@axos-web-dev/shared-components 1.0.100-dev.53 → 1.0.100-dev.53-chat-revamp

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 (166) hide show
  1. package/dist/ATMLocator/ATMLocator.js +2 -1
  2. package/dist/Accordion/Accordion.css.js +2 -1
  3. package/dist/Accordion/Accordion.js +2 -1
  4. package/dist/AlertBanner/index.js +2 -1
  5. package/dist/Article/Article.css.js +2 -1
  6. package/dist/ArticlesSet/ArticlesSet.css.js +2 -1
  7. package/dist/Auth/ErrorAlert.js +2 -1
  8. package/dist/Auth/SignIn.css.js +2 -1
  9. package/dist/AwardsBanner/AwardsBanner.css.js +2 -1
  10. package/dist/BulletItem/BulletItem.js +2 -1
  11. package/dist/Button/Button.css.js +2 -1
  12. package/dist/Button/Button.js +2 -1
  13. package/dist/Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js +2 -1
  14. package/dist/Calculators/ApyCalculator/ApyCalculator.css.js +2 -1
  15. package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js +2 -1
  16. package/dist/Calculators/AxosOneCalculator/index.js +2 -1
  17. package/dist/Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js +2 -1
  18. package/dist/Calculators/BalanceAPYCalculator/index.js +2 -1
  19. package/dist/Calculators/BuyDownCalculator/BuyDownCalculator.css.js +2 -1
  20. package/dist/Calculators/Calculator.js +3 -2
  21. package/dist/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js +2 -1
  22. package/dist/Calculators/MonthlyPaymentLVFCalculator/MonthlyPaymentCalculator.css.js +2 -1
  23. package/dist/Calculators/SummitApyCalculator/BalanceAPYCalculator.css.js +2 -1
  24. package/dist/Calculators/SummitApyCalculator/index.js +2 -1
  25. package/dist/Calculators/calculator.css.js +2 -1
  26. package/dist/CallToActionBar/CallToActionBar.css.js +2 -1
  27. package/dist/Carousel/Carousel.css.js +2 -1
  28. package/dist/Carousel/index.js +2 -1
  29. package/dist/Chatbot/Bubble.css.d.ts +5 -0
  30. package/dist/Chatbot/Bubble.css.js +17 -3
  31. package/dist/Chatbot/Bubble.js +25 -19
  32. package/dist/Chatbot/ChatWindow.css.d.ts +16 -0
  33. package/dist/Chatbot/ChatWindow.css.js +44 -17
  34. package/dist/Chatbot/ChatWindow.d.ts +3 -0
  35. package/dist/Chatbot/ChatWindow.js +341 -162
  36. package/dist/Chatbot/Chatbot.css.js +0 -1
  37. package/dist/Chatbot/Chatbot.js +16 -3
  38. package/dist/Chatbot/ThankYouMessage.d.ts +9 -0
  39. package/dist/Chatbot/ThankYouMessage.js +510 -0
  40. package/dist/Chatbot/index.js +18 -2
  41. package/dist/Chatbot/store/chat.d.ts +3 -0
  42. package/dist/Chatbot/store/chat.js +4 -1
  43. package/dist/Chevron/Chevron.css.js +2 -1
  44. package/dist/Chevron/index.js +2 -1
  45. package/dist/CollectInformationAlert/CollectInformationAlert.css.js +2 -1
  46. package/dist/CollectInformationAlert/index.js +2 -1
  47. package/dist/Comparison/Comparison.css.js +2 -1
  48. package/dist/Comparison/Comparison.js +2 -1
  49. package/dist/ContentBanner/ContentBanner.css.js +2 -1
  50. package/dist/DownloadTile/DownloadTile.css.js +2 -1
  51. package/dist/ExecutiveBio/ExecutiveBio.css.js +2 -1
  52. package/dist/ExecutiveBio/ExecutiveBio.js +2 -1
  53. package/dist/FaqAccordion/FaqAccordion.css.js +2 -1
  54. package/dist/FaqAccordion/index.js +2 -1
  55. package/dist/FooterDisclosure/LVF/LaVictorieFooter.css.js +2 -1
  56. package/dist/FooterDisclosure/LVF/LaVictorieFooter.js +2 -1
  57. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.css.js +2 -1
  58. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +2 -1
  59. package/dist/Forms/ApplicationStart.js +2 -1
  60. package/dist/Forms/ApplyNow.js +2 -1
  61. package/dist/Forms/ClearingForm.js +2 -1
  62. package/dist/Forms/CommercialDeposits.js +2 -1
  63. package/dist/Forms/CommercialDepositsNoLendingOption.js +2 -1
  64. package/dist/Forms/CommercialLending.js +2 -1
  65. package/dist/Forms/CommercialPremiumFinance.js +2 -1
  66. package/dist/Forms/ContactCompany.js +2 -1
  67. package/dist/Forms/ContactCompanyTitle.js +2 -1
  68. package/dist/Forms/ContactUs.js +2 -1
  69. package/dist/Forms/ContactUsAAS.js +2 -1
  70. package/dist/Forms/ContactUsBusiness.js +2 -1
  71. package/dist/Forms/ContactUsBusinessNameEmail.js +2 -1
  72. package/dist/Forms/ContactUsLVF.js +2 -1
  73. package/dist/Forms/ContactUsNMLSId.js +2 -1
  74. package/dist/Forms/CpraRequest.js +2 -1
  75. package/dist/Forms/CraPublicFile.js +2 -1
  76. package/dist/Forms/DealerServices.js +2 -1
  77. package/dist/Forms/EmailOnly.js +2 -1
  78. package/dist/Forms/EmailUs.js +2 -1
  79. package/dist/Forms/Forms.css.js +2 -1
  80. package/dist/Forms/MortgageRate/MortgageRateForm.js +2 -1
  81. package/dist/Forms/MortgageRate/MortgageRateWatch.js +2 -1
  82. package/dist/Forms/MortgageWarehouseLending.js +2 -1
  83. package/dist/Forms/QuickPricer/QuickPricerForm.js +2 -1
  84. package/dist/Forms/QuickPricer/UserInformation.css.js +2 -1
  85. package/dist/Forms/ScheduleCall.js +2 -1
  86. package/dist/Forms/ScheduleCallPremier.js +2 -1
  87. package/dist/Forms/SuccesForm.js +3 -2
  88. package/dist/Forms/WcplSurvey.js +2 -1
  89. package/dist/HeroBanner/HeroBanner.css.js +2 -1
  90. package/dist/HeroBanner/HeroBanner.js +2 -1
  91. package/dist/HeroBanner/LargeBanner.css.js +2 -1
  92. package/dist/HeroBanner/SelectionBanner.css.js +2 -1
  93. package/dist/Hyperlink/Hyperlink.css.js +2 -1
  94. package/dist/Hyperlink/index.js +2 -1
  95. package/dist/IconBillboard/IconBillboard.css.js +2 -1
  96. package/dist/ImageBillboard/ImageBillboard.css.js +2 -1
  97. package/dist/ImageBillboard/ImageBillboard.js +2 -1
  98. package/dist/ImageBillboard/ImageBillboardSet.js +2 -1
  99. package/dist/ImageLink/ImageLink.js +2 -1
  100. package/dist/ImageLink/ImageLinkSet.js +2 -1
  101. package/dist/ImageLink/index.js +2 -1
  102. package/dist/Input/Input.css.js +2 -1
  103. package/dist/Inputs/Input.css.js +2 -1
  104. package/dist/Insight/Featured/CategorySelector.css.js +2 -1
  105. package/dist/Insight/Featured/CategorySelector.js +2 -1
  106. package/dist/Insight/Featured/Featured.js +2 -1
  107. package/dist/Insight/Featured/Header.js +2 -1
  108. package/dist/Interstitial/Interstitial-variants.css.js +2 -1
  109. package/dist/LandingPageHeader/LandingPageHeader.css.js +2 -1
  110. package/dist/LandingPageHeader/LandingPageHeader.js +2 -1
  111. package/dist/MainHTML/index.d.ts +1 -1
  112. package/dist/MainHTML/index.js +3 -1
  113. package/dist/Modal/Modal.css.js +2 -1
  114. package/dist/Modal/Modal.js +2 -1
  115. package/dist/NavigationMenu/AxosALTS/NavBar.css.js +2 -1
  116. package/dist/NavigationMenu/AxosALTS/NavData.js +2 -1
  117. package/dist/NavigationMenu/AxosALTS/index.js +2 -1
  118. package/dist/NavigationMenu/AxosAdvisor/NavBar.css.js +2 -1
  119. package/dist/NavigationMenu/AxosAdvisor/SubNavbar.css.js +2 -1
  120. package/dist/NavigationMenu/AxosAdvisorServices/NavBar.css.js +2 -1
  121. package/dist/NavigationMenu/AxosAdvisorServices/SubNavbar.css.js +2 -1
  122. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +2 -1
  123. package/dist/NavigationMenu/AxosBank/NavBar.css.js +2 -1
  124. package/dist/NavigationMenu/AxosBank/NavData.js +2 -1
  125. package/dist/NavigationMenu/AxosBank/SubNavBar.js +2 -1
  126. package/dist/NavigationMenu/AxosBank/SubNavbar.css.js +2 -1
  127. package/dist/NavigationMenu/AxosBank/index.js +2 -1
  128. package/dist/NavigationMenu/LaVictoire/NavData.js +2 -1
  129. package/dist/NavigationMenu/LaVictoire/index.js +2 -1
  130. package/dist/NavigationMenu/NavDataJson.js +2 -1
  131. package/dist/NavigationMenu/Navbar.js +2 -1
  132. package/dist/NavigationMenu/SignInNavButton.js +2 -1
  133. package/dist/PageNavItem/PageNavItem.css.js +2 -1
  134. package/dist/Pagination/Pagination.js +2 -1
  135. package/dist/SecondaryFooter/SecondaryFooter.css.js +2 -1
  136. package/dist/SetContainer/SetContainer.css.js +2 -1
  137. package/dist/SetContainer/SetContainer.js +2 -1
  138. package/dist/SocialMediaBar/iconsRepository.js +2 -1
  139. package/dist/StepItem/StepItem.css.js +2 -1
  140. package/dist/StepItemSet/StepItemSet.css.js +2 -1
  141. package/dist/StepItemSet/StepItemSet.js +2 -1
  142. package/dist/Tab/Tab.css.js +2 -1
  143. package/dist/Table/Table.css.js +2 -1
  144. package/dist/Table/Table.js +2 -1
  145. package/dist/TextBlock/TextBlock.css.js +2 -1
  146. package/dist/VideoTile/VideoTile.css.js +2 -1
  147. package/dist/VideoTile/VideoTile.js +2 -1
  148. package/dist/VideoWrapper/index.js +2 -1
  149. package/dist/assets/Chatbot/Bubble.css +62 -21
  150. package/dist/assets/Chatbot/ChatWindow.css +179 -76
  151. package/dist/assets/themes/axos.css +10 -0
  152. package/dist/assets/themes/premier.css +10 -0
  153. package/dist/assets/themes/ufb.css +50 -0
  154. package/dist/assets/themes/victorie.css +10 -0
  155. package/dist/icons/ArrowIcon/ArrowIcon.css.js +2 -1
  156. package/dist/icons/CheckIcon/CheckIcon.css.js +2 -1
  157. package/dist/icons/DownloadIcon/DownloadIcon.css.js +2 -1
  158. package/dist/icons/FollowIcon/FollowIcon.css.js +2 -1
  159. package/dist/main.js +20 -2
  160. package/dist/themes/axos.css.d.ts +16 -0
  161. package/dist/themes/axos.css.js +1 -1
  162. package/dist/themes/index.d.ts +1 -0
  163. package/dist/themes/index.js +2 -0
  164. package/dist/themes/ufb.css.d.ts +1 -0
  165. package/dist/themes/ufb.css.js +6 -0
  166. package/package.json +136 -136
