@webex/plugin-meetings 3.0.0-beta.10 → 3.0.0-beta.104

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 (512) hide show
  1. package/UPGRADING.md +9 -9
  2. package/browsers.js +19 -24
  3. package/dist/annotation/annotation.types.js +7 -0
  4. package/dist/annotation/annotation.types.js.map +1 -0
  5. package/dist/annotation/constants.js +48 -0
  6. package/dist/annotation/constants.js.map +1 -0
  7. package/dist/annotation/index.js +357 -0
  8. package/dist/annotation/index.js.map +1 -0
  9. package/dist/breakouts/breakout.js +176 -0
  10. package/dist/breakouts/breakout.js.map +1 -0
  11. package/dist/breakouts/collection.js +23 -0
  12. package/dist/breakouts/collection.js.map +1 -0
  13. package/dist/breakouts/edit-lock-error.js +52 -0
  14. package/dist/breakouts/edit-lock-error.js.map +1 -0
  15. package/dist/breakouts/events.js +43 -0
  16. package/dist/breakouts/events.js.map +1 -0
  17. package/dist/breakouts/index.js +919 -0
  18. package/dist/breakouts/index.js.map +1 -0
  19. package/dist/breakouts/request.js +78 -0
  20. package/dist/breakouts/request.js.map +1 -0
  21. package/dist/breakouts/utils.js +67 -0
  22. package/dist/breakouts/utils.js.map +1 -0
  23. package/dist/common/browser-detection.js +1 -20
  24. package/dist/common/browser-detection.js.map +1 -1
  25. package/dist/common/collection.js +5 -20
  26. package/dist/common/collection.js.map +1 -1
  27. package/dist/common/config.js +0 -7
  28. package/dist/common/config.js.map +1 -1
  29. package/dist/common/errors/captcha-error.js +5 -26
  30. package/dist/common/errors/captcha-error.js.map +1 -1
  31. package/dist/common/errors/intent-to-join.js +5 -26
  32. package/dist/common/errors/intent-to-join.js.map +1 -1
  33. package/dist/common/errors/join-meeting.js +6 -27
  34. package/dist/common/errors/join-meeting.js.map +1 -1
  35. package/dist/common/errors/media.js +5 -26
  36. package/dist/common/errors/media.js.map +1 -1
  37. package/dist/common/errors/parameter.js +5 -33
  38. package/dist/common/errors/parameter.js.map +1 -1
  39. package/dist/common/errors/password-error.js +5 -26
  40. package/dist/common/errors/password-error.js.map +1 -1
  41. package/dist/common/errors/permission.js +4 -25
  42. package/dist/common/errors/permission.js.map +1 -1
  43. package/dist/common/errors/reconnection-in-progress.js +0 -17
  44. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  45. package/dist/common/errors/reconnection.js +5 -26
  46. package/dist/common/errors/reconnection.js.map +1 -1
  47. package/dist/common/errors/stats.js +5 -26
  48. package/dist/common/errors/stats.js.map +1 -1
  49. package/dist/common/errors/webex-errors.js +6 -41
  50. package/dist/common/errors/webex-errors.js.map +1 -1
  51. package/dist/common/errors/webex-meetings-error.js +1 -24
  52. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  53. package/dist/common/events/events-scope.js +0 -22
  54. package/dist/common/events/events-scope.js.map +1 -1
  55. package/dist/common/events/events.js +0 -23
  56. package/dist/common/events/events.js.map +1 -1
  57. package/dist/common/events/trigger-proxy.js +0 -12
  58. package/dist/common/events/trigger-proxy.js.map +1 -1
  59. package/dist/common/events/util.js +0 -15
  60. package/dist/common/events/util.js.map +1 -1
  61. package/dist/common/logs/logger-config.js +0 -4
  62. package/dist/common/logs/logger-config.js.map +1 -1
  63. package/dist/common/logs/logger-proxy.js +1 -8
  64. package/dist/common/logs/logger-proxy.js.map +1 -1
  65. package/dist/common/logs/request.js +35 -61
  66. package/dist/common/logs/request.js.map +1 -1
  67. package/dist/common/queue.js +4 -14
  68. package/dist/common/queue.js.map +1 -1
  69. package/dist/config.js +6 -6
  70. package/dist/config.js.map +1 -1
  71. package/dist/constants.js +173 -52
  72. package/dist/constants.js.map +1 -1
  73. package/dist/controls-options-manager/constants.js +14 -0
  74. package/dist/controls-options-manager/constants.js.map +1 -0
  75. package/dist/controls-options-manager/enums.js +25 -0
  76. package/dist/controls-options-manager/enums.js.map +1 -0
  77. package/dist/controls-options-manager/index.js +297 -0
  78. package/dist/controls-options-manager/index.js.map +1 -0
  79. package/dist/controls-options-manager/types.js +7 -0
  80. package/dist/controls-options-manager/types.js.map +1 -0
  81. package/dist/controls-options-manager/util.js +250 -0
  82. package/dist/controls-options-manager/util.js.map +1 -0
  83. package/dist/index.js +72 -17
  84. package/dist/index.js.map +1 -1
  85. package/dist/locus-info/controlsUtils.js +56 -29
  86. package/dist/locus-info/controlsUtils.js.map +1 -1
  87. package/dist/locus-info/embeddedAppsUtils.js +3 -26
  88. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  89. package/dist/locus-info/fullState.js +0 -15
  90. package/dist/locus-info/fullState.js.map +1 -1
  91. package/dist/locus-info/hostUtils.js +4 -12
  92. package/dist/locus-info/hostUtils.js.map +1 -1
  93. package/dist/locus-info/index.js +327 -211
  94. package/dist/locus-info/index.js.map +1 -1
  95. package/dist/locus-info/infoUtils.js +0 -38
  96. package/dist/locus-info/infoUtils.js.map +1 -1
  97. package/dist/locus-info/mediaSharesUtils.js +12 -38
  98. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  99. package/dist/locus-info/parser.js +88 -123
  100. package/dist/locus-info/parser.js.map +1 -1
  101. package/dist/locus-info/selfUtils.js +99 -91
  102. package/dist/locus-info/selfUtils.js.map +1 -1
  103. package/dist/media/index.js +62 -147
  104. package/dist/media/index.js.map +1 -1
  105. package/dist/media/properties.js +71 -117
  106. package/dist/media/properties.js.map +1 -1
  107. package/dist/media/util.js +2 -9
  108. package/dist/media/util.js.map +1 -1
  109. package/dist/mediaQualityMetrics/config.js +505 -495
  110. package/dist/mediaQualityMetrics/config.js.map +1 -1
  111. package/dist/meeting/in-meeting-actions.js +59 -14
  112. package/dist/meeting/in-meeting-actions.js.map +1 -1
  113. package/dist/meeting/index.js +2396 -2388
  114. package/dist/meeting/index.js.map +1 -1
  115. package/dist/meeting/muteState.js +252 -113
  116. package/dist/meeting/muteState.js.map +1 -1
  117. package/dist/meeting/request.js +318 -283
  118. package/dist/meeting/request.js.map +1 -1
  119. package/dist/meeting/request.type.js +7 -0
  120. package/dist/meeting/request.type.js.map +1 -0
  121. package/dist/meeting/state.js +21 -31
  122. package/dist/meeting/state.js.map +1 -1
  123. package/dist/meeting/util.js +58 -217
  124. package/dist/meeting/util.js.map +1 -1
  125. package/dist/meeting-info/collection.js +3 -25
  126. package/dist/meeting-info/collection.js.map +1 -1
  127. package/dist/meeting-info/index.js +10 -33
  128. package/dist/meeting-info/index.js.map +1 -1
  129. package/dist/meeting-info/meeting-info-v2.js +263 -282
  130. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  131. package/dist/meeting-info/request.js +1 -16
  132. package/dist/meeting-info/request.js.map +1 -1
  133. package/dist/meeting-info/util.js +98 -183
  134. package/dist/meeting-info/util.js.map +1 -1
  135. package/dist/meeting-info/utilv2.js +155 -232
  136. package/dist/meeting-info/utilv2.js.map +1 -1
  137. package/dist/meetings/collection.js +24 -20
  138. package/dist/meetings/collection.js.map +1 -1
  139. package/dist/meetings/index.js +675 -593
  140. package/dist/meetings/index.js.map +1 -1
  141. package/dist/meetings/request.js +23 -42
  142. package/dist/meetings/request.js.map +1 -1
  143. package/dist/meetings/util.js +177 -155
  144. package/dist/meetings/util.js.map +1 -1
  145. package/dist/member/index.js +80 -88
  146. package/dist/member/index.js.map +1 -1
  147. package/dist/member/types.js +15 -0
  148. package/dist/member/types.js.map +1 -0
  149. package/dist/member/util.js +90 -69
  150. package/dist/member/util.js.map +1 -1
  151. package/dist/members/collection.js +12 -12
  152. package/dist/members/collection.js.map +1 -1
  153. package/dist/members/index.js +162 -204
  154. package/dist/members/index.js.map +1 -1
  155. package/dist/members/request.js +58 -53
  156. package/dist/members/request.js.map +1 -1
  157. package/dist/members/types.js +15 -0
  158. package/dist/members/types.js.map +1 -0
  159. package/dist/members/util.js +107 -44
  160. package/dist/members/util.js.map +1 -1
  161. package/dist/metrics/config.js +5 -14
  162. package/dist/metrics/config.js.map +1 -1
  163. package/dist/metrics/constants.js +3 -7
  164. package/dist/metrics/constants.js.map +1 -1
  165. package/dist/metrics/index.js +61 -161
  166. package/dist/metrics/index.js.map +1 -1
  167. package/dist/multistream/mediaRequestManager.js +167 -50
  168. package/dist/multistream/mediaRequestManager.js.map +1 -1
  169. package/dist/multistream/receiveSlot.js +58 -65
  170. package/dist/multistream/receiveSlot.js.map +1 -1
  171. package/dist/multistream/receiveSlotManager.js +74 -93
  172. package/dist/multistream/receiveSlotManager.js.map +1 -1
  173. package/dist/multistream/remoteMedia.js +55 -74
  174. package/dist/multistream/remoteMedia.js.map +1 -1
  175. package/dist/multistream/remoteMediaGroup.js +6 -40
  176. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  177. package/dist/multistream/remoteMediaManager.js +466 -442
  178. package/dist/multistream/remoteMediaManager.js.map +1 -1
  179. package/dist/networkQualityMonitor/index.js +32 -59
  180. package/dist/networkQualityMonitor/index.js.map +1 -1
  181. package/dist/personal-meeting-room/index.js +10 -45
  182. package/dist/personal-meeting-room/index.js.map +1 -1
  183. package/dist/personal-meeting-room/request.js +2 -33
  184. package/dist/personal-meeting-room/request.js.map +1 -1
  185. package/dist/personal-meeting-room/util.js +0 -13
  186. package/dist/personal-meeting-room/util.js.map +1 -1
  187. package/dist/reachability/index.js +190 -199
  188. package/dist/reachability/index.js.map +1 -1
  189. package/dist/reachability/request.js +14 -23
  190. package/dist/reachability/request.js.map +1 -1
  191. package/dist/reactions/constants.js +13 -0
  192. package/dist/reactions/constants.js.map +1 -0
  193. package/dist/reactions/reactions.js +109 -0
  194. package/dist/reactions/reactions.js.map +1 -0
  195. package/dist/reactions/reactions.type.js +36 -0
  196. package/dist/reactions/reactions.type.js.map +1 -0
  197. package/dist/reconnection-manager/index.js +326 -465
  198. package/dist/reconnection-manager/index.js.map +1 -1
  199. package/dist/recording-controller/enums.js +17 -0
  200. package/dist/recording-controller/enums.js.map +1 -0
  201. package/dist/recording-controller/index.js +343 -0
  202. package/dist/recording-controller/index.js.map +1 -0
  203. package/dist/recording-controller/util.js +63 -0
  204. package/dist/recording-controller/util.js.map +1 -0
  205. package/dist/roap/index.js +38 -67
  206. package/dist/roap/index.js.map +1 -1
  207. package/dist/roap/request.js +143 -134
  208. package/dist/roap/request.js.map +1 -1
  209. package/dist/roap/turnDiscovery.js +149 -101
  210. package/dist/roap/turnDiscovery.js.map +1 -1
  211. package/dist/statsAnalyzer/global.js +1 -95
  212. package/dist/statsAnalyzer/global.js.map +1 -1
  213. package/dist/statsAnalyzer/index.js +369 -461
  214. package/dist/statsAnalyzer/index.js.map +1 -1
  215. package/dist/statsAnalyzer/mqaUtil.js +144 -94
  216. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  217. package/dist/transcription/index.js +13 -45
  218. package/dist/transcription/index.js.map +1 -1
  219. package/dist/types/annotation/annotation.types.d.ts +34 -0
  220. package/dist/types/annotation/constants.d.ts +31 -0
  221. package/dist/types/annotation/index.d.ts +124 -0
  222. package/dist/types/breakouts/breakout.d.ts +8 -0
  223. package/dist/types/breakouts/collection.d.ts +5 -0
  224. package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
  225. package/dist/types/breakouts/events.d.ts +2 -0
  226. package/dist/types/breakouts/index.d.ts +5 -0
  227. package/dist/types/breakouts/request.d.ts +22 -0
  228. package/dist/types/breakouts/utils.d.ts +15 -0
  229. package/dist/types/common/browser-detection.d.ts +9 -0
  230. package/dist/types/common/collection.d.ts +48 -0
  231. package/dist/types/common/config.d.ts +2 -0
  232. package/dist/types/common/errors/captcha-error.d.ts +15 -0
  233. package/dist/types/common/errors/intent-to-join.d.ts +16 -0
  234. package/dist/types/common/errors/join-meeting.d.ts +17 -0
  235. package/dist/types/common/errors/media.d.ts +15 -0
  236. package/dist/types/common/errors/parameter.d.ts +15 -0
  237. package/dist/types/common/errors/password-error.d.ts +15 -0
  238. package/dist/types/common/errors/permission.d.ts +14 -0
  239. package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
  240. package/dist/types/common/errors/reconnection.d.ts +15 -0
  241. package/dist/types/common/errors/stats.d.ts +15 -0
  242. package/dist/types/common/errors/webex-errors.d.ts +69 -0
  243. package/dist/types/common/errors/webex-meetings-error.d.ts +20 -0
  244. package/dist/types/common/events/events-scope.d.ts +17 -0
  245. package/dist/types/common/events/events.d.ts +12 -0
  246. package/dist/types/common/events/trigger-proxy.d.ts +2 -0
  247. package/dist/types/common/events/util.d.ts +2 -0
  248. package/dist/types/common/logs/logger-config.d.ts +2 -0
  249. package/dist/types/common/logs/logger-proxy.d.ts +2 -0
  250. package/dist/types/common/logs/request.d.ts +34 -0
  251. package/dist/types/common/queue.d.ts +32 -0
  252. package/dist/types/config.d.ts +78 -0
  253. package/dist/types/constants.d.ts +968 -0
  254. package/dist/types/controls-options-manager/constants.d.ts +4 -0
  255. package/dist/types/controls-options-manager/enums.d.ts +13 -0
  256. package/dist/types/controls-options-manager/index.d.ts +136 -0
  257. package/dist/types/controls-options-manager/types.d.ts +37 -0
  258. package/dist/types/controls-options-manager/util.d.ts +1 -0
  259. package/dist/types/index.d.ts +7 -0
  260. package/dist/types/locus-info/controlsUtils.d.ts +2 -0
  261. package/dist/types/locus-info/embeddedAppsUtils.d.ts +2 -0
  262. package/dist/types/locus-info/fullState.d.ts +2 -0
  263. package/dist/types/locus-info/hostUtils.d.ts +2 -0
  264. package/dist/types/locus-info/index.d.ts +315 -0
  265. package/dist/types/locus-info/infoUtils.d.ts +2 -0
  266. package/dist/types/locus-info/mediaSharesUtils.d.ts +2 -0
  267. package/dist/types/locus-info/parser.d.ts +212 -0
  268. package/dist/types/locus-info/selfUtils.d.ts +2 -0
  269. package/dist/types/media/index.d.ts +34 -0
  270. package/dist/types/media/properties.d.ts +108 -0
  271. package/dist/types/media/util.d.ts +2 -0
  272. package/dist/types/mediaQualityMetrics/config.d.ts +365 -0
  273. package/dist/types/meeting/in-meeting-actions.d.ts +129 -0
  274. package/dist/types/meeting/index.d.ts +1748 -0
  275. package/dist/types/meeting/muteState.d.ts +185 -0
  276. package/dist/types/meeting/request.d.ts +275 -0
  277. package/dist/types/meeting/request.type.d.ts +11 -0
  278. package/dist/types/meeting/state.d.ts +9 -0
  279. package/dist/types/meeting/util.d.ts +2 -0
  280. package/dist/types/meeting-info/collection.d.ts +20 -0
  281. package/dist/types/meeting-info/index.d.ts +57 -0
  282. package/dist/types/meeting-info/meeting-info-v2.d.ts +112 -0
  283. package/dist/types/meeting-info/request.d.ts +22 -0
  284. package/dist/types/meeting-info/util.d.ts +2 -0
  285. package/dist/types/meeting-info/utilv2.d.ts +2 -0
  286. package/dist/types/meetings/collection.d.ts +31 -0
  287. package/dist/types/meetings/index.d.ts +345 -0
  288. package/dist/types/meetings/request.d.ts +27 -0
  289. package/dist/types/meetings/util.d.ts +18 -0
  290. package/dist/types/member/index.d.ts +156 -0
  291. package/dist/types/member/types.d.ts +21 -0
  292. package/dist/types/member/util.d.ts +2 -0
  293. package/dist/types/members/collection.d.ts +29 -0
  294. package/dist/types/members/index.d.ts +353 -0
  295. package/dist/types/members/request.d.ts +69 -0
  296. package/dist/types/members/types.d.ts +24 -0
  297. package/dist/types/members/util.d.ts +2 -0
  298. package/dist/types/metrics/config.d.ts +172 -0
  299. package/dist/types/metrics/constants.d.ts +54 -0
  300. package/dist/types/metrics/index.d.ts +152 -0
  301. package/dist/types/multistream/mediaRequestManager.d.ts +101 -0
  302. package/dist/types/multistream/receiveSlot.d.ts +68 -0
  303. package/dist/types/multistream/receiveSlotManager.d.ts +56 -0
  304. package/dist/types/multistream/remoteMedia.d.ts +72 -0
  305. package/dist/types/multistream/remoteMediaGroup.d.ts +47 -0
  306. package/dist/types/multistream/remoteMediaManager.d.ts +263 -0
  307. package/dist/types/networkQualityMonitor/index.d.ts +70 -0
  308. package/dist/types/personal-meeting-room/index.d.ts +47 -0
  309. package/dist/types/personal-meeting-room/request.d.ts +14 -0
  310. package/dist/types/personal-meeting-room/util.d.ts +2 -0
  311. package/dist/types/reachability/index.d.ts +152 -0
  312. package/dist/types/reachability/request.d.ts +37 -0
  313. package/dist/types/reactions/constants.d.ts +3 -0
  314. package/dist/types/reactions/reactions.d.ts +4 -0
  315. package/dist/types/reactions/reactions.type.d.ts +52 -0
  316. package/dist/types/reconnection-manager/index.d.ts +126 -0
  317. package/dist/types/recording-controller/enums.d.ts +7 -0
  318. package/dist/types/recording-controller/index.d.ts +193 -0
  319. package/dist/types/recording-controller/util.d.ts +13 -0
  320. package/dist/types/roap/index.d.ts +77 -0
  321. package/dist/types/roap/request.d.ts +38 -0
  322. package/dist/types/roap/turnDiscovery.d.ts +88 -0
  323. package/dist/types/statsAnalyzer/global.d.ts +36 -0
  324. package/dist/types/statsAnalyzer/index.d.ts +200 -0
  325. package/dist/types/statsAnalyzer/mqaUtil.d.ts +24 -0
  326. package/dist/types/transcription/index.d.ts +64 -0
  327. package/internal-README.md +7 -6
  328. package/package.json +28 -21
  329. package/src/annotation/annotation.types.ts +41 -0
  330. package/src/annotation/constants.ts +36 -0
  331. package/src/annotation/index.ts +339 -0
  332. package/src/breakouts/README.md +219 -0
  333. package/src/breakouts/breakout.ts +141 -0
  334. package/src/breakouts/collection.ts +19 -0
  335. package/src/breakouts/edit-lock-error.ts +25 -0
  336. package/src/breakouts/events.ts +37 -0
  337. package/src/breakouts/index.ts +823 -0
  338. package/src/breakouts/request.ts +55 -0
  339. package/src/breakouts/utils.ts +57 -0
  340. package/src/common/browser-detection.ts +9 -6
  341. package/src/common/collection.ts +3 -1
  342. package/src/common/errors/captcha-error.ts +6 -6
  343. package/src/common/errors/intent-to-join.ts +6 -6
  344. package/src/common/errors/join-meeting.ts +12 -8
  345. package/src/common/errors/media.ts +6 -6
  346. package/src/common/errors/parameter.ts +9 -6
  347. package/src/common/errors/password-error.ts +6 -6
  348. package/src/common/errors/permission.ts +5 -5
  349. package/src/common/errors/reconnection.ts +6 -6
  350. package/src/common/errors/stats.ts +6 -6
  351. package/src/common/errors/webex-errors.ts +7 -5
  352. package/src/common/errors/webex-meetings-error.ts +1 -1
  353. package/src/common/events/events-scope.ts +5 -1
  354. package/src/common/events/events.ts +5 -1
  355. package/src/common/events/trigger-proxy.ts +8 -3
  356. package/src/common/events/util.ts +1 -2
  357. package/src/common/logs/logger-proxy.ts +21 -10
  358. package/src/common/logs/request.ts +11 -8
  359. package/src/config.ts +16 -12
  360. package/src/constants.ts +119 -6
  361. package/src/controls-options-manager/constants.ts +5 -0
  362. package/src/controls-options-manager/enums.ts +16 -0
  363. package/src/controls-options-manager/index.ts +278 -0
  364. package/src/controls-options-manager/types.ts +49 -0
  365. package/src/controls-options-manager/util.ts +229 -0
  366. package/src/index.ts +33 -0
  367. package/src/locus-info/controlsUtils.ts +91 -24
  368. package/src/locus-info/fullState.ts +15 -11
  369. package/src/locus-info/hostUtils.ts +4 -3
  370. package/src/locus-info/index.ts +270 -54
  371. package/src/locus-info/infoUtils.ts +12 -4
  372. package/src/locus-info/mediaSharesUtils.ts +4 -4
  373. package/src/locus-info/parser.ts +46 -68
  374. package/src/locus-info/selfUtils.ts +187 -56
  375. package/src/media/index.ts +142 -172
  376. package/src/media/properties.ts +43 -36
  377. package/src/media/util.ts +1 -1
  378. package/src/mediaQualityMetrics/config.ts +380 -378
  379. package/src/meeting/in-meeting-actions.ts +123 -3
  380. package/src/meeting/index.ts +2617 -1545
  381. package/src/meeting/muteState.ts +271 -68
  382. package/src/meeting/request.ts +251 -132
  383. package/src/meeting/request.type.ts +13 -0
  384. package/src/meeting/state.ts +45 -30
  385. package/src/meeting/util.ts +119 -110
  386. package/src/meeting-info/collection.ts +2 -1
  387. package/src/meeting-info/index.ts +32 -30
  388. package/src/meeting-info/meeting-info-v2.ts +181 -109
  389. package/src/meeting-info/request.ts +9 -3
  390. package/src/meeting-info/util.ts +54 -46
  391. package/src/meeting-info/utilv2.ts +70 -55
  392. package/src/meetings/collection.ts +21 -1
  393. package/src/meetings/index.ts +749 -437
  394. package/src/meetings/request.ts +29 -25
  395. package/src/meetings/util.ts +122 -33
  396. package/src/member/index.ts +86 -49
  397. package/src/member/types.ts +24 -0
  398. package/src/member/util.ts +92 -13
  399. package/src/members/collection.ts +8 -1
  400. package/src/members/index.ts +281 -129
  401. package/src/members/request.ts +87 -14
  402. package/src/members/types.ts +28 -0
  403. package/src/members/util.ts +140 -49
  404. package/src/metrics/config.ts +256 -90
  405. package/src/metrics/constants.ts +1 -6
  406. package/src/metrics/index.ts +96 -96
  407. package/src/multistream/mediaRequestManager.ts +203 -45
  408. package/src/multistream/receiveSlot.ts +69 -26
  409. package/src/multistream/receiveSlotManager.ts +62 -38
  410. package/src/multistream/remoteMedia.ts +30 -4
  411. package/src/multistream/remoteMediaGroup.ts +4 -3
  412. package/src/multistream/remoteMediaManager.ts +230 -66
  413. package/src/networkQualityMonitor/index.ts +24 -27
  414. package/src/personal-meeting-room/index.ts +12 -16
  415. package/src/personal-meeting-room/request.ts +10 -3
  416. package/src/personal-meeting-room/util.ts +3 -3
  417. package/src/reachability/index.ts +131 -79
  418. package/src/reachability/request.ts +43 -34
  419. package/src/reactions/constants.ts +4 -0
  420. package/src/reactions/reactions.ts +104 -0
  421. package/src/reactions/reactions.type.ts +62 -0
  422. package/src/reconnection-manager/index.ts +193 -111
  423. package/src/recording-controller/enums.ts +8 -0
  424. package/src/recording-controller/index.ts +315 -0
  425. package/src/recording-controller/util.ts +58 -0
  426. package/src/roap/index.ts +63 -51
  427. package/src/roap/request.ts +86 -53
  428. package/src/roap/turnDiscovery.ts +105 -46
  429. package/src/statsAnalyzer/global.ts +8 -104
  430. package/src/statsAnalyzer/index.ts +624 -376
  431. package/src/statsAnalyzer/mqaUtil.ts +203 -90
  432. package/src/transcription/index.ts +34 -32
  433. package/test/integration/spec/converged-space-meetings.js +177 -0
  434. package/test/integration/spec/journey.js +666 -464
  435. package/test/integration/spec/space-meeting.js +320 -204
  436. package/test/integration/spec/transcription.js +7 -8
  437. package/test/unit/spec/annotation/index.ts +435 -0
  438. package/test/unit/spec/breakouts/breakout.ts +184 -0
  439. package/test/unit/spec/breakouts/collection.ts +15 -0
  440. package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
  441. package/test/unit/spec/breakouts/events.ts +77 -0
  442. package/test/unit/spec/breakouts/index.ts +1504 -0
  443. package/test/unit/spec/breakouts/request.ts +104 -0
  444. package/test/unit/spec/breakouts/utils.js +72 -0
  445. package/test/unit/spec/common/browser-detection.js +9 -28
  446. package/test/unit/spec/controls-options-manager/index.js +287 -0
  447. package/test/unit/spec/controls-options-manager/util.js +403 -0
  448. package/test/unit/spec/fixture/locus.js +92 -90
  449. package/test/unit/spec/locus-info/controlsUtils.js +177 -32
  450. package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
  451. package/test/unit/spec/locus-info/index.js +493 -3
  452. package/test/unit/spec/locus-info/infoUtils.js +26 -33
  453. package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
  454. package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
  455. package/test/unit/spec/locus-info/parser.js +3 -9
  456. package/test/unit/spec/locus-info/selfConstant.js +110 -103
  457. package/test/unit/spec/locus-info/selfUtils.js +236 -12
  458. package/test/unit/spec/media/index.ts +104 -8
  459. package/test/unit/spec/media/properties.ts +9 -9
  460. package/test/unit/spec/meeting/in-meeting-actions.ts +58 -3
  461. package/test/unit/spec/meeting/index.js +2649 -837
  462. package/test/unit/spec/meeting/muteState.js +368 -70
  463. package/test/unit/spec/meeting/request.js +217 -43
  464. package/test/unit/spec/meeting/utils.js +146 -165
  465. package/test/unit/spec/meeting-info/meetinginfov2.js +268 -74
  466. package/test/unit/spec/meeting-info/request.js +7 -9
  467. package/test/unit/spec/meeting-info/util.js +11 -12
  468. package/test/unit/spec/meeting-info/utilv2.js +131 -74
  469. package/test/unit/spec/meetings/collection.js +15 -1
  470. package/test/unit/spec/meetings/index.js +1052 -329
  471. package/test/unit/spec/meetings/utils.js +163 -14
  472. package/test/unit/spec/member/index.js +24 -1
  473. package/test/unit/spec/member/util.js +359 -32
  474. package/test/unit/spec/members/index.js +402 -54
  475. package/test/unit/spec/members/request.js +76 -20
  476. package/test/unit/spec/members/utils.js +191 -4
  477. package/test/unit/spec/metrics/index.js +46 -20
  478. package/test/unit/spec/multistream/mediaRequestManager.ts +650 -105
  479. package/test/unit/spec/multistream/receiveSlot.ts +76 -17
  480. package/test/unit/spec/multistream/receiveSlotManager.ts +69 -39
  481. package/test/unit/spec/multistream/remoteMedia.ts +32 -2
  482. package/test/unit/spec/multistream/remoteMediaGroup.ts +5 -5
  483. package/test/unit/spec/multistream/remoteMediaManager.ts +549 -65
  484. package/test/unit/spec/networkQualityMonitor/index.js +24 -18
  485. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
  486. package/test/unit/spec/reachability/index.ts +176 -27
  487. package/test/unit/spec/reachability/request.js +66 -0
  488. package/test/unit/spec/reconnection-manager/index.js +62 -31
  489. package/test/unit/spec/recording-controller/index.js +231 -0
  490. package/test/unit/spec/recording-controller/util.js +102 -0
  491. package/test/unit/spec/roap/index.ts +21 -16
  492. package/test/unit/spec/roap/request.ts +217 -0
  493. package/test/unit/spec/roap/turnDiscovery.ts +93 -49
  494. package/test/unit/spec/stats-analyzer/index.js +116 -60
  495. package/test/utils/cmr.js +44 -42
  496. package/test/utils/constants.js +9 -0
  497. package/test/utils/integrationTestUtils.js +64 -0
  498. package/test/utils/testUtils.js +63 -99
  499. package/test/utils/webex-config.js +22 -18
  500. package/test/utils/webex-test-users.js +57 -50
  501. package/tsconfig.json +6 -0
  502. package/dist/media/internal-media-core-wrapper.js +0 -22
  503. package/dist/media/internal-media-core-wrapper.js.map +0 -1
  504. package/dist/meeting/effectsState.js +0 -334
  505. package/dist/meeting/effectsState.js.map +0 -1
  506. package/dist/multistream/multistreamMedia.js +0 -116
  507. package/dist/multistream/multistreamMedia.js.map +0 -1
  508. package/src/index.js +0 -15
  509. package/src/media/internal-media-core-wrapper.ts +0 -9
  510. package/src/meeting/effectsState.ts +0 -211
  511. package/src/multistream/multistreamMedia.ts +0 -92
  512. package/test/unit/spec/meeting/effectsState.js +0 -291
