@azure/communication-react 1.5.1-alpha-202304150013 → 1.5.1-alpha-202304180012

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 (160) hide show
  1. package/dist/communication-react.d.ts +296 -3
  2. package/dist/dist-cjs/communication-react/index.js +1726 -499
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +13 -0
  7. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +36 -0
  8. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.d.ts +49 -0
  10. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js +53 -0
  11. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js.map +1 -0
  12. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +12 -0
  13. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +25 -1
  14. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  15. package/dist/dist-esm/calling-component-bindings/src/index.d.ts +3 -0
  16. package/dist/dist-esm/calling-component-bindings/src/index.js +2 -0
  17. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  18. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +68 -1
  19. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  20. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +8 -0
  21. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +81 -0
  22. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  23. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +57 -0
  24. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
  25. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +2 -0
  26. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +19 -0
  27. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  28. package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.d.ts +18 -0
  29. package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.js +38 -0
  30. package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.js.map +1 -0
  31. package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +6 -0
  32. package/dist/dist-esm/calling-stateful-client/src/Converter.js +17 -1
  33. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  34. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.d.ts +7 -0
  35. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js +10 -0
  36. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
  37. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
  38. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  39. package/dist/dist-esm/communication-react/src/index.d.ts +2 -0
  40. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  41. package/dist/dist-esm/react-components/src/components/Caption.js +4 -3
  42. package/dist/dist-esm/react-components/src/components/Caption.js.map +1 -1
  43. package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +1 -0
  44. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +4 -4
  45. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  46. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.d.ts +37 -0
  47. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.js +88 -0
  48. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.js.map +1 -0
  49. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.d.ts +2 -0
  50. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js +1 -0
  51. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js.map +1 -1
  52. package/dist/dist-esm/react-components/src/components/StartCaptionsButton.d.ts +70 -0
  53. package/dist/dist-esm/react-components/src/components/StartCaptionsButton.js +52 -0
  54. package/dist/dist-esm/react-components/src/components/StartCaptionsButton.js.map +1 -0
  55. package/dist/dist-esm/react-components/src/components/index.d.ts +2 -0
  56. package/dist/dist-esm/react-components/src/components/index.js +6 -0
  57. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  58. package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +8 -0
  59. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +17 -2
  60. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
  61. package/dist/dist-esm/react-components/src/components/styles/CaptionsSettingsModal.styles.d.ts +34 -0
  62. package/dist/dist-esm/react-components/src/components/styles/CaptionsSettingsModal.styles.js +85 -0
  63. package/dist/dist-esm/react-components/src/components/styles/CaptionsSettingsModal.styles.js.map +1 -0
  64. package/dist/dist-esm/react-components/src/components/utils.d.ts +4 -0
  65. package/dist/dist-esm/react-components/src/components/utils.js +4 -0
  66. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  67. package/dist/dist-esm/react-components/src/index.d.ts +1 -0
  68. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  69. package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.d.ts +1 -1
  70. package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.js.map +1 -1
  71. package/dist/dist-esm/react-components/src/theming/icons.d.ts +4 -0
  72. package/dist/dist-esm/react-components/src/theming/icons.js +11 -1
  73. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  74. package/dist/dist-esm/react-components/src/types/CaptionsAvailableLanguageStrings.d.ts +48 -0
  75. package/dist/dist-esm/react-components/src/types/CaptionsAvailableLanguageStrings.js +4 -0
  76. package/dist/dist-esm/react-components/src/types/CaptionsAvailableLanguageStrings.js.map +1 -0
  77. package/dist/dist-esm/react-components/src/types/index.d.ts +1 -0
  78. package/dist/dist-esm/react-components/src/types/index.js +1 -0
  79. package/dist/dist-esm/react-components/src/types/index.js.map +1 -1
  80. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +65 -0
  81. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  82. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +13 -0
  83. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +61 -2
  84. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  85. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +54 -1
  86. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  87. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +1 -0
  88. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  89. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +18 -3
  90. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  91. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +1 -1
  92. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  93. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +16 -0
  94. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  95. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -0
  96. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  97. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +1 -1
  98. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  99. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.d.ts +7 -0
  100. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.js +21 -0
  101. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.js.map +1 -0
  102. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +22 -0
  103. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +46 -0
  104. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  105. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +9 -2
  106. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  107. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.d.ts +12 -0
  108. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.js.map +1 -1
  109. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +10 -0
  110. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +46 -0
  111. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  112. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +26 -1
  113. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  114. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +5 -0
  115. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +27 -1
  116. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  117. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +3 -1
  118. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +6 -2
  119. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  120. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.d.ts +6 -0
  121. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js +60 -0
  122. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js.map +1 -0
  123. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.d.ts +12 -0
  124. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js +107 -0
  125. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js.map +1 -0
  126. package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.d.ts +7 -0
  127. package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.js +38 -0
  128. package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.js.map +1 -0
  129. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +1 -0
  130. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +19 -1
  131. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  132. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.d.ts +2 -0
  133. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +113 -6
  134. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
  135. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.d.ts +13 -0
  136. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +103 -0
  137. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  138. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.d.ts +6 -0
  139. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.js +24 -0
  140. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.js.map +1 -0
  141. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.d.ts +1 -0
  142. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js +5 -1
  143. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js.map +1 -1
  144. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.d.ts +20 -0
  145. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.js +55 -0
  146. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.js.map +1 -0
  147. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.styles.d.ts +7 -0
  148. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.styles.js +25 -0
  149. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.styles.js.map +1 -0
  150. package/dist/dist-esm/react-composites/src/composites/common/MoreButton.js +1 -1
  151. package/dist/dist-esm/react-composites/src/composites/common/MoreButton.js.map +1 -1
  152. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +0 -2
  153. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +20 -10
  154. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  155. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +4 -0
  156. package/dist/dist-esm/react-composites/src/composites/common/utils.d.ts +4 -0
  157. package/dist/dist-esm/react-composites/src/composites/common/utils.js +4 -0
  158. package/dist/dist-esm/react-composites/src/composites/common/utils.js.map +1 -1
  159. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +61 -1
  160. package/package.json +10 -10
@@ -162,7 +162,7 @@ const _toCommunicationIdentifier = (id) => {
162
162
  // Copyright (c) Microsoft Corporation.
163
163
  // Licensed under the MIT license.
164
164
  // GENERATED FILE. DO NOT EDIT MANUALLY.
165
- var telemetryVersion = '1.5.1-alpha-202304150013';
165
+ var telemetryVersion = '1.5.1-alpha-202304180012';
166
166
 
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  /**
@@ -375,10 +375,40 @@ const getEnvironmentInfo = (state) => {
375
375
  /* @conditional-compile-remove(unsupported-browser) */
376
376
  return state.environmentInfo;
377
377
  };
378
+ /* @conditional-compile-remove(close-captions) */
379
+ /** @private */
380
+ const getCaptions = (state, props) => {
381
+ var _a;
382
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.captions;
383
+ };
384
+ /* @conditional-compile-remove(close-captions) */
385
+ /** @private */
386
+ const getCaptionsStatus = (state, props) => {
387
+ var _a;
388
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.isCaptionsFeatureActive;
389
+ };
390
+ /* @conditional-compile-remove(close-captions) */
391
+ /** @private */
392
+ const getCurrentCaptionLanguage = (state, props) => {
393
+ var _a;
394
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.currentCaptionLanguage;
395
+ };
396
+ /* @conditional-compile-remove(close-captions) */
397
+ /** @private */
398
+ const getCurrentSpokenLanguage = (state, props) => {
399
+ var _a;
400
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.currentSpokenLanguage;
401
+ };
402
+ /* @conditional-compile-remove(close-captions) */
403
+ /** @private */
404
+ const getSupportedSpokenLanguages = (state, props) => {
405
+ var _a;
406
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.supportedSpokenLanguages;
407
+ };
378
408
 
379
409
  // Copyright (c) Microsoft Corporation.
380
410
  // Licensed under the MIT license.
