@microsoft/omnichannel-chat-widget 0.1.0-main.a27ec4b → 0.1.0-main.a2e5071

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 (264) hide show
  1. package/lib/cjs/common/Constants.js +17 -168
  2. package/lib/cjs/common/KeyCodes.js +0 -3
  3. package/lib/cjs/common/contextDataStore/DataStoreManager.js +0 -4
  4. package/lib/cjs/common/storage/default/defaultCacheManager.js +0 -10
  5. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +4 -16
  6. package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +2 -10
  7. package/lib/cjs/common/telemetry/TelemetryConstants.js +22 -23
  8. package/lib/cjs/common/telemetry/TelemetryHelper.js +16 -57
  9. package/lib/cjs/common/telemetry/TelemetryManager.js +0 -31
  10. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +0 -2
  11. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +30 -36
  12. package/lib/cjs/common/telemetry/loggers/consoleLogger.js +0 -9
  13. package/lib/cjs/common/utils.js +18 -105
  14. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +8 -46
  15. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +2 -24
  16. package/lib/cjs/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
  17. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -32
  18. package/lib/cjs/components/dimlayer/DimLayer.js +0 -4
  19. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +8 -36
  20. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -8
  21. package/lib/cjs/components/footerstateful/FooterStateful.js +10 -34
  22. package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +0 -6
  23. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +7 -45
  24. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -8
  25. package/lib/cjs/components/headerstateful/HeaderStateful.js +12 -27
  26. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +2 -14
  27. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +2 -9
  28. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +0 -5
  29. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +4 -11
  30. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +11 -19
  31. package/lib/cjs/components/livechatwidget/common/Deferred.js +3 -10
  32. package/lib/cjs/components/livechatwidget/common/authHelper.js +4 -19
  33. package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -13
  34. package/lib/cjs/components/livechatwidget/common/createFooter.js +0 -10
  35. package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +2 -14
  36. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +16 -24
  37. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +14 -0
  38. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +41 -35
  39. package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +0 -3
  40. package/lib/cjs/components/livechatwidget/common/endChat.js +30 -33
  41. package/lib/cjs/components/livechatwidget/common/getGeneralStylesForButton.js +0 -6
  42. package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +7 -16
  43. package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -8
  44. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +16 -54
  45. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +80 -150
  46. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +4 -17
  47. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +2 -11
  48. package/lib/cjs/components/livechatwidget/common/shareObservable.js +4 -8
  49. package/lib/cjs/components/livechatwidget/common/startChat.js +126 -109
  50. package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +0 -8
  51. package/lib/cjs/components/livechatwidget/common/updateSessionDataForTelemetry.js +2 -11
  52. package/lib/cjs/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
  53. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +201 -256
  54. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +4 -17
  55. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +4 -17
  56. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +4 -17
  57. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +32 -23
  58. package/lib/cjs/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
  59. package/lib/cjs/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +13 -0
  60. package/lib/cjs/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
  61. package/lib/cjs/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
  62. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -37
  63. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +2 -32
  64. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +6 -24
  65. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +19 -38
  66. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +0 -7
  67. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -6
  68. package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +9 -26
  69. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +2 -17
  70. package/lib/cjs/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -24
  71. package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +3 -15
  72. package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -8
  73. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +0 -4
  74. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +0 -4
  75. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
  76. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
  77. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
  78. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
  79. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
  80. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
  81. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
  82. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
  83. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +0 -7
  84. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -5
  85. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +17 -41
  86. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +8 -19
  87. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +23 -60
  88. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +7 -15
  89. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +2 -13
  90. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +0 -16
  91. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +10 -0
  92. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -3
  93. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -3
  94. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +10 -0
  95. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -9
  96. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +2 -30
  97. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +2 -12
  98. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +6 -28
  99. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
  100. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +13 -30
  101. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +3 -9
  102. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -34
  103. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +1 -10
  104. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +1 -12
  105. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +17 -19
  106. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +1 -9
  107. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -9
  108. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +13 -34
  109. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +1 -10
  110. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +7 -11
  111. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +5 -14
  112. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -21
  113. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +0 -12
  114. package/lib/cjs/contexts/ChatAdapterStore.js +0 -2
  115. package/lib/cjs/contexts/ChatContextStore.js +0 -2
  116. package/lib/cjs/contexts/ChatSDKStore.js +0 -2
  117. package/lib/cjs/contexts/common/ConversationState.js +0 -1
  118. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +3 -3
  119. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -11
  120. package/lib/cjs/contexts/createReducer.js +146 -108
  121. package/lib/cjs/controller/componentController.js +2 -31
  122. package/lib/cjs/hooks/useChatAdapterStore.js +0 -6
  123. package/lib/cjs/hooks/useChatContextStore.js +0 -6
  124. package/lib/cjs/hooks/useChatSDKStore.js +0 -6
  125. package/lib/cjs/index.js +0 -5
  126. package/lib/cjs/plugins/newMessageEventHandler.js +15 -36
  127. package/lib/esm/common/Constants.js +14 -155
  128. package/lib/esm/common/KeyCodes.js +0 -2
  129. package/lib/esm/common/contextDataStore/DataStoreManager.js +0 -2
  130. package/lib/esm/common/storage/default/defaultCacheManager.js +0 -3
  131. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +4 -11
  132. package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +2 -3
  133. package/lib/esm/common/telemetry/TelemetryConstants.js +26 -20
  134. package/lib/esm/common/telemetry/TelemetryHelper.js +16 -45
  135. package/lib/esm/common/telemetry/TelemetryManager.js +0 -18
  136. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +28 -24
  137. package/lib/esm/common/telemetry/loggers/consoleLogger.js +0 -5
  138. package/lib/esm/common/utils.js +18 -53
  139. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +8 -17
  140. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +2 -7
  141. package/lib/esm/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
  142. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +10 -13
  143. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +8 -15
  144. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -6
  145. package/lib/esm/components/footerstateful/FooterStateful.js +12 -15
  146. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +7 -35
  147. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -6
  148. package/lib/esm/components/headerstateful/HeaderStateful.js +12 -12
  149. package/lib/esm/components/livechatwidget/LiveChatWidget.js +2 -2
  150. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +2 -6
  151. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +0 -3
  152. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +4 -8
  153. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +11 -15
  154. package/lib/esm/components/livechatwidget/common/Deferred.js +3 -8
  155. package/lib/esm/components/livechatwidget/common/authHelper.js +4 -12
  156. package/lib/esm/components/livechatwidget/common/createAdapter.js +4 -6
  157. package/lib/esm/components/livechatwidget/common/createFooter.js +0 -1
  158. package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +2 -5
  159. package/lib/esm/components/livechatwidget/common/createMarkdown.js +18 -18
  160. package/lib/esm/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +7 -0
  161. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +43 -22
  162. package/lib/esm/components/livechatwidget/common/endChat.js +32 -18
  163. package/lib/esm/components/livechatwidget/common/getGeneralStylesForButton.js +0 -2
  164. package/lib/esm/components/livechatwidget/common/initCallingSdk.js +9 -11
  165. package/lib/esm/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -5
  166. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +18 -19
  167. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +79 -130
  168. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +4 -9
  169. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +4 -3
  170. package/lib/esm/components/livechatwidget/common/shareObservable.js +4 -7
  171. package/lib/esm/components/livechatwidget/common/startChat.js +126 -81
  172. package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +4 -2
  173. package/lib/esm/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
  174. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +203 -190
  175. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +4 -5
  176. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +4 -5
  177. package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +4 -5
  178. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +32 -11
  179. package/lib/esm/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
  180. package/lib/esm/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +6 -0
  181. package/lib/esm/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
  182. package/lib/esm/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
  183. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +11 -21
  184. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +4 -8
  185. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +6 -6
  186. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +17 -11
  187. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
  188. package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +9 -18
  189. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +2 -13
  190. package/lib/esm/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -16
  191. package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +3 -5
  192. package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -6
  193. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +0 -2
  194. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +0 -2
  195. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
  196. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
  197. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
  198. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
  199. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
  200. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
  201. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
  202. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
  203. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +2 -5
  204. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -4
  205. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +17 -26
  206. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +10 -11
  207. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +23 -38
  208. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +9 -8
  209. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +2 -9
  210. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +0 -14
  211. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +3 -0
  212. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -1
  213. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -1
  214. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +3 -0
  215. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -7
  216. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +4 -28
  217. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +3 -3
  218. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +7 -14
  219. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +3 -3
  220. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +15 -19
  221. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +5 -8
  222. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -29
  223. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +3 -7
  224. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +3 -8
  225. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +17 -14
  226. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +3 -7
  227. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -7
  228. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +15 -27
  229. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +3 -5
  230. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +9 -9
  231. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +7 -9
  232. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -13
  233. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +0 -5
  234. package/lib/esm/contexts/ChatAdapterStore.js +2 -1
  235. package/lib/esm/contexts/ChatContextStore.js +2 -1
  236. package/lib/esm/contexts/ChatSDKStore.js +2 -1
  237. package/lib/esm/contexts/common/ConversationState.js +0 -1
  238. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +3 -3
  239. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -5
  240. package/lib/esm/contexts/createReducer.js +146 -105
  241. package/lib/esm/controller/componentController.js +3 -2
  242. package/lib/esm/hooks/useChatAdapterStore.js +0 -4
  243. package/lib/esm/hooks/useChatContextStore.js +0 -4
  244. package/lib/esm/hooks/useChatSDKStore.js +0 -4
  245. package/lib/esm/plugins/newMessageEventHandler.js +15 -26
  246. package/lib/types/common/Constants.d.ts +12 -0
  247. package/lib/types/common/telemetry/TelemetryConstants.d.ts +11 -4
  248. package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -4
  249. package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -0
  250. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +5 -7
  251. package/lib/types/components/livechatwidget/common/startChat.d.ts +3 -2
  252. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +1 -1
  253. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +4 -2
  254. package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -0
  255. package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +2 -2
  256. package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -0
  257. package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +4 -0
  258. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -1
  259. package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +2 -0
  260. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -0
  261. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -0
  262. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -2
  263. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +4 -3
  264. package/package.json +3 -3
