@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.
- package/lib/cjs/assets/Audios.js +1 -2
- package/lib/cjs/assets/Icons.js +16 -32
- package/lib/cjs/common/Constants.js +58 -86
- package/lib/cjs/common/KeyCodes.js +9 -10
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +7 -8
- package/lib/cjs/common/facades/FacadeChatSDK.js +11 -13
- package/lib/cjs/common/storage/default/defaultCacheManager.js +7 -8
- package/lib/cjs/common/telemetry/AppInsightsEvents.js +2 -3
- package/lib/cjs/common/telemetry/ScenarioMarker.js +10 -12
- package/lib/cjs/common/telemetry/TelemetryConstants.js +31 -29
- package/lib/cjs/common/telemetry/TelemetryHelper.js +39 -39
- package/lib/cjs/common/telemetry/TelemetryManager.js +21 -24
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +2 -3
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +2 -3
- package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +2 -3
- package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryInternalData.js +2 -3
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +7 -8
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +1 -1
- package/lib/cjs/common/utils/SecureEventBus.js +36 -10
- package/lib/cjs/common/utils/dispatchCustomEvent.js +2 -3
- package/lib/cjs/common/utils/xssUtils.js +1 -1
- package/lib/cjs/common/utils.js +10 -11
- package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +15 -17
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +10 -12
- package/lib/cjs/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +2 -3
- package/lib/cjs/components/citationpanestateful/CitationDim.js +3 -4
- package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +3 -6
- package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +3 -5
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +3 -5
- package/lib/cjs/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.js +2 -3
- package/lib/cjs/components/dimlayer/DimLayer.js +1 -1
- package/lib/cjs/components/draggable/DraggableChatWidget.js +3 -5
- package/lib/cjs/components/draggable/DraggableEventEmitter.js +4 -6
- package/lib/cjs/components/draggable/DraggableEventNames.js +4 -5
- package/lib/cjs/components/draggable/DraggableEventReceiver.js +2 -4
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +8 -10
- package/lib/cjs/components/errorboundary/ErrorBoundary.js +17 -21
- package/lib/cjs/components/footerstateful/FooterStateful.js +9 -11
- package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +2 -4
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +4 -4
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.js +1 -2
- package/lib/cjs/components/headerstateful/HeaderStateful.js +13 -15
- package/lib/cjs/components/headerstateful/common/styleProps/defaultOutOfOfficeHeaderStyleProps.js +2 -3
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +6 -8
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +10 -14
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +26 -32
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +10 -12
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +9 -11
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +9 -11
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +9 -11
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +12 -17
- package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +4 -5
- package/lib/cjs/components/livechatwidget/common/Deferred.js +10 -13
- package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +12 -15
- package/lib/cjs/components/livechatwidget/common/authHelper.js +1 -1
- package/lib/cjs/components/livechatwidget/common/chatDisconnectHelper.js +5 -5
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +3 -3
- package/lib/cjs/components/livechatwidget/common/createDownloadTranscriptProps.js +1 -2
- package/lib/cjs/components/livechatwidget/common/createFooter.js +1 -1
- package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +6 -6
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +1 -2
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +2 -3
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +2 -3
- package/lib/cjs/components/livechatwidget/common/defaultStyles/defaultLiveChatWidgetGeneralStyles.js +2 -3
- package/lib/cjs/components/livechatwidget/common/endChat.js +12 -13
- package/lib/cjs/components/livechatwidget/common/helpers/markdownHelper.js +1 -1
- package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -4
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +17 -17
- package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +8 -8
- package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +4 -5
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +6 -6
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +11 -11
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +10 -10
- package/lib/cjs/components/livechatwidget/common/startChat.js +37 -37
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +6 -7
- package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +3 -4
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +76 -78
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +6 -8
- package/lib/cjs/components/loadingpanestateful/common/defaultStyleProps/defaultgeneralLoadingPaneStyleProps.js +2 -3
- package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +2 -3
- package/lib/cjs/components/notificationpanestateful/NotificationPaneStateful.js +37 -40
- package/lib/cjs/components/notificationpanestateful/defaultProps/defaultChatDisconnectControlProps.js +2 -3
- package/lib/cjs/components/notificationpanestateful/defaultProps/defaultChatDisconnectStyleProps.js +2 -3
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +3 -5
- package/lib/cjs/components/ooohpanestateful/common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps.js +2 -3
- package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +3 -5
- package/lib/cjs/components/postchatloadingpanestateful/common/defaultgeneralPostChatLoadingPaneStyleProps.js +2 -3
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +4 -6
- package/lib/cjs/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +2 -3
- package/lib/cjs/components/postchatsurveypanestateful/common/isValidSurveyUrl.js +1 -2
- package/lib/cjs/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +3 -4
- package/lib/cjs/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +3 -4
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +10 -12
- package/lib/cjs/components/prechatsurveypanestateful/common/defaultProps/defaultPreChatSurveyLocalizedTexts.js +2 -3
- package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +2 -3
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -10
- package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -6
- package/lib/cjs/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +15 -17
- package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.js +2 -3
- package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.js +2 -3
- package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.js +2 -3
- package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.js +2 -3
- package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +34 -37
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +18 -21
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +17 -20
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +21 -24
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +20 -23
- package/lib/cjs/components/webchatcontainerstateful/common/MockBotCardCommandType.js +4 -5
- package/lib/cjs/components/webchatcontainerstateful/common/MockBotCommand.js +4 -5
- package/lib/cjs/components/webchatcontainerstateful/common/activities/botActivity.js +1 -2
- package/lib/cjs/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultAttachmentProps.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStatefulContainerStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +12 -15
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +10 -12
- package/lib/cjs/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.js +0 -1
- package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +10 -13
- package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +7 -8
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +7 -8
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +9 -11
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +1 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +1 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +60 -42
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +2 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +8 -9
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +4 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.js +11 -12
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.js +4 -5
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +3 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentContentStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDividerStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDownloadIconStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentFileNameStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentSizeStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentAdaptiveCardStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentIconStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampContentStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorBubbleStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorContainerStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorMessageStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.js +6 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +7 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.js +1 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +7 -8
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.js +1 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +8 -8
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +9 -10
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +1 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +4 -5
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +4 -5
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +3 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +1 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +8 -10
- package/lib/cjs/contexts/ChatAdapterStore.js +1 -2
- package/lib/cjs/contexts/ChatContextStore.js +1 -2
- package/lib/cjs/contexts/ChatSDKStore.js +1 -2
- package/lib/cjs/contexts/FacadeChatSDKStore.js +1 -2
- package/lib/cjs/contexts/common/ConversationState.js +3 -4
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +211 -4
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +3 -3
- package/lib/cjs/contexts/common/StartChatFailureType.js +3 -4
- package/lib/cjs/controller/componentController.js +1 -1
- package/lib/cjs/firstresponselatency/Constants.js +3 -4
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +9 -11
- package/lib/cjs/firstresponselatency/util.js +8 -8
- package/lib/cjs/hooks/useChatAdapterStore.js +1 -2
- package/lib/cjs/hooks/useChatContextStore.js +1 -2
- package/lib/cjs/hooks/useChatSDKStore.js +1 -2
- package/lib/cjs/hooks/useFacadeChatSDKStore.js +1 -2
- package/lib/cjs/hooks/useWindowDimensions.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/plugins/createChatTranscript.js +25 -28
- package/lib/cjs/plugins/newMessageEventHandler.js +2 -2
- package/lib/esm/common/Constants.js +40 -39
- package/lib/esm/common/KeyCodes.js +9 -9
- package/lib/esm/common/contextDataStore/DataStoreManager.js +6 -6
- package/lib/esm/common/facades/FacadeChatSDK.js +9 -10
- package/lib/esm/common/storage/default/defaultCacheManager.js +6 -6
- package/lib/esm/common/telemetry/ScenarioMarker.js +9 -10
- package/lib/esm/common/telemetry/TelemetryConstants.js +33 -25
- package/lib/esm/common/telemetry/TelemetryHelper.js +38 -37
- package/lib/esm/common/telemetry/TelemetryManager.js +19 -20
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +5 -5
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +1 -1
- package/lib/esm/common/utils/SecureEventBus.js +9 -8
- package/lib/esm/common/utils.js +10 -11
- package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +12 -12
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +7 -7
- package/lib/esm/components/citationpanestateful/CitationDim.js +1 -1
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +0 -1
- package/lib/esm/components/draggable/DraggableEventEmitter.js +1 -1
- package/lib/esm/components/draggable/DraggableEventNames.js +3 -3
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -5
- package/lib/esm/components/errorboundary/ErrorBoundary.js +15 -17
- package/lib/esm/components/footerstateful/FooterStateful.js +6 -6
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +3 -3
- package/lib/esm/components/headerstateful/HeaderStateful.js +10 -10
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +3 -3
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +9 -12
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +23 -28
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +8 -9
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +7 -8
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +7 -8
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +7 -8
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +10 -14
- package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +3 -3
- package/lib/esm/components/livechatwidget/common/Deferred.js +8 -10
- package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +10 -12
- package/lib/esm/components/livechatwidget/common/authHelper.js +1 -1
- package/lib/esm/components/livechatwidget/common/chatDisconnectHelper.js +5 -5
- package/lib/esm/components/livechatwidget/common/createAdapter.js +3 -3
- package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +6 -6
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +0 -1
- package/lib/esm/components/livechatwidget/common/endChat.js +12 -13
- package/lib/esm/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -4
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +16 -16
- package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +8 -8
- package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +3 -3
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +6 -6
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +11 -11
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +10 -10
- package/lib/esm/components/livechatwidget/common/startChat.js +37 -37
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +6 -7
- package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +73 -73
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +3 -3
- package/lib/esm/components/notificationpanestateful/NotificationPaneStateful.js +34 -35
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +1 -1
- package/lib/esm/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +3 -3
- package/lib/esm/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +3 -3
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +7 -7
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +5 -5
- package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +1 -1
- package/lib/esm/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +12 -12
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +31 -32
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +15 -17
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +15 -17
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +18 -20
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +18 -20
- package/lib/esm/components/webchatcontainerstateful/common/MockBotCardCommandType.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/common/MockBotCommand.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +10 -12
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +7 -8
- package/lib/esm/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.js +0 -1
- package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +7 -7
- package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +7 -8
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +28 -35
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +6 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.js +9 -9
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.js +6 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +7 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.js +0 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +8 -8
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +8 -8
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +3 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +6 -7
- package/lib/esm/contexts/common/ConversationState.js +3 -3
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +211 -3
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +3 -3
- package/lib/esm/contexts/common/StartChatFailureType.js +3 -3
- package/lib/esm/controller/componentController.js +1 -2
- package/lib/esm/firstresponselatency/Constants.js +3 -3
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +7 -8
- package/lib/esm/firstresponselatency/util.js +8 -8
- package/lib/esm/plugins/createChatTranscript.js +23 -25
- package/lib/esm/plugins/newMessageEventHandler.js +2 -2
- package/package.json +28 -22
|
@@ -11,7 +11,7 @@ import { defaultAttachmentStyles } from "../defaultStyles/defaultAtttachmentStyl
|
|
|
11
11
|
import AttachmentContent from "./AttachmentContent";
|
|
12
12
|
import AttachmentIcon from "./AttachmentIcon";
|
|
13
13
|
const Attachment = props => {
|
|
14
|
-
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$r3, _state$domainStates$r4, _state$domainStates$r5, _state$domainStates$r6, _state$domainStates$r7, _state$domainStates$r8
|
|
14
|
+
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$r3, _state$domainStates$r4, _state$domainStates$r5, _state$domainStates$r6, _state$domainStates$r7, _state$domainStates$r8;
|
|
15
15
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
16
16
|
const {
|
|
17
17
|
iconData,
|
|
@@ -20,43 +20,43 @@ const Attachment = props => {
|
|
|
20
20
|
renderer
|
|
21
21
|
} = props;
|
|
22
22
|
const [state] = useChatContextStore();
|
|
23
|
-
const attachmentId = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0
|
|
23
|
+
const attachmentId = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 || (_state$domainStates$r = _state$domainStates$r.attachmentProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.webChatAttachmentId) ?? defaultAttachmentProps.webChatAttachmentId;
|
|
24
24
|
const attachmentDividerStyles = {
|
|
25
25
|
...defaultAttachmentDividerStyles,
|
|
26
|
-
...((_state$domainStates$
|
|
26
|
+
...((_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.attachmentDividerStyles)
|
|
27
27
|
};
|
|
28
28
|
const attachmentIconStyles = {
|
|
29
29
|
...defaultAttachmentIconStyles,
|
|
30
|
-
...((_state$domainStates$
|
|
30
|
+
...((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : _state$domainStates$r3.attachmentIconStyles)
|
|
31
31
|
};
|
|
32
32
|
const attachmentStyles = {
|
|
33
33
|
...defaultAttachmentStyles,
|
|
34
|
-
...((_state$domainStates$
|
|
34
|
+
...((_state$domainStates$r4 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r4 === void 0 ? void 0 : _state$domainStates$r4.attachmentStyles)
|
|
35
35
|
};
|
|
36
36
|
const attachmentSizeStylesString = Object.entries({
|
|
37
37
|
...defaultAttachmentSizeStyles,
|
|
38
|
-
...((_state$domainStates$
|
|
38
|
+
...((_state$domainStates$r5 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r5 === void 0 ? void 0 : _state$domainStates$r5.attachmentSizeStyles)
|
|
39
39
|
}).map(_ref => {
|
|
40
40
|
let [k, v] = _ref;
|
|
41
41
|
return `${k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)}:${v}`;
|
|
42
42
|
}).join(";");
|
|
43
43
|
const attachmentContentStylesString = Object.entries({
|
|
44
44
|
...defaultAttachmentContentStyles,
|
|
45
|
-
...((_state$domainStates$
|
|
45
|
+
...((_state$domainStates$r6 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r6 === void 0 ? void 0 : _state$domainStates$r6.attachmentContentStyles)
|
|
46
46
|
}).map(_ref2 => {
|
|
47
47
|
let [k, v] = _ref2;
|
|
48
48
|
return `${k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)}:${v}`;
|
|
49
49
|
}).join(";");
|
|
50
50
|
const attachmentFileNameStylesString = Object.entries({
|
|
51
51
|
...defaultAttachmentFileNameStyles,
|
|
52
|
-
...((_state$domainStates$
|
|
52
|
+
...((_state$domainStates$r7 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r7 === void 0 ? void 0 : _state$domainStates$r7.attachmentFileNameStyles)
|
|
53
53
|
}).map(_ref3 => {
|
|
54
54
|
let [k, v] = _ref3;
|
|
55
55
|
return `${k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)}:${v}`;
|
|
56
56
|
}).join(";");
|
|
57
57
|
const attachmentDownloadIconStylesString = Object.entries({
|
|
58
58
|
...defaultAttachmentDownloadIconStyles,
|
|
59
|
-
...((_state$domainStates$
|
|
59
|
+
...((_state$domainStates$r8 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r8 === void 0 ? void 0 : _state$domainStates$r8.attachmentDownloadIconStyles)
|
|
60
60
|
}).map(_ref4 => {
|
|
61
61
|
let [k, v] = _ref4;
|
|
62
62
|
return `${k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)}:${v}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from "react";
|
|
3
3
|
import Attachment from "./Attachment";
|
|
4
4
|
const DownloadBlockedAttachment = props => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var FileScanStatus
|
|
2
|
-
(function (FileScanStatus) {
|
|
1
|
+
var FileScanStatus = /*#__PURE__*/function (FileScanStatus) {
|
|
3
2
|
FileScanStatus["PASSED"] = "passed";
|
|
4
3
|
FileScanStatus["MALWARE"] = "malware";
|
|
5
4
|
FileScanStatus["INPROGRESS"] = "in progress";
|
|
6
|
-
|
|
5
|
+
return FileScanStatus;
|
|
6
|
+
}(FileScanStatus || {});
|
|
7
7
|
export default FileScanStatus;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from "react";
|
|
3
3
|
import DownloadBlockedAttachment from "./DownloadBlockedAttachment";
|
|
4
4
|
import { CrossIcon, MaliciousFileIcon } from "../../../../../../assets/Icons";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from "react";
|
|
3
3
|
import Spinner from "./Spinner";
|
|
4
4
|
import DownloadBlockedAttachment from "./DownloadBlockedAttachment";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BotMagicCodeStore } from "../../BotMagicCodeStore";
|
|
2
|
-
var CardActionType
|
|
3
|
-
(function (CardActionType) {
|
|
2
|
+
var CardActionType = /*#__PURE__*/function (CardActionType) {
|
|
4
3
|
CardActionType["OpenUrl"] = "openUrl";
|
|
5
4
|
CardActionType["SignIn"] = "signin";
|
|
6
|
-
|
|
5
|
+
return CardActionType;
|
|
6
|
+
}(CardActionType || {});
|
|
7
7
|
const validCardActionTypes = [CardActionType.OpenUrl, CardActionType.SignIn];
|
|
8
8
|
const botOauthUrlRegex = /[\S]+.botframework.com\/api\/oauth\/signin\?signin=([\S]+)/;
|
|
9
9
|
export const createCardActionMiddleware = botMagicCodeConfig => {
|
|
@@ -16,12 +16,12 @@ const isApplicable = action => {
|
|
|
16
16
|
return action.type === WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && isValidChannel(action) && isWebSequenceIdPresent(action) && lookupOriginalMessageId(action) !== undefined;
|
|
17
17
|
};
|
|
18
18
|
const isValidChannel = action => {
|
|
19
|
-
var _action$payload
|
|
20
|
-
return (action === null || action === void 0
|
|
19
|
+
var _action$payload;
|
|
20
|
+
return (action === null || action === void 0 || (_action$payload = action.payload) === null || _action$payload === void 0 || (_action$payload = _action$payload.activity) === null || _action$payload === void 0 ? void 0 : _action$payload.channelId) === Constants.acsChannel;
|
|
21
21
|
};
|
|
22
22
|
const isChannelDataPresent = action => {
|
|
23
|
-
var _action$payload2, _action$
|
|
24
|
-
return (action === null || action === void 0
|
|
23
|
+
var _action$payload2, _action$payload3;
|
|
24
|
+
return (action === null || action === void 0 || (_action$payload2 = action.payload) === null || _action$payload2 === void 0 || (_action$payload2 = _action$payload2.activity) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.channelData) !== undefined && (action === null || action === void 0 || (_action$payload3 = action.payload) === null || _action$payload3 === void 0 || (_action$payload3 = _action$payload3.activity) === null || _action$payload3 === void 0 ? void 0 : _action$payload3.channelData) !== null;
|
|
25
25
|
};
|
|
26
26
|
const isWebSequenceIdPresent = action => {
|
|
27
27
|
if (!isChannelDataPresent(action)) return false;
|
|
@@ -52,6 +52,6 @@ const extractOriginalMessageId = action => {
|
|
|
52
52
|
return isNaN(originalMessageIdResult) ? undefined : originalMessageIdResult;
|
|
53
53
|
};
|
|
54
54
|
const lookupOriginalMessageId = action => {
|
|
55
|
-
var _action$payload4
|
|
56
|
-
return action === null || action === void 0
|
|
55
|
+
var _action$payload4;
|
|
56
|
+
return action === null || action === void 0 || (_action$payload4 = action.payload) === null || _action$payload4 === void 0 || (_action$payload4 = _action$payload4.activity) === null || _action$payload4 === void 0 || (_action$payload4 = _action$payload4.channelData) === null || _action$payload4 === void 0 || (_action$payload4 = _action$payload4.metadata) === null || _action$payload4 === void 0 ? void 0 : _action$payload4.OriginalMessageId;
|
|
57
57
|
};
|
|
@@ -18,11 +18,11 @@ const isApplicable = action => {
|
|
|
18
18
|
};
|
|
19
19
|
const isPayloadValid = action => {
|
|
20
20
|
var _action$payload;
|
|
21
|
-
return action === null || action === void 0
|
|
21
|
+
return action === null || action === void 0 || (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.activity;
|
|
22
22
|
};
|
|
23
23
|
const isValidChannel = action => {
|
|
24
|
-
var _action$payload2
|
|
25
|
-
return (action === null || action === void 0
|
|
24
|
+
var _action$payload2;
|
|
25
|
+
return (action === null || action === void 0 || (_action$payload2 = action.payload) === null || _action$payload2 === void 0 || (_action$payload2 = _action$payload2.activity) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.channelId) === Constants.acsChannel;
|
|
26
26
|
};
|
|
27
27
|
const isPVAConversation = action => {
|
|
28
28
|
return !isTagIncluded(action, Constants.systemMessageTag) && !isTagIncluded(action, Constants.publicMessageTag) && !isRoleUserOn(action);
|
|
@@ -33,8 +33,8 @@ const isTagIncluded = (action, tag) => {
|
|
|
33
33
|
return isDataTagsPresent(action) && action.payload.activity.channelData.tags.includes(tag);
|
|
34
34
|
};
|
|
35
35
|
const isRoleUserOn = action => {
|
|
36
|
-
var _action$payload3
|
|
37
|
-
return (action === null || action === void 0
|
|
36
|
+
var _action$payload3;
|
|
37
|
+
return (action === null || action === void 0 || (_action$payload3 = action.payload) === null || _action$payload3 === void 0 || (_action$payload3 = _action$payload3.activity) === null || _action$payload3 === void 0 || (_action$payload3 = _action$payload3.from) === null || _action$payload3 === void 0 ? void 0 : _action$payload3.role) === Constants.userMessageTag;
|
|
38
38
|
};
|
|
39
39
|
const overrideTimeStamp = (timestampOriginal, timeStampNew) => {
|
|
40
40
|
return isTimestampValid(timeStampNew) ? timeStampNew : timestampOriginal;
|
|
@@ -44,8 +44,8 @@ const isTimestampValid = timeStamp => {
|
|
|
44
44
|
return regex.test(timeStamp);
|
|
45
45
|
};
|
|
46
46
|
const isDataTagsPresent = action => {
|
|
47
|
-
var _action$payload4
|
|
48
|
-
return (action === null || action === void 0
|
|
47
|
+
var _action$payload4;
|
|
48
|
+
return (action === null || action === void 0 || (_action$payload4 = action.payload) === null || _action$payload4 === void 0 || (_action$payload4 = _action$payload4.activity) === null || _action$payload4 === void 0 || (_action$payload4 = _action$payload4.channelData) === null || _action$payload4 === void 0 ? void 0 : _action$payload4.tags) && action.payload.activity.channelData.tags.length > 0;
|
|
49
49
|
};
|
|
50
50
|
const evaluateTagsAndOverrideTimeStamp = action => {
|
|
51
51
|
const tagValue = tagLookup(action, Constants.prefixTimestampTag);
|
|
@@ -46,7 +46,7 @@ export const NotDeliveredTimestamp = _ref => {
|
|
|
46
46
|
};
|
|
47
47
|
useEffect(() => {
|
|
48
48
|
var _timestampRef$current;
|
|
49
|
-
const timestampWebChatNodes = timestampRef === null || timestampRef === void 0
|
|
49
|
+
const timestampWebChatNodes = timestampRef === null || timestampRef === void 0 || (_timestampRef$current = timestampRef.current) === null || _timestampRef$current === void 0 ? void 0 : _timestampRef$current.childNodes;
|
|
50
50
|
if ((timestampWebChatNodes === null || timestampWebChatNodes === void 0 ? void 0 : timestampWebChatNodes.length) > 1) {
|
|
51
51
|
timestampWebChatNodes[1].innerText = getTimestampHourMinute(timestamp);
|
|
52
52
|
}
|
|
@@ -22,8 +22,8 @@ const attachmentProcessingMiddleware = _ref => {
|
|
|
22
22
|
dispatch
|
|
23
23
|
} = _ref;
|
|
24
24
|
return next => async action => {
|
|
25
|
-
var _action$payload
|
|
26
|
-
if ((action === null || action === void 0 ? void 0 : action.type) === WebChatActionType.WEB_CHAT_SEND_MESSAGE && (action === null || action === void 0
|
|
25
|
+
var _action$payload;
|
|
26
|
+
if ((action === null || action === void 0 ? void 0 : action.type) === WebChatActionType.WEB_CHAT_SEND_MESSAGE && (action === null || action === void 0 || (_action$payload = action.payload) === null || _action$payload === void 0 || (_action$payload = _action$payload.attachments) === null || _action$payload === void 0 ? void 0 : _action$payload.length) > 0) {
|
|
27
27
|
const files = action.payload.attachments;
|
|
28
28
|
if (files.length === 1) {
|
|
29
29
|
return next(action);
|
|
@@ -17,9 +17,9 @@ const MBtoBRatio = 1000000;
|
|
|
17
17
|
* If the result attachment list is empty, return a dummy action
|
|
18
18
|
*/
|
|
19
19
|
const validateAttachment = (action, allowedFileExtensions, maxFileSizeSupportedByDynamics, localizedTexts) => {
|
|
20
|
-
var _action$payload, _action$
|
|
21
|
-
const attachments = action === null || action === void 0
|
|
22
|
-
const attachmentSizes = action === null || action === void 0
|
|
20
|
+
var _action$payload, _action$payload2, _action$payload3;
|
|
21
|
+
const attachments = action === null || action === void 0 || (_action$payload = action.payload) === null || _action$payload === void 0 || (_action$payload = _action$payload.activity) === null || _action$payload === void 0 ? void 0 : _action$payload.attachments;
|
|
22
|
+
const attachmentSizes = action === null || action === void 0 || (_action$payload2 = action.payload) === null || _action$payload2 === void 0 || (_action$payload2 = _action$payload2.activity) === null || _action$payload2 === void 0 || (_action$payload2 = _action$payload2.channelData) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.attachmentSizes;
|
|
23
23
|
if (!attachments || attachments.length === 0) {
|
|
24
24
|
return action;
|
|
25
25
|
}
|
|
@@ -39,7 +39,7 @@ const validateAttachment = (action, allowedFileExtensions, maxFileSizeSupportedB
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
if ((action === null || action === void 0
|
|
42
|
+
if ((action === null || action === void 0 || (_action$payload3 = action.payload) === null || _action$payload3 === void 0 || (_action$payload3 = _action$payload3.activity) === null || _action$payload3 === void 0 || (_action$payload3 = _action$payload3.attachments) === null || _action$payload3 === void 0 ? void 0 : _action$payload3.length) > 0) {
|
|
43
43
|
return action;
|
|
44
44
|
} else {
|
|
45
45
|
return {
|
|
@@ -195,11 +195,11 @@ const createAttachmentUploadValidatorMiddleware = (allowedFileExtensions, maxFil
|
|
|
195
195
|
} = _ref;
|
|
196
196
|
return next => action => {
|
|
197
197
|
if (action.type === WebChatActionType.DIRECT_LINE_POST_ACTIVITY) {
|
|
198
|
-
var _payload$activity, _payload$
|
|
198
|
+
var _payload$activity, _payload$activity2;
|
|
199
199
|
const {
|
|
200
200
|
payload
|
|
201
201
|
} = action;
|
|
202
|
-
if (payload !== null && payload !== void 0 && payload.activity.attachments && payload.activity.attachments.length > 0 && (payload === null || payload === void 0
|
|
202
|
+
if (payload !== null && payload !== void 0 && payload.activity.attachments && payload.activity.attachments.length > 0 && (payload === null || payload === void 0 || (_payload$activity = payload.activity) === null || _payload$activity === void 0 || (_payload$activity = _payload$activity.attachments) === null || _payload$activity === void 0 ? void 0 : _payload$activity.length) === (payload === null || payload === void 0 || (_payload$activity2 = payload.activity) === null || _payload$activity2 === void 0 || (_payload$activity2 = _payload$activity2.channelData) === null || _payload$activity2 === void 0 || (_payload$activity2 = _payload$activity2.attachmentSizes) === null || _payload$activity2 === void 0 ? void 0 : _payload$activity2.length)) {
|
|
203
203
|
return next(validateAttachment(action, allowedFileExtensions, maxFileSizeSupportedByDynamics, localizedTexts));
|
|
204
204
|
}
|
|
205
205
|
}
|
|
@@ -14,8 +14,8 @@ const channelDataMiddleware = addConversationalSurveyTagsCallback => _ref => {
|
|
|
14
14
|
dispatch
|
|
15
15
|
} = _ref;
|
|
16
16
|
return next => action => {
|
|
17
|
-
var _action, _action2
|
|
18
|
-
if (((_action = action) === null || _action === void 0 ? void 0 : _action.type) === WebChatActionType.DIRECT_LINE_POST_ACTIVITY_PENDING && (_action2 = action) !== null && _action2 !== void 0 && (_action2
|
|
17
|
+
var _action, _action2;
|
|
18
|
+
if (((_action = action) === null || _action === void 0 ? void 0 : _action.type) === WebChatActionType.DIRECT_LINE_POST_ACTIVITY_PENDING && (_action2 = action) !== null && _action2 !== void 0 && (_action2 = _action2.payload) !== null && _action2 !== void 0 && (_action2 = _action2.activity) !== null && _action2 !== void 0 && _action2.channelData) {
|
|
19
19
|
const channelIdTag = `${Constants.channelIdKey}${Constants.ChannelId}`;
|
|
20
20
|
const customerMessageTag = `${Constants.CustomerTag}`;
|
|
21
21
|
if (action.payload.activity.channelData.tags) {
|
|
@@ -13,7 +13,7 @@ export const createCitationsMiddleware = (state, dispatch) => () => next => acti
|
|
|
13
13
|
if ((_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
|
|
14
14
|
if (isApplicable(action)) {
|
|
15
15
|
try {
|
|
16
|
-
var _action$payload2,
|
|
16
|
+
var _action$payload2, _gptFeedback$summariz;
|
|
17
17
|
const inMemoryState = executeReducer(state, {
|
|
18
18
|
type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
19
19
|
payload: null
|
|
@@ -21,10 +21,10 @@ export const createCitationsMiddleware = (state, dispatch) => () => next => acti
|
|
|
21
21
|
|
|
22
22
|
// Use the producer-supplied messageid as a stable per-message prefix
|
|
23
23
|
// when present. Do not derive a prefix from activity.id or timestamps.
|
|
24
|
-
const messagePrefix = ((_action$payload2 = action.payload) === null || _action$payload2 === void 0
|
|
24
|
+
const messagePrefix = ((_action$payload2 = action.payload) === null || _action$payload2 === void 0 || (_action$payload2 = _action$payload2.activity) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.messageid) ?? "";
|
|
25
25
|
const gptFeedback = JSON.parse(action.payload.activity.channelData.metadata["pva:gpt-feedback"]);
|
|
26
26
|
// Extract citation objects from the model response
|
|
27
|
-
const citations = (_gptFeedback$summariz = gptFeedback.summarizationOpenAIResponse) === null || _gptFeedback$summariz === void 0
|
|
27
|
+
const citations = (_gptFeedback$summariz = gptFeedback.summarizationOpenAIResponse) === null || _gptFeedback$summariz === void 0 || (_gptFeedback$summariz = _gptFeedback$summariz.result) === null || _gptFeedback$summariz === void 0 ? void 0 : _gptFeedback$summariz.textCitations;
|
|
28
28
|
// Rewrite inline citation labels in activity.text to match the global map keys
|
|
29
29
|
const updatedText = replaceCitations(action.payload.activity.text, citations, messagePrefix);
|
|
30
30
|
|
|
@@ -51,7 +51,7 @@ export const createCitationsMiddleware = (state, dispatch) => () => next => acti
|
|
|
51
51
|
|
|
52
52
|
// Read current in-memory state to merge with existing citations
|
|
53
53
|
//const inMemoryState = executeReducer(state, { type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE, payload: null });
|
|
54
|
-
const existingCitations = (inMemoryState === null || inMemoryState === void 0
|
|
54
|
+
const existingCitations = (inMemoryState === null || inMemoryState === void 0 || (_inMemoryState$domain = inMemoryState.domainStates) === null || _inMemoryState$domain === void 0 ? void 0 : _inMemoryState$domain.citations) || {};
|
|
55
55
|
const updatedCitations = {
|
|
56
56
|
...existingCitations,
|
|
57
57
|
...citationMap
|
|
@@ -84,11 +84,11 @@ export const createCitationsMiddleware = (state, dispatch) => () => next => acti
|
|
|
84
84
|
return next(action);
|
|
85
85
|
};
|
|
86
86
|
const isApplicable = action => {
|
|
87
|
-
var _action$payload3, _action$
|
|
88
|
-
if ((action === null || action === void 0
|
|
89
|
-
var _action$payload5
|
|
87
|
+
var _action$payload3, _action$payload4;
|
|
88
|
+
if ((action === null || action === void 0 || (_action$payload3 = action.payload) === null || _action$payload3 === void 0 || (_action$payload3 = _action$payload3.activity) === null || _action$payload3 === void 0 ? void 0 : _action$payload3.actionType) === "DIRECT_LINE/INCOMING_ACTIVITY" && (action === null || action === void 0 || (_action$payload4 = action.payload) === null || _action$payload4 === void 0 || (_action$payload4 = _action$payload4.activity) === null || _action$payload4 === void 0 ? void 0 : _action$payload4.channelId) === "ACS_CHANNEL") {
|
|
89
|
+
var _action$payload5;
|
|
90
90
|
// Only applicable for ACS incoming activities that include pva:gpt-feedback
|
|
91
|
-
if (action !== null && action !== void 0 && (_action$payload5 = action.payload) !== null && _action$payload5 !== void 0 && (_action$payload5
|
|
91
|
+
if (action !== null && action !== void 0 && (_action$payload5 = action.payload) !== null && _action$payload5 !== void 0 && (_action$payload5 = _action$payload5.activity) !== null && _action$payload5 !== void 0 && (_action$payload5 = _action$payload5.channelData) !== null && _action$payload5 !== void 0 && (_action$payload5 = _action$payload5.metadata) !== null && _action$payload5 !== void 0 && _action$payload5["pva:gpt-feedback"]) {
|
|
92
92
|
return true;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -18,26 +18,26 @@ const createConversationEndMiddleware = (conversationEndCallback, startConversat
|
|
|
18
18
|
return next => action => {
|
|
19
19
|
var _action$payload;
|
|
20
20
|
if ((action === null || action === void 0 ? void 0 : action.type) == WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
|
|
21
|
-
var _activity$from2, _activity$
|
|
21
|
+
var _activity$from2, _activity$channelData9, _activity$channelData0;
|
|
22
22
|
const activity = action.payload.activity;
|
|
23
23
|
if (activity.channelId === "ACS_CHANNEL") {
|
|
24
24
|
var _activity$from;
|
|
25
25
|
if (((_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === DirectLineSenderRole.Bot) {
|
|
26
|
-
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4, _activity$channelData5, _activity$channelData6, _activity$channelData7, _activity$channelData8
|
|
27
|
-
if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$
|
|
26
|
+
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4, _activity$channelData5, _activity$channelData6, _activity$channelData7, _activity$channelData8;
|
|
27
|
+
if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData = _activity$channelData.tags) !== null && _activity$channelData !== void 0 && _activity$channelData.includes(Constants.systemMessageTag) && ((_activity$channelData2 = activity.channelData) !== null && _activity$channelData2 !== void 0 && (_activity$channelData2 = _activity$channelData2.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(Constants.agentEndConversationMessageTag) || (_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && (_activity$channelData3 = _activity$channelData3.tags) !== null && _activity$channelData3 !== void 0 && _activity$channelData3.includes(Constants.supervisorForceCloseMessageTag))) {
|
|
28
28
|
conversationEndCallback();
|
|
29
29
|
}
|
|
30
|
-
if ((_activity$
|
|
30
|
+
if ((_activity$channelData4 = activity.channelData) !== null && _activity$channelData4 !== void 0 && (_activity$channelData4 = _activity$channelData4.tags) !== null && _activity$channelData4 !== void 0 && _activity$channelData4.includes(Constants.systemMessageTag) && ((_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData5 = _activity$channelData5.tags) !== null && _activity$channelData5 !== void 0 && _activity$channelData5.includes(Constants.startConversationalSurveyMessageTag) || (_activity$channelData6 = activity.channelData) !== null && _activity$channelData6 !== void 0 && (_activity$channelData6 = _activity$channelData6.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(Constants.startConversationalSurveyMessageTag))) {
|
|
31
31
|
startConversationalSurveyCallback();
|
|
32
32
|
}
|
|
33
|
-
if ((_activity$
|
|
33
|
+
if ((_activity$channelData7 = activity.channelData) !== null && _activity$channelData7 !== void 0 && (_activity$channelData7 = _activity$channelData7.tags) !== null && _activity$channelData7 !== void 0 && _activity$channelData7.includes(Constants.systemMessageTag) && (_activity$channelData8 = activity.channelData) !== null && _activity$channelData8 !== void 0 && (_activity$channelData8 = _activity$channelData8.tags) !== null && _activity$channelData8 !== void 0 && _activity$channelData8.includes(Constants.endConversationalSurveyMessageTag)) {
|
|
34
34
|
endConversationalSurveyCallback();
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
} else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === DirectLineSenderRole.Channel && ((_activity$
|
|
38
|
-
var _activity$
|
|
37
|
+
} else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === DirectLineSenderRole.Channel && ((_activity$channelData9 = activity.channelData) === null || _activity$channelData9 === void 0 ? void 0 : _activity$channelData9.type) === MessageTypes.Thread && (_activity$channelData0 = activity.channelData) !== null && _activity$channelData0 !== void 0 && _activity$channelData0.properties) {
|
|
38
|
+
var _activity$channelData1, _activity$channelData10;
|
|
39
39
|
// IC3
|
|
40
|
-
if (((_activity$
|
|
40
|
+
if (((_activity$channelData1 = activity.channelData) === null || _activity$channelData1 === void 0 || (_activity$channelData1 = _activity$channelData1.properties) === null || _activity$channelData1 === void 0 ? void 0 : _activity$channelData1.isdeleted) === Constants.truePascal || !((_activity$channelData10 = activity.channelData) !== null && _activity$channelData10 !== void 0 && (_activity$channelData10 = _activity$channelData10.properties) !== null && _activity$channelData10 !== void 0 && _activity$channelData10.containsExternalEntitiesListeningAll)) {
|
|
41
41
|
conversationEndCallback();
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
import { Constants } from "../../../../../common/Constants";
|
|
9
9
|
import { WebChatActionType } from "../../enums/WebChatActionType";
|
|
10
10
|
export const isValidCustomEvent = activity => {
|
|
11
|
-
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$
|
|
12
|
-
return !!(activity !== null && activity !== void 0 && (_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$
|
|
11
|
+
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$from, _activity$channelData4, _activity$channelData5;
|
|
12
|
+
return !!(activity !== null && activity !== void 0 && (_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData = _activity$channelData.metadata) !== null && _activity$channelData !== void 0 && _activity$channelData.customEvent && typeof (activity === null || activity === void 0 || (_activity$channelData2 = activity.channelData) === null || _activity$channelData2 === void 0 || (_activity$channelData2 = _activity$channelData2.metadata) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.customEvent) === Constants.String && (activity === null || activity === void 0 || (_activity$channelData3 = activity.channelData) === null || _activity$channelData3 === void 0 || (_activity$channelData3 = _activity$channelData3.metadata) === null || _activity$channelData3 === void 0 || (_activity$channelData3 = _activity$channelData3.customEvent) === null || _activity$channelData3 === void 0 ? void 0 : _activity$channelData3.toLowerCase()) === Constants.true && (activity === null || activity === void 0 || (_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) !== Constants.userMessageTag && typeof (activity === null || activity === void 0 || (_activity$channelData4 = activity.channelData) === null || _activity$channelData4 === void 0 || (_activity$channelData4 = _activity$channelData4.metadata) === null || _activity$channelData4 === void 0 ? void 0 : _activity$channelData4.customEventName) === Constants.String && activity !== null && activity !== void 0 && (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData5 = _activity$channelData5.metadata) !== null && _activity$channelData5 !== void 0 && _activity$channelData5.customEventValue);
|
|
13
13
|
};
|
|
14
14
|
const createCustomEventMiddleware = broadcastservice => () => next => action => {
|
|
15
15
|
var _action$payload;
|
|
@@ -14,16 +14,16 @@ const gifUploadMiddleware = _ref => {
|
|
|
14
14
|
} = _ref;
|
|
15
15
|
return next => action => {
|
|
16
16
|
if (action.type === WebChatActionType.DIRECT_LINE_POST_ACTIVITY) {
|
|
17
|
-
var _activity$attachments, _activity$channelData
|
|
17
|
+
var _activity$attachments, _activity$channelData;
|
|
18
18
|
const {
|
|
19
19
|
payload: {
|
|
20
20
|
activity
|
|
21
21
|
}
|
|
22
22
|
} = action;
|
|
23
|
-
if ((activity === null || activity === void 0
|
|
23
|
+
if ((activity === null || activity === void 0 || (_activity$attachments = activity.attachments) === null || _activity$attachments === void 0 ? void 0 : _activity$attachments.length) === (activity === null || activity === void 0 || (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 || (_activity$channelData = _activity$channelData.attachmentSizes) === null || _activity$channelData === void 0 ? void 0 : _activity$channelData.length)) {
|
|
24
24
|
var _activity$attachments2;
|
|
25
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
-
activity === null || activity === void 0
|
|
26
|
+
activity === null || activity === void 0 || (_activity$attachments2 = activity.attachments) === null || _activity$attachments2 === void 0 || _activity$attachments2.forEach(attachment => {
|
|
27
27
|
const {
|
|
28
28
|
thumbnailUrl,
|
|
29
29
|
contentUrl,
|
|
@@ -29,8 +29,8 @@ const htmlPlayerMiddleware = _ref => {
|
|
|
29
29
|
dispatch
|
|
30
30
|
} = _ref;
|
|
31
31
|
return next => action => {
|
|
32
|
-
var _action$payload
|
|
33
|
-
if (action.type === WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && ((_action$payload = action.payload) === null || _action$payload === void 0
|
|
32
|
+
var _action$payload;
|
|
33
|
+
if (action.type === WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && ((_action$payload = action.payload) === null || _action$payload === void 0 || (_action$payload = _action$payload.activity) === null || _action$payload === void 0 || (_action$payload = _action$payload.attachments) === null || _action$payload === void 0 ? void 0 : _action$payload.length) > 0) {
|
|
34
34
|
disableHTMLPlayerDownloadButton(Constants.video);
|
|
35
35
|
disableHTMLPlayerDownloadButton(Constants.audio);
|
|
36
36
|
}
|
|
@@ -98,8 +98,8 @@ const htmlTextMiddleware = honorsTargetInHTMLLinks => _ref => {
|
|
|
98
98
|
return next => action => {
|
|
99
99
|
if (action.type === WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY) {
|
|
100
100
|
try {
|
|
101
|
-
var _action$payload
|
|
102
|
-
const text = (_action$payload = action.payload) === null || _action$payload === void 0
|
|
101
|
+
var _action$payload;
|
|
102
|
+
const text = (_action$payload = action.payload) === null || _action$payload === void 0 || (_action$payload = _action$payload.activity) === null || _action$payload === void 0 ? void 0 : _action$payload.text;
|
|
103
103
|
if (text) {
|
|
104
104
|
action = processHTMLText(action, text, honorsTargetInHTMLLinks ?? false);
|
|
105
105
|
}
|
|
@@ -17,21 +17,20 @@ export const localizedStringsBotInitialsMiddleware = onInitialsChange => _ref =>
|
|
|
17
17
|
if (onInitialsChange && !externalInitialsUpdater) {
|
|
18
18
|
externalInitialsUpdater = onInitialsChange; // capture once
|
|
19
19
|
}
|
|
20
|
-
|
|
21
20
|
if (action.type === WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY) {
|
|
22
21
|
var _action$payload, _activity$from;
|
|
23
22
|
const activity = (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.activity;
|
|
24
23
|
if (activity !== null && activity !== void 0 && (_activity$from = activity.from) !== null && _activity$from !== void 0 && _activity$from.name && activity.from.role !== Constants.userMessageTag && activity.from.name !== Constants.userMessageTag) {
|
|
25
|
-
var _activity$channelData, _activity$
|
|
24
|
+
var _activity$channelData, _activity$tags;
|
|
26
25
|
const agentName = activity.from.name.trim();
|
|
27
|
-
const isSystemMessage = agentName === "__agent__" || agentName.startsWith("__") || ((_activity$channelData = activity.channelData) === null || _activity$channelData === void 0
|
|
26
|
+
const isSystemMessage = agentName === "__agent__" || agentName.startsWith("__") || ((_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 || (_activity$channelData = _activity$channelData.tags) === null || _activity$channelData === void 0 ? void 0 : _activity$channelData.includes(Constants.systemMessageTag)) || ((_activity$tags = activity.tags) === null || _activity$tags === void 0 ? void 0 : _activity$tags.includes(Constants.systemMessageTag));
|
|
28
27
|
if (!isSystemMessage && agentName) {
|
|
29
28
|
const newInitials = getIconText(agentName) || currentAgentInitials;
|
|
30
29
|
if (newInitials !== currentAgentInitials) {
|
|
31
30
|
var _externalInitialsUpda;
|
|
32
31
|
currentAgentInitials = newInitials;
|
|
33
32
|
// Notify external React context if provided
|
|
34
|
-
(_externalInitialsUpda = externalInitialsUpdater) === null || _externalInitialsUpda === void 0
|
|
33
|
+
(_externalInitialsUpda = externalInitialsUpdater) === null || _externalInitialsUpda === void 0 || _externalInitialsUpda(currentAgentInitials || "");
|
|
35
34
|
// Broadcast (optional) for multi-tab sync without forcing consumers
|
|
36
35
|
BroadcastService.postMessage({
|
|
37
36
|
eventName: "BotAvatarInitialsUpdated",
|
|
@@ -16,8 +16,8 @@ const createMaxMessageSizeValidator = localizedTexts => _ref => {
|
|
|
16
16
|
} = _ref;
|
|
17
17
|
return next => action => {
|
|
18
18
|
if (action.type === WebChatActionType.WEB_CHAT_SET_SEND_BOX) {
|
|
19
|
-
var _action$payload
|
|
20
|
-
const textLength = ((_action$payload = action.payload) === null || _action$payload === void 0
|
|
19
|
+
var _action$payload;
|
|
20
|
+
const textLength = ((_action$payload = action.payload) === null || _action$payload === void 0 || (_action$payload = _action$payload.text) === null || _action$payload === void 0 ? void 0 : _action$payload.length) || 0;
|
|
21
21
|
if (textLength > WebChatMiddlewareConstants.maxTextLength) {
|
|
22
22
|
NotificationHandler.notifyError(NotificationScenarios.MaxSizeError, localizedTexts.MIDDLEWARE_MAX_CHARACTER_COUNT_EXCEEDED);
|
|
23
23
|
return next(action);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
function _classCallCheck(
|
|
2
|
-
function _defineProperties(
|
|
3
|
-
function _createClass(
|
|
4
|
-
function _toPropertyKey(
|
|
5
|
-
function _toPrimitive(
|
|
1
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
2
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
3
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
import { HtmlClassNames, HtmlIdNames } from "../../../../common/Constants";
|
|
7
7
|
import { NotificationLevel } from "../enums/NotificationLevel";
|
|
8
8
|
import { WebChatActionType } from "../enums/WebChatActionType";
|
|
@@ -14,7 +14,7 @@ export let NotificationHandler = /*#__PURE__*/function () {
|
|
|
14
14
|
function NotificationHandler() {
|
|
15
15
|
_classCallCheck(this, NotificationHandler);
|
|
16
16
|
}
|
|
17
|
-
_createClass(NotificationHandler, null, [{
|
|
17
|
+
return _createClass(NotificationHandler, null, [{
|
|
18
18
|
key: "notify",
|
|
19
19
|
value: function notify(id, level, message) {
|
|
20
20
|
if (WebChatStoreLoader.store) {
|
|
@@ -101,5 +101,4 @@ export let NotificationHandler = /*#__PURE__*/function () {
|
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
}]);
|
|
104
|
-
return NotificationHandler;
|
|
105
104
|
}();
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export let ConversationState
|
|
2
|
-
(function (ConversationState) {
|
|
1
|
+
export let ConversationState = /*#__PURE__*/function (ConversationState) {
|
|
3
2
|
ConversationState[ConversationState["Prechat"] = 0] = "Prechat";
|
|
4
3
|
ConversationState[ConversationState["Loading"] = 1] = "Loading";
|
|
5
4
|
ConversationState[ConversationState["ReconnectChat"] = 2] = "ReconnectChat";
|
|
@@ -11,4 +10,5 @@ export let ConversationState;
|
|
|
11
10
|
ConversationState[ConversationState["Postchat"] = 8] = "Postchat";
|
|
12
11
|
ConversationState[ConversationState["Closed"] = 9] = "Closed";
|
|
13
12
|
ConversationState[ConversationState["Error"] = 10] = "Error";
|
|
14
|
-
|
|
13
|
+
return ConversationState;
|
|
14
|
+
}({});
|