@@ -1,65 +1,38 @@
1
1
  "use strict";
2
2
 
3
3
  var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
-
5
4
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
6
-
7
5
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
8
-
9
6
  _Object$defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
-
13
9
  exports.default = void 0;
14
-
15
10
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
16
-
17
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
18
-
19
12
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
20
-
21
13
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
22
-
23
14
  var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
24
-
25
15
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
26
-
27
16
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
28
-
29
17
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
30
-
18
+ var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
19
+ var _assignWith2 = _interopRequireDefault(require("lodash/assignWith"));
31
20
  var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
32
-
33
21
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
34
-
35
22
  var _eventsScope = _interopRequireDefault(require("../common/events/events-scope"));
36
-
37
23
  var _constants = require("../constants");
38
-
39
24
  var _metrics = _interopRequireDefault(require("../metrics"));
40
-
41
25
  var _config = require("../metrics/config");
42
-
43
- var _infoUtils = _interopRequireDefault(require("../locus-info/infoUtils"));
44
-
45
- var _fullState = _interopRequireDefault(require("../locus-info/fullState"));
46
-
47
- var _selfUtils = _interopRequireDefault(require("../locus-info/selfUtils"));
48
-
49
- var _hostUtils = _interopRequireDefault(require("../locus-info/hostUtils"));
50
-
51
- var _controlsUtils = _interopRequireDefault(require("../locus-info/controlsUtils"));
52
-
53
- var _embeddedAppsUtils = _interopRequireDefault(require("../locus-info/embeddedAppsUtils"));
54
-
55
- var _mediaSharesUtils = _interopRequireDefault(require("../locus-info/mediaSharesUtils"));
56
-
57
- var _parser = _interopRequireDefault(require("../locus-info/parser"));
58
-
26
+ var _infoUtils = _interopRequireDefault(require("./infoUtils"));
27
+ var _fullState = _interopRequireDefault(require("./fullState"));
28
+ var _selfUtils = _interopRequireDefault(require("./selfUtils"));
29
+ var _hostUtils = _interopRequireDefault(require("./hostUtils"));
30
+ var _controlsUtils = _interopRequireDefault(require("./controlsUtils"));
31
+ var _embeddedAppsUtils = _interopRequireDefault(require("./embeddedAppsUtils"));
32
+ var _mediaSharesUtils = _interopRequireDefault(require("./mediaSharesUtils"));
33
+ var _parser = _interopRequireDefault(require("./parser"));
59
34
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
60
-
61
35
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
62
-
63
36
  /**
64
37
  * @description LocusInfo extends ChildEmitter to convert locusInfo info a private emitter to parent object
65
38
  * @export
@@ -68,12 +41,16 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
68
41
  */
