@microsoft/omnichannel-chat-widget 1.8.3-main.ec1328d → 1.8.4-main.424a580

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 (189) hide show
  1. package/lib/cjs/common/Constants.js +7 -0
  2. package/lib/cjs/common/facades/FacadeChatSDK.js +6 -0
  3. package/lib/cjs/common/telemetry/AppInsightsEvents.js +4 -5
  4. package/lib/cjs/common/telemetry/TelemetryConstants.js +47 -2
  5. package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +26 -10
  6. package/lib/cjs/common/utils/SecureEventBus.js +307 -0
  7. package/lib/cjs/common/utils/dispatchCustomEvent.js +25 -0
  8. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +16 -4
  9. package/lib/cjs/components/citationpanestateful/CitationDim.js +29 -0
  10. package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +218 -0
  11. package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +70 -0
  12. package/lib/cjs/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
  13. package/lib/cjs/components/headerstateful/HeaderStateful.js +8 -2
  14. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +4 -4
  15. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +127 -0
  16. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
  17. package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +15 -0
  18. package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +287 -0
  19. package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
  20. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +18 -0
  21. package/lib/cjs/components/livechatwidget/common/endChat.js +28 -3
  22. package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
  23. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +16 -7
  24. package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
  25. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
  26. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
  27. package/lib/cjs/components/livechatwidget/common/startChat.js +10 -5
  28. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +24 -4
  29. package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +8 -2
  30. package/lib/cjs/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
  31. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +51 -8
  32. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +29 -2
  33. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +12 -3
  34. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +127 -11
  35. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
  36. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
  37. package/lib/cjs/components/webchatcontainerstateful/common/activities/botActivity.js +14 -0
  38. package/lib/cjs/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +17 -0
  39. package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +97 -0
  40. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +3 -1
  41. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +1 -1
  42. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
  43. package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +36 -2
  44. package/lib/cjs/components/webchatcontainerstateful/common/utils/fontUtils.js +28 -0
  45. package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +59 -0
  46. package/lib/cjs/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
  47. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +122 -0
  48. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +10 -0
  49. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +47 -0
  50. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1038 -0
  51. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +34 -0
  52. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +50 -1
  53. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +16 -2
  54. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
  55. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +20 -0
  56. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
  57. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +2 -2
  58. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +59 -0
  59. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +5 -3
  60. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -2
  61. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +97 -30
  62. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
  63. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
  64. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +47 -45
  65. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +9 -1
  66. package/lib/cjs/contexts/createReducer.js +30 -0
  67. package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
  68. package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
  69. package/lib/cjs/index.js +9 -1
  70. package/lib/cjs/plugins/newMessageEventHandler.js +4 -1
  71. package/lib/esm/common/Constants.js +7 -0
  72. package/lib/esm/common/facades/FacadeChatSDK.js +6 -0
  73. package/lib/esm/common/telemetry/AppInsightsEvents.js +4 -5
  74. package/lib/esm/common/telemetry/TelemetryConstants.js +45 -1
  75. package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +27 -11
  76. package/lib/esm/common/utils/SecureEventBus.js +328 -0
  77. package/lib/esm/common/utils/dispatchCustomEvent.js +18 -0
  78. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +17 -5
  79. package/lib/esm/components/citationpanestateful/CitationDim.js +20 -0
  80. package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +207 -0
  81. package/lib/esm/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +61 -0
  82. package/lib/esm/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
  83. package/lib/esm/components/headerstateful/HeaderStateful.js +9 -3
  84. package/lib/esm/components/livechatwidget/LiveChatWidget.js +4 -4
  85. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +120 -0
  86. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
  87. package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +8 -0
  88. package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +280 -0
  89. package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
  90. package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +11 -0
  91. package/lib/esm/components/livechatwidget/common/endChat.js +29 -4
  92. package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
  93. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +16 -7
  94. package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
  95. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
  96. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
  97. package/lib/esm/components/livechatwidget/common/startChat.js +12 -7
  98. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +23 -4
  99. package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
  100. package/lib/esm/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
  101. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +52 -9
  102. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +31 -4
  103. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -4
  104. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +130 -12
  105. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
  106. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
  107. package/lib/esm/components/webchatcontainerstateful/common/activities/botActivity.js +7 -0
  108. package/lib/esm/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +9 -0
  109. package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +90 -0
  110. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +3 -1
  111. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
  112. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
  113. package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +32 -0
  114. package/lib/esm/components/webchatcontainerstateful/common/utils/fontUtils.js +21 -0
  115. package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +51 -0
  116. package/lib/esm/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
  117. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +115 -0
  118. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +3 -0
  119. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +39 -0
  120. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1060 -0
  121. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +25 -0
  122. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +48 -1
  123. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +13 -0
  124. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
  125. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +13 -0
  126. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
  127. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +1 -1
  128. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +52 -0
  129. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +3 -2
  130. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +1 -1
  131. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +98 -30
  132. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
  133. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
  134. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +47 -45
  135. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +9 -1
  136. package/lib/esm/contexts/createReducer.js +30 -0
  137. package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
  138. package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
  139. package/lib/esm/index.js +1 -0
  140. package/lib/esm/plugins/newMessageEventHandler.js +4 -1
  141. package/lib/types/common/Constants.d.ts +6 -0
  142. package/lib/types/common/facades/FacadeChatSDK.d.ts +3 -1
  143. package/lib/types/common/telemetry/TelemetryConstants.d.ts +42 -2
  144. package/lib/types/common/utils/SecureEventBus.d.ts +159 -0
  145. package/lib/types/common/utils/dispatchCustomEvent.d.ts +2 -0
  146. package/lib/types/components/citationpanestateful/CitationDim.d.ts +5 -0
  147. package/lib/types/components/citationpanestateful/CitationPaneStateful.d.ts +4 -0
  148. package/lib/types/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.d.ts +11 -0
  149. package/lib/types/components/citationpanestateful/interfaces/ICitationPaneStatefulProps.d.ts +19 -0
  150. package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +1 -1
  151. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +1 -1
  152. package/lib/types/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.d.ts +45 -0
  153. package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +7 -0
  154. package/lib/types/components/livechatwidget/common/PersistentConversationHandler.d.ts +28 -0
  155. package/lib/types/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.d.ts +2 -0
  156. package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +2 -1
  157. package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +1 -0
  158. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +5 -1
  159. package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +5 -3
  160. package/lib/types/components/livechatwidget/interfaces/IPersistentChatHistoryProps.d.ts +12 -0
  161. package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +4 -2
  162. package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +5 -0
  163. package/lib/types/components/webchatcontainerstateful/common/activities/botActivity.d.ts +7 -0
  164. package/lib/types/components/webchatcontainerstateful/common/activities/conversationDividerActivity.d.ts +10 -0
  165. package/lib/types/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.d.ts +2 -0
  166. package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +6 -1
  167. package/lib/types/components/webchatcontainerstateful/common/utils/fontUtils.d.ts +10 -0
  168. package/lib/types/components/webchatcontainerstateful/hooks/usePersistentChatHistory.d.ts +4 -0
  169. package/lib/types/components/webchatcontainerstateful/interfaces/ICitation.d.ts +12 -0
  170. package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +7 -0
  171. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.d.ts +3 -0
  172. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.d.ts +4 -0
  173. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +326 -0
  174. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.d.ts +8 -0
  175. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +2 -1
  176. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -0
  177. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.d.ts +2 -0
  178. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.d.ts +2 -0
  179. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.d.ts +3 -4
  180. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +1 -1
  181. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +2 -2
  182. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -0
  183. package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +6 -0
  184. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +47 -45
  185. package/lib/types/index.d.ts +1 -0
  186. package/package.json +3 -3
  187. /package/lib/cjs/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
  188. /package/lib/esm/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
  189. /package/lib/types/components/confirmationpanestateful/interfaces/{IConfirmationPaneLocalizedText.d.ts → IConfirmationPaneLocalizedTexts.d.ts} +0 -0