@@ -1,14 +1,20 @@
1
1
  "use client";
2
2
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
+ import { vars } from "../themes/axos.css.js";
4
+ import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
5
+ /* empty css */
6
+ /* empty css */
7
+ /* empty css */
3
8
  import clsx from "clsx";
4
9
  import React, { useRef, useEffect, Fragment as Fragment$1 } from "react";
5
10
  import ReactMarkdown from "react-markdown";
6
11
  import { useNetworkState, useMount } from "react-use";
7
12
  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, autoResize, sendButtonStyle, windowStyle, windowOpenStyle } from "./ChatWindow.css.js";
13
+ import { windowBarStyle, left_bar_section, chat_title, button_bar, chatbotMenuItem, chatbotMenu, chatEndDialogOverlay, chatFinishDialog, chatEndCircle, endChatButtonStyle, noAnswerButton, arrowFill, button_reset, buttonss_section, chatNetworkStatus, notificationStyle, messageStyle, user_msg, agent_msg, inline_button_wrapper, inline_button, messagesContainerStyle, inputStyle, autoResize, sendButtonStyle, windowStyle, windowOpenStyle } from "./ChatWindow.css.js";
9
14
  import EllipsisLoader from "./EllipsisAnimation.js";
10
15
  import { EllipsisIcon } from "./EllipsisIcon.js";
