@seamly/web-ui 21.0.7 → 21.0.9
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/build/dist/lib/components.js +224 -231
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/hooks.js +116 -16
- package/build/dist/lib/hooks.min.js +1 -1
- package/build/dist/lib/index.debug.js +50 -39
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +5 -1
- package/build/dist/lib/index.js +208 -220
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +215 -251
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +194 -191
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/utils.js +192 -189
- package/build/dist/lib/utils.min.js +1 -1
- package/package.json +1 -1
- package/src/javascripts/domains/forms/provider.tsx +1 -1
- package/src/javascripts/domains/i18n/slice.ts +2 -0
- package/src/javascripts/domains/interrupt/hooks.ts +15 -7
- package/src/javascripts/domains/interrupt/middleware.ts +7 -14
- package/src/javascripts/domains/interrupt/selectors.ts +4 -0
- package/src/javascripts/domains/interrupt/slice.ts +2 -2
- package/src/javascripts/domains/translations/components/translation-status.tsx +4 -3
- package/src/javascripts/domains/translations/slice.ts +2 -0
- package/src/javascripts/ui/components/app-options/index.js +4 -3
- package/src/javascripts/ui/components/core/seamly-event-subscriber.ts +9 -13
- package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +5 -5
- package/src/javascripts/ui/components/entry/deprecated-toggle-button.js +4 -3
- package/src/javascripts/ui/components/faq/faq.js +5 -4
- package/src/javascripts/ui/components/layout/agent-info.js +4 -3
- package/src/javascripts/ui/components/layout/chat-frame.js +7 -8
- package/src/javascripts/ui/components/layout/deprecated-chat-frame.js +7 -8
- package/src/javascripts/ui/components/layout/interrupt.js +6 -15
- package/src/javascripts/ui/components/layout/pre-chat-messages.js +4 -3
- package/src/javascripts/ui/components/suggestions/index.js +5 -4
- package/src/javascripts/ui/components/translation-chat-status/index.tsx +4 -3
- package/src/javascripts/ui/components/view/app-view.js +1 -2
- package/src/javascripts/ui/components/view/deprecated-view.js +1 -2
- package/src/javascripts/ui/components/view/inline-view.js +1 -11
- package/src/javascripts/ui/components/view/window-view/index.js +1 -9
- package/src/javascripts/ui/components/view/window-view/window-open-button.js +4 -3
- package/src/javascripts/ui/hooks/{use-seamly-chat.js → use-seamly-chat.ts} +5 -1
- package/src/javascripts/ui/hooks/use-session-expired-command.ts +17 -0
- package/src/.DS_Store +0 -0
package/build/dist/lib/index.js
CHANGED
|
@@ -7293,7 +7293,7 @@ _API_ready = new WeakMap(), _API_externalId = new WeakMap(), _API_layoutMode = n
|
|
|
7293
7293
|
return {
|
|
7294
7294
|
clientName: "@seamly/web-ui",
|
|
7295
7295
|
clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
|
|
7296
|
-
clientVersion: "21.0.
|
|
7296
|
+
clientVersion: "21.0.9",
|
|
7297
7297
|
currentUrl: window.location.toString(),
|
|
7298
7298
|
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
7299
7299
|
timezone: getTimeZone(),
|
|
@@ -11744,7 +11744,7 @@ const interruptSlice = createSlice({
|
|
|
11744
11744
|
clearInterrupt: () => slice_initialState
|
|
11745
11745
|
},
|
|
11746
11746
|
extraReducers: builder => {
|
|
11747
|
-
builder.addCase(
|
|
11747
|
+
builder.addCase(initializeConfig.pending, () => slice_initialState).addMatcher(isAnyOf(initializeApp.rejected, initializeConfig.rejected, setLocale.rejected, setVisibility.rejected, initializeVisibility.rejected), (state, {
|
|
11748
11748
|
payload
|
|
11749
11749
|
}) => {
|
|
11750
11750
|
state.error = payload;
|
|
@@ -12620,6 +12620,7 @@ const {
|
|
|
12620
12620
|
|
|
12621
12621
|
|
|
12622
12622
|
|
|
12623
|
+
|
|
12623
12624
|
const i18n_slice_initialState = {
|
|
12624
12625
|
translations: {
|
|
12625
12626
|
'errors.configError.message': 'We are sorry this happened, please retry at a later time.',
|
|
@@ -12656,7 +12657,7 @@ const i18nSlice = createSlice({
|
|
|
12656
12657
|
},
|
|
12657
12658
|
extraReducers: builder => {
|
|
12658
12659
|
// Add reducers for additional action types here, and handle loading state as needed
|
|
12659
|
-
builder.addCase(initializeConfig.fulfilled, (state, {
|
|
12660
|
+
builder.addCase(resetApp.pending, () => i18n_slice_initialState).addCase(initializeConfig.fulfilled, (state, {
|
|
12660
12661
|
payload
|
|
12661
12662
|
}) => {
|
|
12662
12663
|
state.initialLocale = payload.locale;
|
|
@@ -12686,12 +12687,7 @@ const {
|
|
|
12686
12687
|
;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/middleware.ts
|
|
12687
12688
|
|
|
12688
12689
|
|
|
12689
|
-
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
const handledErrorTypes = [SeamlyGeneralError, SeamlyConfigurationError, SeamlySessionExpiredError, SeamlyOfflineError, SeamlyUnauthorizedError, SeamlyUnavailableError];
|
|
12690
|
+
const handledErrorTypes = ['SeamlyGeneralError', 'SeamlyConfigurationError', 'SeamlySessionExpiredError', 'SeamlyOfflineError', 'SeamlyUnauthorizedError', 'SeamlyUnavailableError'];
|
|
12695
12691
|
function createInterruptMiddleware({
|
|
12696
12692
|
api
|
|
12697
12693
|
}) {
|
|
@@ -12701,7 +12697,7 @@ function createInterruptMiddleware({
|
|
|
12701
12697
|
type
|
|
12702
12698
|
} = action;
|
|
12703
12699
|
if (type === setInterrupt.type) {
|
|
12704
|
-
if (!handledErrorTypes.
|
|
12700
|
+
if (!handledErrorTypes.includes(payload.name)) {
|
|
12705
12701
|
throw new SeamlyGeneralError(payload);
|
|
12706
12702
|
} else if (payload.action === 'reset') {
|
|
12707
12703
|
// [SMLY-942] We clear the store before a reset to force a new conversation if the page is refreshed before the conversation is reset
|
|
@@ -12764,6 +12760,7 @@ const selectIsLoading = es_createSelector(({
|
|
|
12764
12760
|
|
|
12765
12761
|
|
|
12766
12762
|
|
|
12763
|
+
|
|
12767
12764
|
const translationsInitialState = {
|
|
12768
12765
|
isActive: false,
|
|
12769
12766
|
currentLocale: undefined,
|
|
@@ -12854,7 +12851,7 @@ const translationSlice = createSlice({
|
|
|
12854
12851
|
}
|
|
12855
12852
|
},
|
|
12856
12853
|
extraReducers: builder => {
|
|
12857
|
-
builder.addCase(initializeConfig.fulfilled, (state, {
|
|
12854
|
+
builder.addCase(resetApp.pending, () => translationsInitialState).addCase(initializeConfig.fulfilled, (state, {
|
|
12858
12855
|
payload
|
|
12859
12856
|
}) => {
|
|
12860
12857
|
var _a;
|
|
@@ -14041,7 +14038,109 @@ const useLiveRegion = () => {
|
|
|
14041
14038
|
sendAssertive
|
|
14042
14039
|
};
|
|
14043
14040
|
};
|
|
14044
|
-
;// CONCATENATED MODULE: ./src/javascripts/
|
|
14041
|
+
;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/selectors.ts
|
|
14042
|
+
|
|
14043
|
+
const selectError = es_createSelector(({
|
|
14044
|
+
interrupt
|
|
14045
|
+
}) => interrupt, ({
|
|
14046
|
+
error
|
|
14047
|
+
}) => error);
|
|
14048
|
+
const selectHasError = es_createSelector(selectError, error => Boolean(error));
|
|
14049
|
+
;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/hooks.ts
|
|
14050
|
+
|
|
14051
|
+
|
|
14052
|
+
|
|
14053
|
+
|
|
14054
|
+
function useInterrupt() {
|
|
14055
|
+
const {
|
|
14056
|
+
t
|
|
14057
|
+
} = useI18n();
|
|
14058
|
+
const error = useSelector_useSelector(selectError);
|
|
14059
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
14060
|
+
const meta = (0,hooks_.useMemo)(() => {
|
|
14061
|
+
if (!hasError) {
|
|
14062
|
+
return {
|
|
14063
|
+
title: undefined,
|
|
14064
|
+
message: undefined,
|
|
14065
|
+
srText: undefined,
|
|
14066
|
+
buttonText: undefined,
|
|
14067
|
+
originalError: undefined
|
|
14068
|
+
};
|
|
14069
|
+
}
|
|
14070
|
+
const {
|
|
14071
|
+
langKey,
|
|
14072
|
+
action
|
|
14073
|
+
} = error;
|
|
14074
|
+
const title = t(`${langKey}.title`);
|
|
14075
|
+
const message = t(`${langKey}.message`);
|
|
14076
|
+
const srText = t(`${langKey}.srText`);
|
|
14077
|
+
const buttonText = t(`${langKey}.buttonText`);
|
|
14078
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, langKey ? {
|
|
14079
|
+
title,
|
|
14080
|
+
message,
|
|
14081
|
+
srText
|
|
14082
|
+
} : {}), action ? {
|
|
14083
|
+
action
|
|
14084
|
+
} : {}), action && langKey ? {
|
|
14085
|
+
buttonText
|
|
14086
|
+
} : {}), {
|
|
14087
|
+
originalError: error
|
|
14088
|
+
});
|
|
14089
|
+
}, [hasError, error, t]);
|
|
14090
|
+
return {
|
|
14091
|
+
hasError,
|
|
14092
|
+
meta,
|
|
14093
|
+
error
|
|
14094
|
+
};
|
|
14095
|
+
}
|
|
14096
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-session-expired-command.ts
|
|
14097
|
+
|
|
14098
|
+
|
|
14099
|
+
|
|
14100
|
+
function useSessionExpiredCommand() {
|
|
14101
|
+
const {
|
|
14102
|
+
meta: {
|
|
14103
|
+
originalError,
|
|
14104
|
+
action
|
|
14105
|
+
}
|
|
14106
|
+
} = useInterrupt();
|
|
14107
|
+
const seamlyCommands = use_seamly_commands();
|
|
14108
|
+
const isExpiredError = (originalError === null || originalError === void 0 ? void 0 : originalError.name) === 'SeamlySessionExpiredError';
|
|
14109
|
+
(0,hooks_.useEffect)(() => {
|
|
14110
|
+
if (isExpiredError && seamlyCommands[action]) {
|
|
14111
|
+
seamlyCommands[action]();
|
|
14112
|
+
}
|
|
14113
|
+
}, [action, seamlyCommands, isExpiredError]);
|
|
14114
|
+
}
|
|
14115
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-chat.ts
|
|
14116
|
+
var use_seamly_chat_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
14117
|
+
function adopt(value) {
|
|
14118
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
14119
|
+
resolve(value);
|
|
14120
|
+
});
|
|
14121
|
+
}
|
|
14122
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14123
|
+
function fulfilled(value) {
|
|
14124
|
+
try {
|
|
14125
|
+
step(generator.next(value));
|
|
14126
|
+
} catch (e) {
|
|
14127
|
+
reject(e);
|
|
14128
|
+
}
|
|
14129
|
+
}
|
|
14130
|
+
function rejected(value) {
|
|
14131
|
+
try {
|
|
14132
|
+
step(generator["throw"](value));
|
|
14133
|
+
} catch (e) {
|
|
14134
|
+
reject(e);
|
|
14135
|
+
}
|
|
14136
|
+
}
|
|
14137
|
+
function step(result) {
|
|
14138
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
14139
|
+
}
|
|
14140
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14141
|
+
});
|
|
14142
|
+
};
|
|
14143
|
+
|
|
14045
14144
|
|
|
14046
14145
|
|
|
14047
14146
|
|
|
@@ -14080,6 +14179,8 @@ const useSeamlyChat = () => {
|
|
|
14080
14179
|
const {
|
|
14081
14180
|
sendAssertive
|
|
14082
14181
|
} = useLiveRegion();
|
|
14182
|
+
// Automatically reset conversation if the session has expired
|
|
14183
|
+
useSessionExpiredCommand();
|
|
14083
14184
|
(0,hooks_.useEffect)(() => {
|
|
14084
14185
|
if (isVisible) {
|
|
14085
14186
|
// Wait for the live containers to stabilise in the DOM before injecting
|
|
@@ -14126,24 +14227,23 @@ const useSeamlyChat = () => {
|
|
|
14126
14227
|
connectCalled.current = false;
|
|
14127
14228
|
}
|
|
14128
14229
|
}, [apiConfigReady, apiConnected]);
|
|
14129
|
-
const connectAndStart = (0,hooks_.useCallback)(
|
|
14230
|
+
const connectAndStart = (0,hooks_.useCallback)(() => use_seamly_chat_awaiter(void 0, void 0, void 0, function* () {
|
|
14130
14231
|
// We don't connect if we are already connected to the api to avoid multiple in-flight connection processes.
|
|
14131
14232
|
if (!apiConnected) {
|
|
14132
14233
|
connectCalled.current = true;
|
|
14133
|
-
|
|
14234
|
+
yield connect();
|
|
14134
14235
|
}
|
|
14135
|
-
|
|
14136
14236
|
// We only start a conversation when the chat interface is either app, 'open' or if using the inline view if it's 'open' or 'minimized'.
|
|
14137
14237
|
if (isApp || isOpen || isVisible && isInline) {
|
|
14138
14238
|
start();
|
|
14139
14239
|
}
|
|
14140
|
-
}, [apiConnected, connect, isApp, isInline, isOpen, isVisible, start]);
|
|
14240
|
+
}), [apiConnected, connect, isApp, isInline, isOpen, isVisible, start]);
|
|
14141
14241
|
(0,hooks_.useEffect)(() => {
|
|
14142
14242
|
// We dont't connect or start when the apiConfig is not ready yet.
|
|
14143
14243
|
// We also keep track of whether start has been called to avoid multiple in-flight connection processes.
|
|
14144
14244
|
// We check if the window view is not open and no conversation is started yet.
|
|
14145
14245
|
// Lastly we check if the inline view is not scrolled in to view.
|
|
14146
|
-
if (!apiConfigReady || connectCalled.current || isWindow && !isOpen
|
|
14246
|
+
if (!apiConfigReady || connectCalled.current || isWindow && !isOpen || isInline && (!isVisible || !showInlineView)) {
|
|
14147
14247
|
return;
|
|
14148
14248
|
}
|
|
14149
14249
|
if (hasConversation() && isOpen) {
|
|
@@ -18039,7 +18139,7 @@ const SeamlyEventSubscriber = () => {
|
|
|
18039
18139
|
channel === null || channel === void 0 ? void 0 : channel.leave();
|
|
18040
18140
|
};
|
|
18041
18141
|
}
|
|
18042
|
-
return () =>
|
|
18142
|
+
return () => undefined;
|
|
18043
18143
|
}, [api, api.connectionInfo, api.conversation]);
|
|
18044
18144
|
(0,hooks_.useEffect)(() => {
|
|
18045
18145
|
api.conversation.onConnection(({
|
|
@@ -18222,6 +18322,9 @@ const SeamlyEventSubscriber = () => {
|
|
|
18222
18322
|
const {
|
|
18223
18323
|
channel
|
|
18224
18324
|
} = api.conversation;
|
|
18325
|
+
if (messageChannelRef.current) {
|
|
18326
|
+
channel === null || channel === void 0 ? void 0 : channel.off('message', messageChannelRef.current);
|
|
18327
|
+
}
|
|
18225
18328
|
messageChannelRef.current = channel.on('message', payload => {
|
|
18226
18329
|
if (!EMITTABLE_MESSAGE_TYPES.includes(payload.type)) {
|
|
18227
18330
|
return payload;
|
|
@@ -18238,19 +18341,18 @@ const SeamlyEventSubscriber = () => {
|
|
|
18238
18341
|
});
|
|
18239
18342
|
return true;
|
|
18240
18343
|
});
|
|
18241
|
-
return () => {
|
|
18242
|
-
var _a;
|
|
18243
|
-
(_a = api.conversation.channel) === null || _a === void 0 ? void 0 : _a.off('message', messageChannelRef.current);
|
|
18244
|
-
};
|
|
18245
18344
|
}
|
|
18246
|
-
return () => undefined;
|
|
18247
18345
|
}, [api, api.connectionInfo, api.conversation.channel, eventBus]);
|
|
18248
18346
|
(0,hooks_.useEffect)(() => {
|
|
18249
18347
|
if (api.connectionInfo) {
|
|
18250
18348
|
api.conversation.onConnection(({
|
|
18251
18349
|
connected
|
|
18252
18350
|
}) => {
|
|
18351
|
+
var _a;
|
|
18253
18352
|
if (!connected) return false;
|
|
18353
|
+
if (syncChannelRef.current) {
|
|
18354
|
+
(_a = api.conversation.channel) === null || _a === void 0 ? void 0 : _a.off('sync', syncChannelRef.current);
|
|
18355
|
+
}
|
|
18254
18356
|
syncChannelRef.current = api.conversation.channel.on('sync', payload => {
|
|
18255
18357
|
var _a;
|
|
18256
18358
|
const lastEvent = events[events.length - 1];
|
|
@@ -18274,12 +18376,7 @@ const SeamlyEventSubscriber = () => {
|
|
|
18274
18376
|
});
|
|
18275
18377
|
return true;
|
|
18276
18378
|
});
|
|
18277
|
-
return () => {
|
|
18278
|
-
var _a;
|
|
18279
|
-
(_a = api.conversation.channel) === null || _a === void 0 ? void 0 : _a.off('sync', syncChannelRef.current);
|
|
18280
|
-
};
|
|
18281
18379
|
}
|
|
18282
|
-
return () => undefined;
|
|
18283
18380
|
}, [api, api.connectionInfo, api.conversation.channel, events, dispatch]);
|
|
18284
18381
|
return null;
|
|
18285
18382
|
};
|
|
@@ -18415,52 +18512,6 @@ const SeamlyInitializer = () => {
|
|
|
18415
18512
|
return null;
|
|
18416
18513
|
};
|
|
18417
18514
|
/* harmony default export */ const seamly_initializer = (SeamlyInitializer);
|
|
18418
|
-
;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/selectors.ts
|
|
18419
|
-
|
|
18420
|
-
const selectError = es_createSelector(({
|
|
18421
|
-
interrupt
|
|
18422
|
-
}) => interrupt, ({
|
|
18423
|
-
error
|
|
18424
|
-
}) => error);
|
|
18425
|
-
;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/hooks.ts
|
|
18426
|
-
|
|
18427
|
-
|
|
18428
|
-
|
|
18429
|
-
|
|
18430
|
-
function useInterrupt() {
|
|
18431
|
-
const {
|
|
18432
|
-
t
|
|
18433
|
-
} = useI18n();
|
|
18434
|
-
const error = useSelector_useSelector(selectError);
|
|
18435
|
-
const hasInterrupt = Boolean(error);
|
|
18436
|
-
const meta = (0,hooks_.useMemo)(() => {
|
|
18437
|
-
if (!error) return {};
|
|
18438
|
-
const {
|
|
18439
|
-
langKey,
|
|
18440
|
-
action
|
|
18441
|
-
} = error;
|
|
18442
|
-
const title = t(`${langKey}.title`);
|
|
18443
|
-
const message = t(`${langKey}.message`);
|
|
18444
|
-
const srText = t(`${langKey}.srText`);
|
|
18445
|
-
const buttonText = t(`${langKey}.buttonText`);
|
|
18446
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({}, langKey ? {
|
|
18447
|
-
title,
|
|
18448
|
-
message,
|
|
18449
|
-
srText
|
|
18450
|
-
} : {}), action ? {
|
|
18451
|
-
action
|
|
18452
|
-
} : {}), action && langKey ? {
|
|
18453
|
-
buttonText
|
|
18454
|
-
} : {}), {
|
|
18455
|
-
originalError: error
|
|
18456
|
-
});
|
|
18457
|
-
}, [t, error]);
|
|
18458
|
-
return {
|
|
18459
|
-
hasInterrupt,
|
|
18460
|
-
meta,
|
|
18461
|
-
error
|
|
18462
|
-
};
|
|
18463
|
-
}
|
|
18464
18515
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-instance-functions-loader.js
|
|
18465
18516
|
|
|
18466
18517
|
|
|
@@ -18510,9 +18561,7 @@ const SeamlyInstanceFunctionsLoader = () => {
|
|
|
18510
18561
|
isInline,
|
|
18511
18562
|
isResolving
|
|
18512
18563
|
} = useSeamlyLayoutMode();
|
|
18513
|
-
const
|
|
18514
|
-
hasInterrupt
|
|
18515
|
-
} = useInterrupt();
|
|
18564
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
18516
18565
|
const currentConversationUrl = useSeamlyConversationUrl();
|
|
18517
18566
|
const prevConversationUrl = (0,hooks_.useRef)(null);
|
|
18518
18567
|
const onActivityHandler = use_seamly_activity_event_handler();
|
|
@@ -18592,7 +18641,7 @@ const SeamlyInstanceFunctionsLoader = () => {
|
|
|
18592
18641
|
}
|
|
18593
18642
|
}, [api.send]);
|
|
18594
18643
|
(0,hooks_.useEffect)(() => {
|
|
18595
|
-
if (!isResolving && !
|
|
18644
|
+
if (!isResolving && !hasError) {
|
|
18596
18645
|
// Check for app reset
|
|
18597
18646
|
if (prevConversationUrl.current && prevConversationUrl.current !== currentConversationUrl) {
|
|
18598
18647
|
eventBus.emit('unreadMessageCount', unreadCount);
|
|
@@ -18611,7 +18660,7 @@ const SeamlyInstanceFunctionsLoader = () => {
|
|
|
18611
18660
|
previousUnreadCount.current = unreadCount;
|
|
18612
18661
|
prevConversationUrl.current = currentConversationUrl;
|
|
18613
18662
|
}
|
|
18614
|
-
}, [unreadCount, visible, eventBus, isInline, isResolving,
|
|
18663
|
+
}, [unreadCount, visible, eventBus, isInline, isResolving, hasError, currentConversationUrl]);
|
|
18615
18664
|
return null;
|
|
18616
18665
|
};
|
|
18617
18666
|
/* harmony default export */ const seamly_instance_functions_loader = (SeamlyInstanceFunctionsLoader);
|
|
@@ -19088,6 +19137,7 @@ const InOutTransition = ({
|
|
|
19088
19137
|
|
|
19089
19138
|
|
|
19090
19139
|
|
|
19140
|
+
|
|
19091
19141
|
|
|
19092
19142
|
|
|
19093
19143
|
const Suggestions = ({
|
|
@@ -19119,9 +19169,7 @@ const Suggestions = ({
|
|
|
19119
19169
|
sendPolite
|
|
19120
19170
|
} = useLiveRegion();
|
|
19121
19171
|
// interrupt & countdown hooks
|
|
19122
|
-
const
|
|
19123
|
-
hasInterrupt
|
|
19124
|
-
} = useInterrupt();
|
|
19172
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
19125
19173
|
const {
|
|
19126
19174
|
hasCountdown,
|
|
19127
19175
|
endCountdown
|
|
@@ -19138,7 +19186,7 @@ const Suggestions = ({
|
|
|
19138
19186
|
} = useTranslatedEventData({
|
|
19139
19187
|
payload
|
|
19140
19188
|
});
|
|
19141
|
-
const suggestions = (0,hooks_.useMemo)(() => payload && !
|
|
19189
|
+
const suggestions = (0,hooks_.useMemo)(() => payload && !hasError ? eventBody : [], [payload, hasError, eventBody]);
|
|
19142
19190
|
const prevSuggestions = (0,hooks_.useRef)(null);
|
|
19143
19191
|
const prevHasSuggestions = (0,hooks_.useRef)(false);
|
|
19144
19192
|
const previousRenderedSuggestions = (0,hooks_.useRef)([]);
|
|
@@ -19590,10 +19638,9 @@ function FormProvider(_a) {
|
|
|
19590
19638
|
});
|
|
19591
19639
|
}, [setExternalErrors]);
|
|
19592
19640
|
const handleSubmit = (0,hooks_.useCallback)((e) => {
|
|
19593
|
-
var _a;
|
|
19594
19641
|
e.preventDefault();
|
|
19595
19642
|
// If the submitter is set to being aria-disabled, block the submit action
|
|
19596
|
-
const ariaDisabled =
|
|
19643
|
+
const ariaDisabled = e.submitter.getAttribute('aria-disabled') === 'true';
|
|
19597
19644
|
setIsSubmitted(!ariaDisabled);
|
|
19598
19645
|
if (!ariaDisabled && validationIsValid) {
|
|
19599
19646
|
dispatch(setHasResponded(true));
|
|
@@ -20268,6 +20315,7 @@ function TranslationsOptionsButton({ children, position = {
|
|
|
20268
20315
|
|
|
20269
20316
|
|
|
20270
20317
|
|
|
20318
|
+
|
|
20271
20319
|
function AppOptions() {
|
|
20272
20320
|
const {
|
|
20273
20321
|
menuOptions,
|
|
@@ -20276,15 +20324,13 @@ function AppOptions() {
|
|
|
20276
20324
|
const {
|
|
20277
20325
|
isAvailable: isTranslationsAvailable
|
|
20278
20326
|
} = useTranslations();
|
|
20279
|
-
const
|
|
20280
|
-
hasInterrupt
|
|
20281
|
-
} = useInterrupt();
|
|
20327
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
20282
20328
|
const {
|
|
20283
20329
|
t,
|
|
20284
20330
|
locale
|
|
20285
20331
|
} = useI18n();
|
|
20286
20332
|
const localeNativeName = useLocaleNativeName(locale);
|
|
20287
|
-
if (!isTranslationsAvailable && (!allowOptionSelection || !menuOptions.length) ||
|
|
20333
|
+
if (!isTranslationsAvailable && (!allowOptionSelection || !menuOptions.length) || hasError) {
|
|
20288
20334
|
return null;
|
|
20289
20335
|
}
|
|
20290
20336
|
const openButtonText = t('translations.settings.openButtonText', {
|
|
@@ -21546,10 +21592,11 @@ const ChatStatus = ({ children, handleClose, title, closeButtonText, srCloseButt
|
|
|
21546
21592
|
|
|
21547
21593
|
|
|
21548
21594
|
|
|
21595
|
+
|
|
21549
21596
|
function TranslationChatStatus() {
|
|
21550
21597
|
const { t } = useI18n();
|
|
21551
21598
|
const { id } = useTranslationsContainer();
|
|
21552
|
-
const
|
|
21599
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
21553
21600
|
const { disableTranslations, currentLocale } = useTranslations();
|
|
21554
21601
|
const localeNativeName = useLocaleNativeName(currentLocale);
|
|
21555
21602
|
const focusSkiplinkTarget = useSkiplinkTargetFocusing();
|
|
@@ -21558,7 +21605,7 @@ function TranslationChatStatus() {
|
|
|
21558
21605
|
disableTranslations();
|
|
21559
21606
|
focusSkiplinkTarget();
|
|
21560
21607
|
}, [disableTranslations, focusSkiplinkTarget]);
|
|
21561
|
-
if (
|
|
21608
|
+
if (hasError) {
|
|
21562
21609
|
return null;
|
|
21563
21610
|
}
|
|
21564
21611
|
return ((0,jsx_runtime_namespaceObject.jsx)(chat_status, { handleClose: handleClickStop, title: label, id: id, closeButtonText: t('translations.status.stopText'), srCloseButtonText: t('translations.status.srStopText') }));
|
|
@@ -21591,24 +21638,17 @@ function TranslationProposal() {
|
|
|
21591
21638
|
|
|
21592
21639
|
|
|
21593
21640
|
|
|
21641
|
+
|
|
21594
21642
|
function TranslationStatus() {
|
|
21595
|
-
const
|
|
21643
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
21596
21644
|
const { isActive } = useTranslations();
|
|
21597
|
-
if (
|
|
21645
|
+
if (hasError) {
|
|
21598
21646
|
return null;
|
|
21599
21647
|
}
|
|
21600
21648
|
return !isActive ? (0,jsx_runtime_namespaceObject.jsx)(TranslationProposal, {}) : (0,jsx_runtime_namespaceObject.jsx)(TranslationChatStatus, {});
|
|
21601
21649
|
}
|
|
21602
21650
|
|
|
21603
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/
|
|
21604
|
-
function chat_frame_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21605
|
-
function chat_frame_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? chat_frame_ownKeys(Object(source), !0).forEach(function (key) { chat_frame_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : chat_frame_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21606
|
-
function chat_frame_defineProperty(obj, key, value) { key = chat_frame_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21607
|
-
function chat_frame_toPropertyKey(arg) { var key = chat_frame_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
21608
|
-
function chat_frame_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); }
|
|
21609
|
-
|
|
21610
|
-
|
|
21611
|
-
|
|
21651
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/interrupt.js
|
|
21612
21652
|
|
|
21613
21653
|
|
|
21614
21654
|
|
|
@@ -21617,61 +21657,24 @@ function chat_frame_toPrimitive(input, hint) { if (typeof input !== "object" ||
|
|
|
21617
21657
|
|
|
21618
21658
|
|
|
21619
21659
|
|
|
21620
|
-
|
|
21621
|
-
children,
|
|
21622
|
-
interruptComponent: InterruptComponent
|
|
21623
|
-
}) {
|
|
21624
|
-
const {
|
|
21625
|
-
hasInterrupt,
|
|
21626
|
-
meta
|
|
21627
|
-
} = useInterrupt();
|
|
21660
|
+
const Interrupt = () => {
|
|
21628
21661
|
const {
|
|
21629
|
-
|
|
21630
|
-
|
|
21631
|
-
|
|
21632
|
-
|
|
21633
|
-
|
|
21662
|
+
meta: {
|
|
21663
|
+
originalError,
|
|
21664
|
+
title,
|
|
21665
|
+
message,
|
|
21666
|
+
buttonText,
|
|
21667
|
+
action,
|
|
21668
|
+
srText
|
|
21634
21669
|
}
|
|
21635
|
-
|
|
21636
|
-
}
|
|
21637
|
-
return (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
21638
|
-
children: [(0,jsx_runtime_namespaceObject.jsxs)(chat_scroll_provider, {
|
|
21639
|
-
children: [(0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
21640
|
-
className: css_className('chat__container__header'),
|
|
21641
|
-
children: [(0,jsx_runtime_namespaceObject.jsx)(TranslationStatus, {}), (0,jsx_runtime_namespaceObject.jsx)(collapse_button, {})]
|
|
21642
|
-
}), children]
|
|
21643
|
-
}), (0,jsx_runtime_namespaceObject.jsx)(entry_container, {}), isOpen && (0,jsx_runtime_namespaceObject.jsx)(AppOptions, {})]
|
|
21644
|
-
});
|
|
21645
|
-
}
|
|
21646
|
-
/* harmony default export */ const chat_frame = (ChatFrame);
|
|
21647
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/interrupt.js
|
|
21648
|
-
|
|
21649
|
-
|
|
21650
|
-
|
|
21651
|
-
|
|
21652
|
-
|
|
21653
|
-
|
|
21654
|
-
|
|
21655
|
-
const Interrupt = ({
|
|
21656
|
-
originalError,
|
|
21657
|
-
title,
|
|
21658
|
-
message,
|
|
21659
|
-
buttonText,
|
|
21660
|
-
action,
|
|
21661
|
-
srText
|
|
21662
|
-
}) => {
|
|
21670
|
+
} = useInterrupt();
|
|
21663
21671
|
const seamlyCommands = use_seamly_commands();
|
|
21664
21672
|
const headingId = useGeneratedId();
|
|
21665
21673
|
const {
|
|
21666
21674
|
sendPolite
|
|
21667
21675
|
} = useLiveRegion();
|
|
21668
21676
|
const focusSkiplinkTarget = useSkiplinkTargetFocusing();
|
|
21669
|
-
const isExpiredError = originalError
|
|
21670
|
-
(0,hooks_.useEffect)(() => {
|
|
21671
|
-
if (isExpiredError && seamlyCommands[action]) {
|
|
21672
|
-
seamlyCommands[action]();
|
|
21673
|
-
}
|
|
21674
|
-
}, [action, seamlyCommands, isExpiredError]);
|
|
21677
|
+
const isExpiredError = originalError?.name === 'SeamlySessionExpiredError';
|
|
21675
21678
|
(0,hooks_.useEffect)(() => {
|
|
21676
21679
|
if (!isExpiredError && srText) {
|
|
21677
21680
|
// Wait for live regions to stabilise in case this occurs
|
|
@@ -21712,16 +21715,48 @@ const Interrupt = ({
|
|
|
21712
21715
|
}) : (0,jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {});
|
|
21713
21716
|
};
|
|
21714
21717
|
/* harmony default export */ const interrupt = (Interrupt);
|
|
21715
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/components/
|
|
21718
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/chat-frame.js
|
|
21719
|
+
|
|
21720
|
+
|
|
21721
|
+
|
|
21722
|
+
|
|
21723
|
+
|
|
21724
|
+
|
|
21725
|
+
|
|
21716
21726
|
|
|
21717
21727
|
|
|
21718
21728
|
|
|
21719
21729
|
|
|
21720
21730
|
|
|
21731
|
+
|
|
21732
|
+
function ChatFrame({
|
|
21733
|
+
children
|
|
21734
|
+
}) {
|
|
21735
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
21736
|
+
const {
|
|
21737
|
+
isOpen
|
|
21738
|
+
} = useVisibility();
|
|
21739
|
+
if (hasError) {
|
|
21740
|
+
return (0,jsx_runtime_namespaceObject.jsx)(interrupt, {});
|
|
21741
|
+
}
|
|
21742
|
+
return (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
21743
|
+
children: [(0,jsx_runtime_namespaceObject.jsxs)(chat_scroll_provider, {
|
|
21744
|
+
children: [(0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
21745
|
+
className: css_className('chat__container__header'),
|
|
21746
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)(TranslationStatus, {}), (0,jsx_runtime_namespaceObject.jsx)(collapse_button, {})]
|
|
21747
|
+
}), children]
|
|
21748
|
+
}), (0,jsx_runtime_namespaceObject.jsx)(entry_container, {}), isOpen && (0,jsx_runtime_namespaceObject.jsx)(AppOptions, {})]
|
|
21749
|
+
});
|
|
21750
|
+
}
|
|
21751
|
+
/* harmony default export */ const chat_frame = (ChatFrame);
|
|
21752
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/components/view/app-view.js
|
|
21753
|
+
|
|
21754
|
+
|
|
21755
|
+
|
|
21756
|
+
|
|
21721
21757
|
const AppView = () => {
|
|
21722
21758
|
return (0,jsx_runtime_namespaceObject.jsx)(chat, {
|
|
21723
21759
|
children: (0,jsx_runtime_namespaceObject.jsx)(chat_frame, {
|
|
21724
|
-
interruptComponent: interrupt,
|
|
21725
21760
|
children: (0,jsx_runtime_namespaceObject.jsx)(conversation, {})
|
|
21726
21761
|
})
|
|
21727
21762
|
});
|
|
@@ -21734,6 +21769,7 @@ const AppView = () => {
|
|
|
21734
21769
|
|
|
21735
21770
|
|
|
21736
21771
|
|
|
21772
|
+
|
|
21737
21773
|
function PreChatMessageEvent({
|
|
21738
21774
|
event
|
|
21739
21775
|
}) {
|
|
@@ -21747,13 +21783,11 @@ function PreChatMessages() {
|
|
|
21747
21783
|
preChatEvents,
|
|
21748
21784
|
layoutMode
|
|
21749
21785
|
} = useConfig();
|
|
21750
|
-
const
|
|
21751
|
-
hasInterrupt
|
|
21752
|
-
} = useInterrupt();
|
|
21786
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
21753
21787
|
const {
|
|
21754
21788
|
isOpen
|
|
21755
21789
|
} = useVisibility();
|
|
21756
|
-
const isVisible = !(
|
|
21790
|
+
const isVisible = !(hasError || !preChatEvents?.length || isOpen);
|
|
21757
21791
|
return isVisible && (0,jsx_runtime_namespaceObject.jsx)("ul", {
|
|
21758
21792
|
className: css_className('pre-chat-messages', `pre-chat-messages--${layoutMode}`),
|
|
21759
21793
|
"aria-hidden": !isVisible,
|
|
@@ -21766,13 +21800,6 @@ function PreChatMessages() {
|
|
|
21766
21800
|
});
|
|
21767
21801
|
}
|
|
21768
21802
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/view/inline-view.js
|
|
21769
|
-
function inline_view_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21770
|
-
function inline_view_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? inline_view_ownKeys(Object(source), !0).forEach(function (key) { inline_view_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : inline_view_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21771
|
-
function inline_view_defineProperty(obj, key, value) { key = inline_view_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21772
|
-
function inline_view_toPropertyKey(arg) { var key = inline_view_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
21773
|
-
function inline_view_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); }
|
|
21774
|
-
|
|
21775
|
-
|
|
21776
21803
|
|
|
21777
21804
|
|
|
21778
21805
|
|
|
@@ -21792,13 +21819,6 @@ const InlineView = () => {
|
|
|
21792
21819
|
const {
|
|
21793
21820
|
isOpen
|
|
21794
21821
|
} = useVisibility();
|
|
21795
|
-
const {
|
|
21796
|
-
hasInterrupt,
|
|
21797
|
-
meta
|
|
21798
|
-
} = useInterrupt();
|
|
21799
|
-
if (hasInterrupt && !isOpen) {
|
|
21800
|
-
return (0,jsx_runtime_namespaceObject.jsx)(interrupt, inline_view_objectSpread({}, meta));
|
|
21801
|
-
}
|
|
21802
21822
|
return (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
21803
21823
|
children: [(0,jsx_runtime_namespaceObject.jsx)(in_out_transition, {
|
|
21804
21824
|
isActive: !isOpen,
|
|
@@ -21814,7 +21834,6 @@ const InlineView = () => {
|
|
|
21814
21834
|
children: (0,jsx_runtime_namespaceObject.jsx)(chat, {
|
|
21815
21835
|
ref: containerRef,
|
|
21816
21836
|
children: showInlineView && (0,jsx_runtime_namespaceObject.jsx)(chat_frame, {
|
|
21817
|
-
interruptComponent: interrupt,
|
|
21818
21837
|
children: isOpen && (0,jsx_runtime_namespaceObject.jsx)(conversation, {})
|
|
21819
21838
|
})
|
|
21820
21839
|
})
|
|
@@ -21836,13 +21855,12 @@ const InlineView = () => {
|
|
|
21836
21855
|
|
|
21837
21856
|
|
|
21838
21857
|
|
|
21858
|
+
|
|
21839
21859
|
const ButtonIcon = () => {
|
|
21840
21860
|
const startChatIcon = useStartChatIcon();
|
|
21841
21861
|
const currentAgent = useSeamlyCurrentAgent();
|
|
21842
|
-
const
|
|
21843
|
-
|
|
21844
|
-
} = useInterrupt();
|
|
21845
|
-
const isActiveConversation = currentAgent && !hasInterrupt;
|
|
21862
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
21863
|
+
const isActiveConversation = currentAgent && !hasError;
|
|
21846
21864
|
const src = isActiveConversation ? currentAgent.avatar : startChatIcon;
|
|
21847
21865
|
return src ? (0,jsx_runtime_namespaceObject.jsx)("img", {
|
|
21848
21866
|
className: css_className(isActiveConversation ? 'avatar' : 'icon'),
|
|
@@ -21888,13 +21906,6 @@ const WindowOpenButton = ({
|
|
|
21888
21906
|
};
|
|
21889
21907
|
/* harmony default export */ const window_open_button = (WindowOpenButton);
|
|
21890
21908
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/view/window-view/index.js
|
|
21891
|
-
function window_view_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21892
|
-
function window_view_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? window_view_ownKeys(Object(source), !0).forEach(function (key) { window_view_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : window_view_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21893
|
-
function window_view_defineProperty(obj, key, value) { key = window_view_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21894
|
-
function window_view_toPropertyKey(arg) { var key = window_view_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
21895
|
-
function window_view_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); }
|
|
21896
|
-
|
|
21897
|
-
|
|
21898
21909
|
|
|
21899
21910
|
|
|
21900
21911
|
|
|
@@ -21916,10 +21927,6 @@ const WindowView = () => {
|
|
|
21916
21927
|
openChat
|
|
21917
21928
|
} = useVisibility();
|
|
21918
21929
|
const userHasResponded = useUserHasResponded();
|
|
21919
|
-
const {
|
|
21920
|
-
hasInterrupt,
|
|
21921
|
-
meta
|
|
21922
|
-
} = useInterrupt();
|
|
21923
21930
|
const {
|
|
21924
21931
|
t
|
|
21925
21932
|
} = useI18n();
|
|
@@ -21931,9 +21938,6 @@ const WindowView = () => {
|
|
|
21931
21938
|
}
|
|
21932
21939
|
}
|
|
21933
21940
|
}), [continueChatText]);
|
|
21934
|
-
if (hasInterrupt && !isOpen) {
|
|
21935
|
-
return (0,jsx_runtime_namespaceObject.jsx)(interrupt, window_view_objectSpread({}, meta));
|
|
21936
|
-
}
|
|
21937
21941
|
return (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
21938
21942
|
children: [(0,jsx_runtime_namespaceObject.jsx)(window_open_button, {
|
|
21939
21943
|
onClick: openChat
|
|
@@ -21958,7 +21962,6 @@ const WindowView = () => {
|
|
|
21958
21962
|
transitionStartState: transitionStartStates.notRendered,
|
|
21959
21963
|
children: (0,jsx_runtime_namespaceObject.jsx)(chat, {
|
|
21960
21964
|
children: (0,jsx_runtime_namespaceObject.jsx)(chat_frame, {
|
|
21961
|
-
interruptComponent: interrupt,
|
|
21962
21965
|
children: (0,jsx_runtime_namespaceObject.jsx)(conversation, {})
|
|
21963
21966
|
})
|
|
21964
21967
|
})
|
|
@@ -22382,6 +22385,7 @@ function initializeExternalApi(appConfig) {
|
|
|
22382
22385
|
|
|
22383
22386
|
|
|
22384
22387
|
|
|
22388
|
+
|
|
22385
22389
|
// Deprecated Toggle Button, should be removed once it is removed from clients
|
|
22386
22390
|
|
|
22387
22391
|
|
|
@@ -22402,13 +22406,11 @@ const DeprecatedToggleButton = ({
|
|
|
22402
22406
|
const focusIfContained = useFocusIfSeamlyContainedFocus();
|
|
22403
22407
|
const currentAgent = useSeamlyCurrentAgent();
|
|
22404
22408
|
const agentSubtitle = useSeamlyHeaderData().subTitle;
|
|
22405
|
-
const
|
|
22406
|
-
hasInterrupt
|
|
22407
|
-
} = useInterrupt();
|
|
22409
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
22408
22410
|
const {
|
|
22409
22411
|
headerCollapseButtonId
|
|
22410
22412
|
} = useSeamlyStateContext();
|
|
22411
|
-
const showAgentInfo = currentAgent && !
|
|
22413
|
+
const showAgentInfo = currentAgent && !hasError;
|
|
22412
22414
|
(0,hooks_.useLayoutEffect)(() => {
|
|
22413
22415
|
// Because we can close the app from the external API we
|
|
22414
22416
|
// need to determine if current keyboard focus resides inside
|
|
@@ -22468,6 +22470,7 @@ const DeprecatedToggleButton = ({
|
|
|
22468
22470
|
|
|
22469
22471
|
|
|
22470
22472
|
|
|
22473
|
+
|
|
22471
22474
|
const AgentInfo = () => {
|
|
22472
22475
|
const {
|
|
22473
22476
|
t
|
|
@@ -22481,12 +22484,10 @@ const AgentInfo = () => {
|
|
|
22481
22484
|
isOpen
|
|
22482
22485
|
} = useVisibility();
|
|
22483
22486
|
const currentAgent = useSeamlyCurrentAgent();
|
|
22484
|
-
const
|
|
22485
|
-
hasInterrupt
|
|
22486
|
-
} = useInterrupt();
|
|
22487
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
22487
22488
|
const startChatIcon = useStartChatIcon();
|
|
22488
22489
|
const src = currentAgent?.avatar ?? startChatIcon;
|
|
22489
|
-
const displaySubtitle =
|
|
22490
|
+
const displaySubtitle = hasError ? '' : subTitle;
|
|
22490
22491
|
const classNames = ['message-count'];
|
|
22491
22492
|
if (isOpen) {
|
|
22492
22493
|
classNames.push('message-count__hide');
|
|
@@ -22563,11 +22564,8 @@ const Header = ({
|
|
|
22563
22564
|
};
|
|
22564
22565
|
/* harmony default export */ const header = (Header);
|
|
22565
22566
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/deprecated-chat-frame.js
|
|
22566
|
-
|
|
22567
|
-
|
|
22568
|
-
function deprecated_chat_frame_defineProperty(obj, key, value) { key = deprecated_chat_frame_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22569
|
-
function deprecated_chat_frame_toPropertyKey(arg) { var key = deprecated_chat_frame_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
22570
|
-
function deprecated_chat_frame_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); }
|
|
22567
|
+
|
|
22568
|
+
|
|
22571
22569
|
|
|
22572
22570
|
|
|
22573
22571
|
|
|
@@ -22579,21 +22577,14 @@ function deprecated_chat_frame_toPrimitive(input, hint) { if (typeof input !== "
|
|
|
22579
22577
|
|
|
22580
22578
|
|
|
22581
22579
|
function deprecated_chat_frame_ChatFrame({
|
|
22582
|
-
children
|
|
22583
|
-
interruptComponent: InterruptComponent
|
|
22580
|
+
children
|
|
22584
22581
|
}) {
|
|
22585
|
-
const {
|
|
22586
|
-
hasInterrupt,
|
|
22587
|
-
meta
|
|
22588
|
-
} = useInterrupt();
|
|
22589
22582
|
const {
|
|
22590
22583
|
isOpen
|
|
22591
22584
|
} = useVisibility();
|
|
22592
|
-
|
|
22593
|
-
|
|
22594
|
-
|
|
22595
|
-
}
|
|
22596
|
-
return null;
|
|
22585
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
22586
|
+
if (hasError) {
|
|
22587
|
+
return (0,jsx_runtime_namespaceObject.jsx)(interrupt, {});
|
|
22597
22588
|
}
|
|
22598
22589
|
return (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
22599
22590
|
children: [(0,jsx_runtime_namespaceObject.jsxs)(chat_scroll_provider, {
|
|
@@ -22633,6 +22624,7 @@ function faq_objectWithoutPropertiesLoose(source, excluded) { if (source == null
|
|
|
22633
22624
|
|
|
22634
22625
|
|
|
22635
22626
|
|
|
22627
|
+
|
|
22636
22628
|
const Faq = () => {
|
|
22637
22629
|
const {
|
|
22638
22630
|
t
|
|
@@ -22646,9 +22638,7 @@ const Faq = () => {
|
|
|
22646
22638
|
const {
|
|
22647
22639
|
sendPolite
|
|
22648
22640
|
} = useLiveRegion();
|
|
22649
|
-
const
|
|
22650
|
-
hasInterrupt
|
|
22651
|
-
} = useInterrupt();
|
|
22641
|
+
const hasError = useSelector_useSelector(selectHasError);
|
|
22652
22642
|
const {
|
|
22653
22643
|
hasCountdown,
|
|
22654
22644
|
endCountdown
|
|
@@ -22664,7 +22654,7 @@ const Faq = () => {
|
|
|
22664
22654
|
payload: lastFaqEventPayload
|
|
22665
22655
|
});
|
|
22666
22656
|
const faqs = (0,hooks_.useMemo)(() => {
|
|
22667
|
-
const newFaqs = lastFaqEventPayload && !
|
|
22657
|
+
const newFaqs = lastFaqEventPayload && !hasError ? eventBody : [];
|
|
22668
22658
|
const itemBaseClass = `faqs__item`;
|
|
22669
22659
|
return newFaqs.map(_ref => {
|
|
22670
22660
|
let {
|
|
@@ -22676,7 +22666,7 @@ const Faq = () => {
|
|
|
22676
22666
|
classNames: [itemBaseClass, ...categories.map(cat => `faqs__item--${String(cat).toLowerCase().replace(/[^a-z0-9_\\-]/, '')}`)]
|
|
22677
22667
|
});
|
|
22678
22668
|
});
|
|
22679
|
-
}, [lastFaqEventPayload,
|
|
22669
|
+
}, [lastFaqEventPayload, hasError, eventBody]);
|
|
22680
22670
|
const prevFaqs = (0,hooks_.useRef)(null);
|
|
22681
22671
|
const prevHasFaqs = (0,hooks_.useRef)(false);
|
|
22682
22672
|
const {
|
|
@@ -22856,7 +22846,6 @@ const DeprecatedAppFrame = ({
|
|
|
22856
22846
|
|
|
22857
22847
|
|
|
22858
22848
|
|
|
22859
|
-
|
|
22860
22849
|
const ShowInlineView = ({
|
|
22861
22850
|
children
|
|
22862
22851
|
}) => {
|
|
@@ -22883,7 +22872,6 @@ const DeprecatedView = () => {
|
|
|
22883
22872
|
onCloseChat: closeChat,
|
|
22884
22873
|
children: (0,jsx_runtime_namespaceObject.jsx)(agent_info, {})
|
|
22885
22874
|
}), (0,jsx_runtime_namespaceObject.jsx)(deprecated_chat_frame, {
|
|
22886
|
-
interruptComponent: interrupt,
|
|
22887
22875
|
children: (0,jsx_runtime_namespaceObject.jsx)(conversation, {})
|
|
22888
22876
|
})]
|
|
22889
22877
|
})
|