@microsoft/omnichannel-chat-widget 0.1.0-main.07a2a56 → 0.1.0-main.0c0fd47

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 (259) hide show
  1. package/lib/cjs/assets/Icons.js +4 -2
  2. package/lib/cjs/common/Constants.js +20 -169
  3. package/lib/cjs/common/KeyCodes.js +3 -4
  4. package/lib/cjs/common/contextDataStore/DataStoreManager.js +3 -5
  5. package/lib/cjs/common/storage/default/defaultCacheManager.js +3 -11
  6. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +4 -16
  7. package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +2 -10
  8. package/lib/cjs/common/telemetry/TelemetryConstants.js +15 -23
  9. package/lib/cjs/common/telemetry/TelemetryHelper.js +19 -58
  10. package/lib/cjs/common/telemetry/TelemetryManager.js +3 -32
  11. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +0 -2
  12. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +2 -21
  13. package/lib/cjs/common/telemetry/loggers/consoleLogger.js +0 -9
  14. package/lib/cjs/common/utils.js +18 -105
  15. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +8 -46
  16. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +2 -24
  17. package/lib/cjs/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
  18. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +4 -28
  19. package/lib/cjs/components/dimlayer/DimLayer.js +0 -4
  20. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +4 -32
  21. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -8
  22. package/lib/cjs/components/footerstateful/FooterStateful.js +6 -29
  23. package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +0 -6
  24. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +7 -45
  25. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -8
  26. package/lib/cjs/components/headerstateful/HeaderStateful.js +7 -28
  27. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +2 -14
  28. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +5 -10
  29. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +3 -6
  30. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +7 -12
  31. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +14 -20
  32. package/lib/cjs/components/livechatwidget/common/Deferred.js +6 -11
  33. package/lib/cjs/components/livechatwidget/common/authHelper.js +4 -19
  34. package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -13
  35. package/lib/cjs/components/livechatwidget/common/createFooter.js +0 -10
  36. package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +2 -14
  37. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +16 -24
  38. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +14 -0
  39. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +60 -26
  40. package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +0 -3
  41. package/lib/cjs/components/livechatwidget/common/endChat.js +50 -35
  42. package/lib/cjs/components/livechatwidget/common/getGeneralStylesForButton.js +0 -6
  43. package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +0 -8
  44. package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -8
  45. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +16 -54
  46. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +78 -151
  47. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +4 -17
  48. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +2 -11
  49. package/lib/cjs/components/livechatwidget/common/shareObservable.js +4 -8
  50. package/lib/cjs/components/livechatwidget/common/startChat.js +141 -112
  51. package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +0 -8
  52. package/lib/cjs/components/livechatwidget/common/updateSessionDataForTelemetry.js +2 -11
  53. package/lib/cjs/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
  54. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +201 -256
  55. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +19 -19
  56. package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +57 -0
  57. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +4 -17
  58. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +4 -17
  59. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +27 -20
  60. package/lib/cjs/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
  61. package/lib/cjs/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +13 -0
  62. package/lib/cjs/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
  63. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -37
  64. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +2 -32
  65. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +6 -24
  66. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +3 -36
  67. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +0 -7
  68. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -6
  69. package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +12 -27
  70. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +5 -18
  71. package/lib/cjs/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -24
  72. package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +3 -15
  73. package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -8
  74. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -5
  75. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -5
  76. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
  77. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
  78. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
  79. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
  80. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
  81. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
  82. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
  83. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
  84. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +0 -7
  85. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -5
  86. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +17 -41
  87. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +8 -19
  88. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +23 -60
  89. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +7 -15
  90. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +2 -13
  91. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +0 -16
  92. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -3
  93. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -3
  94. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -9
  95. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +2 -30
  96. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +7 -18
  97. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +6 -28
  98. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
  99. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +13 -30
  100. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +3 -9
  101. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -34
  102. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +1 -10
  103. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +1 -12
  104. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +17 -19
  105. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +1 -9
  106. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -9
  107. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +13 -34
  108. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +1 -10
  109. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +7 -11
  110. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +5 -14
  111. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -21
  112. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +0 -12
  113. package/lib/cjs/contexts/ChatAdapterStore.js +0 -2
  114. package/lib/cjs/contexts/ChatContextStore.js +0 -2
  115. package/lib/cjs/contexts/ChatSDKStore.js +0 -2
  116. package/lib/cjs/contexts/common/ConversationState.js +0 -1
  117. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +29 -28
  118. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -10
  119. package/lib/cjs/contexts/createReducer.js +152 -106
  120. package/lib/cjs/controller/componentController.js +2 -31
  121. package/lib/cjs/hooks/useChatAdapterStore.js +0 -6
  122. package/lib/cjs/hooks/useChatContextStore.js +0 -6
  123. package/lib/cjs/hooks/useChatSDKStore.js +0 -6
  124. package/lib/cjs/index.js +0 -5
  125. package/lib/cjs/plugins/newMessageEventHandler.js +15 -36
  126. package/lib/esm/assets/Icons.js +2 -1
  127. package/lib/esm/common/Constants.js +17 -156
  128. package/lib/esm/common/KeyCodes.js +3 -3
  129. package/lib/esm/common/contextDataStore/DataStoreManager.js +3 -3
  130. package/lib/esm/common/storage/default/defaultCacheManager.js +3 -4
  131. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +4 -11
  132. package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +2 -3
  133. package/lib/esm/common/telemetry/TelemetryConstants.js +19 -20
  134. package/lib/esm/common/telemetry/TelemetryHelper.js +19 -46
  135. package/lib/esm/common/telemetry/TelemetryManager.js +3 -19
  136. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +2 -14
  137. package/lib/esm/common/telemetry/loggers/consoleLogger.js +0 -5
  138. package/lib/esm/common/utils.js +18 -53
  139. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +8 -17
  140. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +2 -7
  141. package/lib/esm/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
  142. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +6 -9
  143. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +4 -11
  144. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -6
  145. package/lib/esm/components/footerstateful/FooterStateful.js +8 -10
  146. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +7 -35
  147. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -6
  148. package/lib/esm/components/headerstateful/HeaderStateful.js +7 -13
  149. package/lib/esm/components/livechatwidget/LiveChatWidget.js +2 -2
  150. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +5 -7
  151. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +3 -4
  152. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +7 -9
  153. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +14 -16
  154. package/lib/esm/components/livechatwidget/common/Deferred.js +6 -9
  155. package/lib/esm/components/livechatwidget/common/authHelper.js +4 -12
  156. package/lib/esm/components/livechatwidget/common/createAdapter.js +4 -6
  157. package/lib/esm/components/livechatwidget/common/createFooter.js +0 -1
  158. package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +2 -5
  159. package/lib/esm/components/livechatwidget/common/createMarkdown.js +18 -18
  160. package/lib/esm/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +7 -0
  161. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +62 -13
  162. package/lib/esm/components/livechatwidget/common/endChat.js +52 -20
  163. package/lib/esm/components/livechatwidget/common/getGeneralStylesForButton.js +0 -2
  164. package/lib/esm/components/livechatwidget/common/initCallingSdk.js +2 -2
  165. package/lib/esm/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -5
  166. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +18 -19
  167. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +77 -131
  168. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +4 -9
  169. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +4 -3
  170. package/lib/esm/components/livechatwidget/common/shareObservable.js +4 -7
  171. package/lib/esm/components/livechatwidget/common/startChat.js +141 -84
  172. package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +4 -2
  173. package/lib/esm/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
  174. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +203 -190
  175. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +19 -7
  176. package/lib/esm/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +50 -0
  177. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +4 -5
  178. package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +4 -5
  179. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +27 -7
  180. package/lib/esm/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
  181. package/lib/esm/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +6 -0
  182. package/lib/esm/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
  183. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +11 -21
  184. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +4 -8
  185. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +6 -6
  186. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +3 -8
  187. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
  188. package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +12 -19
  189. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +5 -14
  190. package/lib/esm/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -16
  191. package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +3 -5
  192. package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -6
  193. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -3
  194. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -3
  195. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
  196. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
  197. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
  198. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
  199. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
  200. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
  201. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
  202. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
  203. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +2 -5
  204. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -4
  205. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +17 -26
  206. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +10 -11
  207. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +23 -38
  208. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +9 -8
  209. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +2 -9
  210. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +0 -14
  211. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -1
  212. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -1
  213. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -7
  214. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +4 -28
  215. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +8 -9
  216. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +7 -14
  217. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +3 -3
  218. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +15 -19
  219. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +5 -8
  220. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -29
  221. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +3 -7
  222. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +3 -8
  223. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +17 -14
  224. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +3 -7
  225. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -7
  226. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +15 -27
  227. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +3 -5
  228. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +9 -9
  229. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +7 -9
  230. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -13
  231. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +0 -5
  232. package/lib/esm/contexts/ChatAdapterStore.js +2 -1
  233. package/lib/esm/contexts/ChatContextStore.js +2 -1
  234. package/lib/esm/contexts/ChatSDKStore.js +2 -1
  235. package/lib/esm/contexts/common/ConversationState.js +0 -1
  236. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +29 -28
  237. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -4
  238. package/lib/esm/contexts/createReducer.js +152 -103
  239. package/lib/esm/controller/componentController.js +3 -2
  240. package/lib/esm/hooks/useChatAdapterStore.js +0 -4
  241. package/lib/esm/hooks/useChatContextStore.js +0 -4
  242. package/lib/esm/hooks/useChatSDKStore.js +0 -4
  243. package/lib/esm/plugins/newMessageEventHandler.js +15 -26
  244. package/lib/types/assets/Icons.d.ts +1 -0
  245. package/lib/types/common/Constants.d.ts +12 -0
  246. package/lib/types/common/telemetry/TelemetryConstants.d.ts +11 -4
  247. package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -4
  248. package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -0
  249. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +5 -7
  250. package/lib/types/components/livechatwidget/common/startChat.d.ts +3 -2
  251. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +1 -1
  252. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
  253. package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -0
  254. package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -0
  255. package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -0
  256. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -1
  257. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -1
  258. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +29 -27
  259. package/package.json +3 -3