69
42
  var LocusInfo = /*#__PURE__*/function (_EventsScope) {
70
43
  (0, _inherits2.default)(LocusInfo, _EventsScope);
71
-
72
44
  var _super = _createSuper(LocusInfo);
73
-
45
+ /**
46
+ * Constructor
47
+ * @param {boolean} updateMeeting true if the meeting should be updated
48
+ * @param {object} webex
49
+ * @param {string} meetingId
50
+ * @returns {undefined}
51
+ */
74
52
  function LocusInfo(updateMeeting, webex, meetingId) {
75
53
  var _this;
76
-
77
54
  (0, _classCallCheck2.default)(this, LocusInfo);
78
55
  _this = _super.call(this);
79
56
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "compareAndUpdateFlags", void 0);
@@ -100,9 +77,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
100
77
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "fullState", void 0);
101
78
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "host", void 0);
102
79
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "info", void 0);
80
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "roles", void 0);
103
81
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaShares", void 0);
104
82
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "replace", void 0);
105
83
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "url", void 0);
84
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "services", void 0);
85
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mainSessionLocusCache", void 0);
106
86
  _this.parsedLocus = {
107
87
  states: []
108
88
  };
@@ -114,6 +94,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
114
94
  _this.locusParser = new _parser.default();
115
95
  return _this;
