@azure/communication-react 1.13.0-alpha-202402020012 → 1.13.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1004) hide show
  1. package/dist/communication-react.d.ts +21 -692
  2. package/dist/dist-cjs/communication-react/index.js +4860 -7044
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/MessageStatus.js.map +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/areEqual.js.map +1 -1
  6. package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
  7. package/dist/dist-esm/acs-ui-common/src/commonProperties.js.map +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/constants.js.map +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/cssUtils.js.map +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/identifier.js +1 -4
  11. package/dist/dist-esm/acs-ui-common/src/identifier.js.map +1 -1
  12. package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
  13. package/dist/dist-esm/acs-ui-common/src/localizationUtils.js.map +1 -1
  14. package/dist/dist-esm/acs-ui-common/src/logEvent.js.map +1 -1
  15. package/dist/dist-esm/acs-ui-common/src/memoizeFnAll.js.map +1 -1
  16. package/dist/dist-esm/acs-ui-common/src/safeStringify.js.map +1 -1
  17. package/dist/dist-esm/acs-ui-common/src/telemetry.js.map +1 -1
  18. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  19. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  20. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +0 -10
  21. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +0 -19
  22. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  23. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.d.ts +0 -15
  24. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js +11 -57
  25. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js.map +1 -1
  26. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js +5 -12
  27. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js.map +1 -1
  28. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +55 -20
  29. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
  30. package/dist/dist-esm/calling-component-bindings/src/getRemoteParticipantsExcludingConsumers.js +1 -1
  31. package/dist/dist-esm/calling-component-bindings/src/getRemoteParticipantsExcludingConsumers.js.map +1 -1
  32. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +0 -6
  33. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +47 -79
  34. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  35. package/dist/dist-esm/calling-component-bindings/src/handlers/createDefaultCallingHandlersForComponent.js +2 -2
  36. package/dist/dist-esm/calling-component-bindings/src/handlers/createDefaultCallingHandlersForComponent.js.map +1 -1
  37. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.d.ts +1 -1
  38. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +2 -4
  39. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  40. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +6 -2
  41. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
  42. package/dist/dist-esm/calling-component-bindings/src/hooks/useHandlers.d.ts +1 -1
  43. package/dist/dist-esm/calling-component-bindings/src/hooks/useHandlers.js.map +1 -1
  44. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js +0 -12
  45. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  46. package/dist/dist-esm/calling-component-bindings/src/hooks/useSelector.js.map +1 -1
  47. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  48. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +11 -80
  49. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  50. package/dist/dist-esm/calling-component-bindings/src/participantsButtonSelector.js.map +1 -1
  51. package/dist/dist-esm/calling-component-bindings/src/providers/CallAgentProvider.js.map +1 -1
  52. package/dist/dist-esm/calling-component-bindings/src/providers/CallClientProvider.js +3 -6
  53. package/dist/dist-esm/calling-component-bindings/src/providers/CallClientProvider.js.map +1 -1
  54. package/dist/dist-esm/calling-component-bindings/src/providers/CallProvider.js.map +1 -1
  55. package/dist/dist-esm/calling-component-bindings/src/providers/index.js.map +1 -1
  56. package/dist/dist-esm/calling-component-bindings/src/utils/SelectorUtils.js.map +1 -1
  57. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +7 -11
  58. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
  59. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.d.ts +0 -16
  60. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js +1 -39
  61. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js.map +1 -1
  62. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +2 -6
  63. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +17 -56
  64. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  65. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.d.ts +0 -1
  66. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +11 -73
  67. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  68. package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.js.map +1 -1
  69. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.d.ts +1 -1
  70. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js.map +1 -1
  71. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +75 -65
  72. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
  73. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +0 -66
  74. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  75. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +1 -7
  76. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +17 -73
  77. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  78. package/dist/dist-esm/calling-stateful-client/src/CallDeclarative.js +8 -7
  79. package/dist/dist-esm/calling-stateful-client/src/CallDeclarative.js.map +1 -1
  80. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +85 -74
  81. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
  82. package/dist/dist-esm/calling-stateful-client/src/CallIdHistory.js.map +1 -1
  83. package/dist/dist-esm/calling-stateful-client/src/CallIdRef.js.map +1 -1
  84. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +0 -2
  85. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +4 -14
  86. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  87. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js.map +1 -1
  88. package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.js.map +1 -1
  89. package/dist/dist-esm/calling-stateful-client/src/Converter.js +13 -16
  90. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  91. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js +57 -51
  92. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
  93. package/dist/dist-esm/calling-stateful-client/src/IncomingCallDeclarative.js +16 -14
  94. package/dist/dist-esm/calling-stateful-client/src/IncomingCallDeclarative.js.map +1 -1
  95. package/dist/dist-esm/calling-stateful-client/src/IncomingCallSubscriber.js.map +1 -1
  96. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js +15 -3
  97. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js.map +1 -1
  98. package/dist/dist-esm/calling-stateful-client/src/LocalVideoStreamVideoEffectsSubscriber.js.map +1 -1
  99. package/dist/dist-esm/calling-stateful-client/src/Logger.js.map +1 -1
  100. package/dist/dist-esm/calling-stateful-client/src/OptimalVideoCountSubscriber.js +3 -1
  101. package/dist/dist-esm/calling-stateful-client/src/OptimalVideoCountSubscriber.js.map +1 -1
  102. package/dist/dist-esm/calling-stateful-client/src/ParticipantSubscriber.js.map +1 -1
  103. package/dist/dist-esm/calling-stateful-client/src/RaiseHandSubscriber.js.map +1 -1
  104. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js.map +1 -1
  105. package/dist/dist-esm/calling-stateful-client/src/RemoteVideoStreamSubscriber.js +3 -0
  106. package/dist/dist-esm/calling-stateful-client/src/RemoteVideoStreamSubscriber.js.map +1 -1
  107. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +67 -65
  108. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  109. package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js +24 -32
  110. package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js.map +1 -1
  111. package/dist/dist-esm/calling-stateful-client/src/StreamUtilsLogging.js +11 -8
  112. package/dist/dist-esm/calling-stateful-client/src/StreamUtilsLogging.js.map +1 -1
  113. package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.d.ts +1 -1
  114. package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js.map +1 -1
  115. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +8 -7
  116. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -1
  117. package/dist/dist-esm/calling-stateful-client/src/TranscriptionSubscriber.js.map +1 -1
  118. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
  119. package/dist/dist-esm/calling-stateful-client/src/UserFacingDiagnosticsSubscriber.js +3 -3
  120. package/dist/dist-esm/calling-stateful-client/src/UserFacingDiagnosticsSubscriber.js.map +1 -1
  121. package/dist/dist-esm/calling-stateful-client/src/VideoStreamRendererViewDeclarative.js +7 -6
  122. package/dist/dist-esm/calling-stateful-client/src/VideoStreamRendererViewDeclarative.js.map +1 -1
  123. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +0 -2
  124. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  125. package/dist/dist-esm/calling-stateful-client/src/index.js.map +1 -1
  126. package/dist/dist-esm/chat-component-bindings/src/baseSelectors.js +4 -4
  127. package/dist/dist-esm/chat-component-bindings/src/baseSelectors.js.map +1 -1
  128. package/dist/dist-esm/chat-component-bindings/src/chatParticipantListSelector.js +3 -3
  129. package/dist/dist-esm/chat-component-bindings/src/chatParticipantListSelector.js.map +1 -1
  130. package/dist/dist-esm/chat-component-bindings/src/errorBarSelector.js +15 -15
  131. package/dist/dist-esm/chat-component-bindings/src/errorBarSelector.js.map +1 -1
  132. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.d.ts +1 -1
  133. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +10 -3
  134. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  135. package/dist/dist-esm/chat-component-bindings/src/hooks/useHandlers.js.map +1 -1
  136. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  137. package/dist/dist-esm/chat-component-bindings/src/hooks/useSelector.js.map +1 -1
  138. package/dist/dist-esm/chat-component-bindings/src/index.js.map +1 -1
  139. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +23 -40
  140. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  141. package/dist/dist-esm/chat-component-bindings/src/providers/ChatClientProvider.js.map +1 -1
  142. package/dist/dist-esm/chat-component-bindings/src/providers/ChatThreadClientProvider.js +1 -1
  143. package/dist/dist-esm/chat-component-bindings/src/providers/ChatThreadClientProvider.js.map +1 -1
  144. package/dist/dist-esm/chat-component-bindings/src/sendBoxSelector.js.map +1 -1
  145. package/dist/dist-esm/chat-component-bindings/src/typingIndicatorSelector.js +7 -3
  146. package/dist/dist-esm/chat-component-bindings/src/typingIndicatorSelector.js.map +1 -1
  147. package/dist/dist-esm/chat-component-bindings/src/utils/compareMessages.js +1 -3
  148. package/dist/dist-esm/chat-component-bindings/src/utils/compareMessages.js.map +1 -1
  149. package/dist/dist-esm/chat-component-bindings/src/utils/constants.js.map +1 -1
  150. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js +3 -10
  151. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js.map +1 -1
  152. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.js.map +1 -1
  153. package/dist/dist-esm/chat-stateful-client/src/ChatContext.d.ts +1 -1
  154. package/dist/dist-esm/chat-stateful-client/src/ChatContext.js +11 -10
  155. package/dist/dist-esm/chat-stateful-client/src/ChatContext.js.map +1 -1
  156. package/dist/dist-esm/chat-stateful-client/src/Constants.js.map +1 -1
  157. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +11 -8
  158. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
  159. package/dist/dist-esm/chat-stateful-client/src/Logger.js.map +1 -1
  160. package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js +3 -1
  161. package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js.map +1 -1
  162. package/dist/dist-esm/chat-stateful-client/src/StatefulChatClient.js +68 -59
  163. package/dist/dist-esm/chat-stateful-client/src/StatefulChatClient.js.map +1 -1
  164. package/dist/dist-esm/chat-stateful-client/src/StatefulChatThreadClient.js +128 -114
  165. package/dist/dist-esm/chat-stateful-client/src/StatefulChatThreadClient.js.map +1 -1
  166. package/dist/dist-esm/chat-stateful-client/src/convertChatMessage.js +1 -4
  167. package/dist/dist-esm/chat-stateful-client/src/convertChatMessage.js.map +1 -1
  168. package/dist/dist-esm/chat-stateful-client/src/index.js.map +1 -1
  169. package/dist/dist-esm/chat-stateful-client/src/iterators/createDecoratedIterator.js.map +1 -1
  170. package/dist/dist-esm/chat-stateful-client/src/iterators/createDecoratedListMessages.js.map +1 -1
  171. package/dist/dist-esm/chat-stateful-client/src/iterators/createDecoratedListParticipants.js.map +1 -1
  172. package/dist/dist-esm/chat-stateful-client/src/iterators/createDecoratedListReadReceipts.js.map +1 -1
  173. package/dist/dist-esm/chat-stateful-client/src/iterators/createDecoratedListThreads.js.map +1 -1
  174. package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.js.map +1 -1
  175. package/dist/dist-esm/communication-react/src/index.d.ts +2 -6
  176. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  177. package/dist/dist-esm/communication-react/src/mergedHooks.js.map +1 -1
  178. package/dist/dist-esm/react-components/src/components/Announcer/Announcer.js +6 -3
  179. package/dist/dist-esm/react-components/src/components/Announcer/Announcer.js.map +1 -1
  180. package/dist/dist-esm/react-components/src/components/Announcer/AnnouncerContext.js.map +1 -1
  181. package/dist/dist-esm/react-components/src/components/Announcer/AnnouncerMessage.js.map +1 -1
  182. package/dist/dist-esm/react-components/src/components/Announcer/LiveAnnouncer.js +10 -4
  183. package/dist/dist-esm/react-components/src/components/Announcer/LiveAnnouncer.js.map +1 -1
  184. package/dist/dist-esm/react-components/src/components/Announcer/LiveMessage.js +1 -1
  185. package/dist/dist-esm/react-components/src/components/Announcer/LiveMessage.js.map +1 -1
  186. package/dist/dist-esm/react-components/src/components/Announcer/MessageBlock.js +1 -1
  187. package/dist/dist-esm/react-components/src/components/Announcer/MessageBlock.js.map +1 -1
  188. package/dist/dist-esm/react-components/src/components/Announcer.js.map +1 -1
  189. package/dist/dist-esm/react-components/src/components/CameraButton.js +19 -8
  190. package/dist/dist-esm/react-components/src/components/CameraButton.js.map +1 -1
  191. package/dist/dist-esm/react-components/src/components/Caption.js +2 -2
  192. package/dist/dist-esm/react-components/src/components/Caption.js.map +1 -1
  193. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +8 -9
  194. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  195. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.js +22 -44
  196. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.js.map +1 -1
  197. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionMenu.js +5 -2
  198. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionMenu.js.map +1 -1
  199. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionsFlyout.js +22 -37
  200. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionsFlyout.js.map +1 -1
  201. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +8 -14
  202. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
  203. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +43 -45
  204. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
  205. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +30 -69
  206. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
  207. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js +25 -23
  208. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  209. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +31 -34
  210. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  211. package/dist/dist-esm/react-components/src/components/ChatMessage/DefaultSystemMessage.js +5 -9
  212. package/dist/dist-esm/react-components/src/components/ChatMessage/DefaultSystemMessage.js.map +1 -1
  213. package/dist/dist-esm/react-components/src/components/ChatMessage/FluentChatMessageComponentWrapper.js +31 -69
  214. package/dist/dist-esm/react-components/src/components/ChatMessage/FluentChatMessageComponentWrapper.js.map +1 -1
  215. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +1 -1
  216. package/dist/dist-esm/react-components/src/components/ComplianceBanner/BannerMessage.js +18 -18
  217. package/dist/dist-esm/react-components/src/components/ComplianceBanner/BannerMessage.js.map +1 -1
  218. package/dist/dist-esm/react-components/src/components/ComplianceBanner/ComplianceBanner.js +4 -7
  219. package/dist/dist-esm/react-components/src/components/ComplianceBanner/ComplianceBanner.js.map +1 -1
  220. package/dist/dist-esm/react-components/src/components/ComplianceBanner/DelayedUpdateBanner.js +2 -2
  221. package/dist/dist-esm/react-components/src/components/ComplianceBanner/DelayedUpdateBanner.js.map +1 -1
  222. package/dist/dist-esm/react-components/src/components/ComplianceBanner/Utils.js.map +1 -1
  223. package/dist/dist-esm/react-components/src/components/ComplianceBanner/index.js.map +1 -1
  224. package/dist/dist-esm/react-components/src/components/ComplianceBanner/types.js.map +1 -1
  225. package/dist/dist-esm/react-components/src/components/ControlBar.js +14 -10
  226. package/dist/dist-esm/react-components/src/components/ControlBar.js.map +1 -1
  227. package/dist/dist-esm/react-components/src/components/ControlBarButton.js +4 -14
  228. package/dist/dist-esm/react-components/src/components/ControlBarButton.js.map +1 -1
  229. package/dist/dist-esm/react-components/src/components/ControlButtonTooltip.js +14 -3
  230. package/dist/dist-esm/react-components/src/components/ControlButtonTooltip.js.map +1 -1
  231. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js +10 -4
  232. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js.map +1 -1
  233. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js +31 -14
  234. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js.map +1 -1
  235. package/dist/dist-esm/react-components/src/components/DevicePermissions/DevicePermissionDropdown.js +8 -5
  236. package/dist/dist-esm/react-components/src/components/DevicePermissions/DevicePermissionDropdown.js.map +1 -1
  237. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js +6 -24
  238. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +1 -1
  239. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js +20 -12
  240. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js.map +1 -1
  241. package/dist/dist-esm/react-components/src/components/DevicesButton.js +27 -19
  242. package/dist/dist-esm/react-components/src/components/DevicesButton.js.map +1 -1
  243. package/dist/dist-esm/react-components/src/components/Dialpad/DTMFToneGenerator.js +48 -12
  244. package/dist/dist-esm/react-components/src/components/Dialpad/DTMFToneGenerator.js.map +1 -1
  245. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +51 -45
  246. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  247. package/dist/dist-esm/react-components/src/components/Drawer/DrawerContentContainer.js +4 -4
  248. package/dist/dist-esm/react-components/src/components/Drawer/DrawerContentContainer.js.map +1 -1
  249. package/dist/dist-esm/react-components/src/components/Drawer/DrawerLightDismiss.js +6 -2
  250. package/dist/dist-esm/react-components/src/components/Drawer/DrawerLightDismiss.js.map +1 -1
  251. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenu.js +6 -6
  252. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenu.js.map +1 -1
  253. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js +23 -11
  254. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js.map +1 -1
  255. package/dist/dist-esm/react-components/src/components/Drawer/DrawerSurface.js +4 -6
  256. package/dist/dist-esm/react-components/src/components/Drawer/DrawerSurface.js.map +1 -1
  257. package/dist/dist-esm/react-components/src/components/Drawer/index.js.map +1 -1
  258. package/dist/dist-esm/react-components/src/components/EndCallButton.js +7 -3
  259. package/dist/dist-esm/react-components/src/components/EndCallButton.js.map +1 -1
  260. package/dist/dist-esm/react-components/src/components/ErrorBar.js +5 -9
  261. package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
  262. package/dist/dist-esm/react-components/src/components/FileCard.js +4 -3
  263. package/dist/dist-esm/react-components/src/components/FileCard.js.map +1 -1
  264. package/dist/dist-esm/react-components/src/components/FileCardGroup.js +1 -1
  265. package/dist/dist-esm/react-components/src/components/FileCardGroup.js.map +1 -1
  266. package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +4 -0
  267. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js +16 -18
  268. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
  269. package/dist/dist-esm/react-components/src/components/FileUploadCards.js +7 -8
  270. package/dist/dist-esm/react-components/src/components/FileUploadCards.js.map +1 -1
  271. package/dist/dist-esm/react-components/src/components/GridLayout.js +37 -37
  272. package/dist/dist-esm/react-components/src/components/GridLayout.js.map +1 -1
  273. package/dist/dist-esm/react-components/src/components/HighContrastAwareIcon.js +2 -2
  274. package/dist/dist-esm/react-components/src/components/HighContrastAwareIcon.js.map +1 -1
  275. package/dist/dist-esm/react-components/src/components/HoldButton.js +1 -1
  276. package/dist/dist-esm/react-components/src/components/HoldButton.js.map +1 -1
  277. package/dist/dist-esm/react-components/src/components/HorizontalGallery.js +9 -7
  278. package/dist/dist-esm/react-components/src/components/HorizontalGallery.js.map +1 -1
  279. package/dist/dist-esm/react-components/src/components/ImageGallery.js +13 -10
  280. package/dist/dist-esm/react-components/src/components/ImageGallery.js.map +1 -1
  281. package/dist/dist-esm/react-components/src/components/InputBoxButton.js +10 -3
  282. package/dist/dist-esm/react-components/src/components/InputBoxButton.js.map +1 -1
  283. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +7 -5
  284. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  285. package/dist/dist-esm/react-components/src/components/LocalVideoCameraButton.js +5 -3
  286. package/dist/dist-esm/react-components/src/components/LocalVideoCameraButton.js.map +1 -1
  287. package/dist/dist-esm/react-components/src/components/LocalVideoTile.d.ts +0 -5
  288. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +11 -60
  289. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
  290. package/dist/dist-esm/react-components/src/components/MentionPopover.js +14 -17
  291. package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +1 -1
  292. package/dist/dist-esm/react-components/src/components/MessageStatusIndicator.js +36 -23
  293. package/dist/dist-esm/react-components/src/components/MessageStatusIndicator.js.map +1 -1
  294. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +1 -1
  295. package/dist/dist-esm/react-components/src/components/MessageThread.js +48 -82
  296. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  297. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js +14 -17
  298. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js.map +1 -1
  299. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js +101 -94
  300. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js.map +1 -1
  301. package/dist/dist-esm/react-components/src/components/ParticipantItem.js +18 -15
  302. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  303. package/dist/dist-esm/react-components/src/components/ParticipantList.js +36 -61
  304. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  305. package/dist/dist-esm/react-components/src/components/ParticipantsButton.js +32 -46
  306. package/dist/dist-esm/react-components/src/components/ParticipantsButton.js.map +1 -1
  307. package/dist/dist-esm/react-components/src/components/PictureInPictureInPicture/PictureInPictureInPicture.js +3 -3
  308. package/dist/dist-esm/react-components/src/components/PictureInPictureInPicture/PictureInPictureInPicture.js.map +1 -1
  309. package/dist/dist-esm/react-components/src/components/PictureInPictureInPicture/PictureInPictureInPictureTile.js +3 -3
  310. package/dist/dist-esm/react-components/src/components/PictureInPictureInPicture/PictureInPictureInPictureTile.js.map +1 -1
  311. package/dist/dist-esm/react-components/src/components/RaiseHandButton.js +12 -6
  312. package/dist/dist-esm/react-components/src/components/RaiseHandButton.js.map +1 -1
  313. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts +0 -6
  314. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +33 -57
  315. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  316. package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js +2 -2
  317. package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js.map +1 -1
  318. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js +2 -2
  319. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js.map +1 -1
  320. package/dist/dist-esm/react-components/src/components/ScreenShareButton.js +14 -6
  321. package/dist/dist-esm/react-components/src/components/ScreenShareButton.js.map +1 -1
  322. package/dist/dist-esm/react-components/src/components/SendBox.js +20 -24
  323. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  324. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js +2 -2
  325. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js.map +1 -1
  326. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js.map +1 -1
  327. package/dist/dist-esm/react-components/src/components/StartCaptionsButton.js +4 -2
  328. package/dist/dist-esm/react-components/src/components/StartCaptionsButton.js.map +1 -1
  329. package/dist/dist-esm/react-components/src/components/StreamMedia.js +3 -3
  330. package/dist/dist-esm/react-components/src/components/StreamMedia.js.map +1 -1
  331. package/dist/dist-esm/react-components/src/components/SystemMessage.js +4 -2
  332. package/dist/dist-esm/react-components/src/components/SystemMessage.js.map +1 -1
  333. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +22 -67
  334. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +1 -1
  335. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js +49 -55
  336. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js.map +1 -1
  337. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js +10 -10
  338. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js.map +1 -1
  339. package/dist/dist-esm/react-components/src/components/TypingIndicator.js +6 -9
  340. package/dist/dist-esm/react-components/src/components/TypingIndicator.js.map +1 -1
  341. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js +1 -1
  342. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js.map +1 -1
  343. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +1 -1
  344. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -1
  345. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +8 -4
  346. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -1
  347. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js +1 -1
  348. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js.map +1 -1
  349. package/dist/dist-esm/react-components/src/components/VerticalGallery.js +34 -19
  350. package/dist/dist-esm/react-components/src/components/VerticalGallery.js.map +1 -1
  351. package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.js +1 -3
  352. package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.js.map +1 -1
  353. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +12 -8
  354. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
  355. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js +12 -6
  356. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js.map +1 -1
  357. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.styles.js +2 -6
  358. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.styles.js.map +1 -1
  359. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +19 -42
  360. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
  361. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js +10 -14
  362. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js.map +1 -1
  363. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +28 -69
  364. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  365. package/dist/dist-esm/react-components/src/components/VideoGallery/FocusContentLayout.js +2 -2
  366. package/dist/dist-esm/react-components/src/components/VideoGallery/FocusContentLayout.js.map +1 -1
  367. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +0 -4
  368. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -1
  369. package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.js +7 -7
  370. package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.js.map +1 -1
  371. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js +7 -19
  372. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js.map +1 -1
  373. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js +6 -8
  374. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js.map +1 -1
  375. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js +4 -2
  376. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js.map +1 -1
  377. package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js +21 -60
  378. package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js.map +1 -1
  379. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/DefaultLayout.styles.js +6 -1
  380. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/DefaultLayout.styles.js.map +1 -1
  381. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +34 -9
  382. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -1
  383. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideoLayout.styles.js +11 -2
  384. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideoLayout.styles.js.map +1 -1
  385. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/Layout.styles.js.map +1 -1
  386. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/LocalScreenShare.styles.js.map +1 -1
  387. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/RemoteScreenShare.styles.js.map +1 -1
  388. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/RemoteVideoTile.styles.js.map +1 -1
  389. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js +3 -1
  390. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js.map +1 -1
  391. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js +11 -10
  392. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js.map +1 -1
  393. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js +28 -22
  394. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js.map +1 -1
  395. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js +5 -10
  396. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js.map +1 -1
  397. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.d.ts +0 -7
  398. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +39 -61
  399. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
  400. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.js.map +1 -1
  401. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +0 -5
  402. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +30 -77
  403. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
  404. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +1 -18
  405. package/dist/dist-esm/react-components/src/components/VideoGallery.js +69 -151
  406. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  407. package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +2 -13
  408. package/dist/dist-esm/react-components/src/components/VideoTile.js +87 -92
  409. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  410. package/dist/dist-esm/react-components/src/components/assets/RaisedHandIcon.js +2 -2
  411. package/dist/dist-esm/react-components/src/components/assets/RaisedHandIcon.js.map +1 -1
  412. package/dist/dist-esm/react-components/src/components/index.d.ts +2 -10
  413. package/dist/dist-esm/react-components/src/components/index.js +0 -10
  414. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  415. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js.map +1 -1
  416. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
  417. package/dist/dist-esm/react-components/src/components/styles/CaptionsSettingsModal.styles.js.map +1 -1
  418. package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js +6 -2
  419. package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js.map +1 -1
  420. package/dist/dist-esm/react-components/src/components/styles/Common.style.js.map +1 -1
  421. package/dist/dist-esm/react-components/src/components/styles/ControlBar.styles.js.map +1 -1
  422. package/dist/dist-esm/react-components/src/components/styles/Dialpad.styles.d.ts +1 -1
  423. package/dist/dist-esm/react-components/src/components/styles/Dialpad.styles.js +3 -5
  424. package/dist/dist-esm/react-components/src/components/styles/Dialpad.styles.js.map +1 -1
  425. package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.js.map +1 -1
  426. package/dist/dist-esm/react-components/src/components/styles/GridLayout.styles.js.map +1 -1
  427. package/dist/dist-esm/react-components/src/components/styles/HorizontalGallery.styles.js.map +1 -1
  428. package/dist/dist-esm/react-components/src/components/styles/IconButton.styles.js.map +1 -1
  429. package/dist/dist-esm/react-components/src/components/styles/ImageGallery.style.js +5 -2
  430. package/dist/dist-esm/react-components/src/components/styles/ImageGallery.style.js.map +1 -1
  431. package/dist/dist-esm/react-components/src/components/styles/InputBoxButton.style.js.map +1 -1
  432. package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.js +5 -2
  433. package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.js.map +1 -1
  434. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +1 -1
  435. package/dist/dist-esm/react-components/src/components/styles/MessageStatusIndicator.styles.js.map +1 -1
  436. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +10 -4
  437. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  438. package/dist/dist-esm/react-components/src/components/styles/ParticipantItem.styles.js +2 -1
  439. package/dist/dist-esm/react-components/src/components/styles/ParticipantItem.styles.js.map +1 -1
  440. package/dist/dist-esm/react-components/src/components/styles/ParticipantList.styles.js.map +1 -1
  441. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +10 -2
  442. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
  443. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +1 -1
  444. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js.map +1 -1
  445. package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.js +6 -3
  446. package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.js.map +1 -1
  447. package/dist/dist-esm/react-components/src/components/styles/SystemMessage.styles.js.map +1 -1
  448. package/dist/dist-esm/react-components/src/components/styles/TroubleshootingGuideErrorBar.styles.js +2 -1
  449. package/dist/dist-esm/react-components/src/components/styles/TroubleshootingGuideErrorBar.styles.js.map +1 -1
  450. package/dist/dist-esm/react-components/src/components/styles/TypingIndicator.styles.js.map +1 -1
  451. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +1 -1
  452. package/dist/dist-esm/react-components/src/components/styles/VerticalGallery.styles.js +2 -1
  453. package/dist/dist-esm/react-components/src/components/styles/VerticalGallery.styles.js.map +1 -1
  454. package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.js +19 -5
  455. package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.js.map +1 -1
  456. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +0 -11
  457. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +0 -37
  458. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  459. package/dist/dist-esm/react-components/src/components/styles/v8StyleShim.js.map +1 -1
  460. package/dist/dist-esm/react-components/src/components/utils/Datetime.js +4 -1
  461. package/dist/dist-esm/react-components/src/components/utils/Datetime.js.map +1 -1
  462. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +2 -3
  463. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  464. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  465. package/dist/dist-esm/react-components/src/components/utils/delay.js.map +1 -1
  466. package/dist/dist-esm/react-components/src/components/utils/formatPhoneNumber.js.map +1 -1
  467. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js +7 -4
  468. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js.map +1 -1
  469. package/dist/dist-esm/react-components/src/components/utils/keyboardNavigation.js.map +1 -1
  470. package/dist/dist-esm/react-components/src/components/utils/merge.js.map +1 -1
  471. package/dist/dist-esm/react-components/src/components/utils/overFlowGalleriesUtils.js.map +1 -1
  472. package/dist/dist-esm/react-components/src/components/utils/responsive.js +2 -2
  473. package/dist/dist-esm/react-components/src/components/utils/responsive.js.map +1 -1
  474. package/dist/dist-esm/react-components/src/components/utils/useLongPress.js +1 -10
  475. package/dist/dist-esm/react-components/src/components/utils/useLongPress.js.map +1 -1
  476. package/dist/dist-esm/react-components/src/components/utils/videoTileStylesUtils.js +3 -1
  477. package/dist/dist-esm/react-components/src/components/utils/videoTileStylesUtils.js.map +1 -1
  478. package/dist/dist-esm/react-components/src/components/utils.js +10 -13
  479. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  480. package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js +6 -8
  481. package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js.map +1 -1
  482. package/dist/dist-esm/react-components/src/gallery/index.js.map +1 -1
  483. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  484. package/dist/dist-esm/react-components/src/identifiers/index.js.map +1 -1
  485. package/dist/dist-esm/react-components/src/index.d.ts +0 -5
  486. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  487. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +0 -5
  488. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  489. package/dist/dist-esm/react-components/src/localization/index.js.map +1 -1
  490. package/dist/dist-esm/react-components/src/localization/locales/ar-SA/ComponentLocale.js +3 -1
  491. package/dist/dist-esm/react-components/src/localization/locales/ar-SA/ComponentLocale.js.map +1 -1
  492. package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/ComponentLocale.js +3 -1
  493. package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/ComponentLocale.js.map +1 -1
  494. package/dist/dist-esm/react-components/src/localization/locales/de-DE/ComponentLocale.js +3 -1
  495. package/dist/dist-esm/react-components/src/localization/locales/de-DE/ComponentLocale.js.map +1 -1
  496. package/dist/dist-esm/react-components/src/localization/locales/en-GB/ComponentLocale.js +3 -1
  497. package/dist/dist-esm/react-components/src/localization/locales/en-GB/ComponentLocale.js.map +1 -1
  498. package/dist/dist-esm/react-components/src/localization/locales/es-ES/ComponentLocale.js +3 -1
  499. package/dist/dist-esm/react-components/src/localization/locales/es-ES/ComponentLocale.js.map +1 -1
  500. package/dist/dist-esm/react-components/src/localization/locales/fi-FI/ComponentLocale.js +3 -1
  501. package/dist/dist-esm/react-components/src/localization/locales/fi-FI/ComponentLocale.js.map +1 -1
  502. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/ComponentLocale.js +3 -1
  503. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/ComponentLocale.js.map +1 -1
  504. package/dist/dist-esm/react-components/src/localization/locales/he-IL/ComponentLocale.js +3 -1
  505. package/dist/dist-esm/react-components/src/localization/locales/he-IL/ComponentLocale.js.map +1 -1
  506. package/dist/dist-esm/react-components/src/localization/locales/index.js +3 -1
  507. package/dist/dist-esm/react-components/src/localization/locales/index.js.map +1 -1
  508. package/dist/dist-esm/react-components/src/localization/locales/it-IT/ComponentLocale.js +3 -1
  509. package/dist/dist-esm/react-components/src/localization/locales/it-IT/ComponentLocale.js.map +1 -1
  510. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/ComponentLocale.js +3 -1
  511. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/ComponentLocale.js.map +1 -1
  512. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/ComponentLocale.js +3 -1
  513. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/ComponentLocale.js.map +1 -1
  514. package/dist/dist-esm/react-components/src/localization/locales/nb-NO/ComponentLocale.js +3 -1
  515. package/dist/dist-esm/react-components/src/localization/locales/nb-NO/ComponentLocale.js.map +1 -1
  516. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/ComponentLocale.js +3 -1
  517. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/ComponentLocale.js.map +1 -1
  518. package/dist/dist-esm/react-components/src/localization/locales/pl-PL/ComponentLocale.js +3 -1
  519. package/dist/dist-esm/react-components/src/localization/locales/pl-PL/ComponentLocale.js.map +1 -1
  520. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/ComponentLocale.js +3 -1
  521. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/ComponentLocale.js.map +1 -1
  522. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/ComponentLocale.js +3 -1
  523. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/ComponentLocale.js.map +1 -1
  524. package/dist/dist-esm/react-components/src/localization/locales/sv-SE/ComponentLocale.js +3 -1
  525. package/dist/dist-esm/react-components/src/localization/locales/sv-SE/ComponentLocale.js.map +1 -1
  526. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/ComponentLocale.js +3 -1
  527. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/ComponentLocale.js.map +1 -1
  528. package/dist/dist-esm/react-components/src/localization/locales/utils.js.map +1 -1
  529. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/ComponentLocale.js +3 -1
  530. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/ComponentLocale.js.map +1 -1
  531. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/ComponentLocale.js +3 -1
  532. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/ComponentLocale.js.map +1 -1
  533. package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.js +5 -3
  534. package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.js.map +1 -1
  535. package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.js +1 -1
  536. package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.js.map +1 -1
  537. package/dist/dist-esm/react-components/src/theming/generateTheme.js +1 -15
  538. package/dist/dist-esm/react-components/src/theming/generateTheme.js.map +1 -1
  539. package/dist/dist-esm/react-components/src/theming/icons.d.ts +0 -7
  540. package/dist/dist-esm/react-components/src/theming/icons.js +36 -46
  541. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  542. package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +1 -1
  543. package/dist/dist-esm/react-components/src/theming/index.js.map +1 -1
  544. package/dist/dist-esm/react-components/src/theming/themeDuplicates.js.map +1 -1
  545. package/dist/dist-esm/react-components/src/theming/themeUtils.js.map +1 -1
  546. package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
  547. package/dist/dist-esm/react-components/src/theming/v9ThemeShim.js +7 -1
  548. package/dist/dist-esm/react-components/src/theming/v9ThemeShim.js.map +1 -1
  549. package/dist/dist-esm/react-components/src/types/CallSurveyImprovementSuggestions.js.map +1 -1
  550. package/dist/dist-esm/react-components/src/types/CaptionsAvailableLanguageStrings.js.map +1 -1
  551. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  552. package/dist/dist-esm/react-components/src/types/CommunicationParticipant.js.map +1 -1
  553. package/dist/dist-esm/react-components/src/types/ComponentSlotStyle.js.map +1 -1
  554. package/dist/dist-esm/react-components/src/types/CustomStylesProps.js.map +1 -1
  555. package/dist/dist-esm/react-components/src/types/OnRender.js.map +1 -1
  556. package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.d.ts +0 -38
  557. package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.js.map +1 -1
  558. package/dist/dist-esm/react-components/src/types/ReactionTypes.js.map +1 -1
  559. package/dist/dist-esm/react-components/src/types/ReadReceiptsBySenderId.js.map +1 -1
  560. package/dist/dist-esm/react-components/src/types/SurveyIssues.js.map +1 -1
  561. package/dist/dist-esm/react-components/src/types/SurveyIssuesHeadingStrings.js.map +1 -1
  562. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.d.ts +0 -13
  563. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
  564. package/dist/dist-esm/react-components/src/types/index.js.map +1 -1
  565. package/dist/dist-esm/react-composites/src/Logger.js.map +1 -1
  566. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +0 -74
  567. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +40 -67
  568. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  569. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +0 -109
  570. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  571. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +1 -7
  572. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +65 -155
  573. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  574. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +0 -36
  575. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js +1 -7
  576. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  577. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapterProvider.js.map +1 -1
  578. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js +2 -5
  579. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js.map +1 -1
  580. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/DiagnosticsForwarder.js.map +1 -1
  581. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js +3 -1
  582. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js.map +1 -1
  583. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/ParticipantSubcriber.js.map +1 -1
  584. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.d.ts +1 -1
  585. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js +5 -11
  586. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js.map +1 -1
  587. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  588. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +0 -2
  589. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +39 -86
  590. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  591. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +59 -56
  592. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  593. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +141 -133
  594. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +1 -1
  595. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js +18 -10
  596. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js.map +1 -1
  597. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js +7 -1
  598. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js.map +1 -1
  599. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js +1 -1
  600. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -1
  601. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js +7 -1
  602. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js.map +1 -1
  603. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ExpandedLocalVideoTile.js +4 -5
  604. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ExpandedLocalVideoTile.js.map +1 -1
  605. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js +4 -4
  606. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js.map +1 -1
  607. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LobbyTile.js +4 -4
  608. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LobbyTile.js.map +1 -1
  609. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js +23 -34
  610. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js.map +1 -1
  611. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +26 -37
  612. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  613. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js +30 -26
  614. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js.map +1 -1
  615. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +43 -67
  616. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  617. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MutedNotification.js +2 -2
  618. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MutedNotification.js.map +1 -1
  619. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +2 -2
  620. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
  621. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +11 -29
  622. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
  623. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePaneProvider.js.map +1 -1
  624. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +0 -4
  625. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +8 -70
  626. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  627. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +8 -13
  628. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
  629. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/StartCallButton.js +1 -1
  630. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/StartCallButton.js.map +1 -1
  631. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.js +5 -3
  632. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.js.map +1 -1
  633. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js +3 -9
  634. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
  635. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js +11 -19
  636. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js.map +1 -1
  637. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js +2 -5
  638. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js.map +1 -1
  639. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js +7 -14
  640. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
  641. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Participants.js +2 -5
  642. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Participants.js.map +1 -1
  643. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/People.js +1 -1
  644. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/People.js.map +1 -1
  645. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/RaiseHand.js +1 -1
  646. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/RaiseHand.js.map +1 -1
  647. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js +1 -3
  648. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
  649. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +7 -7
  650. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
  651. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +4 -26
  652. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  653. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/usePropsFor.js.map +1 -1
  654. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useSelector.js +1 -1
  655. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useSelector.js.map +1 -1
  656. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +2 -1
  657. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  658. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +11 -68
  659. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  660. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +0 -8
  661. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +32 -80
  662. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  663. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +7 -13
  664. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
  665. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +7 -15
  666. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
  667. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/NoticePage.d.ts +0 -35
  668. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/NoticePage.js +3 -13
  669. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/NoticePage.js.map +1 -1
  670. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +23 -23
  671. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
  672. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +3 -3
  673. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +1 -1
  674. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/LocalVideoTileSelector.d.ts +2 -2
  675. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/LocalVideoTileSelector.js +1 -1
  676. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/LocalVideoTileSelector.js.map +1 -1
  677. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.js +1 -2
  678. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.js.map +1 -1
  679. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  680. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/callStatusSelector.d.ts +1 -1
  681. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/callStatusSelector.js.map +1 -1
  682. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/capabilitiesChangedInfoAndRoleSelector.d.ts +1 -1
  683. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/capabilitiesChangedInfoAndRoleSelector.js +4 -1
  684. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/capabilitiesChangedInfoAndRoleSelector.js.map +1 -1
  685. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/complianceBannerSelector.d.ts +1 -1
  686. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/complianceBannerSelector.js.map +1 -1
  687. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/deviceCountSelector.d.ts +1 -1
  688. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/deviceCountSelector.js.map +1 -1
  689. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/devicePermissionSelector.d.ts +2 -2
  690. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/devicePermissionSelector.js +1 -1
  691. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/devicePermissionSelector.js.map +1 -1
  692. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.d.ts +2 -2
  693. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js +5 -7
  694. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js.map +1 -1
  695. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/lobbySelector.d.ts +4 -4
  696. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/lobbySelector.js +1 -1
  697. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/lobbySelector.js.map +1 -1
  698. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.d.ts +10 -10
  699. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.js +1 -7
  700. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.js.map +1 -1
  701. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localPreviewSelector.d.ts +2 -2
  702. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localPreviewSelector.js +4 -4
  703. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localPreviewSelector.js.map +1 -1
  704. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.d.ts +1 -1
  705. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.js +1 -1
  706. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.js.map +1 -1
  707. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mediaGallerySelector.d.ts +5 -5
  708. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mediaGallerySelector.js +4 -4
  709. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mediaGallerySelector.js.map +1 -1
  710. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mutedNotificationSelector.d.ts +2 -2
  711. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mutedNotificationSelector.js +1 -1
  712. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mutedNotificationSelector.js.map +1 -1
  713. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/networkReconnectTileSelector.d.ts +5 -5
  714. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/networkReconnectTileSelector.js.map +1 -1
  715. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/Buttons.styles.js +1 -1
  716. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/Buttons.styles.js.map +1 -1
  717. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallComposite.styles.js +6 -2
  718. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallComposite.styles.js.map +1 -1
  719. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js +11 -11
  720. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js.map +1 -1
  721. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallControls.styles.js.map +1 -1
  722. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js.map +1 -1
  723. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/ExpandedLocalVideoTile.styles.js +4 -1
  724. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/ExpandedLocalVideoTile.styles.js.map +1 -1
  725. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/HoldPane.styles.js.map +1 -1
  726. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LobbyTile.styles.js +9 -2
  727. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LobbyTile.styles.js.map +1 -1
  728. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalDeviceSettings.styles.js.map +1 -1
  729. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.js +2 -1
  730. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.js.map +1 -1
  731. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/NetworkReconnectTile.styles.js.map +1 -1
  732. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/NoticePage.styles.js.map +1 -1
  733. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/StartCallButton.styles.js +2 -1
  734. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/StartCallButton.styles.js.map +1 -1
  735. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/TransferPage.styles.js +24 -6
  736. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/TransferPage.styles.js.map +1 -1
  737. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.d.ts +2 -2
  738. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.js.map +1 -1
  739. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CapabilityChangedNotificationTracking.js.map +1 -1
  740. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/ErrorTracking.js.map +1 -1
  741. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.d.ts +0 -7
  742. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js +11 -22
  743. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js.map +1 -1
  744. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.js +10 -10
  745. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.js.map +1 -1
  746. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackErrors.js +2 -2
  747. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackErrors.js.map +1 -1
  748. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +2 -6
  749. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +31 -52
  750. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  751. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/index.js.map +1 -1
  752. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/useConsoleErrors.js.map +1 -1
  753. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +0 -74
  754. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +33 -96
  755. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  756. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButton.js +1 -1
  757. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButton.js.map +1 -1
  758. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.js +7 -9
  759. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.js.map +1 -1
  760. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/NotificationIcon.js +9 -6
  761. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/NotificationIcon.js.map +1 -1
  762. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/useUnreadMessagesTracker.js +2 -2
  763. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/useUnreadMessagesTracker.js.map +1 -1
  764. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.js.map +1 -1
  765. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +3 -9
  766. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +11 -73
  767. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  768. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +3 -30
  769. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  770. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +0 -6
  771. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +0 -20
  772. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  773. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +3 -3
  774. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +2 -2
  775. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  776. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js +1 -1
  777. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js.map +1 -1
  778. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/hooks/useCallWithChatCompositeStrings.js.map +1 -1
  779. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/index.js.map +1 -1
  780. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/selectors/moreDrawerSelector.js +1 -1
  781. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/selectors/moreDrawerSelector.js.map +1 -1
  782. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +0 -5
  783. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +1 -4
  784. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  785. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js.map +1 -1
  786. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +2 -3
  787. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  788. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatHeader.js +5 -3
  789. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatHeader.js.map +1 -1
  790. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +30 -37
  791. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  792. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js +1 -1
  793. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js.map +1 -1
  794. package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.js +5 -3
  795. package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.js.map +1 -1
  796. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
  797. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +5 -5
  798. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +57 -46
  799. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  800. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js +20 -15
  801. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js.map +1 -1
  802. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +5 -5
  803. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  804. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js.map +1 -1
  805. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUpload.js.map +1 -1
  806. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js +6 -11
  807. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js.map +1 -1
  808. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadHandler.js.map +1 -1
  809. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +1 -1
  810. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useAdaptedSelector.js +3 -1
  811. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useAdaptedSelector.js.map +1 -1
  812. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +2 -5
  813. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
  814. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/usePropsFor.js.map +1 -1
  815. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.js +1 -1
  816. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.js.map +1 -1
  817. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  818. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +1 -1
  819. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.d.ts +6 -6
  820. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.js +5 -3
  821. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.js.map +1 -1
  822. package/dist/dist-esm/react-composites/src/composites/ChatComposite/styles/Chat.styles.js +6 -2
  823. package/dist/dist-esm/react-composites/src/composites/ChatComposite/styles/Chat.styles.js.map +1 -1
  824. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js +17 -9
  825. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js.map +1 -1
  826. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js +25 -23
  827. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js.map +1 -1
  828. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.styles.js.map +1 -1
  829. package/dist/dist-esm/react-composites/src/composites/common/AvatarPersona.js +4 -10
  830. package/dist/dist-esm/react-composites/src/composites/common/AvatarPersona.js.map +1 -1
  831. package/dist/dist-esm/react-composites/src/composites/common/BaseComposite.js +14 -5
  832. package/dist/dist-esm/react-composites/src/composites/common/BaseComposite.js.map +1 -1
  833. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js +23 -9
  834. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js.map +1 -1
  835. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.styles.js.map +1 -1
  836. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js +8 -6
  837. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js.map +1 -1
  838. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js +16 -12
  839. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js.map +1 -1
  840. package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.js +1 -1
  841. package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.js.map +1 -1
  842. package/dist/dist-esm/react-composites/src/composites/common/ContainerRectProps.js +5 -1
  843. package/dist/dist-esm/react-composites/src/composites/common/ContainerRectProps.js.map +1 -1
  844. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +0 -2
  845. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +39 -95
  846. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  847. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js +33 -35
  848. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js.map +1 -1
  849. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.d.ts +0 -2
  850. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +61 -140
  851. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
  852. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/PeopleButton.js +1 -1
  853. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/PeopleButton.js.map +1 -1
  854. package/dist/dist-esm/react-composites/src/composites/common/ConvertContextualMenuItemToDrawerMenuItem.js.map +1 -1
  855. package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionSettingsDrawer.js +7 -5
  856. package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionSettingsDrawer.js.map +1 -1
  857. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.d.ts +0 -8
  858. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +108 -115
  859. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  860. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.js.map +1 -1
  861. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.d.ts +0 -2
  862. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js.map +1 -1
  863. package/dist/dist-esm/react-composites/src/composites/common/Drawer/captionSettingsDrawer.styles.js.map +1 -1
  864. package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.js +1 -1
  865. package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.js.map +1 -1
  866. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js +14 -19
  867. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
  868. package/dist/dist-esm/react-composites/src/composites/common/MoreButton.js +1 -1
  869. package/dist/dist-esm/react-composites/src/composites/common/MoreButton.js.map +1 -1
  870. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +12 -12
  871. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
  872. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +8 -19
  873. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  874. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js +15 -7
  875. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js.map +1 -1
  876. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js +8 -10
  877. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js.map +1 -1
  878. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +13 -16
  879. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  880. package/dist/dist-esm/react-composites/src/composites/common/adapters.js.map +1 -1
  881. package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -1
  882. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +0 -13
  883. package/dist/dist-esm/react-composites/src/composites/common/icons.js +4 -6
  884. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  885. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependency.js.map +1 -1
  886. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependencyLazy.js.map +1 -1
  887. package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.js.map +1 -1
  888. package/dist/dist-esm/react-composites/src/composites/common/styles/GlobalHostLayer.styles.js.map +1 -1
  889. package/dist/dist-esm/react-composites/src/composites/common/styles/ModalLocalAndRemotePIP.styles.js +10 -4
  890. package/dist/dist-esm/react-composites/src/composites/common/styles/ModalLocalAndRemotePIP.styles.js.map +1 -1
  891. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js +51 -12
  892. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js.map +1 -1
  893. package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.js +29 -6
  894. package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.js.map +1 -1
  895. package/dist/dist-esm/react-composites/src/composites/common/styles/PeoplePaneContent.styles.js +22 -4
  896. package/dist/dist-esm/react-composites/src/composites/common/styles/PeoplePaneContent.styles.js.map +1 -1
  897. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.d.ts +0 -13
  898. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -1
  899. package/dist/dist-esm/react-composites/src/composites/common/utils.js +12 -17
  900. package/dist/dist-esm/react-composites/src/composites/common/utils.js.map +1 -1
  901. package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
  902. package/dist/dist-esm/react-composites/src/composites/localization/LocalizationProvider.js +2 -2
  903. package/dist/dist-esm/react-composites/src/composites/localization/LocalizationProvider.js.map +1 -1
  904. package/dist/dist-esm/react-composites/src/composites/localization/index.js.map +1 -1
  905. package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/CompositeLocale.js.map +1 -1
  906. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/CompositeLocale.js.map +1 -1
  907. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/CompositeLocale.js.map +1 -1
  908. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/CompositeLocale.js.map +1 -1
  909. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +0 -2
  910. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/CompositeLocale.js.map +1 -1
  911. package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/CompositeLocale.js.map +1 -1
  912. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/CompositeLocale.js.map +1 -1
  913. package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/CompositeLocale.js.map +1 -1
  914. package/dist/dist-esm/react-composites/src/composites/localization/locales/index.js.map +1 -1
  915. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/CompositeLocale.js.map +1 -1
  916. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/CompositeLocale.js.map +1 -1
  917. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/CompositeLocale.js.map +1 -1
  918. package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/CompositeLocale.js.map +1 -1
  919. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/CompositeLocale.js.map +1 -1
  920. package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/CompositeLocale.js.map +1 -1
  921. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/CompositeLocale.js.map +1 -1
  922. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/CompositeLocale.js.map +1 -1
  923. package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/CompositeLocale.js.map +1 -1
  924. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/CompositeLocale.js.map +1 -1
  925. package/dist/dist-esm/react-composites/src/composites/localization/locales/utils.js.map +1 -1
  926. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/CompositeLocale.js.map +1 -1
  927. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/CompositeLocale.js.map +1 -1
  928. package/dist/dist-esm/react-composites/src/index-public.js.map +1 -1
  929. package/package.json +1 -1
  930. package/dist/dist-esm/calling-stateful-client/src/ReactionSubscriber.d.ts +0 -16
  931. package/dist/dist-esm/calling-stateful-client/src/ReactionSubscriber.js +0 -24
  932. package/dist/dist-esm/calling-stateful-client/src/ReactionSubscriber.js.map +0 -1
  933. package/dist/dist-esm/calling-stateful-client/src/SpotlightSubscriber.d.ts +0 -16
  934. package/dist/dist-esm/calling-stateful-client/src/SpotlightSubscriber.js +0 -27
  935. package/dist/dist-esm/calling-stateful-client/src/SpotlightSubscriber.js.map +0 -1
  936. package/dist/dist-esm/react-components/src/components/RTE/RTEInputBoxComponent.d.ts +0 -19
  937. package/dist/dist-esm/react-components/src/components/RTE/RTEInputBoxComponent.js +0 -13
  938. package/dist/dist-esm/react-components/src/components/RTE/RTEInputBoxComponent.js.map +0 -1
  939. package/dist/dist-esm/react-components/src/components/RTE/RTESendBox.d.ts +0 -49
  940. package/dist/dist-esm/react-components/src/components/RTE/RTESendBox.js +0 -55
  941. package/dist/dist-esm/react-components/src/components/RTE/RTESendBox.js.map +0 -1
  942. package/dist/dist-esm/react-components/src/components/RTE/RTESendBoxErrors.d.ts +0 -15
  943. package/dist/dist-esm/react-components/src/components/RTE/RTESendBoxErrors.js +0 -18
  944. package/dist/dist-esm/react-components/src/components/RTE/RTESendBoxErrors.js.map +0 -1
  945. package/dist/dist-esm/react-components/src/components/RTE/RichTextEditor.d.ts +0 -18
  946. package/dist/dist-esm/react-components/src/components/RTE/RichTextEditor.js +0 -40
  947. package/dist/dist-esm/react-components/src/components/RTE/RichTextEditor.js.map +0 -1
  948. package/dist/dist-esm/react-components/src/components/ReactionButton.d.ts +0 -54
  949. package/dist/dist-esm/react-components/src/components/ReactionButton.js +0 -89
  950. package/dist/dist-esm/react-components/src/components/ReactionButton.js.map +0 -1
  951. package/dist/dist-esm/react-components/src/components/Survey/StarSurvey/StarSurvey.d.ts +0 -64
  952. package/dist/dist-esm/react-components/src/components/Survey/StarSurvey/StarSurvey.js +0 -55
  953. package/dist/dist-esm/react-components/src/components/Survey/StarSurvey/StarSurvey.js.map +0 -1
  954. package/dist/dist-esm/react-components/src/components/Survey/StarSurvey/StarSurvey.styles.d.ts +0 -18
  955. package/dist/dist-esm/react-components/src/components/Survey/StarSurvey/StarSurvey.styles.js +0 -57
  956. package/dist/dist-esm/react-components/src/components/Survey/StarSurvey/StarSurvey.styles.js.map +0 -1
  957. package/dist/dist-esm/react-components/src/components/Survey/SurveyTypes.d.ts +0 -141
  958. package/dist/dist-esm/react-components/src/components/Survey/SurveyTypes.js +0 -4
  959. package/dist/dist-esm/react-components/src/components/Survey/SurveyTypes.js.map +0 -1
  960. package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.d.ts +0 -63
  961. package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.js +0 -122
  962. package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.js.map +0 -1
  963. package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.styles.d.ts +0 -22
  964. package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.styles.js +0 -53
  965. package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.styles.js.map +0 -1
  966. package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.d.ts +0 -17
  967. package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js +0 -127
  968. package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js.map +0 -1
  969. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.d.ts +0 -24
  970. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js +0 -76
  971. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js.map +0 -1
  972. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +0 -5
  973. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +0 -16
  974. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +0 -1
  975. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Reaction.d.ts +0 -16
  976. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Reaction.js +0 -26
  977. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Reaction.js.map +0 -1
  978. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.d.ts +0 -26
  979. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js +0 -72
  980. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js.map +0 -1
  981. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/capabilitySelector.d.ts +0 -14
  982. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/capabilitySelector.js +0 -13
  983. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/capabilitySelector.js.map +0 -1
  984. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/DtmfDialpadPage.styles.d.ts +0 -8
  985. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/DtmfDialpadPage.styles.js +0 -18
  986. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/DtmfDialpadPage.styles.js.map +0 -1
  987. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/timerUtils.d.ts +0 -17
  988. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/timerUtils.js +0 -30
  989. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/timerUtils.js.map +0 -1
  990. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DtmfDialerButton.d.ts +0 -18
  991. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DtmfDialerButton.js +0 -41
  992. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DtmfDialerButton.js.map +0 -1
  993. package/dist/dist-esm/react-composites/src/composites/common/StarSurvey.d.ts +0 -6
  994. package/dist/dist-esm/react-composites/src/composites/common/StarSurvey.js +0 -29
  995. package/dist/dist-esm/react-composites/src/composites/common/StarSurvey.js.map +0 -1
  996. package/dist/dist-esm/react-composites/src/composites/common/SurveyPane.d.ts +0 -13
  997. package/dist/dist-esm/react-composites/src/composites/common/SurveyPane.js +0 -87
  998. package/dist/dist-esm/react-composites/src/composites/common/SurveyPane.js.map +0 -1
  999. package/dist/dist-esm/react-composites/src/composites/common/SurveyPaneContent.d.ts +0 -13
  1000. package/dist/dist-esm/react-composites/src/composites/common/SurveyPaneContent.js +0 -44
  1001. package/dist/dist-esm/react-composites/src/composites/common/SurveyPaneContent.js.map +0 -1
  1002. package/dist/dist-esm/react-composites/src/composites/common/TagsSurvey.d.ts +0 -8
  1003. package/dist/dist-esm/react-composites/src/composites/common/TagsSurvey.js +0 -23
  1004. package/dist/dist-esm/react-composites/src/composites/common/TagsSurvey.js.map +0 -1
