@axos-web-dev/shared-components 2.2.5 → 2.2.7

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.
Files changed (207) hide show
  1. package/dist/ATMLocator/ATMLocator.d.ts +1 -1
  2. package/dist/ATMLocator/ATMLocator.js +3 -2
  3. package/dist/Accordion/Accordion.d.ts +3 -3
  4. package/dist/Article/Article.d.ts +1 -1
  5. package/dist/Auth/ErrorAlert.d.ts +1 -1
  6. package/dist/Auth/ErrorAlert.js +4 -3
  7. package/dist/Auth/Logout.d.ts +1 -1
  8. package/dist/Auth/SignInPassword.d.ts +1 -1
  9. package/dist/BulletItem/BulletItem.d.ts +1 -1
  10. package/dist/Button/Button.d.ts +1 -1
  11. package/dist/Button/Button.js +3 -2
  12. package/dist/Button/GoBackButton.d.ts +1 -1
  13. package/dist/Calculators/Calculator.d.ts +1 -1
  14. package/dist/Calculators/Calculator.js +4 -3
  15. package/dist/Calculators/MarginTradingCalculator/index.js +3 -2
  16. package/dist/Carousel/index.d.ts +3 -3
  17. package/dist/Carousel/index.js +3 -2
  18. package/dist/Chatbot/AnimatedGradientBorder.css.d.ts +5 -0
  19. package/dist/Chatbot/AnimatedGradientBorder.css.js +13 -3
  20. package/dist/Chatbot/AudioManager.d.ts +19 -0
  21. package/dist/Chatbot/AudioManager.js +61 -0
  22. package/dist/Chatbot/Bubble.css.js +1 -0
  23. package/dist/Chatbot/Bubble.d.ts +1 -1
  24. package/dist/Chatbot/Chat.d.ts +1 -1
  25. package/dist/Chatbot/ChatWindow.css.d.ts +8 -0
  26. package/dist/Chatbot/ChatWindow.css.js +49 -33
  27. package/dist/Chatbot/ChatWindow.js +457 -372
  28. package/dist/Chatbot/Chatbot.css.js +0 -1
  29. package/dist/Chatbot/Chatbot.css.ts.vanilla.css.js +1 -0
  30. package/dist/Chatbot/Chatbot.d.ts +4 -1
  31. package/dist/Chatbot/Chatbot.js +71 -21
  32. package/dist/Chatbot/ChatbotMessage.js +184 -159
  33. package/dist/Chatbot/EllipsisAnimation.d.ts +1 -1
  34. package/dist/Chatbot/EllipsisAnimation.js +0 -6
  35. package/dist/Chatbot/EllipsisIcon.d.ts +1 -1
  36. package/dist/Chatbot/ExpandChatToggle.d.ts +8 -0
  37. package/dist/Chatbot/ExpandChatToggle.js +74 -0
  38. package/dist/Chatbot/index.js +11 -2
  39. package/dist/Chatbot/store/chat.d.ts +8 -0
  40. package/dist/Chatbot/store/chat.js +14 -2
  41. package/dist/Chevron/index.js +3 -2
  42. package/dist/Comparison/Comparison.d.ts +1 -1
  43. package/dist/Comparison/Comparison.js +3 -2
  44. package/dist/Comparison/ComparisonSet.d.ts +1 -1
  45. package/dist/ExecutiveBio/ExecutiveBio.d.ts +1 -1
  46. package/dist/ExecutiveBio/ExecutiveBio.js +3 -2
  47. package/dist/ExecutiveBio/ExecutiveBioSet.d.ts +1 -1
  48. package/dist/ExecutiveBio/Overlay.d.ts +1 -1
  49. package/dist/FaqAccordion/index.d.ts +5 -5
  50. package/dist/FaqAccordion/index.js +3 -2
  51. package/dist/FdicCallout/index.d.ts +1 -1
  52. package/dist/FooterDisclosure/FooterDisclosure.d.ts +4 -4
  53. package/dist/FooterDisclosure/LVF/LaVictorieFooter.d.ts +1 -1
  54. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.d.ts +1 -1
  55. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +3 -2
  56. package/dist/Forms/ApplicationStart.d.ts +1 -1
  57. package/dist/Forms/ApplyNow.d.ts +1 -1
  58. package/dist/Forms/ApplyNow.js +3 -2
  59. package/dist/Forms/BoatMooringLocation.d.ts +1 -1
  60. package/dist/Forms/ClearingForm.d.ts +1 -1
  61. package/dist/Forms/CommercialDeposits.d.ts +1 -1
  62. package/dist/Forms/CommercialDepositsNoLendingOption.d.ts +1 -1
  63. package/dist/Forms/CommercialLending.d.ts +1 -1
  64. package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
  65. package/dist/Forms/ConstructionLendingDynamic.d.ts +1 -1
  66. package/dist/Forms/ContactCompany.d.ts +1 -1
  67. package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
  68. package/dist/Forms/ContactUs.d.ts +1 -1
  69. package/dist/Forms/ContactUsAAS.d.ts +1 -1
  70. package/dist/Forms/ContactUsBusiness.d.ts +1 -1
  71. package/dist/Forms/ContactUsBusiness.js +3 -2
  72. package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
  73. package/dist/Forms/ContactUsBusinessNameEmail.js +3 -2
  74. package/dist/Forms/ContactUsLVF.d.ts +1 -1
  75. package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
  76. package/dist/Forms/ContactUsNMLSId.js +3 -2
  77. package/dist/Forms/ContactUsSchwabAAS.d.ts +1 -1
  78. package/dist/Forms/CpraRequest.d.ts +1 -1
  79. package/dist/Forms/CpraRequest.js +3 -2
  80. package/dist/Forms/CraPublicFile.d.ts +1 -1
  81. package/dist/Forms/CraPublicFile.js +3 -2
  82. package/dist/Forms/DealerServices.d.ts +1 -1
  83. package/dist/Forms/EmailOnly.d.ts +1 -1
  84. package/dist/Forms/EmailOnly.js +3 -2
  85. package/dist/Forms/EmailUs.d.ts +1 -1
  86. package/dist/Forms/HoneyPot/index.d.ts +1 -1
  87. package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
  88. package/dist/Forms/MortgageRate/MortgageRateForm.js +3 -2
  89. package/dist/Forms/MortgageRate/MortgageRateQuoteFilters.d.ts +1 -1
  90. package/dist/Forms/MortgageRate/MortgageRateWatch.d.ts +1 -1
  91. package/dist/Forms/MortgageRate/MortgageRateWatch.js +3 -2
  92. package/dist/Forms/MortgageWarehouseLending.d.ts +2 -2
  93. package/dist/Forms/MortgageWarehouseLending.js +10 -9
  94. package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
  95. package/dist/Forms/QuickPricer/UserInformation.d.ts +1 -1
  96. package/dist/Forms/ScheduleCall.d.ts +1 -1
  97. package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
  98. package/dist/Forms/SuccesForm.d.ts +1 -1
  99. package/dist/Forms/SuccesForm.js +4 -3
  100. package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
  101. package/dist/Forms/WcplSurvey.d.ts +1 -1
  102. package/dist/HeroBanner/HeroBanner.d.ts +1 -1
  103. package/dist/HeroBanner/HeroVideoPoster.d.ts +1 -1
  104. package/dist/HeroBanner/LargeHeroBanner.d.ts +1 -1
  105. package/dist/Hyperlink/index.js +3 -2
  106. package/dist/IconBillboard/IconBillboard.d.ts +1 -1
  107. package/dist/IconBillboard/IconBillboardSet.d.ts +1 -1
  108. package/dist/IconBillboard/sections/CallToActionSection.d.ts +1 -1
  109. package/dist/IconBillboard/sections/HeaderSection.d.ts +2 -2
  110. package/dist/IconBillboard/sections/IconSection.d.ts +1 -1
  111. package/dist/IconBillboard/sections/ItemsSection.d.ts +1 -1
  112. package/dist/IconBillboard/sections/LayoutSection.d.ts +1 -1
  113. package/dist/ImageBillboard/ExitIntentModal/ModalWrapper.d.ts +1 -1
  114. package/dist/ImageBillboard/ImageBillboard.d.ts +1 -1
  115. package/dist/ImageBillboard/ImageBillboardSet.d.ts +1 -1
  116. package/dist/ImageLink/ImageLink.d.ts +1 -1
  117. package/dist/ImageLink/ImageLink.js +3 -2
  118. package/dist/ImageLink/ImageLinkSet.d.ts +1 -1
  119. package/dist/ImageLink/ImageLinkSet.js +3 -2
  120. package/dist/ImageLink/index.js +3 -2
  121. package/dist/ImageWrapper/ImageWrapper.d.ts +1 -1
  122. package/dist/Insight/Featured/CategorySelector.d.ts +2 -2
  123. package/dist/Insight/Featured/CategorySelector.js +3 -2
  124. package/dist/Insight/Featured/Featured.d.ts +2 -2
  125. package/dist/Insight/Featured/Featured.js +3 -2
  126. package/dist/Insight/Featured/Header.d.ts +1 -1
  127. package/dist/Insight/Featured/Header.js +3 -2
  128. package/dist/LandingPageHeader/LandingPageHeader.d.ts +1 -1
  129. package/dist/LoadingIndicator/index.d.ts +1 -1
  130. package/dist/MainHTML/index.d.ts +1 -1
  131. package/dist/Modal/Modal.js +3 -2
  132. package/dist/Modal/contextApi/store.d.ts +1 -4
  133. package/dist/Modal/contextApi/store.js +34 -3
  134. package/dist/NavigationMenu/AxosALTS/index.d.ts +1 -1
  135. package/dist/NavigationMenu/AxosALTS/index.js +3 -2
  136. package/dist/NavigationMenu/AxosAdvisor/SubNavBar.d.ts +1 -1
  137. package/dist/NavigationMenu/AxosAdvisor/index.d.ts +1 -1
  138. package/dist/NavigationMenu/AxosAdvisorServices/SubNavBar.d.ts +1 -1
  139. package/dist/NavigationMenu/AxosAdvisorServices/index.d.ts +1 -1
  140. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.d.ts +1 -1
  141. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +3 -2
  142. package/dist/NavigationMenu/AxosBank/SubNavBar.d.ts +1 -1
  143. package/dist/NavigationMenu/AxosBank/SubNavBar.js +3 -2
  144. package/dist/NavigationMenu/AxosBank/index.d.ts +1 -1
  145. package/dist/NavigationMenu/AxosBank/index.js +4 -2
  146. package/dist/NavigationMenu/AxosClearing/SubNavBar.d.ts +1 -1
  147. package/dist/NavigationMenu/AxosClearing/index.d.ts +1 -1
  148. package/dist/NavigationMenu/AxosFiduciary/index.d.ts +1 -1
  149. package/dist/NavigationMenu/LaVictoire/SubNavBar.d.ts +1 -1
  150. package/dist/NavigationMenu/LaVictoire/index.d.ts +1 -1
  151. package/dist/NavigationMenu/LaVictoire/index.js +3 -2
  152. package/dist/NavigationMenu/NavItem/index.d.ts +1 -1
  153. package/dist/NavigationMenu/Navbar.d.ts +1 -1
  154. package/dist/NavigationMenu/Navbar.js +3 -2
  155. package/dist/NavigationMenu/SignInNavButton.d.ts +1 -3
  156. package/dist/NavigationMenu/SignInNavButton.js +4 -2
  157. package/dist/Pagination/Pagination.d.ts +1 -1
  158. package/dist/SecondaryFooter/index.d.ts +1 -1
  159. package/dist/SetContainer/SetContainer.d.ts +1 -1
  160. package/dist/SetContainer/SetContainer.js +3 -2
  161. package/dist/SocialMediaBar/iconsRepository.d.ts +14 -14
  162. package/dist/SocialMediaBar/iconsRepository.js +3 -2
  163. package/dist/SocialMediaBar/index.d.ts +1 -1
  164. package/dist/Tab/Tab.d.ts +1 -1
  165. package/dist/Tab/TabContainer.d.ts +1 -1
  166. package/dist/Table/Table.d.ts +5 -5
  167. package/dist/TextBlock/TextBlock.d.ts +1 -1
  168. package/dist/Topic/Topic.d.ts +4 -4
  169. package/dist/VideoTile/VideoInit.d.ts +1 -1
  170. package/dist/VideoTile/VideoTile.js +3 -2
  171. package/dist/VideoWrapper/index.js +3 -2
  172. package/dist/WalnutIframe/index.d.ts +1 -1
  173. package/dist/assets/Chatbot/AnimatedGradientBorder.css +99 -12
  174. package/dist/assets/Chatbot/Bubble.css +26 -7
  175. package/dist/assets/Chatbot/ChatWindow.css +164 -71
  176. package/dist/assets/globals.css +3 -0
  177. package/dist/assets/notification.mp3.js +4 -0
  178. package/dist/icons/AxosX/Blue.d.ts +1 -1
  179. package/dist/icons/AxosX/index.d.ts +1 -1
  180. package/dist/icons/CheckCircle.d.ts +1 -1
  181. package/dist/icons/CheckCircleLight.d.ts +1 -1
  182. package/dist/icons/CheckIcon/index.d.ts +1 -1
  183. package/dist/icons/ChevronDown.d.ts +1 -1
  184. package/dist/icons/ChevronUp.d.ts +1 -1
  185. package/dist/icons/Clock/index.d.ts +1 -1
  186. package/dist/icons/EqualHousingLender.d.ts +1 -1
  187. package/dist/icons/Logos/AAS.d.ts +1 -1
  188. package/dist/icons/Logos/AFS.d.ts +1 -1
  189. package/dist/icons/Logos/AXA.d.ts +1 -1
  190. package/dist/icons/Logos/AXB.d.ts +1 -1
  191. package/dist/icons/Logos/AXC.d.ts +1 -1
  192. package/dist/icons/Logos/AXI.d.ts +1 -1
  193. package/dist/icons/Logos/AXOS.d.ts +1 -1
  194. package/dist/icons/Logos/GBLVF.d.ts +1 -1
  195. package/dist/icons/Logos/LVF.d.ts +1 -1
  196. package/dist/icons/Logos/LVFText.d.ts +1 -1
  197. package/dist/icons/Logos/SPB.d.ts +1 -1
  198. package/dist/icons/MemberFdicLogo.d.ts +1 -1
  199. package/dist/icons/QuoteIconGrey.d.ts +1 -1
  200. package/dist/icons/QuoteIconWhite.d.ts +1 -1
  201. package/dist/icons/QuoteIconYellow.d.ts +1 -1
  202. package/dist/main.js +11 -2
  203. package/dist/utils/useVisibility.d.ts +1 -0
  204. package/dist/utils/useVisibility.js +18 -0
  205. package/dist/vite-env.d.js +1 -0
  206. package/package.json +147 -147
  207. package/dist/assets/Chatbot/Chatbot.css +0 -3
