@axos-web-dev/shared-components 1.0.100-dev.34 → 1.0.100-dev.35-chatbot-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ATMLocator/ATMLocator.js +1 -0
- package/dist/Auth/ErrorAlert.js +1 -0
- package/dist/Avatar/Avatar.module.js +7 -7
- package/dist/Blockquote/Blockquote.module.js +3 -3
- package/dist/Button/Button.js +1 -0
- package/dist/Calculators/Calculator.js +2 -1
- package/dist/Carousel/index.js +1 -0
- package/dist/Chatbot/Bubble.d.ts +3 -1
- package/dist/Chatbot/Bubble.js +6 -3
- package/dist/Chatbot/ChatWindow.css.js +1 -0
- package/dist/Chatbot/ChatWindow.d.ts +2 -6
- package/dist/Chatbot/Chatbot.css.js +0 -1
- package/dist/Chatbot/Chatbot.d.ts +6 -1
- package/dist/Chatbot/Chatbot.js +192 -22
- package/dist/Chatbot/index.d.ts +0 -1
- package/dist/Chatbot/index.js +0 -2
- package/dist/Chatbot/store/chat.d.ts +1 -0
- package/dist/Chatbot/store/chat.js +10 -3
- package/dist/Chevron/index.js +1 -0
- package/dist/Comparison/Comparison.js +1 -0
- package/dist/ExecutiveBio/ExecutiveBio.js +1 -0
- package/dist/FaqAccordion/index.js +1 -0
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +1 -0
- package/dist/Forms/ApplyNow.js +1 -0
- package/dist/Forms/ContactUsBusiness.js +1 -0
- package/dist/Forms/ContactUsBusinessNameEmail.js +1 -0
- package/dist/Forms/ContactUsNMLSId.js +1 -0
- package/dist/Forms/CraPublicFile.js +1 -0
- package/dist/Forms/EmailOnly.js +1 -0
- package/dist/Forms/MortgageRate/MortgageRateForm.js +1 -0
- package/dist/Forms/MortgageRate/MortgageRateWatch.js +1 -0
- package/dist/Forms/MortgageWarehouseLending.js +1 -0
- package/dist/Forms/SuccesForm.js +2 -1
- package/dist/Hyperlink/index.js +1 -0
- package/dist/ImageLink/ImageLink.js +1 -0
- package/dist/ImageLink/ImageLinkSet.js +1 -0
- package/dist/ImageLink/index.js +1 -0
- package/dist/Insight/Featured/CategorySelector.js +1 -0
- package/dist/Insight/Featured/Featured.js +1 -0
- package/dist/Insight/Featured/Header.js +1 -0
- package/dist/Modal/Modal.js +1 -0
- package/dist/NavigationMenu/AxosALTS/NavData.js +1 -0
- package/dist/NavigationMenu/AxosALTS/index.js +1 -0
- package/dist/NavigationMenu/AxosAdvisor/NavBar.module.js +52 -52
- package/dist/NavigationMenu/AxosAdvisorServices/NavBar.module.js +53 -53
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +16 -16
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +1 -0
- package/dist/NavigationMenu/AxosBank/NavBar.module.js +39 -39
- package/dist/NavigationMenu/AxosBank/NavData.js +1 -0
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +1 -0
- package/dist/NavigationMenu/AxosBank/index.js +1 -0
- package/dist/NavigationMenu/AxosClearing/NavBar.module.js +37 -37
- package/dist/NavigationMenu/AxosFiduciary/NavBar.module.js +41 -41
- package/dist/NavigationMenu/LaVictoire/NavData.js +1 -0
- package/dist/NavigationMenu/LaVictoire/index.js +1 -0
- package/dist/NavigationMenu/NavDataJson.js +1 -0
- package/dist/NavigationMenu/Navbar.js +1 -0
- package/dist/NavigationMenu/SignInNavButton.js +1 -0
- package/dist/SetContainer/SetContainer.js +1 -0
- package/dist/SocialMediaBar/iconsRepository.js +1 -0
- package/dist/VideoTile/VideoTile.js +1 -0
- package/dist/VideoWrapper/index.js +1 -0
- package/dist/assets/Avatar/Avatar.css.css +59 -59
- package/dist/assets/Blockquote/Blockquote.css.css +72 -72
- package/dist/assets/NavigationMenu/AxosAdvisor/NavBar.css.css +609 -609
- package/dist/assets/NavigationMenu/AxosAdvisorServices/NavBar.css.css +630 -630
- package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css.css +192 -192
- package/dist/assets/NavigationMenu/AxosBank/NavBar.css.css +445 -445
- package/dist/assets/NavigationMenu/AxosClearing/NavBar.css.css +484 -484
- package/dist/assets/NavigationMenu/AxosFiduciary/NavBar.css.css +427 -427
- package/dist/main.js +0 -2
- package/package.json +136 -136
|
@@ -73,6 +73,7 @@ import "../Chatbot/authenticate.js";
|
|
|
73
73
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
74
74
|
/* empty css */
|
|
75
75
|
import "../Chatbot/store/messages.js";
|
|
76
|
+
import "@ujet/websdk-headless";
|
|
76
77
|
/* empty css */
|
|
77
78
|
import "../Comparison/Comparison.css.js";
|
|
78
79
|
import "next/image.js";
|
package/dist/Auth/ErrorAlert.js
CHANGED
|
@@ -65,6 +65,7 @@ import "../Chatbot/authenticate.js";
|
|
|
65
65
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
66
66
|
/* empty css */
|
|
67
67
|
import "../Chatbot/store/messages.js";
|
|
68
|
+
import "@ujet/websdk-headless";
|
|
68
69
|
import { Hyperlink } from "../Hyperlink/index.js";
|
|
69
70
|
/* empty css */
|
|
70
71
|
import "../Comparison/Comparison.css.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import '../assets/Avatar/Avatar.css.css';const avatar_sec = "
|
|
2
|
-
const container = "
|
|
3
|
-
const image = "
|
|
4
|
-
const text = "
|
|
5
|
-
const name = "
|
|
6
|
-
const title = "
|
|
7
|
-
const description = "
|
|
1
|
+
import '../assets/Avatar/Avatar.css.css';const avatar_sec = "_avatar_sec_1clr6_1";
|
|
2
|
+
const container = "_container_1clr6_5";
|
|
3
|
+
const image = "_image_1clr6_14";
|
|
4
|
+
const text = "_text_1clr6_23";
|
|
5
|
+
const name = "_name_1clr6_29";
|
|
6
|
+
const title = "_title_1clr6_37";
|
|
7
|
+
const description = "_description_1clr6_44";
|
|
8
8
|
const css = {
|
|
9
9
|
avatar_sec,
|
|
10
10
|
container,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import '../assets/Blockquote/Blockquote.css.css';const quote_spacer = "
|
|
2
|
-
const author = "
|
|
3
|
-
const quote = "
|
|
1
|
+
import '../assets/Blockquote/Blockquote.css.css';const quote_spacer = "_quote_spacer_ovx4r_1";
|
|
2
|
+
const author = "_author_ovx4r_7";
|
|
3
|
+
const quote = "_quote_ovx4r_1";
|
|
4
4
|
const css = {
|
|
5
5
|
quote_spacer,
|
|
6
6
|
author,
|
package/dist/Button/Button.js
CHANGED
|
@@ -76,6 +76,7 @@ import "../Chatbot/authenticate.js";
|
|
|
76
76
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
77
77
|
/* empty css */
|
|
78
78
|
import "../Chatbot/store/messages.js";
|
|
79
|
+
import "@ujet/websdk-headless";
|
|
79
80
|
/* empty css */
|
|
80
81
|
import "../Comparison/Comparison.css.js";
|
|
81
82
|
import "next/image.js";
|
|
@@ -52,10 +52,11 @@ import "../Carousel/index.js";
|
|
|
52
52
|
/* empty css */
|
|
53
53
|
import "../Chatbot/store/chat.js";
|
|
54
54
|
import "../Chatbot/authenticate.js";
|
|
55
|
-
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
56
55
|
import "react-use";
|
|
56
|
+
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
57
57
|
/* empty css */
|
|
58
58
|
import "../Chatbot/store/messages.js";
|
|
59
|
+
import "@ujet/websdk-headless";
|
|
59
60
|
/* empty css */
|
|
60
61
|
import "../Comparison/Comparison.css.js";
|
|
61
62
|
import "next/image.js";
|
package/dist/Carousel/index.js
CHANGED
|
@@ -78,6 +78,7 @@ import "../Chatbot/authenticate.js";
|
|
|
78
78
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
79
79
|
/* empty css */
|
|
80
80
|
import "../Chatbot/store/messages.js";
|
|
81
|
+
import "@ujet/websdk-headless";
|
|
81
82
|
/* empty css */
|
|
82
83
|
import "../Comparison/Comparison.css.js";
|
|
83
84
|
import "next/image.js";
|
package/dist/Chatbot/Bubble.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
|
|
3
|
-
export declare const Bubble: ({ children }: PropsWithChildren
|
|
3
|
+
export declare const Bubble: ({ children, onClick, }: PropsWithChildren & {
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
package/dist/Chatbot/Bubble.js
CHANGED
|
@@ -3,10 +3,13 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { AnimatePresence, motion } from "framer-motion";
|
|
4
4
|
import { bubbleWrapper, svgFill } from "./Bubble.css.js";
|
|
5
5
|
import { useOpenChat } from "./store/chat.js";
|
|
6
|
-
const Bubble = ({
|
|
6
|
+
const Bubble = ({
|
|
7
|
+
children,
|
|
8
|
+
onClick = () => {
|
|
9
|
+
}
|
|
10
|
+
}) => {
|
|
7
11
|
const isOpen = useOpenChat((state) => state.isOpen);
|
|
8
|
-
|
|
9
|
-
return /* @__PURE__ */ jsxs("div", { className: bubbleWrapper, onClick: toggle, children: [
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", { className: bubbleWrapper, onClick, children: [
|
|
10
13
|
/* @__PURE__ */ jsx("div", { className: "bubble-circle flex", children: /* @__PURE__ */ jsx(AnimatePresence, { children: !isOpen ? /* @__PURE__ */ jsxs(
|
|
11
14
|
motion.svg,
|
|
12
15
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MessageResponse as BaseMessageResponse, HumanAgent } from '@ujet/websdk-headless';
|
|
1
|
+
import { MessageResponse as BaseMessageResponse, HumanAgent, VirtualAgent } from '@ujet/websdk-headless';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
|
|
4
4
|
interface MessageResponse extends BaseMessageResponse {
|
|
@@ -19,11 +19,7 @@ interface ChatWindowProps {
|
|
|
19
19
|
onClose?: () => void;
|
|
20
20
|
endChat?: () => void;
|
|
21
21
|
showReconnect?: boolean;
|
|
22
|
-
virtualAgent?:
|
|
23
|
-
avatar_url: string;
|
|
24
|
-
name: string;
|
|
25
|
-
id: string;
|
|
26
|
-
};
|
|
22
|
+
virtualAgent?: VirtualAgent | null;
|
|
27
23
|
showAvatar?: boolean;
|
|
28
24
|
}
|
|
29
25
|
export declare const ChatWindow: React.FC<ChatWindowProps>;
|
|
@@ -2,4 +2,9 @@ export type ChatbotProps = {
|
|
|
2
2
|
project?: "axos" | "ufb";
|
|
3
3
|
debug?: boolean;
|
|
4
4
|
};
|
|
5
|
-
export declare const Chatbot: (
|
|
5
|
+
export declare const Chatbot: ({ project, projectEnv, menuOption, }: {
|
|
6
|
+
project?: "axos" | "ufb";
|
|
7
|
+
projectEnv?: "dev" | "qa" | "uat" | "stg" | "prod";
|
|
8
|
+
menuOption?: "Support Virtual Agent" | string;
|
|
9
|
+
debug?: boolean;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
package/dist/Chatbot/Chatbot.js
CHANGED
|
@@ -2,37 +2,207 @@
|
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { authenticate } from "./authenticate.js";
|
|
4
4
|
import { Bubble } from "./Bubble.js";
|
|
5
|
-
import { chatbotUFB, chatbotAXB } from "./Chatbot.css.js";
|
|
6
5
|
import { ChatWindow } from "./ChatWindow.js";
|
|
7
6
|
import { useOpenChat } from "./store/chat.js";
|
|
8
7
|
import { useMessages } from "./store/messages.js";
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
import { Logger, consoleLoggerHandler, Client } from "@ujet/websdk-headless";
|
|
9
|
+
import { useRef, useState } from "react";
|
|
10
|
+
import { useMount, useUnmount } from "react-use";
|
|
11
|
+
const Chatbot = ({
|
|
12
|
+
project = "axos",
|
|
13
|
+
projectEnv = "dev",
|
|
14
|
+
menuOption = "Support Virtual Agent"
|
|
15
|
+
}) => {
|
|
16
|
+
const { hasOpenedOnce, toggle, reset } = useOpenChat();
|
|
17
|
+
const { addMessage, addMessages, clearMessages, messages } = useMessages();
|
|
18
|
+
const clientRef = useRef(null);
|
|
19
|
+
const menuRef = useRef(null);
|
|
20
|
+
const isMountedRef = useRef(false);
|
|
21
|
+
const chatRef = useRef(null);
|
|
22
|
+
const agent_virtual = useRef(null);
|
|
23
|
+
const [status, setStatus] = useState("idle");
|
|
24
|
+
const [hasStarted, setHasStarted] = useState(false);
|
|
25
|
+
const brandMap = /* @__PURE__ */ new Map([
|
|
26
|
+
["axos", 1],
|
|
27
|
+
["ufb", 3]
|
|
28
|
+
]);
|
|
29
|
+
const custom_data = {
|
|
30
|
+
unsigned: {
|
|
31
|
+
facingBrandId: {
|
|
32
|
+
label: "facingBrandId",
|
|
33
|
+
value: `${brandMap.get(project) || 1}`
|
|
34
|
+
},
|
|
35
|
+
channel: {
|
|
36
|
+
label: "channel",
|
|
37
|
+
value: "in_web"
|
|
38
|
+
},
|
|
39
|
+
user_auth: {
|
|
40
|
+
label: "user_auth",
|
|
41
|
+
value: "false"
|
|
42
|
+
},
|
|
43
|
+
env: {
|
|
44
|
+
label: "env",
|
|
45
|
+
value: projectEnv
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
if (projectEnv !== "prod") {
|
|
50
|
+
Logger.addHandler(consoleLoggerHandler);
|
|
51
|
+
}
|
|
52
|
+
const onReadyHandler = async () => {
|
|
53
|
+
console.log("Chat client is ready");
|
|
54
|
+
};
|
|
55
|
+
const onAuthenticatedHandler = async () => {
|
|
56
|
+
console.log("Chat client is authenticated");
|
|
57
|
+
};
|
|
58
|
+
const onChatOngoingHandler = async (chat) => {
|
|
59
|
+
console.log("Ongoing chat:", chat);
|
|
60
|
+
};
|
|
61
|
+
const onChatMessageHandler = async (message) => {
|
|
62
|
+
console.log("Received message:", message);
|
|
63
|
+
addMessage(message);
|
|
64
|
+
};
|
|
65
|
+
const onChatTypingStartedHandler = async (identity) => {
|
|
66
|
+
console.log("Typing started by:", identity);
|
|
67
|
+
};
|
|
68
|
+
const onChatDisconnectedHandler = async () => {
|
|
69
|
+
console.log("Chat disconnected");
|
|
70
|
+
setStatus("idle");
|
|
71
|
+
};
|
|
72
|
+
const onDismissedHandler = async () => {
|
|
73
|
+
console.log("Chat dismissed");
|
|
74
|
+
};
|
|
75
|
+
const onTimeoutHandler = async () => {
|
|
76
|
+
console.log("Chat timeout");
|
|
77
|
+
};
|
|
78
|
+
const onEndedHandler = async () => {
|
|
79
|
+
console.log("Chat ended");
|
|
80
|
+
setStatus("finished");
|
|
81
|
+
};
|
|
82
|
+
const onDestroyedHandler = async () => {
|
|
83
|
+
console.log("Chat destroyed");
|
|
84
|
+
};
|
|
85
|
+
const onChatMemberLeftHandler = async (identity) => {
|
|
86
|
+
console.log("Chat member left:", identity);
|
|
87
|
+
};
|
|
88
|
+
const registerEventHandlers = () => {
|
|
89
|
+
clientRef.current?.on("ready", onReadyHandler);
|
|
90
|
+
clientRef.current?.on("authenticated", onAuthenticatedHandler);
|
|
91
|
+
clientRef.current?.on("chat.ongoing", onChatOngoingHandler);
|
|
92
|
+
clientRef.current?.on("chat.message", onChatMessageHandler);
|
|
93
|
+
clientRef.current?.on("chat.typingStarted", onChatTypingStartedHandler);
|
|
94
|
+
clientRef.current?.on("chat.disconnected", onChatDisconnectedHandler);
|
|
95
|
+
clientRef.current?.on("chat.dismissed", onDismissedHandler);
|
|
96
|
+
clientRef.current?.on("chat.timeout", onTimeoutHandler);
|
|
97
|
+
clientRef.current?.on("chat.ended", onEndedHandler);
|
|
98
|
+
clientRef.current?.on("chat.destroyed", onDestroyedHandler);
|
|
99
|
+
clientRef.current?.on("chat.memberLeft", onChatMemberLeftHandler);
|
|
100
|
+
};
|
|
101
|
+
const deregisterEventHandlers = () => {
|
|
102
|
+
clientRef.current?.off("ready", onReadyHandler);
|
|
103
|
+
clientRef.current?.off("authenticated", onAuthenticatedHandler);
|
|
104
|
+
clientRef.current?.off("chat.ongoing", onDismissedHandler);
|
|
105
|
+
clientRef.current?.off("chat.message", onChatMessageHandler);
|
|
106
|
+
clientRef.current?.off("chat.typingStarted", onChatTypingStartedHandler);
|
|
107
|
+
clientRef.current?.off("chat.disconnected", onChatDisconnectedHandler);
|
|
108
|
+
clientRef.current?.off("chat.dismissed", onDismissedHandler);
|
|
109
|
+
clientRef.current?.off("chat.timeout", onTimeoutHandler);
|
|
110
|
+
clientRef.current?.off("chat.ended", onEndedHandler);
|
|
111
|
+
clientRef.current?.off("chat.destroyed", onDestroyedHandler);
|
|
112
|
+
clientRef.current?.off("chat.memberLeft", onChatMemberLeftHandler);
|
|
113
|
+
};
|
|
114
|
+
const createClient = async () => {
|
|
115
|
+
const client = new Client({
|
|
116
|
+
companyId: process.env.CCAI_COMPANY_ID || "",
|
|
117
|
+
tenant: process.env.CCAI_TENANT_NAME || "",
|
|
118
|
+
host: process.env.CCAI_HOST || "",
|
|
119
|
+
// or your region
|
|
120
|
+
authenticate
|
|
121
|
+
});
|
|
122
|
+
clientRef.current = client;
|
|
123
|
+
menuRef.current = await client.getMenus();
|
|
124
|
+
console.log("menus:", menuRef.current);
|
|
125
|
+
registerEventHandlers();
|
|
126
|
+
return;
|
|
127
|
+
};
|
|
128
|
+
const startChat = async () => {
|
|
129
|
+
console.log("Starting chat");
|
|
130
|
+
const client = clientRef.current;
|
|
131
|
+
if (!client) return;
|
|
132
|
+
try {
|
|
133
|
+
const ongoingChat = await client.loadOngoingChat();
|
|
134
|
+
if (ongoingChat) {
|
|
135
|
+
console.log("Ongoing chat found:", ongoingChat);
|
|
136
|
+
console.log("Resuming chat:", ongoingChat.id);
|
|
137
|
+
chatRef.current = await client.resumeChat(ongoingChat.id);
|
|
138
|
+
agent_virtual.current = ongoingChat.agent;
|
|
139
|
+
clientRef?.current?.on("chat.connected", async () => {
|
|
140
|
+
setStatus("connected");
|
|
141
|
+
console.log("connected");
|
|
142
|
+
const messages2 = await clientRef.current?.fetchMessages();
|
|
143
|
+
if (messages2) {
|
|
144
|
+
addMessages(messages2);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const foundMenu = menuRef.current.menus.find(
|
|
150
|
+
(menu) => menu.name === menuOption
|
|
151
|
+
);
|
|
152
|
+
const menuId = foundMenu && foundMenu.id;
|
|
153
|
+
console.log("Creating new chat with menu ID:", menuId);
|
|
154
|
+
const newChat = await client.createChat(menuId, { custom_data });
|
|
155
|
+
if (newChat !== null) {
|
|
156
|
+
chatRef.current = newChat;
|
|
157
|
+
console.log("Chat created id:", newChat.id);
|
|
158
|
+
}
|
|
159
|
+
} catch (err) {
|
|
160
|
+
console.error("Error creating chat:", err);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const handleClick = async () => {
|
|
164
|
+
toggle();
|
|
165
|
+
if (hasStarted) return;
|
|
166
|
+
if (!hasOpenedOnce) {
|
|
167
|
+
await startChat();
|
|
168
|
+
setHasStarted(true);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const onSendMessage = (msg) => {
|
|
172
|
+
console.log("Sending message:", msg);
|
|
173
|
+
clientRef.current?.sendTextMessage(msg);
|
|
174
|
+
};
|
|
175
|
+
const onEndChat = async () => {
|
|
176
|
+
console.log("Ending chat");
|
|
177
|
+
if (chatRef.current) {
|
|
178
|
+
await clientRef.current?.finishChat();
|
|
179
|
+
clearMessages();
|
|
180
|
+
chatRef.current = null;
|
|
181
|
+
console.log("Chat ended");
|
|
182
|
+
reset();
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
useMount(async () => {
|
|
186
|
+
console.log("Chatbot mounted");
|
|
187
|
+
if (isMountedRef.current) return;
|
|
188
|
+
isMountedRef.current = true;
|
|
189
|
+
await createClient();
|
|
190
|
+
});
|
|
191
|
+
useUnmount(() => {
|
|
192
|
+
console.log("Chatbot unmounted");
|
|
193
|
+
deregisterEventHandlers();
|
|
194
|
+
isMountedRef.current = false;
|
|
21
195
|
});
|
|
22
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
23
|
-
/* @__PURE__ */ jsx(Bubble, {}),
|
|
196
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
197
|
+
/* @__PURE__ */ jsx(Bubble, { onClick: handleClick }),
|
|
24
198
|
/* @__PURE__ */ jsx(
|
|
25
199
|
ChatWindow,
|
|
26
200
|
{
|
|
27
201
|
status,
|
|
28
|
-
|
|
202
|
+
virtualAgent: agent_virtual.current,
|
|
29
203
|
messages,
|
|
30
|
-
onSend:
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
endChat,
|
|
34
|
-
virtualAgent,
|
|
35
|
-
showReconnect
|
|
204
|
+
onSend: onSendMessage,
|
|
205
|
+
endChat: onEndChat
|
|
36
206
|
}
|
|
37
207
|
)
|
|
38
208
|
] });
|
package/dist/Chatbot/index.d.ts
CHANGED
package/dist/Chatbot/index.js
CHANGED
|
@@ -7,7 +7,6 @@ import { ChatWindow } from "./ChatWindow.js";
|
|
|
7
7
|
import { arrowFill, button_reset, chatFinishDialog, chatNetworkStatus, chat_title, chatbotMenu, chatbotMenuItem, endChatButtonStyle, inline_button, inline_button_wrapper, inputStyle, messageStyle, messagesContainerStyle, notificationStyle, sendButtonStyle, windowBarStyle, windowOpenStyle, windowStyle } from "./ChatWindow.css.js";
|
|
8
8
|
import { useOpenChat } from "./store/chat.js";
|
|
9
9
|
import { useMessages } from "./store/messages.js";
|
|
10
|
-
import { useHeadlessChat } from "./useHeadlessChat.js";
|
|
11
10
|
export {
|
|
12
11
|
Bubble,
|
|
13
12
|
ChatWindow,
|
|
@@ -31,7 +30,6 @@ export {
|
|
|
31
30
|
notificationStyle,
|
|
32
31
|
sendButtonStyle,
|
|
33
32
|
svgFill,
|
|
34
|
-
useHeadlessChat,
|
|
35
33
|
useMessages,
|
|
36
34
|
useOpenChat,
|
|
37
35
|
windowBarStyle,
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { create } from "zustand";
|
|
2
|
-
const useOpenChat = create((set) => ({
|
|
2
|
+
const useOpenChat = create((set, get) => ({
|
|
3
3
|
isOpen: false,
|
|
4
|
+
hasOpenedOnce: false,
|
|
4
5
|
toggle: () => set((state) => ({ isOpen: !state.isOpen })),
|
|
5
|
-
open: () =>
|
|
6
|
+
open: () => {
|
|
7
|
+
const alreadyOpened = get().hasOpenedOnce;
|
|
8
|
+
set({
|
|
9
|
+
isOpen: true,
|
|
10
|
+
hasOpenedOnce: alreadyOpened ? true : true
|
|
11
|
+
});
|
|
12
|
+
},
|
|
6
13
|
close: () => set({ isOpen: false }),
|
|
7
|
-
reset: () => set({ isOpen: false })
|
|
14
|
+
reset: () => set({ hasOpenedOnce: false, isOpen: false })
|
|
8
15
|
}));
|
|
9
16
|
export {
|
|
10
17
|
useOpenChat
|
package/dist/Chevron/index.js
CHANGED
|
@@ -78,6 +78,7 @@ import "../Chatbot/authenticate.js";
|
|
|
78
78
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
79
79
|
/* empty css */
|
|
80
80
|
import "../Chatbot/store/messages.js";
|
|
81
|
+
import "@ujet/websdk-headless";
|
|
81
82
|
/* empty css */
|
|
82
83
|
import "../Comparison/Comparison.css.js";
|
|
83
84
|
import "next/image.js";
|
|
@@ -78,6 +78,7 @@ import "../Chatbot/authenticate.js";
|
|
|
78
78
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
79
79
|
/* empty css */
|
|
80
80
|
import "../Chatbot/store/messages.js";
|
|
81
|
+
import "@ujet/websdk-headless";
|
|
81
82
|
/* empty css */
|
|
82
83
|
import { comparison_layout, comparison_content, headerComparison, feature_header, feature_title, comparison_feature, comparison_list, comparison_buttons, comparison } from "./Comparison.css.js";
|
|
83
84
|
import "next/image.js";
|
|
@@ -78,6 +78,7 @@ import "../Chatbot/authenticate.js";
|
|
|
78
78
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
79
79
|
/* empty css */
|
|
80
80
|
import "../Chatbot/store/messages.js";
|
|
81
|
+
import "@ujet/websdk-headless";
|
|
81
82
|
/* empty css */
|
|
82
83
|
import "../Comparison/Comparison.css.js";
|
|
83
84
|
import "next/image.js";
|
|
@@ -79,6 +79,7 @@ import "../Chatbot/authenticate.js";
|
|
|
79
79
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
80
80
|
/* empty css */
|
|
81
81
|
import "../Chatbot/store/messages.js";
|
|
82
|
+
import "@ujet/websdk-headless";
|
|
82
83
|
/* empty css */
|
|
83
84
|
import "../Comparison/Comparison.css.js";
|
|
84
85
|
import "next/image.js";
|
|
@@ -74,6 +74,7 @@ import "../../Chatbot/authenticate.js";
|
|
|
74
74
|
import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
75
75
|
/* empty css */
|
|
76
76
|
import "../../Chatbot/store/messages.js";
|
|
77
|
+
import "@ujet/websdk-headless";
|
|
77
78
|
/* empty css */
|
|
78
79
|
import "../../Comparison/Comparison.css.js";
|
|
79
80
|
import "next/image.js";
|
package/dist/Forms/ApplyNow.js
CHANGED
|
@@ -79,6 +79,7 @@ import "../Chatbot/authenticate.js";
|
|
|
79
79
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
80
80
|
/* empty css */
|
|
81
81
|
import "../Chatbot/store/messages.js";
|
|
82
|
+
import "@ujet/websdk-headless";
|
|
82
83
|
/* empty css */
|
|
83
84
|
import "../Comparison/Comparison.css.js";
|
|
84
85
|
import "next/image.js";
|
|
@@ -80,6 +80,7 @@ import "../Chatbot/authenticate.js";
|
|
|
80
80
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
81
81
|
/* empty css */
|
|
82
82
|
import "../Chatbot/store/messages.js";
|
|
83
|
+
import "@ujet/websdk-headless";
|
|
83
84
|
/* empty css */
|
|
84
85
|
import "../Comparison/Comparison.css.js";
|
|
85
86
|
import "next/image.js";
|
|
@@ -80,6 +80,7 @@ import "../Chatbot/authenticate.js";
|
|
|
80
80
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
81
81
|
/* empty css */
|
|
82
82
|
import "../Chatbot/store/messages.js";
|
|
83
|
+
import "@ujet/websdk-headless";
|
|
83
84
|
/* empty css */
|
|
84
85
|
import "../Comparison/Comparison.css.js";
|
|
85
86
|
import "next/image.js";
|
|
@@ -80,6 +80,7 @@ import "../Chatbot/authenticate.js";
|
|
|
80
80
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
81
81
|
/* empty css */
|
|
82
82
|
import "../Chatbot/store/messages.js";
|
|
83
|
+
import "@ujet/websdk-headless";
|
|
83
84
|
/* empty css */
|
|
84
85
|
import "../Comparison/Comparison.css.js";
|
|
85
86
|
import "next/image.js";
|
|
@@ -80,6 +80,7 @@ import "../Chatbot/authenticate.js";
|
|
|
80
80
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
81
81
|
/* empty css */
|
|
82
82
|
import "../Chatbot/store/messages.js";
|
|
83
|
+
import "@ujet/websdk-headless";
|
|
83
84
|
/* empty css */
|
|
84
85
|
import "../Comparison/Comparison.css.js";
|
|
85
86
|
import "next/image.js";
|
package/dist/Forms/EmailOnly.js
CHANGED
|
@@ -81,6 +81,7 @@ import "../Chatbot/authenticate.js";
|
|
|
81
81
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
82
82
|
/* empty css */
|
|
83
83
|
import "../Chatbot/store/messages.js";
|
|
84
|
+
import "@ujet/websdk-headless";
|
|
84
85
|
/* empty css */
|
|
85
86
|
import "../Comparison/Comparison.css.js";
|
|
86
87
|
import "next/image.js";
|
|
@@ -81,6 +81,7 @@ import "../../Chatbot/authenticate.js";
|
|
|
81
81
|
import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
82
82
|
/* empty css */
|
|
83
83
|
import "../../Chatbot/store/messages.js";
|
|
84
|
+
import "@ujet/websdk-headless";
|
|
84
85
|
/* empty css */
|
|
85
86
|
import "../../Comparison/Comparison.css.js";
|
|
86
87
|
import "next/image.js";
|
|
@@ -77,6 +77,7 @@ import "../../Chatbot/authenticate.js";
|
|
|
77
77
|
import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
78
78
|
/* empty css */
|
|
79
79
|
import "../../Chatbot/store/messages.js";
|
|
80
|
+
import "@ujet/websdk-headless";
|
|
80
81
|
/* empty css */
|
|
81
82
|
import "../../Comparison/Comparison.css.js";
|
|
82
83
|
import "next/image.js";
|
|
@@ -80,6 +80,7 @@ import "../Chatbot/authenticate.js";
|
|
|
80
80
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
81
81
|
/* empty css */
|
|
82
82
|
import "../Chatbot/store/messages.js";
|
|
83
|
+
import "@ujet/websdk-headless";
|
|
83
84
|
/* empty css */
|
|
84
85
|
import "../Comparison/Comparison.css.js";
|
|
85
86
|
import "next/image.js";
|
package/dist/Forms/SuccesForm.js
CHANGED
|
@@ -61,10 +61,11 @@ import "../Carousel/index.js";
|
|
|
61
61
|
/* empty css */
|
|
62
62
|
import "../Chatbot/store/chat.js";
|
|
63
63
|
import "../Chatbot/authenticate.js";
|
|
64
|
-
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
65
64
|
import "react-use";
|
|
65
|
+
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
66
66
|
/* empty css */
|
|
67
67
|
import "../Chatbot/store/messages.js";
|
|
68
|
+
import "@ujet/websdk-headless";
|
|
68
69
|
/* empty css */
|
|
69
70
|
import "../Comparison/Comparison.css.js";
|
|
70
71
|
import "next/image.js";
|
package/dist/Hyperlink/index.js
CHANGED
|
@@ -73,6 +73,7 @@ import "../Chatbot/authenticate.js";
|
|
|
73
73
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
74
74
|
/* empty css */
|
|
75
75
|
import "../Chatbot/store/messages.js";
|
|
76
|
+
import "@ujet/websdk-headless";
|
|
76
77
|
/* empty css */
|
|
77
78
|
import "../Comparison/Comparison.css.js";
|
|
78
79
|
import "next/image.js";
|
|
@@ -72,6 +72,7 @@ import "../Chatbot/authenticate.js";
|
|
|
72
72
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
73
73
|
/* empty css */
|
|
74
74
|
import "../Chatbot/store/messages.js";
|
|
75
|
+
import "@ujet/websdk-headless";
|
|
75
76
|
/* empty css */
|
|
76
77
|
import "../Comparison/Comparison.css.js";
|
|
77
78
|
import "../Tab/Tab.css.js";
|
|
@@ -79,6 +79,7 @@ import "../Chatbot/authenticate.js";
|
|
|
79
79
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
80
80
|
/* empty css */
|
|
81
81
|
import "../Chatbot/store/messages.js";
|
|
82
|
+
import "@ujet/websdk-headless";
|
|
82
83
|
/* empty css */
|
|
83
84
|
import "../Comparison/Comparison.css.js";
|
|
84
85
|
import "../Tab/Tab.css.js";
|
package/dist/ImageLink/index.js
CHANGED
|
@@ -71,6 +71,7 @@ import "../Chatbot/authenticate.js";
|
|
|
71
71
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
72
72
|
/* empty css */
|
|
73
73
|
import "../Chatbot/store/messages.js";
|
|
74
|
+
import "@ujet/websdk-headless";
|
|
74
75
|
/* empty css */
|
|
75
76
|
import "../Comparison/Comparison.css.js";
|
|
76
77
|
import "next/image.js";
|
|
@@ -75,6 +75,7 @@ import "../../Chatbot/authenticate.js";
|
|
|
75
75
|
import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
76
76
|
/* empty css */
|
|
77
77
|
import "../../Chatbot/store/messages.js";
|
|
78
|
+
import "@ujet/websdk-headless";
|
|
78
79
|
/* empty css */
|
|
79
80
|
import "../../Comparison/Comparison.css.js";
|
|
80
81
|
import "next/image.js";
|
|
@@ -76,6 +76,7 @@ import "../../Chatbot/authenticate.js";
|
|
|
76
76
|
import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
77
77
|
/* empty css */
|
|
78
78
|
import "../../Chatbot/store/messages.js";
|
|
79
|
+
import "@ujet/websdk-headless";
|
|
79
80
|
/* empty css */
|
|
80
81
|
import "../../Comparison/Comparison.css.js";
|
|
81
82
|
import Image from "next/image.js";
|