@microsoft/omnichannel-chat-widget 1.7.5-main.290ba08 → 1.7.6-main.d227a81

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 (42) hide show
  1. package/lib/cjs/common/telemetry/TelemetryConstants.js +32 -0
  2. package/lib/cjs/common/telemetry/TelemetryHelper.js +10 -0
  3. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +15 -1
  4. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +14 -2
  5. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +12 -0
  6. package/lib/cjs/components/footerstateful/FooterStateful.js +15 -0
  7. package/lib/cjs/components/headerstateful/HeaderStateful.js +16 -2
  8. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +35 -2
  9. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +20 -2
  10. package/lib/cjs/components/notificationpanestateful/NotificationPaneStateful.js +21 -7
  11. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +12 -1
  12. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +14 -3
  13. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -0
  14. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +12 -0
  15. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +12 -1
  16. package/lib/cjs/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +19 -8
  17. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +14 -1
  18. package/lib/cjs/plugins/createChatTranscript.js +15 -6
  19. package/lib/esm/common/telemetry/TelemetryConstants.js +32 -0
  20. package/lib/esm/common/telemetry/TelemetryHelper.js +10 -0
  21. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +15 -1
  22. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +14 -3
  23. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +13 -1
  24. package/lib/esm/components/footerstateful/FooterStateful.js +14 -0
  25. package/lib/esm/components/headerstateful/HeaderStateful.js +16 -2
  26. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +35 -2
  27. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +19 -2
  28. package/lib/esm/components/notificationpanestateful/NotificationPaneStateful.js +21 -7
  29. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +12 -1
  30. package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +14 -3
  31. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -1
  32. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +11 -0
  33. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +12 -1
  34. package/lib/esm/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +19 -8
  35. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +14 -1
  36. package/lib/esm/plugins/createChatTranscript.js +15 -6
  37. package/lib/types/common/telemetry/TelemetryConstants.d.ts +33 -1
  38. package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -0
  39. package/lib/types/common/telemetry/definitions/Payload.d.ts +13 -0
  40. package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IWebChatTranscriptConfig.d.ts +1 -0
  41. package/lib/types/components/livechatwidget/common/createDownloadTranscriptProps.d.ts +1 -0
  42. package/package.json +2 -2
@@ -6,17 +6,25 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = exports.ReconnectChatPaneStateful = void 0;
7
7
  var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
8
8
  var _react = _interopRequireWildcard(require("react"));
9
+ var _utils = require("../../common/utils");
9
10
  var _ConversationState = require("../../contexts/common/ConversationState");
10
11
  var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
11
12
  var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
12
13
  var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
13
- var _utils = require("../../common/utils");
14
14
  var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
15
15
  var _useFacadeChatSDKStore = _interopRequireDefault(require("../../hooks/useFacadeChatSDKStore"));
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
  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); }
18
18
  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; }
19
+ let uiTimer;
19
20
  const ReconnectChatPaneStateful = props => {
21
+ (0, _react.useEffect)(() => {
22
+ uiTimer = (0, _utils.createTimer)();
23
+ _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
24
+ Event: _TelemetryConstants.TelemetryEvent.UXReconnectChatPaneStart,
25
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
26
+ });
27
+ }, []);
20
28
  const [state, dispatch] = (0, _useChatContextStore.default)();
21
29
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
30
  //const chatSDK: any = useChatSDKStore();
@@ -100,6 +108,9 @@ const ReconnectChatPaneStateful = props => {
100
108
  _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
101
109
  Event: _TelemetryConstants.TelemetryEvent.ReconnectChatPaneLoaded
102
110
  });
111
+ _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
112
+ Event: _TelemetryConstants.TelemetryEvent.UXReconnectChatCompleted
113
+ });
103
114
  }, []);
104
115
  return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.ReconnectChatPane, {
105
116
  componentOverrides: reconnectChatProps === null || reconnectChatProps === void 0 ? void 0 : reconnectChatProps.componentOverrides,
@@ -4,24 +4,31 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.StartChatErrorPaneStateful = void 0;
7
+ var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
7
8
  var _react = _interopRequireWildcard(require("react"));
8
- var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
9
9
  var _utils = require("../../common/utils");
10
- var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
10
+ var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
11
+ var _Constants = require("../../common/Constants");
12
+ var _StartChatFailureType = require("../../contexts/common/StartChatFailureType");
11
13
  var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
12
- var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
13
14
  var _defaultStartChatErrorPaneGeneralStyleProps = require("./common/defaultStartChatErrorPaneGeneralStyleProps");
14
- var _defaultStartChatErrorPaneTitleStyleProps = require("./common/defaultStartChatErrorPaneTitleStyleProps");
15
- var _defaultStartChatErrorPaneSubtitleStyleProps = require("./common/defaultStartChatErrorPaneSubtitleStyleProps");
16
- var _defaultStartChatErrorPaneIconStyleProps = require("./common/defaultStartChatErrorPaneIconStyleProps");
17
15
  var _defaultStartChatErrorPaneIconImageProps = require("./common/defaultStartChatErrorPaneIconImageProps");
18
- var _Constants = require("../../common/Constants");
19
- var _StartChatFailureType = require("../../contexts/common/StartChatFailureType");
16
+ var _defaultStartChatErrorPaneIconStyleProps = require("./common/defaultStartChatErrorPaneIconStyleProps");
17
+ var _defaultStartChatErrorPaneSubtitleStyleProps = require("./common/defaultStartChatErrorPaneSubtitleStyleProps");
18
+ var _defaultStartChatErrorPaneTitleStyleProps = require("./common/defaultStartChatErrorPaneTitleStyleProps");
19
+ var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
  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); }