@@ -1,4 +1,3 @@
1
- import '../assets/Chatbot/Chatbot.css';/* empty css */
2
1
  var chatbotAXB = "_1hpv6vm0";
3
2
  var chatbotUFB = "_1hpv6vm1";
4
3
  export {
@@ -1,3 +1,6 @@
1
+ import { default as AudioManager } from './AudioManager';
2
+
3
+ export declare const audioManager: AudioManager;
1
4
  export type ChatbotProps = {
2
5
  project?: "axos" | "ufb";
3
6
  debug?: boolean;
@@ -14,5 +17,5 @@ export declare const Chatbot: ({ project, projectEnv, menuOption, config, }: {
14
17
  menuOption?: "Support Virtual Agent" | string;
15
18
  debug?: boolean;
16
19
  config: InitalizeChatbot;
17
- }) => false | import("react").JSX.Element;
20
+ }) => false | import("react/jsx-runtime").JSX.Element;
18
21
  export {};
@@ -1,12 +1,18 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { usePageVisibility } from "../utils/useVisibility.js";
3
4
  import { useRef, useState, useEffect } from "react";
4
- import { useMount, useUnmount } from "react-use";
5
+ import { useLocation, useMount, useUnmount } from "react-use";
6
+ import notificationSound from "../assets/notification.mp3.js";
7
+ import AudioManager from "./AudioManager.js";
5
8
  import { Bubble } from "./Bubble.js";
