@microsoft/omnichannel-chat-widget 1.1.1-main.691fe30 → 1.1.1-main.c2e1b5a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +20 -15
  2. package/lib/cjs/common/telemetry/TelemetryConstants.js +2 -0
  3. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +7 -4
  4. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +34 -14
  5. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
  6. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +1 -0
  7. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +18 -14
  8. package/lib/esm/common/telemetry/TelemetryConstants.js +2 -0
  9. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +7 -4
  10. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +34 -14
  11. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
  12. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +1 -0
  13. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +1 -0
  14. package/lib/types/common/telemetry/TelemetryConstants.d.ts +1 -0
  15. package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +2 -2
  16. package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +2 -1
  17. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.d.ts +2 -1
  18. package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +1 -0
  19. package/package.json +1 -1
@@ -3,30 +3,35 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.defaultClientDataStoreProvider = void 0;
6
+ exports.isCookieAllowed = exports.defaultClientDataStoreProvider = void 0;
7
7
  var _TelemetryConstants = require("../../telemetry/TelemetryConstants");
8
+ var _Constants = require("../../Constants");
8
9
  var _TelemetryHelper = require("../../telemetry/TelemetryHelper");
9
10
  var _defaultInMemoryDataStore = require("./defaultInMemoryDataStore");
10
- var _Constants = require("../../Constants");
11
11
  /* eslint-disable @typescript-eslint/no-explicit-any */
12
12
 
13
+ const isCookieAllowed = () => {
14
+ try {
15
+ localStorage;
16
+ sessionStorage;
17
+ return true;
18
+ } catch (error) {
19
+ if (!window.TPCWarningLogged) {
20
+ console.warn("Third party cookies blocked.");
21
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.WARN, {
22
+ Event: _TelemetryConstants.TelemetryEvent.ThirdPartyCookiesBlocked,
23
+ Description: "Third party cookies are blocked. Cannot access local storage or session storage."
24
+ });
25
+ window.TPCWarningLogged = true;
26
+ }
27
+ return false;
28
+ }
29
+ };
30
+ exports.isCookieAllowed = isCookieAllowed;
13
31
  const defaultClientDataStoreProvider = function () {
14
32
  let cacheTtlinMins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
15
33
  let storageType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _Constants.StorageType.localStorage;
16
34
  let ttlInMs = 0;
17
- const isCookieAllowed = () => {
18
- try {
19
- localStorage;
20
- sessionStorage;
21
- return true;
22
- } catch (error) {
23
- if (!window.TPCWarningShown) {
24
- console.warn("Third party cookies blocked.");
25
- window.TPCWarningShown = true;
26
- }
27
- return false;
28
- }
29
- };
30
35
  if (ttlInMs == 0) {
31
36
  ttlInMs = cacheTtlinMins * 60 * 1000;
32
37
  }
@@ -164,6 +164,7 @@ exports.TelemetryEvent = TelemetryEvent;
164
164
  TelemetryEvent["SetBotAuthProviderHideCard"] = "SetBotAuthProviderHideCard";
165
165
  TelemetryEvent["SetBotAuthProviderDisplayCard"] = "SetBotAuthProviderDisplayCard";
166
166
  TelemetryEvent["SetBotAuthProviderNotFound"] = "SetBotAuthProviderNotFound";
167
+ TelemetryEvent["ThirdPartyCookiesBlocked"] = "ThirdPartyCookiesBlocked";
167
168
  TelemetryEvent["ProcessingHTMLTextMiddlewareFailed"] = "ProcessingHTMLTextMiddlewareFailed";
168
169
  TelemetryEvent["ProcessingSanitizationMiddlewareFailed"] = "ProcessingSanitizationMiddlewareFailed";
169
170
  TelemetryEvent["FormatTagsMiddlewareJSONStringifyFailed"] = "FormatTagsMiddlewareJSONStringifyFailed";
@@ -231,6 +232,7 @@ class TelemetryConstants {
231
232
  case TelemetryEvent.OutOfOfficePaneLoaded:
232
233
  case TelemetryEvent.ConfirmationPaneLoaded:
233
234
  case TelemetryEvent.ProactiveChatPaneLoaded:
235
+ case TelemetryEvent.ThirdPartyCookiesBlocked:
234
236
  return ScenarioType.LOAD;
235
237
  case TelemetryEvent.PrechatSubmitted:
236
238
  case TelemetryEvent.LCWChatButtonClicked:
@@ -12,6 +12,7 @@ var _react = require("@fluentui/react");
12
12
  var _react2 = _interopRequireWildcard(require("react"));
13
13
  var _startChat = require("../common/startChat");
14
14
  var _utils = require("../../../common/utils");
15
+ var _defaultClientDataStoreProvider = require("../../../common/storage/default/defaultClientDataStoreProvider");
15
16
  var _endChat = require("../common/endChat");
16
17
  var _reconnectChatHelper = require("../common/reconnectChatHelper");
17
18
  var _componentController = require("../../../controller/componentController");
@@ -20,8 +21,8 @@ var _CallingContainerStateful = _interopRequireDefault(require("../../callingcon
20
21
  var _ChatButtonStateful = _interopRequireDefault(require("../../chatbuttonstateful/ChatButtonStateful"));
21
22
  var _ConfirmationPaneStateful = _interopRequireDefault(require("../../confirmationpanestateful/ConfirmationPaneStateful"));
22
23
  var _ConversationState = require("../../../contexts/common/ConversationState");
23
- var _createDownloadTranscriptProps = _interopRequireDefault(require("../common/createDownloadTranscriptProps"));
24
24
  var _DataStoreManager = require("../../../common/contextDataStore/DataStoreManager");
25
+ var _DraggableChatWidget = _interopRequireDefault(require("../../draggable/DraggableChatWidget"));
25
26
  var _EmailTranscriptPaneStateful = _interopRequireDefault(require("../../emailtranscriptpanestateful/EmailTranscriptPaneStateful"));
26
27
  var _HeaderStateful = _interopRequireDefault(require("../../headerstateful/HeaderStateful"));
27
28
  var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
@@ -35,9 +36,9 @@ var _ReconnectChatPaneStateful = _interopRequireDefault(require("../../reconnect
35
36
  var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
36
37
  var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
37
38
  var _WebChatContainerStateful = _interopRequireDefault(require("../../webchatcontainerstateful/WebChatContainerStateful"));
39
+ var _createDownloadTranscriptProps = _interopRequireDefault(require("../common/createDownloadTranscriptProps"));
38
40
  var _createFooter = require("../common/createFooter");
39
41
  var _createInternetConnectionChangeHandler = require("../common/createInternetConnectionChangeHandler");
40
- var _defaultClientDataStoreProvider = require("../../../common/storage/default/defaultClientDataStoreProvider");
41
42
  var _defaultScrollBarProps = require("../common/defaultProps/defaultScrollBarProps");
42
43
  var _defaultWebChatContainerStatefulProps = require("../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps");
43
44
  var _disposeTelemetryLoggers = require("../common/disposeTelemetryLoggers");
@@ -53,7 +54,6 @@ var _startProactiveChat = require("../common/startProactiveChat");
53
54
  var _useChatAdapterStore = _interopRequireDefault(require("../../../hooks/useChatAdapterStore"));
54
55
  var _useChatContextStore = _interopRequireDefault(require("../../../hooks/useChatContextStore"));
55
56
  var _useChatSDKStore = _interopRequireDefault(require("../../../hooks/useChatSDKStore"));
56
- var _DraggableChatWidget = _interopRequireDefault(require("../../draggable/DraggableChatWidget"));
57
57
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
58
58
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
59
59
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -434,6 +434,9 @@ const LiveChatWidgetStateful = props => {
434
434
  payload: undefined
435
435
  });
436
436
  });
437
+
438
+ // Check for TPC and log in telemetry if blocked
439
+ (0, _defaultClientDataStoreProvider.isCookieAllowed)();
437
440
  return () => {
438
441
  (0, _disposeTelemetryLoggers.disposeTelemetryLoggers)();
439
442
  };
@@ -680,7 +683,7 @@ const LiveChatWidgetStateful = props => {
680
683
  initStartChat: initStartChatRelay
681
684
  })), !((_livechatProps$contro9 = livechatProps.controlProps) !== null && _livechatProps$contro9 !== void 0 && _livechatProps$contro9.hideCallingContainer) && (0, _componentController.shouldShowCallingContainer)(state) && /*#__PURE__*/_react2.default.createElement(_CallingContainerStateful.default, _extends({
682
685
  voiceVideoCallingSdk: voiceVideoCallingSDK
683
- }, livechatProps.callingContainerProps)), !((_livechatProps$contro10 = livechatProps.controlProps) !== null && _livechatProps$contro10 !== void 0 && _livechatProps$contro10.hideWebChatContainer) && (0, _componentController.shouldShowWebChatContainer)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon8 = livechatProps.componentOverrides) === null || _livechatProps$compon8 === void 0 ? void 0 : _livechatProps$compon8.webChatContainer) || /*#__PURE__*/_react2.default.createElement(_WebChatContainerStateful.default, livechatProps.webChatContainerProps)), !((_livechatProps$contro11 = livechatProps.controlProps) !== null && _livechatProps$contro11 !== void 0 && _livechatProps$contro11.hideConfirmationPane) && (0, _componentController.shouldShowConfirmationPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon9 = livechatProps.componentOverrides) === null || _livechatProps$compon9 === void 0 ? void 0 : _livechatProps$compon9.confirmationPane) || /*#__PURE__*/_react2.default.createElement(_ConfirmationPaneStateful.default, _extends({}, confirmationPaneProps, {
686
+ }, livechatProps.callingContainerProps)), !((_livechatProps$contro10 = livechatProps.controlProps) !== null && _livechatProps$contro10 !== void 0 && _livechatProps$contro10.hideWebChatContainer) && (0, _componentController.shouldShowWebChatContainer)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon8 = livechatProps.componentOverrides) === null || _livechatProps$compon8 === void 0 ? void 0 : _livechatProps$compon8.webChatContainer) || /*#__PURE__*/_react2.default.createElement(_WebChatContainerStateful.default, livechatProps)), !((_livechatProps$contro11 = livechatProps.controlProps) !== null && _livechatProps$contro11 !== void 0 && _livechatProps$contro11.hideConfirmationPane) && (0, _componentController.shouldShowConfirmationPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon9 = livechatProps.componentOverrides) === null || _livechatProps$compon9 === void 0 ? void 0 : _livechatProps$compon9.confirmationPane) || /*#__PURE__*/_react2.default.createElement(_ConfirmationPaneStateful.default, _extends({}, confirmationPaneProps, {
684
687
  setPostChatContext: setPostChatContextRelay,
685
688
  prepareEndChat: prepareEndChatRelay
686
689
  }))), !((_livechatProps$contro12 = livechatProps.controlProps) !== null && _livechatProps$contro12 !== void 0 && _livechatProps$contro12.hidePostChatLoadingPane) && (0, _componentController.shouldShowPostChatLoadingPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon10 = livechatProps.componentOverrides) === null || _livechatProps$compon10 === void 0 ? void 0 : _livechatProps$compon10.postChatLoadingPane) || /*#__PURE__*/_react2.default.createElement(_PostChatLoadingPaneStateful.default, livechatProps.postChatLoadingPaneProps)), (0, _componentController.shouldShowPostChatSurveyPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon11 = livechatProps.componentOverrides) === null || _livechatProps$compon11 === void 0 ? void 0 : _livechatProps$compon11.postChatSurveyPane) || /*#__PURE__*/_react2.default.createElement(_PostChatSurveyPaneStateful.default, _extends({}, livechatProps.postChatSurveyPaneProps, livechatProps.chatSDK))), (0, _createFooter.createFooter)(livechatProps, state), (0, _componentController.shouldShowEmailTranscriptPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon12 = livechatProps.componentOverrides) === null || _livechatProps$compon12 === void 0 ? void 0 : _livechatProps$compon12.emailTranscriptPane) || /*#__PURE__*/_react2.default.createElement(_EmailTranscriptPaneStateful.default, livechatProps.emailTranscriptPane))))));