11
16
  import { useOpenChat } from "./store/chat.js";
17
+ import { ThankYouMessage } from "./ThankYouMessage.js";
12
18
  const ChatWindow = ({
13
19
  messages,
14
20
  status = "connected",
@@ -20,8 +26,16 @@ const ChatWindow = ({
20
26
  },
21
27
  showReconnect = false,
22
28
  virtualAgent,
23
- showAvatar = false
29
+ showAvatar = false,
30
+ onNewChat = () => {
31
+ console.log("Start chat");
32
+ },
33
+ showName = false,
34
+ onCloseAfterThankYou = () => {
35
+ console.log("Close after thank you");
36
+ }
24
37
  }) => {
38
+ const { showThankyouMessage, displayThankyouMessage, toggleThankyouMessage } = useOpenChat();
25
39
  const [mounted, setMounted] = React.useState(false);
26
40
  const [menuOpen, setMenuOpen] = React.useState(false);
27
41
  const [showEndChatDialog, setShowEndChatDialog] = React.useState(false);
@@ -44,10 +58,6 @@ const ChatWindow = ({
44
58
  useMount(() => {
45
59
  setMounted(true);
46
60
  });
47
- const project = process.env.CCAI_PROJECT_ID;
48
- const isAxos = project === "axos";
49
- const endUserBg = isAxos ? "#14263d" : "#323339";
50
- const chatbotBg = isAxos ? "#E9F8FF" : "#EAE8E8";
51
61
  const escalationDeflected = messages?.filter(
52
62
  (item) => item.type == "noti" && item.event == "escalationDeflected"
53
63
  ).length > 0;
@@ -63,146 +73,287 @@ const ChatWindow = ({
63
73
  useEffect(() => {
64
74
  autoResizeTextarea();
65
75
  }, [input]);
76
+ const displayThankYouScreen = () => {
77
+ displayThankyouMessage();
78
+ };
79
+ const onCancelEndChat = () => {
80
+ setShowEndChatDialog(false);
81
+ toggleThankyouMessage?.();
82
+ onCloseAfterThankYou();
83
+ setInput("");
84
+ };
85
+ const onStartChat = () => {
86
+ onNewChat();
87
+ setInput("");
88
+ toggleThankyouMessage?.();
89
+ };
66
90
  return /* @__PURE__ */ jsxs("div", { className: clsx(windowStyle, isOpen && windowOpenStyle), children: [
67
91
  /* @__PURE__ */ jsxs("div", { className: windowBarStyle, children: [
68
- /* @__PURE__ */ jsxs("div", { className: "flex middle", style: { paddingBlock: "6px" }, children: [
69
- /* @__PURE__ */ jsx(
70
- "img",
71
- {
72
- src: "https://www.axos.com/images/2xmVfQm5l0HWOKjgxQO1Iw/axb-assistant.svg",
73
- style: { marginRight: 12 },
74
- height: 18,
75
- width: 18
76
- }
77
- ),
78
- /* @__PURE__ */ jsx("h2", { className: chat_title, children: "Evo Virtual Assistant" })
79
- ] }),
80
- /* @__PURE__ */ jsx(
81
- "button",
92
+ /* @__PURE__ */ jsx("div", { className: clsx(left_bar_section) }),
93
+ /* @__PURE__ */ jsxs(
94
+ "div",
82
95
  {
83
- onClick: () => {
84
- setMenuOpen(!menuOpen);
85
- },
86
- style: {
87
- border: "none",
88
- background: "transparent",
89
- marginLeft: "auto",
90
- cursor: "pointer",
91
- padding: 0,
92
- display: "flex",
93
- alignContent: "center"
94
- },
95
- children: /* @__PURE__ */ jsx(EllipsisIcon, { color: "#fff" })
96
+ className: "flex middle center",
97
+ style: { paddingBlock: "6px", gap: 4 },
98
+ children: [
99
+ /* @__PURE__ */ jsxs(
100
+ "svg",
101
+ {
102
+ xmlns: "http://www.w3.org/2000/svg",
103
+ width: "20",
104
+ height: "17",
105
+ viewBox: "0 0 20 17",
106
+ fill: "none",
107
+ children: [
108
+ /* @__PURE__ */ jsx(
109
+ "path",
110
+ {
111
+ d: "M10.5277 2.78937C10.8911 2.78937 11.1852 3.08251 11.1853 3.44452C11.1852 3.80654 10.8911 4.10056 10.5277 4.10056H5.26386C4.5371 4.10064 3.94791 4.68761 3.94789 5.41175V10.6565C3.9479 11.3806 4.5371 11.9676 5.26386 11.9677H6.97488C7.12012 11.9678 7.23818 12.0854 7.23825 12.2301V15.6861L10.8932 12.0445C10.9424 11.9956 11.0092 11.9679 11.0786 11.9677H14.4765C15.2032 11.9676 15.7925 11.3806 15.7925 10.6565V9.27302C15.7925 8.91106 16.0868 8.61721 16.45 8.61697C16.8134 8.61699 17.1084 8.91093 17.1084 9.27302V10.6565C17.1084 12.1048 15.9301 13.2788 14.4765 13.2789H11.5149L8.16901 16.6135C7.33997 17.4393 5.92245 16.8542 5.92229 15.6861V13.2789H5.26386C3.81026 13.2788 2.63193 12.1048 2.63193 10.6565V5.41175C2.63194 3.96341 3.81027 2.78945 5.26386 2.78937H10.5277Z",
112
+ fill: "#1E3860"
113
+ }
114
+ ),
115
+ /* @__PURE__ */ jsx(
116
+ "path",
117
+ {
118
+ d: "M9.21265 0.166102C9.57579 0.166381 9.87012 0.460269 9.87018 0.822142C9.87004 1.18394 9.57574 1.47701 9.21265 1.47729H3.29036C2.20017 1.47729 1.31606 2.35831 1.31596 3.44452V6.72294C1.31577 7.08487 1.02083 7.37808 0.657534 7.37808C0.294361 7.37794 0.000196551 7.08478 0 6.72294V3.44452C9.80773e-05 1.63411 1.47333 0.166102 3.29036 0.166102H9.21265Z",
119
+ fill: "#1E3860"
120
+ }
121
+ ),
122
+ /* @__PURE__ */ jsx(
123
+ "path",
124
+ {
125
+ d: "M15.7145 0.475824C15.9558 -0.158638 16.8779 -0.158578 17.1192 0.475824L17.6459 1.8611C17.7218 2.06058 17.8835 2.2175 18.0885 2.29132L19.511 2.80454C20.163 3.03936 20.163 3.93626 19.511 4.17107L18.0885 4.6843C17.8835 4.75812 17.7218 4.91504 17.6459 5.11452L17.1192 6.49979C16.8779 7.1342 15.9558 7.13426 15.7145 6.49979L15.1878 5.11452C15.1119 4.91508 14.9502 4.75811 14.7453 4.6843L13.3227 4.17107C12.6708 3.93622 12.6708 3.0394 13.3227 2.80454L14.7453 2.29132C14.9502 2.21751 15.1119 2.06054 15.1878 1.8611L15.7145 0.475824Z",
126
+ fill: "#1E3860"
127
+ }
128
+ )
129
+ ]
130
+ }
131
+ ),
132
+ /* @__PURE__ */ jsx("h2", { className: chat_title, children: "Ask Ava AI" })
133
+ ]
96
134
  }
97
135
  ),
98
- menuOpen && /* @__PURE__ */ jsx("ul", { className: clsx(chatbotMenu), children: /* @__PURE__ */ jsx("li", { className: chatbotMenuItem, children: /* @__PURE__ */ jsx(
99
- "button",
100
- {
101
- type: "button",
102
- onClick: () => {
103
- setShowEndChatDialog(true);
104
- setMenuOpen(false);
105
- },
106
- style: { width: "100%" },
107
- children: "Finish chat"
108
- }
109
- ) }) }),
110
- showEndChatDialog && /* @__PURE__ */ jsxs(Fragment, { children: [
136
+ /* @__PURE__ */ jsxs("div", { className: clsx(buttonss_section), children: [
111
137
  /* @__PURE__ */ jsx(
112
- "div",
138
+ "button",
113
139
  {
140
+ onClick: () => {
141
+ setMenuOpen(!menuOpen);
142
+ },
143
+ className: clsx(button_bar),
114
144
  style: {
115
- background: "#00000080",
116
- position: "fixed",
117
- top: 0,
118
- left: 0,
119
- right: 0,
120
- bottom: 0,
121
- zIndex: 999,
122
- opacity: 0.75
123
- }
145
+ border: "none",
146
+ cursor: "pointer",
147
+ padding: 0,
148
+ display: "flex",
149
+ alignContent: "center"
150
+ },
151
+ children: /* @__PURE__ */ jsx(EllipsisIcon, {})
124
152
  }
125
153
  ),
126
- /* @__PURE__ */ jsx(
127
- "dialog",
154
+ menuOpen && /* @__PURE__ */ jsx("ul", { className: clsx(chatbotMenu), children: /* @__PURE__ */ jsx("li", { className: chatbotMenuItem, children: /* @__PURE__ */ jsxs(
155
+ "button",
128
156
  {
129
- open: showEndChatDialog,
157
+ type: "button",
158
+ onClick: () => {
159
+ setShowEndChatDialog(true);
160
+ setMenuOpen(false);
161
+ },
130
162
  style: {
131
- padding: "1rem",
132
- borderRadius: 8,
133
- background: "#fff",
134
- color: "#000",
135
- border: `1px solid ${endUserBg}`,
136
- outline: "none",
137
- maxWidth: "90%",
138
- top: "25%",
139
- marginInline: "auto",
140
- zIndex: 1e3
163
+ width: "100%",
164
+ display: "flex",
165
+ alignItems: "center",
166
+ gap: "12px"
141
167
  },
142
- children: /* @__PURE__ */ jsxs("form", { method: "dialog", className: chatFinishDialog, children: [
143
- /* @__PURE__ */ jsx("p", { children: "Are you sure you want to end this chat?" }),
144
- /* @__PURE__ */ jsxs(
145
- "div",
168
+ children: [
169
+ /* @__PURE__ */ jsx("div", { className: clsx(button_bar), children: /* @__PURE__ */ jsxs(
170
+ "svg",
146
171
  {
147
- style: { display: "flex", gap: "1rem", marginTop: "1rem" },
172
+ xmlns: "http://www.w3.org/2000/svg",
173
+ width: "16",
174
+ height: "16",
175
+ viewBox: "0 0 16 16",
176
+ fill: "none",
148
177
  children: [
149
- /* @__PURE__ */ jsx(
150
- "button",
151
- {
152
- className: endChatButtonStyle,
153
- type: "submit",
154
- onClick: () => {
155
- endChat();
156
- setShowEndChatDialog(false);
157
- },
158
- children: "Yes"
159
- }
160
- ),
161
- /* @__PURE__ */ jsx(
162
- "button",
163
- {
164
- className: endChatButtonStyle,
165
- type: "button",
166
- onClick: () => {
167
- setShowEndChatDialog(false);
168
- },
169
- children: "No"
170
- }
171
- )
178
+ /* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_92_1389)", children: [
179
+ /* @__PURE__ */ jsx(
180
+ "path",
181
+ {
182
+ d: "M11.1236 5.37374L8.60278 7.89457L11.1236 10.4167L10.4166 11.1237L7.89445 8.6029L5.37362 11.1237L4.66658 10.4167L7.18742 7.89457L4.66658 5.37374L5.37362 4.66671L7.89445 7.18754L10.4166 4.66671L11.1236 5.37374Z",
183
+ fill: "#1E3860"
184
+ }
185
+ ),
186
+ /* @__PURE__ */ jsx(
187
+ "path",
188
+ {
189
+ fillRule: "evenodd",
190
+ clipRule: "evenodd",
191
+ d: "M13.3333 0.833374C14.3458 0.833374 15.1666 1.65419 15.1666 2.66671V13.3334C15.1666 14.3459 14.3458 15.1667 13.3333 15.1667H2.66659C1.65406 15.1667 0.833252 14.3459 0.833252 13.3334V2.66671C0.833252 1.65419 1.65406 0.833374 2.66659 0.833374H13.3333ZM2.66659 1.83337C2.20635 1.83337 1.83325 2.20647 1.83325 2.66671V13.3334C1.83325 13.7936 2.20635 14.1667 2.66659 14.1667H13.3333C13.7935 14.1667 14.1666 13.7936 14.1666 13.3334V2.66671C14.1666 2.20647 13.7935 1.83337 13.3333 1.83337H2.66659Z",
192
+ fill: "#1E3860"
193
+ }
194
+ )
195
+ ] }),
196
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_92_1389", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white" }) }) })
172
197
  ]
173
198
  }
174
- )
175
- ] })
199
+ ) }),
200
+ /* @__PURE__ */ jsx("span", { children: "End Chat" })
201
+ ]
176
202
  }
177
- )
178
- ] }),
179
- onClose && /* @__PURE__ */ jsx(
180
- "button",
181
- {
182
- onClick: onClose,
183
- className: button_reset,
184
- "aria-label": "Close chat",
185
- title: "Close",
186
- children: /* @__PURE__ */ jsx(
187
- "svg",
203
+ ) }) }),
204
+ showEndChatDialog && /* @__PURE__ */ jsxs(Fragment, { children: [
205
+ /* @__PURE__ */ jsx(
206
+ "div",
188
207
  {
189
- xmlns: "http://www.w3.org/2000/svg",
190
- width: "24",
191
- height: "24",
192
- viewBox: "0 0 24 24",
193
- fill: "none",
194
- children: /* @__PURE__ */ jsx(
195
- "path",
208
+ style: {
209
+ background: "#00000080",
210
+ position: "fixed",
211
+ top: 0,
212
+ left: 0,
213
+ right: 0,
214
+ bottom: 0,
215
+ zIndex: 999
216
+ }
217
+ }
218
+ ),
219
+ /* @__PURE__ */ jsx("dialog", { open: showEndChatDialog, className: chatEndDialogOverlay, children: /* @__PURE__ */ jsxs("form", { method: "dialog", className: chatFinishDialog, children: [
220
+ /* @__PURE__ */ jsx("div", { className: clsx(button_bar, chatEndCircle), children: /* @__PURE__ */ jsxs(
221
+ "svg",
222
+ {
223
+ xmlns: "http://www.w3.org/2000/svg",
224
+ width: "24",
225
+ height: "24",
226
+ viewBox: "0 0 24 24",
227
+ fill: "none",
228
+ children: [
229
+ /* @__PURE__ */ jsx(
230
+ "path",
231
+ {
232
+ d: "M12.7514 7.14531V15.3953H11.2514V7.14531H12.7514Z",
233
+ fill: "#D2272F"
234
+ }
235
+ ),
236
+ /* @__PURE__ */ jsx(
237
+ "path",
238
+ {
239
+ d: "M12.0014 16.8953C12.6227 16.8953 13.1264 17.399 13.1264 18.0203C13.1264 18.6416 12.6227 19.1453 12.0014 19.1453C11.3801 19.1453 10.8764 18.6416 10.8764 18.0203C10.8764 17.399 11.3801 16.8953 12.0014 16.8953Z",
240
+ fill: "#D2272F"
241
+ }
242
+ ),
243
+ /* @__PURE__ */ jsx(
244
+ "path",
245
+ {
246
+ fillRule: "evenodd",
247
+ clipRule: "evenodd",
248
+ d: "M9.31805 3.51187L2.17215 17.8037C1.1748 19.7984 2.62529 22.1453 4.85543 22.1453H19.1472C21.3774 22.1453 22.8279 19.7984 21.8305 17.8037L14.6846 3.51188C13.579 1.30073 10.4236 1.30073 9.31805 3.51187ZM3.51379 18.4745L10.6597 4.18269C11.2125 3.07712 12.7902 3.07712 13.343 4.1827L20.4889 18.4745C20.9875 19.4718 20.2623 20.6453 19.1472 20.6453H4.85543C3.74036 20.6453 3.01512 19.4718 3.51379 18.4745Z",
249
+ fill: "#D2272F"
250
+ }
251
+ )
252
+ ]
253
+ }
254
+ ) }),
255
+ /* @__PURE__ */ jsxs("p", { children: [
256
+ "Are you sure you want to end",
257
+ /* @__PURE__ */ jsx("br", {}),
258
+ " this chat?"
259
+ ] }),
260
+ /* @__PURE__ */ jsxs(
261
+ "div",
262
+ {
263
+ style: {
264
+ display: "flex",
265
+ gap: "1rem",
266
+ marginTop: "1rem",
267
+ flexDirection: "column",
268
+ marginBottom: 24,
269
+ width: "100%"
270
+ },
271
+ children: [
272
+ /* @__PURE__ */ jsx(
273
+ "button",
274
+ {
275
+ className: endChatButtonStyle,
276
+ type: "submit",
277
+ onClick: () => {
278
+ endChat();
279
+ displayThankYouScreen();
280
+ setShowEndChatDialog(false);
281
+ },
282
+ children: "Yes, End Chat"
283
+ }
284
+ ),
285
+ /* @__PURE__ */ jsx(
286
+ "button",
287
+ {
288
+ className: clsx(endChatButtonStyle, noAnswerButton),
289
+ type: "button",
290
+ onClick: () => {
291
+ setShowEndChatDialog(false);
292
+ },
293
+ children: "No, Go Back"
294
+ }
295
+ )
296
+ ]
297
+ }
298
+ ),
299
+ " "
300
+ ] }) })
301
+ ] }),
302
+ /* @__PURE__ */ jsx(
303
+ ThankYouMessage,
304
+ {
305
+ showEndChatDialog: showThankyouMessage,
306
+ onStart: onStartChat,
307
+ onClose: onCancelEndChat
308
+ }
309
+ ),
310
+ onClose && /* @__PURE__ */ jsxs(
311
+ "button",
312
+ {
313
+ onClick: onClose,
314
+ className: clsx(button_reset, button_bar),
315
+ "aria-label": "Close chat",
316
+ title: "Close",
317
+ children: [
318
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
319
+ "svg",
196
320
  {
197
- className: arrowFill,
198
- d: "M2.46875 7.76574L11.9991 17.2961L21.5294 7.76574L20.4687 6.70508L11.9991 15.1749L3.52941 6.70508L2.46875 7.76574Z",
199
- fill: "#98DDFF"
321
+ xmlns: "http://www.w3.org/2000/svg",
322
+ width: "24",
323
+ height: "24",
324
+ viewBox: "0 0 24 24",
325
+ fill: "none",
326
+ children: /* @__PURE__ */ jsx(
327
+ "path",
328
+ {
329
+ className: arrowFill,
330
+ d: "M2.46875 7.76574L11.9991 17.2961L21.5294 7.76574L20.4687 6.70508L11.9991 15.1749L3.52941 6.70508L2.46875 7.76574Z",
331
+ color: vars.chatbot.window.headerText
332
+ }
333
+ )
200
334
  }
201
- )
202
- }
203
- )
204
- }
205
- )
335
+ ) }),
336
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
337
+ "svg",
338
+ {
339
+ width: "15",
340
+ height: "15",
341
+ viewBox: "0 0 15 15",
342
+ fill: "none",
343
+ xmlns: "http://www.w3.org/2000/svg",
344
+ children: /* @__PURE__ */ jsx(
345
+ "path",
346
+ {
347
+ d: "M13.2187 0L14.0142 0.795495L7.803 7.0065L14.0142 13.2187L13.2187 14.0142L7.0065 7.803L0.795495 14.0142L0 13.2187L6.21112 7.0065L0 0.795495L0.795495 0L7.0065 6.21112L13.2187 0Z",
348
+ fill: vars.chatbot.window.headerText
349
+ }
350
+ )
351
+ }
352
+ ) })
353
+ ]
354
+ }
355
+ )
356
+ ] })
206
357
  ] }),