@@ -4,31 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createOnNewAdapterActivityHandler = void 0;
7
-
8
7
  var _TelemetryConstants = require("../common/telemetry/TelemetryConstants");
9
-
10
8
  var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
11
-
12
9
  var _Constants = require("../common/Constants");
13
-
14
10
  var _TelemetryHelper = require("../common/telemetry/TelemetryHelper");
15
-
16
11
  const createOnNewAdapterActivityHandler = (chatId, userId) => {
17
12
  const onNewAdapterActivityHandler = activity => {
18
13
  var _activity$channelData, _activity$channelData2, _activity$channelData3;
19
-
20
14
  const isActivityMessage = (activity === null || activity === void 0 ? void 0 : activity.type) === _Constants.Constants.message;
21
- const isNotHistoryMessage = isActivityMessage && !(activity !== null && activity !== void 0 && (_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(_Constants.Constants.historyMessageTag)) && !(activity !== null && activity !== void 0 && (_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && _activity$channelData3.fromList);
22
-
23
- if (isNotHistoryMessage) {
24
- raiseMessageEvent(activity);
25
- }
15
+ const isHistoryMessage = isActivityMessage && ((activity === null || activity === void 0 ? void 0 : (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : (_activity$channelData2 = _activity$channelData.tags) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.includes(_Constants.Constants.historyMessageTag)) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData3 = activity.channelData) === null || _activity$channelData3 === void 0 ? void 0 : _activity$channelData3.fromList));
16
+ raiseMessageEvent(activity, isHistoryMessage);
26
17
  };
27
-
28
- const raiseMessageEvent = activity => {
18
+ const raiseMessageEvent = (activity, isHistoryMessage) => {
29
19
  if ((activity === null || activity === void 0 ? void 0 : activity.type) === _Constants.Constants.message) {
30
20
  var _text, _text2, _activity$channelData4, _activity$from;
31
-
32
21
  const payload = {
33
22
  // To identify hidden contents vs empty content
34
23
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -39,7 +28,6 @@ const createOnNewAdapterActivityHandler = (chatId, userId) => {
39
28
  tags: activity === null || activity === void 0 ? void 0 : (_activity$channelData4 = activity.channelData) === null || _activity$channelData4 === void 0 ? void 0 : _activity$channelData4.tags,
40
29
  messageType: ""
41
30
  };
42
-
43
31
  if ((activity === null || activity === void 0 ? void 0 : (_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === _Constants.Constants.userMessageTag) {
44
32
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
33
  payload.messageType = _Constants.Constants.userMessageTag;
@@ -47,53 +35,44 @@ const createOnNewAdapterActivityHandler = (chatId, userId) => {
47
35
  eventName: _TelemetryConstants.BroadcastEvent.NewMessageSent,
48
36
  payload: payload
49
37
  };
50
-
51
38
  _omnichannelChatComponents.BroadcastService.postMessage(newMessageSentEvent);
52
-
53
39
  _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
54
40
  Event: _TelemetryConstants.TelemetryEvent.MessageSent,
55
41
  Description: "New message sent"
56
42
  });
57
43
  } else {
58
44
  var _activity$channelData5, _activity$channelData6;
59
-
60
45
  if (activity !== null && activity !== void 0 && (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(_Constants.Constants.systemMessageTag)) {
61
46
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
62
47
  payload.messageType = _Constants.Constants.systemMessageTag;
63
48
  } else {
64
49
  var _activity$channelData7, _activity$channelData8, _activity$channelData9;
65
-
66
50
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
- const messageHasNoText = !(activity !== null && activity !== void 0 && activity.text); // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
-
69
- const messageHasNoTags = !(activity !== null && activity !== void 0 && activity.channelData) || !(activity !== null && activity !== void 0 && (_activity$channelData7 = activity.channelData) !== null && _activity$channelData7 !== void 0 && _activity$channelData7.tags) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData8 = activity.channelData) === null || _activity$channelData8 === void 0 ? void 0 : (_activity$channelData9 = _activity$channelData8.tags) === null || _activity$channelData9 === void 0 ? void 0 : _activity$channelData9.length) === 0; // eslint-disable-next-line @typescript-eslint/no-explicit-any
70
-
51
+ const messageHasNoText = !(activity !== null && activity !== void 0 && activity.text);
52
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
53
+ const messageHasNoTags = !(activity !== null && activity !== void 0 && activity.channelData) || !(activity !== null && activity !== void 0 && (_activity$channelData7 = activity.channelData) !== null && _activity$channelData7 !== void 0 && _activity$channelData7.tags) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData8 = activity.channelData) === null || _activity$channelData8 === void 0 ? void 0 : (_activity$channelData9 = _activity$channelData8.tags) === null || _activity$channelData9 === void 0 ? void 0 : _activity$channelData9.length) === 0;
54
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
71
55
  const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
72
-
73
56
  if (messageHasNoTags && messageHasNoText && messageHasNoAttachments) {
74
57
  return;
75
58
  }
76
-
77
59
  payload.messageType = _Constants.Constants.userMessageTag;
78
60
  }
79
-
80
61
  const newMessageReceivedEvent = {
81
- eventName: _TelemetryConstants.BroadcastEvent.NewMessageReceived,
62
+ eventName: isHistoryMessage ? _TelemetryConstants.BroadcastEvent.HistoryMessageReceived : _TelemetryConstants.BroadcastEvent.NewMessageReceived,
82
63
  payload: payload
83
64
  };
84
-
85
65
  _omnichannelChatComponents.BroadcastService.postMessage(newMessageReceivedEvent);
86
-
87
- _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
88
- Event: _TelemetryConstants.TelemetryEvent.MessageReceived,
89
- Description: "New message received",
90
- Data: payload
91
- });
66
+ if (!isHistoryMessage) {
67
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
68
+ Event: _TelemetryConstants.TelemetryEvent.MessageReceived,
69
+ Description: "New message received",
70
+ Data: payload
71
+ });
72
+ }
92
73
  }