@@ -12,20 +12,24 @@ var _broadcastChannel = require("broadcast-channel");
12
12
  var _botframeworkWebchat = require("botframework-webchat");
13
13
  var _Constants = require("../../common/Constants");
14
14
  var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
15
+ var _NotificationHandler = require("./webchatcontroller/notification/NotificationHandler");
16
+ var _NotificationScenarios = require("./webchatcontroller/enums/NotificationScenarios");
15
17
  var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
16
18
  var _WebChatActionType = require("./webchatcontroller/enums/WebChatActionType");
17
19
  var _WebChatStoreLoader = require("./webchatcontroller/WebChatStoreLoader");
18
20
  var _defaultAdaptiveCardStyles = require("./common/defaultStyles/defaultAdaptiveCardStyles");
19
21
  var _defaultMiddlewareLocalizedTexts = require("./common/defaultProps/defaultMiddlewareLocalizedTexts");
20
22
  var _defaultReceivedMessageAnchorStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles");
23
+ var _defaultSentMessageAnchorStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles");
21
24
  var _defaultSystemMessageBoxStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles");
22
25
  var _defaultUserMessageBoxStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles");
23
26
  var _defaultWebChatContainerStatefulProps = require("./common/defaultProps/defaultWebChatContainerStatefulProps");
24
27
  var _utils = require("../../common/utils");
25
28
  var _ = require("../..");
26
- var _defaultSentMessageAnchorStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles");
27
29
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
28
30
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
+ /* eslint-disable @typescript-eslint/no-explicit-any */
32
+
29
33
  const broadcastChannelMessageEvent = "message";
30
34
  const postActivity = activity => {
31
35
  // eslint-disable-line @typescript-eslint/no-explicit-any
@@ -52,28 +56,33 @@ const createMagicCodeSuccessResponse = signin => {
52
56
  };
53
57
  };
