@azure/communication-react 1.5.1-alpha-202303250012 → 1.5.1-alpha-202303260014

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.
@@ -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-202303250012';
165
+ var telemetryVersion = '1.5.1-alpha-202303260014';
166
166
 
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  /**
@@ -378,7 +378,7 @@ const getEnvironmentInfo = (state) => {
378
378
 
379
379
  // Copyright (c) Microsoft Corporation.
380
380
  // Licensed under the MIT license.
381
- var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
381
+ var __awaiter$F = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
382
382
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
383
383
  return new (P || (P = Promise))(function (resolve, reject) {
384
384
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -416,7 +416,7 @@ const _isPreviewOn = (deviceManager) => {
416
416
  *
417
417
  * @private
418
418
  */
419
- const disposeAllLocalPreviewViews = (callClient) => __awaiter$E(void 0, void 0, void 0, function* () {
419
+ const disposeAllLocalPreviewViews = (callClient) => __awaiter$F(void 0, void 0, void 0, function* () {
420
420
  const unparentedViews = callClient.getState().deviceManager.unparentedViews;
421
421
  for (const view of unparentedViews) {
422
422
  yield callClient.disposeView(undefined, undefined, view);
@@ -549,7 +549,7 @@ const holdButtonSelector = reselect__namespace.createSelector([getCallState], (c
549
549
 
550
550
  // Copyright (c) Microsoft Corporation.
551
551
  // Licensed under the MIT license.
552
- var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
552
+ var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
553
553
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
554
554
  return new (P || (P = Promise))(function (resolve, reject) {
555
555
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -570,7 +570,7 @@ const areStreamsEqual = (prevStream, newStream) => {
570
570
  * @private
571
571
  */
572
572
  const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callClient, deviceManager, call) => {
573
- const onStartLocalVideo = () => __awaiter$D(void 0, void 0, void 0, function* () {
573
+ const onStartLocalVideo = () => __awaiter$E(void 0, void 0, void 0, function* () {
574
574
  // Before the call object creates a stream, dispose of any local preview streams.
575
575
  // @TODO: is there any way to parent the unparented view to the call object instead
576
576
  // of disposing and creating a new stream?
@@ -590,7 +590,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
590
590
  yield call.startVideo(stream);
591
591
  }
592
592
  });
593
- const onStopLocalVideo = (stream) => __awaiter$D(void 0, void 0, void 0, function* () {
593
+ const onStopLocalVideo = (stream) => __awaiter$E(void 0, void 0, void 0, function* () {
594
594
  const callId = call === null || call === void 0 ? void 0 : call.id;
595
595
  if (!callId) {
596
596
  return;
@@ -599,7 +599,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
599
599
  yield call.stopVideo(stream);
600
600
  }
601
601
  });
602
- const onToggleCamera = (options) => __awaiter$D(void 0, void 0, void 0, function* () {
602
+ const onToggleCamera = (options) => __awaiter$E(void 0, void 0, void 0, function* () {
603
603
  const previewOn = _isPreviewOn(callClient.getState().deviceManager);
604
604
  if (previewOn && call && call.state === 'Connecting') {
605
605
  // This is to workaround: https://skype.visualstudio.com/SPOOL/_workitems/edit/3030558.
@@ -647,19 +647,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
647
647
  }
648
648
  }
649
649
  });
650
- const onSelectMicrophone = (device) => __awaiter$D(void 0, void 0, void 0, function* () {
650
+ const onSelectMicrophone = (device) => __awaiter$E(void 0, void 0, void 0, function* () {
651
651
  if (!deviceManager) {
652
652
  return;
653
653
  }
654
654
  return deviceManager.selectMicrophone(device);
655
655
  });
656
- const onSelectSpeaker = (device) => __awaiter$D(void 0, void 0, void 0, function* () {
656
+ const onSelectSpeaker = (device) => __awaiter$E(void 0, void 0, void 0, function* () {
657
657
  if (!deviceManager) {
658
658
  return;
659
659
  }
660
660
  return deviceManager.selectSpeaker(device);
661
661
  });
662
- const onSelectCamera = (device, options) => __awaiter$D(void 0, void 0, void 0, function* () {
662
+ const onSelectCamera = (device, options) => __awaiter$E(void 0, void 0, void 0, function* () {
663
663
  if (!deviceManager) {
664
664
  return;
665
665
  }
@@ -682,19 +682,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
682
682
  }, options);
683
683
  }
684
684
  });
685
- const onToggleMicrophone = () => __awaiter$D(void 0, void 0, void 0, function* () {
685
+ const onToggleMicrophone = () => __awaiter$E(void 0, void 0, void 0, function* () {
686
686
  if (!call || !_isInCall(call.state)) {
687
687
  throw new Error(`Please invoke onToggleMicrophone after call is started`);
688
688
  }
689
689
  return call.isMuted ? yield call.unmute() : yield call.mute();
690
690
  });
691
- const onStartScreenShare = () => __awaiter$D(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
692
- const onStopScreenShare = () => __awaiter$D(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
693
- const onToggleScreenShare = () => __awaiter$D(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
694
- const onHangUp = (forEveryone) => __awaiter$D(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
691
+ const onStartScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
692
+ const onStopScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
693
+ 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(); });
694
+ 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 })); });
695
695
  /* @conditional-compile-remove(PSTN-calls) */
696
- const onToggleHold = () => __awaiter$D(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()); });
697
- const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$D(void 0, void 0, void 0, function* () {
696
+ 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()); });
697
+ const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$E(void 0, void 0, void 0, function* () {
698
698
  var _a;
699
699
  if (!call || call.localVideoStreams.length === 0) {
700
700
  return;
@@ -710,7 +710,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
710
710
  const { view } = (_a = (yield callClient.createView(call.id, undefined, localStream, options))) !== null && _a !== void 0 ? _a : {};
711
711
  return view ? { view } : undefined;
712
712
  });
713
- const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$D(void 0, void 0, void 0, function* () {
713
+ const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$E(void 0, void 0, void 0, function* () {
714
714
  if (!call) {
715
715
  return;
716
716
  }
@@ -741,7 +741,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
741
741
  }
742
742
  return (createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view) ? { view: createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view } : undefined;
743
743
  });
744
- const onDisposeRemoteStreamView = (userId) => __awaiter$D(void 0, void 0, void 0, function* () {
744
+ const onDisposeRemoteStreamView = (userId) => __awaiter$E(void 0, void 0, void 0, function* () {
745
745
  if (!call) {
746
746
  return;
747
747
  }
@@ -762,7 +762,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
762
762
  callClient.disposeView(call.id, participant.identifier, screenShareStream);
763
763
  }
764
764
  });
765
- const onDisposeLocalStreamView = () => __awaiter$D(void 0, void 0, void 0, function* () {
765
+ const onDisposeLocalStreamView = () => __awaiter$E(void 0, void 0, void 0, function* () {
766
766
  // If the user is currently in a call, dispose of the local stream view attached to that call.
767
767
  const callState = call && callClient.getState().calls[call.id];
768
768
  const localStream = callState === null || callState === void 0 ? void 0 : callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');
@@ -775,18 +775,18 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
775
775
  yield disposeAllLocalPreviewViews(callClient);
776
776
  });
777
777
  /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
778
- const onSendDtmfTone = (dtmfTone) => __awaiter$D(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
778
+ const onSendDtmfTone = (dtmfTone) => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
779
779
  const notImplemented = () => {
780
780
  throw new Error('Not implemented, cannot call a method from an abstract object');
781
781
  };
782
782
  /* @conditional-compile-remove(call-readiness) */
783
- const askDevicePermission = (constrain) => __awaiter$D(void 0, void 0, void 0, function* () {
783
+ const askDevicePermission = (constrain) => __awaiter$E(void 0, void 0, void 0, function* () {
784
784
  if (deviceManager) {
785
785
  yield (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.askDevicePermission(constrain));
786
786
  }
787
787
  });
788
788
  /* @conditional-compile-remove(video-background-effects) */
789
- const onRemoveVideoBackgroundEffects = () => __awaiter$D(void 0, void 0, void 0, function* () {
789
+ const onRemoveVideoBackgroundEffects = () => __awaiter$E(void 0, void 0, void 0, function* () {
790
790
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
791
791
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
792
792
  if (stream) {
@@ -794,7 +794,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
794
794
  }
795
795
  });
796
796
  /* @conditional-compile-remove(video-background-effects) */
797
- const onBlurVideoBackground = (bgBlurConfig) => __awaiter$D(void 0, void 0, void 0, function* () {
797
+ const onBlurVideoBackground = (bgBlurConfig) => __awaiter$E(void 0, void 0, void 0, function* () {
798
798
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
799
799
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
800
800
  if (stream) {
@@ -802,7 +802,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
802
802
  }
803
803
  });
804
804
  /* @conditional-compile-remove(video-background-effects) */
805
- const onReplaceVideoBackground = (bgReplacementConfig) => __awaiter$D(void 0, void 0, void 0, function* () {
805
+ const onReplaceVideoBackground = (bgReplacementConfig) => __awaiter$E(void 0, void 0, void 0, function* () {
806
806
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
807
807
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
808
808
  if (stream) {
@@ -844,7 +844,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
844
844
 
845
845
  // Copyright (c) Microsoft Corporation.
846
846
  // Licensed under the MIT license.
847
- var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
847
+ var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
848
848
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
849
849
  return new (P || (P = Promise))(function (resolve, reject) {
850
850
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -871,7 +871,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
871
871
  return callAgent ? callAgent.startCall(participants, options) : undefined;
872
872
  },
873
873
  /* @conditional-compile-remove(PSTN-calls) */
874
- onAddParticipant: (userId, options) => __awaiter$C(void 0, void 0, void 0, function* () {
874
+ onAddParticipant: (userId, options) => __awaiter$D(void 0, void 0, void 0, function* () {
875
875
  const participant = _toCommunicationIdentifier(userId);
876
876
  if (communicationCommon.isPhoneNumberIdentifier(participant)) {
877
877
  call === null || call === void 0 ? void 0 : call.addParticipant(participant, options);
@@ -879,7 +879,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
879
879
  else if (communicationCommon.isCommunicationUserIdentifier(participant) || communicationCommon.isMicrosoftTeamsUserIdentifier(participant)) {
880
880
  call === null || call === void 0 ? void 0 : call.addParticipant(participant);
881
881
  }
882
- }), onRemoveParticipant: (userId) => __awaiter$C(void 0, void 0, void 0, function* () {
882
+ }), onRemoveParticipant: (userId) => __awaiter$D(void 0, void 0, void 0, function* () {
883
883
  const participant = _toCommunicationIdentifier(userId);
884
884
  yield (call === null || call === void 0 ? void 0 : call.removeParticipant(participant));
885
885
  }) });
@@ -887,7 +887,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
887
887
 
888
888
  // Copyright (c) Microsoft Corporation.
889
889
  // Licensed under the MIT license.
890
- var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
890
+ var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
891
891
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
892
892
  return new (P || (P = Promise))(function (resolve, reject) {
893
893
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -919,7 +919,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
919
919
  },
920
920
  /* @conditional-compile-remove(teams-identity-support) */
921
921
  /* @conditional-compile-remove(PSTN-calls) */
922
- onAddParticipant: (userId, options) => __awaiter$B(void 0, void 0, void 0, function* () {
922
+ onAddParticipant: (userId, options) => __awaiter$C(void 0, void 0, void 0, function* () {
923
923
  const participant = _toCommunicationIdentifier(userId);
924
924
  /* @conditional-compile-remove(teams-identity-support) */
925
925
  const threadId = options === null || options === void 0 ? void 0 : options.threadId;
@@ -932,7 +932,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
932
932
  }
933
933
  /* @conditional-compile-remove(teams-identity-support) */
934
934
  call === null || call === void 0 ? void 0 : call.addParticipant(participant);
935
- }), onRemoveParticipant: (userId) => __awaiter$B(void 0, void 0, void 0, function* () {
935
+ }), onRemoveParticipant: (userId) => __awaiter$C(void 0, void 0, void 0, function* () {
936
936
  const participant = _toCommunicationIdentifier(userId);
937
937
  if (communicationCommon.isCommunicationUserIdentifier(participant)) {
938
938
  throw new Error('CommunicationIdentifier in Teams call is not supported!');
@@ -944,7 +944,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
944
944
 
945
945
  // Copyright (c) Microsoft Corporation.
946
946
  // Licensed under the MIT license.
947
- var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
947
+ var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
948
948
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
949
949
  return new (P || (P = Promise))(function (resolve, reject) {
950
950
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -993,13 +993,13 @@ class ProxyDeviceManager {
993
993
  this.selectCamera = (videoDeviceInfo) => {
994
994
  this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);
995
995
  };
996
- this.videoDevicesUpdated = () => __awaiter$A(this, void 0, void 0, function* () {
996
+ this.videoDevicesUpdated = () => __awaiter$B(this, void 0, void 0, function* () {
997
997
  // Device Manager always has a camera with '' name if there are no real camera devices available.
998
998
  // We don't want to show that in the UI.
999
999
  const realCameras = (yield this._deviceManager.getCameras()).filter((c) => !!c.name);
1000
1000
  this._context.setDeviceManagerCameras(dedupeById(realCameras));
1001
1001
  });
1002
- this.audioDevicesUpdated = () => __awaiter$A(this, void 0, void 0, function* () {
1002
+ this.audioDevicesUpdated = () => __awaiter$B(this, void 0, void 0, function* () {
1003
1003
  this._context.setDeviceManagerMicrophones(dedupeById(yield this._deviceManager.getMicrophones()));
1004
1004
  this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));
1005
1005
  });
@@ -1202,7 +1202,7 @@ class CallIdHistory {
1202
1202
 
1203
1203
  // Copyright (c) Microsoft Corporation.
1204
1204
  // Licensed under the MIT license.
1205
- var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1205
+ var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1206
1206
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1207
1207
  return new (P || (P = Promise))(function (resolve, reject) {
1208
1208
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1786,7 +1786,7 @@ class CallContext$2 {
1786
1786
  * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
1787
1787
  */
1788
1788
  withAsyncErrorTeedToState(action, target) {
1789
- return (...args) => __awaiter$z(this, void 0, void 0, function* () {
1789
+ return (...args) => __awaiter$A(this, void 0, void 0, function* () {
1790
1790
  try {
1791
1791
  return yield action(...args);
1792
1792
  }
@@ -2313,7 +2313,7 @@ function _logStreamEvent(eventName, streamLogInfo, error) {
2313
2313
 
2314
2314
  // Copyright (c) Microsoft Corporation.
2315
2315
  // Licensed under the MIT license.
2316
- var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2316
+ var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2317
2317
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2318
2318
  return new (P || (P = Promise))(function (resolve, reject) {
2319
2319
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -2323,7 +2323,7 @@ var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments,
2323
2323
  });
2324
2324
  };
2325
2325
  function createViewVideo(context, internalContext, callId, stream, participantId, options) {
2326
- return __awaiter$y(this, void 0, void 0, function* () {
2326
+ return __awaiter$z(this, void 0, void 0, function* () {
2327
2327
  // we can only have 3 types of createView
2328
2328
  let streamEventType;
2329
2329
  // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.
@@ -2445,7 +2445,7 @@ function createViewVideo(context, internalContext, callId, stream, participantId
2445
2445
  });
2446
2446
  }
2447
2447
  function createViewUnparentedVideo(context, internalContext, stream, options) {
2448
- return __awaiter$y(this, void 0, void 0, function* () {
2448
+ return __awaiter$z(this, void 0, void 0, function* () {
2449
2449
  const renderInfo = internalContext.getUnparentedRenderInfo(stream);
2450
2450
  if (renderInfo && renderInfo.status === 'Rendered') {
2451
2451
  console.warn('Unparented LocalVideoStream is already rendered');
@@ -2613,7 +2613,7 @@ function createView(context, internalContext, callId, participantId, stream, opt
2613
2613
  // Render LocalVideoStream that is not part of a Call
2614
2614
  // 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).
2615
2615
  // We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.
2616
- return context.withAsyncErrorTeedToState(() => __awaiter$y(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
2616
+ return context.withAsyncErrorTeedToState(() => __awaiter$z(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
2617
2617
  }
2618
2618
  else {
2619
2619
  _logStreamEvent(EventNames.CREATE_STREAM_INVALID_PARAMS, { streamType });
@@ -3047,7 +3047,7 @@ class CallSubscriber {
3047
3047
 
3048
3048
  // Copyright (c) Microsoft Corporation.
3049
3049
  // Licensed under the MIT license.
3050
- var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3050
+ var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3051
3051
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3052
3052
  return new (P || (P = Promise))(function (resolve, reject) {
3053
3053
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3067,14 +3067,14 @@ class ProxyIncomingCall {
3067
3067
  switch (prop) {
3068
3068
  case 'accept': {
3069
3069
  return this._context.withAsyncErrorTeedToState(function (...args) {
3070
- return __awaiter$x(this, void 0, void 0, function* () {
3070
+ return __awaiter$y(this, void 0, void 0, function* () {
3071
3071
  return yield target.accept(...args);
3072
3072
  });
3073
3073
  }, 'IncomingCall.accept');
3074
3074
  }
3075
3075
  case 'reject': {
3076
3076
  return this._context.withAsyncErrorTeedToState(function (...args) {
3077
- return __awaiter$x(this, void 0, void 0, function* () {
3077
+ return __awaiter$y(this, void 0, void 0, function* () {
3078
3078
  return yield target.reject(...args);
3079
3079
  });
3080
3080
  }, 'IncomingCall.reject');
@@ -3311,7 +3311,7 @@ const clearCallRelatedState = (context, internalContext) => {
3311
3311
 
3312
3312
  // Copyright (c) Microsoft Corporation.
3313
3313
  // Licensed under the MIT license.
3314
- var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3314
+ var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3315
3315
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3316
3316
  return new (P || (P = Promise))(function (resolve, reject) {
3317
3317
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3337,56 +3337,56 @@ class ProxyCallCommon {
3337
3337
  switch (prop) {
3338
3338
  case 'mute': {
3339
3339
  return this._context.withAsyncErrorTeedToState(function (...args) {
3340
- return __awaiter$w(this, void 0, void 0, function* () {
3340
+ return __awaiter$x(this, void 0, void 0, function* () {
3341
3341
  return yield target.mute(...args);
3342
3342
  });
3343
3343
  }, 'Call.mute');
3344
3344
  }
3345
3345
  case 'unmute': {
3346
3346
  return this._context.withAsyncErrorTeedToState(function (...args) {
3347
- return __awaiter$w(this, void 0, void 0, function* () {
3347
+ return __awaiter$x(this, void 0, void 0, function* () {
3348
3348
  return yield target.unmute(...args);
3349
3349
  });
3350
3350
  }, 'Call.unmute');
3351
3351
  }
3352
3352
  case 'startVideo': {
3353
3353
  return this._context.withAsyncErrorTeedToState(function (...args) {
3354
- return __awaiter$w(this, void 0, void 0, function* () {
3354
+ return __awaiter$x(this, void 0, void 0, function* () {
3355
3355
  return yield target.startVideo(...args);
3356
3356
  });
3357
3357
  }, 'Call.startVideo');
3358
3358
  }
3359
3359
  case 'stopVideo': {
3360
3360
  return this._context.withAsyncErrorTeedToState(function (...args) {
3361
- return __awaiter$w(this, void 0, void 0, function* () {
3361
+ return __awaiter$x(this, void 0, void 0, function* () {
3362
3362
  return yield target.stopVideo(...args);
3363
3363
  });
3364
3364
  }, 'Call.stopVideo');
3365
3365
  }
3366
3366
  case 'startScreenSharing': {
3367
3367
  return this._context.withAsyncErrorTeedToState(function (...args) {
3368
- return __awaiter$w(this, void 0, void 0, function* () {
3368
+ return __awaiter$x(this, void 0, void 0, function* () {
3369
3369
  return yield target.startScreenSharing(...args);
3370
3370
  });
3371
3371
  }, 'Call.startScreenSharing');
3372
3372
  }
3373
3373
  case 'stopScreenSharing': {
3374
3374
  return this._context.withAsyncErrorTeedToState(function (...args) {
3375
- return __awaiter$w(this, void 0, void 0, function* () {
3375
+ return __awaiter$x(this, void 0, void 0, function* () {
3376
3376
  return yield target.stopScreenSharing(...args);
3377
3377
  });
3378
3378
  }, 'Call.stopScreenSharing');
3379
3379
  }
3380
3380
  case 'hold': {
3381
3381
  return this._context.withAsyncErrorTeedToState(function (...args) {
3382
- return __awaiter$w(this, void 0, void 0, function* () {
3382
+ return __awaiter$x(this, void 0, void 0, function* () {
3383
3383
  return yield target.hold(...args);
3384
3384
  });
3385
3385
  }, 'Call.hold');
3386
3386
  }
3387
3387
  case 'resume': {
3388
3388
  return this._context.withAsyncErrorTeedToState(function (...args) {
3389
- return __awaiter$w(this, void 0, void 0, function* () {
3389
+ return __awaiter$x(this, void 0, void 0, function* () {
3390
3390
  return yield target.resume(...args);
3391
3391
  });
3392
3392
  }, 'Call.resume');
@@ -3399,7 +3399,7 @@ class ProxyCallCommon {
3399
3399
 
3400
3400
  // Copyright (c) Microsoft Corporation.
3401
3401
  // Licensed under the MIT license.
3402
- var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3402
+ var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3403
3403
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3404
3404
  return new (P || (P = Promise))(function (resolve, reject) {
3405
3405
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3413,7 +3413,7 @@ class ProxyCall extends ProxyCallCommon {
3413
3413
  switch (prop) {
3414
3414
  case 'addParticipant': {
3415
3415
  return this.getContext().withAsyncErrorTeedToState(function (...args) {
3416
- return __awaiter$v(this, void 0, void 0, function* () {
3416
+ return __awaiter$w(this, void 0, void 0, function* () {
3417
3417
  return yield target.addParticipant(...args);
3418
3418
  });
3419
3419
  }, 'Call.addParticipant');
@@ -3634,7 +3634,7 @@ class InternalCallContext {
3634
3634
 
3635
3635
  // Copyright (c) Microsoft Corporation.
3636
3636
  // Licensed under the MIT license.
3637
- var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3637
+ var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3638
3638
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3639
3639
  return new (P || (P = Promise))(function (resolve, reject) {
3640
3640
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3649,7 +3649,7 @@ class ProxyTeamsCall extends ProxyCallCommon {
3649
3649
  switch (prop) {
3650
3650
  case 'addParticipant': {
3651
3651
  return this.getContext().withAsyncErrorTeedToState(function (...args) {
3652
- return __awaiter$u(this, void 0, void 0, function* () {
3652
+ return __awaiter$v(this, void 0, void 0, function* () {
3653
3653
  return yield target.addParticipant(...args);
3654
3654
  });
3655
3655
  }, 'TeamsCall.addParticipant');
@@ -3764,7 +3764,7 @@ const teamsCallAgentDeclaratify = (callAgent, context, internalContext) => {
3764
3764
 
3765
3765
  // Copyright (c) Microsoft Corporation.
3766
3766
  // Licensed under the MIT license.
3767
- var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3767
+ var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3768
3768
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3769
3769
  return new (P || (P = Promise))(function (resolve, reject) {
3770
3770
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3786,7 +3786,7 @@ class ProxyVideoStreamRendererView {
3786
3786
  get(target, prop) {
3787
3787
  switch (prop) {
3788
3788
  case 'updateScalingMode': {
3789
- return (...args) => __awaiter$t(this, void 0, void 0, function* () {
3789
+ return (...args) => __awaiter$u(this, void 0, void 0, function* () {
3790
3790
  yield target.updateScalingMode(...args);
3791
3791
  this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);
3792
3792
  });
@@ -3807,7 +3807,7 @@ const videoStreamRendererViewDeclaratify = (view, context, callId, participantId
3807
3807
 
3808
3808
  // Copyright (c) Microsoft Corporation.
3809
3809
  // Licensed under the MIT license.
3810
- var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3810
+ var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3811
3811
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3812
3812
  return new (P || (P = Promise))(function (resolve, reject) {
3813
3813
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3829,7 +3829,7 @@ class ProxyCallClient {
3829
3829
  get(target, prop) {
3830
3830
  switch (prop) {
3831
3831
  case 'createCallAgent': {
3832
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$s(this, void 0, void 0, function* () {
3832
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$t(this, void 0, void 0, function* () {
3833
3833
  // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
3834
3834
  // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
3835
3835
  // callAgent if the createCallAgent succeeds.
@@ -3842,7 +3842,7 @@ class ProxyCallClient {
3842
3842
  }), 'CallClient.createCallAgent');
3843
3843
  }
3844
3844
  case 'createTeamsCallAgent': {
3845
- /* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$s(this, void 0, void 0, function* () {
3845
+ /* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$t(this, void 0, void 0, function* () {
3846
3846
  // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
3847
3847
  // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
3848
3848
  // callAgent if the createCallAgent succeeds.
@@ -3855,7 +3855,7 @@ class ProxyCallClient {
3855
3855
  }), 'CallClient.createTeamsCallAgent');
3856
3856
  }
3857
3857
  case 'getDeviceManager': {
3858
- return this._context.withAsyncErrorTeedToState(() => __awaiter$s(this, void 0, void 0, function* () {
3858
+ return this._context.withAsyncErrorTeedToState(() => __awaiter$t(this, void 0, void 0, function* () {
3859
3859
  // As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of
3860
3860
  // DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll
3861
3861
  // throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.
@@ -3884,7 +3884,7 @@ class ProxyCallClient {
3884
3884
  /**
3885
3885
  * add to this object if we want to proxy anything else off the DebugInfo feature object.
3886
3886
  */
3887
- return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$s(this, void 0, void 0, function* () {
3887
+ return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$t(this, void 0, void 0, function* () {
3888
3888
  const environmentInfo = yield feature.getEnvironmentInfo();
3889
3889
  this._context.setEnvironmentInfo(environmentInfo);
3890
3890
  return environmentInfo;
@@ -3937,7 +3937,7 @@ const createStatefulCallClientWithDeps = (callClient, context, internalContext)
3937
3937
  });
3938
3938
  Object.defineProperty(callClient, 'createView', {
3939
3939
  configurable: false,
3940
- value: (callId, participantId, stream, options) => __awaiter$s(void 0, void 0, void 0, function* () {
3940
+ value: (callId, participantId, stream, options) => __awaiter$t(void 0, void 0, void 0, function* () {
3941
3941
  const participantIdKind = participantId ? communicationCommon.getIdentifierKind(participantId) : undefined;
3942
3942
  const result = yield createView(context, internalContext, callId, participantIdKind, stream, options);
3943
3943
  // We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.
@@ -6770,7 +6770,7 @@ const chatMessageActionMenuProps = (menuProps) => {
6770
6770
  return actionMenuProps;
6771
6771
  };
6772
6772
 
6773
- var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6773
+ var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6774
6774
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6775
6775
  return new (P || (P = Promise))(function (resolve, reject) {
6776
6776
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -6795,7 +6795,7 @@ const _FileDownloadCards = (props) => {
6795
6795
  var _a, _b;
6796
6796
  return (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile) !== null && _b !== void 0 ? _b : localeStrings.downloadFile;
6797
6797
  }, [(_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile, localeStrings.downloadFile]);
6798
- const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$r(void 0, void 0, void 0, function* () {
6798
+ const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$s(void 0, void 0, void 0, function* () {
6799
6799
  if (!props.downloadHandler) {
6800
6800
  window.open(file.url, '_blank', 'noopener,noreferrer');
6801
6801
  }
@@ -6943,7 +6943,7 @@ const ChatMessageComponentAsMessageBubble = React__default['default'].memo(Messa
6943
6943
 
6944
6944
  // Copyright (c) Microsoft Corporation.
6945
6945
  // Licensed under the MIT license.
6946
- var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6946
+ var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6947
6947
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6948
6948
  return new (P || (P = Promise))(function (resolve, reject) {
6949
6949
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -6977,7 +6977,7 @@ const ChatMessageComponent = (props) => {
6977
6977
  return React__default['default'].createElement(React__default['default'].Fragment, null);
6978
6978
  }
6979
6979
  else if (isEditing) {
6980
- return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$q(void 0, void 0, void 0, function* () {
6980
+ 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* () {
6981
6981
  props.onUpdateMessage &&
6982
6982
  props.message.messageId &&
6983
6983
  (yield props.onUpdateMessage(props.message.messageId, text, metadata, options));
@@ -7083,7 +7083,7 @@ const getParticipantsWhoHaveReadMessage = (message, readReceiptsBySenderId) => {
7083
7083
 
7084
7084
  // Copyright (c) Microsoft Corporation.
7085
7085
  // Licensed under the MIT license.
7086
- var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7086
+ var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7087
7087
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7088
7088
  return new (P || (P = Promise))(function (resolve, reject) {
7089
7089
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -7318,7 +7318,7 @@ const MessageThread = (props) => {
7318
7318
  setChatMessagesInitialized(chatMessagesInitialized);
7319
7319
  };
7320
7320
  // we try to only send those message status if user is scrolled to the bottom.
7321
- const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
7321
+ const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
7322
7322
  if (!isAtBottomOfScrollRef.current ||
7323
7323
  !document.hasFocus() ||
7324
7324
  !messagesRef.current ||
@@ -7369,7 +7369,7 @@ const MessageThread = (props) => {
7369
7369
  setIsAtBottomOfScrollRef(atBottom);
7370
7370
  }, [scrollToBottom, sendMessageStatusIfAtBottom]);
7371
7371
  // Infinite scrolling + threadInitialize function
7372
- const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
7372
+ const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
7373
7373
  if (!isLoadingChatMessagesRef.current) {
7374
7374
  if (onLoadPreviousChatMessages) {
7375
7375
  isLoadingChatMessagesRef.current = true;
@@ -11689,7 +11689,7 @@ const DevicesButton = (props) => {
11689
11689
 
11690
11690
  // Copyright (c) Microsoft Corporation.
11691
11691
  // Licensed under the MIT license.
11692
- var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11692
+ var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11693
11693
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11694
11694
  return new (P || (P = Promise))(function (resolve, reject) {
11695
11695
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -11727,7 +11727,7 @@ const CameraButton = (props) => {
11727
11727
  const toggleAnnouncerString = React.useCallback((isCameraOn) => {
11728
11728
  setAnnouncerString(!isCameraOn ? strings.cameraActionTurnedOffAnnouncement : strings.cameraActionTurnedOnAnnouncement);
11729
11729
  }, [strings.cameraActionTurnedOffAnnouncement, strings.cameraActionTurnedOnAnnouncement]);
11730
- const onToggleClick = React.useCallback(() => __awaiter$o(void 0, void 0, void 0, function* () {
11730
+ const onToggleClick = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
11731
11731
  // Throttle click on camera, need to await onToggleCamera then allow another click
11732
11732
  if (onToggleCamera) {
11733
11733
  setWaitForCamera(true);
@@ -11892,7 +11892,7 @@ const lightThemeCallButtonStyles = {
11892
11892
 
11893
11893
  // Copyright (c) Microsoft Corporation.
11894
11894
  // Licensed under the MIT license.
11895
- var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11895
+ var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11896
11896
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11897
11897
  return new (P || (P = Promise))(function (resolve, reject) {
11898
11898
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -11933,7 +11933,7 @@ const MicrophoneButton = (props) => {
11933
11933
  const toggleAnnouncerString = React.useCallback((isMicOn) => {
11934
11934
  setAnnouncerString(!isMicOn ? strings.microphoneActionTurnedOffAnnouncement : strings.microphoneActionTurnedOnAnnouncement);
11935
11935
  }, [strings.microphoneActionTurnedOffAnnouncement, strings.microphoneActionTurnedOnAnnouncement]);
11936
- const onToggleClick = React.useCallback(() => __awaiter$n(void 0, void 0, void 0, function* () {
11936
+ const onToggleClick = React.useCallback(() => __awaiter$o(void 0, void 0, void 0, function* () {
11937
11937
  if (onToggleMicrophone) {
11938
11938
  try {
11939
11939
  yield onToggleMicrophone();
@@ -12821,7 +12821,7 @@ const formatPhoneNumber = (phoneNumber) => {
12821
12821
 
12822
12822
  // Copyright (c) Microsoft Corporation.
12823
12823
  // Licensed under the MIT license.
12824
- var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12824
+ var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12825
12825
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12826
12826
  return new (P || (P = Promise))(function (resolve, reject) {
12827
12827
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -12863,10 +12863,10 @@ const DialpadButton = (props) => {
12863
12863
  const theme = react.useTheme();
12864
12864
  const { digit, index, onClick, onLongPress, isMobile = false } = props;
12865
12865
  const useLongPressProps = React__default['default'].useMemo(() => ({
12866
- onClick: () => __awaiter$m(void 0, void 0, void 0, function* () {
12866
+ onClick: () => __awaiter$n(void 0, void 0, void 0, function* () {
12867
12867
  onClick(digit, index);
12868
12868
  }),
12869
- onLongPress: () => __awaiter$m(void 0, void 0, void 0, function* () {
12869
+ onLongPress: () => __awaiter$n(void 0, void 0, void 0, function* () {
12870
12870
  onLongPress(digit, index);
12871
12871
  }),
12872
12872
  touchEventsOnly: isMobile
@@ -13791,7 +13791,7 @@ const findConditionalCompiledSelector = (component) => {
13791
13791
 
13792
13792
  // Copyright (c) Microsoft Corporation.
13793
13793
  // Licensed under the MIT license.
13794
- var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
13794
+ var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
13795
13795
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13796
13796
  return new (P || (P = Promise))(function (resolve, reject) {
13797
13797
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -13814,35 +13814,35 @@ const createDefaultChatHandlers = memoizeOne__default['default']((chatClient, ch
13814
13814
  let messageIterator = undefined;
13815
13815
  let readReceiptIterator = undefined;
13816
13816
  return {
13817
- onSendMessage: (content, options) => __awaiter$l(void 0, void 0, void 0, function* () {
13817
+ onSendMessage: (content, options) => __awaiter$m(void 0, void 0, void 0, function* () {
13818
13818
  const sendMessageRequest = {
13819
13819
  content,
13820
13820
  senderDisplayName: chatClient.getState().displayName
13821
13821
  };
13822
13822
  yield chatThreadClient.sendMessage(sendMessageRequest, options);
13823
13823
  }),
13824
- onUpdateMessage: (messageId, content, metadata, options) => __awaiter$l(void 0, void 0, void 0, function* () {
13824
+ onUpdateMessage: (messageId, content, metadata, options) => __awaiter$m(void 0, void 0, void 0, function* () {
13825
13825
  const updatedMetadata = metadata ? Object.assign({}, metadata) : {};
13826
13826
  updatedMetadata['fileSharingMetadata'] = JSON.stringify((options === null || options === void 0 ? void 0 : options.attachedFilesMetadata) || []);
13827
13827
  yield chatThreadClient.updateMessage(messageId, { content, metadata: updatedMetadata });
13828
13828
  }),
13829
- onDeleteMessage: (messageId) => __awaiter$l(void 0, void 0, void 0, function* () {
13829
+ onDeleteMessage: (messageId) => __awaiter$m(void 0, void 0, void 0, function* () {
13830
13830
  yield chatThreadClient.deleteMessage(messageId);
13831
13831
  }),
13832
13832
  // This handler is designed for chatThread to consume
13833
- onMessageSeen: (chatMessageId) => __awaiter$l(void 0, void 0, void 0, function* () {
13833
+ onMessageSeen: (chatMessageId) => __awaiter$m(void 0, void 0, void 0, function* () {
13834
13834
  yield chatThreadClient.sendReadReceipt({ chatMessageId });
13835
13835
  }),
13836
- onTyping: () => __awaiter$l(void 0, void 0, void 0, function* () {
13836
+ onTyping: () => __awaiter$m(void 0, void 0, void 0, function* () {
13837
13837
  yield chatThreadClient.sendTypingNotification();
13838
13838
  }),
13839
- onRemoveParticipant: (userId) => __awaiter$l(void 0, void 0, void 0, function* () {
13839
+ onRemoveParticipant: (userId) => __awaiter$m(void 0, void 0, void 0, function* () {
13840
13840
  yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
13841
13841
  }),
13842
- updateThreadTopicName: (topicName) => __awaiter$l(void 0, void 0, void 0, function* () {
13842
+ updateThreadTopicName: (topicName) => __awaiter$m(void 0, void 0, void 0, function* () {
13843
13843
  yield chatThreadClient.updateTopic(topicName);
13844
13844
  }),
13845
- onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$l(void 0, void 0, void 0, function* () {
13845
+ onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$m(void 0, void 0, void 0, function* () {
13846
13846
  var _a, _b, _c;
13847
13847
  if (messageIterator === undefined) {
13848
13848
  // Lazy definition so that errors in the method call are reported correctly.
@@ -14579,7 +14579,7 @@ const chatStatefulLogger = logger.createClientLogger('communication-react:chat-s
14579
14579
 
14580
14580
  // Copyright (c) Microsoft Corporation.
14581
14581
  // Licensed under the MIT license.
14582
- var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14582
+ var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14583
14583
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14584
14584
  return new (P || (P = Promise))(function (resolve, reject) {
14585
14585
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -14854,7 +14854,7 @@ class ChatContext$1 {
14854
14854
  * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.
14855
14855
  */
14856
14856
  withAsyncErrorTeedToState(f, target) {
14857
- return (...args) => __awaiter$k(this, void 0, void 0, function* () {
14857
+ return (...args) => __awaiter$l(this, void 0, void 0, function* () {
14858
14858
  try {
14859
14859
  return yield f(...args);
14860
14860
  }
@@ -14961,7 +14961,7 @@ const convertChatMessage = (message, status = 'delivered', clientMessageId) => {
14961
14961
 
14962
14962
  // Copyright (c) Microsoft Corporation.
14963
14963
  // Licensed under the MIT license.
14964
- var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14964
+ var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14965
14965
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14966
14966
  return new (P || (P = Promise))(function (resolve, reject) {
14967
14967
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15046,7 +15046,7 @@ class EventSubscriber {
15046
15046
  };
15047
15047
  // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.
15048
15048
  // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.
15049
- this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$j(this, void 0, void 0, function* () {
15049
+ this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$k(this, void 0, void 0, function* () {
15050
15050
  var e_1, _a;
15051
15051
  try {
15052
15052
  for (var _b = __asyncValues$1(this.chatClient
@@ -15138,7 +15138,7 @@ class EventSubscriber {
15138
15138
 
15139
15139
  // Copyright (c) Microsoft Corporation.
15140
15140
  // Licensed under the MIT license.
15141
- var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15141
+ var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15142
15142
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15143
15143
  return new (P || (P = Promise))(function (resolve, reject) {
15144
15144
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15160,7 +15160,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
15160
15160
  const threadsIterator = iteratorCreator(...args);
15161
15161
  return {
15162
15162
  next() {
15163
- return __awaiter$i(this, void 0, void 0, function* () {
15163
+ return __awaiter$j(this, void 0, void 0, function* () {
15164
15164
  const result = yield threadsIterator.next();
15165
15165
  if (!result.done && result.value) {
15166
15166
  decorateFn(result.value, context);
@@ -15175,7 +15175,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
15175
15175
  const pages = threadsIterator.byPage(settings);
15176
15176
  return {
15177
15177
  next() {
15178
- return __awaiter$i(this, void 0, void 0, function* () {
15178
+ return __awaiter$j(this, void 0, void 0, function* () {
15179
15179
  const result = yield pages.next();
15180
15180
  const page = result.value;
15181
15181
  if (!result.done && result.value) {
@@ -15259,7 +15259,7 @@ const createDecoratedListParticipants = (chatThreadClient, context) => {
15259
15259
 
15260
15260
  // Copyright (c) Microsoft Corporation.
15261
15261
  // Licensed under the MIT license.
15262
- var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15262
+ var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15263
15263
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15264
15264
  return new (P || (P = Promise))(function (resolve, reject) {
15265
15265
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15278,14 +15278,14 @@ class ProxyChatThreadClient {
15278
15278
  return createDecoratedListMessages(chatThreadClient, this._context);
15279
15279
  }
15280
15280
  case 'getMessage': {
15281
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$h(this, void 0, void 0, function* () {
15281
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15282
15282
  const message = yield chatThreadClient.getMessage(...args);
15283
15283
  this._context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));
15284
15284
  return message;
15285
15285
  }), 'ChatThreadClient.getMessage');
15286
15286
  }
15287
15287
  case 'sendMessage': {
15288
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$h(this, void 0, void 0, function* () {
15288
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15289
15289
  // Retry logic?
15290
15290
  const [request, options] = args;
15291
15291
  const { content } = request;
@@ -15325,7 +15325,7 @@ class ProxyChatThreadClient {
15325
15325
  }), 'ChatThreadClient.sendMessage');
15326
15326
  }
15327
15327
  case 'addParticipants': {
15328
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$h(this, void 0, void 0, function* () {
15328
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15329
15329
  const result = yield chatThreadClient.addParticipants(...args);
15330
15330
  const [addRequest] = args;
15331
15331
  const participantsToAdd = addRequest.participants;
@@ -15334,7 +15334,7 @@ class ProxyChatThreadClient {
15334
15334
  }), 'ChatThreadClient.addParticipants');
15335
15335
  }
15336
15336
  case 'deleteMessage': {
15337
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$h(this, void 0, void 0, function* () {
15337
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15338
15338
  // DeleteMessage is able to either delete local one(for failed message) or synced message
15339
15339
  const [messageId] = args;
15340
15340
  if (this._context.deleteLocalMessage(chatThreadClient.threadId, messageId)) {
@@ -15352,12 +15352,12 @@ class ProxyChatThreadClient {
15352
15352
  return createDecoratedListReadReceipts(chatThreadClient, this._context);
15353
15353
  }
15354
15354
  case 'sendTypingNotification': {
15355
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$h(this, void 0, void 0, function* () {
15355
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15356
15356
  return yield chatThreadClient.sendTypingNotification(...args);
15357
15357
  }), 'ChatThreadClient.sendTypingNotification');
15358
15358
  }
15359
15359
  case 'removeParticipant': {
15360
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$h(this, void 0, void 0, function* () {
15360
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15361
15361
  const result = yield chatThreadClient.removeParticipant(...args);
15362
15362
  const [removeIdentifier] = args;
15363
15363
  this._context.deleteParticipant(chatThreadClient.threadId, communicationCommon.getIdentifierKind(removeIdentifier));
@@ -15365,7 +15365,7 @@ class ProxyChatThreadClient {
15365
15365
  }), 'ChatThreadClient.removeParticipant');
15366
15366
  }
15367
15367
  case 'updateMessage': {
15368
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$h(this, void 0, void 0, function* () {
15368
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15369
15369
  const result = yield chatThreadClient.updateMessage(...args);
15370
15370
  const [messageId, updateOption] = args;
15371
15371
  this._context.updateChatMessageContent(chatThreadClient.threadId, messageId, updateOption === null || updateOption === void 0 ? void 0 : updateOption.content);
@@ -15373,7 +15373,7 @@ class ProxyChatThreadClient {
15373
15373
  }), 'ChatThreadClient.updateMessage');
15374
15374
  }
15375
15375
  case 'updateTopic': {
15376
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$h(this, void 0, void 0, function* () {
15376
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15377
15377
  const result = yield chatThreadClient.updateTopic(...args);
15378
15378
  const [topic] = args;
15379
15379
  this._context.updateThreadTopic(chatThreadClient.threadId, topic);
@@ -15381,7 +15381,7 @@ class ProxyChatThreadClient {
15381
15381
  }), 'ChatThreadClient.updateTopic');
15382
15382
  }
15383
15383
  case 'getProperties': {
15384
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$h(this, void 0, void 0, function* () {
15384
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15385
15385
  const result = yield chatThreadClient.getProperties(...args);
15386
15386
  this._context.updateThread(chatThreadClient.threadId, result);
15387
15387
  return result;
@@ -15418,7 +15418,7 @@ const createDecoratedListThreads = (chatClient, context) => {
15418
15418
 
15419
15419
  // Copyright (c) Microsoft Corporation.
15420
15420
  // Licensed under the MIT license.
15421
- var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15421
+ var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15422
15422
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15423
15423
  return new (P || (P = Promise))(function (resolve, reject) {
15424
15424
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15437,7 +15437,7 @@ const proxyChatClient = {
15437
15437
  switch (prop) {
15438
15438
  case 'createChatThread': {
15439
15439
  return context.withAsyncErrorTeedToState(function (...args) {
15440
- return __awaiter$g(this, void 0, void 0, function* () {
15440
+ return __awaiter$h(this, void 0, void 0, function* () {
15441
15441
  const result = yield chatClient.createChatThread(...args);
15442
15442
  const thread = result.chatThread;
15443
15443
  if (thread) {
@@ -15450,7 +15450,7 @@ const proxyChatClient = {
15450
15450
  }
15451
15451
  case 'deleteChatThread': {
15452
15452
  return context.withAsyncErrorTeedToState(function (...args) {
15453
- return __awaiter$g(this, void 0, void 0, function* () {
15453
+ return __awaiter$h(this, void 0, void 0, function* () {
15454
15454
  const result = yield chatClient.deleteChatThread(...args);
15455
15455
  context.deleteThread(args[0]);
15456
15456
  return result;
@@ -15470,7 +15470,7 @@ const proxyChatClient = {
15470
15470
  }
15471
15471
  case 'startRealtimeNotifications': {
15472
15472
  return context.withAsyncErrorTeedToState(function (...args) {
15473
- return __awaiter$g(this, void 0, void 0, function* () {
15473
+ return __awaiter$h(this, void 0, void 0, function* () {
15474
15474
  const ret = yield chatClient.startRealtimeNotifications(...args);
15475
15475
  if (!receiver.eventSubscriber) {
15476
15476
  receiver.eventSubscriber = new EventSubscriber(chatClient, context);
@@ -15481,7 +15481,7 @@ const proxyChatClient = {
15481
15481
  }
15482
15482
  case 'stopRealtimeNotifications': {
15483
15483
  return context.withAsyncErrorTeedToState(function (...args) {
15484
- return __awaiter$g(this, void 0, void 0, function* () {
15484
+ return __awaiter$h(this, void 0, void 0, function* () {
15485
15485
  const ret = yield chatClient.stopRealtimeNotifications(...args);
15486
15486
  if (receiver.eventSubscriber) {
15487
15487
  receiver.eventSubscriber.unsubscribe();
@@ -15919,6 +15919,16 @@ const uploadFileButtonStringTrampoline = () => {
15919
15919
  };
15920
15920
 
15921
15921
  // Copyright (c) Microsoft Corporation.
15922
+ // Licensed under the MIT license.
15923
+ var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15924
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15925
+ return new (P || (P = Promise))(function (resolve, reject) {
15926
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15927
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
15928
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
15929
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
15930
+ });
15931
+ };
15922
15932
  /* @conditional-compile-remove(file-sharing) */
15923
15933
  /**
15924
15934
  * @internal
@@ -15964,9 +15974,10 @@ class FileUploadContext {
15964
15974
  * @internal
15965
15975
  */
15966
15976
  class AzureCommunicationFileUploadAdapter {
15967
- constructor(chatContext) {
15977
+ constructor(chatContext, getAuthToken) {
15968
15978
  this.fileUploads = [];
15969
15979
  this.context = new FileUploadContext(chatContext);
15980
+ this.getAuthToken = getAuthToken;
15970
15981
  }
15971
15982
  findFileUpload(id) {
15972
15983
  return this.fileUploads.find((fileUpload) => fileUpload.id === id);
@@ -16026,6 +16037,24 @@ class AzureCommunicationFileUploadAdapter {
16026
16037
  updateFileUploadMetadata(id, metadata) {
16027
16038
  this.context.updateFileUpload(id, { progress: 1, metadata });
16028
16039
  }
16040
+ /* @conditional-compile-remove(teams-inline-images) */
16041
+ downloadAuthenticatedAttachment(attachmentUrl) {
16042
+ return __awaiter$g(this, void 0, void 0, function* () {
16043
+ function fetchWithAuthentication(url, token) {
16044
+ const headers = new Headers();
16045
+ headers.append('Authorization', `Bearer ${token}`);
16046
+ return fetch(url, { headers });
16047
+ }
16048
+ if (!this.getAuthToken) {
16049
+ return '';
16050
+ }
16051
+ // ToDo InlineAttachments: If GET fails might need to send failure up to contoso
16052
+ const token = yield this.getAuthToken();
16053
+ const response = yield fetchWithAuthentication(attachmentUrl !== null && attachmentUrl !== void 0 ? attachmentUrl : '', token);
16054
+ const blob = yield response.blob();
16055
+ return URL.createObjectURL(blob);
16056
+ });
16057
+ }
16029
16058
  subscribeAllEvents(fileUpload) {
16030
16059
  fileUpload.on('uploadProgressChange', this.updateFileUploadProgress.bind(this));
16031
16060
  fileUpload.on('uploadComplete', this.updateFileUploadMetadata.bind(this));
@@ -16539,6 +16568,8 @@ class AzureCommunicationChatAdapter {
16539
16568
  this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);
16540
16569
  /* @conditional-compile-remove(file-sharing) */
16541
16570
  this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);
16571
+ /* @conditional-compile-remove(teams-inline-images) */
16572
+ this.downloadAuthenticatedAttachment = this.downloadAuthenticatedAttachment.bind(this);
16542
16573
  }
16543
16574
  dispose() {
16544
16575
  this.unsubscribeAllEvents();
@@ -16675,6 +16706,15 @@ class AzureCommunicationChatAdapter {
16675
16706
  updateFileUploadMetadata(id, metadata) {
16676
16707
  this.fileUploadAdapter.updateFileUploadMetadata(id, metadata);
16677
16708
  }
16709
+ /* @conditional-compile-remove(teams-inline-images) */
16710
+ downloadAuthenticatedAttachment(attachmentUrl) {
16711
+ return __awaiter$e(this, void 0, void 0, function* () {
16712
+ if (!this.fileUploadAdapter.downloadAuthenticatedAttachment) {
16713
+ return '';
16714
+ }
16715
+ return yield this.fileUploadAdapter.downloadAuthenticatedAttachment(attachmentUrl);
16716
+ });
16717
+ }
16678
16718
  messageReceivedListener(event) {
16679
16719
  const message = convertEventToChatMessage(event);
16680
16720
  this.emitter.emit('messageReceived', { message });