@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
@@ -59,8 +59,9 @@ export const LiveChatWidgetStateful = props => {
59
59
  var _props$webChatContain, _props$styleProps, _props$webChatContain2, _props$webChatContain3, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain7, _state$appStates14, _props$webChatContain9, _props$webChatContain10, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _props$webChatContain11, _props$webChatContain12, _props$webChatContain13, _props$webChatContain14, _props$webChatContain15, _props$webChatContain16, _props$webChatContain17, _props$webChatContain18, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
60
60
  useEffect(() => {
61
61
  uiTimer = createTimer();
62
- TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
63
- Event: TelemetryEvent.UXLivechatwidgetStart
62
+ TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
63
+ Event: TelemetryEvent.UXLiveChatWidgetStart,
64
+ Description: "Live chat widget loading started."
64
65
  });
65
66
  }, []);
66
67
  const [state, dispatch] = useChatContextStore();
@@ -273,9 +274,8 @@ export const LiveChatWidgetStateful = props => {
273
274
  useEffect(() => {
274
275
  var _state$appStates6;
275
276
  if ((state === null || state === void 0 ? void 0 : (_state$appStates6 = state.appStates) === null || _state$appStates6 === void 0 ? void 0 : _state$appStates6.hideStartChatButton) === true) {
276
- var _props$chatConfig3, _props$chatConfig3$Li, _props$chatConfig4, _props$chatConfig4$Li;
277
277
  //handle OOH pane
278
- if (typeof (props === null || props === void 0 ? void 0 : (_props$chatConfig3 = props.chatConfig) === null || _props$chatConfig3 === void 0 ? void 0 : (_props$chatConfig3$Li = _props$chatConfig3.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig3$Li === void 0 ? void 0 : _props$chatConfig3$Li.OutOfOperatingHours) === "string" && (props === null || props === void 0 ? void 0 : (_props$chatConfig4 = props.chatConfig) === null || _props$chatConfig4 === void 0 ? void 0 : (_props$chatConfig4$Li = _props$chatConfig4.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig4$Li === void 0 ? void 0 : _props$chatConfig4$Li.OutOfOperatingHours.toLowerCase()) === "true") {
278
+ if (state.appStates.outsideOperatingHours === true) {
279
279
  dispatch({
280
280
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
281
281
  payload: ConversationState.OutOfOffice
@@ -311,7 +311,7 @@ export const LiveChatWidgetStateful = props => {
311
311
  });
312
312
  });
313
313
  BroadcastService.getMessageByEventName(BroadcastEvent.StartProactiveChat).subscribe(msg => {
314
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
314
+ TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
315
315
  Event: TelemetryEvent.StartProactiveChatEventReceived,
316
316
  Description: "Start proactive chat event received."
317
317
  });
@@ -409,10 +409,10 @@ export const LiveChatWidgetStateful = props => {
409
409
 
410
410
  // Start chat from SDK Event
411
411
  BroadcastService.getMessageByEventName(BroadcastEvent.StartChat).subscribe(msg => {
412
- var _props$chatConfig5, _props$chatConfig5$Li, _props$chatConfig6, _props$chatConfig6$Li, _msg$payload5, _msg$payload6, _msg$payload7, _msg$payload9, _inMemoryState$appSta2, _inMemoryState$appSta3;
412
+ var _msg$payload5, _msg$payload6, _msg$payload7, _msg$payload9, _inMemoryState$appSta2, _inMemoryState$appSta3, _inMemoryState$appSta4;
413
413
  // If chat is out of operating hours chat widget sets the conversation state to OutOfOffice.
414
- if (typeof (props === null || props === void 0 ? void 0 : (_props$chatConfig5 = props.chatConfig) === null || _props$chatConfig5 === void 0 ? void 0 : (_props$chatConfig5$Li = _props$chatConfig5.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig5$Li === void 0 ? void 0 : _props$chatConfig5$Li.OutOfOperatingHours) === "string" && (props === null || props === void 0 ? void 0 : (_props$chatConfig6 = props.chatConfig) === null || _props$chatConfig6 === void 0 ? void 0 : (_props$chatConfig6$Li = _props$chatConfig6.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig6$Li === void 0 ? void 0 : _props$chatConfig6$Li.OutOfOperatingHours.toLowerCase()) === "true") {
415
- (state === null || state === void 0 ? void 0 : state.appStates.isMinimized) && dispatch({
414
+ if (state.appStates.outsideOperatingHours === true) {
415
+ dispatch({
416
416
  type: LiveChatWidgetActionType.SET_MINIMIZED,
417
417
  payload: false
418
418
  });
@@ -428,7 +428,7 @@ export const LiveChatWidgetStateful = props => {
428
428
  }
429
429
  if (msg !== null && msg !== void 0 && (_msg$payload7 = msg.payload) !== null && _msg$payload7 !== void 0 && _msg$payload7.customContext) {
430
430
  var _msg$payload8;
431
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
431
+ TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
432
432
  Event: TelemetryEvent.CustomContextReceived,
433
433
  Description: "CustomContext received through startChat event."
434
434
  });
@@ -437,8 +437,8 @@ export const LiveChatWidgetStateful = props => {
437
437
  payload: msg === null || msg === void 0 ? void 0 : (_msg$payload8 = msg.payload) === null || _msg$payload8 === void 0 ? void 0 : _msg$payload8.customContext
438
438
  });
439
439
  }
440
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
441
- Event: TelemetryEvent.StartChatEventRecevied,
440
+ TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
441
+ Event: TelemetryEvent.StartChatEventReceived,
442
442
  Description: "Start chat event received."
443
443
  });
444
444
  const inMemoryState = executeReducer(state, {
@@ -446,13 +446,17 @@ export const LiveChatWidgetStateful = props => {
446
446
  payload: null
447
447
  });
448
448
  inMemoryState.domainStates.customContext = msg === null || msg === void 0 ? void 0 : (_msg$payload9 = msg.payload) === null || _msg$payload9 === void 0 ? void 0 : _msg$payload9.customContext;
449
-
450
449
  /*
451
450
  * If the conversation is in closed state then we start a new chat,
452
451
  * else if the conversation is in active state then we maximize the chat
453
452
  * If the conversation is in inactive or postchat state then we maximize the chat.
454
453
  *
455
454
  * To start a new chat, it needs to be called via the close button or close chat via SDK.
455
+ *
456
+ * NOTE : Transition from OOH to business hours will follow this path, since during intialization conversation
457
+ * state is being set to closed.
458
+ *
459
+ * Maximization has been added as part of the initialization chat, since it wont go further than this block.
456
460
  **/
457
461
  if (((_inMemoryState$appSta2 = inMemoryState.appStates) === null || _inMemoryState$appSta2 === void 0 ? void 0 : _inMemoryState$appSta2.conversationState) === ConversationState.Closed) {
458
462
  BroadcastService.postMessage({
@@ -463,7 +467,7 @@ export const LiveChatWidgetStateful = props => {
463
467
  }
464
468
 
465
469
  // If minimized, maximize the chat
466
- if ((inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta3 = inMemoryState.appStates) === null || _inMemoryState$appSta3 === void 0 ? void 0 : _inMemoryState$appSta3.isMinimized) === true) {
470
+ if ((inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta3 = inMemoryState.appStates) === null || _inMemoryState$appSta3 === void 0 ? void 0 : _inMemoryState$appSta3.isMinimized) === true || (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta4 = inMemoryState.appStates) === null || _inMemoryState$appSta4 === void 0 ? void 0 : _inMemoryState$appSta4.isMinimized) === undefined) {
467
471
  var _inMemoryState$domain, _inMemoryState$domain2, _inMemoryState$domain3, _inMemoryState$domain4;
468
472
  dispatch({
469
473
  type: LiveChatWidgetActionType.SET_MINIMIZED,
@@ -482,7 +486,7 @@ export const LiveChatWidgetStateful = props => {
482
486
 
483
487
  // End chat
484
488
  BroadcastService.getMessageByEventName(BroadcastEvent.InitiateEndChat).subscribe(async () => {
485
- TelemetryHelper.logSDKEvent(LogLevel.INFO, {
489
+ TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
486
490
  Event: TelemetryEvent.EndChatEventReceived,
487
491
  Description: "Received InitiateEndChat BroadcastEvent."
488
492
  });
@@ -591,12 +595,12 @@ export const LiveChatWidgetStateful = props => {
591
595
  disablePolling: true
592
596
  });
593
597
  facadeChatSDK === null || facadeChatSDK === void 0 ? void 0 : facadeChatSDK.onAgentEndSession(event => {
594
- var _inMemoryState$appSta4;
598
+ var _inMemoryState$appSta5;
595
599
  const inMemoryState = executeReducer(state, {
596
600
  type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
597
601
  payload: null
598
602
  });
599
- if ("participantsRemoved" in event && (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta4 = inMemoryState.appStates) === null || _inMemoryState$appSta4 === void 0 ? void 0 : _inMemoryState$appSta4.conversationState) === ConversationState.Active) {
603
+ if ("participantsRemoved" in event && (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta5 = inMemoryState.appStates) === null || _inMemoryState$appSta5 === void 0 ? void 0 : _inMemoryState$appSta5.conversationState) === ConversationState.Active) {
600
604
  setWebChatStyles(styles => {
601
605
  return {
602
606
  ...styles,
@@ -739,13 +743,13 @@ export const LiveChatWidgetStateful = props => {
739
743
 
740
744
  // Handle Chat disconnect cases
741
745
  useEffect(() => {
742
- var _inMemoryState$appSta5;
746
+ var _inMemoryState$appSta6;
743
747
  const inMemoryState = executeReducer(state, {
744
748
  type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
745
749
  payload: null
746
750
  });
747
751
  handleChatDisconnect(props, inMemoryState, setWebChatStyles);
748
- const chatDisconnectState = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta5 = inMemoryState.appStates) === null || _inMemoryState$appSta5 === void 0 ? void 0 : _inMemoryState$appSta5.chatDisconnectEventReceived;
752
+ const chatDisconnectState = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta6 = inMemoryState.appStates) === null || _inMemoryState$appSta6 === void 0 ? void 0 : _inMemoryState$appSta6.chatDisconnectEventReceived;
749
753
  if (chatDisconnectState && adapter) {
750
754
  try {
751
755
  adapter.end();
@@ -768,8 +772,9 @@ export const LiveChatWidgetStateful = props => {
768
772
  });
769
773
  }, [(_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : _props$webChatContain9.renderingMiddlewareProps]);
770
774
  useEffect(() => {
771
- TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
772
- Event: TelemetryEvent.UXLivechatwidgetCompleted,
775
+ TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
776
+ Event: TelemetryEvent.UXLiveChatWidgetCompleted,
777
+ Description: "Live chat widget loading completed.",
773
778
  ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
774
779
  });
775
780
  }, []);
@@ -11,8 +11,9 @@ export const OutOfOfficeHoursPaneStateful = props => {
11
11
  var _props$styleProps;
12
12
  useEffect(() => {
13
13
  uiTimer = createTimer();
14
- TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
15
- Event: TelemetryEvent.UXOOHPaneStart
14
+ TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
15
+ Event: TelemetryEvent.UXOutOfOfficeHoursPaneStart,
16
+ Description: "Out of office hours pane loading started."
16
17
  });
17
18
  }, []);
18
19
  const [state] = useChatContextStore();
@@ -38,8 +39,9 @@ export const OutOfOfficeHoursPaneStateful = props => {
38
39
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
39
40
  Event: TelemetryEvent.OutOfOfficePaneLoaded
40
41
  });
41
- TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
42
- Event: TelemetryEvent.UXOOHPaneCompleted,
42
+ TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
43
+ Event: TelemetryEvent.UXOutOfOfficeHoursPaneCompleted,
44
+ Description: "Out of office hours pane loading completed.",
43
45
  ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
44
46
  });
45
47
  }, []);
@@ -84,12 +84,17 @@ export const PostChatSurveyPaneStateful = props => {
84
84
  Event: TelemetryEvent.CustomerVoiceResponsePageLoaded
85
85
  });
86
86
  } else if (data === CustomerVoiceEvents.FormResponseSubmitted) {
87
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
88
- Event: TelemetryEvent.CustomerVoiceFormResponseSubmitted
87
+ TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
88
+ Event: TelemetryEvent.CustomerVoiceFormResponseSubmitted,
89
+ Description: "Customer Voice form response submitted."
89
90
  });
90
91
  } else if (data === CustomerVoiceEvents.FormResponseError) {
91
- TelemetryHelper.logActionEvent(LogLevel.ERROR, {
92
- Event: TelemetryEvent.CustomerVoiceFormResponseError
92
+ TelemetryHelper.logActionEventToAllTelemetry(LogLevel.ERROR, {
93
+ Event: TelemetryEvent.CustomerVoiceFormResponseError,
94
+ Description: "Customer Voice form response error.",
95
+ ExceptionDetails: {
96
+ message: "Customer Voice form response error."
97
+ }
93
98
  });
94
99
  }
95
100
  });
@@ -17,8 +17,9 @@ export const PreChatSurveyPaneStateful = props => {
17
17
  var _surveyProps$stylePro, _props$surveyProps, _props$surveyProps$co;
18
18
  useEffect(() => {
19
19
  uiTimer = createTimer();
20
- TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
21
- Event: TelemetryEvent.UXPrechatPaneStart
20
+ TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
21
+ Event: TelemetryEvent.UXPrechatPaneStart,
22
+ Description: "Prechat survey pane loading started."
22
23
  });
23
24
  }, []);
24
25
 
@@ -67,8 +68,9 @@ export const PreChatSurveyPaneStateful = props => {
67
68
  payload: getAdaptiveCardPayload(state.domainStates.preChatSurveyResponse, requiredFieldMissingMessage),
68
69
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
70
  onSubmit: async values => {
70
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
71
- Event: TelemetryEvent.PrechatSubmitted
71
+ TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
72
+ Event: TelemetryEvent.PrechatSubmitted,
73
+ Description: "Prechat survey submitted."
72
74
  });
73
75
  dispatch({
74
76
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
@@ -139,9 +141,10 @@ export const PreChatSurveyPaneStateful = props => {
139
141
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
140
142
  Event: TelemetryEvent.PrechatSurveyLoaded
141
143
  });
142
- TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
144
+ TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
143
145
  Event: TelemetryEvent.UXPrechatPaneCompleted,
144
- ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
146
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed,
147
+ Description: "Prechat survey pane loading completed."
145
148
  });
146
149
  }, []);
147
150
 
@@ -16,8 +16,9 @@ export const ProactiveChatPaneStateful = props => {
16
16
  var _proactiveChatProps$c;
17
17
  useEffect(() => {
18
18
  uiTimer = createTimer();
19
- TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
20
- Event: TelemetryEvent.UXProactiveChatPaneStart
19
+ TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
20
+ Event: TelemetryEvent.UXProactiveChatPaneStart,
21
+ Description: "Proactive chat pane loading started."
21
22
  });
22
23
  }, []);
23
24
  const [state, dispatch] = useChatContextStore();
@@ -42,7 +43,7 @@ export const ProactiveChatPaneStateful = props => {
42
43
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
43
44
  payload: ConversationState.Closed
44
45
  });
45
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
46
+ TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
46
47
  Event: TelemetryEvent.ProactiveChatRejected,
47
48
  ElapsedTimeInMilliseconds: TelemetryTimers.LcwLoadToChatButtonTimer.milliSecondsElapsed,
48
49
  Description: "Proactive chat invitation timed out."
@@ -121,9 +122,10 @@ export const ProactiveChatPaneStateful = props => {
121
122
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
122
123
  Event: TelemetryEvent.ProactiveChatPaneLoaded
123
124
  });
124
- TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
125
- Event: TelemetryEvent.UXProactiveChatCompleted,
126
- ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
125
+ TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
126
+ Event: TelemetryEvent.UXProactiveChatPaneCompleted,
127
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed,
128
+ Description: "Proactive chat pane loading completed."
127
129
  });
128
130
  return () => {
129
131
  clearTimeout(timeoutEvent);
@@ -241,9 +241,15 @@ export const WebChatContainerStateful = props => {
241
241
  .webchat__stacked-layout_container>div {
242
242
  background: ${(props === null || props === void 0 ? void 0 : (_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : (_props$webChatContain10 = _props$webChatContain9.containerStyles) === null || _props$webChatContain10 === void 0 ? void 0 : _props$webChatContain10.background) ?? ""}
243
243
  }
244
- .webchat__toaster__expandText {
244
+ .webchat__toast_text {
245
245
  display: flex;
246
+
246
247
  }
248
+ .webchat__toaster {
249
+ overflow-y: unset;
250
+ }
251
+
252
+
247
253
  `), /*#__PURE__*/React.createElement(Stack, {
248
254
  styles: containerStyles,
249
255
  className: "webchat__stacked-layout_container"
@@ -1,3 +1,15 @@
1
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2
+ 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); } }
3
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ 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); }
6
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
7
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
8
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
+ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
10
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
11
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1
13
  import "rxjs/add/operator/share";
2
14
  import "rxjs/add/observable/of";
3
15
  import { Observable } from "rxjs/Observable";
@@ -6,74 +18,85 @@ import { customerUser, postBotMessageActivity, postBotAttachmentActivity, postBo
6
18
  import { createHeroCardAttachment, createJpgFileAttachment, createSigninCardAttachment, createThumbnailCardAttachment } from "./utils/attachmentActivityUtils";
7
19
  import MockBotCommand from "./MockBotCommand";
8
20
  import MockBotCardCommandType from "./MockBotCardCommandType";
9
- export class DemoChatAdapter extends MockAdapter {
10
- constructor() {
11
- super();
21
+ export let DemoChatAdapter = /*#__PURE__*/function (_MockAdapter) {
22
+ _inherits(DemoChatAdapter, _MockAdapter);
23
+ var _super = _createSuper(DemoChatAdapter);
24
+ function DemoChatAdapter() {
25
+ var _this;
26
+ _classCallCheck(this, DemoChatAdapter);
27
+ _this = _super.call(this);
12
28
  setTimeout(() => {
13
- postSystemMessageActivity(this.activityObserver, "You're currently using a demo.", 0);
14
- postBotMessageActivity(this.activityObserver, "Type `/help` to learn more", undefined, 0); // send init message from bot
29
+ postSystemMessageActivity(_this.activityObserver, "You're currently using a demo.", 0);
30
+ postBotMessageActivity(_this.activityObserver, "Type `/help` to learn more", undefined, 0); // send init message from bot
15
31
  }, 1000);
32
+ return _this;
16
33
  }
17
- postBotCommandsActivity() {
18
- let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1000;
19
- postBotAttachmentActivity(this.activityObserver, [{
20
- contentType: "application/vnd.microsoft.card.thumbnail",
21
- content: {
22
- buttons: [{
23
- title: "Send system message",
24
- type: "imBack",
25
- value: "send system message"
26
- }, {
27
- title: "Send typing",
28
- type: "imBack",
29
- value: "send typing"
30
- }, {
31
- title: "Send bot message",
32
- type: "imBack",
33
- value: "send bot message"
34
- }],
35
- title: "Commands"
36
- }
37
- }], delay);
38
- }
39
- postActivity(activity) {
40
- if (activity) {
41
- postEchoActivity(this.activityObserver, activity, customerUser);
42
- if (activity.text) {
43
- switch (true) {
44
- case activity.text === MockBotCommand.Help:
45
- this.postBotCommandsActivity();
46
- break;
47
- case activity.text === MockBotCommand.SendSystemMessage:
48
- postSystemMessageActivity(this.activityObserver, "Contoso has joined the chat.");
49
- break;
50
- case activity.text === MockBotCommand.SendTyping:
51
- postBotTypingActivity(this.activityObserver);
52
- break;
53
- case activity.text === MockBotCommand.SendAttachment:
54
- postBotAttachmentActivity(this.activityObserver, [createJpgFileAttachment()]);
55
- break;
56
- case activity.text === MockBotCommand.SendBotMessage:
57
- postBotMessageActivity(this.activityObserver, "Hi, how can I help you?");
58
- break;
59
- case activity.text === `${MockBotCommand.Card} ${MockBotCardCommandType.Signin}`:
60
- postBotAttachmentActivity(this.activityObserver, [createSigninCardAttachment()]);
61
- break;
62
- case activity.text === `${MockBotCommand.Card} ${MockBotCardCommandType.Hero}`:
63
- postBotAttachmentActivity(this.activityObserver, [createHeroCardAttachment()]);
64
- break;
65
- case activity.text === `${MockBotCommand.Card} ${MockBotCardCommandType.Thumbnail}`:
66
- postBotAttachmentActivity(this.activityObserver, [createThumbnailCardAttachment()]);
67
- break;
68
- case activity.text.startsWith(`${MockBotCommand.Bot} `):
69
- postBotMessageActivity(this.activityObserver, activity.text.substring(5));
70
- break;
71
- case activity.text.startsWith(`${MockBotCommand.System} `):
72
- postSystemMessageActivity(this.activityObserver, activity.text.substring(8));
73
- break;
34
+ _createClass(DemoChatAdapter, [{
35
+ key: "postBotCommandsActivity",
36
+ value: function postBotCommandsActivity() {
37
+ let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1000;
38
+ postBotAttachmentActivity(this.activityObserver, [{
39
+ contentType: "application/vnd.microsoft.card.thumbnail",
40
+ content: {
41
+ buttons: [{
42
+ title: "Send system message",
43
+ type: "imBack",
44
+ value: "send system message"
45
+ }, {
46
+ title: "Send typing",
47
+ type: "imBack",
48
+ value: "send typing"
49
+ }, {
50
+ title: "Send bot message",
51
+ type: "imBack",
52
+ value: "send bot message"
53
+ }],
54
+ title: "Commands"
55
+ }
56
+ }], delay);
57
+ }
58
+ }, {
59
+ key: "postActivity",
60
+ value: function postActivity(activity) {
61
+ if (activity) {
62
+ postEchoActivity(this.activityObserver, activity, customerUser);
63
+ if (activity.text) {
64
+ switch (true) {
65
+ case activity.text === MockBotCommand.Help:
66
+ this.postBotCommandsActivity();
67
+ break;
68
+ case activity.text === MockBotCommand.SendSystemMessage:
69
+ postSystemMessageActivity(this.activityObserver, "Contoso has joined the chat.");
70
+ break;
71
+ case activity.text === MockBotCommand.SendTyping:
72
+ postBotTypingActivity(this.activityObserver);
73
+ break;
74
+ case activity.text === MockBotCommand.SendAttachment:
75
+ postBotAttachmentActivity(this.activityObserver, [createJpgFileAttachment()]);
76
+ break;
77
+ case activity.text === MockBotCommand.SendBotMessage:
78
+ postBotMessageActivity(this.activityObserver, "Hi, how can I help you?");
79
+ break;
80
+ case activity.text === `${MockBotCommand.Card} ${MockBotCardCommandType.Signin}`:
81
+ postBotAttachmentActivity(this.activityObserver, [createSigninCardAttachment()]);
82
+ break;
83
+ case activity.text === `${MockBotCommand.Card} ${MockBotCardCommandType.Hero}`:
84
+ postBotAttachmentActivity(this.activityObserver, [createHeroCardAttachment()]);
85
+ break;
86
+ case activity.text === `${MockBotCommand.Card} ${MockBotCardCommandType.Thumbnail}`:
87
+ postBotAttachmentActivity(this.activityObserver, [createThumbnailCardAttachment()]);
88
+ break;
89
+ case activity.text.startsWith(`${MockBotCommand.Bot} `):
90
+ postBotMessageActivity(this.activityObserver, activity.text.substring(5));
91
+ break;
92
+ case activity.text.startsWith(`${MockBotCommand.System} `):
93
+ postSystemMessageActivity(this.activityObserver, activity.text.substring(8));
94
+ break;
95
+ }
74
96
  }
75
97
  }
98
+ return Observable.of(activity.id || "");
76
99
  }
77
- return Observable.of(activity.id || "");
78
- }
79
- }
100
+ }]);
101
+ return DemoChatAdapter;
102
+ }(MockAdapter);
@@ -1,10 +1,29 @@
1
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2
+ 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); } }
3
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ 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); }
6
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
7
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
8
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
+ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
10
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
11
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1
13
  import { DemoChatAdapter } from "./DemoChatAdapter";
2
14
  import { MockChatSDK } from "./mockchatsdk";
3
- export class DemoChatSDK extends MockChatSDK {
4
- constructor() {
5
- super();
15
+ export let DemoChatSDK = /*#__PURE__*/function (_MockChatSDK) {
16
+ _inherits(DemoChatSDK, _MockChatSDK);
17
+ var _super = _createSuper(DemoChatSDK);
18
+ function DemoChatSDK() {
19
+ _classCallCheck(this, DemoChatSDK);
20
+ return _super.call(this);
6
21
  }
7
- createChatAdapter() {
8
- return new DemoChatAdapter();
9
- }
10
- }
22
+ _createClass(DemoChatSDK, [{
23
+ key: "createChatAdapter",
24
+ value: function createChatAdapter() {
25
+ return new DemoChatAdapter();
26
+ }
27
+ }]);
28
+ return DemoChatSDK;
29
+ }(MockChatSDK);
@@ -1,33 +1,56 @@
1
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2
+ 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); } }
3
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ 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); }
6
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
7
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
8
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
+ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
10
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
11
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1
13
  import { Observable } from "rxjs/Observable";
2
14
  import MockAdapter from "./mockadapter";
3
15
  import { customerUser, postBotMessageActivity, postEchoActivity, postSystemMessageActivity } from "./utils/chatAdapterUtils";
4
- export class DesignerChatAdapter extends MockAdapter {
5
- constructor() {
6
- super();
16
+ export let DesignerChatAdapter = /*#__PURE__*/function (_MockAdapter) {
17
+ _inherits(DesignerChatAdapter, _MockAdapter);
18
+ var _super = _createSuper(DesignerChatAdapter);
19
+ function DesignerChatAdapter() {
20
+ var _this;
21
+ _classCallCheck(this, DesignerChatAdapter);
22
+ _this = _super.call(this);
7
23
  setTimeout(() => {
8
- postBotMessageActivity(this.activityObserver, "Thank you for contacting us! How can I help you today?", undefined, 0);
9
- this.postUserActivity("I need to change my address.", 0);
10
- postBotMessageActivity(this.activityObserver, "Okay, let me connect you with a live agent.", undefined, 100);
11
- postSystemMessageActivity(this.activityObserver, "John has joined the chat", 100);
12
- postBotMessageActivity(this.activityObserver, "I'd be happy to help you update your account.", undefined, 100);
24
+ postBotMessageActivity(_this.activityObserver, "Thank you for contacting us! How can I help you today?", undefined, 0);
25
+ _this.postUserActivity("I need to change my address.", 0);
26
+ postBotMessageActivity(_this.activityObserver, "Okay, let me connect you with a live agent.", undefined, 100);
27
+ postSystemMessageActivity(_this.activityObserver, "John has joined the chat", 100);
28
+ postBotMessageActivity(_this.activityObserver, "I'd be happy to help you update your account.", undefined, 100);
13
29
  }, 1000);
30
+ return _this;
14
31
  }
15
- postUserActivity(text) {
16
- let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
17
- setTimeout(() => {
18
- postEchoActivity(this.activityObserver, {
19
- text,
20
- from: {
21
- ...customerUser
22
- },
23
- type: "message"
24
- }, customerUser, 0);
25
- }, delay);
26
- }
27
- postActivity(activity) {
28
- if (activity) {
29
- postEchoActivity(this.activityObserver, activity, customerUser);
32
+ _createClass(DesignerChatAdapter, [{
33
+ key: "postUserActivity",
34
+ value: function postUserActivity(text) {
35
+ let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
36
+ setTimeout(() => {
37
+ postEchoActivity(this.activityObserver, {
38
+ text,
39
+ from: {
40
+ ...customerUser
41
+ },
42
+ type: "message"
43
+ }, customerUser, 0);
44
+ }, delay);
30
45
  }
31
- return Observable.of(activity.id || "");
32
- }
33
- }
46
+ }, {
47
+ key: "postActivity",
48
+ value: function postActivity(activity) {
49
+ if (activity) {
50
+ postEchoActivity(this.activityObserver, activity, customerUser);
51
+ }
52
+ return Observable.of(activity.id || "");
53
+ }
54
+ }]);
55
+ return DesignerChatAdapter;
56
+ }(MockAdapter);