@@ -3,49 +3,51 @@ export let LiveChatWidgetActionType;
3
3
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_ELEMENT_ID"] = 0] = "SET_WIDGET_ELEMENT_ID";
4
4
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RENDERING_MIDDLEWARE_PROPS"] = 1] = "SET_RENDERING_MIDDLEWARE_PROPS";
5
5
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MIDDLEWARE_LOCALIZED_TEXTS"] = 2] = "SET_MIDDLEWARE_LOCALIZED_TEXTS";
6
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_GLOBAL_DIR"] = 3] = "SET_GLOBAL_DIR";
7
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MINIMIZED"] = 4] = "SET_MINIMIZED";
8
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_STATE"] = 5] = "SET_CONVERSATION_STATE";
9
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT_ID"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT_ID";
10
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_FAILING"] = 7] = "SET_START_CHAT_FAILING";
11
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_FAILURE_TYPE"] = 8] = "SET_START_CHAT_FAILURE_TYPE";
12
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 9] = "SET_OUTSIDE_OPERATING_HOURS";
13
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 10] = "SET_PRE_CHAT_SURVEY_RESPONSE";
14
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 11] = "SET_CUSTOM_CONTEXT";
15
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 12] = "SET_SHOW_CONFIRMATION";
16
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 13] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
17
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 14] = "SET_PRECHAT_RESPONSE_EMAIL";
18
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 15] = "SET_AUDIO_NOTIFICATION";
19
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 16] = "SET_E2VV_ENABLED";
20
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 17] = "SET_POST_CHAT_CONTEXT";
21
- LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 18] = "SHOW_CALLING_CONTAINER";
22
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 19] = "SET_INCOMING_CALL";
23
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 20] = "DISABLE_VIDEO_CALL";
24
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 21] = "DISABLE_LOCAL_VIDEO";
25
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 22] = "DISABLE_REMOTE_VIDEO";
26
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 23] = "SET_CHAT_TOKEN";
27
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_BUTTON_DISPLAY"] = 24] = "SET_START_CHAT_BUTTON_DISPLAY";
28
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 25] = "SET_PROACTIVE_CHAT_PARAMS";
29
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 26] = "SET_TELEMETRY_DATA";
30
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 27] = "SET_RECONNECT_ID";
31
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 28] = "SET_UNREAD_MESSAGE_COUNT";
32
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 29] = "SET_FOCUS_CHAT_BUTTON";
33
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED"] = 30] = "SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED";
34
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY"] = 31] = "SET_CONVERSATION_ENDED_BY";
35
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 32] = "SET_WIDGET_STATE";
36
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 33] = "SET_LIVE_CHAT_CONTEXT";
37
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 34] = "SET_BOT_OAUTH_SIGNIN_ID";
38
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 35] = "SET_WIDGET_SIZE";
39
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 36] = "SET_WIDGET_INSTANCE_ID";
40
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONFIG"] = 37] = "SET_LIVE_CHAT_CONFIG";
41
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_WORKFLOW_IN_PROGRESS"] = 38] = "SET_POST_CHAT_WORKFLOW_IN_PROGRESS";
42
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INITIAL_CHAT_SDK_REQUEST_ID"] = 39] = "SET_INITIAL_CHAT_SDK_REQUEST_ID";
43
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOULD_USE_BOT_SURVEY"] = 40] = "SET_SHOULD_USE_BOT_SURVEY";
44
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_DISCONNECT_EVENT_RECEIVED"] = 41] = "SET_CHAT_DISCONNECT_EVENT_RECEIVED";
45
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SURVEY_MODE"] = 42] = "SET_SURVEY_MODE";
46
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONFIRMATION_STATE"] = 43] = "SET_CONFIRMATION_STATE";
47
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_PARTICIPANT_TYPE"] = 44] = "SET_POST_CHAT_PARTICIPANT_TYPE";
48
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_ENABLED"] = 45] = "SET_CONVERSATIONAL_SURVEY_ENABLED";
49
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_DISPLAY"] = 46] = "SET_CONVERSATIONAL_SURVEY_DISPLAY";
50
- LiveChatWidgetActionType[LiveChatWidgetActionType["GET_IN_MEMORY_STATE"] = 47] = "GET_IN_MEMORY_STATE";
6
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CITATIONS"] = 3] = "SET_CITATIONS";
7
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_GLOBAL_DIR"] = 4] = "SET_GLOBAL_DIR";
8
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MINIMIZED"] = 5] = "SET_MINIMIZED";
9
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_STATE"] = 6] = "SET_CONVERSATION_STATE";
10
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT_ID"] = 7] = "SET_PREVIOUS_FOCUSED_ELEMENT_ID";
11
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_FAILING"] = 8] = "SET_START_CHAT_FAILING";
12
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_FAILURE_TYPE"] = 9] = "SET_START_CHAT_FAILURE_TYPE";
13
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 10] = "SET_OUTSIDE_OPERATING_HOURS";
14
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 11] = "SET_PRE_CHAT_SURVEY_RESPONSE";
15
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 12] = "SET_CUSTOM_CONTEXT";
16
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 13] = "SET_SHOW_CONFIRMATION";
17
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 14] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
18
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 15] = "SET_PRECHAT_RESPONSE_EMAIL";
19
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 16] = "SET_AUDIO_NOTIFICATION";
20
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 17] = "SET_E2VV_ENABLED";
21
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 18] = "SET_POST_CHAT_CONTEXT";
22
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 19] = "SHOW_CALLING_CONTAINER";
23
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 20] = "SET_INCOMING_CALL";
24
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 21] = "DISABLE_VIDEO_CALL";
25
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 22] = "DISABLE_LOCAL_VIDEO";
26
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 23] = "DISABLE_REMOTE_VIDEO";
27
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 24] = "SET_CHAT_TOKEN";
28
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_BUTTON_DISPLAY"] = 25] = "SET_START_CHAT_BUTTON_DISPLAY";
29
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 26] = "SET_PROACTIVE_CHAT_PARAMS";
30
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 27] = "SET_TELEMETRY_DATA";
31
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 28] = "SET_RECONNECT_ID";
32
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 29] = "SET_UNREAD_MESSAGE_COUNT";
33
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 30] = "SET_FOCUS_CHAT_BUTTON";
34
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED"] = 31] = "SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED";
35
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY"] = 32] = "SET_CONVERSATION_ENDED_BY";
36
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 33] = "SET_WIDGET_STATE";
37
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 34] = "SET_LIVE_CHAT_CONTEXT";
38
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 35] = "SET_BOT_OAUTH_SIGNIN_ID";
39
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 36] = "SET_WIDGET_SIZE";
40
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 37] = "SET_WIDGET_INSTANCE_ID";
41
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONFIG"] = 38] = "SET_LIVE_CHAT_CONFIG";
42
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_WORKFLOW_IN_PROGRESS"] = 39] = "SET_POST_CHAT_WORKFLOW_IN_PROGRESS";
43
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INITIAL_CHAT_SDK_REQUEST_ID"] = 40] = "SET_INITIAL_CHAT_SDK_REQUEST_ID";
44
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOULD_USE_BOT_SURVEY"] = 41] = "SET_SHOULD_USE_BOT_SURVEY";
45
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_DISCONNECT_EVENT_RECEIVED"] = 42] = "SET_CHAT_DISCONNECT_EVENT_RECEIVED";
46
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SURVEY_MODE"] = 43] = "SET_SURVEY_MODE";
47
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONFIRMATION_STATE"] = 44] = "SET_CONFIRMATION_STATE";
48
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_PARTICIPANT_TYPE"] = 45] = "SET_POST_CHAT_PARTICIPANT_TYPE";
49
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_ENABLED"] = 46] = "SET_CONVERSATIONAL_SURVEY_ENABLED";
50
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_DISPLAY"] = 47] = "SET_CONVERSATIONAL_SURVEY_DISPLAY";
51
+ LiveChatWidgetActionType[LiveChatWidgetActionType["GET_IN_MEMORY_STATE"] = 48] = "GET_IN_MEMORY_STATE";
52
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_AVATAR_INITIALS"] = 49] = "SET_BOT_AVATAR_INITIALS";
51
53
  })(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
@@ -4,6 +4,7 @@ import { ConversationState } from "./ConversationState";
4
4
  import { StartChatFailureType } from "./StartChatFailureType";
5
5
  import { defaultClientDataStoreProvider } from "../../common/storage/default/defaultClientDataStoreProvider";
6
6
  import { defaultMiddlewareLocalizedTexts } from "../../components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
7
+ import { defaultWebChatStyles } from "../../components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles";
7
8
  export const getLiveChatWidgetContextInitialState = props => {
8
9
  var _props$controlProps, _props$webChatContain;
9
10
  const isOutsideOperatingHours = () => {
@@ -33,12 +34,18 @@ export const getLiveChatWidgetContextInitialState = props => {
33
34
  initialStateFromCache.domainStates.liveChatConfig = props.chatConfig;
34
35
  // Cache the result of isOutsideOperatingHours() to ensure consistency
35
36
  initialStateFromCache.appStates.outsideOperatingHours = outsideOperatingHours;
37
+ // Backward compatibility: if botAvatarInitials not cached (older sessions), seed with default
38
+ if (!initialStateFromCache.domainStates.botAvatarInitials) {
39
+ initialStateFromCache.domainStates.botAvatarInitials = defaultWebChatStyles.botAvatarInitials;
40
+ }
36
41
  return initialStateFromCache;
37
42
  }
38
43
  const LiveChatWidgetContextInitialState = {
39
44
  domainStates: {
40
45
  liveChatConfig: props.chatConfig,
41
46
  widgetElementId: "",
47
+ // Map of citation id => content injected by citations middleware
48
+ citations: {},
42
49
  renderingMiddlewareProps: (_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.renderingMiddlewareProps,
43
50
  middlewareLocalizedTexts: defaultMiddlewareLocalizedTexts,
44
51
  preChatSurveyResponse: "{}",
@@ -54,7 +61,8 @@ export const getLiveChatWidgetContextInitialState = props => {
54
61
  transcriptRequestId: "",
55
62
  confirmationPaneConfirmedOptionClicked: false,
56
63
  confirmationState: ConfirmationState.NotSet,
57
- startChatFailureType: StartChatFailureType.Generic
64
+ startChatFailureType: StartChatFailureType.Generic,
65
+ botAvatarInitials: defaultWebChatStyles.botAvatarInitials
58
66
  },
59
67
  appStates: {
60
68
  conversationState: ConversationState.Closed,
@@ -62,6 +62,21 @@ const reducer = (state, action) => {
62
62
  middlewareLocalizedTexts: action.payload
63
63
  }
64
64
  };
65
+ case LiveChatWidgetActionType.SET_CITATIONS:
66
+ inMemory = {
67
+ ...inMemory,
68
+ domainStates: {
69
+ ...inMemory.domainStates,
70
+ citations: action.payload
71
+ }
72
+ };
73
+ return {
74
+ ...state,
75
+ domainStates: {
76
+ ...state.domainStates,
77
+ citations: action.payload
78
+ }
79
+ };
65
80
  case LiveChatWidgetActionType.SET_GLOBAL_DIR:
66
81
  inMemory = {
67
82
  ...inMemory,
@@ -539,6 +554,21 @@ const reducer = (state, action) => {
539
554
  widgetSize: action.payload
540
555
  }
541
556
  };
557
+ case LiveChatWidgetActionType.SET_BOT_AVATAR_INITIALS:
558
+ inMemory = {
559
+ ...inMemory,
560
+ domainStates: {
561
+ ...inMemory.domainStates,
562
+ botAvatarInitials: action.payload
563
+ }
564
+ };
565
+ return {
566
+ ...state,
567
+ domainStates: {
568
+ ...state.domainStates,
569
+ botAvatarInitials: action.payload
570
+ }
571
+ };
542
572
  case LiveChatWidgetActionType.SET_WIDGET_INSTANCE_ID:
543
573
  inMemory = {
544
574
  ...inMemory,
@@ -31,7 +31,7 @@ export const createTrackingForFirstMessage = () => {
31
31
  * Starts tracking the time for the first bot message after widget loads.
32
32
  * Sets a 5-second timeout to auto-reset if no bot message is received.
33
33
  */
34
- const widgetLoadListener = BroadcastService.getMessageByEventName(TelemetryEvent.WidgetLoadComplete).subscribe(() => {
34
+ const widgetLoadListener = BroadcastService.getMessageByEventName(TelemetryEvent.StartChatComplete).subscribe(() => {
35
35
  if (isTracking) return;
36
36
  isTracking = true;
37
37
  startTime = new Date().getTime();
@@ -86,7 +86,8 @@ export const createTrackingForFirstMessage = () => {
86
86
  CustomProperties: {
87
87
  elapsedTime,
88
88
  widgetLoadedAt: startTime,
89
- botMessage: stopTrackingMessage
89
+ botMessage: stopTrackingMessage,
90
+ type: payload === null || payload === void 0 ? void 0 : payload.type
90
91
  }
91
92
  });
92
93
  disconnectListener();
@@ -7,6 +7,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
7
7
  import { BroadcastEvent, LogLevel, TelemetryEvent } from "../common/telemetry/TelemetryConstants";
8
8
  import { BroadcastService } from "@microsoft/omnichannel-chat-components";
9
9
  import { TelemetryHelper } from "../common/telemetry/TelemetryHelper";
10
+ import { Constants } from "../common/Constants";
10
11
  export let FirstResponseLatencyTracker = /*#__PURE__*/function () {
11
12
  function FirstResponseLatencyTracker() {
12
13
  _classCallCheck(this, FirstResponseLatencyTracker);
@@ -127,7 +128,8 @@ export let FirstResponseLatencyTracker = /*#__PURE__*/function () {
127
128
  CustomProperties: {
128
129
  elapsedTime,
129
130
  userMessage: this.startTrackingMessage,
130
- botMessage: this.stopTrackingMessage
131
+ botMessage: this.stopTrackingMessage,
132
+ type: payload === null || payload === void 0 ? void 0 : payload.type
131
133
  }
132
134
  });
133
135
  }
@@ -168,7 +170,9 @@ export let FirstResponseLatencyTracker = /*#__PURE__*/function () {
168
170
  value: function stopClock(payload) {
169
171
  try {
170
172
  if (!payload || !payload.Id) {
171
- throw new Error("Invalid payload");
173
+ if ((payload === null || payload === void 0 ? void 0 : payload.type) !== Constants.typing) {
174
+ throw new Error("Invalid payload");
175
+ }
172
176
  }
173
177
 
174
178
  // Only allow stopTracking if sender is valid and tracking is active
package/lib/esm/index.js CHANGED
@@ -7,5 +7,6 @@ import useFacadeChatSDKStore from "./hooks/useFacadeChatSDKStore";
7
7
  export { default as LiveChatWidget } from "./components/livechatwidget/LiveChatWidget";
8
8
  export { getMockChatSDKIfApplicable } from "./components/livechatwidget/common/getMockChatSDKIfApplicable";
9
9
  export { getWidgetCacheId, getWidgetEndChatEventName, ConversationState };
10
+ export { LiveChatWidgetMockType } from "./components/livechatwidget/interfaces/IMockProps";
10
11
  export { encodeComponentString, decodeComponentString, BroadcastService, useChatSDKStore, useChatContextStore, useFacadeChatSDKStore };
11
12
  export * from "./components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares";
@@ -78,6 +78,9 @@ export const createOnNewAdapterActivityHandler = (chatId, userId, startTime) =>
78
78
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
79
79
  const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
80
80
  if (messageHasNoTags && messageHasNoText && messageHasNoAttachments) {
81
+ if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.typing) {
82
+ return true;
83
+ }
81
84
  return false;
82
85
  }
83
86
  return true;
@@ -106,7 +109,7 @@ export const createOnNewAdapterActivityHandler = (chatId, userId, startTime) =>
106
109
  });
107
110
  };
108
111
  const raiseMessageEvent = activity => {
109
- if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message) {
112
+ if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message || (activity === null || activity === void 0 ? void 0 : activity.type) === Constants.typing) {
110
113
  const scenarioType = getScenarioType(activity);
111
114
  switch (scenarioType) {
112
115
  case ScenarioType.UserSendMessageStrategy:
@@ -28,6 +28,9 @@ export declare class Constants {
28
28
  static readonly channelIdKey = "ChannelId-";
29
29
  static readonly ChannelId = "lcw";
30
30
  static readonly CustomerTag = "FromCustomer";
31
+ static persistentChatHistoryMessageTag: string;
32
+ static persistentChatHistoryMessagePullTriggerTag: string;
33
+ static conversationDividerTag: string;
31
34
  static readonly GifContentType = "image/gif";
32
35
  static readonly video = "video";
33
36
  static readonly audio = "audio";
@@ -43,6 +46,7 @@ export declare class Constants {
43
46
  static readonly averageWaitTimeMessageTag = "averagewaittime";
44
47
  static readonly message = "message";
45
48
  static readonly hiddenTag = "Hidden";
49
+ static readonly typing = "typing";
46
50
  static readonly prefixTimestampTag = "ServerMessageTimestamp_";
47
51
  static readonly acsChannel = "ACS_CHANNEL";
48
52
  static readonly publicMessageTag = "public";
@@ -153,6 +157,8 @@ export declare class HtmlAttributeNames {
153
157
  static readonly adaptiveCardTextBlockClassName = "ac-textBlock";
154
158
  static readonly adaptiveCardToggleInputClassName = "ac-toggleInput";
155
159
  static readonly adaptiveCardActionSetClassName = "ac-actionSet";
160
+ static readonly ocwCitationPaneClassName = "ocw-citation-pane";
161
+ static readonly ocwCitationPaneTitle = "Citation";
156
162
  }
157
163
  export declare class WebChatMiddlewareConstants {
158
164
  static readonly nextVisibleActivity = "nextVisibleActivity";
@@ -1,4 +1,4 @@
1
- import { ChatAdapter, ChatSDKMessage, GetAgentAvailabilityResponse, GetLiveChatTranscriptResponse, GetVoiceVideoCallingResponse, IFileInfo, IRawMessage, MaskingRules, OmnichannelChatSDK, VoiceVideoCallingOptionalParams } from "@microsoft/omnichannel-chat-sdk";
1
+ import { ChatAdapter, ChatSDKMessage, GetAgentAvailabilityResponse, GetLiveChatTranscriptResponse, GetPersistentChatHistoryResponse, GetVoiceVideoCallingResponse, IFileInfo, IRawMessage, MaskingRules, OmnichannelChatSDK, VoiceVideoCallingOptionalParams } from "@microsoft/omnichannel-chat-sdk";
2
2
  import { IFacadeChatSDKInput } from "./types/IFacadeChatSDKInput";
3
3
  import ChatAdapterOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/messaging/ChatAdapterOptionalParams";
4
4
  import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
@@ -13,6 +13,7 @@ import GetChatTokenOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core
13
13
  import GetConversationDetailsOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetConversationDetailsOptionalParams";
14
14
  import GetLiveChatConfigOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetLiveChatConfigOptionalParams";
15
15
  import GetLiveChatTranscriptOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetLiveChatTranscriptOptionalParams";
16
+ import GetPersistentChatHistoryOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetPersistentChatHistoryOptionalParams";
16
17
  import IChatToken from "@microsoft/omnichannel-chat-sdk/lib/external/IC3Adapter/IChatToken";
17
18
  import IFileMetadata from "@microsoft/omnichannel-ic3core/lib/model/IFileMetadata";
18
19
  import IMessage from "@microsoft/omnichannel-ic3core/lib/model/IMessage";
@@ -73,4 +74,5 @@ export declare class FacadeChatSDK {
73
74
  getPostChatSurveyContext(): Promise<PostChatContext>;
74
75
  getAgentAvailability(optionalParams?: GetAgentAvailabilityOptionalParams): Promise<GetAgentAvailabilityResponse>;
75
76
  getReconnectableChats(reconnectableChatsParams?: any): Promise<any>;
77
+ fetchPersistentConversationHistory(getPersistentChatHistoryOptionalParams?: GetPersistentChatHistoryOptionalParams): Promise<GetPersistentChatHistoryResponse>;
76
78
  }
@@ -56,9 +56,11 @@ export declare enum BroadcastEvent {
56
56
  SyncMinimize = "SyncMinimize",
57
57
  OnWidgetError = "OnWidgetError",
58
58
  FMLTrackingCompletedAck = "FMLTrackingCompletedAck",
59
- FMLTrackingCompleted = "FMLTrackingCompleted"
59
+ FMLTrackingCompleted = "FMLTrackingCompleted",
60
+ PersistentConversationReset = "PersistentConversationReset"
60
61
  }
61
62
  export declare enum TelemetryEvent {
63
+ FetchPersistentChatHistoryFailed = "FetchPersistentChatHistoryFailed",
62
64
  CallAdded = "CallAdded",
63
65
  LocalVideoStreamAdded = "LocalVideoStreamAdded",
64
66
  LocalVideoStreamRemoved = "LocalVideoStreamRemoved",
@@ -104,6 +106,7 @@ export declare enum TelemetryEvent {
104
106
  EndChatFailed = "EndChatFailed",
105
107
  SettingCustomContext = "SettingCustomContext",
106
108
  WebChatLoaded = "WebChatLoaded",
109
+ PersistentChatHistoryEnabled = "PersistentChatHistoryEnabled",
107
110
  LCWChatButtonActionCompleted = "LCWChatButtonActionCompleted",
108
111
  LCWChatButtonClicked = "LCWChatButtonClicked",
109
112
  LCWChatButtonShow = "LCWChatButtonShow",
@@ -136,6 +139,7 @@ export declare enum TelemetryEvent {
136
139
  EmailTranscriptLoaded = "EmailTranscriptLoaded",
137
140
  OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
138
141
  ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
142
+ CitationPaneLoaded = "CitationPaneLoaded",
139
143
  ProactiveChatPaneLoaded = "ProactiveChatPaneLoaded",
140
144
  ReconnectChatPaneLoaded = "ReconnectChatPaneLoaded",
141
145
  HeaderCloseButtonClicked = "HeaderCloseButtonClicked",
@@ -262,11 +266,42 @@ export declare enum TelemetryEvent {
262
266
  UXLCWChatButtonLoadingStart = "UXLCWChatButtonLoadingStart",
263
267
  UXLCWChatButtonLoadingCompleted = "UXLCWChatButtonLoadingCompleted",
264
268
  UXConfirmationPaneStart = "UXConfirmationPaneStart",
269
+ UXCitationPaneStart = "UXCitationPaneStart",
265
270
  UXConfirmationPaneCompleted = "UXConfirmationPaneCompleted",
271
+ UXCitationPaneCompleted = "UXCitationPaneCompleted",
266
272
  UXLiveChatWidgetStart = "UXLiveChatWidgetStart",
267
273
  UXLiveChatWidgetCompleted = "UXLiveChatWidgetCompleted",
274
+ UXPostChatPaneStarted = "UXPostChatPaneStarted",
275
+ UXPostChatPaneCompleted = "UXPostChatPaneCompleted",
268
276
  AppInsightsInitialized = "AppInsightsInitialized",
269
- AppInsightsInitFailed = "AppInsightsInitFailed"
277
+ AppInsightsInitFailed = "AppInsightsInitFailed",
278
+ ConvertPersistentChatHistoryMessageToActivityFailed = "ConvertPersistentChatHistoryMessageToActivityFailed",
279
+ UXLCWPersistentChatHistoryInitialized = "UXLCWPersistentChatHistoryInitialized",
280
+ LCWPersistentChatHistoryFetchStarted = "LCWPersistentChatHistoryFetchStarted",
281
+ LCWPersistentChatHistoryFetchCompleted = "LCWPersistentChatHistoryFetchCompleted",
282
+ LCWPersistentChatHistoryFetchFailed = "LCWPersistentChatHistoryFetchFailed",
283
+ LCWWebChatStorePollingStarted = "LCWWebChatStorePollingStarted",
284
+ LCWWebChatStoreReady = "LCWWebChatStoreReady",
285
+ LCWWebChatConnected = "LCWWebChatConnected",
286
+ LCWWebChatDisconnected = "LCWWebChatDisconnected",
287
+ LCWWebChatConnectionCheckFailed = "LCWWebChatConnectionCheckFailed",
288
+ LCWPersistentConversationHandlerInitialized = "LCWPersistentConversationHandlerInitialized",
289
+ LCWPersistentHistoryPullBlocked = "LCWPersistentHistoryPullBlocked",
290
+ LCWPersistentHistoryPullCompleted = "LCWPersistentHistoryPullCompleted",
291
+ LCWLazyLoadInitializationStarted = "LCWLazyLoadInitializationStarted",
292
+ LCWLazyLoadContainerNotFound = "LCWLazyLoadContainerNotFound",
293
+ LCWLazyLoadInitializationCompleted = "LCWLazyLoadInitializationCompleted",
294
+ LCWLazyLoadSessionMetrics = "LCWLazyLoadSessionMetrics",
295
+ LCWLazyLoadTargetElementNotFound = "LCWLazyLoadTargetElementNotFound",
296
+ LCWLazyLoadScrollFailed = "LCWLazyLoadScrollFailed",
297
+ LCWLazyLoadActivityMounted = "LCWLazyLoadActivityMounted",
298
+ LCWLazyLoadReset = "LCWLazyLoadReset",
299
+ LCWLazyLoadNoMoreHistory = "LCWLazyLoadNoMoreHistory",
300
+ LCWLazyLoadDestroyed = "LCWLazyLoadDestroyed",
301
+ SecureEventBusUnauthorizedDispatch = "SecureEventBusUnauthorizedDispatch",
302
+ SecureEventBusListenerError = "SecureEventBusListenerError",
303
+ SecureEventBusDispatchError = "SecureEventBusDispatchError",
304
+ StartChatComplete = "StartChatComplete"
270
305
  }
271
306
  export interface TelemetryInput {
272
307
  scenarioType: ScenarioType;
@@ -277,3 +312,8 @@ export declare class TelemetryConstants {
277
312
  private static map;
278
313
  static mapEventToScenario(eventTypeOrScenarioType: TelemetryEvent): ScenarioType;
279
314
  }
315
+ export declare enum ConversationStage {
316
+ Initialization = "Initialization",
317
+ CSREngagement = "CSR Engagement",
318
+ ConversationEnd = "Conversation End"
319
+ }
@@ -0,0 +1,159 @@
1
+ /**
2
+ * SecureEventBus class implementing the singleton pattern for secure event communication.
3
+ * Provides authentication-based event dispatching to prevent unauthorized external access.
4
+ */
5
+ declare class SecureEventBus {
6
+ private static instance;
7
+ private listeners;
8
+ private readonly authToken;
9
+ private eventCounter;
10
+ /**
11
+ * Private constructor to enforce singleton pattern.
12
+ * Generates a unique authentication token for this session.
13
+ */
14
+ private constructor();
15
+ /**
16
+ * Get the singleton instance of SecureEventBus.
17
+ * Creates a new instance if one doesn't exist.
18
+ *
19
+ * @returns The singleton instance of SecureEventBus
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const eventBus = SecureEventBus.getInstance();
24
+ * ```
25
+ */
26
+ static getInstance(): SecureEventBus;
27
+ /**
28
+ * Generate a cryptographically secure authentication token.
29
+ * Uses crypto.getRandomValues when available, falls back to Math.random.
30
+ *
31
+ * @private
32
+ * @returns A 64-character hexadecimal string representing the authentication token
33
+ */
34
+ private generateAuthToken;
35
+ /**
36
+ * Get the authentication token for this SecureEventBus instance.
37
+ * This token is required for dispatching events and should only be used internally.
38
+ *
39
+ * @returns The authentication token string
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * const eventBus = SecureEventBus.getInstance();
44
+ * const token = eventBus.getAuthToken();
45
+ * eventBus.dispatch('myEvent', { data: 'value' }, token);
46
+ * ```
47
+ */
48
+ getAuthToken(): string;
49
+ /**
50
+ * Dispatch an event with authentication to all registered listeners.
51
+ * Verifies the authentication token before dispatching to prevent unauthorized access.
52
+ *
53
+ * @param eventName - The name of the event to dispatch
54
+ * @param payload - The data to send with the event (optional)
55
+ * @param token - Authentication token (must match the internal token)
56
+ * @returns true if event was successfully dispatched, false if unauthorized or error occurred
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * const eventBus = SecureEventBus.getInstance();
61
+ * const token = eventBus.getAuthToken();
62
+ *
63
+ * // Dispatch with payload
64
+ * const success = eventBus.dispatch('userAction', { action: 'click', target: 'button' }, token);
65
+ *
66
+ * // Dispatch without payload
67
+ * eventBus.dispatch('windowClosed', undefined, token);
68
+ * ```
69
+ */
70
+ dispatch(eventName: string, payload?: any, token?: string): boolean;
71
+ /**
72
+ * Subscribe to an event with a callback function.
73
+ * The callback will be executed whenever the specified event is dispatched.
74
+ *
75
+ * @param eventName - The name of the event to listen for
76
+ * @param callback - The function to execute when the event is fired
77
+ * @returns A function that can be called to unsubscribe from the event
78
+ *
79
+ * @example
80
+ * ```typescript
81
+ * const eventBus = SecureEventBus.getInstance();
82
+ *
83
+ * // Subscribe to an event
84
+ * const unsubscribe = eventBus.subscribe('chatMessage', (message) => {
85
+ * console.log('New message:', message.text);
86
+ * console.log('From user:', message.userId);
87
+ * });
88
+ *
89
+ * // Later, unsubscribe
90
+ * unsubscribe();
91
+ * ```
92
+ */
93
+ subscribe(eventName: string, callback: (payload: any) => void): () => void;
94
+ /**
95
+ * Remove all listeners for a specific event.
96
+ * This completely removes the event from the internal listeners map.
97
+ *
98
+ * @param eventName - The name of the event to remove all listeners for
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * const eventBus = SecureEventBus.getInstance();
103
+ *
104
+ * // Remove all listeners for 'chatClosed' event
105
+ * eventBus.removeAllListeners('chatClosed');
106
+ * ```
107
+ */
108
+ removeAllListeners(eventName: string): void;
109
+ /**
110
+ * Clear all listeners for all events.
111
+ * This resets the entire event bus to its initial state.
112
+ * Useful for cleanup during application shutdown or testing.
113
+ *
114
+ * @example
115
+ * ```typescript
116
+ * const eventBus = SecureEventBus.getInstance();
117
+ *
118
+ * // Clear all event listeners
119
+ * eventBus.clear();
120
+ * ```
121
+ */
122
+ clear(): void;
123
+ /**
124
+ * Get the number of listeners for a specific event.
125
+ * Useful for debugging and monitoring purposes.
126
+ *
127
+ * @param eventName - The name of the event to count listeners for
128
+ * @returns The number of listeners registered for the event
129
+ *
130
+ * @example
131
+ * ```typescript
132
+ * const eventBus = SecureEventBus.getInstance();
133
+ *
134
+ * // Check how many listeners are registered for 'userAction'
135
+ * const count = eventBus.getListenerCount('userAction');
136
+ * console.log(`${count} listeners registered for userAction`);
137
+ * ```
138
+ */
139
+ getListenerCount(eventName: string): number;
140
+ /**
141
+ * Get all registered event names.
142
+ * Returns an array of event names that currently have listeners.
143
+ * Useful for debugging and monitoring purposes.
144
+ *
145
+ * @returns An array of event names that have registered listeners
146
+ *
147
+ * @example
148
+ * ```typescript
149
+ * const eventBus = SecureEventBus.getInstance();
150
+ *
151
+ * // Get all registered events
152
+ * const events = eventBus.getRegisteredEvents();
153
+ * console.log('Active events:', events);
154
+ * // Output: ['userAction', 'chatMessage', 'windowResize']
155
+ * ```
156
+ */
157
+ getRegisteredEvents(): string[];
158
+ }
159
+ export default SecureEventBus;
@@ -0,0 +1,2 @@
1
+ declare const dispatchCustomEvent: (name: string, payload?: any) => void;
2
+ export default dispatchCustomEvent;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export declare const CitationDim: React.FC<{
3
+ brightness?: string;
4
+ }>;
5
+ export default CitationDim;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { ICitationPaneStatefulProps } from "./interfaces/ICitationPaneStatefulProps";
3
+ export declare const CitationPaneStateful: (props: ICitationPaneStatefulProps) => React.JSX.Element;
4
+ export default CitationPaneStateful;
@@ -0,0 +1,11 @@
1
+ export declare const defaultCitationPaneStyles: {
2
+ pane: React.CSSProperties;
3
+ };
4
+ export declare const defaultCitationContentCSS: (controlId: string) => string;
5
+ declare const _default: {
6
+ defaultCitationPaneStyles: {
7
+ pane: React.CSSProperties;
8
+ };
9
+ defaultCitationContentCSS: (controlId: string) => string;
10
+ };
11
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { ICitationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/citationpane/interfaces/ICitationPaneProps";
2
+ export interface ICitationPaneStatefulProps extends ICitationPaneProps {
3
+ /**
4
+ * id: Optional custom ID for the citation pane container
5
+ */
6
+ id?: string;
7
+ /**
8
+ * title: Optional title for the citation pane
9
+ */
10
+ title?: string;
11
+ /**
12
+ * onClose: Optional callback function called when the citation pane is closed
13
+ */
14
+ onClose?: () => void;
15
+ /**
16
+ * contentHtml: Optional HTML content to display in the citation pane
17
+ */
18
+ contentHtml?: string;
19
+ }
@@ -1,2 +1,2 @@
1
- import { IConfirmationPaneLocalizedTexts } from "../../interfaces/IConfirmationPaneLocalizedText";
1
+ import { IConfirmationPaneLocalizedTexts } from "../../interfaces/IConfirmationPaneLocalizedTexts";
2
2
  export declare const defaultConfirmationPaneLocalizedTexts: IConfirmationPaneLocalizedTexts;
@@ -1,4 +1,4 @@
1
- import { IConfirmationPaneLocalizedTexts } from "./IConfirmationPaneLocalizedText";
1
+ import { IConfirmationPaneLocalizedTexts } from "./IConfirmationPaneLocalizedTexts";
2
2
  import { IConfirmationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/confirmationpane/interfaces/IConfirmationPaneProps";
3
3
  export interface IConfirmationPaneStatefulProps extends IConfirmationPaneProps {
4
4
  /**