93
74
  }
94
75
  };
95
-
96
76
  return onNewAdapterActivityHandler;
97
77
  };
98
-
99
78
  exports.createOnNewAdapterActivityHandler = createOnNewAdapterActivityHandler;
@@ -1,321 +1,180 @@
1
1
  var _class;
2
-
3
2
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
-
5
3
  export class Constants {}
6
-
7
4
  _defineProperty(Constants, "magicCodeBroadcastChannel", "MagicCodeChannel");
8
-
9
5
  _defineProperty(Constants, "magicCodeResponseBroadcastChannel", "MagicCodeResponseChannel");
10
-
11
6
  _defineProperty(Constants, "systemMessageTag", "system");
12
-
13
7
  _defineProperty(Constants, "userMessageTag", "user");
14
-
15
8
  _defineProperty(Constants, "historyMessageTag", "history");
16
-
17
9
  _defineProperty(Constants, "agentEndConversationMessageTag", "agentendconversation");
18
-
19
10
  _defineProperty(Constants, "supervisorForceCloseMessageTag", "supervisorforceclosedconversation");
20
-
21
11
  _defineProperty(Constants, "receivedMessageClassName", "ms_lcw_webchat_received_message");
22
-
23
12
  _defineProperty(Constants, "sentMessageClassName", "ms_lcw_webchat_sent_message");