207
358
  mounted && !state.online ? /* @__PURE__ */ jsx("div", { className: clsx(chatNetworkStatus), children: /* @__PURE__ */ jsxs(
208
359
  "div",
@@ -246,7 +397,7 @@ const ChatWindow = ({
246
397
  "div",
247
398
  {
248
399
  style: {
249
- fontSize: 13,
400
+ fontSize: 14,
250
401
  display: "flex",
251
402
  flexDirection: "column",
252
403
  gap: 4
@@ -281,24 +432,27 @@ const ChatWindow = ({
281
432
  },
282
433
  msg.$index
283
434
  ),
284
- /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: endChat, children: "End Chat" }) })
435
+ /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx(
436
+ "button",
437
+ {
438
+ className: endChatButtonStyle,
439
+ onClick: onCancelEndChat,
440
+ children: "End Chat"
441
+ }
442
+ ) })
285
443
  ] }),
286
444
  ["text", "markdown_template", "markdown"].includes(msg.type) && /* @__PURE__ */ jsx(
287
445
  "div",
288
446
  {
289
- className: messageStyle,
290
- style: {
291
- textAlign: msg.$userType == "end_user" ? "right" : "left",
292
- alignSelf: msg.$userType == "end_user" ? "flex-end" : "flex-start",
293
- background: msg.$userType == "end_user" ? endUserBg : chatbotBg,
294
- color: msg.$userType == "end_user" ? "#fff" : "#1F1F1F",
295
- boxShadow: msg.$userType == "end_user" ? "0 1px 4px #b3e0ff55" : void 0
296
- },
447
+ className: clsx(
448
+ messageStyle,
449
+ msg.$userType == "end_user" ? user_msg : agent_msg
450
+ ),
297
451
  children: /* @__PURE__ */ jsxs(
298
452
  "div",
299
453
  {
300
454
  style: {
301
- fontSize: 13,
455
+ fontSize: 14,
302
456
  display: "flex",
303
457
  flexDirection: "column",
304
458
  gap: 4
@@ -322,7 +476,7 @@ const ChatWindow = ({
322
476
  alt: "agent avatar"
323
477
  }
324
478
  ),
325
- /* @__PURE__ */ jsx("strong", { children: virtualAgent?.name })
479
+ showName && /* @__PURE__ */ jsx("strong", { children: virtualAgent?.name })
326
480
  ]
327
481
  }
328
482
  ),
@@ -335,14 +489,29 @@ const ChatWindow = ({
335
489
  "p",
336
490
  {
337
491
  style: { margin: 0, fontSize: "inherit" },
338
- title: new Date(msg.$timestamp).toLocaleString(),
492
+ title: new Date(msg.$timestamp).toLocaleTimeString(
493
+ [],
494
+ {
495
+ hour: "2-digit",
496
+ minute: "2-digit"
497
+ }
498
+ ),
339
499
  ...props
340
500
  }
341
501
  )
342
502
  },
343
503
  children: msg.content
344
504
  }
345
- ) : /* @__PURE__ */ jsx("div", { title: new Date(msg.$timestamp).toLocaleString(), children: msg.content })
505
+ ) : /* @__PURE__ */ jsx(
506
+ "div",
507
+ {
508
+ title: new Date(msg.$timestamp).toLocaleTimeString([], {
509
+ hour: "2-digit",
510
+ minute: "2-digit"
511
+ }),
512
+ children: msg.content
513
+ }
514
+ )
346
515
  ]
