@webex/plugin-meetings 3.12.0-next.7 → 3.12.0-next.70

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.
Files changed (178) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +15 -2
  3. package/dist/aiEnableRequest/index.js.map +1 -1
  4. package/dist/breakouts/breakout.js +8 -3
  5. package/dist/breakouts/breakout.js.map +1 -1
  6. package/dist/breakouts/index.js +26 -2
  7. package/dist/breakouts/index.js.map +1 -1
  8. package/dist/config.js +2 -0
  9. package/dist/config.js.map +1 -1
  10. package/dist/constants.js +30 -7
  11. package/dist/constants.js.map +1 -1
  12. package/dist/controls-options-manager/constants.js +11 -1
  13. package/dist/controls-options-manager/constants.js.map +1 -1
  14. package/dist/controls-options-manager/index.js +38 -24
  15. package/dist/controls-options-manager/index.js.map +1 -1
  16. package/dist/controls-options-manager/util.js +91 -0
  17. package/dist/controls-options-manager/util.js.map +1 -1
  18. package/dist/hashTree/constants.js +13 -1
  19. package/dist/hashTree/constants.js.map +1 -1
  20. package/dist/hashTree/hashTreeParser.js +880 -382
  21. package/dist/hashTree/hashTreeParser.js.map +1 -1
  22. package/dist/hashTree/utils.js +42 -0
  23. package/dist/hashTree/utils.js.map +1 -1
  24. package/dist/index.js +7 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  27. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  28. package/dist/interceptors/locusRetry.js +23 -8
  29. package/dist/interceptors/locusRetry.js.map +1 -1
  30. package/dist/interpretation/index.js +10 -1
  31. package/dist/interpretation/index.js.map +1 -1
  32. package/dist/interpretation/interpretation.types.js +7 -0
  33. package/dist/interpretation/interpretation.types.js.map +1 -0
  34. package/dist/interpretation/siLanguage.js +1 -1
  35. package/dist/locus-info/controlsUtils.js +4 -1
  36. package/dist/locus-info/controlsUtils.js.map +1 -1
  37. package/dist/locus-info/index.js +298 -87
  38. package/dist/locus-info/index.js.map +1 -1
  39. package/dist/locus-info/types.js +19 -0
  40. package/dist/locus-info/types.js.map +1 -1
  41. package/dist/media/index.js +3 -1
  42. package/dist/media/index.js.map +1 -1
  43. package/dist/media/properties.js +1 -0
  44. package/dist/media/properties.js.map +1 -1
  45. package/dist/meeting/in-meeting-actions.js +3 -1
  46. package/dist/meeting/in-meeting-actions.js.map +1 -1
  47. package/dist/meeting/index.js +1046 -689
  48. package/dist/meeting/index.js.map +1 -1
  49. package/dist/meeting/muteState.js +10 -1
  50. package/dist/meeting/muteState.js.map +1 -1
  51. package/dist/meeting/request.js +5 -2
  52. package/dist/meeting/request.js.map +1 -1
  53. package/dist/meeting/util.js +20 -2
  54. package/dist/meeting/util.js.map +1 -1
  55. package/dist/meeting-info/meeting-info-v2.js +2 -2
  56. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  57. package/dist/meetings/index.js +231 -78
  58. package/dist/meetings/index.js.map +1 -1
  59. package/dist/meetings/meetings.types.js +6 -1
  60. package/dist/meetings/meetings.types.js.map +1 -1
  61. package/dist/meetings/request.js +39 -0
  62. package/dist/meetings/request.js.map +1 -1
  63. package/dist/meetings/util.js +79 -5
  64. package/dist/meetings/util.js.map +1 -1
  65. package/dist/member/index.js +10 -0
  66. package/dist/member/index.js.map +1 -1
  67. package/dist/member/types.js.map +1 -1
  68. package/dist/member/util.js +3 -0
  69. package/dist/member/util.js.map +1 -1
  70. package/dist/metrics/constants.js +4 -1
  71. package/dist/metrics/constants.js.map +1 -1
  72. package/dist/multistream/codec/constants.js +63 -0
  73. package/dist/multistream/codec/constants.js.map +1 -0
  74. package/dist/multistream/mediaRequestManager.js +62 -15
  75. package/dist/multistream/mediaRequestManager.js.map +1 -1
  76. package/dist/multistream/receiveSlot.js +9 -0
  77. package/dist/multistream/receiveSlot.js.map +1 -1
  78. package/dist/reactions/reactions.type.js.map +1 -1
  79. package/dist/recording-controller/index.js +1 -3
  80. package/dist/recording-controller/index.js.map +1 -1
  81. package/dist/types/config.d.ts +2 -0
  82. package/dist/types/constants.d.ts +9 -1
  83. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  84. package/dist/types/controls-options-manager/index.d.ts +10 -0
  85. package/dist/types/hashTree/constants.d.ts +2 -0
  86. package/dist/types/hashTree/hashTreeParser.d.ts +146 -17
  87. package/dist/types/hashTree/utils.d.ts +18 -0
  88. package/dist/types/index.d.ts +3 -0
  89. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  90. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  91. package/dist/types/locus-info/index.d.ts +50 -6
  92. package/dist/types/locus-info/types.d.ts +21 -1
  93. package/dist/types/media/properties.d.ts +1 -0
  94. package/dist/types/meeting/in-meeting-actions.d.ts +2 -0
  95. package/dist/types/meeting/index.d.ts +78 -5
  96. package/dist/types/meeting/request.d.ts +1 -0
  97. package/dist/types/meeting/util.d.ts +8 -0
  98. package/dist/types/meetings/index.d.ts +30 -2
  99. package/dist/types/meetings/meetings.types.d.ts +15 -0
  100. package/dist/types/meetings/request.d.ts +14 -0
  101. package/dist/types/member/index.d.ts +1 -0
  102. package/dist/types/member/types.d.ts +1 -0
  103. package/dist/types/member/util.d.ts +1 -0
  104. package/dist/types/metrics/constants.d.ts +3 -0
  105. package/dist/types/multistream/codec/constants.d.ts +7 -0
  106. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  107. package/dist/types/reactions/reactions.type.d.ts +3 -0
  108. package/dist/webinar/index.js +305 -159
  109. package/dist/webinar/index.js.map +1 -1
  110. package/package.json +22 -22
  111. package/src/aiEnableRequest/index.ts +16 -0
  112. package/src/breakouts/breakout.ts +3 -1
  113. package/src/breakouts/index.ts +31 -0
  114. package/src/config.ts +2 -0
  115. package/src/constants.ts +13 -2
  116. package/src/controls-options-manager/constants.ts +14 -1
  117. package/src/controls-options-manager/index.ts +47 -24
  118. package/src/controls-options-manager/util.ts +81 -1
  119. package/src/hashTree/constants.ts +16 -0
  120. package/src/hashTree/hashTreeParser.ts +580 -196
  121. package/src/hashTree/utils.ts +36 -0
  122. package/src/index.ts +6 -0
  123. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  124. package/src/interceptors/locusRetry.ts +25 -4
  125. package/src/interpretation/index.ts +27 -9
  126. package/src/interpretation/interpretation.types.ts +11 -0
  127. package/src/locus-info/controlsUtils.ts +3 -1
  128. package/src/locus-info/index.ts +293 -97
  129. package/src/locus-info/types.ts +25 -1
  130. package/src/media/index.ts +3 -0
  131. package/src/media/properties.ts +1 -0
  132. package/src/meeting/in-meeting-actions.ts +4 -0
  133. package/src/meeting/index.ts +386 -48
  134. package/src/meeting/muteState.ts +10 -1
  135. package/src/meeting/request.ts +11 -0
  136. package/src/meeting/util.ts +21 -2
  137. package/src/meeting-info/meeting-info-v2.ts +4 -2
  138. package/src/meetings/index.ts +134 -44
  139. package/src/meetings/meetings.types.ts +19 -0
  140. package/src/meetings/request.ts +43 -0
  141. package/src/meetings/util.ts +97 -1
  142. package/src/member/index.ts +10 -0
  143. package/src/member/types.ts +1 -0
  144. package/src/member/util.ts +3 -0
  145. package/src/metrics/constants.ts +3 -0
  146. package/src/multistream/codec/constants.ts +58 -0
  147. package/src/multistream/mediaRequestManager.ts +119 -28
  148. package/src/multistream/receiveSlot.ts +18 -0
  149. package/src/reactions/reactions.type.ts +3 -0
  150. package/src/recording-controller/index.ts +1 -2
  151. package/src/webinar/index.ts +214 -36
  152. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  153. package/test/unit/spec/breakouts/breakout.ts +9 -3
  154. package/test/unit/spec/breakouts/index.ts +49 -0
  155. package/test/unit/spec/controls-options-manager/index.js +140 -29
  156. package/test/unit/spec/controls-options-manager/util.js +165 -0
  157. package/test/unit/spec/hashTree/hashTreeParser.ts +1838 -180
  158. package/test/unit/spec/hashTree/utils.ts +125 -1
  159. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  160. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  161. package/test/unit/spec/interpretation/index.ts +26 -4
  162. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  163. package/test/unit/spec/locus-info/index.js +487 -81
  164. package/test/unit/spec/media/index.ts +31 -0
  165. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -0
  166. package/test/unit/spec/meeting/index.js +1240 -37
  167. package/test/unit/spec/meeting/muteState.js +81 -0
  168. package/test/unit/spec/meeting/request.js +12 -0
  169. package/test/unit/spec/meeting/utils.js +33 -0
  170. package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
  171. package/test/unit/spec/meetings/index.js +360 -10
  172. package/test/unit/spec/meetings/request.js +141 -0
  173. package/test/unit/spec/meetings/utils.js +189 -0
  174. package/test/unit/spec/member/index.js +7 -0
  175. package/test/unit/spec/member/util.js +24 -0
  176. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  177. package/test/unit/spec/recording-controller/index.js +9 -8
  178. package/test/unit/spec/webinar/index.ts +329 -28
@@ -496,6 +496,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
496
496
  (0, _defineProperty3.default)(_this, "floorGrantPending", void 0);
497
497
  (0, _defineProperty3.default)(_this, "hasJoinedOnce", void 0);
498
498
  (0, _defineProperty3.default)(_this, "hasWebsocketConnected", void 0);
499
+ (0, _defineProperty3.default)(_this, "mercuryOnlineHandler", void 0);
500
+ (0, _defineProperty3.default)(_this, "mercuryOfflineHandler", void 0);
499
501
  (0, _defineProperty3.default)(_this, "inMeetingActions", void 0);
500
502
  (0, _defineProperty3.default)(_this, "isLocalShareLive", void 0);
501
503
  (0, _defineProperty3.default)(_this, "isRoapInProgress", void 0);
@@ -641,6 +643,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
641
643
  * @returns {void}
642
644
  */
