@microsoft/omnichannel-chat-widget 0.1.0-main.dbc1afa → 0.1.0-main.dee03a3

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 (310) hide show
  1. package/README.md +32 -0
  2. package/lib/cjs/assets/Icons.js +4 -2
  3. package/lib/cjs/common/Constants.js +30 -163
  4. package/lib/cjs/common/KeyCodes.js +3 -4
  5. package/lib/cjs/common/contextDataStore/DataStoreManager.js +3 -5
  6. package/lib/cjs/common/storage/default/defaultCacheManager.js +26 -0
  7. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +102 -0
  8. package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +78 -0
  9. package/lib/cjs/common/telemetry/TelemetryConstants.js +48 -25
  10. package/lib/cjs/common/telemetry/TelemetryHelper.js +19 -58
  11. package/lib/cjs/common/telemetry/TelemetryManager.js +3 -32
  12. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +0 -2
  13. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +30 -36
  14. package/lib/cjs/common/telemetry/loggers/consoleLogger.js +0 -9
  15. package/lib/cjs/common/utils.js +65 -93
  16. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +8 -46
  17. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +19 -25
  18. package/lib/cjs/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
  19. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -33
  20. package/lib/cjs/components/dimlayer/DimLayer.js +0 -4
  21. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +9 -37
  22. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -8
  23. package/lib/cjs/components/footerstateful/FooterStateful.js +11 -42
  24. package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +0 -6
  25. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +14 -43
  26. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -8
  27. package/lib/cjs/components/headerstateful/HeaderStateful.js +20 -32
  28. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +2 -14
  29. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +39 -0
  30. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +20 -0
  31. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  32. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +34 -0
  33. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +64 -0
  34. package/lib/cjs/components/livechatwidget/common/Deferred.js +37 -0
  35. package/lib/cjs/components/livechatwidget/common/authHelper.js +50 -0
  36. package/lib/cjs/components/livechatwidget/common/createAdapter.js +10 -9
  37. package/lib/cjs/components/livechatwidget/common/createFooter.js +4 -23
  38. package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +10 -10
  39. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +36 -43
  40. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +14 -0
  41. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +125 -47
  42. package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +0 -3
  43. package/lib/cjs/components/livechatwidget/common/endChat.js +95 -48
  44. package/lib/cjs/components/livechatwidget/common/getGeneralStylesForButton.js +0 -6
  45. package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +7 -16
  46. package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -8
  47. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +32 -53
  48. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +76 -129
  49. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +4 -17
  50. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +2 -15
  51. package/lib/cjs/components/livechatwidget/common/shareObservable.js +41 -0
  52. package/lib/cjs/components/livechatwidget/common/startChat.js +230 -126
  53. package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +0 -8
  54. package/lib/cjs/components/livechatwidget/common/updateSessionDataForTelemetry.js +2 -11
  55. package/lib/cjs/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
  56. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +315 -205
  57. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +19 -19
  58. package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +57 -0
  59. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +4 -17
  60. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +4 -17
  61. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +32 -23
  62. package/lib/cjs/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
  63. package/lib/cjs/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +13 -0
  64. package/lib/cjs/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
  65. package/lib/cjs/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
  66. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +10 -42
  67. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +19 -33
  68. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +6 -24
  69. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +94 -19
  70. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -7
  71. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -6
  72. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +11 -0
  73. package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +12 -27
  74. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +6 -17
  75. package/lib/cjs/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -24
  76. package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +5 -15
  77. package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -8
  78. package/lib/cjs/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
  79. package/lib/cjs/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
  80. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +12 -0
  81. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -5
  82. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
  83. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
  84. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
  85. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
  86. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
  87. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
  88. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
  89. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
  90. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +0 -7
  91. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -5
  92. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +27 -37
  93. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +10 -22
  94. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +25 -61
  95. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +7 -15
  96. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +41 -0
  97. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +82 -0
  98. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +10 -0
  99. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +10 -0
  100. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -3
  101. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -3
  102. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +10 -0
  103. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -9
  104. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +89 -0
  105. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +7 -18
  106. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +8 -42
  107. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +4 -22
  108. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +13 -30
  109. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +3 -9
  110. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -34
  111. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +1 -10
  112. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +1 -12
  113. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +17 -19
  114. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +1 -9
  115. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -9
  116. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +13 -34
  117. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +1 -10
  118. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +7 -11
  119. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +5 -14
  120. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -21
  121. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +0 -12
  122. package/lib/cjs/contexts/ChatAdapterStore.js +0 -2
  123. package/lib/cjs/contexts/ChatContextStore.js +0 -2
  124. package/lib/cjs/contexts/ChatSDKStore.js +0 -2
  125. package/lib/cjs/contexts/common/ConversationState.js +3 -3
  126. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +30 -26
  127. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +13 -13
  128. package/lib/cjs/contexts/createReducer.js +164 -102
  129. package/lib/cjs/controller/componentController.js +4 -33
  130. package/lib/cjs/hooks/useChatAdapterStore.js +0 -6
  131. package/lib/cjs/hooks/useChatContextStore.js +0 -6
  132. package/lib/cjs/hooks/useChatSDKStore.js +0 -6
  133. package/lib/cjs/index.js +0 -5
  134. package/lib/cjs/plugins/newMessageEventHandler.js +15 -36
  135. package/lib/esm/assets/Icons.js +2 -1
  136. package/lib/esm/common/Constants.js +27 -150
  137. package/lib/esm/common/KeyCodes.js +3 -3
  138. package/lib/esm/common/contextDataStore/DataStoreManager.js +3 -3
  139. package/lib/esm/common/storage/default/defaultCacheManager.js +18 -0
  140. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +95 -0
  141. package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +70 -0
  142. package/lib/esm/common/telemetry/TelemetryConstants.js +52 -22
  143. package/lib/esm/common/telemetry/TelemetryHelper.js +19 -46
  144. package/lib/esm/common/telemetry/TelemetryManager.js +3 -19
  145. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +28 -24
  146. package/lib/esm/common/telemetry/loggers/consoleLogger.js +0 -5
  147. package/lib/esm/common/utils.js +61 -51
  148. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +8 -17
  149. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +22 -12
  150. package/lib/esm/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
  151. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +10 -14
  152. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +9 -16
  153. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -6
  154. package/lib/esm/components/footerstateful/FooterStateful.js +13 -23
  155. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +14 -36
  156. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -6
  157. package/lib/esm/components/headerstateful/HeaderStateful.js +20 -17
  158. package/lib/esm/components/livechatwidget/LiveChatWidget.js +2 -2
  159. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -0
  160. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +13 -0
  161. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  162. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +27 -0
  163. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +57 -0
  164. package/lib/esm/components/livechatwidget/common/Deferred.js +30 -0
  165. package/lib/esm/components/livechatwidget/common/authHelper.js +42 -0
  166. package/lib/esm/components/livechatwidget/common/createAdapter.js +12 -4
  167. package/lib/esm/components/livechatwidget/common/createFooter.js +4 -16
  168. package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +10 -5
  169. package/lib/esm/components/livechatwidget/common/createMarkdown.js +38 -37
  170. package/lib/esm/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +7 -0
  171. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +126 -33
  172. package/lib/esm/components/livechatwidget/common/endChat.js +97 -32
  173. package/lib/esm/components/livechatwidget/common/getGeneralStylesForButton.js +0 -2
  174. package/lib/esm/components/livechatwidget/common/initCallingSdk.js +9 -11
  175. package/lib/esm/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -5
  176. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +35 -22
  177. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +77 -111
  178. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +4 -9
  179. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +4 -7
  180. package/lib/esm/components/livechatwidget/common/shareObservable.js +35 -0
  181. package/lib/esm/components/livechatwidget/common/startChat.js +228 -102
  182. package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +4 -2
  183. package/lib/esm/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
  184. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +317 -148
  185. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +19 -7
  186. package/lib/esm/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +50 -0
  187. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +4 -5
  188. package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +4 -5
  189. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +32 -11
  190. package/lib/esm/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
  191. package/lib/esm/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +6 -0
  192. package/lib/esm/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
  193. package/lib/esm/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
  194. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -26
  195. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +21 -9
  196. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +6 -6
  197. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +94 -4
  198. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -1
  199. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
  200. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +4 -0
  201. package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +12 -19
  202. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +6 -13
  203. package/lib/esm/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -16
  204. package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +5 -5
  205. package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -6
  206. package/lib/esm/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
  207. package/lib/esm/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
  208. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +5 -0
  209. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -3
  210. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
  211. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
  212. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
  213. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
  214. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
  215. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
  216. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
  217. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
  218. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +2 -5
  219. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -4
  220. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +27 -22
  221. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +12 -14
  222. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +25 -39
  223. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +9 -8
  224. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +34 -0
  225. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +80 -0
  226. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +3 -0
  227. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +3 -0
  228. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -1
  229. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -1
  230. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +3 -0
  231. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -7
  232. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +83 -0
  233. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +8 -9
  234. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +9 -28
  235. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +5 -14
  236. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +15 -19
  237. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +5 -8
  238. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -29
  239. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +3 -7
  240. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +3 -8
  241. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +17 -14
  242. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +3 -7
  243. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -7
  244. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +15 -27
  245. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +3 -5
  246. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +9 -9
  247. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +7 -9
  248. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -13
  249. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +0 -5
  250. package/lib/esm/contexts/ChatAdapterStore.js +2 -1
  251. package/lib/esm/contexts/ChatContextStore.js +2 -1
  252. package/lib/esm/contexts/ChatSDKStore.js +2 -1
  253. package/lib/esm/contexts/common/ConversationState.js +3 -3
  254. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +30 -26
  255. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +13 -9
  256. package/lib/esm/contexts/createReducer.js +164 -99
  257. package/lib/esm/controller/componentController.js +5 -4
  258. package/lib/esm/hooks/useChatAdapterStore.js +0 -4
  259. package/lib/esm/hooks/useChatContextStore.js +0 -4
  260. package/lib/esm/hooks/useChatSDKStore.js +0 -4
  261. package/lib/esm/plugins/newMessageEventHandler.js +15 -26
  262. package/lib/types/assets/Icons.d.ts +1 -0
  263. package/lib/types/common/Constants.d.ts +20 -0
  264. package/lib/types/common/interfaces/IContextDataStore.d.ts +1 -1
  265. package/lib/types/common/storage/default/defaultCacheManager.d.ts +4 -0
  266. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +2 -0
  267. package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -0
  268. package/lib/types/common/telemetry/TelemetryConstants.d.ts +35 -7
  269. package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -4
  270. package/lib/types/common/utils.d.ts +7 -3
  271. package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +2 -1
  272. package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -0
  273. package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -0
  274. package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -0
  275. package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -0
  276. package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
  277. package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -0
  278. package/lib/types/components/livechatwidget/common/authHelper.d.ts +5 -0
  279. package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -0
  280. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +6 -7
  281. package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -0
  282. package/lib/types/components/livechatwidget/common/startChat.d.ts +6 -2
  283. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +2 -1
  284. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +5 -2
  285. package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -0
  286. package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -0
  287. package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +2 -2
  288. package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -0
  289. package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +4 -0
  290. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -2
  291. package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -0
  292. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +1 -0
  293. package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +4 -0
  294. package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -0
  295. package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +4 -1
  296. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +4 -0
  297. package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -0
  298. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
  299. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -0
  300. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.d.ts +1 -0
  301. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +2 -0
  302. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -0
  303. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -0
  304. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +5 -0
  305. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +1 -1
  306. package/lib/types/contexts/common/ConversationState.d.ts +3 -2
  307. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +5 -3
  308. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +30 -25
  309. package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +1 -2
  310. package/package.json +5 -4
