@microsoft/omnichannel-chat-widget 1.8.4-main.7bdb634 → 1.8.4-main.cbab5fc
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/README.md +27 -0
- package/lib/cjs/common/Constants.js +3 -0
- package/lib/cjs/common/telemetry/AppInsightsEvents.js +14 -9
- package/lib/cjs/common/telemetry/TelemetryConstants.js +15 -2
- package/lib/cjs/common/telemetry/TelemetryManager.js +10 -7
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +26 -10
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +16 -4
- package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +20 -1
- package/lib/cjs/components/headerstateful/HeaderStateful.js +8 -2
- package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +1 -1
- package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +26 -20
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +1 -2
- package/lib/cjs/components/livechatwidget/common/endChat.js +26 -9
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +9 -2
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
- package/lib/cjs/components/livechatwidget/common/startChat.js +5 -1
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +24 -4
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +123 -28
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +31 -4
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +12 -3
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +30 -29
- package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +8 -2
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -3
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +6 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +30 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +21 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +7 -1
- package/lib/cjs/contexts/createReducer.js +15 -0
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
- package/lib/cjs/plugins/newMessageEventHandler.js +4 -1
- package/lib/esm/common/Constants.js +3 -0
- package/lib/esm/common/telemetry/AppInsightsEvents.js +14 -9
- package/lib/esm/common/telemetry/TelemetryConstants.js +13 -1
- package/lib/esm/common/telemetry/TelemetryManager.js +10 -7
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +27 -11
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +17 -5
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +20 -1
- package/lib/esm/components/headerstateful/HeaderStateful.js +9 -3
- package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +1 -1
- package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +26 -20
- package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +1 -2
- package/lib/esm/components/livechatwidget/common/endChat.js +26 -9
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +9 -2
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
- package/lib/esm/components/livechatwidget/common/startChat.js +7 -3
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +23 -4
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +124 -29
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +33 -6
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -4
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +30 -32
- package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +8 -2
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -3
- package/lib/esm/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +6 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +30 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +21 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +7 -1
- package/lib/esm/contexts/createReducer.js +15 -0
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
- package/lib/esm/plugins/newMessageEventHandler.js +4 -1
- package/lib/types/common/Constants.d.ts +3 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +12 -1
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +1 -0
- package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/IPersistentChatHistoryProps.d.ts +5 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.d.ts +15 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +1 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +5 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
- package/package.json +2 -2
|
@@ -62,7 +62,7 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
64
|
const WebChatContainerStateful = props => {
|
|
65
|
-
var _props$webChatContain, _defaultWebChatContai, _extendedChatConfig$L,
|
|
65
|
+
var _props$webChatContain, _defaultWebChatContai, _extendedChatConfig$L, _extendedChatConfig$L2, _extendedChatConfig$L3, _extendedChatConfig$L4, _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _props$webChatContain6, _props$webChatContain7, _defaultWebChatContai2, _props$webChatContain8, _props$webChatContain9, _defaultWebChatContai3, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _webChatContainerProp17, _webChatContainerProp18, _webChatContainerProp19, _webChatContainerProp20, _webChatContainerProp21, _webChatContainerProp22, _webChatContainerProp23, _webChatContainerProp24, _props$webChatContain10, _props$webChatContain11, _webChatContainerProp25, _webChatContainerProp26, _webChatContainerProp27, _webChatContainerProp28, _props$citationPanePr, _props$citationPanePr2, _props$citationPanePr3, _props$citationPanePr4, _props$citationPanePr5;
|
|
66
66
|
const [facadeChatSDK] = (0, _useFacadeChatSDKStore.default)();
|
|
67
67
|
|
|
68
68
|
// Create a font family that includes emoji support, based on the primary font or default
|
|
@@ -96,17 +96,16 @@ const WebChatContainerStateful = props => {
|
|
|
96
96
|
|
|
97
97
|
// Type the chatConfig properly to avoid 'any' usage
|
|
98
98
|
const extendedChatConfig = props.chatConfig;
|
|
99
|
-
const isHistoryEnabledInConfig = extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L = extendedChatConfig.
|
|
100
|
-
const
|
|
101
|
-
const isPersistentChatEnabledForWidget = !!(extendedChatConfig !== null && extendedChatConfig !== void 0 && (_extendedChatConfig$
|
|
102
|
-
|
|
103
|
-
// Persistent chat history is enabled if explicitly set via props, or if enabled in config
|
|
104
|
-
// Props take precedence over config settings
|
|
105
|
-
const isPersistentHistoryEnabled = isHistoryEnabledViaProps || isHistoryEnabledInConfig;
|
|
99
|
+
const isHistoryEnabledInConfig = extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L = extendedChatConfig.LiveWSAndLiveChatEngJoin) === null || _extendedChatConfig$L === void 0 ? void 0 : _extendedChatConfig$L.msdyn_enablepersistentchatpreviousconversations;
|
|
100
|
+
const isHistoryEnabledViaFCB = extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L2 = extendedChatConfig.LcwFcbConfiguration) === null || _extendedChatConfig$L2 === void 0 ? void 0 : _extendedChatConfig$L2.lcwPersistentChatHistoryEnabled;
|
|
101
|
+
const isPersistentChatEnabledForWidget = !!(extendedChatConfig !== null && extendedChatConfig !== void 0 && (_extendedChatConfig$L3 = extendedChatConfig.LiveChatConfigAuthSettings) !== null && _extendedChatConfig$L3 !== void 0 && _extendedChatConfig$L3.msdyn_javascriptclientfunction) || (0, _liveChatConfigUtils.isPersistentChatEnabled)(extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L4 = extendedChatConfig.LiveWSAndLiveChatEngJoin) === null || _extendedChatConfig$L4 === void 0 ? void 0 : _extendedChatConfig$L4.msdyn_conversationmode);
|
|
106
102
|
|
|
107
103
|
// Check if both persistent chat and widget support are enabled
|
|
108
|
-
const shouldLoadPersistentHistoryMessages =
|
|
104
|
+
const shouldLoadPersistentHistoryMessages = isHistoryEnabledInConfig && isHistoryEnabledViaFCB && isPersistentChatEnabledForWidget;
|
|
109
105
|
if (shouldLoadPersistentHistoryMessages) {
|
|
106
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
107
|
+
Event: _TelemetryConstants.TelemetryEvent.PersistentChatHistoryEnabled
|
|
108
|
+
});
|
|
110
109
|
(0, _usePersistentChatHistory.default)(facadeChatSDK, (props === null || props === void 0 ? void 0 : props.persistentChatHistoryProps) ?? {});
|
|
111
110
|
}
|
|
112
111
|
// Delegated click handler for citation anchors. Placed after state is
|
|
@@ -271,24 +270,28 @@ const WebChatContainerStateful = props => {
|
|
|
271
270
|
background: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp === void 0 ? void 0 : _webChatContainerProp.background) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.background};
|
|
272
271
|
}
|
|
273
272
|
|
|
274
|
-
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card .ac-textBlock {
|
|
275
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp2 === void 0 ? void 0 : _webChatContainerProp2.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color};
|
|
273
|
+
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card .ac-textBlock[role=heading] {
|
|
274
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp2 === void 0 ? void 0 : _webChatContainerProp2.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color} !important;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card label .ac-textRun:first-child {
|
|
278
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp3 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp3 === void 0 ? void 0 : _webChatContainerProp3.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color} !important;
|
|
276
279
|
}
|
|
277
280
|
|
|
278
281
|
.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__bubble--from-user {
|
|
279
|
-
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
282
|
+
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp4 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp4 === void 0 ? void 0 : (_webChatContainerProp5 = _webChatContainerProp4.userMessageBoxStyles) === null || _webChatContainerProp5 === void 0 ? void 0 : _webChatContainerProp5.maxWidth) ?? (_defaultUserMessageBoxStyles.defaultUserMessageBoxStyles === null || _defaultUserMessageBoxStyles.defaultUserMessageBoxStyles === void 0 ? void 0 : _defaultUserMessageBoxStyles.defaultUserMessageBoxStyles.maxWidth)}
|
|
280
283
|
}
|
|
281
284
|
|
|
282
285
|
.webchat__stacked-layout--show-avatar div.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__stacked-layout__message {
|
|
283
|
-
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
286
|
+
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp6 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp6 === void 0 ? void 0 : (_webChatContainerProp7 = _webChatContainerProp6.systemMessageBoxStyles) === null || _webChatContainerProp7 === void 0 ? void 0 : _webChatContainerProp7.maxWidth) ?? (_defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles === null || _defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles === void 0 ? void 0 : _defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles.maxWidth)}
|
|
284
287
|
}
|
|
285
288
|
|
|
286
289
|
div[class="ac-textBlock"] *,
|
|
287
|
-
div[class="ac-input-container"] * {white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
290
|
+
div[class="ac-input-container"] * {white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.textWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.textWhiteSpace}}
|
|
288
291
|
|
|
289
292
|
div[class="ac-input-container"] input.ac-multichoiceInput,
|
|
290
293
|
div[class="ac-input-container"] select.ac-multichoiceInput {
|
|
291
|
-
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (
|
|
294
|
+
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (_webChatContainerProp9 = webChatContainerProps.adaptiveCardStyles) !== null && _webChatContainerProp9 !== void 0 && _webChatContainerProp9.choiceInputPadding ? `padding: ${webChatContainerProps.adaptiveCardStyles.choiceInputPadding} !important;` : ""}
|
|
292
295
|
}
|
|
293
296
|
|
|
294
297
|
.ms_lcw_webchat_received_message>div.webchat__stacked-layout>div.webchat__stacked-layout__main>div.webchat__stacked-layout__content>div.webchat__stacked-layout__message-row>[class^=webchat]:not(.webchat__bubble--from-user)>.webchat__bubble__content {
|
|
@@ -300,15 +303,15 @@ const WebChatContainerStateful = props => {
|
|
|
300
303
|
div[class="ac-textBlock"] a:visited,
|
|
301
304
|
div[class="ac-textBlock"] a:hover,
|
|
302
305
|
div[class="ac-textBlock"] a:active {
|
|
303
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
306
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp10 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp10 === void 0 ? void 0 : _webChatContainerProp10.anchorColor) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.anchorColor};
|
|
304
307
|
}
|
|
305
308
|
|
|
306
|
-
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
309
|
+
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp11 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp11 === void 0 ? void 0 : _webChatContainerProp11.buttonWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
|
|
307
310
|
|
|
308
311
|
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
309
312
|
/* Fallback for browsers that don't support mask */
|
|
310
313
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjRkZGRkZGIiAvPjwvc3ZnPg==);
|
|
311
|
-
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
314
|
+
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp12 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp12 === void 0 ? void 0 : (_webChatContainerProp13 = _webChatContainerProp12.receivedMessageAnchorStyles) === null || _webChatContainerProp13 === void 0 ? void 0 : _webChatContainerProp13.filter) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.filter)};
|
|
312
315
|
height: .75em;
|
|
313
316
|
width: .75em;
|
|
314
317
|
margin-left: .25em;
|
|
@@ -318,7 +321,7 @@ const WebChatContainerStateful = props => {
|
|
|
318
321
|
.ms_lcw_webchat_sent_message img.webchat__render-markdown__external-link-icon {
|
|
319
322
|
/* Fallback for browsers that don't support mask */
|
|
320
323
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjRkZGRkZGIiAvPjwvc3ZnPg==);
|
|
321
|
-
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
324
|
+
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp14 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp14 === void 0 ? void 0 : (_webChatContainerProp15 = _webChatContainerProp14.sentMessageAnchorStyles) === null || _webChatContainerProp15 === void 0 ? void 0 : _webChatContainerProp15.filter) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.filter)};
|
|
322
325
|
height: .75em;
|
|
323
326
|
width: .75em;
|
|
324
327
|
margin-left: .25em;
|
|
@@ -328,7 +331,7 @@ const WebChatContainerStateful = props => {
|
|
|
328
331
|
/* Modern browsers with mask support */
|
|
329
332
|
@supports (mask: url()) or (-webkit-mask: url()) {
|
|
330
333
|
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
331
|
-
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
334
|
+
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp16 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp16 === void 0 ? void 0 : (_webChatContainerProp17 = _webChatContainerProp16.receivedMessageAnchorStyles) === null || _webChatContainerProp17 === void 0 ? void 0 : _webChatContainerProp17.color) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.color)} !important;
|
|
332
335
|
background-image: none !important;
|
|
333
336
|
filter: none !important;
|
|
334
337
|
mask: url("data:image/svg+xml,%3Csvg viewBox='3 3 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.2501 4.50017H10.7495C11.1637 4.50017 11.4995 4.83596 11.4995 5.25017C11.4995 5.62986 11.2173 5.94366 10.8513 5.99332L10.7495 6.00017H7.24974C6.07079 5.99961 5.10349 6.90656 5.00786 8.06112L5.00028 8.22003L5.00312 16.7507C5.00343 17.9415 5.92885 18.9161 7.09966 18.9949L7.25371 19.0001L15.7518 18.9884C16.9415 18.9868 17.9145 18.062 17.9935 16.8923L17.9987 16.7384V13.2321C17.9987 12.8179 18.3345 12.4821 18.7487 12.4821C19.1284 12.4821 19.4422 12.7643 19.4918 13.1303L19.4987 13.2321V16.7384C19.4987 18.7407 17.9293 20.3769 15.9528 20.4829L15.7538 20.4884L7.25827 20.5001L7.05495 20.4949C5.14239 20.3954 3.60895 18.8627 3.50837 16.9502L3.50312 16.7511L3.50089 8.2527L3.50529 8.0502C3.60539 6.13749 5.13867 4.60449 7.05096 4.50527L7.2501 4.50017H10.7495H7.2501ZM13.7481 3.00146L20.3018 3.00197L20.4014 3.01575L20.5022 3.04393L20.559 3.06803C20.6122 3.09122 20.6634 3.12163 20.7111 3.15885L20.7804 3.22156L20.8641 3.32014L20.9183 3.41025L20.957 3.50057L20.9762 3.56476L20.9898 3.62862L20.9992 3.72282L20.9997 10.2554C20.9997 10.6696 20.6639 11.0054 20.2497 11.0054C19.87 11.0054 19.5562 10.7232 19.5065 10.3571L19.4997 10.2554L19.4989 5.56147L12.2797 12.7847C12.0134 13.051 11.5968 13.0753 11.3031 12.8575L11.219 12.7849C10.9527 12.5187 10.9284 12.1021 11.1462 11.8084L11.2188 11.7243L18.4369 4.50146H13.7481C13.3684 4.50146 13.0546 4.21931 13.005 3.85324L12.9981 3.75146C12.9981 3.37177 13.2803 3.05797 13.6464 3.00831L13.7481 3.00146Z' fill='currentColor' /%3E%3C/svg%3E") no-repeat center;
|
|
@@ -338,7 +341,7 @@ const WebChatContainerStateful = props => {
|
|
|
338
341
|
}
|
|
339
342
|
|
|
340
343
|
.ms_lcw_webchat_sent_message img.webchat__render-markdown__external-link-icon {
|
|
341
|
-
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
344
|
+
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp18 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp18 === void 0 ? void 0 : (_webChatContainerProp19 = _webChatContainerProp18.sentMessageAnchorStyles) === null || _webChatContainerProp19 === void 0 ? void 0 : _webChatContainerProp19.color) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.color)} !important;
|
|
342
345
|
background-image: none !important;
|
|
343
346
|
filter: none !important;
|
|
344
347
|
mask: url("data:image/svg+xml,%3Csvg viewBox='3 3 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.2501 4.50017H10.7495C11.1637 4.50017 11.4995 4.83596 11.4995 5.25017C11.4995 5.62986 11.2173 5.94366 10.8513 5.99332L10.7495 6.00017H7.24974C6.07079 5.99961 5.10349 6.90656 5.00786 8.06112L5.00028 8.22003L5.00312 16.7507C5.00343 17.9415 5.92885 18.9161 7.09966 18.9949L7.25371 19.0001L15.7518 18.9884C16.9415 18.9868 17.9145 18.062 17.9935 16.8923L17.9987 16.7384V13.2321C17.9987 12.8179 18.3345 12.4821 18.7487 12.4821C19.1284 12.4821 19.4422 12.7643 19.4918 13.1303L19.4987 13.2321V16.7384C19.4987 18.7407 17.9293 20.3769 15.9528 20.4829L15.7538 20.4884L7.25827 20.5001L7.05495 20.4949C5.14239 20.3954 3.60895 18.8627 3.50837 16.9502L3.50312 16.7511L3.50089 8.2527L3.50529 8.0502C3.60539 6.13749 5.13867 4.60449 7.05096 4.50527L7.2501 4.50017H10.7495H7.2501ZM13.7481 3.00146L20.3018 3.00197L20.4014 3.01575L20.5022 3.04393L20.559 3.06803C20.6122 3.09122 20.6634 3.12163 20.7111 3.15885L20.7804 3.22156L20.8641 3.32014L20.9183 3.41025L20.957 3.50057L20.9762 3.56476L20.9898 3.62862L20.9992 3.72282L20.9997 10.2554C20.9997 10.6696 20.6639 11.0054 20.2497 11.0054C19.87 11.0054 19.5562 10.7232 19.5065 10.3571L19.4997 10.2554L19.4989 5.56147L12.2797 12.7847C12.0134 13.051 11.5968 13.0753 11.3031 12.8575L11.219 12.7849C10.9527 12.5187 10.9284 12.1021 11.1462 11.8084L11.2188 11.7243L18.4369 4.50146H13.7481C13.3684 4.50146 13.0546 4.21931 13.005 3.85324L12.9981 3.75146C12.9981 3.37177 13.2803 3.05797 13.6464 3.00831L13.7481 3.00146Z' fill='currentColor' /%3E%3C/svg%3E") no-repeat center;
|
|
@@ -356,18 +359,18 @@ const WebChatContainerStateful = props => {
|
|
|
356
359
|
.ms_lcw_webchat_received_message a:visited,
|
|
357
360
|
.ms_lcw_webchat_received_message a:hover,
|
|
358
361
|
.ms_lcw_webchat_received_message a:active {
|
|
359
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
362
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp20 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp20 === void 0 ? void 0 : (_webChatContainerProp21 = _webChatContainerProp20.receivedMessageAnchorStyles) === null || _webChatContainerProp21 === void 0 ? void 0 : _webChatContainerProp21.color) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.color)};
|
|
360
363
|
}
|
|
361
364
|
.ms_lcw_webchat_sent_message a:link,
|
|
362
365
|
.ms_lcw_webchat_sent_message a:visited,
|
|
363
366
|
.ms_lcw_webchat_sent_message a:hover,
|
|
364
367
|
.ms_lcw_webchat_sent_message a:active {
|
|
365
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
368
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp22 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp22 === void 0 ? void 0 : (_webChatContainerProp23 = _webChatContainerProp22.sentMessageAnchorStyles) === null || _webChatContainerProp23 === void 0 ? void 0 : _webChatContainerProp23.color) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.color)};
|
|
366
369
|
}
|
|
367
370
|
|
|
368
371
|
// we had a nasty bug long time ago with crashing borders messing with the sendbox, so if customer adds this value, they need to deal with that
|
|
369
372
|
.webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content {
|
|
370
|
-
border-radius: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
373
|
+
border-radius: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp24 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp24 === void 0 ? void 0 : _webChatContainerProp24.bubbleBorderRadius) ?? 0} !important; /* Override border-radius */
|
|
371
374
|
}
|
|
372
375
|
|
|
373
376
|
.webchat__stacked-layout_container>div {
|
|
@@ -404,8 +407,8 @@ const WebChatContainerStateful = props => {
|
|
|
404
407
|
|
|
405
408
|
/* Suggested actions carousel previous/next navigation focus */
|
|
406
409
|
.webchat__suggested-actions .webchat__suggested-actions__carousel .react-film__flipper:focus-visible .react-film__flipper__body {
|
|
407
|
-
outline: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
408
|
-
outline-offset: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
410
|
+
outline: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp25 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp25 === void 0 ? void 0 : _webChatContainerProp25.suggestedActionKeyboardFocusIndicatorBorderStyle) ?? "dashed"} ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp26 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp26 === void 0 ? void 0 : _webChatContainerProp26.suggestedActionKeyboardFocusIndicatorBorderWidth) ?? "1px"} ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp27 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp27 === void 0 ? void 0 : _webChatContainerProp27.suggestedActionKeyboardFocusIndicatorBorderColor) ?? "#605E5C"} !important;
|
|
411
|
+
outline-offset: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp28 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp28 === void 0 ? void 0 : _webChatContainerProp28.suggestedActionKeyboardFocusIndicatorInset) ?? "2px"} !important;
|
|
409
412
|
|
|
410
413
|
`), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
411
414
|
styles: containerStyles,
|
|
@@ -416,9 +419,7 @@ const WebChatContainerStateful = props => {
|
|
|
416
419
|
height: "100%",
|
|
417
420
|
width: "100%"
|
|
418
421
|
}
|
|
419
|
-
}, shouldLoadPersistentHistoryMessages && /*#__PURE__*/_react2.default.createElement(_WebChatEventSubscribers.default, {
|
|
420
|
-
persistentChatHistoryEnabled: props === null || props === void 0 ? void 0 : (_props$persistentChat2 = props.persistentChatHistoryProps) === null || _props$persistentChat2 === void 0 ? void 0 : _props$persistentChat2.persistentChatHistoryEnabled
|
|
421
|
-
}), /*#__PURE__*/_react2.default.createElement(BasicWebChat, null))), citationPaneOpen && /*#__PURE__*/_react2.default.createElement(_CitationPaneStateful.default, {
|
|
422
|
+
}, shouldLoadPersistentHistoryMessages && /*#__PURE__*/_react2.default.createElement(_WebChatEventSubscribers.default, null), /*#__PURE__*/_react2.default.createElement(BasicWebChat, null))), citationPaneOpen && /*#__PURE__*/_react2.default.createElement(_CitationPaneStateful.default, {
|
|
422
423
|
id: ((_props$citationPanePr = props.citationPaneProps) === null || _props$citationPanePr === void 0 ? void 0 : _props$citationPanePr.id) || _Constants.HtmlAttributeNames.ocwCitationPaneClassName,
|
|
423
424
|
title: ((_props$citationPanePr2 = props.citationPaneProps) === null || _props$citationPanePr2 === void 0 ? void 0 : _props$citationPanePr2.title) || _Constants.HtmlAttributeNames.ocwCitationPaneTitle,
|
|
424
425
|
contentHtml: citationPaneText,
|
|
@@ -62,11 +62,17 @@ const convertPersistentChatHistoryMessageToActivity = message => {
|
|
|
62
62
|
}
|
|
63
63
|
if (tags) {
|
|
64
64
|
const formattedTags = additionalData.tags.split(",");
|
|
65
|
-
activity.channelData
|
|
65
|
+
activity.channelData = {
|
|
66
|
+
...activity.channelData,
|
|
67
|
+
tags: [...activity.channelData.tags, ...formattedTags]
|
|
68
|
+
};
|
|
66
69
|
}
|
|
67
70
|
}
|
|
68
71
|
if (from !== null && from !== void 0 && (_from$user = from.user) !== null && _from$user !== void 0 && _from$user.displayName) {
|
|
69
|
-
activity.from
|
|
72
|
+
activity.from = {
|
|
73
|
+
...activity.from,
|
|
74
|
+
name: from.user.displayName
|
|
75
|
+
};
|
|
70
76
|
}
|
|
71
77
|
if ((from === null || from === void 0 ? void 0 : (_from$application = from.application) === null || _from$application === void 0 ? void 0 : _from$application.displayName) === "Customer") {
|
|
72
78
|
activity.from = {
|
|
@@ -35,6 +35,7 @@ const defaultMiddlewareLocalizedTexts = {
|
|
|
35
35
|
MIDDLEWARE_BANNER_FILE_IS_MALICIOUS: "{0} has been blocked because the file may contain a malware.",
|
|
36
36
|
MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_SUCCESS: "Email will be sent after chat ends!",
|
|
37
37
|
MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_ERROR: "Email {0} could not be saved, try again later.",
|
|
38
|
-
PREVIOUS_MESSAGES_LOADING: "Loading previous messages..."
|
|
38
|
+
PREVIOUS_MESSAGES_LOADING: "Loading previous messages...",
|
|
39
|
+
CONVERSATION_DIVIDER_ARIA_LABEL: "Conversation history divider"
|
|
39
40
|
};
|
|
40
41
|
exports.defaultMiddlewareLocalizedTexts = defaultMiddlewareLocalizedTexts;
|
|
@@ -8,9 +8,8 @@ var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants"
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _ChatWidgetEvents = _interopRequireDefault(require("../../livechatwidget/common/ChatWidgetEvents"));
|
|
10
10
|
var _PersistentConversationHandler = _interopRequireDefault(require("../../livechatwidget/common/PersistentConversationHandler"));
|
|
11
|
-
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
12
|
-
var _dispatchCustomEvent = _interopRequireDefault(require("../../../common/utils/dispatchCustomEvent"));
|
|
13
11
|
var _SecureEventBus = _interopRequireDefault(require("../../../common/utils/SecureEventBus"));
|
|
12
|
+
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
14
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
14
|
const usePersistentChatHistory = (facadeChatSDK, props) => {
|
|
16
15
|
const handlerRef = (0, _react.useRef)(null);
|
|
@@ -31,7 +30,6 @@ const usePersistentChatHistory = (facadeChatSDK, props) => {
|
|
|
31
30
|
try {
|
|
32
31
|
var _handlerRef$current;
|
|
33
32
|
await ((_handlerRef$current = handlerRef.current) === null || _handlerRef$current === void 0 ? void 0 : _handlerRef$current.pullHistory());
|
|
34
|
-
(0, _dispatchCustomEvent.default)(_ChatWidgetEvents.default.HIDE_LOADING_BANNER);
|
|
35
33
|
_TelemetryHelper.TelemetryHelper.logActionEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
36
34
|
Event: _TelemetryConstants.TelemetryEvent.LCWPersistentChatHistoryFetchCompleted,
|
|
37
35
|
Description: "Persistent chat history fetch completed successfully"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js
CHANGED
|
@@ -17,14 +17,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
17
17
|
* Component to handle persistent chat history events.
|
|
18
18
|
* Uses WebChatStoreLoader instead of hooks to avoid context issues.
|
|
19
19
|
*/
|
|
20
|
-
const WebChatEventSubscribers =
|
|
20
|
+
const WebChatEventSubscribers = () => {
|
|
21
21
|
const [isConnected, setIsConnected] = (0, _react.useState)(false);
|
|
22
22
|
const [storeReady, setStoreReady] = (0, _react.useState)(false);
|
|
23
23
|
const storeWaitTimer = (0, _utils.createTimer)();
|
|
24
|
+
// Type the chatConfig properly to avoid 'any' usage
|
|
25
|
+
|
|
24
26
|
(0, _react.useEffect)(() => {
|
|
25
|
-
if (!props.persistentChatHistoryEnabled) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
27
|
_TelemetryHelper.TelemetryHelper.logActionEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
29
28
|
Event: _TelemetryConstants.TelemetryEvent.LCWWebChatStorePollingStarted,
|
|
30
29
|
Description: "WebChat store polling started"
|
|
@@ -56,9 +55,9 @@ const WebChatEventSubscribers = props => {
|
|
|
56
55
|
clearInterval(storeCheckInterval);
|
|
57
56
|
};
|
|
58
57
|
}
|
|
59
|
-
}, [
|
|
58
|
+
}, []);
|
|
60
59
|
(0, _react.useEffect)(() => {
|
|
61
|
-
if (!
|
|
60
|
+
if (!storeReady) {
|
|
62
61
|
return;
|
|
63
62
|
}
|
|
64
63
|
const checkConnectionStatus = () => {
|
|
@@ -115,7 +114,7 @@ const WebChatEventSubscribers = props => {
|
|
|
115
114
|
return () => {
|
|
116
115
|
clearInterval(interval);
|
|
117
116
|
};
|
|
118
|
-
}, [isConnected,
|
|
117
|
+
}, [isConnected, storeReady]);
|
|
119
118
|
return null;
|
|
120
119
|
};
|
|
121
120
|
var _default = WebChatEventSubscribers;
|
|
@@ -5,13 +5,42 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _defaultMiddlewareLocalizedTexts = require("../../../../common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
8
9
|
var _defaultPersistentChatHistoryProps = require("../../../../../livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps");
|
|
9
10
|
var _react2 = require("@fluentui/react");
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
12
|
const ConversationDividerActivity = props => {
|
|
12
13
|
const styleApplied = (0, _react2.mergeStyles)(_defaultPersistentChatHistoryProps.defaultPersistentChatHistoryProps.dividerActivityStyle, props.dividerActivityStyle);
|
|
14
|
+
const ariaLabel = props.dividerActivityAriaLabel || _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.CONVERSATION_DIVIDER_ARIA_LABEL;
|
|
15
|
+
|
|
16
|
+
// Create a simple separator that screen readers can detect without being interactive
|
|
17
|
+
// Preserve the visual divider styling while making it accessible
|
|
18
|
+
// Use a ref to programmatically remove only the "EL said:" prefix from the label
|
|
19
|
+
const dividerRef = _react.default.useRef(null);
|
|
20
|
+
_react.default.useEffect(() => {
|
|
21
|
+
if (dividerRef.current) {
|
|
22
|
+
// Find and hardcode the text in the label div to just show the divider label
|
|
23
|
+
const article = dividerRef.current.closest(".webchat__basic-transcript__activity");
|
|
24
|
+
if (article) {
|
|
25
|
+
const labelDiv = article.querySelector("div[id*=\"webchat__basic-transcript__active-descendant-label--\"]");
|
|
26
|
+
if (labelDiv) {
|
|
27
|
+
// Hardcode the text to just the aria label
|
|
28
|
+
labelDiv.textContent = ariaLabel || "";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}, [ariaLabel]);
|
|
13
33
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
14
|
-
|
|
34
|
+
ref: dividerRef,
|
|
35
|
+
role: "separator",
|
|
36
|
+
"aria-label": ariaLabel,
|
|
37
|
+
"aria-hidden": false,
|
|
38
|
+
className: styleApplied,
|
|
39
|
+
"data-accessibility-divider": "true",
|
|
40
|
+
style: {
|
|
41
|
+
// Add accessibility enhancements
|
|
42
|
+
position: "relative"
|
|
43
|
+
}
|
|
15
44
|
});
|
|
16
45
|
};
|
|
17
46
|
var _default = ConversationDividerActivity;
|
|
@@ -62,7 +62,7 @@ let LazyLoadHandler = /*#__PURE__*/function () {
|
|
|
62
62
|
|
|
63
63
|
// Scroll operation state
|
|
64
64
|
// Current scroll operation tracking
|
|
65
|
-
// Prevents concurrent scroll operations
|
|
65
|
+
// Prevents concurrent scroll operations (public for event handlers)
|
|
66
66
|
|
|
67
67
|
// Timeout and queue management
|
|
68
68
|
// Tracks all setTimeout IDs for cleanup
|
|
@@ -934,6 +934,21 @@ const LazyLoadActivity = props => {
|
|
|
934
934
|
setHasMoreHistory(false);
|
|
935
935
|
};
|
|
936
936
|
|
|
937
|
+
// Event listener for HISTORY_LOAD_ERROR - hides banner temporarily without disabling future loads
|
|
938
|
+
const handleHistoryLoadError = () => {
|
|
939
|
+
// Temporarily hide the banner by pausing, but keep hasMoreHistory true to allow retry
|
|
940
|
+
LazyLoadHandler.paused = true;
|
|
941
|
+
LazyLoadHandler.pendingScrollAction = false;
|
|
942
|
+
|
|
943
|
+
// Re-enable after a delay to allow retry on next scroll
|
|
944
|
+
// Note: This timeout is intentionally not tracked as it's scoped to the component lifecycle
|
|
945
|
+
window.setTimeout(() => {
|
|
946
|
+
LazyLoadHandler.paused = false;
|
|
947
|
+
}, 2000); // 2 second delay before allowing retry
|
|
948
|
+
|
|
949
|
+
LazyLoadHandler.logLifecycleEvent(_TelemetryConstants.TelemetryEvent.LCWLazyLoadHistoryError, "History load error - will retry on next scroll");
|
|
950
|
+
};
|
|
951
|
+
|
|
937
952
|
// Event listener for PersistentConversationReset to sync React state
|
|
938
953
|
// This fixes the issue where banner doesn't appear in start chat + close chat + start chat sequence
|
|
939
954
|
// by ensuring React state (hasMoreHistory) is synchronized with handler state when reset occurs
|
|
@@ -946,6 +961,9 @@ const LazyLoadActivity = props => {
|
|
|
946
961
|
const eventBus = _SecureEventBus.default.getInstance();
|
|
947
962
|
const unsubscribeNoMoreHistory = eventBus.subscribe(_ChatWidgetEvents.default.NO_MORE_HISTORY_AVAILABLE, handleNoMoreHistory);
|
|
948
963
|
|
|
964
|
+
// Add event listener for history load errors
|
|
965
|
+
const unsubscribeHistoryError = eventBus.subscribe(_ChatWidgetEvents.default.HISTORY_LOAD_ERROR, handleHistoryLoadError);
|
|
966
|
+
|
|
949
967
|
// Add event listener for persistent conversation reset
|
|
950
968
|
const resetSubscription = _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.PersistentConversationReset).subscribe(handlePersistentConversationReset);
|
|
951
969
|
|
|
@@ -962,6 +980,7 @@ const LazyLoadActivity = props => {
|
|
|
962
980
|
// Still need to return cleanup function even after reset
|
|
963
981
|
return () => {
|
|
964
982
|
unsubscribeNoMoreHistory();
|
|
983
|
+
unsubscribeHistoryError();
|
|
965
984
|
resetSubscription.unsubscribe();
|
|
966
985
|
};
|
|
967
986
|
}
|
|
@@ -1014,6 +1033,7 @@ const LazyLoadActivity = props => {
|
|
|
1014
1033
|
|
|
1015
1034
|
// Remove event listeners
|
|
1016
1035
|
unsubscribeNoMoreHistory();
|
|
1036
|
+
unsubscribeHistoryError();
|
|
1017
1037
|
resetSubscription.unsubscribe();
|
|
1018
1038
|
if (container) {
|
|
1019
1039
|
container.removeEventListener("scroll", handleScroll);
|
|
@@ -12,6 +12,7 @@ var _DirectLineActivityType = require("../../enums/DirectLineActivityType");
|
|
|
12
12
|
var _DirectLineSenderRole = require("../../enums/DirectLineSenderRole");
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _TelemetryHelper = require("../../../../../common/telemetry/TelemetryHelper");
|
|
15
|
+
var _defaultMiddlewareLocalizedTexts = require("../../../common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
15
16
|
var _defaultSystemMessageStyles = require("./defaultStyles/defaultSystemMessageStyles");
|
|
16
17
|
var _defaultUserMessageStyles = require("./defaultStyles/defaultUserMessageStyles");
|
|
17
18
|
var _utils = require("../../../../../common/utils");
|
|
@@ -79,7 +80,7 @@ const isDataTagsPresent = card => {
|
|
|
79
80
|
};
|
|
80
81
|
|
|
81
82
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
82
|
-
const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps, userMessageStyleProps) => () => next => function () {
|
|
83
|
+
const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps, userMessageStyleProps, localizedTexts) => () => next => function () {
|
|
83
84
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
84
85
|
args[_key] = arguments[_key];
|
|
85
86
|
}
|
|
@@ -130,7 +131,11 @@ const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps, userM
|
|
|
130
131
|
};
|
|
131
132
|
}
|
|
132
133
|
if (isTagIncluded(card, _Constants.Constants.conversationDividerTag)) {
|
|
133
|
-
|
|
134
|
+
const conversationDividerLabel = (localizedTexts === null || localizedTexts === void 0 ? void 0 : localizedTexts.CONVERSATION_DIVIDER_ARIA_LABEL) || _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.CONVERSATION_DIVIDER_ARIA_LABEL;
|
|
135
|
+
// Pass the computed localized text to the divider component
|
|
136
|
+
return /*#__PURE__*/_react.default.createElement(_ConversationDividerActivity.default, {
|
|
137
|
+
dividerActivityAriaLabel: conversationDividerLabel
|
|
138
|
+
});
|
|
134
139
|
}
|
|
135
140
|
if (card.activity.text && card.activity.type === _DirectLineActivityType.DirectLineActivityType.Message) {
|
|
136
141
|
if (!card.activity.channelData.isHtmlEncoded && card.activity.channelId === _Constants.Constants.webchatChannelId) {
|
|
@@ -77,6 +77,7 @@ const NotDeliveredTimestamp = _ref => {
|
|
|
77
77
|
style: failedTextStyles
|
|
78
78
|
}, " ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_NOT_DELIVERED) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_NOT_DELIVERED, " "), /*#__PURE__*/_react.default.createElement("span", null, " \xA0-\xA0 "), /*#__PURE__*/_react.default.createElement("span", {
|
|
79
79
|
style: retryTextStyles,
|
|
80
|
+
role: "button",
|
|
80
81
|
onClick: onRetryClick,
|
|
81
82
|
onKeyDown: onRetryKeyEnter,
|
|
82
83
|
tabIndex: 0
|
|
@@ -32,7 +32,12 @@ const createCitationsMiddleware = (state, dispatch) => () => next => action => {
|
|
|
32
32
|
const citations = (_gptFeedback$summariz = gptFeedback.summarizationOpenAIResponse) === null || _gptFeedback$summariz === void 0 ? void 0 : (_gptFeedback$summariz2 = _gptFeedback$summariz.result) === null || _gptFeedback$summariz2 === void 0 ? void 0 : _gptFeedback$summariz2.textCitations;
|
|
33
33
|
// Rewrite inline citation labels in activity.text to match the global map keys
|
|
34
34
|
const updatedText = replaceCitations(action.payload.activity.text, citations, messagePrefix);
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
// Create new activity object to avoid mutation
|
|
37
|
+
action.payload.activity = {
|
|
38
|
+
...action.payload.activity,
|
|
39
|
+
text: updatedText
|
|
40
|
+
};
|
|
36
41
|
// Build a global citation map keyed by the prefixed citation id and
|
|
37
42
|
// dispatch it to app state so the UI container can render citations.
|
|
38
43
|
try {
|
|
@@ -4,18 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.localizedStringsBotInitialsMiddleware = exports.getOverriddenLocalizedStrings = void 0;
|
|
7
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
7
8
|
var _Constants = require("../../../../../common/Constants");
|
|
8
|
-
var _utils = require("../../../../../common/utils");
|
|
9
|
-
var _defaultWebChatStyles = require("../../../common/defaultStyles/defaultWebChatStyles");
|
|
10
9
|
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
10
|
+
var _defaultWebChatStyles = require("../../../common/defaultStyles/defaultWebChatStyles");
|
|
11
|
+
var _utils = require("../../../../../common/utils");
|
|
11
12
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
12
13
|
|
|
13
14
|
let currentAgentInitials = _defaultWebChatStyles.defaultWebChatStyles.botAvatarInitials;
|
|
14
|
-
|
|
15
|
+
|
|
16
|
+
// Optional external updater (React context dispatch wrapper) set at runtime
|
|
17
|
+
let externalInitialsUpdater;
|
|
18
|
+
const localizedStringsBotInitialsMiddleware = onInitialsChange => _ref => {
|
|
15
19
|
let {
|
|
16
20
|
dispatch
|
|
17
21
|
} = _ref;
|
|
18
22
|
return next => action => {
|
|
23
|
+
if (onInitialsChange && !externalInitialsUpdater) {
|
|
24
|
+
externalInitialsUpdater = onInitialsChange; // capture once
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
if (action.type === _WebChatActionType.WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY) {
|
|
20
28
|
var _action$payload, _activity$from;
|
|
21
29
|
const activity = (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.activity;
|
|
@@ -23,10 +31,25 @@ const localizedStringsBotInitialsMiddleware = () => _ref => {
|
|
|
23
31
|
var _activity$channelData, _activity$channelData2, _activity$tags;
|
|
24
32
|
const agentName = activity.from.name.trim();
|
|
25
33
|
const isSystemMessage = agentName === "__agent__" || agentName.startsWith("__") || ((_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : (_activity$channelData2 = _activity$channelData.tags) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.includes(_Constants.Constants.systemMessageTag)) || ((_activity$tags = activity.tags) === null || _activity$tags === void 0 ? void 0 : _activity$tags.includes(_Constants.Constants.systemMessageTag));
|
|
26
|
-
if (!isSystemMessage && agentName
|
|
27
|
-
// Update initials for valid agent/bot names
|
|
34
|
+
if (!isSystemMessage && agentName) {
|
|
28
35
|
const newInitials = (0, _utils.getIconText)(agentName) || currentAgentInitials;
|
|
29
|
-
currentAgentInitials
|
|
36
|
+
if (newInitials !== currentAgentInitials) {
|
|
37
|
+
var _externalInitialsUpda;
|
|
38
|
+
currentAgentInitials = newInitials;
|
|
39
|
+
// Notify external React context if provided
|
|
40
|
+
(_externalInitialsUpda = externalInitialsUpdater) === null || _externalInitialsUpda === void 0 ? void 0 : _externalInitialsUpda(currentAgentInitials || "");
|
|
41
|
+
// Broadcast (optional) for multi-tab sync without forcing consumers
|
|
42
|
+
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
43
|
+
eventName: "BotAvatarInitialsUpdated",
|
|
44
|
+
payload: {
|
|
45
|
+
initials: currentAgentInitials
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
// Also dispatch a no-op action into WebChat store to encourage re-render (cheap)
|
|
49
|
+
dispatch({
|
|
50
|
+
type: "__BOT_INITIALS_UPDATED__"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
30
53
|
}
|
|
31
54
|
}
|
|
32
55
|
}
|
|
@@ -40,7 +63,6 @@ const getOverriddenLocalizedStrings = existingOverrides => {
|
|
|
40
63
|
...strings,
|
|
41
64
|
...existingOverrides
|
|
42
65
|
};
|
|
43
|
-
|
|
44
66
|
// Apply dynamic bot initials to alt text if not already overridden through props
|
|
45
67
|
if (!(existingOverrides !== null && existingOverrides !== void 0 && existingOverrides.ACTIVITY_BOT_SAID_ALT)) {
|
|
46
68
|
result.ACTIVITY_BOT_SAID_ALT = `${currentAgentInitials} said:`;
|
|
@@ -56,4 +56,5 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
56
56
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_ENABLED"] = 46] = "SET_CONVERSATIONAL_SURVEY_ENABLED";
|
|
57
57
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_DISPLAY"] = 47] = "SET_CONVERSATIONAL_SURVEY_DISPLAY";
|
|
58
58
|
LiveChatWidgetActionType[LiveChatWidgetActionType["GET_IN_MEMORY_STATE"] = 48] = "GET_IN_MEMORY_STATE";
|
|
59
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_AVATAR_INITIALS"] = 49] = "SET_BOT_AVATAR_INITIALS";
|
|
59
60
|
})(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
|
|
@@ -10,6 +10,7 @@ var _ConversationState = require("./ConversationState");
|
|
|
10
10
|
var _StartChatFailureType = require("./StartChatFailureType");
|
|
11
11
|
var _defaultClientDataStoreProvider = require("../../common/storage/default/defaultClientDataStoreProvider");
|
|
12
12
|
var _defaultMiddlewareLocalizedTexts = require("../../components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
13
|
+
var _defaultWebChatStyles = require("../../components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles");
|
|
13
14
|
const getLiveChatWidgetContextInitialState = props => {
|
|
14
15
|
var _props$controlProps, _props$webChatContain;
|
|
15
16
|
const isOutsideOperatingHours = () => {
|
|
@@ -39,6 +40,10 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
39
40
|
initialStateFromCache.domainStates.liveChatConfig = props.chatConfig;
|
|
40
41
|
// Cache the result of isOutsideOperatingHours() to ensure consistency
|
|
41
42
|
initialStateFromCache.appStates.outsideOperatingHours = outsideOperatingHours;
|
|
43
|
+
// Backward compatibility: if botAvatarInitials not cached (older sessions), seed with default
|
|
44
|
+
if (!initialStateFromCache.domainStates.botAvatarInitials) {
|
|
45
|
+
initialStateFromCache.domainStates.botAvatarInitials = _defaultWebChatStyles.defaultWebChatStyles.botAvatarInitials;
|
|
46
|
+
}
|
|
42
47
|
return initialStateFromCache;
|
|
43
48
|
}
|
|
44
49
|
const LiveChatWidgetContextInitialState = {
|
|
@@ -62,7 +67,8 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
62
67
|
transcriptRequestId: "",
|
|
63
68
|
confirmationPaneConfirmedOptionClicked: false,
|
|
64
69
|
confirmationState: _Constants.ConfirmationState.NotSet,
|
|
65
|
-
startChatFailureType: _StartChatFailureType.StartChatFailureType.Generic
|
|
70
|
+
startChatFailureType: _StartChatFailureType.StartChatFailureType.Generic,
|
|
71
|
+
botAvatarInitials: _defaultWebChatStyles.defaultWebChatStyles.botAvatarInitials
|
|
66
72
|
},
|
|
67
73
|
appStates: {
|
|
68
74
|
conversationState: _ConversationState.ConversationState.Closed,
|
|
@@ -562,6 +562,21 @@ const reducer = (state, action) => {
|
|
|
562
562
|
widgetSize: action.payload
|
|
563
563
|
}
|
|
564
564
|
};
|
|
565
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_BOT_AVATAR_INITIALS:
|
|
566
|
+
inMemory = {
|
|
567
|
+
...inMemory,
|
|
568
|
+
domainStates: {
|
|
569
|
+
...inMemory.domainStates,
|
|
570
|
+
botAvatarInitials: action.payload
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
return {
|
|
574
|
+
...state,
|
|
575
|
+
domainStates: {
|
|
576
|
+
...state.domainStates,
|
|
577
|
+
botAvatarInitials: action.payload
|
|
578
|
+
}
|
|
579
|
+
};
|
|
565
580
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_INSTANCE_ID:
|
|
566
581
|
inMemory = {
|
|
567
582
|
...inMemory,
|
|
@@ -36,7 +36,7 @@ const createTrackingForFirstMessage = () => {
|
|
|
36
36
|
* Starts tracking the time for the first bot message after widget loads.
|
|
37
37
|
* Sets a 5-second timeout to auto-reset if no bot message is received.
|
|
38
38
|
*/
|
|
39
|
-
const widgetLoadListener = _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.TelemetryEvent.
|
|
39
|
+
const widgetLoadListener = _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.TelemetryEvent.StartChatComplete).subscribe(() => {
|
|
40
40
|
if (isTracking) return;
|
|
41
41
|
isTracking = true;
|
|
42
42
|
startTime = new Date().getTime();
|
|
@@ -91,7 +91,8 @@ const createTrackingForFirstMessage = () => {
|
|
|
91
91
|
CustomProperties: {
|
|
92
92
|
elapsedTime,
|
|
93
93
|
widgetLoadedAt: startTime,
|
|
94
|
-
botMessage: stopTrackingMessage
|
|
94
|
+
botMessage: stopTrackingMessage,
|
|
95
|
+
type: payload === null || payload === void 0 ? void 0 : payload.type
|
|
95
96
|
}
|
|
96
97
|
});
|
|
97
98
|
disconnectListener();
|