643
645
  (0, _defineProperty3.default)(_this, "processRelayEvent", function (e) {
646
+ if (!_this.isRelayEventRouteValid(e)) {
647
+ return;
648
+ }
644
649
  switch (e.data.relayType) {
645
650
  case _constants3.REACTION_RELAY_TYPES.REACTION:
646
651
  if (
@@ -680,6 +685,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
680
685
  */
681
686
  (0, _defineProperty3.default)(_this, "handleLLMOnline", function () {
682
687
  _this.restoreLLMSubscriptionsIfNeeded();
688
+ _this.locusInfo.syncAllHashTreeDatasets({
689
+ onlyLLM: true
690
+ });
683
691
  _triggerProxy.default.trigger(_this, {
684
692
  file: 'meeting/index',
685
693
  function: 'handleLLMOnline'
@@ -687,6 +695,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
687
695
  });
688
696
  /**
689
697
  * Disconnects and cleans up the default LLM session listeners/timers.
698
+ *
699
+ * Ownership-aware: only calls `disconnectLLM` when this meeting is the
700
+ * current owner of the default LLM session (or when no owner is recorded).
701
+ * Event listeners belonging to this meeting instance are always detached
702
+ * so they do not receive another meeting's relay events.
703
+ *
690
704
  * @param {Object} options
691
705
  * @param {boolean} [options.removeOnlineListener=true] removes the one-time online listener
692
706
  * @param {boolean} [options.throwOnError=true] rethrows disconnect errors when true
@@ -698,47 +712,74 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
698
712
  removeOnlineListener,
699
713
  _ref3$throwOnError,
700
714
  throwOnError,
715
+ _this$webex$internal$,
716
+ currentOwner,
717
+ isOwner,
718
+ _this$webex$internal$2,
719
+ currentOwnerAfterCleanup,
720
+ _this$webex$internal$3,
721
+ _this$webex$internal$4,
701
722
  _args = arguments,
702
723
  _t;
703
724
  return _regenerator.default.wrap(function (_context) {
704
725
  while (1) switch (_context.prev = _context.next) {
705
726
  case 0:
706
727
  _ref3 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref3$removeOnlineLis = _ref3.removeOnlineListener, removeOnlineListener = _ref3$removeOnlineLis === void 0 ? true : _ref3$removeOnlineLis, _ref3$throwOnError = _ref3.throwOnError, throwOnError = _ref3$throwOnError === void 0 ? true : _ref3$throwOnError;
728
+ // @ts-ignore - Fix type
729
+ // @ts-ignore - Fix type
730
+ _this$webex$internal$ = _this.webex.internal.llm.resolveSessionOwnership(_this.id, _constants.LLM_DEFAULT_SESSION), currentOwner = _this$webex$internal$.currentOwner, isOwner = _this$webex$internal$.isOwner;
707
731
  _context.prev = 1;
732
+ if (!isOwner) {
733
+ _context.next = 3;
734
+ break;
735
+ }
708
736
  _context.next = 2;
709
737
  return _this.webex.internal.llm.disconnectLLM({
710
738
  code: 3050,
711
739
  reason: 'done (permanent)'
712
- });
740
+ }, _constants.LLM_DEFAULT_SESSION, _this.id);
713
741
  case 2:
714
742
  _context.next = 4;
715
743
  break;
716
744
  case 3:
717
- _context.prev = 3;
745
+ _loggerProxy.default.logger.info("Meeting:index#cleanupLLMConneciton --> skipping disconnect; LLM owned by meeting ".concat(currentOwner, ", not ").concat(_this.id));
746
+ case 4:
747
+ _context.next = 6;
748
+ break;
749
+ case 5:
750
+ _context.prev = 5;
718
751
  _t = _context["catch"](1);
719
752
  _loggerProxy.default.logger.error('Meeting:index#cleanupLLMConneciton --> Failed to disconnect default LLM session', _t);
720
753
  if (!throwOnError) {
721
- _context.next = 4;
754
+ _context.next = 6;
722
755
  break;
723
756
  }
724
757
  throw _t;
725
- case 4:
726
- _context.prev = 4;
758
+ case 6:
759
+ _context.prev = 6;
727
760
  if (removeOnlineListener) {
728
761
  // @ts-ignore - Fix type
729
762
  _this.webex.internal.llm.off('online', _this.handleLLMOnline);
730
763
  }
731
- // @ts-ignore - fix types
732
- _this.webex.internal.llm.off('event:relay.event', _this.processRelayEvent);
733
- // @ts-ignore - Fix type
734
- _this.webex.internal.llm.off(_constants.LOCUS_LLM_EVENT, _this.processLocusLLMEvent);
735
- _this.clearLLMHealthCheckTimer();
736
- return _context.finish(4);
737
- case 5:
764
+ _this.stopListeningForLLMEvents();
765
+
766
+ // Re-check ownership after awaiting disconnectLLM. If ownership changed
767
+ // while cleanup was in flight, do not clear another meeting's owner tag.
768
+ if (isOwner) {
769
+ _this$webex$internal$2 =
770
+ // @ts-ignore - Fix type
771
+ _this.webex.internal.llm.resolveSessionOwnership(_this.id, _constants.LLM_DEFAULT_SESSION), currentOwnerAfterCleanup = _this$webex$internal$2.currentOwner;
772
+ if (currentOwnerAfterCleanup === _this.id) {
773
+ // @ts-ignore - Fix type
774
+ (_this$webex$internal$3 = (_this$webex$internal$4 = _this.webex.internal.llm).setOwnerMeetingId) === null || _this$webex$internal$3 === void 0 ? void 0 : _this$webex$internal$3.call(_this$webex$internal$4, undefined);
775
+ }
776
+ }
777
+ return _context.finish(6);
778
+ case 7:
738
779
  case "end":
739
780
  return _context.stop();
740
781
  }
741
- }, _callee, null, [[1, 3, 4, 5]]);
782
+ }, _callee, null, [[1, 5, 6, 7]]);
742
783
  })));
743
784
  /**
744
785
  * Handles ROAP_FAILURE event from the webrtc media connection
@@ -1321,6 +1362,37 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1321
1362
  }
1322
1363
  }
1323
1364
  });
1365
+ _this.statsAnalyzer.on(_internalMediaCore.StatsAnalyzerEventNames.STATS_UPDATE, function (data) {
1366
+ // Extract srtpCipher from transport stats
1367
+ var srtpCipher;
1368
+ var _iterator = _createForOfIteratorHelper(data.stats.values()),
1369
+ _step;
1370
+ try {
1371
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1372
+ var stats = _step.value;
1373
+ if (stats.type === 'transport' && stats.srtpCipher) {
1374
+ srtpCipher = stats.srtpCipher;
1375
+ break;
1376
+ }
1377
+ }
1378
+
1379
+ // Only emit event if srtpCipher has changed
1380
+ } catch (err) {
1381
+ _iterator.e(err);
1382
+ } finally {
1383
+ _iterator.f();
1384
+ }
1385
+ if (srtpCipher && srtpCipher !== _this.mediaProperties.srtpCipher) {
1386
+ _loggerProxy.default.logger.info("Meeting:index#setupStatsAnalyzerEventHandlers --> SRTP cipher changed from ".concat(_this.mediaProperties.srtpCipher, " to ").concat(srtpCipher));
1387
+ _this.mediaProperties.srtpCipher = srtpCipher;
1388
+ _triggerProxy.default.trigger(_this, {
1389
+ file: 'meeting/index',
1390
+ function: 'setupStatsAnalyzerEventHandlers'
1391
+ }, _constants.EVENT_TRIGGERS.MEETING_SRTP_CIPHER_UPDATED, {
1392
+ srtpCipher: srtpCipher
1393
+ });
1394
+ }
1395
+ });
1324
1396
  });
1325
1397
  /**
1326
1398
  * media failed, so collect a stats report from webrtc using the wcme connection to grab the rtc stats report
@@ -1549,9 +1621,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1549
1621
  _this.shareStatus = _constants.SHARE_STATUS.NO_SHARE;
1550
1622
  }
1551
1623
  _this.queuedMediaUpdates = [];
1552
- _this.stopTranscription();
1553
- _this.transcription = undefined;
1554
- _this.annotation.deregisterEvents();
1624
+
1625
+ // Listener teardown (transcription, annotation, llm/mercury) runs in
1626
+ // stopListeningForMeetingEvents() before /leave and /end so events
1627
+ // received mid-teardown do not trigger Locus syncs. Calling it here
1628
+ // again would double-emit MEETING_STOPPED_RECEIVING_TRANSCRIPTION
1629
+ // because stopTranscription() always fires its trigger.
1630
+ //
1631
+ // Ownership-aware token clear is encapsulated inside clearDataChannelToken().
1555
1632
  _this.clearDataChannelToken();
1556
1633
  _context5.next = 1;
1557
1634
  return _this.cleanupLLMConneciton({
@@ -1727,7 +1804,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1727
1804
  });
1728
1805
 
1729
1806
  // @ts-ignore
1730
- _this.aiEnableRequest = new _aiEnableRequest.default({}, {
1807
+ _this.aiEnableRequest = new _aiEnableRequest.default({
1808
+ locusUrl: _this.locusUrl
1809
+ }, {
1731
1810
  parent: _this.webex
1732
1811
  });
1733
1812
 
@@ -1766,6 +1845,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1766
1845
  var _this$members$findMem2;
1767
1846
  return (_this$members$findMem2 = _this.members.findMemberByCsi(csi)) === null || _this$members$findMem2 === void 0 ? void 0 : _this$members$findMem2.id;
1768
1847
  });
1848
+
1769
1849
  /**
1770
1850
  * Object containing helper classes for managing media requests for audio/video/screenshare (for multistream media connections)
1771
1851
  * All multistream media requests sent out for this meeting have to go through them.
@@ -1777,7 +1857,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1777
1857
  return;
1778
1858
  }
1779
1859
  _this.mediaProperties.webrtcMediaConnection.requestMedia(_internalMediaCore.MediaType.AudioMain, mediaRequests);
1780
- }, {
1860
+ }, _this.getIngressPayloadTypeCallback.bind(_this), {
1781
1861
  // @ts-ignore - config coming from registerPlugin
1782
1862
  degradationPreferences: _this.config.degradationPreferences,
1783
1863
  kind: 'audio',
@@ -1789,7 +1869,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1789
1869
  return;
1790
1870
  }
1791
1871
  _this.mediaProperties.webrtcMediaConnection.requestMedia(_internalMediaCore.MediaType.VideoMain, mediaRequests);
1792
- }, {
1872
+ }, _this.getIngressPayloadTypeCallback.bind(_this), {
1793
1873
  // @ts-ignore - config coming from registerPlugin
1794
1874
  degradationPreferences: _this.config.degradationPreferences,
1795
1875
  kind: 'video',
@@ -1801,7 +1881,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1801
1881
  return;
1802
1882
  }
1803
1883
  _this.mediaProperties.webrtcMediaConnection.requestMedia(_internalMediaCore.MediaType.AudioSlides, mediaRequests);
1804
- }, {
1884
+ }, _this.getIngressPayloadTypeCallback.bind(_this), {
1805
1885
  // @ts-ignore - config coming from registerPlugin
1806
1886
  degradationPreferences: _this.config.degradationPreferences,
1807
1887
  kind: 'audio',
@@ -1813,11 +1893,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1813
1893
  return;
1814
1894
  }
1815
1895
  _this.mediaProperties.webrtcMediaConnection.requestMedia(_internalMediaCore.MediaType.VideoSlides, mediaRequests);
1816
- }, {
1896
+ }, _this.getIngressPayloadTypeCallback.bind(_this), {
1817
1897
  // @ts-ignore - config coming from registerPlugin
1818
1898
  degradationPreferences: _this.config.degradationPreferences,
1819
1899
  kind: 'video',
1820
- trimRequestsToNumOfSources: false
1900
+ trimRequestsToNumOfSources: false,
1901
+ // @ts-ignore - config coming from registerPlugin
1902
+ enableAv1: _this.config.enableAv1SlidesSupport
1821
1903
  })
1822
1904
  };
1823
1905
  /**
@@ -2486,14 +2568,36 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2486
2568
  }
2487
2569
 
2488
2570
  /**
2489
- * Temporary func to return webex object,
2490
- * in order to access internal plugin metrics
2491
- * in the utils file.
2492
- * @internal
2493
- * @returns {object} webex object
2571
+ * Get the ingress payload type for a given media type and codec mime type
2572
+ * @param {MediaType} mediaType - The media type
2573
+ * @param {MediaCodecMimeType} codecMimeType - The codec mime type
2574
+ * @returns {number | undefined} - The ingress payload type
2575
+ * @private
2576
+ * @memberof Meeting
2494
2577
  */
2495
2578
  (0, _inherits2.default)(Meeting, _StatelessWebexPlugin);
2496
2579
  return (0, _createClass2.default)(Meeting, [{
2580
+ key: "getIngressPayloadTypeCallback",
2581
+ value: function getIngressPayloadTypeCallback(mediaType, codecMimeType) {
2582
+ if (this.isMultistream) {
2583
+ try {
2584
+ return this.mediaProperties.webrtcMediaConnection.getIngressPayloadType(mediaType, codecMimeType);
2585
+ } catch (error) {
2586
+ _loggerProxy.default.logger.info("Meeting:index#mediaRequestManager --> failed to get ingress payload type for mediaType=".concat(mediaType, ", codecMimeType=").concat(codecMimeType), error);
2587
+ return undefined;
2588
+ }
2589
+ }
2590
+ return undefined;
2591
+ }
2592
+
2593
+ /**
2594
+ * Temporary func to return webex object,
2595
+ * in order to access internal plugin metrics
2596
+ * in the utils file.
2597
+ * @internal
2598
+ * @returns {object} webex object
2599
+ */
2600
+ }, {
2497
2601
  key: "getWebexObject",
2498
2602
  value: function getWebexObject() {
2499
2603
  // @ts-ignore
@@ -3525,7 +3629,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3525
3629
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_RECORDING_UPDATED, function (_ref10) {
3526
3630
  var state = _ref10.state,
3527
3631
  modifiedBy = _ref10.modifiedBy,
3528
- lastModified = _ref10.lastModified;
3632
+ lastModified = _ref10.lastModified,
3633
+ modifiedByServiceAppName = _ref10.modifiedByServiceAppName,
3634
+ modifiedByServiceAppId = _ref10.modifiedByServiceAppId;
3529
3635
  var event;
3530
3636
  switch (state) {
3531
3637
  case _constants.RECORDING_STATE.RECORDING:
@@ -3549,7 +3655,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3549
3655
  _this12.recording = {
3550
3656
  state: state === _constants.RECORDING_STATE.RESUMED ? _constants.RECORDING_STATE.RECORDING : state,
3551
3657
  modifiedBy: modifiedBy,
3552
- lastModified: lastModified
3658
+ lastModified: lastModified,
3659
+ modifiedByServiceAppName: modifiedByServiceAppName,
3660
+ modifiedByServiceAppId: modifiedByServiceAppId
3553
3661
  };
3554
3662
  _triggerProxy.default.trigger(_this12, {
3555
3663
  file: 'meeting/index',
@@ -4086,15 +4194,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4086
4194
  _this14.breakouts.locusUrlUpdate(url);
4087
4195
  _this14.simultaneousInterpretation.locusUrlUpdate(url);
4088
4196
  _this14.annotation.locusUrlUpdate(url);
4197
+ _this14.aiEnableRequest.locusUrlUpdate(url);
4089
4198
  _this14.locusUrl = url;
4090
4199
  _this14.locusId = (_this14$locusUrl = _this14.locusUrl) === null || _this14$locusUrl === void 0 ? void 0 : _this14$locusUrl.split('/').pop();
4091
4200
  _this14.recordingController.setLocusUrl(_this14.locusUrl);
4092
4201
  _this14.controlsOptionsManager.setLocusUrl(_this14.locusUrl, !!isMainLocus);
4093
4202
  _this14.webinar.locusUrlUpdate(url);
4094
- // @ts-ignore
4095
- _this14.webex.internal.llm.setRefreshHandler(function () {
4096
- return _this14.refreshDataChannelToken();
4097
- });
4098
4203
  _triggerProxy.default.trigger(_this14, {
4099
4204
  file: 'meeting/index',
4100
4205
  function: 'setUpLocusSelfListener'
@@ -4324,34 +4429,56 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4324
4429
  });
4325
4430
  _this19.updateLLMConnection();
4326
4431
  });
4327
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, function (payload) {
4328
- var _this19$rtcMetrics;
4329
- _this19.stopKeepAlive();
4330
- if (payload) {
4331
- _triggerProxy.default.trigger(_this19, {
4332
- file: 'meeting/index',
4333
- function: 'setUpLocusInfoSelfListener'
4334
- }, _constants.EVENT_TRIGGERS.MEETING_SELF_GUEST_ADMITTED, {
4335
- payload: payload
4336
- });
4432
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, /*#__PURE__*/function () {
4433
+ var _ref37 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(payload) {
4434
+ var _this19$rtcMetrics;
4435
+ var _t9;
4436
+ return _regenerator.default.wrap(function (_context1) {
4437
+ while (1) switch (_context1.prev = _context1.next) {
4438
+ case 0:
4439
+ _this19.stopKeepAlive();
4440
+ if (payload) {
4441
+ _triggerProxy.default.trigger(_this19, {
4442
+ file: 'meeting/index',
4443
+ function: 'setUpLocusInfoSelfListener'
4444
+ }, _constants.EVENT_TRIGGERS.MEETING_SELF_GUEST_ADMITTED, {
4445
+ payload: payload
4446
+ });
4337
4447
 
4338
- // @ts-ignore
4339
- _this19.webex.internal.newMetrics.submitClientEvent({
4340
- name: 'client.lobby.exited',
4341
- options: {
4342
- meetingId: _this19.id
4448
+ // @ts-ignore
4449
+ _this19.webex.internal.newMetrics.submitClientEvent({
4450
+ name: 'client.lobby.exited',
4451
+ options: {
4452
+ meetingId: _this19.id
4453
+ }
4454
+ });
4455
+ _metrics.default.sendBehavioralMetric(_constants2.default.GUEST_EXITED_LOBBY, {
4456
+ correlation_id: _this19.correlationId
4457
+ });
4458
+ }
4459
+ (_this19$rtcMetrics = _this19.rtcMetrics) === null || _this19$rtcMetrics === void 0 ? void 0 : _this19$rtcMetrics.sendNextMetrics();
4460
+ _context1.prev = 1;
4461
+ _context1.next = 2;
4462
+ return _this19.ensureDefaultDatachannelTokenAfterAdmit();
4463
+ case 2:
4464
+ _context1.next = 4;
4465
+ break;
4466
+ case 3:
4467
+ _context1.prev = 3;
4468
+ _t9 = _context1["catch"](1);
4469
+ _loggerProxy.default.logger.warn("Meeting:index#setUpLocusInfoSelfListener --> failed post-admit token prefetch flow: ".concat((_t9 === null || _t9 === void 0 ? void 0 : _t9.message) || String(_t9)));
4470
+ case 4:
4471
+ _this19.updateLLMConnection();
4472
+ case 5:
4473
+ case "end":
4474
+ return _context1.stop();
4343
4475
  }
4344
- });
4345
- _metrics.default.sendBehavioralMetric(_constants2.default.GUEST_EXITED_LOBBY, {
4346
- correlation_id: _this19.correlationId
4347
- });
4348
- }
4349
- (_this19$rtcMetrics = _this19.rtcMetrics) === null || _this19$rtcMetrics === void 0 ? void 0 : _this19$rtcMetrics.sendNextMetrics();
4350
- _this19.ensureDefaultDatachannelTokenAfterAdmit().catch(function (error) {
4351
- _loggerProxy.default.logger.warn("Meeting:index#setUpLocusInfoSelfListener --> failed post-admit token prefetch flow: ".concat((error === null || error === void 0 ? void 0 : error.message) || String(error)));
4352
- });
4353
- _this19.updateLLMConnection();
4354
- });
4476
+ }, _callee1, null, [[1, 3]]);
4477
+ }));
4478
+ return function (_x9) {
4479
+ return _ref37.apply(this, arguments);
4480
+ };
4481
+ }());
4355
4482
 
4356
4483
  // @ts-ignore - check if MEDIA_INACTIVITY exists
4357
4484
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, function () {
@@ -4471,49 +4598,49 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4471
4598
  }
4472
4599
  });
4473
4600
  this.locusInfo.on(_constants.EVENTS.DESTROY_MEETING, /*#__PURE__*/function () {
4474
- var _ref37 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(payload) {
4475
- var _t9;
4476
- return _regenerator.default.wrap(function (_context1) {
4477
- while (1) switch (_context1.prev = _context1.next) {
4601
+ var _ref38 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(payload) {
4602
+ var _t0;
4603
+ return _regenerator.default.wrap(function (_context10) {
4604
+ while (1) switch (_context10.prev = _context10.next) {
4478
4605
  case 0:
4479
4606
  if (!_this20.wirelessShare) {
4480
- _context1.next = 2;
4607
+ _context10.next = 2;
4481
4608
  break;
4482
4609
  }
4483
4610
  if (!_this20.mediaProperties.shareVideoStream) {
4484
- _context1.next = 1;
4611
+ _context10.next = 1;
4485
4612
  break;
4486
4613
  }
4487
- _context1.next = 1;
4614
+ _context10.next = 1;
4488
4615
  return _this20.setLocalShareVideoStream(undefined);
4489
4616
  case 1:
4490
4617
  if (!_this20.mediaProperties.shareAudioStream) {
4491
- _context1.next = 2;
4618
+ _context10.next = 2;
4492
4619
  break;
4493
4620
  }
4494
- _context1.next = 2;
4621
+ _context10.next = 2;
4495
4622
  return _this20.setLocalShareAudioStream(undefined);
4496
4623
  case 2:
4497
4624
  if (!payload.shouldLeave) {
4498
- _context1.next = 7;
4625
+ _context10.next = 7;
4499
4626
  break;
4500
4627
  }
4501
- _context1.prev = 3;
4502
- _context1.next = 4;
4628
+ _context10.prev = 3;
4629
+ _context10.next = 4;
4503
4630
  return _this20.leave({
4504
4631
  reason: payload.reason
4505
4632
  });
4506
4633
  case 4:
4507
4634
  _loggerProxy.default.logger.warn('Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. The meeting has been left, but has not been destroyed, you should see a later event for leave.');
4508
- _context1.next = 6;
4635
+ _context10.next = 6;
4509
4636
  break;
4510
4637
  case 5:
4511
- _context1.prev = 5;
4512
- _t9 = _context1["catch"](3);
4638
+ _context10.prev = 5;
4639
+ _t0 = _context10["catch"](3);
4513
4640
  // @ts-ignore
4514
- _loggerProxy.default.logger.error("Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. Issue with leave for meeting, meeting still in collection: ".concat(_this20, ", error: ").concat(_t9));
4641
+ _loggerProxy.default.logger.error("Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. Issue with leave for meeting, meeting still in collection: ".concat(_this20, ", error: ").concat(_t0));
4515
4642
  case 6:
4516
- _context1.next = 8;
4643
+ _context10.next = 8;
4517
4644
  break;
4518
4645
  case 7:
4519
4646
  _loggerProxy.default.logger.info('Meeting:index#setUpLocusInfoMeetingListener --> MEETING_REMOVED_REASON', payload.reason);
@@ -4527,12 +4654,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4527
4654
  });
4528
4655
  case 8:
4529
4656
  case "end":
4530
- return _context1.stop();
4657
+ return _context10.stop();
4531
4658
  }
4532
- }, _callee1, null, [[3, 5]]);
4659
+ }, _callee10, null, [[3, 5]]);
4533
4660
  }));
4534
- return function (_x9) {
4535
- return _ref37.apply(this, arguments);
4661
+ return function (_x0) {
4662
+ return _ref38.apply(this, arguments);
4536
4663
  };
4537
4664
  }());
4538
4665
  }
@@ -4650,31 +4777,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4650
4777
  }, {
4651
4778
  key: "beRightBack",
4652
4779
  value: (function () {
4653
- var _beRightBack = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(enabled) {
4780
+ var _beRightBack = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(enabled) {
4654
4781
  var _this22 = this;
4655
4782
  var errorMessage, error, _errorMessage, _error;
4656
- return _regenerator.default.wrap(function (_context10) {
4657
- while (1) switch (_context10.prev = _context10.next) {
4783
+ return _regenerator.default.wrap(function (_context11) {
4784
+ while (1) switch (_context11.prev = _context11.next) {
4658
4785
  case 0:
4659
4786
  if (this.isMultistream) {
4660
- _context10.next = 1;
4787
+ _context11.next = 1;
4661
4788
  break;
4662
4789
  }
4663
4790
  errorMessage = 'Meeting:index#beRightBack --> Not a multistream meeting';
4664
4791
  error = new Error(errorMessage);
4665
4792
  _loggerProxy.default.logger.error(error);
4666
- return _context10.abrupt("return", _promise.default.reject(error));
4793
+ return _context11.abrupt("return", _promise.default.reject(error));
4667
4794
  case 1:
4668
4795
  if (this.mediaProperties.webrtcMediaConnection) {
4669
- _context10.next = 2;
4796
+ _context11.next = 2;
4670
4797
  break;
4671
4798
  }
4672
4799
  _errorMessage = 'Meeting:index#beRightBack --> WebRTC media connection is not defined';
4673
4800
  _error = new Error(_errorMessage);
4674
4801
  _loggerProxy.default.logger.error(_error);
4675
- return _context10.abrupt("return", _promise.default.reject(_error));
4802
+ return _context11.abrupt("return", _promise.default.reject(_error));
4676
4803
  case 2:
4677
- return _context10.abrupt("return", this.brbState.enable(enabled, this.sendSlotManager).then(function () {
4804
+ return _context11.abrupt("return", this.brbState.enable(enabled, this.sendSlotManager).then(function () {
4678
4805
  if (_this22.audio && enabled) {
4679
4806
  // locus mutes the participant with brb enabled request,
4680
4807
  // so we need to explicitly update remote mute for correct logic flow
@@ -4685,11 +4812,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4685
4812
  }));
4686
4813
  case 3:
4687
4814
  case "end":
4688
- return _context10.stop();
4815
+ return _context11.stop();
4689
4816
  }
4690
- }, _callee10, this);
4817
+ }, _callee11, this);
4691
4818
  }));
4692
- function beRightBack(_x0) {
4819
+ function beRightBack(_x1) {
4693
4820
  return _beRightBack.apply(this, arguments);
4694
4821
  }
4695
4822
  return beRightBack;
@@ -5117,7 +5244,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5117
5244
  displayHints: this.userDisplayHints
5118
5245
  }),
5119
5246
  canAttendeeRequestAiAssistantEnabled: _util2.default.canAttendeeRequestAiAssistantEnabled(this.userDisplayHints, this.roles),
5120
- isAttendeeRequestAiAssistantDeclinedAll: _util2.default.attendeeRequestAiAssistantDeclinedAll(this.userDisplayHints)
5247
+ isAttendeeRequestAiAssistantDeclinedAll: _util2.default.attendeeRequestAiAssistantDeclinedAll(this.userDisplayHints),
5248
+ isAnonymizeDisplayNamesEnabled: _util2.default.isAnonymizeDisplayNamesEnabled(this.userDisplayHints)
5121
5249
  }) || changed;
5122
5250
  }
5123
5251
  if (changed) {
@@ -5168,6 +5296,51 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5168
5296
  this.sipUri = sipUri;
5169
5297
  }
5170
5298
 
5299
+ /**
5300
+ * After initial locus setup, refreshes destination with synced locus data and optionally
5301
+ * performs deferred meeting info fetch when initial locus was incomplete.
5302
+ * @param {LocusDTO} locus
5303
+ * @returns {void}
5304
+ */
5305
+ }, {
5306
+ key: "finalizeMeetingAfterInitialLocusSetup",
5307
+ value: (function () {
5308
+ var _finalizeMeetingAfterInitialLocusSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(locus) {
5309
+ var _this$destination;
5310
+ var _t1;
5311
+ return _regenerator.default.wrap(function (_context12) {
5312
+ while (1) switch (_context12.prev = _context12.next) {
5313
+ case 0:
5314
+ if (locus && (this === null || this === void 0 ? void 0 : this.destinationType) === _constants.DESTINATION_TYPE.LOCUS_ID) {
5315
+ // destination is initialized from the initial locus snapshot in constructor,
5316
+ // so refresh it after locus sync to avoid stale partial hash-tree data.
5317
+ this.destination = locus;
5318
+ }
5319
+ if (!((!this.meetingInfo || (0, _lodash.isEmpty)(this.meetingInfo)) && (_this$destination = this.destination) !== null && _this$destination !== void 0 && _this$destination.info && !this.fetchMeetingInfoTimeoutId && !_util3.default.isOneOnOneCall(locus))) {
5320
+ _context12.next = 4;
5321
+ break;
5322
+ }
5323
+ _context12.prev = 1;
5324
+ _context12.next = 2;
5325
+ return this.fetchMeetingInfo({});
5326
+ case 2:
5327
+ _context12.next = 4;
5328
+ break;
5329
+ case 3:
5330
+ _context12.prev = 3;
5331
+ _t1 = _context12["catch"](1);
5332
+ _loggerProxy.default.logger.info("Meeting:index#finalizeMeetingAfterInitialLocusSetup --> deferred fetchMeetingInfo failed: ".concat(_t1.message));
5333
+ case 4:
5334
+ case "end":
5335
+ return _context12.stop();
5336
+ }
5337
+ }, _callee12, this, [[1, 3]]);
5338
+ }));
5339
+ function finalizeMeetingAfterInitialLocusSetup(_x10) {
5340
+ return _finalizeMeetingAfterInitialLocusSetup.apply(this, arguments);
5341
+ }
5342
+ return finalizeMeetingAfterInitialLocusSetup;
5343
+ }()
5171
5344
  /**
5172
5345
  * Set the locus info the class instance. Should be called with the parsed locus
5173
5346
  * we got in the join response.
@@ -5183,6 +5356,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5183
5356
  * @private
5184
5357
  * @memberof Meeting
5185
5358
  */
5359
+ )
5186
5360
  }, {
5187
5361
  key: "setLocus",
5188
5362
  value: function setLocus(data) {
@@ -5362,11 +5536,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5362
5536
  }, {
5363
5537
  key: "setLocalAudioStream",
5364
5538
  value: (function () {
5365
- var _setLocalAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(localStream) {
5539
+ var _setLocalAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(localStream) {
5366
5540
  var _this$audio2;
5367
5541
  var oldStream;
5368
- return _regenerator.default.wrap(function (_context11) {
5369
- while (1) switch (_context11.prev = _context11.next) {
5542
+ return _regenerator.default.wrap(function (_context13) {
5543
+ while (1) switch (_context13.prev = _context13.next) {
5370
5544
  case 0:
5371
5545
  oldStream = this.mediaProperties.audioStream;
5372
5546
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.UserMuteStateChange, this.localAudioStreamMuteStateHandler);
@@ -5380,21 +5554,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5380
5554
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.SystemMuteStateChange, this.localAudioStreamMuteStateHandler);
5381
5555
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5382
5556
  if (!(!this.isMultistream || !localStream)) {
5383
- _context11.next = 1;
5557
+ _context13.next = 1;
5384
5558
  break;
5385
5559
  }
5386
- _context11.next = 1;
5560
+ _context13.next = 1;
5387
5561
  return this.unpublishStream(_internalMediaCore.MediaType.AudioMain, oldStream);
5388
5562
  case 1:
5389
- _context11.next = 2;
5563
+ _context13.next = 2;
5390
5564
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
5391
5565
  case 2:
5392
5566
  case "end":
5393
- return _context11.stop();
5567
+ return _context13.stop();
5394
5568
  }
5395
- }, _callee11, this);
5569
+ }, _callee13, this);
5396
5570
  }));
5397
- function setLocalAudioStream(_x1) {
5571
+ function setLocalAudioStream(_x11) {
5398
5572
  return _setLocalAudioStream.apply(this, arguments);
5399
5573
  }
5400
5574
  return setLocalAudioStream;
@@ -5410,11 +5584,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5410
5584
  }, {
5411
5585
  key: "setLocalVideoStream",
5412
5586
  value: (function () {
5413
- var _setLocalVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(localStream) {
5587
+ var _setLocalVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(localStream) {
5414
5588
  var _this$video2;
5415
5589
  var oldStream;
5416
- return _regenerator.default.wrap(function (_context12) {
5417
- while (1) switch (_context12.prev = _context12.next) {
5590
+ return _regenerator.default.wrap(function (_context14) {
5591
+ while (1) switch (_context14.prev = _context14.next) {
5418
5592
  case 0:
5419
5593
  oldStream = this.mediaProperties.videoStream;
5420
5594
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.UserMuteStateChange, this.localVideoStreamMuteStateHandler);
@@ -5430,21 +5604,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5430
5604
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5431
5605
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.ConstraintsChange, this.localConstraintsChangeHandler);
5432
5606
  if (!(!this.isMultistream || !localStream)) {
5433
- _context12.next = 1;
5607
+ _context14.next = 1;
5434
5608
  break;
5435
5609
  }
5436
- _context12.next = 1;
5610
+ _context14.next = 1;
5437
5611
  return this.unpublishStream(_internalMediaCore.MediaType.VideoMain, oldStream);
5438
5612
  case 1:
5439
- _context12.next = 2;
5613
+ _context14.next = 2;
5440
5614
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
5441
5615
  case 2:
5442
5616
  case "end":
5443
- return _context12.stop();
5617
+ return _context14.stop();
5444
5618
  }
5445
- }, _callee12, this);
5619
+ }, _callee14, this);
5446
5620
  }));
5447
- function setLocalVideoStream(_x10) {
5621
+ function setLocalVideoStream(_x12) {
5448
5622
  return _setLocalVideoStream.apply(this, arguments);
5449
5623
  }
5450
5624
  return setLocalVideoStream;
@@ -5461,10 +5635,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5461
5635
  }, {
5462
5636
  key: "setLocalShareVideoStream",
5463
5637
  value: (function () {
5464
- var _setLocalShareVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(localDisplayStream) {
5638
+ var _setLocalShareVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15(localDisplayStream) {
5465
5639
  var oldStream;
5466
- return _regenerator.default.wrap(function (_context13) {
5467
- while (1) switch (_context13.prev = _context13.next) {
5640
+ return _regenerator.default.wrap(function (_context15) {
5641
+ while (1) switch (_context15.prev = _context15.next) {
5468
5642
  case 0:
5469
5643
  oldStream = this.mediaProperties.shareVideoStream;
5470
5644
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.SystemMuteStateChange, this.handleShareVideoStreamMuteStateChange);
@@ -5476,21 +5650,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5476
5650
  localDisplayStream === null || localDisplayStream === void 0 ? void 0 : localDisplayStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5477
5651
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
5478
5652
  if (!(!this.isMultistream || !localDisplayStream)) {
5479
- _context13.next = 1;
5653
+ _context15.next = 1;
5480
5654
  break;
5481
5655
  }
5482
- _context13.next = 1;
5656
+ _context15.next = 1;
5483
5657
  return this.unpublishStream(_internalMediaCore.MediaType.VideoSlides, oldStream);
5484
5658
  case 1:
5485
- _context13.next = 2;
5659
+ _context15.next = 2;
5486
5660
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
5487
5661
  case 2:
5488
5662
  case "end":
5489
- return _context13.stop();
5663
+ return _context15.stop();
5490
5664
  }
5491
- }, _callee13, this);
5665
+ }, _callee15, this);
5492
5666
  }));
5493
- function setLocalShareVideoStream(_x11) {
5667
+ function setLocalShareVideoStream(_x13) {
5494
5668
  return _setLocalShareVideoStream.apply(this, arguments);
5495
5669
  }
5496
5670
  return setLocalShareVideoStream;
@@ -5506,10 +5680,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5506
5680
  }, {
5507
5681
  key: "setLocalShareAudioStream",
5508
5682
  value: (function () {
5509
- var _setLocalShareAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(localSystemAudioStream) {
5683
+ var _setLocalShareAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16(localSystemAudioStream) {
5510
5684
  var oldStream;
5511
- return _regenerator.default.wrap(function (_context14) {
5512
- while (1) switch (_context14.prev = _context14.next) {
5685
+ return _regenerator.default.wrap(function (_context16) {
5686
+ while (1) switch (_context16.prev = _context16.next) {
5513
5687
  case 0:
5514
5688
  oldStream = this.mediaProperties.shareAudioStream;
5515
5689
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.Ended, this.handleShareAudioStreamEnded);
@@ -5519,21 +5693,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5519
5693
  localSystemAudioStream === null || localSystemAudioStream === void 0 ? void 0 : localSystemAudioStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5520
5694
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
5521
5695
  if (!(!this.isMultistream || !localSystemAudioStream)) {
5522
- _context14.next = 1;
5696
+ _context16.next = 1;
5523
5697
  break;
5524
5698
  }
5525
- _context14.next = 1;
5699
+ _context16.next = 1;
5526
5700
  return this.unpublishStream(_internalMediaCore.MediaType.AudioSlides, oldStream);
5527
5701
  case 1:
5528
- _context14.next = 2;
5702
+ _context16.next = 2;
5529
5703
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
5530
5704
  case 2:
5531
5705
  case "end":
5532
- return _context14.stop();
5706
+ return _context16.stop();
5533
5707
  }
5534
- }, _callee14, this);
5708
+ }, _callee16, this);
5535
5709
  }));
5536
- function setLocalShareAudioStream(_x12) {
5710
+ function setLocalShareAudioStream(_x14) {
5537
5711
  return _setLocalShareAudioStream.apply(this, arguments);
5538
5712
  }
5539
5713
  return setLocalShareAudioStream;
@@ -5642,8 +5816,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5642
5816
  var _this25 = this;
5643
5817
  // Client will have a socket manager and handle reconnecting to mercury, when we reconnect to mercury
5644
5818
  // if the meeting has active peer connections, it should try to reconnect.
5645
- // @ts-ignore
5646
- this.webex.internal.mercury.on(_constants.ONLINE, function () {
5819
+ this.mercuryOnlineHandler = function () {
5647
5820
  _loggerProxy.default.logger.info('Meeting:index#setMercuryListener --> Web socket online');
5648
5821
 
5649
5822
  // Only send restore event when it was disconnected before and for connected later
@@ -5653,15 +5826,48 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5653
5826
  });
5654
5827
  }
5655
5828
  _this25.hasWebsocketConnected = true;
5656
- });
5657
-
5658
- // @ts-ignore
5659
- this.webex.internal.mercury.on(_constants.OFFLINE, function () {
5829
+ };
5830
+ this.mercuryOfflineHandler = function () {
5660
5831
  _loggerProxy.default.logger.error('Meeting:index#setMercuryListener --> Web socket offline');
5661
5832
  _metrics.default.sendBehavioralMetric(_constants2.default.MERCURY_CONNECTION_FAILURE, {
5662
5833
  correlation_id: _this25.correlationId
5663
5834
  });
5664
- });
5835
+ };
5836
+
5837
+ // @ts-ignore
5838
+ this.webex.internal.mercury.on(_constants.ONLINE, this.mercuryOnlineHandler);
5839
+ // @ts-ignore
5840
+ this.webex.internal.mercury.on(_constants.OFFLINE, this.mercuryOfflineHandler);
5841
+ }
5842
+
5843
+ /**
5844
+ * Removes this meeting's Mercury ONLINE/OFFLINE event listeners registered
5845
+ * by setMercuryListener(). Must be called before Locus /leave to avoid
5846
+ * unnecessary syncs/metrics triggered by events received while leaving
5847
+ * (per Locus team recommendation).
5848
+ *
5849
+ * Mercury is a process-wide singleton shared with other plugins, so we
5850
+ * pass the bound handler refs to .off() to avoid clearing every listener
5851
+ * for ONLINE/OFFLINE on the shared emitter.
5852
+ *
5853
+ * Idempotent: subsequent calls are no-ops because the handler refs are
5854
+ * cleared after detaching.
5855
+ * @private
5856
+ * @returns {void}
5857
+ */
5858
+ }, {
5859
+ key: "stopListeningForMercuryEvents",
5860
+ value: function stopListeningForMercuryEvents() {
5861
+ if (this.mercuryOnlineHandler) {
5862
+ // @ts-ignore
5863
+ this.webex.internal.mercury.off(_constants.ONLINE, this.mercuryOnlineHandler);
5864
+ this.mercuryOnlineHandler = undefined;
5865
+ }
5866
+ if (this.mercuryOfflineHandler) {
5867
+ // @ts-ignore
5868
+ this.webex.internal.mercury.off(_constants.OFFLINE, this.mercuryOfflineHandler);
5869
+ this.mercuryOfflineHandler = undefined;
5870
+ }
5665
5871
  }
5666
5872
 
5667
5873
  /**
@@ -5972,7 +6178,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5972
6178
  }, {
5973
6179
  key: "joinWithMedia",
5974
6180
  value: (function () {
5975
- var _joinWithMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
6181
+ var _joinWithMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
5976
6182
  var _this30 = this;
5977
6183
  var options,
5978
6184
  mediaOptions,
@@ -5995,20 +6201,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5995
6201
  shouldRetry,
5996
6202
  _error2,
5997
6203
  _error3,
5998
- _args15 = arguments,
5999
- _t0,
6000
- _t1;
6001
- return _regenerator.default.wrap(function (_context15) {
6002
- while (1) switch (_context15.prev = _context15.next) {
6204
+ _args17 = arguments,
6205
+ _t10,
6206
+ _t11;
6207
+ return _regenerator.default.wrap(function (_context17) {
6208
+ while (1) switch (_context17.prev = _context17.next) {
6003
6209
  case 0:
6004
- options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
6210
+ options = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
6005
6211
  mediaOptions = options.mediaOptions, _options$joinOptions = options.joinOptions, joinOptions = _options$joinOptions === void 0 ? {} : _options$joinOptions;
6006
6212
  _this$joinWithMediaRe = this.joinWithMediaRetryInfo, isRetry = _this$joinWithMediaRe.isRetry, prevJoinResponse = _this$joinWithMediaRe.prevJoinResponse;
6007
6213
  if (mediaOptions !== null && mediaOptions !== void 0 && mediaOptions.allowMediaInLobby) {
6008
- _context15.next = 1;
6214
+ _context17.next = 1;
6009
6215
  break;
6010
6216
  }
6011
- return _context15.abrupt("return", _promise.default.reject(new _parameter.default('joinWithMedia() can only be used with allowMediaInLobby set to true')));
6217
+ return _context17.abrupt("return", _promise.default.reject(new _parameter.default('joinWithMedia() can only be used with allowMediaInLobby set to true')));
6012
6218
  case 1:
6013
6219
  this.allowMediaInLobby = true;
6014
6220
  _loggerProxy.default.logger.info('Meeting:index#joinWithMedia called');
@@ -6020,39 +6226,39 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6020
6226
  in case WebRTC is not available at all.
6021
6227
  */
6022
6228
  if (!(_webCapabilities.WebCapabilities.supportsRTCPeerConnection() === _webCapabilities.CapabilityState.NOT_CAPABLE)) {
6023
- _context15.next = 2;
6229
+ _context17.next = 2;
6024
6230
  break;
6025
6231
  }
6026
6232
  throw new _internalMediaCore.Errors.WebrtcApiNotAvailableError('RTCPeerConnection API is not available in this environment');
6027
6233
  case 2:
6028
- _context15.prev = 2;
6234
+ _context17.prev = 2;
6029
6235
  forceTurnDiscovery = false;
6030
6236
  if (joinResponse) {
6031
- _context15.next = 7;
6237
+ _context17.next = 7;
6032
6238
  break;
6033
6239
  }
6034
- _context15.next = 3;
6240
+ _context17.next = 3;
6035
6241
  return this.roap.generateTurnDiscoveryRequestMessage(this, true);
6036
6242
  case 3:
6037
- turnDiscoveryRequest = _context15.sent;
6243
+ turnDiscoveryRequest = _context17.sent;
6038
6244
  turnDiscoverySkippedReason = turnDiscoveryRequest.turnDiscoverySkippedReason;
6039
6245
  joinOptions.roapMessage = turnDiscoveryRequest.roapMessage;
6040
6246
  _loggerProxy.default.logger.info('Meeting:index#joinWithMedia ---> calling join with joinOptions, ', joinOptions);
6041
- _context15.next = 4;
6247
+ _context17.next = 4;
6042
6248
  return this.join(joinOptions);
6043
6249
  case 4:
6044
- joinResponse = _context15.sent;
6250
+ joinResponse = _context17.sent;
6045
6251
  joined = true;
6046
6252
 
6047
6253
  // if we sent out TURN discovery Roap message with join, process the TURN discovery response
6048
6254
  if (!joinOptions.roapMessage) {
6049
- _context15.next = 6;
6255
+ _context17.next = 6;
6050
6256
  break;
6051
6257
  }
6052
- _context15.next = 5;
6258
+ _context17.next = 5;
6053
6259
  return this.roap.handleTurnDiscoveryHttpResponse(this, joinResponse);
6054
6260
  case 5:
6055
- _yield$this$roap$hand = _context15.sent;
6261
+ _yield$this$roap$hand = _context17.sent;
6056
6262
  turnServerInfo = _yield$this$roap$hand.turnServerInfo;
6057
6263
  turnDiscoverySkippedReason = _yield$this$roap$hand.turnDiscoverySkippedReason;
6058
6264
  this.turnDiscoverySkippedReason = turnDiscoverySkippedReason;
@@ -6061,7 +6267,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6061
6267
  this.roap.abortTurnDiscovery();
6062
6268
  }
6063
6269
  case 6:
6064
- _context15.next = 8;
6270
+ _context17.next = 8;
6065
6271
  break;
6066
6272
  case 7:
6067
6273
  // This is a retry, when join succeeded but addMedia failed, so we'll just call addMedia() again,
@@ -6069,43 +6275,43 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6069
6275
  forceTurnDiscovery = true;
6070
6276
  joined = true;
6071
6277
  case 8:
6072
- _context15.next = 9;
6278
+ _context17.next = 9;
6073
6279
  return this.addMediaInternal(function () {
6074
6280
  return _this30.joinWithMediaRetryInfo.isRetry ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
6075
6281
  }, turnServerInfo, forceTurnDiscovery, mediaOptions);
6076
6282
  case 9:
6077
- mediaResponse = _context15.sent;
6283
+ mediaResponse = _context17.sent;
6078
6284
  this.joinWithMediaRetryInfo = {
6079
6285
  isRetry: false,
6080
6286
  prevJoinResponse: undefined
6081
6287
  };
6082
- return _context15.abrupt("return", {
6288
+ return _context17.abrupt("return", {
6083
6289
  join: joinResponse,
6084
6290
  media: mediaResponse,
6085
6291
  multistreamEnabled: this.isMultistream
6086
6292
  });
6087
6293
  case 10:
6088
- _context15.prev = 10;
6089
- _t0 = _context15["catch"](2);
6090
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _t0);
6294
+ _context17.prev = 10;
6295
+ _t10 = _context17["catch"](2);
6296
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _t10);
6091
6297
  this.roap.abortTurnDiscovery();
6092
6298
 
6093
6299
  // if this was the first attempt, let's do a retry
6094
6300
  shouldRetry = !isRetry;
6095
- if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_t0) || _internalPluginMetrics.CallDiagnosticUtils.isWebrtcApiNotAvailableError(_t0)) {
6301
+ if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_t10) || _internalPluginMetrics.CallDiagnosticUtils.isWebrtcApiNotAvailableError(_t10)) {
6096
6302
  // errors related to offer creation (for example missing H264 codec) will happen again no matter how many times we try,
6097
6303
  // so there is no point doing a retry
6098
6304
  shouldRetry = false;
6099
6305
  }
6100
- if (_internalPluginMetrics.CallDiagnosticUtils.isBrowserMediaError(_t0)) {
6306
+ if (_internalPluginMetrics.CallDiagnosticUtils.isBrowserMediaError(_t10)) {
6101
6307
  shouldRetry = false;
6102
6308
  // eslint-disable-next-line no-ex-assign
6103
- _t0 = (0, _lodash.merge)({
6309
+ _t10 = (0, _lodash.merge)({
6104
6310
  error: {
6105
6311
  body: {
6106
- errorCode: _internalPluginMetrics.CallDiagnosticUtils.getBrowserMediaErrorCode(_t0),
6107
- message: (_error2 = _t0) === null || _error2 === void 0 ? void 0 : _error2.message,
6108
- name: (_error3 = _t0) === null || _error3 === void 0 ? void 0 : _error3.name
6312
+ errorCode: _internalPluginMetrics.CallDiagnosticUtils.getBrowserMediaErrorCode(_t10),
6313
+ message: (_error2 = _t10) === null || _error2 === void 0 ? void 0 : _error2.message,
6314
+ name: (_error3 = _t10) === null || _error3 === void 0 ? void 0 : _error3.name
6109
6315
  }
6110
6316
  }
6111
6317
  });
@@ -6113,54 +6319,54 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6113
6319
 
6114
6320
  // we only want to call leave if join was successful and this was a retry or we won't be doing any more retries
6115
6321
  if (!(joined && (isRetry || !shouldRetry))) {
6116
- _context15.next = 14;
6322
+ _context17.next = 14;
6117
6323
  break;
6118
6324
  }
6119
- _context15.prev = 11;
6120
- _context15.next = 12;
6325
+ _context17.prev = 11;
6326
+ _context17.next = 12;
6121
6327
  return this.leave({
6122
6328
  resourceId: joinOptions === null || joinOptions === void 0 ? void 0 : joinOptions.resourceId,
6123
6329
  reason: 'joinWithMedia failure'
6124
6330
  });
6125
6331
  case 12:
6126
- _context15.next = 14;
6332
+ _context17.next = 14;
6127
6333
  break;
6128
6334
  case 13:
6129
- _context15.prev = 13;
6130
- _t1 = _context15["catch"](11);
6131
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _t1);
6132
- leaveError = _t1;
6335
+ _context17.prev = 13;
6336
+ _t11 = _context17["catch"](11);
6337
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _t11);
6338
+ leaveError = _t11;
6133
6339
  case 14:
6134
6340
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_WITH_MEDIA_FAILURE, {
6135
6341
  correlation_id: this.correlationId,
6136
6342
  locus_id: (_this$locusUrl = this.locusUrl) === null || _this$locusUrl === void 0 ? void 0 : _this$locusUrl.split('/').pop(),
6137
6343
  // if join fails, we may end up with no locusUrl
6138
- reason: _t0.message,
6139
- stack: _t0.stack,
6344
+ reason: _t10.message,
6345
+ stack: _t10.stack,
6140
6346
  leaveErrorReason: (_leaveError = leaveError) === null || _leaveError === void 0 ? void 0 : _leaveError.message,
6141
6347
  isRetry: isRetry
6142
6348
  }, {
6143
- type: _t0.name
6349
+ type: _t10.name
6144
6350
  });
6145
6351
  if (!shouldRetry) {
6146
- _context15.next = 15;
6352
+ _context17.next = 15;
6147
6353
  break;
6148
6354
  }
6149
6355
  _loggerProxy.default.logger.warn('Meeting:index#joinWithMedia --> retrying call to joinWithMedia');
6150
6356
  this.joinWithMediaRetryInfo.isRetry = true;
6151
6357
  this.joinWithMediaRetryInfo.prevJoinResponse = joinResponse;
6152
- return _context15.abrupt("return", this.joinWithMedia(options));
6358
+ return _context17.abrupt("return", this.joinWithMedia(options));
6153
6359
  case 15:
6154
6360
  this.joinWithMediaRetryInfo = {
6155
6361
  isRetry: false,
6156
6362
  prevJoinResponse: undefined
6157
6363
  };
6158
- throw _t0;
6364
+ throw _t10;
6159
6365
  case 16:
6160
6366
  case "end":
6161
- return _context15.stop();
6367
+ return _context17.stop();
6162
6368
  }
6163
- }, _callee15, this, [[2, 10], [11, 13]]);
6369
+ }, _callee17, this, [[2, 10], [11, 13]]);
6164
6370
  }));
