@vtx/player 1.1.4 → 1.1.6
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/lib/api/fetch.js +75 -51
- package/lib/api/fetch.js.map +1 -1
- package/lib/api/index.js +62 -18
- package/lib/api/index.js.map +1 -1
- package/lib/api/types.d.ts +5 -5
- package/lib/bill-player/index.js +111 -59
- package/lib/bill-player/index.js.map +1 -1
- package/lib/bill-player/style/css.js +9 -0
- package/lib/bill-player/style/css.js.map +1 -1
- package/lib/bill-player/style/index.js +9 -0
- package/lib/bill-player/style/index.js.map +1 -1
- package/lib/components/set-tag-video/index.js +34 -6
- package/lib/components/set-tag-video/index.js.map +1 -1
- package/lib/components/set-tag-video/style/css.js.map +1 -1
- package/lib/components/set-tag-video/style/index.js.map +1 -1
- package/lib/components/split-screen/index.d.ts +1 -1
- package/lib/components/split-screen/index.js +14 -3
- package/lib/components/split-screen/index.js.map +1 -1
- package/lib/components/split-screen/style/css.js.map +1 -1
- package/lib/components/split-screen/style/index.js.map +1 -1
- package/lib/components/tag-video/index.js +38 -10
- package/lib/components/tag-video/index.js.map +1 -1
- package/lib/components/tag-video/style/css.js.map +1 -1
- package/lib/components/tag-video/style/index.js.map +1 -1
- package/lib/components/video-scale/index.d.ts +1 -1
- package/lib/components/video-scale/index.js +9 -2
- package/lib/components/video-scale/index.js.map +1 -1
- package/lib/components/video-scale/style/css.js.map +1 -1
- package/lib/components/video-scale/style/index.js.map +1 -1
- package/lib/context/index.js +4 -0
- package/lib/context/index.js.map +1 -1
- package/lib/controls/index.d.ts +3 -3
- package/lib/controls/index.js +99 -34
- package/lib/controls/index.js.map +1 -1
- package/lib/controls/style/css.js +5 -0
- package/lib/controls/style/css.js.map +1 -1
- package/lib/controls/style/index.js +5 -0
- package/lib/controls/style/index.js.map +1 -1
- package/lib/history-control/index.d.ts +2 -2
- package/lib/history-control/index.js +114 -57
- package/lib/history-control/index.js.map +1 -1
- package/lib/history-control/style/css.js +6 -0
- package/lib/history-control/style/css.js.map +1 -1
- package/lib/history-control/style/index.js +6 -0
- package/lib/history-control/style/index.js.map +1 -1
- package/lib/history-control-v2/components/grid-item/index.js +70 -32
- package/lib/history-control-v2/components/grid-item/index.js.map +1 -1
- package/lib/history-control-v2/components/panel/index.js +105 -36
- package/lib/history-control-v2/components/panel/index.js.map +1 -1
- package/lib/history-control-v2/context.js +2 -0
- package/lib/history-control-v2/context.js.map +1 -1
- package/lib/history-control-v2/index.d.ts +4 -4
- package/lib/history-control-v2/index.js +163 -95
- package/lib/history-control-v2/index.js.map +1 -1
- package/lib/history-control-v2/style/css.js +10 -0
- package/lib/history-control-v2/style/css.js.map +1 -1
- package/lib/history-control-v2/style/index.js +10 -0
- package/lib/history-control-v2/style/index.js.map +1 -1
- package/lib/history-control-v2/utils.js +21 -1
- package/lib/history-control-v2/utils.js.map +1 -1
- package/lib/history-player/index.d.ts +1 -1
- package/lib/history-player/index.js +118 -73
- package/lib/history-player/index.js.map +1 -1
- package/lib/history-player/style/css.js +3 -0
- package/lib/history-player/style/css.js.map +1 -1
- package/lib/history-player/style/index.js +3 -0
- package/lib/history-player/style/index.js.map +1 -1
- package/lib/hooks/useSettings.js +6 -1
- package/lib/hooks/useSettings.js.map +1 -1
- package/lib/icons/index.js +171 -23
- package/lib/icons/index.js.map +1 -1
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -1
- package/lib/live-channel-player/index.js +67 -31
- package/lib/live-channel-player/index.js.map +1 -1
- package/lib/live-channel-player/style/css.js +1 -0
- package/lib/live-channel-player/style/css.js.map +1 -1
- package/lib/live-channel-player/style/index.js +1 -0
- package/lib/live-channel-player/style/index.js.map +1 -1
- package/lib/live-control/index.d.ts +2 -2
- package/lib/live-control/index.js +83 -32
- package/lib/live-control/index.js.map +1 -1
- package/lib/live-control/style/css.js +4 -0
- package/lib/live-control/style/css.js.map +1 -1
- package/lib/live-control/style/index.js +4 -0
- package/lib/live-control/style/index.js.map +1 -1
- package/lib/live-control-v2/index.d.ts +3 -3
- package/lib/live-control-v2/index.js +131 -59
- package/lib/live-control-v2/index.js.map +1 -1
- package/lib/live-control-v2/style/css.js +7 -0
- package/lib/live-control-v2/style/css.js.map +1 -1
- package/lib/live-control-v2/style/index.js +7 -0
- package/lib/live-control-v2/style/index.js.map +1 -1
- package/lib/live-player/index.js +58 -31
- package/lib/live-player/index.js.map +1 -1
- package/lib/live-player/style/css.js +2 -0
- package/lib/live-player/style/css.js.map +1 -1
- package/lib/live-player/style/index.js +2 -0
- package/lib/live-player/style/index.js.map +1 -1
- package/lib/player/index.d.ts +2 -2
- package/lib/player/index.js +127 -47
- package/lib/player/index.js.map +1 -1
- package/lib/typings/h5player.d.ts +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +74 -8
- package/lib/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","names":[
|
|
1
|
+
{"version":3,"file":"css.js","names":[],"sources":["history-control-v2/style/index.js"],"sourcesContent":["import \"antd/lib/button/style\";\nimport \"antd/lib/space/style\";\nimport \"antd/lib/table/style\";\nimport \"antd/lib/tooltip/style\";\nimport '../../controls/style';\nimport '../../history-player/style';\nimport '../../components/split-screen/style';\nimport '../../components/video-scale/style';\nimport '../../components/tag-video/style';\nimport '../../components/set-tag-video/style';\nimport './index.less';\n"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("antd/lib/button/style");
|
|
4
|
+
|
|
4
5
|
require("antd/lib/space/style");
|
|
6
|
+
|
|
5
7
|
require("antd/lib/table/style");
|
|
8
|
+
|
|
6
9
|
require("antd/lib/tooltip/style");
|
|
10
|
+
|
|
7
11
|
require("../../controls/style");
|
|
12
|
+
|
|
8
13
|
require("../../history-player/style");
|
|
14
|
+
|
|
9
15
|
require("../../components/split-screen/style");
|
|
16
|
+
|
|
10
17
|
require("../../components/video-scale/style");
|
|
18
|
+
|
|
11
19
|
require("../../components/tag-video/style");
|
|
20
|
+
|
|
12
21
|
require("../../components/set-tag-video/style");
|
|
22
|
+
|
|
13
23
|
require("./index.less");
|
|
14
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["history-control-v2/style/index.js"],"sourcesContent":["import \"antd/lib/button/style\";\nimport \"antd/lib/space/style\";\nimport \"antd/lib/table/style\";\nimport \"antd/lib/tooltip/style\";\nimport '../../controls/style';\nimport '../../history-player/style';\nimport '../../components/split-screen/style';\nimport '../../components/video-scale/style';\nimport '../../components/tag-video/style';\nimport '../../components/set-tag-video/style';\nimport './index.less';\n"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
|
|
@@ -4,15 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getUrlTableData = exports.getChannelData = exports.DEFAULT_PLAY_PARAMS = exports.DEFAULT_GRID = exports.DEFAULT_CHANNELS = exports.DEFAULT_ACTIVE = void 0;
|
|
7
|
+
|
|
7
8
|
var _utils = require("../utils");
|
|
9
|
+
|
|
8
10
|
var _moment = _interopRequireDefault(require("moment"));
|
|
11
|
+
|
|
9
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
10
14
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
15
|
+
|
|
11
16
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
|
|
12
18
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
+
|
|
13
20
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
21
|
+
|
|
14
22
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
15
|
-
|
|
23
|
+
|
|
24
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
25
|
+
|
|
16
26
|
/** 默认播放器参数 */
|
|
17
27
|
var DEFAULT_PLAY_PARAMS = {
|
|
18
28
|
channelNum: '',
|
|
@@ -36,6 +46,7 @@ var DEFAULT_GRID = 1;
|
|
|
36
46
|
exports.DEFAULT_GRID = DEFAULT_GRID;
|
|
37
47
|
var DEFAULT_ACTIVE = 0;
|
|
38
48
|
exports.DEFAULT_ACTIVE = DEFAULT_ACTIVE;
|
|
49
|
+
|
|
39
50
|
var DEFAULT_CHANNELS = _toConsumableArray(Array(25)).map(function (item, index) {
|
|
40
51
|
return {
|
|
41
52
|
channelIndex: index,
|
|
@@ -55,9 +66,13 @@ var DEFAULT_CHANNELS = _toConsumableArray(Array(25)).map(function (item, index)
|
|
|
55
66
|
* @param data
|
|
56
67
|
* @returns
|
|
57
68
|
*/
|
|
69
|
+
|
|
70
|
+
|
|
58
71
|
exports.DEFAULT_CHANNELS = DEFAULT_CHANNELS;
|
|
72
|
+
|
|
59
73
|
var getChannelData = function getChannelData(data, origin) {
|
|
60
74
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
75
|
+
|
|
61
76
|
var segmentData = {
|
|
62
77
|
list: data.list,
|
|
63
78
|
start: (0, _moment["default"])(origin === null || origin === void 0 ? void 0 : origin.beginTime).startOf('day'),
|
|
@@ -88,9 +103,13 @@ var getChannelData = function getChannelData(data, origin) {
|
|
|
88
103
|
* @param data
|
|
89
104
|
* @returns
|
|
90
105
|
*/
|
|
106
|
+
|
|
107
|
+
|
|
91
108
|
exports.getChannelData = getChannelData;
|
|
109
|
+
|
|
92
110
|
var getUrlTableData = function getUrlTableData(data) {
|
|
93
111
|
var _a;
|
|
112
|
+
|
|
94
113
|
var result = (_a = data.list) === null || _a === void 0 ? void 0 : _a.map(function (item, i) {
|
|
95
114
|
var beginTime = (0, _moment["default"])(item.beginTime);
|
|
96
115
|
var endTime = (0, _moment["default"])(item.endTime);
|
|
@@ -114,5 +133,6 @@ var getUrlTableData = function getUrlTableData(data) {
|
|
|
114
133
|
});
|
|
115
134
|
return result || [];
|
|
116
135
|
};
|
|
136
|
+
|
|
117
137
|
exports.getUrlTableData = getUrlTableData;
|
|
118
138
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["
|
|
1
|
+
{"version":3,"file":"utils.js","names":["DEFAULT_PLAY_PARAMS","channelNum","videoChannelId","tagId","index","url","player","startTime","endTime","deviceId","deviceName","channelName","tableList","segmentData","list","DEFAULT_GRID","DEFAULT_ACTIVE","DEFAULT_CHANNELS","Array","map","item","channelIndex","getChannelData","data","origin","_a","_b","_c","_d","_e","_f","_g","_h","start","moment","beginTime","startOf","end","endOf","result","hkType","playbackUrl","totalTimeUrl","getUrlTableData","code","hasLabel","i","totalSeconds","diff","format","TimeFormat","params","size","bytesToMegaBytes","duration","secondsToString","downloadUrl"],"sources":["history-control-v2/utils.js"],"sourcesContent":["import { TimeFormat, bytesToMegaBytes, secondsToString } from '../utils';\nimport moment from 'moment';\n/** 默认播放器参数 */\nexport const DEFAULT_PLAY_PARAMS = {\n channelNum: '',\n videoChannelId: '',\n tagId: '',\n index: -1,\n url: '',\n player: '',\n startTime: '',\n endTime: '',\n deviceId: '',\n deviceName: '',\n channelName: '',\n tableList: [],\n segmentData: {\n list: [],\n },\n};\nexport const DEFAULT_GRID = 1;\nexport const DEFAULT_ACTIVE = 0;\nexport const DEFAULT_CHANNELS = [...Array(25)].map((item, index) => {\n return {\n channelIndex: index,\n // 通道号\n channelNum: '',\n // 用来判断在下面列表的位置\n index: -1,\n // 如果没有 就不播放\n url: '',\n segmentData: {\n list: [],\n },\n };\n});\n/**\n * 获取历史回放表格数据\n * @param data\n * @returns\n */\nexport const getChannelData = (data, origin) => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const segmentData = {\n list: data.list,\n start: moment(origin === null || origin === void 0 ? void 0 : origin.beginTime).startOf('day'),\n end: moment(origin === null || origin === void 0 ? void 0 : origin.endTime).endOf('day'),\n };\n const result = {\n hkType: data.hkType,\n deviceId: data.deviceId,\n deviceName: data.deviceName,\n channelNum: data.channelNum,\n channelName: data.channelName,\n tagId: (origin === null || origin === void 0 ? void 0 : origin.tagId) || '',\n url: ((_b = (_a = data.list) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.playbackUrl) || data.totalTimeUrl,\n player: data === null || data === void 0 ? void 0 : data.player,\n videoChannelId: data.videoChannelId,\n tableList: getUrlTableData(data),\n segmentData,\n index: (origin === null || origin === void 0 ? void 0 : origin.tagId) ? -1 : 0,\n code: (_d = (_c = data.list) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.code,\n startTime: ((_f = (_e = data.list) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.beginTime) || origin.beginTime,\n endTime: ((_h = (_g = data.list) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.endTime) || origin.endTime,\n hasLabel: data.hasLabel,\n };\n return result;\n};\n/**\n * 获取历史回放表格数据\n * @param data\n * @returns\n */\nexport const getUrlTableData = (data) => {\n var _a;\n const result = (_a = data.list) === null || _a === void 0 ? void 0 : _a.map((item, i) => {\n const beginTime = moment(item.beginTime);\n const endTime = moment(item.endTime);\n const totalSeconds = moment(endTime).diff(moment(beginTime), 'seconds');\n return {\n index: i + 1,\n hkType: data.hkType,\n deviceId: data.deviceId,\n channelName: data.channelName,\n deviceName: data.deviceName,\n channelNum: data.channelNum,\n videoChannelId: data.videoChannelId,\n beginTime: beginTime.format(TimeFormat.params),\n endTime: endTime.format(TimeFormat.params),\n size: bytesToMegaBytes(item.size),\n duration: secondsToString(totalSeconds),\n downloadUrl: '',\n url: item.playbackUrl || data.url,\n code: item.code,\n };\n });\n return result || [];\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;;;;;;;;;;;;;;;AACA;AACO,IAAMA,mBAAmB,GAAG;EAC/BC,UAAU,EAAE,EADmB;EAE/BC,cAAc,EAAE,EAFe;EAG/BC,KAAK,EAAE,EAHwB;EAI/BC,KAAK,EAAE,CAAC,CAJuB;EAK/BC,GAAG,EAAE,EAL0B;EAM/BC,MAAM,EAAE,EANuB;EAO/BC,SAAS,EAAE,EAPoB;EAQ/BC,OAAO,EAAE,EARsB;EAS/BC,QAAQ,EAAE,EATqB;EAU/BC,UAAU,EAAE,EAVmB;EAW/BC,WAAW,EAAE,EAXkB;EAY/BC,SAAS,EAAE,EAZoB;EAa/BC,WAAW,EAAE;IACTC,IAAI,EAAE;EADG;AAbkB,CAA5B;;AAiBA,IAAMC,YAAY,GAAG,CAArB;;AACA,IAAMC,cAAc,GAAG,CAAvB;;;AACA,IAAMC,gBAAgB,GAAG,mBAAIC,KAAK,CAAC,EAAD,CAAT,EAAeC,GAAf,CAAmB,UAACC,IAAD,EAAOhB,KAAP,EAAiB;EAChE,OAAO;IACHiB,YAAY,EAAEjB,KADX;IAEH;IACAH,UAAU,EAAE,EAHT;IAIH;IACAG,KAAK,EAAE,CAAC,CALL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AQHiC,SAAS,EAAEA,SAAS,CAACc,MAAV,CAAiBC,iBAAA,CAAWC,MAA5B,CARR;MASH3C,OAAO,EAAEA,OAAO,CAACyC,MAAR,CAAeC,iBAAA,CAAWC,MAA1B,CATN;MAUHC,IAAI,EAAE,IAAAC,uBAAA,EAAiBjC,IAAI,CAACgC,IAAtB,CAVH;MAWHE,QAAQ,EAAE,IAAAC,sBAAA,EAAgBR,YAAhB,CAXP;MAYHS,WAAW,EAAE,EAZV;MAaHnD,GAAG,EAAEe,IAAI,CAACqB,WAAL,IAAoBlB,IAAI,CAAClB,GAb3B;MAcHuC,IAAI,EAAExB,IAAI,CAACwB;IAdR,CAAP;EAgBH,CApBoE,CAArE;EAqBA,OAAOL,MAAM,IAAI,EAAjB;AACH,CAxBM"}
|
|
@@ -1,34 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = exports.HistoryPlayer = void 0;
|
|
9
|
+
|
|
8
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
9
12
|
var _react = require("react");
|
|
13
|
+
|
|
10
14
|
var _controls = require("../controls");
|
|
15
|
+
|
|
11
16
|
var _icons = require("../icons");
|
|
17
|
+
|
|
12
18
|
var _player = _interopRequireDefault(require("../player"));
|
|
19
|
+
|
|
13
20
|
var _utils = require("../utils");
|
|
21
|
+
|
|
14
22
|
var _ahooks = require("ahooks");
|
|
23
|
+
|
|
15
24
|
var _slider = _interopRequireDefault(require("antd/lib/slider"));
|
|
25
|
+
|
|
16
26
|
var _space = _interopRequireDefault(require("antd/lib/space"));
|
|
27
|
+
|
|
17
28
|
var _moment = _interopRequireDefault(require("moment"));
|
|
29
|
+
|
|
18
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
31
|
+
|
|
32
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
33
|
+
|
|
20
34
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
35
|
+
|
|
21
36
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
37
|
+
|
|
22
38
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
23
|
-
|
|
24
|
-
function
|
|
39
|
+
|
|
40
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
41
|
+
|
|
42
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
43
|
+
|
|
25
44
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
|
+
|
|
26
46
|
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
27
47
|
function adopt(value) {
|
|
28
48
|
return value instanceof P ? value : new P(function (resolve) {
|
|
29
49
|
resolve(value);
|
|
30
50
|
});
|
|
31
51
|
}
|
|
52
|
+
|
|
32
53
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
54
|
function fulfilled(value) {
|
|
34
55
|
try {
|
|
@@ -37,6 +58,7 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
|
|
|
37
58
|
reject(e);
|
|
38
59
|
}
|
|
39
60
|
}
|
|
61
|
+
|
|
40
62
|
function rejected(value) {
|
|
41
63
|
try {
|
|
42
64
|
step(generator["throw"](value));
|
|
@@ -44,62 +66,69 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
|
|
|
44
66
|
reject(e);
|
|
45
67
|
}
|
|
46
68
|
}
|
|
69
|
+
|
|
47
70
|
function step(result) {
|
|
48
71
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
49
72
|
}
|
|
73
|
+
|
|
50
74
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
51
75
|
});
|
|
52
76
|
};
|
|
77
|
+
|
|
53
78
|
var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
54
79
|
var url = props.url,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
80
|
+
type = props.type,
|
|
81
|
+
enableAgent = props.enableAgent,
|
|
82
|
+
_props$width = props.width,
|
|
83
|
+
width = _props$width === void 0 ? '100%' : _props$width,
|
|
84
|
+
_props$height = props.height,
|
|
85
|
+
height = _props$height === void 0 ? '100%' : _props$height,
|
|
86
|
+
captureName = props.captureName,
|
|
87
|
+
_props$controlBottom = props.controlBottom,
|
|
88
|
+
controlBottom = _props$controlBottom === void 0 ? 0 : _props$controlBottom,
|
|
89
|
+
startTime = props.startTime,
|
|
90
|
+
endTime = props.endTime,
|
|
91
|
+
onTimeChange = props.onTimeChange,
|
|
92
|
+
screenshot = props.screenshot,
|
|
93
|
+
_props$showInfo = props.showInfo,
|
|
94
|
+
showInfo = _props$showInfo === void 0 ? false : _props$showInfo,
|
|
95
|
+
_props$info = props.info,
|
|
96
|
+
info = _props$info === void 0 ? [] : _props$info,
|
|
97
|
+
extraButton = props.extraButton,
|
|
98
|
+
_props$controlVisible = props.controlVisible,
|
|
99
|
+
controlVisible = _props$controlVisible === void 0 ? undefined : _props$controlVisible;
|
|
75
100
|
var totalTime = (0, _moment["default"])(endTime).diff((0, _moment["default"])(startTime), 'seconds');
|
|
76
101
|
var containerRef = (0, _react.useRef)(null);
|
|
77
102
|
var wrapRef = (0, _react.useRef)(null);
|
|
78
103
|
var controlsRef = (0, _react.useRef)(null);
|
|
79
104
|
var playerRef = (0, _react.useRef)();
|
|
105
|
+
|
|
80
106
|
var _useFullscreen = (0, _ahooks.useFullscreen)(wrapRef),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
107
|
+
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
108
|
+
isFullscreen = _useFullscreen2[0],
|
|
109
|
+
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
110
|
+
|
|
84
111
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
112
|
+
play: false,
|
|
113
|
+
error: false,
|
|
114
|
+
loading: false,
|
|
115
|
+
id: 'vtx_hk_player_' + (0, _utils.guidGenerator)(),
|
|
116
|
+
volume: 0,
|
|
117
|
+
currentTime: 0,
|
|
118
|
+
progress: 0,
|
|
119
|
+
controls: {
|
|
120
|
+
progress: true
|
|
121
|
+
}
|
|
122
|
+
}),
|
|
123
|
+
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
124
|
+
state = _useSetState2[0],
|
|
125
|
+
setState = _useSetState2[1];
|
|
126
|
+
|
|
99
127
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
100
128
|
return {
|
|
101
129
|
seekTo: function seekTo(time) {
|
|
102
130
|
var player = playerRef.current;
|
|
131
|
+
|
|
103
132
|
if (player) {
|
|
104
133
|
var currentTime = (0, _moment["default"])(time).diff((0, _moment["default"])(startTime), 'seconds');
|
|
105
134
|
return player.seekTo(currentTime);
|
|
@@ -122,50 +151,56 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
122
151
|
type: type
|
|
123
152
|
});
|
|
124
153
|
playerRef.current = player;
|
|
154
|
+
|
|
125
155
|
(function () {
|
|
126
156
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
127
157
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
128
|
-
while (1)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
_context.next = 3;
|
|
140
|
-
return setState({
|
|
141
|
-
loading: true,
|
|
142
|
-
error: false,
|
|
143
|
-
controls: {
|
|
144
|
-
progress: player.type === 'hk_ws' || player.type === 'hkcar_ws'
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
case 3:
|
|
148
|
-
player.playBack().then(function () {
|
|
149
|
-
return setState({
|
|
150
|
-
play: true,
|
|
151
|
-
error: false
|
|
158
|
+
while (1) {
|
|
159
|
+
switch (_context.prev = _context.next) {
|
|
160
|
+
case 0:
|
|
161
|
+
player.onTimeUpdate(function (currentTime, speed) {
|
|
162
|
+
if (!state.loading) {
|
|
163
|
+
setState({
|
|
164
|
+
currentTime: Math.floor(currentTime),
|
|
165
|
+
progress: Math.floor(currentTime / totalTime * 100),
|
|
166
|
+
speed: speed
|
|
167
|
+
});
|
|
168
|
+
}
|
|
152
169
|
});
|
|
153
|
-
|
|
170
|
+
_context.next = 3;
|
|
154
171
|
return setState({
|
|
155
|
-
|
|
172
|
+
loading: true,
|
|
173
|
+
error: false,
|
|
174
|
+
controls: {
|
|
175
|
+
progress: player.type === 'hk_ws' || player.type === 'hkcar_ws'
|
|
176
|
+
}
|
|
156
177
|
});
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
178
|
+
|
|
179
|
+
case 3:
|
|
180
|
+
player.playBack().then(function () {
|
|
181
|
+
return setState({
|
|
182
|
+
play: true,
|
|
183
|
+
error: false
|
|
184
|
+
});
|
|
185
|
+
})["catch"](function () {
|
|
186
|
+
return setState({
|
|
187
|
+
error: true
|
|
188
|
+
});
|
|
189
|
+
})["finally"](function () {
|
|
190
|
+
return setState({
|
|
191
|
+
loading: false
|
|
192
|
+
});
|
|
160
193
|
});
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
194
|
+
|
|
195
|
+
case 4:
|
|
196
|
+
case "end":
|
|
197
|
+
return _context.stop();
|
|
198
|
+
}
|
|
165
199
|
}
|
|
166
200
|
}, _callee);
|
|
167
201
|
}));
|
|
168
202
|
})();
|
|
203
|
+
|
|
169
204
|
return function () {
|
|
170
205
|
player.destroy();
|
|
171
206
|
setState({
|
|
@@ -181,12 +216,15 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
181
216
|
}
|
|
182
217
|
}, [state.currentTime, state.speed]);
|
|
183
218
|
/** 截图方法 */
|
|
219
|
+
|
|
184
220
|
var handleCapture = function handleCapture(e) {
|
|
185
221
|
var player = playerRef.current;
|
|
186
222
|
player && player.capture(captureName, screenshot);
|
|
187
223
|
e.stopPropagation();
|
|
188
224
|
};
|
|
189
225
|
/** 全屏方法 */
|
|
226
|
+
|
|
227
|
+
|
|
190
228
|
var handleFullScreen = function handleFullScreen(e) {
|
|
191
229
|
toggleFullscreen();
|
|
192
230
|
var player = playerRef.current;
|
|
@@ -194,6 +232,8 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
194
232
|
e.stopPropagation();
|
|
195
233
|
};
|
|
196
234
|
/** 进度条控制器 */
|
|
235
|
+
|
|
236
|
+
|
|
197
237
|
var handleSlider = function handleSlider(value) {
|
|
198
238
|
var currentTime = Math.floor(totalTime * value / 100);
|
|
199
239
|
var player = playerRef.current;
|
|
@@ -203,6 +243,8 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
203
243
|
player === null || player === void 0 ? void 0 : player.seekTo(currentTime);
|
|
204
244
|
};
|
|
205
245
|
/** 暂停方法 */
|
|
246
|
+
|
|
247
|
+
|
|
206
248
|
var handlePause = function handlePause() {
|
|
207
249
|
var player = playerRef.current;
|
|
208
250
|
player === null || player === void 0 ? void 0 : player.pause(function () {
|
|
@@ -212,6 +254,8 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
212
254
|
});
|
|
213
255
|
};
|
|
214
256
|
/** 恢复播放方法 */
|
|
257
|
+
|
|
258
|
+
|
|
215
259
|
var handleResume = function handleResume() {
|
|
216
260
|
var player = playerRef.current;
|
|
217
261
|
player === null || player === void 0 ? void 0 : player.resume(function () {
|
|
@@ -220,6 +264,7 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
220
264
|
});
|
|
221
265
|
});
|
|
222
266
|
};
|
|
267
|
+
|
|
223
268
|
return (0, _jsxRuntime.jsxs)("div", Object.assign({
|
|
224
269
|
className: "vtx-history-player",
|
|
225
270
|
ref: wrapRef,
|