@@ -1,5 +1,4 @@
1
1
  import React, { useCallback, useEffect, useRef } from "react";
2
- import { HtmlAttributeNames } from "../../../../../../common/Constants";
3
2
  import { KeyCodes } from "../../../../../../common/KeyCodes";
4
3
  import { Stack } from "@fluentui/react";
5
4
  import { defaultMiddlewareLocalizedTexts } from "../../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
@@ -9,11 +8,10 @@ import { defaultTimestampRetryStyles } from "../defaultStyles/defaultTimestampRe
9
8
  import { getTimestampHourMinute } from "../../../../../../common/utils";
10
9
  import { hooks } from "botframework-webchat";
11
10
  import { useChatContextStore } from "../../../../../..";
12
- /* eslint @typescript-eslint/no-explicit-any: "off" */
13
11
 
12
+ /* eslint @typescript-eslint/no-explicit-any: "off" */
14
13
  export const NotDeliveredTimestamp = _ref => {
15
14
  var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$r3, _state$domainStates$r4, _state$domainStates$m, _state$domainStates$m2;
16
-
17
15
  let {
18
16
  args
19
17
  } = _ref;
@@ -32,54 +30,37 @@ export const NotDeliveredTimestamp = _ref => {
32
30
  } = activity;
33
31
  const [state] = useChatContextStore();
34
32
  const dir = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.timestampDir) ?? state.domainStates.globalDir;
