@microsoft/omnichannel-chat-widget 1.7.8-main.d71f599 → 1.7.8

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 (388) hide show
  1. package/lib/cjs/common/Constants.js +67 -20
  2. package/lib/cjs/common/KeyCodes.js +6 -1
  3. package/lib/cjs/common/contextDataStore/DataStoreManager.js +6 -1
  4. package/lib/cjs/common/facades/FacadeChatSDK.js +391 -305
  5. package/lib/cjs/common/storage/default/defaultCacheManager.js +6 -3
  6. package/lib/cjs/common/telemetry/AppInsightsEvents.js +31 -0
  7. package/lib/cjs/common/telemetry/ScenarioMarker.js +66 -0
  8. package/lib/cjs/common/telemetry/TelemetryConstants.js +151 -129
  9. package/lib/cjs/common/telemetry/TelemetryHelper.js +281 -250
  10. package/lib/cjs/common/telemetry/TelemetryManager.js +32 -12
  11. package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +11 -0
  12. package/lib/cjs/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
  13. package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +149 -0
  14. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +13 -9
  15. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +3 -2
  16. package/lib/cjs/components/footerstateful/FooterStateful.js +11 -6
  17. package/lib/cjs/components/headerstateful/HeaderStateful.js +18 -6
  18. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
  19. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +70 -58
  20. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
  21. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
  22. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
  23. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +14 -6
  24. package/lib/cjs/components/livechatwidget/common/Deferred.js +14 -6
  25. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
  26. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +6 -3
  27. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -2
  28. package/lib/cjs/components/livechatwidget/common/startChat.js +43 -17
  29. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +5 -4
  30. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +25 -20
  31. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
  32. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +9 -4
  33. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
  34. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -6
  35. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +7 -1
  36. package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
  37. package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
  38. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
  39. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
  40. package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +62 -52
  41. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
  42. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
  43. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
  44. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
  45. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +2 -0
  46. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
  47. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +5 -6
  48. package/lib/cjs/controller/componentController.js +3 -2
  49. package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +138 -116
  50. package/lib/cjs/plugins/createChatTranscript.js +88 -58
  51. package/lib/cjs/plugins/newMessageEventHandler.js +13 -10
  52. package/lib/esm/common/Constants.js +65 -19
  53. package/lib/esm/common/KeyCodes.js +6 -1
  54. package/lib/esm/common/contextDataStore/DataStoreManager.js +6 -1
  55. package/lib/esm/common/facades/FacadeChatSDK.js +391 -305
  56. package/lib/esm/common/storage/default/defaultCacheManager.js +6 -1
  57. package/lib/esm/common/telemetry/AppInsightsEvents.js +24 -0
  58. package/lib/esm/common/telemetry/ScenarioMarker.js +59 -0
  59. package/lib/esm/common/telemetry/TelemetryConstants.js +151 -129
  60. package/lib/esm/common/telemetry/TelemetryHelper.js +281 -250
  61. package/lib/esm/common/telemetry/TelemetryManager.js +32 -12
  62. package/lib/esm/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +4 -0
  63. package/lib/esm/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
  64. package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +139 -0
  65. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +13 -9
  66. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +3 -2
  67. package/lib/esm/components/footerstateful/FooterStateful.js +11 -6
  68. package/lib/esm/components/headerstateful/HeaderStateful.js +18 -6
  69. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
  70. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +70 -58
  71. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
  72. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
  73. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
  74. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +14 -6
  75. package/lib/esm/components/livechatwidget/common/Deferred.js +14 -6
  76. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
  77. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +6 -3
  78. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -2
  79. package/lib/esm/components/livechatwidget/common/startChat.js +43 -17
  80. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +5 -4
  81. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +25 -20
  82. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
  83. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +9 -4
  84. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
  85. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -6
  86. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +7 -1
  87. package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
  88. package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
  89. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
  90. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
  91. package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +63 -52
  92. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
  93. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
  94. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
  95. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
  96. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +2 -0
  97. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
  98. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +5 -6
  99. package/lib/esm/controller/componentController.js +3 -2
  100. package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +138 -116
  101. package/lib/esm/plugins/createChatTranscript.js +88 -58
  102. package/lib/esm/plugins/newMessageEventHandler.js +13 -10
  103. package/lib/types/assets/Audios.d.ts +1 -1
  104. package/lib/types/assets/Icons.d.ts +16 -16
  105. package/lib/types/common/Constants.d.ts +283 -277
  106. package/lib/types/common/KeyCodes.d.ts +5 -5
  107. package/lib/types/common/contextDataStore/DataStoreManager.d.ts +4 -4
  108. package/lib/types/common/facades/FacadeChatSDK.d.ts +75 -75
  109. package/lib/types/common/facades/types/IFacadeChatSDKInput.d.ts +13 -13
  110. package/lib/types/common/interfaces/IContextDataStore.d.ts +14 -14
  111. package/lib/types/common/interfaces/ITimer.d.ts +3 -3
  112. package/lib/types/common/storage/default/defaultCacheManager.d.ts +5 -5
  113. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +4 -4
  114. package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -6
  115. package/lib/types/common/telemetry/AppInsightsEvents.d.ts +1 -0
  116. package/lib/types/common/telemetry/ScenarioMarker.d.ts +19 -0
  117. package/lib/types/common/telemetry/TelemetryConstants.d.ts +272 -264
  118. package/lib/types/common/telemetry/TelemetryHelper.d.ts +48 -43
  119. package/lib/types/common/telemetry/TelemetryManager.d.ts +12 -12
  120. package/lib/types/common/telemetry/defaultConfigs/defaultAppInsightsConfig.d.ts +2 -0
  121. package/lib/types/common/telemetry/defaultConfigs/defaultAriaConfig.d.ts +2 -2
  122. package/lib/types/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.d.ts +2 -2
  123. package/lib/types/common/telemetry/defaultConfigs/defaultTelemetryInternalData.d.ts +2 -2
  124. package/lib/types/common/telemetry/definitions/Contracts.d.ts +77 -77
  125. package/lib/types/common/telemetry/definitions/Payload.d.ts +105 -105
  126. package/lib/types/common/telemetry/interfaces/IAppInsightsConfig.d.ts +4 -0
  127. package/lib/types/common/telemetry/interfaces/IAriaConfigurations.d.ts +18 -18
  128. package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +6 -5
  129. package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +23 -21
  130. package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +48 -48
  131. package/lib/types/common/telemetry/interfaces/ITelemetryEvents.d.ts +7 -7
  132. package/lib/types/common/telemetry/loggers/appInsightsLogger.d.ts +10 -0
  133. package/lib/types/common/telemetry/loggers/ariaTelemetryLogger.d.ts +2 -2
  134. package/lib/types/common/telemetry/loggers/consoleLogger.d.ts +2 -2
  135. package/lib/types/common/utils.d.ts +49 -49
  136. package/lib/types/components/callingcontainerstateful/CallingContainerStateful.d.ts +4 -3
  137. package/lib/types/components/callingcontainerstateful/ICallingContainerStatefulProps.d.ts +4 -4
  138. package/lib/types/components/chatbuttonstateful/ChatButtonStateful.d.ts +4 -3
  139. package/lib/types/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.d.ts +2 -2
  140. package/lib/types/components/chatbuttonstateful/interfaces/IChatButtonStatefulParams.d.ts +17 -17
  141. package/lib/types/components/confirmationpanestateful/ConfirmationPaneStateful.d.ts +4 -3
  142. package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +2 -2
  143. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneInputs.d.ts +4 -4
  144. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.d.ts +10 -10
  145. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +13 -13
  146. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +8 -8
  147. package/lib/types/components/dimlayer/DimLayer.d.ts +6 -5
  148. package/lib/types/components/draggable/DraggableChatWidget.d.ts +9 -9
  149. package/lib/types/components/draggable/DraggableEventEmitter.d.ts +27 -27
  150. package/lib/types/components/draggable/DraggableEventNames.d.ts +6 -6
  151. package/lib/types/components/draggable/DraggableEventReceiver.d.ts +27 -27
  152. package/lib/types/components/draggable/IDraggableElementPosition.d.ts +5 -5
  153. package/lib/types/components/draggable/IDraggableElementPositionDelta.d.ts +5 -5
  154. package/lib/types/components/draggable/IDraggableEvent.d.ts +12 -12
  155. package/lib/types/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.d.ts +4 -3
  156. package/lib/types/components/emailtranscriptpanestateful/interfaces/IChatTranscriptBody.d.ts +5 -5
  157. package/lib/types/components/emailtranscriptpanestateful/interfaces/IEmailTranscriptPaneProps.d.ts +11 -11
  158. package/lib/types/components/footerstateful/FooterStateful.d.ts +3 -2
  159. package/lib/types/components/footerstateful/audionotificationstateful/AudioNotificationStateful.d.ts +4 -3
  160. package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationProps.d.ts +3 -3
  161. package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +4 -4
  162. package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +4 -4
  163. package/lib/types/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.d.ts +23 -23
  164. package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IDownloadTranscriptProps.d.ts +19 -19
  165. package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IWebChatTranscriptConfig.d.ts +14 -14
  166. package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/TranscriptHtmlScripts.d.ts +33 -33
  167. package/lib/types/components/headerstateful/HeaderStateful.d.ts +4 -3
  168. package/lib/types/components/headerstateful/common/styleProps/defaultOutOfOfficeHeaderStyleProps.d.ts +2 -2
  169. package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +33 -33
  170. package/lib/types/components/livechatwidget/LiveChatWidget.d.ts +4 -3
  171. package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -14
  172. package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +12 -12
  173. package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -5
  174. package/lib/types/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.d.ts +7 -7
  175. package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -6
  176. package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -7
  177. package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -7
  178. package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -9
  179. package/lib/types/components/livechatwidget/common/authHelper.d.ts +18 -18
  180. package/lib/types/components/livechatwidget/common/chatDisconnectHelper.d.ts +4 -4
  181. package/lib/types/components/livechatwidget/common/createAdapter.d.ts +3 -3
  182. package/lib/types/components/livechatwidget/common/createDownloadTranscriptProps.d.ts +25 -25
  183. package/lib/types/components/livechatwidget/common/createFooter.d.ts +4 -3
  184. package/lib/types/components/livechatwidget/common/createInternetConnectionChangeHandler.d.ts +2 -2
  185. package/lib/types/components/livechatwidget/common/createMarkdown.d.ts +2 -2
  186. package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -2
  187. package/lib/types/components/livechatwidget/common/defaultStyles/defaultLiveChatWidgetGeneralStyles.d.ts +2 -2
  188. package/lib/types/components/livechatwidget/common/disposeTelemetryLoggers.d.ts +1 -1
  189. package/lib/types/components/livechatwidget/common/endChat.d.ts +13 -13
  190. package/lib/types/components/livechatwidget/common/getGeneralStylesForButton.d.ts +3 -3
  191. package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +1 -1
  192. package/lib/types/components/livechatwidget/common/helpers/markdownHelper.d.ts +2 -2
  193. package/lib/types/components/livechatwidget/common/initCallingSdk.d.ts +2 -2
  194. package/lib/types/components/livechatwidget/common/initConfirmationPropsComposer.d.ts +3 -3
  195. package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +7 -7
  196. package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +3 -3
  197. package/lib/types/components/livechatwidget/common/overridePropsOnMockIfApplicable.d.ts +3 -3
  198. package/lib/types/components/livechatwidget/common/persistentChatHelper.d.ts +1 -1
  199. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +12 -12
  200. package/lib/types/components/livechatwidget/common/registerTelemetryLoggers.d.ts +4 -4
  201. package/lib/types/components/livechatwidget/common/renderSurveyHelpers.d.ts +10 -10
  202. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +4 -4
  203. package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -1
  204. package/lib/types/components/livechatwidget/common/startChat.d.ts +11 -11
  205. package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +6 -6
  206. package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +4 -4
  207. package/lib/types/components/livechatwidget/common/updateSessionDataForTelemetry.d.ts +4 -4
  208. package/lib/types/components/livechatwidget/interfaces/IBotAuthActivitySubscriberOptionalParams.d.ts +4 -4
  209. package/lib/types/components/livechatwidget/interfaces/IDraggableChatWidgetProps.d.ts +10 -10
  210. package/lib/types/components/livechatwidget/interfaces/IFeatureConfigProps.d.ts +3 -3
  211. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +17 -17
  212. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +21 -21
  213. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +70 -68
  214. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetStyleProps.d.ts +5 -5
  215. package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +8 -8
  216. package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -22
  217. package/lib/types/components/livechatwidget/interfaces/ISendBox.d.ts +12 -12
  218. package/lib/types/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.d.ts +3 -3
  219. package/lib/types/components/loadingpanestateful/LoadingPaneStateful.d.ts +3 -2
  220. package/lib/types/components/loadingpanestateful/common/defaultStyleProps/defaultgeneralLoadingPaneStyleProps.d.ts +2 -2
  221. package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -2
  222. package/lib/types/components/notificationpanestateful/NotificationPaneStateful.d.ts +4 -3
  223. package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectControlProps.d.ts +2 -2
  224. package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectStyleProps.d.ts +2 -2
  225. package/lib/types/components/notificationpanestateful/interfaces/INotificationPaneStatefulProps.d.ts +13 -13
  226. package/lib/types/components/ooohpanestateful/OOOHPaneStateful.d.ts +4 -3
  227. package/lib/types/components/ooohpanestateful/common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps.d.ts +2 -2
  228. package/lib/types/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.d.ts +4 -3
  229. package/lib/types/components/postchatloadingpanestateful/common/defaultgeneralPostChatLoadingPaneStyleProps.d.ts +2 -2
  230. package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +4 -3
  231. package/lib/types/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.d.ts +2 -2
  232. package/lib/types/components/postchatsurveypanestateful/common/isValidSurveyUrl.d.ts +2 -2
  233. package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -5
  234. package/lib/types/components/postchatsurveypanestateful/enums/PostChatSurveyMode.d.ts +4 -4
  235. package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +5 -5
  236. package/lib/types/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.d.ts +4 -3
  237. package/lib/types/components/prechatsurveypanestateful/common/defaultProps/defaultPreChatSurveyLocalizedTexts.d.ts +2 -2
  238. package/lib/types/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.d.ts +2 -2
  239. package/lib/types/components/prechatsurveypanestateful/interfaces/IPreChatSurveyPaneStatefulParams.d.ts +5 -5
  240. package/lib/types/components/proactivechatpanestateful/ProactiveChatPaneStateful.d.ts +3 -2
  241. package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.d.ts +3 -3
  242. package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatPaneStatefulProps.d.ts +4 -4
  243. package/lib/types/components/reconnectchatpanestateful/ReconnectChatPaneStateful.d.ts +4 -3
  244. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatContext.d.ts +4 -4
  245. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatOptionalParams.d.ts +3 -3
  246. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulParams.d.ts +5 -5
  247. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +5 -5
  248. package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +4 -3
  249. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.d.ts +2 -2
  250. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.d.ts +2 -2
  251. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.d.ts +2 -2
  252. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.d.ts +2 -2
  253. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.d.ts +2 -2
  254. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.d.ts +5 -5
  255. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.d.ts +6 -6
  256. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +14 -14
  257. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +8 -8
  258. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.d.ts +10 -10
  259. package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +4 -3
  260. package/lib/types/components/webchatcontainerstateful/common/DemoChatAdapter.d.ts +10 -10
  261. package/lib/types/components/webchatcontainerstateful/common/DemoChatSDK.d.ts +6 -6
  262. package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +8 -8
  263. package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +31 -31
  264. package/lib/types/components/webchatcontainerstateful/common/MockBotCardCommandType.d.ts +6 -6
  265. package/lib/types/components/webchatcontainerstateful/common/MockBotCommand.d.ts +11 -11
  266. package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultAttachmentProps.d.ts +2 -2
  267. package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts.d.ts +2 -2
  268. package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.d.ts +2 -2
  269. package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.d.ts +2 -2
  270. package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.d.ts +2 -2
  271. package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -2
  272. package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStatefulContainerStyles.d.ts +2 -2
  273. package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.d.ts +2 -2
  274. package/lib/types/components/webchatcontainerstateful/common/mockadapter.d.ts +14 -14
  275. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +45 -45
  276. package/lib/types/components/webchatcontainerstateful/common/utils/BrowserInfo.d.ts +5 -5
  277. package/lib/types/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.d.ts +7 -7
  278. package/lib/types/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.d.ts +9 -9
  279. package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +9 -9
  280. package/lib/types/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.d.ts +2 -2
  281. package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +8 -8
  282. package/lib/types/components/webchatcontainerstateful/interfaces/IAttachmentProps.d.ts +5 -5
  283. package/lib/types/components/webchatcontainerstateful/interfaces/IBotAuthConfig.d.ts +4 -4
  284. package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -4
  285. package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingInfo.d.ts +6 -6
  286. package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingRule.d.ts +3 -3
  287. package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingSetting.d.ts +4 -4
  288. package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +37 -37
  289. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatAction.d.ts +4 -4
  290. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +28 -28
  291. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatProps.d.ts +39 -39
  292. package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -3
  293. package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.d.ts +3 -3
  294. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.d.ts +9 -9
  295. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.d.ts +4 -4
  296. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.d.ts +5 -5
  297. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.d.ts +11 -11
  298. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.d.ts +6 -6
  299. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.d.ts +11 -11
  300. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.d.ts +5 -5
  301. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.d.ts +24 -24
  302. package/lib/types/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.d.ts +9 -9
  303. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.d.ts +2 -2
  304. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.d.ts +2 -2
  305. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +10 -10
  306. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
  307. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.d.ts +6 -6
  308. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.d.ts +3 -2
  309. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.d.ts +3 -2
  310. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.d.ts +3 -2
  311. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.d.ts +3 -2
  312. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.d.ts +6 -6
  313. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.d.ts +3 -2
  314. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.d.ts +3 -2
  315. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.d.ts +3 -2
  316. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +8 -8
  317. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -2
  318. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentContentStyles.d.ts +1 -2
  319. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDividerStyles.d.ts +1 -2
  320. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDownloadIconStyles.d.ts +1 -2
  321. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentFileNameStyles.d.ts +1 -2
  322. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentSizeStyles.d.ts +1 -2
  323. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentAdaptiveCardStyles.d.ts +1 -2
  324. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentIconStyles.d.ts +1 -2
  325. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentStyles.d.ts +1 -2
  326. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarStyles.d.ts +1 -2
  327. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.d.ts +1 -2
  328. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +1 -2
  329. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles.d.ts +1 -2
  330. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -3
  331. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.d.ts +11 -11
  332. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampContentStyles.d.ts +2 -2
  333. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.d.ts +1 -2
  334. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.d.ts +1 -2
  335. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorBubbleStyles.d.ts +1 -2
  336. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorContainerStyles.d.ts +1 -2
  337. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorMessageStyles.d.ts +1 -2
  338. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -3
  339. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageStyles.d.ts +3 -3
  340. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.d.ts +10 -10
  341. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/index.d.ts +10 -10
  342. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.d.ts +4 -4
  343. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +4 -4
  344. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.d.ts +2 -1
  345. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.d.ts +2 -1
  346. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +2 -1
  347. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.d.ts +2 -2
  348. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.d.ts +7 -6
  349. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.d.ts +10 -10
  350. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +11 -11
  351. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.d.ts +10 -10
  352. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.d.ts +11 -11
  353. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.d.ts +11 -11
  354. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.d.ts +10 -10
  355. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.d.ts +10 -10
  356. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.d.ts +10 -10
  357. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.d.ts +11 -11
  358. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.d.ts +10 -10
  359. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.d.ts +10 -10
  360. package/lib/types/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.d.ts +12 -12
  361. package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -1
  362. package/lib/types/contexts/ChatAdapterStore.d.ts +1 -2
  363. package/lib/types/contexts/ChatContextStore.d.ts +1 -1
  364. package/lib/types/contexts/ChatSDKStore.d.ts +1 -1
  365. package/lib/types/contexts/FacadeChatSDKStore.d.ts +1 -1
  366. package/lib/types/contexts/common/ConversationState.d.ts +13 -13
  367. package/lib/types/contexts/common/ILiveChatWidgetAction.d.ts +5 -5
  368. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +63 -63
  369. package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +40 -40
  370. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +48 -48
  371. package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +3 -3
  372. package/lib/types/contexts/common/StartChatFailureType.d.ts +5 -5
  373. package/lib/types/contexts/createReducer.d.ts +4 -4
  374. package/lib/types/controller/componentController.d.ts +16 -16
  375. package/lib/types/firstresponselatency/Constants.d.ts +30 -30
  376. package/lib/types/firstresponselatency/FirstMessageTrackerFromBot.d.ts +1 -1
  377. package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +22 -22
  378. package/lib/types/firstresponselatency/util.d.ts +7 -7
  379. package/lib/types/hooks/useChatAdapterStore.d.ts +2 -2
  380. package/lib/types/hooks/useChatContextStore.d.ts +5 -5
  381. package/lib/types/hooks/useChatSDKStore.d.ts +2 -2
  382. package/lib/types/hooks/useDebounce.d.ts +3 -3
  383. package/lib/types/hooks/useFacadeChatSDKStore.d.ts +3 -3
  384. package/lib/types/hooks/useWindowDimensions.d.ts +4 -4
  385. package/lib/types/index.d.ts +11 -11
  386. package/lib/types/plugins/createChatTranscript.d.ts +3 -3
  387. package/lib/types/plugins/newMessageEventHandler.d.ts +2 -2
  388. package/package.json +32 -17
