wineater-bot 1.7.2 → 1.7.4
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/wineater-chatbot.mjs +36 -34
- package/dist/wineater-chatbot.umd.js +3 -3
- package/package.json +1 -1
- package/src/js/chatbot.js +10 -1
- package/src/js/i18n.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const y = `
|
|
2
2
|
@font-face {
|
|
3
3
|
font-family: 'Poppins';
|
|
4
4
|
src: url('https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap');
|
|
@@ -278,9 +278,9 @@ const b = `
|
|
|
278
278
|
visibility: visible;
|
|
279
279
|
height: 50px;
|
|
280
280
|
}`, g = document.createElement("style");
|
|
281
|
-
g.textContent =
|
|
281
|
+
g.textContent = y;
|
|
282
282
|
document.head.appendChild(g);
|
|
283
|
-
function
|
|
283
|
+
function x() {
|
|
284
284
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(o) {
|
|
285
285
|
const t = Math.random() * 16 | 0;
|
|
286
286
|
return (o === "x" ? t : t & 3 | 8).toString(16);
|
|
@@ -305,12 +305,12 @@ function s(o) {
|
|
|
305
305
|
}
|
|
306
306
|
return null;
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function w() {
|
|
309
309
|
const o = "uniqueUserID";
|
|
310
310
|
let t = s(o);
|
|
311
|
-
return t || (t =
|
|
311
|
+
return t || (t = x(), h(o, t, 365)), t;
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function c(o, t) {
|
|
314
314
|
fetch("https://api.wineater.com/proxy/track", {
|
|
315
315
|
method: "POST",
|
|
316
316
|
headers: {
|
|
@@ -327,19 +327,19 @@ function d(o, t) {
|
|
|
327
327
|
});
|
|
328
328
|
}
|
|
329
329
|
function p() {
|
|
330
|
-
|
|
330
|
+
c("Chatbot Opened", { distinct_id: s("uniqueUserID"), client: s("chatbotToken") });
|
|
331
331
|
}
|
|
332
332
|
function u() {
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
function w(o) {
|
|
336
|
-
d("Message Sent", { distinct_id: s("uniqueUserID"), message_content: o, client: s("chatbotToken") });
|
|
333
|
+
c("Chatbot Closed", { distinct_id: s("uniqueUserID"), client: s("chatbotToken") });
|
|
337
334
|
}
|
|
338
335
|
function v(o) {
|
|
339
|
-
|
|
336
|
+
c("Message Sent", { distinct_id: s("uniqueUserID"), message_content: o, client: s("chatbotToken") });
|
|
340
337
|
}
|
|
341
338
|
function k(o) {
|
|
342
|
-
|
|
339
|
+
c("Products Got", { distinct_id: s("uniqueUserID"), products: o, client: s("chatbotToken") });
|
|
340
|
+
}
|
|
341
|
+
function E(o) {
|
|
342
|
+
c("Product Clicked", { distinct_id: s("uniqueUserID"), product_id: o, client: s("chatbotToken") });
|
|
343
343
|
}
|
|
344
344
|
function m() {
|
|
345
345
|
const o = document.getElementById("chat-window"), t = document.getElementById("chat-icon");
|
|
@@ -348,17 +348,17 @@ function m() {
|
|
|
348
348
|
function I() {
|
|
349
349
|
u(), document.getElementById("chat-window").classList.remove("visible");
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function C() {
|
|
352
352
|
p(), document.getElementById("chat-window").classList.add("visible");
|
|
353
353
|
}
|
|
354
354
|
document.addEventListener("DOMContentLoaded", () => {
|
|
355
355
|
setupCloseButton(), setupOutsideClick();
|
|
356
356
|
});
|
|
357
|
-
const
|
|
357
|
+
const T = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi"], B = "OuhXJRleF6sROjsQZPWx1yqjrL6APeJxmHswqyOBWbgIqtXcht3MDadvI9DtOOoL";
|
|
358
358
|
class f {
|
|
359
359
|
constructor(t) {
|
|
360
360
|
var e;
|
|
361
|
-
this.baseURL = "https://api.wineater.com/", this.store =
|
|
361
|
+
this.baseURL = "https://api.wineater.com/", this.store = T.find((n) => window.location.href.includes(n)), this.token = ((e = window == null ? void 0 : window.wineaterData) == null ? void 0 : e.CLIENT_TOKEN) || B;
|
|
362
362
|
}
|
|
363
363
|
async getStoreConfig(t) {
|
|
364
364
|
console.log(t);
|
|
@@ -397,7 +397,7 @@ class f {
|
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
class
|
|
400
|
+
class S {
|
|
401
401
|
constructor() {
|
|
402
402
|
this.api = new f(), this.language = "en", this.translations = {
|
|
403
403
|
fr: {
|
|
@@ -417,7 +417,7 @@ class B {
|
|
|
417
417
|
welcomeMessage: "Mejore su experiencia gastronómica. Solo proporcione los detalles de su plato y obtenga la recomendación de vino ideal. ¿Qué le gustaría comer?",
|
|
418
418
|
noResultsFound: "No se encontraron resultados.",
|
|
419
419
|
somethingWentWrong: "Lo sentimos, algo salió mal.",
|
|
420
|
-
chatButton: "
|
|
420
|
+
chatButton: "Maridaje ideal",
|
|
421
421
|
inputPlaceholder: "ej., Ensalada de atún",
|
|
422
422
|
sendButton: "Maridar",
|
|
423
423
|
price: "Precio",
|
|
@@ -466,8 +466,8 @@ class B {
|
|
|
466
466
|
return this.translations[this.language][t] || t;
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
const a = new
|
|
470
|
-
class
|
|
469
|
+
const a = new S();
|
|
470
|
+
class L {
|
|
471
471
|
constructor() {
|
|
472
472
|
var e;
|
|
473
473
|
this.api = new f();
|
|
@@ -488,7 +488,7 @@ class S {
|
|
|
488
488
|
if (e) {
|
|
489
489
|
this.displayMessage(e, "user"), t.value = "", this.showTypingIndicator();
|
|
490
490
|
try {
|
|
491
|
-
|
|
491
|
+
v(e);
|
|
492
492
|
const n = await this.api.getWineRecommendations(e);
|
|
493
493
|
this.hideTypingIndicator(), n && n.length ? this.displayResults(n) : this.displayMessage("No results found.", "api");
|
|
494
494
|
} catch {
|
|
@@ -507,31 +507,33 @@ class S {
|
|
|
507
507
|
i.textContent = t, i.className = "message " + e, n.appendChild(i), n.scrollTop = n.scrollHeight;
|
|
508
508
|
}
|
|
509
509
|
sendAnalytics(t) {
|
|
510
|
-
|
|
510
|
+
console.log(t), E(t);
|
|
511
511
|
}
|
|
512
512
|
displayResults(t) {
|
|
513
513
|
const e = document.getElementById("message-container");
|
|
514
|
-
|
|
514
|
+
k(t.map((n) => n.Title)), t.forEach((n) => {
|
|
515
515
|
const i = document.createElement("div");
|
|
516
516
|
i.className = "wine-item";
|
|
517
517
|
const r = document.createElement("img");
|
|
518
518
|
r.src = n.Image, i.appendChild(r);
|
|
519
|
-
const
|
|
520
|
-
|
|
519
|
+
const d = document.createElement("div");
|
|
520
|
+
d.innerHTML = `
|
|
521
521
|
<strong>${n.Title}</strong><br>
|
|
522
522
|
${a.translate("price")}: ${n.Price}<br>
|
|
523
523
|
${a.translate("region")}: ${n.Region}<br>
|
|
524
524
|
${a.translate("type")}: ${n.Type}<br>
|
|
525
|
-
<a href="${n.Url}"
|
|
526
|
-
`,
|
|
525
|
+
<a href="${n.Url}" target="_blank">${a.translate("moreInfo")}</a>
|
|
526
|
+
`, d.querySelector("a").addEventListener("click", (b) => {
|
|
527
|
+
b.preventDefault(), this.sendAnalytics(n.Title), window.open(n.Url, "_blank");
|
|
528
|
+
}), i.appendChild(d), e.appendChild(i), this.displayFirstMessage(n.Reason);
|
|
527
529
|
}), e.scrollTop = e.scrollHeight;
|
|
528
530
|
}
|
|
529
531
|
}
|
|
530
532
|
const W = "OuhXJRleF6sROjsQZPWx1yqjrL6APeJxmHswqyOBWbgIqtXcht3MDadvI9DtOOoL";
|
|
531
533
|
document.addEventListener("DOMContentLoaded", () => {
|
|
532
|
-
window.toggleChatWindow = m, window.closeChatWindow = I, window.openChatWindow =
|
|
534
|
+
window.toggleChatWindow = m, window.closeChatWindow = I, window.openChatWindow = C;
|
|
533
535
|
});
|
|
534
|
-
function
|
|
536
|
+
function P() {
|
|
535
537
|
var e;
|
|
536
538
|
const t = `
|
|
537
539
|
<div id="chatbot-container">
|
|
@@ -564,10 +566,10 @@ function L() {
|
|
|
564
566
|
`;
|
|
565
567
|
document.body.insertAdjacentHTML("beforeend", t);
|
|
566
568
|
}
|
|
567
|
-
function
|
|
569
|
+
function O() {
|
|
568
570
|
document.getElementById("close-btn").addEventListener("click", m);
|
|
569
571
|
}
|
|
570
|
-
function
|
|
572
|
+
function D() {
|
|
571
573
|
window.addEventListener("click", function(o) {
|
|
572
574
|
const t = document.getElementById("chat-window"), e = document.getElementById("chat-icon");
|
|
573
575
|
!t.contains(o.target) && !e.contains(o.target) && (t.classList.remove("visible"), e.style.display = "flex");
|
|
@@ -583,13 +585,13 @@ if (typeof window < "u") {
|
|
|
583
585
|
let o = ((l = window == null ? void 0 : window.wineaterData) == null ? void 0 : l.POSITION) || "bottom-right";
|
|
584
586
|
window.addEventListener("DOMContentLoaded", async () => {
|
|
585
587
|
var r;
|
|
586
|
-
const e = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi"].find((
|
|
588
|
+
const e = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi"].find((d) => window.location.href.includes(d)) || null;
|
|
587
589
|
let n;
|
|
588
|
-
e && (n = e.charAt(0).toUpperCase() + e.slice(1), n === "Biobio" && (o = "right-center")), await a.fetchConfig(n || "Demo"),
|
|
590
|
+
e && (n = e.charAt(0).toUpperCase() + e.slice(1), n === "Biobio" && (o = "right-center")), await a.fetchConfig(n || "Demo"), P(), O(), D(), M(o), h("chatbotToken", ((r = window.wineaterData) == null ? void 0 : r.CLIENT_TOKEN) || W, 365), w(), new L().initialize();
|
|
589
591
|
});
|
|
590
592
|
}
|
|
591
593
|
export {
|
|
592
594
|
I as closeChatWindow,
|
|
593
|
-
|
|
595
|
+
C as openChatWindow,
|
|
594
596
|
m as toggleChatWindow
|
|
595
597
|
};
|
|
@@ -277,13 +277,13 @@
|
|
|
277
277
|
.typing-indicator.visible {
|
|
278
278
|
visibility: visible;
|
|
279
279
|
height: 50px;
|
|
280
|
-
}`,p=document.createElement("style");p.textContent=d,document.head.appendChild(p);function v(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(o){const t=Math.random()*16|0;return(o==="x"?t:t&3|8).toString(16)})}function u(o,t,e){let n="";if(e){const i=new Date;i.setTime(i.getTime()+e*24*60*60*1e3),n="; expires="+i.toUTCString()}document.cookie=o+"="+(t||"")+n+"; path=/; secure; samesite=strict"}function s(o){const t=o+"=",e=document.cookie.split(";");for(let n=0;n<e.length;n++){let i=e[n];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null}function k(){const o="uniqueUserID";let t=s(o);return t||(t=v(),u(o,t,365)),t}function c(o,t){fetch("https://api.wineater.com/proxy/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:o,properties:t})}).then(i=>{i.ok||console.error("Mixpanel tracking failed",i)}).catch(i=>{console.error("Mixpanel tracking error",i)})}function m(){c("Chatbot Opened",{distinct_id:s("uniqueUserID"),client:s("chatbotToken")})}function f(){c("Chatbot Closed",{distinct_id:s("uniqueUserID"),client:s("chatbotToken")})}function
|
|
280
|
+
}`,p=document.createElement("style");p.textContent=d,document.head.appendChild(p);function v(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(o){const t=Math.random()*16|0;return(o==="x"?t:t&3|8).toString(16)})}function u(o,t,e){let n="";if(e){const i=new Date;i.setTime(i.getTime()+e*24*60*60*1e3),n="; expires="+i.toUTCString()}document.cookie=o+"="+(t||"")+n+"; path=/; secure; samesite=strict"}function s(o){const t=o+"=",e=document.cookie.split(";");for(let n=0;n<e.length;n++){let i=e[n];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null}function k(){const o="uniqueUserID";let t=s(o);return t||(t=v(),u(o,t,365)),t}function c(o,t){fetch("https://api.wineater.com/proxy/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:o,properties:t})}).then(i=>{i.ok||console.error("Mixpanel tracking failed",i)}).catch(i=>{console.error("Mixpanel tracking error",i)})}function m(){c("Chatbot Opened",{distinct_id:s("uniqueUserID"),client:s("chatbotToken")})}function f(){c("Chatbot Closed",{distinct_id:s("uniqueUserID"),client:s("chatbotToken")})}function E(o){c("Message Sent",{distinct_id:s("uniqueUserID"),message_content:o,client:s("chatbotToken")})}function I(o){c("Products Got",{distinct_id:s("uniqueUserID"),products:o,client:s("chatbotToken")})}function C(o){c("Product Clicked",{distinct_id:s("uniqueUserID"),product_id:o,client:s("chatbotToken")})}function h(){const o=document.getElementById("chat-window"),t=document.getElementById("chat-icon");o.classList.contains("visible")?(f(),o.classList.remove("visible"),t.style.display="flex"):(m(),o.classList.add("visible"),t.style.display="none")}function b(){f(),document.getElementById("chat-window").classList.remove("visible")}function y(){m(),document.getElementById("chat-window").classList.add("visible")}document.addEventListener("DOMContentLoaded",()=>{setupCloseButton(),setupOutsideClick()});const T=["climats","telckel","biobio","weinpoint","vinigrandi"],B="OuhXJRleF6sROjsQZPWx1yqjrL6APeJxmHswqyOBWbgIqtXcht3MDadvI9DtOOoL";class w{constructor(t){var e;this.baseURL="https://api.wineater.com/",this.store=T.find(n=>window.location.href.includes(n)),this.token=((e=window==null?void 0:window.wineaterData)==null?void 0:e.CLIENT_TOKEN)||B}async getStoreConfig(t){console.log(t);try{const e=await fetch(`${this.baseURL}stores/store`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`},body:JSON.stringify({store:t})});if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return await e.json()}catch(e){throw console.error("Error fetching store configuration:",e),e}}async getWineRecommendations(t){console.log(window.location.href);try{const e=await fetch(`${this.baseURL}dish/recommendations`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`},body:JSON.stringify({text:t,store:this.store?this.store.toString().charAt(0).toUpperCase()+this.store.slice(1):void 0})}),n=await e.json();if(!e.ok)throw new Error(`API call failed with status ${e.status}: ${n.message||"No additional error information"}`);return n}catch(e){throw console.error("Fetching wine recommendations failed:",e.message),new Error(`Error in getWineRecommendations: ${e.message}`)}}}class W{constructor(){this.api=new w,this.language="en",this.translations={fr:{welcomeMessage:"Sublimez votre expérience gastronomique. Il vous suffit de donner les détails de votre plat, et obtenez la recommandation de compagnon de vin idéale. Que voulez-vous manger?",noResultsFound:"Aucun résultat trouvé.",somethingWentWrong:"Désolé, quelque chose a mal tourné.",chatButton:"Accorder le vin au dîner",inputPlaceholder:"ex., Salade de thon",sendButton:"Accorder",price:"Prix",region:"Région",type:"Type",reason:"Suggestion",moreInfo:"Plus d'infos"},es:{welcomeMessage:"Mejore su experiencia gastronómica. Solo proporcione los detalles de su plato y obtenga la recomendación de vino ideal. ¿Qué le gustaría comer?",noResultsFound:"No se encontraron resultados.",somethingWentWrong:"Lo sentimos, algo salió mal.",chatButton:"Maridaje ideal",inputPlaceholder:"ej., Ensalada de atún",sendButton:"Maridar",price:"Precio",region:"Región",type:"Tipo",reason:"Sugerencia",moreInfo:"Más info"},en:{welcomeMessage:"Enhance your dining experience. Just provide your dish details and get the ideal wine pairing. What would you like to eat?",noResultsFound:"No results found.",somethingWentWrong:"Sorry, something went wrong.",chatButton:"Pair wine with dinner",inputPlaceholder:"e.g., Tuna Salad",sendButton:"Pair",price:"Price",region:"Region",type:"Type",reason:"Suggestion",moreInfo:"More info"},de:{welcomeMessage:"Verbessern Sie Ihr kulinarisches Erlebnis. Geben Sie einfach die Details Ihres Gerichts an und erhalten Sie die ideale Weinempfehlung. Was möchten Sie essen?",noResultsFound:"Keine Ergebnisse gefunden.",somethingWentWrong:"Entschuldigung, etwas ist schief gelaufen.",chatButton:"Wein zum Abendessen",inputPlaceholder:"z.B., Thunfischsalat",sendButton:"Kombinieren",price:"Preis",region:"Region",type:"Typ",reason:"Anregung",moreInfo:"Mehr Info"}}}async fetchConfig(t="Demo"){try{const e=await this.api.getStoreConfig(t);this.language=e.lang}catch{this.language="en"}}translate(t){return this.translations[this.language][t]||t}}const a=new W;class S{constructor(){var e;this.api=new w;const t=((e=window==null?void 0:window.wineaterData)==null?void 0:e.FIRST_MESSAGE_TEXT)||a.translate("welcomeMessage");this.displayFirstMessage(t)}initialize(){document.getElementById("send-button").addEventListener("click",()=>this.handleUserInput()),document.getElementById("user-input").addEventListener("keypress",n=>{n.key==="Enter"&&this.handleUserInput()})}displayFirstMessage(t,e="api"){const n=document.getElementById("message-container"),i=document.createElement("div");i.className=`message ${e}`,i.textContent=t,n.appendChild(i),n.scrollTop=n.scrollHeight}async handleUserInput(){const t=document.getElementById("user-input"),e=t.value.trim();if(e){this.displayMessage(e,"user"),t.value="",this.showTypingIndicator();try{E(e);const n=await this.api.getWineRecommendations(e);this.hideTypingIndicator(),n&&n.length?this.displayResults(n):this.displayMessage("No results found.","api")}catch{this.hideTypingIndicator(),this.displayMessage(a.translate("somethingWentWrong"),"api")}}}showTypingIndicator(){document.getElementById("typing-indicator").classList.add("visible")}hideTypingIndicator(){document.getElementById("typing-indicator").classList.remove("visible")}displayMessage(t,e){const n=document.getElementById("message-container"),i=document.createElement("div");i.textContent=t,i.className="message "+e,n.appendChild(i),n.scrollTop=n.scrollHeight}sendAnalytics(t){console.log(t),C(t)}displayResults(t){const e=document.getElementById("message-container");I(t.map(n=>n.Title)),t.forEach(n=>{const i=document.createElement("div");i.className="wine-item";const l=document.createElement("img");l.src=n.Image,i.appendChild(l);const g=document.createElement("div");g.innerHTML=`
|
|
281
281
|
<strong>${n.Title}</strong><br>
|
|
282
282
|
${a.translate("price")}: ${n.Price}<br>
|
|
283
283
|
${a.translate("region")}: ${n.Region}<br>
|
|
284
284
|
${a.translate("type")}: ${n.Type}<br>
|
|
285
|
-
<a href="${n.Url}"
|
|
286
|
-
`,i.appendChild(g),e.appendChild(i),this.displayFirstMessage(n.Reason)}),e.scrollTop=e.scrollHeight}}const L="OuhXJRleF6sROjsQZPWx1yqjrL6APeJxmHswqyOBWbgIqtXcht3MDadvI9DtOOoL";document.addEventListener("DOMContentLoaded",()=>{window.toggleChatWindow=h,window.closeChatWindow=b,window.openChatWindow=y});function P(){var e;const t=`
|
|
285
|
+
<a href="${n.Url}" target="_blank">${a.translate("moreInfo")}</a>
|
|
286
|
+
`,g.querySelector("a").addEventListener("click",A=>{A.preventDefault(),this.sendAnalytics(n.Title),window.open(n.Url,"_blank")}),i.appendChild(g),e.appendChild(i),this.displayFirstMessage(n.Reason)}),e.scrollTop=e.scrollHeight}}const L="OuhXJRleF6sROjsQZPWx1yqjrL6APeJxmHswqyOBWbgIqtXcht3MDadvI9DtOOoL";document.addEventListener("DOMContentLoaded",()=>{window.toggleChatWindow=h,window.closeChatWindow=b,window.openChatWindow=y});function P(){var e;const t=`
|
|
287
287
|
<div id="chatbot-container">
|
|
288
288
|
<div id="chat-icon" onclick="toggleChatWindow()">
|
|
289
289
|
<img src="https://landing-static.s3.eu-central-1.amazonaws.com/images/chat-icon.svg" alt="Chat Icon"> <!-- Update the path to your logo image -->
|
package/package.json
CHANGED
package/src/js/chatbot.js
CHANGED
|
@@ -84,6 +84,7 @@ export class Chatbot {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
sendAnalytics(product) {
|
|
87
|
+
console.log(product);
|
|
87
88
|
trackProductClick(product);
|
|
88
89
|
}
|
|
89
90
|
|
|
@@ -104,8 +105,16 @@ export class Chatbot {
|
|
|
104
105
|
${translator.translate('price')}: ${wine.Price}<br>
|
|
105
106
|
${translator.translate('region')}: ${wine.Region}<br>
|
|
106
107
|
${translator.translate('type')}: ${wine.Type}<br>
|
|
107
|
-
<a href="${wine.Url}"
|
|
108
|
+
<a href="${wine.Url}" target="_blank">${translator.translate('moreInfo')}</a>
|
|
108
109
|
`;
|
|
110
|
+
|
|
111
|
+
// Add click event listener to the link
|
|
112
|
+
const link = contentDiv.querySelector('a');
|
|
113
|
+
link.addEventListener('click', (event) => {
|
|
114
|
+
event.preventDefault(); // Prevent the default link behavior
|
|
115
|
+
this.sendAnalytics(wine.Title); // Call sendAnalytics when clicked
|
|
116
|
+
window.open(wine.Url, '_blank'); // Open the link in a new tab
|
|
117
|
+
});
|
|
109
118
|
wineDiv.appendChild(contentDiv);
|
|
110
119
|
// const suggestionDiv = document.createElement('div');
|
|
111
120
|
// suggestionDiv.innerHTML = `${translator.translate('reason')}: ${wine.Reason}<br>`;
|
package/src/js/i18n.js
CHANGED
|
@@ -22,7 +22,7 @@ class Translator {
|
|
|
22
22
|
welcomeMessage: "Mejore su experiencia gastronómica. Solo proporcione los detalles de su plato y obtenga la recomendación de vino ideal. ¿Qué le gustaría comer?",
|
|
23
23
|
noResultsFound: "No se encontraron resultados.",
|
|
24
24
|
somethingWentWrong: "Lo sentimos, algo salió mal.",
|
|
25
|
-
chatButton: "
|
|
25
|
+
chatButton: "Maridaje ideal",
|
|
26
26
|
inputPlaceholder: "ej., Ensalada de atún",
|
|
27
27
|
sendButton: "Maridar",
|
|
28
28
|
price: "Precio",
|