24
-
25
13
  _defineProperty(Constants, "webchatChannelId", "webchat");
26
-
27
14
  _defineProperty(Constants, "markdown", "markdown");
28
-
29
15
  _defineProperty(Constants, "actionType", "actionType");
30
-
31
16
  _defineProperty(Constants, "String", "string");
32
-
33
17
  _defineProperty(Constants, "ChatMessagesJson", "chatMessagesJson");
34
-
35
18
  _defineProperty(Constants, "truePascal", "True");
36
-
37
19
  _defineProperty(Constants, "true", "true");
38
-
39
20
  _defineProperty(Constants, "false", "false");
40
-
41
21
  _defineProperty(Constants, "maximumUnreadMessageCount", 99);
42
-
43
22
  _defineProperty(Constants, "channelIdKey", "ChannelId-");
44
-
45
23
  _defineProperty(Constants, "ChannelId", "lcw");
46
-
47
24
  _defineProperty(Constants, "CustomerTag", "FromCustomer");
48
-
49
25
  _defineProperty(Constants, "GifContentType", "image/gif");
50
-
51
26
  _defineProperty(Constants, "video", "video");
52
-
53
27
  _defineProperty(Constants, "audio", "audio");
54
-
55
28
  _defineProperty(Constants, "controlsList", "controlsList");
56
-
57
29
  _defineProperty(Constants, "nodownload", "nodownload");
58
-
59
30
  _defineProperty(Constants, "activity", "activity");
60
-
61
31
  _defineProperty(Constants, "payload", "payload");
62
-
63
32
  _defineProperty(Constants, "text", "text");
64
-
65
33
  _defineProperty(Constants, "blank", "_blank");