35
- const contentStyles = { ...defaultTimestampContentStyles,
33
+ const contentStyles = {
34
+ ...defaultTimestampContentStyles,
36
35
  ...((_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.timestampContentStyleProps)
37
36
  };
38
- const failedTextStyles = { ...defaultTimestampFailedStyles,
37
+ const failedTextStyles = {
38
+ ...defaultTimestampFailedStyles,
39
39
  ...((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : _state$domainStates$r3.timestampFailedTextStyleProps)
40
40
  };
41
- const retryTextStyles = { ...defaultTimestampRetryStyles,
41
+ const retryTextStyles = {
42
+ ...defaultTimestampRetryStyles,
42
43
  ...((_state$domainStates$r4 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r4 === void 0 ? void 0 : _state$domainStates$r4.timestampRetryTextStyleProps)
43
44
  };
44
45
  useEffect(() => {
45
46
  var _timestampRef$current;
46
-
47
47
  const timestampWebChatNodes = timestampRef === null || timestampRef === void 0 ? void 0 : (_timestampRef$current = timestampRef.current) === null || _timestampRef$current === void 0 ? void 0 : _timestampRef$current.childNodes;
48
-
49
48
  if ((timestampWebChatNodes === null || timestampWebChatNodes === void 0 ? void 0 : timestampWebChatNodes.length) > 1) {
50
49
  timestampWebChatNodes[1].innerText = getTimestampHourMinute(timestamp);
51
50
  }
52
51
  }, [timestampRef]);
53
- const onRetryClick = useCallback(async event => {
52
+ const onRetryClick = useCallback(async () => {
54
53
  var _activity$channelData;
55
-
56
- removeNotDeliveredTimestamp(event);
57
54
  activity.previousClientActivityID = (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : _activity$channelData.clientActivityID;
58
55
  await postActivity(activity);
59
56
  focus("sendBox");
60
57
  }, [activity, focus, postActivity]);
61
-
62
58
  const onRetryKeyEnter = event => {
63
59
  if (event.code === KeyCodes.ENTER) {
64
60
  event.preventDefault();
65
- onRetryClick(event);
61
+ onRetryClick();
66
62
  }
67
63
  };
68
-
69
- const removeNotDeliveredTimestamp = event => {
70
- let parent = event.target.parentElement;
71
-
72
- while (parent.tagName !== HtmlAttributeNames.listItem) {
73
- parent = parent.parentElement;
74
-
75
- if (parent.tagName === HtmlAttributeNames.unorderedList) {
76
- return;
77
- }
78
- }
79
-
80
- parent.parentNode.removeChild(parent);
81
- };
82
-
83
64
  return /*#__PURE__*/React.createElement(Stack, {
84
65
  style: contentStyles,
85
66
  dir: dir,
@@ -2,29 +2,20 @@ import React from "react";
2
2
  import { Stack } from "@fluentui/react";
3
3
  import { defaultMiddlewareLocalizedTexts } from "../../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
4
4
  import { defaultTimestampContentStyles } from "../defaultStyles/defaultTimestampContentStyles";
5
- import { getTimestampHourMinute } from "../../../../../../common/utils";
6
5
  import { useChatContextStore } from "../../../../../..";
7
- /* eslint @typescript-eslint/no-explicit-any: "off" */
8
6
 
9
- export const SendingTimestamp = _ref => {
7
+ /* eslint @typescript-eslint/no-explicit-any: "off" */
8
+ export const SendingTimestamp = () => {
10
9
  var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$m;
11
-
12
- let {
13
- args
14
- } = _ref;
15
10
  const [state] = useChatContextStore();
16
11
  const dir = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.timestampDir) ?? state.domainStates.globalDir;
17
- const contentStyles = { ...defaultTimestampContentStyles,
12
+ const contentStyles = {
13
+ ...defaultTimestampContentStyles,
18
14
  ...((_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.timestampContentStyleProps)
19
15
  };
20
- const {
21
- activity: {
22
- timestamp
23
- }
24
- } = args;
25
16
  return /*#__PURE__*/React.createElement(Stack, {
26
17
  style: contentStyles,
27
18
  dir: dir,
28
19
  horizontal: true
29
- }, /*#__PURE__*/React.createElement("span", null, " ", getTimestampHourMinute(timestamp)), /*#__PURE__*/React.createElement("span", null, " \xA0-\xA0 "), /*#__PURE__*/React.createElement("span", null, " ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_SENDING) ?? defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_SENDING, " "));
20
+ }, /*#__PURE__*/React.createElement("span", null, " ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_SENDING) ?? defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_SENDING, " "));
30
21
  };
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * This middleware changes the component that shows who's actively typing. It uses the default Microsoft LiveChatWidget styles.
5
5
  ******/
6
+
6
7
  import React from "react";
7
8
  import { DirectLineSenderRole } from "../../enums/DirectLineSenderRole";
8
9
  import { defaultMiddlewareLocalizedTexts } from "../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
@@ -10,11 +11,11 @@ import { defaultTypingIndicatorBubbleStyles } from "./defaultStyles/defaultTypin
10
11
  import { defaultTypingIndicatorContainerStyles } from "./defaultStyles/defaultTypingIndicatorContainerStyles";
11
12
  import { defaultTypingIndicatorMessageStyles } from "./defaultStyles/defaultTypingIndicatorMessageStyles";
12
13
  import { useChatContextStore } from "../../../../..";
13
- import useChatSDKStore from "../../../../../hooks/useChatSDKStore"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
+ import useChatSDKStore from "../../../../../hooks/useChatSDKStore";
14
15
 
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
17
  const TypingIndicator = _ref => {
16
18
  var _state$domainStates$l, _state$domainStates$r, _state$domainStates$r2, _state$domainStates$r3;
17
-
18
19
  let {
19
20
  activeTyping,
20
21
  visible
@@ -22,39 +23,37 @@ const TypingIndicator = _ref => {
22
23
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
24
  const chatSDK = useChatSDKStore();
24
25
  const [state] = useChatContextStore();
25
-
26
26
  if (!activeTyping || Object.keys(activeTyping).length === 0 || ((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.LiveChatVersion) === 1 && !visible) {
27
27
  return null;
28
28
  }
29
-
30
29
  activeTyping = Object.keys(activeTyping).map(key => activeTyping[key]);
31
-
32
30
  for (let i = 0; i < activeTyping.length; i++) {
33
31
  if (activeTyping[i].role && activeTyping[i].role === DirectLineSenderRole.User) {
34
32
  var _state$domainStates$l2;
35
-
36
33
  //visible is set to false if the current user is typing, in which case, we just send typing indicator to OC
37
34
  if (((_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.LiveChatVersion) === 2 && !visible) {
38
35
  chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.sendTypingEvent();
39
36
  return null;
40
37
  }
41
-
42
38
  activeTyping.splice(i, 1);
43
39
  i--;
44
40
  }
45
41
  }
46
-
47
- const localizedTexts = { ...defaultMiddlewareLocalizedTexts,
42
+ const localizedTexts = {
43
+ ...defaultMiddlewareLocalizedTexts,
48
44
  ...state.domainStates.middlewareLocalizedTexts
49
45
  };
50
46
  const message = getTypingIndicatorMessage(activeTyping, localizedTexts);
51
- const typingIndicatorStyles = { ...defaultTypingIndicatorContainerStyles,
47
+ const typingIndicatorStyles = {
48
+ ...defaultTypingIndicatorContainerStyles,
52
49
  ...((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.typingIndicatorStyleProps)
53
50
  };
54
- const typingIndicatorBubbleStyles = { ...defaultTypingIndicatorBubbleStyles,
51
+ const typingIndicatorBubbleStyles = {
52
+ ...defaultTypingIndicatorBubbleStyles,
55
53
  ...((_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.typingIndicatorBubbleStyleProps)
56
54
  };
57
- const typingIndicatorMessageStyles = { ...defaultTypingIndicatorMessageStyles,
55
+ const typingIndicatorMessageStyles = {
56
+ ...defaultTypingIndicatorMessageStyles,
58
57
  ...((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : _state$domainStates$r3.typingIndicatorMessageStyleProps)
59
58
  };
60
59
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
@@ -96,9 +95,9 @@ const TypingIndicator = _ref => {
96
95
  }), /*#__PURE__*/React.createElement("div", {
97
96
  style: typingIndicatorMessageStyles
98
97
  }, " ", message, " ")));
99
- }; // eslint-disable-next-line react/display-name, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
100
-
98
+ };
101
99
 
100
+ // eslint-disable-next-line react/display-name, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
102
101
  export const typingIndicatorMiddleware = () => next => args => {
103
102
  const {
104
103
  activeTyping,
@@ -108,8 +107,9 @@ export const typingIndicatorMiddleware = () => next => args => {
108
107
  activeTyping: activeTyping,
109
108
  visible: visible
110
109
  });
111
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
110
+ };
112
111
 
112
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
113
113
  const getTypingIndicatorMessage = (activeTyping, localizedTexts) => {
114
114
  if (!activeTyping || activeTyping.length === 0) {
115
115
  return "";
@@ -120,19 +120,15 @@ const getTypingIndicatorMessage = (activeTyping, localizedTexts) => {
120
120
  const firstMember = activeTyping[0].name;
121
121
  const lastMember = activeTyping[1].name;
122
122
  let message = localizedTexts.MIDDLEWARE_TYPING_INDICATOR_TWO;
123
-
124
123
  if (!message) {
125
124
  return "";
126
125
  }
127
-
128
126
  if (message.includes("{0}")) {
129
127
  message = message.replace("{0}", firstMember);
130
128
  }
131
-
132
129
  if (message.includes("{1}")) {
133
130
  message = message.replace("{1}", lastMember);
134
131
  }
135
-
136
132
  return message;
137
133
  } else {
138
134
  const message = localizedTexts.MIDDLEWARE_TYPING_INDICATOR_MULTIPLE;
@@ -3,8 +3,10 @@
3
3
  *
4
4
  * Handles attachment sending.
5
5
  ******/
6
- import { WebChatActionType } from "../../enums/WebChatActionType"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
6
 
7
+ import { WebChatActionType } from "../../enums/WebChatActionType";
8
+
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
10
  const createSendFileAction = files => {
9
11
  return {
10
12
  payload: {
@@ -12,31 +14,26 @@ const createSendFileAction = files => {
12
14
  },
13
15
  type: WebChatActionType.WEB_CHAT_SEND_FILES
14
16
  };
15
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
-
17
+ };
17
18
 
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
20
  const attachmentProcessingMiddleware = _ref => {
19
21
  let {
20
22
  dispatch
21
23
  } = _ref;
22
24
  return next => async action => {
23
25
  var _action$payload, _action$payload$files;
24
-
25
26
  if ((action === null || action === void 0 ? void 0 : action.type) === WebChatActionType.WEB_CHAT_SEND_FILES && (action === null || action === void 0 ? void 0 : (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : (_action$payload$files = _action$payload.files) === null || _action$payload$files === void 0 ? void 0 : _action$payload$files.length) > 0) {
26
27
  const files = action.payload.files;
27
-
28
28
  if (files.length === 1) {
29
29
  return next(action);
30
30
  }
31
-
32
31
  const dispatchAction = createSendFileAction(files.slice(0, files.length - 1));
33
32
  const nextAction = createSendFileAction([files[files.length - 1]]);
34
33
  await dispatch(dispatchAction);
35
34
  return next(nextAction);
36
35
  }
37
-
38
36
  return next(action);
39
37
  };
40
38
  };
41
-
42
39
  export default attachmentProcessingMiddleware;
@@ -3,27 +3,25 @@
3
3
  *
4
4
  * Checks if the attachment being uploaded satisfies Omnichannel's requirement on file extensions and file size.
5
5
  ******/
6
+
6
7
  import { NotificationHandler } from "../../notification/NotificationHandler";
7
8
  import { NotificationScenarios } from "../../enums/NotificationScenarios";
8
9
  import { WebChatActionType } from "../../enums/WebChatActionType";
9
10
  const MBtoBRatio = 1000000;
11
+
10
12
  /*
11
13
  * If an attachment is invalid, delete this attachment from the attachments list
12
14
  * If the result attachment list is empty, return a dummy action
13
15
  */
14
-
15
16
  const validateAttachment = (action, allowedFileExtensions, maxUploadFileSize, localizedTexts) => {
16
17
  var _action$payload, _action$payload$activ, _action$payload2, _action$payload2$acti, _action$payload2$acti2, _action$payload3, _action$payload3$acti, _action$payload3$acti2;
17
-
18
18
  const attachments = action === null || action === void 0 ? void 0 : (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : (_action$payload$activ = _action$payload.activity) === null || _action$payload$activ === void 0 ? void 0 : _action$payload$activ.attachments;
19
19
  const attachmentSizes = action === null || action === void 0 ? void 0 : (_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : (_action$payload2$acti = _action$payload2.activity) === null || _action$payload2$acti === void 0 ? void 0 : (_action$payload2$acti2 = _action$payload2$acti.channelData) === null || _action$payload2$acti2 === void 0 ? void 0 : _action$payload2$acti2.attachmentSizes;
20
-
21
20
  if (attachments) {
22
21
  for (let i = 0; i < attachments.length; i++) {
23
22
  const fileExtensionValid = validateFileExtension(attachments[i], allowedFileExtensions);
24
23
  const fileSizeValid = validateFileSize(attachmentSizes[i], maxUploadFileSize);
25
24
  const fileIsEmpty = parseInt(attachmentSizes[i]) == 0;
26
-
27
25
  if (!fileExtensionValid || !fileSizeValid || fileIsEmpty) {
28
26
  NotificationHandler.notifyError(NotificationScenarios.AttachmentError, buildErrorMessage(attachments[i].name, fileExtensionValid, fileSizeValid, fileIsEmpty, maxUploadFileSize, localizedTexts));
29
27
  attachments.splice(i, 1);
@@ -32,7 +30,6 @@ const validateAttachment = (action, allowedFileExtensions, maxUploadFileSize, lo
32
30
  }
33
31
  }
34
32
  }
35
-
36
33
  if ((action === null || action === void 0 ? void 0 : (_action$payload3 = action.payload) === null || _action$payload3 === void 0 ? void 0 : (_action$payload3$acti = _action$payload3.activity) === null || _action$payload3$acti === void 0 ? void 0 : (_action$payload3$acti2 = _action$payload3$acti.attachments) === null || _action$payload3$acti2 === void 0 ? void 0 : _action$payload3$acti2.length) > 0) {
37
34
  return action;
38
35
  } else {
@@ -41,37 +38,30 @@ const validateAttachment = (action, allowedFileExtensions, maxUploadFileSize, lo
41
38
  payload: null
42
39
  };
43
40
  }
44
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
-
41
+ };
46
42
 
43
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
44
  const validateFileExtension = (attachment, allowedFileExtensions) => {
48
45
  if (!allowedFileExtensions) {
49
46
  return true;
50
47
  }
51
-
52
48
  const fileName = attachment.name.toLowerCase();
53
49
  const index = fileName.lastIndexOf(".");
54
-
55
50
  if (!index) {
56
51
  return false;
57
52
  }
58
-
59
53
  const fileExtension = fileName.substring(index);
60
54
  const allExtensions = allowedFileExtensions === null || allowedFileExtensions === void 0 ? void 0 : allowedFileExtensions.toLowerCase().split(",");
61
55
  return allExtensions.indexOf(fileExtension) > -1;
62
56
  };
63
-
64
57
  const validateFileSize = (attachmentSize, maxUploadFileSize) => {
65
58
  return (maxUploadFileSize && parseInt(maxUploadFileSize) * MBtoBRatio) > parseInt(attachmentSize);
66
59
  };
67
-
68
60
  const buildErrorMessage = (fileName, supportedFileExtension, supportedFileSize, fileIsEmpty, maxUploadFileSize, localizedTexts) => {
69
61
  let errorMessage = "";
70
-
71
62
  if (!fileName || !maxUploadFileSize) {
72
63
  return localizedTexts.MIDDLEWARE_BANNER_FILE_NULL_ERROR ?? "";
73
64
  }
74
-
75
65
  if (!supportedFileExtension && !supportedFileSize) {
76
66
  errorMessage = getFileSizeAndFileExtensionErrorMessage(fileName, maxUploadFileSize, localizedTexts);
77
67
  } else if (!supportedFileSize) {
@@ -83,33 +73,25 @@ const buildErrorMessage = (fileName, supportedFileExtension, supportedFileSize,
83
73
  } else {
84
74
  errorMessage = localizedTexts.MIDDLEWARE_BANNER_ERROR_MESSAGE ?? "";
85
75
  }
86
-
87
76
  return errorMessage;
88
77
  };
89
-
90
78
  const getFileSizeAndFileExtensionErrorMessage = (fileName, maxUploadFileSize, localizedTexts) => {
91
79
  const index = fileName.lastIndexOf(".");
92
80
  let errorMessage;
93
-
94
81
  if (index < 0) {
95
82
  errorMessage = localizedTexts.MIDDLEWARE_BANNER_FILE_SIZE_WITHOUT_EXTENSION_ERROR;
96
83
  } else {
97
84
  var _errorMessage;
98
-
99
85
  const fileExtension = fileName.substring(index);
100
86
  errorMessage = localizedTexts.MIDDLEWARE_BANNER_FILE_SIZE_EXTENSION_ERROR;
101
-
102
87
  if ((_errorMessage = errorMessage) !== null && _errorMessage !== void 0 && _errorMessage.includes("{1}")) {
103
88
  errorMessage = errorMessage.replace("{1}", fileExtension);
104
89
  }
105
90
  }
106
-
107
91
  return errorMessage ? errorMessage.includes("{0}") ? errorMessage.replace("{0}", maxUploadFileSize) : errorMessage : "";
108
92
  };
109
-
110
93
  const getFileExtensionErrorMessage = (fileName, localizedTexts) => {
111
94
  const index = fileName.lastIndexOf(".");
112
-
113
95
  if (index < 0) {
114
96
  return localizedTexts.MIDDLEWARE_BANNER_FILE_WITHOUT_EXTENSION ?? "";
115
97
  } else {
@@ -118,13 +100,12 @@ const getFileExtensionErrorMessage = (fileName, localizedTexts) => {
118
100
  return errorMessage ? errorMessage.includes("{0}") ? errorMessage.replace("{0}", fileExtension) : errorMessage : "";
119
101
  }
120
102
  };
121
-
122
103
  const getFileSizeErrorMessage = (maxUploadFileSize, localizedTexts) => {
123
104
  const errorMessage = localizedTexts.MIDDLEWARE_BANNER_FILE_SIZE_ERROR;
124
105
  return errorMessage ? errorMessage.includes("{0}") ? errorMessage.replace("{0}", maxUploadFileSize) : errorMessage : "";
125
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
126
-
106
+ };
127
107
 
108
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
128
109
  const createAttachmentUploadValidatorMiddleware = (allowedFileExtensions, maxUploadFileSize, localizedTexts) => _ref => {
129
110
  let {
130
111
  dispatch
@@ -132,18 +113,14 @@ const createAttachmentUploadValidatorMiddleware = (allowedFileExtensions, maxUpl
132
113
  return next => action => {
133
114
  if (action.type === WebChatActionType.DIRECT_LINE_POST_ACTIVITY) {
134
115
  var _payload$activity, _payload$activity2, _payload$activity2$ch, _payload$activity3, _payload$activity3$at, _payload$activity4, _payload$activity4$ch, _payload$activity4$ch2;
135
-
136
116
  const {
137
117
  payload
138
118
  } = action;
139
-
140
119
  if (payload !== null && payload !== void 0 && (_payload$activity = payload.activity) !== null && _payload$activity !== void 0 && _payload$activity.attachments && payload !== null && payload !== void 0 && (_payload$activity2 = payload.activity) !== null && _payload$activity2 !== void 0 && (_payload$activity2$ch = _payload$activity2.channelData) !== null && _payload$activity2$ch !== void 0 && _payload$activity2$ch.attachmentSizes && (payload === null || payload === void 0 ? void 0 : (_payload$activity3 = payload.activity) === null || _payload$activity3 === void 0 ? void 0 : (_payload$activity3$at = _payload$activity3.attachments) === null || _payload$activity3$at === void 0 ? void 0 : _payload$activity3$at.length) === (payload === null || payload === void 0 ? void 0 : (_payload$activity4 = payload.activity) === null || _payload$activity4 === void 0 ? void 0 : (_payload$activity4$ch = _payload$activity4.channelData) === null || _payload$activity4$ch === void 0 ? void 0 : (_payload$activity4$ch2 = _payload$activity4$ch.attachmentSizes) === null || _payload$activity4$ch2 === void 0 ? void 0 : _payload$activity4$ch2.length)) {
141
120
  return next(validateAttachment(action, allowedFileExtensions, maxUploadFileSize, localizedTexts));
142
121
  }
143
122
  }
144
-
145
123
  return next(action);
146
124
  };
147
125
  };
148
-
149
126
  export default createAttachmentUploadValidatorMiddleware;
@@ -3,26 +3,25 @@
3
3
  *
4
4
  * Adds necessary tags if not present so that the rendering middlewares can process them later.
5
5
  ******/
6
+
6
7
  import { Constants } from "../../../../../common/Constants";
7
8
  import { DeliveryMode } from "@microsoft/omnichannel-chat-sdk";
8
- import { WebChatActionType } from "../../enums/WebChatActionType"; // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
9
+ import { WebChatActionType } from "../../enums/WebChatActionType";
9
10
 
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
10
12
  const channelDataMiddleware = _ref => {
11
13
  let {
12
14
  dispatch
13
15
  } = _ref;
14
16
  return next => action => {
15
17
  var _action$payload, _action$payload$activ;
16
-
17
18
  if ((action === null || action === void 0 ? void 0 : action.type) === WebChatActionType.DIRECT_LINE_POST_ACTIVITY_PENDING && action !== null && action !== void 0 && (_action$payload = action.payload) !== null && _action$payload !== void 0 && (_action$payload$activ = _action$payload.activity) !== null && _action$payload$activ !== void 0 && _action$payload$activ.channelData) {
18
19
  const channelIdTag = `${Constants.channelIdKey}${Constants.ChannelId}`;
19
20
  const customerMessageTag = `${Constants.CustomerTag}`;
20
-
21
21
  if (action.payload.activity.channelData.tags) {
22
22
  if (!action.payload.activity.channelData.tags.includes(channelIdTag)) {
23
23
  action.payload.activity.channelData.tags.push(channelIdTag);
24
24
  }
25
-
26
25
  if (!action.payload.activity.channelData.tags.includes(customerMessageTag)) {
27
26
  action.payload.activity.channelData.tags.push(customerMessageTag);
28
27
  }
@@ -30,14 +29,11 @@ const channelDataMiddleware = _ref => {
30
29
  action.payload.activity.channelData.tags = [channelIdTag];
31
30
  action.payload.activity.channelData.tags.push(customerMessageTag);
32
31
  }
33
-
34
32
  action.payload.activity.channelData.metadata = {
35
33
  deliveryMode: DeliveryMode.Bridged
36
34
  };
37
35
  }
38
-
39
36
  return next(action);
40
37
  };
41
38
  };
42
-
43
39
  export default channelDataMiddleware;
@@ -4,42 +4,37 @@
4
4
  * This middleware is invoked when the conversation is ended by the agent/bot.
5
5
  * The callback is then invoked to hide the send box (by default).
6
6
  ******/
7
+
7
8
  import { Constants } from "../../../../../common/Constants";
8
9
  import { DirectLineSenderRole } from "../../enums/DirectLineSenderRole";
9
10
  import { MessageTypes } from "../../enums/MessageType";
10
- import { WebChatActionType } from "../../enums/WebChatActionType"; // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
11
+ import { WebChatActionType } from "../../enums/WebChatActionType";
11
12
 
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
12
14
  const createConversationEndMiddleware = conversationEndCallback => _ref => {
13
15
  let {
14
16
  dispatch
15
17
  } = _ref;
16
18
  return next => action => {
17
19
  var _action$payload;
18
-
19
20
  if ((action === null || action === void 0 ? void 0 : action.type) == WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
20
21
  var _activity$from, _activity$from2, _activity$channelData7, _activity$channelData8;
21
-
22
22
  const activity = action.payload.activity;
23
-
24
23
  if (((_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === DirectLineSenderRole.Bot && activity.channelId === "ACS_CHANNEL") {
25
24
  var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4, _activity$channelData5, _activity$channelData6;
26
-
27
25
  // ACS
28
26
  if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(Constants.systemMessageTag) && ((_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && (_activity$channelData4 = _activity$channelData3.tags) !== null && _activity$channelData4 !== void 0 && _activity$channelData4.includes(Constants.agentEndConversationMessageTag) || (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(Constants.supervisorForceCloseMessageTag))) {
29
27
  conversationEndCallback();
30
28
  }
31
29
  } else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === DirectLineSenderRole.Channel && ((_activity$channelData7 = activity.channelData) === null || _activity$channelData7 === void 0 ? void 0 : _activity$channelData7.type) === MessageTypes.Thread && (_activity$channelData8 = activity.channelData) !== null && _activity$channelData8 !== void 0 && _activity$channelData8.properties) {
32
30
  var _activity$channelData9, _activity$channelData10, _activity$channelData11, _activity$channelData12;
33
-
34
31
  // IC3
35
32
  if (((_activity$channelData9 = activity.channelData) === null || _activity$channelData9 === void 0 ? void 0 : (_activity$channelData10 = _activity$channelData9.properties) === null || _activity$channelData10 === void 0 ? void 0 : _activity$channelData10.isdeleted) === Constants.truePascal || !((_activity$channelData11 = activity.channelData) !== null && _activity$channelData11 !== void 0 && (_activity$channelData12 = _activity$channelData11.properties) !== null && _activity$channelData12 !== void 0 && _activity$channelData12.containsExternalEntitiesListeningAll)) {
36
33
  conversationEndCallback();
37
34
  }
38
35
  }
39
36
  }
40
-
41
37
  return next(action);
42
38
  };
43
39
  };
44
-
45
40
  export default createConversationEndMiddleware;
@@ -3,18 +3,16 @@
3
3
  *
4
4
  * Applies data masking rules that Omnichannel Admin has configured.
5
5
  ******/
6
+
6
7
  import { LogLevel, TelemetryEvent } from "../../../../../common/telemetry/TelemetryConstants";
7
8
  import { TelemetryHelper } from "../../../../../common/telemetry/TelemetryHelper";
8
9
  import { WebChatActionType } from "../../enums/WebChatActionType";
9
10
  import { isMaskingforCustomer } from "../../../common/utils/isMaskingFromCustomer";
10
-
11
11
  const applyDataMasking = (action, regexCollection) => {
12
12
  const maskedChar = "#"; //to do: load from env once OC SDK supporting.
13
-
14
13
  let {
15
14
  text
16
15
  } = action.payload;
17
-
18
16
  if (!regexCollection) {
19
17
  TelemetryHelper.logActionEvent(LogLevel.ERROR, {
20
18
  Event: TelemetryEvent.InvalidConfiguration,
@@ -24,22 +22,26 @@ const applyDataMasking = (action, regexCollection) => {
24
22
  });
25
23
  return action;
26
24
  }
27
-
25
+ let isRuleMatched = false;
28
26
  for (const ruleId of Object.keys(regexCollection)) {
29
27
  const item = regexCollection[ruleId];
30
-
31
28
  if (item) {
32
29
  try {
33
30
  const regex = new RegExp(item, "gi");
34
- let match; // eslint-disable-next-line no-cond-assign
35
-
31
+ let match;
32
+ // eslint-disable-next-line no-cond-assign
36
33
  while (match = regex.exec(text)) {
37
34
  const replaceStr = match[0].replace(/./gi, maskedChar);
38
35
  text = text.replace(match[0], replaceStr);
36
+ TelemetryHelper.logActionEvent(LogLevel.INFO, {
37
+ Event: TelemetryEvent.DataMaskingRuleApplied,
38
+ Description: `Data Masking Rule Id: ${ruleId} applied.`
39
+ });
40
+ isRuleMatched = true;
39
41
  }
40
42
  } catch (err) {
41
43
  TelemetryHelper.logActionEvent(LogLevel.ERROR, {
42
- Event: TelemetryEvent.DataMaskingRuleApplied,
44
+ Event: TelemetryEvent.DataMaskingRuleApplyFailed,
43
45
  ExceptionDetails: {
44
46
  RuleId: ruleId,
45
47
  Exception: err
@@ -47,27 +49,28 @@ const applyDataMasking = (action, regexCollection) => {
47
49
  });
48
50
  }
49
51
  }
50
- }
51
52
 
53
+ // Exit if rule matched
54
+ if (isRuleMatched === true) {
55
+ break;
56
+ }
57
+ }
52
58
  action.payload.text = text;
53
59
  return action;
54
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
55
-
60
+ };
56
61
 
62
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
57
63
  const createDataMaskingMiddleware = dataMaskingInfo => _ref => {
58
64
  let {
59
65
  dispatch
60
66
  } = _ref;
61
67
  return next => action => {
62
68
  var _action$payload;
63
-
64
69
  if (isMaskingforCustomer(dataMaskingInfo) && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.text && action.type === WebChatActionType.WEB_CHAT_SEND_MESSAGE) {
65
70
  const regexCollection = dataMaskingInfo === null || dataMaskingInfo === void 0 ? void 0 : dataMaskingInfo.dataMaskingRules;
66
71
  return next(applyDataMasking(action, regexCollection));
67
72
  }
68
-
69
73
  return next(action);
70
74
  };
71
75
  };
72
-
73
76
  export default createDataMaskingMiddleware;
@@ -3,9 +3,11 @@
3
3
  *
4
4
  * Ensures that GIF are properly uploaded.
5
5
  ******/
6
+
6
7
  import { Constants } from "../../../../../common/Constants";
7
- import { WebChatActionType } from "../../enums/WebChatActionType"; // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
8
+ import { WebChatActionType } from "../../enums/WebChatActionType";
8
9
 
10
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
9
11
  const gifUploadMiddleware = _ref => {
10
12
  let {
11
13
  dispatch
@@ -13,16 +15,13 @@ const gifUploadMiddleware = _ref => {
13
15
  return next => action => {
14
16
  if (action.type === WebChatActionType.DIRECT_LINE_POST_ACTIVITY) {
15
17
  var _activity$attachments, _activity$channelData, _activity$channelData2;
16
-
17
18
  const {
18
19
  payload: {
19
20
  activity
20
21
  }
21
22
  } = action;
22
-
23
23
  if ((activity === null || activity === void 0 ? void 0 : (_activity$attachments = activity.attachments) === null || _activity$attachments === void 0 ? void 0 : _activity$attachments.length) === (activity === null || activity === void 0 ? void 0 : (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : (_activity$channelData2 = _activity$channelData.attachmentSizes) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.length)) {
24
24
  var _activity$attachments2;
25
-
26
25
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
26
  activity === null || activity === void 0 ? void 0 : (_activity$attachments2 = activity.attachments) === null || _activity$attachments2 === void 0 ? void 0 : _activity$attachments2.forEach(attachment => {
28
27
  const {
@@ -30,16 +29,13 @@ const gifUploadMiddleware = _ref => {
30
29
  contentUrl,
31
30
  contentType
32
31
  } = attachment;
33
-
34
32
  if (contentType === Constants.GifContentType && thumbnailUrl !== contentUrl) {
35
33
  attachment.thumbnailUrl = contentUrl;
36
34
  }
37
35
  });
38
36
  }
39
37
  }
40
-
41
38
  return next(action);
42
39
  };
43
40
  };
44
-
45
41
  export default gifUploadMiddleware;