@axos-web-dev/shared-components 2.0.0-dev.1 → 2.0.0-dev.2-nav-0
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 +5 -9
- package/dist/Accordion/Accordion.js +3 -3
- package/dist/AlertBanner/index.js +1 -1
- package/dist/Article/Article.d.ts +2 -2
- package/dist/Article/Article.js +14 -3
- package/dist/Auth/ErrorAlert.js +6 -10
- package/dist/Auth/SignInPassword.js +0 -1
- package/dist/BulletItem/BulletItem.js +0 -1
- package/dist/Button/Button.js +5 -10
- package/dist/Calculators/AnnualFeeCalculator/index.js +1 -2
- package/dist/Calculators/ApyCalculator/index.js +4 -2
- package/dist/Calculators/AxosOneCalculator/index.js +16 -9
- package/dist/Calculators/BalanceAPYCalculator/index.js +0 -1
- package/dist/Calculators/BuyDownCalculator/index.js +1 -2
- package/dist/Calculators/Calculator.js +2 -6
- package/dist/Calculators/MarginTradingCalculator/index.js +121 -3
- package/dist/Calculators/MarineLoanMonthlyPaymentCalculator/index.js +1 -2
- package/dist/Calculators/MaxLoanCalculator/index.js +1 -2
- package/dist/Calculators/MonthlyPaymentCalculator/index.js +1 -2
- package/dist/Calculators/MonthlyPaymentLVFCalculator/index.js +1 -2
- package/dist/Calculators/SummitApyCalculator/index.js +3 -2
- package/dist/Carousel/index.js +6 -10
- package/dist/Chatbot/Bubble.js +1 -1
- package/dist/Chatbot/Chat.js +0 -7
- package/dist/Chatbot/ChatWindow.d.ts +2 -0
- package/dist/Chatbot/ChatWindow.js +27 -14
- package/dist/Chatbot/Chatbot.d.ts +1 -1
- package/dist/Chatbot/Chatbot.js +118 -13
- package/dist/Chatbot/ChatbotMessage.d.ts +1 -0
- package/dist/Chatbot/ChatbotMessage.js +42 -22
- package/dist/Chatbot/store/chat.d.ts +6 -0
- package/dist/Chatbot/store/chat.js +14 -2
- package/dist/Chatbot/store/messages.d.ts +1 -0
- package/dist/Chatbot/store/messages.js +5 -2
- package/dist/Chevron/index.js +4 -9
- package/dist/Comparison/Comparison.js +5 -9
- package/dist/ContentBanner/index.js +1 -1
- package/dist/ExecutiveBio/ExecutiveBio.css.d.ts +51 -1
- package/dist/ExecutiveBio/ExecutiveBio.css.js +48 -46
- package/dist/ExecutiveBio/ExecutiveBio.d.ts +1 -1
- package/dist/ExecutiveBio/ExecutiveBio.interface.d.ts +3 -1
- package/dist/ExecutiveBio/ExecutiveBio.js +144 -152
- package/dist/ExecutiveBio/ExecutiveBioSet.d.ts +1 -2
- package/dist/ExecutiveBio/ExecutiveBioSet.js +30 -17
- package/dist/ExecutiveBio/index.js +2 -1
- package/dist/FaqAccordion/index.js +6 -10
- package/dist/FooterDisclosure/FooterDisclosure.js +1 -1
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +85 -185
- package/dist/Forms/ApplicationStart.js +0 -1
- package/dist/Forms/ApplyNow.js +3 -7
- package/dist/Forms/BoatMooringLocation.js +0 -1
- package/dist/Forms/ClearingForm.js +0 -1
- package/dist/Forms/CommercialDeposits.js +0 -1
- package/dist/Forms/CommercialDepositsNoLendingOption.js +0 -1
- package/dist/Forms/CommercialLending.js +0 -1
- package/dist/Forms/CommercialPremiumFinance.js +0 -1
- package/dist/Forms/ConstructionLendingDynamic.d.ts +12 -0
- package/dist/Forms/ConstructionLendingDynamic.js +324 -0
- package/dist/Forms/ContactCompany.js +0 -1
- package/dist/Forms/ContactCompanyTitle.js +0 -1
- package/dist/Forms/ContactUs.js +0 -1
- package/dist/Forms/ContactUsAAS.js +0 -1
- package/dist/Forms/ContactUsBusiness.js +5 -9
- package/dist/Forms/ContactUsBusinessNameEmail.js +5 -9
- package/dist/Forms/ContactUsLVF.js +0 -1
- package/dist/Forms/ContactUsNMLSId.js +5 -9
- package/dist/Forms/CpraRequest.js +101 -3
- package/dist/Forms/CraPublicFile.js +5 -9
- package/dist/Forms/DealerServices.js +0 -1
- package/dist/Forms/EmailOnly.js +12 -11
- package/dist/Forms/EmailUs.js +0 -1
- package/dist/Forms/FormEnums.js +1 -3
- package/dist/Forms/Forms.css.d.ts +1 -1
- package/dist/Forms/Forms.css.js +3 -3
- package/dist/Forms/HoneyPot/index.js +0 -1
- package/dist/Forms/MortgageRate/MortgageRateForm.js +7 -11
- package/dist/Forms/MortgageRate/MortgageRateWatch.js +5 -9
- package/dist/Forms/MortgageWarehouseLending.js +5 -9
- package/dist/Forms/QuickPricer/QuickPricerForm.js +0 -1
- package/dist/Forms/ScheduleCall.js +0 -1
- package/dist/Forms/ScheduleCallPremier.js +0 -1
- package/dist/Forms/SuccesForm.js +5 -9
- package/dist/Forms/VendorQuestionnaire.js +0 -1
- package/dist/Forms/index.d.ts +1 -0
- package/dist/Forms/index.js +2 -1
- package/dist/HeroBanner/HeroBanner.js +2 -2
- package/dist/Hyperlink/index.js +8 -11
- package/dist/IconBillboard/IconBillboard.css.d.ts +1 -0
- package/dist/IconBillboard/IconBillboard.css.js +11 -9
- package/dist/IconBillboard/IconBillboardSet.js +1 -1
- package/dist/IconBillboard/index.js +2 -1
- package/dist/ImageBillboard/ImageBillboard.js +1 -1
- package/dist/ImageBillboard/ImageBillboardSet.js +14 -8
- package/dist/ImageLink/ImageLink.js +5 -9
- package/dist/ImageLink/ImageLinkSet.js +5 -9
- package/dist/ImageLink/index.js +3 -7
- package/dist/Input/Checkbox.js +2 -2
- package/dist/Input/DownPaymentInput.js +1 -1
- package/dist/Input/Dropdown.js +1 -1
- package/dist/Input/Input.js +1 -1
- package/dist/Input/InputTextArea.js +1 -1
- package/dist/Insight/Featured/CategorySelector.js +3 -7
- package/dist/Insight/Featured/Featured.js +7 -11
- package/dist/Insight/Featured/Header.js +5 -9
- package/dist/LandingPageHeader/LandingPageHeader.css.d.ts +19 -1
- package/dist/LandingPageHeader/LandingPageHeader.css.js +6 -6
- package/dist/LandingPageHeader/LandingPageHeader.d.ts +3 -1
- package/dist/LandingPageHeader/LandingPageHeader.js +42 -16
- package/dist/LoadingIndicator/index.js +0 -1
- package/dist/Modal/Modal.js +3 -7
- package/dist/Modal/contextApi/store.d.ts +16 -2
- package/dist/Modal/contextApi/store.js +37 -6
- package/dist/NavigationMenu/AxosALTS/NavData.d.ts +7 -1
- package/dist/NavigationMenu/AxosALTS/NavData.js +6 -137
- package/dist/NavigationMenu/AxosALTS/index.js +12 -13
- package/dist/NavigationMenu/AxosAdvisor/SubNavBar.js +0 -1
- package/dist/NavigationMenu/AxosAdvisor/index.js +0 -1
- package/dist/NavigationMenu/AxosAdvisorServices/SubNavBar.js +0 -1
- package/dist/NavigationMenu/AxosAdvisorServices/index.js +0 -1
- package/dist/NavigationMenu/AxosBank/DropwdownButton.d.ts +7 -0
- package/dist/NavigationMenu/AxosBank/DropwdownButton.js +239 -0
- package/dist/NavigationMenu/AxosBank/Menu.d.ts +37 -0
- package/dist/NavigationMenu/AxosBank/Menu.js +254 -0
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.d.ts +12 -1
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +389 -101
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +50 -17
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +44 -261
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +61 -636
- package/dist/NavigationMenu/AxosBank/MobileMenu/mobileReducer.d.ts +36 -0
- package/dist/NavigationMenu/AxosBank/MobileMenu/mobileReducer.js +105 -0
- package/dist/NavigationMenu/AxosBank/NavBar.module.js +42 -39
- package/dist/NavigationMenu/AxosBank/NavData.d.ts +39 -2
- package/dist/NavigationMenu/AxosBank/NavData.js +34 -166
- package/dist/NavigationMenu/AxosBank/SubNavBar.d.ts +6 -1
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +117 -3102
- package/dist/NavigationMenu/AxosBank/SubNavItem.d.ts +1 -0
- package/dist/NavigationMenu/AxosBank/SubNavItem.js +313 -0
- package/dist/NavigationMenu/AxosBank/index.d.ts +6 -4
- package/dist/NavigationMenu/AxosBank/index.js +87 -392
- package/dist/NavigationMenu/AxosClearing/index.js +0 -1
- package/dist/NavigationMenu/LaVictoire/NavData.d.ts +13 -2
- package/dist/NavigationMenu/LaVictoire/NavData.js +14 -146
- package/dist/NavigationMenu/LaVictoire/SubNavBar.js +4 -1
- package/dist/NavigationMenu/LaVictoire/index.js +18 -42
- package/dist/NavigationMenu/Navbar.d.ts +4 -1
- package/dist/NavigationMenu/Navbar.js +11 -11
- package/dist/NavigationMenu/SignInNavButton.js +18 -25
- package/dist/NavigationMenu/utils.d.ts +465 -0
- package/dist/NavigationMenu/utils.js +112 -0
- package/dist/PageNavItem/PageNavItem.js +1 -1
- package/dist/SetContainer/SetContainer.js +7 -11
- package/dist/SocialMediaBar/iconsRepository.d.ts +44 -14
- package/dist/SocialMediaBar/iconsRepository.js +30 -38
- package/dist/SocialMediaBar/index.js +3 -1
- package/dist/StepItem/StepItem.js +1 -1
- package/dist/StepItemSet/StepItemSet.js +1 -1
- package/dist/Tab/Tab.js +0 -1
- package/dist/Table/Table.js +1 -2
- package/dist/Topic/Topic.js +1 -1
- package/dist/VideoTile/VideoTile.js +2 -6
- package/dist/VideoWrapper/index.js +2 -6
- package/dist/assets/Calculators/ApyCalculator/ApyCalculator.css +1 -1
- package/dist/assets/Calculators/MarginTradingCalculator/MarginTradingCalculator.css +2 -2
- package/dist/assets/Calculators/SummitApyCalculator/BalanceAPYCalculator.css +1 -1
- package/dist/assets/Carousel/Carousel.css +1 -1
- package/dist/assets/Chatbot/AnimatedGradientBorder.css +2 -1
- package/dist/assets/Chatbot/ChatWindow.css +16 -8
- package/dist/assets/DownloadTile/DownloadTile.css +2 -2
- package/dist/assets/ExecutiveBio/ExecutiveBio.css +281 -171
- package/dist/assets/Forms/Forms.css +29 -25
- package/dist/assets/HelpArticle/HelpArticle.css +2 -2
- package/dist/assets/IconBillboard/IconBillboard.css +35 -28
- package/dist/assets/Inputs/Input.css +1 -1
- package/dist/assets/Insight/Featured/CategorySelector.css +1 -1
- package/dist/assets/Insight/Insight.css +4 -4
- package/dist/assets/LandingPageHeader/LandingPageHeader.css +28 -15
- package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css +191 -30
- package/dist/assets/NavigationMenu/AxosBank/NavBar.css +125 -87
- package/dist/assets/Topic/Topic.css +1 -1
- package/dist/assets/Typography/Typography.css +1 -1
- package/dist/assets/VideoTile/VideoTile.css +1 -1
- package/dist/assets/globals.css +24 -14
- package/dist/main.js +8 -3
- package/dist/utils/allowedAxosDomains.d.ts +5 -2
- package/dist/utils/allowedAxosDomains.js +50 -47
- package/dist/utils/appendQueryParams.js +36 -5
- package/dist/utils/index.js +2 -1
- package/dist/utils/validateExternalLinks.d.ts +1 -1
- package/dist/utils/validateExternalLinks.js +4 -6
- package/package.json +1 -1
- package/dist/NavigationMenu/NavDataJson.d.ts +0 -2
- package/dist/NavigationMenu/NavDataJson.js +0 -317
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { button } from "../../Button/Button.css.js";
|
|
4
4
|
import { title } from "../../IconBillboard/IconBillboard.css.js";
|
|
5
|
-
import "../../utils/allowedAxosDomains.js";
|
|
6
5
|
import { getVariant } from "../../utils/getVariant.js";
|
|
7
6
|
import { useState } from "react";
|
|
8
7
|
import clsx from "clsx";
|
|
9
8
|
import { calc_text, description_text, calc_disclosure } from "../BalanceAPYCalculator/BalanceAPYCalculator.css.js";
|
|
10
9
|
import { calculator } from "../calculator.css.js";
|
|
11
|
-
import { calc_container, h2i, inputs_container, input_container, input_box, error_message, hide_select_arrow, calculation_header, payment_results
|
|
10
|
+
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";
|
|
12
11
|
const MarineLoanMonthlyPaymentCalculator = ({ variant, header, disclosure, bodyCopy = true }) => {
|
|
13
12
|
const fullVariant = getVariant(variant);
|
|
14
13
|
const [loanAmountDisplay, setLoanAmountDisplay] = useState("$75,000");
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { button } from "../../Button/Button.css.js";
|
|
4
|
-
import { calc_container, h2i, inputs_container, input_container, input_box, error_message, calculation_header, payment_results
|
|
4
|
+
import { calc_container, container, h2i, inputs_container, input_container, input_box, error_message, calculation_header, payment_results } from "../MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js";
|
|
5
5
|
import { title } from "../../IconBillboard/IconBillboard.css.js";
|
|
6
|
-
import "../../utils/allowedAxosDomains.js";
|
|
7
6
|
import { getVariant } from "../../utils/getVariant.js";
|
|
8
7
|
import { useState } from "react";
|
|
9
8
|
import clsx from "clsx";
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { button } from "../../Button/Button.css.js";
|
|
4
4
|
import { title } from "../../IconBillboard/IconBillboard.css.js";
|
|
5
|
-
import "../../utils/allowedAxosDomains.js";
|
|
6
5
|
import { getVariant } from "../../utils/getVariant.js";
|
|
7
6
|
import { useState } from "react";
|
|
8
7
|
import clsx from "clsx";
|
|
9
8
|
import { calc_text, description_text, calc_disclosure } from "../BalanceAPYCalculator/BalanceAPYCalculator.css.js";
|
|
10
9
|
import { calculator } from "../calculator.css.js";
|
|
11
|
-
import { calc_container, h2i, inputs_container, input_container, input_box, error_message, calculation_header, payment_results
|
|
10
|
+
import { calc_container, container, h2i, inputs_container, input_container, input_box, error_message, calculation_header, payment_results } from "./MonthlyPaymentCalculator.css.js";
|
|
12
11
|
const MonthlyPaymentCalculator = ({
|
|
13
12
|
variant,
|
|
14
13
|
header,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { button } from "../../Button/Button.css.js";
|
|
4
|
-
import "../../utils/allowedAxosDomains.js";
|
|
5
4
|
import { getVariant } from "../../utils/getVariant.js";
|
|
6
5
|
import { useState } from "react";
|
|
7
6
|
import { calc_disclosure } from "../BalanceAPYCalculator/BalanceAPYCalculator.css.js";
|
|
8
|
-
import { calc_content_area, calc_h2, calc_bodycopy, lvf_calc_wrapper, lvf_calc_header, calc_wrapper_inner, calc_input_wrap, rounded_cell, calc_input_styles, error_dialog, results_wrap, result_header, result_value, waves, parallax
|
|
7
|
+
import { bg_vars, calc_content_area, calc_h2, calc_bodycopy, lvf_calc_wrapper, lvf_calc_header, calc_wrapper_inner, calc_input_wrap, rounded_cell, calc_input_styles, error_dialog, results_wrap, result_header, result_value, waves, parallax } from "./MonthlyPaymentCalculator.css.js";
|
|
9
8
|
const MonthlyPaymentLVFCalculator = ({ variant, header, bodyCopy, disclosure }) => {
|
|
10
9
|
const theme = getVariant(variant);
|
|
11
10
|
const [loanAmountMasked, setLoanAmountMasked] = useState("50,000");
|
|
@@ -16,8 +16,8 @@ import '../../assets/icons/FollowIcon/FollowIcon.css';import '../../assets/icons
|
|
|
16
16
|
/* empty css */
|
|
17
17
|
import { Table, TableHead, TableRow, TableCell, TableBody } from "../../Table/Table.js";
|
|
18
18
|
import { headerCell } from "../../Table/Table.css.js";
|
|
19
|
-
import "../../utils/allowedAxosDomains.js";
|
|
20
19
|
import { getVariant } from "../../utils/getVariant.js";
|
|
20
|
+
import { useGlobalContext } from "../../Modal/contextApi/store.js";
|
|
21
21
|
import clsx from "clsx";
|
|
22
22
|
import { summit_container, summit_calc_icon, summit_header_container, summit_header_calc, summit_calc_text, summit_description_text, summit_calculator_wrapper, summit_input_container, summit_input_label, summit_d_label, summit_m_label, summit_calculator_input, summit_calculator_button, focus_row, summit_table_container, summit_calc_disclosure } from "./BalanceAPYCalculator.css.js";
|
|
23
23
|
const SummitApyCalculator = ({
|
|
@@ -27,8 +27,9 @@ const SummitApyCalculator = ({
|
|
|
27
27
|
icon,
|
|
28
28
|
variant
|
|
29
29
|
}) => {
|
|
30
|
+
const { domains } = useGlobalContext();
|
|
30
31
|
const calc_variant = getVariant(variant);
|
|
31
|
-
const SUMMIT_APY =
|
|
32
|
+
const SUMMIT_APY = Number(domains.SUMMIT_SAVINGS_APY);
|
|
32
33
|
const [balance, setBalance] = useState(1e4);
|
|
33
34
|
const [axbAPY, _setAxbAPY] = useState(SUMMIT_APY);
|
|
34
35
|
const [axbEarning, setAxbEarning] = useState(
|
package/dist/Carousel/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { getVariant } from "../utils/getVariant.js";
|
|
|
6
6
|
import { section_text } from "../IconBillboard/IconBillboard.css.js";
|
|
7
7
|
import "../icons/ArrowIcon/ArrowIcon.css.js";
|
|
8
8
|
import "../icons/CheckIcon/CheckIcon.css.js";
|
|
9
|
-
import '../assets/VideoWrapper/VideoWrapper.css';import '../assets/TopicalNavSet/TopicalNavSet.css';import '../assets/TopicalNavItem/TopicalNavItem.css';import '../assets/Topic/Topic.css';import '../assets/TextBlock/TextBlock.css';import '../assets/SocialMediaBar/SocialMediaBar.css';import '../assets/SecondaryFooter/SecondaryFooter.css';import '../assets/Pagination/Pagination.css';import '../assets/PageNavSet/PageNavigationSet.css';import '../assets/NavigationMenu/LaVictoire/NavBar2.css';import '../assets/NavigationMenu/AxosALTS/NavBar2.css';import '../assets/NavigationMenu/AxosClearing/NavBar2.css';import '../assets/NavigationMenu/AxosBank/SubNavbar.css';import '../assets/NavigationMenu/AxosBank/NavBar2.css';import '../assets/NavigationMenu/AxosAdvisorServices/SubNavbar.css';import '../assets/NavigationMenu/AxosAdvisorServices/NavBar2.css';import '../assets/NavigationMenu/AxosAdvisor/SubNavbar.css';import '../assets/NavigationMenu/AxosAdvisor/NavBar2.css';import '../assets/Insight/Featured/Header.css';import '../assets/Insight/Featured/CategorySelector.css';import '../assets/Insight/Featured/Featured.css';import '../assets/ImageLink/ImageLink.css';import '../assets/VideoTile/VideoTile.css';import '../assets/HelpArticle/HelpArticle.css';import '../assets/FooterSiteMap/AxosBank/FooterSiteMap.css';import '../assets/FooterDisclosure/LVF/LaVictorieFooter.css';import '../assets/DownloadTile/DownloadTile.css';import '../assets/CollectInformationAlert/CollectInformationAlert.css';import '../assets/Chatbot/ChatWindow.css';import '../assets/Chatbot/Chatbot.css';import '../assets/Chatbot/Bubble.css';import '../assets/Chatbot/AnimatedGradientBorder.css';import '../assets/CallToActionBar/CallToActionBar.css';import '../assets/Insight/Insight.css';import '../assets/AwardsItem/AwardsItem.css';import '../assets/AwardsBanner/AwardsBanner.css';import '../assets/Auth/SignIn.css';import '../assets/Auth/ErrorAlert.css';import '../assets/Calculators/MarginTradingCalculator/MarginTradingCalculator.css';import '../assets/Forms/QuickPricer/UserInformation.css';import '../assets/
|
|
9
|
+
import '../assets/VideoWrapper/VideoWrapper.css';import '../assets/TopicalNavSet/TopicalNavSet.css';import '../assets/TopicalNavItem/TopicalNavItem.css';import '../assets/Topic/Topic.css';import '../assets/TextBlock/TextBlock.css';import '../assets/SocialMediaBar/SocialMediaBar.css';import '../assets/SecondaryFooter/SecondaryFooter.css';import '../assets/Pagination/Pagination.css';import '../assets/PageNavSet/PageNavigationSet.css';import '../assets/NavigationMenu/LaVictoire/NavBar2.css';import '../assets/NavigationMenu/AxosALTS/NavBar2.css';import '../assets/NavigationMenu/AxosClearing/NavBar2.css';import '../assets/NavigationMenu/AxosBank/SubNavbar.css';import '../assets/NavigationMenu/AxosBank/NavBar2.css';import '../assets/NavigationMenu/AxosAdvisorServices/SubNavbar.css';import '../assets/NavigationMenu/AxosAdvisorServices/NavBar2.css';import '../assets/NavigationMenu/AxosAdvisor/SubNavbar.css';import '../assets/NavigationMenu/AxosAdvisor/NavBar2.css';import '../assets/Insight/Featured/Header.css';import '../assets/Insight/Featured/CategorySelector.css';import '../assets/Insight/Featured/Featured.css';import '../assets/ImageLink/ImageLink.css';import '../assets/VideoTile/VideoTile.css';import '../assets/HelpArticle/HelpArticle.css';import '../assets/FooterSiteMap/AxosBank/FooterSiteMap.css';import '../assets/FooterDisclosure/LVF/LaVictorieFooter.css';import '../assets/DownloadTile/DownloadTile.css';import '../assets/CollectInformationAlert/CollectInformationAlert.css';import '../assets/Chatbot/ChatWindow.css';import '../assets/Chatbot/Chatbot.css';import '../assets/Chatbot/Bubble.css';import '../assets/Chatbot/AnimatedGradientBorder.css';import '../assets/CallToActionBar/CallToActionBar.css';import '../assets/Insight/Insight.css';import '../assets/AwardsItem/AwardsItem.css';import '../assets/AwardsBanner/AwardsBanner.css';import '../assets/Auth/SignIn.css';import '../assets/Auth/ErrorAlert.css';import '../assets/Calculators/MarginTradingCalculator/MarginTradingCalculator.css';import '../assets/Forms/QuickPricer/UserInformation.css';import '../assets/Forms/QuickPricer/QuickPricerResults.css';import '../assets/Modal/Modal.css';import '../assets/BulletItem/BulletItem.css';import '../assets/Typography/Typography.css';import '../assets/icons/FollowIcon/FollowIcon.css';import '../assets/icons/DownloadIcon/DownloadIcon.css';import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
11
|
/* empty css */
|
|
12
12
|
/* empty css */
|
|
@@ -15,7 +15,6 @@ import '../assets/VideoWrapper/VideoWrapper.css';import '../assets/TopicalNavSet
|
|
|
15
15
|
import SvgQuoteIconGrey from "../icons/QuoteIconGrey.js";
|
|
16
16
|
import SvgQuoteIconWhite from "../icons/QuoteIconWhite.js";
|
|
17
17
|
import SvgQuoteIconYellow from "../icons/QuoteIconYellow.js";
|
|
18
|
-
import "../utils/allowedAxosDomains.js";
|
|
19
18
|
/* empty css */
|
|
20
19
|
/* empty css */
|
|
21
20
|
import "../Accordion/Accordion.js";
|
|
@@ -26,6 +25,7 @@ import "../ArticlesSet/ArticlesSet.css.js";
|
|
|
26
25
|
import "../Calculators/calculator.css.js";
|
|
27
26
|
import "../Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js";
|
|
28
27
|
import "../Button/Button.css.js";
|
|
28
|
+
import "../Modal/contextApi/store.js";
|
|
29
29
|
import "../Calculators/ApyCalculator/ApyCalculator.css.js";
|
|
30
30
|
import "../Table/Table.css.js";
|
|
31
31
|
import "../Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js";
|
|
@@ -53,11 +53,10 @@ import "../Input/Checkbox.css.js";
|
|
|
53
53
|
import "../LoadingIndicator/LoadingIndicator.css.js";
|
|
54
54
|
import "react-use";
|
|
55
55
|
import "../Chevron/Chevron.css.js";
|
|
56
|
+
/* empty css */
|
|
56
57
|
import "../Interstitial/Interstitial-variants.css.js";
|
|
57
58
|
import "../Inputs/Input.css.js";
|
|
58
59
|
/* empty css */
|
|
59
|
-
/* empty css */
|
|
60
|
-
import "../Modal/contextApi/store.js";
|
|
61
60
|
import "../Hyperlink/Hyperlink.css.js";
|
|
62
61
|
/* empty css */
|
|
63
62
|
import "iframe-resizer";
|
|
@@ -110,16 +109,13 @@ import "next/navigation.js";
|
|
|
110
109
|
/* empty css */
|
|
111
110
|
/* empty css */
|
|
112
111
|
/* empty css */
|
|
113
|
-
import "next/link.js";
|
|
114
|
-
import "../NavigationMenu/AxosBank/MobileMenu/MobileNavData.js";
|
|
115
112
|
/* empty css */
|
|
116
|
-
import "
|
|
113
|
+
import "next/link.js";
|
|
114
|
+
import "../NavigationMenu/AxosBank/Menu.js";
|
|
117
115
|
/* empty css */
|
|
118
116
|
/* empty css */
|
|
119
|
-
import "../NavigationMenu/AxosALTS/NavData.js";
|
|
120
117
|
/* empty css */
|
|
121
118
|
/* empty css */
|
|
122
|
-
import "../NavigationMenu/LaVictoire/NavData.js";
|
|
123
119
|
import "../PageNavItem/PageNavItem.css.js";
|
|
124
120
|
import "react-slick";
|
|
125
121
|
/* empty css */
|
|
@@ -133,7 +129,7 @@ import "../StepItemSet/StepItemSet.css.js";
|
|
|
133
129
|
/* empty css */
|
|
134
130
|
/* empty css */
|
|
135
131
|
/* empty css */
|
|
136
|
-
import { icon,
|
|
132
|
+
import { icon, slide, authorLocation, author, quoteSetContainer, headerCarousel, descriptionCarousel, slides, carousel, dots, dot } from "./Carousel.css.js";
|
|
137
133
|
import { useCarousel } from "./store.js";
|
|
138
134
|
const iconVarints = /* @__PURE__ */ new Map([
|
|
139
135
|
[
|
package/dist/Chatbot/Bubble.js
CHANGED
package/dist/Chatbot/Chat.js
CHANGED
|
@@ -33,7 +33,6 @@ function Chat() {
|
|
|
33
33
|
let chatConnectedHandler;
|
|
34
34
|
async function initChat() {
|
|
35
35
|
const { Client, consoleLoggerHandler, Logger } = await import("@ujet/websdk-headless");
|
|
36
|
-
console.log("this", isMounted);
|
|
37
36
|
Logger.addHandler(consoleLoggerHandler);
|
|
38
37
|
clientRef.current = new Client({
|
|
39
38
|
companyId,
|
|
@@ -71,14 +70,11 @@ function Chat() {
|
|
|
71
70
|
menus?.menus[5].id
|
|
72
71
|
);
|
|
73
72
|
}
|
|
74
|
-
console.log("this");
|
|
75
73
|
identityHandler = (identity) => {
|
|
76
74
|
if (!isMounted.current) return;
|
|
77
75
|
console.log("identity:", identity);
|
|
78
76
|
};
|
|
79
77
|
messageHandler = (msg) => {
|
|
80
|
-
console.log("new message:", msg);
|
|
81
|
-
console.log("addMessage:", msg);
|
|
82
78
|
addMessage(msg);
|
|
83
79
|
};
|
|
84
80
|
chatUpdatedHandler = (chat) => {
|
|
@@ -87,13 +83,11 @@ function Chat() {
|
|
|
87
83
|
chatConnectedHandler = async () => {
|
|
88
84
|
console.log("connected");
|
|
89
85
|
const messagesFetched = await clientRef.current?.fetchMessages();
|
|
90
|
-
console.log("[messages]:", messagesFetched);
|
|
91
86
|
addMessages(messagesFetched || []);
|
|
92
87
|
};
|
|
93
88
|
memberJoinedHandler = (identity) => {
|
|
94
89
|
console.log("member joined:", identity);
|
|
95
90
|
};
|
|
96
|
-
console.log(isMounted.current);
|
|
97
91
|
clientRef.current?.on("authenticated", () => {
|
|
98
92
|
console.log("authenticated");
|
|
99
93
|
});
|
|
@@ -144,7 +138,6 @@ function Chat() {
|
|
|
144
138
|
const form = e.target;
|
|
145
139
|
const input = form.elements[0];
|
|
146
140
|
const message = input.value;
|
|
147
|
-
console.log("Sending message:", message);
|
|
148
141
|
try {
|
|
149
142
|
await clientRef.current?.sendTextMessage(message);
|
|
150
143
|
input.value = "";
|
|
@@ -24,6 +24,8 @@ interface ChatWindowProps {
|
|
|
24
24
|
showName?: boolean;
|
|
25
25
|
onNewChat?: () => void;
|
|
26
26
|
onCloseAfterThankYou?: () => void;
|
|
27
|
+
isTyping?: boolean;
|
|
28
|
+
previewTyping?: (msg: string) => void;
|
|
27
29
|
}
|
|
28
30
|
export declare const ChatWindow: React.FC<ChatWindowProps>;
|
|
29
31
|
export {};
|
|
@@ -32,9 +32,19 @@ const ChatWindow = ({
|
|
|
32
32
|
showName = false,
|
|
33
33
|
onCloseAfterThankYou = () => {
|
|
34
34
|
console.log("Close after thank you");
|
|
35
|
+
},
|
|
36
|
+
previewTyping = (msg) => {
|
|
37
|
+
console.log("Preview typing: ", msg);
|
|
35
38
|
}
|
|
36
39
|
}) => {
|
|
37
|
-
const {
|
|
40
|
+
const {
|
|
41
|
+
showThankyouMessage,
|
|
42
|
+
displayThankyouMessage,
|
|
43
|
+
toggleThankyouMessage,
|
|
44
|
+
hasEscalated,
|
|
45
|
+
isBlockedInput,
|
|
46
|
+
isOpen
|
|
47
|
+
} = useOpenChat();
|
|
38
48
|
const [mounted, setMounted] = React.useState(false);
|
|
39
49
|
const [menuOpen, setMenuOpen] = React.useState(false);
|
|
40
50
|
const [showEndChatDialog, setShowEndChatDialog] = React.useState(false);
|
|
@@ -42,14 +52,14 @@ const ChatWindow = ({
|
|
|
42
52
|
const [input, setInput] = React.useState("");
|
|
43
53
|
const messagesEndRef = useRef(null);
|
|
44
54
|
const inputRef = useRef(null);
|
|
45
|
-
const isOpen = useOpenChat((state2) => state2.isOpen);
|
|
46
55
|
useEffect(() => {
|
|
47
56
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
48
57
|
}, [messages]);
|
|
49
58
|
const handleSend = (e) => {
|
|
50
59
|
e.preventDefault();
|
|
51
60
|
const cleaned = cleanInput(input);
|
|
52
|
-
if (
|
|
61
|
+
if (isBlockedInput) return;
|
|
62
|
+
if (cleaned != "") {
|
|
53
63
|
onSend(cleaned);
|
|
54
64
|
setInput("");
|
|
55
65
|
}
|
|
@@ -128,7 +138,7 @@ const ChatWindow = ({
|
|
|
128
138
|
]
|
|
129
139
|
}
|
|
130
140
|
),
|
|
131
|
-
/* @__PURE__ */ jsx("h2", { className: chat_title, children: "Ask
|
|
141
|
+
/* @__PURE__ */ jsx("h2", { className: chat_title, children: "Ask Evo AI" })
|
|
132
142
|
]
|
|
133
143
|
}
|
|
134
144
|
),
|
|
@@ -136,6 +146,7 @@ const ChatWindow = ({
|
|
|
136
146
|
/* @__PURE__ */ jsx(
|
|
137
147
|
"button",
|
|
138
148
|
{
|
|
149
|
+
disabled: messages.length === 0,
|
|
139
150
|
onClick: () => {
|
|
140
151
|
setMenuOpen(!menuOpen);
|
|
141
152
|
},
|
|
@@ -417,7 +428,11 @@ const ChatWindow = ({
|
|
|
417
428
|
showAvatar,
|
|
418
429
|
showName,
|
|
419
430
|
virtualAgent,
|
|
420
|
-
onCancelEndChat
|
|
431
|
+
onCancelEndChat,
|
|
432
|
+
onEndChat: () => {
|
|
433
|
+
endChat();
|
|
434
|
+
onCloseAfterThankYou();
|
|
435
|
+
}
|
|
421
436
|
},
|
|
422
437
|
msg?.$index
|
|
423
438
|
)),
|
|
@@ -438,7 +453,7 @@ const ChatWindow = ({
|
|
|
438
453
|
style: {
|
|
439
454
|
display: "flex",
|
|
440
455
|
padding: "12px 16px",
|
|
441
|
-
background: "#ffffff",
|
|
456
|
+
background: isBlockedInput || inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected ? "light-dark(rgba(239, 239, 239, 0.3), rgba(59, 59, 59, 0.3))" : "#ffffff",
|
|
442
457
|
borderRadius: 12
|
|
443
458
|
},
|
|
444
459
|
children: [
|
|
@@ -449,19 +464,17 @@ const ChatWindow = ({
|
|
|
449
464
|
value: input,
|
|
450
465
|
onChange: (e) => setInput(e.target.value),
|
|
451
466
|
onKeyDown: (e) => {
|
|
467
|
+
if (hasEscalated) {
|
|
468
|
+
previewTyping(e.target?.value);
|
|
469
|
+
}
|
|
452
470
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
453
|
-
e
|
|
454
|
-
const cleaned = cleanInput(input);
|
|
455
|
-
if (cleaned) {
|
|
456
|
-
onSend(cleaned);
|
|
457
|
-
setInput("");
|
|
458
|
-
}
|
|
471
|
+
handleSend(e);
|
|
459
472
|
}
|
|
460
473
|
},
|
|
461
474
|
placeholder: "Ask anything...",
|
|
462
475
|
className: clsx(inputStyle, autoResize),
|
|
463
476
|
autoFocus: true,
|
|
464
|
-
disabled: inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected,
|
|
477
|
+
disabled: isBlockedInput || inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected,
|
|
465
478
|
rows: 1
|
|
466
479
|
}
|
|
467
480
|
),
|
|
@@ -474,7 +487,7 @@ const ChatWindow = ({
|
|
|
474
487
|
),
|
|
475
488
|
type: "submit",
|
|
476
489
|
title: "Send message",
|
|
477
|
-
disabled: inputDisabled || status !== "connected" || !input.trim() || messages.length == 0 || escalationDeflected,
|
|
490
|
+
disabled: isBlockedInput || inputDisabled || status !== "connected" || !input.trim() || messages.length == 0 || escalationDeflected,
|
|
478
491
|
children: /* @__PURE__ */ jsx(
|
|
479
492
|
"svg",
|
|
480
493
|
{
|
|
@@ -7,4 +7,4 @@ export declare const Chatbot: ({ project, projectEnv, menuOption, debug, }: {
|
|
|
7
7
|
projectEnv?: "dev" | "qa" | "uat" | "stg" | "prod";
|
|
8
8
|
menuOption?: "Support Virtual Agent" | string;
|
|
9
9
|
debug?: boolean;
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
}) => false | import("react/jsx-runtime").JSX.Element;
|
package/dist/Chatbot/Chatbot.js
CHANGED
|
@@ -14,7 +14,16 @@ const Chatbot = ({
|
|
|
14
14
|
menuOption = "Support Virtual Agent",
|
|
15
15
|
debug = false
|
|
16
16
|
}) => {
|
|
17
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
hasOpenedOnce,
|
|
19
|
+
toggle,
|
|
20
|
+
reset,
|
|
21
|
+
startEscalation,
|
|
22
|
+
hasEscalated,
|
|
23
|
+
endEscalation,
|
|
24
|
+
unblockInput,
|
|
25
|
+
blockInput
|
|
26
|
+
} = useOpenChat();
|
|
18
27
|
const { addMessage, addMessages, clearMessages, messages } = useMessages();
|
|
19
28
|
const clientRef = useRef(null);
|
|
20
29
|
const menuRef = useRef(null);
|
|
@@ -26,6 +35,20 @@ const Chatbot = ({
|
|
|
26
35
|
const [hasStarted, setHasStarted] = useState(false);
|
|
27
36
|
const [menusLoaded, setMenusLoaded] = useState(false);
|
|
28
37
|
const [pendingStart, setPendingStart] = useState(false);
|
|
38
|
+
const [isTyping, setIsTyping] = useState(false);
|
|
39
|
+
const [scalationStarted, setScalationStarted] = useState(false);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (messages.length === 0) return;
|
|
42
|
+
const hasScalation = messages.some(
|
|
43
|
+
(msg) => msg.$userType === "user" || ["escalationAccepted", "escalationStarted"].includes(
|
|
44
|
+
msg.event
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
setScalationStarted(hasScalation);
|
|
48
|
+
return () => {
|
|
49
|
+
setScalationStarted(false);
|
|
50
|
+
};
|
|
51
|
+
}, [messages]);
|
|
29
52
|
const brandMap = /* @__PURE__ */ new Map([
|
|
30
53
|
["axos", 1],
|
|
31
54
|
["ufb", 3]
|
|
@@ -33,8 +56,7 @@ const Chatbot = ({
|
|
|
33
56
|
const typingMessage = {
|
|
34
57
|
$sid: "typing-1",
|
|
35
58
|
type: "system",
|
|
36
|
-
|
|
37
|
-
text: "AI is typing...",
|
|
59
|
+
text: scalationStarted ? "Typing" : "AI is typing...",
|
|
38
60
|
sender: { id: "system", type: "system" },
|
|
39
61
|
$timestamp: /* @__PURE__ */ new Date(),
|
|
40
62
|
$userType: "system",
|
|
@@ -77,13 +99,44 @@ const Chatbot = ({
|
|
|
77
99
|
};
|
|
78
100
|
const onChatMessageHandler = async (message) => {
|
|
79
101
|
console.log("Received message:", message);
|
|
80
|
-
|
|
81
|
-
if (
|
|
82
|
-
addMessage(
|
|
102
|
+
const { event, $userType } = message;
|
|
103
|
+
if (["system", "virtual_agent", "user"].includes($userType) && event === void 0) {
|
|
104
|
+
addMessage(message);
|
|
105
|
+
if (!hasEscalated) {
|
|
106
|
+
unblockInput?.();
|
|
107
|
+
}
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
switch (event) {
|
|
111
|
+
case "escalationAccepted":
|
|
112
|
+
case "escalationStarted":
|
|
113
|
+
setScalationStarted(true);
|
|
114
|
+
startEscalation?.();
|
|
115
|
+
addMessage(message);
|
|
116
|
+
return;
|
|
117
|
+
case "escalationEnded":
|
|
118
|
+
case "escalationFailed": {
|
|
119
|
+
endEscalation?.();
|
|
120
|
+
addMessage(message);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
default:
|
|
124
|
+
addMessage(message);
|
|
125
|
+
if (["end_user"].includes(message.$userType)) {
|
|
126
|
+
if (!hasEscalated) {
|
|
127
|
+
addMessage(typingMessage);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return;
|
|
83
131
|
}
|
|
84
132
|
};
|
|
85
133
|
const onChatTypingStartedHandler = async (identity) => {
|
|
86
134
|
console.log("Typing started by:", identity);
|
|
135
|
+
setIsTyping(true);
|
|
136
|
+
};
|
|
137
|
+
const onChatTypingEndedHandler = async (identity) => {
|
|
138
|
+
console.log("Typing ended by:", identity);
|
|
139
|
+
setIsTyping(false);
|
|
87
140
|
};
|
|
88
141
|
const onChatDisconnectedHandler = async () => {
|
|
89
142
|
console.log("Chat disconnected");
|
|
@@ -105,23 +158,47 @@ const Chatbot = ({
|
|
|
105
158
|
const onChatMemberLeftHandler = async (identity) => {
|
|
106
159
|
console.log("Chat member left:", identity);
|
|
107
160
|
};
|
|
161
|
+
const onChatMemberJoinedHandler = async (identity) => {
|
|
162
|
+
console.log("Chat member joined:", identity);
|
|
163
|
+
};
|
|
108
164
|
const onChatConnectedHandler = async () => {
|
|
109
165
|
setStatus("connected");
|
|
110
166
|
console.log("connected");
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
167
|
+
try {
|
|
168
|
+
if (!clientRef.current) {
|
|
169
|
+
console.error("Client not initialized on chat connected");
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const messages2 = await clientRef.current?.fetchMessages();
|
|
173
|
+
console.log("Fetched messages on chat connected:", messages2);
|
|
174
|
+
if (messages2) {
|
|
175
|
+
addMessages(messages2);
|
|
176
|
+
const hasEscalation = messages2.some(
|
|
177
|
+
(msg) => msg.$userType === "user" || ["escalationAccepted", "escalationStarted"].includes(
|
|
178
|
+
msg.event
|
|
179
|
+
)
|
|
180
|
+
);
|
|
181
|
+
console.log(hasEscalation);
|
|
182
|
+
if (hasEscalation) {
|
|
183
|
+
setScalationStarted(true);
|
|
184
|
+
startEscalation?.();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
} catch (error) {
|
|
188
|
+
console.error("Error fetching messages on chat connected:", error);
|
|
114
189
|
}
|
|
115
190
|
};
|
|
116
191
|
const registerEventHandlers = () => {
|
|
117
192
|
clientRef.current?.on("chat.ongoing", onChatOngoingHandler);
|
|
118
193
|
clientRef.current?.on("chat.message", onChatMessageHandler);
|
|
119
194
|
clientRef.current?.on("chat.typingStarted", onChatTypingStartedHandler);
|
|
195
|
+
clientRef.current?.on("chat.typingEnded", onChatTypingEndedHandler);
|
|
120
196
|
clientRef.current?.on("chat.disconnected", onChatDisconnectedHandler);
|
|
121
197
|
clientRef.current?.on("chat.dismissed", onDismissedHandler);
|
|
122
198
|
clientRef.current?.on("chat.timeout", onTimeoutHandler);
|
|
123
199
|
clientRef.current?.on("chat.ended", onEndedHandler);
|
|
124
200
|
clientRef.current?.on("chat.destroyed", onDestroyedHandler);
|
|
201
|
+
clientRef.current?.on("chat.memberJoined", onChatMemberJoinedHandler);
|
|
125
202
|
clientRef.current?.on("chat.memberLeft", onChatMemberLeftHandler);
|
|
126
203
|
clientRef?.current?.on("chat.connected", onChatConnectedHandler);
|
|
127
204
|
};
|
|
@@ -131,12 +208,14 @@ const Chatbot = ({
|
|
|
131
208
|
clientRef.current?.off("chat.ongoing", onDismissedHandler);
|
|
132
209
|
clientRef.current?.off("chat.message", onChatMessageHandler);
|
|
133
210
|
clientRef.current?.off("chat.typingStarted", onChatTypingStartedHandler);
|
|
211
|
+
clientRef.current?.off("chat.typingEnded", onChatTypingEndedHandler);
|
|
134
212
|
clientRef.current?.off("chat.disconnected", onChatDisconnectedHandler);
|
|
135
213
|
clientRef.current?.off("chat.dismissed", onDismissedHandler);
|
|
136
214
|
clientRef.current?.off("chat.timeout", onTimeoutHandler);
|
|
137
215
|
clientRef.current?.off("chat.ended", onEndedHandler);
|
|
138
216
|
clientRef.current?.off("chat.destroyed", onDestroyedHandler);
|
|
139
217
|
clientRef.current?.off("chat.memberLeft", onChatMemberLeftHandler);
|
|
218
|
+
clientRef.current?.off("chat.memberJoined", onChatMemberJoinedHandler);
|
|
140
219
|
clientRef.current?.off("chat.connected", onChatConnectedHandler);
|
|
141
220
|
};
|
|
142
221
|
const createClient = async () => {
|
|
@@ -150,6 +229,9 @@ const Chatbot = ({
|
|
|
150
229
|
tenant: process.env.CCAI_TENANT_NAME || "",
|
|
151
230
|
host: process.env.CCAI_HOST || "",
|
|
152
231
|
// or your region
|
|
232
|
+
// companyId: import.meta.env.VITE_COMPANY_ID || "",
|
|
233
|
+
// tenant: import.meta.env.VITE_TENANT_NAME || "",
|
|
234
|
+
// host: import.meta.env.VITE_HOST || "", // or your region
|
|
153
235
|
authenticate
|
|
154
236
|
});
|
|
155
237
|
client?.on("ready", onReadyHandler);
|
|
@@ -210,9 +292,17 @@ const Chatbot = ({
|
|
|
210
292
|
setHasStarted(true);
|
|
211
293
|
}
|
|
212
294
|
};
|
|
213
|
-
const onSendMessage = (msg) => {
|
|
295
|
+
const onSendMessage = async (msg) => {
|
|
214
296
|
console.log("Sending message:", msg);
|
|
215
|
-
|
|
297
|
+
try {
|
|
298
|
+
await clientRef.current?.sendTextMessage(msg);
|
|
299
|
+
} catch (error) {
|
|
300
|
+
console.log(error);
|
|
301
|
+
} finally {
|
|
302
|
+
if (!hasEscalated) {
|
|
303
|
+
blockInput?.();
|
|
304
|
+
}
|
|
305
|
+
}
|
|
216
306
|
};
|
|
217
307
|
const onEndChat = async () => {
|
|
218
308
|
console.log("Ending chat");
|
|
@@ -223,6 +313,7 @@ const Chatbot = ({
|
|
|
223
313
|
chatRef.current = null;
|
|
224
314
|
console.log("Chat ended");
|
|
225
315
|
setHasStarted(false);
|
|
316
|
+
endEscalation?.();
|
|
226
317
|
}
|
|
227
318
|
};
|
|
228
319
|
const onEndAndStartNewChat = async () => {
|
|
@@ -251,6 +342,7 @@ const Chatbot = ({
|
|
|
251
342
|
setHasStarted(false);
|
|
252
343
|
setStatus("idle");
|
|
253
344
|
clearMessages();
|
|
345
|
+
endEscalation?.();
|
|
254
346
|
clientRef.current?.destroy();
|
|
255
347
|
clientRef.current?.destroyChat();
|
|
256
348
|
clientRef.current = null;
|
|
@@ -262,7 +354,18 @@ const Chatbot = ({
|
|
|
262
354
|
reset();
|
|
263
355
|
setHasStarted(false);
|
|
264
356
|
};
|
|
265
|
-
|
|
357
|
+
const onPreviewTyping = async (msg) => {
|
|
358
|
+
console.log("Preview typing message:", msg);
|
|
359
|
+
try {
|
|
360
|
+
if (clientRef.current) {
|
|
361
|
+
chatRef.current?.startTyping();
|
|
362
|
+
await clientRef.current?.sendPreviewMessage(msg);
|
|
363
|
+
}
|
|
364
|
+
} catch (error) {
|
|
365
|
+
console.error("Error sending preview message:", error);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
return menusLoaded && /* @__PURE__ */ jsxs("div", { className: project === "ufb" ? chatbotUFB : chatbotAXB, children: [
|
|
266
369
|
/* @__PURE__ */ jsx(Bubble, { onClick: handleClick }),
|
|
267
370
|
/* @__PURE__ */ jsx(
|
|
268
371
|
ChatWindow,
|
|
@@ -274,7 +377,9 @@ const Chatbot = ({
|
|
|
274
377
|
endChat: onEndChat,
|
|
275
378
|
onClose,
|
|
276
379
|
onNewChat: onEndAndStartNewChat,
|
|
277
|
-
onCloseAfterThankYou
|
|
380
|
+
onCloseAfterThankYou,
|
|
381
|
+
previewTyping: onPreviewTyping,
|
|
382
|
+
isTyping
|
|
278
383
|
}
|
|
279
384
|
)
|
|
280
385
|
] });
|