66
-
67
34
  _defineProperty(Constants, "visitorIdPrefix", "8:");
68
-
69
35
  _defineProperty(Constants, "left", "left");
70
-
71
36
  _defineProperty(Constants, "queuePositionMessageTag", "queueposition");
72
-
73
37
  _defineProperty(Constants, "averageWaitTimeMessageTag", "averagewaittime");
74
-
75
38
  _defineProperty(Constants, "message", "message");
76
-
77
39
  _defineProperty(Constants, "hiddenTag", "Hidden");
78
-
79
40
  _defineProperty(Constants, "prefixTimestampTag", "ServerMessageTimestamp_");
80
-
81
41
  _defineProperty(Constants, "acsChannel", "ACS_CHANNEL");
82
-
83
42
  _defineProperty(Constants, "publicMessageTag", "public");
84
-
85
43
  _defineProperty(Constants, "supportedAdaptiveCardContentTypes", ["application/vnd.microsoft.card.adaptive", "application/vnd.microsoft.card.audio", "application/vnd.microsoft.card.hero", "application/vnd.microsoft.card.receipt", "application/vnd.microsoft.card.thumbnail", "application/vnd.microsoft.card.signin", "application/vnd.microsoft.card.oauth"]);
86
-
87
44
  _defineProperty(Constants, "maxUploadFileSize", "500000");
88
-
89
45
  _defineProperty(Constants, "imageRegex", /(\.)(jpeg|jpg|jiff|png|gif|bmp)$/i);
90
-
91
46
  _defineProperty(Constants, "audioMediaRegex", /(\.)(aac|aiff|alac|flac|mp2|mp3|pcm|wav|wma)$/i);
92
-
93
47
  _defineProperty(Constants, "videoMediaRegex", /(\.)(avchd|avi|flv|mpe|mpeg|mpg|mpv|mp4|m4p|m4v|mov|qt|swf|webm|wmv)$/i);
94
-
95
48
  _defineProperty(Constants, "chromeSupportedInlineMediaRegex", /(\.)(aac|mp3|wav|mp4)$/i);
96
-
97
49
  _defineProperty(Constants, "firefoxSupportedInlineMediaRegex", /(\.)(aac|flac|mp3|wav|mp4|mov)$/i);
98
-
99
50
  _defineProperty(Constants, "CallAdded", "callAdded");
100
-
101
51
  _defineProperty(Constants, "LocalVideoStreamAdded", "localVideoStreamAdded");
102
-
103
52
  _defineProperty(Constants, "LocalVideoStreamRemoved", "localVideoStreamRemoved");
104
-
105
53
  _defineProperty(Constants, "RemoteVideoStreamAdded", "remoteVideoStreamAdded");
106
-
107
54
  _defineProperty(Constants, "RemoteVideoStreamRemoved", "remoteVideoStreamRemoved");
108
-
109
55
  _defineProperty(Constants, "CallDisconnected", "callDisconnected");
110
-
111
56
  _defineProperty(Constants, "IncomingCallEnded", "incomingCallEnded");
112
-
113
57
  _defineProperty(Constants, "VoiceVideoInitialize", "voiceVideoInitialize");
114
-
115
58
  _defineProperty(Constants, "VoiceVideoInitializeException", "voiceVideoInitializeOnException");
116
-
117
59
  _defineProperty(Constants, "VoiceVideoLoading", "voiceVideoLoading");
118
-
119
60
  _defineProperty(Constants, "VoiceVideoNotLoaded", "voiceVideoNotLoaded");
120
-
121
61
  _defineProperty(Constants, "VoiceVideoLoadingException", "voiceVideoLoadingOnException");
122
-
123
62
  _defineProperty(Constants, "VoiceVideoAcceptCallException", "voiceVideoAcceptCallOnException");
124
-
125
63
  _defineProperty(Constants, "VoiceVideoAcceptCallWithVideoException", "voiceVideoAcceptCallWithVideoException");
126
-
127
64
  _defineProperty(Constants, "defaultDownloadTranscriptError", "Download transcript failed.");
128
-
129
65
  _defineProperty(Constants, "ProactiveChatInviteTimeoutInMs", 60000);
130
-
131
66
  _defineProperty(Constants, "InputSubmit", "InputSubmit");
132
-
133
67
  _defineProperty(Constants, "ReconnectIdAttributeName", "oc.reconnectid");
134
-
135
68
  _defineProperty(Constants, "LiveChatWidget", "LiveChatWidgetNew");
136
-
137
69
  _defineProperty(Constants, "GuidPattern", "xx-x-4m-ym-xxx");
138
-
139
70
  _defineProperty(Constants, "Default", "default");
140
-
141
71
  _defineProperty(Constants, "Zero", "zero");
142
-
143
72
  _defineProperty(Constants, "Title", "title");
