@microsoft/omnichannel-chat-widget 1.8.5-0 → 1.8.6

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 (347) hide show
  1. package/lib/cjs/assets/Audios.js +1 -2
  2. package/lib/cjs/assets/Icons.js +16 -32
  3. package/lib/cjs/common/Constants.js +58 -86
  4. package/lib/cjs/common/KeyCodes.js +9 -10
  5. package/lib/cjs/common/contextDataStore/DataStoreManager.js +7 -8
  6. package/lib/cjs/common/facades/FacadeChatSDK.js +11 -13
  7. package/lib/cjs/common/storage/default/defaultCacheManager.js +7 -8
  8. package/lib/cjs/common/telemetry/AppInsightsEvents.js +2 -3
  9. package/lib/cjs/common/telemetry/ScenarioMarker.js +10 -12
  10. package/lib/cjs/common/telemetry/TelemetryConstants.js +31 -29
  11. package/lib/cjs/common/telemetry/TelemetryHelper.js +39 -39
  12. package/lib/cjs/common/telemetry/TelemetryManager.js +21 -24
  13. package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +2 -3
  14. package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +2 -3
  15. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +2 -3
  16. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryInternalData.js +2 -3
  17. package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +7 -8
  18. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +1 -1
  19. package/lib/cjs/common/utils/SecureEventBus.js +36 -10
  20. package/lib/cjs/common/utils/dispatchCustomEvent.js +2 -3
  21. package/lib/cjs/common/utils/xssUtils.js +1 -1
  22. package/lib/cjs/common/utils.js +10 -11
  23. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +15 -17
  24. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +10 -12
  25. package/lib/cjs/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +2 -3
  26. package/lib/cjs/components/citationpanestateful/CitationDim.js +3 -4
  27. package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +3 -6
  28. package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +3 -5
  29. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +3 -5
  30. package/lib/cjs/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.js +2 -3
  31. package/lib/cjs/components/dimlayer/DimLayer.js +1 -1
  32. package/lib/cjs/components/draggable/DraggableChatWidget.js +3 -5
  33. package/lib/cjs/components/draggable/DraggableEventEmitter.js +4 -6
  34. package/lib/cjs/components/draggable/DraggableEventNames.js +4 -5
  35. package/lib/cjs/components/draggable/DraggableEventReceiver.js +2 -4
  36. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +8 -10
  37. package/lib/cjs/components/errorboundary/ErrorBoundary.js +17 -21
  38. package/lib/cjs/components/footerstateful/FooterStateful.js +9 -11
  39. package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +2 -4
  40. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +4 -4
  41. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.js +1 -2
  42. package/lib/cjs/components/headerstateful/HeaderStateful.js +13 -15
  43. package/lib/cjs/components/headerstateful/common/styleProps/defaultOutOfOfficeHeaderStyleProps.js +2 -3
  44. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +6 -8
  45. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +10 -14
  46. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +26 -32
  47. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +10 -12
  48. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +9 -11
  49. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +9 -11
  50. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +9 -11
  51. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +12 -17
  52. package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +4 -5
  53. package/lib/cjs/components/livechatwidget/common/Deferred.js +10 -13
  54. package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +12 -15
  55. package/lib/cjs/components/livechatwidget/common/authHelper.js +1 -1
  56. package/lib/cjs/components/livechatwidget/common/chatDisconnectHelper.js +5 -5
  57. package/lib/cjs/components/livechatwidget/common/createAdapter.js +3 -3
  58. package/lib/cjs/components/livechatwidget/common/createDownloadTranscriptProps.js +1 -2
  59. package/lib/cjs/components/livechatwidget/common/createFooter.js +1 -1
  60. package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +6 -6
  61. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +1 -2
  62. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +2 -3
  63. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +2 -3
  64. package/lib/cjs/components/livechatwidget/common/defaultStyles/defaultLiveChatWidgetGeneralStyles.js +2 -3
  65. package/lib/cjs/components/livechatwidget/common/endChat.js +12 -13
  66. package/lib/cjs/components/livechatwidget/common/helpers/markdownHelper.js +1 -1
  67. package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -4
  68. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +17 -17
  69. package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +8 -8
  70. package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +4 -5
  71. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +6 -6
  72. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +11 -11
  73. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +10 -10
  74. package/lib/cjs/components/livechatwidget/common/startChat.js +37 -37
  75. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +6 -7
  76. package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +3 -4
  77. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +76 -78
  78. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +6 -8
  79. package/lib/cjs/components/loadingpanestateful/common/defaultStyleProps/defaultgeneralLoadingPaneStyleProps.js +2 -3
  80. package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +2 -3
  81. package/lib/cjs/components/notificationpanestateful/NotificationPaneStateful.js +37 -40
  82. package/lib/cjs/components/notificationpanestateful/defaultProps/defaultChatDisconnectControlProps.js +2 -3
  83. package/lib/cjs/components/notificationpanestateful/defaultProps/defaultChatDisconnectStyleProps.js +2 -3
  84. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +3 -5
  85. package/lib/cjs/components/ooohpanestateful/common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps.js +2 -3
  86. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +3 -5
  87. package/lib/cjs/components/postchatloadingpanestateful/common/defaultgeneralPostChatLoadingPaneStyleProps.js +2 -3
  88. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +4 -6
  89. package/lib/cjs/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +2 -3
  90. package/lib/cjs/components/postchatsurveypanestateful/common/isValidSurveyUrl.js +1 -2
  91. package/lib/cjs/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +3 -4
  92. package/lib/cjs/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +3 -4
  93. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +10 -12
  94. package/lib/cjs/components/prechatsurveypanestateful/common/defaultProps/defaultPreChatSurveyLocalizedTexts.js +2 -3
  95. package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +2 -3
  96. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -10
  97. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -6
  98. package/lib/cjs/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +15 -17
  99. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.js +2 -3
  100. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.js +2 -3
  101. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.js +2 -3
  102. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.js +2 -3
  103. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.js +2 -3
  104. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +34 -37
  105. package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +18 -21
  106. package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +17 -20
  107. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +21 -24
  108. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +20 -23
  109. package/lib/cjs/components/webchatcontainerstateful/common/MockBotCardCommandType.js +4 -5
  110. package/lib/cjs/components/webchatcontainerstateful/common/MockBotCommand.js +4 -5
  111. package/lib/cjs/components/webchatcontainerstateful/common/activities/botActivity.js +1 -2
  112. package/lib/cjs/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +2 -3
  113. package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +3 -4
  114. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultAttachmentProps.js +2 -3
  115. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts.js +2 -3
  116. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -3
  117. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -4
  118. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -3
  119. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +2 -3
  120. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStatefulContainerStyles.js +2 -3
  121. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +2 -3
  122. package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +12 -15
  123. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +10 -12
  124. package/lib/cjs/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.js +0 -1
  125. package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +10 -13
  126. package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +1 -1
  127. package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +3 -4
  128. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +7 -8
  129. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +2 -3
  130. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +7 -8
  131. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +3 -4
  132. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +3 -4
  133. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +3 -4
  134. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +3 -4
  135. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +3 -4
  136. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +3 -4
  137. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +3 -4
  138. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +3 -4
  139. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +9 -11
  140. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +1 -2
  141. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +1 -2
  142. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +2 -3
  143. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +2 -3
  144. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +60 -42
  145. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +2 -4
  146. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +8 -9
  147. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -1
  148. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +4 -4
  149. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.js +11 -12
  150. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.js +2 -3
  151. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.js +2 -3
  152. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.js +3 -4
  153. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.js +4 -5
  154. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.js +3 -4
  155. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.js +3 -4
  156. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.js +2 -3
  157. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +1 -1
  158. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +3 -3
  159. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentContentStyles.js +2 -3
  160. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDividerStyles.js +2 -3
  161. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDownloadIconStyles.js +2 -3
  162. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentFileNameStyles.js +2 -3
  163. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentSizeStyles.js +2 -3
  164. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentAdaptiveCardStyles.js +2 -3
  165. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentIconStyles.js +2 -3
  166. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentStyles.js +2 -3
  167. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarStyles.js +2 -3
  168. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +2 -3
  169. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +2 -3
  170. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +2 -3
  171. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles.js +2 -3
  172. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +2 -3
  173. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +2 -3
  174. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampContentStyles.js +2 -3
  175. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -3
  176. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -3
  177. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorBubbleStyles.js +2 -3
  178. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorContainerStyles.js +2 -3
  179. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorMessageStyles.js +2 -3
  180. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +2 -3
  181. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageStyles.js +2 -3
  182. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.js +6 -6
  183. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +7 -7
  184. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +1 -1
  185. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +1 -1
  186. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +3 -4
  187. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +1 -1
  188. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.js +1 -2
  189. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +2 -3
  190. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +3 -4
  191. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +7 -8
  192. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.js +1 -2
  193. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +3 -4
  194. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +8 -8
  195. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +9 -10
  196. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +3 -4
  197. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +1 -2
  198. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +4 -5
  199. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -4
  200. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +4 -5
  201. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +3 -4
  202. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +3 -4
  203. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +1 -2
  204. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +2 -3
  205. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +8 -10
  206. package/lib/cjs/contexts/ChatAdapterStore.js +1 -2
  207. package/lib/cjs/contexts/ChatContextStore.js +1 -2
  208. package/lib/cjs/contexts/ChatSDKStore.js +1 -2
  209. package/lib/cjs/contexts/FacadeChatSDKStore.js +1 -2
  210. package/lib/cjs/contexts/common/ConversationState.js +3 -4
  211. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +211 -4
  212. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +3 -3
  213. package/lib/cjs/contexts/common/StartChatFailureType.js +3 -4
  214. package/lib/cjs/controller/componentController.js +1 -1
  215. package/lib/cjs/firstresponselatency/Constants.js +3 -4
  216. package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +9 -11
  217. package/lib/cjs/firstresponselatency/util.js +8 -8
  218. package/lib/cjs/hooks/useChatAdapterStore.js +1 -2
  219. package/lib/cjs/hooks/useChatContextStore.js +1 -2
  220. package/lib/cjs/hooks/useChatSDKStore.js +1 -2
  221. package/lib/cjs/hooks/useFacadeChatSDKStore.js +1 -2
  222. package/lib/cjs/hooks/useWindowDimensions.js +1 -1
  223. package/lib/cjs/index.js +1 -1
  224. package/lib/cjs/plugins/createChatTranscript.js +25 -28
  225. package/lib/cjs/plugins/newMessageEventHandler.js +2 -2
  226. package/lib/esm/common/Constants.js +40 -39
  227. package/lib/esm/common/KeyCodes.js +9 -9
  228. package/lib/esm/common/contextDataStore/DataStoreManager.js +6 -6
  229. package/lib/esm/common/facades/FacadeChatSDK.js +9 -10
  230. package/lib/esm/common/storage/default/defaultCacheManager.js +6 -6
  231. package/lib/esm/common/telemetry/ScenarioMarker.js +9 -10
  232. package/lib/esm/common/telemetry/TelemetryConstants.js +33 -25
  233. package/lib/esm/common/telemetry/TelemetryHelper.js +38 -37
  234. package/lib/esm/common/telemetry/TelemetryManager.js +19 -20
  235. package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +5 -5
  236. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +1 -1
  237. package/lib/esm/common/utils/SecureEventBus.js +9 -8
  238. package/lib/esm/common/utils.js +10 -11
  239. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +12 -12
  240. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +7 -7
  241. package/lib/esm/components/citationpanestateful/CitationDim.js +1 -1
  242. package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +0 -1
  243. package/lib/esm/components/draggable/DraggableEventEmitter.js +1 -1
  244. package/lib/esm/components/draggable/DraggableEventNames.js +3 -3
  245. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -5
  246. package/lib/esm/components/errorboundary/ErrorBoundary.js +15 -17
  247. package/lib/esm/components/footerstateful/FooterStateful.js +6 -6
  248. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +3 -3
  249. package/lib/esm/components/headerstateful/HeaderStateful.js +10 -10
  250. package/lib/esm/components/livechatwidget/LiveChatWidget.js +3 -3
  251. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +9 -12
  252. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +23 -28
  253. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +8 -9
  254. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +7 -8
  255. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +7 -8
  256. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +7 -8
  257. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +10 -14
  258. package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +3 -3
  259. package/lib/esm/components/livechatwidget/common/Deferred.js +8 -10
  260. package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +10 -12
  261. package/lib/esm/components/livechatwidget/common/authHelper.js +1 -1
  262. package/lib/esm/components/livechatwidget/common/chatDisconnectHelper.js +5 -5
  263. package/lib/esm/components/livechatwidget/common/createAdapter.js +3 -3
  264. package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +6 -6
  265. package/lib/esm/components/livechatwidget/common/createMarkdown.js +0 -1
  266. package/lib/esm/components/livechatwidget/common/endChat.js +12 -13
  267. package/lib/esm/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -4
  268. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +16 -16
  269. package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +8 -8
  270. package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +3 -3
  271. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +6 -6
  272. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +11 -11
  273. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +10 -10
  274. package/lib/esm/components/livechatwidget/common/startChat.js +37 -37
  275. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +6 -7
  276. package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
  277. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +73 -73
  278. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +3 -3
  279. package/lib/esm/components/notificationpanestateful/NotificationPaneStateful.js +34 -35
  280. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +1 -1
  281. package/lib/esm/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +3 -3
  282. package/lib/esm/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +3 -3
  283. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +7 -7
  284. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +5 -5
  285. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +1 -1
  286. package/lib/esm/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +12 -12
  287. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +31 -32
  288. package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +15 -17
  289. package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +15 -17
  290. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +18 -20
  291. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +18 -20
  292. package/lib/esm/components/webchatcontainerstateful/common/MockBotCardCommandType.js +3 -3
  293. package/lib/esm/components/webchatcontainerstateful/common/MockBotCommand.js +3 -3
  294. package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +1 -1
  295. package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +10 -12
  296. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +7 -8
  297. package/lib/esm/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.js +0 -1
  298. package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +7 -7
  299. package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +1 -1
  300. package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -1
  301. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -6
  302. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -6
  303. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +3 -3
  304. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +3 -3
  305. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +3 -3
  306. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +3 -3
  307. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +3 -3
  308. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +3 -3
  309. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +3 -3
  310. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +3 -3
  311. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +7 -8
  312. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +28 -35
  313. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +6 -6
  314. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +3 -3
  315. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.js +9 -9
  316. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.js +1 -1
  317. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.js +3 -3
  318. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.js +1 -1
  319. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.js +1 -1
  320. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +3 -3
  321. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.js +6 -6
  322. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +7 -7
  323. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +1 -1
  324. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.js +0 -1
  325. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +2 -2
  326. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -6
  327. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +2 -2
  328. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +8 -8
  329. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +8 -8
  330. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +2 -2
  331. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +3 -3
  332. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +2 -2
  333. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +2 -2
  334. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +3 -4
  335. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +2 -2
  336. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +6 -7
  337. package/lib/esm/contexts/common/ConversationState.js +3 -3
  338. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +211 -3
  339. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +3 -3
  340. package/lib/esm/contexts/common/StartChatFailureType.js +3 -3
  341. package/lib/esm/controller/componentController.js +1 -2
  342. package/lib/esm/firstresponselatency/Constants.js +3 -3
  343. package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +7 -8
  344. package/lib/esm/firstresponselatency/util.js +8 -8
  345. package/lib/esm/plugins/createChatTranscript.js +23 -25
  346. package/lib/esm/plugins/newMessageEventHandler.js +2 -2
  347. package/package.json +28 -22
