impact-chatbot 2.3.55 → 2.3.57
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/dist/index.cjs.js +290 -131
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +290 -131
- package/dist/index.esm.js.map +1 -1
- package/dist/services/chatbot-services.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -7,7 +7,7 @@ var lodash = require('lodash');
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var api = require('config/api');
|
|
9
9
|
var axiosInstance = require('core/Utils/axios');
|
|
10
|
-
require('core/actions/tenantConfigActions');
|
|
10
|
+
var tenantConfigActions = require('core/actions/tenantConfigActions');
|
|
11
11
|
var userAccessActions = require('core/actions/userAccessActions');
|
|
12
12
|
var snackbarActions = require('core/actions/snackbarActions');
|
|
13
13
|
var moment = require('moment');
|
|
@@ -43,6 +43,7 @@ var RangePicker = require('core/commonComponents/dateRangePicker');
|
|
|
43
43
|
var NoFilterSetSavedIcon = require('core/coreAssets/chatbot/noFilterSetSaved.svg');
|
|
44
44
|
var CoreComponentScreen = require('core/commonComponents/coreComponentScreen');
|
|
45
45
|
var utils$1 = require('core/commonComponents/coreComponentScreen/utils');
|
|
46
|
+
var utils$2 = require('core/Utils/utils');
|
|
46
47
|
|
|
47
48
|
function _interopNamespaceDefault(e) {
|
|
48
49
|
var n = Object.create(null);
|
|
@@ -95,6 +96,26 @@ const fetchRelatedQuestions = (flowType, screen_name) => {
|
|
|
95
96
|
return null;
|
|
96
97
|
}
|
|
97
98
|
};
|
|
99
|
+
const getAgentVisibilityData = () => {
|
|
100
|
+
try {
|
|
101
|
+
return tenantConfigActions.tenantConfigApiCache(3, {
|
|
102
|
+
attribute_name: "show_agent_icon",
|
|
103
|
+
})();
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
console.error("getSmartBotVisibilityData error", error);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const getAgentExceptionUserList = (applicationCode) => {
|
|
110
|
+
try {
|
|
111
|
+
return tenantConfigActions.tenantConfigApiCache(applicationCode, {
|
|
112
|
+
attribute_name: "agent_exception_user_list",
|
|
113
|
+
})();
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
console.error("getAgentExceptionUserList error", error);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
98
119
|
const refreshAndUpdateUserManualApi = async (body) => {
|
|
99
120
|
try {
|
|
100
121
|
return axiosInstance({
|
|
@@ -13111,6 +13132,7 @@ const SmartBot = (props) => {
|
|
|
13111
13132
|
const [selectedFilterSet, setSelectedFilterSet] = React.useState(null);
|
|
13112
13133
|
const [answerMode, setAnswerMode] = React.useState("auto");
|
|
13113
13134
|
const [chatBotWidth, setChatBotWidth] = React.useState(null);
|
|
13135
|
+
const [tabList, setTabList] = React.useState([]);
|
|
13114
13136
|
React.useRef(0);
|
|
13115
13137
|
const { setUserFlow, setUserScreenAndFlow, fetchUserResultsFromQuery, getCurrentDateTimeString, setLink, } = useChatFlow(chatDataRef, setLoader, setFlowType, setScreenName, setUserInput, setQuestionIndex, setCurrentAppLink, flowType, screenName, questionIndex, userInput, dateFormat, currentMode, activeConversationId, setIsModuleChanged, chatBodyRef, filterReducerState, dispatch, navigate, setShowChatPlaceholder, baseUrl, setChatDataState, setCurrentSessionId, customChatConfig, chatDataInfoRef, chatbotContext, setInitValue, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, uniqueChatId, initValue, sessionId, fieldNumber, setFieldNumber, additionalArgs, setActiveConversationId, navSessionId, setNavSessionId);
|
|
13116
13138
|
const { parseSavedFlow, saveCurrentChanges, endCurrentSession, clearChatSession, initiateNewChat, hasUnsavedChanges, } = useChatSession(chatDataRef, setFlowType, setScreenName, setUserInput, setTemplateData, chatDataScreenLinkRef, setShowModal, setMinimizedMode, setSelectedModule, setChatDataState, currentMode, setUserFlow, getCurrentDateTimeString, setCurrentAppLink, selectedModule, fetchUserResultsFromQuery, props.closeBot, activeConversationId, setActiveConversationId, setShowChatPlaceholder);
|
|
@@ -13286,6 +13308,271 @@ const SmartBot = (props) => {
|
|
|
13286
13308
|
console.error("handleUploadAccess error", error);
|
|
13287
13309
|
}
|
|
13288
13310
|
};
|
|
13311
|
+
const handleAgentAccess = async () => {
|
|
13312
|
+
try {
|
|
13313
|
+
let applicationURL = window.location.pathname.split("/")?.[1];
|
|
13314
|
+
let applicationName = getFormattedApplicationName(applicationURL).toLowerCase();
|
|
13315
|
+
let accessDataResponse = await userAccessActions.getModuleLevelAccessUtility({
|
|
13316
|
+
app: applicationName,
|
|
13317
|
+
module: ["ChatbotAgent"],
|
|
13318
|
+
skipHierarchyCall: true,
|
|
13319
|
+
})();
|
|
13320
|
+
let showAgentIcon = await getAgentVisibilityData();
|
|
13321
|
+
if (!lodash.isEmpty(accessDataResponse) && showAgentIcon) {
|
|
13322
|
+
let appCode = utils$2.getApplicationCodeFromURL(applicationName);
|
|
13323
|
+
let list = await getAgentExceptionUserList(appCode);
|
|
13324
|
+
let isWhitelisted = false;
|
|
13325
|
+
if (list?.data?.data[0]?.attribute_value?.allow_all) {
|
|
13326
|
+
isWhitelisted = true;
|
|
13327
|
+
}
|
|
13328
|
+
else if (list?.data?.data[0]?.attribute_value?.allow_patterns) {
|
|
13329
|
+
const allowedPatterns = list?.data?.data[0]?.attribute_value?.allow_patterns;
|
|
13330
|
+
const currentUserEmail = localStorage.getItem("name");
|
|
13331
|
+
isWhitelisted = allowedPatterns.some((pattern) => currentUserEmail.includes(pattern));
|
|
13332
|
+
}
|
|
13333
|
+
else if (list?.data?.data[0]?.attribute_value?.allowed_mail_list) {
|
|
13334
|
+
const allowedMailList = list?.data?.data[0]?.attribute_value?.allowed_mail_list;
|
|
13335
|
+
const currentUserEmail = localStorage.getItem("name");
|
|
13336
|
+
isWhitelisted = allowedMailList.includes(currentUserEmail);
|
|
13337
|
+
}
|
|
13338
|
+
let tabListData = isWhitelisted
|
|
13339
|
+
? [
|
|
13340
|
+
{
|
|
13341
|
+
name: "Agent",
|
|
13342
|
+
// isActive: activeTab.current.activeTab === "agent",
|
|
13343
|
+
initialClick: true,
|
|
13344
|
+
onClick: (params) => {
|
|
13345
|
+
// if (localStorage.getItem("isStreaming") === "true") {
|
|
13346
|
+
// displaySnackMessages(
|
|
13347
|
+
// "Please wait till the current request is completed",
|
|
13348
|
+
// "warning"
|
|
13349
|
+
// );
|
|
13350
|
+
// return;
|
|
13351
|
+
// } else {
|
|
13352
|
+
setShowSavedFilters(false);
|
|
13353
|
+
const agentConversations = chatDataInfoRef?.current[params?.name?.toLowerCase()]?.conversations;
|
|
13354
|
+
const firstConversationId = agentConversations ? Object.keys(agentConversations)[0] : undefined;
|
|
13355
|
+
if (params?.name?.toLowerCase() === "agent") {
|
|
13356
|
+
if (!lodash.isEmpty(agentConversations?.[firstConversationId]?.messages)) {
|
|
13357
|
+
setShowChatPlaceholder(false);
|
|
13358
|
+
}
|
|
13359
|
+
else {
|
|
13360
|
+
setShowChatPlaceholder(true);
|
|
13361
|
+
}
|
|
13362
|
+
}
|
|
13363
|
+
setCurrentMode(params?.name?.toLowerCase());
|
|
13364
|
+
if (firstConversationId) {
|
|
13365
|
+
setActiveConversationId(firstConversationId);
|
|
13366
|
+
}
|
|
13367
|
+
localStorage.setItem("currentModeData", params?.name?.toLowerCase());
|
|
13368
|
+
setNewChatScreen(false);
|
|
13369
|
+
activeTab.current.activeTab = "agent";
|
|
13370
|
+
setIsStop(false);
|
|
13371
|
+
// }
|
|
13372
|
+
// setConversation([]);
|
|
13373
|
+
// chatDataInfoRef.current[currentMode] = [];
|
|
13374
|
+
},
|
|
13375
|
+
icon: jsxRuntime.jsx(SvgAgentIcon, {}),
|
|
13376
|
+
},
|
|
13377
|
+
{
|
|
13378
|
+
name: "Navigation",
|
|
13379
|
+
// isActive: activeTab.current.activeTab === "navigation",
|
|
13380
|
+
// initialClick: true,
|
|
13381
|
+
onClick: (params) => {
|
|
13382
|
+
// if (localStorage.getItem("isStreaming") === "true") {
|
|
13383
|
+
// displaySnackMessages(
|
|
13384
|
+
// "Please wait till the current request is completed",
|
|
13385
|
+
// "warning"
|
|
13386
|
+
// );
|
|
13387
|
+
// return;
|
|
13388
|
+
// } else {
|
|
13389
|
+
setShowSavedFilters(false);
|
|
13390
|
+
let currentModeValue = params?.name?.toLowerCase();
|
|
13391
|
+
const modeConversations = chatDataInfoRef?.current[currentModeValue]?.conversations;
|
|
13392
|
+
const firstConversationId = modeConversations ? Object.keys(modeConversations)[0] : undefined;
|
|
13393
|
+
if (!lodash.isEmpty(modeConversations?.[firstConversationId]?.messages)) {
|
|
13394
|
+
setNewChatScreen(false);
|
|
13395
|
+
}
|
|
13396
|
+
else {
|
|
13397
|
+
setNewChatScreen(true);
|
|
13398
|
+
}
|
|
13399
|
+
localStorage.setItem("currentModeData", params?.name?.toLowerCase());
|
|
13400
|
+
setShowChatPlaceholder(false);
|
|
13401
|
+
// setConversation({});
|
|
13402
|
+
setLoader(false);
|
|
13403
|
+
activeTab.current.activeTab = "navigation";
|
|
13404
|
+
setHideMenu(false);
|
|
13405
|
+
let chatDataForReference = localStorage.getItem("chatDataForReference");
|
|
13406
|
+
let currentModeData = localStorage.getItem("currentModeData");
|
|
13407
|
+
if (chatDataForReference && currentModeData === "navigation") {
|
|
13408
|
+
let parsedData = JSON.parse(chatDataForReference);
|
|
13409
|
+
chatDataInfoRef.current = lodash.cloneDeep(parsedData);
|
|
13410
|
+
}
|
|
13411
|
+
// setNewChatScreen(true);
|
|
13412
|
+
setIsStop(false);
|
|
13413
|
+
setCurrentMode(params?.name?.toLowerCase());
|
|
13414
|
+
if (firstConversationId) {
|
|
13415
|
+
setActiveConversationId(firstConversationId);
|
|
13416
|
+
}
|
|
13417
|
+
// setConversation([]);
|
|
13418
|
+
// chatDataInfoRef.current[currentMode] = [];
|
|
13419
|
+
// }
|
|
13420
|
+
},
|
|
13421
|
+
icon: jsxRuntime.jsx(SvgNavigationIcon, {}),
|
|
13422
|
+
},
|
|
13423
|
+
{
|
|
13424
|
+
name: "Saved Filters",
|
|
13425
|
+
// isActive: activeTab.current.activeTab === "agent",
|
|
13426
|
+
// initialClick: true,
|
|
13427
|
+
onClick: (params) => {
|
|
13428
|
+
// if (localStorage.getItem("isStreaming") === "true") {
|
|
13429
|
+
// displaySnackMessages(
|
|
13430
|
+
// "Please wait till the current request is completed",
|
|
13431
|
+
// "warning"
|
|
13432
|
+
// );
|
|
13433
|
+
// return;
|
|
13434
|
+
// } else {
|
|
13435
|
+
// const agentConversations = chatDataInfoRef?.current[params?.name?.toLowerCase()]?.conversations;
|
|
13436
|
+
// const firstConversationId = agentConversations ? Object.keys(agentConversations)[0] : undefined;
|
|
13437
|
+
if (params?.name?.toLowerCase() === "saved filters") {
|
|
13438
|
+
setNewChatScreen(false);
|
|
13439
|
+
setShowChatPlaceholder(false);
|
|
13440
|
+
setShowSavedFilters(true);
|
|
13441
|
+
// if (
|
|
13442
|
+
// !isEmpty(
|
|
13443
|
+
// agentConversations?.[firstConversationId]?.messages
|
|
13444
|
+
// )
|
|
13445
|
+
// ) {
|
|
13446
|
+
// setShowChatPlaceholder(false);
|
|
13447
|
+
// } else {
|
|
13448
|
+
// setShowChatPlaceholder(true);
|
|
13449
|
+
// }
|
|
13450
|
+
}
|
|
13451
|
+
// setCurrentMode(params?.name?.toLowerCase());
|
|
13452
|
+
// if (firstConversationId) {
|
|
13453
|
+
// setActiveConversationId(firstConversationId);
|
|
13454
|
+
// }
|
|
13455
|
+
// localStorage.setItem(
|
|
13456
|
+
// "currentModeData",
|
|
13457
|
+
// params?.name?.toLowerCase()
|
|
13458
|
+
// );
|
|
13459
|
+
// setNewChatScreen(false);
|
|
13460
|
+
// activeTab.current.activeTab = "agent";
|
|
13461
|
+
// setIsStop(false);
|
|
13462
|
+
// }
|
|
13463
|
+
// setConversation([]);
|
|
13464
|
+
// chatDataInfoRef.current[currentMode] = [];
|
|
13465
|
+
},
|
|
13466
|
+
icon: jsxRuntime.jsx(SvgSaveFilterTab, {}),
|
|
13467
|
+
},
|
|
13468
|
+
] : [
|
|
13469
|
+
{
|
|
13470
|
+
name: "Navigation",
|
|
13471
|
+
// isActive: activeTab.current.activeTab === "navigation",
|
|
13472
|
+
initialClick: true,
|
|
13473
|
+
onClick: (params) => {
|
|
13474
|
+
// if (localStorage.getItem("isStreaming") === "true") {
|
|
13475
|
+
// displaySnackMessages(
|
|
13476
|
+
// "Please wait till the current request is completed",
|
|
13477
|
+
// "warning"
|
|
13478
|
+
// );
|
|
13479
|
+
// return;
|
|
13480
|
+
// } else {
|
|
13481
|
+
setShowSavedFilters(false);
|
|
13482
|
+
let currentModeValue = params?.name?.toLowerCase();
|
|
13483
|
+
const modeConversations = chatDataInfoRef?.current[currentModeValue]?.conversations;
|
|
13484
|
+
const firstConversationId = modeConversations ? Object.keys(modeConversations)[0] : undefined;
|
|
13485
|
+
if (!lodash.isEmpty(modeConversations?.[firstConversationId]?.messages)) {
|
|
13486
|
+
setNewChatScreen(false);
|
|
13487
|
+
}
|
|
13488
|
+
else {
|
|
13489
|
+
setNewChatScreen(true);
|
|
13490
|
+
}
|
|
13491
|
+
localStorage.setItem("currentModeData", params?.name?.toLowerCase());
|
|
13492
|
+
setShowChatPlaceholder(false);
|
|
13493
|
+
// setConversation({});
|
|
13494
|
+
setLoader(false);
|
|
13495
|
+
activeTab.current.activeTab = "navigation";
|
|
13496
|
+
setHideMenu(false);
|
|
13497
|
+
let chatDataForReference = localStorage.getItem("chatDataForReference");
|
|
13498
|
+
let currentModeData = localStorage.getItem("currentModeData");
|
|
13499
|
+
if (chatDataForReference && currentModeData === "navigation") {
|
|
13500
|
+
let parsedData = JSON.parse(chatDataForReference);
|
|
13501
|
+
chatDataInfoRef.current = lodash.cloneDeep(parsedData);
|
|
13502
|
+
}
|
|
13503
|
+
// setNewChatScreen(true);
|
|
13504
|
+
setIsStop(false);
|
|
13505
|
+
setCurrentMode(params?.name?.toLowerCase());
|
|
13506
|
+
if (firstConversationId) {
|
|
13507
|
+
setActiveConversationId(firstConversationId);
|
|
13508
|
+
}
|
|
13509
|
+
// setConversation([]);
|
|
13510
|
+
// chatDataInfoRef.current[currentMode] = [];
|
|
13511
|
+
// }
|
|
13512
|
+
},
|
|
13513
|
+
icon: jsxRuntime.jsx(SvgNavigationIcon, {}),
|
|
13514
|
+
}
|
|
13515
|
+
];
|
|
13516
|
+
setTabList(tabListData);
|
|
13517
|
+
}
|
|
13518
|
+
else {
|
|
13519
|
+
setCurrentMode("navigation");
|
|
13520
|
+
setNewChatScreen(true);
|
|
13521
|
+
setShowChatPlaceholder(false);
|
|
13522
|
+
setTabList([
|
|
13523
|
+
{
|
|
13524
|
+
name: "Navigation",
|
|
13525
|
+
// isActive: activeTab.current.activeTab === "navigation",
|
|
13526
|
+
initialClick: true,
|
|
13527
|
+
onClick: (params) => {
|
|
13528
|
+
// if (localStorage.getItem("isStreaming") === "true") {
|
|
13529
|
+
// displaySnackMessages(
|
|
13530
|
+
// "Please wait till the current request is completed",
|
|
13531
|
+
// "warning"
|
|
13532
|
+
// );
|
|
13533
|
+
// return;
|
|
13534
|
+
// } else {
|
|
13535
|
+
setShowSavedFilters(false);
|
|
13536
|
+
let currentModeValue = params?.name?.toLowerCase();
|
|
13537
|
+
const modeConversations = chatDataInfoRef?.current[currentModeValue]?.conversations;
|
|
13538
|
+
const firstConversationId = modeConversations ? Object.keys(modeConversations)[0] : undefined;
|
|
13539
|
+
if (!lodash.isEmpty(modeConversations?.[firstConversationId]?.messages)) {
|
|
13540
|
+
setNewChatScreen(false);
|
|
13541
|
+
}
|
|
13542
|
+
else {
|
|
13543
|
+
setNewChatScreen(true);
|
|
13544
|
+
}
|
|
13545
|
+
localStorage.setItem("currentModeData", params?.name?.toLowerCase());
|
|
13546
|
+
setShowChatPlaceholder(false);
|
|
13547
|
+
// setConversation({});
|
|
13548
|
+
setLoader(false);
|
|
13549
|
+
activeTab.current.activeTab = "navigation";
|
|
13550
|
+
setHideMenu(false);
|
|
13551
|
+
let chatDataForReference = localStorage.getItem("chatDataForReference");
|
|
13552
|
+
let currentModeData = localStorage.getItem("currentModeData");
|
|
13553
|
+
if (chatDataForReference && currentModeData === "navigation") {
|
|
13554
|
+
let parsedData = JSON.parse(chatDataForReference);
|
|
13555
|
+
chatDataInfoRef.current = lodash.cloneDeep(parsedData);
|
|
13556
|
+
}
|
|
13557
|
+
// setNewChatScreen(true);
|
|
13558
|
+
setIsStop(false);
|
|
13559
|
+
setCurrentMode(params?.name?.toLowerCase());
|
|
13560
|
+
if (firstConversationId) {
|
|
13561
|
+
setActiveConversationId(firstConversationId);
|
|
13562
|
+
}
|
|
13563
|
+
// setConversation([]);
|
|
13564
|
+
// chatDataInfoRef.current[currentMode] = [];
|
|
13565
|
+
// }
|
|
13566
|
+
},
|
|
13567
|
+
icon: jsxRuntime.jsx(SvgNavigationIcon, {}),
|
|
13568
|
+
}
|
|
13569
|
+
]);
|
|
13570
|
+
}
|
|
13571
|
+
}
|
|
13572
|
+
catch (error) {
|
|
13573
|
+
console.error("handleAgentAccess error", error);
|
|
13574
|
+
}
|
|
13575
|
+
};
|
|
13289
13576
|
const fetchSavedFilterSets = async () => {
|
|
13290
13577
|
try {
|
|
13291
13578
|
const savedFilters = await filterAction.getFilterUserConfiguration("Chatbot");
|
|
@@ -13318,6 +13605,7 @@ const SmartBot = (props) => {
|
|
|
13318
13605
|
}, 5000, { trailing: false }), [loadingState, templateData, displaySnackMessages, activeConversationId, sessionId, baseUrl]);
|
|
13319
13606
|
React.useEffect(() => {
|
|
13320
13607
|
handleUploadAccess();
|
|
13608
|
+
handleAgentAccess();
|
|
13321
13609
|
}, []);
|
|
13322
13610
|
React.useEffect(() => {
|
|
13323
13611
|
configureBotActions();
|
|
@@ -13882,136 +14170,7 @@ const SmartBot = (props) => {
|
|
|
13882
14170
|
onSendIconClick: onSendIconClick, conversation: conversation, onModuleClick: (id, name, param) => {
|
|
13883
14171
|
// activeTab.current.activeTab = name.toLowerCase();
|
|
13884
14172
|
handleModuleSelect(name);
|
|
13885
|
-
}, moduleList: modules, tabList:
|
|
13886
|
-
{
|
|
13887
|
-
name: "Agent",
|
|
13888
|
-
// isActive: activeTab.current.activeTab === "agent",
|
|
13889
|
-
initialClick: true,
|
|
13890
|
-
onClick: (params) => {
|
|
13891
|
-
// if (localStorage.getItem("isStreaming") === "true") {
|
|
13892
|
-
// displaySnackMessages(
|
|
13893
|
-
// "Please wait till the current request is completed",
|
|
13894
|
-
// "warning"
|
|
13895
|
-
// );
|
|
13896
|
-
// return;
|
|
13897
|
-
// } else {
|
|
13898
|
-
setShowSavedFilters(false);
|
|
13899
|
-
const agentConversations = chatDataInfoRef?.current[params?.name?.toLowerCase()]?.conversations;
|
|
13900
|
-
const firstConversationId = agentConversations ? Object.keys(agentConversations)[0] : undefined;
|
|
13901
|
-
if (params?.name?.toLowerCase() === "agent") {
|
|
13902
|
-
if (!lodash.isEmpty(agentConversations?.[firstConversationId]?.messages)) {
|
|
13903
|
-
setShowChatPlaceholder(false);
|
|
13904
|
-
}
|
|
13905
|
-
else {
|
|
13906
|
-
setShowChatPlaceholder(true);
|
|
13907
|
-
}
|
|
13908
|
-
}
|
|
13909
|
-
setCurrentMode(params?.name?.toLowerCase());
|
|
13910
|
-
if (firstConversationId) {
|
|
13911
|
-
setActiveConversationId(firstConversationId);
|
|
13912
|
-
}
|
|
13913
|
-
localStorage.setItem("currentModeData", params?.name?.toLowerCase());
|
|
13914
|
-
setNewChatScreen(false);
|
|
13915
|
-
activeTab.current.activeTab = "agent";
|
|
13916
|
-
setIsStop(false);
|
|
13917
|
-
// }
|
|
13918
|
-
// setConversation([]);
|
|
13919
|
-
// chatDataInfoRef.current[currentMode] = [];
|
|
13920
|
-
},
|
|
13921
|
-
icon: jsxRuntime.jsx(SvgAgentIcon, {}),
|
|
13922
|
-
},
|
|
13923
|
-
{
|
|
13924
|
-
name: "Navigation",
|
|
13925
|
-
// isActive: activeTab.current.activeTab === "navigation",
|
|
13926
|
-
// initialClick: true,
|
|
13927
|
-
onClick: (params) => {
|
|
13928
|
-
// if (localStorage.getItem("isStreaming") === "true") {
|
|
13929
|
-
// displaySnackMessages(
|
|
13930
|
-
// "Please wait till the current request is completed",
|
|
13931
|
-
// "warning"
|
|
13932
|
-
// );
|
|
13933
|
-
// return;
|
|
13934
|
-
// } else {
|
|
13935
|
-
setShowSavedFilters(false);
|
|
13936
|
-
let currentModeValue = params?.name?.toLowerCase();
|
|
13937
|
-
const modeConversations = chatDataInfoRef?.current[currentModeValue]?.conversations;
|
|
13938
|
-
const firstConversationId = modeConversations ? Object.keys(modeConversations)[0] : undefined;
|
|
13939
|
-
if (!lodash.isEmpty(modeConversations?.[firstConversationId]?.messages)) {
|
|
13940
|
-
setNewChatScreen(false);
|
|
13941
|
-
}
|
|
13942
|
-
else {
|
|
13943
|
-
setNewChatScreen(true);
|
|
13944
|
-
}
|
|
13945
|
-
localStorage.setItem("currentModeData", params?.name?.toLowerCase());
|
|
13946
|
-
setShowChatPlaceholder(false);
|
|
13947
|
-
// setConversation({});
|
|
13948
|
-
setLoader(false);
|
|
13949
|
-
activeTab.current.activeTab = "navigation";
|
|
13950
|
-
setHideMenu(false);
|
|
13951
|
-
let chatDataForReference = localStorage.getItem("chatDataForReference");
|
|
13952
|
-
let currentModeData = localStorage.getItem("currentModeData");
|
|
13953
|
-
if (chatDataForReference && currentModeData === "navigation") {
|
|
13954
|
-
let parsedData = JSON.parse(chatDataForReference);
|
|
13955
|
-
chatDataInfoRef.current = lodash.cloneDeep(parsedData);
|
|
13956
|
-
}
|
|
13957
|
-
// setNewChatScreen(true);
|
|
13958
|
-
setIsStop(false);
|
|
13959
|
-
setCurrentMode(params?.name?.toLowerCase());
|
|
13960
|
-
if (firstConversationId) {
|
|
13961
|
-
setActiveConversationId(firstConversationId);
|
|
13962
|
-
}
|
|
13963
|
-
// setConversation([]);
|
|
13964
|
-
// chatDataInfoRef.current[currentMode] = [];
|
|
13965
|
-
// }
|
|
13966
|
-
},
|
|
13967
|
-
icon: jsxRuntime.jsx(SvgNavigationIcon, {}),
|
|
13968
|
-
},
|
|
13969
|
-
{
|
|
13970
|
-
name: "Saved Filters",
|
|
13971
|
-
// isActive: activeTab.current.activeTab === "agent",
|
|
13972
|
-
// initialClick: true,
|
|
13973
|
-
onClick: (params) => {
|
|
13974
|
-
// if (localStorage.getItem("isStreaming") === "true") {
|
|
13975
|
-
// displaySnackMessages(
|
|
13976
|
-
// "Please wait till the current request is completed",
|
|
13977
|
-
// "warning"
|
|
13978
|
-
// );
|
|
13979
|
-
// return;
|
|
13980
|
-
// } else {
|
|
13981
|
-
// const agentConversations = chatDataInfoRef?.current[params?.name?.toLowerCase()]?.conversations;
|
|
13982
|
-
// const firstConversationId = agentConversations ? Object.keys(agentConversations)[0] : undefined;
|
|
13983
|
-
if (params?.name?.toLowerCase() === "saved filters") {
|
|
13984
|
-
setNewChatScreen(false);
|
|
13985
|
-
setShowChatPlaceholder(false);
|
|
13986
|
-
setShowSavedFilters(true);
|
|
13987
|
-
// if (
|
|
13988
|
-
// !isEmpty(
|
|
13989
|
-
// agentConversations?.[firstConversationId]?.messages
|
|
13990
|
-
// )
|
|
13991
|
-
// ) {
|
|
13992
|
-
// setShowChatPlaceholder(false);
|
|
13993
|
-
// } else {
|
|
13994
|
-
// setShowChatPlaceholder(true);
|
|
13995
|
-
// }
|
|
13996
|
-
}
|
|
13997
|
-
// setCurrentMode(params?.name?.toLowerCase());
|
|
13998
|
-
// if (firstConversationId) {
|
|
13999
|
-
// setActiveConversationId(firstConversationId);
|
|
14000
|
-
// }
|
|
14001
|
-
// localStorage.setItem(
|
|
14002
|
-
// "currentModeData",
|
|
14003
|
-
// params?.name?.toLowerCase()
|
|
14004
|
-
// );
|
|
14005
|
-
// setNewChatScreen(false);
|
|
14006
|
-
// activeTab.current.activeTab = "agent";
|
|
14007
|
-
// setIsStop(false);
|
|
14008
|
-
// }
|
|
14009
|
-
// setConversation([]);
|
|
14010
|
-
// chatDataInfoRef.current[currentMode] = [];
|
|
14011
|
-
},
|
|
14012
|
-
icon: jsxRuntime.jsx(SvgSaveFilterTab, {}),
|
|
14013
|
-
},
|
|
14014
|
-
], utilityList: utilityList, isAssistantThinking: false, isCustomScreen: showChatPlaceholder ? showChatPlaceholder : showSavedFilters, customScreenJsx: showChatPlaceholder ?
|
|
14173
|
+
}, moduleList: modules, tabList: tabList, utilityList: utilityList, isAssistantThinking: false, isCustomScreen: showChatPlaceholder ? showChatPlaceholder : showSavedFilters, customScreenJsx: showChatPlaceholder ?
|
|
14015
14174
|
jsxRuntime.jsx(ChatPlaceholder, { dateFormat: dateFormat, chatDataRef: chatDataRef, currentMode: currentMode, setShowChatPlaceholder: setShowChatPlaceholder, setLoader: setLoader, setCurrentAgentId: setCurrentAgentId, baseUrl: baseUrl, setBaseUrl: setBaseUrl, setCurrentSessionId: setCurrentSessionId, customChatConfig: customChatConfig, chatDataInfoRef: chatDataInfoRef, setChatDataState: setChatDataState, userInput: userInput, legacyAgentScreen: legacyAgentScreen, activeConversationId: activeConversationId, chatBodyRef: chatBodyRef, chatbotContext: chatbotContext, setInitValue: setInitValue, setSessionId: setSessionId, thinkingContent: thinkingContext?.thinkingContent, setThinkingContent: setThinkingContent, isThinking: isThinking, setIsThinking: setIsThinking, chatId: chatId, setChatId: setChatId, isStop: isStop, setIsStop: setIsStop, functionsRef: functionsRef, functionsState: functionsState, setFunctionsState: setFunctionsState, thinkingHeaderMessage: thinkingContext?.thinkingHeaderMessage, setThinkingHeaderMessage: setThinkingHeaderMessage, uniqueChatId: uniqueChatId, setUniqueChatId: setUniqueChatId, fieldNumber: fieldNumber, setFieldNumber: setFieldNumber, setAdditionalArgs: setAdditionalArgs, displayQuestions: displayQuestions, questions: questions, setActiveConversationId: setActiveConversationId, selectedFilterSet: selectedFilterSet, answerMode: answerMode })
|
|
14016
14175
|
:
|
|
14017
14176
|
jsxRuntime.jsx(ChatbotSaveFilterComponent$1, { savedFilterSets: savedFilterSets, partialClose: partialClose, chatBotWidth: chatBotWidth }), inputText: userInput, threadList: ["Home"], hideMenuArrow: hideMenu, newChatScreen: newChatScreen, isModuleListLoading: modulesLoading, suggestionBanner: {
|