144
-
145
73
  _defineProperty(Constants, "Target", "target");
146
-
147
74
  _defineProperty(Constants, "Blank", "_blank");
148
-
149
75
  _defineProperty(Constants, "TargetRelationship", "rel");
150
-
151
76
  _defineProperty(Constants, "TargetRelationshipAttributes", "noopener noreferrer");
152
-
153
77
  _defineProperty(Constants, "OpenLinkIconCssClass", "webchat__markdown__external-link-icon");
154
-
155
78
  _defineProperty(Constants, "internetConnectionTestUrl", "https://ocsdk-prod.azureedge.net/public/connecttest.txt");
156
-
157
79
  _defineProperty(Constants, "internetConnectionTestUrlText", "Omnichannel Connect Test");
158
-
159
80
  _defineProperty(Constants, "ChatWidgetStateChangedPrefix", "ChatWidgetStateChanged");
160
-
161
81
  _defineProperty(Constants, "PostChatLoadingDurationInMs", 2000);
162
-
163
82
  _defineProperty(Constants, "BrowserUnloadConfirmationMessage", "Do you want to leave chat?");
164
-
165
83
  export const Regex = (_class = class Regex {}, _defineProperty(_class, "EmailRegex", "(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"), _class);
166
84
  export class HtmlIdNames {}
167
-
168
85
  _defineProperty(HtmlIdNames, "MSLiveChatWidget", "MSLiveChatWidget");
169
-
170
86
  export class HtmlClassNames {}
171
-
172
87
  _defineProperty(HtmlClassNames, "webChatBannerCloseButton", "webchat__toast__dismissButton");
173
-
174
88
  _defineProperty(HtmlClassNames, "webChatBannerExpandButton", "webchat__toaster__expandIcon");
175
-
176
89
  export class HtmlElementSelectors {}
177
-
178
90
  _defineProperty(HtmlElementSelectors, "sendBoxSelector", "textarea[data-id=\"webchat-sendbox-input\"]");
179
-
180
91
  export class HtmlAttributeNames {}
181
-
182
92
  _defineProperty(HtmlAttributeNames, "role", "role");
183
-
184
93
  _defineProperty(HtmlAttributeNames, "navigation", "navigation");
185
-
186
94
  _defineProperty(HtmlAttributeNames, "ariaLabel", "aria-label");
187
-
188
95
  _defineProperty(HtmlAttributeNames, "ariaLive", "aria-live");
189
-
190
96
  _defineProperty(HtmlAttributeNames, "ariaDisabled", "aria-disabled");
191
-
192
97
  _defineProperty(HtmlAttributeNames, "form", "form");
193
-
194
98
  _defineProperty(HtmlAttributeNames, "ariaLabelledby", "aria-labelledby");
195
-
196
99
  _defineProperty(HtmlAttributeNames, "tabindex", "tabindex");
197
-
198
100
  _defineProperty(HtmlAttributeNames, "ariaRequired", "aria-required");
199
-
200
101
  _defineProperty(HtmlAttributeNames, "ariaDesribedby", "aria-describedby");
201
-
202
102
  _defineProperty(HtmlAttributeNames, "ariaHidden", "aria-hidden");
203
-
204
103
  _defineProperty(HtmlAttributeNames, "disabled", "disabled");
205
-
206
104
  _defineProperty(HtmlAttributeNames, "hidden", "hidden");
207
-
208
105
  _defineProperty(HtmlAttributeNames, "download", "download");
209
-
210
106
  _defineProperty(HtmlAttributeNames, "href", "href");
211
-
212
107
  _defineProperty(HtmlAttributeNames, "region", "region");
213
-
214
108
  _defineProperty(HtmlAttributeNames, "button", "button");
215
-
216
109
  _defineProperty(HtmlAttributeNames, "input", "Input");
217
-
218
110
  _defineProperty(HtmlAttributeNames, "style", "style");
219
-
220
111
  _defineProperty(HtmlAttributeNames, "head", "head");
221
-
222
112
  _defineProperty(HtmlAttributeNames, "type", "type");
223
-
224
113
  _defineProperty(HtmlAttributeNames, "csstext", "text/css");
225
-
226
114
  _defineProperty(HtmlAttributeNames, "listItem", "LI");
227
-
228
115
  _defineProperty(HtmlAttributeNames, "unorderedList", "UL");
229
-
230
116
  _defineProperty(HtmlAttributeNames, "div", "div");
231
-
232
117
  _defineProperty(HtmlAttributeNames, "aTagName", "a");
233
-
234
118
  _defineProperty(HtmlAttributeNames, "noopenerTag", "noopener");
235
-
236
119
  _defineProperty(HtmlAttributeNames, "noreferrerTag", "noreferrer");
237
-
238
120
  _defineProperty(HtmlAttributeNames, "adaptiveCardClassName", "ac-adaptiveCard");
