@microsoft/omnichannel-chat-widget 0.1.0-main.bf74329 → 0.1.0-main.c1bbb91

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 (126) hide show
  1. package/lib/cjs/assets/Icons.js +4 -2
  2. package/lib/cjs/common/Constants.js +24 -4
  3. package/lib/cjs/common/KeyCodes.js +3 -1
  4. package/lib/cjs/common/contextDataStore/DataStoreManager.js +3 -1
  5. package/lib/cjs/common/storage/default/defaultCacheManager.js +5 -3
  6. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +15 -6
  7. package/lib/cjs/common/telemetry/TelemetryConstants.js +12 -5
  8. package/lib/cjs/common/telemetry/TelemetryHelper.js +7 -2
  9. package/lib/cjs/common/telemetry/TelemetryManager.js +3 -1
  10. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +2 -2
  11. package/lib/cjs/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
  12. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +1 -1
  13. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
  14. package/lib/cjs/components/headerstateful/HeaderStateful.js +6 -4
  15. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +3 -1
  16. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +3 -1
  17. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +3 -1
  18. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +3 -1
  19. package/lib/cjs/components/livechatwidget/common/Deferred.js +3 -1
  20. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +14 -0
  21. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +67 -16
  22. package/lib/cjs/components/livechatwidget/common/endChat.js +42 -2
  23. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +13 -19
  24. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +75 -114
  25. package/lib/cjs/components/livechatwidget/common/startChat.js +162 -45
  26. package/lib/cjs/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
  27. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +152 -116
  28. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +22 -2
  29. package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +57 -0
  30. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +2 -2
  31. package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
  32. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -0
  33. package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +3 -1
  34. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +3 -1
  35. package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -0
  36. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -1
  37. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -1
  38. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -3
  39. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
  40. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +1 -1
  41. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +1 -1
  42. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +5 -6
  43. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -14
  44. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
  45. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +12 -1
  46. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +29 -27
  47. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +6 -3
  48. package/lib/cjs/contexts/createReducer.js +19 -2
  49. package/lib/cjs/controller/componentController.js +1 -1
  50. package/lib/cjs/hooks/useDebounce.js +28 -0
  51. package/lib/cjs/hooks/useWindowDimensions.js +30 -0
  52. package/lib/cjs/plugins/newMessageEventHandler.js +4 -0
  53. package/lib/esm/assets/Icons.js +2 -1
  54. package/lib/esm/common/Constants.js +21 -3
  55. package/lib/esm/common/KeyCodes.js +3 -1
  56. package/lib/esm/common/contextDataStore/DataStoreManager.js +3 -1
  57. package/lib/esm/common/storage/default/defaultCacheManager.js +5 -3
  58. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +15 -6
  59. package/lib/esm/common/telemetry/TelemetryConstants.js +12 -5
  60. package/lib/esm/common/telemetry/TelemetryHelper.js +7 -2
  61. package/lib/esm/common/telemetry/TelemetryManager.js +3 -1
  62. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +2 -2
  63. package/lib/esm/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
  64. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +1 -1
  65. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
  66. package/lib/esm/components/headerstateful/HeaderStateful.js +6 -4
  67. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +3 -1
  68. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +3 -1
  69. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +3 -1
  70. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +3 -1
  71. package/lib/esm/components/livechatwidget/common/Deferred.js +3 -1
  72. package/lib/esm/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +7 -0
  73. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +67 -16
  74. package/lib/esm/components/livechatwidget/common/endChat.js +42 -2
  75. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +13 -19
  76. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +72 -109
  77. package/lib/esm/components/livechatwidget/common/startChat.js +161 -45
  78. package/lib/esm/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
  79. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +153 -117
  80. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +22 -2
  81. package/lib/esm/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +50 -0
  82. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +2 -2
  83. package/lib/esm/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
  84. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -0
  85. package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +3 -1
  86. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +3 -1
  87. package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -0
  88. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -1
  89. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -1
  90. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -3
  91. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
  92. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +1 -1
  93. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +1 -1
  94. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +5 -6
  95. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -14
  96. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
  97. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +12 -1
  98. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +29 -27
  99. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +6 -3
  100. package/lib/esm/contexts/createReducer.js +19 -2
  101. package/lib/esm/controller/componentController.js +1 -1
  102. package/lib/esm/hooks/useDebounce.js +22 -0
  103. package/lib/esm/hooks/useWindowDimensions.js +23 -0
  104. package/lib/esm/plugins/newMessageEventHandler.js +4 -0
  105. package/lib/types/assets/Icons.d.ts +1 -0
  106. package/lib/types/common/Constants.d.ts +14 -0
  107. package/lib/types/common/storage/default/defaultCacheManager.d.ts +1 -1
  108. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +1 -1
  109. package/lib/types/common/telemetry/TelemetryConstants.d.ts +11 -4
  110. package/lib/types/common/telemetry/definitions/Contracts.d.ts +4 -4
  111. package/lib/types/common/telemetry/definitions/Payload.d.ts +1 -0
  112. package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +4 -0
  113. package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -0
  114. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +5 -7
  115. package/lib/types/components/livechatwidget/common/startChat.d.ts +5 -4
  116. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +3 -1
  117. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
  118. package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -0
  119. package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -0
  120. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -1
  121. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +1 -1
  122. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -1
  123. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +29 -27
  124. package/lib/types/hooks/useDebounce.d.ts +3 -0
  125. package/lib/types/hooks/useWindowDimensions.d.ts +4 -0
  126. package/package.json +3 -3
