@axos-web-dev/shared-components 1.0.100-dev.42-chatbot-reset-fix.6 → 1.0.100-dev.43-executive.1
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/ATMLocator/ATMLocator.js +2 -1
- package/dist/Auth/ErrorAlert.js +1 -0
- package/dist/Auth/SignInPassword.js +2 -2
- package/dist/BulletItem/BulletItem.js +0 -1
- package/dist/Button/Button.js +1 -0
- package/dist/Calculators/AnnualFeeCalculator/index.js +1 -1
- package/dist/Calculators/BuyDownCalculator/index.js +1 -1
- package/dist/Calculators/Calculator.js +2 -1
- package/dist/Calculators/MarineLoanMonthlyPaymentCalculator/index.js +1 -1
- package/dist/Calculators/MaxLoanCalculator/index.js +1 -1
- package/dist/Calculators/MonthlyPaymentCalculator/index.js +1 -1
- package/dist/Carousel/index.js +1 -0
- package/dist/Chatbot/ChatWindow.css.d.ts +0 -1
- package/dist/Chatbot/ChatWindow.css.js +11 -13
- package/dist/Chatbot/ChatWindow.js +66 -87
- package/dist/Chatbot/Chatbot.d.ts +1 -1
- package/dist/Chatbot/Chatbot.js +10 -46
- package/dist/Chatbot/index.js +1 -2
- package/dist/Chevron/index.js +1 -0
- package/dist/Comparison/Comparison.js +1 -0
- package/dist/ExecutiveBio/ExecutiveBio.css.d.ts +136 -0
- package/dist/ExecutiveBio/ExecutiveBio.css.js +46 -0
- package/dist/ExecutiveBio/ExecutiveBio.d.ts +1 -1
- package/dist/ExecutiveBio/ExecutiveBio.interface.d.ts +10 -4
- package/dist/ExecutiveBio/ExecutiveBio.js +330 -85
- package/dist/ExecutiveBio/index.js +24 -1
- package/dist/FaqAccordion/index.js +1 -0
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +1 -0
- package/dist/Forms/ApplicationStart.js +2 -4
- package/dist/Forms/ApplyNow.js +2 -1
- package/dist/Forms/ClearingForm.js +2 -4
- package/dist/Forms/CommercialDeposits.js +2 -4
- package/dist/Forms/CommercialDepositsNoLendingOption.js +2 -4
- package/dist/Forms/CommercialLending.js +2 -4
- package/dist/Forms/CommercialPremiumFinance.js +2 -4
- package/dist/Forms/ContactCompany.js +2 -4
- package/dist/Forms/ContactCompanyTitle.js +2 -4
- package/dist/Forms/ContactUs.js +2 -4
- package/dist/Forms/ContactUsAAS.js +2 -4
- package/dist/Forms/ContactUsBusiness.js +3 -4
- package/dist/Forms/ContactUsBusinessNameEmail.js +3 -4
- package/dist/Forms/ContactUsLVF.js +2 -4
- package/dist/Forms/ContactUsNMLSId.js +3 -4
- package/dist/Forms/CpraRequest.d.ts +1 -1
- package/dist/Forms/CpraRequest.js +2 -5
- package/dist/Forms/CraPublicFile.js +3 -4
- package/dist/Forms/DealerServices.js +2 -4
- package/dist/Forms/EmailOnly.js +3 -4
- package/dist/Forms/EmailUs.js +5 -7
- package/dist/Forms/HoneyPot/index.js +1 -2
- package/dist/Forms/MortgageRate/MortgageRateForm.js +3 -4
- package/dist/Forms/MortgageRate/MortgageRateWatch.js +1 -0
- package/dist/Forms/MortgageWarehouseLending.js +3 -4
- package/dist/Forms/QuickPricer/QuickPricerForm.js +12 -16
- package/dist/Forms/ScheduleCall.js +2 -4
- package/dist/Forms/ScheduleCallPremier.js +2 -4
- package/dist/Forms/SuccesForm.js +2 -1
- package/dist/Forms/VendorQuestionnaire.js +2 -6
- package/dist/Forms/index.js +0 -1
- package/dist/Hyperlink/index.js +1 -0
- package/dist/ImageLink/ImageLink.js +2 -1
- package/dist/ImageLink/ImageLinkSet.js +1 -0
- package/dist/ImageLink/index.js +1 -0
- package/dist/Insight/Featured/CategorySelector.js +1 -0
- package/dist/Insight/Featured/Featured.js +1 -0
- package/dist/Insight/Featured/Header.js +1 -0
- package/dist/LoadingIndicator/index.js +0 -1
- package/dist/Modal/Modal.js +1 -0
- package/dist/Modal/contextApi/store.js +1 -1
- package/dist/NavigationMenu/AxosALTS/NavData.js +1 -0
- package/dist/NavigationMenu/AxosALTS/index.js +1 -0
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +1 -0
- package/dist/NavigationMenu/AxosBank/NavData.js +1 -0
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +1 -0
- package/dist/NavigationMenu/AxosBank/index.js +1 -0
- package/dist/NavigationMenu/LaVictoire/NavData.js +1 -0
- package/dist/NavigationMenu/LaVictoire/index.js +1 -0
- package/dist/NavigationMenu/NavDataJson.js +1 -0
- package/dist/NavigationMenu/Navbar.js +1 -0
- package/dist/NavigationMenu/SignInNavButton.js +1 -0
- package/dist/SetContainer/SetContainer.js +2 -1
- package/dist/SocialMediaBar/iconsRepository.js +1 -0
- package/dist/Tab/Tab.js +0 -1
- package/dist/VideoTile/VideoTile.js +1 -0
- package/dist/VideoWrapper/index.js +1 -0
- package/dist/assets/Chatbot/ChatWindow.css +26 -38
- package/dist/assets/ExecutiveBio/ExecutiveBio.css +268 -0
- package/dist/main.js +26 -11
- package/dist/utils/index.d.ts +1 -4
- package/dist/utils/index.js +1 -9
- package/package.json +136 -136
- package/dist/utils/emailValidation.d.ts +0 -1
- package/dist/utils/emailValidation.js +0 -31
- package/dist/utils/nmlsValidation.d.ts +0 -1
- package/dist/utils/nmlsValidation.js +0 -34
- package/dist/utils/useCachedValidators.d.ts +0 -2
- package/dist/utils/useCachedValidators.js +0 -22
|
@@ -11,11 +11,11 @@ import '../assets/VideoWrapper/VideoWrapper.css';import '../assets/TopicalNavSet
|
|
|
11
11
|
/* empty css */
|
|
12
12
|
import "../utils/allowedAxosDomains.js";
|
|
13
13
|
import { getVariant } from "../utils/getVariant.js";
|
|
14
|
-
import "react";
|
|
15
14
|
import clsx from "clsx";
|
|
16
15
|
/* empty css */
|
|
17
16
|
/* empty css */
|
|
18
17
|
import "../Button/Button.css.js";
|
|
18
|
+
import "react";
|
|
19
19
|
import "react-use";
|
|
20
20
|
import "../Accordion/Accordion.js";
|
|
21
21
|
import "../Accordion/Accordion.css.js";
|
|
@@ -73,6 +73,7 @@ import "../Chatbot/store/chat.js";
|
|
|
73
73
|
import "../Chatbot/authenticate.js";
|
|
74
74
|
/* empty css */
|
|
75
75
|
import "../Chatbot/store/messages.js";
|
|
76
|
+
import "@ujet/websdk-headless";
|
|
76
77
|
/* empty css */
|
|
77
78
|
import "../Comparison/Comparison.css.js";
|
|
78
79
|
import "next/image.js";
|
package/dist/Auth/ErrorAlert.js
CHANGED
|
@@ -65,6 +65,7 @@ import "../Chatbot/store/chat.js";
|
|
|
65
65
|
import "../Chatbot/authenticate.js";
|
|
66
66
|
/* empty css */
|
|
67
67
|
import "../Chatbot/store/messages.js";
|
|
68
|
+
import "@ujet/websdk-headless";
|
|
68
69
|
import { Hyperlink } from "../Hyperlink/index.js";
|
|
69
70
|
/* empty css */
|
|
70
71
|
import "../Comparison/Comparison.css.js";
|
|
@@ -3,12 +3,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
4
4
|
import { Input } from "../Input/Input.js";
|
|
5
5
|
import "../utils/allowedAxosDomains.js";
|
|
6
|
-
import { z } from "zod";
|
|
7
6
|
import { getVariant } from "../utils/getVariant.js";
|
|
8
|
-
import { useState } from "react";
|
|
9
7
|
import clsx from "clsx";
|
|
10
8
|
import { useAction } from "next-safe-action/hooks";
|
|
9
|
+
import { useState } from "react";
|
|
11
10
|
import { useForm } from "react-hook-form";
|
|
11
|
+
import { z } from "zod";
|
|
12
12
|
import { ErrorAlert } from "./ErrorAlert.js";
|
|
13
13
|
import { body_sign_in, form_input_wrapper, sign_in_button, sign_in_form } from "./SignIn.css.js";
|
|
14
14
|
const schema = z.object({
|
|
@@ -10,7 +10,6 @@ import '../assets/icons/FollowIcon/FollowIcon.css';import '../assets/icons/Downl
|
|
|
10
10
|
/* empty css */
|
|
11
11
|
import "../utils/allowedAxosDomains.js";
|
|
12
12
|
import { getVariant } from "../utils/getVariant.js";
|
|
13
|
-
import "react";
|
|
14
13
|
import clsx from "clsx";
|
|
15
14
|
import { bulletIcon } from "./BulletItem.css.js";
|
|
16
15
|
const BulletItem = (props) => {
|
package/dist/Button/Button.js
CHANGED
|
@@ -5,8 +5,8 @@ import { Chevron } from "../../Chevron/index.js";
|
|
|
5
5
|
import { title } from "../../IconBillboard/IconBillboard.css.js";
|
|
6
6
|
import "../../utils/allowedAxosDomains.js";
|
|
7
7
|
import { getVariant } from "../../utils/getVariant.js";
|
|
8
|
-
import { useRef, useState, useEffect } from "react";
|
|
9
8
|
import clsx from "clsx";
|
|
9
|
+
import { useRef, useState, useEffect } from "react";
|
|
10
10
|
import { calculator } from "../calculator.css.js";
|
|
11
11
|
import { container, calc_container, calc_block, pb0_1023, slider_block_wrapper, w100, stat_row, balance_wrapper, fb50, stat, slider_wrapper, slider, pt0_1023, text_block } from "./AnnualFeeCalculator.css.js";
|
|
12
12
|
const AnnualFeeCalculator = ({
|
|
@@ -19,10 +19,10 @@ import "../../Input/DownPaymentInput.js";
|
|
|
19
19
|
import "../../Input/RadioButton.js";
|
|
20
20
|
import { PercentageInput } from "../../Input/PercentageInput.js";
|
|
21
21
|
import "../../utils/allowedAxosDomains.js";
|
|
22
|
-
import { z } from "zod";
|
|
23
22
|
import { getVariant } from "../../utils/getVariant.js";
|
|
24
23
|
import clsx from "clsx";
|
|
25
24
|
import { useForm, FormProvider } from "react-hook-form";
|
|
25
|
+
import { z } from "zod";
|
|
26
26
|
import { calc_container, calculator_section, section_header, theme_header, mt_8, buydown_calculator_form, row_form, calculate_row, form_wrapper, form_disclosure } from "./BuyDownCalculator.css.js";
|
|
27
27
|
const BuyDownCalculator = ({
|
|
28
28
|
header,
|
|
@@ -14,13 +14,13 @@ import '../assets/Forms/QuickPricer/UserInformation.css';import '../assets/Forms
|
|
|
14
14
|
/* empty css */
|
|
15
15
|
import "../utils/allowedAxosDomains.js";
|
|
16
16
|
import { getVariant } from "../utils/getVariant.js";
|
|
17
|
-
import { useRef, useEffect } from "react";
|
|
18
17
|
import clsx from "clsx";
|
|
19
18
|
/* empty css */
|
|
20
19
|
/* empty css */
|
|
21
20
|
import "../Accordion/Accordion.js";
|
|
22
21
|
import "../Accordion/Accordion.css.js";
|
|
23
22
|
import "../AlertBanner/AlertBanner.css.js";
|
|
23
|
+
import { useRef, useEffect } from "react";
|
|
24
24
|
import "../Article/Article.css.js";
|
|
25
25
|
import "../ArticlesSet/ArticlesSet.css.js";
|
|
26
26
|
import "../Chevron/Chevron.css.js";
|
|
@@ -56,6 +56,7 @@ import "../Chatbot/authenticate.js";
|
|
|
56
56
|
import "react-use";
|
|
57
57
|
/* empty css */
|
|
58
58
|
import "../Chatbot/store/messages.js";
|
|
59
|
+
import "@ujet/websdk-headless";
|
|
59
60
|
/* empty css */
|
|
60
61
|
import "../Comparison/Comparison.css.js";
|
|
61
62
|
import "next/image.js";
|
|
@@ -4,8 +4,8 @@ import { button } from "../../Button/Button.css.js";
|
|
|
4
4
|
import { title } from "../../IconBillboard/IconBillboard.css.js";
|
|
5
5
|
import "../../utils/allowedAxosDomains.js";
|
|
6
6
|
import { getVariant } from "../../utils/getVariant.js";
|
|
7
|
-
import { useState } from "react";
|
|
8
7
|
import clsx from "clsx";
|
|
8
|
+
import { useState } from "react";
|
|
9
9
|
import { calc_text, description_text, calc_disclosure } from "../BalanceAPYCalculator/BalanceAPYCalculator.css.js";
|
|
10
10
|
import { calculator } from "../calculator.css.js";
|
|
11
11
|
import { calc_container, container, h2i, inputs_container, input_container, input_box, error_message, hide_select_arrow, calculation_header, payment_results } from "../MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js";
|
|
@@ -5,8 +5,8 @@ import { calc_container, container, h2i, inputs_container, input_container, inpu
|
|
|
5
5
|
import { title } from "../../IconBillboard/IconBillboard.css.js";
|
|
6
6
|
import "../../utils/allowedAxosDomains.js";
|
|
7
7
|
import { getVariant } from "../../utils/getVariant.js";
|
|
8
|
-
import { useState } from "react";
|
|
9
8
|
import clsx from "clsx";
|
|
9
|
+
import { useState } from "react";
|
|
10
10
|
import { calculator } from "../calculator.css.js";
|
|
11
11
|
const MaxLoanCalculator = ({
|
|
12
12
|
variant,
|
|
@@ -4,8 +4,8 @@ import { button } from "../../Button/Button.css.js";
|
|
|
4
4
|
import { title } from "../../IconBillboard/IconBillboard.css.js";
|
|
5
5
|
import "../../utils/allowedAxosDomains.js";
|
|
6
6
|
import { getVariant } from "../../utils/getVariant.js";
|
|
7
|
-
import { useState } from "react";
|
|
8
7
|
import clsx from "clsx";
|
|
8
|
+
import { useState } from "react";
|
|
9
9
|
import { calc_text, description_text, calc_disclosure } from "../BalanceAPYCalculator/BalanceAPYCalculator.css.js";
|
|
10
10
|
import { calculator } from "../calculator.css.js";
|
|
11
11
|
import { calc_container, container, h2i, inputs_container, input_container, input_box, error_message, calculation_header, payment_results } from "./MonthlyPaymentCalculator.css.js";
|
package/dist/Carousel/index.js
CHANGED
|
@@ -5,7 +5,6 @@ export declare const chat_title: string;
|
|
|
5
5
|
export declare const button_reset: string;
|
|
6
6
|
export declare const arrowFill: string;
|
|
7
7
|
export declare const inputStyle: string;
|
|
8
|
-
export declare const autoResize: string;
|
|
9
8
|
export declare const sendButtonStyle: string;
|
|
10
9
|
export declare const messagesContainerStyle: string;
|
|
11
10
|
export declare const notificationStyle: string;
|
|
@@ -6,21 +6,19 @@ var chat_title = "_13n1jqk3";
|
|
|
6
6
|
var button_reset = "_13n1jqk4";
|
|
7
7
|
var arrowFill = "_13n1jqk5";
|
|
8
8
|
var inputStyle = "_13n1jqk6";
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var chatFinishDialog = "_13n1jqki";
|
|
9
|
+
var sendButtonStyle = "_13n1jqk7";
|
|
10
|
+
var messagesContainerStyle = "_13n1jqk8";
|
|
11
|
+
var notificationStyle = "_13n1jqk9";
|
|
12
|
+
var messageStyle = "_13n1jqka";
|
|
13
|
+
var inline_button_wrapper = "_13n1jqkb";
|
|
14
|
+
var inline_button = "_13n1jqkc";
|
|
15
|
+
var endChatButtonStyle = "_13n1jqkd";
|
|
16
|
+
var chatbotMenu = "_13n1jqke";
|
|
17
|
+
var chatbotMenuItem = "_13n1jqkf";
|
|
18
|
+
var chatNetworkStatus = "_13n1jqkg";
|
|
19
|
+
var chatFinishDialog = "_13n1jqkh";
|
|
21
20
|
export {
|
|
22
21
|
arrowFill,
|
|
23
|
-
autoResize,
|
|
24
22
|
button_reset,
|
|
25
23
|
chatFinishDialog,
|
|
26
24
|
chatNetworkStatus,
|
|
@@ -5,7 +5,7 @@ import React, { useRef, useEffect, Fragment as Fragment$1 } from "react";
|
|
|
5
5
|
import ReactMarkdown from "react-markdown";
|
|
6
6
|
import { useNetworkState, useMount } from "react-use";
|
|
7
7
|
import remarkGfm from "remark-gfm";
|
|
8
|
-
import { windowBarStyle, chat_title, chatbotMenuItem, chatbotMenu, chatFinishDialog, endChatButtonStyle, button_reset, arrowFill, chatNetworkStatus, notificationStyle, messageStyle, inline_button_wrapper, inline_button, messagesContainerStyle, inputStyle,
|
|
8
|
+
import { windowBarStyle, chat_title, chatbotMenuItem, chatbotMenu, chatFinishDialog, endChatButtonStyle, button_reset, arrowFill, chatNetworkStatus, notificationStyle, messageStyle, inline_button_wrapper, inline_button, messagesContainerStyle, inputStyle, sendButtonStyle, windowStyle, windowOpenStyle } from "./ChatWindow.css.js";
|
|
9
9
|
import EllipsisLoader from "./EllipsisAnimation.js";
|
|
10
10
|
import { EllipsisIcon } from "./EllipsisIcon.js";
|
|
11
11
|
import { useOpenChat } from "./store/chat.js";
|
|
@@ -28,16 +28,14 @@ const ChatWindow = ({
|
|
|
28
28
|
const state = useNetworkState();
|
|
29
29
|
const [input, setInput] = React.useState("");
|
|
30
30
|
const messagesEndRef = useRef(null);
|
|
31
|
-
const inputRef = useRef(null);
|
|
32
31
|
const isOpen = useOpenChat((state2) => state2.isOpen);
|
|
33
32
|
useEffect(() => {
|
|
34
33
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
35
34
|
}, [messages]);
|
|
36
35
|
const handleSend = (e) => {
|
|
37
36
|
e.preventDefault();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
onSend(cleaned);
|
|
37
|
+
if (input.trim()) {
|
|
38
|
+
onSend(input);
|
|
41
39
|
setInput("");
|
|
42
40
|
}
|
|
43
41
|
};
|
|
@@ -51,18 +49,6 @@ const ChatWindow = ({
|
|
|
51
49
|
const escalationDeflected = messages?.filter(
|
|
52
50
|
(item) => item.type == "noti" && item.event == "escalationDeflected"
|
|
53
51
|
).length > 0;
|
|
54
|
-
const cleanInput = (text) => text.replace(/[\r\n]+/g, " ").trim();
|
|
55
|
-
const autoResizeTextarea = () => {
|
|
56
|
-
if (inputRef.current) {
|
|
57
|
-
inputRef.current.style.height = "auto";
|
|
58
|
-
inputRef.current.style.maxHeight = "80px";
|
|
59
|
-
inputRef.current.style.height = inputRef.current.scrollHeight + "px";
|
|
60
|
-
inputRef.current.style.overflowY = inputRef.current.scrollHeight > 80 ? "auto" : "hidden";
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
autoResizeTextarea();
|
|
65
|
-
}, [input]);
|
|
66
52
|
return /* @__PURE__ */ jsxs("div", { className: clsx(windowStyle, isOpen && windowOpenStyle), children: [
|
|
67
53
|
/* @__PURE__ */ jsxs("div", { className: windowBarStyle, children: [
|
|
68
54
|
/* @__PURE__ */ jsxs("div", { className: "flex middle", style: { paddingBlock: "6px" }, children: [
|
|
@@ -283,7 +269,7 @@ const ChatWindow = ({
|
|
|
283
269
|
),
|
|
284
270
|
/* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: endChat, children: "End Chat" }) })
|
|
285
271
|
] }),
|
|
286
|
-
["text", "markdown_template", "markdown"].includes(msg.type) && /* @__PURE__ */
|
|
272
|
+
["text", "markdown_template", "markdown"].includes(msg.type) && /* @__PURE__ */ jsxs(
|
|
287
273
|
"div",
|
|
288
274
|
{
|
|
289
275
|
className: messageStyle,
|
|
@@ -294,58 +280,62 @@ const ChatWindow = ({
|
|
|
294
280
|
color: msg.$userType == "end_user" ? "#fff" : "#1F1F1F",
|
|
295
281
|
boxShadow: msg.$userType == "end_user" ? "0 1px 4px #b3e0ff55" : void 0
|
|
296
282
|
},
|
|
297
|
-
children:
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
"
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
{
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
283
|
+
children: [
|
|
284
|
+
/* @__PURE__ */ jsxs(
|
|
285
|
+
"div",
|
|
286
|
+
{
|
|
287
|
+
style: {
|
|
288
|
+
fontSize: 13,
|
|
289
|
+
display: "flex",
|
|
290
|
+
flexDirection: "column",
|
|
291
|
+
gap: 4
|
|
292
|
+
},
|
|
293
|
+
children: [
|
|
294
|
+
msg.$userType == "virtual_agent" && /* @__PURE__ */ jsxs(
|
|
295
|
+
"div",
|
|
296
|
+
{
|
|
297
|
+
style: {
|
|
298
|
+
display: "flex",
|
|
299
|
+
// justifyContent: "center",
|
|
300
|
+
alignItems: "center",
|
|
301
|
+
gap: "8px"
|
|
302
|
+
},
|
|
303
|
+
children: [
|
|
304
|
+
showAvatar && /* @__PURE__ */ jsx(
|
|
305
|
+
"img",
|
|
306
|
+
{
|
|
307
|
+
width: 24,
|
|
308
|
+
height: 24,
|
|
309
|
+
src: virtualAgent?.avatar_url,
|
|
310
|
+
alt: "agent avatar"
|
|
311
|
+
}
|
|
312
|
+
),
|
|
313
|
+
/* @__PURE__ */ jsx("strong", { children: virtualAgent?.name })
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
),
|
|
317
|
+
/* @__PURE__ */ jsx(
|
|
318
|
+
ReactMarkdown,
|
|
319
|
+
{
|
|
320
|
+
remarkPlugins: [[remarkGfm, { singleTilde: false }]],
|
|
321
|
+
components: {
|
|
322
|
+
p: ({ ...props }) => /* @__PURE__ */ jsx(
|
|
323
|
+
"p",
|
|
324
|
+
{
|
|
325
|
+
style: { margin: 0, fontSize: "inherit" },
|
|
326
|
+
title: new Date(msg.$timestamp).toLocaleString(),
|
|
327
|
+
...props
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
},
|
|
331
|
+
children: msg.content
|
|
332
|
+
}
|
|
333
|
+
)
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
),
|
|
337
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 10, color: "#888", marginTop: 2 } })
|
|
338
|
+
]
|
|
349
339
|
},
|
|
350
340
|
msg.$index
|
|
351
341
|
),
|
|
@@ -408,31 +398,20 @@ const ChatWindow = ({
|
|
|
408
398
|
onSubmit: handleSend,
|
|
409
399
|
style: {
|
|
410
400
|
borderTop: "1px solid #eee",
|
|
411
|
-
display: "flex"
|
|
412
|
-
|
|
401
|
+
display: "flex",
|
|
402
|
+
gap: 8
|
|
413
403
|
},
|
|
414
404
|
children: [
|
|
415
405
|
/* @__PURE__ */ jsx(
|
|
416
|
-
"
|
|
406
|
+
"input",
|
|
417
407
|
{
|
|
418
|
-
|
|
408
|
+
type: "text",
|
|
419
409
|
value: input,
|
|
420
410
|
onChange: (e) => setInput(e.target.value),
|
|
421
|
-
onKeyDown: (e) => {
|
|
422
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
423
|
-
e.preventDefault();
|
|
424
|
-
const cleaned = cleanInput(input);
|
|
425
|
-
if (cleaned) {
|
|
426
|
-
onSend(cleaned);
|
|
427
|
-
setInput("");
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
},
|
|
431
411
|
placeholder: "Ask something...",
|
|
432
|
-
className:
|
|
412
|
+
className: inputStyle,
|
|
433
413
|
autoFocus: true,
|
|
434
|
-
disabled: inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected
|
|
435
|
-
rows: 1
|
|
414
|
+
disabled: inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected
|
|
436
415
|
}
|
|
437
416
|
),
|
|
438
417
|
/* @__PURE__ */ jsx(
|
|
@@ -2,7 +2,7 @@ export type ChatbotProps = {
|
|
|
2
2
|
project?: "axos" | "ufb";
|
|
3
3
|
debug?: boolean;
|
|
4
4
|
};
|
|
5
|
-
export declare const Chatbot: ({ project, projectEnv, menuOption,
|
|
5
|
+
export declare const Chatbot: ({ project, projectEnv, menuOption, }: {
|
|
6
6
|
project?: "axos" | "ufb";
|
|
7
7
|
projectEnv?: "dev" | "qa" | "uat" | "stg" | "prod";
|
|
8
8
|
menuOption?: "Support Virtual Agent" | string;
|
package/dist/Chatbot/Chatbot.js
CHANGED
|
@@ -6,13 +6,13 @@ import { chatbotUFB, chatbotAXB } from "./Chatbot.css.js";
|
|
|
6
6
|
import { ChatWindow } from "./ChatWindow.js";
|
|
7
7
|
import { useOpenChat } from "./store/chat.js";
|
|
8
8
|
import { useMessages } from "./store/messages.js";
|
|
9
|
-
import {
|
|
9
|
+
import { Logger, consoleLoggerHandler, Client } from "@ujet/websdk-headless";
|
|
10
|
+
import { useRef, useState } from "react";
|
|
10
11
|
import { useMount, useUnmount } from "react-use";
|
|
11
12
|
const Chatbot = ({
|
|
12
13
|
project = "axos",
|
|
13
14
|
projectEnv = "dev",
|
|
14
|
-
menuOption = "Support Virtual Agent"
|
|
15
|
-
debug = false
|
|
15
|
+
menuOption = "Support Virtual Agent"
|
|
16
16
|
}) => {
|
|
17
17
|
const { hasOpenedOnce, toggle, reset } = useOpenChat();
|
|
18
18
|
const { addMessage, addMessages, clearMessages, messages } = useMessages();
|
|
@@ -24,8 +24,6 @@ const Chatbot = ({
|
|
|
24
24
|
const agent_virtual = useRef(null);
|
|
25
25
|
const [status, setStatus] = useState("idle");
|
|
26
26
|
const [hasStarted, setHasStarted] = useState(false);
|
|
27
|
-
const [menusLoaded, setMenusLoaded] = useState(false);
|
|
28
|
-
const [pendingStart, setPendingStart] = useState(false);
|
|
29
27
|
const brandMap = /* @__PURE__ */ new Map([
|
|
30
28
|
["axos", 1],
|
|
31
29
|
["ufb", 3]
|
|
@@ -50,13 +48,11 @@ const Chatbot = ({
|
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
50
|
};
|
|
51
|
+
if (projectEnv !== "prod") {
|
|
52
|
+
Logger.addHandler(consoleLoggerHandler);
|
|
53
|
+
}
|
|
53
54
|
const onReadyHandler = async () => {
|
|
54
55
|
console.log("Chat client is ready");
|
|
55
|
-
if (clientRef.current) {
|
|
56
|
-
menuRef.current = await clientRef.current.getMenus();
|
|
57
|
-
setMenusLoaded(true);
|
|
58
|
-
console.log("menus:", menuRef.current);
|
|
59
|
-
}
|
|
60
56
|
};
|
|
61
57
|
const onAuthenticatedHandler = async () => {
|
|
62
58
|
console.log("Chat client is authenticated");
|
|
@@ -100,6 +96,8 @@ const Chatbot = ({
|
|
|
100
96
|
}
|
|
101
97
|
};
|
|
102
98
|
const registerEventHandlers = () => {
|
|
99
|
+
clientRef.current?.on("ready", onReadyHandler);
|
|
100
|
+
clientRef.current?.on("authenticated", onAuthenticatedHandler);
|
|
103
101
|
clientRef.current?.on("chat.ongoing", onChatOngoingHandler);
|
|
104
102
|
clientRef.current?.on("chat.message", onChatMessageHandler);
|
|
105
103
|
clientRef.current?.on("chat.typingStarted", onChatTypingStartedHandler);
|
|
@@ -126,10 +124,6 @@ const Chatbot = ({
|
|
|
126
124
|
clientRef.current?.off("chat.connected", onChatConnectedHandler);
|
|
127
125
|
};
|
|
128
126
|
const createClient = async () => {
|
|
129
|
-
const { Client, Logger, consoleLoggerHandler } = await import("@ujet/websdk-headless");
|
|
130
|
-
if (projectEnv !== "prod" || debug) {
|
|
131
|
-
Logger.addHandler(consoleLoggerHandler);
|
|
132
|
-
}
|
|
133
127
|
if (clientRef.current) return;
|
|
134
128
|
const client = new Client({
|
|
135
129
|
companyId: process.env.CCAI_COMPANY_ID || "",
|
|
@@ -138,10 +132,10 @@ const Chatbot = ({
|
|
|
138
132
|
// or your region
|
|
139
133
|
authenticate
|
|
140
134
|
});
|
|
141
|
-
client?.on("ready", onReadyHandler);
|
|
142
|
-
client?.on("authenticated", onAuthenticatedHandler);
|
|
143
135
|
isMountedRef.current = true;
|
|
144
136
|
clientRef.current = client;
|
|
137
|
+
menuRef.current = await client.getMenus();
|
|
138
|
+
console.log("menus:", menuRef.current);
|
|
145
139
|
registerEventHandlers();
|
|
146
140
|
return;
|
|
147
141
|
};
|
|
@@ -149,17 +143,6 @@ const Chatbot = ({
|
|
|
149
143
|
console.log("Starting chat");
|
|
150
144
|
const client = clientRef.current;
|
|
151
145
|
if (!client) return;
|
|
152
|
-
if (!menuRef.current || !menuRef.current.menus) {
|
|
153
|
-
let waited = 0;
|
|
154
|
-
while ((!menuRef.current || !menuRef.current.menus) && waited < 5e3) {
|
|
155
|
-
await new Promise((res) => setTimeout(res, 100));
|
|
156
|
-
waited += 100;
|
|
157
|
-
}
|
|
158
|
-
if (!menuRef.current || !menuRef.current.menus) {
|
|
159
|
-
console.error("Menu not loaded, cannot start chat");
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
146
|
try {
|
|
164
147
|
const ongoingChat = await client.loadOngoingChat();
|
|
165
148
|
if (ongoingChat) {
|
|
@@ -177,7 +160,6 @@ const Chatbot = ({
|
|
|
177
160
|
const newChat = await client.createChat(menuId, { custom_data });
|
|
178
161
|
if (newChat !== null) {
|
|
179
162
|
chatRef.current = newChat;
|
|
180
|
-
agent_virtual.current = newChat.agent;
|
|
181
163
|
console.log("Chat created id:", newChat.id);
|
|
182
164
|
}
|
|
183
165
|
} catch (err) {
|
|
@@ -187,10 +169,6 @@ const Chatbot = ({
|
|
|
187
169
|
const handleClick = async () => {
|
|
188
170
|
toggle();
|
|
189
171
|
if (hasStarted) return;
|
|
190
|
-
if (!menusLoaded) {
|
|
191
|
-
setPendingStart(true);
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
172
|
if (!hasOpenedOnce) {
|
|
195
173
|
await startChat();
|
|
196
174
|
setHasStarted(true);
|
|
@@ -218,25 +196,11 @@ const Chatbot = ({
|
|
|
218
196
|
isMountedRef.current = true;
|
|
219
197
|
await createClient();
|
|
220
198
|
});
|
|
221
|
-
useEffect(() => {
|
|
222
|
-
if (menusLoaded && pendingStart && !hasStarted) {
|
|
223
|
-
startChat();
|
|
224
|
-
setHasStarted(true);
|
|
225
|
-
setPendingStart(false);
|
|
226
|
-
}
|
|
227
|
-
}, [menusLoaded, pendingStart, hasStarted]);
|
|
228
199
|
useUnmount(() => {
|
|
229
200
|
console.log("Chatbot unmounted");
|
|
230
201
|
deregisterEventHandlers();
|
|
231
202
|
isMountedRef.current = false;
|
|
232
203
|
hasLoadedBefore.current = true;
|
|
233
|
-
reset();
|
|
234
|
-
setHasStarted(false);
|
|
235
|
-
setStatus("idle");
|
|
236
|
-
clearMessages();
|
|
237
|
-
clientRef.current?.destroy();
|
|
238
|
-
clientRef.current?.destroyChat();
|
|
239
|
-
clientRef.current = null;
|
|
240
204
|
});
|
|
241
205
|
return /* @__PURE__ */ jsxs("div", { className: project === "ufb" ? chatbotUFB : chatbotAXB, children: [
|
|
242
206
|
/* @__PURE__ */ jsx(Bubble, { onClick: handleClick }),
|
package/dist/Chatbot/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { bubbleWrapper, svgFill } from "./Bubble.css.js";
|
|
|
4
4
|
import { Chatbot } from "./Chatbot.js";
|
|
5
5
|
import { chatbotAXB, chatbotUFB } from "./Chatbot.css.js";
|
|
6
6
|
import { ChatWindow } from "./ChatWindow.js";
|
|
7
|
-
import { arrowFill,
|
|
7
|
+
import { arrowFill, button_reset, chatFinishDialog, chatNetworkStatus, chat_title, chatbotMenu, chatbotMenuItem, endChatButtonStyle, inline_button, inline_button_wrapper, inputStyle, messageStyle, messagesContainerStyle, notificationStyle, sendButtonStyle, windowBarStyle, windowOpenStyle, windowStyle } from "./ChatWindow.css.js";
|
|
8
8
|
import { useOpenChat } from "./store/chat.js";
|
|
9
9
|
import { useMessages } from "./store/messages.js";
|
|
10
10
|
export {
|
|
@@ -12,7 +12,6 @@ export {
|
|
|
12
12
|
ChatWindow,
|
|
13
13
|
Chatbot,
|
|
14
14
|
arrowFill,
|
|
15
|
-
autoResize,
|
|
16
15
|
bubbleWrapper,
|
|
17
16
|
button_reset,
|
|
18
17
|
chatFinishDialog,
|
package/dist/Chevron/index.js
CHANGED
|
@@ -78,6 +78,7 @@ import "../Chatbot/store/chat.js";
|
|
|
78
78
|
import "../Chatbot/authenticate.js";
|
|
79
79
|
/* empty css */
|
|
80
80
|
import "../Chatbot/store/messages.js";
|
|
81
|
+
import "@ujet/websdk-headless";
|
|
81
82
|
/* empty css */
|
|
82
83
|
import { comparison_layout, comparison_content, headerComparison, feature_header, feature_title, comparison_feature, comparison_list, comparison_buttons, comparison } from "./Comparison.css.js";
|
|
83
84
|
import "next/image.js";
|