22
22
  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; }
23
+ let uiTimer;
23
24
  const StartChatErrorPaneStateful = startChatErrorPaneProps => {
24
25
  var _startChatErrorPanePr, _startChatErrorPanePr2, _startChatErrorPanePr3, _startChatErrorPanePr4, _startChatErrorPanePr5, _startChatErrorPanePr6, _startChatErrorPanePr7, _startChatErrorPanePr8, _startChatErrorPanePr9, _startChatErrorPanePr10, _startChatErrorPanePr11;
26
+ (0, _react.useEffect)(() => {
27
+ uiTimer = (0, _utils.createTimer)();
28
+ _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
29
+ Event: _TelemetryConstants.TelemetryEvent.UXStartChatErrorPaneStart
30
+ });
31
+ }, []);
25
32
  const [state] = (0, _useChatContextStore.default)();
26
33
  const generalStyleProps = Object.assign({}, _defaultStartChatErrorPaneGeneralStyleProps.defaultStartChatErrorPaneGeneralStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr === void 0 ? void 0 : _startChatErrorPanePr.generalStyleProps);
27
34
  const titleStyleProps = Object.assign({}, _defaultStartChatErrorPaneTitleStyleProps.defaultStartChatErrorPaneTitleStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr2 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr2 === void 0 ? void 0 : _startChatErrorPanePr2.titleStyleProps);
@@ -70,6 +77,10 @@ const StartChatErrorPaneStateful = startChatErrorPaneProps => {
70
77
  Event: _TelemetryConstants.TelemetryEvent.StartChatErrorPaneLoaded,
71
78
  Description: "Start chat error pane loaded."
72
79
  });
80
+ _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
81
+ Event: _TelemetryConstants.TelemetryEvent.UXStartChatErrorCompleted,
82
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
83
+ });
73
84
  }, []);
74
85
  return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.LoadingPane, {
75
86
  componentOverrides: startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : startChatErrorPaneProps.componentOverrides,
@@ -7,6 +7,7 @@ exports.default = exports.WebChatContainerStateful = void 0;
7
7
  var _react = require("@fluentui/react");
8
8
  var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
9
9
  var _react2 = _interopRequireWildcard(require("react"));
10
+ var _utils = require("../../common/utils");
10
11
  var _BotMagicCodeStore = require("./webchatcontroller/BotMagicCodeStore");
11
12
  var _botframeworkWebchat = require("botframework-webchat");
12
13
  var _Constants = require("../../common/Constants");
@@ -23,12 +24,12 @@ var _defaultSentMessageAnchorStyles = require("./webchatcontroller/middlewares/r
23
24
  var _defaultSystemMessageBoxStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles");
24
25
  var _defaultUserMessageBoxStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles");
25
26
  var _defaultWebChatContainerStatefulProps = require("./common/defaultProps/defaultWebChatContainerStatefulProps");
26
- var _utils = require("../../common/utils");
27
27
  var _ = require("../..");
28
28
  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); }
29
29
  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; }
30
30
  /* eslint-disable @typescript-eslint/no-explicit-any */
31
31
 
32
+ let uiTimer;
32
33
  const broadcastChannelMessageEvent = "message";
33
34
  const postActivity = activity => {
34
35
  // eslint-disable-line @typescript-eslint/no-explicit-any
@@ -56,6 +57,12 @@ const createMagicCodeSuccessResponse = signin => {
56
57
  };
57
58
  const WebChatContainerStateful = props => {
58
59
  var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _props$webChatContain9, _props$webChatContain10;
60
+ (0, _react2.useEffect)(() => {
61
+ uiTimer = (0, _utils.createTimer)();
62
+ _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
63
+ Event: _TelemetryConstants.TelemetryEvent.UXWebchatContainerCompleted
64
+ });
65
+ }, []);
59
66
  const {
60
67
  BasicWebChat
61
68
  } = _botframeworkWebchat.Components;
@@ -151,6 +158,12 @@ const WebChatContainerStateful = props => {
151
158
  };
152
159
  magicCodeBroadcastChannel.addEventListener(broadcastChannelMessageEvent, eventListener);