381
- var __awaiter$F = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
411
+ var __awaiter$J = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
382
412
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
383
413
  return new (P || (P = Promise))(function (resolve, reject) {
384
414
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -416,7 +446,7 @@ const _isPreviewOn = (deviceManager) => {
416
446
  *
417
447
  * @private
418
448
  */
419
- const disposeAllLocalPreviewViews = (callClient) => __awaiter$F(void 0, void 0, void 0, function* () {
449
+ const disposeAllLocalPreviewViews = (callClient) => __awaiter$J(void 0, void 0, void 0, function* () {
420
450
  const unparentedViews = callClient.getState().deviceManager.unparentedViews;
421
451
  for (const view of unparentedViews) {
422
452
  yield callClient.disposeView(undefined, undefined, view);
@@ -542,7 +572,7 @@ const holdButtonSelector = reselect__namespace.createSelector([getCallState], (c
542
572
 
543
573
  // Copyright (c) Microsoft Corporation.
544
574
  // Licensed under the MIT license.
545
- var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
575
+ var __awaiter$I = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
546
576
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
547
577
  return new (P || (P = Promise))(function (resolve, reject) {
548
578
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -563,7 +593,7 @@ const areStreamsEqual = (prevStream, newStream) => {
563
593
  * @private
564
594
  */
565
595
  const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callClient, deviceManager, call) => {
566
- const onStartLocalVideo = () => __awaiter$E(void 0, void 0, void 0, function* () {
596
+ const onStartLocalVideo = () => __awaiter$I(void 0, void 0, void 0, function* () {
567
597
  // Before the call object creates a stream, dispose of any local preview streams.
568
598
  // @TODO: is there any way to parent the unparented view to the call object instead
569
599
  // of disposing and creating a new stream?
@@ -583,7 +613,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
583
613
  yield call.startVideo(stream);
584
614
  }
585
615
  });
586
- const onStopLocalVideo = (stream) => __awaiter$E(void 0, void 0, void 0, function* () {
616
+ const onStopLocalVideo = (stream) => __awaiter$I(void 0, void 0, void 0, function* () {
587
617
  const callId = call === null || call === void 0 ? void 0 : call.id;
588
618
  if (!callId) {
589
619
  return;
@@ -592,7 +622,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
592
622
  yield call.stopVideo(stream);
593
623
  }
594
624
  });
595
- const onToggleCamera = (options) => __awaiter$E(void 0, void 0, void 0, function* () {
625
+ const onToggleCamera = (options) => __awaiter$I(void 0, void 0, void 0, function* () {
596
626
  const previewOn = _isPreviewOn(callClient.getState().deviceManager);
597
627
  if (previewOn && call && call.state === 'Connecting') {
598
628
  // This is to workaround: https://skype.visualstudio.com/SPOOL/_workitems/edit/3030558.
@@ -640,19 +670,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
640
670
  }
641
671
  }
642
672
  });
643
- const onSelectMicrophone = (device) => __awaiter$E(void 0, void 0, void 0, function* () {
673
+ const onSelectMicrophone = (device) => __awaiter$I(void 0, void 0, void 0, function* () {
644
674
  if (!deviceManager) {
645
675
  return;
646
676
  }
647
677
  return deviceManager.selectMicrophone(device);
648
678
  });
649
- const onSelectSpeaker = (device) => __awaiter$E(void 0, void 0, void 0, function* () {
679
+ const onSelectSpeaker = (device) => __awaiter$I(void 0, void 0, void 0, function* () {
650
680
  if (!deviceManager) {
651
681
  return;
652
682
  }
653
683
  return deviceManager.selectSpeaker(device);
654
684
  });
655
- const onSelectCamera = (device, options) => __awaiter$E(void 0, void 0, void 0, function* () {
685
+ const onSelectCamera = (device, options) => __awaiter$I(void 0, void 0, void 0, function* () {
656
686
  if (!deviceManager) {
657
687
  return;
658
688
  }
@@ -675,19 +705,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
675
705
  }, options);
676
706
  }
677
707
  });
678
- const onToggleMicrophone = () => __awaiter$E(void 0, void 0, void 0, function* () {
708
+ const onToggleMicrophone = () => __awaiter$I(void 0, void 0, void 0, function* () {
679
709
  if (!call || !_isInCall(call.state)) {
680
710
  throw new Error(`Please invoke onToggleMicrophone after call is started`);
681
711
  }
682
712
  return call.isMuted ? yield call.unmute() : yield call.mute();
683
713
  });
684
- const onStartScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
685
- const onStopScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
686
- const onToggleScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
687
- const onHangUp = (forEveryone) => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
714
+ const onStartScreenShare = () => __awaiter$I(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
715
+ const onStopScreenShare = () => __awaiter$I(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
716
+ const onToggleScreenShare = () => __awaiter$I(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
717
+ const onHangUp = (forEveryone) => __awaiter$I(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
688
718
  /* @conditional-compile-remove(PSTN-calls) */
689
- const onToggleHold = () => __awaiter$E(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.state) === 'LocalHold' ? yield (call === null || call === void 0 ? void 0 : call.resume()) : yield (call === null || call === void 0 ? void 0 : call.hold()); });
690
- const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$E(void 0, void 0, void 0, function* () {
719
+ const onToggleHold = () => __awaiter$I(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.state) === 'LocalHold' ? yield (call === null || call === void 0 ? void 0 : call.resume()) : yield (call === null || call === void 0 ? void 0 : call.hold()); });
720
+ const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$I(void 0, void 0, void 0, function* () {
691
721
  var _a;
692
722
  if (!call || call.localVideoStreams.length === 0) {
693
723
  return;
@@ -703,7 +733,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
703
733
  const { view } = (_a = (yield callClient.createView(call.id, undefined, localStream, options))) !== null && _a !== void 0 ? _a : {};
704
734
  return view ? { view } : undefined;
705
735
  });
706
- const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$E(void 0, void 0, void 0, function* () {
736
+ const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$I(void 0, void 0, void 0, function* () {
707
737
  if (!call) {
708
738
  return;
709
739
  }
@@ -734,7 +764,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
734
764
  }
735
765
  return (createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view) ? { view: createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view } : undefined;
736
766
  });
737
- const onDisposeRemoteStreamView = (userId) => __awaiter$E(void 0, void 0, void 0, function* () {
767
+ const onDisposeRemoteStreamView = (userId) => __awaiter$I(void 0, void 0, void 0, function* () {
738
768
  if (!call) {
739
769
  return;
740
770
  }
@@ -755,7 +785,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
755
785
  callClient.disposeView(call.id, participant.identifier, screenShareStream);
756
786
  }
757
787
  });
758
- const onDisposeLocalStreamView = () => __awaiter$E(void 0, void 0, void 0, function* () {
788
+ const onDisposeLocalStreamView = () => __awaiter$I(void 0, void 0, void 0, function* () {
759
789
  // If the user is currently in a call, dispose of the local stream view attached to that call.
760
790
  const callState = call && callClient.getState().calls[call.id];
761
791
  const localStream = callState === null || callState === void 0 ? void 0 : callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');
@@ -768,18 +798,18 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
768
798
  yield disposeAllLocalPreviewViews(callClient);
769
799
  });
770
800
  /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
771
- const onSendDtmfTone = (dtmfTone) => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
801
+ const onSendDtmfTone = (dtmfTone) => __awaiter$I(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
772
802
  const notImplemented = () => {
773
803
  throw new Error('Not implemented, cannot call a method from an abstract object');
774
804
  };
775
805
  /* @conditional-compile-remove(call-readiness) */
776
- const askDevicePermission = (constrain) => __awaiter$E(void 0, void 0, void 0, function* () {
806
+ const askDevicePermission = (constrain) => __awaiter$I(void 0, void 0, void 0, function* () {
777
807
  if (deviceManager) {
778
808
  yield (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.askDevicePermission(constrain));
779
809
  }
780
810
  });
781
811
  /* @conditional-compile-remove(video-background-effects) */
782
- const onRemoveVideoBackgroundEffects = () => __awaiter$E(void 0, void 0, void 0, function* () {
812
+ const onRemoveVideoBackgroundEffects = () => __awaiter$I(void 0, void 0, void 0, function* () {
783
813
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
784
814
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
785
815
  if (stream) {
@@ -787,7 +817,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
787
817
  }
788
818
  });
789
819
  /* @conditional-compile-remove(video-background-effects) */
790
- const onBlurVideoBackground = (backgroundBlurConfig) => __awaiter$E(void 0, void 0, void 0, function* () {
820
+ const onBlurVideoBackground = (backgroundBlurConfig) => __awaiter$I(void 0, void 0, void 0, function* () {
791
821
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
792
822
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
793
823
  if (stream) {
@@ -795,7 +825,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
795
825
  }
796
826
  });
797
827
  /* @conditional-compile-remove(video-background-effects) */
798
- const onReplaceVideoBackground = (backgroundReplacementConfig) => __awaiter$E(void 0, void 0, void 0, function* () {
828
+ const onReplaceVideoBackground = (backgroundReplacementConfig) => __awaiter$I(void 0, void 0, void 0, function* () {
799
829
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
800
830
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
801
831
  if (stream) {
@@ -804,6 +834,22 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
804
834
  .startEffects(new communicationCallingEffects.BackgroundReplacementEffect(backgroundReplacementConfig));
805
835
  }
806
836
  });
837
+ /* @conditional-compile-remove(close-captions) */
838
+ const onStartCaptions = (options) => __awaiter$I(void 0, void 0, void 0, function* () {
839
+ yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).startCaptions(options));
840
+ });
841
+ /* @conditional-compile-remove(close-captions) */
842
+ const onStopCaptions = () => __awaiter$I(void 0, void 0, void 0, function* () {
843
+ yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).stopCaptions());
844
+ });
845
+ /* @conditional-compile-remove(close-captions) */
846
+ const onSetSpokenLanguage = (language) => __awaiter$I(void 0, void 0, void 0, function* () {
847
+ yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).setSpokenLanguage(language));
848
+ });
849
+ /* @conditional-compile-remove(close-captions) */
850
+ const onSetCaptionLanguage = (language) => __awaiter$I(void 0, void 0, void 0, function* () {
851
+ yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).setCaptionLanguage(language));
852
+ });
807
853
  return {
808
854
  onHangUp,
809
855
  /* @conditional-compile-remove(PSTN-calls) */
@@ -833,13 +879,21 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
833
879
  /* @conditional-compile-remove(video-background-effects) */
834
880
  onBlurVideoBackground,
835
881
  /* @conditional-compile-remove(video-background-effects) */
836
- onReplaceVideoBackground
882
+ onReplaceVideoBackground,
883
+ /* @conditional-compile-remove(close-captions) */
884
+ onStartCaptions,
885
+ /* @conditional-compile-remove(close-captions) */
886
+ onStopCaptions,
887
+ /* @conditional-compile-remove(close-captions) */
888
+ onSetCaptionLanguage,
889
+ /* @conditional-compile-remove(close-captions) */
890
+ onSetSpokenLanguage
837
891
  };
838
892
  });
839
893
 
840
894
  // Copyright (c) Microsoft Corporation.
841
895
  // Licensed under the MIT license.
842
- var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
896
+ var __awaiter$H = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
843
897
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
844
898
  return new (P || (P = Promise))(function (resolve, reject) {
845
899
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -864,7 +918,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
864
918
  return callAgent === null || callAgent === void 0 ? void 0 : callAgent.startCall(participants, options);
865
919
  },
866
920
  /* @conditional-compile-remove(PSTN-calls) */
867
- onAddParticipant: (userId, options) => __awaiter$D(void 0, void 0, void 0, function* () {
921
+ onAddParticipant: (userId, options) => __awaiter$H(void 0, void 0, void 0, function* () {
868
922
  const participant = _toCommunicationIdentifier(userId);
869
923
  if (communicationCommon.isPhoneNumberIdentifier(participant)) {
870
924
  call === null || call === void 0 ? void 0 : call.addParticipant(participant, options);
@@ -872,7 +926,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
872
926
  else if (communicationCommon.isCommunicationUserIdentifier(participant) || communicationCommon.isMicrosoftTeamsUserIdentifier(participant)) {
873
927
  call === null || call === void 0 ? void 0 : call.addParticipant(participant);
874
928
  }
875
- }), onRemoveParticipant: (userId) => __awaiter$D(void 0, void 0, void 0, function* () {
929
+ }), onRemoveParticipant: (userId) => __awaiter$H(void 0, void 0, void 0, function* () {
876
930
  const participant = _toCommunicationIdentifier(userId);
877
931
  yield (call === null || call === void 0 ? void 0 : call.removeParticipant(participant));
878
932
  }) });
@@ -880,7 +934,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
880
934
 
881
935
  // Copyright (c) Microsoft Corporation.
882
936
  // Licensed under the MIT license.
883
- var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
937
+ var __awaiter$G = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
884
938
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
885
939
  return new (P || (P = Promise))(function (resolve, reject) {
886
940
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -912,7 +966,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
912
966
  },
913
967
  /* @conditional-compile-remove(teams-identity-support) */
914
968
  /* @conditional-compile-remove(PSTN-calls) */
915
- onAddParticipant: (userId, options) => __awaiter$C(void 0, void 0, void 0, function* () {
969
+ onAddParticipant: (userId, options) => __awaiter$G(void 0, void 0, void 0, function* () {
916
970
  const participant = _toCommunicationIdentifier(userId);
917
971
  /* @conditional-compile-remove(teams-identity-support) */
918
972
  const threadId = options === null || options === void 0 ? void 0 : options.threadId;
@@ -925,7 +979,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
925
979
  }
926
980
  /* @conditional-compile-remove(teams-identity-support) */
927
981
  call === null || call === void 0 ? void 0 : call.addParticipant(participant);
928
- }), onRemoveParticipant: (userId) => __awaiter$C(void 0, void 0, void 0, function* () {
982
+ }), onRemoveParticipant: (userId) => __awaiter$G(void 0, void 0, void 0, function* () {
929
983
  const participant = _toCommunicationIdentifier(userId);
930
984
  if (communicationCommon.isCommunicationUserIdentifier(participant)) {
931
985
  throw new Error('CommunicationIdentifier in Teams call is not supported!');
@@ -935,9 +989,57 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
935
989
  }) });
936
990
  });
937
991
 
992
+ /* @conditional-compile-remove(close-captions) */
993
+ /* @conditional-compile-remove(close-captions) */
994
+ /**
995
+ * Selector for {@link StartCaptionsButton} component.
996
+ *
997
+ * @internal
998
+ */
999
+ const _startCaptionsButtonSelector = reselect__namespace.createSelector([getCaptionsStatus, getCurrentCaptionLanguage, getCurrentSpokenLanguage], (isCaptionsFeatureActive, currentCaptionLanguage, currentSpokenLanguage) => {
1000
+ return {
1001
+ checked: isCaptionsFeatureActive !== null && isCaptionsFeatureActive !== void 0 ? isCaptionsFeatureActive : false,
1002
+ currentCaptionLanguage: currentCaptionLanguage !== null && currentCaptionLanguage !== void 0 ? currentCaptionLanguage : 'en-us',
1003
+ currentSpokenLanguage: currentSpokenLanguage !== null && currentSpokenLanguage !== void 0 ? currentSpokenLanguage : 'en-us'
1004
+ };
1005
+ });
1006
+ /* @conditional-compile-remove(close-captions) */
1007
+ /**
1008
+ * Selector for {@link ChangeSpokenLanguageButton} component.
1009
+ *
1010
+ * @internal
1011
+ */
1012
+ const _changeSpokenLanguageSelector = reselect__namespace.createSelector([getSupportedSpokenLanguages, getCurrentSpokenLanguage, getCaptionsStatus], (supportedSpokenLanguages, currentSpokenLanguage, isCaptionsFeatureActive) => {
1013
+ return {
1014
+ supportedSpokenLanguages: supportedSpokenLanguages !== null && supportedSpokenLanguages !== void 0 ? supportedSpokenLanguages : ['en-us'],
1015
+ currentSpokenLanguage: currentSpokenLanguage !== null && currentSpokenLanguage !== void 0 ? currentSpokenLanguage : 'en-us',
1016
+ isCaptionsFeatureActive: isCaptionsFeatureActive !== null && isCaptionsFeatureActive !== void 0 ? isCaptionsFeatureActive : false
1017
+ };
1018
+ });
1019
+ /* @conditional-compile-remove(close-captions) */
1020
+ /**
1021
+ * Selector for {@link CaptionsBanner} component.
1022
+ *
1023
+ * @internal
1024
+ */
1025
+ const _captionsBannerSelector = reselect__namespace.createSelector([getCaptions, getCaptionsStatus], (captions, isCaptionsFeatureActive) => {
1026
+ const captionsInfo = captions === null || captions === void 0 ? void 0 : captions.map((c) => {
1027
+ var _a, _b;
1028
+ return {
1029
+ displayName: (_a = c.speaker.displayName) !== null && _a !== void 0 ? _a : 'Unnamed Participant',
1030
+ captionText: (_b = c.captionText) !== null && _b !== void 0 ? _b : '',
1031
+ userId: c.speaker.identifier ? toFlatCommunicationIdentifier(c.speaker.identifier) : ''
1032
+ };
1033
+ });
1034
+ return {
1035
+ captions: captionsInfo !== null && captionsInfo !== void 0 ? captionsInfo : [],
1036
+ isCaptionsOn: isCaptionsFeatureActive !== null && isCaptionsFeatureActive !== void 0 ? isCaptionsFeatureActive : false
1037
+ };
1038
+ });
1039
+
938
1040
  // Copyright (c) Microsoft Corporation.
939
1041
  // Licensed under the MIT license.
940
- var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1042
+ var __awaiter$F = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
941
1043
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
942
1044
  return new (P || (P = Promise))(function (resolve, reject) {
943
1045
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -986,13 +1088,13 @@ class ProxyDeviceManager {
986
1088
  this.selectCamera = (videoDeviceInfo) => {
987
1089
  this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);
988
1090
  };
989
- this.videoDevicesUpdated = () => __awaiter$B(this, void 0, void 0, function* () {
1091
+ this.videoDevicesUpdated = () => __awaiter$F(this, void 0, void 0, function* () {
990
1092
  // Device Manager always has a camera with '' name if there are no real camera devices available.
991
1093
  // We don't want to show that in the UI.
992
1094
  const realCameras = (yield this._deviceManager.getCameras()).filter((c) => !!c.name);
993
1095
  this._context.setDeviceManagerCameras(dedupeById(realCameras));
994
1096
  });
995
- this.audioDevicesUpdated = () => __awaiter$B(this, void 0, void 0, function* () {
1097
+ this.audioDevicesUpdated = () => __awaiter$F(this, void 0, void 0, function* () {
996
1098
  this._context.setDeviceManagerMicrophones(dedupeById(yield this._deviceManager.getMicrophones()));
997
1099
  this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));
998
1100
  });
@@ -1195,7 +1297,170 @@ class CallIdHistory {
1195
1297
 
1196
1298
  // Copyright (c) Microsoft Corporation.
1197
1299
  // Licensed under the MIT license.
1198
- var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1300
+ /**
1301
+ * @internal
1302
+ */
1303
+ const _isACSCall = (call) => {
1304
+ /* @conditional-compile-remove(teams-identity-support) */
1305
+ return !call.kind || call.kind === 'Call';
1306
+ };
1307
+ /**
1308
+ * @internal
1309
+ */
1310
+ const _isACSCallAgent = (callAgent) => {
1311
+ /* @conditional-compile-remove(teams-identity-support) */
1312
+ return !callAgent.kind || callAgent.kind === 'CallAgent';
1313
+ };
1314
+ /**
1315
+ * @internal
1316
+ */
1317
+ const _isTeamsCall = (call) => {
1318
+ /* @conditional-compile-remove(teams-identity-support) */
1319
+ return call.kind === 'TeamsCall';
1320
+ };
1321
+ /**
1322
+ * @internal
1323
+ */
1324
+ const _isTeamsCallAgent = (callAgent) => {
1325
+ /* @conditional-compile-remove(teams-identity-support) */
1326
+ return callAgent.kind === 'TeamsCallAgent';
1327
+ };
1328
+ /* @conditional-compile-remove(close-captions) */
1329
+ /**
1330
+ * @private
1331
+ * Determine whether a call is:
1332
+ * A TeamsCall
1333
+ * or a ACS Call joining the teams meeting
1334
+ */
1335
+ const _isTeamsMeetingCall = (call) => {
1336
+ return _isTeamsCall(call) || (_isACSCall(call) && !call.info.groupId && !call.info.roomId); // there should be a better way to determine if a call is joining a teams meeting ideally should be a meetingID in the info object
1337
+ };
1338
+
1339
+ // Copyright (c) Microsoft Corporation.
1340
+ /**
1341
+ * @private
1342
+ */
1343
+ function convertSdkLocalStreamToDeclarativeLocalStream(stream) {
1344
+ return {
1345
+ source: stream.source,
1346
+ mediaStreamType: stream.mediaStreamType,
1347
+ view: undefined
1348
+ // TODO [video-background-effects]: Add video effects state when it is added to the SDK
1349
+ };
1350
+ }
1351
+ /**
1352
+ * @private
1353
+ */
1354
+ function convertSdkRemoteStreamToDeclarativeRemoteStream(stream) {
1355
+ return {
1356
+ id: stream.id,
1357
+ mediaStreamType: stream.mediaStreamType,
1358
+ isAvailable: stream.isAvailable,
1359
+ /* @conditional-compile-remove(video-stream-is-receiving-flag) */
1360
+ isReceiving: stream.isReceiving,
1361
+ view: undefined
1362
+ };
1363
+ }
1364
+ /**
1365
+ * @private
1366
+ */
1367
+ function convertSdkParticipantToDeclarativeParticipant(participant) {
1368
+ const declarativeVideoStreams = {};
1369
+ for (const videoStream of participant.videoStreams) {
1370
+ declarativeVideoStreams[videoStream.id] = convertSdkRemoteStreamToDeclarativeRemoteStream(videoStream);
1371
+ }
1372
+ return {
1373
+ identifier: participant.identifier,
1374
+ displayName: participant.displayName,
1375
+ state: participant.state,
1376
+ callEndReason: participant.callEndReason,
1377
+ videoStreams: declarativeVideoStreams,
1378
+ isMuted: participant.isMuted,
1379
+ isSpeaking: participant.isSpeaking
1380
+ };
1381
+ }
1382
+ /**
1383
+ * @private
1384
+ *
1385
+ * Note at the time of writing only one LocalVideoStream is supported by the SDK.
1386
+ */
1387
+ function convertSdkCallToDeclarativeCall(call) {
1388
+ const declarativeRemoteParticipants = {};
1389
+ call.remoteParticipants.forEach((participant) => {
1390
+ declarativeRemoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] =
1391
+ convertSdkParticipantToDeclarativeParticipant(participant);
1392
+ });
1393
+ return {
1394
+ id: call.id,
1395
+ /* @conditional-compile-remove(teams-identity-support) */
1396
+ kind: _isACSCall(call) ? 'Call' : 'TeamsCall',
1397
+ callerInfo: call.callerInfo,
1398
+ state: call.state,
1399
+ callEndReason: call.callEndReason,
1400
+ diagnostics: {
1401
+ network: {
1402
+ latest: {}
1403
+ },
1404
+ media: {
1405
+ latest: {}
1406
+ }
1407
+ },
1408
+ direction: call.direction,
1409
+ isMuted: call.isMuted,
1410
+ isScreenSharingOn: call.isScreenSharingOn,
1411
+ localVideoStreams: call.localVideoStreams.map(convertSdkLocalStreamToDeclarativeLocalStream),
1412
+ remoteParticipants: declarativeRemoteParticipants,
1413
+ remoteParticipantsEnded: {},
1414
+ recording: { isRecordingActive: false },
1415
+ transcription: { isTranscriptionActive: false },
1416
+ screenShareRemoteParticipant: undefined,
1417
+ startTime: new Date(),
1418
+ endTime: undefined,
1419
+ /* @conditional-compile-remove(rooms) */
1420
+ role: call.role,
1421
+ /* @conditional-compile-remove(close-captions) */
1422
+ captionsFeature: {
1423
+ captions: [],
1424
+ supportedSpokenLanguages: [],
1425
+ supportedCaptionLanguages: [],
1426
+ currentCaptionLanguage: '',
1427
+ currentSpokenLanguage: '',
1428
+ isCaptionsFeatureActive: false
1429
+ }
1430
+ };
1431
+ }
1432
+ /**
1433
+ * @private
1434
+ */
1435
+ function convertSdkIncomingCallToDeclarativeIncomingCall(call) {
1436
+ return {
1437
+ id: call.id,
1438
+ callerInfo: call.callerInfo,
1439
+ startTime: new Date(),
1440
+ endTime: undefined
1441
+ };
1442
+ }
1443
+ /**
1444
+ * @private
1445
+ */
1446
+ function convertFromSDKToDeclarativeVideoStreamRendererView(view) {
1447
+ return {
1448
+ scalingMode: view.scalingMode,
1449
+ isMirrored: view.isMirrored,
1450
+ target: view.target
1451
+ };
1452
+ }
1453
+ /* @conditional-compile-remove(close-captions) */
1454
+ /**
1455
+ * @private
1456
+ */
1457
+ function convertFromSDKToCaptionInfoState(caption) {
1458
+ return Object.assign({}, caption);
1459
+ }
1460
+
1461
+ // Copyright (c) Microsoft Corporation.
1462
+ // Licensed under the MIT license.
1463
+ var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1199
1464
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1200
1465
  return new (P || (P = Promise))(function (resolve, reject) {
1201
1466
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1313,6 +1578,10 @@ class CallContext$2 {
1313
1578
  /* @conditional-compile-remove(total-participant-count) */
1314
1579
  existingCall.totalParticipantCount = call.totalParticipantCount;
1315
1580
  // We don't update the startTime and endTime if we are updating an existing active call
1581
+ /* @conditional-compile-remove(close-captions) */
1582
+ existingCall.captionsFeature.currentSpokenLanguage = call.captionsFeature.currentSpokenLanguage;
1583
+ /* @conditional-compile-remove(close-captions) */
1584
+ existingCall.captionsFeature.currentCaptionLanguage = call.captionsFeature.currentCaptionLanguage;
1316
1585
  }
1317
1586
  else {
1318
1587
  draft.calls[latestCallId] = call;
@@ -1770,212 +2039,188 @@ class CallContext$2 {
1770
2039
  this._atomicId++;
1771
2040
  return id;
1772
2041
  }
1773
- /**
1774
- * Tees any errors encountered in an async function to the state.
1775
- *
1776
- * @param action Async function to execute.
1777
- * @param target The error target to tee error to.
1778
- * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.
1779
- * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
1780
- */
1781
- withAsyncErrorTeedToState(action, target) {
1782
- return (...args) => __awaiter$A(this, void 0, void 0, function* () {
1783
- try {
1784
- return yield action(...args);
2042
+ /* @conditional-compile-remove(close-captions) */
2043
+ processNewCaption(captions, newCaption) {
2044
+ // going through current captions to find the last caption said by the same speaker, remove that caption if it's partial and replace with the new caption
2045
+ for (let index = captions.length - 1; index >= 0; index--) {
2046
+ const currentCaption = captions[index];
2047
+ if (currentCaption &&
2048
+ currentCaption.resultType !== 'Final' &&
2049
+ currentCaption.speaker.identifier &&
2050
+ newCaption.speaker.identifier &&
2051
+ toFlatCommunicationIdentifier(currentCaption.speaker.identifier) ===
2052
+ toFlatCommunicationIdentifier(newCaption.speaker.identifier)) {
2053
+ captions.splice(index, 1);
2054
+ break;
1785
2055
  }
1786
- catch (error) {
1787
- const callError = toCallError(target, error);
1788
- this.setLatestError(target, callError);
1789
- throw callError;
2056
+ }
2057
+ captions.push(newCaption);
2058
+ // If the array length exceeds 50, remove the oldest caption
2059
+ if (captions.length > 50) {
2060
+ captions.shift();
2061
+ }
2062
+ }
2063
+ /* @conditional-compile-remove(close-captions) */
2064
+ addCaption(callId, caption) {
2065
+ this.modifyState((draft) => {
2066
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
2067
+ if (call) {
2068
+ this.processNewCaption(call.captionsFeature.captions, convertFromSDKToCaptionInfoState(caption));
1790
2069
  }
1791
2070
  });
1792
2071
  }
1793
- /**
1794
- * Tees any errors encountered in an function to the state.
1795
- *
1796
- * @param action Function to execute.
1797
- * @param target The error target to tee error to.
1798
- * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.
1799
- * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
1800
- */
1801
- withErrorTeedToState(action, target) {
1802
- return (...args) => {
1803
- try {
1804
- callingStatefulLogger.info(`Calling stateful client target function called: ${target}`);
1805
- return action(...args);
1806
- }
1807
- catch (error) {
1808
- const callError = toCallError(target, error);
1809
- this.setLatestError(target, callError);
1810
- throw callError;
2072
+ /* @conditional-compile-remove(close-captions) */
2073
+ setIsCaptionActive(callId, isCaptionsActive) {
2074
+ this.modifyState((draft) => {
2075
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
2076
+ if (call) {
2077
+ call.captionsFeature.isCaptionsFeatureActive = isCaptionsActive;
1811
2078
  }
1812
- };
2079
+ });
1813
2080
  }
1814
- setLatestError(target, error) {
2081
+ /* @conditional-compile-remove(close-captions) */
2082
+ setSelectedSpokenLanguage(callId, spokenLanguage) {
1815
2083
  this.modifyState((draft) => {
1816
- draft.latestErrors[target] = error;
2084
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
2085
+ if (call) {
2086
+ call.captionsFeature.currentSpokenLanguage = spokenLanguage;
2087
+ }
1817
2088
  });
1818
2089
  }
1819
- }
1820
- const toCallError = (target, error) => {
1821
- if (error instanceof Error) {
1822
- return new CallError(target, error);
1823
- }
1824
- return new CallError(target, new Error(error));
1825
- };
1826
- const findOldestCallEnded = (calls) => {
1827
- var _a, _b, _c, _d;
1828
- const callEntries = Object.entries(calls);
1829
- let [oldestCallId, oldestCall] = callEntries[0];
1830
- if (oldestCall.endTime === undefined) {
1831
- return oldestCallId;
2090
+ /* @conditional-compile-remove(close-captions) */
2091
+ setSelectedCaptionLanguage(callId, captionLanguage) {
2092
+ this.modifyState((draft) => {
2093
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
2094
+ if (call) {
2095
+ call.captionsFeature.currentCaptionLanguage = captionLanguage;
2096
+ }
2097
+ });
1832
2098
  }
1833
- for (const [callId, call] of callEntries.slice(1)) {
1834
- if (call.endTime === undefined) {
1835
- return callId;
1836
- }
1837
- if (((_b = (_a = call.endTime) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : 0) < ((_d = (_c = oldestCall.endTime) === null || _c === void 0 ? void 0 : _c.getTime()) !== null && _d !== void 0 ? _d : 0)) {
1838
- [oldestCallId, oldestCall] = [callId, call];
1839
- }
2099
+ /* @conditional-compile-remove(close-captions) */
2100
+ setAvailableCaptionLanguages(callId, captionLanguages) {
2101
+ this.modifyState((draft) => {
2102
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
2103
+ if (call) {
2104
+ call.captionsFeature.supportedCaptionLanguages = captionLanguages;
2105
+ }
2106
+ });
1840
2107
  }
1841
- return oldestCallId;
1842
- };
1843
-
1844
- // Copyright (c) Microsoft Corporation.
1845
- // Licensed under the MIT license.
1846
- /**
1847
- * @internal
1848
- */
1849
- const _isACSCall = (call) => {
1850
- /* @conditional-compile-remove(teams-identity-support) */
1851
- return !call.kind || call.kind === 'Call';
1852
- };
1853
- /**
1854
- * @internal
1855
- */
1856
- const _isACSCallAgent = (callAgent) => {
1857
- /* @conditional-compile-remove(teams-identity-support) */
1858
- return !callAgent.kind || callAgent.kind === 'CallAgent';
1859
- };
1860
- /**
1861
- * @internal
1862
- */
1863
- const _isTeamsCall = (call) => {
1864
- /* @conditional-compile-remove(teams-identity-support) */
1865
- return call.kind === 'TeamsCall';
1866
- };
1867
- /**
1868
- * @internal
1869
- */
1870
- const _isTeamsCallAgent = (callAgent) => {
1871
- /* @conditional-compile-remove(teams-identity-support) */
1872
- return callAgent.kind === 'TeamsCallAgent';
1873
- };
1874
-
1875
- // Copyright (c) Microsoft Corporation.
1876
- /**
1877
- * @private
1878
- */
1879
- function convertSdkLocalStreamToDeclarativeLocalStream(stream) {
1880
- return {
1881
- source: stream.source,
1882
- mediaStreamType: stream.mediaStreamType,
1883
- view: undefined
1884
- // TODO [video-background-effects]: Add video effects state when it is added to the SDK
1885
- };
1886
- }
1887
- /**
1888
- * @private
1889
- */
1890
- function convertSdkRemoteStreamToDeclarativeRemoteStream(stream) {
1891
- return {
1892
- id: stream.id,
1893
- mediaStreamType: stream.mediaStreamType,
1894
- isAvailable: stream.isAvailable,
1895
- /* @conditional-compile-remove(video-stream-is-receiving-flag) */
1896
- isReceiving: stream.isReceiving,
1897
- view: undefined
1898
- };
1899
- }
1900
- /**
1901
- * @private
1902
- */
1903
- function convertSdkParticipantToDeclarativeParticipant(participant) {
1904
- const declarativeVideoStreams = {};
1905
- for (const videoStream of participant.videoStreams) {
1906
- declarativeVideoStreams[videoStream.id] = convertSdkRemoteStreamToDeclarativeRemoteStream(videoStream);
2108
+ /* @conditional-compile-remove(close-captions) */
2109
+ setAvailableSpokenLanguages(callId, spokenLanguages) {
2110
+ this.modifyState((draft) => {
2111
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
2112
+ if (call) {
2113
+ call.captionsFeature.supportedSpokenLanguages = spokenLanguages;
2114
+ }
2115
+ });
1907
2116
  }
1908
- return {
1909
- identifier: participant.identifier,
1910
- displayName: participant.displayName,
1911
- state: participant.state,
1912
- callEndReason: participant.callEndReason,
1913
- videoStreams: declarativeVideoStreams,
1914
- isMuted: participant.isMuted,
1915
- isSpeaking: participant.isSpeaking
1916
- };
1917
- }
1918
- /**
1919
- * @private
1920
- *
1921
- * Note at the time of writing only one LocalVideoStream is supported by the SDK.
1922
- */
1923
- function convertSdkCallToDeclarativeCall(call) {
1924
- const declarativeRemoteParticipants = {};
1925
- call.remoteParticipants.forEach((participant) => {
1926
- declarativeRemoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] =
1927
- convertSdkParticipantToDeclarativeParticipant(participant);
1928
- });
1929
- return {
1930
- id: call.id,
1931
- /* @conditional-compile-remove(teams-identity-support) */
1932
- kind: _isACSCall(call) ? 'Call' : 'TeamsCall',
1933
- callerInfo: call.callerInfo,
1934
- state: call.state,
1935
- callEndReason: call.callEndReason,
1936
- diagnostics: {
1937
- network: {
1938
- latest: {}
1939
- },
1940
- media: {
1941
- latest: {}
2117
+ /**
2118
+ * Tees any errors encountered in an async function to the state.
2119
+ *
2120
+ * @param action Async function to execute.
2121
+ * @param target The error target to tee error to.
2122
+ * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.
2123
+ * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
2124
+ */
2125
+ withAsyncErrorTeedToState(action, target) {
2126
+ return (...args) => __awaiter$E(this, void 0, void 0, function* () {
2127
+ try {
2128
+ return yield action(...args);
2129
+ }
2130
+ catch (error) {
2131
+ const callError = toCallError(target, error);
2132
+ this.setLatestError(target, callError);
2133
+ throw callError;
1942
2134
  }
1943
- },
1944
- direction: call.direction,
1945
- isMuted: call.isMuted,
1946
- isScreenSharingOn: call.isScreenSharingOn,
1947
- localVideoStreams: call.localVideoStreams.map(convertSdkLocalStreamToDeclarativeLocalStream),
1948
- remoteParticipants: declarativeRemoteParticipants,
1949
- remoteParticipantsEnded: {},
1950
- recording: { isRecordingActive: false },
1951
- transcription: { isTranscriptionActive: false },
1952
- screenShareRemoteParticipant: undefined,
1953
- startTime: new Date(),
1954
- endTime: undefined,
1955
- /* @conditional-compile-remove(rooms) */
1956
- role: call.role
1957
- };
1958
- }
1959
- /**
1960
- * @private
1961
- */
1962
- function convertSdkIncomingCallToDeclarativeIncomingCall(call) {
1963
- return {
1964
- id: call.id,
1965
- callerInfo: call.callerInfo,
1966
- startTime: new Date(),
1967
- endTime: undefined
1968
- };
2135
+ });
2136
+ }
2137
+ /**
2138
+ * Tees any errors encountered in an function to the state.
2139
+ *
2140
+ * @param action Function to execute.
2141
+ * @param target The error target to tee error to.
2142
+ * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.
2143
+ * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
2144
+ */
2145
+ withErrorTeedToState(action, target) {
2146
+ return (...args) => {
2147
+ try {
2148
+ callingStatefulLogger.info(`Calling stateful client target function called: ${target}`);
2149
+ return action(...args);
2150
+ }
2151
+ catch (error) {
2152
+ const callError = toCallError(target, error);
2153
+ this.setLatestError(target, callError);
2154
+ throw callError;
2155
+ }
2156
+ };
2157
+ }
2158
+ setLatestError(target, error) {
2159
+ this.modifyState((draft) => {
2160
+ draft.latestErrors[target] = error;
2161
+ });
2162
+ }
1969
2163
  }
2164
+ const toCallError = (target, error) => {
2165
+ if (error instanceof Error) {
2166
+ return new CallError(target, error);
2167
+ }
2168
+ return new CallError(target, new Error(error));
2169
+ };
2170
+ const findOldestCallEnded = (calls) => {
2171
+ var _a, _b, _c, _d;
2172
+ const callEntries = Object.entries(calls);
2173
+ let [oldestCallId, oldestCall] = callEntries[0];
2174
+ if (oldestCall.endTime === undefined) {
2175
+ return oldestCallId;
2176
+ }
2177
+ for (const [callId, call] of callEntries.slice(1)) {
2178
+ if (call.endTime === undefined) {
2179
+ return callId;
2180
+ }
2181
+ if (((_b = (_a = call.endTime) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : 0) < ((_d = (_c = oldestCall.endTime) === null || _c === void 0 ? void 0 : _c.getTime()) !== null && _d !== void 0 ? _d : 0)) {
2182
+ [oldestCallId, oldestCall] = [callId, call];
2183
+ }
2184
+ }
2185
+ return oldestCallId;
2186
+ };
2187
+
2188
+ // Copyright (c) Microsoft Corporation.
2189
+ // Licensed under the MIT license.
2190
+ /* @conditional-compile-remove(close-captions) */
1970
2191
  /**
1971
2192
  * @private
1972
2193
  */
1973
- function convertFromSDKToDeclarativeVideoStreamRendererView(view) {
1974
- return {
1975
- scalingMode: view.scalingMode,
1976
- isMirrored: view.isMirrored,
1977
- target: view.target
1978
- };
2194
+ class CaptionsSubscriber {
2195
+ constructor(callIdRef, context, captions) {
2196
+ this.subscribe = () => {
2197
+ this._captions.on('isCaptionsActiveChanged', this.isCaptionsActiveChanged);
2198
+ this._captions.on('captionsReceived', this.onCaptionsReceived);
2199
+ };
2200
+ this.unsubscribe = () => {
2201
+ this._captions.off('isCaptionsActiveChanged', this.isCaptionsActiveChanged);
2202
+ this._captions.off('captionsReceived', this.onCaptionsReceived);
2203
+ };
2204
+ this.onCaptionsReceived = (caption) => {
2205
+ this._context.addCaption(this._callIdRef.callId, caption);
2206
+ this._context.setSelectedSpokenLanguage(this._callIdRef.callId, caption.spokenLanguage);
2207
+ this._context.setSelectedCaptionLanguage(this._callIdRef.callId, caption.spokenLanguage);
2208
+ };
2209
+ this.isCaptionsActiveChanged = () => {
2210
+ this._context.setIsCaptionActive(this._callIdRef.callId, this._captions.isCaptionsFeatureActive);
2211
+ };
2212
+ this._callIdRef = callIdRef;
2213
+ this._context = context;
2214
+ this._captions = captions;
2215
+ if (this._captions.isCaptionsFeatureActive) {
2216
+ this._context.setIsCaptionActive(this._callIdRef.callId, this._captions.isCaptionsFeatureActive);
2217
+ }
2218
+ this._context.setAvailableSpokenLanguages(this._callIdRef.callId, this._captions.supportedSpokenLanguages);
2219
+ if ('availableSubtitleLanguages' in this._captions) {
2220
+ this._context.setAvailableCaptionLanguages(this._callIdRef.callId, this._captions.supportedCaptionLanguages);
2221
+ }
2222
+ this.subscribe();
2223
+ }
1979
2224
  }
1980
2225
 
1981
2226
  // Copyright (c) Microsoft Corporation.
@@ -2306,7 +2551,7 @@ function _logStreamEvent(eventName, streamLogInfo, error) {
2306
2551
 
2307
2552
  // Copyright (c) Microsoft Corporation.
2308
2553
  // Licensed under the MIT license.
2309
- var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2554
+ var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2310
2555
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2311
2556
  return new (P || (P = Promise))(function (resolve, reject) {
2312
2557
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -2316,7 +2561,7 @@ var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments,
2316
2561
  });
2317
2562
  };
2318
2563
  function createViewVideo(context, internalContext, callId, stream, participantId, options) {
2319
- return __awaiter$z(this, void 0, void 0, function* () {
2564
+ return __awaiter$D(this, void 0, void 0, function* () {
2320
2565
  // we can only have 3 types of createView
2321
2566
  let streamEventType;
2322
2567
  // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.
@@ -2438,7 +2683,7 @@ function createViewVideo(context, internalContext, callId, stream, participantId
2438
2683
  });
2439
2684
  }
2440
2685
  function createViewUnparentedVideo(context, internalContext, stream, options) {
2441
- return __awaiter$z(this, void 0, void 0, function* () {
2686
+ return __awaiter$D(this, void 0, void 0, function* () {
2442
2687
  const renderInfo = internalContext.getUnparentedRenderInfo(stream);
2443
2688
  if (renderInfo && renderInfo.status === 'Rendered') {
2444
2689
  console.warn('Unparented LocalVideoStream is already rendered');
@@ -2606,7 +2851,7 @@ function createView(context, internalContext, callId, participantId, stream, opt
2606
2851
  // Render LocalVideoStream that is not part of a Call
2607
2852
  // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).
2608
2853
  // We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.
2609
- return context.withAsyncErrorTeedToState(() => __awaiter$z(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
2854
+ return context.withAsyncErrorTeedToState(() => __awaiter$D(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
2610
2855
  }
2611
2856
  else {
2612
2857
  _logStreamEvent(EventNames.CREATE_STREAM_INVALID_PARAMS, { streamType });
@@ -2889,6 +3134,8 @@ class CallSubscriber {
2889
3134
  constructor(call, context, internalContext) {
2890
3135
  this.subscribe = () => {
2891
3136
  this._call.on('stateChanged', this.stateChanged);
3137
+ /* @conditional-compile-remove(close-captions) */
3138
+ this._call.on('stateChanged', this.initCaptionSubscriber);
2892
3139
  this._call.on('idChanged', this.idChanged);
2893
3140
  this._call.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged);
2894
3141
  this._call.on('remoteParticipantsUpdated', this.remoteParticipantsUpdated);
@@ -2911,7 +3158,10 @@ class CallSubscriber {
2911
3158
  }
2912
3159
  };
2913
3160
  this.unsubscribe = () => {
3161
+ var _a;
2914
3162
  this._call.off('stateChanged', this.stateChanged);
3163
+ /* @conditional-compile-remove(close-captions) */
3164
+ this._call.off('stateChanged', this.initCaptionSubscriber);
2915
3165
  this._call.off('idChanged', this.idChanged);
2916
3166
  this._call.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged);
2917
3167
  this._call.off('remoteParticipantsUpdated', this.remoteParticipantsUpdated);
@@ -2934,10 +3184,20 @@ class CallSubscriber {
2934
3184
  this._diagnosticsSubscriber.unsubscribe();
2935
3185
  this._recordingSubscriber.unsubscribe();
2936
3186
  this._transcriptionSubscriber.unsubscribe();
3187
+ /* @conditional-compile-remove(close-captions) */
3188
+ (_a = this._captionsSubscriber) === null || _a === void 0 ? void 0 : _a.unsubscribe();
2937
3189
  };
2938
3190
  this.stateChanged = () => {
2939
3191
  this._context.setCallState(this._callIdRef.callId, this._call.state);
2940
3192
  };
3193
+ /* @conditional-compile-remove(close-captions) */
3194
+ this.initCaptionSubscriber = () => {
3195
+ // subscribe to captions here so that we don't call captions when call is not initialized
3196
+ if (_isTeamsMeetingCall(this._call) && this._call.state === 'Connected' && !this._captionsSubscriber) {
3197
+ this._captionsSubscriber = new CaptionsSubscriber(this._callIdRef, this._context, this._call.feature(communicationCalling.Features.TeamsCaptions));
3198
+ this._call.off('stateChanged', this.initCaptionSubscriber);
3199
+ }
3200
+ };
2941
3201
  this.idChanged = () => {
2942
3202
  this._internalContext.setCallId(this._call.id, this._callIdRef.callId);
2943
3203
  this._context.setCallId(this._call.id, this._callIdRef.callId);
@@ -3040,7 +3300,7 @@ class CallSubscriber {
3040
3300
 
3041
3301
  // Copyright (c) Microsoft Corporation.
3042
3302
  // Licensed under the MIT license.
3043
- var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3303
+ var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3044
3304
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3045
3305
  return new (P || (P = Promise))(function (resolve, reject) {
3046
3306
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3060,14 +3320,14 @@ class ProxyIncomingCall {
3060
3320
  switch (prop) {
3061
3321
  case 'accept': {
3062
3322
  return this._context.withAsyncErrorTeedToState(function (...args) {
3063
- return __awaiter$y(this, void 0, void 0, function* () {
3323
+ return __awaiter$C(this, void 0, void 0, function* () {
3064
3324
  return yield target.accept(...args);
3065
3325
  });
3066
3326
  }, 'IncomingCall.accept');
3067
3327
  }
3068
3328
  case 'reject': {
3069
3329
  return this._context.withAsyncErrorTeedToState(function (...args) {
3070
- return __awaiter$y(this, void 0, void 0, function* () {
3330
+ return __awaiter$C(this, void 0, void 0, function* () {
3071
3331
  return yield target.reject(...args);
3072
3332
  });
3073
3333
  }, 'IncomingCall.reject');
@@ -3304,7 +3564,7 @@ const clearCallRelatedState = (context, internalContext) => {
3304
3564
 
3305
3565
  // Copyright (c) Microsoft Corporation.
3306
3566
  // Licensed under the MIT license.
3307
- var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3567
+ var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3308
3568
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3309
3569
  return new (P || (P = Promise))(function (resolve, reject) {
3310
3570
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3330,60 +3590,114 @@ class ProxyCallCommon {
3330
3590
  switch (prop) {
3331
3591
  case 'mute': {
3332
3592
  return this._context.withAsyncErrorTeedToState(function (...args) {
3333
- return __awaiter$x(this, void 0, void 0, function* () {
3593
+ return __awaiter$B(this, void 0, void 0, function* () {
3334
3594
  return yield target.mute(...args);
3335
3595
  });
3336
3596
  }, 'Call.mute');
3337
3597
  }
3338
3598
  case 'unmute': {
3339
3599
  return this._context.withAsyncErrorTeedToState(function (...args) {
3340
- return __awaiter$x(this, void 0, void 0, function* () {
3600
+ return __awaiter$B(this, void 0, void 0, function* () {
3341
3601
  return yield target.unmute(...args);
3342
3602
  });
3343
3603
  }, 'Call.unmute');
3344
3604
  }
3345
3605
  case 'startVideo': {
3346
3606
  return this._context.withAsyncErrorTeedToState(function (...args) {
3347
- return __awaiter$x(this, void 0, void 0, function* () {
3607
+ return __awaiter$B(this, void 0, void 0, function* () {
3348
3608
  return yield target.startVideo(...args);
3349
3609
  });
3350
3610
  }, 'Call.startVideo');
3351
3611
  }
3352
3612
  case 'stopVideo': {
3353
3613
  return this._context.withAsyncErrorTeedToState(function (...args) {
3354
- return __awaiter$x(this, void 0, void 0, function* () {
3614
+ return __awaiter$B(this, void 0, void 0, function* () {
3355
3615
  return yield target.stopVideo(...args);
3356
3616
  });
3357
3617
  }, 'Call.stopVideo');
3358
3618
  }
3359
3619
  case 'startScreenSharing': {
3360
3620
  return this._context.withAsyncErrorTeedToState(function (...args) {
3361
- return __awaiter$x(this, void 0, void 0, function* () {
3621
+ return __awaiter$B(this, void 0, void 0, function* () {
3362
3622
  return yield target.startScreenSharing(...args);
3363
3623
  });
3364
3624
  }, 'Call.startScreenSharing');
3365
3625
  }
3366
3626
  case 'stopScreenSharing': {
3367
3627
  return this._context.withAsyncErrorTeedToState(function (...args) {
3368
- return __awaiter$x(this, void 0, void 0, function* () {
3628
+ return __awaiter$B(this, void 0, void 0, function* () {
3369
3629
  return yield target.stopScreenSharing(...args);
3370
3630
  });
3371
3631
  }, 'Call.stopScreenSharing');
3372
3632
  }
3373
3633
  case 'hold': {
3374
3634
  return this._context.withAsyncErrorTeedToState(function (...args) {
3375
- return __awaiter$x(this, void 0, void 0, function* () {
3635
+ return __awaiter$B(this, void 0, void 0, function* () {
3376
3636
  return yield target.hold(...args);
3377
3637
  });
3378
3638
  }, 'Call.hold');
3379
3639
  }
3380
3640
  case 'resume': {
3381
3641
  return this._context.withAsyncErrorTeedToState(function (...args) {
3382
- return __awaiter$x(this, void 0, void 0, function* () {
3642
+ return __awaiter$B(this, void 0, void 0, function* () {
3383
3643
  return yield target.resume(...args);
3384
3644
  });
3385
3645
  }, 'Call.resume');
3386
3646
  }
3647
+ case 'feature': {
3648
+ // these are mini version of Proxy object - if it grows too big, a real Proxy object should be used.
3649
+ return this._context.withErrorTeedToState((...args) => {
3650
+ /* @conditional-compile-remove(close-captions) */
3651
+ if (args[0] === communicationCalling.Features.TeamsCaptions) {
3652
+ const captionsFeature = target.feature(communicationCalling.Features.TeamsCaptions);
3653
+ const proxyFeature = new ProxyTeamsCaptionsFeature(this._context, target);
3654
+ return new Proxy(captionsFeature, proxyFeature);
3655
+ }
3656
+ return target.feature(...args);
3657
+ }, 'Call.feature');
3658
+ }
3659
+ default:
3660
+ return Reflect.get(target, prop);
3661
+ }
3662
+ }
3663
+ }
3664
+ /* @conditional-compile-remove(close-captions) */
3665
+ /**
3666
+ * @private
3667
+ */
3668
+ class ProxyTeamsCaptionsFeature {
3669
+ constructor(context, call) {
3670
+ this._context = context;
3671
+ this._call = call;
3672
+ }
3673
+ get(target, prop) {
3674
+ switch (prop) {
3675
+ case 'startCaptions':
3676
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$B(this, void 0, void 0, function* () {
3677
+ var _a, _b;
3678
+ const ret = yield target.startCaptions(...args);
3679
+ this._context.setIsCaptionActive(this._call.id, true);
3680
+ this._context.setSelectedSpokenLanguage(this._call.id, (_b = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.spokenLanguage) !== null && _b !== void 0 ? _b : 'en-us');
3681
+ return ret;
3682
+ }), 'Call.feature');
3683
+ case 'stopCaptions':
3684
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$B(this, void 0, void 0, function* () {
3685
+ const ret = yield target.stopCaptions(...args);
3686
+ this._context.setIsCaptionActive(this._call.id, false);
3687
+ return ret;
3688
+ }), 'Call.feature');
3689
+ case 'setSpokenLanguage':
3690
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$B(this, void 0, void 0, function* () {
3691
+ const ret = yield target.setSpokenLanguage(...args);
3692
+ this._context.setSelectedSpokenLanguage(this._call.id, args[0]);
3693
+ return ret;
3694
+ }), 'Call.feature');
3695
+ case 'setCaptionLanguage':
3696
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$B(this, void 0, void 0, function* () {
3697
+ const ret = yield target.setCaptionLanguage(...args);
3698
+ this._context.setSelectedCaptionLanguage(this._call.id, args[0]);
3699
+ return ret;
3700
+ }), 'Call.feature');
3387
3701
  default:
3388
3702
  return Reflect.get(target, prop);
3389
3703
  }
@@ -3392,7 +3706,7 @@ class ProxyCallCommon {
3392
3706
 
3393
3707
  // Copyright (c) Microsoft Corporation.
3394
3708
  // Licensed under the MIT license.
3395
- var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3709
+ var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3396
3710
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3397
3711
  return new (P || (P = Promise))(function (resolve, reject) {
3398
3712
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3406,7 +3720,7 @@ class ProxyCall extends ProxyCallCommon {
3406
3720
  switch (prop) {
3407
3721
  case 'addParticipant': {
3408
3722
  return this.getContext().withAsyncErrorTeedToState(function (...args) {
3409
- return __awaiter$w(this, void 0, void 0, function* () {
3723
+ return __awaiter$A(this, void 0, void 0, function* () {
3410
3724
  return yield target.addParticipant(...args);
3411
3725
  });
3412
3726
  }, 'Call.addParticipant');
@@ -3627,7 +3941,7 @@ class InternalCallContext {
3627
3941
 
3628
3942
  // Copyright (c) Microsoft Corporation.
3629
3943
  // Licensed under the MIT license.
3630
- var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3944
+ var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3631
3945
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3632
3946
  return new (P || (P = Promise))(function (resolve, reject) {
3633
3947
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3642,7 +3956,7 @@ class ProxyTeamsCall extends ProxyCallCommon {
3642
3956
  switch (prop) {
3643
3957
  case 'addParticipant': {
3644
3958
  return this.getContext().withAsyncErrorTeedToState(function (...args) {
3645
- return __awaiter$v(this, void 0, void 0, function* () {
3959
+ return __awaiter$z(this, void 0, void 0, function* () {
3646
3960
  return yield target.addParticipant(...args);
3647
3961
  });
3648
3962
  }, 'TeamsCall.addParticipant');
@@ -3757,7 +4071,7 @@ const teamsCallAgentDeclaratify = (callAgent, context, internalContext) => {
3757
4071
 
3758
4072
  // Copyright (c) Microsoft Corporation.
3759
4073
  // Licensed under the MIT license.
3760
- var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4074
+ var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3761
4075
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3762
4076
  return new (P || (P = Promise))(function (resolve, reject) {
3763
4077
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3779,7 +4093,7 @@ class ProxyVideoStreamRendererView {
3779
4093
  get(target, prop) {
3780
4094
  switch (prop) {
3781
4095
  case 'updateScalingMode': {
3782
- return (...args) => __awaiter$u(this, void 0, void 0, function* () {
4096
+ return (...args) => __awaiter$y(this, void 0, void 0, function* () {
3783
4097
  yield target.updateScalingMode(...args);
3784
4098
  this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);
3785
4099
  });
@@ -3800,7 +4114,7 @@ const videoStreamRendererViewDeclaratify = (view, context, callId, participantId
3800
4114
 
3801
4115
  // Copyright (c) Microsoft Corporation.
3802
4116
  // Licensed under the MIT license.
3803
- var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4117
+ var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3804
4118
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3805
4119
  return new (P || (P = Promise))(function (resolve, reject) {
3806
4120
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3822,7 +4136,7 @@ class ProxyCallClient {
3822
4136
  get(target, prop) {
3823
4137
  switch (prop) {
3824
4138
  case 'createCallAgent': {
3825
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$t(this, void 0, void 0, function* () {
4139
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$x(this, void 0, void 0, function* () {
3826
4140
  // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
3827
4141
  // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
3828
4142
  // callAgent if the createCallAgent succeeds.
@@ -3835,7 +4149,7 @@ class ProxyCallClient {
3835
4149
  }), 'CallClient.createCallAgent');
3836
4150
  }
3837
4151
  case 'createTeamsCallAgent': {
3838
- /* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$t(this, void 0, void 0, function* () {
4152
+ /* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$x(this, void 0, void 0, function* () {
3839
4153
  // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
3840
4154
  // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
3841
4155
  // callAgent if the createCallAgent succeeds.
@@ -3848,7 +4162,7 @@ class ProxyCallClient {
3848
4162
  }), 'CallClient.createTeamsCallAgent');
3849
4163
  }
3850
4164
  case 'getDeviceManager': {
3851
- return this._context.withAsyncErrorTeedToState(() => __awaiter$t(this, void 0, void 0, function* () {
4165
+ return this._context.withAsyncErrorTeedToState(() => __awaiter$x(this, void 0, void 0, function* () {
3852
4166
  // As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of
3853
4167
  // DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll
3854
4168
  // throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.
@@ -3877,7 +4191,7 @@ class ProxyCallClient {
3877
4191
  /**
3878
4192
  * add to this object if we want to proxy anything else off the DebugInfo feature object.
3879
4193
  */
3880
- return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$t(this, void 0, void 0, function* () {
4194
+ return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$x(this, void 0, void 0, function* () {
3881
4195
  const environmentInfo = yield feature.getEnvironmentInfo();
3882
4196
  this._context.setEnvironmentInfo(environmentInfo);
3883
4197
  return environmentInfo;
@@ -3930,7 +4244,7 @@ const createStatefulCallClientWithDeps = (callClient, context, internalContext)
3930
4244
  });
3931
4245
  Object.defineProperty(callClient, 'createView', {
3932
4246
  configurable: false,
3933
- value: (callId, participantId, stream, options) => __awaiter$t(void 0, void 0, void 0, function* () {
4247
+ value: (callId, participantId, stream, options) => __awaiter$x(void 0, void 0, void 0, function* () {
3934
4248
  const participantIdKind = participantId ? communicationCommon.getIdentifierKind(participantId) : undefined;
3935
4249
  const result = yield createView(context, internalContext, callId, participantIdKind, stream, options);
3936
4250
  // We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.
@@ -4692,6 +5006,10 @@ function chunk(options, itemsPerRow) {
4692
5006
  }
4693
5007
  return rows;
4694
5008
  }
5009
+ /**
5010
+ * @private
5011
+ */
5012
+ const defaultSpokenLanguage$1 = 'en-us';
4695
5013
 
4696
5014
  // Copyright (c) Microsoft Corporation.
4697
5015
  /**
@@ -5357,7 +5675,15 @@ const DEFAULT_COMPONENT_ICONS = {
5357
5675
  /* @conditional-compile-remove(vertical-gallery) */
5358
5676
  VerticalGalleryRightButton: React__default['default'].createElement(reactIcons.ChevronRight20Regular, null),
5359
5677
  /* @conditional-compile-remove(video-background-effects) */
5360
- OptionsVideoBackgroundEffect: React__default['default'].createElement(reactIcons.VideoBackgroundEffect20Regular, null)
5678
+ OptionsVideoBackgroundEffect: React__default['default'].createElement(reactIcons.VideoBackgroundEffect20Regular, null),
5679
+ /* @conditional-compile-remove(close-captions) */
5680
+ CaptionsIcon: React__default['default'].createElement(reactIcons.ClosedCaption20Regular, null),
5681
+ /* @conditional-compile-remove(close-captions) */
5682
+ CaptionsOffIcon: React__default['default'].createElement(reactIcons.ClosedCaptionOff20Regular, null),
5683
+ /* @conditional-compile-remove(close-captions) */
5684
+ CaptionsSettingsIcon: React__default['default'].createElement(reactIcons.Settings20Regular, null),
5685
+ /* @conditional-compile-remove(close-captions) */
5686
+ ChangeSpokenLanguageIcon: React__default['default'].createElement(reactIcons.PersonVoice20Regular, null)
5361
5687
  };
5362
5688
 
5363
5689
  // Copyright (c) Microsoft Corporation.
@@ -6952,7 +7278,7 @@ const chatMessageActionMenuProps = (menuProps) => {
6952
7278
  return actionMenuProps;
6953
7279
  };
6954
7280
 
6955
- var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7281
+ var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6956
7282
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6957
7283
  return new (P || (P = Promise))(function (resolve, reject) {
6958
7284
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -6977,7 +7303,7 @@ const _FileDownloadCards = (props) => {
6977
7303
  var _a, _b;
6978
7304
  return (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile) !== null && _b !== void 0 ? _b : localeStrings.downloadFile;
6979
7305
  }, [(_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile, localeStrings.downloadFile]);
6980
- const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$s(void 0, void 0, void 0, function* () {
7306
+ const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$w(void 0, void 0, void 0, function* () {
6981
7307
  if (!props.downloadHandler) {
6982
7308
  window.open(file.url, '_blank', 'noopener,noreferrer');
6983
7309
  }
@@ -7146,7 +7472,7 @@ const ChatMessageComponentAsMessageBubble = React__default['default'].memo(Messa
7146
7472
 
7147
7473
  // Copyright (c) Microsoft Corporation.
7148
7474
  // Licensed under the MIT license.
7149
- var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7475
+ var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7150
7476
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7151
7477
  return new (P || (P = Promise))(function (resolve, reject) {
7152
7478
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -7178,7 +7504,7 @@ const ChatMessageComponent = (props) => {
7178
7504
  onSendMessage && onSendMessage(content !== undefined ? content : '');
7179
7505
  }, [clientMessageId, content, onSendMessage, onDeleteMessage]);
7180
7506
  if (isEditing && message.messageType === 'chat') {
7181
- return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$r(void 0, void 0, void 0, function* () {
7507
+ return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$v(void 0, void 0, void 0, function* () {
7182
7508
  props.onUpdateMessage &&
7183
7509
  message.messageId &&
7184
7510
  (yield props.onUpdateMessage(message.messageId, text, metadata, options));
@@ -7289,7 +7615,7 @@ var getParticipantsWhoHaveReadMessage = (message, readReceiptsBySenderId) => {
7289
7615
 
7290
7616
  // Copyright (c) Microsoft Corporation.
7291
7617
  // Licensed under the MIT license.
7292
- var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7618
+ var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7293
7619
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7294
7620
  return new (P || (P = Promise))(function (resolve, reject) {
7295
7621
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -7509,7 +7835,7 @@ const MessageThread = (props) => {
7509
7835
  /* @conditional-compile-remove(teams-inline-images) */
7510
7836
  const [inlineAttachments, setInlineAttachments] = React.useState({});
7511
7837
  /* @conditional-compile-remove(teams-inline-images) */
7512
- const onFetchInlineAttachment = React.useCallback((attachment) => __awaiter$q(void 0, void 0, void 0, function* () {
7838
+ const onFetchInlineAttachment = React.useCallback((attachment) => __awaiter$u(void 0, void 0, void 0, function* () {
7513
7839
  if (!onFetchAttachments || attachment.id in inlineAttachments) {
7514
7840
  return;
7515
7841
  }
@@ -7551,7 +7877,7 @@ const MessageThread = (props) => {
7551
7877
  setChatMessagesInitialized(chatMessagesInitialized);
7552
7878
  };
7553
7879
  // we try to only send those message status if user is scrolled to the bottom.
7554
- const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
7880
+ const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$u(void 0, void 0, void 0, function* () {
7555
7881
  if (!isAtBottomOfScrollRef.current ||
7556
7882
  !document.hasFocus() ||
7557
7883
  !messagesRef.current ||
@@ -7602,7 +7928,7 @@ const MessageThread = (props) => {
7602
7928
  setIsAtBottomOfScrollRef(atBottom);
7603
7929
  }, [scrollToBottom, sendMessageStatusIfAtBottom]);
7604
7930
  // Infinite scrolling + threadInitialize function
7605
- const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
7931
+ const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$u(void 0, void 0, void 0, function* () {
7606
7932
  if (!isLoadingChatMessagesRef.current) {
7607
7933
  if (onLoadPreviousChatMessages) {
7608
7934
  isLoadingChatMessagesRef.current = true;
@@ -8320,6 +8646,7 @@ const DrawerMenuItem = (props) => {
8320
8646
  React__default['default'].createElement(react.Text, { styles: {
8321
8647
  root: { color: props.disabled ? theme.palette.neutralTertiaryAlt : theme.palette.neutralSecondary }
8322
8648
  } }, props.secondaryText))),
8649
+ props.secondaryComponent && React__default['default'].createElement(react.Stack.Item, null, props.secondaryComponent),
8323
8650
  secondaryIcon && React__default['default'].createElement(react.Stack.Item, null, secondaryIcon)));
8324
8651
  };
8325
8652
  const MenuItemIcon = (props) => (React__default['default'].createElement(react.FontIcon, Object.assign({ className: react.mergeStyles(iconStyles$1) }, props)));
@@ -11933,7 +12260,7 @@ const DevicesButton = (props) => {
11933
12260
 
11934
12261
  // Copyright (c) Microsoft Corporation.
11935
12262
  // Licensed under the MIT license.
11936
- var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12263
+ var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11937
12264
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11938
12265
  return new (P || (P = Promise))(function (resolve, reject) {
11939
12266
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -11971,7 +12298,7 @@ const CameraButton = (props) => {
11971
12298
  const toggleAnnouncerString = React.useCallback((isCameraOn) => {
11972
12299
  setAnnouncerString(!isCameraOn ? strings.cameraActionTurnedOffAnnouncement : strings.cameraActionTurnedOnAnnouncement);
11973
12300
  }, [strings.cameraActionTurnedOffAnnouncement, strings.cameraActionTurnedOnAnnouncement]);
11974
- const onToggleClick = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
12301
+ const onToggleClick = React.useCallback(() => __awaiter$t(void 0, void 0, void 0, function* () {
11975
12302
  // Throttle click on camera, need to await onToggleCamera then allow another click
11976
12303
  if (onToggleCamera) {
11977
12304
  setWaitForCamera(true);
@@ -12139,7 +12466,7 @@ const lightThemeCallButtonStyles = {
12139
12466
 
12140
12467
  // Copyright (c) Microsoft Corporation.
12141
12468
  // Licensed under the MIT license.
12142
- var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12469
+ var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12143
12470
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12144
12471
  return new (P || (P = Promise))(function (resolve, reject) {
12145
12472
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -12180,7 +12507,7 @@ const MicrophoneButton = (props) => {
12180
12507
  const toggleAnnouncerString = React.useCallback((isMicOn) => {
12181
12508
  setAnnouncerString(!isMicOn ? strings.microphoneActionTurnedOffAnnouncement : strings.microphoneActionTurnedOnAnnouncement);
12182
12509
  }, [strings.microphoneActionTurnedOffAnnouncement, strings.microphoneActionTurnedOnAnnouncement]);
12183
- const onToggleClick = React.useCallback(() => __awaiter$o(void 0, void 0, void 0, function* () {
12510
+ const onToggleClick = React.useCallback(() => __awaiter$s(void 0, void 0, void 0, function* () {
12184
12511
  if (onToggleMicrophone) {
12185
12512
  try {
12186
12513
  yield onToggleMicrophone();
@@ -12947,7 +13274,7 @@ const containerStyles$3 = (theme) => {
12947
13274
  /**
12948
13275
  * @private
12949
13276
  */
12950
- const buttonStyles = (theme) => ({
13277
+ const buttonStyles$1 = (theme) => ({
12951
13278
  root: {
12952
13279
  background: 'none',
12953
13280
  border: 'none',
@@ -13068,7 +13395,7 @@ const formatPhoneNumber = (phoneNumber) => {
13068
13395
 
13069
13396
  // Copyright (c) Microsoft Corporation.
13070
13397
  // Licensed under the MIT license.
13071
- var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
13398
+ var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
13072
13399
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13073
13400
  return new (P || (P = Promise))(function (resolve, reject) {
13074
13401
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -13110,16 +13437,16 @@ const DialpadButton = (props) => {
13110
13437
  const theme = react.useTheme();
13111
13438
  const { digit, index, onClick, onLongPress, isMobile = false } = props;
13112
13439
  const useLongPressProps = React__default['default'].useMemo(() => ({
13113
- onClick: () => __awaiter$n(void 0, void 0, void 0, function* () {
13440
+ onClick: () => __awaiter$r(void 0, void 0, void 0, function* () {
13114
13441
  onClick(digit, index);
13115
13442
  }),
13116
- onLongPress: () => __awaiter$n(void 0, void 0, void 0, function* () {
13443
+ onLongPress: () => __awaiter$r(void 0, void 0, void 0, function* () {
13117
13444
  onLongPress(digit, index);
13118
13445
  }),
13119
13446
  touchEventsOnly: isMobile
13120
13447
  }), [digit, index, isMobile, onClick, onLongPress]);
13121
13448
  const longPressHandlers = useLongPress(useLongPressProps);
13122
- return (React__default['default'].createElement(react.DefaultButton, Object.assign({ "data-test-id": `dialpad-button-${props.index}`, styles: react.concatStyleSets(buttonStyles(), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.button) }, longPressHandlers),
13449
+ return (React__default['default'].createElement(react.DefaultButton, Object.assign({ "data-test-id": `dialpad-button-${props.index}`, styles: react.concatStyleSets(buttonStyles$1(), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.button) }, longPressHandlers),
13123
13450
  React__default['default'].createElement(react.Stack, null,
13124
13451
  React__default['default'].createElement(react.Text, { className: react.mergeStyles(digitStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.digit) }, props.digit),
13125
13452
  React__default['default'].createElement(react.Text, { className: react.mergeStyles(letterStyles(theme), (_c = props.styles) === null || _c === void 0 ? void 0 : _c.letter) }, (_d = props.letter) !== null && _d !== void 0 ? _d : ' '))));
@@ -13576,80 +13903,341 @@ const videoEffectsItemContainerStyles = (args) => {
13576
13903
  };
13577
13904
 
13578
13905
  // Copyright (c) Microsoft Corporation.
13579
- /**
13580
- * Picker for choosing a Video Background Effect.
13581
- *
13582
- * @remarks
13583
- * This functions similar to a radio group of buttons, where the user can select one of the options.
13584
- *
13585
- * @internal
13586
- */
13587
- const _VideoBackgroundEffectsPicker = (props) => {
13588
- var _a, _b, _c;
13589
- const [componentControlledSelectedEffectKey, setComponentControlledSelectedEffectKey] = React__default['default'].useState(props.defaultSelectedEffectKey);
13590
- // Warn the developer if they use the component in an incorrect controlled way.
13591
- reactHooks.useWarnings({
13592
- name: 'VideoBackgroundEffectsPicker',
13593
- props,
13594
- controlledUsage: {
13595
- onChangeProp: 'onChange',
13596
- valueProp: 'selectedEffectKey',
13597
- defaultValueProp: 'defaultSelectedEffectKey'
13598
- }
13906
+ /**
13907
+ * Picker for choosing a Video Background Effect.
13908
+ *
13909
+ * @remarks
13910
+ * This functions similar to a radio group of buttons, where the user can select one of the options.
13911
+ *
13912
+ * @internal
13913
+ */
13914
+ const _VideoBackgroundEffectsPicker = (props) => {
13915
+ var _a, _b, _c;
13916
+ const [componentControlledSelectedEffectKey, setComponentControlledSelectedEffectKey] = React__default['default'].useState(props.defaultSelectedEffectKey);
13917
+ // Warn the developer if they use the component in an incorrect controlled way.
13918
+ reactHooks.useWarnings({
13919
+ name: 'VideoBackgroundEffectsPicker',
13920
+ props,
13921
+ controlledUsage: {
13922
+ onChangeProp: 'onChange',
13923
+ valueProp: 'selectedEffectKey',
13924
+ defaultValueProp: 'defaultSelectedEffectKey'
13925
+ }
13926
+ });
13927
+ const selectedEffect = (_a = props.selectedEffectKey) !== null && _a !== void 0 ? _a : componentControlledSelectedEffectKey;
13928
+ const setSelectedEffect = (selectedEffectKey) => {
13929
+ var _a;
13930
+ setComponentControlledSelectedEffectKey(selectedEffectKey);
13931
+ (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, selectedEffectKey);
13932
+ };
13933
+ const convertedOptions = props.options.map((option) => (Object.assign({ isSelected: option.key === selectedEffect, onSelect: () => setSelectedEffect(option.key) }, option)));
13934
+ const optionsByRow = props.itemsPerRow === 'wrap' ? [convertedOptions] : chunk(convertedOptions, (_b = props.itemsPerRow) !== null && _b !== void 0 ? _b : 3);
13935
+ return (React__default['default'].createElement(react.Stack, { tokens: { childrenGap: '0.5rem' } },
13936
+ React__default['default'].createElement(react.Label, { className: react.mergeStyles((_c = props.styles) === null || _c === void 0 ? void 0 : _c.label) }, props.label),
13937
+ optionsByRow.map((options, rowIndex) => {
13938
+ var _a;
13939
+ return (React__default['default'].createElement(react.Stack, { className: react.mergeStyles((_a = props.styles) === null || _a === void 0 ? void 0 : _a.rowRoot), wrap: props.itemsPerRow === 'wrap', horizontal: true, key: rowIndex, tokens: { childrenGap: '0.5rem' } }, options.map((option) => (React__default['default'].createElement(_VideoEffectsItem, Object.assign({}, option, { key: option.key }))))));
13940
+ })));
13941
+ };
13942
+
13943
+ // Copyright (c) Microsoft Corporation.
13944
+ /**
13945
+ * @private
13946
+ */
13947
+ const iconClassName = react.mergeStyles({
13948
+ marginRight: _pxToRem(8)
13949
+ });
13950
+ /**
13951
+ * @private
13952
+ */
13953
+ const displayNameClassName = react.mergeStyles({
13954
+ fontWeight: 400,
13955
+ fontSize: _pxToRem(12),
13956
+ lineHeight: _pxToRem(16)
13957
+ });
13958
+ /**
13959
+ * @private
13960
+ */
13961
+ const captionClassName = react.mergeStyles({
13962
+ fontWeight: 400,
13963
+ fontSize: _pxToRem(16),
13964
+ lineHeight: _pxToRem(22)
13965
+ });
13966
+ /**
13967
+ * @private
13968
+ */
13969
+ const captionContainerClassName = react.mergeStyles({
13970
+ marginTop: _pxToRem(6),
13971
+ marginBottom: _pxToRem(6),
13972
+ overflowAnchor: 'none'
13973
+ });
13974
+ /**
13975
+ * @private
13976
+ */
13977
+ const captionsBannerClassName = react.mergeStyles({
13978
+ height: _pxToRem(100),
13979
+ overflowY: 'auto',
13980
+ overflowX: 'hidden'
13981
+ });
13982
+ /**
13983
+ * @private
13984
+ */
13985
+ const captionsContentContainerClassName = react.mergeStyles({
13986
+ minWidth: 0
13987
+ });
13988
+ /**
13989
+ * @private
13990
+ */
13991
+ const displayNameContainerClassName = react.mergeStyles({
13992
+ overflow: 'hidden',
13993
+ textOverflow: 'ellipsis'
13994
+ });
13995
+
13996
+ // Copyright (c) Microsoft Corporation.
13997
+ /**
13998
+ * @internal
13999
+ * A component for displaying a single line of caption
14000
+ */
14001
+ const _Caption = (props) => {
14002
+ const { displayName, userId, captionText, onRenderAvatar } = props;
14003
+ const personaOptions = {
14004
+ hidePersonaDetails: true,
14005
+ size: react.PersonaSize.size32,
14006
+ text: displayName,
14007
+ showOverflowTooltip: false,
14008
+ initialsTextColor: 'white',
14009
+ styles: {
14010
+ root: {
14011
+ margin: '0.25rem'
14012
+ }
14013
+ }
14014
+ };
14015
+ const userIcon = onRenderAvatar ? onRenderAvatar(userId !== null && userId !== void 0 ? userId : '', personaOptions) : React__default['default'].createElement(react.Persona, Object.assign({}, personaOptions));
14016
+ return (React__default['default'].createElement(react.Stack, { horizontal: true, verticalAlign: "start", horizontalAlign: "start" },
14017
+ React__default['default'].createElement(react.Stack.Item, { className: iconClassName }, userIcon),
14018
+ React__default['default'].createElement(react.Stack, { verticalAlign: "start", className: captionsContentContainerClassName },
14019
+ React__default['default'].createElement(react.Stack.Item, { className: displayNameContainerClassName },
14020
+ React__default['default'].createElement(react.Text, { className: displayNameClassName }, displayName)),
14021
+ React__default['default'].createElement(react.Stack.Item, null,
14022
+ React__default['default'].createElement(react.Text, { className: captionClassName }, captionText)))));
14023
+ };
14024
+
14025
+ // Copyright (c) Microsoft Corporation.
14026
+ /**
14027
+ * @internal
14028
+ * A component for displaying a CaptionsBanner with user icon, displayName and captions text.
14029
+ */
14030
+ const _CaptionsBanner = (props) => {
14031
+ const { captions, isCaptionsOn, onRenderAvatar } = props;
14032
+ const captionsScrollDivRef = React.useRef(null);
14033
+ const [isAtBottomOfScroll, setIsAtBottomOfScroll] = React.useState(true);
14034
+ const scrollToBottom = () => {
14035
+ if (captionsScrollDivRef.current) {
14036
+ captionsScrollDivRef.current.scrollTop = captionsScrollDivRef.current.scrollHeight;
14037
+ }
14038
+ };
14039
+ const handleScrollToTheBottom = React.useCallback(() => {
14040
+ if (!captionsScrollDivRef.current) {
14041
+ return;
14042
+ }
14043
+ const atBottom = Math.ceil(captionsScrollDivRef.current.scrollTop) >=
14044
+ captionsScrollDivRef.current.scrollHeight - captionsScrollDivRef.current.clientHeight;
14045
+ setIsAtBottomOfScroll(atBottom);
14046
+ }, []);
14047
+ React.useEffect(() => {
14048
+ const captionsScrollDiv = captionsScrollDivRef.current;
14049
+ captionsScrollDiv === null || captionsScrollDiv === void 0 ? void 0 : captionsScrollDiv.addEventListener('scroll', handleScrollToTheBottom);
14050
+ return () => {
14051
+ captionsScrollDiv === null || captionsScrollDiv === void 0 ? void 0 : captionsScrollDiv.removeEventListener('scroll', handleScrollToTheBottom);
14052
+ };
14053
+ }, [handleScrollToTheBottom]);
14054
+ React.useEffect(() => {
14055
+ // only auto scroll to bottom is already is at bottom of scroll before new caption comes in
14056
+ if (isAtBottomOfScroll) {
14057
+ scrollToBottom();
14058
+ }
14059
+ }, [captions, isAtBottomOfScroll]);
14060
+ return (React__default['default'].createElement(React__default['default'].Fragment, null, isCaptionsOn && (React__default['default'].createElement("div", { "data-is-focusable": true },
14061
+ React__default['default'].createElement(reactNorthstar.Ref, { innerRef: captionsScrollDivRef },
14062
+ React__default['default'].createElement(react.Stack, { verticalAlign: "start", className: captionsBannerClassName }, captions.map((caption, key) => {
14063
+ return (React__default['default'].createElement("div", { key: key, className: captionContainerClassName, tabIndex: 0 },
14064
+ React__default['default'].createElement(_Caption, Object.assign({}, caption, { onRenderAvatar: onRenderAvatar }))));
14065
+ })))))));
14066
+ };
14067
+
14068
+ // Copyright (c) Microsoft Corporation.
14069
+ // Licensed under the MIT license.
14070
+ (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14071
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14072
+ return new (P || (P = Promise))(function (resolve, reject) {
14073
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
14074
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
14075
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14076
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
13599
14077
  });
13600
- const selectedEffect = (_a = props.selectedEffectKey) !== null && _a !== void 0 ? _a : componentControlledSelectedEffectKey;
13601
- const setSelectedEffect = (selectedEffectKey) => {
13602
- var _a;
13603
- setComponentControlledSelectedEffectKey(selectedEffectKey);
13604
- (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, selectedEffectKey);
13605
- };
13606
- const convertedOptions = props.options.map((option) => (Object.assign({ isSelected: option.key === selectedEffect, onSelect: () => setSelectedEffect(option.key) }, option)));
13607
- const optionsByRow = props.itemsPerRow === 'wrap' ? [convertedOptions] : chunk(convertedOptions, (_b = props.itemsPerRow) !== null && _b !== void 0 ? _b : 3);
13608
- return (React__default['default'].createElement(react.Stack, { tokens: { childrenGap: '0.5rem' } },
13609
- React__default['default'].createElement(react.Label, { className: react.mergeStyles((_c = props.styles) === null || _c === void 0 ? void 0 : _c.label) }, props.label),
13610
- optionsByRow.map((options, rowIndex) => {
13611
- var _a;
13612
- return (React__default['default'].createElement(react.Stack, { className: react.mergeStyles((_a = props.styles) === null || _a === void 0 ? void 0 : _a.rowRoot), wrap: props.itemsPerRow === 'wrap', horizontal: true, key: rowIndex, tokens: { childrenGap: '0.5rem' } }, options.map((option) => (React__default['default'].createElement(_VideoEffectsItem, Object.assign({}, option, { key: option.key }))))));
13613
- })));
13614
14078
  };
13615
14079
 
13616
14080
  // Copyright (c) Microsoft Corporation.
13617
14081
  /**
13618
14082
  * @private
13619
14083
  */
13620
- react.mergeStyles({
13621
- marginRight: _pxToRem(8)
14084
+ const themedCaptionsSettingsModalStyle = (theme) => ({
14085
+ main: {
14086
+ borderRadius: theme.effects.roundedCorner6,
14087
+ padding: _pxToRem(24),
14088
+ width: _pxToRem(440),
14089
+ height: _pxToRem(268),
14090
+ overflow: 'hidden'
14091
+ }
13622
14092
  });
13623
14093
  /**
13624
14094
  * @private
13625
14095
  */
13626
- react.mergeStyles({
13627
- fontWeight: 400,
13628
- fontSize: _pxToRem(12),
13629
- lineHeight: _pxToRem(16)
14096
+ const titleClassName = react.mergeStyles({
14097
+ fontWeight: 600,
14098
+ fontSize: _pxToRem(20),
14099
+ lineHeight: _pxToRem(28)
13630
14100
  });
13631
14101
  /**
13632
14102
  * @private
13633
14103
  */
13634
- react.mergeStyles({
13635
- fontWeight: 400,
13636
- fontSize: _pxToRem(16),
13637
- lineHeight: _pxToRem(22)
14104
+ const titleContainerClassName = react.mergeStyles({
14105
+ paddingBottom: _pxToRem(20)
13638
14106
  });
13639
14107
  /**
13640
14108
  * @private
13641
14109
  */
13642
- react.mergeStyles({
13643
- marginTop: _pxToRem(6),
13644
- marginBottom: _pxToRem(6)
14110
+ const dropdownContainerClassName = react.mergeStyles({
14111
+ paddingBottom: _pxToRem(16),
14112
+ paddingTop: _pxToRem(16)
13645
14113
  });
13646
14114
  /**
13647
14115
  * @private
13648
14116
  */
13649
- react.mergeStyles({
13650
- height: _pxToRem(100),
13651
- overflow: 'scroll'
14117
+ const dropdownInfoTextStyle = (theme) => react.mergeStyles({
14118
+ fontWeight: 400,
14119
+ fontSize: _pxToRem(12),
14120
+ lineHeight: _pxToRem(16),
14121
+ color: theme.palette.neutralSecondary
14122
+ });
14123
+ /**
14124
+ * @private
14125
+ */
14126
+ const buttonsContainerClassName = react.mergeStyles({
14127
+ paddingTop: _pxToRem(16)
13652
14128
  });
14129
+ /**
14130
+ * @private
14131
+ */
14132
+ const buttonStyles = (theme) => {
14133
+ return {
14134
+ root: {
14135
+ borderRadius: _pxToRem(2),
14136
+ margin: _pxToRem(8)
14137
+ },
14138
+ rootHovered: {
14139
+ backgroundColor: theme.palette.themePrimary,
14140
+ borderColor: theme.palette.themePrimary,
14141
+ color: theme.palette.white
14142
+ },
14143
+ rootFocused: {
14144
+ backgroundColor: theme.palette.themePrimary,
14145
+ borderColor: theme.palette.themePrimary,
14146
+ color: theme.palette.white
14147
+ },
14148
+ rootPressed: {
14149
+ backgroundColor: theme.palette.themePrimary,
14150
+ borderColor: theme.palette.themePrimary,
14151
+ color: theme.palette.white
14152
+ }
14153
+ };
14154
+ };
14155
+ /**
14156
+ * @private
14157
+ */
14158
+ const dropdownStyles = {
14159
+ callout: { height: _pxToRem(300), overflow: 'auto' }
14160
+ };
14161
+
14162
+ var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14163
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14164
+ return new (P || (P = Promise))(function (resolve, reject) {
14165
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
14166
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
14167
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14168
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
14169
+ });
14170
+ };
14171
+ /**
14172
+ * @internal
14173
+ * a component for setting spoken languages
14174
+ */
14175
+ const _CaptionsSettingsModal = (props) => {
14176
+ const { supportedSpokenLanguages, currentSpokenLanguage, isCaptionsFeatureActive, showModal, onSetSpokenLanguage, onDismissCaptionsSettings, onStartCaptions, strings, captionsAvailableLanguageStrings } = props;
14177
+ const theme = react.useTheme();
14178
+ const [selectedItem, setSelectedItem] = React.useState({
14179
+ key: currentSpokenLanguage !== '' ? currentSpokenLanguage : defaultSpokenLanguage$1,
14180
+ text: currentSpokenLanguage !== '' ? currentSpokenLanguage : defaultSpokenLanguage$1
14181
+ });
14182
+ const onDismiss = React.useCallback(() => {
14183
+ if (onDismissCaptionsSettings) {
14184
+ onDismissCaptionsSettings();
14185
+ }
14186
+ }, [onDismissCaptionsSettings]);
14187
+ const onConfirm = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
14188
+ const languageCode = selectedItem.key.toString();
14189
+ if (isCaptionsFeatureActive) {
14190
+ onSetSpokenLanguage(languageCode);
14191
+ }
14192
+ else {
14193
+ yield onStartCaptions({ spokenLanguage: languageCode });
14194
+ // set spoken language when start captions with a spoken language specified.
14195
+ // this is to fix the bug when a second user starts captions with a new spoken language, captions bot ignore that spoken language
14196
+ onSetSpokenLanguage(languageCode);
14197
+ }
14198
+ onDismiss();
14199
+ }), [onDismiss, isCaptionsFeatureActive, onSetSpokenLanguage, onStartCaptions, selectedItem.key]);
14200
+ const dropdownOptions = React.useMemo(() => {
14201
+ return supportedSpokenLanguages.map((languageCode) => {
14202
+ return {
14203
+ key: languageCode,
14204
+ text: captionsAvailableLanguageStrings ? captionsAvailableLanguageStrings[languageCode] : languageCode
14205
+ };
14206
+ });
14207
+ }, [supportedSpokenLanguages, captionsAvailableLanguageStrings]);
14208
+ const onChange = (event, option) => {
14209
+ if (option) {
14210
+ setSelectedItem(option);
14211
+ }
14212
+ };
14213
+ const calloutProps = React.useMemo(() => ({
14214
+ preventDismissOnEvent: _preventDismissOnEvent
14215
+ }), []);
14216
+ const CaptionsSettingsComponent = React.useCallback(() => {
14217
+ return (React__default['default'].createElement(react.Stack, null,
14218
+ React__default['default'].createElement(react.Dropdown, { label: strings === null || strings === void 0 ? void 0 : strings.captionsSettingsDropdownLabel, selectedKey: selectedItem ? selectedItem.key : undefined, onChange: onChange, calloutProps: calloutProps, placeholder: currentSpokenLanguage !== '' ? currentSpokenLanguage : defaultSpokenLanguage$1, options: dropdownOptions, styles: dropdownStyles }),
14219
+ React__default['default'].createElement(react.Text, { className: dropdownInfoTextStyle(theme) }, strings === null || strings === void 0 ? void 0 : strings.captionsSettingsDropdownInfoText)));
14220
+ }, [
14221
+ calloutProps,
14222
+ currentSpokenLanguage,
14223
+ dropdownOptions,
14224
+ selectedItem,
14225
+ strings === null || strings === void 0 ? void 0 : strings.captionsSettingsDropdownInfoText,
14226
+ strings === null || strings === void 0 ? void 0 : strings.captionsSettingsDropdownLabel,
14227
+ theme
14228
+ ]);
14229
+ const CaptionsSettingsModalStyle = React.useMemo(() => themedCaptionsSettingsModalStyle(theme), [theme]);
14230
+ return (React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(react.Modal, { titleAriaId: strings === null || strings === void 0 ? void 0 : strings.captionsSettingsModalAriaLabel, isOpen: showModal, onDismiss: onDismiss, isBlocking: true, styles: CaptionsSettingsModalStyle },
14231
+ React__default['default'].createElement(react.Stack, { horizontal: true, horizontalAlign: "space-between", verticalAlign: "center", className: titleContainerClassName },
14232
+ React__default['default'].createElement(react.Text, { className: titleClassName }, strings === null || strings === void 0 ? void 0 : strings.captionsSettingsModalTitle),
14233
+ React__default['default'].createElement(react.IconButton, { iconProps: { iconName: 'Cancel' }, ariaLabel: strings === null || strings === void 0 ? void 0 : strings.captionsSettingsCloseModalButtonAriaLabel, onClick: onDismiss, style: { color: theme.palette.black } })),
14234
+ React__default['default'].createElement(react.Stack, { className: dropdownContainerClassName }, CaptionsSettingsComponent()),
14235
+ React__default['default'].createElement(react.Stack, { horizontal: true, horizontalAlign: "end", className: buttonsContainerClassName },
14236
+ React__default['default'].createElement(react.PrimaryButton, { styles: buttonStyles(theme), onClick: onConfirm },
14237
+ React__default['default'].createElement("span", null, strings === null || strings === void 0 ? void 0 : strings.captionsSettingsConfirmButtonLabel)),
14238
+ React__default['default'].createElement(react.DefaultButton, { onClick: onDismiss, styles: buttonStyles(theme) },
14239
+ React__default['default'].createElement("span", null, strings === null || strings === void 0 ? void 0 : strings.captionsSettingsCancelButtonLabel))))));
14240
+ };
13653
14241
 
13654
14242
  // Copyright (c) Microsoft Corporation.
13655
14243
  // Licensed under the MIT license.
@@ -14191,7 +14779,7 @@ const findConditionalCompiledSelector = (component) => {
14191
14779
 
14192
14780
  // Copyright (c) Microsoft Corporation.
14193
14781
  // Licensed under the MIT license.
14194
- var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14782
+ var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14195
14783
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14196
14784
  return new (P || (P = Promise))(function (resolve, reject) {
14197
14785
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -14214,35 +14802,35 @@ const createDefaultChatHandlers = memoizeOne__default['default']((chatClient, ch
14214
14802
  let messageIterator = undefined;
14215
14803
  let readReceiptIterator = undefined;
14216
14804
  return {
14217
- onSendMessage: (content, options) => __awaiter$m(void 0, void 0, void 0, function* () {
14805
+ onSendMessage: (content, options) => __awaiter$p(void 0, void 0, void 0, function* () {
14218
14806
  const sendMessageRequest = {
14219
14807
  content,
14220
14808
  senderDisplayName: chatClient.getState().displayName
14221
14809
  };
14222
14810
  yield chatThreadClient.sendMessage(sendMessageRequest, options);
14223
14811
  }),
14224
- onUpdateMessage: (messageId, content, metadata, options) => __awaiter$m(void 0, void 0, void 0, function* () {
14812
+ onUpdateMessage: (messageId, content, metadata, options) => __awaiter$p(void 0, void 0, void 0, function* () {
14225
14813
  const updatedMetadata = metadata ? Object.assign({}, metadata) : {};
14226
14814
  updatedMetadata['fileSharingMetadata'] = JSON.stringify((options === null || options === void 0 ? void 0 : options.attachedFilesMetadata) || []);
14227
14815
  yield chatThreadClient.updateMessage(messageId, { content, metadata: updatedMetadata });
14228
14816
  }),
14229
- onDeleteMessage: (messageId) => __awaiter$m(void 0, void 0, void 0, function* () {
14817
+ onDeleteMessage: (messageId) => __awaiter$p(void 0, void 0, void 0, function* () {
14230
14818
  yield chatThreadClient.deleteMessage(messageId);
14231
14819
  }),
14232
14820
  // This handler is designed for chatThread to consume
14233
- onMessageSeen: (chatMessageId) => __awaiter$m(void 0, void 0, void 0, function* () {
14821
+ onMessageSeen: (chatMessageId) => __awaiter$p(void 0, void 0, void 0, function* () {
14234
14822
  yield chatThreadClient.sendReadReceipt({ chatMessageId });
14235
14823
  }),
14236
- onTyping: () => __awaiter$m(void 0, void 0, void 0, function* () {
14824
+ onTyping: () => __awaiter$p(void 0, void 0, void 0, function* () {
14237
14825
  yield chatThreadClient.sendTypingNotification();
14238
14826
  }),
14239
- onRemoveParticipant: (userId) => __awaiter$m(void 0, void 0, void 0, function* () {
14827
+ onRemoveParticipant: (userId) => __awaiter$p(void 0, void 0, void 0, function* () {
14240
14828
  yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
14241
14829
  }),
14242
- updateThreadTopicName: (topicName) => __awaiter$m(void 0, void 0, void 0, function* () {
14830
+ updateThreadTopicName: (topicName) => __awaiter$p(void 0, void 0, void 0, function* () {
14243
14831
  yield chatThreadClient.updateTopic(topicName);
14244
14832
  }),
14245
- onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$m(void 0, void 0, void 0, function* () {
14833
+ onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$p(void 0, void 0, void 0, function* () {
14246
14834
  var _a, _b, _c;
14247
14835
  if (messageIterator === undefined) {
14248
14836
  // Lazy definition so that errors in the method call are reported correctly.
@@ -15014,7 +15602,7 @@ const chatStatefulLogger = logger.createClientLogger('communication-react:chat-s
15014
15602
 
15015
15603
  // Copyright (c) Microsoft Corporation.
15016
15604
  // Licensed under the MIT license.
15017
- var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15605
+ var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15018
15606
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15019
15607
  return new (P || (P = Promise))(function (resolve, reject) {
15020
15608
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15289,7 +15877,7 @@ class ChatContext$1 {
15289
15877
  * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.
15290
15878
  */
15291
15879
  withAsyncErrorTeedToState(f, target) {
15292
- return (...args) => __awaiter$l(this, void 0, void 0, function* () {
15880
+ return (...args) => __awaiter$o(this, void 0, void 0, function* () {
15293
15881
  try {
15294
15882
  return yield f(...args);
15295
15883
  }
@@ -15401,7 +15989,7 @@ const convertChatMessage = (message, status = 'delivered', clientMessageId) => {
15401
15989
 
15402
15990
  // Copyright (c) Microsoft Corporation.
15403
15991
  // Licensed under the MIT license.
15404
- var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15992
+ var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15405
15993
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15406
15994
  return new (P || (P = Promise))(function (resolve, reject) {
15407
15995
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15486,7 +16074,7 @@ class EventSubscriber {
15486
16074
  };
15487
16075
  // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.
15488
16076
  // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.
15489
- this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$k(this, void 0, void 0, function* () {
16077
+ this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$n(this, void 0, void 0, function* () {
15490
16078
  var e_1, _a;
15491
16079
  try {
15492
16080
  for (var _b = __asyncValues$1(this.chatClient
@@ -15578,7 +16166,7 @@ class EventSubscriber {
15578
16166
 
15579
16167
  // Copyright (c) Microsoft Corporation.
15580
16168
  // Licensed under the MIT license.
15581
- var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16169
+ var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15582
16170
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15583
16171
  return new (P || (P = Promise))(function (resolve, reject) {
15584
16172
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15600,7 +16188,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
15600
16188
  const threadsIterator = iteratorCreator(...args);
15601
16189
  return {
15602
16190
  next() {
15603
- return __awaiter$j(this, void 0, void 0, function* () {
16191
+ return __awaiter$m(this, void 0, void 0, function* () {
15604
16192
  const result = yield threadsIterator.next();
15605
16193
  if (!result.done && result.value) {
15606
16194
  decorateFn(result.value, context);
@@ -15615,7 +16203,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
15615
16203
  const pages = threadsIterator.byPage(settings);
15616
16204
  return {
15617
16205
  next() {
15618
- return __awaiter$j(this, void 0, void 0, function* () {
16206
+ return __awaiter$m(this, void 0, void 0, function* () {
15619
16207
  const result = yield pages.next();
15620
16208
  const page = result.value;
15621
16209
  if (!result.done && result.value) {
@@ -15699,7 +16287,7 @@ const createDecoratedListParticipants = (chatThreadClient, context) => {
15699
16287
 
15700
16288
  // Copyright (c) Microsoft Corporation.
15701
16289
  // Licensed under the MIT license.
15702
- var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16290
+ var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15703
16291
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15704
16292
  return new (P || (P = Promise))(function (resolve, reject) {
15705
16293
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15718,14 +16306,14 @@ class ProxyChatThreadClient {
15718
16306
  return createDecoratedListMessages(chatThreadClient, this._context);
15719
16307
  }
15720
16308
  case 'getMessage': {
15721
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16309
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15722
16310
  const message = yield chatThreadClient.getMessage(...args);
15723
16311
  this._context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));
15724
16312
  return message;
15725
16313
  }), 'ChatThreadClient.getMessage');
15726
16314
  }
15727
16315
  case 'sendMessage': {
15728
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16316
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15729
16317
  // Retry logic?
15730
16318
  const [request, options] = args;
15731
16319
  const { content } = request;
@@ -15765,7 +16353,7 @@ class ProxyChatThreadClient {
15765
16353
  }), 'ChatThreadClient.sendMessage');
15766
16354
  }
15767
16355
  case 'addParticipants': {
15768
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16356
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15769
16357
  const result = yield chatThreadClient.addParticipants(...args);
15770
16358
  const [addRequest] = args;
15771
16359
  const participantsToAdd = addRequest.participants;
@@ -15774,7 +16362,7 @@ class ProxyChatThreadClient {
15774
16362
  }), 'ChatThreadClient.addParticipants');
15775
16363
  }
15776
16364
  case 'deleteMessage': {
15777
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16365
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15778
16366
  // DeleteMessage is able to either delete local one(for failed message) or synced message
15779
16367
  const [messageId] = args;
15780
16368
  if (this._context.deleteLocalMessage(chatThreadClient.threadId, messageId)) {
@@ -15792,12 +16380,12 @@ class ProxyChatThreadClient {
15792
16380
  return createDecoratedListReadReceipts(chatThreadClient, this._context);
15793
16381
  }
15794
16382
  case 'sendTypingNotification': {
15795
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16383
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15796
16384
  return yield chatThreadClient.sendTypingNotification(...args);
15797
16385
  }), 'ChatThreadClient.sendTypingNotification');
15798
16386
  }
15799
16387
  case 'removeParticipant': {
15800
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16388
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15801
16389
  const result = yield chatThreadClient.removeParticipant(...args);
15802
16390
  const [removeIdentifier] = args;
15803
16391
  this._context.deleteParticipant(chatThreadClient.threadId, communicationCommon.getIdentifierKind(removeIdentifier));
@@ -15805,7 +16393,7 @@ class ProxyChatThreadClient {
15805
16393
  }), 'ChatThreadClient.removeParticipant');
15806
16394
  }
15807
16395
  case 'updateMessage': {
15808
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16396
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15809
16397
  const result = yield chatThreadClient.updateMessage(...args);
15810
16398
  const [messageId, updateOption] = args;
15811
16399
  this._context.updateChatMessageContent(chatThreadClient.threadId, messageId, updateOption === null || updateOption === void 0 ? void 0 : updateOption.content);
@@ -15813,7 +16401,7 @@ class ProxyChatThreadClient {
15813
16401
  }), 'ChatThreadClient.updateMessage');
15814
16402
  }
15815
16403
  case 'updateTopic': {
15816
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16404
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15817
16405
  const result = yield chatThreadClient.updateTopic(...args);
15818
16406
  const [topic] = args;
15819
16407
  this._context.updateThreadTopic(chatThreadClient.threadId, topic);
@@ -15821,7 +16409,7 @@ class ProxyChatThreadClient {
15821
16409
  }), 'ChatThreadClient.updateTopic');
15822
16410
  }
15823
16411
  case 'getProperties': {
15824
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16412
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15825
16413
  const result = yield chatThreadClient.getProperties(...args);
15826
16414
  this._context.updateThread(chatThreadClient.threadId, result);
15827
16415
  return result;
@@ -15858,7 +16446,7 @@ const createDecoratedListThreads = (chatClient, context) => {
15858
16446
 
15859
16447
  // Copyright (c) Microsoft Corporation.
15860
16448
  // Licensed under the MIT license.
15861
- var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16449
+ var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15862
16450
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15863
16451
  return new (P || (P = Promise))(function (resolve, reject) {
15864
16452
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15877,7 +16465,7 @@ const proxyChatClient = {
15877
16465
  switch (prop) {
15878
16466
  case 'createChatThread': {
15879
16467
  return context.withAsyncErrorTeedToState(function (...args) {
15880
- return __awaiter$h(this, void 0, void 0, function* () {
16468
+ return __awaiter$k(this, void 0, void 0, function* () {
15881
16469
  const result = yield chatClient.createChatThread(...args);
15882
16470
  const thread = result.chatThread;
15883
16471
  if (thread) {
@@ -15890,7 +16478,7 @@ const proxyChatClient = {
15890
16478
  }
15891
16479
  case 'deleteChatThread': {
15892
16480
  return context.withAsyncErrorTeedToState(function (...args) {
15893
- return __awaiter$h(this, void 0, void 0, function* () {
16481
+ return __awaiter$k(this, void 0, void 0, function* () {
15894
16482
  const result = yield chatClient.deleteChatThread(...args);
15895
16483
  context.deleteThread(args[0]);
15896
16484
  return result;
@@ -15910,7 +16498,7 @@ const proxyChatClient = {
15910
16498
  }
15911
16499
  case 'startRealtimeNotifications': {
15912
16500
  return context.withAsyncErrorTeedToState(function (...args) {
15913
- return __awaiter$h(this, void 0, void 0, function* () {
16501
+ return __awaiter$k(this, void 0, void 0, function* () {
15914
16502
  const ret = yield chatClient.startRealtimeNotifications(...args);
15915
16503
  if (!receiver.eventSubscriber) {
15916
16504
  receiver.eventSubscriber = new EventSubscriber(chatClient, context);
@@ -15921,7 +16509,7 @@ const proxyChatClient = {
15921
16509
  }
15922
16510
  case 'stopRealtimeNotifications': {
15923
16511
  return context.withAsyncErrorTeedToState(function (...args) {
15924
- return __awaiter$h(this, void 0, void 0, function* () {
16512
+ return __awaiter$k(this, void 0, void 0, function* () {
15925
16513
  const ret = yield chatClient.stopRealtimeNotifications(...args);
15926
16514
  if (receiver.eventSubscriber) {
15927
16515
  receiver.eventSubscriber.unsubscribe();
@@ -16108,7 +16696,7 @@ const CallCompositeIcon = (props) => (React__default['default'].createElement(re
16108
16696
  */
16109
16697
  const CallWithChatCompositeIcon = (props) => (React__default['default'].createElement(react.FontIcon, Object.assign({}, props)));
16110
16698
 
16111
- var call$d={cameraLabel:"Camera",noCamerasLabel:"No cameras found",cameraPermissionDenied:"Your browser is blocking access to your camera",cameraTurnedOff:"Your camera is turned off",chatButtonLabel:"Chat",close:"Close",complianceBannerNowOnlyRecording:"You are now only recording this meeting.",complianceBannerNowOnlyTranscription:"You are now only transcribing this meeting.",complianceBannerRecordingAndTranscriptionSaved:"Recording and transcription are being saved.",complianceBannerRecordingAndTranscriptionStarted:"Recording and transcription have started.",complianceBannerRecordingAndTranscriptionStopped:"Recording and transcription have stopped.",complianceBannerRecordingSaving:"Recording is being saved.",complianceBannerRecordingStarted:"Recording has started.",complianceBannerRecordingStopped:"Recording has stopped.",complianceBannerTranscriptionStarted:"Transcription has started.",complianceBannerTranscriptionConsent:"By joining, you are giving consent for this meeting to be transcribed.",complianceBannerTranscriptionSaving:"Transcription is being saved.",complianceBannerTranscriptionStopped:"Transcription has stopped.",configurationPageTitle:"Start a call",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",defaultPlaceHolder:"Select an option",dismissSidePaneButtonLabel:"Close",effects:"Effects",blurBackgroundEffectButtonLabel:"Blur",blurBackgroundTooltip:"Blur Background",removeBackgroundEffectButtonLabel:"None",removeBackgroundTooltip:"Remove Background",failedToJoinCallDueToNoNetworkMoreDetails:"Call was disconnected due to a network issue. Check your connection and join again.",failedToJoinCallDueToNoNetworkTitle:"Call disconnected",failedToJoinTeamsMeetingReasonAccessDeniedMoreDetails:"You were not granted entry in the call. If this was a mistake, re-join the call.",failedToJoinTeamsMeetingReasonAccessDeniedTitle:"Dismissed from lobby",learnMore:"Learn more",leftCallMoreDetails:"If this was a mistake, re-join the call.",leftCallTitle:"You left the call",lobbyScreenConnectingToCallTitle:"Joining call",lobbyScreenWaitingToBeAdmittedTitle:"Waiting to be admitted",microphonePermissionDenied:"Your browser is blocking access to your microphone",microphoneToggleInLobbyNotAllowed:"Cannot mute or unmute while in lobby.",mutedMessage:"You're muted",networkReconnectMoreDetails:"Looks like something went wrong. We're trying to get back into the call.",networkReconnectTitle:"Hold on",deniedPermissionToRoomDetails:"You do not have permission to join this room.",deniedPermissionToRoomTitle:"Permission denied to room",peopleButtonLabel:"People",peoplePaneTitle:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",privacyPolicy:"Privacy policy",rejoinCallButtonLabel:"Re-join call",removedFromCallMoreDetails:"Another participant removed you from the call.",removedFromCallTitle:"You were removed",removeMenuLabel:"Remove",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",roomNotFoundDetails:"Room ID provided is not valid.",roomNotFoundTitle:"Room not found",soundLabel:"Sound",noMicrophonesLabel:"No microphones found",noSpeakersLabel:"No speakers found",startCallButtonLabel:"Start call",openDialpadButtonLabel:"Dial phone number",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",moreButtonCallingLabel:"More",resumeCallButtonLabel:"Resume",resumingCallButtonLabel:"Resuming...",resumeCallButtonAriaLabel:"Resume call",resumingCallButtonAriaLabel:"Resume call",holdScreenLabel:"You're on hold",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceholderText:"Enter number",outboundCallingNoticeString:"Calling...",participantJoinedNoticeString:"{displayName} joined",twoParticipantJoinedNoticeString:"{displayName1} and {displayName2} have joined",threeParticipantJoinedNoticeString:"{displayName1}, {displayName2} and {displayName3} have joined",participantLeftNoticeString:"{displayName} left",twoParticipantLeftNoticeString:"{displayName1} and {displayName2} have left",threeParticipantLeftNoticeString:"{displayName1}, {displayName2} and {displayName3} have left",unnamedParticipantString:"unnamed participant",manyUnnamedParticipantsJoined:"unnamed participant and {numOfParticipants} other participants joined",manyUnnamedParticipantsLeft:"unnamed participant and {numOfParticipants} other participants left",manyParticipantsJoined:"{displayName1}, {displayName2}, {displayName3} and {numOfParticipants} other participants joined",manyParticipantsLeft:"{displayName1}, {displayName2}, {displayName3} and {numOfParticipants} other participants left"};var chat$d={chatListHeader:"In this chat",uploadFile:"Upload File"};var callWithChat$d={chatButtonLabel:"Chat",chatButtonNewMessageNotificationLabel:"New Message",chatButtonTooltipClosedWithMessageCount:"Show chat ({unreadMessagesCount} unread)",chatButtonTooltipClose:"Hide chat",chatButtonTooltipOpen:"Show chat",chatPaneTitle:"Chat",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",dismissSidePaneButtonLabel:"Close",moreDrawerAudioDeviceMenuTitle:"Audio Device",moreDrawerButtonLabel:"More options",moreDrawerButtonTooltip:"More options",moreDrawerMicrophoneMenuTitle:"Microphone",moreDrawerSpeakerMenuTitle:"Speaker",peopleButtonLabel:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",peoplePaneTitle:"People",pictureInPictureTileAriaLabel:"Video Feeds. Click to return to call screen.",removeMenuLabel:"Remove",openDialpadButtonLabel:"Dial phone number",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceholderText:"Enter number"};var en_US = {call:call$d,chat:chat$d,callWithChat:callWithChat$d};
16699
+ var call$d={cameraLabel:"Camera",noCamerasLabel:"No cameras found",cameraPermissionDenied:"Your browser is blocking access to your camera",cameraTurnedOff:"Your camera is turned off",chatButtonLabel:"Chat",close:"Close",complianceBannerNowOnlyRecording:"You are now only recording this meeting.",complianceBannerNowOnlyTranscription:"You are now only transcribing this meeting.",complianceBannerRecordingAndTranscriptionSaved:"Recording and transcription are being saved.",complianceBannerRecordingAndTranscriptionStarted:"Recording and transcription have started.",complianceBannerRecordingAndTranscriptionStopped:"Recording and transcription have stopped.",complianceBannerRecordingSaving:"Recording is being saved.",complianceBannerRecordingStarted:"Recording has started.",complianceBannerRecordingStopped:"Recording has stopped.",complianceBannerTranscriptionStarted:"Transcription has started.",complianceBannerTranscriptionConsent:"By joining, you are giving consent for this meeting to be transcribed.",complianceBannerTranscriptionSaving:"Transcription is being saved.",complianceBannerTranscriptionStopped:"Transcription has stopped.",configurationPageTitle:"Start a call",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",defaultPlaceHolder:"Select an option",dismissSidePaneButtonLabel:"Close",effects:"Effects",blurBackgroundEffectButtonLabel:"Blur",blurBackgroundTooltip:"Blur Background",removeBackgroundEffectButtonLabel:"None",removeBackgroundTooltip:"Remove Background",failedToJoinCallDueToNoNetworkMoreDetails:"Call was disconnected due to a network issue. Check your connection and join again.",failedToJoinCallDueToNoNetworkTitle:"Call disconnected",failedToJoinTeamsMeetingReasonAccessDeniedMoreDetails:"You were not granted entry in the call. If this was a mistake, re-join the call.",failedToJoinTeamsMeetingReasonAccessDeniedTitle:"Dismissed from lobby",learnMore:"Learn more",leftCallMoreDetails:"If this was a mistake, re-join the call.",leftCallTitle:"You left the call",lobbyScreenConnectingToCallTitle:"Joining call",lobbyScreenWaitingToBeAdmittedTitle:"Waiting to be admitted",microphonePermissionDenied:"Your browser is blocking access to your microphone",microphoneToggleInLobbyNotAllowed:"Cannot mute or unmute while in lobby.",mutedMessage:"You're muted",networkReconnectMoreDetails:"Looks like something went wrong. We're trying to get back into the call.",networkReconnectTitle:"Hold on",deniedPermissionToRoomDetails:"You do not have permission to join this room.",deniedPermissionToRoomTitle:"Permission denied to room",peopleButtonLabel:"People",peoplePaneTitle:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",privacyPolicy:"Privacy policy",rejoinCallButtonLabel:"Re-join call",removedFromCallMoreDetails:"Another participant removed you from the call.",removedFromCallTitle:"You were removed",removeMenuLabel:"Remove",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",roomNotFoundDetails:"Room ID provided is not valid.",roomNotFoundTitle:"Room not found",soundLabel:"Sound",noMicrophonesLabel:"No microphones found",noSpeakersLabel:"No speakers found",startCallButtonLabel:"Start call",openDialpadButtonLabel:"Dial phone number",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",moreButtonCallingLabel:"More",resumeCallButtonLabel:"Resume",resumingCallButtonLabel:"Resuming...",resumeCallButtonAriaLabel:"Resume call",resumingCallButtonAriaLabel:"Resume call",holdScreenLabel:"You're on hold",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceholderText:"Enter number",outboundCallingNoticeString:"Calling...",participantJoinedNoticeString:"{displayName} joined",twoParticipantJoinedNoticeString:"{displayName1} and {displayName2} have joined",threeParticipantJoinedNoticeString:"{displayName1}, {displayName2} and {displayName3} have joined",participantLeftNoticeString:"{displayName} left",twoParticipantLeftNoticeString:"{displayName1} and {displayName2} have left",threeParticipantLeftNoticeString:"{displayName1}, {displayName2} and {displayName3} have left",unnamedParticipantString:"unnamed participant",manyUnnamedParticipantsJoined:"unnamed participant and {numOfParticipants} other participants joined",manyUnnamedParticipantsLeft:"unnamed participant and {numOfParticipants} other participants left",manyParticipantsJoined:"{displayName1}, {displayName2}, {displayName3} and {numOfParticipants} other participants joined",manyParticipantsLeft:"{displayName1}, {displayName2}, {displayName3} and {numOfParticipants} other participants left",liveCaptionsLabel:"Live captions",captionsSettingsLabel:"Caption settings",startCaptionsButtonOnLabel:"Turn on captions",startCaptionsButtonOffLabel:"Turn off captions",startCaptionsButtonTooltipOnContent:"Turn off captions",startCaptionsButtonTooltipOffContent:"Turn on captions",captionsSettingsModalTitle:"What language is being spoken?",captionsSettingsDropdownLabel:"Spoken language",captionsSettingsDropdownInfoText:"Language that everyone on this call is speaking.",captionsSettingsConfirmButtonLabel:"Confirm",captionsSettingsCancelButtonLabel:"Cancel",captionsSettingsModalAriaLabel:"Captions Setting Modal",captionsSettingsCloseModalButtonAriaLabel:"Close Captions Setting",captionsBannerMoreButtonCallingLabel:"More",captionsBannerMoreButtonTooltip:"More options",captionsAvailableLanguageStrings:{"ar-ae":"Arabic - U.A.E.","ar-sa":"Arabic - Saudi Arabia","da-dk":"Danish","de-de":"German - Germany","en-au":"English - Australia","en-ca":"English - Canada","en-gb":"English - United Kingdom","en-in":"English - India","en-nz":"English - New Zealand","en-us":"English - United States","es-es":"Spanish - Spain (Modern Sort)","es-mx":"Spanish - Mexico","fi-fi":"Finnish","fr-ca":"French - Canada","fr-fr":"French - France","hi-in":"Hindi","it-it":"Italian - Italy","ja-jp":"Japanese","ko-kr":"Korean","nb-no":"Norwegian (Bokmål)","nl-be":"Dutch - Belgium","nl-nl":"Dutch - Netherlands","pl-pl":"Polish","pt-br":"Portuguese - Brazil","ru-ru":"Russian","sv-se":"Swedish","zh-cn":"Chinese - People's Republic of China","zh-hk":"Chinese - Hong Kong SAR","cs-cz":"Czech","pt-pt":"Portuguese - Portugal","tr-tr":"Turkish","vi-vn":"Vietnamese","th-th":"Thai","he-il":"Hebrew","cy-gb":"Welsh","uk-ua":"Ukrainian","el-gr":"Greek","hu-hu":"Hungarian","ro-ro":"Romanian","sk-sk":"Slovak","zh-tw":"Chinese - Taiwan"}};var chat$d={chatListHeader:"In this chat",uploadFile:"Upload File"};var callWithChat$d={chatButtonLabel:"Chat",chatButtonNewMessageNotificationLabel:"New Message",chatButtonTooltipClosedWithMessageCount:"Show chat ({unreadMessagesCount} unread)",chatButtonTooltipClose:"Hide chat",chatButtonTooltipOpen:"Show chat",chatPaneTitle:"Chat",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",dismissSidePaneButtonLabel:"Close",moreDrawerAudioDeviceMenuTitle:"Audio Device",moreDrawerButtonLabel:"More options",moreDrawerButtonTooltip:"More options",moreDrawerMicrophoneMenuTitle:"Microphone",moreDrawerSpeakerMenuTitle:"Speaker",moreDrawerCaptionsMenuTitle:"Live captions",moreDrawerSpokenLanguageMenuTitle:"Spoken language",peopleButtonLabel:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",peoplePaneTitle:"People",pictureInPictureTileAriaLabel:"Video Feeds. Click to return to call screen.",removeMenuLabel:"Remove",openDialpadButtonLabel:"Dial phone number",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceholderText:"Enter number"};var en_US = {call:call$d,chat:chat$d,callWithChat:callWithChat$d};
16112
16700
 
16113
16701
  var call$c={cameraLabel:"Camera",cameraPermissionDenied:"Your browser is blocking access to your camera",cameraTurnedOff:"Your camera is turned off",chatButtonLabel:"Chat",close:"Close",complianceBannerNowOnlyRecording:"You are now only recording this meeting.",complianceBannerNowOnlyTranscription:"You are now only transcribing this meeting.",complianceBannerRecordingAndTranscriptionSaved:"Recording and transcription are being saved.",complianceBannerRecordingAndTranscriptionStarted:"Recording and transcription have started.",complianceBannerRecordingAndTranscriptionStopped:"Recording and transcription have stopped.",complianceBannerRecordingSaving:"Recording is being saved.",complianceBannerRecordingStarted:"Recording has started.",complianceBannerRecordingStopped:"Recording has stopped.",complianceBannerTranscriptionStarted:"Transcription has started.",complianceBannerTranscriptionConsent:"By joining, you are giving consent for this meeting to be transcribed.",complianceBannerTranscriptionSaving:"Transcription is being saved.",complianceBannerTranscriptionStopped:"Transcription has stopped.",configurationPageTitle:"Start a call",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",defaultPlaceHolder:"Select an option",dismissSidePaneButtonLabel:"Close",failedToJoinCallDueToNoNetworkMoreDetails:"Call was disconnected due to a network issue. Check your connection and join again.",failedToJoinCallDueToNoNetworkTitle:"Call disconnected",failedToJoinTeamsMeetingReasonAccessDeniedMoreDetails:"You were not granted entry in the call. If this was a mistake, re-join the call.",failedToJoinTeamsMeetingReasonAccessDeniedTitle:"Dismissed from lobby",learnMore:"Learn more",leftCallMoreDetails:"If this was a mistake, re-join the call.",leftCallTitle:"You left the call",lobbyScreenConnectingToCallTitle:"Joining call",lobbyScreenWaitingToBeAdmittedTitle:"Waiting to be admitted",microphonePermissionDenied:"Your browser is blocking access to your microphone",microphoneToggleInLobbyNotAllowed:"Cannot mute or unmute while in lobby.",mutedMessage:"You're muted",networkReconnectMoreDetails:"Looks like something went wrong. We're trying to get back into the call.",networkReconnectTitle:"Hold on",deniedPermissionToRoomDetails:"You do not have permission to join this room.",deniedPermissionToRoomTitle:"Permission denied to room",peopleButtonLabel:"People",peoplePaneTitle:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",privacyPolicy:"Privacy policy",rejoinCallButtonLabel:"Re-join call",removedFromCallMoreDetails:"Another participant removed you from the call.",removedFromCallTitle:"You were removed",removeMenuLabel:"Remove",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",roomNotFoundDetails:"Room ID provided is not valid.",roomNotFoundTitle:"Room not found",soundLabel:"Sound",startCallButtonLabel:"Start call",openDialpadButtonLabel:"Dial phone number",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",moreButtonCallingLabel:"More",resumeCallButtonLabel:"Resume",resumingCallButtonLabel:"Resuming...",resumeCallButtonAriaLabel:"Resume call",resumingCallButtonAriaLabel:"Resume call",holdScreenLabel:"You're on hold",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceHolderText:"Enter number",outboundCallingNoticeString:"Calling..."};var chat$c={chatListHeader:"In this chat",uploadFile:"Upload File"};var callWithChat$c={chatButtonLabel:"Chat",chatButtonNewMessageNotificationLabel:"New Message",chatButtonTooltipClosedWithMessageCount:"Show chat ({unreadMessagesCount} unread)",chatButtonTooltipClose:"Hide chat",chatButtonTooltipOpen:"Show chat",chatPaneTitle:"Chat",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",dismissSidePaneButtonLabel:"Close",moreDrawerAudioDeviceMenuTitle:"Audio Device",moreDrawerButtonLabel:"More options",moreDrawerButtonTooltip:"More options",moreDrawerMicrophoneMenuTitle:"Microphone",moreDrawerSpeakerMenuTitle:"Speaker",peopleButtonLabel:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",peoplePaneTitle:"People",pictureInPictureTileAriaLabel:"Video Feeds. Click to return to call screen.",removeMenuLabel:"Remove",openDialpadButtonLabel:"Dial phone number",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceHolderText:"Enter number"};var en_GB = {call:call$c,chat:chat$c,callWithChat:callWithChat$c};
16114
16702
 
@@ -16526,7 +17114,7 @@ const END_CALL_PAGES = [
16526
17114
 
16527
17115
  // Copyright (c) Microsoft Corporation.
16528
17116
  // Licensed under the MIT license.
16529
- var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
17117
+ var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16530
17118
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16531
17119
  return new (P || (P = Promise))(function (resolve, reject) {
16532
17120
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -16562,7 +17150,7 @@ const isCameraOn = (state) => {
16562
17150
  /**
16563
17151
  * @private
16564
17152
  */
16565
- const startSelectedVideoEffect = (adapter) => __awaiter$g(void 0, void 0, void 0, function* () {
17153
+ const startSelectedVideoEffect = (adapter) => __awaiter$j(void 0, void 0, void 0, function* () {
16566
17154
  if (adapter.getState().selectedVideoBackgroundEffect) {
16567
17155
  const selectedVideoBackgroundEffect = adapter.getState().selectedVideoBackgroundEffect;
16568
17156
  if ((selectedVideoBackgroundEffect === null || selectedVideoBackgroundEffect === void 0 ? void 0 : selectedVideoBackgroundEffect.effectName) === 'blur') {
@@ -16767,7 +17355,7 @@ const isDisabled$2 = (option) => {
16767
17355
  /**
16768
17356
  * @returns Permissions state for the camera.
16769
17357
  */
16770
- const queryCameraPermissionFromPermissionsAPI = () => __awaiter$g(void 0, void 0, void 0, function* () {
17358
+ const queryCameraPermissionFromPermissionsAPI = () => __awaiter$j(void 0, void 0, void 0, function* () {
16771
17359
  try {
16772
17360
  return (yield navigator.permissions.query({ name: 'camera' })).state;
16773
17361
  }
@@ -16780,7 +17368,7 @@ const queryCameraPermissionFromPermissionsAPI = () => __awaiter$g(void 0, void 0
16780
17368
  /**
16781
17369
  * @returns Permissions state for the microphone.
16782
17370
  */
16783
- const queryMicrophonePermissionFromPermissionsAPI = () => __awaiter$g(void 0, void 0, void 0, function* () {
17371
+ const queryMicrophonePermissionFromPermissionsAPI = () => __awaiter$j(void 0, void 0, void 0, function* () {
16784
17372
  try {
16785
17373
  return (yield navigator.permissions.query({ name: 'microphone' })).state;
16786
17374
  }
@@ -16797,7 +17385,7 @@ const queryMicrophonePermissionFromPermissionsAPI = () => __awaiter$g(void 0, vo
16797
17385
  * If permission API is not supported on this browser, permission state is set to unsupported.
16798
17386
  * @private
16799
17387
  */
16800
- const getDevicePermissionState = (setVideoState, setAudioState) => __awaiter$g(void 0, void 0, void 0, function* () {
17388
+ const getDevicePermissionState = (setVideoState, setAudioState) => __awaiter$j(void 0, void 0, void 0, function* () {
16801
17389
  const [cameraResult, microphoneResult] = yield Promise.all([
16802
17390
  queryCameraPermissionFromPermissionsAPI(),
16803
17391
  queryMicrophonePermissionFromPermissionsAPI()
@@ -16874,7 +17462,7 @@ const createParticipantModifier = (createModifiedParticipant) => {
16874
17462
 
16875
17463
  // Copyright (c) Microsoft Corporation.
16876
17464
  // Licensed under the MIT license.
16877
- var __awaiter$f = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
17465
+ var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16878
17466
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16879
17467
  return new (P || (P = Promise))(function (resolve, reject) {
16880
17468
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -17009,9 +17597,9 @@ class AzureCommunicationChatAdapter {
17009
17597
  this.unsubscribeAllEvents();
17010
17598
  }
17011
17599
  fetchInitialData() {
17012
- return __awaiter$f(this, void 0, void 0, function* () {
17600
+ return __awaiter$i(this, void 0, void 0, function* () {
17013
17601
  // If get properties fails we dont want to try to get the participants after.
17014
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17602
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17015
17603
  var e_1, _a;
17016
17604
  yield this.chatThreadClient.getProperties();
17017
17605
  try {
@@ -17045,8 +17633,8 @@ class AzureCommunicationChatAdapter {
17045
17633
  this.context.offStateChange(handler);
17046
17634
  }
17047
17635
  sendMessage(content, options = {}) {
17048
- return __awaiter$f(this, void 0, void 0, function* () {
17049
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17636
+ return __awaiter$i(this, void 0, void 0, function* () {
17637
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17050
17638
  /* @conditional-compile-remove(file-sharing) */
17051
17639
  options.metadata = Object.assign(Object.assign({}, options.metadata), convertFileUploadsUiStateToMessageMetadata(this.context.getState().fileUploads));
17052
17640
  /* @conditional-compile-remove(file-sharing) */
@@ -17063,51 +17651,51 @@ class AzureCommunicationChatAdapter {
17063
17651
  });
17064
17652
  }
17065
17653
  sendReadReceipt(chatMessageId) {
17066
- return __awaiter$f(this, void 0, void 0, function* () {
17067
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17654
+ return __awaiter$i(this, void 0, void 0, function* () {
17655
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17068
17656
  yield this.handlers.onMessageSeen(chatMessageId);
17069
17657
  }));
17070
17658
  });
17071
17659
  }
17072
17660
  sendTypingIndicator() {
17073
- return __awaiter$f(this, void 0, void 0, function* () {
17074
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17661
+ return __awaiter$i(this, void 0, void 0, function* () {
17662
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17075
17663
  yield this.handlers.onTyping();
17076
17664
  }));
17077
17665
  });
17078
17666
  }
17079
17667
  removeParticipant(userId) {
17080
- return __awaiter$f(this, void 0, void 0, function* () {
17081
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17668
+ return __awaiter$i(this, void 0, void 0, function* () {
17669
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17082
17670
  yield this.handlers.onRemoveParticipant(userId);
17083
17671
  }));
17084
17672
  });
17085
17673
  }
17086
17674
  setTopic(topicName) {
17087
- return __awaiter$f(this, void 0, void 0, function* () {
17088
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17675
+ return __awaiter$i(this, void 0, void 0, function* () {
17676
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17089
17677
  yield this.handlers.updateThreadTopicName(topicName);
17090
17678
  }));
17091
17679
  });
17092
17680
  }
17093
17681
  loadPreviousChatMessages(messagesToLoad) {
17094
- return __awaiter$f(this, void 0, void 0, function* () {
17095
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17682
+ return __awaiter$i(this, void 0, void 0, function* () {
17683
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17096
17684
  return yield this.handlers.onLoadPreviousChatMessages(messagesToLoad);
17097
17685
  }));
17098
17686
  });
17099
17687
  }
17100
17688
  updateMessage(messageId, content, metadata, options) {
17101
- return __awaiter$f(this, void 0, void 0, function* () {
17102
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17689
+ return __awaiter$i(this, void 0, void 0, function* () {
17690
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17103
17691
  /* @conditional-compile-remove(file-sharing) */
17104
17692
  return yield this.handlers.onUpdateMessage(messageId, content, metadata, options);
17105
17693
  }));
17106
17694
  });
17107
17695
  }
17108
17696
  deleteMessage(messageId) {
17109
- return __awaiter$f(this, void 0, void 0, function* () {
17110
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17697
+ return __awaiter$i(this, void 0, void 0, function* () {
17698
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17111
17699
  return yield this.handlers.onDeleteMessage(messageId);
17112
17700
  }));
17113
17701
  });
@@ -17142,8 +17730,8 @@ class AzureCommunicationChatAdapter {
17142
17730
  }
17143
17731
  /* @conditional-compile-remove(teams-inline-images) */
17144
17732
  downloadAuthenticatedAttachment(attachmentUrl) {
17145
- return __awaiter$f(this, void 0, void 0, function* () {
17146
- return this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17733
+ return __awaiter$i(this, void 0, void 0, function* () {
17734
+ return this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17147
17735
  if (this.credential === undefined) {
17148
17736
  const e = new Error();
17149
17737
  e['target'] = 'ChatThreadClient.getMessage';
@@ -17158,7 +17746,7 @@ class AzureCommunicationChatAdapter {
17158
17746
  throw e;
17159
17747
  }
17160
17748
  function fetchWithAuthentication(url, token) {
17161
- return __awaiter$f(this, void 0, void 0, function* () {
17749
+ return __awaiter$i(this, void 0, void 0, function* () {
17162
17750
  const headers = new Headers();
17163
17751
  headers.append('Authorization', `Bearer ${token}`);
17164
17752
  try {
@@ -17226,7 +17814,7 @@ class AzureCommunicationChatAdapter {
17226
17814
  this.emitter.off(event, listener);
17227
17815
  }
17228
17816
  asyncTeeErrorToEventEmitter(f) {
17229
- return __awaiter$f(this, void 0, void 0, function* () {
17817
+ return __awaiter$i(this, void 0, void 0, function* () {
17230
17818
  try {
17231
17819
  return yield f();
17232
17820
  }
@@ -17268,7 +17856,7 @@ const convertEventType = (type) => {
17268
17856
  *
17269
17857
  * @public
17270
17858
  */
17271
- const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$f(void 0, void 0, void 0, function* () {
17859
+ const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$i(void 0, void 0, void 0, function* () {
17272
17860
  if (!isValidIdentifier(userId)) {
17273
17861
  throw new Error('Provided userId is invalid. Please provide valid identifier object.');
17274
17862
  }
@@ -17337,7 +17925,7 @@ beforeDispose) => {
17337
17925
  if (!credential || !displayName || !endpoint || !threadId || !userId) {
17338
17926
  return;
17339
17927
  }
17340
- (() => __awaiter$f(void 0, void 0, void 0, function* () {
17928
+ (() => __awaiter$i(void 0, void 0, void 0, function* () {
17341
17929
  if (adapterRef.current) {
17342
17930
  // Dispose the old adapter when a new one is created.
17343
17931
  //
@@ -17369,7 +17957,7 @@ beforeDispose) => {
17369
17957
  // Dispose any existing adapter when the component unmounts.
17370
17958
  React.useEffect(() => {
17371
17959
  return () => {
17372
- (() => __awaiter$f(void 0, void 0, void 0, function* () {
17960
+ (() => __awaiter$i(void 0, void 0, void 0, function* () {
17373
17961
  if (adapterRef.current) {
17374
17962
  if (beforeDisposeRef.current) {
17375
17963
  yield beforeDisposeRef.current(adapterRef.current);
@@ -17393,7 +17981,7 @@ beforeDispose) => {
17393
17981
  function createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient,
17394
17982
  /* @conditional-compile-remove(teams-inline-images) */
17395
17983
  options) {
17396
- return __awaiter$f(this, void 0, void 0, function* () {
17984
+ return __awaiter$i(this, void 0, void 0, function* () {
17397
17985
  return new AzureCommunicationChatAdapter(chatClient, chatThreadClient,
17398
17986
  /* @conditional-compile-remove(teams-inline-images) */ options);
17399
17987
  });
@@ -17606,7 +18194,7 @@ const sendboxContainerStyles = {
17606
18194
 
17607
18195
  // Copyright (c) Microsoft Corporation.
17608
18196
  // Licensed under the MIT license.
17609
- var __awaiter$e = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
18197
+ var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
17610
18198
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17611
18199
  return new (P || (P = Promise))(function (resolve, reject) {
17612
18200
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -17627,7 +18215,7 @@ const AvatarPersona = (props) => {
17627
18215
  const { userId, dataProvider, text, imageUrl, imageInitials, initialsColor, initialsTextColor, showOverflowTooltip } = props;
17628
18216
  const [data, setData] = React.useState();
17629
18217
  React.useEffect(() => {
17630
- (() => __awaiter$e(void 0, void 0, void 0, function* () {
18218
+ (() => __awaiter$h(void 0, void 0, void 0, function* () {
17631
18219
  if (dataProvider && userId) {
17632
18220
  const newData = yield dataProvider(userId);
17633
18221
  if (avatarDeepDifferenceCheck(data, newData)) {
@@ -17991,7 +18579,7 @@ const FileDownloadErrorBar = (props) => {
17991
18579
 
17992
18580
  // Copyright (c) Microsoft Corporation.
17993
18581
  // Licensed under the MIT license.
17994
- var __awaiter$d = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
18582
+ var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
17995
18583
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17996
18584
  return new (P || (P = Promise))(function (resolve, reject) {
17997
18585
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -18012,7 +18600,7 @@ const ChatScreen = (props) => {
18012
18600
  const theme = useTheme();
18013
18601
  React.useEffect(() => {
18014
18602
  // Initial data should be always fetched by the composite(or external caller) instead of the adapter
18015
- const fetchData = () => __awaiter$d(void 0, void 0, void 0, function* () {
18603
+ const fetchData = () => __awaiter$g(void 0, void 0, void 0, function* () {
18016
18604
  // Fetch initial data for adapter
18017
18605
  yield adapter.fetchInitialData();
18018
18606
  // Fetch initial set of messages. Without fetching messages here, if the Composite's adapter is changed the message thread does not load new messages.
@@ -18127,20 +18715,6 @@ const useAdapter = () => {
18127
18715
  return adapter;
18128
18716
  };
18129
18717
 
18130
- // Copyright (c) Microsoft Corporation.
18131
- // Licensed under the MIT license.
18132
- /** @private */
18133
- const containerDivStyles = { position: 'relative', width: '100%', height: '100%' };
18134
-
18135
- // Copyright (c) Microsoft Corporation.
18136
- // Licensed under the MIT license.
18137
- /**
18138
- * This minimum width is to make sure the side pane does not overlap with the composite when the screen is narrow.
18139
- *
18140
- * @private
18141
- */
18142
- const compositeMinWidthRem = 30;
18143
-
18144
18718
  // Copyright (c) Microsoft Corporation.
18145
18719
  /**
18146
18720
  * @private
@@ -18226,7 +18800,7 @@ const adaptCompositeState = (compositeState) => {
18226
18800
 
18227
18801
  // Copyright (c) Microsoft Corporation.
18228
18802
  // Licensed under the MIT license.
18229
- var __awaiter$c = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
18803
+ var __awaiter$f = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
18230
18804
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18231
18805
  return new (P || (P = Promise))(function (resolve, reject) {
18232
18806
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -18245,103 +18819,131 @@ _component) => {
18245
18819
  return createCompositeHandlers(useAdapter());
18246
18820
  };
18247
18821
  const createCompositeHandlers = memoizeOne__default['default']((adapter) => ({
18248
- onCreateLocalStreamView: (options) => __awaiter$c(void 0, void 0, void 0, function* () {
18822
+ onCreateLocalStreamView: (options) => __awaiter$f(void 0, void 0, void 0, function* () {
18249
18823
  return yield adapter.createStreamView(undefined, options);
18250
18824
  }),
18251
- onCreateRemoteStreamView: (userId, options) => __awaiter$c(void 0, void 0, void 0, function* () {
18825
+ onCreateRemoteStreamView: (userId, options) => __awaiter$f(void 0, void 0, void 0, function* () {
18252
18826
  return yield adapter.createStreamView(userId, options);
18253
18827
  }),
18254
- onHangUp: (forEveryone) => __awaiter$c(void 0, void 0, void 0, function* () {
18828
+ onHangUp: (forEveryone) => __awaiter$f(void 0, void 0, void 0, function* () {
18255
18829
  yield adapter.leaveCall(forEveryone);
18256
18830
  }),
18257
18831
  /* @conditional-compile-remove(PSTN-calls) */
18258
- onToggleHold: () => __awaiter$c(void 0, void 0, void 0, function* () {
18832
+ onToggleHold: () => __awaiter$f(void 0, void 0, void 0, function* () {
18259
18833
  var _a;
18260
18834
  return ((_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.state) === 'LocalHold' ? yield adapter.resumeCall() : yield adapter.holdCall();
18261
18835
  }),
18262
18836
  /* @conditional-compile-remove(PSTN-calls) */
18263
- onAddParticipant: (participant, options) => __awaiter$c(void 0, void 0, void 0, function* () {
18837
+ onAddParticipant: (participant, options) => __awaiter$f(void 0, void 0, void 0, function* () {
18264
18838
  return yield adapter.addParticipant(participant, options);
18265
18839
  }),
18266
18840
  /* @conditional-compile-remove(PSTN-calls) */
18267
- onSendDtmfTone: (dtmfTone) => __awaiter$c(void 0, void 0, void 0, function* () {
18841
+ onSendDtmfTone: (dtmfTone) => __awaiter$f(void 0, void 0, void 0, function* () {
18268
18842
  yield adapter.sendDtmfTone(dtmfTone);
18269
18843
  }),
18270
- onRemoveParticipant: (userId) => __awaiter$c(void 0, void 0, void 0, function* () {
18844
+ onRemoveParticipant: (userId) => __awaiter$f(void 0, void 0, void 0, function* () {
18271
18845
  yield adapter.removeParticipant(userId);
18272
18846
  }),
18273
- onSelectCamera: (deviceInfo, options) => __awaiter$c(void 0, void 0, void 0, function* () {
18847
+ onSelectCamera: (deviceInfo, options) => __awaiter$f(void 0, void 0, void 0, function* () {
18274
18848
  yield adapter.setCamera(deviceInfo, options);
18275
18849
  }),
18276
- onSelectMicrophone: (deviceInfo) => __awaiter$c(void 0, void 0, void 0, function* () {
18850
+ onSelectMicrophone: (deviceInfo) => __awaiter$f(void 0, void 0, void 0, function* () {
18277
18851
  yield adapter.setMicrophone(deviceInfo);
18278
18852
  }),
18279
- onSelectSpeaker: (deviceInfo) => __awaiter$c(void 0, void 0, void 0, function* () {
18853
+ onSelectSpeaker: (deviceInfo) => __awaiter$f(void 0, void 0, void 0, function* () {
18280
18854
  yield adapter.setSpeaker(deviceInfo);
18281
18855
  }),
18282
18856
  onStartCall: (participants, options) => {
18283
18857
  const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));
18284
18858
  return adapter.startCall(rawIds, options);
18285
18859
  },
18286
- onStartScreenShare: () => __awaiter$c(void 0, void 0, void 0, function* () {
18860
+ onStartScreenShare: () => __awaiter$f(void 0, void 0, void 0, function* () {
18287
18861
  yield adapter.startScreenShare();
18288
18862
  }),
18289
- onStopScreenShare: () => __awaiter$c(void 0, void 0, void 0, function* () {
18863
+ onStopScreenShare: () => __awaiter$f(void 0, void 0, void 0, function* () {
18290
18864
  yield adapter.stopScreenShare();
18291
18865
  }),
18292
- onToggleCamera: (options) => __awaiter$c(void 0, void 0, void 0, function* () {
18866
+ onToggleCamera: (options) => __awaiter$f(void 0, void 0, void 0, function* () {
18293
18867
  isCameraOn(adapter.getState()) ? yield adapter.stopCamera() : yield adapter.startCamera(options);
18294
18868
  }),
18295
- onToggleMicrophone: () => __awaiter$c(void 0, void 0, void 0, function* () {
18869
+ onToggleMicrophone: () => __awaiter$f(void 0, void 0, void 0, function* () {
18296
18870
  var _b;
18297
18871
  return ((_b = adapter.getState().call) === null || _b === void 0 ? void 0 : _b.isMuted) ? yield adapter.unmute() : yield adapter.mute();
18298
18872
  }),
18299
- onToggleScreenShare: () => __awaiter$c(void 0, void 0, void 0, function* () {
18873
+ onToggleScreenShare: () => __awaiter$f(void 0, void 0, void 0, function* () {
18300
18874
  var _c;
18301
18875
  return ((_c = adapter.getState().call) === null || _c === void 0 ? void 0 : _c.isScreenSharingOn)
18302
18876
  ? yield adapter.stopScreenShare()
18303
18877
  : yield adapter.startScreenShare();
18304
18878
  }),
18305
- onStartLocalVideo: () => __awaiter$c(void 0, void 0, void 0, function* () {
18879
+ onStartLocalVideo: () => __awaiter$f(void 0, void 0, void 0, function* () {
18306
18880
  if (adapter.getState().call) {
18307
18881
  return adapter.startCamera();
18308
18882
  }
18309
18883
  }),
18310
- onDisposeLocalStreamView: () => __awaiter$c(void 0, void 0, void 0, function* () {
18884
+ onDisposeLocalStreamView: () => __awaiter$f(void 0, void 0, void 0, function* () {
18311
18885
  return adapter.disposeStreamView();
18312
18886
  }),
18313
- onDisposeRemoteStreamView: (userId) => __awaiter$c(void 0, void 0, void 0, function* () {
18887
+ onDisposeRemoteStreamView: (userId) => __awaiter$f(void 0, void 0, void 0, function* () {
18314
18888
  return adapter.disposeStreamView(userId);
18315
18889
  }),
18316
18890
  /* @conditional-compile-remove(call-readiness) */
18317
- askDevicePermission: (constrain) => __awaiter$c(void 0, void 0, void 0, function* () {
18891
+ askDevicePermission: (constrain) => __awaiter$f(void 0, void 0, void 0, function* () {
18318
18892
  return adapter.askDevicePermission(constrain);
18319
18893
  }),
18320
18894
  /* @conditional-compile-remove(video-background-effects) */
18321
- onRemoveVideoBackgroundEffects: () => __awaiter$c(void 0, void 0, void 0, function* () {
18895
+ onRemoveVideoBackgroundEffects: () => __awaiter$f(void 0, void 0, void 0, function* () {
18322
18896
  return yield adapter.stopVideoBackgroundEffect();
18323
18897
  }),
18324
18898
  /* @conditional-compile-remove(video-background-effects) */
18325
- onBlurVideoBackground: (backgroundBlurConfig) => __awaiter$c(void 0, void 0, void 0, function* () {
18899
+ onBlurVideoBackground: (backgroundBlurConfig) => __awaiter$f(void 0, void 0, void 0, function* () {
18326
18900
  return yield adapter.blurVideoBackground(backgroundBlurConfig);
18327
18901
  }),
18328
18902
  /* @conditional-compile-remove(video-background-effects) */
18329
- onReplaceVideoBackground: (backgroundReplacementConfig) => __awaiter$c(void 0, void 0, void 0, function* () {
18903
+ onReplaceVideoBackground: (backgroundReplacementConfig) => __awaiter$f(void 0, void 0, void 0, function* () {
18330
18904
  return yield adapter.replaceVideoBackground(backgroundReplacementConfig);
18905
+ }),
18906
+ /* @conditional-compile-remove(close-captions) */
18907
+ onStartCaptions: (options) => __awaiter$f(void 0, void 0, void 0, function* () {
18908
+ yield adapter.startCaptions(options);
18909
+ }),
18910
+ /* @conditional-compile-remove(close-captions) */
18911
+ onStopCaptions: () => __awaiter$f(void 0, void 0, void 0, function* () {
18912
+ yield adapter.stopCaptions();
18913
+ }),
18914
+ /* @conditional-compile-remove(close-captions) */
18915
+ onSetSpokenLanguage: (language) => __awaiter$f(void 0, void 0, void 0, function* () {
18916
+ yield adapter.setSpokenLanguage(language);
18917
+ }),
18918
+ /* @conditional-compile-remove(close-captions) */
18919
+ onSetCaptionLanguage: (language) => __awaiter$f(void 0, void 0, void 0, function* () {
18920
+ yield adapter.setCaptionLanguage(language);
18331
18921
  })
18332
18922
  }));
18333
18923
 
18334
18924
  // Copyright (c) Microsoft Corporation.
18335
- /**
18336
- * @private
18337
- */
18338
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
18339
- const usePropsFor$1 = (component) => {
18340
- const selector = getSelector$1(component);
18341
- if (!selector) {
18342
- throw new Error("Can't find the selector for component, please check supported component list");
18343
- }
18344
- return Object.assign(Object.assign({}, useAdaptedSelector(selector)), useHandlers());
18925
+ /** @private */
18926
+ const CaptionsSettingsModal = (props) => {
18927
+ /* @conditional-compile-remove(close-captions) */
18928
+ const CaptionsSettingsModalProps = useAdaptedSelector(_changeSpokenLanguageSelector);
18929
+ /* @conditional-compile-remove(close-captions) */
18930
+ const handlers = useHandlers();
18931
+ /* @conditional-compile-remove(close-captions) */
18932
+ const strings = useLocale().strings.call;
18933
+ /* @conditional-compile-remove(close-captions) */
18934
+ const modalStrings = {
18935
+ captionsSettingsModalTitle: strings.captionsSettingsModalTitle,
18936
+ captionsSettingsDropdownLabel: strings.captionsSettingsDropdownLabel,
18937
+ captionsSettingsDropdownInfoText: strings.captionsSettingsDropdownInfoText,
18938
+ captionsSettingsConfirmButtonLabel: strings.captionsSettingsConfirmButtonLabel,
18939
+ captionsSettingsCancelButtonLabel: strings.captionsSettingsCancelButtonLabel,
18940
+ captionsSettingsModalAriaLabel: strings.captionsSettingsModalAriaLabel,
18941
+ captionsSettingsCloseModalButtonAriaLabel: strings.captionsSettingsCloseModalButtonAriaLabel
18942
+ };
18943
+ /* @conditional-compile-remove(close-captions) */
18944
+ const captionsAvailableLanguageStrings = strings.captionsAvailableLanguageStrings;
18945
+ /* @conditional-compile-remove(close-captions) */
18946
+ return (React__default['default'].createElement(_CaptionsSettingsModal, Object.assign({}, CaptionsSettingsModalProps, handlers, { strings: modalStrings, captionsAvailableLanguageStrings: captionsAvailableLanguageStrings, showModal: props.showCaptionsSettingsModal, onDismissCaptionsSettings: props.onDismissCaptionsSettings })));
18345
18947
  };
18346
18948
 
18347
18949
  // Copyright (c) Microsoft Corporation.
@@ -18412,28 +19014,189 @@ const participantButtonWithIncreasedTouchTargets = {
18412
19014
  /**
18413
19015
  * @private
18414
19016
  */
18415
- const devicesButtonWithIncreasedTouchTargets = {
18416
- menuStyles: {
18417
- menuItemStyles: buttonFlyoutIncreasedSizeStyles
18418
- }
18419
- };
19017
+ const devicesButtonWithIncreasedTouchTargets = {
19018
+ menuStyles: {
19019
+ menuItemStyles: buttonFlyoutIncreasedSizeStyles
19020
+ }
19021
+ };
19022
+ /**
19023
+ * @private
19024
+ */
19025
+ const controlButtonBaseStyle = {
19026
+ label: {
19027
+ minWidth: '2.25rem'
19028
+ }
19029
+ };
19030
+ /**
19031
+ * @private
19032
+ */
19033
+ const concatButtonBaseStyles = (...styles) => {
19034
+ let result = controlButtonBaseStyle;
19035
+ styles.forEach((style) => {
19036
+ result = react.concatStyleSets(result, style);
19037
+ });
19038
+ return result;
19039
+ };
19040
+
19041
+ // Copyright (c) Microsoft Corporation.
19042
+ const icon$2 = () => React__default['default'].createElement(reactIcons.MoreHorizontal20Filled, { key: 'chatOnIconKey', primaryFill: "currentColor" });
19043
+ /**
19044
+ * @private
19045
+ */
19046
+ const MoreButton = (props) => {
19047
+ return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { labelKey: 'optionsButtonLabelKey', showLabel: props.showLabel, onRenderOnIcon: icon$2, onRenderOffIcon: icon$2, onClick: props.onClick, "data-ui-id": props['data-ui-id'] })));
19048
+ };
19049
+
19050
+ var __awaiter$e = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
19051
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19052
+ return new (P || (P = Promise))(function (resolve, reject) {
19053
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19054
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19055
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19056
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19057
+ });
19058
+ };
19059
+ /**
19060
+ *
19061
+ * @private
19062
+ */
19063
+ const CaptionsBannerMoreButton = (props) => {
19064
+ /* @conditional-compile-remove(close-captions) */
19065
+ const localeStrings = useLocale();
19066
+ /* @conditional-compile-remove(close-captions) */
19067
+ const startCaptionsButtonProps = useAdaptedSelector(_startCaptionsButtonSelector);
19068
+ /* @conditional-compile-remove(close-captions) */
19069
+ const startCaptionsButtonHandlers = useHandlers();
19070
+ /* @conditional-compile-remove(close-captions) */
19071
+ const moreButtonStrings = React.useMemo(() => ({
19072
+ label: localeStrings.strings.call.captionsBannerMoreButtonCallingLabel,
19073
+ tooltipOffContent: localeStrings.strings.call.captionsBannerMoreButtonTooltip
19074
+ }), [localeStrings]);
19075
+ /* @conditional-compile-remove(close-captions) */
19076
+ const moreButtonContextualMenuItems = [];
19077
+ /* @conditional-compile-remove(close-captions) */
19078
+ const startCaptions = React.useCallback(() => __awaiter$e(void 0, void 0, void 0, function* () {
19079
+ yield startCaptionsButtonHandlers.onStartCaptions({
19080
+ spokenLanguage: startCaptionsButtonProps.currentSpokenLanguage
19081
+ });
19082
+ // set spoken language when start captions with a spoken language specified.
19083
+ // this is to fix the bug when a second user starts captions with a new spoken language, captions bot ignore that spoken language
19084
+ startCaptionsButtonHandlers.onSetSpokenLanguage(startCaptionsButtonProps.currentSpokenLanguage);
19085
+ }), [startCaptionsButtonHandlers, startCaptionsButtonProps.currentSpokenLanguage]);
19086
+ /* @conditional-compile-remove(close-captions) */
19087
+ moreButtonContextualMenuItems.push({
19088
+ key: 'ToggleCaptionsKey',
19089
+ text: startCaptionsButtonProps.checked
19090
+ ? localeStrings.strings.call.startCaptionsButtonTooltipOnContent
19091
+ : localeStrings.strings.call.startCaptionsButtonTooltipOffContent,
19092
+ onClick: () => {
19093
+ startCaptionsButtonProps.checked
19094
+ ? startCaptionsButtonHandlers.onStopCaptions()
19095
+ : startCaptionsButtonProps.currentSpokenLanguage !== ''
19096
+ ? startCaptions()
19097
+ : props.onCaptionsSettingsClick && props.onCaptionsSettingsClick();
19098
+ },
19099
+ iconProps: {
19100
+ iconName: startCaptionsButtonProps.checked ? 'CaptionsOffIcon' : 'CaptionsIcon',
19101
+ styles: { root: { lineHeight: 0 } }
19102
+ },
19103
+ itemProps: {
19104
+ styles: buttonFlyoutIncreasedSizeStyles
19105
+ }
19106
+ });
19107
+ /* @conditional-compile-remove(close-captions) */
19108
+ if (props.onCaptionsSettingsClick) {
19109
+ moreButtonContextualMenuItems.push({
19110
+ key: 'openCaptionsSettingsKey',
19111
+ id: 'common-call-composite-captions-settings-button',
19112
+ text: localeStrings.strings.call.captionsSettingsLabel,
19113
+ onClick: props.onCaptionsSettingsClick,
19114
+ iconProps: {
19115
+ iconName: 'CaptionsSettingsIcon',
19116
+ styles: { root: { lineHeight: 0 } }
19117
+ },
19118
+ itemProps: {
19119
+ styles: buttonFlyoutIncreasedSizeStyles
19120
+ },
19121
+ disabled: !startCaptionsButtonProps.checked
19122
+ });
19123
+ }
19124
+ /* @conditional-compile-remove(close-captions) */
19125
+ return (React__default['default'].createElement(MoreButton, Object.assign({}, props, { "data-ui-id": "captions-banner-more-button", strings: moreButtonStrings, menuIconProps: { hidden: true }, menuProps: {
19126
+ items: moreButtonContextualMenuItems,
19127
+ calloutProps: {
19128
+ preventDismissOnEvent: _preventDismissOnEvent
19129
+ }
19130
+ } })));
19131
+ };
19132
+
19133
+ // Copyright (c) Microsoft Corporation.
19134
+ /* @conditional-compile-remove(close-captions) */
19135
+ const mobileViewBannerWidth = '90%';
19136
+ /* @conditional-compile-remove(close-captions) */
19137
+ const desktopViewBannerWidth = '50%';
19138
+ /** @private */
19139
+ const CaptionsBanner = (props) => {
19140
+ /* @conditional-compile-remove(close-captions) */
19141
+ const captionsBannerProps = useAdaptedSelector(_captionsBannerSelector);
19142
+ /* @conditional-compile-remove(close-captions) */
19143
+ const handlers = useHandlers();
19144
+ /* @conditional-compile-remove(close-captions) */
19145
+ const [isCaptionsSettingsOpen, setIsCaptionsSettingsOpen] = React.useState(false);
19146
+ /* @conditional-compile-remove(close-captions) */
19147
+ const onClickCaptionsSettings = () => {
19148
+ setIsCaptionsSettingsOpen(true);
19149
+ };
19150
+ /* @conditional-compile-remove(close-captions) */
19151
+ const onDismissCaptionsSettings = () => {
19152
+ setIsCaptionsSettingsOpen(false);
19153
+ };
19154
+ /* @conditional-compile-remove(close-captions) */
19155
+ const containerClassName = react.mergeStyles({
19156
+ position: 'relative'
19157
+ });
19158
+ /* @conditional-compile-remove(close-captions) */
19159
+ const floatingChildClassName = react.mergeStyles({
19160
+ position: 'absolute',
19161
+ right: 0,
19162
+ top: 0
19163
+ });
19164
+ return (React__default['default'].createElement(React__default['default'].Fragment, null,
19165
+ /* @conditional-compile-remove(close-captions) */ isCaptionsSettingsOpen && (React__default['default'].createElement(CaptionsSettingsModal, { showCaptionsSettingsModal: isCaptionsSettingsOpen, onDismissCaptionsSettings: onDismissCaptionsSettings })),
19166
+ /* @conditional-compile-remove(close-captions) */ captionsBannerProps.captions.length > 0 &&
19167
+ captionsBannerProps.isCaptionsOn && (React__default['default'].createElement("div", { className: containerClassName },
19168
+ React__default['default'].createElement(react.Stack, { horizontalAlign: "center" },
19169
+ React__default['default'].createElement(react.Stack.Item, { style: { width: props.isMobile ? mobileViewBannerWidth : desktopViewBannerWidth } },
19170
+ React__default['default'].createElement(_CaptionsBanner, Object.assign({}, captionsBannerProps, handlers)))),
19171
+ !props.isMobile && (React__default['default'].createElement("div", { className: floatingChildClassName },
19172
+ React__default['default'].createElement(CaptionsBannerMoreButton, { onCaptionsSettingsClick: onClickCaptionsSettings })))))));
19173
+ };
19174
+
19175
+ // Copyright (c) Microsoft Corporation.
19176
+ // Licensed under the MIT license.
19177
+ /** @private */
19178
+ const containerDivStyles = { position: 'relative', width: '100%', height: '100%' };
19179
+
19180
+ // Copyright (c) Microsoft Corporation.
19181
+ // Licensed under the MIT license.
19182
+ /**
19183
+ * This minimum width is to make sure the side pane does not overlap with the composite when the screen is narrow.
19184
+ *
19185
+ * @private
19186
+ */
19187
+ const compositeMinWidthRem = 30;
19188
+
19189
+ // Copyright (c) Microsoft Corporation.
18420
19190
  /**
18421
19191
  * @private
18422
19192
  */
18423
- const controlButtonBaseStyle = {
18424
- label: {
18425
- minWidth: '2.25rem'
19193
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
19194
+ const usePropsFor$1 = (component) => {
19195
+ const selector = getSelector$1(component);
19196
+ if (!selector) {
19197
+ throw new Error("Can't find the selector for component, please check supported component list");
18426
19198
  }
18427
- };
18428
- /**
18429
- * @private
18430
- */
18431
- const concatButtonBaseStyles = (...styles) => {
18432
- let result = controlButtonBaseStyle;
18433
- styles.forEach((style) => {
18434
- result = react.concatStyleSets(result, style);
18435
- });
18436
- return result;
19199
+ return Object.assign(Object.assign({}, useAdaptedSelector(selector)), useHandlers());
18437
19200
  };
18438
19201
 
18439
19202
  // Copyright (c) Microsoft Corporation.
@@ -18602,6 +19365,16 @@ const getDominantSpeakerInfo = (state) => { var _a; return (_a = state.call) ===
18602
19365
  * @private
18603
19366
  */
18604
19367
  const getRemoteParticipants = (state) => { var _a; return (_a = state.call) === null || _a === void 0 ? void 0 : _a.remoteParticipants; };
19368
+ /* @conditional-compile-remove(video-background-effects) */
19369
+ /**
19370
+ * @private
19371
+ */
19372
+ const getSelectedVideoEffect = (state) => state.selectedVideoBackgroundEffect;
19373
+ /* @conditional-compile-remove(close-captions) */
19374
+ /**
19375
+ * @private
19376
+ */
19377
+ const getIsTeamsCall = (state) => state.isTeamsCall;
18605
19378
 
18606
19379
  // Copyright (c) Microsoft Corporation.
18607
19380
  /**
@@ -18671,7 +19444,7 @@ const isDisabled = (option) => {
18671
19444
  };
18672
19445
 
18673
19446
  // Copyright (c) Microsoft Corporation.
18674
- const icon$2 = () => React__default['default'].createElement(CallCompositeIcon, { iconName: 'ControlButtonParticipants' });
19447
+ const icon$1 = () => React__default['default'].createElement(CallCompositeIcon, { iconName: 'ControlButtonParticipants' });
18675
19448
  /**
18676
19449
  * @private
18677
19450
  */
@@ -18687,16 +19460,7 @@ const People = (props) => {
18687
19460
  }
18688
19461
  }, (_a = props.styles) !== null && _a !== void 0 ? _a : {}, controlButtonBaseStyle);
18689
19462
  }, [props.styles, theme.palette.neutralLight]);
18690
- return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { "data-ui-id": "call-composite-participants-button", strings: strings, labelKey: 'peopleButtonLabelKey', onRenderOnIcon: onRenderOnIcon !== null && onRenderOnIcon !== void 0 ? onRenderOnIcon : icon$2, onRenderOffIcon: onRenderOffIcon !== null && onRenderOffIcon !== void 0 ? onRenderOffIcon : icon$2, onClick: onClick, styles: styles })));
18691
- };
18692
-
18693
- // Copyright (c) Microsoft Corporation.
18694
- const icon$1 = () => React__default['default'].createElement(reactIcons.MoreHorizontal20Filled, { key: 'chatOnIconKey', primaryFill: "currentColor" });
18695
- /**
18696
- * @private
18697
- */
18698
- const MoreButton = (props) => {
18699
- return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { labelKey: 'optionsButtonLabelKey', showLabel: props.showLabel, onRenderOnIcon: icon$1, onRenderOffIcon: icon$1, onClick: props.onClick, "data-ui-id": 'common-call-composite-more-button' })));
19463
+ return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { "data-ui-id": "call-composite-participants-button", strings: strings, labelKey: 'peopleButtonLabelKey', onRenderOnIcon: onRenderOnIcon !== null && onRenderOnIcon !== void 0 ? onRenderOnIcon : icon$1, onRenderOffIcon: onRenderOffIcon !== null && onRenderOffIcon !== void 0 ? onRenderOffIcon : icon$1, onClick: onClick, styles: styles })));
18700
19464
  };
18701
19465
 
18702
19466
  // Copyright (c) Microsoft Corporation.
@@ -18928,7 +19692,7 @@ const CallControls = (props) => {
18928
19692
  React__default['default'].createElement(People, { checked: props.peopleButtonChecked, ariaLabel: peopleButtonStrings === null || peopleButtonStrings === void 0 ? void 0 : peopleButtonStrings.label, showLabel: (options === null || options === void 0 ? void 0 : options.displayType) !== 'compact', onClick: props.onPeopleButtonClicked, "data-ui-id": "call-composite-people-button", strings: peopleButtonStrings, disabled: isDisabled$2(options === null || options === void 0 ? void 0 : options.participantsButton) })),
18929
19693
  isEnabled$2(options === null || options === void 0 ? void 0 : options.devicesButton) && (React__default['default'].createElement(Devices, { displayType: options === null || options === void 0 ? void 0 : options.displayType, increaseFlyoutItemSize: props.increaseFlyoutItemSize, disabled: isDisabled$2(options === null || options === void 0 ? void 0 : options.devicesButton) })),
18930
19694
  /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(PSTN-calls) */
18931
- isEnabled$2(options === null || options === void 0 ? void 0 : options.moreButton) && moreButtonContextualMenuItems().length > 0 && (React__default['default'].createElement(MoreButton, { strings: moreButtonStrings, menuIconProps: { hidden: true }, menuProps: { items: moreButtonContextualMenuItems() }, showLabel: (options === null || options === void 0 ? void 0 : options.displayType) !== 'compact' })),
19695
+ isEnabled$2(options === null || options === void 0 ? void 0 : options.moreButton) && moreButtonContextualMenuItems().length > 0 && (React__default['default'].createElement(MoreButton, { "data-ui-id": "common-call-composite-more-button", strings: moreButtonStrings, menuIconProps: { hidden: true }, menuProps: { items: moreButtonContextualMenuItems() }, showLabel: (options === null || options === void 0 ? void 0 : options.displayType) !== 'compact' })),
18932
19696
  customButtons['primary'],
18933
19697
  isEnabled$2(options === null || options === void 0 ? void 0 : options.endCallButton) && React__default['default'].createElement(EndCall, { displayType: options === null || options === void 0 ? void 0 : options.displayType })))));
18934
19698
  };
@@ -19259,16 +20023,39 @@ const onFetchCustomButtonPropsTrampoline = (options) => {
19259
20023
  };
19260
20024
 
19261
20025
  // Copyright (c) Microsoft Corporation.
20026
+ // Licensed under the MIT license.
20027
+ var __awaiter$d = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
20028
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20029
+ return new (P || (P = Promise))(function (resolve, reject) {
20030
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20031
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20032
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20033
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20034
+ });
20035
+ };
19262
20036
  /**
19263
20037
  *
19264
20038
  * @private
19265
20039
  */
19266
20040
  const DesktopMoreButton = (props) => {
19267
- /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
20041
+ /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(close-captions) */
19268
20042
  const localeStrings = useLocale();
19269
20043
  /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
19270
20044
  const holdButtonProps = usePropsFor$1(HoldButton);
19271
- /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
20045
+ /* @conditional-compile-remove(close-captions) */
20046
+ const startCaptionsButtonProps = useAdaptedSelector(_startCaptionsButtonSelector);
20047
+ /* @conditional-compile-remove(close-captions) */
20048
+ const startCaptionsButtonHandlers = useHandlers();
20049
+ /* @conditional-compile-remove(close-captions) */
20050
+ const startCaptions = React.useCallback(() => __awaiter$d(void 0, void 0, void 0, function* () {
20051
+ yield startCaptionsButtonHandlers.onStartCaptions({
20052
+ spokenLanguage: startCaptionsButtonProps.currentSpokenLanguage
20053
+ });
20054
+ // set spoken language when start captions with a spoken language specified.
20055
+ // this is to fix the bug when a second user starts captions with a new spoken language, captions bot ignore that spoken language
20056
+ startCaptionsButtonHandlers.onSetSpokenLanguage(startCaptionsButtonProps.currentSpokenLanguage);
20057
+ }), [startCaptionsButtonHandlers, startCaptionsButtonProps.currentSpokenLanguage]);
20058
+ /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(close-captions) */
19272
20059
  const moreButtonStrings = React.useMemo(() => ({
19273
20060
  label: localeStrings.strings.call.moreButtonCallingLabel,
19274
20061
  tooltipOffContent: localeStrings.strings.callWithChat.moreDrawerButtonTooltip
@@ -19287,6 +20074,77 @@ const DesktopMoreButton = (props) => {
19287
20074
  },
19288
20075
  disabled: props.disableButtonsForHoldScreen
19289
20076
  });
20077
+ // is captions feature is active
20078
+ /* @conditional-compile-remove(close-captions) */
20079
+ if (props.isCaptionsSupported) {
20080
+ const captionsContextualMenuItems = [];
20081
+ const menuSubIconStyleSet = {
20082
+ root: {
20083
+ height: 'unset',
20084
+ lineHeight: '100%',
20085
+ width: '1.25rem'
20086
+ }
20087
+ };
20088
+ moreButtonContextualMenuItems.push({
20089
+ key: 'liveCaptionsKey',
20090
+ id: 'common-call-composite-captions-button',
20091
+ text: localeStrings.strings.call.liveCaptionsLabel,
20092
+ iconProps: { iconName: 'CaptionsIcon', styles: { root: { lineHeight: 0 } } },
20093
+ itemProps: {
20094
+ styles: buttonFlyoutIncreasedSizeStyles
20095
+ },
20096
+ disabled: props.disableButtonsForHoldScreen,
20097
+ subMenuProps: {
20098
+ id: 'captions-contextual-menu',
20099
+ items: captionsContextualMenuItems,
20100
+ calloutProps: {
20101
+ preventDismissOnEvent: _preventDismissOnEvent
20102
+ }
20103
+ },
20104
+ submenuIconProps: {
20105
+ iconName: 'HorizontalGalleryRightButton',
20106
+ styles: menuSubIconStyleSet
20107
+ }
20108
+ });
20109
+ captionsContextualMenuItems.push({
20110
+ key: 'ToggleCaptionsKey',
20111
+ id: 'common-call-composite-captions-toggle-button',
20112
+ text: startCaptionsButtonProps.checked
20113
+ ? localeStrings.strings.call.startCaptionsButtonTooltipOnContent
20114
+ : localeStrings.strings.call.startCaptionsButtonTooltipOffContent,
20115
+ onClick: () => {
20116
+ startCaptionsButtonProps.checked
20117
+ ? startCaptionsButtonHandlers.onStopCaptions()
20118
+ : startCaptionsButtonProps.currentSpokenLanguage !== ''
20119
+ ? startCaptions()
20120
+ : props.onCaptionsSettingsClick && props.onCaptionsSettingsClick();
20121
+ },
20122
+ iconProps: {
20123
+ iconName: startCaptionsButtonProps.checked ? 'CaptionsOffIcon' : 'CaptionsIcon',
20124
+ styles: { root: { lineHeight: 0 } }
20125
+ },
20126
+ itemProps: {
20127
+ styles: buttonFlyoutIncreasedSizeStyles
20128
+ },
20129
+ disabled: props.disableButtonsForHoldScreen
20130
+ });
20131
+ if (props.onCaptionsSettingsClick) {
20132
+ captionsContextualMenuItems.push({
20133
+ key: 'openCaptionsSettingsKey',
20134
+ id: 'common-call-composite-captions-settings-button',
20135
+ text: localeStrings.strings.call.captionsSettingsLabel,
20136
+ onClick: props.onCaptionsSettingsClick,
20137
+ iconProps: {
20138
+ iconName: 'CaptionsSettingsIcon',
20139
+ styles: { root: { lineHeight: 0 } }
20140
+ },
20141
+ itemProps: {
20142
+ styles: buttonFlyoutIncreasedSizeStyles
20143
+ },
20144
+ disabled: props.disableButtonsForHoldScreen || !startCaptionsButtonProps.checked
20145
+ });
20146
+ }
20147
+ }
19290
20148
  /*@conditional-compile-remove(PSTN-calls) */
19291
20149
  if (props.onClickShowDialpad) {
19292
20150
  moreButtonContextualMenuItems.push({
@@ -19325,8 +20183,13 @@ const DesktopMoreButton = (props) => {
19325
20183
  } }, element));
19326
20184
  });
19327
20185
  return (React__default['default'].createElement(MoreButton, Object.assign({}, props, { "data-ui-id": "common-call-composite-more-button",
19328
- /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
19329
- strings: moreButtonStrings, menuIconProps: { hidden: true }, menuProps: { items: moreButtonContextualMenuItems } })));
20186
+ /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(close-captions) */
20187
+ strings: moreButtonStrings, menuIconProps: { hidden: true }, menuProps: {
20188
+ items: moreButtonContextualMenuItems,
20189
+ calloutProps: {
20190
+ preventDismissOnEvent: _preventDismissOnEvent
20191
+ }
20192
+ } })));
19330
20193
  };
19331
20194
 
19332
20195
  // Copyright (c) Microsoft Corporation.
@@ -19398,6 +20261,8 @@ const CommonCallControlBar = (props) => {
19398
20261
  const [isOutOfSpace, setIsOutOfSpace] = React.useState(false);
19399
20262
  const callWithChatStrings = useCallWithChatCompositeStrings();
19400
20263
  const options = inferCommonCallControlOptions(props.mobileView, props.callControls);
20264
+ /* @conditional-compile-remove(close-captions) */
20265
+ const [showCaptionsSettingsModal, setShowCaptionsSettingsModal] = React.useState(false);
19401
20266
  const handleResize = React.useCallback(() => {
19402
20267
  setControlBarButtonsWidth(controlBarContainerRef.current ? controlBarContainerRef.current.offsetWidth : 0);
19403
20268
  setPanelsButtonsWidth(sidepaneControlsRef.current ? sidepaneControlsRef.current.offsetWidth : 0);
@@ -19424,6 +20289,14 @@ const CommonCallControlBar = (props) => {
19424
20289
  React.useEffect(() => {
19425
20290
  setIsOutOfSpace(totalButtonsWidth > controlBarContainerWidth);
19426
20291
  }, [totalButtonsWidth, controlBarContainerWidth]);
20292
+ /* @conditional-compile-remove(close-captions) */
20293
+ const openCaptionsSettingsModal = React.useCallback(() => {
20294
+ setShowCaptionsSettingsModal(true);
20295
+ }, []);
20296
+ /* @conditional-compile-remove(close-captions) */
20297
+ const onDismissCaptionsSettings = React.useCallback(() => {
20298
+ setShowCaptionsSettingsModal(false);
20299
+ }, []);
19427
20300
  const chatButtonStrings = React.useMemo(() => ({
19428
20301
  label: callWithChatStrings.chatButtonLabel,
19429
20302
  tooltipOffContent: callWithChatStrings.chatButtonTooltipOpen,
@@ -19463,6 +20336,8 @@ const CommonCallControlBar = (props) => {
19463
20336
  }
19464
20337
  const chatButton = props.chatAdapter ? (React__default['default'].createElement(ChatButtonWithUnreadMessagesBadge, { chatAdapter: props.chatAdapter, checked: props.chatButtonChecked, showLabel: options.displayType !== 'compact', isChatPaneVisible: (_a = props.chatButtonChecked) !== null && _a !== void 0 ? _a : false, onClick: props.onChatButtonClicked, disabled: props.disableButtonsForLobbyPage || isDisabled$2(options.chatButton), strings: chatButtonStrings, styles: commonButtonStyles, newMessageLabel: callWithChatStrings.chatButtonNewMessageNotificationLabel })) : (React__default['default'].createElement(React__default['default'].Fragment, null));
19465
20338
  return (React__default['default'].createElement("div", { ref: controlBarSizeRef },
20339
+ React__default['default'].createElement(CallAdapterProvider, { adapter: props.callAdapter },
20340
+ /* @conditional-compile-remove(close-captions) */ showCaptionsSettingsModal && (React__default['default'].createElement(CaptionsSettingsModal, { showCaptionsSettingsModal: showCaptionsSettingsModal, onDismissCaptionsSettings: onDismissCaptionsSettings }))),
19466
20341
  React__default['default'].createElement(react.Stack, { horizontal: true, reversed: !props.mobileView && !isOutOfSpace, horizontalAlign: "space-between", className: react.mergeStyles(callControlsContainerStyles, controlBarContainerStyles$1, controlBarDesktopContainerStyles) },
19467
20342
  React__default['default'].createElement(react.Stack.Item, { grow: true, className: react.mergeStyles(controlBarWrapperDesktopStyles) },
19468
20343
  React__default['default'].createElement(CallAdapterProvider, { adapter: props.callAdapter },
@@ -19495,7 +20370,11 @@ const CommonCallControlBar = (props) => {
19495
20370
  /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ isEnabled$1(options === null || options === void 0 ? void 0 : options.holdButton) &&
19496
20371
  !props.mobileView && (React__default['default'].createElement(DesktopMoreButton, { disableButtonsForHoldScreen: props.disableButtonsForHoldScreen, styles: commonButtonStyles, onClickShowDialpad: props.onClickShowDialpad,
19497
20372
  /* @conditional-compile-remove(control-bar-button-injection) */
19498
- callControls: props.callControls })),
20373
+ callControls: props.callControls,
20374
+ /* @conditional-compile-remove(close-captions) */
20375
+ isCaptionsSupported: props.isCaptionsSupported,
20376
+ /* @conditional-compile-remove(close-captions) */
20377
+ onCaptionsSettingsClick: openCaptionsSettingsModal })),
19499
20378
  React__default['default'].createElement(EndCall, { displayType: "compact", styles: endCallButtonStyles }))))))),
19500
20379
  !props.mobileView && (React__default['default'].createElement(react.Stack.Item, null,
19501
20380
  React__default['default'].createElement("div", { ref: sidepaneControlsRef },
@@ -20241,7 +21120,7 @@ const AddPeopleButton = (props) => {
20241
21120
 
20242
21121
  // Copyright (c) Microsoft Corporation.
20243
21122
  // Licensed under the MIT license.
20244
- var __awaiter$b = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
21123
+ var __awaiter$c = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
20245
21124
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20246
21125
  return new (P || (P = Promise))(function (resolve, reject) {
20247
21126
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -20277,7 +21156,7 @@ const PeoplePaneContent = (props) => {
20277
21156
  setDrawerMenuItems
20278
21157
  ]);
20279
21158
  const participantListProps = React.useMemo(() => {
20280
- const onRemoveAParticipant = (participantId) => __awaiter$b(void 0, void 0, void 0, function* () { return onRemoveParticipant(participantId); });
21159
+ const onRemoveAParticipant = (participantId) => __awaiter$c(void 0, void 0, void 0, function* () { return onRemoveParticipant(participantId); });
20281
21160
  return Object.assign(Object.assign({}, participantListDefaultProps), {
20282
21161
  // Passing undefined callback for mobile to avoid context menus for participants in ParticipantList are clicked
20283
21162
  onRemoveParticipant: props.mobileView ? undefined : onRemoveAParticipant,
@@ -20475,8 +21354,12 @@ const useMinMaxDragPosition = (modalLayerHostId, rtl) => {
20475
21354
  }, [modalHostHeight, modalHostWidth, rtl]);
20476
21355
  return { minDragPosition: minDragPosition, maxDragPosition: maxDragPosition };
20477
21356
  };
21357
+ /**
21358
+ * @private
21359
+ */
21360
+ const defaultSpokenLanguage = 'en-us';
20478
21361
 
20479
- var __awaiter$a = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
21362
+ var __awaiter$b = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
20480
21363
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20481
21364
  return new (P || (P = Promise))(function (resolve, reject) {
20482
21365
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -20506,11 +21389,11 @@ const CallPane = (props) => {
20506
21389
  /**
20507
21390
  * In a Call Composite when a participant is removed, we must remove them from the call.
20508
21391
  */
20509
- const removeParticipantFromCall = (participantId) => __awaiter$a(void 0, void 0, void 0, function* () {
21392
+ const removeParticipantFromCall = (participantId) => __awaiter$b(void 0, void 0, void 0, function* () {
20510
21393
  yield props.callAdapter.removeParticipant(participantId);
20511
21394
  });
20512
21395
  /* @conditional-compile-remove(PSTN-calls) */
20513
- const addParticipantToCall = (participant, options) => __awaiter$a(void 0, void 0, void 0, function* () {
21396
+ const addParticipantToCall = (participant, options) => __awaiter$b(void 0, void 0, void 0, function* () {
20514
21397
  yield props.callAdapter.addParticipant(participant, options);
20515
21398
  });
20516
21399
  const minMaxDragPosition = useMinMaxDragPosition(props.modalLayerHostId, props.rtl);
@@ -20574,6 +21457,99 @@ const isSpeakingAndMutedAnimationStyles = Object.assign({}, react.AnimationStyle
20574
21457
  const isNotSpeakingAndMutedAnimationStyles = Object.assign(Object.assign({}, react.AnimationStyles.fadeOut200), { display: 'none' });
20575
21458
 
20576
21459
  // Copyright (c) Microsoft Corporation.
21460
+ /**
21461
+ * @private
21462
+ */
21463
+ const spokenLanguageDrawerStyles = (theme) => ({
21464
+ root: {
21465
+ height: _pxToRem(300),
21466
+ overflow: 'auto'
21467
+ },
21468
+ drawerSurfaceStyles: {
21469
+ drawerContentContainer: {
21470
+ root: {
21471
+ span: {
21472
+ fontWeight: 600,
21473
+ fontSize: _pxToRem(17),
21474
+ lineHeight: _pxToRem(22),
21475
+ color: theme.palette.neutralDark
21476
+ }
21477
+ }
21478
+ }
21479
+ }
21480
+ });
21481
+
21482
+ // Copyright (c) Microsoft Corporation.
21483
+ /** @private */
21484
+ const SpokenLanguageDrawer = (props) => {
21485
+ var _a;
21486
+ /* @conditional-compile-remove(close-captions) */
21487
+ const theme = useTheme();
21488
+ /* @conditional-compile-remove(close-captions) */
21489
+ const changeSpokenLanguageProps = useAdaptedSelector(_changeSpokenLanguageSelector);
21490
+ /* @conditional-compile-remove(close-captions) */
21491
+ const changeSpokenLanguageHandlers = useHandlers();
21492
+ /* @conditional-compile-remove(close-captions) */
21493
+ const onSpokenLanguageDrawerItemClick = React.useCallback((languageCode) => {
21494
+ props.setCurrentSpokenLanguage(languageCode);
21495
+ }, [props]);
21496
+ /* @conditional-compile-remove(close-captions) */
21497
+ const spokenLanguageDrawerItems = React.useMemo(() => {
21498
+ var _a;
21499
+ return (_a = changeSpokenLanguageProps === null || changeSpokenLanguageProps === void 0 ? void 0 : changeSpokenLanguageProps.supportedSpokenLanguages) === null || _a === void 0 ? void 0 : _a.map((languageCode) => ({
21500
+ itemKey: languageCode,
21501
+ text: props.supportedLanguageStrings ? props.supportedLanguageStrings[languageCode] : languageCode,
21502
+ onItemClick: () => onSpokenLanguageDrawerItemClick(languageCode),
21503
+ secondaryIconProps: props.currentSpokenLanguage === languageCode ? { iconName: 'Accept' } : undefined
21504
+ }));
21505
+ }, [
21506
+ changeSpokenLanguageProps === null || changeSpokenLanguageProps === void 0 ? void 0 : changeSpokenLanguageProps.supportedSpokenLanguages,
21507
+ props.currentSpokenLanguage,
21508
+ props.supportedLanguageStrings,
21509
+ onSpokenLanguageDrawerItemClick
21510
+ ]);
21511
+ /* @conditional-compile-remove(close-captions) */
21512
+ return (React__default['default'].createElement(_DrawerMenu, { heading: (_a = props.strings) === null || _a === void 0 ? void 0 : _a.spokenLanguageMenuTitle, items: spokenLanguageDrawerItems !== null && spokenLanguageDrawerItems !== void 0 ? spokenLanguageDrawerItems : [], onLightDismiss: () => {
21513
+ changeSpokenLanguageHandlers.onSetSpokenLanguage(props.currentSpokenLanguage);
21514
+ props.onLightDismiss();
21515
+ }, styles: spokenLanguageDrawerStyles(theme) }));
21516
+ };
21517
+
21518
+ /**
21519
+ * @private
21520
+ */
21521
+ const themedToggleButtonStyle = (theme, checked) => {
21522
+ if (checked) {
21523
+ return {
21524
+ root: {
21525
+ margin: 0
21526
+ },
21527
+ pill: {
21528
+ backgroundColor: `${theme.palette.themePrimary} !important`
21529
+ },
21530
+ thumb: {
21531
+ backgroundColor: `${theme.palette.white} !important`
21532
+ }
21533
+ };
21534
+ }
21535
+ return {
21536
+ root: {
21537
+ margin: 0
21538
+ }
21539
+ };
21540
+ };
21541
+
21542
+ // Copyright (c) Microsoft Corporation.
21543
+ // Licensed under the MIT license.
21544
+ var __awaiter$a = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
21545
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
21546
+ return new (P || (P = Promise))(function (resolve, reject) {
21547
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21548
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21549
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21550
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21551
+ });
21552
+ };
20577
21553
  const inferCallWithChatControlOptions = (callWithChatControls) => {
20578
21554
  if (callWithChatControls === false) {
20579
21555
  return false;
@@ -20584,6 +21560,8 @@ const inferCallWithChatControlOptions = (callWithChatControls) => {
20584
21560
  /** @private */
20585
21561
  const MoreDrawer = (props) => {
20586
21562
  var _a, _b;
21563
+ /* @conditional-compile-remove(close-captions) */
21564
+ const theme = react.useTheme();
20587
21565
  const drawerMenuItems = [];
20588
21566
  const { speakers, onSelectSpeaker, onLightDismiss } = props;
20589
21567
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
@@ -20691,6 +21669,76 @@ const MoreDrawer = (props) => {
20691
21669
  iconProps: { iconName: 'Dialpad', styles: { root: { lineHeight: 0 } } }
20692
21670
  });
20693
21671
  }
21672
+ /* @conditional-compile-remove(close-captions) */
21673
+ //Captions drawer menu
21674
+ const supportedLanguageStrings = useLocale().strings.call.captionsAvailableLanguageStrings;
21675
+ /* @conditional-compile-remove(close-captions) */
21676
+ const startCaptionsButtonProps = useAdaptedSelector(_startCaptionsButtonSelector);
21677
+ /* @conditional-compile-remove(close-captions) */
21678
+ const startCaptionsButtonHandlers = useHandlers();
21679
+ /* @conditional-compile-remove(close-captions) */
21680
+ const [isSpokenLanguageDrawerOpen, setIsSpokenLanguageDrawerOpen] = React.useState(false);
21681
+ /* @conditional-compile-remove(close-captions) */
21682
+ const [currentSpokenLanguage, setCurrentSpokenLanguage] = React.useState(startCaptionsButtonProps.currentSpokenLanguage === ''
21683
+ ? defaultSpokenLanguage
21684
+ : startCaptionsButtonProps.currentSpokenLanguage);
21685
+ /* @conditional-compile-remove(close-captions) */
21686
+ const onToggleChange = React.useCallback(() => __awaiter$a(void 0, void 0, void 0, function* () {
21687
+ if (!startCaptionsButtonProps.checked) {
21688
+ yield startCaptionsButtonHandlers.onStartCaptions({
21689
+ spokenLanguage: currentSpokenLanguage
21690
+ });
21691
+ // set spoken language when start captions with a spoken language specified.
21692
+ // this is to fix the bug when a second user starts captions with a new spoken language, captions bot ignore that spoken language
21693
+ startCaptionsButtonHandlers.onSetSpokenLanguage(currentSpokenLanguage);
21694
+ }
21695
+ else {
21696
+ startCaptionsButtonHandlers.onStopCaptions();
21697
+ }
21698
+ }), [startCaptionsButtonProps.checked, startCaptionsButtonHandlers, currentSpokenLanguage]);
21699
+ /* @conditional-compile-remove(close-captions) */
21700
+ if (props.isCaptionsSupported) {
21701
+ const captionsDrawerItems = [];
21702
+ drawerMenuItems.push({
21703
+ itemKey: 'captions',
21704
+ id: 'common-call-composite-captions-button',
21705
+ disabled: props.disableButtonsForHoldScreen,
21706
+ text: props.strings.captionsMenuTitle,
21707
+ iconProps: { iconName: 'CaptionsIcon' },
21708
+ subMenuProps: captionsDrawerItems
21709
+ });
21710
+ captionsDrawerItems.push({
21711
+ itemKey: 'ToggleCaptionsKey',
21712
+ text: startCaptionsButtonProps.checked
21713
+ ? localeStrings.strings.call.startCaptionsButtonTooltipOnContent
21714
+ : localeStrings.strings.call.startCaptionsButtonTooltipOffContent,
21715
+ iconProps: {
21716
+ iconName: startCaptionsButtonProps.checked ? 'CaptionsOffIcon' : 'CaptionsIcon',
21717
+ styles: { root: { lineHeight: 0 } }
21718
+ },
21719
+ disabled: props.disableButtonsForHoldScreen,
21720
+ secondaryComponent: (React__default['default'].createElement(react.Stack, { verticalFill: true, verticalAlign: "center" },
21721
+ React__default['default'].createElement(react.Toggle, { id: "common-call-composite-captions-toggle-button", checked: startCaptionsButtonProps.checked, styles: themedToggleButtonStyle(theme, startCaptionsButtonProps.checked), onChange: onToggleChange })))
21722
+ });
21723
+ captionsDrawerItems.push({
21724
+ itemKey: 'ChangeSpokenLanguage',
21725
+ text: props.strings.spokenLanguageMenuTitle,
21726
+ id: 'common-call-composite-captions-settings-button',
21727
+ secondaryText: supportedLanguageStrings ? supportedLanguageStrings[currentSpokenLanguage] : currentSpokenLanguage,
21728
+ iconProps: {
21729
+ iconName: 'ChangeSpokenLanguageIcon',
21730
+ styles: { root: { lineHeight: 0 } }
21731
+ },
21732
+ disabled: props.disableButtonsForHoldScreen || !startCaptionsButtonProps.checked,
21733
+ onItemClick: () => {
21734
+ setIsSpokenLanguageDrawerOpen(true);
21735
+ },
21736
+ secondaryIconProps: {
21737
+ iconName: 'ChevronRight',
21738
+ styles: { root: { lineHeight: 0 } }
21739
+ }
21740
+ });
21741
+ }
20694
21742
  /* @conditional-compile-remove(control-bar-button-injection) */
20695
21743
  const customDrawerButtons = React.useMemo(() => generateCustomCallDrawerButtons(onFetchCustomButtonPropsTrampoline(drawerSelectionOptions !== false ? drawerSelectionOptions : undefined), drawerSelectionOptions !== false ? drawerSelectionOptions === null || drawerSelectionOptions === void 0 ? void 0 : drawerSelectionOptions.displayType : undefined), [drawerSelectionOptions]);
20696
21744
  /* @conditional-compile-remove(control-bar-button-injection) */
@@ -20705,7 +21753,10 @@ const MoreDrawer = (props) => {
20705
21753
  customDrawerButtons['overflow'].forEach((element) => {
20706
21754
  drawerMenuItems.push(element);
20707
21755
  });
20708
- return React__default['default'].createElement(_DrawerMenu, { items: drawerMenuItems, onLightDismiss: props.onLightDismiss });
21756
+ /* @conditional-compile-remove(close-captions) */
21757
+ return (React__default['default'].createElement(React__default['default'].Fragment, null,
21758
+ isSpokenLanguageDrawerOpen && props.isCaptionsSupported && (React__default['default'].createElement(SpokenLanguageDrawer, { onLightDismiss: props.onLightDismiss, setCurrentSpokenLanguage: setCurrentSpokenLanguage, currentSpokenLanguage: currentSpokenLanguage, strings: props.strings, supportedLanguageStrings: supportedLanguageStrings })),
21759
+ !isSpokenLanguageDrawerOpen && React__default['default'].createElement(_DrawerMenu, { items: drawerMenuItems, onLightDismiss: props.onLightDismiss })));
20709
21760
  };
20710
21761
  const isDeviceSelected = (speaker, selectedSpeaker) => !!selectedSpeaker && speaker.id === selectedSpeaker.id;
20711
21762
  const isEnabled = (option) => option !== false;
@@ -20731,13 +21782,33 @@ const PreparedMoreDrawer = (props) => {
20731
21782
  peopleButtonLabel: strings.peopleButtonLabel,
20732
21783
  audioDeviceMenuTitle: strings.moreDrawerAudioDeviceMenuTitle,
20733
21784
  microphoneMenuTitle: strings.moreDrawerMicrophoneMenuTitle,
20734
- speakerMenuTitle: strings.moreDrawerSpeakerMenuTitle
21785
+ speakerMenuTitle: strings.moreDrawerSpeakerMenuTitle,
21786
+ /* @conditional-compile-remove(close-captions) */
21787
+ captionsMenuTitle: strings.moreDrawerCaptionsMenuTitle,
21788
+ /* @conditional-compile-remove(close-captions) */
21789
+ spokenLanguageMenuTitle: strings.moreDrawerSpokenLanguageMenuTitle
20735
21790
  }), [strings]);
20736
21791
  const deviceProps = useSelector$1(moreDrawerSelector);
20737
21792
  const callHandlers = useHandlers();
20738
21793
  return React__default['default'].createElement(MoreDrawer, Object.assign({}, props, deviceProps, callHandlers, { strings: moreDrawerStrings }));
20739
21794
  };
20740
21795
 
21796
+ // Copyright (c) Microsoft Corporation.
21797
+ /* @conditional-compile-remove(video-background-effects) */
21798
+ /**
21799
+ * @private
21800
+ */
21801
+ const activeVideoBackgroundEffectSelector = reselect__namespace.createSelector([getSelectedVideoEffect], (selectedVideoBackgroundEffect) => {
21802
+ if (selectedVideoBackgroundEffect &&
21803
+ (selectedVideoBackgroundEffect.effectName === 'blur' || selectedVideoBackgroundEffect.effectName === 'none')) {
21804
+ return selectedVideoBackgroundEffect.effectName;
21805
+ }
21806
+ else if (selectedVideoBackgroundEffect && selectedVideoBackgroundEffect.effectName === 'replacement') {
21807
+ return selectedVideoBackgroundEffect === null || selectedVideoBackgroundEffect === void 0 ? void 0 : selectedVideoBackgroundEffect.effectKey;
21808
+ }
21809
+ return 'none';
21810
+ });
21811
+
20741
21812
  var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
20742
21813
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20743
21814
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -20757,6 +21828,8 @@ const VideoEffectsPane = (props) => {
20757
21828
  /* @conditional-compile-remove(video-background-effects) */
20758
21829
  const locale = useLocale();
20759
21830
  /* @conditional-compile-remove(video-background-effects) */
21831
+ const adapter = useAdapter();
21832
+ /* @conditional-compile-remove(video-background-effects) */
20760
21833
  const strings = locale.strings.call;
20761
21834
  /* @conditional-compile-remove(video-background-effects) */
20762
21835
  const selectableVideoEffects = React.useMemo(() => {
@@ -20782,7 +21855,7 @@ const VideoEffectsPane = (props) => {
20782
21855
  }
20783
21856
  }
20784
21857
  ];
20785
- const videoEffectImages = props.adapter.getState().videoBackgroundImages;
21858
+ const videoEffectImages = adapter.getState().videoBackgroundImages;
20786
21859
  if (videoEffectImages) {
20787
21860
  videoEffectImages.forEach((img) => {
20788
21861
  var _a;
@@ -20798,22 +21871,22 @@ const VideoEffectsPane = (props) => {
20798
21871
  });
20799
21872
  }
20800
21873
  return videoEffects;
20801
- }, [strings, props.adapter]);
21874
+ }, [strings, adapter]);
20802
21875
  /* @conditional-compile-remove(video-background-effects) */
20803
21876
  const onEffectChange = React.useCallback((effectKey) => __awaiter$9(void 0, void 0, void 0, function* () {
20804
21877
  if (effectKey === 'blur') {
20805
21878
  const blurEffect = {
20806
21879
  effectName: effectKey
20807
21880
  };
20808
- props.adapter.updateSelectedVideoBackgroundEffect(blurEffect);
20809
- yield props.adapter.blurVideoBackground();
21881
+ adapter.updateSelectedVideoBackgroundEffect(blurEffect);
21882
+ yield adapter.blurVideoBackground();
20810
21883
  }
20811
21884
  else if (effectKey === 'none') {
20812
21885
  const noneEffect = {
20813
21886
  effectName: effectKey
20814
21887
  };
20815
- props.adapter.updateSelectedVideoBackgroundEffect(noneEffect);
20816
- yield props.adapter.stopVideoBackgroundEffect();
21888
+ adapter.updateSelectedVideoBackgroundEffect(noneEffect);
21889
+ yield adapter.stopVideoBackgroundEffect();
20817
21890
  }
20818
21891
  else {
20819
21892
  const backgroundImg = selectableVideoEffects.find((effect) => {
@@ -20825,11 +21898,11 @@ const VideoEffectsPane = (props) => {
20825
21898
  effectKey,
20826
21899
  backgroundImageUrl: backgroundImg.backgroundProps.url
20827
21900
  };
20828
- props.adapter.updateSelectedVideoBackgroundEffect(replaceEffect);
20829
- yield props.adapter.replaceVideoBackground({ backgroundImageUrl: backgroundImg.backgroundProps.url });
21901
+ adapter.updateSelectedVideoBackgroundEffect(replaceEffect);
21902
+ yield adapter.replaceVideoBackground({ backgroundImageUrl: backgroundImg.backgroundProps.url });
20830
21903
  }
20831
21904
  }
20832
- }), [props.adapter, selectableVideoEffects]);
21905
+ }), [adapter, selectableVideoEffects]);
20833
21906
  return VideoEffectsPaneTrampoline(showVideoEffectsOptions, setshowVideoEffectsOptions,
20834
21907
  /* @conditional-compile-remove(video-background-effects) */
20835
21908
  selectableVideoEffects,
@@ -20840,7 +21913,9 @@ const VideoEffectsPaneTrampoline = (showVideoEffectsOptions, setshowVideoEffects
20840
21913
  /* @conditional-compile-remove(video-background-effects) */
20841
21914
  const locale = useLocale();
20842
21915
  /* @conditional-compile-remove(video-background-effects) */
20843
- return (React__default['default'].createElement(react.Panel, { headerText: locale.strings.call.effects, isOpen: showVideoEffectsOptions, onDismiss: () => setshowVideoEffectsOptions(false), hasCloseButton: true, closeButtonAriaLabel: "Close", isLightDismiss: true }, selectableVideoEffects && (React__default['default'].createElement(_VideoBackgroundEffectsPicker, { options: selectableVideoEffects, onChange: onEffectChange }))));
21916
+ const selectedEffect = useSelector$1(activeVideoBackgroundEffectSelector);
21917
+ /* @conditional-compile-remove(video-background-effects) */
21918
+ return (React__default['default'].createElement(react.Panel, { headerText: locale.strings.call.effects, isOpen: showVideoEffectsOptions, onDismiss: () => setshowVideoEffectsOptions(false), hasCloseButton: true, closeButtonAriaLabel: "Close", isLightDismiss: true }, selectableVideoEffects && (React__default['default'].createElement(_VideoBackgroundEffectsPicker, { options: selectableVideoEffects, onChange: onEffectChange, selectedEffectKey: selectedEffect }))));
20844
21919
  };
20845
21920
 
20846
21921
  // Copyright (c) Microsoft Corporation.
@@ -20950,6 +22025,10 @@ const CallArrangement = (props) => {
20950
22025
  if (!rolePermissions.cameraButton && props.errorBarProps) {
20951
22026
  errorBarProps = Object.assign(Object.assign({}, props.errorBarProps), { activeErrorMessages: props.errorBarProps.activeErrorMessages.filter((e) => e.type !== 'callCameraAccessDenied' && e.type !== 'callCameraAccessDeniedSafari') });
20952
22027
  }
22028
+ /* @conditional-compile-remove(close-captions) */
22029
+ const isTeamsCall = useSelector$1(getIsTeamsCall);
22030
+ /* @conditional-compile-remove(close-captions) */
22031
+ const hasJoinedCall = useSelector$1(getCallStatus) === 'Connected';
20953
22032
  return (React__default['default'].createElement("div", { ref: containerRef, className: react.mergeStyles(containerDivStyles), id: props.id },
20954
22033
  React__default['default'].createElement(react.Stack, { verticalFill: true, horizontalAlign: "stretch", className: containerClassName, "data-ui-id": props.dataUiId },
20955
22034
  React__default['default'].createElement(react.Stack, { grow: true, styles: callArrangementContainerStyles },
@@ -20960,6 +22039,8 @@ const CallArrangement = (props) => {
20960
22039
  peopleButtonChecked: activePane === 'people',
20961
22040
  /* @conditional-compile-remove(one-to-n-calling) */
20962
22041
  onPeopleButtonClicked: togglePeoplePane }))) : (React__default['default'].createElement(CommonCallControlBar, Object.assign({}, props.callControlProps, { callControls: props.callControlProps.options, callAdapter: adapter, mobileView: props.mobileView, disableButtonsForLobbyPage: isInLobby, peopleButtonChecked: activePane === 'people', onPeopleButtonClicked: togglePeoplePane, onMoreButtonClicked: onMoreButtonClicked,
22042
+ /* @conditional-compile-remove(close-captions) */
22043
+ isCaptionsSupported: isTeamsCall && hasJoinedCall,
20963
22044
  /* @conditional-compile-remove(video-background-effects) */
20964
22045
  onShowVideoEffectsPicker: setShowVideoEffectsPane }))))),
20965
22046
  ((_d = props.callControlProps) === null || _d === void 0 ? void 0 : _d.options) !== false && showDrawer && (React__default['default'].createElement(react.Stack, { styles: drawerContainerStylesValue },
@@ -20967,7 +22048,9 @@ const CallArrangement = (props) => {
20967
22048
  /* @conditional-compile-remove(PSTN-calls) */
20968
22049
  onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined,
20969
22050
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
20970
- disableButtonsForHoldScreen: isInLocalHold }))),
22051
+ disableButtonsForHoldScreen: isInLocalHold,
22052
+ /* @conditional-compile-remove(close-captions) */
22053
+ isCaptionsSupported: isTeamsCall && hasJoinedCall }))),
20971
22054
  /* @conditional-compile-remove(PSTN-calls) */
20972
22055
  ((_e = props.callControlProps) === null || _e === void 0 ? void 0 : _e.options) !== false && showDtmfDialpad && (React__default['default'].createElement(react.Stack, { styles: drawerContainerStylesValue },
20973
22056
  React__default['default'].createElement(SendDtmfDialpad, { isMobile: props.mobileView, strings: dialpadStrings, showDialpad: showDtmfDialpad, onDismissDialpad: onDismissDtmfDialpad }))),
@@ -20981,11 +22064,13 @@ const CallArrangement = (props) => {
20981
22064
  errorBarProps !== false && (React__default['default'].createElement(react.Stack, { styles: bannerNotificationStyles },
20982
22065
  React__default['default'].createElement(ErrorBar, Object.assign({}, errorBarProps)))),
20983
22066
  canUnmute && !!props.mutedNotificationProps && (React__default['default'].createElement(MutedNotification, Object.assign({}, props.mutedNotificationProps)))),
20984
- props.onRenderGalleryContent && props.onRenderGalleryContent()))),
22067
+ props.onRenderGalleryContent && props.onRenderGalleryContent(),
22068
+ /* @conditional-compile-remove(close-captions) */
22069
+ /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ !isInLocalHold && (React__default['default'].createElement(CaptionsBanner, { isMobile: props.mobileView }))))),
20985
22070
  /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
20986
22071
  callPaneContent()),
20987
22072
  /* @conditional-compile-remove(video-background-effects) */
20988
- React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane, adapter: adapter })))));
22073
+ React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane })))));
20989
22074
  };
20990
22075
  /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
20991
22076
  const showShowPeopleTabHeaderButton$1 = (callControls) => {
@@ -22323,7 +23408,7 @@ const ConfigurationPage = (props) => {
22323
23408
  React__default['default'].createElement(react.Stack, { styles: mobileWithPreview ? startCallButtonContainerStyleMobile : startCallButtonContainerStyleDesktop },
22324
23409
  React__default['default'].createElement(StartCallButton, { className: mobileWithPreview ? startCallButtonStyleMobile : undefined, onClick: startCallHandler, disabled: disableStartCallButton })))),
22325
23410
  /* @conditional-compile-remove(video-background-effects) */
22326
- React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setVideoEffectsPane, adapter: adapter })));
23411
+ React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setVideoEffectsPane })));
22327
23412
  };
22328
23413
  const localPreviewTrampoline = (mobileView, doNotShow) => {
22329
23414
  /* @conditional-compile-remove(rooms) */
@@ -23253,6 +24338,13 @@ class AzureCommunicationCallAdapter {
23253
24338
  this.sendDtmfTone.bind(this);
23254
24339
  /* @conditional-compile-remove(unsupported-browser) */
23255
24340
  this.allowUnsupportedBrowserVersion.bind(this);
24341
+ /* @conditional-compile-remove(close-captions) */
24342
+ {
24343
+ this.startCaptions.bind(this);
24344
+ this.stopCaptions.bind(this);
24345
+ this.setSpokenLanguage.bind(this);
24346
+ this.setCaptionLanguage.bind(this);
24347
+ }
23256
24348
  /* @conditional-compile-remove(video-background-effects) */
23257
24349
  this.blurVideoBackground.bind(this);
23258
24350
  /* @conditional-compile-remove(video-background-effects) */
@@ -23575,6 +24667,30 @@ class AzureCommunicationCallAdapter {
23575
24667
  this.handlers.onSendDtmfTone(dtmfTone);
23576
24668
  });
23577
24669
  }
24670
+ /* @conditional-compile-remove(close-captions) */
24671
+ startCaptions(options) {
24672
+ return __awaiter$4(this, void 0, void 0, function* () {
24673
+ this.handlers.onStartCaptions(options);
24674
+ });
24675
+ }
24676
+ /* @conditional-compile-remove(close-captions) */
24677
+ stopCaptions() {
24678
+ return __awaiter$4(this, void 0, void 0, function* () {
24679
+ this.handlers.onStopCaptions();
24680
+ });
24681
+ }
24682
+ /* @conditional-compile-remove(close-captions) */
24683
+ setCaptionLanguage(language) {
24684
+ return __awaiter$4(this, void 0, void 0, function* () {
24685
+ this.handlers.onSetCaptionLanguage(language);
24686
+ });
24687
+ }
24688
+ /* @conditional-compile-remove(close-captions) */
24689
+ setSpokenLanguage(language) {
24690
+ return __awaiter$4(this, void 0, void 0, function* () {
24691
+ this.handlers.onSetSpokenLanguage(language);
24692
+ });
24693
+ }
23578
24694
  getState() {
23579
24695
  return this.context.getState();
23580
24696
  }
@@ -23588,15 +24704,26 @@ class AzureCommunicationCallAdapter {
23588
24704
  on(event, listener) {
23589
24705
  this.emitter.on(event, listener);
23590
24706
  }
23591
- subscribeCallEvents() {
24707
+ /* @conditional-compile-remove(close-captions) */
24708
+ subscribeToCaptionEvents() {
23592
24709
  var _a, _b, _c, _d;
24710
+ if (((_a = this.call) === null || _a === void 0 ? void 0 : _a.state) === 'Connected') {
24711
+ (_b = this.call) === null || _b === void 0 ? void 0 : _b.feature(communicationCalling.Features.TeamsCaptions).on('captionsReceived', this.captionsReceived.bind(this));
24712
+ (_c = this.call) === null || _c === void 0 ? void 0 : _c.feature(communicationCalling.Features.TeamsCaptions).on('isCaptionsActiveChanged', this.isCaptionsActiveChanged.bind(this));
24713
+ (_d = this.call) === null || _d === void 0 ? void 0 : _d.off('stateChanged', this.subscribeToCaptionEvents.bind(this));
24714
+ }
24715
+ }
24716
+ subscribeCallEvents() {
24717
+ var _a, _b, _c, _d, _e;
23593
24718
  (_a = this.call) === null || _a === void 0 ? void 0 : _a.on('remoteParticipantsUpdated', this.onRemoteParticipantsUpdated.bind(this));
23594
24719
  (_b = this.call) === null || _b === void 0 ? void 0 : _b.on('isMutedChanged', this.isMyMutedChanged.bind(this));
23595
24720
  (_c = this.call) === null || _c === void 0 ? void 0 : _c.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged.bind(this));
23596
24721
  (_d = this.call) === null || _d === void 0 ? void 0 : _d.on('idChanged', this.callIdChanged.bind(this));
24722
+ /* @conditional-compile-remove(close-captions) */
24723
+ (_e = this.call) === null || _e === void 0 ? void 0 : _e.on('stateChanged', this.subscribeToCaptionEvents.bind(this));
23597
24724
  }
23598
24725
  unsubscribeCallEvents() {
23599
- var _a, _b, _c, _d;
24726
+ var _a, _b, _c, _d, _e, _f, _g;
23600
24727
  for (const subscriber of this.participantSubscribers.values()) {
23601
24728
  subscriber.unsubscribeAll();
23602
24729
  }
@@ -23605,6 +24732,12 @@ class AzureCommunicationCallAdapter {
23605
24732
  (_b = this.call) === null || _b === void 0 ? void 0 : _b.off('isMutedChanged', this.isMyMutedChanged.bind(this));
23606
24733
  (_c = this.call) === null || _c === void 0 ? void 0 : _c.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged.bind(this));
23607
24734
  (_d = this.call) === null || _d === void 0 ? void 0 : _d.off('idChanged', this.callIdChanged.bind(this));
24735
+ /* @conditional-compile-remove(close-captions) */
24736
+ (_e = this._call) === null || _e === void 0 ? void 0 : _e.feature(communicationCalling.Features.TeamsCaptions).off('captionsReceived', this.captionsReceived.bind(this));
24737
+ /* @conditional-compile-remove(close-captions) */
24738
+ (_f = this._call) === null || _f === void 0 ? void 0 : _f.feature(communicationCalling.Features.TeamsCaptions).off('isCaptionsActiveChanged', this.isCaptionsActiveChanged.bind(this));
24739
+ /* @conditional-compile-remove(close-captions) */
24740
+ (_g = this.call) === null || _g === void 0 ? void 0 : _g.off('stateChanged', this.subscribeToCaptionEvents.bind(this));
23608
24741
  }
23609
24742
  onRemoteParticipantsUpdated({ added, removed }) {
23610
24743
  if (added && added.length > 0) {
@@ -23626,6 +24759,17 @@ class AzureCommunicationCallAdapter {
23626
24759
  var _a;
23627
24760
  this.emitter.emit('isLocalScreenSharingActiveChanged', { isScreenSharingOn: (_a = this.call) === null || _a === void 0 ? void 0 : _a.isScreenSharingOn });
23628
24761
  }
24762
+ /* @conditional-compile-remove(close-captions) */
24763
+ captionsReceived(captionsInfo) {
24764
+ this.emitter.emit('captionsReceived', { captionsInfo });
24765
+ }
24766
+ /* @conditional-compile-remove(close-captions) */
24767
+ isCaptionsActiveChanged() {
24768
+ var _a;
24769
+ this.emitter.emit('isCaptionsActiveChanged', {
24770
+ isActive: (_a = this.call) === null || _a === void 0 ? void 0 : _a.feature(communicationCalling.Features.TeamsCaptions).isCaptionsFeatureActive
24771
+ });
24772
+ }
23629
24773
  callIdChanged() {
23630
24774
  var _a;
23631
24775
  ((_a = this.call) === null || _a === void 0 ? void 0 : _a.id) && this.emitter.emit('callIdChanged', { callId: this.call.id });
@@ -24090,6 +25234,30 @@ class CallWithChatBackedCallAdapter {
24090
25234
  allowUnsupportedBrowserVersion() {
24091
25235
  return this.callWithChatAdapter.allowUnsupportedBrowserVersion();
24092
25236
  }
25237
+ /* @conditional-compile-remove(close-captions) */
25238
+ startCaptions(options) {
25239
+ return __awaiter$3(this, void 0, void 0, function* () {
25240
+ this.callWithChatAdapter.startCaptions(options);
25241
+ });
25242
+ }
25243
+ /* @conditional-compile-remove(close-captions) */
25244
+ stopCaptions() {
25245
+ return __awaiter$3(this, void 0, void 0, function* () {
25246
+ this.callWithChatAdapter.stopCaptions();
25247
+ });
25248
+ }
25249
+ /* @conditional-compile-remove(close-captions) */
25250
+ setCaptionLanguage(language) {
25251
+ return __awaiter$3(this, void 0, void 0, function* () {
25252
+ this.callWithChatAdapter.setCaptionLanguage(language);
25253
+ });
25254
+ }
25255
+ /* @conditional-compile-remove(close-captions) */
25256
+ setSpokenLanguage(language) {
25257
+ return __awaiter$3(this, void 0, void 0, function* () {
25258
+ this.callWithChatAdapter.setSpokenLanguage(language);
25259
+ });
25260
+ }
24093
25261
  /* @conditional-compile-remove(video-background-effects) */
24094
25262
  blurVideoBackground(backgroundBlurConfig) {
24095
25263
  return __awaiter$3(this, void 0, void 0, function* () {
@@ -24132,7 +25300,9 @@ function callAdapterStateFromCallWithChatAdapterState(callWithChatAdapterState)
24132
25300
  /* @conditional-compile-remove(unsupported-browser) */
24133
25301
  environmentInfo: callWithChatAdapterState.environmentInfo,
24134
25302
  /* @conditional-compile-remove(video-background-effects) */
24135
- videoBackgroundImages: callWithChatAdapterState.videoBackgroundImages
25303
+ videoBackgroundImages: callWithChatAdapterState.videoBackgroundImages,
25304
+ /* @conditional-compile-remove(video-background-effects) */
25305
+ selectedVideoBackgroundEffect: callWithChatAdapterState.selectedVideoBackgroundEffect
24136
25306
  };
24137
25307
  }
24138
25308
 
@@ -24455,6 +25625,8 @@ const CallWithChatScreen = (props) => {
24455
25625
  }), [callWithChatStrings]);
24456
25626
  /* @conditional-compile-remove(PSTN-calls) */
24457
25627
  const alternateCallerId = callAdapter.getState().alternateCallerId;
25628
+ /* @conditional-compile-remove(close-captions) */
25629
+ const isTeamsCall = callAdapter.getState().isTeamsCall;
24458
25630
  const callCompositeOptions = React.useMemo(() => ({
24459
25631
  callControls: false,
24460
25632
  /* @conditional-compile-remove(call-readiness) */
@@ -24483,7 +25655,8 @@ const CallWithChatScreen = (props) => {
24483
25655
  style: callCompositeContainerCSS },
24484
25656
  React__default['default'].createElement(CallComposite, Object.assign({}, props, { formFactor: formFactor, options: callCompositeOptions, adapter: callAdapter, fluentTheme: fluentTheme }))),
24485
25657
  /* @conditional-compile-remove(video-background-effects) */
24486
- React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane, adapter: callAdapter }),
25658
+ React__default['default'].createElement(CallAdapterProvider, { adapter: callAdapter },
25659
+ React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane })),
24487
25660
  chatProps.adapter && callAdapter && hasJoinedCall && (React__default['default'].createElement(CallWithChatPane, { chatCompositeProps: chatProps, inviteLink: props.joinInvitationURL, onClose: closePane, chatAdapter: chatProps.adapter, callAdapter: callAdapter, onFetchAvatarPersonaData: props.onFetchAvatarPersonaData, onFetchParticipantMenuItems: props.onFetchParticipantMenuItems, onChatButtonClicked: showShowChatTabHeaderButton(props.callControls) ? selectChat : undefined, onPeopleButtonClicked: showShowPeopleTabHeaderButton(props.callControls) ? selectPeople : undefined, modalLayerHostId: modalLayerHostId, mobileView: mobileView, activePane: activePane,
24488
25661
  /* @conditional-compile-remove(file-sharing) */
24489
25662
  fileSharing: props.fileSharing, rtl: props.rtl, callControls: typeof props.callControls !== 'boolean' ? props.callControls : undefined }))),
@@ -24494,6 +25667,8 @@ const CallWithChatScreen = (props) => {
24494
25667
  disableButtonsForHoldScreen: isInLocalHold, callControls: props.callControls, containerHeight: containerHeight, containerWidth: containerWidth,
24495
25668
  /* @conditional-compile-remove(PSTN-calls) */
24496
25669
  onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined,
25670
+ /* @conditional-compile-remove(close-captions) */
25671
+ isCaptionsSupported: isTeamsCall && hasJoinedCall,
24497
25672
  /* @conditional-compile-remove(video-background-effects) */
24498
25673
  onShowVideoEffectsPicker: setShowVideoEffectsPane, rtl: props.rtl })))),
24499
25674
  showControlBar && showDrawer && (React__default['default'].createElement(ChatAdapterProvider, { adapter: chatProps.adapter },
@@ -24503,7 +25678,9 @@ const CallWithChatScreen = (props) => {
24503
25678
  /* @conditional-compile-remove(PSTN-calls) */
24504
25679
  onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined,
24505
25680
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
24506
- disableButtonsForHoldScreen: isInLocalHold }))))),
25681
+ disableButtonsForHoldScreen: isInLocalHold,
25682
+ /* @conditional-compile-remove(close-captions) */
25683
+ isCaptionsSupported: isTeamsCall && hasJoinedCall }))))),
24507
25684
  /* @conditional-compile-remove(PSTN-calls) */
24508
25685
  showControlBar && showDtmfDialpad && (React__default['default'].createElement(ChatAdapterProvider, { adapter: chatProps.adapter },
24509
25686
  React__default['default'].createElement(CallAdapterProvider, { adapter: callAdapter },
@@ -24579,7 +25756,9 @@ function callWithChatAdapterStateFromBackingStates(callAdapter, chatAdapter) {
24579
25756
  /* @conditional-compile-remove(unsupported-browser) */
24580
25757
  environmentInfo: callAdapterState.environmentInfo,
24581
25758
  /* @conditional-compile-remove(video-background-effects) */
24582
- videoBackgroundImages: callAdapterState.videoBackgroundImages
25759
+ videoBackgroundImages: callAdapterState.videoBackgroundImages,
25760
+ /* @conditional-compile-remove(video-background-effects) */
25761
+ selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect
24583
25762
  };
24584
25763
  }
24585
25764
  /**
@@ -24596,7 +25775,9 @@ function mergeChatAdapterStateIntoCallWithChatAdapterState(existingCallWithChatA
24596
25775
  function mergeCallAdapterStateIntoCallWithChatAdapterState(existingCallWithChatAdapterState, callAdapterState) {
24597
25776
  return Object.assign(Object.assign({}, existingCallWithChatAdapterState), { userId: callAdapterState.userId, page: callAdapterState.page, displayName: callAdapterState.displayName, devices: callAdapterState.devices, call: callAdapterState.call, isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled, isTeamsCall: callAdapterState.isTeamsCall, latestCallErrors: callAdapterState.latestErrors,
24598
25777
  /* @conditional-compile-remove(video-background-effects) */
24599
- videoBackgroundImages: callAdapterState.videoBackgroundImages });
25778
+ videoBackgroundImages: callAdapterState.videoBackgroundImages,
25779
+ /* @conditional-compile-remove(video-background-effects) */
25780
+ selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect });
24600
25781
  }
24601
25782
 
24602
25783
  // Copyright (c) Microsoft Corporation.
@@ -24780,6 +25961,12 @@ class AzureCommunicationCallWithChatAdapter {
24780
25961
  this.sendDtmfTone.bind(this);
24781
25962
  /* @conditional-compile-remove(unsupported-browser) */
24782
25963
  this.allowUnsupportedBrowserVersion.bind(this);
25964
+ /* @conditional-compile-remove(close-captions) */ {
25965
+ this.startCaptions.bind(this);
25966
+ this.stopCaptions.bind(this);
25967
+ this.setSpokenLanguage.bind(this);
25968
+ this.setCaptionLanguage.bind(this);
25969
+ }
24783
25970
  /* @conditional-compile-remove(video-background-effects) */
24784
25971
  this.blurVideoBackground.bind(this);
24785
25972
  /* @conditional-compile-remove(video-background-effects) */
@@ -25004,6 +26191,30 @@ class AzureCommunicationCallWithChatAdapter {
25004
26191
  allowUnsupportedBrowserVersion() {
25005
26192
  return this.callAdapter.allowUnsupportedBrowserVersion();
25006
26193
  }
26194
+ /* @conditional-compile-remove(close-captions) */
26195
+ startCaptions(options) {
26196
+ return __awaiter(this, void 0, void 0, function* () {
26197
+ yield this.callAdapter.startCaptions(options);
26198
+ });
26199
+ }
26200
+ /* @conditional-compile-remove(close-captions) */
26201
+ stopCaptions() {
26202
+ return __awaiter(this, void 0, void 0, function* () {
26203
+ yield this.callAdapter.stopCaptions();
26204
+ });
26205
+ }
26206
+ /* @conditional-compile-remove(close-captions) */
26207
+ setCaptionLanguage(language) {
26208
+ return __awaiter(this, void 0, void 0, function* () {
26209
+ yield this.callAdapter.setCaptionLanguage(language);
26210
+ });
26211
+ }
26212
+ /* @conditional-compile-remove(close-captions) */
26213
+ setSpokenLanguage(language) {
26214
+ return __awaiter(this, void 0, void 0, function* () {
26215
+ yield this.callAdapter.setSpokenLanguage(language);
26216
+ });
26217
+ }
25007
26218
  /* @conditional-compile-remove(video-background-effects) */
25008
26219
  blurVideoBackground(backgroundBlurConfig) {
25009
26220
  return __awaiter(this, void 0, void 0, function* () {
@@ -25063,6 +26274,14 @@ class AzureCommunicationCallWithChatAdapter {
25063
26274
  case 'selectedSpeakerChanged':
25064
26275
  this.callAdapter.on('selectedSpeakerChanged', listener);
25065
26276
  break;
26277
+ /* @conditional-compile-remove(close-captions) */
26278
+ case 'captionsReceived':
26279
+ this.callAdapter.on('captionsReceived', listener);
26280
+ break;
26281
+ /* @conditional-compile-remove(close-captions) */
26282
+ case 'isCaptionsActiveChanged':
26283
+ this.callAdapter.on('isCaptionsActiveChanged', listener);
26284
+ break;
25066
26285
  case 'messageReceived':
25067
26286
  this.chatAdapter.on('messageReceived', listener);
25068
26287
  break;
@@ -25121,6 +26340,14 @@ class AzureCommunicationCallWithChatAdapter {
25121
26340
  case 'selectedSpeakerChanged':
25122
26341
  this.callAdapter.off('selectedSpeakerChanged', listener);
25123
26342
  break;
26343
+ /* @conditional-compile-remove(close-captions) */
26344
+ case 'captionsReceived':
26345
+ this.callAdapter.off('captionsReceived', listener);
26346
+ break;
26347
+ /* @conditional-compile-remove(close-captions) */
26348
+ case 'isCaptionsActiveChanged':
26349
+ this.callAdapter.off('isCaptionsActiveChanged', listener);
26350
+ break;
25124
26351
  case 'messageReceived':
25125
26352
  this.chatAdapter.off('messageReceived', listener);
25126
26353
  break;