116
96
  }
97
+
117
98
  /**
118
99
  * Apply locus delta data to meeting
119
100
  * @param {string} action Locus delta action
@@ -121,45 +102,38 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
121
102
  * @param {Meeting} meeting
122
103
  * @returns {undefined}
123
104
  */
124
-
125
-
126
105
  (0, _createClass2.default)(LocusInfo, [{
127
106
  key: "applyLocusDeltaData",
128
107
  value: function applyLocusDeltaData(action, locus, meeting) {
129
108
  var _this2 = this;
130
-
131
109
  var _LocusDeltaParser$loc = _parser.default.loci,
132
- DESYNC = _LocusDeltaParser$loc.DESYNC,
133
- USE_CURRENT = _LocusDeltaParser$loc.USE_CURRENT,
134
- USE_INCOMING = _LocusDeltaParser$loc.USE_INCOMING;
135
-
110
+ DESYNC = _LocusDeltaParser$loc.DESYNC,
111
+ USE_CURRENT = _LocusDeltaParser$loc.USE_CURRENT,
112
+ USE_INCOMING = _LocusDeltaParser$loc.USE_INCOMING;
136
113
  switch (action) {
137
114
  case USE_INCOMING:
138
115
  meeting.locusInfo.onDeltaLocus(locus);
139
116
  break;
140
-
141
117
  case USE_CURRENT:
142
118
  meeting.locusDesync = false;
143
119
  meeting.needToGetFullLocus = false;
144
120
  break;
145
-
146
121
  case DESYNC:
147
122
  meeting.meetingRequest.getFullLocus({
148
123
  desync: true,
149
124
  locusUrl: meeting.locusUrl
150
125
  }).then(function (res) {
151
- meeting.locusInfo.onFullLocus(res.body); // Notify parser to resume processing delta events
126
+ meeting.locusInfo.onFullLocus(res.body);
127
+ // Notify parser to resume processing delta events
152
128
  // now that we have full locus from DESYNC.
153
-
154
129
  _this2.locusParser.resume();
155
130
  });
156
131
  break;
157
-
158
132
  default:
159
133
  _loggerProxy.default.logger.info("Locus-info:index#applyLocusDeltaData --> Unknown locus delta action: ".concat(action));
160
-
161
134
  }
162
135
  }
136
+
163
137
  /**
164
138
  * Adds locus delta to parser's queue
165
139
  * and registers a function handler
@@ -168,12 +142,10 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
168
142
  * @param {Meeting} meeting
169
143
  * @returns {undefined}
170
144
  */
171
-
172
145
  }, {
173
146
  key: "handleLocusDelta",
174
147
  value: function handleLocusDelta(locus, meeting) {
175
148
  var _this3 = this;
176
-
177
149
  // register a function to process delta actions
178
150
  if (!this.locusParser.onDeltaAction) {
179
151
  // delta action, along with associated loci
@@ -181,20 +153,20 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
181
153
  this.locusParser.onDeltaAction = function (action, parsedLoci) {
182
154
  _this3.applyLocusDeltaData(action, parsedLoci, meeting);
183
155
  };
184
- } // queue delta event with parser
185
-
186
-
156
+ }
157
+ // queue delta event with parser
187
158
  this.locusParser.onDeltaEvent(locus);
188
159
  }
160
+
189
161
  /**
190
162
  * @param {Locus} locus
191
163
  * @returns {undefined}
192
164
  * @memberof LocusInfo
193
165
  */
194
-
195
166
  }, {
196
167
  key: "init",
197
168
  value: function init() {
169
+ var _locus$links;
198
170
  var locus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
199
171
  this.created = locus.created || null;
200
172
  this.scheduledMeeting = locus.meeting || null;
@@ -206,6 +178,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
206
178
  this.membership = locus.membership || null;
207
179
  this.identities = locus.identities || null;
208
180
  this.participants = locus.participants || null;
181
+
209
182
  /**
210
183
  * Stores the delta values for a changed participant.
211
184
  *
@@ -223,50 +196,53 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
223
196
  * @private
224
197
  * @member LocusInfo
225
198
  */
226
-
227
- this.deltaParticipants = []; // above section only updates the locusInfo object
199
+ this.deltaParticipants = [];
200
+ this.updateLocusCache(locus);
201
+ // above section only updates the locusInfo object
228
202
  // The below section makes sure it updates the locusInfo as well as updates the meeting object
229
-
230
- this.updateParticipants(locus.participants); // For 1:1 space meeting the conversation Url does not exist in locus.conversation
231
-
203
+ this.updateParticipants(locus.participants);
204
+ // For 1:1 space meeting the conversation Url does not exist in locus.conversation
232
205
  this.updateConversationUrl(locus.conversationUrl, locus.info);
233
- this.updateControls(locus.controls);
206
+ this.updateControls(locus.controls, locus.self);
234
207
  this.updateLocusUrl(locus.url);
235
208
  this.updateFullState(locus.fullState);
236
209
  this.updateMeetingInfo(locus.info);
237
- this.updateEmbeddedApps(locus.embeddedApps); // self and participants generate sipUrl for 1:1 meeting
238
-
210
+ this.updateEmbeddedApps(locus.embeddedApps);
211
+ // self and participants generate sipUrl for 1:1 meeting
239
212
  this.updateSelf(locus.self, locus.participants);
240
213
  this.updateHostInfo(locus.host);
241
214
  this.updateMediaShares(locus.mediaShares);
215
+ this.updateServices((_locus$links = locus.links) === null || _locus$links === void 0 ? void 0 : _locus$links.services);
242
216
  }
217
+
243
218
  /**
244
219
  * @param {Object} locus
245
220
  * @returns {undefined}
246
221
  * @memberof LocusInfo
247
222
  */
248
-
249
223
  }, {
250
224
  key: "initialSetup",
251
225
  value: function initialSetup(locus) {
252
- this.onFullLocus(locus); // Change it to true after it receives it first locus object
226
+ this.updateLocusCache(locus);
227
+ this.onFullLocus(locus);
253
228
 
229
+ // Change it to true after it receives it first locus object
254
230
  this.emitChange = true;
255
231
  }
232
+
256
233
  /**
257
234
  * @param {Meeting} meeting
258
235
  * @param {Object} data
259
236
  * @returns {undefined}
260
237
  * @memberof LocusInfo
261
238
  */
262
-
263
239
  }, {
264
240
  key: "parse",
265
241
  value: function parse(meeting, data) {
242
+ // eslint-disable-next-line @typescript-eslint/no-shadow
266
243
  var eventType = data.eventType;
267
-
244
+ var locus = this.getTheLocusToUpdate(data.locus);
268
245
  _loggerProxy.default.logger.info("Locus-info:index#parse --> received locus data: ".concat(eventType));
269
-
270
246
  switch (eventType) {
271
247
  case _constants.LOCUSEVENT.PARTICIPANT_JOIN:
272
248
  case _constants.LOCUSEVENT.PARTICIPANT_LEFT:
@@ -282,19 +258,18 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
282
258
  case _constants.LOCUSEVENT.PARTICIPANT_DECLINED:
283
259
  case _constants.LOCUSEVENT.FLOOR_GRANTED:
284
260
  case _constants.LOCUSEVENT.FLOOR_RELEASED:
285
- this.onFullLocus(data.locus, eventType);
261
+ this.onFullLocus(locus, eventType);
286
262
  break;
287
-
288
263
  case _constants.LOCUSEVENT.DIFFERENCE:
289
- this.handleLocusDelta(data.locus, meeting);
264
+ this.handleLocusDelta(locus, meeting);
290
265
  break;
291
-
292
266
  default:
293
267
  // Why will there be a event with no eventType ????
294
268
  // we may not need this, we can get full locus
295
- this.handleLocusDelta(data.locus, meeting);
269
+ this.handleLocusDelta(locus, meeting);
296
270
  }
297
271
  }
272
+
298
273
  /**
299
274
  * @param {String} scope
300
275
  * @param {String} eventName
@@ -302,12 +277,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
302
277
  * @returns {undefined}
303
278
  * @memberof LocusInfo
304
279
  */
305
-
306
280
  }, {
307
281
  key: "emitScoped",
308
282
  value: function emitScoped(scope, eventName, args) {
309
283
  return this.emit(scope, eventName, args);
310
284
  }
285
+
311
286
  /**
312
287
  * updates the locus with full locus object
313
288
  * @param {object} locus locus object
@@ -315,32 +290,33 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
315
290
  * @returns {object} null
316
291
  * @memberof LocusInfo
317
292
  */
318
-
293
+ // eslint-disable-next-line @typescript-eslint/no-shadow
319
294
  }, {
320
295
  key: "onFullLocus",
321
296
  value: function onFullLocus(locus, eventType) {
322
297
  if (!locus) {
323
298
  _loggerProxy.default.logger.error('Locus-info:index#onFullLocus --> object passed as argument was invalid, continuing.');
324
299
  }
325
-
326
300
  this.updateParticipantDeltas(locus.participants);
327
301
  this.scheduledMeeting = locus.meeting || null;
328
302
  this.participants = locus.participants;
303
+ var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
329
304
  this.updateLocusInfo(locus);
330
- this.updateParticipants(locus.participants);
305
+ this.updateParticipants(locus.participants, isReplaceMembers);
331
306
  this.isMeetingActive();
332
307
  this.handleOneOnOneEvent(eventType);
333
- this.updateEmbeddedApps(locus.embeddedApps); // set current (working copy) for parser
334
-
308
+ this.updateEmbeddedApps(locus.embeddedApps);
309
+ // set current (working copy) for parser
335
310
  this.locusParser.workingCopy = locus;
336
- } // used for ringing stops on one on one
311
+ }
337
312
 
313
+ // used for ringing stops on one on one
338
314
  /**
339
315
  * @param {String} eventType
340
316
  * @returns {undefined}
341
317
  * @memberof LocusInfo
342
318
  */
343
-
319
+ // eslint-disable-next-line @typescript-eslint/no-shadow
344
320
  }, {
345
321
  key: "handleOneOnOneEvent",
346
322
  value: function handleOneOnOneEvent(eventType) {
@@ -355,9 +331,8 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
355
331
  remoteDeclined: true,
356
332
  remoteAnswered: false
357
333
  });
