bibot 1.0.5 → 1.0.6
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/.babelrc +7 -0
- package/.vscode/settings.json +5 -0
- package/dist/bibot.js +175 -0
- package/dist/bibot.js.map +1 -0
- package/dist/component/bibot.d.ts +5 -0
- package/dist/component/bibot.js +170 -0
- package/dist/component/bibot.js.map +1 -0
- package/dist/config/appStateEnums.js +10 -5
- package/dist/config/endpointEnums.js +27 -22
- package/dist/config/index.js +38 -5
- package/dist/config/statusCode.js +49 -44
- package/dist/context/AppContext.js +73 -56
- package/dist/context/index.js +16 -3
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +38 -4
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/mobileView.js +33 -18
- package/dist/hooks/useBiBotChatBot.d.ts +29 -0
- package/dist/hooks/useBiBotChatBot.js +206 -0
- package/dist/hooks/useBiBotChatBot.js.map +1 -0
- package/dist/hooks/usePluginFactory.js +60 -77
- package/dist/index.css +36 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/reducers/appReducer.js +24 -22
- package/dist/reducers/index.js +16 -3
- package/dist/services/index.js +16 -3
- package/dist/services/plugin-api.js +179 -182
- package/dist/styles/RegisterPageStyle.css +63 -0
- package/dist/styles/adminPortal.css +26 -0
- package/dist/styles/appConfig.css +90 -0
- package/dist/styles/buttonStyle.css +27 -0
- package/dist/styles/chatStyle.css +140 -0
- package/dist/styles/index.css +82 -0
- package/dist/styles/predefinedStyle.css +35 -0
- package/dist/styles/themeStyle.css +42 -0
- package/dist/styles/training.css +86 -0
- package/dist/types/coreInterfaces.d.ts +1 -10
- package/dist/types/coreInterfaces.js +5 -2
- package/dist/types/index.js +16 -3
- package/dist/utils/index.js +27 -3
- package/dist/utils/sessionManager.js +16 -12
- package/dist/utils/trimWhitespace.js +15 -11
- package/package.json +50 -54
- package/src/component/bibot.tsx +103 -0
- package/src/config/appStateEnums.ts +3 -0
- package/src/config/endpointEnums.ts +28 -0
- package/src/config/index.ts +5 -0
- package/src/config/statusCode.ts +49 -0
- package/src/context/AppContext.tsx +66 -0
- package/src/context/index.ts +3 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/mobileView.tsx +17 -0
- package/src/hooks/useBiBotChatBot.tsx +107 -0
- package/src/hooks/usePluginFactory.tsx +38 -0
- package/src/index.css +36 -0
- package/src/index.tsx +3 -0
- package/src/reducers/appReducer.ts +16 -0
- package/src/reducers/index.ts +4 -0
- package/src/services/index.ts +2 -0
- package/src/services/plugin-api.tsx +120 -0
- package/src/styles/RegisterPageStyle.css +63 -0
- package/src/styles/adminPortal.css +26 -0
- package/src/styles/appConfig.css +90 -0
- package/src/styles/buttonStyle.css +27 -0
- package/src/styles/chatStyle.css +140 -0
- package/src/styles/index.css +82 -0
- package/src/styles/predefinedStyle.css +35 -0
- package/src/styles/themeStyle.css +42 -0
- package/src/styles/training.css +86 -0
- package/src/types/coreInterfaces.ts +69 -0
- package/src/types/index.ts +4 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/sessionManager.tsx +15 -0
- package/src/utils/trimWhitespace.ts +11 -0
- package/tsconfig.json +25 -0
- package/webpack.config.js +19 -0
- package/dist/components/bibot.js +0 -171
- package/dist/components/bibot.js.map +0 -1
- /package/dist/{components/bibot.d.ts → bibot.d.ts} +0 -0
@@ -1,58 +1,75 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
var
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.AppProvider = exports.AppContext = void 0;
|
8
|
+
var _appStateEnums = require("../config/appStateEnums");
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
10
|
+
var _appReducer = require("../reducers/appReducer");
|
11
|
+
var _sessionManager = require("../utils/sessionManager");
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
14
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
16
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
19
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
20
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
21
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
22
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
23
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
24
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
25
|
+
var dummyDispatch = function dummyDispatch() {}; // A no-op function.
|
26
|
+
|
18
27
|
var defaultContextValue = {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
};
|
25
|
-
var AppContext = createContext(defaultContextValue);
|
26
|
-
var AppProvider = function (_a) {
|
27
|
-
var children = _a.children;
|
28
|
-
var APP_STATE_KEY = 'app_states';
|
29
|
-
var initialState = {
|
30
|
-
chatIsOpen: false,
|
31
|
-
sessionId: getSessionId()
|
32
|
-
};
|
33
|
-
var _b = useReducer(appReducer, initialState), state = _b[0], dispatch = _b[1];
|
34
|
-
useEffect(function () {
|
35
|
-
// Pool the initial states from local storage
|
36
|
-
var storedStates = localStorage.getItem(APP_STATE_KEY);
|
37
|
-
if (storedStates) {
|
38
|
-
try {
|
39
|
-
var parsedStates = JSON.parse(storedStates);
|
40
|
-
// Merge stored states with initial states
|
41
|
-
var updatedStates = __assign(__assign({}, initialState), parsedStates);
|
42
|
-
console.log(initialState, parsedStates, updatedStates);
|
43
|
-
// Dispatch action to update the states
|
44
|
-
dispatch(__assign({ type: appStateEnums.BIBOT }, updatedStates));
|
45
|
-
}
|
46
|
-
catch (error) {
|
47
|
-
console.error('Failed to parse app states from local storage:', error);
|
48
|
-
}
|
49
|
-
}
|
50
|
-
}, []);
|
51
|
-
useEffect(function () {
|
52
|
-
console.log('Changes in state: ', state);
|
53
|
-
localStorage.setItem(APP_STATE_KEY, JSON.stringify(state));
|
54
|
-
}, [state]);
|
55
|
-
return (_jsx(AppContext.Provider, { value: { state: state, dispatch: dispatch }, children: children }));
|
28
|
+
state: {
|
29
|
+
chatIsOpen: false,
|
30
|
+
sessionId: (0, _sessionManager.getSessionId)()
|
31
|
+
},
|
32
|
+
dispatch: dummyDispatch
|
56
33
|
};
|
57
|
-
|
58
|
-
|
34
|
+
var AppContext = exports.AppContext = /*#__PURE__*/(0, _react.createContext)(defaultContextValue);
|
35
|
+
var AppProvider = exports.AppProvider = function AppProvider(_ref) {
|
36
|
+
var children = _ref.children;
|
37
|
+
var APP_STATE_KEY = 'app_states';
|
38
|
+
var initialState = {
|
39
|
+
chatIsOpen: false,
|
40
|
+
sessionId: (0, _sessionManager.getSessionId)()
|
41
|
+
};
|
42
|
+
var _useReducer = (0, _react.useReducer)(_appReducer.appReducer, initialState),
|
43
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
44
|
+
state = _useReducer2[0],
|
45
|
+
dispatch = _useReducer2[1];
|
46
|
+
(0, _react.useEffect)(function () {
|
47
|
+
// Pool the initial states from local storage
|
48
|
+
var storedStates = localStorage.getItem(APP_STATE_KEY);
|
49
|
+
if (storedStates) {
|
50
|
+
try {
|
51
|
+
var parsedStates = JSON.parse(storedStates);
|
52
|
+
|
53
|
+
// Merge stored states with initial states
|
54
|
+
var updatedStates = _objectSpread(_objectSpread({}, initialState), parsedStates);
|
55
|
+
console.log(initialState, parsedStates, updatedStates);
|
56
|
+
// Dispatch action to update the states
|
57
|
+
dispatch(_objectSpread({
|
58
|
+
type: _appStateEnums.appStateEnums.BIBOT
|
59
|
+
}, updatedStates));
|
60
|
+
} catch (error) {
|
61
|
+
console.error('Failed to parse app states from local storage:', error);
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}, []);
|
65
|
+
(0, _react.useEffect)(function () {
|
66
|
+
console.log('Changes in state: ', state);
|
67
|
+
localStorage.setItem(APP_STATE_KEY, JSON.stringify(state));
|
68
|
+
}, [state]);
|
69
|
+
return /*#__PURE__*/_react["default"].createElement(AppContext.Provider, {
|
70
|
+
value: {
|
71
|
+
state: state,
|
72
|
+
dispatch: dispatch
|
73
|
+
}
|
74
|
+
}, children);
|
75
|
+
};
|
package/dist/context/index.js
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
var _AppContext = require("./AppContext");
|
7
|
+
Object.keys(_AppContext).forEach(function (key) {
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (key in exports && exports[key] === _AppContext[key]) return;
|
10
|
+
Object.defineProperty(exports, key, {
|
11
|
+
enumerable: true,
|
12
|
+
get: function get() {
|
13
|
+
return _AppContext[key];
|
14
|
+
}
|
15
|
+
});
|
16
|
+
});
|
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
@@ -1,4 +1,38 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
var _usePluginFactory = require("./usePluginFactory");
|
7
|
+
Object.keys(_usePluginFactory).forEach(function (key) {
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (key in exports && exports[key] === _usePluginFactory[key]) return;
|
10
|
+
Object.defineProperty(exports, key, {
|
11
|
+
enumerable: true,
|
12
|
+
get: function get() {
|
13
|
+
return _usePluginFactory[key];
|
14
|
+
}
|
15
|
+
});
|
16
|
+
});
|
17
|
+
var _useBiBotChatBot = require("./useBiBotChatBot");
|
18
|
+
Object.keys(_useBiBotChatBot).forEach(function (key) {
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
20
|
+
if (key in exports && exports[key] === _useBiBotChatBot[key]) return;
|
21
|
+
Object.defineProperty(exports, key, {
|
22
|
+
enumerable: true,
|
23
|
+
get: function get() {
|
24
|
+
return _useBiBotChatBot[key];
|
25
|
+
}
|
26
|
+
});
|
27
|
+
});
|
28
|
+
var _mobileView = require("./mobileView");
|
29
|
+
Object.keys(_mobileView).forEach(function (key) {
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
31
|
+
if (key in exports && exports[key] === _mobileView[key]) return;
|
32
|
+
Object.defineProperty(exports, key, {
|
33
|
+
enumerable: true,
|
34
|
+
get: function get() {
|
35
|
+
return _mobileView[key];
|
36
|
+
}
|
37
|
+
});
|
38
|
+
});
|
package/dist/hooks/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AAEjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AAEjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA"}
|
package/dist/hooks/mobileView.js
CHANGED
@@ -1,18 +1,33 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = MobileView;
|
7
|
+
var _react = require("react");
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
14
|
+
function MobileView() {
|
15
|
+
var _useState = (0, _react.useState)(false),
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
17
|
+
isMobile = _useState2[0],
|
18
|
+
setIsMobile = _useState2[1];
|
19
|
+
(0, _react.useEffect)(function () {
|
20
|
+
var isMobileDevice = function isMobileDevice() {
|
21
|
+
var screenWidth = window.innerWidth;
|
22
|
+
var mobileThreshold = 768;
|
23
|
+
setIsMobile(screenWidth < mobileThreshold);
|
24
|
+
};
|
25
|
+
isMobileDevice();
|
26
|
+
window.addEventListener('resize', isMobileDevice);
|
27
|
+
return function () {
|
28
|
+
// clean up event listner on when component unmount
|
29
|
+
window.removeEventListener('resize', isMobileDevice);
|
30
|
+
};
|
31
|
+
}, []);
|
32
|
+
return isMobile;
|
33
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
interface UseBiBotChatBotProps {
|
3
|
+
clientId: string;
|
4
|
+
}
|
5
|
+
interface ChatBubbleConfigProps {
|
6
|
+
bgColor?: string;
|
7
|
+
color?: string;
|
8
|
+
title?: string;
|
9
|
+
logo_url?: string;
|
10
|
+
}
|
11
|
+
declare const useBiBotChatBot: ({ clientId }: UseBiBotChatBotProps) => {
|
12
|
+
chatIsOpen: boolean;
|
13
|
+
messages: {
|
14
|
+
sender: 'user' | 'bot';
|
15
|
+
text: string;
|
16
|
+
}[];
|
17
|
+
isLoading: boolean;
|
18
|
+
messageEndRef: React.RefObject<HTMLDivElement>;
|
19
|
+
userInput: string;
|
20
|
+
handleUserInput: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
21
|
+
handleKeyPress: (e: React.KeyboardEvent<HTMLInputElement>) => Promise<void>;
|
22
|
+
toggleChat: () => void;
|
23
|
+
sendInputInquiry: () => Promise<void>;
|
24
|
+
chatBubbleConfig: ChatBubbleConfigProps | undefined;
|
25
|
+
showPredefinedQuestions: boolean;
|
26
|
+
predefinedQuestions: string[];
|
27
|
+
handlePredefinedQuestionSelect: (question: any) => void;
|
28
|
+
};
|
29
|
+
export { useBiBotChatBot };
|
@@ -0,0 +1,206 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.useBiBotChatBot = void 0;
|
8
|
+
var _antd = require("antd");
|
9
|
+
var _appStateEnums = require("../config/appStateEnums");
|
10
|
+
var _react = require("react");
|
11
|
+
var _AppContext = require("../context/AppContext");
|
12
|
+
var _uuid = require("uuid");
|
13
|
+
var _pluginApi = require("../services/plugin-api");
|
14
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
15
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
16
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
17
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
18
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
19
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
20
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
21
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
22
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
23
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
24
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
25
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
26
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
27
|
+
var useBiBotChatBot = exports.useBiBotChatBot = function useBiBotChatBot(_ref) {
|
28
|
+
var clientId = _ref.clientId;
|
29
|
+
var _useState = (0, _react.useState)([]),
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
31
|
+
predefinedQuestions = _useState2[0],
|
32
|
+
setPredefinedQuestions = _useState2[1]; // State to store predefined questions
|
33
|
+
var _useState3 = (0, _react.useState)(true),
|
34
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
35
|
+
showPredefinedQuestions = _useState4[0],
|
36
|
+
setShowPredefinedQuestions = _useState4[1]; // State to toggle predefined questions
|
37
|
+
var _useContext = (0, _react.useContext)(_AppContext.AppContext),
|
38
|
+
state = _useContext.state,
|
39
|
+
dispatch = _useContext.dispatch;
|
40
|
+
var chatIsOpen = state.chatIsOpen;
|
41
|
+
var _useState5 = (0, _react.useState)([]),
|
42
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
43
|
+
messages = _useState6[0],
|
44
|
+
setMessages = _useState6[1];
|
45
|
+
var _useState7 = (0, _react.useState)(''),
|
46
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
47
|
+
userInput = _useState8[0],
|
48
|
+
setUserInput = _useState8[1];
|
49
|
+
var _useState9 = (0, _react.useState)(false),
|
50
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
51
|
+
isLoading = _useState10[0],
|
52
|
+
setIsLoading = _useState10[1];
|
53
|
+
var messageEndRef = (0, _react.useRef)(null);
|
54
|
+
var _useState11 = (0, _react.useState)(),
|
55
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
56
|
+
chatBubbleConfig = _useState12[0],
|
57
|
+
setChatBubbleConfig = _useState12[1];
|
58
|
+
|
59
|
+
// Function to handle selecting a predefined question
|
60
|
+
var handlePredefinedQuestionSelect = function handlePredefinedQuestionSelect(question) {
|
61
|
+
setUserInput(question);
|
62
|
+
sendInputInquiry();
|
63
|
+
setShowPredefinedQuestions(false); // Hide predefined questions after selection
|
64
|
+
};
|
65
|
+
var getChatBubbleConfig = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
66
|
+
var remotePredefinedQuestions, remoteChatBubbleConfig;
|
67
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
68
|
+
while (1) switch (_context.prev = _context.next) {
|
69
|
+
case 0:
|
70
|
+
_context.next = 2;
|
71
|
+
return (0, _pluginApi.getRemoteClientChatPredefinedQuestions)({
|
72
|
+
client_id: clientId
|
73
|
+
});
|
74
|
+
case 2:
|
75
|
+
remotePredefinedQuestions = _context.sent;
|
76
|
+
if (remotePredefinedQuestions) {
|
77
|
+
setPredefinedQuestions(remotePredefinedQuestions);
|
78
|
+
}
|
79
|
+
_context.next = 6;
|
80
|
+
return (0, _pluginApi.getRemoteClientChatBubbleConfig)({
|
81
|
+
client_id: clientId
|
82
|
+
});
|
83
|
+
case 6:
|
84
|
+
remoteChatBubbleConfig = _context.sent;
|
85
|
+
if (remoteChatBubbleConfig) {
|
86
|
+
setChatBubbleConfig(remoteChatBubbleConfig);
|
87
|
+
}
|
88
|
+
case 8:
|
89
|
+
case "end":
|
90
|
+
return _context.stop();
|
91
|
+
}
|
92
|
+
}, _callee);
|
93
|
+
})), [clientId]);
|
94
|
+
(0, _react.useEffect)(function () {
|
95
|
+
void getChatBubbleConfig();
|
96
|
+
}, [getChatBubbleConfig]);
|
97
|
+
(0, _react.useEffect)(function () {
|
98
|
+
if (messageEndRef !== null && messageEndRef !== void 0 && messageEndRef.current) {
|
99
|
+
messageEndRef.current.scrollIntoView({
|
100
|
+
behavior: 'smooth'
|
101
|
+
});
|
102
|
+
}
|
103
|
+
}, [messages]);
|
104
|
+
var toggleChat = function toggleChat() {
|
105
|
+
dispatch({
|
106
|
+
type: _appStateEnums.appStateEnums.BIBOT,
|
107
|
+
chatIsOpen: !chatIsOpen
|
108
|
+
});
|
109
|
+
};
|
110
|
+
var handleUserInput = function handleUserInput(e) {
|
111
|
+
setUserInput(e.target.value);
|
112
|
+
};
|
113
|
+
function sendInputInquiry() {
|
114
|
+
return _sendInputInquiry.apply(this, arguments);
|
115
|
+
}
|
116
|
+
function _sendInputInquiry() {
|
117
|
+
_sendInputInquiry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
118
|
+
var response, _error$message;
|
119
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
120
|
+
while (1) switch (_context3.prev = _context3.next) {
|
121
|
+
case 0:
|
122
|
+
setIsLoading(true);
|
123
|
+
setUserInput('');
|
124
|
+
_context3.prev = 2;
|
125
|
+
if (!userInput.trim()) {
|
126
|
+
_context3.next = 9;
|
127
|
+
break;
|
128
|
+
}
|
129
|
+
// dispatch({ type: appStateEnums.BIBOT, chatIsOpen: true })
|
130
|
+
setMessages(function (messages) {
|
131
|
+
return [].concat(_toConsumableArray(messages), [{
|
132
|
+
sender: 'user',
|
133
|
+
text: userInput
|
134
|
+
}]);
|
135
|
+
});
|
136
|
+
_context3.next = 7;
|
137
|
+
return (0, _pluginApi.askBiBot)({
|
138
|
+
client_id: clientId,
|
139
|
+
q: userInput.trim(),
|
140
|
+
session_id: state.sessionId,
|
141
|
+
chat_id: (0, _uuid.v4)()
|
142
|
+
});
|
143
|
+
case 7:
|
144
|
+
response = _context3.sent;
|
145
|
+
setMessages(function (messages) {
|
146
|
+
return [].concat(_toConsumableArray(messages), [{
|
147
|
+
sender: 'bot',
|
148
|
+
text: response
|
149
|
+
}]);
|
150
|
+
});
|
151
|
+
case 9:
|
152
|
+
_context3.next = 14;
|
153
|
+
break;
|
154
|
+
case 11:
|
155
|
+
_context3.prev = 11;
|
156
|
+
_context3.t0 = _context3["catch"](2);
|
157
|
+
void _antd.message.error((_error$message = _context3.t0 === null || _context3.t0 === void 0 ? void 0 : _context3.t0.message) !== null && _error$message !== void 0 ? _error$message : 'Failed to get response from server');
|
158
|
+
case 14:
|
159
|
+
_context3.prev = 14;
|
160
|
+
setIsLoading(false);
|
161
|
+
return _context3.finish(14);
|
162
|
+
case 17:
|
163
|
+
case "end":
|
164
|
+
return _context3.stop();
|
165
|
+
}
|
166
|
+
}, _callee3, null, [[2, 11, 14, 17]]);
|
167
|
+
}));
|
168
|
+
return _sendInputInquiry.apply(this, arguments);
|
169
|
+
}
|
170
|
+
var handleKeyPress = /*#__PURE__*/function () {
|
171
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
172
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
173
|
+
while (1) switch (_context2.prev = _context2.next) {
|
174
|
+
case 0:
|
175
|
+
if (!(e.key === 'Enter' && !isLoading)) {
|
176
|
+
_context2.next = 3;
|
177
|
+
break;
|
178
|
+
}
|
179
|
+
_context2.next = 3;
|
180
|
+
return sendInputInquiry();
|
181
|
+
case 3:
|
182
|
+
case "end":
|
183
|
+
return _context2.stop();
|
184
|
+
}
|
185
|
+
}, _callee2);
|
186
|
+
}));
|
187
|
+
return function handleKeyPress(_x) {
|
188
|
+
return _ref3.apply(this, arguments);
|
189
|
+
};
|
190
|
+
}();
|
191
|
+
return {
|
192
|
+
chatIsOpen: chatIsOpen,
|
193
|
+
messages: messages,
|
194
|
+
isLoading: isLoading,
|
195
|
+
messageEndRef: messageEndRef,
|
196
|
+
userInput: userInput,
|
197
|
+
handleUserInput: handleUserInput,
|
198
|
+
handleKeyPress: handleKeyPress,
|
199
|
+
toggleChat: toggleChat,
|
200
|
+
sendInputInquiry: sendInputInquiry,
|
201
|
+
chatBubbleConfig: chatBubbleConfig,
|
202
|
+
showPredefinedQuestions: showPredefinedQuestions,
|
203
|
+
predefinedQuestions: predefinedQuestions,
|
204
|
+
handlePredefinedQuestionSelect: handlePredefinedQuestionSel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