6165
6371
  function joinWithMedia() {
6166
6372
  return _joinWithMedia.apply(this, arguments);
@@ -6190,20 +6396,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6190
6396
  return _promise.default.reject(new _parameter.default('Cannot reconnect, Media has not established to reconnect'));
6191
6397
  }
6192
6398
  this.cleanUpBeforeReconnection();
6193
- return this.reconnectionManager.reconnect(options, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
6194
- return _regenerator.default.wrap(function (_context16) {
6195
- while (1) switch (_context16.prev = _context16.next) {
6399
+ return this.reconnectionManager.reconnect(options, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
6400
+ return _regenerator.default.wrap(function (_context18) {
6401
+ while (1) switch (_context18.prev = _context18.next) {
6196
6402
  case 0:
6197
- _context16.next = 1;
6403
+ _context18.next = 1;
6198
6404
  return _this31.waitForRemoteSDPAnswer();
6199
6405
  case 1:
6200
- _context16.next = 2;
6406
+ _context18.next = 2;
6201
6407
  return _this31.waitForMediaConnectionConnected();
6202
6408
  case 2:
6203
6409
  case "end":
6204
- return _context16.stop();
6410
+ return _context18.stop();
6205
6411
  }
6206
- }, _callee16);
6412
+ }, _callee18);
6207
6413
  }))).then(function () {
6208
6414
  _loggerProxy.default.logger.log('Meeting:index#reconnect --> Meeting reconnect success');
6209
6415
  }).catch(function (error) {
@@ -6344,53 +6550,75 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6344
6550
  }, {
6345
6551
  key: "startTranscription",
6346
6552
  value: (function () {
6347
- var _startTranscription = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17(options) {
6348
- var _t10;
6349
- return _regenerator.default.wrap(function (_context17) {
6350
- while (1) switch (_context17.prev = _context17.next) {
6553
+ var _startTranscription = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19(options) {
6554
+ var _t12;
6555
+ return _regenerator.default.wrap(function (_context19) {
6556
+ while (1) switch (_context19.prev = _context19.next) {
6351
6557
  case 0:
6352
6558
  if (!this.isJoined()) {
6353
- _context17.next = 5;
6559
+ _context19.next = 5;
6354
6560
  break;
6355
6561
  }
6356
6562
  _loggerProxy.default.logger.info('Meeting:index#startTranscription --> Attempting to enable transcription!');
6357
- _context17.prev = 1;
6563
+ _context19.prev = 1;
6358
6564
  if (!this.areVoiceaEventsSetup) {
6359
6565
  this.setUpVoiceaListeners();
6360
6566
  }
6361
6567
 
6362
6568
  // @ts-ignore
6363
- _context17.next = 2;
6569
+ _context19.next = 2;
6364
6570
  return this.webex.internal.voicea.turnOnCaptions(options === null || options === void 0 ? void 0 : options.spokenLanguage);
6365
6571
  case 2:
6366
- _context17.next = 4;
6572
+ _context19.next = 4;
6367
6573
  break;
6368
6574
  case 3:
6369
- _context17.prev = 3;
6370
- _t10 = _context17["catch"](1);
6371
- _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_t10));
6575
+ _context19.prev = 3;
6576
+ _t12 = _context19["catch"](1);
6577
+ _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_t12));
6372
6578
  _metrics.default.sendBehavioralMetric(_constants2.default.RECEIVE_TRANSCRIPTION_FAILURE, {
6373
6579
  correlation_id: this.correlationId,
6374
- reason: _t10.message,
6375
- stack: _t10.stack
6580
+ reason: _t12.message,
6581
+ stack: _t12.stack
6376
6582
  });
6377
6583
  case 4:
6378
- _context17.next = 6;
6584
+ _context19.next = 6;
6379
6585
  break;
6380
6586
  case 5:
6381
6587
  _loggerProxy.default.logger.error("Meeting:index#startTranscription --> meeting joined : ".concat(this.isJoined()));
6382
6588
  throw new Error('Meeting is not joined');
6383
6589
  case 6:
6384
6590
  case "end":
6385
- return _context17.stop();
6591
+ return _context19.stop();
6386
6592
  }
6387
- }, _callee17, this, [[1, 3]]);
6593
+ }, _callee19, this, [[1, 3]]);
6388
6594
  }));