358
- } // for 1:1 bob calls alice and alice answers, notify the meeting state
359
-
360
-
334
+ }
335
+ // for 1:1 bob calls alice and alice answers, notify the meeting state
361
336
  if (eventType === _constants.LOCUSEVENT.PARTICIPANT_JOIN) {
362
337
  // trigger the event for stop ringing
363
338
  this.emitScoped({
@@ -370,29 +345,37 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
370
345
  }
371
346
  }
372
347
  }
348
+
373
349
  /**
374
350
  * @param {Object} locus
375
351
  * @returns {undefined}
376
352
  * @memberof LocusInfo
377
353
  */
378
-
379
354
  }, {
380
355
  key: "onDeltaLocus",
381
356
  value: function onDeltaLocus(locus) {
357
+ var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
382
358
  this.updateLocusInfo(locus);
383
- this.updateParticipants(locus.participants);
359
+ this.updateParticipants(locus.participants, isReplaceMembers);
384
360
  this.isMeetingActive();
385
361
  }
362
+
386
363
  /**
387
364
  * @param {Object} locus
388
365
  * @returns {undefined}
389
366
  * @memberof LocusInfo
390
367
  */
391
-
392
368
  }, {
393
369
  key: "updateLocusInfo",
394
370
  value: function updateLocusInfo(locus) {
395
- this.updateControls(locus.controls);
371
+ var _locus$self, _locus$self2, _locus$links2;
372
+ if (((_locus$self = locus.self) === null || _locus$self === void 0 ? void 0 : _locus$self.reason) === 'MOVED' && ((_locus$self2 = locus.self) === null || _locus$self2 === void 0 ? void 0 : _locus$self2.state) === 'LEFT') {
373
+ // When moved to a breakout session locus sends a message for the previous locus
374
+ // indicating that we have been moved. It isn't helpful to continue parsing this
375
+ // as it gets interpreted as if we have left the call
376
+ return;
377
+ }
378
+ this.updateControls(locus.controls, locus.self);
396
379
  this.updateConversationUrl(locus.conversationUrl, locus.info);
397
380
  this.updateCreated(locus.created);
398
381
  this.updateFullState(locus.fullState);
@@ -409,33 +392,35 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
409
392
  this.updateMemberShip(locus.membership);
410
393
  this.updateIdentifiers(locus.identities);
411
394
  this.updateEmbeddedApps(locus.embeddedApps);
412
- this.compareAndUpdate(); // update which required to compare different objects from locus
395
+ this.updateServices((_locus$links2 = locus.links) === null || _locus$links2 === void 0 ? void 0 : _locus$links2.services);
396
+ this.compareAndUpdate();
397
+ // update which required to compare different objects from locus
413
398
  }
399
+
414
400
  /**
415
401
  * @param {Array} participants
416
402
  * @param {Object} self
417
403
  * @returns {Array}
418
404
  * @memberof LocusInfo
419
405
  */
420
-
421
406
  }, {
422
407
  key: "getLocusPartner",
423
408
  value: function getLocusPartner(participants, self) {
424
409
  if (!participants || participants.length === 0) {
425
410
  return null;
426
411
  }
427
-
428
412
  return participants.find(function (participant) {
429
413
  return self && participant.identity !== self.identity && (participants.length <= 2 || participant.type === _constants._USER_ && !participant.removed);
430
- } // @ts-ignore
414
+ }
415
+ // @ts-ignore
431
416
  ) || this.partner;
432
- } // TODO: all the leave states need to be checked
417
+ }
433
418
 
419
+ // TODO: all the leave states need to be checked
434
420
  /**
435
421
  * @returns {undefined}
436
422
  * @memberof LocusInfo
437
423
  */
438
-
439
424
  }, {
440
425
  key: "isMeetingActive",
441
426
  value: function isMeetingActive() {
@@ -444,20 +429,22 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
444
429
  var partner = this.getLocusPartner(this.participants, this.self);
445
430
  this.updateMeeting({
446
431
  partner: partner
447
- }); // Check if guest user needs to be checked here
432
+ });
433
+
434
+ // Check if guest user needs to be checked here
435
+
448
436
  // 1) when bob declines call from bob, (bob='DECLINED')
449
437
  // 2) When alice rejects call to bob , (bob='NOTIFIED')
438
+
450
439
  // When we dont add MEDIA for condition 2. The state of bob='IDLE'
451
440
 
452
441
  if (this.fullState && this.fullState.state === _constants.LOCUS.STATE.INACTIVE) {
453
442
  // TODO: update the meeting state
454
443
  _loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Call Ended, locus state is inactive.');
455
-
456
444
  _metrics.default.postEvent({
457
445
  event: _config.eventType.REMOTE_ENDED,
458
446
  meetingId: this.meetingId
459
447
  });
460
-
461
448
  this.emitScoped({
462
449
  file: 'locus-info',
463
450
  function: 'isMeetingActive'
@@ -470,7 +457,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
470
457
  event: _config.eventType.REMOTE_ENDED,
471
458
  meetingId: this.meetingId
472
459
  });
473
-
474
460
  this.emitScoped({
475
461
  file: 'locus-info',
476
462
  function: 'isMeetingActive'
@@ -484,7 +470,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
484
470
  event: _config.eventType.REMOTE_ENDED,
485
471
  meetingId: this.meetingId
486
472
  });
487
-
488
473
  this.emitScoped({
489
474
  file: 'locus-info',
490
475
  function: 'isMeetingActive'
@@ -494,15 +479,14 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
494
479
  });
495
480
  }
496
481
  } else if (this.parsedLocus.fullState.type === _constants._MEETING_) {
497
- if (this.fullState && (this.fullState.state === _constants.LOCUS.STATE.INACTIVE || // @ts-ignore
482
+ if (this.fullState && (this.fullState.state === _constants.LOCUS.STATE.INACTIVE ||
483
+ // @ts-ignore
498
484
  this.fullState.state === _constants.LOCUS.STATE.TERMINATING)) {
499
485
  _loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Meeting is ending due to inactive or terminating');
500
-
501
486
  _metrics.default.postEvent({
502
487
  event: _config.eventType.REMOTE_ENDED,
503
488
  meetingId: this.meetingId
504
489
  });
505
-
506
490
  this.emitScoped({
507
491
  file: 'locus-info',
508
492
  function: 'isMeetingActive'
@@ -516,7 +500,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
516
500
  event: _config.eventType.REMOTE_ENDED,
517
501
  meetingId: this.meetingId
518
502
  });
519
-
520
503
  this.emitScoped({
521
504
  file: 'locus-info',
522
505
  function: 'isMeetingActive'
@@ -524,7 +507,8 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
524
507
  reason: _constants.MEETING_REMOVED_REASON.FULLSTATE_REMOVED,
525
508
  shouldLeave: false
526
509
  });
527
- } // If you are guest and you are removed from the meeting
510
+ }
511
+ // If you are guest and you are removed from the meeting
528
512
  // You wont get any further events
529
513
  else if (this.parsedLocus.self && this.parsedLocus.self.removed) {
530
514
  // Check if we need to send an event
@@ -540,13 +524,13 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
540
524
  _loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Meeting Type is unknown.');
541
525
  }
542
526
  }
527
+
543
528
  /**
544
529
  * checks if the host permissions have changed while in the meeting
545
530
  * This would be the case if your role as host or moderator has been updated
546
531
  * @returns {undefined}
547
532
  * @memberof LocusInfo
548
533
  */
549
-
550
534
  }, {
551
535
  key: "compareAndUpdate",
552
536
  value: function compareAndUpdate() {
@@ -556,17 +540,16 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
556
540
  this.compareSelfAndHost();
557
541
  }
558
542
  }
543
+
559
544
  /**
560
545
  * compared the self object to check if the user has host permissions
561
546
  * @returns {undefined}
562
547
  * @memberof LocusInfo
563
548
  */
564
-
565
549
  }, {
566
550
  key: "compareSelfAndHost",
567
551
  value: function compareSelfAndHost() {
568
552
  var _this$parsedLocus$hos;
569
-
570
553
  // In some cases the host info is not present but the moderator values changes from null to false so it triggers an update
571
554
  if (this.parsedLocus.self.selfIdentity === ((_this$parsedLocus$hos = this.parsedLocus.host) === null || _this$parsedLocus$hos === void 0 ? void 0 : _this$parsedLocus$hos.hostId) && this.parsedLocus.self.moderator) {
572
555
  this.emitScoped({
@@ -584,6 +567,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
584
567
  });
585
568
  }
586
569
  }
570
+
587
571
  /**
588
572
  * Update the deltaParticipants property of this object based on a list of
589
573
  * provided participants.
@@ -591,22 +575,19 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
591
575
  * @param {Array} [participants] - The participants to update against.
592
576
  * @returns {void}
593
577
  */
594
-
595
578
  }, {
596
579
  key: "updateParticipantDeltas",
597
580
  value: function updateParticipantDeltas() {
598
581
  var _this4 = this;
599
-
600
582
  var participants = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
601
-
602
583
  // Used to find a participant within a participants collection.
603
584
  var findParticipant = function findParticipant(participant, collection) {
604
585
  return collection.find(function (item) {
605
586
  return item.person.id === participant.person.id;
606
587
  });
607
- }; // Generates an object that indicates which state properties have changed.
608
-
588
+ };
609
589
 
590
+ // Generates an object that indicates which state properties have changed.
610
591
  var generateDelta = function generateDelta() {
611
592
  var prevState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
612
593
  var newState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -615,8 +596,9 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
615
596
  audioStatus: prevState.audioStatus !== newState.audioStatus,
616
597
  videoSlidesStatus: prevState.videoSlidesStatus !== newState.videoSlidesStatus,
617
598
  videoStatus: prevState.videoStatus !== newState.videoStatus
618
- }; // Clean the object
599
+ };
619
600
 
601
+ // Clean the object
620
602
  (0, _keys.default)(deltas).forEach(function (key) {
621
603
  if (deltas[key] !== true) {
622
604
  delete deltas[key];
@@ -624,35 +606,31 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
624
606
  });
625
607
  return deltas;
626
608
  };