6
9
  import { chatbotAXB, chatbotUFB } from "./Chatbot.css.js";
7
10
  import { ChatWindow } from "./ChatWindow.js";
8
11
  import { useOpenChat } from "./store/chat.js";
9
12
  import { useMessages } from "./store/messages.js";
13
+ const audioManager = new AudioManager();
14
+ audioManager.installUjetAudioOverride(notificationSound);
15
+ audioManager.setSoundEnabled(false);
10
16
  const Chatbot = ({
11
17
  project = "axos",
12
18
  projectEnv = "dev",
@@ -14,6 +20,7 @@ const Chatbot = ({
14
20
  config
15
21
  }) => {
16
22
  const {
23
+ isOpen,
17
24
  hasOpenedOnce,
18
25
  toggle,
19
26
  reset,
@@ -21,8 +28,16 @@ const Chatbot = ({
21
28
  hasEscalated,
22
29
  endEscalation,
23
30
  unblockInput,
24
- blockInput
31
+ blockInput,
32
+ hasStarted,
33
+ setChatStarted,
34
+ resetChatStarted,
35
+ setChatStatus,
36
+ displayThankyouMessage,
37
+ hideDisplayThankyouMessage
25
38
  } = useOpenChat();
39
+ const isVisible = usePageVisibility();
40
+ const location = useLocation();
26
41
  const { addMessage, addMessages, clearMessages, messages } = useMessages();
27
42
  const clientRef = useRef(null);
28
43
  const menuRef = useRef(null);
@@ -31,7 +46,6 @@ const Chatbot = ({
31
46
  const chatLoading = useRef(false);
32
47
  const agent_virtual = useRef(null);
33
48
  const [status, setStatus] = useState("idle");
34
- const [hasStarted, setHasStarted] = useState(false);
35
49
  const [menusLoaded, setMenusLoaded] = useState(false);
36
50
  const [isTyping, setIsTyping] = useState(false);
37
51
  const [scalationStarted, setScalationStarted] = useState(false);
@@ -78,6 +92,10 @@ const Chatbot = ({
78
92
  env: {
79
93
  label: "env",
80
94
  value: projectEnv === "uat" ? "dev" : projectEnv
95
+ },
96
+ url: {
97
+ label: "url",
98
+ value: location.href
81
99
  }
82
100
  }
83
101
  };
@@ -222,9 +240,6 @@ const Chatbot = ({
222
240
  const createClient = async () => {
223
241
  const { Client } = await import("@ujet/websdk-headless");
224
242
  if (clientRef.current) return;
225
- console.log({
226
- config
227
- });
228
243
  const client = new Client({
229
244
  companyId: config.companyId,
230
245
  tenant: config.tenantName,
@@ -251,12 +266,20 @@ const Chatbot = ({
251
266
  };
252
267
  const startChat = async (source) => {
253
268
  const client = clientRef.current;
254
- if (!client) return;
255
- if (hasStarted) return;
269
+ if (!client) {
270
+ console.log(`no client detected`);
271
+ return;
272
+ }
273
+ if (hasStarted) {
274
+ console.log(`has started is ${hasStarted}`);
275
+ return;
276
+ }
277
+ hideDisplayThankyouMessage();
256
278
  if (chatLoading.current) {
257
279
  console.log(`startChat skipped [${source}] — already in progress`);
258
280
  return;
259
281
  }
282
+ setChatStatus("connected");
260
283
  try {
261
284
  console.log(`Starting chat [${source}]`, chatRef.current);
262
285
  chatLoading.current = true;
@@ -301,15 +324,16 @@ const Chatbot = ({
301
324
  console.error("Error creating chat:", err);
302
325
  } finally {
303
326
  chatLoading.current = false;
304
- setHasStarted(true);
327
+ setChatStarted();
305
328
  }
306
329
  };
307
330
  const handleClick = async () => {
331
+ audioManager.setSoundEnabled(true);
308
332
  toggle();
309
333
  if (hasStarted) return;
310
334
  if (!hasOpenedOnce) {
311
335
  await startChat("bubbleClick");
312
- setHasStarted(true);
336
+ setChatStarted();
313
337
  }
314
338
  };
315
339
  const onSendMessage = async (msg) => {
@@ -334,15 +358,27 @@ const Chatbot = ({
334
358
  }
335
359
  };
336
360
  const onEndChat = async () => {
337
- console.log("Ending chat");
361
+ console.log(`Ending chat [end chat]`);
338
362
  if (chatRef.current) {
339
- await clientRef.current?.finishChat();
340
- await chatRef.current?.destroy();
341
- clearMessages();
342
- chatRef.current = null;
343
- console.log("Chat ended");
344
- setHasStarted(false);
345
- endEscalation?.();
363
+ try {
364
+ clientRef.current?.finishChat().then(() => {
365
+ console.log(`Chat finished`);
366
+ chatRef.current?.destroy().then(() => {
367
+ console.log(`Chat destroyed`);
368
+ clearMessages();
369
+ chatRef.current = null;
370
+ resetChatStarted();
371
+ console.log("Chat ended");
372
+ endEscalation?.();
373
+ }).finally(() => {
374
+ setChatStatus("ending");
375
+ displayThankyouMessage();
376
+ });
377
+ });
378
+ } catch (error) {
379
+ console.log(error, "from onEndChat");
380
+ }
381
+ return;
346
382
  }
347
383
  };
348
384
  const onEndAndStartNewChat = async () => {
@@ -361,7 +397,7 @@ const Chatbot = ({
361
397
  deregisterEventHandlers();
362
398
  chatLoading.current = false;
363
399
  reset();
364
- setHasStarted(false);
400
+ resetChatStarted();
365
401
  setStatus("idle");
366
402
  clearMessages();
367
403
  endEscalation?.();
@@ -377,7 +413,7 @@ const Chatbot = ({
377
413
  };
378
414
  const onCloseAfterThankYou = async () => {
379
415
  reset();
380
- setHasStarted(false);
416
+ resetChatStarted();
381
417
  newChatSession();
382
418
  };
383
419
  const onPreviewTyping = async (msg) => {
@@ -391,6 +427,19 @@ const Chatbot = ({
391
427
  console.error("Error sending preview message:", error);
392
428
  }
393
429
  };
430
+ useEffect(() => {
431
+ if (chatRef.current) {
432
+ if (isVisible && isOpen) {
433
+ audioManager.setSoundEnabled(false);
434
+ }
435
+ if (isVisible && !isOpen) {
436
+ audioManager.setSoundEnabled(true);
437
+ }
438
+ if (!isVisible) {
439
+ audioManager.setSoundEnabled(true);
440
+ }
441
+ }
442
+ }, [isOpen, isVisible]);
394
443
  return menusLoaded && /* @__PURE__ */ jsxs(
395
444
  "div",
396
445
  {
@@ -417,5 +466,6 @@ const Chatbot = ({
417
466
  );
418
467
  };
419
468
  export {
420
- Chatbot
469
+ Chatbot,
470
+ audioManager
421
471
  };
@@ -9,7 +9,7 @@ import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import
9
9
  /* empty css */
10
10
  /* empty css */
11
11
  import clsx from "clsx";
12
- import { shimmerText, notificationStyle, messageStyle, user_msg, agent_msg, inline_button_wrapper, inline_button, endChatButtonStyle } from "./ChatWindow.css.js";
12
+ import { shimmerText, notificationStyle, trMortgageTable, tableCell, tableHead, tableMsg, messageStyle, user_msg, agent_msg, inline_button_wrapper, inline_button, endChatButtonStyle } from "./ChatWindow.css.js";
13
13
  import { useOpenChat } from "./store/chat.js";
14
14
  function timeAgo(date) {
15
15
  const seconds = Math.floor(((/* @__PURE__ */ new Date()).getTime() - date.getTime()) / 1e3);
@@ -68,172 +68,197 @@ const ChatbotMessage = ({
68
68
  }
69
69
  );
70
70
  }
71
- return /* @__PURE__ */ jsxs(Fragment, { children: [
72
- msg.type == "noti" && msg.$userType == "system" && msg.event == "escalationStarted" && /* @__PURE__ */ jsx("div", { className: notificationStyle, children: "We are connecting you with a human agent..." }, msg.$index),
73
- msg.type == "noti" && msg.$userType == "system" && msg.event == "memberLeft" && /* @__PURE__ */ jsxs("div", { className: notificationStyle, children: [
74
- /* @__PURE__ */ jsx("strong", { children: "Virtual Agent" }),
75
- " just left the conversation."
76
- ] }, msg.$index),
77
- msg.type == "noti" && msg.$userType == "system" && msg.event == "escalationAccepted" && /* @__PURE__ */ jsxs("div", { className: notificationStyle, children: [
78
- "You are now connected with a",
79
- " ",
80
- msg.to_agent ? /* @__PURE__ */ jsx("strong", { children: msg?.to_agent?.name }) : "an agent"
81
- ] }, msg.$index),
82
- msg.type == "noti" && msg.$userType == "virtual_agent" && msg.event == "escalationDeflected" && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
83
- "div",
84
- {
85
- className: notificationStyle,
86
- style: { fontSize: 12 },
87
- children: [
88
- "Our chat team is available weekdays, 8am-5pm, except federal bank holidays. For immediate assistance you can reach out to us at",
89
- " ",
90
- /* @__PURE__ */ jsx("a", { href: "tel:1-888-502-2967", children: "1-888-502-2967" }),
91
- "."
92
- ]
71
+ const checkInformationMortgage = typeof msg.content == "string" ? msg.content.replace(/•/g, "-").replace(/\\n/g, "\n") : "";
72
+ return /* @__PURE__ */ jsxs(
73
+ "div",
74
+ {
75
+ style: {
76
+ display: "flex",
77
+ flexDirection: "column"
93
78
  },
94
- msg.$index
95
- ) }),
96
- ["text", "markdown_template", "markdown"].includes(msg.type) && /* @__PURE__ */ jsx(
97
- "div",
98
- {
99
- className: clsx(
100
- messageStyle,
101
- msg.$userType == "end_user" ? user_msg : agent_msg
79
+ children: [
80
+ msg.type == "noti" && msg.$userType == "system" && msg.event == "escalationStarted" && /* @__PURE__ */ jsx("div", { className: notificationStyle, children: "We are connecting you with a human agent..." }, msg.$index),
81
+ msg.type == "noti" && msg.$userType == "system" && msg.event == "memberLeft" && /* @__PURE__ */ jsxs("div", { className: notificationStyle, children: [
82
+ /* @__PURE__ */ jsx("strong", { children: "Virtual Agent" }),
83
+ " just left the conversation."
84
+ ] }, msg.$index),
85
+ msg.type == "noti" && msg.$userType == "system" && msg.event == "escalationAccepted" && /* @__PURE__ */ jsxs("div", { className: notificationStyle, children: [
86
+ "You are now connected with a",
87
+ " ",
88
+ msg.to_agent ? /* @__PURE__ */ jsx("strong", { children: msg?.to_agent?.name }) : "an agent"
89
+ ] }, msg.$index),
90
+ msg.type == "noti" && msg.$userType == "virtual_agent" && msg.event == "escalationDeflected" && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
91
+ "div",
92
+ {
93
+ className: notificationStyle,
94
+ style: { fontSize: 12 },
95
+ children: [
96
+ "Our chat team is available weekdays, 8am-5pm, except federal bank holidays. For immediate assistance you can reach out to us at",
97
+ " ",
98
+ /* @__PURE__ */ jsx("a", { href: "tel:1-888-502-2967", children: "1-888-502-2967" }),
99
+ "."
100
+ ]
101
+ },
102
+ msg.$index
103
+ ) }),
104
+ ["text", "markdown_template", "markdown"].includes(msg.type) && /* @__PURE__ */ jsx(
105
+ "div",
106
+ {
107
+ className: clsx(
108
+ messageStyle,
109
+ msg.$userType == "end_user" ? user_msg : agent_msg
110
+ ),
111
+ children: /* @__PURE__ */ jsxs(
112
+ "div",
113
+ {
114
+ style: {
115
+ fontSize: 14,
116
+ display: "flex",
117
+ flexDirection: "column",
118
+ gap: 4
119
+ },
120
+ children: [
121
+ msg.$userType == "virtual_agent" && /* @__PURE__ */ jsxs(
122
+ "div",
123
+ {
124
+ style: {
125
+ display: "flex",
126
+ alignItems: "center",
127
+ gap: "8px"
128
+ },
129
+ children: [
130
+ showAvatar && /* @__PURE__ */ jsx(
131
+ "img",
132
+ {
133
+ width: 24,
134
+ height: 24,
135
+ src: virtualAgent?.avatar_url,
136
+ alt: "agent avatar"
137
+ }
138
+ ),
139
+ showName && /* @__PURE__ */ jsx("strong", { children: virtualAgent?.name })
140
+ ]
141
+ }
142
+ ),
143
+ msg.$userType != "end_user" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
144
+ ReactMarkdown,
145
+ {
146
+ remarkPlugins: [[remarkGfm, { singleTilde: false }]],
147
+ components: {
148
+ p: ({ ...props }) => /* @__PURE__ */ jsx(
149
+ "p",
150
+ {
151
+ style: { margin: 0, fontSize: "inherit" },
152
+ title: new Date(msg.$timestamp).toLocaleTimeString([], {
153
+ hour: "2-digit",
154
+ minute: "2-digit"
155
+ }),
156
+ ...props
157
+ }
158
+ ),
159
+ a: ({ ...props }) => /* @__PURE__ */ jsx("a", { style: { wordBreak: "break-word" }, ...props }),
160
+ table: ({ node, ...props }) => /* @__PURE__ */ jsx("div", { style: { overflowX: "auto", marginTop: 4 }, children: /* @__PURE__ */ jsx(
161
+ "table",
162
+ {
163
+ ...props,
164
+ className: clsx(tableMsg),
165
+ style: { tableLayout: "fixed" }
166
+ }
167
+ ) }),
168
+ th: ({ node, ...props }) => /* @__PURE__ */ jsx("th", { ...props, className: clsx(tableHead) }),
169
+ td: ({ node, ...props }) => /* @__PURE__ */ jsx("td", { ...props, className: clsx(tableCell) }),
170
+ tr: ({ node, ...props }) => {
171
+ return /* @__PURE__ */ jsx("tr", { className: clsx(trMortgageTable), ...props });
172
+ }
173
+ },
174
+ children: msg?.content?.includes("Does this information look correct?") ? checkInformationMortgage : msg.content
175
+ }
176
+ ) }) : /* @__PURE__ */ jsx(
177
+ "div",
178
+ {
179
+ title: new Date(msg.$timestamp).toLocaleTimeString([], {
180
+ hour: "2-digit",
181
+ minute: "2-digit"
182
+ }),
183
+ children: msg.content
184
+ }
185
+ )
186
+ ]
187
+ }
188
+ )
189
+ },
190
+ msg.$index
102
191
  ),
103
- children: /* @__PURE__ */ jsxs(
192
+ msg.type == "inline_button" && Array.isArray(msg.buttons) && msg.buttons.length > 0 && /* @__PURE__ */ jsx("div", { className: inline_button_wrapper, children: msg.buttons.length !== 0 && Array.isArray(msg.buttons) && msg.buttons.map((button, index) => {
193
+ return /* @__PURE__ */ jsx(
194
+ "button",
195
+ {
196
+ className: inline_button,
197
+ onClick: () => {
198
+ onSend?.(button?.title);
199
+ },
200
+ children: button.title
201
+ },
202
+ index
203
+ );
204
+ }) }),
205
+ " ",
206
+ msg.event == "chatEnded" && msg.status == "failed" && /* @__PURE__ */ jsxs(Fragment, { children: [
207
+ /* @__PURE__ */ jsxs(
208
+ "div",
209
+ {
210
+ title: (/* @__PURE__ */ new Date()).toLocaleString(),
211
+ style: {
212
+ fontSize: 12,
213
+ color: "#888",
214
+ marginBottom: 4,
215
+ textAlign: "center"
216
+ },
217
+ children: [
218
+ "No team members are online at the moment.",
219
+ /* @__PURE__ */ jsx("br", {}),
220
+ " Please try again later."
221
+ ]
222
+ }
223
+ ),
224
+ /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: onEndChat, children: "End Chat" }) })
225
+ ] }),
226
+ msg.event == "chatEnded" && msg.status != "failed" && /* @__PURE__ */ jsxs(Fragment, { children: [
227
+ /* @__PURE__ */ jsxs(
228
+ "div",
229
+ {
230
+ title: (/* @__PURE__ */ new Date()).toLocaleString(),
231
+ style: {
232
+ fontSize: 12,
233
+ color: "#888",
234
+ marginBottom: 4,
235
+ textAlign: "center"
236
+ },
237
+ children: [
238
+ "Thank you for chatting!",
239
+ /* @__PURE__ */ jsx("br", {}),
240
+ " This conversation has ended."
241
+ ]
242
+ }
243
+ ),
244
+ /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: onEndChat, children: "End Chat" }) })
245
+ ] }),
246
+ msg.type == "text" && /* @__PURE__ */ jsx(
104
247
  "div",
105
248
  {
106
249
  style: {
107
- fontSize: 14,
108
- display: "flex",
109
- flexDirection: "column",
110
- gap: 4
250
+ textAlign: msg.$userType === "end_user" ? "right" : "left",
251
+ fontSize: 12,
252
+ color: vars.chatbot.window.timestampColor,
253
+ textTransform: "capitalize",
254
+ fontFamily: "inherit"
111
255
  },
112
- children: [
113
- msg.$userType == "virtual_agent" && /* @__PURE__ */ jsxs(
114
- "div",
115
- {
116
- style: {
117
- display: "flex",
118
- alignItems: "center",
119
- gap: "8px"
120
- },
121
- children: [
122
- showAvatar && /* @__PURE__ */ jsx(
123
- "img",
124
- {
125
- width: 24,
126
- height: 24,
127
- src: virtualAgent?.avatar_url,
128
- alt: "agent avatar"
129
- }
130
- ),
131
- showName && /* @__PURE__ */ jsx("strong", { children: virtualAgent?.name })
132
- ]
133
- }
134
- ),
135
- msg.$userType != "end_user" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
136
- ReactMarkdown,
137
- {
138
- remarkPlugins: [[remarkGfm, { singleTilde: false }]],
139
- components: {
140
- p: ({ ...props }) => /* @__PURE__ */ jsx(
141
- "p",
142
- {
143
- style: { margin: 0, fontSize: "inherit" },
144
- title: new Date(msg.$timestamp).toLocaleTimeString([], {
145
- hour: "2-digit",
146
- minute: "2-digit"
147
- }),
148
- ...props
149
- }
150
- ),
151
- a: ({ ...props }) => /* @__PURE__ */ jsx("a", { style: { wordBreak: "break-word" }, ...props })
152
- },
153
- children: msg.content
154
- }
155
- ) }) : /* @__PURE__ */ jsx(
156
- "div",
157
- {
158
- title: new Date(msg.$timestamp).toLocaleTimeString([], {
159
- hour: "2-digit",
160
- minute: "2-digit"
161
- }),
162
- children: msg.content
163
- }
164
- )
165
- ]
256
+ children: timeText
166
257
  }
167
258
  )
168
- },
169
- msg.$index
170
- ),
171
- msg.type == "inline_button" && Array.isArray(msg.buttons) && msg.buttons.length > 0 && /* @__PURE__ */ jsx("div", { className: inline_button_wrapper, children: msg.buttons.length !== 0 && Array.isArray(msg.buttons) && msg.buttons.map((button, index) => {
172
- return /* @__PURE__ */ jsx(
173
- "button",
174
- {
175
- className: inline_button,
176
- onClick: () => {
177
- onSend?.(button?.title);
178
- },
179
- children: button.title
180
- },
181
- index
182
- );
183
- }) }),
184
- " ",
185
- msg.event == "chatEnded" && msg.status == "failed" && /* @__PURE__ */ jsxs(Fragment, { children: [
186
- /* @__PURE__ */ jsxs(
187
- "div",
188
- {
189
- title: (/* @__PURE__ */ new Date()).toLocaleString(),
190
- style: {
191
- fontSize: 12,
192
- color: "#888",
193
- marginBottom: 4,
194
- textAlign: "center"
195
- },
196
- children: [
197
- "No team members are online at the moment.",
198
- /* @__PURE__ */ jsx("br", {}),
199
- " Please try again later."
200
- ]
201
- }
202
- ),
203
- /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: onEndChat, children: "End Chat" }) })
204
- ] }),
205
- msg.event == "chatEnded" && msg.status != "failed" && /* @__PURE__ */ jsxs(Fragment, { children: [
206
- /* @__PURE__ */ jsxs(
207
- "div",
208
- {
209
- title: (/* @__PURE__ */ new Date()).toLocaleString(),
210
- style: {
211
- fontSize: 12,
212
- color: "#888",
213
- marginBottom: 4,
214
- textAlign: "center"
215
- },
216
- children: [
217
- "Thank you for chatting!",
218
- /* @__PURE__ */ jsx("br", {}),
219
- " This conversation has ended."
220
- ]
221
- }
222
- ),
223
- /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: onEndChat, children: "End Chat" }) })
224
- ] }),
225
- msg.type == "text" && /* @__PURE__ */ jsx(
226
- "div",
227
- {
228
- style: {
229
- textAlign: msg.$userType === "end_user" ? "right" : "left",
230
- fontSize: 12,
231
- color: vars.chatbot.window.timestampColor
232
- },
233
- children: timeText
234
- }
235
- )
236
- ] });
259
+ ]
260
+ }
261
+ );
237
262
  };
