@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
@@ -10,49 +10,51 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
10
10
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_ELEMENT_ID"] = 0] = "SET_WIDGET_ELEMENT_ID";
11
11
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RENDERING_MIDDLEWARE_PROPS"] = 1] = "SET_RENDERING_MIDDLEWARE_PROPS";
12
12
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MIDDLEWARE_LOCALIZED_TEXTS"] = 2] = "SET_MIDDLEWARE_LOCALIZED_TEXTS";
13
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_GLOBAL_DIR"] = 3] = "SET_GLOBAL_DIR";
14
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MINIMIZED"] = 4] = "SET_MINIMIZED";
15
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_STATE"] = 5] = "SET_CONVERSATION_STATE";
16
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT_ID"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT_ID";
17
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_FAILING"] = 7] = "SET_START_CHAT_FAILING";
18
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_FAILURE_TYPE"] = 8] = "SET_START_CHAT_FAILURE_TYPE";
19
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 9] = "SET_OUTSIDE_OPERATING_HOURS";
20
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 10] = "SET_PRE_CHAT_SURVEY_RESPONSE";
21
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 11] = "SET_CUSTOM_CONTEXT";
22
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 12] = "SET_SHOW_CONFIRMATION";
23
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 13] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
24
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 14] = "SET_PRECHAT_RESPONSE_EMAIL";
25
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 15] = "SET_AUDIO_NOTIFICATION";
26
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 16] = "SET_E2VV_ENABLED";
27
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 17] = "SET_POST_CHAT_CONTEXT";
28
- LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 18] = "SHOW_CALLING_CONTAINER";
29
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 19] = "SET_INCOMING_CALL";
30
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 20] = "DISABLE_VIDEO_CALL";
31
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 21] = "DISABLE_LOCAL_VIDEO";
32
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 22] = "DISABLE_REMOTE_VIDEO";
33
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 23] = "SET_CHAT_TOKEN";
34
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_BUTTON_DISPLAY"] = 24] = "SET_START_CHAT_BUTTON_DISPLAY";
35
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 25] = "SET_PROACTIVE_CHAT_PARAMS";
36
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 26] = "SET_TELEMETRY_DATA";
37
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 27] = "SET_RECONNECT_ID";
38
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 28] = "SET_UNREAD_MESSAGE_COUNT";
39
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 29] = "SET_FOCUS_CHAT_BUTTON";
40
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED"] = 30] = "SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED";
41
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY"] = 31] = "SET_CONVERSATION_ENDED_BY";
42
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 32] = "SET_WIDGET_STATE";
43
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 33] = "SET_LIVE_CHAT_CONTEXT";
44
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 34] = "SET_BOT_OAUTH_SIGNIN_ID";
45
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 35] = "SET_WIDGET_SIZE";
46
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 36] = "SET_WIDGET_INSTANCE_ID";
47
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONFIG"] = 37] = "SET_LIVE_CHAT_CONFIG";
48
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_WORKFLOW_IN_PROGRESS"] = 38] = "SET_POST_CHAT_WORKFLOW_IN_PROGRESS";
49
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INITIAL_CHAT_SDK_REQUEST_ID"] = 39] = "SET_INITIAL_CHAT_SDK_REQUEST_ID";
50
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOULD_USE_BOT_SURVEY"] = 40] = "SET_SHOULD_USE_BOT_SURVEY";
51
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_DISCONNECT_EVENT_RECEIVED"] = 41] = "SET_CHAT_DISCONNECT_EVENT_RECEIVED";
52
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SURVEY_MODE"] = 42] = "SET_SURVEY_MODE";
53
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONFIRMATION_STATE"] = 43] = "SET_CONFIRMATION_STATE";
54
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_PARTICIPANT_TYPE"] = 44] = "SET_POST_CHAT_PARTICIPANT_TYPE";
55
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_ENABLED"] = 45] = "SET_CONVERSATIONAL_SURVEY_ENABLED";
56
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_DISPLAY"] = 46] = "SET_CONVERSATIONAL_SURVEY_DISPLAY";
57
- LiveChatWidgetActionType[LiveChatWidgetActionType["GET_IN_MEMORY_STATE"] = 47] = "GET_IN_MEMORY_STATE";
13
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CITATIONS"] = 3] = "SET_CITATIONS";
14
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_GLOBAL_DIR"] = 4] = "SET_GLOBAL_DIR";
15
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MINIMIZED"] = 5] = "SET_MINIMIZED";
16
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_STATE"] = 6] = "SET_CONVERSATION_STATE";
17
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT_ID"] = 7] = "SET_PREVIOUS_FOCUSED_ELEMENT_ID";
18
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_FAILING"] = 8] = "SET_START_CHAT_FAILING";
19
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_FAILURE_TYPE"] = 9] = "SET_START_CHAT_FAILURE_TYPE";
20
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 10] = "SET_OUTSIDE_OPERATING_HOURS";
21
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 11] = "SET_PRE_CHAT_SURVEY_RESPONSE";
22
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 12] = "SET_CUSTOM_CONTEXT";
23
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 13] = "SET_SHOW_CONFIRMATION";
24
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 14] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
25
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 15] = "SET_PRECHAT_RESPONSE_EMAIL";
26
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 16] = "SET_AUDIO_NOTIFICATION";
27
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 17] = "SET_E2VV_ENABLED";
28
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 18] = "SET_POST_CHAT_CONTEXT";
29
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 19] = "SHOW_CALLING_CONTAINER";
30
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 20] = "SET_INCOMING_CALL";
31
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 21] = "DISABLE_VIDEO_CALL";
32
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 22] = "DISABLE_LOCAL_VIDEO";
33
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 23] = "DISABLE_REMOTE_VIDEO";
34
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 24] = "SET_CHAT_TOKEN";
35
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_BUTTON_DISPLAY"] = 25] = "SET_START_CHAT_BUTTON_DISPLAY";
36
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 26] = "SET_PROACTIVE_CHAT_PARAMS";
37
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 27] = "SET_TELEMETRY_DATA";
38
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 28] = "SET_RECONNECT_ID";
39
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 29] = "SET_UNREAD_MESSAGE_COUNT";
40
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 30] = "SET_FOCUS_CHAT_BUTTON";
41
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED"] = 31] = "SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED";
42
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY"] = 32] = "SET_CONVERSATION_ENDED_BY";
43
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 33] = "SET_WIDGET_STATE";
44
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 34] = "SET_LIVE_CHAT_CONTEXT";
45
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 35] = "SET_BOT_OAUTH_SIGNIN_ID";
46
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 36] = "SET_WIDGET_SIZE";
47
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 37] = "SET_WIDGET_INSTANCE_ID";
48
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONFIG"] = 38] = "SET_LIVE_CHAT_CONFIG";
49
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_WORKFLOW_IN_PROGRESS"] = 39] = "SET_POST_CHAT_WORKFLOW_IN_PROGRESS";
50
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INITIAL_CHAT_SDK_REQUEST_ID"] = 40] = "SET_INITIAL_CHAT_SDK_REQUEST_ID";
51
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOULD_USE_BOT_SURVEY"] = 41] = "SET_SHOULD_USE_BOT_SURVEY";
52
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_DISCONNECT_EVENT_RECEIVED"] = 42] = "SET_CHAT_DISCONNECT_EVENT_RECEIVED";
53
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SURVEY_MODE"] = 43] = "SET_SURVEY_MODE";
54
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONFIRMATION_STATE"] = 44] = "SET_CONFIRMATION_STATE";
55
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_PARTICIPANT_TYPE"] = 45] = "SET_POST_CHAT_PARTICIPANT_TYPE";
56
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_ENABLED"] = 46] = "SET_CONVERSATIONAL_SURVEY_ENABLED";
57
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_DISPLAY"] = 47] = "SET_CONVERSATIONAL_SURVEY_DISPLAY";
58
+ LiveChatWidgetActionType[LiveChatWidgetActionType["GET_IN_MEMORY_STATE"] = 48] = "GET_IN_MEMORY_STATE";
59
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_AVATAR_INITIALS"] = 49] = "SET_BOT_AVATAR_INITIALS";
58
60
  })(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
@@ -10,6 +10,7 @@ var _ConversationState = require("./ConversationState");
10
10
  var _StartChatFailureType = require("./StartChatFailureType");
11
11
  var _defaultClientDataStoreProvider = require("../../common/storage/default/defaultClientDataStoreProvider");
12
12
  var _defaultMiddlewareLocalizedTexts = require("../../components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts");
13
+ var _defaultWebChatStyles = require("../../components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles");
13
14
  const getLiveChatWidgetContextInitialState = props => {
14
15
  var _props$controlProps, _props$webChatContain;
15
16
  const isOutsideOperatingHours = () => {
@@ -39,12 +40,18 @@ const getLiveChatWidgetContextInitialState = props => {
39
40
  initialStateFromCache.domainStates.liveChatConfig = props.chatConfig;
40
41
  // Cache the result of isOutsideOperatingHours() to ensure consistency
41
42
  initialStateFromCache.appStates.outsideOperatingHours = outsideOperatingHours;
43
+ // Backward compatibility: if botAvatarInitials not cached (older sessions), seed with default
44
+ if (!initialStateFromCache.domainStates.botAvatarInitials) {
45
+ initialStateFromCache.domainStates.botAvatarInitials = _defaultWebChatStyles.defaultWebChatStyles.botAvatarInitials;
46
+ }
42
47
  return initialStateFromCache;
43
48
  }
44
49
  const LiveChatWidgetContextInitialState = {
45
50
  domainStates: {
46
51
  liveChatConfig: props.chatConfig,
47
52
  widgetElementId: "",
53
+ // Map of citation id => content injected by citations middleware
54
+ citations: {},
48
55
  renderingMiddlewareProps: (_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.renderingMiddlewareProps,
49
56
  middlewareLocalizedTexts: _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts,
50
57
  preChatSurveyResponse: "{}",
@@ -60,7 +67,8 @@ const getLiveChatWidgetContextInitialState = props => {
60
67
  transcriptRequestId: "",
61
68
  confirmationPaneConfirmedOptionClicked: false,
62
69
  confirmationState: _Constants.ConfirmationState.NotSet,
63
- startChatFailureType: _StartChatFailureType.StartChatFailureType.Generic
70
+ startChatFailureType: _StartChatFailureType.StartChatFailureType.Generic,
71
+ botAvatarInitials: _defaultWebChatStyles.defaultWebChatStyles.botAvatarInitials
64
72
  },
65
73
  appStates: {
66
74
  conversationState: _ConversationState.ConversationState.Closed,
@@ -70,6 +70,21 @@ const reducer = (state, action) => {
70
70
  middlewareLocalizedTexts: action.payload
71
71
  }
72
72
  };
73
+ case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CITATIONS:
74
+ inMemory = {
75
+ ...inMemory,
76
+ domainStates: {
77
+ ...inMemory.domainStates,
78
+ citations: action.payload
79
+ }
80
+ };
81
+ return {
82
+ ...state,
83
+ domainStates: {
84
+ ...state.domainStates,
85
+ citations: action.payload
86
+ }
87
+ };
73
88
  case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_GLOBAL_DIR:
74
89
  inMemory = {
75
90
  ...inMemory,
@@ -547,6 +562,21 @@ const reducer = (state, action) => {
547
562
  widgetSize: action.payload
548
563
  }
549
564
  };
565
+ case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_BOT_AVATAR_INITIALS:
566
+ inMemory = {
567
+ ...inMemory,
568
+ domainStates: {
569
+ ...inMemory.domainStates,
570
+ botAvatarInitials: action.payload
571
+ }
572
+ };
573
+ return {
574
+ ...state,
575
+ domainStates: {
576
+ ...state.domainStates,
577
+ botAvatarInitials: action.payload
578
+ }
579
+ };
550
580
  case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_INSTANCE_ID:
551
581
  inMemory = {
552
582
  ...inMemory,
@@ -36,7 +36,7 @@ const createTrackingForFirstMessage = () => {
36
36
  * Starts tracking the time for the first bot message after widget loads.
37
37
  * Sets a 5-second timeout to auto-reset if no bot message is received.
38
38
  */
39
- const widgetLoadListener = _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.TelemetryEvent.WidgetLoadComplete).subscribe(() => {
39
+ const widgetLoadListener = _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.TelemetryEvent.StartChatComplete).subscribe(() => {
40
40
  if (isTracking) return;
41
41
  isTracking = true;
42
42
  startTime = new Date().getTime();
@@ -91,7 +91,8 @@ const createTrackingForFirstMessage = () => {
91
91
  CustomProperties: {
92
92
  elapsedTime,
93
93
  widgetLoadedAt: startTime,
94
- botMessage: stopTrackingMessage
94
+ botMessage: stopTrackingMessage,
95
+ type: payload === null || payload === void 0 ? void 0 : payload.type
95
96
  }
96
97
  });
97
98
  disconnectListener();
@@ -7,6 +7,7 @@ exports.FirstResponseLatencyTracker = void 0;
7
7
  var _TelemetryConstants = require("../common/telemetry/TelemetryConstants");
8
8
  var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
9
9
  var _TelemetryHelper = require("../common/telemetry/TelemetryHelper");
10
+ var _Constants = require("../common/Constants");
10
11
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
12
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
12
13
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -133,7 +134,8 @@ let FirstResponseLatencyTracker = /*#__PURE__*/function () {
133
134
  CustomProperties: {
134
135
  elapsedTime,
135
136
  userMessage: this.startTrackingMessage,
136
- botMessage: this.stopTrackingMessage
137
+ botMessage: this.stopTrackingMessage,
138
+ type: payload === null || payload === void 0 ? void 0 : payload.type
137
139
  }
138
140
  });
139
141
  }
@@ -174,7 +176,9 @@ let FirstResponseLatencyTracker = /*#__PURE__*/function () {
174
176
  value: function stopClock(payload) {
175
177
  try {
176
178
  if (!payload || !payload.Id) {
177
- throw new Error("Invalid payload");
179
+ if ((payload === null || payload === void 0 ? void 0 : payload.type) !== _Constants.Constants.typing) {
180
+ throw new Error("Invalid payload");
181
+ }
178
182
  }
179
183
 
180
184
  // Only allow stopTracking if sender is valid and tracking is active
package/lib/cjs/index.js CHANGED
@@ -14,7 +14,8 @@ var _exportNames = {
14
14
  useChatSDKStore: true,
15
15
  useFacadeChatSDKStore: true,
16
16
  LiveChatWidget: true,
17
- getMockChatSDKIfApplicable: true
17
+ getMockChatSDKIfApplicable: true,
18
+ LiveChatWidgetMockType: true
18
19
  };
19
20
  Object.defineProperty(exports, "BroadcastService", {
20
21
  enumerable: true,
@@ -34,6 +35,12 @@ Object.defineProperty(exports, "LiveChatWidget", {
34
35
  return _LiveChatWidget.default;
35
36
  }
36
37
  });
38
+ Object.defineProperty(exports, "LiveChatWidgetMockType", {
39
+ enumerable: true,
40
+ get: function () {
41
+ return _IMockProps.LiveChatWidgetMockType;
42
+ }
43
+ });
37
44
  Object.defineProperty(exports, "decodeComponentString", {
38
45
  enumerable: true,
39
46
  get: function () {
@@ -90,6 +97,7 @@ var _useChatSDKStore = _interopRequireDefault(require("./hooks/useChatSDKStore")
90
97
  var _useFacadeChatSDKStore = _interopRequireDefault(require("./hooks/useFacadeChatSDKStore"));
91
98
  var _LiveChatWidget = _interopRequireDefault(require("./components/livechatwidget/LiveChatWidget"));
92
99
  var _getMockChatSDKIfApplicable = require("./components/livechatwidget/common/getMockChatSDKIfApplicable");
100
+ var _IMockProps = require("./components/livechatwidget/interfaces/IMockProps");
93
101
  var _renderingmiddlewares = require("./components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares");
94
102
  Object.keys(_renderingmiddlewares).forEach(function (key) {
95
103
  if (key === "default" || key === "__esModule") return;
@@ -84,6 +84,9 @@ const createOnNewAdapterActivityHandler = (chatId, userId, startTime) => {
84
84
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
85
85
  const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
86
86
  if (messageHasNoTags && messageHasNoText && messageHasNoAttachments) {
87
+ if ((activity === null || activity === void 0 ? void 0 : activity.type) === _Constants2.Constants.typing) {
88
+ return true;
89
+ }
87
90
  return false;
88
91
  }
89
92
  return true;
@@ -112,7 +115,7 @@ const createOnNewAdapterActivityHandler = (chatId, userId, startTime) => {
112
115
  });
113
116
  };
114
117
  const raiseMessageEvent = activity => {
115
- if ((activity === null || activity === void 0 ? void 0 : activity.type) === _Constants2.Constants.message) {
118
+ if ((activity === null || activity === void 0 ? void 0 : activity.type) === _Constants2.Constants.message || (activity === null || activity === void 0 ? void 0 : activity.type) === _Constants2.Constants.typing) {
116
119
  const scenarioType = (0, _util.getScenarioType)(activity);
117
120
  switch (scenarioType) {
118
121
  case _Constants.ScenarioType.UserSendMessageStrategy:
@@ -38,6 +38,10 @@ _defineProperty(Constants, "botParticipantTypeTag", "Bot");
38
38
  _defineProperty(Constants, "channelIdKey", "ChannelId-");
39
39
  _defineProperty(Constants, "ChannelId", "lcw");
40
40
  _defineProperty(Constants, "CustomerTag", "FromCustomer");
41
+ // LCW only tags (Only applicable on client-side for additional processing, not recognized by service)
42
+ _defineProperty(Constants, "persistentChatHistoryMessageTag", "PersistentChatHistory");
43
+ _defineProperty(Constants, "persistentChatHistoryMessagePullTriggerTag", "PersistentChatHistoryMessagePullTrigger");
44
+ _defineProperty(Constants, "conversationDividerTag", "ConversationDivider");
41
45
  // gifUploadMiddleware
42
46
  _defineProperty(Constants, "GifContentType", "image/gif");
43
47
  // htmlPlayerMiddleware
@@ -57,6 +61,7 @@ _defineProperty(Constants, "queuePositionMessageTag", "queueposition");
57
61
  _defineProperty(Constants, "averageWaitTimeMessageTag", "averagewaittime");
58
62
  _defineProperty(Constants, "message", "message");
59
63
  _defineProperty(Constants, "hiddenTag", "Hidden");
64
+ _defineProperty(Constants, "typing", "typing");
60
65
  // messageTimestampMiddleware
61
66
  _defineProperty(Constants, "prefixTimestampTag", "ServerMessageTimestamp_");
62
67
  _defineProperty(Constants, "acsChannel", "ACS_CHANNEL");
@@ -184,6 +189,8 @@ _defineProperty(HtmlAttributeNames, "adaptiveCardClassName", "ac-adaptiveCard");
184
189
  _defineProperty(HtmlAttributeNames, "adaptiveCardTextBlockClassName", "ac-textBlock");
185
190
  _defineProperty(HtmlAttributeNames, "adaptiveCardToggleInputClassName", "ac-toggleInput");
186
191
  _defineProperty(HtmlAttributeNames, "adaptiveCardActionSetClassName", "ac-actionSet");
192
+ _defineProperty(HtmlAttributeNames, "ocwCitationPaneClassName", "ocw-citation-pane");
193
+ _defineProperty(HtmlAttributeNames, "ocwCitationPaneTitle", "Citation");
187
194
  export let WebChatMiddlewareConstants = /*#__PURE__*/_createClass(function WebChatMiddlewareConstants() {
188
195
  _classCallCheck(this, WebChatMiddlewareConstants);
189
196
  });
@@ -481,6 +481,12 @@ export let FacadeChatSDK = /*#__PURE__*/function () {
481
481
  reconnectableChatsParams.authenticatedUserToken = this.token;
482
482
  return this.validateAndExecuteCall("getReconnectableChats", () => this.chatSDK.OCClient.getReconnectableChats(reconnectableChatsParams));
483
483
  }
484
+ }, {
485
+ key: "fetchPersistentConversationHistory",
486
+ value: async function fetchPersistentConversationHistory() {
487
+ let getPersistentChatHistoryOptionalParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
488
+ return this.validateAndExecuteCall("getPersistentChatHistory", () => this.chatSDK.getPersistentChatHistory(getPersistentChatHistoryOptionalParams));
489
+ }
484
490
  }]);
485
491
  return FacadeChatSDK;
486
492
  }();
@@ -1,8 +1,5 @@
1
1
  export const AppInsightsEventMapping = {
2
2
  "LCWChatButtonClicked": "LCWChatButtonActionStarted",
3
- "WidgetLoadStarted": "WidgetStartChatStarted",
4
- "WidgetLoadComplete": "WidgetStartChatCompleted",
5
- "WidgetLoadFailed": "WidgetStartChatFailed",
6
3
  "PrechatSubmitted": "PrechatSubmitCompleted",
7
4
  "StartChatEventRecevied": "StartChatEventReceivedCompleted",
8
5
  "EndChatEventReceived": "EndChatEventReceivedCompleted",
@@ -18,7 +15,9 @@ export const AppInsightsEventMapping = {
18
15
  "MessageSent": "MessageSentCompleted",
19
16
  "MessageReceived": "MessageReceivedCompleted",
20
17
  "SystemMessageReceived": "SystemMessageReceivedCompleted",
21
- "RehydrateMessageReceived": "RehydrateMessageReceivedCompleted",
18
+ "RehydrateMessageReceived": "ChatHistoryMessageReceivedCompleted",
22
19
  "CustomContextReceived": "CustomContextReceivedCompleted",
23
- "PostChatContextCallSucceed": "PostChatContextCallCompleted"
20
+ "NewTokenValidationStarted": "AuthTokenValidationStarted",
21
+ "NewTokenValidationCompleted": "AuthTokenValidationCompleted",
22
+ "NewTokenValidationFailed": "AuthTokenValidationFailed"
24
23
  };
@@ -68,9 +68,11 @@ export let BroadcastEvent;
68
68
  BroadcastEvent["OnWidgetError"] = "OnWidgetError";
69
69
  BroadcastEvent["FMLTrackingCompletedAck"] = "FMLTrackingCompletedAck";
70
70
  BroadcastEvent["FMLTrackingCompleted"] = "FMLTrackingCompleted";
71
+ BroadcastEvent["PersistentConversationReset"] = "PersistentConversationReset";
71
72
  })(BroadcastEvent || (BroadcastEvent = {}));
72
73
  export let TelemetryEvent;
73
74
  (function (TelemetryEvent) {
75
+ TelemetryEvent["FetchPersistentChatHistoryFailed"] = "FetchPersistentChatHistoryFailed";
74
76
  TelemetryEvent["CallAdded"] = "CallAdded";
75
77
  TelemetryEvent["LocalVideoStreamAdded"] = "LocalVideoStreamAdded";
76
78
  TelemetryEvent["LocalVideoStreamRemoved"] = "LocalVideoStreamRemoved";
@@ -116,6 +118,7 @@ export let TelemetryEvent;
116
118
  TelemetryEvent["EndChatFailed"] = "EndChatFailed";
117
119
  TelemetryEvent["SettingCustomContext"] = "SettingCustomContext";
118
120
  TelemetryEvent["WebChatLoaded"] = "WebChatLoaded";
121
+ TelemetryEvent["PersistentChatHistoryEnabled"] = "PersistentChatHistoryEnabled";
119
122
  TelemetryEvent["LCWChatButtonActionCompleted"] = "LCWChatButtonActionCompleted";
120
123
  TelemetryEvent["LCWChatButtonClicked"] = "LCWChatButtonClicked";
121
124
  TelemetryEvent["LCWChatButtonShow"] = "LCWChatButtonShow";
@@ -148,6 +151,7 @@ export let TelemetryEvent;
148
151
  TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
149
152
  TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
150
153
  TelemetryEvent["ConfirmationPaneLoaded"] = "ConfirmationPaneLoaded";
154
+ TelemetryEvent["CitationPaneLoaded"] = "CitationPaneLoaded";
151
155
  TelemetryEvent["ProactiveChatPaneLoaded"] = "ProactiveChatPaneLoaded";
152
156
  TelemetryEvent["ReconnectChatPaneLoaded"] = "ReconnectChatPaneLoaded";
153
157
  TelemetryEvent["HeaderCloseButtonClicked"] = "HeaderCloseButtonClicked";
@@ -274,11 +278,42 @@ export let TelemetryEvent;
274
278
  TelemetryEvent["UXLCWChatButtonLoadingStart"] = "UXLCWChatButtonLoadingStart";
275
279
  TelemetryEvent["UXLCWChatButtonLoadingCompleted"] = "UXLCWChatButtonLoadingCompleted";
276
280
  TelemetryEvent["UXConfirmationPaneStart"] = "UXConfirmationPaneStart";
281
+ TelemetryEvent["UXCitationPaneStart"] = "UXCitationPaneStart";
277
282
  TelemetryEvent["UXConfirmationPaneCompleted"] = "UXConfirmationPaneCompleted";
283
+ TelemetryEvent["UXCitationPaneCompleted"] = "UXCitationPaneCompleted";
278
284
  TelemetryEvent["UXLiveChatWidgetStart"] = "UXLiveChatWidgetStart";
279
285
  TelemetryEvent["UXLiveChatWidgetCompleted"] = "UXLiveChatWidgetCompleted";
286
+ TelemetryEvent["UXPostChatPaneStarted"] = "UXPostChatPaneStarted";
287
+ TelemetryEvent["UXPostChatPaneCompleted"] = "UXPostChatPaneCompleted";
280
288
  TelemetryEvent["AppInsightsInitialized"] = "AppInsightsInitialized";
281
289
  TelemetryEvent["AppInsightsInitFailed"] = "AppInsightsInitFailed";
290
+ TelemetryEvent["ConvertPersistentChatHistoryMessageToActivityFailed"] = "ConvertPersistentChatHistoryMessageToActivityFailed";
291
+ TelemetryEvent["UXLCWPersistentChatHistoryInitialized"] = "UXLCWPersistentChatHistoryInitialized";
292
+ TelemetryEvent["LCWPersistentChatHistoryFetchStarted"] = "LCWPersistentChatHistoryFetchStarted";
293
+ TelemetryEvent["LCWPersistentChatHistoryFetchCompleted"] = "LCWPersistentChatHistoryFetchCompleted";
294
+ TelemetryEvent["LCWPersistentChatHistoryFetchFailed"] = "LCWPersistentChatHistoryFetchFailed";
295
+ TelemetryEvent["LCWWebChatStorePollingStarted"] = "LCWWebChatStorePollingStarted";
296
+ TelemetryEvent["LCWWebChatStoreReady"] = "LCWWebChatStoreReady";
297
+ TelemetryEvent["LCWWebChatConnected"] = "LCWWebChatConnected";
298
+ TelemetryEvent["LCWWebChatDisconnected"] = "LCWWebChatDisconnected";
299
+ TelemetryEvent["LCWWebChatConnectionCheckFailed"] = "LCWWebChatConnectionCheckFailed";
300
+ TelemetryEvent["LCWPersistentConversationHandlerInitialized"] = "LCWPersistentConversationHandlerInitialized";
301
+ TelemetryEvent["LCWPersistentHistoryPullBlocked"] = "LCWPersistentHistoryPullBlocked";
302
+ TelemetryEvent["LCWPersistentHistoryPullCompleted"] = "LCWPersistentHistoryPullCompleted";
303
+ TelemetryEvent["LCWLazyLoadInitializationStarted"] = "LCWLazyLoadInitializationStarted";
304
+ TelemetryEvent["LCWLazyLoadContainerNotFound"] = "LCWLazyLoadContainerNotFound";
305
+ TelemetryEvent["LCWLazyLoadInitializationCompleted"] = "LCWLazyLoadInitializationCompleted";
306
+ TelemetryEvent["LCWLazyLoadSessionMetrics"] = "LCWLazyLoadSessionMetrics";
307
+ TelemetryEvent["LCWLazyLoadTargetElementNotFound"] = "LCWLazyLoadTargetElementNotFound";
308
+ TelemetryEvent["LCWLazyLoadScrollFailed"] = "LCWLazyLoadScrollFailed";
309
+ TelemetryEvent["LCWLazyLoadActivityMounted"] = "LCWLazyLoadActivityMounted";
310
+ TelemetryEvent["LCWLazyLoadReset"] = "LCWLazyLoadReset";
311
+ TelemetryEvent["LCWLazyLoadNoMoreHistory"] = "LCWLazyLoadNoMoreHistory";
312
+ TelemetryEvent["LCWLazyLoadDestroyed"] = "LCWLazyLoadDestroyed";
313
+ TelemetryEvent["SecureEventBusUnauthorizedDispatch"] = "SecureEventBusUnauthorizedDispatch";
314
+ TelemetryEvent["SecureEventBusListenerError"] = "SecureEventBusListenerError";
315
+ TelemetryEvent["SecureEventBusDispatchError"] = "SecureEventBusDispatchError";
316
+ TelemetryEvent["StartChatComplete"] = "StartChatComplete";
282
317
  })(TelemetryEvent || (TelemetryEvent = {}));
283
318
  export let TelemetryConstants = /*#__PURE__*/function () {
284
319
  function TelemetryConstants() {
@@ -346,6 +381,9 @@ export let TelemetryConstants = /*#__PURE__*/function () {
346
381
  case TelemetryEvent.PostChatWorkflowFromAgent:
347
382
  case TelemetryEvent.PostChatWorkflowFromBot:
348
383
  case TelemetryEvent.AppStatesException:
384
+ case TelemetryEvent.SecureEventBusUnauthorizedDispatch:
385
+ case TelemetryEvent.SecureEventBusListenerError:
386
+ case TelemetryEvent.SecureEventBusDispatchError:
349
387
  return ScenarioType.ACTIONS;
350
388
  case TelemetryEvent.StartChatSDKCall:
351
389
  case TelemetryEvent.StartChatEventReceived:
@@ -405,4 +443,10 @@ export let TelemetryConstants = /*#__PURE__*/function () {
405
443
  }
406
444
  }]);
407
445
  return TelemetryConstants;
408
- }();
446
+ }();
447
+ export let ConversationStage;
448
+ (function (ConversationStage) {
449
+ ConversationStage["Initialization"] = "Initialization";
450
+ ConversationStage["CSREngagement"] = "CSR Engagement";
451
+ ConversationStage["ConversationEnd"] = "Conversation End";
452
+ })(ConversationStage || (ConversationStage = {}));
@@ -1,19 +1,16 @@
1
- import { LogLevel, TelemetryEvent } from "../TelemetryConstants";
1
+ import { ConversationStage, LogLevel, TelemetryEvent } from "../TelemetryConstants";
2
2
  import ScenarioMarker from "../ScenarioMarker";
3
3
  import { TelemetryHelper } from "../TelemetryHelper";
4
4
  import { AppInsightsTelemetryMessage } from "../../Constants";
5
5
  import { AppInsightsEventMapping } from "../AppInsightsEvents";
6
6
  var AllowedKeys;
7
7
  (function (AllowedKeys) {
8
- AllowedKeys["LogLevel"] = "LogLevel";
8
+ AllowedKeys["OrganizationId"] = "OrganizationId";
9
+ AllowedKeys["ConversationId"] = "LiveWorkItemId";
10
+ AllowedKeys["ElapsedTimeInMilliseconds"] = "Duration";
9
11
  AllowedKeys["Description"] = "Description";
10
- AllowedKeys["ExceptionDetails"] = "ExceptionDetails";
11
- AllowedKeys["ChannelId"] = "ChannelId";
12
+ AllowedKeys["ChannelId"] = "ChannelType";
12
13
  AllowedKeys["LCWRuntimeId"] = "ClientSessionId";
13
- AllowedKeys["ConversationId"] = "LiveWorkItemId";
14
- AllowedKeys["ChatId"] = "ChatThreadId";
15
- AllowedKeys["OrganizationId"] = "OrganizationId";
16
- AllowedKeys["ElapsedTimeInMilliseconds"] = "DurationInMilliseconds";
17
14
  })(AllowedKeys || (AllowedKeys = {}));
18
15
  let initializationPromise = null;
19
16
  export const appInsightsLogger = appInsightsKey => {
@@ -86,9 +83,9 @@ export const appInsightsLogger = appInsightsKey => {
86
83
  if (!_logger) return;
87
84
  const eventName = telemetryInput === null || telemetryInput === void 0 ? void 0 : (_telemetryInput$paylo = telemetryInput.payload) === null || _telemetryInput$paylo === void 0 ? void 0 : _telemetryInput$paylo.Event;
88
85
  const telemetryInfo = telemetryInput === null || telemetryInput === void 0 ? void 0 : (_telemetryInput$telem = telemetryInput.telemetryInfo) === null || _telemetryInput$telem === void 0 ? void 0 : _telemetryInput$telem.telemetryInfo;
89
- const eventProperties = setEventProperties(telemetryInfo);
90
86
  if (eventName) {
91
87
  const trackingEventName = getTrackingEventName(logLevel, eventName);
88
+ const eventProperties = setEventProperties(trackingEventName, telemetryInfo);
92
89
  _logger.trackEvent({
93
90
  name: trackingEventName,
94
91
  properties: eventProperties
@@ -107,17 +104,36 @@ export const appInsightsLogger = appInsightsKey => {
107
104
  };
108
105
 
109
106
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
110
- function setEventProperties(telemetryInfo) {
107
+ function setEventProperties(eventName, telemetryInfo) {
111
108
  const eventProperties = {};
112
109
  if (telemetryInfo) {
113
110
  for (const key in AllowedKeys) {
114
- const finalKey = AllowedKeys[key]; // get renamed keys for LCWRuntimeId, ConversationId, ChatId
111
+ const finalKey = AllowedKeys[key]; // get renamed keys for LCWRuntimeId, ConversationId
115
112
  const value = telemetryInfo[key];
116
113
  if (value !== undefined && value !== null && value !== "") {
117
114
  eventProperties[finalKey] = value;
118
115
  }
119
116
  }
120
117
  }
118
+ // Include exception details in description for error events
119
+ if (telemetryInfo !== null && telemetryInfo !== void 0 && telemetryInfo.ExceptionDetails) {
120
+ eventProperties[AllowedKeys.Description] = JSON.stringify(telemetryInfo.ExceptionDetails);
121
+ }
122
+ const customProperties = (() => {
123
+ if (!(telemetryInfo !== null && telemetryInfo !== void 0 && telemetryInfo.CustomProperties)) {
124
+ return {};
125
+ }
126
+ try {
127
+ return typeof telemetryInfo.CustomProperties === "string" ? JSON.parse(telemetryInfo.CustomProperties) : telemetryInfo.CustomProperties;
128
+ } catch (error) {
129
+ console.warn("Failed to parse CustomProperties:", error);
130
+ return {};
131
+ }
132
+ })();
133
+ // Additional properties
134
+ eventProperties["ConversationStage"] = customProperties.ConversationStage ?? ConversationStage.CSREngagement;
135
+ eventProperties["Scenario"] = "Conversation Diagnostics";
136
+ eventProperties["OperationName"] = eventName.includes(": ") ? eventName.split(": ")[1] : eventName;
121
137
  return eventProperties;
122
138
  }
123
139
  function getTrackingEventName(logLevel, eventName) {