627
-
628
609
  this.deltaParticipants = participants.reduce(function (collection, participant) {
629
610
  var existingParticipant = findParticipant(participant, _this4.participants || []) || {};
630
611
  var delta = generateDelta(existingParticipant.status, participant.status);
631
612
  var changed = (0, _keys.default)(delta).length > 0;
632
-
633
613
  if (changed) {
634
614
  collection.push({
635
615
  person: participant.person,
636
616
  delta: delta
637
617
  });
638
618
  }
639
-
640
619
  return collection;
641
620
  }, []);
642
621
  }
622
+
643
623
  /**
644
- *
624
+ * update meeting's members
645
625
  * @param {Object} participants new participants object
646
- * @param {boolen} deltaParticpantFlag delta event
626
+ * @param {Boolean} isReplace is replace the whole members
647
627
  * @returns {Array} updatedParticipants
648
628
  * @memberof LocusInfo
649
629
  */
650
-
651
630
  }, {
652
631
  key: "updateParticipants",
653
- value: function updateParticipants(participants) {
632
+ value: function updateParticipants(participants, isReplace) {
654
633
  var _this$parsedLocus$con;
655
-
656
634
  this.emitScoped({
657
635
  file: 'locus-info',
658
636
  function: 'updateParticipants'
@@ -661,33 +639,34 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
661
639
  recordingId: this.parsedLocus.controls && ((_this$parsedLocus$con = this.parsedLocus.controls.record) === null || _this$parsedLocus$con === void 0 ? void 0 : _this$parsedLocus$con.modifiedBy),
662
640
  selfIdentity: this.parsedLocus.self && this.parsedLocus.self.selfIdentity,
663
641
  selfId: this.parsedLocus.self && this.parsedLocus.self.selfId,
664
- hostId: this.parsedLocus.host && this.parsedLocus.host.hostId
642
+ hostId: this.parsedLocus.host && this.parsedLocus.host.hostId,
643
+ isReplace: isReplace
665
644
  });
666
645
  }
646
+
667
647
  /**
668
648
  * @param {Object} controls
649
+ * @param {Object} self
669
650
  * @returns {undefined}
670
651
  * @memberof LocusInfo
671
652
  */
672
-
673
653
  }, {
674
654
  key: "updateControls",
675
- value: function updateControls(controls) {
655
+ value: function updateControls(controls, self) {
676
656
  if (controls && !(0, _isEqual2.default)(this.controls, controls)) {
677
657
  this.parsedLocus.controls = _controlsUtils.default.parse(controls);
678
-
679
658
  var _ControlsUtils$getCon = _controlsUtils.default.getControls(this.controls, controls),
680
- _ControlsUtils$getCon2 = _ControlsUtils$getCon.updates,
681
- hasRecordingChanged = _ControlsUtils$getCon2.hasRecordingChanged,
682
- hasRecordingPausedChanged = _ControlsUtils$getCon2.hasRecordingPausedChanged,
683
- hasMeetingContainerChanged = _ControlsUtils$getCon2.hasMeetingContainerChanged,
684
- hasTranscribeChanged = _ControlsUtils$getCon2.hasTranscribeChanged,
685
- hasEntryExitToneChanged = _ControlsUtils$getCon2.hasEntryExitToneChanged,
686
- current = _ControlsUtils$getCon.current;
687
-
659
+ _ControlsUtils$getCon2 = _ControlsUtils$getCon.updates,
660
+ hasRecordingChanged = _ControlsUtils$getCon2.hasRecordingChanged,
661
+ hasRecordingPausedChanged = _ControlsUtils$getCon2.hasRecordingPausedChanged,
662
+ hasMeetingContainerChanged = _ControlsUtils$getCon2.hasMeetingContainerChanged,
663
+ hasTranscribeChanged = _ControlsUtils$getCon2.hasTranscribeChanged,
664
+ hasEntryExitToneChanged = _ControlsUtils$getCon2.hasEntryExitToneChanged,
665
+ hasBreakoutChanged = _ControlsUtils$getCon2.hasBreakoutChanged,
666
+ hasVideoEnabledChanged = _ControlsUtils$getCon2.hasVideoEnabledChanged,
667
+ current = _ControlsUtils$getCon.current;
688
668
  if (hasRecordingChanged || hasRecordingPausedChanged) {
689
669
  var state = null;
690
-
691
670
  if (hasRecordingPausedChanged) {
692
671
  if (current.record.paused) {
693
672
  state = _constants.RECORDING_STATE.PAUSED;
@@ -698,7 +677,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
698
677
  } else if (hasRecordingChanged) {
699
678
  state = current.record.recording ? _constants.RECORDING_STATE.RECORDING : _constants.RECORDING_STATE.IDLE;
700
679
  }
701
-
702
680
  this.emitScoped({
703
681
  file: 'locus-info',
704
682
  function: 'updateControls'
@@ -708,7 +686,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
708
686
  lastModified: current.record.lastModified
709
687
  });
710
688
  }
711
-
712
689
  if (hasMeetingContainerChanged) {
713
690
  var meetingContainerUrl = current.meetingContainer.meetingContainerUrl;
714
691
  this.emitScoped({
@@ -718,11 +695,10 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
718
695
  meetingContainerUrl: meetingContainerUrl
719
696
  });
720
697
  }
721
-
722
698
  if (hasTranscribeChanged) {
723
699
  var _current$transcribe = current.transcribe,
724
- transcribing = _current$transcribe.transcribing,
725
- caption = _current$transcribe.caption;
700
+ transcribing = _current$transcribe.transcribing,
701
+ caption = _current$transcribe.caption;
726
702
  this.emitScoped({
727
703
  file: 'locus-info',
728
704
  function: 'updateControls'
@@ -731,30 +707,54 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
731
707
  caption: caption
732
708
  });
733
709
  }
734
-
710
+ if (hasBreakoutChanged) {
711
+ var breakout = current.breakout;
712
+ breakout.breakoutMoveId = _selfUtils.default.getReplacedBreakoutMoveId(self, this.webex.internal.device.url);
713
+ this.emitScoped({
714
+ file: 'locus-info',
715
+ function: 'updateControls'
716
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_MEETING_BREAKOUT_UPDATED, {
717
+ breakout: breakout
718
+ });
719
+ }
735
720
  if (hasEntryExitToneChanged) {
736
721
  var entryExitTone = current.entryExitTone;
722
+ this.updateMeeting({
723
+ entryExitTone: entryExitTone
724
+ });
737
725
  this.emitScoped({
738
726
  file: 'locus-info',
739
727
  function: 'updateControls'
740
728
  }, _constants.LOCUSINFO.EVENTS.CONTROLS_ENTRY_EXIT_TONE_UPDATED, {
741
729
  entryExitTone: entryExitTone
742
730
  });
731
+ }
732
+
733
+ // videoEnabled is handled differently than other controls,
734
+ // to fit with audio mute status logic
735
+ if (hasVideoEnabledChanged) {
736
+ var videoEnabled = current.videoEnabled;
743
737
  this.updateMeeting({
744
- entryExitTone: entryExitTone
738
+ unmuteVideoAllowed: videoEnabled
739
+ });
740
+ this.emitScoped({
741
+ file: 'locus-info',
742
+ function: 'updateControls'
743
+ }, _constants.LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED, {
744
+ // muted: not part of locus.controls
745
+ unmuteAllowed: videoEnabled
745
746
  });
746
747
  }
747
-
748
748
  this.controls = controls;
749
749
  }
750
750
  }
751
+
751
752
  /**
752
753
  * @param {String} conversationUrl
753
754
  * @param {Object} info
754
755
  * @returns {undefined}
755
756
  * @memberof LocusInfo
756
757
  */
757
-
758
758
  }, {
759
759
  key: "updateConversationUrl",
760
760
  value: function updateConversationUrl(conversationUrl, info) {
@@ -770,12 +770,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
770
770
  });
771
771
  }
772
772
  }
773
+
773
774
  /**
774
775
  * @param {Object} created
775
776
  * @returns {undefined}
776
777
  * @memberof LocusInfo
777
778
  */
778
-
779
779
  }, {
780
780
  key: "updateCreated",
781
781
  value: function updateCreated(created) {
@@ -783,20 +783,37 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
783
783
  this.created = created;
784
784
  }
785
785
  }
786
+
786
787
  /**
787
- * @param {Object} fullState
788
+ * @param {Object} services
788
789
  * @returns {undefined}
789
790
  * @memberof LocusInfo
790
791
  */
792
+ }, {
793
+ key: "updateServices",
794
+ value: function updateServices(services) {
795
+ if (services && !(0, _isEqual2.default)(this.services, services)) {
796
+ this.services = services;
797
+ this.emitScoped({
798
+ file: 'locus-info',
799
+ function: 'updateServices'
800
+ }, _constants.LOCUSINFO.EVENTS.LINKS_SERVICES, {
801
+ services: services
802
+ });
803
+ }
804
+ }
791
805
 
806
+ /**
807
+ * @param {Object} fullState
808
+ * @returns {undefined}
809
+ * @memberof LocusInfo
810
+ */
792
811
  }, {
793
812
  key: "updateFullState",
794
813
  value: function updateFullState(fullState) {
795
814
  if (fullState && !(0, _isEqual2.default)(this.fullState, fullState)) {
796
815
  var result = _fullState.default.getFullState(this.fullState, fullState);
797
-
798
816
  this.updateMeeting(result.current);
799
-
800
817
  if (result.updates.meetingStateChangedTo) {
801
818
  this.emitScoped({
802
819
  file: 'locus-info',
@@ -806,7 +823,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
806
823
  currentState: result.current.meetingState
807
824
  });
808
825
  }
809
-
810
826
  if (result.updates.meetingTypeChangedTo) {
811
827
  this.emitScoped({
812
828
  file: 'locus-info',
@@ -815,11 +831,11 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
815
831
  type: result.current.type
816
832
  });
817
833
  }
818
-
819
834
  this.parsedLocus.fullState = result.current;
820
835
  this.fullState = fullState;
821
836
  }
822
837
  }
838
+
823
839
  /**
824
840
  * handles when the locus.host is updated
825
841
  * @param {Object} host the locus.host property
@@ -827,16 +843,13 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
827
843
  * @memberof LocusInfo
828
844
  * emits internal event locus_info_update_host
829
845
  */
830
-
831
846
  }, {
832
847
  key: "updateHostInfo",
833
848
  value: function updateHostInfo(host) {
834
849
  if (host && !(0, _isEqual2.default)(this.host, host)) {
835
850
  var parsedHosts = _hostUtils.default.getHosts(this.host, host);
836
-
837
851
  this.updateMeeting(parsedHosts.current);
838
852
  this.parsedLocus.host = parsedHosts.current;
839
-
840
853
  if (parsedHosts.updates.isNewHost) {
841
854
  this.compareAndUpdateFlags.compareSelfAndHost = true;
842
855
  this.emitScoped({
@@ -847,31 +860,26 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
847
860
  oldHost: parsedHosts.previous
848
861
  });
849
862
  }
850
-
851
863
  this.host = host;
852
864
  } else {
853
865
  this.compareAndUpdateFlags.compareSelfAndHost = false;
854
866
  }
855
867
  }
868
+
856
869
  /**
857
870
  * @param {Object} info
858
871
  * @param {Object} self
859
872
  * @returns {undefined}
860
873
  * @memberof LocusInfo
861
874
  */
862
-
863
875
  }, {
864
876
  key: "updateMeetingInfo",
865
877
  value: function updateMeetingInfo(info, self) {
866
- if (info && !(0, _isEqual2.default)(this.info, info)) {
867
- var _this$parsedLocus$sel;
868
-
869
- var roles = self ? _selfUtils.default.getRoles(self) : ((_this$parsedLocus$sel = this.parsedLocus.self) === null || _this$parsedLocus$sel === void 0 ? void 0 : _this$parsedLocus$sel.roles) || [];
870
-
878
+ var _this$parsedLocus$sel;
879
+ var roles = self ? _selfUtils.default.getRoles(self) : ((_this$parsedLocus$sel = this.parsedLocus.self) === null || _this$parsedLocus$sel === void 0 ? void 0 : _this$parsedLocus$sel.roles) || [];
880
+ if (info && !(0, _isEqual2.default)(this.info, info) || roles.length && !(0, _isEqual2.default)(this.roles, roles) && info) {
871
881
  var isJoined = _selfUtils.default.isJoined(self || this.parsedLocus.self);
872
-
873
882
  var parsedInfo = _infoUtils.default.getInfos(this.parsedLocus.info, info, roles, isJoined);
874
-
875
883
  this.emitScoped({
876
884
  file: 'locus-info',
877
885
  function: 'updateMeetingInfo'
@@ -879,33 +887,31 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
879
887
  info: parsedInfo.current,
880
888
  self: self
881
889
  });
882
-
883
890
  if (parsedInfo.updates.isLocked) {
884
891
  this.emitScoped({
885
892
  file: 'locus-info',
886
893
  function: 'updateMeetingInfo'
887
894
  }, _constants.LOCUSINFO.EVENTS.MEETING_LOCKED, info);
888
895
  }
889
-
890
896
  if (parsedInfo.updates.isUnlocked) {
891
897
  this.emitScoped({
892
898
  file: 'locus-info',
893
899
  function: 'updateMeetingInfo'
894
900
  }, _constants.LOCUSINFO.EVENTS.MEETING_UNLOCKED, info);
895
901
  }
896
-
897
902
  this.info = info;
898
- this.parsedLocus.info = parsedInfo.current; // Parses the info and adds necessary values
899
-
903
+ this.parsedLocus.info = parsedInfo.current;
904
+ // Parses the info and adds necessary values
900
905
  this.updateMeeting(parsedInfo.current);
901
906
  }
907
+ this.roles = roles;
902
908
  }
909
+
903
910
  /**
904
911
  * @param {Object} embeddedApps
905
912
  * @returns {undefined}
906
913
  * @memberof LocusInfo
907
914
  */
908
-
909
915
  }, {
910
916
  key: "updateEmbeddedApps",
911
917
  value: function updateEmbeddedApps(embeddedApps) {
@@ -913,9 +919,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
913
919
  if (_embeddedAppsUtils.default.areSimilar(this.embeddedApps, embeddedApps)) {
914
920
  return;
915
921
  }
916
-
917
922
  var parsedEmbeddedApps = _embeddedAppsUtils.default.parse(embeddedApps);
918
-
919
923
  this.updateMeeting({
920
924
  embeddedApps: parsedEmbeddedApps
921
925
  });
@@ -925,6 +929,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
925
929
  }, _constants.LOCUSINFO.EVENTS.EMBEDDED_APPS_UPDATED, parsedEmbeddedApps);
926
930
  this.embeddedApps = embeddedApps;
927
931
  }
