@inleads/inleads-widgets
Version:
Widgets for chatbot, WhatsApp, nps, contact-form
680 lines (679 loc) • 32.8 kB
JavaScript
import { h } from "@stencil/core";
import send from "./assets/images/send.svg";
import close from "./assets/images/close.svg";
import chatbotDefaultImage from "./assets/images/chat-bot-robo-icon.svg";
import imageCloseicon from "./assets/images/close-outline-icon.svg";
import imageUpload from "./assets/images/image-upload-icon.svg";
import { marked, Renderer } from "marked";
import DOMPurify from "dompurify";
const renderer = new Renderer();
renderer.link = ({ href, tokens }) => {
const text = tokens.map((token) => token.raw).join(""); // Extract text safely
const safeHref = DOMPurify.sanitize(href || "#");
return `<a href="${safeHref}" target="_blank" rel="noopener noreferrer">${text}</a>`;
};
marked.use({ renderer });
export class ChatbotWidget {
constructor() {
this.IMAGE_VALIDATION = {
maxSize: 5 * 1024 * 1024, // 5MB in bytes
allowedTypes: ['image/jpeg', 'image/jpg', 'image/png']
};
this.handleFileChange = async (event) => {
var _a, _b, _c;
const input = event.target;
const files = input.files;
this.imageUploadErrorStatus = false;
if (!files || files.length === 0) {
console.warn("No file selected.");
return;
}
for (const file of Array.from(files)) {
const validationResult = this.validateImageFile(file);
if (!validationResult.isValid) {
console.warn((_a = validationResult.error) === null || _a === void 0 ? void 0 : _a.title, (_b = validationResult.error) === null || _b === void 0 ? void 0 : _b.description);
this.imageUploadErrorMsg = (_c = validationResult.error) === null || _c === void 0 ? void 0 : _c.description;
this.imageUploadErrorStatus = true;
setTimeout(() => {
this.imageUploadErrorStatus = false;
}, 3000);
continue;
}
try {
const base64Image = await new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => {
const result = reader.result;
resolve(result);
};
reader.onerror = () => reject(new Error("Error reading file"));
reader.readAsDataURL(file);
});
this.imagePreview = base64Image;
this.senderImageList = base64Image;
}
catch (error) {
console.error("File processing error:", error);
}
}
input.value = "";
};
this.handleRemoveImage = () => {
this.imagePreview = "";
this.senderImageList = "";
};
this.audioPlayer = async () => {
try {
const audio = new Audio('https://azure.healthvox.ai/assets/popup-sound.mp3');
await audio.play();
}
catch (error) {
// Silently handle any errors to prevent breaking the widget
// console.log('Audio notification not available');
}
};
this.handleUserInteraction = () => {
// If greeting has been loaded, play the audio
if (this.greetingLoaded) {
this.audioPlayer();
this.greetingLoaded = false; // Reset so it only plays once
}
document.removeEventListener('click', this.handleUserInteraction);
document.removeEventListener('scroll', this.handleUserInteraction);
};
this.handlePromptButtonClick = async (userMessage) => {
if (this.loading)
return;
this.chatInput.value = '';
this.messages = [...this.messages, { text: userMessage, type: 'user', image: this.imagePreview }];
this.scrollToBottom();
this.loading = true;
if (!this.callObjectId) {
await this.saveCall();
}
this.generateResponse(userMessage);
};
this.apiKey = undefined;
this.agentId = undefined;
this.emailId = undefined;
this.userName = undefined;
this.chatbotApiKey = undefined;
this.agentIdState = undefined;
this.messages = [];
this.loading = false;
this.closeStatus = true;
this.botName = undefined;
this.greetingsMessage = undefined;
this.textColor = undefined;
this.botBubbleColor = undefined;
this.botImage = undefined;
this.chatBoxColor = undefined;
this.domainNames = undefined;
this.validOrigin = false;
this.closeBotMessageHint = true;
this.preprompts = [];
this.profileText = undefined;
this.entityName = undefined;
this.agentDeletionStatus = undefined;
this.name = undefined;
this.email = undefined;
this.errors = {};
this.isChatBoxVisible = false;
this.isRegisterForm = false;
this.contactObjectId = undefined;
this.callObjectId = undefined;
this.contactEntityId = undefined;
this.phoneNumber = null;
this.model = undefined;
this.imageUploadErrorStatus = false;
this.imageUploadErrorMsg = undefined;
this.imagePreview = '';
this.senderImageList = '';
this.uploadStatus = '';
this.isUploading = false;
this.showDate = undefined;
this.greetingLoaded = false;
this.footerDisclaimer = undefined;
this.popupMessage = undefined;
}
validateImageFile(file) {
if (!this.IMAGE_VALIDATION.allowedTypes.includes(file.type)) {
return {
isValid: false,
error: {
title: "Invalid file type",
description: "Please select a JPG, JPEG, or PNG image"
}
};
}
if (file.size > this.IMAGE_VALIDATION.maxSize) {
return {
isValid: false,
error: {
title: "File too large",
description: "Please select an image smaller than 5MB"
}
};
}
return { isValid: true };
}
validateForm() {
let formIsValid = true;
const errors = {};
const nameRegex = /^[a-zA-Z\s]+$/;
if (!this.name) {
formIsValid = false;
errors['name'] = 'Name is required.';
}
else if (!nameRegex.test(this.name)) {
formIsValid = false;
errors['name'] = 'Name must contain only letters and spaces.';
}
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!this.email) {
formIsValid = false;
errors['email'] = 'Email is required.';
}
else if (!emailRegex.test(this.email)) {
formIsValid = false;
errors['email'] = 'Enter a valid email address.';
}
if (this.phoneNumber && !/^\d{10}$/.test(this.phoneNumber)) {
formIsValid = false;
errors['phone'] = 'Phone number must be 10 digits.';
}
this.errors = errors;
return formIsValid;
}
componentWillLoad() {
document.addEventListener('click', this.handleUserInteraction);
document.addEventListener('scroll', this.handleUserInteraction);
this.loadUserData();
this.toggleRegisterForm();
this.initializeChatbot();
if (this.emailId && this.apiKey) {
this.email = this.emailId;
this.name = this.userName;
this.phoneNumber;
this.sendingUserData();
}
}
handleSubmit() {
if (this.validateForm()) {
this.sendingUserData();
this.storeUserData();
this.isChatBoxVisible = !this.isChatBoxVisible;
}
}
handleSkipForm() {
this.isChatBoxVisible = !this.isChatBoxVisible;
}
handleHintMessageBlock() {
// Only hide the message temporarily for the current session
// It will reappear when the chat is closed and reopened
this.closeBotMessageHint = true;
}
async sendingUserData() {
const payload = {
name: this.name,
email: this.email,
phoneNumber: this.phoneNumber || undefined,
apiKey: this.chatbotApiKey,
};
try {
this.callObjectId = '';
const response = await fetch("https://prod1.healthvox.ai/chatBot/savingContactFromWidget", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
const data = await response.json();
this.contactObjectId = data.objectId;
this.contactEntityId = data.entity.objectId;
// console.log("User data saved:", data);
}
catch (error) {
console.error("Error saving user data:", error);
}
}
async saveCall() {
try {
const response = await fetch("https://prod1.healthvox.ai/chatBot/save-call-details", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ agentId: this.agentIdState,
contactId: this.contactObjectId, entityId: this.contactEntityId }),
});
const data = await response.json();
this.callObjectId = data.objectId;
if (response.ok) {
// console.log("Call saved successfully:", data);
}
else {
// console.error("Error saving call:", data);
}
}
catch (error) {
console.error("Error in saveCall function:", error);
}
}
hexToRgb(hex) {
hex = hex.replace(/^#/, '');
const r = parseInt(hex.slice(0, 2), 16);
const g = parseInt(hex.slice(2, 4), 16);
const b = parseInt(hex.slice(4, 6), 16);
return `rgb(${r}, ${g}, ${b})`;
}
hexToRgba(hex, opacity) {
const rgb = this.hexToRgb(hex);
return rgb.replace('rgb', 'rgba').replace(')', `, ${opacity})`);
}
toggleChatBox() {
this.isChatBoxVisible = !this.isChatBoxVisible;
}
toggleRegisterForm() {
var _a;
const emailPattern = /^[^\s@]+@[^\s@]+\.[a-zA-Z0-9-]+$/;
if ((!emailPattern.test(this.emailId)) ||
((_a = this.userName) === null || _a === void 0 ? void 0 : _a.trim()) === "") {
this.isRegisterForm = true;
this.isChatBoxVisible = false;
}
else {
this.isRegisterForm = false;
this.isChatBoxVisible = true;
}
}
storeUserData() {
localStorage.setItem('userName', this.name);
localStorage.setItem('userEmail', this.email);
localStorage.setItem('userMobileNumber', JSON.stringify(this.phoneNumber));
}
async initializeChatbot() {
this.chatbotApiKey = this.apiKey;
this.agentIdState = this.agentId;
await this.validateApiKey();
await this.fetchAgentSettings();
setTimeout(() => {
this.closeBotMessageHint = false;
}, 3000);
// if (!this.callObjectId) {
// await this.saveCall();
// }
}
async validateApiKey() {
try {
const response = await fetch("https://prod1.healthvox.ai/chatBot/validateChatbotApiKey", {
method: "POST",
body: JSON.stringify({ apiKey: this.chatbotApiKey }),
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
});
await response.json();
// console.log("API Key validated:", data);
}
catch (error) {
console.error("Error in sending API key:", error);
}
}
async fetchAgentSettings() {
try {
const response = await fetch("https://prod1.healthvox.ai/chatBot/getAgentSettingsData", {
method: "POST",
body: JSON.stringify({ apiKey: this.chatbotApiKey, agentId: this.agentIdState }),
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
// console.log(data)
if (data) {
this.botName = this.capitalizeName(data.name || "Agent");
this.preprompts = this.filteringArray(data.prompts || []);
this.greetingsMessage = data.greeting || "";
this.botImage = data.chatBotImage || chatbotDefaultImage;
this.textColor = data.textColor || "#ffffff";
this.botBubbleColor = data.botBubbleColor || "#000000";
this.chatBoxColor = data.botBoxColor || "#1b1464";
this.domainNames = data.domains || [];
this.entityName = this.capitalizeName(data.entity.name);
this.agentDeletionStatus = data.isDeleted || false;
this.model = data.model || "";
this.footerDisclaimer = data.entity.footerDisclaimer || "";
this.popupMessage = data.chatbotWelcomeMessage || "Hi how can I help you?";
// Mark greeting as loaded so audio will play on next user interaction
this.greetingLoaded = true;
// Ensure the greeting message is visible when the component loads
if (this.closeStatus) {
this.closeBotMessageHint = false;
}
// Try to play audio, but this might be blocked by browser
try {
setTimeout(() => {
this.audioPlayer().catch(() => {
// console.log('Audio will play on next user interaction');
});
}, 300);
}
catch (error) {
// console.log('Audio will play on next user interaction');
}
const originUrl = window.location.origin;
const abbreviation = this.entityName.split(" ").length > 1 ? this.entityName.split(" ").map(word => word[0]).join("").slice(0, 2) : this.entityName.charAt(0);
this.profileText = abbreviation;
// For local development, always set validOrigin to true
const isLocalhost = originUrl.includes('localhost') || originUrl.includes('127.0.0.1');
if (isLocalhost || (Array.isArray(this.domainNames) && this.domainNames.some(name => originUrl.includes(name)))) {
this.validOrigin = true;
}
else {
this.validOrigin = false;
}
this.showDate = this.getFormattedDate();
}
}
catch (error) {
console.error("Error fetching chatbot settings:", error);
}
}
capitalizeName(name) {
return name.replace(/\b\w/g, char => char.toUpperCase());
}
filteringArray(arr) {
const filterList = arr.filter(i => i !== "");
return filterList;
}
async handleChat() {
if (this.loading)
return;
const userMessage = this.chatInput.value.trim();
if (!userMessage)
return;
this.messages = [...this.messages, { text: userMessage, type: 'user', image: this.imagePreview }];
this.chatInput.value = '';
this.imagePreview = "";
this.scrollToBottom();
this.loading = true;
if (!this.callObjectId) {
await this.saveCall();
}
this.generateResponse(userMessage);
}
async generateResponse(userQuery) {
try {
const response = await fetch("https://prod1.healthvox.ai/chatBot/getAiResponse", {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
userQuery: userQuery,
imageData: this.senderImageList ? this.senderImageList.split(',')[1] : null,
apiKey: this.chatbotApiKey,
agentId: this.agentIdState,
contactId: this.contactObjectId,
entityId: this.contactEntityId,
callId: this.callObjectId
}),
});
const data = await response.json();
const botResponseMessage = data && response.ok ? data.trim() : 'Oops! Something went wrong. Please try again.';
this.messages = [...this.messages, { text: botResponseMessage, type: 'bot', image: null }];
}
catch (error) {
console.error("Error generating response:", error);
this.messages = [...this.messages, { text: 'Oops! Something went wrong. Please try again.', type: 'bot', image: null }];
}
finally {
this.audioPlayer();
this.loading = false;
this.scrollToBottom();
this.senderImageList = null;
this.chatInput.value = "";
}
}
scrollToBottom() {
requestAnimationFrame(() => {
const chatbotWidget = document.querySelector('chatbot-widget');
const shadowRoot = chatbotWidget === null || chatbotWidget === void 0 ? void 0 : chatbotWidget.shadowRoot;
this.chatbox = shadowRoot === null || shadowRoot === void 0 ? void 0 : shadowRoot.querySelector('.ai-user-chatbox');
if (this.chatbox) {
this.chatbox.scrollTop = this.chatbox.scrollHeight;
}
});
}
handleKeyPress(event) {
var _a;
// Prevent default behavior for spacebar to stop page scrolling
if (event.key === ' ' || event.code === 'Space') {
// Don't prevent default for spacebar as it should add space in the textarea
// Just stop propagation to prevent page scrolling
event.stopPropagation();
}
if (event.key === 'Enter' && !event.shiftKey) {
event.preventDefault();
if (this.loading)
return;
const message = (_a = this.chatInput) === null || _a === void 0 ? void 0 : _a.value.trim();
if (message)
this.handleChat();
}
}
toggleChatWidget() {
this.closeStatus = !this.closeStatus;
this.scrollToBottom();
// Show greeting message when chat is closed
if (this.closeStatus) {
this.closeBotMessageHint = false; // Show the greeting when chat is closed
}
else {
this.closeBotMessageHint = true; // Hide the greeting when chat is open
}
// If greeting has been loaded but audio hasn't played yet, play it now
if (this.greetingLoaded) {
this.audioPlayer();
this.greetingLoaded = false; // Reset so it only plays once
}
}
loadUserData() {
const storedName = localStorage.getItem('userName');
const storedEmail = localStorage.getItem('userEmail');
const storedMobileNumber = localStorage.getItem('userMobileNumber');
if (storedName) {
this.userName = storedName;
this.name = storedName;
}
if (storedEmail) {
this.emailId = storedEmail;
this.email = storedEmail;
}
if (storedMobileNumber) {
this.phoneNumber = JSON.parse(storedMobileNumber);
}
}
convertMarkdownToHTML(text) {
if (!text)
return null;
const rawHTML = marked.parse(text);
return DOMPurify.sanitize(rawHTML, { ADD_ATTR: ["target"] });
}
getFormattedDate() {
const date = new Date();
return new Intl.DateTimeFormat('en-US', {
month: 'short',
day: '2-digit',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
hour12: true,
}).format(date);
}
render() {
if (!this.validOrigin || this.agentDeletionStatus) {
return null;
}
return (h("div", { class: "ai-user-chat-container" }, this.closeStatus ? (h("div", { class: "ai-user-robot-container" }, this.closeBotMessageHint ? null :
h("div", { class: "chatbot-message-container" }, h("div", { class: "chatbot-message-blue", style: { backgroundColor: this.chatBoxColor, '--chat-box-color': this.chatBoxColor }, onClick: () => this.toggleChatWidget() }, h("p", { class: "chatbot-message-content", style: { color: this.textColor, } }, h("span", { class: "wave-emoji" }, "\uD83D\uDC4B"), this.popupMessage), h("div", { class: "msg-close-btn-container", onClick: (e) => { e.stopPropagation(); this.handleHintMessageBlock(); } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: this.textColor, id: "Layer_1", "data-name": "Layer 1", viewBox: "0 0 24 24", width: "16", height: "16" }, h("path", { d: "M12,0A12,12,0,1,0,24,12,12,12,0,0,0,12,0Zm4.707,15.293-1.414,1.414L12,13.414,8.707,16.707,7.293,15.293,10.586,12,7.293,8.707,8.707,7.293,12,10.586l3.293-3.293,1.414,1.414L13.414,12Z" }))))), h("div", { class: "chatbot-image-container", style: { backgroundColor: this.chatBoxColor } }, h("img", { style: { backgroundColor: this.chatBoxColor }, class: "ai-chatbot-image", src: this.botImage, alt: "chat-bot", onClick: () => this.toggleChatWidget() })))) : (!this.isChatBoxVisible ?
(h("div", { class: "ai-user-chat-widget ai-user-chat-form" }, h("div", { class: "ai-chatbot-main-heading chatbot-form", style: { backgroundColor: this.chatBoxColor } }, h("div", { class: "profile-heading-chatbot" }, h("h3", { class: "ai-form-heading ", style: { color: this.textColor } }, "Chat With Us", h("span", { class: "greeting-info" }, `Welcome to ${this.entityName}!`))), h("button", { class: "ai-chatbot-btn ai-chatbot-btn-close", onClick: () => this.toggleChatWidget() }, h("img", { class: "ai-chatbot-close-image", src: close, alt: "close" }))), h("div", { class: "ai-user-chatbox ai-user-chatbot-form-conatiner", id: "chatBot", style: { border: "none" } }, h("div", { class: "chat-logs" }, h("form", null, h("div", { class: "form-group" }, h("label", null, h("span", { class: "required" }, "*"), "Name"), h("input", { type: "text", value: this.name, onInput: (e) => (this.name = e.target.value), class: "form-control" }), this.errors['name'] && h("div", { class: "error-message" }, this.errors['name'])), h("div", { class: "form-group" }, h("label", null, h("span", { class: "required" }, "*"), "Email"), h("input", { type: "email", value: this.email, onInput: (e) => (this.email = e.target.value), class: "form-control" }), this.errors['email'] && h("div", { class: "error-message" }, this.errors['email'])), h("div", { class: "form-group" }, h("label", null, "Phone Number"), h("input", { type: "tel", value: this.phoneNumber, pattern: "[0-9]{10}", maxlength: "10", onInput: (e) => {
const value = e.target.value.replace(/[^0-9]/g, '');
if (value.length <= 10) {
this.phoneNumber = value;
}
}, class: "form-control" }), this.errors['phone'] && h("div", { class: "error-message" }, this.errors['phone']))), h("div", { class: "chatbot-form-buttons" }, h("button", { type: "button", class: "btn-form-submit", onClick: () => this.handleSubmit(), style: { backgroundColor: this.chatBoxColor, color: this.textColor, border: "none" } }, "Submit")))), h("div", { class: "chat-accreditation" }, "Powered by ", h("a", { class: "accreditation", href: "https://inleads.ai", target: "_blank" }, "Inleads.ai")))) : (h("div", { class: "ai-user-chat-widget ai-user-chatbot-widget" }, h("div", { class: "ai-chatbot-main-heading", style: { backgroundColor: this.chatBoxColor } }, h("div", { class: "profile-heading-chatbot" }, h("div", { class: "profile-abbreviation-block", style: {
'--text-length': `${this.profileText.length}}`,
} }, h("h3", { class: "profile-abbreviation", style: {
color: this.chatBoxColor,
} }, this.profileText)), h("h3", { class: "ai-user-heading", style: { color: this.textColor } }, this.entityName, h("span", { class: "agent-name" }, this.botName))), h("button", { class: "ai-chatbot-btn ai-chatbot-btn-close", onClick: () => this.toggleChatWidget() }, h("img", { class: "ai-chatbot-close-image", src: close, alt: "close" }))), h("div", { class: "ai-user-chatbox", id: "chatBot" }, this.showDate ?
h("div", { class: "show-date", style: { color: this.chatBoxColor } }, this.showDate)
: null, h("div", { class: 'ai-chatbot-chat-message ai-chatbot-bot' }, h("div", { innerHTML: this.convertMarkdownToHTML(this.greetingsMessage) })), this.preprompts.length > 0 ? (h("div", { class: 'ai-chatbot-chat-message ai-chatbot-user ai-chatbot-prompts' }, h("div", { class: "preprompts-container" }, this.preprompts.map((item, index) => (item === "" ? null :
h("button", { key: index, type: 'button', class: "preprompt-button", style: { '--chat-box-prompt-color': this.chatBoxColor }, onClick: () => this.handlePromptButtonClick(item) }, item)))))) : null, this.messages.map((message, index) => (h("div", { class: `ai-chatbot-chat-message ai-chatbot-${message.type}`, style: {
backgroundColor: message.type === 'user' ? this.hexToRgba(this.chatBoxColor, 0.25) : '', // Set RGBA color for user messages
}, key: index }, message.type === 'user' ?
h("div", { class: "images-list-preview" }, message.type === 'user' && message.image ? (h("div", { class: "image-preview-container sender-image-item", key: index }, h("img", { src: message.image, alt: "Preview", class: "image-preview image-sender" }))) : null) : null, h("div", { innerHTML: this.convertMarkdownToHTML(message.text) })))), this.loading && (h("div", { class: "ai-chatbot-loading" }, h("div", { class: "ai-chatbot-music-loader" }, h("div", { class: "ai-loading-bar", style: { backgroundColor: this.botBubbleColor } }), h("div", { class: "ai-loading-bar", style: { backgroundColor: this.botBubbleColor } }), h("div", { class: "ai-loading-bar", style: { backgroundColor: this.botBubbleColor } }), h("div", { class: "ai-loading-bar", style: { backgroundColor: this.botBubbleColor } }))))), h("div", { class: "ai-chatbot-input-container" }, h("div", { class: "images-list-preview" }, this.imageUploadErrorStatus ? h("span", { class: "image-upload-error" }, `*${this.imageUploadErrorMsg}`) : null, this.imagePreview ?
h("div", { class: "image-preview-container image-input-preview" }, h("img", { src: this.imagePreview, alt: "Preview", class: "image-preview" }), h("div", { class: "close-image", onClick: () => this.handleRemoveImage() }, h("img", { src: imageCloseicon, alt: "image-close-icon", class: "close-icon", onClick: () => this.handleRemoveImage }))) : null), h("div", { class: "user-input-container" }, this.model === "llama3.2-vision:latest" ?
h("div", { class: "upload-area" }, h("input", { type: "file", accept: "image/*", onChange: this.handleFileChange, ref: (el) => (this.fileInput = el), style: { display: "none" } }), h("button", { class: "upload-button", onClick: () => this.fileInput.click(), disabled: this.isUploading }, h("img", { src: imageUpload, alt: "image-upload" }))) : null, h("textarea", { class: "ai-chatbot-textarea", placeholder: "Type a message...", ref: (el) => (this.chatInput = el), onKeyPress: (event) => this.handleKeyPress(event), onKeyDown: (event) => {
// Prevent spacebar from scrolling the page
if (event.key === ' ' || event.code === 'Space') {
// Stop propagation to prevent the event from bubbling up to the document
// This prevents the page from scrolling
event.stopPropagation();
}
} }), h("span", { class: "ai-chatbot-send-button", onClick: () => this.handleChat() }, h("img", { class: "ai-chatbot-send-image", src: send, alt: "send" })))), this.footerDisclaimer ?
h("div", { class: "ai-chatbot-disclaimer" }, this.footerDisclaimer) : h("div", { class: "ai-chatbot-disclaimer" }, "Powered by Healthvox AI"))))));
}
static get is() { return "chatbot-widget"; }
static get encapsulation() { return "shadow"; }
static get originalStyleUrls() {
return {
"$": ["chatbot-widget.css"]
};
}
static get styleUrls() {
return {
"$": ["chatbot-widget.css"]
};
}
static get properties() {
return {
"apiKey": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "api-key",
"reflect": false
},
"agentId": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "agent-id",
"reflect": false
},
"emailId": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "email-id",
"reflect": false
},
"userName": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "user-name",
"reflect": false
}
};
}
static get states() {
return {
"chatbotApiKey": {},
"agentIdState": {},
"messages": {},
"loading": {},
"closeStatus": {},
"botName": {},
"greetingsMessage": {},
"textColor": {},
"botBubbleColor": {},
"botImage": {},
"chatBoxColor": {},
"domainNames": {},
"validOrigin": {},
"closeBotMessageHint": {},
"preprompts": {},
"profileText": {},
"entityName": {},
"agentDeletionStatus": {},
"name": {},
"email": {},
"errors": {},
"isChatBoxVisible": {},
"isRegisterForm": {},
"contactObjectId": {},
"callObjectId": {},
"contactEntityId": {},
"phoneNumber": {},
"model": {},
"imageUploadErrorStatus": {},
"imageUploadErrorMsg": {},
"imagePreview": {},
"senderImageList": {},
"uploadStatus": {},
"isUploading": {},
"showDate": {},
"greetingLoaded": {},
"footerDisclaimer": {},
"popupMessage": {}
};
}
}
//# sourceMappingURL=chatbot-widget.js.map