@@ -7,11 +7,15 @@ 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
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
+ 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
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
13
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
14
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
12
15
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
- class FirstResponseLatencyTracker {
14
- constructor() {
16
+ let FirstResponseLatencyTracker = /*#__PURE__*/function () {
17
+ function FirstResponseLatencyTracker() {
18
+ _classCallCheck(this, FirstResponseLatencyTracker);
15
19
  _defineProperty(this, "isABotConversation", false);
16
20
  _defineProperty(this, "isStarted", false);
17
21
  _defineProperty(this, "isEnded", false);
@@ -47,133 +51,151 @@ class FirstResponseLatencyTracker {
47
51
  // we do have a mechanism in place to prevent log agent messages.
48
52
  this.isABotConversation = true;
49
53
  }
50
- createTrackingMessage(payload, type) {
51
- return {
52
- Id: payload.Id,
53
- role: payload.role,
54
- timestamp: payload === null || payload === void 0 ? void 0 : payload.timestamp,
55
- tags: payload.tags,
56
- messageType: payload.messageType,
57
- text: payload.text,
58
- type: type,
59
- checkTime: new Date().getTime()
60
- };
61
- }
62
-
63
- // Tracking Functions
64
- startTracking(payload) {
65
- if (!this.isReady) return;
66
- // this prevents to initiate tracking for multiple incoming messages
67
- if (this.isStarted) {
68
- return;
69
- }
70
- // this is to ensure we track only messages where bot is engaged
71
- if (!this.isABotConversation) {
72
- return;
73
- }
74
- // control of states to prevent clashing of messages
75
- this.isStarted = true;
76
- this.isEnded = false;
77
- // The idea of using types is to enrich telemetry data
78
- this.startTrackingMessage = this.createTrackingMessage(payload, "userMessage");
79
- }
80
- handleAgentMessage(payload) {
81
- var _payload$tags;
82
- // this tag so far is only present in agent messages
83
- if (payload !== null && payload !== void 0 && (_payload$tags = payload.tags) !== null && _payload$tags !== void 0 && _payload$tags.includes("public")) {
84
- this.deregister();
85
- }
86
- }
87
- stopTracking(payload) {
88
- var _this$stopTrackingMes, _this$startTrackingMe;
89
- // this prevents execution for multiple incoming messages from the bot.
90
- if (this.isEnded && !this.isStarted) {
91
- return;
54
+ _createClass(FirstResponseLatencyTracker, [{
55
+ key: "createTrackingMessage",
56
+ value: function createTrackingMessage(payload, type) {
57
+ return {
58
+ Id: payload.Id,
59
+ role: payload.role,
60
+ timestamp: payload === null || payload === void 0 ? void 0 : payload.timestamp,
61
+ tags: payload.tags,
62
+ messageType: payload.messageType,
63
+ text: payload.text,
64
+ type: type,
65
+ checkTime: new Date().getTime()
66
+ };
92
67
  }
93
68
 
94
- // control of states to prevent clashing of messages
95
- this.isEnded = true;
96
- this.isStarted = false;
97
-
98
- // The idea of using types is to enrich telemetry data
99
- this.stopTrackingMessage = this.createTrackingMessage(payload, "botMessage");
100
- // calculating elapsed time
101
- const elapsedTime = (((_this$stopTrackingMes = this.stopTrackingMessage) === null || _this$stopTrackingMes === void 0 ? void 0 : _this$stopTrackingMes.checkTime) ?? 0) - (((_this$startTrackingMe = this.startTrackingMessage) === null || _this$startTrackingMe === void 0 ? void 0 : _this$startTrackingMe.checkTime) ?? 0);
102
- _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
103
- Event: _TelemetryConstants.TelemetryEvent.MessageLapTrack,
104
- Description: "First response latency tracking",
105
- CustomProperties: {
106
- elapsedTime,
107
- userMessage: this.startTrackingMessage,
108
- botMessage: this.stopTrackingMessage
69
+ // Tracking Functions
70
+ }, {
71
+ key: "startTracking",
72
+ value: function startTracking(payload) {
73
+ if (!this.isReady) return;
74
+ // this prevents to initiate tracking for multiple incoming messages
75
+ if (this.isStarted) {
76
+ return;
109
77
  }
110
- });
111
- }
112
-
113
- // mechanism to ensure we track only allowed conversations
114
- isMessageFromValidSender(payload) {
115
- var _payload$tags2;
116
- // agent scenario
117
- if (payload !== null && payload !== void 0 && (_payload$tags2 = payload.tags) !== null && _payload$tags2 !== void 0 && _payload$tags2.includes("public")) {
118
- this.handleAgentMessage(payload);
119
- return false;
78
+ // this is to ensure we track only messages where bot is engaged
79
+ if (!this.isABotConversation) {
80
+ return;
81
+ }
82
+ // control of states to prevent clashing of messages
83
+ this.isStarted = true;
84
+ this.isEnded = false;
85
+ // The idea of using types is to enrich telemetry data
86
+ this.startTrackingMessage = this.createTrackingMessage(payload, "userMessage");
120
87
  }
121
- return true;
122
- }
123
- startClock(payload) {
124
- try {
125
- if (!payload || !payload.Id) {
126
- throw new Error("Invalid payload");
88
+ }, {
89
+ key: "handleAgentMessage",
90
+ value: function handleAgentMessage(payload) {
91
+ var _payload$tags;
92
+ // this tag so far is only present in agent messages
93
+ if (payload !== null && payload !== void 0 && (_payload$tags = payload.tags) !== null && _payload$tags !== void 0 && _payload$tags.includes("public")) {
94
+ this.deregister();
127
95
  }
128
- this.startTracking(payload);
129
- } catch (e) {
130
- _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
131
- Event: _TelemetryConstants.TelemetryEvent.MessageStartLapTrackError,
132
- Description: "Error while starting the clock",
133
- ExceptionDetails: e,
96
+ }
97
+ }, {
98
+ key: "stopTracking",
99
+ value: function stopTracking(payload) {
100
+ var _this$stopTrackingMes, _this$startTrackingMe;
101
+ // this prevents execution for multiple incoming messages from the bot.
102
+ if (this.isEnded && !this.isStarted) {
103
+ return;
104
+ }
105
+
106
+ // control of states to prevent clashing of messages
107
+ this.isEnded = true;
108
+ this.isStarted = false;
109
+
110
+ // The idea of using types is to enrich telemetry data
111
+ this.stopTrackingMessage = this.createTrackingMessage(payload, "botMessage");
112
+ // calculating elapsed time
113
+ const elapsedTime = (((_this$stopTrackingMes = this.stopTrackingMessage) === null || _this$stopTrackingMes === void 0 ? void 0 : _this$stopTrackingMes.checkTime) ?? 0) - (((_this$startTrackingMe = this.startTrackingMessage) === null || _this$startTrackingMe === void 0 ? void 0 : _this$startTrackingMe.checkTime) ?? 0);
114
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
115
+ Event: _TelemetryConstants.TelemetryEvent.MessageLapTrack,
116
+ Description: "First response latency tracking",
134
117
  CustomProperties: {
135
- payload: payload
118
+ elapsedTime,
119
+ userMessage: this.startTrackingMessage,
120
+ botMessage: this.stopTrackingMessage
136
121
  }
137
122
  });
138
123
  }
139
- }
140
- stopClock(payload) {
141
- try {
142
- if (!payload || !payload.Id) {
143
- throw new Error("Invalid payload");
124
+
125
+ // mechanism to ensure we track only allowed conversations
126
+ }, {
127
+ key: "isMessageFromValidSender",
128
+ value: function isMessageFromValidSender(payload) {
129
+ var _payload$tags2;
130
+ // agent scenario
131
+ if (payload !== null && payload !== void 0 && (_payload$tags2 = payload.tags) !== null && _payload$tags2 !== void 0 && _payload$tags2.includes("public")) {
132
+ this.handleAgentMessage(payload);
133
+ return false;
144
134
  }
145
- if (!this.isMessageFromValidSender(payload)) return;
146
- if (this.isABotConversation && this.isStarted) {
147
- this.stopTracking(payload);
135
+ return true;
136
+ }
137
+ }, {
138
+ key: "startClock",
139
+ value: function startClock(payload) {
140
+ try {
141
+ if (!payload || !payload.Id) {
142
+ throw new Error("Invalid payload");
143
+ }
144
+ this.startTracking(payload);
145
+ } catch (e) {
146
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
147
+ Event: _TelemetryConstants.TelemetryEvent.MessageStartLapTrackError,
148
+ Description: "Error while starting the clock",
149
+ ExceptionDetails: e,
150
+ CustomProperties: {
151
+ payload: payload
152
+ }
153
+ });
148
154
  }
149
- } catch (e) {
150
- console.error("FRL : error while trying to stop the tracker", e);
151
- _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
152
- Event: _TelemetryConstants.TelemetryEvent.MessageStopLapTrackError,
153
- Description: "Error while stopping the clock",
154
- ExceptionDetails: e,
155
- CustomProperties: {
156
- payload: payload
155
+ }
156
+ }, {
157
+ key: "stopClock",
158
+ value: function stopClock(payload) {
159
+ try {
160
+ if (!payload || !payload.Id) {
161
+ throw new Error("Invalid payload");
157
162
  }
158
- });
159
- //reset state
160
- this.startTrackingMessage = undefined;
161
- this.stopTrackingMessage = undefined;
163
+ if (!this.isMessageFromValidSender(payload)) return;
164
+ if (this.isABotConversation && this.isStarted) {
165
+ this.stopTracking(payload);
166
+ }
167
+ } catch (e) {
168
+ console.error("FRL : error while trying to stop the tracker", e);
169
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
170
+ Event: _TelemetryConstants.TelemetryEvent.MessageStopLapTrackError,
171
+ Description: "Error while stopping the clock",
172
+ ExceptionDetails: e,
173
+ CustomProperties: {
174
+ payload: payload
175
+ }
176
+ });
177
+ //reset state
178
+ this.startTrackingMessage = undefined;
179
+ this.stopTrackingMessage = undefined;
180
+ this.isStarted = false;
181
+ this.isEnded = false;
182
+ }
183
+ }
184
+ }, {
185
+ key: "deregister",
186
+ value: function deregister() {
187
+ // Reset State
188
+ this.isABotConversation = false;
162
189
  this.isStarted = false;
163
190
  this.isEnded = false;
191
+ this.startTrackingMessage = undefined;
192
+ this.stopTrackingMessage = undefined;
193
+ this.offlineNetworkListener.unsubscribe();
194
+ this.fmltrackingListener.unsubscribe();
195
+ this.rehydrateListener.unsubscribe();
196
+ this.historyListener.unsubscribe();
164
197
  }
165
- }
166
- deregister() {
167
- // Reset State
168
- this.isABotConversation = false;
169
- this.isStarted = false;
170
- this.isEnded = false;
171
- this.startTrackingMessage = undefined;
172
- this.stopTrackingMessage = undefined;
173
- this.offlineNetworkListener.unsubscribe();
174
- this.fmltrackingListener.unsubscribe();
175
- this.rehydrateListener.unsubscribe();
176
- this.historyListener.unsubscribe();
177
- }
178
- }
198
+ }]);
199
+ return FirstResponseLatencyTracker;
200
+ }();
179
201
  exports.FirstResponseLatencyTracker = FirstResponseLatencyTracker;
@@ -8,14 +8,18 @@ var _utils = require("../common/utils");
8
8
  var _defaultLibraryScripts = _interopRequireDefault(require("../components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts"));
9
9
  var _dompurify = _interopRequireDefault(require("dompurify"));
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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); } }
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; }
11
14
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
15
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
13
16
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
- class TranscriptHTMLBuilder {
17
+ let TranscriptHTMLBuilder = /*#__PURE__*/function () {
15
18
  // eslint-disable-line @typescript-eslint/no-explicit-any
16
19
 
17
- constructor(options) {
20
+ function TranscriptHTMLBuilder(options) {
18
21
  var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12, _this$options13;
22
+ _classCallCheck(this, TranscriptHTMLBuilder);
19
23
  _defineProperty(this, "options", void 0);
20
24
  _defineProperty(this, "pageTitle", "Customer Transcript");
21
25
  _defineProperty(this, "attachmentMessage", "The following attachment was uploaded during the conversation: ");
@@ -75,59 +79,79 @@ class TranscriptHTMLBuilder {
75
79
  this.externalScripts = this.options.externalScripts;
76
80
  }
77
81
  }
78
- createMetaElement() {
79
- const htmlData = `
82
+ _createClass(TranscriptHTMLBuilder, [{
83
+ key: "createMetaElement",
84
+ value: function createMetaElement() {
85
+ const htmlData = `
80
86
  <meta charset="UTF-8">
81
87
  `;
82
- return htmlData;
83
- }
84
- createTitleElement() {
85
- const htmlData = `<title> ${this.pageTitle} </title>`;
86
- return htmlData;
87
- }
88
- createScriptElement(src) {
89
- let integrity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
90
- let crossOrigin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
91
- let referrerPolicy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
92
- return `<script src="${src}" ${integrity ? `integrity="${integrity}"` : ""} ${crossOrigin ? `crossorigin="${crossOrigin}"` : ""} ${referrerPolicy ? `referrerpolicy="${referrerPolicy}"` : ""}><\/script>`;
93
- }
94
- createWebChatScriptElement() {
95
- var _this$externalScripts, _this$externalScripts2, _this$externalScripts3, _this$externalScripts4, _this$externalScripts5, _this$externalScripts6, _this$externalScripts7, _this$externalScripts8, _this$externalScripts9, _this$externalScripts10;
96
- return (_this$externalScripts = this.externalScripts) !== null && _this$externalScripts !== void 0 && (_this$externalScripts2 = _this$externalScripts.botframeworkWebChat) !== null && _this$externalScripts2 !== void 0 && _this$externalScripts2.src ? this.createScriptElement((_this$externalScripts3 = this.externalScripts) === null || _this$externalScripts3 === void 0 ? void 0 : (_this$externalScripts4 = _this$externalScripts3.botframeworkWebChat) === null || _this$externalScripts4 === void 0 ? void 0 : _this$externalScripts4.src, (_this$externalScripts5 = this.externalScripts) === null || _this$externalScripts5 === void 0 ? void 0 : (_this$externalScripts6 = _this$externalScripts5.botframeworkWebChat) === null || _this$externalScripts6 === void 0 ? void 0 : _this$externalScripts6.integrity, (_this$externalScripts7 = this.externalScripts) === null || _this$externalScripts7 === void 0 ? void 0 : (_this$externalScripts8 = _this$externalScripts7.botframeworkWebChat) === null || _this$externalScripts8 === void 0 ? void 0 : _this$externalScripts8.crossOrigin, (_this$externalScripts9 = this.externalScripts) === null || _this$externalScripts9 === void 0 ? void 0 : (_this$externalScripts10 = _this$externalScripts9.botframeworkWebChat) === null || _this$externalScripts10 === void 0 ? void 0 : _this$externalScripts10.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.botframeworkWebChat.src);
97
- }
98
- createRxJsScriptElement() {
99
- var _this$externalScripts11, _this$externalScripts12, _this$externalScripts13, _this$externalScripts14, _this$externalScripts15, _this$externalScripts16, _this$externalScripts17, _this$externalScripts18, _this$externalScripts19, _this$externalScripts20;
100
- return (_this$externalScripts11 = this.externalScripts) !== null && _this$externalScripts11 !== void 0 && (_this$externalScripts12 = _this$externalScripts11.rxJs) !== null && _this$externalScripts12 !== void 0 && _this$externalScripts12.src ? this.createScriptElement((_this$externalScripts13 = this.externalScripts) === null || _this$externalScripts13 === void 0 ? void 0 : (_this$externalScripts14 = _this$externalScripts13.rxJs) === null || _this$externalScripts14 === void 0 ? void 0 : _this$externalScripts14.src, (_this$externalScripts15 = this.externalScripts) === null || _this$externalScripts15 === void 0 ? void 0 : (_this$externalScripts16 = _this$externalScripts15.rxJs) === null || _this$externalScripts16 === void 0 ? void 0 : _this$externalScripts16.integrity, (_this$externalScripts17 = this.externalScripts) === null || _this$externalScripts17 === void 0 ? void 0 : (_this$externalScripts18 = _this$externalScripts17.rxJs) === null || _this$externalScripts18 === void 0 ? void 0 : _this$externalScripts18.crossOrigin, (_this$externalScripts19 = this.externalScripts) === null || _this$externalScripts19 === void 0 ? void 0 : (_this$externalScripts20 = _this$externalScripts19.rxJs) === null || _this$externalScripts20 === void 0 ? void 0 : _this$externalScripts20.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.rxJs.src, _defaultLibraryScripts.default.rxJs.integrity, _defaultLibraryScripts.default.rxJs.crossOrigin, _defaultLibraryScripts.default.rxJs.referrerPolicy);
101
- }
102
- createReactScriptElement() {
103
- var _this$externalScripts21, _this$externalScripts22, _this$externalScripts23, _this$externalScripts24, _this$externalScripts25, _this$externalScripts26, _this$externalScripts27, _this$externalScripts28, _this$externalScripts29, _this$externalScripts30;
104
- return (_this$externalScripts21 = this.externalScripts) !== null && _this$externalScripts21 !== void 0 && (_this$externalScripts22 = _this$externalScripts21.react) !== null && _this$externalScripts22 !== void 0 && _this$externalScripts22.src ? this.createScriptElement((_this$externalScripts23 = this.externalScripts) === null || _this$externalScripts23 === void 0 ? void 0 : (_this$externalScripts24 = _this$externalScripts23.react) === null || _this$externalScripts24 === void 0 ? void 0 : _this$externalScripts24.src, (_this$externalScripts25 = this.externalScripts) === null || _this$externalScripts25 === void 0 ? void 0 : (_this$externalScripts26 = _this$externalScripts25.react) === null || _this$externalScripts26 === void 0 ? void 0 : _this$externalScripts26.integrity, (_this$externalScripts27 = this.externalScripts) === null || _this$externalScripts27 === void 0 ? void 0 : (_this$externalScripts28 = _this$externalScripts27.react) === null || _this$externalScripts28 === void 0 ? void 0 : _this$externalScripts28.crossOrigin, (_this$externalScripts29 = this.externalScripts) === null || _this$externalScripts29 === void 0 ? void 0 : (_this$externalScripts30 = _this$externalScripts29.react) === null || _this$externalScripts30 === void 0 ? void 0 : _this$externalScripts30.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.react.src);
105
- }
106
- createReactDomScriptElement() {
107
- var _this$externalScripts31, _this$externalScripts32, _this$externalScripts33, _this$externalScripts34, _this$externalScripts35, _this$externalScripts36, _this$externalScripts37, _this$externalScripts38, _this$externalScripts39, _this$externalScripts40, _this$externalScripts41, _this$externalScripts42;
108
- return (_this$externalScripts31 = this.externalScripts) !== null && _this$externalScripts31 !== void 0 && (_this$externalScripts32 = _this$externalScripts31.reactDom) !== null && _this$externalScripts32 !== void 0 && _this$externalScripts32.src ? this.createScriptElement((_this$externalScripts33 = this.externalScripts) === null || _this$externalScripts33 === void 0 ? void 0 : (_this$externalScripts34 = _this$externalScripts33.reactDom) === null || _this$externalScripts34 === void 0 ? void 0 : _this$externalScripts34.src, (_this$externalScripts35 = this.externalScripts) === null || _this$externalScripts35 === void 0 ? void 0 : (_this$externalScripts36 = _this$externalScripts35.reactDom) === null || _this$externalScripts36 === void 0 ? void 0 : _this$externalScripts36.integrity, (_this$externalScripts37 = this.externalScripts) === null || _this$externalScripts37 === void 0 ? void 0 : (_this$externalScripts38 = _this$externalScripts37.reactDom) === null || _this$externalScripts38 === void 0 ? void 0 : _this$externalScripts38.crossOrigin, (_this$externalScripts39 = this.externalScripts) === null || _this$externalScripts39 === void 0 ? void 0 : (_this$externalScripts40 = _this$externalScripts39.reactDom) === null || _this$externalScripts40 === void 0 ? void 0 : _this$externalScripts40.referrerPolicy) : this.createScriptElement(((_this$externalScripts41 = this.externalScripts) === null || _this$externalScripts41 === void 0 ? void 0 : (_this$externalScripts42 = _this$externalScripts41.reactDom) === null || _this$externalScripts42 === void 0 ? void 0 : _this$externalScripts42.src) ?? _defaultLibraryScripts.default.reactDom.src);
109
- }
110
- createMarkdownItScriptElement() {
111
- var _this$externalScripts43, _this$externalScripts44, _this$externalScripts45, _this$externalScripts46, _this$externalScripts47, _this$externalScripts48, _this$externalScripts49, _this$externalScripts50, _this$externalScripts51, _this$externalScripts52;
112
- return (_this$externalScripts43 = this.externalScripts) !== null && _this$externalScripts43 !== void 0 && (_this$externalScripts44 = _this$externalScripts43.markdownIt) !== null && _this$externalScripts44 !== void 0 && _this$externalScripts44.src ? this.createScriptElement((_this$externalScripts45 = this.externalScripts) === null || _this$externalScripts45 === void 0 ? void 0 : (_this$externalScripts46 = _this$externalScripts45.markdownIt) === null || _this$externalScripts46 === void 0 ? void 0 : _this$externalScripts46.src, (_this$externalScripts47 = this.externalScripts) === null || _this$externalScripts47 === void 0 ? void 0 : (_this$externalScripts48 = _this$externalScripts47.markdownIt) === null || _this$externalScripts48 === void 0 ? void 0 : _this$externalScripts48.integrity, (_this$externalScripts49 = this.externalScripts) === null || _this$externalScripts49 === void 0 ? void 0 : (_this$externalScripts50 = _this$externalScripts49.markdownIt) === null || _this$externalScripts50 === void 0 ? void 0 : _this$externalScripts50.crossOrigin, (_this$externalScripts51 = this.externalScripts) === null || _this$externalScripts51 === void 0 ? void 0 : (_this$externalScripts52 = _this$externalScripts51.markdownIt) === null || _this$externalScripts52 === void 0 ? void 0 : _this$externalScripts52.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.markdownIt.src, _defaultLibraryScripts.default.markdownIt.integrity, _defaultLibraryScripts.default.markdownIt.crossOrigin);
113
- }
114
- createExternalScriptElements() {
115
- const webChatScript = this.createWebChatScriptElement();
116
- const rxJsScript = this.createRxJsScriptElement();
117
- const reactScript = this.createReactScriptElement();
118
- const reactDomScript = this.createReactDomScriptElement();
119
- const markdownItScript = this.createMarkdownItScriptElement();
120
- const htmlData = `
88
+ return htmlData;
89
+ }
90
+ }, {
91
+ key: "createTitleElement",
92
+ value: function createTitleElement() {
93
+ const htmlData = `<title> ${this.pageTitle} </title>`;
94
+ return htmlData;
95
+ }
96
+ }, {
97
+ key: "createScriptElement",
98
+ value: function createScriptElement(src) {
99
+ let integrity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
100
+ let crossOrigin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
101
+ let referrerPolicy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
102
+ return `<script src="${src}" ${integrity ? `integrity="${integrity}"` : ""} ${crossOrigin ? `crossorigin="${crossOrigin}"` : ""} ${referrerPolicy ? `referrerpolicy="${referrerPolicy}"` : ""}><\/script>`;
103
+ }
104
+ }, {
105
+ key: "createWebChatScriptElement",
106
+ value: function createWebChatScriptElement() {
107
+ var _this$externalScripts, _this$externalScripts2, _this$externalScripts3, _this$externalScripts4, _this$externalScripts5, _this$externalScripts6, _this$externalScripts7, _this$externalScripts8, _this$externalScripts9, _this$externalScripts10;
108
+ return (_this$externalScripts = this.externalScripts) !== null && _this$externalScripts !== void 0 && (_this$externalScripts2 = _this$externalScripts.botframeworkWebChat) !== null && _this$externalScripts2 !== void 0 && _this$externalScripts2.src ? this.createScriptElement((_this$externalScripts3 = this.externalScripts) === null || _this$externalScripts3 === void 0 ? void 0 : (_this$externalScripts4 = _this$externalScripts3.botframeworkWebChat) === null || _this$externalScripts4 === void 0 ? void 0 : _this$externalScripts4.src, (_this$externalScripts5 = this.externalScripts) === null || _this$externalScripts5 === void 0 ? void 0 : (_this$externalScripts6 = _this$externalScripts5.botframeworkWebChat) === null || _this$externalScripts6 === void 0 ? void 0 : _this$externalScripts6.integrity, (_this$externalScripts7 = this.externalScripts) === null || _this$externalScripts7 === void 0 ? void 0 : (_this$externalScripts8 = _this$externalScripts7.botframeworkWebChat) === null || _this$externalScripts8 === void 0 ? void 0 : _this$externalScripts8.crossOrigin, (_this$externalScripts9 = this.externalScripts) === null || _this$externalScripts9 === void 0 ? void 0 : (_this$externalScripts10 = _this$externalScripts9.botframeworkWebChat) === null || _this$externalScripts10 === void 0 ? void 0 : _this$externalScripts10.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.botframeworkWebChat.src);
109
+ }
110
+ }, {
111
+ key: "createRxJsScriptElement",
112
+ value: function createRxJsScriptElement() {
113
+ var _this$externalScripts11, _this$externalScripts12, _this$externalScripts13, _this$externalScripts14, _this$externalScripts15, _this$externalScripts16, _this$externalScripts17, _this$externalScripts18, _this$externalScripts19, _this$externalScripts20;
114
+ return (_this$externalScripts11 = this.externalScripts) !== null && _this$externalScripts11 !== void 0 && (_this$externalScripts12 = _this$externalScripts11.rxJs) !== null && _this$externalScripts12 !== void 0 && _this$externalScripts12.src ? this.createScriptElement((_this$externalScripts13 = this.externalScripts) === null || _this$externalScripts13 === void 0 ? void 0 : (_this$externalScripts14 = _this$externalScripts13.rxJs) === null || _this$externalScripts14 === void 0 ? void 0 : _this$externalScripts14.src, (_this$externalScripts15 = this.externalScripts) === null || _this$externalScripts15 === void 0 ? void 0 : (_this$externalScripts16 = _this$externalScripts15.rxJs) === null || _this$externalScripts16 === void 0 ? void 0 : _this$externalScripts16.integrity, (_this$externalScripts17 = this.externalScripts) === null || _this$externalScripts17 === void 0 ? void 0 : (_this$externalScripts18 = _this$externalScripts17.rxJs) === null || _this$externalScripts18 === void 0 ? void 0 : _this$externalScripts18.crossOrigin, (_this$externalScripts19 = this.externalScripts) === null || _this$externalScripts19 === void 0 ? void 0 : (_this$externalScripts20 = _this$externalScripts19.rxJs) === null || _this$externalScripts20 === void 0 ? void 0 : _this$externalScripts20.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.rxJs.src, _defaultLibraryScripts.default.rxJs.integrity, _defaultLibraryScripts.default.rxJs.crossOrigin, _defaultLibraryScripts.default.rxJs.referrerPolicy);
115
+ }
116
+ }, {
117
+ key: "createReactScriptElement",
118
+ value: function createReactScriptElement() {
119
+ var _this$externalScripts21, _this$externalScripts22, _this$externalScripts23, _this$externalScripts24, _this$externalScripts25, _this$externalScripts26, _this$externalScripts27, _this$externalScripts28, _this$externalScripts29, _this$externalScripts30;
120
+ return (_this$externalScripts21 = this.externalScripts) !== null && _this$externalScripts21 !== void 0 && (_this$externalScripts22 = _this$externalScripts21.react) !== null && _this$externalScripts22 !== void 0 && _this$externalScripts22.src ? this.createScriptElement((_this$externalScripts23 = this.externalScripts) === null || _this$externalScripts23 === void 0 ? void 0 : (_this$externalScripts24 = _this$externalScripts23.react) === null || _this$externalScripts24 === void 0 ? void 0 : _this$externalScripts24.src, (_this$externalScripts25 = this.externalScripts) === null || _this$externalScripts25 === void 0 ? void 0 : (_this$externalScripts26 = _this$externalScripts25.react) === null || _this$externalScripts26 === void 0 ? void 0 : _this$externalScripts26.integrity, (_this$externalScripts27 = this.externalScripts) === null || _this$externalScripts27 === void 0 ? void 0 : (_this$externalScripts28 = _this$externalScripts27.react) === null || _this$externalScripts28 === void 0 ? void 0 : _this$externalScripts28.crossOrigin, (_this$externalScripts29 = this.externalScripts) === null || _this$externalScripts29 === void 0 ? void 0 : (_this$externalScripts30 = _this$externalScripts29.react) === null || _this$externalScripts30 === void 0 ? void 0 : _this$externalScripts30.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.react.src);
121
+ }
122
+ }, {
123
+ key: "createReactDomScriptElement",
124
+ value: function createReactDomScriptElement() {
125
+ var _this$externalScripts31, _this$externalScripts32, _this$externalScripts33, _this$externalScripts34, _this$externalScripts35, _this$externalScripts36, _this$externalScripts37, _this$externalScripts38, _this$externalScripts39, _this$externalScripts40, _this$externalScripts41, _this$externalScripts42;
126
+ return (_this$externalScripts31 = this.externalScripts) !== null && _this$externalScripts31 !== void 0 && (_this$externalScripts32 = _this$externalScripts31.reactDom) !== null && _this$externalScripts32 !== void 0 && _this$externalScripts32.src ? this.createScriptElement((_this$externalScripts33 = this.externalScripts) === null || _this$externalScripts33 === void 0 ? void 0 : (_this$externalScripts34 = _this$externalScripts33.reactDom) === null || _this$externalScripts34 === void 0 ? void 0 : _this$externalScripts34.src, (_this$externalScripts35 = this.externalScripts) === null || _this$externalScripts35 === void 0 ? void 0 : (_this$externalScripts36 = _this$externalScripts35.reactDom) === null || _this$externalScripts36 === void 0 ? void 0 : _this$externalScripts36.integrity, (_this$externalScripts37 = this.externalScripts) === null || _this$externalScripts37 === void 0 ? void 0 : (_this$externalScripts38 = _this$externalScripts37.reactDom) === null || _this$externalScripts38 === void 0 ? void 0 : _this$externalScripts38.crossOrigin, (_this$externalScripts39 = this.externalScripts) === null || _this$externalScripts39 === void 0 ? void 0 : (_this$externalScripts40 = _this$externalScripts39.reactDom) === null || _this$externalScripts40 === void 0 ? void 0 : _this$externalScripts40.referrerPolicy) : this.createScriptElement(((_this$externalScripts41 = this.externalScripts) === null || _this$externalScripts41 === void 0 ? void 0 : (_this$externalScripts42 = _this$externalScripts41.reactDom) === null || _this$externalScripts42 === void 0 ? void 0 : _this$externalScripts42.src) ?? _defaultLibraryScripts.default.reactDom.src);
127
+ }
128
+ }, {
129
+ key: "createMarkdownItScriptElement",
130
+ value: function createMarkdownItScriptElement() {
131
+ var _this$externalScripts43, _this$externalScripts44, _this$externalScripts45, _this$externalScripts46, _this$externalScripts47, _this$externalScripts48, _this$externalScripts49, _this$externalScripts50, _this$externalScripts51, _this$externalScripts52;
132
+ return (_this$externalScripts43 = this.externalScripts) !== null && _this$externalScripts43 !== void 0 && (_this$externalScripts44 = _this$externalScripts43.markdownIt) !== null && _this$externalScripts44 !== void 0 && _this$externalScripts44.src ? this.createScriptElement((_this$externalScripts45 = this.externalScripts) === null || _this$externalScripts45 === void 0 ? void 0 : (_this$externalScripts46 = _this$externalScripts45.markdownIt) === null || _this$externalScripts46 === void 0 ? void 0 : _this$externalScripts46.src, (_this$externalScripts47 = this.externalScripts) === null || _this$externalScripts47 === void 0 ? void 0 : (_this$externalScripts48 = _this$externalScripts47.markdownIt) === null || _this$externalScripts48 === void 0 ? void 0 : _this$externalScripts48.integrity, (_this$externalScripts49 = this.externalScripts) === null || _this$externalScripts49 === void 0 ? void 0 : (_this$externalScripts50 = _this$externalScripts49.markdownIt) === null || _this$externalScripts50 === void 0 ? void 0 : _this$externalScripts50.crossOrigin, (_this$externalScripts51 = this.externalScripts) === null || _this$externalScripts51 === void 0 ? void 0 : (_this$externalScripts52 = _this$externalScripts51.markdownIt) === null || _this$externalScripts52 === void 0 ? void 0 : _this$externalScripts52.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.markdownIt.src, _defaultLibraryScripts.default.markdownIt.integrity, _defaultLibraryScripts.default.markdownIt.crossOrigin);
133
+ }
134
+ }, {
135
+ key: "createExternalScriptElements",
136
+ value: function createExternalScriptElements() {
137
+ const webChatScript = this.createWebChatScriptElement();
138
+ const rxJsScript = this.createRxJsScriptElement();
139
+ const reactScript = this.createReactScriptElement();
140
+ const reactDomScript = this.createReactDomScriptElement();
141
+ const markdownItScript = this.createMarkdownItScriptElement();
142
+ const htmlData = `
121
143
  ${webChatScript}
122
144
  ${rxJsScript}
123
145
  ${reactScript}
124
146
  ${reactDomScript}
125
147
  ${markdownItScript}
126
148
  `;
127
- return htmlData;
128
- }
129
- createHeadElement() {
130
- const htmlData = `
149
+ return htmlData;
150
+ }
151
+ }, {
152
+ key: "createHeadElement",
153
+ value: function createHeadElement() {
154
+ const htmlData = `
131
155
  <head>
132
156
  ${this.createMetaElement()}
133
157
  ${this.createTitleElement()}
@@ -367,10 +391,12 @@ class TranscriptHTMLBuilder {
367
391
  <\/style>
368
392
  </head>
369
393
  `;
370
- return htmlData;
371
- }
372
- createBodyElement() {
373
- const htmlData = `
394
+ return htmlData;
395
+ }
396
+ }, {
397
+ key: "createBodyElement",
398
+ value: function createBodyElement() {
399
+ const htmlData = `
374
400
  <body>
375
401
  <script>
376
402
  if (!navigator.onLine) {
@@ -651,18 +677,22 @@ class TranscriptHTMLBuilder {
651
677
  <\/script>
652
678
  </body>
653
679
  `;
654
- return htmlData;
655
- }
656
- createHTML() {
657
- const htmlData = `
680
+ return htmlData;
681
+ }
682
+ }, {
683
+ key: "createHTML",
684
+ value: function createHTML() {
685
+ const htmlData = `
658
686
  <html>
659
687
  ${this.createHeadElement()}
660
688
  ${this.createBodyElement()}
661
689
  </html>
662
690
  `;
663
- return htmlData;
664
- }
665
- }
691
+ return htmlData;
692
+ }
693
+ }]);
694
+ return TranscriptHTMLBuilder;
695
+ }();
666
696
  const createChatTranscript = async function (transcript, facadeChatSDK) {
667
697
  let renderAttachments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
668
698
  let transcriptOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
@@ -26,7 +26,6 @@ const createOnNewAdapterActivityHandler = (chatId, userId) => {
26
26
  const userSendMessageStrategy = activity => {
27
27
  var _TelemetryManager$Int;
28
28
  const payload = (0, _util.buildMessagePayload)(activity, userId);
29
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
29
  payload.messageType = _Constants2.Constants.userMessageTag;
31
30
  const newMessageSentEvent = {
32
31
  eventName: _TelemetryConstants.BroadcastEvent.NewMessageSent,
@@ -36,16 +35,20 @@ const createOnNewAdapterActivityHandler = (chatId, userId) => {
36
35
  if (!(0, _util.isHistoryMessage)(activity, startTime)) {
37
36
  firstResponseLatencyTracker.startClock(payload);
38
37
  }
39
- _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
38
+ _TelemetryHelper.TelemetryHelper.logActionEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
40
39
  Event: _TelemetryConstants.TelemetryEvent.MessageSent,
41
40
  Description: "New message sent"
42
41
  });
43
42
  };
44
43
  const systemMessageStrategy = activity => {
45
44
  const payload = (0, _util.buildMessagePayload)(activity, userId);
46
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
45
  payload.messageType = _Constants2.Constants.systemMessageTag;
48
- _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
46
+ if ((0, _util.isHistoryMessage)(activity, startTime)) {
47
+ var _TelemetryManager$Int2;
48
+ historyMessageStrategy((0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$Int2 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.conversationId));
49
+ return;
50
+ }
51
+ _TelemetryHelper.TelemetryHelper.logActionEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
49
52
  Event: _TelemetryConstants.TelemetryEvent.SystemMessageReceived,
50
53
  Description: "System message received"
51
54
  });
@@ -59,7 +62,7 @@ const createOnNewAdapterActivityHandler = (chatId, userId) => {
59
62
  if (!isHistoryMessageReceivedEventRaised) {
60
63
  // this is needed for reload scenarios, it helps to identify the last message received before the reload
61
64
  isHistoryMessageReceivedEventRaised = true;
62
- _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
65
+ _TelemetryHelper.TelemetryHelper.logActionEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
63
66
  Event: _TelemetryConstants.TelemetryEvent.RehydrateMessageReceived,
64
67
  Description: "History message received",
65
68
  CustomProperties: payload
@@ -80,23 +83,23 @@ const createOnNewAdapterActivityHandler = (chatId, userId) => {
80
83
  return true;
81
84
  };
82
85
  const receivedMessageStrategy = activity => {
83
- var _TelemetryManager$Int3;
86
+ var _TelemetryManager$Int4;
84
87
  if (!isValidMessage(activity)) return;
85
88
  const isHistoryMessageReceived = (0, _util.isHistoryMessage)(activity, startTime);
86
89
  const payload = (0, _util.buildMessagePayload)(activity, userId);
87
90
  payload.messageType = _Constants2.Constants.userMessageTag;
88
91
  if (isHistoryMessageReceived) {
89
- var _TelemetryManager$Int2;
90
- historyMessageStrategy((0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$Int2 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.conversationId));
92
+ var _TelemetryManager$Int3;
93
+ historyMessageStrategy((0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$Int3 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int3 === void 0 ? void 0 : _TelemetryManager$Int3.conversationId));
91
94
  return;
92
95
  }
93
96
  firstResponseLatencyTracker.stopClock(payload);
94
97
  const newMessageReceivedEvent = {
95
98
  eventName: _TelemetryConstants.BroadcastEvent.NewMessageReceived,
96
- payload: (0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$Int3 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int3 === void 0 ? void 0 : _TelemetryManager$Int3.conversationId)
99
+ payload: (0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$Int4 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int4 === void 0 ? void 0 : _TelemetryManager$Int4.conversationId)
97
100
  };
98
101
  _omnichannelChatComponents.BroadcastService.postMessage(newMessageReceivedEvent);
99
- _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
102
+ _TelemetryHelper.TelemetryHelper.logActionEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
100
103
  Event: _TelemetryConstants.TelemetryEvent.MessageReceived,
101
104
  Description: "New message received",
102
105
  CustomProperties: payload