@webex/plugin-meetings 3.10.0-next.8 → 3.10.0-webex-services-ready.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/annotation/annotation.types.js.map +1 -1
- package/dist/annotation/constants.js.map +1 -1
- package/dist/annotation/index.js +19 -22
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +6 -6
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/collection.js.map +1 -1
- package/dist/breakouts/edit-lock-error.js +9 -11
- package/dist/breakouts/edit-lock-error.js.map +1 -1
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +126 -127
- package/dist/breakouts/index.js.map +1 -1
- package/dist/breakouts/request.js +6 -8
- package/dist/breakouts/request.js.map +1 -1
- package/dist/breakouts/utils.js.map +1 -1
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js +1 -2
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +9 -11
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +10 -12
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-forbidden-error.js +10 -12
- package/dist/common/errors/join-forbidden-error.js.map +1 -1
- package/dist/common/errors/join-meeting.js +10 -12
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/join-webinar-error.js +9 -11
- package/dist/common/errors/join-webinar-error.js.map +1 -1
- package/dist/common/errors/media.js +9 -11
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/multistream-not-supported-error.js +9 -11
- package/dist/common/errors/multistream-not-supported-error.js.map +1 -1
- package/dist/common/errors/no-meeting-info.js +9 -11
- package/dist/common/errors/no-meeting-info.js.map +1 -1
- package/dist/common/errors/parameter.js +11 -14
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +9 -11
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +9 -11
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reclaim-host-role-errors.js +32 -38
- package/dist/common/errors/reclaim-host-role-errors.js.map +1 -1
- package/dist/common/errors/reconnection-not-started.js +5 -6
- package/dist/common/errors/reconnection-not-started.js.map +1 -1
- package/dist/common/errors/reconnection.js +9 -11
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +9 -11
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +20 -29
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +9 -12
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js +9 -10
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js +9 -10
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +17 -17
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js +1 -2
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +0 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js +11 -8
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/enums.js.map +1 -1
- package/dist/controls-options-manager/index.js +1 -2
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/types.js.map +1 -1
- package/dist/controls-options-manager/util.js +1 -2
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/hashTree/constants.js +20 -0
- package/dist/hashTree/constants.js.map +1 -0
- package/dist/hashTree/hashTree.js +515 -0
- package/dist/hashTree/hashTree.js.map +1 -0
- package/dist/hashTree/hashTreeParser.js +1266 -0
- package/dist/hashTree/hashTreeParser.js.map +1 -0
- package/dist/hashTree/types.js +21 -0
- package/dist/hashTree/types.js.map +1 -0
- package/dist/hashTree/utils.js +48 -0
- package/dist/hashTree/utils.js.map +1 -0
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/interceptors/index.js.map +1 -1
- package/dist/interceptors/locusRetry.js +6 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interceptors/locusRouteToken.js +6 -8
- package/dist/interceptors/locusRouteToken.js.map +1 -1
- package/dist/interpretation/collection.js.map +1 -1
- package/dist/interpretation/index.js +1 -2
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/interpretation/siLanguage.js.map +1 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +551 -94
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +3 -4
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/locus-info/types.js +7 -0
- package/dist/locus-info/types.js.map +1 -0
- package/dist/media/MediaConnectionAwaiter.js +1 -2
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +0 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +15 -17
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js.map +1 -1
- package/dist/meeting/brbState.js +8 -9
- package/dist/meeting/brbState.js.map +1 -1
- package/dist/meeting/connectionStateHandler.js +10 -13
- package/dist/meeting/connectionStateHandler.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1555 -1527
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +13 -17
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +11 -12
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +101 -104
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/type.js.map +1 -1
- package/dist/meeting/util.js +24 -23
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.js +3 -3
- package/dist/meeting/voicea-meeting.js.map +1 -1
- package/dist/meeting-info/collection.js +7 -10
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +1 -2
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +135 -146
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +1 -2
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js +36 -37
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +30 -31
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +6 -8
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +179 -141
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +6 -8
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +25 -23
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +1 -2
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js +6 -3
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +1 -2
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +18 -21
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +8 -11
- package/dist/members/request.js.map +1 -1
- package/dist/members/types.js.map +1 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +3 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +3 -4
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +1 -2
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +34 -45
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +8 -9
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +12 -15
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +1 -2
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +122 -123
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +29 -30
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/personal-meeting-room/index.js +16 -19
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +7 -10
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/clusterReachability.js +56 -373
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +203 -205
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +14 -1
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/reachabilityPeerConnection.js +445 -0
- package/dist/reachability/reachabilityPeerConnection.js.map +1 -0
- package/dist/reachability/request.js.map +1 -1
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/constants.js.map +1 -1
- package/dist/reactions/reactions.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +178 -176
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/enums.js.map +1 -1
- package/dist/recording-controller/index.js +1 -2
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/roap/index.js +12 -15
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +24 -26
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +75 -76
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/types.js.map +1 -1
- package/dist/transcription/index.js +4 -5
- package/dist/transcription/index.js.map +1 -1
- package/dist/types/constants.d.ts +26 -21
- package/dist/types/hashTree/constants.d.ts +8 -0
- package/dist/types/hashTree/hashTree.d.ts +129 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +260 -0
- package/dist/types/hashTree/types.d.ts +25 -0
- package/dist/types/hashTree/utils.d.ts +9 -0
- package/dist/types/locus-info/index.d.ts +91 -42
- package/dist/types/locus-info/types.d.ts +46 -0
- package/dist/types/meeting/index.d.ts +22 -9
- package/dist/types/meetings/index.d.ts +9 -2
- package/dist/types/metrics/constants.d.ts +2 -0
- package/dist/types/reachability/clusterReachability.d.ts +10 -88
- package/dist/types/reachability/reachability.types.d.ts +12 -1
- package/dist/types/reachability/reachabilityPeerConnection.d.ts +111 -0
- package/dist/webinar/collection.js +1 -2
- package/dist/webinar/collection.js.map +1 -1
- package/dist/webinar/index.js +148 -158
- package/dist/webinar/index.js.map +1 -1
- package/package.json +22 -21
- package/src/constants.ts +13 -1
- package/src/hashTree/constants.ts +9 -0
- package/src/hashTree/hashTree.ts +463 -0
- package/src/hashTree/hashTreeParser.ts +1161 -0
- package/src/hashTree/types.ts +30 -0
- package/src/hashTree/utils.ts +42 -0
- package/src/locus-info/index.ts +556 -85
- package/src/locus-info/types.ts +48 -0
- package/src/meeting/index.ts +58 -26
- package/src/meeting/util.ts +1 -0
- package/src/meetings/index.ts +104 -51
- package/src/metrics/constants.ts +2 -0
- package/src/reachability/clusterReachability.ts +50 -347
- package/src/reachability/reachability.types.ts +15 -1
- package/src/reachability/reachabilityPeerConnection.ts +416 -0
- package/test/unit/spec/hashTree/hashTree.ts +655 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +1532 -0
- package/test/unit/spec/hashTree/utils.ts +103 -0
- package/test/unit/spec/locus-info/index.js +667 -1
- package/test/unit/spec/meeting/index.js +91 -20
- package/test/unit/spec/meeting/utils.js +77 -0
- package/test/unit/spec/meetings/index.js +71 -26
- package/test/unit/spec/reachability/clusterReachability.ts +281 -138
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
|
|
4
|
+
var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
5
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
|
6
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
7
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
|
8
|
+
var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
|
|
9
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
10
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
11
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
12
|
+
value: true
|
|
13
|
+
});
|
|
14
|
+
exports.ReachabilityPeerConnection = void 0;
|
|
15
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
16
|
+
var _set = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/set"));
|
|
17
|
+
var _entries = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/entries"));
|
|
18
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
|
|
19
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
20
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
|
|
21
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
22
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
23
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
|
|
24
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
|
|
25
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
|
|
26
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
27
|
+
var _common = require("@webex/common");
|
|
28
|
+
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
29
|
+
var _util = require("./util");
|
|
30
|
+
var _eventsScope = _interopRequireDefault(require("../common/events/events-scope"));
|
|
31
|
+
var _constants = require("../constants");
|
|
32
|
+
var _reachability = require("./reachability.types");
|
|
33
|
+
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
34
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
35
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
36
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
37
|
+
/**
|
|
38
|
+
* A class to handle RTCPeerConnection lifecycle and ICE candidate gathering for reachability checks.
|
|
39
|
+
* It will do all the work like PeerConnection lifecycle, candidate processing, result management, and event emission.
|
|
40
|
+
*/
|
|
41
|
+
var ReachabilityPeerConnection = exports.ReachabilityPeerConnection = /*#__PURE__*/function (_EventsScope) {
|
|
42
|
+
/**
|
|
43
|
+
* Constructor for ReachabilityPeerConnection
|
|
44
|
+
* @param {string} clusterName name of the cluster
|
|
45
|
+
* @param {ClusterNode} clusterInfo information about the media cluster
|
|
46
|
+
*/
|
|
47
|
+
function ReachabilityPeerConnection(clusterName, clusterInfo) {
|
|
48
|
+
var _this;
|
|
49
|
+
(0, _classCallCheck2.default)(this, ReachabilityPeerConnection);
|
|
50
|
+
_this = _callSuper(this, ReachabilityPeerConnection);
|
|
51
|
+
(0, _defineProperty2.default)(_this, "numUdpUrls", void 0);
|
|
52
|
+
(0, _defineProperty2.default)(_this, "numTcpUrls", void 0);
|
|
53
|
+
(0, _defineProperty2.default)(_this, "numXTlsUrls", void 0);
|
|
54
|
+
(0, _defineProperty2.default)(_this, "pc", void 0);
|
|
55
|
+
(0, _defineProperty2.default)(_this, "defer", void 0);
|
|
56
|
+
(0, _defineProperty2.default)(_this, "startTimestamp", void 0);
|
|
57
|
+
(0, _defineProperty2.default)(_this, "srflxIceCandidates", []);
|
|
58
|
+
(0, _defineProperty2.default)(_this, "clusterName", void 0);
|
|
59
|
+
(0, _defineProperty2.default)(_this, "result", void 0);
|
|
60
|
+
(0, _defineProperty2.default)(_this, "emittedSubnets", new _set.default());
|
|
61
|
+
_this.clusterName = clusterName;
|
|
62
|
+
_this.numUdpUrls = clusterInfo.udp.length;
|
|
63
|
+
_this.numTcpUrls = clusterInfo.tcp.length;
|
|
64
|
+
_this.numXTlsUrls = clusterInfo.xtls.length;
|
|
65
|
+
_this.pc = _this.createPeerConnection(clusterInfo);
|
|
66
|
+
_this.defer = new _common.Defer();
|
|
67
|
+
_this.result = {
|
|
68
|
+
udp: {
|
|
69
|
+
result: 'untested'
|
|
70
|
+
},
|
|
71
|
+
tcp: {
|
|
72
|
+
result: 'untested'
|
|
73
|
+
},
|
|
74
|
+
xtls: {
|
|
75
|
+
result: 'untested'
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return _this;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Gets total elapsed time, can be called only after start() is called
|
|
83
|
+
* @returns {number} Milliseconds
|
|
84
|
+
*/
|
|
85
|
+
(0, _inherits2.default)(ReachabilityPeerConnection, _EventsScope);
|
|
86
|
+
return (0, _createClass2.default)(ReachabilityPeerConnection, [{
|
|
87
|
+
key: "getElapsedTime",
|
|
88
|
+
value: function getElapsedTime() {
|
|
89
|
+
return Math.round(performance.now() - this.startTimestamp);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Generate peerConnection config settings
|
|
94
|
+
* @param {ClusterNode} cluster
|
|
95
|
+
* @returns {RTCConfiguration} peerConnectionConfig
|
|
96
|
+
*/
|
|
97
|
+
}, {
|
|
98
|
+
key: "createPeerConnection",
|
|
99
|
+
value:
|
|
100
|
+
/**
|
|
101
|
+
* Creates an RTCPeerConnection
|
|
102
|
+
* @param {ClusterNode} clusterInfo information about the media cluster
|
|
103
|
+
* @returns {RTCPeerConnection|null} peerConnection
|
|
104
|
+
*/
|
|
105
|
+
function createPeerConnection(clusterInfo) {
|
|
106
|
+
try {
|
|
107
|
+
var config = ReachabilityPeerConnection.buildPeerConnectionConfig(clusterInfo);
|
|
108
|
+
var peerConnection = new RTCPeerConnection(config);
|
|
109
|
+
return peerConnection;
|
|
110
|
+
} catch (peerConnectionError) {
|
|
111
|
+
_loggerProxy.default.logger.warn("Reachability:ReachabilityPeerConnection#createPeerConnection --> Error creating peerConnection:", peerConnectionError);
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @returns {ClusterReachabilityResult} reachability result for this instance
|
|
118
|
+
*/
|
|
119
|
+
}, {
|
|
120
|
+
key: "getResult",
|
|
121
|
+
value: function getResult() {
|
|
122
|
+
return this.result;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Closes the peerConnection
|
|
127
|
+
* @returns {void}
|
|
128
|
+
*/
|
|
129
|
+
}, {
|
|
130
|
+
key: "closePeerConnection",
|
|
131
|
+
value: function closePeerConnection() {
|
|
132
|
+
if (this.pc) {
|
|
133
|
+
this.pc.onicecandidate = null;
|
|
134
|
+
this.pc.onicegatheringstatechange = null;
|
|
135
|
+
this.pc.close();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Resolves the defer, indicating that reachability checks for this cluster are completed
|
|
141
|
+
*
|
|
142
|
+
* @returns {void}
|
|
143
|
+
*/
|
|
144
|
+
}, {
|
|
145
|
+
key: "finishReachabilityCheck",
|
|
146
|
+
value: function finishReachabilityCheck() {
|
|
147
|
+
this.defer.resolve();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Aborts the cluster reachability checks by closing the peer connection
|
|
152
|
+
*
|
|
153
|
+
* @returns {void}
|
|
154
|
+
*/
|
|
155
|
+
}, {
|
|
156
|
+
key: "abort",
|
|
157
|
+
value: function abort() {
|
|
158
|
+
var CLOSED = _constants.CONNECTION_STATE.CLOSED;
|
|
159
|
+
if (this.pc && this.pc.connectionState !== CLOSED) {
|
|
160
|
+
this.closePeerConnection();
|
|
161
|
+
this.finishReachabilityCheck();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Adds public IP (client media IPs)
|
|
167
|
+
* @param {string} protocol
|
|
168
|
+
* @param {string} publicIp
|
|
169
|
+
* @returns {void}
|
|
170
|
+
*/
|
|
171
|
+
}, {
|
|
172
|
+
key: "addPublicIp",
|
|
173
|
+
value: function addPublicIp(protocol, publicIp) {
|
|
174
|
+
if (!publicIp) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
var result = this.result[protocol];
|
|
178
|
+
var ipAdded = false;
|
|
179
|
+
if (result.clientMediaIPs) {
|
|
180
|
+
if (!result.clientMediaIPs.includes(publicIp)) {
|
|
181
|
+
result.clientMediaIPs.push(publicIp);
|
|
182
|
+
ipAdded = true;
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
result.clientMediaIPs = [publicIp];
|
|
186
|
+
ipAdded = true;
|
|
187
|
+
}
|
|
188
|
+
if (ipAdded) {
|
|
189
|
+
this.emit({
|
|
190
|
+
file: 'reachabilityPeerConnection',
|
|
191
|
+
function: 'addPublicIp'
|
|
192
|
+
}, _reachability.ReachabilityPeerConnectionEvents.clientMediaIpsUpdated, {
|
|
193
|
+
protocol: protocol,
|
|
194
|
+
clientMediaIPs: result.clientMediaIPs
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Registers a listener for the iceGatheringStateChange event
|
|
201
|
+
*
|
|
202
|
+
* @returns {void}
|
|
203
|
+
*/
|
|
204
|
+
}, {
|
|
205
|
+
key: "registerIceGatheringStateChangeListener",
|
|
206
|
+
value: function registerIceGatheringStateChangeListener() {
|
|
207
|
+
var _this2 = this;
|
|
208
|
+
this.pc.onicegatheringstatechange = function () {
|
|
209
|
+
if (_this2.pc.iceGatheringState === _constants.ICE_GATHERING_STATE.COMPLETE) {
|
|
210
|
+
_this2.closePeerConnection();
|
|
211
|
+
_this2.defer.resolve();
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Saves the latency in the result for the given protocol and marks it as reachable,
|
|
218
|
+
* emits the "resultReady" event if this is the first result for that protocol,
|
|
219
|
+
* emits the "clientMediaIpsUpdated" event if we already had a result and only found
|
|
220
|
+
* a new client IP
|
|
221
|
+
*
|
|
222
|
+
* @param {string} protocol
|
|
223
|
+
* @param {number} latency
|
|
224
|
+
* @param {string|null} [publicIp]
|
|
225
|
+
* @param {string|null} [serverIp]
|
|
226
|
+
* @returns {void}
|
|
227
|
+
*/
|
|
228
|
+
}, {
|
|
229
|
+
key: "saveResult",
|
|
230
|
+
value: function saveResult(protocol, latency, publicIp, serverIp) {
|
|
231
|
+
var result = this.result[protocol];
|
|
232
|
+
if (result.latencyInMilliseconds === undefined) {
|
|
233
|
+
_loggerProxy.default.logger.log(// @ts-ignore
|
|
234
|
+
"Reachability:ReachabilityPeerConnection#saveResult --> Successfully reached ".concat(this.clusterName, " over ").concat(protocol, ": ").concat(latency, "ms"));
|
|
235
|
+
result.latencyInMilliseconds = latency;
|
|
236
|
+
result.result = 'reachable';
|
|
237
|
+
if (publicIp) {
|
|
238
|
+
result.clientMediaIPs = [publicIp];
|
|
239
|
+
}
|
|
240
|
+
this.emit({
|
|
241
|
+
file: 'reachabilityPeerConnection',
|
|
242
|
+
function: 'saveResult'
|
|
243
|
+
}, _reachability.ReachabilityPeerConnectionEvents.resultReady, _objectSpread({
|
|
244
|
+
protocol: protocol
|
|
245
|
+
}, result));
|
|
246
|
+
} else {
|
|
247
|
+
this.addPublicIp(protocol, publicIp);
|
|
248
|
+
}
|
|
249
|
+
if (serverIp) {
|
|
250
|
+
if (!this.emittedSubnets.has(serverIp)) {
|
|
251
|
+
this.emittedSubnets.add(serverIp);
|
|
252
|
+
this.emit({
|
|
253
|
+
file: 'reachabilityPeerConnection',
|
|
254
|
+
function: 'saveResult'
|
|
255
|
+
}, _reachability.ReachabilityPeerConnectionEvents.reachedSubnets, {
|
|
256
|
+
subnets: [serverIp]
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Determines NAT type by analyzing server reflexive candidate patterns
|
|
264
|
+
* @param {RTCIceCandidate} candidate server reflexive candidate
|
|
265
|
+
* @returns {void}
|
|
266
|
+
*/
|
|
267
|
+
}, {
|
|
268
|
+
key: "determineNatTypeForSrflxCandidate",
|
|
269
|
+
value: function determineNatTypeForSrflxCandidate(candidate) {
|
|
270
|
+
var _this3 = this;
|
|
271
|
+
this.srflxIceCandidates.push(candidate);
|
|
272
|
+
if (this.srflxIceCandidates.length > 1) {
|
|
273
|
+
var portsFound = {};
|
|
274
|
+
this.srflxIceCandidates.forEach(function (c) {
|
|
275
|
+
var key = "".concat(c.address, ":").concat(c.relatedPort);
|
|
276
|
+
if (!portsFound[key]) {
|
|
277
|
+
portsFound[key] = new _set.default();
|
|
278
|
+
}
|
|
279
|
+
portsFound[key].add(c.port);
|
|
280
|
+
});
|
|
281
|
+
(0, _entries.default)(portsFound).forEach(function (_ref) {
|
|
282
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
283
|
+
ports = _ref2[1];
|
|
284
|
+
if (ports.size > 1) {
|
|
285
|
+
// Found candidates with the same address and relatedPort, but different ports
|
|
286
|
+
_this3.emit({
|
|
287
|
+
file: 'reachabilityPeerConnection',
|
|
288
|
+
function: 'determineNatTypeForSrflxCandidate'
|
|
289
|
+
}, _reachability.ReachabilityPeerConnectionEvents.natTypeUpdated, {
|
|
290
|
+
natType: _reachability.NatType.SymmetricNat
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Registers a listener for the icecandidate event
|
|
299
|
+
*
|
|
300
|
+
* @returns {void}
|
|
301
|
+
*/
|
|
302
|
+
}, {
|
|
303
|
+
key: "registerIceCandidateListener",
|
|
304
|
+
value: function registerIceCandidateListener() {
|
|
305
|
+
var _this4 = this;
|
|
306
|
+
this.pc.onicecandidate = function (e) {
|
|
307
|
+
var TURN_TLS_PORT = 443;
|
|
308
|
+
var CANDIDATE_TYPES = {
|
|
309
|
+
SERVER_REFLEXIVE: 'srflx',
|
|
310
|
+
RELAY: 'relay'
|
|
311
|
+
};
|
|
312
|
+
var latencyInMilliseconds = _this4.getElapsedTime();
|
|
313
|
+
if (e.candidate) {
|
|
314
|
+
if (e.candidate.type === CANDIDATE_TYPES.SERVER_REFLEXIVE) {
|
|
315
|
+
var serverIp = null;
|
|
316
|
+
if ('url' in e.candidate) {
|
|
317
|
+
var stunServerUrlRegex = /stun:([\d.]+):\d+/;
|
|
318
|
+
var match = e.candidate.url.match(stunServerUrlRegex);
|
|
319
|
+
serverIp = match && match[1];
|
|
320
|
+
}
|
|
321
|
+
_this4.saveResult('udp', latencyInMilliseconds, e.candidate.address, serverIp);
|
|
322
|
+
_this4.determineNatTypeForSrflxCandidate(e.candidate);
|
|
323
|
+
}
|
|
324
|
+
if (e.candidate.type === CANDIDATE_TYPES.RELAY) {
|
|
325
|
+
var protocol = e.candidate.port === TURN_TLS_PORT ? 'xtls' : 'tcp';
|
|
326
|
+
_this4.saveResult(protocol, latencyInMilliseconds, null, e.candidate.address);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Starts the process of doing UDP, TCP, and XTLS reachability checks.
|
|
334
|
+
* @returns {Promise<ClusterReachabilityResult>}
|
|
335
|
+
*/
|
|
336
|
+
}, {
|
|
337
|
+
key: "start",
|
|
338
|
+
value: (function () {
|
|
339
|
+
var _start = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
340
|
+
var offer, gatherIceCandidatePromise, _t;
|
|
341
|
+
return _regenerator.default.wrap(function (_context) {
|
|
342
|
+
while (1) switch (_context.prev = _context.next) {
|
|
343
|
+
case 0:
|
|
344
|
+
if (this.pc) {
|
|
345
|
+
_context.next = 1;
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
_loggerProxy.default.logger.warn("Reachability:ReachabilityPeerConnection#start --> Error: peerConnection is undefined");
|
|
349
|
+
return _context.abrupt("return", this.result);
|
|
350
|
+
case 1:
|
|
351
|
+
// Initialize this.result as saying that nothing is reachable.
|
|
352
|
+
// It will get updated as we go along and successfully gather ICE candidates.
|
|
353
|
+
this.result.udp = {
|
|
354
|
+
result: this.numUdpUrls > 0 ? 'unreachable' : 'untested'
|
|
355
|
+
};
|
|
356
|
+
this.result.tcp = {
|
|
357
|
+
result: this.numTcpUrls > 0 ? 'unreachable' : 'untested'
|
|
358
|
+
};
|
|
359
|
+
this.result.xtls = {
|
|
360
|
+
result: this.numXTlsUrls > 0 ? 'unreachable' : 'untested'
|
|
361
|
+
};
|
|
362
|
+
_context.prev = 2;
|
|
363
|
+
_context.next = 3;
|
|
364
|
+
return this.pc.createOffer({
|
|
365
|
+
offerToReceiveAudio: true
|
|
366
|
+
});
|
|
367
|
+
case 3:
|
|
368
|
+
offer = _context.sent;
|
|
369
|
+
this.startTimestamp = performance.now();
|
|
370
|
+
|
|
371
|
+
// Set up the state change listeners before triggering the ICE gathering
|
|
372
|
+
gatherIceCandidatePromise = this.gatherIceCandidates(); // not awaiting the next call on purpose, because we're not sending the offer anywhere and there won't be any answer
|
|
373
|
+
// we just need to make this call to trigger the ICE gathering process
|
|
374
|
+
this.pc.setLocalDescription(offer);
|
|
375
|
+
_context.next = 4;
|
|
376
|
+
return gatherIceCandidatePromise;
|
|
377
|
+
case 4:
|
|
378
|
+
_context.next = 6;
|
|
379
|
+
break;
|
|
380
|
+
case 5:
|
|
381
|
+
_context.prev = 5;
|
|
382
|
+
_t = _context["catch"](2);
|
|
383
|
+
_loggerProxy.default.logger.warn("Reachability:ReachabilityPeerConnection#start --> Error: ", _t);
|
|
384
|
+
case 6:
|
|
385
|
+
return _context.abrupt("return", this.result);
|
|
386
|
+
case 7:
|
|
387
|
+
case "end":
|
|
388
|
+
return _context.stop();
|
|
389
|
+
}
|
|
390
|
+
}, _callee, this, [[2, 5]]);
|
|
391
|
+
}));
|
|
392
|
+
function start() {
|
|
393
|
+
return _start.apply(this, arguments);
|
|
394
|
+
}
|
|
395
|
+
return start;
|
|
396
|
+
}()
|
|
397
|
+
/**
|
|
398
|
+
* Starts the process of gathering ICE candidates
|
|
399
|
+
* @returns {Promise} promise that's resolved once reachability checks are completed or timeout is reached
|
|
400
|
+
*/
|
|
401
|
+
)
|
|
402
|
+
}, {
|
|
403
|
+
key: "gatherIceCandidates",
|
|
404
|
+
value: function gatherIceCandidates() {
|
|
405
|
+
this.registerIceGatheringStateChangeListener();
|
|
406
|
+
this.registerIceCandidateListener();
|
|
407
|
+
return this.defer.promise;
|
|
408
|
+
}
|
|
409
|
+
}], [{
|
|
410
|
+
key: "buildPeerConnectionConfig",
|
|
411
|
+
value: function buildPeerConnectionConfig(cluster) {
|
|
412
|
+
var udpIceServers = cluster.udp.map(function (url) {
|
|
413
|
+
return {
|
|
414
|
+
username: '',
|
|
415
|
+
credential: '',
|
|
416
|
+
urls: [url]
|
|
417
|
+
};
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
// STUN servers are contacted only using UDP, so in order to test TCP reachability
|
|
421
|
+
// we pretend that Linus is a TURN server, because we can explicitly say "transport=tcp" in TURN urls.
|
|
422
|
+
// We then check for relay candidates to know if TURN-TCP worked (see registerIceCandidateListener()).
|
|
423
|
+
var tcpIceServers = cluster.tcp.map(function (urlString) {
|
|
424
|
+
return {
|
|
425
|
+
username: 'webexturnreachuser',
|
|
426
|
+
credential: 'webexturnreachpwd',
|
|
427
|
+
urls: [(0, _util.convertStunUrlToTurn)(urlString, 'tcp')]
|
|
428
|
+
};
|
|
429
|
+
});
|
|
430
|
+
var turnTlsIceServers = cluster.xtls.map(function (urlString) {
|
|
431
|
+
return {
|
|
432
|
+
username: 'webexturnreachuser',
|
|
433
|
+
credential: 'webexturnreachpwd',
|
|
434
|
+
urls: [(0, _util.convertStunUrlToTurnTls)(urlString)]
|
|
435
|
+
};
|
|
436
|
+
});
|
|
437
|
+
return {
|
|
438
|
+
iceServers: [].concat((0, _toConsumableArray2.default)(udpIceServers), (0, _toConsumableArray2.default)(tcpIceServers), (0, _toConsumableArray2.default)(turnTlsIceServers)),
|
|
439
|
+
iceCandidatePoolSize: 0,
|
|
440
|
+
iceTransportPolicy: 'all'
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
}]);
|
|
444
|
+
}(_eventsScope.default);
|
|
445
|
+
//# sourceMappingURL=reachabilityPeerConnection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_common","require","_loggerProxy","_interopRequireDefault","_util","_eventsScope","_constants","_reachability","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","_callSuper","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","Boolean","prototype","valueOf","call","ReachabilityPeerConnection","exports","_EventsScope","clusterName","clusterInfo","_this","_classCallCheck2","_set","numUdpUrls","udp","numTcpUrls","tcp","numXTlsUrls","xtls","pc","createPeerConnection","defer","Defer","result","_inherits2","_createClass2","key","value","getElapsedTime","Math","round","performance","now","startTimestamp","config","buildPeerConnectionConfig","peerConnection","RTCPeerConnection","peerConnectionError","LoggerProxy","logger","warn","getResult","closePeerConnection","onicecandidate","onicegatheringstatechange","close","finishReachabilityCheck","resolve","abort","CLOSED","CONNECTION_STATE","connectionState","addPublicIp","protocol","publicIp","ipAdded","clientMediaIPs","includes","emit","file","function","ReachabilityPeerConnectionEvents","clientMediaIpsUpdated","registerIceGatheringStateChangeListener","_this2","iceGatheringState","ICE_GATHERING_STATE","COMPLETE","saveResult","latency","serverIp","latencyInMilliseconds","undefined","log","concat","resultReady","emittedSubnets","has","add","reachedSubnets","subnets","determineNatTypeForSrflxCandidate","candidate","_this3","srflxIceCandidates","portsFound","c","address","relatedPort","port","_entries","_ref","_ref2","_slicedToArray2","ports","size","natTypeUpdated","natType","NatType","SymmetricNat","registerIceCandidateListener","_this4","TURN_TLS_PORT","CANDIDATE_TYPES","SERVER_REFLEXIVE","RELAY","type","stunServerUrlRegex","match","url","_start","_asyncToGenerator2","_regenerator","mark","_callee","offer","gatherIceCandidatePromise","_t","wrap","_context","prev","next","abrupt","createOffer","offerToReceiveAudio","sent","gatherIceCandidates","setLocalDescription","stop","start","promise","cluster","udpIceServers","map","username","credential","urls","tcpIceServers","urlString","convertStunUrlToTurn","turnTlsIceServers","convertStunUrlToTurnTls","iceServers","_toConsumableArray2","iceCandidatePoolSize","iceTransportPolicy","EventsScope"],"sources":["reachabilityPeerConnection.ts"],"sourcesContent":["import {Defer} from '@webex/common';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {ClusterNode} from './request';\nimport {convertStunUrlToTurn, convertStunUrlToTurnTls} from './util';\nimport EventsScope from '../common/events/events-scope';\n\nimport {CONNECTION_STATE, ICE_GATHERING_STATE} from '../constants';\nimport {\n ClusterReachabilityResult,\n NatType,\n Protocol,\n ReachabilityPeerConnectionEvents,\n} from './reachability.types';\n\n/**\n * A class to handle RTCPeerConnection lifecycle and ICE candidate gathering for reachability checks.\n * It will do all the work like PeerConnection lifecycle, candidate processing, result management, and event emission.\n */\nexport class ReachabilityPeerConnection extends EventsScope {\n public numUdpUrls: number;\n public numTcpUrls: number;\n public numXTlsUrls: number;\n private pc: RTCPeerConnection | null;\n private defer: Defer;\n private startTimestamp: number;\n private srflxIceCandidates: RTCIceCandidate[] = [];\n private clusterName: string;\n private result: ClusterReachabilityResult;\n private emittedSubnets: Set<string> = new Set();\n\n /**\n * Constructor for ReachabilityPeerConnection\n * @param {string} clusterName name of the cluster\n * @param {ClusterNode} clusterInfo information about the media cluster\n */\n constructor(clusterName: string, clusterInfo: ClusterNode) {\n super();\n this.clusterName = clusterName;\n this.numUdpUrls = clusterInfo.udp.length;\n this.numTcpUrls = clusterInfo.tcp.length;\n this.numXTlsUrls = clusterInfo.xtls.length;\n\n this.pc = this.createPeerConnection(clusterInfo);\n\n this.defer = new Defer();\n this.result = {\n udp: {\n result: 'untested',\n },\n tcp: {\n result: 'untested',\n },\n xtls: {\n result: 'untested',\n },\n };\n }\n\n /**\n * Gets total elapsed time, can be called only after start() is called\n * @returns {number} Milliseconds\n */\n private getElapsedTime() {\n return Math.round(performance.now() - this.startTimestamp);\n }\n\n /**\n * Generate peerConnection config settings\n * @param {ClusterNode} cluster\n * @returns {RTCConfiguration} peerConnectionConfig\n */\n private static buildPeerConnectionConfig(cluster: ClusterNode): RTCConfiguration {\n const udpIceServers = cluster.udp.map((url) => ({\n username: '',\n credential: '',\n urls: [url],\n }));\n\n // STUN servers are contacted only using UDP, so in order to test TCP reachability\n // we pretend that Linus is a TURN server, because we can explicitly say \"transport=tcp\" in TURN urls.\n // We then check for relay candidates to know if TURN-TCP worked (see registerIceCandidateListener()).\n const tcpIceServers = cluster.tcp.map((urlString: string) => {\n return {\n username: 'webexturnreachuser',\n credential: 'webexturnreachpwd',\n urls: [convertStunUrlToTurn(urlString, 'tcp')],\n };\n });\n\n const turnTlsIceServers = cluster.xtls.map((urlString: string) => {\n return {\n username: 'webexturnreachuser',\n credential: 'webexturnreachpwd',\n urls: [convertStunUrlToTurnTls(urlString)],\n };\n });\n\n return {\n iceServers: [...udpIceServers, ...tcpIceServers, ...turnTlsIceServers],\n iceCandidatePoolSize: 0,\n iceTransportPolicy: 'all',\n };\n }\n\n /**\n * Creates an RTCPeerConnection\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @returns {RTCPeerConnection|null} peerConnection\n */\n private createPeerConnection(clusterInfo: ClusterNode): RTCPeerConnection | null {\n try {\n const config = ReachabilityPeerConnection.buildPeerConnectionConfig(clusterInfo);\n\n const peerConnection = new RTCPeerConnection(config);\n\n return peerConnection;\n } catch (peerConnectionError) {\n LoggerProxy.logger.warn(\n `Reachability:ReachabilityPeerConnection#createPeerConnection --> Error creating peerConnection:`,\n peerConnectionError\n );\n\n return null;\n }\n }\n\n /**\n * @returns {ClusterReachabilityResult} reachability result for this instance\n */\n getResult() {\n return this.result;\n }\n\n /**\n * Closes the peerConnection\n * @returns {void}\n */\n private closePeerConnection() {\n if (this.pc) {\n this.pc.onicecandidate = null;\n this.pc.onicegatheringstatechange = null;\n this.pc.close();\n }\n }\n\n /**\n * Resolves the defer, indicating that reachability checks for this cluster are completed\n *\n * @returns {void}\n */\n private finishReachabilityCheck() {\n this.defer.resolve();\n }\n\n /**\n * Aborts the cluster reachability checks by closing the peer connection\n *\n * @returns {void}\n */\n public abort() {\n const {CLOSED} = CONNECTION_STATE;\n\n if (this.pc && this.pc.connectionState !== CLOSED) {\n this.closePeerConnection();\n this.finishReachabilityCheck();\n }\n }\n\n /**\n * Adds public IP (client media IPs)\n * @param {string} protocol\n * @param {string} publicIp\n * @returns {void}\n */\n private addPublicIp(protocol: Protocol, publicIp?: string | null) {\n if (!publicIp) {\n return;\n }\n\n const result = this.result[protocol];\n let ipAdded = false;\n\n if (result.clientMediaIPs) {\n if (!result.clientMediaIPs.includes(publicIp)) {\n result.clientMediaIPs.push(publicIp);\n ipAdded = true;\n }\n } else {\n result.clientMediaIPs = [publicIp];\n ipAdded = true;\n }\n\n if (ipAdded) {\n this.emit(\n {\n file: 'reachabilityPeerConnection',\n function: 'addPublicIp',\n },\n ReachabilityPeerConnectionEvents.clientMediaIpsUpdated,\n {\n protocol,\n clientMediaIPs: result.clientMediaIPs,\n }\n );\n }\n }\n\n /**\n * Registers a listener for the iceGatheringStateChange event\n *\n * @returns {void}\n */\n private registerIceGatheringStateChangeListener() {\n this.pc.onicegatheringstatechange = () => {\n if (this.pc.iceGatheringState === ICE_GATHERING_STATE.COMPLETE) {\n this.closePeerConnection();\n this.defer.resolve();\n }\n };\n }\n\n /**\n * Saves the latency in the result for the given protocol and marks it as reachable,\n * emits the \"resultReady\" event if this is the first result for that protocol,\n * emits the \"clientMediaIpsUpdated\" event if we already had a result and only found\n * a new client IP\n *\n * @param {string} protocol\n * @param {number} latency\n * @param {string|null} [publicIp]\n * @param {string|null} [serverIp]\n * @returns {void}\n */\n private saveResult(\n protocol: Protocol,\n latency: number,\n publicIp?: string | null,\n serverIp?: string | null\n ) {\n const result = this.result[protocol];\n\n if (result.latencyInMilliseconds === undefined) {\n LoggerProxy.logger.log(\n // @ts-ignore\n `Reachability:ReachabilityPeerConnection#saveResult --> Successfully reached ${this.clusterName} over ${protocol}: ${latency}ms`\n );\n result.latencyInMilliseconds = latency;\n result.result = 'reachable';\n if (publicIp) {\n result.clientMediaIPs = [publicIp];\n }\n\n this.emit(\n {\n file: 'reachabilityPeerConnection',\n function: 'saveResult',\n },\n ReachabilityPeerConnectionEvents.resultReady,\n {\n protocol,\n ...result,\n }\n );\n } else {\n this.addPublicIp(protocol, publicIp);\n }\n\n if (serverIp) {\n if (!this.emittedSubnets.has(serverIp)) {\n this.emittedSubnets.add(serverIp);\n this.emit(\n {\n file: 'reachabilityPeerConnection',\n function: 'saveResult',\n },\n ReachabilityPeerConnectionEvents.reachedSubnets,\n {\n subnets: [serverIp],\n }\n );\n }\n }\n }\n\n /**\n * Determines NAT type by analyzing server reflexive candidate patterns\n * @param {RTCIceCandidate} candidate server reflexive candidate\n * @returns {void}\n */\n private determineNatTypeForSrflxCandidate(candidate: RTCIceCandidate) {\n this.srflxIceCandidates.push(candidate);\n\n if (this.srflxIceCandidates.length > 1) {\n const portsFound: Record<string, Set<number>> = {};\n\n this.srflxIceCandidates.forEach((c) => {\n const key = `${c.address}:${c.relatedPort}`;\n if (!portsFound[key]) {\n portsFound[key] = new Set();\n }\n portsFound[key].add(c.port);\n });\n\n Object.entries(portsFound).forEach(([, ports]) => {\n if (ports.size > 1) {\n // Found candidates with the same address and relatedPort, but different ports\n this.emit(\n {\n file: 'reachabilityPeerConnection',\n function: 'determineNatTypeForSrflxCandidate',\n },\n ReachabilityPeerConnectionEvents.natTypeUpdated,\n {\n natType: NatType.SymmetricNat,\n }\n );\n }\n });\n }\n }\n\n /**\n * Registers a listener for the icecandidate event\n *\n * @returns {void}\n */\n private registerIceCandidateListener() {\n this.pc.onicecandidate = (e) => {\n const TURN_TLS_PORT = 443;\n const CANDIDATE_TYPES = {\n SERVER_REFLEXIVE: 'srflx',\n RELAY: 'relay',\n };\n\n const latencyInMilliseconds = this.getElapsedTime();\n\n if (e.candidate) {\n if (e.candidate.type === CANDIDATE_TYPES.SERVER_REFLEXIVE) {\n let serverIp = null;\n if ('url' in e.candidate) {\n const stunServerUrlRegex = /stun:([\\d.]+):\\d+/;\n\n const match = (e.candidate as any).url.match(stunServerUrlRegex);\n serverIp = match && match[1];\n }\n\n this.saveResult('udp', latencyInMilliseconds, e.candidate.address, serverIp);\n\n this.determineNatTypeForSrflxCandidate(e.candidate);\n }\n\n if (e.candidate.type === CANDIDATE_TYPES.RELAY) {\n const protocol = e.candidate.port === TURN_TLS_PORT ? 'xtls' : 'tcp';\n this.saveResult(protocol, latencyInMilliseconds, null, e.candidate.address);\n }\n }\n };\n }\n\n /**\n * Starts the process of doing UDP, TCP, and XTLS reachability checks.\n * @returns {Promise<ClusterReachabilityResult>}\n */\n async start(): Promise<ClusterReachabilityResult> {\n if (!this.pc) {\n LoggerProxy.logger.warn(\n `Reachability:ReachabilityPeerConnection#start --> Error: peerConnection is undefined`\n );\n\n return this.result;\n }\n\n // Initialize this.result as saying that nothing is reachable.\n // It will get updated as we go along and successfully gather ICE candidates.\n this.result.udp = {\n result: this.numUdpUrls > 0 ? 'unreachable' : 'untested',\n };\n this.result.tcp = {\n result: this.numTcpUrls > 0 ? 'unreachable' : 'untested',\n };\n this.result.xtls = {\n result: this.numXTlsUrls > 0 ? 'unreachable' : 'untested',\n };\n\n try {\n const offer = await this.pc.createOffer({offerToReceiveAudio: true});\n\n this.startTimestamp = performance.now();\n\n // Set up the state change listeners before triggering the ICE gathering\n const gatherIceCandidatePromise = this.gatherIceCandidates();\n\n // not awaiting the next call on purpose, because we're not sending the offer anywhere and there won't be any answer\n // we just need to make this call to trigger the ICE gathering process\n this.pc.setLocalDescription(offer);\n\n await gatherIceCandidatePromise;\n } catch (error) {\n LoggerProxy.logger.warn(`Reachability:ReachabilityPeerConnection#start --> Error: `, error);\n }\n\n return this.result;\n }\n\n /**\n * Starts the process of gathering ICE candidates\n * @returns {Promise} promise that's resolved once reachability checks are completed or timeout is reached\n */\n private gatherIceCandidates() {\n this.registerIceGatheringStateChangeListener();\n this.registerIceCandidateListener();\n\n return this.defer.promise;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAK8B,SAAAO,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAL,CAAA,WAAAM,gCAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,CAAAO,IAAA,CAAAC,KAAA,CAAAR,CAAA,EAAAG,CAAA,YAAAH,CAAA;AAAA,SAAAS,cAAAX,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAW,SAAA,CAAAC,MAAA,EAAAZ,CAAA,UAAAC,CAAA,WAAAU,SAAA,CAAAX,CAAA,IAAAW,SAAA,CAAAX,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAe,MAAA,CAAA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AC3D,OAAO;UACLJ,QAAQ,EAAE,oBAAoB;UAC9BC,UAAU,EAAE,mBAAmB;UAC/BC,IAAI,EAAE,CAAC,IAAAG,0BAAoB,EAACD,SAAS,EAAE,KAAK,CAAC;QAC/C,CAAC;MACH,CAAC,CAAC;MAEF,IAAME,iBAAiB,GAAGT,OAAO,CAAClH,IAAI,CAACoH,GAAG,CAAC,UAACK,SAAiB,EAAK;QAChE,OAAO;UACLJ,QAAQ,EAAE,oBAAoB;UAC9BC,UAAU,EAAE,mBAAmB;UAC/BC,IAAI,EAAE,CAAC,IAAAK,6BAAuB,EAACH,SAAS,CAAC;QAC3C,CAAC;MACH,CAAC,CAAC;MAEF,OAAO;QACLI,UAAU,KAAApE,MAAA,KAAAqE,mBAAA,CAAAzJ,OAAA,EAAM8I,aAAa,OAAAW,mBAAA,CAAAzJ,OAAA,EAAKmJ,aAAa,OAAAM,mBAAA,CAAAzJ,OAAA,EAAKsJ,iBAAiB,EAAC;QACtEI,oBAAoB,EAAE,CAAC;QACvBC,kBAAkB,EAAE;MACtB,CAAC;IACH;EAAC;AAAA,EApF6CC,oBAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_constants","ownKeys","e","r","t","_Object$keys2","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","ReachabilityRequest","_createClass2","webex","_this","_classCallCheck2","trigger","ipVersion","previousReport","_this$webex","_this$webex$config","_this$webex$config$su","_this$webex2","_this$webex2$config","_this$webex2$config$s","appType","config","support","appVersion","callWrapper","internal","newMetrics","callDiagnosticLatencies","measureLatency","bind","func","request","method","HTTP_VERBS","POST","shouldRefreshAccessToken","api","API","CALLIOPEDISCOVERY","resource","RESOURCE","CLUSTERS","body","ipver","components","timeout","meetings","reachabilityGetClusterTimeout","then","res","_res$body","clusters","joinCookie","discoveryOptions","_keys","key","_res$body$clusterClas","_res$body$clusterClas2","isVideoMesh","clusterClasses","hybridMedia","includes","LoggerProxy","logger","log","concat","_stringify","localSDPList","REACHABILITY","offers","_default","exports"],"sources":["request.ts"],"sourcesContent":["import LoggerProxy from '../common/logs/logger-proxy';\nimport {HTTP_VERBS, RESOURCE, API, IP_VERSION} from '../constants';\nimport {GetClustersTrigger} from './reachability.types';\n\nexport interface ClusterNode {\n isVideoMesh: boolean;\n udp: Array<string>;\n tcp: Array<string>;\n xtls: Array<string>;\n}\n\nexport type ClusterList = {\n [key: string]: ClusterNode;\n};\n\n/**\n * @class ReachabilityRequest\n */\nclass ReachabilityRequest {\n webex: any;\n\n /**\n * Creates an instance of ReachabilityRequest.\n * @param {object} webex\n * @memberof ReachabilityRequest\n */\n constructor(webex: object) {\n this.webex = webex;\n }\n\n /**\n * Gets the cluster information\n *\n * @param {string} trigger that's passed to Orpheus\n * @param {IP_VERSION} ipVersion information about current ip network we're on\n * @param {Object} previousReport last reachability result\n * @returns {Promise}\n */\n getClusters = (\n trigger: GetClustersTrigger,\n ipVersion?: IP_VERSION,\n previousReport?: any\n ): Promise<{\n clusters: ClusterList;\n joinCookie: any;\n discoveryOptions?: Record<string, any>;\n }> => {\n const appType = this.webex?.config?.support?.appType;\n const appVersion = this.webex?.config?.support?.appVersion;\n\n // we only measure latency for the initial startup call, not for other triggers\n const callWrapper =\n trigger === 'startup'\n ? this.webex.internal.newMetrics.callDiagnosticLatencies.measureLatency.bind(\n this.webex.internal.newMetrics.callDiagnosticLatencies\n )\n : (func) => func();\n\n return callWrapper(\n () =>\n this.webex.request({\n method: HTTP_VERBS.POST,\n shouldRefreshAccessToken: false,\n api: API.CALLIOPEDISCOVERY,\n resource: RESOURCE.CLUSTERS,\n body: {\n ipver: ipVersion,\n 'supported-options': {\n 'report-version': 1,\n 'early-call-min-clusters': true,\n },\n 'previous-report': previousReport,\n ...(appType &&\n appVersion && {\n 'client-environment': {components: {[appType]: appVersion}},\n }),\n trigger,\n },\n timeout: this.webex.config.meetings.reachabilityGetClusterTimeout,\n }),\n 'internal.get.cluster.time'\n ).then((res) => {\n const {clusters, joinCookie, discoveryOptions} = res.body;\n\n Object.keys(clusters).forEach((key) => {\n clusters[key].isVideoMesh = !!res.body.clusterClasses?.hybridMedia?.includes(key);\n });\n\n LoggerProxy.logger.log(\n `Reachability:request#getClusters --> get clusters (ipver=${ipVersion}) successful:${JSON.stringify(\n clusters\n )}`\n );\n\n return {\n clusters,\n joinCookie,\n discoveryOptions,\n };\n });\n };\n\n /**\n * gets remote SDP For Clusters\n * @param {Object} localSDPList localSDPs for the cluster\n * @returns {Object}\n */\n remoteSDPForClusters = (localSDPList: object) =>\n this.webex\n .request({\n method: HTTP_VERBS.POST,\n shouldRefreshAccessToken: false,\n api: API.CALLIOPEDISCOVERY,\n resource: RESOURCE.REACHABILITY,\n body: {offers: localSDPList},\n })\n .then((res) => {\n LoggerProxy.logger.log(\n 'Reachability:request#remoteSDPForClusters --> Remote SDPs got succcessfully'\n );\n\n return res.body;\n });\n}\n\nexport default ReachabilityRequest;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAmE,SAAAE,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,aAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAL,CAAA,WAAAM,gCAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,CAAAO,IAAA,CAAAC,KAAA,CAAAR,CAAA,EAAAG,CAAA,YAAAH,CAAA;AAAA,SAAAS,cAAAX,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAW,SAAA,CAAAC,MAA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/FJ,IAAI,CAAClC,KAAK,GAAGA,KAAK;AACpB,CAAC;AAAA,IAAA8D,QAAA,GAAAC,OAAA,CAAArE,OAAA,GAiGYI,mBAAmB"}
|
|
1
|
+
{"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_constants","ownKeys","e","r","t","_Object$keys2","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","ReachabilityRequest","_createClass2","webex","_this","_classCallCheck2","trigger","ipVersion","previousReport","_this$webex","_this$webex$config","_this$webex$config$su","_this$webex2","_this$webex2$config","_this$webex2$config$s","appType","config","support","appVersion","callWrapper","internal","newMetrics","callDiagnosticLatencies","measureLatency","bind","func","request","method","HTTP_VERBS","POST","shouldRefreshAccessToken","api","API","CALLIOPEDISCOVERY","resource","RESOURCE","CLUSTERS","body","ipver","components","timeout","meetings","reachabilityGetClusterTimeout","then","res","_res$body","clusters","joinCookie","discoveryOptions","_keys","key","_res$body$clusterClas","_res$body$clusterClas2","isVideoMesh","clusterClasses","hybridMedia","includes","LoggerProxy","logger","log","concat","_stringify","localSDPList","REACHABILITY","offers","_default","exports"],"sources":["request.ts"],"sourcesContent":["import LoggerProxy from '../common/logs/logger-proxy';\nimport {HTTP_VERBS, RESOURCE, API, IP_VERSION} from '../constants';\nimport {GetClustersTrigger} from './reachability.types';\n\nexport interface ClusterNode {\n isVideoMesh: boolean;\n udp: Array<string>;\n tcp: Array<string>;\n xtls: Array<string>;\n}\n\nexport type ClusterList = {\n [key: string]: ClusterNode;\n};\n\n/**\n * @class ReachabilityRequest\n */\nclass ReachabilityRequest {\n webex: any;\n\n /**\n * Creates an instance of ReachabilityRequest.\n * @param {object} webex\n * @memberof ReachabilityRequest\n */\n constructor(webex: object) {\n this.webex = webex;\n }\n\n /**\n * Gets the cluster information\n *\n * @param {string} trigger that's passed to Orpheus\n * @param {IP_VERSION} ipVersion information about current ip network we're on\n * @param {Object} previousReport last reachability result\n * @returns {Promise}\n */\n getClusters = (\n trigger: GetClustersTrigger,\n ipVersion?: IP_VERSION,\n previousReport?: any\n ): Promise<{\n clusters: ClusterList;\n joinCookie: any;\n discoveryOptions?: Record<string, any>;\n }> => {\n const appType = this.webex?.config?.support?.appType;\n const appVersion = this.webex?.config?.support?.appVersion;\n\n // we only measure latency for the initial startup call, not for other triggers\n const callWrapper =\n trigger === 'startup'\n ? this.webex.internal.newMetrics.callDiagnosticLatencies.measureLatency.bind(\n this.webex.internal.newMetrics.callDiagnosticLatencies\n )\n : (func) => func();\n\n return callWrapper(\n () =>\n this.webex.request({\n method: HTTP_VERBS.POST,\n shouldRefreshAccessToken: false,\n api: API.CALLIOPEDISCOVERY,\n resource: RESOURCE.CLUSTERS,\n body: {\n ipver: ipVersion,\n 'supported-options': {\n 'report-version': 1,\n 'early-call-min-clusters': true,\n },\n 'previous-report': previousReport,\n ...(appType &&\n appVersion && {\n 'client-environment': {components: {[appType]: appVersion}},\n }),\n trigger,\n },\n timeout: this.webex.config.meetings.reachabilityGetClusterTimeout,\n }),\n 'internal.get.cluster.time'\n ).then((res) => {\n const {clusters, joinCookie, discoveryOptions} = res.body;\n\n Object.keys(clusters).forEach((key) => {\n clusters[key].isVideoMesh = !!res.body.clusterClasses?.hybridMedia?.includes(key);\n });\n\n LoggerProxy.logger.log(\n `Reachability:request#getClusters --> get clusters (ipver=${ipVersion}) successful:${JSON.stringify(\n clusters\n )}`\n );\n\n return {\n clusters,\n joinCookie,\n discoveryOptions,\n };\n });\n };\n\n /**\n * gets remote SDP For Clusters\n * @param {Object} localSDPList localSDPs for the cluster\n * @returns {Object}\n */\n remoteSDPForClusters = (localSDPList: object) =>\n this.webex\n .request({\n method: HTTP_VERBS.POST,\n shouldRefreshAccessToken: false,\n api: API.CALLIOPEDISCOVERY,\n resource: RESOURCE.REACHABILITY,\n body: {offers: localSDPList},\n })\n .then((res) => {\n LoggerPro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O;QACLA,QAAQ,EAARA,QAAQ;QACRC,UAAU,EAAVA,UAAU;QACVC,gBAAgB,EAAhBA;MACF,CAAC;IACH,CAAC,CAAC;EACJ,CAAC;EAED;AACF;AACA;AACA;AACA;EAJE,IAAApD,gBAAA,CAAAC,OAAA,gCAKuB,UAACiE,YAAoB;IAAA,OAC1C1D,KAAI,CAACD,KAAK,CACPuB,OAAO,CAAC;MACPC,MAAM,EAAEC,qBAAU,CAACC,IAAI;MACvBC,wBAAwB,EAAE,KAAK;MAC/BC,GAAG,EAAEC,cAAG,CAACC,iBAAiB;MAC1BC,QAAQ,EAAEC,mBAAQ,CAAC4B,YAAY;MAC/B1B,IAAI,EAAE;QAAC2B,MAAM,EAAEF;MAAY;IAC7B,CAAC,CAAC,CACDnB,IAAI,CAAC,UAACC,GAAG,EAAK;MACba,oBAAW,CAACC,MAAM,CAACC,GAAG,CACpB,6EACF,CAAC;MAED,OAAOf,GAAG,CAACP,IAAI;IACjB,CAAC,CAAC;EAAA;EA/FJ,IAAI,CAAClC,KAAK,GAAGA,KAAK;AACpB,CAAC;AAAA,IAAA8D,QAAA,GAAAC,OAAA,CAAArE,OAAA,GAiGYI,mBAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["convertStunUrlToTurn","stunUrl","protocol","url","URL","Error","concat","searchParams","append","toString","convertStunUrlToTurnTls"],"sources":["util.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\n/**\n * Converts a stun url to a turn url\n *\n * @param {string} stunUrl url of a stun server\n * @param {'tcp'|'udp'} protocol what protocol to use for the turn server\n * @returns {string} url of a turn server\n */\nexport function convertStunUrlToTurn(stunUrl: string, protocol: 'udp' | 'tcp') {\n // stunUrl looks like this: \"stun:external-media91.public.wjfkm-a-10.prod.infra.webex.com:5004\"\n // and we need it to be like this: \"turn:external-media91.public.wjfkm-a-10.prod.infra.webex.com:5004?transport=tcp\"\n const url = new URL(stunUrl);\n\n if (url.protocol !== 'stun:') {\n throw new Error(`Not a STUN URL: ${stunUrl}`);\n }\n\n url.protocol = 'turn:';\n if (protocol === 'tcp') {\n url.searchParams.append('transport', 'tcp');\n }\n\n return url.toString();\n}\n\n/**\n * Converts a stun url to a turns url\n *\n * @param {string} stunUrl url of a stun server\n * @returns {string} url of a turns server\n */\nexport function convertStunUrlToTurnTls(stunUrl: string) {\n // stunUrl looks like this: \"stun:external-media1.public.wjfkm-a-15.prod.infra.webex.com:443\"\n // and we need it to be like this: \"turns:external-media1.public.wjfkm-a-15.prod.infra.webex.com:443?transport=tcp\"\n const url = new URL(stunUrl);\n\n if (url.protocol !== 'stun:') {\n throw new Error(`Not a STUN URL: ${stunUrl}`);\n }\n\n url.protocol = 'turns:';\n url.searchParams.append('transport', 'tcp');\n\n return url.toString();\n}\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,oBAAoBA,CAACC,OAAe,EAAEC,QAAuB,EAAE;EAC7E;EACA;EACA,IAAMC,GAAG,GAAG,IAAIC,GAAG,CAACH,OAAO,CAAC;EAE5B,IAAIE,GAAG,CAACD,QAAQ,KAAK,OAAO,EAAE;IAC5B,MAAM,IAAIG,KAAK,oBAAAC,MAAA,CAAoBL,OAAO,CAAE,CAAC;EAC/C;EAEAE,GAAG,CAACD,QAAQ,GAAG,OAAO;EACtB,IAAIA,QAAQ,KAAK,KAAK,EAAE;IACtBC,GAAG,CAACI,YAAY,CAACC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC;EAC7C;EAEA,OAAOL,GAAG,CAACM,QAAQ,CAAC,CAAC;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAACT,OAAe,EAAE;EACvD;EACA;EACA,IAAME,GAAG,GAAG,IAAIC,GAAG,CAACH,OAAO,CAAC;EAE5B,IAAIE,GAAG,CAACD,QAAQ,KAAK,OAAO,EAAE;IAC5B,MAAM,IAAIG,KAAK,oBAAAC,MAAA,CAAoBL,OAAO,CAAE,CAAC;EAC/C;EAEAE,GAAG,CAACD,QAAQ,GAAG,QAAQ;EACvBC,GAAG,CAACI,YAAY,CAACC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC;EAE3C,OAAOL,GAAG,CAACM,QAAQ,CAAC,CAAC;AACvB"}
|
|
1
|
+
{"version":3,"names":["convertStunUrlToTurn","stunUrl","protocol","url","URL","Error","concat","searchParams","append","toString","convertStunUrlToTurnTls"],"sources":["util.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\n/**\n * Converts a stun url to a turn url\n *\n * @param {string} stunUrl url of a stun server\n * @param {'tcp'|'udp'} protocol what protocol to use for the turn server\n * @returns {string} url of a turn server\n */\nexport function convertStunUrlToTurn(stunUrl: string, protocol: 'udp' | 'tcp') {\n // stunUrl looks like this: \"stun:external-media91.public.wjfkm-a-10.prod.infra.webex.com:5004\"\n // and we need it to be like this: \"turn:external-media91.public.wjfkm-a-10.prod.infra.webex.com:5004?transport=tcp\"\n const url = new URL(stunUrl);\n\n if (url.protocol !== 'stun:') {\n throw new Error(`Not a STUN URL: ${stunUrl}`);\n }\n\n url.protocol = 'turn:';\n if (protocol === 'tcp') {\n url.searchParams.append('transport', 'tcp');\n }\n\n return url.toString();\n}\n\n/**\n * Converts a stun url to a turns url\n *\n * @param {string} stunUrl url of a stun server\n * @returns {string} url of a turns server\n */\nexport function convertStunUrlToTurnTls(stunUrl: string) {\n // stunUrl looks like this: \"stun:external-media1.public.wjfkm-a-15.prod.infra.webex.com:443\"\n // and we need it to be like this: \"turns:external-media1.public.wjfkm-a-15.prod.infra.webex.com:443?transport=tcp\"\n const url = new URL(stunUrl);\n\n if (url.protocol !== 'stun:') {\n throw new Error(`Not a STUN URL: ${stunUrl}`);\n }\n\n url.protocol = 'turns:';\n url.searchParams.append('transport', 'tcp');\n\n return url.toString();\n}\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,oBAAoBA,CAACC,OAAe,EAAEC,QAAuB,EAAE;EAC7E;EACA;EACA,IAAMC,GAAG,GAAG,IAAIC,GAAG,CAACH,OAAO,CAAC;EAE5B,IAAIE,GAAG,CAACD,QAAQ,KAAK,OAAO,EAAE;IAC5B,MAAM,IAAIG,KAAK,oBAAAC,MAAA,CAAoBL,OAAO,CAAE,CAAC;EAC/C;EAEAE,GAAG,CAACD,QAAQ,GAAG,OAAO;EACtB,IAAIA,QAAQ,KAAK,KAAK,EAAE;IACtBC,GAAG,CAACI,YAAY,CAACC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC;EAC7C;EAEA,OAAOL,GAAG,CAACM,QAAQ,CAAC,CAAC;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAACT,OAAe,EAAE;EACvD;EACA;EACA,IAAME,GAAG,GAAG,IAAIC,GAAG,CAACH,OAAO,CAAC;EAE5B,IAAIE,GAAG,CAACD,QAAQ,KAAK,OAAO,EAAE;IAC5B,MAAM,IAAIG,KAAK,oBAAAC,MAAA,CAAoBL,OAAO,CAAE,CAAC;EAC/C;EAEAE,GAAG,CAACD,QAAQ,GAAG,QAAQ;EACvBC,GAAG,CAACI,YAAY,CAACC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC;EAE3C,OAAOL,GAAG,CAACM,QAAQ,CAAC,CAAC;AACvB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["REACTION_RELAY_TYPES","exports","REACTION"],"sources":["constants.ts"],"sourcesContent":["// eslint-disable-next-line import/prefer-default-export\nexport const REACTION_RELAY_TYPES = {\n REACTION: 'react',\n} as const;\n"],"mappings":";;;;;;;AAAA;AACO,IAAMA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG;EAClCE,QAAQ,EAAE;AACZ,CAAU"}
|
|
1
|
+
{"version":3,"names":["REACTION_RELAY_TYPES","exports","REACTION"],"sources":["constants.ts"],"sourcesContent":["// eslint-disable-next-line import/prefer-default-export\nexport const REACTION_RELAY_TYPES = {\n REACTION: 'react',\n} as const;\n"],"mappings":";;;;;;;AAAA;AACO,IAAMA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG;EAClCE,QAAQ,EAAE;AACZ,CAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Reactions","exports","smile","type","codepoints","shortcodes","sad","wow","haha","celebrate","clap","thumb_up","thumb_down","heart","fire","prayer","speed_up","slow_down","SkinTones","normal","light","medium_light","medium","medium_dark","dark"],"sources":["reactions.ts"],"sourcesContent":["import {Reaction, ReactionServerType, SkinTone, SkinToneType} from './reactions.type';\n\nconst Reactions: Record<ReactionServerType, Reaction> = {\n smile: {\n type: 'smile',\n codepoints: '1F642',\n shortcodes: ':slightly_smiling_face:',\n },\n sad: {\n type: 'sad',\n codepoints: '1F625',\n shortcodes: ':sad_but_relieved_face:',\n },\n wow: {\n type: 'wow',\n codepoints: '1F62E',\n shortcodes: ':open_mouth:',\n },\n haha: {\n type: 'haha',\n codepoints: '1F603',\n shortcodes: ':smiley:',\n },\n celebrate: {\n type: 'celebrate',\n codepoints: '1F389',\n shortcodes: ':party_popper:',\n },\n clap: {\n type: 'clap',\n codepoints: '1F44F',\n shortcodes: ':clap:',\n },\n thumb_up: {\n type: 'thumb_up',\n codepoints: '1F44D',\n shortcodes: ':thumbsup:',\n },\n thumb_down: {\n type: 'thumb_down',\n codepoints: '1F44E',\n shortcodes: ':thumbsdown:',\n },\n heart: {\n type: 'heart',\n codepoints: '2764',\n shortcodes: ':heart:',\n },\n fire: {\n type: 'fire',\n codepoints: '1F525',\n shortcodes: ':fire:',\n },\n prayer: {\n type: 'prayer',\n codepoints: '1F64F',\n shortcodes: ':pray:',\n },\n speed_up: {\n type: 'speed_up',\n codepoints: '1F407',\n shortcodes: ':rabbit:',\n },\n slow_down: {\n type: 'slow_down',\n codepoints: '1F422',\n shortcodes: ':turtle:',\n },\n};\n\nconst SkinTones: Record<SkinToneType, SkinTone> = {\n normal: {\n type: 'normal_skin_tone',\n codepoints: '',\n shortcodes: '',\n },\n light: {\n type: 'light_skin_tone',\n codepoints: '1F3FB',\n shortcodes: ':skin-tone-2:',\n },\n medium_light: {\n type: 'medium_light_skin_tone',\n codepoints: '1F3FC',\n shortcodes: ':skin-tone-3:',\n },\n medium: {\n type: 'medium_skin_tone',\n codepoints: '1F3FD',\n shortcodes: ':skin-tone-4:',\n },\n medium_dark: {\n type: 'medium_dark_skin_tone',\n codepoints: '1F3FE',\n shortcodes: ':skin-tone-5:',\n },\n dark: {\n type: 'dark_skin_tone',\n codepoints: '1F3FF',\n shortcodes: ':skin-tone-6:',\n },\n};\n\nexport {Reactions, SkinTones};\n"],"mappings":";;;;;;;AAEA,IAAMA,SAA+C,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACtDE,KAAK,EAAE;IACLC,IAAI,EAAE,OAAO;IACbC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDC,GAAG,EAAE;IACHH,IAAI,EAAE,KAAK;IACXC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDE,GAAG,EAAE;IACHJ,IAAI,EAAE,KAAK;IACXC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDG,IAAI,EAAE;IACJL,IAAI,EAAE,MAAM;IACZC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDI,SAAS,EAAE;IACTN,IAAI,EAAE,WAAW;IACjBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDK,IAAI,EAAE;IACJP,IAAI,EAAE,MAAM;IACZC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDM,QAAQ,EAAE;IACRR,IAAI,EAAE,UAAU;IAChBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDO,UAAU,EAAE;IACVT,IA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AAC"}
|
|
1
|
+
{"version":3,"names":["Reactions","exports","smile","type","codepoints","shortcodes","sad","wow","haha","celebrate","clap","thumb_up","thumb_down","heart","fire","prayer","speed_up","slow_down","SkinTones","normal","light","medium_light","medium","medium_dark","dark"],"sources":["reactions.ts"],"sourcesContent":["import {Reaction, ReactionServerType, SkinTone, SkinToneType} from './reactions.type';\n\nconst Reactions: Record<ReactionServerType, Reaction> = {\n smile: {\n type: 'smile',\n codepoints: '1F642',\n shortcodes: ':slightly_smiling_face:',\n },\n sad: {\n type: 'sad',\n codepoints: '1F625',\n shortcodes: ':sad_but_relieved_face:',\n },\n wow: {\n type: 'wow',\n codepoints: '1F62E',\n shortcodes: ':open_mouth:',\n },\n haha: {\n type: 'haha',\n codepoints: '1F603',\n shortcodes: ':smiley:',\n },\n celebrate: {\n type: 'celebrate',\n codepoints: '1F389',\n shortcodes: ':party_popper:',\n },\n clap: {\n type: 'clap',\n codepoints: '1F44F',\n shortcodes: ':clap:',\n },\n thumb_up: {\n type: 'thumb_up',\n codepoints: '1F44D',\n shortcodes: ':thumbsup:',\n },\n thumb_down: {\n type: 'thumb_down',\n codepoints: '1F44E',\n shortcodes: ':thumbsdown:',\n },\n heart: {\n type: 'heart',\n codepoints: '2764',\n shortcodes: ':heart:',\n },\n fire: {\n type: 'fire',\n codepoints: '1F525',\n shortcodes: ':fire:',\n },\n prayer: {\n type: 'prayer',\n codepoints: '1F64F',\n shortcodes: ':pray:',\n },\n speed_up: {\n type: 'speed_up',\n codepoints: '1F407',\n shortcodes: ':rabbit:',\n },\n slow_down: {\n type: 'slow_down',\n codepoints: '1F422',\n shortcodes: ':turtle:',\n },\n};\n\nconst SkinTones: Record<SkinToneType, SkinTone> = {\n normal: {\n type: 'normal_skin_tone',\n codepoints: '',\n shortcodes: '',\n },\n light: {\n type: 'light_skin_tone',\n codepoints: '1F3FB',\n shortcodes: ':skin-tone-2:',\n },\n medium_light: {\n type: 'medium_light_skin_tone',\n codepoints: '1F3FC',\n shortcodes: ':skin-tone-3:',\n },\n medium: {\n type: 'medium_skin_tone',\n codepoints: '1F3FD',\n shortcodes: ':skin-tone-4:',\n },\n medium_dark: {\n type: 'medium_dark_skin_tone',\n codepoints: '1F3FE',\n shortcodes: ':skin-tone-5:',\n },\n dark: {\n type: 'dark_skin_tone',\n codepoints: '1F3FF',\n shortcodes: ':skin-tone-6:',\n },\n};\n\nexport {Reactions, SkinTones};\n"],"mappings":";;;;;;;AAEA,IAAMA,SAA+C,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACtDE,KAAK,EAAE;IACLC,IAAI,EAAE,OAAO;IACbC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDC,GAAG,EAAE;IACHH,IAAI,EAAE,KAAK;IACXC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDE,GAAG,EAAE;IACHJ,IAAI,EAAE,KAAK;IACXC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDG,IAAI,EAAE;IACJL,IAAI,EAAE,MAAM;IACZC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDI,SAAS,EAAE;IACTN,IAAI,EAAE,WAAW;IACjBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDK,IAAI,EAAE;IACJP,IAAI,EAAE,MAAM;IACZC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDM,QAAQ,EAAE;IACRR,IAAI,EAAE,UAAU;IAChBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDO,UAAU,EAAE;IACVT,IAAI,EAAE,YAAY;IAClBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDQ,KAAK,EAAE;IACLV,IAAI,EAAE,OAAO;IACbC,UAAU,EAAE,MAAM;IAClBC,UAAU,EAAE;EACd,CAAC;EACDS,IAAI,EAAE;IACJX,IAAI,EAAE,MAAM;IACZC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDU,MAAM,EAAE;IACNZ,IAAI,EAAE,QAAQ;IACdC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDW,QAAQ,EAAE;IACRb,IAAI,EAAE,UAAU;IAChBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDY,SAAS,EAAE;IACTd,IAAI,EAAE,WAAW;IACjBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd;AACF,CAAC;AAED,IAAMa,SAAyC,GAAAjB,OAAA,CAAAiB,SAAA,GAAG;EAChDC,MAAM,EAAE;IACNhB,IAAI,EAAE,kBAAkB;IACxBC,UAAU,EAAE,EAAE;IACdC,UAAU,EAAE;EACd,CAAC;EACDe,KAAK,EAAE;IACLjB,IAAI,EAAE,iBAAiB;IACvBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDgB,YAAY,EAAE;IACZlB,IAAI,EAAE,wBAAwB;IAC9BC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDiB,MAAM,EAAE;IACNnB,IAAI,EAAE,kBAAkB;IACxBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDkB,WAAW,EAAE;IACXpB,IAAI,EAAE,uBAAuB;IAC7BC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDmB,IAAI,EAAE;IACJrB,IAAI,EAAE,gBAAgB;IACtBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ReactionServerType","exports","SkinToneType"],"sources":["reactions.type.ts"],"sourcesContent":["import {REACTION_RELAY_TYPES} from './constants';\n\nexport type EmoticonData = {\n type: string;\n codepoints?: string;\n shortcodes?: string;\n};\n\nexport type SkinTone = EmoticonData;\n\nexport type Reaction = EmoticonData & {\n tone?: SkinTone;\n};\n\n// eslint-disable-next-line no-shadow\nexport enum ReactionServerType {\n smile = 'smile',\n sad = 'sad',\n wow = 'wow',\n haha = 'haha',\n celebrate = 'celebrate',\n clap = 'clap',\n thumb_up = 'thumb_up',\n thumb_down = 'thumb_down',\n heart = 'heart',\n fire = 'fire',\n prayer = 'prayer',\n speed_up = 'speed_up',\n slow_down = 'slow_down',\n}\n\n// eslint-disable-next-line no-shadow\nexport enum SkinToneType {\n normal = 'normal',\n light = 'light',\n medium_light = 'medium_light',\n medium = 'medium',\n medium_dark = 'medium_dark',\n dark = 'dark',\n}\n\nexport type Sender = {\n participantId: string;\n};\n\nexport type ProcessedReaction = {\n reaction: Reaction;\n sender: {\n id: Sender['participantId'];\n name: string;\n };\n};\n\ntype RelayEventData = {\n relayType: (typeof REACTION_RELAY_TYPES)['REACTION'];\n reaction: Reaction;\n sender: Sender;\n};\n\nexport type RelayEvent = {\n data: RelayEventData;\n};\n"],"mappings":";;;;;;;AAcA;AAAA,IACYA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA,OAgB9B;AAAA,IACYE,YAAY,GAAAD,OAAA,CAAAC,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA"}
|
|
1
|
+
{"version":3,"names":["ReactionServerType","exports","SkinToneType"],"sources":["reactions.type.ts"],"sourcesContent":["import {REACTION_RELAY_TYPES} from './constants';\n\nexport type EmoticonData = {\n type: string;\n codepoints?: string;\n shortcodes?: string;\n};\n\nexport type SkinTone = EmoticonData;\n\nexport type Reaction = EmoticonData & {\n tone?: SkinTone;\n};\n\n// eslint-disable-next-line no-shadow\nexport enum ReactionServerType {\n smile = 'smile',\n sad = 'sad',\n wow = 'wow',\n haha = 'haha',\n celebrate = 'celebrate',\n clap = 'clap',\n thumb_up = 'thumb_up',\n thumb_down = 'thumb_down',\n heart = 'heart',\n fire = 'fire',\n prayer = 'prayer',\n speed_up = 'speed_up',\n slow_down = 'slow_down',\n}\n\n// eslint-disable-next-line no-shadow\nexport enum SkinToneType {\n normal = 'normal',\n light = 'light',\n medium_light = 'medium_light',\n medium = 'medium',\n medium_dark = 'medium_dark',\n dark = 'dark',\n}\n\nexport type Sender = {\n participantId: string;\n};\n\nexport type ProcessedReaction = {\n reaction: Reaction;\n sender: {\n id: Sender['participantId'];\n name: string;\n };\n};\n\ntype RelayEventData = {\n relayType: (typeof REACTION_RELAY_TYPES)['REACTION'];\n reaction: Reaction;\n sender: Sender;\n};\n\nexport type RelayEvent = {\n data: RelayEventData;\n};\n"],"mappings":";;;;;;;AAcA;AAAA,IACYA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA,OAgB9B;AAAA,IACYE,YAAY,GAAAD,OAAA,CAAAC,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
|