54
58
  const WebChatContainerStateful = props => {
55
- var _props$adaptiveCardSt, _props$renderingMiddl, _props$renderingMiddl2, _props$renderingMiddl3, _props$renderingMiddl4, _props$adaptiveCardSt2, _props$adaptiveCardSt3, _props$adaptiveCardSt4, _props$adaptiveCardSt5, _props$renderingMiddl5, _props$renderingMiddl6, _props$renderingMiddl7, _props$renderingMiddl8, _props$renderingMiddl9, _props$renderingMiddl10;
59
+ var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15;
56
60
  const {
57
61
  BasicWebChat
58
62
  } = _botframeworkWebchat.Components;
59
63
  const [state, dispatch] = (0, _.useChatContextStore)();
60
64
  const magicCodeBroadcastChannel = new _broadcastChannel.BroadcastChannel(_Constants.Constants.magicCodeBroadcastChannel);
61
65
  const magicCodeResponseBroadcastChannel = new _broadcastChannel.BroadcastChannel(_Constants.Constants.magicCodeResponseBroadcastChannel);
66
+ const {
67
+ webChatContainerProps,
68
+ contextDataStore
69
+ } = props;
62
70
  const containerStyles = {
63
- root: Object.assign({}, _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.containerStyles, props === null || props === void 0 ? void 0 : props.containerStyles, {
71
+ root: Object.assign({}, _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.containerStyles, webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.containerStyles, {
64
72
  display: state.appStates.isMinimized ? "none" : ""
65
73
  }) // Use this instead of removing WebChat from the picture so that the activity observer inside the adapter is not invoked
66
74
  };
67
75
 
68
76
  const localizedTexts = {
69
77
  ..._defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts,
70
- ...(props === null || props === void 0 ? void 0 : props.localizedTexts)
78
+ ...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
71
79
  };
72
80
  (0, _react2.useEffect)(() => {
81
+ var _props$webChatContain, _props$webChatContain2;
73
82
  (0, _utils.setFocusOnSendBox)();
74
83
  dispatch({
75
84
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_RENDERING_MIDDLEWARE_PROPS,
76
- payload: props === null || props === void 0 ? void 0 : props.renderingMiddlewareProps
85
+ payload: webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.renderingMiddlewareProps
77
86
  });
78
87
  dispatch({
79
88
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MIDDLEWARE_LOCALIZED_TEXTS,
@@ -82,6 +91,17 @@ const WebChatContainerStateful = props => {
82
91
  _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
83
92
  Event: _TelemetryConstants.TelemetryEvent.WebChatLoaded
84
93
  });
94
+ if (((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : (_props$webChatContain2 = _props$webChatContain.renderingMiddlewareProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.disableThirdPartyCookiesAlert) !== true && !contextDataStore) {
95
+ try {
96
+ localStorage;
97
+ sessionStorage;
98
+ } catch (error) {
99
+ if (!window.TPCWarningShown) {
100
+ _NotificationHandler.NotificationHandler.notifyWarning(_NotificationScenarios.NotificationScenarios.TPC, (localizedTexts === null || localizedTexts === void 0 ? void 0 : localizedTexts.THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE) ?? "");
101
+ window.TPCWarningShown = true;
102
+ }
103
+ }
104
+ }
85
105
  }, []);
86
106
  (0, _react2.useEffect)(() => {
87
107
  const eventListener = event => {
@@ -122,33 +142,33 @@ const WebChatContainerStateful = props => {
122
142
  return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("style", null, `
123
143
 
124
144
  .webchat__bubble__content>div#ms_lcw_webchat_adaptive_card {
125
- background: ${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt = props.adaptiveCardStyles) === null || _props$adaptiveCardSt === void 0 ? void 0 : _props$adaptiveCardSt.background) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.background};
145
+ background: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp === void 0 ? void 0 : _webChatContainerProp.background) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.background};
126
146
  }
127
147
 
128
148
  .webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__bubble--from-user {
129
- max-width: ${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl = props.renderingMiddlewareProps) === null || _props$renderingMiddl === void 0 ? void 0 : (_props$renderingMiddl2 = _props$renderingMiddl.userMessageBoxStyles) === null || _props$renderingMiddl2 === void 0 ? void 0 : _props$renderingMiddl2.maxWidth) ?? (_defaultUserMessageBoxStyles.defaultUserMessageBoxStyles === null || _defaultUserMessageBoxStyles.defaultUserMessageBoxStyles === void 0 ? void 0 : _defaultUserMessageBoxStyles.defaultUserMessageBoxStyles.maxWidth)}
149
+ max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp2 === void 0 ? void 0 : (_webChatContainerProp3 = _webChatContainerProp2.userMessageBoxStyles) === null || _webChatContainerProp3 === void 0 ? void 0 : _webChatContainerProp3.maxWidth) ?? (_defaultUserMessageBoxStyles.defaultUserMessageBoxStyles === null || _defaultUserMessageBoxStyles.defaultUserMessageBoxStyles === void 0 ? void 0 : _defaultUserMessageBoxStyles.defaultUserMessageBoxStyles.maxWidth)}
130
150
  }
131
151
 
132
152
  .webchat__stacked-layout--show-avatar div.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__stacked-layout__message {
133
- max-width: ${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl3 = props.renderingMiddlewareProps) === null || _props$renderingMiddl3 === void 0 ? void 0 : (_props$renderingMiddl4 = _props$renderingMiddl3.systemMessageBoxStyles) === null || _props$renderingMiddl4 === void 0 ? void 0 : _props$renderingMiddl4.maxWidth) ?? (_defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles === null || _defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles === void 0 ? void 0 : _defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles.maxWidth)}
153
+ max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp4 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp4 === void 0 ? void 0 : (_webChatContainerProp5 = _webChatContainerProp4.systemMessageBoxStyles) === null || _webChatContainerProp5 === void 0 ? void 0 : _webChatContainerProp5.maxWidth) ?? (_defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles === null || _defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles === void 0 ? void 0 : _defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles.maxWidth)}
134
154
  }
135
155
 
136
156
  div[class="ac-textBlock"] *,
137
- div[class="ac-input-container"] * {color:${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt2 = props.adaptiveCardStyles) === null || _props$adaptiveCardSt2 === void 0 ? void 0 : _props$adaptiveCardSt2.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color}; white-space:${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt3 = props.adaptiveCardStyles) === null || _props$adaptiveCardSt3 === void 0 ? void 0 : _props$adaptiveCardSt3.textWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.textWhiteSpace}}
157
+ div[class="ac-input-container"] * {color:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp6 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp6 === void 0 ? void 0 : _webChatContainerProp6.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color}; white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp7 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp7 === void 0 ? void 0 : _webChatContainerProp7.textWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.textWhiteSpace}}
138
158
  div[class="ac-textBlock"] a:link,
139
159
  div[class="ac-textBlock"] a:visited,
140
160
  div[class="ac-textBlock"] a:hover,
141
161
  div[class="ac-textBlock"] a:active {
142
- color: ${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt4 = props.adaptiveCardStyles) === null || _props$adaptiveCardSt4 === void 0 ? void 0 : _props$adaptiveCardSt4.anchorColor) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.anchorColor};
162
+ color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.anchorColor) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.anchorColor};
143
163
  }
144
164
 
145
- .webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt5 = props.adaptiveCardStyles) === null || _props$adaptiveCardSt5 === void 0 ? void 0 : _props$adaptiveCardSt5.buttonWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
165
+ .webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp9 === void 0 ? void 0 : _webChatContainerProp9.buttonWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
146
166
 
147
167
  .ms_lcw_webchat_received_message img.webchat__markdown__external-link-icon {
148
168
  background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03LjI1MDEgNC41MDAxN0gxMC43NDk1QzExLjE2MzcgNC41MDAxNyAxMS40OTk1IDQuODM1OTYgMTEuNDk5NSA1LjI1MDE3QzExLjQ5OTUgNS42Mjk4NiAxMS4yMTczIDUuOTQzNjYgMTAuODUxMyA1Ljk5MzMyTDEwLjc0OTUgNi4wMDAxN0g3LjI0OTc0QzYuMDcwNzkgNS45OTk2MSA1LjEwMzQ5IDYuOTA2NTYgNS4wMDc4NiA4LjA2MTEyTDUuMDAwMjggOC4yMjAwM0w1LjAwMzEyIDE2Ljc1MDdDNS4wMDM0MyAxNy45NDE1IDUuOTI4ODUgMTguOTE2MSA3LjA5OTY2IDE4Ljk5NDlMNy4yNTM3MSAxOS4wMDAxTDE1Ljc1MTggMTguOTg4NEMxNi45NDE1IDE4Ljk4NjggMTcuOTE0NSAxOC4wNjIgMTcuOTkzNSAxNi44OTIzTDE3Ljk5ODcgMTYuNzM4NFYxMy4yMzIxQzE3Ljk5ODcgMTIuODE3OSAxOC4zMzQ1IDEyLjQ4MjEgMTguNzQ4NyAxMi40ODIxQzE5LjEyODQgMTIuNDgyMSAxOS40NDIyIDEyLjc2NDMgMTkuNDkxOCAxMy4xMzAzTDE5LjQ5ODcgMTMuMjMyMVYxNi43Mzg0QzE5LjQ5ODcgMTguNzQwNyAxNy45MjkzIDIwLjM3NjkgMTUuOTUyOCAyMC40ODI5TDE1Ljc1MzggMjAuNDg4NEw3LjI1ODI3IDIwLjUwMDFMNy4wNTQ5NSAyMC40OTQ5QzUuMTQyMzkgMjAuMzk1NCAzLjYwODk1IDE4Ljg2MjcgMy41MDgzNyAxNi45NTAyTDMuNTAzMTIgMTYuNzUxMUwzLjUwMDg5IDguMjUyN0wzLjUwNTI5IDguMDUwMkMzLjYwNTM5IDYuMTM3NDkgNS4xMzg2NyA0LjYwNDQ5IDcuMDUwOTYgNC41MDUyN0w3LjI1MDEgNC41MDAxN0gxMC43NDk1SDcuMjUwMVpNMTMuNzQ4MSAzLjAwMTQ2TDIwLjMwMTggMy4wMDE5N0wyMC40MDE0IDMuMDE1NzVMMjAuNTAyMiAzLjA0MzkzTDIwLjU1OSAzLjA2ODAzQzIwLjYxMjIgMy4wOTEyMiAyMC42NjM0IDMuMTIxNjMgMjAuNzExMSAzLjE1ODg1TDIwLjc4MDQgMy4yMjE1NkwyMC44NjQxIDMuMzIwMTRMMjAuOTE4MyAzLjQxMDI1TDIwLjk1NyAzLjUwMDU3TDIwLjk3NjIgMy41NjQ3NkwyMC45ODk4IDMuNjI4NjJMMjAuOTk5MiAzLjcyMjgyTDIwLjk5OTcgMTAuMjU1NEMyMC45OTk3IDEwLjY2OTYgMjAuNjYzOSAxMS4wMDU0IDIwLjI0OTcgMTEuMDA1NEMxOS44NyAxMS4wMDU0IDE5LjU1NjIgMTAuNzIzMiAxOS41MDY1IDEwLjM1NzFMMTkuNDk5NyAxMC4yNTU0TDE5LjQ5ODkgNS41NjE0N0wxMi4yNzk3IDEyLjc4NDdDMTIuMDEzNCAxMy4wNTEgMTEuNTk2OCAxMy4wNzUzIDExLjMwMzEgMTIuODU3NUwxMS4yMTkgMTIuNzg0OUMxMC45NTI3IDEyLjUxODcgMTAuOTI4NCAxMi4xMDIxIDExLjE0NjIgMTEuODA4NEwxMS4yMTg4IDExLjcyNDNMMTguNDM2OSA0LjUwMTQ2SDEzLjc0ODFDMTMuMzY4NCA0LjUwMTQ2IDEzLjA1NDYgNC4yMTkzMSAxMy4wMDUgMy44NTMyNEwxMi45OTgxIDMuNzUxNDZDMTIuOTk4MSAzLjM3MTc3IDEzLjI4MDMgMy4wNTc5NyAxMy42NDY0IDMuMDA4MzFMMTMuNzQ4MSAzLjAwMTQ2WiIgZmlsbD0iI0ZGRkZGRiIgLz48L3N2Zz4) !important;
149
169
  height: '.75em';
150
170
  marginLeft: '.25em';
151
- filter:${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl5 = props.renderingMiddlewareProps) === null || _props$renderingMiddl5 === void 0 ? void 0 : (_props$renderingMiddl6 = _props$renderingMiddl5.receivedMessageAnchorStyles) === null || _props$renderingMiddl6 === void 0 ? void 0 : _props$renderingMiddl6.filter) ?? "none"};
171
+ filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp10 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp10 === void 0 ? void 0 : (_webChatContainerProp11 = _webChatContainerProp10.receivedMessageAnchorStyles) === null || _webChatContainerProp11 === void 0 ? void 0 : _webChatContainerProp11.filter) ?? "none"};
152
172
  }
153
173
  pre {
154
174
  white-space: pre-wrap;
@@ -161,13 +181,13 @@ const WebChatContainerStateful = props => {
161
181
  .ms_lcw_webchat_received_message a:visited,
162
182
  .ms_lcw_webchat_received_message a:hover,
163
183
  .ms_lcw_webchat_received_message a:active {
164
- color: ${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl7 = props.renderingMiddlewareProps) === null || _props$renderingMiddl7 === void 0 ? void 0 : (_props$renderingMiddl8 = _props$renderingMiddl7.receivedMessageAnchorStyles) === null || _props$renderingMiddl8 === void 0 ? void 0 : _props$renderingMiddl8.color) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.color)};
184
+ color: ${(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.color) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.color)};
165
185
  }
166
186
  .ms_lcw_webchat_sent_message a:link,
167
187
  .ms_lcw_webchat_sent_message a:visited,
168
188
  .ms_lcw_webchat_sent_message a:hover,
169
189
  .ms_lcw_webchat_sent_message a:active {
170
- color: ${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl9 = props.renderingMiddlewareProps) === null || _props$renderingMiddl9 === void 0 ? void 0 : (_props$renderingMiddl10 = _props$renderingMiddl9.sentMessageAnchorStyles) === null || _props$renderingMiddl10 === void 0 ? void 0 : _props$renderingMiddl10.color) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.color)};
190
+ color: ${(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.color) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.color)};
171
191
  }
172
192
  `), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
173
193
  styles: containerStyles
@@ -30,6 +30,7 @@ const defaultMiddlewareLocalizedTexts = {
30
30
  MIDDLEWARE_MESSAGE_DELIVERED: "Sent",
31
31
  MIDDLEWARE_MESSAGE_NOT_DELIVERED: "Not Delivered",
32
32
  MIDDLEWARE_MESSAGE_RETRY: "Retry",
33
- MIDDLEWARE_BANNER_CHAT_DISCONNECT: "Your conversation has been disconnected. For additional assistance, please start a new chat."
33
+ MIDDLEWARE_BANNER_CHAT_DISCONNECT: "Your conversation has been disconnected. For additional assistance, please start a new chat.",
34
+ THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE: "Third party cookies are blocked. Reloading this page will start a new conversation."
34
35
  };
35
36
  exports.defaultMiddlewareLocalizedTexts = defaultMiddlewareLocalizedTexts;
@@ -14,4 +14,5 @@ exports.NotificationScenarios = NotificationScenarios;
14
14
  NotificationScenarios["InternetConnection"] = "internet connection";
15
15
  NotificationScenarios["MaxSizeError"] = "max size";
16
16
  NotificationScenarios["ChatDisconnect"] = "chat disconnect";
17
+ NotificationScenarios["TPC"] = "tpc blocked";
17
18
  })(NotificationScenarios || (exports.NotificationScenarios = NotificationScenarios = {}));
@@ -1,26 +1,30 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
 
3
3
  import { LogLevel, TelemetryEvent } from "../../telemetry/TelemetryConstants";
4
+ import { StorageType } from "../../Constants";
4
5
  import { TelemetryHelper } from "../../telemetry/TelemetryHelper";
5
6
  import { inMemoryDataStore } from "./defaultInMemoryDataStore";
6
- import { StorageType } from "../../Constants";
7
+ export const isCookieAllowed = () => {
8
+ try {
9
+ localStorage;
10
+ sessionStorage;
11
+ return true;
12
+ } catch (error) {
13
+ if (!window.TPCWarningLogged) {
14
+ console.warn("Third party cookies blocked.");
15
+ TelemetryHelper.logActionEvent(LogLevel.WARN, {
16
+ Event: TelemetryEvent.ThirdPartyCookiesBlocked,
17
+ Description: "Third party cookies are blocked. Cannot access local storage or session storage."
18
+ });
19
+ window.TPCWarningLogged = true;
20
+ }
21
+ return false;
22
+ }
23
+ };
7
24
  export const defaultClientDataStoreProvider = function () {
8
25
  let cacheTtlinMins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
9
26
  let storageType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : StorageType.localStorage;
10
27
  let ttlInMs = 0;
11
- const isCookieAllowed = () => {
12
- try {
13
- localStorage;
14
- sessionStorage;
15
- return true;
16
- } catch (error) {
17
- if (!window.TPCWarningShown) {
18
- console.warn("Third party cookies blocked.");
19
- window.TPCWarningShown = true;
20
- }
21
- return false;
22
- }
23
- };
24
28
  if (ttlInMs == 0) {
25
29
  ttlInMs = cacheTtlinMins * 60 * 1000;
26
30
  }
@@ -158,6 +158,7 @@ export let TelemetryEvent;
158
158
  TelemetryEvent["SetBotAuthProviderHideCard"] = "SetBotAuthProviderHideCard";
159
159
  TelemetryEvent["SetBotAuthProviderDisplayCard"] = "SetBotAuthProviderDisplayCard";
160
160
  TelemetryEvent["SetBotAuthProviderNotFound"] = "SetBotAuthProviderNotFound";
161
+ TelemetryEvent["ThirdPartyCookiesBlocked"] = "ThirdPartyCookiesBlocked";
161
162
  TelemetryEvent["ProcessingHTMLTextMiddlewareFailed"] = "ProcessingHTMLTextMiddlewareFailed";
162
163
  TelemetryEvent["ProcessingSanitizationMiddlewareFailed"] = "ProcessingSanitizationMiddlewareFailed";
163
164
  TelemetryEvent["FormatTagsMiddlewareJSONStringifyFailed"] = "FormatTagsMiddlewareJSONStringifyFailed";
@@ -225,6 +226,7 @@ export class TelemetryConstants {
225
226
  case TelemetryEvent.OutOfOfficePaneLoaded:
226
227
  case TelemetryEvent.ConfirmationPaneLoaded:
227
228
  case TelemetryEvent.ProactiveChatPaneLoaded:
229
+ case TelemetryEvent.ThirdPartyCookiesBlocked:
228
230
  return ScenarioType.LOAD;
229
231
  case TelemetryEvent.PrechatSubmitted:
230
232
  case TelemetryEvent.LCWChatButtonClicked:
@@ -7,6 +7,7 @@ import { Stack } from "@fluentui/react";
7
7
  import React, { useEffect, useRef, useState } from "react";
8
8
  import { checkIfConversationStillValid, initStartChat, prepareStartChat, setPreChatAndInitiateChat } from "../common/startChat";
9
9
  import { createTimer, getBroadcastChannelName, getConversationDetailsCall, getLocaleDirection, getStateFromCache, getWidgetCacheIdfromProps, getWidgetEndChatEventName, isNullOrEmptyString, isUndefinedOrEmpty, newGuid } from "../../../common/utils";
10
+ import { defaultClientDataStoreProvider, isCookieAllowed } from "../../../common/storage/default/defaultClientDataStoreProvider";
10
11
  import { endChat, prepareEndChat } from "../common/endChat";
11
12
  import { handleChatReconnect, isReconnectEnabled } from "../common/reconnectChatHelper";
12
13
  import { shouldShowCallingContainer, shouldShowChatButton, shouldShowConfirmationPane, shouldShowEmailTranscriptPane, shouldShowHeader, shouldShowLoadingPane, shouldShowOutOfOfficeHoursPane, shouldShowPostChatLoadingPane, shouldShowPostChatSurveyPane, shouldShowPreChatSurveyPane, shouldShowProactiveChatPane, shouldShowReconnectChatPane, shouldShowWebChatContainer } from "../../../controller/componentController";
@@ -15,8 +16,8 @@ import CallingContainerStateful from "../../callingcontainerstateful/CallingCont
15
16
  import ChatButtonStateful from "../../chatbuttonstateful/ChatButtonStateful";
16
17
  import ConfirmationPaneStateful from "../../confirmationpanestateful/ConfirmationPaneStateful";
17
18
  import { ConversationState } from "../../../contexts/common/ConversationState";
18
- import createDownloadTranscriptProps from "../common/createDownloadTranscriptProps";
19
19
  import { DataStoreManager } from "../../../common/contextDataStore/DataStoreManager";
20
+ import DraggableChatWidget from "../../draggable/DraggableChatWidget";
20
21
  import { ElementType } from "@microsoft/omnichannel-chat-components";
21
22
  import EmailTranscriptPaneStateful from "../../emailtranscriptpanestateful/EmailTranscriptPaneStateful";
22
23
  import HeaderStateful from "../../headerstateful/HeaderStateful";
@@ -31,9 +32,9 @@ import ReconnectChatPaneStateful from "../../reconnectchatpanestateful/Reconnect
31
32
  import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
32
33
  import { TelemetryTimers } from "../../../common/telemetry/TelemetryManager";
33
34
  import WebChatContainerStateful from "../../webchatcontainerstateful/WebChatContainerStateful";
35
+ import createDownloadTranscriptProps from "../common/createDownloadTranscriptProps";
34
36
  import { createFooter } from "../common/createFooter";
35
37
  import { createInternetConnectionChangeHandler } from "../common/createInternetConnectionChangeHandler";
36
- import { defaultClientDataStoreProvider } from "../../../common/storage/default/defaultClientDataStoreProvider";
37
38
  import { defaultScrollBarProps } from "../common/defaultProps/defaultScrollBarProps";
38
39
  import { defaultWebChatContainerStatefulProps } from "../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps";
39
40
  import { disposeTelemetryLoggers } from "../common/disposeTelemetryLoggers";
@@ -49,7 +50,6 @@ import { startProactiveChat } from "../common/startProactiveChat";
49
50
  import useChatAdapterStore from "../../../hooks/useChatAdapterStore";
50
51
  import useChatContextStore from "../../../hooks/useChatContextStore";
51
52
  import useChatSDKStore from "../../../hooks/useChatSDKStore";
52
- import DraggableChatWidget from "../../draggable/DraggableChatWidget";
53
53
  export const LiveChatWidgetStateful = props => {
54
54
  var _props$webChatContain, _props$styleProps, _chatSDK$omnichannelC, _props$controlProps, _props$controlProps2, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain6, _props$controlProps11, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$contro10, _livechatProps$compon8, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$compon11, _livechatProps$compon12;
55
55
  const [state, dispatch] = useChatContextStore();
@@ -426,6 +426,9 @@ export const LiveChatWidgetStateful = props => {
426
426
  payload: undefined
427
427
  });
428
428
  });
429
+
430
+ // Check for TPC and log in telemetry if blocked
431
+ isCookieAllowed();
429
432
  return () => {
430
433
  disposeTelemetryLoggers();
431
434
  };
@@ -672,7 +675,7 @@ export const LiveChatWidgetStateful = props => {
672
675
  initStartChat: initStartChatRelay
673
676
  })), !((_livechatProps$contro9 = livechatProps.controlProps) !== null && _livechatProps$contro9 !== void 0 && _livechatProps$contro9.hideCallingContainer) && shouldShowCallingContainer(state) && /*#__PURE__*/React.createElement(CallingContainerStateful, _extends({
674
677
  voiceVideoCallingSdk: voiceVideoCallingSDK
675
- }, livechatProps.callingContainerProps)), !((_livechatProps$contro10 = livechatProps.controlProps) !== null && _livechatProps$contro10 !== void 0 && _livechatProps$contro10.hideWebChatContainer) && shouldShowWebChatContainer(state) && (decodeComponentString((_livechatProps$compon8 = livechatProps.componentOverrides) === null || _livechatProps$compon8 === void 0 ? void 0 : _livechatProps$compon8.webChatContainer) || /*#__PURE__*/React.createElement(WebChatContainerStateful, livechatProps.webChatContainerProps)), !((_livechatProps$contro11 = livechatProps.controlProps) !== null && _livechatProps$contro11 !== void 0 && _livechatProps$contro11.hideConfirmationPane) && shouldShowConfirmationPane(state) && (decodeComponentString((_livechatProps$compon9 = livechatProps.componentOverrides) === null || _livechatProps$compon9 === void 0 ? void 0 : _livechatProps$compon9.confirmationPane) || /*#__PURE__*/React.createElement(ConfirmationPaneStateful, _extends({}, confirmationPaneProps, {
678
+ }, livechatProps.callingContainerProps)), !((_livechatProps$contro10 = livechatProps.controlProps) !== null && _livechatProps$contro10 !== void 0 && _livechatProps$contro10.hideWebChatContainer) && shouldShowWebChatContainer(state) && (decodeComponentString((_livechatProps$compon8 = livechatProps.componentOverrides) === null || _livechatProps$compon8 === void 0 ? void 0 : _livechatProps$compon8.webChatContainer) || /*#__PURE__*/React.createElement(WebChatContainerStateful, livechatProps)), !((_livechatProps$contro11 = livechatProps.controlProps) !== null && _livechatProps$contro11 !== void 0 && _livechatProps$contro11.hideConfirmationPane) && shouldShowConfirmationPane(state) && (decodeComponentString((_livechatProps$compon9 = livechatProps.componentOverrides) === null || _livechatProps$compon9 === void 0 ? void 0 : _livechatProps$compon9.confirmationPane) || /*#__PURE__*/React.createElement(ConfirmationPaneStateful, _extends({}, confirmationPaneProps, {
676
679
  setPostChatContext: setPostChatContextRelay,
677
680
  prepareEndChat: prepareEndChatRelay
678
681
  }))), !((_livechatProps$contro12 = livechatProps.controlProps) !== null && _livechatProps$contro12 !== void 0 && _livechatProps$contro12.hidePostChatLoadingPane) && shouldShowPostChatLoadingPane(state) && (decodeComponentString((_livechatProps$compon10 = livechatProps.componentOverrides) === null || _livechatProps$compon10 === void 0 ? void 0 : _livechatProps$compon10.postChatLoadingPane) || /*#__PURE__*/React.createElement(PostChatLoadingPaneStateful, livechatProps.postChatLoadingPaneProps)), shouldShowPostChatSurveyPane(state) && (decodeComponentString((_livechatProps$compon11 = livechatProps.componentOverrides) === null || _livechatProps$compon11 === void 0 ? void 0 : _livechatProps$compon11.postChatSurveyPane) || /*#__PURE__*/React.createElement(PostChatSurveyPaneStateful, _extends({}, livechatProps.postChatSurveyPaneProps, livechatProps.chatSDK))), createFooter(livechatProps, state), shouldShowEmailTranscriptPane(state) && (decodeComponentString((_livechatProps$compon12 = livechatProps.componentOverrides) === null || _livechatProps$compon12 === void 0 ? void 0 : _livechatProps$compon12.emailTranscriptPane) || /*#__PURE__*/React.createElement(EmailTranscriptPaneStateful, livechatProps.emailTranscriptPane))))));
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+
1
3
  import { Stack } from "@fluentui/react";
2
4
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
3
5
  import React, { useEffect } from "react";
@@ -6,18 +8,20 @@ import { BroadcastChannel } from "broadcast-channel";
6
8
  import { Components } from "botframework-webchat";
7
9
  import { Constants } from "../../common/Constants";
8
10
  import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
11
+ import { NotificationHandler } from "./webchatcontroller/notification/NotificationHandler";
12
+ import { NotificationScenarios } from "./webchatcontroller/enums/NotificationScenarios";
9
13
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
10
14
  import { WebChatActionType } from "./webchatcontroller/enums/WebChatActionType";
11
15
  import { WebChatStoreLoader } from "./webchatcontroller/WebChatStoreLoader";
12
16
  import { defaultAdaptiveCardStyles } from "./common/defaultStyles/defaultAdaptiveCardStyles";
13
17
  import { defaultMiddlewareLocalizedTexts } from "./common/defaultProps/defaultMiddlewareLocalizedTexts";
14
18
  import { defaultReceivedMessageAnchorStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles";
19
+ import { defaultSentMessageAnchorStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles";
15
20
  import { defaultSystemMessageBoxStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles";
16
21
  import { defaultUserMessageBoxStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles";
17
22
  import { defaultWebChatContainerStatefulProps } from "./common/defaultProps/defaultWebChatContainerStatefulProps";
18
23
  import { setFocusOnSendBox } from "../../common/utils";
19
24
  import { useChatContextStore } from "../..";
20
- import { defaultSentMessageAnchorStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles";
21
25
  const broadcastChannelMessageEvent = "message";
22
26
  const postActivity = activity => {
23
27
  // eslint-disable-line @typescript-eslint/no-explicit-any
@@ -44,28 +48,33 @@ const createMagicCodeSuccessResponse = signin => {
44
48
  };
45
49
  };
46
50
  export const WebChatContainerStateful = props => {
47
- var _props$adaptiveCardSt, _props$renderingMiddl, _props$renderingMiddl2, _props$renderingMiddl3, _props$renderingMiddl4, _props$adaptiveCardSt2, _props$adaptiveCardSt3, _props$adaptiveCardSt4, _props$adaptiveCardSt5, _props$renderingMiddl5, _props$renderingMiddl6, _props$renderingMiddl7, _props$renderingMiddl8, _props$renderingMiddl9, _props$renderingMiddl10;
51
+ var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15;
48
52
  const {
49
53
  BasicWebChat
50
54
  } = Components;
51
55
  const [state, dispatch] = useChatContextStore();
52
56
  const magicCodeBroadcastChannel = new BroadcastChannel(Constants.magicCodeBroadcastChannel);
53
57
  const magicCodeResponseBroadcastChannel = new BroadcastChannel(Constants.magicCodeResponseBroadcastChannel);
58
+ const {
59
+ webChatContainerProps,
60
+ contextDataStore
61
+ } = props;
54
62
  const containerStyles = {
55
- root: Object.assign({}, defaultWebChatContainerStatefulProps.containerStyles, props === null || props === void 0 ? void 0 : props.containerStyles, {
63
+ root: Object.assign({}, defaultWebChatContainerStatefulProps.containerStyles, webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.containerStyles, {
56
64
  display: state.appStates.isMinimized ? "none" : ""
57
65
  }) // Use this instead of removing WebChat from the picture so that the activity observer inside the adapter is not invoked
58
66
  };
59
67
 
60
68
  const localizedTexts = {
61
69
  ...defaultMiddlewareLocalizedTexts,
62
- ...(props === null || props === void 0 ? void 0 : props.localizedTexts)
70
+ ...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
63
71
  };
64
72
  useEffect(() => {
73
+ var _props$webChatContain, _props$webChatContain2;
65
74
  setFocusOnSendBox();
66
75
  dispatch({
67
76
  type: LiveChatWidgetActionType.SET_RENDERING_MIDDLEWARE_PROPS,
68
- payload: props === null || props === void 0 ? void 0 : props.renderingMiddlewareProps
77
+ payload: webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.renderingMiddlewareProps
69
78
  });
70
79
  dispatch({
71
80
  type: LiveChatWidgetActionType.SET_MIDDLEWARE_LOCALIZED_TEXTS,
@@ -74,6 +83,17 @@ export const WebChatContainerStateful = props => {
74
83
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
75
84
  Event: TelemetryEvent.WebChatLoaded
76
85
  });
86
+ if (((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : (_props$webChatContain2 = _props$webChatContain.renderingMiddlewareProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.disableThirdPartyCookiesAlert) !== true && !contextDataStore) {
87
+ try {
88
+ localStorage;
89
+ sessionStorage;
90
+ } catch (error) {
91
+ if (!window.TPCWarningShown) {
92
+ NotificationHandler.notifyWarning(NotificationScenarios.TPC, (localizedTexts === null || localizedTexts === void 0 ? void 0 : localizedTexts.THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE) ?? "");
93
+ window.TPCWarningShown = true;
94
+ }
95
+ }
96
+ }
77
97
  }, []);
78
98
  useEffect(() => {
79
99
  const eventListener = event => {
@@ -114,33 +134,33 @@ export const WebChatContainerStateful = props => {
114
134
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
115
135
 
116
136
  .webchat__bubble__content>div#ms_lcw_webchat_adaptive_card {
117
- background: ${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt = props.adaptiveCardStyles) === null || _props$adaptiveCardSt === void 0 ? void 0 : _props$adaptiveCardSt.background) ?? defaultAdaptiveCardStyles.background};
137
+ background: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp === void 0 ? void 0 : _webChatContainerProp.background) ?? defaultAdaptiveCardStyles.background};
118
138
  }
119
139
 
120
140
  .webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__bubble--from-user {
121
- max-width: ${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl = props.renderingMiddlewareProps) === null || _props$renderingMiddl === void 0 ? void 0 : (_props$renderingMiddl2 = _props$renderingMiddl.userMessageBoxStyles) === null || _props$renderingMiddl2 === void 0 ? void 0 : _props$renderingMiddl2.maxWidth) ?? (defaultUserMessageBoxStyles === null || defaultUserMessageBoxStyles === void 0 ? void 0 : defaultUserMessageBoxStyles.maxWidth)}
141
+ max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp2 === void 0 ? void 0 : (_webChatContainerProp3 = _webChatContainerProp2.userMessageBoxStyles) === null || _webChatContainerProp3 === void 0 ? void 0 : _webChatContainerProp3.maxWidth) ?? (defaultUserMessageBoxStyles === null || defaultUserMessageBoxStyles === void 0 ? void 0 : defaultUserMessageBoxStyles.maxWidth)}
122
142
  }
123
143
 
124
144
  .webchat__stacked-layout--show-avatar div.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__stacked-layout__message {
125
- max-width: ${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl3 = props.renderingMiddlewareProps) === null || _props$renderingMiddl3 === void 0 ? void 0 : (_props$renderingMiddl4 = _props$renderingMiddl3.systemMessageBoxStyles) === null || _props$renderingMiddl4 === void 0 ? void 0 : _props$renderingMiddl4.maxWidth) ?? (defaultSystemMessageBoxStyles === null || defaultSystemMessageBoxStyles === void 0 ? void 0 : defaultSystemMessageBoxStyles.maxWidth)}
145
+ max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp4 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp4 === void 0 ? void 0 : (_webChatContainerProp5 = _webChatContainerProp4.systemMessageBoxStyles) === null || _webChatContainerProp5 === void 0 ? void 0 : _webChatContainerProp5.maxWidth) ?? (defaultSystemMessageBoxStyles === null || defaultSystemMessageBoxStyles === void 0 ? void 0 : defaultSystemMessageBoxStyles.maxWidth)}
126
146
  }
127
147
 
128
148
  div[class="ac-textBlock"] *,
129
- div[class="ac-input-container"] * {color:${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt2 = props.adaptiveCardStyles) === null || _props$adaptiveCardSt2 === void 0 ? void 0 : _props$adaptiveCardSt2.color) ?? defaultAdaptiveCardStyles.color}; white-space:${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt3 = props.adaptiveCardStyles) === null || _props$adaptiveCardSt3 === void 0 ? void 0 : _props$adaptiveCardSt3.textWhiteSpace) ?? defaultAdaptiveCardStyles.textWhiteSpace}}
149
+ div[class="ac-input-container"] * {color:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp6 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp6 === void 0 ? void 0 : _webChatContainerProp6.color) ?? defaultAdaptiveCardStyles.color}; white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp7 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp7 === void 0 ? void 0 : _webChatContainerProp7.textWhiteSpace) ?? defaultAdaptiveCardStyles.textWhiteSpace}}
130
150
  div[class="ac-textBlock"] a:link,