6389
- function startTranscription(_x13) {
6595
+ function startTranscription(_x15) {
6390
6596
  return _startTranscription.apply(this, arguments);
6391
6597
  }
6392
6598
  return startTranscription;
6393
6599
  }())
6600
+ }, {
6601
+ key: "isRelayEventRouteValid",
6602
+ value:
6603
+ /**
6604
+ * Verifies the relay event was delivered for the active LLM session binding.
6605
+ * @param {RelayEvent} event Event object coming from LLM Connection
6606
+ * @returns {boolean}
6607
+ */
6608
+ function isRelayEventRouteValid(event) {
6609
+ var _event$headers;
6610
+ var route = event === null || event === void 0 ? void 0 : (_event$headers = event.headers) === null || _event$headers === void 0 ? void 0 : _event$headers.route;
6611
+ if (!route) {
6612
+ return true;
6613
+ }
6614
+ var llm = this.webex.internal.llm;
6615
+ var isPracticeSession = llm.isConnected(_constants.LLM_PRACTICE_SESSION);
6616
+ var expectedBinding = isPracticeSession ? llm.getBinding(_constants.LLM_PRACTICE_SESSION) : llm.getBinding();
6617
+ if (!expectedBinding || route === expectedBinding) {
6618
+ return true;
6619
+ }
6620
+ return false;
6621
+ }
6394
6622
  }, {
6395
6623
  key: "stopTranscription",
6396
6624
  value:
@@ -6441,9 +6669,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6441
6669
  key: "restoreLLMSubscriptionsIfNeeded",
6442
6670
  value: function restoreLLMSubscriptionsIfNeeded() {
6443
6671
  try {
6444
- var _this$webex$internal$, _this$webex$internal$2;
6672
+ var _this$webex$internal$5, _this$webex$internal$6;
6445
6673
  // @ts-ignore
6446
- var isCaptionBoxOn = (_this$webex$internal$ = this.webex.internal.voicea) === null || _this$webex$internal$ === void 0 ? void 0 : (_this$webex$internal$2 = _this$webex$internal$.getIsCaptionBoxOn) === null || _this$webex$internal$2 === void 0 ? void 0 : _this$webex$internal$2.call(_this$webex$internal$);
6674
+ var isCaptionBoxOn = (_this$webex$internal$5 = this.webex.internal.voicea) === null || _this$webex$internal$5 === void 0 ? void 0 : (_this$webex$internal$6 = _this$webex$internal$5.getIsCaptionBoxOn) === null || _this$webex$internal$6 === void 0 ? void 0 : _this$webex$internal$6.call(_this$webex$internal$5);
6447
6675
  if (!isCaptionBoxOn) {
6448
6676
  return;
6449
6677
  }
@@ -6473,7 +6701,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6473
6701
  * Scenario D: Joining any other way (sip, pstn, conversationUrl, link just need to specify resourceId)
6474
6702
  */
6475
6703
  function () {
6476
- var _join = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
6704
+ var _join = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
6477
6705
  var _this34 = this;
6478
6706
  var options,
6479
6707
  errorMessage,
@@ -6484,26 +6712,26 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6484
6712
  _error4,
6485
6713
  _errorMessage3,
6486
6714
  _error5,
6487
- _args18 = arguments,
6488
- _t11;
6489
- return _regenerator.default.wrap(function (_context18) {
6490
- while (1) switch (_context18.prev = _context18.next) {
6715
+ _args20 = arguments,
6716
+ _t13;
6717
+ return _regenerator.default.wrap(function (_context20) {
6718
+ while (1) switch (_context20.prev = _context20.next) {
6491
6719
  case 0:
6492
- options = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
6720
+ options = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : {};
6493
6721
  if (this.webex.meetings.registered) {
6494
- _context18.next = 1;
6722
+ _context20.next = 1;
6495
6723
  break;
6496
6724
  }
6497
6725
  errorMessage = 'Meeting:index#join --> Device not registered';
6498
6726
  error = new Error(errorMessage);
6499
6727
  _loggerProxy.default.logger.error(errorMessage);
6500
- return _context18.abrupt("return", _promise.default.reject(error));
6728
+ return _context20.abrupt("return", _promise.default.reject(error));
6501
6729
  case 1:
6502
6730
  if (!this.deferJoin) {
6503
- _context18.next = 2;
6731
+ _context20.next = 2;
6504
6732
  break;
6505
6733
  }
6506
- return _context18.abrupt("return", this.deferJoin);
6734
+ return _context20.abrupt("return", this.deferJoin);
6507
6735
  case 2:
6508
6736
  // Create a deferred promise for a consistent resolve value from utils.
6509
6737
  // This also prevents redundant API calls.
@@ -6555,15 +6783,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6555
6783
  this.wirelessShare = true;
6556
6784
  }
6557
6785
  if (!options.meetingQuality) {
6558
- _context18.next = 6;
6786
+ _context20.next = 6;
6559
6787
  break;
6560
6788
  }
6561
6789
  if (!(typeof options.meetingQuality === 'string')) {
6562
- _context18.next = 4;
6790
+ _context20.next = 4;
6563
6791
  break;
6564
6792
  }
6565
6793
  if (_constants.QUALITY_LEVELS[options.meetingQuality]) {
6566
- _context18.next = 3;
6794
+ _context20.next = 3;
6567
6795
  break;
6568
6796
  }
6569
6797
  _errorMessage2 = "Meeting:index#join --> ".concat(options.meetingQuality, " not defined");
@@ -6571,16 +6799,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6571
6799
  _loggerProxy.default.logger.error(_errorMessage2);
6572
6800
  joinFailed(_error4);
6573
6801
  this.deferJoin = undefined;
6574
- return _context18.abrupt("return", _promise.default.reject(_error4));
6802
+ return _context20.abrupt("return", _promise.default.reject(_error4));
6575
6803
  case 3:
6576
6804
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality);
6577
6805
  case 4:
6578
6806
  if (!((0, _typeof2.default)(options.meetingQuality) === 'object')) {
6579
- _context18.next = 6;
6807
+ _context20.next = 6;
6580
6808
  break;
6581
6809
  }
6582
6810
  if (_constants.QUALITY_LEVELS[options.meetingQuality.remote]) {
6583
- _context18.next = 5;
6811
+ _context20.next = 5;
6584
6812
  break;
6585
6813
  }
6586
6814
  _errorMessage3 = "Meeting:index#join --> ".concat(options.meetingQuality.remote, " not defined");
@@ -6588,42 +6816,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6588
6816
  _error5 = new Error(_errorMessage3);
6589
6817
  joinFailed(_error5);
6590
6818
  this.deferJoin = undefined;
6591
- return _context18.abrupt("return", _promise.default.reject(new Error(_errorMessage3)));
6819
+ return _context20.abrupt("return", _promise.default.reject(new Error(_errorMessage3)));
6592
6820
  case 5:
6593
6821
  if (options.meetingQuality.remote) {
6594
6822
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality.remote);
6595
6823
  }
6596
6824
  case 6:
6597
6825
  this.isMultistream = !!options.enableMultistream;
6598
- _context18.prev = 7;
6599
- _context18.next = 8;
6826
+ _context20.prev = 7;
6827
+ _context20.next = 8;
6600
6828
  return this.checkAndRefreshPermissionToken(_constants.MEETING_PERMISSION_TOKEN_REFRESH_THRESHOLD_IN_SEC, _constants.MEETING_PERMISSION_TOKEN_REFRESH_REASON);
6601
6829
  case 8:
6602
- _context18.next = 10;
6830
+ _context20.next = 10;
6603
6831
  break;
6604
6832
  case 9:
6605
- _context18.prev = 9;
6606
- _t11 = _context18["catch"](7);
6607
- _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _t11);
6608
- if (!(_t11 instanceof _captchaError.default || _t11 instanceof _passwordError.default || _t11 instanceof _permission.default)) {
6609
- _context18.next = 10;
6833
+ _context20.prev = 9;
6834
+ _t13 = _context20["catch"](7);
6835
+ _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _t13);
6836
+ if (!(_t13 instanceof _captchaError.default || _t13 instanceof _passwordError.default || _t13 instanceof _permission.default)) {
6837
+ _context20.next = 10;
6610
6838
  break;
6611
6839
  }
6612
- this.meetingFiniteStateMachine.fail(_t11);
6840
+ this.meetingFiniteStateMachine.fail(_t13);
6613
6841
 
6614
6842
  // Upload logs on refreshpermissionToken refresh Failure
6615
6843
  _triggerProxy.default.trigger(this, {
6616
6844
  file: 'meeting/index',
6617
6845
  function: 'join'
6618
6846
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
6619
- joinFailed(_t11);
6847
+ joinFailed(_t13);
6620
6848
  this.deferJoin = undefined;
6621
6849
 
6622
6850
  // if refresh permission token requires captcha, password or permission, we are throwing the errors
6623
6851
  // and bubble it up to client
6624
- return _context18.abrupt("return", _promise.default.reject(_t11));
6852
+ return _context20.abrupt("return", _promise.default.reject(_t13));
6625
6853
  case 10:
6626
- return _context18.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
6854
+ return _context20.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
6627
6855
  _this34.meetingFiniteStateMachine.join();
6628
6856
  _this34.setupLocusMediaRequest();
6629
6857
 
@@ -6679,9 +6907,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6679
6907
  }));
6680
6908
  case 11:
6681
6909
  case "end":
6682
- return _context18.stop();
6910
+ return _context20.stop();
6683
6911
  }
6684
- }, _callee18, this, [[7, 9]]);
6912
+ }, _callee20, this, [[7, 9]]);
6685
6913
  }));
6686
6914
  function join() {
6687
6915
  return _join.apply(this, arguments);
@@ -6730,17 +6958,66 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6730
6958
  this.llmHealthCheckTimer = undefined;
6731
6959
  }
6732
6960
  }