@@ -25,10 +25,11 @@ enablePatches();
25
25
  * @private
26
26
  */
27
27
  export class ChatContext {
28
- constructor(maxListeners,
29
- /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ credential) {
28
+ constructor(maxListeners, /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ credential) {
30
29
  this._state = {
31
- userId: { id: '' },
30
+ userId: {
31
+ id: ''
32
+ },
32
33
  displayName: '',
33
34
  threads: {},
34
35
  latestErrors: {}
@@ -109,7 +110,9 @@ export class ChatContext {
109
110
  }
110
111
  const thread = draft.threads[threadId];
111
112
  if (thread && !thread.properties) {
112
- thread.properties = { topic: topic };
113
+ thread.properties = {
114
+ topic: topic
115
+ };
113
116
  }
114
117
  else if (thread && thread.properties) {
115
118
  thread.properties.topic = topic;
@@ -198,7 +201,7 @@ export class ChatContext {
198
201
  var _a;
199
202
  const participants = (_a = draft.threads[threadId]) === null || _a === void 0 ? void 0 : _a.participants;
200
203
  if (participants) {
201
- participantIds.forEach((id) => {
204
+ participantIds.forEach(id => {
202
205
  delete participants[toFlatCommunicationIdentifier(id)];
203
206
  });
204
207
  }
@@ -234,7 +237,7 @@ export class ChatContext {
234
237
  let isTypingActive = false;
235
238
  this.modifyState((draft) => {
236
239
  for (const thread of Object.values(draft.threads)) {
237
- const filteredTypingIndicators = thread.typingIndicators.filter((typingIndicator) => {
240
+ const filteredTypingIndicators = thread.typingIndicators.filter(typingIndicator => {
238
241
  const timeGap = Date.now() - typingIndicator.receivedOn.getTime();
239
242
  return timeGap < Constants.TYPING_INDICATOR_MAINTAIN_TIME;
240
243
  });
@@ -289,9 +292,7 @@ export class ChatContext {
289
292
  var _a;
290
293
  const attachments = (_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments;
291
294
  if (message.type === 'html' && attachments && attachments.length > 0) {
292
- if (this._messageQueue &&
293
- !this._messageQueue.containsMessageWithSameAttachments(message) &&
294
- message.resourceCache === undefined) {
295
+ if (this._messageQueue && !this._messageQueue.containsMessageWithSameAttachments(message) && message.resourceCache === undefined) {
295
296
  // Need to discuss retry logic in case of failure
296
297
  this._messageQueue.addMessage(message);
297
298
  this._messageQueue.startQueue(threadId, requestAttachments);
@@ -351,7 +352,7 @@ export class ChatContext {
351
352
  }
352
353
  const typingIndicators = thread.typingIndicators;
353
354
  const userIdAsKey = toFlatCommunicationIdentifier(userId);
354
- const filteredTypingIndicators = typingIndicators.filter((typingIndicator) => toFlatCommunicationIdentifier(typingIndicator.sender) !== userIdAsKey);
355
+ const filteredTypingIndicators = typingIndicators.filter(typingIndicator => toFlatCommunicationIdentifier(typingIndicator.sender) !== userIdAsKey);
355
356
  if (filteredTypingIndicators.length !== typingIndicators.length) {
356
357
  thread.typingIndicators = filteredTypingIndicators;
357
358
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ChatContext.js","sourceRoot":"","sources":["../../../../../chat-stateful-client/src/ChatContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC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7D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,MAAM,WAAW,GAAG,CAAC,MAAuB,EAAE,KAAc,EAAa,EAAE;IACzE,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport EventEmitter from 'events';\nimport { enableMapSet, enablePatches, produce, Patch } from 'immer';\nimport {\n ChatClientState,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget,\n ChatError\n} from './ChatClientState';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\nimport { ChatMessageReadReceipt, ChatParticipant } from '@azure/communication-chat';\nimport { CommunicationIdentifierKind, UnknownIdentifierKind } from '@azure/communication-common';\nimport { AzureLogger, createClientLogger, getLogLevel } from '@azure/logger';\nimport { _safeJSONStringify, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { Constants } from './Constants';\nimport { TypingIndicatorReceivedEvent } from '@azure/communication-chat';\nimport { chatStatefulLogger } from './Logger';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport type { CommunicationTokenCredential } from '@azure/communication-common';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ResourceDownloadQueue, requestAttachments } from './ResourceDownloadQueue';\n\nenableMapSet();\n// Needed to generate state diff for verbose logging.\nenablePatches();\n\n/**\n * @private\n */\nexport class ChatContext {\n private _state: ChatClientState = {\n userId: { id: '' } as UnknownIdentifierKind,\n displayName: '',\n threads: {},\n latestErrors: {} as ChatErrors\n };\n private _batchMode = false;\n private _logger: AzureLogger;\n private _emitter: EventEmitter;\n private typingIndicatorInterval: number | undefined = undefined;\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n private _messageQueue: ResourceDownloadQueue | undefined = undefined;\n\n constructor(\n maxListeners?: number,\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ credential?: CommunicationTokenCredential\n ) {\n this._logger = createClientLogger('communication-react:chat-context');\n this._emitter = new EventEmitter();\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n if (credential) {\n this._messageQueue = new ResourceDownloadQueue(this, credential);\n }\n if (maxListeners) {\n this._emitter.setMaxListeners(maxListeners);\n }\n }\n\n public getState(): ChatClientState {\n return this._state;\n }\n\n public modifyState(modifier: (draft: ChatClientState) => void): void {\n const priorState = this._state;\n this._state = produce(this._state, modifier, (patches: Patch[]) => {\n if (getLogLevel() === 'verbose') {\n // Log to `info` because AzureLogger.verbose() doesn't show up in console.\n this._logger.info(`State change: ${_safeJSONStringify(patches)}`);\n }\n });\n if (!this._batchMode && this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n }\n\n public setThread(threadId: string, threadState: ChatThreadClientState): void {\n this.modifyState((draft: ChatClientState) => {\n draft.threads[threadId] = threadState;\n });\n }\n\n public createThread(threadId: string, properties?: ChatThreadProperties): void {\n this.modifyState((draft: ChatClientState) => {\n draft.threads[threadId] = {\n chatMessages: {},\n threadId: threadId,\n properties: properties,\n participants: {},\n readReceipts: [],\n typingIndicators: [],\n latestReadTime: new Date(0)\n };\n });\n }\n\n public updateChatConfig(userId: CommunicationIdentifierKind, displayName: string): void {\n this.modifyState((draft: ChatClientState) => {\n draft.displayName = displayName;\n draft.userId = userId;\n });\n }\n\n public createThreadIfNotExist(threadId: string, properties?: ChatThreadProperties): boolean {\n const exists = Object.prototype.hasOwnProperty.call(this.getState().threads, threadId);\n if (!exists) {\n this.createThread(threadId, properties);\n return true;\n }\n return false;\n }\n\n public updateThread(threadId: string, properties?: ChatThreadProperties): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n thread.properties = properties;\n }\n });\n }\n\n public updateThreadTopic(threadId: string, topic?: string): void {\n this.modifyState((draft: ChatClientState) => {\n if (topic === undefined) {\n return;\n }\n const thread = draft.threads[threadId];\n if (thread && !thread.properties) {\n thread.properties = { topic: topic };\n } else if (thread && thread.properties) {\n thread.properties.topic = topic;\n }\n });\n }\n\n public deleteThread(threadId: string): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n delete draft.threads[threadId];\n }\n });\n }\n\n public setChatMessages(threadId: string, messages: { [key: string]: ChatMessageWithStatus }): void {\n this.modifyState((draft: ChatClientState) => {\n const threadState = draft.threads[threadId];\n if (threadState) {\n threadState.chatMessages = messages;\n }\n\n // remove typing indicator when receive messages\n const thread = draft.threads[threadId];\n if (thread) {\n for (const message of Object.values(messages)) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n }\n });\n }\n\n public updateChatMessageContent(threadId: string, messagesId: string, content: string | undefined): void {\n this.modifyState((draft: ChatClientState) => {\n const chatMessage = draft.threads[threadId]?.chatMessages[messagesId];\n if (chatMessage) {\n if (!chatMessage.content) {\n chatMessage.content = {};\n }\n chatMessage.content.message = content;\n }\n });\n }\n\n public deleteLocalMessage(threadId: string, localId: string): boolean {\n let localMessageDeleted = false;\n this.modifyState((draft: ChatClientState) => {\n const chatMessages = draft.threads[threadId]?.chatMessages;\n const message: ChatMessageWithStatus | undefined = chatMessages ? chatMessages[localId] : undefined;\n if (chatMessages && message && message.clientMessageId) {\n delete chatMessages[message.clientMessageId];\n localMessageDeleted = true;\n }\n });\n return localMessageDeleted;\n }\n\n public deleteMessage(threadId: string, id: string): void {\n this.modifyState((draft: ChatClientState) => {\n const chatMessages = draft.threads[threadId]?.chatMessages;\n if (chatMessages) {\n delete chatMessages[id];\n }\n });\n }\n\n public setParticipant(threadId: string, participant: ChatParticipant): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n participants[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n });\n }\n\n public setParticipants(threadId: string, participants: ChatParticipant[]): void {\n this.modifyState((draft: ChatClientState) => {\n const participantsMap = draft.threads[threadId]?.participants;\n if (participantsMap) {\n for (const participant of participants) {\n participantsMap[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n }\n });\n }\n\n public deleteParticipants(threadId: string, participantIds: CommunicationIdentifierKind[]): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n participantIds.forEach((id) => {\n delete participants[toFlatCommunicationIdentifier(id)];\n });\n }\n });\n }\n\n public deleteParticipant(threadId: string, participantId: CommunicationIdentifierKind): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n delete participants[toFlatCommunicationIdentifier(participantId)];\n }\n });\n }\n\n public addReadReceipt(threadId: string, readReceipt: ChatMessageReadReceipt): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n const readReceipts = thread?.readReceipts;\n if (thread && readReceipts) {\n // TODO(prprabhu): Replace `this.getState()` with `draft`?\n if (readReceipt.sender !== this.getState().userId && thread.latestReadTime < readReceipt.readOn) {\n thread.latestReadTime = readReceipt.readOn;\n }\n readReceipts.push(readReceipt);\n }\n });\n }\n\n private startTypingIndicatorCleanUp(): void {\n if (this.typingIndicatorInterval) {\n return;\n }\n this.typingIndicatorInterval = window.setInterval(() => {\n let isTypingActive = false;\n this.modifyState((draft: ChatClientState) => {\n for (const thread of Object.values(draft.threads)) {\n const filteredTypingIndicators = thread.typingIndicators.filter((typingIndicator) => {\n const timeGap = Date.now() - typingIndicator.receivedOn.getTime();\n return timeGap < Constants.TYPING_INDICATOR_MAINTAIN_TIME;\n });\n\n if (thread.typingIndicators.length !== filteredTypingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n if (thread.typingIndicators.length > 0) {\n isTypingActive = true;\n }\n }\n });\n\n if (!isTypingActive && this.typingIndicatorInterval) {\n window.clearInterval(this.typingIndicatorInterval);\n this.typingIndicatorInterval = undefined;\n }\n }, 1000);\n }\n\n public addTypingIndicator(threadId: string, typingIndicator: TypingIndicatorReceivedEvent): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n const typingIndicators = thread.typingIndicators;\n typingIndicators.push(typingIndicator);\n }\n });\n\n // Make sure we only maintain a period of typing indicator for perf purposes\n this.startTypingIndicatorCleanUp();\n }\n\n public setChatMessage(threadId: string, message: ChatMessageWithStatus): void {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.parseAttachments(threadId, message);\n\n const { id: messageId, clientMessageId } = message;\n if (messageId || clientMessageId) {\n this.modifyState((draft: ChatClientState) => {\n const threadMessages = draft.threads[threadId]?.chatMessages;\n const isLocalIdInMap = threadMessages && clientMessageId && threadMessages[clientMessageId];\n const messageKey = !messageId || isLocalIdInMap ? clientMessageId : messageId;\n\n if (threadMessages && messageKey) {\n threadMessages[messageKey] = message;\n }\n\n // remove typing indicator when receive a message from a user\n const thread = draft.threads[threadId];\n if (thread) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n });\n }\n }\n\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n private parseAttachments(threadId: string, message: ChatMessageWithStatus): void {\n const attachments = message.content?.attachments;\n if (message.type === 'html' && attachments && attachments.length > 0) {\n if (\n this._messageQueue &&\n !this._messageQueue.containsMessageWithSameAttachments(message) &&\n message.resourceCache === undefined\n ) {\n // Need to discuss retry logic in case of failure\n this._messageQueue.addMessage(message);\n this._messageQueue.startQueue(threadId, requestAttachments);\n }\n }\n }\n\n /**\n * Tees any errors encountered in an async function to the state.\n *\n * @param f Async function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withAsyncErrorTeedToState<Args extends unknown[], R>(\n f: (...args: Args) => Promise<R>,\n target: ChatErrorTarget\n ): (...args: Args) => Promise<R> {\n return async (...args: Args): Promise<R> => {\n try {\n return await f(...args);\n } catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n\n /**\n * Tees any errors encountered in an function to the state.\n *\n * @param f Function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withErrorTeedToState<Args extends unknown[], R>(\n f: (...args: Args) => R,\n target: ChatErrorTarget\n ): (...args: Args) => R {\n return (...args: Args): R => {\n try {\n chatStatefulLogger.info(`Chat stateful client target function called: ${target}`);\n return f(...args);\n } catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n\n private setLatestError(target: ChatErrorTarget, error: ChatError): void {\n this.modifyState((draft: ChatClientState) => {\n draft.latestErrors[target] = error;\n });\n }\n\n // This is a mutating function, only use it inside of a produce() function\n private filterTypingIndicatorForUser(thread: ChatThreadClientState, userId?: CommunicationIdentifierKind): void {\n if (!userId) {\n return;\n }\n const typingIndicators = thread.typingIndicators;\n const userIdAsKey = toFlatCommunicationIdentifier(userId);\n const filteredTypingIndicators = typingIndicators.filter(\n (typingIndicator) => toFlatCommunicationIdentifier(typingIndicator.sender) !== userIdAsKey\n );\n if (filteredTypingIndicators.length !== typingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n }\n\n /**\n * Batch updates to minimize `stateChanged` events across related operations.\n *\n * - A maximum of one `stateChanged` event is emitted, at the end of the operations.\n * - No `stateChanged` event is emitted if the state did not change through the operations.\n * - In case of an exception, state is reset to the prior value and no `stateChanged` event is emitted.\n *\n * All operations finished in this batch should be synchronous.\n * This function is not reentrant -- do not call batch() from within another batch().\n */\n public batch(operations: () => void): void {\n if (this._batchMode) {\n throw new Error('batch() called from within another batch()');\n }\n\n this._batchMode = true;\n const priorState = this._state;\n try {\n operations();\n if (this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n } catch (e) {\n this._state = priorState;\n if (getLogLevel() === 'verbose') {\n this._logger.warning(`State rollback to: ${_safeJSONStringify(priorState)}`);\n }\n throw e;\n } finally {\n this._batchMode = false;\n }\n }\n\n public onStateChange(handler: (state: ChatClientState) => void): void {\n this._emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (state: ChatClientState) => void): void {\n this._emitter.off('stateChanged', handler);\n }\n}\n\nconst toChatError = (target: ChatErrorTarget, error: unknown): ChatError => {\n if (error instanceof Error) {\n return new ChatError(target, error);\n }\n return new ChatError(target, new Error(`${error}`));\n};\n"]}
1
+ {"version":3,"file":"ChatContext.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/ChatContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAS,MAAM,OAAO,CAAC;AACpE,OAAO,EAA6F,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAIzI,OAAO,EAAe,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,gCAAgC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,uEAAuE;AACvE,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACpF,YAAY,EAAE,CAAC;AACf,qDAAqD;AACrD,aAAa,EAAE,CAAC;AAEhB;;GAEG;AACH,MAAM,OAAO,WAAW;IAetB,YAAY,YAAqB,EAAE,uEAAuE,CAAA,UAAyC;QAd3I,WAAM,GAA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AAC;gBAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;YACzB,IAAI,WAAW,EAAE,KAAK,SAAS,EAAE,CAAC;gBAChC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,sBAAsB,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YAC/E,CAAC;YACD,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC;IACM,aAAa,CAAC,OAAyC;QAC5D,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IACM,cAAc,CAAC,OAAyC;QAC7D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF;AACD,MAAM,WAAW,GAAG,CAAC,MAAuB,EAAE,KAAc,EAAa,EAAE;IACzE,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport EventEmitter from 'events';\nimport { enableMapSet, enablePatches, produce, Patch } from 'immer';\nimport { ChatClientState, ChatErrors, ChatThreadClientState, ChatThreadProperties, ChatErrorTarget, ChatError } from './ChatClientState';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\nimport { ChatMessageReadReceipt, ChatParticipant } from '@azure/communication-chat';\nimport { CommunicationIdentifierKind, UnknownIdentifierKind } from '@azure/communication-common';\nimport { AzureLogger, createClientLogger, getLogLevel } from '@azure/logger';\nimport { _safeJSONStringify, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { Constants } from './Constants';\nimport { TypingIndicatorReceivedEvent } from '@azure/communication-chat';\nimport { chatStatefulLogger } from './Logger';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport type { CommunicationTokenCredential } from '@azure/communication-common';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ResourceDownloadQueue, requestAttachments } from './ResourceDownloadQueue';\nenableMapSet();\n// Needed to generate state diff for verbose logging.\nenablePatches();\n\n/**\n * @private\n */\nexport class ChatContext {\n private _state: ChatClientState = {\n userId: ({\n id: ''\n } as UnknownIdentifierKind),\n displayName: '',\n threads: {},\n latestErrors: ({} as ChatErrors)\n };\n private _batchMode = false;\n private _logger: AzureLogger;\n private _emitter: EventEmitter;\n private typingIndicatorInterval: number | undefined = undefined;\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n private _messageQueue: ResourceDownloadQueue | undefined = undefined;\n constructor(maxListeners?: number, /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */credential?: CommunicationTokenCredential) {\n this._logger = createClientLogger('communication-react:chat-context');\n this._emitter = new EventEmitter();\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n if (credential) {\n this._messageQueue = new ResourceDownloadQueue(this, credential);\n }\n if (maxListeners) {\n this._emitter.setMaxListeners(maxListeners);\n }\n }\n public getState(): ChatClientState {\n return this._state;\n }\n public modifyState(modifier: (draft: ChatClientState) => void): void {\n const priorState = this._state;\n this._state = produce(this._state, modifier, (patches: Patch[]) => {\n if (getLogLevel() === 'verbose') {\n // Log to `info` because AzureLogger.verbose() doesn't show up in console.\n this._logger.info(`State change: ${_safeJSONStringify(patches)}`);\n }\n });\n if (!this._batchMode && this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n }\n public setThread(threadId: string, threadState: ChatThreadClientState): void {\n this.modifyState((draft: ChatClientState) => {\n draft.threads[threadId] = threadState;\n });\n }\n public createThread(threadId: string, properties?: ChatThreadProperties): void {\n this.modifyState((draft: ChatClientState) => {\n draft.threads[threadId] = {\n chatMessages: {},\n threadId: threadId,\n properties: properties,\n participants: {},\n readReceipts: [],\n typingIndicators: [],\n latestReadTime: new Date(0)\n };\n });\n }\n public updateChatConfig(userId: CommunicationIdentifierKind, displayName: string): void {\n this.modifyState((draft: ChatClientState) => {\n draft.displayName = displayName;\n draft.userId = userId;\n });\n }\n public createThreadIfNotExist(threadId: string, properties?: ChatThreadProperties): boolean {\n const exists = Object.prototype.hasOwnProperty.call(this.getState().threads, threadId);\n if (!exists) {\n this.createThread(threadId, properties);\n return true;\n }\n return false;\n }\n public updateThread(threadId: string, properties?: ChatThreadProperties): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n thread.properties = properties;\n }\n });\n }\n public updateThreadTopic(threadId: string, topic?: string): void {\n this.modifyState((draft: ChatClientState) => {\n if (topic === undefined) {\n return;\n }\n const thread = draft.threads[threadId];\n if (thread && !thread.properties) {\n thread.properties = {\n topic: topic\n };\n } else if (thread && thread.properties) {\n thread.properties.topic = topic;\n }\n });\n }\n public deleteThread(threadId: string): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n delete draft.threads[threadId];\n }\n });\n }\n public setChatMessages(threadId: string, messages: {\n [key: string]: ChatMessageWithStatus;\n }): void {\n this.modifyState((draft: ChatClientState) => {\n const threadState = draft.threads[threadId];\n if (threadState) {\n threadState.chatMessages = messages;\n }\n\n // remove typing indicator when receive messages\n const thread = draft.threads[threadId];\n if (thread) {\n for (const message of Object.values(messages)) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n }\n });\n }\n public updateChatMessageContent(threadId: string, messagesId: string, content: string | undefined): void {\n this.modifyState((draft: ChatClientState) => {\n const chatMessage = draft.threads[threadId]?.chatMessages[messagesId];\n if (chatMessage) {\n if (!chatMessage.content) {\n chatMessage.content = {};\n }\n chatMessage.content.message = content;\n }\n });\n }\n public deleteLocalMessage(threadId: string, localId: string): boolean {\n let localMessageDeleted = false;\n this.modifyState((draft: ChatClientState) => {\n const chatMessages = draft.threads[threadId]?.chatMessages;\n const message: ChatMessageWithStatus | undefined = chatMessages ? chatMessages[localId] : undefined;\n if (chatMessages && message && message.clientMessageId) {\n delete chatMessages[message.clientMessageId];\n localMessageDeleted = true;\n }\n });\n return localMessageDeleted;\n }\n public deleteMessage(threadId: string, id: string): void {\n this.modifyState((draft: ChatClientState) => {\n const chatMessages = draft.threads[threadId]?.chatMessages;\n if (chatMessages) {\n delete chatMessages[id];\n }\n });\n }\n public setParticipant(threadId: string, participant: ChatParticipant): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n participants[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n });\n }\n public setParticipants(threadId: string, participants: ChatParticipant[]): void {\n this.modifyState((draft: ChatClientState) => {\n const participantsMap = draft.threads[threadId]?.participants;\n if (participantsMap) {\n for (const participant of participants) {\n participantsMap[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n }\n });\n }\n public deleteParticipants(threadId: string, participantIds: CommunicationIdentifierKind[]): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n participantIds.forEach(id => {\n delete participants[toFlatCommunicationIdentifier(id)];\n });\n }\n });\n }\n public deleteParticipant(threadId: string, participantId: CommunicationIdentifierKind): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n delete participants[toFlatCommunicationIdentifier(participantId)];\n }\n });\n }\n public addReadReceipt(threadId: string, readReceipt: ChatMessageReadReceipt): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n const readReceipts = thread?.readReceipts;\n if (thread && readReceipts) {\n // TODO(prprabhu): Replace `this.getState()` with `draft`?\n if (readReceipt.sender !== this.getState().userId && thread.latestReadTime < readReceipt.readOn) {\n thread.latestReadTime = readReceipt.readOn;\n }\n readReceipts.push(readReceipt);\n }\n });\n }\n private startTypingIndicatorCleanUp(): void {\n if (this.typingIndicatorInterval) {\n return;\n }\n this.typingIndicatorInterval = window.setInterval(() => {\n let isTypingActive = false;\n this.modifyState((draft: ChatClientState) => {\n for (const thread of Object.values(draft.threads)) {\n const filteredTypingIndicators = thread.typingIndicators.filter(typingIndicator => {\n const timeGap = Date.now() - typingIndicator.receivedOn.getTime();\n return timeGap < Constants.TYPING_INDICATOR_MAINTAIN_TIME;\n });\n if (thread.typingIndicators.length !== filteredTypingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n if (thread.typingIndicators.length > 0) {\n isTypingActive = true;\n }\n }\n });\n if (!isTypingActive && this.typingIndicatorInterval) {\n window.clearInterval(this.typingIndicatorInterval);\n this.typingIndicatorInterval = undefined;\n }\n }, 1000);\n }\n public addTypingIndicator(threadId: string, typingIndicator: TypingIndicatorReceivedEvent): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n const typingIndicators = thread.typingIndicators;\n typingIndicators.push(typingIndicator);\n }\n });\n\n // Make sure we only maintain a period of typing indicator for perf purposes\n this.startTypingIndicatorCleanUp();\n }\n public setChatMessage(threadId: string, message: ChatMessageWithStatus): void {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.parseAttachments(threadId, message);\n const {\n id: messageId,\n clientMessageId\n } = message;\n if (messageId || clientMessageId) {\n this.modifyState((draft: ChatClientState) => {\n const threadMessages = draft.threads[threadId]?.chatMessages;\n const isLocalIdInMap = threadMessages && clientMessageId && threadMessages[clientMessageId];\n const messageKey = !messageId || isLocalIdInMap ? clientMessageId : messageId;\n if (threadMessages && messageKey) {\n threadMessages[messageKey] = message;\n }\n\n // remove typing indicator when receive a message from a user\n const thread = draft.threads[threadId];\n if (thread) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n });\n }\n }\n\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n private parseAttachments(threadId: string, message: ChatMessageWithStatus): void {\n const attachments = message.content?.attachments;\n if (message.type === 'html' && attachments && attachments.length > 0) {\n if (this._messageQueue && !this._messageQueue.containsMessageWithSameAttachments(message) && message.resourceCache === undefined) {\n // Need to discuss retry logic in case of failure\n this._messageQueue.addMessage(message);\n this._messageQueue.startQueue(threadId, requestAttachments);\n }\n }\n }\n\n /**\n * Tees any errors encountered in an async function to the state.\n *\n * @param f Async function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withAsyncErrorTeedToState<Args extends unknown[], R>(f: (...args: Args) => Promise<R>, target: ChatErrorTarget): (...args: Args) => Promise<R> {\n return async (...args: Args): Promise<R> => {\n try {\n return await f(...args);\n } catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n\n /**\n * Tees any errors encountered in an function to the state.\n *\n * @param f Function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withErrorTeedToState<Args extends unknown[], R>(f: (...args: Args) => R, target: ChatErrorTarget): (...args: Args) => R {\n return (...args: Args): R => {\n try {\n chatStatefulLogger.info(`Chat stateful client target function called: ${target}`);\n return f(...args);\n } catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n private setLatestError(target: ChatErrorTarget, error: ChatError): void {\n this.modifyState((draft: ChatClientState) => {\n draft.latestErrors[target] = error;\n });\n }\n\n // This is a mutating function, only use it inside of a produce() function\n private filterTypingIndicatorForUser(thread: ChatThreadClientState, userId?: CommunicationIdentifierKind): void {\n if (!userId) {\n return;\n }\n const typingIndicators = thread.typingIndicators;\n const userIdAsKey = toFlatCommunicationIdentifier(userId);\n const filteredTypingIndicators = typingIndicators.filter(typingIndicator => toFlatCommunicationIdentifier(typingIndicator.sender) !== userIdAsKey);\n if (filteredTypingIndicators.length !== typingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n }\n\n /**\n * Batch updates to minimize `stateChanged` events across related operations.\n *\n * - A maximum of one `stateChanged` event is emitted, at the end of the operations.\n * - No `stateChanged` event is emitted if the state did not change through the operations.\n * - In case of an exception, state is reset to the prior value and no `stateChanged` event is emitted.\n *\n * All operations finished in this batch should be synchronous.\n * This function is not reentrant -- do not call batch() from within another batch().\n */\n public batch(operations: () => void): void {\n if (this._batchMode) {\n throw new Error('batch() called from within another batch()');\n }\n this._batchMode = true;\n const priorState = this._state;\n try {\n operations();\n if (this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n } catch (e) {\n this._state = priorState;\n if (getLogLevel() === 'verbose') {\n this._logger.warning(`State rollback to: ${_safeJSONStringify(priorState)}`);\n }\n throw e;\n } finally {\n this._batchMode = false;\n }\n }\n public onStateChange(handler: (state: ChatClientState) => void): void {\n this._emitter.on('stateChanged', handler);\n }\n public offStateChange(handler: (state: ChatClientState) => void): void {\n this._emitter.off('stateChanged', handler);\n }\n}\nconst toChatError = (target: ChatErrorTarget, error: unknown): ChatError => {\n if (error instanceof Error) {\n return new ChatError(target, error);\n }\n return new ChatError(target, new Error(`${error}`));\n};"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../../../chat-stateful-client/src/Constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,8BAA8B,EAAE,CAAC,GAAG,IAAI;IACxC,UAAU,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC;CACxB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @private\n */\nexport const Constants = {\n TYPING_INDICATOR_MAINTAIN_TIME: 8 * 1000,\n DUMMY_DATE: new Date(0)\n};\n"]}
1
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/Constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,8BAA8B,EAAE,CAAC,GAAG,IAAI;IACxC,UAAU,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC;CACxB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @private\n */\nexport const Constants = {\n TYPING_INDICATOR_MAINTAIN_TIME: 8 * 1000,\n DUMMY_DATE: new Date(0)\n};"]}
@@ -38,7 +38,8 @@ export class EventSubscriber {
38
38
  type: this.convertEventType(event.type),
39
39
  sender: event.sender,
40
40
  senderDisplayName: event.senderDisplayName,
41
- sequenceId: '', // Note: there is a bug in chatMessageReceived event that it is missing sequenceId
41
+ sequenceId: '',
42
+ // Note: there is a bug in chatMessageReceived event that it is missing sequenceId
42
43
  createdOn: new Date(event.createdOn),
43
44
  editedOn: 'editedOn' in event ? event.editedOn : undefined,
44
45
  metadata: event.metadata
@@ -82,7 +83,7 @@ export class EventSubscriber {
82
83
  this.chatContext.setChatMessage(event.threadId, convertChatMessage(editedMessage));
83
84
  };
84
85
  this.onParticipantsAdded = (event) => {
85
- const participantsToAdd = event.participantsAdded.map((participant) => (Object.assign(Object.assign({}, participant), { shareHistoryTime: participant.shareHistoryTime ? new Date(participant.shareHistoryTime) : undefined })));
86
+ const participantsToAdd = event.participantsAdded.map(participant => (Object.assign(Object.assign({}, participant), { shareHistoryTime: participant.shareHistoryTime ? new Date(participant.shareHistoryTime) : undefined })));
86
87
  this.chatContext.batch(() => {
87
88
  this.chatContext.createThreadIfNotExist(event.threadId);
88
89
  this.chatContext.setParticipants(event.threadId, participantsToAdd);
@@ -94,9 +95,9 @@ export class EventSubscriber {
94
95
  this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter(this, void 0, void 0, function* () {
95
96
  var _a, e_1, _b, _c;
96
97
  try {
97
- for (var _d = true, _e = __asyncValues(this.chatClient
98
- .getChatThreadClient(threadId)
99
- .listMessages({ startTime: new Date(Date.now() - maxSyncTimeInMs) })), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
98
+ for (var _d = true, _e = __asyncValues(this.chatClient.getChatThreadClient(threadId).listMessages({
99
+ startTime: new Date(Date.now() - maxSyncTimeInMs)
100
+ })), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
100
101
  _c = _f.value;
101
102
  _d = false;
102
103
  const message = _c;
@@ -114,14 +115,14 @@ export class EventSubscriber {
114
115
  }
115
116
  });
116
117
  this.onParticipantsRemoved = (event) => {
117
- const participantIds = event.participantsRemoved.map((participant) => {
118
+ const participantIds = event.participantsRemoved.map(participant => {
118
119
  return participant.id;
119
120
  });
120
121
  this.chatContext.deleteParticipants(event.threadId, participantIds);
121
122
  // If the current user is removed from the thread, do not fetch the last participant message
122
123
  // as they no longer have access to the thread.
123
124
  const currentUserId = toFlatCommunicationIdentifier(this.chatContext.getState().userId);
124
- const wasCurrentUserRemoved = participantIds.find((id) => toFlatCommunicationIdentifier(id) === currentUserId);
125
+ const wasCurrentUserRemoved = participantIds.find(id => toFlatCommunicationIdentifier(id) === currentUserId);
125
126
  if (!wasCurrentUserRemoved) {
126
127
  this.fetchLastParticipantMessage(event.threadId, 'participantRemoved');
127
128
  }
@@ -151,7 +152,9 @@ export class EventSubscriber {
151
152
  this.chatContext.deleteThread(event.threadId);
152
153
  };
153
154
  this.onChatThreadPropertiesUpdated = (event) => {
154
- this.chatContext.updateThread(event.threadId, { topic: event.properties.topic });
155
+ this.chatContext.updateThread(event.threadId, {
156
+ topic: event.properties.topic
157
+ });
155
158
  };
156
159
  this.subscribe = () => {
157
160
  this.chatClient.on('chatMessageReceived', this.onChatMessageReceived);
@@ -1 +1 @@
1
- {"version":3,"file":"EventSubscriber.js","sourceRoot":"","sources":["../../../../../chat-stateful-client/src/EventSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;AAelC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,iEAAiE;AACjE,wEAAwE;AACxE,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,CAAC;AAElC;;GAEG;AACH,MAAM,OAAO,eAAe;IAI1B,YAAY,UAAsB,EAAE,WAAwB;QAMpD,8BAAyB,GAAG,CAClC,KAAwD,EACjC,EAAE;YACzB,OAAO,kBAAkB,CAAC;gBACxB,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,OAAO,EAAE;oBACP,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,uEAAuE;oBACvE,WAAW,EAAE,KAAK,CAAC,WAAW;iBAC/B;gBACD,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC;gBACvC,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;gBAC1C,UAAU,EAAE,EAAE,EAAE,kFAAkF;gBAClG,SAAS,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;gBACpC,QAAQ,EAAE,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;gBAC1D,QAAQ,EAAE,KAAK,CAAC,QAAQ;aACzB,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,gGAAgG;QACxF,qBAAgB,GAAG,CAAC,IAAY,EAAmB,EAAE;YAC3D,MAAM,aAAa,GAAG,IAAI,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CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;YAEvE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;YACvE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,yBAAyB,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAC;YAE/E,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC;QACzF,CAAC,CAAC;QA/KA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;CA6KF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatClient, ChatMessageReadReceipt, ChatMessageType } from '@azure/communication-chat';\nimport {\n ChatMessageDeletedEvent,\n ChatMessageEditedEvent,\n ChatMessageReceivedEvent,\n ChatThreadCreatedEvent,\n ChatThreadDeletedEvent,\n ChatThreadPropertiesUpdatedEvent,\n ParticipantsAddedEvent,\n ParticipantsRemovedEvent,\n ReadReceiptReceivedEvent,\n TypingIndicatorReceivedEvent\n} from '@azure/communication-chat';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatContext } from './ChatContext';\nimport { convertChatMessage } from './convertChatMessage';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\n\n// TODO: When we can get messageId of event from SDK, remove this\n// Maximum time to look back message list when we receive a system event\nconst maxSyncTimeInMs = 10 * 1000;\n\n/**\n * @private\n */\nexport class EventSubscriber {\n private chatClient: ChatClient;\n private chatContext: ChatContext;\n\n constructor(chatClient: ChatClient, chatContext: ChatContext) {\n this.chatClient = chatClient;\n this.chatContext = chatContext;\n this.subscribe();\n }\n\n private convertEventToChatMessage = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent\n ): ChatMessageWithStatus => {\n return convertChatMessage({\n id: event.id,\n version: event.version,\n content: {\n message: event.message,\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n attachments: event.attachments\n },\n type: this.convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '', // Note: there is a bug in chatMessageReceived event that it is missing sequenceId\n createdOn: new Date(event.createdOn),\n editedOn: 'editedOn' in event ? event.editedOn : undefined,\n metadata: event.metadata\n });\n };\n\n // convert event type to chatMessage type, only possible type is 'html' and 'text' in chat event\n private convertEventType = (type: string): ChatMessageType => {\n const lowerCaseType = type.toLowerCase();\n if (lowerCaseType === 'richtext/html' || lowerCaseType === 'html') {\n return 'html';\n } else {\n return 'text';\n }\n };\n\n private onChatMessageReceived = (event: ChatMessageReceivedEvent): void => {\n // Today we are avoiding how to render these messages. In the future we can\n // remove this condition and handle this message appropriately.\n const messageEventType = event.type.toLowerCase();\n if (messageEventType !== 'text' && messageEventType !== 'richtext/html' && messageEventType !== 'html') {\n return;\n }\n\n const newMessage = this.convertEventToChatMessage(event);\n\n // Because of bug in chatMessageReceived event, if we already have that particular message in context, we want to\n // make sure to not overwrite the sequenceId when calling setChatMessage.\n const existingMessage = this.chatContext.getState().threads[event.threadId]?.chatMessages[event.id];\n if (existingMessage) {\n newMessage.sequenceId = existingMessage.sequenceId;\n }\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setChatMessage(event.threadId, newMessage);\n });\n };\n\n private onChatMessageDeleted = (event: ChatMessageDeletedEvent): void => {\n this.chatContext.deleteMessage(event.threadId, event.id);\n };\n\n private onChatMessageEdited = (event: ChatMessageEditedEvent): void => {\n const editedMessage = this.convertEventToChatMessage(event);\n this.chatContext.setChatMessage(event.threadId, convertChatMessage(editedMessage));\n };\n\n private onParticipantsAdded = (event: ParticipantsAddedEvent): void => {\n const participantsToAdd = event.participantsAdded.map((participant) => ({\n ...participant,\n shareHistoryTime: participant.shareHistoryTime ? new Date(participant.shareHistoryTime) : undefined\n }));\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setParticipants(event.threadId, participantsToAdd);\n });\n this.fetchLastParticipantMessage(event.threadId, 'participantAdded');\n };\n\n // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.\n // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.\n private fetchLastParticipantMessage = async (\n threadId: string,\n actionType: 'participantAdded' | 'participantRemoved'\n ): Promise<void> => {\n for await (const message of this.chatClient\n .getChatThreadClient(threadId)\n .listMessages({ startTime: new Date(Date.now() - maxSyncTimeInMs) })) {\n if (message.type === actionType) {\n this.chatContext.setChatMessage(threadId, { ...message, status: 'delivered' });\n }\n }\n };\n\n private onParticipantsRemoved = (event: ParticipantsRemovedEvent): void => {\n const participantIds = event.participantsRemoved.map((participant) => {\n return participant.id;\n });\n this.chatContext.deleteParticipants(event.threadId, participantIds);\n\n // If the current user is removed from the thread, do not fetch the last participant message\n // as they no longer have access to the thread.\n const currentUserId = toFlatCommunicationIdentifier(this.chatContext.getState().userId);\n const wasCurrentUserRemoved = participantIds.find((id) => toFlatCommunicationIdentifier(id) === currentUserId);\n if (!wasCurrentUserRemoved) {\n this.fetchLastParticipantMessage(event.threadId, 'participantRemoved');\n }\n };\n\n private onReadReceiptReceived = (event: ReadReceiptReceivedEvent): void => {\n const readReceipt: ChatMessageReadReceipt = {\n ...event,\n sender: event.sender,\n readOn: new Date(event.readOn)\n };\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.addReadReceipt(event.threadId, readReceipt);\n });\n };\n\n private onTypingIndicatorReceived = (typingIndicator: TypingIndicatorReceivedEvent): void => {\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(typingIndicator.threadId);\n this.chatContext.addTypingIndicator(typingIndicator.threadId, typingIndicator);\n });\n };\n\n private onChatThreadCreated = (event: ChatThreadCreatedEvent): void => {\n const properties = {\n topic: event.properties.topic\n };\n if (!this.chatContext.createThreadIfNotExist(event.threadId, properties)) {\n this.chatContext.updateThread(event.threadId, properties);\n }\n };\n\n private onChatThreadDeleted = (event: ChatThreadDeletedEvent): void => {\n this.chatContext.deleteThread(event.threadId);\n };\n\n private onChatThreadPropertiesUpdated = (event: ChatThreadPropertiesUpdatedEvent): void => {\n this.chatContext.updateThread(event.threadId, { topic: event.properties.topic });\n };\n\n public subscribe = (): void => {\n this.chatClient.on('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.on('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.on('chatMessageEdited', this.onChatMessageEdited);\n\n this.chatClient.on('participantsAdded', this.onParticipantsAdded);\n this.chatClient.on('participantsRemoved', this.onParticipantsRemoved);\n\n this.chatClient.on('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.on('typingIndicatorReceived', this.onTypingIndicatorReceived);\n\n this.chatClient.on('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.on('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.on('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n\n public unsubscribe = (): void => {\n this.chatClient.off('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.off('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.off('chatMessageEdited', this.onChatMessageEdited);\n\n this.chatClient.off('participantsAdded', this.onParticipantsAdded);\n this.chatClient.off('participantsRemoved', this.onParticipantsRemoved);\n\n this.chatClient.off('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.off('typingIndicatorReceived', this.onTypingIndicatorReceived);\n\n this.chatClient.off('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.off('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.off('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n}\n"]}
1
+ {"version":3,"file":"EventSubscriber.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/EventSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;AAIlC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,iEAAiE;AACjE,wEAAwE;AACxE,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,CAAC;AAElC;;GAEG;AACH,MAAM,OAAO,eAAe;IAG1B,YAAY,UAAsB,EAAE,WAAwB;QAKpD,8BAAyB,GAAG,CAAC,KAAwD,EAAyB,EAAE;YACtH,OAAO,kBAAkB,CAAC;gBACxB,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,OAAO,EAAE;oBACP,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,uEAAuE;oBACvE,WAAW,EAAE,KAAK,CAAC,WAAW;iBAC/B;gBACD,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC;gBACvC,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;gBAC1C,UAAU,EAAE,EAAE;gBACd,kFAAkF;gBAClF,SAAS,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;gBACpC,QAAQ,EAAE,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;gBAC1D,QAAQ,EAAE,KAAK,CAAC,QAAQ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I,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;YACvE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;YACvE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,yBAAyB,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAC;YAC/E,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC;QACzF,CAAC,CAAC;QA5JA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;CA0JF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatClient, ChatMessageReadReceipt, ChatMessageType } from '@azure/communication-chat';\nimport { ChatMessageDeletedEvent, ChatMessageEditedEvent, ChatMessageReceivedEvent, ChatThreadCreatedEvent, ChatThreadDeletedEvent, ChatThreadPropertiesUpdatedEvent, ParticipantsAddedEvent, ParticipantsRemovedEvent, ReadReceiptReceivedEvent, TypingIndicatorReceivedEvent } from '@azure/communication-chat';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatContext } from './ChatContext';\nimport { convertChatMessage } from './convertChatMessage';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\n\n// TODO: When we can get messageId of event from SDK, remove this\n// Maximum time to look back message list when we receive a system event\nconst maxSyncTimeInMs = 10 * 1000;\n\n/**\n * @private\n */\nexport class EventSubscriber {\n private chatClient: ChatClient;\n private chatContext: ChatContext;\n constructor(chatClient: ChatClient, chatContext: ChatContext) {\n this.chatClient = chatClient;\n this.chatContext = chatContext;\n this.subscribe();\n }\n private convertEventToChatMessage = (event: ChatMessageReceivedEvent | ChatMessageEditedEvent): ChatMessageWithStatus => {\n return convertChatMessage({\n id: event.id,\n version: event.version,\n content: {\n message: event.message,\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n attachments: event.attachments\n },\n type: this.convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '',\n // Note: there is a bug in chatMessageReceived event that it is missing sequenceId\n createdOn: new Date(event.createdOn),\n editedOn: 'editedOn' in event ? event.editedOn : undefined,\n metadata: event.metadata\n });\n };\n\n // convert event type to chatMessage type, only possible type is 'html' and 'text' in chat event\n private convertEventType = (type: string): ChatMessageType => {\n const lowerCaseType = type.toLowerCase();\n if (lowerCaseType === 'richtext/html' || lowerCaseType === 'html') {\n return 'html';\n } else {\n return 'text';\n }\n };\n private onChatMessageReceived = (event: ChatMessageReceivedEvent): void => {\n // Today we are avoiding how to render these messages. In the future we can\n // remove this condition and handle this message appropriately.\n const messageEventType = event.type.toLowerCase();\n if (messageEventType !== 'text' && messageEventType !== 'richtext/html' && messageEventType !== 'html') {\n return;\n }\n const newMessage = this.convertEventToChatMessage(event);\n\n // Because of bug in chatMessageReceived event, if we already have that particular message in context, we want to\n // make sure to not overwrite the sequenceId when calling setChatMessage.\n const existingMessage = this.chatContext.getState().threads[event.threadId]?.chatMessages[event.id];\n if (existingMessage) {\n newMessage.sequenceId = existingMessage.sequenceId;\n }\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setChatMessage(event.threadId, newMessage);\n });\n };\n private onChatMessageDeleted = (event: ChatMessageDeletedEvent): void => {\n this.chatContext.deleteMessage(event.threadId, event.id);\n };\n private onChatMessageEdited = (event: ChatMessageEditedEvent): void => {\n const editedMessage = this.convertEventToChatMessage(event);\n this.chatContext.setChatMessage(event.threadId, convertChatMessage(editedMessage));\n };\n private onParticipantsAdded = (event: ParticipantsAddedEvent): void => {\n const participantsToAdd = event.participantsAdded.map(participant => ({\n ...participant,\n shareHistoryTime: participant.shareHistoryTime ? new Date(participant.shareHistoryTime) : undefined\n }));\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setParticipants(event.threadId, participantsToAdd);\n });\n this.fetchLastParticipantMessage(event.threadId, 'participantAdded');\n };\n\n // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.\n // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.\n private fetchLastParticipantMessage = async (threadId: string, actionType: 'participantAdded' | 'participantRemoved'): Promise<void> => {\n for await (const message of this.chatClient.getChatThreadClient(threadId).listMessages({\n startTime: new Date(Date.now() - maxSyncTimeInMs)\n })) {\n if (message.type === actionType) {\n this.chatContext.setChatMessage(threadId, {\n ...message,\n status: 'delivered'\n });\n }\n }\n };\n private onParticipantsRemoved = (event: ParticipantsRemovedEvent): void => {\n const participantIds = event.participantsRemoved.map(participant => {\n return participant.id;\n });\n this.chatContext.deleteParticipants(event.threadId, participantIds);\n\n // If the current user is removed from the thread, do not fetch the last participant message\n // as they no longer have access to the thread.\n const currentUserId = toFlatCommunicationIdentifier(this.chatContext.getState().userId);\n const wasCurrentUserRemoved = participantIds.find(id => toFlatCommunicationIdentifier(id) === currentUserId);\n if (!wasCurrentUserRemoved) {\n this.fetchLastParticipantMessage(event.threadId, 'participantRemoved');\n }\n };\n private onReadReceiptReceived = (event: ReadReceiptReceivedEvent): void => {\n const readReceipt: ChatMessageReadReceipt = {\n ...event,\n sender: event.sender,\n readOn: new Date(event.readOn)\n };\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.addReadReceipt(event.threadId, readReceipt);\n });\n };\n private onTypingIndicatorReceived = (typingIndicator: TypingIndicatorReceivedEvent): void => {\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(typingIndicator.threadId);\n this.chatContext.addTypingIndicator(typingIndicator.threadId, typingIndicator);\n });\n };\n private onChatThreadCreated = (event: ChatThreadCreatedEvent): void => {\n const properties = {\n topic: event.properties.topic\n };\n if (!this.chatContext.createThreadIfNotExist(event.threadId, properties)) {\n this.chatContext.updateThread(event.threadId, properties);\n }\n };\n private onChatThreadDeleted = (event: ChatThreadDeletedEvent): void => {\n this.chatContext.deleteThread(event.threadId);\n };\n private onChatThreadPropertiesUpdated = (event: ChatThreadPropertiesUpdatedEvent): void => {\n this.chatContext.updateThread(event.threadId, {\n topic: event.properties.topic\n });\n };\n public subscribe = (): void => {\n this.chatClient.on('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.on('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.on('chatMessageEdited', this.onChatMessageEdited);\n this.chatClient.on('participantsAdded', this.onParticipantsAdded);\n this.chatClient.on('participantsRemoved', this.onParticipantsRemoved);\n this.chatClient.on('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.on('typingIndicatorReceived', this.onTypingIndicatorReceived);\n this.chatClient.on('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.on('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.on('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n public unsubscribe = (): void => {\n this.chatClient.off('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.off('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.off('chatMessageEdited', this.onChatMessageEdited);\n this.chatClient.off('participantsAdded', this.onParticipantsAdded);\n this.chatClient.off('participantsRemoved', this.onParticipantsRemoved);\n this.chatClient.off('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.off('typingIndicatorReceived', this.onTypingIndicatorReceived);\n this.chatClient.off('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.off('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.off('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../../../../chat-stateful-client/src/Logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,mCAAmC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from '@azure/logger';\n\n/**\n * @private\n */\nexport const chatStatefulLogger = createClientLogger('communication-react:chat-stateful');\n"]}
1
+ {"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/Logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,mCAAmC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from '@azure/logger';\n\n/**\n * @private\n */\nexport const chatStatefulLogger = createClientLogger('communication-react:chat-stateful');"]}
@@ -102,7 +102,9 @@ const fetchImageSource = (src, credential) => __awaiter(void 0, void 0, void 0,
102
102
  const headers = new Headers();
103
103
  headers.append('Authorization', `Bearer ${token}`);
104
104
  try {
105
- return yield fetch(url, { headers });
105
+ return yield fetch(url, {
106
+ headers
107
+ });
106
108
  }
107
109
  catch (err) {
108
110
  throw new ChatError('ChatThreadClient.getMessage', err);
@@ -1 +1 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AAC;QACR,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;IACrD,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ChatContext } from './ChatContext';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ChatError } from './ChatClientState';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport type { CommunicationTokenCredential } from '@azure/communication-common';\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * @private\n */\nexport class ResourceDownloadQueue {\n private _messagesNeedingResourceRetrieval: ChatMessageWithStatus[] = [];\n private _context: ChatContext;\n private isActive = false;\n private _credential: CommunicationTokenCredential;\n\n constructor(context: ChatContext, credential: CommunicationTokenCredential) {\n this._context = context;\n this._credential = credential;\n }\n\n public containsMessageWithSameAttachments(message: ChatMessageWithStatus): boolean {\n let contains = false;\n const incomingAttachment = message.content?.attachments;\n if (incomingAttachment) {\n for (const m of this._messagesNeedingResourceRetrieval) {\n const existingAttachment = m.content?.attachments ?? [];\n contains = incomingAttachment.every((element, index) => element === existingAttachment[index]);\n if (contains) {\n break;\n }\n }\n }\n\n return contains;\n }\n\n public addMessage(message: ChatMessageWithStatus): void {\n // make a copy of message and add to queue\n const copy = { ...message };\n this._messagesNeedingResourceRetrieval.push(copy);\n }\n\n public async startQueue(threadId: string, operation: ImageRequest): Promise<void> {\n if (this.isActive) {\n return;\n }\n\n while (this._messagesNeedingResourceRetrieval.length > 0) {\n this.isActive = true;\n const message = this._messagesNeedingResourceRetrieval.shift();\n if (!message) {\n this.isActive = false;\n continue;\n }\n\n try {\n const newMessage = await operation(message, this._credential);\n if (newMessage) {\n this.isActive = false;\n this._context.setChatMessage(threadId, newMessage);\n }\n } catch (error) {\n console.log('Downloading Resource error: ', error);\n }\n }\n }\n}\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * @private\n */\nexport const requestAttachments = async (\n message: ChatMessageWithStatus,\n credential: CommunicationTokenCredential\n): Promise<ChatMessageWithStatus> => {\n const attachments = message.content?.attachments;\n if (message.type === 'html' && attachments) {\n if (message.resourceCache === undefined) {\n message.resourceCache = {};\n }\n for (const attachment of attachments) {\n if (attachment.previewUrl) {\n const previewUrl = attachment.previewUrl;\n try {\n const src = await fetchImageSource(previewUrl, credential);\n message.resourceCache[previewUrl] = src;\n } catch (error) {\n throw new ResourceDownloadError(message);\n }\n }\n }\n }\n\n return message;\n};\n/**\n * @private\n */\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nconst fetchImageSource = async (src: string, credential: CommunicationTokenCredential): Promise<string> => {\n async function fetchWithAuthentication(url: string, token: string): Promise<Response> {\n const headers = new Headers();\n headers.append('Authorization', `Bearer ${token}`);\n try {\n return await fetch(url, { headers });\n } catch (err) {\n throw new ChatError('ChatThreadClient.getMessage', err as Error);\n }\n }\n const accessToken = await credential.getToken();\n const response = await fetchWithAuthentication(src, accessToken.token);\n const blob = await response.blob();\n return URL.createObjectURL(blob);\n};\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\ninterface ImageRequest {\n (message: ChatMessageWithStatus, credential: CommunicationTokenCredential): Promise<ChatMessageWithStatus>;\n}\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * @private\n */\nexport class ResourceDownloadError extends Error {\n public chatMessageWithStatus: ChatMessageWithStatus;\n\n constructor(chatMessageWithStatus: ChatMessageWithStatus) {\n super();\n this.chatMessageWithStatus = chatMessageWithStatus;\n }\n}\n"]}
1
+ {"version":3,"file":"ResourceDownloadQueue.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/ResourceDownloadQueue.ts"],"names":[],"mappings":";;;;;;;;;AAIA,uEAAuE;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,mB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,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,IAAI,qBAAqB,CAAC,OAAO,CAAC,CAAC;gBAC3C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAA,CAAC;AACF;;GAEG;AACH,uEAAuE;AACvE,MAAM,gBAAgB,GAAG,CAAO,GAAW,EAAE,UAAwC,EAAmB,EAAE;IACxG,SAAe,uBAAuB,CAAC,GAAW,EAAE,KAAa;;YAC/D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;YAC9B,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;YACnD,IAAI,CAAC;gBACH,OAAO,MAAM,KAAK,CAAC,GAAG,EAAE;oBACtB,OAAO;iBACR,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,IAAI,SAAS,CAAC,6BAA6B,EAAG,GAAa,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;KAAA;IACD,MAAM,WAAW,GAAG,MAAM,UAAU,CAAC,QAAQ,EAAE,CAAC;IAChD,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAAC,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IACvE,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,OAAO,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC,CAAA,CAAC;AAMF,uEAAuE;AACvE;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAE9C,YAAY,qBAA4C;QACtD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;IACrD,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ChatContext } from './ChatContext';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ChatError } from './ChatClientState';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport type { CommunicationTokenCredential } from '@azure/communication-common';\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * @private\n */\nexport class ResourceDownloadQueue {\n private _messagesNeedingResourceRetrieval: ChatMessageWithStatus[] = [];\n private _context: ChatContext;\n private isActive = false;\n private _credential: CommunicationTokenCredential;\n constructor(context: ChatContext, credential: CommunicationTokenCredential) {\n this._context = context;\n this._credential = credential;\n }\n public containsMessageWithSameAttachments(message: ChatMessageWithStatus): boolean {\n let contains = false;\n const incomingAttachment = message.content?.attachments;\n if (incomingAttachment) {\n for (const m of this._messagesNeedingResourceRetrieval) {\n const existingAttachment = m.content?.attachments ?? [];\n contains = incomingAttachment.every((element, index) => element === existingAttachment[index]);\n if (contains) {\n break;\n }\n }\n }\n return contains;\n }\n public addMessage(message: ChatMessageWithStatus): void {\n // make a copy of message and add to queue\n const copy = {\n ...message\n };\n this._messagesNeedingResourceRetrieval.push(copy);\n }\n public async startQueue(threadId: string, operation: ImageRequest): Promise<void> {\n if (this.isActive) {\n return;\n }\n while (this._messagesNeedingResourceRetrieval.length > 0) {\n this.isActive = true;\n const message = this._messagesNeedingResourceRetrieval.shift();\n if (!message) {\n this.isActive = false;\n continue;\n }\n try {\n const newMessage = await operation(message, this._credential);\n if (newMessage) {\n this.isActive = false;\n this._context.setChatMessage(threadId, newMessage);\n }\n } catch (error) {\n console.log('Downloading Resource error: ', error);\n }\n }\n }\n}\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * @private\n */\nexport const requestAttachments = async (message: ChatMessageWithStatus, credential: CommunicationTokenCredential): Promise<ChatMessageWithStatus> => {\n const attachments = message.content?.attachments;\n if (message.type === 'html' && attachments) {\n if (message.resourceCache === undefined) {\n message.resourceCache = {};\n }\n for (const attachment of attachments) {\n if (attachment.previewUrl) {\n const previewUrl = attachment.previewUrl;\n try {\n const src = await fetchImageSource(previewUrl, credential);\n message.resourceCache[previewUrl] = src;\n } catch (error) {\n throw new ResourceDownloadError(message);\n }\n }\n }\n }\n return message;\n};\n/**\n * @private\n */\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nconst fetchImageSource = async (src: string, credential: CommunicationTokenCredential): Promise<string> => {\n async function fetchWithAuthentication(url: string, token: string): Promise<Response> {\n const headers = new Headers();\n headers.append('Authorization', `Bearer ${token}`);\n try {\n return await fetch(url, {\n headers\n });\n } catch (err) {\n throw new ChatError('ChatThreadClient.getMessage', (err as Error));\n }\n }\n const accessToken = await credential.getToken();\n const response = await fetchWithAuthentication(src, accessToken.token);\n const blob = await response.blob();\n return URL.createObjectURL(blob);\n};\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\ninterface ImageRequest {\n (message: ChatMessageWithStatus, credential: CommunicationTokenCredential): Promise<ChatMessageWithStatus>;\n}\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * @private\n */\nexport class ResourceDownloadError extends Error {\n public chatMessageWithStatus: ChatMessageWithStatus;\n constructor(chatMessageWithStatus: ChatMessageWithStatus) {\n super();\n this.chatMessageWithStatus = chatMessageWithStatus;\n }\n}"]}
@@ -25,62 +25,70 @@ const proxyChatClient = {
25
25
  }
26
26
  const context = receiver.context;
27
27
  switch (prop) {
28
- case 'createChatThread': {
29
- return context.withAsyncErrorTeedToState(function (...args) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- const result = yield chatClient.createChatThread(...args);
32
- const thread = result.chatThread;
33
- if (thread) {
34
- const [request] = args;
35
- context.createThread(thread.id, { topic: request.topic });
36
- }
37
- return result;
38
- });
39
- }, 'ChatClient.createChatThread');
40
- }
41
- case 'deleteChatThread': {
42
- return context.withAsyncErrorTeedToState(function (...args) {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- const result = yield chatClient.deleteChatThread(...args);
45
- context.deleteThread(args[0]);
46
- return result;
47
- });
48
- }, 'ChatClient.deleteChatThread');
49
- }
50
- case 'listChatThreads': {
51
- return createDecoratedListThreads(chatClient, context);
52
- }
53
- case 'getChatThreadClient': {
54
- return function (...args) {
55
- const chatThreadClient = chatClient.getChatThreadClient(...args);
56
- // TODO(prprabhu): Ensure that thread properties are fetched into the ChatContext at this point.
57
- // A new thread might be created here, but the properties will never be fetched.
58
- return chatThreadClientDeclaratify(chatThreadClient, context);
59
- };
60
- }
61
- case 'startRealtimeNotifications': {
62
- return context.withAsyncErrorTeedToState(function (...args) {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- const ret = yield chatClient.startRealtimeNotifications(...args);
65
- if (!receiver.eventSubscriber) {
66
- receiver.eventSubscriber = new EventSubscriber(chatClient, context);
67
- }
68
- return ret;
69
- });
70
- }, 'ChatClient.startRealtimeNotifications');
71
- }
72
- case 'stopRealtimeNotifications': {
73
- return context.withAsyncErrorTeedToState(function (...args) {
74
- return __awaiter(this, void 0, void 0, function* () {
75
- const ret = yield chatClient.stopRealtimeNotifications(...args);
76
- if (receiver.eventSubscriber) {
77
- receiver.eventSubscriber.unsubscribe();
78
- receiver.eventSubscriber = undefined;
79
- }
80
- return ret;
81
- });
82
- }, 'ChatClient.stopRealtimeNotifications');
83
- }
28
+ case 'createChatThread':
29
+ {
30
+ return context.withAsyncErrorTeedToState(function (...args) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ const result = yield chatClient.createChatThread(...args);
33
+ const thread = result.chatThread;
34
+ if (thread) {
35
+ const [request] = args;
36
+ context.createThread(thread.id, {
37
+ topic: request.topic
38
+ });
39
+ }
40
+ return result;
41
+ });
42
+ }, 'ChatClient.createChatThread');
43
+ }
44
+ case 'deleteChatThread':
45
+ {
46
+ return context.withAsyncErrorTeedToState(function (...args) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const result = yield chatClient.deleteChatThread(...args);
49
+ context.deleteThread(args[0]);
50
+ return result;
51
+ });
52
+ }, 'ChatClient.deleteChatThread');
53
+ }
54
+ case 'listChatThreads':
55
+ {
56
+ return createDecoratedListThreads(chatClient, context);
57
+ }
58
+ case 'getChatThreadClient':
59
+ {
60
+ return function (...args) {
61
+ const chatThreadClient = chatClient.getChatThreadClient(...args);
62
+ // TODO(prprabhu): Ensure that thread properties are fetched into the ChatContext at this point.
63
+ // A new thread might be created here, but the properties will never be fetched.
64
+ return chatThreadClientDeclaratify(chatThreadClient, context);
65
+ };
66
+ }
67
+ case 'startRealtimeNotifications':
68
+ {
69
+ return context.withAsyncErrorTeedToState(function (...args) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ const ret = yield chatClient.startRealtimeNotifications(...args);
72
+ if (!receiver.eventSubscriber) {
73
+ receiver.eventSubscriber = new EventSubscriber(chatClient, context);
74
+ }
75
+ return ret;
76
+ });
77
+ }, 'ChatClient.startRealtimeNotifications');
78
+ }
79
+ case 'stopRealtimeNotifications':
80
+ {
81
+ return context.withAsyncErrorTeedToState(function (...args) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ const ret = yield chatClient.stopRealtimeNotifications(...args);
84
+ if (receiver.eventSubscriber) {
85
+ receiver.eventSubscriber.unsubscribe();
86
+ receiver.eventSubscriber = undefined;
87
+ }
88
+ return ret;
89
+ });
90
+ }, 'ChatClient.stopRealtimeNotifications');
91
+ }
84
92
  default:
85
93
  return Reflect.get(chatClient, prop);
86
94
  }
@@ -103,7 +111,9 @@ export const createStatefulChatClient = (args, options) => {
103
111
  */
104
112
  export const _createStatefulChatClientInner = (args, options, telemetryImplementationHint = 'StatefulComponents') => {
105
113
  chatStatefulLogger.info(`Creating chat stateful client using library version: ${_getApplicationId(telemetryImplementationHint)}`);
106
- const tweakedOptions = Object.assign(Object.assign({}, options), { chatClientOptions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.chatClientOptions), { userAgentOptions: { userAgentPrefix: _getApplicationId(telemetryImplementationHint) } }) });
114
+ const tweakedOptions = Object.assign(Object.assign({}, options), { chatClientOptions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.chatClientOptions), { userAgentOptions: {
115
+ userAgentPrefix: _getApplicationId(telemetryImplementationHint)
116
+ } }) });
107
117
  return _createStatefulChatClientWithDeps(new ChatClient(args.endpoint, args.credential, tweakedOptions.chatClientOptions), args, tweakedOptions);
108
118
  };
109
119
  /**
@@ -113,8 +123,7 @@ export const _createStatefulChatClientInner = (args, options, telemetryImplement
113
123
  * @internal
114
124
  */
115
125
  export const _createStatefulChatClientWithDeps = (chatClient, args, options) => {
116
- const context = new ChatContext(options === null || options === void 0 ? void 0 : options.maxStateChangeListeners,
117
- /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ args.credential);
126
+ const context = new ChatContext(options === null || options === void 0 ? void 0 : options.maxStateChangeListeners, /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ args.credential);
118
127
  let eventSubscriber;
119
128
  context.updateChatConfig(getIdentifierKind(args.userId), args.displayName);
120
129
  const proxy = new Proxy(chatClient, proxyChatClient);