@@ -39,7 +39,6 @@ export let BroadcastEvent;
39
39
  BroadcastEvent["HistoryMessageReceived"] = "HistoryMessageReceived";
40
40
  BroadcastEvent["RedirectPageRequest"] = "RedirectPageRequest";
41
41
  BroadcastEvent["StartChat"] = "StartChat";
42
- BroadcastEvent["StartChatSkippingChatButtonRendering"] = "StartChatSkippingChatButtonRendering";
43
42
  BroadcastEvent["StartUnauthenticatedReconnectChat"] = "StartUnauthenticatedReconnectChat";
44
43
  BroadcastEvent["InitiateEndChat"] = "InitiateEndChat";
45
44
  BroadcastEvent["SetCustomContext"] = "SetCustomContext";
@@ -49,6 +48,9 @@ export let BroadcastEvent;
49
48
  BroadcastEvent["CloseChat"] = "CloseChat";
50
49
  BroadcastEvent["InitiateEndChatOnBrowserUnload"] = "InitiateEndChatOnBrowserUnload";
51
50
  BroadcastEvent["ClosePopoutWindow"] = "ClosePopoutWindow";
51
+ BroadcastEvent["RaiseErrorEvent"] = "RaiseErrorEvent";
52
+ BroadcastEvent["NetworkDisconnected"] = "NetworkDisconnected";
53
+ BroadcastEvent["NetworkReconnected"] = "NetworkReconnected";
52
54
  })(BroadcastEvent || (BroadcastEvent = {}));
53
55
  export let TelemetryEvent;