6733
- }, {
6961
+
6962
+ /**
6963
+ * Removes LLM event listeners and clears the health check timer.
6964
+ * Must be called before Locus /leave to avoid unnecessary syncs triggered
6965
+ * by events received while leaving (per Locus team recommendation).
6966
+ * Idempotent: safe to call multiple times; .off() is a no-op when no
6967
+ * matching listener is registered.
6968
+ * @private
6969
+ * @returns {void}
6970
+ */
6971
+ }, {
6972
+ key: "stopListeningForLLMEvents",
6973
+ value: function stopListeningForLLMEvents() {
6974
+ // @ts-ignore - fix types
6975
+ this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
6976
+ // @ts-ignore - fix types
6977
+ this.webex.internal.llm.off(_constants.LOCUS_LLM_EVENT, this.processLocusLLMEvent);
6978
+ this.clearLLMHealthCheckTimer();
6979
+ }
6980
+
6981
+ /**
6982
+ * Stops listening on every event bus (LLM, Mercury, voicea/transcription,
6983
+ * annotation) that could otherwise deliver events to this meeting while
6984
+ * Locus is processing /leave or /end. Per the Locus team recommendation,
6985
+ * this must run before the Locus request is dispatched to avoid
6986
+ * unnecessary syncs triggered by in-flight events.
6987
+ *
6988
+ * Voicea (transcription) subscribes to llm 'event:relay.event' internally,
6989
+ * and the annotation plugin subscribes to both mercury and llm, so both
6990
+ * must be torn down alongside the direct LLM/Mercury listeners.
6991
+ *
6992
+ * Idempotent: safe to call multiple times; .off() is a no-op when no
6993
+ * matching listener is registered, and stopTranscription is guarded.
6994
+ * @private
6995
+ * @returns {void}
6996
+ */
6997
+ }, {
6998
+ key: "stopListeningForMeetingEvents",
6999
+ value: function stopListeningForMeetingEvents() {
7000
+ this.stopListeningForLLMEvents();
7001
+ this.stopListeningForMercuryEvents();
7002
+ if (this.transcription) {
7003
+ this.stopTranscription();
7004
+ this.transcription = undefined;
7005
+ }
7006
+ this.annotation.deregisterEvents();
7007
+ }
7008
+ }, {
6734
7009
  key: "clearDataChannelToken",
6735
7010
  value:
6736
7011
  /**
6737
- * Clears all data channel tokens stored in LLM.
6738
- * Called during meeting cleanup to ensure stale tokens are not reused.
7012
+ * Clears data channel tokens associated with this meeting ownership.
7013
+ * Ownership checks are enforced in internal-plugin-llm.
6739
7014
  * @returns {void}
6740
7015
  */
6741
7016
  function clearDataChannelToken() {
6742
7017
  // @ts-ignore
6743
- this.webex.internal.llm.resetDatachannelTokens();
7018
+ this.webex.internal.llm.clearDatachannelToken(_constants.LLM_DEFAULT_SESSION, this.id);
7019
+ // @ts-ignore
7020
+ this.webex.internal.llm.clearDatachannelToken(_constants.LLM_PRACTICE_SESSION, this.id);
6744
7021
  }
6745
7022
 
6746
7023
  /**
@@ -6757,11 +7034,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6757
7034
  var practiceSessionDatachannelToken = join === null || join === void 0 ? void 0 : (_join$locus2 = join.locus) === null || _join$locus2 === void 0 ? void 0 : (_join$locus2$self = _join$locus2.self) === null || _join$locus2$self === void 0 ? void 0 : _join$locus2$self.practiceSessionDatachannelToken;
6758
7035
  if (datachannelToken) {
6759
7036
  // @ts-ignore
6760
- this.webex.internal.llm.setDatachannelToken(datachannelToken, _internalPluginLlm.DataChannelTokenType.Default);
7037
+ this.webex.internal.llm.setDatachannelToken(datachannelToken, _constants.LLM_DEFAULT_SESSION, this.id);
6761
7038
  }
6762
7039
  if (practiceSessionDatachannelToken) {
6763
7040
  // @ts-ignore
6764
- this.webex.internal.llm.setDatachannelToken(practiceSessionDatachannelToken, _internalPluginLlm.DataChannelTokenType.PracticeSession);
7041
+ this.webex.internal.llm.setDatachannelToken(practiceSessionDatachannelToken, _constants.LLM_PRACTICE_SESSION, this.id);
6765
7042
  }
6766
7043
  }
6767
7044
 
@@ -6773,55 +7050,55 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6773
7050
  }, {
6774
7051
  key: "ensureDefaultDatachannelTokenAfterAdmit",
6775
7052
  value: (function () {
6776
- var _ensureDefaultDatachannelTokenAfterAdmit = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
6777
- var _response$body, datachannelToken, isDataChannelTokenEnabled, response, fetchedDatachannelToken, msg, _t12;
6778
- return _regenerator.default.wrap(function (_context19) {
6779
- while (1) switch (_context19.prev = _context19.next) {
7053
+ var _ensureDefaultDatachannelTokenAfterAdmit = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
7054
+ var _response$body, datachannelToken, isDataChannelTokenEnabled, response, fetchedDatachannelToken, msg, _t14;
7055
+ return _regenerator.default.wrap(function (_context21) {
7056
+ while (1) switch (_context21.prev = _context21.next) {
6780
7057
  case 0:
6781
- _context19.prev = 0;
7058
+ _context21.prev = 0;
6782
7059
  // @ts-ignore
6783
- datachannelToken = this.webex.internal.llm.getDatachannelToken(); // @ts-ignore
6784
- _context19.next = 1;
7060
+ datachannelToken = this.webex.internal.llm.getDatachannelToken(_constants.LLM_DEFAULT_SESSION, this.id); // @ts-ignore
7061
+ _context21.next = 1;
6785
7062
  return this.webex.internal.llm.isDataChannelTokenEnabled();
6786
7063
  case 1:
6787
- isDataChannelTokenEnabled = _context19.sent;
7064
+ isDataChannelTokenEnabled = _context21.sent;
6788
7065
  if (!(!isDataChannelTokenEnabled || datachannelToken)) {
6789
- _context19.next = 2;
7066
+ _context21.next = 2;
6790
7067
  break;
6791
7068
  }
6792
- return _context19.abrupt("return", false);
7069
+ return _context21.abrupt("return", false);
6793
7070
  case 2:
6794
- _context19.next = 3;
7071
+ _context21.next = 3;
6795
7072
  return this.meetingRequest.fetchDatachannelToken({
6796
7073
  locusUrl: this.locusUrl,
6797
7074
  requestingParticipantId: this.members.selfId,
6798
7075
  isPracticeSession: false
6799
7076
  });
6800
7077
  case 3:
6801
- response = _context19.sent;
7078
+ response = _context21.sent;
6802
7079
  fetchedDatachannelToken = response === null || response === void 0 ? void 0 : (_response$body = response.body) === null || _response$body === void 0 ? void 0 : _response$body.datachannelToken;
6803
7080
  if (fetchedDatachannelToken) {
6804
- _context19.next = 4;
7081
+ _context21.next = 4;
6805
7082
  break;
6806
7083
  }
6807
- return _context19.abrupt("return", false);
7084
+ return _context21.abrupt("return", false);
6808
7085
  case 4:
6809
7086
  // @ts-ignore
6810
- this.webex.internal.llm.setDatachannelToken(fetchedDatachannelToken, _internalPluginLlm.DataChannelTokenType.Default);
6811
- return _context19.abrupt("return", true);
7087
+ this.webex.internal.llm.setDatachannelToken(fetchedDatachannelToken, _constants.LLM_DEFAULT_SESSION, this.id);
7088
+ return _context21.abrupt("return", true);
6812
7089
  case 5:
6813
- _context19.prev = 5;
6814
- _t12 = _context19["catch"](0);
6815
- msg = (_t12 === null || _t12 === void 0 ? void 0 : _t12.message) || String(_t12);
7090
+ _context21.prev = 5;
7091
+ _t14 = _context21["catch"](0);
7092
+ msg = (_t14 === null || _t14 === void 0 ? void 0 : _t14.message) || String(_t14);
6816
7093
  _loggerProxy.default.logger.warn("Meeting:index#ensureDefaultDatachannelTokenAfterAdmit --> failed to proactively fetch default data channel token after admit: ".concat(msg), {
6817
- statusCode: _t12 === null || _t12 === void 0 ? void 0 : _t12.statusCode
7094
+ statusCode: _t14 === null || _t14 === void 0 ? void 0 : _t14.statusCode
6818
7095
  });
6819
- return _context19.abrupt("return", false);
7096
+ return _context21.abrupt("return", false);
6820
7097
  case 6:
6821
7098
  case "end":
6822
- return _context19.stop();
7099
+ return _context21.stop();
6823
7100
  }
6824
- }, _callee19, this, [[0, 5]]);
7101
+ }, _callee21, this, [[0, 5]]);
6825
7102
  }));
6826
7103
  function ensureDefaultDatachannelTokenAfterAdmit() {
6827
7104
  return _ensureDefaultDatachannelTokenAfterAdmit.apply(this, arguments);
@@ -6837,43 +7114,120 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6837
7114
  }, {
6838
7115
  key: "updateLLMConnection",
6839
7116
  value: (function () {
6840
- var _updateLLMConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
7117
+ var _updateLLMConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
6841
7118
  var _this36 = this;
6842
- var _ref39, _ref39$url, url, _ref39$info, _ref39$info2, _ref39$info2$datachan, datachannelUrl, isJoined, datachannelToken, dataChannelUrl;
6843
- return _regenerator.default.wrap(function (_context20) {
6844
- while (1) switch (_context20.prev = _context20.next) {
7119
+ var _ref40, _ref40$url, url, _ref40$info, _ref40$info2, _ref40$info2$datachan, datachannelUrl, isJoined, dataChannelUrl, _this$webex$internal$7, currentOwner, wasConnected, datachannelToken, refreshHandlerOwnerMeetingId, shouldAlignRefreshHandlerAfterOwnershipClaim;
7120
+ return _regenerator.default.wrap(function (_context22) {
7121
+ while (1) switch (_context22.prev = _context22.next) {
6845
7122
  case 0:
6846
7123
  // @ts-ignore - Fix type
6847
- _ref39 = this.locusInfo || {}, _ref39$url = _ref39.url, url = _ref39$url === void 0 ? undefined : _ref39$url, _ref39$info = _ref39.info, _ref39$info2 = _ref39$info === void 0 ? {} : _ref39$info, _ref39$info2$datachan = _ref39$info2.datachannelUrl, datachannelUrl = _ref39$info2$datachan === void 0 ? undefined : _ref39$info2$datachan;
6848
- isJoined = this.isJoined(); // @ts-ignore
6849
- datachannelToken = this.webex.internal.llm.getDatachannelToken(_internalPluginLlm.DataChannelTokenType.Default);
6850
- dataChannelUrl = datachannelUrl; // @ts-ignore - Fix type
6851
- if (!this.webex.internal.llm.isConnected()) {
6852
- _context20.next = 2;
7124
+ _ref40 = this.locusInfo || {}, _ref40$url = _ref40.url, url = _ref40$url === void 0 ? undefined : _ref40$url, _ref40$info = _ref40.info, _ref40$info2 = _ref40$info === void 0 ? {} : _ref40$info, _ref40$info2$datachan = _ref40$info2.datachannelUrl, datachannelUrl = _ref40$info2$datachan === void 0 ? undefined : _ref40$info2$datachan;
7125
+ isJoined = this.isJoined();
7126
+ dataChannelUrl = datachannelUrl; // Ownership guard: when the default LLM session is already connected and
7127
+ // owned by a *different* Meeting instance, do not disconnect or reconfigure
7128
+ // it. Another meeting's `updateLLMConnection` must be ignored here to
7129
+ // avoid killing the socket it relies on. We only proceed to manage the
7130
+ // connection when this meeting is the current owner, or when no owner is
7131
+ // set yet (first claim).
7132
+ // @ts-ignore - Fix type
7133
+ _this$webex$internal$7 = this.webex.internal.llm.resolveSessionOwnership(this.id, _constants.LLM_DEFAULT_SESSION), currentOwner = _this$webex$internal$7.currentOwner; // Capture connectivity before any reconnect attempt. If LLM was already
7134
+ // connected, we must respect current ownership. If it was disconnected,
7135
+ // this flow may reclaim stale owner tags after a fresh connect.
7136
+ // @ts-ignore - Fix type
7137
+ wasConnected = this.webex.internal.llm.isConnected(); // Prefer ownership-scoped token read. For disconnected stale-owner reclaim
7138
+ // flows, fallback to ownerless read so initial register can still carry a
7139
+ // token and recover from stale ownership without 401/403 dead-end.
7140
+ // @ts-ignore - Fix type
7141
+ datachannelToken = this.webex.internal.llm.getDatachannelToken(_constants.LLM_DEFAULT_SESSION, this.id);
7142
+ if (!datachannelToken && !wasConnected && currentOwner && currentOwner !== this.id) {
7143
+ // @ts-ignore - Fix type
7144
+ datachannelToken = this.webex.internal.llm.getDatachannelToken(_constants.LLM_DEFAULT_SESSION);
7145
+ }
7146
+
7147
+ // @ts-ignore - Fix type
7148
+ if (!wasConnected) {
7149
+ _context22.next = 3;
7150
+ break;
7151
+ }
7152
+ if (!(currentOwner && currentOwner !== this.id)) {
7153
+ _context22.next = 1;
6853
7154
  break;
6854
7155
  }
7156
+ // Another meeting owns the live LLM socket. We must not disconnect
7157
+ // or reconfigure it -- doing so would tear down a session the
7158
+ // owning meeting still relies on. Locus/datachannel URL mismatch is
7159
+ // expected here (each meeting has its own locus URL) and is NOT a
7160
+ // valid signal of staleness, so we never reclaim from this path.
7161
+ // The only safe reclaim mechanism is the `finally`-block owner-tag
7162
+ // release in `cleanupLLMConneciton`, which fires when this meeting
7163
+ // itself is being torn down.
7164
+ _loggerProxy.default.logger.info("Meeting:index#updateLLMConnection --> skipping; LLM owned by meeting ".concat(currentOwner, ", not ").concat(this.id));
7165
+ return _context22.abrupt("return", undefined);
7166
+ case 1:
6855
7167
  if (!(
6856
7168
  // @ts-ignore - Fix type
6857
7169
  url === this.webex.internal.llm.getLocusUrl() &&
6858
7170
  // @ts-ignore - Fix type
6859
7171
  dataChannelUrl === this.webex.internal.llm.getDatachannelUrl() && isJoined)) {
6860
- _context20.next = 1;
7172
+ _context22.next = 2;
6861
7173
  break;
6862
7174
  }
6863
- return _context20.abrupt("return", undefined);
6864
- case 1:
6865
- _context20.next = 2;
7175
+ return _context22.abrupt("return", undefined);
7176
+ case 2:
7177
+ _context22.next = 3;
6866
7178
  return this.cleanupLLMConneciton({
6867
7179
  removeOnlineListener: false
6868
7180
  });
6869
- case 2:
7181
+ case 3:
6870
7182
  if (isJoined) {
6871
- _context20.next = 3;
7183
+ _context22.next = 4;
6872
7184
  break;
6873
7185
  }
6874
- return _context20.abrupt("return", undefined);
6875
- case 3:
6876
- return _context20.abrupt("return", this.webex.internal.llm.registerAndConnect(url, dataChannelUrl, datachannelToken).then(function (registerAndConnectResult) {
7186
+ return _context22.abrupt("return", undefined);
7187
+ case 4:
7188
+ // Bind refresh handler before registration so interceptor-triggered token
7189
+ // refresh during register POST can resolve a valid handler.
7190
+ // Prefer this meeting as owner, but allow owner-less fallback when a stale
7191
+ // foreign owner tag is present on a disconnected session.
7192
+ refreshHandlerOwnerMeetingId = currentOwner && currentOwner !== this.id ? undefined : this.id;
7193
+ shouldAlignRefreshHandlerAfterOwnershipClaim = refreshHandlerOwnerMeetingId !== this.id; // @ts-ignore - Fix type
7194
+ this.webex.internal.llm.setRefreshHandler(function () {
7195
+ return _this36.refreshDataChannelToken();
7196
+ }, _constants.LLM_DEFAULT_SESSION, refreshHandlerOwnerMeetingId);
7197
+
7198
+ // @ts-ignore - Fix type
7199
+ return _context22.abrupt("return", this.webex.internal.llm.registerAndConnect(url, dataChannelUrl, datachannelToken).then(function (registerAndConnectResult) {
7200
+ _this36.locusInfo.syncAllHashTreeDatasets({
7201
+ onlyLLM: true
7202
+ });
7203
+ // Record ownership of the default LLM session for this meeting so
7204
+ // subsequent cross-meeting `updateLLMConnection` / `cleanupLLMConneciton`
7205
+ // calls can detect and skip work that doesn't belong to them.
7206
+ // @ts-ignore - Fix type
7207
+ var _this36$webex$interna = _this36.webex.internal.llm.resolveSessionOwnership(_this36.id, _constants.LLM_DEFAULT_SESSION),
7208
+ isOwner = _this36$webex$interna.isOwner;
7209
+ var canReclaimAfterDisconnectedStart = !wasConnected;
7210
+
7211
+ // Refresh handler is pre-bound before registerAndConnect so token
7212
+ // refresh can work even during the registration request itself.
7213
+ if (isOwner || canReclaimAfterDisconnectedStart) {
7214
+ var _this36$webex$interna2, _this36$webex$interna3;
7215
+ // Record ownership of the default LLM session for this meeting so
7216
+ // subsequent cross-meeting `updateLLMConnection` / `cleanupLLMConneciton`
7217
+ // calls can detect and skip work that doesn't belong to them.
7218
+ // @ts-ignore - Fix type
7219
+ (_this36$webex$interna2 = (_this36$webex$interna3 = _this36.webex.internal.llm).setOwnerMeetingId) === null || _this36$webex$interna2 === void 0 ? void 0 : _this36$webex$interna2.call(_this36$webex$interna3, _this36.id);
7220
+
7221
+ // If we pre-bound refresh ownerlessly (stale-owner reclaim path),
7222
+ // align the handler with the newly claimed owner immediately after
7223
+ // ownership is updated.
7224
+ if (shouldAlignRefreshHandlerAfterOwnershipClaim) {
7225
+ // @ts-ignore - Fix type
7226
+ _this36.webex.internal.llm.setRefreshHandler(function () {
7227
+ return _this36.refreshDataChannelToken();
7228
+ }, _constants.LLM_DEFAULT_SESSION, _this36.id);
7229
+ }
7230
+ }
6877
7231
  // @ts-ignore - Fix type
6878
7232
  _this36.webex.internal.llm.off('event:relay.event', _this36.processRelayEvent);
6879
7233
  // @ts-ignore - Fix type
@@ -6886,11 +7240,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6886
7240
  _this36.startLLMHealthCheckTimer();
6887
7241
  return _promise.default.resolve(registerAndConnectResult);
6888
7242
  }));
6889
- case 4:
7243
+ case 5:
6890
7244
  case "end":
6891
- return _context20.stop();
7245
+ return _context22.stop();
6892
7246
  }
6893
- }, _callee20, this);
7247
+ }, _callee22, this);
6894
7248
  }));
6895
7249
  function updateLLMConnection() {
6896
7250
  return _updateLLMConnection.apply(this, arguments);
@@ -7076,17 +7430,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7076
7430
  meetingId: this.id
7077
7431
  }
7078
7432
  });
7079
- this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
7080
- var mediaSettings, _t13;
7081
- return _regenerator.default.wrap(function (_context21) {
7082
- while (1) switch (_context21.prev = _context21.next) {
7433
+ this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
7434
+ var mediaSettings, _t15;
7435
+ return _regenerator.default.wrap(function (_context23) {
7436
+ while (1) switch (_context23.prev = _context23.next) {
7083
7437
  case 0:
7084
- _context21.prev = 0;
7438
+ _context23.prev = 0;
7085
7439
  if (!(_this40.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
7086
- _context21.next = 1;
7440
+ _context23.next = 1;
7087
7441
  break;
7088
7442
  }
7089
- _context21.next = 1;
7443
+ _context23.next = 1;
7090
7444
  return _this40.releaseScreenShareFloor();
7091
7445
  case 1:
7092
7446
  mediaSettings = {
@@ -7105,23 +7459,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7105
7459
  // when a move to is intiated by the client , Locus delets the existing media node from the server as soon the device answers the meeting
7106
7460
  // once the device answers we close the old connection and create new media server connection with only share enabled
7107
7461
  if (!_this40.statsAnalyzer) {
7108
- _context21.next = 2;
7462
+ _context23.next = 2;
7109
7463
  break;
7110
7464
  }
7111
- _context21.next = 2;
7465
+ _context23.next = 2;
7112
7466
  return _this40.statsAnalyzer.stopAnalyzer();
7113
7467
  case 2:
7114
- _context21.next = 3;
7468
+ _context23.next = 3;
7115
7469
  return _this40.closeRemoteStreams();
7116
7470
  case 3:
7117
- _context21.next = 4;
7471
+ _context23.next = 4;
7118
7472
  return _this40.closePeerConnections();
7119
7473
  case 4:
7120
7474
  _this40.cleanupLocalStreams();
7121
7475
  _this40.unsetRemoteStreams();
7122
7476
  _this40.unsetPeerConnections();
7123
7477
  _this40.reconnectionManager.cleanUp();
7124
- _context21.next = 5;
7478
+ _context23.next = 5;
7125
7479
  return _this40.addMedia({
7126
7480
  audioEnabled: false,
7127
7481
  videoEnabled: false,
@@ -7130,24 +7484,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7130
7484
  case 5:
7131
7485
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_SUCCESS);
7132
7486
  _this40.isMoveToInProgress = false;
7133
- _context21.next = 7;
7487
+ _context23.next = 7;
7134
7488
  break;
7135
7489
  case 6:
7136
- _context21.prev = 6;
7137
- _t13 = _context21["catch"](0);
7138
- _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _t13);
7490
+ _context23.prev = 6;
7491
+ _t15 = _context23["catch"](0);
7492
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _t15);
7139
7493
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
7140
7494
  correlation_id: _this40.correlationId,
7141
7495
  locus_id: _this40.locusUrl.split('/').pop(),
7142
- reason: _t13.message,
7143
- stack: _t13.stack
7496
+ reason: _t15.message,
7497
+ stack: _t15.stack
7144
7498
  });
7145
7499
  _this40.isMoveToInProgress = false;
7146
7500
  case 7:
7147
7501
  case "end":
7148
- return _context21.stop();
7502
+ return _context23.stop();
7149
7503
  }
7150
- }, _callee21, null, [[0, 6]]);
7504
+ }, _callee23, null, [[0, 6]]);
7151
7505
  })));
7152
7506
  _loggerProxy.default.logger.info('Meeting:index#moveTo --> Initated moved to using resourceId', resourceId);
7153
7507
 
@@ -7235,10 +7589,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7235
7589
  }, {
7236
7590
  key: "createMediaConnection",
7237
7591
  value: (function () {
7238
- var _createMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22(turnServerInfo, bundlePolicy) {
7592
+ var _createMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24(turnServerInfo, bundlePolicy) {
7239
7593
  var mc, audioEnabled, videoEnabled, shareEnabled;
7240
- return _regenerator.default.wrap(function (_context22) {
7241
- while (1) switch (_context22.prev = _context22.next) {
7594
+ return _regenerator.default.wrap(function (_context24) {
7595
+ while (1) switch (_context24.prev = _context24.next) {
7242
7596
  case 0:
7243
7597
  this.rtcMetrics = this.isMultistream ?
7244
7598
  // @ts-ignore
@@ -7264,6 +7618,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7264
7618
  disableAudioMainDtx: this.config.experimental.disableAudioMainDtx,
7265
7619
  // @ts-ignore - config coming from registerPlugin
7266
7620
  enableAudioTwcc: this.config.enableAudioTwccForMultistream,
7621
+ // @ts-ignore - config coming from registerPlugin
7622
+ enableAv1SlidesSupport: this.config.enableAv1SlidesSupport,
7267
7623
  stopIceGatheringAfterFirstRelayCandidate:
7268
7624
  // @ts-ignore - config coming from registerPlugin
7269
7625
  this.config.stopIceGatheringAfterFirstRelayCandidate
@@ -7280,42 +7636,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7280
7636
 
7281
7637
  // publish the streams
7282
7638
  if (!this.mediaProperties.audioStream) {
7283
- _context22.next = 1;
7639
+ _context24.next = 1;
7284
7640
  break;
7285
7641
  }
7286
7642
  this.setSendNamedMediaGroup(_internalMediaCore.MediaType.AudioMain);
7287
- _context22.next = 1;
7643
+ _context24.next = 1;
7288
7644
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
7289
7645
  case 1:
7290
7646
  if (!this.mediaProperties.videoStream) {
7291
- _context22.next = 2;
7647
+ _context24.next = 2;
7292
7648
  break;
7293
7649
  }
7294
- _context22.next = 2;
7650
+ _context24.next = 2;
7295
7651
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
7296
7652
  case 2:
7297
7653
  if (!this.mediaProperties.shareVideoStream) {
7298
- _context22.next = 3;
7654
+ _context24.next = 3;
7299
7655
  break;
7300
7656
  }
7301
- _context22.next = 3;
7657
+ _context24.next = 3;
7302
7658
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
7303
7659
  case 3:
7304
7660
  if (!(this.isMultistream && this.mediaProperties.shareAudioStream)) {
7305
- _context22.next = 4;
7661
+ _context24.next = 4;
7306
7662
  break;
7307
7663
  }
7308
- _context22.next = 4;
7664
+ _context24.next = 4;
7309
7665
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
7310
7666
  case 4:
7311
- return _context22.abrupt("return", mc);
7667
+ return _context24.abrupt("return", mc);
7312
7668
  case 5:
7313
7669
  case "end":
7314
- return _context22.stop();
7670
+ return _context24.stop();
7315
7671
  }
7316
- }, _callee22, this);
7672
+ }, _callee24, this);
7317
7673
  }));
7318
- function createMediaConnection(_x14, _x15) {
7674
+ function createMediaConnection(_x16, _x17) {
7319
7675
  return _createMediaConnection.apply(this, arguments);
7320
7676
  }
7321
7677
  return createMediaConnection;
@@ -7353,11 +7709,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7353
7709
  }, {
7354
7710
  key: "setUpLocalStreamReferences",
7355
7711
  value: (function () {
7356
- var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23(localStreams) {
7712
+ var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25(localStreams) {
7357
7713
  var _localStreams$microph, _localStreams$camera, _localStreams$screenS, _localStreams$screenS2, _localStreams$screenS3, _localStreams$screenS4, _localStreams$screenS5, _localStreams$screenS6;
7358
- var setUpStreamPromises, _t14;
7359
- return _regenerator.default.wrap(function (_context23) {
7360
- while (1) switch (_context23.prev = _context23.next) {
7714
+ var setUpStreamPromises, _t16;
7715
+ return _regenerator.default.wrap(function (_context25) {
7716
+ while (1) switch (_context25.prev = _context25.next) {
7361
7717
  case 0:
7362
7718
  setUpStreamPromises = [];
7363
7719
  if (localStreams !== null && localStreams !== void 0 && localStreams.microphone && (localStreams === null || localStreams === void 0 ? void 0 : (_localStreams$microph = localStreams.microphone) === null || _localStreams$microph === void 0 ? void 0 : _localStreams$microph.readyState) !== 'ended') {
@@ -7372,24 +7728,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7372
7728
  if (localStreams !== null && localStreams !== void 0 && (_localStreams$screenS4 = localStreams.screenShare) !== null && _localStreams$screenS4 !== void 0 && _localStreams$screenS4.audio && (localStreams === null || localStreams === void 0 ? void 0 : (_localStreams$screenS5 = localStreams.screenShare) === null || _localStreams$screenS5 === void 0 ? void 0 : (_localStreams$screenS6 = _localStreams$screenS5.audio) === null || _localStreams$screenS6 === void 0 ? void 0 : _localStreams$screenS6.readyState) !== 'ended') {
7373
7729
  setUpStreamPromises.push(this.setLocalShareAudioStream(localStreams.screenShare.audio));
7374
7730
  }
7375
- _context23.prev = 1;
7376
- _context23.next = 2;
7731
+ _context25.prev = 1;
7732
+ _context25.next = 2;
7377
7733
  return _promise.default.all(setUpStreamPromises);
7378
7734
  case 2:
7379
- _context23.next = 4;
7735
+ _context25.next = 4;
7380
7736
  break;
7381
7737
  case 3:
7382
- _context23.prev = 3;
7383
- _t14 = _context23["catch"](1);
7384
- _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _t14);
7385
- throw _t14;
7738
+ _context25.prev = 3;
7739
+ _t16 = _context25["catch"](1);
7740
+ _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _t16);
7741
+ throw _t16;
7386
7742
  case 4:
7387
7743
  case "end":
7388
- return _context23.stop();
7744
+ return _context25.stop();
7389
7745
  }
7390
- }, _callee23, this, [[1, 3]]);
7746
+ }, _callee25, this, [[1, 3]]);
7391
7747
  }));
7392
- function setUpLocalStreamReferences(_x16) {
7748
+ function setUpLocalStreamReferences(_x18) {
7393
7749
  return _setUpLocalStreamReferences.apply(this, arguments);
7394
7750
  }
7395
7751
  return setUpLocalStreamReferences;
@@ -7404,72 +7760,72 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7404
7760
  }, {
7405
7761
  key: "waitForMediaConnectionConnected",
7406
7762
  value: (function () {
7407
- var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
7408
- var iceConnected, _this$mediaProperties9, _this$mediaProperties0, _this$mediaProperties1, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, timedOutError, _t15, _t16, _t17, _t18, _t19, _t20, _t21, _t22, _t23, _t24, _t25, _t26, _t27, _t28, _t29;
7409
- return _regenerator.default.wrap(function (_context24) {
7410
- while (1) switch (_context24.prev = _context24.next) {
7763
+ var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
7764
+ var iceConnected, _this$mediaProperties9, _this$mediaProperties0, _this$mediaProperties1, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, timedOutError, _t17, _t18, _t19, _t20, _t21, _t22, _t23, _t24, _t25, _t26, _t27, _t28, _t29, _t30, _t31;
7765
+ return _regenerator.default.wrap(function (_context26) {
7766
+ while (1) switch (_context26.prev = _context26.next) {
7411
7767
  case 0:
7412
- _context24.prev = 0;
7413
- _context24.next = 1;
7768
+ _context26.prev = 0;
7769
+ _context26.next = 1;
7414
7770
  return this.mediaProperties.waitForMediaConnectionConnected(this.correlationId);
7415
7771
  case 1:
7416
- _context24.next = 5;
7772
+ _context26.next = 5;
7417
7773
  break;
7418
7774
  case 2:
7419
- _context24.prev = 2;
7420
- _t15 = _context24["catch"](0);
7421
- iceConnected = _t15.iceConnected;
7775
+ _context26.prev = 2;
7776
+ _t17 = _context26["catch"](0);
7777
+ iceConnected = _t17.iceConnected;
7422
7778
  if (this.hasMediaConnectionConnectedAtLeastOnce) {
7423
- _context24.next = 4;
7779
+ _context26.next = 4;
7424
7780
  break;
7425
7781
  }
7426
- _t16 = this.webex.internal.newMetrics;
7427
- _t17 = !this.turnServerUsed;
7428
- _t18 = this.addMediaData.icePhaseCallback();
7429
- _t19 = this.webex.internal.newMetrics.callDiagnosticMetrics;
7430
- _t20 = _internalPluginMetrics.CallDiagnosticUtils;
7431
- _t21 = ((_this$mediaProperties9 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties9 === void 0 ? void 0 : (_this$mediaProperties0 = _this$mediaProperties9.multistreamConnection) === null || _this$mediaProperties0 === void 0 ? void 0 : (_this$mediaProperties1 = _this$mediaProperties0.pc) === null || _this$mediaProperties1 === void 0 ? void 0 : (_this$mediaProperties10 = _this$mediaProperties1.pc) === null || _this$mediaProperties10 === void 0 ? void 0 : _this$mediaProperties10.signalingState) || ((_this$mediaProperties11 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.mediaConnection) === null || _this$mediaProperties12 === void 0 ? void 0 : (_this$mediaProperties13 = _this$mediaProperties12.pc) === null || _this$mediaProperties13 === void 0 ? void 0 : _this$mediaProperties13.signalingState) || 'unknown';
7432
- _t22 = iceConnected;
7433
- _t23 = this.turnServerUsed;
7434
- _context24.next = 3;
7782
+ _t18 = this.webex.internal.newMetrics;
7783
+ _t19 = !this.turnServerUsed;
7784
+ _t20 = this.addMediaData.icePhaseCallback();
7785
+ _t21 = this.webex.internal.newMetrics.callDiagnosticMetrics;
7786
+ _t22 = _internalPluginMetrics.CallDiagnosticUtils;
7787
+ _t23 = ((_this$mediaProperties9 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties9 === void 0 ? void 0 : (_this$mediaProperties0 = _this$mediaProperties9.multistreamConnection) === null || _this$mediaProperties0 === void 0 ? void 0 : (_this$mediaProperties1 = _this$mediaProperties0.pc) === null || _this$mediaProperties1 === void 0 ? void 0 : (_this$mediaProperties10 = _this$mediaProperties1.pc) === null || _this$mediaProperties10 === void 0 ? void 0 : _this$mediaProperties10.signalingState) || ((_this$mediaProperties11 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.mediaConnection) === null || _this$mediaProperties12 === void 0 ? void 0 : (_this$mediaProperties13 = _this$mediaProperties12.pc) === null || _this$mediaProperties13 === void 0 ? void 0 : _this$mediaProperties13.signalingState) || 'unknown';
7788
+ _t24 = iceConnected;
7789
+ _t25 = this.turnServerUsed;
7790
+ _context26.next = 3;
7435
7791
  return this.webex.meetings.reachability.isWebexMediaBackendUnreachable().catch(function () {
7436
7792
  return false;
7437
7793
  });
7438
7794
  case 3:
7439
- _t24 = _context24.sent;
7440
- _t25 = _t20.generateClientErrorCodeForIceFailure.call(_t20, {
7441
- signalingState: _t21,
7442
- iceConnected: _t22,
7443
- turnServerUsed: _t23,
7444
- unreachable: _t24
7795
+ _t26 = _context26.sent;
7796
+ _t27 = _t22.generateClientErrorCodeForIceFailure.call(_t22, {
7797
+ signalingState: _t23,
7798
+ iceConnected: _t24,
7799
+ turnServerUsed: _t25,
7800
+ unreachable: _t26
7445
7801
  });
7446
- _t26 = _t19.getErrorPayloadForClientErrorCode.call(_t19, {
7447
- clientErrorCode: _t25
7802
+ _t28 = _t21.getErrorPayloadForClientErrorCode.call(_t21, {
7803
+ clientErrorCode: _t27
7448
7804
  });
7449
- _t27 = [_t26];
7450
- _t28 = {
7451
- canProceed: _t17,
7452
- icePhase: _t18,
7453
- errors: _t27
7805
+ _t29 = [_t28];
7806
+ _t30 = {
7807
+ canProceed: _t19,
7808
+ icePhase: _t20,
7809
+ errors: _t29
7454
7810
  };
7455
- _t29 = {
7811
+ _t31 = {
7456
7812
  meetingId: this.id,
7457
- rawError: _t15
7813
+ rawError: _t17
7458
7814
  };
7459
- _t16.submitClientEvent.call(_t16, {
7815
+ _t18.submitClientEvent.call(_t18, {
7460
7816
  name: 'client.ice.end',
7461
- payload: _t28,
7462
- options: _t29
7817
+ payload: _t30,
7818
+ options: _t31
7463
7819
  });
7464
7820
  case 4:
7465
7821
  timedOutError = new Error("Timed out waiting for media connection to be connected, correlationId=".concat(this.correlationId));
7466
- timedOutError.cause = _t15;
7822
+ timedOutError.cause = _t17;
7467
7823
  throw timedOutError;
7468
7824
  case 5:
7469
7825
  case "end":
7470
- return _context24.stop();
7826
+ return _context26.stop();
7471
7827
  }
7472
- }, _callee24, this, [[0, 2]]);
7828
+ }, _callee26, this, [[0, 2]]);
7473
7829
  }));
7474
7830
  function waitForMediaConnectionConnected() {
7475
7831
  return _waitForMediaConnectionConnected.apply(this, arguments);
@@ -7536,19 +7892,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7536
7892
  }, {
7537
7893
  key: "waitForRemoteSDPAnswer",
7538
7894
  value: (function () {
7539
- var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
7895
+ var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
7540
7896
  var _this44 = this;
7541
7897
  var LOG_HEADER, deferSDPAnswer;
7542
- return _regenerator.default.wrap(function (_context25) {
7543
- while (1) switch (_context25.prev = _context25.next) {
7898
+ return _regenerator.default.wrap(function (_context27) {
7899
+ while (1) switch (_context27.prev = _context27.next) {
7544
7900
  case 0:
7545
7901
  LOG_HEADER = 'Meeting:index#addMedia():waitForRemoteSDPAnswer -->';
7546
7902
  if (this.deferSDPAnswer) {
7547
- _context25.next = 1;
7903
+ _context27.next = 1;
7548
7904
  break;
7549
7905
  }
7550
7906
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " offer not created yet"));
7551
- return _context25.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
7907
+ return _context27.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
7552
7908
  case 1:
7553
7909
  deferSDPAnswer = this.deferSDPAnswer;
7554
7910
  this.sdpResponseTimer = setTimeout(function () {
@@ -7574,12 +7930,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7574
7930
  deferSDPAnswer.reject(error);
7575
7931
  }, _constants.ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT);
7576
7932
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " waiting for REMOTE SDP ANSWER..."));
7577
- return _context25.abrupt("return", deferSDPAnswer.promise);
7933
+ return _context27.abrupt("return", deferSDPAnswer.promise);
7578
7934
  case 2:
7579
7935
  case "end":
7580
- return _context25.stop();
7936
+ return _context27.stop();
7581
7937
  }
7582
- }, _callee25, this);
7938
+ }, _callee27, this);
7583
7939
  }));
7584
7940
  function waitForRemoteSDPAnswer() {
7585
7941
  return _waitForRemoteSDPAnswer.apply(this, arguments);
@@ -7598,30 +7954,30 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7598
7954
  }, {
7599
7955
  key: "retryEstablishMediaConnectionWithForcedTurnDiscovery",
7600
7956
  value: (function () {
7601
- var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26(remoteMediaManagerConfig, bundlePolicy) {
7602
- var LOG_HEADER, _t30;
7603
- return _regenerator.default.wrap(function (_context26) {
7604
- while (1) switch (_context26.prev = _context26.next) {
7957
+ var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28(remoteMediaManagerConfig, bundlePolicy) {
7958
+ var LOG_HEADER, _t32;
7959
+ return _regenerator.default.wrap(function (_context28) {
7960
+ while (1) switch (_context28.prev = _context28.next) {
7605
7961
  case 0:
7606
7962
  LOG_HEADER = 'Meeting:index#addMedia():retryEstablishMediaConnectionWithForcedTurnDiscovery -->';
7607
- _context26.prev = 1;
7608
- _context26.next = 2;
7963
+ _context28.prev = 1;
7964
+ _context28.next = 2;
7609
7965
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true);
7610
7966
  case 2:
7611
- _context26.next = 4;
7967
+ _context28.next = 4;
7612
7968
  break;
7613
7969
  case 3:
7614
- _context26.prev = 3;
7615
- _t30 = _context26["catch"](1);
7616
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _t30);
7617
- throw _t30;
7970
+ _context28.prev = 3;
7971
+ _t32 = _context28["catch"](1);
7972
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _t32);
7973
+ throw _t32;
7618
7974
  case 4:
7619
7975
  case "end":
7620
- return _context26.stop();
7976
+ return _context28.stop();
7621
7977
  }
7622
- }, _callee26, this, [[1, 3]]);
7978
+ }, _callee28, this, [[1, 3]]);
7623
7979
  }));
7624
- function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x17, _x18) {
7980
+ function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x19, _x20) {
7625
7981
  return _retryEstablishMediaConnectionWithForcedTurnDiscovery.apply(this, arguments);
7626
7982
  }
7627
7983
  return retryEstablishMediaConnectionWithForcedTurnDiscovery;
@@ -7639,14 +7995,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7639
7995
  }, {
7640
7996
  key: "retryWithForcedTurnDiscovery",
7641
7997
  value: (function () {
7642
- var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27(remoteMediaManagerConfig, bundlePolicy) {
7998
+ var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(remoteMediaManagerConfig, bundlePolicy) {
7643
7999
  var LOG_HEADER;
7644
- return _regenerator.default.wrap(function (_context27) {
7645
- while (1) switch (_context27.prev = _context27.next) {
8000
+ return _regenerator.default.wrap(function (_context29) {
8001
+ while (1) switch (_context29.prev = _context29.next) {
7646
8002
  case 0:
7647
8003
  this.addMediaData.retriedWithTurnServer = true;
7648
8004
  LOG_HEADER = 'Meeting:index#addMedia():retryWithForcedTurnDiscovery -->';
7649
- _context27.next = 1;
8005
+ _context29.next = 1;
7650
8006
  return this.cleanUpBeforeRetryWithTurnServer();
7651
8007
  case 1:
7652
8008
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_RETRY, {
@@ -7656,24 +8012,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7656
8012
  reason: 'forcingTurnTls'
7657
8013
  });
7658
8014
  if (!(this.state === _constants.MEETING_STATE.STATES.LEFT)) {
7659
- _context27.next = 2;
8015
+ _context29.next = 2;
7660
8016
  break;
7661
8017
  }
7662
8018
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " meeting state was LEFT after first attempt to establish media connection. Attempting to rejoin. "));
7663
- _context27.next = 2;
8019
+ _context29.next = 2;
7664
8020
  return this.join({
7665
8021
  rejoin: true
7666
8022
  });
7667
8023
  case 2:
7668
- _context27.next = 3;
8024
+ _context29.next = 3;
7669
8025
  return this.retryEstablishMediaConnectionWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
7670
8026
  case 3:
7671
8027
  case "end":
7672
- return _context27.stop();
8028
+ return _context29.stop();
7673
8029
  }
7674
- }, _callee27, this);
8030
+ }, _callee29, this);
7675
8031
  }));
7676
- function retryWithForcedTurnDiscovery(_x19, _x20) {
8032
+ function retryWithForcedTurnDiscovery(_x21, _x22) {
7677
8033
  return _retryWithForcedTurnDiscovery.apply(this, arguments);
7678
8034
  }
7679
8035
  return retryWithForcedTurnDiscovery;
@@ -7693,32 +8049,32 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7693
8049
  }, {
7694
8050
  key: "handleWaitForMediaConnectionConnectedError",
7695
8051
  value: (function () {
7696
- var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28(error, remoteMediaManagerConfig, bundlePolicy) {
8052
+ var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30(error, remoteMediaManagerConfig, bundlePolicy) {
7697
8053
  var LOG_HEADER;
7698
- return _regenerator.default.wrap(function (_context28) {
7699
- while (1) switch (_context28.prev = _context28.next) {
8054
+ return _regenerator.default.wrap(function (_context30) {
8055
+ while (1) switch (_context30.prev = _context30.next) {
7700
8056
  case 0:
7701
8057
  LOG_HEADER = 'Meeting:index#addMedia():handleWaitForMediaConnectionConnectedError -->'; // @ts-ignore - config coming from registerPlugin
7702
8058
  if (this.turnServerUsed) {
7703
- _context28.next = 2;
8059
+ _context30.next = 2;
7704
8060
  break;
7705
8061
  }
7706
8062
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " error waiting for media to connect on UDP, TCP, retrying using TURN-TLS, "), error);
7707
- _context28.next = 1;
8063
+ _context30.next = 1;
7708
8064
  return this.retryWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
7709
8065
  case 1:
7710
- _context28.next = 3;
8066
+ _context30.next = 3;
7711
8067
  break;
7712
8068
  case 2:
7713
8069
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error waiting for media to connect using UDP, TCP and TURN-TLS"), error);
7714
8070
  throw new _webexErrors.AddMediaFailed(error);
7715
8071
  case 3:
7716
8072
  case "end":
7717
- return _context28.stop();
8073
+ return _context30.stop();
7718
8074
  }
7719
- }, _callee28, this);
8075
+ }, _callee30, this);
7720
8076
  }));
7721
- function handleWaitForMediaConnectionConnectedError(_x21, _x22, _x23) {
8077
+ function handleWaitForMediaConnectionConnectedError(_x23, _x24, _x25) {
7722
8078
  return _handleWaitForMediaConnectionConnectedError.apply(this, arguments);
7723
8079
  }
7724
8080
  return handleWaitForMediaConnectionConnectedError;
@@ -7734,20 +8090,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7734
8090
  }, {
7735
8091
  key: "doTurnDiscovery",
7736
8092
  value: (function () {
7737
- var _doTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(isReconnecting, isForced) {
8093
+ var _doTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31(isReconnecting, isForced) {
7738
8094
  var cdl, turnDiscoveryResult;
7739
- return _regenerator.default.wrap(function (_context29) {
7740
- while (1) switch (_context29.prev = _context29.next) {
8095
+ return _regenerator.default.wrap(function (_context31) {
8096
+ while (1) switch (_context31.prev = _context31.next) {
7741
8097
  case 0:
7742
8098
  // @ts-ignore
7743
8099
  cdl = this.webex.internal.newMetrics.callDiagnosticLatencies; // @ts-ignore
7744
8100
  this.webex.internal.newMetrics.submitInternalEvent({
7745
8101
  name: 'internal.client.add-media.turn-discovery.start'
7746
8102
  });
7747
- _context29.next = 1;
8103
+ _context31.next = 1;
7748
8104
  return this.roap.doTurnDiscovery(this, isReconnecting, isForced);
7749
8105
  case 1:
7750
- turnDiscoveryResult = _context29.sent;
8106
+ turnDiscoveryResult = _context31.sent;
7751
8107
  this.turnDiscoverySkippedReason = turnDiscoveryResult === null || turnDiscoveryResult === void 0 ? void 0 : turnDiscoveryResult.turnDiscoverySkippedReason;
7752
8108
  this.turnServerUsed = !this.turnDiscoverySkippedReason;
7753
8109
 
@@ -7763,14 +8119,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7763
8119
  retriedWithTurnServer: this.addMediaData.retriedWithTurnServer
7764
8120
  });
7765
8121
  }
7766
- return _context29.abrupt("return", turnDiscoveryResult);
8122
+ return _context31.abrupt("return", turnDiscoveryResult);
7767
8123
  case 2:
7768
8124
  case "end":
7769
- return _context29.stop();
8125
+ return _context31.stop();
7770
8126
  }
7771
- }, _callee29, this);
8127
+ }, _callee31, this);
7772
8128
  }));
7773
- function doTurnDiscovery(_x24, _x25) {
8129
+ function doTurnDiscovery(_x26, _x27) {
7774
8130
  return _doTurnDiscovery.apply(this, arguments);
7775
8131
  }
7776
8132
  return doTurnDiscovery;
@@ -7789,35 +8145,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7789
8145
  }, {
7790
8146
  key: "establishMediaConnection",
7791
8147
  value: (function () {
7792
- var _establishMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
8148
+ var _establishMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
7793
8149
  var _this$locusMediaReque;
7794
- var LOG_HEADER, isReconnecting, _yield$this$doTurnDis, mc, _t31, _t32;
7795
- return _regenerator.default.wrap(function (_context30) {
7796
- while (1) switch (_context30.prev = _context30.next) {
8150
+ var LOG_HEADER, isReconnecting, _yield$this$doTurnDis, mc, _t33, _t34;
8151
+ return _regenerator.default.wrap(function (_context32) {
8152
+ while (1) switch (_context32.prev = _context32.next) {
7797
8153
  case 0:
7798
8154
  LOG_HEADER = 'Meeting:index#addMedia():establishMediaConnection -->';
7799
8155
  isReconnecting = this.isMoveToInProgress || !!((_this$locusMediaReque = this.locusMediaRequest) !== null && _this$locusMediaReque !== void 0 && _this$locusMediaReque.isConfluenceCreated()); // We are forcing turn discovery if the case is moveTo and a turn server was used already
7800
8156
  if (this.isMoveToInProgress && this.turnServerUsed) {
7801
8157
  isForced = true;
7802
8158
  }
7803
- _context30.prev = 1;
8159
+ _context32.prev = 1;
7804
8160
  if (turnServerInfo) {
7805
- _context30.next = 3;
8161
+ _context32.next = 3;
7806
8162
  break;
7807
8163
  }
7808
- _context30.next = 2;
8164
+ _context32.next = 2;
7809
8165
  return this.doTurnDiscovery(isReconnecting, isForced);
7810
8166
  case 2:
7811
- _yield$this$doTurnDis = _context30.sent;
8167
+ _yield$this$doTurnDis = _context32.sent;
7812
8168
  turnServerInfo = _yield$this$doTurnDis.turnServerInfo;
7813
8169
  case 3:
7814
- _context30.next = 4;
8170
+ _context32.next = 4;
7815
8171
  return this.createMediaConnection(turnServerInfo, bundlePolicy);
7816
8172
  case 4:
7817
- mc = _context30.sent;
8173
+ mc = _context32.sent;
7818
8174
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connection created this.isMultistream=").concat(this.isMultistream));
7819
8175
  if (!this.isMultistream) {
7820
- _context30.next = 5;
8176
+ _context32.next = 5;
7821
8177
  break;
7822
8178
  }
7823
8179
  this.remoteMediaManager = new _remoteMediaManager.RemoteMediaManager(this.receiveSlotManager, this.mediaRequestManagers, remoteMediaManagerConfig);
@@ -7825,42 +8181,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7825
8181
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.InterpretationAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_INTERPRETATION_AUDIO_CREATED);
7826
8182
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.ScreenShareAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_SCREEN_SHARE_AUDIO_CREATED);
7827
8183
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.VideoLayoutChanged, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_VIDEO_LAYOUT_CHANGED);
7828
- _context30.next = 5;
8184
+ _context32.next = 5;
7829
8185
  return this.remoteMediaManager.start();
7830
8186
  case 5:
7831
- _context30.next = 6;
8187
+ _context32.next = 6;
7832
8188
  return mc.initiateOffer();
7833
8189
  case 6:
7834
- _context30.next = 7;
8190
+ _context32.next = 7;
7835
8191
  return this.waitForRemoteSDPAnswer();
7836
8192
  case 7:
7837
8193
  this.handleMediaLogging(this.mediaProperties);
7838
- _context30.next = 9;
8194
+ _context32.next = 9;
7839
8195
  break;
7840
8196
  case 8:
7841
- _context30.prev = 8;
7842
- _t31 = _context30["catch"](1);
7843
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _t31);
7844
- throw _t31;
8197
+ _context32.prev = 8;
8198
+ _t33 = _context32["catch"](1);
8199
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _t33);
8200
+ throw _t33;
7845
8201
  case 9:
7846
- _context30.prev = 9;
7847
- _context30.next = 10;
8202
+ _context32.prev = 9;
8203
+ _context32.next = 10;
7848
8204
  return this.waitForMediaConnectionConnected();
7849
8205
  case 10:
7850
- _context30.next = 12;
8206
+ _context32.next = 12;
7851
8207
  break;
7852
8208
  case 11:
7853
- _context30.prev = 11;
7854
- _t32 = _context30["catch"](9);
7855
- _context30.next = 12;
7856
- return this.handleWaitForMediaConnectionConnectedError(_t32, remoteMediaManagerConfig, bundlePolicy);
8209
+ _context32.prev = 11;
8210
+ _t34 = _context32["catch"](9);
8211
+ _context32.next = 12;
8212
+ return this.handleWaitForMediaConnectionConnectedError(_t34, remoteMediaManagerConfig, bundlePolicy);
7857
8213
  case 12:
7858
8214
  case "end":
7859
- return _context30.stop();
8215
+ return _context32.stop();
7860
8216
  }
7861
- }, _callee30, this, [[1, 8], [9, 11]]);
8217
+ }, _callee32, this, [[1, 8], [9, 11]]);
7862
8218
  }));
7863
- function establishMediaConnection(_x26, _x27, _x28, _x29) {
8219
+ function establishMediaConnection(_x28, _x29, _x30, _x31) {
7864
8220
  return _establishMediaConnection.apply(this, arguments);
7865
8221
  }
7866
8222
  return establishMediaConnection;
@@ -7875,16 +8231,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7875
8231
  }, {
7876
8232
  key: "cleanUpOnAddMediaFailure",
7877
8233
  value: (function () {
7878
- var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
8234
+ var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
7879
8235
  var _this$networkQualityM, _this$statsMonitor;
7880
- return _regenerator.default.wrap(function (_context31) {
7881
- while (1) switch (_context31.prev = _context31.next) {
8236
+ return _regenerator.default.wrap(function (_context33) {
8237
+ while (1) switch (_context33.prev = _context33.next) {
7882
8238
  case 0:
7883
8239
  if (!this.statsAnalyzer) {
7884
- _context31.next = 1;
8240
+ _context33.next = 1;
7885
8241
  break;
7886
8242
  }
7887
- _context31.next = 1;
8243
+ _context33.next = 1;
7888
8244
  return this.statsAnalyzer.stopAnalyzer();
7889
8245
  case 1:
7890
8246
  this.statsAnalyzer = null;
@@ -7895,7 +8251,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7895
8251
 
7896
8252
  // when media fails, we want to upload a webrtc dump to see whats going on
7897
8253
  // this function is async, but returns once the stats have been gathered
7898
- _context31.next = 2;
8254
+ _context33.next = 2;
7899
8255
  return this.forceSendStatsReport({
7900
8256
  callFrom: 'addMedia'
7901
8257
  });
@@ -7906,9 +8262,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7906
8262
  }
7907
8263
  case 3:
7908
8264
  case "end":
7909
- return _context31.stop();
8265
+ return _context33.stop();
7910
8266
  }
7911
- }, _callee31, this);
8267
+ }, _callee33, this);
7912
8268
  }));
7913
8269
  function cleanUpOnAddMediaFailure() {
7914
8270
  return _cleanUpOnAddMediaFailure.apply(this, arguments);
@@ -7926,16 +8282,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7926
8282
  }, {
7927
8283
  key: "downgradeFromMultistreamToTranscoded",
7928
8284
  value: (function () {
7929
- var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
8285
+ var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
7930
8286
  var _this$networkQualityM2, _this$statsMonitor2, _this$locusMediaReque2;
7931
- return _regenerator.default.wrap(function (_context32) {
7932
- while (1) switch (_context32.prev = _context32.next) {
8287
+ return _regenerator.default.wrap(function (_context34) {
8288
+ while (1) switch (_context34.prev = _context34.next) {
7933
8289
  case 0:
7934
8290
  if (!this.statsAnalyzer) {
7935
- _context32.next = 1;
8291
+ _context34.next = 1;
7936
8292
  break;
7937
8293
  }
7938
- _context32.next = 1;
8294
+ _context34.next = 1;
7939
8295
  return this.statsAnalyzer.stopAnalyzer();
7940
8296
  case 1:
7941
8297
  this.statsAnalyzer = null;
@@ -7953,9 +8309,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7953
8309
  this.createStatsAnalyzer();
7954
8310
  case 2:
7955
8311
  case "end":
7956
- return _context32.stop();
8312
+ return _context34.stop();
7957
8313
  }
7958
- }, _callee32, this);
8314
+ }, _callee34, this);
7959
8315
  }));
7960
8316
  function downgradeFromMultistreamToTranscoded() {
7961
8317
  return _downgradeFromMultistreamToTranscoded.apply(this, arguments);
@@ -7973,11 +8329,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7973
8329
  }, {
7974
8330
  key: "cleanUpBeforeRetryWithTurnServer",
7975
8331
  value: (function () {
7976
- var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
7977
- return _regenerator.default.wrap(function (_context33) {
7978
- while (1) switch (_context33.prev = _context33.next) {
8332
+ var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
8333
+ return _regenerator.default.wrap(function (_context35) {
8334
+ while (1) switch (_context35.prev = _context35.next) {
7979
8335
  case 0:
7980
- _context33.next = 1;
8336
+ _context35.next = 1;
7981
8337
  return this.forceSendStatsReport({
7982
8338
  callFrom: 'cleanUpBeforeRetryWithTurnServer'
7983
8339
  });
@@ -7997,9 +8353,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7997
8353
  }
7998
8354
  case 2:
7999
8355
  case "end":
8000
- return _context33.stop();
8356
+ return _context35.stop();
8001
8357
  }
8002
- }, _callee33, this);
8358
+ }, _callee35, this);
8003
8359
  }));
8004
8360
  function cleanUpBeforeRetryWithTurnServer() {
8005
8361
  return _cleanUpBeforeRetryWithTurnServer.apply(this, arguments);
@@ -8009,35 +8365,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8009
8365
  }, {
8010
8366
  key: "cleanUpBeforeReconnection",
8011
8367
  value: function () {
8012
- var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
8013
- var _t33;
8014
- return _regenerator.default.wrap(function (_context34) {
8015
- while (1) switch (_context34.prev = _context34.next) {
8368
+ var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
8369
+ var _t35;
8370
+ return _regenerator.default.wrap(function (_context36) {
8371
+ while (1) switch (_context36.prev = _context36.next) {
8016
8372
  case 0:
8017
- _context34.prev = 0;
8018
- _context34.next = 1;
8373
+ _context36.prev = 0;
8374
+ _context36.next = 1;
8019
8375
  return this.forceSendStatsReport({
8020
8376
  callFrom: 'cleanUpBeforeReconnection'
8021
8377
  });
8022
8378
  case 1:
8023
8379
  if (!this.statsAnalyzer) {
8024
- _context34.next = 2;
8380
+ _context36.next = 2;
8025
8381
  break;
8026
8382
  }
8027
- _context34.next = 2;
8383
+ _context36.next = 2;
8028
8384
  return this.statsAnalyzer.stopAnalyzer();
8029
8385
  case 2:
8030
- _context34.next = 4;
8386
+ _context36.next = 4;
8031
8387
  break;
8032
8388
  case 3:
8033
- _context34.prev = 3;
8034
- _t33 = _context34["catch"](0);
8035
- _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _t33);
8389
+ _context36.prev = 3;
8390
+ _t35 = _context36["catch"](0);
8391
+ _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _t35);
8036
8392
  case 4:
8037
8393
  case "end":
8038
- return _context34.stop();
8394
+ return _context36.stop();
8039
8395
  }
8040
- }, _callee34, this, [[0, 3]]);
8396
+ }, _callee36, this, [[0, 3]]);
8041
8397
  }));
8042
8398
  function cleanUpBeforeReconnection() {
8043
8399
  return _cleanUpBeforeReconnection.apply(this, arguments);
@@ -8105,7 +8461,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8105
8461
  }, {
8106
8462
  key: "addMediaInternal",
8107
8463
  value: (function () {
8108
- var _addMediaInternal = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
8464
+ var _addMediaInternal = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
8109
8465
  var options,
8110
8466
  LOG_HEADER,
8111
8467
  localStreams,
@@ -8167,26 +8523,26 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8167
8523
  _selectedCandidatePairChanges,
8168
8524
  _numTransports,
8169
8525
  _iceCandidateErrors,
8170
- _args35 = arguments,
8171
- _t34,
8172
- _t35;
8173
- return _regenerator.default.wrap(function (_context35) {
8174
- while (1) switch (_context35.prev = _context35.next) {
8526
+ _args37 = arguments,
8527
+ _t36,
8528
+ _t37;
8529
+ return _regenerator.default.wrap(function (_context37) {
8530
+ while (1) switch (_context37.prev = _context37.next) {
8175
8531
  case 0:
8176
- options = _args35.length > 3 && _args35[3] !== undefined ? _args35[3] : {};
8532
+ options = _args37.length > 3 && _args37[3] !== undefined ? _args37[3] : {};
8177
8533
  this.addMediaData.retriedWithTurnServer = false;
8178
8534
  this.addMediaData.icePhaseCallback = icePhaseCallback;
8179
8535
  this.hasMediaConnectionConnectedAtLeastOnce = false;
8180
8536
  LOG_HEADER = 'Meeting:index#addMedia -->';
8181
8537
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: options=").concat((0, _stringify.default)(options), ", turnServerInfo=").concat((0, _stringify.default)(turnServerInfo), ", forceTurnDiscovery=").concat(forceTurnDiscovery));
8182
8538
  if (!(options.allowMediaInLobby !== true && this.meetingState !== _constants.FULL_STATE.ACTIVE)) {
8183
- _context35.next = 1;
8539
+ _context37.next = 1;
8184
8540
  break;
8185
8541
  }
8186
8542
  throw new _webexErrors.MeetingNotActiveError();
8187
8543
  case 1:
8188
8544
  if (!_util2.default.isUserInLeftState(this.locusInfo)) {
8189
- _context35.next = 2;
8545
+ _context37.next = 2;
8190
8546
  break;
8191
8547
  }
8192
8548
  throw new _webexErrors.UserNotJoinedError();
@@ -8203,7 +8559,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8203
8559
  ipver = _util2.default.getIpVersion(this.webex); // used just for metrics
8204
8560
  // If the user is unjoined or guest waiting in lobby dont allow the user to addMedia
8205
8561
  if (!(this.isUserUnadmitted && !this.wirelessShare && !this.allowMediaInLobby)) {
8206
- _context35.next = 3;
8562
+ _context37.next = 3;
8207
8563
  break;
8208
8564
  }
8209
8565
  throw new _webexErrors.UserInLobbyError();
@@ -8247,62 +8603,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8247
8603
  this.audio = (0, _muteState.createMuteState)(_constants.AUDIO, this, audioEnabled);
8248
8604
  this.video = (0, _muteState.createMuteState)(_constants.VIDEO, this, videoEnabled);
8249
8605
  this.brbState = (0, _brbState.createBrbState)(this, false);
8250
- _context35.prev = 4;
8606
+ _context37.prev = 4;
8251
8607
  if (!(allowPublishMediaInLobby || !this.isUserUnadmitted)) {
8252
- _context35.next = 5;
8608
+ _context37.next = 5;
8253
8609
  break;
8254
8610
  }
8255
- _context35.next = 5;
8611
+ _context37.next = 5;
8256
8612
  return this.setUpLocalStreamReferences(localStreams);
8257
8613
  case 5:
8258
8614
  this.setMercuryListener();
8259
8615
  this.createStatsAnalyzer();
8260
- _context35.prev = 6;
8261
- _context35.next = 7;
8616
+ _context37.prev = 6;
8617
+ _context37.next = 7;
8262
8618
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, forceTurnDiscovery, turnServerInfo);
8263
8619
  case 7:
8264
- _context35.next = 12;
8620
+ _context37.next = 12;
8265
8621
  break;
8266
8622
  case 8:
8267
- _context35.prev = 8;
8268
- _t34 = _context35["catch"](6);
8269
- if (!(_t34 instanceof _multistreamNotSupportedError.default)) {
8270
- _context35.next = 11;
8623
+ _context37.prev = 8;
8624
+ _t36 = _context37["catch"](6);
8625
+ if (!(_t36 instanceof _multistreamNotSupportedError.default)) {
8626
+ _context37.next = 11;
8271
8627
  break;
8272
8628
  }
8273
8629
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " we asked for multistream backend (Homer), but got transcoded backend, recreating media connection..."));
8274
- _context35.next = 9;
8630
+ _context37.next = 9;
8275
8631
  return this.downgradeFromMultistreamToTranscoded();
8276
8632
  case 9:
8277
- _context35.next = 10;
8633
+ _context37.next = 10;
8278
8634
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true, undefined);
8279
8635
  case 10:
8280
- _context35.next = 12;
8636
+ _context37.next = 12;
8281
8637
  break;
8282
8638
  case 11:
8283
- throw _t34;
8639
+ throw _t36;
8284
8640
  case 12:
8285
8641
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connected, finalizing..."));
8286
8642
  if (!this.mediaProperties.hasLocalShareStream()) {
8287
- _context35.next = 13;
8643
+ _context37.next = 13;
8288
8644
  break;
8289
8645
  }
8290
- _context35.next = 13;
8646
+ _context37.next = 13;
8291
8647
  return this.enqueueScreenShareFloorRequest();
8292
8648
  case 13:
8293
- _context35.next = 14;
8649
+ _context37.next = 14;
8294
8650
  return this.mediaProperties.getCurrentConnectionInfo();
8295
8651
  case 14:
8296
- _yield$this$mediaProp = _context35.sent;
8652
+ _yield$this$mediaProp = _context37.sent;
8297
8653
  connectionType = _yield$this$mediaProp.connectionType;
8298
8654
  ipVersion = _yield$this$mediaProp.ipVersion;
8299
8655
  selectedCandidatePairChanges = _yield$this$mediaProp.selectedCandidatePairChanges;
8300
8656
  numTransports = _yield$this$mediaProp.numTransports;
8301
8657
  iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
8302
- _context35.next = 15;
8658
+ _context37.next = 15;
8303
8659
  return this.getMediaReachabilityMetricFields();
8304
8660
  case 15:
8305
- reachabilityMetrics = _context35.sent;
8661
+ reachabilityMetrics = _context37.sent;
8306
8662
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread(_objectSpread(_objectSpread({
8307
8663
  correlation_id: this.correlationId,
8308
8664
  locus_id: this.locusUrl.split('/').pop(),
@@ -8332,31 +8688,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8332
8688
  // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
8333
8689
  (_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
8334
8690
  this.startPeriodicLogUpload();
8335
- _context35.next = 20;
8691
+ _context37.next = 20;
8336
8692
  break;
8337
8693
  case 16:
8338
- _context35.prev = 16;
8339
- _t35 = _context35["catch"](4);
8340
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _t35);
8694
+ _context37.prev = 16;
8695
+ _t37 = _context37["catch"](4);
8696
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _t37);
8341
8697
 
8342
8698
  // @ts-ignore
8343
- _context35.next = 17;
8699
+ _context37.next = 17;
8344
8700
  return this.getMediaReachabilityMetricFields();
8345
8701
  case 17:
8346
- _reachabilityMetrics = _context35.sent;
8347
- _context35.next = 18;
8702
+ _reachabilityMetrics = _context37.sent;
8703
+ _context37.next = 18;
8348
8704
  return this.mediaProperties.getCurrentConnectionInfo();
8349
8705
  case 18:
8350
- _yield$this$mediaProp2 = _context35.sent;
8706
+ _yield$this$mediaProp2 = _context37.sent;
8351
8707
  _selectedCandidatePairChanges = _yield$this$mediaProp2.selectedCandidatePairChanges;
8352
8708
  _numTransports = _yield$this$mediaProp2.numTransports;
8353
8709
  _iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
8354
8710
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread(_objectSpread(_objectSpread({
8355
8711
  correlation_id: this.correlationId,
8356
8712
  locus_id: this.locusUrl.split('/').pop(),
8357
- reason: _t35.message,
8358
- stack: _t35.stack,
8359
- code: _t35.code,
8713
+ reason: _t37.message,
8714
+ stack: _t37.stack,
8715
+ code: _t37.code,
8360
8716
  selectedCandidatePairChanges: _selectedCandidatePairChanges,
8361
8717
  numTransports: _numTransports,
8362
8718
  turnDiscoverySkippedReason: this.turnDiscoverySkippedReason,
@@ -8371,7 +8727,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8371
8727
  iceCandidatesCount: this.iceCandidatesCount,
8372
8728
  ipver: ipver
8373
8729
  }));
8374
- _context35.next = 19;
8730
+ _context37.next = 19;
8375
8731
  return this.cleanUpOnAddMediaFailure();
8376
8732
  case 19:
8377
8733
  // Upload logs on error while adding media
@@ -8379,23 +8735,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8379
8735
  file: 'meeting/index',
8380
8736
  function: 'addMedia'
8381
8737
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
8382
- if (_t35 instanceof _internalMediaCore.Errors.SdpError) {
8738
+ if (_t37 instanceof _internalMediaCore.Errors.SdpError) {
8383
8739
  this.leave({
8384
8740
  reason: _constants.MEETING_REMOVED_REASON.MEETING_CONNECTION_FAILED
8385
8741
  });
8386
8742
  }
8387
- throw _t35;
8743
+ throw _t37;
8388
8744
  case 20:
8389
- _context35.prev = 20;
8745
+ _context37.prev = 20;
8390
8746
  this.addMediaData.icePhaseCallback = DEFAULT_ICE_PHASE_CALLBACK;
8391
- return _context35.finish(20);
8747
+ return _context37.finish(20);
8392
8748
  case 21:
8393
8749
  case "end":
8394
- return _context35.stop();
8750
+ return _context37.stop();
8395
8751
  }
8396
- }, _callee35, this, [[4, 16, 20, 21], [6, 8]]);
8752
+ }, _callee37, this, [[4, 16, 20, 21], [6, 8]]);
8397
8753
  }));
8398
- function addMediaInternal(_x30, _x31, _x32) {
8754
+ function addMediaInternal(_x32, _x33, _x34) {
8399
8755
  return _addMediaInternal.apply(this, arguments);
8400
8756
  }
8401
8757
  return addMediaInternal;
@@ -8461,35 +8817,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8461
8817
  * @memberof Meeting
8462
8818
  */
8463
8819
  function () {
8464
- var _updateMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36(options) {
8820
+ var _updateMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38(options) {
8465
8821
  var audioEnabled, videoEnabled, shareAudioEnabled, shareVideoEnabled, _this$audio3, _this$video3;
8466
- return _regenerator.default.wrap(function (_context36) {
8467
- while (1) switch (_context36.prev = _context36.next) {
8822
+ return _regenerator.default.wrap(function (_context38) {
8823
+ while (1) switch (_context38.prev = _context38.next) {
8468
8824
  case 0:
8469
8825
  this.checkMediaConnection();
8470
8826
  audioEnabled = options.audioEnabled, videoEnabled = options.videoEnabled, shareAudioEnabled = options.shareAudioEnabled, shareVideoEnabled = options.shareVideoEnabled;
8471
8827
  _loggerProxy.default.logger.log("Meeting:index#updateMedia --> called with options=".concat((0, _stringify.default)(options)));
8472
8828
  if (this.canUpdateMedia()) {
8473
- _context36.next = 1;
8829
+ _context38.next = 1;
8474
8830
  break;
8475
8831
  }
8476
- return _context36.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
8832
+ return _context38.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
8477
8833
  case 1:
8478
8834
  if (!this.isMultistream) {
8479
- _context36.next = 3;
8835
+ _context38.next = 3;
8480
8836
  break;
8481
8837
  }
8482
8838
  if (!(shareAudioEnabled !== undefined || shareVideoEnabled !== undefined)) {
8483
- _context36.next = 2;
8839
+ _context38.next = 2;
8484
8840
  break;
8485
8841
  }
8486
8842
  throw new Error('toggling shareAudioEnabled or shareVideoEnabled in a multistream meeting is not supported, to control receiving screen share call meeting.remoteMediaManager.setLayout() with appropriate layout');
8487
8843
  case 2:
8488
- _context36.next = 4;
8844
+ _context38.next = 4;
8489
8845
  break;
8490
8846
  case 3:
8491
8847
  if (!(shareAudioEnabled !== undefined)) {
8492
- _context36.next = 4;
8848
+ _context38.next = 4;
8493
8849
  break;
8494
8850
  }
8495
8851
  throw new Error('toggling shareAudioEnabled in a transcoded meeting is not supported as of now');
@@ -8514,20 +8870,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8514
8870
  this.mediaProperties.mediaDirection.receiveShare = !!(shareAudioEnabled || shareVideoEnabled);
8515
8871
  }
8516
8872
  if (this.isMultistream) {
8517
- _context36.next = 5;
8873
+ _context38.next = 5;
8518
8874
  break;
8519
8875
  }
8520
- _context36.next = 5;
8876
+ _context38.next = 5;
8521
8877
  return this.updateTranscodedMediaConnection();
8522
8878
  case 5:
8523
- return _context36.abrupt("return", undefined);
8879
+ return _context38.abrupt("return", undefined);
8524
8880
  case 6:
8525
8881
  case "end":
8526
- return _context36.stop();
8882
+ return _context38.stop();
8527
8883
  }
8528
- }, _callee36, this);
8884
+ }, _callee38, this);
8529
8885
  }));
8530
- function updateMedia(_x33) {
8886
+ function updateMedia(_x35) {
8531
8887
  return _updateMedia.apply(this, arguments);
8532
8888
  }
8533
8889
  return updateMedia;
@@ -8667,15 +9023,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8667
9023
  );
8668
9024
  };