153
160
  }, []);
161
+ (0, _react2.useEffect)(() => {
162
+ _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
163
+ Event: _TelemetryConstants.TelemetryEvent.UXWebchatContainerCompleted,
164
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
165
+ });
166
+ }, []);
154
167
  return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("style", null, `
155
168
  .webchat__stacked-layout__content .ac-pushButton {
156
169
  cursor: pointer;
@@ -14,7 +14,7 @@ class TranscriptHTMLBuilder {
14
14
  // eslint-disable-line @typescript-eslint/no-explicit-any
15
15
 
16
16
  constructor(options) {
17
- var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12;
17
+ var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12, _this$options13;
18
18
  _defineProperty(this, "options", void 0);
19
19
  _defineProperty(this, "pageTitle", "Customer Transcript");
20
20
  _defineProperty(this, "attachmentMessage", "The following attachment was uploaded during the conversation: ");
@@ -25,6 +25,7 @@ class TranscriptHTMLBuilder {
25
25
  _defineProperty(this, "agentAvatarFontColor", "#000");
26
26
  _defineProperty(this, "customerAvatarBackgroundColor", "#2266E3");
27
27
  _defineProperty(this, "customerAvatarFontColor", "#FFF");
28
+ _defineProperty(this, "customerDisplayName", "");
28
29
  _defineProperty(this, "disableMarkdownMessageFormatting", false);
29
30
  _defineProperty(this, "disableNewLineMarkdownSupport", false);
30
31
  _defineProperty(this, "externalScripts", {});
@@ -60,13 +61,16 @@ class TranscriptHTMLBuilder {
60
61
  if ((_this$options9 = this.options) !== null && _this$options9 !== void 0 && _this$options9.customerAvatarFontColor) {
61
62
  this.customerAvatarFontColor = this.options.customerAvatarFontColor;
62
63
  }
63
- if ((_this$options10 = this.options) !== null && _this$options10 !== void 0 && _this$options10.disableMarkdownMessageFormatting) {
64
+ if ((_this$options10 = this.options) !== null && _this$options10 !== void 0 && _this$options10.customerDisplayName) {
65
+ this.customerDisplayName = this.options.customerDisplayName;
66
+ }
67
+ if ((_this$options11 = this.options) !== null && _this$options11 !== void 0 && _this$options11.disableMarkdownMessageFormatting) {
64
68
  this.disableMarkdownMessageFormatting = this.options.disableMarkdownMessageFormatting;
65
69
  }
66
- if ((_this$options11 = this.options) !== null && _this$options11 !== void 0 && _this$options11.disableNewLineMarkdownSupport) {
70
+ if ((_this$options12 = this.options) !== null && _this$options12 !== void 0 && _this$options12.disableNewLineMarkdownSupport) {
67
71
  this.disableNewLineMarkdownSupport = this.options.disableNewLineMarkdownSupport;
68
72
  }
69
- if ((_this$options12 = this.options) !== null && _this$options12 !== void 0 && _this$options12.externalScripts) {
73
+ if ((_this$options13 = this.options) !== null && _this$options13 !== void 0 && _this$options13.externalScripts) {
70
74
  this.externalScripts = this.options.externalScripts;
71
75
  }
72
76
  }
@@ -528,7 +532,12 @@ class TranscriptHTMLBuilder {
528
532
  const avatarMiddleware = () => (next) => (...args) => {
529
533
  const [card] = args;
530
534
  const {fromUser, activity} = card;
531
- const initials = getIconText(activity.from.name);
535
+ let displayName = getIconText(activity.from.name);
536
+ let customerDisplayName = '${this.customerDisplayName}';
537
+
538
+ if (fromUser && customerDisplayName) {
539
+ displayName = customerDisplayName;
540
+ }
532
541
 
533
542
  const avatarElement = React.createElement(
534
543
  "div",
@@ -536,7 +545,7 @@ class TranscriptHTMLBuilder {
536
545
  React.createElement(
537
546
  "p",
538
547
  null,
539
- \`\${initials}\`
548
+ \`\${displayName}\`
540
549
  )
541
550
  );
542
551
 
@@ -135,6 +135,7 @@ export let TelemetryEvent;
135
135
  TelemetryEvent["ConfirmationCancelButtonClicked"] = "ConfirmationCancelButtonClicked";
136
136
  TelemetryEvent["ConfirmationConfirmButtonClicked"] = "ConfirmationConfirmButtonClicked";
137
137
  TelemetryEvent["LoadingPaneLoaded"] = "LoadingPaneLoaded";
138
+ TelemetryEvent["LoadingPaneUnloaded"] = "LoadingPaneUnloaded";
138
139
  TelemetryEvent["StartChatErrorPaneLoaded"] = "StartChatErrorPaneLoaded";
139
140
  TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
140
141
  TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
@@ -167,6 +168,7 @@ export let TelemetryEvent;
167
168
  TelemetryEvent["SetBotAuthProviderNotFound"] = "SetBotAuthProviderNotFound";
168
169
  TelemetryEvent["BotAuthActivityUndefinedSignInId"] = "BotAuthActivityUndefinedSignInId";
169
170
  TelemetryEvent["ThirdPartyCookiesBlocked"] = "ThirdPartyCookiesBlocked";
171
+ TelemetryEvent["ParticipantsRemovedEvent"] = "ParticipantsRemovedEvent";
170
172
  TelemetryEvent["ProcessingHTMLTextMiddlewareFailed"] = "ProcessingHTMLTextMiddlewareFailed";
171
173
  TelemetryEvent["ProcessingSanitizationMiddlewareFailed"] = "ProcessingSanitizationMiddlewareFailed";
172
174
  TelemetryEvent["FormatTagsMiddlewareJSONStringifyFailed"] = "FormatTagsMiddlewareJSONStringifyFailed";
@@ -218,6 +220,36 @@ export let TelemetryEvent;
218
220
  TelemetryEvent["NewTokenFailed"] = "NewTokenFailed";
219
221
  TelemetryEvent["NewTokenExpired"] = "NewTokenExpired";
220
222
  TelemetryEvent["TokenEmptyOrSame"] = "TokenEmptyOrSame";
223
+ TelemetryEvent["UXFooterStart"] = "UXFooterStart";
224
+ TelemetryEvent["UXFooterCompleted"] = "UXFooterCompleted";
225
+ TelemetryEvent["UXHeaderStart"] = "UXHeaderStart";
226
+ TelemetryEvent["UXHeaderCompleted"] = "UXHeaderCompleted";
227
+ TelemetryEvent["UXLoadingPaneStart"] = "UXLoadingPaneStart";
228
+ TelemetryEvent["UXLoadingPaneCompleted"] = "UXLoadingPaneCompleted";
229
+ TelemetryEvent["UXNotificationPaneStart"] = "UXNotificationPaneStart";
230
+ TelemetryEvent["UXNotificationPaneCompleted"] = "UXNotificationPaneCompleted";
231
+ TelemetryEvent["UXOOHPaneStart"] = "UXOOHPaneStart";
232
+ TelemetryEvent["UXOOHPaneCompleted"] = "UXOOHPaneCompleted";
233
+ TelemetryEvent["UXPostChatLoadingPaneStart"] = "UXPostChatLoadingPaneStart";
234
+ TelemetryEvent["UXPostChatLoadingPaneCompleted"] = "UXPostChatLoadingPaneCompleted";
235
+ TelemetryEvent["UXPrechatPaneStart"] = "UXPrechatPaneStart";
236
+ TelemetryEvent["UXPrechatPaneCompleted"] = "UXPrechatPaneCompleted";
237
+ TelemetryEvent["UXProactiveChatPaneStart"] = "UXProactiveChatPaneStart";
238
+ TelemetryEvent["UXProactiveChatCompleted"] = "UXProactiveChatCompleted";
239
+ TelemetryEvent["UXReconnectChatPaneStart"] = "UXReconnectChatPaneStart";
240
+ TelemetryEvent["UXReconnectChatCompleted"] = "UXReconnectChatCompleted";
241
+ TelemetryEvent["UXStartChatErrorPaneStart"] = "UXStartChatErrorPaneStart";
242
+ TelemetryEvent["UXStartChatErrorCompleted"] = "UXStartChatErrorCompleted";
243
+ TelemetryEvent["UXEmailTranscriptPaneStart"] = "UXEmailTranscriptPaneStart";
244
+ TelemetryEvent["UXEmailTranscriptPaneCompleted"] = "UXEmailTranscriptPaneCompleted";
245
+ TelemetryEvent["UXWebchatContainerStart"] = "UXWebchatContainerStart";
246
+ TelemetryEvent["UXWebchatContainerCompleted"] = "UXWebchatContainerCompleted";
247
+ TelemetryEvent["UXLCWChatButtonStart"] = "UXLCWChatButtonStart";
248
+ TelemetryEvent["UXLCWChatButtonCompleted"] = "UXLCWChatButtonCompleted";
249
+ TelemetryEvent["UXConfirmationPaneStart"] = "UXConfirmationPaneStart";
250
+ TelemetryEvent["UXConfirmationPaneCompleted"] = "UXConfirmationPaneCompleted";
251
+ TelemetryEvent["UXLivechatwidgetStart"] = "UXLivechatwidgetStart";
252
+ TelemetryEvent["UXLivechatwidgetCompleted"] = "UXLivechatwidgetCompleted";
221
253
  })(TelemetryEvent || (TelemetryEvent = {}));
222
254
  export class TelemetryConstants {
223
255
  static map(eventTypeOrScenarioType) {
@@ -213,6 +213,16 @@ _defineProperty(TelemetryHelper, "logLoadingEvent", (logLevel, payload) => {
213
213
  };
214
214
  BroadcastService.postMessage(telemetryEvent);
215
215
  });
216
+ _defineProperty(TelemetryHelper, "logUIEvent", (logLevel, payload) => {
217
+ const telemetryEvent = {
218
+ eventName: (payload === null || payload === void 0 ? void 0 : payload.Event) ?? "",
219
+ logLevel: logLevel,
220
+ payload: {
221
+ ...payload
222
+ }
223
+ };
224
+ BroadcastService.postMessage(telemetryEvent);
225
+ });
216
226
  _defineProperty(TelemetryHelper, "logActionEvent", (logLevel, payload) => {
217
227
  const telemetryEvent = {
218
228
  eventName: (payload === null || payload === void 0 ? void 0 : payload.Event) ?? "",
@@ -1,5 +1,6 @@
1
1
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
2
  import React, { useEffect, useRef, useState } from "react";
3
+ import { createTimer, setFocusOnElement } from "../../common/utils";
3
4
  import { ChatButton } from "@microsoft/omnichannel-chat-components";
4
5
  import { Constants } from "../../common/Constants";
5
6
  import { ConversationState } from "../../contexts/common/ConversationState";
@@ -7,10 +8,19 @@ import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetAc
7
8
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
8
9
  import { TelemetryTimers } from "../../common/telemetry/TelemetryManager";
9
10
  import { defaultOutOfOfficeChatButtonStyleProps } from "./common/styleProps/defaultOutOfOfficeChatButtonStyleProps";
10
- import { setFocusOnElement } from "../../common/utils";
11
11
  import useChatContextStore from "../../hooks/useChatContextStore";
12
+ let uiTimer;
12
13
  export const ChatButtonStateful = props => {
13
14
  var _state$domainStates$l, _state$domainStates$l2, _buttonProps$controlP, _props$buttonProps, _props$buttonProps$co, _props$buttonProps2, _props$buttonProps2$c, _props$buttonProps3, _props$buttonProps3$c;
15
+ // this is to ensure the telemetry is set only once and start the load timer
16
+ useEffect(() => {
17
+ uiTimer = createTimer();
18
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
19
+ Event: TelemetryEvent.UXLCWChatButtonStart
20
+ });
21
+ }, []);
22
+
23
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
24
  const [state, dispatch] = useChatContextStore();
15
25
  const {
16
26
  buttonProps,
@@ -92,6 +102,10 @@ export const ChatButtonStateful = props => {
92
102
  payload: true
93
103
  });
94
104
  }
105
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
106
+ Event: TelemetryEvent.UXLCWChatButtonCompleted,
107
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
108
+ });
95
109
  }, []);
96
110
  return /*#__PURE__*/React.createElement(ChatButton, {
97
111
  componentOverrides: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.componentOverrides,
@@ -1,15 +1,22 @@
1
1
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
- import { ConfirmationPane } from "@microsoft/omnichannel-chat-components";
3
2
  import React, { useEffect } from "react";
4
- import { findAllFocusableElement, findParentFocusableElementsWithoutChildContainer, preventFocusToMoveOutOfElement, setFocusOnElement, setFocusOnSendBox, setTabIndices } from "../../common/utils";
3
+ import { createTimer, findAllFocusableElement, findParentFocusableElementsWithoutChildContainer, preventFocusToMoveOutOfElement, setFocusOnElement, setFocusOnSendBox, setTabIndices } from "../../common/utils";
4
+ import { ConfirmationPane } from "@microsoft/omnichannel-chat-components";
5
+ import { ConfirmationState } from "../../common/Constants";
5
6
  import { DimLayer } from "../dimlayer/DimLayer";
6
7
  import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
7
8
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
8
9
  import useChatContextStore from "../../hooks/useChatContextStore";
9
- import { ConfirmationState } from "../../common/Constants";
10
+ let uiTimer;
10
11
 
11
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
13
  export const ConfirmationPaneStateful = props => {
14
+ useEffect(() => {
15
+ uiTimer = createTimer();
16
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
17
+ Event: TelemetryEvent.UXConfirmationPaneStart
18
+ });
19
+ }, []);
13
20
  const initialTabIndexMap = new Map();
14
21
  let elements = [];
15
22
  const [state, dispatch] = useChatContextStore();
@@ -76,6 +83,10 @@ export const ConfirmationPaneStateful = props => {
76
83
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
77
84
  Event: TelemetryEvent.ConfirmationPaneLoaded
78
85
  });
86
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
87
+ Event: TelemetryEvent.UXConfirmationPaneCompleted,
88
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
89
+ });
79
90
  }, []);
80
91
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DimLayer, {
81
92
  brightness: (controlProps === null || controlProps === void 0 ? void 0 : controlProps.brightnessValueOnDim) ?? "0.2"
@@ -1,6 +1,6 @@
1
1
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
2
  import React, { useCallback, useEffect, useState } from "react";
3
- import { findAllFocusableElement, findParentFocusableElementsWithoutChildContainer, formatTemplateString, preventFocusToMoveOutOfElement, setFocusOnElement, setFocusOnSendBox, setTabIndices } from "../../common/utils";
3
+ import { createTimer, findAllFocusableElement, findParentFocusableElementsWithoutChildContainer, formatTemplateString, preventFocusToMoveOutOfElement, setFocusOnElement, setFocusOnSendBox, setTabIndices } from "../../common/utils";
4
4
  import { DimLayer } from "../dimlayer/DimLayer";
5
5
  import { InputValidationPane } from "@microsoft/omnichannel-chat-components";
6
6
  import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
@@ -11,8 +11,16 @@ import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
11
11
  import { defaultMiddlewareLocalizedTexts } from "../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
12
12
  import useChatContextStore from "../../hooks/useChatContextStore";
13
13
  import useFacadeSDKStore from "../../hooks/useFacadeChatSDKStore";
14
+ let uiTimer;
14
15
  export const EmailTranscriptPaneStateful = props => {
15
16
  var _props$controlProps;
17
+ // this is to ensure the telemetry is set only once and start the load timer
18
+ useEffect(() => {
19
+ uiTimer = createTimer();
20
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
21
+ Event: TelemetryEvent.UXEmailTranscriptPaneStart
22
+ });
23
+ }, []);
16
24
  const initialTabIndexMap = new Map();
17
25
  let elements = [];
18
26
  const [state, dispatch] = useChatContextStore();
@@ -94,6 +102,10 @@ export const EmailTranscriptPaneStateful = props => {
94
102
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
95
103
  Event: TelemetryEvent.EmailTranscriptLoaded
96
104
  });
105
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
106
+ Event: TelemetryEvent.UXEmailTranscriptPaneCompleted,
107
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
108
+ });
97
109
  }, [initialEmail]);
98
110
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DimLayer, {
99
111
  brightness: (controlProps === null || controlProps === void 0 ? void 0 : controlProps.brightnessValueOnDim) ?? "0.2"
@@ -9,13 +9,21 @@ import { NewMessageNotificationSoundBase64 } from "../../assets/Audios";
9
9
  import { NotificationHandler } from "../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler";
10
10
  import { NotificationScenarios } from "../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
11
11
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
12
+ import { createTimer } from "../../common/utils";
12
13
  import { downloadTranscript } from "./downloadtranscriptstateful/DownloadTranscriptStateful";
13
14
  import useChatContextStore from "../../hooks/useChatContextStore";
14
15
  import useFacadeSDKStore from "../../hooks/useFacadeChatSDKStore";
16
+ let uiTimer;
15
17
 
16
18
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
19
  export const FooterStateful = props => {
18
20
  var _footerProps$controlP3;
21
+ useEffect(() => {
22
+ uiTimer = createTimer();
23
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
24
+ Event: TelemetryEvent.UXFooterStart
25
+ });
26
+ }, []);
19
27
  const [state, dispatch] = useChatContextStore();
20
28
  // hideFooterDisplay - the purpose of this is to keep the footer always "active",
21
29
  // but hide it visually in certain states (e.g., loading state) and show in some other states (e.g. active state).
@@ -92,6 +100,12 @@ export const FooterStateful = props => {
92
100
  }
93
101
  }
94
102
  }, [state.appStates.conversationState]);
103
+ useEffect(() => {
104
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
105
+ Event: TelemetryEvent.UXFooterCompleted,
106
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
107
+ });
108
+ }, []);
95
109
  return /*#__PURE__*/React.createElement(React.Fragment, null, !hideFooterDisplay && /*#__PURE__*/React.createElement(Footer, {
96
110
  componentOverrides: footerProps === null || footerProps === void 0 ? void 0 : footerProps.componentOverrides,
97
111
  controlProps: controlProps,
@@ -1,16 +1,24 @@
1
1
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
2
  import React, { useEffect, useRef, useState } from "react";
3
+ import { ConfirmationState } from "../../common/Constants";
3
4
  import { ConversationState } from "../../contexts/common/ConversationState";
5
+ import DraggableEventEmitter from "../draggable/DraggableEventEmitter";
4
6
  import { Header } from "@microsoft/omnichannel-chat-components";
5
7
  import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
6
8
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
9
+ import { createTimer } from "../../common/utils";
7
10
  import { defaultOutOfOfficeHeaderStyleProps } from "./common/styleProps/defaultOutOfOfficeHeaderStyleProps";
8
11
  import useChatAdapterStore from "../../hooks/useChatAdapterStore";
9
12
  import useChatContextStore from "../../hooks/useChatContextStore";
10
- import { ConfirmationState } from "../../common/Constants";
11
- import DraggableEventEmitter from "../draggable/DraggableEventEmitter";
13
+ let uiTimer;
12
14
  export const HeaderStateful = props => {
13
15
  var _state$domainStates$l, _state$domainStates$l2, _state$domainStates, _headerProps$controlP, _headerProps$controlP2, _headerProps$controlP3, _outOfOfficeHeaderPro, _state$domainStates3;
16
+ useEffect(() => {
17
+ uiTimer = createTimer();
18
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
19
+ Event: TelemetryEvent.UXHeaderStart
20
+ });
21
+ }, []);
14
22
  const [state, dispatch] = useChatContextStore();
15
23
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
24
  const [adapter] = useChatAdapterStore();
@@ -105,6 +113,12 @@ export const HeaderStateful = props => {
105
113
  elementId: outOfOperatingHours || state.appStates.conversationState === ConversationState.OutOfOffice ? outOfOfficeControlProps.id : controlProps.id,
106
114
  targetWindow: props.draggableEventEmitterTargetWindow ?? window
107
115
  };
116
+ useEffect(() => {
117
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
118
+ Event: TelemetryEvent.UXHeaderCompleted,
119
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
120
+ });
121
+ }, []);
108
122
  if (props.draggable === true) {
109
123
  var _generalStyleProps;
110
124
  const styleProps = outOfOperatingHours || state.appStates.conversationState === ConversationState.OutOfOffice ? outOfOfficeStyleProps : headerProps === null || headerProps === void 0 ? void 0 : headerProps.styleProps;
@@ -54,8 +54,15 @@ import { startProactiveChat } from "../common/startProactiveChat";
54
54
  import useChatAdapterStore from "../../../hooks/useChatAdapterStore";
55
55
  import useChatContextStore from "../../../hooks/useChatContextStore";
56
56
  import useFacadeSDKStore from "../../../hooks/useFacadeChatSDKStore";
57
+ let uiTimer;
57
58
  export const LiveChatWidgetStateful = props => {
58
59
  var _props$webChatContain, _props$styleProps, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain7, _props$webChatContain8, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _props$webChatContain9, _props$webChatContain10, _props$webChatContain11, _props$webChatContain12, _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$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
60
+ useEffect(() => {
61
+ uiTimer = createTimer();
62
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
63
+ Event: TelemetryEvent.UXLivechatwidgetStart
64
+ });
65
+ }, []);
59
66
  const [state, dispatch] = useChatContextStore();
60
67
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
61
68
  const [adapter, setAdapter] = useChatAdapterStore();
@@ -574,6 +581,26 @@ export const LiveChatWidgetStateful = props => {
574
581
  eventName: BroadcastEvent.NewMessageNotification
575
582
  });
576
583
  });
584
+ facadeChatSDK === null || facadeChatSDK === void 0 ? void 0 : facadeChatSDK.onAgentEndSession(event => {
585
+ var _inMemoryState$appSta6;
586
+ const inMemoryState = executeReducer(state, {
587
+ type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
588
+ payload: null
589
+ });
590
+ if ("participantsRemoved" in event && (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta6 = inMemoryState.appStates) === null || _inMemoryState$appSta6 === void 0 ? void 0 : _inMemoryState$appSta6.conversationState) === ConversationState.Active) {
591
+ setWebChatStyles(styles => {
592
+ return {
593
+ ...styles,
594
+ hideSendBox: true
595
+ };
596
+ });
597
+ TelemetryHelper.logSDKEvent(LogLevel.INFO, {
598
+ Event: TelemetryEvent.ParticipantsRemovedEvent,
599
+ Description: "Participants removed event received."
600
+ });
601
+ return;
602
+ }
603
+ });
577
604
  }
578
605
  if (state.appStates.conversationState === ConversationState.InActive) {
579
606
  var _props$webChatContain2, _props$webChatContain3;
@@ -703,13 +730,13 @@ export const LiveChatWidgetStateful = props => {
703
730
 
704
731
  // Handle Chat disconnect cases
705
732
  useEffect(() => {
706
- var _inMemoryState$appSta6;
733
+ var _inMemoryState$appSta7;
707
734
  const inMemoryState = executeReducer(state, {
708
735
  type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
709
736
  payload: null
710
737
  });
711
738
  handleChatDisconnect(props, inMemoryState, setWebChatStyles);
712
- const chatDisconnectState = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta6 = inMemoryState.appStates) === null || _inMemoryState$appSta6 === void 0 ? void 0 : _inMemoryState$appSta6.chatDisconnectEventReceived;
739
+ const chatDisconnectState = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta7 = inMemoryState.appStates) === null || _inMemoryState$appSta7 === void 0 ? void 0 : _inMemoryState$appSta7.chatDisconnectEventReceived;
713
740
  if (chatDisconnectState && adapter) {
714
741
  try {
715
742
  adapter.end();
@@ -731,6 +758,12 @@ export const LiveChatWidgetStateful = props => {
731
758
  payload: (_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.renderingMiddlewareProps
732
759
  });
733
760
  }, [(_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.renderingMiddlewareProps]);
761
+ useEffect(() => {
762
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
763
+ Event: TelemetryEvent.UXLivechatwidgetCompleted,
764
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
765
+ });
766
+ }, []);
734
767
  const initiateEndChatOnBrowserUnload = () => {
735
768
  var _DataStoreManager$cli;
736
769
  TelemetryHelper.logActionEvent(LogLevel.INFO, {
@@ -1,16 +1,23 @@
1
1
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
2
  import React, { useEffect } from "react";
3
+ import { createTimer, findAllFocusableElement } from "../../common/utils";
3
4
  import { LoadingPane } from "@microsoft/omnichannel-chat-components";
4
5
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
5
6
  import { defaultGeneralLoadingPaneStyleProps } from "./common/defaultStyleProps/defaultgeneralLoadingPaneStyleProps";
6
- import { findAllFocusableElement } from "../../common/utils";
7
+ import { errorUILoadingPaneStyleProps } from "./common/errorUIStyleProps/errorUILoadingPaneStyleProps";
7
8
  import useChatContextStore from "../../hooks/useChatContextStore";
8
9
  import useWindowDimensions from "../../hooks/useWindowDimensions";
9
- import { errorUILoadingPaneStyleProps } from "./common/errorUIStyleProps/errorUILoadingPaneStyleProps";
10
+ let uiTimer;
10
11
 
11
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
13
  export const LoadingPaneStateful = props => {
13
14
  var _loadingPaneProps$sty, _startChatErrorPanePr, _startChatErrorPanePr2;
15
+ useEffect(() => {
16
+ uiTimer = createTimer();
17
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
18
+ Event: TelemetryEvent.UXLoadingPaneStart
19
+ });
20
+ }, []);
14
21
  const [state] = useChatContextStore();
15
22
  const {
16
23
  loadingPaneProps,
@@ -53,6 +60,16 @@ export const LoadingPaneStateful = props => {
53
60
  Event: TelemetryEvent.LoadingPaneLoaded,
54
61
  Description: "Loading pane loaded."
55
62
  });
63
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
64
+ Event: TelemetryEvent.UXLoadingPaneCompleted,
65
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
66
+ });
67
+ return () => {
68
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
69
+ Event: TelemetryEvent.LoadingPaneUnloaded,
70
+ Description: "Loading pane unmount."
71
+ });
72
+ };
56
73
  }, []);
57
74
  return /*#__PURE__*/React.createElement(LoadingPane, {
58
75
  componentOverrides: loadingPaneProps === null || loadingPaneProps === void 0 ? void 0 : loadingPaneProps.componentOverrides,
@@ -1,18 +1,26 @@
1
+ import { ConfirmationState, NotificationPaneConstants } from "../../common/Constants";
2
+ import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
1
3
  import React, { useEffect, useRef } from "react";
4
+ import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
2
5
  import { NotificationPane } from "@microsoft/omnichannel-chat-components";
6
+ import { NotificationScenarios } from "../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
7
+ import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
8
+ import { createTimer } from "../../common/utils";
9
+ import { defaultChatDisconnectControlProps } from "./defaultProps/defaultChatDisconnectControlProps";
10
+ import { defaultChatDisconnectStyleProps } from "./defaultProps/defaultChatDisconnectStyleProps";
3
11
  import { hooks } from "botframework-webchat";
4
12
  import { useCallback } from "react";
5
- import { NotificationScenarios } from "../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
6
13
  import useChatAdapterStore from "../../hooks/useChatAdapterStore";
7
14
  import useChatContextStore from "../../hooks/useChatContextStore";
8
- import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
9
- import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
10
- import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
11
- import { ConfirmationState, NotificationPaneConstants } from "../../common/Constants";
12
- import { defaultChatDisconnectStyleProps } from "./defaultProps/defaultChatDisconnectStyleProps";
13
- import { defaultChatDisconnectControlProps } from "./defaultProps/defaultChatDisconnectControlProps";
15
+ let uiTimer;
14
16
  export const NotificationPaneStateful = props => {
15
17
  var _state$domainStates, _state$domainStates3;
18
+ useEffect(() => {
19
+ uiTimer = createTimer();
20
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
21
+ Event: TelemetryEvent.UXNotificationPaneStart
22
+ });
23
+ }, []);
16
24
  const {
17
25
  notificationPaneProps,
18
26
  notificationScenarioType,
@@ -162,6 +170,12 @@ export const NotificationPaneStateful = props => {
162
170
  // TODO additional scenarios to be added...
163
171
  }
164
172
 
173
+ useEffect(() => {
174
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
175
+ Event: TelemetryEvent.UXNotificationPaneCompleted,
176
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
177
+ });
178
+ }, []);
165
179
  return /*#__PURE__*/React.createElement(NotificationPane, genericPropsObj);
166
180
  };
167
181
  export default NotificationPaneStateful;