@@ -44,7 +44,7 @@ import sanitizationMiddleware from "../../webchatcontainerstateful/webchatcontro
44
44
 
45
45
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
46
46
  export const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endChat) => {
47
- var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _props$webChatContain5, _props$webChatContain6, _state$domainStates$l4, _state$domainStates$l5, _props$webChatContain11, _props$webChatContain12, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain13, _props$webChatContain14, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain15, _props$webChatContain16, _state$domainStates$l6, _state$domainStates$l7, _props$webChatContain17, _props$webChatContain18, _props$webChatContain19, _props$webChatContain20, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain21, _props$webChatContain22, _defaultWebChatContai, _props$webChatContain23, _props$webChatContain24, _defaultWebChatContai2, _props$webChatContain25, _props$webChatContain26, _props$webChatContain27, _props$webChatContain28;
47
+ var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _props$webChatContain5, _props$webChatContain6, _state$domainStates$l4, _props$webChatContain0, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain1, _state$domainStates$r3, _props$webChatContain10, _state$domainStates$l5, _props$webChatContain11, _props$webChatContain12, _state$domainStates$r4, _state$domainStates$r5, _props$webChatContain13, _defaultWebChatContai, _props$webChatContain14, _defaultWebChatContai2, _props$webChatContain15, _props$webChatContain16, _props$webChatContain17;
48
48
  // Add a hook to make all links open a new window
49
49
  postDomPurifyActivities();
50
50
  const localizedTexts = {
@@ -135,10 +135,10 @@ export const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endCh
135
135
  const hyperlinkTextOverrideRenderer = new HyperlinkTextOverrideRenderer(hyperlinkTextOverride);
136
136
  const markdownRenderers = [hyperlinkTextOverrideRenderer];
137
137
  const renderMarkdown = text => {
138
- var _props$webChatContain8, _props$webChatContain9;
139
- if ((_props$webChatContain8 = props.webChatContainerProps) !== null && _props$webChatContain8 !== void 0 && (_props$webChatContain9 = _props$webChatContain8.webChatProps) !== null && _props$webChatContain9 !== void 0 && _props$webChatContain9.renderMarkdown) {
140
- var _props$webChatContain10;
141
- text = (_props$webChatContain10 = props.webChatContainerProps) === null || _props$webChatContain10 === void 0 ? void 0 : _props$webChatContain10.webChatProps.renderMarkdown(text);
138
+ var _props$webChatContain8;
139
+ if ((_props$webChatContain8 = props.webChatContainerProps) !== null && _props$webChatContain8 !== void 0 && (_props$webChatContain8 = _props$webChatContain8.webChatProps) !== null && _props$webChatContain8 !== void 0 && _props$webChatContain8.renderMarkdown) {
140
+ var _props$webChatContain9;
141
+ text = (_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : _props$webChatContain9.webChatProps.renderMarkdown(text);
142
142
  } else {
143
143
  const render = disableMarkdownMessageFormatting ? markdown.renderInline.bind(markdown) : markdown.render.bind(markdown);
144
144
  text = render(text);
@@ -168,21 +168,21 @@ export const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endCh
168
168
  const webChatProps = {
169
169
  ...defaultWebChatContainerStatefulProps.webChatProps,
170
170
  dir: state.domainStates.globalDir,
171
- locale: changeLanguageCodeFormatForWebChat(getLocaleStringFromId((_state$domainStates$l4 = state.domainStates.liveChatConfig) === null || _state$domainStates$l4 === void 0 ? void 0 : (_state$domainStates$l5 = _state$domainStates$l4.ChatWidgetLanguage) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.msdyn_localeid)),
171
+ locale: changeLanguageCodeFormatForWebChat(getLocaleStringFromId((_state$domainStates$l4 = state.domainStates.liveChatConfig) === null || _state$domainStates$l4 === void 0 || (_state$domainStates$l4 = _state$domainStates$l4.ChatWidgetLanguage) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_localeid)),
172
172
  store: webChatStore,
173
- activityMiddleware: (_props$webChatContain11 = props.webChatContainerProps) !== null && _props$webChatContain11 !== void 0 && (_props$webChatContain12 = _props$webChatContain11.renderingMiddlewareProps) !== null && _props$webChatContain12 !== void 0 && _props$webChatContain12.disableActivityMiddleware ? undefined : createActivityMiddleware(renderMarkdown, (_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.systemMessageStyleProps, (_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.userMessageStyleProps, localizedTexts),
174
- attachmentMiddleware: (_props$webChatContain13 = props.webChatContainerProps) !== null && _props$webChatContain13 !== void 0 && (_props$webChatContain14 = _props$webChatContain13.renderingMiddlewareProps) !== null && _props$webChatContain14 !== void 0 && _props$webChatContain14.disableAttachmentMiddleware ? undefined : createAttachmentMiddleware(((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : (_state$domainStates$r4 = _state$domainStates$r3.attachmentProps) === null || _state$domainStates$r4 === void 0 ? void 0 : _state$domainStates$r4.enableInlinePlaying) ?? defaultAttachmentProps.enableInlinePlaying),
175
- activityStatusMiddleware: (_props$webChatContain15 = props.webChatContainerProps) !== null && _props$webChatContain15 !== void 0 && (_props$webChatContain16 = _props$webChatContain15.renderingMiddlewareProps) !== null && _props$webChatContain16 !== void 0 && _props$webChatContain16.disableActivityStatusMiddleware ? undefined : createActivityStatusMiddleware(getLocaleStringFromId((_state$domainStates$l6 = state.domainStates.liveChatConfig) === null || _state$domainStates$l6 === void 0 ? void 0 : (_state$domainStates$l7 = _state$domainStates$l6.ChatWidgetLanguage) === null || _state$domainStates$l7 === void 0 ? void 0 : _state$domainStates$l7.msdyn_localeid)),
176
- toastMiddleware: (_props$webChatContain17 = props.webChatContainerProps) !== null && _props$webChatContain17 !== void 0 && (_props$webChatContain18 = _props$webChatContain17.renderingMiddlewareProps) !== null && _props$webChatContain18 !== void 0 && _props$webChatContain18.disableToastMiddleware ? undefined : createToastMiddleware(props.notificationPaneProps, endChat),
173
+ activityMiddleware: (_props$webChatContain0 = props.webChatContainerProps) !== null && _props$webChatContain0 !== void 0 && (_props$webChatContain0 = _props$webChatContain0.renderingMiddlewareProps) !== null && _props$webChatContain0 !== void 0 && _props$webChatContain0.disableActivityMiddleware ? undefined : createActivityMiddleware(renderMarkdown, (_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.systemMessageStyleProps, (_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.userMessageStyleProps, localizedTexts),
174
+ attachmentMiddleware: (_props$webChatContain1 = props.webChatContainerProps) !== null && _props$webChatContain1 !== void 0 && (_props$webChatContain1 = _props$webChatContain1.renderingMiddlewareProps) !== null && _props$webChatContain1 !== void 0 && _props$webChatContain1.disableAttachmentMiddleware ? undefined : createAttachmentMiddleware(((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 || (_state$domainStates$r3 = _state$domainStates$r3.attachmentProps) === null || _state$domainStates$r3 === void 0 ? void 0 : _state$domainStates$r3.enableInlinePlaying) ?? defaultAttachmentProps.enableInlinePlaying),
175
+ activityStatusMiddleware: (_props$webChatContain10 = props.webChatContainerProps) !== null && _props$webChatContain10 !== void 0 && (_props$webChatContain10 = _props$webChatContain10.renderingMiddlewareProps) !== null && _props$webChatContain10 !== void 0 && _props$webChatContain10.disableActivityStatusMiddleware ? undefined : createActivityStatusMiddleware(getLocaleStringFromId((_state$domainStates$l5 = state.domainStates.liveChatConfig) === null || _state$domainStates$l5 === void 0 || (_state$domainStates$l5 = _state$domainStates$l5.ChatWidgetLanguage) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.msdyn_localeid)),
176
+ toastMiddleware: (_props$webChatContain11 = props.webChatContainerProps) !== null && _props$webChatContain11 !== void 0 && (_props$webChatContain11 = _props$webChatContain11.renderingMiddlewareProps) !== null && _props$webChatContain11 !== void 0 && _props$webChatContain11.disableToastMiddleware ? undefined : createToastMiddleware(props.notificationPaneProps, endChat),
177
177
  renderMarkdown,
178
- avatarMiddleware: (_props$webChatContain19 = props.webChatContainerProps) !== null && _props$webChatContain19 !== void 0 && (_props$webChatContain20 = _props$webChatContain19.renderingMiddlewareProps) !== null && _props$webChatContain20 !== void 0 && _props$webChatContain20.disableAvatarMiddleware ? undefined : createAvatarMiddleware((_state$domainStates$r5 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r5 === void 0 ? void 0 : _state$domainStates$r5.avatarStyleProps, (_state$domainStates$r6 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r6 === void 0 ? void 0 : _state$domainStates$r6.avatarTextStyleProps),
179
- groupActivitiesMiddleware: (_props$webChatContain21 = props.webChatContainerProps) !== null && _props$webChatContain21 !== void 0 && (_props$webChatContain22 = _props$webChatContain21.renderingMiddlewareProps) !== null && _props$webChatContain22 !== void 0 && _props$webChatContain22.disableGroupActivitiesMiddleware ? undefined : (_defaultWebChatContai = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.groupActivitiesMiddleware,
180
- typingIndicatorMiddleware: (_props$webChatContain23 = props.webChatContainerProps) !== null && _props$webChatContain23 !== void 0 && (_props$webChatContain24 = _props$webChatContain23.renderingMiddlewareProps) !== null && _props$webChatContain24 !== void 0 && _props$webChatContain24.disableTypingIndicatorMiddleware ? undefined : (_defaultWebChatContai2 = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.typingIndicatorMiddleware,
178
+ avatarMiddleware: (_props$webChatContain12 = props.webChatContainerProps) !== null && _props$webChatContain12 !== void 0 && (_props$webChatContain12 = _props$webChatContain12.renderingMiddlewareProps) !== null && _props$webChatContain12 !== void 0 && _props$webChatContain12.disableAvatarMiddleware ? undefined : createAvatarMiddleware((_state$domainStates$r4 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r4 === void 0 ? void 0 : _state$domainStates$r4.avatarStyleProps, (_state$domainStates$r5 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r5 === void 0 ? void 0 : _state$domainStates$r5.avatarTextStyleProps),
179
+ groupActivitiesMiddleware: (_props$webChatContain13 = props.webChatContainerProps) !== null && _props$webChatContain13 !== void 0 && (_props$webChatContain13 = _props$webChatContain13.renderingMiddlewareProps) !== null && _props$webChatContain13 !== void 0 && _props$webChatContain13.disableGroupActivitiesMiddleware ? undefined : (_defaultWebChatContai = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.groupActivitiesMiddleware,
180
+ typingIndicatorMiddleware: (_props$webChatContain14 = props.webChatContainerProps) !== null && _props$webChatContain14 !== void 0 && (_props$webChatContain14 = _props$webChatContain14.renderingMiddlewareProps) !== null && _props$webChatContain14 !== void 0 && _props$webChatContain14.disableTypingIndicatorMiddleware ? undefined : (_defaultWebChatContai2 = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.typingIndicatorMiddleware,
181
181
  onTelemetry: createWebChatTelemetry(),
182
- cardActionMiddleware: createCardActionMiddleware(((_props$webChatContain25 = props.webChatContainerProps) === null || _props$webChatContain25 === void 0 ? void 0 : _props$webChatContain25.botMagicCode) || undefined),
182
+ cardActionMiddleware: createCardActionMiddleware(((_props$webChatContain15 = props.webChatContainerProps) === null || _props$webChatContain15 === void 0 ? void 0 : _props$webChatContain15.botMagicCode) || undefined),
183
183
  sendTypingIndicator: true,
184
- overrideLocalizedStrings: getOverriddenLocalizedStrings((_props$webChatContain26 = props.webChatContainerProps) === null || _props$webChatContain26 === void 0 ? void 0 : (_props$webChatContain27 = _props$webChatContain26.webChatProps) === null || _props$webChatContain27 === void 0 ? void 0 : _props$webChatContain27.overrideLocalizedStrings),
185
- ...((_props$webChatContain28 = props.webChatContainerProps) === null || _props$webChatContain28 === void 0 ? void 0 : _props$webChatContain28.webChatProps)
184
+ overrideLocalizedStrings: getOverriddenLocalizedStrings((_props$webChatContain16 = props.webChatContainerProps) === null || _props$webChatContain16 === void 0 || (_props$webChatContain16 = _props$webChatContain16.webChatProps) === null || _props$webChatContain16 === void 0 ? void 0 : _props$webChatContain16.overrideLocalizedStrings),
185
+ ...((_props$webChatContain17 = props.webChatContainerProps) === null || _props$webChatContain17 === void 0 ? void 0 : _props$webChatContain17.webChatProps)
186
186
  };
187
187
  return webChatProps;
188
188
  };
@@ -9,13 +9,13 @@ export const isPostChatSurveyEnabled = async facadeChatSDK => {
9
9
 
10
10
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
11
  export const getPostChatSurveyConfig = async facadeChatSDK => {
12
- var _chatConfig$LiveWSAnd2, _chatConfig$LiveWSAnd3, _chatConfig$LiveWSAnd4, _chatConfig$LiveWSAnd5, _chatConfig$LiveWSAnd6, _chatConfig$LiveWSAnd7, _chatConfig$LiveWSAnd8, _chatConfig$LiveWSAnd9, _chatConfig$LiveWSAnd10;
12
+ var _chatConfig$LiveWSAnd2, _chatConfig$LiveWSAnd3, _chatConfig$LiveWSAnd4, _chatConfig$LiveWSAnd5, _chatConfig$LiveWSAnd6;
13
13
  const chatConfig = await facadeChatSDK.getLiveChatConfig();
14
14
  const postChatEnabled = (_chatConfig$LiveWSAnd2 = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd2 === void 0 ? void 0 : _chatConfig$LiveWSAnd2.msdyn_postconversationsurveyenable.toString().toLowerCase();
15
- const agentSurveyMode = (_chatConfig$LiveWSAnd3 = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd3 === void 0 ? void 0 : (_chatConfig$LiveWSAnd4 = _chatConfig$LiveWSAnd3.msdyn_postconversationsurveymode) === null || _chatConfig$LiveWSAnd4 === void 0 ? void 0 : _chatConfig$LiveWSAnd4.toString();
16
- const botSurveyMode = (_chatConfig$LiveWSAnd5 = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd5 === void 0 ? void 0 : (_chatConfig$LiveWSAnd6 = _chatConfig$LiveWSAnd5.msdyn_postconversationsurveybotsurveymode) === null || _chatConfig$LiveWSAnd6 === void 0 ? void 0 : _chatConfig$LiveWSAnd6.toString();
17
- const surveyProvider = (_chatConfig$LiveWSAnd7 = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd7 === void 0 ? void 0 : (_chatConfig$LiveWSAnd8 = _chatConfig$LiveWSAnd7.msdyn_surveyprovider) === null || _chatConfig$LiveWSAnd8 === void 0 ? void 0 : _chatConfig$LiveWSAnd8.toString();
18
- const isConversationalSurveyEnabled = (_chatConfig$LiveWSAnd9 = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd9 === void 0 ? void 0 : (_chatConfig$LiveWSAnd10 = _chatConfig$LiveWSAnd9.msdyn_isConversationalPostChatSurveyEnabled) === null || _chatConfig$LiveWSAnd10 === void 0 ? void 0 : _chatConfig$LiveWSAnd10.toString().toLowerCase();
15
+ const agentSurveyMode = (_chatConfig$LiveWSAnd3 = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd3 === void 0 || (_chatConfig$LiveWSAnd3 = _chatConfig$LiveWSAnd3.msdyn_postconversationsurveymode) === null || _chatConfig$LiveWSAnd3 === void 0 ? void 0 : _chatConfig$LiveWSAnd3.toString();
16
+ const botSurveyMode = (_chatConfig$LiveWSAnd4 = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd4 === void 0 || (_chatConfig$LiveWSAnd4 = _chatConfig$LiveWSAnd4.msdyn_postconversationsurveybotsurveymode) === null || _chatConfig$LiveWSAnd4 === void 0 ? void 0 : _chatConfig$LiveWSAnd4.toString();
17
+ const surveyProvider = (_chatConfig$LiveWSAnd5 = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd5 === void 0 || (_chatConfig$LiveWSAnd5 = _chatConfig$LiveWSAnd5.msdyn_surveyprovider) === null || _chatConfig$LiveWSAnd5 === void 0 ? void 0 : _chatConfig$LiveWSAnd5.toString();
18
+ const isConversationalSurveyEnabled = (_chatConfig$LiveWSAnd6 = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd6 === void 0 || (_chatConfig$LiveWSAnd6 = _chatConfig$LiveWSAnd6.msdyn_isConversationalPostChatSurveyEnabled) === null || _chatConfig$LiveWSAnd6 === void 0 ? void 0 : _chatConfig$LiveWSAnd6.toString().toLowerCase();
19
19
  return {
20
20
  postChatEnabled: postChatEnabled === "true",
21
21
  agentSurveyMode: agentSurveyMode,
@@ -44,18 +44,18 @@ export const shouldLoadPersistentChatHistory = extendedChatConfig => {
44
44
  var _extendedChatConfig$L, _extendedChatConfig$L2, _extendedChatConfig$L3;
45
45
  // CRITICAL: First check if conversation mode is persistent
46
46
  // Only persistent mode ("192350001") should allow history loading
47
- const isPersistentChatEnabledForWidget = isPersistentChatEnabled(extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L = extendedChatConfig.LiveWSAndLiveChatEngJoin) === null || _extendedChatConfig$L === void 0 ? void 0 : _extendedChatConfig$L.msdyn_conversationmode);
47
+ const isPersistentChatEnabledForWidget = isPersistentChatEnabled(extendedChatConfig === null || extendedChatConfig === void 0 || (_extendedChatConfig$L = extendedChatConfig.LiveWSAndLiveChatEngJoin) === null || _extendedChatConfig$L === void 0 ? void 0 : _extendedChatConfig$L.msdyn_conversationmode);
48
48
  if (!isPersistentChatEnabledForWidget) {
49
49
  return false;
50
50
  }
51
51
 
52
52
  // Check if history is enabled in admin config (handles both boolean and string "true"/"false")
53
- const isHistoryEnabledInConfig = parseBooleanFromConfig(extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L2 = extendedChatConfig.LiveWSAndLiveChatEngJoin) === null || _extendedChatConfig$L2 === void 0 ? void 0 : _extendedChatConfig$L2.msdyn_enablepersistentchatpreviousconversations);
53
+ const isHistoryEnabledInConfig = parseBooleanFromConfig(extendedChatConfig === null || extendedChatConfig === void 0 || (_extendedChatConfig$L2 = extendedChatConfig.LiveWSAndLiveChatEngJoin) === null || _extendedChatConfig$L2 === void 0 ? void 0 : _extendedChatConfig$L2.msdyn_enablepersistentchatpreviousconversations);
54
54
  if (!isHistoryEnabledInConfig) {
55
55
  return false;
56
56
  }
57
57
 
58
58
  // Check if history is enabled via feature flag (handles both boolean and string "true"/"false")
59
- const isHistoryEnabledViaFCB = parseBooleanFromConfig(extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L3 = extendedChatConfig.LcwFcbConfiguration) === null || _extendedChatConfig$L3 === void 0 ? void 0 : _extendedChatConfig$L3.lcwPersistentChatHistoryEnabled);
59
+ const isHistoryEnabledViaFCB = parseBooleanFromConfig(extendedChatConfig === null || extendedChatConfig === void 0 || (_extendedChatConfig$L3 = extendedChatConfig.LcwFcbConfiguration) === null || _extendedChatConfig$L3 === void 0 ? void 0 : _extendedChatConfig$L3.lcwPersistentChatHistoryEnabled);
60
60
  return isHistoryEnabledViaFCB;
61
61
  };
@@ -1,7 +1,7 @@
1
1
  const overridePropsOnMockIfApplicable = props => {
2
2
  var _props$mock, _props$mock2;
3
- if (props !== null && props !== void 0 && (_props$mock = props.mock) !== null && _props$mock !== void 0 && _props$mock.type && (props === null || props === void 0 ? void 0 : (_props$mock2 = props.mock) === null || _props$mock2 === void 0 ? void 0 : _props$mock2.type.toLowerCase()) === "designer") {
4
- var _props$mock3, _props$mock3$mockMess;
3
+ if (props !== null && props !== void 0 && (_props$mock = props.mock) !== null && _props$mock !== void 0 && _props$mock.type && (props === null || props === void 0 || (_props$mock2 = props.mock) === null || _props$mock2 === void 0 ? void 0 : _props$mock2.type.toLowerCase()) === "designer") {
4
+ var _props$mock3;
5
5
  if (!props.webChatContainerProps) {
6
6
  props.webChatContainerProps = {};
7
7
  }
@@ -17,7 +17,7 @@ const overridePropsOnMockIfApplicable = props => {
17
17
  props.webChatContainerProps = {
18
18
  ...props.webChatContainerProps,
19
19
  webChatProps: {
20
- disabled: !(props !== null && props !== void 0 && (_props$mock3 = props.mock) !== null && _props$mock3 !== void 0 && (_props$mock3$mockMess = _props$mock3.mockMessages) !== null && _props$mock3$mockMess !== void 0 && _props$mock3$mockMess.length),
20
+ disabled: !(props !== null && props !== void 0 && (_props$mock3 = props.mock) !== null && _props$mock3 !== void 0 && (_props$mock3 = _props$mock3.mockMessages) !== null && _props$mock3 !== void 0 && _props$mock3.length),
21
21
  ...props.webChatContainerProps.webChatProps,
22
22
  overrideLocalizedStrings: {
23
23
  TEXT_INPUT_PLACEHOLDER: "Send a message . . .",
@@ -12,9 +12,9 @@ import { handleStartChatError } from "./startChatErrorHandler";
12
12
  // Return value: should start normal chat flow when reconnect is enabled
13
13
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
14
  const handleChatReconnect = async (facadeChatSDK, props, dispatch, setAdapter, initStartChat, state) => {
15
- var _props$chatConfig, _props$chatConfig$Liv;
15
+ var _props$chatConfig;
16
16
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
- const isAuthenticatedChat = (_props$chatConfig = props.chatConfig) !== null && _props$chatConfig !== void 0 && (_props$chatConfig$Liv = _props$chatConfig.LiveChatConfigAuthSettings) !== null && _props$chatConfig$Liv !== void 0 && _props$chatConfig$Liv.msdyn_javascriptclientfunction ? true : false;
17
+ const isAuthenticatedChat = (_props$chatConfig = props.chatConfig) !== null && _props$chatConfig !== void 0 && (_props$chatConfig = _props$chatConfig.LiveChatConfigAuthSettings) !== null && _props$chatConfig !== void 0 && _props$chatConfig.msdyn_javascriptclientfunction ? true : false;
18
18
  // Get chat reconnect context
19
19
  const reconnectChatContext = (await getChatReconnectContext(facadeChatSDK, props.chatConfig, props, isAuthenticatedChat, dispatch)) ?? {};
20
20
 
@@ -126,16 +126,16 @@ const redirectPage = (redirectURL, redirectInSameWindow) => {
126
126
  };
127
127
  const isReconnectEnabled = chatConfig => {
128
128
  if (chatConfig) {
129
- var _chatConfig$LiveWSAnd, _chatConfig$LiveWSAnd2;
130
- const reconnectEnabled = ((_chatConfig$LiveWSAnd = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd === void 0 ? void 0 : (_chatConfig$LiveWSAnd2 = _chatConfig$LiveWSAnd.msdyn_enablechatreconnect) === null || _chatConfig$LiveWSAnd2 === void 0 ? void 0 : _chatConfig$LiveWSAnd2.toLowerCase()) === "true";
129
+ var _chatConfig$LiveWSAnd;
130
+ const reconnectEnabled = ((_chatConfig$LiveWSAnd = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd === void 0 || (_chatConfig$LiveWSAnd = _chatConfig$LiveWSAnd.msdyn_enablechatreconnect) === null || _chatConfig$LiveWSAnd === void 0 ? void 0 : _chatConfig$LiveWSAnd.toLowerCase()) === "true";
131
131
  return reconnectEnabled;
132
132
  }
133
133
  return false;
134
134
  };
135
135
  const isPersistentEnabled = chatConfig => {
136
136
  if (chatConfig) {
137
- var _chatConfig$LiveWSAnd3, _chatConfig$LiveWSAnd4;
138
- const persistentEnabled = ((_chatConfig$LiveWSAnd3 = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd3 === void 0 ? void 0 : (_chatConfig$LiveWSAnd4 = _chatConfig$LiveWSAnd3.msdyn_conversationmode) === null || _chatConfig$LiveWSAnd4 === void 0 ? void 0 : _chatConfig$LiveWSAnd4.toLowerCase()) === ConversationMode.Persistent;
137
+ var _chatConfig$LiveWSAnd2;
138
+ const persistentEnabled = ((_chatConfig$LiveWSAnd2 = chatConfig.LiveWSAndLiveChatEngJoin) === null || _chatConfig$LiveWSAnd2 === void 0 || (_chatConfig$LiveWSAnd2 = _chatConfig$LiveWSAnd2.msdyn_conversationmode) === null || _chatConfig$LiveWSAnd2 === void 0 ? void 0 : _chatConfig$LiveWSAnd2.toLowerCase()) === ConversationMode.Persistent;
139
139
  return persistentEnabled;
140
140
  }
141
141
  return false;
@@ -7,16 +7,16 @@ import { defaultTelemetryConfiguration } from "../../../common/telemetry/default
7
7
  import { newGuid } from "../../../common/utils";
8
8
  import { defaultAppInsightsConfig } from "../../../common/telemetry/defaultConfigs/defaultAppInsightsConfig";
9
9
  export const registerTelemetryLoggers = (props, dispatch) => {
10
- var _props$liveChatContex, _props$liveChatContex2;
10
+ var _props$liveChatContex;
11
11
  const telemetryConfig = {
12
12
  ...defaultTelemetryConfiguration,
13
13
  ...props.telemetryConfig
14
14
  };
15
- if ((_props$liveChatContex = props.liveChatContextFromCache) !== null && _props$liveChatContex !== void 0 && (_props$liveChatContex2 = _props$liveChatContex.domainStates) !== null && _props$liveChatContex2 !== void 0 && _props$liveChatContex2.telemetryInternalData) {
16
- var _props$liveChatContex3, _props$liveChatContex4;
17
- TelemetryManager.InternalTelemetryData = (_props$liveChatContex3 = props.liveChatContextFromCache) === null || _props$liveChatContex3 === void 0 ? void 0 : (_props$liveChatContex4 = _props$liveChatContex3.domainStates) === null || _props$liveChatContex4 === void 0 ? void 0 : _props$liveChatContex4.telemetryInternalData;
15
+ if ((_props$liveChatContex = props.liveChatContextFromCache) !== null && _props$liveChatContex !== void 0 && (_props$liveChatContex = _props$liveChatContex.domainStates) !== null && _props$liveChatContex !== void 0 && _props$liveChatContex.telemetryInternalData) {
16
+ var _props$liveChatContex2;
17
+ TelemetryManager.InternalTelemetryData = (_props$liveChatContex2 = props.liveChatContextFromCache) === null || _props$liveChatContex2 === void 0 || (_props$liveChatContex2 = _props$liveChatContex2.domainStates) === null || _props$liveChatContex2 === void 0 ? void 0 : _props$liveChatContex2.telemetryInternalData;
18
18
  } else {
19
- var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$chatSDK3, _props$chatSDK3$omnic, _props$chatSDK4, _props$chatSDK4$omnic, _props$chatSDK5, _props$chatSDK5$omnic, _props$chatSDK6, _props$chatSDK6$omnic, _props$chatSDK7, _props$chatSDK7$omnic, _props$chatSDK8, _props$chatSDK8$omnic, _props$chatSDK9, _props$chatSDK9$omnic;
19
+ var _props$chatSDK, _props$chatSDK2, _props$chatSDK3, _props$chatSDK4, _props$chatSDK5, _props$chatSDK6, _props$chatSDK7, _props$chatSDK8, _props$chatSDK9;
20
20
  let telemetryData = {
21
21
  ...defaultInternalTelemetryData,
22
22
  telemetryConfig: Object.assign({}, defaultTelemetryConfiguration, telemetryConfig),
@@ -29,21 +29,21 @@ export const registerTelemetryLoggers = (props, dispatch) => {
29
29
  //store AppInsights instrumentation key from chatConfig if present
30
30
  telemetryData.chatConfigAppInsightsKey = (_props$chatConfig$Liv = props.chatConfig.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig$Liv === void 0 ? void 0 : _props$chatConfig$Liv.AppInsightsInstrumentationKey;
31
31
  }
32
- if (!((_props$chatSDK = props.chatSDK) !== null && _props$chatSDK !== void 0 && (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) !== null && _props$chatSDK$omnich !== void 0 && _props$chatSDK$omnich.orgId) || ((_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.orgId.trim().length) === 0) {
32
+ if (!((_props$chatSDK = props.chatSDK) !== null && _props$chatSDK !== void 0 && (_props$chatSDK = _props$chatSDK.omnichannelConfig) !== null && _props$chatSDK !== void 0 && _props$chatSDK.orgId) || ((_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 || (_props$chatSDK2 = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2 === void 0 ? void 0 : _props$chatSDK2.orgId.trim().length) === 0) {
33
33
  throw new Error("orgId is undefined in ChatSDK");
34
34
  }
35
- if (!((_props$chatSDK3 = props.chatSDK) !== null && _props$chatSDK3 !== void 0 && (_props$chatSDK3$omnic = _props$chatSDK3.omnichannelConfig) !== null && _props$chatSDK3$omnic !== void 0 && _props$chatSDK3$omnic.widgetId) || ((_props$chatSDK4 = props.chatSDK) === null || _props$chatSDK4 === void 0 ? void 0 : (_props$chatSDK4$omnic = _props$chatSDK4.omnichannelConfig) === null || _props$chatSDK4$omnic === void 0 ? void 0 : _props$chatSDK4$omnic.widgetId.trim().length) === 0) {
35
+ if (!((_props$chatSDK3 = props.chatSDK) !== null && _props$chatSDK3 !== void 0 && (_props$chatSDK3 = _props$chatSDK3.omnichannelConfig) !== null && _props$chatSDK3 !== void 0 && _props$chatSDK3.widgetId) || ((_props$chatSDK4 = props.chatSDK) === null || _props$chatSDK4 === void 0 || (_props$chatSDK4 = _props$chatSDK4.omnichannelConfig) === null || _props$chatSDK4 === void 0 ? void 0 : _props$chatSDK4.widgetId.trim().length) === 0) {
36
36
  throw new Error("widgetId is undefined in ChatSDK");
37
37
  }
38
- if (!((_props$chatSDK5 = props.chatSDK) !== null && _props$chatSDK5 !== void 0 && (_props$chatSDK5$omnic = _props$chatSDK5.omnichannelConfig) !== null && _props$chatSDK5$omnic !== void 0 && _props$chatSDK5$omnic.orgUrl) || ((_props$chatSDK6 = props.chatSDK) === null || _props$chatSDK6 === void 0 ? void 0 : (_props$chatSDK6$omnic = _props$chatSDK6.omnichannelConfig) === null || _props$chatSDK6$omnic === void 0 ? void 0 : _props$chatSDK6$omnic.orgUrl.trim().length) === 0) {
38
+ if (!((_props$chatSDK5 = props.chatSDK) !== null && _props$chatSDK5 !== void 0 && (_props$chatSDK5 = _props$chatSDK5.omnichannelConfig) !== null && _props$chatSDK5 !== void 0 && _props$chatSDK5.orgUrl) || ((_props$chatSDK6 = props.chatSDK) === null || _props$chatSDK6 === void 0 || (_props$chatSDK6 = _props$chatSDK6.omnichannelConfig) === null || _props$chatSDK6 === void 0 ? void 0 : _props$chatSDK6.orgUrl.trim().length) === 0) {
39
39
  throw new Error("orgUrl is undefined in ChatSDK");
40
40
  }
41
41
  telemetryData.OCChatSDKVersion = telemetryConfig.OCChatSDKVersion ?? "0.0.0-0";
42
42
  telemetryData.chatComponentVersion = telemetryConfig.chatComponentVersion ?? "0.0.0-0";
43
43
  telemetryData.chatWidgetVersion = telemetryConfig.chatWidgetVersion ?? "0.0.0-0";
44
- telemetryData.orgId = (_props$chatSDK7 = props.chatSDK) === null || _props$chatSDK7 === void 0 ? void 0 : (_props$chatSDK7$omnic = _props$chatSDK7.omnichannelConfig) === null || _props$chatSDK7$omnic === void 0 ? void 0 : _props$chatSDK7$omnic.orgId;
45
- telemetryData.widgetId = (_props$chatSDK8 = props.chatSDK) === null || _props$chatSDK8 === void 0 ? void 0 : (_props$chatSDK8$omnic = _props$chatSDK8.omnichannelConfig) === null || _props$chatSDK8$omnic === void 0 ? void 0 : _props$chatSDK8$omnic.widgetId;
46
- telemetryData.orgUrl = (_props$chatSDK9 = props.chatSDK) === null || _props$chatSDK9 === void 0 ? void 0 : (_props$chatSDK9$omnic = _props$chatSDK9.omnichannelConfig) === null || _props$chatSDK9$omnic === void 0 ? void 0 : _props$chatSDK9$omnic.orgUrl;
44
+ telemetryData.orgId = (_props$chatSDK7 = props.chatSDK) === null || _props$chatSDK7 === void 0 || (_props$chatSDK7 = _props$chatSDK7.omnichannelConfig) === null || _props$chatSDK7 === void 0 ? void 0 : _props$chatSDK7.orgId;
45
+ telemetryData.widgetId = (_props$chatSDK8 = props.chatSDK) === null || _props$chatSDK8 === void 0 || (_props$chatSDK8 = _props$chatSDK8.omnichannelConfig) === null || _props$chatSDK8 === void 0 ? void 0 : _props$chatSDK8.widgetId;
46
+ telemetryData.orgUrl = (_props$chatSDK9 = props.chatSDK) === null || _props$chatSDK9 === void 0 || (_props$chatSDK9 = _props$chatSDK9.omnichannelConfig) === null || _props$chatSDK9 === void 0 ? void 0 : _props$chatSDK9.orgUrl;
47
47
  telemetryData.lcwRuntimeId = telemetryConfig.LCWRuntimeId ?? newGuid();
48
48
  TelemetryManager.InternalTelemetryData = telemetryData;
49
49
  dispatch({
@@ -13,16 +13,16 @@ let conversationDetails = undefined;
13
13
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
14
  let postChatSurveyMode = undefined;
15
15
  const getBotSurveyMode = (props, state) => {
16
- var _props$chatConfig, _props$chatConfig$Liv, _state$domainStates$l, _state$domainStates$l2;
17
- return ((_props$chatConfig = props.chatConfig) === null || _props$chatConfig === void 0 ? void 0 : (_props$chatConfig$Liv = _props$chatConfig.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig$Liv === void 0 ? void 0 : _props$chatConfig$Liv.msdyn_postconversationsurveybotsurveymode) ?? ((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveybotsurveymode);
16
+ var _props$chatConfig, _state$domainStates$l;
17
+ return ((_props$chatConfig = props.chatConfig) === null || _props$chatConfig === void 0 || (_props$chatConfig = _props$chatConfig.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig === void 0 ? void 0 : _props$chatConfig.msdyn_postconversationsurveybotsurveymode) ?? ((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 || (_state$domainStates$l = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.msdyn_postconversationsurveybotsurveymode);
18
18
  };
19
19
  const getUserSurveyMode = (props, state) => {
20
- var _props$chatConfig2, _props$chatConfig2$Li, _props$chatConfig3, _props$chatConfig3$Li;
21
- if (!((_props$chatConfig2 = props.chatConfig) !== null && _props$chatConfig2 !== void 0 && (_props$chatConfig2$Li = _props$chatConfig2.LiveWSAndLiveChatEngJoin) !== null && _props$chatConfig2$Li !== void 0 && _props$chatConfig2$Li.msdyn_postconversationsurveymode)) {
22
- var _state$domainStates, _state$domainStates$l3, _state$domainStates$l4;
23
- return (state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : (_state$domainStates$l3 = _state$domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode) ?? PostChatSurveyMode.Embed;
20
+ var _props$chatConfig2, _props$chatConfig3;
21
+ if (!((_props$chatConfig2 = props.chatConfig) !== null && _props$chatConfig2 !== void 0 && (_props$chatConfig2 = _props$chatConfig2.LiveWSAndLiveChatEngJoin) !== null && _props$chatConfig2 !== void 0 && _props$chatConfig2.msdyn_postconversationsurveymode)) {
22
+ var _state$domainStates;
23
+ return (state === null || state === void 0 || (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 || (_state$domainStates = _state$domainStates.liveChatConfig) === null || _state$domainStates === void 0 || (_state$domainStates = _state$domainStates.LiveWSAndLiveChatEngJoin) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.msdyn_postconversationsurveymode) ?? PostChatSurveyMode.Embed;
24
24
  }
25
- return (_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.msdyn_postconversationsurveymode;
25
+ return (_props$chatConfig3 = props.chatConfig) === null || _props$chatConfig3 === void 0 || (_props$chatConfig3 = _props$chatConfig3.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig3 === void 0 ? void 0 : _props$chatConfig3.msdyn_postconversationsurveymode;
26
26
  };
27
27
 
28
28
  // Set Survey mode based on conversation ended by entity
@@ -128,8 +128,8 @@ const initiatePostChat = async (props, conversationDetailsParam, state, dispatch
128
128
 
129
129
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
130
130
  const isPostChatEnabled = (props, state) => {
131
- var _props$chatConfig4, _props$chatConfig4$Li, _state$domainStates$l5, _state$domainStates$l6;
132
- const isPostChatEnabled = ((_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.msdyn_postconversationsurveyenable) ?? ((_state$domainStates$l5 = state.domainStates.liveChatConfig) === null || _state$domainStates$l5 === void 0 ? void 0 : (_state$domainStates$l6 = _state$domainStates$l5.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l6 === void 0 ? void 0 : _state$domainStates$l6.msdyn_postconversationsurveyenable);
131
+ var _props$chatConfig4, _state$domainStates$l2;
132
+ const isPostChatEnabled = ((_props$chatConfig4 = props.chatConfig) === null || _props$chatConfig4 === void 0 || (_props$chatConfig4 = _props$chatConfig4.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig4 === void 0 ? void 0 : _props$chatConfig4.msdyn_postconversationsurveyenable) ?? ((_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 || (_state$domainStates$l2 = _state$domainStates$l2.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable);
133
133
  return isPostChatEnabled === Constants.true;
134
134
  };
135
135
 
@@ -146,7 +146,7 @@ const getPostChatContext = async (facadeChatSDK, state, dispatch) => {
146
146
  }
147
147
  if (postChatEnabled) {
148
148
  var _state$domainStates2;
149
- if ((state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.postChatContext) === undefined) {
149
+ if ((state === null || state === void 0 || (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.postChatContext) === undefined) {
150
150
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
151
151
  const context = await facadeChatSDK.getPostChatSurveyContext();
152
152
  TelemetryHelper.logSDKEvent(LogLevel.INFO, {
@@ -58,7 +58,7 @@ const prepareStartChat = async (props, facadeChatSDK, state, dispatch, setAdapte
58
58
 
59
59
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
60
  const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, isProactiveChat, proactiveChatEnablePrechatState, state, props) => {
61
- var _props$preChatSurveyP, _props$preChatSurveyP2, _props$controlProps, _state$domainStates, _state$domainStates$l, _state$domainStates$l2, _state$appStates2;
61
+ var _props$preChatSurveyP, _props$controlProps, _state$domainStates, _state$appStates2;
62
62
  // This reset needs to be done before to load prechat, because the conversation state changes from close to prechat
63
63
  if ((state === null || state === void 0 ? void 0 : state.appStates.conversationState) === ConversationState.Closed) {
64
64
  // Preventive reset to avoid starting chat with previous requestId which could potentially cause problems
@@ -67,12 +67,12 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
67
67
 
68
68
  // Getting prechat Survey Context
69
69
  const parseToJson = false;
70
- const preChatSurveyResponse = (props === null || props === void 0 ? void 0 : (_props$preChatSurveyP = props.preChatSurveyPaneProps) === null || _props$preChatSurveyP === void 0 ? void 0 : (_props$preChatSurveyP2 = _props$preChatSurveyP.controlProps) === null || _props$preChatSurveyP2 === void 0 ? void 0 : _props$preChatSurveyP2.payload) ?? (await facadeChatSDK.getPreChatSurvey(parseToJson));
70
+ const preChatSurveyResponse = (props === null || props === void 0 || (_props$preChatSurveyP = props.preChatSurveyPaneProps) === null || _props$preChatSurveyP === void 0 || (_props$preChatSurveyP = _props$preChatSurveyP.controlProps) === null || _props$preChatSurveyP === void 0 ? void 0 : _props$preChatSurveyP.payload) ?? (await facadeChatSDK.getPreChatSurvey(parseToJson));
71
71
  let showPrechat = isProactiveChat ? preChatSurveyResponse && proactiveChatEnablePrechatState : preChatSurveyResponse && !(props !== null && props !== void 0 && (_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hidePreChatSurveyPane);
72
- showPrechat = await shouldSetPreChatIfPersistentChat(facadeChatSDK, state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : (_state$domainStates$l = _state$domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_conversationmode, showPrechat);
72
+ showPrechat = await shouldSetPreChatIfPersistentChat(facadeChatSDK, state === null || state === void 0 || (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 || (_state$domainStates = _state$domainStates.liveChatConfig) === null || _state$domainStates === void 0 || (_state$domainStates = _state$domainStates.LiveWSAndLiveChatEngJoin) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.msdyn_conversationmode, showPrechat);
73
73
  if (showPrechat) {
74
- var _state$domainStates2, _state$domainStates2$, _state$domainStates2$2, _state$domainStates2$3;
75
- const isOutOfOperatingHours = (state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : (_state$domainStates2$ = _state$domainStates2.liveChatConfig) === null || _state$domainStates2$ === void 0 ? void 0 : (_state$domainStates2$2 = _state$domainStates2$.LiveWSAndLiveChatEngJoin) === null || _state$domainStates2$2 === void 0 ? void 0 : (_state$domainStates2$3 = _state$domainStates2$2.OutOfOperatingHours) === null || _state$domainStates2$3 === void 0 ? void 0 : _state$domainStates2$3.toString().toLowerCase()) === "true";
74
+ var _state$domainStates2;
75
+ const isOutOfOperatingHours = (state === null || state === void 0 || (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 || (_state$domainStates2 = _state$domainStates2.liveChatConfig) === null || _state$domainStates2 === void 0 || (_state$domainStates2 = _state$domainStates2.LiveWSAndLiveChatEngJoin) === null || _state$domainStates2 === void 0 || (_state$domainStates2 = _state$domainStates2.OutOfOperatingHours) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.toString().toLowerCase()) === "true";
76
76
  if (isOutOfOperatingHours) {
77
77
  (state === null || state === void 0 ? void 0 : state.appStates.isMinimized) && dispatch({
78
78
  type: LiveChatWidgetActionType.SET_MINIMIZED,
@@ -98,8 +98,8 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
98
98
  });
99
99
 
100
100
  // If minimized, maximize the chat, if the state is missing, consider it as minimized
101
- if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : _state$appStates.isMinimized) === true) {
102
- var _state$domainStates3, _state$domainStates3$, _state$domainStates4, _state$domainStates4$, _TelemetryManager$Int;
101
+ if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 || (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : _state$appStates.isMinimized) === true) {
102
+ var _state$domainStates3, _state$domainStates4, _TelemetryManager$Int;
103
103
  dispatch({
104
104
  type: LiveChatWidgetActionType.SET_MINIMIZED,
105
105
  payload: false
@@ -109,9 +109,9 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
109
109
  BroadcastService.postMessage({
110
110
  eventName: BroadcastEvent.MaximizeChat,
111
111
  payload: {
112
- height: state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : (_state$domainStates3$ = _state$domainStates3.widgetSize) === null || _state$domainStates3$ === void 0 ? void 0 : _state$domainStates3$.height,
113
- width: state === null || state === void 0 ? void 0 : (_state$domainStates4 = state.domainStates) === null || _state$domainStates4 === void 0 ? void 0 : (_state$domainStates4$ = _state$domainStates4.widgetSize) === null || _state$domainStates4$ === void 0 ? void 0 : _state$domainStates4$.width,
114
- runtimeId: TelemetryManager === null || TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.lcwRuntimeId
112
+ height: state === null || state === void 0 || (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 || (_state$domainStates3 = _state$domainStates3.widgetSize) === null || _state$domainStates3 === void 0 ? void 0 : _state$domainStates3.height,
113
+ width: state === null || state === void 0 || (_state$domainStates4 = state.domainStates) === null || _state$domainStates4 === void 0 || (_state$domainStates4 = _state$domainStates4.widgetSize) === null || _state$domainStates4 === void 0 ? void 0 : _state$domainStates4.width,
114
+ runtimeId: TelemetryManager === null || TelemetryManager === void 0 || (_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.lcwRuntimeId
115
115
  }
116
116
  });
117
117
  }
@@ -131,8 +131,8 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
131
131
  *
132
132
  * This is because a new change to control OOH as closed event when a widget is coming from chat.
133
133
  */
134
- if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.isMinimized) === true) {
135
- var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6$, _TelemetryManager$Int2;
134
+ if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 || (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.isMinimized) === true) {
135
+ var _state$domainStates5, _state$domainStates6, _TelemetryManager$Int2;
136
136
  dispatch({
137
137
  type: LiveChatWidgetActionType.SET_MINIMIZED,
138
138
  payload: false
@@ -141,9 +141,9 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
141
141
  BroadcastService.postMessage({
142
142
  eventName: BroadcastEvent.MaximizeChat,
143
143
  payload: {
144
- height: state === null || state === void 0 ? void 0 : (_state$domainStates5 = state.domainStates) === null || _state$domainStates5 === void 0 ? void 0 : (_state$domainStates5$ = _state$domainStates5.widgetSize) === null || _state$domainStates5$ === void 0 ? void 0 : _state$domainStates5$.height,
145
- width: state === null || state === void 0 ? void 0 : (_state$domainStates6 = state.domainStates) === null || _state$domainStates6 === void 0 ? void 0 : (_state$domainStates6$ = _state$domainStates6.widgetSize) === null || _state$domainStates6$ === void 0 ? void 0 : _state$domainStates6$.width,
146
- runtimeId: TelemetryManager === null || TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int2 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.lcwRuntimeId
144
+ height: state === null || state === void 0 || (_state$domainStates5 = state.domainStates) === null || _state$domainStates5 === void 0 || (_state$domainStates5 = _state$domainStates5.widgetSize) === null || _state$domainStates5 === void 0 ? void 0 : _state$domainStates5.height,
145
+ width: state === null || state === void 0 || (_state$domainStates6 = state.domainStates) === null || _state$domainStates6 === void 0 || (_state$domainStates6 = _state$domainStates6.widgetSize) === null || _state$domainStates6 === void 0 ? void 0 : _state$domainStates6.width,
146
+ runtimeId: TelemetryManager === null || TelemetryManager === void 0 || (_TelemetryManager$Int2 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.lcwRuntimeId
147
147
  }
148
148
  });
149
149
  }
@@ -155,9 +155,9 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
155
155
 
156
156
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
157
157
  const initStartChat = async (facadeChatSDK, dispatch, setAdapter, state, props, params, persistedState) => {
158
- var _state$domainStates7, _state$domainStates7$, _state$domainStates7$2;
158
+ var _state$domainStates7;
159
159
  let isStartChatSuccessful = false;
160
- const persistentChatEnabled = isPersistentChatEnabled(state === null || state === void 0 ? void 0 : (_state$domainStates7 = state.domainStates) === null || _state$domainStates7 === void 0 ? void 0 : (_state$domainStates7$ = _state$domainStates7.liveChatConfig) === null || _state$domainStates7$ === void 0 ? void 0 : (_state$domainStates7$2 = _state$domainStates7$.LiveWSAndLiveChatEngJoin) === null || _state$domainStates7$2 === void 0 ? void 0 : _state$domainStates7$2.msdyn_conversationmode);
160
+ const persistentChatEnabled = isPersistentChatEnabled(state === null || state === void 0 || (_state$domainStates7 = state.domainStates) === null || _state$domainStates7 === void 0 || (_state$domainStates7 = _state$domainStates7.liveChatConfig) === null || _state$domainStates7 === void 0 || (_state$domainStates7 = _state$domainStates7.LiveWSAndLiveChatEngJoin) === null || _state$domainStates7 === void 0 ? void 0 : _state$domainStates7.msdyn_conversationmode);
161
161
  if ((state === null || state === void 0 ? void 0 : state.appStates.conversationState) === ConversationState.Closed) {
162
162
  // Preventive reset to avoid starting chat with previous requestId which could potentially cause problems
163
163
  chatSDKStateCleanUp(facadeChatSDK.getChatSDK());
@@ -165,7 +165,7 @@ const initStartChat = async (facadeChatSDK, dispatch, setAdapter, state, props,
165
165
  try {
166
166
  var _state$appStates3;
167
167
  // Clear disconnect state on start chat
168
- (state === null || state === void 0 ? void 0 : (_state$appStates3 = state.appStates) === null || _state$appStates3 === void 0 ? void 0 : _state$appStates3.chatDisconnectEventReceived) && dispatch({
168
+ (state === null || state === void 0 || (_state$appStates3 = state.appStates) === null || _state$appStates3 === void 0 ? void 0 : _state$appStates3.chatDisconnectEventReceived) && dispatch({
169
169
  type: LiveChatWidgetActionType.SET_CHAT_DISCONNECT_EVENT_RECEIVED,
170
170
  payload: false
171
171
  });
@@ -182,23 +182,23 @@ const initStartChat = async (facadeChatSDK, dispatch, setAdapter, state, props,
182
182
 
183
183
  //Check if chat retrieved from cache
184
184
  if (persistedState || params !== null && params !== void 0 && params.liveChatContext) {
185
- var _persistedState$domai, _persistedState$domai2, _persistedState$domai3, _persistedState$domai4, _persistedState$domai5;
185
+ var _persistedState$domai, _persistedState$domai2;
186
186
  BroadcastService.postMessage({
187
187
  eventName: BroadcastEvent.ChatRetrievedFromCache,
188
188
  payload: {
189
- chatId: persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai = persistedState.domainStates) === null || _persistedState$domai === void 0 ? void 0 : (_persistedState$domai2 = _persistedState$domai.liveChatContext) === null || _persistedState$domai2 === void 0 ? void 0 : (_persistedState$domai3 = _persistedState$domai2.chatToken) === null || _persistedState$domai3 === void 0 ? void 0 : _persistedState$domai3.chatId,
190
- requestId: persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai4 = persistedState.domainStates) === null || _persistedState$domai4 === void 0 ? void 0 : (_persistedState$domai5 = _persistedState$domai4.liveChatContext) === null || _persistedState$domai5 === void 0 ? void 0 : _persistedState$domai5.requestId
189
+ chatId: persistedState === null || persistedState === void 0 || (_persistedState$domai = persistedState.domainStates) === null || _persistedState$domai === void 0 || (_persistedState$domai = _persistedState$domai.liveChatContext) === null || _persistedState$domai === void 0 || (_persistedState$domai = _persistedState$domai.chatToken) === null || _persistedState$domai === void 0 ? void 0 : _persistedState$domai.chatId,
190
+ requestId: persistedState === null || persistedState === void 0 || (_persistedState$domai2 = persistedState.domainStates) === null || _persistedState$domai2 === void 0 || (_persistedState$domai2 = _persistedState$domai2.liveChatContext) === null || _persistedState$domai2 === void 0 ? void 0 : _persistedState$domai2.requestId
191
191
  }
192
192
  });
193
193
  }
194
194
  try {
195
- var _window$Microsoft, _window$Microsoft$Dyn, _window$Microsoft$Dyn2, _window$Microsoft$Dyn3;
195
+ var _window$Microsoft;
196
196
  // Set custom context params
197
197
  await setCustomContextParams(state, props);
198
198
  const defaultOptionalParams = {
199
199
  sendDefaultInitContext: true,
200
200
  isProactiveChat: !!(params !== null && params !== void 0 && params.isProactiveChat),
201
- portalContactId: (_window$Microsoft = window.Microsoft) === null || _window$Microsoft === void 0 ? void 0 : (_window$Microsoft$Dyn = _window$Microsoft.Dynamic365) === null || _window$Microsoft$Dyn === void 0 ? void 0 : (_window$Microsoft$Dyn2 = _window$Microsoft$Dyn.Portal) === null || _window$Microsoft$Dyn2 === void 0 ? void 0 : (_window$Microsoft$Dyn3 = _window$Microsoft$Dyn2.User) === null || _window$Microsoft$Dyn3 === void 0 ? void 0 : _window$Microsoft$Dyn3.contactId
201
+ portalContactId: (_window$Microsoft = window.Microsoft) === null || _window$Microsoft === void 0 || (_window$Microsoft = _window$Microsoft.Dynamic365) === null || _window$Microsoft === void 0 || (_window$Microsoft = _window$Microsoft.Portal) === null || _window$Microsoft === void 0 || (_window$Microsoft = _window$Microsoft.User) === null || _window$Microsoft === void 0 ? void 0 : _window$Microsoft.contactId
202
202
  };
203
203
  const startChatOptionalParams = Object.assign({}, params, optionalParams, defaultOptionalParams);
204
204
  // startTime is used to determine if a message is history or new, better to be set before creating the adapter to get bandwidth
@@ -285,27 +285,27 @@ const createAdapterAndSubscribe = async (facadeChatSDK, dispatch, setAdapter, st
285
285
  });
286
286
  if (chatToken !== null && chatToken !== void 0 && chatToken.chatId && chatToken !== null && chatToken !== void 0 && chatToken.visitorId) {
287
287
  var _newAdapter$activity$;
288
- newAdapter === null || newAdapter === void 0 ? void 0 : (_newAdapter$activity$ = newAdapter.activity$) === null || _newAdapter$activity$ === void 0 ? void 0 : _newAdapter$activity$.subscribe(createOnNewAdapterActivityHandler(chatToken.chatId, chatToken.visitorId, startTime));
288
+ newAdapter === null || newAdapter === void 0 || (_newAdapter$activity$ = newAdapter.activity$) === null || _newAdapter$activity$ === void 0 || _newAdapter$activity$.subscribe(createOnNewAdapterActivityHandler(chatToken.chatId, chatToken.visitorId, startTime));
289
289
  }
290
290
  };
291
291
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
292
292
  const canConnectToExistingChat = async (props, facadeChatSDK, state, dispatch, setAdapter) => {
293
- var _state$appStates4, _persistedState$domai6, _persistedState$appSt;
293
+ var _state$appStates4, _persistedState$domai3, _persistedState$appSt;
294
294
  // By pass this function in case of popout chat
295
- if ((state === null || state === void 0 ? void 0 : (_state$appStates4 = state.appStates) === null || _state$appStates4 === void 0 ? void 0 : _state$appStates4.hideStartChatButton) === true) {
295
+ if ((state === null || state === void 0 || (_state$appStates4 = state.appStates) === null || _state$appStates4 === void 0 ? void 0 : _state$appStates4.hideStartChatButton) === true) {
296
296
  return false;
297
297
  }
298
298
  const persistedState = getStateFromCache(getWidgetCacheIdfromProps(props));
299
299
 
300
300
  //Connect to only active chat session
301
- if (persistedState && !isUndefinedOrEmpty(persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai6 = persistedState.domainStates) === null || _persistedState$domai6 === void 0 ? void 0 : _persistedState$domai6.liveChatContext) && (persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$appSt = persistedState.appStates) === null || _persistedState$appSt === void 0 ? void 0 : _persistedState$appSt.conversationState) === ConversationState.Active) {
302
- var _persistedState$domai7;
301
+ if (persistedState && !isUndefinedOrEmpty(persistedState === null || persistedState === void 0 || (_persistedState$domai3 = persistedState.domainStates) === null || _persistedState$domai3 === void 0 ? void 0 : _persistedState$domai3.liveChatContext) && (persistedState === null || persistedState === void 0 || (_persistedState$appSt = persistedState.appStates) === null || _persistedState$appSt === void 0 ? void 0 : _persistedState$appSt.conversationState) === ConversationState.Active) {
302
+ var _persistedState$domai4;
303
303
  dispatch({
304
304
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
305
305
  payload: ConversationState.Loading
306
306
  });
307
307
  const optionalParams = {
308
- liveChatContext: persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai7 = persistedState.domainStates) === null || _persistedState$domai7 === void 0 ? void 0 : _persistedState$domai7.liveChatContext
308
+ liveChatContext: persistedState === null || persistedState === void 0 || (_persistedState$domai4 = persistedState.domainStates) === null || _persistedState$domai4 === void 0 ? void 0 : _persistedState$domai4.liveChatContext
309
309
  };
310
310
  await initStartChat(facadeChatSDK, dispatch, setAdapter, state, props, optionalParams, persistedState);
311
311
  return true;
@@ -315,11 +315,11 @@ const canConnectToExistingChat = async (props, facadeChatSDK, state, dispatch, s
315
315
 
316
316
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
317
317
  const setCustomContextParams = async (state, props) => {
318
- var _state$domainStates8, _persistedState$domai8;
318
+ var _state$domainStates8, _persistedState$domai5;
319
319
  if (state !== null && state !== void 0 && (_state$domainStates8 = state.domainStates) !== null && _state$domainStates8 !== void 0 && _state$domainStates8.customContext) {
320
320
  var _state$domainStates9;
321
321
  optionalParams = Object.assign({}, optionalParams, {
322
- customContext: JSON.parse(JSON.stringify(state === null || state === void 0 ? void 0 : (_state$domainStates9 = state.domainStates) === null || _state$domainStates9 === void 0 ? void 0 : _state$domainStates9.customContext))
322
+ customContext: JSON.parse(JSON.stringify(state === null || state === void 0 || (_state$domainStates9 = state.domainStates) === null || _state$domainStates9 === void 0 ? void 0 : _state$domainStates9.customContext))
323
323
  });
324
324
  return;
325
325
  }
@@ -328,7 +328,7 @@ const setCustomContextParams = async (state, props) => {
328
328
  }
329
329
  // Add custom context only for unauthenticated chat
330
330
  const persistedState = getStateFromCache(widgetInstanceId);
331
- const customContextLocal = (persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai8 = persistedState.domainStates) === null || _persistedState$domai8 === void 0 ? void 0 : _persistedState$domai8.customContext) ?? (props === null || props === void 0 ? void 0 : props.initialCustomContext);
331
+ const customContextLocal = (persistedState === null || persistedState === void 0 || (_persistedState$domai5 = persistedState.domainStates) === null || _persistedState$domai5 === void 0 ? void 0 : _persistedState$domai5.customContext) ?? (props === null || props === void 0 ? void 0 : props.initialCustomContext);
332
332
  if (customContextLocal) {
333
333
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
334
334
  Event: TelemetryEvent.SettingCustomContext,
@@ -352,9 +352,9 @@ const canStartPopoutChat = async props => {
352
352
  }
353
353
  popoutWidgetInstanceId = getWidgetCacheIdfromProps(props, true);
354
354
  if (!isNullOrEmptyString(popoutWidgetInstanceId)) {
355
- var _persistedState$domai9, _persistedState$appSt2;
355
+ var _persistedState$domai6, _persistedState$appSt2;
356
356
  const persistedState = getStateFromCache(popoutWidgetInstanceId);
357
- if (persistedState && !isUndefinedOrEmpty(persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai9 = persistedState.domainStates) === null || _persistedState$domai9 === void 0 ? void 0 : _persistedState$domai9.liveChatContext) && (persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$appSt2 = persistedState.appStates) === null || _persistedState$appSt2 === void 0 ? void 0 : _persistedState$appSt2.conversationState) === ConversationState.Active) {
357
+ if (persistedState && !isUndefinedOrEmpty(persistedState === null || persistedState === void 0 || (_persistedState$domai6 = persistedState.domainStates) === null || _persistedState$domai6 === void 0 ? void 0 : _persistedState$domai6.liveChatContext) && (persistedState === null || persistedState === void 0 || (_persistedState$appSt2 = persistedState.appStates) === null || _persistedState$appSt2 === void 0 ? void 0 : _persistedState$appSt2.conversationState) === ConversationState.Active) {
358
358
  // Initiate popout chat
359
359
  BroadcastService.postMessage({
360
360
  eventName: BroadcastEvent.InitiateStartChatInPopoutMode
@@ -367,9 +367,9 @@ const canStartPopoutChat = async props => {
367
367
 
368
368
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
369
369
  const checkIfConversationStillValid = async (facadeChatSDK, dispatch, state) => {
370
- var _state$domainStates10, _state$domainStates11, _state$domainStates12;
371
- const requestIdFromCache = (_state$domainStates10 = state.domainStates) === null || _state$domainStates10 === void 0 ? void 0 : (_state$domainStates11 = _state$domainStates10.liveChatContext) === null || _state$domainStates11 === void 0 ? void 0 : _state$domainStates11.requestId;
372
- const liveChatContext = state === null || state === void 0 ? void 0 : (_state$domainStates12 = state.domainStates) === null || _state$domainStates12 === void 0 ? void 0 : _state$domainStates12.liveChatContext;
370
+ var _state$domainStates0, _state$domainStates1;
371
+ const requestIdFromCache = (_state$domainStates0 = state.domainStates) === null || _state$domainStates0 === void 0 || (_state$domainStates0 = _state$domainStates0.liveChatContext) === null || _state$domainStates0 === void 0 ? void 0 : _state$domainStates0.requestId;
372
+ const liveChatContext = state === null || state === void 0 || (_state$domainStates1 = state.domainStates) === null || _state$domainStates1 === void 0 ? void 0 : _state$domainStates1.liveChatContext;
373
373
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
374
374
  let conversationDetails = undefined;
375
375
  // Preserve current requestId
@@ -32,7 +32,6 @@ export const handleStartChatError = (dispatch, facadeChatSDK, props, ex, isStart
32
32
  logWidgetLoadCompleteWithError(ex);
33
33
  // Don't return early - let the generic error handling logic handle hideErrorUIPane and telemetry
34
34
  }
35
-
36
35
  if (ex.message === WidgetLoadCustomErrorString.NetworkErrorString) {
37
36
  logWidgetLoadCompleteWithError(ex);
38
37
  }
@@ -118,7 +117,7 @@ const logWidgetLoadFailed = ex => {
118
117
  Event: TelemetryEvent.WidgetLoadFailed,
119
118
  Description: "Widget load complete with error",
120
119
  ExceptionDetails: exDetails,
121
- ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg === void 0 ? void 0 : _TelemetryTimers$Widg.milliSecondsElapsed,
120
+ ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 || (_TelemetryTimers$Widg = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg === void 0 ? void 0 : _TelemetryTimers$Widg.milliSecondsElapsed,
122
121
  CustomProperties: {
123
122
  ConversationStage: ConversationStage.Initialization
124
123
  }
@@ -133,7 +132,7 @@ export const logWidgetLoadComplete = additionalMessage => {
133
132
  TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
134
133
  Event: TelemetryEvent.WidgetLoadComplete,
135
134
  Description: descriptionString,
136
- ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg2 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg2 === void 0 ? void 0 : _TelemetryTimers$Widg2.milliSecondsElapsed
135
+ ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 || (_TelemetryTimers$Widg2 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg2 === void 0 ? void 0 : _TelemetryTimers$Widg2.milliSecondsElapsed
137
136
  });
138
137
  };
139
138
  export const logStartChatComplete = additionalMessage => {
@@ -162,7 +161,7 @@ const logWidgetLoadCompleteWithError = ex => {
162
161
  Event: TelemetryEvent.WidgetLoadFailed,
163
162
  Description: "Widget load complete with error",
164
163
  ExceptionDetails: exDetails,
165
- ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg3 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg3 === void 0 ? void 0 : _TelemetryTimers$Widg3.milliSecondsElapsed,
164
+ ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 || (_TelemetryTimers$Widg3 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg3 === void 0 ? void 0 : _TelemetryTimers$Widg3.milliSecondsElapsed,
166
165
  CustomProperties: {
167
166
  ConversationStage: ConversationStage.Initialization
168
167
  }
@@ -193,7 +192,7 @@ export const logWidgetLoadWithUnexpectedError = ex => {
193
192
  Event: TelemetryEvent.WidgetLoadFailed,
194
193
  Description: "Widget load with unexpected error",
195
194
  ExceptionDetails: exDetails,
196
- ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg4 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg4 === void 0 ? void 0 : _TelemetryTimers$Widg4.milliSecondsElapsed,
195
+ ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 || (_TelemetryTimers$Widg4 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg4 === void 0 ? void 0 : _TelemetryTimers$Widg4.milliSecondsElapsed,
197
196
  CustomProperties: {
198
197
  ConversationStage: ConversationStage.Initialization
199
198
  }
@@ -209,7 +208,7 @@ const forceEndChat = facadeChatSDK => {
209
208
  TelemetryHelper.logSDKEvent(LogLevel.INFO, {
210
209
  Event: TelemetryEvent.EndChatSDKCall
211
210
  });
212
- facadeChatSDK === null || facadeChatSDK === void 0 ? void 0 : facadeChatSDK.getChatSDK().endChat();
211
+ facadeChatSDK === null || facadeChatSDK === void 0 || facadeChatSDK.getChatSDK().endChat();
213
212
  };
214
213
  const handleWidgetUseOutsideOperatingHour = dispatch => {
215
214
  dispatch({
@@ -277,7 +276,7 @@ const handleInvalidOrClosedConversation = (dispatch, facadeChatSDK, props, ex) =
277
276
  endChatStateCleanUp(dispatch);
278
277
  closeChatStateCleanUp(dispatch);
279
278
  chatSDKStateCleanUp(facadeChatSDK.getChatSDK());
280
- (_DataStoreManager$cli = DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 ? void 0 : _DataStoreManager$cli.removeData(getWidgetCacheIdfromProps(props));
279
+ (_DataStoreManager$cli = DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 || _DataStoreManager$cli.removeData(getWidgetCacheIdfromProps(props));
281
280
 
282
281
  // Starts new chat
283
282
  dispatch({
@@ -1,6 +1,6 @@
1
- export let LiveChatWidgetMockType;
2
- (function (LiveChatWidgetMockType) {
1
+ export let LiveChatWidgetMockType = /*#__PURE__*/function (LiveChatWidgetMockType) {
3
2
  LiveChatWidgetMockType["Test"] = "Test";
4
3
  LiveChatWidgetMockType["Demo"] = "Demo";
5
4
  LiveChatWidgetMockType["Designer"] = "Designer";
6
- })(LiveChatWidgetMockType || (LiveChatWidgetMockType = {}));
5
+ return LiveChatWidgetMockType;
6
+ }({});