ezuikit-flv 1.0.3-beta.2 → 1.0.3-beta.3
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/CHANGELOG.md +2 -0
- package/decoder.js +1 -1
- package/index.js +2 -2
- package/package.json +2 -2
- package/types/player/interface.d.ts +1 -0
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
*
|
|
3
3
|
* EzuikitFlv.js v1.0.3-beta.2
|
|
4
|
-
* Copyright (c) 2025-
|
|
4
|
+
* Copyright (c) 2025-10-29 Ezviz-OpenBiz
|
|
5
5
|
*
|
|
6
6
|
* https://github.com/Ezviz-OpenBiz/EZUIKit-flv
|
|
7
7
|
*
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
* Copyright (c) 2024-7-11 Ezviz-OpenBiz
|
|
28
28
|
* Released under MIT the License.
|
|
29
29
|
*
|
|
30
|
-
*/var Pe,Ue,Fe,Ne,Ve=(Pe="undefined"!=typeof self?self:window,Ue={navigator:void 0!==Pe.navigator?Pe.navigator:{userAgent:""},infoMap:{engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","360","360SE","360EE","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet","iPad"]}},Fe={getMatchMap:function(e){return{Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,Edge:e.indexOf("Edge")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Arora:e.indexOf("Arora")>-1,Lunascape:e.indexOf("Lunascape")>-1,QupZilla:e.indexOf("QupZilla")>-1,"Coc Coc":e.indexOf("coc_coc_browser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,Iceweasel:e.indexOf("Iceweasel")>-1,Konqueror:e.indexOf("Konqueror")>-1,Iceape:e.indexOf("Iceape")>-1,SeaMonkey:e.indexOf("SeaMonkey")>-1,Epiphany:e.indexOf("Epiphany")>-1,360:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1,"360EE":e.indexOf("360EE")>-1,"360SE":e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Nexus 7")>-1,iPad:e.indexOf("iPad")>-1}},matchInfoMap:function(e){var t,i=(null==(t=Ue.navigator)?void 0:t.userAgent)||"",r=Fe.getMatchMap(i);for(var n in Ue.infoMap)for(var o=0;o<Ue.infoMap[n].length;o++){var a=Ue.infoMap[n][o];r[a]&&(e[n]=a)}},getOS:function(){var e=this;return Fe.matchInfoMap(e),null==e?void 0:e.os},getOSVersion:function(){var e=this,t=Ue.navigator.userAgent||"";e.osVersion="";var i={Windows:function(){var e=t.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[e]||e},Android:function(){return t.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return t.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return t.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return t.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return t.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return t.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};return"function"==typeof i[e.os]&&(e.osVersion=i[e.os](),e.osVersion==t&&(e.osVersion="")),e.osVersion},getOrientationStatu:function(){return window.matchMedia("(orientation: portrait)").matches?"vertical":"horizontal"},getDeviceType:function(){var e=this;return e.device="PC",Fe.matchInfoMap(e),e.device},getNetwork:function(){var e,t,i,r;return null==(e=(null==(t=navigator)?void 0:t.connection)||(null==(i=navigator)?void 0:i.mozConnection)||(null==(r=navigator)?void 0:r.webkitConnection))?void 0:e.effectiveType},getLanguage:function(){var e,t,i;return this.language=((i=((null==(e=Ue.navigator)?void 0:e.browserLanguage)||(null==(t=Ue.navigator)?void 0:t.language)).split("-"))[1]&&(i[1]=i[1].toUpperCase()),i.join("_")),this.language},createFingerprint:function(e){var t=document.createElement("canvas"),i=t.getContext("2d"),r=e||window.location.host;i.textBaseline="top",i.font="14px 'Arial'",i.fillStyle="#f60",i.fillRect(125,1,62,20),i.fillStyle="#069",i.fillText(r,2,15),i.fillStyle="rgba(102, 204, 0, 0.7)",i.fillText(r,4,17);var n=t.toDataURL().replace("data:image/png;base64,","");return function(e){var t,i,r,n="";for(t=0,i=(e+="").length;t<i;t++)n+=(r=e.charCodeAt(t).toString(16)).length<2?"0"+r:r;return n}(atob(n).slice(-16,-12))},getBrowserInfo:function(){var e=this;Fe.matchInfoMap(e);var t=Ue.navigator.userAgent||"",i=function(e,t){var i=Ue.navigator.mimeTypes;for(var r in i)if(i[r][e]==t)return!0;return!1},r=Fe.getMatchMap(t),n=!1;if(Pe.chrome){var o=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");+o>36&&Pe.showModalDialog?n=!0:+o>45&&(n=i("type","application/vnd.chromium.remoting-viewer"))}if(r.Baidu&&r.Opera&&(r.Baidu=!1),r.Mobile&&(r.Mobile=!t.includes("iPad")),n&&(i("type","application/gameplugin")||Ue.navigator&&void 0===Ue.navigator.connection.saveData?r["360SE"]=!0:r["360EE"]=!0),r.IE||r.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:case 75:case 105:break;case 102:r["360EE"]=!0;break;case 104:r["360SE"]=!0}var a={Safari:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return t.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return t.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return t.replace(/^.*Edge\/([\d.]+).*$/,"$1")},Firefox:function(){return t.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return t.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return t.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return t.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return t.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return t.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Arora:function(){return t.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return t.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return t.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return t.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return t.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return t.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return t.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return t.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return t.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return t.replace(/^.*QihooBrowser\/([\d.]+).*$/,"$1")},"360SE":function(){return{63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[+t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[+t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return t.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return t.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return t.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return t.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return t.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return t.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},LBBROWSER:function(){return{57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[+navigator.userAgent.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"2345Explorer":function(){return t.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return t.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return t.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return t.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return t.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return t.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},Taobao:function(){return t.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return t.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return t.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return t.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return t.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return t.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};return e.browserVersion="",a[e.browser]&&(e.browserVersion=a[e.browser](),e.browserVersion==t&&(e.browserVersion="")),"Edge"==e.browser&&(e.engine="EdgeHTML"),"Chrome"==e.browser&&parseInt(e.browserVersion)>27&&(e.engine="Blink"),"Opera"==e.browser&&parseInt(e.browserVersion)>12&&(e.engine="Blink"),"Yandex"==e.browser&&(e.engine="Blink"),e.browser+" (version: "+e.browserVersion+"; kernel: "+e.engine+")"}},Ne={DeviceInfoObj:function(e){var t,i=function(t){var i;null==(i=e.info)||i.forEach((function(e){e.toLowerCase()===t.toLowerCase()&&(n[t]=r[t])}))};e=e||{domain:""};var r={deviceType:Fe.getDeviceType(),OS:Fe.getOS(),OSVersion:Fe.getOSVersion(),sh:Pe.screen.height,sw:Pe.screen.width,lang:Fe.getLanguage(),netWork:Fe.getNetwork(),orientation:Fe.getOrientationStatu(),browserInfo:Fe.getBrowserInfo(),fingerprint:Fe.createFingerprint(e.domain),userAgent:null==(t=Ue.navigator)?void 0:t.userAgent};if(!e.info||0===e.info.length)return r;var n={};for(var o in r)i(o);return n}},{getDeviceInfo:function(e){return Ne.DeviceInfoObj(e)}}),Ge=function(){function e(){}return e.add=function(t,i){e.queues.push({url:t,data:i})},e.fire=function(){if(e.queues&&0!==e.queues.length){e.isStop=!1;var t=e.queues[0];t.url&&e.api.report(t.data),e.queues.splice(0,1),e.fire()}else e.isStop=!0},e}();Ge.isStop=!0,Ge.queues=[];var je=function(){function e(e){this.url=e}var t=e.prototype;return t.report=function(e){this.checkUrl(this.url)&&this.sendInfo(e)},t.sendInfo=function(e){navigator.sendBeacon?this.sendBeacon(this.url,e):this.sendImage(this.url,e)},t.sendImage=function(e,t){var i=this.changeJSON2Query(t),r=new Image;r.onload=r.onerror=function(){r=null},r.src=e+"?"+i+"&random="+Math.random()},t.sendBeacon=function(e,t){try{navigator.sendBeacon(e,this.formatParamsByURLSearchParams(t))}catch(e){}},t.formatParamsByURLSearchParams=function(e){var t=new URLSearchParams;for(var i in e)"object"==typeof e[i]&&(e[i]=JSON.stringify(e[i])),t.append(i,e[i]);return t},t.changeJSON2Query=function(e){var t="";for(var i in e){""!=t&&(t+="&");var r=e[i];t+=i+"="+encodeURIComponent("object"==typeof r?JSON.stringify(r):r)}return t},t.checkUrl=function(e){return!!e&&/^[hH][tT][tT][pP]([sS]?):\/\//.test(e)},e}();function $e(){return $e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},$e.apply(this,arguments)}var We=function(){function e(e){this.options=e,this.extendsInfo=e.extendsInfo||{},this.clientInfo=this._getDeviceInfo(),Ge.api=new je(e.url)}var t=e.prototype;return t.send=function(e){return this.options.forbidden||"object"!=typeof e||(this._handleRecordError(e),Ge.isStop&&Ge.fire()),this},t.setForbidden=function(e){this.options.forbidden=e},t.updateExtendsInfo=function(e){void 0===e&&(e={}),this.extendsInfo=$e({},this.extendsInfo||{},e)},t._handleRecordError=function(e){try{var t=this._handleErrorInfo(e);Ge.add(this.options.url,t)}catch(e){}},t._handleErrorInfo=function(e){var t=this._getExtendsInfo(),i=$e({st:(new Date).getTime()},t,e);return i.clientInfo=this.clientInfo,i},t._getExtendsInfo=function(){try{var e,t={},i=this.extendsInfo||{};for(var r in"function"==typeof i.getDynamic&&(e=i.getDynamic()),"[object Object]"===Object.prototype.toString.call(e)&&(i=$e({},i,e)),i)"function"!=typeof i[r]&&(t[r]=i[r]);return t}catch(e){return{}}},t._getDeviceInfo=function(){try{var e=Ve.getDeviceInfo();return JSON.stringify(e)}catch(e){return""}},e}();function Qe(e){if(/http[s]?:\/\/|ws[s]?:\/\//.test(e)){const t=e.split("?")[1],i=t?t.split("&"):[],r={};for(let e=0;e<i.length;++e){const[t,n]=i[e].split("=");r[t]=r[t]||decodeURIComponent(n)}try{const t=e.split(".flv")[0].split("/"),i=t[t.length-1].split("_");t.length>0&&i[0]&&i[1]&&i[2]&&(r.serial=i[0],r.no=i[1],r.bitstream=i[2])}catch(e){}return r}return{}}class ze{static initMonitor(e){ze.collect=new We({forbidden:e,url:"https://log.ys7.com/statistics.do/opensdk_ezuikit",jsError:!1,promiseError:!1,resourceError:!1,extendsInfo:{protocol:"flv",v:"1.0.3-beta.2"}})}static report(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ze.collect||ze.initMonitor();try{const i=Qe(ze.url);ze.collect.send({url:ze.url,serial:i.serial,no:i.no,action:e,logInfo:t})}catch(e){}}}class He extends Me{constructor(e,t){super(e,t,ce),this._opt.useMSE=!1,this._loadingTimeoutDelayTimer=null,this._opt.hasAudio&&(this.audio=new he(this)),this.decoderWorker=new fe(this),this.stream=null,this.demux=null,this._lastVolume=null,J()&&(this.keepScreenOn=new Se(this)),this._opt.hasAudio&&this._opt.volume>0&&!this._opt.isMute&&(this.volume=this._opt.volume)}destroy(){this._loading=!1,this._playing=!1,this._hasLoaded=!1,this._lastVolume=null,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this.decoderWorker&&(this.decoderWorker.destroy(),this.decoderWorker=null),this.video&&(this.video.destroy(),this.video=null),this.audio&&(this.audio.destroy(),this.audio=null),this.stream&&(this.stream.destroy(),this.stream=null),this.demux&&(this.demux.destroy(),this.demux=null),this.events&&(this.events.destroy(),this.events=null),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.clearStatsInterval(),this.releaseWakeLock(),this.keepScreenOn=null,this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,this.emit("destroy"),this.off(),this.debug.log("play","destroy end")}set loaded(e){this._hasLoaded=e}get loaded(){return this._hasLoaded}set playing(e){e&&(this.loading=!1),this.playing!==e&&(this._playing=e,this.emit(D.playing,e),this.emit(D.volumechange,this.volume),e?this.emit(D.play):this.emit(D.pause))}get playing(){return this._playing}get volume(){var e;return+((null===(e=this.audio)||void 0===e?void 0:e.volume)||0).toFixed(2)||0}set volume(e){var t;e!==this.volume&&(null===(t=this.audio)||void 0===t||t.setVolume(e),this._lastVolume=e)}get lastVolume(){return this._lastVolume}set loading(e){this.loading!==e&&(this._loading=e,this.emit(D.loading,this._loading),e||this.emit(D.loaded))}get loading(){return this._loading}set audioTimestamp(e){null!==e&&(this._audioTimestamp=e)}get audioTimestamp(){return this._audioTimestamp}set videoTimestamp(e){null!==e&&(this._videoTimestamp=e,this._opt.useWCS||this._opt.useMSE||this.audioTimestamp&&this.videoTimestamp&&this.audio&&this.audio.emit(D.videoSyncAudio,{audioTimestamp:this.audioTimestamp,videoTimestamp:this.videoTimestamp,diff:this.audioTimestamp-this.videoTimestamp}))}get videoTimestamp(){return this._videoTimestamp}get isDebug(){return!0===this._opt.debug}_init(){return new Promise(((e,t)=>{this.stream||(this.stream=new pe(this)),this.audio||this._opt.hasAudio&&(this.audio=new he(this)),this.demux||(this.demux=new ge(this)),this.decoderWorker?e():(this.decoderWorker=new fe(this),this.once(D.decoderWorkerInit,(()=>{e()})))}))}play(e){return this._opt=Object.assign({},this._opt,e||{}),this.clearCheckHeartTimeout(),new Promise(((e,t)=>{if(!this._opt.url)return t();this.loading=!0,this.playing=!1,this._times.playInitStart=X(),this._init().then((()=>{this._times.playStart=X(),this._opt.isMute||this.mute(!1),this.enableWakeLock();try{this.stream.fetchStream(this._opt.url,this._opt)}catch(e){}this.checkLoadingTimeout(),this.stream.once(D.streamError,(e=>{this.stream&&(this.stream.destroy(),this.stream=null),this.clearCheckLoadingTimeout(),this.emit(D.streamError,e),this.emit(D.delayTimeout),t(e)})),this.stream.once(D.streamEnd,(()=>{t()})),this.stream.once(D.streamSuccess,(()=>{this.clearCheckLoadingTimeout(),this.emit(D.streamSuccess),e(),this._times.streamResponse=X(),this.video.play(),this.checkStatsInterval()}))})).catch((e=>{t(e)})),this._resumeAudioAfterPause()}))}close(){return new Promise((e=>{this._close().then((()=>{var t,i;null===(t=this.video)||void 0===t||null===(i=t.clearView)||void 0===i||i.call(t),e()}))}))}_resumeAudioAfterPause(){this.lastVolume&&(this.volume=this.lastVolume)}_close(){return new Promise((e=>{this._loadingTimeoutDelayTimer&&(clearTimeout(this._loadingTimeoutDelayTimer),this._loadingTimeoutDelayTimer=null),this.stream&&(this.stream.destroy(),this.stream=null),this.demux&&(this.demux.destroy(),this.demux=null),this.decoderWorker&&(this.decoderWorker.destroy(),this.decoderWorker=null),this.audio&&(this.audio.destroy(),this.audio=null),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.clearStatsInterval(),this.playing=!1,this.loading=!1,this.video&&(this.video.resetInit(),this.video.pause(!0)),this.releaseWakeLock(),this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},setTimeout((()=>{e()}),0)}))}pause(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.close():this._close()}mute(e){var t;null===(t=this.audio)||void 0===t||t.mute(e)}_onlyMseOrWcsVideo(){return!1===this._opt.hasAudio&&(this._opt.useMSE||this._opt.useWCS&&!this._opt.useOffscreen)}checkHeart(){this.clearCheckHeartTimeout(),this.checkHeartTimeout()}checkHeartTimeout(){}checkStatsInterval(){this._checkStatsInterval=setInterval((()=>{this.updateStats()}),1e3)}clearCheckHeartTimeout(){this._checkHeartTimeout&&(clearTimeout(this._checkHeartTimeout),this._checkHeartTimeout=null)}checkLoadingTimeout(){this._checkLoadingTimeout=setTimeout((()=>{this.playing||(this.clearCheckLoadingTimeout(),this.pause().then((()=>{this.emit(D.timeout,D.loadingTimeout),this.emit(D.loadingTimeout)})).catch((()=>{})))}),1e3*this._opt.loadingTimeout)}clearCheckLoadingTimeout(){this._checkLoadingTimeout&&(clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}clearStatsInterval(){this._checkStatsInterval&&(clearInterval(this._checkStatsInterval),this._checkStatsInterval=null)}handleRender(){this.loading&&(this.emit(D.start),this.loading=!1),this.clearCheckLoadingTimeout(),this.playing||(this.playing=!0),this.checkHeart()}updateStats(e){e=e||{},this._startBpsTime||(this._startBpsTime=X()),ee(e.ts)&&(this._stats.ts=e.ts),ee(e.buf)&&(this._stats.buf=e.buf),e.fps&&(this._stats.fps+=1),e.abps&&(this._stats.abps+=e.abps),e.vbps&&(this._stats.vbps+=e.vbps);const t=X();t-this._startBpsTime<1e3||(this.emit(D.stats,this._stats),this._stats.fps=0,this._stats.abps=0,this._stats.vbps=0,this._startBpsTime=t)}resetStats(){this._startBpsTime=null,this._stats={buf:0,fps:0,abps:0,vbps:0,ts:0}}enableWakeLock(){this._opt.keepScreenOn&&this.keepScreenOn&&this.keepScreenOn.enable()}releaseWakeLock(){this._opt.keepScreenOn&&this.keepScreenOn&&this.keepScreenOn.disable()}handlePlayToRenderTimes(){const e=this._times;e.playTimestamp=e.playStart-e.playInitStart,e.streamTimestamp=e.streamStart-e.playStart,e.streamResponseTimestamp=e.streamResponse-e.streamStart,e.demuxTimestamp=e.demuxStart-e.streamResponse,e.decodeTimestamp=e.decodeStart-e.demuxStart,e.videoTimestamp=e.videoStart-e.decodeStart,e.allTimestamp=e.videoStart-e.playInitStart,this.emit(D.playToRenderTimes,e)}getOption(){return this._opt}emitError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";ze.report(51,{event:e,value:t}),this.emit(D.error,e,t),this.emit(e,t)}}var qe,Ye={exports:{}};var Xe=(qe||(qe=1,function(e,t){!function(t,i){e.exports=i()}(self,(()=>(()=>{var e={62:(e,t,i)=>{var r=i(1465)("span").classList,n=r&&r.constructor&&r.constructor.prototype;e.exports=n===Object.prototype?void 0:n},63:(e,t,i)=>{var r=i(4152);e.exports=function(e){return r(e)||null===e}},115:(e,t,i)=>{var r=i(815),n=i(4152),o=i(5727),a=i(452),s=i(6908),l=i(7553),d=TypeError,c=l("toPrimitive");e.exports=function(e,t){if(!n(e)||o(e))return e;var i,l=a(e,c);if(l){if(void 0===t&&(t="default"),i=r(l,e,t),!n(i)||o(i))return i;throw new d("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},219:(e,t,i)=>{var r=i(2719),n=i(7024),o=i(256),a=function(e){return function(t,i,a){var s=r(t),l=o(s);if(0===l)return!e&&-1;var d,c=n(a,l);if(e&&i!=i){for(;l>c;)if((d=s[c++])!=d)return!0}else for(;l>c;c++)if((e||c in s)&&s[c]===i)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},256:(e,t,i)=>{var r=i(2420);e.exports=function(e){return r(e.length)}},279:(e,t,i)=>{var r=i(815),n=i(5736),o=i(7749),a=i(4985),s=i(9273),l=TypeError;e.exports=function(e,t){var i=arguments.length<2?s(e):t;if(n(i))return o(r(i,e));throw new l(a(e)+" is not iterable")}},309:(e,t,i)=>{var r=i(9922),n=i(497);e.exports=r?{}.toString:function(){return"[object "+n(this)+"]"}},452:(e,t,i)=>{var r=i(5736),n=i(5599);e.exports=function(e,t){var i=e[t];return n(i)?void 0:r(i)}},458:(e,t,i)=>{var r=i(526),n=i(6458);e.exports=function(e){if("Function"===r(e))return n(e)}},497:(e,t,i)=>{var r=i(9922),n=i(9211),o=i(526),a=i(7553)("toStringTag"),s=Object,l="Arguments"===o(function(){return arguments}());e.exports=r?o:function(e){var t,i,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?i:l?o(t):"Object"===(r=o(t))&&n(t.callee)?"Arguments":r}},526:(e,t,i)=>{var r=i(6458),n=r({}.toString),o=r("".slice);e.exports=function(e){return o(n(e),8,-1)}},550:(e,t,i)=>{i.d(t,{A:()=>r});const r={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},577:(e,t,i)=>{var r=i(3463),n=i(1002),o=r("keys");e.exports=function(e){return o[e]||(o[e]=n(e))}},594:e=>{var t=TypeError;e.exports=function(e,i){if(e<i)throw new t("Not enough arguments");return e}},605:(e,t,i)=>{var r=i(7553);t.f=r},648:(e,t,i)=>{i(2578),i(4579);var r=i(9364),n=i(1562),o=i(2363),a=i(5057),s=i(815),l=i(6458),d=i(9646),c=i(6666),u=i(3930),h=i(1176),A=i(8873),p=i(1541),f=i(7712),_=i(3587),m=i(2757),v=i(9211),g=i(4347),y=i(7042),b=i(497),S=i(7749),E=i(4152),w=i(6677),T=i(6122),k=i(6330),R=i(279),O=i(9273),C=i(1567),B=i(594),x=i(7553),I=i(986),L=x("iterator"),D="URLSearchParams",M=D+"Iterator",P=_.set,U=_.getterFor(D),F=_.getterFor(M),N=o("fetch"),V=o("Request"),G=o("Headers"),j=V&&V.prototype,$=G&&G.prototype,W=n.TypeError,Q=n.encodeURIComponent,z=String.fromCharCode,H=a("String","fromCodePoint"),q=parseInt,Y=l("".charAt),X=l([].join),Z=l([].push),K=l("".replace),J=l([].shift),ee=l([].splice),te=l("".split),ie=l("".slice),re=l(/./.exec),ne=/\+/g,oe=/^[0-9a-f]+$/i,ae=function(e,t){var i=ie(e,t,t+2);return re(oe,i)?q(i,16):NaN},se=function(e){for(var t=0,i=128;i>0&&e&i;i>>=1)t++;return t},le=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},de=function(e){for(var t=(e=K(e,ne," ")).length,i="",r=0;r<t;){var n=Y(e,r);if("%"===n){if("%"===Y(e,r+1)||r+3>t){i+="%",r++;continue}var o=ae(e,r+1);if(o!=o){i+=n,r++;continue}r+=2;var a=se(o);if(0===a)n=z(o);else{if(1===a||a>4){i+="�",r++;continue}for(var s=[o],l=1;l<a&&!(3+ ++r>t||"%"!==Y(e,r));){var d=ae(e,r+1);if(d!=d){r+=3;break}if(d>191||d<128)break;Z(s,d),r+=2,l++}if(s.length!==a){i+="�";continue}var c=le(s);null===c?i+="�":n=H(c)}}i+=n,r++}return i},ce=/[!'()~]|%20/g,ue={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},he=function(e){return ue[e]},Ae=function(e){return K(Q(e),ce,he)},pe=f((function(e,t){P(this,{type:M,target:U(e).entries,index:0,kind:t})}),D,(function(){var e=F(this),t=e.target,i=e.index++;if(!t||i>=t.length)return e.target=null,C(void 0,!0);var r=t[i];switch(e.kind){case"keys":return C(r.key,!1);case"values":return C(r.value,!1)}return C([r.key,r.value],!1)}),!0),fe=function(e){this.entries=[],this.url=null,void 0!==e&&(E(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Y(e,0)?ie(e,1):e:w(e)))};fe.prototype={type:D,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,i,r,n,o,a,l,d=this.entries,c=O(e);if(c)for(i=(t=R(e,c)).next;!(r=s(i,t)).done;){if(o=(n=R(S(r.value))).next,(a=s(o,n)).done||(l=s(o,n)).done||!s(o,n).done)throw new W("Expected sequence with length 2");Z(d,{key:w(a.value),value:w(l.value)})}else for(var u in e)g(e,u)&&Z(d,{key:u,value:w(e[u])})},parseQuery:function(e){if(e)for(var t,i,r=this.entries,n=te(e,"&"),o=0;o<n.length;)(t=n[o++]).length&&(i=te(t,"="),Z(r,{key:de(J(i)),value:de(X(i,"="))}))},serialize:function(){for(var e,t=this.entries,i=[],r=0;r<t.length;)e=t[r++],Z(i,Ae(e.key)+"="+Ae(e.value));return X(i,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var _e=function(){m(this,me);var e=P(this,new fe(arguments.length>0?arguments[0]:void 0));d||(this.size=e.entries.length)},me=_e.prototype;if(A(me,{append:function(e,t){var i=U(this);B(arguments.length,2),Z(i.entries,{key:w(e),value:w(t)}),d||this.length++,i.updateURL()},delete:function(e){for(var t=U(this),i=B(arguments.length,1),r=t.entries,n=w(e),o=i<2?void 0:arguments[1],a=void 0===o?o:w(o),s=0;s<r.length;){var l=r[s];if(l.key!==n||void 0!==a&&l.value!==a)s++;else if(ee(r,s,1),void 0!==a)break}d||(this.size=r.length),t.updateURL()},get:function(e){var t=U(this).entries;B(arguments.length,1);for(var i=w(e),r=0;r<t.length;r++)if(t[r].key===i)return t[r].value;return null},getAll:function(e){var t=U(this).entries;B(arguments.length,1);for(var i=w(e),r=[],n=0;n<t.length;n++)t[n].key===i&&Z(r,t[n].value);return r},has:function(e){for(var t=U(this).entries,i=B(arguments.length,1),r=w(e),n=i<2?void 0:arguments[1],o=void 0===n?n:w(n),a=0;a<t.length;){var s=t[a++];if(s.key===r&&(void 0===o||s.value===o))return!0}return!1},set:function(e,t){var i=U(this);B(arguments.length,1);for(var r,n=i.entries,o=!1,a=w(e),s=w(t),l=0;l<n.length;l++)(r=n[l]).key===a&&(o?ee(n,l--,1):(o=!0,r.value=s));o||Z(n,{key:a,value:s}),d||(this.size=n.length),i.updateURL()},sort:function(){var e=U(this);I(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,i=U(this).entries,r=y(e,arguments.length>1?arguments[1]:void 0),n=0;n<i.length;)r((t=i[n++]).value,t.key,this)},keys:function(){return new pe(this,"keys")},values:function(){return new pe(this,"values")},entries:function(){return new pe(this,"entries")}},{enumerable:!0}),u(me,L,me.entries,{name:"entries"}),u(me,"toString",(function(){return U(this).serialize()}),{enumerable:!0}),d&&h(me,"size",{get:function(){return U(this).entries.length},configurable:!0,enumerable:!0}),p(_e,D),r({global:!0,constructor:!0,forced:!c},{URLSearchParams:_e}),!c&&v(G)){var ve=l($.has),ge=l($.set),ye=function(e){if(E(e)){var t,i=e.body;if(b(i)===D)return t=e.headers?new G(e.headers):new G,ve(t,"content-type")||ge(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),T(e,{body:k(0,w(i)),headers:k(0,t)})}return e};if(v(N)&&r({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return N(e,arguments.length>1?ye(arguments[1]):{})}}),v(V)){var be=function(e){return m(this,j),new V(e,arguments.length>1?ye(arguments[1]):{})};j.constructor=be,be.prototype=j,r({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:be})}}e.exports={URLSearchParams:_e,getState:U}},719:(e,t,i)=>{i.d(t,{A:()=>r});const r=function(){function e(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return e.prototype.isComplete=function(){return!this.hasAudio||this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&this.audioChannelCount,!this.hasVideo||this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&this.sarDen,null!=this.mimeType},e.prototype.isSeekable=function(){return this.hasKeyframesIndex},e.prototype.getNearestKeyframe=function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,i=this._search(t.times,e);return{index:i,milliseconds:t.times[i],fileposition:t.filepositions[i]}},e.prototype._search=function(e,t){var i=0,r=e.length-1,n=0,o=0,a=r;for(t<e[0]&&(i=0,o=a+1);o<=a;){if((n=o+Math.floor((a-o)/2))===r||t>=e[n]&&t<e[n+1]){i=n;break}e[n]<t?o=n+1:a=n-1}return i},e}()},730:(e,t,i)=>{var r=i(9364),n=i(815);r({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return n(URL.prototype.toString,this)}})},775:(e,t,i)=>{var r=i(9845),n=i(1562),o=i(4191),a="__core-js_shared__",s=e.exports=n[a]||o(a,{});(s.versions||(s.versions=[])).push({version:"3.40.0",mode:r?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.40.0/LICENSE",source:"https://github.com/zloirock/core-js"})},778:(e,t,i)=>{i(4220)},804:(e,t,i)=>{var r=i(9364),n=i(5057),o=i(4347),a=i(6677),s=i(3463),l=i(9266),d=s("string-to-symbol-registry"),c=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=a(e);if(o(d,t))return d[t];var i=n("Symbol")(t);return d[t]=i,c[i]=t,i}})},815:(e,t,i)=>{var r=i(6898),n=Function.prototype.call;e.exports=r?n.bind(n):function(){return n.apply(n,arguments)}},834:(e,t,i)=>{i(6383)},947:(e,t,i)=>{var r=i(9364),n=i(7917),o=i(2809),a=i(7819),s=i(9083);r({target:"Object",stat:!0,forced:!n||o((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(s(e)):[]}})},986:(e,t,i)=>{var r=i(8626),n=Math.floor,o=function(e,t){var i=e.length;if(i<8)for(var a,s,l=1;l<i;){for(s=l,a=e[l];s&&t(e[s-1],a)>0;)e[s]=e[--s];s!==l++&&(e[s]=a)}else for(var d=n(i/2),c=o(r(e,0,d),t),u=o(r(e,d),t),h=c.length,A=u.length,p=0,f=0;p<h||f<A;)e[p+f]=p<h&&f<A?t(c[p],u[f])<=0?c[p++]:u[f++]:p<h?c[p++]:u[f++];return e};e.exports=o},1002:(e,t,i)=>{var r=i(6458),n=0,o=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++n+o,36)}},1031:(e,t,i)=>{var r=i(7553),n=i(6122),o=i(3643).f,a=r("unscopables"),s=Array.prototype;void 0===s[a]&&o(s,a,{configurable:!0,value:n(null)}),e.exports=function(e){s[a][e]=!0}},1068:(e,t,i)=>{var r=i(63),n=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw new o("Can't set "+n(e)+" as a prototype")}},1144:(e,t,i)=>{var r=i(815),n=i(4347),o=i(9615),a=i(7677),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||n(e,"flags")||!o(s,e)?t:r(a,e)}},1147:(e,t,i)=>{var r,n,o,a=i(2809),s=i(9211),l=i(4152),d=i(6122),c=i(8125),u=i(3930),h=i(7553),A=i(9845),p=h("iterator"),f=!1;[].keys&&("next"in(o=[].keys())?(n=c(c(o)))!==Object.prototype&&(r=n):f=!0),!l(r)||a((function(){var e={};return r[p].call(e)!==e}))?r={}:A&&(r=d(r)),s(r[p])||u(r,p,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:f}},1176:(e,t,i)=>{var r=i(4233),n=i(3643);e.exports=function(e,t,i){return i.get&&r(i.get,t,{getter:!0}),i.set&&r(i.set,t,{setter:!0}),n.f(e,t,i)}},1209:(e,t,i)=>{var r=i(5057),n=i(6458),o=i(2630),a=i(7819),s=i(7749),l=n([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(s(e)),i=a.f;return i?l(t,i(e)):t}},1432:(e,t,i)=>{var r=i(6458),n=i(5736);e.exports=function(e,t,i){try{return r(n(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(e){}}},1454:(e,t,i)=>{i(648)},1464:(e,t,i)=>{var r=i(9364),n=i(4979).map;r({target:"Array",proto:!0,forced:!i(8611)("map")},{map:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}})},1465:(e,t,i)=>{var r=i(1562),n=i(4152),o=r.document,a=n(o)&&n(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},1541:(e,t,i)=>{var r=i(3643).f,n=i(4347),o=i(7553)("toStringTag");e.exports=function(e,t,i){e&&!i&&(e=e.prototype),e&&!n(e,o)&&r(e,o,{configurable:!0,value:t})}},1562:function(e){var t=function(e){return e&&e.Math===Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof r&&r)||t("object"==typeof this&&this)||function(){return this}()||Function("return this")()},1567:e=>{e.exports=function(e,t){return{value:e,done:t}}},1684:(e,t,i)=>{var r=i(5736),n=i(9083),o=i(5273),a=i(256),s=TypeError,l="Reduce of empty array with no initial value",d=function(e){return function(t,i,d,c){var u=n(t),h=o(u),A=a(u);if(r(i),0===A&&d<2)throw new s(l);var p=e?A-1:0,f=e?-1:1;if(d<2)for(;;){if(p in h){c=h[p],p+=f;break}if(p+=f,e?p<0:A<=p)throw new s(l)}for(;e?p>=0:A>p;p+=f)p in h&&(c=i(c,h[p],p,u));return c}};e.exports={left:d(!1),right:d(!0)}},1766:(e,t,i)=>{var r=i(9364),n=i(4347),o=i(5727),a=i(4985),s=i(3463),l=i(9266),d=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!l},{keyFor:function(e){if(!o(e))throw new TypeError(a(e)+" is not a symbol");if(n(d,e))return d[e]}})},1900:(e,t,i)=>{e.exports=i(2632).default},1951:(e,t,i)=>{i.d(t,{$_:()=>r,EX:()=>o,EZ:()=>n,Sc:()=>a});var r=function(e,t,i,r,n){this.dts=e,this.pts=t,this.duration=i,this.originalDts=r,this.isSyncPoint=n,this.fileposition=null},n=function(){function e(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return e.prototype.appendSyncPoint=function(e){e.isSyncPoint=!0,this.syncPoints.push(e)},e}(),o=function(){function e(){this._list=[]}return e.prototype.clear=function(){this._list=[]},e.prototype.appendArray=function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))},e.prototype.getLastSyncPointBeforeDts=function(e){if(0===this._list.length)return null;var t=this._list,i=0,r=t.length-1,n=0,o=0,a=r;for(e<t[0].dts&&(i=0,o=a+1);o<=a;){if((n=o+Math.floor((a-o)/2))===r||e>=t[n].dts&&e<t[n+1].dts){i=n;break}t[n].dts<e?o=n+1:a=n-1}return this._list[i]},e}(),a=function(){function e(e){this._type=e,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),e.prototype.isEmpty=function(){return 0===this._list.length},e.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},e.prototype._searchNearestSegmentBefore=function(e){var t,i=this._list;if(0===i.length)return-2;var r=i.length-1,n=0,o=0,a=r,s=0;if(e<i[0].originalBeginDts)return-1;for(;o<=a;){if((n=o+Math.floor((a-o)/2))===r||e>((null===(t=i[n].lastSample)||void 0===t?void 0:t.originalDts)||0)&&e<i[n+1].originalBeginDts){s=n;break}i[n].originalBeginDts<e?o=n+1:a=n-1}return s},e.prototype._searchNearestSegmentAfter=function(e){return this._searchNearestSegmentBefore(e)+1},e.prototype.append=function(e){var t,i,r=this._list,n=e,o=this._lastAppendLocation,a=0;-1!==o&&o<r.length&&n.originalBeginDts>=((null===(i=null===(t=r[o])||void 0===t?void 0:t.lastSample)||void 0===i?void 0:i.originalDts)||0)&&(o===r.length-1||o<r.length-1&&n.originalBeginDts<r[o+1].originalBeginDts)?a=o+1:r.length>0&&(a=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=a,this._list.splice(a,0,n)},e.prototype.getLastSegmentBefore=function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null},e.prototype.getLastSampleBefore=function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null},e.prototype.getLastSyncPointBefore=function(e){for(var t=this._searchNearestSegmentBefore(e),i=this._list[t].syncPoints;0===i.length&&t>0;)t--,i=this._list[t].syncPoints;return i.length>0?i[i.length-1]:null},e}()},2139:(e,t,i)=>{i.d(t,{A:()=>r});const r=i(5307)},2250:(e,t,i)=>{var r=i(6458),n=i(3930),o=Date.prototype,a="Invalid Date",s="toString",l=r(o[s]),d=r(o.getTime);String(new Date(NaN))!==a&&n(o,s,(function(){var e=d(this);return e==e?l(this):a}))},2327:e=>{e.exports={}},2363:(e,t,i)=>{var r=i(1562),n=i(9646),o=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!n)return r[e];var t=o(r,e);return t&&t.value}},2377:(e,t,i)=>{var r=i(4979).forEach,n=i(5888)("forEach");e.exports=n?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},2382:(e,t,i)=>{var r=i(9364),n=i(815),o=i(9845),a=i(6656),s=i(9211),l=i(7712),d=i(8125),c=i(6641),u=i(1541),h=i(9277),A=i(3930),p=i(7553),f=i(2327),_=i(1147),m=a.PROPER,v=a.CONFIGURABLE,g=_.IteratorPrototype,y=_.BUGGY_SAFARI_ITERATORS,b=p("iterator"),S="keys",E="values",w="entries",T=function(){return this};e.exports=function(e,t,i,a,p,_,k){l(i,t,a);var R,O,C,B=function(e){if(e===p&&M)return M;if(!y&&e&&e in L)return L[e];switch(e){case S:case E:case w:return function(){return new i(this,e)}}return function(){return new i(this)}},x=t+" Iterator",I=!1,L=e.prototype,D=L[b]||L["@@iterator"]||p&&L[p],M=!y&&D||B(p),P="Array"===t&&L.entries||D;if(P&&(R=d(P.call(new e)))!==Object.prototype&&R.next&&(o||d(R)===g||(c?c(R,g):s(R[b])||A(R,b,T)),u(R,x,!0,!0),o&&(f[x]=T)),m&&p===E&&D&&D.name!==E&&(!o&&v?h(L,"name",E):(I=!0,M=function(){return n(D,this)})),p)if(O={values:B(E),keys:_?M:B(S),entries:B(w)},k)for(C in O)(y||I||!(C in L))&&A(L,C,O[C]);else r({target:t,proto:!0,forced:y||I},O);return o&&!k||L[b]===M||A(L,b,M,{name:p}),f[t]=M,O}},2420:(e,t,i)=>{var r=i(4685),n=Math.min;e.exports=function(e){var t=r(e);return t>0?n(t,9007199254740991):0}},2460:(e,t,i)=>{i.d(t,{A:()=>n});var r=i(2139);const n=function(){function e(){}return e.e=function(t,i){var r;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(r=e.emitter)||void 0===r||r.emit("log","error",n)),e.ENABLE_ERROR&&(console.error?console.error(n):console.warn?console.warn(n):console.log(n))},e.i=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&e.emitter.emit("log","info",r),e.ENABLE_INFO&&(console.info?console.info(r):console.log(r))},e.w=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",r),e.ENABLE_WARN&&(console.warn?console.warn(r):console.log(r))},e.d=function(t,i){var r;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(r=e.emitter)||void 0===r||r.emit("log","debug",n)),e.ENABLE_DEBUG&&(console.debug?console.debug(n):console.log(n))},e.v=function(t,i){var r;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(r=e.emitter)||void 0===r||r.emit("log","verbose",n)),e.ENABLE_VERBOSE&&console.log(n)},e.FORCE_GLOBAL_TAG=!1,e.GLOBAL_TAG="ezuikit-flv",e.ENABLE_CALLBACK=!1,e.emitter=new r.A,e.ENABLE_ERROR=!0,e.ENABLE_INFO=!0,e.ENABLE_WARN=!0,e.ENABLE_DEBUG=!0,e.ENABLE_VERBOSE=!0,e}()},2578:(e,t,i)=>{var r=i(2719),n=i(1031),o=i(2327),a=i(3587),s=i(3643).f,l=i(2382),d=i(1567),c=i(9845),u=i(9646),h="Array Iterator",A=a.set,p=a.getterFor(h);e.exports=l(Array,"Array",(function(e,t){A(this,{type:h,target:r(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,i=e.index++;if(!t||i>=t.length)return e.target=null,d(void 0,!0);switch(e.kind){case"keys":return d(i,!1);case"values":return d(t[i],!1)}return d([i,t[i]],!1)}),"values");var f=o.Arguments=o.Array;if(n("keys"),n("values"),n("entries"),!c&&u&&"values"!==f.name)try{s(f,"name",{value:"values"})}catch(e){}},2630:(e,t,i)=>{var r=i(3430),n=i(6853).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,n)}},2632:(e,t,i)=>{i.d(t,{default:()=>N});var r={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32},n=i(8098),o={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,liveBufferLatencyChasing:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0,url:void 0,redirectedURL:void 0,cors:!1};function a(){return Object.assign({},o)}var s=function(){function e(){}return e.supportMSEH264Playback=function(){var e;return null===(e=window.MediaSource)||void 0===e?void 0:e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},e.supportMSEH265Playback=function(){var e;return null===(e=window.MediaSource)||void 0===e?void 0:e.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')},e.supportNetworkStreamIO=function(){var e=new n.A({},a()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"===t||"xhr-moz-chunked-loader"===t},e.getNetworkLoaderTypeName=function(){var e=new n.A({},a()),t=e.loaderType;return e.destroy(),t},e.supportNativeMediaPlayback=function(t){void 0===e.videoElement&&(e.videoElement=window.document.createElement("video"));var i=e.videoElement.canPlayType(t);return"probably"===i||"maybe"===i},e.getFeatureList=function(){var t={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.msePlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName()||"",t.mseLivePlayback=t.msePlayback&&t.networkStreamIO,t.mseH265Playback=e.supportMSEH265Playback(),t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeMP4H265Playback=e.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t},e}();const l=s;var d=i(9034),c=i(2139),u=i(2460),h=i(8870);const A={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",DESTROYING:"destroying"};i(6041),i(8845),i(6815),i(9688),i(5758),i(5347),i(2578),i(5336),i(1464),i(4742),i(2250),i(6033),i(3813),i(4659),i(3074),i(9917),i(3478),i(5597),i(6263),i(6810),i(6728),i(7958),i(834),i(8862),i(4879),i(778),i(730),i(1454);var p=function(){var e=ENTRY_MODULE,t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={exports:{}};return e[r](n,n.exports,i),n.exports}i.m=e,i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.g=function(){if("[object Object]"===Object.prototype.toString.call(globalThis))return globalThis;try{return this||new Function("return this")()}catch(e){if("[object Object]"===Object.prototype.toString.call(window))return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r=i(ENTRY_MODULE);return r.default||r},f="[\\.|\\-|\\+|\\w|/|@]+",_="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+f+").*?\\)";function m(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function v(e,t,r){var n={};n[r]=[];var o,a=t.toString(),s=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||a.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!s)return n;for(var l,d=s[1],c=new RegExp("(\\\\n|\\W)"+m(d)+_,"g");l=c.exec(a);)"dll-reference"!==l[3]&&n[r].push(l[3]);for(c=new RegExp("\\("+m(d)+'\\("(dll-reference\\s('+f+'))"\\)\\)'+_,"g");l=c.exec(a);)e[l[2]]||(n[r].push(l[1]),e[l[2]]=i(l[1]).m),n[l[2]]=n[l[2]]||[],n[l[2]].push(l[4]);for(var u=Object.keys(n),h=0;h<u.length;h++)for(var A=0;A<n[u[h]].length;A++)o=n[u[h]][A],!isNaN(1*o)&&(n[u[h]][A]=1*n[u[h]][A]);return n}function g(e){return Object.keys(e).reduce((function(t,i){return t||e[i].length>0}),!1)}function y(e,t,i,r){var n=e[r].map((function(e){return'"'.concat(e,'": ').concat(t[r][e].toString())})).join(","),o=p.toString().split("ENTRY_MODULE");return"".concat(o[0],"{").concat(n,"}").concat(o[1],'"').concat(i,'"').concat(o[2])}var b=i(8635),S=i(9953),E=i(550),w=i(719);const T=function(){function e(e,t){if(this.TAG="Transmuxer",this._workerDestroying=!1,this._controller=null,this._emitter=new c.A,t.enableWorker&&"undefined"!=typeof Worker)try{this._worker=this._worker=function(e,t){t=t||{};var r={main:i.m},n=t.all?{main:Object.keys(r.main)}:function(e,t){for(var i={main:[7477]},r={main:[]},n={main:{}};g(i);)for(var o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],l=i[s].pop();if(n[s]=n[s]||{},!n[s][l]&&e[s][l]){n[s][l]=!0,r[s]=r[s]||[],r[s].push(l);for(var d=v(e,e[s][l],s),c=Object.keys(d),u=0;u<c.length;u++)i[c[u]]=i[c[u]]||[],i[c[u]]=i[c[u]].concat(d[c[u]])}}return r}(r),o="";Object.keys(n).filter((function(e){return"main"!==e})).forEach((function(e){for(var t=0;n[e][t];)t++;n[e].push(t),r[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o+="var ".concat(e," = (").concat(y(n,r,t,modules),")();\n")})),o+="(".concat(y(n,r,7477,"main"),")();");var a=new window.Blob([o],{type:"text/javascript"});if(t.bare)return a;var s=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(a),l=new window.Worker(s);return l.objectURL=s,l}(),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},b.A.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:b.A.getConfig()})}catch(i){u.A.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new S.A(e,t)}else this._controller=new S.A(e,t);if(this._controller){var r=this._controller;null==r||r.on(E.A.IO_ERROR,this._onIOError.bind(this)),null==r||r.on(E.A.DEMUX_ERROR,this._onDemuxError.bind(this)),null==r||r.on(E.A.INIT_SEGMENT,this._onInitSegment.bind(this)),null==r||r.on(E.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),null==r||r.on(E.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),null==r||r.on(E.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),null==r||r.on(E.A.MEDIA_INFO,this._onMediaInfo.bind(this)),null==r||r.on(E.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),null==r||r.on(E.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),null==r||r.on(E.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),null==r||r.on(E.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),null==r||r.on(E.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),null==r||r.on(E.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),null==r||r.on(E.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),null==r||r.on(E.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),null==r||r.on(E.A.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){var e;this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"transmuxing-worker destroy"}),b.A.removeListener(this.e.onLoggingConfigChanged),this.e=null):(null===(e=this._controller)||void 0===e||e.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.hasWorker=function(){return null!=this._worker},e.prototype.open=function(){var e;this._worker?this._worker.postMessage({cmd:"start"}):null===(e=this._controller)||void 0===e||e.start()},e.prototype.close=function(){var e;this._worker?this._worker.postMessage({cmd:"stop"}):null===(e=this._controller)||void 0===e||e.stop()},e.prototype.seek=function(e){var t;this._worker?this._worker.postMessage({cmd:"seek",param:e}):null===(t=this._controller)||void 0===t||t.seek(e)},e.prototype.pause=function(){var e;this._worker?this._worker.postMessage({cmd:"pause"}):null===(e=this._controller)||void 0===e||e.pause()},e.prototype.resume=function(){var e;this._worker?this._worker.postMessage({cmd:"resume"}):null===(e=this._controller)||void 0===e||e.resume()},e.prototype._onInitSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(E.A.INIT_SEGMENT,e,t)}))},e.prototype._onMediaSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(E.A.MEDIA_SEGMENT,e,t)}))},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(E.A.LOADING_COMPLETE)}))},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(E.A.RECOVERED_EARLY_EOF)}))},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.MEDIA_INFO,e)}))},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.METADATA_ARRIVED,e)}))},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.SCRIPTDATA_ARRIVED,e)}))},e.prototype._onTimedID3MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.TIMED_ID3_METADATA_ARRIVED,e)}))},e.prototype._onSMPTE2038MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.SMPTE2038_METADATA_ARRIVED,e)}))},e.prototype._onSCTE35MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.SCTE35_METADATA_ARRIVED,e)}))},e.prototype._onPESPrivateDataDescriptor=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.PES_PRIVATE_DATA_DESCRIPTOR,e)}))},e.prototype._onPESPrivateDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.PES_PRIVATE_DATA_ARRIVED,e)}))},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.STATISTICS_INFO,e)}))},e.prototype._onIOError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(E.A.IO_ERROR,e,t)}))},e.prototype._onDemuxError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(E.A.DEMUX_ERROR,e,t)}))},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.RECOMMEND_SEEKPOINT,e)}))},e.prototype._onLoggingConfigChanged=function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})},e.prototype._onWorkerMessage=function(e){var t=e.data,i=null==t?void 0:t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case E.A.INIT_SEGMENT:case E.A.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case E.A.LOADING_COMPLETE:case E.A.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case E.A.MEDIA_INFO:Object.setPrototypeOf(i,w.A.prototype),this._emitter.emit(t.msg,i);break;case E.A.METADATA_ARRIVED:case E.A.SCRIPTDATA_ARRIVED:case E.A.TIMED_ID3_METADATA_ARRIVED:case E.A.SMPTE2038_METADATA_ARRIVED:case E.A.SCTE35_METADATA_ARRIVED:case E.A.PES_PRIVATE_DATA_DESCRIPTOR:case E.A.PES_PRIVATE_DATA_ARRIVED:case E.A.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case E.A.IO_ERROR:case E.A.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case E.A.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":u.A.emitter.emit("log",i.type,i.logcat)}},e}(),k="error",R="source_open",O="update_end",C="buffer_full";var B=i(1951),x=i(4383);const I=function(){function e(e){this.TAG="MSEController",this._config=e,this._emitter=new c.A,this._config.isLive&&void 0===this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new B.EX}return e.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaSource)throw new x.j4("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL},e.prototype.detachMediaElement=function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var i=this._pendingSegments[t];i.splice(0,i.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var r=this._sourceBuffers[t];if(r){if("closed"!==e.readyState){try{e.removeSourceBuffer(r)}catch(e){u.A.e(this.TAG,e.message)}null==r||r.removeEventListener("error",this.e.onSourceBufferError),null==r||r.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){u.A.e(this.TAG,e.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},e.prototype.appendInitSegment=function(e,t){var i;if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var r=e,n="".concat(r.container);r.codec&&r.codec.length>0&&(n+=";codecs=".concat(r.codec));var o=!1;if(u.A.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[r.type]=r,n!==this._mimeTypes[r.type]){if(this._mimeTypes[r.type])u.A.v(this.TAG,"Notice: ".concat(r.type," mimeType changed, origin: ").concat(this._mimeTypes[r.type]||"",", target: ").concat(n));else{o=!0;try{var a=this._sourceBuffers[r.type]=this._mediaSource.addSourceBuffer(n);a.addEventListener("error",this.e.onSourceBufferError),a.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return u.A.e(this.TAG,e.message),void this._emitter.emit(k,{code:e.code,msg:e.message})}}this._mimeTypes[r.type]=n}t||this._pendingSegments[r.type].push(r),o||this._sourceBuffers[r.type]&&!(null===(i=this._sourceBuffers[r.type])||void 0===i?void 0:i.updating)&&this._doAppendSegments(),h.A.safari&&"audio/mpeg"===r.container&&r.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=r.mediaDuration/1e3,this._updateMediaSourceDuration())},e.prototype.appendMediaSegment=function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var i=this._sourceBuffers[t.type];!i||i.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},e.prototype.seek=function(e){var t,i;for(var r in this._sourceBuffers)if(this._sourceBuffers[r]){var n=this._sourceBuffers[r];if("open"===(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState))try{null==n||n.abort()}catch(e){u.A.e(this.TAG,e.message)}this._idrList.clear();var o=this._pendingSegments[r];if(o.splice(0,o.length),"closed"!==(null===(i=this._mediaSource)||void 0===i?void 0:i.readyState)){if(n){for(var a=0;a<n.buffered.length;a++){var s=n.buffered.start(a),l=n.buffered.end(a);this._pendingRemoveRanges[r].push({start:s,end:l})}(null==n?void 0:n.updating)||this._doRemoveRanges()}if(h.A.safari){var d=this._lastInitSegments[r];d&&(this._pendingSegments[r].push(d),(null==n?void 0:n.updating)||this._doAppendSegments())}}}},e.prototype.endOfStream=function(){var e,t,i=this._mediaSource,r=this._sourceBuffers;i&&"open"===i.readyState?(null===(e=r.video)||void 0===e?void 0:e.updating)||(null===(t=r.audio)||void 0===t?void 0:t.updating)?this._hasPendingEos=!0:(this._hasPendingEos=!1,i.endOfStream()):i&&"closed"===i.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)},e.prototype.getNearestKeyframe=function(e){return this._idrList.getLastSyncPointBeforeDts(e)},e.prototype._needCleanupSourceBuffer=function(){var e,t;if(!this._config.autoCleanupSourceBuffer)return!1;var i=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(var r in this._sourceBuffers){var n=this._sourceBuffers[r];if(n){var o=n.buffered;if(o.length>=1&&i-o.start(0)>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0))return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e,t,i,r=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(var n in this._sourceBuffers){var o=this._sourceBuffers[n];if(o){for(var a=o.buffered,s=!1,l=0;l<a.length;l++){var d=a.start(l),c=a.end(l);if(d<=r&&r<c+3){if(r-d>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0)){s=!0;var u=r-((null===(i=this._config)||void 0===i?void 0:i.autoCleanupMinBackwardDuration)||0);this._pendingRemoveRanges[n].push({start:d,end:u})}}else c<r&&(s=!0,this._pendingRemoveRanges[n].push({start:d,end:c}))}s&&!o.updating&&this._doRemoveRanges()}}},e.prototype._updateMediaSourceDuration=function(){var e,t,i,r,n=this._sourceBuffers;if(0!==(null===(e=this._mediaElement)||void 0===e?void 0:e.readyState)&&"open"===(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState)&&!(null===(i=n.video)||void 0===i?void 0:i.updating)&&!(null===(r=n.audio)||void 0===r?void 0:r.updating)){var o=this._mediaSource.duration,a=this._pendingMediaDuration;a>0&&(isNaN(o)||a>o)&&(u.A.v(this.TAG,"Update MediaSource duration from ".concat(o," to ").concat(a)),this._mediaSource.duration=a),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},e.prototype._doRemoveRanges=function(){var e;for(var t in this._pendingRemoveRanges)if(this._sourceBuffers[t]&&!(null===(e=this._sourceBuffers[t])||void 0===e?void 0:e.updating))for(var i=this._sourceBuffers[t],r=this._pendingRemoveRanges[t];r.length&&!(null==i?void 0:i.updating);){var n=r.shift();null==i||i.remove(n.start,n.end)}},e.prototype._doAppendSegments=function(){var e,t,i,r=this._pendingSegments;for(var n in r)if(this._sourceBuffers[n]&&!(null===(e=this._sourceBuffers[n])||void 0===e?void 0:e.updating)&&r[n].length>0){var o=r[n].shift();if(null==o?void 0:o.timestampOffset){var a=(null===(t=this._sourceBuffers[n])||void 0===t?void 0:t.timestampOffset)||0,s=o.timestampOffset/1e3;Math.abs(a-s)>.1&&(u.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(a," to ").concat(s)),this._sourceBuffers[n]&&(this._sourceBuffers[n].timestampOffset=s)),delete o.timestampOffset}if(!o.data||0===o.data.byteLength)continue;try{null===(i=this._sourceBuffers[n])||void 0===i||i.appendBuffer(o.data),this._isBufferFull=!1,"video"===n&&o.hasOwnProperty("info")&&this._idrList.appendArray(o.info.syncPoints)}catch(e){this._pendingSegments[n].unshift(o),22===e.code?(this._isBufferFull||this._emitter.emit(C),this._isBufferFull=!0):(u.A.e(this.TAG,e.message),this._emitter.emit(k,{code:e.code,msg:e.message}))}}},e.prototype._onSourceOpen=function(){var e;if(u.A.v(this.TAG,"MediaSource onSourceOpen"),null===(e=this._mediaSource)||void 0===e||e.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var t=this._pendingSourceBufferInit;t.length;){var i=t.shift();this.appendInitSegment(i,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(R)},e.prototype._onSourceEnded=function(){u.A.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){u.A.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},e.prototype._hasPendingSegments=function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0},e.prototype._hasPendingRemoveRanges=function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0},e.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(O)},e.prototype._onSourceBufferError=function(e){u.A.e(this.TAG,"SourceBuffer Error: ".concat(e))},e}();var L=i(6399),D={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},M={NETWORK_EXCEPTION:d.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:d.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:d.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:d.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:L.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:L.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:L.A.CODEC_UNSUPPORTED};const P=function(){function e(e,t){var i,r,n;this.TAG="MSEPlayer",this._type="MSEPlayer",this._emitter=new c.A,this._config=a(),"object"==typeof t&&Object.assign(this._config,t);var o=e.type.toLowerCase();if("mse"!==o&&"mpegts"!==o&&"m2ts"!==o&&"flv"!==o)throw new x.Qn("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");e.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=e,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var s=h.A.chrome&&(h.A.version&&(null===(i=h.A.version)||void 0===i?void 0:i.major)<50||h.A.version&&50===(null===(r=null===h.A||void 0===h.A?void 0:h.A.version)||void 0===r?void 0:r.major)&&((null===(n=null===h.A||void 0===h.A?void 0:h.A.version)||void 0===n?void 0:n.build)||-1)<2661);this._alwaysSeekKeyframe=!!(s||h.A.msedge||h.A.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return e.prototype.destroy=function(){this._emitter.emit(A.DESTROYING),null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===A.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){i._emitter.emit(A.MEDIA_INFO,i.mediaInfo)})):e===A.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){i._emitter.emit(A.STATISTICS_INFO,i.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){var t,i,r,n,o,a=this;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new I(this._config),null===(t=this._msectl)||void 0===t||t.on(O,this._onmseUpdateEnd.bind(this)),null===(i=this._msectl)||void 0===i||i.on(C,this._onmseBufferFull.bind(this)),null===(r=this._msectl)||void 0===r||r.on(R,(function(){a._mseSourceOpened=!0,a._hasPendingLoad&&(a._hasPendingLoad=!1,a.load())})),null===(n=this._msectl)||void 0===n||n.on(k,(function(e){a._emitter.emit(A.ERROR,D.MEDIA_ERROR,M.MEDIA_MSE_ERROR,e)})),null===(o=this._msectl)||void 0===o||o.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){var e;this._mediaElement&&(null===(e=this._msectl)||void 0===e||e.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)},e.prototype.load=function(){var e=this;if(!this._mediaElement)throw new x.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new x.j4("MSEPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(!this._config.deferLoadAfterSourceOpen||this._mseSourceOpened?(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new T(this._mediaDataSource,this._config),this._transmuxer.on(E.A.INIT_SEGMENT,(function(t,i){var r;null===(r=e._msectl)||void 0===r||r.appendInitSegment(i)})),this._transmuxer.on(E.A.MEDIA_SEGMENT,(function(t,i){var r,n,o;if(null===(r=e._msectl)||void 0===r||r.appendMediaSegment(i),e._config.lazyLoad&&!e._config.isLive){var a=null===(n=e._mediaElement)||void 0===n?void 0:n.currentTime;i.info.endDts>=1e3*(a+((null===(o=e._config)||void 0===o?void 0:o.lazyLoadMaxDuration)||0))&&null==e._progressChecker&&(u.A.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(E.A.LOADING_COMPLETE,(function(){var t;null===(t=e._msectl)||void 0===t||t.endOfStream(),e._emitter.emit(A.LOADING_COMPLETE)})),this._transmuxer.on(E.A.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(A.RECOVERED_EARLY_EOF)})),this._transmuxer.on(E.A.IO_ERROR,(function(t,i){e._emitter.emit(A.ERROR,D.NETWORK_ERROR,t,i)})),this._transmuxer.on(E.A.DEMUX_ERROR,(function(t,i){e._emitter.emit(A.ERROR,D.MEDIA_ERROR,t,{code:-1,msg:i})})),this._transmuxer.on(E.A.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(A.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(E.A.METADATA_ARRIVED,(function(t){e._emitter.emit(A.METADATA_ARRIVED,t)})),this._transmuxer.on(E.A.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(A.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(E.A.TIMED_ID3_METADATA_ARRIVED,(function(t){e._emitter.emit(A.TIMED_ID3_METADATA_ARRIVED,t)})),this._transmuxer.on(E.A.SMPTE2038_METADATA_ARRIVED,(function(t){e._emitter.emit(A.SMPTE2038_METADATA_ARRIVED,t)})),this._transmuxer.on(E.A.SCTE35_METADATA_ARRIVED,(function(t){e._emitter.emit(A.SCTE35_METADATA_ARRIVED,t)})),this._transmuxer.on(E.A.PES_PRIVATE_DATA_DESCRIPTOR,(function(t){e._emitter.emit(A.PES_PRIVATE_DATA_DESCRIPTOR,t)})),this._transmuxer.on(E.A.PES_PRIVATE_DATA_ARRIVED,(function(t){e._emitter.emit(A.PES_PRIVATE_DATA_ARRIVED,t)})),this._transmuxer.on(E.A.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(A.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(E.A.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()):this._hasPendingLoad=!0)},e.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},e.prototype.play=function(){var e,t,i,r;return t=this,r=function(){return function(e,t){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){switch(t.label){case 0:return[4,null===(e=this._mediaElement)||void 0===e?void 0:e.play()];case 1:return[2,t.sent()]}}))},new((i=void 0)||(i=Promise))((function(e,n){function o(e){try{s(r.next(e))}catch(e){n(e)}}function a(e){try{s(r.throw(e))}catch(e){n(e)}}function s(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(o,a)}s((r=r.apply(t,[])).next())}))},e.prototype.pause=function(){var e;null===(e=this._mediaElement)||void 0===e||e.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.volume},set:function(e){this._mediaElement&&(this._mediaElement.volume=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.muted},set:function(e){this._mediaElement&&(this._mediaElement.muted=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),e.prototype._fillStatisticsInfo=function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,r=0;if(this._mediaElement.getVideoPlaybackQuality){var n=this._mediaElement.getVideoPlaybackQuality();i=n.totalVideoFrames,r=n.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,r=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=r),e},e.prototype._onmseUpdateEnd=function(){var e,t,i,r,n=null===(e=this._mediaElement)||void 0===e?void 0:e.buffered,o=(null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime)||0;if(this._config.isLive&&this._config.liveBufferLatencyChasing&&(null==n?void 0:n.length)>0&&!(null===(i=this._mediaElement)||void 0===i?void 0:i.paused)){var a=n.end(n.length-1);if(a>((null===(r=this._config)||void 0===r?void 0:r.liveBufferLatencyMaxLatency)||0)&&a-o>(this._config.liveBufferLatencyMaxLatency||0)){var s=a-(this._config.liveBufferLatencyMinRemain||0);this.currentTime=s}}if(this._config.lazyLoad&&!this._config.isLive){for(var l=0,d=0;d<n.length;d++){var c=n.start(d),h=n.end(d);if(c<=o&&o<h){l=h;break}}l>=o+(this._config.lazyLoadMaxDuration||0)&&null==this._progressChecker&&(u.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},e.prototype._onmseBufferFull=function(){u.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},e.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},e.prototype._checkProgressAndResume=function(){for(var e,t,i,r=(null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime)||0,n=(null===(t=this._mediaElement)||void 0===t?void 0:t.buffered)||[],o=!1,a=0;a<n.length;a++){var s=n.start(a),l=n.end(a);if(r>=s&&r<l){r>=l-(this._config.lazyLoadRecoverDuration||0)&&(o=!0);break}}o&&(window.clearInterval(this._progressChecker),this._progressChecker=null,o&&(u.A.v(this.TAG,"Continue loading from paused position"),null===(i=this._transmuxer)||void 0===i||i.resume()))},e.prototype._isTimepointBuffered=function(e){for(var t,i=null===(t=this._mediaElement)||void 0===t?void 0:t.buffered,r=0;r<i.length;r++){var n=i.start(r),o=i.end(r);if(e>=n&&e<o)return!0}return!1},e.prototype._internalSeek=function(e){var t,i,r,n=this._isTimepointBuffered(e),o=!1,a=0;if(e<1&&this._mediaElement.buffered.length>0){var s=this._mediaElement.buffered.start(0);(s<1&&e<s||h.A.safari)&&(o=!0,a=h.A.safari?.1:s)}if(o)this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=a);else if(n){if(this._alwaysSeekKeyframe){var l=null===(t=this._msectl)||void 0===t?void 0:t.getNearestKeyframe(Math.floor(1e3*e));this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=null!=l?l.dts/1e3:e)}else this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e);null!=this._progressChecker&&this._checkProgressAndResume()}else null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),null===(i=this._msectl)||void 0===i||i.seek(e),null===(r=this._transmuxer)||void 0===r||r.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e))},e.prototype._checkAndApplyUnbufferedSeekpoint=function(){var e,t,i,r;if(this._seekpointRecord)if(((null===(e=this._seekpointRecord)||void 0===e?void 0:e.recordTime)||0)<=this._now()-100){var n=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(n)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),null===(i=this._msectl)||void 0===i||i.seek(n),null===(r=this._transmuxer)||void 0===r||r.seek(Math.floor(1e3*n)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=n)))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},e.prototype._checkAndResumeStuckPlayback=function(e){var t=this._mediaElement;if(e||!this._receivedCanPlay||t.readyState<2){var i=t.buffered;i.length>0&&t.currentTime<i.start(0)&&(u.A.w(this.TAG,"Playback seems stuck at ".concat(t.currentTime,", seek to ").concat(i.start(0))),this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=i.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress)))}else this._mediaElement&&this._mediaElement.removeEventListener("progress",this.e.onvProgress)},e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement&&(this._mediaElement.currentTime=this._pendingSeekTime),this._pendingSeekTime=null)},e.prototype._onvSeeking=function(e){var t,i,r,n=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime,o=null===(i=this._mediaElement)||void 0===i?void 0:i.buffered;if(this._requestSetTime)this._requestSetTime=!1;else{if(n<1&&o.length>0){var a=o.start(0);if(a<1&&n<a||h.A.safari)return this._requestSetTime=!0,void(this._mediaElement&&(h.A.safari?this._mediaElement.currentTime=.1:this._mediaElement.currentTime=a))}if(this._isTimepointBuffered(n)){if(this._alwaysSeekKeyframe){var s=null===(r=this._msectl)||void 0===r?void 0:r.getNearestKeyframe(Math.floor(1e3*n));null!=s&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=s.dts/1e3))}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:n,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},e.prototype._onvCanPlay=function(e){var t;this._receivedCanPlay=!0,null===(t=this._mediaElement)||void 0===t||t.removeEventListener("canplay",this.e.onvCanPlay)},e.prototype._onvStalled=function(e){this._checkAndResumeStuckPlayback(!0)},e.prototype._onvProgress=function(e){this._checkAndResumeStuckPlayback()},e}(),U=function(){function e(e,t){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new c.A,this._config=a(),"object"==typeof t&&Object.assign(this._config,t);var i=e.type.toLowerCase();if("mse"===i||"mpegts"===i||"m2ts"===i||"flv"===i)throw new x.Qn("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(e.hasOwnProperty("segments"))throw new x.Qn("NativePlayer(".concat(e.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=e,this._mediaElement=null}return e.prototype.destroy=function(){var e;this._emitter.emit(A.DESTROYING),this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,null===(e=this._emitter)||void 0===e||e.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===A.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){i._emitter.emit(A.MEDIA_INFO,i.mediaInfo)})):e===A.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){i._emitter.emit(A.STATISTICS_INFO,i.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.load=function(){var e;if(!this._mediaElement)throw new x.j4("HTMLMediaElement must be attached before load()!");this._mediaElement.src=(null===(e=this._mediaDataSource)||void 0===e?void 0:e.url)||"",this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){var e,t,i,r;return t=this,r=function(){return function(e,t){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){switch(t.label){case 0:return[4,null===(e=this._mediaElement)||void 0===e?void 0:e.play()];case 1:return[2,t.sent()]}}))},new((i=void 0)||(i=Promise))((function(e,n){function o(e){try{s(r.next(e))}catch(e){n(e)}}function a(e){try{s(r.throw(e))}catch(e){n(e)}}function s(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(o,a)}s((r=r.apply(t,[])).next())}))},e.prototype.pause=function(){var e;null===(e=this._mediaElement)||void 0===e||e.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.volume},set:function(e){this._mediaElement&&(this._mediaElement.volume=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.muted},set:function(e){this._mediaElement&&(this._mediaElement.muted=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,r=0;if(this._mediaElement.getVideoPlaybackQuality){var n=this._mediaElement.getVideoPlaybackQuality();i=n.totalVideoFrames,r=n.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,r=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=r),e},enumerable:!1,configurable:!0}),e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement&&(this._mediaElement.currentTime=this._pendingSeekTime),this._pendingSeekTime=null),this._emitter.emit(A.MEDIA_INFO,this.mediaInfo)},e.prototype._reportStatisticsInfo=function(){this._emitter.emit(A.STATISTICS_INFO,this.statisticsInfo)},e}();var F={createPlayer:function(e,t){(null==e?void 0:e.url)&&(e.url=function(e,t){void 0===t&&(t=["h264"]);var i=(t||["h264"]).reduce((function(e,t){return t=t.toLowerCase(),e+(r[t]||0)}),0),n=e.split("?")[0],o=e.split("?")[1];return o=(o||"").split("&").filter((function(e){return!/^vc=\d?/.test(e)})).join("&"),n+"?"+o+(o?"&":"")+"vc="+i}(e.url,["h264","h265"]));var i=e;if(null==i||"object"!=typeof i)throw new x.Qn("MediaDataSource must be an javascript object!");if(!Object.prototype.hasOwnProperty.call(i,"type"))throw new x.Qn("MediaDataSource must has type field to indicate video file type!");switch(i.type){case"mse":case"mpegts":case"m2ts":case"flv":return new P(i,t);default:return new U(i,t)}},isSupported:function(){return l.supportMSEH264Playback()},getFeatureList:function(){return l.getFeatureList()},BaseLoader:d.HC,LoaderStatus:d.eO,LoaderErrors:d.Xv,version:"",Events:A,ErrorTypes:D,ErrorDetails:M,MSEPlayer:P,NativePlayer:U,LoggingControl:b.A};Object.defineProperty(F,"version",{enumerable:!0,get:function(){return"2.0.1"}});const N=F},2671:(e,t,i)=>{var r=i(6458),n=i(2809),o=i(9211),a=i(497),s=i(5057),l=i(3732),d=function(){},c=s("Reflect","construct"),u=/^\s*(?:class|function)\b/,h=r(u.exec),A=!u.test(d),p=function(e){if(!o(e))return!1;try{return c(d,[],e),!0}catch(e){return!1}},f=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return A||!!h(u,l(e))}catch(e){return!0}};f.sham=!0,e.exports=!c||n((function(){var e;return p(p.call)||!p(Object)||!p((function(){e=!0}))||e}))?f:p},2719:(e,t,i)=>{var r=i(5273),n=i(5840);e.exports=function(e){return r(n(e))}},2757:(e,t,i)=>{var r=i(9615),n=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw new n("Incorrect invocation")}},2792:(e,t,i)=>{var r=i(9646),n=i(2809);e.exports=r&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},2807:(e,t,i)=>{var r=i(9047);e.exports=function(e,t){return new(r(e))(0===t?0:t)}},2809:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},2897:(e,t,i)=>{var r=i(9646),n=i(815),o=i(7403),a=i(6330),s=i(2719),l=i(4151),d=i(4347),c=i(6071),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(e,t){if(e=s(e),t=l(t),c)try{return u(e,t)}catch(e){}if(d(e,t))return a(!n(o.f,e,t),e[t])}},2915:(e,t,i)=>{var r=i(7553),n=i(2327),o=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||a[o]===e)}},3074:(e,t,i)=>{var r=i(9364),n=i(9083),o=i(7642);r({target:"Object",stat:!0,forced:i(2809)((function(){o(1)}))},{keys:function(e){return o(n(e))}})},3430:(e,t,i)=>{var r=i(6458),n=i(4347),o=i(2719),a=i(219).indexOf,s=i(7923),l=r([].push);e.exports=function(e,t){var i,r=o(e),d=0,c=[];for(i in r)!n(s,i)&&n(r,i)&&l(c,i);for(;t.length>d;)n(r,i=t[d++])&&(~a(c,i)||l(c,i));return c}},3439:(e,t,i)=>{var r=i(9646),n=i(6458),o=i(815),a=i(2809),s=i(7642),l=i(7819),d=i(7403),c=i(9083),u=i(5273),h=Object.assign,A=Object.defineProperty,p=n([].concat);e.exports=!h||a((function(){if(r&&1!==h({b:1},h(A({},"a",{enumerable:!0,get:function(){A(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach((function(e){t[e]=e})),7!==h({},e)[i]||s(h({},t)).join("")!==n}))?function(e,t){for(var i=c(e),n=arguments.length,a=1,h=l.f,A=d.f;n>a;)for(var f,_=u(arguments[a++]),m=h?p(s(_),h(_)):s(_),v=m.length,g=0;v>g;)f=m[g++],r&&!o(A,_,f)||(i[f]=_[f]);return i}:h},3463:(e,t,i)=>{var r=i(775);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},3478:(e,t,i)=>{var r=i(9646),n=i(1562),o=i(6458),a=i(4346),s=i(5405),l=i(9277),d=i(6122),c=i(2630).f,u=i(9615),h=i(9666),A=i(6677),p=i(1144),f=i(8587),_=i(9614),m=i(3930),v=i(2809),g=i(4347),y=i(3587).enforce,b=i(9603),S=i(7553),E=i(7517),w=i(6288),T=S("match"),k=n.RegExp,R=k.prototype,O=n.SyntaxError,C=o(R.exec),B=o("".charAt),x=o("".replace),I=o("".indexOf),L=o("".slice),D=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,M=/a/g,P=/a/g,U=new k(M)!==M,F=f.MISSED_STICKY,N=f.UNSUPPORTED_Y;if(a("RegExp",r&&(!U||F||E||w||v((function(){return P[T]=!1,k(M)!==M||k(P)===P||"/a/i"!==String(k(M,"i"))}))))){for(var V=function(e,t){var i,r,n,o,a,c,f=u(R,this),_=h(e),m=void 0===t,v=[],b=e;if(!f&&_&&m&&e.constructor===V)return e;if((_||u(R,e))&&(e=e.source,m&&(t=p(b))),e=void 0===e?"":A(e),t=void 0===t?"":A(t),b=e,E&&"dotAll"in M&&(r=!!t&&I(t,"s")>-1)&&(t=x(t,/s/g,"")),i=t,F&&"sticky"in M&&(n=!!t&&I(t,"y")>-1)&&N&&(t=x(t,/y/g,"")),w&&(o=function(e){for(var t,i=e.length,r=0,n="",o=[],a=d(null),s=!1,l=!1,c=0,u="";r<=i;r++){if("\\"===(t=B(e,r)))t+=B(e,++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:if(n+=t,"?:"===L(e,r+1,r+3))continue;C(D,L(e,r+1))&&(r+=2,l=!0),c++;continue;case">"===t&&l:if(""===u||g(a,u))throw new O("Invalid capture group name");a[u]=!0,o[o.length]=[u,c],l=!1,u="";continue}l?u+=t:n+=t}return[n,o]}(e),e=o[0],v=o[1]),a=s(k(e,t),f?this:R,V),(r||n||v.length)&&(c=y(a),r&&(c.dotAll=!0,c.raw=V(function(e){for(var t,i=e.length,r=0,n="",o=!1;r<=i;r++)"\\"!==(t=B(e,r))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),n+=t):n+="[\\s\\S]":n+=t+B(e,++r);return n}(e),i)),n&&(c.sticky=!0),v.length&&(c.groups=v)),e!==b)try{l(a,"source",""===b?"(?:)":b)}catch(e){}return a},G=c(k),j=0;G.length>j;)_(V,k,G[j++]);R.constructor=V,V.prototype=R,m(n,"RegExp",V,{constructor:!0})}b("RegExp")},3479:(e,t,i)=>{var r=i(5993);e.exports="NODE"===r},3587:(e,t,i)=>{var r,n,o,a=i(4468),s=i(1562),l=i(4152),d=i(9277),c=i(4347),u=i(775),h=i(577),A=i(7923),p="Object already initialized",f=s.TypeError,_=s.WeakMap;if(a||u.state){var m=u.state||(u.state=new _);m.get=m.get,m.has=m.has,m.set=m.set,r=function(e,t){if(m.has(e))throw new f(p);return t.facade=e,m.set(e,t),t},n=function(e){return m.get(e)||{}},o=function(e){return m.has(e)}}else{var v=h("state");A[v]=!0,r=function(e,t){if(c(e,v))throw new f(p);return t.facade=e,d(e,v,t),t},n=function(e){return c(e,v)?e[v]:{}},o=function(e){return c(e,v)}}e.exports={set:r,get:n,has:o,enforce:function(e){return o(e)?n(e):r(e,{})},getterFor:function(e){return function(t){var i;if(!l(t)||(i=n(t)).type!==e)throw new f("Incompatible receiver, "+e+" required");return i}}}},3643:(e,t,i)=>{var r=i(9646),n=i(6071),o=i(2792),a=i(7749),s=i(4151),l=TypeError,d=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u="enumerable",h="configurable",A="writable";t.f=r?o?function(e,t,i){if(a(e),t=s(t),a(i),"function"==typeof e&&"prototype"===t&&"value"in i&&A in i&&!i[A]){var r=c(e,t);r&&r[A]&&(e[t]=i.value,i={configurable:h in i?i[h]:r[h],enumerable:u in i?i[u]:r[u],writable:!1})}return d(e,t,i)}:d:function(e,t,i){if(a(e),t=s(t),a(i),n)try{return d(e,t,i)}catch(e){}if("get"in i||"set"in i)throw new l("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},3732:(e,t,i)=>{var r=i(6458),n=i(9211),o=i(775),a=r(Function.toString);n(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},3813:(e,t,i)=>{i(1541)(Math,"Math",!0)},3930:(e,t,i)=>{var r=i(9211),n=i(3643),o=i(4233),a=i(4191);e.exports=function(e,t,i,s){s||(s={});var l=s.enumerable,d=void 0!==s.name?s.name:t;if(r(i)&&o(i,d,s),s.global)l?e[t]=i:a(t,i);else{try{s.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=i:n.f(e,t,{value:i,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},3992:(e,t,i)=>{var r=i(9364),n=i(5057),o=i(8891),a=i(815),s=i(6458),l=i(2809),d=i(9211),c=i(5727),u=i(8626),h=i(9695),A=i(7917),p=String,f=n("JSON","stringify"),_=s(/./.exec),m=s("".charAt),v=s("".charCodeAt),g=s("".replace),y=s(1..toString),b=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,E=/^[\uDC00-\uDFFF]$/,w=!A||l((function(){var e=n("Symbol")("stringify detection");return"[null]"!==f([e])||"{}"!==f({a:e})||"{}"!==f(Object(e))})),T=l((function(){return'"\\udf06\\ud834"'!==f("\udf06\ud834")||'"\\udead"'!==f("\udead")})),k=function(e,t){var i=u(arguments),r=h(t);if(d(r)||void 0!==e&&!c(e))return i[1]=function(e,t){if(d(r)&&(t=a(r,this,p(e),t)),!c(t))return t},o(f,null,i)},R=function(e,t,i){var r=m(i,t-1),n=m(i,t+1);return _(S,e)&&!_(E,n)||_(E,e)&&!_(S,r)?"\\u"+y(v(e,0),16):e};f&&r({target:"JSON",stat:!0,arity:3,forced:w||T},{stringify:function(e,t,i){var r=u(arguments),n=o(w?k:f,null,r);return T&&"string"==typeof n?g(n,b,R):n}})},4151:(e,t,i)=>{var r=i(115),n=i(5727);e.exports=function(e){var t=r(e,"string");return n(t)?t:t+""}},4152:(e,t,i)=>{var r=i(9211);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},4160:(e,t,i)=>{var r=i(815),n=i(5057),o=i(7553),a=i(3930);e.exports=function(){var e=n("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,s=o("toPrimitive");t&&!t[s]&&a(t,s,(function(e){return r(i,this)}),{arity:1})}},4191:(e,t,i)=>{var r=i(1562),n=Object.defineProperty;e.exports=function(e,t){try{n(r,e,{value:t,configurable:!0,writable:!0})}catch(i){r[e]=t}return t}},4220:(e,t,i)=>{i(6810);var r,n=i(9364),o=i(9646),a=i(6666),s=i(1562),l=i(7042),d=i(6458),c=i(3930),u=i(1176),h=i(2757),A=i(4347),p=i(3439),f=i(4478),_=i(8626),m=i(4417).codeAt,v=i(4955),g=i(6677),y=i(1541),b=i(594),S=i(648),E=i(3587),w=E.set,T=E.getterFor("URL"),k=S.URLSearchParams,R=S.getState,O=s.URL,C=s.TypeError,B=s.parseInt,x=Math.floor,I=Math.pow,L=d("".charAt),D=d(/./.exec),M=d([].join),P=d(1..toString),U=d([].pop),F=d([].push),N=d("".replace),V=d([].shift),G=d("".split),j=d("".slice),$=d("".toLowerCase),W=d([].unshift),Q="Invalid scheme",z="Invalid host",H="Invalid port",q=/[a-z]/i,Y=/[\d+-.a-z]/i,X=/\d/,Z=/^0x/i,K=/^[0-7]+$/,J=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ie=/[\0\t\n\r #/:<>?@[\\\]^|]/,re=/^[\u0000-\u0020]+/,ne=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,oe=/[\t\n\r]/g,ae=function(e){var t,i,r,n;if("number"==typeof e){for(t=[],i=0;i<4;i++)W(t,e%256),e=x(e/256);return M(t,".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,i=1,r=null,n=0,o=0;o<8;o++)0!==e[o]?(n>i&&(t=r,i=n),r=null,n=0):(null===r&&(r=o),++n);return n>i?r:t}(e),i=0;i<8;i++)n&&0===e[i]||(n&&(n=!1),r===i?(t+=i?":":"::",n=!0):(t+=P(e[i],16),i<7&&(t+=":")));return"["+t+"]"}return e},se={},le=p({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),de=p({},le,{"#":1,"?":1,"{":1,"}":1}),ce=p({},de,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ue=function(e,t){var i=m(e,0);return i>32&&i<127&&!A(t,e)?e:encodeURIComponent(e)},he={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Ae=function(e,t){var i;return 2===e.length&&D(q,L(e,0))&&(":"===(i=L(e,1))||!t&&"|"===i)},pe=function(e){var t;return e.length>1&&Ae(j(e,0,2))&&(2===e.length||"/"===(t=L(e,2))||"\\"===t||"?"===t||"#"===t)},fe=function(e){return"."===e||"%2e"===$(e)},_e={},me={},ve={},ge={},ye={},be={},Se={},Ee={},we={},Te={},ke={},Re={},Oe={},Ce={},Be={},xe={},Ie={},Le={},De={},Me={},Pe={},Ue=function(e,t,i){var r,n,o,a=g(e);if(t){if(n=this.parse(a))throw new C(n);this.searchParams=null}else{if(void 0!==i&&(r=new Ue(i,!0)),n=this.parse(a,null,r))throw new C(n);(o=R(new k)).bindURL(this),this.searchParams=o}};Ue.prototype={type:"URL",parse:function(e,t,i){var n,o,a,s,l,d=this,c=t||_e,u=0,h="",p=!1,m=!1,v=!1;for(e=g(e),t||(d.scheme="",d.username="",d.password="",d.host=null,d.port=null,d.path=[],d.query=null,d.fragment=null,d.cannotBeABaseURL=!1,e=N(e,re,""),e=N(e,ne,"$1")),e=N(e,oe,""),n=f(e);u<=n.length;){switch(o=n[u],c){case _e:if(!o||!D(q,o)){if(t)return Q;c=ve;continue}h+=$(o),c=me;break;case me:if(o&&(D(Y,o)||"+"===o||"-"===o||"."===o))h+=$(o);else{if(":"!==o){if(t)return Q;h="",c=ve,u=0;continue}if(t&&(d.isSpecial()!==A(he,h)||"file"===h&&(d.includesCredentials()||null!==d.port)||"file"===d.scheme&&!d.host))return;if(d.scheme=h,t)return void(d.isSpecial()&&he[d.scheme]===d.port&&(d.port=null));h="","file"===d.scheme?c=Ce:d.isSpecial()&&i&&i.scheme===d.scheme?c=ge:d.isSpecial()?c=Ee:"/"===n[u+1]?(c=ye,u++):(d.cannotBeABaseURL=!0,F(d.path,""),c=De)}break;case ve:if(!i||i.cannotBeABaseURL&&"#"!==o)return Q;if(i.cannotBeABaseURL&&"#"===o){d.scheme=i.scheme,d.path=_(i.path),d.query=i.query,d.fragment="",d.cannotBeABaseURL=!0,c=Pe;break}c="file"===i.scheme?Ce:be;continue;case ge:if("/"!==o||"/"!==n[u+1]){c=be;continue}c=we,u++;break;case ye:if("/"===o){c=Te;break}c=Le;continue;case be:if(d.scheme=i.scheme,o===r)d.username=i.username,d.password=i.password,d.host=i.host,d.port=i.port,d.path=_(i.path),d.query=i.query;else if("/"===o||"\\"===o&&d.isSpecial())c=Se;else if("?"===o)d.username=i.username,d.password=i.password,d.host=i.host,d.port=i.port,d.path=_(i.path),d.query="",c=Me;else{if("#"!==o){d.username=i.username,d.password=i.password,d.host=i.host,d.port=i.port,d.path=_(i.path),d.path.length--,c=Le;continue}d.username=i.username,d.password=i.password,d.host=i.host,d.port=i.port,d.path=_(i.path),d.query=i.query,d.fragment="",c=Pe}break;case Se:if(!d.isSpecial()||"/"!==o&&"\\"!==o){if("/"!==o){d.username=i.username,d.password=i.password,d.host=i.host,d.port=i.port,c=Le;continue}c=Te}else c=we;break;case Ee:if(c=we,"/"!==o||"/"!==L(h,u+1))continue;u++;break;case we:if("/"!==o&&"\\"!==o){c=Te;continue}break;case Te:if("@"===o){p&&(h="%40"+h),p=!0,a=f(h);for(var y=0;y<a.length;y++){var b=a[y];if(":"!==b||v){var S=ue(b,ce);v?d.password+=S:d.username+=S}else v=!0}h=""}else if(o===r||"/"===o||"?"===o||"#"===o||"\\"===o&&d.isSpecial()){if(p&&""===h)return"Invalid authority";u-=f(h).length+1,h="",c=ke}else h+=o;break;case ke:case Re:if(t&&"file"===d.scheme){c=xe;continue}if(":"!==o||m){if(o===r||"/"===o||"?"===o||"#"===o||"\\"===o&&d.isSpecial()){if(d.isSpecial()&&""===h)return z;if(t&&""===h&&(d.includesCredentials()||null!==d.port))return;if(s=d.parseHost(h))return s;if(h="",c=Ie,t)return;continue}"["===o?m=!0:"]"===o&&(m=!1),h+=o}else{if(""===h)return z;if(s=d.parseHost(h))return s;if(h="",c=Oe,t===Re)return}break;case Oe:if(!D(X,o)){if(o===r||"/"===o||"?"===o||"#"===o||"\\"===o&&d.isSpecial()||t){if(""!==h){var E=B(h,10);if(E>65535)return H;d.port=d.isSpecial()&&E===he[d.scheme]?null:E,h=""}if(t)return;c=Ie;continue}return H}h+=o;break;case Ce:if(d.scheme="file","/"===o||"\\"===o)c=Be;else{if(!i||"file"!==i.scheme){c=Le;continue}switch(o){case r:d.host=i.host,d.path=_(i.path),d.query=i.query;break;case"?":d.host=i.host,d.path=_(i.path),d.query="",c=Me;break;case"#":d.host=i.host,d.path=_(i.path),d.query=i.query,d.fragment="",c=Pe;break;default:pe(M(_(n,u),""))||(d.host=i.host,d.path=_(i.path),d.shortenPath()),c=Le;continue}}break;case Be:if("/"===o||"\\"===o){c=xe;break}i&&"file"===i.scheme&&!pe(M(_(n,u),""))&&(Ae(i.path[0],!0)?F(d.path,i.path[0]):d.host=i.host),c=Le;continue;case xe:if(o===r||"/"===o||"\\"===o||"?"===o||"#"===o){if(!t&&Ae(h))c=Le;else if(""===h){if(d.host="",t)return;c=Ie}else{if(s=d.parseHost(h))return s;if("localhost"===d.host&&(d.host=""),t)return;h="",c=Ie}continue}h+=o;break;case Ie:if(d.isSpecial()){if(c=Le,"/"!==o&&"\\"!==o)continue}else if(t||"?"!==o)if(t||"#"!==o){if(o!==r&&(c=Le,"/"!==o))continue}else d.fragment="",c=Pe;else d.query="",c=Me;break;case Le:if(o===r||"/"===o||"\\"===o&&d.isSpecial()||!t&&("?"===o||"#"===o)){if(".."===(l=$(l=h))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(d.shortenPath(),"/"===o||"\\"===o&&d.isSpecial()||F(d.path,"")):fe(h)?"/"===o||"\\"===o&&d.isSpecial()||F(d.path,""):("file"===d.scheme&&!d.path.length&&Ae(h)&&(d.host&&(d.host=""),h=L(h,0)+":"),F(d.path,h)),h="","file"===d.scheme&&(o===r||"?"===o||"#"===o))for(;d.path.length>1&&""===d.path[0];)V(d.path);"?"===o?(d.query="",c=Me):"#"===o&&(d.fragment="",c=Pe)}else h+=ue(o,de);break;case De:"?"===o?(d.query="",c=Me):"#"===o?(d.fragment="",c=Pe):o!==r&&(d.path[0]+=ue(o,se));break;case Me:t||"#"!==o?o!==r&&("'"===o&&d.isSpecial()?d.query+="%27":d.query+="#"===o?"%23":ue(o,se)):(d.fragment="",c=Pe);break;case Pe:o!==r&&(d.fragment+=ue(o,le))}u++}},parseHost:function(e){var t,i,r;if("["===L(e,0)){if("]"!==L(e,e.length-1))return z;if(t=function(e){var t,i,r,n,o,a,s,l=[0,0,0,0,0,0,0,0],d=0,c=null,u=0,h=function(){return L(e,u)};if(":"===h()){if(":"!==L(e,1))return;u+=2,c=++d}for(;h();){if(8===d)return;if(":"!==h()){for(t=i=0;i<4&&D(ee,h());)t=16*t+B(h(),16),u++,i++;if("."===h()){if(0===i)return;if(u-=i,d>6)return;for(r=0;h();){if(n=null,r>0){if(!("."===h()&&r<4))return;u++}if(!D(X,h()))return;for(;D(X,h());){if(o=B(h(),10),null===n)n=o;else{if(0===n)return;n=10*n+o}if(n>255)return;u++}l[d]=256*l[d]+n,2!=++r&&4!==r||d++}if(4!==r)return;break}if(":"===h()){if(u++,!h())return}else if(h())return;l[d++]=t}else{if(null!==c)return;u++,c=++d}}if(null!==c)for(a=d-c,d=7;0!==d&&a>0;)s=l[d],l[d--]=l[c+a-1],l[c+--a]=s;else if(8!==d)return;return l}(j(e,1,-1)),!t)return z;this.host=t}else if(this.isSpecial()){if(e=v(e),D(te,e))return z;if(t=function(e){var t,i,r,n,o,a,s,l=G(e,".");if(l.length&&""===l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(i=[],r=0;r<t;r++){if(""===(n=l[r]))return e;if(o=10,n.length>1&&"0"===L(n,0)&&(o=D(Z,n)?16:8,n=j(n,8===o?1:2)),""===n)a=0;else{if(!D(10===o?J:8===o?K:ee,n))return e;a=B(n,o)}F(i,a)}for(r=0;r<t;r++)if(a=i[r],r===t-1){if(a>=I(256,5-t))return null}else if(a>255)return null;for(s=U(i),r=0;r<i.length;r++)s+=i[r]*I(256,3-r);return s}(e),null===t)return z;this.host=t}else{if(D(ie,e))return z;for(t="",i=f(e),r=0;r<i.length;r++)t+=ue(i[r],se);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return A(he,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&Ae(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,i=e.username,r=e.password,n=e.host,o=e.port,a=e.path,s=e.query,l=e.fragment,d=t+":";return null!==n?(d+="//",e.includesCredentials()&&(d+=i+(r?":"+r:"")+"@"),d+=ae(n),null!==o&&(d+=":"+o)):"file"===t&&(d+="//"),d+=e.cannotBeABaseURL?a[0]:a.length?"/"+M(a,"/"):"",null!==s&&(d+="?"+s),null!==l&&(d+="#"+l),d},setHref:function(e){var t=this.parse(e);if(t)throw new C(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new Fe(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+ae(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(g(e)+":",_e)},getUsername:function(){return this.username},setUsername:function(e){var t=f(g(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var i=0;i<t.length;i++)this.username+=ue(t[i],ce)}},getPassword:function(){return this.password},setPassword:function(e){var t=f(g(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var i=0;i<t.length;i++)this.password+=ue(t[i],ce)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ae(e):ae(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,ke)},getHostname:function(){var e=this.host;return null===e?"":ae(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Re)},getPort:function(){var e=this.port;return null===e?"":g(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=g(e))?this.port=null:this.parse(e,Oe))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+M(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Ie))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=g(e))?this.query=null:("?"===L(e,0)&&(e=j(e,1)),this.query="",this.parse(e,Me)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=g(e))?("#"===L(e,0)&&(e=j(e,1)),this.fragment="",this.parse(e,Pe)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Fe=function(e){var t=h(this,Ne),i=b(arguments.length,1)>1?arguments[1]:void 0,r=w(t,new Ue(e,!1,i));o||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},Ne=Fe.prototype,Ve=function(e,t){return{get:function(){return T(this)[e]()},set:t&&function(e){return T(this)[t](e)},configurable:!0,enumerable:!0}};if(o&&(u(Ne,"href",Ve("serialize","setHref")),u(Ne,"origin",Ve("getOrigin")),u(Ne,"protocol",Ve("getProtocol","setProtocol")),u(Ne,"username",Ve("getUsername","setUsername")),u(Ne,"password",Ve("getPassword","setPassword")),u(Ne,"host",Ve("getHost","setHost")),u(Ne,"hostname",Ve("getHostname","setHostname")),u(Ne,"port",Ve("getPort","setPort")),u(Ne,"pathname",Ve("getPathname","setPathname")),u(Ne,"search",Ve("getSearch","setSearch")),u(Ne,"searchParams",Ve("getSearchParams")),u(Ne,"hash",Ve("getHash","setHash"))),c(Ne,"toJSON",(function(){return T(this).serialize()}),{enumerable:!0}),c(Ne,"toString",(function(){return T(this).serialize()}),{enumerable:!0}),O){var Ge=O.createObjectURL,je=O.revokeObjectURL;Ge&&c(Fe,"createObjectURL",l(Ge,O)),je&&c(Fe,"revokeObjectURL",l(je,O))}y(Fe,"URL"),n({global:!0,constructor:!0,forced:!a,sham:!o},{URL:Fe})},4233:(e,t,i)=>{var r=i(6458),n=i(2809),o=i(9211),a=i(4347),s=i(9646),l=i(6656).CONFIGURABLE,d=i(3732),c=i(3587),u=c.enforce,h=c.get,A=String,p=Object.defineProperty,f=r("".slice),_=r("".replace),m=r([].join),v=s&&!n((function(){return 8!==p((function(){}),"length",{value:8}).length})),g=String(String).split("String"),y=e.exports=function(e,t,i){"Symbol("===f(A(t),0,7)&&(t="["+_(A(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!a(e,"name")||l&&e.name!==t)&&(s?p(e,"name",{value:t,configurable:!0}):e.name=t),v&&i&&a(i,"arity")&&e.length!==i.arity&&p(e,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?s&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=u(e);return a(r,"source")||(r.source=m(g,"string"==typeof t?t:"")),e};Function.prototype.toString=y((function(){return o(this)&&h(this).source||d(this)}),"toString")},4346:(e,t,i)=>{var r=i(2809),n=i(9211),o=/#|\.prototype\./,a=function(e,t){var i=l[s(e)];return i===c||i!==d&&(n(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=a.data={},d=a.NATIVE="N",c=a.POLYFILL="P";e.exports=a},4347:(e,t,i)=>{var r=i(6458),n=i(9083),o=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(n(e),t)}},4383:(e,t,i)=>{i.d(t,{Al:()=>o,Qn:()=>s,Xu:()=>l,j4:()=>a});var r,n=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=function(){function e(e){this.name="RuntimeException",this._message=e}return Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),a=function(e){function t(t){var i=e.call(this,t)||this;return i.name="IllegalStateException",i}return n(t,e),t}(o),s=function(e){function t(t){var i=e.call(this,t)||this;return i.name="InvalidArgumentException",i}return n(t,e),t}(o),l=function(e){function t(t){var i=e.call(this,t)||this;return i.name="NotImplementedException",i}return n(t,e),t}(o)},4417:(e,t,i)=>{var r=i(6458),n=i(4685),o=i(6677),a=i(5840),s=r("".charAt),l=r("".charCodeAt),d=r("".slice),c=function(e){return function(t,i){var r,c,u=o(a(t)),h=n(i),A=u.length;return h<0||h>=A?e?"":void 0:(r=l(u,h))<55296||r>56319||h+1===A||(c=l(u,h+1))<56320||c>57343?e?s(u,h):r:e?d(u,h,h+2):c-56320+(r-55296<<10)+65536}};e.exports={codeAt:c(!1),charAt:c(!0)}},4468:(e,t,i)=>{var r=i(1562),n=i(9211),o=r.WeakMap;e.exports=n(o)&&/native code/.test(String(o))},4478:(e,t,i)=>{var r=i(7042),n=i(815),o=i(9083),a=i(5957),s=i(2915),l=i(2671),d=i(256),c=i(8286),u=i(279),h=i(9273),A=Array;e.exports=function(e){var t=o(e),i=l(this),p=arguments.length,f=p>1?arguments[1]:void 0,_=void 0!==f;_&&(f=r(f,p>2?arguments[2]:void 0));var m,v,g,y,b,S,E=h(t),w=0;if(!E||this===A&&s(E))for(m=d(t),v=i?new this(m):A(m);m>w;w++)S=_?f(t[w],w):t[w],c(v,w,S);else for(v=i?new this:[],b=(y=u(t,E)).next;!(g=n(b,y)).done;w++)S=_?a(y,f,[g.value,w],!0):g.value,c(v,w,S);return v.length=w,v}},4579:(e,t,i)=>{var r=i(9364),n=i(6458),o=i(7024),a=RangeError,s=String.fromCharCode,l=String.fromCodePoint,d=n([].join);r({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(e){for(var t,i=[],r=arguments.length,n=0;r>n;){if(t=+arguments[n++],o(t,1114111)!==t)throw new a(t+" is not a valid code point");i[n]=t<65536?s(t):s(55296+((t-=65536)>>10),t%1024+56320)}return d(i,"")}})},4659:(e,t,i)=>{var r=i(9364),n=i(9646),o=i(3643).f;r({target:"Object",stat:!0,forced:Object.defineProperty!==o,sham:!n},{defineProperty:o})},4685:(e,t,i)=>{var r=i(9879);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},4715:(e,t,i)=>{var r=i(5057);e.exports=r("document","documentElement")},4742:(e,t,i)=>{var r=i(9364),n=i(1684).left,o=i(5888),a=i(4941);r({target:"Array",proto:!0,forced:!i(3479)&&a>79&&a<83||!o("reduce")},{reduce:function(e){var t=arguments.length;return n(this,e,t,t>1?arguments[1]:void 0)}})},4879:(e,t,i)=>{var r=i(1562),n=i(9402),o=i(62),a=i(2578),s=i(9277),l=i(1541),d=i(7553)("iterator"),c=a.values,u=function(e,t){if(e){if(e[d]!==c)try{s(e,d,c)}catch(t){e[d]=c}if(l(e,t,!0),n[t])for(var i in a)if(e[i]!==a[i])try{s(e,i,a[i])}catch(t){e[i]=a[i]}}};for(var h in n)u(r[h]&&r[h].prototype,h);u(o,"DOMTokenList")},4884:(e,t,i)=>{var r=i(526),n=i(2719),o=i(2630).f,a=i(8626),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"===r(e)?function(e){try{return o(e)}catch(e){return a(s)}}(e):o(n(e))}},4941:(e,t,i)=>{var r,n,o=i(1562),a=i(8053),s=o.process,l=o.Deno,d=s&&s.versions||l&&l.version,c=d&&d.v8;c&&(n=(r=c.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!n&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(n=+r[1]),e.exports=n},4955:(e,t,i)=>{var r=i(6458),n=2147483647,o=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",l=RangeError,d=r(a.exec),c=Math.floor,u=String.fromCharCode,h=r("".charCodeAt),A=r([].join),p=r([].push),f=r("".replace),_=r("".split),m=r("".toLowerCase),v=function(e){return e+22+75*(e<26)},g=function(e,t,i){var r=0;for(e=i?c(e/700):e>>1,e+=c(e/t);e>455;)e=c(e/35),r+=36;return c(r+36*e/(e+38))},y=function(e){var t=[];e=function(e){for(var t=[],i=0,r=e.length;i<r;){var n=h(e,i++);if(n>=55296&&n<=56319&&i<r){var o=h(e,i++);56320==(64512&o)?p(t,((1023&n)<<10)+(1023&o)+65536):(p(t,n),i--)}else p(t,n)}return t}(e);var i,r,o=e.length,a=128,d=0,f=72;for(i=0;i<e.length;i++)(r=e[i])<128&&p(t,u(r));var _=t.length,m=_;for(_&&p(t,"-");m<o;){var y=n;for(i=0;i<e.length;i++)(r=e[i])>=a&&r<y&&(y=r);var b=m+1;if(y-a>c((n-d)/b))throw new l(s);for(d+=(y-a)*b,a=y,i=0;i<e.length;i++){if((r=e[i])<a&&++d>n)throw new l(s);if(r===a){for(var S=d,E=36;;){var w=E<=f?1:E>=f+26?26:E-f;if(S<w)break;var T=S-w,k=36-w;p(t,u(v(w+T%k))),S=c(T/k),E+=36}p(t,u(v(S))),f=g(d,b,m===_),d=0,m++}}d++,a++}return A(t,"")};e.exports=function(e){var t,i,r=[],n=_(f(m(e),a,"."),".");for(t=0;t<n.length;t++)i=n[t],p(r,d(o,i)?"xn--"+y(i):i);return A(r,".")}},4979:(e,t,i)=>{var r=i(7042),n=i(6458),o=i(5273),a=i(9083),s=i(256),l=i(2807),d=n([].push),c=function(e){var t=1===e,i=2===e,n=3===e,c=4===e,u=6===e,h=7===e,A=5===e||u;return function(p,f,_,m){for(var v,g,y=a(p),b=o(y),S=s(b),E=r(f,_),w=0,T=m||l,k=t?T(p,S):i||h?T(p,0):void 0;S>w;w++)if((A||w in b)&&(g=E(v=b[w],w,y),e))if(t)k[w]=g;else if(g)switch(e){case 3:return!0;case 5:return v;case 6:return w;case 2:d(k,v)}else switch(e){case 4:return!1;case 7:d(k,v)}return u?-1:n||c?c:k}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},4985:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},5057:(e,t,i)=>{var r=i(1562),n=i(9211);e.exports=function(e,t){return arguments.length<2?(i=r[e],n(i)?i:void 0):r[e]&&r[e][t];var i}},5273:(e,t,i)=>{var r=i(6458),n=i(2809),o=i(526),a=Object,s=r("".split);e.exports=n((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===o(e)?s(e,""):a(e)}:a},5307:e=>{var t=Object.prototype.hasOwnProperty,i="~";function r(){}function n(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new n(r,o||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,r,n=[];if(0===this._eventsCount)return n;for(r in e=this._events)t.call(e,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},s.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,a=new Array(o);n<o;n++)a[n]=r[n].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,n,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,d,c=this._events[s],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,n),!0;case 5:return c.fn.call(c.context,t,r,n,o),!0;case 6:return c.fn.call(c.context,t,r,n,o,a),!0}for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c.fn.apply(c.context,l)}else{var h,A=c.length;for(d=0;d<A;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),u){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,r);break;case 4:c[d].fn.call(c[d].context,t,r,n);break;default:if(!l)for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c[d].fn.apply(c[d].context,l)}}return!0},s.prototype.on=function(e,t,i){return o(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return o(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,r,n){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||n&&!s.once||r&&s.context!==r||a(this,o);else{for(var l=0,d=[],c=s.length;l<c;l++)(s[l].fn!==t||n&&!s[l].once||r&&s[l].context!==r)&&d.push(s[l]);d.length?this._events[o]=1===d.length?d[0]:d:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s},5336:(e,t,i)=>{var r=i(9364),n=i(6458),o=i(5273),a=i(2719),s=i(5888),l=n([].join);r({target:"Array",proto:!0,forced:o!==Object||!s("join",",")},{join:function(e){return l(a(this),void 0===e?",":e)}})},5347:(e,t,i)=>{var r=i(9364),n=i(2377);r({target:"Array",proto:!0,forced:[].forEach!==n},{forEach:n})},5405:(e,t,i)=>{var r=i(9211),n=i(4152),o=i(6641);e.exports=function(e,t,i){var a,s;return o&&r(a=t.constructor)&&a!==i&&n(s=a.prototype)&&s!==i.prototype&&o(e,s),e}},5597:(e,t,i)=>{var r=i(9364),n=i(9377);r({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})},5599:e=>{e.exports=function(e){return null==e}},5716:(e,t,i)=>{var r=i(6458),n=i(9083),o=Math.floor,a=r("".charAt),s=r("".replace),l=r("".slice),d=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,i,r,u,h){var A=i+e.length,p=r.length,f=c;return void 0!==u&&(u=n(u),f=d),s(h,f,(function(n,s){var d;switch(a(s,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,i);case"'":return l(t,A);case"<":d=u[l(s,1,-1)];break;default:var c=+s;if(0===c)return n;if(c>p){var h=o(c/10);return 0===h?n:h<=p?void 0===r[h-1]?a(s,1):r[h-1]+a(s,1):n}d=r[c-1]}return void 0===d?"":d}))}},5727:(e,t,i)=>{var r=i(5057),n=i(9211),o=i(9615),a=i(9742),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return n(t)&&o(t.prototype,s(e))}},5736:(e,t,i)=>{var r=i(9211),n=i(4985),o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(n(e)+" is not a function")}},5758:(e,t,i)=>{var r=i(9364),n=i(4979).filter;r({target:"Array",proto:!0,forced:!i(8611)("filter")},{filter:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}})},5810:(e,t,i)=>{var r=i(526);e.exports=Array.isArray||function(e){return"Array"===r(e)}},5840:(e,t,i)=>{var r=i(5599),n=TypeError;e.exports=function(e){if(r(e))throw new n("Can't call method on "+e);return e}},5888:(e,t,i)=>{var r=i(2809);e.exports=function(e,t){var i=[][e];return!!i&&r((function(){i.call(null,t||function(){return 1},1)}))}},5957:(e,t,i)=>{var r=i(7749),n=i(8401);e.exports=function(e,t,i,o){try{return o?t(r(i)[0],i[1]):t(i)}catch(t){n(e,"throw",t)}}},5993:(e,t,i)=>{var r=i(1562),n=i(8053),o=i(526),a=function(e){return n.slice(0,e.length)===e};e.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":r.Bun&&"string"==typeof Bun.version?"BUN":r.Deno&&"object"==typeof Deno.version?"DENO":"process"===o(r.process)?"NODE":r.window&&r.document?"BROWSER":"REST"},6033:(e,t,i)=>{var r=i(1562);i(1541)(r.JSON,"JSON",!0)},6041:(e,t,i)=>{i(7267),i(804),i(1766),i(3992),i(947)},6071:(e,t,i)=>{var r=i(9646),n=i(2809),o=i(1465);e.exports=!r&&!n((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},6122:(e,t,i)=>{var r,n=i(7749),o=i(7815),a=i(6853),s=i(7923),l=i(4715),d=i(1465),c=i(577),u="prototype",h="script",A=c("IE_PROTO"),p=function(){},f=function(e){return"<"+h+">"+e+"</"+h+">"},_=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},m=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,i;m="undefined"!=typeof document?document.domain&&r?_(r):(t=d("iframe"),i="java"+h+":",t.style.display="none",l.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):_(r);for(var n=a.length;n--;)delete m[u][a[n]];return m()};s[A]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(p[u]=n(e),i=new p,p[u]=null,i[A]=e):i=m(),void 0===t?i:o.f(i,t)}},6263:(e,t,i)=>{var r=i(6656).PROPER,n=i(3930),o=i(7749),a=i(6677),s=i(2809),l=i(1144),d="toString",c=RegExp.prototype,u=c[d],h=s((function(){return"/a/b"!==u.call({source:"a",flags:"b"})})),A=r&&u.name!==d;(h||A)&&n(c,d,(function(){var e=o(this);return"/"+a(e.source)+"/"+a(l(e))}),{unsafe:!0})},6285:(e,t,i)=>{var r=i(1562);e.exports=r},6288:(e,t,i)=>{var r=i(2809),n=i(1562).RegExp;e.exports=r((function(){var e=n("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},6330:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6383:(e,t,i)=>{var r=i(9364),n=i(1562);r({global:!0,forced:n.globalThis!==n},{globalThis:n})},6399:(e,t,i)=>{i.d(t,{A:()=>r});const r={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},6458:(e,t,i)=>{var r=i(6898),n=Function.prototype,o=n.call,a=r&&n.bind.bind(o,o);e.exports=r?a:function(e){return function(){return o.apply(e,arguments)}}},6641:(e,t,i)=>{var r=i(1432),n=i(4152),o=i(5840),a=i(1068);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=r(Object.prototype,"__proto__","set"))(i,[]),t=i instanceof Array}catch(e){}return function(i,r){return o(i),a(r),n(i)?(t?e(i,r):i.__proto__=r,i):i}}():void 0)},6656:(e,t,i)=>{var r=i(9646),n=i(4347),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=n(o,"name"),l=s&&"something"===function(){}.name,d=s&&(!r||r&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:d}},6666:(e,t,i)=>{var r=i(2809),n=i(7553),o=i(9646),a=i(9845),s=n("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,i=new URLSearchParams("a=1&a=2&b=3"),r="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),r+=i+e})),i.delete("a",2),i.delete("b",void 0),a&&(!e.toJSON||!i.has("a",1)||i.has("a",2)||!i.has("a",void 0)||i.has("b"))||!t.size&&(a||!o)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==r||"x"!==new URL("https://x",void 0).host}))},6677:(e,t,i)=>{var r=i(497),n=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}},6728:(e,t,i)=>{var r=i(815),n=i(9518),o=i(7749),a=i(5599),s=i(2420),l=i(6677),d=i(5840),c=i(452),u=i(9987),h=i(9260);n("match",(function(e,t,i){return[function(t){var i=d(this),n=a(t)?void 0:c(t,e);return n?r(n,t,i):new RegExp(t)[e](l(i))},function(e){var r=o(this),n=l(e),a=i(t,r,n);if(a.done)return a.value;if(!r.global)return h(r,n);var d=r.unicode;r.lastIndex=0;for(var c,A=[],p=0;null!==(c=h(r,n));){var f=l(c[0]);A[p]=f,""===f&&(r.lastIndex=u(n,s(r.lastIndex),d)),p++}return 0===p?null:A}]}))},6810:(e,t,i)=>{var r=i(4417).charAt,n=i(6677),o=i(3587),a=i(2382),s=i(1567),l="String Iterator",d=o.set,c=o.getterFor(l);a(String,"String",(function(e){d(this,{type:l,string:n(e),index:0})}),(function(){var e,t=c(this),i=t.string,n=t.index;return n>=i.length?s(void 0,!0):(e=r(i,n),t.index+=e.length,s(e,!1))}))},6815:(e,t,i)=>{var r=i(5057),n=i(7225),o=i(1541);n("toStringTag"),o(r("Symbol"),"Symbol")},6853:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6898:(e,t,i)=>{var r=i(2809);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},6908:(e,t,i)=>{var r=i(815),n=i(9211),o=i(4152),a=TypeError;e.exports=function(e,t){var i,s;if("string"===t&&n(i=e.toString)&&!o(s=r(i,e)))return s;if(n(i=e.valueOf)&&!o(s=r(i,e)))return s;if("string"!==t&&n(i=e.toString)&&!o(s=r(i,e)))return s;throw new a("Can't convert object to primitive value")}},7024:(e,t,i)=>{var r=i(4685),n=Math.max,o=Math.min;e.exports=function(e,t){var i=r(e);return i<0?n(i+t,0):o(i,t)}},7042:(e,t,i)=>{var r=i(458),n=i(5736),o=i(6898),a=r(r.bind);e.exports=function(e,t){return n(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},7225:(e,t,i)=>{var r=i(6285),n=i(4347),o=i(605),a=i(3643).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});n(t,e)||a(t,e,{value:o.f(e)})}},7267:(e,t,i)=>{var r=i(9364),n=i(1562),o=i(815),a=i(6458),s=i(9845),l=i(9646),d=i(7917),c=i(2809),u=i(4347),h=i(9615),A=i(7749),p=i(2719),f=i(4151),_=i(6677),m=i(6330),v=i(6122),g=i(7642),y=i(2630),b=i(4884),S=i(7819),E=i(2897),w=i(3643),T=i(7815),k=i(7403),R=i(3930),O=i(1176),C=i(3463),B=i(577),x=i(7923),I=i(1002),L=i(7553),D=i(605),M=i(7225),P=i(4160),U=i(1541),F=i(3587),N=i(4979).forEach,V=B("hidden"),G="Symbol",j="prototype",$=F.set,W=F.getterFor(G),Q=Object[j],z=n.Symbol,H=z&&z[j],q=n.RangeError,Y=n.TypeError,X=n.QObject,Z=E.f,K=w.f,J=b.f,ee=k.f,te=a([].push),ie=C("symbols"),re=C("op-symbols"),ne=C("wks"),oe=!X||!X[j]||!X[j].findChild,ae=function(e,t,i){var r=Z(Q,t);r&&delete Q[t],K(e,t,i),r&&e!==Q&&K(Q,t,r)},se=l&&c((function(){return 7!==v(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?ae:K,le=function(e,t){var i=ie[e]=v(H);return $(i,{type:G,tag:e,description:t}),l||(i.description=t),i},de=function(e,t,i){e===Q&&de(re,t,i),A(e);var r=f(t);return A(i),u(ie,r)?(i.enumerable?(u(e,V)&&e[V][r]&&(e[V][r]=!1),i=v(i,{enumerable:m(0,!1)})):(u(e,V)||K(e,V,m(1,v(null))),e[V][r]=!0),se(e,r,i)):K(e,r,i)},ce=function(e,t){A(e);var i=p(t),r=g(i).concat(pe(i));return N(r,(function(t){l&&!o(ue,i,t)||de(e,t,i[t])})),e},ue=function(e){var t=f(e),i=o(ee,this,t);return!(this===Q&&u(ie,t)&&!u(re,t))&&(!(i||!u(this,t)||!u(ie,t)||u(this,V)&&this[V][t])||i)},he=function(e,t){var i=p(e),r=f(t);if(i!==Q||!u(ie,r)||u(re,r)){var n=Z(i,r);return!n||!u(ie,r)||u(i,V)&&i[V][r]||(n.enumerable=!0),n}},Ae=function(e){var t=J(p(e)),i=[];return N(t,(function(e){u(ie,e)||u(x,e)||te(i,e)})),i},pe=function(e){var t=e===Q,i=J(t?re:p(e)),r=[];return N(i,(function(e){!u(ie,e)||t&&!u(Q,e)||te(r,ie[e])})),r};d||(R(H=(z=function(){if(h(H,this))throw new Y("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?_(arguments[0]):void 0,t=I(e),i=function(e){var r=void 0===this?n:this;r===Q&&o(i,re,e),u(r,V)&&u(r[V],t)&&(r[V][t]=!1);var a=m(1,e);try{se(r,t,a)}catch(e){if(!(e instanceof q))throw e;ae(r,t,a)}};return l&&oe&&se(Q,t,{configurable:!0,set:i}),le(t,e)})[j],"toString",(function(){return W(this).tag})),R(z,"withoutSetter",(function(e){return le(I(e),e)})),k.f=ue,w.f=de,T.f=ce,E.f=he,y.f=b.f=Ae,S.f=pe,D.f=function(e){return le(L(e),e)},l&&(O(H,"description",{configurable:!0,get:function(){return W(this).description}}),s||R(Q,"propertyIsEnumerable",ue,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!d,sham:!d},{Symbol:z}),N(g(ne),(function(e){M(e)})),r({target:G,stat:!0,forced:!d},{useSetter:function(){oe=!0},useSimple:function(){oe=!1}}),r({target:"Object",stat:!0,forced:!d,sham:!l},{create:function(e,t){return void 0===t?v(e):ce(v(e),t)},defineProperty:de,defineProperties:ce,getOwnPropertyDescriptor:he}),r({target:"Object",stat:!0,forced:!d},{getOwnPropertyNames:Ae}),P(),U(z,G),x[V]=!0},7403:(e,t)=>{var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,n=r&&!i.call({1:2},1);t.f=n?function(e){var t=r(this,e);return!!t&&t.enumerable}:i},7477:(e,t,i)=>{var r=i(8635),n=i(9953),o=i(550),a=null,s=function(e,t){self.postMessage({msg:"logcat_callback",data:{type:e,logcat:t}})};function l(e,t){var i={msg:o.A.INIT_SEGMENT,data:{type:e,data:t}};self.postMessage(i,[t.data])}function d(e,t){var i={msg:o.A.MEDIA_SEGMENT,data:{type:e,data:t}};self.postMessage(i,[t.data])}function c(){var e={msg:o.A.LOADING_COMPLETE};self.postMessage(e)}function u(){var e={msg:o.A.RECOVERED_EARLY_EOF};self.postMessage(e)}function h(e){var t={msg:o.A.MEDIA_INFO,data:e};self.postMessage(t)}function A(e){var t={msg:o.A.METADATA_ARRIVED,data:e};self.postMessage(t)}function p(e){var t={msg:o.A.SCRIPTDATA_ARRIVED,data:e};self.postMessage(t)}function f(e){var t={msg:o.A.TIMED_ID3_METADATA_ARRIVED,data:e};self.postMessage(t)}function _(e){var t={msg:o.A.SMPTE2038_METADATA_ARRIVED,data:e};self.postMessage(t)}function m(e){var t={msg:o.A.SCTE35_METADATA_ARRIVED,data:e};self.postMessage(t)}function v(e){var t={msg:o.A.PES_PRIVATE_DATA_DESCRIPTOR,data:e};self.postMessage(t)}function g(e){var t={msg:o.A.PES_PRIVATE_DATA_ARRIVED,data:e};self.postMessage(t)}function y(e){var t={msg:o.A.STATISTICS_INFO,data:e};self.postMessage(t)}function b(e,t){self.postMessage({msg:o.A.IO_ERROR,data:{type:e,info:t}})}function S(e,t){self.postMessage({msg:o.A.DEMUX_ERROR,data:{type:e,info:t}})}function E(e){self.postMessage({msg:o.A.RECOMMEND_SEEKPOINT,data:e})}self.addEventListener("message",(function(e){switch(e.data.cmd){case"init":(a=new n.A(e.data.param[0],e.data.param[1])).on(o.A.IO_ERROR,b),a.on(o.A.DEMUX_ERROR,S),a.on(o.A.INIT_SEGMENT,l),a.on(o.A.MEDIA_SEGMENT,d),a.on(o.A.LOADING_COMPLETE,c),a.on(o.A.RECOVERED_EARLY_EOF,u),a.on(o.A.MEDIA_INFO,h),a.on(o.A.METADATA_ARRIVED,A),a.on(o.A.SCRIPTDATA_ARRIVED,p),a.on(o.A.TIMED_ID3_METADATA_ARRIVED,f),a.on(o.A.SMPTE2038_METADATA_ARRIVED,_),a.on(o.A.SCTE35_METADATA_ARRIVED,m),a.on(o.A.PES_PRIVATE_DATA_DESCRIPTOR,v),a.on(o.A.PES_PRIVATE_DATA_ARRIVED,g),a.on(o.A.STATISTICS_INFO,y),a.on(o.A.RECOMMEND_SEEKPOINT,E);break;case"destroy":a&&(a.destroy(),a=null),self.postMessage({msg:"destroyed"});break;case"start":null==a||a.start();break;case"stop":null==a||a.stop();break;case"seek":null==a||a.seek(e.data.param);break;case"pause":null==a||a.pause();break;case"resume":null==a||a.resume();break;case"logging_config":var t=e.data.param;r.A.applyConfig(t),!0===t.enableCallback?r.A.addLogListener(s):r.A.removeLogListener(s)}}))},7478:(e,t,i)=>{var r=i(4347),n=i(1209),o=i(2897),a=i(3643);e.exports=function(e,t,i){for(var s=n(t),l=a.f,d=o.f,c=0;c<s.length;c++){var u=s[c];r(e,u)||i&&r(i,u)||l(e,u,d(t,u))}}},7517:(e,t,i)=>{var r=i(2809),n=i(1562).RegExp;e.exports=r((function(){var e=n(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},7553:(e,t,i)=>{var r=i(1562),n=i(3463),o=i(4347),a=i(1002),s=i(7917),l=i(9742),d=r.Symbol,c=n("wks"),u=l?d.for||d:d&&d.withoutSetter||a;e.exports=function(e){return o(c,e)||(c[e]=s&&o(d,e)?d[e]:u("Symbol."+e)),c[e]}},7642:(e,t,i)=>{var r=i(3430),n=i(6853);e.exports=Object.keys||function(e){return r(e,n)}},7677:(e,t,i)=>{var r=i(7749);e.exports=function(){var e=r(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}},7712:(e,t,i)=>{var r=i(1147).IteratorPrototype,n=i(6122),o=i(6330),a=i(1541),s=i(2327),l=function(){return this};e.exports=function(e,t,i,d){var c=t+" Iterator";return e.prototype=n(r,{next:o(+!d,i)}),a(e,c,!1,!0),s[c]=l,e}},7749:(e,t,i)=>{var r=i(4152),n=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(n(e)+" is not an object")}},7815:(e,t,i)=>{var r=i(9646),n=i(2792),o=i(3643),a=i(7749),s=i(2719),l=i(7642);t.f=r&&!n?Object.defineProperties:function(e,t){a(e);for(var i,r=s(t),n=l(t),d=n.length,c=0;d>c;)o.f(e,i=n[c++],r[i]);return e}},7819:(e,t)=>{t.f=Object.getOwnPropertySymbols},7917:(e,t,i)=>{var r=i(4941),n=i(2809),o=i(1562).String;e.exports=!!Object.getOwnPropertySymbols&&!n((function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},7923:e=>{e.exports={}},7955:e=>{var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},7958:(e,t,i)=>{var r=i(8891),n=i(815),o=i(6458),a=i(9518),s=i(2809),l=i(7749),d=i(9211),c=i(5599),u=i(4685),h=i(2420),A=i(6677),p=i(5840),f=i(9987),_=i(452),m=i(5716),v=i(9260),g=i(7553)("replace"),y=Math.max,b=Math.min,S=o([].concat),E=o([].push),w=o("".indexOf),T=o("".slice),k="$0"==="a".replace(/./,"$0"),R=!!/./[g]&&""===/./[g]("a","$0");a("replace",(function(e,t,i){var o=R?"$":"$0";return[function(e,i){var r=p(this),o=c(e)?void 0:_(e,g);return o?n(o,e,r,i):n(t,A(r),e,i)},function(e,n){var a=l(this),s=A(e);if("string"==typeof n&&-1===w(n,o)&&-1===w(n,"$<")){var c=i(t,a,s,n);if(c.done)return c.value}var p=d(n);p||(n=A(n));var _,g=a.global;g&&(_=a.unicode,a.lastIndex=0);for(var k,R=[];null!==(k=v(a,s))&&(E(R,k),g);)""===A(k[0])&&(a.lastIndex=f(s,h(a.lastIndex),_));for(var O,C="",B=0,x=0;x<R.length;x++){for(var I,L=A((k=R[x])[0]),D=y(b(u(k.index),s.length),0),M=[],P=1;P<k.length;P++)E(M,void 0===(O=k[P])?O:String(O));var U=k.groups;if(p){var F=S([L],M,D,s);void 0!==U&&E(F,U),I=A(r(n,void 0,F))}else I=m(L,s,D,M,U,n);D>=B&&(C+=T(s,B,D)+I,B=D+L.length)}return C+T(s,B)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!k||R)},8053:(e,t,i)=>{var r=i(1562).navigator,n=r&&r.userAgent;e.exports=n?String(n):""},8098:(e,t,i)=>{i.d(t,{A:()=>g});var r=i(2460);const n=function(){function e(){var e;this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,(null===(e=self.performance)||void 0===e?void 0:e.now)?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0===e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}();var o,a=i(9034),s=i(8870),l=i(4383),d=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});const c=function(e){function t(t,i){var r=e.call(this,"fetch-stream-loader")||this;return r.TAG="FetchStreamLoader",r._seekHandler=t,r._config=i,r._needStash=!0,r._requestAbort=!1,r._abortController=null,r._contentLength=null,r._receivedLength=0,r}return d(t,e),t.isSupported=function(){var e;try{var t=s.A.msedge&&((null===(e=null===s.A||void 0===s.A?void 0:s.A.version)||void 0===e?void 0:e.minor)||0)>=15048&&!s.A.webkit,i=!s.A.msedge||t;return self.fetch&&self.ReadableStream&&i}catch(e){return!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){var i=this;this._dataSource=e,this._range=t;var r=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(r=e.redirectedURL);var n=this._seekHandler.getConfig(r,t),o=new self.Headers;if("object"==typeof n.headers){var s=n.headers;for(var d in s)s.hasOwnProperty(d)&&o.append(d,s[d])}var c={method:"GET",headers:o,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var d in this._config.headers)o.append(d,this._config.headers[d]);e.cors||(c.mode="same-origin"),e.withCredentials&&(c.credentials="include"),(null==e?void 0:e.referrerPolicy)&&(c.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,this._abortController&&(c.signal=this._abortController.signal)),this._status=a.eO.kConnecting,self.fetch(n.url,c).then((function(e){var t,r;if(i._requestAbort)return i._status=a.eO.kIdle,void(null===(t=e.body)||void 0===t||t.cancel());if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==n.url&&i._onURLRedirect){var o=i._seekHandler.removeURLParameters(e.url);i._onURLRedirect(o)}var s=e.headers.get("Content-Length");return null!=s&&(i._contentLength=parseInt(s),0!==i._contentLength&&i._onContentLengthKnown&&i._onContentLengthKnown(i._contentLength)),i._pump.call(i,null===(r=e.body)||void 0===r?void 0:r.getReader())}if(i._status=a.eO.kError,!i._onError)throw new l.Al("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);i._onError(a.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){var t;if(!(null===(t=i._abortController)||void 0===t?void 0:t.signal.aborted)){if(i._status=a.eO.kError,!i._onError)throw e;i._onError(a.Xv.EXCEPTION,{code:-1,msg:e.message})}}))},t.prototype.abort=function(){var e;if(this._requestAbort=!0,(this._status!==a.eO.kBuffering||!s.A.chrome)&&this._abortController)try{null===(e=this._abortController)||void 0===e||e.abort()}catch(e){}},t.prototype._pump=function(e){var t=this;return e.read().then((function(i){var r,n,o,s;if(i.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=a.eO.kError;var d=a.Xv.EARLY_EOF,c={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new l.Al(c.msg);t._onError(d,c)}else t._status=a.eO.kComplete,t._onComplete&&t._onComplete((null===(r=t._range)||void 0===r?void 0:r.from)||0,((null===(n=t._range)||void 0===n?void 0:n.from)||0)+t._receivedLength-1);else{if(null===(o=t._abortController)||void 0===o?void 0:o.signal.aborted)return void(t._status=a.eO.kComplete);if(t._requestAbort)return t._status=a.eO.kComplete,e.cancel();t._status=a.eO.kBuffering;var u=i.value.buffer,h=((null===(s=t._range)||void 0===s?void 0:s.from)||0)+t._receivedLength;t._receivedLength+=u.byteLength,t._onDataArrival&&t._onDataArrival(u,h,t._receivedLength),t._pump(e)}})).catch((function(e){var i,r;if(null===(r=null===(i=t._abortController)||void 0===i?void 0:i.signal)||void 0===r?void 0:r.aborted)t._status=a.eO.kComplete;else if(11!==e.code||!s.A.msedge){t._status=a.eO.kError;var n=0,o=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(n=a.Xv.EXCEPTION,o={code:e.code,msg:e.message}):(n=a.Xv.EARLY_EOF,o={code:e.code,msg:"Fetch stream meet Early-EOF"}),!t._onError)throw new l.Al(o.msg);t._onError(n,o)}}))},t}(a.HC);var u=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();const h=function(e){function t(t,i){var r=e.call(this,"xhr-moz-chunked-loader")||this;return r.TAG="MozChunkedLoader",r._seekHandler=t,r._config=i,r._needStash=!0,r._xhr=null,r._requestAbort=!1,r._contentLength=null,r._receivedLength=0,r}return u(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return r.A.w("MozChunkedLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(i=e.redirectedURL);var r=this._seekHandler.getConfig(i,t);this._requestURL=r.url;var n=this._xhr=new XMLHttpRequest;if(n.open("GET",r.url,!0),n.responseType="moz-chunked-arraybuffer",n.onreadystatechange=this._onReadyStateChange.bind(this),n.onprogress=this._onProgress.bind(this),n.onloadend=this._onLoadEnd.bind(this),n.onerror=this._onXhrError.bind(this),e.withCredentials&&(n.withCredentials=!0),"object"==typeof r.headers){var o=r.headers;for(var s in o)o.hasOwnProperty(s)&&n.setRequestHeader(s,o[s])}if("object"==typeof this._config.headers)for(var s in o=this._config.headers)o.hasOwnProperty(s)&&n.setRequestHeader(s,o[s]);this._status=a.eO.kConnecting,n.send()},t.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=a.eO.kComplete},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(void 0!==t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var i=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(i)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=a.eO.kError,!this._onError)throw new l.Al("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(a.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=a.eO.kBuffering}},t.prototype._onProgress=function(e){var t;if(this._status!==a.eO.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var i=e.target.response,r=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,r,this._receivedLength)}},t.prototype._onLoadEnd=function(e){this._requestAbort?this._requestAbort=!1:this._status!==a.eO.kError&&(this._status=a.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))},t.prototype._onXhrError=function(e){this._status=a.eO.kError;var t=0,i=null;if(this._contentLength&&e.loaded<this._contentLength?(t=a.Xv.EARLY_EOF,i={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=a.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new l.Al(i.msg);this._onError(t,i)},t}(a.HC);var A=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();const p=function(e){function t(t,i){var r=e.call(this,"xhr-range-loader")||this;return r.TAG="RangeLoader",r._seekHandler=t,r._config=i,r._needStash=!1,r._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],r._currentChunkSizeKB=384,r._currentSpeedNormalized=0,r._zeroSpeedChunkCount=0,r._xhr=null,r._speedSampler=new n,r._requestAbort=!1,r._waitForTotalLength=!1,r._totalLengthReceived=!1,r._currentRequestURL=null,r._currentRedirectedURL=null,r._currentRequestRange=null,r._totalLength=null,r._contentLength=null,r._receivedLength=0,r._lastTimeLoaded=0,r}return A(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return r.A.w("RangeLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},Object.defineProperty(t.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),t.prototype.open=function(e,t){this._dataSource=e,this._range=t,this._status=a.eO.kConnecting;var i=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(i=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||i?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))},t.prototype._openSubRange=function(){var e,t,i=1024*this._currentChunkSizeKB,r=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._receivedLength,n=r+i;null!=this._contentLength&&n-this._range.from>=this._contentLength&&(n=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._contentLength-1),this._currentRequestRange={from:r,to:n},this._internalOpen(this._dataSource,this._currentRequestRange)},t.prototype._internalOpen=function(e,t){this._lastTimeLoaded=0;var i=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?i=this._currentRedirectedURL:null!=e.redirectedURL&&(i=e.redirectedURL));var r=this._seekHandler.getConfig(i,t);this._currentRequestURL=r.url;var n=this._xhr=new XMLHttpRequest;if(n.open("GET",r.url,!0),n.responseType="arraybuffer",n.onreadystatechange=this._onReadyStateChange.bind(this),n.onprogress=this._onProgress.bind(this),n.onload=this._onLoad.bind(this),n.onerror=this._onXhrError.bind(this),e.withCredentials&&(n.withCredentials=!0),"object"==typeof r.headers){var o=r.headers;for(var a in o)o.hasOwnProperty(a)&&n.setRequestHeader(a,o[a])}if("object"==typeof this._config.headers)for(var a in o=this._config.headers)o.hasOwnProperty(a)&&n.setRequestHeader(a,o[a]);n.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=a.eO.kComplete},t.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var i=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&i!==this._currentRedirectedURL&&(this._currentRedirectedURL=i,this._onURLRedirect&&this._onURLRedirect(i))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=a.eO.kBuffering}else{if(this._status=a.eO.kError,!this._onError)throw new l.Al("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(a.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==a.eO.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var i=e.total;this._internalAbort(),null!=i&&0!==i&&(this._totalLength=i)}if(-1===this._range.to?this._contentLength=(this._totalLength||0)-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var r=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(r)}},t.prototype._normalizeSpeed=function(e){var t=this._chunkSizeKBList,i=t.length-1,r=0,n=0,o=i;if(e<t[0])return t[0];for(;n<=o;){if((r=n+Math.floor((o-n)/2))===i||e>=t[r]&&e<t[r+1])return t[r];t[r]<e?n=r+1:o=r-1}},t.prototype._onLoad=function(e){if(this._status!==a.eO.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),0!==t){var i=this._normalizeSpeed(t);this._currentSpeedNormalized!==i&&(this._currentSpeedNormalized=i,this._currentChunkSizeKB=i)}var r=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=r.byteLength;var o=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():o=!0,this._onDataArrival&&this._onDataArrival(r,n,this._receivedLength),o&&(this._status=a.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},t.prototype._onXhrError=function(e){this._status=a.eO.kError;var t=0,i=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=a.Xv.EARLY_EOF,i={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=a.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new l.Al(i.msg);this._onError(t,i)},t}(a.HC);var f=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();const _=function(e){function t(t,i){var r=e.call(this,"websocket-loader")||this;return r.TAG="WebSocketLoader",r._needStash=!0,r._ws=null,r._requestAbort=!1,r._receivedLength=0,r}return f(t,e),t.isSupported=function(){try{return void 0!==self.WebSocket}catch(e){return!1}},t.prototype.destroy=function(){this._ws&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=a.eO.kConnecting}catch(e){this._status=a.eO.kError;var i={code:e.code,msg:e.message};if(!this._onError)throw new l.Al(i.msg);this._onError(a.Xv.EXCEPTION,i)}},t.prototype.abort=function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=a.eO.kComplete},t.prototype._onWebSocketOpen=function(e){this._status=a.eO.kBuffering},t.prototype._onWebSocketClose=function(e){this._requestAbort?this._requestAbort=!1:(this._status=a.eO.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1))},t.prototype._onWebSocketMessage=function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var i=new FileReader;i.onload=function(){t._dispatchArrayBuffer(null==i?void 0:i.result)},i.readAsArrayBuffer(e.data)}else{this._status=a.eO.kError;var r={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new l.Al(r.msg);this._onError(a.Xv.EXCEPTION,r)}},t.prototype._dispatchArrayBuffer=function(e){var t=e,i=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)},t.prototype._onWebSocketError=function(e){this._status=a.eO.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new l.Al(t.msg);this._onError(a.Xv.EXCEPTION,t)},t}(a.HC),m=function(){function e(e){this._zeroStart=e||!1}return e.prototype.getConfig=function(e,t){var i,r={};return 0!==t.from||-1!==t.to?(i=-1!==t.to?"bytes=".concat(t.from.toString(),"-").concat(t.to.toString()):"bytes=".concat(t.from.toString(),"-"),r.Range=i):this._zeroStart&&(r.Range="bytes=0-"),{url:e,headers:r}},e.prototype.removeURLParameters=function(e){return e},e}(),v=function(){function e(e,t){this._startName=e,this._endName=t}return e.prototype.getConfig=function(e,t){var i=e;if(0!==t.from||-1!==t.to){var r=!0;i.includes("?")||(i+="?",r=!1),r&&(i+="&"),i+="".concat(this._startName,"=").concat(t.from.toString()),-1!==t.to&&(i+="&".concat(this._endName,"=").concat(t.to.toString()))}return{url:i,headers:{}}},e.prototype.removeURLParameters=function(e){var t,i=e.split("?")[0],r=e.indexOf("?");-1!==r&&(t=e.substring(r+1));var n="";if(void 0!==t&&t.length>0)for(var o=t.split("&"),a=0;a<o.length;a++){var s=o[a].split("="),l=a>0;s[0]!==this._startName&&s[0]!==this._endName&&(l&&(n+="&"),n+=o[a])}return 0===n.length?i:i+"?"+n},e}(),g=function(){function e(e,t,i){this.TAG="IOController",this._config=t,this._extraData=i,this._stashInitialSize=65536,void 0!==t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,t.enableStashBuffer||(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url||""),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new n,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return e.prototype.destroy=function(){var e,t,i;(null===(e=this._loader)||void 0===e?void 0:e.isWorking())&&(null===(t=this._loader)||void 0===t||t.abort()),null===(i=this._loader)||void 0===i||i.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},e.prototype.isWorking=function(){var e;return(null===(e=this._loader)||void 0===e?void 0:e.isWorking())&&!this._paused},e.prototype.isPaused=function(){return this._paused},Object.defineProperty(e.prototype,"status",{get:function(){var e;return null===(e=this._loader)||void 0===e?void 0:e.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){var e;return null===(e=this._dataSource)||void 0===e?void 0:e.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){var e;return null!=this._redirectedURL||void 0!==(null===(e=this._dataSource)||void 0===e?void 0:e.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){var e;return this._redirectedURL||(null===(e=this._dataSource)||void 0===e?void 0:e.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){var e,t;return this._loaderClass===p?null===(e=this._loader)||void 0===e?void 0:e.currentSpeed:null===(t=this._speedSampler)||void 0===t?void 0:t.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){var e;return null===(e=this._loader)||void 0===e?void 0:e.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new m(!!this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new v(t,i)}else{if("custom"!==e.seekType)throw new l.Qn("Invalid seekType in config: ".concat((null==e?void 0:e.seekType)||""));if("function"!=typeof e.customSeekHandler)throw new l.Qn("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}},e.prototype._selectLoader=function(){var e;if(null!=this._config.customLoader)this._loaderClass=(null===(e=this._config)||void 0===e?void 0:e.customLoader)||null;else if(this._isWebSocketURL)this._loaderClass=_;else if(c.isSupported())this._loaderClass=c;else if(h.isSupported())this._loaderClass=h;else{if(!p.isSupported())throw new l.Al("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=p}},e.prototype._createLoader=function(){var e;this._loaderClass&&(this._loader=new this._loaderClass(this._seekHandler,this._config),(null===(e=this._loader)||void 0===e?void 0:e.needStashBuffer)||(this._enableStash=!1),this._loader&&(this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)))},e.prototype.open=function(e){var t,i;this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),null===(t=this._speedSampler)||void 0===t||t.reset(),e||(this._fullRequestFlag=!0),null===(i=this._loader)||void 0===i||i.open(this._dataSource,Object.assign({},this._currentRange))},e.prototype.abort=function(){var e;null===(e=this._loader)||void 0===e||e.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},e.prototype.pause=function(){var e,t;this.isWorking()&&(null===(e=this._loader)||void 0===e||e.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange&&(this._currentRange.to=this._stashByteStart-1)):this._resumeFrom=((null===(t=this._currentRange)||void 0===t?void 0:t.to)||0)+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},e.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},e.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},e.prototype._internalSeek=function(e,t){var i,r,n,o;(null===(i=this._loader)||void 0===i?void 0:i.isWorking())&&(null===(r=this._loader)||void 0===r||r.abort()),this._flushStashBuffer(t),null===(n=this._loader)||void 0===n||n.destroy(),this._loader=null;var a={from:e,to:-1};this._currentRange={from:a.from,to:-1},null===(o=this._speedSampler)||void 0===o||o.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,a),this._onSeeked&&this._onSeeked()},e.prototype.updateUrl=function(e){if(!e||"string"!=typeof e||0===e.length)throw new l.Qn("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){for(var t=this._stashSize;t+1048576<e;)t*=2;if((t+=1048576)!==this._bufferSize){var i=new ArrayBuffer(t);if(this._stashUsed>0){var r=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(i,0,t).set(r,0)}this._stashBuffer=i,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,i=t.length-1,r=0,n=0,o=i;if(e<t[0])return t[0];for(;n<=o;){if((r=n+Math.floor((o-n)/2))===i||e>=t[r]&&e<t[r+1])return t[r];t[r]<e?n=r+1:o=r-1}},e.prototype._adjustStashSize=function(e){var t=0;(t=this._config.isLive?e/8:e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var i=1024*t+1048576;this._bufferSize<i&&this._expandBuffer(i),this._stashSize=1024*t},e.prototype._dispatchChunks=function(e,t){return this._currentRange&&(this._currentRange.to=t+e.byteLength-1),this._onDataArrival?this._onDataArrival(e,t):0},e.prototype._onURLRedirect=function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)},e.prototype._onContentLengthKnown=function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)},e.prototype._onLoaderChunkArrival=function(e,t,i){var r,n;if(!this._onDataArrival)throw new l.j4("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),null===(r=this._speedSampler)||void 0===r||r.addBytes(e.byteLength);var o=null===(n=this._speedSampler)||void 0===n?void 0:n.lastSecondKBps;if(0!==o){var a=this._normalizeSpeed(o);this._speedNormalized!==a&&(this._speedNormalized=a,this._adjustStashSize(a))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize)(c=new Uint8Array(this._stashBuffer,0,this._stashSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;else if(c=new Uint8Array(this._stashBuffer,0,this._bufferSize),this._stashUsed>0){var s=this._stashBuffer.slice(0,this._stashUsed);(u=this._dispatchChunks(s,this._stashByteStart))<s.byteLength?u>0&&(h=new Uint8Array(s,u),c.set(h,0),this._stashUsed=h.byteLength,this._stashByteStart+=u):(this._stashUsed=0,this._stashByteStart+=u),this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),c=new Uint8Array(this._stashBuffer,0,this._bufferSize)),c.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else(u=this._dispatchChunks(e,t))<e.byteLength&&((d=e.byteLength-u)>this._bufferSize&&(this._expandBuffer(d),c=new Uint8Array(this._stashBuffer,0,this._bufferSize)),c.set(new Uint8Array(e,u),0),this._stashUsed+=d,this._stashByteStart=t+u);else if(0===this._stashUsed){var d;(u=this._dispatchChunks(e,t))<e.byteLength&&((d=e.byteLength-u)>this._bufferSize&&this._expandBuffer(d),(c=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e,u),0),this._stashUsed+=d,this._stashByteStart=t+u)}else{var c,u;if(this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength),(c=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength,(u=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))<this._stashUsed&&u>0){var h=new Uint8Array(this._stashBuffer,u);c.set(h,0)}this._stashUsed-=u,this._stashByteStart+=u}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),n=t.byteLength-i;if(i<t.byteLength){if(!e){if(i>0){var o=new Uint8Array(this._stashBuffer,0,this._bufferSize),a=new Uint8Array(t,i);o.set(a,0),this._stashUsed=a.byteLength,this._stashByteStart+=i}return 0}r.A.w(this.TAG,"".concat(n," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,n}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){var i;switch(r.A.e(this.TAG,"Loader error, code = ".concat(t.code,", msg = ").concat(t.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=a.Xv.UNRECOVERABLE_EARLY_EOF),e){case a.Xv.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var n=((null===(i=this._currentRange)||void 0===i?void 0:i.to)||0)+1;return void(n<this._totalLength&&(r.A.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(n,!1)))}e=a.Xv.UNRECOVERABLE_EARLY_EOF;case a.Xv.UNRECOVERABLE_EARLY_EOF:case a.Xv.CONNECTING_TIMEOUT:case a.Xv.HTTP_STATUS_CODE_INVALID:case a.Xv.EXCEPTION:}if(!this._onError)throw new l.Al("IOException: "+t.msg);this._onError(e,t)},e}()},8125:(e,t,i)=>{var r=i(4347),n=i(9211),o=i(9083),a=i(577),s=i(8465),l=a("IE_PROTO"),d=Object,c=d.prototype;e.exports=s?d.getPrototypeOf:function(e){var t=o(e);if(r(t,l))return t[l];var i=t.constructor;return n(i)&&t instanceof i?i.prototype:t instanceof d?c:null}},8286:(e,t,i)=>{var r=i(9646),n=i(3643),o=i(6330);e.exports=function(e,t,i){r?n.f(e,t,o(0,i)):e[t]=i}},8401:(e,t,i)=>{var r=i(815),n=i(7749),o=i(452);e.exports=function(e,t,i){var a,s;n(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw i;return i}a=r(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw i;if(s)throw a;return n(a),i}},8465:(e,t,i)=>{var r=i(2809);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},8587:(e,t,i)=>{var r=i(2809),n=i(1562).RegExp,o=r((function(){var e=n("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=o||r((function(){return!n("a","y").sticky})),s=o||r((function(){var e=n("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},8611:(e,t,i)=>{var r=i(2809),n=i(7553),o=i(4941),a=n("species");e.exports=function(e){return o>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},8626:(e,t,i)=>{var r=i(6458);e.exports=r([].slice)},8635:(e,t,i)=>{i.d(t,{A:()=>o});var r=i(2139),n=i(2460);const o=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return n.A.FORCE_GLOBAL_TAG},set:function(t){n.A.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return n.A.GLOBAL_TAG},set:function(t){n.A.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return n.A.ENABLE_VERBOSE&&n.A.ENABLE_DEBUG&&n.A.ENABLE_INFO&&n.A.ENABLE_WARN&&n.A.ENABLE_ERROR},set:function(t){n.A.ENABLE_VERBOSE=t,n.A.ENABLE_DEBUG=t,n.A.ENABLE_INFO=t,n.A.ENABLE_WARN=t,n.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return n.A.ENABLE_DEBUG},set:function(t){n.A.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return n.A.ENABLE_VERBOSE},set:function(t){n.A.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return n.A.ENABLE_INFO},set:function(t){n.A.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return n.A.ENABLE_WARN},set:function(t){n.A.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return n.A.ENABLE_ERROR},set:function(t){n.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:n.A.GLOBAL_TAG,forceGlobalTag:n.A.FORCE_GLOBAL_TAG,enableVerbose:n.A.ENABLE_VERBOSE,enableDebug:n.A.ENABLE_DEBUG,enableInfo:n.A.ENABLE_INFO,enableWarn:n.A.ENABLE_WARN,enableError:n.A.ENABLE_ERROR,enableCallback:n.A.ENABLE_CALLBACK}},e.applyConfig=function(e){n.A.GLOBAL_TAG=e.globalTag,n.A.FORCE_GLOBAL_TAG=e.forceGlobalTag,n.A.ENABLE_VERBOSE=e.enableVerbose,n.A.ENABLE_DEBUG=e.enableDebug,n.A.ENABLE_INFO=e.enableInfo,n.A.ENABLE_WARN=e.enableWarn,n.A.ENABLE_ERROR=e.enableError,n.A.ENABLE_CALLBACK=!!e.enableCallback},e._notifyChange=function(){var t=e.emitter;if(t.listenerCount("change")>0){var i=e.getConfig();t.emit("change",i)}},e.registerListener=function(t){e.emitter.addListener("change",t)},e.removeListener=function(t){e.emitter.removeListener("change",t)},e.addLogListener=function(t){n.A.emitter.addListener("log",t),n.A.emitter.listenerCount("log")>0&&(n.A.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){n.A.emitter.removeListener("log",t),0===n.A.emitter.listenerCount("log")&&(n.A.ENABLE_CALLBACK=!1,e._notifyChange())},e.emitter=new r.A,e}()},8845:(e,t,i)=>{var r=i(9364),n=i(9646),o=i(1562),a=i(6458),s=i(4347),l=i(9211),d=i(9615),c=i(6677),u=i(1176),h=i(7478),A=o.Symbol,p=A&&A.prototype;if(n&&l(A)&&(!("description"in p)||void 0!==A().description)){var f={},_=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:c(arguments[0]),t=d(p,this)?new A(e):void 0===e?A():A(e);return""===e&&(f[t]=!0),t};h(_,A),_.prototype=p,p.constructor=_;var m="Symbol(description detection)"===String(A("description detection")),v=a(p.valueOf),g=a(p.toString),y=/^Symbol\((.*)\)[^)]+$/,b=a("".replace),S=a("".slice);u(p,"description",{configurable:!0,get:function(){var e=v(this);if(s(f,e))return"";var t=g(e),i=m?S(t,7,-1):b(t,y,"$1");return""===i?void 0:i}}),r({global:!0,constructor:!0,forced:!0},{Symbol:_})}},8862:(e,t,i)=>{var r=i(1562),n=i(9402),o=i(62),a=i(2377),s=i(9277),l=function(e){if(e&&e.forEach!==a)try{s(e,"forEach",a)}catch(t){e.forEach=a}};for(var d in n)n[d]&&l(r[d]&&r[d].prototype);l(o)},8870:(e,t,i)=>{i.d(t,{A:()=>n});var r={};!function(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.includes("trident")&&/(rv)(?::| )([\w.]+)/.exec(e)||!e.includes("compatible")&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],i=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],n={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},o={};if(n.browser){o[n.browser]=!0;var a=n.majorVersion.split(".");o.version={major:parseInt(n.majorVersion,10),string:n.version},a.length>1&&(o.version.minor=parseInt(a[1],10)),a.length>2&&(o.version.build=parseInt(a[2],10))}if(n.platform&&(o[n.platform]=!0),(o.chrome||o.opr||o.safari)&&(o.webkit=!0),o.rv||o.iemobile){o.rv&&delete o.rv;var s="msie";n.browser=s,o[s]=!0}if(o.edge){delete o.edge;var l="msedge";n.browser=l,o[l]=!0}if(o.opr){var d="opera";n.browser=d,o[d]=!0}if(o.safari&&o.android){var c="android";n.browser=c,o[c]=!0}for(var u in o.name=n.browser,o.platform=n.platform,r)Object.prototype.hasOwnProperty.call(r,u)&&delete r[u];Object.assign(r,o)}();const n=r},8873:(e,t,i)=>{var r=i(3930);e.exports=function(e,t,i){for(var n in t)r(e,n,t[n],i);return e}},8891:(e,t,i)=>{var r=i(6898),n=Function.prototype,o=n.apply,a=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},9034:(e,t,i)=>{i.d(t,{HC:()=>a,Xv:()=>o,eO:()=>n});var r=i(4383),n={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},o={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},a=function(){function e(e){this._type=e||"undefined",this._status=n.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return e.prototype.destroy=function(){this._status=n.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},e.prototype.isWorking=function(){return this._status===n.kConnecting||this._status===n.kBuffering},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),e.prototype.open=function(e,t){throw new r.Xu("Unimplemented abstract function!")},e.prototype.abort=function(){throw new r.Xu("Unimplemented abstract function!")},e}()},9047:(e,t,i)=>{var r=i(5810),n=i(2671),o=i(4152),a=i(7553)("species"),s=Array;e.exports=function(e){var t;return r(e)&&(t=e.constructor,(n(t)&&(t===s||r(t.prototype))||o(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?s:t}},9083:(e,t,i)=>{var r=i(5840),n=Object;e.exports=function(e){return n(r(e))}},9211:e=>{var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},9260:(e,t,i)=>{var r=i(815),n=i(7749),o=i(9211),a=i(526),s=i(9377),l=TypeError;e.exports=function(e,t){var i=e.exec;if(o(i)){var d=r(i,e,t);return null!==d&&n(d),d}if("RegExp"===a(e))return r(s,e,t);throw new l("RegExp#exec called on incompatible receiver")}},9266:(e,t,i)=>{var r=i(7917);e.exports=r&&!!Symbol.for&&!!Symbol.keyFor},9273:(e,t,i)=>{var r=i(497),n=i(452),o=i(5599),a=i(2327),s=i(7553)("iterator");e.exports=function(e){if(!o(e))return n(e,s)||n(e,"@@iterator")||a[r(e)]}},9277:(e,t,i)=>{var r=i(9646),n=i(3643),o=i(6330);e.exports=r?function(e,t,i){return n.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},9364:(e,t,i)=>{var r=i(1562),n=i(2897).f,o=i(9277),a=i(3930),s=i(4191),l=i(7478),d=i(4346);e.exports=function(e,t){var i,c,u,h,A,p=e.target,f=e.global,_=e.stat;if(i=f?r:_?r[p]||s(p,{}):r[p]&&r[p].prototype)for(c in t){if(h=t[c],u=e.dontCallGetSet?(A=n(i,c))&&A.value:i[c],!d(f?c:p+(_?".":"#")+c,e.forced)&&void 0!==u){if(typeof h==typeof u)continue;l(h,u)}(e.sham||u&&u.sham)&&o(h,"sham",!0),a(i,c,h,e)}}},9377:(e,t,i)=>{var r,n,o=i(815),a=i(6458),s=i(6677),l=i(7677),d=i(8587),c=i(3463),u=i(6122),h=i(3587).get,A=i(7517),p=i(6288),f=c("native-string-replace",String.prototype.replace),_=RegExp.prototype.exec,m=_,v=a("".charAt),g=a("".indexOf),y=a("".replace),b=a("".slice),S=(n=/b*/g,o(_,r=/a/,"a"),o(_,n,"a"),0!==r.lastIndex||0!==n.lastIndex),E=d.BROKEN_CARET,w=void 0!==/()??/.exec("")[1];(S||w||E||A||p)&&(m=function(e){var t,i,r,n,a,d,c,A=this,p=h(A),T=s(e),k=p.raw;if(k)return k.lastIndex=A.lastIndex,t=o(m,k,T),A.lastIndex=k.lastIndex,t;var R=p.groups,O=E&&A.sticky,C=o(l,A),B=A.source,x=0,I=T;if(O&&(C=y(C,"y",""),-1===g(C,"g")&&(C+="g"),I=b(T,A.lastIndex),A.lastIndex>0&&(!A.multiline||A.multiline&&"\n"!==v(T,A.lastIndex-1))&&(B="(?: "+B+")",I=" "+I,x++),i=new RegExp("^(?:"+B+")",C)),w&&(i=new RegExp("^"+B+"$(?!\\s)",C)),S&&(r=A.lastIndex),n=o(_,O?i:A,I),O?n?(n.input=b(n.input,x),n[0]=b(n[0],x),n.index=A.lastIndex,A.lastIndex+=n[0].length):A.lastIndex=0:S&&n&&(A.lastIndex=A.global?n.index+n[0].length:r),w&&n&&n.length>1&&o(f,n[0],i,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(n[a]=void 0)})),n&&R)for(n.groups=d=u(null),a=0;a<R.length;a++)d[(c=R[a])[0]]=n[c[1]];return n}),e.exports=m},9402:e=>{e.exports={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}},9518:(e,t,i)=>{i(5597);var r=i(815),n=i(3930),o=i(9377),a=i(2809),s=i(7553),l=i(9277),d=s("species"),c=RegExp.prototype;e.exports=function(e,t,i,u){var h=s(e),A=!a((function(){var t={};return t[h]=function(){return 7},7!==""[e](t)})),p=A&&!a((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[d]=function(){return i},i.flags="",i[h]=/./[h]),i.exec=function(){return t=!0,null},i[h](""),!t}));if(!A||!p||i){var f=/./[h],_=t(h,""[e],(function(e,t,i,n,a){var s=t.exec;return s===o||s===c.exec?A&&!a?{done:!0,value:r(f,t,i,n)}:{done:!0,value:r(e,i,t,n)}:{done:!1}}));n(String.prototype,e,_[0]),n(c,h,_[1])}u&&l(c[h],"sham",!0)}},9603:(e,t,i)=>{var r=i(5057),n=i(1176),o=i(7553),a=i(9646),s=o("species");e.exports=function(e){var t=r(e);a&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},9614:(e,t,i)=>{var r=i(3643).f;e.exports=function(e,t,i){i in e||r(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})}},9615:(e,t,i)=>{var r=i(6458);e.exports=r({}.isPrototypeOf)},9646:(e,t,i)=>{var r=i(2809);e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},9666:(e,t,i)=>{var r=i(4152),n=i(526),o=i(7553)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"===n(e))}},9688:(e,t,i)=>{var r=i(9364),n=i(2809),o=i(5810),a=i(4152),s=i(9083),l=i(256),d=i(7955),c=i(8286),u=i(2807),h=i(8611),A=i(7553),p=i(4941),f=A("isConcatSpreadable"),_=p>=51||!n((function(){var e=[];return e[f]=!1,e.concat()[0]!==e})),m=function(e){if(!a(e))return!1;var t=e[f];return void 0!==t?!!t:o(e)};r({target:"Array",proto:!0,arity:1,forced:!_||!h("concat")},{concat:function(e){var t,i,r,n,o,a=s(this),h=u(a,0),A=0;for(t=-1,r=arguments.length;t<r;t++)if(m(o=-1===t?a:arguments[t]))for(n=l(o),d(A+n),i=0;i<n;i++,A++)i in o&&c(h,A,o[i]);else d(A+1),c(h,A++,o);return h.length=A,h}})},9695:(e,t,i)=>{var r=i(6458),n=i(5810),o=i(9211),a=i(526),s=i(6677),l=r([].push);e.exports=function(e){if(o(e))return e;if(n(e)){for(var t=e.length,i=[],r=0;r<t;r++){var d=e[r];"string"==typeof d?l(i,d):"number"!=typeof d&&"Number"!==a(d)&&"String"!==a(d)||l(i,s(d))}var c=i.length,u=!0;return function(e,t){if(u)return u=!1,t;if(n(this))return t;for(var r=0;r<c;r++)if(i[r]===e)return t}}}},9742:(e,t,i)=>{var r=i(7917);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},9845:e=>{e.exports=!1},9879:e=>{var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?i:t)(r)}},9917:(e,t,i)=>{var r=i(9922),n=i(3930),o=i(309);r||n(Object.prototype,"toString",o,{unsafe:!0})},9922:(e,t,i)=>{var r={};r[i(7553)("toStringTag")]="z",e.exports="[object z]"===String(r)},9953:(e,t,i)=>{i.d(t,{A:()=>Me});var r=i(2139),n=i(2460),o=i(8870),a=i(719);function s(e,t,i){var r=e;if(t+i<r.length){for(;i--;)if(128!=(192&r[++t]))return!1;return!0}return!1}const l=function(e){for(var t=[],i=e,r=0,n=e.length;r<n;)if(i[r]<128)t.push(String.fromCharCode(i[r])),++r;else{if(i[r]<192);else if(i[r]<224){if(s(i,r,1)&&(o=(31&i[r])<<6|63&i[r+1])>=128){t.push(String.fromCharCode(65535&o)),r+=2;continue}}else if(i[r]<240){if(s(i,r,2)&&(o=(15&i[r])<<12|(63&i[r+1])<<6|63&i[r+2])>=2048&&55296!=(63488&o)){t.push(String.fromCharCode(65535&o)),r+=3;continue}}else if(i[r]<248){var o;if(s(i,r,3)&&(o=(7&i[r])<<18|(63&i[r+1])<<12|(63&i[r+2])<<6|63&i[r+3])>65536&&o<1114112){o-=65536,t.push(String.fromCharCode(o>>>10|55296)),t.push(String.fromCharCode(1023&o|56320)),r+=4;continue}}t.push(String.fromCharCode(65533)),++r}return t.join("")};var d,c=i(4383),u=(d=new ArrayBuffer(2),new DataView(d).setInt16(0,256,!0),256===new Int16Array(d)[0]);const h=function(){function e(){}return e.parseScriptData=function(t,i,r){var o={};try{var a=e.parseValue(t,i,r),s=e.parseValue(t,i+a.size,r-a.size);o[a.data]=s.data}catch(e){n.A.e("AMF",e.toString())}return o},e.parseObject=function(t,i,r){if(r<3)throw new c.j4("Data not enough when parse ScriptDataObject");var n=e.parseString(t,i,r),o=e.parseValue(t,i+n.size,r-n.size),a=o.objectEnd;return{data:{name:n.data,value:o.data},size:n.size+o.size,objectEnd:a}},e.parseVariable=function(t,i,r){return e.parseObject(t,i,r)},e.parseString=function(e,t,i){if(i<2)throw new c.j4("Data not enough when parse String");var r=new DataView(e,t,i).getUint16(0,!u);return{data:r>0?l(new Uint8Array(e,t+2,r)):"",size:2+r}},e.parseLongString=function(e,t,i){if(i<4)throw new c.j4("Data not enough when parse LongString");var r=new DataView(e,t,i).getUint32(0,!u);return{data:r>0?l(new Uint8Array(e,t+4,r)):"",size:4+r}},e.parseDate=function(e,t,i){if(i<10)throw new c.j4("Data size invalid when parse Date");var r=new DataView(e,t,i),n=r.getFloat64(0,!u),o=r.getInt16(8,!u);return{data:new Date(n+=60*o*1e3),size:10}},e.parseValue=function(t,i,r){if(r<1)throw new c.j4("Data not enough when parse Value");var o,a=new DataView(t,i,r),s=1,l=a.getUint8(0),d=!1;try{switch(l){case 0:o=a.getFloat64(1,!u),s+=8;break;case 1:o=!!a.getUint8(1),s+=1;break;case 2:var h=e.parseString(t,i+1,r-1);o=h.data,s+=h.size;break;case 3:o={};var A=0;for(9==(16777215&a.getUint32(r-4,!u))&&(A=3);s<r-4;){var p=e.parseObject(t,i+s,r-s-A);if(p.objectEnd)break;o[p.data.name]=p.data.value,s+=p.size}s<=r-3&&9==(16777215&a.getUint32(s-1,!u))&&(s+=3);break;case 8:for(o={},s+=4,A=0,9==(16777215&a.getUint32(r-4,!u))&&(A=3);s<r-8;){var f=e.parseVariable(t,i+s,r-s-A);if(f.objectEnd)break;o[f.data.name]=f.data.value,s+=f.size}s<=r-3&&9==(16777215&a.getUint32(s-1,!u))&&(s+=3);break;case 9:o=void 0,s=1,d=!0;break;case 10:o=[];var _=a.getUint32(1,!u);s+=4;for(var m=0;m<_;m++){var v=e.parseValue(t,i+s,r-s);o.push(v.data),s+=v.size}break;case 11:var g=e.parseDate(t,i+1,r-1);o=g.data,s+=g.size;break;case 12:var y=e.parseString(t,i+1,r-1);o=y.data,s+=y.size;break;default:s=r,n.A.w("AMF","Unsupported AMF value type "+l.toString())}}catch(e){n.A.e("AMF",e.toString())}return{data:o,size:s,objectEnd:d}},e}(),A=function(){function e(e){this.TAG="ExpGolomb",this._buffer=e,this._buffer_index=0,this._total_bytes=e.byteLength,this._total_bits=8*e.byteLength,this._current_word=0,this._current_word_bits_left=0}return e.prototype.destroy=function(){this._buffer=null},e.prototype._fillCurrentWord=function(){var e,t=this._total_bytes-this._buffer_index;if(t<=0)throw new c.j4("ExpGolomb: _fillCurrentWord() but no bytes available");var i=Math.min(4,t),r=new Uint8Array(4);r.set(null===(e=this._buffer)||void 0===e?void 0:e.subarray(this._buffer_index,this._buffer_index+i)),this._current_word=new DataView(r.buffer).getUint32(0,!1),this._buffer_index+=i,this._current_word_bits_left=8*i},e.prototype.readBits=function(e){if(e>32)throw new c.Qn("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var i=this._current_word_bits_left?this._current_word:0;i>>>=32-this._current_word_bits_left;var r=e-this._current_word_bits_left;this._fillCurrentWord();var n=Math.min(r,this._current_word_bits_left),o=this._current_word>>>32-n;return this._current_word<<=n,this._current_word_bits_left-=n,i<<n|o},e.prototype.readBool=function(){return 1===this.readBits(1)},e.prototype.readByte=function(){return this.readBits(8)},e.prototype._skipLeadingZero=function(){var e;for(e=0;e<this._current_word_bits_left;e++)if(this._current_word&2147483648>>>e)return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},e.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},e.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},e}(),p=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,r=new Uint8Array(i),n=0,o=0;o<i;o++)o>=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(r[n]=t[o],n++);return new Uint8Array(r.buffer,0,n)},e.parseSPS=function(t){for(var i=t.subarray(1,4),r="avc1.",n=0;n<3;n++){var o=i[n].toString(16);o.length<2&&(o="0"+o),r+=o}var a=e._ebsp2rbsp(t),s=new A(a);s.readByte();var l=s.readByte();s.readByte();var d=s.readByte();s.readUEG();var c=e.getProfileString(l),u=e.getLevelString(d),h=1,p=420,f=8,_=8;if((100===l||110===l||122===l||244===l||44===l||83===l||86===l||118===l||128===l||138===l||144===l)&&(3===(h=s.readUEG())&&s.readBits(1),h<=3&&(p=[0,420,422,444][h]),f=s.readUEG()+8,_=s.readUEG()+8,s.readBits(1),s.readBool()))for(var m=3!==h?8:12,v=0;v<m;v++)s.readBool()&&(v<6?e._skipScalingList(s,16):e._skipScalingList(s,64));s.readUEG();var g=s.readUEG();if(0===g)s.readUEG();else if(1===g){s.readBits(1),s.readSEG(),s.readSEG();var y=s.readUEG();for(v=0;v<y;v++)s.readSEG()}var b=s.readUEG();s.readBits(1);var S=s.readUEG(),E=s.readUEG(),w=s.readBits(1);0===w&&s.readBits(1),s.readBits(1);var T=0,k=0,R=0,O=0;s.readBool()&&(T=s.readUEG(),k=s.readUEG(),R=s.readUEG(),O=s.readUEG());var C=1,B=1,x=0,I=!0,L=0,D=0;if(s.readBool()){if(s.readBool()){var M=s.readByte();M>0&&M<16?(C=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][M-1],B=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][M-1]):255===M&&(C=s.readByte()<<8|s.readByte(),B=s.readByte()<<8|s.readByte())}if(s.readBool()&&s.readBool(),s.readBool()&&(s.readBits(4),s.readBool()&&s.readBits(24)),s.readBool()&&(s.readUEG(),s.readUEG()),s.readBool()){var P=s.readBits(32),U=s.readBits(32);I=s.readBool(),x=(L=U)/(D=2*P)}}var F=1;1===C&&1===B||(F=C/B);var N=0,V=0;0===h?(N=1,V=2-w):(N=3===h?1:2,V=(1===h?2:1)*(2-w));var G=16*(S+1),j=16*(E+1)*(2-w);G-=(T+k)*N,j-=(R+O)*V;var $=Math.ceil(G*F);return s.destroy(),s=null,{codec_mimetype:r,profile_idc:l,level_idc:d,profile_string:c,level_string:u,chroma_format_idc:h,bit_depth:f,bit_depth_luma:f,bit_depth_chroma:_,ref_frames:b,chroma_format:p,chroma_format_string:e.getChromaFormatString(p),frame_rate:{fixed:I,fps:x,fps_den:D,fps_num:L},sar_ratio:{width:C,height:B},codec_size:{width:G,height:j},present_size:{width:$,height:j}}},e._skipScalingList=function(e,t){for(var i=8,r=8,n=0;n<t;n++)0!==r&&(r=(i+e.readSEG()+256)%256),i=0===r?i:r},e.getProfileString=function(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}},e.getLevelString=function(e){return(e/10).toFixed(1)},e.getChromaFormatString=function(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},e}();var f=i(6399);const _=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,r=new Uint8Array(i),n=0,o=0;o<i;o++)o>=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(r[n]=t[o],n++);return new Uint8Array(r.buffer,0,n)},e.parseVPS=function(t){var i=e._ebsp2rbsp(t),r=new A(i);return r.readByte(),r.readByte(),r.readBits(4),r.readBits(2),r.readBits(6),{num_temporal_layers:r.readBits(3)+1,temporal_id_nested:r.readBool()}},e.parseSPS=function(t){var i=e._ebsp2rbsp(t),r=new A(i);r.readByte(),r.readByte();for(var n=0,o=0,a=0,s=0,l=(r.readBits(4),r.readBits(3)),d=(r.readBool(),r.readBits(2)),c=r.readBool(),u=r.readBits(5),h=r.readByte(),p=r.readByte(),f=r.readByte(),_=r.readByte(),m=r.readByte(),v=r.readByte(),g=r.readByte(),y=r.readByte(),b=r.readByte(),S=r.readByte(),E=r.readByte(),w=[],T=[],k=0;k<l;k++)w.push(r.readBool()),T.push(r.readBool());if(l>0)for(k=l;k<8;k++)r.readBits(2);for(k=0;k<l;k++)w[k]&&(r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte()),T[k]&&r.readByte();r.readUEG();var R=r.readUEG();3===R&&r.readBits(1);var O=r.readUEG(),C=r.readUEG();r.readBool()&&(n+=r.readUEG(),o+=r.readUEG(),a+=r.readUEG(),s+=r.readUEG());var B=r.readUEG(),x=r.readUEG(),I=r.readUEG();for(k=r.readBool()?0:l;k<=l;k++)r.readUEG(),r.readUEG(),r.readUEG();if(r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG(),r.readBool()&&r.readBool())for(var L=0;L<4;L++)for(var D=0;D<(3===L?2:6);D++)if(r.readBool()){var M=Math.min(64,1<<4+(L<<1));for(L>1&&r.readSEG(),k=0;k<M;k++)r.readSEG()}else r.readUEG();r.readBool(),r.readBool(),r.readBool()&&(r.readByte(),r.readUEG(),r.readUEG(),r.readBool());var P=r.readUEG(),U=0;for(k=0;k<P;k++){var F=!1;if(0!==k&&(F=r.readBool()),F){k===P&&r.readUEG(),r.readBool(),r.readUEG();for(var N=0,V=0;V<=U;V++){var G=r.readBool(),j=!1;G||(j=r.readBool()),(G||j)&&N++}U=N}else{var $=r.readUEG(),W=r.readUEG();for(U=$+W,V=0;V<$;V++)r.readUEG(),r.readBool();for(V=0;V<W;V++)r.readUEG(),r.readBool()}}if(r.readBool()){var Q=r.readUEG();for(k=0;k<Q;k++){for(V=0;V<I+4;V++)r.readBits(1);r.readBits(1)}}var z=0,H=1,q=1,Y=!1,X=1,Z=1;if(r.readBool(),r.readBool(),r.readBool()){if(r.readBool()){var K=r.readByte();K>0&&K<=16?(H=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][K-1],q=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][K-1]):255===K&&(H=r.readBits(16),q=r.readBits(16))}if(r.readBool()&&r.readBool(),r.readBool()&&(r.readBits(3),r.readBool(),r.readBool()&&(r.readByte(),r.readByte(),r.readByte())),r.readBool()&&(r.readUEG(),r.readUEG()),r.readBool(),r.readBool(),r.readBool(),r.readBool()&&(r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG()),r.readBool()&&(X=r.readBits(32),Z=r.readBits(32),r.readBool()&&r.readUEG(),r.readBool())){var J,ee,te=!1;for(J=r.readBool(),ee=r.readBool(),(J||ee)&&((te=r.readBool())&&(r.readByte(),r.readBits(5),r.readBool(),r.readBits(5)),r.readBits(4),r.readBits(4),te&&r.readBits(4),r.readBits(5),r.readBits(5),r.readBits(5)),k=0;k<=l;k++){var ie=r.readBool();Y=ie;var re=!1,ne=1;ie||(re=r.readBool());var oe=!1;if(re?r.readSEG():oe=r.readBool(),oe||(ne=r.readUEG()+1),J)for(V=0;V<ne;V++)r.readUEG(),r.readUEG(),te&&(r.readUEG(),r.readUEG());if(ee)for(V=0;V<ne;V++)r.readUEG(),r.readUEG(),te&&(r.readUEG(),r.readUEG())}}r.readBool()&&(r.readBool(),r.readBool(),r.readBool(),z=r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG())}r.readBool();var ae="hvc1.".concat(u,".1.L").concat(E,".B0"),se=O-(n+o)*(1===R||2===R?2:1),le=C-(a+s)*(1===R?2:1),de=1;return 1!==H&&1!==q&&(de=H/q),r.destroy(),r=null,{codec_mimetype:ae,level_string:e.getLevelString(E),profile_idc:u,bit_depth:B+8,ref_frames:1,chroma_format:R,chroma_format_string:e.getChromaFormatString(R),general_level_idc:E,general_profile_space:d,general_tier_flag:c,general_profile_idc:u,general_profile_compatibility_flags_1:h,general_profile_compatibility_flags_2:p,general_profile_compatibility_flags_3:f,general_profile_compatibility_flags_4:_,general_constraint_indicator_flags_1:m,general_constraint_indicator_flags_2:v,general_constraint_indicator_flags_3:g,general_constraint_indicator_flags_4:y,general_constraint_indicator_flags_5:b,general_constraint_indicator_flags_6:S,min_spatial_segmentation_idc:z,constant_frame_rate:0,chroma_format_idc:R,bit_depth_luma_minus8:B,bit_depth_chroma_minus8:x,frame_rate:{fixed:Y,fps:Z/X,fps_den:X,fps_num:Z},sar_ratio:{width:H,height:q},codec_size:{width:se,height:le},present_size:{width:se*de,height:le}}},e.parsePPS=function(t){var i=e._ebsp2rbsp(t),r=new A(i);r.readByte(),r.readByte(),r.readUEG(),r.readUEG(),r.readBool(),r.readBool(),r.readBits(3),r.readBool(),r.readBool(),r.readUEG(),r.readUEG(),r.readSEG(),r.readBool(),r.readBool(),r.readBool()&&r.readUEG(),r.readSEG(),r.readSEG(),r.readBool(),r.readBool(),r.readBool(),r.readBool();var n=r.readBool(),o=r.readBool(),a=1;return o&&n?a=0:o?a=3:n&&(a=2),{parallelismType:a}},e.getChromaFormatString=function(e){switch(e){case 0:return"4:0:0";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}},e.getProfileString=function(e){switch(e){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}},e.getLevelString=function(e){return(e/30).toFixed(1)},e}();function m(e){return e.byteOffset%2==0&&e.byteLength%2==0}function v(e){return e.byteOffset%4==0&&e.byteLength%4==0}function g(e,t){for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const y=function(e,t){return e.byteLength===t.byteLength&&(v(e)&&v(t)?function(e,t){return g(new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4),new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4))}(e,t):m(e)&&m(t)?function(e,t){return g(new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2))}(e,t):function(e,t){return g(e,t)}(e,t))},b=function(){function e(){}return e.parseOBUs=function(t){for(var i=null,r=0;r<t.byteLength;){t[r];var n=(120&t[r])>>3,o=!!(4&t[r]),a=!!(2&t[r]);t[r],r+=1,o&&(r+=1);var s=Number.POSITIVE_INFINITY;if(a){s=0;for(var l=0;s|=(127&t[r])<<7*l,128&t[r+=1];l++);}1===n&&(i=e.parseSeuqneceHeader(t.subarray(r,r+s))),r+=s}return i},e.parseSeuqneceHeader=function(t){var i=new A(t),r=i.readBits(3),n=(i.readBool(),i.readBool()),o=!0,a=0,s=0,l=[];if(n)l.push({operating_point_idc:0,level:i.readBits(5),tier:0});else{if(i.readBool()){var d=i.readBits(32),c=i.readBits(32),u=i.readBool();if(u){for(var h=0;0===i.readBits(1);)h+=1;h>=32||i.readBits(h)}a=c,s=d,o=u,i.readBool()&&(i.readBits(5),i.readBits(32),i.readBits(5),i.readBits(5))}for(var p=i.readBool(),f=i.readBits(5),_=0;_<=f;_++){var m=i.readBits(12),v=i.readBits(5),g=v>7?i.readBits(1):0;l.push({operating_point_idc:m,level:v,tier:g}),p&&i.readBool()&&i.readBits(4)}}var y=l[0],b=y.level,S=y.tier,E=i.readBits(4),w=i.readBits(4),T=i.readBits(E+1)+1,k=i.readBits(w+1)+1,R=!1;n||(R=i.readBool()),R&&(i.readBits(4),i.readBits(4)),i.readBool(),i.readBool(),i.readBool();var O=!1;n||(i.readBool(),i.readBool(),i.readBool(),i.readBool(),(O=i.readBool())&&(i.readBool(),i.readBool()),(i.readBool()||i.readBits(1))&&(i.readBool()||i.readBits(1)),O&&i.readBits(3)),i.readBool(),i.readBool(),i.readBool();var C=i.readBool(),B=8;B=2===r&&C?i.readBool()?12:10:C?10:8;var x=!1;1!==r&&(x=i.readBool()),i.readBool()&&(i.readBits(8),i.readBits(8),i.readBits(8));var I=1,L=1;return x?(i.readBits(1),I=1,L=1):(i.readBits(1),0===r?(I=1,L=1):1===r?(I=0,L=0):12===B?i.readBits(1)&&i.readBits(1):(I=1,L=0),I&&L&&i.readBits(2),i.readBits(1)),i.readBool(),i.destroy(),i=null,{codec_mimetype:"av01.".concat(r,".").concat(e.getLevelString(b,S),".").concat(B.toString(10).padStart(2,"0")),level:b,tier:S,level_string:e.getLevelString(b,S),profile_idc:r,profile_string:"".concat(r),bit_depth:B,ref_frames:1,chroma_format:e.getChromaFormat(x,I,L),chroma_format_string:e.getChromaFormatString(x,I,L),frame_rate:{fixed:o,fps:a/s,fps_den:s,fps_num:a},sar_ratio:{width:1,height:1},codec_size:{width:T,height:k},present_size:{width:1*T,height:k}}},e.getLevelString=function(e,t){return"".concat(e.toString(10).padStart(2,"0")).concat(0===t?"M":"H")},e.getChromaFormat=function(e,t,i){return e?0:0===t&&0===i?3:1===t&&0===i?2:1===t&&1===i?1:Number.NaN},e.getChromaFormatString=function(e,t,i){return e?"4:0:0":0===t&&0===i?"4:4:4":1===t&&0===i?"4:2:2":1===t&&1===i?"4:2:0":"Unknown"},e}();var S=function(){function e(e,t){this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new a.A,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return e.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},e.probe=function(e){var t=new Uint8Array(e);if(t.byteLength<9)return{needMoreData:!0};var i={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return i;var r,n=(4&t[4])>>>2!=0,o=!!(1&t[4]),a=(r=t)[5]<<24|r[6]<<16|r[7]<<8|r[8];return a<9?i:{match:!0,consumed:a,dataOffset:a,hasAudioTrack:n,hasVideoTrack:o}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo&&(this._mediaInfo.duration=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo&&(this._mediaInfo.hasAudio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo&&(this._mediaInfo.hasVideo=e)},enumerable:!1,configurable:!0}),e.prototype.resetMediaInfo=function(){this._mediaInfo=new a.A},e.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},e.prototype.parseChunks=function(t,i){var r,o;if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new c.j4("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var a=0,s=this._littleEndian;if(0===i){if(!(t.byteLength>13))return 0;var l=e.probe(t);a=(null==l?void 0:l.dataOffset)||0}for(this._firstParse&&(this._firstParse=!1,i+a!==this._dataOffset&&n.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(d=new DataView(t,a)).getUint32(0,!s)&&n.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),a+=4);a<t.byteLength;){this._dispatch=!0;var d=new DataView(t,a);if(a+11+4>t.byteLength)break;var u=d.getUint8(0),h=16777215&d.getUint32(0,!s);if(a+11+h+4>t.byteLength)break;if(8===u||9===u||18===u){var A=d.getUint8(4),p=d.getUint8(5),f=d.getUint8(6)|p<<8|A<<16|d.getUint8(7)<<24;16777215&d.getUint32(7,!s)&&n.A.w(this.TAG,"Meet tag which has StreamID != 0!");var _=a+11;switch(u){case 8:this._parseAudioData(t,_,h,f);break;case 9:this._parseVideoData(t,_,h,f,i+a);break;case 18:this._parseScriptData(t,_,h)}var m=d.getUint32(11+h,!s);m!==11+h&&n.A.w(this.TAG,"Invalid PrevTagSize ".concat(m)),a+=11+h+4}else n.A.w(this.TAG,"Unsupported tag type ".concat(u,", skipped")),a+=11+h+4}return this._isInitialMetadataDispatched()&&this._dispatch&&((null===(r=this._audioTrack)||void 0===r?void 0:r.length)||(null===(o=this._videoTrack)||void 0===o?void 0:o.length))&&this._onDataAvailable(this._audioTrack,this._videoTrack),a},e.prototype._parseScriptData=function(e,t,i){var r,o,a,s=h.parseScriptData(e,t,i);if(s.hasOwnProperty("onMetaData")){if(null==s.onMetaData||"object"!=typeof s.onMetaData)return void n.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&n.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=s;var l=null===(r=this._metadata)||void 0===r?void 0:r.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},l)),"boolean"==typeof(null==l?void 0:l.hasAudio)&&(this._hasAudioFlagOverrided||(this._hasAudio=l.hasAudio,this._mediaInfo&&(this._mediaInfo.hasAudio=this._hasAudio))),"boolean"==typeof(null==l?void 0:l.hasVideo)&&(this._hasVideoFlagOverrided||(this._hasVideo=l.hasVideo,this._mediaInfo&&(this._mediaInfo.hasVideo=this._hasVideo))),"number"==typeof(null==l?void 0:l.audiodatarate)&&this._mediaInfo&&(this._mediaInfo.audioDataRate=l.audiodatarate),"number"==typeof(null==l?void 0:l.videodatarate)&&this._mediaInfo&&(this._mediaInfo.videoDataRate=l.videodatarate),"number"==typeof(null==l?void 0:l.width)&&this._mediaInfo&&(this._mediaInfo.width=l.width),"number"==typeof(null==l?void 0:l.height)&&this._mediaInfo&&(this._mediaInfo.height=l.height),"number"==typeof(null==l?void 0:l.duration)){if(!this._durationOverrided){var d=Math.floor(l.duration*this._timescale);this._duration=d,this._mediaInfo&&(this._mediaInfo.duration=d)}}else this._mediaInfo&&(this._mediaInfo.duration=0);if("number"==typeof(null==l?void 0:l.framerate)){var c=Math.floor(1e3*l.framerate);if(c>0){var u=c/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=u,this._referenceFrameRate.fps_num=c,this._referenceFrameRate.fps_den=1e3,this._mediaInfo&&(this._mediaInfo.fps=u)}}if("object"==typeof(null==l?void 0:l.keyframes)){this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!0);var A=l.keyframes;this._mediaInfo&&(this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(A)),l.keyframes=null}else this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!1);this._dispatch=!1,this._mediaInfo&&(this._mediaInfo.metadata=l),n.A.v(this.TAG,"Parsed onMetaData"),(null===(o=this._mediaInfo)||void 0===o?void 0:o.isComplete())&&(null===(a=this._onMediaInfo)||void 0===a||a.call(this,this._mediaInfo))}Object.keys(s).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},s))},e.prototype._parseKeyframesIndex=function(e){for(var t=[],i=[],r=1;r<e.times.length;r++){var n=this._timestampBase+Math.floor(1e3*e.times[r]);t.push(n),i.push(e.filepositions[r])}return{times:t,filepositions:i}},e.prototype._parseAudioData=function(e,t,i,r){var o,a,s,l,d,c,u,h,A,p;if(i<=1)n.A.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(!this._hasAudioFlagOverrided||!1!==this._hasAudio){this._littleEndian;var _=new DataView(e,t,i).getUint8(0),m=_>>>4;if(2===m||10===m){var v=0,g=(12&_)>>>2;if(g>=0&&g<=4){v=this._flvSoundRateTable[g];var b=1&_,S=this._audioMetadata,E=this._audioTrack;if(S||(!1!==this._hasAudio||this._hasAudioFlagOverrided||(this._hasAudio=!0,this._mediaInfo&&(this._mediaInfo.hasAudio=!0)),(S=this._audioMetadata={}).type="audio",S.id=null==E?void 0:E.id,S.timescale=this._timescale,S.duration=this._duration,S.audioSampleRate=v,S.channelCount=0===b?1:2),10===m){var w=this._parseAACAudioData(e,t+1,i-1);if(void 0===w)return;if(0===(null==w?void 0:w.packetType)){if(null==S?void 0:S.config){if(y(w.data.config,null==S?void 0:S.config))return;n.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var T=w.data;S.audioSampleRate=null==T?void 0:T.samplingRate,S.channelCount=null==T?void 0:T.channelCount,S.codec=null==T?void 0:T.codec,S.originalCodec=null==T?void 0:T.originalCodec,S.config=null==T?void 0:T.config,S.refSampleDuration=1024/S.audioSampleRate*S.timescale,n.A.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(l=this._videoTrack)||void 0===l?void 0:l.length))&&(null===(d=this._onDataAvailable)||void 0===d||d.call(this,this._audioTrack,this._videoTrack)):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,null===(c=this._onTrackMetadata)||void 0===c||c.call(this,"audio",S),(O=this._mediaInfo).audioCodec=S.originalCodec||"",O.audioSampleRate=S.audioSampleRate,O.audioChannelCount=S.channelCount,O.hasVideo?null!=O.videoCodec&&(O.mimeType='video/x-flv; codecs="'+O.videoCodec+","+O.audioCodec+'"'):O.mimeType='video/x-flv; codecs="'+O.audioCodec+'"',(null==O?void 0:O.isComplete())&&(null===(u=this._onMediaInfo)||void 0===u||u.call(this,O))}else if(1===w.packetType){var k=this._timestampBase+r,R={unit:w.data,length:w.data.byteLength,dts:k,pts:k};E&&(null==E||E.samples.push(R),E.length+=(null===(h=null==w?void 0:w.data)||void 0===h?void 0:h.length)||0)}else n.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(w.packetType))}else if(2===m){if(!S.codec){var O;if(void 0===(T=this._parseMP3AudioData(e,t+1,i-1,!0)))return;S.audioSampleRate=T.samplingRate,S.channelCount=T.channelCount,S.codec=T.codec,S.originalCodec=T.originalCodec,S.refSampleDuration=1152/S.audioSampleRate*S.timescale,n.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,null===(A=this._onTrackMetadata)||void 0===A||A.call(this,"audio",S),(O=this._mediaInfo).audioCodec=S.codec,O.audioSampleRate=S.audioSampleRate,O.audioChannelCount=S.channelCount,O.audioDataRate=T.bitRate,(null==O?void 0:O.hasVideo)?null!=O.videoCodec&&(O.mimeType='video/x-flv; codecs="'+O.videoCodec+","+O.audioCodec+'"'):O.mimeType='video/x-flv; codecs="'+O.audioCodec+'"',O.isComplete()&&(null===(p=this._onMediaInfo)||void 0===p||p.call(this,O))}var C=this._parseMP3AudioData(e,t+1,i-1,!1);if(void 0===C)return;k=this._timestampBase+r;var B={unit:C,length:C.byteLength,dts:k,pts:k};null==E||E.samples.push(B),E&&(E.length+=C.length)}}else null===(a=this._onError)||void 0===a||a.call(this,f.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+g)}else null===(o=this._onError)||void 0===o||o.call(this,f.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+m)}},e.prototype._parseAACAudioData=function(e,t,i){if(!(i<=1)){var r={},o=new Uint8Array(e,t,i);return r.packetType=o[0],0===o[0]?r.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):r.data=o.subarray(1),r}n.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,i){var r,n,o,a,s=new Uint8Array(e,t,i),l=null,d=0,c=null;if(d=o=s[0]>>>3,(a=(7&s[0])<<1|s[1]>>>7)<0||a>=this._mpegSamplingRates.length)null===(r=this._onError)||void 0===r||r.call(this,f.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var u=this._mpegSamplingRates[a],h=(120&s[1])>>>3;if(!(h<0||h>=8)){5===d&&(c=(7&s[1])<<1|s[2]>>>7,s[2]);var A=self.navigator.userAgent.toLowerCase();return A.includes("firefox")?a>=6?(d=5,l=new Array(4),c=a-3):(d=2,l=new Array(2),c=a):A.includes("android")?(d=2,l=new Array(2),c=a):(d=5,c=a,l=new Array(4),a>=6?c=a-3:1===h&&(d=2,l=new Array(2),c=a)),l[0]=d<<3,l[0]|=(15&a)>>>1,l[1]=(15&a)<<7,l[1]|=(15&h)<<3,5===d&&(l[1]|=(15&c)>>>1,l[2]=(1&c)<<7,l[2]|=8,l[3]=0),{config:l,samplingRate:u,channelCount:h,codec:"mp4a.40."+d,originalCodec:"mp4a.40."+o}}null===(n=this._onError)||void 0===n||n.call(this,f.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,i,r){if(!(i<4)){this._littleEndian;var o,a=new Uint8Array(e,t,i);if(r){if(255!==a[0])return;var s=a[1]>>>3&3,l=(6&a[1])>>1,d=(240&a[2])>>>4,c=(12&a[2])>>>2,u=3&~(a[3]>>>6)?2:1,h=0,A=0;switch(s){case 0:h=this._mpegAudioV25SampleRateTable[c];break;case 2:h=this._mpegAudioV20SampleRateTable[c];break;case 3:h=this._mpegAudioV10SampleRateTable[c]}switch(l){case 1:d<this._mpegAudioL3BitRateTable.length&&(A=this._mpegAudioL3BitRateTable[d]);break;case 2:d<this._mpegAudioL2BitRateTable.length&&(A=this._mpegAudioL2BitRateTable[d]);break;case 3:d<this._mpegAudioL1BitRateTable.length&&(A=this._mpegAudioL1BitRateTable[d])}o={bitRate:A,samplingRate:h,channelCount:u,codec:"mp3",originalCodec:"mp3"}}else o=a;return o}n.A.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")},e.prototype._parseVideoData=function(e,t,i,r,o){var a,s;if(i<=1)n.A.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(!this._hasVideoFlagOverrided||!1!==this._hasVideo){var l=new Uint8Array(e,t,i)[0],d=(112&l)>>>4;if(128&l){var c=15&l,u=String.fromCharCode.apply(String,function(e,t,i){if(2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}([],function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a}(new Uint8Array(e,t,i).slice(1,5)),!1));"hvc1"===u?this._parseEnhancedHEVCVideoPacket(e,t+5,i-5,r,o,d,c):"av01"===u?this._parseEnhancedAV1VideoPacket(e,t+5,i-5,r,o,d,c):null===(s=this._onError)||void 0===s||s.call(this,f.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(u))}else{var h=15&l;7===h?this._parseAVCVideoPacket(e,t+1,i-1,r,o,d):12===h?this._parseHEVCVideoPacket(e,t+1,i-1,r,o,d):null===(a=this._onError)||void 0===a||a.call(this,f.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(h))}}},e.prototype._parseAVCVideoPacket=function(e,t,i,r,o,a){var s;if(i<4)n.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var l=this._littleEndian,d=new DataView(e,t,i),c=d.getUint8(0),u=(16777215&d.getUint32(0,!l))<<8>>8;0===c?this._parseAVCDecoderConfigurationRecord(e,t+4,i-4):1===c?this._parseAVCVideoData(e,t+4,i-4,r,o,a,u):2===c||null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(c))}},e.prototype._parseHEVCVideoPacket=function(e,t,i,r,o,a){var s;if(i<4)n.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var l=this._littleEndian,d=new DataView(e,t,i),c=d.getUint8(0),u=(16777215&d.getUint32(0,!l))<<8>>8;0===c?this._parseHEVCDecoderConfigurationRecord(e,t+4,i-4):1===c?this._parseHEVCVideoData(e,t+4,i-4,r,o,a,u):2===c||null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(c))}},e.prototype._parseEnhancedHEVCVideoPacket=function(e,t,i,r,n,o,a){var s,l=this._littleEndian,d=new DataView(e,t,i);if(0===a)this._parseHEVCDecoderConfigurationRecord(e,t,i);else if(1===a){var c=(4294967040&d.getUint32(0,!l))>>8;this._parseHEVCVideoData(e,t+3,i-3,r,n,o,c)}else 3===a?this._parseHEVCVideoData(e,t,i,r,n,o,0):2===a||null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(a))},e.prototype._parseEnhancedAV1VideoPacket=function(e,t,i,r,n,o,a){var s,l;this._littleEndian,0===a?this._parseAV1CodecConfigurationRecord(e,t,i):1===a?this._parseAV1VideoData(e,t,i,r,n,o,0):5===a?null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Not Suported MP2T AV1 video packet type ".concat(a)):2===a||null===(l=this._onError)||void 0===l||l.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(a))},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,i){var r,o,a,s,l,d,c,u,h,A,_;if(i<7)n.A.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var m=this._videoMetadata,v=this._videoTrack,g=this._littleEndian,b=new DataView(e,t,i);if(m){if(void 0!==m.avcc){var S=new Uint8Array(e,t,i);if(y(S,m.avcc))return;n.A.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(m=this._videoMetadata={}).type="video",m.id=null==v?void 0:v.id,m.timescale=this._timescale,m.duration=this._duration;var E=b.getUint8(0),w=b.getUint8(1);if(b.getUint8(2),b.getUint8(3),1===E&&0!==w)if(this._naluLengthSize=1+(3&b.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var T=31&b.getUint8(5);if(0!==T){T>1&&n.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(T));for(var k=6,R=0;R<T;R++){var O=b.getUint16(k,!g);if(k+=2,0!==O){var C=new Uint8Array(e,t+k,O);k+=O;var B=p.parseSPS(C);if(0===R){m.codecWidth=B.codec_size.width,m.codecHeight=B.codec_size.height,m.presentWidth=B.present_size.width,m.presentHeight=B.present_size.height,m.profile=B.profile_string,m.level=B.level_string,m.bitDepth=B.bit_depth,m.chromaFormat=B.chroma_format,m.sarRatio=B.sar_ratio,m.frameRate=B.frame_rate,B.frame_rate.fixed&&0!==B.frame_rate.fps_num&&0!==B.frame_rate.fps_den||(m.frameRate=this._referenceFrameRate);var x=null===(s=m.frameRate)||void 0===s?void 0:s.fps_den,I=null===(l=m.frameRate)||void 0===l?void 0:l.fps_num;m.refSampleDuration=m.timescale*(x/I);for(var L=C.subarray(1,4),D="avc1.",M=0;M<3;M++){var P=L[M].toString(16);P.length<2&&(P="0"+P),D+=P}m.codec=D;var U=this._mediaInfo;U.width=m.codecWidth,U.height=m.codecHeight,U.fps=m.frameRate.fps,U.profile=m.profile,U.level=m.level,U.refFrames=B.ref_frames,U.chromaFormat=B.chroma_format_string,U.sarNum=m.sarRatio.width,U.sarDen=m.sarRatio.height,U.videoCodec=D,U.hasAudio?null!=U.audioCodec&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.videoCodec+'"',U.isComplete()&&(null===(d=this._onMediaInfo)||void 0===d||d.call(this,U))}}}var F=b.getUint8(k);if(0!==F){for(F>1&&n.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(F)),k++,R=0;R<F;R++)O=b.getUint16(k,!g),k+=2,0!==O&&(k+=O);m.avcc=new Uint8Array(i),m.avcc.set(new Uint8Array(e,t,i),0),n.A.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(u=this._audioTrack)||void 0===u?void 0:u.length)||(null===(h=this._videoTrack)||void 0===h?void 0:h.length))&&(null===(A=this._onDataAvailable)||void 0===A||A.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(_=this._onTrackMetadata)||void 0===_||_.call(this,"video",m)}else null===(c=this._onError)||void 0===c||c.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else null===(a=this._onError)||void 0===a||a.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else null===(o=this._onError)||void 0===o||o.call(this,f.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else null===(r=this._onError)||void 0===r||r.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}},e.prototype._parseHEVCDecoderConfigurationRecord=function(e,t,i){var r,o,a,s,l,d,c;if(i<22)n.A.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");else{var u=this._videoMetadata,h=this._videoTrack,A=this._littleEndian,p=new DataView(e,t,i);if(u){if(void 0!==u.hvcc){var m=new Uint8Array(e,t,i);if(y(m,u.hvcc))return;n.A.w(this.TAG,"HEVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(u=this._videoMetadata={}).type="video",u.id=null==h?void 0:h.id,u.timescale=this._timescale,u.duration=this._duration;var v=p.getUint8(0),g=31&p.getUint8(1);if(1===v&&0!==g)if(this._naluLengthSize=1+(3&p.getUint8(21)),3===this._naluLengthSize||4===this._naluLengthSize){for(var b=p.getUint8(22),S=0,E=23;S<b;S++){var w=63&p.getUint8(E+0),T=p.getUint16(E+1,!A);E+=3;for(var k=0;k<T;k++){var R=p.getUint16(E+0,!A);if(0===k)if(33===w){E+=2;var O=new Uint8Array(e,t+E,R),C=_.parseSPS(O);u.codecWidth=C.codec_size.width,u.codecHeight=C.codec_size.height,u.presentWidth=C.present_size.width,u.presentHeight=C.present_size.height,u.profile=null==C?void 0:C.profile_string,u.level=C.level_string,u.bitDepth=C.bit_depth,u.chromaFormat=C.chroma_format,u.sarRatio=C.sar_ratio,u.frameRate=C.frame_rate,C.frame_rate.fixed&&0!==C.frame_rate.fps_num&&0!==C.frame_rate.fps_den||(u.frameRate=this._referenceFrameRate);var B=u.frameRate.fps_den,x=u.frameRate.fps_num;u.refSampleDuration=u.timescale*(B/x),u.codec=C.codec_mimetype;var I=this._mediaInfo;I.width=u.codecWidth,I.height=u.codecHeight,I.fps=u.frameRate.fps,I.profile=u.profile,I.level=u.level,I.refFrames=C.ref_frames,I.chromaFormat=C.chroma_format_string,I.sarNum=u.sarRatio.width,I.sarDen=u.sarRatio.height,I.videoCodec=C.codec_mimetype,I.hasAudio?null!=I.audioCodec&&(I.mimeType='video/x-flv; codecs="'+I.videoCodec+","+I.audioCodec+'"'):I.mimeType='video/x-flv; codecs="'+I.videoCodec+'"',I.isComplete()&&(null===(a=this._onMediaInfo)||void 0===a||a.call(this,I)),E+=R}else E+=2+R;else E+=2+R}}u.hvcc=new Uint8Array(i),u.hvcc.set(new Uint8Array(e,t,i),0),n.A.v(this.TAG,"Parsed HEVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(l=this._videoTrack)||void 0===l?void 0:l.length))&&(null===(d=this._onDataAvailable)||void 0===d||d.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(c=this._onTrackMetadata)||void 0===c||c.call(this,"video",u)}else null===(o=this._onError)||void 0===o||o.call(this,f.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else null===(r=this._onError)||void 0===r||r.call(this,f.A.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord")}},e.prototype._parseAV1CodecConfigurationRecord=function(e,t,i){var r,o,a,s,l,d,c,u,h,A,p;if(i<4)n.A.w(this.TAG,"Flv: Invalid AV1CodecConfigurationRecord, lack of data!");else{var _=this._videoMetadata,m=this._videoTrack,v=(this._littleEndian,new DataView(e,t,i));_?void 0!==_.av1c&&n.A.w(this.TAG,"Found another AV1CodecConfigurationRecord!"):(!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(_=this._videoMetadata={}).type="video",_.id=null==m?void 0:m.id,_.timescale=this._timescale,_.duration=this._duration);var g=127&v.getUint8(0);if(v.getUint8(1),v.getUint8(1),v.getUint8(2),1===g){var y=b.parseOBUs(new Uint8Array(e,t+4,i-4));if(null!=y){_.codecWidth=null===(a=null==y?void 0:y.codec_size)||void 0===a?void 0:a.width,_.codecHeight=null===(s=null==y?void 0:y.codec_size)||void 0===s?void 0:s.height,_.presentWidth=null===(l=null==y?void 0:y.present_size)||void 0===l?void 0:l.width,_.presentHeight=null===(d=null==y?void 0:y.present_size)||void 0===d?void 0:d.height,_.profile=y.profile_string,_.level=y.level_string,_.bitDepth=y.bit_depth,_.chromaFormat=y.chroma_format,_.sarRatio=y.sar_ratio,_.frameRate=y.frame_rate,y.frame_rate.fixed&&0!==y.frame_rate.fps_num&&0!==y.frame_rate.fps_den||(_.frameRate=this._referenceFrameRate);var S=_.frameRate.fps_den,E=_.frameRate.fps_num;_.refSampleDuration=_.timescale*(S/E),_.codec=y.codec_mimetype;var w=this._mediaInfo;w.width=_.codecWidth,w.height=_.codecHeight,w.fps=_.frameRate.fps,w.profile=_.profile,w.level=_.level,w.refFrames=y.ref_frames,w.chromaFormat=y.chroma_format_string,w.sarNum=_.sarRatio.width,w.sarDen=_.sarRatio.height,w.videoCodec=y.codec_mimetype,w.hasAudio?null!=w.audioCodec&&(w.mimeType='video/x-flv; codecs="'+w.videoCodec+","+w.audioCodec+'"'):w.mimeType='video/x-flv; codecs="'+w.videoCodec+'"',w.isComplete()&&(null===(c=this._onMediaInfo)||void 0===c||c.call(this,w)),_.av1c=new Uint8Array(i),_.av1c.set(new Uint8Array(e,t,i),0),n.A.v(this.TAG,"Parsed AV1CodecConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(u=this._audioTrack)||void 0===u?void 0:u.length)||(null===(h=this._videoTrack)||void 0===h?void 0:h.length))&&(null===(A=this._onDataAvailable)||void 0===A||A.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(p=this._onTrackMetadata)||void 0===p||p.call(this,"video",_)}else null===(o=this._onError)||void 0===o||o.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}else null===(r=this._onError)||void 0===r||r.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}},e.prototype._parseAVCVideoData=function(e,t,i,r,o,a,s){for(var l=this._littleEndian,d=new DataView(e,t,i),c=[],u=0,h=0,A=this._naluLengthSize,p=this._timestampBase+r,f=1===a;h<i;){if(h+4>=i){n.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(h,", dataSize = ").concat(i));break}var _=d.getUint32(h,!l);if(3===A&&(_>>>=8),_>i-A)return void n.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var m=31&d.getUint8(h+A);5===m&&(f=!0);var v=new Uint8Array(e,t+h,A+_),g={type:m,data:v};c.push(g),u+=v.byteLength,h+=A+_}if(c.length){var y=this._videoTrack,b={units:c,length:u,isKeyframe:f,dts:p,cts:s,pts:p+s};f&&(b.fileposition=o),y&&(y.samples.push(b),y.length+=u)}},e.prototype._parseHEVCVideoData=function(e,t,i,r,o,a,s){for(var l=this._littleEndian,d=new DataView(e,t,i),c=[],u=0,h=0,A=this._naluLengthSize,p=this._timestampBase+r,f=1===a;h<i;){if(h+4>=i){n.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(h,", dataSize = ").concat(i));break}var _=d.getUint32(h,!l);if(3===A&&(_>>>=8),_>i-A)return void n.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var m=31&d.getUint8(h+A);19!==m&&20!==m||(f=!0);var v=new Uint8Array(e,t+h,A+_),g={type:m,data:v};c.push(g),u+=v.byteLength,h+=A+_}if(c.length){var y=this._videoTrack,b={units:c,length:u,isKeyframe:f,dts:p,cts:s,pts:p+s};f&&(b.fileposition=o),y&&(null==y||y.samples.push(b),y.length+=u)}},e.prototype._parseAV1VideoData=function(e,t,i,r,n,o,a){this._littleEndian;var s,l=[],d=this._timestampBase+r,c=1===o;if(s=i,l.push({unitType:0,data:new Uint8Array(e,t+0,i)}),l.length){var u=this._videoTrack,h={units:l,length:s,isKeyframe:c,dts:d,cts:a,pts:d+a};c&&(h.fileposition=n),u&&(null==u||u.samples.push(h),u.length+=s)}},e}();const E=S,w=function(){function e(){}return e.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onSMPTE2038Metadata=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null},e}();var T,k=function(){this.program_pmt_pid={}};!function(e){e[e.kMPEG1Audio=3]="kMPEG1Audio",e[e.kMPEG2Audio=4]="kMPEG2Audio",e[e.kPESPrivateData=6]="kPESPrivateData",e[e.kADTSAAC=15]="kADTSAAC",e[e.kLOASAAC=17]="kLOASAAC",e[e.kAC3=129]="kAC3",e[e.kEAC3=135]="kEAC3",e[e.kID3=21]="kID3",e[e.kSCTE35=134]="kSCTE35",e[e.kH264=27]="kH264",e[e.kH265=36]="kH265"}(T||(T={}));var R,O=function(){this.pid_stream_type={},this.common_pids={h264:void 0,h265:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,eac3:void 0,mp3:void 0},this.pes_private_data_pids={},this.timed_id3_pids={},this.scte_35_pids={},this.smpte2038_pids={}},C=function(){},B=function(){},x=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0,this.random_access_indicator=0};!function(e){e[e.kUnspecified=0]="kUnspecified",e[e.kSliceNonIDR=1]="kSliceNonIDR",e[e.kSliceDPA=2]="kSliceDPA",e[e.kSliceDPB=3]="kSliceDPB",e[e.kSliceDPC=4]="kSliceDPC",e[e.kSliceIDR=5]="kSliceIDR",e[e.kSliceSEI=6]="kSliceSEI",e[e.kSliceSPS=7]="kSliceSPS",e[e.kSlicePPS=8]="kSlicePPS",e[e.kSliceAUD=9]="kSliceAUD",e[e.kEndOfSequence=10]="kEndOfSequence",e[e.kEndOfStream=11]="kEndOfStream",e[e.kFiller=12]="kFiller",e[e.kSPSExt=13]="kSPSExt",e[e.kReserved0=14]="kReserved0"}(R||(R={}));var I,L,D=function(){},M=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},P=function(){function e(e){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not find H264 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;var r=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],n=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===r||1===n)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_startcode_offset_,r=31&e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3],n=(128&e[i])>>>7,o=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=o,!(r>=R.kReserved0)&&0===n){var a=e.subarray(i,o);(t=new D).type=r,t.data=a}}return t},e}(),U=function(){function e(e,t,i){var r=8+e.byteLength+1+2+t.byteLength,n=!1;66!==e[3]&&77!==e[3]&&88!==e[3]&&(n=!0,r+=4);var o=this.data=new Uint8Array(r);o[0]=1,o[1]=e[1],o[2]=e[2],o[3]=e[3],o[4]=255,o[5]=225;var a=e.byteLength;o[6]=a>>>8,o[7]=255&a;var s=8;o.set(e,8),o[s+=a]=1;var l=t.byteLength;o[s+1]=l>>>8,o[s+2]=255&l,o.set(t,s+3),s+=3+l,n&&(o[s]=252|i.chroma_format_idc,o[s+1]=248|i.bit_depth_luma-8,o[s+2]=248|i.bit_depth_chroma-8,o[s+3]=0,s+=4)}return e.prototype.getData=function(){return this.data},e}();!function(e){e[e.kNull=0]="kNull",e[e.kAACMain=1]="kAACMain",e[e.kAAC_LC=2]="kAAC_LC",e[e.kAAC_SSR=3]="kAAC_SSR",e[e.kAAC_LTP=4]="kAAC_LTP",e[e.kAAC_SBR=5]="kAAC_SBR",e[e.kAAC_Scalable=6]="kAAC_Scalable",e[e.kLayer1=32]="kLayer1",e[e.kLayer2=33]="kLayer2",e[e.kLayer3=34]="kLayer3"}(I||(I={})),function(e){e[e.k96000Hz=0]="k96000Hz",e[e.k88200Hz=1]="k88200Hz",e[e.k64000Hz=2]="k64000Hz",e[e.k48000Hz=3]="k48000Hz",e[e.k44100Hz=4]="k44100Hz",e[e.k32000Hz=5]="k32000Hz",e[e.k24000Hz=6]="k24000Hz",e[e.k22050Hz=7]="k22050Hz",e[e.k16000Hz=8]="k16000Hz",e[e.k12000Hz=9]="k12000Hz",e[e.k11025Hz=10]="k11025Hz",e[e.k8000Hz=11]="k8000Hz",e[e.k7350Hz=12]="k7350Hz"}(L||(L={}));var F,N,V=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],G=(F=function(e,t){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},F(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}F(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),j=function(){},$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return G(t,e),t}(j),W=function(){function e(e){this.TAG="AACADTSParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found ADTS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(4095==(i[t+0]<<8|i[t+1])>>>4)return t;t++}},e.prototype.readNextAACFrame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,r=(8&e[i+1])>>>3,n=(6&e[i+1])>>>1,o=1&e[i+1],a=(192&e[i+2])>>>6,s=(60&e[i+2])>>>2,l=(1&e[i+2])<<2|(192&e[i+3])>>>6,d=(3&e[i+3])<<11|e[i+4]<<3|(224&e[i+5])>>>5;if(e[i+6],i+d>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var c=1===o?7:9,u=d-c;i+=c;var h=this.findNextSyncwordOffset(i+u);if(this.current_syncword_offset_=h,(0===r||1===r)&&0===n){var A=e.subarray(i,i+u);(t=new j).audio_object_type=a+1,t.sampling_freq_index=s,t.sampling_frequency=V[s],t.channel_config=l,t.data=A}}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),Q=function(){function e(e){this.TAG="AACLOASParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found LOAS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+1>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(695==(i[t+0]<<3|i[t+1]>>>5))return t;t++}},e.prototype.getLATMValue=function(e){for(var t=e.readBits(2),i=0,r=0;r<=t;r++)i<<=8,i|=e.readByte();return i},e.prototype.readNextAACFrame=function(e){for(var t=this.data_,i=null;null==i&&!this.eof_flag_;){var r=this.current_syncword_offset_,o=(31&t[r+1])<<8|t[r+2];if(r+3+o>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var a=new A(t.subarray(r+3,r+3+o)),s=null;if(a.readBool()){if(null==e){n.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(r+3+o),a.destroy();continue}s=e}else{var l=a.readBool();if(l&&a.readBool()){n.A.e(this.TAG,"audioMuxVersionA is Not Supported"),a.destroy();break}if(l&&this.getLATMValue(a),!a.readBool()){n.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),a.destroy();break}if(0!==a.readBits(6)){n.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),a.destroy();break}if(0!==a.readBits(4)){n.A.e(this.TAG,"more than 2 numProgram Not Supported"),a.destroy();break}if(0!==a.readBits(3)){n.A.e(this.TAG,"more than 2 numLayer Not Supported"),a.destroy();break}var d=l?this.getLATMValue(a):0,c=a.readBits(5);d-=5;var u=a.readBits(4);d-=4;var h=a.readBits(4);d-=4,a.readBits(3),(d-=3)>0&&a.readBits(d);var p=a.readBits(3);if(0!==p){n.A.e(this.TAG,"frameLengthType = ".concat(p,". Only frameLengthType = 0 Supported")),a.destroy();break}a.readByte();var f=a.readBool();if(f)if(l)this.getLATMValue(a);else{for(var _=0;;){_<<=8;var m=a.readBool();if(_+=a.readByte(),!m)break}console.log(_)}a.readBool()&&a.readByte(),(s=new $).audio_object_type=c,s.sampling_freq_index=u,s.sampling_frequency=V[s.sampling_freq_index],s.channel_config=h,s.other_data_present=f}for(var v=0;;){var g=a.readByte();if(v+=g,255!==g)break}for(var y=new Uint8Array(v),b=0;b<v;b++)y[b]=a.readByte();(i=new $).audio_object_type=s.audio_object_type,i.sampling_freq_index=s.sampling_freq_index,i.sampling_frequency=V[s.sampling_freq_index],i.channel_config=s.channel_config,i.other_data_present=s.other_data_present,i.data=y,this.current_syncword_offset_=this.findNextSyncwordOffset(r+3+o)}return i},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),z=function(e){var t=[],i=e.audio_object_type,r=e.audio_object_type,n=e.sampling_freq_index,o=e.channel_config,a=0,s=navigator.userAgent.toLowerCase();s.includes("firefox")?n>=6?(r=5,t=new Array(4),a=n-3):(r=2,t=new Array(2),a=n):s.includes("android")?(r=2,t=new Array(2),a=n):(r=5,a=n,t=new Array(4),n>=6?a=n-3:1===o&&(r=2,t=new Array(2),a=n)),t[0]=r<<3,t[0]|=(15&n)>>>1,t[1]=(15&n)<<7,t[1]|=(15&o)<<3,5===r&&(t[1]|=(15&a)>>>1,t[2]=(1&a)<<7,t[2]|=8,t[3]=0),this.config=t,this.sampling_rate=V[n],this.channel_count=o,this.codec_mimetype="mp4a.40."+r.toString(),this.original_codec_mimetype="mp4a.40."+i.toString()},H=function(){},q=function(){};!function(e){e[e.kSpliceNull=0]="kSpliceNull",e[e.kSpliceSchedule=4]="kSpliceSchedule",e[e.kSpliceInsert=5]="kSpliceInsert",e[e.kTimeSignal=6]="kTimeSignal",e[e.kBandwidthReservation=7]="kBandwidthReservation",e[e.kPrivateCommand=255]="kPrivateCommand"}(N||(N={}));var Y,X=function(e){var t=e.readBool();return t?(e.readBits(6),{time_specified_flag:t,pts_time:4*e.readBits(31)+e.readBits(2)}):(e.readBits(7),{time_specified_flag:t})},Z=function(e){var t=e.readBool();return e.readBits(6),{auto_return:t,duration:4*e.readBits(31)+e.readBits(2)}},K=function(e,t){var i=t.readBits(8);return e?{component_tag:i}:{component_tag:i,splice_time:X(t)}},J=function(e){return{component_tag:e.readBits(8),utc_splice_time:e.readBits(32)}},ee=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var r={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return r;if(r.out_of_network_indicator=e.readBool(),r.program_splice_flag=e.readBool(),r.duration_flag=e.readBool(),e.readBits(5),r.program_splice_flag)r.utc_splice_time=e.readBits(32);else{r.component_count=e.readBits(8),r.components=[];for(var n=0;n<r.component_count;n++)r.components.push(J(e))}return r.duration_flag&&(r.break_duration=Z(e)),r.unique_program_id=e.readBits(16),r.avail_num=e.readBits(8),r.avails_expected=e.readBits(8),r},te=function(e,t,i,r){return{descriptor_tag:e,descriptor_length:t,identifier:i,provider_avail_id:r.readBits(32)}},ie=function(e,t,i,r){var n=r.readBits(8),o=r.readBits(3);r.readBits(5);for(var a="",s=0;s<o;s++)a+=String.fromCharCode(r.readBits(8));return{descriptor_tag:e,descriptor_length:t,identifier:i,preroll:n,dtmf_count:o,DTMF_char:a}},re=function(e){var t=e.readBits(8);return e.readBits(7),{component_tag:t,pts_offset:4*e.readBits(31)+e.readBits(2)}},ne=function(e,t,i,r){var n=r.readBits(32),o=r.readBool();r.readBits(7);var a={descriptor_tag:e,descriptor_length:t,identifier:i,segmentation_event_id:n,segmentation_event_cancel_indicator:o};if(o)return a;if(a.program_segmentation_flag=r.readBool(),a.segmentation_duration_flag=r.readBool(),a.delivery_not_restricted_flag=r.readBool(),a.delivery_not_restricted_flag?r.readBits(5):(a.web_delivery_allowed_flag=r.readBool(),a.no_regional_blackout_flag=r.readBool(),a.archive_allowed_flag=r.readBool(),a.device_restrictions=r.readBits(2)),!a.program_segmentation_flag){a.component_count=r.readBits(8),a.components=[];for(var s=0;s<a.component_count;s++)a.components.push(re(r))}a.segmentation_duration_flag&&(a.segmentation_duration=r.readBits(40)),a.segmentation_upid_type=r.readBits(8),a.segmentation_upid_length=r.readBits(8);var l=new Uint8Array(a.segmentation_upid_length);for(s=0;s<a.segmentation_upid_length;s++)l[s]=r.readBits(8);return a.segmentation_upid=l.buffer,a.segmentation_type_id=r.readBits(8),a.segment_num=r.readBits(8),a.segments_expected=r.readBits(8),52!==a.segmentation_type_id&&54!==a.segmentation_type_id&&56!==a.segmentation_type_id&&58!==a.segmentation_type_id||(a.sub_segment_num=r.readBits(8),a.sub_segments_expected=r.readBits(8)),a},oe=function(e,t,i,r){return{descriptor_tag:e,descriptor_length:t,identifier:i,TAI_seconds:r.readBits(48),TAI_ns:r.readBits(32),UTC_offset:r.readBits(16)}},ae=function(e){return{component_tag:e.readBits(8),ISO_code:String.fromCharCode(e.readBits(8),e.readBits(8),e.readBits(8)),Bit_Stream_Mode:e.readBits(3),Num_Channels:e.readBits(4),Full_Srvc_Audio:e.readBool()}},se=function(e,t,i,r){for(var n=r.readBits(4),o=[],a=0;a<n;a++)o.push(ae(r));return{descriptor_tag:e,descriptor_length:t,identifier:i,audio_count:n,components:o}};!function(e){e[e.kSliceIDR_W_RADL=19]="kSliceIDR_W_RADL",e[e.kSliceIDR_N_LP=20]="kSliceIDR_N_LP",e[e.kSliceCRA_NUT=21]="kSliceCRA_NUT",e[e.kSliceVPS=32]="kSliceVPS",e[e.kSliceSPS=33]="kSliceSPS",e[e.kSlicePPS=34]="kSlicePPS",e[e.kSliceAUD=35]="kSliceAUD"}(Y||(Y={}));var le=function(){},de=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},ce=function(){function e(e){this.TAG="H265AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not find H265 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;var r=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],n=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===r||1===n)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_startcode_offset_,r=e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3]>>1&63,n=(128&e[i])>>>7,o=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=o,0===n){var a=e.subarray(i,o);(t=new le).type=r,t.data=a}}return t},e}(),ue=function(){function e(e,t,i,r){var n=23+(5+e.byteLength)+(5+t.byteLength)+(5+i.byteLength),o=this.data=new Uint8Array(n);o[0]=1,o[1]=(3&r.general_profile_space)<<6|(r.general_tier_flag?1:0)<<5|31&r.general_profile_idc,o[2]=r.general_profile_compatibility_flags_1,o[3]=r.general_profile_compatibility_flags_2,o[4]=r.general_profile_compatibility_flags_3,o[5]=r.general_profile_compatibility_flags_4,o[6]=r.general_constraint_indicator_flags_1,o[7]=r.general_constraint_indicator_flags_2,o[8]=r.general_constraint_indicator_flags_3,o[9]=r.general_constraint_indicator_flags_4,o[10]=r.general_constraint_indicator_flags_5,o[11]=r.general_constraint_indicator_flags_6,o[12]=r.general_level_idc,o[13]=240|(3840&r.min_spatial_segmentation_idc)>>8,o[14]=255&r.min_spatial_segmentation_idc,o[15]=252|3&r.parallelismType,o[16]=252|3&r.chroma_format_idc,o[17]=248|7&r.bit_depth_luma_minus8,o[18]=248|7&r.bit_depth_chroma_minus8,o[19]=0,o[20]=0,o[21]=(3&r.constant_frame_rate)<<6|(7&r.num_temporal_layers)<<3|(r.temporal_id_nested?1:0)<<2|3,o[22]=3,o[23]=128|Y.kSliceVPS,o[24]=0,o[25]=1,o[26]=(65280&e.byteLength)>>8,o[27]=255&e.byteLength,o.set(e,28),o[23+(5+e.byteLength)+0]=128|Y.kSliceSPS,o[23+(5+e.byteLength)+1]=0,o[23+(5+e.byteLength)+2]=1,o[23+(5+e.byteLength)+3]=(65280&t.byteLength)>>8,o[23+(5+e.byteLength)+4]=255&t.byteLength,o.set(t,23+(5+e.byteLength)+5),o[23+(5+e.byteLength+5+t.byteLength)+0]=128|Y.kSlicePPS,o[23+(5+e.byteLength+5+t.byteLength)+1]=0,o[23+(5+e.byteLength+5+t.byteLength)+2]=1,o[23+(5+e.byteLength+5+t.byteLength)+3]=(65280&i.byteLength)>>8,o[23+(5+e.byteLength+5+t.byteLength)+4]=255&i.byteLength,o.set(i,23+(5+e.byteLength+5+t.byteLength)+5)}return e.prototype.getData=function(){return this.data},e}(),he=function(){},Ae=function(){},pe=function(){},fe=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],_e=function(){function e(e){this.TAG="AC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]))return t;t++}},e.prototype.readNextAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,r=e[i+4]>>6,n=[48e3,44200,33e3][r],o=63&e[i+4],a=2*fe[r][o];if(i+a>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var s=this.findNextSyncwordOffset(i+a);this.current_syncword_offset_=s;var l=e[i+5]>>3,d=7&e[i+5],c=e[i+6]>>5,u=0;1&c&&1!==c&&(u+=2),4&c&&(u+=2),2===c&&(u+=2);var h=(e[i+6]<<8|e[i+7])>>12-u&1,A=[2,1,2,3,3,4,4,5][c]+h;(t=new pe).sampling_frequency=n,t.channel_count=A,t.channel_mode=c,t.bit_stream_identification=l,t.low_frequency_effects_channel_on=h,t.bit_stream_mode=d,t.frame_size_code=o,t.data=e.subarray(i,i+a)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),me=function(e){var t;t=[e.sampling_rate_code<<6|e.bit_stream_identification<<1|e.bit_stream_mode>>2,(3&e.bit_stream_mode)<<6|e.channel_mode<<3|e.low_frequency_effects_channel_on<<2|e.frame_size_code>>4,e.frame_size_code<<4&224],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.bit_stream_mode=e.bit_stream_mode,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},ve=function(){},ge=function(){function e(e){this.TAG="EAC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]))return t;t++}},e.prototype.readNextEAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,r=new A(e.subarray(i+2)),n=(r.readBits(2),r.readBits(3),r.readBits(11)+1<<1),o=r.readBits(2),a=null,s=null;3===o?(a=[24e3,22060,16e3][o=r.readBits(2)],s=3):(a=[48e3,44100,32e3][o],s=r.readBits(2));var l=r.readBits(3),d=r.readBits(1),c=r.readBits(5);if(i+n>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var u=this.findNextSyncwordOffset(i+n);this.current_syncword_offset_=u;var h=[2,1,2,3,3,4,4,5][l]+d;r.destroy(),(t=new ve).sampling_frequency=a,t.channel_count=h,t.channel_mode=l,t.bit_stream_identification=c,t.low_frequency_effects_channel_on=d,t.frame_size=n,t.num_blks=[1,2,3,6][s],t.data=e.subarray(i,i+n)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),ye=function(e){var t,i=Math.floor(e.frame_size*e.sampling_frequency/(16*e.num_blks));t=[255&i,248&i,e.sampling_rate_code<<6|e.bit_stream_identification<<1,e.channel_mode<<1|e.low_frequency_effects_channel_on,0],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.num_blks=e.num_blks,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},be=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Se=function(){return Se=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Se.apply(this,arguments)},Ee=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a},we=function(e,t,i){if(2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},Te=function(e){function t(t,i){var r=e.call(this)||this;return r.TAG="TSDemuxer",r.first_parse_=!0,r.media_info_=new a.A,r.timescale_=90,r.duration_=0,r.current_pmt_pid_=-1,r.program_pmt_map_={},r.pes_slice_queues_={},r.section_slice_queues_={},r.video_metadata_={vps:void 0,sps:void 0,pps:void 0,details:void 0},r.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},r.aac_last_sample_pts_=void 0,r.aac_last_incomplete_data_=null,r.has_video_=!1,r.has_audio_=!1,r.video_init_segment_dispatched_=!1,r.audio_init_segment_dispatched_=!1,r.video_metadata_changed_=!1,r.audio_metadata_changed_=!1,r.loas_previous_frame=null,r.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},r.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},r.ts_packet_size_=t.ts_packet_size,r.sync_offset_=t.sync_offset,r.config_=i,r}return be(t,e),t.prototype.destroy=function(){this.media_info_=null,this.pes_slice_queues_=null,this.section_slice_queues_=null,this.video_metadata_=null,this.audio_metadata_=null,this.aac_last_incomplete_data_=null,this.video_track_=null,this.audio_track_=null,e.prototype.destroy.call(this)},t.probe=function(e){var t=new Uint8Array(e),i=-1,r=188;if(t.byteLength<=3*r)return{needMoreData:!0};for(;-1===i;){for(var o=Math.min(1e3,t.byteLength-3*r),a=0;a<o;){if(71===t[a]&&71===t[a+r]&&71===t[a+2*r]){i=a;break}a++}if(-1===i)if(188===r)r=192;else{if(192!==r)break;r=204}}return-1===i?{match:!1}:(192===r&&i>=4?(n.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),i-=4):204===r&&n.A.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:r,sync_offset:i})},t.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},t.prototype.resetMediaInfo=function(){this.media_info_=new a.A},t.prototype.parseChunks=function(e,t){var i;if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new c.j4("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var r=0;for(this.first_parse_&&(this.first_parse_=!1,r=this.sync_offset_);r+this.ts_packet_size_<=e.byteLength;){var o=t+r;192===this.ts_packet_size_&&(r+=4);var a=new Uint8Array(e,r,188),s=a[0];if(71!==s){n.A.e(this.TAG,"sync_byte = ".concat(s,", not 0x47"));break}var l=(64&a[1])>>>6,d=(a[1],(31&a[1])<<8|a[2]),u=(48&a[3])>>>4,h=15&a[3],A={},p=4;if(2===u||3===u){var f=a[4];if(5+f===188){r+=188,204===this.ts_packet_size_&&(r+=16);continue}f>0&&(A=this.parseAdaptationField(e,r+4,1+f)),p=5+f}if(1===u||3===u)if(0===d||d===this.current_pmt_pid_||void 0!==this.pmt_&&this.pmt_.pid_stream_type[d]===T.kSCTE35){var _=188-p;this.handleSectionSlice(e,r+p,_,{pid:d,file_position:o,payload_unit_start_indicator:l,continuity_conunter:h,random_access_indicator:A.random_access_indicator})}else if(void 0!==(null===(i=this.pmt_)||void 0===i?void 0:i.pid_stream_type[d])){_=188-p;var m=this.pmt_.pid_stream_type[d];(d===this.pmt_.common_pids.h264||d===this.pmt_.common_pids.h265||d===this.pmt_.common_pids.adts_aac||d===this.pmt_.common_pids.loas_aac||d===this.pmt_.common_pids.ac3||d===this.pmt_.common_pids.eac3||d===this.pmt_.common_pids.opus||d===this.pmt_.common_pids.mp3||this.pmt_.pes_private_data_pids[d]||this.pmt_.timed_id3_pids[d])&&this.handlePESSlice(e,r+p,_,{pid:d,stream_type:m,file_position:o,payload_unit_start_indicator:l,continuity_conunter:h,random_access_indicator:A.random_access_indicator})}r+=188,204===this.ts_packet_size_&&(r+=16)}return this.dispatchAudioVideoMediaSegment(),r},t.prototype.parseAdaptationField=function(e,t,i){var r=new Uint8Array(e,t,i),o=r[0];return o>0?o>183?(n.A.w(this.TAG,"Illegal adaptation_field_length: ".concat(o)),{}):{discontinuity_indicator:(128&r[1])>>>7,random_access_indicator:(64&r[1])>>>6,elementary_stream_priority_indicator:(32&r[1])>>>5}:{}},t.prototype.handleSectionSlice=function(e,t,i,r){var n=new Uint8Array(e,t,i),o=this.section_slice_queues_?this.section_slice_queues_[r.pid]:{};if(r.payload_unit_start_indicator){var a=n[0];if(void 0!==o&&0!==(null==o?void 0:o.total_length)){var s=new Uint8Array(e,t+1,Math.min(i,a));o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,r):this.clearSlices(o,r)}for(var l=1+a;l<n.byteLength&&255!==n[l+0];){var d=(15&n[l+1])<<8|n[l+2];this.section_slice_queues_&&(this.section_slice_queues_[r.pid]=new x,o=this.section_slice_queues_[r.pid]),o.expected_length=d+3,o.file_position=r.file_position,o.random_access_indicator=r.random_access_indicator,s=new Uint8Array(e,t+l,Math.min(i-l,o.expected_length-o.total_length)),o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,r):o.total_length>=o.expected_length&&this.clearSlices(o,r),l+=s.byteLength}}else void 0!==o&&0!==o.total_length&&(s=new Uint8Array(e,t,Math.min(i,o.expected_length-o.total_length)),o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,r):o.total_length>=o.expected_length&&this.clearSlices(o,r))},t.prototype.handlePESSlice=function(e,t,i,r){var o=new Uint8Array(e,t,i),a=o[0]<<16|o[1]<<8|o[2],s=(o[3],o[4]<<8|o[5]);if(r.payload_unit_start_indicator){if(1!==a)return void n.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(a));var l=this.pes_slice_queues_[r.pid];l&&(0===l.expected_length||l.expected_length===l.total_length?this.emitPESSlices(l,r):this.clearSlices(l,r)),this.pes_slice_queues_&&(this.pes_slice_queues_[r.pid]=new x,this.pes_slice_queues_[r.pid].file_position=r.file_position,this.pes_slice_queues_[r.pid].random_access_indicator=r.random_access_indicator)}if(void 0!==this.pes_slice_queues_[r.pid]){var d=this.pes_slice_queues_[r.pid];d.slices.push(o),r.payload_unit_start_indicator&&(d.expected_length=0===s?0:s+6),d.total_length+=o.byteLength,d.expected_length>0&&d.expected_length===d.total_length?this.emitPESSlices(d,r):d.expected_length>0&&d.expected_length<d.total_length&&this.clearSlices(d,r)}},t.prototype.emitSectionSlices=function(e,t){for(var i=new Uint8Array(e.total_length),r=0,n=0;r<e.slices.length;r++){var o=e.slices[r];i.set(o,n),n+=o.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var a=new B;a.pid=t.pid,a.data=i,a.file_position=e.file_position,a.random_access_indicator=e.random_access_indicator,this.parseSection(a)},t.prototype.emitPESSlices=function(e,t){for(var i=new Uint8Array(e.total_length),r=0,n=0;r<e.slices.length;r++){var o=e.slices[r];i.set(o,n),n+=o.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var a=new C;a.pid=t.pid,a.data=i,a.stream_type=t.stream_type,a.file_position=e.file_position,a.random_access_indicator=e.random_access_indicator,this.parsePES(a)},t.prototype.clearSlices=function(e,t){e.slices=[],e.expected_length=-1,e.total_length=0},t.prototype.parseSection=function(e){var t,i=e.data,r=e.pid;0===r?this.parsePAT(i):r===this.current_pmt_pid_?this.parsePMT(i):(null===(t=this.pmt_)||void 0===t?void 0:t.scte_35_pids[r])&&this.parseSCTE35(i)},t.prototype.parsePES=function(e){var t=e.data,i=t[0]<<16|t[1]<<8|t[2],r=t[3],o=t[4]<<8|t[5];if(1===i)if(188!==r&&190!==r&&191!==r&&240!==r&&241!==r&&255!==r&&242!==r&&248!==r){t[6];var a=(192&t[7])>>>6,s=t[8],l=void 0,d=void 0;2!==a&&3!==a||(l=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,d=3===a?536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2:l);var c=9+s,u=void 0;if(0!==o){if(o<3+s)return void n.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");u=o-3-s}else u=t.byteLength-c;var h=t.subarray(c,c+u);switch(e.stream_type){case T.kMPEG1Audio:case T.kMPEG2Audio:this.parseMP3Payload(h,l);break;case T.kPESPrivateData:this.pmt_.common_pids.opus===e.pid?this.parseOpusPayload(h,l):this.pmt_.common_pids.ac3===e.pid?this.parseAC3Payload(h,l):this.pmt_.common_pids.eac3===e.pid?this.parseEAC3Payload(h,l):this.pmt_.smpte2038_pids[e.pid]?this.parseSMPTE2038MetadataPayload(h,l,d,e.pid,r):this.parsePESPrivateDataPayload(h,l,d,e.pid,r);break;case T.kADTSAAC:this.parseADTSAACPayload(h,l);break;case T.kLOASAAC:this.parseLOASAACPayload(h,l);break;case T.kAC3:this.parseAC3Payload(h,l);break;case T.kEAC3:this.parseEAC3Payload(h,l);break;case T.kID3:this.parseTimedID3MetadataPayload(h,l,d,e.pid,r);break;case T.kH264:this.parseH264Payload(h,l,d,e.file_position,e.random_access_indicator);break;case T.kH265:this.parseH265Payload(h,l,d,e.file_position,e.random_access_indicator)}}else 188!==r&&191!==r&&240!==r&&241!==r&&255!==r&&242!==r&&248!==r||e.stream_type!==T.kPESPrivateData||(c=6,u=void 0,u=0!==o?o:t.byteLength-c,h=t.subarray(c,c+u),this.parsePESPrivateDataPayload(h,void 0,void 0,e.pid,r));else n.A.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(i))},t.prototype.parsePAT=function(e){var t=e[0];if(0===t){var i=(15&e[1])<<8|e[2],r=(e[3],e[4],(62&e[5])>>>1),o=1&e[5],a=e[6],s=(e[7],null);if(1===o&&0===a)(s=new k).version_number=r;else if(null==(s=this.pat_))return;for(var l=i-5-4,d=-1,c=-1,u=8;u<8+l;u+=4){var h=e[u]<<8|e[u+1],A=(31&e[u+2])<<8|e[u+3];0===h?s.network_pid=A:(s.program_pmt_pid[h]=A,-1===d&&(d=h),-1===c&&(c=A))}1===o&&0===a&&(void 0===this.pat_&&n.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(s))),this.pat_=s,this.current_program_=d,this.current_pmt_pid_=c)}else n.A.e(this.TAG,"parsePAT: table_id ".concat(t," is not corresponded to PAT!"))},t.prototype.parsePMT=function(e){var t=e[0];if(2===t){var i=(15&e[1])<<8|e[2],r=e[3]<<8|e[4],o=(62&e[5])>>>1,a=1&e[5],s=e[6],l=(e[7],null);if(1===a&&0===s)(l=new O).program_number=r,l.version_number=o,this.program_pmt_map_[r]=l;else if(null==(l=this.program_pmt_map_[r]))return;e[8],e[9];for(var d=(15&e[10])<<8|e[11],c=12+d,u=i-9-d-4,h=c;h<c+u;){var A=e[h],p=(31&e[h+1])<<8|e[h+2],f=(15&e[h+3])<<8|e[h+4];l.pid_stream_type[p]=A;var _=l.common_pids.h264||l.common_pids.h265,m=l.common_pids.adts_aac||l.common_pids.loas_aac||l.common_pids.ac3||l.common_pids.eac3||l.common_pids.opus||l.common_pids.mp3;if(A!==T.kH264||_)if(A!==T.kH265||_)if(A!==T.kADTSAAC||m)if(A!==T.kLOASAAC||m)if(A!==T.kAC3||m)if(A!==T.kEAC3||m)if(A!==T.kMPEG1Audio&&A!==T.kMPEG2Audio||m)if(A===T.kPESPrivateData){if(l.pes_private_data_pids[p]=!0,f>0){for(var v=h+5;v<h+5+f;){var g=e[v+0],y=e[v+1];if(5===g){var b=String.fromCharCode.apply(String,we([],Ee(Array.from(e.subarray(v+2,v+2+y))),!1));"VANC"===b?l.smpte2038_pids[p]=!0:"Opus"===b&&(l.common_pids.opus=p)}else if(127===g&&p===l.common_pids.opus){var S=null;if(128===e[v+2]&&(S=e[v+3]),null==S){n.A.e(this.TAG,"Not Supported Opus channel count.");continue}var E={codec:"opus",channel_count:15&S?15&S:2,channel_config_code:S,sample_rate:48e3},w={codec:"opus",meta:E};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(w)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(w)):(this.audio_metadata_=E,this.dispatchAudioInitSegment(w))}v+=2+y}var k=e.subarray(h+5,h+5+f);this.dispatchPESPrivateDataDescriptor(p,A,k)}}else A===T.kID3?l.timed_id3_pids[p]=!0:A===T.kSCTE35&&(l.scte_35_pids[p]=!0);else l.common_pids.mp3=p;else l.common_pids.eac3=p;else l.common_pids.ac3=p;else l.common_pids.loas_aac=p;else l.common_pids.adts_aac=p;else l.common_pids.h265=p;else l.common_pids.h264=p;h+=5+f}r===this.current_program_&&(void 0===this.pmt_&&n.A.v(this.TAG,"Parsed first PMT: ".concat(JSON.stringify(l))),this.pmt_=l,(l.common_pids.h264||l.common_pids.h265)&&(this.has_video_=!0),(l.common_pids.adts_aac||l.common_pids.loas_aac||l.common_pids.ac3||l.common_pids.opus||l.common_pids.mp3)&&(this.has_audio_=!0))}else n.A.e(this.TAG,"parsePMT: table_id ".concat(t," is not corresponded to PMT!"))},t.prototype.parseSCTE35=function(e){var t=function(e){var t,i,r,n,o,a,s=new A(e),l=s.readBits(8),d=s.readBool(),c=s.readBool();s.readBits(2);var u=s.readBits(12),h=s.readBits(8),p=s.readBool(),f=s.readBits(6),_=4*s.readBits(31)+s.readBits(2),m=s.readBits(8),v=s.readBits(12),g=s.readBits(12),y=s.readBits(8),b=null;y===N.kSpliceNull?b={}:y===N.kSpliceSchedule?b=function(e){for(var t=e.readBits(8),i=[],r=0;r<t;r++)i.push(ee(e));return{splice_count:t,events:i}}(s):y===N.kSpliceInsert?b=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var r={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return r;if(r.out_of_network_indicator=e.readBool(),r.program_splice_flag=e.readBool(),r.duration_flag=e.readBool(),r.splice_immediate_flag=e.readBool(),e.readBits(4),r.program_splice_flag&&!r.splice_immediate_flag&&(r.splice_time=X(e)),!r.program_splice_flag){r.component_count=e.readBits(8),r.components=[];for(var n=0;n<r.component_count;n++)r.components.push(K(r.splice_immediate_flag,e))}return r.duration_flag&&(r.break_duration=Z(e)),r.unique_program_id=e.readBits(16),r.avail_num=e.readBits(8),r.avails_expected=e.readBits(8),r}(s):y===N.kTimeSignal?b=function(e){return{splice_time:X(e)}}(s):y===N.kBandwidthReservation?b={}:y===N.kPrivateCommand?b=function(e,t){for(var i=String.fromCharCode(t.readBits(8),t.readBits(8),t.readBits(8),t.readBits(8)),r=new Uint8Array(e-4),n=0;n<e-4;n++)r[n]=t.readBits(8);return{identifier:i,private_data:r.buffer}}(g,s):s.readBits(8*g);for(var S=[],E=s.readBits(16),w=0;w<E;){var T=s.readBits(8),k=s.readBits(8),R=String.fromCharCode(s.readBits(8),s.readBits(8),s.readBits(8),s.readBits(8));0===T?S.push(te(T,k,R,s)):1===T?S.push(ie(T,k,R,s)):2===T?S.push(ne(T,k,R,s)):3===T?S.push(oe(T,k,R,s)):4===T?S.push(se(T,k,R,s)):s.readBits(8*(k-4)),w+=2+k}var O={table_id:l,section_syntax_indicator:d,private_indicator:c,section_length:u,protocol_version:h,encrypted_packet:p,encryption_algorithm:f,pts_adjustment:_,cw_index:m,tier:v,splice_command_length:g,splice_command_type:y,splice_command:b,descriptor_loop_length:E,splice_descriptors:S,E_CRC32:p?s.readBits(32):void 0,CRC32:s.readBits(32)};if(y===N.kSpliceInsert){var C=b;if(C.splice_event_cancel_indicator)return{splice_command_type:y,detail:O,data:e};if(C.program_splice_flag&&!C.splice_immediate_flag){var B=C.duration_flag?null===(t=null==C?void 0:C.break_duration)||void 0===t?void 0:t.auto_return:void 0,x=C.duration_flag?((null===(i=null==C?void 0:C.break_duration)||void 0===i?void 0:i.duration)||0)/90:void 0;return(null===(r=C.splice_time)||void 0===r?void 0:r.time_specified_flag)?{splice_command_type:y,pts:(_+((null===(n=null==C?void 0:C.splice_time)||void 0===n?void 0:n.pts_time)||0))%Math.pow(2,33),auto_return:B,duraiton:x,detail:O,data:e}:{splice_command_type:y,auto_return:B,duraiton:x,detail:O,data:e}}return{splice_command_type:y,auto_return:B=C.duration_flag?null===(o=C.break_duration)||void 0===o?void 0:o.auto_return:void 0,duraiton:x=C.duration_flag?((null===(a=C.break_duration)||void 0===a?void 0:a.duration)||0)/90:void 0,detail:O,data:e}}if(y===N.kTimeSignal){var I=b;return I.splice_time.time_specified_flag?{splice_command_type:y,pts:(_+(I.splice_time.pts_time||0))%Math.pow(2,33),detail:O,data:e}:{splice_command_type:y,detail:O,data:e}}return{splice_command_type:y,detail:O,data:e}}(e);if(void 0!==t.pts){var i=Math.floor(t.pts/this.timescale_);t.pts=i}else t.nearest_pts=this.aac_last_sample_pts_;this.onSCTE35Metadata&&this.onSCTE35Metadata(t)},t.prototype.parseH264Payload=function(e,t,i,r,o){for(var a,s,l=new P(e),d=null,c=[],u=0,h=!1;null!=(d=l.readNextNaluPayload());){var A=new M(d);if(A.type===R.kSliceSPS){var f=p.parseSPS(d.data);this.video_init_segment_dispatched_?this.detectVideoMetadataChange(A,f)&&(n.A.v(this.TAG,"H264: Critical h264 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:A,pps:void 0,details:f}):this.video_metadata_&&(this.video_metadata_.sps=A,this.video_metadata_.details=f)}else A.type===R.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(this.video_metadata_&&(this.video_metadata_.pps=A),(null===(a=this.video_metadata_)||void 0===a?void 0:a.sps)&&(null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):(A.type===R.kSliceIDR||A.type===R.kSliceNonIDR&&1===o)&&(h=!0);this.video_init_segment_dispatched_&&(c.push(A),u+=A.data.byteLength)}var _=Math.floor(t/this.timescale_),m=Math.floor(i/this.timescale_);if(c.length){var v=this.video_track_,g={units:c,length:u,isKeyframe:h,dts:m,pts:_,cts:_-m,file_position:r};v&&(v.samples.push(g),v.length+=u)}},t.prototype.parseH265Payload=function(e,t,i,r,o){for(var a,s,l,d,c,u,h,A=new ce(e),p=null,f=[],m=0,v=!1;null!=(p=A.readNextNaluPayload());){var g=new de(p);if(g.type===Y.kSliceVPS){if(!this.video_init_segment_dispatched_){var y=_.parseVPS(p.data);this.video_metadata_&&(this.video_metadata_.vps=g,this.video_metadata_.details=Se(Se({},null===(a=this.video_metadata_)||void 0===a?void 0:a.details),y))}}else g.type===Y.kSliceSPS?(y=_.parseSPS(p.data),this.video_init_segment_dispatched_?this.detectVideoMetadataChange(g,y)&&(n.A.v(this.TAG,"H265: Critical h265 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:g,pps:void 0,details:y}):this.video_metadata_&&(this.video_metadata_.sps=g,this.video_metadata_.details=Se(Se({},null===(s=this.video_metadata_)||void 0===s?void 0:s.details),y))):g.type===Y.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(y=_.parsePPS(p.data),this.video_metadata_&&(this.video_metadata_.pps=g,this.video_metadata_.details=Se(Se({},null===(l=this.video_metadata_)||void 0===l?void 0:l.details),y)),(null===(d=this.video_metadata_)||void 0===d?void 0:d.vps)&&(null===(c=this.video_metadata_)||void 0===c?void 0:c.sps)&&(null===(u=this.video_metadata_)||void 0===u?void 0:u.pps)&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):g.type!==Y.kSliceIDR_W_RADL&&g.type!==Y.kSliceIDR_N_LP&&g.type!==Y.kSliceCRA_NUT||(v=!0);this.video_init_segment_dispatched_&&(f.push(g),m+=g.data.byteLength)}var b=Math.floor(t/this.timescale_),S=Math.floor(i/this.timescale_);if(f.length){var E=this.video_track_,w={units:f,length:m,isKeyframe:v,dts:S,pts:b,cts:b-S,file_position:r};E&&(null===(h=E.samples)||void 0===h||h.push(w),E.length+=m)}},t.prototype.detectVideoMetadataChange=function(e,t){var i,r,o,a,s,l,d,c,u,h;if(t.codec_mimetype!==(null===(r=null===(i=this.video_metadata_)||void 0===i?void 0:i.details)||void 0===r?void 0:r.codec_mimetype))return n.A.v(this.TAG,"Video: Codec mimeType changed from "+"".concat(null===(o=this.video_metadata_)||void 0===o?void 0:o.details.codec_mimetype," to ").concat(null==t?void 0:t.codec_mimetype)),!0;if(t.codec_size.width!==(null===(s=null===(a=this.video_metadata_)||void 0===a?void 0:a.details)||void 0===s?void 0:s.codec_size.width)||t.codec_size.height!==(null===(d=null===(l=this.video_metadata_)||void 0===l?void 0:l.details)||void 0===d?void 0:d.codec_size.height)){var A=null===(c=this.video_metadata_)||void 0===c?void 0:c.details.codec_size,p=t.codec_size;return n.A.v(this.TAG,"Video: Coded Resolution changed from "+"".concat(A.width,"x").concat(A.height," to ").concat(p.width,"x").concat(p.height)),!0}return t.present_size.width!==(null===(u=this.video_metadata_)||void 0===u?void 0:u.details.present_size.width)&&(n.A.v(this.TAG,"Video: Present resolution width changed from "+"".concat(null===(h=this.video_metadata_)||void 0===h?void 0:h.details.present_size.width," to ").concat(null==t?void 0:t.present_size.width)),!0)},t.prototype.isInitSegmentDispatched=function(){return this.has_video_&&this.has_audio_?this.video_init_segment_dispatched_&&this.audio_init_segment_dispatched_:this.has_video_&&!this.has_audio_?this.video_init_segment_dispatched_:!(this.has_video_||!this.has_audio_)&&this.audio_init_segment_dispatched_},t.prototype.dispatchVideoInitSegment=function(){var e,t,i,r,o,a,s,l,d,c,u,h,A=null===(e=this.video_metadata_)||void 0===e?void 0:e.details,p={type:"video"};p.id=null===(t=this.video_track_)||void 0===t?void 0:t.id,p.timescale=1e3,p.duration=this.duration_,p.codecWidth=A.codec_size.width,p.codecHeight=A.codec_size.height,p.presentWidth=A.present_size.width,p.presentHeight=A.present_size.height,p.profile=A.profile_string,p.level=A.level_string,p.bitDepth=A.bit_depth,p.chromaFormat=A.chroma_format,p.sarRatio=A.sar_ratio,p.frameRate=A.frame_rate;var f=p.frameRate.fps_den,_=p.frameRate.fps_num;if(p.refSampleDuration=f/_*1e3,p.codec=A.codec_mimetype,null===(i=this.video_metadata_)||void 0===i?void 0:i.vps){var m=null===(r=this.video_metadata_)||void 0===r?void 0:r.vps.data.subarray(4),v=null===(a=null===(o=this.video_metadata_)||void 0===o?void 0:o.sps)||void 0===a?void 0:a.data.subarray(4),g=null===(l=null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)||void 0===l?void 0:l.data.subarray(4),y=new ue(m,v,g,A);p.hvcc=y.getData(),this.video_init_segment_dispatched_||n.A.v(this.TAG,"Generated first HEVCDecoderConfigurationRecord for mimeType: ".concat(p.codec))}else{v=null===(c=null===(d=this.video_metadata_)||void 0===d?void 0:d.sps)||void 0===c?void 0:c.data.subarray(4),g=null===(h=null===(u=this.video_metadata_)||void 0===u?void 0:u.pps)||void 0===h?void 0:h.data.subarray(4);var b=new U(v,g,A);p.avcc=b.getData(),this.video_init_segment_dispatched_||n.A.v(this.TAG,"Generated first AVCDecoderConfigurationRecord for mimeType: ".concat(p.codec))}this.onTrackMetadata&&this.onTrackMetadata("video",p),this.video_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var S=this.media_info_;S.hasVideo=!0,S.width=p.codecWidth,S.height=p.codecHeight,S.fps=p.frameRate.fps,S.profile=p.profile,S.level=p.level,S.refFrames=A.ref_frames,S.chromaFormat=A.chroma_format_string,S.sarNum=p.sarRatio.width,S.sarDen=p.sarRatio.height,S.videoCodec=p.codec,S.hasAudio&&S.audioCodec?S.mimeType='video/mp2t; codecs="'.concat(S.videoCodec,",").concat(S.audioCodec,'"'):S.mimeType='video/mp2t; codecs="'.concat(S.videoCodec,'"'),S.isComplete()&&this.onMediaInfo&&this.onMediaInfo(S)},t.prototype.dispatchVideoMediaSegment=function(){var e;this.isInitSegmentDispatched()&&(null===(e=this.video_track_)||void 0===e?void 0:e.length)&&this.onDataAvailable&&this.onDataAvailable(null,this.video_track_)},t.prototype.dispatchAudioMediaSegment=function(){var e;this.isInitSegmentDispatched()&&(null===(e=this.audio_track_)||void 0===e?void 0:e.length)&&this.onDataAvailable&&this.onDataAvailable(this.audio_track_,null)},t.prototype.dispatchAudioVideoMediaSegment=function(){var e,t;this.isInitSegmentDispatched()&&((null===(e=this.audio_track_)||void 0===e?void 0:e.length)||(null===(t=this.video_track_)||void 0===t?void 0:t.length))&&this.onDataAvailable&&this.onDataAvailable(this.audio_track_,this.video_track_)},t.prototype.parseADTSAACPayload=function(e,t){var i,r,o;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var a=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);a.set(this.aac_last_incomplete_data_,0),a.set(e,this.aac_last_incomplete_data_.byteLength),e=a}var s,l=0;if(void 0!==t&&(l=t/this.timescale_),"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){if(void 0===t&&void 0!==this.aac_last_sample_pts_)s=1024/(null===(r=this.audio_metadata_)||void 0===r?void 0:r.sampling_frequency)*1e3,l=this.aac_last_sample_pts_+s;else if(void 0===t)return void n.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){s=1024/this.audio_metadata_.sampling_frequency*1e3;var d=this.aac_last_sample_pts_+s;Math.abs(d-l)>1&&(n.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(d,"ms, PES pts: ").concat(l,"ms")),l=d)}}for(var c=new W(e),u=null,h=l,A=0;null!=(u=c.readNextAACFrame());){s=1024/u.sampling_frequency*1e3;var p={codec:"aac",data:u};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(p)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(p)):(this.audio_metadata_={codec:"aac",audio_object_type:u.audio_object_type,sampling_freq_index:u.sampling_freq_index,sampling_frequency:u.sampling_frequency,channel_config:u.channel_config},this.dispatchAudioInitSegment(p)),A=h;var f=Math.floor(h),_={unit:u.data,length:u.data.byteLength,pts:f,dts:f};this.audio_track_&&(null===(o=this.audio_track_)||void 0===o||o.samples.push(_),this.audio_track_.length+=u.data.byteLength),h+=s}c.hasIncompleteData()&&(this.aac_last_incomplete_data_=c.getIncompleteData()),A&&(this.aac_last_sample_pts_=A)}},t.prototype.parseLOASAACPayload=function(e,t){var i,r,o;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var a=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);a.set(this.aac_last_incomplete_data_,0),a.set(e,this.aac_last_incomplete_data_.byteLength),e=a}var s,l=0;if(void 0!==t&&(l=t/this.timescale_),"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){if(void 0===t&&void 0!==this.aac_last_sample_pts_)s=1024/this.audio_metadata_.sampling_frequency*1e3,l=this.aac_last_sample_pts_+s;else if(void 0===t)return void n.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){s=1024/this.audio_metadata_.sampling_frequency*1e3;var d=this.aac_last_sample_pts_+s;Math.abs(d-l)>1&&(n.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(d,"ms, PES pts: ").concat(l,"ms")),l=d)}}for(var c=new Q(e),u=null,h=l,A=0;null!=(u=c.readNextAACFrame(null!==(r=this.loas_previous_frame)&&void 0!==r?r:void 0));){this.loas_previous_frame=u,s=1024/u.sampling_frequency*1e3;var p={codec:"aac",data:u};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(p)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(p)):(this.audio_metadata_={codec:"aac",audio_object_type:u.audio_object_type,sampling_freq_index:u.sampling_freq_index,sampling_frequency:u.sampling_frequency,channel_config:u.channel_config},this.dispatchAudioInitSegment(p)),A=h;var f=Math.floor(h),_={unit:u.data,length:u.data.byteLength,pts:f,dts:f};this.audio_track_&&(null===(o=this.audio_track_)||void 0===o||o.samples.push(_),this.audio_track_.length+=u.data.byteLength),h+=s}c.hasIncompleteData()&&(this.aac_last_incomplete_data_=c.getIncompleteData()),A&&(this.aac_last_sample_pts_=A)}},t.prototype.parseAC3Payload=function(e,t){var i,r;if(!this.has_video_||this.video_init_segment_dispatched_){var o,a=0;if(void 0!==t&&(a=t/this.timescale_),"ac-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=1536/this.audio_metadata_.sampling_frequency*1e3,a=this.aac_last_sample_pts_+o;else if(void 0===t)return void n.A.w(this.TAG,"AC3: Unknown pts");for(var s=new _e(e),l=null,d=a,c=0;null!=(l=s.readNextAC3Frame());){o=1536/l.sampling_frequency*1e3;var u={codec:"ac-3",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(u)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(u)):(this.audio_metadata_={codec:"ac-3",sampling_frequency:l.sampling_frequency,bit_stream_identification:l.bit_stream_identification,bit_stream_mode:l.bit_stream_mode,low_frequency_effects_channel_on:l.low_frequency_effects_channel_on,channel_mode:l.channel_mode},this.dispatchAudioInitSegment(u)),c=d;var h=Math.floor(d),A={unit:l.data,length:l.data.byteLength,pts:h,dts:h};this.audio_track_&&(null===(r=this.audio_track_)||void 0===r||r.samples.push(A),this.audio_track_.length+=l.data.byteLength),d+=o}c&&(this.aac_last_sample_pts_=c)}},t.prototype.parseEAC3Payload=function(e,t){var i,r;if(!this.has_video_||this.video_init_segment_dispatched_){var o,a=0;if(void 0!==t&&(a=t/this.timescale_),"ec-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=256*(this.audio_metadata_.num_blks||0)/(this.audio_metadata_.sampling_frequency||0)*1e3,a=this.aac_last_sample_pts_+o;else if(void 0===t)return void n.A.w(this.TAG,"EAC3: Unknown pts");for(var s=new ge(e),l=null,d=a,c=0;null!=(l=s.readNextEAC3Frame());){o=1536/l.sampling_frequency*1e3;var u={codec:"ec-3",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(u)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(u)):(this.audio_metadata_={codec:"ec-3",sampling_frequency:l.sampling_frequency,bit_stream_identification:l.bit_stream_identification,low_frequency_effects_channel_on:l.low_frequency_effects_channel_on,num_blks:l.num_blks,channel_mode:l.channel_mode},this.dispatchAudioInitSegment(u)),c=d;var h=Math.floor(d),A={unit:l.data,length:l.data.byteLength,pts:h,dts:h};this.audio_track_&&(null===(r=this.audio_track_)||void 0===r||r.samples.push(A),this.audio_track_.length+=l.data.byteLength),d+=o}c&&(this.aac_last_sample_pts_=c)}},t.prototype.parseOpusPayload=function(e,t){var i,r;if(!this.has_video_||this.video_init_segment_dispatched_){var o,a=0;if(void 0!==t&&(a=t/this.timescale_),"opus"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=20,a=this.aac_last_sample_pts_+o;else if(void 0===t)return void n.A.w(this.TAG,"Opus: Unknown pts");for(var s=a,l=0,d=0;d<e.length;){o=20;for(var c=!!(16&e[d+1]),u=!!(8&e[d+1]),h=d+2,A=0;255===e[h];)A+=255,h+=1;A+=e[h],h+=1,h+=c?2:0,h+=u?2:0,l=s;var p=Math.floor(s),f=e.slice(h,h+A),_={unit:f,length:f.byteLength,pts:p,dts:p};this.audio_track_&&(null===(r=this.audio_track_)||void 0===r||r.samples.push(_),this.audio_track_.length+=f.byteLength),s+=o,d=h+A}l&&(this.aac_last_sample_pts_=l)}},t.prototype.parseMP3Payload=function(e,t){var i;if(!this.has_video_||this.video_init_segment_dispatched_){var r=e[1]>>>3&3,n=(6&e[1])>>1,o=(e[2],(12&e[2])>>>2),a=3&~(e[3]>>>6)?2:1,s=0,l=34;switch(r){case 0:s=[11025,12e3,8e3,0][o];break;case 2:s=[22050,24e3,16e3,0][o];break;case 3:s=[44100,48e3,32e3,0][o]}switch(n){case 1:l=34;break;case 2:l=33;break;case 3:l=32}var d=new Ae;d.object_type=l,d.sample_rate=s,d.channel_count=a,d.data=e;var c={codec:"mp3",data:d};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c)):(this.audio_metadata_={codec:"mp3",object_type:l,sample_rate:s,channel_count:a},this.dispatchAudioInitSegment(c));var u={unit:e,length:e.byteLength,pts:t/this.timescale_,dts:t/this.timescale_};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(u),this.audio_track_.length+=e.byteLength)}},t.prototype.detectAudioMetadataChange=function(e){var t,i,r,o;if(e.codec!==(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))return n.A.v(this.TAG,"Audio: Audio Codecs changed from "+"".concat(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec," to ").concat(e.codec)),!0;if("aac"===e.codec&&"aac"===this.audio_metadata_.codec){if((a=e.data).audio_object_type!==this.audio_metadata_.audio_object_type)return n.A.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(a.audio_object_type)),!0;if(a.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return n.A.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(a.sampling_freq_index)),!0;if(a.channel_config!==this.audio_metadata_.channel_config)return n.A.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(null===(r=this.audio_metadata_)||void 0===r?void 0:r.channel_config," to ").concat(a.channel_config)),!0}else if("ac-3"===e.codec&&"ac-3"===this.audio_metadata_.codec){var a;if((a=e.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return n.A.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(null===(o=this.audio_metadata_)||void 0===o?void 0:o.sampling_frequency," to ").concat(a.sampling_frequency)),!0;if(a.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return n.A.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(a.bit_stream_identification)),!0;if(a.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return n.A.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(a.bit_stream_mode)),!0;if(a.channel_mode!==this.audio_metadata_.channel_mode)return n.A.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(a.channel_mode)),!0;if(a.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return n.A.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(a.low_frequency_effects_channel_on)),!0}else if("opus"===e.codec&&"opus"===this.audio_metadata_.codec){if((s=e.meta).sample_rate!==this.audio_metadata_.sample_rate)return n.A.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(s.sample_rate)),!0;if(s.channel_count!==this.audio_metadata_.channel_count)return n.A.v(this.TAG,"Opus: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(s.channel_count)),!0}else if("mp3"===e.codec&&"mp3"===this.audio_metadata_.codec){var s;if((s=e.data).object_type!==this.audio_metadata_.object_type)return n.A.v(this.TAG,"MP3: AudioObjectType changed from "+"".concat(this.audio_metadata_.object_type," to ").concat(s.object_type)),!0;if(s.sample_rate!==this.audio_metadata_.sample_rate)return n.A.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(s.sample_rate)),!0;if(s.channel_count!==this.audio_metadata_.channel_count)return n.A.v(this.TAG,"MP3: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(s.channel_count)),!0}return!1},t.prototype.dispatchAudioInitSegment=function(e){var t,i,r,o,a,s,l={type:"audio"};if(l.id=null===(t=this.audio_track_)||void 0===t?void 0:t.id,l.timescale=1e3,l.duration=this.duration_,"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){var d="aac"===e.codec?e.data:null,c=new z(d);l.audioSampleRate=c.sampling_rate,l.channelCount=c.channel_count,l.codec=c.codec_mimetype,l.originalCodec=c.original_codec_mimetype,l.config=c.config,l.refSampleDuration=1024/l.audioSampleRate*l.timescale}else if("ac-3"===(null===(r=this.audio_metadata_)||void 0===r?void 0:r.codec)){var u="ac-3"===e.codec?e.data:null,h=new me(u);l.audioSampleRate=h.sampling_rate,l.channelCount=h.channel_count,l.codec=h.codec_mimetype,l.originalCodec=h.original_codec_mimetype,l.config=h.config,l.refSampleDuration=1536/l.audioSampleRate*l.timescale}else if("ec-3"===(null===(o=this.audio_metadata_)||void 0===o?void 0:o.codec)){var A="ec-3"===e.codec?e.data:null,p=new ye(A);l.audioSampleRate=p.sampling_rate,l.channelCount=p.channel_count,l.codec=p.codec_mimetype,l.originalCodec=p.original_codec_mimetype,l.config=p.config,l.refSampleDuration=256*p.num_blks/l.audioSampleRate*l.timescale}else"opus"===(null===(a=this.audio_metadata_)||void 0===a?void 0:a.codec)?(l.audioSampleRate=this.audio_metadata_.sample_rate,l.channelCount=this.audio_metadata_.channel_count,l.channelConfigCode=this.audio_metadata_.channel_config_code,l.codec="opus",l.originalCodec="opus",l.config=void 0,l.refSampleDuration=20):"mp3"===(null===(s=this.audio_metadata_)||void 0===s?void 0:s.codec)&&(l.audioSampleRate=this.audio_metadata_.sample_rate,l.channelCount=this.audio_metadata_.channel_count,l.codec="mp3",l.originalCodec="mp3",l.config=void 0);this.audio_init_segment_dispatched_||n.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(l.codec)),this.onTrackMetadata&&this.onTrackMetadata("audio",l),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var f=this.media_info_;f.hasAudio=!0,f.audioCodec=l.originalCodec,f.audioSampleRate=l.audioSampleRate,f.audioChannelCount=l.channelCount,f.hasVideo&&f.videoCodec?f.mimeType='video/mp2t; codecs="'.concat(f.videoCodec,",").concat(f.audioCodec,'"'):f.mimeType='video/mp2t; codecs="'.concat(f.audioCodec,'"'),f.isComplete()&&this.onMediaInfo&&this.onMediaInfo(f)},t.prototype.dispatchPESPrivateDataDescriptor=function(e,t,i){var r=new q;r.pid=e,r.stream_type=t,r.descriptor=i,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(r)},t.prototype.parsePESPrivateDataPayload=function(e,t,i,r,n){var o=new H;if(o.pid=r,o.stream_id=n,o.len=e.byteLength,o.data=e,void 0!==t){var a=Math.floor(t/this.timescale_);o.pts=a}else o.nearest_pts=this.aac_last_sample_pts_;if(void 0!==i){var s=Math.floor(i/this.timescale_);o.dts=s}this.onPESPrivateData&&this.onPESPrivateData(o)},t.prototype.parseTimedID3MetadataPayload=function(e,t,i,r,n){var o=new H;if(o.pid=r,o.stream_id=n,o.len=e.byteLength,o.data=e,void 0!==t){var a=Math.floor(t/this.timescale_);o.pts=a}if(void 0!==i){var s=Math.floor(i/this.timescale_);o.dts=s}this.onTimedID3Metadata&&this.onTimedID3Metadata(o)},t.prototype.parseSMPTE2038MetadataPayload=function(e,t,i,r,n){var o=new he;if(o.pid=r,o.stream_id=n,o.len=e.byteLength,o.data=e,void 0!==t){var a=Math.floor(t/this.timescale_);o.pts=a}if(o.nearest_pts=this.aac_last_sample_pts_,void 0!==i){var s=Math.floor(i/this.timescale_);o.dts=s}o.ancillaries=function(e){for(var t=new A(e),i=0,r=[];i+=6,0===t.readBits(6);){var n=t.readBool();i+=1;var o=t.readBits(11);i+=11;var a=t.readBits(12);i+=12;var s=255&t.readBits(10);i+=10;var l=255&t.readBits(10);i+=10;var d=255&t.readBits(10);i+=10;for(var c=new Uint8Array(d),u=0;u<d;u++){var h=255&t.readBits(10);i+=10,c[u]=h}t.readBits(10),i+=10;var p="User Defined";65===s?7===l&&(p="SCTE-104"):95===s?220===l?p="ARIB STD-B37 (1SEG)":221===l?p="ARIB STD-B37 (ANALOG)":222===l?p="ARIB STD-B37 (SD)":223===l&&(p="ARIB STD-B37 (HD)"):97===s&&(1===l?p="EIA-708":2===l&&(p="EIA-608")),r.push({yc_indicator:n,line_number:o,horizontal_offset:a,did:s,sdid:l,user_data:c,description:p,information:{}}),t.readBits(8-(i-Math.floor(i/8))%8),i+=(8-(i-Math.floor(i/8)))%8}return t.destroy(),t=null,r}(e),this.onSMPTE2038Metadata&&this.onSMPTE2038Metadata(o)},t}(w);const ke=Te;var Re=new Uint8Array([0,0,0,0,0,0,0,0]),Oe=function(){function e(){}return e.init=function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],hvc1:[],hvcC:[],av01:[],av1C:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[],Opus:[],dOps:[],"ac-3":[],dac3:[],"ec-3":[],dec3:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)])},e.box=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];for(var r=8,n=null,o=Array.prototype.slice.call(arguments,1),a=o.length,s=0;s<a;s++)r+=o[s].byteLength;(n=new Uint8Array(r))[0]=r>>>24&255,n[1]=r>>>16&255,n[2]=r>>>8&255,n[3]=255&r,n.set(e,4);var l=8;for(s=0;s<a;s++)n.set(o[s],l),l+=o[s].byteLength;return n},e.generateInitSegment=function(t){var i=e.box(e.types.ftyp,e.constants.FTYP),r=e.moov(t),n=new Uint8Array(i.byteLength+r.byteLength);return n.set(i,0),n.set(r,i.byteLength),n},e.moov=function(t){var i=e.mvhd(t.timescale,t.duration),r=e.trak(t),n=e.mvex(t);return e.box(e.types.moov,i,r,n)},e.mvhd=function(t,i){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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]))},e.trak=function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.tkhd=function(t){var i=t.id,r=t.duration,n=t.presentWidth,o=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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,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,n>>>8&255,255&n,0,0,o>>>8&255,255&o,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))},e.mdhd=function(t){var i=t.timescale,r=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,r>>>24&255,r>>>16&255,r>>>8&255,255&r,85,196,0,0]))},e.hdlr=function(t){var i;return i="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,i)},e.minf=function(t){var i;return i="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,i,e.dinf(),e.stbl(t))},e.dinf=function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))},e.stbl=function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):"ac-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ac3(t)):"ec-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ec3(t)):"opus"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.Opus(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):"video"===t.type&&t.codec.startsWith("hvc1")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t)):"video"===t.type&&t.codec.startsWith("av01")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.av01(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var i=t.channelCount,r=t.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types[".mp3"],n)},e.mp4a=function(t){var i=t.channelCount,r=t.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types.mp4a,n,e.esds(t))},e.ac3=function(t){var i,r=t.channelCount,n=t.audioSampleRate,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]);return e.box(e.types["ac-3"],o,e.box(e.types.dac3,new Uint8Array(null!==(i=t.config)&&void 0!==i?i:[])))},e.ec3=function(t){var i,r=t.channelCount,n=t.audioSampleRate,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]);return e.box(e.types["ec-3"],o,e.box(e.types.dec3,new Uint8Array(null!==(i=t.config)&&void 0!==i?i:[])))},e.esds=function(t){var i,r=null!==(i=t.config)&&void 0!==i?i:[],n=r.length,o=new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(r).concat([6,1,2]));return e.box(e.types.esds,o)},e.Opus=function(t){var i=t.channelCount,r=t.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types.Opus,n,e.dOps(t))},e.dOps=function(t){var i=t.channelCount,r=t.channelConfigCode,n=t.audioSampleRate,o=[];switch(r){case 1:case 2:o=[0];break;case 0:o=[255,1,1,0,1];break;case 128:o=[255,2,0,0,1];break;case 3:o=[1,2,1,0,2,1];break;case 4:o=[1,2,2,0,1,2,3];break;case 5:o=[1,3,2,0,4,1,2,3];break;case 6:o=[1,4,2,0,4,1,2,3,5];break;case 7:o=[1,4,2,0,4,1,2,3,5,6];break;case 8:o=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:o=[1,1,2,0,1];break;case 131:o=[1,1,3,0,1,2];break;case 132:o=[1,1,4,0,1,2,3];break;case 133:o=[1,1,5,0,1,2,3,4];break;case 134:o=[1,1,6,0,1,2,3,4,5];break;case 135:o=[1,1,7,0,1,2,3,4,5,6];break;case 136:o=[1,1,8,0,1,2,3,4,5,6,7]}var a=new Uint8Array(function(e,t,i){if(2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}([0,i,0,0,n>>>24&255,n>>>17&255,n>>>8&255,n>>>0&255,0,0],function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a}(o),!1));return e.box(e.types.dOps,a)},e.avc1=function(t){var i=t.avcc,r=t.codecWidth,n=t.codecHeight,o=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,r>>>8&255,255&r,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,o,e.box(e.types.avcC,i))},e.hvc1=function(t){var i=t.hvcc,r=t.codecWidth,n=t.codecHeight,o=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,r>>>8&255,255&r,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.hvc1,o,e.box(e.types.hvcC,i))},e.av01=function(t){var i,r,n=t.av1c,o=null!==(i=t.codecWidth)&&void 0!==i?i:192,a=null!==(r=t.codecHeight)&&void 0!==r?r:108,s=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,o>>>8&255,255&o,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.av01,s,e.box(e.types.av1C,n))},e.mvex=function(t){return e.box(e.types.mvex,e.trex(t))},e.trex=function(t){var i=t.id,r=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,r)},e.moof=function(t,i){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,i))},e.mfhd=function(t){var i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,i)},e.traf=function(t,i){var r=t.id,n=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),o=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),a=e.sdtp(t),s=e.trun(t,a.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,n,o,s,a)},e.sdtp=function(t){for(var i=t.samples||[],r=i.length,n=new Uint8Array(4+r),o=0;o<r;o++){var a=i[o].flags;n[o+4]=a.isLeading<<6|a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy}return e.box(e.types.sdtp,n)},e.trun=function(t,i){var r=t.samples||[],n=r.length,o=12+16*n,a=new Uint8Array(o);i+=8+o,a.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var s=0;s<n;s++){var l=r[s].duration,d=r[s].size,c=r[s].flags,u=r[s].cts;a.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,d>>>24&255,d>>>16&255,d>>>8&255,255&d,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.isNonSync,0,0,u>>>24&255,u>>>16&255,u>>>8&255,255&u],12+16*s)}return e.box(e.types.trun,a)},e.mdat=function(t){return e.box(e.types.mdat,t)},e.constants={FTYP:new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),STSD_PREFIX:new Uint8Array([0,0,0,0,0,0,0,1]),STTS:Re,STSC:Re,STCO:Re,STSZ:new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),HDLR_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]),HDLR_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]),DREF:new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),SMHD:new Uint8Array([0,0,0,0,0,0,0,0]),VMHD:new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},e}();Oe.init();const Ce=Oe,Be=function(){function e(){}return e.getSilentFrame=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])}return null},e}();var xe=i(1951);const Ie=function(){function e(e){var t;this.TAG="MP4Remuxer",this._fillSilentAfterSeek=!1,this._config=e,this._isLive=!!e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new xe.Sc("audio"),this._videoSegmentInfoList=new xe.Sc("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!o.A.chrome||!(o.A.version&&o.A.version.major<50||o.A.version&&50===o.A.version.major&&((null===(t=o.A.version)||void 0===t?void 0:t.build)||0)<2661)),this._fillSilentAfterSeek=!(!o.A.msedge&&!o.A.msie),this._mp3UseMpegAudio=!o.A.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(e){var t;return e.onDataAvailable=null===(t=this.remux)||void 0===t?void 0:t.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new c.j4("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),t&&this._remuxVideo(t),e&&this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var i=null,r="mp4",n=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(r="mpeg",n="",i=new Uint8Array):i=Ce.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=Ce.generateInitSegment(t)}if(!this._onInitSegment)throw new c.j4("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:n,container:"".concat(e,"/").concat(r),mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){var i,r;this._dtsBaseInited||((null===(i=null==e?void 0:e.samples)||void 0===i?void 0:i.length)&&(this._audioDtsBase=e.samples[0].dts),(null===(r=null==t?void 0:t.samples)||void 0===r?void 0:r.length)&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=null==e?void 0:e.length);var r={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(r.samples.push(t),r.length=null==t?void 0:t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(r,!0)},e.prototype._remuxAudio=function(e,t){var i,r,a,s,l,d,c;if(null!=this._audioMeta){var u,h,A=e,p=A.samples,f=-1,_=this._audioMeta.refSampleDuration,m="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,v=this._dtsBaseInited&&void 0===this._audioNextDts,g=!1;if(p&&0!==p.length&&(1!==p.length||t)){var y=0,b=null,S=0;m?(y=0,S=A.length):(y=8,S=8+A.length);var E=null;if(p.length>1&&(S-=(E=p.pop()).length),null!=this._audioStashedLastSample){var w=this._audioStashedLastSample;this._audioStashedLastSample=null,p.unshift(w),S+=w.length}null!=E&&(this._audioStashedLastSample=E);var T=p[0].dts-this._dtsBase;if(this._audioNextDts)u=T-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())u=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(g=!0);else{var k=this._audioSegmentInfoList.getLastSampleBefore(T);if(null!=k){var R=T-(k.originalDts+k.duration);R<=3&&(R=0),u=T-(k.dts+k.duration+R)}else u=0}if(g){var O=T-u,C=this._videoSegmentInfoList.getLastSegmentBefore(T);if(null!=C&&C.beginDts<O){if(V=Be.getSilentFrame(null===(i=this._audioMeta)||void 0===i?void 0:i.originalCodec,null===(r=this._audioMeta)||void 0===r?void 0:r.channelCount)){var B=C.beginDts,x=O-C.beginDts;n.A.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(B,", duration: ").concat(x)),p.unshift({unit:V,dts:B,pts:B}),S+=V.byteLength}}else g=!1}for(var I=[],L=0;L<p.length;L++){var D=(w=p[L]).unit,M=w.dts-this._dtsBase,P=(B=M,!1),U=null,F=0;if(!(M<-.001)){if("mp3"!==this._audioMeta.codec){var N=M;if(this._audioNextDts&&(N=this._audioNextDts),(u=M-N)<=-3*(_||0)){n.A.w(this.TAG,"Dropping 1 audio frame (originalDts: ".concat(M," ms ,curRefDts: ").concat(N," ms) due to dtsCorrection: ").concat(u," ms overlap."));continue}if(u>=3*(_||0)&&this._fillAudioTimestampGap&&!o.A.safari){P=!0;var V,G=Math.floor(u/(_||0));n.A.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"originalDts: ".concat(M," ms, curRefDts: ").concat(N," ms, ")+"dtsCorrection: ".concat(Math.round(u)," ms, generate: ").concat(G," frames")),B=Math.floor(N),F=Math.floor(N+(_||0))-B,null==(V=Be.getSilentFrame(null===(a=this._audioMeta)||void 0===a?void 0:a.originalCodec,this._audioMeta.channelCount))&&(n.A.w(this.TAG,"Unable to generate silent frame for "+"".concat(null===(s=this._audioMeta)||void 0===s?void 0:s.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),V=D),U=[];for(var j=0;j<G;j++){N+=_||0;var $=Math.floor(N),W=Math.floor(N+(_||0))-$,Q={dts:$,pts:$,cts:0,unit:V,size:V.byteLength,duration:W,originalDts:M,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};U.push(Q),S+=Q.size}this._audioNextDts=N+(_||0)}else B=Math.floor(N),F=Math.floor(N+(_||0))-B,this._audioNextDts=N+(_||0)}else B=M-u,F=L!==p.length-1?p[L+1].dts-this._dtsBase-u-B:null!=E?E.dts-this._dtsBase-u-B:I.length>=1?null===(l=I[I.length-1])||void 0===l?void 0:l.duration:Math.floor(_||0),this._audioNextDts=B+F;-1===f&&(f=B),I.push({dts:B,pts:B,cts:0,unit:w.unit,size:null===(d=w.unit)||void 0===d?void 0:d.byteLength,duration:F,originalDts:M,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),P&&I.push.apply(I,U)}}if(0===I.length)return A.samples=[],void(A.length=0);for(m?b=new Uint8Array(S):((b=new Uint8Array(S))[0]=S>>>24&255,b[1]=S>>>16&255,b[2]=S>>>8&255,b[3]=255&S,b.set(Ce.types.mdat,4)),L=0;L<I.length;L++)D=I[L].unit,b.set(D,y),y+=D.byteLength||0;var z=I[I.length-1];h=z.dts+z.duration;var H,q=new xe.EZ;q.beginDts=f,q.endDts=h,q.beginPts=f,q.endPts=h,q.originalBeginDts=I[0].originalDts,q.originalEndDts=z.originalDts+z.duration,q.firstSample=new xe.$_(I[0].dts,I[0].pts,I[0].duration,I[0].originalDts,!1),q.lastSample=new xe.$_(z.dts,z.pts,z.duration,z.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(q),A.samples=I,A.sequenceNumber++,H=m?new Uint8Array:Ce.moof(A,f),A.samples=[],A.length=0;var Y={type:"audio",data:this._mergeBoxes(H,b).buffer,sampleCount:I.length,info:q};m&&v&&Y&&(Y.timestampOffset=f),null===(c=this._onMediaSegment)||void 0===c||c.call(this,"audio",Y)}}},e.prototype._remuxVideo=function(e,t){var i,r;if(null!=this._videoMeta){var n,o,a,s=e,l=s.samples,d=-1,c=-1;if(l&&0!==l.length&&(1!==l.length||t)){var u=8,h=null,A=8+e.length,p=null;if(l.length>1&&(A-=(p=l.pop()).length),null!=this._videoStashedLastSample){var f=this._videoStashedLastSample;this._videoStashedLastSample=null,l.unshift(f),A+=(null==f?void 0:f.length)||0}null!=p&&(this._videoStashedLastSample=p);var _=l[0].dts-this._dtsBase;if(this._videoNextDts)n=_-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())n=0;else{var m=this._videoSegmentInfoList.getLastSampleBefore(_);if(null!=m){var v=_-(m.originalDts+m.duration);v<=3&&(v=0),n=_-(m.dts+m.duration+v)}else n=0}for(var g=new xe.EZ,y=[],b=0;b<l.length;b++){var S,E=(f=l[b]).dts-this._dtsBase,w=f.isKeyframe,T=E-n,k=f.cts,R=T+k;if(-1===d&&(d=T,c=R),S=b!==l.length-1?l[b+1].dts-this._dtsBase-n-T:null!=p?p.dts-this._dtsBase-n-T:y.length>=1?y[y.length-1].duration:Math.floor((null===(i=this._videoMeta)||void 0===i?void 0:i.refSampleDuration)||0),w){var O=new xe.$_(T,R,S,f.dts,!0);O.fileposition=f.fileposition,g.appendSyncPoint(O)}y.push({dts:T,pts:R,cts:k,units:f.units,size:f.length,isKeyframe:w,duration:S,originalDts:E,flags:{isLeading:0,dependsOn:w?2:1,isDependedOn:w?1:0,hasRedundancy:0,isNonSync:w?0:1}})}for((h=new Uint8Array(A))[0]=A>>>24&255,h[1]=A>>>16&255,h[2]=A>>>8&255,h[3]=255&A,h.set(Ce.types.mdat,4),b=0;b<y.length;b++)for(var C=y[b].units;null==C?void 0:C.length;){var B=C.shift(),x=null==B?void 0:B.data;h.set(x,u),u+=x.byteLength}var I=y[y.length-1];if(o=I.dts+I.duration,a=I.pts+I.duration,this._videoNextDts=o,g.beginDts=d,g.endDts=o,g.beginPts=c,g.endPts=a,g.originalBeginDts=y[0].originalDts,g.originalEndDts=I.originalDts+I.duration,g.firstSample=new xe.$_(y[0].dts,y[0].pts,y[0].duration,y[0].originalDts,!!y[0].isKeyframe),g.lastSample=new xe.$_(I.dts,I.pts,I.duration,I.originalDts,!!I.isKeyframe),this._isLive||this._videoSegmentInfoList.append(g),s.samples=y,s.sequenceNumber++,this._forceFirstIDR){var L=y[0].flags;L.dependsOn=2,L.isNonSync=0}var D=Ce.moof(s,d);s.samples=[],s.length=0,null===(r=this._onMediaSegment)||void 0===r||r.call(this,"video",{type:"video",data:this._mergeBoxes(D,h).buffer,sampleCount:y.length,info:g})}}},e.prototype._mergeBoxes=function(e,t){var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(e,0),i.set(t,e.byteLength),i},e}();var Le=i(8098),De=i(550);const Me=function(){function e(e,t){var i;this.TAG="TransmuxingController",this._emitter=new r.A,this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!=typeof e.cors&&(e.cors=!0),"boolean"!=typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;var n=0;null===(i=this._mediaDataSource.segments)||void 0===i||i.forEach((function(i){i.timestampBase=n,n+=i.duration,i.cors=e.cors,i.withCredentials=e.withCredentials,t.referrerPolicy&&(i.referrerPolicy=t.referrerPolicy)})),isNaN(n)||this._mediaDataSource.duration===n||(this._mediaDataSource.duration=n),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return e.prototype.destroy=function(){var e,t,i;this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(null===(e=this._ioctl)||void 0===e||e.destroy(),this._ioctl=null),this._demuxer&&(null===(t=this._demuxer)||void 0===t||t.destroy(),this._demuxer=null),this._remuxer&&(null===(i=this._remuxer)||void 0===i||i.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},e.prototype._loadSegment=function(e,t){var i,r,n;if(this._currentSegmentIndex=e,null===(i=this._mediaDataSource)||void 0===i?void 0:i.segments){var o=null===(r=this._mediaDataSource)||void 0===r?void 0:r.segments[e],a=this._ioctl=new Le.A(o,this._config,e);a.onError=this._onIOException.bind(this),a.onSeeked=this._onIOSeeked.bind(this),a.onComplete=this._onIOComplete.bind(this),a.onRedirect=this._onIORedirect.bind(this),a.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?null===(n=this._demuxer)||void 0===n||n.bindDataSource(this._ioctl):a.onDataArrival=this._onInitChunkArrival.bind(this),a.open(t)}},e.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},e.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},e.prototype.pause=function(){var e;(null===(e=this._ioctl)||void 0===e?void 0:e.isWorking())&&(this._ioctl.pause(),this._disableStatisticsReporter())},e.prototype.resume=function(){var e;(null===(e=this._ioctl)||void 0===e?void 0:e.isPaused())&&(this._ioctl.resume(),this._enableStatisticsReporter())},e.prototype.seek=function(e){var t,i,r,n,o,a,s,l,d,c,u,h,A,p;if(null!=this._mediaInfo&&(null===(t=this._mediaInfo)||void 0===t?void 0:t.isSeekable())){var f=this._searchSegmentIndexContains(e);if(f===this._currentSegmentIndex){var _=(null===(i=this._mediaInfo)||void 0===i?void 0:i.segments)?null===(r=this._mediaInfo)||void 0===r?void 0:r.segments[f]:{};if(void 0===_)this._pendingSeekTime=e;else{var m=null==_?void 0:_.getNearestKeyframe(e);null===(n=this._remuxer)||void 0===n||n.seek(null==m?void 0:m.milliseconds),null===(o=this._ioctl)||void 0===o||o.seek(null==m?void 0:m.fileposition),this._pendingResolveSeekPoint=null==m?void 0:m.milliseconds}}else{var v=(null===(a=this._mediaInfo)||void 0===a?void 0:a.segments)?null===(s=this._mediaInfo)||void 0===s?void 0:s.segments[f]:{};void 0===v?(this._pendingSeekTime=e,this._internalAbort(),null===(l=this._remuxer)||void 0===l||l.seek(),null===(d=this._remuxer)||void 0===d||d.insertDiscontinuity(),this._loadSegment(f)):(m=v.getNearestKeyframe(e),this._internalAbort(),null===(c=this._remuxer)||void 0===c||c.seek(e),null===(u=this._remuxer)||void 0===u||u.insertDiscontinuity(),this._demuxer&&(null===(h=this._demuxer)||void 0===h||h.resetMediaInfo(),this._demuxer.timestampBase=(null===(A=this._mediaDataSource)||void 0===A?void 0:A.segments)?null===(p=this._mediaDataSource)||void 0===p?void 0:p.segments[f].timestampBase:0),this._loadSegment(f,null==m?void 0:m.fileposition),this._pendingResolveSeekPoint=null==m?void 0:m.milliseconds,this._reportSegmentMediaInfo(f))}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){var t,i=this._mediaDataSource.segments,r=((null==i?void 0:i.length)||0)-1;if(0===((null==i?void 0:i.length)||0))return r;for(var n=0;n<((null==i?void 0:i.length)||0);n++)if(i&&e<((null===(t=i[n])||void 0===t?void 0:t.timestampBase)||0)){r=n-1;break}return r},e.prototype._onInitChunkArrival=function(e,t){var i,r,o,a,s,l=this,d=0;if(t>0)null===(i=this._demuxer)||void 0===i||i.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments?null===(r=this._mediaDataSource.segments[this._currentSegmentIndex])||void 0===r?void 0:r.timestampBase:0,d=(null===(o=this._demuxer)||void 0===o?void 0:o.parseChunks(e,t))||0;else{var c=null;(c=E.probe(e)).match&&(this._setupFLVDemuxerRemuxer(c),d=(null===(a=this._demuxer)||void 0===a?void 0:a.parseChunks(e,t))||0),c.match||(null==c?void 0:c.needMoreData)||(c=ke.probe(e)).match&&(this._setupTSDemuxerRemuxer(c),d=(null===(s=this._demuxer)||void 0===s?void 0:s.parseChunks(e,t))||0),c.match||(null==c?void 0:c.needMoreData)||(c=null,n.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then((function(){l._internalAbort()})),this._emitter.emit(De.A.DEMUX_ERROR,f.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return d},e.prototype._setupFLVDemuxerRemuxer=function(e){var t;this._demuxer=new E(e,this._config),this._remuxer||(this._remuxer=new Ie(this._config));var i=this._mediaDataSource;void 0===i.duration||isNaN(i.duration)||(this._demuxer.overridedDuration=i.duration),"boolean"==typeof i.hasAudio&&(this._demuxer.overridedHasAudio=i.hasAudio),"boolean"==typeof i.hasVideo&&(this._demuxer.overridedHasVideo=i.hasVideo),i.segments&&this._demuxer&&this._remuxer&&(this._demuxer.timestampBase=null===(t=null==i?void 0:i.segments[this._currentSegmentIndex])||void 0===t?void 0:t.timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this))},e.prototype._setupTSDemuxerRemuxer=function(e){var t=this._demuxer=new ke(e,this._config);this._remuxer||(this._remuxer=new Ie(this._config)),t.onError=this._onDemuxException.bind(this),t.onMediaInfo=this._onMediaInfo.bind(this),t.onMetaDataArrived=this._onMetaDataArrived.bind(this),t.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),t.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),t.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),t.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),t.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},e.prototype._onMediaInfo=function(e){var t,i,r=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=(null===(i=null===(t=this._mediaDataSource)||void 0===t?void 0:t.segments)||void 0===i?void 0:i.length)||0,Object.setPrototypeOf(this._mediaInfo,a.A.prototype));var n=Object.assign({},e);Object.setPrototypeOf(n,a.A.prototype),this._mediaInfo.segments&&(this._mediaInfo.segments[this._currentSegmentIndex]=n),this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=r._pendingSeekTime;r._pendingSeekTime=null,r.seek(e)}))},e.prototype._onMetaDataArrived=function(e){this._emitter.emit(De.A.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(De.A.SCRIPTDATA_ARRIVED,e)},e.prototype._onTimedID3Metadata=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.dts&&(e.dts-=i),this._emitter.emit(De.A.TIMED_ID3_METADATA_ARRIVED,e))},e.prototype._onSMPTE2038Metadata=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.dts&&(e.dts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),this._emitter.emit(De.A.SMPTE2038_METADATA_ARRIVED,e))},e.prototype._onSCTE35Metadata=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),this._emitter.emit(De.A.SCTE35_METADATA_ARRIVED,e))},e.prototype._onPESPrivateDataDescriptor=function(e){this._emitter.emit(De.A.PES_PRIVATE_DATA_DESCRIPTOR,e)},e.prototype._onPESPrivateData=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),void 0!==e.dts&&(e.dts-=i),this._emitter.emit(De.A.PES_PRIVATE_DATA_ARRIVED,e))},e.prototype._onIOSeeked=function(){var e;null===(e=this._remuxer)||void 0===e||e.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t,i,r=e+1;r<((null===(i=null===(t=this._mediaDataSource)||void 0===t?void 0:t.segments)||void 0===i?void 0:i.length)||0)?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(r)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(De.A.LOADING_COMPLETE),this._disableStatisticsReporter())},e.prototype._onIORedirect=function(e){var t,i=null===(t=this._ioctl)||void 0===t?void 0:t.extraData;this._mediaDataSource.segments&&(this._mediaDataSource.segments[i].redirectedURL=e)},e.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(De.A.RECOVERED_EARLY_EOF)},e.prototype._onIOException=function(e,t){n.A.e(this.TAG,"IOException: type = ".concat(e,", code = ").concat(t.code,", msg = ").concat(t.msg)),this._emitter.emit(De.A.IO_ERROR,e,t),this._disableStatisticsReporter()},e.prototype._onDemuxException=function(e,t){n.A.e(this.TAG,"DemuxException: type = ".concat(e,", info = ").concat(t)),this._emitter.emit(De.A.DEMUX_ERROR,e,t)},e.prototype._onRemuxerInitSegmentArrival=function(e,t){this._emitter.emit(De.A.INIT_SEGMENT,e,t)},e.prototype._onRemuxerMediaSegmentArrival=function(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(De.A.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){var i=t.info.syncPoints,r=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,o.A.safari&&i.length>0&&i[0].originalDts===r&&(r=i[0].pts),this._emitter.emit(De.A.RECOMMEND_SEEKPOINT,r)}},e.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&this._reportStatisticsInfo&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},e.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype._reportSegmentMediaInfo=function(e){var t,i,r,n,o=(null===(t=this._mediaInfo)||void 0===t?void 0:t.segments)?null===(i=this._mediaInfo)||void 0===i?void 0:i.segments[e]:{},a=Object.assign({},o);a.duration=null===(r=this._mediaInfo)||void 0===r?void 0:r.duration,a.segmentCount=null===(n=this._mediaInfo)||void 0===n?void 0:n.segmentCount,delete a.segments,delete a.keyframesIndex,this._emitter.emit(De.A.MEDIA_INFO,a)},e.prototype._reportStatisticsInfo=function(){var e,t,i,r,n,o,a={};a.url=null===(e=this._ioctl)||void 0===e?void 0:e.currentURL,a.hasRedirect=null===(t=this._ioctl)||void 0===t?void 0:t.hasRedirect,a.hasRedirect&&(a.redirectedURL=null===(i=this._ioctl)||void 0===i?void 0:i.currentRedirectedURL),a.speed=null===(r=this._ioctl)||void 0===r?void 0:r.currentSpeed,a.loaderType=null===(n=this._ioctl)||void 0===n?void 0:n.loaderType,a.currentSegmentIndex=this._currentSegmentIndex,a.totalSegmentCount=null===(o=this._mediaDataSource.segments)||void 0===o?void 0:o.length,this._emitter.emit(De.A.STATISTICS_INFO,a)},e}()},9987:(e,t,i)=>{var r=i(4417).charAt;e.exports=function(e,t,i){return t+(i?r(e,t).length:1)}}},t={};function i(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,i),o.exports}return i.m=e,i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i(1900)})()))}(Ye)),Ye.exports);class Ze extends re{constructor(e){var t,i;super(),this.player=e;const r=document.createElement("video"),n=document.createElement("canvas");this.$posterElement=document.createElement("img"),r.volume=0,r.oncontextmenu=e=>{e.preventDefault()},this.player._opt.hasAudio||(r.muted=!0),r.style.position="absolute",r.style.top="0px",r.style.left="0px",this._delayPlay=!1,e.$container.appendChild(r),this.videoInfo={width:"",height:"",encType:""},this.$videoElement=r,this.$canvasElement=n,this.canvasContext=n.getContext("2d"),this.fixChromeVideoFlashBug(),this.resize();const{proxy:o}=this.player.events;o(this.$videoElement,"loadstart",(()=>{this.player.emit("loadstart")})),o(this.$videoElement,"loadeddata",(()=>{this.player.debug.log("Video",`loadeddata ${this._delayPlay}`),this.player.emit(D.streamSuccess)})),o(this.$videoElement,"canplay",(()=>{this.player.debug.log("Video",`canplay and _delayPlay is ${this._delayPlay}`),this._delayPlay&&this._play(),this.player.$container.contains(this.$posterElement)&&this.$posterElement&&this.player.$container.removeChild(this.$posterElement)})),o(this.$videoElement,"waiting",(()=>{this.player.emit(D.videoWaiting)})),o(this.$videoElement,"timeupdate",(()=>{this.player.emit(D.timeUpdate,this.currentTime),!this.isPlaying()&&this.init&&(this.player.debug.log("Video","timeupdate and this.isPlaying is false and retry play"),this.$videoElement.play())})),null===(i=null===(t=this.player.debug)||void 0===t?void 0:t.log)||void 0===i||i.call(t,"Video","init")}destroy(){super.destroy(),this.$canvasElement=null,this.canvasContext=null,this.$videoElement&&(this.$videoElement.pause(),this.$videoElement.currentTime=0,this.$videoElement.src="",this.$videoElement.removeAttribute("src"),this.$videoElement=null),this.trackGenerator&&(this.trackGenerator.stop(),this.trackGenerator=null),this.vwriter&&(this.vwriter.close(),this.vwriter=null),this.player.$container.contains(this.$posterElement)&&this.$posterElement&&this.player.$container.removeChild(this.$posterElement),this.player.debug.log("Video","destroy")}fixChromeVideoFlashBug(){const e=function(){const e=navigator.userAgent.toLowerCase(),t={},i={IE:window.ActiveXObject||"ActiveXObject"in window,Chrome:e.indexOf("chrome")>-1&&e.indexOf("safari")>-1,Firefox:e.indexOf("firefox")>-1,Opera:e.indexOf("opera")>-1,Safari:e.indexOf("safari")>-1&&-1===e.indexOf("chrome"),Edge:e.indexOf("edge")>-1,QQBrowser:/qqbrowser/.test(e),WeixinBrowser:/MicroMessenger/i.test(e)};for(let r in i)if(i[r]){let i="";if("IE"===r)i=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];else if("Chrome"===r){for(const e in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[e].type&&(r="360");i=e.match(/chrome\/([\d.]+)/)[1]}else"Firefox"===r?i=e.match(/firefox\/([\d.]+)/)[1]:"Opera"===r?i=e.match(/opera\/([\d.]+)/)[1]:"Safari"===r?i=e.match(/version\/([\d.]+)/)[1]:"Edge"===r?i=e.match(/edge\/([\d.]+)/)[1]:"QQBrowser"===r&&(i=e.match(/qqbrowser\/([\d.]+)/)[1]);t.type=r,t.version=parseInt(i)}return t}(),t=e.type.toLowerCase();if("chrome"===t||"edge"===t){this.player.$container.style.backdropFilter="blur(0px)"}}play(){if(this.$videoElement){const e=this._getVideoReadyState();if(this.player.debug.log("Video",`play and readyState: ${e}`),0===e)return this.player.debug.warn("Video","readyState is 0 and set _delayPlay to true"),void(this._delayPlay=!0);this._play()}}_getVideoReadyState(){let e=0;return this.$videoElement&&(e=this.$videoElement.readyState),e}_play(){if(this.$videoElement){const e=setTimeout((()=>{this.$videoElement.play().then((()=>{this._delayPlay=!1,this.player.debug.log("Video","_play success"),setTimeout((()=>{this.isPlaying()||(this.player.debug.warn("Video","play failed and retry play"),this._play())}),100)})).catch((e=>{this.player.debug.error("Video","_play error",e)})).finally((()=>{clearTimeout(e)}))}),20)}}pause(e){this._poster(),this.$videoElement.paused||(e?this.$videoElement&&this.$videoElement.pause():setTimeout((()=>{this.$videoElement&&this.$videoElement.pause()}),100))}clearView(){}screenshot(e,t,i,r){var n;e=e||X()+"",r=r||U.download,t=t||"png";const o={png:"image/png",jpeg:"image/jpeg",webp:"image/webp"};"number"!=typeof i&&(i=Number(i||.92));const a=this.$videoElement,s=this.$canvasElement;s.width=a.videoWidth,s.height=a.videoHeight,null===(n=this.canvasContext)||void 0===n||n.drawImage(a,0,0,s.width,s.height);const l=s.toDataURL(o[t]||o.png,i);if(setTimeout((()=>{var e;null===(e=this.canvasContext)||void 0===e||e.clearRect(0,0,s.width,s.height),s.width=0,s.height=0}),10),"data:,"!==l){if(r===U.base64)return l;{const i=Y(l,e+"."+t);return r===U.blob?i:r===U.download?(de(i,e),i):void 0}}}initCanvasViewSize(){this.resize()}_poster(){const e=this.screenshot("poster","png",.75,U.base64);void 0===e||e.length<10||(this.$posterElement.src=e,this.$posterElement.style.position="absolute",this.$posterElement.style.top="0px",this.$posterElement.style.left="0px",this.$posterElement.style.zIndex="1",this.$posterElement.style.objectFit="contain",this.$posterElement.style.pointerEvents="none",this.player.$container.appendChild(this.$posterElement),this.resize())}render(e){this.vwriter&&this.vwriter.write(e.videoFrame)}resize(){this._resizeElement(this.$videoElement),this._resizeElement(this.$posterElement)}_resizeElement(e){const t=this.player._opt,i=this.player.width,r=this.player.height,n=t.rotate;e.width=i,e.height=r,270!==n&&90!==n||(e.width=r,e.height=i);const o=(i-e.width)/2,a=(r-e.height)/2;let s="contain";t.scaleMode===V.full&&(s="fill"),t.scaleMode===V.fullAuto&&(s="cover"),e.style.objectFit=s,e.style.transform="rotate("+n+"deg)",e.style.left=o+"px",e.style.top=a+"px"}isPlaying(){return this.$videoElement&&!this.$videoElement.paused}get currentTime(){var e;return(null===(e=this.$videoElement)||void 0===e?void 0:e.currentTime)||0}}class Ke extends Me{constructor(e,t){super(e,t,Ze),this._checkHeartTimeout=null,this._checkLoadingTimeout=null,this._opt.useMSE=!0,this.emit(D.decoderLoaded),this._createPlayer(t)}close(){}_createPlayer(e){var t;this._opt=Object.assign({},this._opt,e),this._removeFlvEvents(),this.player&&(this.player.unload(),this.player.detachMediaElement(),this.player.destroy(),this.player=null),this.events||(this.events=new Ce(this)),this.video||(this.video=new Ze(this)),null===(t=Xe.LoggingControl)||void 0===t||t.applyConfig({globalTag:"EzuikitFlv",enableVerbose:!!this._opt.debug,enableDebug:!!this._opt.debug,enableInfo:!!this._opt.debug,enableWarn:!!this._opt.debug,enableError:!0}),this.player=Xe.createPlayer({type:"flv",url:e.url,isLive:e.isLive},{stashInitialSize:128,enableWorker:!0,liveBufferLatencyChasing:!0,autoCleanupSourceBuffer:!0,lazyLoadMaxDuration:86400,fixAudioTimestampGap:!1}),this.player.attachMediaElement(this.video.$videoElement),this._flvEvents()}_removeFlvEvents(){this.player&&(this.player.off(Xe.Events.ERROR),this.player.off(Xe.Events.LOADING_COMPLETE),this.player.off(Xe.Events.RECOVERED_EARLY_EOF),this.player.off(Xe.Events.MEDIA_INFO),this.player.off(Xe.Events.STATISTICS_INFO),this.player.off(Xe.Events.DESTROYING))}_flvEvents(){if(this.player){let e=0;this.player.on(Xe.Events.ERROR,((t,i,r)=>{"MediaError"===t&&"MediaMSEError"===i&&9===r.code&&this.emit(P.mediaSourceH265NotSupport,r),this.emit(D.error,{errorTypes:t,errorDetails:i,info:r}),t.indexOf("NetworkError")>-1&&(this.emit(D.streamError,{errorTypes:t,errorDetails:i,info:r,api:this._opt.url,type:"stream"}),this.player&&this.pause().then((()=>{this.emit(D.delayTimeout)}))),"MediaError"===t&&"CodecUnsupported"===i&&-1===r.code&&r.msg.indexOf("Unsupported audio codec")?0===e&&(ze.report(51,{event:t,value:r}),e=1,this.debug.error(`${Xe.Events.ERROR}`,t,i,JSON.stringify(r))):(ze.report(51,{event:t,value:r}),this.debug.error(`${Xe.Events.ERROR}`,t,i,JSON.stringify(r)))})),this.player.on(Xe.Events.LOADING_COMPLETE,(e=>{this.debug.warn(`${Xe.Events.LOADING_COMPLETE}`,JSON.stringify(e))})),this.player.on(Xe.Events.RECOVERED_EARLY_EOF,(e=>{this.debug.warn(`${Xe.Events.RECOVERED_EARLY_EOF}`,e)})),this.player.on("media_info",(e=>{this.clearCheckLoadingTimeout(),this.video.updateVideoInfo(Object.assign({encTypeCode:(null==e?void 0:e.videoCodec.indexOf("avc"))>=0?7:12},e))})),this.player.on(Xe.Events.STATISTICS_INFO,(e=>{e.decodedFrames===this._decodedFrames&&null===this._checkHeartTimeout?this.checkHeartTimeout():e.decodedFrames!==this._decodedFrames&&(this.clearCheckHeartTimeout(),this._decodedFrames=e.decodedFrames)})),this.player.on(Xe.Events.DESTROYING,(e=>{this.debug.log(`${Xe.Events.DESTROYING}`,JSON.stringify(e))})),this.on(D.videoWaiting,(()=>{this.clearCheckHeartTimeout(),null===this._checkHeartTimeout&&this.handleRender()})),this._onVideoLoadstart=this._onVideoLoadstart.bind(this),this.off("loadstart"),this.on("loadstart",this._onVideoLoadstart),this.on(D.timeUpdate,(()=>{this.clearCheckHeartTimeout()})),this._onVideoStreamSuccess=this._onVideoStreamSuccess.bind(this),this.off(D.streamSuccess,this._onVideoStreamSuccess),this.on(D.streamSuccess,this._onVideoStreamSuccess)}}_onVideoLoadstart(){this.checkLoadingTimeout()}_onVideoStreamSuccess(){this.clearCheckLoadingTimeout()}getOption(){return this._opt}emitError(e,t=""){this.emit(D.error,e,t),this.emit(e,t)}destroy(){this._destroy(),this.video&&(this.video.destroy(),this.video=null),this.events&&(this.events.destroy(),this.events=null),this.emit("destroy"),this.off(),this.debug.log("play","destroy end")}_destroy(){this.player&&this.playing&&this.player.pause(),this._flvPlayerDestroy(),this._loading=!1,this._playing=!1,this._lastVolume=null,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0}resetStats(){}get loaded(){return!0}set playing(e){e&&(this.loading=!1),this.playing!==e&&(this._playing=e,this.emit(D.playing,e),e?this.emit(D.play):this.emit(D.pause))}get playing(){return this._playing}get volume(){var e;return(null===(e=this.video)||void 0===e?void 0:e.$videoElement.volume)||0}set volume(e){0!==e&&this.video?(this.video.$videoElement.muted=!1,this.video.$videoElement.volume=e,this._lastVolume=e):this.video&&(this.video.$videoElement.muted=!0),this.emit(D.volumechange,this.volume),0===e?this.emit(D.mute,!0):0!==e&&this.emit(D.mute,!1)}get lastVolume(){return this._lastVolume}set loading(e){this.loading!==e&&(this._loading=e,this.emit(D.loading,this._loading),e||this.emit(D.loaded))}get loading(){return this._loading}set audioTimestamp(e){null!==e&&(this._audioTimestamp=e)}get audioTimestamp(){return this._audioTimestamp}set videoTimestamp(e){null!==e&&(this._videoTimestamp=e)}get videoTimestamp(){return this._videoTimestamp}get isDebug(){return!!this._opt.debug}checkLoadingTimeout(){var e;this._checkLoadingTimeout=window.setTimeout((()=>{this.clearCheckLoadingTimeout(),this.pause().then((()=>{this.emit(D.timeout,D.loadingTimeout),this.emit(D.loadingTimeout)})).catch((()=>{}))}),1e3*((null===(e=this._opt)||void 0===e?void 0:e.loadingTimeout)||10))}clearCheckLoadingTimeout(){this._checkLoadingTimeout&&(clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}checkHeart(){this.clearCheckHeartTimeout(),this.checkHeartTimeout()}clearCheckHeartTimeout(){this._checkHeartTimeout&&(clearTimeout(this._checkHeartTimeout),this._checkHeartTimeout=null)}checkHeartTimeout(){}handleRender(){this.loading&&(this.emit(D.start),this.loading=!1),this.playing||(this.playing=!0),this.checkHeart()}updateOption(e){var t;super.updateOption(e),null===(t=Xe.LoggingControl)||void 0===t||t.applyConfig({globalTag:"EzuikitFlv",enableVerbose:!!e.debug,enableDebug:!!e.debug,enableInfo:!!e.debug,enableWarn:!!e.debug,enableError:!0})}play(e={}){return this._play(e)}_play(e={}){return this.player&&this._destroy(),this._createPlayer(Object.assign({},this._opt,e)),this.loading=!0,this._playing=!1,this._times.playInitStart=X(),this.player?(this.player.load(),this.clearCheckHeartTimeout(),new Promise(((e,t)=>{this.player.play().then((()=>{this.loading=!1,this.playing=!0,this._opt.isMute||this.mute(!1),e()})).catch((e=>{t(e)}))}))):Promise.reject()}_flvPlayerDestroy(){this.player&&(this.video.pause(),this.player.unload(),this._removeFlvEvents(),this.player.detachMediaElement(),this.player.destroy(),this.player=null)}_close(){return new Promise((e=>{this._loading=!1,this._playing=!1,this._lastVolume=null,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this.video&&this.video.resetInit(),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.player&&(this._flvPlayerDestroy(),this._pause=!0),this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,setTimeout((()=>{e()}),110)}))}pause(){return this._close()}resumeAudioAfterPause(){}mute(e){this.volume=e?0:.5}}class Je{constructor(e,t){this._opt=Object.assign({},f,t),(J()||"360EE"===c().browser)&&(this._opt.useMSE=!1);return new(Je.getLoaderFactory(this._opt.useMSE))(e,this._opt)}static getLoaderFactory(e){return e?Ke:He}}var et,tt={exports:{}};var it=(et||(et=1,function(e){var t=Object.prototype.hasOwnProperty,i="~";function r(){}function n(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new n(r,o||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,r,n=[];if(0===this._eventsCount)return n;for(r in e=this._events)t.call(e,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},s.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,a=new Array(o);n<o;n++)a[n]=r[n].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,n,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,d,c=this._events[s],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,n),!0;case 5:return c.fn.call(c.context,t,r,n,o),!0;case 6:return c.fn.call(c.context,t,r,n,o,a),!0}for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c.fn.apply(c.context,l)}else{var h,A=c.length;for(d=0;d<A;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),u){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,r);break;case 4:c[d].fn.call(c[d].context,t,r,n);break;default:if(!l)for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c[d].fn.apply(c[d].context,l)}}return!0},s.prototype.on=function(e,t,i){return o(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return o(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,r,n){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||n&&!s.once||r&&s.context!==r||a(this,o);else{for(var l=0,d=[],c=s.length;l<c;l++)(s[l].fn!==t||n&&!s[l].once||r&&s[l].context!==r)&&d.push(s[l]);d.length?this._events[o]=1===d.length?d[0]:d:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}(tt)),tt.exports),rt=n(it);function nt(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=new URL(e),r=e.split("?")[1];let n={};if(r){const e=r.split("&");for(let t of e){if(""===t)continue;const e=t.split("=");e[0]&&(n[e[0]]=e[1])}}const o={protocol:i.protocol,hostname:i.hostname,port:i.port,pathname:i.pathname,search:i.search,query:n,url:e};if(t&&/_(\d+)_(\d+)\.flv/.test(e)){const e=i.pathname.split("/")[i.pathname.split("/").length-1].replace(/.flv$/,"").split("_");e[0].indexOf("-")>=0?o.deviceSerial=e[0].split("-")[1]:o.deviceSerial=e[0],o.channelNo=+e[1],o.streamTypeIn=+e[2]}return o}var ot,at={exports:{}},st=o(Object.freeze({__proto__:null,default:{}}));var lt=(ot||(ot=1,function(e){!function(){var t="input is invalid type",i="object"==typeof window,n=i?window:{};n.JS_MD5_NO_WINDOW&&(i=!1);var o=!i&&"object"==typeof self,a=!n.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?n=r:o&&(n=self);var s,l=!n.JS_MD5_NO_COMMON_JS&&e.exports,d=!n.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),u=[128,32768,8388608,-2147483648],h=[0,8,16,24],A=["hex","array","digest","buffer","arrayBuffer","base64"],p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),f=[];if(d){var _=new ArrayBuffer(68);s=new Uint8Array(_),f=new Uint32Array(_)}var m=Array.isArray;!n.JS_MD5_NO_NODE_JS&&m||(m=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var v=ArrayBuffer.isView;!d||!n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&v||(v=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var g=function(e){var i=typeof e;if("string"===i)return[e,!0];if("object"!==i||null===e)throw new Error(t);if(d&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!m(e)&&!v(e))throw new Error(t);return[e,!1]},y=function(e){return function(t){return new E(!0).update(t)[e]()}},b=function(e){var i,r=st,o=st.Buffer;return i=o.from&&!n.JS_MD5_NO_BUFFER_FROM?o.from:function(e){return new o(e)},function(n){if("string"==typeof n)return r.createHash("md5").update(n,"utf8").digest("hex");if(null==n)throw new Error(t);return n.constructor===ArrayBuffer&&(n=new Uint8Array(n)),m(n)||v(n)||n.constructor===o?r.createHash("md5").update(i(n)).digest("hex"):e(n)}},S=function(e){return function(t,i){return new w(t,!0).update(i)[e]()}};function E(e){if(e)f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f,this.buffer8=s;else if(d){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function w(e,t){var i,r=g(e);if(e=r[0],r[1]){var n,o=[],a=e.length,s=0;for(i=0;i<a;++i)(n=e.charCodeAt(i))<128?o[s++]=n:n<2048?(o[s++]=192|n>>>6,o[s++]=128|63&n):n<55296||n>=57344?(o[s++]=224|n>>>12,o[s++]=128|n>>>6&63,o[s++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),o[s++]=240|n>>>18,o[s++]=128|n>>>12&63,o[s++]=128|n>>>6&63,o[s++]=128|63&n);e=o}e.length>64&&(e=new E(!0).update(e).array());var l=[],d=[];for(i=0;i<64;++i){var c=e[i]||0;l[i]=92^c,d[i]=54^c}E.call(this,t),this.update(d),this.oKeyPad=l,this.inner=!0,this.sharedMemory=t}E.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t=g(e);e=t[0];for(var i,r,n=t[1],o=0,a=e.length,s=this.blocks,l=this.buffer8;o<a;){if(this.hashed&&(this.hashed=!1,s[0]=s[16],s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),n)if(d)for(r=this.start;o<a&&r<64;++o)(i=e.charCodeAt(o))<128?l[r++]=i:i<2048?(l[r++]=192|i>>>6,l[r++]=128|63&i):i<55296||i>=57344?(l[r++]=224|i>>>12,l[r++]=128|i>>>6&63,l[r++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),l[r++]=240|i>>>18,l[r++]=128|i>>>12&63,l[r++]=128|i>>>6&63,l[r++]=128|63&i);else for(r=this.start;o<a&&r<64;++o)(i=e.charCodeAt(o))<128?s[r>>>2]|=i<<h[3&r++]:i<2048?(s[r>>>2]|=(192|i>>>6)<<h[3&r++],s[r>>>2]|=(128|63&i)<<h[3&r++]):i<55296||i>=57344?(s[r>>>2]|=(224|i>>>12)<<h[3&r++],s[r>>>2]|=(128|i>>>6&63)<<h[3&r++],s[r>>>2]|=(128|63&i)<<h[3&r++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),s[r>>>2]|=(240|i>>>18)<<h[3&r++],s[r>>>2]|=(128|i>>>12&63)<<h[3&r++],s[r>>>2]|=(128|i>>>6&63)<<h[3&r++],s[r>>>2]|=(128|63&i)<<h[3&r++]);else if(d)for(r=this.start;o<a&&r<64;++o)l[r++]=e[o];else for(r=this.start;o<a&&r<64;++o)s[r>>>2]|=e[o]<<h[3&r++];this.lastByteIndex=r,this.bytes+=r-this.start,r>=64?(this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},E.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>>2]|=u[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},E.prototype.hash=function(){var e,t,i,r,n,o,a=this.blocks;this.first?t=((t=((e=((e=a[0]-680876937)<<7|e>>>25)-271733879|0)^(i=((i=(-271733879^(r=((r=(-1732584194^2004318071&e)+a[1]-117830708)<<12|r>>>20)+e|0)&(-271733879^e))+a[2]-1126478375)<<17|i>>>15)+r|0)&(r^e))+a[3]-1316259209)<<22|t>>>10)+i|0:(e=this.h0,t=this.h1,i=this.h2,t=((t+=((e=((e+=((r=this.h3)^t&(i^r))+a[0]-680876936)<<7|e>>>25)+t|0)^(i=((i+=(t^(r=((r+=(i^e&(t^i))+a[1]-389564586)<<12|r>>>20)+e|0)&(e^t))+a[2]+606105819)<<17|i>>>15)+r|0)&(r^e))+a[3]-1044525330)<<22|t>>>10)+i|0),t=((t+=((e=((e+=(r^t&(i^r))+a[4]-176418897)<<7|e>>>25)+t|0)^(i=((i+=(t^(r=((r+=(i^e&(t^i))+a[5]+1200080426)<<12|r>>>20)+e|0)&(e^t))+a[6]-1473231341)<<17|i>>>15)+r|0)&(r^e))+a[7]-45705983)<<22|t>>>10)+i|0,t=((t+=((e=((e+=(r^t&(i^r))+a[8]+1770035416)<<7|e>>>25)+t|0)^(i=((i+=(t^(r=((r+=(i^e&(t^i))+a[9]-1958414417)<<12|r>>>20)+e|0)&(e^t))+a[10]-42063)<<17|i>>>15)+r|0)&(r^e))+a[11]-1990404162)<<22|t>>>10)+i|0,t=((t+=((e=((e+=(r^t&(i^r))+a[12]+1804603682)<<7|e>>>25)+t|0)^(i=((i+=(t^(r=((r+=(i^e&(t^i))+a[13]-40341101)<<12|r>>>20)+e|0)&(e^t))+a[14]-1502002290)<<17|i>>>15)+r|0)&(r^e))+a[15]+1236535329)<<22|t>>>10)+i|0,t=((t+=((r=((r+=(t^i&((e=((e+=(i^r&(t^i))+a[1]-165796510)<<5|e>>>27)+t|0)^t))+a[6]-1069501632)<<9|r>>>23)+e|0)^e&((i=((i+=(e^t&(r^e))+a[11]+643717713)<<14|i>>>18)+r|0)^r))+a[0]-373897302)<<20|t>>>12)+i|0,t=((t+=((r=((r+=(t^i&((e=((e+=(i^r&(t^i))+a[5]-701558691)<<5|e>>>27)+t|0)^t))+a[10]+38016083)<<9|r>>>23)+e|0)^e&((i=((i+=(e^t&(r^e))+a[15]-660478335)<<14|i>>>18)+r|0)^r))+a[4]-405537848)<<20|t>>>12)+i|0,t=((t+=((r=((r+=(t^i&((e=((e+=(i^r&(t^i))+a[9]+568446438)<<5|e>>>27)+t|0)^t))+a[14]-1019803690)<<9|r>>>23)+e|0)^e&((i=((i+=(e^t&(r^e))+a[3]-187363961)<<14|i>>>18)+r|0)^r))+a[8]+1163531501)<<20|t>>>12)+i|0,t=((t+=((r=((r+=(t^i&((e=((e+=(i^r&(t^i))+a[13]-1444681467)<<5|e>>>27)+t|0)^t))+a[2]-51403784)<<9|r>>>23)+e|0)^e&((i=((i+=(e^t&(r^e))+a[7]+1735328473)<<14|i>>>18)+r|0)^r))+a[12]-1926607734)<<20|t>>>12)+i|0,t=((t+=((o=(r=((r+=((n=t^i)^(e=((e+=(n^r)+a[5]-378558)<<4|e>>>28)+t|0))+a[8]-2022574463)<<11|r>>>21)+e|0)^e)^(i=((i+=(o^t)+a[11]+1839030562)<<16|i>>>16)+r|0))+a[14]-35309556)<<23|t>>>9)+i|0,t=((t+=((o=(r=((r+=((n=t^i)^(e=((e+=(n^r)+a[1]-1530992060)<<4|e>>>28)+t|0))+a[4]+1272893353)<<11|r>>>21)+e|0)^e)^(i=((i+=(o^t)+a[7]-155497632)<<16|i>>>16)+r|0))+a[10]-1094730640)<<23|t>>>9)+i|0,t=((t+=((o=(r=((r+=((n=t^i)^(e=((e+=(n^r)+a[13]+681279174)<<4|e>>>28)+t|0))+a[0]-358537222)<<11|r>>>21)+e|0)^e)^(i=((i+=(o^t)+a[3]-722521979)<<16|i>>>16)+r|0))+a[6]+76029189)<<23|t>>>9)+i|0,t=((t+=((o=(r=((r+=((n=t^i)^(e=((e+=(n^r)+a[9]-640364487)<<4|e>>>28)+t|0))+a[12]-421815835)<<11|r>>>21)+e|0)^e)^(i=((i+=(o^t)+a[15]+530742520)<<16|i>>>16)+r|0))+a[2]-995338651)<<23|t>>>9)+i|0,t=((t+=((r=((r+=(t^((e=((e+=(i^(t|~r))+a[0]-198630844)<<6|e>>>26)+t|0)|~i))+a[7]+1126891415)<<10|r>>>22)+e|0)^((i=((i+=(e^(r|~t))+a[14]-1416354905)<<15|i>>>17)+r|0)|~e))+a[5]-57434055)<<21|t>>>11)+i|0,t=((t+=((r=((r+=(t^((e=((e+=(i^(t|~r))+a[12]+1700485571)<<6|e>>>26)+t|0)|~i))+a[3]-1894986606)<<10|r>>>22)+e|0)^((i=((i+=(e^(r|~t))+a[10]-1051523)<<15|i>>>17)+r|0)|~e))+a[1]-2054922799)<<21|t>>>11)+i|0,t=((t+=((r=((r+=(t^((e=((e+=(i^(t|~r))+a[8]+1873313359)<<6|e>>>26)+t|0)|~i))+a[15]-30611744)<<10|r>>>22)+e|0)^((i=((i+=(e^(r|~t))+a[6]-1560198380)<<15|i>>>17)+r|0)|~e))+a[13]+1309151649)<<21|t>>>11)+i|0,t=((t+=((r=((r+=(t^((e=((e+=(i^(t|~r))+a[4]-145523070)<<6|e>>>26)+t|0)|~i))+a[11]-1120210379)<<10|r>>>22)+e|0)^((i=((i+=(e^(r|~t))+a[2]+718787259)<<15|i>>>17)+r|0)|~e))+a[9]-343485551)<<21|t>>>11)+i|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=i-1732584194|0,this.h3=r+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+i|0,this.h3=this.h3+r|0)},E.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,r=this.h3;return c[e>>>4&15]+c[15&e]+c[e>>>12&15]+c[e>>>8&15]+c[e>>>20&15]+c[e>>>16&15]+c[e>>>28&15]+c[e>>>24&15]+c[t>>>4&15]+c[15&t]+c[t>>>12&15]+c[t>>>8&15]+c[t>>>20&15]+c[t>>>16&15]+c[t>>>28&15]+c[t>>>24&15]+c[i>>>4&15]+c[15&i]+c[i>>>12&15]+c[i>>>8&15]+c[i>>>20&15]+c[i>>>16&15]+c[i>>>28&15]+c[i>>>24&15]+c[r>>>4&15]+c[15&r]+c[r>>>12&15]+c[r>>>8&15]+c[r>>>20&15]+c[r>>>16&15]+c[r>>>28&15]+c[r>>>24&15]},E.prototype.toString=E.prototype.hex,E.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,r=this.h3;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&i,i>>>8&255,i>>>16&255,i>>>24&255,255&r,r>>>8&255,r>>>16&255,r>>>24&255]},E.prototype.array=E.prototype.digest,E.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},E.prototype.buffer=E.prototype.arrayBuffer,E.prototype.base64=function(){for(var e,t,i,r="",n=this.array(),o=0;o<15;)e=n[o++],t=n[o++],i=n[o++],r+=p[e>>>2]+p[63&(e<<4|t>>>4)]+p[63&(t<<2|i>>>6)]+p[63&i];return e=n[o],r+=p[e>>>2]+p[e<<4&63]+"=="},w.prototype=new E,w.prototype.finalize=function(){if(E.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();E.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),E.prototype.finalize.call(this)}};var T=function(){var e=y("hex");a&&(e=b(e)),e.create=function(){return new E},e.update=function(t){return e.create().update(t)};for(var t=0;t<A.length;++t){var i=A[t];e[i]=y(i)}return e}();T.md5=T,T.md5.hmac=function(){var e=S("hex");e.create=function(e){return new w(e)},e.update=function(t,i){return e.create(t).update(i)};for(var t=0;t<A.length;++t){var i=A[t];e[i]=S(i)}return e}(),l?e.exports=T:n.md5=T}()}(at)),at.exports),dt=n(lt);const ct="/api/v3/device/local/video/unify/query",ut="/api/service/device/capacity/video/quality",ht="/api/v3/device/setVideoLevel",At="/api/lapp/v2/live/address/get",pt="/api/service/media/live/cdn/config",ft="/api/service/media/live/record/cdn/config";function _t(e){return e<10?"0"+e:e+""}const mt={0:"流畅",1:"标清",2:"高清",3:"超清",4:"极清",5:"3K",6:"4K"},vt=[{videoLevel:1,name:mt[1],streamTypeIn:2,type:"compatible"},{videoLevel:2,name:mt[2],streamTypeIn:1,type:"compatible"}];class gt{constructor(e,t){this._player=e,this.baseURL=t.baseURL||"https://open.ys7.com",this.accessToken=t.accessToken,this.deviceSerial=t.deviceSerial,this.channelNo=t.channelNo,this.appName=t.appName,this.v=t.v}fetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=/http[s]?:\/\//.test(e)?e:`${this.baseURL}${e}`;return fetch(i,{...t||{},headers:{clientType:"ezuikit-flv",accessToken:this.accessToken,deviceSerial:this.deviceSerial,localIndex:this.channelNo,...t.headers||{}}})}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch(e,{...t||{},method:"get"})}post(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch(e,{...t||{},method:"post"})}setVideoLevelService(e){const t=new FormData;return t.append("videoLevel",parseInt(e)),this.post(`${ht}`,{body:t}).then((e=>e.json())).catch((e=>{var t,i;null===(t=(i=this._player).emit)||void 0===t||t.call(i,P.fetchError,{api:ht,error:e})}))}async getLocalVideoUnifyQueryService(e){var t,i,r,n;const o=(e.startTime+36e5*((null===(t=this._player._opt)||void 0===t?void 0:t.timeZone)||0))/1e3,a=(e.endTime+36e5*((null===(i=this._player._opt)||void 0===i?void 0:i.timeZone)||0))/1e3,s=async e=>{let t=[];try{var i,r,n;const d=await this.get(`${ct}?startTime=${e.startTime}&endTime=${e.endTime}&pageSize=${e.pageSize||200}`).then((e=>e.json())).catch((e=>{var t,i;null===(t=(i=this._player).emit)||void 0===t||t.call(i,P.fetchError,{api:ct,error:e})}));var o,a,l;if(200!==(null==d||null===(i=d.meta)||void 0===i?void 0:i.code))return null===(o=(a=this._player).emit)||void 0===o||o.call(a,P.fetchError,{api:ct,error:null==d?void 0:d.meta}),t;if(null!=d&&null!==(r=d.data)&&void 0!==r&&null!==(r=r.records)&&void 0!==r&&r.length&&(t=t.concat(d.data.records||[])),null!=d&&null!==(n=d.data)&&void 0!==n&&n.hasMore)t=t.concat(await s({...e,startTime:null==d||null===(l=d.data)||void 0===l?void 0:l.nextFileTime}))}catch(e){}return t},l=await s({...e,startTime:o,endTime:a})||[];return this._player.playbackRecords=(l||[]).map((e=>{var t,i;return{...e,startTime:e.startTime-3600*((null===(t=this._player._opt)||void 0===t?void 0:t.timeZone)||0),endTime:e.endTime-3600*((null===(i=this._player._opt)||void 0===i?void 0:i.timeZone)||0)}})).reduce(((e,t)=>{const i=e[e.length-1];return i&&i.endTime===t.startTime?i.endTime=t.endTime:e.push(t),e}),[]),null===(r=(n=this._player).emit)||void 0===r||r.call(n,D.localVideoRecords,this._player.playbackRecords),l}async getVideoQualityService(){let e=vt;try{var t,i;const o=await this.get(`${ut}?deviceSerial=${this.deviceSerial}`).then((e=>e.json())).catch((e=>{this._player.emit(P.fetchError,{api:ut,error:e})}));var r,n;if(200!==(null==o||null===(t=o.meta)||void 0===t?void 0:t.code))return null===(r=(n=this._player).emit)||void 0===r||r.call(n,P.fetchError,{api:ut,error:null==o?void 0:o.meta}),e;null!=o&&null!==(i=o.data)&&void 0!==i&&i.length&&(e=o.data)}catch(e){}return e=e.map((e=>({...e,name:mt[e.videoLevel]||"未知"}))),e}getPlayAddressService(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=new FormData;return Object.keys(e).forEach((i=>{t.append(i,e[i])})),t.append("protocol",4),t.append("accessToken",this.accessToken),t.append("deviceSerial",this.deviceSerial),t.append("channelNo",this.channelNo),this.post(`${At}`,{body:t}).then((e=>e.json())).then((e=>{var t;return 200==+e.code?null==e||null===(t=e.data)||void 0===t?void 0:t.url:""}))}getRecordAddressService(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.appName&&this.v?(delete e.expireTime,this.getCDNRecordAddressService(e)):this.getPlayAddressService({...e,type:2})}getLiveAddressService(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.appName&&this.v?(delete e.expireTime,this.getCDNLiveAddressService(e)):this.getPlayAddressService({...e,type:1})}getCDNPlayAddressService(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new FormData,r=new Date,n=`${r.getFullYear()}-${_t(r.getMonth()+1)}-${_t(r.getDate())} 00:00:00`,o=`${r.getFullYear()}-${_t(r.getMonth()+1)}-${_t(r.getDate())} 23:59:59`;return i.append("startTime",n),i.append("endTime",o),i.append("playProtocol",2),i.append("streamName",dt((function(e,t){var i,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[];for(t=t||r.length,i=0;i<e;i++)n[i]=r[0|Math.random()*t];return n.join("")}(32)+"_"+(new Date).getTime()).replace(/-/gi,"")+"_"+this.deviceSerial+"_"+this.channelNo+"_"+t.quality)),i.append("supportH265",1),i.append("appName",this.appName),Object.keys(t).forEach((e=>{i.append(e,t[e])})),this.post(e,{body:i}).then((e=>e.json())).then((e=>{var t,i;return 200==+(null===(t=e.meta)||void 0===t?void 0:t.code)?null===(i=e.data)||void 0===i?void 0:i.cdnUrl:""}))}async getCDNLiveAddressService(e){return this.getCDNPlayAddressService(`${pt}`,e)}async getCDNRecordAddressService(e){return this.getCDNPlayAddressService(`${ft}`,{recordStartTime:e.startTime,recordEndTime:e.stopTime,quality:e.quality,type:e.type||1})}}function yt(e){return new Date(bt(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/"))}function bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return`${(e=e.replace(/\//gi,"").replace(/-/gi,"").replace(/:/gi,"").replace(/ /gi,"")).substring(0,4)}${t}${e.substring(4,6)}${t}${e.substring(6,8)} ${e.substring(8,10)}:${e.substring(10,12)}:${e.substring(12,14)}`}const St=["h264","h265"],Et=[.5,1,2,4,8];class wt extends rt{constructor(t){var i;super(wt._setOptions(t)),e(this,"event",new rt),e(this,"urlInfo",{}),e(this,"services",null),e(this,"_loadingTimeoutDelayTimer",null),ze.initMonitor(t.ignoreMonitor||t.disableColect);const r=Object.assign({},{isLive:!0,timeZone:0},f,t);let n=t.id||t.container;if("string"==typeof n&&(n=document.querySelector("#"+n.replace(/^#/,""))),!n)throw new Error("Flv required node can be a string (dom id) or dom (HTMLElement node)");if("CANVAS"===n.nodeName||"VIDEO"===n.nodeName)throw new Error(`Flv container type can not be ${n.nodeName} type`);if(!t.url)throw new Error("Flv url is empty");ze.url=t.url,ze.report(1,{name:"constructor"}),n.classList.add("ezui-player-container","ezui-flv-container"),n.style.cssText+="position:relative; overflow: hidden;",delete r.container,r.forceNoOffscreen=!0,ee(r.videoBuffer)&&(r.videoBuffer=1e3*Number(r.videoBuffer)),this._opt=r,this.urlInfo=nt(r.url,this._opt.isEzviz),this.$container=n,this._loadingTimeoutReplayTimes=0,this.events=new Ce(this),this._initPlayer(n,r),this._videoInfo={},this._currentPlayDate=null,this.definitionList=[],this.definition={},this._playbackRate=1,this.playbackRateList=Et,this.playbackRecords=[],this.services=new gt(this,{baseURL:(null===(i=this._opt.env)||void 0===i?void 0:i.domain)||H,accessToken:this._opt.accessToken,deviceSerial:this.urlInfo.deviceSerial,channelNo:this.urlInfo.channelNo}),this._httpServices()}_httpServices(){try{var e,t,i;if(this._opt.isEzviz&&null!==(e=this._opt)&&void 0!==e&&e.accessToken&&this.urlInfo.deviceSerial&&this.urlInfo.channelNo>=0&&this.urlInfo.streamTypeIn)if(this.services=new gt(this,{baseURL:((null===(t=this._opt.env)||void 0===t?void 0:t.domain)||H).replace(/\/$/,""),accessToken:this._opt.accessToken,deviceSerial:this.urlInfo.deviceSerial,channelNo:this.urlInfo.channelNo,appName:this._opt.appName,v:null===(i=this.urlInfo.query)||void 0===i?void 0:i.v}),this._isEzvizPlayback(this._opt.url)&&!this._opt.isLive){var r,n,o,a;this._playbackRate=+((null===(r=this.urlInfo)||void 0===r||null===(r=r.query)||void 0===r?void 0:r.playbackSpeed)||1),null===(n=this.services)||void 0===n||n.getLocalVideoUnifyQueryService({startTime:yt(null===(o=this.urlInfo)||void 0===o||null===(o=o.query)||void 0===o?void 0:o.begin).getTime(),endTime:yt(null===(a=this.urlInfo)||void 0===a||null===(a=a.query)||void 0===a?void 0:a.end).getTime()});let e=null,t=0;this.on(D.timeUpdate,(i=>{const r=this.playbackRecords.length;if(r>0){var n,o;const d=yt(this.urlInfo.query.begin).getTime()/1e3;let c=null===(n=this.playbackRecords[t])||void 0===n?void 0:n.startTime,u=null===(o=this.playbackRecords[t])||void 0===o?void 0:o.endTime;if(d<=this.playbackRecords[0].startTime)t=0;else{if(d>=this.playbackRecords[this.playbackRecords.length-1].endTime)return;for(let e=0;e<r;e++){const i=this.playbackRecords[e];if(d>=i.startTime&&d<=i.endTime){var a;t=e,c=d,u=null===(a=this.playbackRecords[t])||void 0===a?void 0:a.endTime;break}{const r=this.playbackRecords[e+1];if(d>=i.endTime&&d<=r.startTime){var s,l;t=e+1,c=null===(s=this.playbackRecords[t])||void 0===s?void 0:s.startTime,u=null===(l=this.playbackRecords[t])||void 0===l?void 0:l.endTime;break}}}}let h=parseInt(c+i,10);if(0===i)return;this.emit(D.timeUpdateOSD,{currentTime:i,currentFragmentPlayEnd:c+i>=u,currentSliceIndex:t,osd:h}),h+3>=this.playbackRecords[r-1].endTime&&(e&&clearTimeout(e),e=setTimeout((()=>{this.emit(D.end),clearTimeout(e),this.pause()}),3e3)),c+i>=u&&t<r-1&&t++;const A=new Date(1e3*h);this._currentPlayDate=`${A.getFullYear()}${_t(A.getMonth()+1)}${_t(A.getDate())}${_t(A.getHours())}${_t(A.getMinutes())}${_t(A.getSeconds())}`}}))}else if(!this._isEzvizPlayback(this._opt.url)&&this._opt.isLive){var s,l,d,c;const e=null!==(s=this.urlInfo)&&void 0!==s&&null!==(s=s.query)&&void 0!==s&&s.expire?parseInt((1e3*this.urlInfo.query.expire-(new Date).getTime())/1e3):void 0;Promise.all([null===(l=this.services)||void 0===l?void 0:l.getVideoQualityService(),null===(d=this.services)||void 0===d?void 0:d.getLiveAddressService({quality:"1"==(null===(c=this.urlInfo)||void 0===c?void 0:c.streamTypeIn)?2:1,expireTime:e})]).then((e=>{let t=[this.urlInfo.url,e[1]].sort(((e,t)=>{const i=e=>{const t=e.match(/_(\d+)\.flv/);return t?parseInt(t[1],10):0};return i(e)-i(t)}));const i=e[0].map(((e,i)=>({...e,url:1===e.streamTypeIn?t[0]:t[1]})));this.definitionList=i,this.emit(D.getDefinitionListResult,i),this.emit(D.definitionListChange,i)}))}}catch(e){var u,h;null===(u=this.player)||void 0===u||null===(u=u.debug)||void 0===u||null===(h=u.error)||void 0===h||h.call(u,e)}}setDefinitionList(e){this.player&&(this.definitionList=e,this.emit(D.definitionListChange,e))}switchDefinition(e){if(this.player){if(e.videoLevel>=0&&[1,2].includes(e.streamTypeIn)){const n=this.definitionList.find((t=>t.videoLevel===e.videoLevel));if(n){if(this.emit(D.definitionChange,n),this.definition=n,n.url){var t;if("compatible"!==n.type)null===(t=this.services)||void 0===t||t.setVideoLevelService(n.videoLevel);return this.playing?this.pause().then((()=>{this.play({url:n.url})})):this.play({url:n.url}),Promise.resolve(0)}var i;return null===(i=this.player.debug)||void 0===i||i.warn("play url is not found"),Promise.resolve(1)}var r;return null===(r=this.player.debug)||void 0===r||r.warn("definition is not found"),Promise.resolve(1)}var n;return null===(n=this.player.debug)||void 0===n||n.warn(`not support ${null==e?void 0:e.videoLevel}`),Promise.resolve(1)}}setPlaybackRateList(e){this.player&&(this.playbackRateList=e,this.emit(D.playbackRateListChange,e))}get playbackRate(){return this._playbackRate}set playbackRate(e){this.switchPlaybackRate(e)}switchPlaybackRate(e){var t,i,r;return this.player&&this._isEzvizPlayback(this._opt.url)?(e=+e,null!==(t=this.playbackRateList)&&void 0!==t&&t.includes(e)?this._getNewRecordPlayUrl({playbackRate:e}).then((t=>t?(this._playbackRate=e,this.emit(D.playbackRateChange,e),this.playing?this.pause().then((e=>{this.play({url:t})})):this.play({url:t}),0):1)):(null===(i=this.player)||void 0===i||null===(i=i.debug)||void 0===i||i.warn(`not support ${e}`),Promise.resolve(1))):(null===(r=this.player)||void 0===r||null===(r=r.debug)||void 0===r||r.warn(`not support ${e}`),Promise.resolve(1))}_getNewRecordPlayUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.player&&this._isEzvizPlayback(this._opt.url)){var t,i,r,n;const o=yt(this._currentPlayDate||(null===(t=this.urlInfo)||void 0===t||null===(t=t.query)||void 0===t?void 0:t.begin)),a=yt(null===(i=this.urlInfo)||void 0===i||null===(i=i.query)||void 0===i?void 0:i.end);return null===(r=this.services)||void 0===r?void 0:r.getRecordAddressService({expireTime:parseInt((new Date(1e3*(null===(n=this.urlInfo.query)||void 0===n?void 0:n.expire)).getTime()-(new Date).getTime())/1e3,10),startTime:`${o.getFullYear()}-${_t(o.getMonth()+1)}-${_t(o.getDate())} ${_t(o.getHours())}:${_t(o.getMinutes())}:${_t(o.getSeconds())}`,stopTime:`${a.getFullYear()}-${_t(a.getMonth()+1)}-${_t(a.getDate())} ${_t(a.getHours())}:${_t(a.getMinutes())}:${_t(a.getSeconds())}`,playbackSpeed:e.playbackRate||this.playbackRate,quality:this.urlInfo.streamTypeIn})}return Promise.resolve("")}_isEzvizPlayback(e){return this._opt.isEzviz&&/rec=(local|cloud)/.test(this._opt.url)}get playing(){return this.player.playing}static _setOptions(e){return"string"==typeof(e=Object.assign({},{isLive:!0,timeZone:0},f,e)).id?e:"string"==typeof e.container?(e.id=e.container.replace(/^#/,""),e):e}destroy(){this.events&&(this.events.destroy(),this.events=null),this.player&&(this.player.destroy(),this.player=null),this.$container&&(this.$container.classList.remove("ezui-flv-container"),this.$container=null),this.definitionList=[],this.definition={},this._videoInfo={},this._currentPlayDate=null,this.urlInfo={},this._playbackRate=1,this.playbackRateList=[],this.playbackRecords=[],this.$container=null,this._opt={},this._loadingTimeoutReplayTimes=0,this.removeAllListeners(),ze.report(50,{name:"destroy"})}_handlevideoInfo(e){this._videoInfo=e||{}}_initPlayer(e,t){var r,n,o,a;t.url&&(t.url=i(t.url,St)),this.player=new Je(e,t),null===(r=this.player.debug)||void 0===r||r.log("Flv","version",wt.version),null===(n=this.player.debug)||void 0===n||n.log("Flv","_initPlayer",JSON.stringify(t)),this._bindEvents(),t.autoPlay&&this.play(),this._handlevideoInfo=this._handlevideoInfo.bind(this),null===(o=this.player)||void 0===o||o.off(D.videoInfo,this._handlevideoInfo),null===(a=this.player)||void 0===a||a.on(D.videoInfo,this._handlevideoInfo)}_resetPlayer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.player.destroy(),this.player=null,this._opt=Object.assign(this._opt,e),this._initPlayer(this.$container,this._opt)}_bindEvents(){Object.keys(M).forEach((e=>{this.player.on(M[e],(t=>{this.emit(e,t),this.event.emit(e,t)}))}))}setDebug(e){this.player.updateOption({debug:e}),ze.report(50,{name:"setDebug"})}setLogger(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.player.updateOption({loggerOptions:{...this.player._opt.loggerOptions||{},...e}})}closeSound(){var e,t;null===(e=this.player)||void 0===e||null===(t=e.mute)||void 0===t||t.call(e,!0),ze.report(50,{name:"closeSound"})}openSound(){var e,t;null===(e=this.player)||void 0===e||null===(t=e.mute)||void 0===t||t.call(e,!1),ze.report(50,{name:"openSound"})}setVolume(e){this.player&&(this.player.volume=e,ze.report(50,{name:"setVolume",value:e}))}get volume(){return this.player.volume}set volume(e){this.setVolume(e)}getVolume(){return ze.report(50,{name:"getVolume"}),this.player.volume}audioResume(){var e,t;null===(e=this.player)||void 0===e||null===(e=e.audio)||void 0===e||null===(t=e.audioEnabled)||void 0===t||t.call(e,!0),ze.report(50,{name:"audioResume"})}setScaleMode(e){return new Promise(((t,i)=>{try{e=Number(e)}catch(e){return void i(e)}[V.full,V.auto,V.fullAuto].includes(e)?(this.player.updateOption({scaleMode:e}),this.resize(),t(),ze.report(50,{name:"setScaleMode"})):i("scale mode 0 | 1 | 2")}))}pause(){var e,t;return ze.report(50,{name:"pause"}),this._delayTimeoutTimer&&(clearTimeout(this._delayTimeoutTimer),this._delayTimeoutTimer=null),this._loadingTimeoutDelayTimer&&(clearTimeout(this._loadingTimeoutDelayTimer),this._loadingTimeoutDelayTimer=null),null===(e=this.player)||void 0===e||null===(t=e.pause)||void 0===t?void 0:t.call(e)}clearView(){this.player.video.clearView(),ze.report(50,{name:"clearView"})}async play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._loadingTimeoutReplayTimes=0,this.__play(e)}async __play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.url&&(ze.url=e.url),"string"==typeof e&&(e={url:e}),this._currentPlayDate&&!e.url&&this._isEzvizPlayback())try{e.url=await this.services.getRecordAddressService({expireTime:86400,quality:this.urlInfo.streamTypeIn,startTime:bt(this._currentPlayDate,"-"),stopTime:bt(this.urlInfo.query.end,"-"),playbackSpeed:this.playbackRate}),this._currentPlayDate=null}catch(e){}const t=i(e.url||this._opt.url,St);return this.urlInfo=nt(t,this._opt.isEzviz),this._playbackRate=this.urlInfo.query.playbackSpeed||1,this._opt=Object.assign({},this._opt,e||{},{url:t}),this._opt.urlQuery=Qe(e.url),ze.report(50,{name:"play"}),await new Promise(((e,t)=>{var i;if(!this._opt.url)return this.emit(D.error,P.playError),void t("play url is empty");null!==(i=this.player)&&void 0!==i&&i.playing?(this.clearView(),this.player.play(this._opt).then((()=>{e()})).catch((e=>{this.player.debug.warn("Flv","pause -> play and play error",e),this.player.pause().then((()=>{t(e)}))}))):this._play(this._opt).then((()=>{e()})).catch((e=>{this.player.debug.warn("Flv","this._play error",e),t(e)}))}))}_play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(((t,i)=>{const r=0===e.url.indexOf("http"),n=r?h:u,o=r||-1!==e.url.indexOf(".flv")||this._opt.isFlv?A:p;this.player.updateOption({protocol:n,demuxType:o}),this.player.once(P.webglAlignmentError,(()=>{this.player.off(P.webglAlignmentError),this.pause().then((()=>{this.player.debug.log("Flv","webglAlignmentError"),this._resetPlayer({openWebglAlignment:!0}),this.play(e).then((()=>{this.player.debug.log("Flv","webglAlignmentError and play success")})).catch((()=>{this.player.debug.log("Flv","webglAlignmentError and play error")}))}))})),this.player.once(P.mediaSourceH265NotSupport,(()=>{this.player.off(P.mediaSourceH265NotSupport),this.pause().then((()=>{this.player._opt.autoWasm&&(this.player.debug.log("Flv","auto wasm [mse-> wasm] reset player and play"),this._resetPlayer({useMSE:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","auto wasm [mse-> wasm] reset player and play success")})).catch((()=>{this.player.debug.log("Flv","auto wasm [mse-> wasm] reset player and play error")})))}))})),this.player.once(P.mediaSourceFull,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source full"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source full and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source full and reset player and play error")}))}))})),this.player.once(P.mediaSourceAppendBufferError,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source append buffer error"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source append buffer error and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source append buffer error and reset player and play error")}))}))})),this.player.once(P.mediaSourceBufferListLarge,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source buffer list large"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source buffer list large and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source buffer list large and reset player and play error")}))}))})),this.player.once(P.mediaSourceAppendBufferEndTimeout,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source append buffer end timeout"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source append buffer end timeout and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source append buffer end timeout and reset player and play error")}))}))})),this.player.once(P.mseSourceBufferError,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","mseSourceBufferError close success")}))})),this.player.once(P.webcodecsH265NotSupport,(()=>{this.pause().then((()=>{this.player._opt.autoWasm&&(this.player.debug.log("Flv","auto wasm [wcs-> wasm] reset player and play"),this._resetPlayer({useWCS:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","auto wasm [wcs-> wasm] reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","auto wasm [wcs-> wasm] reset player and play error")})))}))})),this.player.once(P.wasmDecodeError,(()=>{this.player._opt.wasmDecodeErrorReplay&&this.pause().then((()=>{this.player.debug.log("Flv","wasm decode error and reset player and play"),this._resetPlayer({useWCS:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","wasm decode error and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","wasm decode error and reset player and play error")}))}))})),this.player.off(D.delayTimeout,this._onDelayTimeout),this._onDelayTimeout=this._onDelayTimeout.bind(this),this.player.once(D.delayTimeout,this._onDelayTimeout),this.player.off(D.loadingTimeout,this._onLoadingTimeout),this._onLoadingTimeout=this._onLoadingTimeout.bind(this),this.player.once(D.loadingTimeout,this._onLoadingTimeout),this.player.off(D.delayTimeout,this._onStreamSuccess),this._onStreamSuccess=this._onStreamSuccess.bind(this),this.player.once(D.streamSuccess,this._onStreamSuccess),this.player.off(D.delayTimeout,this._onStreamError),this._onStreamError=this._onStreamError.bind(this),this.player.once(D.streamError,this._onStreamError),this.hasLoaded()?this.player.play(e).then((()=>{var e,i;null!==(e=this.player)&&void 0!==e&&null!==(e=e.video)&&void 0!==e&&e.$videoElement&&(null===(i=this.urlInfo.query)||void 0===i?void 0:i.playbackSpeed)>=1&&(this.player.video.$videoElement.playbackRate=this.urlInfo.query.playbackSpeed),t()})).catch((e=>{this.player&&(this.player.debug.warn("Flv","hasLoaded and play error",e),this.player.pause().then((()=>{i(e)})))})):this.player.once(D.decoderWorkerInit,(()=>{this.player.play(e).then((()=>{var e,i;null!==(e=this.player)&&void 0!==e&&null!==(e=e.video)&&void 0!==e&&e.$videoElement&&(null===(i=this.urlInfo.query)||void 0===i?void 0:i.playbackSpeed)>=1&&(this.player.video.$videoElement.playbackRate=this.urlInfo.query.playbackSpeed),t()})).catch((e=>{this.player&&(this.player.debug.warn("Flv","decoderWorkerInit and play error",e),this.player.pause().then((()=>{i(e)})))}))}))}))}_onDelayTimeout(){this._delayTimeoutTimer=setTimeout((()=>{this._delayTimeoutTimer&&(clearTimeout(this._delayTimeoutTimer),this._delayTimeoutTimer=null),(this._loadingTimeoutReplayTimes<+this.player._opt.loadingTimeoutReplayTimes||-1==+this.player._opt.loadingTimeoutReplayTimes)&&(this._loadingTimeoutReplayTimes+=1,this.player.debug.log("Flv",`delay timeout replay time is ${this._loadingTimeoutReplayTimes}`),this.player.off(D.delayTimeout,this._onDelayTimeout),this.emit(D.loadingRetryTimes,this._loadingTimeoutReplayTimes),this.__play(this._opt).then((()=>{this._loadingTimeoutReplayTimes=0})))}),1e3*(this._opt.loadingTimeoutDelay||3))}_onLoadingTimeout(){this._loadingTimeoutDelayTimer=setTimeout((()=>{this._loadingTimeoutDelayTimer&&(clearTimeout(this._loadingTimeoutDelayTimer),this._loadingTimeoutDelayTimer=null),(this._loadingTimeoutReplayTimes<+this.player._opt.loadingTimeoutReplayTimes||-1==+this.player._opt.loadingTimeoutReplayTimes)&&(this._loadingTimeoutReplayTimes+=1,this.player.debug.log("Flv",`loading timeout replay time is ${this._loadingTimeoutReplayTimes}`),this.player.off(D.delayTimeout,this._onLoadingTimeout),this.emit(D.loadingRetryTimes,this._loadingTimeoutReplayTimes),this.__play(this._opt).then((()=>{this._loadingTimeoutReplayTimes=0})))}),1e3*(this._opt.loadingTimeoutDelay||3))}_onStreamSuccess(){this.emit(D.streamSuccess)}_onStreamError(){this.emit(D.streamError)}resize(e,t){e>0&&t>0&&this.player.updateOption({width:e,height:t}),this.player.resize(),ze.report(50,{name:"resize"})}setBufferTime(e){var t,i;e=Number(e),this.player.updateOption({videoBuffer:1e3*e}),null===(t=this.player)||void 0===t||null===(t=t.decoderWorker)||void 0===t||null===(i=t.updateWorkConfig)||void 0===i||i.call(t,{key:"videoBuffer",value:1e3*e})}setRotate(e){ze.report(50,{name:"setRotate",value:e});try{e=parseInt(e,10)}catch(e){return Promise.reject("rotate 0 | 90 | 180 | 270")}return new Promise(((t,i)=>{wt.ROTATE.includes(e)?(this.player.updateOption({rotate:e}),this.resize(),t()):i("rotate 0 | 90 | 180 | 270")}))}hasLoaded(){return this.player.loaded}setKeepScreenOn(){this.player.updateOption({keepScreenOn:!0}),ze.report(50,{name:"setKeepScreenOn"})}_setFullscreen(e){const t=!!e;this.player.fullscreen!==t&&(this.player.fullscreen=t)}get fullscreening(){return this.player.fullscreen}get videoInfo(){return this._videoInfo}get currentTime(){return this.player.video?this.player.video.currentTime:0}fullScreen(){return this.fullscreen()}fullscreen(){return function(e){var t,i;return!!((null==(i=window)||null==(t=i.navigator)?void 0:t.userAgent)||"").match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)}()||this._setFullscreen(!0),ze.report(50,{name:"fullScreen"}),Promise.resolve()}cancelFullScreen(){return ze.report(50,{name:"cancelFullScreen"}),this.exitFullscreen()}exitFullscreen(){return this._setFullscreen(!1),ze.report(50,{name:"exitFullscreen"}),Promise.resolve()}screenshot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"png",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.92,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"download";if(this.player.video)return i=+i,this.player.video.screenshot(e,t,i,r)}getState(){return{playing:!!this.player&&this.player.playing,mute:!(this.player&&this.player.volume>0),fullscreen:!!this.player&&this.player.fullscreen,webFullscreen:!!this.player&&this.player.webFullscreen,loaded:!!this.player&&this.player.loaded,volume:this.player?parseFloat(this.player.volume).toFixed(2):0,isDebug:!!this.player&&this.player.isDebug}}getOptions(){return this.player?this.player._opt:{}}getVersion(){return ze.report(50,{name:"getVersion"}),"1.0.3-beta.2"}static supportType(e){if("flv"===e.type)return!0;if(e.url){let t=e.url;t.startsWith("http://")||t.startsWith("https://")||(t=/^\/\//.test(t)?"http:"+t:location.origin+location.pathname+t);try{return/\.flv$/i.test(new URL(t).pathname)}catch(e){}}return!1}}return e(wt,"ERROR",P),e(wt,"QUALITY_ENUM",mt),e(wt,"ROTATE",[0,90,180,270]),e(wt,"TIMEOUT",{delayTimeout:D.delayTimeout}),e(wt,"version","1.0.3-beta.2"),wt}));
|
|
30
|
+
*/var Pe,Ue,Fe,Ne,Ve=(Pe="undefined"!=typeof self?self:window,Ue={navigator:void 0!==Pe.navigator?Pe.navigator:{userAgent:""},infoMap:{engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","360","360SE","360EE","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet","iPad"]}},Fe={getMatchMap:function(e){return{Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,Edge:e.indexOf("Edge")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Arora:e.indexOf("Arora")>-1,Lunascape:e.indexOf("Lunascape")>-1,QupZilla:e.indexOf("QupZilla")>-1,"Coc Coc":e.indexOf("coc_coc_browser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,Iceweasel:e.indexOf("Iceweasel")>-1,Konqueror:e.indexOf("Konqueror")>-1,Iceape:e.indexOf("Iceape")>-1,SeaMonkey:e.indexOf("SeaMonkey")>-1,Epiphany:e.indexOf("Epiphany")>-1,360:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1,"360EE":e.indexOf("360EE")>-1,"360SE":e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Nexus 7")>-1,iPad:e.indexOf("iPad")>-1}},matchInfoMap:function(e){var t,i=(null==(t=Ue.navigator)?void 0:t.userAgent)||"",r=Fe.getMatchMap(i);for(var n in Ue.infoMap)for(var o=0;o<Ue.infoMap[n].length;o++){var a=Ue.infoMap[n][o];r[a]&&(e[n]=a)}},getOS:function(){var e=this;return Fe.matchInfoMap(e),null==e?void 0:e.os},getOSVersion:function(){var e=this,t=Ue.navigator.userAgent||"";e.osVersion="";var i={Windows:function(){var e=t.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[e]||e},Android:function(){return t.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return t.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return t.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return t.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return t.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return t.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};return"function"==typeof i[e.os]&&(e.osVersion=i[e.os](),e.osVersion==t&&(e.osVersion="")),e.osVersion},getOrientationStatu:function(){return window.matchMedia("(orientation: portrait)").matches?"vertical":"horizontal"},getDeviceType:function(){var e=this;return e.device="PC",Fe.matchInfoMap(e),e.device},getNetwork:function(){var e,t,i,r;return null==(e=(null==(t=navigator)?void 0:t.connection)||(null==(i=navigator)?void 0:i.mozConnection)||(null==(r=navigator)?void 0:r.webkitConnection))?void 0:e.effectiveType},getLanguage:function(){var e,t,i;return this.language=((i=((null==(e=Ue.navigator)?void 0:e.browserLanguage)||(null==(t=Ue.navigator)?void 0:t.language)).split("-"))[1]&&(i[1]=i[1].toUpperCase()),i.join("_")),this.language},createFingerprint:function(e){var t=document.createElement("canvas"),i=t.getContext("2d"),r=e||window.location.host;i.textBaseline="top",i.font="14px 'Arial'",i.fillStyle="#f60",i.fillRect(125,1,62,20),i.fillStyle="#069",i.fillText(r,2,15),i.fillStyle="rgba(102, 204, 0, 0.7)",i.fillText(r,4,17);var n=t.toDataURL().replace("data:image/png;base64,","");return function(e){var t,i,r,n="";for(t=0,i=(e+="").length;t<i;t++)n+=(r=e.charCodeAt(t).toString(16)).length<2?"0"+r:r;return n}(atob(n).slice(-16,-12))},getBrowserInfo:function(){var e=this;Fe.matchInfoMap(e);var t=Ue.navigator.userAgent||"",i=function(e,t){var i=Ue.navigator.mimeTypes;for(var r in i)if(i[r][e]==t)return!0;return!1},r=Fe.getMatchMap(t),n=!1;if(Pe.chrome){var o=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");+o>36&&Pe.showModalDialog?n=!0:+o>45&&(n=i("type","application/vnd.chromium.remoting-viewer"))}if(r.Baidu&&r.Opera&&(r.Baidu=!1),r.Mobile&&(r.Mobile=!t.includes("iPad")),n&&(i("type","application/gameplugin")||Ue.navigator&&void 0===Ue.navigator.connection.saveData?r["360SE"]=!0:r["360EE"]=!0),r.IE||r.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:case 75:case 105:break;case 102:r["360EE"]=!0;break;case 104:r["360SE"]=!0}var a={Safari:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return t.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return t.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return t.replace(/^.*Edge\/([\d.]+).*$/,"$1")},Firefox:function(){return t.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return t.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return t.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return t.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return t.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return t.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Arora:function(){return t.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return t.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return t.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return t.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return t.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return t.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return t.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return t.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return t.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return t.replace(/^.*QihooBrowser\/([\d.]+).*$/,"$1")},"360SE":function(){return{63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[+t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[+t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return t.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return t.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return t.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return t.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return t.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return t.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},LBBROWSER:function(){return{57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[+navigator.userAgent.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"2345Explorer":function(){return t.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return t.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return t.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return t.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return t.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return t.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},Taobao:function(){return t.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return t.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return t.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return t.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return t.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return t.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};return e.browserVersion="",a[e.browser]&&(e.browserVersion=a[e.browser](),e.browserVersion==t&&(e.browserVersion="")),"Edge"==e.browser&&(e.engine="EdgeHTML"),"Chrome"==e.browser&&parseInt(e.browserVersion)>27&&(e.engine="Blink"),"Opera"==e.browser&&parseInt(e.browserVersion)>12&&(e.engine="Blink"),"Yandex"==e.browser&&(e.engine="Blink"),e.browser+" (version: "+e.browserVersion+"; kernel: "+e.engine+")"}},Ne={DeviceInfoObj:function(e){var t,i=function(t){var i;null==(i=e.info)||i.forEach((function(e){e.toLowerCase()===t.toLowerCase()&&(n[t]=r[t])}))};e=e||{domain:""};var r={deviceType:Fe.getDeviceType(),OS:Fe.getOS(),OSVersion:Fe.getOSVersion(),sh:Pe.screen.height,sw:Pe.screen.width,lang:Fe.getLanguage(),netWork:Fe.getNetwork(),orientation:Fe.getOrientationStatu(),browserInfo:Fe.getBrowserInfo(),fingerprint:Fe.createFingerprint(e.domain),userAgent:null==(t=Ue.navigator)?void 0:t.userAgent};if(!e.info||0===e.info.length)return r;var n={};for(var o in r)i(o);return n}},{getDeviceInfo:function(e){return Ne.DeviceInfoObj(e)}}),Ge=function(){function e(){}return e.add=function(t,i){e.queues.push({url:t,data:i})},e.fire=function(){if(e.queues&&0!==e.queues.length){e.isStop=!1;var t=e.queues[0];t.url&&e.api.report(t.data),e.queues.splice(0,1),e.fire()}else e.isStop=!0},e}();Ge.isStop=!0,Ge.queues=[];var je=function(){function e(e){this.url=e}var t=e.prototype;return t.report=function(e){this.checkUrl(this.url)&&this.sendInfo(e)},t.sendInfo=function(e){navigator.sendBeacon?this.sendBeacon(this.url,e):this.sendImage(this.url,e)},t.sendImage=function(e,t){var i=this.changeJSON2Query(t),r=new Image;r.onload=r.onerror=function(){r=null},r.src=e+"?"+i+"&random="+Math.random()},t.sendBeacon=function(e,t){try{navigator.sendBeacon(e,this.formatParamsByURLSearchParams(t))}catch(e){}},t.formatParamsByURLSearchParams=function(e){var t=new URLSearchParams;for(var i in e)"object"==typeof e[i]&&(e[i]=JSON.stringify(e[i])),t.append(i,e[i]);return t},t.changeJSON2Query=function(e){var t="";for(var i in e){""!=t&&(t+="&");var r=e[i];t+=i+"="+encodeURIComponent("object"==typeof r?JSON.stringify(r):r)}return t},t.checkUrl=function(e){return!!e&&/^[hH][tT][tT][pP]([sS]?):\/\//.test(e)},e}();function $e(){return $e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},$e.apply(this,arguments)}var We=function(){function e(e){this.options=e,this.extendsInfo=e.extendsInfo||{},this.clientInfo=this._getDeviceInfo(),Ge.api=new je(e.url)}var t=e.prototype;return t.send=function(e){return this.options.forbidden||"object"!=typeof e||(this._handleRecordError(e),Ge.isStop&&Ge.fire()),this},t.setForbidden=function(e){this.options.forbidden=e},t.updateExtendsInfo=function(e){void 0===e&&(e={}),this.extendsInfo=$e({},this.extendsInfo||{},e)},t._handleRecordError=function(e){try{var t=this._handleErrorInfo(e);Ge.add(this.options.url,t)}catch(e){}},t._handleErrorInfo=function(e){var t=this._getExtendsInfo(),i=$e({st:(new Date).getTime()},t,e);return i.clientInfo=this.clientInfo,i},t._getExtendsInfo=function(){try{var e,t={},i=this.extendsInfo||{};for(var r in"function"==typeof i.getDynamic&&(e=i.getDynamic()),"[object Object]"===Object.prototype.toString.call(e)&&(i=$e({},i,e)),i)"function"!=typeof i[r]&&(t[r]=i[r]);return t}catch(e){return{}}},t._getDeviceInfo=function(){try{var e=Ve.getDeviceInfo();return JSON.stringify(e)}catch(e){return""}},e}();function Qe(e){if(/http[s]?:\/\/|ws[s]?:\/\//.test(e)){const t=e.split("?")[1],i=t?t.split("&"):[],r={};for(let e=0;e<i.length;++e){const[t,n]=i[e].split("=");r[t]=r[t]||decodeURIComponent(n)}try{const t=e.split(".flv")[0].split("/"),i=t[t.length-1].split("_");t.length>0&&i[0]&&i[1]&&i[2]&&(r.serial=i[0],r.no=i[1],r.bitstream=i[2])}catch(e){}return r}return{}}class ze{static initMonitor(e){ze.collect=new We({forbidden:e,url:"https://log.ys7.com/statistics.do/opensdk_ezuikit",jsError:!1,promiseError:!1,resourceError:!1,extendsInfo:{protocol:"flv",v:"1.0.3-beta.2"}})}static report(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ze.collect||ze.initMonitor();try{const i=Qe(ze.url);ze.collect.send({url:ze.url,serial:i.serial,no:i.no,action:e,logInfo:t})}catch(e){}}}class He extends Me{constructor(e,t){super(e,t,ce),this._opt.useMSE=!1,this._loadingTimeoutDelayTimer=null,this._opt.hasAudio&&(this.audio=new he(this)),this.decoderWorker=new fe(this),this.stream=null,this.demux=null,this._lastVolume=null,J()&&(this.keepScreenOn=new Se(this)),this._opt.hasAudio&&this._opt.volume>0&&!this._opt.isMute&&(this.volume=this._opt.volume)}destroy(){this._loading=!1,this._playing=!1,this._hasLoaded=!1,this._lastVolume=null,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this.decoderWorker&&(this.decoderWorker.destroy(),this.decoderWorker=null),this.video&&(this.video.destroy(),this.video=null),this.audio&&(this.audio.destroy(),this.audio=null),this.stream&&(this.stream.destroy(),this.stream=null),this.demux&&(this.demux.destroy(),this.demux=null),this.events&&(this.events.destroy(),this.events=null),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.clearStatsInterval(),this.releaseWakeLock(),this.keepScreenOn=null,this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,this.emit("destroy"),this.off(),this.debug.log("play","destroy end")}set loaded(e){this._hasLoaded=e}get loaded(){return this._hasLoaded}set playing(e){e&&(this.loading=!1),this.playing!==e&&(this._playing=e,this.emit(D.playing,e),this.emit(D.volumechange,this.volume),e?this.emit(D.play):this.emit(D.pause))}get playing(){return this._playing}get volume(){var e;return+((null===(e=this.audio)||void 0===e?void 0:e.volume)||0).toFixed(2)||0}set volume(e){var t;e!==this.volume&&(null===(t=this.audio)||void 0===t||t.setVolume(e),this._lastVolume=e)}get lastVolume(){return this._lastVolume}set loading(e){this.loading!==e&&(this._loading=e,this.emit(D.loading,this._loading),e||this.emit(D.loaded))}get loading(){return this._loading}set audioTimestamp(e){null!==e&&(this._audioTimestamp=e)}get audioTimestamp(){return this._audioTimestamp}set videoTimestamp(e){null!==e&&(this._videoTimestamp=e,this._opt.useWCS||this._opt.useMSE||this.audioTimestamp&&this.videoTimestamp&&this.audio&&this.audio.emit(D.videoSyncAudio,{audioTimestamp:this.audioTimestamp,videoTimestamp:this.videoTimestamp,diff:this.audioTimestamp-this.videoTimestamp}))}get videoTimestamp(){return this._videoTimestamp}get isDebug(){return!0===this._opt.debug}_init(){return new Promise(((e,t)=>{this.stream||(this.stream=new pe(this)),this.audio||this._opt.hasAudio&&(this.audio=new he(this)),this.demux||(this.demux=new ge(this)),this.decoderWorker?e():(this.decoderWorker=new fe(this),this.once(D.decoderWorkerInit,(()=>{e()})))}))}play(e){return this._opt=Object.assign({},this._opt,e||{}),this.clearCheckHeartTimeout(),new Promise(((e,t)=>{if(!this._opt.url)return t();this.loading=!0,this.playing=!1,this._times.playInitStart=X(),this._init().then((()=>{this._times.playStart=X(),this._opt.isMute||this.mute(!1),this.enableWakeLock();try{this.stream.fetchStream(this._opt.url,this._opt)}catch(e){}this.checkLoadingTimeout(),this.stream.once(D.streamError,(e=>{this.stream&&(this.stream.destroy(),this.stream=null),this.clearCheckLoadingTimeout(),this.emit(D.streamError,e),this.emit(D.delayTimeout),t(e)})),this.stream.once(D.streamEnd,(()=>{t()})),this.stream.once(D.streamSuccess,(()=>{this.clearCheckLoadingTimeout(),this.emit(D.streamSuccess),e(),this._times.streamResponse=X(),this.video.play(),this.checkStatsInterval()}))})).catch((e=>{t(e)})),this._resumeAudioAfterPause()}))}close(){return new Promise((e=>{this._close().then((()=>{var t,i;null===(t=this.video)||void 0===t||null===(i=t.clearView)||void 0===i||i.call(t),e()}))}))}_resumeAudioAfterPause(){this.lastVolume&&(this.volume=this.lastVolume)}_close(){return new Promise((e=>{this._loadingTimeoutDelayTimer&&(clearTimeout(this._loadingTimeoutDelayTimer),this._loadingTimeoutDelayTimer=null),this.stream&&(this.stream.destroy(),this.stream=null),this.demux&&(this.demux.destroy(),this.demux=null),this.decoderWorker&&(this.decoderWorker.destroy(),this.decoderWorker=null),this.audio&&(this.audio.destroy(),this.audio=null),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.clearStatsInterval(),this.playing=!1,this.loading=!1,this.video&&(this.video.resetInit(),this.video.pause(!0)),this.releaseWakeLock(),this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},setTimeout((()=>{e()}),0)}))}pause(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.close():this._close()}mute(e){var t;null===(t=this.audio)||void 0===t||t.mute(e)}_onlyMseOrWcsVideo(){return!1===this._opt.hasAudio&&(this._opt.useMSE||this._opt.useWCS&&!this._opt.useOffscreen)}checkHeart(){this.clearCheckHeartTimeout(),this.checkHeartTimeout()}checkHeartTimeout(){}checkStatsInterval(){this._checkStatsInterval=setInterval((()=>{this.updateStats()}),1e3)}clearCheckHeartTimeout(){this._checkHeartTimeout&&(clearTimeout(this._checkHeartTimeout),this._checkHeartTimeout=null)}checkLoadingTimeout(){this._checkLoadingTimeout=setTimeout((()=>{this.playing||(this.clearCheckLoadingTimeout(),this.pause().then((()=>{this.emit(D.timeout,D.loadingTimeout),this.emit(D.loadingTimeout)})).catch((()=>{})))}),1e3*this._opt.loadingTimeout)}clearCheckLoadingTimeout(){this._checkLoadingTimeout&&(clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}clearStatsInterval(){this._checkStatsInterval&&(clearInterval(this._checkStatsInterval),this._checkStatsInterval=null)}handleRender(){this.loading&&(this.emit(D.start),this.loading=!1),this.clearCheckLoadingTimeout(),this.playing||(this.playing=!0),this.checkHeart()}updateStats(e){e=e||{},this._startBpsTime||(this._startBpsTime=X()),ee(e.ts)&&(this._stats.ts=e.ts),ee(e.buf)&&(this._stats.buf=e.buf),e.fps&&(this._stats.fps+=1),e.abps&&(this._stats.abps+=e.abps),e.vbps&&(this._stats.vbps+=e.vbps);const t=X();t-this._startBpsTime<1e3||(this.emit(D.stats,this._stats),this._stats.fps=0,this._stats.abps=0,this._stats.vbps=0,this._startBpsTime=t)}resetStats(){this._startBpsTime=null,this._stats={buf:0,fps:0,abps:0,vbps:0,ts:0}}enableWakeLock(){this._opt.keepScreenOn&&this.keepScreenOn&&this.keepScreenOn.enable()}releaseWakeLock(){this._opt.keepScreenOn&&this.keepScreenOn&&this.keepScreenOn.disable()}handlePlayToRenderTimes(){const e=this._times;e.playTimestamp=e.playStart-e.playInitStart,e.streamTimestamp=e.streamStart-e.playStart,e.streamResponseTimestamp=e.streamResponse-e.streamStart,e.demuxTimestamp=e.demuxStart-e.streamResponse,e.decodeTimestamp=e.decodeStart-e.demuxStart,e.videoTimestamp=e.videoStart-e.decodeStart,e.allTimestamp=e.videoStart-e.playInitStart,this.emit(D.playToRenderTimes,e)}getOption(){return this._opt}emitError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";ze.report(51,{event:e,value:t}),this.emit(D.error,e,t),this.emit(e,t)}}var qe,Ye={exports:{}};var Xe=(qe||(qe=1,function(e,t){!function(t,i){e.exports=i()}(self,(()=>(()=>{var e={62:(e,t,i)=>{var r=i(1465)("span").classList,n=r&&r.constructor&&r.constructor.prototype;e.exports=n===Object.prototype?void 0:n},63:(e,t,i)=>{var r=i(4152);e.exports=function(e){return r(e)||null===e}},115:(e,t,i)=>{var r=i(815),n=i(4152),o=i(5727),a=i(452),s=i(6908),l=i(7553),d=TypeError,c=l("toPrimitive");e.exports=function(e,t){if(!n(e)||o(e))return e;var i,l=a(e,c);if(l){if(void 0===t&&(t="default"),i=r(l,e,t),!n(i)||o(i))return i;throw new d("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},219:(e,t,i)=>{var r=i(2719),n=i(7024),o=i(256),a=function(e){return function(t,i,a){var s=r(t),l=o(s);if(0===l)return!e&&-1;var d,c=n(a,l);if(e&&i!=i){for(;l>c;)if((d=s[c++])!=d)return!0}else for(;l>c;c++)if((e||c in s)&&s[c]===i)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},256:(e,t,i)=>{var r=i(2420);e.exports=function(e){return r(e.length)}},279:(e,t,i)=>{var r=i(815),n=i(5736),o=i(7749),a=i(4985),s=i(9273),l=TypeError;e.exports=function(e,t){var i=arguments.length<2?s(e):t;if(n(i))return o(r(i,e));throw new l(a(e)+" is not iterable")}},309:(e,t,i)=>{var r=i(9922),n=i(497);e.exports=r?{}.toString:function(){return"[object "+n(this)+"]"}},452:(e,t,i)=>{var r=i(5736),n=i(5599);e.exports=function(e,t){var i=e[t];return n(i)?void 0:r(i)}},458:(e,t,i)=>{var r=i(526),n=i(6458);e.exports=function(e){if("Function"===r(e))return n(e)}},497:(e,t,i)=>{var r=i(9922),n=i(9211),o=i(526),a=i(7553)("toStringTag"),s=Object,l="Arguments"===o(function(){return arguments}());e.exports=r?o:function(e){var t,i,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?i:l?o(t):"Object"===(r=o(t))&&n(t.callee)?"Arguments":r}},526:(e,t,i)=>{var r=i(6458),n=r({}.toString),o=r("".slice);e.exports=function(e){return o(n(e),8,-1)}},550:(e,t,i)=>{i.d(t,{A:()=>r});const r={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},577:(e,t,i)=>{var r=i(3463),n=i(1002),o=r("keys");e.exports=function(e){return o[e]||(o[e]=n(e))}},594:e=>{var t=TypeError;e.exports=function(e,i){if(e<i)throw new t("Not enough arguments");return e}},605:(e,t,i)=>{var r=i(7553);t.f=r},648:(e,t,i)=>{i(2578),i(4579);var r=i(9364),n=i(1562),o=i(2363),a=i(5057),s=i(815),l=i(6458),d=i(9646),c=i(6666),u=i(3930),h=i(1176),A=i(8873),p=i(1541),f=i(7712),_=i(3587),m=i(2757),v=i(9211),g=i(4347),y=i(7042),b=i(497),S=i(7749),E=i(4152),w=i(6677),T=i(6122),k=i(6330),R=i(279),O=i(9273),C=i(1567),B=i(594),x=i(7553),I=i(986),L=x("iterator"),D="URLSearchParams",M=D+"Iterator",P=_.set,U=_.getterFor(D),F=_.getterFor(M),N=o("fetch"),V=o("Request"),G=o("Headers"),j=V&&V.prototype,$=G&&G.prototype,W=n.TypeError,Q=n.encodeURIComponent,z=String.fromCharCode,H=a("String","fromCodePoint"),q=parseInt,Y=l("".charAt),X=l([].join),Z=l([].push),K=l("".replace),J=l([].shift),ee=l([].splice),te=l("".split),ie=l("".slice),re=l(/./.exec),ne=/\+/g,oe=/^[0-9a-f]+$/i,ae=function(e,t){var i=ie(e,t,t+2);return re(oe,i)?q(i,16):NaN},se=function(e){for(var t=0,i=128;i>0&&e&i;i>>=1)t++;return t},le=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},de=function(e){for(var t=(e=K(e,ne," ")).length,i="",r=0;r<t;){var n=Y(e,r);if("%"===n){if("%"===Y(e,r+1)||r+3>t){i+="%",r++;continue}var o=ae(e,r+1);if(o!=o){i+=n,r++;continue}r+=2;var a=se(o);if(0===a)n=z(o);else{if(1===a||a>4){i+="�",r++;continue}for(var s=[o],l=1;l<a&&!(3+ ++r>t||"%"!==Y(e,r));){var d=ae(e,r+1);if(d!=d){r+=3;break}if(d>191||d<128)break;Z(s,d),r+=2,l++}if(s.length!==a){i+="�";continue}var c=le(s);null===c?i+="�":n=H(c)}}i+=n,r++}return i},ce=/[!'()~]|%20/g,ue={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},he=function(e){return ue[e]},Ae=function(e){return K(Q(e),ce,he)},pe=f((function(e,t){P(this,{type:M,target:U(e).entries,index:0,kind:t})}),D,(function(){var e=F(this),t=e.target,i=e.index++;if(!t||i>=t.length)return e.target=null,C(void 0,!0);var r=t[i];switch(e.kind){case"keys":return C(r.key,!1);case"values":return C(r.value,!1)}return C([r.key,r.value],!1)}),!0),fe=function(e){this.entries=[],this.url=null,void 0!==e&&(E(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Y(e,0)?ie(e,1):e:w(e)))};fe.prototype={type:D,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,i,r,n,o,a,l,d=this.entries,c=O(e);if(c)for(i=(t=R(e,c)).next;!(r=s(i,t)).done;){if(o=(n=R(S(r.value))).next,(a=s(o,n)).done||(l=s(o,n)).done||!s(o,n).done)throw new W("Expected sequence with length 2");Z(d,{key:w(a.value),value:w(l.value)})}else for(var u in e)g(e,u)&&Z(d,{key:u,value:w(e[u])})},parseQuery:function(e){if(e)for(var t,i,r=this.entries,n=te(e,"&"),o=0;o<n.length;)(t=n[o++]).length&&(i=te(t,"="),Z(r,{key:de(J(i)),value:de(X(i,"="))}))},serialize:function(){for(var e,t=this.entries,i=[],r=0;r<t.length;)e=t[r++],Z(i,Ae(e.key)+"="+Ae(e.value));return X(i,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var _e=function(){m(this,me);var e=P(this,new fe(arguments.length>0?arguments[0]:void 0));d||(this.size=e.entries.length)},me=_e.prototype;if(A(me,{append:function(e,t){var i=U(this);B(arguments.length,2),Z(i.entries,{key:w(e),value:w(t)}),d||this.length++,i.updateURL()},delete:function(e){for(var t=U(this),i=B(arguments.length,1),r=t.entries,n=w(e),o=i<2?void 0:arguments[1],a=void 0===o?o:w(o),s=0;s<r.length;){var l=r[s];if(l.key!==n||void 0!==a&&l.value!==a)s++;else if(ee(r,s,1),void 0!==a)break}d||(this.size=r.length),t.updateURL()},get:function(e){var t=U(this).entries;B(arguments.length,1);for(var i=w(e),r=0;r<t.length;r++)if(t[r].key===i)return t[r].value;return null},getAll:function(e){var t=U(this).entries;B(arguments.length,1);for(var i=w(e),r=[],n=0;n<t.length;n++)t[n].key===i&&Z(r,t[n].value);return r},has:function(e){for(var t=U(this).entries,i=B(arguments.length,1),r=w(e),n=i<2?void 0:arguments[1],o=void 0===n?n:w(n),a=0;a<t.length;){var s=t[a++];if(s.key===r&&(void 0===o||s.value===o))return!0}return!1},set:function(e,t){var i=U(this);B(arguments.length,1);for(var r,n=i.entries,o=!1,a=w(e),s=w(t),l=0;l<n.length;l++)(r=n[l]).key===a&&(o?ee(n,l--,1):(o=!0,r.value=s));o||Z(n,{key:a,value:s}),d||(this.size=n.length),i.updateURL()},sort:function(){var e=U(this);I(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,i=U(this).entries,r=y(e,arguments.length>1?arguments[1]:void 0),n=0;n<i.length;)r((t=i[n++]).value,t.key,this)},keys:function(){return new pe(this,"keys")},values:function(){return new pe(this,"values")},entries:function(){return new pe(this,"entries")}},{enumerable:!0}),u(me,L,me.entries,{name:"entries"}),u(me,"toString",(function(){return U(this).serialize()}),{enumerable:!0}),d&&h(me,"size",{get:function(){return U(this).entries.length},configurable:!0,enumerable:!0}),p(_e,D),r({global:!0,constructor:!0,forced:!c},{URLSearchParams:_e}),!c&&v(G)){var ve=l($.has),ge=l($.set),ye=function(e){if(E(e)){var t,i=e.body;if(b(i)===D)return t=e.headers?new G(e.headers):new G,ve(t,"content-type")||ge(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),T(e,{body:k(0,w(i)),headers:k(0,t)})}return e};if(v(N)&&r({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return N(e,arguments.length>1?ye(arguments[1]):{})}}),v(V)){var be=function(e){return m(this,j),new V(e,arguments.length>1?ye(arguments[1]):{})};j.constructor=be,be.prototype=j,r({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:be})}}e.exports={URLSearchParams:_e,getState:U}},719:(e,t,i)=>{i.d(t,{A:()=>r});const r=function(){function e(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return e.prototype.isComplete=function(){return!this.hasAudio||this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&this.audioChannelCount,!this.hasVideo||this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&this.sarDen,null!=this.mimeType},e.prototype.isSeekable=function(){return this.hasKeyframesIndex},e.prototype.getNearestKeyframe=function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,i=this._search(t.times,e);return{index:i,milliseconds:t.times[i],fileposition:t.filepositions[i]}},e.prototype._search=function(e,t){var i=0,r=e.length-1,n=0,o=0,a=r;for(t<e[0]&&(i=0,o=a+1);o<=a;){if((n=o+Math.floor((a-o)/2))===r||t>=e[n]&&t<e[n+1]){i=n;break}e[n]<t?o=n+1:a=n-1}return i},e}()},730:(e,t,i)=>{var r=i(9364),n=i(815);r({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return n(URL.prototype.toString,this)}})},775:(e,t,i)=>{var r=i(9845),n=i(1562),o=i(4191),a="__core-js_shared__",s=e.exports=n[a]||o(a,{});(s.versions||(s.versions=[])).push({version:"3.40.0",mode:r?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.40.0/LICENSE",source:"https://github.com/zloirock/core-js"})},778:(e,t,i)=>{i(4220)},804:(e,t,i)=>{var r=i(9364),n=i(5057),o=i(4347),a=i(6677),s=i(3463),l=i(9266),d=s("string-to-symbol-registry"),c=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=a(e);if(o(d,t))return d[t];var i=n("Symbol")(t);return d[t]=i,c[i]=t,i}})},815:(e,t,i)=>{var r=i(6898),n=Function.prototype.call;e.exports=r?n.bind(n):function(){return n.apply(n,arguments)}},834:(e,t,i)=>{i(6383)},947:(e,t,i)=>{var r=i(9364),n=i(7917),o=i(2809),a=i(7819),s=i(9083);r({target:"Object",stat:!0,forced:!n||o((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(s(e)):[]}})},986:(e,t,i)=>{var r=i(8626),n=Math.floor,o=function(e,t){var i=e.length;if(i<8)for(var a,s,l=1;l<i;){for(s=l,a=e[l];s&&t(e[s-1],a)>0;)e[s]=e[--s];s!==l++&&(e[s]=a)}else for(var d=n(i/2),c=o(r(e,0,d),t),u=o(r(e,d),t),h=c.length,A=u.length,p=0,f=0;p<h||f<A;)e[p+f]=p<h&&f<A?t(c[p],u[f])<=0?c[p++]:u[f++]:p<h?c[p++]:u[f++];return e};e.exports=o},1002:(e,t,i)=>{var r=i(6458),n=0,o=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++n+o,36)}},1031:(e,t,i)=>{var r=i(7553),n=i(6122),o=i(3643).f,a=r("unscopables"),s=Array.prototype;void 0===s[a]&&o(s,a,{configurable:!0,value:n(null)}),e.exports=function(e){s[a][e]=!0}},1068:(e,t,i)=>{var r=i(63),n=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw new o("Can't set "+n(e)+" as a prototype")}},1144:(e,t,i)=>{var r=i(815),n=i(4347),o=i(9615),a=i(7677),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||n(e,"flags")||!o(s,e)?t:r(a,e)}},1147:(e,t,i)=>{var r,n,o,a=i(2809),s=i(9211),l=i(4152),d=i(6122),c=i(8125),u=i(3930),h=i(7553),A=i(9845),p=h("iterator"),f=!1;[].keys&&("next"in(o=[].keys())?(n=c(c(o)))!==Object.prototype&&(r=n):f=!0),!l(r)||a((function(){var e={};return r[p].call(e)!==e}))?r={}:A&&(r=d(r)),s(r[p])||u(r,p,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:f}},1176:(e,t,i)=>{var r=i(4233),n=i(3643);e.exports=function(e,t,i){return i.get&&r(i.get,t,{getter:!0}),i.set&&r(i.set,t,{setter:!0}),n.f(e,t,i)}},1209:(e,t,i)=>{var r=i(5057),n=i(6458),o=i(2630),a=i(7819),s=i(7749),l=n([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(s(e)),i=a.f;return i?l(t,i(e)):t}},1432:(e,t,i)=>{var r=i(6458),n=i(5736);e.exports=function(e,t,i){try{return r(n(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(e){}}},1454:(e,t,i)=>{i(648)},1464:(e,t,i)=>{var r=i(9364),n=i(4979).map;r({target:"Array",proto:!0,forced:!i(8611)("map")},{map:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}})},1465:(e,t,i)=>{var r=i(1562),n=i(4152),o=r.document,a=n(o)&&n(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},1541:(e,t,i)=>{var r=i(3643).f,n=i(4347),o=i(7553)("toStringTag");e.exports=function(e,t,i){e&&!i&&(e=e.prototype),e&&!n(e,o)&&r(e,o,{configurable:!0,value:t})}},1562:function(e){var t=function(e){return e&&e.Math===Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof r&&r)||t("object"==typeof this&&this)||function(){return this}()||Function("return this")()},1567:e=>{e.exports=function(e,t){return{value:e,done:t}}},1684:(e,t,i)=>{var r=i(5736),n=i(9083),o=i(5273),a=i(256),s=TypeError,l="Reduce of empty array with no initial value",d=function(e){return function(t,i,d,c){var u=n(t),h=o(u),A=a(u);if(r(i),0===A&&d<2)throw new s(l);var p=e?A-1:0,f=e?-1:1;if(d<2)for(;;){if(p in h){c=h[p],p+=f;break}if(p+=f,e?p<0:A<=p)throw new s(l)}for(;e?p>=0:A>p;p+=f)p in h&&(c=i(c,h[p],p,u));return c}};e.exports={left:d(!1),right:d(!0)}},1766:(e,t,i)=>{var r=i(9364),n=i(4347),o=i(5727),a=i(4985),s=i(3463),l=i(9266),d=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!l},{keyFor:function(e){if(!o(e))throw new TypeError(a(e)+" is not a symbol");if(n(d,e))return d[e]}})},1900:(e,t,i)=>{e.exports=i(2632).default},1951:(e,t,i)=>{i.d(t,{$_:()=>r,EX:()=>o,EZ:()=>n,Sc:()=>a});var r=function(e,t,i,r,n){this.dts=e,this.pts=t,this.duration=i,this.originalDts=r,this.isSyncPoint=n,this.fileposition=null},n=function(){function e(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return e.prototype.appendSyncPoint=function(e){e.isSyncPoint=!0,this.syncPoints.push(e)},e}(),o=function(){function e(){this._list=[]}return e.prototype.clear=function(){this._list=[]},e.prototype.appendArray=function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))},e.prototype.getLastSyncPointBeforeDts=function(e){if(0===this._list.length)return null;var t=this._list,i=0,r=t.length-1,n=0,o=0,a=r;for(e<t[0].dts&&(i=0,o=a+1);o<=a;){if((n=o+Math.floor((a-o)/2))===r||e>=t[n].dts&&e<t[n+1].dts){i=n;break}t[n].dts<e?o=n+1:a=n-1}return this._list[i]},e}(),a=function(){function e(e){this._type=e,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),e.prototype.isEmpty=function(){return 0===this._list.length},e.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},e.prototype._searchNearestSegmentBefore=function(e){var t,i=this._list;if(0===i.length)return-2;var r=i.length-1,n=0,o=0,a=r,s=0;if(e<i[0].originalBeginDts)return-1;for(;o<=a;){if((n=o+Math.floor((a-o)/2))===r||e>((null===(t=i[n].lastSample)||void 0===t?void 0:t.originalDts)||0)&&e<i[n+1].originalBeginDts){s=n;break}i[n].originalBeginDts<e?o=n+1:a=n-1}return s},e.prototype._searchNearestSegmentAfter=function(e){return this._searchNearestSegmentBefore(e)+1},e.prototype.append=function(e){var t,i,r=this._list,n=e,o=this._lastAppendLocation,a=0;-1!==o&&o<r.length&&n.originalBeginDts>=((null===(i=null===(t=r[o])||void 0===t?void 0:t.lastSample)||void 0===i?void 0:i.originalDts)||0)&&(o===r.length-1||o<r.length-1&&n.originalBeginDts<r[o+1].originalBeginDts)?a=o+1:r.length>0&&(a=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=a,this._list.splice(a,0,n)},e.prototype.getLastSegmentBefore=function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null},e.prototype.getLastSampleBefore=function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null},e.prototype.getLastSyncPointBefore=function(e){for(var t=this._searchNearestSegmentBefore(e),i=this._list[t].syncPoints;0===i.length&&t>0;)t--,i=this._list[t].syncPoints;return i.length>0?i[i.length-1]:null},e}()},2139:(e,t,i)=>{i.d(t,{A:()=>r});const r=i(5307)},2250:(e,t,i)=>{var r=i(6458),n=i(3930),o=Date.prototype,a="Invalid Date",s="toString",l=r(o[s]),d=r(o.getTime);String(new Date(NaN))!==a&&n(o,s,(function(){var e=d(this);return e==e?l(this):a}))},2327:e=>{e.exports={}},2363:(e,t,i)=>{var r=i(1562),n=i(9646),o=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!n)return r[e];var t=o(r,e);return t&&t.value}},2377:(e,t,i)=>{var r=i(4979).forEach,n=i(5888)("forEach");e.exports=n?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},2382:(e,t,i)=>{var r=i(9364),n=i(815),o=i(9845),a=i(6656),s=i(9211),l=i(7712),d=i(8125),c=i(6641),u=i(1541),h=i(9277),A=i(3930),p=i(7553),f=i(2327),_=i(1147),m=a.PROPER,v=a.CONFIGURABLE,g=_.IteratorPrototype,y=_.BUGGY_SAFARI_ITERATORS,b=p("iterator"),S="keys",E="values",w="entries",T=function(){return this};e.exports=function(e,t,i,a,p,_,k){l(i,t,a);var R,O,C,B=function(e){if(e===p&&M)return M;if(!y&&e&&e in L)return L[e];switch(e){case S:case E:case w:return function(){return new i(this,e)}}return function(){return new i(this)}},x=t+" Iterator",I=!1,L=e.prototype,D=L[b]||L["@@iterator"]||p&&L[p],M=!y&&D||B(p),P="Array"===t&&L.entries||D;if(P&&(R=d(P.call(new e)))!==Object.prototype&&R.next&&(o||d(R)===g||(c?c(R,g):s(R[b])||A(R,b,T)),u(R,x,!0,!0),o&&(f[x]=T)),m&&p===E&&D&&D.name!==E&&(!o&&v?h(L,"name",E):(I=!0,M=function(){return n(D,this)})),p)if(O={values:B(E),keys:_?M:B(S),entries:B(w)},k)for(C in O)(y||I||!(C in L))&&A(L,C,O[C]);else r({target:t,proto:!0,forced:y||I},O);return o&&!k||L[b]===M||A(L,b,M,{name:p}),f[t]=M,O}},2420:(e,t,i)=>{var r=i(4685),n=Math.min;e.exports=function(e){var t=r(e);return t>0?n(t,9007199254740991):0}},2460:(e,t,i)=>{i.d(t,{A:()=>n});var r=i(2139);const n=function(){function e(){}return e.e=function(t,i){var r;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(r=e.emitter)||void 0===r||r.emit("log","error",n)),e.ENABLE_ERROR&&(console.error?console.error(n):console.warn?console.warn(n):console.log(n))},e.i=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&e.emitter.emit("log","info",r),e.ENABLE_INFO&&(console.info?console.info(r):console.log(r))},e.w=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",r),e.ENABLE_WARN&&(console.warn?console.warn(r):console.log(r))},e.d=function(t,i){var r;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(r=e.emitter)||void 0===r||r.emit("log","debug",n)),e.ENABLE_DEBUG&&(console.debug?console.debug(n):console.log(n))},e.v=function(t,i){var r;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(r=e.emitter)||void 0===r||r.emit("log","verbose",n)),e.ENABLE_VERBOSE&&console.log(n)},e.FORCE_GLOBAL_TAG=!1,e.GLOBAL_TAG="ezuikit-flv",e.ENABLE_CALLBACK=!1,e.emitter=new r.A,e.ENABLE_ERROR=!0,e.ENABLE_INFO=!0,e.ENABLE_WARN=!0,e.ENABLE_DEBUG=!0,e.ENABLE_VERBOSE=!0,e}()},2578:(e,t,i)=>{var r=i(2719),n=i(1031),o=i(2327),a=i(3587),s=i(3643).f,l=i(2382),d=i(1567),c=i(9845),u=i(9646),h="Array Iterator",A=a.set,p=a.getterFor(h);e.exports=l(Array,"Array",(function(e,t){A(this,{type:h,target:r(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,i=e.index++;if(!t||i>=t.length)return e.target=null,d(void 0,!0);switch(e.kind){case"keys":return d(i,!1);case"values":return d(t[i],!1)}return d([i,t[i]],!1)}),"values");var f=o.Arguments=o.Array;if(n("keys"),n("values"),n("entries"),!c&&u&&"values"!==f.name)try{s(f,"name",{value:"values"})}catch(e){}},2630:(e,t,i)=>{var r=i(3430),n=i(6853).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,n)}},2632:(e,t,i)=>{i.d(t,{default:()=>N});var r={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32},n=i(8098),o={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,liveBufferLatencyChasing:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0,url:void 0,redirectedURL:void 0,cors:!1};function a(){return Object.assign({},o)}var s=function(){function e(){}return e.supportMSEH264Playback=function(){var e;return null===(e=window.MediaSource)||void 0===e?void 0:e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},e.supportMSEH265Playback=function(){var e;return null===(e=window.MediaSource)||void 0===e?void 0:e.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')},e.supportNetworkStreamIO=function(){var e=new n.A({},a()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"===t||"xhr-moz-chunked-loader"===t},e.getNetworkLoaderTypeName=function(){var e=new n.A({},a()),t=e.loaderType;return e.destroy(),t},e.supportNativeMediaPlayback=function(t){void 0===e.videoElement&&(e.videoElement=window.document.createElement("video"));var i=e.videoElement.canPlayType(t);return"probably"===i||"maybe"===i},e.getFeatureList=function(){var t={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.msePlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName()||"",t.mseLivePlayback=t.msePlayback&&t.networkStreamIO,t.mseH265Playback=e.supportMSEH265Playback(),t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeMP4H265Playback=e.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t},e}();const l=s;var d=i(9034),c=i(2139),u=i(2460),h=i(8870);const A={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",DESTROYING:"destroying"};i(6041),i(8845),i(6815),i(9688),i(5758),i(5347),i(2578),i(5336),i(1464),i(4742),i(2250),i(6033),i(3813),i(4659),i(3074),i(9917),i(3478),i(5597),i(6263),i(6810),i(6728),i(7958),i(834),i(8862),i(4879),i(778),i(730),i(1454);var p=function(){var e=ENTRY_MODULE,t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={exports:{}};return e[r](n,n.exports,i),n.exports}i.m=e,i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.g=function(){if("[object Object]"===Object.prototype.toString.call(globalThis))return globalThis;try{return this||new Function("return this")()}catch(e){if("[object Object]"===Object.prototype.toString.call(window))return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r=i(ENTRY_MODULE);return r.default||r},f="[\\.|\\-|\\+|\\w|/|@]+",_="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+f+").*?\\)";function m(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function v(e,t,r){var n={};n[r]=[];var o,a=t.toString(),s=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||a.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!s)return n;for(var l,d=s[1],c=new RegExp("(\\\\n|\\W)"+m(d)+_,"g");l=c.exec(a);)"dll-reference"!==l[3]&&n[r].push(l[3]);for(c=new RegExp("\\("+m(d)+'\\("(dll-reference\\s('+f+'))"\\)\\)'+_,"g");l=c.exec(a);)e[l[2]]||(n[r].push(l[1]),e[l[2]]=i(l[1]).m),n[l[2]]=n[l[2]]||[],n[l[2]].push(l[4]);for(var u=Object.keys(n),h=0;h<u.length;h++)for(var A=0;A<n[u[h]].length;A++)o=n[u[h]][A],!isNaN(1*o)&&(n[u[h]][A]=1*n[u[h]][A]);return n}function g(e){return Object.keys(e).reduce((function(t,i){return t||e[i].length>0}),!1)}function y(e,t,i,r){var n=e[r].map((function(e){return'"'.concat(e,'": ').concat(t[r][e].toString())})).join(","),o=p.toString().split("ENTRY_MODULE");return"".concat(o[0],"{").concat(n,"}").concat(o[1],'"').concat(i,'"').concat(o[2])}var b=i(8635),S=i(9953),E=i(550),w=i(719);const T=function(){function e(e,t){if(this.TAG="Transmuxer",this._workerDestroying=!1,this._controller=null,this._emitter=new c.A,t.enableWorker&&"undefined"!=typeof Worker)try{this._worker=this._worker=function(e,t){t=t||{};var r={main:i.m},n=t.all?{main:Object.keys(r.main)}:function(e,t){for(var i={main:[7477]},r={main:[]},n={main:{}};g(i);)for(var o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],l=i[s].pop();if(n[s]=n[s]||{},!n[s][l]&&e[s][l]){n[s][l]=!0,r[s]=r[s]||[],r[s].push(l);for(var d=v(e,e[s][l],s),c=Object.keys(d),u=0;u<c.length;u++)i[c[u]]=i[c[u]]||[],i[c[u]]=i[c[u]].concat(d[c[u]])}}return r}(r),o="";Object.keys(n).filter((function(e){return"main"!==e})).forEach((function(e){for(var t=0;n[e][t];)t++;n[e].push(t),r[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o+="var ".concat(e," = (").concat(y(n,r,t,modules),")();\n")})),o+="(".concat(y(n,r,7477,"main"),")();");var a=new window.Blob([o],{type:"text/javascript"});if(t.bare)return a;var s=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(a),l=new window.Worker(s);return l.objectURL=s,l}(),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},b.A.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:b.A.getConfig()})}catch(i){u.A.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new S.A(e,t)}else this._controller=new S.A(e,t);if(this._controller){var r=this._controller;null==r||r.on(E.A.IO_ERROR,this._onIOError.bind(this)),null==r||r.on(E.A.DEMUX_ERROR,this._onDemuxError.bind(this)),null==r||r.on(E.A.INIT_SEGMENT,this._onInitSegment.bind(this)),null==r||r.on(E.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),null==r||r.on(E.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),null==r||r.on(E.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),null==r||r.on(E.A.MEDIA_INFO,this._onMediaInfo.bind(this)),null==r||r.on(E.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),null==r||r.on(E.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),null==r||r.on(E.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),null==r||r.on(E.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),null==r||r.on(E.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),null==r||r.on(E.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),null==r||r.on(E.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),null==r||r.on(E.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),null==r||r.on(E.A.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){var e;this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"transmuxing-worker destroy"}),b.A.removeListener(this.e.onLoggingConfigChanged),this.e=null):(null===(e=this._controller)||void 0===e||e.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.hasWorker=function(){return null!=this._worker},e.prototype.open=function(){var e;this._worker?this._worker.postMessage({cmd:"start"}):null===(e=this._controller)||void 0===e||e.start()},e.prototype.close=function(){var e;this._worker?this._worker.postMessage({cmd:"stop"}):null===(e=this._controller)||void 0===e||e.stop()},e.prototype.seek=function(e){var t;this._worker?this._worker.postMessage({cmd:"seek",param:e}):null===(t=this._controller)||void 0===t||t.seek(e)},e.prototype.pause=function(){var e;this._worker?this._worker.postMessage({cmd:"pause"}):null===(e=this._controller)||void 0===e||e.pause()},e.prototype.resume=function(){var e;this._worker?this._worker.postMessage({cmd:"resume"}):null===(e=this._controller)||void 0===e||e.resume()},e.prototype._onInitSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(E.A.INIT_SEGMENT,e,t)}))},e.prototype._onMediaSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(E.A.MEDIA_SEGMENT,e,t)}))},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(E.A.LOADING_COMPLETE)}))},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(E.A.RECOVERED_EARLY_EOF)}))},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.MEDIA_INFO,e)}))},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.METADATA_ARRIVED,e)}))},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.SCRIPTDATA_ARRIVED,e)}))},e.prototype._onTimedID3MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.TIMED_ID3_METADATA_ARRIVED,e)}))},e.prototype._onSMPTE2038MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.SMPTE2038_METADATA_ARRIVED,e)}))},e.prototype._onSCTE35MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.SCTE35_METADATA_ARRIVED,e)}))},e.prototype._onPESPrivateDataDescriptor=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.PES_PRIVATE_DATA_DESCRIPTOR,e)}))},e.prototype._onPESPrivateDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.PES_PRIVATE_DATA_ARRIVED,e)}))},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.STATISTICS_INFO,e)}))},e.prototype._onIOError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(E.A.IO_ERROR,e,t)}))},e.prototype._onDemuxError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(E.A.DEMUX_ERROR,e,t)}))},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(E.A.RECOMMEND_SEEKPOINT,e)}))},e.prototype._onLoggingConfigChanged=function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})},e.prototype._onWorkerMessage=function(e){var t=e.data,i=null==t?void 0:t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case E.A.INIT_SEGMENT:case E.A.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case E.A.LOADING_COMPLETE:case E.A.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case E.A.MEDIA_INFO:Object.setPrototypeOf(i,w.A.prototype),this._emitter.emit(t.msg,i);break;case E.A.METADATA_ARRIVED:case E.A.SCRIPTDATA_ARRIVED:case E.A.TIMED_ID3_METADATA_ARRIVED:case E.A.SMPTE2038_METADATA_ARRIVED:case E.A.SCTE35_METADATA_ARRIVED:case E.A.PES_PRIVATE_DATA_DESCRIPTOR:case E.A.PES_PRIVATE_DATA_ARRIVED:case E.A.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case E.A.IO_ERROR:case E.A.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case E.A.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":u.A.emitter.emit("log",i.type,i.logcat)}},e}(),k="error",R="source_open",O="update_end",C="buffer_full";var B=i(1951),x=i(4383);const I=function(){function e(e){this.TAG="MSEController",this._config=e,this._emitter=new c.A,this._config.isLive&&void 0===this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new B.EX}return e.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaSource)throw new x.j4("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL},e.prototype.detachMediaElement=function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var i=this._pendingSegments[t];i.splice(0,i.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var r=this._sourceBuffers[t];if(r){if("closed"!==e.readyState){try{e.removeSourceBuffer(r)}catch(e){u.A.e(this.TAG,e.message)}null==r||r.removeEventListener("error",this.e.onSourceBufferError),null==r||r.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){u.A.e(this.TAG,e.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},e.prototype.appendInitSegment=function(e,t){var i;if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var r=e,n="".concat(r.container);r.codec&&r.codec.length>0&&(n+=";codecs=".concat(r.codec));var o=!1;if(u.A.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[r.type]=r,n!==this._mimeTypes[r.type]){if(this._mimeTypes[r.type])u.A.v(this.TAG,"Notice: ".concat(r.type," mimeType changed, origin: ").concat(this._mimeTypes[r.type]||"",", target: ").concat(n));else{o=!0;try{var a=this._sourceBuffers[r.type]=this._mediaSource.addSourceBuffer(n);a.addEventListener("error",this.e.onSourceBufferError),a.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return u.A.e(this.TAG,e.message),void this._emitter.emit(k,{code:e.code,msg:e.message})}}this._mimeTypes[r.type]=n}t||this._pendingSegments[r.type].push(r),o||this._sourceBuffers[r.type]&&!(null===(i=this._sourceBuffers[r.type])||void 0===i?void 0:i.updating)&&this._doAppendSegments(),h.A.safari&&"audio/mpeg"===r.container&&r.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=r.mediaDuration/1e3,this._updateMediaSourceDuration())},e.prototype.appendMediaSegment=function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var i=this._sourceBuffers[t.type];!i||i.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},e.prototype.seek=function(e){var t,i;for(var r in this._sourceBuffers)if(this._sourceBuffers[r]){var n=this._sourceBuffers[r];if("open"===(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState))try{null==n||n.abort()}catch(e){u.A.e(this.TAG,e.message)}this._idrList.clear();var o=this._pendingSegments[r];if(o.splice(0,o.length),"closed"!==(null===(i=this._mediaSource)||void 0===i?void 0:i.readyState)){if(n){for(var a=0;a<n.buffered.length;a++){var s=n.buffered.start(a),l=n.buffered.end(a);this._pendingRemoveRanges[r].push({start:s,end:l})}(null==n?void 0:n.updating)||this._doRemoveRanges()}if(h.A.safari){var d=this._lastInitSegments[r];d&&(this._pendingSegments[r].push(d),(null==n?void 0:n.updating)||this._doAppendSegments())}}}},e.prototype.endOfStream=function(){var e,t,i=this._mediaSource,r=this._sourceBuffers;i&&"open"===i.readyState?(null===(e=r.video)||void 0===e?void 0:e.updating)||(null===(t=r.audio)||void 0===t?void 0:t.updating)?this._hasPendingEos=!0:(this._hasPendingEos=!1,i.endOfStream()):i&&"closed"===i.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)},e.prototype.getNearestKeyframe=function(e){return this._idrList.getLastSyncPointBeforeDts(e)},e.prototype._needCleanupSourceBuffer=function(){var e,t;if(!this._config.autoCleanupSourceBuffer)return!1;var i=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(var r in this._sourceBuffers){var n=this._sourceBuffers[r];if(n){var o=n.buffered;if(o.length>=1&&i-o.start(0)>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0))return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e,t,i,r=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(var n in this._sourceBuffers){var o=this._sourceBuffers[n];if(o){for(var a=o.buffered,s=!1,l=0;l<a.length;l++){var d=a.start(l),c=a.end(l);if(d<=r&&r<c+3){if(r-d>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0)){s=!0;var u=r-((null===(i=this._config)||void 0===i?void 0:i.autoCleanupMinBackwardDuration)||0);this._pendingRemoveRanges[n].push({start:d,end:u})}}else c<r&&(s=!0,this._pendingRemoveRanges[n].push({start:d,end:c}))}s&&!o.updating&&this._doRemoveRanges()}}},e.prototype._updateMediaSourceDuration=function(){var e,t,i,r,n=this._sourceBuffers;if(0!==(null===(e=this._mediaElement)||void 0===e?void 0:e.readyState)&&"open"===(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState)&&!(null===(i=n.video)||void 0===i?void 0:i.updating)&&!(null===(r=n.audio)||void 0===r?void 0:r.updating)){var o=this._mediaSource.duration,a=this._pendingMediaDuration;a>0&&(isNaN(o)||a>o)&&(u.A.v(this.TAG,"Update MediaSource duration from ".concat(o," to ").concat(a)),this._mediaSource.duration=a),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},e.prototype._doRemoveRanges=function(){var e;for(var t in this._pendingRemoveRanges)if(this._sourceBuffers[t]&&!(null===(e=this._sourceBuffers[t])||void 0===e?void 0:e.updating))for(var i=this._sourceBuffers[t],r=this._pendingRemoveRanges[t];r.length&&!(null==i?void 0:i.updating);){var n=r.shift();null==i||i.remove(n.start,n.end)}},e.prototype._doAppendSegments=function(){var e,t,i,r=this._pendingSegments;for(var n in r)if(this._sourceBuffers[n]&&!(null===(e=this._sourceBuffers[n])||void 0===e?void 0:e.updating)&&r[n].length>0){var o=r[n].shift();if(null==o?void 0:o.timestampOffset){var a=(null===(t=this._sourceBuffers[n])||void 0===t?void 0:t.timestampOffset)||0,s=o.timestampOffset/1e3;Math.abs(a-s)>.1&&(u.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(a," to ").concat(s)),this._sourceBuffers[n]&&(this._sourceBuffers[n].timestampOffset=s)),delete o.timestampOffset}if(!o.data||0===o.data.byteLength)continue;try{null===(i=this._sourceBuffers[n])||void 0===i||i.appendBuffer(o.data),this._isBufferFull=!1,"video"===n&&o.hasOwnProperty("info")&&this._idrList.appendArray(o.info.syncPoints)}catch(e){this._pendingSegments[n].unshift(o),22===e.code?(this._isBufferFull||this._emitter.emit(C),this._isBufferFull=!0):(u.A.e(this.TAG,e.message),this._emitter.emit(k,{code:e.code,msg:e.message}))}}},e.prototype._onSourceOpen=function(){var e;if(u.A.v(this.TAG,"MediaSource onSourceOpen"),null===(e=this._mediaSource)||void 0===e||e.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var t=this._pendingSourceBufferInit;t.length;){var i=t.shift();this.appendInitSegment(i,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(R)},e.prototype._onSourceEnded=function(){u.A.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){u.A.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},e.prototype._hasPendingSegments=function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0},e.prototype._hasPendingRemoveRanges=function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0},e.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(O)},e.prototype._onSourceBufferError=function(e){u.A.e(this.TAG,"SourceBuffer Error: ".concat(e))},e}();var L=i(6399),D={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},M={NETWORK_EXCEPTION:d.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:d.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:d.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:d.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:L.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:L.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:L.A.CODEC_UNSUPPORTED};const P=function(){function e(e,t){var i,r,n;this.TAG="MSEPlayer",this._type="MSEPlayer",this._emitter=new c.A,this._config=a(),"object"==typeof t&&Object.assign(this._config,t);var o=e.type.toLowerCase();if("mse"!==o&&"mpegts"!==o&&"m2ts"!==o&&"flv"!==o)throw new x.Qn("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");e.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=e,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var s=h.A.chrome&&(h.A.version&&(null===(i=h.A.version)||void 0===i?void 0:i.major)<50||h.A.version&&50===(null===(r=null===h.A||void 0===h.A?void 0:h.A.version)||void 0===r?void 0:r.major)&&((null===(n=null===h.A||void 0===h.A?void 0:h.A.version)||void 0===n?void 0:n.build)||-1)<2661);this._alwaysSeekKeyframe=!!(s||h.A.msedge||h.A.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return e.prototype.destroy=function(){this._emitter.emit(A.DESTROYING),null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===A.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){i._emitter.emit(A.MEDIA_INFO,i.mediaInfo)})):e===A.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){i._emitter.emit(A.STATISTICS_INFO,i.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){var t,i,r,n,o,a=this;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new I(this._config),null===(t=this._msectl)||void 0===t||t.on(O,this._onmseUpdateEnd.bind(this)),null===(i=this._msectl)||void 0===i||i.on(C,this._onmseBufferFull.bind(this)),null===(r=this._msectl)||void 0===r||r.on(R,(function(){a._mseSourceOpened=!0,a._hasPendingLoad&&(a._hasPendingLoad=!1,a.load())})),null===(n=this._msectl)||void 0===n||n.on(k,(function(e){a._emitter.emit(A.ERROR,D.MEDIA_ERROR,M.MEDIA_MSE_ERROR,e)})),null===(o=this._msectl)||void 0===o||o.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){var e;this._mediaElement&&(null===(e=this._msectl)||void 0===e||e.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)},e.prototype.load=function(){var e=this;if(!this._mediaElement)throw new x.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new x.j4("MSEPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(!this._config.deferLoadAfterSourceOpen||this._mseSourceOpened?(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new T(this._mediaDataSource,this._config),this._transmuxer.on(E.A.INIT_SEGMENT,(function(t,i){var r;null===(r=e._msectl)||void 0===r||r.appendInitSegment(i)})),this._transmuxer.on(E.A.MEDIA_SEGMENT,(function(t,i){var r,n,o;if(null===(r=e._msectl)||void 0===r||r.appendMediaSegment(i),e._config.lazyLoad&&!e._config.isLive){var a=null===(n=e._mediaElement)||void 0===n?void 0:n.currentTime;i.info.endDts>=1e3*(a+((null===(o=e._config)||void 0===o?void 0:o.lazyLoadMaxDuration)||0))&&null==e._progressChecker&&(u.A.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(E.A.LOADING_COMPLETE,(function(){var t;null===(t=e._msectl)||void 0===t||t.endOfStream(),e._emitter.emit(A.LOADING_COMPLETE)})),this._transmuxer.on(E.A.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(A.RECOVERED_EARLY_EOF)})),this._transmuxer.on(E.A.IO_ERROR,(function(t,i){e._emitter.emit(A.ERROR,D.NETWORK_ERROR,t,i)})),this._transmuxer.on(E.A.DEMUX_ERROR,(function(t,i){e._emitter.emit(A.ERROR,D.MEDIA_ERROR,t,{code:-1,msg:i})})),this._transmuxer.on(E.A.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(A.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(E.A.METADATA_ARRIVED,(function(t){e._emitter.emit(A.METADATA_ARRIVED,t)})),this._transmuxer.on(E.A.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(A.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(E.A.TIMED_ID3_METADATA_ARRIVED,(function(t){e._emitter.emit(A.TIMED_ID3_METADATA_ARRIVED,t)})),this._transmuxer.on(E.A.SMPTE2038_METADATA_ARRIVED,(function(t){e._emitter.emit(A.SMPTE2038_METADATA_ARRIVED,t)})),this._transmuxer.on(E.A.SCTE35_METADATA_ARRIVED,(function(t){e._emitter.emit(A.SCTE35_METADATA_ARRIVED,t)})),this._transmuxer.on(E.A.PES_PRIVATE_DATA_DESCRIPTOR,(function(t){e._emitter.emit(A.PES_PRIVATE_DATA_DESCRIPTOR,t)})),this._transmuxer.on(E.A.PES_PRIVATE_DATA_ARRIVED,(function(t){e._emitter.emit(A.PES_PRIVATE_DATA_ARRIVED,t)})),this._transmuxer.on(E.A.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(A.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(E.A.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()):this._hasPendingLoad=!0)},e.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},e.prototype.play=function(){var e,t,i,r;return t=this,r=function(){return function(e,t){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){switch(t.label){case 0:return[4,null===(e=this._mediaElement)||void 0===e?void 0:e.play()];case 1:return[2,t.sent()]}}))},new((i=void 0)||(i=Promise))((function(e,n){function o(e){try{s(r.next(e))}catch(e){n(e)}}function a(e){try{s(r.throw(e))}catch(e){n(e)}}function s(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(o,a)}s((r=r.apply(t,[])).next())}))},e.prototype.pause=function(){var e;null===(e=this._mediaElement)||void 0===e||e.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.volume},set:function(e){this._mediaElement&&(this._mediaElement.volume=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.muted},set:function(e){this._mediaElement&&(this._mediaElement.muted=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),e.prototype._fillStatisticsInfo=function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,r=0;if(this._mediaElement.getVideoPlaybackQuality){var n=this._mediaElement.getVideoPlaybackQuality();i=n.totalVideoFrames,r=n.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,r=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=r),e},e.prototype._onmseUpdateEnd=function(){var e,t,i,r,n=null===(e=this._mediaElement)||void 0===e?void 0:e.buffered,o=(null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime)||0;if(this._config.isLive&&this._config.liveBufferLatencyChasing&&(null==n?void 0:n.length)>0&&!(null===(i=this._mediaElement)||void 0===i?void 0:i.paused)){var a=n.end(n.length-1);if(a>((null===(r=this._config)||void 0===r?void 0:r.liveBufferLatencyMaxLatency)||0)&&a-o>(this._config.liveBufferLatencyMaxLatency||0)){var s=a-(this._config.liveBufferLatencyMinRemain||0);this.currentTime=s}}if(this._config.lazyLoad&&!this._config.isLive){for(var l=0,d=0;d<n.length;d++){var c=n.start(d),h=n.end(d);if(c<=o&&o<h){l=h;break}}l>=o+(this._config.lazyLoadMaxDuration||0)&&null==this._progressChecker&&(u.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},e.prototype._onmseBufferFull=function(){u.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},e.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},e.prototype._checkProgressAndResume=function(){for(var e,t,i,r=(null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime)||0,n=(null===(t=this._mediaElement)||void 0===t?void 0:t.buffered)||[],o=!1,a=0;a<n.length;a++){var s=n.start(a),l=n.end(a);if(r>=s&&r<l){r>=l-(this._config.lazyLoadRecoverDuration||0)&&(o=!0);break}}o&&(window.clearInterval(this._progressChecker),this._progressChecker=null,o&&(u.A.v(this.TAG,"Continue loading from paused position"),null===(i=this._transmuxer)||void 0===i||i.resume()))},e.prototype._isTimepointBuffered=function(e){for(var t,i=null===(t=this._mediaElement)||void 0===t?void 0:t.buffered,r=0;r<i.length;r++){var n=i.start(r),o=i.end(r);if(e>=n&&e<o)return!0}return!1},e.prototype._internalSeek=function(e){var t,i,r,n=this._isTimepointBuffered(e),o=!1,a=0;if(e<1&&this._mediaElement.buffered.length>0){var s=this._mediaElement.buffered.start(0);(s<1&&e<s||h.A.safari)&&(o=!0,a=h.A.safari?.1:s)}if(o)this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=a);else if(n){if(this._alwaysSeekKeyframe){var l=null===(t=this._msectl)||void 0===t?void 0:t.getNearestKeyframe(Math.floor(1e3*e));this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=null!=l?l.dts/1e3:e)}else this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e);null!=this._progressChecker&&this._checkProgressAndResume()}else null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),null===(i=this._msectl)||void 0===i||i.seek(e),null===(r=this._transmuxer)||void 0===r||r.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e))},e.prototype._checkAndApplyUnbufferedSeekpoint=function(){var e,t,i,r;if(this._seekpointRecord)if(((null===(e=this._seekpointRecord)||void 0===e?void 0:e.recordTime)||0)<=this._now()-100){var n=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(n)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),null===(i=this._msectl)||void 0===i||i.seek(n),null===(r=this._transmuxer)||void 0===r||r.seek(Math.floor(1e3*n)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=n)))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},e.prototype._checkAndResumeStuckPlayback=function(e){var t=this._mediaElement;if(e||!this._receivedCanPlay||t.readyState<2){var i=t.buffered;i.length>0&&t.currentTime<i.start(0)&&(u.A.w(this.TAG,"Playback seems stuck at ".concat(t.currentTime,", seek to ").concat(i.start(0))),this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=i.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress)))}else this._mediaElement&&this._mediaElement.removeEventListener("progress",this.e.onvProgress)},e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement&&(this._mediaElement.currentTime=this._pendingSeekTime),this._pendingSeekTime=null)},e.prototype._onvSeeking=function(e){var t,i,r,n=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime,o=null===(i=this._mediaElement)||void 0===i?void 0:i.buffered;if(this._requestSetTime)this._requestSetTime=!1;else{if(n<1&&o.length>0){var a=o.start(0);if(a<1&&n<a||h.A.safari)return this._requestSetTime=!0,void(this._mediaElement&&(h.A.safari?this._mediaElement.currentTime=.1:this._mediaElement.currentTime=a))}if(this._isTimepointBuffered(n)){if(this._alwaysSeekKeyframe){var s=null===(r=this._msectl)||void 0===r?void 0:r.getNearestKeyframe(Math.floor(1e3*n));null!=s&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=s.dts/1e3))}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:n,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},e.prototype._onvCanPlay=function(e){var t;this._receivedCanPlay=!0,null===(t=this._mediaElement)||void 0===t||t.removeEventListener("canplay",this.e.onvCanPlay)},e.prototype._onvStalled=function(e){this._checkAndResumeStuckPlayback(!0)},e.prototype._onvProgress=function(e){this._checkAndResumeStuckPlayback()},e}(),U=function(){function e(e,t){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new c.A,this._config=a(),"object"==typeof t&&Object.assign(this._config,t);var i=e.type.toLowerCase();if("mse"===i||"mpegts"===i||"m2ts"===i||"flv"===i)throw new x.Qn("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(e.hasOwnProperty("segments"))throw new x.Qn("NativePlayer(".concat(e.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=e,this._mediaElement=null}return e.prototype.destroy=function(){var e;this._emitter.emit(A.DESTROYING),this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,null===(e=this._emitter)||void 0===e||e.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===A.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){i._emitter.emit(A.MEDIA_INFO,i.mediaInfo)})):e===A.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){i._emitter.emit(A.STATISTICS_INFO,i.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.load=function(){var e;if(!this._mediaElement)throw new x.j4("HTMLMediaElement must be attached before load()!");this._mediaElement.src=(null===(e=this._mediaDataSource)||void 0===e?void 0:e.url)||"",this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){var e,t,i,r;return t=this,r=function(){return function(e,t){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){switch(t.label){case 0:return[4,null===(e=this._mediaElement)||void 0===e?void 0:e.play()];case 1:return[2,t.sent()]}}))},new((i=void 0)||(i=Promise))((function(e,n){function o(e){try{s(r.next(e))}catch(e){n(e)}}function a(e){try{s(r.throw(e))}catch(e){n(e)}}function s(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(o,a)}s((r=r.apply(t,[])).next())}))},e.prototype.pause=function(){var e;null===(e=this._mediaElement)||void 0===e||e.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.volume},set:function(e){this._mediaElement&&(this._mediaElement.volume=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.muted},set:function(e){this._mediaElement&&(this._mediaElement.muted=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,r=0;if(this._mediaElement.getVideoPlaybackQuality){var n=this._mediaElement.getVideoPlaybackQuality();i=n.totalVideoFrames,r=n.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,r=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=r),e},enumerable:!1,configurable:!0}),e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement&&(this._mediaElement.currentTime=this._pendingSeekTime),this._pendingSeekTime=null),this._emitter.emit(A.MEDIA_INFO,this.mediaInfo)},e.prototype._reportStatisticsInfo=function(){this._emitter.emit(A.STATISTICS_INFO,this.statisticsInfo)},e}();var F={createPlayer:function(e,t){(null==e?void 0:e.url)&&(e.url=function(e,t){void 0===t&&(t=["h264"]);var i=(t||["h264"]).reduce((function(e,t){return t=t.toLowerCase(),e+(r[t]||0)}),0),n=e.split("?")[0],o=e.split("?")[1];return o=(o||"").split("&").filter((function(e){return!/^vc=\d?/.test(e)})).join("&"),n+"?"+o+(o?"&":"")+"vc="+i}(e.url,["h264","h265"]));var i=e;if(null==i||"object"!=typeof i)throw new x.Qn("MediaDataSource must be an javascript object!");if(!Object.prototype.hasOwnProperty.call(i,"type"))throw new x.Qn("MediaDataSource must has type field to indicate video file type!");switch(i.type){case"mse":case"mpegts":case"m2ts":case"flv":return new P(i,t);default:return new U(i,t)}},isSupported:function(){return l.supportMSEH264Playback()},getFeatureList:function(){return l.getFeatureList()},BaseLoader:d.HC,LoaderStatus:d.eO,LoaderErrors:d.Xv,version:"",Events:A,ErrorTypes:D,ErrorDetails:M,MSEPlayer:P,NativePlayer:U,LoggingControl:b.A};Object.defineProperty(F,"version",{enumerable:!0,get:function(){return"2.0.1"}});const N=F},2671:(e,t,i)=>{var r=i(6458),n=i(2809),o=i(9211),a=i(497),s=i(5057),l=i(3732),d=function(){},c=s("Reflect","construct"),u=/^\s*(?:class|function)\b/,h=r(u.exec),A=!u.test(d),p=function(e){if(!o(e))return!1;try{return c(d,[],e),!0}catch(e){return!1}},f=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return A||!!h(u,l(e))}catch(e){return!0}};f.sham=!0,e.exports=!c||n((function(){var e;return p(p.call)||!p(Object)||!p((function(){e=!0}))||e}))?f:p},2719:(e,t,i)=>{var r=i(5273),n=i(5840);e.exports=function(e){return r(n(e))}},2757:(e,t,i)=>{var r=i(9615),n=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw new n("Incorrect invocation")}},2792:(e,t,i)=>{var r=i(9646),n=i(2809);e.exports=r&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},2807:(e,t,i)=>{var r=i(9047);e.exports=function(e,t){return new(r(e))(0===t?0:t)}},2809:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},2897:(e,t,i)=>{var r=i(9646),n=i(815),o=i(7403),a=i(6330),s=i(2719),l=i(4151),d=i(4347),c=i(6071),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(e,t){if(e=s(e),t=l(t),c)try{return u(e,t)}catch(e){}if(d(e,t))return a(!n(o.f,e,t),e[t])}},2915:(e,t,i)=>{var r=i(7553),n=i(2327),o=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||a[o]===e)}},3074:(e,t,i)=>{var r=i(9364),n=i(9083),o=i(7642);r({target:"Object",stat:!0,forced:i(2809)((function(){o(1)}))},{keys:function(e){return o(n(e))}})},3430:(e,t,i)=>{var r=i(6458),n=i(4347),o=i(2719),a=i(219).indexOf,s=i(7923),l=r([].push);e.exports=function(e,t){var i,r=o(e),d=0,c=[];for(i in r)!n(s,i)&&n(r,i)&&l(c,i);for(;t.length>d;)n(r,i=t[d++])&&(~a(c,i)||l(c,i));return c}},3439:(e,t,i)=>{var r=i(9646),n=i(6458),o=i(815),a=i(2809),s=i(7642),l=i(7819),d=i(7403),c=i(9083),u=i(5273),h=Object.assign,A=Object.defineProperty,p=n([].concat);e.exports=!h||a((function(){if(r&&1!==h({b:1},h(A({},"a",{enumerable:!0,get:function(){A(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach((function(e){t[e]=e})),7!==h({},e)[i]||s(h({},t)).join("")!==n}))?function(e,t){for(var i=c(e),n=arguments.length,a=1,h=l.f,A=d.f;n>a;)for(var f,_=u(arguments[a++]),m=h?p(s(_),h(_)):s(_),v=m.length,g=0;v>g;)f=m[g++],r&&!o(A,_,f)||(i[f]=_[f]);return i}:h},3463:(e,t,i)=>{var r=i(775);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},3478:(e,t,i)=>{var r=i(9646),n=i(1562),o=i(6458),a=i(4346),s=i(5405),l=i(9277),d=i(6122),c=i(2630).f,u=i(9615),h=i(9666),A=i(6677),p=i(1144),f=i(8587),_=i(9614),m=i(3930),v=i(2809),g=i(4347),y=i(3587).enforce,b=i(9603),S=i(7553),E=i(7517),w=i(6288),T=S("match"),k=n.RegExp,R=k.prototype,O=n.SyntaxError,C=o(R.exec),B=o("".charAt),x=o("".replace),I=o("".indexOf),L=o("".slice),D=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,M=/a/g,P=/a/g,U=new k(M)!==M,F=f.MISSED_STICKY,N=f.UNSUPPORTED_Y;if(a("RegExp",r&&(!U||F||E||w||v((function(){return P[T]=!1,k(M)!==M||k(P)===P||"/a/i"!==String(k(M,"i"))}))))){for(var V=function(e,t){var i,r,n,o,a,c,f=u(R,this),_=h(e),m=void 0===t,v=[],b=e;if(!f&&_&&m&&e.constructor===V)return e;if((_||u(R,e))&&(e=e.source,m&&(t=p(b))),e=void 0===e?"":A(e),t=void 0===t?"":A(t),b=e,E&&"dotAll"in M&&(r=!!t&&I(t,"s")>-1)&&(t=x(t,/s/g,"")),i=t,F&&"sticky"in M&&(n=!!t&&I(t,"y")>-1)&&N&&(t=x(t,/y/g,"")),w&&(o=function(e){for(var t,i=e.length,r=0,n="",o=[],a=d(null),s=!1,l=!1,c=0,u="";r<=i;r++){if("\\"===(t=B(e,r)))t+=B(e,++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:if(n+=t,"?:"===L(e,r+1,r+3))continue;C(D,L(e,r+1))&&(r+=2,l=!0),c++;continue;case">"===t&&l:if(""===u||g(a,u))throw new O("Invalid capture group name");a[u]=!0,o[o.length]=[u,c],l=!1,u="";continue}l?u+=t:n+=t}return[n,o]}(e),e=o[0],v=o[1]),a=s(k(e,t),f?this:R,V),(r||n||v.length)&&(c=y(a),r&&(c.dotAll=!0,c.raw=V(function(e){for(var t,i=e.length,r=0,n="",o=!1;r<=i;r++)"\\"!==(t=B(e,r))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),n+=t):n+="[\\s\\S]":n+=t+B(e,++r);return n}(e),i)),n&&(c.sticky=!0),v.length&&(c.groups=v)),e!==b)try{l(a,"source",""===b?"(?:)":b)}catch(e){}return a},G=c(k),j=0;G.length>j;)_(V,k,G[j++]);R.constructor=V,V.prototype=R,m(n,"RegExp",V,{constructor:!0})}b("RegExp")},3479:(e,t,i)=>{var r=i(5993);e.exports="NODE"===r},3587:(e,t,i)=>{var r,n,o,a=i(4468),s=i(1562),l=i(4152),d=i(9277),c=i(4347),u=i(775),h=i(577),A=i(7923),p="Object already initialized",f=s.TypeError,_=s.WeakMap;if(a||u.state){var m=u.state||(u.state=new _);m.get=m.get,m.has=m.has,m.set=m.set,r=function(e,t){if(m.has(e))throw new f(p);return t.facade=e,m.set(e,t),t},n=function(e){return m.get(e)||{}},o=function(e){return m.has(e)}}else{var v=h("state");A[v]=!0,r=function(e,t){if(c(e,v))throw new f(p);return t.facade=e,d(e,v,t),t},n=function(e){return c(e,v)?e[v]:{}},o=function(e){return c(e,v)}}e.exports={set:r,get:n,has:o,enforce:function(e){return o(e)?n(e):r(e,{})},getterFor:function(e){return function(t){var i;if(!l(t)||(i=n(t)).type!==e)throw new f("Incompatible receiver, "+e+" required");return i}}}},3643:(e,t,i)=>{var r=i(9646),n=i(6071),o=i(2792),a=i(7749),s=i(4151),l=TypeError,d=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u="enumerable",h="configurable",A="writable";t.f=r?o?function(e,t,i){if(a(e),t=s(t),a(i),"function"==typeof e&&"prototype"===t&&"value"in i&&A in i&&!i[A]){var r=c(e,t);r&&r[A]&&(e[t]=i.value,i={configurable:h in i?i[h]:r[h],enumerable:u in i?i[u]:r[u],writable:!1})}return d(e,t,i)}:d:function(e,t,i){if(a(e),t=s(t),a(i),n)try{return d(e,t,i)}catch(e){}if("get"in i||"set"in i)throw new l("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},3732:(e,t,i)=>{var r=i(6458),n=i(9211),o=i(775),a=r(Function.toString);n(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},3813:(e,t,i)=>{i(1541)(Math,"Math",!0)},3930:(e,t,i)=>{var r=i(9211),n=i(3643),o=i(4233),a=i(4191);e.exports=function(e,t,i,s){s||(s={});var l=s.enumerable,d=void 0!==s.name?s.name:t;if(r(i)&&o(i,d,s),s.global)l?e[t]=i:a(t,i);else{try{s.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=i:n.f(e,t,{value:i,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},3992:(e,t,i)=>{var r=i(9364),n=i(5057),o=i(8891),a=i(815),s=i(6458),l=i(2809),d=i(9211),c=i(5727),u=i(8626),h=i(9695),A=i(7917),p=String,f=n("JSON","stringify"),_=s(/./.exec),m=s("".charAt),v=s("".charCodeAt),g=s("".replace),y=s(1..toString),b=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,E=/^[\uDC00-\uDFFF]$/,w=!A||l((function(){var e=n("Symbol")("stringify detection");return"[null]"!==f([e])||"{}"!==f({a:e})||"{}"!==f(Object(e))})),T=l((function(){return'"\\udf06\\ud834"'!==f("\udf06\ud834")||'"\\udead"'!==f("\udead")})),k=function(e,t){var i=u(arguments),r=h(t);if(d(r)||void 0!==e&&!c(e))return i[1]=function(e,t){if(d(r)&&(t=a(r,this,p(e),t)),!c(t))return t},o(f,null,i)},R=function(e,t,i){var r=m(i,t-1),n=m(i,t+1);return _(S,e)&&!_(E,n)||_(E,e)&&!_(S,r)?"\\u"+y(v(e,0),16):e};f&&r({target:"JSON",stat:!0,arity:3,forced:w||T},{stringify:function(e,t,i){var r=u(arguments),n=o(w?k:f,null,r);return T&&"string"==typeof n?g(n,b,R):n}})},4151:(e,t,i)=>{var r=i(115),n=i(5727);e.exports=function(e){var t=r(e,"string");return n(t)?t:t+""}},4152:(e,t,i)=>{var r=i(9211);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},4160:(e,t,i)=>{var r=i(815),n=i(5057),o=i(7553),a=i(3930);e.exports=function(){var e=n("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,s=o("toPrimitive");t&&!t[s]&&a(t,s,(function(e){return r(i,this)}),{arity:1})}},4191:(e,t,i)=>{var r=i(1562),n=Object.defineProperty;e.exports=function(e,t){try{n(r,e,{value:t,configurable:!0,writable:!0})}catch(i){r[e]=t}return t}},4220:(e,t,i)=>{i(6810);var r,n=i(9364),o=i(9646),a=i(6666),s=i(1562),l=i(7042),d=i(6458),c=i(3930),u=i(1176),h=i(2757),A=i(4347),p=i(3439),f=i(4478),_=i(8626),m=i(4417).codeAt,v=i(4955),g=i(6677),y=i(1541),b=i(594),S=i(648),E=i(3587),w=E.set,T=E.getterFor("URL"),k=S.URLSearchParams,R=S.getState,O=s.URL,C=s.TypeError,B=s.parseInt,x=Math.floor,I=Math.pow,L=d("".charAt),D=d(/./.exec),M=d([].join),P=d(1..toString),U=d([].pop),F=d([].push),N=d("".replace),V=d([].shift),G=d("".split),j=d("".slice),$=d("".toLowerCase),W=d([].unshift),Q="Invalid scheme",z="Invalid host",H="Invalid port",q=/[a-z]/i,Y=/[\d+-.a-z]/i,X=/\d/,Z=/^0x/i,K=/^[0-7]+$/,J=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ie=/[\0\t\n\r #/:<>?@[\\\]^|]/,re=/^[\u0000-\u0020]+/,ne=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,oe=/[\t\n\r]/g,ae=function(e){var t,i,r,n;if("number"==typeof e){for(t=[],i=0;i<4;i++)W(t,e%256),e=x(e/256);return M(t,".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,i=1,r=null,n=0,o=0;o<8;o++)0!==e[o]?(n>i&&(t=r,i=n),r=null,n=0):(null===r&&(r=o),++n);return n>i?r:t}(e),i=0;i<8;i++)n&&0===e[i]||(n&&(n=!1),r===i?(t+=i?":":"::",n=!0):(t+=P(e[i],16),i<7&&(t+=":")));return"["+t+"]"}return e},se={},le=p({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),de=p({},le,{"#":1,"?":1,"{":1,"}":1}),ce=p({},de,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ue=function(e,t){var i=m(e,0);return i>32&&i<127&&!A(t,e)?e:encodeURIComponent(e)},he={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Ae=function(e,t){var i;return 2===e.length&&D(q,L(e,0))&&(":"===(i=L(e,1))||!t&&"|"===i)},pe=function(e){var t;return e.length>1&&Ae(j(e,0,2))&&(2===e.length||"/"===(t=L(e,2))||"\\"===t||"?"===t||"#"===t)},fe=function(e){return"."===e||"%2e"===$(e)},_e={},me={},ve={},ge={},ye={},be={},Se={},Ee={},we={},Te={},ke={},Re={},Oe={},Ce={},Be={},xe={},Ie={},Le={},De={},Me={},Pe={},Ue=function(e,t,i){var r,n,o,a=g(e);if(t){if(n=this.parse(a))throw new C(n);this.searchParams=null}else{if(void 0!==i&&(r=new Ue(i,!0)),n=this.parse(a,null,r))throw new C(n);(o=R(new k)).bindURL(this),this.searchParams=o}};Ue.prototype={type:"URL",parse:function(e,t,i){var n,o,a,s,l,d=this,c=t||_e,u=0,h="",p=!1,m=!1,v=!1;for(e=g(e),t||(d.scheme="",d.username="",d.password="",d.host=null,d.port=null,d.path=[],d.query=null,d.fragment=null,d.cannotBeABaseURL=!1,e=N(e,re,""),e=N(e,ne,"$1")),e=N(e,oe,""),n=f(e);u<=n.length;){switch(o=n[u],c){case _e:if(!o||!D(q,o)){if(t)return Q;c=ve;continue}h+=$(o),c=me;break;case me:if(o&&(D(Y,o)||"+"===o||"-"===o||"."===o))h+=$(o);else{if(":"!==o){if(t)return Q;h="",c=ve,u=0;continue}if(t&&(d.isSpecial()!==A(he,h)||"file"===h&&(d.includesCredentials()||null!==d.port)||"file"===d.scheme&&!d.host))return;if(d.scheme=h,t)return void(d.isSpecial()&&he[d.scheme]===d.port&&(d.port=null));h="","file"===d.scheme?c=Ce:d.isSpecial()&&i&&i.scheme===d.scheme?c=ge:d.isSpecial()?c=Ee:"/"===n[u+1]?(c=ye,u++):(d.cannotBeABaseURL=!0,F(d.path,""),c=De)}break;case ve:if(!i||i.cannotBeABaseURL&&"#"!==o)return Q;if(i.cannotBeABaseURL&&"#"===o){d.scheme=i.scheme,d.path=_(i.path),d.query=i.query,d.fragment="",d.cannotBeABaseURL=!0,c=Pe;break}c="file"===i.scheme?Ce:be;continue;case ge:if("/"!==o||"/"!==n[u+1]){c=be;continue}c=we,u++;break;case ye:if("/"===o){c=Te;break}c=Le;continue;case be:if(d.scheme=i.scheme,o===r)d.username=i.username,d.password=i.password,d.host=i.host,d.port=i.port,d.path=_(i.path),d.query=i.query;else if("/"===o||"\\"===o&&d.isSpecial())c=Se;else if("?"===o)d.username=i.username,d.password=i.password,d.host=i.host,d.port=i.port,d.path=_(i.path),d.query="",c=Me;else{if("#"!==o){d.username=i.username,d.password=i.password,d.host=i.host,d.port=i.port,d.path=_(i.path),d.path.length--,c=Le;continue}d.username=i.username,d.password=i.password,d.host=i.host,d.port=i.port,d.path=_(i.path),d.query=i.query,d.fragment="",c=Pe}break;case Se:if(!d.isSpecial()||"/"!==o&&"\\"!==o){if("/"!==o){d.username=i.username,d.password=i.password,d.host=i.host,d.port=i.port,c=Le;continue}c=Te}else c=we;break;case Ee:if(c=we,"/"!==o||"/"!==L(h,u+1))continue;u++;break;case we:if("/"!==o&&"\\"!==o){c=Te;continue}break;case Te:if("@"===o){p&&(h="%40"+h),p=!0,a=f(h);for(var y=0;y<a.length;y++){var b=a[y];if(":"!==b||v){var S=ue(b,ce);v?d.password+=S:d.username+=S}else v=!0}h=""}else if(o===r||"/"===o||"?"===o||"#"===o||"\\"===o&&d.isSpecial()){if(p&&""===h)return"Invalid authority";u-=f(h).length+1,h="",c=ke}else h+=o;break;case ke:case Re:if(t&&"file"===d.scheme){c=xe;continue}if(":"!==o||m){if(o===r||"/"===o||"?"===o||"#"===o||"\\"===o&&d.isSpecial()){if(d.isSpecial()&&""===h)return z;if(t&&""===h&&(d.includesCredentials()||null!==d.port))return;if(s=d.parseHost(h))return s;if(h="",c=Ie,t)return;continue}"["===o?m=!0:"]"===o&&(m=!1),h+=o}else{if(""===h)return z;if(s=d.parseHost(h))return s;if(h="",c=Oe,t===Re)return}break;case Oe:if(!D(X,o)){if(o===r||"/"===o||"?"===o||"#"===o||"\\"===o&&d.isSpecial()||t){if(""!==h){var E=B(h,10);if(E>65535)return H;d.port=d.isSpecial()&&E===he[d.scheme]?null:E,h=""}if(t)return;c=Ie;continue}return H}h+=o;break;case Ce:if(d.scheme="file","/"===o||"\\"===o)c=Be;else{if(!i||"file"!==i.scheme){c=Le;continue}switch(o){case r:d.host=i.host,d.path=_(i.path),d.query=i.query;break;case"?":d.host=i.host,d.path=_(i.path),d.query="",c=Me;break;case"#":d.host=i.host,d.path=_(i.path),d.query=i.query,d.fragment="",c=Pe;break;default:pe(M(_(n,u),""))||(d.host=i.host,d.path=_(i.path),d.shortenPath()),c=Le;continue}}break;case Be:if("/"===o||"\\"===o){c=xe;break}i&&"file"===i.scheme&&!pe(M(_(n,u),""))&&(Ae(i.path[0],!0)?F(d.path,i.path[0]):d.host=i.host),c=Le;continue;case xe:if(o===r||"/"===o||"\\"===o||"?"===o||"#"===o){if(!t&&Ae(h))c=Le;else if(""===h){if(d.host="",t)return;c=Ie}else{if(s=d.parseHost(h))return s;if("localhost"===d.host&&(d.host=""),t)return;h="",c=Ie}continue}h+=o;break;case Ie:if(d.isSpecial()){if(c=Le,"/"!==o&&"\\"!==o)continue}else if(t||"?"!==o)if(t||"#"!==o){if(o!==r&&(c=Le,"/"!==o))continue}else d.fragment="",c=Pe;else d.query="",c=Me;break;case Le:if(o===r||"/"===o||"\\"===o&&d.isSpecial()||!t&&("?"===o||"#"===o)){if(".."===(l=$(l=h))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(d.shortenPath(),"/"===o||"\\"===o&&d.isSpecial()||F(d.path,"")):fe(h)?"/"===o||"\\"===o&&d.isSpecial()||F(d.path,""):("file"===d.scheme&&!d.path.length&&Ae(h)&&(d.host&&(d.host=""),h=L(h,0)+":"),F(d.path,h)),h="","file"===d.scheme&&(o===r||"?"===o||"#"===o))for(;d.path.length>1&&""===d.path[0];)V(d.path);"?"===o?(d.query="",c=Me):"#"===o&&(d.fragment="",c=Pe)}else h+=ue(o,de);break;case De:"?"===o?(d.query="",c=Me):"#"===o?(d.fragment="",c=Pe):o!==r&&(d.path[0]+=ue(o,se));break;case Me:t||"#"!==o?o!==r&&("'"===o&&d.isSpecial()?d.query+="%27":d.query+="#"===o?"%23":ue(o,se)):(d.fragment="",c=Pe);break;case Pe:o!==r&&(d.fragment+=ue(o,le))}u++}},parseHost:function(e){var t,i,r;if("["===L(e,0)){if("]"!==L(e,e.length-1))return z;if(t=function(e){var t,i,r,n,o,a,s,l=[0,0,0,0,0,0,0,0],d=0,c=null,u=0,h=function(){return L(e,u)};if(":"===h()){if(":"!==L(e,1))return;u+=2,c=++d}for(;h();){if(8===d)return;if(":"!==h()){for(t=i=0;i<4&&D(ee,h());)t=16*t+B(h(),16),u++,i++;if("."===h()){if(0===i)return;if(u-=i,d>6)return;for(r=0;h();){if(n=null,r>0){if(!("."===h()&&r<4))return;u++}if(!D(X,h()))return;for(;D(X,h());){if(o=B(h(),10),null===n)n=o;else{if(0===n)return;n=10*n+o}if(n>255)return;u++}l[d]=256*l[d]+n,2!=++r&&4!==r||d++}if(4!==r)return;break}if(":"===h()){if(u++,!h())return}else if(h())return;l[d++]=t}else{if(null!==c)return;u++,c=++d}}if(null!==c)for(a=d-c,d=7;0!==d&&a>0;)s=l[d],l[d--]=l[c+a-1],l[c+--a]=s;else if(8!==d)return;return l}(j(e,1,-1)),!t)return z;this.host=t}else if(this.isSpecial()){if(e=v(e),D(te,e))return z;if(t=function(e){var t,i,r,n,o,a,s,l=G(e,".");if(l.length&&""===l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(i=[],r=0;r<t;r++){if(""===(n=l[r]))return e;if(o=10,n.length>1&&"0"===L(n,0)&&(o=D(Z,n)?16:8,n=j(n,8===o?1:2)),""===n)a=0;else{if(!D(10===o?J:8===o?K:ee,n))return e;a=B(n,o)}F(i,a)}for(r=0;r<t;r++)if(a=i[r],r===t-1){if(a>=I(256,5-t))return null}else if(a>255)return null;for(s=U(i),r=0;r<i.length;r++)s+=i[r]*I(256,3-r);return s}(e),null===t)return z;this.host=t}else{if(D(ie,e))return z;for(t="",i=f(e),r=0;r<i.length;r++)t+=ue(i[r],se);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return A(he,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&Ae(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,i=e.username,r=e.password,n=e.host,o=e.port,a=e.path,s=e.query,l=e.fragment,d=t+":";return null!==n?(d+="//",e.includesCredentials()&&(d+=i+(r?":"+r:"")+"@"),d+=ae(n),null!==o&&(d+=":"+o)):"file"===t&&(d+="//"),d+=e.cannotBeABaseURL?a[0]:a.length?"/"+M(a,"/"):"",null!==s&&(d+="?"+s),null!==l&&(d+="#"+l),d},setHref:function(e){var t=this.parse(e);if(t)throw new C(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new Fe(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+ae(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(g(e)+":",_e)},getUsername:function(){return this.username},setUsername:function(e){var t=f(g(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var i=0;i<t.length;i++)this.username+=ue(t[i],ce)}},getPassword:function(){return this.password},setPassword:function(e){var t=f(g(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var i=0;i<t.length;i++)this.password+=ue(t[i],ce)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ae(e):ae(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,ke)},getHostname:function(){var e=this.host;return null===e?"":ae(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Re)},getPort:function(){var e=this.port;return null===e?"":g(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=g(e))?this.port=null:this.parse(e,Oe))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+M(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Ie))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=g(e))?this.query=null:("?"===L(e,0)&&(e=j(e,1)),this.query="",this.parse(e,Me)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=g(e))?("#"===L(e,0)&&(e=j(e,1)),this.fragment="",this.parse(e,Pe)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Fe=function(e){var t=h(this,Ne),i=b(arguments.length,1)>1?arguments[1]:void 0,r=w(t,new Ue(e,!1,i));o||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},Ne=Fe.prototype,Ve=function(e,t){return{get:function(){return T(this)[e]()},set:t&&function(e){return T(this)[t](e)},configurable:!0,enumerable:!0}};if(o&&(u(Ne,"href",Ve("serialize","setHref")),u(Ne,"origin",Ve("getOrigin")),u(Ne,"protocol",Ve("getProtocol","setProtocol")),u(Ne,"username",Ve("getUsername","setUsername")),u(Ne,"password",Ve("getPassword","setPassword")),u(Ne,"host",Ve("getHost","setHost")),u(Ne,"hostname",Ve("getHostname","setHostname")),u(Ne,"port",Ve("getPort","setPort")),u(Ne,"pathname",Ve("getPathname","setPathname")),u(Ne,"search",Ve("getSearch","setSearch")),u(Ne,"searchParams",Ve("getSearchParams")),u(Ne,"hash",Ve("getHash","setHash"))),c(Ne,"toJSON",(function(){return T(this).serialize()}),{enumerable:!0}),c(Ne,"toString",(function(){return T(this).serialize()}),{enumerable:!0}),O){var Ge=O.createObjectURL,je=O.revokeObjectURL;Ge&&c(Fe,"createObjectURL",l(Ge,O)),je&&c(Fe,"revokeObjectURL",l(je,O))}y(Fe,"URL"),n({global:!0,constructor:!0,forced:!a,sham:!o},{URL:Fe})},4233:(e,t,i)=>{var r=i(6458),n=i(2809),o=i(9211),a=i(4347),s=i(9646),l=i(6656).CONFIGURABLE,d=i(3732),c=i(3587),u=c.enforce,h=c.get,A=String,p=Object.defineProperty,f=r("".slice),_=r("".replace),m=r([].join),v=s&&!n((function(){return 8!==p((function(){}),"length",{value:8}).length})),g=String(String).split("String"),y=e.exports=function(e,t,i){"Symbol("===f(A(t),0,7)&&(t="["+_(A(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!a(e,"name")||l&&e.name!==t)&&(s?p(e,"name",{value:t,configurable:!0}):e.name=t),v&&i&&a(i,"arity")&&e.length!==i.arity&&p(e,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?s&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=u(e);return a(r,"source")||(r.source=m(g,"string"==typeof t?t:"")),e};Function.prototype.toString=y((function(){return o(this)&&h(this).source||d(this)}),"toString")},4346:(e,t,i)=>{var r=i(2809),n=i(9211),o=/#|\.prototype\./,a=function(e,t){var i=l[s(e)];return i===c||i!==d&&(n(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=a.data={},d=a.NATIVE="N",c=a.POLYFILL="P";e.exports=a},4347:(e,t,i)=>{var r=i(6458),n=i(9083),o=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(n(e),t)}},4383:(e,t,i)=>{i.d(t,{Al:()=>o,Qn:()=>s,Xu:()=>l,j4:()=>a});var r,n=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=function(){function e(e){this.name="RuntimeException",this._message=e}return Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),a=function(e){function t(t){var i=e.call(this,t)||this;return i.name="IllegalStateException",i}return n(t,e),t}(o),s=function(e){function t(t){var i=e.call(this,t)||this;return i.name="InvalidArgumentException",i}return n(t,e),t}(o),l=function(e){function t(t){var i=e.call(this,t)||this;return i.name="NotImplementedException",i}return n(t,e),t}(o)},4417:(e,t,i)=>{var r=i(6458),n=i(4685),o=i(6677),a=i(5840),s=r("".charAt),l=r("".charCodeAt),d=r("".slice),c=function(e){return function(t,i){var r,c,u=o(a(t)),h=n(i),A=u.length;return h<0||h>=A?e?"":void 0:(r=l(u,h))<55296||r>56319||h+1===A||(c=l(u,h+1))<56320||c>57343?e?s(u,h):r:e?d(u,h,h+2):c-56320+(r-55296<<10)+65536}};e.exports={codeAt:c(!1),charAt:c(!0)}},4468:(e,t,i)=>{var r=i(1562),n=i(9211),o=r.WeakMap;e.exports=n(o)&&/native code/.test(String(o))},4478:(e,t,i)=>{var r=i(7042),n=i(815),o=i(9083),a=i(5957),s=i(2915),l=i(2671),d=i(256),c=i(8286),u=i(279),h=i(9273),A=Array;e.exports=function(e){var t=o(e),i=l(this),p=arguments.length,f=p>1?arguments[1]:void 0,_=void 0!==f;_&&(f=r(f,p>2?arguments[2]:void 0));var m,v,g,y,b,S,E=h(t),w=0;if(!E||this===A&&s(E))for(m=d(t),v=i?new this(m):A(m);m>w;w++)S=_?f(t[w],w):t[w],c(v,w,S);else for(v=i?new this:[],b=(y=u(t,E)).next;!(g=n(b,y)).done;w++)S=_?a(y,f,[g.value,w],!0):g.value,c(v,w,S);return v.length=w,v}},4579:(e,t,i)=>{var r=i(9364),n=i(6458),o=i(7024),a=RangeError,s=String.fromCharCode,l=String.fromCodePoint,d=n([].join);r({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(e){for(var t,i=[],r=arguments.length,n=0;r>n;){if(t=+arguments[n++],o(t,1114111)!==t)throw new a(t+" is not a valid code point");i[n]=t<65536?s(t):s(55296+((t-=65536)>>10),t%1024+56320)}return d(i,"")}})},4659:(e,t,i)=>{var r=i(9364),n=i(9646),o=i(3643).f;r({target:"Object",stat:!0,forced:Object.defineProperty!==o,sham:!n},{defineProperty:o})},4685:(e,t,i)=>{var r=i(9879);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},4715:(e,t,i)=>{var r=i(5057);e.exports=r("document","documentElement")},4742:(e,t,i)=>{var r=i(9364),n=i(1684).left,o=i(5888),a=i(4941);r({target:"Array",proto:!0,forced:!i(3479)&&a>79&&a<83||!o("reduce")},{reduce:function(e){var t=arguments.length;return n(this,e,t,t>1?arguments[1]:void 0)}})},4879:(e,t,i)=>{var r=i(1562),n=i(9402),o=i(62),a=i(2578),s=i(9277),l=i(1541),d=i(7553)("iterator"),c=a.values,u=function(e,t){if(e){if(e[d]!==c)try{s(e,d,c)}catch(t){e[d]=c}if(l(e,t,!0),n[t])for(var i in a)if(e[i]!==a[i])try{s(e,i,a[i])}catch(t){e[i]=a[i]}}};for(var h in n)u(r[h]&&r[h].prototype,h);u(o,"DOMTokenList")},4884:(e,t,i)=>{var r=i(526),n=i(2719),o=i(2630).f,a=i(8626),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"===r(e)?function(e){try{return o(e)}catch(e){return a(s)}}(e):o(n(e))}},4941:(e,t,i)=>{var r,n,o=i(1562),a=i(8053),s=o.process,l=o.Deno,d=s&&s.versions||l&&l.version,c=d&&d.v8;c&&(n=(r=c.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!n&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(n=+r[1]),e.exports=n},4955:(e,t,i)=>{var r=i(6458),n=2147483647,o=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",l=RangeError,d=r(a.exec),c=Math.floor,u=String.fromCharCode,h=r("".charCodeAt),A=r([].join),p=r([].push),f=r("".replace),_=r("".split),m=r("".toLowerCase),v=function(e){return e+22+75*(e<26)},g=function(e,t,i){var r=0;for(e=i?c(e/700):e>>1,e+=c(e/t);e>455;)e=c(e/35),r+=36;return c(r+36*e/(e+38))},y=function(e){var t=[];e=function(e){for(var t=[],i=0,r=e.length;i<r;){var n=h(e,i++);if(n>=55296&&n<=56319&&i<r){var o=h(e,i++);56320==(64512&o)?p(t,((1023&n)<<10)+(1023&o)+65536):(p(t,n),i--)}else p(t,n)}return t}(e);var i,r,o=e.length,a=128,d=0,f=72;for(i=0;i<e.length;i++)(r=e[i])<128&&p(t,u(r));var _=t.length,m=_;for(_&&p(t,"-");m<o;){var y=n;for(i=0;i<e.length;i++)(r=e[i])>=a&&r<y&&(y=r);var b=m+1;if(y-a>c((n-d)/b))throw new l(s);for(d+=(y-a)*b,a=y,i=0;i<e.length;i++){if((r=e[i])<a&&++d>n)throw new l(s);if(r===a){for(var S=d,E=36;;){var w=E<=f?1:E>=f+26?26:E-f;if(S<w)break;var T=S-w,k=36-w;p(t,u(v(w+T%k))),S=c(T/k),E+=36}p(t,u(v(S))),f=g(d,b,m===_),d=0,m++}}d++,a++}return A(t,"")};e.exports=function(e){var t,i,r=[],n=_(f(m(e),a,"."),".");for(t=0;t<n.length;t++)i=n[t],p(r,d(o,i)?"xn--"+y(i):i);return A(r,".")}},4979:(e,t,i)=>{var r=i(7042),n=i(6458),o=i(5273),a=i(9083),s=i(256),l=i(2807),d=n([].push),c=function(e){var t=1===e,i=2===e,n=3===e,c=4===e,u=6===e,h=7===e,A=5===e||u;return function(p,f,_,m){for(var v,g,y=a(p),b=o(y),S=s(b),E=r(f,_),w=0,T=m||l,k=t?T(p,S):i||h?T(p,0):void 0;S>w;w++)if((A||w in b)&&(g=E(v=b[w],w,y),e))if(t)k[w]=g;else if(g)switch(e){case 3:return!0;case 5:return v;case 6:return w;case 2:d(k,v)}else switch(e){case 4:return!1;case 7:d(k,v)}return u?-1:n||c?c:k}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},4985:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},5057:(e,t,i)=>{var r=i(1562),n=i(9211);e.exports=function(e,t){return arguments.length<2?(i=r[e],n(i)?i:void 0):r[e]&&r[e][t];var i}},5273:(e,t,i)=>{var r=i(6458),n=i(2809),o=i(526),a=Object,s=r("".split);e.exports=n((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===o(e)?s(e,""):a(e)}:a},5307:e=>{var t=Object.prototype.hasOwnProperty,i="~";function r(){}function n(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new n(r,o||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,r,n=[];if(0===this._eventsCount)return n;for(r in e=this._events)t.call(e,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},s.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,a=new Array(o);n<o;n++)a[n]=r[n].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,n,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,d,c=this._events[s],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,n),!0;case 5:return c.fn.call(c.context,t,r,n,o),!0;case 6:return c.fn.call(c.context,t,r,n,o,a),!0}for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c.fn.apply(c.context,l)}else{var h,A=c.length;for(d=0;d<A;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),u){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,r);break;case 4:c[d].fn.call(c[d].context,t,r,n);break;default:if(!l)for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c[d].fn.apply(c[d].context,l)}}return!0},s.prototype.on=function(e,t,i){return o(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return o(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,r,n){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||n&&!s.once||r&&s.context!==r||a(this,o);else{for(var l=0,d=[],c=s.length;l<c;l++)(s[l].fn!==t||n&&!s[l].once||r&&s[l].context!==r)&&d.push(s[l]);d.length?this._events[o]=1===d.length?d[0]:d:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s},5336:(e,t,i)=>{var r=i(9364),n=i(6458),o=i(5273),a=i(2719),s=i(5888),l=n([].join);r({target:"Array",proto:!0,forced:o!==Object||!s("join",",")},{join:function(e){return l(a(this),void 0===e?",":e)}})},5347:(e,t,i)=>{var r=i(9364),n=i(2377);r({target:"Array",proto:!0,forced:[].forEach!==n},{forEach:n})},5405:(e,t,i)=>{var r=i(9211),n=i(4152),o=i(6641);e.exports=function(e,t,i){var a,s;return o&&r(a=t.constructor)&&a!==i&&n(s=a.prototype)&&s!==i.prototype&&o(e,s),e}},5597:(e,t,i)=>{var r=i(9364),n=i(9377);r({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})},5599:e=>{e.exports=function(e){return null==e}},5716:(e,t,i)=>{var r=i(6458),n=i(9083),o=Math.floor,a=r("".charAt),s=r("".replace),l=r("".slice),d=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,i,r,u,h){var A=i+e.length,p=r.length,f=c;return void 0!==u&&(u=n(u),f=d),s(h,f,(function(n,s){var d;switch(a(s,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,i);case"'":return l(t,A);case"<":d=u[l(s,1,-1)];break;default:var c=+s;if(0===c)return n;if(c>p){var h=o(c/10);return 0===h?n:h<=p?void 0===r[h-1]?a(s,1):r[h-1]+a(s,1):n}d=r[c-1]}return void 0===d?"":d}))}},5727:(e,t,i)=>{var r=i(5057),n=i(9211),o=i(9615),a=i(9742),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return n(t)&&o(t.prototype,s(e))}},5736:(e,t,i)=>{var r=i(9211),n=i(4985),o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(n(e)+" is not a function")}},5758:(e,t,i)=>{var r=i(9364),n=i(4979).filter;r({target:"Array",proto:!0,forced:!i(8611)("filter")},{filter:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}})},5810:(e,t,i)=>{var r=i(526);e.exports=Array.isArray||function(e){return"Array"===r(e)}},5840:(e,t,i)=>{var r=i(5599),n=TypeError;e.exports=function(e){if(r(e))throw new n("Can't call method on "+e);return e}},5888:(e,t,i)=>{var r=i(2809);e.exports=function(e,t){var i=[][e];return!!i&&r((function(){i.call(null,t||function(){return 1},1)}))}},5957:(e,t,i)=>{var r=i(7749),n=i(8401);e.exports=function(e,t,i,o){try{return o?t(r(i)[0],i[1]):t(i)}catch(t){n(e,"throw",t)}}},5993:(e,t,i)=>{var r=i(1562),n=i(8053),o=i(526),a=function(e){return n.slice(0,e.length)===e};e.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":r.Bun&&"string"==typeof Bun.version?"BUN":r.Deno&&"object"==typeof Deno.version?"DENO":"process"===o(r.process)?"NODE":r.window&&r.document?"BROWSER":"REST"},6033:(e,t,i)=>{var r=i(1562);i(1541)(r.JSON,"JSON",!0)},6041:(e,t,i)=>{i(7267),i(804),i(1766),i(3992),i(947)},6071:(e,t,i)=>{var r=i(9646),n=i(2809),o=i(1465);e.exports=!r&&!n((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},6122:(e,t,i)=>{var r,n=i(7749),o=i(7815),a=i(6853),s=i(7923),l=i(4715),d=i(1465),c=i(577),u="prototype",h="script",A=c("IE_PROTO"),p=function(){},f=function(e){return"<"+h+">"+e+"</"+h+">"},_=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},m=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,i;m="undefined"!=typeof document?document.domain&&r?_(r):(t=d("iframe"),i="java"+h+":",t.style.display="none",l.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):_(r);for(var n=a.length;n--;)delete m[u][a[n]];return m()};s[A]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(p[u]=n(e),i=new p,p[u]=null,i[A]=e):i=m(),void 0===t?i:o.f(i,t)}},6263:(e,t,i)=>{var r=i(6656).PROPER,n=i(3930),o=i(7749),a=i(6677),s=i(2809),l=i(1144),d="toString",c=RegExp.prototype,u=c[d],h=s((function(){return"/a/b"!==u.call({source:"a",flags:"b"})})),A=r&&u.name!==d;(h||A)&&n(c,d,(function(){var e=o(this);return"/"+a(e.source)+"/"+a(l(e))}),{unsafe:!0})},6285:(e,t,i)=>{var r=i(1562);e.exports=r},6288:(e,t,i)=>{var r=i(2809),n=i(1562).RegExp;e.exports=r((function(){var e=n("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},6330:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6383:(e,t,i)=>{var r=i(9364),n=i(1562);r({global:!0,forced:n.globalThis!==n},{globalThis:n})},6399:(e,t,i)=>{i.d(t,{A:()=>r});const r={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},6458:(e,t,i)=>{var r=i(6898),n=Function.prototype,o=n.call,a=r&&n.bind.bind(o,o);e.exports=r?a:function(e){return function(){return o.apply(e,arguments)}}},6641:(e,t,i)=>{var r=i(1432),n=i(4152),o=i(5840),a=i(1068);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=r(Object.prototype,"__proto__","set"))(i,[]),t=i instanceof Array}catch(e){}return function(i,r){return o(i),a(r),n(i)?(t?e(i,r):i.__proto__=r,i):i}}():void 0)},6656:(e,t,i)=>{var r=i(9646),n=i(4347),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=n(o,"name"),l=s&&"something"===function(){}.name,d=s&&(!r||r&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:d}},6666:(e,t,i)=>{var r=i(2809),n=i(7553),o=i(9646),a=i(9845),s=n("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,i=new URLSearchParams("a=1&a=2&b=3"),r="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),r+=i+e})),i.delete("a",2),i.delete("b",void 0),a&&(!e.toJSON||!i.has("a",1)||i.has("a",2)||!i.has("a",void 0)||i.has("b"))||!t.size&&(a||!o)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==r||"x"!==new URL("https://x",void 0).host}))},6677:(e,t,i)=>{var r=i(497),n=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}},6728:(e,t,i)=>{var r=i(815),n=i(9518),o=i(7749),a=i(5599),s=i(2420),l=i(6677),d=i(5840),c=i(452),u=i(9987),h=i(9260);n("match",(function(e,t,i){return[function(t){var i=d(this),n=a(t)?void 0:c(t,e);return n?r(n,t,i):new RegExp(t)[e](l(i))},function(e){var r=o(this),n=l(e),a=i(t,r,n);if(a.done)return a.value;if(!r.global)return h(r,n);var d=r.unicode;r.lastIndex=0;for(var c,A=[],p=0;null!==(c=h(r,n));){var f=l(c[0]);A[p]=f,""===f&&(r.lastIndex=u(n,s(r.lastIndex),d)),p++}return 0===p?null:A}]}))},6810:(e,t,i)=>{var r=i(4417).charAt,n=i(6677),o=i(3587),a=i(2382),s=i(1567),l="String Iterator",d=o.set,c=o.getterFor(l);a(String,"String",(function(e){d(this,{type:l,string:n(e),index:0})}),(function(){var e,t=c(this),i=t.string,n=t.index;return n>=i.length?s(void 0,!0):(e=r(i,n),t.index+=e.length,s(e,!1))}))},6815:(e,t,i)=>{var r=i(5057),n=i(7225),o=i(1541);n("toStringTag"),o(r("Symbol"),"Symbol")},6853:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6898:(e,t,i)=>{var r=i(2809);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},6908:(e,t,i)=>{var r=i(815),n=i(9211),o=i(4152),a=TypeError;e.exports=function(e,t){var i,s;if("string"===t&&n(i=e.toString)&&!o(s=r(i,e)))return s;if(n(i=e.valueOf)&&!o(s=r(i,e)))return s;if("string"!==t&&n(i=e.toString)&&!o(s=r(i,e)))return s;throw new a("Can't convert object to primitive value")}},7024:(e,t,i)=>{var r=i(4685),n=Math.max,o=Math.min;e.exports=function(e,t){var i=r(e);return i<0?n(i+t,0):o(i,t)}},7042:(e,t,i)=>{var r=i(458),n=i(5736),o=i(6898),a=r(r.bind);e.exports=function(e,t){return n(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},7225:(e,t,i)=>{var r=i(6285),n=i(4347),o=i(605),a=i(3643).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});n(t,e)||a(t,e,{value:o.f(e)})}},7267:(e,t,i)=>{var r=i(9364),n=i(1562),o=i(815),a=i(6458),s=i(9845),l=i(9646),d=i(7917),c=i(2809),u=i(4347),h=i(9615),A=i(7749),p=i(2719),f=i(4151),_=i(6677),m=i(6330),v=i(6122),g=i(7642),y=i(2630),b=i(4884),S=i(7819),E=i(2897),w=i(3643),T=i(7815),k=i(7403),R=i(3930),O=i(1176),C=i(3463),B=i(577),x=i(7923),I=i(1002),L=i(7553),D=i(605),M=i(7225),P=i(4160),U=i(1541),F=i(3587),N=i(4979).forEach,V=B("hidden"),G="Symbol",j="prototype",$=F.set,W=F.getterFor(G),Q=Object[j],z=n.Symbol,H=z&&z[j],q=n.RangeError,Y=n.TypeError,X=n.QObject,Z=E.f,K=w.f,J=b.f,ee=k.f,te=a([].push),ie=C("symbols"),re=C("op-symbols"),ne=C("wks"),oe=!X||!X[j]||!X[j].findChild,ae=function(e,t,i){var r=Z(Q,t);r&&delete Q[t],K(e,t,i),r&&e!==Q&&K(Q,t,r)},se=l&&c((function(){return 7!==v(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?ae:K,le=function(e,t){var i=ie[e]=v(H);return $(i,{type:G,tag:e,description:t}),l||(i.description=t),i},de=function(e,t,i){e===Q&&de(re,t,i),A(e);var r=f(t);return A(i),u(ie,r)?(i.enumerable?(u(e,V)&&e[V][r]&&(e[V][r]=!1),i=v(i,{enumerable:m(0,!1)})):(u(e,V)||K(e,V,m(1,v(null))),e[V][r]=!0),se(e,r,i)):K(e,r,i)},ce=function(e,t){A(e);var i=p(t),r=g(i).concat(pe(i));return N(r,(function(t){l&&!o(ue,i,t)||de(e,t,i[t])})),e},ue=function(e){var t=f(e),i=o(ee,this,t);return!(this===Q&&u(ie,t)&&!u(re,t))&&(!(i||!u(this,t)||!u(ie,t)||u(this,V)&&this[V][t])||i)},he=function(e,t){var i=p(e),r=f(t);if(i!==Q||!u(ie,r)||u(re,r)){var n=Z(i,r);return!n||!u(ie,r)||u(i,V)&&i[V][r]||(n.enumerable=!0),n}},Ae=function(e){var t=J(p(e)),i=[];return N(t,(function(e){u(ie,e)||u(x,e)||te(i,e)})),i},pe=function(e){var t=e===Q,i=J(t?re:p(e)),r=[];return N(i,(function(e){!u(ie,e)||t&&!u(Q,e)||te(r,ie[e])})),r};d||(R(H=(z=function(){if(h(H,this))throw new Y("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?_(arguments[0]):void 0,t=I(e),i=function(e){var r=void 0===this?n:this;r===Q&&o(i,re,e),u(r,V)&&u(r[V],t)&&(r[V][t]=!1);var a=m(1,e);try{se(r,t,a)}catch(e){if(!(e instanceof q))throw e;ae(r,t,a)}};return l&&oe&&se(Q,t,{configurable:!0,set:i}),le(t,e)})[j],"toString",(function(){return W(this).tag})),R(z,"withoutSetter",(function(e){return le(I(e),e)})),k.f=ue,w.f=de,T.f=ce,E.f=he,y.f=b.f=Ae,S.f=pe,D.f=function(e){return le(L(e),e)},l&&(O(H,"description",{configurable:!0,get:function(){return W(this).description}}),s||R(Q,"propertyIsEnumerable",ue,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!d,sham:!d},{Symbol:z}),N(g(ne),(function(e){M(e)})),r({target:G,stat:!0,forced:!d},{useSetter:function(){oe=!0},useSimple:function(){oe=!1}}),r({target:"Object",stat:!0,forced:!d,sham:!l},{create:function(e,t){return void 0===t?v(e):ce(v(e),t)},defineProperty:de,defineProperties:ce,getOwnPropertyDescriptor:he}),r({target:"Object",stat:!0,forced:!d},{getOwnPropertyNames:Ae}),P(),U(z,G),x[V]=!0},7403:(e,t)=>{var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,n=r&&!i.call({1:2},1);t.f=n?function(e){var t=r(this,e);return!!t&&t.enumerable}:i},7477:(e,t,i)=>{var r=i(8635),n=i(9953),o=i(550),a=null,s=function(e,t){self.postMessage({msg:"logcat_callback",data:{type:e,logcat:t}})};function l(e,t){var i={msg:o.A.INIT_SEGMENT,data:{type:e,data:t}};self.postMessage(i,[t.data])}function d(e,t){var i={msg:o.A.MEDIA_SEGMENT,data:{type:e,data:t}};self.postMessage(i,[t.data])}function c(){var e={msg:o.A.LOADING_COMPLETE};self.postMessage(e)}function u(){var e={msg:o.A.RECOVERED_EARLY_EOF};self.postMessage(e)}function h(e){var t={msg:o.A.MEDIA_INFO,data:e};self.postMessage(t)}function A(e){var t={msg:o.A.METADATA_ARRIVED,data:e};self.postMessage(t)}function p(e){var t={msg:o.A.SCRIPTDATA_ARRIVED,data:e};self.postMessage(t)}function f(e){var t={msg:o.A.TIMED_ID3_METADATA_ARRIVED,data:e};self.postMessage(t)}function _(e){var t={msg:o.A.SMPTE2038_METADATA_ARRIVED,data:e};self.postMessage(t)}function m(e){var t={msg:o.A.SCTE35_METADATA_ARRIVED,data:e};self.postMessage(t)}function v(e){var t={msg:o.A.PES_PRIVATE_DATA_DESCRIPTOR,data:e};self.postMessage(t)}function g(e){var t={msg:o.A.PES_PRIVATE_DATA_ARRIVED,data:e};self.postMessage(t)}function y(e){var t={msg:o.A.STATISTICS_INFO,data:e};self.postMessage(t)}function b(e,t){self.postMessage({msg:o.A.IO_ERROR,data:{type:e,info:t}})}function S(e,t){self.postMessage({msg:o.A.DEMUX_ERROR,data:{type:e,info:t}})}function E(e){self.postMessage({msg:o.A.RECOMMEND_SEEKPOINT,data:e})}self.addEventListener("message",(function(e){switch(e.data.cmd){case"init":(a=new n.A(e.data.param[0],e.data.param[1])).on(o.A.IO_ERROR,b),a.on(o.A.DEMUX_ERROR,S),a.on(o.A.INIT_SEGMENT,l),a.on(o.A.MEDIA_SEGMENT,d),a.on(o.A.LOADING_COMPLETE,c),a.on(o.A.RECOVERED_EARLY_EOF,u),a.on(o.A.MEDIA_INFO,h),a.on(o.A.METADATA_ARRIVED,A),a.on(o.A.SCRIPTDATA_ARRIVED,p),a.on(o.A.TIMED_ID3_METADATA_ARRIVED,f),a.on(o.A.SMPTE2038_METADATA_ARRIVED,_),a.on(o.A.SCTE35_METADATA_ARRIVED,m),a.on(o.A.PES_PRIVATE_DATA_DESCRIPTOR,v),a.on(o.A.PES_PRIVATE_DATA_ARRIVED,g),a.on(o.A.STATISTICS_INFO,y),a.on(o.A.RECOMMEND_SEEKPOINT,E);break;case"destroy":a&&(a.destroy(),a=null),self.postMessage({msg:"destroyed"});break;case"start":null==a||a.start();break;case"stop":null==a||a.stop();break;case"seek":null==a||a.seek(e.data.param);break;case"pause":null==a||a.pause();break;case"resume":null==a||a.resume();break;case"logging_config":var t=e.data.param;r.A.applyConfig(t),!0===t.enableCallback?r.A.addLogListener(s):r.A.removeLogListener(s)}}))},7478:(e,t,i)=>{var r=i(4347),n=i(1209),o=i(2897),a=i(3643);e.exports=function(e,t,i){for(var s=n(t),l=a.f,d=o.f,c=0;c<s.length;c++){var u=s[c];r(e,u)||i&&r(i,u)||l(e,u,d(t,u))}}},7517:(e,t,i)=>{var r=i(2809),n=i(1562).RegExp;e.exports=r((function(){var e=n(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},7553:(e,t,i)=>{var r=i(1562),n=i(3463),o=i(4347),a=i(1002),s=i(7917),l=i(9742),d=r.Symbol,c=n("wks"),u=l?d.for||d:d&&d.withoutSetter||a;e.exports=function(e){return o(c,e)||(c[e]=s&&o(d,e)?d[e]:u("Symbol."+e)),c[e]}},7642:(e,t,i)=>{var r=i(3430),n=i(6853);e.exports=Object.keys||function(e){return r(e,n)}},7677:(e,t,i)=>{var r=i(7749);e.exports=function(){var e=r(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}},7712:(e,t,i)=>{var r=i(1147).IteratorPrototype,n=i(6122),o=i(6330),a=i(1541),s=i(2327),l=function(){return this};e.exports=function(e,t,i,d){var c=t+" Iterator";return e.prototype=n(r,{next:o(+!d,i)}),a(e,c,!1,!0),s[c]=l,e}},7749:(e,t,i)=>{var r=i(4152),n=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(n(e)+" is not an object")}},7815:(e,t,i)=>{var r=i(9646),n=i(2792),o=i(3643),a=i(7749),s=i(2719),l=i(7642);t.f=r&&!n?Object.defineProperties:function(e,t){a(e);for(var i,r=s(t),n=l(t),d=n.length,c=0;d>c;)o.f(e,i=n[c++],r[i]);return e}},7819:(e,t)=>{t.f=Object.getOwnPropertySymbols},7917:(e,t,i)=>{var r=i(4941),n=i(2809),o=i(1562).String;e.exports=!!Object.getOwnPropertySymbols&&!n((function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},7923:e=>{e.exports={}},7955:e=>{var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},7958:(e,t,i)=>{var r=i(8891),n=i(815),o=i(6458),a=i(9518),s=i(2809),l=i(7749),d=i(9211),c=i(5599),u=i(4685),h=i(2420),A=i(6677),p=i(5840),f=i(9987),_=i(452),m=i(5716),v=i(9260),g=i(7553)("replace"),y=Math.max,b=Math.min,S=o([].concat),E=o([].push),w=o("".indexOf),T=o("".slice),k="$0"==="a".replace(/./,"$0"),R=!!/./[g]&&""===/./[g]("a","$0");a("replace",(function(e,t,i){var o=R?"$":"$0";return[function(e,i){var r=p(this),o=c(e)?void 0:_(e,g);return o?n(o,e,r,i):n(t,A(r),e,i)},function(e,n){var a=l(this),s=A(e);if("string"==typeof n&&-1===w(n,o)&&-1===w(n,"$<")){var c=i(t,a,s,n);if(c.done)return c.value}var p=d(n);p||(n=A(n));var _,g=a.global;g&&(_=a.unicode,a.lastIndex=0);for(var k,R=[];null!==(k=v(a,s))&&(E(R,k),g);)""===A(k[0])&&(a.lastIndex=f(s,h(a.lastIndex),_));for(var O,C="",B=0,x=0;x<R.length;x++){for(var I,L=A((k=R[x])[0]),D=y(b(u(k.index),s.length),0),M=[],P=1;P<k.length;P++)E(M,void 0===(O=k[P])?O:String(O));var U=k.groups;if(p){var F=S([L],M,D,s);void 0!==U&&E(F,U),I=A(r(n,void 0,F))}else I=m(L,s,D,M,U,n);D>=B&&(C+=T(s,B,D)+I,B=D+L.length)}return C+T(s,B)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!k||R)},8053:(e,t,i)=>{var r=i(1562).navigator,n=r&&r.userAgent;e.exports=n?String(n):""},8098:(e,t,i)=>{i.d(t,{A:()=>g});var r=i(2460);const n=function(){function e(){var e;this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,(null===(e=self.performance)||void 0===e?void 0:e.now)?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0===e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}();var o,a=i(9034),s=i(8870),l=i(4383),d=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});const c=function(e){function t(t,i){var r=e.call(this,"fetch-stream-loader")||this;return r.TAG="FetchStreamLoader",r._seekHandler=t,r._config=i,r._needStash=!0,r._requestAbort=!1,r._abortController=null,r._contentLength=null,r._receivedLength=0,r}return d(t,e),t.isSupported=function(){var e;try{var t=s.A.msedge&&((null===(e=null===s.A||void 0===s.A?void 0:s.A.version)||void 0===e?void 0:e.minor)||0)>=15048&&!s.A.webkit,i=!s.A.msedge||t;return self.fetch&&self.ReadableStream&&i}catch(e){return!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){var i=this;this._dataSource=e,this._range=t;var r=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(r=e.redirectedURL);var n=this._seekHandler.getConfig(r,t),o=new self.Headers;if("object"==typeof n.headers){var s=n.headers;for(var d in s)s.hasOwnProperty(d)&&o.append(d,s[d])}var c={method:"GET",headers:o,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var d in this._config.headers)o.append(d,this._config.headers[d]);e.cors||(c.mode="same-origin"),e.withCredentials&&(c.credentials="include"),(null==e?void 0:e.referrerPolicy)&&(c.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,this._abortController&&(c.signal=this._abortController.signal)),this._status=a.eO.kConnecting,self.fetch(n.url,c).then((function(e){var t,r;if(i._requestAbort)return i._status=a.eO.kIdle,void(null===(t=e.body)||void 0===t||t.cancel());if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==n.url&&i._onURLRedirect){var o=i._seekHandler.removeURLParameters(e.url);i._onURLRedirect(o)}var s=e.headers.get("Content-Length");return null!=s&&(i._contentLength=parseInt(s),0!==i._contentLength&&i._onContentLengthKnown&&i._onContentLengthKnown(i._contentLength)),i._pump.call(i,null===(r=e.body)||void 0===r?void 0:r.getReader())}if(i._status=a.eO.kError,!i._onError)throw new l.Al("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);i._onError(a.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){var t;if(!(null===(t=i._abortController)||void 0===t?void 0:t.signal.aborted)){if(i._status=a.eO.kError,!i._onError)throw e;i._onError(a.Xv.EXCEPTION,{code:-1,msg:e.message})}}))},t.prototype.abort=function(){var e;if(this._requestAbort=!0,(this._status!==a.eO.kBuffering||!s.A.chrome)&&this._abortController)try{null===(e=this._abortController)||void 0===e||e.abort()}catch(e){}},t.prototype._pump=function(e){var t=this;return e.read().then((function(i){var r,n,o,s;if(i.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=a.eO.kError;var d=a.Xv.EARLY_EOF,c={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new l.Al(c.msg);t._onError(d,c)}else t._status=a.eO.kComplete,t._onComplete&&t._onComplete((null===(r=t._range)||void 0===r?void 0:r.from)||0,((null===(n=t._range)||void 0===n?void 0:n.from)||0)+t._receivedLength-1);else{if(null===(o=t._abortController)||void 0===o?void 0:o.signal.aborted)return void(t._status=a.eO.kComplete);if(t._requestAbort)return t._status=a.eO.kComplete,e.cancel();t._status=a.eO.kBuffering;var u=i.value.buffer,h=((null===(s=t._range)||void 0===s?void 0:s.from)||0)+t._receivedLength;t._receivedLength+=u.byteLength,t._onDataArrival&&t._onDataArrival(u,h,t._receivedLength),t._pump(e)}})).catch((function(e){var i,r;if(null===(r=null===(i=t._abortController)||void 0===i?void 0:i.signal)||void 0===r?void 0:r.aborted)t._status=a.eO.kComplete;else if(11!==e.code||!s.A.msedge){t._status=a.eO.kError;var n=0,o=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(n=a.Xv.EXCEPTION,o={code:e.code,msg:e.message}):(n=a.Xv.EARLY_EOF,o={code:e.code,msg:"Fetch stream meet Early-EOF"}),!t._onError)throw new l.Al(o.msg);t._onError(n,o)}}))},t}(a.HC);var u=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();const h=function(e){function t(t,i){var r=e.call(this,"xhr-moz-chunked-loader")||this;return r.TAG="MozChunkedLoader",r._seekHandler=t,r._config=i,r._needStash=!0,r._xhr=null,r._requestAbort=!1,r._contentLength=null,r._receivedLength=0,r}return u(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return r.A.w("MozChunkedLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(i=e.redirectedURL);var r=this._seekHandler.getConfig(i,t);this._requestURL=r.url;var n=this._xhr=new XMLHttpRequest;if(n.open("GET",r.url,!0),n.responseType="moz-chunked-arraybuffer",n.onreadystatechange=this._onReadyStateChange.bind(this),n.onprogress=this._onProgress.bind(this),n.onloadend=this._onLoadEnd.bind(this),n.onerror=this._onXhrError.bind(this),e.withCredentials&&(n.withCredentials=!0),"object"==typeof r.headers){var o=r.headers;for(var s in o)o.hasOwnProperty(s)&&n.setRequestHeader(s,o[s])}if("object"==typeof this._config.headers)for(var s in o=this._config.headers)o.hasOwnProperty(s)&&n.setRequestHeader(s,o[s]);this._status=a.eO.kConnecting,n.send()},t.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=a.eO.kComplete},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(void 0!==t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var i=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(i)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=a.eO.kError,!this._onError)throw new l.Al("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(a.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=a.eO.kBuffering}},t.prototype._onProgress=function(e){var t;if(this._status!==a.eO.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var i=e.target.response,r=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,r,this._receivedLength)}},t.prototype._onLoadEnd=function(e){this._requestAbort?this._requestAbort=!1:this._status!==a.eO.kError&&(this._status=a.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))},t.prototype._onXhrError=function(e){this._status=a.eO.kError;var t=0,i=null;if(this._contentLength&&e.loaded<this._contentLength?(t=a.Xv.EARLY_EOF,i={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=a.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new l.Al(i.msg);this._onError(t,i)},t}(a.HC);var A=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();const p=function(e){function t(t,i){var r=e.call(this,"xhr-range-loader")||this;return r.TAG="RangeLoader",r._seekHandler=t,r._config=i,r._needStash=!1,r._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],r._currentChunkSizeKB=384,r._currentSpeedNormalized=0,r._zeroSpeedChunkCount=0,r._xhr=null,r._speedSampler=new n,r._requestAbort=!1,r._waitForTotalLength=!1,r._totalLengthReceived=!1,r._currentRequestURL=null,r._currentRedirectedURL=null,r._currentRequestRange=null,r._totalLength=null,r._contentLength=null,r._receivedLength=0,r._lastTimeLoaded=0,r}return A(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return r.A.w("RangeLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},Object.defineProperty(t.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),t.prototype.open=function(e,t){this._dataSource=e,this._range=t,this._status=a.eO.kConnecting;var i=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(i=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||i?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))},t.prototype._openSubRange=function(){var e,t,i=1024*this._currentChunkSizeKB,r=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._receivedLength,n=r+i;null!=this._contentLength&&n-this._range.from>=this._contentLength&&(n=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._contentLength-1),this._currentRequestRange={from:r,to:n},this._internalOpen(this._dataSource,this._currentRequestRange)},t.prototype._internalOpen=function(e,t){this._lastTimeLoaded=0;var i=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?i=this._currentRedirectedURL:null!=e.redirectedURL&&(i=e.redirectedURL));var r=this._seekHandler.getConfig(i,t);this._currentRequestURL=r.url;var n=this._xhr=new XMLHttpRequest;if(n.open("GET",r.url,!0),n.responseType="arraybuffer",n.onreadystatechange=this._onReadyStateChange.bind(this),n.onprogress=this._onProgress.bind(this),n.onload=this._onLoad.bind(this),n.onerror=this._onXhrError.bind(this),e.withCredentials&&(n.withCredentials=!0),"object"==typeof r.headers){var o=r.headers;for(var a in o)o.hasOwnProperty(a)&&n.setRequestHeader(a,o[a])}if("object"==typeof this._config.headers)for(var a in o=this._config.headers)o.hasOwnProperty(a)&&n.setRequestHeader(a,o[a]);n.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=a.eO.kComplete},t.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var i=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&i!==this._currentRedirectedURL&&(this._currentRedirectedURL=i,this._onURLRedirect&&this._onURLRedirect(i))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=a.eO.kBuffering}else{if(this._status=a.eO.kError,!this._onError)throw new l.Al("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(a.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==a.eO.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var i=e.total;this._internalAbort(),null!=i&&0!==i&&(this._totalLength=i)}if(-1===this._range.to?this._contentLength=(this._totalLength||0)-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var r=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(r)}},t.prototype._normalizeSpeed=function(e){var t=this._chunkSizeKBList,i=t.length-1,r=0,n=0,o=i;if(e<t[0])return t[0];for(;n<=o;){if((r=n+Math.floor((o-n)/2))===i||e>=t[r]&&e<t[r+1])return t[r];t[r]<e?n=r+1:o=r-1}},t.prototype._onLoad=function(e){if(this._status!==a.eO.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),0!==t){var i=this._normalizeSpeed(t);this._currentSpeedNormalized!==i&&(this._currentSpeedNormalized=i,this._currentChunkSizeKB=i)}var r=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=r.byteLength;var o=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():o=!0,this._onDataArrival&&this._onDataArrival(r,n,this._receivedLength),o&&(this._status=a.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},t.prototype._onXhrError=function(e){this._status=a.eO.kError;var t=0,i=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=a.Xv.EARLY_EOF,i={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=a.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new l.Al(i.msg);this._onError(t,i)},t}(a.HC);var f=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();const _=function(e){function t(t,i){var r=e.call(this,"websocket-loader")||this;return r.TAG="WebSocketLoader",r._needStash=!0,r._ws=null,r._requestAbort=!1,r._receivedLength=0,r}return f(t,e),t.isSupported=function(){try{return void 0!==self.WebSocket}catch(e){return!1}},t.prototype.destroy=function(){this._ws&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=a.eO.kConnecting}catch(e){this._status=a.eO.kError;var i={code:e.code,msg:e.message};if(!this._onError)throw new l.Al(i.msg);this._onError(a.Xv.EXCEPTION,i)}},t.prototype.abort=function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=a.eO.kComplete},t.prototype._onWebSocketOpen=function(e){this._status=a.eO.kBuffering},t.prototype._onWebSocketClose=function(e){this._requestAbort?this._requestAbort=!1:(this._status=a.eO.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1))},t.prototype._onWebSocketMessage=function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var i=new FileReader;i.onload=function(){t._dispatchArrayBuffer(null==i?void 0:i.result)},i.readAsArrayBuffer(e.data)}else{this._status=a.eO.kError;var r={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new l.Al(r.msg);this._onError(a.Xv.EXCEPTION,r)}},t.prototype._dispatchArrayBuffer=function(e){var t=e,i=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)},t.prototype._onWebSocketError=function(e){this._status=a.eO.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new l.Al(t.msg);this._onError(a.Xv.EXCEPTION,t)},t}(a.HC),m=function(){function e(e){this._zeroStart=e||!1}return e.prototype.getConfig=function(e,t){var i,r={};return 0!==t.from||-1!==t.to?(i=-1!==t.to?"bytes=".concat(t.from.toString(),"-").concat(t.to.toString()):"bytes=".concat(t.from.toString(),"-"),r.Range=i):this._zeroStart&&(r.Range="bytes=0-"),{url:e,headers:r}},e.prototype.removeURLParameters=function(e){return e},e}(),v=function(){function e(e,t){this._startName=e,this._endName=t}return e.prototype.getConfig=function(e,t){var i=e;if(0!==t.from||-1!==t.to){var r=!0;i.includes("?")||(i+="?",r=!1),r&&(i+="&"),i+="".concat(this._startName,"=").concat(t.from.toString()),-1!==t.to&&(i+="&".concat(this._endName,"=").concat(t.to.toString()))}return{url:i,headers:{}}},e.prototype.removeURLParameters=function(e){var t,i=e.split("?")[0],r=e.indexOf("?");-1!==r&&(t=e.substring(r+1));var n="";if(void 0!==t&&t.length>0)for(var o=t.split("&"),a=0;a<o.length;a++){var s=o[a].split("="),l=a>0;s[0]!==this._startName&&s[0]!==this._endName&&(l&&(n+="&"),n+=o[a])}return 0===n.length?i:i+"?"+n},e}(),g=function(){function e(e,t,i){this.TAG="IOController",this._config=t,this._extraData=i,this._stashInitialSize=65536,void 0!==t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,t.enableStashBuffer||(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url||""),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new n,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return e.prototype.destroy=function(){var e,t,i;(null===(e=this._loader)||void 0===e?void 0:e.isWorking())&&(null===(t=this._loader)||void 0===t||t.abort()),null===(i=this._loader)||void 0===i||i.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},e.prototype.isWorking=function(){var e;return(null===(e=this._loader)||void 0===e?void 0:e.isWorking())&&!this._paused},e.prototype.isPaused=function(){return this._paused},Object.defineProperty(e.prototype,"status",{get:function(){var e;return null===(e=this._loader)||void 0===e?void 0:e.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){var e;return null===(e=this._dataSource)||void 0===e?void 0:e.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){var e;return null!=this._redirectedURL||void 0!==(null===(e=this._dataSource)||void 0===e?void 0:e.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){var e;return this._redirectedURL||(null===(e=this._dataSource)||void 0===e?void 0:e.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){var e,t;return this._loaderClass===p?null===(e=this._loader)||void 0===e?void 0:e.currentSpeed:null===(t=this._speedSampler)||void 0===t?void 0:t.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){var e;return null===(e=this._loader)||void 0===e?void 0:e.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new m(!!this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new v(t,i)}else{if("custom"!==e.seekType)throw new l.Qn("Invalid seekType in config: ".concat((null==e?void 0:e.seekType)||""));if("function"!=typeof e.customSeekHandler)throw new l.Qn("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}},e.prototype._selectLoader=function(){var e;if(null!=this._config.customLoader)this._loaderClass=(null===(e=this._config)||void 0===e?void 0:e.customLoader)||null;else if(this._isWebSocketURL)this._loaderClass=_;else if(c.isSupported())this._loaderClass=c;else if(h.isSupported())this._loaderClass=h;else{if(!p.isSupported())throw new l.Al("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=p}},e.prototype._createLoader=function(){var e;this._loaderClass&&(this._loader=new this._loaderClass(this._seekHandler,this._config),(null===(e=this._loader)||void 0===e?void 0:e.needStashBuffer)||(this._enableStash=!1),this._loader&&(this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)))},e.prototype.open=function(e){var t,i;this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),null===(t=this._speedSampler)||void 0===t||t.reset(),e||(this._fullRequestFlag=!0),null===(i=this._loader)||void 0===i||i.open(this._dataSource,Object.assign({},this._currentRange))},e.prototype.abort=function(){var e;null===(e=this._loader)||void 0===e||e.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},e.prototype.pause=function(){var e,t;this.isWorking()&&(null===(e=this._loader)||void 0===e||e.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange&&(this._currentRange.to=this._stashByteStart-1)):this._resumeFrom=((null===(t=this._currentRange)||void 0===t?void 0:t.to)||0)+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},e.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},e.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},e.prototype._internalSeek=function(e,t){var i,r,n,o;(null===(i=this._loader)||void 0===i?void 0:i.isWorking())&&(null===(r=this._loader)||void 0===r||r.abort()),this._flushStashBuffer(t),null===(n=this._loader)||void 0===n||n.destroy(),this._loader=null;var a={from:e,to:-1};this._currentRange={from:a.from,to:-1},null===(o=this._speedSampler)||void 0===o||o.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,a),this._onSeeked&&this._onSeeked()},e.prototype.updateUrl=function(e){if(!e||"string"!=typeof e||0===e.length)throw new l.Qn("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){for(var t=this._stashSize;t+1048576<e;)t*=2;if((t+=1048576)!==this._bufferSize){var i=new ArrayBuffer(t);if(this._stashUsed>0){var r=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(i,0,t).set(r,0)}this._stashBuffer=i,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,i=t.length-1,r=0,n=0,o=i;if(e<t[0])return t[0];for(;n<=o;){if((r=n+Math.floor((o-n)/2))===i||e>=t[r]&&e<t[r+1])return t[r];t[r]<e?n=r+1:o=r-1}},e.prototype._adjustStashSize=function(e){var t=0;(t=this._config.isLive?e/8:e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var i=1024*t+1048576;this._bufferSize<i&&this._expandBuffer(i),this._stashSize=1024*t},e.prototype._dispatchChunks=function(e,t){return this._currentRange&&(this._currentRange.to=t+e.byteLength-1),this._onDataArrival?this._onDataArrival(e,t):0},e.prototype._onURLRedirect=function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)},e.prototype._onContentLengthKnown=function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)},e.prototype._onLoaderChunkArrival=function(e,t,i){var r,n;if(!this._onDataArrival)throw new l.j4("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),null===(r=this._speedSampler)||void 0===r||r.addBytes(e.byteLength);var o=null===(n=this._speedSampler)||void 0===n?void 0:n.lastSecondKBps;if(0!==o){var a=this._normalizeSpeed(o);this._speedNormalized!==a&&(this._speedNormalized=a,this._adjustStashSize(a))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize)(c=new Uint8Array(this._stashBuffer,0,this._stashSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;else if(c=new Uint8Array(this._stashBuffer,0,this._bufferSize),this._stashUsed>0){var s=this._stashBuffer.slice(0,this._stashUsed);(u=this._dispatchChunks(s,this._stashByteStart))<s.byteLength?u>0&&(h=new Uint8Array(s,u),c.set(h,0),this._stashUsed=h.byteLength,this._stashByteStart+=u):(this._stashUsed=0,this._stashByteStart+=u),this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),c=new Uint8Array(this._stashBuffer,0,this._bufferSize)),c.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else(u=this._dispatchChunks(e,t))<e.byteLength&&((d=e.byteLength-u)>this._bufferSize&&(this._expandBuffer(d),c=new Uint8Array(this._stashBuffer,0,this._bufferSize)),c.set(new Uint8Array(e,u),0),this._stashUsed+=d,this._stashByteStart=t+u);else if(0===this._stashUsed){var d;(u=this._dispatchChunks(e,t))<e.byteLength&&((d=e.byteLength-u)>this._bufferSize&&this._expandBuffer(d),(c=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e,u),0),this._stashUsed+=d,this._stashByteStart=t+u)}else{var c,u;if(this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength),(c=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength,(u=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))<this._stashUsed&&u>0){var h=new Uint8Array(this._stashBuffer,u);c.set(h,0)}this._stashUsed-=u,this._stashByteStart+=u}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),n=t.byteLength-i;if(i<t.byteLength){if(!e){if(i>0){var o=new Uint8Array(this._stashBuffer,0,this._bufferSize),a=new Uint8Array(t,i);o.set(a,0),this._stashUsed=a.byteLength,this._stashByteStart+=i}return 0}r.A.w(this.TAG,"".concat(n," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,n}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){var i;switch(r.A.e(this.TAG,"Loader error, code = ".concat(t.code,", msg = ").concat(t.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=a.Xv.UNRECOVERABLE_EARLY_EOF),e){case a.Xv.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var n=((null===(i=this._currentRange)||void 0===i?void 0:i.to)||0)+1;return void(n<this._totalLength&&(r.A.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(n,!1)))}e=a.Xv.UNRECOVERABLE_EARLY_EOF;case a.Xv.UNRECOVERABLE_EARLY_EOF:case a.Xv.CONNECTING_TIMEOUT:case a.Xv.HTTP_STATUS_CODE_INVALID:case a.Xv.EXCEPTION:}if(!this._onError)throw new l.Al("IOException: "+t.msg);this._onError(e,t)},e}()},8125:(e,t,i)=>{var r=i(4347),n=i(9211),o=i(9083),a=i(577),s=i(8465),l=a("IE_PROTO"),d=Object,c=d.prototype;e.exports=s?d.getPrototypeOf:function(e){var t=o(e);if(r(t,l))return t[l];var i=t.constructor;return n(i)&&t instanceof i?i.prototype:t instanceof d?c:null}},8286:(e,t,i)=>{var r=i(9646),n=i(3643),o=i(6330);e.exports=function(e,t,i){r?n.f(e,t,o(0,i)):e[t]=i}},8401:(e,t,i)=>{var r=i(815),n=i(7749),o=i(452);e.exports=function(e,t,i){var a,s;n(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw i;return i}a=r(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw i;if(s)throw a;return n(a),i}},8465:(e,t,i)=>{var r=i(2809);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},8587:(e,t,i)=>{var r=i(2809),n=i(1562).RegExp,o=r((function(){var e=n("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=o||r((function(){return!n("a","y").sticky})),s=o||r((function(){var e=n("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},8611:(e,t,i)=>{var r=i(2809),n=i(7553),o=i(4941),a=n("species");e.exports=function(e){return o>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},8626:(e,t,i)=>{var r=i(6458);e.exports=r([].slice)},8635:(e,t,i)=>{i.d(t,{A:()=>o});var r=i(2139),n=i(2460);const o=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return n.A.FORCE_GLOBAL_TAG},set:function(t){n.A.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return n.A.GLOBAL_TAG},set:function(t){n.A.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return n.A.ENABLE_VERBOSE&&n.A.ENABLE_DEBUG&&n.A.ENABLE_INFO&&n.A.ENABLE_WARN&&n.A.ENABLE_ERROR},set:function(t){n.A.ENABLE_VERBOSE=t,n.A.ENABLE_DEBUG=t,n.A.ENABLE_INFO=t,n.A.ENABLE_WARN=t,n.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return n.A.ENABLE_DEBUG},set:function(t){n.A.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return n.A.ENABLE_VERBOSE},set:function(t){n.A.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return n.A.ENABLE_INFO},set:function(t){n.A.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return n.A.ENABLE_WARN},set:function(t){n.A.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return n.A.ENABLE_ERROR},set:function(t){n.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:n.A.GLOBAL_TAG,forceGlobalTag:n.A.FORCE_GLOBAL_TAG,enableVerbose:n.A.ENABLE_VERBOSE,enableDebug:n.A.ENABLE_DEBUG,enableInfo:n.A.ENABLE_INFO,enableWarn:n.A.ENABLE_WARN,enableError:n.A.ENABLE_ERROR,enableCallback:n.A.ENABLE_CALLBACK}},e.applyConfig=function(e){n.A.GLOBAL_TAG=e.globalTag,n.A.FORCE_GLOBAL_TAG=e.forceGlobalTag,n.A.ENABLE_VERBOSE=e.enableVerbose,n.A.ENABLE_DEBUG=e.enableDebug,n.A.ENABLE_INFO=e.enableInfo,n.A.ENABLE_WARN=e.enableWarn,n.A.ENABLE_ERROR=e.enableError,n.A.ENABLE_CALLBACK=!!e.enableCallback},e._notifyChange=function(){var t=e.emitter;if(t.listenerCount("change")>0){var i=e.getConfig();t.emit("change",i)}},e.registerListener=function(t){e.emitter.addListener("change",t)},e.removeListener=function(t){e.emitter.removeListener("change",t)},e.addLogListener=function(t){n.A.emitter.addListener("log",t),n.A.emitter.listenerCount("log")>0&&(n.A.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){n.A.emitter.removeListener("log",t),0===n.A.emitter.listenerCount("log")&&(n.A.ENABLE_CALLBACK=!1,e._notifyChange())},e.emitter=new r.A,e}()},8845:(e,t,i)=>{var r=i(9364),n=i(9646),o=i(1562),a=i(6458),s=i(4347),l=i(9211),d=i(9615),c=i(6677),u=i(1176),h=i(7478),A=o.Symbol,p=A&&A.prototype;if(n&&l(A)&&(!("description"in p)||void 0!==A().description)){var f={},_=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:c(arguments[0]),t=d(p,this)?new A(e):void 0===e?A():A(e);return""===e&&(f[t]=!0),t};h(_,A),_.prototype=p,p.constructor=_;var m="Symbol(description detection)"===String(A("description detection")),v=a(p.valueOf),g=a(p.toString),y=/^Symbol\((.*)\)[^)]+$/,b=a("".replace),S=a("".slice);u(p,"description",{configurable:!0,get:function(){var e=v(this);if(s(f,e))return"";var t=g(e),i=m?S(t,7,-1):b(t,y,"$1");return""===i?void 0:i}}),r({global:!0,constructor:!0,forced:!0},{Symbol:_})}},8862:(e,t,i)=>{var r=i(1562),n=i(9402),o=i(62),a=i(2377),s=i(9277),l=function(e){if(e&&e.forEach!==a)try{s(e,"forEach",a)}catch(t){e.forEach=a}};for(var d in n)n[d]&&l(r[d]&&r[d].prototype);l(o)},8870:(e,t,i)=>{i.d(t,{A:()=>n});var r={};!function(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.includes("trident")&&/(rv)(?::| )([\w.]+)/.exec(e)||!e.includes("compatible")&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],i=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],n={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},o={};if(n.browser){o[n.browser]=!0;var a=n.majorVersion.split(".");o.version={major:parseInt(n.majorVersion,10),string:n.version},a.length>1&&(o.version.minor=parseInt(a[1],10)),a.length>2&&(o.version.build=parseInt(a[2],10))}if(n.platform&&(o[n.platform]=!0),(o.chrome||o.opr||o.safari)&&(o.webkit=!0),o.rv||o.iemobile){o.rv&&delete o.rv;var s="msie";n.browser=s,o[s]=!0}if(o.edge){delete o.edge;var l="msedge";n.browser=l,o[l]=!0}if(o.opr){var d="opera";n.browser=d,o[d]=!0}if(o.safari&&o.android){var c="android";n.browser=c,o[c]=!0}for(var u in o.name=n.browser,o.platform=n.platform,r)Object.prototype.hasOwnProperty.call(r,u)&&delete r[u];Object.assign(r,o)}();const n=r},8873:(e,t,i)=>{var r=i(3930);e.exports=function(e,t,i){for(var n in t)r(e,n,t[n],i);return e}},8891:(e,t,i)=>{var r=i(6898),n=Function.prototype,o=n.apply,a=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},9034:(e,t,i)=>{i.d(t,{HC:()=>a,Xv:()=>o,eO:()=>n});var r=i(4383),n={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},o={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},a=function(){function e(e){this._type=e||"undefined",this._status=n.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return e.prototype.destroy=function(){this._status=n.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},e.prototype.isWorking=function(){return this._status===n.kConnecting||this._status===n.kBuffering},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),e.prototype.open=function(e,t){throw new r.Xu("Unimplemented abstract function!")},e.prototype.abort=function(){throw new r.Xu("Unimplemented abstract function!")},e}()},9047:(e,t,i)=>{var r=i(5810),n=i(2671),o=i(4152),a=i(7553)("species"),s=Array;e.exports=function(e){var t;return r(e)&&(t=e.constructor,(n(t)&&(t===s||r(t.prototype))||o(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?s:t}},9083:(e,t,i)=>{var r=i(5840),n=Object;e.exports=function(e){return n(r(e))}},9211:e=>{var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},9260:(e,t,i)=>{var r=i(815),n=i(7749),o=i(9211),a=i(526),s=i(9377),l=TypeError;e.exports=function(e,t){var i=e.exec;if(o(i)){var d=r(i,e,t);return null!==d&&n(d),d}if("RegExp"===a(e))return r(s,e,t);throw new l("RegExp#exec called on incompatible receiver")}},9266:(e,t,i)=>{var r=i(7917);e.exports=r&&!!Symbol.for&&!!Symbol.keyFor},9273:(e,t,i)=>{var r=i(497),n=i(452),o=i(5599),a=i(2327),s=i(7553)("iterator");e.exports=function(e){if(!o(e))return n(e,s)||n(e,"@@iterator")||a[r(e)]}},9277:(e,t,i)=>{var r=i(9646),n=i(3643),o=i(6330);e.exports=r?function(e,t,i){return n.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},9364:(e,t,i)=>{var r=i(1562),n=i(2897).f,o=i(9277),a=i(3930),s=i(4191),l=i(7478),d=i(4346);e.exports=function(e,t){var i,c,u,h,A,p=e.target,f=e.global,_=e.stat;if(i=f?r:_?r[p]||s(p,{}):r[p]&&r[p].prototype)for(c in t){if(h=t[c],u=e.dontCallGetSet?(A=n(i,c))&&A.value:i[c],!d(f?c:p+(_?".":"#")+c,e.forced)&&void 0!==u){if(typeof h==typeof u)continue;l(h,u)}(e.sham||u&&u.sham)&&o(h,"sham",!0),a(i,c,h,e)}}},9377:(e,t,i)=>{var r,n,o=i(815),a=i(6458),s=i(6677),l=i(7677),d=i(8587),c=i(3463),u=i(6122),h=i(3587).get,A=i(7517),p=i(6288),f=c("native-string-replace",String.prototype.replace),_=RegExp.prototype.exec,m=_,v=a("".charAt),g=a("".indexOf),y=a("".replace),b=a("".slice),S=(n=/b*/g,o(_,r=/a/,"a"),o(_,n,"a"),0!==r.lastIndex||0!==n.lastIndex),E=d.BROKEN_CARET,w=void 0!==/()??/.exec("")[1];(S||w||E||A||p)&&(m=function(e){var t,i,r,n,a,d,c,A=this,p=h(A),T=s(e),k=p.raw;if(k)return k.lastIndex=A.lastIndex,t=o(m,k,T),A.lastIndex=k.lastIndex,t;var R=p.groups,O=E&&A.sticky,C=o(l,A),B=A.source,x=0,I=T;if(O&&(C=y(C,"y",""),-1===g(C,"g")&&(C+="g"),I=b(T,A.lastIndex),A.lastIndex>0&&(!A.multiline||A.multiline&&"\n"!==v(T,A.lastIndex-1))&&(B="(?: "+B+")",I=" "+I,x++),i=new RegExp("^(?:"+B+")",C)),w&&(i=new RegExp("^"+B+"$(?!\\s)",C)),S&&(r=A.lastIndex),n=o(_,O?i:A,I),O?n?(n.input=b(n.input,x),n[0]=b(n[0],x),n.index=A.lastIndex,A.lastIndex+=n[0].length):A.lastIndex=0:S&&n&&(A.lastIndex=A.global?n.index+n[0].length:r),w&&n&&n.length>1&&o(f,n[0],i,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(n[a]=void 0)})),n&&R)for(n.groups=d=u(null),a=0;a<R.length;a++)d[(c=R[a])[0]]=n[c[1]];return n}),e.exports=m},9402:e=>{e.exports={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}},9518:(e,t,i)=>{i(5597);var r=i(815),n=i(3930),o=i(9377),a=i(2809),s=i(7553),l=i(9277),d=s("species"),c=RegExp.prototype;e.exports=function(e,t,i,u){var h=s(e),A=!a((function(){var t={};return t[h]=function(){return 7},7!==""[e](t)})),p=A&&!a((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[d]=function(){return i},i.flags="",i[h]=/./[h]),i.exec=function(){return t=!0,null},i[h](""),!t}));if(!A||!p||i){var f=/./[h],_=t(h,""[e],(function(e,t,i,n,a){var s=t.exec;return s===o||s===c.exec?A&&!a?{done:!0,value:r(f,t,i,n)}:{done:!0,value:r(e,i,t,n)}:{done:!1}}));n(String.prototype,e,_[0]),n(c,h,_[1])}u&&l(c[h],"sham",!0)}},9603:(e,t,i)=>{var r=i(5057),n=i(1176),o=i(7553),a=i(9646),s=o("species");e.exports=function(e){var t=r(e);a&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},9614:(e,t,i)=>{var r=i(3643).f;e.exports=function(e,t,i){i in e||r(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})}},9615:(e,t,i)=>{var r=i(6458);e.exports=r({}.isPrototypeOf)},9646:(e,t,i)=>{var r=i(2809);e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},9666:(e,t,i)=>{var r=i(4152),n=i(526),o=i(7553)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"===n(e))}},9688:(e,t,i)=>{var r=i(9364),n=i(2809),o=i(5810),a=i(4152),s=i(9083),l=i(256),d=i(7955),c=i(8286),u=i(2807),h=i(8611),A=i(7553),p=i(4941),f=A("isConcatSpreadable"),_=p>=51||!n((function(){var e=[];return e[f]=!1,e.concat()[0]!==e})),m=function(e){if(!a(e))return!1;var t=e[f];return void 0!==t?!!t:o(e)};r({target:"Array",proto:!0,arity:1,forced:!_||!h("concat")},{concat:function(e){var t,i,r,n,o,a=s(this),h=u(a,0),A=0;for(t=-1,r=arguments.length;t<r;t++)if(m(o=-1===t?a:arguments[t]))for(n=l(o),d(A+n),i=0;i<n;i++,A++)i in o&&c(h,A,o[i]);else d(A+1),c(h,A++,o);return h.length=A,h}})},9695:(e,t,i)=>{var r=i(6458),n=i(5810),o=i(9211),a=i(526),s=i(6677),l=r([].push);e.exports=function(e){if(o(e))return e;if(n(e)){for(var t=e.length,i=[],r=0;r<t;r++){var d=e[r];"string"==typeof d?l(i,d):"number"!=typeof d&&"Number"!==a(d)&&"String"!==a(d)||l(i,s(d))}var c=i.length,u=!0;return function(e,t){if(u)return u=!1,t;if(n(this))return t;for(var r=0;r<c;r++)if(i[r]===e)return t}}}},9742:(e,t,i)=>{var r=i(7917);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},9845:e=>{e.exports=!1},9879:e=>{var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?i:t)(r)}},9917:(e,t,i)=>{var r=i(9922),n=i(3930),o=i(309);r||n(Object.prototype,"toString",o,{unsafe:!0})},9922:(e,t,i)=>{var r={};r[i(7553)("toStringTag")]="z",e.exports="[object z]"===String(r)},9953:(e,t,i)=>{i.d(t,{A:()=>Me});var r=i(2139),n=i(2460),o=i(8870),a=i(719);function s(e,t,i){var r=e;if(t+i<r.length){for(;i--;)if(128!=(192&r[++t]))return!1;return!0}return!1}const l=function(e){for(var t=[],i=e,r=0,n=e.length;r<n;)if(i[r]<128)t.push(String.fromCharCode(i[r])),++r;else{if(i[r]<192);else if(i[r]<224){if(s(i,r,1)&&(o=(31&i[r])<<6|63&i[r+1])>=128){t.push(String.fromCharCode(65535&o)),r+=2;continue}}else if(i[r]<240){if(s(i,r,2)&&(o=(15&i[r])<<12|(63&i[r+1])<<6|63&i[r+2])>=2048&&55296!=(63488&o)){t.push(String.fromCharCode(65535&o)),r+=3;continue}}else if(i[r]<248){var o;if(s(i,r,3)&&(o=(7&i[r])<<18|(63&i[r+1])<<12|(63&i[r+2])<<6|63&i[r+3])>65536&&o<1114112){o-=65536,t.push(String.fromCharCode(o>>>10|55296)),t.push(String.fromCharCode(1023&o|56320)),r+=4;continue}}t.push(String.fromCharCode(65533)),++r}return t.join("")};var d,c=i(4383),u=(d=new ArrayBuffer(2),new DataView(d).setInt16(0,256,!0),256===new Int16Array(d)[0]);const h=function(){function e(){}return e.parseScriptData=function(t,i,r){var o={};try{var a=e.parseValue(t,i,r),s=e.parseValue(t,i+a.size,r-a.size);o[a.data]=s.data}catch(e){n.A.e("AMF",e.toString())}return o},e.parseObject=function(t,i,r){if(r<3)throw new c.j4("Data not enough when parse ScriptDataObject");var n=e.parseString(t,i,r),o=e.parseValue(t,i+n.size,r-n.size),a=o.objectEnd;return{data:{name:n.data,value:o.data},size:n.size+o.size,objectEnd:a}},e.parseVariable=function(t,i,r){return e.parseObject(t,i,r)},e.parseString=function(e,t,i){if(i<2)throw new c.j4("Data not enough when parse String");var r=new DataView(e,t,i).getUint16(0,!u);return{data:r>0?l(new Uint8Array(e,t+2,r)):"",size:2+r}},e.parseLongString=function(e,t,i){if(i<4)throw new c.j4("Data not enough when parse LongString");var r=new DataView(e,t,i).getUint32(0,!u);return{data:r>0?l(new Uint8Array(e,t+4,r)):"",size:4+r}},e.parseDate=function(e,t,i){if(i<10)throw new c.j4("Data size invalid when parse Date");var r=new DataView(e,t,i),n=r.getFloat64(0,!u),o=r.getInt16(8,!u);return{data:new Date(n+=60*o*1e3),size:10}},e.parseValue=function(t,i,r){if(r<1)throw new c.j4("Data not enough when parse Value");var o,a=new DataView(t,i,r),s=1,l=a.getUint8(0),d=!1;try{switch(l){case 0:o=a.getFloat64(1,!u),s+=8;break;case 1:o=!!a.getUint8(1),s+=1;break;case 2:var h=e.parseString(t,i+1,r-1);o=h.data,s+=h.size;break;case 3:o={};var A=0;for(9==(16777215&a.getUint32(r-4,!u))&&(A=3);s<r-4;){var p=e.parseObject(t,i+s,r-s-A);if(p.objectEnd)break;o[p.data.name]=p.data.value,s+=p.size}s<=r-3&&9==(16777215&a.getUint32(s-1,!u))&&(s+=3);break;case 8:for(o={},s+=4,A=0,9==(16777215&a.getUint32(r-4,!u))&&(A=3);s<r-8;){var f=e.parseVariable(t,i+s,r-s-A);if(f.objectEnd)break;o[f.data.name]=f.data.value,s+=f.size}s<=r-3&&9==(16777215&a.getUint32(s-1,!u))&&(s+=3);break;case 9:o=void 0,s=1,d=!0;break;case 10:o=[];var _=a.getUint32(1,!u);s+=4;for(var m=0;m<_;m++){var v=e.parseValue(t,i+s,r-s);o.push(v.data),s+=v.size}break;case 11:var g=e.parseDate(t,i+1,r-1);o=g.data,s+=g.size;break;case 12:var y=e.parseString(t,i+1,r-1);o=y.data,s+=y.size;break;default:s=r,n.A.w("AMF","Unsupported AMF value type "+l.toString())}}catch(e){n.A.e("AMF",e.toString())}return{data:o,size:s,objectEnd:d}},e}(),A=function(){function e(e){this.TAG="ExpGolomb",this._buffer=e,this._buffer_index=0,this._total_bytes=e.byteLength,this._total_bits=8*e.byteLength,this._current_word=0,this._current_word_bits_left=0}return e.prototype.destroy=function(){this._buffer=null},e.prototype._fillCurrentWord=function(){var e,t=this._total_bytes-this._buffer_index;if(t<=0)throw new c.j4("ExpGolomb: _fillCurrentWord() but no bytes available");var i=Math.min(4,t),r=new Uint8Array(4);r.set(null===(e=this._buffer)||void 0===e?void 0:e.subarray(this._buffer_index,this._buffer_index+i)),this._current_word=new DataView(r.buffer).getUint32(0,!1),this._buffer_index+=i,this._current_word_bits_left=8*i},e.prototype.readBits=function(e){if(e>32)throw new c.Qn("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var i=this._current_word_bits_left?this._current_word:0;i>>>=32-this._current_word_bits_left;var r=e-this._current_word_bits_left;this._fillCurrentWord();var n=Math.min(r,this._current_word_bits_left),o=this._current_word>>>32-n;return this._current_word<<=n,this._current_word_bits_left-=n,i<<n|o},e.prototype.readBool=function(){return 1===this.readBits(1)},e.prototype.readByte=function(){return this.readBits(8)},e.prototype._skipLeadingZero=function(){var e;for(e=0;e<this._current_word_bits_left;e++)if(this._current_word&2147483648>>>e)return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},e.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},e.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},e}(),p=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,r=new Uint8Array(i),n=0,o=0;o<i;o++)o>=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(r[n]=t[o],n++);return new Uint8Array(r.buffer,0,n)},e.parseSPS=function(t){for(var i=t.subarray(1,4),r="avc1.",n=0;n<3;n++){var o=i[n].toString(16);o.length<2&&(o="0"+o),r+=o}var a=e._ebsp2rbsp(t),s=new A(a);s.readByte();var l=s.readByte();s.readByte();var d=s.readByte();s.readUEG();var c=e.getProfileString(l),u=e.getLevelString(d),h=1,p=420,f=8,_=8;if((100===l||110===l||122===l||244===l||44===l||83===l||86===l||118===l||128===l||138===l||144===l)&&(3===(h=s.readUEG())&&s.readBits(1),h<=3&&(p=[0,420,422,444][h]),f=s.readUEG()+8,_=s.readUEG()+8,s.readBits(1),s.readBool()))for(var m=3!==h?8:12,v=0;v<m;v++)s.readBool()&&(v<6?e._skipScalingList(s,16):e._skipScalingList(s,64));s.readUEG();var g=s.readUEG();if(0===g)s.readUEG();else if(1===g){s.readBits(1),s.readSEG(),s.readSEG();var y=s.readUEG();for(v=0;v<y;v++)s.readSEG()}var b=s.readUEG();s.readBits(1);var S=s.readUEG(),E=s.readUEG(),w=s.readBits(1);0===w&&s.readBits(1),s.readBits(1);var T=0,k=0,R=0,O=0;s.readBool()&&(T=s.readUEG(),k=s.readUEG(),R=s.readUEG(),O=s.readUEG());var C=1,B=1,x=0,I=!0,L=0,D=0;if(s.readBool()){if(s.readBool()){var M=s.readByte();M>0&&M<16?(C=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][M-1],B=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][M-1]):255===M&&(C=s.readByte()<<8|s.readByte(),B=s.readByte()<<8|s.readByte())}if(s.readBool()&&s.readBool(),s.readBool()&&(s.readBits(4),s.readBool()&&s.readBits(24)),s.readBool()&&(s.readUEG(),s.readUEG()),s.readBool()){var P=s.readBits(32),U=s.readBits(32);I=s.readBool(),x=(L=U)/(D=2*P)}}var F=1;1===C&&1===B||(F=C/B);var N=0,V=0;0===h?(N=1,V=2-w):(N=3===h?1:2,V=(1===h?2:1)*(2-w));var G=16*(S+1),j=16*(E+1)*(2-w);G-=(T+k)*N,j-=(R+O)*V;var $=Math.ceil(G*F);return s.destroy(),s=null,{codec_mimetype:r,profile_idc:l,level_idc:d,profile_string:c,level_string:u,chroma_format_idc:h,bit_depth:f,bit_depth_luma:f,bit_depth_chroma:_,ref_frames:b,chroma_format:p,chroma_format_string:e.getChromaFormatString(p),frame_rate:{fixed:I,fps:x,fps_den:D,fps_num:L},sar_ratio:{width:C,height:B},codec_size:{width:G,height:j},present_size:{width:$,height:j}}},e._skipScalingList=function(e,t){for(var i=8,r=8,n=0;n<t;n++)0!==r&&(r=(i+e.readSEG()+256)%256),i=0===r?i:r},e.getProfileString=function(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}},e.getLevelString=function(e){return(e/10).toFixed(1)},e.getChromaFormatString=function(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},e}();var f=i(6399);const _=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,r=new Uint8Array(i),n=0,o=0;o<i;o++)o>=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(r[n]=t[o],n++);return new Uint8Array(r.buffer,0,n)},e.parseVPS=function(t){var i=e._ebsp2rbsp(t),r=new A(i);return r.readByte(),r.readByte(),r.readBits(4),r.readBits(2),r.readBits(6),{num_temporal_layers:r.readBits(3)+1,temporal_id_nested:r.readBool()}},e.parseSPS=function(t){var i=e._ebsp2rbsp(t),r=new A(i);r.readByte(),r.readByte();for(var n=0,o=0,a=0,s=0,l=(r.readBits(4),r.readBits(3)),d=(r.readBool(),r.readBits(2)),c=r.readBool(),u=r.readBits(5),h=r.readByte(),p=r.readByte(),f=r.readByte(),_=r.readByte(),m=r.readByte(),v=r.readByte(),g=r.readByte(),y=r.readByte(),b=r.readByte(),S=r.readByte(),E=r.readByte(),w=[],T=[],k=0;k<l;k++)w.push(r.readBool()),T.push(r.readBool());if(l>0)for(k=l;k<8;k++)r.readBits(2);for(k=0;k<l;k++)w[k]&&(r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte(),r.readByte()),T[k]&&r.readByte();r.readUEG();var R=r.readUEG();3===R&&r.readBits(1);var O=r.readUEG(),C=r.readUEG();r.readBool()&&(n+=r.readUEG(),o+=r.readUEG(),a+=r.readUEG(),s+=r.readUEG());var B=r.readUEG(),x=r.readUEG(),I=r.readUEG();for(k=r.readBool()?0:l;k<=l;k++)r.readUEG(),r.readUEG(),r.readUEG();if(r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG(),r.readBool()&&r.readBool())for(var L=0;L<4;L++)for(var D=0;D<(3===L?2:6);D++)if(r.readBool()){var M=Math.min(64,1<<4+(L<<1));for(L>1&&r.readSEG(),k=0;k<M;k++)r.readSEG()}else r.readUEG();r.readBool(),r.readBool(),r.readBool()&&(r.readByte(),r.readUEG(),r.readUEG(),r.readBool());var P=r.readUEG(),U=0;for(k=0;k<P;k++){var F=!1;if(0!==k&&(F=r.readBool()),F){k===P&&r.readUEG(),r.readBool(),r.readUEG();for(var N=0,V=0;V<=U;V++){var G=r.readBool(),j=!1;G||(j=r.readBool()),(G||j)&&N++}U=N}else{var $=r.readUEG(),W=r.readUEG();for(U=$+W,V=0;V<$;V++)r.readUEG(),r.readBool();for(V=0;V<W;V++)r.readUEG(),r.readBool()}}if(r.readBool()){var Q=r.readUEG();for(k=0;k<Q;k++){for(V=0;V<I+4;V++)r.readBits(1);r.readBits(1)}}var z=0,H=1,q=1,Y=!1,X=1,Z=1;if(r.readBool(),r.readBool(),r.readBool()){if(r.readBool()){var K=r.readByte();K>0&&K<=16?(H=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][K-1],q=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][K-1]):255===K&&(H=r.readBits(16),q=r.readBits(16))}if(r.readBool()&&r.readBool(),r.readBool()&&(r.readBits(3),r.readBool(),r.readBool()&&(r.readByte(),r.readByte(),r.readByte())),r.readBool()&&(r.readUEG(),r.readUEG()),r.readBool(),r.readBool(),r.readBool(),r.readBool()&&(r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG()),r.readBool()&&(X=r.readBits(32),Z=r.readBits(32),r.readBool()&&r.readUEG(),r.readBool())){var J,ee,te=!1;for(J=r.readBool(),ee=r.readBool(),(J||ee)&&((te=r.readBool())&&(r.readByte(),r.readBits(5),r.readBool(),r.readBits(5)),r.readBits(4),r.readBits(4),te&&r.readBits(4),r.readBits(5),r.readBits(5),r.readBits(5)),k=0;k<=l;k++){var ie=r.readBool();Y=ie;var re=!1,ne=1;ie||(re=r.readBool());var oe=!1;if(re?r.readSEG():oe=r.readBool(),oe||(ne=r.readUEG()+1),J)for(V=0;V<ne;V++)r.readUEG(),r.readUEG(),te&&(r.readUEG(),r.readUEG());if(ee)for(V=0;V<ne;V++)r.readUEG(),r.readUEG(),te&&(r.readUEG(),r.readUEG())}}r.readBool()&&(r.readBool(),r.readBool(),r.readBool(),z=r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG())}r.readBool();var ae="hvc1.".concat(u,".1.L").concat(E,".B0"),se=O-(n+o)*(1===R||2===R?2:1),le=C-(a+s)*(1===R?2:1),de=1;return 1!==H&&1!==q&&(de=H/q),r.destroy(),r=null,{codec_mimetype:ae,level_string:e.getLevelString(E),profile_idc:u,bit_depth:B+8,ref_frames:1,chroma_format:R,chroma_format_string:e.getChromaFormatString(R),general_level_idc:E,general_profile_space:d,general_tier_flag:c,general_profile_idc:u,general_profile_compatibility_flags_1:h,general_profile_compatibility_flags_2:p,general_profile_compatibility_flags_3:f,general_profile_compatibility_flags_4:_,general_constraint_indicator_flags_1:m,general_constraint_indicator_flags_2:v,general_constraint_indicator_flags_3:g,general_constraint_indicator_flags_4:y,general_constraint_indicator_flags_5:b,general_constraint_indicator_flags_6:S,min_spatial_segmentation_idc:z,constant_frame_rate:0,chroma_format_idc:R,bit_depth_luma_minus8:B,bit_depth_chroma_minus8:x,frame_rate:{fixed:Y,fps:Z/X,fps_den:X,fps_num:Z},sar_ratio:{width:H,height:q},codec_size:{width:se,height:le},present_size:{width:se*de,height:le}}},e.parsePPS=function(t){var i=e._ebsp2rbsp(t),r=new A(i);r.readByte(),r.readByte(),r.readUEG(),r.readUEG(),r.readBool(),r.readBool(),r.readBits(3),r.readBool(),r.readBool(),r.readUEG(),r.readUEG(),r.readSEG(),r.readBool(),r.readBool(),r.readBool()&&r.readUEG(),r.readSEG(),r.readSEG(),r.readBool(),r.readBool(),r.readBool(),r.readBool();var n=r.readBool(),o=r.readBool(),a=1;return o&&n?a=0:o?a=3:n&&(a=2),{parallelismType:a}},e.getChromaFormatString=function(e){switch(e){case 0:return"4:0:0";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}},e.getProfileString=function(e){switch(e){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}},e.getLevelString=function(e){return(e/30).toFixed(1)},e}();function m(e){return e.byteOffset%2==0&&e.byteLength%2==0}function v(e){return e.byteOffset%4==0&&e.byteLength%4==0}function g(e,t){for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const y=function(e,t){return e.byteLength===t.byteLength&&(v(e)&&v(t)?function(e,t){return g(new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4),new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4))}(e,t):m(e)&&m(t)?function(e,t){return g(new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2))}(e,t):function(e,t){return g(e,t)}(e,t))},b=function(){function e(){}return e.parseOBUs=function(t){for(var i=null,r=0;r<t.byteLength;){t[r];var n=(120&t[r])>>3,o=!!(4&t[r]),a=!!(2&t[r]);t[r],r+=1,o&&(r+=1);var s=Number.POSITIVE_INFINITY;if(a){s=0;for(var l=0;s|=(127&t[r])<<7*l,128&t[r+=1];l++);}1===n&&(i=e.parseSeuqneceHeader(t.subarray(r,r+s))),r+=s}return i},e.parseSeuqneceHeader=function(t){var i=new A(t),r=i.readBits(3),n=(i.readBool(),i.readBool()),o=!0,a=0,s=0,l=[];if(n)l.push({operating_point_idc:0,level:i.readBits(5),tier:0});else{if(i.readBool()){var d=i.readBits(32),c=i.readBits(32),u=i.readBool();if(u){for(var h=0;0===i.readBits(1);)h+=1;h>=32||i.readBits(h)}a=c,s=d,o=u,i.readBool()&&(i.readBits(5),i.readBits(32),i.readBits(5),i.readBits(5))}for(var p=i.readBool(),f=i.readBits(5),_=0;_<=f;_++){var m=i.readBits(12),v=i.readBits(5),g=v>7?i.readBits(1):0;l.push({operating_point_idc:m,level:v,tier:g}),p&&i.readBool()&&i.readBits(4)}}var y=l[0],b=y.level,S=y.tier,E=i.readBits(4),w=i.readBits(4),T=i.readBits(E+1)+1,k=i.readBits(w+1)+1,R=!1;n||(R=i.readBool()),R&&(i.readBits(4),i.readBits(4)),i.readBool(),i.readBool(),i.readBool();var O=!1;n||(i.readBool(),i.readBool(),i.readBool(),i.readBool(),(O=i.readBool())&&(i.readBool(),i.readBool()),(i.readBool()||i.readBits(1))&&(i.readBool()||i.readBits(1)),O&&i.readBits(3)),i.readBool(),i.readBool(),i.readBool();var C=i.readBool(),B=8;B=2===r&&C?i.readBool()?12:10:C?10:8;var x=!1;1!==r&&(x=i.readBool()),i.readBool()&&(i.readBits(8),i.readBits(8),i.readBits(8));var I=1,L=1;return x?(i.readBits(1),I=1,L=1):(i.readBits(1),0===r?(I=1,L=1):1===r?(I=0,L=0):12===B?i.readBits(1)&&i.readBits(1):(I=1,L=0),I&&L&&i.readBits(2),i.readBits(1)),i.readBool(),i.destroy(),i=null,{codec_mimetype:"av01.".concat(r,".").concat(e.getLevelString(b,S),".").concat(B.toString(10).padStart(2,"0")),level:b,tier:S,level_string:e.getLevelString(b,S),profile_idc:r,profile_string:"".concat(r),bit_depth:B,ref_frames:1,chroma_format:e.getChromaFormat(x,I,L),chroma_format_string:e.getChromaFormatString(x,I,L),frame_rate:{fixed:o,fps:a/s,fps_den:s,fps_num:a},sar_ratio:{width:1,height:1},codec_size:{width:T,height:k},present_size:{width:1*T,height:k}}},e.getLevelString=function(e,t){return"".concat(e.toString(10).padStart(2,"0")).concat(0===t?"M":"H")},e.getChromaFormat=function(e,t,i){return e?0:0===t&&0===i?3:1===t&&0===i?2:1===t&&1===i?1:Number.NaN},e.getChromaFormatString=function(e,t,i){return e?"4:0:0":0===t&&0===i?"4:4:4":1===t&&0===i?"4:2:2":1===t&&1===i?"4:2:0":"Unknown"},e}();var S=function(){function e(e,t){this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new a.A,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return e.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},e.probe=function(e){var t=new Uint8Array(e);if(t.byteLength<9)return{needMoreData:!0};var i={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return i;var r,n=(4&t[4])>>>2!=0,o=!!(1&t[4]),a=(r=t)[5]<<24|r[6]<<16|r[7]<<8|r[8];return a<9?i:{match:!0,consumed:a,dataOffset:a,hasAudioTrack:n,hasVideoTrack:o}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo&&(this._mediaInfo.duration=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo&&(this._mediaInfo.hasAudio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo&&(this._mediaInfo.hasVideo=e)},enumerable:!1,configurable:!0}),e.prototype.resetMediaInfo=function(){this._mediaInfo=new a.A},e.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},e.prototype.parseChunks=function(t,i){var r,o;if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new c.j4("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var a=0,s=this._littleEndian;if(0===i){if(!(t.byteLength>13))return 0;var l=e.probe(t);a=(null==l?void 0:l.dataOffset)||0}for(this._firstParse&&(this._firstParse=!1,i+a!==this._dataOffset&&n.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(d=new DataView(t,a)).getUint32(0,!s)&&n.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),a+=4);a<t.byteLength;){this._dispatch=!0;var d=new DataView(t,a);if(a+11+4>t.byteLength)break;var u=d.getUint8(0),h=16777215&d.getUint32(0,!s);if(a+11+h+4>t.byteLength)break;if(8===u||9===u||18===u){var A=d.getUint8(4),p=d.getUint8(5),f=d.getUint8(6)|p<<8|A<<16|d.getUint8(7)<<24;16777215&d.getUint32(7,!s)&&n.A.w(this.TAG,"Meet tag which has StreamID != 0!");var _=a+11;switch(u){case 8:this._parseAudioData(t,_,h,f);break;case 9:this._parseVideoData(t,_,h,f,i+a);break;case 18:this._parseScriptData(t,_,h)}var m=d.getUint32(11+h,!s);m!==11+h&&n.A.w(this.TAG,"Invalid PrevTagSize ".concat(m)),a+=11+h+4}else n.A.w(this.TAG,"Unsupported tag type ".concat(u,", skipped")),a+=11+h+4}return this._isInitialMetadataDispatched()&&this._dispatch&&((null===(r=this._audioTrack)||void 0===r?void 0:r.length)||(null===(o=this._videoTrack)||void 0===o?void 0:o.length))&&this._onDataAvailable(this._audioTrack,this._videoTrack),a},e.prototype._parseScriptData=function(e,t,i){var r,o,a,s=h.parseScriptData(e,t,i);if(s.hasOwnProperty("onMetaData")){if(null==s.onMetaData||"object"!=typeof s.onMetaData)return void n.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&n.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=s;var l=null===(r=this._metadata)||void 0===r?void 0:r.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},l)),"boolean"==typeof(null==l?void 0:l.hasAudio)&&(this._hasAudioFlagOverrided||(this._hasAudio=l.hasAudio,this._mediaInfo&&(this._mediaInfo.hasAudio=this._hasAudio))),"boolean"==typeof(null==l?void 0:l.hasVideo)&&(this._hasVideoFlagOverrided||(this._hasVideo=l.hasVideo,this._mediaInfo&&(this._mediaInfo.hasVideo=this._hasVideo))),"number"==typeof(null==l?void 0:l.audiodatarate)&&this._mediaInfo&&(this._mediaInfo.audioDataRate=l.audiodatarate),"number"==typeof(null==l?void 0:l.videodatarate)&&this._mediaInfo&&(this._mediaInfo.videoDataRate=l.videodatarate),"number"==typeof(null==l?void 0:l.width)&&this._mediaInfo&&(this._mediaInfo.width=l.width),"number"==typeof(null==l?void 0:l.height)&&this._mediaInfo&&(this._mediaInfo.height=l.height),"number"==typeof(null==l?void 0:l.duration)){if(!this._durationOverrided){var d=Math.floor(l.duration*this._timescale);this._duration=d,this._mediaInfo&&(this._mediaInfo.duration=d)}}else this._mediaInfo&&(this._mediaInfo.duration=0);if("number"==typeof(null==l?void 0:l.framerate)){var c=Math.floor(1e3*l.framerate);if(c>0){var u=c/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=u,this._referenceFrameRate.fps_num=c,this._referenceFrameRate.fps_den=1e3,this._mediaInfo&&(this._mediaInfo.fps=u)}}if("object"==typeof(null==l?void 0:l.keyframes)){this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!0);var A=l.keyframes;this._mediaInfo&&(this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(A)),l.keyframes=null}else this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!1);this._dispatch=!1,this._mediaInfo&&(this._mediaInfo.metadata=l),n.A.v(this.TAG,"Parsed onMetaData"),(null===(o=this._mediaInfo)||void 0===o?void 0:o.isComplete())&&(null===(a=this._onMediaInfo)||void 0===a||a.call(this,this._mediaInfo))}Object.keys(s).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},s))},e.prototype._parseKeyframesIndex=function(e){for(var t=[],i=[],r=1;r<e.times.length;r++){var n=this._timestampBase+Math.floor(1e3*e.times[r]);t.push(n),i.push(e.filepositions[r])}return{times:t,filepositions:i}},e.prototype._parseAudioData=function(e,t,i,r){var o,a,s,l,d,c,u,h,A,p;if(i<=1)n.A.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(!this._hasAudioFlagOverrided||!1!==this._hasAudio){this._littleEndian;var _=new DataView(e,t,i).getUint8(0),m=_>>>4;if(2===m||10===m){var v=0,g=(12&_)>>>2;if(g>=0&&g<=4){v=this._flvSoundRateTable[g];var b=1&_,S=this._audioMetadata,E=this._audioTrack;if(S||(!1!==this._hasAudio||this._hasAudioFlagOverrided||(this._hasAudio=!0,this._mediaInfo&&(this._mediaInfo.hasAudio=!0)),(S=this._audioMetadata={}).type="audio",S.id=null==E?void 0:E.id,S.timescale=this._timescale,S.duration=this._duration,S.audioSampleRate=v,S.channelCount=0===b?1:2),10===m){var w=this._parseAACAudioData(e,t+1,i-1);if(void 0===w)return;if(0===(null==w?void 0:w.packetType)){if(null==S?void 0:S.config){if(y(w.data.config,null==S?void 0:S.config))return;n.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var T=w.data;S.audioSampleRate=null==T?void 0:T.samplingRate,S.channelCount=null==T?void 0:T.channelCount,S.codec=null==T?void 0:T.codec,S.originalCodec=null==T?void 0:T.originalCodec,S.config=null==T?void 0:T.config,S.refSampleDuration=1024/S.audioSampleRate*S.timescale,n.A.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(l=this._videoTrack)||void 0===l?void 0:l.length))&&(null===(d=this._onDataAvailable)||void 0===d||d.call(this,this._audioTrack,this._videoTrack)):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,null===(c=this._onTrackMetadata)||void 0===c||c.call(this,"audio",S),(O=this._mediaInfo).audioCodec=S.originalCodec||"",O.audioSampleRate=S.audioSampleRate,O.audioChannelCount=S.channelCount,O.hasVideo?null!=O.videoCodec&&(O.mimeType='video/x-flv; codecs="'+O.videoCodec+","+O.audioCodec+'"'):O.mimeType='video/x-flv; codecs="'+O.audioCodec+'"',(null==O?void 0:O.isComplete())&&(null===(u=this._onMediaInfo)||void 0===u||u.call(this,O))}else if(1===w.packetType){var k=this._timestampBase+r,R={unit:w.data,length:w.data.byteLength,dts:k,pts:k};E&&(null==E||E.samples.push(R),E.length+=(null===(h=null==w?void 0:w.data)||void 0===h?void 0:h.length)||0)}else n.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(w.packetType))}else if(2===m){if(!S.codec){var O;if(void 0===(T=this._parseMP3AudioData(e,t+1,i-1,!0)))return;S.audioSampleRate=T.samplingRate,S.channelCount=T.channelCount,S.codec=T.codec,S.originalCodec=T.originalCodec,S.refSampleDuration=1152/S.audioSampleRate*S.timescale,n.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,null===(A=this._onTrackMetadata)||void 0===A||A.call(this,"audio",S),(O=this._mediaInfo).audioCodec=S.codec,O.audioSampleRate=S.audioSampleRate,O.audioChannelCount=S.channelCount,O.audioDataRate=T.bitRate,(null==O?void 0:O.hasVideo)?null!=O.videoCodec&&(O.mimeType='video/x-flv; codecs="'+O.videoCodec+","+O.audioCodec+'"'):O.mimeType='video/x-flv; codecs="'+O.audioCodec+'"',O.isComplete()&&(null===(p=this._onMediaInfo)||void 0===p||p.call(this,O))}var C=this._parseMP3AudioData(e,t+1,i-1,!1);if(void 0===C)return;k=this._timestampBase+r;var B={unit:C,length:C.byteLength,dts:k,pts:k};null==E||E.samples.push(B),E&&(E.length+=C.length)}}else null===(a=this._onError)||void 0===a||a.call(this,f.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+g)}else null===(o=this._onError)||void 0===o||o.call(this,f.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+m)}},e.prototype._parseAACAudioData=function(e,t,i){if(!(i<=1)){var r={},o=new Uint8Array(e,t,i);return r.packetType=o[0],0===o[0]?r.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):r.data=o.subarray(1),r}n.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,i){var r,n,o,a,s=new Uint8Array(e,t,i),l=null,d=0,c=null;if(d=o=s[0]>>>3,(a=(7&s[0])<<1|s[1]>>>7)<0||a>=this._mpegSamplingRates.length)null===(r=this._onError)||void 0===r||r.call(this,f.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var u=this._mpegSamplingRates[a],h=(120&s[1])>>>3;if(!(h<0||h>=8)){5===d&&(c=(7&s[1])<<1|s[2]>>>7,s[2]);var A=self.navigator.userAgent.toLowerCase();return A.includes("firefox")?a>=6?(d=5,l=new Array(4),c=a-3):(d=2,l=new Array(2),c=a):A.includes("android")?(d=2,l=new Array(2),c=a):(d=5,c=a,l=new Array(4),a>=6?c=a-3:1===h&&(d=2,l=new Array(2),c=a)),l[0]=d<<3,l[0]|=(15&a)>>>1,l[1]=(15&a)<<7,l[1]|=(15&h)<<3,5===d&&(l[1]|=(15&c)>>>1,l[2]=(1&c)<<7,l[2]|=8,l[3]=0),{config:l,samplingRate:u,channelCount:h,codec:"mp4a.40."+d,originalCodec:"mp4a.40."+o}}null===(n=this._onError)||void 0===n||n.call(this,f.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,i,r){if(!(i<4)){this._littleEndian;var o,a=new Uint8Array(e,t,i);if(r){if(255!==a[0])return;var s=a[1]>>>3&3,l=(6&a[1])>>1,d=(240&a[2])>>>4,c=(12&a[2])>>>2,u=3&~(a[3]>>>6)?2:1,h=0,A=0;switch(s){case 0:h=this._mpegAudioV25SampleRateTable[c];break;case 2:h=this._mpegAudioV20SampleRateTable[c];break;case 3:h=this._mpegAudioV10SampleRateTable[c]}switch(l){case 1:d<this._mpegAudioL3BitRateTable.length&&(A=this._mpegAudioL3BitRateTable[d]);break;case 2:d<this._mpegAudioL2BitRateTable.length&&(A=this._mpegAudioL2BitRateTable[d]);break;case 3:d<this._mpegAudioL1BitRateTable.length&&(A=this._mpegAudioL1BitRateTable[d])}o={bitRate:A,samplingRate:h,channelCount:u,codec:"mp3",originalCodec:"mp3"}}else o=a;return o}n.A.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")},e.prototype._parseVideoData=function(e,t,i,r,o){var a,s;if(i<=1)n.A.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(!this._hasVideoFlagOverrided||!1!==this._hasVideo){var l=new Uint8Array(e,t,i)[0],d=(112&l)>>>4;if(128&l){var c=15&l,u=String.fromCharCode.apply(String,function(e,t,i){if(2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}([],function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a}(new Uint8Array(e,t,i).slice(1,5)),!1));"hvc1"===u?this._parseEnhancedHEVCVideoPacket(e,t+5,i-5,r,o,d,c):"av01"===u?this._parseEnhancedAV1VideoPacket(e,t+5,i-5,r,o,d,c):null===(s=this._onError)||void 0===s||s.call(this,f.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(u))}else{var h=15&l;7===h?this._parseAVCVideoPacket(e,t+1,i-1,r,o,d):12===h?this._parseHEVCVideoPacket(e,t+1,i-1,r,o,d):null===(a=this._onError)||void 0===a||a.call(this,f.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(h))}}},e.prototype._parseAVCVideoPacket=function(e,t,i,r,o,a){var s;if(i<4)n.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var l=this._littleEndian,d=new DataView(e,t,i),c=d.getUint8(0),u=(16777215&d.getUint32(0,!l))<<8>>8;0===c?this._parseAVCDecoderConfigurationRecord(e,t+4,i-4):1===c?this._parseAVCVideoData(e,t+4,i-4,r,o,a,u):2===c||null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(c))}},e.prototype._parseHEVCVideoPacket=function(e,t,i,r,o,a){var s;if(i<4)n.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var l=this._littleEndian,d=new DataView(e,t,i),c=d.getUint8(0),u=(16777215&d.getUint32(0,!l))<<8>>8;0===c?this._parseHEVCDecoderConfigurationRecord(e,t+4,i-4):1===c?this._parseHEVCVideoData(e,t+4,i-4,r,o,a,u):2===c||null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(c))}},e.prototype._parseEnhancedHEVCVideoPacket=function(e,t,i,r,n,o,a){var s,l=this._littleEndian,d=new DataView(e,t,i);if(0===a)this._parseHEVCDecoderConfigurationRecord(e,t,i);else if(1===a){var c=(4294967040&d.getUint32(0,!l))>>8;this._parseHEVCVideoData(e,t+3,i-3,r,n,o,c)}else 3===a?this._parseHEVCVideoData(e,t,i,r,n,o,0):2===a||null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(a))},e.prototype._parseEnhancedAV1VideoPacket=function(e,t,i,r,n,o,a){var s,l;this._littleEndian,0===a?this._parseAV1CodecConfigurationRecord(e,t,i):1===a?this._parseAV1VideoData(e,t,i,r,n,o,0):5===a?null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Not Suported MP2T AV1 video packet type ".concat(a)):2===a||null===(l=this._onError)||void 0===l||l.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(a))},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,i){var r,o,a,s,l,d,c,u,h,A,_;if(i<7)n.A.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var m=this._videoMetadata,v=this._videoTrack,g=this._littleEndian,b=new DataView(e,t,i);if(m){if(void 0!==m.avcc){var S=new Uint8Array(e,t,i);if(y(S,m.avcc))return;n.A.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(m=this._videoMetadata={}).type="video",m.id=null==v?void 0:v.id,m.timescale=this._timescale,m.duration=this._duration;var E=b.getUint8(0),w=b.getUint8(1);if(b.getUint8(2),b.getUint8(3),1===E&&0!==w)if(this._naluLengthSize=1+(3&b.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var T=31&b.getUint8(5);if(0!==T){T>1&&n.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(T));for(var k=6,R=0;R<T;R++){var O=b.getUint16(k,!g);if(k+=2,0!==O){var C=new Uint8Array(e,t+k,O);k+=O;var B=p.parseSPS(C);if(0===R){m.codecWidth=B.codec_size.width,m.codecHeight=B.codec_size.height,m.presentWidth=B.present_size.width,m.presentHeight=B.present_size.height,m.profile=B.profile_string,m.level=B.level_string,m.bitDepth=B.bit_depth,m.chromaFormat=B.chroma_format,m.sarRatio=B.sar_ratio,m.frameRate=B.frame_rate,B.frame_rate.fixed&&0!==B.frame_rate.fps_num&&0!==B.frame_rate.fps_den||(m.frameRate=this._referenceFrameRate);var x=null===(s=m.frameRate)||void 0===s?void 0:s.fps_den,I=null===(l=m.frameRate)||void 0===l?void 0:l.fps_num;m.refSampleDuration=m.timescale*(x/I);for(var L=C.subarray(1,4),D="avc1.",M=0;M<3;M++){var P=L[M].toString(16);P.length<2&&(P="0"+P),D+=P}m.codec=D;var U=this._mediaInfo;U.width=m.codecWidth,U.height=m.codecHeight,U.fps=m.frameRate.fps,U.profile=m.profile,U.level=m.level,U.refFrames=B.ref_frames,U.chromaFormat=B.chroma_format_string,U.sarNum=m.sarRatio.width,U.sarDen=m.sarRatio.height,U.videoCodec=D,U.hasAudio?null!=U.audioCodec&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.videoCodec+'"',U.isComplete()&&(null===(d=this._onMediaInfo)||void 0===d||d.call(this,U))}}}var F=b.getUint8(k);if(0!==F){for(F>1&&n.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(F)),k++,R=0;R<F;R++)O=b.getUint16(k,!g),k+=2,0!==O&&(k+=O);m.avcc=new Uint8Array(i),m.avcc.set(new Uint8Array(e,t,i),0),n.A.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(u=this._audioTrack)||void 0===u?void 0:u.length)||(null===(h=this._videoTrack)||void 0===h?void 0:h.length))&&(null===(A=this._onDataAvailable)||void 0===A||A.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(_=this._onTrackMetadata)||void 0===_||_.call(this,"video",m)}else null===(c=this._onError)||void 0===c||c.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else null===(a=this._onError)||void 0===a||a.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else null===(o=this._onError)||void 0===o||o.call(this,f.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else null===(r=this._onError)||void 0===r||r.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}},e.prototype._parseHEVCDecoderConfigurationRecord=function(e,t,i){var r,o,a,s,l,d,c;if(i<22)n.A.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");else{var u=this._videoMetadata,h=this._videoTrack,A=this._littleEndian,p=new DataView(e,t,i);if(u){if(void 0!==u.hvcc){var m=new Uint8Array(e,t,i);if(y(m,u.hvcc))return;n.A.w(this.TAG,"HEVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(u=this._videoMetadata={}).type="video",u.id=null==h?void 0:h.id,u.timescale=this._timescale,u.duration=this._duration;var v=p.getUint8(0),g=31&p.getUint8(1);if(1===v&&0!==g)if(this._naluLengthSize=1+(3&p.getUint8(21)),3===this._naluLengthSize||4===this._naluLengthSize){for(var b=p.getUint8(22),S=0,E=23;S<b;S++){var w=63&p.getUint8(E+0),T=p.getUint16(E+1,!A);E+=3;for(var k=0;k<T;k++){var R=p.getUint16(E+0,!A);if(0===k)if(33===w){E+=2;var O=new Uint8Array(e,t+E,R),C=_.parseSPS(O);u.codecWidth=C.codec_size.width,u.codecHeight=C.codec_size.height,u.presentWidth=C.present_size.width,u.presentHeight=C.present_size.height,u.profile=null==C?void 0:C.profile_string,u.level=C.level_string,u.bitDepth=C.bit_depth,u.chromaFormat=C.chroma_format,u.sarRatio=C.sar_ratio,u.frameRate=C.frame_rate,C.frame_rate.fixed&&0!==C.frame_rate.fps_num&&0!==C.frame_rate.fps_den||(u.frameRate=this._referenceFrameRate);var B=u.frameRate.fps_den,x=u.frameRate.fps_num;u.refSampleDuration=u.timescale*(B/x),u.codec=C.codec_mimetype;var I=this._mediaInfo;I.width=u.codecWidth,I.height=u.codecHeight,I.fps=u.frameRate.fps,I.profile=u.profile,I.level=u.level,I.refFrames=C.ref_frames,I.chromaFormat=C.chroma_format_string,I.sarNum=u.sarRatio.width,I.sarDen=u.sarRatio.height,I.videoCodec=C.codec_mimetype,I.hasAudio?null!=I.audioCodec&&(I.mimeType='video/x-flv; codecs="'+I.videoCodec+","+I.audioCodec+'"'):I.mimeType='video/x-flv; codecs="'+I.videoCodec+'"',I.isComplete()&&(null===(a=this._onMediaInfo)||void 0===a||a.call(this,I)),E+=R}else E+=2+R;else E+=2+R}}u.hvcc=new Uint8Array(i),u.hvcc.set(new Uint8Array(e,t,i),0),n.A.v(this.TAG,"Parsed HEVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(l=this._videoTrack)||void 0===l?void 0:l.length))&&(null===(d=this._onDataAvailable)||void 0===d||d.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(c=this._onTrackMetadata)||void 0===c||c.call(this,"video",u)}else null===(o=this._onError)||void 0===o||o.call(this,f.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else null===(r=this._onError)||void 0===r||r.call(this,f.A.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord")}},e.prototype._parseAV1CodecConfigurationRecord=function(e,t,i){var r,o,a,s,l,d,c,u,h,A,p;if(i<4)n.A.w(this.TAG,"Flv: Invalid AV1CodecConfigurationRecord, lack of data!");else{var _=this._videoMetadata,m=this._videoTrack,v=(this._littleEndian,new DataView(e,t,i));_?void 0!==_.av1c&&n.A.w(this.TAG,"Found another AV1CodecConfigurationRecord!"):(!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(_=this._videoMetadata={}).type="video",_.id=null==m?void 0:m.id,_.timescale=this._timescale,_.duration=this._duration);var g=127&v.getUint8(0);if(v.getUint8(1),v.getUint8(1),v.getUint8(2),1===g){var y=b.parseOBUs(new Uint8Array(e,t+4,i-4));if(null!=y){_.codecWidth=null===(a=null==y?void 0:y.codec_size)||void 0===a?void 0:a.width,_.codecHeight=null===(s=null==y?void 0:y.codec_size)||void 0===s?void 0:s.height,_.presentWidth=null===(l=null==y?void 0:y.present_size)||void 0===l?void 0:l.width,_.presentHeight=null===(d=null==y?void 0:y.present_size)||void 0===d?void 0:d.height,_.profile=y.profile_string,_.level=y.level_string,_.bitDepth=y.bit_depth,_.chromaFormat=y.chroma_format,_.sarRatio=y.sar_ratio,_.frameRate=y.frame_rate,y.frame_rate.fixed&&0!==y.frame_rate.fps_num&&0!==y.frame_rate.fps_den||(_.frameRate=this._referenceFrameRate);var S=_.frameRate.fps_den,E=_.frameRate.fps_num;_.refSampleDuration=_.timescale*(S/E),_.codec=y.codec_mimetype;var w=this._mediaInfo;w.width=_.codecWidth,w.height=_.codecHeight,w.fps=_.frameRate.fps,w.profile=_.profile,w.level=_.level,w.refFrames=y.ref_frames,w.chromaFormat=y.chroma_format_string,w.sarNum=_.sarRatio.width,w.sarDen=_.sarRatio.height,w.videoCodec=y.codec_mimetype,w.hasAudio?null!=w.audioCodec&&(w.mimeType='video/x-flv; codecs="'+w.videoCodec+","+w.audioCodec+'"'):w.mimeType='video/x-flv; codecs="'+w.videoCodec+'"',w.isComplete()&&(null===(c=this._onMediaInfo)||void 0===c||c.call(this,w)),_.av1c=new Uint8Array(i),_.av1c.set(new Uint8Array(e,t,i),0),n.A.v(this.TAG,"Parsed AV1CodecConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(u=this._audioTrack)||void 0===u?void 0:u.length)||(null===(h=this._videoTrack)||void 0===h?void 0:h.length))&&(null===(A=this._onDataAvailable)||void 0===A||A.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(p=this._onTrackMetadata)||void 0===p||p.call(this,"video",_)}else null===(o=this._onError)||void 0===o||o.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}else null===(r=this._onError)||void 0===r||r.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}},e.prototype._parseAVCVideoData=function(e,t,i,r,o,a,s){for(var l=this._littleEndian,d=new DataView(e,t,i),c=[],u=0,h=0,A=this._naluLengthSize,p=this._timestampBase+r,f=1===a;h<i;){if(h+4>=i){n.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(h,", dataSize = ").concat(i));break}var _=d.getUint32(h,!l);if(3===A&&(_>>>=8),_>i-A)return void n.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var m=31&d.getUint8(h+A);5===m&&(f=!0);var v=new Uint8Array(e,t+h,A+_),g={type:m,data:v};c.push(g),u+=v.byteLength,h+=A+_}if(c.length){var y=this._videoTrack,b={units:c,length:u,isKeyframe:f,dts:p,cts:s,pts:p+s};f&&(b.fileposition=o),y&&(y.samples.push(b),y.length+=u)}},e.prototype._parseHEVCVideoData=function(e,t,i,r,o,a,s){for(var l=this._littleEndian,d=new DataView(e,t,i),c=[],u=0,h=0,A=this._naluLengthSize,p=this._timestampBase+r,f=1===a;h<i;){if(h+4>=i){n.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(h,", dataSize = ").concat(i));break}var _=d.getUint32(h,!l);if(3===A&&(_>>>=8),_>i-A)return void n.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var m=31&d.getUint8(h+A);19!==m&&20!==m||(f=!0);var v=new Uint8Array(e,t+h,A+_),g={type:m,data:v};c.push(g),u+=v.byteLength,h+=A+_}if(c.length){var y=this._videoTrack,b={units:c,length:u,isKeyframe:f,dts:p,cts:s,pts:p+s};f&&(b.fileposition=o),y&&(null==y||y.samples.push(b),y.length+=u)}},e.prototype._parseAV1VideoData=function(e,t,i,r,n,o,a){this._littleEndian;var s,l=[],d=this._timestampBase+r,c=1===o;if(s=i,l.push({unitType:0,data:new Uint8Array(e,t+0,i)}),l.length){var u=this._videoTrack,h={units:l,length:s,isKeyframe:c,dts:d,cts:a,pts:d+a};c&&(h.fileposition=n),u&&(null==u||u.samples.push(h),u.length+=s)}},e}();const E=S,w=function(){function e(){}return e.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onSMPTE2038Metadata=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null},e}();var T,k=function(){this.program_pmt_pid={}};!function(e){e[e.kMPEG1Audio=3]="kMPEG1Audio",e[e.kMPEG2Audio=4]="kMPEG2Audio",e[e.kPESPrivateData=6]="kPESPrivateData",e[e.kADTSAAC=15]="kADTSAAC",e[e.kLOASAAC=17]="kLOASAAC",e[e.kAC3=129]="kAC3",e[e.kEAC3=135]="kEAC3",e[e.kID3=21]="kID3",e[e.kSCTE35=134]="kSCTE35",e[e.kH264=27]="kH264",e[e.kH265=36]="kH265"}(T||(T={}));var R,O=function(){this.pid_stream_type={},this.common_pids={h264:void 0,h265:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,eac3:void 0,mp3:void 0},this.pes_private_data_pids={},this.timed_id3_pids={},this.scte_35_pids={},this.smpte2038_pids={}},C=function(){},B=function(){},x=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0,this.random_access_indicator=0};!function(e){e[e.kUnspecified=0]="kUnspecified",e[e.kSliceNonIDR=1]="kSliceNonIDR",e[e.kSliceDPA=2]="kSliceDPA",e[e.kSliceDPB=3]="kSliceDPB",e[e.kSliceDPC=4]="kSliceDPC",e[e.kSliceIDR=5]="kSliceIDR",e[e.kSliceSEI=6]="kSliceSEI",e[e.kSliceSPS=7]="kSliceSPS",e[e.kSlicePPS=8]="kSlicePPS",e[e.kSliceAUD=9]="kSliceAUD",e[e.kEndOfSequence=10]="kEndOfSequence",e[e.kEndOfStream=11]="kEndOfStream",e[e.kFiller=12]="kFiller",e[e.kSPSExt=13]="kSPSExt",e[e.kReserved0=14]="kReserved0"}(R||(R={}));var I,L,D=function(){},M=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},P=function(){function e(e){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not find H264 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;var r=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],n=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===r||1===n)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_startcode_offset_,r=31&e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3],n=(128&e[i])>>>7,o=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=o,!(r>=R.kReserved0)&&0===n){var a=e.subarray(i,o);(t=new D).type=r,t.data=a}}return t},e}(),U=function(){function e(e,t,i){var r=8+e.byteLength+1+2+t.byteLength,n=!1;66!==e[3]&&77!==e[3]&&88!==e[3]&&(n=!0,r+=4);var o=this.data=new Uint8Array(r);o[0]=1,o[1]=e[1],o[2]=e[2],o[3]=e[3],o[4]=255,o[5]=225;var a=e.byteLength;o[6]=a>>>8,o[7]=255&a;var s=8;o.set(e,8),o[s+=a]=1;var l=t.byteLength;o[s+1]=l>>>8,o[s+2]=255&l,o.set(t,s+3),s+=3+l,n&&(o[s]=252|i.chroma_format_idc,o[s+1]=248|i.bit_depth_luma-8,o[s+2]=248|i.bit_depth_chroma-8,o[s+3]=0,s+=4)}return e.prototype.getData=function(){return this.data},e}();!function(e){e[e.kNull=0]="kNull",e[e.kAACMain=1]="kAACMain",e[e.kAAC_LC=2]="kAAC_LC",e[e.kAAC_SSR=3]="kAAC_SSR",e[e.kAAC_LTP=4]="kAAC_LTP",e[e.kAAC_SBR=5]="kAAC_SBR",e[e.kAAC_Scalable=6]="kAAC_Scalable",e[e.kLayer1=32]="kLayer1",e[e.kLayer2=33]="kLayer2",e[e.kLayer3=34]="kLayer3"}(I||(I={})),function(e){e[e.k96000Hz=0]="k96000Hz",e[e.k88200Hz=1]="k88200Hz",e[e.k64000Hz=2]="k64000Hz",e[e.k48000Hz=3]="k48000Hz",e[e.k44100Hz=4]="k44100Hz",e[e.k32000Hz=5]="k32000Hz",e[e.k24000Hz=6]="k24000Hz",e[e.k22050Hz=7]="k22050Hz",e[e.k16000Hz=8]="k16000Hz",e[e.k12000Hz=9]="k12000Hz",e[e.k11025Hz=10]="k11025Hz",e[e.k8000Hz=11]="k8000Hz",e[e.k7350Hz=12]="k7350Hz"}(L||(L={}));var F,N,V=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],G=(F=function(e,t){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},F(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}F(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),j=function(){},$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return G(t,e),t}(j),W=function(){function e(e){this.TAG="AACADTSParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found ADTS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(4095==(i[t+0]<<8|i[t+1])>>>4)return t;t++}},e.prototype.readNextAACFrame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,r=(8&e[i+1])>>>3,n=(6&e[i+1])>>>1,o=1&e[i+1],a=(192&e[i+2])>>>6,s=(60&e[i+2])>>>2,l=(1&e[i+2])<<2|(192&e[i+3])>>>6,d=(3&e[i+3])<<11|e[i+4]<<3|(224&e[i+5])>>>5;if(e[i+6],i+d>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var c=1===o?7:9,u=d-c;i+=c;var h=this.findNextSyncwordOffset(i+u);if(this.current_syncword_offset_=h,(0===r||1===r)&&0===n){var A=e.subarray(i,i+u);(t=new j).audio_object_type=a+1,t.sampling_freq_index=s,t.sampling_frequency=V[s],t.channel_config=l,t.data=A}}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),Q=function(){function e(e){this.TAG="AACLOASParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found LOAS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+1>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(695==(i[t+0]<<3|i[t+1]>>>5))return t;t++}},e.prototype.getLATMValue=function(e){for(var t=e.readBits(2),i=0,r=0;r<=t;r++)i<<=8,i|=e.readByte();return i},e.prototype.readNextAACFrame=function(e){for(var t=this.data_,i=null;null==i&&!this.eof_flag_;){var r=this.current_syncword_offset_,o=(31&t[r+1])<<8|t[r+2];if(r+3+o>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var a=new A(t.subarray(r+3,r+3+o)),s=null;if(a.readBool()){if(null==e){n.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(r+3+o),a.destroy();continue}s=e}else{var l=a.readBool();if(l&&a.readBool()){n.A.e(this.TAG,"audioMuxVersionA is Not Supported"),a.destroy();break}if(l&&this.getLATMValue(a),!a.readBool()){n.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),a.destroy();break}if(0!==a.readBits(6)){n.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),a.destroy();break}if(0!==a.readBits(4)){n.A.e(this.TAG,"more than 2 numProgram Not Supported"),a.destroy();break}if(0!==a.readBits(3)){n.A.e(this.TAG,"more than 2 numLayer Not Supported"),a.destroy();break}var d=l?this.getLATMValue(a):0,c=a.readBits(5);d-=5;var u=a.readBits(4);d-=4;var h=a.readBits(4);d-=4,a.readBits(3),(d-=3)>0&&a.readBits(d);var p=a.readBits(3);if(0!==p){n.A.e(this.TAG,"frameLengthType = ".concat(p,". Only frameLengthType = 0 Supported")),a.destroy();break}a.readByte();var f=a.readBool();if(f)if(l)this.getLATMValue(a);else{for(var _=0;;){_<<=8;var m=a.readBool();if(_+=a.readByte(),!m)break}console.log(_)}a.readBool()&&a.readByte(),(s=new $).audio_object_type=c,s.sampling_freq_index=u,s.sampling_frequency=V[s.sampling_freq_index],s.channel_config=h,s.other_data_present=f}for(var v=0;;){var g=a.readByte();if(v+=g,255!==g)break}for(var y=new Uint8Array(v),b=0;b<v;b++)y[b]=a.readByte();(i=new $).audio_object_type=s.audio_object_type,i.sampling_freq_index=s.sampling_freq_index,i.sampling_frequency=V[s.sampling_freq_index],i.channel_config=s.channel_config,i.other_data_present=s.other_data_present,i.data=y,this.current_syncword_offset_=this.findNextSyncwordOffset(r+3+o)}return i},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),z=function(e){var t=[],i=e.audio_object_type,r=e.audio_object_type,n=e.sampling_freq_index,o=e.channel_config,a=0,s=navigator.userAgent.toLowerCase();s.includes("firefox")?n>=6?(r=5,t=new Array(4),a=n-3):(r=2,t=new Array(2),a=n):s.includes("android")?(r=2,t=new Array(2),a=n):(r=5,a=n,t=new Array(4),n>=6?a=n-3:1===o&&(r=2,t=new Array(2),a=n)),t[0]=r<<3,t[0]|=(15&n)>>>1,t[1]=(15&n)<<7,t[1]|=(15&o)<<3,5===r&&(t[1]|=(15&a)>>>1,t[2]=(1&a)<<7,t[2]|=8,t[3]=0),this.config=t,this.sampling_rate=V[n],this.channel_count=o,this.codec_mimetype="mp4a.40."+r.toString(),this.original_codec_mimetype="mp4a.40."+i.toString()},H=function(){},q=function(){};!function(e){e[e.kSpliceNull=0]="kSpliceNull",e[e.kSpliceSchedule=4]="kSpliceSchedule",e[e.kSpliceInsert=5]="kSpliceInsert",e[e.kTimeSignal=6]="kTimeSignal",e[e.kBandwidthReservation=7]="kBandwidthReservation",e[e.kPrivateCommand=255]="kPrivateCommand"}(N||(N={}));var Y,X=function(e){var t=e.readBool();return t?(e.readBits(6),{time_specified_flag:t,pts_time:4*e.readBits(31)+e.readBits(2)}):(e.readBits(7),{time_specified_flag:t})},Z=function(e){var t=e.readBool();return e.readBits(6),{auto_return:t,duration:4*e.readBits(31)+e.readBits(2)}},K=function(e,t){var i=t.readBits(8);return e?{component_tag:i}:{component_tag:i,splice_time:X(t)}},J=function(e){return{component_tag:e.readBits(8),utc_splice_time:e.readBits(32)}},ee=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var r={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return r;if(r.out_of_network_indicator=e.readBool(),r.program_splice_flag=e.readBool(),r.duration_flag=e.readBool(),e.readBits(5),r.program_splice_flag)r.utc_splice_time=e.readBits(32);else{r.component_count=e.readBits(8),r.components=[];for(var n=0;n<r.component_count;n++)r.components.push(J(e))}return r.duration_flag&&(r.break_duration=Z(e)),r.unique_program_id=e.readBits(16),r.avail_num=e.readBits(8),r.avails_expected=e.readBits(8),r},te=function(e,t,i,r){return{descriptor_tag:e,descriptor_length:t,identifier:i,provider_avail_id:r.readBits(32)}},ie=function(e,t,i,r){var n=r.readBits(8),o=r.readBits(3);r.readBits(5);for(var a="",s=0;s<o;s++)a+=String.fromCharCode(r.readBits(8));return{descriptor_tag:e,descriptor_length:t,identifier:i,preroll:n,dtmf_count:o,DTMF_char:a}},re=function(e){var t=e.readBits(8);return e.readBits(7),{component_tag:t,pts_offset:4*e.readBits(31)+e.readBits(2)}},ne=function(e,t,i,r){var n=r.readBits(32),o=r.readBool();r.readBits(7);var a={descriptor_tag:e,descriptor_length:t,identifier:i,segmentation_event_id:n,segmentation_event_cancel_indicator:o};if(o)return a;if(a.program_segmentation_flag=r.readBool(),a.segmentation_duration_flag=r.readBool(),a.delivery_not_restricted_flag=r.readBool(),a.delivery_not_restricted_flag?r.readBits(5):(a.web_delivery_allowed_flag=r.readBool(),a.no_regional_blackout_flag=r.readBool(),a.archive_allowed_flag=r.readBool(),a.device_restrictions=r.readBits(2)),!a.program_segmentation_flag){a.component_count=r.readBits(8),a.components=[];for(var s=0;s<a.component_count;s++)a.components.push(re(r))}a.segmentation_duration_flag&&(a.segmentation_duration=r.readBits(40)),a.segmentation_upid_type=r.readBits(8),a.segmentation_upid_length=r.readBits(8);var l=new Uint8Array(a.segmentation_upid_length);for(s=0;s<a.segmentation_upid_length;s++)l[s]=r.readBits(8);return a.segmentation_upid=l.buffer,a.segmentation_type_id=r.readBits(8),a.segment_num=r.readBits(8),a.segments_expected=r.readBits(8),52!==a.segmentation_type_id&&54!==a.segmentation_type_id&&56!==a.segmentation_type_id&&58!==a.segmentation_type_id||(a.sub_segment_num=r.readBits(8),a.sub_segments_expected=r.readBits(8)),a},oe=function(e,t,i,r){return{descriptor_tag:e,descriptor_length:t,identifier:i,TAI_seconds:r.readBits(48),TAI_ns:r.readBits(32),UTC_offset:r.readBits(16)}},ae=function(e){return{component_tag:e.readBits(8),ISO_code:String.fromCharCode(e.readBits(8),e.readBits(8),e.readBits(8)),Bit_Stream_Mode:e.readBits(3),Num_Channels:e.readBits(4),Full_Srvc_Audio:e.readBool()}},se=function(e,t,i,r){for(var n=r.readBits(4),o=[],a=0;a<n;a++)o.push(ae(r));return{descriptor_tag:e,descriptor_length:t,identifier:i,audio_count:n,components:o}};!function(e){e[e.kSliceIDR_W_RADL=19]="kSliceIDR_W_RADL",e[e.kSliceIDR_N_LP=20]="kSliceIDR_N_LP",e[e.kSliceCRA_NUT=21]="kSliceCRA_NUT",e[e.kSliceVPS=32]="kSliceVPS",e[e.kSliceSPS=33]="kSliceSPS",e[e.kSlicePPS=34]="kSlicePPS",e[e.kSliceAUD=35]="kSliceAUD"}(Y||(Y={}));var le=function(){},de=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},ce=function(){function e(e){this.TAG="H265AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not find H265 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;var r=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],n=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===r||1===n)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_startcode_offset_,r=e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3]>>1&63,n=(128&e[i])>>>7,o=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=o,0===n){var a=e.subarray(i,o);(t=new le).type=r,t.data=a}}return t},e}(),ue=function(){function e(e,t,i,r){var n=23+(5+e.byteLength)+(5+t.byteLength)+(5+i.byteLength),o=this.data=new Uint8Array(n);o[0]=1,o[1]=(3&r.general_profile_space)<<6|(r.general_tier_flag?1:0)<<5|31&r.general_profile_idc,o[2]=r.general_profile_compatibility_flags_1,o[3]=r.general_profile_compatibility_flags_2,o[4]=r.general_profile_compatibility_flags_3,o[5]=r.general_profile_compatibility_flags_4,o[6]=r.general_constraint_indicator_flags_1,o[7]=r.general_constraint_indicator_flags_2,o[8]=r.general_constraint_indicator_flags_3,o[9]=r.general_constraint_indicator_flags_4,o[10]=r.general_constraint_indicator_flags_5,o[11]=r.general_constraint_indicator_flags_6,o[12]=r.general_level_idc,o[13]=240|(3840&r.min_spatial_segmentation_idc)>>8,o[14]=255&r.min_spatial_segmentation_idc,o[15]=252|3&r.parallelismType,o[16]=252|3&r.chroma_format_idc,o[17]=248|7&r.bit_depth_luma_minus8,o[18]=248|7&r.bit_depth_chroma_minus8,o[19]=0,o[20]=0,o[21]=(3&r.constant_frame_rate)<<6|(7&r.num_temporal_layers)<<3|(r.temporal_id_nested?1:0)<<2|3,o[22]=3,o[23]=128|Y.kSliceVPS,o[24]=0,o[25]=1,o[26]=(65280&e.byteLength)>>8,o[27]=255&e.byteLength,o.set(e,28),o[23+(5+e.byteLength)+0]=128|Y.kSliceSPS,o[23+(5+e.byteLength)+1]=0,o[23+(5+e.byteLength)+2]=1,o[23+(5+e.byteLength)+3]=(65280&t.byteLength)>>8,o[23+(5+e.byteLength)+4]=255&t.byteLength,o.set(t,23+(5+e.byteLength)+5),o[23+(5+e.byteLength+5+t.byteLength)+0]=128|Y.kSlicePPS,o[23+(5+e.byteLength+5+t.byteLength)+1]=0,o[23+(5+e.byteLength+5+t.byteLength)+2]=1,o[23+(5+e.byteLength+5+t.byteLength)+3]=(65280&i.byteLength)>>8,o[23+(5+e.byteLength+5+t.byteLength)+4]=255&i.byteLength,o.set(i,23+(5+e.byteLength+5+t.byteLength)+5)}return e.prototype.getData=function(){return this.data},e}(),he=function(){},Ae=function(){},pe=function(){},fe=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],_e=function(){function e(e){this.TAG="AC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]))return t;t++}},e.prototype.readNextAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,r=e[i+4]>>6,n=[48e3,44200,33e3][r],o=63&e[i+4],a=2*fe[r][o];if(i+a>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var s=this.findNextSyncwordOffset(i+a);this.current_syncword_offset_=s;var l=e[i+5]>>3,d=7&e[i+5],c=e[i+6]>>5,u=0;1&c&&1!==c&&(u+=2),4&c&&(u+=2),2===c&&(u+=2);var h=(e[i+6]<<8|e[i+7])>>12-u&1,A=[2,1,2,3,3,4,4,5][c]+h;(t=new pe).sampling_frequency=n,t.channel_count=A,t.channel_mode=c,t.bit_stream_identification=l,t.low_frequency_effects_channel_on=h,t.bit_stream_mode=d,t.frame_size_code=o,t.data=e.subarray(i,i+a)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),me=function(e){var t;t=[e.sampling_rate_code<<6|e.bit_stream_identification<<1|e.bit_stream_mode>>2,(3&e.bit_stream_mode)<<6|e.channel_mode<<3|e.low_frequency_effects_channel_on<<2|e.frame_size_code>>4,e.frame_size_code<<4&224],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.bit_stream_mode=e.bit_stream_mode,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},ve=function(){},ge=function(){function e(e){this.TAG="EAC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]))return t;t++}},e.prototype.readNextEAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,r=new A(e.subarray(i+2)),n=(r.readBits(2),r.readBits(3),r.readBits(11)+1<<1),o=r.readBits(2),a=null,s=null;3===o?(a=[24e3,22060,16e3][o=r.readBits(2)],s=3):(a=[48e3,44100,32e3][o],s=r.readBits(2));var l=r.readBits(3),d=r.readBits(1),c=r.readBits(5);if(i+n>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var u=this.findNextSyncwordOffset(i+n);this.current_syncword_offset_=u;var h=[2,1,2,3,3,4,4,5][l]+d;r.destroy(),(t=new ve).sampling_frequency=a,t.channel_count=h,t.channel_mode=l,t.bit_stream_identification=c,t.low_frequency_effects_channel_on=d,t.frame_size=n,t.num_blks=[1,2,3,6][s],t.data=e.subarray(i,i+n)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),ye=function(e){var t,i=Math.floor(e.frame_size*e.sampling_frequency/(16*e.num_blks));t=[255&i,248&i,e.sampling_rate_code<<6|e.bit_stream_identification<<1,e.channel_mode<<1|e.low_frequency_effects_channel_on,0],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.num_blks=e.num_blks,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},be=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Se=function(){return Se=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Se.apply(this,arguments)},Ee=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a},we=function(e,t,i){if(2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},Te=function(e){function t(t,i){var r=e.call(this)||this;return r.TAG="TSDemuxer",r.first_parse_=!0,r.media_info_=new a.A,r.timescale_=90,r.duration_=0,r.current_pmt_pid_=-1,r.program_pmt_map_={},r.pes_slice_queues_={},r.section_slice_queues_={},r.video_metadata_={vps:void 0,sps:void 0,pps:void 0,details:void 0},r.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},r.aac_last_sample_pts_=void 0,r.aac_last_incomplete_data_=null,r.has_video_=!1,r.has_audio_=!1,r.video_init_segment_dispatched_=!1,r.audio_init_segment_dispatched_=!1,r.video_metadata_changed_=!1,r.audio_metadata_changed_=!1,r.loas_previous_frame=null,r.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},r.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},r.ts_packet_size_=t.ts_packet_size,r.sync_offset_=t.sync_offset,r.config_=i,r}return be(t,e),t.prototype.destroy=function(){this.media_info_=null,this.pes_slice_queues_=null,this.section_slice_queues_=null,this.video_metadata_=null,this.audio_metadata_=null,this.aac_last_incomplete_data_=null,this.video_track_=null,this.audio_track_=null,e.prototype.destroy.call(this)},t.probe=function(e){var t=new Uint8Array(e),i=-1,r=188;if(t.byteLength<=3*r)return{needMoreData:!0};for(;-1===i;){for(var o=Math.min(1e3,t.byteLength-3*r),a=0;a<o;){if(71===t[a]&&71===t[a+r]&&71===t[a+2*r]){i=a;break}a++}if(-1===i)if(188===r)r=192;else{if(192!==r)break;r=204}}return-1===i?{match:!1}:(192===r&&i>=4?(n.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),i-=4):204===r&&n.A.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:r,sync_offset:i})},t.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},t.prototype.resetMediaInfo=function(){this.media_info_=new a.A},t.prototype.parseChunks=function(e,t){var i;if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new c.j4("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var r=0;for(this.first_parse_&&(this.first_parse_=!1,r=this.sync_offset_);r+this.ts_packet_size_<=e.byteLength;){var o=t+r;192===this.ts_packet_size_&&(r+=4);var a=new Uint8Array(e,r,188),s=a[0];if(71!==s){n.A.e(this.TAG,"sync_byte = ".concat(s,", not 0x47"));break}var l=(64&a[1])>>>6,d=(a[1],(31&a[1])<<8|a[2]),u=(48&a[3])>>>4,h=15&a[3],A={},p=4;if(2===u||3===u){var f=a[4];if(5+f===188){r+=188,204===this.ts_packet_size_&&(r+=16);continue}f>0&&(A=this.parseAdaptationField(e,r+4,1+f)),p=5+f}if(1===u||3===u)if(0===d||d===this.current_pmt_pid_||void 0!==this.pmt_&&this.pmt_.pid_stream_type[d]===T.kSCTE35){var _=188-p;this.handleSectionSlice(e,r+p,_,{pid:d,file_position:o,payload_unit_start_indicator:l,continuity_conunter:h,random_access_indicator:A.random_access_indicator})}else if(void 0!==(null===(i=this.pmt_)||void 0===i?void 0:i.pid_stream_type[d])){_=188-p;var m=this.pmt_.pid_stream_type[d];(d===this.pmt_.common_pids.h264||d===this.pmt_.common_pids.h265||d===this.pmt_.common_pids.adts_aac||d===this.pmt_.common_pids.loas_aac||d===this.pmt_.common_pids.ac3||d===this.pmt_.common_pids.eac3||d===this.pmt_.common_pids.opus||d===this.pmt_.common_pids.mp3||this.pmt_.pes_private_data_pids[d]||this.pmt_.timed_id3_pids[d])&&this.handlePESSlice(e,r+p,_,{pid:d,stream_type:m,file_position:o,payload_unit_start_indicator:l,continuity_conunter:h,random_access_indicator:A.random_access_indicator})}r+=188,204===this.ts_packet_size_&&(r+=16)}return this.dispatchAudioVideoMediaSegment(),r},t.prototype.parseAdaptationField=function(e,t,i){var r=new Uint8Array(e,t,i),o=r[0];return o>0?o>183?(n.A.w(this.TAG,"Illegal adaptation_field_length: ".concat(o)),{}):{discontinuity_indicator:(128&r[1])>>>7,random_access_indicator:(64&r[1])>>>6,elementary_stream_priority_indicator:(32&r[1])>>>5}:{}},t.prototype.handleSectionSlice=function(e,t,i,r){var n=new Uint8Array(e,t,i),o=this.section_slice_queues_?this.section_slice_queues_[r.pid]:{};if(r.payload_unit_start_indicator){var a=n[0];if(void 0!==o&&0!==(null==o?void 0:o.total_length)){var s=new Uint8Array(e,t+1,Math.min(i,a));o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,r):this.clearSlices(o,r)}for(var l=1+a;l<n.byteLength&&255!==n[l+0];){var d=(15&n[l+1])<<8|n[l+2];this.section_slice_queues_&&(this.section_slice_queues_[r.pid]=new x,o=this.section_slice_queues_[r.pid]),o.expected_length=d+3,o.file_position=r.file_position,o.random_access_indicator=r.random_access_indicator,s=new Uint8Array(e,t+l,Math.min(i-l,o.expected_length-o.total_length)),o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,r):o.total_length>=o.expected_length&&this.clearSlices(o,r),l+=s.byteLength}}else void 0!==o&&0!==o.total_length&&(s=new Uint8Array(e,t,Math.min(i,o.expected_length-o.total_length)),o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,r):o.total_length>=o.expected_length&&this.clearSlices(o,r))},t.prototype.handlePESSlice=function(e,t,i,r){var o=new Uint8Array(e,t,i),a=o[0]<<16|o[1]<<8|o[2],s=(o[3],o[4]<<8|o[5]);if(r.payload_unit_start_indicator){if(1!==a)return void n.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(a));var l=this.pes_slice_queues_[r.pid];l&&(0===l.expected_length||l.expected_length===l.total_length?this.emitPESSlices(l,r):this.clearSlices(l,r)),this.pes_slice_queues_&&(this.pes_slice_queues_[r.pid]=new x,this.pes_slice_queues_[r.pid].file_position=r.file_position,this.pes_slice_queues_[r.pid].random_access_indicator=r.random_access_indicator)}if(void 0!==this.pes_slice_queues_[r.pid]){var d=this.pes_slice_queues_[r.pid];d.slices.push(o),r.payload_unit_start_indicator&&(d.expected_length=0===s?0:s+6),d.total_length+=o.byteLength,d.expected_length>0&&d.expected_length===d.total_length?this.emitPESSlices(d,r):d.expected_length>0&&d.expected_length<d.total_length&&this.clearSlices(d,r)}},t.prototype.emitSectionSlices=function(e,t){for(var i=new Uint8Array(e.total_length),r=0,n=0;r<e.slices.length;r++){var o=e.slices[r];i.set(o,n),n+=o.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var a=new B;a.pid=t.pid,a.data=i,a.file_position=e.file_position,a.random_access_indicator=e.random_access_indicator,this.parseSection(a)},t.prototype.emitPESSlices=function(e,t){for(var i=new Uint8Array(e.total_length),r=0,n=0;r<e.slices.length;r++){var o=e.slices[r];i.set(o,n),n+=o.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var a=new C;a.pid=t.pid,a.data=i,a.stream_type=t.stream_type,a.file_position=e.file_position,a.random_access_indicator=e.random_access_indicator,this.parsePES(a)},t.prototype.clearSlices=function(e,t){e.slices=[],e.expected_length=-1,e.total_length=0},t.prototype.parseSection=function(e){var t,i=e.data,r=e.pid;0===r?this.parsePAT(i):r===this.current_pmt_pid_?this.parsePMT(i):(null===(t=this.pmt_)||void 0===t?void 0:t.scte_35_pids[r])&&this.parseSCTE35(i)},t.prototype.parsePES=function(e){var t=e.data,i=t[0]<<16|t[1]<<8|t[2],r=t[3],o=t[4]<<8|t[5];if(1===i)if(188!==r&&190!==r&&191!==r&&240!==r&&241!==r&&255!==r&&242!==r&&248!==r){t[6];var a=(192&t[7])>>>6,s=t[8],l=void 0,d=void 0;2!==a&&3!==a||(l=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,d=3===a?536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2:l);var c=9+s,u=void 0;if(0!==o){if(o<3+s)return void n.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");u=o-3-s}else u=t.byteLength-c;var h=t.subarray(c,c+u);switch(e.stream_type){case T.kMPEG1Audio:case T.kMPEG2Audio:this.parseMP3Payload(h,l);break;case T.kPESPrivateData:this.pmt_.common_pids.opus===e.pid?this.parseOpusPayload(h,l):this.pmt_.common_pids.ac3===e.pid?this.parseAC3Payload(h,l):this.pmt_.common_pids.eac3===e.pid?this.parseEAC3Payload(h,l):this.pmt_.smpte2038_pids[e.pid]?this.parseSMPTE2038MetadataPayload(h,l,d,e.pid,r):this.parsePESPrivateDataPayload(h,l,d,e.pid,r);break;case T.kADTSAAC:this.parseADTSAACPayload(h,l);break;case T.kLOASAAC:this.parseLOASAACPayload(h,l);break;case T.kAC3:this.parseAC3Payload(h,l);break;case T.kEAC3:this.parseEAC3Payload(h,l);break;case T.kID3:this.parseTimedID3MetadataPayload(h,l,d,e.pid,r);break;case T.kH264:this.parseH264Payload(h,l,d,e.file_position,e.random_access_indicator);break;case T.kH265:this.parseH265Payload(h,l,d,e.file_position,e.random_access_indicator)}}else 188!==r&&191!==r&&240!==r&&241!==r&&255!==r&&242!==r&&248!==r||e.stream_type!==T.kPESPrivateData||(c=6,u=void 0,u=0!==o?o:t.byteLength-c,h=t.subarray(c,c+u),this.parsePESPrivateDataPayload(h,void 0,void 0,e.pid,r));else n.A.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(i))},t.prototype.parsePAT=function(e){var t=e[0];if(0===t){var i=(15&e[1])<<8|e[2],r=(e[3],e[4],(62&e[5])>>>1),o=1&e[5],a=e[6],s=(e[7],null);if(1===o&&0===a)(s=new k).version_number=r;else if(null==(s=this.pat_))return;for(var l=i-5-4,d=-1,c=-1,u=8;u<8+l;u+=4){var h=e[u]<<8|e[u+1],A=(31&e[u+2])<<8|e[u+3];0===h?s.network_pid=A:(s.program_pmt_pid[h]=A,-1===d&&(d=h),-1===c&&(c=A))}1===o&&0===a&&(void 0===this.pat_&&n.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(s))),this.pat_=s,this.current_program_=d,this.current_pmt_pid_=c)}else n.A.e(this.TAG,"parsePAT: table_id ".concat(t," is not corresponded to PAT!"))},t.prototype.parsePMT=function(e){var t=e[0];if(2===t){var i=(15&e[1])<<8|e[2],r=e[3]<<8|e[4],o=(62&e[5])>>>1,a=1&e[5],s=e[6],l=(e[7],null);if(1===a&&0===s)(l=new O).program_number=r,l.version_number=o,this.program_pmt_map_[r]=l;else if(null==(l=this.program_pmt_map_[r]))return;e[8],e[9];for(var d=(15&e[10])<<8|e[11],c=12+d,u=i-9-d-4,h=c;h<c+u;){var A=e[h],p=(31&e[h+1])<<8|e[h+2],f=(15&e[h+3])<<8|e[h+4];l.pid_stream_type[p]=A;var _=l.common_pids.h264||l.common_pids.h265,m=l.common_pids.adts_aac||l.common_pids.loas_aac||l.common_pids.ac3||l.common_pids.eac3||l.common_pids.opus||l.common_pids.mp3;if(A!==T.kH264||_)if(A!==T.kH265||_)if(A!==T.kADTSAAC||m)if(A!==T.kLOASAAC||m)if(A!==T.kAC3||m)if(A!==T.kEAC3||m)if(A!==T.kMPEG1Audio&&A!==T.kMPEG2Audio||m)if(A===T.kPESPrivateData){if(l.pes_private_data_pids[p]=!0,f>0){for(var v=h+5;v<h+5+f;){var g=e[v+0],y=e[v+1];if(5===g){var b=String.fromCharCode.apply(String,we([],Ee(Array.from(e.subarray(v+2,v+2+y))),!1));"VANC"===b?l.smpte2038_pids[p]=!0:"Opus"===b&&(l.common_pids.opus=p)}else if(127===g&&p===l.common_pids.opus){var S=null;if(128===e[v+2]&&(S=e[v+3]),null==S){n.A.e(this.TAG,"Not Supported Opus channel count.");continue}var E={codec:"opus",channel_count:15&S?15&S:2,channel_config_code:S,sample_rate:48e3},w={codec:"opus",meta:E};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(w)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(w)):(this.audio_metadata_=E,this.dispatchAudioInitSegment(w))}v+=2+y}var k=e.subarray(h+5,h+5+f);this.dispatchPESPrivateDataDescriptor(p,A,k)}}else A===T.kID3?l.timed_id3_pids[p]=!0:A===T.kSCTE35&&(l.scte_35_pids[p]=!0);else l.common_pids.mp3=p;else l.common_pids.eac3=p;else l.common_pids.ac3=p;else l.common_pids.loas_aac=p;else l.common_pids.adts_aac=p;else l.common_pids.h265=p;else l.common_pids.h264=p;h+=5+f}r===this.current_program_&&(void 0===this.pmt_&&n.A.v(this.TAG,"Parsed first PMT: ".concat(JSON.stringify(l))),this.pmt_=l,(l.common_pids.h264||l.common_pids.h265)&&(this.has_video_=!0),(l.common_pids.adts_aac||l.common_pids.loas_aac||l.common_pids.ac3||l.common_pids.opus||l.common_pids.mp3)&&(this.has_audio_=!0))}else n.A.e(this.TAG,"parsePMT: table_id ".concat(t," is not corresponded to PMT!"))},t.prototype.parseSCTE35=function(e){var t=function(e){var t,i,r,n,o,a,s=new A(e),l=s.readBits(8),d=s.readBool(),c=s.readBool();s.readBits(2);var u=s.readBits(12),h=s.readBits(8),p=s.readBool(),f=s.readBits(6),_=4*s.readBits(31)+s.readBits(2),m=s.readBits(8),v=s.readBits(12),g=s.readBits(12),y=s.readBits(8),b=null;y===N.kSpliceNull?b={}:y===N.kSpliceSchedule?b=function(e){for(var t=e.readBits(8),i=[],r=0;r<t;r++)i.push(ee(e));return{splice_count:t,events:i}}(s):y===N.kSpliceInsert?b=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var r={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return r;if(r.out_of_network_indicator=e.readBool(),r.program_splice_flag=e.readBool(),r.duration_flag=e.readBool(),r.splice_immediate_flag=e.readBool(),e.readBits(4),r.program_splice_flag&&!r.splice_immediate_flag&&(r.splice_time=X(e)),!r.program_splice_flag){r.component_count=e.readBits(8),r.components=[];for(var n=0;n<r.component_count;n++)r.components.push(K(r.splice_immediate_flag,e))}return r.duration_flag&&(r.break_duration=Z(e)),r.unique_program_id=e.readBits(16),r.avail_num=e.readBits(8),r.avails_expected=e.readBits(8),r}(s):y===N.kTimeSignal?b=function(e){return{splice_time:X(e)}}(s):y===N.kBandwidthReservation?b={}:y===N.kPrivateCommand?b=function(e,t){for(var i=String.fromCharCode(t.readBits(8),t.readBits(8),t.readBits(8),t.readBits(8)),r=new Uint8Array(e-4),n=0;n<e-4;n++)r[n]=t.readBits(8);return{identifier:i,private_data:r.buffer}}(g,s):s.readBits(8*g);for(var S=[],E=s.readBits(16),w=0;w<E;){var T=s.readBits(8),k=s.readBits(8),R=String.fromCharCode(s.readBits(8),s.readBits(8),s.readBits(8),s.readBits(8));0===T?S.push(te(T,k,R,s)):1===T?S.push(ie(T,k,R,s)):2===T?S.push(ne(T,k,R,s)):3===T?S.push(oe(T,k,R,s)):4===T?S.push(se(T,k,R,s)):s.readBits(8*(k-4)),w+=2+k}var O={table_id:l,section_syntax_indicator:d,private_indicator:c,section_length:u,protocol_version:h,encrypted_packet:p,encryption_algorithm:f,pts_adjustment:_,cw_index:m,tier:v,splice_command_length:g,splice_command_type:y,splice_command:b,descriptor_loop_length:E,splice_descriptors:S,E_CRC32:p?s.readBits(32):void 0,CRC32:s.readBits(32)};if(y===N.kSpliceInsert){var C=b;if(C.splice_event_cancel_indicator)return{splice_command_type:y,detail:O,data:e};if(C.program_splice_flag&&!C.splice_immediate_flag){var B=C.duration_flag?null===(t=null==C?void 0:C.break_duration)||void 0===t?void 0:t.auto_return:void 0,x=C.duration_flag?((null===(i=null==C?void 0:C.break_duration)||void 0===i?void 0:i.duration)||0)/90:void 0;return(null===(r=C.splice_time)||void 0===r?void 0:r.time_specified_flag)?{splice_command_type:y,pts:(_+((null===(n=null==C?void 0:C.splice_time)||void 0===n?void 0:n.pts_time)||0))%Math.pow(2,33),auto_return:B,duraiton:x,detail:O,data:e}:{splice_command_type:y,auto_return:B,duraiton:x,detail:O,data:e}}return{splice_command_type:y,auto_return:B=C.duration_flag?null===(o=C.break_duration)||void 0===o?void 0:o.auto_return:void 0,duraiton:x=C.duration_flag?((null===(a=C.break_duration)||void 0===a?void 0:a.duration)||0)/90:void 0,detail:O,data:e}}if(y===N.kTimeSignal){var I=b;return I.splice_time.time_specified_flag?{splice_command_type:y,pts:(_+(I.splice_time.pts_time||0))%Math.pow(2,33),detail:O,data:e}:{splice_command_type:y,detail:O,data:e}}return{splice_command_type:y,detail:O,data:e}}(e);if(void 0!==t.pts){var i=Math.floor(t.pts/this.timescale_);t.pts=i}else t.nearest_pts=this.aac_last_sample_pts_;this.onSCTE35Metadata&&this.onSCTE35Metadata(t)},t.prototype.parseH264Payload=function(e,t,i,r,o){for(var a,s,l=new P(e),d=null,c=[],u=0,h=!1;null!=(d=l.readNextNaluPayload());){var A=new M(d);if(A.type===R.kSliceSPS){var f=p.parseSPS(d.data);this.video_init_segment_dispatched_?this.detectVideoMetadataChange(A,f)&&(n.A.v(this.TAG,"H264: Critical h264 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:A,pps:void 0,details:f}):this.video_metadata_&&(this.video_metadata_.sps=A,this.video_metadata_.details=f)}else A.type===R.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(this.video_metadata_&&(this.video_metadata_.pps=A),(null===(a=this.video_metadata_)||void 0===a?void 0:a.sps)&&(null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):(A.type===R.kSliceIDR||A.type===R.kSliceNonIDR&&1===o)&&(h=!0);this.video_init_segment_dispatched_&&(c.push(A),u+=A.data.byteLength)}var _=Math.floor(t/this.timescale_),m=Math.floor(i/this.timescale_);if(c.length){var v=this.video_track_,g={units:c,length:u,isKeyframe:h,dts:m,pts:_,cts:_-m,file_position:r};v&&(v.samples.push(g),v.length+=u)}},t.prototype.parseH265Payload=function(e,t,i,r,o){for(var a,s,l,d,c,u,h,A=new ce(e),p=null,f=[],m=0,v=!1;null!=(p=A.readNextNaluPayload());){var g=new de(p);if(g.type===Y.kSliceVPS){if(!this.video_init_segment_dispatched_){var y=_.parseVPS(p.data);this.video_metadata_&&(this.video_metadata_.vps=g,this.video_metadata_.details=Se(Se({},null===(a=this.video_metadata_)||void 0===a?void 0:a.details),y))}}else g.type===Y.kSliceSPS?(y=_.parseSPS(p.data),this.video_init_segment_dispatched_?this.detectVideoMetadataChange(g,y)&&(n.A.v(this.TAG,"H265: Critical h265 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:g,pps:void 0,details:y}):this.video_metadata_&&(this.video_metadata_.sps=g,this.video_metadata_.details=Se(Se({},null===(s=this.video_metadata_)||void 0===s?void 0:s.details),y))):g.type===Y.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(y=_.parsePPS(p.data),this.video_metadata_&&(this.video_metadata_.pps=g,this.video_metadata_.details=Se(Se({},null===(l=this.video_metadata_)||void 0===l?void 0:l.details),y)),(null===(d=this.video_metadata_)||void 0===d?void 0:d.vps)&&(null===(c=this.video_metadata_)||void 0===c?void 0:c.sps)&&(null===(u=this.video_metadata_)||void 0===u?void 0:u.pps)&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):g.type!==Y.kSliceIDR_W_RADL&&g.type!==Y.kSliceIDR_N_LP&&g.type!==Y.kSliceCRA_NUT||(v=!0);this.video_init_segment_dispatched_&&(f.push(g),m+=g.data.byteLength)}var b=Math.floor(t/this.timescale_),S=Math.floor(i/this.timescale_);if(f.length){var E=this.video_track_,w={units:f,length:m,isKeyframe:v,dts:S,pts:b,cts:b-S,file_position:r};E&&(null===(h=E.samples)||void 0===h||h.push(w),E.length+=m)}},t.prototype.detectVideoMetadataChange=function(e,t){var i,r,o,a,s,l,d,c,u,h;if(t.codec_mimetype!==(null===(r=null===(i=this.video_metadata_)||void 0===i?void 0:i.details)||void 0===r?void 0:r.codec_mimetype))return n.A.v(this.TAG,"Video: Codec mimeType changed from "+"".concat(null===(o=this.video_metadata_)||void 0===o?void 0:o.details.codec_mimetype," to ").concat(null==t?void 0:t.codec_mimetype)),!0;if(t.codec_size.width!==(null===(s=null===(a=this.video_metadata_)||void 0===a?void 0:a.details)||void 0===s?void 0:s.codec_size.width)||t.codec_size.height!==(null===(d=null===(l=this.video_metadata_)||void 0===l?void 0:l.details)||void 0===d?void 0:d.codec_size.height)){var A=null===(c=this.video_metadata_)||void 0===c?void 0:c.details.codec_size,p=t.codec_size;return n.A.v(this.TAG,"Video: Coded Resolution changed from "+"".concat(A.width,"x").concat(A.height," to ").concat(p.width,"x").concat(p.height)),!0}return t.present_size.width!==(null===(u=this.video_metadata_)||void 0===u?void 0:u.details.present_size.width)&&(n.A.v(this.TAG,"Video: Present resolution width changed from "+"".concat(null===(h=this.video_metadata_)||void 0===h?void 0:h.details.present_size.width," to ").concat(null==t?void 0:t.present_size.width)),!0)},t.prototype.isInitSegmentDispatched=function(){return this.has_video_&&this.has_audio_?this.video_init_segment_dispatched_&&this.audio_init_segment_dispatched_:this.has_video_&&!this.has_audio_?this.video_init_segment_dispatched_:!(this.has_video_||!this.has_audio_)&&this.audio_init_segment_dispatched_},t.prototype.dispatchVideoInitSegment=function(){var e,t,i,r,o,a,s,l,d,c,u,h,A=null===(e=this.video_metadata_)||void 0===e?void 0:e.details,p={type:"video"};p.id=null===(t=this.video_track_)||void 0===t?void 0:t.id,p.timescale=1e3,p.duration=this.duration_,p.codecWidth=A.codec_size.width,p.codecHeight=A.codec_size.height,p.presentWidth=A.present_size.width,p.presentHeight=A.present_size.height,p.profile=A.profile_string,p.level=A.level_string,p.bitDepth=A.bit_depth,p.chromaFormat=A.chroma_format,p.sarRatio=A.sar_ratio,p.frameRate=A.frame_rate;var f=p.frameRate.fps_den,_=p.frameRate.fps_num;if(p.refSampleDuration=f/_*1e3,p.codec=A.codec_mimetype,null===(i=this.video_metadata_)||void 0===i?void 0:i.vps){var m=null===(r=this.video_metadata_)||void 0===r?void 0:r.vps.data.subarray(4),v=null===(a=null===(o=this.video_metadata_)||void 0===o?void 0:o.sps)||void 0===a?void 0:a.data.subarray(4),g=null===(l=null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)||void 0===l?void 0:l.data.subarray(4),y=new ue(m,v,g,A);p.hvcc=y.getData(),this.video_init_segment_dispatched_||n.A.v(this.TAG,"Generated first HEVCDecoderConfigurationRecord for mimeType: ".concat(p.codec))}else{v=null===(c=null===(d=this.video_metadata_)||void 0===d?void 0:d.sps)||void 0===c?void 0:c.data.subarray(4),g=null===(h=null===(u=this.video_metadata_)||void 0===u?void 0:u.pps)||void 0===h?void 0:h.data.subarray(4);var b=new U(v,g,A);p.avcc=b.getData(),this.video_init_segment_dispatched_||n.A.v(this.TAG,"Generated first AVCDecoderConfigurationRecord for mimeType: ".concat(p.codec))}this.onTrackMetadata&&this.onTrackMetadata("video",p),this.video_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var S=this.media_info_;S.hasVideo=!0,S.width=p.codecWidth,S.height=p.codecHeight,S.fps=p.frameRate.fps,S.profile=p.profile,S.level=p.level,S.refFrames=A.ref_frames,S.chromaFormat=A.chroma_format_string,S.sarNum=p.sarRatio.width,S.sarDen=p.sarRatio.height,S.videoCodec=p.codec,S.hasAudio&&S.audioCodec?S.mimeType='video/mp2t; codecs="'.concat(S.videoCodec,",").concat(S.audioCodec,'"'):S.mimeType='video/mp2t; codecs="'.concat(S.videoCodec,'"'),S.isComplete()&&this.onMediaInfo&&this.onMediaInfo(S)},t.prototype.dispatchVideoMediaSegment=function(){var e;this.isInitSegmentDispatched()&&(null===(e=this.video_track_)||void 0===e?void 0:e.length)&&this.onDataAvailable&&this.onDataAvailable(null,this.video_track_)},t.prototype.dispatchAudioMediaSegment=function(){var e;this.isInitSegmentDispatched()&&(null===(e=this.audio_track_)||void 0===e?void 0:e.length)&&this.onDataAvailable&&this.onDataAvailable(this.audio_track_,null)},t.prototype.dispatchAudioVideoMediaSegment=function(){var e,t;this.isInitSegmentDispatched()&&((null===(e=this.audio_track_)||void 0===e?void 0:e.length)||(null===(t=this.video_track_)||void 0===t?void 0:t.length))&&this.onDataAvailable&&this.onDataAvailable(this.audio_track_,this.video_track_)},t.prototype.parseADTSAACPayload=function(e,t){var i,r,o;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var a=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);a.set(this.aac_last_incomplete_data_,0),a.set(e,this.aac_last_incomplete_data_.byteLength),e=a}var s,l=0;if(void 0!==t&&(l=t/this.timescale_),"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){if(void 0===t&&void 0!==this.aac_last_sample_pts_)s=1024/(null===(r=this.audio_metadata_)||void 0===r?void 0:r.sampling_frequency)*1e3,l=this.aac_last_sample_pts_+s;else if(void 0===t)return void n.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){s=1024/this.audio_metadata_.sampling_frequency*1e3;var d=this.aac_last_sample_pts_+s;Math.abs(d-l)>1&&(n.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(d,"ms, PES pts: ").concat(l,"ms")),l=d)}}for(var c=new W(e),u=null,h=l,A=0;null!=(u=c.readNextAACFrame());){s=1024/u.sampling_frequency*1e3;var p={codec:"aac",data:u};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(p)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(p)):(this.audio_metadata_={codec:"aac",audio_object_type:u.audio_object_type,sampling_freq_index:u.sampling_freq_index,sampling_frequency:u.sampling_frequency,channel_config:u.channel_config},this.dispatchAudioInitSegment(p)),A=h;var f=Math.floor(h),_={unit:u.data,length:u.data.byteLength,pts:f,dts:f};this.audio_track_&&(null===(o=this.audio_track_)||void 0===o||o.samples.push(_),this.audio_track_.length+=u.data.byteLength),h+=s}c.hasIncompleteData()&&(this.aac_last_incomplete_data_=c.getIncompleteData()),A&&(this.aac_last_sample_pts_=A)}},t.prototype.parseLOASAACPayload=function(e,t){var i,r,o;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var a=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);a.set(this.aac_last_incomplete_data_,0),a.set(e,this.aac_last_incomplete_data_.byteLength),e=a}var s,l=0;if(void 0!==t&&(l=t/this.timescale_),"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){if(void 0===t&&void 0!==this.aac_last_sample_pts_)s=1024/this.audio_metadata_.sampling_frequency*1e3,l=this.aac_last_sample_pts_+s;else if(void 0===t)return void n.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){s=1024/this.audio_metadata_.sampling_frequency*1e3;var d=this.aac_last_sample_pts_+s;Math.abs(d-l)>1&&(n.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(d,"ms, PES pts: ").concat(l,"ms")),l=d)}}for(var c=new Q(e),u=null,h=l,A=0;null!=(u=c.readNextAACFrame(null!==(r=this.loas_previous_frame)&&void 0!==r?r:void 0));){this.loas_previous_frame=u,s=1024/u.sampling_frequency*1e3;var p={codec:"aac",data:u};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(p)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(p)):(this.audio_metadata_={codec:"aac",audio_object_type:u.audio_object_type,sampling_freq_index:u.sampling_freq_index,sampling_frequency:u.sampling_frequency,channel_config:u.channel_config},this.dispatchAudioInitSegment(p)),A=h;var f=Math.floor(h),_={unit:u.data,length:u.data.byteLength,pts:f,dts:f};this.audio_track_&&(null===(o=this.audio_track_)||void 0===o||o.samples.push(_),this.audio_track_.length+=u.data.byteLength),h+=s}c.hasIncompleteData()&&(this.aac_last_incomplete_data_=c.getIncompleteData()),A&&(this.aac_last_sample_pts_=A)}},t.prototype.parseAC3Payload=function(e,t){var i,r;if(!this.has_video_||this.video_init_segment_dispatched_){var o,a=0;if(void 0!==t&&(a=t/this.timescale_),"ac-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=1536/this.audio_metadata_.sampling_frequency*1e3,a=this.aac_last_sample_pts_+o;else if(void 0===t)return void n.A.w(this.TAG,"AC3: Unknown pts");for(var s=new _e(e),l=null,d=a,c=0;null!=(l=s.readNextAC3Frame());){o=1536/l.sampling_frequency*1e3;var u={codec:"ac-3",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(u)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(u)):(this.audio_metadata_={codec:"ac-3",sampling_frequency:l.sampling_frequency,bit_stream_identification:l.bit_stream_identification,bit_stream_mode:l.bit_stream_mode,low_frequency_effects_channel_on:l.low_frequency_effects_channel_on,channel_mode:l.channel_mode},this.dispatchAudioInitSegment(u)),c=d;var h=Math.floor(d),A={unit:l.data,length:l.data.byteLength,pts:h,dts:h};this.audio_track_&&(null===(r=this.audio_track_)||void 0===r||r.samples.push(A),this.audio_track_.length+=l.data.byteLength),d+=o}c&&(this.aac_last_sample_pts_=c)}},t.prototype.parseEAC3Payload=function(e,t){var i,r;if(!this.has_video_||this.video_init_segment_dispatched_){var o,a=0;if(void 0!==t&&(a=t/this.timescale_),"ec-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=256*(this.audio_metadata_.num_blks||0)/(this.audio_metadata_.sampling_frequency||0)*1e3,a=this.aac_last_sample_pts_+o;else if(void 0===t)return void n.A.w(this.TAG,"EAC3: Unknown pts");for(var s=new ge(e),l=null,d=a,c=0;null!=(l=s.readNextEAC3Frame());){o=1536/l.sampling_frequency*1e3;var u={codec:"ec-3",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(u)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(u)):(this.audio_metadata_={codec:"ec-3",sampling_frequency:l.sampling_frequency,bit_stream_identification:l.bit_stream_identification,low_frequency_effects_channel_on:l.low_frequency_effects_channel_on,num_blks:l.num_blks,channel_mode:l.channel_mode},this.dispatchAudioInitSegment(u)),c=d;var h=Math.floor(d),A={unit:l.data,length:l.data.byteLength,pts:h,dts:h};this.audio_track_&&(null===(r=this.audio_track_)||void 0===r||r.samples.push(A),this.audio_track_.length+=l.data.byteLength),d+=o}c&&(this.aac_last_sample_pts_=c)}},t.prototype.parseOpusPayload=function(e,t){var i,r;if(!this.has_video_||this.video_init_segment_dispatched_){var o,a=0;if(void 0!==t&&(a=t/this.timescale_),"opus"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=20,a=this.aac_last_sample_pts_+o;else if(void 0===t)return void n.A.w(this.TAG,"Opus: Unknown pts");for(var s=a,l=0,d=0;d<e.length;){o=20;for(var c=!!(16&e[d+1]),u=!!(8&e[d+1]),h=d+2,A=0;255===e[h];)A+=255,h+=1;A+=e[h],h+=1,h+=c?2:0,h+=u?2:0,l=s;var p=Math.floor(s),f=e.slice(h,h+A),_={unit:f,length:f.byteLength,pts:p,dts:p};this.audio_track_&&(null===(r=this.audio_track_)||void 0===r||r.samples.push(_),this.audio_track_.length+=f.byteLength),s+=o,d=h+A}l&&(this.aac_last_sample_pts_=l)}},t.prototype.parseMP3Payload=function(e,t){var i;if(!this.has_video_||this.video_init_segment_dispatched_){var r=e[1]>>>3&3,n=(6&e[1])>>1,o=(e[2],(12&e[2])>>>2),a=3&~(e[3]>>>6)?2:1,s=0,l=34;switch(r){case 0:s=[11025,12e3,8e3,0][o];break;case 2:s=[22050,24e3,16e3,0][o];break;case 3:s=[44100,48e3,32e3,0][o]}switch(n){case 1:l=34;break;case 2:l=33;break;case 3:l=32}var d=new Ae;d.object_type=l,d.sample_rate=s,d.channel_count=a,d.data=e;var c={codec:"mp3",data:d};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c)):(this.audio_metadata_={codec:"mp3",object_type:l,sample_rate:s,channel_count:a},this.dispatchAudioInitSegment(c));var u={unit:e,length:e.byteLength,pts:t/this.timescale_,dts:t/this.timescale_};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(u),this.audio_track_.length+=e.byteLength)}},t.prototype.detectAudioMetadataChange=function(e){var t,i,r,o;if(e.codec!==(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))return n.A.v(this.TAG,"Audio: Audio Codecs changed from "+"".concat(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec," to ").concat(e.codec)),!0;if("aac"===e.codec&&"aac"===this.audio_metadata_.codec){if((a=e.data).audio_object_type!==this.audio_metadata_.audio_object_type)return n.A.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(a.audio_object_type)),!0;if(a.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return n.A.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(a.sampling_freq_index)),!0;if(a.channel_config!==this.audio_metadata_.channel_config)return n.A.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(null===(r=this.audio_metadata_)||void 0===r?void 0:r.channel_config," to ").concat(a.channel_config)),!0}else if("ac-3"===e.codec&&"ac-3"===this.audio_metadata_.codec){var a;if((a=e.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return n.A.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(null===(o=this.audio_metadata_)||void 0===o?void 0:o.sampling_frequency," to ").concat(a.sampling_frequency)),!0;if(a.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return n.A.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(a.bit_stream_identification)),!0;if(a.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return n.A.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(a.bit_stream_mode)),!0;if(a.channel_mode!==this.audio_metadata_.channel_mode)return n.A.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(a.channel_mode)),!0;if(a.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return n.A.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(a.low_frequency_effects_channel_on)),!0}else if("opus"===e.codec&&"opus"===this.audio_metadata_.codec){if((s=e.meta).sample_rate!==this.audio_metadata_.sample_rate)return n.A.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(s.sample_rate)),!0;if(s.channel_count!==this.audio_metadata_.channel_count)return n.A.v(this.TAG,"Opus: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(s.channel_count)),!0}else if("mp3"===e.codec&&"mp3"===this.audio_metadata_.codec){var s;if((s=e.data).object_type!==this.audio_metadata_.object_type)return n.A.v(this.TAG,"MP3: AudioObjectType changed from "+"".concat(this.audio_metadata_.object_type," to ").concat(s.object_type)),!0;if(s.sample_rate!==this.audio_metadata_.sample_rate)return n.A.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(s.sample_rate)),!0;if(s.channel_count!==this.audio_metadata_.channel_count)return n.A.v(this.TAG,"MP3: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(s.channel_count)),!0}return!1},t.prototype.dispatchAudioInitSegment=function(e){var t,i,r,o,a,s,l={type:"audio"};if(l.id=null===(t=this.audio_track_)||void 0===t?void 0:t.id,l.timescale=1e3,l.duration=this.duration_,"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){var d="aac"===e.codec?e.data:null,c=new z(d);l.audioSampleRate=c.sampling_rate,l.channelCount=c.channel_count,l.codec=c.codec_mimetype,l.originalCodec=c.original_codec_mimetype,l.config=c.config,l.refSampleDuration=1024/l.audioSampleRate*l.timescale}else if("ac-3"===(null===(r=this.audio_metadata_)||void 0===r?void 0:r.codec)){var u="ac-3"===e.codec?e.data:null,h=new me(u);l.audioSampleRate=h.sampling_rate,l.channelCount=h.channel_count,l.codec=h.codec_mimetype,l.originalCodec=h.original_codec_mimetype,l.config=h.config,l.refSampleDuration=1536/l.audioSampleRate*l.timescale}else if("ec-3"===(null===(o=this.audio_metadata_)||void 0===o?void 0:o.codec)){var A="ec-3"===e.codec?e.data:null,p=new ye(A);l.audioSampleRate=p.sampling_rate,l.channelCount=p.channel_count,l.codec=p.codec_mimetype,l.originalCodec=p.original_codec_mimetype,l.config=p.config,l.refSampleDuration=256*p.num_blks/l.audioSampleRate*l.timescale}else"opus"===(null===(a=this.audio_metadata_)||void 0===a?void 0:a.codec)?(l.audioSampleRate=this.audio_metadata_.sample_rate,l.channelCount=this.audio_metadata_.channel_count,l.channelConfigCode=this.audio_metadata_.channel_config_code,l.codec="opus",l.originalCodec="opus",l.config=void 0,l.refSampleDuration=20):"mp3"===(null===(s=this.audio_metadata_)||void 0===s?void 0:s.codec)&&(l.audioSampleRate=this.audio_metadata_.sample_rate,l.channelCount=this.audio_metadata_.channel_count,l.codec="mp3",l.originalCodec="mp3",l.config=void 0);this.audio_init_segment_dispatched_||n.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(l.codec)),this.onTrackMetadata&&this.onTrackMetadata("audio",l),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var f=this.media_info_;f.hasAudio=!0,f.audioCodec=l.originalCodec,f.audioSampleRate=l.audioSampleRate,f.audioChannelCount=l.channelCount,f.hasVideo&&f.videoCodec?f.mimeType='video/mp2t; codecs="'.concat(f.videoCodec,",").concat(f.audioCodec,'"'):f.mimeType='video/mp2t; codecs="'.concat(f.audioCodec,'"'),f.isComplete()&&this.onMediaInfo&&this.onMediaInfo(f)},t.prototype.dispatchPESPrivateDataDescriptor=function(e,t,i){var r=new q;r.pid=e,r.stream_type=t,r.descriptor=i,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(r)},t.prototype.parsePESPrivateDataPayload=function(e,t,i,r,n){var o=new H;if(o.pid=r,o.stream_id=n,o.len=e.byteLength,o.data=e,void 0!==t){var a=Math.floor(t/this.timescale_);o.pts=a}else o.nearest_pts=this.aac_last_sample_pts_;if(void 0!==i){var s=Math.floor(i/this.timescale_);o.dts=s}this.onPESPrivateData&&this.onPESPrivateData(o)},t.prototype.parseTimedID3MetadataPayload=function(e,t,i,r,n){var o=new H;if(o.pid=r,o.stream_id=n,o.len=e.byteLength,o.data=e,void 0!==t){var a=Math.floor(t/this.timescale_);o.pts=a}if(void 0!==i){var s=Math.floor(i/this.timescale_);o.dts=s}this.onTimedID3Metadata&&this.onTimedID3Metadata(o)},t.prototype.parseSMPTE2038MetadataPayload=function(e,t,i,r,n){var o=new he;if(o.pid=r,o.stream_id=n,o.len=e.byteLength,o.data=e,void 0!==t){var a=Math.floor(t/this.timescale_);o.pts=a}if(o.nearest_pts=this.aac_last_sample_pts_,void 0!==i){var s=Math.floor(i/this.timescale_);o.dts=s}o.ancillaries=function(e){for(var t=new A(e),i=0,r=[];i+=6,0===t.readBits(6);){var n=t.readBool();i+=1;var o=t.readBits(11);i+=11;var a=t.readBits(12);i+=12;var s=255&t.readBits(10);i+=10;var l=255&t.readBits(10);i+=10;var d=255&t.readBits(10);i+=10;for(var c=new Uint8Array(d),u=0;u<d;u++){var h=255&t.readBits(10);i+=10,c[u]=h}t.readBits(10),i+=10;var p="User Defined";65===s?7===l&&(p="SCTE-104"):95===s?220===l?p="ARIB STD-B37 (1SEG)":221===l?p="ARIB STD-B37 (ANALOG)":222===l?p="ARIB STD-B37 (SD)":223===l&&(p="ARIB STD-B37 (HD)"):97===s&&(1===l?p="EIA-708":2===l&&(p="EIA-608")),r.push({yc_indicator:n,line_number:o,horizontal_offset:a,did:s,sdid:l,user_data:c,description:p,information:{}}),t.readBits(8-(i-Math.floor(i/8))%8),i+=(8-(i-Math.floor(i/8)))%8}return t.destroy(),t=null,r}(e),this.onSMPTE2038Metadata&&this.onSMPTE2038Metadata(o)},t}(w);const ke=Te;var Re=new Uint8Array([0,0,0,0,0,0,0,0]),Oe=function(){function e(){}return e.init=function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],hvc1:[],hvcC:[],av01:[],av1C:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[],Opus:[],dOps:[],"ac-3":[],dac3:[],"ec-3":[],dec3:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)])},e.box=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];for(var r=8,n=null,o=Array.prototype.slice.call(arguments,1),a=o.length,s=0;s<a;s++)r+=o[s].byteLength;(n=new Uint8Array(r))[0]=r>>>24&255,n[1]=r>>>16&255,n[2]=r>>>8&255,n[3]=255&r,n.set(e,4);var l=8;for(s=0;s<a;s++)n.set(o[s],l),l+=o[s].byteLength;return n},e.generateInitSegment=function(t){var i=e.box(e.types.ftyp,e.constants.FTYP),r=e.moov(t),n=new Uint8Array(i.byteLength+r.byteLength);return n.set(i,0),n.set(r,i.byteLength),n},e.moov=function(t){var i=e.mvhd(t.timescale,t.duration),r=e.trak(t),n=e.mvex(t);return e.box(e.types.moov,i,r,n)},e.mvhd=function(t,i){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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]))},e.trak=function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.tkhd=function(t){var i=t.id,r=t.duration,n=t.presentWidth,o=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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,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,n>>>8&255,255&n,0,0,o>>>8&255,255&o,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))},e.mdhd=function(t){var i=t.timescale,r=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,r>>>24&255,r>>>16&255,r>>>8&255,255&r,85,196,0,0]))},e.hdlr=function(t){var i;return i="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,i)},e.minf=function(t){var i;return i="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,i,e.dinf(),e.stbl(t))},e.dinf=function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))},e.stbl=function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):"ac-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ac3(t)):"ec-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ec3(t)):"opus"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.Opus(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):"video"===t.type&&t.codec.startsWith("hvc1")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t)):"video"===t.type&&t.codec.startsWith("av01")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.av01(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var i=t.channelCount,r=t.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types[".mp3"],n)},e.mp4a=function(t){var i=t.channelCount,r=t.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types.mp4a,n,e.esds(t))},e.ac3=function(t){var i,r=t.channelCount,n=t.audioSampleRate,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]);return e.box(e.types["ac-3"],o,e.box(e.types.dac3,new Uint8Array(null!==(i=t.config)&&void 0!==i?i:[])))},e.ec3=function(t){var i,r=t.channelCount,n=t.audioSampleRate,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]);return e.box(e.types["ec-3"],o,e.box(e.types.dec3,new Uint8Array(null!==(i=t.config)&&void 0!==i?i:[])))},e.esds=function(t){var i,r=null!==(i=t.config)&&void 0!==i?i:[],n=r.length,o=new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(r).concat([6,1,2]));return e.box(e.types.esds,o)},e.Opus=function(t){var i=t.channelCount,r=t.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types.Opus,n,e.dOps(t))},e.dOps=function(t){var i=t.channelCount,r=t.channelConfigCode,n=t.audioSampleRate,o=[];switch(r){case 1:case 2:o=[0];break;case 0:o=[255,1,1,0,1];break;case 128:o=[255,2,0,0,1];break;case 3:o=[1,2,1,0,2,1];break;case 4:o=[1,2,2,0,1,2,3];break;case 5:o=[1,3,2,0,4,1,2,3];break;case 6:o=[1,4,2,0,4,1,2,3,5];break;case 7:o=[1,4,2,0,4,1,2,3,5,6];break;case 8:o=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:o=[1,1,2,0,1];break;case 131:o=[1,1,3,0,1,2];break;case 132:o=[1,1,4,0,1,2,3];break;case 133:o=[1,1,5,0,1,2,3,4];break;case 134:o=[1,1,6,0,1,2,3,4,5];break;case 135:o=[1,1,7,0,1,2,3,4,5,6];break;case 136:o=[1,1,8,0,1,2,3,4,5,6,7]}var a=new Uint8Array(function(e,t,i){if(2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}([0,i,0,0,n>>>24&255,n>>>17&255,n>>>8&255,n>>>0&255,0,0],function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a}(o),!1));return e.box(e.types.dOps,a)},e.avc1=function(t){var i=t.avcc,r=t.codecWidth,n=t.codecHeight,o=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,r>>>8&255,255&r,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,o,e.box(e.types.avcC,i))},e.hvc1=function(t){var i=t.hvcc,r=t.codecWidth,n=t.codecHeight,o=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,r>>>8&255,255&r,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.hvc1,o,e.box(e.types.hvcC,i))},e.av01=function(t){var i,r,n=t.av1c,o=null!==(i=t.codecWidth)&&void 0!==i?i:192,a=null!==(r=t.codecHeight)&&void 0!==r?r:108,s=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,o>>>8&255,255&o,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.av01,s,e.box(e.types.av1C,n))},e.mvex=function(t){return e.box(e.types.mvex,e.trex(t))},e.trex=function(t){var i=t.id,r=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,r)},e.moof=function(t,i){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,i))},e.mfhd=function(t){var i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,i)},e.traf=function(t,i){var r=t.id,n=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),o=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),a=e.sdtp(t),s=e.trun(t,a.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,n,o,s,a)},e.sdtp=function(t){for(var i=t.samples||[],r=i.length,n=new Uint8Array(4+r),o=0;o<r;o++){var a=i[o].flags;n[o+4]=a.isLeading<<6|a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy}return e.box(e.types.sdtp,n)},e.trun=function(t,i){var r=t.samples||[],n=r.length,o=12+16*n,a=new Uint8Array(o);i+=8+o,a.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var s=0;s<n;s++){var l=r[s].duration,d=r[s].size,c=r[s].flags,u=r[s].cts;a.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,d>>>24&255,d>>>16&255,d>>>8&255,255&d,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.isNonSync,0,0,u>>>24&255,u>>>16&255,u>>>8&255,255&u],12+16*s)}return e.box(e.types.trun,a)},e.mdat=function(t){return e.box(e.types.mdat,t)},e.constants={FTYP:new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),STSD_PREFIX:new Uint8Array([0,0,0,0,0,0,0,1]),STTS:Re,STSC:Re,STCO:Re,STSZ:new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),HDLR_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]),HDLR_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]),DREF:new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),SMHD:new Uint8Array([0,0,0,0,0,0,0,0]),VMHD:new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},e}();Oe.init();const Ce=Oe,Be=function(){function e(){}return e.getSilentFrame=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])}return null},e}();var xe=i(1951);const Ie=function(){function e(e){var t;this.TAG="MP4Remuxer",this._fillSilentAfterSeek=!1,this._config=e,this._isLive=!!e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new xe.Sc("audio"),this._videoSegmentInfoList=new xe.Sc("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!o.A.chrome||!(o.A.version&&o.A.version.major<50||o.A.version&&50===o.A.version.major&&((null===(t=o.A.version)||void 0===t?void 0:t.build)||0)<2661)),this._fillSilentAfterSeek=!(!o.A.msedge&&!o.A.msie),this._mp3UseMpegAudio=!o.A.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(e){var t;return e.onDataAvailable=null===(t=this.remux)||void 0===t?void 0:t.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new c.j4("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),t&&this._remuxVideo(t),e&&this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var i=null,r="mp4",n=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(r="mpeg",n="",i=new Uint8Array):i=Ce.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=Ce.generateInitSegment(t)}if(!this._onInitSegment)throw new c.j4("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:n,container:"".concat(e,"/").concat(r),mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){var i,r;this._dtsBaseInited||((null===(i=null==e?void 0:e.samples)||void 0===i?void 0:i.length)&&(this._audioDtsBase=e.samples[0].dts),(null===(r=null==t?void 0:t.samples)||void 0===r?void 0:r.length)&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=null==e?void 0:e.length);var r={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(r.samples.push(t),r.length=null==t?void 0:t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(r,!0)},e.prototype._remuxAudio=function(e,t){var i,r,a,s,l,d,c;if(null!=this._audioMeta){var u,h,A=e,p=A.samples,f=-1,_=this._audioMeta.refSampleDuration,m="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,v=this._dtsBaseInited&&void 0===this._audioNextDts,g=!1;if(p&&0!==p.length&&(1!==p.length||t)){var y=0,b=null,S=0;m?(y=0,S=A.length):(y=8,S=8+A.length);var E=null;if(p.length>1&&(S-=(E=p.pop()).length),null!=this._audioStashedLastSample){var w=this._audioStashedLastSample;this._audioStashedLastSample=null,p.unshift(w),S+=w.length}null!=E&&(this._audioStashedLastSample=E);var T=p[0].dts-this._dtsBase;if(this._audioNextDts)u=T-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())u=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(g=!0);else{var k=this._audioSegmentInfoList.getLastSampleBefore(T);if(null!=k){var R=T-(k.originalDts+k.duration);R<=3&&(R=0),u=T-(k.dts+k.duration+R)}else u=0}if(g){var O=T-u,C=this._videoSegmentInfoList.getLastSegmentBefore(T);if(null!=C&&C.beginDts<O){if(V=Be.getSilentFrame(null===(i=this._audioMeta)||void 0===i?void 0:i.originalCodec,null===(r=this._audioMeta)||void 0===r?void 0:r.channelCount)){var B=C.beginDts,x=O-C.beginDts;n.A.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(B,", duration: ").concat(x)),p.unshift({unit:V,dts:B,pts:B}),S+=V.byteLength}}else g=!1}for(var I=[],L=0;L<p.length;L++){var D=(w=p[L]).unit,M=w.dts-this._dtsBase,P=(B=M,!1),U=null,F=0;if(!(M<-.001)){if("mp3"!==this._audioMeta.codec){var N=M;if(this._audioNextDts&&(N=this._audioNextDts),(u=M-N)<=-3*(_||0)){n.A.w(this.TAG,"Dropping 1 audio frame (originalDts: ".concat(M," ms ,curRefDts: ").concat(N," ms) due to dtsCorrection: ").concat(u," ms overlap."));continue}if(u>=3*(_||0)&&this._fillAudioTimestampGap&&!o.A.safari){P=!0;var V,G=Math.floor(u/(_||0));n.A.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"originalDts: ".concat(M," ms, curRefDts: ").concat(N," ms, ")+"dtsCorrection: ".concat(Math.round(u)," ms, generate: ").concat(G," frames")),B=Math.floor(N),F=Math.floor(N+(_||0))-B,null==(V=Be.getSilentFrame(null===(a=this._audioMeta)||void 0===a?void 0:a.originalCodec,this._audioMeta.channelCount))&&(n.A.w(this.TAG,"Unable to generate silent frame for "+"".concat(null===(s=this._audioMeta)||void 0===s?void 0:s.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),V=D),U=[];for(var j=0;j<G;j++){N+=_||0;var $=Math.floor(N),W=Math.floor(N+(_||0))-$,Q={dts:$,pts:$,cts:0,unit:V,size:V.byteLength,duration:W,originalDts:M,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};U.push(Q),S+=Q.size}this._audioNextDts=N+(_||0)}else B=Math.floor(N),F=Math.floor(N+(_||0))-B,this._audioNextDts=N+(_||0)}else B=M-u,F=L!==p.length-1?p[L+1].dts-this._dtsBase-u-B:null!=E?E.dts-this._dtsBase-u-B:I.length>=1?null===(l=I[I.length-1])||void 0===l?void 0:l.duration:Math.floor(_||0),this._audioNextDts=B+F;-1===f&&(f=B),I.push({dts:B,pts:B,cts:0,unit:w.unit,size:null===(d=w.unit)||void 0===d?void 0:d.byteLength,duration:F,originalDts:M,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),P&&I.push.apply(I,U)}}if(0===I.length)return A.samples=[],void(A.length=0);for(m?b=new Uint8Array(S):((b=new Uint8Array(S))[0]=S>>>24&255,b[1]=S>>>16&255,b[2]=S>>>8&255,b[3]=255&S,b.set(Ce.types.mdat,4)),L=0;L<I.length;L++)D=I[L].unit,b.set(D,y),y+=D.byteLength||0;var z=I[I.length-1];h=z.dts+z.duration;var H,q=new xe.EZ;q.beginDts=f,q.endDts=h,q.beginPts=f,q.endPts=h,q.originalBeginDts=I[0].originalDts,q.originalEndDts=z.originalDts+z.duration,q.firstSample=new xe.$_(I[0].dts,I[0].pts,I[0].duration,I[0].originalDts,!1),q.lastSample=new xe.$_(z.dts,z.pts,z.duration,z.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(q),A.samples=I,A.sequenceNumber++,H=m?new Uint8Array:Ce.moof(A,f),A.samples=[],A.length=0;var Y={type:"audio",data:this._mergeBoxes(H,b).buffer,sampleCount:I.length,info:q};m&&v&&Y&&(Y.timestampOffset=f),null===(c=this._onMediaSegment)||void 0===c||c.call(this,"audio",Y)}}},e.prototype._remuxVideo=function(e,t){var i,r;if(null!=this._videoMeta){var n,o,a,s=e,l=s.samples,d=-1,c=-1;if(l&&0!==l.length&&(1!==l.length||t)){var u=8,h=null,A=8+e.length,p=null;if(l.length>1&&(A-=(p=l.pop()).length),null!=this._videoStashedLastSample){var f=this._videoStashedLastSample;this._videoStashedLastSample=null,l.unshift(f),A+=(null==f?void 0:f.length)||0}null!=p&&(this._videoStashedLastSample=p);var _=l[0].dts-this._dtsBase;if(this._videoNextDts)n=_-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())n=0;else{var m=this._videoSegmentInfoList.getLastSampleBefore(_);if(null!=m){var v=_-(m.originalDts+m.duration);v<=3&&(v=0),n=_-(m.dts+m.duration+v)}else n=0}for(var g=new xe.EZ,y=[],b=0;b<l.length;b++){var S,E=(f=l[b]).dts-this._dtsBase,w=f.isKeyframe,T=E-n,k=f.cts,R=T+k;if(-1===d&&(d=T,c=R),S=b!==l.length-1?l[b+1].dts-this._dtsBase-n-T:null!=p?p.dts-this._dtsBase-n-T:y.length>=1?y[y.length-1].duration:Math.floor((null===(i=this._videoMeta)||void 0===i?void 0:i.refSampleDuration)||0),w){var O=new xe.$_(T,R,S,f.dts,!0);O.fileposition=f.fileposition,g.appendSyncPoint(O)}y.push({dts:T,pts:R,cts:k,units:f.units,size:f.length,isKeyframe:w,duration:S,originalDts:E,flags:{isLeading:0,dependsOn:w?2:1,isDependedOn:w?1:0,hasRedundancy:0,isNonSync:w?0:1}})}for((h=new Uint8Array(A))[0]=A>>>24&255,h[1]=A>>>16&255,h[2]=A>>>8&255,h[3]=255&A,h.set(Ce.types.mdat,4),b=0;b<y.length;b++)for(var C=y[b].units;null==C?void 0:C.length;){var B=C.shift(),x=null==B?void 0:B.data;h.set(x,u),u+=x.byteLength}var I=y[y.length-1];if(o=I.dts+I.duration,a=I.pts+I.duration,this._videoNextDts=o,g.beginDts=d,g.endDts=o,g.beginPts=c,g.endPts=a,g.originalBeginDts=y[0].originalDts,g.originalEndDts=I.originalDts+I.duration,g.firstSample=new xe.$_(y[0].dts,y[0].pts,y[0].duration,y[0].originalDts,!!y[0].isKeyframe),g.lastSample=new xe.$_(I.dts,I.pts,I.duration,I.originalDts,!!I.isKeyframe),this._isLive||this._videoSegmentInfoList.append(g),s.samples=y,s.sequenceNumber++,this._forceFirstIDR){var L=y[0].flags;L.dependsOn=2,L.isNonSync=0}var D=Ce.moof(s,d);s.samples=[],s.length=0,null===(r=this._onMediaSegment)||void 0===r||r.call(this,"video",{type:"video",data:this._mergeBoxes(D,h).buffer,sampleCount:y.length,info:g})}}},e.prototype._mergeBoxes=function(e,t){var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(e,0),i.set(t,e.byteLength),i},e}();var Le=i(8098),De=i(550);const Me=function(){function e(e,t){var i;this.TAG="TransmuxingController",this._emitter=new r.A,this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!=typeof e.cors&&(e.cors=!0),"boolean"!=typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;var n=0;null===(i=this._mediaDataSource.segments)||void 0===i||i.forEach((function(i){i.timestampBase=n,n+=i.duration,i.cors=e.cors,i.withCredentials=e.withCredentials,t.referrerPolicy&&(i.referrerPolicy=t.referrerPolicy)})),isNaN(n)||this._mediaDataSource.duration===n||(this._mediaDataSource.duration=n),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return e.prototype.destroy=function(){var e,t,i;this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(null===(e=this._ioctl)||void 0===e||e.destroy(),this._ioctl=null),this._demuxer&&(null===(t=this._demuxer)||void 0===t||t.destroy(),this._demuxer=null),this._remuxer&&(null===(i=this._remuxer)||void 0===i||i.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},e.prototype._loadSegment=function(e,t){var i,r,n;if(this._currentSegmentIndex=e,null===(i=this._mediaDataSource)||void 0===i?void 0:i.segments){var o=null===(r=this._mediaDataSource)||void 0===r?void 0:r.segments[e],a=this._ioctl=new Le.A(o,this._config,e);a.onError=this._onIOException.bind(this),a.onSeeked=this._onIOSeeked.bind(this),a.onComplete=this._onIOComplete.bind(this),a.onRedirect=this._onIORedirect.bind(this),a.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?null===(n=this._demuxer)||void 0===n||n.bindDataSource(this._ioctl):a.onDataArrival=this._onInitChunkArrival.bind(this),a.open(t)}},e.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},e.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},e.prototype.pause=function(){var e;(null===(e=this._ioctl)||void 0===e?void 0:e.isWorking())&&(this._ioctl.pause(),this._disableStatisticsReporter())},e.prototype.resume=function(){var e;(null===(e=this._ioctl)||void 0===e?void 0:e.isPaused())&&(this._ioctl.resume(),this._enableStatisticsReporter())},e.prototype.seek=function(e){var t,i,r,n,o,a,s,l,d,c,u,h,A,p;if(null!=this._mediaInfo&&(null===(t=this._mediaInfo)||void 0===t?void 0:t.isSeekable())){var f=this._searchSegmentIndexContains(e);if(f===this._currentSegmentIndex){var _=(null===(i=this._mediaInfo)||void 0===i?void 0:i.segments)?null===(r=this._mediaInfo)||void 0===r?void 0:r.segments[f]:{};if(void 0===_)this._pendingSeekTime=e;else{var m=null==_?void 0:_.getNearestKeyframe(e);null===(n=this._remuxer)||void 0===n||n.seek(null==m?void 0:m.milliseconds),null===(o=this._ioctl)||void 0===o||o.seek(null==m?void 0:m.fileposition),this._pendingResolveSeekPoint=null==m?void 0:m.milliseconds}}else{var v=(null===(a=this._mediaInfo)||void 0===a?void 0:a.segments)?null===(s=this._mediaInfo)||void 0===s?void 0:s.segments[f]:{};void 0===v?(this._pendingSeekTime=e,this._internalAbort(),null===(l=this._remuxer)||void 0===l||l.seek(),null===(d=this._remuxer)||void 0===d||d.insertDiscontinuity(),this._loadSegment(f)):(m=v.getNearestKeyframe(e),this._internalAbort(),null===(c=this._remuxer)||void 0===c||c.seek(e),null===(u=this._remuxer)||void 0===u||u.insertDiscontinuity(),this._demuxer&&(null===(h=this._demuxer)||void 0===h||h.resetMediaInfo(),this._demuxer.timestampBase=(null===(A=this._mediaDataSource)||void 0===A?void 0:A.segments)?null===(p=this._mediaDataSource)||void 0===p?void 0:p.segments[f].timestampBase:0),this._loadSegment(f,null==m?void 0:m.fileposition),this._pendingResolveSeekPoint=null==m?void 0:m.milliseconds,this._reportSegmentMediaInfo(f))}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){var t,i=this._mediaDataSource.segments,r=((null==i?void 0:i.length)||0)-1;if(0===((null==i?void 0:i.length)||0))return r;for(var n=0;n<((null==i?void 0:i.length)||0);n++)if(i&&e<((null===(t=i[n])||void 0===t?void 0:t.timestampBase)||0)){r=n-1;break}return r},e.prototype._onInitChunkArrival=function(e,t){var i,r,o,a,s,l=this,d=0;if(t>0)null===(i=this._demuxer)||void 0===i||i.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments?null===(r=this._mediaDataSource.segments[this._currentSegmentIndex])||void 0===r?void 0:r.timestampBase:0,d=(null===(o=this._demuxer)||void 0===o?void 0:o.parseChunks(e,t))||0;else{var c=null;(c=E.probe(e)).match&&(this._setupFLVDemuxerRemuxer(c),d=(null===(a=this._demuxer)||void 0===a?void 0:a.parseChunks(e,t))||0),c.match||(null==c?void 0:c.needMoreData)||(c=ke.probe(e)).match&&(this._setupTSDemuxerRemuxer(c),d=(null===(s=this._demuxer)||void 0===s?void 0:s.parseChunks(e,t))||0),c.match||(null==c?void 0:c.needMoreData)||(c=null,n.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then((function(){l._internalAbort()})),this._emitter.emit(De.A.DEMUX_ERROR,f.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return d},e.prototype._setupFLVDemuxerRemuxer=function(e){var t;this._demuxer=new E(e,this._config),this._remuxer||(this._remuxer=new Ie(this._config));var i=this._mediaDataSource;void 0===i.duration||isNaN(i.duration)||(this._demuxer.overridedDuration=i.duration),"boolean"==typeof i.hasAudio&&(this._demuxer.overridedHasAudio=i.hasAudio),"boolean"==typeof i.hasVideo&&(this._demuxer.overridedHasVideo=i.hasVideo),i.segments&&this._demuxer&&this._remuxer&&(this._demuxer.timestampBase=null===(t=null==i?void 0:i.segments[this._currentSegmentIndex])||void 0===t?void 0:t.timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this))},e.prototype._setupTSDemuxerRemuxer=function(e){var t=this._demuxer=new ke(e,this._config);this._remuxer||(this._remuxer=new Ie(this._config)),t.onError=this._onDemuxException.bind(this),t.onMediaInfo=this._onMediaInfo.bind(this),t.onMetaDataArrived=this._onMetaDataArrived.bind(this),t.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),t.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),t.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),t.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),t.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},e.prototype._onMediaInfo=function(e){var t,i,r=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=(null===(i=null===(t=this._mediaDataSource)||void 0===t?void 0:t.segments)||void 0===i?void 0:i.length)||0,Object.setPrototypeOf(this._mediaInfo,a.A.prototype));var n=Object.assign({},e);Object.setPrototypeOf(n,a.A.prototype),this._mediaInfo.segments&&(this._mediaInfo.segments[this._currentSegmentIndex]=n),this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=r._pendingSeekTime;r._pendingSeekTime=null,r.seek(e)}))},e.prototype._onMetaDataArrived=function(e){this._emitter.emit(De.A.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(De.A.SCRIPTDATA_ARRIVED,e)},e.prototype._onTimedID3Metadata=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.dts&&(e.dts-=i),this._emitter.emit(De.A.TIMED_ID3_METADATA_ARRIVED,e))},e.prototype._onSMPTE2038Metadata=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.dts&&(e.dts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),this._emitter.emit(De.A.SMPTE2038_METADATA_ARRIVED,e))},e.prototype._onSCTE35Metadata=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),this._emitter.emit(De.A.SCTE35_METADATA_ARRIVED,e))},e.prototype._onPESPrivateDataDescriptor=function(e){this._emitter.emit(De.A.PES_PRIVATE_DATA_DESCRIPTOR,e)},e.prototype._onPESPrivateData=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),void 0!==e.dts&&(e.dts-=i),this._emitter.emit(De.A.PES_PRIVATE_DATA_ARRIVED,e))},e.prototype._onIOSeeked=function(){var e;null===(e=this._remuxer)||void 0===e||e.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t,i,r=e+1;r<((null===(i=null===(t=this._mediaDataSource)||void 0===t?void 0:t.segments)||void 0===i?void 0:i.length)||0)?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(r)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(De.A.LOADING_COMPLETE),this._disableStatisticsReporter())},e.prototype._onIORedirect=function(e){var t,i=null===(t=this._ioctl)||void 0===t?void 0:t.extraData;this._mediaDataSource.segments&&(this._mediaDataSource.segments[i].redirectedURL=e)},e.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(De.A.RECOVERED_EARLY_EOF)},e.prototype._onIOException=function(e,t){n.A.e(this.TAG,"IOException: type = ".concat(e,", code = ").concat(t.code,", msg = ").concat(t.msg)),this._emitter.emit(De.A.IO_ERROR,e,t),this._disableStatisticsReporter()},e.prototype._onDemuxException=function(e,t){n.A.e(this.TAG,"DemuxException: type = ".concat(e,", info = ").concat(t)),this._emitter.emit(De.A.DEMUX_ERROR,e,t)},e.prototype._onRemuxerInitSegmentArrival=function(e,t){this._emitter.emit(De.A.INIT_SEGMENT,e,t)},e.prototype._onRemuxerMediaSegmentArrival=function(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(De.A.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){var i=t.info.syncPoints,r=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,o.A.safari&&i.length>0&&i[0].originalDts===r&&(r=i[0].pts),this._emitter.emit(De.A.RECOMMEND_SEEKPOINT,r)}},e.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&this._reportStatisticsInfo&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},e.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype._reportSegmentMediaInfo=function(e){var t,i,r,n,o=(null===(t=this._mediaInfo)||void 0===t?void 0:t.segments)?null===(i=this._mediaInfo)||void 0===i?void 0:i.segments[e]:{},a=Object.assign({},o);a.duration=null===(r=this._mediaInfo)||void 0===r?void 0:r.duration,a.segmentCount=null===(n=this._mediaInfo)||void 0===n?void 0:n.segmentCount,delete a.segments,delete a.keyframesIndex,this._emitter.emit(De.A.MEDIA_INFO,a)},e.prototype._reportStatisticsInfo=function(){var e,t,i,r,n,o,a={};a.url=null===(e=this._ioctl)||void 0===e?void 0:e.currentURL,a.hasRedirect=null===(t=this._ioctl)||void 0===t?void 0:t.hasRedirect,a.hasRedirect&&(a.redirectedURL=null===(i=this._ioctl)||void 0===i?void 0:i.currentRedirectedURL),a.speed=null===(r=this._ioctl)||void 0===r?void 0:r.currentSpeed,a.loaderType=null===(n=this._ioctl)||void 0===n?void 0:n.loaderType,a.currentSegmentIndex=this._currentSegmentIndex,a.totalSegmentCount=null===(o=this._mediaDataSource.segments)||void 0===o?void 0:o.length,this._emitter.emit(De.A.STATISTICS_INFO,a)},e}()},9987:(e,t,i)=>{var r=i(4417).charAt;e.exports=function(e,t,i){return t+(i?r(e,t).length:1)}}},t={};function i(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,i),o.exports}return i.m=e,i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i(1900)})()))}(Ye)),Ye.exports);class Ze extends re{constructor(e){var t,i;super(),this.player=e;const r=document.createElement("video"),n=document.createElement("canvas");this.$posterElement=document.createElement("img"),r.volume=0,r.oncontextmenu=e=>{e.preventDefault()},this.player._opt.hasAudio||(r.muted=!0),r.style.position="absolute",r.style.top="0px",r.style.left="0px",this._delayPlay=!1,e.$container.appendChild(r),this.videoInfo={width:"",height:"",encType:""},this.$videoElement=r,this.$canvasElement=n,this.canvasContext=n.getContext("2d"),this.fixChromeVideoFlashBug(),this.resize();const{proxy:o}=this.player.events;o(this.$videoElement,"loadstart",(()=>{this.player.emit("loadstart")})),o(this.$videoElement,"loadeddata",(()=>{this.player.debug.log("Video",`loadeddata ${this._delayPlay}`),this.player.emit(D.streamSuccess)})),o(this.$videoElement,"canplay",(()=>{this.player.debug.log("Video",`canplay and _delayPlay is ${this._delayPlay}`),this._delayPlay&&this._play(),this.player.$container.contains(this.$posterElement)&&this.$posterElement&&this.player.$container.removeChild(this.$posterElement)})),o(this.$videoElement,"waiting",(()=>{this.player.emit(D.videoWaiting)})),o(this.$videoElement,"timeupdate",(()=>{this.player.emit(D.timeUpdate,this.currentTime),!this.isPlaying()&&this.init&&(this.player.debug.log("Video","timeupdate and this.isPlaying is false and retry play"),this.$videoElement.play())})),null===(i=null===(t=this.player.debug)||void 0===t?void 0:t.log)||void 0===i||i.call(t,"Video","init")}destroy(){super.destroy(),this.$canvasElement=null,this.canvasContext=null,this.$videoElement&&(this.$videoElement.pause(),this.$videoElement.currentTime=0,this.$videoElement.src="",this.$videoElement.removeAttribute("src"),this.$videoElement=null),this.trackGenerator&&(this.trackGenerator.stop(),this.trackGenerator=null),this.vwriter&&(this.vwriter.close(),this.vwriter=null),this.player.$container.contains(this.$posterElement)&&this.$posterElement&&this.player.$container.removeChild(this.$posterElement),this.player.debug.log("Video","destroy")}fixChromeVideoFlashBug(){const e=function(){const e=navigator.userAgent.toLowerCase(),t={},i={IE:window.ActiveXObject||"ActiveXObject"in window,Chrome:e.indexOf("chrome")>-1&&e.indexOf("safari")>-1,Firefox:e.indexOf("firefox")>-1,Opera:e.indexOf("opera")>-1,Safari:e.indexOf("safari")>-1&&-1===e.indexOf("chrome"),Edge:e.indexOf("edge")>-1,QQBrowser:/qqbrowser/.test(e),WeixinBrowser:/MicroMessenger/i.test(e)};for(let r in i)if(i[r]){let i="";if("IE"===r)i=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];else if("Chrome"===r){for(const e in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[e].type&&(r="360");i=e.match(/chrome\/([\d.]+)/)[1]}else"Firefox"===r?i=e.match(/firefox\/([\d.]+)/)[1]:"Opera"===r?i=e.match(/opera\/([\d.]+)/)[1]:"Safari"===r?i=e.match(/version\/([\d.]+)/)[1]:"Edge"===r?i=e.match(/edge\/([\d.]+)/)[1]:"QQBrowser"===r&&(i=e.match(/qqbrowser\/([\d.]+)/)[1]);t.type=r,t.version=parseInt(i)}return t}(),t=e.type.toLowerCase();if("chrome"===t||"edge"===t){this.player.$container.style.backdropFilter="blur(0px)"}}play(){if(this.$videoElement){const e=this._getVideoReadyState();if(this.player.debug.log("Video",`play and readyState: ${e}`),0===e)return this.player.debug.warn("Video","readyState is 0 and set _delayPlay to true"),void(this._delayPlay=!0);this._play()}}_getVideoReadyState(){let e=0;return this.$videoElement&&(e=this.$videoElement.readyState),e}_play(){if(this.$videoElement){const e=setTimeout((()=>{this.$videoElement.play().then((()=>{this._delayPlay=!1,this.player.debug.log("Video","_play success"),setTimeout((()=>{this.isPlaying()||(this.player.debug.warn("Video","play failed and retry play"),this._play())}),100)})).catch((e=>{this.player.debug.error("Video","_play error",e)})).finally((()=>{clearTimeout(e)}))}),20)}}pause(e){this._poster(),this.$videoElement.paused||(e?this.$videoElement&&this.$videoElement.pause():setTimeout((()=>{this.$videoElement&&this.$videoElement.pause()}),100))}clearView(){}screenshot(e,t,i,r){var n;e=e||X()+"",r=r||U.download,t=t||"png";const o={png:"image/png",jpeg:"image/jpeg",webp:"image/webp"};"number"!=typeof i&&(i=Number(i||.92));const a=this.$videoElement,s=this.$canvasElement;s.width=a.videoWidth,s.height=a.videoHeight,null===(n=this.canvasContext)||void 0===n||n.drawImage(a,0,0,s.width,s.height);const l=s.toDataURL(o[t]||o.png,i);if(setTimeout((()=>{var e;null===(e=this.canvasContext)||void 0===e||e.clearRect(0,0,s.width,s.height),s.width=0,s.height=0}),10),"data:,"!==l){if(r===U.base64)return l;{const i=Y(l,e+"."+t);return r===U.blob?i:r===U.download?(de(i,e),i):void 0}}}initCanvasViewSize(){this.resize()}_poster(){const e=this.screenshot("poster","png",.75,U.base64);void 0===e||e.length<10||(this.$posterElement.src=e,this.$posterElement.style.position="absolute",this.$posterElement.style.top="0px",this.$posterElement.style.left="0px",this.$posterElement.style.zIndex="1",this.$posterElement.style.objectFit="contain",this.$posterElement.style.pointerEvents="none",this.player.$container.appendChild(this.$posterElement),this.resize())}render(e){this.vwriter&&this.vwriter.write(e.videoFrame)}resize(){this._resizeElement(this.$videoElement),this._resizeElement(this.$posterElement)}_resizeElement(e){const t=this.player._opt,i=this.player.width,r=this.player.height,n=t.rotate;e.width=i,e.height=r,270!==n&&90!==n||(e.width=r,e.height=i);const o=(i-e.width)/2,a=(r-e.height)/2;let s="contain";t.scaleMode===V.full&&(s="fill"),t.scaleMode===V.fullAuto&&(s="cover"),e.style.objectFit=s,e.style.transform="rotate("+n+"deg)",e.style.left=o+"px",e.style.top=a+"px"}isPlaying(){return this.$videoElement&&!this.$videoElement.paused}get currentTime(){var e;return(null===(e=this.$videoElement)||void 0===e?void 0:e.currentTime)||0}}class Ke extends Me{constructor(e,t){super(e,t,Ze),this._checkHeartTimeout=null,this._checkLoadingTimeout=null,this._opt.useMSE=!0,this.emit(D.decoderLoaded),this._createPlayer(t)}close(){}_createPlayer(e){var t;this._opt=Object.assign({},this._opt,e),this.events||(this.events=new Ce(this)),this.video||(this.video=new Ze(this)),null===(t=Xe.LoggingControl)||void 0===t||t.applyConfig({globalTag:"EzuikitFlv",enableVerbose:!!this._opt.debug,enableDebug:!!this._opt.debug,enableInfo:!!this._opt.debug,enableWarn:!!this._opt.debug,enableError:!0}),this.player=Xe.createPlayer({type:"flv",url:e.url,isLive:e.isLive},{stashInitialSize:128,enableWorker:!0,enableStashBuffer:!0,autoCleanupSourceBuffer:!0,lazyLoadMaxDuration:86400,fixAudioTimestampGap:!1,referrerPolicy:e.referrerPolicy}),this.player.attachMediaElement(this.video.$videoElement),this._flvEvents(),e.isLive&&this.player.on(Xe.Events.LOADING_COMPLETE,(()=>{this.player.updateConfig({liveBufferLatencyChasing:!0})}))}_removeFlvEvents(){this.player&&(this.player.off(Xe.Events.ERROR),this.player.off(Xe.Events.LOADING_COMPLETE),this.player.off(Xe.Events.RECOVERED_EARLY_EOF),this.player.off(Xe.Events.MEDIA_INFO),this.player.off(Xe.Events.STATISTICS_INFO),this.player.off(Xe.Events.DESTROYING))}_flvEvents(){if(this.player){let e=0;this.player.on(Xe.Events.ERROR,((t,i,r)=>{"MediaError"===t&&"MediaMSEError"===i&&9===r.code&&this.emit(P.mediaSourceH265NotSupport,r),this.emit(D.error,{errorTypes:t,errorDetails:i,info:r}),t.indexOf("NetworkError")>=-1&&(this.emit(D.streamError,{errorTypes:t,errorDetails:i,info:r,api:this._opt.url,type:"stream"}),this.player&&this.pause().then((()=>{this.emit(D.delayTimeout)}))),"MediaError"===t&&"CodecUnsupported"===i&&-1===r.code&&r.msg.indexOf("Unsupported audio codec")?0===e&&(ze.report(51,{event:t,value:r}),e=1,this.debug.error(`${Xe.Events.ERROR}`,t,i,JSON.stringify(r))):(ze.report(51,{event:t,value:r}),this.debug.error(`${Xe.Events.ERROR}`,t,i,JSON.stringify(r)),this.clearCheckLoadingTimeout())})),this.player.on(Xe.Events.LOADING_COMPLETE,(e=>{this.debug.warn(`${Xe.Events.LOADING_COMPLETE}`,JSON.stringify(e))})),this.player.on(Xe.Events.RECOVERED_EARLY_EOF,(e=>{this.debug.warn(`${Xe.Events.RECOVERED_EARLY_EOF}`,e)})),this.player.on("media_info",(e=>{this.clearCheckLoadingTimeout(),this.video.updateVideoInfo(Object.assign({encTypeCode:(null==e?void 0:e.videoCodec.indexOf("avc"))>=0?7:12},e))})),this.player.on(Xe.Events.STATISTICS_INFO,(e=>{e.decodedFrames===this._decodedFrames&&null===this._checkHeartTimeout?this.checkHeartTimeout():e.decodedFrames!==this._decodedFrames&&(this.clearCheckHeartTimeout(),this._decodedFrames=e.decodedFrames)})),this.player.on(Xe.Events.DESTROYING,(e=>{this.debug.log(`${Xe.Events.DESTROYING}`,JSON.stringify(e))})),this.on(D.videoWaiting,(()=>{this.clearCheckHeartTimeout(),null===this._checkHeartTimeout&&this.handleRender()})),this._onVideoLoadstart=this._onVideoLoadstart.bind(this),this.off("loadstart"),this.on("loadstart",this._onVideoLoadstart),this.on(D.timeUpdate,(()=>{this.clearCheckHeartTimeout()})),this._onVideoStreamSuccess=this._onVideoStreamSuccess.bind(this),this.off(D.streamSuccess,this._onVideoStreamSuccess),this.on(D.streamSuccess,this._onVideoStreamSuccess)}}_onVideoLoadstart(){this.checkLoadingTimeout()}_onVideoStreamSuccess(){this.clearCheckLoadingTimeout()}getOption(){return this._opt}emitError(e,t=""){this.emit(D.error,e,t),this.emit(e,t)}destroy(){this._destroy(),this.video&&(this.video.destroy(),this.video=null),this.events&&(this.events.destroy(),this.events=null),this.emit("destroy"),this.off(),this.debug.log("play","destroy end")}_destroy(){this.player&&this.playing&&this.player.pause(),this._flvPlayerDestroy(),this._loading=!1,this._playing=!1,this._lastVolume=null,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0}resetStats(){}get loaded(){return!0}set playing(e){e&&(this.loading=!1),this.playing!==e&&(this._playing=e,this.emit(D.playing,e),e?this.emit(D.play):this.emit(D.pause))}get playing(){return this._playing}get volume(){var e;return(null===(e=this.video)||void 0===e?void 0:e.$videoElement.volume)||0}set volume(e){0!==e&&this.video?(this.video.$videoElement.muted=!1,this.video.$videoElement.volume=e,this._lastVolume=e):this.video&&(this.video.$videoElement.muted=!0),this.emit(D.volumechange,this.volume),0===e?this.emit(D.mute,!0):0!==e&&this.emit(D.mute,!1)}get lastVolume(){return this._lastVolume}set loading(e){this.loading!==e&&(this._loading=e,this.emit(D.loading,this._loading),e||this.emit(D.loaded))}get loading(){return this._loading}set audioTimestamp(e){null!==e&&(this._audioTimestamp=e)}get audioTimestamp(){return this._audioTimestamp}set videoTimestamp(e){null!==e&&(this._videoTimestamp=e)}get videoTimestamp(){return this._videoTimestamp}get isDebug(){return!!this._opt.debug}checkLoadingTimeout(){var e;this._checkLoadingTimeout=window.setTimeout((()=>{this.clearCheckLoadingTimeout(),this.pause().then((()=>{this.emit(D.timeout,D.loadingTimeout),this.emit(D.loadingTimeout)})).catch((()=>{}))}),1e3*((null===(e=this._opt)||void 0===e?void 0:e.loadingTimeout)||10))}clearCheckLoadingTimeout(){this._checkLoadingTimeout&&(clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}checkHeart(){this.clearCheckHeartTimeout(),this.checkHeartTimeout()}clearCheckHeartTimeout(){this._checkHeartTimeout&&(clearTimeout(this._checkHeartTimeout),this._checkHeartTimeout=null)}checkHeartTimeout(){}handleRender(){this.loading&&(this.emit(D.start),this.loading=!1),this.playing||(this.playing=!0),this.checkHeart()}updateOption(e){var t;super.updateOption(e),null===(t=Xe.LoggingControl)||void 0===t||t.applyConfig({globalTag:"EzuikitFlv",enableVerbose:!!e.debug,enableDebug:!!e.debug,enableInfo:!!e.debug,enableWarn:!!e.debug,enableError:!0})}play(e={}){return this._play(e)}_play(e={}){return this.player&&this._destroy(),this._createPlayer(Object.assign({},this._opt,e)),this.loading=!0,this._playing=!1,this._times.playInitStart=X(),this.player?(this.player.load(),this.clearCheckHeartTimeout(),new Promise(((e,t)=>{this.player.play().then((()=>{this.loading=!1,this.playing=!0,this._opt.isMute||this.mute(!1),e()})).catch((e=>{t(e)}))}))):Promise.reject()}_flvPlayerDestroy(){this.player&&(this.video.pause(),this.player.unload(),this._removeFlvEvents(),this.player.detachMediaElement(),this.player.destroy(),this.player=null)}_close(){return new Promise((e=>{this._loading=!1,this._playing=!1,this._lastVolume=null,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this.video&&this.video.resetInit(),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.player&&(this._flvPlayerDestroy(),this._pause=!0),this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,setTimeout((()=>{e()}),110)}))}pause(){return this._close()}resumeAudioAfterPause(){}mute(e){this.volume=e?0:.5}}class Je{constructor(e,t){this._opt=Object.assign({},f,t),(J()||"360EE"===c().browser)&&(this._opt.useMSE=!1);return new(Je.getLoaderFactory(this._opt.useMSE))(e,this._opt)}static getLoaderFactory(e){return e?Ke:He}}var et,tt={exports:{}};var it=(et||(et=1,function(e){var t=Object.prototype.hasOwnProperty,i="~";function r(){}function n(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new n(r,o||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,r,n=[];if(0===this._eventsCount)return n;for(r in e=this._events)t.call(e,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},s.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,a=new Array(o);n<o;n++)a[n]=r[n].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,n,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,d,c=this._events[s],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,n),!0;case 5:return c.fn.call(c.context,t,r,n,o),!0;case 6:return c.fn.call(c.context,t,r,n,o,a),!0}for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c.fn.apply(c.context,l)}else{var h,A=c.length;for(d=0;d<A;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),u){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,r);break;case 4:c[d].fn.call(c[d].context,t,r,n);break;default:if(!l)for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c[d].fn.apply(c[d].context,l)}}return!0},s.prototype.on=function(e,t,i){return o(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return o(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,r,n){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||n&&!s.once||r&&s.context!==r||a(this,o);else{for(var l=0,d=[],c=s.length;l<c;l++)(s[l].fn!==t||n&&!s[l].once||r&&s[l].context!==r)&&d.push(s[l]);d.length?this._events[o]=1===d.length?d[0]:d:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}(tt)),tt.exports),rt=n(it);function nt(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=new URL(e),r=e.split("?")[1];let n={};if(r){const e=r.split("&");for(let t of e){if(""===t)continue;const e=t.split("=");e[0]&&(n[e[0]]=e[1])}}const o={protocol:i.protocol,hostname:i.hostname,port:i.port,pathname:i.pathname,search:i.search,query:n,url:e};if(t&&/_(\d+)_(\d+)\.flv/.test(e)){const e=i.pathname.split("/")[i.pathname.split("/").length-1].replace(/.flv$/,"").split("_");e[0].indexOf("-")>=0?o.deviceSerial=e[0].split("-")[1]:o.deviceSerial=e[0],o.channelNo=+e[1],o.streamTypeIn=+e[2]}return o}var ot,at={exports:{}},st=o(Object.freeze({__proto__:null,default:{}}));var lt=(ot||(ot=1,function(e){!function(){var t="input is invalid type",i="object"==typeof window,n=i?window:{};n.JS_MD5_NO_WINDOW&&(i=!1);var o=!i&&"object"==typeof self,a=!n.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?n=r:o&&(n=self);var s,l=!n.JS_MD5_NO_COMMON_JS&&e.exports,d=!n.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),u=[128,32768,8388608,-2147483648],h=[0,8,16,24],A=["hex","array","digest","buffer","arrayBuffer","base64"],p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),f=[];if(d){var _=new ArrayBuffer(68);s=new Uint8Array(_),f=new Uint32Array(_)}var m=Array.isArray;!n.JS_MD5_NO_NODE_JS&&m||(m=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var v=ArrayBuffer.isView;!d||!n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&v||(v=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var g=function(e){var i=typeof e;if("string"===i)return[e,!0];if("object"!==i||null===e)throw new Error(t);if(d&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!m(e)&&!v(e))throw new Error(t);return[e,!1]},y=function(e){return function(t){return new E(!0).update(t)[e]()}},b=function(e){var i,r=st,o=st.Buffer;return i=o.from&&!n.JS_MD5_NO_BUFFER_FROM?o.from:function(e){return new o(e)},function(n){if("string"==typeof n)return r.createHash("md5").update(n,"utf8").digest("hex");if(null==n)throw new Error(t);return n.constructor===ArrayBuffer&&(n=new Uint8Array(n)),m(n)||v(n)||n.constructor===o?r.createHash("md5").update(i(n)).digest("hex"):e(n)}},S=function(e){return function(t,i){return new w(t,!0).update(i)[e]()}};function E(e){if(e)f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f,this.buffer8=s;else if(d){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function w(e,t){var i,r=g(e);if(e=r[0],r[1]){var n,o=[],a=e.length,s=0;for(i=0;i<a;++i)(n=e.charCodeAt(i))<128?o[s++]=n:n<2048?(o[s++]=192|n>>>6,o[s++]=128|63&n):n<55296||n>=57344?(o[s++]=224|n>>>12,o[s++]=128|n>>>6&63,o[s++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),o[s++]=240|n>>>18,o[s++]=128|n>>>12&63,o[s++]=128|n>>>6&63,o[s++]=128|63&n);e=o}e.length>64&&(e=new E(!0).update(e).array());var l=[],d=[];for(i=0;i<64;++i){var c=e[i]||0;l[i]=92^c,d[i]=54^c}E.call(this,t),this.update(d),this.oKeyPad=l,this.inner=!0,this.sharedMemory=t}E.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t=g(e);e=t[0];for(var i,r,n=t[1],o=0,a=e.length,s=this.blocks,l=this.buffer8;o<a;){if(this.hashed&&(this.hashed=!1,s[0]=s[16],s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),n)if(d)for(r=this.start;o<a&&r<64;++o)(i=e.charCodeAt(o))<128?l[r++]=i:i<2048?(l[r++]=192|i>>>6,l[r++]=128|63&i):i<55296||i>=57344?(l[r++]=224|i>>>12,l[r++]=128|i>>>6&63,l[r++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),l[r++]=240|i>>>18,l[r++]=128|i>>>12&63,l[r++]=128|i>>>6&63,l[r++]=128|63&i);else for(r=this.start;o<a&&r<64;++o)(i=e.charCodeAt(o))<128?s[r>>>2]|=i<<h[3&r++]:i<2048?(s[r>>>2]|=(192|i>>>6)<<h[3&r++],s[r>>>2]|=(128|63&i)<<h[3&r++]):i<55296||i>=57344?(s[r>>>2]|=(224|i>>>12)<<h[3&r++],s[r>>>2]|=(128|i>>>6&63)<<h[3&r++],s[r>>>2]|=(128|63&i)<<h[3&r++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),s[r>>>2]|=(240|i>>>18)<<h[3&r++],s[r>>>2]|=(128|i>>>12&63)<<h[3&r++],s[r>>>2]|=(128|i>>>6&63)<<h[3&r++],s[r>>>2]|=(128|63&i)<<h[3&r++]);else if(d)for(r=this.start;o<a&&r<64;++o)l[r++]=e[o];else for(r=this.start;o<a&&r<64;++o)s[r>>>2]|=e[o]<<h[3&r++];this.lastByteIndex=r,this.bytes+=r-this.start,r>=64?(this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},E.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>>2]|=u[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},E.prototype.hash=function(){var e,t,i,r,n,o,a=this.blocks;this.first?t=((t=((e=((e=a[0]-680876937)<<7|e>>>25)-271733879|0)^(i=((i=(-271733879^(r=((r=(-1732584194^2004318071&e)+a[1]-117830708)<<12|r>>>20)+e|0)&(-271733879^e))+a[2]-1126478375)<<17|i>>>15)+r|0)&(r^e))+a[3]-1316259209)<<22|t>>>10)+i|0:(e=this.h0,t=this.h1,i=this.h2,t=((t+=((e=((e+=((r=this.h3)^t&(i^r))+a[0]-680876936)<<7|e>>>25)+t|0)^(i=((i+=(t^(r=((r+=(i^e&(t^i))+a[1]-389564586)<<12|r>>>20)+e|0)&(e^t))+a[2]+606105819)<<17|i>>>15)+r|0)&(r^e))+a[3]-1044525330)<<22|t>>>10)+i|0),t=((t+=((e=((e+=(r^t&(i^r))+a[4]-176418897)<<7|e>>>25)+t|0)^(i=((i+=(t^(r=((r+=(i^e&(t^i))+a[5]+1200080426)<<12|r>>>20)+e|0)&(e^t))+a[6]-1473231341)<<17|i>>>15)+r|0)&(r^e))+a[7]-45705983)<<22|t>>>10)+i|0,t=((t+=((e=((e+=(r^t&(i^r))+a[8]+1770035416)<<7|e>>>25)+t|0)^(i=((i+=(t^(r=((r+=(i^e&(t^i))+a[9]-1958414417)<<12|r>>>20)+e|0)&(e^t))+a[10]-42063)<<17|i>>>15)+r|0)&(r^e))+a[11]-1990404162)<<22|t>>>10)+i|0,t=((t+=((e=((e+=(r^t&(i^r))+a[12]+1804603682)<<7|e>>>25)+t|0)^(i=((i+=(t^(r=((r+=(i^e&(t^i))+a[13]-40341101)<<12|r>>>20)+e|0)&(e^t))+a[14]-1502002290)<<17|i>>>15)+r|0)&(r^e))+a[15]+1236535329)<<22|t>>>10)+i|0,t=((t+=((r=((r+=(t^i&((e=((e+=(i^r&(t^i))+a[1]-165796510)<<5|e>>>27)+t|0)^t))+a[6]-1069501632)<<9|r>>>23)+e|0)^e&((i=((i+=(e^t&(r^e))+a[11]+643717713)<<14|i>>>18)+r|0)^r))+a[0]-373897302)<<20|t>>>12)+i|0,t=((t+=((r=((r+=(t^i&((e=((e+=(i^r&(t^i))+a[5]-701558691)<<5|e>>>27)+t|0)^t))+a[10]+38016083)<<9|r>>>23)+e|0)^e&((i=((i+=(e^t&(r^e))+a[15]-660478335)<<14|i>>>18)+r|0)^r))+a[4]-405537848)<<20|t>>>12)+i|0,t=((t+=((r=((r+=(t^i&((e=((e+=(i^r&(t^i))+a[9]+568446438)<<5|e>>>27)+t|0)^t))+a[14]-1019803690)<<9|r>>>23)+e|0)^e&((i=((i+=(e^t&(r^e))+a[3]-187363961)<<14|i>>>18)+r|0)^r))+a[8]+1163531501)<<20|t>>>12)+i|0,t=((t+=((r=((r+=(t^i&((e=((e+=(i^r&(t^i))+a[13]-1444681467)<<5|e>>>27)+t|0)^t))+a[2]-51403784)<<9|r>>>23)+e|0)^e&((i=((i+=(e^t&(r^e))+a[7]+1735328473)<<14|i>>>18)+r|0)^r))+a[12]-1926607734)<<20|t>>>12)+i|0,t=((t+=((o=(r=((r+=((n=t^i)^(e=((e+=(n^r)+a[5]-378558)<<4|e>>>28)+t|0))+a[8]-2022574463)<<11|r>>>21)+e|0)^e)^(i=((i+=(o^t)+a[11]+1839030562)<<16|i>>>16)+r|0))+a[14]-35309556)<<23|t>>>9)+i|0,t=((t+=((o=(r=((r+=((n=t^i)^(e=((e+=(n^r)+a[1]-1530992060)<<4|e>>>28)+t|0))+a[4]+1272893353)<<11|r>>>21)+e|0)^e)^(i=((i+=(o^t)+a[7]-155497632)<<16|i>>>16)+r|0))+a[10]-1094730640)<<23|t>>>9)+i|0,t=((t+=((o=(r=((r+=((n=t^i)^(e=((e+=(n^r)+a[13]+681279174)<<4|e>>>28)+t|0))+a[0]-358537222)<<11|r>>>21)+e|0)^e)^(i=((i+=(o^t)+a[3]-722521979)<<16|i>>>16)+r|0))+a[6]+76029189)<<23|t>>>9)+i|0,t=((t+=((o=(r=((r+=((n=t^i)^(e=((e+=(n^r)+a[9]-640364487)<<4|e>>>28)+t|0))+a[12]-421815835)<<11|r>>>21)+e|0)^e)^(i=((i+=(o^t)+a[15]+530742520)<<16|i>>>16)+r|0))+a[2]-995338651)<<23|t>>>9)+i|0,t=((t+=((r=((r+=(t^((e=((e+=(i^(t|~r))+a[0]-198630844)<<6|e>>>26)+t|0)|~i))+a[7]+1126891415)<<10|r>>>22)+e|0)^((i=((i+=(e^(r|~t))+a[14]-1416354905)<<15|i>>>17)+r|0)|~e))+a[5]-57434055)<<21|t>>>11)+i|0,t=((t+=((r=((r+=(t^((e=((e+=(i^(t|~r))+a[12]+1700485571)<<6|e>>>26)+t|0)|~i))+a[3]-1894986606)<<10|r>>>22)+e|0)^((i=((i+=(e^(r|~t))+a[10]-1051523)<<15|i>>>17)+r|0)|~e))+a[1]-2054922799)<<21|t>>>11)+i|0,t=((t+=((r=((r+=(t^((e=((e+=(i^(t|~r))+a[8]+1873313359)<<6|e>>>26)+t|0)|~i))+a[15]-30611744)<<10|r>>>22)+e|0)^((i=((i+=(e^(r|~t))+a[6]-1560198380)<<15|i>>>17)+r|0)|~e))+a[13]+1309151649)<<21|t>>>11)+i|0,t=((t+=((r=((r+=(t^((e=((e+=(i^(t|~r))+a[4]-145523070)<<6|e>>>26)+t|0)|~i))+a[11]-1120210379)<<10|r>>>22)+e|0)^((i=((i+=(e^(r|~t))+a[2]+718787259)<<15|i>>>17)+r|0)|~e))+a[9]-343485551)<<21|t>>>11)+i|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=i-1732584194|0,this.h3=r+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+i|0,this.h3=this.h3+r|0)},E.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,r=this.h3;return c[e>>>4&15]+c[15&e]+c[e>>>12&15]+c[e>>>8&15]+c[e>>>20&15]+c[e>>>16&15]+c[e>>>28&15]+c[e>>>24&15]+c[t>>>4&15]+c[15&t]+c[t>>>12&15]+c[t>>>8&15]+c[t>>>20&15]+c[t>>>16&15]+c[t>>>28&15]+c[t>>>24&15]+c[i>>>4&15]+c[15&i]+c[i>>>12&15]+c[i>>>8&15]+c[i>>>20&15]+c[i>>>16&15]+c[i>>>28&15]+c[i>>>24&15]+c[r>>>4&15]+c[15&r]+c[r>>>12&15]+c[r>>>8&15]+c[r>>>20&15]+c[r>>>16&15]+c[r>>>28&15]+c[r>>>24&15]},E.prototype.toString=E.prototype.hex,E.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,r=this.h3;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&i,i>>>8&255,i>>>16&255,i>>>24&255,255&r,r>>>8&255,r>>>16&255,r>>>24&255]},E.prototype.array=E.prototype.digest,E.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},E.prototype.buffer=E.prototype.arrayBuffer,E.prototype.base64=function(){for(var e,t,i,r="",n=this.array(),o=0;o<15;)e=n[o++],t=n[o++],i=n[o++],r+=p[e>>>2]+p[63&(e<<4|t>>>4)]+p[63&(t<<2|i>>>6)]+p[63&i];return e=n[o],r+=p[e>>>2]+p[e<<4&63]+"=="},w.prototype=new E,w.prototype.finalize=function(){if(E.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();E.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),E.prototype.finalize.call(this)}};var T=function(){var e=y("hex");a&&(e=b(e)),e.create=function(){return new E},e.update=function(t){return e.create().update(t)};for(var t=0;t<A.length;++t){var i=A[t];e[i]=y(i)}return e}();T.md5=T,T.md5.hmac=function(){var e=S("hex");e.create=function(e){return new w(e)},e.update=function(t,i){return e.create(t).update(i)};for(var t=0;t<A.length;++t){var i=A[t];e[i]=S(i)}return e}(),l?e.exports=T:n.md5=T}()}(at)),at.exports),dt=n(lt);const ct="/api/v3/device/local/video/unify/query",ut="/api/service/device/capacity/video/quality",ht="/api/v3/device/setVideoLevel",At="/api/lapp/v2/live/address/get",pt="/api/service/media/live/cdn/config",ft="/api/service/media/live/record/cdn/config";function _t(e){return e<10?"0"+e:e+""}const mt={0:"流畅",1:"标清",2:"高清",3:"超清",4:"极清",5:"3K",6:"4K"},vt=[{videoLevel:1,name:mt[1],streamTypeIn:2,type:"compatible"},{videoLevel:2,name:mt[2],streamTypeIn:1,type:"compatible"}];class gt{constructor(e,t){this._player=e,this.baseURL=t.baseURL||"https://open.ys7.com",this.accessToken=t.accessToken,this.deviceSerial=t.deviceSerial,this.channelNo=t.channelNo,this.appName=t.appName,this.v=t.v}fetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=/http[s]?:\/\//.test(e)?e:`${this.baseURL}${e}`;return fetch(i,{...t||{},headers:{clientType:"ezuikit-flv",accessToken:this.accessToken,deviceSerial:this.deviceSerial,localIndex:this.channelNo,...t.headers||{}}})}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch(e,{...t||{},method:"get"})}post(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch(e,{...t||{},method:"post"})}setVideoLevelService(e){const t=new FormData;return t.append("videoLevel",parseInt(e)),this.post(`${ht}`,{body:t}).then((e=>e.json())).catch((e=>{var t,i;null===(t=(i=this._player).emit)||void 0===t||t.call(i,P.fetchError,{api:ht,error:e})}))}async getLocalVideoUnifyQueryService(e){var t,i,r,n;const o=(e.startTime+36e5*((null===(t=this._player._opt)||void 0===t?void 0:t.timeZone)||0))/1e3,a=(e.endTime+36e5*((null===(i=this._player._opt)||void 0===i?void 0:i.timeZone)||0))/1e3,s=async e=>{let t=[];try{var i,r,n;const d=await this.get(`${ct}?startTime=${e.startTime}&endTime=${e.endTime}&pageSize=${e.pageSize||200}`).then((e=>e.json())).catch((e=>{var t,i;null===(t=(i=this._player).emit)||void 0===t||t.call(i,P.fetchError,{api:ct,error:e})}));var o,a,l;if(200!==(null==d||null===(i=d.meta)||void 0===i?void 0:i.code))return null===(o=(a=this._player).emit)||void 0===o||o.call(a,P.fetchError,{api:ct,error:null==d?void 0:d.meta}),t;if(null!=d&&null!==(r=d.data)&&void 0!==r&&null!==(r=r.records)&&void 0!==r&&r.length&&(t=t.concat(d.data.records||[])),null!=d&&null!==(n=d.data)&&void 0!==n&&n.hasMore)t=t.concat(await s({...e,startTime:null==d||null===(l=d.data)||void 0===l?void 0:l.nextFileTime}))}catch(e){}return t},l=await s({...e,startTime:o,endTime:a})||[];return this._player.playbackRecords=(l||[]).map((e=>{var t,i;return{...e,startTime:e.startTime-3600*((null===(t=this._player._opt)||void 0===t?void 0:t.timeZone)||0),endTime:e.endTime-3600*((null===(i=this._player._opt)||void 0===i?void 0:i.timeZone)||0)}})).reduce(((e,t)=>{const i=e[e.length-1];return i&&i.endTime===t.startTime?i.endTime=t.endTime:e.push(t),e}),[]),null===(r=(n=this._player).emit)||void 0===r||r.call(n,D.localVideoRecords,this._player.playbackRecords),l}async getVideoQualityService(){let e=vt;try{var t,i;const o=await this.get(`${ut}?deviceSerial=${this.deviceSerial}`).then((e=>e.json())).catch((e=>{this._player.emit(P.fetchError,{api:ut,error:e})}));var r,n;if(200!==(null==o||null===(t=o.meta)||void 0===t?void 0:t.code))return null===(r=(n=this._player).emit)||void 0===r||r.call(n,P.fetchError,{api:ut,error:null==o?void 0:o.meta}),e;null!=o&&null!==(i=o.data)&&void 0!==i&&i.length&&(e=o.data)}catch(e){}return e=e.map((e=>({...e,name:mt[e.videoLevel]||"未知"}))),e}getPlayAddressService(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=new FormData;return Object.keys(e).forEach((i=>{t.append(i,e[i])})),t.append("protocol",4),t.append("accessToken",this.accessToken),t.append("deviceSerial",this.deviceSerial),t.append("channelNo",this.channelNo),this.post(`${At}`,{body:t}).then((e=>e.json())).then((e=>{var t;return 200==+e.code?null==e||null===(t=e.data)||void 0===t?void 0:t.url:""}))}getRecordAddressService(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.appName&&this.v?(delete e.expireTime,this.getCDNRecordAddressService(e)):this.getPlayAddressService({...e,type:2})}getLiveAddressService(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.appName&&this.v?(delete e.expireTime,this.getCDNLiveAddressService(e)):this.getPlayAddressService({...e,type:1})}getCDNPlayAddressService(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new FormData,r=new Date,n=`${r.getFullYear()}-${_t(r.getMonth()+1)}-${_t(r.getDate())} 00:00:00`,o=`${r.getFullYear()}-${_t(r.getMonth()+1)}-${_t(r.getDate())} 23:59:59`;return i.append("startTime",n),i.append("endTime",o),i.append("playProtocol",2),i.append("streamName",dt((function(e,t){var i,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[];for(t=t||r.length,i=0;i<e;i++)n[i]=r[0|Math.random()*t];return n.join("")}(32)+"_"+(new Date).getTime()).replace(/-/gi,"")+"_"+this.deviceSerial+"_"+this.channelNo+"_"+t.quality)),i.append("supportH265",1),i.append("appName",this.appName),Object.keys(t).forEach((e=>{i.append(e,t[e])})),this.post(e,{body:i}).then((e=>e.json())).then((e=>{var t,i;return 200==+(null===(t=e.meta)||void 0===t?void 0:t.code)?null===(i=e.data)||void 0===i?void 0:i.cdnUrl:""}))}async getCDNLiveAddressService(e){return this.getCDNPlayAddressService(`${pt}`,e)}async getCDNRecordAddressService(e){return this.getCDNPlayAddressService(`${ft}`,{recordStartTime:e.startTime,recordEndTime:e.stopTime,quality:e.quality,type:e.type||1})}}function yt(e){return new Date(bt(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/"))}function bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return`${(e=e.replace(/\//gi,"").replace(/-/gi,"").replace(/:/gi,"").replace(/ /gi,"")).substring(0,4)}${t}${e.substring(4,6)}${t}${e.substring(6,8)} ${e.substring(8,10)}:${e.substring(10,12)}:${e.substring(12,14)}`}const St=["h264","h265"],Et=[.5,1,2,4,8];class wt extends rt{constructor(t){var i;super(wt._setOptions(t)),e(this,"event",new rt),e(this,"urlInfo",{}),e(this,"services",null),e(this,"_loadingTimeoutDelayTimer",null),ze.initMonitor(t.ignoreMonitor||t.disableColect);const r=Object.assign({},{isLive:!0,timeZone:0},f,t);let n=t.id||t.container;if("string"==typeof n&&(n=document.querySelector("#"+n.replace(/^#/,""))),!n)throw new Error("Flv required node can be a string (dom id) or dom (HTMLElement node)");if("CANVAS"===n.nodeName||"VIDEO"===n.nodeName)throw new Error(`Flv container type can not be ${n.nodeName} type`);if(!t.url)throw new Error("Flv url is empty");ze.url=t.url,ze.report(1,{name:"constructor"}),n.classList.add("ezui-player-container","ezui-flv-container"),n.style.cssText+="position:relative; overflow: hidden;",delete r.container,r.forceNoOffscreen=!0,ee(r.videoBuffer)&&(r.videoBuffer=1e3*Number(r.videoBuffer)),this._opt=r,this.urlInfo=nt(r.url,this._opt.isEzviz),this.$container=n,this._loadingTimeoutReplayTimes=0,this.events=new Ce(this),this._initPlayer(n,r),this._videoInfo={},this._currentPlayDate=null,this.definitionList=[],this.definition={},this._playbackRate=1,this.playbackRateList=Et,this.playbackRecords=[],this.services=new gt(this,{baseURL:(null===(i=this._opt.env)||void 0===i?void 0:i.domain)||H,accessToken:this._opt.accessToken,deviceSerial:this.urlInfo.deviceSerial,channelNo:this.urlInfo.channelNo}),this._httpServices()}_httpServices(){try{var e,t,i;if(this._opt.isEzviz&&null!==(e=this._opt)&&void 0!==e&&e.accessToken&&this.urlInfo.deviceSerial&&this.urlInfo.channelNo>=0&&this.urlInfo.streamTypeIn)if(this.services=new gt(this,{baseURL:((null===(t=this._opt.env)||void 0===t?void 0:t.domain)||H).replace(/\/$/,""),accessToken:this._opt.accessToken,deviceSerial:this.urlInfo.deviceSerial,channelNo:this.urlInfo.channelNo,appName:this._opt.appName,v:null===(i=this.urlInfo.query)||void 0===i?void 0:i.v}),this._isEzvizPlayback(this._opt.url)&&!this._opt.isLive){var r,n,o,a;this._playbackRate=+((null===(r=this.urlInfo)||void 0===r||null===(r=r.query)||void 0===r?void 0:r.playbackSpeed)||1),null===(n=this.services)||void 0===n||n.getLocalVideoUnifyQueryService({startTime:yt(null===(o=this.urlInfo)||void 0===o||null===(o=o.query)||void 0===o?void 0:o.begin).getTime(),endTime:yt(null===(a=this.urlInfo)||void 0===a||null===(a=a.query)||void 0===a?void 0:a.end).getTime()});let e=null,t=0;this.on(D.timeUpdate,(i=>{const r=this.playbackRecords.length;if(r>0){var n,o;const d=yt(this.urlInfo.query.begin).getTime()/1e3;let c=null===(n=this.playbackRecords[t])||void 0===n?void 0:n.startTime,u=null===(o=this.playbackRecords[t])||void 0===o?void 0:o.endTime;if(d<=this.playbackRecords[0].startTime)t=0;else{if(d>=this.playbackRecords[this.playbackRecords.length-1].endTime)return;for(let e=0;e<r;e++){const i=this.playbackRecords[e];if(d>=i.startTime&&d<=i.endTime){var a;t=e,c=d,u=null===(a=this.playbackRecords[t])||void 0===a?void 0:a.endTime;break}{const r=this.playbackRecords[e+1];if(d>=i.endTime&&d<=r.startTime){var s,l;t=e+1,c=null===(s=this.playbackRecords[t])||void 0===s?void 0:s.startTime,u=null===(l=this.playbackRecords[t])||void 0===l?void 0:l.endTime;break}}}}let h=parseInt(c+i,10);if(0===i)return;this.emit(D.timeUpdateOSD,{currentTime:i,currentFragmentPlayEnd:c+i>=u,currentSliceIndex:t,osd:h}),h+3>=this.playbackRecords[r-1].endTime&&(e&&clearTimeout(e),e=setTimeout((()=>{this.emit(D.end),clearTimeout(e),this.pause()}),3e3)),c+i>=u&&t<r-1&&t++;const A=new Date(1e3*h);this._currentPlayDate=`${A.getFullYear()}${_t(A.getMonth()+1)}${_t(A.getDate())}${_t(A.getHours())}${_t(A.getMinutes())}${_t(A.getSeconds())}`}}))}else if(!this._isEzvizPlayback(this._opt.url)&&this._opt.isLive){var s,l,d,c;const e=null!==(s=this.urlInfo)&&void 0!==s&&null!==(s=s.query)&&void 0!==s&&s.expire?parseInt((1e3*this.urlInfo.query.expire-(new Date).getTime())/1e3):void 0;Promise.all([null===(l=this.services)||void 0===l?void 0:l.getVideoQualityService(),null===(d=this.services)||void 0===d?void 0:d.getLiveAddressService({quality:"1"==(null===(c=this.urlInfo)||void 0===c?void 0:c.streamTypeIn)?2:1,expireTime:e})]).then((e=>{let t=[this.urlInfo.url,e[1]].sort(((e,t)=>{const i=e=>{const t=e.match(/_(\d+)\.flv/);return t?parseInt(t[1],10):0};return i(e)-i(t)}));const i=e[0].map(((e,i)=>({...e,url:1===e.streamTypeIn?t[0]:t[1]})));this.definitionList=i,this.emit(D.getDefinitionListResult,i),this.emit(D.definitionListChange,i)}))}}catch(e){var u,h;null===(u=this.player)||void 0===u||null===(u=u.debug)||void 0===u||null===(h=u.error)||void 0===h||h.call(u,e)}}setDefinitionList(e){this.player&&(this.definitionList=e,this.emit(D.definitionListChange,e))}switchDefinition(e){if(this.player){if(e.videoLevel>=0&&[1,2].includes(e.streamTypeIn)){const n=this.definitionList.find((t=>t.videoLevel===e.videoLevel));if(n){if(this.emit(D.definitionChange,n),this.definition=n,n.url){var t;if("compatible"!==n.type)null===(t=this.services)||void 0===t||t.setVideoLevelService(n.videoLevel);return this.playing?this.pause().then((()=>{this.play({url:n.url})})):this.play({url:n.url}),Promise.resolve(0)}var i;return null===(i=this.player.debug)||void 0===i||i.warn("play url is not found"),Promise.resolve(1)}var r;return null===(r=this.player.debug)||void 0===r||r.warn("definition is not found"),Promise.resolve(1)}var n;return null===(n=this.player.debug)||void 0===n||n.warn(`not support ${null==e?void 0:e.videoLevel}`),Promise.resolve(1)}}setPlaybackRateList(e){this.player&&(this.playbackRateList=e,this.emit(D.playbackRateListChange,e))}get playbackRate(){return this._playbackRate}set playbackRate(e){this.switchPlaybackRate(e)}switchPlaybackRate(e){var t,i,r;return this.player&&this._isEzvizPlayback(this._opt.url)?(e=+e,null!==(t=this.playbackRateList)&&void 0!==t&&t.includes(e)?this._getNewRecordPlayUrl({playbackRate:e}).then((t=>t?(this._playbackRate=e,this.emit(D.playbackRateChange,e),this.playing?this.pause().then((e=>{this.play({url:t})})):this.play({url:t}),0):1)):(null===(i=this.player)||void 0===i||null===(i=i.debug)||void 0===i||i.warn(`not support ${e}`),Promise.resolve(1))):(null===(r=this.player)||void 0===r||null===(r=r.debug)||void 0===r||r.warn(`not support ${e}`),Promise.resolve(1))}_getNewRecordPlayUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.player&&this._isEzvizPlayback(this._opt.url)){var t,i,r,n;const o=yt(this._currentPlayDate||(null===(t=this.urlInfo)||void 0===t||null===(t=t.query)||void 0===t?void 0:t.begin)),a=yt(null===(i=this.urlInfo)||void 0===i||null===(i=i.query)||void 0===i?void 0:i.end);return null===(r=this.services)||void 0===r?void 0:r.getRecordAddressService({expireTime:parseInt((new Date(1e3*(null===(n=this.urlInfo.query)||void 0===n?void 0:n.expire)).getTime()-(new Date).getTime())/1e3,10),startTime:`${o.getFullYear()}-${_t(o.getMonth()+1)}-${_t(o.getDate())} ${_t(o.getHours())}:${_t(o.getMinutes())}:${_t(o.getSeconds())}`,stopTime:`${a.getFullYear()}-${_t(a.getMonth()+1)}-${_t(a.getDate())} ${_t(a.getHours())}:${_t(a.getMinutes())}:${_t(a.getSeconds())}`,playbackSpeed:e.playbackRate||this.playbackRate,quality:this.urlInfo.streamTypeIn})}return Promise.resolve("")}_isEzvizPlayback(e){return this._opt.isEzviz&&/rec=(local|cloud)/.test(this._opt.url)}get playing(){return this.player.playing}static _setOptions(e){return"string"==typeof(e=Object.assign({},{isLive:!0,timeZone:0},f,e)).id?e:"string"==typeof e.container?(e.id=e.container.replace(/^#/,""),e):e}destroy(){this.events&&(this.events.destroy(),this.events=null),this.player&&(this.player.destroy(),this.player=null),this.$container&&(this.$container.classList.remove("ezui-flv-container"),this.$container=null),this.definitionList=[],this.definition={},this._videoInfo={},this._currentPlayDate=null,this.urlInfo={},this._playbackRate=1,this.playbackRateList=[],this.playbackRecords=[],this.$container=null,this._opt={},this._loadingTimeoutReplayTimes=0,this.removeAllListeners(),ze.report(50,{name:"destroy"})}_handlevideoInfo(e){this._videoInfo=e||{}}_initPlayer(e,t){var r,n,o,a;t.url&&(t.url=i(t.url,St)),this.player=new Je(e,t),null===(r=this.player.debug)||void 0===r||r.log("Flv","version",wt.version),null===(n=this.player.debug)||void 0===n||n.log("Flv","_initPlayer",JSON.stringify(t)),this._bindEvents(),t.autoPlay&&this.play(),this._handlevideoInfo=this._handlevideoInfo.bind(this),null===(o=this.player)||void 0===o||o.off(D.videoInfo,this._handlevideoInfo),null===(a=this.player)||void 0===a||a.on(D.videoInfo,this._handlevideoInfo)}_resetPlayer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.player.destroy(),this.player=null,this._opt=Object.assign(this._opt,e),this._initPlayer(this.$container,this._opt)}_bindEvents(){Object.keys(M).forEach((e=>{this.player.on(M[e],(t=>{this.emit(e,t),this.event.emit(e,t)}))}))}setDebug(e){this.player.updateOption({debug:e}),ze.report(50,{name:"setDebug"})}setLogger(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.player.updateOption({loggerOptions:{...this.player._opt.loggerOptions||{},...e}})}closeSound(){var e,t;null===(e=this.player)||void 0===e||null===(t=e.mute)||void 0===t||t.call(e,!0),ze.report(50,{name:"closeSound"})}openSound(){var e,t;null===(e=this.player)||void 0===e||null===(t=e.mute)||void 0===t||t.call(e,!1),ze.report(50,{name:"openSound"})}setVolume(e){this.player&&(this.player.volume=e,ze.report(50,{name:"setVolume",value:e}))}get volume(){return this.player.volume}set volume(e){this.setVolume(e)}getVolume(){return ze.report(50,{name:"getVolume"}),this.player.volume}audioResume(){var e,t;null===(e=this.player)||void 0===e||null===(e=e.audio)||void 0===e||null===(t=e.audioEnabled)||void 0===t||t.call(e,!0),ze.report(50,{name:"audioResume"})}setScaleMode(e){return new Promise(((t,i)=>{try{e=Number(e)}catch(e){return void i(e)}[V.full,V.auto,V.fullAuto].includes(e)?(this.player.updateOption({scaleMode:e}),this.resize(),t(),ze.report(50,{name:"setScaleMode"})):i("scale mode 0 | 1 | 2")}))}pause(){var e,t;return ze.report(50,{name:"pause"}),this._delayTimeoutTimer&&(clearTimeout(this._delayTimeoutTimer),this._delayTimeoutTimer=null),this._loadingTimeoutDelayTimer&&(clearTimeout(this._loadingTimeoutDelayTimer),this._loadingTimeoutDelayTimer=null),null===(e=this.player)||void 0===e||null===(t=e.pause)||void 0===t?void 0:t.call(e)}clearView(){this.player.video.clearView(),ze.report(50,{name:"clearView"})}async play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._loadingTimeoutReplayTimes=0,this.__play(e)}async __play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.url&&(ze.url=e.url),"string"==typeof e&&(e={url:e}),this._currentPlayDate&&!e.url&&this._isEzvizPlayback())try{e.url=await this.services.getRecordAddressService({expireTime:86400,quality:this.urlInfo.streamTypeIn,startTime:bt(this._currentPlayDate,"-"),stopTime:bt(this.urlInfo.query.end,"-"),playbackSpeed:this.playbackRate}),this._currentPlayDate=null}catch(e){}const t=i(e.url||this._opt.url,St);return this.urlInfo=nt(t,this._opt.isEzviz),this._playbackRate=this.urlInfo.query.playbackSpeed||1,this._opt=Object.assign({},this._opt,e||{},{url:t}),this._opt.urlQuery=Qe(e.url),ze.report(50,{name:"play"}),await new Promise(((e,t)=>{var i;if(!this._opt.url)return this.emit(D.error,P.playError),void t("play url is empty");null!==(i=this.player)&&void 0!==i&&i.playing?(this.clearView(),this.player.play(this._opt).then((()=>{e()})).catch((e=>{this.player.debug.warn("Flv","pause -> play and play error",e),this.player.pause().then((()=>{t(e)}))}))):this._play(this._opt).then((()=>{e()})).catch((e=>{this.player.debug.warn("Flv","this._play error",e),t(e)}))}))}_play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(((t,i)=>{const r=0===e.url.indexOf("http"),n=r?h:u,o=r||-1!==e.url.indexOf(".flv")||this._opt.isFlv?A:p;this.player.updateOption({protocol:n,demuxType:o}),this.player.once(P.webglAlignmentError,(()=>{this.player.off(P.webglAlignmentError),this.pause().then((()=>{this.player.debug.log("Flv","webglAlignmentError"),this._resetPlayer({openWebglAlignment:!0}),this.play(e).then((()=>{this.player.debug.log("Flv","webglAlignmentError and play success")})).catch((()=>{this.player.debug.log("Flv","webglAlignmentError and play error")}))}))})),this.player.once(P.mediaSourceH265NotSupport,(()=>{this.player.off(P.mediaSourceH265NotSupport),this.pause().then((()=>{this.player._opt.autoWasm&&(this.player.debug.log("Flv","auto wasm [mse-> wasm] reset player and play"),this._resetPlayer({useMSE:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","auto wasm [mse-> wasm] reset player and play success")})).catch((()=>{this.player.debug.log("Flv","auto wasm [mse-> wasm] reset player and play error")})))}))})),this.player.once(P.mediaSourceFull,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source full"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source full and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source full and reset player and play error")}))}))})),this.player.once(P.mediaSourceAppendBufferError,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source append buffer error"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source append buffer error and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source append buffer error and reset player and play error")}))}))})),this.player.once(P.mediaSourceBufferListLarge,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source buffer list large"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source buffer list large and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source buffer list large and reset player and play error")}))}))})),this.player.once(P.mediaSourceAppendBufferEndTimeout,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source append buffer end timeout"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source append buffer end timeout and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source append buffer end timeout and reset player and play error")}))}))})),this.player.once(P.mseSourceBufferError,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","mseSourceBufferError close success")}))})),this.player.once(P.webcodecsH265NotSupport,(()=>{this.pause().then((()=>{this.player._opt.autoWasm&&(this.player.debug.log("Flv","auto wasm [wcs-> wasm] reset player and play"),this._resetPlayer({useWCS:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","auto wasm [wcs-> wasm] reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","auto wasm [wcs-> wasm] reset player and play error")})))}))})),this.player.once(P.wasmDecodeError,(()=>{this.player._opt.wasmDecodeErrorReplay&&this.pause().then((()=>{this.player.debug.log("Flv","wasm decode error and reset player and play"),this._resetPlayer({useWCS:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","wasm decode error and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","wasm decode error and reset player and play error")}))}))})),this.player.off(D.delayTimeout,this._onDelayTimeout),this._onDelayTimeout=this._onDelayTimeout.bind(this),this.player.once(D.delayTimeout,this._onDelayTimeout),this.player.off(D.loadingTimeout,this._onLoadingTimeout),this._onLoadingTimeout=this._onLoadingTimeout.bind(this),this.player.once(D.loadingTimeout,this._onLoadingTimeout),this.player.off(D.delayTimeout,this._onStreamSuccess),this._onStreamSuccess=this._onStreamSuccess.bind(this),this.player.once(D.streamSuccess,this._onStreamSuccess),this.player.off(D.delayTimeout,this._onStreamError),this._onStreamError=this._onStreamError.bind(this),this.player.once(D.streamError,this._onStreamError),this.hasLoaded()?this.player.play(e).then((()=>{var e,i;null!==(e=this.player)&&void 0!==e&&null!==(e=e.video)&&void 0!==e&&e.$videoElement&&(null===(i=this.urlInfo.query)||void 0===i?void 0:i.playbackSpeed)>=1&&(this.player.video.$videoElement.playbackRate=this.urlInfo.query.playbackSpeed),t()})).catch((e=>{this.player&&(this.player.debug.warn("Flv","hasLoaded and play error",e),this.player.pause().then((()=>{i(e)})))})):this.player.once(D.decoderWorkerInit,(()=>{this.player.play(e).then((()=>{var e,i;null!==(e=this.player)&&void 0!==e&&null!==(e=e.video)&&void 0!==e&&e.$videoElement&&(null===(i=this.urlInfo.query)||void 0===i?void 0:i.playbackSpeed)>=1&&(this.player.video.$videoElement.playbackRate=this.urlInfo.query.playbackSpeed),t()})).catch((e=>{this.player&&(this.player.debug.warn("Flv","decoderWorkerInit and play error",e),this.player.pause().then((()=>{i(e)})))}))}))}))}_onDelayTimeout(){this._delayTimeoutTimer=setTimeout((()=>{this._delayTimeoutTimer&&(clearTimeout(this._delayTimeoutTimer),this._delayTimeoutTimer=null),(this._loadingTimeoutReplayTimes<+this.player._opt.loadingTimeoutReplayTimes||-1==+this.player._opt.loadingTimeoutReplayTimes)&&(this._loadingTimeoutReplayTimes+=1,this.player.debug.log("Flv",`delay timeout replay time is ${this._loadingTimeoutReplayTimes}`),this.player.off(D.delayTimeout,this._onDelayTimeout),this.emit(D.loadingRetryTimes,this._loadingTimeoutReplayTimes),this.__play(this._opt).then((()=>{this._loadingTimeoutReplayTimes=0})))}),1e3*(this._opt.loadingTimeoutDelay||3))}_onLoadingTimeout(){this._loadingTimeoutDelayTimer=setTimeout((()=>{this._loadingTimeoutDelayTimer&&(clearTimeout(this._loadingTimeoutDelayTimer),this._loadingTimeoutDelayTimer=null),(this._loadingTimeoutReplayTimes<+this.player._opt.loadingTimeoutReplayTimes||-1==+this.player._opt.loadingTimeoutReplayTimes)&&(this._loadingTimeoutReplayTimes+=1,this.player.debug.log("Flv",`loading timeout replay time is ${this._loadingTimeoutReplayTimes}`),this.player.off(D.delayTimeout,this._onLoadingTimeout),this.emit(D.loadingRetryTimes,this._loadingTimeoutReplayTimes),this.__play(this._opt).then((()=>{this._loadingTimeoutReplayTimes=0})))}),1e3*(this._opt.loadingTimeoutDelay||3))}_onStreamSuccess(){this.emit(D.streamSuccess)}_onStreamError(){this.emit(D.streamError)}resize(e,t){e>0&&t>0&&this.player.updateOption({width:e,height:t}),this.player.resize(),ze.report(50,{name:"resize"})}setBufferTime(e){var t,i;e=Number(e),this.player.updateOption({videoBuffer:1e3*e}),null===(t=this.player)||void 0===t||null===(t=t.decoderWorker)||void 0===t||null===(i=t.updateWorkConfig)||void 0===i||i.call(t,{key:"videoBuffer",value:1e3*e})}setRotate(e){ze.report(50,{name:"setRotate",value:e});try{e=parseInt(e,10)}catch(e){return Promise.reject("rotate 0 | 90 | 180 | 270")}return new Promise(((t,i)=>{wt.ROTATE.includes(e)?(this.player.updateOption({rotate:e}),this.resize(),t()):i("rotate 0 | 90 | 180 | 270")}))}hasLoaded(){return this.player.loaded}setKeepScreenOn(){this.player.updateOption({keepScreenOn:!0}),ze.report(50,{name:"setKeepScreenOn"})}_setFullscreen(e){const t=!!e;this.player.fullscreen!==t&&(this.player.fullscreen=t)}get fullscreening(){return this.player.fullscreen}get videoInfo(){return this._videoInfo}get currentTime(){return this.player.video?this.player.video.currentTime:0}fullScreen(){return this.fullscreen()}fullscreen(){return function(e){var t,i;return!!((null==(i=window)||null==(t=i.navigator)?void 0:t.userAgent)||"").match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)}()||this._setFullscreen(!0),ze.report(50,{name:"fullScreen"}),Promise.resolve()}cancelFullScreen(){return ze.report(50,{name:"cancelFullScreen"}),this.exitFullscreen()}exitFullscreen(){return this._setFullscreen(!1),ze.report(50,{name:"exitFullscreen"}),Promise.resolve()}screenshot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"png",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.92,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"download";if(this.player.video)return i=+i,this.player.video.screenshot(e,t,i,r)}getState(){return{playing:!!this.player&&this.player.playing,mute:!(this.player&&this.player.volume>0),fullscreen:!!this.player&&this.player.fullscreen,webFullscreen:!!this.player&&this.player.webFullscreen,loaded:!!this.player&&this.player.loaded,volume:this.player?parseFloat(this.player.volume).toFixed(2):0,isDebug:!!this.player&&this.player.isDebug}}getOptions(){return this.player?this.player._opt:{}}getVersion(){return ze.report(50,{name:"getVersion"}),"1.0.3-beta.2"}static supportType(e){if("flv"===e.type)return!0;if(e.url){let t=e.url;t.startsWith("http://")||t.startsWith("https://")||(t=/^\/\//.test(t)?"http:"+t:location.origin+location.pathname+t);try{return/\.flv$/i.test(new URL(t).pathname)}catch(e){}}return!1}}return e(wt,"ERROR",P),e(wt,"QUALITY_ENUM",mt),e(wt,"ROTATE",[0,90,180,270]),e(wt,"TIMEOUT",{delayTimeout:D.delayTimeout}),e(wt,"version","1.0.3-beta.2"),wt}));
|