932
+
928
933
  /**
929
934
  * handles when the locus.mediaShares is updated
930
935
  * @param {Object} mediaShares the locus.mediaShares property
@@ -932,14 +937,14 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
932
937
  * @memberof LocusInfo
933
938
  * emits internal event locus_info_update_media_shares
934
939
  */
935
-
936
940
  }, {
937
941
  key: "updateMediaShares",
938
942
  value: function updateMediaShares(mediaShares) {
939
943
  if (mediaShares && !(0, _isEqual2.default)(this.mediaShares, mediaShares)) {
940
944
  var parsedMediaShares = _mediaSharesUtils.default.getMediaShares(this.mediaShares, mediaShares);
941
-
942
945
  this.updateMeeting(parsedMediaShares.current);
946
+ this.parsedLocus.mediaShares = parsedMediaShares.current;
947
+ this.mediaShares = mediaShares;
943
948
  this.emitScoped({
944
949
  file: 'locus-info',
945
950
  function: 'updateMediaShares'
@@ -947,16 +952,14 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
947
952
  current: parsedMediaShares.current,
948
953
  previous: parsedMediaShares.previous
949
954
  });
950
- this.parsedLocus.mediaShares = parsedMediaShares.current;
951
- this.mediaShares = mediaShares;
952
955
  }
953
956
  }
957
+
954
958
  /**
955
959
  * @param {String} participantsUrl
956
960
  * @returns {undefined}
957
961
  * @memberof LocusInfo
958
962
  */
959
-
960
963
  }, {
961
964
  key: "updateParticipantsUrl",
962
965
  value: function updateParticipantsUrl(participantsUrl) {
@@ -964,12 +967,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
964
967
  this.participantsUrl = participantsUrl;
965
968
  }
966
969
  }
970
+
967
971
  /**
968
972
  * @param {Object} replace
969
973
  * @returns {undefined}
970
974
  * @memberof LocusInfo
971
975
  */
972
-
973
976
  }, {
974
977
  key: "updateReplace",
975
978
  value: function updateReplace(replace) {
@@ -977,6 +980,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
977
980
  this.replace = replace;
978
981
  }
979
982
  }
983
+
980
984
  /**
981
985
  * handles when the locus.self is updated
982
986
  * @param {Object} self the locus.mediaShares property
@@ -985,7 +989,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
985
989
  * @memberof LocusInfo
986
990
  * emits internal events self_admitted_guest, self_unadmitted_guest, locus_info_update_self
987
991
  */
988
-
989
992
  }, {
990
993
  key: "updateSelf",
991
994
  value: function updateSelf(self, participants) {
@@ -993,29 +996,24 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
993
996
  if (self && !(0, _isEqual2.default)(this.self, self)) {
994
997
  // @ts-ignore
995
998
  var parsedSelves = _selfUtils.default.getSelves(this.self, self, this.webex.internal.device.url);
996
-
997
999
  this.updateMeeting(parsedSelves.current);
998
1000
  this.parsedLocus.self = parsedSelves.current;
999
1001
  var element = this.parsedLocus.states[this.parsedLocus.states.length - 1];
1000
-
1001
1002
  if (element !== parsedSelves.current.state) {
1002
1003
  this.parsedLocus.states.push(parsedSelves.current.state);
1003
- } // TODO: check if we need to save the sipUri here as well
1004
- // this.emit(LOCUSINFO.EVENTS.MEETING_UPDATE, SelfUtils.getSipUrl(this.getLocusPartner(participants, self), this.parsedLocus.fullState.type, this.parsedLocus.info.sipUri));
1005
-
1004
+ }
1006
1005
 
1006
+ // TODO: check if we need to save the sipUri here as well
1007
+ // this.emit(LOCUSINFO.EVENTS.MEETING_UPDATE, SelfUtils.getSipUrl(this.getLocusPartner(participants, self), this.parsedLocus.fullState.type, this.parsedLocus.info.sipUri));
1007
1008
  var result = _selfUtils.default.getSipUrl(this.getLocusPartner(participants, self), this.parsedLocus.fullState.type, this.parsedLocus.info.sipUri);
1008
-
1009
1009
  if (result.sipUri) {
1010
1010
  this.updateMeeting(result);
1011
1011
  }
1012
-
1013
1012
  if (parsedSelves.updates.moderatorChanged) {
1014
1013
  this.compareAndUpdateFlags.compareHostAndSelf = true;
1015
1014
  } else {
1016
1015
  this.compareAndUpdateFlags.compareHostAndSelf = false;
1017
1016
  }
1018
-
1019
1017
  if (parsedSelves.updates.layoutChanged) {
1020
1018
  this.emitScoped({
1021
1019
  file: 'locus-info',
@@ -1024,7 +1022,14 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1024
1022
  layout: parsedSelves.current.layout
1025
1023
  });
1026
1024
  }
1027
-
1025
+ if (parsedSelves.updates.breakoutsChanged) {
1026
+ this.emitScoped({
1027
+ file: 'locus-info',
1028
+ function: 'updateSelf'
1029
+ }, _constants.LOCUSINFO.EVENTS.SELF_MEETING_BREAKOUTS_CHANGED, {
1030
+ breakoutSessions: parsedSelves.current.breakoutSessions
1031
+ });
1032
+ }
1028
1033
  if (parsedSelves.updates.isMediaInactiveOrReleased) {
1029
1034
  this.emitScoped({
1030
1035
  file: 'locus-info',
@@ -1033,13 +1038,29 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1033
1038
  reason: self.reason
1034
1039
  });
1035
1040
  }
1036
-
1037
1041
  if (parsedSelves.updates.moderatorChanged) {
1038
1042
  this.emitScoped({
1039
1043
  file: 'locus-info',
1040
1044
  function: 'updateSelf'
1041
1045
  }, _constants.LOCUSINFO.EVENTS.SELF_MODERATOR_CHANGED, self);
1042
1046
  }
1047
+ // When the user upgrades to moderator or cohost
1048
+ if (parsedSelves.updates.isUpgradeToModeratorOrCohost) {
1049
+ this.emitScoped({
1050
+ file: 'locus-info',
1051
+ function: 'updateSelf'
1052
+ }, _constants.LOCUSINFO.EVENTS.SELF_MODERATOR_OR_COHOST_UPGRADE, self);
1053
+ }
1054
+ //
1055
+ if (parsedSelves.updates.isVideoMutedByOthersChanged) {
1056
+ this.emitScoped({
1057
+ file: 'locus-info',
1058
+ function: 'updateSelf'
1059
+ }, _constants.LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED, {
1060
+ muted: parsedSelves.current.remoteVideoMuted
1061
+ // unmuteAllowed: not part of .self
1062
+ });
1063
+ }
1043
1064
 
1044
1065
  if (parsedSelves.updates.localAudioUnmuteRequiredByServer) {
1045
1066
  this.emitScoped({
@@ -1050,7 +1071,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1050
1071
  unmuteAllowed: parsedSelves.current.unmuteAllowed
1051
1072
  });
1052
1073
  }
1053
-
1054
1074
  if (parsedSelves.updates.isMutedByOthersChanged) {
1055
1075
  this.emitScoped({
1056
1076
  file: 'locus-info',
@@ -1060,39 +1080,34 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1060
1080
  unmuteAllowed: parsedSelves.current.unmuteAllowed
1061
1081
  });
1062
1082
  }
1063
-
1064
1083
  if (parsedSelves.updates.localAudioUnmuteRequestedByServer) {
1065
1084
  this.emitScoped({
1066
1085
  file: 'locus-info',
1067
1086
  function: 'updateSelf'
1068
1087
  }, _constants.LOCUSINFO.EVENTS.LOCAL_UNMUTE_REQUESTED, {});
1069
1088
  }
1070
-
1071
1089
  if (parsedSelves.updates.isUserUnadmitted) {
1072
1090
  this.emitScoped({
1073
1091
  file: 'locus-info',
1074
1092
  function: 'updateSelf'
1075
1093
  }, _constants.LOCUSINFO.EVENTS.SELF_UNADMITTED_GUEST, self);
1076
1094
  }
1077
-
1078
1095
  if (parsedSelves.updates.isUserAdmitted) {
1079
1096
  this.emitScoped({
1080
1097
  file: 'locus-info',
1081
1098
  function: 'updateSelf'
1082
1099
  }, _constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, self);
1083
1100
  }
1084
-
1085
1101
  if (parsedSelves.updates.isMediaInactive) {
1086
1102
  this.emitScoped({
1087
1103
  file: 'locus-info',
1088
1104
  function: 'updateSelf'
1089
- }, // @ts-ignore
1105
+ },
1106
+ // @ts-ignore
1090
1107
  _constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, _selfUtils.default.getMediaStatus(self.mediaSessions));
1091
1108
  }
1092
-
1093
1109
  if (parsedSelves.updates.audioStateChange || parsedSelves.updates.videoStateChange || parsedSelves.updates.shareStateChange) {
1094
1110
  var _parsedSelves$current, _parsedSelves$current2, _parsedSelves$current3;
1095
-
1096
1111
  this.emitScoped({
1097
1112
  file: 'locus-info',
1098
1113
  function: 'updateSelf'
@@ -1102,14 +1117,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1102
1117
  shareStatus: (_parsedSelves$current3 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current3 === void 0 ? void 0 : _parsedSelves$current3.share
1103
1118
  });
1104
1119
  }
1105
-
1106
1120
  if (parsedSelves.updates.isUserObserving) {
1107
1121
  this.emitScoped({
1108
1122
  file: 'locus-info',
1109
1123
  function: 'updateSelf'
1110
1124
  }, _constants.LOCUSINFO.EVENTS.SELF_OBSERVING);
1111
1125
  }
1112
-
1113
1126
  if (parsedSelves.updates.canNotViewTheParticipantListChanged) {
1114
1127
  this.emitScoped({
1115
1128
  file: 'locus-info',
@@ -1118,7 +1131,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1118
1131
  canNotViewTheParticipantList: parsedSelves.current.canNotViewTheParticipantList
1119
1132
  });
1120
1133
  }
1121
-
1122
1134
  if (parsedSelves.updates.isSharingBlockedChanged) {
1123
1135
  this.emitScoped({
1124
1136
  file: 'locus-info',
@@ -1127,7 +1139,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1127
1139
  isSharingBlocked: parsedSelves.current.isSharingBlocked
1128
1140
  });
1129
1141
  }
1130
-
1131
1142
  this.emitScoped({
1132
1143
  file: 'locus-info',
1133
1144
  function: 'updateSelf'
@@ -1135,20 +1146,20 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1135
1146
  oldSelf: parsedSelves.previous,
1136
1147
  newSelf: parsedSelves.current
1137
1148
  });
1138
- this.parsedLocus.self = parsedSelves.current; // @ts-ignore
1139
-
1149
+ this.parsedLocus.self = parsedSelves.current;
1150
+ // @ts-ignore
1140
1151
  this.self = self;
1141
1152
  } else {
1142
1153
  this.compareAndUpdateFlags.compareHostAndSelf = false;
1143
1154
  }
1144
1155
  }
