ezuikit-flv 1.0.2 → 1.0.3-alpha.2
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 +11 -2
- package/README.md +6 -83
- package/decoder.js +3 -3
- package/index.js +6 -18
- package/package.json +2 -2
- package/types/constant/index.d.ts +14 -1
- package/types/index.d.ts +121 -21
- package/types/player/base-player.d.ts +9 -0
- package/types/player/hard-player/index.d.ts +15 -9
- package/types/player/hard-player/videoLoader.d.ts +3 -2
- package/types/player/index.d.ts +2 -2
- package/types/player/interface.d.ts +2 -1
- package/types/player/soft-player/canvasLoader.d.ts +5 -0
- package/types/player/soft-player/index.d.ts +4 -9
- package/types/services/HttpUtil.d.ts +19 -0
- package/types/services/api.d.ts +7 -0
- package/types/services/getAddress.d.ts +22 -0
- package/types/services/getLocalVideoUnifyQuery.d.ts +15 -0
- package/types/services/getVideoQuality.d.ts +38 -0
- package/types/services/setVideoLevel.d.ts +5 -0
- package/types/stream/index.d.ts +1 -2
- package/types/typedefs.d.ts +48 -6
- package/types/utils/debug.d.ts +1 -1
- package/types/utils/formatDateTIme.d.ts +6 -0
- package/types/utils/getInfoByUrl.d.ts +14 -0
- package/types/utils/index.d.ts +1 -3
- package/types/utils/number.d.ts +1 -0
- package/types/flv-mse/flv.min.d.ts +0 -3
package/index.js
CHANGED
|
@@ -1,42 +1,30 @@
|
|
|
1
1
|
/*
|
|
2
2
|
*
|
|
3
|
-
* EzuikitFlv.js v1.0.2
|
|
4
|
-
* Copyright (c)
|
|
3
|
+
* EzuikitFlv.js v1.0.3-alpha.2
|
|
4
|
+
* Copyright (c) 2025-3-13 Ezviz-OpenBiz
|
|
5
5
|
*
|
|
6
6
|
* https://github.com/Ezviz-OpenBiz/EZUIKit-flv
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).EzuikitFlv=t()}(this,(function(){"use strict";function e(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var
|
|
9
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).EzuikitFlv=t()}(this,(function(){"use strict";function e(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}
|
|
10
10
|
/*
|
|
11
11
|
*
|
|
12
12
|
* @ezuikit/utils-tools v1.0.2
|
|
13
13
|
* Copyright (c) 2024-5-22 Ezviz-OpenBiz
|
|
14
14
|
* Released under MIT the License.
|
|
15
15
|
*
|
|
16
|
-
*/function i(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)}var n={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function r(e,t){void 0===t&&(t=["h264"]);var i=(t||["h264"]).reduce((function(e,t){return t=t.toLowerCase(),e+(n[t]||0)}),0),r=e.split("?")[0],o=e.split("?")[1];return o=(o||"").split("&").filter((function(e){return!/^vc=\d?/.test(e)})).join("&"),r+"?"+o+(o?"&":"")+"vc="+i}
|
|
17
|
-
/*!
|
|
18
|
-
* browser-tool v1.2.2
|
|
19
|
-
* Useragent analysis tool.
|
|
20
|
-
* https://passer-by.com/browser/
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) 2017-present, HaoLe Zheng
|
|
23
|
-
*
|
|
24
|
-
* Released under the MIT License
|
|
25
|
-
* https://github.com/mumuy/browser
|
|
26
|
-
*
|
|
27
|
-
* Created on: 2024-01-16
|
|
28
|
-
*/function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a={name:"Safari",match:function(e){return e.indexOf("Safari")>-1},version:function(e){var t;return(null===(t=e.match(/Version\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},s={name:"Chrome",match:function(e){return e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1},version:function(e){var t,i;return(null===(t=e.match(/Chrome\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(i=e.match(/CriOS\/([\d.]+)/))||void 0===i?void 0:i[1])||""}},d={name:"Edge",match:function(e){return e.indexOf("Edge")>-1||e.indexOf("Edg/")>-1||e.indexOf("EdgA")>-1||e.indexOf("EdgiOS")>-1},version:function(e){var t,i,n,r;return(null===(t=e.match(/Edge\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(i=e.match(/Edg\/([\d.]+)/))||void 0===i?void 0:i[1])||(null===(n=e.match(/EdgA\/([\d.]+)/))||void 0===n?void 0:n[1])||(null===(r=e.match(/EdgiOS\/([\d.]+)/))||void 0===r?void 0:r[1])||""}},l={name:"IE",match:function(e){return e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1},version:function(e){var t,i;return(null===(t=e.match(/MSIE ([\d.]+)/))||void 0===t?void 0:t[1])||(null===(i=e.match(/rv:([\d.]+)/))||void 0===i?void 0:i[1])||""}},c={name:"Firefox",match:function(e){return e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1},version:function(e){var t,i;return(null===(t=e.match(/Firefox\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(i=e.match(/FxiOS\/([\d.]+)/))||void 0===i?void 0:i[1])||""}},h={name:"Firefox Focus",match:function(e){return e.indexOf("Focus")>-1},version:function(e){var t;return(null===(t=e.match(/Focus\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},u={name:"Chromium",match:function(e){return e.indexOf("Chromium")>-1},version:function(e){var t;return(null===(t=e.match(/Chromium\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},A={name:"Opera",match:function(e){return e.indexOf("Opera")>-1||e.indexOf("OPR")>-1},version:function(e){var t,i;return(null===(t=e.match(/Opera\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(i=e.match(/OPR\/([\d.]+)/))||void 0===i?void 0:i[1])||""}},p={name:"Vivaldi",match:function(e){return e.indexOf("Vivaldi")>-1},version:function(e){var t;return(null===(t=e.match(/Vivaldi\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},_={name:"Yandex",match:function(e){return e.indexOf("YaBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/YaBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},f={};"undefined"!=typeof globalThis?f=globalThis:"undefined"!=typeof self?f=self:"undefined"!=typeof window?f=window:"undefined"!=typeof global&&(f=global);var m=f,v={name:"Brave",match:function(e){var t;return!(null==m||null===(t=m.navigator)||void 0===t||!t.brave)},version:function(e){var t;return(null===(t=e.match(/Chrome\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},g={name:"Arora",match:function(e){return e.indexOf("Arora")>-1},version:function(e){var t;return(null===(t=e.match(/Arora\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},y={name:"Lunascape",match:function(e){return e.indexOf("Lunascape")>-1},version:function(e){var t;return(null===(t=e.match(/Lunascape[\/\s]([\d.]+)/))||void 0===t?void 0:t[1])||""}},b={name:"QupZilla",match:function(e){return e.indexOf("QupZilla")>-1},version:function(e){var t;return(null===(t=e.match(/QupZilla[\/\s]([\d.]+)/))||void 0===t?void 0:t[1])||""}},E={name:"Coc Coc",match:function(e){return e.indexOf("coc_coc_browser")>-1},version:function(e){var t;return(null===(t=e.match(/coc_coc_browser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},S={name:"Kindle",match:function(e){return e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1},version:function(e){var t;return(null===(t=e.match(/Version\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},w={name:"Iceweasel",match:function(e){return e.indexOf("Iceweasel")>-1},version:function(e){var t;return(null===(t=e.match(/Iceweasel\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},T={name:"Konqueror",match:function(e){return e.indexOf("Konqueror")>-1},version:function(e){var t;return(null===(t=e.match(/Konqueror\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},B={name:"Iceape",match:function(e){return e.indexOf("Iceape")>-1},version:function(e){var t;return(null===(t=e.match(/Iceape\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},k={name:"SeaMonkey",match:function(e){return e.indexOf("SeaMonkey")>-1},version:function(e){var t;return(null===(t=e.match(/SeaMonkey\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},C={name:"Epiphany",match:function(e){return e.indexOf("Epiphany")>-1},version:function(e){var t;return(null===(t=e.match(/Epiphany\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},R={name:"Huawei",match:function(e){return e.indexOf("HuaweiBrowser")>-1||e.indexOf("HUAWEI")>-1||e.indexOf("HONOR")>-1||e.indexOf("HBPC/")>-1},version:function(e){var t,i,n;return(null===(t=e.match(/Version\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(i=e.match(/HuaweiBrowser\/([\d.]+)/))||void 0===i?void 0:i[1])||(null===(n=e.match(/HBPC\/([\d.]+)/))||void 0===n?void 0:n[1])||""}},O={name:"OPPO",match:function(e){return e.indexOf("HeyTapBrowser")>-1||e.indexOf("OPPO")>-1},version:function(e){var t;return(null===(t=e.match(/HeyTapBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},I={name:"Vivo",match:function(e){return e.indexOf("VivoBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/VivoBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},x={name:"Xiaomi",match:function(e){return e.indexOf("MiuiBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/MiuiBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},D={name:"Meizu",match:function(e){return e.indexOf("MZBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/MZBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},L={name:"Samsung",match:function(e){return e.indexOf("SamsungBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/SamsungBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}};function M(e,t){var i,n=null==m||null===(i=m.navigator)||void 0===i?void 0:i.mimeTypes;for(var r in n)if(n[r][e]&&n[r][e]==t)return n[r];return null}var P={name:"360",match:function(e){var t=!1;if(null!=m&&m.chrome){var i=e.replace(/^.*Chrome\/([\d]+).*$/,"$1");M("type","application/360softmgrplugin")||M("type","application/mozilla-npqihooquicklogin")||i>36&&null!=m&&m.showModalDialog?t=!0:i>45&&!(t=M("type","application/vnd.chromium.remoting-viewer"))&&i>=69&&(t=M("type","application/hwepass2001.installepass2001")||M("type","application/asx"))}return e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1||t},version:function(e){var t;return(null===(t=e.match(/QihooBrowser(HD)?\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},U={name:"360SE",match:function(e){var t,i=!1;return P.match(e)&&(M("type","application/gameplugin")||null!=m&&null!==(t=m.navigator)&&void 0!==t&&null!==(t=t.userAgentData)&&void 0!==t&&t.brands.filter((function(e){return"Not.A/Brand"==e.brand})).length)&&(i=!0),e.indexOf("360SE")>-1||i},version:function(e){return{114:"15.0",108:"14.0",86:"13.0",78:"12.0",69:"11.0",63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[parseInt(s.version(e))]||""}},F={name:"360EE",match:function(e){var t=!1;if(M("type","application/cenroll.cenroll.version.1")||M("type","application/hwepass2001.installepass2001"))t=!0;else if(P.match(e)){var i;null!=m&&null!==(i=m.navigator)&&void 0!==i&&null!==(i=i.userAgentData)&&void 0!==i&&i.brands.filter((function(e){return"Not A(Brand"==e.brand})).length&&(t=!0)}return e.indexOf("360EE")>-1||t},version:function(e){return{119:"(X)22.0",108:"14.0",95:"(X)21.0",86:"13.0",78:"12.0",69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[parseInt(s.version(e))]||""}},V={name:"UC",match:function(e){return e.indexOf("UCBrowser")>-1||e.indexOf(" UBrowser")>-1||e.indexOf("UCWEB")>-1},version:function(e){var t;return(null===(t=e.match(/UC?Browser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},N={name:"QQBrowser",match:function(e){return e.indexOf("QQBrowser")>-1},version:function(e){var t;return(null===(t=e.match(/QQBrowser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},G={name:"QQ",match:function(e){return e.indexOf("QQ/")>-1},version:function(e){var t;return(null===(t=e.match(/QQ\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},W={name:"Baidu",match:function(e){return e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1||e.indexOf("baidubrowser")>-1||e.indexOf("baiduboxapp")>-1||e.indexOf("BaiduD")>-1},version:function(e){var t,i;return(null===(t=e.match(/BIDUBrowser[\s\/]([\d.]+)/))||void 0===t?void 0:t[1])||(null===(i=e.match(/baiduboxapp\/([\d.]+)/))||void 0===i?void 0:i[1])||""}},j={name:"Maxthon",match:function(e){return e.indexOf("Maxthon")>-1||(null==m?void 0:m.maxthon)},version:function(e){var t;return{109:"7.0",78:"6.0"}[parseInt(s.version(e))]||(null===(t=e.match(/Maxthon\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},Q={name:"Sogou",match:function(e){return e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1},version:function(e){var t,i;return{94:"12.0",80:"11.0"}[(null===(t=e.match(/Chrome\/([\d]+)/))||void 0===t?void 0:t[1])||""]||(null===(i=e.match(/SogouMobileBrowser\/([\d.]+)/))||void 0===i?void 0:i[1])||""}},z={name:"Liebao",match:function(e){return e.indexOf("LBBROWSER")>-1||e.indexOf("LieBaoFast")>-1||(null==m?void 0:m.liebao)},version:function(e){var t="";e.indexOf("LieBaoFast")>-1&&(t=e.replace(/LieBaoFast\/([\d.]+)/,"$1"));var i=parseInt(s.version(e));return t||{79:"8.0",57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[i]||""}},H={name:"2345Explorer",match:function(e){var t,i,n=(null==m?void 0:m.chrome)&&((null==m||null===(t=m.chrome)||void 0===t?void 0:t.adblock2345)||(null==m||null===(i=m.chrome)||void 0===i?void 0:i.common2345));return e.indexOf("2345Explorer")>-1||e.indexOf("Mb2345Browser")>-1||e.indexOf("2345chrome")>-1||n},version:function(e){var t,i;return{69:"10.0",55:"9.9"}[parseInt(s.version(e))]||(null===(t=e.match(/2345Explorer\/([\d.]+)/))||void 0===t?void 0:t[1])||(null===(i=e.match(/Mb2345Browser\/([\d.]+)/))||void 0===i?void 0:i[1])||""}},q={name:"115Browser",match:function(e){return e.indexOf("115Browser")>-1},version:function(e){var t;return(null===(t=e.match(/115Browser\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},X={name:"TheWorld",match:function(e){return e.indexOf("TheWorld")>-1},version:function(e){var t;return(null===(t=e.match(/TheWorld ([\d.]+)/))||void 0===t?void 0:t[1])||""}},$={name:"Quark",match:function(e){return e.indexOf("Quark")>-1},version:function(e){var t;return(null===(t=e.match(/Quark\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},Y={name:"Qiyu",match:function(e){return e.indexOf("Qiyu")>-1},version:function(e){var t;return(null===(t=e.match(/Qiyu\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},Z={name:"Wechat",match:function(e){return e.indexOf("MicroMessenger")>-1},version:function(e){var t;return(null===(t=e.match(/MicroMessenger\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},K={name:"WechatWork",match:function(e){return e.indexOf("wxwork/")>-1},version:function(e){var t;return(null===(t=e.match(/wxwork\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},J={name:"Taobao",match:function(e){return e.indexOf("AliApp(TB")>-1},version:function(e){var t;return(null===(t=e.match(/AliApp\(TB\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},ee={name:"Alipay",match:function(e){return e.indexOf("AliApp(AP")>-1},version:function(e){var t;return(null===(t=e.match(/AliApp\(AP\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},te={name:"Weibo",match:function(e){return e.indexOf("Weibo")>-1},version:function(e){var t;return(null===(t=e.match(/weibo__([\d.]+)/))||void 0===t?void 0:t[1])||""}},ie={name:"Douban",match:function(e){return e.indexOf("com.douban.frodo")>-1},version:function(e){var t;return(null===(t=e.match(/com.douban.frodo\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},ne={name:"Suning",match:function(e){return e.indexOf("SNEBUY-APP")>-1},version:function(e){var t;return(null===(t=e.match(/SNEBUY-APP([\d.]+)/))||void 0===t?void 0:t[1])||""}},re={name:"iQIYI",match:function(e){return e.indexOf("IqiyiApp")>-1},version:function(e){var t;return(null===(t=e.match(/IqiyiVersion\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},oe={name:"DingTalk",match:function(e){return e.indexOf("DingTalk")>-1},version:function(e){var t;return(null===(t=e.match(/DingTalk\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},ae={name:"Douyin",match:function(e){return e.indexOf("aweme")>-1},version:function(e){var t;return(null===(t=e.match(/app_version\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},se={name:"Googlebot",match:function(e){return e.indexOf("Googlebot")>-1},version:function(e){var t;return(null===(t=e.match(/Googlebot\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},de={name:"Baiduspider",match:function(e){return e.indexOf("Baiduspider")>-1},version:function(e){var t;return(null===(t=e.match(/Baiduspider(-render)?\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},le={name:"Sogouspider",match:function(e){return e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1},version:function(e){var t;return(null===(t=e.match(/Sogou (\S+) Spider\/([\d.]+)/i))||void 0===t?void 0:t[1])||""}},ce={name:"Bingbot",match:function(e){return e.indexOf("bingbot")>-1},version:function(e){var t;return(null===(t=e.match(/bingbot\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},he={name:"360Spider",match:function(e){return e.indexOf("360Spider")>-1||e.indexOf("HaosouSpider")>-1},version:function(e){return""}},ue={name:"Bytespider",match:function(e){return e.indexOf("Bytespider")>-1},version:function(e){return""}},Ae={name:"YisouSpider",match:function(e){return e.indexOf("YisouSpider")>-1},version:function(e){var t;return(null===(t=e.match(/YisouSpider\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},pe={name:"YodaoBot",match:function(e){return e.indexOf("YodaoBot")>-1},version:function(e){var t;return(null===(t=e.match(/YodaoBot\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},_e={name:"YandexBot",match:function(e){return e.indexOf("YandexBot")>-1},version:function(e){var t;return(null===(t=e.match(/YandexBot\/([\d.]+)/))||void 0===t?void 0:t[1])||""}};function fe(e,t){var i,n=e.userAgent;e.browser="",e.browserVersion="",[a,s,d,l,c,h,u,A,p,_,v,g,y,b,E,S,w,T,B,k,C,R,O,I,x,D,L,P,F,U,V,N,G,W,j,Q,z,H,q,X,$,Y,Z,K,J,ee,te,ie,ne,re,oe,ae,se,de,le,ce,he,ue,Ae,pe,_e].forEach((function(i){i.match(n)&&(e.browser=i.name,e.browserVersion=i.version(n,t))})),"Chrome"==e.browser&&n.match(/\S+Browser/)&&(e.browser=n.match(/\S+Browser/)[0],e.browserVersion=(null===(i=n.replace(/^.*Browser\/([\d.]+).*$/))||void 0===i?void 0:i[1])||"")}var me={name:"Mobile",match:function(e){return e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1}},ve={name:"Tablet",match:function(e){var t=(null==m?void 0:m.navigator)||{};return e.indexOf("Tablet")>-1||e.indexOf("Pad")>-1||e.indexOf("Nexus 7")>-1||"MacIntel"===t.platform&&t.maxTouchPoints>1}};function ge(e){e.device="Desktop",[me,ve].forEach((function(t){t.match(e.userAgent)&&(e.device=t.name)}))}var ye={name:"WebKit",match:function(e){return e.indexOf("AppleWebKit")>-1}},be={name:"Trident",match:function(e){return e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1}},Ee={name:"Gecko",match:function(e){return e.indexOf("Gecko/")>-1}},Se={name:"Presto",match:function(e){return e.indexOf("Presto")>-1}},we={name:"KHTML",match:function(e){return e.indexOf("KHTML/")>-1}};function Te(e){e.engine="",[ye,be,Ee,Se,we].forEach((function(t){t.match(e.userAgent)&&(e.engine=t.name)})),"Edge"==e.browser?e.engine=parseInt(e.browserVersion)>75?"Blink":"EdgeHTML":(s.match(e.userAgent)&&"WebKit"==e.engine&&parseInt(s.version(e.userAgent))>27||"Opera"==e.browser&&parseInt(e.browserVersion)>12||"Yandex"==e.browser)&&(e.engine="Blink")}var Be={name:"Windows",match:function(e){return e.indexOf("Windows")>-1},version:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(null===(t=e.match(/^Mozilla\/\d.0 \(Windows NT ([\d.]+)[;)].*$/))||void 0===t?void 0:t[1])||"",r={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return i?new Promise((function(e){var t;null!=m&&null!==(t=m.navigator)&&void 0!==t&&t.userAgentData?m.navigator.userAgentData.getHighEntropyValues(["platformVersion"]).then((function(t){var i="";"Windows"===navigator.userAgentData.platform&&(i=parseInt(t.platformVersion.split(".")[0])>=13?"11":"10"),e(i)})):e(r[n]||n)})):r[n]||n}},ke={name:"Linux",match:function(e){return e.indexOf("Linux")>-1||e.indexOf("X11")>-1},version:function(e){return""}},Ce={name:"macOS",match:function(e){return e.indexOf("Macintosh")>-1},version:function(e){var t;return(null===(t=e.match(/Mac OS X -?([\d_]+)/))||void 0===t?void 0:t[1].replace(/_/g,"."))||""}},Re={name:"Android",match:function(e){return e.indexOf("Android")>-1||e.indexOf("Adr")>-1},version:function(e){var t;return(null===(t=e.match(/Android ([\d.]+);/))||void 0===t?void 0:t[1])||""}},Oe={name:"HarmonyOS",match:function(e){return e.indexOf("HarmonyOS")>-1},version:function(e){var t,i=+(null===(t=e.match(/HMSCore (\d+.\d+)/))||void 0===t?void 0:t[1])||0;return i>=6.1?"4.0":i>=6?"3.0":i>=5?"2.0":i>=4?"1.0":""}},Ie={name:"Ubuntu",match:function(e){return e.indexOf("Ubuntu")>-1},version:function(e){return""}},xe={name:"FreeBSD",match:function(e){return e.indexOf("FreeBSD")>-1},version:function(e){return""}},De={name:"Debian",match:function(e){return e.indexOf("Debian")>-1},version:function(e){var t;return(null===(t=e.match(/Debian\/([\d.]+)/))||void 0===t?void 0:t[1])||""}},Le={name:"iOS",match:function(e){return e.indexOf("like Mac OS X")>-1},version:function(e){var t;return(null===(t=e.match(/OS ([\d_]+) like/))||void 0===t?void 0:t[1].replace(/_/g,"."))||""}},Me={name:"Windows Phone",match:function(e){return e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1},version:function(e){var t;return(null===(t=e.match(/Windows Phone( OS)? ([\d.]+);/))||void 0===t?void 0:t[2])||""}},Pe={name:"BlackBerry",match:function(e){return e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1},version:function(e){return""}},Ue={name:"MeeGo",match:function(e){return e.indexOf("MeeGo")>-1},version:function(e){return""}},Fe={name:"Symbian",match:function(e){return e.indexOf("Symbian")>-1},version:function(e){return""}},Ve={name:"Chrome OS",match:function(e){return e.indexOf("CrOS")>-1},version:function(e){var t,i;return(null===(t=e.match(/MSIE ([\d.]+)/))||void 0===t?void 0:t[1])||(null===(i=e.match(/rv:([\d.]+)/))||void 0===i?void 0:i[1])||""}},Ne={name:"WebOS",match:function(e){return e.indexOf("hpwOS")>-1},version:function(e){var t;return(null===(t=e.match(/hpwOS\/([\d.]+);/))||void 0===t?void 0:t[1])||""}};function Ge(e,t){var i,n=e.userAgent;e.system="",e.systemVersion="",[Be,ke,Ce,Re,Oe,Ie,xe,De,Le,Me,Pe,Ue,Fe,Ve,Ne].forEach((function(i){i.match(n)&&(e.system=i.name,e.systemVersion=i.version(n,t))})),e.platform="",n.match(/(Win64|x64|WOW64|x86_64)/i)?e.platform="Win64":n.match(/(Win32|x86|WOW32)/i)?e.platform="Win32":n.match(/aarch64|arm64/)?e.platform="ARM64":n.match(/arm32/)?e.platform="ARM32":null!=m&&null!==(i=m.navigator)&&void 0!==i&&i.platform&&(e.platform=m.navigator.platform),e.architecture="";var r,o=n+"|"+e.platform;o.match(/armv\d+/i)||o.match(/aarch64/)?e.architecture="arm":o.match(/loongarch64/)?e.architecture="loongarch":e.architecture="x86",e.bitness=n.match(/Win64|x64|WOW64|x86_64|aarch64|arm64|loongarch64/i)?64:32,t&&null!=m&&null!==(r=m.navigator)&&void 0!==r&&r.userAgentData&&(e.architecture=navigator.userAgentData.getHighEntropyValues(["architecture"]).then((function(e){return e.architecture})),e.bitness=navigator.userAgentData.getHighEntropyValues(["bitness"]).then((function(e){return+e.bitness})))}function We(e){if(e.gpu="",e.gpuModel="",null!=m&&m.document){var t,i,n=m.document.createElement("canvas").getContext("experimental-webgl"),r=n.getExtension("WEBGL_debug_renderer_info"),o=n.getParameter(r.UNMASKED_RENDERER_WEBGL);e.gpu=(null===(t=o.match(/ANGLE \((.+?),/))||void 0===t?void 0:t[1])||"",e.gpuModel=(null===(i=o.match(/, (.+?) (\(|vs_)/))||void 0===i?void 0:i[1])||""}}function je(e){e.language=function(e,t){var i=(null==m||null===(e=m.navigator)||void 0===e?void 0:e.browserLanguage)||(null==m||null===(t=m.navigator)||void 0===t?void 0:t.language);if("string"!=typeof i)return"Unknown language";var n=i.split("-");return n[1]&&(n[1]=n[1].toUpperCase()),n.join("_")}()}function Qe(e){var t,i,n;e.network=(i="unknown",(n=null==m||null===(t=m.navigator)||void 0===t?void 0:t.connection)&&("2"!=(i=n.type||n.effectiveType)&&"unknown"!=i||(i="wifi")),i)}function ze(e){e.isWebview=e.userAgent.indexOf("; wv)")>-1,e.isRobot=["Googlebot","Baiduspider","Sogouspider","Bingbot","360Spider","Bytespider","YandexBot"].includes(e.browser)}var He=function(e){var t,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={};return n.userAgent=e||(null==m||null===(t=m.navigator)||void 0===t?void 0:t.userAgent)||"",[fe,ge,Te,Ge,We,je,Qe,ze].forEach((function(e){return e(n,i)})),n};function qe(e){var t=He(e);for(var i in t)"object"==o(t[i])&&(t[i]="");return t}qe.getInfo=function(e){var t=He(e,!0),i=Object.keys(t),n=Object.values(t).map((function(e){return"object"==o(e)?e:Promise.resolve(e)}));return Promise.all(n).then((function(e){var t={};return e.forEach((function(e,n){t[i[n]]=e})),t}))};const Xe=0,$e=1,Ye="flv",Ze="m7s",Ke={videoBuffer:200,videoBufferDelay:1e3,scaleMode:1,debug:!1,loadingTimeout:10,heartTimeout:5,timeout:10,loadingTimeoutReplay:!0,heartTimeoutReplay:!0,loadingTimeoutReplayTimes:3,heartTimeoutReplayTimes:3,keepScreenOn:!1,isNotMute:!1,hasAudio:!0,volume:.5,hasVideo:!0,decoder:"decoder.js",staticPath:"",url:"",rotate:0,forceNoOffscreen:!0,protocol:$e,demuxType:Ye,useMSE:!1,autoWasm:!0,wasmDecodeErrorReplay:!0,openWebglAlignment:!1,wasmDecodeAudioSyncVideo:!1,useWebFullScreen:!0,loggerOptions:{level:"INFO"}},Je="init",et="initVideo",tt="render",it="playAudio",nt="initAudio",rt="audioCode",ot="videoCode",at="wasmError",st="Invalid NAL unit size",dt=1,lt=2,ct=8,ht=9,ut="init",At="decode",pt="audioDecode",_t="close",ft="updateConfig",mt={fullscreen:"fullscreen$2",webFullscreen:"webFullscreen",decoderWorkerInit:"decoderWorkerInit",play:"play",playing:"playing",pause:"pause",mute:"mute",load:"load",loading:"loading",videoInfo:"videoInfo",timeUpdate:"timeUpdate",audioInfo:"audioInfo",log:"log",error:"error",kBps:"kBps",timeout:"timeout",delayTimeout:"delayTimeout",loadingTimeout:"loadingTimeout",stats:"stats",performance:"performance",buffer:"buffer",videoFrame:"videoFrame",start:"start",metadata:"metadata",resize:"resize",streamEnd:"streamEnd",streamSuccess:"streamSuccess",streamMessage:"streamMessage",streamError:"streamError",volumechange:"volumechange",destroy:"destroy",mseSourceOpen:"mseSourceOpen",mseSourceClose:"mseSourceClose",mseSourceBufferError:"mseSourceBufferError",mseSourceBufferBusy:"mseSourceBufferBusy",mseSourceBufferFull:"mseSourceBufferFull",videoWaiting:"videoWaiting",videoTimeUpdate:"videoTimeUpdate",videoSyncAudio:"videoSyncAudio",playToRenderTimes:"playToRenderTimes"},vt={load:mt.load,timeUpdate:mt.timeUpdate,videoInfo:mt.videoInfo,audioInfo:mt.audioInfo,error:mt.error,kBps:mt.kBps,log:mt.log,start:mt.start,timeout:mt.timeout,loadingTimeout:mt.loadingTimeout,delayTimeout:mt.delayTimeout,fullscreen:"fullscreen",webFullscreen:mt.webFullscreen,play:mt.play,pause:mt.pause,mute:mt.mute,stats:mt.stats,volumechange:mt.volumechange,performance:mt.performance,playToRenderTimes:mt.playToRenderTimes},gt={playError:"playIsNotPauseOrUrlIsNull",fetchError:"NetworkError",websocketError:"websocketError",webcodecsH265NotSupport:"webcodecsH265NotSupport",webcodecsDecodeError:"webcodecsDecodeError",webcodecsWidthOrHeightChange:"webcodecsWidthOrHeightChange",mediaSourceH265NotSupport:"mediaSourceH265NotSupport",mediaSourceFull:mt.mseSourceBufferFull,mseSourceBufferError:mt.mseSourceBufferError,mediaSourceAppendBufferError:"mediaSourceAppendBufferError",mediaSourceBufferListLarge:"mediaSourceBufferListLarge",mediaSourceAppendBufferEndTimeout:"mediaSourceAppendBufferEndTimeout",wasmDecodeError:"wasmDecodeError",webglAlignmentError:"webglAlignmentError"},yt="notConnect",bt="open",Et="close",St="error",wt={download:"download",base64:"base64",blob:"blob"},Tt={7:"H264(AVC)",12:"H265(HEVC)"},Bt={10:"AAC",7:"ALAW",8:"MULAW"},kt={full:0,auto:1,fullAuto:2},Ct="webcodecs",Rt="webgl",Ot="offscreen",It=1e3,xt="The user aborted a request",Dt="AbortError",Lt="AbortError";function Mt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pt={exports:{}};!function(e){!function(){var t="undefined"!=typeof window&&void 0!==window.document?window.document:{},i=e.exports,n=function(){for(var e,i=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,r=i.length,o={};n<r;n++)if((e=i[n])&&e[1]in t){for(n=0;n<e.length;n++)o[i[0][n]]=e[n];return o}return!1}(),r={change:n.fullscreenchange,error:n.fullscreenerror},o={request:function(e,i){return new Promise(function(r,o){var a=function(){this.off("change",a),r()}.bind(this);this.on("change",a);var s=(e=e||t.documentElement)[n.requestFullscreen](i);s instanceof Promise&&s.then(a).catch(o)}.bind(this))},exit:function(){return new Promise(function(e,i){if(this.isFullscreen){var r=function(){this.off("change",r),e()}.bind(this);this.on("change",r);var o=t[n.exitFullscreen]();o instanceof Promise&&o.then(r).catch(i)}else e()}.bind(this))},toggle:function(e,t){return this.isFullscreen?this.exit():this.request(e,t)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(e,i){var n=r[e];n&&t.addEventListener(n,i,!1)},off:function(e,i){var n=r[e];n&&t.removeEventListener(n,i,!1)},raw:n};n?(Object.defineProperties(o,{isFullscreen:{get:function(){return Boolean(t[n.fullscreenElement])}},element:{enumerable:!0,get:function(){return t[n.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(t[n.fullscreenEnabled])}}}),i?e.exports=o:window.screenfull=o):i?e.exports={isEnabled:!1}:window.screenfull={isEnabled:!1}}()}(Pt);var Ut=Mt(Pt.exports);function Ft(){}function Vt(e=""){const t=e.split(","),i=atob(t[1]),n=t[0].replace("data:","").replace(";base64","");let r=i.length;const o=new Uint8Array(r);for(;r--;)o[r]=i.charCodeAt(r);return new File([o],"file",{type:n})}function Nt(){return(new Date).getTime()}function Gt(e,t,i){if(e)return"object"==typeof t&&Object.keys(t).forEach((i=>{Gt(e,i,t[i])})),e.style[t]=i,e}function Wt(){return performance&&"function"==typeof performance.now?performance.now():Date.now()}function jt(e){let t=0,i=Wt();return n=>{t+=n;const r=Wt(),o=r-i;o>=1e3&&(e(t/o*1e3),i=r,t=0)}}function Qt(){return/phone|pad|pod|iphone|ipod|ios|ipad|android|mobile|blackberry|iemobile|mqqbrowser|juc|wosbrowser|webos|symbian|windows phone|opera mini|huaweibrowser/i.test(window.navigator.userAgent.toLowerCase())}function zt(){return Ut.isFullscreen}function Ht(e){return null==e}function qt(e){return!Ht(e)}function Xt(e){const t=e||window.event;return t.target||t.srcElement}(()=>{try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){}})();class $t{constructor(){}on(e,t,i){const n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:i}),this}once(e,t,i){const n=this;function r(...o){n.off(e,r),t.apply(i,o)}return r._=t,this.on(e,r,i)}emit(e,...t){const i=((this.e||(this.e={}))[e]||[]).slice();for(let e=0;e<i.length;e+=1)i[e].fn.apply(i[e].ctx,t);return this}off(e,t){const i=this.e||(this.e={});if(!e)return Object.keys(i).forEach((e=>{delete i[e]})),void delete this.e;const n=i[e],r=[];if(n&&t)for(let e=0,i=n.length;e<i;e+=1)n[e].fn!==t&&n[e].fn._!==t&&r.push(n[e]);return r.length?i[e]=r:delete i[e],this}}let Yt=class extends $t{constructor(){super(),this.init=!1}resetInit(){this.init=!1,this.videoInfo={width:"",height:"",encType:"",encTypeCode:""}}destroy(){var e;this.resetInit(),this.player.$container&&this.$videoElement&&(null===(e=this.player.$container)||void 0===e||e.removeChild(this.$videoElement)),this.off()}updateVideoInfo(e){e.encTypeCode&&(this.videoInfo.encType=Tt[e.encTypeCode]),e.width&&(this.videoInfo.width=e.width),e.height&&(this.videoInfo.height=e.height),this.videoInfo.encType&&this.videoInfo.height&&this.videoInfo.width&&!this.init&&(this.player.emit(mt.videoInfo,this.videoInfo),this.init=!0)}play(){}pause(){}clearView(){}};const Zt="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0;function Kt(e,t,i){const n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){ii(n.response,t,i)},n.onerror=function(){},n.send()}function Jt(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return t.status>=200&&t.status<=299}function ei(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(t){const i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(i)}}const ti=Zt.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent);var ii="object"!=typeof window||window!==Zt?function(){}:"download"in HTMLAnchorElement.prototype&&!ti?function(e,t,i){const n=Zt.URL||Zt.webkitURL,r=document.createElementNS("http://www.w3.org/1999/xhtml","a");t=t||e.name||"download",r.download=t,r.rel="noopener","string"==typeof e?(r.href=e,r.origin!==location.origin?Jt(r.href)?Kt(e,t,i):ei(r,r.target="_blank"):ei(r)):(r.href=n.createObjectURL(e),setTimeout((function(){n.revokeObjectURL(r.href)}),4e4),setTimeout((function(){ei(r)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download","string"==typeof e)if(Jt(e))Kt(e,t,i);else{const t=document.createElement("a");t.href=e,t.target="_blank",setTimeout((function(){ei(t)}))}else navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,i),t)}:function(e,t,i,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),"string"==typeof e)return Kt(e,t,i);const r="application/octet-stream"===e.type,o=/constructor/i.test(Zt.HTMLElement)||Zt.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||r&&o||ti)&&"undefined"!=typeof FileReader){const t=new FileReader;t.onloadend=function(){let e=t.result;e=a?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=e:location=e,n=null},t.readAsDataURL(e)}else{const t=Zt.URL||Zt.webkitURL,i=t.createObjectURL(e);n?n.location=i:location.href=i,n=null,setTimeout((function(){t.revokeObjectURL(i)}),4e4)}};class ni extends Yt{constructor(e){super(),this.player=e;const t=document.createElement("canvas");t.style.position="absolute",t.style.top=0,t.style.left=0,this.$videoElement=t,e.$container.appendChild(this.$videoElement),this.context2D=null,this.contextGl=null,this.contextGlRender=null,this.contextGlDestroy=null,this.bitmaprenderer=null,this.renderType=null,this.videoInfo={width:"",height:"",encType:""},this._initCanvasRender(),this._contextmenuEvent=e=>{e.target===this.$videoElement&&e.preventDefault()},document.addEventListener("contextmenu",this._contextmenuEvent),this.player.debug.log("CanvasVideo","init")}destroy(){super.destroy(),this.contextGl&&(this.contextGl=null),this.context2D&&(this.context2D=null),this.contextGlRender&&(this.contextGlDestroy&&this.contextGlDestroy(),this.contextGlDestroy=null,this.contextGlRender=null),this.bitmaprenderer&&(this.bitmaprenderer=null),this._contextmenuEvent&&(document.removeEventListener("contextmenu",this._contextmenuEvent),this._contextmenuEvent=null),this.renderType=null,this.player.debug.log("CanvasVideoLoader","destroy")}_initContextGl(){this.contextGl=function(e){let t=null;const i=["webgl","experimental-webgl","moz-webgl","webkit-3d"];let n=0;for(;!t&&n<i.length;){const r=i[n];try{const i={preserveDrawingBuffer:!0};t=e.getContext(r,i)}catch(e){t=null}t&&"function"==typeof t.getParameter||(t=null),++n}return t}(this.$videoElement);const e=((e,t)=>{var i=["attribute vec4 vertexPos;","attribute vec4 texturePos;","varying vec2 textureCoord;","void main()","{","gl_Position = vertexPos;","textureCoord = texturePos.xy;","}"].join("\n"),n=["precision highp float;","varying highp vec2 textureCoord;","uniform sampler2D ySampler;","uniform sampler2D uSampler;","uniform sampler2D vSampler;","const mat4 YUV2RGB = mat4","(","1.1643828125, 0, 1.59602734375, -.87078515625,","1.1643828125, -.39176171875, -.81296875, .52959375,","1.1643828125, 2.017234375, 0, -1.081390625,","0, 0, 0, 1",");","void main(void) {","highp float y = texture2D(ySampler, textureCoord).r;","highp float u = texture2D(uSampler, textureCoord).r;","highp float v = texture2D(vSampler, textureCoord).r;","gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;","}"].join("\n");t&&e.pixelStorei(e.UNPACK_ALIGNMENT,1);var r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS);var o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,n),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS);var a=e.createProgram();e.attachShader(a,r),e.attachShader(a,o),e.linkProgram(a),e.getProgramParameter(a,e.LINK_STATUS),e.useProgram(a);var s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var d=e.getAttribLocation(a,"vertexPos");e.enableVertexAttribArray(d),e.vertexAttribPointer(d,2,e.FLOAT,!1,0,0);var l=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,l),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var c=e.getAttribLocation(a,"texturePos");function h(t,i){var n=e.createTexture();return e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),e.uniform1i(e.getUniformLocation(a,t),i),n}e.enableVertexAttribArray(c),e.vertexAttribPointer(c,2,e.FLOAT,!1,0,0);var u=h("ySampler",0),A=h("uSampler",1),p=h("vSampler",2);return{render:function(t,i,n,r,o){e.viewport(0,0,t,i),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,u),e.texImage2D(e.TEXTURE_2D,0,e.LUMINANCE,t,i,0,e.LUMINANCE,e.UNSIGNED_BYTE,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,A),e.texImage2D(e.TEXTURE_2D,0,e.LUMINANCE,t/2,i/2,0,e.LUMINANCE,e.UNSIGNED_BYTE,r),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,p),e.texImage2D(e.TEXTURE_2D,0,e.LUMINANCE,t/2,i/2,0,e.LUMINANCE,e.UNSIGNED_BYTE,o),e.drawArrays(e.TRIANGLE_STRIP,0,4)},destroy:function(){try{e.deleteProgram(a),e.deleteBuffer(s),e.deleteBuffer(l),e.deleteTexture(u),e.deleteTexture(A),e.deleteTexture(p)}catch(e){}}}})(this.contextGl,this.player._opt.openWebglAlignment);this.contextGlRender=e.render,this.contextGlDestroy=e.destroy}_initContext2D(){this.context2D=this.$videoElement.getContext("2d")}_initCanvasRender(){this._supportOffscreen()?(this.renderType=Ot,this._bindOffscreen()):(this.renderType=Rt,this._initContextGl())}_supportOffscreen(){return"function"==typeof this.$videoElement.transferControlToOffscreen&&this.player._opt.useOffscreen}_bindOffscreen(){this.bitmaprenderer=this.$videoElement.getContext("bitmaprenderer")}initCanvasViewSize(){this.$videoElement.width=this.videoInfo.width,this.$videoElement.height=this.videoInfo.height,this.resize()}render(e){switch(this.player.videoTimestamp=e.ts,this.renderType){case Ot:this.bitmaprenderer.transferFromImageBitmap(e.buffer);break;case Rt:this.contextGlRender(this.$videoElement.width,this.$videoElement.height,e.output[0],e.output[1],e.output[2]);break;case Ct:this.context2D.drawImage(e.videoFrame,0,0,this.$videoElement.width,this.$videoElement.height),(t=e.videoFrame).close?t.close():t.destroy&&t.destroy()}var t}screenshot(e,t,i,n){e=e||Nt(),n=n||wt.download;const r={png:"image/png",jpeg:"image/jpeg",webp:"image/webp"};let o=.92;!r[t]&&wt[t]&&(n=t,t="png",i=void 0),"string"==typeof i&&(n=i,i=void 0),void 0!==i&&(o=Number(i));const a=this.$videoElement.toDataURL(r[t]||r.png,o);if(n===wt.base64)return a;{const t=Vt(a);if(n===wt.blob)return t;n===wt.download&&ii(t,e)}}clearView(){switch(this.renderType){case Ot:(function(e,t){const i=document.createElement("canvas");return i.width=e,i.height=t,window.createImageBitmap(i,0,0,e,t)})(this.$videoElement.width,this.$videoElement.height).then((e=>{this.bitmaprenderer.transferFromImageBitmap(e)}));break;case Rt:this.contextGl.clear(this.contextGl.COLOR_BUFFER_BIT);break;case Ct:this.context2D.clearRect(0,0,this.$videoElement.width,this.$videoElement.height)}}resize(){this.player.debug.log("canvasVideo","resize");const e=this.player._opt,t=this.player.width,i=this.player.height;let n=this.$videoElement.width,r=this.$videoElement.height;const o=e.rotate,a=(t-n)/2,s=(i-r)/2;270!==o&&90!==o||(n=this.$videoElement.height,r=this.$videoElement.width);const d=t/n,l=i/r;let c=d>l?l:d;e.scaleMode!==kt.auto&&d!==l&&(c=d+","+l),e.scaleMode===kt.fullAuto&&(c=d>l?d:l);let h="scale("+c+")";o&&(h+=" rotate("+o+"deg)"),this.$videoElement.style.transform=h,this.$videoElement.style.left=a+"px",this.$videoElement.style.top=s+"px"}}class ri extends $t{constructor(e){super(),this.bufferList=[],this.player=e,this.scriptNode=null,this.hasInitScriptNode=!1,this.audioContextChannel=null,this.audioContext=new(window.AudioContext||window.webkitAudioContext),this.gainNode=this.audioContext.createGain();const t=this.audioContext.createBufferSource();t.buffer=this.audioContext.createBuffer(1,1,22050),t.connect(this.audioContext.destination),t.noteOn?t.noteOn(0):t.start(0),this.audioBufferSourceNode=t,this.mediaStreamAudioDestinationNode=this.audioContext.createMediaStreamDestination(),this.audioEnabled(!0),this.gainNode.gain.value=0,this.playing=!1,this.audioSyncVideoOption={diff:null},this.audioInfo={encType:"",channels:"",sampleRate:""},this.init=!1,this.hasAudio=!1,this.on(mt.videoSyncAudio,(e=>{this.audioSyncVideoOption=e})),this.player.debug.log("AudioContext","init")}resetInit(){this.init=!1,this.audioInfo={encType:"",channels:"",sampleRate:""}}destroy(){this.closeAudio(),this.resetInit(),this.audioContext.close(),this.audioContext=null,this.gainNode=null,this.hasAudio=!1,this.playing=!1,this.scriptNode&&(this.scriptNode.onaudioprocess=Ft,this.scriptNode=null),this.audioBufferSourceNode=null,this.mediaStreamAudioDestinationNode=null,this.hasInitScriptNode=!1,this.audioSyncVideoOption={diff:null},this.off(),this.player.debug.log("AudioContext","destroy")}updateAudioInfo(e){e.encTypeCode&&(this.audioInfo.encType=Bt[e.encTypeCode]),e.channels&&(this.audioInfo.channels=e.channels),e.sampleRate&&(this.audioInfo.sampleRate=e.sampleRate),this.audioInfo.sampleRate&&this.audioInfo.channels&&this.audioInfo.encType&&!this.init&&(this.player.emit(mt.audioInfo,this.audioInfo),this.init=!0)}get isPlaying(){return this.playing}get isMute(){return 0===this.gainNode.gain.value}get volume(){return this.gainNode.gain.value}get bufferSize(){return this.bufferList.length}initScriptNode(){if(this.playing=!0,this.hasInitScriptNode)return;const e=this.audioInfo.channels,t=this.audioContext.createScriptProcessor(1024,0,e);t.onaudioprocess=t=>{const i=t.outputBuffer;if(this.bufferList.length&&this.playing){if(!this.player._opt.useWCS&&!this.player._opt.useMSE&&this.player._opt.wasmDecodeAudioSyncVideo){if(this.audioSyncVideoOption.diff>It)return void this.player.debug.warn("AudioContext",`audioSyncVideoOption more than diff :${this.audioSyncVideoOption.diff}, waiting`);if(this.audioSyncVideoOption.diff<-1e3){this.player.debug.warn("AudioContext",`audioSyncVideoOption less than diff :${this.audioSyncVideoOption.diff}, dropping`);let e=this.bufferList.shift();for(;e.ts-this.player.videoTimestamp<-1e3&&this.bufferList.length>0;)e=this.bufferList.shift();if(0===this.bufferList.length)return}}if(0===this.bufferList.length)return;const t=this.bufferList.shift();t&&t.ts&&(this.player.audioTimestamp=t.ts);for(let n=0;n<e;n++){const e=t.buffer[n],r=i.getChannelData(n);for(let t=0;t<1024;t++)r[t]=e[t]||0}}},t.connect(this.gainNode),this.scriptNode=t,this.gainNode.connect(this.audioContext.destination),this.gainNode.connect(this.mediaStreamAudioDestinationNode),this.hasInitScriptNode=!0}mute(e){e?(this.isMute||this.player.emit(mt.mute,e),this.setVolume(0),this.clear()):(this.isMute&&this.player.emit(mt.mute,e),this.setVolume(.5))}setVolume(e){e=parseFloat(e).toFixed(2),isNaN(e)||(this.audioEnabled(!0),e=function(e,t,i){return Math.max(Math.min(e,Math.max(t,i)),Math.min(t,i))}(e,0,1),this.gainNode.gain.value=e,this.gainNode.gain.setValueAtTime(e,this.audioContext.currentTime),this.player.emit(mt.volumechange,this.player.volume))}closeAudio(){this.hasInitScriptNode&&(this.scriptNode&&this.scriptNode.disconnect(this.gainNode),this.gainNode&&this.gainNode.disconnect(this.audioContext.destination),this.gainNode&&this.gainNode.disconnect(this.mediaStreamAudioDestinationNode)),this.clear()}audioEnabled(e){e?"suspended"===this.audioContext.state&&this.audioContext.resume():"running"===this.audioContext.state&&this.audioContext.suspend()}isStateRunning(){return"running"===this.audioContext.state}isStateSuspended(){return"suspended"===this.audioContext.state}clear(){this.bufferList=[]}play(e,t){this.isMute||(this.hasAudio=!0,this.bufferList.push({buffer:e,ts:t}),this.bufferList.length>20&&(this.player.debug.warn("AudioContext",`bufferList is large: ${this.bufferList.length}`),this.bufferList.length>50&&this.bufferList.shift()))}pause(){this.audioSyncVideoOption={diff:null},this.playing=!1,this.clear()}resume(){this.playing=!0}}class oi{constructor(e){return new(oi.getLoaderFactory())(e)}static getLoaderFactory(){return ri}}class ai extends $t{constructor(e){super(),this.player=e,this.playing=!1,this.abortController=new AbortController,this.streamRate=jt((e=>{})),e.debug.log("FetchStream","init")}destroy(){this.abort(),this.off(),this.streamRate=null,this.player.debug.log("FetchStream","destroy")}fetchStream(e,t={}){const{demux:i}=this.player;this.player._times.streamStart=Nt();const n=Object.assign({signal:this.abortController.signal},{headers:t.headers||{}});fetch(e,n).then((e=>{const t=e.body.getReader();this.emit(mt.streamSuccess);const n=()=>{t.read().then((({done:e,value:t})=>{e?i.close():(this.streamRate&&this.streamRate(t.byteLength),i.dispatch(t),n())})).catch((e=>{i.close();const n=e.toString();-1===n.indexOf(xt)&&-1===n.indexOf(Dt)&&e.name!==Lt&&(this.abort(),t.cancel(),this.emit(gt.fetchError,e),this.player.emit(mt.error,gt.fetchError))}))};n()})).catch((e=>{"AbortError"!==e.name&&(i.close(),this.abort(),this.emit(gt.fetchError,e),this.player.emit(mt.error,gt.fetchError))}))}abort(){this.abortController&&(this.abortController.abort(),this.abortController=null)}}class si extends $t{constructor(e){super(),this.player=e,this.socket=null,this.socketStatus=yt,this.wsUrl=null,this.streamRate=jt((e=>{})),e.debug.log("WebsocketLoader","init")}destroy(){this.socket&&(this.socket.close(1e3,"Client disconnecting"),this.socket=null),this.socketStatus=yt,this.streamRate=null,this.wsUrl=null,this.off(),this.player.debug.log("websocketLoader","destroy")}_createWebSocket(){const e=this.player,{debug:t,events:{proxy:i},demux:n}=e;this.socket=new WebSocket(this.wsUrl),this.socket.binaryType="arraybuffer",i(this.socket,"open",(()=>{this.emit(mt.streamSuccess),t.log("websocketLoader","socket open"),this.socketStatus=bt})),i(this.socket,"message",(e=>{this.streamRate&&this.streamRate(e.data.byteLength),this._handleMessage(e.data)})),i(this.socket,"close",(()=>{t.log("websocketLoader","socket close"),this.emit(mt.streamEnd),this.socketStatus=Et})),i(this.socket,"error",(e=>{t.log("websocketLoader","socket error"),this.emit(gt.websocketError,e),this.player.emit(mt.error,gt.websocketError),this.socketStatus=St,n.close(),t.log("websocketLoader","socket error:",e)}))}_handleMessage(e){const{demux:t}=this.player;t?t.dispatch(e):this.player.debug.warn("websocketLoader","websocket handle message demux is null")}fetchStream(e,t){this.player._times.streamStart=Nt(),this.wsUrl=e,this._createWebSocket()}}class di{constructor(e){return new(di.getLoaderFactory(e._opt.protocol))(e)}static getLoaderFactory(e){return e===$e?ai:e===Xe?si:void 0}}class li{constructor(e){this.player=e,this.decoderWorker=new Worker((""===e._opt.staticPath?"":function(e,t){void 0===t&&(t="");var i=/^(https?:\/\/|^\/\/)/;return i.test(e)?e:(e=e.replace(/\/+/g,"/"),t=i.test(t||"")?t:window.location.href,new URL(e,t).href)}(e._opt.staticPath))+e._opt.decoder),this._initDecoderWorker(),e.debug.log("decoderWorker","init")}destroy(){this.decoderWorker.postMessage({cmd:_t}),this.decoderWorker.terminate(),this.decoderWorker=null,this.player.debug.log("decoderWorker","destroy")}_initDecoderWorker(){const{debug:e,events:{proxy:t}}=this.player;this.decoderWorker.onmessage=t=>{var i,n,r,o,a,s;const d=t.data;switch(d.cmd){case Je:e.log("decoderWorker","onmessage:",Je),this.player.loaded||this.player.emit(mt.load),this.player.emit(mt.decoderWorkerInit),this._initWork();break;case ot:e.log("decoderWorker","onmessage:",ot,d.code),this.player._times.decodeStart||(this.player._times.decodeStart=Nt()),this.player.video.updateVideoInfo({encTypeCode:d.code});break;case rt:e.log("decoderWorker","onmessage:",rt,d.code),null===(i=this.player)||void 0===i||null===(i=i.audio)||void 0===i||null===(n=i.updateAudioInfo)||void 0===n||n.call(i,{encTypeCode:d.code});break;case et:if(e.log("decoderWorker","onmessage:",et,`width:${d.w},height:${d.h}`),null===(r=this.player)||void 0===r||null===(r=r.video)||void 0===r||null===(o=r.updateVideoInfo)||void 0===o||o.call(r,{width:d.w,height:d.h}),!this.player._opt.openWebglAlignment&&d.w/2%4!=0)return void this.player.emit(gt.webglAlignmentError);this.player.video.initCanvasViewSize();break;case nt:e.log("decoderWorker","onmessage:",nt,`channels:${d.channels},sampleRate:${d.sampleRate}`),this.player.audio&&(this.player.audio.updateAudioInfo(d),this.player.audio.initScriptNode(d));break;case tt:this.player.handleRender(),this.player.video.render(d),this.player.emit(mt.timeUpdate,d.ts),this.player.updateStats({fps:!0,ts:d.ts,buf:d.delay}),this.player._times.videoStart||(this.player._times.videoStart=Nt(),this.player.handlePlayToRenderTimes());break;case it:this.player.playing&&this.player.audio&&this.player.audio.play(d.buffer,d.ts);break;case at:d.message&&-1!==d.message.indexOf(st)&&this.player.emitError(gt.wasmDecodeError);break;default:null===(a=(s=this.player)[d.cmd])||void 0===a||a.call(s,d)}}}_initWork(){var e;const t={debug:this.player._opt.debug,useOffscreen:this.player._opt.useOffscreen,useWCS:this.player._opt.useWCS,videoBuffer:this.player._opt.videoBuffer,videoBufferDelay:this.player._opt.videoBufferDelay,openWebglAlignment:this.player._opt.openWebglAlignment};this.decoderWorker.postMessage({cmd:ut,opt:JSON.stringify(t),sampleRate:(null===(e=this.player)||void 0===e||null===(e=e.audio)||void 0===e||null===(e=e.audioContext)||void 0===e?void 0:e.sampleRate)||0})}decodeVideo(e,t,i){const n={type:lt,ts:Math.max(t,0),isIFrame:i};this.decoderWorker.postMessage({cmd:At,buffer:e,options:n},[e.buffer])}decodeAudio(e,t){this.player._opt.useWCS||this.player._opt.useMSE?this._decodeAudioNoDelay(e,t):this._decodeAudio(e,t)}_decodeAudio(e,t){const i={type:dt,ts:Math.max(t,0)};this.decoderWorker.postMessage({cmd:At,buffer:e,options:i},[e.buffer])}_decodeAudioNoDelay(e,t){this.decoderWorker.postMessage({cmd:pt,buffer:e,ts:Math.max(t,0)},[e.buffer])}updateWorkConfig(e){this.decoderWorker.postMessage({cmd:ft,key:e.key,value:e.value})}}class ci extends $t{constructor(e){super(),this.player=e,this.stopId=null,this.firstTimestamp=null,this.startTimestamp=null,this.delay=-1,this.bufferList=[],this.dropping=!1,this.initInterval()}destroy(){this.stopId&&(clearInterval(this.stopId),this.stopId=null),this.firstTimestamp=null,this.startTimestamp=null,this.delay=-1,this.bufferList=[],this.dropping=!1,this.off(),this.player.debug.log("CommonDemux","destroy")}getDelay(e){if(!e)return-1;if(this.firstTimestamp){if(e){const t=Date.now()-this.startTimestamp,i=e-this.firstTimestamp;this.delay=t>=i?t-i:i-t}}else this.firstTimestamp=e,this.startTimestamp=Date.now(),this.delay=-1;return this.delay}resetDelay(){this.firstTimestamp=null,this.startTimestamp=null,this.delay=-1,this.dropping=!1}initInterval(){this.player.debug.log("common dumex","init Interval");const e=()=>{let e;const t=this.player._opt.videoBuffer,i=this.player._opt.videoBufferDelay;if(this.bufferList.length)if(this.dropping){for(e=this.bufferList.shift(),e.type===dt&&0===e.payload[1]&&this._doDecoderDecode(e);!e.isIFrame&&this.bufferList.length;)e=this.bufferList.shift(),e.type===dt&&0===e.payload[1]&&this._doDecoderDecode(e);e.isIFrame&&this.getDelay(e.ts)<=Math.min(t,200)&&(this.dropping=!1,this._doDecoderDecode(e))}else e=this.bufferList[0],-1===this.getDelay(e.ts)?(this.bufferList.shift(),this._doDecoderDecode(e)):this.delay>t+i?(this.resetDelay(),this.dropping=!0):(e=this.bufferList[0],this.getDelay(e.ts)>t&&(this.bufferList.shift(),this._doDecoderDecode(e)))};e(),this.stopId=setInterval(e,10)}_doDecode(e,t,i,n,r){const o=this.player,a={ts:i,cts:r,type:t,isIFrame:!1};var s,d;if(o._opt.useWCS&&!o._opt.useOffscreen)t===lt&&(a.isIFrame=n),this.pushBuffer(e,a);else if(t===lt)null==o||null===(s=o.decoderWorker)||void 0===s||null===(d=s.decodeVideo)||void 0===d||d.call(s,e,i,n);else if(t===dt){var l,c;if(o._opt.hasAudio)null==o||null===(l=o.decoderWorker)||void 0===l||null===(c=l.decodeAudio)||void 0===c||c.call(l,e,i)}}_doDecoderDecode(e){const t=this.player;var i,n;e.type===dt?t._opt.hasAudio&&(null===(i=t.decoderWorker)||void 0===i||null===(n=i.decodeAudio)||void 0===n||n.call(i,e.payload,e.ts)):e.type}pushBuffer(e,t){t.type===dt?this.bufferList.push({ts:t.ts,payload:e,type:dt}):t.type===lt&&this.bufferList.push({ts:t.ts,cts:t.cts,payload:e,type:lt,isIFrame:t.isIFrame})}close(){}}class hi extends ci{constructor(e){super(e),this.input=this._inputFlv(),this.flvDemux=this.dispatchFlvData(this.input),e.debug.log("FlvDemux","init")}destroy(){super.destroy(),this.input=null,this.flvDemux=null,this.player.debug.log("FlvDemux","destroy")}dispatch(e){this.flvDemux(e)}*_inputFlv(){yield 9;const e=new ArrayBuffer(4),t=new Uint8Array(e),i=new Uint32Array(e),n=this.player;for(;;){t[3]=0;const e=yield 15,r=e[4];t[0]=e[7],t[1]=e[6],t[2]=e[5];const o=i[0];t[0]=e[10],t[1]=e[9],t[2]=e[8];let a=i[0];16777215===a&&(t[3]=e[11],a=i[0]);const s=yield o;switch(r){case ct:n._opt.hasAudio&&(n.updateStats({abps:s.byteLength}),s.byteLength>0&&this._doDecode(s,dt,a));break;case ht:if(n._times.demuxStart||(n._times.demuxStart=Nt()),n._opt.hasVideo){n.updateStats({vbps:s.byteLength});const e=s[0]>>4==1;if(s.byteLength>0){i[0]=s[4],i[1]=s[3],i[2]=s[2],i[3]=0;const t=i[0];this._doDecode(s,lt,a,e,t)}}}}}dispatchFlvData(e){let t=e.next(),i=null;return n=>{let r=new Uint8Array(n);if(i){const e=new Uint8Array(i.length+r.length);e.set(i),e.set(r,i.length),r=e,i=null}for(;r.length>=t.value;){const i=r.slice(t.value);t=e.next(r.slice(0,t.value)),r=i}r.length>0&&(i=r)}}close(){var e,t;null===(e=this.input)||void 0===e||null===(t=e.return)||void 0===t||t.call(e,null)}}class ui extends ci{constructor(e){super(e),e.debug.log("M7sDemux","init")}destroy(){super.destroy(),this.player.debug.log("M7sDemux","destroy"),this.player=null}dispatch(e){const t=this.player,i=new DataView(e),n=i.getUint8(0),r=i.getUint32(1,!1);switch(n){case dt:if(t._opt.hasAudio){const i=new Uint8Array(e,5);t.updateStats({abps:i.byteLength}),i.byteLength>0&&this._doDecode(i,n,r)}break;case lt:if(t._opt.hasVideo)if(t._times.demuxStart||(t._times.demuxStart=Nt()),i.byteLength>5){const o=new Uint8Array(e,5),a=i.getUint8(5)>>4==1;t.updateStats({vbps:o.byteLength}),o.byteLength>0&&this._doDecode(o,n,r,a)}else this.player.debug.warn("M7sDemux","dispatch","dv byteLength is",i.byteLength)}}}class Ai{constructor(e){return new(Ai.getLoaderFactory(e._opt.demuxType))(e)}static getLoaderFactory(e){return e===Ze?ui:e===Ye?hi:void 0}}const pi=()=>"undefined"!=typeof navigator&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,_i=()=>"wakeLock"in navigator;class fi{constructor(e){if(this.player=e,this.enabled=!1,_i()){this._wakeLock=null;const e=()=>{null!==this._wakeLock&&"visible"===document.visibilityState&&this.enable()};document.addEventListener("visibilitychange",e),document.addEventListener("fullscreenchange",e)}else pi()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm","data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK"),this._addSourceToVideo(this.noSleepVideo,"mp4","data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"),this.noSleepVideo.addEventListener("loadedmetadata",(()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",(()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())}))})))}_addSourceToVideo(e,t,i){const n=document.createElement("source");n.src=i,n.type=`video/${t}`,e.appendChild(n)}get isEnabled(){return this.enabled}enable(){const e=this.player.debug;if(_i())return navigator.wakeLock.request("screen").then((t=>{this._wakeLock=t,this.enabled=!0,e.log("wakeLock","Wake Lock active."),this._wakeLock.addEventListener("release",(()=>{e.log("wakeLock","Wake Lock released.")}))})).catch((t=>{throw this.enabled=!1,e.error("wakeLock",`${t.name}, ${t.message}`),t}));if(pi())return this.disable(),this.noSleepTimer=window.setInterval((()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))}),15e3),this.enabled=!0,Promise.resolve();return this.noSleepVideo.play().then((e=>(this.enabled=!0,e))).catch((e=>{throw this.enabled=!1,e}))}disable(){const e=this.player.debug;_i()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):pi()?this.noSleepTimer&&(e.warn("wakeLock","NoSleep now disabled for older iOS devices."),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}
|
|
16
|
+
*/(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var t={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function i(e,i){void 0===i&&(i=["h264"]);var r=(i||["h264"]).reduce((function(e,i){return i=i.toLowerCase(),e+(t[i]||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="+r}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o,a={exports:{}},s=a.exports;var l=(o||(o=1,function(e,t){var i;i="undefined"!=typeof self?self:s,e.exports=function(e){var t=e||{},i=void 0!==e.navigator?e.navigator:{},r=function(e,t){var r=i.mimeTypes;for(var n in r)if(r[n][e]==t)return!0;return!1},n=null;return void 0!==i.userAgentData&&i.userAgentData.getHighEntropyValues(["platformVersion"]).then((function(e){if("Windows"===i.userAgentData.platform){const t=parseInt(e.platformVersion.split(".")[0]);n=t>=13?11:10}})),function(e){var o=e||i.userAgent||"",a={},s={Trident:o.indexOf("Trident")>-1||o.indexOf("NET CLR")>-1,Presto:o.indexOf("Presto")>-1,WebKit:o.indexOf("AppleWebKit")>-1,Gecko:o.indexOf("Gecko/")>-1,KHTML:o.indexOf("KHTML/")>-1,Safari:o.indexOf("Safari")>-1,Chrome:o.indexOf("Chrome")>-1||o.indexOf("CriOS")>-1,IE:o.indexOf("MSIE")>-1||o.indexOf("Trident")>-1,Edge:o.indexOf("Edge")>-1||o.indexOf("Edg/")>-1||o.indexOf("EdgA")>-1||o.indexOf("EdgiOS")>-1,Firefox:o.indexOf("Firefox")>-1||o.indexOf("FxiOS")>-1,"Firefox Focus":o.indexOf("Focus")>-1,Chromium:o.indexOf("Chromium")>-1,Opera:o.indexOf("Opera")>-1||o.indexOf("OPR")>-1,Vivaldi:o.indexOf("Vivaldi")>-1,Yandex:o.indexOf("YaBrowser")>-1,Brave:!!i.brave,Arora:o.indexOf("Arora")>-1,Lunascape:o.indexOf("Lunascape")>-1,QupZilla:o.indexOf("QupZilla")>-1,"Coc Coc":o.indexOf("coc_coc_browser")>-1,Kindle:o.indexOf("Kindle")>-1||o.indexOf("Silk/")>-1,Iceweasel:o.indexOf("Iceweasel")>-1,Konqueror:o.indexOf("Konqueror")>-1,Iceape:o.indexOf("Iceape")>-1,SeaMonkey:o.indexOf("SeaMonkey")>-1,Epiphany:o.indexOf("Epiphany")>-1,360:o.indexOf("QihooBrowser")>-1||o.indexOf("QHBrowser")>-1,"360EE":o.indexOf("360EE")>-1,"360SE":o.indexOf("360SE")>-1,UC:o.indexOf("UCBrowser")>-1||o.indexOf(" UBrowser")>-1||o.indexOf("UCWEB")>-1,QQBrowser:o.indexOf("QQBrowser")>-1,QQ:o.indexOf("QQ/")>-1,Baidu:o.indexOf("Baidu")>-1||o.indexOf("BIDUBrowser")>-1||o.indexOf("baidubrowser")>-1||o.indexOf("baiduboxapp")>-1||o.indexOf("BaiduHD")>-1,Maxthon:o.indexOf("Maxthon")>-1,Sogou:o.indexOf("MetaSr")>-1||o.indexOf("Sogou")>-1,Liebao:o.indexOf("LBBROWSER")>-1||o.indexOf("LieBaoFast")>-1,"2345Explorer":o.indexOf("2345Explorer")>-1||o.indexOf("Mb2345Browser")>-1||o.indexOf("2345chrome")>-1,"115Browser":o.indexOf("115Browser")>-1,TheWorld:o.indexOf("TheWorld")>-1,Quark:o.indexOf("Quark")>-1,Qiyu:o.indexOf("Qiyu")>-1,XiaoMi:o.indexOf("MiuiBrowser")>-1,Huawei:o.indexOf("HuaweiBrowser")>-1||o.indexOf("HUAWEI/")>-1||o.indexOf("HONOR")>-1||o.indexOf("HBPC/")>-1,Vivo:o.indexOf("VivoBrowser")>-1,OPPO:o.indexOf("HeyTapBrowser")>-1,Wechat:o.indexOf("MicroMessenger")>-1,WechatWork:o.indexOf("wxwork/")>-1,Taobao:o.indexOf("AliApp(TB")>-1,Alipay:o.indexOf("AliApp(AP")>-1,Weibo:o.indexOf("Weibo")>-1,Douban:o.indexOf("com.douban.frodo")>-1,Suning:o.indexOf("SNEBUY-APP")>-1,iQiYi:o.indexOf("IqiyiApp")>-1,DingTalk:o.indexOf("DingTalk")>-1,Douyin:o.indexOf("aweme")>-1,Googlebot:o.indexOf("Googlebot")>-1,Baiduspider:o.indexOf("Baiduspider")>-1,Sogouspider:o.match(/Sogou (\S+) Spider/i),Bingbot:o.indexOf("bingbot")>-1,"360Spider":o.indexOf("360Spider")>-1||o.indexOf("HaosouSpider")>-1,Bytespider:o.indexOf("Bytespider")>-1,YisouSpider:o.indexOf("YisouSpider")>-1,YodaoBot:o.indexOf("YodaoBot")>-1,YandexBot:o.indexOf("YandexBot")>-1,Windows:o.indexOf("Windows")>-1,Linux:o.indexOf("Linux")>-1||o.indexOf("X11")>-1,"Mac OS":o.indexOf("Macintosh")>-1,Android:o.indexOf("Android")>-1||o.indexOf("Adr")>-1,HarmonyOS:o.indexOf("HarmonyOS")>-1,Ubuntu:o.indexOf("Ubuntu")>-1,FreeBSD:o.indexOf("FreeBSD")>-1,Debian:o.indexOf("Debian")>-1,"Windows Phone":o.indexOf("IEMobile")>-1||o.indexOf("Windows Phone")>-1,BlackBerry:o.indexOf("BlackBerry")>-1||o.indexOf("RIM")>-1,MeeGo:o.indexOf("MeeGo")>-1,Symbian:o.indexOf("Symbian")>-1,iOS:o.indexOf("like Mac OS X")>-1,"Chrome OS":o.indexOf("CrOS")>-1,WebOS:o.indexOf("hpwOS")>-1,Mobile:o.indexOf("Mobi")>-1||o.indexOf("iPh")>-1||o.indexOf("480")>-1,Tablet:o.indexOf("Tablet")>-1||o.indexOf("Pad")>-1||o.indexOf("Nexus 7")>-1||"MacIntel"===i.platform&&i.maxTouchPoints>1,isWebview:o.indexOf("; wv)")>-1},l=!1;if(t.chrome){var d=o.replace(/^.*Chrome\/([\d]+).*$/,"$1");t.chrome.adblock2345||t.chrome.common2345?s["2345Explorer"]=!0:r("type","application/360softmgrplugin")||r("type","application/mozilla-npqihooquicklogin")||d>36&&t.showModalDialog?l=!0:d>45&&!(l=r("type","application/vnd.chromium.remoting-viewer"))&&d>=69&&(l=r("type","application/hwepass2001.installepass2001")||r("type","application/asx"))}s.Mobile?s.Mobile=!(o.indexOf("iPad")>-1):l&&(r("type","application/gameplugin")||i&&void 0!==i.connection&&void 0===i.connection.saveData?s["360SE"]=!0:s["360EE"]=!0),s.Baidu&&s.Opera?s.Baidu=!1:s.iOS&&(s.Safari=!0);var c={engine:["WebKit","Trident","Gecko","Presto","KHTML"],browser:["Safari","Chrome","Edge","IE","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Brave","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","XiaoMi","Vivo","OPPO","360","360SE","360EE","UC","QQBrowser","QQ","Huawei","Baidu","Maxthon","Sogou","Liebao","2345Explorer","115Browser","TheWorld","Quark","Qiyu","Wechat","WechatWork","Taobao","Alipay","Weibo","Douban","Suning","iQiYi","DingTalk","Douyin","Googlebot","Baiduspider","Sogouspider","Bingbot","360Spider","Bytespider","YisouSpider","YodaoBot","YandexBot"],system:["Windows","Linux","Mac OS","Android","HarmonyOS","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet"]};for(var u in a.device="PC",a.language=function(){var e=i.browserLanguage||i.language;if("string"!=typeof e)return"Unknown language";var t=e.split("-");return t[1]&&(t[1]=t[1].toUpperCase()),t.join("_")}(),c)for(var h=0;h<c[u].length;h++){var A=c[u][h];s[A]&&(a[u]=A)}var p={Windows:function(){var e=o.replace(/^Mozilla\/\d.0 \(Windows NT ([\d.]+)[;)].*$/,"$1");return{10:"10",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 o.replace(/^.*Android ([\d.]+);.*$/,"$1")},HarmonyOS:function(){return{10:"2",12:"3"}[o.replace(/^Mozilla.*Android ([\d.]+)[;)].*$/,"$1")]||""},iOS:function(){return o.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return o.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return o.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return o.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return o.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};a.systemVersion="",p[a.system]&&(a.systemVersion=p[a.system](),a.systemVersion==o&&(a.systemVersion="")),"Windows"==a.system&&n&&(a.systemVersion=n),a.platform=i.platform,a.isWebview=s.isWebview,a.isBot=["Googlebot","Baiduspider","Sogouspider","Bingbot","360Spider","Bytespider","YandexBot"].some((function(e){return s[e]}));var f={Safari:function(){return o.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return o.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return o.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return o.replace(/^.*Edge\/([\d.]+).*$/,"$1").replace(/^.*Edg\/([\d.]+).*$/,"$1").replace(/^.*EdgA\/([\d.]+).*$/,"$1").replace(/^.*EdgiOS\/([\d.]+).*$/,"$1")},Firefox:function(){return o.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return o.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return o.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return o.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return o.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return o.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Brave:function(){return o.replace(/^.*Chrome\/([\d.]+).*$/,"$1")},Arora:function(){return o.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return o.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return o.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return o.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return o.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return o.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return o.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return o.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return o.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return o.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return o.replace(/^.*QihooBrowser(HD)?\/([\d.]+).*$/,"$2")},"360SE":function(){return{108:"14.0",86:"13.0",78:"12.0",69:"11.0",63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[o.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{95:"21",86:"13.0",78:"12.0",69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[o.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return o.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return o.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return o.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return o.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1").replace(/^.*baiduboxapp\/([\d.]+).*$/,"$1")},UC:function(){return o.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return o.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},Liebao:function(){var e="";o.indexOf("LieBaoFast")>-1&&(e=o.replace(/^.*LieBaoFast\/([\d.]+).*$/,"$1"));var t={57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"},i=o.replace(/^.*Chrome\/([\d]+).*$/,"$1");return e||t[i]||""},"2345Explorer":function(){return{69:"10.0",55:"9.9"}[navigator.userAgent.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||o.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1").replace(/^.*Mb2345Browser\/([\d.]+).*$/,"$1")},"115Browser":function(){return o.replace(/^.*115Browser\/([\d.]+).*$/,"$1")},TheWorld:function(){return o.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return o.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Vivo:function(){return o.replace(/^.*VivoBrowser\/([\d.]+).*$/,"$1")},OPPO:function(){return o.replace(/^.*HeyTapBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return o.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return o.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return o.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},WechatWork:function(){return o.replace(/^.*wxwork\/([\d.]+).*$/,"$1")},Taobao:function(){return o.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return o.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return o.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return o.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return o.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return o.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")},DingTalk:function(){return o.replace(/^.*DingTalk\/([\d.]+).*$/,"$1")},Douyin:function(){return o.replace(/^.*app_version\/([\d.]+).*$/,"$1")},Huawei:function(){return o.replace(/^.*Version\/([\d.]+).*$/,"$1").replace(/^.*HuaweiBrowser\/([\d.]+).*$/,"$1").replace(/^.*HBPC\/([\d.]+).*$/,"$1")},Googlebot:function(){return o.replace(/^.*Googlebot\/([\d.]+).*$/,"$1")},Baiduspider:function(){return o.replace(/^.*Baiduspider(-render)?\/([\d.]+).*$/,"$1")},Sogouspider:function(){return o.replace(/^.*Sogou (\S+) Spider\/([\d.]+).*$/i,"$2")},Bingbot:function(){return o.replace(/^.*bingbot\/([\d.]+).*$/,"$1")},"360Spider":function(){return""},Bytespider:function(){return""},YisouSpider:function(){return o.replace(/^.*YisouSpider\/([\d.]+).*$/,"$1")},YodaoBot:function(){return o.replace(/^.*YodaoBot\/([\d.]+).*$/,"$1")},YandexBot:function(){return o.replace(/^.*YandexBot\/([\d.]+).*$/,"$1")}};return a.version="",f[a.browser]&&(a.version=f[a.browser](),a.version==o&&(a.version="")),"Chrome"==a.browser&&o.match(/\S+Browser/)&&(a.browser=o.match(/\S+Browser/)[0],a.version=o.replace(/^.*Browser\/([\d.]+).*$/,"$1")),"Edge"==a.browser?a.engine=parseInt(a.version)>75?"Blink":"EdgeHTML":(s.Chrome&&"WebKit"==a.engine&&parseInt(f.Chrome())>27||"Opera"==a.browser&&parseInt(a.version)>12||"Yandex"==a.browser)&&(a.engine="Blink"),a}}(i)}(a)),a.exports),d=n(l);const c=0,u=1,h="flv",A="m7s",p={videoBuffer:200,videoBufferDelay:1e3,scaleMode:1,debug:!1,loadingTimeout:10,heartTimeout:5,timeout:10,loadingTimeoutReplay:!0,heartTimeoutReplay:!0,loadingTimeoutReplayTimes:3,heartTimeoutReplayTimes:5,keepScreenOn:!1,isMute:!0,hasAudio:!0,volume:.5,hasVideo:!0,decoder:"decoder.js",staticPath:"",url:"",rotate:0,forceNoOffscreen:!0,protocol:u,demuxType:h,useMSE:!1,autoWasm:!0,wasmDecodeErrorReplay:!0,openWebglAlignment:!1,wasmDecodeAudioSyncVideo:!1,useWebFullScreen:!0,loggerOptions:{level:"INFO"}},f="init",_="initVideo",m="render",v="playAudio",g="initAudio",y="audioCode",b="videoCode",E="wasmError",S="Invalid NAL unit size",w=1,T=2,k=8,R=9,O="init",C="decode",B="audioDecode",x="close",I="updateConfig",L={fullscreen:"fullscreen$2",webFullscreen:"webFullscreen",decoderWorkerInit:"decoderWorkerInit",play:"play",playing:"playing",pause:"pause",mute:"mute",load:"load",loading:"loading",loaded:"loaded",videoInfo:"videoInfo",timeUpdate:"timeUpdate",timeUpdateOSD:"timeUpdateOSD",audioInfo:"audioInfo",log:"log",error:"error",kBps:"kBps",timeout:"timeout",delayTimeout:"delayTimeout",loadingTimeout:"loadingTimeout",stats:"stats",performance:"performance",buffer:"buffer",videoFrame:"videoFrame",start:"start",metadata:"metadata",resize:"resize",streamEnd:"streamEnd",streamSuccess:"streamSuccess",streamMessage:"streamMessage",streamError:"streamError",volumechange:"volumechange",destroy:"destroy",mseSourceOpen:"mseSourceOpen",mseSourceClose:"mseSourceClose",mseSourceBufferError:"mseSourceBufferError",mseSourceBufferBusy:"mseSourceBufferBusy",mseSourceBufferFull:"mseSourceBufferFull",videoWaiting:"videoWaiting",videoTimeUpdate:"videoTimeUpdate",videoSyncAudio:"videoSyncAudio",playToRenderTimes:"playToRenderTimes",localVideoRecords:"localVideoRecords",getDefinitionListResult:"getDefinitionListResult",definitionChange:"definitionChange",definitionListChange:"definitionListChange",playbackRateListChange:"playbackRateListChange",playbackRateChange:"playbackRateChange",decoderLoaded:"decoderLoaded"},D={load:L.load,timeUpdate:L.timeUpdate,videoInfo:L.videoInfo,audioInfo:L.audioInfo,error:L.error,kBps:L.kBps,log:L.log,start:L.start,timeout:L.timeout,loadingTimeout:L.loadingTimeout,delayTimeout:L.delayTimeout,fullscreen:"fullscreen",webFullscreen:L.webFullscreen,play:L.play,pause:L.pause,mute:L.mute,stats:L.stats,volumechange:L.volumechange,performance:L.performance,playToRenderTimes:L.playToRenderTimes},M={playError:"playIsNotPauseOrUrlIsNull",fetchError:"NetworkError",websocketError:"websocketError",webcodecsH265NotSupport:"webcodecsH265NotSupport",webcodecsDecodeError:"webcodecsDecodeError",webcodecsWidthOrHeightChange:"webcodecsWidthOrHeightChange",mediaSourceH265NotSupport:"mediaSourceH265NotSupport",mediaSourceFull:L.mseSourceBufferFull,mseSourceBufferError:L.mseSourceBufferError,mediaSourceAppendBufferError:"mediaSourceAppendBufferError",mediaSourceBufferListLarge:"mediaSourceBufferListLarge",mediaSourceAppendBufferEndTimeout:"mediaSourceAppendBufferEndTimeout",wasmDecodeError:"wasmDecodeError",webglAlignmentError:"webglAlignmentError"},P={download:"download",base64:"base64",blob:"blob"},U={7:"H264(AVC)",12:"H265(HEVC)"},F={10:"AAC",7:"ALAW",8:"MULAW"},V={full:0,auto:1,fullAuto:2},N="webcodecs",G="webgl",j="offscreen",$="The user aborted a request",W="AbortError",Q="AbortError";function z(){}function H(){let e=arguments.length>1?arguments[1]:void 0;const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(","),i=atob(t[1]),r=t[0].replace("data:","").replace(";base64","");let n=i.length;const o=new Uint8Array(n);for(;n--;)o[n]=i.charCodeAt(n);return new File([o],e||"file",{type:r})}function q(){return(new Date).getTime()}function Y(e,t,i){if(e)return"object"==typeof t&&Object.keys(t).forEach((i=>{Y(e,i,t[i])})),e.style[t]=i,e}function X(){return performance&&"function"==typeof performance.now?performance.now():Date.now()}function Z(){return/phone|pad|pod|iphone|ipod|ios|ipad|android|mobile|blackberry|iemobile|mqqbrowser|juc|wosbrowser|webos|symbian|windows phone|opera mini|huaweibrowser/i.test(window.navigator.userAgent.toLowerCase())}function K(e){return null==e}function J(e){return!K(e)}function ee(e){const t=e||window.event;return t.target||t.srcElement}(()=>{try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){}})();class te{constructor(){}on(e,t,i){const r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:i}),this}once(e,t,i){const r=this;function n(){r.off(e,n);for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];t.apply(i,a)}return n._=t,this.on(e,n,i)}emit(e){const t=((this.e||(this.e={}))[e]||[]).slice();for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];for(let e=0;e<t.length;e+=1)t[e].fn.apply(t[e].ctx,r);return this}off(e,t){const i=this.e||(this.e={});if(!e)return Object.keys(i).forEach((e=>{delete i[e]})),void delete this.e;const r=i[e],n=[];if(r&&t)for(let e=0,i=r.length;e<i;e+=1)r[e].fn!==t&&r[e].fn._!==t&&n.push(r[e]);return n.length?i[e]=n:delete i[e],this}}let ie=class extends te{constructor(){super(),this.init=!1}resetInit(){this.init=!1,this.videoInfo={width:"",height:"",encType:"",encTypeCode:""}}destroy(){var e;this.resetInit(),this.player.$container&&this.$videoElement&&(null===(e=this.player.$container)||void 0===e||e.removeChild(this.$videoElement)),this.off()}updateVideoInfo(e){e.encTypeCode&&(this.videoInfo.encType=U[e.encTypeCode]),e.width&&(this.videoInfo.width=e.width),e.height&&(this.videoInfo.height=e.height),this.videoInfo.encType&&this.videoInfo.height&&this.videoInfo.width&&!this.init&&(this.player.emit(L.videoInfo,this.videoInfo),this.init=!0)}play(){}pause(){}clearView(){}};const re="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0;function ne(e,t,i){const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){le(r.response,t,i)},r.onerror=function(){},r.send()}function oe(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return t.status>=200&&t.status<=299}function ae(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(t){const i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(i)}}const se=re.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent);var le="object"!=typeof window||window!==re?function(){}:"download"in HTMLAnchorElement.prototype&&!se?function(e,t,i){const r=re.URL||re.webkitURL,n=document.createElementNS("http://www.w3.org/1999/xhtml","a");t=t||e.name||"download",n.download=t,n.rel="noopener","string"==typeof e?(n.href=e,n.origin!==location.origin?oe(n.href)?ne(e,t,i):ae(n,n.target="_blank"):ae(n)):(n.href=r.createObjectURL(e),setTimeout((function(){r.revokeObjectURL(n.href)}),4e4),setTimeout((function(){ae(n)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download","string"==typeof e)if(oe(e))ne(e,t,i);else{const t=document.createElement("a");t.href=e,t.target="_blank",setTimeout((function(){ae(t)}))}else navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,i),t)}:function(e,t,i,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return ne(e,t,i);const n="application/octet-stream"===e.type,o=/constructor/i.test(re.HTMLElement)||re.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||n&&o||se)&&"undefined"!=typeof FileReader){const t=new FileReader;t.onloadend=function(){let e=t.result;e=a?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},t.readAsDataURL(e)}else{const t=re.URL||re.webkitURL,i=t.createObjectURL(e);r?r.location=i:location.href=i,r=null,setTimeout((function(){t.revokeObjectURL(i)}),4e4)}};class de extends ie{constructor(e){super(),this.player=e;const t=document.createElement("canvas");t.style.position="absolute",t.style.top=0,t.style.left=0,this.$videoElement=t,e.$container.appendChild(this.$videoElement),this.context2D=null,this.contextGl=null,this.contextGlRender=null,this.contextGlDestroy=null,this.bitmaprenderer=null,this.renderType=null,this.videoInfo={width:"",height:"",encType:""},this._currentTime=0,this._initCanvasRender(),this._contextmenuEvent=e=>{e.target===this.$videoElement&&e.preventDefault()},document.addEventListener("contextmenu",this._contextmenuEvent),this.player.debug.log("CanvasVideo","init")}destroy(){super.destroy(),this.contextGl&&(this.contextGl=null),this.context2D&&(this.context2D=null),this.contextGlRender&&(this.contextGlDestroy&&this.contextGlDestroy(),this.contextGlDestroy=null,this.contextGlRender=null),this.bitmaprenderer&&(this.bitmaprenderer=null),this._contextmenuEvent&&(document.removeEventListener("contextmenu",this._contextmenuEvent),this._contextmenuEvent=null),this.renderType=null,this.player.debug.log("CanvasVideoLoader","destroy")}_initContextGl(){this.contextGl=function(e){let t=null;const i=["webgl","experimental-webgl","moz-webgl","webkit-3d"];let r=0;for(;!t&&r<i.length;){const n=i[r];try{const i={preserveDrawingBuffer:!0};t=e.getContext(n,i)}catch(e){t=null}t&&"function"==typeof t.getParameter||(t=null),++r}return t}(this.$videoElement);const e=((e,t)=>{var i=["attribute vec4 vertexPos;","attribute vec4 texturePos;","varying vec2 textureCoord;","void main()","{","gl_Position = vertexPos;","textureCoord = texturePos.xy;","}"].join("\n"),r=["precision highp float;","varying highp vec2 textureCoord;","uniform sampler2D ySampler;","uniform sampler2D uSampler;","uniform sampler2D vSampler;","const mat4 YUV2RGB = mat4","(","1.1643828125, 0, 1.59602734375, -.87078515625,","1.1643828125, -.39176171875, -.81296875, .52959375,","1.1643828125, 2.017234375, 0, -1.081390625,","0, 0, 0, 1",");","void main(void) {","highp float y = texture2D(ySampler, textureCoord).r;","highp float u = texture2D(uSampler, textureCoord).r;","highp float v = texture2D(vSampler, textureCoord).r;","gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;","}"].join("\n");t&&e.pixelStorei(e.UNPACK_ALIGNMENT,1);var n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,i),e.compileShader(n),e.getShaderParameter(n,e.COMPILE_STATUS);var o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,r),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS);var a=e.createProgram();e.attachShader(a,n),e.attachShader(a,o),e.linkProgram(a),e.getProgramParameter(a,e.LINK_STATUS),e.useProgram(a);var s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var l=e.getAttribLocation(a,"vertexPos");e.enableVertexAttribArray(l),e.vertexAttribPointer(l,2,e.FLOAT,!1,0,0);var d=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,d),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var c=e.getAttribLocation(a,"texturePos");function u(t,i){var r=e.createTexture();return e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),e.uniform1i(e.getUniformLocation(a,t),i),r}e.enableVertexAttribArray(c),e.vertexAttribPointer(c,2,e.FLOAT,!1,0,0);var h=u("ySampler",0),A=u("uSampler",1),p=u("vSampler",2);return{render:function(t,i,r,n,o){e.viewport(0,0,t,i),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,h),e.texImage2D(e.TEXTURE_2D,0,e.LUMINANCE,t,i,0,e.LUMINANCE,e.UNSIGNED_BYTE,r),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,A),e.texImage2D(e.TEXTURE_2D,0,e.LUMINANCE,t/2,i/2,0,e.LUMINANCE,e.UNSIGNED_BYTE,n),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,p),e.texImage2D(e.TEXTURE_2D,0,e.LUMINANCE,t/2,i/2,0,e.LUMINANCE,e.UNSIGNED_BYTE,o),e.drawArrays(e.TRIANGLE_STRIP,0,4)},destroy:function(){try{e.deleteProgram(a),e.deleteBuffer(s),e.deleteBuffer(d),e.deleteTexture(h),e.deleteTexture(A),e.deleteTexture(p)}catch(e){}}}})(this.contextGl,this.player._opt.openWebglAlignment);this.contextGlRender=e.render,this.contextGlDestroy=e.destroy}_initContext2D(){this.context2D=this.$videoElement.getContext("2d")}_initCanvasRender(){this._supportOffscreen()?(this.renderType=j,this._bindOffscreen()):(this.renderType=G,this._initContextGl())}_supportOffscreen(){return"function"==typeof this.$videoElement.transferControlToOffscreen&&this.player._opt.useOffscreen}_bindOffscreen(){this.bitmaprenderer=this.$videoElement.getContext("bitmaprenderer")}initCanvasViewSize(){this.$videoElement.width=this.videoInfo.width,this.$videoElement.height=this.videoInfo.height,this.resize()}render(e){switch(this.player.videoTimestamp=e.ts,this._currentTime=e.ts,this.renderType){case j:this.bitmaprenderer.transferFromImageBitmap(e.buffer);break;case G:this.contextGlRender(this.$videoElement.width,this.$videoElement.height,e.output[0],e.output[1],e.output[2]);break;case N:this.context2D.drawImage(e.videoFrame,0,0,this.$videoElement.width,this.$videoElement.height),(t=e.videoFrame).close?t.close():t.destroy&&t.destroy()}var t}screenshot(e,t,i,r){e=e||q(),r=r||P.download;const n={png:"image/png",jpeg:"image/jpeg",webp:"image/webp"};let o=.92;!n[t]&&P[t]&&(r=t,t="png",i=void 0),"string"==typeof i&&(r=i,i=void 0),void 0!==i&&(o=Number(i));const a=this.$videoElement.toDataURL(n[t]||n.png,o);if(r===P.base64)return a;{const i=H(a,e+"."+t);if(r===P.blob)return i;r===P.download&&le(i,e)}}clearView(){switch(this.renderType){case j:(function(e,t){const i=document.createElement("canvas");return i.width=e,i.height=t,window.createImageBitmap(i,0,0,e,t)})(this.$videoElement.width,this.$videoElement.height).then((e=>{this.bitmaprenderer.transferFromImageBitmap(e)}));break;case G:this.contextGl.clear(this.contextGl.COLOR_BUFFER_BIT);break;case N:this.context2D.clearRect(0,0,this.$videoElement.width,this.$videoElement.height)}}resize(){this.player.debug.log("canvasVideo","resize");const e=this.player._opt,t=this.player.width,i=this.player.height;let r=this.$videoElement.width,n=this.$videoElement.height;const o=e.rotate,a=(t-r)/2,s=(i-n)/2;270!==o&&90!==o||(r=this.$videoElement.height,n=this.$videoElement.width);const l=t/r,d=i/n;let c=l>d?d:l;e.scaleMode!==V.auto&&l!==d&&(c=l+","+d),e.scaleMode===V.fullAuto&&(c=l>d?l:d);let u="scale("+c+")";o&&(u+=" rotate("+o+"deg)"),this.$videoElement.style.transform=u,this.$videoElement.style.left=a+"px",this.$videoElement.style.top=s+"px"}get currentTime(){return(this._currentTime||0)/1e3}}class ce extends te{constructor(e){super(),this.bufferList=[],this.player=e,this.scriptNode=null,this.hasInitScriptNode=!1,this.audioContextChannel=null,this.audioContext=new(window.AudioContext||window.webkitAudioContext),this.gainNode=this.audioContext.createGain();const t=this.audioContext.createBufferSource();t.buffer=this.audioContext.createBuffer(1,1,22050),t.connect(this.audioContext.destination),t.noteOn?t.noteOn(0):t.start(0),this.audioBufferSourceNode=t,this.mediaStreamAudioDestinationNode=this.audioContext.createMediaStreamDestination(),this.audioEnabled(!0),this.gainNode.gain.value=0,this.playing=!1,this.audioSyncVideoOption={diff:null},this.audioInfo={encType:"",channels:"",sampleRate:""},this.init=!1,this.hasAudio=!1,this.on(L.videoSyncAudio,(e=>{this.audioSyncVideoOption=e})),this.player.debug.log("AudioContext","init")}resetInit(){this.init=!1,this.audioInfo={encType:"",channels:"",sampleRate:""}}destroy(){this.closeAudio(),this.resetInit(),this.audioContext.close(),this.audioContext=null,this.gainNode=null,this.hasAudio=!1,this.playing=!1,this.scriptNode&&(this.scriptNode.onaudioprocess=z,this.scriptNode=null),this.audioBufferSourceNode=null,this.mediaStreamAudioDestinationNode=null,this.hasInitScriptNode=!1,this.audioSyncVideoOption={diff:null},this.off(),this.player.debug.log("AudioContext","destroy")}updateAudioInfo(e){e.encTypeCode&&(this.audioInfo.encType=F[e.encTypeCode]),e.channels&&(this.audioInfo.channels=e.channels),e.sampleRate&&(this.audioInfo.sampleRate=e.sampleRate),this.audioInfo.sampleRate&&this.audioInfo.channels&&this.audioInfo.encType&&!this.init&&(this.player.emit(L.audioInfo,this.audioInfo),this.init=!0)}get isPlaying(){return this.playing}get isMute(){return 0===this.gainNode.gain.value}get volume(){return this.gainNode.gain.value}get bufferSize(){return this.bufferList.length}initScriptNode(){if(this.playing=!0,this.hasInitScriptNode)return;const e=this.audioInfo.channels,t=this.audioContext.createScriptProcessor(1024,0,e);t.onaudioprocess=t=>{const i=t.outputBuffer;if(this.bufferList.length&&this.playing){if(!this.player._opt.useWCS&&!this.player._opt.useMSE&&this.player._opt.wasmDecodeAudioSyncVideo){if(this.audioSyncVideoOption.diff>1e3)return void this.player.debug.warn("AudioContext",`audioSyncVideoOption more than diff :${this.audioSyncVideoOption.diff}, waiting`);if(this.audioSyncVideoOption.diff<-1e3){this.player.debug.warn("AudioContext",`audioSyncVideoOption less than diff :${this.audioSyncVideoOption.diff}, dropping`);let e=this.bufferList.shift();for(;e.ts-this.player.videoTimestamp<-1e3&&this.bufferList.length>0;)e=this.bufferList.shift();if(0===this.bufferList.length)return}}if(0===this.bufferList.length)return;const t=this.bufferList.shift();t&&t.ts&&(this.player.audioTimestamp=t.ts);for(let r=0;r<e;r++){const e=t.buffer[r],n=i.getChannelData(r);for(let t=0;t<1024;t++)n[t]=e[t]||0}}},t.connect(this.gainNode),this.scriptNode=t,this.gainNode.connect(this.audioContext.destination),this.gainNode.connect(this.mediaStreamAudioDestinationNode),this.hasInitScriptNode=!0}mute(e){e?(this.isMute||this.player.emit(L.mute,e),this.setVolume(0),this.clear()):(this.isMute&&this.player.emit(L.mute,e),this.setVolume(.5))}setVolume(e){e=parseFloat(e).toFixed(2),isNaN(e)||(this.audioEnabled(!0),e=function(e,t,i){return Math.max(Math.min(e,Math.max(t,i)),Math.min(t,i))}(e,0,1),this.gainNode.gain.value=e,this.gainNode.gain.setValueAtTime(e,this.audioContext.currentTime),this.player.emit(L.volumechange,this.player.volume))}closeAudio(){this.hasInitScriptNode&&(this.scriptNode&&this.scriptNode.disconnect(this.gainNode),this.gainNode&&this.gainNode.disconnect(this.audioContext.destination),this.gainNode&&this.gainNode.disconnect(this.mediaStreamAudioDestinationNode)),this.clear()}audioEnabled(e){e?"suspended"===this.audioContext.state&&this.audioContext.resume():"running"===this.audioContext.state&&this.audioContext.suspend()}isStateRunning(){return"running"===this.audioContext.state}isStateSuspended(){return"suspended"===this.audioContext.state}clear(){this.bufferList=[]}play(e,t){this.isMute||(this.hasAudio=!0,this.bufferList.push({buffer:e,ts:t}),this.bufferList.length>20&&(this.player.debug.warn("AudioContext",`bufferList is large: ${this.bufferList.length}`),this.bufferList.length>50&&this.bufferList.shift()))}pause(){this.audioSyncVideoOption={diff:null},this.playing=!1,this.clear()}resume(){this.playing=!0}}class ue{constructor(e){return new(ue.getLoaderFactory())(e)}static getLoaderFactory(){return ce}}class he extends te{constructor(e){super(),this.player=e,this.playing=!1,this.abortController=new AbortController,this.streamRate=(X(),e=>{X()}),e.debug.log("FetchStream","init")}destroy(){this.abort(),this.off(),this.streamRate=null,this.player.debug.log("FetchStream","destroy")}fetchStream(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{demux:i}=this.player;this.player._times.streamStart=q();const r=Object.assign({signal:this.abortController.signal},{headers:t.headers||{}});fetch(e,r).then((e=>{const t=e.body.getReader();this.emit(L.streamSuccess);const r=()=>{t.read().then((e=>{let{done:t,value:n}=e;t?i.close():(this.streamRate&&this.streamRate(n.byteLength),i.dispatch(n),r())})).catch((e=>{i.close();const r=e.toString();-1===r.indexOf($)&&-1===r.indexOf(W)&&e.name!==Q&&(this.abort(),t.cancel(),this.emit(M.fetchError,e),this.player.emit(L.error,M.fetchError))}))};r()})).catch((e=>{"AbortError"!==e.name&&(i.close(),this.abort(),this.emit(M.fetchError,e),this.player.emit(L.error,M.fetchError))}))}abort(){this.abortController&&(this.abortController.abort(),this.abortController=null)}}class Ae{constructor(e){return new(Ae.getLoaderFactory(e._opt.protocol))(e)}static getLoaderFactory(e){return he}}class pe{constructor(e){this.player=e,this.decoderWorker=new Worker((""===e._opt.staticPath?"":function(e,t){void 0===t&&(t="");var i=/^(https?:\/\/|^\/\/)/;return i.test(e)?e:(e=e.replace(/\/+/g,"/"),t=i.test(t||"")?t:window.location.href,new URL(e,t).href)}(e._opt.staticPath))+e._opt.decoder),this._initDecoderWorker(),e.debug.log("decoderWorker","init")}destroy(){this.decoderWorker.postMessage({cmd:x}),this.decoderWorker.terminate(),this.decoderWorker=null,this.player.debug.log("decoderWorker","destroy")}_initDecoderWorker(){const{debug:e,events:{proxy:t}}=this.player;this.decoderWorker.onmessage=t=>{var i,r,n,o,a,s;const l=t.data;switch(l.cmd){case f:e.log("decoderWorker","onmessage:",f),this.player.loaded||this.player.emit(L.load),this.player.emit(L.decoderWorkerInit),this.player.emit(L.decoderLoaded),this._initWork();break;case b:e.log("decoderWorker","onmessage:",b,l.code),this.player._times.decodeStart||(this.player._times.decodeStart=q()),this.player.video.updateVideoInfo({encTypeCode:l.code});break;case y:e.log("decoderWorker","onmessage:",y,l.code),null===(i=this.player)||void 0===i||null===(i=i.audio)||void 0===i||null===(r=i.updateAudioInfo)||void 0===r||r.call(i,{encTypeCode:l.code});break;case _:if(e.log("decoderWorker","onmessage:",_,`width:${l.w},height:${l.h}`),null===(n=this.player)||void 0===n||null===(n=n.video)||void 0===n||null===(o=n.updateVideoInfo)||void 0===o||o.call(n,{width:l.w,height:l.h}),!this.player._opt.openWebglAlignment&&l.w/2%4!=0)return void this.player.emit(M.webglAlignmentError);this.player.video.initCanvasViewSize();break;case g:e.log("decoderWorker","onmessage:",g,`channels:${l.channels},sampleRate:${l.sampleRate}`),this.player.audio&&(this.player.audio.updateAudioInfo(l),this.player.audio.initScriptNode(l));break;case m:this.player.handleRender(),this.player.video.render(l),this.player.emit(L.timeUpdate,l.ts/1e3),this.player.updateStats({fps:!0,ts:l.ts,buf:l.delay}),this.player._times.videoStart||(this.player._times.videoStart=q(),this.player.handlePlayToRenderTimes());break;case v:this.player.playing&&this.player.audio&&this.player.audio.play(l.buffer,l.ts);break;case E:l.message&&-1!==l.message.indexOf(S)&&this.player.emitError(M.wasmDecodeError);break;default:null===(a=(s=this.player)[l.cmd])||void 0===a||a.call(s,l)}}}_initWork(){var e;const t={debug:this.player._opt.debug,useOffscreen:this.player._opt.useOffscreen,useWCS:this.player._opt.useWCS,videoBuffer:this.player._opt.videoBuffer,videoBufferDelay:this.player._opt.videoBufferDelay,openWebglAlignment:this.player._opt.openWebglAlignment};this.decoderWorker.postMessage({cmd:O,opt:JSON.stringify(t),sampleRate:(null===(e=this.player)||void 0===e||null===(e=e.audio)||void 0===e||null===(e=e.audioContext)||void 0===e?void 0:e.sampleRate)||0})}decodeVideo(e,t,i){const r={type:T,ts:Math.max(t,0),isIFrame:i};this.decoderWorker.postMessage({cmd:C,buffer:e,options:r},[e.buffer])}decodeAudio(e,t){this.player._opt.useWCS||this.player._opt.useMSE?this._decodeAudioNoDelay(e,t):this._decodeAudio(e,t)}_decodeAudio(e,t){const i={type:w,ts:Math.max(t,0)};this.decoderWorker.postMessage({cmd:C,buffer:e,options:i},[e.buffer])}_decodeAudioNoDelay(e,t){this.decoderWorker.postMessage({cmd:B,buffer:e,ts:Math.max(t,0)},[e.buffer])}updateWorkConfig(e){this.decoderWorker.postMessage({cmd:I,key:e.key,value:e.value})}}class fe extends te{constructor(e){super(),this.player=e,this.stopId=null,this.firstTimestamp=null,this.startTimestamp=null,this.delay=-1,this.bufferList=[],this.dropping=!1,this.initInterval()}destroy(){this.stopId&&(clearInterval(this.stopId),this.stopId=null),this.firstTimestamp=null,this.startTimestamp=null,this.delay=-1,this.bufferList=[],this.dropping=!1,this.off(),this.player.debug.log("CommonDemux","destroy")}getDelay(e){if(!e)return-1;if(this.firstTimestamp){if(e){const t=Date.now()-this.startTimestamp,i=e-this.firstTimestamp;this.delay=t>=i?t-i:i-t}}else this.firstTimestamp=e,this.startTimestamp=Date.now(),this.delay=-1;return this.delay}resetDelay(){this.firstTimestamp=null,this.startTimestamp=null,this.delay=-1,this.dropping=!1}initInterval(){this.player.debug.log("common dumex","init Interval");const e=()=>{let e;const t=this.player._opt.videoBuffer,i=this.player._opt.videoBufferDelay;if(this.bufferList.length)if(this.dropping){for(e=this.bufferList.shift(),e.type===w&&0===e.payload[1]&&this._doDecoderDecode(e);!e.isIFrame&&this.bufferList.length;)e=this.bufferList.shift(),e.type===w&&0===e.payload[1]&&this._doDecoderDecode(e);e.isIFrame&&this.getDelay(e.ts)<=Math.min(t,200)&&(this.dropping=!1,this._doDecoderDecode(e))}else e=this.bufferList[0],-1===this.getDelay(e.ts)?(this.bufferList.shift(),this._doDecoderDecode(e)):this.delay>t+i?(this.resetDelay(),this.dropping=!0):(e=this.bufferList[0],this.getDelay(e.ts)>t&&(this.bufferList.shift(),this._doDecoderDecode(e)))};e(),this.stopId=setInterval(e,10)}_doDecode(e,t,i,r,n){const o=this.player,a={ts:i,cts:n,type:t,isIFrame:!1};var s,l;if(o._opt.useWCS&&!o._opt.useOffscreen)t===T&&(a.isIFrame=r),this.pushBuffer(e,a);else if(t===T)null==o||null===(s=o.decoderWorker)||void 0===s||null===(l=s.decodeVideo)||void 0===l||l.call(s,e,i,r);else if(t===w){var d,c;if(o._opt.hasAudio)null==o||null===(d=o.decoderWorker)||void 0===d||null===(c=d.decodeAudio)||void 0===c||c.call(d,e,i)}}_doDecoderDecode(e){const t=this.player;var i,r;e.type===w?t._opt.hasAudio&&(null===(i=t.decoderWorker)||void 0===i||null===(r=i.decodeAudio)||void 0===r||r.call(i,e.payload,e.ts)):e.type}pushBuffer(e,t){t.type===w?this.bufferList.push({ts:t.ts,payload:e,type:w}):t.type===T&&this.bufferList.push({ts:t.ts,cts:t.cts,payload:e,type:T,isIFrame:t.isIFrame})}close(){}}class _e extends fe{constructor(e){super(e),this.input=this._inputFlv(),this.flvDemux=this.dispatchFlvData(this.input),e.debug.log("FlvDemux","init")}destroy(){super.destroy(),this.input=null,this.flvDemux=null,this.player.debug.log("FlvDemux","destroy")}dispatch(e){this.flvDemux(e)}*_inputFlv(){yield 9;const e=new ArrayBuffer(4),t=new Uint8Array(e),i=new Uint32Array(e),r=this.player;for(;;){t[3]=0;const e=yield 15,n=e[4];t[0]=e[7],t[1]=e[6],t[2]=e[5];const o=i[0];t[0]=e[10],t[1]=e[9],t[2]=e[8];let a=i[0];16777215===a&&(t[3]=e[11],a=i[0]);const s=yield o;switch(n){case k:r._opt.hasAudio&&(r.updateStats({abps:s.byteLength}),s.byteLength>0&&this._doDecode(s,w,a));break;case R:if(r._times.demuxStart||(r._times.demuxStart=q()),r._opt.hasVideo){r.updateStats({vbps:s.byteLength});const e=s[0]>>4==1;if(s.byteLength>0){i[0]=s[4],i[1]=s[3],i[2]=s[2],i[3]=0;const t=i[0];this._doDecode(s,T,a,e,t)}}}}}dispatchFlvData(e){let t=e.next(),i=null;return r=>{let n=new Uint8Array(r);if(i){const e=new Uint8Array(i.length+n.length);e.set(i),e.set(n,i.length),n=e,i=null}for(;n.length>=t.value;){const i=n.slice(t.value);t=e.next(n.slice(0,t.value)),n=i}n.length>0&&(i=n)}}close(){var e,t;null===(e=this.input)||void 0===e||null===(t=e.return)||void 0===t||t.call(e,null)}}class me extends fe{constructor(e){super(e),e.debug.log("M7sDemux","init")}destroy(){super.destroy(),this.player.debug.log("M7sDemux","destroy"),this.player=null}dispatch(e){const t=this.player,i=new DataView(e),r=i.getUint8(0),n=i.getUint32(1,!1);switch(r){case w:if(t._opt.hasAudio){const i=new Uint8Array(e,5);t.updateStats({abps:i.byteLength}),i.byteLength>0&&this._doDecode(i,r,n)}break;case T:if(t._opt.hasVideo)if(t._times.demuxStart||(t._times.demuxStart=q()),i.byteLength>5){const o=new Uint8Array(e,5),a=i.getUint8(5)>>4==1;t.updateStats({vbps:o.byteLength}),o.byteLength>0&&this._doDecode(o,r,n,a)}else this.player.debug.warn("M7sDemux","dispatch","dv byteLength is",i.byteLength)}}}class ve{constructor(e){return new(ve.getLoaderFactory(e._opt.demuxType))(e)}static getLoaderFactory(e){return e===A?me:e===h?_e:void 0}}const ge=()=>"undefined"!=typeof navigator&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,ye=()=>"wakeLock"in navigator;class be{constructor(e){if(this.player=e,this.enabled=!1,ye()){this._wakeLock=null;const e=()=>{null!==this._wakeLock&&"visible"===document.visibilityState&&this.enable()};document.addEventListener("visibilitychange",e),document.addEventListener("fullscreenchange",e)}else ge()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm","data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK"),this._addSourceToVideo(this.noSleepVideo,"mp4","data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"),this.noSleepVideo.addEventListener("loadedmetadata",(()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",(()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())}))})))}_addSourceToVideo(e,t,i){const r=document.createElement("source");r.src=i,r.type=`video/${t}`,e.appendChild(r)}get isEnabled(){return this.enabled}enable(){const e=this.player.debug;if(ye())return navigator.wakeLock.request("screen").then((t=>{this._wakeLock=t,this.enabled=!0,e.log("wakeLock","Wake Lock active."),this._wakeLock.addEventListener("release",(()=>{e.log("wakeLock","Wake Lock released.")}))})).catch((t=>{throw this.enabled=!1,e.error("wakeLock",`${t.name}, ${t.message}`),t}));if(ge())return this.disable(),this.noSleepTimer=window.setInterval((()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))}),15e3),this.enabled=!0,Promise.resolve();return this.noSleepVideo.play().then((e=>(this.enabled=!0,e))).catch((e=>{throw this.enabled=!1,e}))}disable(){const e=this.player.debug;ye()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):ge()?this.noSleepTimer&&(e.warn("wakeLock","NoSleep now disabled for older iOS devices."),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}
|
|
29
17
|
/*
|
|
30
18
|
*
|
|
31
19
|
* @ezuikit/utils-logger v1.0.1
|
|
32
20
|
* Copyright (c) 2024-3-23 Ezviz-OpenBiz
|
|
33
21
|
* Released under MIT the License.
|
|
34
22
|
*
|
|
35
|
-
*/var mi={info:"",log:"background: #4096ff; color: #FFF;",warn:"background: yellow; color: #FFF;",error:"background: red; color: #FFF;"},vi=function(){function e(e){void 0===e&&(e={}),this._options={level:"INFO",showTime:!1},this._levelNum=3,this.info=this._loggerFactory("info",this._levelNum>=3),this.log=this._loggerFactory("log",this._levelNum>=2),this.warn=this._loggerFactory("warn",this._levelNum>=1),this.error=this._loggerFactory("error",this._levelNum>=0),this.setOptions(e)}var t=e.prototype;return t.setOptions=function(e){var t;this._options=Object.assign({},this._options,e),this._levelNum=this._matchLevel(null!=(t=this._options.level)?t:"INFO"),this.info=this._loggerFactory("info",this._levelNum>=3),this.log=this._loggerFactory("log",this._levelNum>=2),this.warn=this._loggerFactory("warn",this._levelNum>=1),this.error=this._loggerFactory("error",this._levelNum>=0)},t._matchLevel=function(e){var t=3;switch(e){case"INFO":t=3;break;case"LOG":t=2;break;case"WARN":t=1;break;case"ERROR":t=0}return t},t._loggerFactory=function(t,i){var n=console[t];if(i&&n){var r,o=this._options.name?"%c["+this._options.name+"]%c %c["+t.toUpperCase()+"]":"%c["+t.toUpperCase()+"]",a=[this._options.name?"background: green;color: #fff":null,this._options.name?"":null,mi[t]].filter((function(e){return null!=e}));return(r=n).bind.apply(r,[].concat([console,o],a))}return e.noop},t.getOptions=function(){return this._options},t.getVersion=function(){return"1.0.1"},e}();function gi(e){return(e=+e)<10&&(e="0"+e),e+""}vi.noop=function(){};var yi=["info","log","warn","error"];function bi(e){var t=new vi(e);return new Proxy(t,{get:function(e,t){if(yi.includes(t)){var i;if(null==(i=e._options)?void 0:i.showTime){var n=(o=(r=new Date(Date.now())).getFullYear(),a=r.getMonth()+1,s=r.getDate(),d=r.getHours(),l=r.getMinutes(),c=r.getSeconds(),h=r.getMilliseconds(),o+"/"+gi(a)+"/"+gi(s)+" "+gi(d)+":"+gi(l)+":"+gi(c)+":"+h);return e[t].bind(console,"["+n+"]")}return e[t].bind(console)}var r,o,a,s,d,l,c,h;return Reflect.get(e,t)}})}class Ei{constructor(e){this.master=e,this.logger=new bi({name:"FLV",showTime:!0}),console.log(e._opt.loggerOptions)}info(e,...t){this._setLoger()>=4&&this.logger.log(e,...t)}log(e,...t){this._setLoger()>=3&&this.logger.log(e,...t)}warn(e,...t){this._setLoger()>=2&&this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}_setLoger(e){var t,i,n,r,o;if(this.master._opt.debug&&null!==(t=this.master._opt.loggerOptions)&&void 0!==t&&t.level)return"INFO"===(null===(i=this.master._opt.loggerOptions)||void 0===i?void 0:i.level)?4:"LOG"===(null===(n=this.master._opt.loggerOptions)||void 0===n?void 0:n.level)?3:"WARN"===(null===(r=this.master._opt.loggerOptions)||void 0===r?void 0:r.level)?2:"ERROR"===(null===(o=this.master._opt.loggerOptions)||void 0===o?void 0:o.level)?1:5}}class Si{constructor(e){this.destroys=[],this.proxy=this.proxy.bind(this),this.master=e}proxy(e,t,i,n={}){if(!e)return;if(Array.isArray(t))return t.map((t=>this.proxy(e,t,i,n)));e.addEventListener(t,i,n);const r=()=>e.removeEventListener(t,i,n);return this.destroys.push(r),r}destroy(){var e;null===(e=this.master.debug)||void 0===e||e.log("Events","destroy"),this.destroys.forEach((e=>e()))}}class wi{constructor(e){this.player=e,((e,t)=>{const{events:{proxy:i}}=e,n=document.createElement("object");n.setAttribute("aria-hidden","true"),n.setAttribute("tabindex",-1),n.type="text/html",n.data="about:blank",Gt(n,{display:"block",position:"absolute",top:"0",left:"0",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:"-1"});let r=e.width,o=e.height;i(n,"load",(()=>{i(n.contentDocument.defaultView,"resize",(()=>{e.width===r&&e.height===o||(r=e.width,o=e.height,e.emit(mt.resize),s())}))})),e.$container.appendChild(n),e.on(mt.destroy,(()=>{e.$container.removeChild(n)}));const a=i=>{const n=!0===(r=i)||!1===r?i:e.fullscreen;var r;Gt(t.$fullscreenExit,"display",n?"flex":"none"),Gt(t.$fullscreen,"display",n?"none":"flex")},s=()=>{Qt()&&e._opt.useWebFullScreen};try{Ut.on("change",a),e.events.destroys.push((()=>{Ut.off("change",a)}))}catch(e){}e.on(mt.webFullscreen,(e=>{a(e),s()}))})(e,this)}}class Ti extends $t{constructor(e,t,i){var n;super(),this.$container=e,this._opt=t,this.debug=new Ei(this),this._loading=!1,this._playing=!1,this._hasLoaded=!1,this._checkHeartTimeout=null,this._checkLoadingTimeout=null,this._checkStatsInterval=null,this._startBpsTime=null,this._isPlayingBeforePageHidden=!1,this._stats={buf:0,fps:0,abps:0,vbps:0,ts:0},this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this._videoTimestamp=0,this._audioTimestamp=0,n=this,Object.defineProperty(n,"rect",{get:()=>{const e=n.$container.getBoundingClientRect();return e.width=Math.max(e.width,n.$container.clientWidth),e.height=Math.max(e.height,n.$container.clientHeight),e}}),["bottom","height","left","right","top","width"].forEach((e=>{Object.defineProperty(n,e,{get:()=>n.rect[e]})})),this.events=new Si(this),this.video=new i(this),(e=>{try{const t=t=>{Xt(t)===e.$container&&(e.emit(vt.fullscreen,e.fullscreen),e.fullscreen?e._opt.useMSE&&e.resize():e.resize())};Ut.on("change",t),e.events.destroys.push((()=>{Ut.off("change",t)}))}catch(e){}e.on(mt.decoderWorkerInit,(()=>{e.debug.log("player","has loaded"),e.loaded=!0})),e.on(mt.play,(()=>{e.loading=!1})),e.on(mt.fullscreen,(t=>{if(t)try{Ut.request(e.$container).then((()=>{})).catch((t=>{Qt()&&e._opt.useWebFullScreen&&(e.webFullscreen=!0)}))}catch(t){Qt()&&e._opt.useWebFullScreen&&(e.webFullscreen=!0)}else try{Ut.exit().then((()=>{e.webFullscreen&&(e.webFullscreen=!1)})).catch((()=>{e.webFullscreen=!1}))}catch(t){e.webFullscreen=!1}})),Qt()&&e.on(mt.webFullscreen,(t=>{t?e.$container.classList.add("flv-fullscreen-web"):e.$container.classList.remove("flv-fullscreen-web"),e._opt.useWebFullScreen&&Gt(e.$container,t?{position:"fixed",top:"0px",left:"0px",right:"0px",bottom:"0px",height:"100%",width:"100%"}:{position:"relative",top:"",left:"",right:"",bottom:"",height:"",width:""}),e.emit(vt.fullscreen,e.fullscreen)})),e.on(mt.resize,(()=>{var t;null===(t=e.video)||void 0===t||t.resize()}));const t=[mt.timeUpdate];Object.keys(mt).forEach((i=>{e.on(mt[i],(n=>{t.includes(i)||e.debug.log("player events",mt[i],n)}))})),Object.keys(gt).forEach((t=>{e.on(gt[t],(i=>{e.debug.log("player event error",gt[t],i)}))}))})(this),(e=>{const{_opt:t,debug:i,events:{proxy:n}}=e;t.supportDblclickFullscreen&&n(e.$container,"dblclick",(t=>{const i=Xt(t).nodeName.toLowerCase();"canvas"!==i&&"video"!==i||(e.fullscreen=!e.fullscreen)})),n(document,"visibilitychange",(()=>{t.hiddenAutoPause&&(i.log("visibilitychange",document.visibilityState,e._isPlayingBeforePageHidden),"visible"===document.visibilityState?e._isPlayingBeforePageHidden&&e.play():(e._isPlayingBeforePageHidden=e.playing,e.playing&&e.pause()))})),n(window,"fullscreenchange",(()=>{null!==e.keepScreenOn&&"visible"===document.visibilityState&&e.enableWakeLock&&e.enableWakeLock()}))})(this),this.control=new wi(this)}updateOption(e){this._opt=Object.assign({},this._opt,e)}}
|
|
23
|
+
*/var Ee={info:"",log:"background: #4096ff; color: #FFF;",warn:"background: yellow; color: #FFF;",error:"background: red; color: #FFF;"},Se=function(){function e(e){void 0===e&&(e={}),this._options={level:"INFO",showTime:!1},this._levelNum=3,this.info=this._loggerFactory("info",this._levelNum>=3),this.log=this._loggerFactory("log",this._levelNum>=2),this.warn=this._loggerFactory("warn",this._levelNum>=1),this.error=this._loggerFactory("error",this._levelNum>=0),this.setOptions(e)}var t=e.prototype;return t.setOptions=function(e){var t;this._options=Object.assign({},this._options,e),this._levelNum=this._matchLevel(null!=(t=this._options.level)?t:"INFO"),this.info=this._loggerFactory("info",this._levelNum>=3),this.log=this._loggerFactory("log",this._levelNum>=2),this.warn=this._loggerFactory("warn",this._levelNum>=1),this.error=this._loggerFactory("error",this._levelNum>=0)},t._matchLevel=function(e){var t=3;switch(e){case"INFO":t=3;break;case"LOG":t=2;break;case"WARN":t=1;break;case"ERROR":t=0}return t},t._loggerFactory=function(t,i){var r=console[t];if(i&&r){var n,o=this._options.name?"%c["+this._options.name+"]%c %c["+t.toUpperCase()+"]":"%c["+t.toUpperCase()+"]",a=[this._options.name?"background: green;color: #fff":null,this._options.name?"":null,Ee[t]].filter((function(e){return null!=e}));return(n=r).bind.apply(n,[].concat([console,o],a))}return e.noop},t.getOptions=function(){return this._options},t.getVersion=function(){return"1.0.1"},e}();function we(e){return(e=+e)<10&&(e="0"+e),e+""}Se.noop=function(){};var Te=["info","log","warn","error"];function ke(e){var t=new Se(e);return new Proxy(t,{get:function(e,t){if(Te.includes(t)){var i;if(null==(i=e._options)?void 0:i.showTime){var r=(o=(n=new Date(Date.now())).getFullYear(),a=n.getMonth()+1,s=n.getDate(),l=n.getHours(),d=n.getMinutes(),c=n.getSeconds(),u=n.getMilliseconds(),o+"/"+we(a)+"/"+we(s)+" "+we(l)+":"+we(d)+":"+we(c)+":"+u);return e[t].bind(console,"["+r+"]")}return e[t].bind(console)}var n,o,a,s,l,d,c,u;return Reflect.get(e,t)}})}class Re{constructor(e){this.master=e,this.logger=new ke({name:"FLV",showTime:!0}),console.log(e._opt.loggerOptions)}info(e){if(this._setLogger()>=4){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];this.logger.log(e,...i)}}log(e){if(this._setLogger()>=3){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];this.logger.log(e,...i)}}warn(e){if(this._setLogger()>=2){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];this.logger.warn(e,...i)}}error(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];this.logger.error(e,...i)}_setLogger(e){var t,i,r,n,o;if(this.master._opt.debug&&null!==(t=this.master._opt.loggerOptions)&&void 0!==t&&t.level)return"INFO"===(null===(i=this.master._opt.loggerOptions)||void 0===i?void 0:i.level)?4:"LOG"===(null===(r=this.master._opt.loggerOptions)||void 0===r?void 0:r.level)?3:"WARN"===(null===(n=this.master._opt.loggerOptions)||void 0===n?void 0:n.level)?2:"ERROR"===(null===(o=this.master._opt.loggerOptions)||void 0===o?void 0:o.level)?1:5}}class Oe{constructor(e){this.destroys=[],this.proxy=this.proxy.bind(this),this.master=e}proxy(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e)return;if(Array.isArray(t))return t.map((t=>this.proxy(e,t,i,r)));e.addEventListener(t,i,r);const n=()=>e.removeEventListener(t,i,r);return this.destroys.push(n),n}destroy(){var e;null===(e=this.master.debug)||void 0===e||e.log("Events","destroy"),this.destroys.forEach((e=>e()))}}var Ce,Be={exports:{}};var xe=(Ce||(Ce=1,function(e){!function(){var t="undefined"!=typeof window&&void 0!==window.document?window.document:{},i=e.exports,r=function(){for(var e,i=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],r=0,n=i.length,o={};r<n;r++)if((e=i[r])&&e[1]in t){for(r=0;r<e.length;r++)o[i[0][r]]=e[r];return o}return!1}(),n={change:r.fullscreenchange,error:r.fullscreenerror},o={request:function(e,i){return new Promise(function(n,o){var a=function(){this.off("change",a),n()}.bind(this);this.on("change",a);var s=(e=e||t.documentElement)[r.requestFullscreen](i);s instanceof Promise&&s.then(a).catch(o)}.bind(this))},exit:function(){return new Promise(function(e,i){if(this.isFullscreen){var n=function(){this.off("change",n),e()}.bind(this);this.on("change",n);var o=t[r.exitFullscreen]();o instanceof Promise&&o.then(n).catch(i)}else e()}.bind(this))},toggle:function(e,t){return this.isFullscreen?this.exit():this.request(e,t)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(e,i){var r=n[e];r&&t.addEventListener(r,i,!1)},off:function(e,i){var r=n[e];r&&t.removeEventListener(r,i,!1)},raw:r};r?(Object.defineProperties(o,{isFullscreen:{get:function(){return Boolean(t[r.fullscreenElement])}},element:{enumerable:!0,get:function(){return t[r.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(t[r.fullscreenEnabled])}}}),i?e.exports=o:window.screenfull=o):i?e.exports={isEnabled:!1}:window.screenfull={isEnabled:!1}}()}(Be)),Be.exports),Ie=n(xe);class Le{constructor(e){this.player=e,((e,t)=>{const{events:{proxy:i}}=e,r=document.createElement("object");r.setAttribute("aria-hidden","true"),r.setAttribute("tabindex",-1),r.type="text/html",r.data="about:blank",Y(r,{display:"block",position:"absolute",top:"0",left:"0",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:"-1"});let n=e.width,o=e.height;i(r,"load",(()=>{i(r.contentDocument.defaultView,"resize",(()=>{e.width===n&&e.height===o||(n=e.width,o=e.height,e.emit(L.resize),a())}))})),e.$container.appendChild(r),e.on(L.destroy,(()=>{e.$container.removeChild(r)}));const a=()=>{Z()&&e._opt.useWebFullScreen}})(e)}}class De extends te{constructor(e,t,i){var r;super(),this.$container=e,this._opt=t,this.debug=new Re(this),this._loading=!1,this._playing=!1,this._hasLoaded=!1,this._checkHeartTimeout=null,this._checkLoadingTimeout=null,this._checkStatsInterval=null,this._startBpsTime=null,this._isPlayingBeforePageHidden=!1,this._stats={buf:0,fps:0,abps:0,vbps:0,ts:0},this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this._videoTimestamp=0,this._audioTimestamp=0,r=this,Object.defineProperty(r,"rect",{get:()=>{const e=r.$container.getBoundingClientRect();return e.width=Math.max(e.width,r.$container.clientWidth),e.height=Math.max(e.height,r.$container.clientHeight),e}}),["bottom","height","left","right","top","width"].forEach((e=>{Object.defineProperty(r,e,{get:()=>r.rect[e]})})),this.events=new Oe(this),this.video=new i(this),(e=>{try{if(Ie.isEnabled){let t=t=>{ee(t)===e.$container&&(e._fullscreen=!e._fullscreen,e.emit(D.fullscreen,e.fullscreen),e.fullscreen||e.resize())};Ie.on("change",t),e.events.destroys.push((()=>{Ie.off("change",t),t=null}))}}catch(e){}e.on(L.decoderWorkerInit,(()=>{e.debug.log("player","has loaded"),e.loaded=!0})),e.on(L.play,(()=>{e.loading=!1})),e.on(L.fullscreen,(t=>{if(t)try{var i;Ie.isEnabled?Ie.request(e.$container).then((()=>{})).catch((t=>{Z()&&e._opt.useWebFullScreen&&(e.webFullscreen=!0)})):null==e||null===(i=e.debug)||void 0===i||i.warn("screenfull is not enabled")}catch(t){Z()&&e._opt.useWebFullScreen&&(e.webFullscreen=!0)}else try{var r;Ie.isEnabled?Ie.exit(e.$container).then((()=>{e.webFullscreen&&(e.webFullscreen=!1)})).catch((()=>{e.webFullscreen=!1})):null==e||null===(r=e.debug)||void 0===r||r.warn("screenfull is not enabled")}catch(t){e.webFullscreen=!1}})),Z()&&e.on(L.webFullscreen,(t=>{t?e.$container.classList.add("flv-fullscreen-web"):e.$container.classList.remove("flv-fullscreen-web"),e._opt.useWebFullScreen&&Y(e.$container,t?{position:"fixed",top:"0px",left:"0px",right:"0px",bottom:"0px",height:"100%",width:"100%"}:{position:"relative",top:"",left:"",right:"",bottom:"",height:"",width:""}),e.emit(D.fullscreen,e.fullscreen)})),e.on(L.resize,(()=>{var t;null===(t=e.video)||void 0===t||t.resize()}));const t=[L.timeUpdate];Object.keys(L).forEach((i=>{e.on(L[i],(r=>{t.includes(i)||("object"!=typeof r||"[object Object]"!==Object.prototype.toString.call(r)?e.debug.log("player events",L[i],r):e.debug.log("player events",L[i],JSON.stringify(r)))}))})),Object.keys(M).forEach((t=>{e.on(M[t],(i=>{e.debug.log("player event error",M[t],i)}))}))})(this),(e=>{const{_opt:t,debug:i,events:{proxy:r}}=e;t.supportDblclickFullscreen&&r(e.$container,"dblclick",(t=>{const i=ee(t).nodeName.toLowerCase();"canvas"!==i&&"video"!==i||(e.fullscreen=!e.fullscreen)})),r(document,"visibilitychange",(()=>{t.hiddenAutoPause&&(i.log("visibilitychange",document.visibilityState,e._isPlayingBeforePageHidden),"visible"===document.visibilityState?e._isPlayingBeforePageHidden&&e.play():(e._isPlayingBeforePageHidden=e.playing,e.playing&&e.pause()))})),r(window,"fullscreenchange",(()=>{null!==e.keepScreenOn&&"visible"===document.visibilityState&&e.enableWakeLock&&e.enableWakeLock()}))})(this),this._fullscreen=!1,this.control=new Le(this)}set fullscreen(e){Z()&&this._opt.useWebFullScreen?(this.emit(L.webFullscreen,e),setTimeout((()=>{this.updateOption({rotate:e?270:0}),this.resize()}),10)):this.emit(L.fullscreen,e)}get fullscreen(){return this._fullscreen||this.webFullscreen}set webFullscreen(e){this.emit(L.webFullscreen,e)}get webFullscreen(){return this.$container.classList.contains("flv-fullscreen-web")}updateOption(e){this._opt=Object.assign({},this._opt,e)}resize(){this.$container.style.width=(this._opt.width||this.width)+"px",this.$container.style.height=(this._opt.height||this.height)+"px",this.video.resize()}}
|
|
36
24
|
/*
|
|
37
25
|
*
|
|
38
26
|
* @ezuikit/utils-collect v0.1.0-beta.1
|
|
39
27
|
* Copyright (c) 2024-7-11 Ezviz-OpenBiz
|
|
40
28
|
* Released under MIT the License.
|
|
41
29
|
*
|
|
42
|
-
*/var Bi,ki,Ci,Ri,Oi=(Bi="undefined"!=typeof self?self:window,ki={navigator:void 0!==Bi.navigator?Bi.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"]}},Ci={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=ki.navigator)?void 0:t.userAgent)||"",n=Ci.getMatchMap(i);for(var r in ki.infoMap)for(var o=0;o<ki.infoMap[r].length;o++){var a=ki.infoMap[r][o];n[a]&&(e[r]=a)}},getOS:function(){var e=this;return Ci.matchInfoMap(e),null==e?void 0:e.os},getOSVersion:function(){var e=this,t=ki.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",Ci.matchInfoMap(e),e.device},getNetwork:function(){var e,t,i,n;return null==(e=(null==(t=navigator)?void 0:t.connection)||(null==(i=navigator)?void 0:i.mozConnection)||(null==(n=navigator)?void 0:n.webkitConnection))?void 0:e.effectiveType},getLanguage:function(){var e,t,i;return this.language=((i=((null==(e=ki.navigator)?void 0:e.browserLanguage)||(null==(t=ki.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"),n=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(n,2,15),i.fillStyle="rgba(102, 204, 0, 0.7)",i.fillText(n,4,17);var r=t.toDataURL().replace("data:image/png;base64,","");return function(e){var t,i,n,r="";for(t=0,i=(e+="").length;t<i;t++)r+=(n=e.charCodeAt(t).toString(16)).length<2?"0"+n:n;return r}(atob(r).slice(-16,-12))},getBrowserInfo:function(){var e=this;Ci.matchInfoMap(e);var t=ki.navigator.userAgent||"",i=function(e,t){var i=ki.navigator.mimeTypes;for(var n in i)if(i[n][e]==t)return!0;return!1},n=Ci.getMatchMap(t),r=!1;if(Bi.chrome){var o=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");+o>36&&Bi.showModalDialog?r=!0:+o>45&&(r=i("type","application/vnd.chromium.remoting-viewer"))}if(n.Baidu&&n.Opera&&(n.Baidu=!1),n.Mobile&&(n.Mobile=!t.includes("iPad")),r&&(i("type","application/gameplugin")||ki.navigator&&void 0===ki.navigator.connection.saveData?n["360SE"]=!0:n["360EE"]=!0),n.IE||n.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:case 75:case 105:break;case 102:n["360EE"]=!0;break;case 104:n["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+")"}},Ri={DeviceInfoObj:function(e){var t,i=function(t){var i;null==(i=e.info)||i.forEach((function(e){e.toLowerCase()===t.toLowerCase()&&(r[t]=n[t])}))};e=e||{domain:""};var n={deviceType:Ci.getDeviceType(),OS:Ci.getOS(),OSVersion:Ci.getOSVersion(),sh:Bi.screen.height,sw:Bi.screen.width,lang:Ci.getLanguage(),netWork:Ci.getNetwork(),orientation:Ci.getOrientationStatu(),browserInfo:Ci.getBrowserInfo(),fingerprint:Ci.createFingerprint(e.domain),userAgent:null==(t=ki.navigator)?void 0:t.userAgent};if(!e.info||0===e.info.length)return n;var r={};for(var o in n)i(o);return r}},{getDeviceInfo:function(e){return Ri.DeviceInfoObj(e)}}),Ii=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}();Ii.isStop=!0,Ii.queues=[];var xi=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),n=new Image;n.onload=n.onerror=function(){n=null},n.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 n=e[i];t+=i+"="+encodeURIComponent("object"==typeof n?JSON.stringify(n):n)}return t},t.checkUrl=function(e){return!!e&&/^[hH][tT][tT][pP]([sS]?):\/\//.test(e)},e}();function Di(){return Di=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Di.apply(this,arguments)}var Li=function(){function e(e){this.options=e,this.extendsInfo=e.extendsInfo||{},this.clientInfo=this._getDeviceInfo(),Ii.api=new xi(e.url)}var t=e.prototype;return t.send=function(e){return this.options.forbidden||"object"!=typeof e||(this._handleRecordError(e),Ii.isStop&&Ii.fire()),this},t.setForbidden=function(e){this.options.forbidden=e},t.updateExtendsInfo=function(e){void 0===e&&(e={}),this.extendsInfo=Di({},this.extendsInfo||{},e)},t._handleRecordError=function(e){try{var t=this._handleErrorInfo(e);Ii.add(this.options.url,t)}catch(e){}},t._handleErrorInfo=function(e){var t=this._getExtendsInfo(),i=Di({st:(new Date).getTime()},t,e);return i.clientInfo=this.clientInfo,i},t._getExtendsInfo=function(){try{var e,t={},i=this.extendsInfo||{};for(var n in"function"==typeof i.getDynamic&&(e=i.getDynamic()),"[object Object]"===Object.prototype.toString.call(e)&&(i=Di({},i,e)),i)"function"!=typeof i[n]&&(t[n]=i[n]);return t}catch(e){return{}}},t._getDeviceInfo=function(){try{var e=Oi.getDeviceInfo();return JSON.stringify(e)}catch(e){return""}},e}();function Mi(e){if(/http[s]?:\/\/|ws[s]?:\/\//.test(e)){const t=e.split("?")[1],i=t?t.split("&"):[],n={};for(let e=0;e<i.length;++e){const[t,r]=i[e].split("=");n[t]=n[t]||decodeURIComponent(r)}try{const t=e.split(".flv")[0].split("/"),i=t[t.length-1].split("_");t.length>0&&i[0]&&i[1]&&i[2]&&(n.serial=i[0],n.no=i[1],n.bitstream=i[2])}catch(e){}return n}return{}}class Pi{static initMonitor(e){Pi.collect=new Li({forbidden:e,url:"https://log.ys7.com/statistics.do/opensdk_ezuikit",jsError:!1,promiseError:!1,resourceError:!1,extendsInfo:{protocol:"flv",v:"1.0.2"}})}static report(e,t={}){Pi.collect||Pi.initMonitor();try{const i=Mi(Pi.url);Pi.collect.send({url:Pi.url,serial:i.serial,no:i.no,action:e,logInfo:t})}catch(e){}}}class Ui extends Ti{constructor(e,t){super(e,t,ni),this._opt.useMSE=!1,this._opt.hasAudio&&(this.audio=new oi(this)),this.decoderWorker=new li(this),this.stream=null,this.demux=null,this._lastVolume=null,Qt()&&(this.keepScreenOn=new fi(this)),this._opt.hasAudio&&this._opt.volume>0&&(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 fullscreen(e){Qt()&&this._opt.useWebFullScreen?(this.emit(mt.webFullscreen,e),setTimeout((()=>{this.updateOption({rotate:e?270:0}),this.resize()}),10)):this.emit(mt.fullscreen,e)}get fullscreen(){return zt()||this.webFullscreen}set webFullscreen(e){this.emit(mt.webFullscreen,e)}get webFullscreen(){return this.$container.classList.contains("flv-fullscreen-web")}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(mt.playing,e),this.emit(mt.volumechange,this.volume),e?this.emit(mt.play):this.emit(mt.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(mt.loading,this._loading))}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(mt.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 di(this)),this.audio||this._opt.hasAudio&&(this.audio=new oi(this)),this.demux||(this.demux=new Ai(this)),this.decoderWorker?e():(this.decoderWorker=new li(this),this.once(mt.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=Nt(),this.init().then((()=>{this._times.playStart=Nt(),this._opt.isNotMute&&this.mute(!1),this.enableWakeLock();try{this.stream.fetchStream(this._opt.url,this._opt)}catch(e){}this.checkLoadingTimeout(),this.stream.once(gt.fetchError,(e=>{t(e)})),this.stream.once(gt.websocketError,(e=>{t(e)})),this.stream.once(mt.streamEnd,(()=>{t()})),this.stream.once(mt.streamSuccess,(()=>{e(),this._times.streamResponse=Nt(),this.video.play(),this.checkStatsInterval()}))})).catch((e=>{t(e)})),this._resumeAudioAfterPause()}))}close(){return new Promise((e=>{this._close().then((()=>{this.video&&this.video.clearView(),e()}))}))}_resumeAudioAfterPause(){this.lastVolume&&(this.volume=this.lastVolume)}_close(){return new Promise((e=>{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(e=!1){return e?this.close():this._close()}mute(e){this.volume=e?0:.5,this.audio&&this.audio.mute(e)}resize(){this.$container.style.width=(this._opt.width||this.width)+"px",this.$container.style.height=(this._opt.height||this.height)+"px",this.video.resize()}_onlyMseOrWcsVideo(){return!1===this._opt.hasAudio&&(this._opt.useMSE||this._opt.useWCS&&!this._opt.useOffscreen)}checkHeart(){this.clearCheckHeartTimeout(),this.checkHeartTimeout()}checkHeartTimeout(){this._checkHeartTimeout&&this.clearCheckHeartTimeout(),this._checkHeartTimeout=setTimeout((()=>{if(this._checkHeartTimeout&&this.clearCheckHeartTimeout(),this.playing){if(0!==this._stats.fps)return;this.pause().then((()=>{this.emit(mt.timeout,mt.delayTimeout),this.emit(mt.delayTimeout)}))}}),1e3*this._opt.heartTimeout)}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(mt.timeout,mt.loadingTimeout),this.emit(mt.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(mt.start),this.loading=!1),this.clearCheckLoadingTimeout(),this.playing||(this.playing=!0),this.checkHeart()}updateStats(e){e=e||{},this._startBpsTime||(this._startBpsTime=Nt()),qt(e.ts)&&(this._stats.ts=e.ts),qt(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=Nt();t-this._startBpsTime<1e3||(this.emit(mt.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(mt.playToRenderTimes,e)}getOption(){return this._opt}emitError(e,t=""){Pi.report(51,{event:e,value:t}),this.emit(mt.error,e,t),this.emit(e,t)}}var Fi={exports:{}};!function(e,t){!function(t,i){e.exports=i()}(globalThis,(()=>(()=>{var e={343:e=>{var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new r(n,o||e,a),d=i?i+t:t;return e._events[d]?e._events[d].fn?e._events[d]=[e._events[d],s]:e._events[d].push(s):(e._events[d]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,r,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var d,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){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,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,o),!0;case 6:return c.fn.call(c.context,t,n,r,o,a),!0}for(l=1,d=new Array(h-1);l<h;l++)d[l-1]=arguments[l];c.fn.apply(c.context,d)}else{var u,A=c.length;for(l=0;l<A;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,n);break;case 4:c[l].fn.call(c[l].context,t,n,r);break;default:if(!d)for(u=1,d=new Array(h-1);u<h;u++)d[u-1]=arguments[u];c[l].fn.apply(c[l].context,d)}}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,n,r){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||r&&!s.once||n&&s.context!==n||a(this,o);else{for(var d=0,l=[],c=s.length;d<c;d++)(s[d].fn!==t||r&&!s[d].once||n&&s[d].context!==n)&&l.push(s[d]);l.length?this._events[o]=1===l.length?l[0]:l: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 n,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},825:(e,t,i)=>{i.d(t,{A:()=>n});const n=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,n=e.length-1,r=0,o=0,a=n;for(t<e[0]&&(i=0,o=a+1);o<=a;){if((r=o+Math.floor((a-o)/2))===n||t>=e[r]&&t<e[r+1]){i=r;break}e[r]<t?o=r+1:a=r-1}return i},e}()},453:(e,t,i)=>{i.d(t,{$_:()=>n,EX:()=>o,EZ:()=>r,Sc:()=>a});var n=function(e,t,i,n,r){this.dts=e,this.pts=t,this.duration=i,this.originalDts=n,this.isSyncPoint=r,this.fileposition=null},r=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,n=t.length-1,r=0,o=0,a=n;for(e<t[0].dts&&(i=0,o=a+1);o<=a;){if((r=o+Math.floor((a-o)/2))===n||e>=t[r].dts&&e<t[r+1].dts){i=r;break}t[r].dts<e?o=r+1:a=r-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 n=i.length-1,r=0,o=0,a=n,s=0;if(e<i[0].originalBeginDts)return-1;for(;o<=a;){if((r=o+Math.floor((a-o)/2))===n||e>((null===(t=i[r].lastSample)||void 0===t?void 0:t.originalDts)||0)&&e<i[r+1].originalBeginDts){s=r;break}i[r].originalBeginDts<e?o=r+1:a=r-1}return s},e.prototype._searchNearestSegmentAfter=function(e){return this._searchNearestSegmentBefore(e)+1},e.prototype.append=function(e){var t,i,n=this._list,r=e,o=this._lastAppendLocation,a=0;-1!==o&&o<n.length&&r.originalBeginDts>=((null===(i=null===(t=n[o])||void 0===t?void 0:t.lastSample)||void 0===i?void 0:i.originalDts)||0)&&(o===n.length-1||o<n.length-1&&r.originalBeginDts<n[o+1].originalBeginDts)?a=o+1:n.length>0&&(a=this._searchNearestSegmentBefore(r.originalBeginDts)+1),this._lastAppendLocation=a,this._list.splice(a,0,r)},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}()},976:(e,t,i)=>{i.d(t,{A:()=>Me});var n=i(413),r=i(502),o=i(620),a=i(825);function s(e,t,i){var n=e;if(t+i<n.length){for(;i--;)if(128!=(192&n[++t]))return!1;return!0}return!1}const d=function(e){for(var t=[],i=e,n=0,r=e.length;n<r;)if(i[n]<128)t.push(String.fromCharCode(i[n])),++n;else{if(i[n]<192);else if(i[n]<224){if(s(i,n,1)&&(o=(31&i[n])<<6|63&i[n+1])>=128){t.push(String.fromCharCode(65535&o)),n+=2;continue}}else if(i[n]<240){if(s(i,n,2)&&(o=(15&i[n])<<12|(63&i[n+1])<<6|63&i[n+2])>=2048&&55296!=(63488&o)){t.push(String.fromCharCode(65535&o)),n+=3;continue}}else if(i[n]<248){var o;if(s(i,n,3)&&(o=(7&i[n])<<18|(63&i[n+1])<<12|(63&i[n+2])<<6|63&i[n+3])>65536&&o<1114112){o-=65536,t.push(String.fromCharCode(o>>>10|55296)),t.push(String.fromCharCode(1023&o|56320)),n+=4;continue}}t.push(String.fromCharCode(65533)),++n}return t.join("")};var l,c=i(713),h=(l=new ArrayBuffer(2),new DataView(l).setInt16(0,256,!0),256===new Int16Array(l)[0]);const u=function(){function e(){}return e.parseScriptData=function(t,i,n){var o={};try{var a=e.parseValue(t,i,n),s=e.parseValue(t,i+a.size,n-a.size);o[a.data]=s.data}catch(e){r.A.e("AMF",e.toString())}return o},e.parseObject=function(t,i,n){if(n<3)throw new c.j4("Data not enough when parse ScriptDataObject");var r=e.parseString(t,i,n),o=e.parseValue(t,i+r.size,n-r.size),a=o.objectEnd;return{data:{name:r.data,value:o.data},size:r.size+o.size,objectEnd:a}},e.parseVariable=function(t,i,n){return e.parseObject(t,i,n)},e.parseString=function(e,t,i){if(i<2)throw new c.j4("Data not enough when parse String");var n=new DataView(e,t,i).getUint16(0,!h);return{data:n>0?d(new Uint8Array(e,t+2,n)):"",size:2+n}},e.parseLongString=function(e,t,i){if(i<4)throw new c.j4("Data not enough when parse LongString");var n=new DataView(e,t,i).getUint32(0,!h);return{data:n>0?d(new Uint8Array(e,t+4,n)):"",size:4+n}},e.parseDate=function(e,t,i){if(i<10)throw new c.j4("Data size invalid when parse Date");var n=new DataView(e,t,i),r=n.getFloat64(0,!h),o=n.getInt16(8,!h);return{data:new Date(r+=60*o*1e3),size:10}},e.parseValue=function(t,i,n){if(n<1)throw new c.j4("Data not enough when parse Value");var o,a=new DataView(t,i,n),s=1,d=a.getUint8(0),l=!1;try{switch(d){case 0:o=a.getFloat64(1,!h),s+=8;break;case 1:o=!!a.getUint8(1),s+=1;break;case 2:var u=e.parseString(t,i+1,n-1);o=u.data,s+=u.size;break;case 3:o={};var A=0;for(9==(16777215&a.getUint32(n-4,!h))&&(A=3);s<n-4;){var p=e.parseObject(t,i+s,n-s-A);if(p.objectEnd)break;o[p.data.name]=p.data.value,s+=p.size}s<=n-3&&9==(16777215&a.getUint32(s-1,!h))&&(s+=3);break;case 8:for(o={},s+=4,A=0,9==(16777215&a.getUint32(n-4,!h))&&(A=3);s<n-8;){var _=e.parseVariable(t,i+s,n-s-A);if(_.objectEnd)break;o[_.data.name]=_.data.value,s+=_.size}s<=n-3&&9==(16777215&a.getUint32(s-1,!h))&&(s+=3);break;case 9:o=void 0,s=1,l=!0;break;case 10:o=[];var f=a.getUint32(1,!h);s+=4;for(var m=0;m<f;m++){var v=e.parseValue(t,i+s,n-s);o.push(v.data),s+=v.size}break;case 11:var g=e.parseDate(t,i+1,n-1);o=g.data,s+=g.size;break;case 12:var y=e.parseString(t,i+1,n-1);o=y.data,s+=y.size;break;default:s=n,r.A.w("AMF","Unsupported AMF value type "+d.toString())}}catch(e){r.A.e("AMF",e.toString())}return{data:o,size:s,objectEnd:l}},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),n=new Uint8Array(4);n.set(null===(e=this._buffer)||void 0===e?void 0:e.subarray(this._buffer_index,this._buffer_index+i)),this._current_word=new DataView(n.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 n=e-this._current_word_bits_left;this._fillCurrentWord();var r=Math.min(n,this._current_word_bits_left),o=this._current_word>>>32-r;return this._current_word<<=r,this._current_word_bits_left-=r,i<<r|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,n=new Uint8Array(i),r=0,o=0;o<i;o++)o>=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(n[r]=t[o],r++);return new Uint8Array(n.buffer,0,r)},e.parseSPS=function(t){for(var i=t.subarray(1,4),n="avc1.",r=0;r<3;r++){var o=i[r].toString(16);o.length<2&&(o="0"+o),n+=o}var a=e._ebsp2rbsp(t),s=new A(a);s.readByte();var d=s.readByte();s.readByte();var l=s.readByte();s.readUEG();var c=e.getProfileString(d),h=e.getLevelString(l),u=1,p=420,_=8,f=8;if((100===d||110===d||122===d||244===d||44===d||83===d||86===d||118===d||128===d||138===d||144===d)&&(3===(u=s.readUEG())&&s.readBits(1),u<=3&&(p=[0,420,422,444][u]),_=s.readUEG()+8,f=s.readUEG()+8,s.readBits(1),s.readBool()))for(var m=3!==u?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 E=s.readUEG(),S=s.readUEG(),w=s.readBits(1);0===w&&s.readBits(1),s.readBits(1);var T=0,B=0,k=0,C=0;s.readBool()&&(T=s.readUEG(),B=s.readUEG(),k=s.readUEG(),C=s.readUEG());var R=1,O=1,I=0,x=!0,D=0,L=0;if(s.readBool()){if(s.readBool()){var M=s.readByte();M>0&&M<16?(R=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][M-1],O=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][M-1]):255===M&&(R=s.readByte()<<8|s.readByte(),O=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);x=s.readBool(),I=(D=U)/(L=2*P)}}var F=1;1===R&&1===O||(F=R/O);var V=0,N=0;0===u?(V=1,N=2-w):(V=3===u?1:2,N=(1===u?2:1)*(2-w));var G=16*(E+1),W=16*(S+1)*(2-w);G-=(T+B)*V,W-=(k+C)*N;var j=Math.ceil(G*F);return s.destroy(),s=null,{codec_mimetype:n,profile_idc:d,level_idc:l,profile_string:c,level_string:h,chroma_format_idc:u,bit_depth:_,bit_depth_luma:_,bit_depth_chroma:f,ref_frames:b,chroma_format:p,chroma_format_string:e.getChromaFormatString(p),frame_rate:{fixed:x,fps:I,fps_den:L,fps_num:D},sar_ratio:{width:R,height:O},codec_size:{width:G,height:W},present_size:{width:j,height:W}}},e._skipScalingList=function(e,t){for(var i=8,n=8,r=0;r<t;r++)0!==n&&(n=(i+e.readSEG()+256)%256),i=0===n?i:n},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 _=i(465);const f=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),r=0,o=0;o<i;o++)o>=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(n[r]=t[o],r++);return new Uint8Array(n.buffer,0,r)},e.parseVPS=function(t){var i=e._ebsp2rbsp(t),n=new A(i);return n.readByte(),n.readByte(),n.readBits(4),n.readBits(2),n.readBits(6),{num_temporal_layers:n.readBits(3)+1,temporal_id_nested:n.readBool()}},e.parseSPS=function(t){var i=e._ebsp2rbsp(t),n=new A(i);n.readByte(),n.readByte();for(var r=0,o=0,a=0,s=0,d=(n.readBits(4),n.readBits(3)),l=(n.readBool(),n.readBits(2)),c=n.readBool(),h=n.readBits(5),u=n.readByte(),p=n.readByte(),_=n.readByte(),f=n.readByte(),m=n.readByte(),v=n.readByte(),g=n.readByte(),y=n.readByte(),b=n.readByte(),E=n.readByte(),S=n.readByte(),w=[],T=[],B=0;B<d;B++)w.push(n.readBool()),T.push(n.readBool());if(d>0)for(B=d;B<8;B++)n.readBits(2);for(B=0;B<d;B++)w[B]&&(n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte()),T[B]&&n.readByte();n.readUEG();var k=n.readUEG();3===k&&n.readBits(1);var C=n.readUEG(),R=n.readUEG();n.readBool()&&(r+=n.readUEG(),o+=n.readUEG(),a+=n.readUEG(),s+=n.readUEG());var O=n.readUEG(),I=n.readUEG(),x=n.readUEG();for(B=n.readBool()?0:d;B<=d;B++)n.readUEG(),n.readUEG(),n.readUEG();if(n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readBool()&&n.readBool())for(var D=0;D<4;D++)for(var L=0;L<(3===D?2:6);L++)if(n.readBool()){var M=Math.min(64,1<<4+(D<<1));for(D>1&&n.readSEG(),B=0;B<M;B++)n.readSEG()}else n.readUEG();n.readBool(),n.readBool(),n.readBool()&&(n.readByte(),n.readUEG(),n.readUEG(),n.readBool());var P=n.readUEG(),U=0;for(B=0;B<P;B++){var F=!1;if(0!==B&&(F=n.readBool()),F){B===P&&n.readUEG(),n.readBool(),n.readUEG();for(var V=0,N=0;N<=U;N++){var G=n.readBool(),W=!1;G||(W=n.readBool()),(G||W)&&V++}U=V}else{var j=n.readUEG(),Q=n.readUEG();for(U=j+Q,N=0;N<j;N++)n.readUEG(),n.readBool();for(N=0;N<Q;N++)n.readUEG(),n.readBool()}}if(n.readBool()){var z=n.readUEG();for(B=0;B<z;B++){for(N=0;N<x+4;N++)n.readBits(1);n.readBits(1)}}var H=0,q=1,X=1,$=!1,Y=1,Z=1;if(n.readBool(),n.readBool(),n.readBool()){if(n.readBool()){var K=n.readByte();K>0&&K<=16?(q=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][K-1],X=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][K-1]):255===K&&(q=n.readBits(16),X=n.readBits(16))}if(n.readBool()&&n.readBool(),n.readBool()&&(n.readBits(3),n.readBool(),n.readBool()&&(n.readByte(),n.readByte(),n.readByte())),n.readBool()&&(n.readUEG(),n.readUEG()),n.readBool(),n.readBool(),n.readBool(),n.readBool()&&(n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG()),n.readBool()&&(Y=n.readBits(32),Z=n.readBits(32),n.readBool()&&n.readUEG(),n.readBool())){var J,ee,te=!1;for(J=n.readBool(),ee=n.readBool(),(J||ee)&&((te=n.readBool())&&(n.readByte(),n.readBits(5),n.readBool(),n.readBits(5)),n.readBits(4),n.readBits(4),te&&n.readBits(4),n.readBits(5),n.readBits(5),n.readBits(5)),B=0;B<=d;B++){var ie=n.readBool();$=ie;var ne=!1,re=1;ie||(ne=n.readBool());var oe=!1;if(ne?n.readSEG():oe=n.readBool(),oe||(re=n.readUEG()+1),J)for(N=0;N<re;N++)n.readUEG(),n.readUEG(),te&&(n.readUEG(),n.readUEG());if(ee)for(N=0;N<re;N++)n.readUEG(),n.readUEG(),te&&(n.readUEG(),n.readUEG())}}n.readBool()&&(n.readBool(),n.readBool(),n.readBool(),H=n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG())}n.readBool();var ae="hvc1.".concat(h,".1.L").concat(S,".B0"),se=C-(r+o)*(1===k||2===k?2:1),de=R-(a+s)*(1===k?2:1),le=1;return 1!==q&&1!==X&&(le=q/X),n.destroy(),n=null,{codec_mimetype:ae,level_string:e.getLevelString(S),profile_idc:h,bit_depth:O+8,ref_frames:1,chroma_format:k,chroma_format_string:e.getChromaFormatString(k),general_level_idc:S,general_profile_space:l,general_tier_flag:c,general_profile_idc:h,general_profile_compatibility_flags_1:u,general_profile_compatibility_flags_2:p,general_profile_compatibility_flags_3:_,general_profile_compatibility_flags_4:f,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:E,min_spatial_segmentation_idc:H,constant_frame_rate:0,chroma_format_idc:k,bit_depth_luma_minus8:O,bit_depth_chroma_minus8:I,frame_rate:{fixed:$,fps:Z/Y,fps_den:Y,fps_num:Z},sar_ratio:{width:q,height:X},codec_size:{width:se,height:de},present_size:{width:se*le,height:de}}},e.parsePPS=function(t){var i=e._ebsp2rbsp(t),n=new A(i);n.readByte(),n.readByte(),n.readUEG(),n.readUEG(),n.readBool(),n.readBool(),n.readBits(3),n.readBool(),n.readBool(),n.readUEG(),n.readUEG(),n.readSEG(),n.readBool(),n.readBool(),n.readBool()&&n.readUEG(),n.readSEG(),n.readSEG(),n.readBool(),n.readBool(),n.readBool(),n.readBool();var r=n.readBool(),o=n.readBool(),a=1;return o&&r?a=0:o?a=3:r&&(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,n=0;n<t.byteLength;){t[n];var r=(120&t[n])>>3,o=!!(4&t[n]),a=!!(2&t[n]);t[n],n+=1,o&&(n+=1);var s=Number.POSITIVE_INFINITY;if(a){s=0;for(var d=0;s|=(127&t[n])<<7*d,128&t[n+=1];d++);}1===r&&(i=e.parseSeuqneceHeader(t.subarray(n,n+s))),n+=s}return i},e.parseSeuqneceHeader=function(t){var i=new A(t),n=i.readBits(3),r=(i.readBool(),i.readBool()),o=!0,a=0,s=0,d=[];if(r)d.push({operating_point_idc:0,level:i.readBits(5),tier:0});else{if(i.readBool()){var l=i.readBits(32),c=i.readBits(32),h=i.readBool();if(h){for(var u=0;0===i.readBits(1);)u+=1;u>=32||i.readBits(u)}a=c,s=l,o=h,i.readBool()&&(i.readBits(5),i.readBits(32),i.readBits(5),i.readBits(5))}for(var p=i.readBool(),_=i.readBits(5),f=0;f<=_;f++){var m=i.readBits(12),v=i.readBits(5),g=v>7?i.readBits(1):0;d.push({operating_point_idc:m,level:v,tier:g}),p&&i.readBool()&&i.readBits(4)}}var y=d[0],b=y.level,E=y.tier,S=i.readBits(4),w=i.readBits(4),T=i.readBits(S+1)+1,B=i.readBits(w+1)+1,k=!1;r||(k=i.readBool()),k&&(i.readBits(4),i.readBits(4)),i.readBool(),i.readBool(),i.readBool();var C=!1;r||(i.readBool(),i.readBool(),i.readBool(),i.readBool(),(C=i.readBool())&&(i.readBool(),i.readBool()),(i.readBool()||i.readBits(1))&&(i.readBool()||i.readBits(1)),C&&i.readBits(3)),i.readBool(),i.readBool(),i.readBool();var R=i.readBool(),O=8;O=2===n&&R?i.readBool()?12:10:R?10:8;var I=!1;1!==n&&(I=i.readBool()),i.readBool()&&(i.readBits(8),i.readBits(8),i.readBits(8));var x=1,D=1;return I?(i.readBits(1),x=1,D=1):(i.readBits(1),0===n?(x=1,D=1):1===n?(x=0,D=0):12===O?i.readBits(1)&&i.readBits(1):(x=1,D=0),x&&D&&i.readBits(2),i.readBits(1)),i.readBool(),i.destroy(),i=null,{codec_mimetype:"av01.".concat(n,".").concat(e.getLevelString(b,E),".").concat(O.toString(10).padStart(2,"0")),level:b,tier:E,level_string:e.getLevelString(b,E),profile_idc:n,profile_string:"".concat(n),bit_depth:O,ref_frames:1,chroma_format:e.getChromaFormat(I,x,D),chroma_format_string:e.getChromaFormatString(I,x,D),frame_rate:{fixed:o,fps:a/s,fps_den:s,fps_num:a},sar_ratio:{width:1,height:1},codec_size:{width:T,height:B},present_size:{width:1*T,height:B}}},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 E=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 n,r=(4&t[4])>>>2!=0,o=!!(1&t[4]),a=(n=t)[5]<<24|n[6]<<16|n[7]<<8|n[8];return a<9?i:{match:!0,consumed:a,dataOffset:a,hasAudioTrack:r,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 n,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 d=e.probe(t);a=(null==d?void 0:d.dataOffset)||0}for(this._firstParse&&(this._firstParse=!1,i+a!==this._dataOffset&&r.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(l=new DataView(t,a)).getUint32(0,!s)&&r.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),a+=4);a<t.byteLength;){this._dispatch=!0;var l=new DataView(t,a);if(a+11+4>t.byteLength)break;var h=l.getUint8(0),u=16777215&l.getUint32(0,!s);if(a+11+u+4>t.byteLength)break;if(8===h||9===h||18===h){var A=l.getUint8(4),p=l.getUint8(5),_=l.getUint8(6)|p<<8|A<<16|l.getUint8(7)<<24;16777215&l.getUint32(7,!s)&&r.A.w(this.TAG,"Meet tag which has StreamID != 0!");var f=a+11;switch(h){case 8:this._parseAudioData(t,f,u,_);break;case 9:this._parseVideoData(t,f,u,_,i+a);break;case 18:this._parseScriptData(t,f,u)}var m=l.getUint32(11+u,!s);m!==11+u&&r.A.w(this.TAG,"Invalid PrevTagSize ".concat(m)),a+=11+u+4}else r.A.w(this.TAG,"Unsupported tag type ".concat(h,", skipped")),a+=11+u+4}return this._isInitialMetadataDispatched()&&this._dispatch&&((null===(n=this._audioTrack)||void 0===n?void 0:n.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 n,o,a,s=u.parseScriptData(e,t,i);if(s.hasOwnProperty("onMetaData")){if(null==s.onMetaData||"object"!=typeof s.onMetaData)return void r.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&r.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=s;var d=null===(n=this._metadata)||void 0===n?void 0:n.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},d)),"boolean"==typeof(null==d?void 0:d.hasAudio)&&(this._hasAudioFlagOverrided||(this._hasAudio=d.hasAudio,this._mediaInfo&&(this._mediaInfo.hasAudio=this._hasAudio))),"boolean"==typeof(null==d?void 0:d.hasVideo)&&(this._hasVideoFlagOverrided||(this._hasVideo=d.hasVideo,this._mediaInfo&&(this._mediaInfo.hasVideo=this._hasVideo))),"number"==typeof(null==d?void 0:d.audiodatarate)&&this._mediaInfo&&(this._mediaInfo.audioDataRate=d.audiodatarate),"number"==typeof(null==d?void 0:d.videodatarate)&&this._mediaInfo&&(this._mediaInfo.videoDataRate=d.videodatarate),"number"==typeof(null==d?void 0:d.width)&&this._mediaInfo&&(this._mediaInfo.width=d.width),"number"==typeof(null==d?void 0:d.height)&&this._mediaInfo&&(this._mediaInfo.height=d.height),"number"==typeof(null==d?void 0:d.duration)){if(!this._durationOverrided){var l=Math.floor(d.duration*this._timescale);this._duration=l,this._mediaInfo&&(this._mediaInfo.duration=l)}}else this._mediaInfo&&(this._mediaInfo.duration=0);if("number"==typeof(null==d?void 0:d.framerate)){var c=Math.floor(1e3*d.framerate);if(c>0){var h=c/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=h,this._referenceFrameRate.fps_num=c,this._referenceFrameRate.fps_den=1e3,this._mediaInfo&&(this._mediaInfo.fps=h)}}if("object"==typeof(null==d?void 0:d.keyframes)){this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!0);var A=d.keyframes;this._mediaInfo&&(this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(A)),d.keyframes=null}else this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!1);this._dispatch=!1,this._mediaInfo&&(this._mediaInfo.metadata=d),r.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=[],n=1;n<e.times.length;n++){var r=this._timestampBase+Math.floor(1e3*e.times[n]);t.push(r),i.push(e.filepositions[n])}return{times:t,filepositions:i}},e.prototype._parseAudioData=function(e,t,i,n){var o,a,s,d,l,c,h,u,A,p;if(i<=1)r.A.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(!this._hasAudioFlagOverrided||!1!==this._hasAudio){this._littleEndian;var f=new DataView(e,t,i).getUint8(0),m=f>>>4;if(2===m||10===m){var v=0,g=(12&f)>>>2;if(g>=0&&g<=4){v=this._flvSoundRateTable[g];var b=1&f,E=this._audioMetadata,S=this._audioTrack;if(E||(!1!==this._hasAudio||this._hasAudioFlagOverrided||(this._hasAudio=!0,this._mediaInfo&&(this._mediaInfo.hasAudio=!0)),(E=this._audioMetadata={}).type="audio",E.id=null==S?void 0:S.id,E.timescale=this._timescale,E.duration=this._duration,E.audioSampleRate=v,E.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==E?void 0:E.config){if(y(w.data.config,null==E?void 0:E.config))return;r.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var T=w.data;E.audioSampleRate=null==T?void 0:T.samplingRate,E.channelCount=null==T?void 0:T.channelCount,E.codec=null==T?void 0:T.codec,E.originalCodec=null==T?void 0:T.originalCodec,E.config=null==T?void 0:T.config,E.refSampleDuration=1024/E.audioSampleRate*E.timescale,r.A.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(d=this._videoTrack)||void 0===d?void 0:d.length))&&(null===(l=this._onDataAvailable)||void 0===l||l.call(this,this._audioTrack,this._videoTrack)):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,null===(c=this._onTrackMetadata)||void 0===c||c.call(this,"audio",E),(C=this._mediaInfo).audioCodec=E.originalCodec||"",C.audioSampleRate=E.audioSampleRate,C.audioChannelCount=E.channelCount,C.hasVideo?null!=C.videoCodec&&(C.mimeType='video/x-flv; codecs="'+C.videoCodec+","+C.audioCodec+'"'):C.mimeType='video/x-flv; codecs="'+C.audioCodec+'"',(null==C?void 0:C.isComplete())&&(null===(h=this._onMediaInfo)||void 0===h||h.call(this,C))}else if(1===w.packetType){var B=this._timestampBase+n,k={unit:w.data,length:w.data.byteLength,dts:B,pts:B};S&&(null==S||S.samples.push(k),S.length+=(null===(u=null==w?void 0:w.data)||void 0===u?void 0:u.length)||0)}else r.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(w.packetType))}else if(2===m){if(!E.codec){var C;if(void 0===(T=this._parseMP3AudioData(e,t+1,i-1,!0)))return;E.audioSampleRate=T.samplingRate,E.channelCount=T.channelCount,E.codec=T.codec,E.originalCodec=T.originalCodec,E.refSampleDuration=1152/E.audioSampleRate*E.timescale,r.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,null===(A=this._onTrackMetadata)||void 0===A||A.call(this,"audio",E),(C=this._mediaInfo).audioCodec=E.codec,C.audioSampleRate=E.audioSampleRate,C.audioChannelCount=E.channelCount,C.audioDataRate=T.bitRate,(null==C?void 0:C.hasVideo)?null!=C.videoCodec&&(C.mimeType='video/x-flv; codecs="'+C.videoCodec+","+C.audioCodec+'"'):C.mimeType='video/x-flv; codecs="'+C.audioCodec+'"',C.isComplete()&&(null===(p=this._onMediaInfo)||void 0===p||p.call(this,C))}var R=this._parseMP3AudioData(e,t+1,i-1,!1);if(void 0===R)return;B=this._timestampBase+n;var O={unit:R,length:R.byteLength,dts:B,pts:B};null==S||S.samples.push(O),S&&(S.length+=R.length)}}else null===(a=this._onError)||void 0===a||a.call(this,_.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+g)}else null===(o=this._onError)||void 0===o||o.call(this,_.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+m)}},e.prototype._parseAACAudioData=function(e,t,i){if(!(i<=1)){var n={},o=new Uint8Array(e,t,i);return n.packetType=o[0],0===o[0]?n.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):n.data=o.subarray(1),n}r.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,i){var n,r,o,a,s=new Uint8Array(e,t,i),d=null,l=0,c=null;if(l=o=s[0]>>>3,(a=(7&s[0])<<1|s[1]>>>7)<0||a>=this._mpegSamplingRates.length)null===(n=this._onError)||void 0===n||n.call(this,_.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var h=this._mpegSamplingRates[a],u=(120&s[1])>>>3;if(!(u<0||u>=8)){5===l&&(c=(7&s[1])<<1|s[2]>>>7,s[2]);var A=self.navigator.userAgent.toLowerCase();return A.includes("firefox")?a>=6?(l=5,d=new Array(4),c=a-3):(l=2,d=new Array(2),c=a):A.includes("android")?(l=2,d=new Array(2),c=a):(l=5,c=a,d=new Array(4),a>=6?c=a-3:1===u&&(l=2,d=new Array(2),c=a)),d[0]=l<<3,d[0]|=(15&a)>>>1,d[1]=(15&a)<<7,d[1]|=(15&u)<<3,5===l&&(d[1]|=(15&c)>>>1,d[2]=(1&c)<<7,d[2]|=8,d[3]=0),{config:d,samplingRate:h,channelCount:u,codec:"mp4a.40."+l,originalCodec:"mp4a.40."+o}}null===(r=this._onError)||void 0===r||r.call(this,_.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,i,n){if(!(i<4)){this._littleEndian;var o,a=new Uint8Array(e,t,i);if(n){if(255!==a[0])return;var s=a[1]>>>3&3,d=(6&a[1])>>1,l=(240&a[2])>>>4,c=(12&a[2])>>>2,h=3&~(a[3]>>>6)?2:1,u=0,A=0;switch(s){case 0:u=this._mpegAudioV25SampleRateTable[c];break;case 2:u=this._mpegAudioV20SampleRateTable[c];break;case 3:u=this._mpegAudioV10SampleRateTable[c]}switch(d){case 1:l<this._mpegAudioL3BitRateTable.length&&(A=this._mpegAudioL3BitRateTable[l]);break;case 2:l<this._mpegAudioL2BitRateTable.length&&(A=this._mpegAudioL2BitRateTable[l]);break;case 3:l<this._mpegAudioL1BitRateTable.length&&(A=this._mpegAudioL1BitRateTable[l])}o={bitRate:A,samplingRate:u,channelCount:h,codec:"mp3",originalCodec:"mp3"}}else o=a;return o}r.A.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")},e.prototype._parseVideoData=function(e,t,i,n,o){var a,s;if(i<=1)r.A.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(!this._hasVideoFlagOverrided||!1!==this._hasVideo){var d=new Uint8Array(e,t,i)[0],l=(112&d)>>>4;if(128&d){var c=15&d,h=String.fromCharCode.apply(String,function(e,t,i){if(2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}([],function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}(new Uint8Array(e,t,i).slice(1,5)),!1));"hvc1"===h?this._parseEnhancedHEVCVideoPacket(e,t+5,i-5,n,o,l,c):"av01"===h?this._parseEnhancedAV1VideoPacket(e,t+5,i-5,n,o,l,c):null===(s=this._onError)||void 0===s||s.call(this,_.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(h))}else{var u=15&d;7===u?this._parseAVCVideoPacket(e,t+1,i-1,n,o,l):12===u?this._parseHEVCVideoPacket(e,t+1,i-1,n,o,l):null===(a=this._onError)||void 0===a||a.call(this,_.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(u))}}},e.prototype._parseAVCVideoPacket=function(e,t,i,n,o,a){var s;if(i<4)r.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var d=this._littleEndian,l=new DataView(e,t,i),c=l.getUint8(0),h=(16777215&l.getUint32(0,!d))<<8>>8;0===c?this._parseAVCDecoderConfigurationRecord(e,t+4,i-4):1===c?this._parseAVCVideoData(e,t+4,i-4,n,o,a,h):2===c||null===(s=this._onError)||void 0===s||s.call(this,_.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(c))}},e.prototype._parseHEVCVideoPacket=function(e,t,i,n,o,a){var s;if(i<4)r.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var d=this._littleEndian,l=new DataView(e,t,i),c=l.getUint8(0),h=(16777215&l.getUint32(0,!d))<<8>>8;0===c?this._parseHEVCDecoderConfigurationRecord(e,t+4,i-4):1===c?this._parseHEVCVideoData(e,t+4,i-4,n,o,a,h):2===c||null===(s=this._onError)||void 0===s||s.call(this,_.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(c))}},e.prototype._parseEnhancedHEVCVideoPacket=function(e,t,i,n,r,o,a){var s,d=this._littleEndian,l=new DataView(e,t,i);if(0===a)this._parseHEVCDecoderConfigurationRecord(e,t,i);else if(1===a){var c=(4294967040&l.getUint32(0,!d))>>8;this._parseHEVCVideoData(e,t+3,i-3,n,r,o,c)}else 3===a?this._parseHEVCVideoData(e,t,i,n,r,o,0):2===a||null===(s=this._onError)||void 0===s||s.call(this,_.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(a))},e.prototype._parseEnhancedAV1VideoPacket=function(e,t,i,n,r,o,a){var s,d;this._littleEndian,0===a?this._parseAV1CodecConfigurationRecord(e,t,i):1===a?this._parseAV1VideoData(e,t,i,n,r,o,0):5===a?null===(s=this._onError)||void 0===s||s.call(this,_.A.FORMAT_ERROR,"Flv: Not Suported MP2T AV1 video packet type ".concat(a)):2===a||null===(d=this._onError)||void 0===d||d.call(this,_.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(a))},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,i){var n,o,a,s,d,l,c,h,u,A,f;if(i<7)r.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 E=new Uint8Array(e,t,i);if(y(E,m.avcc))return;r.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 S=b.getUint8(0),w=b.getUint8(1);if(b.getUint8(2),b.getUint8(3),1===S&&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&&r.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(T));for(var B=6,k=0;k<T;k++){var C=b.getUint16(B,!g);if(B+=2,0!==C){var R=new Uint8Array(e,t+B,C);B+=C;var O=p.parseSPS(R);if(0===k){m.codecWidth=O.codec_size.width,m.codecHeight=O.codec_size.height,m.presentWidth=O.present_size.width,m.presentHeight=O.present_size.height,m.profile=O.profile_string,m.level=O.level_string,m.bitDepth=O.bit_depth,m.chromaFormat=O.chroma_format,m.sarRatio=O.sar_ratio,m.frameRate=O.frame_rate,O.frame_rate.fixed&&0!==O.frame_rate.fps_num&&0!==O.frame_rate.fps_den||(m.frameRate=this._referenceFrameRate);var I=null===(s=m.frameRate)||void 0===s?void 0:s.fps_den,x=null===(d=m.frameRate)||void 0===d?void 0:d.fps_num;m.refSampleDuration=m.timescale*(I/x);for(var D=R.subarray(1,4),L="avc1.",M=0;M<3;M++){var P=D[M].toString(16);P.length<2&&(P="0"+P),L+=P}m.codec=L;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=O.ref_frames,U.chromaFormat=O.chroma_format_string,U.sarNum=m.sarRatio.width,U.sarDen=m.sarRatio.height,U.videoCodec=L,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===(l=this._onMediaInfo)||void 0===l||l.call(this,U))}}}var F=b.getUint8(B);if(0!==F){for(F>1&&r.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(F)),B++,k=0;k<F;k++)C=b.getUint16(B,!g),B+=2,0!==C&&(B+=C);m.avcc=new Uint8Array(i),m.avcc.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(h=this._audioTrack)||void 0===h?void 0:h.length)||(null===(u=this._videoTrack)||void 0===u?void 0:u.length))&&(null===(A=this._onDataAvailable)||void 0===A||A.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(f=this._onTrackMetadata)||void 0===f||f.call(this,"video",m)}else null===(c=this._onError)||void 0===c||c.call(this,_.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else null===(a=this._onError)||void 0===a||a.call(this,_.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else null===(o=this._onError)||void 0===o||o.call(this,_.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else null===(n=this._onError)||void 0===n||n.call(this,_.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}},e.prototype._parseHEVCDecoderConfigurationRecord=function(e,t,i){var n,o,a,s,d,l,c;if(i<22)r.A.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");else{var h=this._videoMetadata,u=this._videoTrack,A=this._littleEndian,p=new DataView(e,t,i);if(h){if(void 0!==h.hvcc){var m=new Uint8Array(e,t,i);if(y(m,h.hvcc))return;r.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)),(h=this._videoMetadata={}).type="video",h.id=null==u?void 0:u.id,h.timescale=this._timescale,h.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),E=0,S=23;E<b;E++){var w=63&p.getUint8(S+0),T=p.getUint16(S+1,!A);S+=3;for(var B=0;B<T;B++){var k=p.getUint16(S+0,!A);if(0===B)if(33===w){S+=2;var C=new Uint8Array(e,t+S,k),R=f.parseSPS(C);h.codecWidth=R.codec_size.width,h.codecHeight=R.codec_size.height,h.presentWidth=R.present_size.width,h.presentHeight=R.present_size.height,h.profile=null==R?void 0:R.profile_string,h.level=R.level_string,h.bitDepth=R.bit_depth,h.chromaFormat=R.chroma_format,h.sarRatio=R.sar_ratio,h.frameRate=R.frame_rate,R.frame_rate.fixed&&0!==R.frame_rate.fps_num&&0!==R.frame_rate.fps_den||(h.frameRate=this._referenceFrameRate);var O=h.frameRate.fps_den,I=h.frameRate.fps_num;h.refSampleDuration=h.timescale*(O/I),h.codec=R.codec_mimetype;var x=this._mediaInfo;x.width=h.codecWidth,x.height=h.codecHeight,x.fps=h.frameRate.fps,x.profile=h.profile,x.level=h.level,x.refFrames=R.ref_frames,x.chromaFormat=R.chroma_format_string,x.sarNum=h.sarRatio.width,x.sarDen=h.sarRatio.height,x.videoCodec=R.codec_mimetype,x.hasAudio?null!=x.audioCodec&&(x.mimeType='video/x-flv; codecs="'+x.videoCodec+","+x.audioCodec+'"'):x.mimeType='video/x-flv; codecs="'+x.videoCodec+'"',x.isComplete()&&(null===(a=this._onMediaInfo)||void 0===a||a.call(this,x)),S+=k}else S+=2+k;else S+=2+k}}h.hvcc=new Uint8Array(i),h.hvcc.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed HEVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(d=this._videoTrack)||void 0===d?void 0:d.length))&&(null===(l=this._onDataAvailable)||void 0===l||l.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(c=this._onTrackMetadata)||void 0===c||c.call(this,"video",h)}else null===(o=this._onError)||void 0===o||o.call(this,_.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else null===(n=this._onError)||void 0===n||n.call(this,_.A.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord")}},e.prototype._parseAV1CodecConfigurationRecord=function(e,t,i){var n,o,a,s,d,l,c,h,u,A,p;if(i<4)r.A.w(this.TAG,"Flv: Invalid AV1CodecConfigurationRecord, lack of data!");else{var f=this._videoMetadata,m=this._videoTrack,v=(this._littleEndian,new DataView(e,t,i));f?void 0!==f.av1c&&r.A.w(this.TAG,"Found another AV1CodecConfigurationRecord!"):(!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(f=this._videoMetadata={}).type="video",f.id=null==m?void 0:m.id,f.timescale=this._timescale,f.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){f.codecWidth=null===(a=null==y?void 0:y.codec_size)||void 0===a?void 0:a.width,f.codecHeight=null===(s=null==y?void 0:y.codec_size)||void 0===s?void 0:s.height,f.presentWidth=null===(d=null==y?void 0:y.present_size)||void 0===d?void 0:d.width,f.presentHeight=null===(l=null==y?void 0:y.present_size)||void 0===l?void 0:l.height,f.profile=y.profile_string,f.level=y.level_string,f.bitDepth=y.bit_depth,f.chromaFormat=y.chroma_format,f.sarRatio=y.sar_ratio,f.frameRate=y.frame_rate,y.frame_rate.fixed&&0!==y.frame_rate.fps_num&&0!==y.frame_rate.fps_den||(f.frameRate=this._referenceFrameRate);var E=f.frameRate.fps_den,S=f.frameRate.fps_num;f.refSampleDuration=f.timescale*(E/S),f.codec=y.codec_mimetype;var w=this._mediaInfo;w.width=f.codecWidth,w.height=f.codecHeight,w.fps=f.frameRate.fps,w.profile=f.profile,w.level=f.level,w.refFrames=y.ref_frames,w.chromaFormat=y.chroma_format_string,w.sarNum=f.sarRatio.width,w.sarDen=f.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)),f.av1c=new Uint8Array(i),f.av1c.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed AV1CodecConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(h=this._audioTrack)||void 0===h?void 0:h.length)||(null===(u=this._videoTrack)||void 0===u?void 0:u.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",f)}else null===(o=this._onError)||void 0===o||o.call(this,_.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}else null===(n=this._onError)||void 0===n||n.call(this,_.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}},e.prototype._parseAVCVideoData=function(e,t,i,n,o,a,s){for(var d=this._littleEndian,l=new DataView(e,t,i),c=[],h=0,u=0,A=this._naluLengthSize,p=this._timestampBase+n,_=1===a;u<i;){if(u+4>=i){r.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(u,", dataSize = ").concat(i));break}var f=l.getUint32(u,!d);if(3===A&&(f>>>=8),f>i-A)return void r.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var m=31&l.getUint8(u+A);5===m&&(_=!0);var v=new Uint8Array(e,t+u,A+f),g={type:m,data:v};c.push(g),h+=v.byteLength,u+=A+f}if(c.length){var y=this._videoTrack,b={units:c,length:h,isKeyframe:_,dts:p,cts:s,pts:p+s};_&&(b.fileposition=o),y&&(y.samples.push(b),y.length+=h)}},e.prototype._parseHEVCVideoData=function(e,t,i,n,o,a,s){for(var d=this._littleEndian,l=new DataView(e,t,i),c=[],h=0,u=0,A=this._naluLengthSize,p=this._timestampBase+n,_=1===a;u<i;){if(u+4>=i){r.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(u,", dataSize = ").concat(i));break}var f=l.getUint32(u,!d);if(3===A&&(f>>>=8),f>i-A)return void r.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var m=31&l.getUint8(u+A);19!==m&&20!==m||(_=!0);var v=new Uint8Array(e,t+u,A+f),g={type:m,data:v};c.push(g),h+=v.byteLength,u+=A+f}if(c.length){var y=this._videoTrack,b={units:c,length:h,isKeyframe:_,dts:p,cts:s,pts:p+s};_&&(b.fileposition=o),y&&(null==y||y.samples.push(b),y.length+=h)}},e.prototype._parseAV1VideoData=function(e,t,i,n,r,o,a){this._littleEndian;var s,d=[],l=this._timestampBase+n,c=1===o;if(s=i,d.push({unitType:0,data:new Uint8Array(e,t+0,i)}),d.length){var h=this._videoTrack,u={units:d,length:s,isKeyframe:c,dts:l,cts:a,pts:l+a};c&&(u.fileposition=r),h&&(null==h||h.samples.push(u),h.length+=s)}},e}();const S=E,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,B=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 k,C=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={}},R=function(){},O=function(){},I=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"}(k||(k={}));var x,D,L=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_&&r.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 n=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],r=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===n||1===r)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_,n=31&e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3],r=(128&e[i])>>>7,o=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=o,!(n>=k.kReserved0)&&0===r){var a=e.subarray(i,o);(t=new L).type=n,t.data=a}}return t},e}(),U=function(){function e(e,t,i){var n=8+e.byteLength+1+2+t.byteLength,r=!1;66!==e[3]&&77!==e[3]&&88!==e[3]&&(r=!0,n+=4);var o=this.data=new Uint8Array(n);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 d=t.byteLength;o[s+1]=d>>>8,o[s+2]=255&d,o.set(t,s+3),s+=3+d,r&&(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"}(x||(x={})),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"}(D||(D={}));var F,V,N=[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)}),W=function(){},j=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return G(t,e),t}(W),Q=function(){function e(e){this.TAG="AACADTSParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.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_,n=(8&e[i+1])>>>3,r=(6&e[i+1])>>>1,o=1&e[i+1],a=(192&e[i+2])>>>6,s=(60&e[i+2])>>>2,d=(1&e[i+2])<<2|(192&e[i+3])>>>6,l=(3&e[i+3])<<11|e[i+4]<<3|(224&e[i+5])>>>5;if(e[i+6],i+l>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var c=1===o?7:9,h=l-c;i+=c;var u=this.findNextSyncwordOffset(i+h);if(this.current_syncword_offset_=u,(0===n||1===n)&&0===r){var A=e.subarray(i,i+h);(t=new W).audio_object_type=a+1,t.sampling_freq_index=s,t.sampling_frequency=N[s],t.channel_config=d,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}(),z=function(){function e(e){this.TAG="AACLOASParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.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,n=0;n<=t;n++)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 n=this.current_syncword_offset_,o=(31&t[n+1])<<8|t[n+2];if(n+3+o>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var a=new A(t.subarray(n+3,n+3+o)),s=null;if(a.readBool()){if(null==e){r.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+o),a.destroy();continue}s=e}else{var d=a.readBool();if(d&&a.readBool()){r.A.e(this.TAG,"audioMuxVersionA is Not Supported"),a.destroy();break}if(d&&this.getLATMValue(a),!a.readBool()){r.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),a.destroy();break}if(0!==a.readBits(6)){r.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),a.destroy();break}if(0!==a.readBits(4)){r.A.e(this.TAG,"more than 2 numProgram Not Supported"),a.destroy();break}if(0!==a.readBits(3)){r.A.e(this.TAG,"more than 2 numLayer Not Supported"),a.destroy();break}var l=d?this.getLATMValue(a):0,c=a.readBits(5);l-=5;var h=a.readBits(4);l-=4;var u=a.readBits(4);l-=4,a.readBits(3),(l-=3)>0&&a.readBits(l);var p=a.readBits(3);if(0!==p){r.A.e(this.TAG,"frameLengthType = ".concat(p,". Only frameLengthType = 0 Supported")),a.destroy();break}a.readByte();var _=a.readBool();if(_)if(d)this.getLATMValue(a);else for(;;){8;var f=a.readBool();if(a.readByte(),!f)break}a.readBool()&&a.readByte(),(s=new j).audio_object_type=c,s.sampling_freq_index=h,s.sampling_frequency=N[s.sampling_freq_index],s.channel_config=u,s.other_data_present=_}for(var m=0;;){var v=a.readByte();if(m+=v,255!==v)break}for(var g=new Uint8Array(m),y=0;y<m;y++)g[y]=a.readByte();(i=new j).audio_object_type=s.audio_object_type,i.sampling_freq_index=s.sampling_freq_index,i.sampling_frequency=N[s.sampling_freq_index],i.channel_config=s.channel_config,i.other_data_present=s.other_data_present,i.data=g,this.current_syncword_offset_=this.findNextSyncwordOffset(n+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}(),H=function(e){var t=[],i=e.audio_object_type,n=e.audio_object_type,r=e.sampling_freq_index,o=e.channel_config,a=0,s=navigator.userAgent.toLowerCase();s.includes("firefox")?r>=6?(n=5,t=new Array(4),a=r-3):(n=2,t=new Array(2),a=r):s.includes("android")?(n=2,t=new Array(2),a=r):(n=5,a=r,t=new Array(4),r>=6?a=r-3:1===o&&(n=2,t=new Array(2),a=r)),t[0]=n<<3,t[0]|=(15&r)>>>1,t[1]=(15&r)<<7,t[1]|=(15&o)<<3,5===n&&(t[1]|=(15&a)>>>1,t[2]=(1&a)<<7,t[2]|=8,t[3]=0),this.config=t,this.sampling_rate=N[r],this.channel_count=o,this.codec_mimetype="mp4a.40."+n.toString(),this.original_codec_mimetype="mp4a.40."+i.toString()},q=function(){},X=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"}(V||(V={}));var $,Y=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:Y(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 n={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),e.readBits(5),n.program_splice_flag)n.utc_splice_time=e.readBits(32);else{n.component_count=e.readBits(8),n.components=[];for(var r=0;r<n.component_count;r++)n.components.push(J(e))}return n.duration_flag&&(n.break_duration=Z(e)),n.unique_program_id=e.readBits(16),n.avail_num=e.readBits(8),n.avails_expected=e.readBits(8),n},te=function(e,t,i,n){return{descriptor_tag:e,descriptor_length:t,identifier:i,provider_avail_id:n.readBits(32)}},ie=function(e,t,i,n){var r=n.readBits(8),o=n.readBits(3);n.readBits(5);for(var a="",s=0;s<o;s++)a+=String.fromCharCode(n.readBits(8));return{descriptor_tag:e,descriptor_length:t,identifier:i,preroll:r,dtmf_count:o,DTMF_char:a}},ne=function(e){var t=e.readBits(8);return e.readBits(7),{component_tag:t,pts_offset:4*e.readBits(31)+e.readBits(2)}},re=function(e,t,i,n){var r=n.readBits(32),o=n.readBool();n.readBits(7);var a={descriptor_tag:e,descriptor_length:t,identifier:i,segmentation_event_id:r,segmentation_event_cancel_indicator:o};if(o)return a;if(a.program_segmentation_flag=n.readBool(),a.segmentation_duration_flag=n.readBool(),a.delivery_not_restricted_flag=n.readBool(),a.delivery_not_restricted_flag?n.readBits(5):(a.web_delivery_allowed_flag=n.readBool(),a.no_regional_blackout_flag=n.readBool(),a.archive_allowed_flag=n.readBool(),a.device_restrictions=n.readBits(2)),!a.program_segmentation_flag){a.component_count=n.readBits(8),a.components=[];for(var s=0;s<a.component_count;s++)a.components.push(ne(n))}a.segmentation_duration_flag&&(a.segmentation_duration=n.readBits(40)),a.segmentation_upid_type=n.readBits(8),a.segmentation_upid_length=n.readBits(8);var d=new Uint8Array(a.segmentation_upid_length);for(s=0;s<a.segmentation_upid_length;s++)d[s]=n.readBits(8);return a.segmentation_upid=d.buffer,a.segmentation_type_id=n.readBits(8),a.segment_num=n.readBits(8),a.segments_expected=n.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=n.readBits(8),a.sub_segments_expected=n.readBits(8)),a},oe=function(e,t,i,n){return{descriptor_tag:e,descriptor_length:t,identifier:i,TAI_seconds:n.readBits(48),TAI_ns:n.readBits(32),UTC_offset:n.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,n){for(var r=n.readBits(4),o=[],a=0;a<r;a++)o.push(ae(n));return{descriptor_tag:e,descriptor_length:t,identifier:i,audio_count:r,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"}($||($={}));var de=function(){},le=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_&&r.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 n=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],r=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===n||1===r)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_,n=e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3]>>1&63,r=(128&e[i])>>>7,o=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=o,0===r){var a=e.subarray(i,o);(t=new de).type=n,t.data=a}}return t},e}(),he=function(){function e(e,t,i,n){var r=23+(5+e.byteLength)+(5+t.byteLength)+(5+i.byteLength),o=this.data=new Uint8Array(r);o[0]=1,o[1]=(3&n.general_profile_space)<<6|(n.general_tier_flag?1:0)<<5|31&n.general_profile_idc,o[2]=n.general_profile_compatibility_flags_1,o[3]=n.general_profile_compatibility_flags_2,o[4]=n.general_profile_compatibility_flags_3,o[5]=n.general_profile_compatibility_flags_4,o[6]=n.general_constraint_indicator_flags_1,o[7]=n.general_constraint_indicator_flags_2,o[8]=n.general_constraint_indicator_flags_3,o[9]=n.general_constraint_indicator_flags_4,o[10]=n.general_constraint_indicator_flags_5,o[11]=n.general_constraint_indicator_flags_6,o[12]=n.general_level_idc,o[13]=240|(3840&n.min_spatial_segmentation_idc)>>8,o[14]=255&n.min_spatial_segmentation_idc,o[15]=252|3&n.parallelismType,o[16]=252|3&n.chroma_format_idc,o[17]=248|7&n.bit_depth_luma_minus8,o[18]=248|7&n.bit_depth_chroma_minus8,o[19]=0,o[20]=0,o[21]=(3&n.constant_frame_rate)<<6|(7&n.num_temporal_layers)<<3|(n.temporal_id_nested?1:0)<<2|3,o[22]=3,o[23]=128|$.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|$.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|$.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}(),ue=function(){},Ae=function(){},pe=function(){},_e=[[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]],fe=function(){function e(e){this.TAG="AC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.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_,n=e[i+4]>>6,r=[48e3,44200,33e3][n],o=63&e[i+4],a=2*_e[n][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 d=e[i+5]>>3,l=7&e[i+5],c=e[i+6]>>5,h=0;1&c&&1!==c&&(h+=2),4&c&&(h+=2),2===c&&(h+=2);var u=(e[i+6]<<8|e[i+7])>>12-h&1,A=[2,1,2,3,3,4,4,5][c]+u;(t=new pe).sampling_frequency=r,t.channel_count=A,t.channel_mode=c,t.bit_stream_identification=d,t.low_frequency_effects_channel_on=u,t.bit_stream_mode=l,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_&&r.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_,n=new A(e.subarray(i+2)),r=(n.readBits(2),n.readBits(3),n.readBits(11)+1<<1),o=n.readBits(2),a=null,s=null;3===o?(a=[24e3,22060,16e3][o=n.readBits(2)],s=3):(a=[48e3,44100,32e3][o],s=n.readBits(2));var d=n.readBits(3),l=n.readBits(1),c=n.readBits(5);if(i+r>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var h=this.findNextSyncwordOffset(i+r);this.current_syncword_offset_=h;var u=[2,1,2,3,3,4,4,5][d]+l;n.destroy(),(t=new ve).sampling_frequency=a,t.channel_count=u,t.channel_mode=d,t.bit_stream_identification=c,t.low_frequency_effects_channel_on=l,t.frame_size=r,t.num_blks=[1,2,3,6][s],t.data=e.subarray(i,i+r)}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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ee=function(){return Ee=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Ee.apply(this,arguments)},Se=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a},we=function(e,t,i){if(2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))},Te=function(e){function t(t,i){var n=e.call(this)||this;return n.TAG="TSDemuxer",n.first_parse_=!0,n.media_info_=new a.A,n.timescale_=90,n.duration_=0,n.current_pmt_pid_=-1,n.program_pmt_map_={},n.pes_slice_queues_={},n.section_slice_queues_={},n.video_metadata_={vps:void 0,sps:void 0,pps:void 0,details:void 0},n.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},n.aac_last_sample_pts_=void 0,n.aac_last_incomplete_data_=null,n.has_video_=!1,n.has_audio_=!1,n.video_init_segment_dispatched_=!1,n.audio_init_segment_dispatched_=!1,n.video_metadata_changed_=!1,n.audio_metadata_changed_=!1,n.loas_previous_frame=null,n.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},n.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},n.ts_packet_size_=t.ts_packet_size,n.sync_offset_=t.sync_offset,n.config_=i,n}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,n=188;if(t.byteLength<=3*n)return{needMoreData:!0};for(;-1===i;){for(var o=Math.min(1e3,t.byteLength-3*n),a=0;a<o;){if(71===t[a]&&71===t[a+n]&&71===t[a+2*n]){i=a;break}a++}if(-1===i)if(188===n)n=192;else{if(192!==n)break;n=204}}return-1===i?{match:!1}:(192===n&&i>=4?(r.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),i-=4):204===n&&r.A.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:n,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 n=0;for(this.first_parse_&&(this.first_parse_=!1,n=this.sync_offset_);n+this.ts_packet_size_<=e.byteLength;){var o=t+n;192===this.ts_packet_size_&&(n+=4);var a=new Uint8Array(e,n,188),s=a[0];if(71!==s){r.A.e(this.TAG,"sync_byte = ".concat(s,", not 0x47"));break}var d=(64&a[1])>>>6,l=(a[1],(31&a[1])<<8|a[2]),h=(48&a[3])>>>4,u=15&a[3],A={},p=4;if(2===h||3===h){var _=a[4];if(5+_===188){n+=188,204===this.ts_packet_size_&&(n+=16);continue}_>0&&(A=this.parseAdaptationField(e,n+4,1+_)),p=5+_}if(1===h||3===h)if(0===l||l===this.current_pmt_pid_||void 0!==this.pmt_&&this.pmt_.pid_stream_type[l]===T.kSCTE35){var f=188-p;this.handleSectionSlice(e,n+p,f,{pid:l,file_position:o,payload_unit_start_indicator:d,continuity_conunter:u,random_access_indicator:A.random_access_indicator})}else if(void 0!==(null===(i=this.pmt_)||void 0===i?void 0:i.pid_stream_type[l])){f=188-p;var m=this.pmt_.pid_stream_type[l];(l===this.pmt_.common_pids.h264||l===this.pmt_.common_pids.h265||l===this.pmt_.common_pids.adts_aac||l===this.pmt_.common_pids.loas_aac||l===this.pmt_.common_pids.ac3||l===this.pmt_.common_pids.eac3||l===this.pmt_.common_pids.opus||l===this.pmt_.common_pids.mp3||this.pmt_.pes_private_data_pids[l]||this.pmt_.timed_id3_pids[l])&&this.handlePESSlice(e,n+p,f,{pid:l,stream_type:m,file_position:o,payload_unit_start_indicator:d,continuity_conunter:u,random_access_indicator:A.random_access_indicator})}n+=188,204===this.ts_packet_size_&&(n+=16)}return this.dispatchAudioVideoMediaSegment(),n},t.prototype.parseAdaptationField=function(e,t,i){var n=new Uint8Array(e,t,i),o=n[0];return o>0?o>183?(r.A.w(this.TAG,"Illegal adaptation_field_length: ".concat(o)),{}):{discontinuity_indicator:(128&n[1])>>>7,random_access_indicator:(64&n[1])>>>6,elementary_stream_priority_indicator:(32&n[1])>>>5}:{}},t.prototype.handleSectionSlice=function(e,t,i,n){var r=new Uint8Array(e,t,i),o=this.section_slice_queues_?this.section_slice_queues_[n.pid]:{};if(n.payload_unit_start_indicator){var a=r[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,n):this.clearSlices(o,n)}for(var d=1+a;d<r.byteLength&&255!==r[d+0];){var l=(15&r[d+1])<<8|r[d+2];this.section_slice_queues_&&(this.section_slice_queues_[n.pid]=new I,o=this.section_slice_queues_[n.pid]),o.expected_length=l+3,o.file_position=n.file_position,o.random_access_indicator=n.random_access_indicator,s=new Uint8Array(e,t+d,Math.min(i-d,o.expected_length-o.total_length)),o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,n):o.total_length>=o.expected_length&&this.clearSlices(o,n),d+=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,n):o.total_length>=o.expected_length&&this.clearSlices(o,n))},t.prototype.handlePESSlice=function(e,t,i,n){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(n.payload_unit_start_indicator){if(1!==a)return void r.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(a));var d=this.pes_slice_queues_[n.pid];d&&(0===d.expected_length||d.expected_length===d.total_length?this.emitPESSlices(d,n):this.clearSlices(d,n)),this.pes_slice_queues_&&(this.pes_slice_queues_[n.pid]=new I,this.pes_slice_queues_[n.pid].file_position=n.file_position,this.pes_slice_queues_[n.pid].random_access_indicator=n.random_access_indicator)}if(void 0!==this.pes_slice_queues_[n.pid]){var l=this.pes_slice_queues_[n.pid];l.slices.push(o),n.payload_unit_start_indicator&&(l.expected_length=0===s?0:s+6),l.total_length+=o.byteLength,l.expected_length>0&&l.expected_length===l.total_length?this.emitPESSlices(l,n):l.expected_length>0&&l.expected_length<l.total_length&&this.clearSlices(l,n)}},t.prototype.emitSectionSlices=function(e,t){for(var i=new Uint8Array(e.total_length),n=0,r=0;n<e.slices.length;n++){var o=e.slices[n];i.set(o,r),r+=o.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var a=new O;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),n=0,r=0;n<e.slices.length;n++){var o=e.slices[n];i.set(o,r),r+=o.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var a=new R;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,n=e.pid;0===n?this.parsePAT(i):n===this.current_pmt_pid_?this.parsePMT(i):(null===(t=this.pmt_)||void 0===t?void 0:t.scte_35_pids[n])&&this.parseSCTE35(i)},t.prototype.parsePES=function(e){var t=e.data,i=t[0]<<16|t[1]<<8|t[2],n=t[3],o=t[4]<<8|t[5];if(1===i)if(188!==n&&190!==n&&191!==n&&240!==n&&241!==n&&255!==n&&242!==n&&248!==n){t[6];var a=(192&t[7])>>>6,s=t[8],d=void 0,l=void 0;2!==a&&3!==a||(d=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,l=3===a?536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2:d);var c=9+s,h=void 0;if(0!==o){if(o<3+s)return void r.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");h=o-3-s}else h=t.byteLength-c;var u=t.subarray(c,c+h);switch(e.stream_type){case T.kMPEG1Audio:case T.kMPEG2Audio:this.parseMP3Payload(u,d);break;case T.kPESPrivateData:this.pmt_.common_pids.opus===e.pid?this.parseOpusPayload(u,d):this.pmt_.common_pids.ac3===e.pid?this.parseAC3Payload(u,d):this.pmt_.common_pids.eac3===e.pid?this.parseEAC3Payload(u,d):this.pmt_.smpte2038_pids[e.pid]?this.parseSMPTE2038MetadataPayload(u,d,l,e.pid,n):this.parsePESPrivateDataPayload(u,d,l,e.pid,n);break;case T.kADTSAAC:this.parseADTSAACPayload(u,d);break;case T.kLOASAAC:this.parseLOASAACPayload(u,d);break;case T.kAC3:this.parseAC3Payload(u,d);break;case T.kEAC3:this.parseEAC3Payload(u,d);break;case T.kID3:this.parseTimedID3MetadataPayload(u,d,l,e.pid,n);break;case T.kH264:this.parseH264Payload(u,d,l,e.file_position,e.random_access_indicator);break;case T.kH265:this.parseH265Payload(u,d,l,e.file_position,e.random_access_indicator)}}else 188!==n&&191!==n&&240!==n&&241!==n&&255!==n&&242!==n&&248!==n||e.stream_type!==T.kPESPrivateData||(c=6,h=void 0,h=0!==o?o:t.byteLength-c,u=t.subarray(c,c+h),this.parsePESPrivateDataPayload(u,void 0,void 0,e.pid,n));else r.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],n=(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 B).version_number=n;else if(null==(s=this.pat_))return;for(var d=i-5-4,l=-1,c=-1,h=8;h<8+d;h+=4){var u=e[h]<<8|e[h+1],A=(31&e[h+2])<<8|e[h+3];0===u?s.network_pid=A:(s.program_pmt_pid[u]=A,-1===l&&(l=u),-1===c&&(c=A))}1===o&&0===a&&(void 0===this.pat_&&r.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(s))),this.pat_=s,this.current_program_=l,this.current_pmt_pid_=c)}else r.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],n=e[3]<<8|e[4],o=(62&e[5])>>>1,a=1&e[5],s=e[6],d=(e[7],null);if(1===a&&0===s)(d=new C).program_number=n,d.version_number=o,this.program_pmt_map_[n]=d;else if(null==(d=this.program_pmt_map_[n]))return;e[8],e[9];for(var l=(15&e[10])<<8|e[11],c=12+l,h=i-9-l-4,u=c;u<c+h;){var A=e[u],p=(31&e[u+1])<<8|e[u+2],_=(15&e[u+3])<<8|e[u+4];d.pid_stream_type[p]=A;var f=d.common_pids.h264||d.common_pids.h265,m=d.common_pids.adts_aac||d.common_pids.loas_aac||d.common_pids.ac3||d.common_pids.eac3||d.common_pids.opus||d.common_pids.mp3;if(A!==T.kH264||f)if(A!==T.kH265||f)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(d.pes_private_data_pids[p]=!0,_>0){for(var v=u+5;v<u+5+_;){var g=e[v+0],y=e[v+1];if(5===g){var b=String.fromCharCode.apply(String,we([],Se(Array.from(e.subarray(v+2,v+2+y))),!1));"VANC"===b?d.smpte2038_pids[p]=!0:"Opus"===b&&(d.common_pids.opus=p)}else if(127===g&&p===d.common_pids.opus){var E=null;if(128===e[v+2]&&(E=e[v+3]),null==E){r.A.e(this.TAG,"Not Supported Opus channel count.");continue}var S={codec:"opus",channel_count:15&E?15&E:2,channel_config_code:E,sample_rate:48e3},w={codec:"opus",meta:S};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(w)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(w)):(this.audio_metadata_=S,this.dispatchAudioInitSegment(w))}v+=2+y}var B=e.subarray(u+5,u+5+_);this.dispatchPESPrivateDataDescriptor(p,A,B)}}else A===T.kID3?d.timed_id3_pids[p]=!0:A===T.kSCTE35&&(d.scte_35_pids[p]=!0);else d.common_pids.mp3=p;else d.common_pids.eac3=p;else d.common_pids.ac3=p;else d.common_pids.loas_aac=p;else d.common_pids.adts_aac=p;else d.common_pids.h265=p;else d.common_pids.h264=p;u+=5+_}n===this.current_program_&&(void 0===this.pmt_&&r.A.v(this.TAG,"Parsed first PMT: ".concat(JSON.stringify(d))),this.pmt_=d,(d.common_pids.h264||d.common_pids.h265)&&(this.has_video_=!0),(d.common_pids.adts_aac||d.common_pids.loas_aac||d.common_pids.ac3||d.common_pids.opus||d.common_pids.mp3)&&(this.has_audio_=!0))}else r.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,n,r,o,a,s=new A(e),d=s.readBits(8),l=s.readBool(),c=s.readBool();s.readBits(2);var h=s.readBits(12),u=s.readBits(8),p=s.readBool(),_=s.readBits(6),f=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===V.kSpliceNull?b={}:y===V.kSpliceSchedule?b=function(e){for(var t=e.readBits(8),i=[],n=0;n<t;n++)i.push(ee(e));return{splice_count:t,events:i}}(s):y===V.kSpliceInsert?b=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var n={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),n.splice_immediate_flag=e.readBool(),e.readBits(4),n.program_splice_flag&&!n.splice_immediate_flag&&(n.splice_time=Y(e)),!n.program_splice_flag){n.component_count=e.readBits(8),n.components=[];for(var r=0;r<n.component_count;r++)n.components.push(K(n.splice_immediate_flag,e))}return n.duration_flag&&(n.break_duration=Z(e)),n.unique_program_id=e.readBits(16),n.avail_num=e.readBits(8),n.avails_expected=e.readBits(8),n}(s):y===V.kTimeSignal?b=function(e){return{splice_time:Y(e)}}(s):y===V.kBandwidthReservation?b={}:y===V.kPrivateCommand?b=function(e,t){for(var i=String.fromCharCode(t.readBits(8),t.readBits(8),t.readBits(8),t.readBits(8)),n=new Uint8Array(e-4),r=0;r<e-4;r++)n[r]=t.readBits(8);return{identifier:i,private_data:n.buffer}}(g,s):s.readBits(8*g);for(var E=[],S=s.readBits(16),w=0;w<S;){var T=s.readBits(8),B=s.readBits(8),k=String.fromCharCode(s.readBits(8),s.readBits(8),s.readBits(8),s.readBits(8));0===T?E.push(te(T,B,k,s)):1===T?E.push(ie(T,B,k,s)):2===T?E.push(re(T,B,k,s)):3===T?E.push(oe(T,B,k,s)):4===T?E.push(se(T,B,k,s)):s.readBits(8*(B-4)),w+=2+B}var C={table_id:d,section_syntax_indicator:l,private_indicator:c,section_length:h,protocol_version:u,encrypted_packet:p,encryption_algorithm:_,pts_adjustment:f,cw_index:m,tier:v,splice_command_length:g,splice_command_type:y,splice_command:b,descriptor_loop_length:S,splice_descriptors:E,E_CRC32:p?s.readBits(32):void 0,CRC32:s.readBits(32)};if(y===V.kSpliceInsert){var R=b;if(R.splice_event_cancel_indicator)return{splice_command_type:y,detail:C,data:e};if(R.program_splice_flag&&!R.splice_immediate_flag){var O=R.duration_flag?null===(t=null==R?void 0:R.break_duration)||void 0===t?void 0:t.auto_return:void 0,I=R.duration_flag?((null===(i=null==R?void 0:R.break_duration)||void 0===i?void 0:i.duration)||0)/90:void 0;return(null===(n=R.splice_time)||void 0===n?void 0:n.time_specified_flag)?{splice_command_type:y,pts:(f+((null===(r=null==R?void 0:R.splice_time)||void 0===r?void 0:r.pts_time)||0))%Math.pow(2,33),auto_return:O,duraiton:I,detail:C,data:e}:{splice_command_type:y,auto_return:O,duraiton:I,detail:C,data:e}}return{splice_command_type:y,auto_return:O=R.duration_flag?null===(o=R.break_duration)||void 0===o?void 0:o.auto_return:void 0,duraiton:I=R.duration_flag?((null===(a=R.break_duration)||void 0===a?void 0:a.duration)||0)/90:void 0,detail:C,data:e}}if(y===V.kTimeSignal){var x=b;return x.splice_time.time_specified_flag?{splice_command_type:y,pts:(f+(x.splice_time.pts_time||0))%Math.pow(2,33),detail:C,data:e}:{splice_command_type:y,detail:C,data:e}}return{splice_command_type:y,detail:C,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,n,o){for(var a,s,d=new P(e),l=null,c=[],h=0,u=!1;null!=(l=d.readNextNaluPayload());){var A=new M(l);if(A.type===k.kSliceSPS){var _=p.parseSPS(l.data);this.video_init_segment_dispatched_?this.detectVideoMetadataChange(A,_)&&(r.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:_}):this.video_metadata_&&(this.video_metadata_.sps=A,this.video_metadata_.details=_)}else A.type===k.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===k.kSliceIDR||A.type===k.kSliceNonIDR&&1===o)&&(u=!0);this.video_init_segment_dispatched_&&(c.push(A),h+=A.data.byteLength)}var f=Math.floor(t/this.timescale_),m=Math.floor(i/this.timescale_);if(c.length){var v=this.video_track_,g={units:c,length:h,isKeyframe:u,dts:m,pts:f,cts:f-m,file_position:n};v&&(v.samples.push(g),v.length+=h)}},t.prototype.parseH265Payload=function(e,t,i,n,o){for(var a,s,d,l,c,h,u,A=new ce(e),p=null,_=[],m=0,v=!1;null!=(p=A.readNextNaluPayload());){var g=new le(p);if(g.type===$.kSliceVPS){if(!this.video_init_segment_dispatched_){var y=f.parseVPS(p.data);this.video_metadata_&&(this.video_metadata_.vps=g,this.video_metadata_.details=Ee(Ee({},null===(a=this.video_metadata_)||void 0===a?void 0:a.details),y))}}else g.type===$.kSliceSPS?(y=f.parseSPS(p.data),this.video_init_segment_dispatched_?this.detectVideoMetadataChange(g,y)&&(r.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=Ee(Ee({},null===(s=this.video_metadata_)||void 0===s?void 0:s.details),y))):g.type===$.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(y=f.parsePPS(p.data),this.video_metadata_&&(this.video_metadata_.pps=g,this.video_metadata_.details=Ee(Ee({},null===(d=this.video_metadata_)||void 0===d?void 0:d.details),y)),(null===(l=this.video_metadata_)||void 0===l?void 0:l.vps)&&(null===(c=this.video_metadata_)||void 0===c?void 0:c.sps)&&(null===(h=this.video_metadata_)||void 0===h?void 0:h.pps)&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):g.type!==$.kSliceIDR_W_RADL&&g.type!==$.kSliceIDR_N_LP&&g.type!==$.kSliceCRA_NUT||(v=!0);this.video_init_segment_dispatched_&&(_.push(g),m+=g.data.byteLength)}var b=Math.floor(t/this.timescale_),E=Math.floor(i/this.timescale_);if(_.length){var S=this.video_track_,w={units:_,length:m,isKeyframe:v,dts:E,pts:b,cts:b-E,file_position:n};S&&(null===(u=S.samples)||void 0===u||u.push(w),S.length+=m)}},t.prototype.detectVideoMetadataChange=function(e,t){var i,n,o,a,s,d,l,c,h,u;if(t.codec_mimetype!==(null===(n=null===(i=this.video_metadata_)||void 0===i?void 0:i.details)||void 0===n?void 0:n.codec_mimetype))return r.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===(l=null===(d=this.video_metadata_)||void 0===d?void 0:d.details)||void 0===l?void 0:l.codec_size.height)){var A=null===(c=this.video_metadata_)||void 0===c?void 0:c.details.codec_size,p=t.codec_size;return r.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===(h=this.video_metadata_)||void 0===h?void 0:h.details.present_size.width)&&(r.A.v(this.TAG,"Video: Present resolution width changed from "+"".concat(null===(u=this.video_metadata_)||void 0===u?void 0:u.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,n,o,a,s,d,l,c,h,u,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 _=p.frameRate.fps_den,f=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===(n=this.video_metadata_)||void 0===n?void 0:n.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===(d=null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)||void 0===d?void 0:d.data.subarray(4),y=new he(m,v,g,A);p.hvcc=y.getData(),this.video_init_segment_dispatched_||r.A.v(this.TAG,"Generated first HEVCDecoderConfigurationRecord for mimeType: ".concat(p.codec))}else{v=null===(c=null===(l=this.video_metadata_)||void 0===l?void 0:l.sps)||void 0===c?void 0:c.data.subarray(4),g=null===(u=null===(h=this.video_metadata_)||void 0===h?void 0:h.pps)||void 0===u?void 0:u.data.subarray(4);var b=new U(v,g,A);p.avcc=b.getData(),this.video_init_segment_dispatched_||r.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 E=this.media_info_;E.hasVideo=!0,E.width=p.codecWidth,E.height=p.codecHeight,E.fps=p.frameRate.fps,E.profile=p.profile,E.level=p.level,E.refFrames=A.ref_frames,E.chromaFormat=A.chroma_format_string,E.sarNum=p.sarRatio.width,E.sarDen=p.sarRatio.height,E.videoCodec=p.codec,E.hasAudio&&E.audioCodec?E.mimeType='video/mp2t; codecs="'.concat(E.videoCodec,",").concat(E.audioCodec,'"'):E.mimeType='video/mp2t; codecs="'.concat(E.videoCodec,'"'),E.isComplete()&&this.onMediaInfo&&this.onMediaInfo(E)},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,n,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,d=0;if(void 0!==t&&(d=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===(n=this.audio_metadata_)||void 0===n?void 0:n.sampling_frequency)*1e3,d=this.aac_last_sample_pts_+s;else if(void 0===t)return void r.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 l=this.aac_last_sample_pts_+s;Math.abs(l-d)>1&&(r.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(l,"ms, PES pts: ").concat(d,"ms")),d=l)}}for(var c=new Q(e),h=null,u=d,A=0;null!=(h=c.readNextAACFrame());){s=1024/h.sampling_frequency*1e3;var p={codec:"aac",data:h};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(p)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(p)):(this.audio_metadata_={codec:"aac",audio_object_type:h.audio_object_type,sampling_freq_index:h.sampling_freq_index,sampling_frequency:h.sampling_frequency,channel_config:h.channel_config},this.dispatchAudioInitSegment(p)),A=u;var _=Math.floor(u),f={unit:h.data,length:h.data.byteLength,pts:_,dts:_};this.audio_track_&&(null===(o=this.audio_track_)||void 0===o||o.samples.push(f),this.audio_track_.length+=h.data.byteLength),u+=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,n,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,d=0;if(void 0!==t&&(d=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,d=this.aac_last_sample_pts_+s;else if(void 0===t)return void r.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 l=this.aac_last_sample_pts_+s;Math.abs(l-d)>1&&(r.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(l,"ms, PES pts: ").concat(d,"ms")),d=l)}}for(var c=new z(e),h=null,u=d,A=0;null!=(h=c.readNextAACFrame(null!==(n=this.loas_previous_frame)&&void 0!==n?n:void 0));){this.loas_previous_frame=h,s=1024/h.sampling_frequency*1e3;var p={codec:"aac",data:h};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(p)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(p)):(this.audio_metadata_={codec:"aac",audio_object_type:h.audio_object_type,sampling_freq_index:h.sampling_freq_index,sampling_frequency:h.sampling_frequency,channel_config:h.channel_config},this.dispatchAudioInitSegment(p)),A=u;var _=Math.floor(u),f={unit:h.data,length:h.data.byteLength,pts:_,dts:_};this.audio_track_&&(null===(o=this.audio_track_)||void 0===o||o.samples.push(f),this.audio_track_.length+=h.data.byteLength),u+=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,n;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 r.A.w(this.TAG,"AC3: Unknown pts");for(var s=new fe(e),d=null,l=a,c=0;null!=(d=s.readNextAC3Frame());){o=1536/d.sampling_frequency*1e3;var h={codec:"ac-3",data:d};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(h)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(h)):(this.audio_metadata_={codec:"ac-3",sampling_frequency:d.sampling_frequency,bit_stream_identification:d.bit_stream_identification,bit_stream_mode:d.bit_stream_mode,low_frequency_effects_channel_on:d.low_frequency_effects_channel_on,channel_mode:d.channel_mode},this.dispatchAudioInitSegment(h)),c=l;var u=Math.floor(l),A={unit:d.data,length:d.data.byteLength,pts:u,dts:u};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(A),this.audio_track_.length+=d.data.byteLength),l+=o}c&&(this.aac_last_sample_pts_=c)}},t.prototype.parseEAC3Payload=function(e,t){var i,n;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 r.A.w(this.TAG,"EAC3: Unknown pts");for(var s=new ge(e),d=null,l=a,c=0;null!=(d=s.readNextEAC3Frame());){o=1536/d.sampling_frequency*1e3;var h={codec:"ec-3",data:d};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(h)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(h)):(this.audio_metadata_={codec:"ec-3",sampling_frequency:d.sampling_frequency,bit_stream_identification:d.bit_stream_identification,low_frequency_effects_channel_on:d.low_frequency_effects_channel_on,num_blks:d.num_blks,channel_mode:d.channel_mode},this.dispatchAudioInitSegment(h)),c=l;var u=Math.floor(l),A={unit:d.data,length:d.data.byteLength,pts:u,dts:u};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(A),this.audio_track_.length+=d.data.byteLength),l+=o}c&&(this.aac_last_sample_pts_=c)}},t.prototype.parseOpusPayload=function(e,t){var i,n;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 r.A.w(this.TAG,"Opus: Unknown pts");for(var s=a,d=0,l=0;l<e.length;){o=20;for(var c=!!(16&e[l+1]),h=!!(8&e[l+1]),u=l+2,A=0;255===e[u];)A+=255,u+=1;A+=e[u],u+=1,u+=c?2:0,u+=h?2:0,d=s;var p=Math.floor(s),_=e.slice(u,u+A),f={unit:_,length:_.byteLength,pts:p,dts:p};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(f),this.audio_track_.length+=_.byteLength),s+=o,l=u+A}d&&(this.aac_last_sample_pts_=d)}},t.prototype.parseMP3Payload=function(e,t){var i;if(!this.has_video_||this.video_init_segment_dispatched_){var n=e[1]>>>3&3,r=(6&e[1])>>1,o=(e[2],(12&e[2])>>>2),a=3&~(e[3]>>>6)?2:1,s=0,d=34;switch(n){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(r){case 1:d=34;break;case 2:d=33;break;case 3:d=32}var l=new Ae;l.object_type=d,l.sample_rate=s,l.channel_count=a,l.data=e;var c={codec:"mp3",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c)):(this.audio_metadata_={codec:"mp3",object_type:d,sample_rate:s,channel_count:a},this.dispatchAudioInitSegment(c));var h={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(h),this.audio_track_.length+=e.byteLength)}},t.prototype.detectAudioMetadataChange=function(e){var t,i,n,o;if(e.codec!==(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))return r.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 r.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 r.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 r.A.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(null===(n=this.audio_metadata_)||void 0===n?void 0:n.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 r.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 r.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 r.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 r.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 r.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 r.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 r.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 r.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 r.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 r.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,n,o,a,s,d={type:"audio"};if(d.id=null===(t=this.audio_track_)||void 0===t?void 0:t.id,d.timescale=1e3,d.duration=this.duration_,"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){var l="aac"===e.codec?e.data:null,c=new H(l);d.audioSampleRate=c.sampling_rate,d.channelCount=c.channel_count,d.codec=c.codec_mimetype,d.originalCodec=c.original_codec_mimetype,d.config=c.config,d.refSampleDuration=1024/d.audioSampleRate*d.timescale}else if("ac-3"===(null===(n=this.audio_metadata_)||void 0===n?void 0:n.codec)){var h="ac-3"===e.codec?e.data:null,u=new me(h);d.audioSampleRate=u.sampling_rate,d.channelCount=u.channel_count,d.codec=u.codec_mimetype,d.originalCodec=u.original_codec_mimetype,d.config=u.config,d.refSampleDuration=1536/d.audioSampleRate*d.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);d.audioSampleRate=p.sampling_rate,d.channelCount=p.channel_count,d.codec=p.codec_mimetype,d.originalCodec=p.original_codec_mimetype,d.config=p.config,d.refSampleDuration=256*p.num_blks/d.audioSampleRate*d.timescale}else"opus"===(null===(a=this.audio_metadata_)||void 0===a?void 0:a.codec)?(d.audioSampleRate=this.audio_metadata_.sample_rate,d.channelCount=this.audio_metadata_.channel_count,d.channelConfigCode=this.audio_metadata_.channel_config_code,d.codec="opus",d.originalCodec="opus",d.config=void 0,d.refSampleDuration=20):"mp3"===(null===(s=this.audio_metadata_)||void 0===s?void 0:s.codec)&&(d.audioSampleRate=this.audio_metadata_.sample_rate,d.channelCount=this.audio_metadata_.channel_count,d.codec="mp3",d.originalCodec="mp3",d.config=void 0);this.audio_init_segment_dispatched_||r.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(d.codec)),this.onTrackMetadata&&this.onTrackMetadata("audio",d),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var _=this.media_info_;_.hasAudio=!0,_.audioCodec=d.originalCodec,_.audioSampleRate=d.audioSampleRate,_.audioChannelCount=d.channelCount,_.hasVideo&&_.videoCodec?_.mimeType='video/mp2t; codecs="'.concat(_.videoCodec,",").concat(_.audioCodec,'"'):_.mimeType='video/mp2t; codecs="'.concat(_.audioCodec,'"'),_.isComplete()&&this.onMediaInfo&&this.onMediaInfo(_)},t.prototype.dispatchPESPrivateDataDescriptor=function(e,t,i){var n=new X;n.pid=e,n.stream_type=t,n.descriptor=i,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(n)},t.prototype.parsePESPrivateDataPayload=function(e,t,i,n,r){var o=new q;if(o.pid=n,o.stream_id=r,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,n,r){var o=new q;if(o.pid=n,o.stream_id=r,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,n,r){var o=new ue;if(o.pid=n,o.stream_id=r,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,n=[];i+=6,0===t.readBits(6);){var r=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 d=255&t.readBits(10);i+=10;var l=255&t.readBits(10);i+=10;for(var c=new Uint8Array(l),h=0;h<l;h++){var u=255&t.readBits(10);i+=10,c[h]=u}t.readBits(10),i+=10;var p="User Defined";65===s?7===d&&(p="SCTE-104"):95===s?220===d?p="ARIB STD-B37 (1SEG)":221===d?p="ARIB STD-B37 (ANALOG)":222===d?p="ARIB STD-B37 (SD)":223===d&&(p="ARIB STD-B37 (HD)"):97===s&&(1===d?p="EIA-708":2===d&&(p="EIA-608")),n.push({yc_indicator:r,line_number:o,horizontal_offset:a,did:s,sdid:d,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,n}(e),this.onSMPTE2038Metadata&&this.onSMPTE2038Metadata(o)},t}(w);const Be=Te;var ke=new Uint8Array([0,0,0,0,0,0,0,0]),Ce=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 n=8,r=null,o=Array.prototype.slice.call(arguments,1),a=o.length,s=0;s<a;s++)n+=o[s].byteLength;(r=new Uint8Array(n))[0]=n>>>24&255,r[1]=n>>>16&255,r[2]=n>>>8&255,r[3]=255&n,r.set(e,4);var d=8;for(s=0;s<a;s++)r.set(o[s],d),d+=o[s].byteLength;return r},e.generateInitSegment=function(t){var i=e.box(e.types.ftyp,e.constants.FTYP),n=e.moov(t),r=new Uint8Array(i.byteLength+n.byteLength);return r.set(i,0),r.set(n,i.byteLength),r},e.moov=function(t){var i=e.mvhd(t.timescale,t.duration),n=e.trak(t),r=e.mvex(t);return e.box(e.types.moov,i,n,r)},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,n=t.duration,r=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,n>>>24&255,n>>>16&255,n>>>8&255,255&n,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,r>>>8&255,255&r,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,n=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,n>>>24&255,n>>>16&255,n>>>8&255,255&n,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,n=t.audioSampleRate,r=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,n>>>8&255,255&n,0,0]);return e.box(e.types[".mp3"],r)},e.mp4a=function(t){var i=t.channelCount,n=t.audioSampleRate,r=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,n>>>8&255,255&n,0,0]);return e.box(e.types.mp4a,r,e.esds(t))},e.ac3=function(t){var i,n=t.channelCount,r=t.audioSampleRate,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,r>>>8&255,255&r,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,n=t.channelCount,r=t.audioSampleRate,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,r>>>8&255,255&r,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,n=null!==(i=t.config)&&void 0!==i?i:[],r=n.length,o=new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(n).concat([6,1,2]));return e.box(e.types.esds,o)},e.Opus=function(t){var i=t.channelCount,n=t.audioSampleRate,r=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,n>>>8&255,255&n,0,0]);return e.box(e.types.Opus,r,e.dOps(t))},e.dOps=function(t){var i=t.channelCount,n=t.channelConfigCode,r=t.audioSampleRate,o=[];switch(n){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 n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}([0,i,0,0,r>>>24&255,r>>>17&255,r>>>8&255,r>>>0&255,0,0],function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}(o),!1));return e.box(e.types.dOps,a)},e.avc1=function(t){var i=t.avcc,n=t.codecWidth,r=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,n>>>8&255,255&n,r>>>8&255,255&r,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,n=t.codecWidth,r=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,n>>>8&255,255&n,r>>>8&255,255&r,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,n,r=t.av1c,o=null!==(i=t.codecWidth)&&void 0!==i?i:192,a=null!==(n=t.codecHeight)&&void 0!==n?n: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,r))},e.mvex=function(t){return e.box(e.types.mvex,e.trex(t))},e.trex=function(t){var i=t.id,n=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,n)},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 n=t.id,r=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),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,r,o,s,a)},e.sdtp=function(t){for(var i=t.samples||[],n=i.length,r=new Uint8Array(4+n),o=0;o<n;o++){var a=i[o].flags;r[o+4]=a.isLeading<<6|a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy}return e.box(e.types.sdtp,r)},e.trun=function(t,i){var n=t.samples||[],r=n.length,o=12+16*r,a=new Uint8Array(o);i+=8+o,a.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var s=0;s<r;s++){var d=n[s].duration,l=n[s].size,c=n[s].flags,h=n[s].cts;a.set([d>>>24&255,d>>>16&255,d>>>8&255,255&d,l>>>24&255,l>>>16&255,l>>>8&255,255&l,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.isNonSync,0,0,h>>>24&255,h>>>16&255,h>>>8&255,255&h],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:ke,STSC:ke,STCO:ke,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}();Ce.init();const Re=Ce,Oe=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 Ie=i(453);const xe=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 Ie.Sc("audio"),this._videoSegmentInfoList=new Ie.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,n="mp4",r=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",r="",i=new Uint8Array):i=Re.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=Re.generateInitSegment(t)}if(!this._onInitSegment)throw new c.j4("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:r,container:"".concat(e,"/").concat(n),mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){var i,n;this._dtsBaseInited||((null===(i=null==e?void 0:e.samples)||void 0===i?void 0:i.length)&&(this._audioDtsBase=e.samples[0].dts),(null===(n=null==t?void 0:t.samples)||void 0===n?void 0:n.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 n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=null==t?void 0:t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(n,!0)},e.prototype._remuxAudio=function(e,t){var i,n,a,s,d,l,c;if(null!=this._audioMeta){var h,u,A=e,p=A.samples,_=-1,f=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,E=0;m?(y=0,E=A.length):(y=8,E=8+A.length);var S=null;if(p.length>1&&(E-=(S=p.pop()).length),null!=this._audioStashedLastSample){var w=this._audioStashedLastSample;this._audioStashedLastSample=null,p.unshift(w),E+=w.length}null!=S&&(this._audioStashedLastSample=S);var T=p[0].dts-this._dtsBase;if(this._audioNextDts)h=T-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())h=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(g=!0);else{var B=this._audioSegmentInfoList.getLastSampleBefore(T);if(null!=B){var k=T-(B.originalDts+B.duration);k<=3&&(k=0),h=T-(B.dts+B.duration+k)}else h=0}if(g){var C=T-h,R=this._videoSegmentInfoList.getLastSegmentBefore(T);if(null!=R&&R.beginDts<C){if(N=Oe.getSilentFrame(null===(i=this._audioMeta)||void 0===i?void 0:i.originalCodec,null===(n=this._audioMeta)||void 0===n?void 0:n.channelCount)){var O=R.beginDts,I=C-R.beginDts;r.A.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(O,", duration: ").concat(I)),p.unshift({unit:N,dts:O,pts:O}),E+=N.byteLength}}else g=!1}for(var x=[],D=0;D<p.length;D++){var L=(w=p[D]).unit,M=w.dts-this._dtsBase,P=(O=M,!1),U=null,F=0;if(!(M<-.001)){if("mp3"!==this._audioMeta.codec){var V=M;if(this._audioNextDts&&(V=this._audioNextDts),(h=M-V)<=-3*(f||0)){r.A.w(this.TAG,"Dropping 1 audio frame (originalDts: ".concat(M," ms ,curRefDts: ").concat(V," ms) due to dtsCorrection: ").concat(h," ms overlap."));continue}if(h>=3*(f||0)&&this._fillAudioTimestampGap&&!o.A.safari){P=!0;var N,G=Math.floor(h/(f||0));r.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(V," ms, ")+"dtsCorrection: ".concat(Math.round(h)," ms, generate: ").concat(G," frames")),O=Math.floor(V),F=Math.floor(V+(f||0))-O,null==(N=Oe.getSilentFrame(null===(a=this._audioMeta)||void 0===a?void 0:a.originalCodec,this._audioMeta.channelCount))&&(r.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")),N=L),U=[];for(var W=0;W<G;W++){V+=f||0;var j=Math.floor(V),Q=Math.floor(V+(f||0))-j,z={dts:j,pts:j,cts:0,unit:N,size:N.byteLength,duration:Q,originalDts:M,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};U.push(z),E+=z.size}this._audioNextDts=V+(f||0)}else O=Math.floor(V),F=Math.floor(V+(f||0))-O,this._audioNextDts=V+(f||0)}else O=M-h,F=D!==p.length-1?p[D+1].dts-this._dtsBase-h-O:null!=S?S.dts-this._dtsBase-h-O:x.length>=1?null===(d=x[x.length-1])||void 0===d?void 0:d.duration:Math.floor(f||0),this._audioNextDts=O+F;-1===_&&(_=O),x.push({dts:O,pts:O,cts:0,unit:w.unit,size:null===(l=w.unit)||void 0===l?void 0:l.byteLength,duration:F,originalDts:M,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),P&&x.push.apply(x,U)}}if(0===x.length)return A.samples=[],void(A.length=0);for(m?b=new Uint8Array(E):((b=new Uint8Array(E))[0]=E>>>24&255,b[1]=E>>>16&255,b[2]=E>>>8&255,b[3]=255&E,b.set(Re.types.mdat,4)),D=0;D<x.length;D++)L=x[D].unit,b.set(L,y),y+=L.byteLength||0;var H=x[x.length-1];u=H.dts+H.duration;var q=new Ie.EZ;q.beginDts=_,q.endDts=u,q.beginPts=_,q.endPts=u,q.originalBeginDts=x[0].originalDts,q.originalEndDts=H.originalDts+H.duration,q.firstSample=new Ie.$_(x[0].dts,x[0].pts,x[0].duration,x[0].originalDts,!1),q.lastSample=new Ie.$_(H.dts,H.pts,H.duration,H.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(q),A.samples=x,A.sequenceNumber++;var X;X=m?new Uint8Array:Re.moof(A,_),A.samples=[],A.length=0;var $={type:"audio",data:this._mergeBoxes(X,b).buffer,sampleCount:x.length,info:q};m&&v&&$&&($.timestampOffset=_),null===(c=this._onMediaSegment)||void 0===c||c.call(this,"audio",$)}}},e.prototype._remuxVideo=function(e,t){var i,n;if(null!=this._videoMeta){var r,o,a,s=e,d=s.samples,l=-1,c=-1;if(d&&0!==d.length&&(1!==d.length||t)){var h=8,u=null,A=8+e.length,p=null;if(d.length>1&&(A-=(p=d.pop()).length),null!=this._videoStashedLastSample){var _=this._videoStashedLastSample;this._videoStashedLastSample=null,d.unshift(_),A+=(null==_?void 0:_.length)||0}null!=p&&(this._videoStashedLastSample=p);var f=d[0].dts-this._dtsBase;if(this._videoNextDts)r=f-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())r=0;else{var m=this._videoSegmentInfoList.getLastSampleBefore(f);if(null!=m){var v=f-(m.originalDts+m.duration);v<=3&&(v=0),r=f-(m.dts+m.duration+v)}else r=0}for(var g=new Ie.EZ,y=[],b=0;b<d.length;b++){var E=(_=d[b]).dts-this._dtsBase,S=_.isKeyframe,w=E-r,T=_.cts,B=w+T;-1===l&&(l=w,c=B);var k=0;if(k=b!==d.length-1?d[b+1].dts-this._dtsBase-r-w:null!=p?p.dts-this._dtsBase-r-w:y.length>=1?y[y.length-1].duration:Math.floor((null===(i=this._videoMeta)||void 0===i?void 0:i.refSampleDuration)||0),S){var C=new Ie.$_(w,B,k,_.dts,!0);C.fileposition=_.fileposition,g.appendSyncPoint(C)}y.push({dts:w,pts:B,cts:T,units:_.units,size:_.length,isKeyframe:S,duration:k,originalDts:E,flags:{isLeading:0,dependsOn:S?2:1,isDependedOn:S?1:0,hasRedundancy:0,isNonSync:S?0:1}})}for((u=new Uint8Array(A))[0]=A>>>24&255,u[1]=A>>>16&255,u[2]=A>>>8&255,u[3]=255&A,u.set(Re.types.mdat,4),b=0;b<y.length;b++)for(var R=y[b].units;null==R?void 0:R.length;){var O=R.shift(),I=null==O?void 0:O.data;u.set(I,h),h+=I.byteLength}var x=y[y.length-1];if(o=x.dts+x.duration,a=x.pts+x.duration,this._videoNextDts=o,g.beginDts=l,g.endDts=o,g.beginPts=c,g.endPts=a,g.originalBeginDts=y[0].originalDts,g.originalEndDts=x.originalDts+x.duration,g.firstSample=new Ie.$_(y[0].dts,y[0].pts,y[0].duration,y[0].originalDts,!!y[0].isKeyframe),g.lastSample=new Ie.$_(x.dts,x.pts,x.duration,x.originalDts,!!x.isKeyframe),this._isLive||this._videoSegmentInfoList.append(g),s.samples=y,s.sequenceNumber++,this._forceFirstIDR){var D=y[0].flags;D.dependsOn=2,D.isNonSync=0}var L=Re.moof(s,l);s.samples=[],s.length=0,null===(n=this._onMediaSegment)||void 0===n||n.call(this,"video",{type:"video",data:this._mergeBoxes(L,u).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 De=i(302),Le=i(716);const Me=function(){function e(e,t){var i;this.TAG="TransmuxingController",this._emitter=new n.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 r=0;null===(i=this._mediaDataSource.segments)||void 0===i||i.forEach((function(i){i.timestampBase=r,r+=i.duration,i.cors=e.cors,i.withCredentials=e.withCredentials,t.referrerPolicy&&(i.referrerPolicy=t.referrerPolicy)})),isNaN(r)||this._mediaDataSource.duration===r||(this._mediaDataSource.duration=r),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,n,r;if(this._currentSegmentIndex=e,null===(i=this._mediaDataSource)||void 0===i?void 0:i.segments){var o=null===(n=this._mediaDataSource)||void 0===n?void 0:n.segments[e],a=this._ioctl=new De.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===(r=this._demuxer)||void 0===r||r.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,n,r,o,a,s,d,l,c,h,u,A,p;if(null!=this._mediaInfo&&(null===(t=this._mediaInfo)||void 0===t?void 0:t.isSeekable())){var _=this._searchSegmentIndexContains(e);if(_===this._currentSegmentIndex){var f=(null===(i=this._mediaInfo)||void 0===i?void 0:i.segments)?null===(n=this._mediaInfo)||void 0===n?void 0:n.segments[_]:{};if(void 0===f)this._pendingSeekTime=e;else{var m=null==f?void 0:f.getNearestKeyframe(e);null===(r=this._remuxer)||void 0===r||r.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[_]:{};void 0===v?(this._pendingSeekTime=e,this._internalAbort(),null===(d=this._remuxer)||void 0===d||d.seek(),null===(l=this._remuxer)||void 0===l||l.insertDiscontinuity(),this._loadSegment(_)):(m=v.getNearestKeyframe(e),this._internalAbort(),null===(c=this._remuxer)||void 0===c||c.seek(e),null===(h=this._remuxer)||void 0===h||h.insertDiscontinuity(),this._demuxer&&(null===(u=this._demuxer)||void 0===u||u.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[_].timestampBase:0),this._loadSegment(_,null==m?void 0:m.fileposition),this._pendingResolveSeekPoint=null==m?void 0:m.milliseconds,this._reportSegmentMediaInfo(_))}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){var t,i=this._mediaDataSource.segments,n=((null==i?void 0:i.length)||0)-1;if(0===((null==i?void 0:i.length)||0))return n;for(var r=0;r<((null==i?void 0:i.length)||0);r++)if(i&&e<((null===(t=i[r])||void 0===t?void 0:t.timestampBase)||0)){n=r-1;break}return n},e.prototype._onInitChunkArrival=function(e,t){var i,n,o,a,s,d=this,l=0;if(t>0)null===(i=this._demuxer)||void 0===i||i.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments?null===(n=this._mediaDataSource.segments[this._currentSegmentIndex])||void 0===n?void 0:n.timestampBase:0,l=(null===(o=this._demuxer)||void 0===o?void 0:o.parseChunks(e,t))||0;else{var c=null;(c=S.probe(e)).match&&(this._setupFLVDemuxerRemuxer(c),l=(null===(a=this._demuxer)||void 0===a?void 0:a.parseChunks(e,t))||0),c.match||(null==c?void 0:c.needMoreData)||(c=Be.probe(e)).match&&(this._setupTSDemuxerRemuxer(c),l=(null===(s=this._demuxer)||void 0===s?void 0:s.parseChunks(e,t))||0),c.match||(null==c?void 0:c.needMoreData)||(c=null,r.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then((function(){d._internalAbort()})),this._emitter.emit(Le.A.DEMUX_ERROR,_.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return l},e.prototype._setupFLVDemuxerRemuxer=function(e){var t;this._demuxer=new S(e,this._config),this._remuxer||(this._remuxer=new xe(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 Be(e,this._config);this._remuxer||(this._remuxer=new xe(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,n=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 r=Object.assign({},e);Object.setPrototypeOf(r,a.A.prototype),this._mediaInfo.segments&&(this._mediaInfo.segments[this._currentSegmentIndex]=r),this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=n._pendingSeekTime;n._pendingSeekTime=null,n.seek(e)}))},e.prototype._onMetaDataArrived=function(e){this._emitter.emit(Le.A.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(Le.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(Le.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(Le.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(Le.A.SCTE35_METADATA_ARRIVED,e))},e.prototype._onPESPrivateDataDescriptor=function(e){this._emitter.emit(Le.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(Le.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,n=e+1;n<((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(n)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(Le.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(Le.A.RECOVERED_EARLY_EOF)},e.prototype._onIOException=function(e,t){r.A.e(this.TAG,"IOException: type = ".concat(e,", code = ").concat(t.code,", msg = ").concat(t.msg)),this._emitter.emit(Le.A.IO_ERROR,e,t),this._disableStatisticsReporter()},e.prototype._onDemuxException=function(e,t){r.A.e(this.TAG,"DemuxException: type = ".concat(e,", info = ").concat(t)),this._emitter.emit(Le.A.DEMUX_ERROR,e,t)},e.prototype._onRemuxerInitSegmentArrival=function(e,t){this._emitter.emit(Le.A.INIT_SEGMENT,e,t)},e.prototype._onRemuxerMediaSegmentArrival=function(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(Le.A.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){var i=t.info.syncPoints,n=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,o.A.safari&&i.length>0&&i[0].originalDts===n&&(n=i[0].pts),this._emitter.emit(Le.A.RECOMMEND_SEEKPOINT,n)}},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,n,r,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===(n=this._mediaInfo)||void 0===n?void 0:n.duration,a.segmentCount=null===(r=this._mediaInfo)||void 0===r?void 0:r.segmentCount,delete a.segments,delete a.keyframesIndex,this._emitter.emit(Le.A.MEDIA_INFO,a)},e.prototype._reportStatisticsInfo=function(){var e,t,i,n,r,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===(n=this._ioctl)||void 0===n?void 0:n.currentSpeed,a.loaderType=null===(r=this._ioctl)||void 0===r?void 0:r.loaderType,a.currentSegmentIndex=this._currentSegmentIndex,a.totalSegmentCount=null===(o=this._mediaDataSource.segments)||void 0===o?void 0:o.length,this._emitter.emit(Le.A.STATISTICS_INFO,a)},e}()},716:(e,t,i)=>{i.d(t,{A:()=>n});const n={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"}},291:(e,t,i)=>{var n=i(641),r=i(976),o=i(716),a=null,s=function(e,t){self.postMessage({msg:"logcat_callback",data:{type:e,logcat:t}})};function d(e,t){var i={msg:o.A.INIT_SEGMENT,data:{type:e,data:t}};self.postMessage(i,[t.data])}function l(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 h(){var e={msg:o.A.RECOVERED_EARLY_EOF};self.postMessage(e)}function u(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 _(e){var t={msg:o.A.TIMED_ID3_METADATA_ARRIVED,data:e};self.postMessage(t)}function f(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 E(e,t){self.postMessage({msg:o.A.DEMUX_ERROR,data:{type:e,info:t}})}function S(e){self.postMessage({msg:o.A.RECOMMEND_SEEKPOINT,data:e})}self.addEventListener("message",(function(e){switch(e.data.cmd){case"init":(a=new r.A(e.data.param[0],e.data.param[1])).on(o.A.IO_ERROR,b),a.on(o.A.DEMUX_ERROR,E),a.on(o.A.INIT_SEGMENT,d),a.on(o.A.MEDIA_SEGMENT,l),a.on(o.A.LOADING_COMPLETE,c),a.on(o.A.RECOVERED_EARLY_EOF,h),a.on(o.A.MEDIA_INFO,u),a.on(o.A.METADATA_ARRIVED,A),a.on(o.A.SCRIPTDATA_ARRIVED,p),a.on(o.A.TIMED_ID3_METADATA_ARRIVED,_),a.on(o.A.SMPTE2038_METADATA_ARRIVED,f),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,S);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;n.A.applyConfig(t),!0===t.enableCallback?n.A.addLogListener(s):n.A.removeLogListener(s)}}))},465:(e,t,i)=>{i.d(t,{A:()=>n});const n={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},133:(e,t,i)=>{i.d(t,{default:()=>Q});var n={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32},r=i(302),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 r.A({},a()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"===t||"xhr-moz-chunked-loader"===t},e.getNetworkLoaderTypeName=function(){var e=new r.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 d=s;var l=i(288),c=i(413),h=i(502),u=i(620);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"},p=function(){const e=ENTRY_MODULE,t={};function i(n){if(t[n])return t[n].exports;const r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}i.m=e,i.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(const n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};const n=i(ENTRY_MODULE);return n.default||n};p.toString();const _="[\\.|\\-|\\+|\\w|/|@]+",f="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+_+").*?\\)";function m(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function v(e){return!isNaN(1*e)}function g(e,t,n){const r={};r[n]=[];const o=t.toString(),a=o.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||o.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!a)return r;const s=a[1];let d,l=new RegExp("(\\\\n|\\W)"+m(s)+f,"g");for(;d=l.exec(o);)"dll-reference"!==d[3]&&r[n].push(d[3]);for(l=new RegExp("\\("+m(s)+'\\("(dll-reference\\s('+_+'))"\\)\\)'+f,"g");d=l.exec(o);)e[d[2]]||(r[n].push(d[1]),e[d[2]]=i(d[1]).m),r[d[2]]=r[d[2]]||[],r[d[2]].push(d[4]);const c=Object.keys(r);for(let e=0;e<c.length;e++)for(let t=0;t<r[c[e]].length;t++)v(r[c[e]][t])&&(r[c[e]][t]=1*r[c[e]][t]);return r}function y(e){return Object.keys(e).reduce(((t,i)=>t||e[i].length>0),!1)}function b(e,t,i,n){const r=e[n].map((e=>`"${e}": ${t[n][e].toString()}`)).join(","),o=p.toString().split("ENTRY_MODULE");return`${o[0]}{${r}}${o[1]}"${i}"${o[2]}`}function E(e,t){t=t||{};const n={main:i.m},r=t.all?{main:Object.keys(n.main)}:function(e,t){const i={main:[t]},n={main:[]},r={main:{}};for(;y(i);){const t=Object.keys(i);for(let o=0;o<t.length;o++){const a=t[o],s=i[a].pop();if(r[a]=r[a]||{},r[a][s]||!e[a][s])continue;r[a][s]=!0,n[a]=n[a]||[],n[a].push(s);const d=g(e,e[a][s],a),l=Object.keys(d);for(let e=0;e<l.length;e++)i[l[e]]=i[l[e]]||[],i[l[e]]=i[l[e]].concat(d[l[e]])}}return n}(n,e);let o="";Object.keys(r).filter((e=>"main"!==e)).forEach((e=>{let t=0;for(;r[e][t];)t++;r[e].push(t),n[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o+=`var ${e} = (${b(r,n,t,modules)})();\n`})),o+=`(${b(r,n,e,"main")})();`;const a=new window.Blob([o],{type:"text/javascript"});if(t.bare)return a;const s=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(a),d=new window.Worker(s);return d.objectURL=s,d}var S=i(641),w=i(976),T=i(716),B=i(825),k=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=E(291),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)},S.A.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:S.A.getConfig()})}catch(i){h.A.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new w.A(e,t)}else this._controller=new w.A(e,t);if(this._controller){var i=this._controller;null==i||i.on(T.A.IO_ERROR,this._onIOError.bind(this)),null==i||i.on(T.A.DEMUX_ERROR,this._onDemuxError.bind(this)),null==i||i.on(T.A.INIT_SEGMENT,this._onInitSegment.bind(this)),null==i||i.on(T.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),null==i||i.on(T.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),null==i||i.on(T.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),null==i||i.on(T.A.MEDIA_INFO,this._onMediaInfo.bind(this)),null==i||i.on(T.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),null==i||i.on(T.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),null==i||i.on(T.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),null==i||i.on(T.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),null==i||i.on(T.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),null==i||i.on(T.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),null==i||i.on(T.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),null==i||i.on(T.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),null==i||i.on(T.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:"destroy"}),S.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(T.A.INIT_SEGMENT,e,t)}))},e.prototype._onMediaSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(T.A.MEDIA_SEGMENT,e,t)}))},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(T.A.LOADING_COMPLETE)}))},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(T.A.RECOVERED_EARLY_EOF)}))},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(T.A.MEDIA_INFO,e)}))},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(T.A.METADATA_ARRIVED,e)}))},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(T.A.SCRIPTDATA_ARRIVED,e)}))},e.prototype._onTimedID3MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(T.A.TIMED_ID3_METADATA_ARRIVED,e)}))},e.prototype._onSMPTE2038MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(T.A.SMPTE2038_METADATA_ARRIVED,e)}))},e.prototype._onSCTE35MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(T.A.SCTE35_METADATA_ARRIVED,e)}))},e.prototype._onPESPrivateDataDescriptor=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(T.A.PES_PRIVATE_DATA_DESCRIPTOR,e)}))},e.prototype._onPESPrivateDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(T.A.PES_PRIVATE_DATA_ARRIVED,e)}))},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(T.A.STATISTICS_INFO,e)}))},e.prototype._onIOError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(T.A.IO_ERROR,e,t)}))},e.prototype._onDemuxError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(T.A.DEMUX_ERROR,e,t)}))},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(T.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 T.A.INIT_SEGMENT:case T.A.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case T.A.LOADING_COMPLETE:case T.A.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case T.A.MEDIA_INFO:Object.setPrototypeOf(i,B.A.prototype),this._emitter.emit(t.msg,i);break;case T.A.METADATA_ARRIVED:case T.A.SCRIPTDATA_ARRIVED:case T.A.TIMED_ID3_METADATA_ARRIVED:case T.A.SMPTE2038_METADATA_ARRIVED:case T.A.SCTE35_METADATA_ARRIVED:case T.A.PES_PRIVATE_DATA_DESCRIPTOR:case T.A.PES_PRIVATE_DATA_ARRIVED:case T.A.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case T.A.IO_ERROR:case T.A.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case T.A.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":h.A.emitter.emit("log",i.type,i.logcat)}},e}();const C=k,R="error",O="source_open",I="update_end",x="buffer_full";var D=i(453),L=i(713),M=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 D.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 L.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 n=this._sourceBuffers[t];if(n){if("closed"!==e.readyState){try{e.removeSourceBuffer(n)}catch(e){h.A.e(this.TAG,e.message)}null==n||n.removeEventListener("error",this.e.onSourceBufferError),null==n||n.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){h.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 n=e,r="".concat(n.container);n.codec&&n.codec.length>0&&(r+=";codecs=".concat(n.codec));var o=!1;if(h.A.v(this.TAG,"Received Initialization Segment, mimeType: "+r),this._lastInitSegments[n.type]=n,r!==this._mimeTypes[n.type]){if(this._mimeTypes[n.type])h.A.v(this.TAG,"Notice: ".concat(n.type," mimeType changed, origin: ").concat(this._mimeTypes[n.type]||"",", target: ").concat(r));else{o=!0;try{var a=this._sourceBuffers[n.type]=this._mediaSource.addSourceBuffer(r);a.addEventListener("error",this.e.onSourceBufferError),a.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return h.A.e(this.TAG,e.message),void this._emitter.emit(R,{code:e.code,msg:e.message})}}this._mimeTypes[n.type]=r}t||this._pendingSegments[n.type].push(n),o||this._sourceBuffers[n.type]&&!(null===(i=this._sourceBuffers[n.type])||void 0===i?void 0:i.updating)&&this._doAppendSegments(),u.A.safari&&"audio/mpeg"===n.container&&n.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=n.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 n in this._sourceBuffers)if(this._sourceBuffers[n]){var r=this._sourceBuffers[n];if("open"===(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState))try{null==r||r.abort()}catch(e){h.A.e(this.TAG,e.message)}this._idrList.clear();var o=this._pendingSegments[n];if(o.splice(0,o.length),"closed"!==(null===(i=this._mediaSource)||void 0===i?void 0:i.readyState)){if(r){for(var a=0;a<r.buffered.length;a++){var s=r.buffered.start(a),d=r.buffered.end(a);this._pendingRemoveRanges[n].push({start:s,end:d})}(null==r?void 0:r.updating)||this._doRemoveRanges()}if(u.A.safari){var l=this._lastInitSegments[n];l&&(this._pendingSegments[n].push(l),(null==r?void 0:r.updating)||this._doAppendSegments())}}}},e.prototype.endOfStream=function(){var e,t,i=this._mediaSource,n=this._sourceBuffers;i&&"open"===i.readyState?(null===(e=n.video)||void 0===e?void 0:e.updating)||(null===(t=n.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 n in this._sourceBuffers){var r=this._sourceBuffers[n];if(r){var o=r.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,n=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(var r in this._sourceBuffers){var o=this._sourceBuffers[r];if(o){for(var a=o.buffered,s=!1,d=0;d<a.length;d++){var l=a.start(d),c=a.end(d);if(l<=n&&n<c+3){if(n-l>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0)){s=!0;var h=n-((null===(i=this._config)||void 0===i?void 0:i.autoCleanupMinBackwardDuration)||0);this._pendingRemoveRanges[r].push({start:l,end:h})}}else c<n&&(s=!0,this._pendingRemoveRanges[r].push({start:l,end:c}))}s&&!o.updating&&this._doRemoveRanges()}}},e.prototype._updateMediaSourceDuration=function(){var e,t,i,n,r=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=r.video)||void 0===i?void 0:i.updating)&&!(null===(n=r.audio)||void 0===n?void 0:n.updating)){var o=this._mediaSource.duration,a=this._pendingMediaDuration;a>0&&(isNaN(o)||a>o)&&(h.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],n=this._pendingRemoveRanges[t];n.length&&!(null==i?void 0:i.updating);){var r=n.shift();null==i||i.remove(r.start,r.end)}},e.prototype._doAppendSegments=function(){var e,t,i,n=this._pendingSegments;for(var r in n)if(this._sourceBuffers[r]&&!(null===(e=this._sourceBuffers[r])||void 0===e?void 0:e.updating)&&n[r].length>0){var o=n[r].shift();if(null==o?void 0:o.timestampOffset){var a=(null===(t=this._sourceBuffers[r])||void 0===t?void 0:t.timestampOffset)||0,s=o.timestampOffset/1e3;Math.abs(a-s)>.1&&(h.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(a," to ").concat(s)),this._sourceBuffers[r]&&(this._sourceBuffers[r].timestampOffset=s)),delete o.timestampOffset}if(!o.data||0===o.data.byteLength)continue;try{null===(i=this._sourceBuffers[r])||void 0===i||i.appendBuffer(o.data),this._isBufferFull=!1,"video"===r&&o.hasOwnProperty("info")&&this._idrList.appendArray(o.info.syncPoints)}catch(e){this._pendingSegments[r].unshift(o),22===e.code?(this._isBufferFull||this._emitter.emit(x),this._isBufferFull=!0):(h.A.e(this.TAG,e.message),this._emitter.emit(R,{code:e.code,msg:e.message}))}}},e.prototype._onSourceOpen=function(){var e;if(h.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(O)},e.prototype._onSourceEnded=function(){h.A.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){h.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(I)},e.prototype._onSourceBufferError=function(e){h.A.e(this.TAG,"SourceBuffer Error: ".concat(e))},e}();const P=M;var U=i(465),F={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},V={NETWORK_EXCEPTION:l.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:l.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:l.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:l.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:U.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:U.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:U.A.CODEC_UNSUPPORTED},N=function(){function e(e,t){var i,n,r;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 L.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=u.A.chrome&&(u.A.version&&(null===(i=u.A.version)||void 0===i?void 0:i.major)<50||u.A.version&&50===(null===(n=null===u.A||void 0===u.A?void 0:u.A.version)||void 0===n?void 0:n.major)&&((null===(r=null===u.A||void 0===u.A?void 0:u.A.version)||void 0===r?void 0:r.build)||-1)<2661);this._alwaysSeekKeyframe=!!(s||u.A.msedge||u.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,n,r,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 P(this._config),null===(t=this._msectl)||void 0===t||t.on(I,this._onmseUpdateEnd.bind(this)),null===(i=this._msectl)||void 0===i||i.on(x,this._onmseBufferFull.bind(this)),null===(n=this._msectl)||void 0===n||n.on(O,(function(){a._mseSourceOpened=!0,a._hasPendingLoad&&(a._hasPendingLoad=!1,a.load())})),null===(r=this._msectl)||void 0===r||r.on(R,(function(e){a._emitter.emit(A.ERROR,F.MEDIA_ERROR,V.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 L.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new L.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 C(this._mediaDataSource,this._config),this._transmuxer.on(T.A.INIT_SEGMENT,(function(t,i){var n;null===(n=e._msectl)||void 0===n||n.appendInitSegment(i)})),this._transmuxer.on(T.A.MEDIA_SEGMENT,(function(t,i){var n,r,o;if(null===(n=e._msectl)||void 0===n||n.appendMediaSegment(i),e._config.lazyLoad&&!e._config.isLive){var a=null===(r=e._mediaElement)||void 0===r?void 0:r.currentTime;i.info.endDts>=1e3*(a+((null===(o=e._config)||void 0===o?void 0:o.lazyLoadMaxDuration)||0))&&null==e._progressChecker&&(h.A.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(T.A.LOADING_COMPLETE,(function(){var t;null===(t=e._msectl)||void 0===t||t.endOfStream(),e._emitter.emit(A.LOADING_COMPLETE)})),this._transmuxer.on(T.A.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(A.RECOVERED_EARLY_EOF)})),this._transmuxer.on(T.A.IO_ERROR,(function(t,i){e._emitter.emit(A.ERROR,F.NETWORK_ERROR,t,i)})),this._transmuxer.on(T.A.DEMUX_ERROR,(function(t,i){e._emitter.emit(A.ERROR,F.MEDIA_ERROR,t,{code:-1,msg:i})})),this._transmuxer.on(T.A.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(A.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(T.A.METADATA_ARRIVED,(function(t){e._emitter.emit(A.METADATA_ARRIVED,t)})),this._transmuxer.on(T.A.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(A.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(T.A.TIMED_ID3_METADATA_ARRIVED,(function(t){e._emitter.emit(A.TIMED_ID3_METADATA_ARRIVED,t)})),this._transmuxer.on(T.A.SMPTE2038_METADATA_ARRIVED,(function(t){e._emitter.emit(A.SMPTE2038_METADATA_ARRIVED,t)})),this._transmuxer.on(T.A.SCTE35_METADATA_ARRIVED,(function(t){e._emitter.emit(A.SCTE35_METADATA_ARRIVED,t)})),this._transmuxer.on(T.A.PES_PRIVATE_DATA_DESCRIPTOR,(function(t){e._emitter.emit(A.PES_PRIVATE_DATA_DESCRIPTOR,t)})),this._transmuxer.on(T.A.PES_PRIVATE_DATA_ARRIVED,(function(t){e._emitter.emit(A.PES_PRIVATE_DATA_ARRIVED,t)})),this._transmuxer.on(T.A.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(A.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(T.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;return function(e,t,i,n){return new(i||(i=Promise))((function(t,r){function o(e){try{s(n.next(e))}catch(e){r(e)}}function a(e){try{s(n.throw(e))}catch(e){r(e)}}function s(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,a)}s((n=n.apply(e,[])).next())}))}(this,0,void 0,(function(){return function(e,t){var i,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(d){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,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,d])}}}(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()]}}))}))},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,n=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();i=r.totalVideoFrames,n=r.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},e.prototype._onmseUpdateEnd=function(){var e,t,i,n,r=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==r?void 0:r.length)>0&&!(null===(i=this._mediaElement)||void 0===i?void 0:i.paused)){var a=r.end(r.length-1);if(a>((null===(n=this._config)||void 0===n?void 0:n.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 d=0,l=0;l<r.length;l++){var c=r.start(l),u=r.end(l);if(c<=o&&o<u){d=u;break}}d>=o+(this._config.lazyLoadMaxDuration||0)&&null==this._progressChecker&&(h.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},e.prototype._onmseBufferFull=function(){h.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,n=(null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime)||0,r=null===(t=this._mediaElement)||void 0===t?void 0:t.buffered,o=!1,a=0;a<r.length;a++){var s=r.start(a),d=r.end(a);if(n>=s&&n<d){n>=d-(this._config.lazyLoadRecoverDuration||0)&&(o=!0);break}}o&&(window.clearInterval(this._progressChecker),this._progressChecker=null,o&&(h.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,n=0;n<i.length;n++){var r=i.start(n),o=i.end(n);if(e>=r&&e<o)return!0}return!1},e.prototype._internalSeek=function(e){var t,i,n,r,o,a=this._isTimepointBuffered(e),s=!1,d=0;if(e<1&&(null===(t=this._mediaElement)||void 0===t?void 0:t.buffered).length>0){var l=(null===(i=this._mediaElement)||void 0===i?void 0:i.buffered).start(0);(l<1&&e<l||u.A.safari)&&(s=!0,d=u.A.safari?.1:l)}if(s)this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=d);else if(a){if(this._alwaysSeekKeyframe){var c=null===(n=this._msectl)||void 0===n?void 0:n.getNearestKeyframe(Math.floor(1e3*e));this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=null!=c?c.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===(r=this._msectl)||void 0===r||r.seek(e),null===(o=this._transmuxer)||void 0===o||o.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,n;if(this._seekpointRecord)if(((null===(e=this._seekpointRecord)||void 0===e?void 0:e.recordTime)||0)<=this._now()-100){var r=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(r)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),null===(i=this._msectl)||void 0===i||i.seek(r),null===(n=this._transmuxer)||void 0===n||n.seek(Math.floor(1e3*r)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=r)))}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)&&(h.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,n,r=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(r<1&&o.length>0){var a=o.start(0);if(a<1&&r<a||u.A.safari)return this._requestSetTime=!0,void(this._mediaElement&&(u.A.safari?this._mediaElement.currentTime=.1:this._mediaElement.currentTime=a))}if(this._isTimepointBuffered(r)){if(this._alwaysSeekKeyframe){var s=null===(n=this._msectl)||void 0===n?void 0:n.getNearestKeyframe(Math.floor(1e3*r));null!=s&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=s.dts/1e3))}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:r,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}();const G=N;const W=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 L.Qn("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(e.hasOwnProperty("segments"))throw new L.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 L.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;return function(e,t,i,n){return new(i||(i=Promise))((function(t,r){function o(e){try{s(n.next(e))}catch(e){r(e)}}function a(e){try{s(n.throw(e))}catch(e){r(e)}}function s(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,a)}s((n=n.apply(e,[])).next())}))}(this,0,void 0,(function(){return function(e,t){var i,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(d){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,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,d])}}}(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()]}}))}))},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,n=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();i=r.totalVideoFrames,n=r.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),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 j={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+(n[t]||0)}),0),r=e.split("?")[0],o=e.split("?")[1];return o=(o||"").split("&").filter((function(e){return!/^vc=\d?/.test(e)})).join("&"),r+"?"+o+(o?"&":"")+"vc="+i}(e.url,["h264","h265"]));var i=e;if(null==i||"object"!=typeof i)throw new L.Qn("MediaDataSource must be an javascript object!");if(!Object.prototype.hasOwnProperty.call(i,"type"))throw new L.Qn("MediaDataSource must has type field to indicate video file type!");switch(i.type){case"mse":case"mpegts":case"m2ts":case"flv":return new G(i,t);default:return new W(i,t)}},isSupported:function(){return d.supportMSEH264Playback()},getFeatureList:function(){return d.getFeatureList()},BaseLoader:l.HC,LoaderStatus:l.eO,LoaderErrors:l.Xv,version:"",Events:A,ErrorTypes:F,ErrorDetails:V,MSEPlayer:G,NativePlayer:W,LoggingControl:S.A};Object.defineProperty(j,"version",{enumerable:!0,get:function(){return"2.0.1"}});const Q=j},446:(e,t,i)=>{e.exports=i(133).default},302:(e,t,i)=>{i.d(t,{A:()=>g});var n=i(502);const r=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(288),s=i(620),d=i(713),l=(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 n=e.call(this,"fetch-stream-loader")||this;return n.TAG="FetchStreamLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._requestAbort=!1,n._abortController=null,n._contentLength=null,n._receivedLength=0,n}return l(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 n=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(n=e.redirectedURL);var r=this._seekHandler.getConfig(n,t),o=new self.Headers;if("object"==typeof r.headers){var s=r.headers;for(var l in s)s.hasOwnProperty(l)&&o.append(l,s[l])}var c={method:"GET",headers:o,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var l in this._config.headers)o.append(l,this._config.headers[l]);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(r.url,c).then((function(e){var t,n;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!==r.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===(n=e.body)||void 0===n?void 0:n.getReader())}if(i._status=a.eO.kError,!i._onError)throw new d.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 n,r,o,s;if(i.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=a.eO.kError;var l=a.Xv.EARLY_EOF,c={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new d.Al(c.msg);t._onError(l,c)}else t._status=a.eO.kComplete,t._onComplete&&t._onComplete((null===(n=t._range)||void 0===n?void 0:n.from)||0,((null===(r=t._range)||void 0===r?void 0:r.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 h=i.value.buffer,u=((null===(s=t._range)||void 0===s?void 0:s.from)||0)+t._receivedLength;t._receivedLength+=h.byteLength,t._onDataArrival&&t._onDataArrival(h,u,t._receivedLength),t._pump(e)}})).catch((function(e){var i,n;if(null===(n=null===(i=t._abortController)||void 0===i?void 0:i.signal)||void 0===n?void 0:n.aborted)t._status=a.eO.kComplete;else if(11!==e.code||!s.A.msedge){t._status=a.eO.kError;var r=0,o=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(r=a.Xv.EXCEPTION,o={code:e.code,msg:e.message}):(r=a.Xv.EARLY_EOF,o={code:e.code,msg:"Fetch stream meet Early-EOF"}),!t._onError)throw new d.Al(o.msg);t._onError(r,o)}}))},t}(a.HC);var h=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const u=function(e){function t(t,i){var n=e.call(this,"xhr-moz-chunked-loader")||this;return n.TAG="MozChunkedLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._xhr=null,n._requestAbort=!1,n._contentLength=null,n._receivedLength=0,n}return h(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 n.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 n=this._seekHandler.getConfig(i,t);this._requestURL=n.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="moz-chunked-arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onloadend=this._onLoadEnd.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"==typeof n.headers){var o=n.headers;for(var s in o)o.hasOwnProperty(s)&&r.setRequestHeader(s,o[s])}if("object"==typeof this._config.headers)for(var s in o=this._config.headers)o.hasOwnProperty(s)&&r.setRequestHeader(s,o[s]);this._status=a.eO.kConnecting,r.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 d.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,n=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,n,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 d.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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const p=function(e){function t(t,i){var n=e.call(this,"xhr-range-loader")||this;return n.TAG="RangeLoader",n._seekHandler=t,n._config=i,n._needStash=!1,n._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],n._currentChunkSizeKB=384,n._currentSpeedNormalized=0,n._zeroSpeedChunkCount=0,n._xhr=null,n._speedSampler=new r,n._requestAbort=!1,n._waitForTotalLength=!1,n._totalLengthReceived=!1,n._currentRequestURL=null,n._currentRedirectedURL=null,n._currentRequestRange=null,n._totalLength=null,n._contentLength=null,n._receivedLength=0,n._lastTimeLoaded=0,n}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 n.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,n=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._receivedLength,r=n+i;null!=this._contentLength&&r-this._range.from>=this._contentLength&&(r=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._contentLength-1),this._currentRequestRange={from:n,to:r},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 n=this._seekHandler.getConfig(i,t);this._currentRequestURL=n.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onload=this._onLoad.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"==typeof n.headers){var o=n.headers;for(var a in o)o.hasOwnProperty(a)&&r.setRequestHeader(a,o[a])}if("object"==typeof this._config.headers)for(var a in o=this._config.headers)o.hasOwnProperty(a)&&r.setRequestHeader(a,o[a]);r.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 d.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 n=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(n)}},t.prototype._normalizeSpeed=function(e){var t=this._chunkSizeKBList,i=t.length-1,n=0,r=0,o=i;if(e<t[0])return t[0];for(;r<=o;){if((n=r+Math.floor((o-r)/2))===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?r=n+1:o=n-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 n=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=n.byteLength;var o=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():o=!0,this._onDataArrival&&this._onDataArrival(n,r,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 d.Al(i.msg);this._onError(t,i)},t}(a.HC);var _=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const f=function(e){function t(t,i){var n=e.call(this,"websocket-loader")||this;return n.TAG="WebSocketLoader",n._needStash=!0,n._ws=null,n._requestAbort=!1,n._receivedLength=0,n}return _(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 d.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 n={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new d.Al(n.msg);this._onError(a.Xv.EXCEPTION,n)}},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 d.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={};if(0!==t.from||-1!==t.to){var n;n=-1!==t.to?"bytes=".concat(t.from.toString(),"-").concat(t.to.toString()):"bytes=".concat(t.from.toString(),"-"),i.Range=n}else this._zeroStart&&(i.Range="bytes=0-");return{url:e,headers:i}},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 n=!0;i.includes("?")||(i+="?",n=!1),n&&(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],n=e.indexOf("?");-1!==n&&(t=e.substring(n+1));var r="";if(void 0!==t&&t.length>0)for(var o=t.split("&"),a=0;a<o.length;a++){var s=o[a].split("="),d=a>0;s[0]!==this._startName&&s[0]!==this._endName&&(d&&(r+="&"),r+=o[a])}return 0===r.length?i:i+"?"+r},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 r,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 d.Qn("Invalid seekType in config: ".concat((null==e?void 0:e.seekType)||""));if("function"!=typeof e.customSeekHandler)throw new d.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=f;else if(c.isSupported())this._loaderClass=c;else if(u.isSupported())this._loaderClass=u;else{if(!p.isSupported())throw new d.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,n,r,o;(null===(i=this._loader)||void 0===i?void 0:i.isWorking())&&(null===(n=this._loader)||void 0===n||n.abort()),this._flushStashBuffer(t),null===(r=this._loader)||void 0===r||r.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 d.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 n=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(i,0,t).set(n,0)}this._stashBuffer=i,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,i=t.length-1,n=0,r=0,o=i;if(e<t[0])return t[0];for(;r<=o;){if((n=r+Math.floor((o-r)/2))===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?r=n+1:o=n-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 n,r;if(!this._onDataArrival)throw new d.j4("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),null===(n=this._speedSampler)||void 0===n||n.addBytes(e.byteLength);var o=null===(r=this._speedSampler)||void 0===r?void 0:r.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);(h=this._dispatchChunks(s,this._stashByteStart))<s.byteLength?h>0&&(u=new Uint8Array(s,h),c.set(u,0),this._stashUsed=u.byteLength,this._stashByteStart+=h):(this._stashUsed=0,this._stashByteStart+=h),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(h=this._dispatchChunks(e,t))<e.byteLength&&((l=e.byteLength-h)>this._bufferSize&&(this._expandBuffer(l),c=new Uint8Array(this._stashBuffer,0,this._bufferSize)),c.set(new Uint8Array(e,h),0),this._stashUsed+=l,this._stashByteStart=t+h);else if(0===this._stashUsed){var l;(h=this._dispatchChunks(e,t))<e.byteLength&&((l=e.byteLength-h)>this._bufferSize&&this._expandBuffer(l),(c=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e,h),0),this._stashUsed+=l,this._stashByteStart=t+h)}else{var c,h;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,(h=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))<this._stashUsed&&h>0){var u=new Uint8Array(this._stashBuffer,h);c.set(u,0)}this._stashUsed-=h,this._stashByteStart+=h}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),r=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}n.A.w(this.TAG,"".concat(r," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,r}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(n.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 r=((null===(i=this._currentRange)||void 0===i?void 0:i.to)||0)+1;return void(r<this._totalLength&&(n.A.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(r,!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 d.Al("IOException: "+t.msg);this._onError(e,t)},e}()},288:(e,t,i)=>{i.d(t,{HC:()=>a,Xv:()=>o,eO:()=>r});var n=i(713),r={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=r.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=r.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},e.prototype.isWorking=function(){return this._status===r.kConnecting||this._status===r.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 n.Xu("Unimplemented abstract function!")},e.prototype.abort=function(){throw new n.Xu("Unimplemented abstract function!")},e}()},620:(e,t,i)=>{i.d(t,{A:()=>r});var n={};!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)||[],r={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},o={};if(r.browser){o[r.browser]=!0;var a=r.majorVersion.split(".");o.version={major:parseInt(r.majorVersion,10),string:r.version},a.length>1&&(o.version.minor=parseInt(a[1],10)),a.length>2&&(o.version.build=parseInt(a[2],10))}if(r.platform&&(o[r.platform]=!0),(o.chrome||o.opr||o.safari)&&(o.webkit=!0),o.rv||o.iemobile){o.rv&&delete o.rv;var s="msie";r.browser=s,o[s]=!0}if(o.edge){delete o.edge;var d="msedge";r.browser=d,o[d]=!0}if(o.opr){var l="opera";r.browser=l,o[l]=!0}if(o.safari&&o.android){var c="android";r.browser=c,o[c]=!0}for(var h in o.name=r.browser,o.platform=r.platform,n)Object.prototype.hasOwnProperty.call(n,h)&&delete n[h];Object.assign(n,o)}();const r=n},713:(e,t,i)=>{i.d(t,{Al:()=>o,Qn:()=>s,Xu:()=>d,j4:()=>a});var n,r=(n=function(e,t){return n=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])},n(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}n(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 r(t,e),t}(o),s=function(e){function t(t){var i=e.call(this,t)||this;return i.name="InvalidArgumentException",i}return r(t,e),t}(o),d=function(e){function t(t){var i=e.call(this,t)||this;return i.name="NotImplementedException",i}return r(t,e),t}(o)},502:(e,t,i)=>{i.d(t,{A:()=>r});var n=i(413);const r=function(){function e(){}return e.e=function(t,i){var n;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(n=e.emitter)||void 0===n||n.emit("log","error",r)),e.ENABLE_ERROR&&(console.error||console.warn)},e.i=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&e.emitter.emit("log","info",n),e.ENABLE_INFO&&console.info},e.w=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",n),e.ENABLE_WARN&&console.warn},e.d=function(t,i){var n;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(n=e.emitter)||void 0===n||n.emit("log","debug",r)),e.ENABLE_DEBUG&&console.debug},e.v=function(t,i){var n;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(n=e.emitter)||void 0===n||n.emit("log","verbose",r)),e.ENABLE_VERBOSE},e.FORCE_GLOBAL_TAG=!1,e.GLOBAL_TAG="ezuikit-flv",e.ENABLE_CALLBACK=!1,e.emitter=new n.A,e.ENABLE_ERROR=!0,e.ENABLE_INFO=!0,e.ENABLE_WARN=!0,e.ENABLE_DEBUG=!0,e.ENABLE_VERBOSE=!0,e}()},641:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(413),r=i(502);const o=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return r.A.FORCE_GLOBAL_TAG},set:function(t){r.A.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return r.A.GLOBAL_TAG},set:function(t){r.A.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return r.A.ENABLE_VERBOSE&&r.A.ENABLE_DEBUG&&r.A.ENABLE_INFO&&r.A.ENABLE_WARN&&r.A.ENABLE_ERROR},set:function(t){r.A.ENABLE_VERBOSE=t,r.A.ENABLE_DEBUG=t,r.A.ENABLE_INFO=t,r.A.ENABLE_WARN=t,r.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return r.A.ENABLE_DEBUG},set:function(t){r.A.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return r.A.ENABLE_VERBOSE},set:function(t){r.A.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return r.A.ENABLE_INFO},set:function(t){r.A.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return r.A.ENABLE_WARN},set:function(t){r.A.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return r.A.ENABLE_ERROR},set:function(t){r.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:r.A.GLOBAL_TAG,forceGlobalTag:r.A.FORCE_GLOBAL_TAG,enableVerbose:r.A.ENABLE_VERBOSE,enableDebug:r.A.ENABLE_DEBUG,enableInfo:r.A.ENABLE_INFO,enableWarn:r.A.ENABLE_WARN,enableError:r.A.ENABLE_ERROR,enableCallback:r.A.ENABLE_CALLBACK}},e.applyConfig=function(e){r.A.GLOBAL_TAG=e.globalTag,r.A.FORCE_GLOBAL_TAG=e.forceGlobalTag,r.A.ENABLE_VERBOSE=e.enableVerbose,r.A.ENABLE_DEBUG=e.enableDebug,r.A.ENABLE_INFO=e.enableInfo,r.A.ENABLE_WARN=e.enableWarn,r.A.ENABLE_ERROR=e.enableError,r.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){r.A.emitter.addListener("log",t),r.A.emitter.listenerCount("log")>0&&(r.A.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){r.A.emitter.removeListener("log",t),0===r.A.emitter.listenerCount("log")&&(r.A.ENABLE_CALLBACK=!1,e._notifyChange())},e.emitter=new n.A,e}()},413:(e,t,i)=>{i.d(t,{A:()=>n});const n=i(343)}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}return i.m=e,i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i(446)})()))}(Fi);var Vi=Fi.exports;class Ni extends Yt{constructor(e){super(),this.player=e;const t=document.createElement("video"),i=document.createElement("canvas");this.$posterElement=document.createElement("img"),t.volume=0,t.oncontextmenu=e=>{e.preventDefault()},this.player._opt.hasAudio||(t.muted=!0),t.style.position="absolute",t.style.top="0px",t.style.left="0px",this._delayPlay=!1,e.$container.appendChild(t),this.videoInfo={width:"",height:"",encType:""},this.$videoElement=t,this.$canvasElement=i,this.canvasContext=i.getContext("2d"),this.fixChromeVideoFlashBug(),this.resize();const{proxy:n}=this.player.events;n(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)})),n(this.$videoElement,"waiting",(()=>{this.player.emit(mt.videoWaiting)})),n(this.$videoElement,"timeupdate",(e=>{const t=parseInt(e.timeStamp,10);this.player.emit(mt.timeUpdate,t),!this.isPlaying()&&this.init&&(this.player.debug.log("Video","timeupdate and this.isPlaying is false and retry play"),this.$videoElement.play())})),this.player.debug.log("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 n in i)if(i[n]){let i="";if("IE"===n)i=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];else if("Chrome"===n){for(const e in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[e].type&&(n="360");i=e.match(/chrome\/([\d.]+)/)[1]}else"Firefox"===n?i=e.match(/firefox\/([\d.]+)/)[1]:"Opera"===n?i=e.match(/opera\/([\d.]+)/)[1]:"Safari"===n?i=e.match(/version\/([\d.]+)/)[1]:"Edge"===n?i=e.match(/edge\/([\d.]+)/)[1]:"QQBrowser"===n&&(i=e.match(/qqbrowser\/([\d.]+)/)[1]);t.type=n,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(){this.$videoElement&&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)}))}pause(e){this._poster(),e?this.$videoElement&&this.$videoElement.pause():setTimeout((()=>{this.$videoElement&&this.$videoElement.pause()}),100)}clearView(){}screenshot(e,t,i,n){var r;e=e||Nt()+"",n=n||wt.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===(r=this.canvasContext)||void 0===r||r.drawImage(a,0,0,s.width,s.height);const d=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),n===wt.base64)return d;{const t=Vt(d);return n===wt.blob?t:(n===wt.download&&ii(t,e),"")}}initCanvasViewSize(){this.resize()}_poster(){const e=this.screenshot("poster","png",.75,wt.base64);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,n=this.player.height,r=t.rotate;e.width=i,e.height=n,270!==r&&90!==r||(e.width=n,e.height=i);const o=(i-e.width)/2,a=(n-e.height)/2;let s="contain";t.scaleMode===kt.full&&(s="fill"),t.scaleMode===kt.fullAuto&&(s="cover"),e.style.objectFit=s,e.style.transform="rotate("+r+"deg)",e.style.left=o+"px",e.style.top=a+"px"}isPlaying(){return this.$videoElement&&!this.$videoElement.paused}}class Gi extends Ti{constructor(e,t){super(e,t,Ni),this._checkHeartTimeout=null,this._opt.useMSE=!0,this._createPlayer(t)}close(){throw new Error("Method not implemented.")}_createPlayer(e){var t;this._opt=Object.assign({},this._opt,e),this.events||(this.events=new Si(this)),this.video||(this.video=new Ni(this)),null===(t=Vi.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=Vi.createPlayer({type:"flv",url:e.url,isLive:!0},{stashInitialSize:128,enableWorker:!0,liveBufferLatencyChasing:!0}),this.player.attachMediaElement(this.video.$videoElement),this.loaded=!0,this._flvEvents()}_flvEvents(){this.player&&(this.player.on(Vi.Events.ERROR,((e,t,i)=>{"MediaError"===e&&"MediaMSEError"===t&&9===i.code&&this.emit(gt.mediaSourceH265NotSupport,i),e.indexOf("NetworkError")>-1&&this.player&&this.pause().then((()=>{this.emit(mt.timeout,mt.delayTimeout),this.emit(mt.delayTimeout)})),Pi.report(51,{event:e,value:i}),this.debug.error(`${Vi.Events.ERROR}`,e,t,i)})),this.player.on(Vi.Events.LOADING_COMPLETE,(e=>{this.debug.log(`${Vi.Events.LOADING_COMPLETE}`,e)})),this.player.on(Vi.Events.RECOVERED_EARLY_EOF,(e=>{this.debug.log(`${Vi.Events.RECOVERED_EARLY_EOF}`,e)})),this.player.on(Vi.Events.MEDIA_INFO,(e=>{this.video.updateVideoInfo({encTypeCode:(null==e?void 0:e.videoCodec.indexOf("avc"))>=0?7:12,width:e.width,height:e.height})})),this.player.on(Vi.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(Vi.Events.DESTROYING,(e=>{this.debug.log(`${Vi.Events.DESTROYING}`,e)})),this.off(mt.videoWaiting),this.off(mt.timeUpdate),this.on(mt.videoWaiting,(()=>{this.clearCheckHeartTimeout(),null===this._checkHeartTimeout&&this.handleRender()})),this.on(mt.timeUpdate,(()=>{this.clearCheckHeartTimeout()})))}getOption(){return this._opt}emitError(e,t=""){this.emit(mt.error,e,t),this.emit(e,t)}destroy(){this.player&&this.playing&&this.player.pause(),this.player&&(this.player.unload(),this.player.detachMediaElement(),this.player.destroy(),this.player=null),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.video&&(this.video.destroy(),this.video=null),this.events&&(this.events.destroy(),this.events=null),this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,this.emit("destroy"),this.off(),this.debug.log("play","destroy end")}resetStats(){}set fullscreen(e){Qt()&&this._opt.useWebFullScreen?(this.emit(mt.webFullscreen,e),setTimeout((()=>{this.updateOption({rotate:e?270:0}),this.resize()}),10)):this.emit(mt.fullscreen,e)}get fullscreen(){return zt()||this.webFullscreen}set webFullscreen(e){this.emit(mt.webFullscreen,e)}get webFullscreen(){return this.$container.classList.contains("flv-fullscreen-web")}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(mt.playing,e),this.emit(mt.volumechange,this.volume),e?this.emit(mt.play):this.emit(mt.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){e!==this.volume&&this.video&&(this.video.$videoElement.muted=!1,this.video.$videoElement.volume=e,this._lastVolume=e),0===e?this.emit(mt.mute,!0):this.emit(mt.mute,!1)}get lastVolume(){return this._lastVolume}set loading(e){this.loading!==e&&(this._loading=e,this.emit(mt.loading,this._loading))}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}checkHeart(){this.clearCheckHeartTimeout(),this.checkHeartTimeout()}clearCheckHeartTimeout(){this._checkHeartTimeout&&(clearTimeout(this._checkHeartTimeout),this._checkHeartTimeout=null)}checkHeartTimeout(){this._checkHeartTimeout=setTimeout((()=>{this.playing&&this.pause().then((()=>{this.emit(mt.timeout,mt.delayTimeout),this.emit(mt.delayTimeout)}))}),1e3*this._opt.heartTimeout)}checkLoadingTimeout(){this._checkLoadingTimeout=setTimeout((()=>{this.playing||this.pause().then((()=>{this.emit(mt.timeout,mt.loadingTimeout),this.emit(mt.loadingTimeout)}))}),1e3*this._opt.loadingTimeout)}handleRender(){this.loading&&(this.emit(mt.start),this.loading=!1,this.clearCheckLoadingTimeout()),this.playing||(this.playing=!0),this.checkHeart()}clearCheckLoadingTimeout(){this._checkLoadingTimeout&&(clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}updateOption(e){var t;super.updateOption(e),null===(t=Vi.LoggingControl)||void 0===t||t.applyConfig({globalTag:"EzuikitFlv",enableVerbose:!!e.debug,enableDebug:!!e.debug,enableInfo:!!e.debug,enableWarn:!!e.debug,enableError:!0})}play(){var e;return(null===(e=this.player)||void 0===e?void 0:e.playing)?this.pause().then((()=>this._play())):this._play()}_play(){return this._pause&&this._createPlayer(this._opt),this.loading=!0,this.playing=!1,this._times.playInitStart=Nt(),this.player?(this.player.load(),this.clearCheckHeartTimeout(),new Promise(((e,t)=>{this.player.play().then((()=>{this.loading=!1,this.playing=!0,this._opt.isNotMute&&this.mute(!1),e()})).catch((e=>{t(e)}))}))):Promise.reject()}_close(){return new Promise((e=>{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.video&&(this.video.resetInit(),this.video.pause(!0)),this.player&&(this.player.pause(),this.player.unload(),this._pause=!0,this.loaded=!0),this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,setTimeout((()=>{e()}),10)}))}pause(){return this._close()}resumeAudioAfterPause(){}mute(e){this.volume=e?0:.5}resize(){this.video.resize()}}class Wi{constructor(e,t){this._opt=Object.assign({},Ke,t),(Qt()||"360EE"===qe().browser)&&(this._opt.useMSE=!1);return new(Wi.getLoaderFactory(this._opt.useMSE))(e,this._opt)}static getLoaderFactory(e){return e?Gi:Ui}}var ji={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new r(n,o||e,a),d=i?i+t:t;return e._events[d]?e._events[d].fn?e._events[d]=[e._events[d],s]:e._events[d].push(s):(e._events[d]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,r,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var d,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){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,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,o),!0;case 6:return c.fn.call(c.context,t,n,r,o,a),!0}for(l=1,d=new Array(h-1);l<h;l++)d[l-1]=arguments[l];c.fn.apply(c.context,d)}else{var u,A=c.length;for(l=0;l<A;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,n);break;case 4:c[l].fn.call(c[l].context,t,n,r);break;default:if(!d)for(u=1,d=new Array(h-1);u<h;u++)d[u-1]=arguments[u];c[l].fn.apply(c[l].context,d)}}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,n,r){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||r&&!s.once||n&&s.context!==n||a(this,o);else{for(var d=0,l=[],c=s.length;d<c;d++)(s[d].fn!==t||r&&!s[d].once||n&&s[d].context!==n)&&l.push(s[d]);l.length?this._events[o]=1===l.length?l[0]:l: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 n,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}(ji);var Qi=Mt(ji.exports);const zi=["h264","h265"];class Hi extends Qi{constructor(e){super(Hi._setOptions(e)),t(this,"event",new Qi),Pi.initMonitor(e.ignoreMonitor||e.disableColect);const i=e;let n=e.id||e.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(!e.url)throw new Error("Flv url is empty");if(Pi.url=e.url,Pi.report(1,{name:"constructor"}),i.videoBuffer>=i.heartTimeout)throw new Error(`Flv videoBuffer ${i.videoBuffer}s must be less than heartTimeout ${i.heartTimeout}s`);n.classList.add("ezui-player-container","ezui-flv-container"),n.style.position="relative",delete i.container,i.forceNoOffscreen=!0,qt(i.videoBuffer)&&(i.videoBuffer=1e3*Number(i.videoBuffer)),qt(i.timeout)&&(Ht(i.loadingTimeout)&&(i.loadingTimeout=i.timeout),Ht(i.heartTimeout)&&(i.heartTimeout=i.timeout)),this._opt=i,this.$container=n,this._loadingTimeoutReplayTimes=0,this._heartTimeoutReplayTimes=0,this.events=new Si(this),this._initPlayer(n,i)}static _setOptions(e){return"string"==typeof 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.$container=null,this._opt={},this._loadingTimeoutReplayTimes=0,this._heartTimeoutReplayTimes=0,this.removeAllListeners(),Pi.report(50,{name:"destroy"})}_initPlayer(e,t){t.url&&(t.url=r(t.url,zi)),this.player=new Wi(e,t),this._bindEvents(),t.autoPlay&&this.play()}_resetPlayer(e={}){this.player.destroy(),this.player=null,this._opt=Object.assign(this._opt,e),this._initPlayer(this.$container,this._opt)}_bindEvents(){Object.keys(vt).forEach((e=>{this.player.on(vt[e],(t=>{this.emit(e,t),this.event.emit(e,t)}))}))}setDebug(e){this.player.updateOption({debug:e}),Pi.report(50,{name:"setDebug"})}setLogger(e={}){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),Pi.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),Pi.report(50,{name:"openSound"})}setVolume(e){this.openSound(),this.player.volume=e,Pi.report(50,{name:"setVolume",value:e})}get volume(){return this.player.volume}set volume(e){this.setVolume(e)}getVolume(){return Pi.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),Pi.report(50,{name:"audioResume"})}setTimeout(e){e=Number(e),this.player.updateOption({timeout:e,loadingTimeout:e,heartTimeout:e})}setScaleMode(e){return new Promise(((t,i)=>{try{e=Number(e)}catch(e){return void i(e)}[kt.full,kt.auto,kt.fullAuto].includes(e)?(this.player.updateOption({scaleMode:e}),this.resize(),t(),Pi.report(50,{name:"setScaleMode"})):i("scale mode 0 | 1 | 2")}))}pause(){var e,t;return Pi.report(50,{name:"pause"}),null===(e=this.player)||void 0===e||null===(t=e.pause)||void 0===t?void 0:t.call(e)}close(){return this._opt.url="",this._opt.playOptions={},this._opt.urlQuery={},Pi.report(50,{name:"close"}),this.player.close()}clearView(){this.player.video.clearView(),Pi.report(50,{name:"clearView"})}play(e={}){var t;e.url&&(Pi.url=e.url),"string"==typeof e&&(e={url:e});const i=r(e.url||this._opt.url,zi);return i===this._opt.url&&null!==(t=this.player)&&void 0!==t&&t.playing?Promise.resolve():(this._opt=Object.assign({},this._opt,e||{},{url:i}),this._opt.urlQuery=Mi(e.url),Pi.report(50,{name:"play"}),new Promise(((e,t)=>{var i;if(!this._opt.url)return this.emit(mt.error,gt.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=>{t(e)}))})))}_play(e={}){return new Promise(((t,i)=>{const n=0===e.url.indexOf("http"),r=n?$e:Xe,o=n||-1!==e.url.indexOf(".flv")||this._opt.isFlv?Ye:Ze;this.player.updateOption({protocol:r,demuxType:o}),this.player.once(gt.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(gt.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(gt.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(gt.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(gt.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(gt.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(gt.mseSourceBufferError,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","mseSourceBufferError close success")}))})),this.player.once(gt.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(gt.webcodecsWidthOrHeightChange,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","webcodecs Width Or Height Change reset player and play"),this._resetPlayer({useWCS:!0}),this.play(e).then((()=>{this.player.debug.log("Flv","webcodecs Width Or Height Change reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","webcodecs Width Or Height Change reset player and play error")}))}))})),this.player.once(gt.webcodecsDecodeError,(()=>{this.pause().then((()=>{this.player._opt.autoWasm&&(this.player.debug.log("Flv","webcodecs decode error reset player and play"),this._resetPlayer({useWCS:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","webcodecs decode error reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","webcodecs decode error reset player and play error")})))}))})),this.player.once(gt.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.once(mt.delayTimeout,(()=>{this.player._opt.heartTimeoutReplay&&(this._heartTimeoutReplayTimes<this.player._opt.heartTimeoutReplayTimes||-1===this.player._opt.heartTimeoutReplayTimes)&&(this.player.debug.log("Flv",`delay timeout replay time is ${this._heartTimeoutReplayTimes}`),this._heartTimeoutReplayTimes+=1,this.play(e).then((()=>{this._heartTimeoutReplayTimes=0})).catch((e=>{this._heartTimeoutReplayTimes=0})))})),this.player.once(mt.loadingTimeout,(()=>{this.player._opt.loadingTimeoutReplay&&(this._loadingTimeoutReplayTimes<this.player._opt.loadingTimeoutReplayTimes||-1===this.player._opt.loadingTimeoutReplayTimes)&&(this.player.debug.log("Flv",`loading timeout replay time is ${this._loadingTimeoutReplayTimes}`),this._loadingTimeoutReplayTimes+=1,this.play(e).then((()=>{this._loadingTimeoutReplayTimes=0})).catch((()=>{})))})),this.hasLoaded()?this.player.play(e).then((()=>{t()})).catch((e=>{this.player&&(this.player.debug.warn("Flv","hasLoaded and play error",e),this.player.pause().then((()=>{i(e)})))})):this.player.once(mt.decoderWorkerInit,(()=>{this.player.play(e).then((()=>{t()})).catch((e=>{this.player&&(this.player.debug.warn("Flv","decoderWorkerInit and play error",e),this.player.pause().then((()=>{i(e)})))}))}))}))}resize(e,t){e>0&&t>0&&this.player.updateOption({width:e,height:t}),this.player.resize(),Pi.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){Pi.report(50,{name:"setRotate",value:e});try{e=parseInt(e,10)}catch(e){return Promise.reject("rotate 0 | 90 | 180 | 270")}const t=[0,90,180,270];return new Promise(((i,n)=>{t.includes(e)?(this.player.updateOption({rotate:e}),this.resize(),i()):n("rotate 0 | 90 | 180 | 270")}))}hasLoaded(){return this.player.loaded}setKeepScreenOn(){this.player.updateOption({keepScreenOn:!0}),Pi.report(50,{name:"setKeepScreenOn"})}_setFullscreen(e){const t=!!e;this.player.fullscreen!==t&&(this.player.fullscreen=t)}fullScreen(){return i()||this._setFullscreen(!0),Pi.report(50,{name:"fullScreen"}),Promise.resolve()}fullscreen(){return i()||this._setFullscreen(!0),Pi.report(50,{name:"fullScreen"}),Promise.resolve()}cancelFullScreen(){return Pi.report(50,{name:"cancelFullScreen"}),this._exitFullscreen()}exitFullscreen(){return this.cancelFullScreen()}_exitFullscreen(){return this._setFullscreen(!1),Pi.report(50,{name:"exitFullscreen"}),Promise.resolve()}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 Pi.report(50,{name:"getVersion"}),"1.0.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 t(Hi,"ERROR",gt),t(Hi,"TIMEOUT",{loadingTimeout:mt.loadingTimeout,delayTimeout:mt.delayTimeout}),t(Hi,"version","1.0.2"),Hi}));
|
|
30
|
+
*/var Me,Pe,Ue,Fe,Ve=(Me="undefined"!=typeof self?self:window,Pe={navigator:void 0!==Me.navigator?Me.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"]}},Ue={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=Pe.navigator)?void 0:t.userAgent)||"",r=Ue.getMatchMap(i);for(var n in Pe.infoMap)for(var o=0;o<Pe.infoMap[n].length;o++){var a=Pe.infoMap[n][o];r[a]&&(e[n]=a)}},getOS:function(){var e=this;return Ue.matchInfoMap(e),null==e?void 0:e.os},getOSVersion:function(){var e=this,t=Pe.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",Ue.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=Pe.navigator)?void 0:e.browserLanguage)||(null==(t=Pe.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;Ue.matchInfoMap(e);var t=Pe.navigator.userAgent||"",i=function(e,t){var i=Pe.navigator.mimeTypes;for(var r in i)if(i[r][e]==t)return!0;return!1},r=Ue.getMatchMap(t),n=!1;if(Me.chrome){var o=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");+o>36&&Me.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")||Pe.navigator&&void 0===Pe.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+")"}},Fe={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:Ue.getDeviceType(),OS:Ue.getOS(),OSVersion:Ue.getOSVersion(),sh:Me.screen.height,sw:Me.screen.width,lang:Ue.getLanguage(),netWork:Ue.getNetwork(),orientation:Ue.getOrientationStatu(),browserInfo:Ue.getBrowserInfo(),fingerprint:Ue.createFingerprint(e.domain),userAgent:null==(t=Pe.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 Fe.DeviceInfoObj(e)}}),Ne=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}();Ne.isStop=!0,Ne.queues=[];var Ge=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 je(){return je=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},je.apply(this,arguments)}var $e=function(){function e(e){this.options=e,this.extendsInfo=e.extendsInfo||{},this.clientInfo=this._getDeviceInfo(),Ne.api=new Ge(e.url)}var t=e.prototype;return t.send=function(e){return this.options.forbidden||"object"!=typeof e||(this._handleRecordError(e),Ne.isStop&&Ne.fire()),this},t.setForbidden=function(e){this.options.forbidden=e},t.updateExtendsInfo=function(e){void 0===e&&(e={}),this.extendsInfo=je({},this.extendsInfo||{},e)},t._handleRecordError=function(e){try{var t=this._handleErrorInfo(e);Ne.add(this.options.url,t)}catch(e){}},t._handleErrorInfo=function(e){var t=this._getExtendsInfo(),i=je({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=je({},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 We(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 Qe{static initMonitor(e){Qe.collect=new $e({forbidden:e,url:"https://log.ys7.com/statistics.do/opensdk_ezuikit",jsError:!1,promiseError:!1,resourceError:!1,extendsInfo:{protocol:"flv",v:"1.0.3-alpha.2"}})}static report(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Qe.collect||Qe.initMonitor();try{const i=We(Qe.url);Qe.collect.send({url:Qe.url,serial:i.serial,no:i.no,action:e,logInfo:t})}catch(e){}}}class ze extends De{constructor(e,t){super(e,t,de),this._opt.useMSE=!1,this._opt.hasAudio&&(this.audio=new ue(this)),this.decoderWorker=new pe(this),this.stream=null,this.demux=null,this._lastVolume=null,Z()&&(this.keepScreenOn=new be(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(L.playing,e),this.emit(L.volumechange,this.volume),e?this.emit(L.play):this.emit(L.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(L.loading,this._loading),e||this.emit(L.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(L.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 Ae(this)),this.audio||this._opt.hasAudio&&(this.audio=new ue(this)),this.demux||(this.demux=new ve(this)),this.decoderWorker?e():(this.decoderWorker=new pe(this),this.once(L.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=q(),this._init().then((()=>{this._times.playStart=q(),this._opt.isMute||this.mute(!1),this.enableWakeLock();try{this.stream.fetchStream(this._opt.url,this._opt)}catch(e){}this.checkLoadingTimeout(),this.stream.once(M.fetchError,(e=>{t(e)})),this.stream.once(M.websocketError,(e=>{t(e)})),this.stream.once(L.streamEnd,(()=>{t()})),this.stream.once(L.streamSuccess,(()=>{e(),this._times.streamResponse=q(),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.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;this.volume=e?0:.5,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(){this._checkHeartTimeout&&this.clearCheckHeartTimeout(),this._checkHeartTimeout=setTimeout((()=>{if(this._checkHeartTimeout&&this.clearCheckHeartTimeout(),this.playing){if(0!==this._stats.fps)return;this.pause().then((()=>{this.emit(L.timeout,L.delayTimeout),this.emit(L.delayTimeout)}))}}),1e3*this._opt.heartTimeout)}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(L.timeout,L.loadingTimeout),this.emit(L.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(L.start),this.loading=!1),this.clearCheckLoadingTimeout(),this.playing||(this.playing=!0),this.checkHeart()}updateStats(e){e=e||{},this._startBpsTime||(this._startBpsTime=q()),J(e.ts)&&(this._stats.ts=e.ts),J(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=q();t-this._startBpsTime<1e3||(this.emit(L.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(L.playToRenderTimes,e)}getOption(){return this._opt}emitError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Qe.report(51,{event:e,value:t}),this.emit(L.error,e,t),this.emit(e,t)}}var He,qe={exports:{}};var Ye=(He||(He=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),E=i(7749),S=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),V=o("fetch"),N=o("Request"),G=o("Headers"),j=N&&N.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&&(S(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(E(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(S(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(V)&&r({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return V(e,arguments.length>1?ye(arguments[1]):{})}}),v(N)){var be=function(e){return m(this,j),new N(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"),E="keys",S="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 E:case S: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===S&&D&&D.name!==S&&(!o&&v?h(L,"name",S):(I=!0,M=function(){return n(D,this)})),p)if(O={values:B(S),keys:_?M:B(E),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:()=>V});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),E=i(9953),S=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 E.A(e,t)}else this._controller=new E.A(e,t);if(this._controller){var r=this._controller;null==r||r.on(S.A.IO_ERROR,this._onIOError.bind(this)),null==r||r.on(S.A.DEMUX_ERROR,this._onDemuxError.bind(this)),null==r||r.on(S.A.INIT_SEGMENT,this._onInitSegment.bind(this)),null==r||r.on(S.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),null==r||r.on(S.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),null==r||r.on(S.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),null==r||r.on(S.A.MEDIA_INFO,this._onMediaInfo.bind(this)),null==r||r.on(S.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),null==r||r.on(S.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),null==r||r.on(S.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),null==r||r.on(S.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),null==r||r.on(S.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),null==r||r.on(S.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),null==r||r.on(S.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),null==r||r.on(S.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),null==r||r.on(S.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(S.A.INIT_SEGMENT,e,t)}))},e.prototype._onMediaSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(S.A.MEDIA_SEGMENT,e,t)}))},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(S.A.LOADING_COMPLETE)}))},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(S.A.RECOVERED_EARLY_EOF)}))},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.MEDIA_INFO,e)}))},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.METADATA_ARRIVED,e)}))},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.SCRIPTDATA_ARRIVED,e)}))},e.prototype._onTimedID3MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.TIMED_ID3_METADATA_ARRIVED,e)}))},e.prototype._onSMPTE2038MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.SMPTE2038_METADATA_ARRIVED,e)}))},e.prototype._onSCTE35MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.SCTE35_METADATA_ARRIVED,e)}))},e.prototype._onPESPrivateDataDescriptor=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.PES_PRIVATE_DATA_DESCRIPTOR,e)}))},e.prototype._onPESPrivateDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.PES_PRIVATE_DATA_ARRIVED,e)}))},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.STATISTICS_INFO,e)}))},e.prototype._onIOError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(S.A.IO_ERROR,e,t)}))},e.prototype._onDemuxError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(S.A.DEMUX_ERROR,e,t)}))},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.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 S.A.INIT_SEGMENT:case S.A.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case S.A.LOADING_COMPLETE:case S.A.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case S.A.MEDIA_INFO:Object.setPrototypeOf(i,w.A.prototype),this._emitter.emit(t.msg,i);break;case S.A.METADATA_ARRIVED:case S.A.SCRIPTDATA_ARRIVED:case S.A.TIMED_ID3_METADATA_ARRIVED:case S.A.SMPTE2038_METADATA_ARRIVED:case S.A.SCTE35_METADATA_ARRIVED:case S.A.PES_PRIVATE_DATA_DESCRIPTOR:case S.A.PES_PRIVATE_DATA_ARRIVED:case S.A.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case S.A.IO_ERROR:case S.A.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case S.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(S.A.INIT_SEGMENT,(function(t,i){var r;null===(r=e._msectl)||void 0===r||r.appendInitSegment(i)})),this._transmuxer.on(S.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(S.A.LOADING_COMPLETE,(function(){var t;null===(t=e._msectl)||void 0===t||t.endOfStream(),e._emitter.emit(A.LOADING_COMPLETE)})),this._transmuxer.on(S.A.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(A.RECOVERED_EARLY_EOF)})),this._transmuxer.on(S.A.IO_ERROR,(function(t,i){e._emitter.emit(A.ERROR,D.NETWORK_ERROR,t,i)})),this._transmuxer.on(S.A.DEMUX_ERROR,(function(t,i){e._emitter.emit(A.ERROR,D.MEDIA_ERROR,t,{code:-1,msg:i})})),this._transmuxer.on(S.A.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(A.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(S.A.METADATA_ARRIVED,(function(t){e._emitter.emit(A.METADATA_ARRIVED,t)})),this._transmuxer.on(S.A.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(A.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(S.A.TIMED_ID3_METADATA_ARRIVED,(function(t){e._emitter.emit(A.TIMED_ID3_METADATA_ARRIVED,t)})),this._transmuxer.on(S.A.SMPTE2038_METADATA_ARRIVED,(function(t){e._emitter.emit(A.SMPTE2038_METADATA_ARRIVED,t)})),this._transmuxer.on(S.A.SCTE35_METADATA_ARRIVED,(function(t){e._emitter.emit(A.SCTE35_METADATA_ARRIVED,t)})),this._transmuxer.on(S.A.PES_PRIVATE_DATA_DESCRIPTOR,(function(t){e._emitter.emit(A.PES_PRIVATE_DATA_DESCRIPTOR,t)})),this._transmuxer.on(S.A.PES_PRIVATE_DATA_ARRIVED,(function(t){e._emitter.emit(A.PES_PRIVATE_DATA_ARRIVED,t)})),this._transmuxer.on(S.A.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(A.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(S.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 V=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),E=i(7553),S=i(7517),w=i(6288),T=E("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,V=f.UNSUPPORTED_Y;if(a("RegExp",r&&(!U||F||S||w||v((function(){return P[T]=!1,k(M)!==M||k(P)===P||"/a/i"!==String(k(M,"i"))}))))){for(var N=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===N)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,S&&"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)&&V&&(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,N),(r||n||v.length)&&(c=y(a),r&&(c.dotAll=!0,c.raw=N(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;)_(N,k,G[j++]);R.constructor=N,N.prototype=R,m(n,"RegExp",N,{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,E=/^[\uD800-\uDBFF]$/,S=/^[\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 _(E,e)&&!_(S,n)||_(S,e)&&!_(E,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),E=i(648),S=i(3587),w=S.set,T=S.getterFor("URL"),k=E.URLSearchParams,R=E.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),V=d("".replace),N=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={},Ee={},Se={},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=V(e,re,""),e=V(e,ne,"$1")),e=V(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=Se:"/"===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=Ee;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 Ee: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 Se: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 E=ue(b,ce);v?d.password+=E:d.username+=E}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 S=B(h,10);if(S>65535)return H;d.port=d.isSpecial()&&S===he[d.scheme]?null:S,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];)N(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,Ve),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())},Ve=Fe.prototype,Ne=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(Ve,"href",Ne("serialize","setHref")),u(Ve,"origin",Ne("getOrigin")),u(Ve,"protocol",Ne("getProtocol","setProtocol")),u(Ve,"username",Ne("getUsername","setUsername")),u(Ve,"password",Ne("getPassword","setPassword")),u(Ve,"host",Ne("getHost","setHost")),u(Ve,"hostname",Ne("getHostname","setHostname")),u(Ve,"port",Ne("getPort","setPort")),u(Ve,"pathname",Ne("getPathname","setPathname")),u(Ve,"search",Ne("getSearch","setSearch")),u(Ve,"searchParams",Ne("getSearchParams")),u(Ve,"hash",Ne("getHash","setHash"))),c(Ve,"toJSON",(function(){return T(this).serialize()}),{enumerable:!0}),c(Ve,"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,E,S=h(t),w=0;if(!S||this===A&&s(S))for(m=d(t),v=i?new this(m):A(m);m>w;w++)E=_?f(t[w],w):t[w],c(v,w,E);else for(v=i?new this:[],b=(y=u(t,S)).next;!(g=n(b,y)).done;w++)E=_?a(y,f,[g.value,w],!0):g.value,c(v,w,E);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 E=d,S=36;;){var w=S<=f?1:S>=f+26?26:S-f;if(E<w)break;var T=E-w,k=36-w;p(t,u(v(w+T%k))),E=c(T/k),S+=36}p(t,u(v(E))),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),E=s(b),S=r(f,_),w=0,T=m||l,k=t?T(p,E):i||h?T(p,0):void 0;E>w;w++)if((A||w in b)&&(g=S(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),E=i(7819),S=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),V=i(4979).forEach,N=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=S.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,N)&&e[N][r]&&(e[N][r]=!1),i=v(i,{enumerable:m(0,!1)})):(u(e,N)||K(e,N,m(1,v(null))),e[N][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 V(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,N)&&this[N][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,N)&&i[N][r]||(n.enumerable=!0),n}},Ae=function(e){var t=J(p(e)),i=[];return V(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 V(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,N)&&u(r[N],t)&&(r[N][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,S.f=he,y.f=b.f=Ae,E.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}),V(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[N]=!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 E(e,t){self.postMessage({msg:o.A.DEMUX_ERROR,data:{type:e,info:t}})}function S(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,E),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,S);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,E=o([].concat),S=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))&&(S(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++)S(M,void 0===(O=k[P])?O:String(O));var U=k.groups;if(p){var F=E([L],M,D,s);void 0!==U&&S(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),E=a("".slice);u(p,"description",{configurable:!0,get:function(){var e=v(this);if(s(f,e))return"";var t=g(e),i=m?E(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),E=(n=/b*/g,o(_,r=/a/,"a"),o(_,n,"a"),0!==r.lastIndex||0!==n.lastIndex),S=d.BROKEN_CARET,w=void 0!==/()??/.exec("")[1];(E||w||S||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=S&&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)),E&&(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:E&&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 E=s.readUEG(),S=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 V=0,N=0;0===h?(V=1,N=2-w):(V=3===h?1:2,N=(1===h?2:1)*(2-w));var G=16*(E+1),j=16*(S+1)*(2-w);G-=(T+k)*V,j-=(R+O)*N;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(),E=r.readByte(),S=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 V=0,N=0;N<=U;N++){var G=r.readBool(),j=!1;G||(j=r.readBool()),(G||j)&&V++}U=V}else{var $=r.readUEG(),W=r.readUEG();for(U=$+W,N=0;N<$;N++)r.readUEG(),r.readBool();for(N=0;N<W;N++)r.readUEG(),r.readBool()}}if(r.readBool()){var Q=r.readUEG();for(k=0;k<Q;k++){for(N=0;N<I+4;N++)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(N=0;N<ne;N++)r.readUEG(),r.readUEG(),te&&(r.readUEG(),r.readUEG());if(ee)for(N=0;N<ne;N++)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(S,".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(S),profile_idc:u,bit_depth:B+8,ref_frames:1,chroma_format:R,chroma_format_string:e.getChromaFormatString(R),general_level_idc:S,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:E,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,E=y.tier,S=i.readBits(4),w=i.readBits(4),T=i.readBits(S+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,E),".").concat(B.toString(10).padStart(2,"0")),level:b,tier:E,level_string:e.getLevelString(b,E),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 E=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&_,E=this._audioMetadata,S=this._audioTrack;if(E||(!1!==this._hasAudio||this._hasAudioFlagOverrided||(this._hasAudio=!0,this._mediaInfo&&(this._mediaInfo.hasAudio=!0)),(E=this._audioMetadata={}).type="audio",E.id=null==S?void 0:S.id,E.timescale=this._timescale,E.duration=this._duration,E.audioSampleRate=v,E.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==E?void 0:E.config){if(y(w.data.config,null==E?void 0:E.config))return;n.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var T=w.data;E.audioSampleRate=null==T?void 0:T.samplingRate,E.channelCount=null==T?void 0:T.channelCount,E.codec=null==T?void 0:T.codec,E.originalCodec=null==T?void 0:T.originalCodec,E.config=null==T?void 0:T.config,E.refSampleDuration=1024/E.audioSampleRate*E.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",E),(O=this._mediaInfo).audioCodec=E.originalCodec||"",O.audioSampleRate=E.audioSampleRate,O.audioChannelCount=E.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};S&&(null==S||S.samples.push(R),S.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(!E.codec){var O;if(void 0===(T=this._parseMP3AudioData(e,t+1,i-1,!0)))return;E.audioSampleRate=T.samplingRate,E.channelCount=T.channelCount,E.codec=T.codec,E.originalCodec=T.originalCodec,E.refSampleDuration=1152/E.audioSampleRate*E.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",E),(O=this._mediaInfo).audioCodec=E.codec,O.audioSampleRate=E.audioSampleRate,O.audioChannelCount=E.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==S||S.samples.push(B),S&&(S.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 E=new Uint8Array(e,t,i);if(y(E,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 S=b.getUint8(0),w=b.getUint8(1);if(b.getUint8(2),b.getUint8(3),1===S&&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),E=0,S=23;E<b;E++){var w=63&p.getUint8(S+0),T=p.getUint16(S+1,!A);S+=3;for(var k=0;k<T;k++){var R=p.getUint16(S+0,!A);if(0===k)if(33===w){S+=2;var O=new Uint8Array(e,t+S,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)),S+=R}else S+=2+R;else S+=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 E=_.frameRate.fps_den,S=_.frameRate.fps_num;_.refSampleDuration=_.timescale*(E/S),_.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 S=E,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,V,N=[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=N[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=N[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=N[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=N[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"}(V||(V={}));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)}}(),Ee=function(){return Ee=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},Ee.apply(this,arguments)},Se=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([],Se(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 E=null;if(128===e[v+2]&&(E=e[v+3]),null==E){n.A.e(this.TAG,"Not Supported Opus channel count.");continue}var S={codec:"opus",channel_count:15&E?15&E:2,channel_config_code:E,sample_rate:48e3},w={codec:"opus",meta:S};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(w)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(w)):(this.audio_metadata_=S,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===V.kSpliceNull?b={}:y===V.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===V.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===V.kTimeSignal?b=function(e){return{splice_time:X(e)}}(s):y===V.kBandwidthReservation?b={}:y===V.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 E=[],S=s.readBits(16),w=0;w<S;){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?E.push(te(T,k,R,s)):1===T?E.push(ie(T,k,R,s)):2===T?E.push(ne(T,k,R,s)):3===T?E.push(oe(T,k,R,s)):4===T?E.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:S,splice_descriptors:E,E_CRC32:p?s.readBits(32):void 0,CRC32:s.readBits(32)};if(y===V.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===V.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=Ee(Ee({},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=Ee(Ee({},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=Ee(Ee({},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_),E=Math.floor(i/this.timescale_);if(f.length){var S=this.video_track_,w={units:f,length:m,isKeyframe:v,dts:E,pts:b,cts:b-E,file_position:r};S&&(null===(h=S.samples)||void 0===h||h.push(w),S.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 E=this.media_info_;E.hasVideo=!0,E.width=p.codecWidth,E.height=p.codecHeight,E.fps=p.frameRate.fps,E.profile=p.profile,E.level=p.level,E.refFrames=A.ref_frames,E.chromaFormat=A.chroma_format_string,E.sarNum=p.sarRatio.width,E.sarDen=p.sarRatio.height,E.videoCodec=p.codec,E.hasAudio&&E.audioCodec?E.mimeType='video/mp2t; codecs="'.concat(E.videoCodec,",").concat(E.audioCodec,'"'):E.mimeType='video/mp2t; codecs="'.concat(E.videoCodec,'"'),E.isComplete()&&this.onMediaInfo&&this.onMediaInfo(E)},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,E=0;m?(y=0,E=A.length):(y=8,E=8+A.length);var S=null;if(p.length>1&&(E-=(S=p.pop()).length),null!=this._audioStashedLastSample){var w=this._audioStashedLastSample;this._audioStashedLastSample=null,p.unshift(w),E+=w.length}null!=S&&(this._audioStashedLastSample=S);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(N=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:N,dts:B,pts:B}),E+=N.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 V=M;if(this._audioNextDts&&(V=this._audioNextDts),(u=M-V)<=-3*(_||0)){n.A.w(this.TAG,"Dropping 1 audio frame (originalDts: ".concat(M," ms ,curRefDts: ").concat(V," ms) due to dtsCorrection: ").concat(u," ms overlap."));continue}if(u>=3*(_||0)&&this._fillAudioTimestampGap&&!o.A.safari){P=!0;var N,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(V," ms, ")+"dtsCorrection: ".concat(Math.round(u)," ms, generate: ").concat(G," frames")),B=Math.floor(V),F=Math.floor(V+(_||0))-B,null==(N=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")),N=D),U=[];for(var j=0;j<G;j++){V+=_||0;var $=Math.floor(V),W=Math.floor(V+(_||0))-$,Q={dts:$,pts:$,cts:0,unit:N,size:N.byteLength,duration:W,originalDts:M,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};U.push(Q),E+=Q.size}this._audioNextDts=V+(_||0)}else B=Math.floor(V),F=Math.floor(V+(_||0))-B,this._audioNextDts=V+(_||0)}else B=M-u,F=L!==p.length-1?p[L+1].dts-this._dtsBase-u-B:null!=S?S.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(E):((b=new Uint8Array(E))[0]=E>>>24&255,b[1]=E>>>16&255,b[2]=E>>>8&255,b[3]=255&E,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 E,S=(f=l[b]).dts-this._dtsBase,w=f.isKeyframe,T=S-n,k=f.cts,R=T+k;if(-1===d&&(d=T,c=R),E=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,E,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:E,originalDts:S,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=S.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 S(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)})()))}(qe)),qe.exports);class Xe extends ie{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,"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(L.videoWaiting)})),o(this.$videoElement,"timeupdate",(()=>{this.player.emit(L.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(),e?this.$videoElement&&this.$videoElement.pause():setTimeout((()=>{this.$videoElement&&this.$videoElement.pause()}),100)}clearView(){}screenshot(e,t,i,r){var n;e=e||q()+"",r=r||P.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),r===P.base64)return l;{const i=H(l,e+"."+t);return r===P.blob?i:(r===P.download&&le(i,e),"")}}initCanvasViewSize(){this.resize()}_poster(){const e=this.screenshot("poster","png",.75,P.base64);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 Ze extends De{constructor(e,t){super(e,t,Xe),this._checkHeartTimeout=null,this._opt.useMSE=!0,this.emit(L.decoderLoaded),this._createPlayer(t)}close(){}_createPlayer(e){var t;this._opt=Object.assign({},this._opt,e),this.player&&(this.player.unload(),this.player.detachMediaElement(),this.player.destroy(),this.player=null),this.events||(this.events=new Oe(this)),null===(t=Ye.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=Ye.createPlayer({type:"flv",url:e.url,isLive:e.isLive},{stashInitialSize:128,enableWorker:!0,liveBufferLatencyChasing:!0,lazyLoadMaxDuration:300}),this.player.attachMediaElement(this.video.$videoElement),this.loaded=!0,this._removeFlvEvents(),this._flvEvents()}_removeFlvEvents(){this.player&&(this.player.off(Ye.Events.ERROR),this.player.off(Ye.Events.LOADING_COMPLETE),this.player.off(Ye.Events.RECOVERED_EARLY_EOF),this.player.off(Ye.Events.MEDIA_INFO),this.player.off(Ye.Events.STATISTICS_INFO),this.player.off(Ye.Events.DESTROYING))}_flvEvents(){if(this.player){let e=0;this.player.on(Ye.Events.ERROR,((t,i,r)=>{"MediaError"===t&&"MediaMSEError"===i&&9===r.code&&this.emit(M.mediaSourceH265NotSupport,r),t.indexOf("NetworkError")>-1&&this.player&&this.pause().then((()=>{const e=setTimeout((()=>{clearTimeout(e),this.video.$videoElement.paused&&(this.emit(L.timeout,L.delayTimeout),this.emit(L.delayTimeout))}),1e3)})),"MediaError"===t&&"CodecUnsupported"===i&&-1===r.code&&r.msg.indexOf("Unsupported audio codec")?0===e&&(Qe.report(51,{event:t,value:r}),e=1,this.debug.error(`${Ye.Events.ERROR}`,t,i,JSON.stringify(r))):(Qe.report(51,{event:t,value:r}),this.debug.error(`${Ye.Events.ERROR}`,t,i,JSON.stringify(r)))})),this.player.on(Ye.Events.LOADING_COMPLETE,(e=>{this.debug.log(`${Ye.Events.LOADING_COMPLETE}`,JSON.stringify(e))})),this.player.on(Ye.Events.RECOVERED_EARLY_EOF,(e=>{this.debug.log(`${Ye.Events.RECOVERED_EARLY_EOF}`,e)})),this.player.on(Ye.Events.MEDIA_INFO,(e=>{this.video.updateVideoInfo({encTypeCode:(null==e?void 0:e.videoCodec.indexOf("avc"))>=0?7:12,width:e.width,height:e.height})})),this.player.on(Ye.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(Ye.Events.DESTROYING,(e=>{this.debug.log(`${Ye.Events.DESTROYING}`,JSON.stringify(e))})),this.on(L.videoWaiting,(()=>{this.clearCheckHeartTimeout(),null===this._checkHeartTimeout&&this.handleRender()})),this.on(L.timeUpdate,(()=>{this.clearCheckHeartTimeout()}))}}getOption(){return this._opt}emitError(e,t=""){this.emit(L.error,e,t),this.emit(e,t)}destroy(){this.player&&this.playing&&this.player.pause(),this.player&&(this.player.unload(),this.player.detachMediaElement(),this.player.destroy(),this.player=null),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.video&&(this.video.destroy(),this.video=null),this.events&&(this.events.destroy(),this.events=null),this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,this.emit("destroy"),this.off(),this.debug.log("play","destroy end")}resetStats(){}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(L.playing,e),this.emit(L.volumechange,this.volume),e?this.emit(L.play):this.emit(L.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){e!==this.volume&&this.video&&(this.video.$videoElement.muted=!1,this.video.$videoElement.volume=e,this._lastVolume=e),0===e?this.emit(L.mute,!0):this.emit(L.mute,!1)}get lastVolume(){return this._lastVolume}set loading(e){this.loading!==e&&(this._loading=e,this.emit(L.loading,this._loading),e||this.emit(L.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}checkHeart(){this.clearCheckHeartTimeout(),this.checkHeartTimeout()}clearCheckHeartTimeout(){this._checkHeartTimeout&&(clearTimeout(this._checkHeartTimeout),this._checkHeartTimeout=null)}checkHeartTimeout(){this._checkHeartTimeout=setTimeout((()=>{this.playing&&this.pause().then((()=>{this.emit(L.timeout,L.delayTimeout),this.emit(L.delayTimeout)}))}),1e3*this._opt.heartTimeout)}checkLoadingTimeout(){this._checkLoadingTimeout=setTimeout((()=>{this.playing||this.pause().then((()=>{this.emit(L.timeout,L.loadingTimeout),this.emit(L.loadingTimeout)}))}),1e3*this._opt.loadingTimeout)}handleRender(){this.loading&&(this.emit(L.start),this.loading=!1,this.clearCheckLoadingTimeout()),this.playing||(this.playing=!0),this.checkHeart()}clearCheckLoadingTimeout(){this._checkLoadingTimeout&&(clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}updateOption(e){var t;super.updateOption(e),null===(t=Ye.LoggingControl)||void 0===t||t.applyConfig({globalTag:"EzuikitFlv",enableVerbose:!!e.debug,enableDebug:!!e.debug,enableInfo:!!e.debug,enableWarn:!!e.debug,enableError:!0})}play(e={}){var t;return e.url&&(this.player.url=e.url),(null===(t=this.player)||void 0===t?void 0:t.playing)?this.pause().then((()=>this._play(e))):this._play(e)}_play(e={}){return this._pause&&this._createPlayer(Object.assign({},this._opt,e)),this.loading=!0,this.playing=!1,this._times.playInitStart=q(),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()}_close(){return new Promise((e=>{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.video&&(this.video.resetInit(),this.video.pause(!0)),this.player&&(this.player.pause(),this.player.unload(),this._pause=!0,this.loaded=!0),this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,setTimeout((()=>{e()}),10)}))}pause(){return this._close()}resumeAudioAfterPause(){}mute(e){this.volume=e?0:.5}}class Ke{constructor(e,t){this._opt=Object.assign({},p,t),(Z()||"360EE"===d().browser)&&(this._opt.useMSE=!1);return new(Ke.getLoaderFactory(this._opt.useMSE))(e,this._opt)}static getLoaderFactory(e){return e?Ze:ze}}var Je,et={exports:{}};var tt=(Je||(Je=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}(et)),et.exports),it=n(tt);class rt{static get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fetch(`${rt.defaults.baseURL}${e}`,{...t||{},method:"get",headers:{clientType:"ezuikit-flv",accessToken:rt.defaults.accessToken,deviceSerial:rt.defaults.deviceSerial,localIndex:rt.defaults.channelNo,...t.headers||{}}})}static post(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fetch(`${rt.defaults.baseURL}${e}`,{...t||{},method:"post",headers:{clientType:"ezuikit-flv",accessToken:rt.defaults.accessToken,deviceSerial:rt.defaults.deviceSerial,localIndex:rt.defaults.channelNo,...t.headers||{}}})}}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 t=i.pathname.split("/")[i.pathname.split("/").length-1].replace(/.flv$/,"").split("_");if(t[0].indexOf("-")>=0?o.deviceSerial=t[0].split("-")[1]:o.deviceSerial=t[0],o.channelNo=+t[1],o.streamTypeIn=+t[2],/begin_(\d{14})/.test(e)){const t=e.match(/begin_(\d{14})/);o.query.begin=t[1]}if(/end_(\d{14})/.test(e)){const t=e.match(/end_(\d{14})/);o.query.end=t[1]}}return o}e(rt,"defaults",{baseURL:"https://open.ys7.com",accessToken:"",deviceSerial:"",channelNo:""});const ot={getLocalVideoUnifyQuery:"/api/v3/device/local/video/unify/query",getVideoQuality:"/api/service/device/capacity/video/quality",setVideoLevel:"/api/v3/device/setVideoLevel",getAddress:"/api/lapp/v2/live/address/get"},at={0:"流畅",1:"标清",2:"高清",3:"超清",4:"极清",5:"3K",6:"4K"},st=[{videoLevel:1,name:at[1],streamTypeIn:2,type:"compatible"},{videoLevel:2,name:at[2],streamTypeIn:1,type:"compatible"}];async function lt(e){let t=st;try{var i,r;const n=await rt.get(`${ot.getVideoQuality}?deviceSerial=${rt.defaults.deviceSerial}`).then((e=>e.json())).catch((t=>{e.emit(M.fetchError,{api:ot.getVideoQuality,error:t})}));if(200!==(null==n||null===(i=n.meta)||void 0===i?void 0:i.code))return e.emit(M.fetchError,{api:ot.getVideoQuality,error:null==n?void 0:n.meta}),t;null!=n&&null!==(r=n.data)&&void 0!==r&&r.length&&(t=n.data)}catch(e){}return t=t.map((e=>({...e,name:at[e.videoLevel]||"未知"}))),t}async function dt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const t=new FormData;return Object.keys(e).forEach((i=>{t.append(i,e[i])})),t.append("protocol",4),t.append("accessToken",rt.defaults.accessToken),t.append("deviceSerial",rt.defaults.deviceSerial),t.append("channelNo",rt.defaults.channelNo),await rt.post(`${ot.getAddress}`,{body:t}).then((e=>e.json())).then((e=>200==+e.code?e.data:{}))}catch(e){return Promise.reject(e)}}async function ct(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return await dt({...e,type:1})}function ut(e){const t=(e=e.replace(/\//gi,"").replace(/-/gi,"").replace(/:/gi,"").replace(/ /gi,"")).substring(0,4),i=e.substring(4,6),r=e.substring(6,8),n=e.substring(8,10),o=e.substring(10,12),a=e.substring(12,14);return new Date(`${t}/${i}/${r} ${n}:${o}:${a}`)}function ht(e){return e<10?"0"+e:e+""}const At=["h264","h265"],pt=[.5,1,2,4,8];class ft extends it{constructor(t){super(ft._setOptions(t)),e(this,"event",new it),e(this,"urlInfo",{}),e(this,"seekTime",0),Qe.initMonitor(t.ignoreMonitor||t.disableColect);const i=t;let r=t.id||t.container;if("string"==typeof r&&(r=document.querySelector("#"+r.replace(/^#/,""))),!r)throw new Error("Flv required node can be a string (dom id) or dom (HTMLElement node)");if("CANVAS"===r.nodeName||"VIDEO"===r.nodeName)throw new Error(`Flv container type can not be ${r.nodeName} type`);if(!t.url)throw new Error("Flv url is empty");if(Qe.url=t.url,Qe.report(1,{name:"constructor"}),i.videoBuffer>=i.heartTimeout)throw new Error(`Flv videoBuffer ${i.videoBuffer}s must be less than heartTimeout ${i.heartTimeout}s`);r.classList.add("ezui-player-container","ezui-flv-container"),r.style.cssText+="position:relative; overflow: hidden;",delete i.container,i.forceNoOffscreen=!0,J(i.videoBuffer)&&(i.videoBuffer=1e3*Number(i.videoBuffer)),J(i.timeout)&&(K(i.loadingTimeout)&&(i.loadingTimeout=i.timeout),K(i.heartTimeout)&&(i.heartTimeout=i.timeout)),this._opt=i,this.urlInfo=nt(i.url,this._opt.isEzviz),this.$container=r,this._loadingTimeoutReplayTimes=0,this._heartTimeoutReplayTimes=0,this.events=new Oe(this),this._initPlayer(r,i),this._videoInfo={},this.definitionList=[],this.definition={},this._playbackRate=1,this.playbackRateList=pt,this.playbackRecords=[],this._httpServices()}_httpServices(){try{var e,t;if(this._opt.isEzviz&&null!==(e=this._opt)&&void 0!==e&&e.accessToken&&this.urlInfo.deviceSerial&&this.urlInfo.channelNo>=0&&this.urlInfo.streamTypeIn)if(rt.defaults.baseURL=((null===(t=this._opt.env)||void 0===t?void 0:t.domain)||"https://open.ys7.com/").replace(/\/$/,""),rt.defaults.accessToken=this._opt.accessToken,rt.defaults.deviceSerial=this.urlInfo.deviceSerial,rt.defaults.channelNo=this.urlInfo.channelNo,rt.defaults.streamTypeIn=this.urlInfo.streamTypeIn,this._isEzvizPlayback(this._opt.url)&&!this._opt.isLive){var i,r,n;this._playbackRate=+((null===(i=this.urlInfo)||void 0===i||null===(i=i.query)||void 0===i?void 0:i.playbackSpeed)||1),async function(e,t){const i=async t=>{let r=[];try{var n,o,a;const l=await rt.get(`${ot.getLocalVideoUnifyQuery}?startTime=${(t.startTime-36e5*(e._opt.timeZone||0))/1e3}&endTime=${(t.endTime-36e5*(e._opt.timeZone||0))/1e3}&pageSize=${t.pageSize||200}`).then((e=>e.json())).catch((t=>{e.emit(M.fetchError,{api:ot.getLocalVideoUnifyQuery,error:t})}));if(200!==(null==l||null===(n=l.meta)||void 0===n?void 0:n.code))return e.emit(M.fetchError,{api:ot.getLocalVideoUnifyQuery,error:null==l?void 0:l.meta}),r;var s;null!=l&&null!==(o=l.data)&&void 0!==o&&null!==(o=o.records)&&void 0!==o&&o.length&&(r=r.concat(l.data.records||[])),null!=l&&null!==(a=l.data)&&void 0!==a&&a.hasMore&&(r=r.concat(await i({...t,startTime:1e3*(null==l||null===(s=l.data)||void 0===s?void 0:s.nextFileTime)})))}catch(e){}return r},r=await i(t)||[];e.playbackRecords=r||[],e.emit(L.localVideoRecords,r)}(this,{startTime:ut(null===(r=this.urlInfo)||void 0===r||null===(r=r.query)||void 0===r?void 0:r.begin).getTime(),endTime:ut(null===(n=this.urlInfo)||void 0===n||null===(n=n.query)||void 0===n?void 0:n.end).getTime()});let e=0,t=0,o=0,a=0;this.on(L.timeUpdate,(i=>{var r;if((null===(r=this.playbackRecords)||void 0===r?void 0:r.length)>0){var n,s;const r=this.playbackRecords.findIndex((e=>(a+=e.endTime-e.startTime,a>=i)));t=null===(n=this.playbackRecords[r])||void 0===n?void 0:n.startTime;const l=null===(s=this.playbackRecords[r])||void 0===s?void 0:s.endTime;o=0===r?i:i-(a-(l-t));const d=parseInt(t+o,10);this.emit(L.timeUpdateOSD,{currentTime:i,currentFragmentPlayEnd:e!=r,currentSliceIndex:r,osd:d}),e=r;const c=new Date(1e3*d);this.seekTime=`${c.getFullYear()}${ht(c.getMonth()+1)}${ht(c.getDate())}${ht(c.getHours())}${ht(c.getMinutes())}${ht(c.getSeconds())}`,a=0}}))}else if(!this._isEzvizPlayback(this._opt.url)&&this._opt.isLive){var o,a;const e=null!==(o=this.urlInfo)&&void 0!==o&&null!==(o=o.query)&&void 0!==o&&o.expire?parseInt((1e3*this.urlInfo.query.expire-(new Date).getTime())/1e3):void 0;Promise.all([lt(this),ct({quality:"1"==(null===(a=this.urlInfo)||void 0===a?void 0:a.streamTypeIn)?2:1,expireTime:e})]).then((e=>{let t=[this.urlInfo.url,e[1].url].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(L.getDefinitionListResult,i),this.emit(L.definitionListChange,i)}))}}catch(e){var s,l;null===(s=this.player)||void 0===s||null===(s=s.debug)||void 0===s||null===(l=s.error)||void 0===l||l.call(s,e)}}setDefinitionList(e){this.player&&(this.definitionList=e,this.emit(L.definitionListChange,e))}switchDefinition(e){if(this.player)if(e.videoLevel>=0&&[1,2].includes(e.streamTypeIn)){const t=this.definitionList.find((t=>t.videoLevel===e.videoLevel));t&&(this.emit(L.definitionChange,t),this.definition=t,t.url&&("compatible"!==t.type&&async function(e,t){try{var i=new FormData;return i.append("videoLevel",parseInt(t)),await rt.post(`${ot.setVideoLevel}`,{body:i}).then((e=>e.json())).catch((t=>{e.emit(EVENTS_ERROR.fetchError,{api:ot.setVideoLevel,error:t})}))}catch(e){return{}}}(this,t.videoLevel),this.playing&&this.pause(),this.play({url:t.url})))}else{var t;null===(t=this.player.debug)||void 0===t||t.warn(`not support ${null==e?void 0:e.videoLevel}`)}}setPlaybackRateList(e){this.player&&(this.playbackRateList=e,this.emit(L.playbackRateListChange,e))}get playbackRate(){return this._playbackRate}set playbackRate(e){this.switchPlaybackRate(e)}switchPlaybackRate(e){var t,i;return this.player&&this._isEzvizPlayback(this._opt.url)?(e=+e,this.playbackRateList.includes(e)?this._getNewPlaybackPlayUrl({playbackRate:e}).then((t=>t?(this._playbackRate=e,this.emit(L.playbackRateChange,e),this.playing&&this.pause(),this.play({url:t}),0):1)):(null===(t=this.player)||void 0===t||null===(t=t.debug)||void 0===t||t.warn(`not support ${e}`),Promise.resolve(1))):(null===(i=this.player)||void 0===i||null===(i=i.debug)||void 0===i||i.warn(`not support ${e}`),Promise.resolve(1))}_getNewPlaybackPlayUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.player&&this._isEzvizPlayback(this._opt.url)&&this._opt.isEzviz){var t,i,r;const n=ut(this.seekTime||(null===(t=this.urlInfo)||void 0===t||null===(t=t.query)||void 0===t?void 0:t.begin)),o=ut(null===(i=this.urlInfo)||void 0===i||null===(i=i.query)||void 0===i?void 0:i.end);return async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return await dt({...e,type:2})}({expireTime:parseInt((new Date(1e3*(null===(r=this.urlInfo.query)||void 0===r?void 0:r.expire)).getTime()-(new Date).getTime())/1e3,10),startTime:`${n.getFullYear()}-${ht(n.getMonth()+1)}-${ht(n.getDate())} ${ht(n.getHours())}:${ht(n.getMinutes())}:${ht(n.getSeconds())}`,stopTime:`${o.getFullYear()}-${ht(o.getMonth()+1)}-${ht(o.getDate())} ${ht(o.getHours())}:${ht(o.getMinutes())}:${ht(o.getSeconds())}`,playbackSpeed:e.playbackRate||this.playbackRate}).then((e=>null==e?void 0:e.url))}return Promise.resolve("")}async seek(e){if(this.seekTime=e.replace(/\//gi,"").replace(/-/gi,"").replace(/:/gi,"").replace(/ /gi,""),this.player&&this._isEzvizPlayback(this._opt.url)&&this._opt.isEzviz)try{const e=await this._getNewPlaybackPlayUrl(this.seekTime);this.playing&&this.pause(),this.play({url:e})}catch(e){}}_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},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.urlInfo={},this._playbackRate=1,this.playbackRateList=[],this.playbackRecords=[],this.$container=null,this._opt={},this._loadingTimeoutReplayTimes=0,this._heartTimeoutReplayTimes=0,this.removeAllListeners(),Qe.report(50,{name:"destroy"})}_initPlayer(e,t){var r,n;t.url&&(t.url=i(t.url,At)),this.player=new Ke(e,t),null===(r=this.player.debug)||void 0===r||r.log("Flv","version",ft.version),null===(n=this.player.debug)||void 0===n||n.log("Flv","_initPlayer",JSON.stringify(t)),this._bindEvents(),t.autoPlay&&this.play()}_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(D).forEach((e=>{this.player.on(D[e],(t=>{this.emit(e,t),this.event.emit(e,t)}))}))}setDebug(e){this.player.updateOption({debug:e}),Qe.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),Qe.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),Qe.report(50,{name:"openSound"})}setVolume(e){this.openSound(),this.player.volume=e,Qe.report(50,{name:"setVolume",value:e})}get volume(){return this.player.volume}set volume(e){this.setVolume(e)}getVolume(){return Qe.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),Qe.report(50,{name:"audioResume"})}setTimeout(e){e=Number(e),this.player.updateOption({timeout:e,loadingTimeout:e,heartTimeout:e})}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(),Qe.report(50,{name:"setScaleMode"})):i("scale mode 0 | 1 | 2")}))}pause(){var e,t;return Qe.report(50,{name:"pause"}),null===(e=this.player)||void 0===e||null===(t=e.pause)||void 0===t?void 0:t.call(e)}clearView(){this.player.video.clearView(),Qe.report(50,{name:"clearView"})}play(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.url&&(Qe.url=t.url),"string"==typeof t&&(t={url:t});const r=i(t.url||this._opt.url,At);return this.urlInfo=nt(r,this._opt.isEzviz),r===this._opt.url&&null!==(e=this.player)&&void 0!==e&&e.playing?Promise.resolve():(this._opt=Object.assign({},this._opt,t||{},{url:r}),this._opt.urlQuery=We(t.url),Qe.report(50,{name:"play"}),new Promise(((e,t)=>{var i;if(!this._opt.url)return this.emit(L.error,M.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?u:c,o=r||-1!==e.url.indexOf(".flv")||this._opt.isFlv?h:A;this.player.updateOption({protocol:n,demuxType:o}),this.player.once(M.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(M.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(M.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(M.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(M.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(M.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(M.mseSourceBufferError,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","mseSourceBufferError close success")}))})),this.player.once(M.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(M.webcodecsWidthOrHeightChange,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","webcodecs Width Or Height Change reset player and play"),this._resetPlayer({useWCS:!0}),this.play(e).then((()=>{this.player.debug.log("Flv","webcodecs Width Or Height Change reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","webcodecs Width Or Height Change reset player and play error")}))}))})),this.player.once(M.webcodecsDecodeError,(()=>{this.pause().then((()=>{this.player._opt.autoWasm&&(this.player.debug.log("Flv","webcodecs decode error reset player and play"),this._resetPlayer({useWCS:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","webcodecs decode error reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","webcodecs decode error reset player and play error")})))}))})),this.player.once(M.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.once(L.delayTimeout,(()=>{this.player._opt.heartTimeoutReplay&&(this._heartTimeoutReplayTimes<this.player._opt.heartTimeoutReplayTimes||-1===this.player._opt.heartTimeoutReplayTimes)&&(this.player.debug.log("Flv",`delay timeout replay time is ${this._heartTimeoutReplayTimes}`),this._heartTimeoutReplayTimes+=1,this.play(e).then((()=>{this._heartTimeoutReplayTimes=0})))})),this.player.once(L.loadingTimeout,(()=>{this.player._opt.loadingTimeoutReplay&&(this._loadingTimeoutReplayTimes<this.player._opt.loadingTimeoutReplayTimes||-1===this.player._opt.loadingTimeoutReplayTimes)&&(this.player.debug.log("Flv",`loading timeout replay time is ${this._loadingTimeoutReplayTimes}`),this._loadingTimeoutReplayTimes+=1,this.play(e).then((e=>{this._loadingTimeoutReplayTimes=0})))})),this.hasLoaded()?this.player.play(e).then((()=>{t()})).catch((e=>{this.player&&(this.player.debug.warn("Flv","hasLoaded and play error",e),this.player.pause().then((()=>{i(e)})))})):this.player.once(L.decoderWorkerInit,(()=>{this.player.play(e).then((()=>{t()})).catch((e=>{this.player&&(this.player.debug.warn("Flv","decoderWorkerInit and play error",e),this.player.pause().then((()=>{i(e)})))}))})),this.player.once(L.videoInfo,(e=>{this._videoInfo=e||{}}))}))}resize(e,t){e>0&&t>0&&this.player.updateOption({width:e,height:t}),this.player.resize(),Qe.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){Qe.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)=>{ft.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}),Qe.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),Qe.report(50,{name:"fullScreen"}),Promise.resolve()}cancelFullScreen(){return Qe.report(50,{name:"cancelFullScreen"}),this.exitFullscreen()}exitFullscreen(){return this._setFullscreen(!1),Qe.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";return this.player.video?(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 Qe.report(50,{name:"getVersion"}),"1.0.3-alpha.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(ft,"ERROR",M),e(ft,"QUALITY_ENUM",at),e(ft,"ROTATE",[0,90,180,270]),e(ft,"TIMEOUT",{loadingTimeout:L.loadingTimeout,delayTimeout:L.delayTimeout}),e(ft,"version","1.0.3-alpha.2"),ft}));
|