131
151
  div[class="ac-textBlock"] a:visited,
132
152
  div[class="ac-textBlock"] a:hover,
133
153
  div[class="ac-textBlock"] a:active {
134
- color: ${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt4 = props.adaptiveCardStyles) === null || _props$adaptiveCardSt4 === void 0 ? void 0 : _props$adaptiveCardSt4.anchorColor) ?? defaultAdaptiveCardStyles.anchorColor};
154
+ color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.anchorColor) ?? defaultAdaptiveCardStyles.anchorColor};
135
155
  }
136
156
 
137
- .webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt5 = props.adaptiveCardStyles) === null || _props$adaptiveCardSt5 === void 0 ? void 0 : _props$adaptiveCardSt5.buttonWhiteSpace) ?? defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
157
+ .webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp9 === void 0 ? void 0 : _webChatContainerProp9.buttonWhiteSpace) ?? defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
138
158
 
139
159
  .ms_lcw_webchat_received_message img.webchat__markdown__external-link-icon {
140
160
  background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03LjI1MDEgNC41MDAxN0gxMC43NDk1QzExLjE2MzcgNC41MDAxNyAxMS40OTk1IDQuODM1OTYgMTEuNDk5NSA1LjI1MDE3QzExLjQ5OTUgNS42Mjk4NiAxMS4yMTczIDUuOTQzNjYgMTAuODUxMyA1Ljk5MzMyTDEwLjc0OTUgNi4wMDAxN0g3LjI0OTc0QzYuMDcwNzkgNS45OTk2MSA1LjEwMzQ5IDYuOTA2NTYgNS4wMDc4NiA4LjA2MTEyTDUuMDAwMjggOC4yMjAwM0w1LjAwMzEyIDE2Ljc1MDdDNS4wMDM0MyAxNy45NDE1IDUuOTI4ODUgMTguOTE2MSA3LjA5OTY2IDE4Ljk5NDlMNy4yNTM3MSAxOS4wMDAxTDE1Ljc1MTggMTguOTg4NEMxNi45NDE1IDE4Ljk4NjggMTcuOTE0NSAxOC4wNjIgMTcuOTkzNSAxNi44OTIzTDE3Ljk5ODcgMTYuNzM4NFYxMy4yMzIxQzE3Ljk5ODcgMTIuODE3OSAxOC4zMzQ1IDEyLjQ4MjEgMTguNzQ4NyAxMi40ODIxQzE5LjEyODQgMTIuNDgyMSAxOS40NDIyIDEyLjc2NDMgMTkuNDkxOCAxMy4xMzAzTDE5LjQ5ODcgMTMuMjMyMVYxNi43Mzg0QzE5LjQ5ODcgMTguNzQwNyAxNy45MjkzIDIwLjM3NjkgMTUuOTUyOCAyMC40ODI5TDE1Ljc1MzggMjAuNDg4NEw3LjI1ODI3IDIwLjUwMDFMNy4wNTQ5NSAyMC40OTQ5QzUuMTQyMzkgMjAuMzk1NCAzLjYwODk1IDE4Ljg2MjcgMy41MDgzNyAxNi45NTAyTDMuNTAzMTIgMTYuNzUxMUwzLjUwMDg5IDguMjUyN0wzLjUwNTI5IDguMDUwMkMzLjYwNTM5IDYuMTM3NDkgNS4xMzg2NyA0LjYwNDQ5IDcuMDUwOTYgNC41MDUyN0w3LjI1MDEgNC41MDAxN0gxMC43NDk1SDcuMjUwMVpNMTMuNzQ4MSAzLjAwMTQ2TDIwLjMwMTggMy4wMDE5N0wyMC40MDE0IDMuMDE1NzVMMjAuNTAyMiAzLjA0MzkzTDIwLjU1OSAzLjA2ODAzQzIwLjYxMjIgMy4wOTEyMiAyMC42NjM0IDMuMTIxNjMgMjAuNzExMSAzLjE1ODg1TDIwLjc4MDQgMy4yMjE1NkwyMC44NjQxIDMuMzIwMTRMMjAuOTE4MyAzLjQxMDI1TDIwLjk1NyAzLjUwMDU3TDIwLjk3NjIgMy41NjQ3NkwyMC45ODk4IDMuNjI4NjJMMjAuOTk5MiAzLjcyMjgyTDIwLjk5OTcgMTAuMjU1NEMyMC45OTk3IDEwLjY2OTYgMjAuNjYzOSAxMS4wMDU0IDIwLjI0OTcgMTEuMDA1NEMxOS44NyAxMS4wMDU0IDE5LjU1NjIgMTAuNzIzMiAxOS41MDY1IDEwLjM1NzFMMTkuNDk5NyAxMC4yNTU0TDE5LjQ5ODkgNS41NjE0N0wxMi4yNzk3IDEyLjc4NDdDMTIuMDEzNCAxMy4wNTEgMTEuNTk2OCAxMy4wNzUzIDExLjMwMzEgMTIuODU3NUwxMS4yMTkgMTIuNzg0OUMxMC45NTI3IDEyLjUxODcgMTAuOTI4NCAxMi4xMDIxIDExLjE0NjIgMTEuODA4NEwxMS4yMTg4IDExLjcyNDNMMTguNDM2OSA0LjUwMTQ2SDEzLjc0ODFDMTMuMzY4NCA0LjUwMTQ2IDEzLjA1NDYgNC4yMTkzMSAxMy4wMDUgMy44NTMyNEwxMi45OTgxIDMuNzUxNDZDMTIuOTk4MSAzLjM3MTc3IDEzLjI4MDMgMy4wNTc5NyAxMy42NDY0IDMuMDA4MzFMMTMuNzQ4MSAzLjAwMTQ2WiIgZmlsbD0iI0ZGRkZGRiIgLz48L3N2Zz4) !important;