54
56
  (function (TelemetryEvent) {
@@ -60,8 +62,8 @@ export let TelemetryEvent;
60
62
  TelemetryEvent["CallDisconnected"] = "CallDisconnected";
61
63
  TelemetryEvent["CallDisconnectedException"] = "CallDisconnectedException";
62
64
  TelemetryEvent["IncomingCallEnded"] = "incomingCallEnded";
63
- TelemetryEvent["VoiceVideoInitialize"] = "VoiceVideoInitialize";
64
- TelemetryEvent["VoiceVideoInitializeException"] = "VoiceVideoInitializeException";
65
+ TelemetryEvent["VoiceVideoSdkInitialize"] = "VoiceVideoSdkInitialize";
66
+ TelemetryEvent["VoiceVideoSdkInitializeException"] = "VoiceVideoSdkInitializeException";
65
67
  TelemetryEvent["VoiceVideoLoading"] = "VoiceVideoLoading";
66
68
  TelemetryEvent["VoiceVideoNotLoaded"] = "VoiceVideoNotLoaded";
67
69
  TelemetryEvent["VoiceVideoLoadingException"] = "VoiceVideoLoadingException";
@@ -92,6 +94,7 @@ export let TelemetryEvent;
92
94
  TelemetryEvent["WebChatLoaded"] = "WebChatLoaded";
93
95
  TelemetryEvent["LCWChatButtonClicked"] = "LCWChatButtonClicked";
94
96
  TelemetryEvent["LCWChatButtonShow"] = "LCWChatButtonShow";
97
+ TelemetryEvent["WidgetLoadStarted"] = "WidgetLoadStarted";
95
98
  TelemetryEvent["WidgetLoadComplete"] = "WidgetLoadComplete";
96
99
  TelemetryEvent["WidgetLoadFailed"] = "WidgetLoadFailed";
97
100
  TelemetryEvent["StartChatMethodException"] = "StartChatMethodException";
@@ -108,6 +111,7 @@ export let TelemetryEvent;
108
111
  TelemetryEvent["DownloadTranscriptResponseNullOrUndefined"] = "DownloadTranscriptResponseNullOrUndefined";
109
112
  TelemetryEvent["EmailTranscriptSent"] = "EmailTranscriptSent";
110
113
  TelemetryEvent["EmailTranscriptFailed"] = "EmailTranscriptFailed";
114
+ TelemetryEvent["ErrorUIPaneLoaded"] = "ErrorUIPaneLoaded";
111
115
  TelemetryEvent["DownloadTranscriptFailed"] = "DownloadTranscriptFailed";
112
116
  TelemetryEvent["StartChatFailed"] = "StartChatFailed";
113
117
  TelemetryEvent["IC3ThreadUpdateEventReceived"] = "IC3ThreadUpdateEventReceived";
@@ -132,6 +136,7 @@ export let TelemetryEvent;
132
136
  TelemetryEvent["GetConversationDetailsException"] = "GetConversationDetailsException";
133
137
  TelemetryEvent["BrowserUnloadEventStarted"] = "BrowserUnloadEventStarted";
134
138
  TelemetryEvent["GetAuthTokenCalled"] = "GetAuthTokenCalled";
139
+ TelemetryEvent["GetAuthTokenFailed"] = "GetAuthTokenFailed";
135
140
  TelemetryEvent["ReceivedNullOrEmptyToken"] = "ReceivedNullOrEmptyToken";
136
141
  TelemetryEvent["CustomerVoiceResponsePageLoaded"] = "CustomerVoiceResponsePageLoaded";
137
142
  TelemetryEvent["CustomerVoiceFormResponseSubmitted"] = "CustomerVoiceFormResponseSubmitted";
@@ -142,6 +147,7 @@ export let TelemetryEvent;
142
147
  TelemetryEvent["QueuePositionMessageRecieved"] = "QueuePositionMessageRecieved";
143
148
  TelemetryEvent["AverageWaitTimeMessageRecieved"] = "AverageWaitTimeMessageRecieved";
144
149
  TelemetryEvent["DataMaskingRuleApplied"] = "DataMaskingRuleApplied";
150
+ TelemetryEvent["DataMaskingRuleApplyFailed"] = "DataMaskingRuleApplyFailed";
145
151
  TelemetryEvent["IC3ClientEvent"] = "IC3ClientEvent";
146
152
  TelemetryEvent["ConversationEndedThreadEventReceived"] = "ConversationEndedThreadEventReceived";
147
153
  TelemetryEvent["InvalidConfiguration"] = "InvalidConfiguration";
@@ -161,6 +167,7 @@ export let TelemetryEvent;
161
167
  TelemetryEvent["ReconnectChatMinimize"] = "ReconnectChatMinimize";
162
168
  TelemetryEvent["MessageSent"] = "MessageSent";
163
169
  TelemetryEvent["MessageReceived"] = "MessageReceived";
170
+ TelemetryEvent["SystemMessageReceived"] = "SystemMessageReceived";
164
171
  TelemetryEvent["CustomContextReceived"] = "CustomContextReceived";
165
172
  TelemetryEvent["NetworkDisconnected"] = "NetworkDisconnected";
166
173
  TelemetryEvent["NetworkReconnected"] = "NetworkReconnected";
@@ -244,8 +251,8 @@ export class TelemetryConstants {
244
251
  case TelemetryEvent.CallDisconnected:
245
252
  case TelemetryEvent.CallDisconnectedException:
246
253
  case TelemetryEvent.IncomingCallEnded:
247
- case TelemetryEvent.VoiceVideoInitialize:
248
- case TelemetryEvent.VoiceVideoInitializeException:
254
+ case TelemetryEvent.VoiceVideoSdkInitialize:
255
+ case TelemetryEvent.VoiceVideoSdkInitializeException:
249
256
  case TelemetryEvent.VoiceVideoLoading:
250
257
  case TelemetryEvent.VoiceVideoNotLoaded:
251
258
  case TelemetryEvent.VoiceVideoLoadingException:
@@ -1,4 +1,6 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
4
  import { ScenarioType, TelemetryEvent } from "./TelemetryConstants";
3
5
  import { newGuid } from "../utils";
4
6
  import { TelemetryManager } from "./TelemetryManager";
@@ -53,6 +55,8 @@ export class TelemetryHelper {
53
55
  event.ActionType = payload.ActionType;
54
56
  event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
55
57
  event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
58
+ event.Description = payload.Description;
59
+ event.CustomProperties = JSON.stringify(payload.CustomProperties);
56
60
  });
57
61
  }
58
62
  static conformToWebChatContract(level, input) {
@@ -78,6 +82,7 @@ export class TelemetryHelper {
78
82
  event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
79
83
  event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
80
84
  event.Language = ((_TelemetryManager$Int10 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int10 === void 0 ? void 0 : _TelemetryManager$Int10.chatWidgetLocaleLCID) || "";
85
+ event.Description = payload.Data;
81
86
  });
82
87
  }
83
88
  static conformToLoadContract(level, input) {
@@ -157,7 +162,7 @@ export class TelemetryHelper {
157
162
  telemetryDataLocal.widgetId = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.appId;
158
163
  telemetryDataLocal.orgId = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgId;
159
164
  telemetryDataLocal.orgUrl = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgUrl;
160
- telemetryDataLocal.lcwRuntimeId = newGuid();
165
+ telemetryDataLocal.lcwRuntimeId = telemetryConfig.LCWRuntimeId ?? newGuid();
161
166
  return telemetryDataLocal;
162
167
  }
163
168
  static addSessionDataToTelemetry(chatSession, telemetryInternalData) {
@@ -1,4 +1,6 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
4
  import { LogLevel, ScenarioType, TelemetryConstants, TelemetryEvent } from "./TelemetryConstants";
3
5
  import { BroadcastService } from "@microsoft/omnichannel-chat-components";
4
6
  import { ariaTelemetryLogger } from "./loggers/ariaTelemetryLogger";
@@ -58,7 +58,7 @@ export const CallingContainerStateful = props => {
58
58
  });
59
59
  } catch (e) {
60
60
  TelemetryHelper.logCallingEvent(LogLevel.ERROR, {
61
- Event: TelemetryEvent.VoiceVideoInitializeException,
61
+ Event: TelemetryEvent.VoiceVideoSdkInitializeException,
62
62
  Description: `Failed to initialize VideoVoiceCalling Sdk: ${e}`
63
63
  });
64
64
  }
@@ -66,7 +66,7 @@ export const CallingContainerStateful = props => {
66
66
  init().then(() => {
67
67
  if (voiceVideoCallingSdk) {
68
68
  TelemetryHelper.logCallingEvent(LogLevel.INFO, {
69
- Event: TelemetryEvent.VoiceVideoInitialize,
69
+ Event: TelemetryEvent.VoiceVideoSdkInitialize,
70
70
  Description: "Initialize VideoVoiceCalling Sdk Success"
71
71
  }, callId);
72
72
  voiceVideoCallingSdk.onCallAdded(() => {
@@ -1,5 +1,8 @@
1
1
  export const defaultOutOfOfficeChatButtonStyleProps = {
2
2
  iconStyleProps: {
3
3
  backgroundColor: "#000000"
4
+ },
5
+ subtitleStyleProps: {
6
+ margin: "0px 10px 0px 10px"
4
7
  }
5
8
  };
@@ -82,7 +82,7 @@ export const ConfirmationPaneStateful = props => {
82
82
  Event: TelemetryEvent.ConfirmationPaneLoaded
83
83
  });
84
84
  }, []);
85
- return /*#__PURE__*/React.createElement(React.Fragment, null, !(controlProps !== null && controlProps !== void 0 && controlProps.disableDimLayer) && /*#__PURE__*/React.createElement(DimLayer, {
85
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DimLayer, {
86
86
  brightness: (controlProps === null || controlProps === void 0 ? void 0 : controlProps.brightnessValueOnDim) ?? "0.2"
87
87
  }), /*#__PURE__*/React.createElement(ConfirmationPane, {
88
88
  componentOverrides: props === null || props === void 0 ? void 0 : props.componentOverrides,
@@ -88,7 +88,7 @@ export const EmailTranscriptPaneStateful = props => {
88
88
  Event: TelemetryEvent.EmailTranscriptLoaded
89
89
  });
90
90
  }, [initialEmail]);
91
- return /*#__PURE__*/React.createElement(React.Fragment, null, !(controlProps !== null && controlProps !== void 0 && controlProps.disableDimLayer) && /*#__PURE__*/React.createElement(DimLayer, {
91
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DimLayer, {
92
92
  brightness: (controlProps === null || controlProps === void 0 ? void 0 : controlProps.brightnessValueOnDim) ?? "0.2"
93
93
  }), /*#__PURE__*/React.createElement(InputValidationPane, {
94
94
  componentOverrides: props.componentOverrides,
@@ -21,6 +21,7 @@ export const HeaderStateful = props => {
21
21
  const [outOfOperatingHours, setOutOfOperatingHours] = useState(((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.OutOfOperatingHours) === "True");
22
22
  const outOfOfficeStyleProps = Object.assign({}, defaultOutOfOfficeHeaderStyleProps, outOfOfficeHeaderProps === null || outOfOfficeHeaderProps === void 0 ? void 0 : outOfOfficeHeaderProps.styleProps);
23
23
  const conversationState = useRef(state.appStates.conversationState);
24
+ const conversationEndedByAgent = useRef(state.appStates.conversationEndedByAgent);
24
25
  const controlProps = {
25
26
  id: "oc-lcw-header",
26
27
  dir: state.domainStates.globalDir,
@@ -40,7 +41,7 @@ export const HeaderStateful = props => {
40
41
  Event: TelemetryEvent.HeaderCloseButtonClicked,
41
42
  Description: "Header Close button clicked."
42
43
  });
43
- if (conversationState.current === ConversationState.Active) {
44
+ if (conversationState.current === ConversationState.Active || conversationEndedByAgent.current) {
44
45
  dispatch({
45
46
  type: LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
46
47
  payload: true
@@ -60,9 +61,9 @@ export const HeaderStateful = props => {
60
61
  }
61
62
  },
62
63
  ...(headerProps === null || headerProps === void 0 ? void 0 : headerProps.controlProps),
63
- hideTitle: state.appStates.conversationState === ConversationState.Loading || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
64
- hideIcon: state.appStates.conversationState === ConversationState.Loading || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
65
- hideCloseButton: state.appStates.conversationState === ConversationState.Loading || state.appStates.conversationState === ConversationState.Prechat || state.appStates.conversationState === ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
64
+ hideTitle: state.appStates.conversationState === ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
65
+ hideIcon: state.appStates.conversationState === ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
66
+ hideCloseButton: state.appStates.conversationState === ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === ConversationState.Prechat || state.appStates.conversationState === ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
66
67
  };
67
68
  const outOfOfficeControlProps = {
68
69
  id: "oc-lcw-header",
@@ -86,6 +87,7 @@ export const HeaderStateful = props => {
86
87
  if (state.appStates.conversationState) {
87
88
  conversationState.current = state.appStates.conversationState;
88
89
  }
90
+ conversationEndedByAgent.current = state.appStates.conversationEndedByAgent;
89
91
  }, [state.appStates]);
90
92
  return /*#__PURE__*/React.createElement(Header, {
91
93
  componentOverrides: headerProps === null || headerProps === void 0 ? void 0 : headerProps.componentOverrides,
@@ -1,4 +1,6 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
4
  import { Deferred } from "./Deferred";
3
5
  export class ActivityStreamHandler {
4
6
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1,4 +1,6 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
4
  export class DefaultActivitySubscriber {
3
5
  constructor() {
4
6
  _defineProperty(this, "observer", void 0);
@@ -1,4 +1,6 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
4
  import { ActivityStreamHandler } from "../ActivityStreamHandler";
3
5
  export class PauseActivitySubscriber {
4
6
  constructor() {
@@ -1,4 +1,6 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
4
  import { DefaultActivitySubscriber } from "./ActivitySubscriber/DefaultActivitySubscriber";
3
5
  import { shareObservable } from "./shareObservable";
4
6
  export class ChatAdapterShim {
@@ -1,4 +1,6 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
4
  export class Deferred {
3
5
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
6
 
@@ -0,0 +1,7 @@
1
+ export const defaultScrollBarProps = {
2
+ width: "7px",
3
+ trackBackgroundColor: "#f1f1f1",
4
+ thumbBackgroundColor: "#888",
5
+ thumbBorderRadius: "10px",
6
+ thumbHoverColor: "#555"
7
+ };
@@ -9,9 +9,9 @@ import { createActivityMiddleware } from "../../../webchatcontainerstateful/webc
9
9
  import createAttachmentMiddleware from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware";
10
10
  import { createAvatarMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware";
11
11
  import { createMarkdown } from "../createMarkdown";
12
+ import { createWebChatTelemetry } from "../../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger";
12
13
  import { groupActivitiesMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware";
13
14
  import { typingIndicatorMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware";
14
- import { createWebChatTelemetry } from "../../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger";
15
15
 
16
16
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
17
17
  export const dummyDefaultProps = {
@@ -407,6 +407,7 @@ export const dummyDefaultProps = {
407
407
  width: "90px",
408
408
  cursor: "pointer",
409
409
  overflow: "hidden",
410
+ padding: "0px",
410
411
  whiteSpace: "nowrap"
411
412
  },
412
413
  subtitleStyleProps: {
@@ -414,12 +415,14 @@ export const dummyDefaultProps = {
414
415
  fontWeight: "200",
415
416
  color: "#666",
416
417
  overflow: "hidden",
418
+ padding: "0px",
417
419
  fontFamily: "'Segoe UI',Arial,sans-serif",
418
420
  display: "block",
419
421
  alignItems: "center",
420
422
  margin: "0px 14px 0px 14px",
421
423
  textOverflow: "ellipsis !important",
422
- width: "max-content",
424
+ width: "90px",
425
+ whiteSpace: "nowrap",
423
426
  cursor: "pointer"
424
427
  },
425
428
  classNames: {
@@ -469,7 +472,6 @@ export const dummyDefaultProps = {
469
472
  cancelButtonText: "Cancel",
470
473
  cancelButtonAriaLabel: "Cancel. Return to Chat",
471
474
  brightnessValueOnDim: "0.2",
472
- disableDimLayer: false,
473
475
  onConfirm: () => {},
474
476
  // Detailed implementation omitted
475
477
  onCancel: () => {} // Detailed implementation omitted
@@ -477,20 +479,23 @@ export const dummyDefaultProps = {
477
479
 
478
480
  styleProps: {
479
481
  generalStyleProps: {
482
+ display: "flex",
483
+ minHeight: "160px",
484
+ maxHeight: "300px",
485
+ boxSizing: "border-box",
480
486
  backgroundColor: "#FFFFFF",
481
487
  borderRadius: "2px",
482
488
  color: "black",
483
489
  fontFamily: "Segoe UI, Arial, sans-serif",
484
490
  fontSize: "14px",
485
- height: "160px",
486
491
  padding: "10px 20px",
487
- width: "262px",
488
492
  position: "absolute",
489
493
  justifyContent: "center",
490
494
  alignItems: "center",
491
- display: "flex",
492
495
  flexFlow: "column",
493
- zIndex: "9999"
496
+ zIndex: "9999",
497
+ left: "26px",
498
+ right: "26px"
494
499
  },
495
500
  titleStyleProps: {
496
501
  color: "#323130",
@@ -512,10 +517,14 @@ export const dummyDefaultProps = {
512
517
  },
513
518
  buttonGroupStyleProps: {
514
519
  display: "flex",
520
+ width: "auto",
521
+ height: "auto",
522
+ boxSizing: "border-box",
515
523
  flexFlow: "row",
516
524
  justifyContent: "center",
517
525
  alignItems: "center",
518
- gap: "10px"
526
+ gap: "10px",
527
+ marginBottom: "10px"
519
528
  },
520
529
  confirmButtonStyleProps: {
521
530
  backgroundColor: "rgba(9,72,159,1)",
@@ -570,6 +579,7 @@ export const dummyDefaultProps = {
570
579
  hideCallingContainer: false,
571
580
  hideChatButton: false,
572
581
  hideConfirmationPane: false,
582
+ hideErrorUIPane: false,
573
583
  hideFooter: false,
574
584
  hideHeader: false,
575
585
  hideLoadingPane: false,
@@ -579,7 +589,7 @@ export const dummyDefaultProps = {
579
589
  hideProactiveChatPane: false,
580
590
  hideReconnectChatPane: false,
581
591
  hideWebChatContainer: false,
582
- skipChatButtonRendering: false
592
+ hideStartChatButton: false
583
593
  },
584
594
  directLine: new MockAdapter(),
585
595
  downloadTranscriptProps: {
@@ -620,7 +630,6 @@ export const dummyDefaultProps = {
620
630
  cancelButtonText: "Cancel",
621
631
  cancelButtonAriaLabel: "Cancel",
622
632
  brightnessValueOnDim: "0.2",
623
- disableDimLayer: false,
624
633
  onSend: undefined,
625
634
  onCancel: undefined,
626
635
  checkInput: undefined
@@ -1018,7 +1027,8 @@ export const dummyDefaultProps = {
1018
1027
  margin: "0px 0px 20px 0px",
1019
1028
  display: "flex",
1020
1029
  order: 1,
1021
- alignSelf: "auto"
1030
+ alignSelf: "auto",
1031
+ overflow: "visible"
1022
1032
  },
1023
1033
  iconImageProps: {
1024
1034
  src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2lpKSI+DQo8cGF0aCBkPSJNMTUuMTk3MSAxNi4yNzI1VjI1Ljg1MjRDMTUuMTk3MSAyNy4zODExIDE1Ljg0MDEgMjcuNTIwMSAxNi45ODMyIDI3LjUyMDFMMjYuNzA4NCAyNy41NjQ5TDMxLjAwMzkgMzIuMzEyM1YyNy41NjQ5SDMxLjg5N0MzMi4xNzQzIDI3LjU2MzcgMzIuNDQ4NyAyNy41MDc3IDMyLjcwNDUgMjcuNDAwMUMzMi45NjAzIDI3LjI5MjQgMzMuMTkyNSAyNy4xMzUzIDMzLjM4NzggMjYuOTM3NUMzMy41ODMxIDI2LjczOTggMzMuNzM3NyAyNi41MDU0IDMzLjg0MjcgMjYuMjQ3N0MzMy45NDc4IDI1Ljk5IDM0LjAwMTMgMjUuNzE0IDM0LjAwMDEgMjUuNDM1NVYxNi4zMDM4QzM0LjAwMTMgMTYuMDI1NCAzMy45NDc4IDE1Ljc0OTQgMzMuODQyNyAxNS40OTE3QzMzLjczNzcgMTUuMjM0IDMzLjU4MzEgMTQuOTk5NiAzMy4zODc4IDE0LjgwMThDMzMuMTkyNSAxNC42MDQxIDMyLjk2MDMgMTQuNDQ2OSAzMi43MDQ1IDE0LjMzOTNDMzIuNDQ4NyAxNC4yMzE2IDMyLjE3NDMgMTQuMTc1NiAzMS44OTcgMTQuMTc0NEwxNy4zMDQ3IDE0LjE0MzFDMTcuMDI2OSAxNC4xNDM3IDE2Ljc1MiAx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CAwIDAgMTI3IDAiIHJlc3VsdD0iaGFyZEFscGhhIi8+DQo8ZmVPZmZzZXQgZHg9Ii0xIiBkeT0iLTEiLz4NCjxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9ImFyaXRobWV0aWMiIGsyPSItMSIgazM9IjEiLz4NCjxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDEgMCAwIDAgMCAxIDAgMCAwIDAgMSAwIDAgMCAwLjE2IDAiLz4NCjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJlZmZlY3QyX2lubmVyU2hhZG93IiByZXN1bHQ9ImVmZmVjdDNfaW5uZXJTaGFkb3ciLz4NCjwvZmlsdGVyPg0KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDBfbGluZWFyIiB4MT0iLTAuMzk1MDAxIiB5MT0iMjMuMTI4MiIgeDI9IjIwLjEwNTgiIHkyPSIzNy44NDc0IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+DQo8c3RvcCBzdG9wLWNvbG9yPSIjRUZFRkVGIi8+DQo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IndoaXRlIi8+DQo8L2xpbmVhckdyYWRpZW50Pg0KPC9kZWZzPg0KPC9zdmc+DQo=",
@@ -1110,7 +1120,8 @@ export const dummyDefaultProps = {
1110
1120
  dir: "auto",
1111
1121
  hideOOOHPane: false,
1112
1122
  hideTitle: false,
1113
- titleText: "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open."
1123
+ titleText: "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open. Please see link https://microsoft.com",
1124
+ openLinkInNewTab: true
1114
1125
  },
1115
1126
  styleProps: {
1116
1127
  generalStyleProps: {
@@ -1153,7 +1164,7 @@ export const dummyDefaultProps = {
1153
1164
  subtitleText: "Please take a moment to give us feedback about your chat experience. We are loading the survey for you now."
1154
1165
  },
1155
1166
  styleProps: {
1156
- // ...[Existing chat button style props]
1167
+ // ...[Existing loading pane style props]
1157
1168
  generalStyleProps: {
1158
1169
  position: "initial",
1159
1170
  width: "100%",
@@ -1184,6 +1195,47 @@ export const dummyDefaultProps = {
1184
1195
  },
1185
1196
  isCustomerVoiceSurveyCompact: undefined
1186
1197
  },
1198
+ preChatSurveyPaneProps: {
1199
+ controlProps: {
1200
+ id: "oc-lcw-prechatsurveypane-default",
1201
+ dir: "auto",
1202
+ hidePreChatSurveyPane: false,
1203
+ adaptiveCardHostConfig: "{\"fontFamily\":\"Segoe UI, Helvetica Neue, sans-serif\",\"containerStyles\":{\"default\":{\"foregroundColors\":{\"default\":{\"default\":\"#000000\"}},\"backgroundColor\":\"#FFFFFF\"}},\"actions\":{\"actionsOrientation\":\"Vertical\",\"actionAlignment\":\"stretch\"}}",
1204
+ payload: "{\"$schema\":\"http://adaptivecards.io/schemas/adaptive-card.json\",\"type\":\"AdaptiveCard\",\"version\":\"1.1\",\"body\":[{\"type\":\"TextBlock\",\"weight\":\"bolder\",\"text\":\"Please answer below questions.\"},{\"type\":\"Input.Text\",\"id\":\"1e5e4e7a-8f0b-ec11-b6e6-000d3a305d38\",\"label\":\"name pls?\",\"maxLength\":100,\"isRequired\":true,\"errorMessage\":\"Name is required\"},{\"type\":\"Input.Text\",\"id\":\"7f8f5d6d-995e-ec11-8f8f-000d3a31376e\",\"label\":\"multi\\nmulti\\nmulti\",\"style\":\"text\",\"isMultiline\":true,\"maxLength\":250},{\"type\":\"Input.ChoiceSet\",\"id\":\"e4bdf7cb-995e-ec11-8f8f-000d3a31376e\",\"label\":\"options\",\"isMultiSelect\":false,\"value\":\"1\",\"style\":\"compact\",\"choices\":[{\"title\":\"one\",\"value\":\"1\"},{\"title\":\"two\",\"value\":\"2\"},{\"title\":\"three\",\"value\":\"3\"}]},{\"type\":\"Input.Toggle\",\"id\":\"b26011d2-995e-ec11-8f8f-000d3a31376e\",\"title\":\"consent\",\"valueOn\":\"True\",\"valueOff\":\"False\",\"value\":\"false\"},{\"type\":\"TextBlock\",\"isSubtle\":true,\"text\":\"Fields marked with * are mandatory.\",\"wrap\":true}],\"actions\":[{\"type\":\"Action.Submit\",\"title\":\"Submit\",\"data\":{\"Type\":\"InputSubmit\"}}]}",
1205
+ onSubmit: function () {} // Detailed implementation omitted
1206
+ },
1207
+
1208
+ styleProps: {
1209
+ generalStyleProps: {
1210
+ borderStyle: "solid",
1211
+ borderRadius: "4px",
1212
+ borderWidth: "0px",
1213
+ backgroundColor: "#FFFFFF",
1214
+ borderColor: "#F1F1F1",
1215
+ overflowY: "auto",
1216
+ height: "inherit",
1217
+ width: "inherit"
1218
+ },
1219
+ customButtonStyleProps: {
1220
+ backgroundColor: "rgb(49, 95, 162)",
1221
+ color: "#FFFFFF",
1222
+ fontFamily: "Segoe UI, Arial, sans-serif",
1223
+ fontSize: "15px",
1224
+ height: "48px"
1225
+ },
1226
+ adaptiveCardContainerStyleProps: {
1227
+ border: "1px solid #ECECEC",
1228
+ borderRadius: "4px",
1229
+ margin: "3%"
1230
+ },
1231
+ customTextInputStyleProps: {
1232
+ height: "20px"
1233
+ },
1234
+ customMultilineTextInputStyleProps: {
1235
+ height: "52px"
1236
+ }
1237
+ }
1238
+ },
1187
1239
  proactiveChatPaneProps: {
1188
1240
  componentOverrides: {
1189
1241
  title: undefined,
@@ -1440,7 +1492,6 @@ export const dummyDefaultProps = {
1440
1492
  startNewChatButtonClassName: undefined
1441
1493
  }
1442
1494
  },
1443
- isReconnectEnabled: undefined,
1444
1495
  reconnectId: undefined,
1445
1496
  redirectInSameWindow: undefined
1446
1497
  },
@@ -1563,10 +1614,10 @@ export const dummyDefaultProps = {
1563
1614
  padding: "0px 10px 0 10px"
1564
1615
  },
1565
1616
  userMessageBoxStyles: {
1566
- maxWidth: "75%"
1617
+ maxWidth: "90%"
1567
1618
  },
1568
1619
  systemMessageBoxStyles: {
1569
- maxWidth: "75%"
1620
+ maxWidth: "90%"
1570
1621
  },
1571
1622
  typingIndicatorStyleProps: {
1572
1623
  marginLeft: "10px",
@@ -8,6 +8,7 @@ import { defaultWebChatContainerStatefulProps } from "../../webchatcontainerstat
8
8
  import { PostChatSurveyMode } from "../../postchatsurveypanestateful/enums/PostChatSurveyMode";
9
9
  import { Constants } from "../../../common/Constants";
10
10
  import { addDelayInMs, getWidgetEndChatEventName } from "../../../common/utils";
11
+ import { getAuthClientFunction, handleAuthentication } from "./authHelper";
11
12
 
12
13
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
14
  const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, state) => {
@@ -15,6 +16,23 @@ const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, disp
15
16
  const isPostChatEnabled = (_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable;
16
17
  const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode;
17
18
 
19
+ //Unable to end chat if token has expired
20
+ if (props.getAuthToken) {
21
+ const authClientFunction = getAuthClientFunction(props.chatConfig);
22
+ if (props.getAuthToken && authClientFunction) {
23
+ // set auth token to chat sdk before start chat
24
+ const authSuccess = await handleAuthentication(chatSDK, props.chatConfig, props.getAuthToken);
25
+ if (!authSuccess) {
26
+ TelemetryHelper.logActionEvent(LogLevel.ERROR, {
27
+ Event: TelemetryEvent.GetAuthTokenFailed,
28
+ ExceptionDetails: {
29
+ exception: "Unable to get auth token during end chat"
30
+ }
31
+ });
32
+ }
33
+ }
34
+ }
35
+
18
36
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
37
  let conversationDetails = undefined;
20
38
  try {
@@ -30,7 +48,13 @@ const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, disp
30
48
  if (isPostChatEnabled === "true" && ((_conversationDetails = conversationDetails) === null || _conversationDetails === void 0 ? void 0 : _conversationDetails.canRenderPostChat) === Constants.truePascal) {
31
49
  const skipEndChatSDK = false;
32
50
  const skipCloseChat = true;
51
+ const chatSession = await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.getCurrentLiveChatContext());
33
52
  await endChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat, false);
53
+ if (chatSession) {
54
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
+ chatSDK.chatToken = chatSession.chatToken ?? {};
56
+ chatSDK.requestId = chatSession.requestId;
57
+ }
34
58
  if (postChatSurveyMode === PostChatSurveyMode.Embed) {
35
59
  dispatch({
36
60
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
@@ -42,10 +66,22 @@ const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, disp
42
66
  };
43
67
  BroadcastService.postMessage(loadPostChatEvent);
44
68
  } else if (postChatSurveyMode === PostChatSurveyMode.Link) {
69
+ var _props$webChatContain, _props$webChatContain2;
45
70
  dispatch({
46
71
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
47
72
  payload: ConversationState.InActive
48
73
  });
74
+
75
+ // Disable SendBox
76
+ if ((props === null || props === void 0 ? void 0 : (_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.hideSendboxOnConversationEnd) !== false) {
77
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
78
+ setWebChatStyles(styles => {
79
+ return {
80
+ ...styles,
81
+ hideSendBox: true
82
+ };
83
+ });
84
+ }
49
85
  }
50
86
  return;
51
87
  }
@@ -84,14 +120,18 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
84
120
  type: LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
85
121
  payload: undefined
86
122
  });
123
+ dispatch({
124
+ type: LiveChatWidgetActionType.SET_RECONNECT_ID,
125
+ payload: undefined
126
+ });
87
127
  if (!skipCloseChat) {
88
128
  try {
89
- var _props$webChatContain;
129
+ var _props$webChatContain3;
90
130
  adapter === null || adapter === void 0 ? void 0 : adapter.end();
91
131
  setAdapter(undefined);
92
132
  setWebChatStyles({
93
133
  ...defaultWebChatContainerStatefulProps.webChatStyles,
94
- ...((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles)
134
+ ...((_props$webChatContain3 = props.webChatContainerProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.webChatStyles)
95
135
  });
96
136
  WebChatStoreLoader.store = null;
97
137
  dispatch({
@@ -62,25 +62,19 @@ export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatS
62
62
  };
63
63
  });
64
64
  }
65
- if (isPostChatEnabled === "true") {
66
- if (postChatSurveyMode === PostChatSurveyMode.Embed) {
67
- WebChatStoreLoader.store = null;
68
- dispatch({
69
- type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
70
- payload: ConversationState.PostchatLoading
71
- });
72
- await addDelayInMs(Constants.PostChatLoadingDurationInMs);
73
- const loadPostChatEvent = {
74
- eventName: BroadcastEvent.LoadPostChatSurvey
75
- };
76
- BroadcastService.postMessage(loadPostChatEvent);
77
- } else if (postChatSurveyMode === PostChatSurveyMode.Link) {
78
- dispatch({
79
- type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
80
- payload: ConversationState.InActive
81
- });
82
- }
83
- } else {
65
+ if (isPostChatEnabled === "true" && postChatSurveyMode === PostChatSurveyMode.Embed && state.appStates.conversationState === ConversationState.Active) {
66
+ WebChatStoreLoader.store = null;
67
+ dispatch({
68
+ type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
69
+ payload: ConversationState.PostchatLoading
70
+ });
71
+ await addDelayInMs(Constants.PostChatLoadingDurationInMs);
72
+ const loadPostChatEvent = {
73
+ eventName: BroadcastEvent.LoadPostChatSurvey
74
+ };
75
+ BroadcastService.postMessage(loadPostChatEvent);
76
+ }
77
+ if (state.appStates.conversationState === ConversationState.Active) {
84
78
  dispatch({
85
79
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
86
80
  payload: ConversationState.InActive