1156
+
1145
1157
  /**
1146
1158
  * handles when the locus.url is updated
1147
1159
  * @param {String} url
1148
1160
  * @returns {undefined}
1149
1161
  * emits internal event locus_info_update_url
1150
1162
  */
1151
-
1152
1163
  }, {
1153
1164
  key: "updateLocusUrl",
1154
1165
  value: function updateLocusUrl(url) {
@@ -1163,12 +1174,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1163
1174
  }, _constants.EVENTS.LOCUS_INFO_UPDATE_URL, url);
1164
1175
  }
1165
1176
  }
1177
+
1166
1178
  /**
1167
1179
  * @param {String} aclUrl
1168
1180
  * @returns {undefined}
1169
1181
  * @memberof LocusInfo
1170
1182
  */
1171
-
1172
1183
  }, {
1173
1184
  key: "updateAclUrl",
1174
1185
  value: function updateAclUrl(aclUrl) {
@@ -1176,12 +1187,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1176
1187
  this.aclUrl = aclUrl;
1177
1188
  }
1178
1189
  }
1190
+
1179
1191
  /**
1180
1192
  * @param {Number} baseSequence
1181
1193
  * @returns {undefined}
1182
1194
  * @memberof LocusInfo
1183
1195
  */
1184
-
1185
1196
  }, {
1186
1197
  key: "updateBasequence",
1187
1198
  value: function updateBasequence(baseSequence) {
@@ -1189,12 +1200,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1189
1200
  this.baseSequence = baseSequence;
1190
1201
  }
1191
1202
  }
1203
+
1192
1204
  /**
1193
1205
  * @param {Number} sequence
1194
1206
  * @returns {undefined}
1195
1207
  * @memberof LocusInfo
1196
1208
  */
1197
-
1198
1209
  }, {
1199
1210
  key: "updateSequence",
1200
1211
  value: function updateSequence(sequence) {
@@ -1202,12 +1213,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1202
1213
  this.sequence = sequence;
1203
1214
  }
1204
1215
  }
1216
+
1205
1217
  /**
1206
1218
  * @param {Object} membership
1207
1219
  * @returns {undefined}
1208
1220
  * @memberof LocusInfo
1209
1221
  */
1210
-
1211
1222
  }, {
1212
1223
  key: "updateMemberShip",
1213
1224
  value: function updateMemberShip(membership) {
@@ -1215,12 +1226,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1215
1226
  this.membership = membership;
1216
1227
  }
1217
1228
  }
1229
+
1218
1230
  /**
1219
1231
  * @param {Array} identities
1220
1232
  * @returns {undefined}
1221
1233
  * @memberof LocusInfo
1222
1234
  */
1223
-
1224
1235
  }, {
1225
1236
  key: "updateIdentifiers",
1226
1237
  value: function updateIdentifiers(identities) {
@@ -1228,9 +1239,114 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1228
1239
  this.identities = identities;
1229
1240
  }
1230
1241
  }
1242
+
1243
+ /**
1244
+ * check the locus is main session's one or not, if is main session's, update main session cache
1245
+ * @param {Object} locus
1246
+ * @returns {undefined}
1247
+ * @memberof LocusInfo
1248
+ */
1249
+ }, {
1250
+ key: "updateLocusCache",
1251
+ value: function updateLocusCache(locus) {
1252
+ var isMainSessionDTO = _controlsUtils.default.isMainSessionDTO(locus);
1253
+ if (isMainSessionDTO) {
1254
+ this.updateMainSessionLocusCache(locus);
1255
+ }
1256
+ }
1257
+
1258
+ /**
1259
+ * if return from breakout to main session, need to use cached main session DTO since locus won't send the full locus (participants)
1260
+ * if join breakout from main session, need to query main locus url (if response with 403 means no privilege, need to clear the cache)
1261
+ * @param {Object} newLocus
1262
+ * @returns {Object}
1263
+ * @memberof LocusInfo
1264
+ */
1265
+ }, {
1266
+ key: "getTheLocusToUpdate",
1267
+ value: function getTheLocusToUpdate(newLocus) {
1268
+ var switchStatus = _controlsUtils.default.getSessionSwitchStatus(this.controls, newLocus.controls);
1269
+ if (switchStatus.isReturnToMain && this.mainSessionLocusCache) {
1270
+ return (0, _cloneDeep2.default)(this.mainSessionLocusCache);
1271
+ }
1272
+ if (switchStatus.isJoinToBreakout) {
1273
+ this.emitScoped({
1274
+ file: 'locus-info',
1275
+ function: 'updateControls'
1276
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_JOIN_BREAKOUT_FROM_MAIN, {
1277
+ mainLocusUrl: this.url
1278
+ });
1279
+ }
1280
+ return newLocus;
1281
+ }
1282
+
1283
+ /**
1284
+ * merge participants by participant id
1285
+ * @param {Array} participants
1286
+ * @param {Array} sourceParticipants
1287
+ * @returns {Array} merged participants
1288
+ * @memberof LocusInfo
1289
+ */
1290
+ // eslint-disable-next-line class-methods-use-this
1291
+ }, {
1292
+ key: "mergeParticipants",
1293
+ value: function mergeParticipants(participants, sourceParticipants) {
1294
+ if (!sourceParticipants || !sourceParticipants.length) return participants;
1295
+ if (!participants || !participants.length) {
1296
+ return sourceParticipants;
1297
+ }
1298
+ sourceParticipants.forEach(function (participant) {
1299
+ var existIndex = participants.findIndex(function (p) {
1300
+ return p.id === participant.id;
1301
+ });
1302
+ if (existIndex > -1) {
1303
+ participants.splice(existIndex, 1, participant);
1304
+ } else {
1305
+ participants.push(participant);
1306
+ }
1307
+ });
1308
+ return participants;
1309
+ }
1310
+
1311
+ /**
1312
+ * need cache main sessions' participants since locus will not send the full list when cohost/host leave breakout
1313
+ * @param {Object} mainLocus
1314
+ * @returns {undefined}
1315
+ * @memberof LocusInfo
1316
+ */
1317
+ }, {
1318
+ key: "updateMainSessionLocusCache",
1319
+ value: function updateMainSessionLocusCache(mainLocus) {
1320
+ var _this5 = this;
1321
+ if (!mainLocus) {
1322
+ return;
1323
+ }
1324
+ var locusClone = (0, _cloneDeep2.default)(mainLocus);
1325
+ if (this.mainSessionLocusCache) {
1326
+ // shallow merge and do special merge for participants
1327
+ (0, _assignWith2.default)(this.mainSessionLocusCache, locusClone, function (objValue, srcValue, key) {
1328
+ if (key === 'participants') {
1329
+ return _this5.mergeParticipants(objValue, srcValue);
1330
+ }
1331
+ return srcValue || objValue;
1332
+ });
1333
+ } else {
1334
+ this.mainSessionLocusCache = locusClone;
1335
+ }
1336
+ }
1337
+
1338
+ /**
1339
+ * clear main session cache
1340
+ * @returns {undefined}
1341
+ * @memberof LocusInfo
1342
+ */
1343
+ }, {
1344
+ key: "clearMainSessionLocusCache",
1345
+ value: function clearMainSessionLocusCache() {
1346
+ this.mainSessionLocusCache = null;
1347
+ }
1231
1348
  }]);
1232
1349
  return LocusInfo;
1233
1350
  }(_eventsScope.default);
1234
-
1235
1351
  exports.default = LocusInfo;
1236
1352
  //# sourceMappingURL=index.js.map