8669
9025
  _loggerProxy.default.logger.log('Meeting:index#leave --> Leaving a meeting');
9026
+ this.stopListeningForMeetingEvents();
8670
9027
  return _util2.default.leaveMeeting(this, options).then(/*#__PURE__*/function () {
8671
- var _ref41 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37(leave) {
8672
- return _regenerator.default.wrap(function (_context37) {
8673
- while (1) switch (_context37.prev = _context37.next) {
9028
+ var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(leave) {
9029
+ return _regenerator.default.wrap(function (_context39) {
9030
+ while (1) switch (_context39.prev = _context39.next) {
8674
9031
  case 0:
8675
9032
  // CA team recommends submitting this *after* locus /leave
8676
9033
  submitLeaveMetric();
8677
9034
  _this49.meetingFiniteStateMachine.leave();
8678
- _context37.next = 1;
9035
+ _context39.next = 1;
8679
9036
  return _this49.clearMeetingData();
8680
9037
  case 1:
8681
9038
  // upload logs on leave irrespective of meeting delete
@@ -8696,15 +9053,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8696
9053
  });
8697
9054
  }
8698
9055
  _loggerProxy.default.logger.log('Meeting:index#leave --> LEAVE REASON ', leaveReason);
8699
- return _context37.abrupt("return", leave);
9056
+ return _context39.abrupt("return", leave);
8700
9057
  case 2:
8701
9058
  case "end":
8702
- return _context37.stop();
9059
+ return _context39.stop();
8703
9060
  }
8704
- }, _callee37);
9061
+ }, _callee39);
8705
9062
  }));