347
516
  }
348
517
  )
@@ -350,18 +519,10 @@ const ChatWindow = ({
350
519
  msg.$index
351
520
  ),
352
521
  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) => {
353
- const lastItem = msg.buttons && msg.buttons?.length - 1;
354
522
  return /* @__PURE__ */ jsx(
355
523
  "button",
356
524
  {
357
525
  className: inline_button,
358
- style: {
359
- borderRadius: "0px",
360
- borderTopLeftRadius: [0].includes(index) ? 8 : 0,
361
- borderTopRightRadius: [0].includes(index) ? 8 : 0,
362
- borderBottomLeftRadius: [lastItem].includes(index) ? 8 : 0,
363
- borderBottomRightRadius: [lastItem].includes(index) ? 8 : 0
364
- },
365
526
  onClick: () => {
366
527
  onSend(button?.title);
367
528
  },
@@ -388,7 +549,14 @@ const ChatWindow = ({
388
549
  ]
389
550
  }
390
551
  ),
391
- /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: endChat, children: "End Chat" }) })
552
+ /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx(
553
+ "button",
554
+ {
555
+ className: endChatButtonStyle,
556
+ onClick: onCancelEndChat,
557
+ children: "End Chat"
558
+ }
559
+ ) })
392
560
  ] })
393
561
  ] }, msg.$index)),
