@microsoft/omnichannel-chat-widget 0.1.0-main.34fc37e → 0.1.0-main.3aede09
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/common/storage/default/defaultCacheManager.js +34 -0
- package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +114 -0
- package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +86 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +6 -0
- package/lib/cjs/components/footerstateful/FooterStateful.js +1 -8
- package/lib/cjs/components/livechatwidget/common/authHelper.js +16 -3
- package/lib/cjs/components/livechatwidget/common/createFooter.js +7 -16
- package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +12 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +3 -0
- package/lib/cjs/components/livechatwidget/common/startChat.js +12 -3
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +49 -41
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +6 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +10 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +10 -3
- package/lib/esm/common/storage/default/defaultCacheManager.js +19 -0
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +102 -0
- package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +71 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +6 -0
- package/lib/esm/components/footerstateful/FooterStateful.js +1 -8
- package/lib/esm/components/livechatwidget/common/authHelper.js +14 -3
- package/lib/esm/components/livechatwidget/common/createFooter.js +4 -15
- package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +8 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +3 -0
- package/lib/esm/components/livechatwidget/common/startChat.js +13 -4
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +48 -41
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +5 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +3 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +8 -3
- package/lib/types/common/storage/default/defaultCacheManager.d.ts +4 -0
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +2 -0
- package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +5 -1
- package/lib/types/components/livechatwidget/common/authHelper.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +2 -0
- package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +1 -2
- package/package.json +2 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.registerBroadcastServiceForLocalStorage = exports.defaultCacheManager = void 0;
|
|
7
|
+
|
|
8
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
9
|
+
|
|
10
|
+
var _utils = require("../../utils");
|
|
11
|
+
|
|
12
|
+
var _defaultClientDataStoreProvider = require("./defaultClientDataStoreProvider");
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
class defaultCacheManager {}
|
|
17
|
+
|
|
18
|
+
exports.defaultCacheManager = defaultCacheManager;
|
|
19
|
+
|
|
20
|
+
_defineProperty(defaultCacheManager, "InternalCache", {});
|
|
21
|
+
|
|
22
|
+
const registerBroadcastServiceForLocalStorage = (orgid, widgetId, widgetInstanceId) => {
|
|
23
|
+
const widgetCacheId = (0, _utils.getWidgetCacheId)(orgid, widgetId, widgetInstanceId);
|
|
24
|
+
|
|
25
|
+
_omnichannelChatComponents.BroadcastService.getMessageByEventName(widgetCacheId).subscribe(msg => {
|
|
26
|
+
try {
|
|
27
|
+
(0, _defaultClientDataStoreProvider.defaultClientDataStoreProvider)().setData(widgetCacheId, JSON.stringify(msg.payload), "localStorage");
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error("Error in setting data to localstorage", error);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.registerBroadcastServiceForLocalStorage = registerBroadcastServiceForLocalStorage;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultClientDataStoreProvider = void 0;
|
|
7
|
+
|
|
8
|
+
var _defaultInMemoryDataStore = require("./defaultInMemoryDataStore");
|
|
9
|
+
|
|
10
|
+
var _TelemetryHelper = require("../../telemetry/TelemetryHelper");
|
|
11
|
+
|
|
12
|
+
var _TelemetryConstants = require("../../telemetry/TelemetryConstants");
|
|
13
|
+
|
|
14
|
+
const defaultClientDataStoreProvider = () => {
|
|
15
|
+
const isCookieAllowed = () => {
|
|
16
|
+
try {
|
|
17
|
+
localStorage;
|
|
18
|
+
sessionStorage;
|
|
19
|
+
return true;
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error("Third party cookie blocked");
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const TtlInMs = 15 * 60 * 1000; // 15 mins
|
|
27
|
+
|
|
28
|
+
const dataStoreProvider = {
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
setData: (key, data, type) => {
|
|
31
|
+
if (isCookieAllowed()) {
|
|
32
|
+
try {
|
|
33
|
+
if (key) {
|
|
34
|
+
const now = new Date();
|
|
35
|
+
const item = {
|
|
36
|
+
data: data,
|
|
37
|
+
expiry: now.getTime() + TtlInMs
|
|
38
|
+
};
|
|
39
|
+
const strItem = JSON.stringify(item);
|
|
40
|
+
|
|
41
|
+
if (type === "localStorage") {
|
|
42
|
+
localStorage.setItem(key, strItem);
|
|
43
|
+
} else {
|
|
44
|
+
sessionStorage.setItem(key, strItem);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
} catch (error) {
|
|
48
|
+
_TelemetryHelper.TelemetryHelper.logConfigDataEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
49
|
+
Event: _TelemetryConstants.TelemetryEvent.ClientDataStoreProviderFailed,
|
|
50
|
+
ExceptionDetails: error,
|
|
51
|
+
Description: "Unable to store data in localStorage."
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
const dataToCache = {
|
|
56
|
+
key: key,
|
|
57
|
+
data: data,
|
|
58
|
+
type: type
|
|
59
|
+
};
|
|
60
|
+
parent.postMessage(dataToCache, "*");
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
+
getData: (key, type) => {
|
|
65
|
+
if (isCookieAllowed()) {
|
|
66
|
+
let item;
|
|
67
|
+
|
|
68
|
+
if (type === "localStorage") {
|
|
69
|
+
item = localStorage.getItem(key);
|
|
70
|
+
} else {
|
|
71
|
+
item = sessionStorage.getItem(key);
|
|
72
|
+
} //Return item if not expired
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
let itemInJson = undefined;
|
|
76
|
+
|
|
77
|
+
if (item !== null) {
|
|
78
|
+
itemInJson = JSON.parse(item);
|
|
79
|
+
const now = new Date(); // compare the expiry time of the item with the current time
|
|
80
|
+
|
|
81
|
+
if (now.getTime() > itemInJson.expiry) {
|
|
82
|
+
// If the item is expired, delete the item from storage
|
|
83
|
+
// and return null
|
|
84
|
+
localStorage.removeItem(key);
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return itemInJson.data;
|
|
89
|
+
}
|
|
90
|
+
} else {
|
|
91
|
+
// get data from in memory db when cookie is disabled
|
|
92
|
+
return (0, _defaultInMemoryDataStore.inMemoryDataStore)().getData(key);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
|
+
removeData: (key, type) => {
|
|
97
|
+
if (isCookieAllowed()) {
|
|
98
|
+
if (key) {
|
|
99
|
+
if (type === "localStorage") {
|
|
100
|
+
return localStorage.removeItem(key);
|
|
101
|
+
} else {
|
|
102
|
+
return sessionStorage.removeItem(key);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
106
|
+
// get data from in memory db when cookie is disabled
|
|
107
|
+
return (0, _defaultInMemoryDataStore.inMemoryDataStore)().removeData(key);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return dataStoreProvider;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
exports.defaultClientDataStoreProvider = defaultClientDataStoreProvider;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.inMemoryDataStore = exports.defaultInitializeInMemoryDataStore = void 0;
|
|
7
|
+
|
|
8
|
+
var _TelemetryConstants = require("../../telemetry/TelemetryConstants");
|
|
9
|
+
|
|
10
|
+
var _TelemetryHelper = require("../../telemetry/TelemetryHelper");
|
|
11
|
+
|
|
12
|
+
var _defaultCacheManager = require("./defaultCacheManager");
|
|
13
|
+
|
|
14
|
+
const defaultInitializeInMemoryDataStore = widgetId => {
|
|
15
|
+
try {
|
|
16
|
+
localStorage;
|
|
17
|
+
} catch (error) {
|
|
18
|
+
// Register below events when localStorage is not accessible
|
|
19
|
+
// Listening to event raised from client browser
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
window.addEventListener("message", function (e) {
|
|
22
|
+
try {
|
|
23
|
+
if (e.data.key) {
|
|
24
|
+
const browserData = e.data;
|
|
25
|
+
|
|
26
|
+
if (_defaultCacheManager.defaultCacheManager.InternalCache[browserData.key]) {
|
|
27
|
+
delete _defaultCacheManager.defaultCacheManager.InternalCache[browserData.key];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
_defaultCacheManager.defaultCacheManager.InternalCache[browserData.key] = browserData.data;
|
|
31
|
+
}
|
|
32
|
+
} catch (error) {
|
|
33
|
+
_TelemetryHelper.TelemetryHelper.logConfigDataEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
34
|
+
Event: _TelemetryConstants.TelemetryEvent.InMemoryDataStoreFailed,
|
|
35
|
+
ExceptionDetails: error,
|
|
36
|
+
Description: "Unable to register default in-memory cache."
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}); // send cache initialize message to client
|
|
40
|
+
|
|
41
|
+
if (_defaultCacheManager.defaultCacheManager.InternalCache === undefined || {}) {
|
|
42
|
+
parent.postMessage({
|
|
43
|
+
data: "cacheinitialize",
|
|
44
|
+
widgetId: widgetId
|
|
45
|
+
}, "*");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.defaultInitializeInMemoryDataStore = defaultInitializeInMemoryDataStore;
|
|
51
|
+
|
|
52
|
+
const inMemoryDataStore = () => {
|
|
53
|
+
const dataStoreProvider = {
|
|
54
|
+
getData: key => {
|
|
55
|
+
if (_defaultCacheManager.defaultCacheManager.InternalCache && _defaultCacheManager.defaultCacheManager.InternalCache[key]) {
|
|
56
|
+
return _defaultCacheManager.defaultCacheManager.InternalCache[key];
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
|
+
setData: (key, data) => {
|
|
61
|
+
try {
|
|
62
|
+
_defaultCacheManager.defaultCacheManager.InternalCache[key] = data;
|
|
63
|
+
} catch (error) {
|
|
64
|
+
_TelemetryHelper.TelemetryHelper.logConfigDataEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
65
|
+
Event: _TelemetryConstants.TelemetryEvent.InMemoryDataStoreFailed,
|
|
66
|
+
ExceptionDetails: error,
|
|
67
|
+
Description: "Unable to set data in default in-memory cache."
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
removeData: key => {
|
|
72
|
+
try {
|
|
73
|
+
_defaultCacheManager.defaultCacheManager.InternalCache[key] = {};
|
|
74
|
+
} catch (error) {
|
|
75
|
+
_TelemetryHelper.TelemetryHelper.logConfigDataEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
76
|
+
Event: _TelemetryConstants.TelemetryEvent.InMemoryDataStoreFailed,
|
|
77
|
+
ExceptionDetails: error,
|
|
78
|
+
Description: "Unable to remove data from default in-memory cache."
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
return dataStoreProvider;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
exports.inMemoryDataStore = inMemoryDataStore;
|
|
@@ -101,6 +101,8 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
101
101
|
TelemetryEvent["PostChatContextCallSucceed"] = "PostChatContextCallSucceed";
|
|
102
102
|
TelemetryEvent["PostChatContextCallFailed"] = "PostChatContextCallFailed";
|
|
103
103
|
TelemetryEvent["ParseAdaptiveCardFailed"] = "ParseAdaptiveCardFailed";
|
|
104
|
+
TelemetryEvent["ClientDataStoreProviderFailed"] = "ClientDataStoreProviderFailed";
|
|
105
|
+
TelemetryEvent["InMemoryDataStoreFailed"] = "InMemoryDataStoreFailed";
|
|
104
106
|
TelemetryEvent["WebChatLoaded"] = "WebChatLoaded";
|
|
105
107
|
TelemetryEvent["LCWChatButtonClicked"] = "LCWChatButtonClicked";
|
|
106
108
|
TelemetryEvent["LCWChatButtonShow"] = "LCWChatButtonShow";
|
|
@@ -171,6 +173,8 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
171
173
|
TelemetryEvent["MessageSent"] = "MessageSent";
|
|
172
174
|
TelemetryEvent["MessageReceived"] = "MessageReceived";
|
|
173
175
|
TelemetryEvent["CustomContextReceived"] = "CustomContextReceived";
|
|
176
|
+
TelemetryEvent["NetworkDisconnected"] = "NetworkDisconnected";
|
|
177
|
+
TelemetryEvent["NetworkReconnected"] = "NetworkReconnected";
|
|
174
178
|
})(TelemetryEvent || (exports.TelemetryEvent = TelemetryEvent = {}));
|
|
175
179
|
|
|
176
180
|
class TelemetryConstants {
|
|
@@ -217,6 +221,8 @@ class TelemetryConstants {
|
|
|
217
221
|
case TelemetryEvent.MessageReceived:
|
|
218
222
|
case TelemetryEvent.CustomContextReceived:
|
|
219
223
|
case TelemetryEvent.BrowserUnloadEventStarted:
|
|
224
|
+
case TelemetryEvent.NetworkDisconnected:
|
|
225
|
+
case TelemetryEvent.NetworkReconnected:
|
|
220
226
|
return ScenarioType.ACTIONS;
|
|
221
227
|
|
|
222
228
|
case TelemetryEvent.StartChatSDKCall:
|
|
@@ -110,14 +110,7 @@ const FooterStateful = props => {
|
|
|
110
110
|
isAudioMuted: state.appStates.isAudioMuted
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
|
-
|
|
114
|
-
const footer = document.getElementById(footerId);
|
|
115
|
-
|
|
116
|
-
if (footer) {
|
|
117
|
-
footer.style.display = hideFooterDisplay ? "none" : "";
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.Footer, {
|
|
113
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !hideFooterDisplay && /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.Footer, {
|
|
121
114
|
componentOverrides: footerProps === null || footerProps === void 0 ? void 0 : footerProps.componentOverrides,
|
|
122
115
|
controlProps: controlProps,
|
|
123
116
|
styleProps: footerProps === null || footerProps === void 0 ? void 0 : footerProps.styleProps
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.removeAuthTokenProvider = exports.handleAuthentication = void 0;
|
|
6
|
+
exports.removeAuthTokenProvider = exports.handleAuthentication = exports.getAuthClientFunction = void 0;
|
|
7
7
|
|
|
8
8
|
var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants");
|
|
9
9
|
|
|
@@ -11,8 +11,7 @@ var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
|
11
11
|
|
|
12
12
|
var _utils = require("../../../common/utils");
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
const handleAuthentication = async (chatSDK, chatConfig, getAuthToken) => {
|
|
14
|
+
const getAuthClientFunction = chatConfig => {
|
|
16
15
|
let authClientFunction = undefined;
|
|
17
16
|
|
|
18
17
|
if (chatConfig !== null && chatConfig !== void 0 && chatConfig.LiveChatConfigAuthSettings) {
|
|
@@ -21,6 +20,15 @@ const handleAuthentication = async (chatSDK, chatConfig, getAuthToken) => {
|
|
|
21
20
|
authClientFunction = (chatConfig === null || chatConfig === void 0 ? void 0 : (_chatConfig$LiveChatC = chatConfig.LiveChatConfigAuthSettings) === null || _chatConfig$LiveChatC === void 0 ? void 0 : _chatConfig$LiveChatC.msdyn_javascriptclientfunction) ?? undefined;
|
|
22
21
|
}
|
|
23
22
|
|
|
23
|
+
return authClientFunction;
|
|
24
|
+
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
exports.getAuthClientFunction = getAuthClientFunction;
|
|
28
|
+
|
|
29
|
+
const handleAuthentication = async (chatSDK, chatConfig, getAuthToken) => {
|
|
30
|
+
const authClientFunction = getAuthClientFunction(chatConfig);
|
|
31
|
+
|
|
24
32
|
if (getAuthToken && authClientFunction) {
|
|
25
33
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
26
34
|
Event: _TelemetryConstants.TelemetryEvent.GetAuthTokenCalled
|
|
@@ -33,12 +41,17 @@ const handleAuthentication = async (chatSDK, chatConfig, getAuthToken) => {
|
|
|
33
41
|
chatSDK.setAuthTokenProvider(async () => {
|
|
34
42
|
return token;
|
|
35
43
|
});
|
|
44
|
+
return true;
|
|
36
45
|
} else {
|
|
37
46
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
38
47
|
Event: _TelemetryConstants.TelemetryEvent.ReceivedNullOrEmptyToken
|
|
39
48
|
});
|
|
49
|
+
|
|
50
|
+
return false;
|
|
40
51
|
}
|
|
41
52
|
}
|
|
53
|
+
|
|
54
|
+
return false;
|
|
42
55
|
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
56
|
|
|
44
57
|
|
|
@@ -16,26 +16,17 @@ var _componentController = require("../../../controller/componentController");
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
18
|
const createFooter = (props, state) => {
|
|
19
|
-
var _props$
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
hideEmailTranscriptButton: true,
|
|
25
|
-
hideAudioNotificationButton: true
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const footer = !((_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hideFooter) && (0, _componentController.shouldShowFooter)(state) ? (0, _omnichannelChatComponents.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.footer) || /*#__PURE__*/_react.default.createElement(_FooterStateful.default, {
|
|
19
|
+
var _props$controlProps, _props$componentOverr;
|
|
20
|
+
|
|
21
|
+
const hideFooterDisplay = !((_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hideFooter) && (0, _componentController.shouldShowFooter)(state) ? false : true;
|
|
22
|
+
|
|
23
|
+
const footer = (0, _omnichannelChatComponents.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.footer) || /*#__PURE__*/_react.default.createElement(_FooterStateful.default, {
|
|
29
24
|
footerProps: props.footerProps,
|
|
30
25
|
downloadTranscriptProps: props.downloadTranscriptProps,
|
|
31
26
|
audioNotificationProps: props.audioNotificationProps,
|
|
32
|
-
hideFooterDisplay:
|
|
33
|
-
}) : (0, _omnichannelChatComponents.decodeComponentString)((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.footer) || /*#__PURE__*/_react.default.createElement(_FooterStateful.default, {
|
|
34
|
-
footerProps: footerPropsHidden,
|
|
35
|
-
downloadTranscriptProps: props.downloadTranscriptProps,
|
|
36
|
-
audioNotificationProps: props.audioNotificationProps,
|
|
37
|
-
hideFooterDisplay: true
|
|
27
|
+
hideFooterDisplay: hideFooterDisplay
|
|
38
28
|
});
|
|
29
|
+
|
|
39
30
|
return footer;
|
|
40
31
|
};
|
|
41
32
|
|
|
@@ -13,6 +13,10 @@ var _NotificationScenarios = require("../../webchatcontainerstateful/webchatcont
|
|
|
13
13
|
|
|
14
14
|
var _defaultMiddlewareLocalizedTexts = require("../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
15
15
|
|
|
16
|
+
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
17
|
+
|
|
18
|
+
var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants");
|
|
19
|
+
|
|
16
20
|
const isInternetConnected = async () => {
|
|
17
21
|
try {
|
|
18
22
|
const response = await fetch(_Constants.Constants.internetConnectionTestUrl);
|
|
@@ -28,8 +32,16 @@ const createInternetConnectionChangeHandler = async () => {
|
|
|
28
32
|
const connected = await isInternetConnected();
|
|
29
33
|
|
|
30
34
|
if (!connected) {
|
|
35
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.WARN, {
|
|
36
|
+
Event: _TelemetryConstants.TelemetryEvent.NetworkDisconnected
|
|
37
|
+
});
|
|
38
|
+
|
|
31
39
|
_NotificationHandler.NotificationHandler.notifyError(_NotificationScenarios.NotificationScenarios.InternetConnection, _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_NO_INTERNET_CONNECTION);
|
|
32
40
|
} else {
|
|
41
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.WARN, {
|
|
42
|
+
Event: _TelemetryConstants.TelemetryEvent.NetworkReconnected
|
|
43
|
+
});
|
|
44
|
+
|
|
33
45
|
_NotificationHandler.NotificationHandler.notifySuccess(_NotificationScenarios.NotificationScenarios.InternetConnection, _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_INTERNET_BACK_ONLINE);
|
|
34
46
|
}
|
|
35
47
|
}; // Checking connection status on online & offline events due to possible false positives
|
|
@@ -121,6 +121,17 @@ const initStartChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAda
|
|
|
121
121
|
try {
|
|
122
122
|
var _newAdapter$activity$, _TelemetryTimers$Widg;
|
|
123
123
|
|
|
124
|
+
const authClientFunction = (0, _authHelper.getAuthClientFunction)(chatConfig);
|
|
125
|
+
|
|
126
|
+
if (getAuthToken && authClientFunction) {
|
|
127
|
+
// set auth token to chat sdk before start chat
|
|
128
|
+
const authSuccess = await (0, _authHelper.handleAuthentication)(chatSDK, chatConfig, getAuthToken);
|
|
129
|
+
|
|
130
|
+
if (!authSuccess) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
124
135
|
let isStartChatSuccessful = false; //Check if chat retrieved from cache
|
|
125
136
|
|
|
126
137
|
if (persistedState || params !== null && params !== void 0 && params.liveChatContext) {
|
|
@@ -145,9 +156,7 @@ const initStartChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAda
|
|
|
145
156
|
|
|
146
157
|
|
|
147
158
|
setCustomContextParams(chatSDK);
|
|
148
|
-
optionalParams = Object.assign({}, params, optionalParams);
|
|
149
|
-
|
|
150
|
-
await (0, _authHelper.handleAuthentication)(chatSDK, chatConfig, getAuthToken);
|
|
159
|
+
optionalParams = Object.assign({}, params, optionalParams);
|
|
151
160
|
await chatSDK.startChat(optionalParams);
|
|
152
161
|
isStartChatSuccessful = true;
|
|
153
162
|
} catch (error) {
|
|
@@ -91,7 +91,9 @@ var _useChatSDKStore = _interopRequireDefault(require("../../../hooks/useChatSDK
|
|
|
91
91
|
|
|
92
92
|
var _ActivityStreamHandler = require("../common/ActivityStreamHandler");
|
|
93
93
|
|
|
94
|
-
var
|
|
94
|
+
var _defaultCacheManager = require("../../../common/storage/default/defaultCacheManager");
|
|
95
|
+
|
|
96
|
+
var _defaultClientDataStoreProvider = require("../../../common/storage/default/defaultClientDataStoreProvider");
|
|
95
97
|
|
|
96
98
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
97
99
|
|
|
@@ -152,30 +154,39 @@ const LiveChatWidgetStateful = props => {
|
|
|
152
154
|
};
|
|
153
155
|
|
|
154
156
|
(0, _react2.useEffect)(() => {
|
|
155
|
-
var _props$
|
|
157
|
+
var _props$controlProps4, _props$controlProps5, _props$controlProps6, _props$controlProps8, _props$chatConfig, _props$chatConfig$Cha, _props$controlProps9, _props$reconnectChatP, _props$chatConfig2, _props$chatConfig2$Li, _props$reconnectChatP4, _state$domainStates;
|
|
158
|
+
|
|
159
|
+
// Add default localStorage support for widget
|
|
160
|
+
if (props.contextDataStore === undefined) {
|
|
161
|
+
var _chatSDK$omnichannelC2, _chatSDK$omnichannelC3, _props$controlProps3;
|
|
162
|
+
|
|
163
|
+
(0, _defaultCacheManager.registerBroadcastServiceForLocalStorage)(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC2 = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC2 === void 0 ? void 0 : _chatSDK$omnichannelC2.orgId, chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC3 = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC3 === void 0 ? void 0 : _chatSDK$omnichannelC3.widgetId, (props === null || props === void 0 ? void 0 : (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.widgetInstanceId) ?? "");
|
|
164
|
+
_DataStoreManager.DataStoreManager.clientDataStore = (0, _defaultClientDataStoreProvider.defaultClientDataStoreProvider)();
|
|
165
|
+
} else {
|
|
166
|
+
_DataStoreManager.DataStoreManager.clientDataStore = props.contextDataStore;
|
|
167
|
+
}
|
|
156
168
|
|
|
157
169
|
(0, _registerTelemetryLoggers.registerTelemetryLoggers)(props, dispatch);
|
|
158
170
|
(0, _createInternetConnectionChangeHandler.createInternetConnectionChangeHandler)();
|
|
159
|
-
_DataStoreManager.DataStoreManager.clientDataStore = props.contextDataStore ?? undefined;
|
|
160
171
|
dispatch({
|
|
161
172
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_ELEMENT_ID,
|
|
162
173
|
payload: widgetElementId
|
|
163
174
|
});
|
|
164
175
|
dispatch({
|
|
165
176
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SKIP_CHAT_BUTTON_RENDERING,
|
|
166
|
-
payload: ((_props$
|
|
177
|
+
payload: ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.skipChatButtonRendering) || false
|
|
167
178
|
});
|
|
168
179
|
dispatch({
|
|
169
180
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_E2VV_ENABLED,
|
|
170
181
|
payload: false
|
|
171
182
|
});
|
|
172
183
|
|
|
173
|
-
if ((_props$
|
|
174
|
-
var _props$
|
|
184
|
+
if ((_props$controlProps5 = props.controlProps) !== null && _props$controlProps5 !== void 0 && _props$controlProps5.widgetInstanceId && !(0, _utils.isNullOrEmptyString)((_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.widgetInstanceId)) {
|
|
185
|
+
var _props$controlProps7;
|
|
175
186
|
|
|
176
187
|
dispatch({
|
|
177
188
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_INSTANCE_ID,
|
|
178
|
-
payload: (_props$
|
|
189
|
+
payload: (_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.widgetInstanceId
|
|
179
190
|
});
|
|
180
191
|
}
|
|
181
192
|
|
|
@@ -186,13 +197,13 @@ const LiveChatWidgetStateful = props => {
|
|
|
186
197
|
});
|
|
187
198
|
}); // Initialize global dir
|
|
188
199
|
|
|
189
|
-
const globalDir = ((_props$
|
|
200
|
+
const globalDir = ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.dir) ?? (0, _utils.getLocaleDirection)((_props$chatConfig = props.chatConfig) === null || _props$chatConfig === void 0 ? void 0 : (_props$chatConfig$Cha = _props$chatConfig.ChatWidgetLanguage) === null || _props$chatConfig$Cha === void 0 ? void 0 : _props$chatConfig$Cha.msdyn_localeid);
|
|
190
201
|
dispatch({
|
|
191
202
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_GLOBAL_DIR,
|
|
192
203
|
payload: globalDir
|
|
193
204
|
});
|
|
194
205
|
|
|
195
|
-
if (!((_props$
|
|
206
|
+
if (!((_props$controlProps9 = props.controlProps) !== null && _props$controlProps9 !== void 0 && _props$controlProps9.skipChatButtonRendering) && (_props$reconnectChatP = props.reconnectChatPaneProps) !== null && _props$reconnectChatP !== void 0 && _props$reconnectChatP.reconnectId) {
|
|
196
207
|
var _props$reconnectChatP2, _props$reconnectChatP3;
|
|
197
208
|
|
|
198
209
|
(0, _reconnectChatHelper.startUnauthenticatedReconnectChat)(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.isReconnectEnabled, (_props$reconnectChatP3 = props.reconnectChatPaneProps) === null || _props$reconnectChatP3 === void 0 ? void 0 : _props$reconnectChatP3.reconnectId, _startChat.initStartChat);
|
|
@@ -218,21 +229,16 @@ const LiveChatWidgetStateful = props => {
|
|
|
218
229
|
}
|
|
219
230
|
});
|
|
220
231
|
return;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (isAuthenticationSettingsEnabled === false) {
|
|
225
|
-
var _state$domainStates;
|
|
232
|
+
}
|
|
226
233
|
|
|
227
|
-
|
|
228
|
-
|
|
234
|
+
if (!state.appStates.skipChatButtonRendering && !(0, _utils.isUndefinedOrEmpty)((_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.liveChatContext) && state.appStates.conversationState === _ConversationState.ConversationState.Active) {
|
|
235
|
+
var _state$domainStates2;
|
|
229
236
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
237
|
+
const optionalParams = {
|
|
238
|
+
liveChatContext: (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.liveChatContext
|
|
239
|
+
};
|
|
240
|
+
(0, _startChat.initStartChat)(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, optionalParams);
|
|
241
|
+
return;
|
|
236
242
|
} // All other case should show start chat button, skipChatButtonRendering will take care of it own
|
|
237
243
|
|
|
238
244
|
|
|
@@ -280,7 +286,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
280
286
|
}, [state.appStates.skipChatButtonRendering]); // useEffect for when skip chat button rendering
|
|
281
287
|
|
|
282
288
|
(0, _react2.useEffect)(() => {
|
|
283
|
-
var _chatSDK$
|
|
289
|
+
var _chatSDK$omnichannelC8, _chatSDK$omnichannelC9, _props$controlProps12;
|
|
284
290
|
|
|
285
291
|
// Add the custom context on receiving the SetCustomContext event
|
|
286
292
|
_omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.SetCustomContext).subscribe(msg => {
|
|
@@ -315,14 +321,14 @@ const LiveChatWidgetStateful = props => {
|
|
|
315
321
|
|
|
316
322
|
|
|
317
323
|
_omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.StartChat).subscribe(() => {
|
|
318
|
-
var _chatSDK$
|
|
324
|
+
var _chatSDK$omnichannelC4, _chatSDK$omnichannelC5, _props$controlProps10;
|
|
319
325
|
|
|
320
326
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
321
327
|
Event: _TelemetryConstants.TelemetryEvent.StartChatEventRecevied,
|
|
322
328
|
Description: "Start chat event received."
|
|
323
329
|
});
|
|
324
330
|
|
|
325
|
-
const persistedState = (0, _utils.getStateFromCache)(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$
|
|
331
|
+
const persistedState = (0, _utils.getStateFromCache)(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC4 = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC4 === void 0 ? void 0 : _chatSDK$omnichannelC4.orgId, chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC5 = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC5 === void 0 ? void 0 : _chatSDK$omnichannelC5.widgetId, (props === null || props === void 0 ? void 0 : (_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.widgetInstanceId) ?? ""); // Chat not found in cache
|
|
326
332
|
|
|
327
333
|
if (persistedState === undefined) {
|
|
328
334
|
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
@@ -366,10 +372,10 @@ const LiveChatWidgetStateful = props => {
|
|
|
366
372
|
|
|
367
373
|
_omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.InitiateEndChat).subscribe(async () => {
|
|
368
374
|
if (state.appStates.skipChatButtonRendering !== true) {
|
|
369
|
-
var _chatSDK$
|
|
375
|
+
var _chatSDK$omnichannelC6, _chatSDK$omnichannelC7, _props$controlProps11;
|
|
370
376
|
|
|
371
377
|
// This is to ensure to get latest state from cache in multitab
|
|
372
|
-
const persistedState = (0, _utils.getStateFromCache)(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$
|
|
378
|
+
const persistedState = (0, _utils.getStateFromCache)(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC6 = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC6 === void 0 ? void 0 : _chatSDK$omnichannelC6.orgId, chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC7 = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC7 === void 0 ? void 0 : _chatSDK$omnichannelC7.widgetId, (props === null || props === void 0 ? void 0 : (_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.widgetInstanceId) ?? "");
|
|
373
379
|
|
|
374
380
|
if (persistedState && persistedState.appStates.conversationState === _ConversationState.ConversationState.Active) {
|
|
375
381
|
(0, _endChat.prepareEndChat)(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, state);
|
|
@@ -391,7 +397,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
391
397
|
}); // Listen to end chat event from other tabs
|
|
392
398
|
|
|
393
399
|
|
|
394
|
-
const endChatEventName = (0, _utils.getWidgetEndChatEventName)(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$
|
|
400
|
+
const endChatEventName = (0, _utils.getWidgetEndChatEventName)(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC8 = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC8 === void 0 ? void 0 : _chatSDK$omnichannelC8.orgId, chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC9 = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC9 === void 0 ? void 0 : _chatSDK$omnichannelC9.widgetId, ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.widgetInstanceId) ?? "");
|
|
395
401
|
|
|
396
402
|
_omnichannelChatComponents.BroadcastService.getMessageByEventName(endChatEventName).subscribe(async () => {
|
|
397
403
|
(0, _endChat.endChat)(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, false, false, false);
|
|
@@ -477,23 +483,25 @@ const LiveChatWidgetStateful = props => {
|
|
|
477
483
|
}, [(_props$webChatContain3 = props.webChatContainerProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.webChatStyles]); // Publish chat widget state
|
|
478
484
|
|
|
479
485
|
(0, _react2.useEffect)(() => {
|
|
480
|
-
var _props$
|
|
486
|
+
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps13;
|
|
481
487
|
|
|
482
488
|
// Only activate these windows events when conversation state is active and chat widget is in popout mode
|
|
483
489
|
// Ghost chat scenarios
|
|
484
|
-
if (state.appStates.conversationState === _ConversationState.ConversationState.Active && ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.skipChatButtonRendering) === true) {
|
|
485
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
486
|
-
window.onbeforeunload = function () {
|
|
487
|
-
const prompt = _Constants.Constants.BrowserUnloadConfirmationMessage;
|
|
488
|
-
return prompt;
|
|
489
|
-
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
window.onunload = function () {
|
|
493
|
-
initiateEndChatOnBrowserUnload();
|
|
494
|
-
};
|
|
495
|
-
}
|
|
496
490
|
|
|
491
|
+
/* COMMENTING THIS CODE FOR PARITY WITH OLD LCW
|
|
492
|
+
if (state.appStates.conversationState === ConversationState.Active &&
|
|
493
|
+
props.controlProps?.skipChatButtonRendering === true) {
|
|
494
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
495
|
+
|
|
496
|
+
window.onbeforeunload = function () {
|
|
497
|
+
const prompt = Constants.BrowserUnloadConfirmationMessage;
|
|
498
|
+
return prompt;
|
|
499
|
+
};
|
|
500
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
501
|
+
window.onunload = function () {
|
|
502
|
+
initiateEndChatOnBrowserUnload();
|
|
503
|
+
};
|
|
504
|
+
}*/
|
|
497
505
|
widgetStateEventName = (0, _utils.getWidgetCacheId)(props === null || props === void 0 ? void 0 : (_props$chatSDK = props.chatSDK) === null || _props$chatSDK === void 0 ? void 0 : (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) === null || _props$chatSDK$omnich === void 0 ? void 0 : _props$chatSDK$omnich.orgId, props === null || props === void 0 ? void 0 : (_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.widgetId, (props === null || props === void 0 ? void 0 : (_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.widgetInstanceId) ?? "");
|
|
498
506
|
const chatWidgetStateChangeEvent = {
|
|
499
507
|
eventName: widgetStateEventName,
|