8706
- return function (_x34) {
8707
- return _ref41.apply(this, arguments);
9063
+ return function (_x36) {
9064
+ return _ref42.apply(this, arguments);
8708
9065
  };
8709
9066
  }()).catch(function (error) {
8710
9067
  // CA team recommends submitting this *after* locus /leave
@@ -9368,13 +9725,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9368
9725
  correlation_id: this.correlationId,
9369
9726
  locus_id: this.locusId
9370
9727
  });
9728
+ this.stopListeningForMeetingEvents();
9371
9729
  return _util2.default.endMeetingForAll(this).then(/*#__PURE__*/function () {
9372
- var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38(end) {
9373
- return _regenerator.default.wrap(function (_context38) {
9374
- while (1) switch (_context38.prev = _context38.next) {
9730
+ var _ref43 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40(end) {
9731
+ return _regenerator.default.wrap(function (_context40) {
9732
+ while (1) switch (_context40.prev = _context40.next) {
9375
9733
  case 0:
9376
9734
  _this56.meetingFiniteStateMachine.end();
9377
- _context38.next = 1;
9735
+ _context40.next = 1;
9378
9736
  return _this56.clearMeetingData();
9379
9737
  case 1:
9380
9738
  // upload logs on leave irrespective of meeting delete
@@ -9382,15 +9740,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9382
9740
  file: 'meeting/index',
9383
9741
  function: 'endMeetingForAll'
9384
9742
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this56);
9385
- return _context38.abrupt("return", end);
9743
+ return _context40.abrupt("return", end);
9386
9744
  case 2:
9387
9745
  case "end":
9388
- return _context38.stop();
9746
+ return _context40.stop();
9389
9747
  }
9390
- }, _callee38);
9748
+ }, _callee40);
9391
9749
  }));
9392
- return function (_x35) {
9393
- return _ref42.apply(this, arguments);
9750
+ return function (_x37) {
9751
+ return _ref43.apply(this, arguments);
9394
9752
  };
9395
9753
  }()).catch(function (error) {
9396
9754
  _this56.meetingFiniteStateMachine.fail(error);
@@ -9426,10 +9784,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9426
9784
  var _this$locusInfo7, _this$locusInfo7$cont, _this$locusInfo7$cont2;
9427
9785
  var reactionChannelUrl = (_this$locusInfo7 = this.locusInfo) === null || _this$locusInfo7 === void 0 ? void 0 : (_this$locusInfo7$cont = _this$locusInfo7.controls) === null || _this$locusInfo7$cont === void 0 ? void 0 : (_this$locusInfo7$cont2 = _this$locusInfo7$cont.reactions) === null || _this$locusInfo7$cont2 === void 0 ? void 0 : _this$locusInfo7$cont2.reactionChannelUrl;
9428
9786
  var participantId = this.members.selfId;
9429
- var reactionData = _reactions.Reactions[reactionType];
9430
- if (!reactionData) {
9431
- return _promise.default.reject(new Error("".concat(reactionType, " is not a valid reaction.")));
9432
- }
9787
+ var reactionData = _reactions.Reactions[reactionType] || {
9788
+ type: reactionType
9789
+ };
9433
9790
  var skinToneData = _reactions.SkinTones[skinToneType] || _reactions.SkinTones.normal;
9434
9791
  var reaction = _objectSpread(_objectSpread({}, reactionData), {}, {
9435
9792
  tone: skinToneData
@@ -9454,12 +9811,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9454
9811
  */
9455
9812
  }, {
9456
9813
  key: "extendMeeting",
9457
- value: function extendMeeting(_ref43) {
9458
- var meetingPolicyUrl = _ref43.meetingPolicyUrl,
9459
- meetingInstanceId = _ref43.meetingInstanceId,
9460
- participantId = _ref43.participantId,
9461
- _ref43$extensionMinut = _ref43.extensionMinutes,
9462
- extensionMinutes = _ref43$extensionMinut === void 0 ? 30 : _ref43$extensionMinut;
9814
+ value: function extendMeeting(_ref44) {
9815
+ var meetingPolicyUrl = _ref44.meetingPolicyUrl,
9816
+ meetingInstanceId = _ref44.meetingInstanceId,
9817
+ participantId = _ref44.participantId,
9818
+ _ref44$extensionMinut = _ref44.extensionMinutes,
9819
+ extensionMinutes = _ref44$extensionMinut === void 0 ? 30 : _ref44$extensionMinut;
9463
9820
  if (!meetingInstanceId || !participantId) {
9464
9821
  return _promise.default.reject(new Error('Missing meetingInstanceId or participantId'));
9465
9822
  }
@@ -9540,39 +9897,39 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9540
9897
  }, {
9541
9898
  key: "enableMusicMode",
9542
9899
  value: (function () {
9543
- var _enableMusicMode = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(shouldEnableMusicMode) {
9544
- return _regenerator.default.wrap(function (_context39) {
9545
- while (1) switch (_context39.prev = _context39.next) {
9900
+ var _enableMusicMode = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(shouldEnableMusicMode) {
9901
+ return _regenerator.default.wrap(function (_context41) {
9902
+ while (1) switch (_context41.prev = _context41.next) {
9546
9903
  case 0:
9547
9904
  this.checkMediaConnection();
9548
9905
  if (this.isMultistream) {
9549
- _context39.next = 1;
9906
+ _context41.next = 1;
9550
9907
  break;
9551
9908
  }
9552
9909
  throw new Error('enableMusicMode() only supported with multistream');
9553
9910
  case 1:
9554
9911
  if (!shouldEnableMusicMode) {
9555
- _context39.next = 3;
9912
+ _context41.next = 3;
9556
9913
  break;
9557
9914
  }
9558
- _context39.next = 2;
9915
+ _context41.next = 2;
9559
9916
  return this.sendSlotManager.setCustomCodecParameters(_internalMediaCore.MediaType.AudioMain, _internalMediaCore.MediaCodecMimeType.OPUS, {
9560
9917
  maxaveragebitrate: '64000',
9561
9918
  maxplaybackrate: '48000'
9562
9919
  });
9563
9920
  case 2:
9564
- _context39.next = 4;
9921
+ _context41.next = 4;
9565
9922
  break;
9566
9923
  case 3:
9567
- _context39.next = 4;
9924
+ _context41.next = 4;
9568
9925
  return this.sendSlotManager.markCustomCodecParametersForDeletion(_internalMediaCore.MediaType.AudioMain, _internalMediaCore.MediaCodecMimeType.OPUS, ['maxaveragebitrate', 'maxplaybackrate']);
9569
9926
  case 4:
9570
9927
  case "end":
9571
- return _context39.stop();
9928
+ return _context41.stop();
9572
9929
  }
9573
- }, _callee39, this);
9930
+ }, _callee41, this);
9574
9931
  }));
9575
- function enableMusicMode(_x36) {
9932
+ function enableMusicMode(_x38) {
9576
9933
  return _enableMusicMode.apply(this, arguments);
9577
9934
  }
9578
9935
  return enableMusicMode;
@@ -9663,25 +10020,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9663
10020
  }, {
9664
10021
  key: "publishStream",
9665
10022
  value: (function () {
9666
- var _publishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40(mediaType, stream) {
9667
- return _regenerator.default.wrap(function (_context40) {
9668
- while (1) switch (_context40.prev = _context40.next) {
10023
+ var _publishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(mediaType, stream) {
10024
+ return _regenerator.default.wrap(function (_context42) {
10025
+ while (1) switch (_context42.prev = _context42.next) {
9669
10026
  case 0:
9670
10027
  if (stream) {
9671
- _context40.next = 1;
10028
+ _context42.next = 1;
9672
10029
  break;
9673
10030
  }
9674
- return _context40.abrupt("return");
10031
+ return _context42.abrupt("return");
9675
10032
  case 1:
9676
10033
  if (!this.mediaProperties.webrtcMediaConnection) {
9677
- _context40.next = 3;
10034
+ _context42.next = 3;
9678
10035
  break;
9679
10036
  }
9680
10037
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
9681
- _context40.next = 2;
10038
+ _context42.next = 2;
9682
10039
  break;
9683
10040
  }
9684
- _context40.next = 2;
10041
+ _context42.next = 2;
9685
10042
  return this.sendSlotManager.publishStream(mediaType, stream);
9686
10043
  case 2:
9687
10044
  this.emitPublishStateChangeEvent({
@@ -9692,11 +10049,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9692
10049
  });
9693
10050
  case 3:
9694
10051
  case "end":
9695
- return _context40.stop();
10052
+ return _context42.stop();
9696
10053
  }
9697
- }, _callee40, this);
10054
+ }, _callee42, this);
9698
10055
  }));
9699
- function publishStream(_x37, _x38) {
10056
+ function publishStream(_x39, _x40) {
9700
10057
  return _publishStream.apply(this, arguments);
9701
10058
  }
9702
10059
  return publishStream;
@@ -9712,21 +10069,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9712
10069
  }, {
9713
10070
  key: "unpublishStream",
9714
10071
  value: (function () {
9715
- var _unpublishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(mediaType, stream) {
9716
- return _regenerator.default.wrap(function (_context41) {
9717
- while (1) switch (_context41.prev = _context41.next) {
10072
+ var _unpublishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(mediaType, stream) {
10073
+ return _regenerator.default.wrap(function (_context43) {
10074
+ while (1) switch (_context43.prev = _context43.next) {
9718
10075
  case 0:
9719
10076
  if (stream) {
9720
- _context41.next = 1;
10077
+ _context43.next = 1;
9721
10078
  break;
9722
10079
  }
9723
- return _context41.abrupt("return");
10080
+ return _context43.abrupt("return");
9724
10081
  case 1:
9725
10082
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
9726
- _context41.next = 2;
10083
+ _context43.next = 2;
9727
10084
  break;
9728
10085
  }
9729
- _context41.next = 2;
10086
+ _context43.next = 2;
9730
10087
  return this.sendSlotManager.unpublishStream(mediaType);
9731
10088
  case 2:
9732
10089
  this.emitPublishStateChangeEvent({
@@ -9737,11 +10094,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9737
10094
  });
9738
10095
  case 3:
9739
10096
  case "end":
9740
- return _context41.stop();
10097
+ return _context43.stop();
9741
10098
  }
9742
- }, _callee41, this);
10099
+ }, _callee43, this);
9743
10100
  }));
9744
- function unpublishStream(_x39, _x40) {
10101
+ function unpublishStream(_x41, _x42) {
9745
10102
  return _unpublishStream.apply(this, arguments);
9746
10103
  }
9747
10104
  return unpublishStream;
@@ -9756,19 +10113,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9756
10113
  }, {
9757
10114
  key: "publishStreams",
9758
10115
  value: (function () {
9759
- var _publishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(streams) {
10116
+ var _publishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44(streams) {
9760
10117
  var _streams$screenShare, _streams$screenShare2, _streams$screenShare3, _streams$screenShare4, _streams$screenShare5, _streams$screenShare6;
9761
10118
  var streamChecks, _i, _streamChecks, _streamChecks$_i, stream, name, floorRequestNeeded, _streams$screenShare7;
9762
- return _regenerator.default.wrap(function (_context42) {
9763
- while (1) switch (_context42.prev = _context42.next) {
10119
+ return _regenerator.default.wrap(function (_context44) {
10120
+ while (1) switch (_context44.prev = _context44.next) {
9764
10121
  case 0:
9765
10122
  _loggerProxy.default.logger.info("Meeting:index#publishStreams --> called with: ".concat((0, _stringify.default)(streams)));
9766
10123
  this.checkMediaConnection();
9767
10124
  if (!(!streams.microphone && !streams.camera && !((_streams$screenShare = streams.screenShare) !== null && _streams$screenShare !== void 0 && _streams$screenShare.audio) && !((_streams$screenShare2 = streams.screenShare) !== null && _streams$screenShare2 !== void 0 && _streams$screenShare2.video))) {
9768
- _context42.next = 1;
10125
+ _context44.next = 1;
9769
10126
  break;
9770
10127
  }
9771
- return _context42.abrupt("return");
10128
+ return _context44.abrupt("return");
9772
10129
  case 1:
9773
10130
  streamChecks = [{
9774
10131
  stream: streams === null || streams === void 0 ? void 0 : streams.microphone,
@@ -9786,62 +10143,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9786
10143
  _i = 0, _streamChecks = streamChecks;
9787
10144
  case 2:
9788
10145
  if (!(_i < _streamChecks.length)) {
9789
- _context42.next = 4;
10146
+ _context44.next = 4;
9790
10147
  break;
9791
10148
  }
9792
10149
  _streamChecks$_i = _streamChecks[_i], stream = _streamChecks$_i.stream, name = _streamChecks$_i.name;
9793
10150
  if (!((stream === null || stream === void 0 ? void 0 : stream.readyState) === 'ended')) {
9794
- _context42.next = 3;
10151
+ _context44.next = 3;
9795
10152
  break;
9796
10153
  }
9797
10154
  throw new Error("Attempted to publish ".concat(name, " stream with ended readyState, correlationId=").concat(this.correlationId));
9798
10155
  case 3:
9799
10156
  _i++;
9800
- _context42.next = 2;
10157
+ _context44.next = 2;
9801
10158
  break;
9802
10159
  case 4:
9803
10160
  floorRequestNeeded = false; // Screenshare Audio is supported only in multi stream. So we check for screenshare audio presence only if it's a multi stream meeting
9804
10161
  if (!(this.isMultistream && (_streams$screenShare5 = streams.screenShare) !== null && _streams$screenShare5 !== void 0 && _streams$screenShare5.audio)) {
9805
- _context42.next = 6;
10162
+ _context44.next = 6;
9806
10163
  break;
9807
10164
  }
9808
- _context42.next = 5;
10165
+ _context44.next = 5;
9809
10166
  return this.setLocalShareAudioStream(streams.screenShare.audio);
9810
10167
  case 5:
9811
10168
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
9812
10169
  case 6:
9813
10170
  if (!((_streams$screenShare6 = streams.screenShare) !== null && _streams$screenShare6 !== void 0 && _streams$screenShare6.video)) {
9814
- _context42.next = 8;
10171
+ _context44.next = 8;
9815
10172
  break;
9816
10173
  }
9817
- _context42.next = 7;
10174
+ _context44.next = 7;
9818
10175
  return this.setLocalShareVideoStream((_streams$screenShare7 = streams.screenShare) === null || _streams$screenShare7 === void 0 ? void 0 : _streams$screenShare7.video);
9819
10176
  case 7:
9820
10177
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
9821
10178
  case 8:
9822
10179
  if (!streams.microphone) {
9823
- _context42.next = 9;
10180
+ _context44.next = 9;
9824
10181
  break;
9825
10182
  }
9826
- _context42.next = 9;
10183
+ _context44.next = 9;
9827
10184
  return this.setLocalAudioStream(streams.microphone);
9828
10185
  case 9:
9829
10186
  if (!streams.camera) {
9830
- _context42.next = 10;
10187
+ _context44.next = 10;
9831
10188
  break;
9832
10189
  }
9833
- _context42.next = 10;
10190
+ _context44.next = 10;
9834
10191
  return this.setLocalVideoStream(streams.camera);
9835
10192
  case 10:
9836
10193
  if (this.isMultistream) {
9837
- _context42.next = 11;
10194
+ _context44.next = 11;
9838
10195
  break;
9839
10196
  }
9840
- _context42.next = 11;
10197
+ _context44.next = 11;
9841
10198
  return this.updateTranscodedMediaConnection();
9842
10199
  case 11:
9843
10200
  if (!floorRequestNeeded) {
9844
- _context42.next = 12;
10201
+ _context44.next = 12;
9845
10202
  break;
9846
10203
  }
9847
10204
  this.localShareInstanceId = _uuid.default.v4();
@@ -9872,15 +10229,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9872
10229
  // we're sending the http request to Locus to request the screen share floor
9873
10230
  // only after the SDP update, because that's how it's always been done for transcoded meetings
9874
10231
  // and also if sharing from the start, we need confluence to have been created
9875
- _context42.next = 12;
10232
+ _context44.next = 12;
9876
10233
  return this.enqueueScreenShareFloorRequest();
9877
10234
  case 12:
9878
10235
  case "end":
9879
- return _context42.stop();
10236
+ return _context44.stop();
9880
10237
  }
9881
- }, _callee42, this);
10238
+ }, _callee44, this);
9882
10239
  }));
9883
- function publishStreams(_x41) {
10240
+ function publishStreams(_x43) {
9884
10241
  return _publishStreams.apply(this, arguments);
9885
10242
  }
9886
10243
  return publishStreams;
@@ -9895,20 +10252,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9895
10252
  }, {
9896
10253
  key: "unpublishStreams",
9897
10254
  value: (function () {
9898
- var _unpublishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(streams) {
9899
- var promises, _iterator, _step, stream;
9900
- return _regenerator.default.wrap(function (_context43) {
9901
- while (1) switch (_context43.prev = _context43.next) {
10255
+ var _unpublishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45(streams) {
10256
+ var promises, _iterator2, _step2, stream;
10257
+ return _regenerator.default.wrap(function (_context45) {
10258
+ while (1) switch (_context45.prev = _context45.next) {
9902
10259
  case 0:
9903
10260
  _loggerProxy.default.logger.info("Meeting:index#unpublishStreams --> called with: ".concat((0, _stringify.default)(streams)));
9904
10261
  this.checkMediaConnection();
9905
10262
  promises = [];
9906
- _iterator = _createForOfIteratorHelper(streams.filter(function (t) {
10263
+ _iterator2 = _createForOfIteratorHelper(streams.filter(function (t) {
9907
10264
  return !!t;
9908
10265
  }));
9909
10266
  try {
9910
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
9911
- stream = _step.value;
10267
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
10268
+ stream = _step2.value;
9912
10269
  if (stream === this.mediaProperties.shareAudioStream) {
9913
10270
  promises.push(this.setLocalShareAudioStream(undefined));
9914
10271
  }
@@ -9923,14 +10280,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9923
10280
  }
9924
10281
  }
9925
10282
  } catch (err) {
9926
- _iterator.e(err);
10283
+ _iterator2.e(err);
9927
10284
  } finally {
9928
- _iterator.f();
10285
+ _iterator2.f();
9929
10286
  }
9930
10287
  if (!this.isMultistream) {
9931
10288
  promises.push(this.updateTranscodedMediaConnection());
9932
10289
  }
9933
- _context43.next = 1;
10290
+ _context45.next = 1;
9934
10291
  return _promise.default.all(promises);
9935
10292
  case 1:
9936
10293
  // we're allowing for the SDK to support just audio share as well
@@ -9951,11 +10308,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9951
10308
  }
9952
10309
  case 2:
9953
10310
  case "end":
9954
- return _context43.stop();
10311
+ return _context45.stop();
9955
10312
  }
9956
- }, _callee43, this);
10313
+ }, _callee45, this);
9957
10314
  }));
9958
- function unpublishStreams(_x42) {
10315
+ function unpublishStreams(_x44) {
9959
10316
  return _unpublishStreams.apply(this, arguments);
9960
10317
  }
9961
10318
  return unpublishStreams;
@@ -10021,16 +10378,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10021
10378
  }, {
10022
10379
  key: "getMediaReachabilityMetricFields",
10023
10380
  value: (function () {
10024
- var _getMediaReachabilityMetricFields = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
10381
+ var _getMediaReachabilityMetricFields = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
10025
10382
  var _this$mediaServerIp, _this$mediaConnection, _this$mediaConnection2, _this$mediaConnection3;
10026
10383
  var reachabilityMetrics, successKeys, totalSuccessCases, selectedSubnetFirstOctet, isSubnetReachable, selectedCluster;
10027
- return _regenerator.default.wrap(function (_context44) {
10028
- while (1) switch (_context44.prev = _context44.next) {
10384
+ return _regenerator.default.wrap(function (_context46) {
10385
+ while (1) switch (_context46.prev = _context46.next) {
10029
10386
  case 0:
10030
- _context44.next = 1;
10387
+ _context46.next = 1;
10031
10388
  return this.webex.meetings.reachability.getReachabilityMetrics();
10032
10389
  case 1:
10033
- reachabilityMetrics = _context44.sent;
10390
+ reachabilityMetrics = _context46.sent;
10034
10391
  successKeys = ['reachability_public_udp_success', 'reachability_public_tcp_success', 'reachability_public_xtls_success', 'reachability_vmn_udp_success', 'reachability_vmn_tcp_success', 'reachability_vmn_xtls_success'];
10035
10392
  totalSuccessCases = successKeys.reduce(function (total, key) {
10036
10393
  var value = reachabilityMetrics[key];
@@ -10047,16 +10404,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10047
10404
  this.webex.meetings.reachability.isSubnetReachable(selectedSubnetFirstOctet);
10048
10405
  }
10049
10406
  selectedCluster = (_this$mediaConnection = (_this$mediaConnection2 = this.mediaConnections) === null || _this$mediaConnection2 === void 0 ? void 0 : (_this$mediaConnection3 = _this$mediaConnection2[0]) === null || _this$mediaConnection3 === void 0 ? void 0 : _this$mediaConnection3.mediaAgentCluster) !== null && _this$mediaConnection !== void 0 ? _this$mediaConnection : null;
10050
- return _context44.abrupt("return", _objectSpread(_objectSpread({}, reachabilityMetrics), {}, {
10407
+ return _context46.abrupt("return", _objectSpread(_objectSpread({}, reachabilityMetrics), {}, {
10051
10408
  subnet_reachable: isSubnetReachable,
10052
10409
  selected_cluster: selectedCluster,
10053
10410
  selected_subnet: selectedSubnetFirstOctet ? "".concat(selectedSubnetFirstOctet, ".X.X.X") : null
10054
10411
  }));
10055
10412
  case 2:
10056
10413
  case "end":
10057
- return _context44.stop();
10414
+ return _context46.stop();
10058
10415
  }
10059
- }, _callee44, this);
10416
+ }, _callee46, this);
10060
10417
  }));
10061
10418
  function getMediaReachabilityMetricFields() {
10062
10419
  return _getMediaReachabilityMetricFields.apply(this, arguments);
@@ -10073,17 +10430,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10073
10430
  }, {
10074
10431
  key: "setStage",
10075
10432
  value: function setStage() {
10076
- var _ref44 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
10077
- _ref44$activeSpeakerP = _ref44.activeSpeakerProportion,
10078
- activeSpeakerProportion = _ref44$activeSpeakerP === void 0 ? 0.5 : _ref44$activeSpeakerP,
10079
- customBackground = _ref44.customBackground,
10080
- customLogo = _ref44.customLogo,
10081
- customNameLabel = _ref44.customNameLabel,
10082
- importantParticipants = _ref44.importantParticipants,
10083
- _ref44$lockAttendeeVi = _ref44.lockAttendeeViewOnStage,
10084
- lockAttendeeViewOnStage = _ref44$lockAttendeeVi === void 0 ? false : _ref44$lockAttendeeVi,
10085
- _ref44$showActiveSpea = _ref44.showActiveSpeaker,
10086
- showActiveSpeaker = _ref44$showActiveSpea === void 0 ? false : _ref44$showActiveSpea;
10433
+ var _ref45 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
10434
+ _ref45$activeSpeakerP = _ref45.activeSpeakerProportion,
10435
+ activeSpeakerProportion = _ref45$activeSpeakerP === void 0 ? 0.5 : _ref45$activeSpeakerP,
10436
+ customBackground = _ref45.customBackground,
10437
+ customLogo = _ref45.customLogo,
10438
+ customNameLabel = _ref45.customNameLabel,
10439
+ importantParticipants = _ref45.importantParticipants,
10440
+ _ref45$lockAttendeeVi = _ref45.lockAttendeeViewOnStage,
10441
+ lockAttendeeViewOnStage = _ref45$lockAttendeeVi === void 0 ? false : _ref45$lockAttendeeVi,
10442
+ _ref45$showActiveSpea = _ref45.showActiveSpeaker,
10443
+ showActiveSpeaker = _ref45$showActiveSpea === void 0 ? false : _ref45$showActiveSpea;
10087
10444
  var videoLayout = {
10088
10445
  overrideDefault: true,
10089
10446
  lockAttendeeViewOnStageOnly: lockAttendeeViewOnStage,
@@ -10187,41 +10544,41 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10187
10544
  }, {
10188
10545
  key: "refreshDataChannelToken",
10189
10546
  value: (function () {
10190
- var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
10191
- var isPracticeSession, dataChannelTokenType, res, msg, _t36;
10192
- return _regenerator.default.wrap(function (_context45) {
10193
- while (1) switch (_context45.prev = _context45.next) {
10547
+ var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
10548
+ var isPracticeSession, dataChannelTokenType, res, msg, _t38;
10549
+ return _regenerator.default.wrap(function (_context47) {
10550
+ while (1) switch (_context47.prev = _context47.next) {
10194
10551
  case 0:
10195
10552
  isPracticeSession = this.webinar.isJoinPracticeSessionDataChannel();
10196
10553
  dataChannelTokenType = this.getDataChannelTokenType();
10197
- _context45.prev = 1;
10198
- _context45.next = 2;
10554
+ _context47.prev = 1;
10555
+ _context47.next = 2;
10199
10556
  return this.meetingRequest.fetchDatachannelToken({
10200
10557
  locusUrl: this.locusUrl,
10201
10558
  requestingParticipantId: this.members.selfId,
10202
10559
  isPracticeSession: isPracticeSession
10203
10560
  });
10204
10561
  case 2:
10205
- res = _context45.sent;
10206
- return _context45.abrupt("return", {
10562
+ res = _context47.sent;
10563
+ return _context47.abrupt("return", {
10207
10564
  body: {
10208
10565
  datachannelToken: res.body.datachannelToken,
10209
10566
  dataChannelTokenType: dataChannelTokenType
10210
10567
  }
10211
10568
  });
10212
10569
  case 3:
10213
- _context45.prev = 3;
10214
- _t36 = _context45["catch"](1);
10215
- msg = (_t36 === null || _t36 === void 0 ? void 0 : _t36.message) || String(_t36);
10570
+ _context47.prev = 3;
10571
+ _t38 = _context47["catch"](1);
10572
+ msg = (_t38 === null || _t38 === void 0 ? void 0 : _t38.message) || String(_t38);
10216
10573
  _loggerProxy.default.logger.warn("Meeting:index#refreshDataChannelToken --> DataChannel token refresh failed (likely locus changed or participant left): ".concat(msg), {
10217
- statusCode: _t36 === null || _t36 === void 0 ? void 0 : _t36.statusCode
10574
+ statusCode: _t38 === null || _t38 === void 0 ? void 0 : _t38.statusCode
10218
10575
  });
10219
- return _context45.abrupt("return", null);
10576
+ return _context47.abrupt("return", null);
10220
10577
  case 4:
10221
10578
  case "end":
10222
- return _context45.stop();
10579
+ return _context47.stop();
10223
10580
  }
10224
- }, _callee45, this, [[1, 3]]);
10581
+ }, _callee47, this, [[1, 3]]);
10225
10582
  }));
10226
10583
  function refreshDataChannelToken() {
10227
10584
  return _refreshDataChannelToken.apply(this, arguments);