239
-
240
121
  _defineProperty(HtmlAttributeNames, "adaptiveCardTextBlockClassName", "ac-textBlock");
241
-
242
122
  _defineProperty(HtmlAttributeNames, "adaptiveCardToggleInputClassName", "ac-toggleInput");
243
-
244
123
  export class WebChatMiddlewareConstants {}
245
-
246
124
  _defineProperty(WebChatMiddlewareConstants, "nextVisibleActivity", "nextVisibleActivity");
247
-
248
125
  _defineProperty(WebChatMiddlewareConstants, "timeBetweenTimestampGroups", 300000);
249
-
250
126
  _defineProperty(WebChatMiddlewareConstants, "maxTextLength", 6000);
251
-
252
127
  _defineProperty(WebChatMiddlewareConstants, "adaptiveCard", "AdaptiveCard");
253
-
254
128
  export class MimeTypes {}
255
-
256
129
  _defineProperty(MimeTypes, "UnknownFileType", "application/octet-stream");
257
-
258
130
  export class LocaleConstants {}
259
-
260
131
  _defineProperty(LocaleConstants, "RTL_LOCALES", ["1025", "1037"]);
261
-
262
132
  export let ElementType;
263
-
264
133
  (function (ElementType) {
265
134
  ElementType["CallingContainerSDK"] = "CallingContainerSDK";
266
135
  })(ElementType || (ElementType = {}));
267
-
268
136
  export let ChatSDKError;
269
-
270
137
  (function (ChatSDKError) {
271
138
  ChatSDKError["WidgetUseOutsideOperatingHour"] = "WidgetUseOutsideOperatingHour";
272
139
  })(ChatSDKError || (ChatSDKError = {}));
273
-
274
140
  export let EnvironmentVersion;
275
-
276
141
  (function (EnvironmentVersion) {
277
142
  EnvironmentVersion["prod"] = "prod";
278
143
  EnvironmentVersion["dogfood"] = "df";
279
144
  EnvironmentVersion["int"] = "int";
280
145
  EnvironmentVersion["test"] = "test";
281
146
  })(EnvironmentVersion || (EnvironmentVersion = {}));
282
-
147
+ export let E2VVOptions;
148
+ (function (E2VVOptions) {
149
+ E2VVOptions["NoCalling"] = "192350000";
150
+ E2VVOptions["VideoAndVoiceCalling"] = "192350001";
151
+ E2VVOptions["VoiceOnly"] = "192350002";
152
+ })(E2VVOptions || (E2VVOptions = {}));
153
+ export let LiveWorkItemState;
154
+ (function (LiveWorkItemState) {
155
+ LiveWorkItemState["Active"] = "Active";
156
+ LiveWorkItemState["Closed"] = "Closed";
157
+ LiveWorkItemState["Open"] = "Open";
158
+ LiveWorkItemState["Waiting"] = "Waiting";
159
+ LiveWorkItemState["WrapUp"] = "WrapUp";
160
+ })(LiveWorkItemState || (LiveWorkItemState = {}));
283
161
  export class TranscriptConstants {}
284
-
285
162
  _defineProperty(TranscriptConstants, "ChatTranscriptsBodyColor", "#F5F5F5");
286
-
287
163
  _defineProperty(TranscriptConstants, "TranscriptMessageEmojiMessageType", "http://schema.skype.com/emoji");
288
-
289
164
  _defineProperty(TranscriptConstants, "ChatTranscriptDownloadFile", "ChatTranscripts.html");
290
-
291
165
  _defineProperty(TranscriptConstants, "DefaultFileAttachmentName", "Untitled.txt");
292
-
293
166
  _defineProperty(TranscriptConstants, "CustomerDialogColor", "#E8E8E8");
294
-
295
167
  _defineProperty(TranscriptConstants, "CustomerFontColor", "black");
296
-
297
168
  _defineProperty(TranscriptConstants, "AdaptiveCardType", "adaptivecard");
298
-
299
169
  _defineProperty(TranscriptConstants, "InternalMode", "internal");
300
-
301
170
  _defineProperty(TranscriptConstants, "AgentDialogColor", "#2266E3");
302
-
303
171
  _defineProperty(TranscriptConstants, "AgentFontColor", "white");
304
-
305
172
  export class AriaTelemetryConstants {}
306
-
307
173
  _defineProperty(AriaTelemetryConstants, "GERMANY_ENDPOINT", "https://de.pipe.aria.microsoft.com/Collector/3.0/");
308
-
309
174
  _defineProperty(AriaTelemetryConstants, "GCCH_ENDPOINT", "https://tb.pipe.aria.microsoft.com/Collector/3.0/");
310
-
311
175
  _defineProperty(AriaTelemetryConstants, "DOD_ENDPOINT", "https://pf.pipe.aria.microsoft.com/Collector/3.0");