394
562
  showReconnect && /* @__PURE__ */ jsx(
@@ -402,14 +570,16 @@ const ChatWindow = ({
402
570
  ),
403
571
  /* @__PURE__ */ jsx("div", { ref: messagesEndRef })
404
572
  ] }),
405
- /* @__PURE__ */ jsxs(
573
+ /* @__PURE__ */ jsx("div", { style: { padding: "16px 16px 24px 16px" }, children: /* @__PURE__ */ jsxs(
406
574
  "form",
407
575
  {
408
576
  onSubmit: handleSend,
409
577
  style: {
410
- borderTop: "1px solid #eee",
411
- display: "flex"
578
+ borderRadius: 12,
579
+ border: `1px solid ${vars.chatbot.window.inputBorder}`,
580
+ display: "flex",
412
581
  // gap: 8,
582
+ padding: "12px 16px"
413
583
  },
414
584
  children: [
415
585
  /* @__PURE__ */ jsx(
@@ -428,7 +598,7 @@ const ChatWindow = ({
428
598
  }
429
599
  }
430
600
  },
431
- placeholder: "Ask something...",
601
+ placeholder: "Ask anything...",
432
602
  className: clsx(inputStyle, autoResize),
433
603
  autoFocus: true,
434
604
  disabled: inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected,
@@ -438,28 +608,37 @@ const ChatWindow = ({
438
608
  /* @__PURE__ */ jsx(
439
609
  "button",
440
610
  {
441
- className: clsx(sendButtonStyle, input.trim().length > 0 && "active"),
611
+ className: clsx(
612
+ sendButtonStyle,
613
+ input.trim().length > 0 && "active"
614
+ ),
442
615
  type: "submit",
443
616
  title: "Send message",
444
617
  disabled: inputDisabled || status !== "connected" || !input.trim() || messages.length == 0 || escalationDeflected,
445
- children: /* @__PURE__ */ jsxs(
618
+ children: /* @__PURE__ */ jsx(
446
619
  "svg",
447
620
  {
448
621
  xmlns: "http://www.w3.org/2000/svg",
449
- id: "send-icon",
450
- width: 24,
451
- height: 24,
452
- children: [
453
- /* @__PURE__ */ jsx("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" }),
454
- /* @__PURE__ */ jsx("path", { d: "M0 0h24v24H0z", fill: "none" })
455
- ]
622
+ width: "16",
623
+ height: "16",
624
+ viewBox: "0 0 16 16",
625
+ fill: "none",
626
+ children: /* @__PURE__ */ jsx(
627
+ "path",
628
+ {
629
+ fillRule: "evenodd",
630
+ clipRule: "evenodd",
631
+ d: "M0.0030533 5.42479C0.0273417 5.1795 0.193529 4.9714 0.427369 4.89345L15.0114 0.0320896C15.236 -0.0427712 15.4836 0.0156801 15.651 0.183075C15.8184 0.35047 15.8769 0.598075 15.802 0.822659L10.9407 15.4067C10.8627 15.6406 10.6546 15.8068 10.4093 15.8311C10.164 15.8553 9.92737 15.7332 9.80508 15.5192L6.35411 9.47999L0.314925 6.02903C0.100912 5.90673 -0.0212351 5.67008 0.0030533 5.42479ZM7.59169 9.1263L9.64202 12.7144C9.85645 13.0896 10.4138 13.0344 10.5505 12.6244L13.9046 2.56191C14.0349 2.17103 13.6631 1.79916 13.2722 1.92946L3.20969 5.28362C2.79967 5.4203 2.74448 5.97766 3.11973 6.19209L6.70781 8.24242L9.90579 5.04443C10.1499 4.80036 10.5456 4.80036 10.7897 5.04443C11.0337 5.28851 11.0337 5.68424 10.7897 5.92832L7.59169 9.1263Z",
632
+ fill: "#435164"
633
+ }
634
+ )
456
635
  }
457
636
  )
458
637
  }
459
638
  )
460
639
  ]
461
640
  }
462
- )
641
+ ) })
463
642
  ] });
464
643
  };
465
644
  export {
@@ -1,4 +1,3 @@
1
- import "./Chatbot.css.ts.vanilla.css.js";
2
1
  var chatbotAXB = "_1hpv6vm0";
3
2
  var chatbotUFB = "_1hpv6vm1";
4
3
  export {