141
161
  height: '.75em';
142
162
  marginLeft: '.25em';
143
- filter:${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl5 = props.renderingMiddlewareProps) === null || _props$renderingMiddl5 === void 0 ? void 0 : (_props$renderingMiddl6 = _props$renderingMiddl5.receivedMessageAnchorStyles) === null || _props$renderingMiddl6 === void 0 ? void 0 : _props$renderingMiddl6.filter) ?? "none"};
163
+ filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp10 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp10 === void 0 ? void 0 : (_webChatContainerProp11 = _webChatContainerProp10.receivedMessageAnchorStyles) === null || _webChatContainerProp11 === void 0 ? void 0 : _webChatContainerProp11.filter) ?? "none"};
144
164
  }
145
165
  pre {
146
166
  white-space: pre-wrap;
@@ -153,13 +173,13 @@ export const WebChatContainerStateful = props => {
153
173
  .ms_lcw_webchat_received_message a:visited,
154
174
  .ms_lcw_webchat_received_message a:hover,
155
175
  .ms_lcw_webchat_received_message a:active {
156
- color: ${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl7 = props.renderingMiddlewareProps) === null || _props$renderingMiddl7 === void 0 ? void 0 : (_props$renderingMiddl8 = _props$renderingMiddl7.receivedMessageAnchorStyles) === null || _props$renderingMiddl8 === void 0 ? void 0 : _props$renderingMiddl8.color) ?? (defaultReceivedMessageAnchorStyles === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.color)};
176
+ color: ${(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.color) ?? (defaultReceivedMessageAnchorStyles === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.color)};
157
177
  }