312
-
313
176
  _defineProperty(AriaTelemetryConstants, "EUROPE_ENDPOINT", "https://eu-mobile.events.data.microsoft.com/Collector/3.0/");
314
-
315
177
  _defineProperty(AriaTelemetryConstants, "MOONCAKE_ENDPOINT", "");
316
-
317
178
  _defineProperty(AriaTelemetryConstants, "Public", "Public");
318
-
319
179
  _defineProperty(AriaTelemetryConstants, "EU", "Europe");
320
-
321
180
  _defineProperty(AriaTelemetryConstants, "lcwEUDomainNames", ["crm4.omnichannelengagementhub.com", "crm12.omnichannelengagementhub.com", "crm16.omnichannelengagementhub.com", "crm17.omnichannelengagementhub.com", "crm19.omnichannelengagementhub.com"]);
@@ -1,5 +1,3 @@
1
1
  var _class;
2
-
3
2
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
-
5
3
  export const KeyCodes = (_class = class KeyCodes {}, _defineProperty(_class, "ENTER", "Enter"), _defineProperty(_class, "TAB", "Tab"), _class);
@@ -1,5 +1,3 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
2
  export class DataStoreManager {}
4
-
5
3
  _defineProperty(DataStoreManager, "clientDataStore", void 0);
@@ -1,12 +1,9 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
2
  import { BroadcastService } from "@microsoft/omnichannel-chat-components";
4
3
  import { getWidgetCacheId } from "../../utils";
5
4
  import { defaultClientDataStoreProvider } from "./defaultClientDataStoreProvider";
6
5
  export class defaultCacheManager {}
7
-
8
6
  _defineProperty(defaultCacheManager, "InternalCache", {});
9
-
10
7
  export const registerBroadcastServiceForLocalStorage = (orgid, widgetId, widgetInstanceId) => {
11
8
  const widgetCacheId = getWidgetCacheId(orgid, widgetId, widgetInstanceId);
12
9
  BroadcastService.getMessageByEventName(widgetCacheId).subscribe(msg => {
@@ -12,9 +12,7 @@ export const defaultClientDataStoreProvider = () => {
12
12
  return false;
13
13
  }
14
14
  };
15
-
16
15
  const TtlInMs = 15 * 60 * 1000; // 15 mins
17
-
18
16
  const dataStoreProvider = {
19
17
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
18
  setData: (key, data, type) => {
@@ -27,7 +25,6 @@ export const defaultClientDataStoreProvider = () => {
27
25
  expiry: now.getTime() + TtlInMs
28
26
  };
29
27
  const strItem = JSON.stringify(item);
30
-
31
28
  if (type === "localStorage") {
32
29
  localStorage.setItem(key, strItem);
33
30
  } else {
@@ -54,27 +51,23 @@ export const defaultClientDataStoreProvider = () => {
54
51
  getData: (key, type) => {
55
52
  if (isCookieAllowed()) {
56
53
  let item;
57
-
58
54
  if (type === "localStorage") {
59
55
  item = localStorage.getItem(key);
60
56
  } else {
61
57
  item = sessionStorage.getItem(key);
62
- } //Return item if not expired
63
-
64
-
58
+ }
59
+ //Return item if not expired
65
60
  let itemInJson = undefined;
66
-
67
61
  if (item !== null) {
68
62
  itemInJson = JSON.parse(item);
69
- const now = new Date(); // compare the expiry time of the item with the current time
70
-
63
+ const now = new Date();
64
+ // compare the expiry time of the item with the current time
71
65
  if (now.getTime() > itemInJson.expiry) {
72
66
  // If the item is expired, delete the item from storage
73
67
  // and return null
74
68
  localStorage.removeItem(key);
75
69
  return null;
76
70
  }
77
-
78
71
  return itemInJson.data;
79
72
  }
80
73
  } else {
@@ -12,11 +12,9 @@ export const defaultInitializeInMemoryDataStore = widgetId => {
12
12
  try {
13
13
  if (e.data.key) {
14
14
  const browserData = e.data;
15
-
16
15
  if (defaultCacheManager.InternalCache[browserData.key]) {
17
16
  delete defaultCacheManager.InternalCache[browserData.key];
18
17
  }
19
-
20
18
  defaultCacheManager.InternalCache[browserData.key] = browserData.data;
21
19
  }
22
20
  } catch (error) {
@@ -26,8 +24,9 @@ export const defaultInitializeInMemoryDataStore = widgetId => {
26
24
  Description: "Unable to register default in-memory cache."
27
25
  });
28
26
  }
29
- }); // send cache initialize message to client
27
+ });
30
28
 
29
+ // send cache initialize message to client
31
30
  if (defaultCacheManager.InternalCache === undefined || {}) {
32
31
  parent.postMessage({
33
32
  data: "cacheinitialize",