238
263
  export {
239
264
  ChatbotMessage
@@ -1,2 +1,2 @@
1
- declare const EllipsisLoader: () => import("react").JSX.Element;
1
+ declare const EllipsisLoader: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default EllipsisLoader;
@@ -30,9 +30,6 @@ const loadingTransition = {
30
30
  ease: "easeInOut"
31
31
  };
32
32
  const EllipsisLoader = () => {
33
- const project = process.env.CCAI_PROJECT_ID;
34
- const isAxos = project === "axos";
35
- const endUserBg = isAxos ? "#14263d" : "#323339";
36
33
  return /* @__PURE__ */ jsxs(
37
34
  motion.svg,
38
35
  {
@@ -49,7 +46,6 @@ const EllipsisLoader = () => {
49
46
  cx: "20",
50
47
  cy: "15",
51
48
  r: "8",
52
- fill: endUserBg,
53
49
  variants: loadingCircleVariants,
54
50
  transition: loadingTransition
55
51
  }
@@ -60,7 +56,6 @@ const EllipsisLoader = () => {
60
56
  cx: "50",
61
57
  cy: "15",
62
58
  r: "8",
63
- fill: endUserBg,
64
59
  variants: loadingCircleVariants,
65
60
  transition: loadingTransition
66
61
  }
@@ -71,7 +66,6 @@ const EllipsisLoader = () => {
71
66
  cx: "80",
72
67
  cy: "15",
73
68
  r: "8",
74
- fill: endUserBg,
75
69
  variants: loadingCircleVariants,
76
70
  transition: loadingTransition
77
71
  }
@@ -1,4 +1,4 @@
1
1
  export declare const EllipsisIcon: ({ size, color }: {
2
2
  size?: number | undefined;
3
3
  color?: string | undefined;
4
- }) => import("react").JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface ExpandChatToggleProps {
4
+ isExpanded: boolean;
5
+ onToggle: () => void;
6
+ }
7
+ export declare const ExpandChatToggle: React.FC<ExpandChatToggleProps>;
8
+ export {};