158
178
  .ms_lcw_webchat_sent_message a:link,
159
179
  .ms_lcw_webchat_sent_message a:visited,
160
180
  .ms_lcw_webchat_sent_message a:hover,
161
181
  .ms_lcw_webchat_sent_message a:active {
162
- color: ${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl9 = props.renderingMiddlewareProps) === null || _props$renderingMiddl9 === void 0 ? void 0 : (_props$renderingMiddl10 = _props$renderingMiddl9.sentMessageAnchorStyles) === null || _props$renderingMiddl10 === void 0 ? void 0 : _props$renderingMiddl10.color) ?? (defaultSentMessageAnchorStyles === null || defaultSentMessageAnchorStyles === void 0 ? void 0 : defaultSentMessageAnchorStyles.color)};
182
+ color: ${(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.color) ?? (defaultSentMessageAnchorStyles === null || defaultSentMessageAnchorStyles === void 0 ? void 0 : defaultSentMessageAnchorStyles.color)};
163
183
  }
164
184
  `), /*#__PURE__*/React.createElement(Stack, {
165
185
  styles: containerStyles
@@ -24,5 +24,6 @@ export const defaultMiddlewareLocalizedTexts = {
24
24
  MIDDLEWARE_MESSAGE_DELIVERED: "Sent",
25
25
  MIDDLEWARE_MESSAGE_NOT_DELIVERED: "Not Delivered",
26
26
  MIDDLEWARE_MESSAGE_RETRY: "Retry",
27
- MIDDLEWARE_BANNER_CHAT_DISCONNECT: "Your conversation has been disconnected. For additional assistance, please start a new chat."
27
+ MIDDLEWARE_BANNER_CHAT_DISCONNECT: "Your conversation has been disconnected. For additional assistance, please start a new chat.",
28
+ THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE: "Third party cookies are blocked. Reloading this page will start a new conversation."
28
29
  };
@@ -7,4 +7,5 @@ export let NotificationScenarios;
7
7
  NotificationScenarios["InternetConnection"] = "internet connection";
8
8
  NotificationScenarios["MaxSizeError"] = "max size";
9
9
  NotificationScenarios["ChatDisconnect"] = "chat disconnect";
10
+ NotificationScenarios["TPC"] = "tpc blocked";
10
11
  })(NotificationScenarios || (NotificationScenarios = {}));
@@ -1,3 +1,4 @@
1
1
  import { IContextDataStore } from "../../interfaces/IContextDataStore";
2
2
  import { StorageType } from "../../Constants";
3
+ export declare const isCookieAllowed: () => boolean;
3
4
  export declare const defaultClientDataStoreProvider: (cacheTtlinMins?: number, storageType?: StorageType) => IContextDataStore;
@@ -151,6 +151,7 @@ export declare enum TelemetryEvent {
151
151
  SetBotAuthProviderHideCard = "SetBotAuthProviderHideCard",
152
152
  SetBotAuthProviderDisplayCard = "SetBotAuthProviderDisplayCard",
153
153
  SetBotAuthProviderNotFound = "SetBotAuthProviderNotFound",
154
+ ThirdPartyCookiesBlocked = "ThirdPartyCookiesBlocked",
154
155
  ProcessingHTMLTextMiddlewareFailed = "ProcessingHTMLTextMiddlewareFailed",
155
156
  ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
156
157
  FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
@@ -1,3 +1,3 @@
1
- import { IWebChatContainerStatefulProps } from "./interfaces/IWebChatContainerStatefulProps";
2
- export declare const WebChatContainerStateful: (props: IWebChatContainerStatefulProps) => JSX.Element;
1
+ import { ILiveChatWidgetProps } from "../livechatwidget/interfaces/ILiveChatWidgetProps";
2
+ export declare const WebChatContainerStateful: (props: ILiveChatWidgetProps) => JSX.Element;
3
3
  export default WebChatContainerStateful;
@@ -1,5 +1,5 @@
1
- import React from "react";
2
1
  import { IAttachmentProps } from "./IAttachmentProps";
2
+ import React from "react";
3
3
  export interface IRenderingMiddlewareProps {
4
4
  timestampDir?: "ltr" | "rtl" | "auto";
5
5
  disableActivityMiddleware?: boolean;
@@ -8,6 +8,7 @@ export interface IRenderingMiddlewareProps {
8
8
  disableAvatarMiddleware?: boolean;
9
9
  disableGroupActivitiesMiddleware?: boolean;
10
10
  disableTypingIndicatorMiddleware?: boolean;
11
+ disableThirdPartyCookiesAlert?: boolean;
11
12
  hideSendboxOnConversationEnd?: boolean;
12
13
  userMessageStyleProps?: React.CSSProperties;
13
14
  systemMessageStyleProps?: React.CSSProperties;
@@ -5,5 +5,6 @@ export declare enum NotificationScenarios {
5
5
  AttachmentError = "attachment",
6
6
  InternetConnection = "internet connection",
7
7
  MaxSizeError = "max size",
8
- ChatDisconnect = "chat disconnect"
8
+ ChatDisconnect = "chat disconnect",
9
+ TPC = "tpc blocked"
9
10
  }
@@ -20,4 +20,5 @@ export interface ILiveChatWidgetLocalizedTexts {
20
20
  PRECHAT_REQUIRED_FIELD_MISSING_MESSAGE?: string;
21
21
  MARKDOWN_EXTERNAL_LINK_ALT?: string;
22
22
  MIDDLEWARE_BANNER_CHAT_DISCONNECT?: string;
23
+ THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE?: string;
23
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.1.1-main.691fe30",
3
+ "version": "1.1.1-main.c2e1b5a",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",