impact-chatbot 2.3.11 → 2.3.14
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/core/styles/colours.d.ts +2 -0
- package/dist/hooks/useChatFlow.d.ts +1 -1
- package/dist/hooks/useChatState.d.ts +2 -0
- package/dist/index.cjs.js +69 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +69 -14
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const useChatFlow: (chatDataRef: any, setLoader: any, setFlowType: any, setScreenName: any, setUserInput: any, setQuestionIndex: any, setCurrentAppLink: any, flowType: any, screenName: any, questionIndex: any, userInput: any, dateFormat: any, currentMode: any, activeConversationId: any, setIsModuleChanged: any, chatBodyRef: any, filterReducerState: any, dispatch: any, navigate: any, setShowChatPlaceholder: any, baseUrl: any, setChatDataState: any, setCurrentSessionId: any, customChatConfig: any, chatDataInfoRef: any, chatbotContext: any, setInitValue: any, setSessionId: any, thinkingContent: any, setThinkingContent: any, isThinking: any, setIsThinking: any, chatId: any, setChatId: any, isStop: any, setIsStop: any, functionsRef: any, functionsState: any, setFunctionsState: any, thinkingHeaderMessage: any, setThinkingHeaderMessage: any, uniqueChatId: any, initValue: any, sessionId: any, fieldNumber: any, setFieldNumber: any) => {
|
|
1
|
+
export declare const useChatFlow: (chatDataRef: any, setLoader: any, setFlowType: any, setScreenName: any, setUserInput: any, setQuestionIndex: any, setCurrentAppLink: any, flowType: any, screenName: any, questionIndex: any, userInput: any, dateFormat: any, currentMode: any, activeConversationId: any, setIsModuleChanged: any, chatBodyRef: any, filterReducerState: any, dispatch: any, navigate: any, setShowChatPlaceholder: any, baseUrl: any, setChatDataState: any, setCurrentSessionId: any, customChatConfig: any, chatDataInfoRef: any, chatbotContext: any, setInitValue: any, setSessionId: any, thinkingContent: any, setThinkingContent: any, isThinking: any, setIsThinking: any, chatId: any, setChatId: any, isStop: any, setIsStop: any, functionsRef: any, functionsState: any, setFunctionsState: any, thinkingHeaderMessage: any, setThinkingHeaderMessage: any, uniqueChatId: any, initValue: any, sessionId: any, fieldNumber: any, setFieldNumber: any, additionalArgs: any) => {
|
|
2
2
|
setUserFlow: (data: any) => Promise<void>;
|
|
3
3
|
setUserScreenAndFlow: (data: any) => void;
|
|
4
4
|
fetchUserResultsFromQuery: (refObject: any, fetchQuestions?: boolean, inputValue?: any) => Promise<void>;
|
|
@@ -92,6 +92,8 @@ export declare const useChatState: () => {
|
|
|
92
92
|
setIsUploadModalOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
93
93
|
isRefreshTriggered: boolean;
|
|
94
94
|
setIsRefreshTriggered: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
95
|
+
additionalArgs: {};
|
|
96
|
+
setAdditionalArgs: import("react").Dispatch<import("react").SetStateAction<{}>>;
|
|
95
97
|
grabPositionRef: import("react").MutableRefObject<any>;
|
|
96
98
|
chatDataRef: import("react").MutableRefObject<{
|
|
97
99
|
insights: {
|
package/dist/index.cjs.js
CHANGED
|
@@ -1230,6 +1230,7 @@ const useAgentFlow = (dateFormat, chatDataRef, currentMode, setShowChatPlacehold
|
|
|
1230
1230
|
setUniqueChatId: utilityObjectData?.setUniqueChatId,
|
|
1231
1231
|
fieldNumber: utilityObjectData?.fieldNumber,
|
|
1232
1232
|
setFieldNumber: utilityObjectData?.setFieldNumber,
|
|
1233
|
+
setAdditionalArgs: utilityObjectData?.setAdditionalArgs,
|
|
1233
1234
|
baseUrl: baseUrlTemp,
|
|
1234
1235
|
};
|
|
1235
1236
|
response = await parseResponse(null, "stream", "", currentModeValue, false, "", {}, payload, utilityObject);
|
|
@@ -1757,6 +1758,7 @@ const useAgentFlow = (dateFormat, chatDataRef, currentMode, setShowChatPlacehold
|
|
|
1757
1758
|
chat_input: data?.chatInput,
|
|
1758
1759
|
delay: 0.3,
|
|
1759
1760
|
chat_id: utilityObjectData?.uniqueChatId ? utilityObjectData?.uniqueChatId : utilityObjectData?.currentAgentChatId,
|
|
1761
|
+
...(!isEmpty(utilityObjectData?.additionalArgs) ? utilityObjectData.additionalArgs : {}),
|
|
1760
1762
|
};
|
|
1761
1763
|
// Handle @ filter mentions - user_explicit_input contains filter values
|
|
1762
1764
|
if (!isEmpty(data?.userExplicitInput)) {
|
|
@@ -1922,7 +1924,7 @@ const useAgentFlow = (dateFormat, chatDataRef, currentMode, setShowChatPlacehold
|
|
|
1922
1924
|
};
|
|
1923
1925
|
};
|
|
1924
1926
|
|
|
1925
|
-
const 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) => {
|
|
1927
|
+
const 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) => {
|
|
1926
1928
|
const { prepareDataAndSendToAgent, setAgentFlow, processResponse, } = useAgentFlow(dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, baseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, {
|
|
1927
1929
|
setChatDataState,
|
|
1928
1930
|
activeConversationId,
|
|
@@ -1947,6 +1949,7 @@ const useChatFlow = (chatDataRef, setLoader, setFlowType, setScreenName, setUser
|
|
|
1947
1949
|
uniqueChatId,
|
|
1948
1950
|
fieldNumber,
|
|
1949
1951
|
setFieldNumber,
|
|
1952
|
+
setAdditionalArgs: () => { },
|
|
1950
1953
|
});
|
|
1951
1954
|
const getCurrentDateTimeString = () => {
|
|
1952
1955
|
return moment().format(dateFormat);
|
|
@@ -2110,6 +2113,7 @@ const useChatFlow = (chatDataRef, setLoader, setFlowType, setScreenName, setUser
|
|
|
2110
2113
|
setSessionId: setSessionId,
|
|
2111
2114
|
setInitValue: setInitValue,
|
|
2112
2115
|
uniqueChatId: uniqueChatId,
|
|
2116
|
+
additionalArgs: additionalArgs,
|
|
2113
2117
|
});
|
|
2114
2118
|
}
|
|
2115
2119
|
else if (data.actionType === "indirect") {
|
|
@@ -2811,6 +2815,8 @@ const colours = {
|
|
|
2811
2815
|
oceanGreen: "#3BB273",
|
|
2812
2816
|
linen: "#FCEEEE",
|
|
2813
2817
|
greyishBlue: "#F2F4FA",
|
|
2818
|
+
denim: "#1A56DB",
|
|
2819
|
+
pattensBlue: "#DBEAFE"
|
|
2814
2820
|
};
|
|
2815
2821
|
|
|
2816
2822
|
const rem = (px) => `${px / 16}rem`;
|
|
@@ -3884,6 +3890,7 @@ const useChatState = () => {
|
|
|
3884
3890
|
const [isModalOpen, setIsModalOpen] = React.useState(false);
|
|
3885
3891
|
const [isUploadModalOpen, setIsUploadModalOpen] = React.useState(false);
|
|
3886
3892
|
const [isRefreshTriggered, setIsRefreshTriggered] = React.useState(false);
|
|
3893
|
+
const [additionalArgs, setAdditionalArgs] = React.useState({});
|
|
3887
3894
|
// Selectors
|
|
3888
3895
|
const filterReducerState = reactRedux.useSelector((state) => state.filterReducer);
|
|
3889
3896
|
const notificationData = reactRedux.useSelector((state) => state.notificationReducer.notificationData);
|
|
@@ -4028,6 +4035,8 @@ const useChatState = () => {
|
|
|
4028
4035
|
setIsUploadModalOpen,
|
|
4029
4036
|
isRefreshTriggered,
|
|
4030
4037
|
setIsRefreshTriggered,
|
|
4038
|
+
additionalArgs,
|
|
4039
|
+
setAdditionalArgs,
|
|
4031
4040
|
// Refs
|
|
4032
4041
|
grabPositionRef,
|
|
4033
4042
|
chatDataRef,
|
|
@@ -4315,21 +4324,37 @@ const useStyles$5 = styles.makeStyles((theme) => ({
|
|
|
4315
4324
|
height: "100%",
|
|
4316
4325
|
}
|
|
4317
4326
|
},
|
|
4327
|
+
headingContainer: {
|
|
4328
|
+
display: "flex",
|
|
4329
|
+
alignItems: "center",
|
|
4330
|
+
justifyContent: "center",
|
|
4331
|
+
gap: pxToRem(8),
|
|
4332
|
+
marginBottom: pxToRem(5),
|
|
4333
|
+
},
|
|
4318
4334
|
heading: {
|
|
4319
4335
|
fontFamily: "Manrope, sans-serif",
|
|
4320
4336
|
fontSize: pxToRem(20),
|
|
4321
4337
|
fontWeight: 800,
|
|
4322
4338
|
lineHeight: pxToRem(30),
|
|
4323
|
-
color:
|
|
4324
|
-
marginBottom: pxToRem(5),
|
|
4339
|
+
color: colours.boldHeadingBlue,
|
|
4325
4340
|
textAlign: "center",
|
|
4326
4341
|
},
|
|
4342
|
+
alphaTag: {
|
|
4343
|
+
fontFamily: "Manrope, sans-serif",
|
|
4344
|
+
fontSize: pxToRem(11),
|
|
4345
|
+
fontWeight: 700,
|
|
4346
|
+
color: colours.denim,
|
|
4347
|
+
backgroundColor: colours.pattensBlue,
|
|
4348
|
+
borderRadius: pxToRem(4),
|
|
4349
|
+
padding: `${pxToRem(2)} ${pxToRem(8)}`,
|
|
4350
|
+
lineHeight: pxToRem(16),
|
|
4351
|
+
},
|
|
4327
4352
|
headingHelperText: {
|
|
4328
4353
|
fontFamily: "Manrope, sans-serif",
|
|
4329
4354
|
fontSize: pxToRem(14),
|
|
4330
4355
|
fontWeight: 400,
|
|
4331
4356
|
lineHeight: pxToRem(16),
|
|
4332
|
-
color:
|
|
4357
|
+
color: colours.boldHeadingBlue,
|
|
4333
4358
|
marginBottom: pxToRem(44),
|
|
4334
4359
|
// maxWidth: pxToRem(420),
|
|
4335
4360
|
textAlign: "center",
|
|
@@ -4356,7 +4381,7 @@ const useStyles$5 = styles.makeStyles((theme) => ({
|
|
|
4356
4381
|
const useRectangleStyles = styles.makeStyles((theme) => ({
|
|
4357
4382
|
rectangle: {
|
|
4358
4383
|
width: "100%",
|
|
4359
|
-
height:
|
|
4384
|
+
height: "4rem",
|
|
4360
4385
|
borderRadius: pxToRem(12),
|
|
4361
4386
|
padding: pxToRem(16),
|
|
4362
4387
|
display: "flex",
|
|
@@ -4433,11 +4458,16 @@ const useRectangleStyles = styles.makeStyles((theme) => ({
|
|
|
4433
4458
|
},
|
|
4434
4459
|
title: {
|
|
4435
4460
|
fontFamily: "Manrope, sans-serif",
|
|
4436
|
-
fontSize: pxToRem(
|
|
4437
|
-
fontWeight:
|
|
4461
|
+
fontSize: pxToRem(14),
|
|
4462
|
+
fontWeight: 600,
|
|
4438
4463
|
lineHeight: pxToRem(21),
|
|
4439
4464
|
color: "#1F2B4D",
|
|
4440
4465
|
marginBottom: pxToRem(2),
|
|
4466
|
+
overflow: "hidden",
|
|
4467
|
+
textOverflow: "ellipsis",
|
|
4468
|
+
display: "-webkit-box",
|
|
4469
|
+
WebkitLineClamp: 2,
|
|
4470
|
+
WebkitBoxOrient: "vertical",
|
|
4441
4471
|
},
|
|
4442
4472
|
description: {
|
|
4443
4473
|
fontFamily: "Manrope, sans-serif",
|
|
@@ -4449,10 +4479,21 @@ const useRectangleStyles = styles.makeStyles((theme) => ({
|
|
|
4449
4479
|
}));
|
|
4450
4480
|
const Rectangle = ({ type, icon, title, description, onClick, hoverable }) => {
|
|
4451
4481
|
const classes = useRectangleStyles();
|
|
4452
|
-
|
|
4482
|
+
const titleRef = React.useRef(null);
|
|
4483
|
+
const [isTruncated, setIsTruncated] = React.useState(false);
|
|
4484
|
+
const checkTruncation = React.useCallback(() => {
|
|
4485
|
+
const el = titleRef.current;
|
|
4486
|
+
if (el) {
|
|
4487
|
+
setIsTruncated(el.scrollHeight > el.clientHeight);
|
|
4488
|
+
}
|
|
4489
|
+
}, []);
|
|
4490
|
+
React.useEffect(() => {
|
|
4491
|
+
checkTruncation();
|
|
4492
|
+
}, [title, checkTruncation]);
|
|
4493
|
+
return (jsxRuntime.jsxs("div", { className: `${classes.rectangle} ${classes[type]} ${hoverable ? classes.rectangleHoverable : ''}`, onClick: onClick, title: isTruncated ? title : null, children: [jsxRuntime.jsxs("div", { className: classes.textContainer, children: [jsxRuntime.jsx(material.Typography, { className: classes.title, ref: titleRef, children: title }), jsxRuntime.jsx(material.Typography, { className: classes.description, children: description })] }), jsxRuntime.jsx("div", { className: classes.iconContainer, children: jsxRuntime.jsx("div", { className: classes.icon, children: icon }) })] }));
|
|
4453
4494
|
};
|
|
4454
4495
|
const ChatPlaceholder = (props) => {
|
|
4455
|
-
const { dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, setCurrentAgentId, baseUrl, setBaseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, setChatDataState, userInput, legacyAgentScreen, activeConversationId, chatBodyRef, chatbotContext, setInitValue, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, uniqueChatId, setUniqueChatId, fieldNumber, setFieldNumber, questions, displayQuestions } = props;
|
|
4496
|
+
const { dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, setCurrentAgentId, baseUrl, setBaseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, setChatDataState, userInput, legacyAgentScreen, activeConversationId, chatBodyRef, chatbotContext, setInitValue, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, uniqueChatId, setUniqueChatId, fieldNumber, setFieldNumber, setAdditionalArgs, questions, displayQuestions } = props;
|
|
4456
4497
|
const classes = useStyles$5();
|
|
4457
4498
|
globalStyles();
|
|
4458
4499
|
const [cardList, setCardList] = React.useState([]);
|
|
@@ -4482,6 +4523,7 @@ const ChatPlaceholder = (props) => {
|
|
|
4482
4523
|
setUniqueChatId,
|
|
4483
4524
|
fieldNumber,
|
|
4484
4525
|
setFieldNumber,
|
|
4526
|
+
setAdditionalArgs,
|
|
4485
4527
|
});
|
|
4486
4528
|
const getBaseUrl = async () => {
|
|
4487
4529
|
try {
|
|
@@ -4575,7 +4617,7 @@ const ChatPlaceholder = (props) => {
|
|
|
4575
4617
|
agentId: card.agentId || card.id
|
|
4576
4618
|
}));
|
|
4577
4619
|
const dataToMap = legacyAgentScreen || displayQuestions ? transformedCardList : rectangleData;
|
|
4578
|
-
return (jsxRuntime.jsxs("div", { className: classes.placeholderContainer, children: [jsxRuntime.jsx("div", { className: classes.centerIconContainer, children: jsxRuntime.jsx(SvgCenter3D, { className: classes.centerIcon }) }), jsxRuntime.jsx(material.Typography, { variant: "h1", className: classes.heading, children: "Alan's Capabilities" }), jsxRuntime.jsx(material.Typography, { variant: "body1", className: classes.headingHelperText, children: "Discover potential issues & opportunities Alan can help you with!" }), jsxRuntime.jsx("div", { className: classes.rectanglesContainer, children: dataToMap.map((item, index) => (jsxRuntime.jsx(Rectangle, { type: item.type, icon: item.icon, title: item.title, description: item.description, onClick: () => handleRectangleClick(item?.agentId, item?.title), hoverable: legacyAgentScreen || displayQuestions }, index))) })] }));
|
|
4620
|
+
return (jsxRuntime.jsxs("div", { className: classes.placeholderContainer, children: [jsxRuntime.jsx("div", { className: classes.centerIconContainer, children: jsxRuntime.jsx(SvgCenter3D, { className: classes.centerIcon }) }), jsxRuntime.jsxs("div", { className: classes.headingContainer, children: [jsxRuntime.jsx(material.Typography, { variant: "h1", className: classes.heading, children: "Alan's Capabilities" }), jsxRuntime.jsx("span", { className: classes.alphaTag, children: "Alpha" })] }), jsxRuntime.jsx(material.Typography, { variant: "body1", className: classes.headingHelperText, children: "Discover potential issues & opportunities Alan can help you with!" }), jsxRuntime.jsx("div", { className: classes.rectanglesContainer, children: dataToMap.map((item, index) => (jsxRuntime.jsx(Rectangle, { type: item.type, icon: item.icon, title: item.title, description: item.description, onClick: () => handleRectangleClick(item?.agentId, item?.title), hoverable: legacyAgentScreen || displayQuestions }, index))) })] }));
|
|
4579
4621
|
};
|
|
4580
4622
|
|
|
4581
4623
|
const dateFormat = "DD-MM-YYYY HH:mm:ss";
|
|
@@ -5102,6 +5144,9 @@ const sseevent = (message, messageToStoreRef) => {
|
|
|
5102
5144
|
messageToStoreRef.current.uniqueChatId = parsedData?.chat_id
|
|
5103
5145
|
? parsedData.chat_id
|
|
5104
5146
|
: "";
|
|
5147
|
+
messageToStoreRef.current.additionalArgs = parsedData?.additional_args
|
|
5148
|
+
? parsedData.additional_args
|
|
5149
|
+
: {};
|
|
5105
5150
|
}
|
|
5106
5151
|
// Handle widget status - capture widget_data when status is "widget"
|
|
5107
5152
|
if (parsedData?.status === "widget" && !lodash.isEmpty(parsedData?.widget_data)) {
|
|
@@ -5122,6 +5167,9 @@ const sseevent = (message, messageToStoreRef) => {
|
|
|
5122
5167
|
: "";
|
|
5123
5168
|
messageToStoreRef.current.initValue = true;
|
|
5124
5169
|
messageToStoreRef.current.status = "completed";
|
|
5170
|
+
messageToStoreRef.current.additionalArgs = parsedData?.additional_args
|
|
5171
|
+
? parsedData.additional_args
|
|
5172
|
+
: {};
|
|
5125
5173
|
}
|
|
5126
5174
|
if (parsedData?.status === "completed" ||
|
|
5127
5175
|
parsedData?.status === "follow-up") {
|
|
@@ -5947,6 +5995,7 @@ const StreamedContent = ({ botData }) => {
|
|
|
5947
5995
|
initValue: false,
|
|
5948
5996
|
sessionId: "",
|
|
5949
5997
|
uniqueChatId: "",
|
|
5998
|
+
additionalArgs: {},
|
|
5950
5999
|
});
|
|
5951
6000
|
React.useRef(new Set()); // Tracks processed message chunks to prevent duplicates
|
|
5952
6001
|
React.useRef(""); // Tracks current content before adding new chunk
|
|
@@ -6252,6 +6301,9 @@ const StreamedContent = ({ botData }) => {
|
|
|
6252
6301
|
];
|
|
6253
6302
|
botData.utilityObject.setInitValue(messageToStoreRef.current.initValue);
|
|
6254
6303
|
botData.utilityObject.setSessionId(messageToStoreRef.current.sessionId);
|
|
6304
|
+
botData.utilityObject.setAdditionalArgs(!isEmpty(messageToStoreRef.current.additionalArgs)
|
|
6305
|
+
? messageToStoreRef.current.additionalArgs
|
|
6306
|
+
: {});
|
|
6255
6307
|
if (!wasStreamingAbortedRef.current) {
|
|
6256
6308
|
botData.utilityObject.setUniqueChatId(messageToStoreRef.current.uniqueChatId);
|
|
6257
6309
|
dispatch(smartBotActions.setCurrentAgentChatId(messageToStoreRef.current.uniqueChatId));
|
|
@@ -9755,7 +9807,7 @@ let chatbotFilterCustomConfig = {
|
|
|
9755
9807
|
|
|
9756
9808
|
const SmartBot = (props) => {
|
|
9757
9809
|
const { userName, partialClose, setPartialClose, forceOpen, customBaseUrl = "", displayQuestions, questions = [] } = props;
|
|
9758
|
-
const { showModal, setShowModal, minimizedMode, setMinimizedMode, userInput, setUserInput, position, setPosition, flowType, setFlowType, screenName, setScreenName, questionIndex, setQuestionIndex, currentAppLink, setCurrentAppLink, loader, setLoader, enableRefreshAction, setEnableRefreshAction, refreshLoader, setRefreshLoader, chatDataState, setChatDataState, showExtendedContent, setShowExtendedContent, currentMode, setCurrentMode, selectedModule, setSelectedModule, isCardVisible, setIsCardVisible, templateData, setTemplateData, showAlert, setShowAlert, grabPositionRef, chatDataRef, chatBodyRef, minimizedBtnRef, chatDataScreenLinkRef, navigate, location, dispatch, globalClasses, classes, dateFormat, filterReducerState, activeConversationId, setActiveConversationId, isModuleChanged, setIsModuleChanged, showChatPlaceholder, setShowChatPlaceholder, currentAgentId, setCurrentAgentId, baseUrl = customBaseUrl, setBaseUrl, currentSessionId, setCurrentSessionId, notificationData, agentTaskCompleted, setAgentTaskCompleted, customChatConfig, setCustomChatConfig, setMiddleWareFunction, chatBotInfoRef, chatDataInfoRef, initValue, setInitValue, sessionId, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, legacyAgentScreen, setLegacyAgentScreen, uniqueChatId, setUniqueChatId, fieldNumber, setFieldNumber, thinkingContext, isModalOpen, setIsModalOpen, utilityList, setUtilityList, isUploadModalOpen, setIsUploadModalOpen, isRefreshTriggered, setIsRefreshTriggered, } = useChatState();
|
|
9810
|
+
const { showModal, setShowModal, minimizedMode, setMinimizedMode, userInput, setUserInput, position, setPosition, flowType, setFlowType, screenName, setScreenName, questionIndex, setQuestionIndex, currentAppLink, setCurrentAppLink, loader, setLoader, enableRefreshAction, setEnableRefreshAction, refreshLoader, setRefreshLoader, chatDataState, setChatDataState, showExtendedContent, setShowExtendedContent, currentMode, setCurrentMode, selectedModule, setSelectedModule, isCardVisible, setIsCardVisible, templateData, setTemplateData, showAlert, setShowAlert, grabPositionRef, chatDataRef, chatBodyRef, minimizedBtnRef, chatDataScreenLinkRef, navigate, location, dispatch, globalClasses, classes, dateFormat, filterReducerState, activeConversationId, setActiveConversationId, isModuleChanged, setIsModuleChanged, showChatPlaceholder, setShowChatPlaceholder, currentAgentId, setCurrentAgentId, baseUrl = customBaseUrl, setBaseUrl, currentSessionId, setCurrentSessionId, notificationData, agentTaskCompleted, setAgentTaskCompleted, customChatConfig, setCustomChatConfig, setMiddleWareFunction, chatBotInfoRef, chatDataInfoRef, initValue, setInitValue, sessionId, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, legacyAgentScreen, setLegacyAgentScreen, uniqueChatId, setUniqueChatId, fieldNumber, setFieldNumber, thinkingContext, isModalOpen, setIsModalOpen, utilityList, setUtilityList, isUploadModalOpen, setIsUploadModalOpen, isRefreshTriggered, setIsRefreshTriggered, additionalArgs, setAdditionalArgs, } = useChatState();
|
|
9759
9811
|
// Add state for confirmation dialogs
|
|
9760
9812
|
React.useState(false);
|
|
9761
9813
|
React.useState(null);
|
|
@@ -9779,7 +9831,7 @@ const SmartBot = (props) => {
|
|
|
9779
9831
|
const [isLandingScreen, setIsLandingScreen] = React.useState(true);
|
|
9780
9832
|
const [showSuggestionBanner, setShowSuggestionBanner] = React.useState(true);
|
|
9781
9833
|
const [filterOptions, setFilterOptions] = React.useState([]);
|
|
9782
|
-
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);
|
|
9834
|
+
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);
|
|
9783
9835
|
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);
|
|
9784
9836
|
const { refreshAndUpdateUserManual, configureBotActions, displaySnackMessages, } = useBotConfiguration(setRefreshLoader, setEnableRefreshAction, dispatch);
|
|
9785
9837
|
const { prepareDataAndSendToAgent } = useAgentFlow(dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, baseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, {
|
|
@@ -9807,6 +9859,7 @@ const SmartBot = (props) => {
|
|
|
9807
9859
|
setUniqueChatId,
|
|
9808
9860
|
fieldNumber,
|
|
9809
9861
|
setFieldNumber,
|
|
9862
|
+
setAdditionalArgs,
|
|
9810
9863
|
});
|
|
9811
9864
|
const fetchCustomBotConfigurations = async () => {
|
|
9812
9865
|
try {
|
|
@@ -10173,7 +10226,8 @@ const SmartBot = (props) => {
|
|
|
10173
10226
|
setSessionId: setSessionId,
|
|
10174
10227
|
setInitValue: setInitValue,
|
|
10175
10228
|
uniqueChatId: uniqueChatId,
|
|
10176
|
-
currentAgentChatId: currentAgentChatId
|
|
10229
|
+
currentAgentChatId: currentAgentChatId,
|
|
10230
|
+
additionalArgs: lodash.isEmpty(userInput) ? additionalArgs : {}
|
|
10177
10231
|
});
|
|
10178
10232
|
setUserInput("");
|
|
10179
10233
|
}
|
|
@@ -10336,6 +10390,7 @@ const SmartBot = (props) => {
|
|
|
10336
10390
|
}));
|
|
10337
10391
|
setInitValue(true);
|
|
10338
10392
|
setSessionId("");
|
|
10393
|
+
setAdditionalArgs({});
|
|
10339
10394
|
setIsStop(false);
|
|
10340
10395
|
setUserInput("");
|
|
10341
10396
|
setUniqueChatId("");
|
|
@@ -10453,7 +10508,7 @@ const SmartBot = (props) => {
|
|
|
10453
10508
|
},
|
|
10454
10509
|
icon: jsxRuntime.jsx(SvgNavigationIcon, {}),
|
|
10455
10510
|
},
|
|
10456
|
-
], utilityList: utilityList, isAssistantThinking: loader, isCustomScreen: showChatPlaceholder, customScreenJsx: 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, displayQuestions: displayQuestions, questions: questions }), inputText: userInput, threadList: ["Home"], hideMenuArrow: hideMenu, newChatScreen: newChatScreen, isModuleListLoading: modulesLoading, suggestionBanner: {
|
|
10511
|
+
], utilityList: utilityList, isAssistantThinking: loader, isCustomScreen: showChatPlaceholder, customScreenJsx: 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 }), inputText: userInput, threadList: ["Home"], hideMenuArrow: hideMenu, newChatScreen: newChatScreen, isModuleListLoading: modulesLoading, suggestionBanner: {
|
|
10457
10512
|
freeTextHeading: "Try adding more details :",
|
|
10458
10513
|
freeTextContent: "Alan works better when you provide more context and pointed questions",
|
|
10459
10514
|
}, isStopIcon: isStop, onStopIconClick: onStopIconClick, footerText: "AI-generated responses may contain errors\u2014please verify important information", showSuggestionBanner: showSuggestionBanner, onCloseSuggestionBanner: () => {
|