@@ -4,7 +4,6 @@ import { NotificationScenarios } from "../../webchatcontainerstateful/webchatcon
4
4
  import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
5
5
  import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
6
6
  import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
7
-
8
7
  const isInternetConnected = async () => {
9
8
  try {
10
9
  const response = await fetch(Constants.internetConnectionTestUrl);
@@ -14,11 +13,9 @@ const isInternetConnected = async () => {
14
13
  return false;
15
14
  }
16
15
  };
17
-
18
16
  export const createInternetConnectionChangeHandler = async () => {
19
17
  const handler = async () => {
20
18
  const connected = await isInternetConnected();
21
-
22
19
  if (!connected) {
23
20
  TelemetryHelper.logActionEvent(LogLevel.WARN, {
24
21
  Event: TelemetryEvent.NetworkDisconnected
@@ -30,9 +27,9 @@ export const createInternetConnectionChangeHandler = async () => {
30
27
  });
31
28
  NotificationHandler.notifySuccess(NotificationScenarios.InternetConnection, defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_INTERNET_BACK_ONLINE);
32
29
  }
33
- }; // Checking connection status on online & offline events due to possible false positives
34
-
30
+ };
35
31
 
32
+ // Checking connection status on online & offline events due to possible false positives
36
33
  window.addEventListener("online", () => handler(), false);
37
34
  window.addEventListener("offline", () => handler(), false);
38
35
  };
@@ -1,17 +1,18 @@
1
1
  import MarkdownIt from "markdown-it";
2
2
  import MarkdownItForInline from "markdown-it-for-inline";
3
3
  import { defaultMarkdownLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts";
4
- import { Constants } from "../../../common/Constants"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
+ import { Constants } from "../../../common/Constants";
5
5
 
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
7
  export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineMarkdownSupport) => {
7
8
  let markdown;
8
-
9
9
  if (!disableMarkdownMessageFormatting) {
10
10
  markdown = new MarkdownIt(Constants.Default, {
11
11
  html: true,
12
12
  linkify: true,
13
13
  breaks: !disableNewLineMarkdownSupport
14
- }); // ToDo: Commenting below usage of plugin until deferred bug is resolved: https://github.com/mayashavin/markdown-it-slack/issues/1
14
+ });
15
+ // ToDo: Commenting below usage of plugin until deferred bug is resolved: https://github.com/mayashavin/markdown-it-slack/issues/1
15
16
  // markdown.use(MarkdownSlack);
16
17
  } else {
17
18
  markdown = new MarkdownIt(Constants.Zero, {
@@ -19,38 +20,37 @@ export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineM
19
20
  linkify: true,
20
21
  breaks: !disableNewLineMarkdownSupport
21
22
  });
22
- markdown.enable(["entity", // Rule to process html entity - {, ¯, "
23
- "linkify", // Rule to replace link-like texts with link nodes
24
- "html_block", // Rule to process html blocks and paragraphs
25
- "html_inline", // Rule to process html tags
23
+ markdown.enable(["entity",
24
+ // Rule to process html entity - {, ¯, "
25
+ "linkify",
26
+ // Rule to replace link-like texts with link nodes
27
+ "html_block",
28
+ // Rule to process html blocks and paragraphs
29
+ "html_inline",
30
+ // Rule to process html tags
26
31
  "newline" // Rule to proceess '\n'
27
32
  ]);
28
- } // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
-
33
+ }
30
34
 
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
36
  markdown.use(MarkdownItForInline, "url_new_win", "link_open", function (tokens, idx, env) {
32
- const targetAttrIndex = tokens[idx].attrIndex(Constants.Target); // Put a transparent pixel instead of the "open in new window" icon, so developers can easily modify the icon in CSS.
33
-
37
+ const targetAttrIndex = tokens[idx].attrIndex(Constants.Target);
38
+ // Put a transparent pixel instead of the "open in new window" icon, so developers can easily modify the icon in CSS.
34
39
  const TRANSPARENT_GIF = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
35
-
36
40
  if (~targetAttrIndex) {
37
41
  tokens[idx].attrs[targetAttrIndex][1] = Constants.Blank;
38
42
  } else {
39
43
  tokens[idx].attrPush([Constants.Target, Constants.Blank]);
40
44
  }
41
-
42
45
  const relAttrIndex = tokens[idx].attrIndex(Constants.TargetRelationship);
43
-
44
46
  if (~relAttrIndex) {
45
47
  tokens[idx].attrs[relAttrIndex][1] = Constants.TargetRelationshipAttributes;
46
48
  } else {
47
49
  tokens[idx].attrPush([Constants.TargetRelationship, Constants.TargetRelationshipAttributes]);
48
-
49
50
  if (!disableMarkdownMessageFormatting) {
50
- tokens[idx].attrPush([Constants.Title, defaultMarkdownLocalizedTexts.MARKDOWN_EXTERNAL_LINK_ALT]); // eslint-disable-next-line quotes
51
-
51
+ tokens[idx].attrPush([Constants.Title, defaultMarkdownLocalizedTexts.MARKDOWN_EXTERNAL_LINK_ALT]);
52
+ // eslint-disable-next-line quotes
52
53
  const iconTokens = markdown.parseInline(`![${defaultMarkdownLocalizedTexts.MARKDOWN_EXTERNAL_LINK_ALT}](${TRANSPARENT_GIF})`, env)[0].children;
53
-
54
54
  if (iconTokens && iconTokens.length > 0) {
55
55
  iconTokens[0].attrJoin("class", Constants.OpenLinkIconCssClass);
56
56
  tokens.splice(idx + 2, 0, ...iconTokens);
@@ -0,0 +1,7 @@
1
+ export const defaultScrollBarProps = {
2
+ width: "7px",
3
+ trackBackgroundColor: "#f1f1f1",
4
+ thumbBackgroundColor: "#888",
5
+ thumbBorderRadius: "10px",
6
+ thumbHoverColor: "#555"
7
+ };
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-empty-function, @typescript-eslint/no-explicit-any */
2
+
2
3
  import { ChatReconnectIconBase64, CloseChatButtonIconBase64, ModernChatIconBase64, ProactiveChatBannerBase64 } from "@microsoft/omnichannel-chat-components";
3
4
  import MockAdapter from "../../../webchatcontainerstateful/common/mockadapter";
4
5
  import { NewMessageNotificationSoundBase64 } from "../../../../assets/Audios";
@@ -10,8 +11,9 @@ import { createAvatarMiddleware } from "../../../webchatcontainerstateful/webcha
10
11
  import { createMarkdown } from "../createMarkdown";
11
12
  import { groupActivitiesMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware";
12
13
  import { typingIndicatorMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware";
13
- import { createWebChatTelemetry } from "../../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger"; // eslint-disable-next-line @typescript-eslint/no-unused-vars
14
+ import { createWebChatTelemetry } from "../../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger";
14
15
 
16
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
15
17
  export const dummyDefaultProps = {
16
18
  audioNotificationProps: {
17
19
  audioSrc: NewMessageNotificationSoundBase64
@@ -471,24 +473,27 @@ export const dummyDefaultProps = {
471
473
  onConfirm: () => {},
472
474
  // Detailed implementation omitted
473
475
  onCancel: () => {} // Detailed implementation omitted
474
-
475
476
  },
477
+
476
478
  styleProps: {
477
479
  generalStyleProps: {
480
+ display: "flex",
481
+ minHeight: "160px",
482
+ maxHeight: "300px",
483
+ boxSizing: "border-box",
478
484
  backgroundColor: "#FFFFFF",
479
485
  borderRadius: "2px",
480
486
  color: "black",
481
487
  fontFamily: "Segoe UI, Arial, sans-serif",
482
488
  fontSize: "14px",
483
- height: "160px",
484
489
  padding: "10px 20px",
485
- width: "262px",
486
490
  position: "absolute",
487
491
  justifyContent: "center",
488
492
  alignItems: "center",
489
- display: "flex",
490
493
  flexFlow: "column",
491
- zIndex: "9999"
494
+ zIndex: "9999",
495
+ left: "26px",
496
+ right: "26px"
492
497
  },
493
498
  titleStyleProps: {
494
499
  color: "#323130",
@@ -510,10 +515,14 @@ export const dummyDefaultProps = {
510
515
  },
511
516
  buttonGroupStyleProps: {
512
517
  display: "flex",
518
+ width: "auto",
519
+ height: "auto",
520
+ boxSizing: "border-box",
513
521
  flexFlow: "row",
514
522
  justifyContent: "center",
515
523
  alignItems: "center",
516
- gap: "10px"
524
+ gap: "10px",
525
+ marginBottom: "10px"
517
526
  },
518
527
  confirmButtonStyleProps: {
519
528
  backgroundColor: "rgba(9,72,159,1)",
@@ -577,7 +586,7 @@ export const dummyDefaultProps = {
577
586
  hideProactiveChatPane: false,
578
587
  hideReconnectChatPane: false,
579
588
  hideWebChatContainer: false,
580
- skipChatButtonRendering: false
589
+ hideStartChatButton: false
581
590
  },
582
591
  directLine: new MockAdapter(),
583
592
  downloadTranscriptProps: {
@@ -1062,8 +1071,8 @@ export const dummyDefaultProps = {
1062
1071
  titleText: "We're Offline",
1063
1072
  subtitleText: "No agents available",
1064
1073
  onClick: () => {} // Detailed implementation omitted
1065
-
1066
1074
  },
1075
+
1067
1076
  styleProps: {
1068
1077
  // ...[Existing chat button style props]
1069
1078
  iconStyleProps: {
@@ -1081,8 +1090,8 @@ export const dummyDefaultProps = {
1081
1090
  text: "We're Offline"
1082
1091
  },
1083
1092
  onMinimizeClick: () => {} // Detailed implementation omitted
1084
-
1085
1093
  },
1094
+
1086
1095
  styleProps: {
1087
1096
  // ...[Existing chat button style props]
1088
1097
  generalStyleProps: {
@@ -1182,6 +1191,47 @@ export const dummyDefaultProps = {
1182
1191
  },
1183
1192
  isCustomerVoiceSurveyCompact: undefined
1184
1193
  },
1194
+ preChatSurveyPaneProps: {
1195
+ controlProps: {
1196
+ id: "oc-lcw-prechatsurveypane-default",
1197
+ dir: "auto",
1198
+ hidePreChatSurveyPane: false,
1199
+ adaptiveCardHostConfig: "{\"fontFamily\":\"Segoe UI, Helvetica Neue, sans-serif\",\"containerStyles\":{\"default\":{\"foregroundColors\":{\"default\":{\"default\":\"#000000\"}},\"backgroundColor\":\"#FFFFFF\"}},\"actions\":{\"actionsOrientation\":\"Vertical\",\"actionAlignment\":\"stretch\"}}",
1200
+ payload: "{\"$schema\":\"http://adaptivecards.io/schemas/adaptive-card.json\",\"type\":\"AdaptiveCard\",\"version\":\"1.1\",\"body\":[{\"type\":\"TextBlock\",\"weight\":\"bolder\",\"text\":\"Please answer below questions.\"},{\"type\":\"Input.Text\",\"id\":\"1e5e4e7a-8f0b-ec11-b6e6-000d3a305d38\",\"label\":\"name pls?\",\"maxLength\":100,\"isRequired\":true,\"errorMessage\":\"Name is required\"},{\"type\":\"Input.Text\",\"id\":\"7f8f5d6d-995e-ec11-8f8f-000d3a31376e\",\"label\":\"multi\\nmulti\\nmulti\",\"style\":\"text\",\"isMultiline\":true,\"maxLength\":250},{\"type\":\"Input.ChoiceSet\",\"id\":\"e4bdf7cb-995e-ec11-8f8f-000d3a31376e\",\"label\":\"options\",\"isMultiSelect\":false,\"value\":\"1\",\"style\":\"compact\",\"choices\":[{\"title\":\"one\",\"value\":\"1\"},{\"title\":\"two\",\"value\":\"2\"},{\"title\":\"three\",\"value\":\"3\"}]},{\"type\":\"Input.Toggle\",\"id\":\"b26011d2-995e-ec11-8f8f-000d3a31376e\",\"title\":\"consent\",\"valueOn\":\"True\",\"valueOff\":\"False\",\"value\":\"false\"},{\"type\":\"TextBlock\",\"isSubtle\":true,\"text\":\"Fields marked with * are mandatory.\",\"wrap\":true}],\"actions\":[{\"type\":\"Action.Submit\",\"title\":\"Submit\",\"data\":{\"Type\":\"InputSubmit\"}}]}",
1201
+ onSubmit: function () {} // Detailed implementation omitted
1202
+ },
1203
+
1204
+ styleProps: {
1205
+ generalStyleProps: {
1206
+ borderStyle: "solid",
1207
+ borderRadius: "4px",
1208
+ borderWidth: "3px",
1209
+ backgroundColor: "#FFFFFF",
1210
+ borderColor: "#F1F1F1",
1211
+ overflowY: "auto",
1212
+ height: "inherit",
1213
+ width: "inherit"
1214
+ },
1215
+ customButtonStyleProps: {
1216
+ backgroundColor: "rgb(49, 95, 162)",
1217
+ color: "#FFFFFF",
1218
+ fontFamily: "Segoe UI, Arial, sans-serif",
1219
+ fontSize: "15px",
1220
+ height: "48px"
1221
+ },
1222
+ adaptiveCardContainerStyleProps: {
1223
+ border: "1px solid #ECECEC",
1224
+ borderRadius: "4px",
1225
+ margin: "3%"
1226
+ },
1227
+ customTextInputStyleProps: {
1228
+ height: "20px"
1229
+ },
1230
+ customMultilineTextInputStyleProps: {
1231
+ height: "52px"
1232
+ }
1233
+ }
1234
+ },
1185
1235
  proactiveChatPaneProps: {
1186
1236
  componentOverrides: {
1187
1237
  title: undefined,
@@ -1220,8 +1270,8 @@ export const dummyDefaultProps = {
1220
1270
  onClose: () => {},
1221
1271
  // Detailed implementation omitted
1222
1272
  onStart: () => {} // Detailed implementation omitted
1223
-
1224
1273
  },
1274
+
1225
1275
  styleProps: {
1226
1276
  generalStyleProps: {
1227
1277
  backgroundColor: "rgb(255, 255, 255)",
@@ -1352,8 +1402,8 @@ export const dummyDefaultProps = {
1352
1402
  onStartNewChat: () => {},
1353
1403
  // Detailed implementation omitted
1354
1404
  onMinimize: () => {} // Detailed implementation omitted
1355
-
1356
1405
  },
1406
+
1357
1407
  styleProps: {
1358
1408
  generalStyleProps: {
1359
1409
  backgroundColor: "rgb(255, 255, 255)",
@@ -1438,7 +1488,6 @@ export const dummyDefaultProps = {
1438
1488
  startNewChatButtonClassName: undefined
1439
1489
  }
1440
1490
  },
1441
- isReconnectEnabled: undefined,
1442
1491
  reconnectId: undefined,
1443
1492
  redirectInSameWindow: undefined
1444
1493
  },
@@ -7,16 +7,34 @@ import { WebChatStoreLoader } from "../../webchatcontainerstateful/webchatcontro
7
7
  import { defaultWebChatContainerStatefulProps } from "../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps";
8
8
  import { PostChatSurveyMode } from "../../postchatsurveypanestateful/enums/PostChatSurveyMode";
9
9
  import { Constants } from "../../../common/Constants";
10
- import { addDelayInMs, getWidgetEndChatEventName } from "../../../common/utils"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ import { addDelayInMs, getWidgetEndChatEventName } from "../../../common/utils";
11
+ import { getAuthClientFunction, handleAuthentication } from "./authHelper";
11
12
 
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
14
  const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, state) => {
13
15
  var _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4, _conversationDetails;
14
-
15
16
  const isPostChatEnabled = (_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable;
16
- const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode; // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+ const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode;
18
+
19
+ //Unable to end chat if token has expired
20
+ if (props.getAuthToken) {
21
+ const authClientFunction = getAuthClientFunction(props.chatConfig);
22
+ if (props.getAuthToken && authClientFunction) {
23
+ // set auth token to chat sdk before start chat
24
+ const authSuccess = await handleAuthentication(chatSDK, props.chatConfig, props.getAuthToken);
25
+ if (!authSuccess) {
26
+ TelemetryHelper.logActionEvent(LogLevel.ERROR, {
27
+ Event: TelemetryEvent.GetAuthTokenFailed,
28
+ ExceptionDetails: {
29
+ exception: "Unable to get auth token during end chat"
30
+ }
31
+ });
32
+ }
33
+ }
34
+ }
17
35
 
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
37
  let conversationDetails = undefined;
19
-
20
38
  try {
21
39
  conversationDetails = await chatSDK.getConversationDetails();
22
40
  } catch (erorr) {
@@ -27,12 +45,16 @@ const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, disp
27
45
  }
28
46
  });
29
47
  }
30
-
31
48
  if (isPostChatEnabled === "true" && ((_conversationDetails = conversationDetails) === null || _conversationDetails === void 0 ? void 0 : _conversationDetails.canRenderPostChat) === Constants.truePascal) {
32
49
  const skipEndChatSDK = false;
33
50
  const skipCloseChat = true;
51
+ const chatSession = await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.getCurrentLiveChatContext());
34
52
  await endChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat, false);
35
-
53
+ if (chatSession) {
54
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
+ chatSDK.chatToken = chatSession.chatToken ?? {};
56
+ chatSDK.requestId = chatSession.requestId;
57
+ }
36
58
  if (postChatSurveyMode === PostChatSurveyMode.Embed) {
37
59
  dispatch({
38
60
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
@@ -44,19 +66,29 @@ const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, disp
44
66
  };
45
67
  BroadcastService.postMessage(loadPostChatEvent);
46
68
  } else if (postChatSurveyMode === PostChatSurveyMode.Link) {
69
+ var _props$webChatContain, _props$webChatContain2;
47
70
  dispatch({
48
71
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
49
72
  payload: ConversationState.InActive
50
73
  });
51
- }
52
74
 
75
+ // Disable SendBox
76
+ if ((props === null || props === void 0 ? void 0 : (_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : (_props$webChatContain2 = _props$webChatContain.renderingMiddlewareProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.hideSendboxOnConversationEnd) !== false) {
77
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
78
+ setWebChatStyles(styles => {
79
+ return {
80
+ ...styles,
81
+ hideSendBox: true
82
+ };
83
+ });
84
+ }
85
+ }
53
86
  return;
54
87
  }
55
-
56
88
  await endChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, false, false, true);
57
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
-
89
+ };
59
90
 
91
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
92
  const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat, postMessageToOtherTab) => {
61
93
  if (!skipEndChatSDK) {
62
94
  try {
@@ -73,9 +105,9 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
73
105
  });
74
106
  postMessageToOtherTab = false;
75
107
  }
76
- } // Need to clear these states immediately when chat ended from OC.
77
-
108
+ }
78
109
 
110
+ // Need to clear these states immediately when chat ended from OC.
79
111
  dispatch({
80
112
  type: LiveChatWidgetActionType.SET_CUSTOM_CONTEXT,
81
113
  payload: undefined
@@ -88,15 +120,18 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
88
120
  type: LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
89
121
  payload: undefined
90
122
  });
91
-
123
+ dispatch({
124
+ type: LiveChatWidgetActionType.SET_RECONNECT_ID,
125
+ payload: undefined
126
+ });
92
127
  if (!skipCloseChat) {
93
128
  try {
94
- var _props$webChatContain;
95
-
129
+ var _props$webChatContain3;
96
130
  adapter === null || adapter === void 0 ? void 0 : adapter.end();
97
131
  setAdapter(undefined);
98
- setWebChatStyles({ ...defaultWebChatContainerStatefulProps.webChatStyles,
99
- ...((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles)
132
+ setWebChatStyles({
133
+ ...defaultWebChatContainerStatefulProps.webChatStyles,
134
+ ...((_props$webChatContain3 = props.webChatContainerProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.webChatStyles)
100
135
  });
101
136
  WebChatStoreLoader.store = null;
102
137
  dispatch({
@@ -127,10 +162,8 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
127
162
  proactiveChatInNewWindow: false
128
163
  }
129
164
  });
130
-
131
165
  if (postMessageToOtherTab) {
132
166
  var _chatSDK$omnichannelC, _chatSDK$omnichannelC2, _props$controlProps;
133
-
134
167
  const endChatEventName = getWidgetEndChatEventName(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC === void 0 ? void 0 : _chatSDK$omnichannelC.orgId, chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC2 = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC2 === void 0 ? void 0 : _chatSDK$omnichannelC2.widgetId, (props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "");
135
168
  BroadcastService.postMessage({
136
169
  eventName: endChatEventName
@@ -146,5 +179,4 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
146
179
  }
147
180
  }
148
181
  };
149
-
150
182
  export { prepareEndChat, endChat };
@@ -2,7 +2,6 @@ import { shouldShowChatButton, shouldShowProactiveChatPane } from "../../../cont
2
2
  import { defaultLiveChatWidgetGeneralStyles } from "./defaultStyles/defaultLiveChatWidgetGeneralStyles";
3
3
  export const getGeneralStylesForButton = state => {
4
4
  let generalStylesForButton = defaultLiveChatWidgetGeneralStyles;
5
-
6
5
  if (!shouldShowChatButton(state) && !shouldShowProactiveChatPane(state)) {
7
6
  generalStylesForButton = Object.assign({}, defaultLiveChatWidgetGeneralStyles, {
8
7
  boxShadow: "0px 0px 2px rgba(0, 0, 0, 0.16), 0px 4px 8px rgba(0, 0, 0, 0.12)",
@@ -12,6 +11,5 @@ export const getGeneralStylesForButton = state => {
12
11
  padding: "0.5"
13
12
  });
14
13
  }
15
-
16
14
  return generalStylesForButton;
17
15
  };
@@ -1,6 +1,7 @@
1
1
  import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
2
- import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
+ import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
3
3
 
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
5
  export const initCallingSdk = async (chatSDK, setVoiceVideoCallingSDK) => {
5
6
  try {
6
7
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -13,7 +14,6 @@ export const initCallingSdk = async (chatSDK, setVoiceVideoCallingSDK) => {
13
14
  });
14
15
  return true;
15
16
  }
16
-
17
17
  return false;
18
18
  } catch (error) {
19
19
  TelemetryHelper.logCallingEvent(LogLevel.ERROR, {
@@ -1,14 +1,13 @@
1
1
  import { defaultConfirmationPaneLocalizedTexts } from "../../confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts";
2
2
  export const initConfirmationPropsComposer = props => {
3
3
  var _props$confirmationPa, _props$footerProps, _props$footerProps$co, _props$footerProps2, _props$footerProps2$c, _props$confirmationPa2;
4
-
5
- const confirmationPanelocalizedTexts = { ...defaultConfirmationPaneLocalizedTexts,
4
+ const confirmationPanelocalizedTexts = {
5
+ ...defaultConfirmationPaneLocalizedTexts,
6
6
  ...(props === null || props === void 0 ? void 0 : (_props$confirmationPa = props.confirmationPaneProps) === null || _props$confirmationPa === void 0 ? void 0 : _props$confirmationPa.confirmationPaneLocalizedTexts)
7
7
  };
8
8
  let confirmationPaneInputs;
9
9
  const emailTranscriptDisabled = ((_props$footerProps = props.footerProps) === null || _props$footerProps === void 0 ? void 0 : (_props$footerProps$co = _props$footerProps.controlProps) === null || _props$footerProps$co === void 0 ? void 0 : _props$footerProps$co.hideEmailTranscriptButton) ?? false;
10
10
  const downloadTranscriptDisabled = ((_props$footerProps2 = props.footerProps) === null || _props$footerProps2 === void 0 ? void 0 : (_props$footerProps2$c = _props$footerProps2.controlProps) === null || _props$footerProps2$c === void 0 ? void 0 : _props$footerProps2$c.hideDownloadTranscriptButton) ?? false;
11
-
12
11
  if (!emailTranscriptDisabled && !downloadTranscriptDisabled) {
13
12
  confirmationPaneInputs = {
14
13
  title: confirmationPanelocalizedTexts.CLOSE_CONFIRMATION_DIALOG_TITLE_FOR_EMAIL_AND_DOWNLOAD_TRANSCRIPT_ENABLED,
@@ -30,8 +29,8 @@ export const initConfirmationPropsComposer = props => {
30
29
  description: confirmationPanelocalizedTexts.CLOSE_CONFIRMATION_DIALOG_DESCRIPTION_DEFAULT
31
30
  };
32
31
  }
33
-
34
- const confirmationPaneProps = { ...props.confirmationPaneProps,
32
+ const confirmationPaneProps = {
33
+ ...props.confirmationPaneProps,
35
34
  controlProps: {
36
35
  titleText: confirmationPaneInputs.title,
37
36
  subtitleText: confirmationPaneInputs.description,
@@ -29,41 +29,39 @@ import preProcessingMiddleware from "../../webchatcontainerstateful/webchatcontr
29
29
  import sanitizationMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware";
30
30
  import { createCardActionMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware";
31
31
  import createMessageTimeStampMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware";
32
- import { Constants } from "../../../common/Constants"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
+ import { Constants } from "../../../common/Constants";
33
33
 
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
35
  export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatStyles) => {
35
36
  var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4, _state$domainStates$l8, _state$domainStates$l9, _props$webChatContain7, _props$webChatContain8, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain9, _props$webChatContain10, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain11, _props$webChatContain12, _defaultWebChatContai, _props$webChatContain13, _props$webChatContain14, _props$webChatContain15, _props$webChatContain16, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain17, _props$webChatContain18, _defaultWebChatContai2, _props$webChatContain19, _props$webChatContain20, _defaultWebChatContai3, _props$webChatContain21, _props$webChatContain22;
36
-
37
- const localizedTexts = { ...defaultMiddlewareLocalizedTexts,
37
+ const localizedTexts = {
38
+ ...defaultMiddlewareLocalizedTexts,
38
39
  ...((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.localizedTexts)
39
40
  };
40
- const disableNewLineMarkdownSupport = ((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.disableNewLineMarkdownSupport) ?? defaultWebChatContainerStatefulProps.disableNewLineMarkdownSupport; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
41
-
41
+ const disableNewLineMarkdownSupport = ((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.disableNewLineMarkdownSupport) ?? defaultWebChatContainerStatefulProps.disableNewLineMarkdownSupport;
42
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
42
43
  const markdown = createMarkdown(((_props$webChatContain3 = props.webChatContainerProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.disableMarkdownMessageFormatting) ?? defaultWebChatContainerStatefulProps.disableMarkdownMessageFormatting, disableNewLineMarkdownSupport);
43
44
  const isPostChatEnabled = (_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable;
44
- const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode; // Initialize Web Chat's redux store
45
+ const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode;
45
46
 
47
+ // Initialize Web Chat's redux store
46
48
  let webChatStore = WebChatStoreLoader.store;
47
-
48
49
  if (!webChatStore) {
49
50
  var _state$domainStates$l5, _state$domainStates$l6, _state$domainStates$l7, _props$webChatContain6;
50
-
51
51
  const conversationEndCallback = async () => {
52
52
  var _props$webChatContain4, _props$webChatContain5;
53
-
54
53
  TelemetryHelper.logActionEvent(LogLevel.INFO, {
55
54
  Event: TelemetryEvent.ConversationEndedThreadEventReceived,
56
55
  Description: "Conversation is ended by agent side or by timeout."
57
56
  });
58
-
59
57
  if ((props === null || props === void 0 ? void 0 : (_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : (_props$webChatContain5 = _props$webChatContain4.renderingMiddlewareProps) === null || _props$webChatContain5 === void 0 ? void 0 : _props$webChatContain5.hideSendboxOnConversationEnd) !== false) {
60
58
  setWebChatStyles(styles => {
61
- return { ...styles,
59
+ return {
60
+ ...styles,
62
61
  hideSendBox: true
63
62
  };
64
63
  });
65
64
  }
66
-
67
65
  if (isPostChatEnabled === "true") {
68
66
  if (postChatSurveyMode === PostChatSurveyMode.Embed) {
69
67
  WebChatStoreLoader.store = null;
@@ -92,7 +90,6 @@ export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatS
92
90
  payload: true
93
91
  });
94
92
  }
95
-
96
93
  dispatch({
97
94
  type: LiveChatWidgetActionType.SET_CHAT_TOKEN,
98
95
  payload: undefined
@@ -102,15 +99,17 @@ export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatS
102
99
  payload: undefined
103
100
  });
104
101
  };
105
-
106
- webChatStore = createStore({}, //initial state
107
- preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l5 = state.domainStates.liveChatConfig) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.allowedFileExtensions, (_state$domainStates$l6 = state.domainStates.liveChatConfig) === null || _state$domainStates$l6 === void 0 ? void 0 : _state$domainStates$l6.maxUploadFileSize, localizedTexts), channelDataMiddleware, createConversationEndMiddleware(conversationEndCallback), createDataMaskingMiddleware((_state$domainStates$l7 = state.domainStates.liveChatConfig) === null || _state$domainStates$l7 === void 0 ? void 0 : _state$domainStates$l7.DataMaskingInfo), createMessageTimeStampMiddleware, gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware, createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware, // eslint-disable-next-line @typescript-eslint/no-explicit-any
102
+ webChatStore = createStore({},
103
+ //initial state
104
+ preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l5 = state.domainStates.liveChatConfig) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.allowedFileExtensions, (_state$domainStates$l6 = state.domainStates.liveChatConfig) === null || _state$domainStates$l6 === void 0 ? void 0 : _state$domainStates$l6.maxUploadFileSize, localizedTexts), channelDataMiddleware, createConversationEndMiddleware(conversationEndCallback), createDataMaskingMiddleware((_state$domainStates$l7 = state.domainStates.liveChatConfig) === null || _state$domainStates$l7 === void 0 ? void 0 : _state$domainStates$l7.DataMaskingInfo), createMessageTimeStampMiddleware, gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware, createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware,
105
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
108
106
  ...(((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.storeMiddlewares) ?? []));
109
107
  WebChatStoreLoader.store = webChatStore;
110
- } // Initialize the remaining Web Chat props
111
-
108
+ }
112
109
 
113
- const webChatProps = { ...defaultWebChatContainerStatefulProps.webChatProps,
110
+ // Initialize the remaining Web Chat props
111
+ const webChatProps = {
112
+ ...defaultWebChatContainerStatefulProps.webChatProps,
114
113
  dir: state.domainStates.globalDir,
115
114
  locale: changeLanguageCodeFormatForWebChat(getLocaleStringFromId((_state$domainStates$l8 = state.domainStates.liveChatConfig) === null || _state$domainStates$l8 === void 0 ? void 0 : (_state$domainStates$l9 = _state$domainStates$l8.ChatWidgetLanguage) === null || _state$domainStates$l9 === void 0 ? void 0 : _state$domainStates$l9.msdyn_localeid)),
116
115
  store: webChatStore,