@flowengage/react-chatbot 6.0.3 → 6.0.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/flowengage-embed.js +11 -11
- package/dist/flowengage-react-chatbot.cjs +11 -11
- package/dist/flowengage-react-chatbot.mjs +310 -324
- package/package.json +1 -1
|
@@ -26274,43 +26274,29 @@ var vD = class extends UE {
|
|
|
26274
26274
|
static startSession(e) {
|
|
26275
26275
|
return e.textOnly ? oD.startSession(e) : dD.startSession(e);
|
|
26276
26276
|
}
|
|
26277
|
-
}, yD =
|
|
26278
|
-
|
|
26279
|
-
speechStartTime: 0,
|
|
26280
|
-
isSpeaking: !1,
|
|
26281
|
-
items: [],
|
|
26282
|
-
timers: [],
|
|
26283
|
-
lastHighlightId: null,
|
|
26284
|
-
isVoiceMode: !1
|
|
26285
|
-
};
|
|
26286
|
-
function bD() {
|
|
26287
|
-
yD.timers.forEach(clearTimeout), yD.wordsSoFar = 0, yD.speechStartTime = 0, yD.isSpeaking = !1, yD.items = [], yD.timers = [], yD.lastHighlightId = null;
|
|
26288
|
-
}
|
|
26289
|
-
//#endregion
|
|
26290
|
-
//#region src/utils/highlightEngine.js
|
|
26291
|
-
var xD = 80;
|
|
26292
|
-
function SD(e) {
|
|
26277
|
+
}, yD = 80;
|
|
26278
|
+
function bD(e) {
|
|
26293
26279
|
requestAnimationFrame(() => {
|
|
26294
|
-
let t = e.getBoundingClientRect(), n = t.top + t.height / 2, r =
|
|
26280
|
+
let t = e.getBoundingClientRect(), n = t.top + t.height / 2, r = yD, i = r + (window.innerHeight - r) / 2, a = window.pageYOffset + n - i;
|
|
26295
26281
|
window.scrollTo({
|
|
26296
26282
|
top: Math.max(0, a),
|
|
26297
26283
|
behavior: "smooth"
|
|
26298
26284
|
});
|
|
26299
26285
|
});
|
|
26300
26286
|
}
|
|
26301
|
-
function
|
|
26287
|
+
function xD(e) {
|
|
26302
26288
|
if (!e || e.hasAttribute("data-fe-highlighted")) return;
|
|
26303
|
-
|
|
26289
|
+
SD(), e.classList?.remove("fe-highlight-section", "fe-highlight-speaking", "fe-highlight-exiting"), bD(e);
|
|
26304
26290
|
let t = e.style.cssText;
|
|
26305
26291
|
e.setAttribute("data-fe-highlighted", "true"), e.setAttribute("data-fe-orig-style", t), e.style.outline = "3px solid #2563eb", e.style.outlineOffset = "8px", e.style.background = "rgba(37, 99, 235, 0.08)", e.style.borderRadius = "8px", e.style.padding = "12px 16px", e.style.transition = "all 0.4s ease";
|
|
26306
26292
|
}
|
|
26307
|
-
function
|
|
26293
|
+
function SD() {
|
|
26308
26294
|
let e = document.querySelector("[data-fe-highlighted]");
|
|
26309
26295
|
e && (e.style.cssText = e.getAttribute("data-fe-orig-style") || "", e.removeAttribute("data-fe-highlighted"), e.removeAttribute("data-fe-orig-style"));
|
|
26310
26296
|
}
|
|
26311
26297
|
//#endregion
|
|
26312
26298
|
//#region src/lib/svgIcons.jsx
|
|
26313
|
-
var
|
|
26299
|
+
var CD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
26314
26300
|
width: e,
|
|
26315
26301
|
height: e,
|
|
26316
26302
|
viewBox: "0 0 24 24",
|
|
@@ -26326,7 +26312,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26326
26312
|
strokeLinecap: "round",
|
|
26327
26313
|
strokeLinejoin: "round"
|
|
26328
26314
|
})]
|
|
26329
|
-
}),
|
|
26315
|
+
}), wD = ({ size: e = 20 }) => /* @__PURE__ */ _("svg", {
|
|
26330
26316
|
width: e,
|
|
26331
26317
|
height: e,
|
|
26332
26318
|
viewBox: "0 0 24 24",
|
|
@@ -26341,7 +26327,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26341
26327
|
x2: "1",
|
|
26342
26328
|
y2: "23"
|
|
26343
26329
|
})]
|
|
26344
|
-
}),
|
|
26330
|
+
}), TD = ({ size: e = 18 }) => /* @__PURE__ */ _("svg", {
|
|
26345
26331
|
width: e,
|
|
26346
26332
|
height: e,
|
|
26347
26333
|
viewBox: "0 0 24 24",
|
|
@@ -26356,7 +26342,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26356
26342
|
x2: "12",
|
|
26357
26343
|
y2: "5"
|
|
26358
26344
|
}), /* @__PURE__ */ g("polyline", { points: "5 12 12 5 19 12" })]
|
|
26359
|
-
}),
|
|
26345
|
+
}), ED = () => /* @__PURE__ */ _("svg", {
|
|
26360
26346
|
width: "14",
|
|
26361
26347
|
height: "14",
|
|
26362
26348
|
viewBox: "0 0 24 24",
|
|
@@ -26366,7 +26352,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26366
26352
|
strokeLinecap: "round",
|
|
26367
26353
|
strokeLinejoin: "round",
|
|
26368
26354
|
children: [/* @__PURE__ */ g("polyline", { points: "9 17 4 12 9 7" }), /* @__PURE__ */ g("path", { d: "M20 18v-2a4 4 0 00-4-4H4" })]
|
|
26369
|
-
}),
|
|
26355
|
+
}), DD = () => /* @__PURE__ */ g("svg", {
|
|
26370
26356
|
width: "18",
|
|
26371
26357
|
height: "18",
|
|
26372
26358
|
viewBox: "0 0 24 24",
|
|
@@ -26376,7 +26362,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26376
26362
|
strokeLinecap: "round",
|
|
26377
26363
|
strokeLinejoin: "round",
|
|
26378
26364
|
children: /* @__PURE__ */ g("path", { d: "M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.42 19.42 0 01-6.12-6.11A19.79 19.79 0 012 4.11 2 2 0 014.11 2h3a2 2 0 012 1.72c.13.96.37 1.91.71 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.9.34 1.85.58 2.81.71A2 2 0 0122 16.92z" })
|
|
26379
|
-
}),
|
|
26365
|
+
}), OD = ({ className: e = "" }) => /* @__PURE__ */ _("svg", {
|
|
26380
26366
|
className: e,
|
|
26381
26367
|
width: "14",
|
|
26382
26368
|
height: "14",
|
|
@@ -26405,7 +26391,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26405
26391
|
y2: "16"
|
|
26406
26392
|
})
|
|
26407
26393
|
]
|
|
26408
|
-
}),
|
|
26394
|
+
}), kD = ({ size: e = 14 }) => /* @__PURE__ */ _("svg", {
|
|
26409
26395
|
width: e,
|
|
26410
26396
|
height: e,
|
|
26411
26397
|
viewBox: "0 0 24 24",
|
|
@@ -26428,7 +26414,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26428
26414
|
/* @__PURE__ */ g("path", { d: "M15 13v2" }),
|
|
26429
26415
|
/* @__PURE__ */ g("path", { d: "M9 13v2" })
|
|
26430
26416
|
]
|
|
26431
|
-
}),
|
|
26417
|
+
}), AD = ({ size: e = 20, strokeWidth: t = 2, color: n = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
26432
26418
|
width: e,
|
|
26433
26419
|
height: e,
|
|
26434
26420
|
viewBox: "0 0 24 24",
|
|
@@ -26448,7 +26434,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26448
26434
|
x2: "19",
|
|
26449
26435
|
y2: "12"
|
|
26450
26436
|
})]
|
|
26451
|
-
}),
|
|
26437
|
+
}), jD = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
26452
26438
|
width: e,
|
|
26453
26439
|
height: e,
|
|
26454
26440
|
viewBox: "0 0 24 24",
|
|
@@ -26474,7 +26460,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26474
26460
|
fill: t
|
|
26475
26461
|
})
|
|
26476
26462
|
]
|
|
26477
|
-
}),
|
|
26463
|
+
}), MD = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
26478
26464
|
width: "24",
|
|
26479
26465
|
height: "24",
|
|
26480
26466
|
viewBox: "0 0 24 24",
|
|
@@ -26492,7 +26478,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26492
26478
|
"stroke-linecap": "round",
|
|
26493
26479
|
"stroke-linejoin": "round"
|
|
26494
26480
|
})]
|
|
26495
|
-
}),
|
|
26481
|
+
}), ND = () => /* @__PURE__ */ g("svg", {
|
|
26496
26482
|
width: "24",
|
|
26497
26483
|
height: "24",
|
|
26498
26484
|
viewBox: "0 0 24 24",
|
|
@@ -26504,7 +26490,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26504
26490
|
"stroke-width": "1.5",
|
|
26505
26491
|
"stroke-linejoin": "round"
|
|
26506
26492
|
})
|
|
26507
|
-
}),
|
|
26493
|
+
}), PD = ({ size: e = 24 }) => /* @__PURE__ */ _("svg", {
|
|
26508
26494
|
xmlns: "http://www.w3.org/2000/svg",
|
|
26509
26495
|
width: e,
|
|
26510
26496
|
height: e,
|
|
@@ -26522,7 +26508,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26522
26508
|
/* @__PURE__ */ g("path", { d: "m2 2 20 20" }),
|
|
26523
26509
|
/* @__PURE__ */ g("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" })
|
|
26524
26510
|
]
|
|
26525
|
-
}),
|
|
26511
|
+
}), FD = (e = "") => String(e).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim(), ID = (e = "") => String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), LD = new Set([
|
|
26526
26512
|
"p",
|
|
26527
26513
|
"br",
|
|
26528
26514
|
"ul",
|
|
@@ -26533,30 +26519,30 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
|
|
|
26533
26519
|
"b",
|
|
26534
26520
|
"i",
|
|
26535
26521
|
"a"
|
|
26536
|
-
]),
|
|
26537
|
-
function
|
|
26522
|
+
]), RD = /^https?:\/\//i;
|
|
26523
|
+
function zD(e) {
|
|
26538
26524
|
let t = Array.from(e.childNodes);
|
|
26539
26525
|
for (let n of t) if (n.nodeType === Node.ELEMENT_NODE) {
|
|
26540
26526
|
let t = n.tagName.toLowerCase();
|
|
26541
|
-
if (!
|
|
26527
|
+
if (!LD.has(t)) {
|
|
26542
26528
|
e.replaceChild(document.createTextNode(n.textContent), n);
|
|
26543
26529
|
continue;
|
|
26544
26530
|
}
|
|
26545
26531
|
let r = {};
|
|
26546
26532
|
if (t === "a") {
|
|
26547
26533
|
let e = n.getAttribute("href") || "";
|
|
26548
|
-
|
|
26534
|
+
RD.test(e) && (r.href = e), r.target = "_blank", r.rel = "noopener noreferrer";
|
|
26549
26535
|
}
|
|
26550
26536
|
for (; n.attributes.length > 0;) n.removeAttribute(n.attributes[0].name);
|
|
26551
26537
|
for (let [e, t] of Object.entries(r)) n.setAttribute(e, t);
|
|
26552
|
-
|
|
26538
|
+
zD(n);
|
|
26553
26539
|
} else n.nodeType !== Node.TEXT_NODE && e.removeChild(n);
|
|
26554
26540
|
}
|
|
26555
|
-
function
|
|
26541
|
+
function BD(e) {
|
|
26556
26542
|
let t = document.createElement("div");
|
|
26557
|
-
return t.innerHTML = e,
|
|
26543
|
+
return t.innerHTML = e, zD(t), t.innerHTML;
|
|
26558
26544
|
}
|
|
26559
|
-
function
|
|
26545
|
+
function VD(e) {
|
|
26560
26546
|
let t = String(e || "").trim();
|
|
26561
26547
|
if (!t) return t;
|
|
26562
26548
|
let n = /^<p>\s*<strong>([\s\S]*?)<\/strong>\s*<\/p>$/i.exec(t);
|
|
@@ -26568,33 +26554,33 @@ function UD(e) {
|
|
|
26568
26554
|
}
|
|
26569
26555
|
return e;
|
|
26570
26556
|
}
|
|
26571
|
-
var
|
|
26557
|
+
var HD = (e = "") => {
|
|
26572
26558
|
let t = String(e || "").trim();
|
|
26573
26559
|
if (!t) return "";
|
|
26574
|
-
if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return
|
|
26575
|
-
let n = t.replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n").split(/\n\s*\n/).map((e) => e.trim()).filter(Boolean), r = (e) =>
|
|
26576
|
-
return
|
|
26560
|
+
if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return VD(BD(t));
|
|
26561
|
+
let n = t.replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n").split(/\n\s*\n/).map((e) => e.trim()).filter(Boolean), r = (e) => ID(e).replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g, "<a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\">$1</a>").replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(/\*([^*\n]+)\*/g, "<em>$1</em>");
|
|
26562
|
+
return VD(n.map((e) => {
|
|
26577
26563
|
let t = e.split("\n").map((e) => e.trim()).filter(Boolean), n = t.filter((e) => /^[-*]\s+/.test(e));
|
|
26578
26564
|
if (n.length >= 2 && n.length === t.length) return `<ul>${n.map((e) => `<li>${r(e.replace(/^[-*]\s+/, ""))}</li>`).join("")}</ul>`;
|
|
26579
26565
|
let i = e.split(/\s+(?=[-*]\s+\*\*?)/).map((e) => e.trim()).filter(Boolean);
|
|
26580
26566
|
return i.length >= 2 && i.every((e) => /^[-*]\s+/.test(e)) ? `<ul>${i.map((e) => `<li>${r(e.replace(/^[-*]\s+/, ""))}</li>`).join("")}</ul>` : `<p>${r(e).replace(/\n/g, "<br />")}</p>`;
|
|
26581
26567
|
}).join(""));
|
|
26582
|
-
},
|
|
26568
|
+
}, UD = new Set(["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]), WD = new Set([
|
|
26583
26569
|
".pdf",
|
|
26584
26570
|
".docx",
|
|
26585
26571
|
".png",
|
|
26586
26572
|
".jpg",
|
|
26587
26573
|
".jpeg"
|
|
26588
|
-
]),
|
|
26589
|
-
function
|
|
26574
|
+
]), GD = "image/png,image/jpeg,.pdf,.docx";
|
|
26575
|
+
function KD(e) {
|
|
26590
26576
|
if (!e) return !1;
|
|
26591
26577
|
let t = typeof e.name == "string" ? e.name.toLowerCase() : "", n = t.includes(".") ? `.${t.split(".").pop()}` : "", r = typeof e.type == "string" ? e.type.toLowerCase() : "";
|
|
26592
|
-
return r === "image/png" || r === "image/jpeg" ||
|
|
26578
|
+
return r === "image/png" || r === "image/jpeg" || UD.has(r) || WD.has(n);
|
|
26593
26579
|
}
|
|
26594
|
-
function
|
|
26595
|
-
return e ?
|
|
26580
|
+
function qD(e) {
|
|
26581
|
+
return e ? KD(e) ? e.size > 2097152 ? "File must be 2 MB or smaller." : "" : "Only PNG, JPEG, PDF, and DOCX files are allowed." : "No file selected.";
|
|
26596
26582
|
}
|
|
26597
|
-
function
|
|
26583
|
+
function JD(e = 0) {
|
|
26598
26584
|
if (!Number.isFinite(e) || e <= 0) return "";
|
|
26599
26585
|
let t = [
|
|
26600
26586
|
"B",
|
|
@@ -26606,12 +26592,12 @@ function XD(e = 0) {
|
|
|
26606
26592
|
let i = n >= 10 || r === 0 ? 0 : 1;
|
|
26607
26593
|
return `${n.toFixed(i)} ${t[r]}`;
|
|
26608
26594
|
}
|
|
26609
|
-
function
|
|
26595
|
+
function YD(e) {
|
|
26610
26596
|
return e ? e.name || "Attachment" : "";
|
|
26611
26597
|
}
|
|
26612
26598
|
//#endregion
|
|
26613
26599
|
//#region src/utils/avatarHelpers.js
|
|
26614
|
-
function
|
|
26600
|
+
function XD(e) {
|
|
26615
26601
|
if (!e || typeof e != "string") return "?";
|
|
26616
26602
|
let t = e.trim();
|
|
26617
26603
|
if (!t) return "?";
|
|
@@ -26620,7 +26606,7 @@ function QD(e) {
|
|
|
26620
26606
|
}
|
|
26621
26607
|
//#endregion
|
|
26622
26608
|
//#region src/components/AvatarImageOrInitials.jsx
|
|
26623
|
-
function
|
|
26609
|
+
function ZD({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
|
|
26624
26610
|
let [i, a] = m(null), o = typeof e == "string" ? e.trim() : "";
|
|
26625
26611
|
return c(() => {
|
|
26626
26612
|
if (!o) {
|
|
@@ -26642,12 +26628,12 @@ function $D({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
|
|
|
26642
26628
|
style: n
|
|
26643
26629
|
}) : /* @__PURE__ */ g("span", {
|
|
26644
26630
|
style: r,
|
|
26645
|
-
children:
|
|
26631
|
+
children: XD(t)
|
|
26646
26632
|
});
|
|
26647
26633
|
}
|
|
26648
26634
|
//#endregion
|
|
26649
26635
|
//#region src/components/MessageList.jsx
|
|
26650
|
-
function
|
|
26636
|
+
function QD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: s = null, agentDisplayName: l = "Agent", botAvatarNode: u = null }) {
|
|
26651
26637
|
let { resolvedConfig: d } = Ln(), f = p(null), [v, y] = m(null), [b, x] = m(null), S = p(e.length), C = p(!0), w = p(null), T = o((e) => {
|
|
26652
26638
|
let t = e.target.closest("a[href]");
|
|
26653
26639
|
if (!t) return;
|
|
@@ -26702,7 +26688,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
26702
26688
|
children: [
|
|
26703
26689
|
e.map((e) => {
|
|
26704
26690
|
if (e.type === "call_recording" || typeof e.message == "string" && e.message.includes("AI chat recording")) return null;
|
|
26705
|
-
let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, d = e.type === "file" && e.metadata?.fileUrl, f = e.agent_name || e.agentName || e.metadata?.agentName || l, p = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, m =
|
|
26691
|
+
let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, d = e.type === "file" && e.metadata?.fileUrl, f = e.agent_name || e.agentName || e.metadata?.agentName || l, p = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, m = FD(e.replyToContent || e.replyContext?.message || ""), v = e.replyToSender === "user" ? "You" : e.replyToSender === "agent" ? "Agent" : e.replyToSender === "ai" || e.replyToSender === "bot" ? "AI Assistant" : "Message";
|
|
26706
26692
|
return t ? /* @__PURE__ */ g("div", {
|
|
26707
26693
|
style: {
|
|
26708
26694
|
display: "flex",
|
|
@@ -26747,7 +26733,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
26747
26733
|
fontWeight: 800,
|
|
26748
26734
|
marginTop: !c && (r || o) ? "22px" : "0px"
|
|
26749
26735
|
},
|
|
26750
|
-
children: r ? u || /* @__PURE__ */ g(
|
|
26736
|
+
children: r ? u || /* @__PURE__ */ g(kD, { size: 16 }) : /* @__PURE__ */ g(ZD, {
|
|
26751
26737
|
src: p || "",
|
|
26752
26738
|
name: f,
|
|
26753
26739
|
imgStyle: {
|
|
@@ -26789,7 +26775,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
26789
26775
|
onMouseLeave: (e) => {
|
|
26790
26776
|
e.currentTarget.style.color = "#9ca3af";
|
|
26791
26777
|
},
|
|
26792
|
-
children: [/* @__PURE__ */ g(
|
|
26778
|
+
children: [/* @__PURE__ */ g(ED, {}), "Reply"]
|
|
26793
26779
|
}),
|
|
26794
26780
|
/* @__PURE__ */ _("div", {
|
|
26795
26781
|
style: {
|
|
@@ -26833,7 +26819,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
26833
26819
|
children: m
|
|
26834
26820
|
})]
|
|
26835
26821
|
}), d ? (() => {
|
|
26836
|
-
let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i =
|
|
26822
|
+
let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i = JD(e.metadata.fileSize), a = t.startsWith("image/"), o = t === "application/pdf" ? {
|
|
26837
26823
|
color: "#ef4444",
|
|
26838
26824
|
label: "PDF"
|
|
26839
26825
|
} : t.includes("word") || t.includes("docx") ? {
|
|
@@ -27005,7 +26991,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
27005
26991
|
});
|
|
27006
26992
|
})() : r ? /* @__PURE__ */ g("div", {
|
|
27007
26993
|
className: "flowengage-message-content fe-bot-message",
|
|
27008
|
-
dangerouslySetInnerHTML: { __html:
|
|
26994
|
+
dangerouslySetInnerHTML: { __html: HD(e.message) },
|
|
27009
26995
|
onClick: T
|
|
27010
26996
|
}) : /* @__PURE__ */ g("div", {
|
|
27011
26997
|
style: { whiteSpace: n || o ? "normal" : "pre-wrap" },
|
|
@@ -27070,7 +27056,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
27070
27056
|
boxShadow: u ? "none" : "0 8px 20px rgba(59,130,246,0.24)",
|
|
27071
27057
|
overflow: "hidden"
|
|
27072
27058
|
},
|
|
27073
|
-
children: u || /* @__PURE__ */ g(
|
|
27059
|
+
children: u || /* @__PURE__ */ g(kD, { size: 16 })
|
|
27074
27060
|
}), /* @__PURE__ */ _("div", {
|
|
27075
27061
|
style: {
|
|
27076
27062
|
display: "flex",
|
|
@@ -27112,7 +27098,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
27112
27098
|
borderRadius: "50%",
|
|
27113
27099
|
overflow: "hidden"
|
|
27114
27100
|
},
|
|
27115
|
-
children: /* @__PURE__ */ g(
|
|
27101
|
+
children: /* @__PURE__ */ g(ZD, {
|
|
27116
27102
|
src: s || "",
|
|
27117
27103
|
name: l,
|
|
27118
27104
|
imgStyle: {
|
|
@@ -27206,7 +27192,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
27206
27192
|
}
|
|
27207
27193
|
//#endregion
|
|
27208
27194
|
//#region src/components/ChatInput.jsx
|
|
27209
|
-
function
|
|
27195
|
+
function $D({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUiActive: i, handleToggleVoice: a, activeScreen: o, inputDisabled: s, replyContext: c, clearReplyContext: l, requiresEmail: u, emailInput: d, setEmailInput: f, emailError: m, showVoiceToggle: v = !1, voiceEnabled: y = !0, onFileSelect: b, selectedFile: x = null, onRemoveSelectedFile: S, attachmentError: C = "", isUploadingAttachment: w = !1, inputPlaceholder: T = "Type your message" }) {
|
|
27210
27196
|
let ee = p(null), te = c?.sender === "user" ? "You" : c?.sender === "agent" ? "Agent" : "AI Assistant", ne = u ? !!d?.trim() : !!e?.trim() || !!x, re = s || w || !ne, E = !u && y && v;
|
|
27211
27197
|
return /* @__PURE__ */ _("div", {
|
|
27212
27198
|
style: {
|
|
@@ -27301,7 +27287,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27301
27287
|
background: "rgba(59,130,246,0.08)",
|
|
27302
27288
|
color: "var(--flowengage-primary)"
|
|
27303
27289
|
},
|
|
27304
|
-
children: /* @__PURE__ */ g(
|
|
27290
|
+
children: /* @__PURE__ */ g(kD, { size: 13 })
|
|
27305
27291
|
}), /* @__PURE__ */ g("span", { children: "Please provide your email address so we can help you." })]
|
|
27306
27292
|
})
|
|
27307
27293
|
}),
|
|
@@ -27341,7 +27327,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27341
27327
|
overflow: "hidden",
|
|
27342
27328
|
textOverflow: "ellipsis"
|
|
27343
27329
|
},
|
|
27344
|
-
children:
|
|
27330
|
+
children: YD(x)
|
|
27345
27331
|
}),
|
|
27346
27332
|
/* @__PURE__ */ g("div", {
|
|
27347
27333
|
style: {
|
|
@@ -27349,7 +27335,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27349
27335
|
color: "#6b7280",
|
|
27350
27336
|
marginTop: "2px"
|
|
27351
27337
|
},
|
|
27352
|
-
children:
|
|
27338
|
+
children: JD(x.size)
|
|
27353
27339
|
})
|
|
27354
27340
|
]
|
|
27355
27341
|
}), /* @__PURE__ */ g("button", {
|
|
@@ -27394,7 +27380,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27394
27380
|
E ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("input", {
|
|
27395
27381
|
ref: ee,
|
|
27396
27382
|
type: "file",
|
|
27397
|
-
accept:
|
|
27383
|
+
accept: GD,
|
|
27398
27384
|
style: { display: "none" },
|
|
27399
27385
|
onChange: (e) => {
|
|
27400
27386
|
let t = e.target.files?.[0];
|
|
@@ -27426,7 +27412,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27426
27412
|
onMouseLeave: (e) => {
|
|
27427
27413
|
e.currentTarget.style.opacity = "1";
|
|
27428
27414
|
},
|
|
27429
|
-
children: /* @__PURE__ */ g(
|
|
27415
|
+
children: /* @__PURE__ */ g(AD, {
|
|
27430
27416
|
size: 16,
|
|
27431
27417
|
color: "currentColor"
|
|
27432
27418
|
})
|
|
@@ -27483,7 +27469,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27483
27469
|
onMouseLeave: (e) => {
|
|
27484
27470
|
e.currentTarget.style.opacity = "1";
|
|
27485
27471
|
},
|
|
27486
|
-
children: /* @__PURE__ */ g(
|
|
27472
|
+
children: /* @__PURE__ */ g(TD, { size: 16 })
|
|
27487
27473
|
})
|
|
27488
27474
|
]
|
|
27489
27475
|
}),
|
|
@@ -27546,7 +27532,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27546
27532
|
}
|
|
27547
27533
|
//#endregion
|
|
27548
27534
|
//#region src/components/StatusBanners.jsx
|
|
27549
|
-
function
|
|
27535
|
+
function eO({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
|
|
27550
27536
|
return /* @__PURE__ */ _(h, { children: [(e || t) && /* @__PURE__ */ _("div", {
|
|
27551
27537
|
style: {
|
|
27552
27538
|
margin: "0 20px 10px",
|
|
@@ -27559,7 +27545,7 @@ function nO({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
|
|
|
27559
27545
|
gap: "10px"
|
|
27560
27546
|
},
|
|
27561
27547
|
children: [
|
|
27562
|
-
/* @__PURE__ */ g(
|
|
27548
|
+
/* @__PURE__ */ g(OD, { className: "" }),
|
|
27563
27549
|
/* @__PURE__ */ g("span", {
|
|
27564
27550
|
style: {
|
|
27565
27551
|
fontSize: "12px",
|
|
@@ -27605,13 +27591,13 @@ function nO({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
|
|
|
27605
27591
|
}
|
|
27606
27592
|
//#endregion
|
|
27607
27593
|
//#region src/components/AnimatedOrb.jsx
|
|
27608
|
-
var
|
|
27594
|
+
var tO = [
|
|
27609
27595
|
"#135bd8",
|
|
27610
27596
|
"#ef334b",
|
|
27611
27597
|
"#ffbd2e"
|
|
27612
27598
|
];
|
|
27613
|
-
function
|
|
27614
|
-
return !Array.isArray(e) || e.length === 0 ?
|
|
27599
|
+
function nO(e) {
|
|
27600
|
+
return !Array.isArray(e) || e.length === 0 ? tO : e.length === 1 ? [
|
|
27615
27601
|
e[0],
|
|
27616
27602
|
e[0],
|
|
27617
27603
|
e[0]
|
|
@@ -27625,7 +27611,7 @@ function iO(e) {
|
|
|
27625
27611
|
e[2]
|
|
27626
27612
|
];
|
|
27627
27613
|
}
|
|
27628
|
-
var
|
|
27614
|
+
var rO = {
|
|
27629
27615
|
idle: 3,
|
|
27630
27616
|
listening: .75,
|
|
27631
27617
|
thinking: 1,
|
|
@@ -27633,7 +27619,7 @@ var aO = {
|
|
|
27633
27619
|
muted: .75,
|
|
27634
27620
|
error: .08
|
|
27635
27621
|
};
|
|
27636
|
-
function
|
|
27622
|
+
function iO(e) {
|
|
27637
27623
|
if (!e || typeof e != "string") return [
|
|
27638
27624
|
0,
|
|
27639
27625
|
0,
|
|
@@ -27646,14 +27632,14 @@ function oO(e) {
|
|
|
27646
27632
|
parseInt(n.slice(4, 6), 16) / 255
|
|
27647
27633
|
];
|
|
27648
27634
|
}
|
|
27649
|
-
function
|
|
27635
|
+
function aO(e, t) {
|
|
27650
27636
|
if (!e || typeof e != "string") return `rgba(0,0,0,${t})`;
|
|
27651
27637
|
if (e.startsWith("rgb")) return e.replace(/[\d.]+\)$/, `${t})`);
|
|
27652
27638
|
let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
|
|
27653
27639
|
return `rgba(${parseInt(r.slice(0, 2), 16)},${parseInt(r.slice(2, 4), 16)},${parseInt(r.slice(4, 6), 16)},${t})`;
|
|
27654
27640
|
}
|
|
27655
|
-
var
|
|
27656
|
-
function
|
|
27641
|
+
var oO = "\n attribute vec2 a_pos;\n varying vec2 v_uv;\n void main() {\n v_uv = a_pos * 0.5 + 0.5;\n gl_Position = vec4(a_pos, 0.0, 1.0);\n }\n", sO = "\n precision highp float;\n\n varying vec2 v_uv;\n uniform float u_time;\n uniform float u_speed;\n uniform vec3 u_c1;\n uniform vec3 u_c2;\n uniform vec3 u_c3;\n\n // ── Gradient noise ─────────────────────────────────────────────────────────\n vec2 hash2(vec2 p) {\n p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));\n return -1.0 + 2.0 * fract(sin(p) * 43758.5453123);\n }\n float gnoise(vec2 p) {\n vec2 i = floor(p), f = fract(p);\n vec2 u = f*f*f*(f*(f*6.0-15.0)+10.0);\n return mix(\n mix(dot(hash2(i), f),\n dot(hash2(i+vec2(1,0)), f-vec2(1,0)), u.x),\n mix(dot(hash2(i+vec2(0,1)), f-vec2(0,1)),\n dot(hash2(i+vec2(1,1)), f-vec2(1,1)), u.x),\n u.y\n ) * 0.5 + 0.5;\n }\n\n // ── 3-octave FBM normalised to [0,1] — fewer octaves → larger, softer blobs\n float fbm(vec2 p) {\n float v = 0.0, a = 0.5;\n for (int i = 0; i < 3; i++) {\n v += a * gnoise(p);\n p = p * 2.1 + vec2(100.0);\n a *= 0.5;\n }\n return v / 0.875;\n }\n\n // ── Scalar hash for grain ──────────────────────────────────────────────────\n float hash1(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);\n }\n\n void main() {\n vec2 uv = v_uv;\n float t = u_time * u_speed + 47.3;\n\n // ── ① Two-level domain warp — deep organic folding and swirling ───────────\n // First pass: large-scale sweep\n vec2 q = vec2(\n fbm(uv * 1.8 + vec2( t * 0.13, t * 0.11)) * 2.0 - 1.0,\n fbm(uv * 1.8 + vec2( t * 0.11 + 3.7, -t * 0.14 + 1.1)) * 2.0 - 1.0\n );\n // Second pass: warp the warp — creates curling, folding sub-currents\n vec2 r = vec2(\n fbm(uv * 1.8 + q * 0.55 + vec2( t * 0.09, t * 0.07)) * 2.0 - 1.0,\n fbm(uv * 1.8 + q * 0.55 + vec2(-t * 0.07 + 5.1, t * 0.10 + 2.3)) * 2.0 - 1.0\n );\n vec2 wp = uv + r * 0.38;\n\n // ── ② Three independent fields — each drifts inward from its source edge ──\n // Asymmetric velocities: dominant axis matches the inflow direction so the\n // noise texture visually streams inward (left→right, right→left, bottom→top).\n float f1 = fbm(wp * 0.85 + vec2(-t * 0.18, t * 0.04)); // LEFT → right\n float f2 = fbm(wp * 0.85 + vec2( t * 0.18 + 5.3, t * 0.04 + 1.7)); // RIGHT → left\n float f3 = fbm(wp * 0.85 + vec2( t * 0.04 - 3.2, -t * 0.18 + 6.4)); // BOTTOM → up\n\n // ── ③ Breathing blobs — sin pulse makes each field expand and contract ────\n float p1 = 0.88 + 0.12 * sin(t * 0.61);\n float p2 = 0.88 + 0.12 * sin(t * 0.47 + 2.09);\n float p3 = 0.88 + 0.12 * sin(t * 0.53 + 4.19);\n\n // Wide smoothstep (0.26 → 0.70) → soft, diffused blob edges that dissolve\n // gradually into each other, like dye spreading through water.\n float b1 = smoothstep(0.26, 0.70, f1 * p1);\n float b2 = smoothstep(0.26, 0.70, f2 * p2);\n float b3 = smoothstep(0.26, 0.70, f3 * p3);\n\n // ── ④ Directional origin gradients.\n // Each color owns its home edge (value = 1.0) and smoothly fades to zero\n // before reaching the opposite side. The transition windows are offset so\n // they overlap only in the center third — that overlap zone is where the\n // three colors meet and blend, while the edges stay uncontaminated.\n float d1 = 1.0 - smoothstep(0.20, 0.74, uv.x); // c1: LEFT → full at x<0.20, zero by x=0.74\n float d2 = 1.0 - smoothstep(0.20, 0.74, 1.0 - uv.x); // c2: RIGHT → full at x>0.80, zero by x=0.26\n float d3 = 1.0 - smoothstep(0.18, 0.68, uv.y); // c3: BOTTOM → full at y<0.18, zero by y=0.68\n\n float w1 = b1 * d1;\n float w2 = b2 * d2;\n float w3 = b3 * d3;\n\n // ── ⑤ Dye-mixing colour blend ──────────────────────────────────────────────\n // dyeColor is the weighted average of all active colours — exactly how dyes\n // mix in water: overlapping streams blend smoothly, no hard edges.\n float total = w1 + w2 + w3;\n vec3 dyeColor = (u_c1 * w1 + u_c2 * w2 + u_c3 * w3) / max(total, 0.001);\n\n // Boost brightness of the dye to make colors pop and seem less dull\n dyeColor *= 1.65;\n\n // Exponential coverage: cores are rich and opaque; edges dissolve into the\n // near-white base. White only shows through where dye concentration is thin.\n float coverage = 1.0 - exp(-total * 5.0);\n vec3 col = mix(vec3(1.0, 1.0, 1.0), dyeColor, coverage);\n col = clamp(col, 0.0, 1.0);\n\n // ── ⑥ Sphere shading — subtle edge vignette only, no specular ─────────────\n vec2 uvc = v_uv * 2.0 - 1.0;\n\n // ── ⑦ Subtle grain — breaks gradient banding, adds filmic texture ──────────\n float grain = hash1(v_uv * 437.3 + fract(t)) * 2.0 - 1.0;\n col += grain * 0.018;\n\n gl_FragColor = vec4(clamp(col, 0.0, 1.0), 1.0);\n }\n";
|
|
27642
|
+
function cO(e, t, n) {
|
|
27657
27643
|
let r = (t, n) => {
|
|
27658
27644
|
let r = e.createShader(t);
|
|
27659
27645
|
return e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (console.error("[AnimatedOrb shader]", e.getShaderInfoLog(r)), null);
|
|
@@ -27662,10 +27648,10 @@ function uO(e, t, n) {
|
|
|
27662
27648
|
let o = e.createProgram();
|
|
27663
27649
|
return e.attachShader(o, i), e.attachShader(o, a), e.linkProgram(o), e.getProgramParameter(o, e.LINK_STATUS) ? o : (console.error("[AnimatedOrb link]", e.getProgramInfoLog(o)), null);
|
|
27664
27650
|
}
|
|
27665
|
-
function
|
|
27666
|
-
let [s, l, u] =
|
|
27651
|
+
function lO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
|
|
27652
|
+
let [s, l, u] = nO(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(rO[t] ?? .35);
|
|
27667
27653
|
c(() => {
|
|
27668
|
-
h.current =
|
|
27654
|
+
h.current = rO[t] ?? .35;
|
|
27669
27655
|
}, [t]), c(() => {
|
|
27670
27656
|
let t = m.current;
|
|
27671
27657
|
if (!t) return;
|
|
@@ -27682,7 +27668,7 @@ function dO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
27682
27668
|
console.warn("[AnimatedOrb] WebGL unavailable.");
|
|
27683
27669
|
return;
|
|
27684
27670
|
}
|
|
27685
|
-
let i =
|
|
27671
|
+
let i = cO(r, oO, sO);
|
|
27686
27672
|
if (!i) {
|
|
27687
27673
|
console.error("[AnimatedOrb] WebGL program failed to compile/link");
|
|
27688
27674
|
return;
|
|
@@ -27712,7 +27698,7 @@ function dO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
27712
27698
|
c2: r.getUniformLocation(i, "u_c2"),
|
|
27713
27699
|
c3: r.getUniformLocation(i, "u_c3")
|
|
27714
27700
|
};
|
|
27715
|
-
r.uniform3fv(c.c1,
|
|
27701
|
+
r.uniform3fv(c.c1, iO(s)), r.uniform3fv(c.c2, iO(l)), r.uniform3fv(c.c3, iO(u)), r.viewport(0, 0, t.width, t.height);
|
|
27716
27702
|
let d = performance.now(), f, p = (e) => {
|
|
27717
27703
|
r.uniform1f(c.time, (e - d) / 1e3), r.uniform1f(c.speed, h.current), r.drawArrays(r.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
|
|
27718
27704
|
};
|
|
@@ -27743,7 +27729,7 @@ function dO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
27743
27729
|
position: "absolute",
|
|
27744
27730
|
inset: -10,
|
|
27745
27731
|
borderRadius: "50%",
|
|
27746
|
-
background: `radial-gradient(circle, ${
|
|
27732
|
+
background: `radial-gradient(circle, ${aO(s, .18)} 0%, transparent 70%)`,
|
|
27747
27733
|
pointerEvents: "none"
|
|
27748
27734
|
},
|
|
27749
27735
|
animate: { opacity: [.3, .75] },
|
|
@@ -27821,17 +27807,17 @@ function dO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
27821
27807
|
}
|
|
27822
27808
|
//#endregion
|
|
27823
27809
|
//#region src/components/CallScreen.jsx
|
|
27824
|
-
var
|
|
27825
|
-
function
|
|
27810
|
+
var uO = "\n @keyframes fe-call-ring-pulse {\n 0% { transform: scale(1); opacity: 0.55; }\n 70% { transform: scale(1.85); opacity: 0; }\n 100% { transform: scale(1.85); opacity: 0; }\n }\n @keyframes fe-call-spin {\n to { transform: rotate(360deg); }\n }\n @keyframes fe-call-slide-up {\n from { opacity: 0; transform: translateY(24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes fe-call-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes fe-call-bar-slide-in {\n from { opacity: 0; transform: translateY(10px) scale(0.97); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n @keyframes fe-call-dot-blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.35; }\n }\n @keyframes fe-call-avatar-breathe {\n 0%, 100% { opacity: 0.5; transform: scale(1); }\n 50% { opacity: 0.9; transform: scale(1.12); }\n }\n";
|
|
27811
|
+
function dO(e) {
|
|
27826
27812
|
let t = (e || "").replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
|
|
27827
27813
|
return `${parseInt(n.slice(0, 2), 16)},${parseInt(n.slice(2, 4), 16)},${parseInt(n.slice(4, 6), 16)}`;
|
|
27828
27814
|
}
|
|
27829
|
-
function
|
|
27815
|
+
function fO(e) {
|
|
27830
27816
|
if (!e || typeof e != "string") return "#1a1a1a";
|
|
27831
27817
|
let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = parseInt(n.slice(0, 2), 16) / 255, i = parseInt(n.slice(2, 4), 16) / 255, a = parseInt(n.slice(4, 6), 16) / 255, o = (e) => e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
27832
27818
|
return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
|
|
27833
27819
|
}
|
|
27834
|
-
function
|
|
27820
|
+
function pO(e, t) {
|
|
27835
27821
|
let n = Array.isArray(e) && e.length > 0 ? e : [t || "#3B82F6"], [r, i, a] = n;
|
|
27836
27822
|
return n.length === 1 ? [
|
|
27837
27823
|
`radial-gradient(ellipse 110% 65% at 50% -5%, ${r}28 0%, transparent 68%)`,
|
|
@@ -27848,8 +27834,8 @@ function hO(e, t) {
|
|
|
27848
27834
|
"#f7f8fa"
|
|
27849
27835
|
].join(", ");
|
|
27850
27836
|
}
|
|
27851
|
-
function
|
|
27852
|
-
let i = (t || "A")[0].toUpperCase(), a =
|
|
27837
|
+
function mO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
|
|
27838
|
+
let i = (t || "A")[0].toUpperCase(), a = fO(r), o = n > 48 ? {
|
|
27853
27839
|
boxShadow: `0 0 0 3px ${r}44`,
|
|
27854
27840
|
border: "3px solid rgba(255,255,255,0.15)"
|
|
27855
27841
|
} : { border: `1.5px solid ${r}55` };
|
|
@@ -27886,7 +27872,7 @@ function gO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" })
|
|
|
27886
27872
|
children: i
|
|
27887
27873
|
});
|
|
27888
27874
|
}
|
|
27889
|
-
function
|
|
27875
|
+
function hO(e) {
|
|
27890
27876
|
let t = p(null), n = o(() => {
|
|
27891
27877
|
if (!t.current) return;
|
|
27892
27878
|
let { audioContext: e, oscillator: n, interval: r, toneTimeout: i } = t.current;
|
|
@@ -27933,8 +27919,8 @@ function _O(e) {
|
|
|
27933
27919
|
n
|
|
27934
27920
|
]), c(() => () => n(), [n]), n;
|
|
27935
27921
|
}
|
|
27936
|
-
function
|
|
27937
|
-
let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x =
|
|
27922
|
+
function gO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDurationSeconds: r, isCallMuted: i, agentName: a, agentHeadshot: o, fallbackAgentName: s, acceptCall: c, rejectCall: l, endWebRTCCall: u, toggleCallMute: d, formatCallDuration: f, onMinimize: p, primaryColor: m = "#3B82F6", orbColors: h, chatHistory: v = [] }) {
|
|
27923
|
+
let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = hO(!!e), S = async () => {
|
|
27938
27924
|
x(), await c();
|
|
27939
27925
|
}, C = async () => {
|
|
27940
27926
|
x(), await l();
|
|
@@ -27946,14 +27932,14 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
27946
27932
|
flexDirection: "column",
|
|
27947
27933
|
borderRadius: "inherit",
|
|
27948
27934
|
overflow: "hidden",
|
|
27949
|
-
background:
|
|
27935
|
+
background: pO(h, m),
|
|
27950
27936
|
animation: T ? "fe-call-slide-up 0.36s cubic-bezier(0.16,1,0.3,1)" : "fe-call-fade-in 0.32s ease"
|
|
27951
27937
|
};
|
|
27952
27938
|
if (b === "incoming") {
|
|
27953
27939
|
let e = Array.isArray(h) && h.length > 0 ? h : [m];
|
|
27954
27940
|
return /* @__PURE__ */ _("div", {
|
|
27955
27941
|
style: ee,
|
|
27956
|
-
children: [/* @__PURE__ */ g("style", { children:
|
|
27942
|
+
children: [/* @__PURE__ */ g("style", { children: uO }), /* @__PURE__ */ _("div", {
|
|
27957
27943
|
style: {
|
|
27958
27944
|
flex: 1,
|
|
27959
27945
|
display: "flex",
|
|
@@ -27984,7 +27970,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
27984
27970
|
width: "96px",
|
|
27985
27971
|
height: "96px",
|
|
27986
27972
|
borderRadius: "50%",
|
|
27987
|
-
background: `radial-gradient(circle, rgba(${
|
|
27973
|
+
background: `radial-gradient(circle, rgba(${dO(e[0])},0.2) 0%, transparent 70%)`,
|
|
27988
27974
|
filter: "blur(10px)",
|
|
27989
27975
|
zIndex: 0
|
|
27990
27976
|
} }),
|
|
@@ -28001,7 +27987,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28001
27987
|
animation: `fe-call-ring-pulse 2.6s cubic-bezier(0.215,0.61,0.355,1) ${t}s infinite`,
|
|
28002
27988
|
zIndex: 1
|
|
28003
27989
|
} }, n)),
|
|
28004
|
-
/* @__PURE__ */ g(
|
|
27990
|
+
/* @__PURE__ */ g(mO, {
|
|
28005
27991
|
headshot: o,
|
|
28006
27992
|
name: y,
|
|
28007
27993
|
size: 82,
|
|
@@ -28081,7 +28067,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28081
28067
|
e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(239,68,68,0.5)";
|
|
28082
28068
|
},
|
|
28083
28069
|
"aria-label": "Decline call",
|
|
28084
|
-
children: /* @__PURE__ */ g(
|
|
28070
|
+
children: /* @__PURE__ */ g(wD, { size: 26 })
|
|
28085
28071
|
}), /* @__PURE__ */ g("span", {
|
|
28086
28072
|
style: {
|
|
28087
28073
|
fontSize: "12px",
|
|
@@ -28122,7 +28108,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28122
28108
|
e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(34,197,94,0.5)";
|
|
28123
28109
|
},
|
|
28124
28110
|
"aria-label": "Accept call",
|
|
28125
|
-
children: /* @__PURE__ */ g(
|
|
28111
|
+
children: /* @__PURE__ */ g(DD, {})
|
|
28126
28112
|
}), /* @__PURE__ */ g("span", {
|
|
28127
28113
|
style: {
|
|
28128
28114
|
fontSize: "12px",
|
|
@@ -28139,7 +28125,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28139
28125
|
}
|
|
28140
28126
|
return b === "connecting" ? /* @__PURE__ */ _("div", {
|
|
28141
28127
|
style: ee,
|
|
28142
|
-
children: [/* @__PURE__ */ g("style", { children:
|
|
28128
|
+
children: [/* @__PURE__ */ g("style", { children: uO }), /* @__PURE__ */ _("div", {
|
|
28143
28129
|
style: {
|
|
28144
28130
|
flex: 1,
|
|
28145
28131
|
display: "flex",
|
|
@@ -28149,7 +28135,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28149
28135
|
gap: "24px"
|
|
28150
28136
|
},
|
|
28151
28137
|
children: [
|
|
28152
|
-
/* @__PURE__ */ g(
|
|
28138
|
+
/* @__PURE__ */ g(mO, {
|
|
28153
28139
|
headshot: o,
|
|
28154
28140
|
name: y,
|
|
28155
28141
|
size: 64,
|
|
@@ -28176,7 +28162,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28176
28162
|
}) : /* @__PURE__ */ _("div", {
|
|
28177
28163
|
style: ee,
|
|
28178
28164
|
children: [
|
|
28179
|
-
/* @__PURE__ */ g("style", { children:
|
|
28165
|
+
/* @__PURE__ */ g("style", { children: uO }),
|
|
28180
28166
|
/* @__PURE__ */ _("div", {
|
|
28181
28167
|
style: {
|
|
28182
28168
|
display: "flex",
|
|
@@ -28222,7 +28208,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28222
28208
|
children: /* @__PURE__ */ g("polyline", { points: "15 18 9 12 15 6" })
|
|
28223
28209
|
})
|
|
28224
28210
|
}),
|
|
28225
|
-
/* @__PURE__ */ g(
|
|
28211
|
+
/* @__PURE__ */ g(lO, {
|
|
28226
28212
|
colors: h,
|
|
28227
28213
|
size: 36,
|
|
28228
28214
|
voiceState: w
|
|
@@ -28273,7 +28259,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28273
28259
|
gap: "16px",
|
|
28274
28260
|
padding: "0 24px 16px"
|
|
28275
28261
|
},
|
|
28276
|
-
children: [/* @__PURE__ */ g(
|
|
28262
|
+
children: [/* @__PURE__ */ g(mO, {
|
|
28277
28263
|
headshot: o,
|
|
28278
28264
|
name: y,
|
|
28279
28265
|
size: 116,
|
|
@@ -28328,7 +28314,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28328
28314
|
transition: "all 0.2s ease"
|
|
28329
28315
|
},
|
|
28330
28316
|
"aria-label": i ? "Unmute" : "Mute",
|
|
28331
|
-
children: [g(i ?
|
|
28317
|
+
children: [g(i ? PD : CD, { size: 18 }), i ? "Unmute" : "Mute"]
|
|
28332
28318
|
}), /* @__PURE__ */ _("button", {
|
|
28333
28319
|
type: "button",
|
|
28334
28320
|
onClick: u,
|
|
@@ -28356,15 +28342,15 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28356
28342
|
e.currentTarget.style.background = "rgba(239,68,68,0.9)", e.currentTarget.style.transform = "scale(1)";
|
|
28357
28343
|
},
|
|
28358
28344
|
"aria-label": "End call",
|
|
28359
|
-
children: [/* @__PURE__ */ g(
|
|
28345
|
+
children: [/* @__PURE__ */ g(wD, { size: 18 }), "End Call"]
|
|
28360
28346
|
})]
|
|
28361
28347
|
})
|
|
28362
28348
|
]
|
|
28363
28349
|
});
|
|
28364
28350
|
}
|
|
28365
|
-
function
|
|
28351
|
+
function _O({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
|
|
28366
28352
|
let u = e || n || "Agent";
|
|
28367
|
-
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children:
|
|
28353
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: uO }), /* @__PURE__ */ _("div", {
|
|
28368
28354
|
role: "button",
|
|
28369
28355
|
tabIndex: 0,
|
|
28370
28356
|
onClick: c,
|
|
@@ -28421,7 +28407,7 @@ function yO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
28421
28407
|
borderRadius: "50%",
|
|
28422
28408
|
border: `1.5px solid ${l}55`
|
|
28423
28409
|
} }),
|
|
28424
|
-
/* @__PURE__ */ g(
|
|
28410
|
+
/* @__PURE__ */ g(mO, {
|
|
28425
28411
|
headshot: t,
|
|
28426
28412
|
name: u,
|
|
28427
28413
|
size: 38,
|
|
@@ -28505,7 +28491,7 @@ function yO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
28505
28491
|
boxShadow: i ? `0 0 0 3px ${l}12` : "none"
|
|
28506
28492
|
},
|
|
28507
28493
|
"aria-label": i ? "Unmute" : "Mute",
|
|
28508
|
-
children: g(i ?
|
|
28494
|
+
children: g(i ? PD : CD, { size: 15 })
|
|
28509
28495
|
}), /* @__PURE__ */ g("button", {
|
|
28510
28496
|
type: "button",
|
|
28511
28497
|
onClick: (e) => {
|
|
@@ -28533,7 +28519,7 @@ function yO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
28533
28519
|
transition: "all 0.18s ease"
|
|
28534
28520
|
},
|
|
28535
28521
|
"aria-label": "End call",
|
|
28536
|
-
children: /* @__PURE__ */ g(
|
|
28522
|
+
children: /* @__PURE__ */ g(wD, { size: 16 })
|
|
28537
28523
|
})]
|
|
28538
28524
|
})
|
|
28539
28525
|
]
|
|
@@ -28541,7 +28527,7 @@ function yO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
28541
28527
|
}
|
|
28542
28528
|
//#endregion
|
|
28543
28529
|
//#region src/utils/voicePriorContext.js
|
|
28544
|
-
function
|
|
28530
|
+
function vO(e, t = {}) {
|
|
28545
28531
|
let n = t.maxChars ?? 4500;
|
|
28546
28532
|
if (!Array.isArray(e) || e.length === 0) return "";
|
|
28547
28533
|
let r = [];
|
|
@@ -28559,7 +28545,7 @@ function bO(e, t = {}) {
|
|
|
28559
28545
|
//#endregion
|
|
28560
28546
|
//#region src/utils/voiceActionVisuals.js
|
|
28561
28547
|
var Q = "fe-vv";
|
|
28562
|
-
function
|
|
28548
|
+
function yO() {
|
|
28563
28549
|
if (typeof document > "u" || document.getElementById(`${Q}-styles`)) return;
|
|
28564
28550
|
let e = `
|
|
28565
28551
|
/* ── Action toast ───────────────────────────────────────────────────────────── */
|
|
@@ -28704,14 +28690,14 @@ function xO() {
|
|
|
28704
28690
|
`, t = document.createElement("style");
|
|
28705
28691
|
t.id = `${Q}-styles`, t.textContent = e, (document.head || document.documentElement).appendChild(t);
|
|
28706
28692
|
}
|
|
28707
|
-
var
|
|
28708
|
-
function
|
|
28709
|
-
return (!
|
|
28693
|
+
var bO = null, xO = null;
|
|
28694
|
+
function SO() {
|
|
28695
|
+
return (!bO || !bO.isConnected) && (bO = document.createElement("div"), bO.id = `${Q}-toast`, document.body.appendChild(bO)), bO;
|
|
28710
28696
|
}
|
|
28711
|
-
function
|
|
28697
|
+
function CO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
|
|
28712
28698
|
if (typeof document > "u") return;
|
|
28713
|
-
|
|
28714
|
-
let i =
|
|
28699
|
+
yO(), xO &&= (clearTimeout(xO), null);
|
|
28700
|
+
let i = SO();
|
|
28715
28701
|
if (i.innerHTML = "", n) {
|
|
28716
28702
|
let e = document.createElement("span");
|
|
28717
28703
|
e.className = `${Q}-icon`, e.textContent = n, i.appendChild(e);
|
|
@@ -28720,82 +28706,82 @@ function TO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
|
|
|
28720
28706
|
e.className = `${Q}-spin`, i.appendChild(e);
|
|
28721
28707
|
}
|
|
28722
28708
|
let a = document.createElement("span");
|
|
28723
|
-
a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (
|
|
28709
|
+
a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (xO = setTimeout(() => wO(), r));
|
|
28724
28710
|
}
|
|
28725
|
-
function
|
|
28726
|
-
|
|
28727
|
-
|
|
28728
|
-
}, e) :
|
|
28711
|
+
function wO(e = 0) {
|
|
28712
|
+
bO && (e > 0 ? xO = setTimeout(() => {
|
|
28713
|
+
bO && bO.classList.remove(`${Q}-show`);
|
|
28714
|
+
}, e) : bO && bO.classList.remove(`${Q}-show`));
|
|
28729
28715
|
}
|
|
28730
|
-
var
|
|
28731
|
-
function
|
|
28732
|
-
return (!
|
|
28716
|
+
var TO = null, EO = [];
|
|
28717
|
+
function DO() {
|
|
28718
|
+
return (!TO || !TO.isConnected) && (TO = document.createElement("div"), TO.id = `${Q}-bar`, document.body.appendChild(TO)), TO;
|
|
28733
28719
|
}
|
|
28734
|
-
function
|
|
28720
|
+
function OO() {
|
|
28735
28721
|
if (typeof document > "u") return;
|
|
28736
|
-
|
|
28737
|
-
let e =
|
|
28722
|
+
yO(), EO.forEach(clearTimeout), EO = [];
|
|
28723
|
+
let e = DO();
|
|
28738
28724
|
e.style.transition = "none", e.style.width = "0%", e.classList.add(`${Q}-bar-active`), e.offsetHeight, e.style.transition = "width 0.35s ease, opacity 0.25s ease";
|
|
28739
28725
|
let t = [[80, "width 0.6s ease"], [92, "width 1.2s ease"]], n = 50;
|
|
28740
28726
|
for (let [e, r] of t) {
|
|
28741
28727
|
let t = n, i = e, a = r;
|
|
28742
|
-
|
|
28743
|
-
|
|
28728
|
+
EO.push(setTimeout(() => {
|
|
28729
|
+
TO && (TO.style.transition = a, TO.style.width = `${i}%`);
|
|
28744
28730
|
}, t)), n += 800;
|
|
28745
28731
|
}
|
|
28746
28732
|
}
|
|
28747
|
-
function
|
|
28748
|
-
|
|
28749
|
-
|
|
28750
|
-
|
|
28733
|
+
function kO() {
|
|
28734
|
+
TO && (EO.forEach(clearTimeout), EO = [], TO.style.transition = "width 0.2s ease", TO.style.width = "100%", EO.push(setTimeout(() => {
|
|
28735
|
+
TO && (TO.style.transition = "opacity 0.35s ease", TO.style.opacity = "0", EO.push(setTimeout(() => {
|
|
28736
|
+
TO && (TO.style.width = "0%", TO.classList.remove(`${Q}-bar-active`));
|
|
28751
28737
|
}, 380)));
|
|
28752
28738
|
}, 220)));
|
|
28753
28739
|
}
|
|
28754
|
-
function
|
|
28740
|
+
function AO() {
|
|
28755
28741
|
typeof document > "u" || document.querySelectorAll(`.${Q}-field-active, .${Q}-field-filled`).forEach((e) => e.classList.remove(`${Q}-field-active`, `${Q}-field-filled`));
|
|
28756
28742
|
}
|
|
28757
|
-
function
|
|
28758
|
-
!e || typeof document > "u" || (
|
|
28743
|
+
function jO(e) {
|
|
28744
|
+
!e || typeof document > "u" || (yO(), AO(), e.classList.add(`${Q}-field-active`));
|
|
28759
28745
|
}
|
|
28760
|
-
function
|
|
28746
|
+
function MO(e) {
|
|
28761
28747
|
e && (e.classList.remove(`${Q}-field-active`), e.classList.add(`${Q}-field-filled`), setTimeout(() => {
|
|
28762
28748
|
e.isConnected && e.classList.remove(`${Q}-field-filled`);
|
|
28763
28749
|
}, 1400));
|
|
28764
28750
|
}
|
|
28765
|
-
var
|
|
28751
|
+
var NO = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
|
|
28766
28752
|
<filter id="${Q}-csh">
|
|
28767
28753
|
<feDropShadow dx="1" dy="2" stdDeviation="1.5" flood-color="#00000060"/>
|
|
28768
28754
|
</filter>
|
|
28769
28755
|
<path d="M4 2L19 10.5L11 12.8L8 20L4 2Z"
|
|
28770
28756
|
fill="white" stroke="#1e1b4b" stroke-width="1.6" stroke-linejoin="round"
|
|
28771
28757
|
filter="url(#${Q}-csh)"/>
|
|
28772
|
-
</svg>`,
|
|
28773
|
-
function
|
|
28774
|
-
return (!
|
|
28758
|
+
</svg>`, PO = null, FO = !1;
|
|
28759
|
+
function IO() {
|
|
28760
|
+
return (!PO || !PO.isConnected) && (PO = document.createElement("div"), PO.id = `${Q}-cursor`, PO.innerHTML = NO, document.body.appendChild(PO), FO = !1), PO;
|
|
28775
28761
|
}
|
|
28776
|
-
async function
|
|
28762
|
+
async function LO(e) {
|
|
28777
28763
|
if (typeof document > "u" || !e) return;
|
|
28778
|
-
|
|
28764
|
+
yO();
|
|
28779
28765
|
let t;
|
|
28780
28766
|
try {
|
|
28781
28767
|
t = e.getBoundingClientRect();
|
|
28782
28768
|
} catch {
|
|
28783
28769
|
return;
|
|
28784
28770
|
}
|
|
28785
|
-
let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i =
|
|
28786
|
-
|
|
28771
|
+
let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = IO();
|
|
28772
|
+
FO ||= (i.style.transition = "none", i.style.left = `${window.innerWidth / 2}px`, i.style.top = `${window.innerHeight * .4}px`, i.classList.add(`${Q}-cursor-visible`), i.offsetHeight, i.style.transition = "left 0.32s cubic-bezier(0.25,0.46,0.45,0.94), top 0.32s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.2s ease", !0), i.style.left = `${n}px`, i.style.top = `${r}px`, await VO(360);
|
|
28787
28773
|
}
|
|
28788
|
-
function
|
|
28789
|
-
|
|
28790
|
-
|
|
28774
|
+
function RO(e = !1) {
|
|
28775
|
+
PO && (e ? (PO.classList.remove(`${Q}-cursor-visible`), FO = !1) : (PO.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
|
|
28776
|
+
FO = !1;
|
|
28791
28777
|
}, 250)));
|
|
28792
28778
|
}
|
|
28793
|
-
async function
|
|
28794
|
-
|
|
28779
|
+
async function zO(e) {
|
|
28780
|
+
PO && (PO.classList.add(`${Q}-cursor-click`), await VO(280), PO.classList.remove(`${Q}-cursor-click`));
|
|
28795
28781
|
}
|
|
28796
|
-
function
|
|
28782
|
+
function BO(e) {
|
|
28797
28783
|
if (!e || typeof document > "u") return;
|
|
28798
|
-
|
|
28784
|
+
yO();
|
|
28799
28785
|
let t;
|
|
28800
28786
|
try {
|
|
28801
28787
|
t = e.getBoundingClientRect();
|
|
@@ -28821,7 +28807,7 @@ function HO(e) {
|
|
|
28821
28807
|
a.remove(), e.style.position = n, e.style.overflow = r;
|
|
28822
28808
|
}, 650);
|
|
28823
28809
|
}
|
|
28824
|
-
function
|
|
28810
|
+
function VO(e) {
|
|
28825
28811
|
return new Promise((t) => setTimeout(t, e));
|
|
28826
28812
|
}
|
|
28827
28813
|
//#endregion
|
|
@@ -28829,42 +28815,42 @@ function UO(e) {
|
|
|
28829
28815
|
function $(...e) {
|
|
28830
28816
|
Rn() && console.log("[FlowEngage:voice-tools]", ...e);
|
|
28831
28817
|
}
|
|
28832
|
-
function
|
|
28818
|
+
function HO(e) {
|
|
28833
28819
|
return new Promise((t) => setTimeout(t, e));
|
|
28834
28820
|
}
|
|
28835
|
-
var
|
|
28836
|
-
function
|
|
28821
|
+
var UO = "#flowengage-root, .flowengage-shell, .flowengage-widget-root";
|
|
28822
|
+
function WO(e) {
|
|
28837
28823
|
if (!e || typeof e.closest != "function") return !1;
|
|
28838
28824
|
try {
|
|
28839
|
-
return !!e.closest(
|
|
28825
|
+
return !!e.closest(UO);
|
|
28840
28826
|
} catch {
|
|
28841
28827
|
return !1;
|
|
28842
28828
|
}
|
|
28843
28829
|
}
|
|
28844
|
-
function
|
|
28830
|
+
function GO(e) {
|
|
28845
28831
|
try {
|
|
28846
28832
|
let t = e.ownerDocument?.defaultView;
|
|
28847
28833
|
if (t) return t.getComputedStyle(e);
|
|
28848
28834
|
} catch {}
|
|
28849
28835
|
return window.getComputedStyle(e);
|
|
28850
28836
|
}
|
|
28851
|
-
function
|
|
28837
|
+
function KO(e) {
|
|
28852
28838
|
let t = /* @__PURE__ */ new Set();
|
|
28853
28839
|
function n(r) {
|
|
28854
28840
|
if (!r || t.has(r)) return;
|
|
28855
28841
|
t.add(r), e(r);
|
|
28856
28842
|
let i = r.querySelectorAll("iframe");
|
|
28857
|
-
for (let e of i) if (!
|
|
28843
|
+
for (let e of i) if (!WO(e)) try {
|
|
28858
28844
|
let t = e.contentDocument;
|
|
28859
28845
|
t && n(t);
|
|
28860
28846
|
} catch {}
|
|
28861
28847
|
}
|
|
28862
28848
|
typeof document < "u" && n(document);
|
|
28863
28849
|
}
|
|
28864
|
-
function
|
|
28850
|
+
function qO(e) {
|
|
28865
28851
|
return e == null ? null : String(e).replace(/\u00a0/g, " ").replace(/\s*\*+\s*$/u, "").replace(/\s+/g, " ").trim();
|
|
28866
28852
|
}
|
|
28867
|
-
function
|
|
28853
|
+
function JO(e) {
|
|
28868
28854
|
let t = e.ownerDocument || document, n = e.getAttribute("aria-labelledby");
|
|
28869
28855
|
if (n) {
|
|
28870
28856
|
let e = n.trim().split(/\s+/).filter(Boolean), r = [];
|
|
@@ -28872,42 +28858,42 @@ function XO(e) {
|
|
|
28872
28858
|
let e = t.getElementById(n);
|
|
28873
28859
|
e?.textContent && r.push(e.textContent.trim());
|
|
28874
28860
|
} catch {}
|
|
28875
|
-
if (r.length) return
|
|
28861
|
+
if (r.length) return qO(r.join(" "));
|
|
28876
28862
|
}
|
|
28877
|
-
if (e.labels && e.labels.length) return
|
|
28863
|
+
if (e.labels && e.labels.length) return qO(e.labels[0].textContent);
|
|
28878
28864
|
let r = e.id;
|
|
28879
28865
|
if (r) try {
|
|
28880
28866
|
let e = t.querySelector(`label[for="${CSS.escape(r)}"]`);
|
|
28881
|
-
if (e) return
|
|
28867
|
+
if (e) return qO(e.textContent);
|
|
28882
28868
|
} catch {
|
|
28883
28869
|
let e = t.querySelector(`label[for="${r.replace(/"/g, "\\\"")}"]`);
|
|
28884
|
-
if (e) return
|
|
28870
|
+
if (e) return qO(e.textContent);
|
|
28885
28871
|
}
|
|
28886
28872
|
let i = e.previousElementSibling;
|
|
28887
28873
|
for (let e = 0; e < 6 && i; e += 1) {
|
|
28888
|
-
if (i.tagName === "LABEL") return
|
|
28874
|
+
if (i.tagName === "LABEL") return qO(i.textContent);
|
|
28889
28875
|
let e = (i.className || "").toString().toLowerCase();
|
|
28890
28876
|
if (/chakra-form__label|formlabel|field-label|form-label|mui-form-label/.test(e)) {
|
|
28891
|
-
let e =
|
|
28877
|
+
let e = qO(i.textContent);
|
|
28892
28878
|
if (e) return e;
|
|
28893
28879
|
}
|
|
28894
28880
|
i = i.previousElementSibling;
|
|
28895
28881
|
}
|
|
28896
28882
|
let a = e.parentElement;
|
|
28897
28883
|
for (let e = 0; e < 5 && a; e += 1) {
|
|
28898
|
-
if (a.tagName === "LABEL") return
|
|
28884
|
+
if (a.tagName === "LABEL") return qO(a.textContent);
|
|
28899
28885
|
let e = a.querySelector?.(":scope > label, :scope > [class*='FormLabel'], :scope > [class*='form__label']");
|
|
28900
|
-
if (e?.textContent) return
|
|
28886
|
+
if (e?.textContent) return qO(e.textContent);
|
|
28901
28887
|
a = a.parentElement;
|
|
28902
28888
|
}
|
|
28903
28889
|
let o = e.getAttribute("aria-label");
|
|
28904
|
-
return o ?
|
|
28890
|
+
return o ? qO(o) : null;
|
|
28905
28891
|
}
|
|
28906
|
-
function
|
|
28892
|
+
function YO() {
|
|
28907
28893
|
let e = [];
|
|
28908
|
-
return
|
|
28894
|
+
return KO((t) => {
|
|
28909
28895
|
e.push(...Array.from(t.querySelectorAll("input, select, textarea")).filter((e) => {
|
|
28910
|
-
if (
|
|
28896
|
+
if (WO(e)) return !1;
|
|
28911
28897
|
let t = (e.type || "").toLowerCase();
|
|
28912
28898
|
if ([
|
|
28913
28899
|
"hidden",
|
|
@@ -28916,32 +28902,32 @@ function ZO() {
|
|
|
28916
28902
|
"image"
|
|
28917
28903
|
].includes(t) || e.disabled || e.readOnly) return !1;
|
|
28918
28904
|
try {
|
|
28919
|
-
let t =
|
|
28905
|
+
let t = GO(e);
|
|
28920
28906
|
if (t.display === "none" || t.visibility === "hidden") return !1;
|
|
28921
28907
|
} catch {}
|
|
28922
28908
|
return !0;
|
|
28923
28909
|
}));
|
|
28924
28910
|
}), e;
|
|
28925
28911
|
}
|
|
28926
|
-
function
|
|
28927
|
-
return
|
|
28912
|
+
function XO() {
|
|
28913
|
+
return YO().map((e, t) => ({
|
|
28928
28914
|
formIndex: 0,
|
|
28929
28915
|
fieldIndex: t,
|
|
28930
28916
|
tag: e.tagName,
|
|
28931
28917
|
type: e.type || "text",
|
|
28932
28918
|
name: e.name || null,
|
|
28933
28919
|
id: e.id || null,
|
|
28934
|
-
label:
|
|
28920
|
+
label: JO(e),
|
|
28935
28921
|
placeholder: e.placeholder || null
|
|
28936
28922
|
}));
|
|
28937
28923
|
}
|
|
28938
|
-
function
|
|
28924
|
+
function ZO() {
|
|
28939
28925
|
let e = [];
|
|
28940
|
-
return
|
|
28926
|
+
return KO((t) => {
|
|
28941
28927
|
e.push(...Array.from(t.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
|
|
28942
|
-
if (
|
|
28928
|
+
if (WO(e) || e.disabled) return !1;
|
|
28943
28929
|
try {
|
|
28944
|
-
let t =
|
|
28930
|
+
let t = GO(e);
|
|
28945
28931
|
if (t.display === "none" || t.visibility === "hidden") return !1;
|
|
28946
28932
|
} catch {}
|
|
28947
28933
|
return !0;
|
|
@@ -28953,15 +28939,15 @@ function $O() {
|
|
|
28953
28939
|
type: e.type || e.tagName
|
|
28954
28940
|
}));
|
|
28955
28941
|
}
|
|
28956
|
-
function
|
|
28942
|
+
function QO(e) {
|
|
28957
28943
|
return String(e || "").toLowerCase().replace(/\u00a0/g, " ").replace(/\*/g, "").replace(/\s+/g, " ").trim();
|
|
28958
28944
|
}
|
|
28959
|
-
function
|
|
28960
|
-
let t =
|
|
28945
|
+
function $O(e) {
|
|
28946
|
+
let t = QO(e);
|
|
28961
28947
|
return t = t.replace(/\s+field\s*$/i, "").trim(), t;
|
|
28962
28948
|
}
|
|
28963
|
-
function
|
|
28964
|
-
let n =
|
|
28949
|
+
function ek(e, t) {
|
|
28950
|
+
let n = $O(t);
|
|
28965
28951
|
if (!n) return 0;
|
|
28966
28952
|
let r = (e.name || "").toLowerCase(), i = (e.id || "").toLowerCase();
|
|
28967
28953
|
if (r === "url" && /url|website|domain|site|audit/.test(n) || (i === "url-input" || i.endsWith("-url-input")) && /url|website|domain|site|audit/.test(n)) return 100;
|
|
@@ -28969,12 +28955,12 @@ function nk(e, t) {
|
|
|
28969
28955
|
e.name,
|
|
28970
28956
|
e.id,
|
|
28971
28957
|
e.placeholder,
|
|
28972
|
-
|
|
28958
|
+
JO(e),
|
|
28973
28959
|
e.getAttribute("aria-label"),
|
|
28974
28960
|
e.getAttribute("title"),
|
|
28975
28961
|
e.getAttribute("data-testid"),
|
|
28976
28962
|
e.getAttribute("autocomplete")
|
|
28977
|
-
].filter(Boolean).map((e) =>
|
|
28963
|
+
].filter(Boolean).map((e) => QO(e)), o = 0;
|
|
28978
28964
|
for (let e of a) {
|
|
28979
28965
|
if (!e) continue;
|
|
28980
28966
|
if (e.includes(n) || n.includes(e)) {
|
|
@@ -28989,16 +28975,16 @@ function nk(e, t) {
|
|
|
28989
28975
|
}
|
|
28990
28976
|
return o;
|
|
28991
28977
|
}
|
|
28992
|
-
var
|
|
28993
|
-
function
|
|
28978
|
+
var tk = 28;
|
|
28979
|
+
function nk(e, t) {
|
|
28994
28980
|
let n = null, r = 0;
|
|
28995
28981
|
for (let i of e) {
|
|
28996
|
-
let e =
|
|
28982
|
+
let e = ek(i, t);
|
|
28997
28983
|
e > r && (r = e, n = i);
|
|
28998
28984
|
}
|
|
28999
|
-
return !n || r <
|
|
28985
|
+
return !n || r < tk ? null : n;
|
|
29000
28986
|
}
|
|
29001
|
-
function
|
|
28987
|
+
function rk(e, t, n) {
|
|
29002
28988
|
let r = String(t || "").toLowerCase().trim(), i = String(n || "").trim();
|
|
29003
28989
|
if (!(/^https?:\/\//i.test(i) || /\.\w{2,}(\/|\s|$)/.test(i) || r.includes("url") || r.includes("website") || r.includes("domain") || r.includes("site"))) return null;
|
|
29004
28990
|
let a = null, o = 0;
|
|
@@ -29018,7 +29004,7 @@ function ak(e, t, n) {
|
|
|
29018
29004
|
t.name,
|
|
29019
29005
|
t.id,
|
|
29020
29006
|
t.placeholder,
|
|
29021
|
-
|
|
29007
|
+
JO(t),
|
|
29022
29008
|
t.getAttribute("aria-label"),
|
|
29023
29009
|
t.getAttribute("autocomplete")
|
|
29024
29010
|
].filter(Boolean).join(" ").toLowerCase();
|
|
@@ -29026,15 +29012,15 @@ function ak(e, t, n) {
|
|
|
29026
29012
|
}
|
|
29027
29013
|
return !a || o < 42 ? null : a;
|
|
29028
29014
|
}
|
|
29029
|
-
function
|
|
29015
|
+
function ik(e) {
|
|
29030
29016
|
let t = String(e ?? "").trim();
|
|
29031
29017
|
return t ? /^https?:\/\//i.test(t) ? !0 : /\.\w{2,}(\/|\s|$)/.test(t) : !1;
|
|
29032
29018
|
}
|
|
29033
|
-
function
|
|
29019
|
+
function ak(e) {
|
|
29034
29020
|
let t = String(e ?? "").toLowerCase().trim();
|
|
29035
29021
|
return t ? !!(t === "url" || t === "website" || t === "website url" || t === "website_url" || t === "enter website url" || t.includes("website") || t.includes("domain") || /(enter\s+website|site\s*url|page\s*url)/.test(t)) : !1;
|
|
29036
29022
|
}
|
|
29037
|
-
function
|
|
29023
|
+
function ok(e) {
|
|
29038
29024
|
if (!e || e.tagName !== "INPUT" && e.tagName !== "TEXTAREA") return !1;
|
|
29039
29025
|
let t = (e.type || "").toLowerCase();
|
|
29040
29026
|
return ![
|
|
@@ -29046,22 +29032,22 @@ function ck(e) {
|
|
|
29046
29032
|
"file"
|
|
29047
29033
|
].includes(t);
|
|
29048
29034
|
}
|
|
29049
|
-
function
|
|
29050
|
-
if (!
|
|
29035
|
+
function sk(e) {
|
|
29036
|
+
if (!ok(e)) return !1;
|
|
29051
29037
|
let t = (e.name || "").toLowerCase(), n = (e.id || "").toLowerCase(), r = [
|
|
29052
29038
|
e.name,
|
|
29053
29039
|
e.id,
|
|
29054
29040
|
e.placeholder,
|
|
29055
|
-
|
|
29041
|
+
JO(e),
|
|
29056
29042
|
e.getAttribute("aria-label")
|
|
29057
29043
|
].filter(Boolean).join(" ").toLowerCase();
|
|
29058
29044
|
return t === "url" || n === "url-input" || n.endsWith("-url-input") || /(website\s*url|enter\s+website|site\s*url)/.test(r) || /(website|domain)/.test(r) && /(url|site)/.test(r);
|
|
29059
29045
|
}
|
|
29060
|
-
function
|
|
29061
|
-
let r = String(t ?? ""), i = String(n ?? ""), a =
|
|
29046
|
+
function ck(e, t, n) {
|
|
29047
|
+
let r = String(t ?? ""), i = String(n ?? ""), a = dk(e, r) || nk(e, r) || rk(e, r, i);
|
|
29062
29048
|
if (!a) return [];
|
|
29063
29049
|
let o = new Set([a]);
|
|
29064
|
-
if (
|
|
29050
|
+
if (ik(i) && ak(r)) for (let t of e) t !== a && sk(t) && o.add(t);
|
|
29065
29051
|
let s = Array.from(o);
|
|
29066
29052
|
return s.sort((e, t) => {
|
|
29067
29053
|
if (e === t) return 0;
|
|
@@ -29069,7 +29055,7 @@ function uk(e, t, n) {
|
|
|
29069
29055
|
return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
29070
29056
|
}), s;
|
|
29071
29057
|
}
|
|
29072
|
-
function
|
|
29058
|
+
function lk(e, t) {
|
|
29073
29059
|
try {
|
|
29074
29060
|
if (!e?.getBoundingClientRect || !t?.getBoundingClientRect) return Infinity;
|
|
29075
29061
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
@@ -29084,17 +29070,17 @@ function dk(e, t) {
|
|
|
29084
29070
|
return Infinity;
|
|
29085
29071
|
}
|
|
29086
29072
|
}
|
|
29087
|
-
function
|
|
29073
|
+
function uk(e) {
|
|
29088
29074
|
if (!e || typeof e != "string") return null;
|
|
29089
29075
|
let t = null;
|
|
29090
|
-
return
|
|
29076
|
+
return KO((n) => {
|
|
29091
29077
|
try {
|
|
29092
29078
|
let r = n.getElementById(e);
|
|
29093
|
-
r && !
|
|
29079
|
+
r && !WO(r) && r.matches?.("input, select, textarea") && (t = r);
|
|
29094
29080
|
} catch {}
|
|
29095
29081
|
}), t;
|
|
29096
29082
|
}
|
|
29097
|
-
function
|
|
29083
|
+
function dk(e, t) {
|
|
29098
29084
|
let n = String(t ?? "").trim();
|
|
29099
29085
|
if (!n) return null;
|
|
29100
29086
|
let r = n.match(/^name:\s*([\w.-]+)$/i);
|
|
@@ -29104,12 +29090,12 @@ function pk(e, t) {
|
|
|
29104
29090
|
}
|
|
29105
29091
|
let i = n.match(/^id:\s*([\w.-]+)$/i);
|
|
29106
29092
|
if (i) {
|
|
29107
|
-
let e =
|
|
29093
|
+
let e = uk(i[1]);
|
|
29108
29094
|
if (e) return e;
|
|
29109
29095
|
}
|
|
29110
29096
|
let a = n.startsWith("#") ? n.slice(1) : n;
|
|
29111
29097
|
if (/^[\w-]+$/.test(a)) {
|
|
29112
|
-
let e =
|
|
29098
|
+
let e = uk(a);
|
|
29113
29099
|
if (e) return e;
|
|
29114
29100
|
}
|
|
29115
29101
|
let o = n.toLowerCase().replace(/\s+/g, " ");
|
|
@@ -29119,7 +29105,7 @@ function pk(e, t) {
|
|
|
29119
29105
|
}
|
|
29120
29106
|
return null;
|
|
29121
29107
|
}
|
|
29122
|
-
function
|
|
29108
|
+
function fk(e, t) {
|
|
29123
29109
|
let n = String(t || "").toLowerCase().trim();
|
|
29124
29110
|
if (!n) return 0;
|
|
29125
29111
|
let r = [
|
|
@@ -29135,13 +29121,13 @@ function mk(e, t) {
|
|
|
29135
29121
|
for (let e of i) r.includes(e) && (a += 1);
|
|
29136
29122
|
return a / i.length * 92;
|
|
29137
29123
|
}
|
|
29138
|
-
function
|
|
29124
|
+
function pk(e, t) {
|
|
29139
29125
|
let n = [];
|
|
29140
|
-
|
|
29126
|
+
KO((e) => {
|
|
29141
29127
|
n.push(...Array.from(e.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
|
|
29142
|
-
if (
|
|
29128
|
+
if (WO(e) || e.disabled) return !1;
|
|
29143
29129
|
try {
|
|
29144
|
-
let t =
|
|
29130
|
+
let t = GO(e);
|
|
29145
29131
|
if (t.display === "none" || t.visibility === "hidden") return !1;
|
|
29146
29132
|
} catch {}
|
|
29147
29133
|
return !0;
|
|
@@ -29149,7 +29135,7 @@ function hk(e, t) {
|
|
|
29149
29135
|
});
|
|
29150
29136
|
let r = 0, i = n.map((t) => ({
|
|
29151
29137
|
el: t,
|
|
29152
|
-
s:
|
|
29138
|
+
s: fk(t, e)
|
|
29153
29139
|
}));
|
|
29154
29140
|
for (let { s: e } of i) e > r && (r = e);
|
|
29155
29141
|
if (r < 36) return null;
|
|
@@ -29159,14 +29145,14 @@ function hk(e, t) {
|
|
|
29159
29145
|
if (o.length) {
|
|
29160
29146
|
let e = a[0], t = Infinity;
|
|
29161
29147
|
for (let n of a) for (let r of o) {
|
|
29162
|
-
let i =
|
|
29148
|
+
let i = lk(n, r);
|
|
29163
29149
|
i < t && (t = i, e = n);
|
|
29164
29150
|
}
|
|
29165
29151
|
return e;
|
|
29166
29152
|
}
|
|
29167
29153
|
return a[0];
|
|
29168
29154
|
}
|
|
29169
|
-
function
|
|
29155
|
+
function mk(e) {
|
|
29170
29156
|
if (e == null) return {};
|
|
29171
29157
|
if (typeof e == "string") {
|
|
29172
29158
|
let t = e.trim();
|
|
@@ -29179,8 +29165,8 @@ function gk(e) {
|
|
|
29179
29165
|
}
|
|
29180
29166
|
return e;
|
|
29181
29167
|
}
|
|
29182
|
-
function
|
|
29183
|
-
let t =
|
|
29168
|
+
function hk(e) {
|
|
29169
|
+
let t = mk(e);
|
|
29184
29170
|
if (Array.isArray(t) && t.length > 0) {
|
|
29185
29171
|
let e = t[0];
|
|
29186
29172
|
if (e?.field_key != null || e?.fieldKey != null) return t.map((e) => ({
|
|
@@ -29208,7 +29194,7 @@ function _k(e) {
|
|
|
29208
29194
|
value: e?.value ?? e?.Value
|
|
29209
29195
|
})) : [];
|
|
29210
29196
|
}
|
|
29211
|
-
function
|
|
29197
|
+
function gk(e) {
|
|
29212
29198
|
if (!e || typeof e != "string") return [];
|
|
29213
29199
|
let t = e.trim();
|
|
29214
29200
|
if (!t || /\b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\b/i.test(t)) return [];
|
|
@@ -29227,7 +29213,7 @@ function vk(e) {
|
|
|
29227
29213
|
}
|
|
29228
29214
|
return [];
|
|
29229
29215
|
}
|
|
29230
|
-
function
|
|
29216
|
+
function _k(e) {
|
|
29231
29217
|
if (!e || typeof e != "string") return [];
|
|
29232
29218
|
let t = e.trim();
|
|
29233
29219
|
if (!t) return [];
|
|
@@ -29263,17 +29249,17 @@ function yk(e) {
|
|
|
29263
29249
|
}
|
|
29264
29250
|
return n;
|
|
29265
29251
|
}
|
|
29266
|
-
function
|
|
29252
|
+
function vk(e) {
|
|
29267
29253
|
if (!e || typeof e != "object") return null;
|
|
29268
29254
|
let t = e.url ?? e.target_url ?? e.page_url ?? e.pageUrl ?? e.link ?? e.href ?? e.path;
|
|
29269
29255
|
return t == null ? null : String(t).trim() || null;
|
|
29270
29256
|
}
|
|
29271
|
-
function
|
|
29257
|
+
function yk(e) {
|
|
29272
29258
|
if (!e || typeof e != "object") return null;
|
|
29273
29259
|
let t = e.query ?? e.q ?? e.search ?? e.text ?? e.keywords;
|
|
29274
29260
|
return t == null ? null : String(t).trim() || null;
|
|
29275
29261
|
}
|
|
29276
|
-
function
|
|
29262
|
+
function bk(e, t, n) {
|
|
29277
29263
|
if (!n?.skipScroll) try {
|
|
29278
29264
|
e.scrollIntoView({
|
|
29279
29265
|
block: "center",
|
|
@@ -29328,7 +29314,7 @@ function Sk(e, t, n) {
|
|
|
29328
29314
|
} catch {}
|
|
29329
29315
|
return !0;
|
|
29330
29316
|
}
|
|
29331
|
-
function
|
|
29317
|
+
function xk() {
|
|
29332
29318
|
let e = {};
|
|
29333
29319
|
document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((t) => {
|
|
29334
29320
|
if (t.id) return;
|
|
@@ -29343,15 +29329,15 @@ function Ck() {
|
|
|
29343
29329
|
e[r] = !0, t.id = r;
|
|
29344
29330
|
});
|
|
29345
29331
|
}
|
|
29346
|
-
function
|
|
29332
|
+
function Sk() {
|
|
29347
29333
|
let e = document.querySelector("main, [role='main'], article") || document.body;
|
|
29348
29334
|
return Array.from(e.querySelectorAll("h1, h2, h3, h4")).filter((e) => !e.closest("#flowengage-root, .flowengage-shell, .flowengage-widget-root")).map((e) => e.textContent.replace(/\s+/g, " ").trim()).filter((e) => e.length > 2 && e.length < 200).slice(0, 12);
|
|
29349
29335
|
}
|
|
29350
|
-
function
|
|
29336
|
+
function Ck(e) {
|
|
29351
29337
|
let t = e.siteId || null, n = (e.apiBaseUrl || "").replace(/\/$/, ""), r = typeof e.getLastUserVoiceText == "function" ? e.getLastUserVoiceText : null, i = [], a = {
|
|
29352
29338
|
flowengage_navigate: async (n) => {
|
|
29353
29339
|
$("flowengage_navigate ▶ raw parameters:", n);
|
|
29354
|
-
let i =
|
|
29340
|
+
let i = mk(n), a = vk(i), o = i.section_text ?? i.sectionText ?? i.section, s = Array.isArray(i.expected_landmarks) ? i.expected_landmarks : Array.isArray(i.expectedLandmarks) ? i.expectedLandmarks : [];
|
|
29355
29341
|
if ($("flowengage_navigate · coerced:", {
|
|
29356
29342
|
url: a,
|
|
29357
29343
|
sectionText: o,
|
|
@@ -29376,11 +29362,11 @@ function Tk(e) {
|
|
|
29376
29362
|
return $("flowengage_navigate ✖ blocked", e), e;
|
|
29377
29363
|
}
|
|
29378
29364
|
try {
|
|
29379
|
-
|
|
29365
|
+
CO(`Navigating to ${a}...`, { spinner: !0 }), OO(), SD();
|
|
29380
29366
|
try {
|
|
29381
29367
|
let e = r ? r() : "";
|
|
29382
29368
|
if (e && t) {
|
|
29383
|
-
let n =
|
|
29369
|
+
let n = vO([{
|
|
29384
29370
|
sender: "user",
|
|
29385
29371
|
message: e
|
|
29386
29372
|
}]);
|
|
@@ -29400,7 +29386,7 @@ function Tk(e) {
|
|
|
29400
29386
|
let n = typeof window < "u" ? window.location.pathname : e, r = typeof window < "u" ? window.location.href : a, i = n === e, o = (n.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) || "Home";
|
|
29401
29387
|
$("flowengage_navigate → SPA nav complete. target:", e, "actual:", n);
|
|
29402
29388
|
let s = [], c = Date.now() + 2e3;
|
|
29403
|
-
for (; Date.now() < c && (await new Promise((e) => setTimeout(e, 250)), s =
|
|
29389
|
+
for (; Date.now() < c && (await new Promise((e) => setTimeout(e, 250)), s = Sk(), !(s.length >= 3)););
|
|
29404
29390
|
$("flowengage_navigate → page headings collected:", s);
|
|
29405
29391
|
let l = s.length ? s.join(" | ") : "none";
|
|
29406
29392
|
return i ? (wr(), `OK_NAVIGATE_SPA. Visitor is now on: ${r} (page: "${o}") | Section headings: ${l}. Use ONLY these exact heading strings for flowengage_highlight. Do NOT say "I have navigated you" or "I've taken you to" — start immediately with highlights and content about THIS page.`) : (wr(), `OK_NAVIGATE_SPA. CURRENT PAGE IS: ${r} (page: "${o}") | Section headings: ${l}. Use ONLY these exact heading strings for flowengage_highlight. Describe THIS page only — do not mention the page you tried to navigate to.`);
|
|
@@ -29408,30 +29394,30 @@ function Tk(e) {
|
|
|
29408
29394
|
return "OK_NAVIGATE_RELOADING. Navigating to the page now; the voice session will resume automatically on the new page. When the session resumes, immediately introduce the new page and continue guiding the visitor — do not wait for the user to speak first.";
|
|
29409
29395
|
} catch (e) {
|
|
29410
29396
|
let t = `Navigation error: ${e?.message || String(e)}`;
|
|
29411
|
-
return $("flowengage_navigate ✖", t),
|
|
29397
|
+
return $("flowengage_navigate ✖", t), CO("Navigation failed", {
|
|
29412
29398
|
spinner: !1,
|
|
29413
29399
|
icon: "⚠️",
|
|
29414
29400
|
duration: 1800
|
|
29415
29401
|
}), t;
|
|
29416
29402
|
} finally {
|
|
29417
|
-
|
|
29403
|
+
kO(), wO(900);
|
|
29418
29404
|
}
|
|
29419
29405
|
},
|
|
29420
29406
|
flowengage_highlight: async (e) => {
|
|
29421
29407
|
$("flowengage_highlight ▶", e);
|
|
29422
|
-
let t =
|
|
29423
|
-
|
|
29408
|
+
let t = mk(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
|
|
29409
|
+
xk();
|
|
29424
29410
|
let i = hr(n || null, r || null);
|
|
29425
|
-
if (!i && r && (await new Promise((e) => setTimeout(e, 500)),
|
|
29411
|
+
if (!i && r && (await new Promise((e) => setTimeout(e, 500)), xk(), i = hr(null, r)), !i) {
|
|
29426
29412
|
$("flowengage_highlight ✖ no element for:", r || n);
|
|
29427
|
-
let e =
|
|
29413
|
+
let e = Sk(), t = e.length ? `Page headings: ${e.join(" | ")}. Use one of these exact strings for section_text.` : "No headings found — skip highlight and continue.";
|
|
29428
29414
|
return `HIGHLIGHT_NOT_FOUND: "${r || n}" on the current page. ${t}`;
|
|
29429
29415
|
}
|
|
29430
|
-
return
|
|
29416
|
+
return xD(i), $("flowengage_highlight ✓", r || n), `OK_HIGHLIGHT: "${r || n}". WALKTHROUGH: If you are mid-walkthrough and have more sections to cover, continue immediately to the next section — do NOT pause or wait for the visitor to speak between sections.`;
|
|
29431
29417
|
},
|
|
29432
29418
|
flowengage_read_content: async (e) => {
|
|
29433
29419
|
$("flowengage_read_content ▶", e);
|
|
29434
|
-
let t =
|
|
29420
|
+
let t = mk(e), n = t?.section_text || t?.sectionText || "";
|
|
29435
29421
|
try {
|
|
29436
29422
|
let e = "";
|
|
29437
29423
|
if (n) {
|
|
@@ -29454,11 +29440,11 @@ function Tk(e) {
|
|
|
29454
29440
|
},
|
|
29455
29441
|
flowengage_search: async (e) => {
|
|
29456
29442
|
$("flowengage_search ▶", e);
|
|
29457
|
-
let r =
|
|
29443
|
+
let r = yk(mk(e));
|
|
29458
29444
|
if ($("flowengage_search · query:", r, "siteId:", t, "apiBase:", n || "(empty)"), !r) return $("flowengage_search ✖ missing query"), "Missing query parameter.";
|
|
29459
29445
|
if (!t) return $("flowengage_search ✖ no siteId"), "Site is not configured for search.";
|
|
29460
29446
|
if (!n) return $("flowengage_search ✖ no api base"), "API base URL is missing; cannot search.";
|
|
29461
|
-
|
|
29447
|
+
CO(`Searching${r ? ` for "${r}"` : ""}…`, { spinner: !0 });
|
|
29462
29448
|
try {
|
|
29463
29449
|
let e = `${n}/api/site-tools/search`;
|
|
29464
29450
|
$("flowengage_search → POST", e);
|
|
@@ -29481,12 +29467,12 @@ function Tk(e) {
|
|
|
29481
29467
|
let t = `Search error: ${e.message || "network"}`;
|
|
29482
29468
|
return $("flowengage_search ✖", t), t;
|
|
29483
29469
|
} finally {
|
|
29484
|
-
|
|
29470
|
+
wO(600);
|
|
29485
29471
|
}
|
|
29486
29472
|
},
|
|
29487
29473
|
flowengage_page_content: async (e) => {
|
|
29488
29474
|
$("flowengage_page_content ▶", e);
|
|
29489
|
-
let r =
|
|
29475
|
+
let r = mk(e), i = r?.url || r?.page_url || "";
|
|
29490
29476
|
if ($("flowengage_page_content · url:", i, "siteId:", t, "apiBase:", n || "(empty)"), !i) return $("flowengage_page_content ✖ missing url"), "Missing url parameter.";
|
|
29491
29477
|
if (!t) return $("flowengage_page_content ✖ no siteId"), "Site is not configured.";
|
|
29492
29478
|
if (!n) return $("flowengage_page_content ✖ no api base"), "API base URL is missing; cannot fetch page content.";
|
|
@@ -29519,7 +29505,7 @@ function Tk(e) {
|
|
|
29519
29505
|
flowengage_end_session: async () => ($("flowengage_end_session ▶"), typeof e.requestEndSession == "function" && e.requestEndSession(), "Voice session is ending."),
|
|
29520
29506
|
flowengage_get_current_page: async () => {
|
|
29521
29507
|
if ($("flowengage_get_current_page ▶"), typeof window > "u") return "Cannot determine current page (no browser context).";
|
|
29522
|
-
let e = window.location.href, t = window.location.pathname, n = document.title || "", r =
|
|
29508
|
+
let e = window.location.href, t = window.location.pathname, n = document.title || "", r = Sk(), i = r.length ? r.join(" | ") : "none";
|
|
29523
29509
|
return $("flowengage_get_current_page ✓", {
|
|
29524
29510
|
url: e,
|
|
29525
29511
|
path: t,
|
|
@@ -29527,7 +29513,7 @@ function Tk(e) {
|
|
|
29527
29513
|
}), $("flowengage_get_current_page → page headings collected:", r), `CURRENT_PAGE. URL: ${e} | Path: ${t} | Title: ${n} | Section headings: ${i}. Use ONLY these exact heading strings for flowengage_highlight — never invent or abbreviate section names.`;
|
|
29528
29514
|
},
|
|
29529
29515
|
flowengage_list_forms: async () => {
|
|
29530
|
-
let e =
|
|
29516
|
+
let e = XO(), t = ZO();
|
|
29531
29517
|
return $("flowengage_list_forms ✓", `${e.length} field(s)`, `${t.length} button(s)`), JSON.stringify({
|
|
29532
29518
|
fields: e,
|
|
29533
29519
|
buttons: t,
|
|
@@ -29536,52 +29522,52 @@ function Tk(e) {
|
|
|
29536
29522
|
},
|
|
29537
29523
|
flowengage_fill_form: async (e) => {
|
|
29538
29524
|
try {
|
|
29539
|
-
$("flowengage_fill_form ▶ raw:", e),
|
|
29540
|
-
let t =
|
|
29525
|
+
$("flowengage_fill_form ▶ raw:", e), AO();
|
|
29526
|
+
let t = hk(e);
|
|
29541
29527
|
if (!t.length && r) {
|
|
29542
|
-
let e = r(), n =
|
|
29543
|
-
n.length ? $("flowengage_fill_form · inferred URL from last user utterance (model omitted usable fields):", n) : (n =
|
|
29528
|
+
let e = r(), n = gk(e);
|
|
29529
|
+
n.length ? $("flowengage_fill_form · inferred URL from last user utterance (model omitted usable fields):", n) : (n = _k(e), n.length && $("flowengage_fill_form · inferred contact fields from last user utterance (empty tool params):", n)), n.length && (t = n);
|
|
29544
29530
|
}
|
|
29545
29531
|
if ($("flowengage_fill_form · normalized fields:", t), !t.length) return "No fields provided. Call flowengage_list_forms for field_key strings, then flowengage_fill_form with { \"fields\": [ { \"field_key\": \"<label or placeholder from list>\", \"value\": \"<user value>\" } ] }. Never use empty {}. Pass the value the user just said (email, message, name, URL) in fields.";
|
|
29546
29532
|
let n = [];
|
|
29547
29533
|
for (let e of t) {
|
|
29548
29534
|
let t = e?.field_key ?? e?.fieldKey, r = e?.value;
|
|
29549
29535
|
if (t == null || r == null) continue;
|
|
29550
|
-
|
|
29551
|
-
let a =
|
|
29536
|
+
CO(`Filling ${String(t)}...`, { spinner: !0 });
|
|
29537
|
+
let a = YO(), o = ck(a, String(t), r);
|
|
29552
29538
|
if (o.length) {
|
|
29553
|
-
for (let [e, t] of o.entries())
|
|
29539
|
+
for (let [e, t] of o.entries()) jO(t), await LO(t), bk(t, r, { skipScroll: e > 0 }), MO(t), await HO(120);
|
|
29554
29540
|
i = o, n.push(String(t));
|
|
29555
29541
|
continue;
|
|
29556
29542
|
}
|
|
29557
|
-
let s =
|
|
29558
|
-
s ||=
|
|
29543
|
+
let s = dk(a, String(t));
|
|
29544
|
+
s ||= nk(a, String(t)), s ||= rk(a, String(t), r), s && (jO(s), await LO(s), bk(s, r), MO(s), await HO(120), i = [s], n.push(String(t)));
|
|
29559
29545
|
}
|
|
29560
29546
|
if (!n.length) return $("flowengage_fill_form ✖ no matches"), "Could not match any fields. Call flowengage_list_forms and use field_key values that match placeholder, label, name, or id (e.g. Enter Website URL). Ensure the form is on the page, not the chat panel.";
|
|
29561
29547
|
let a = `OK_FILLED: ${n.join(", ")}`;
|
|
29562
|
-
return $("flowengage_fill_form ✓", a),
|
|
29548
|
+
return $("flowengage_fill_form ✓", a), CO("Form filled", {
|
|
29563
29549
|
spinner: !1,
|
|
29564
29550
|
icon: "✅",
|
|
29565
29551
|
duration: 1100
|
|
29566
29552
|
}), a;
|
|
29567
29553
|
} catch (e) {
|
|
29568
29554
|
let t = `flowengage_fill_form error: ${e?.message || String(e)}`;
|
|
29569
|
-
return $("flowengage_fill_form ✖", t),
|
|
29555
|
+
return $("flowengage_fill_form ✖", t), CO("Failed to fill form", {
|
|
29570
29556
|
spinner: !1,
|
|
29571
29557
|
icon: "⚠️",
|
|
29572
29558
|
duration: 1800
|
|
29573
29559
|
}), t;
|
|
29574
29560
|
} finally {
|
|
29575
|
-
|
|
29561
|
+
RO(), AO(), wO(700);
|
|
29576
29562
|
}
|
|
29577
29563
|
},
|
|
29578
29564
|
flowengage_click_button: async (e) => {
|
|
29579
|
-
let t =
|
|
29565
|
+
let t = mk(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim();
|
|
29580
29566
|
if ($("flowengage_click_button ▶", n), !n) return "Missing button_text: pass the visible label, e.g. Conduct Audit.";
|
|
29581
|
-
let r =
|
|
29567
|
+
let r = pk(n, i);
|
|
29582
29568
|
if (!r) return $("flowengage_click_button ✖ no match"), `Could not find a button matching "${n}". Call flowengage_list_forms to see button texts.`;
|
|
29583
29569
|
try {
|
|
29584
|
-
|
|
29570
|
+
CO(`Clicking ${n}...`, { spinner: !0 });
|
|
29585
29571
|
try {
|
|
29586
29572
|
r.scrollIntoView({
|
|
29587
29573
|
block: "center",
|
|
@@ -29590,22 +29576,22 @@ function Tk(e) {
|
|
|
29590
29576
|
} catch {
|
|
29591
29577
|
r.scrollIntoView(!0);
|
|
29592
29578
|
}
|
|
29593
|
-
await
|
|
29579
|
+
await LO(r), r.focus?.(), await zO(r), BO(r), r.click();
|
|
29594
29580
|
let e = (r.textContent || r.value || r.getAttribute("aria-label") || "").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
|
|
29595
|
-
return $("flowengage_click_button ✓", t),
|
|
29581
|
+
return $("flowengage_click_button ✓", t), CO(`Clicked ${e}`, {
|
|
29596
29582
|
spinner: !1,
|
|
29597
29583
|
icon: "✅",
|
|
29598
29584
|
duration: 1200
|
|
29599
29585
|
}), t;
|
|
29600
29586
|
} catch (e) {
|
|
29601
29587
|
let t = `Click failed: ${e?.message || String(e)}`;
|
|
29602
|
-
return $("flowengage_click_button ✖", t),
|
|
29588
|
+
return $("flowengage_click_button ✖", t), CO("Click failed", {
|
|
29603
29589
|
spinner: !1,
|
|
29604
29590
|
icon: "⚠️",
|
|
29605
29591
|
duration: 1800
|
|
29606
29592
|
}), t;
|
|
29607
29593
|
} finally {
|
|
29608
|
-
|
|
29594
|
+
RO(), wO(700);
|
|
29609
29595
|
}
|
|
29610
29596
|
}
|
|
29611
29597
|
};
|
|
@@ -29622,7 +29608,7 @@ function Tk(e) {
|
|
|
29622
29608
|
}
|
|
29623
29609
|
//#endregion
|
|
29624
29610
|
//#region src/utils/wrapVoiceToolsForLogging.js
|
|
29625
|
-
function
|
|
29611
|
+
function wk(e) {
|
|
29626
29612
|
return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
|
|
29627
29613
|
let r = Rn();
|
|
29628
29614
|
r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
|
|
@@ -29639,7 +29625,7 @@ function Ek(e) {
|
|
|
29639
29625
|
}
|
|
29640
29626
|
//#endregion
|
|
29641
29627
|
//#region src/components/FlowEngageWidget.jsx
|
|
29642
|
-
var
|
|
29628
|
+
var Tk = {
|
|
29643
29629
|
blue: "#135bd8",
|
|
29644
29630
|
red: "#ef334b",
|
|
29645
29631
|
yellow: "#ffbd2e",
|
|
@@ -29647,7 +29633,7 @@ var Dk = {
|
|
|
29647
29633
|
highlight: "rgba(255,255,255,0.9)",
|
|
29648
29634
|
green: "#10b981"
|
|
29649
29635
|
};
|
|
29650
|
-
function
|
|
29636
|
+
function Ek(e) {
|
|
29651
29637
|
if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
|
|
29652
29638
|
let [t, n, r] = e;
|
|
29653
29639
|
return e.length >= 3 && r ? [
|
|
@@ -29661,12 +29647,12 @@ function Ok(e) {
|
|
|
29661
29647
|
"#f7f8fa"
|
|
29662
29648
|
].join(", ");
|
|
29663
29649
|
}
|
|
29664
|
-
function
|
|
29650
|
+
function Dk(e) {
|
|
29665
29651
|
if (!e || typeof e != "string") return "#1a1a1a";
|
|
29666
29652
|
let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = parseInt(n.slice(0, 2), 16) / 255, i = parseInt(n.slice(2, 4), 16) / 255, a = parseInt(n.slice(4, 6), 16) / 255, o = (e) => e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
29667
29653
|
return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
|
|
29668
29654
|
}
|
|
29669
|
-
function
|
|
29655
|
+
function Ok({ logo: t, style: n }) {
|
|
29670
29656
|
if (!t) return null;
|
|
29671
29657
|
if (typeof t == "string") return /* @__PURE__ */ g("img", {
|
|
29672
29658
|
src: t,
|
|
@@ -29691,7 +29677,7 @@ function Ak({ logo: t, style: n }) {
|
|
|
29691
29677
|
children: r
|
|
29692
29678
|
}) : null;
|
|
29693
29679
|
}
|
|
29694
|
-
function
|
|
29680
|
+
function kk({ title: e }) {
|
|
29695
29681
|
return /* @__PURE__ */ g("div", {
|
|
29696
29682
|
style: {
|
|
29697
29683
|
width: "100%",
|
|
@@ -29709,18 +29695,18 @@ function jk({ title: e }) {
|
|
|
29709
29695
|
children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
|
|
29710
29696
|
});
|
|
29711
29697
|
}
|
|
29712
|
-
function
|
|
29698
|
+
function Ak(e, t) {
|
|
29713
29699
|
let n = (t || "").trim();
|
|
29714
29700
|
return n ? !!(/\b(let'?s|let us)\s+(end|stop|finish|wrap up|close)\s+(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\bend\s+(this\s+)?(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\b(hang\s+up|disconnect)\b/i.test(n) || /\b(that'?s all|we'?re done)\b/i.test(n) || e === "bot" && (/\b(I'?ll|I will|Let me|I can|I'?m going to)\s+(end|close)\s+(the\s+)?(voice\s+)?(session|call)\b/i.test(n) || /\b(ending|closing)\s+(the\s+)?(voice\s+)?session\b|\bvoice\s+session\s+(is\s+)?(now\s+)?(ended|over|closing)\b/i.test(n) || /\b(session|call)\s+(is\s+)?(now\s+)?(ended|over)\b/i.test(n) || /\bwe\s+can\s+end\s+(the\s+)?(session|call)?\s*(here|now)\b/i.test(n) || /\b(wrapping\s+up|signing\s+off)\b/i.test(n)) || /^(goodbye|bye|that'?s all|we'?re done|hang up|disconnect)\b/i.test(n)) : !1;
|
|
29715
29701
|
}
|
|
29716
|
-
function
|
|
29717
|
-
return /* @__PURE__ */ g(
|
|
29702
|
+
function jk({ orbColors: e, ...t }) {
|
|
29703
|
+
return /* @__PURE__ */ g(lO, {
|
|
29718
29704
|
colors: e,
|
|
29719
29705
|
...t
|
|
29720
29706
|
});
|
|
29721
29707
|
}
|
|
29722
|
-
function
|
|
29723
|
-
let s = n ||
|
|
29708
|
+
function Mk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
|
|
29709
|
+
let s = n || Tk.green, c = Dk(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
|
|
29724
29710
|
style: {
|
|
29725
29711
|
display: "flex",
|
|
29726
29712
|
alignItems: a ? "flex-end" : "center",
|
|
@@ -29841,7 +29827,7 @@ function Pk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
|
|
|
29841
29827
|
delay: 0
|
|
29842
29828
|
},
|
|
29843
29829
|
style: { flexShrink: 0 },
|
|
29844
|
-
children: /* @__PURE__ */ g(
|
|
29830
|
+
children: /* @__PURE__ */ g(jk, {
|
|
29845
29831
|
size: l,
|
|
29846
29832
|
orbColors: t
|
|
29847
29833
|
})
|
|
@@ -29873,8 +29859,8 @@ function Pk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
|
|
|
29873
29859
|
children: u
|
|
29874
29860
|
})] });
|
|
29875
29861
|
}
|
|
29876
|
-
function
|
|
29877
|
-
let c = n ||
|
|
29862
|
+
function Nk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
|
|
29863
|
+
let c = n || Tk.green, l = Dk(c);
|
|
29878
29864
|
return /* @__PURE__ */ _(Dm.div, {
|
|
29879
29865
|
initial: {
|
|
29880
29866
|
scale: 50 / 350,
|
|
@@ -29945,7 +29931,7 @@ function Fk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
|
|
|
29945
29931
|
children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
|
|
29946
29932
|
})
|
|
29947
29933
|
}),
|
|
29948
|
-
/* @__PURE__ */ g(
|
|
29934
|
+
/* @__PURE__ */ g(jk, {
|
|
29949
29935
|
size: 72,
|
|
29950
29936
|
orbColors: t
|
|
29951
29937
|
}),
|
|
@@ -30014,7 +30000,7 @@ function Fk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
|
|
|
30014
30000
|
]
|
|
30015
30001
|
});
|
|
30016
30002
|
}
|
|
30017
|
-
function
|
|
30003
|
+
function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i, siteId: a, apiBaseUrl: s, chatId: l, historyRef: u, onMessageSync: d, voiceEndCounter: f }) {
|
|
30018
30004
|
let [h, v] = m("idle"), [y, b] = m(!1), [x, S] = m(!1), C = p(null), w = p(""), T = p(async () => {}), ee = p(!1), te = p(!1), ne = p(!1), re = p(!1), E = p("minimized"), ie = p(null), ae = p(null), oe = p(null), D = p(0), se = p(!1), ce = p("idle"), le = p(!1), ue = p(null), de = p(null), fe = p(!1), pe = o((e = "minimized") => {
|
|
30019
30005
|
E.current = e, re.current = !0, queueMicrotask(() => {
|
|
30020
30006
|
ee.current || (ee.current = !0, T.current?.());
|
|
@@ -30022,7 +30008,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30022
30008
|
}, [u]), me = o(async (e) => {
|
|
30023
30009
|
re.current = !0;
|
|
30024
30010
|
try {
|
|
30025
|
-
|
|
30011
|
+
SD();
|
|
30026
30012
|
} catch {}
|
|
30027
30013
|
if (a) try {
|
|
30028
30014
|
Ve(a);
|
|
@@ -30070,7 +30056,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30070
30056
|
if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
|
|
30071
30057
|
u.current = [], w.current = "", ee.current = !1, ne.current = !1, re.current = !1, E.current = "minimized", kr({ onBeforeNavigate: () => {
|
|
30072
30058
|
if (a && u.current.length > 0) try {
|
|
30073
|
-
let e =
|
|
30059
|
+
let e = vO(u.current);
|
|
30074
30060
|
e && Ae(a, e);
|
|
30075
30061
|
} catch {}
|
|
30076
30062
|
if (!er()) {
|
|
@@ -30092,7 +30078,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30092
30078
|
}
|
|
30093
30079
|
Ne();
|
|
30094
30080
|
} });
|
|
30095
|
-
let t =
|
|
30081
|
+
let t = wk(Ck({
|
|
30096
30082
|
siteId: a || null,
|
|
30097
30083
|
apiBaseUrl: s || null,
|
|
30098
30084
|
getLastUserVoiceText: () => w.current,
|
|
@@ -30162,10 +30148,10 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30162
30148
|
message: r,
|
|
30163
30149
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
30164
30150
|
}], a) try {
|
|
30165
|
-
let e =
|
|
30151
|
+
let e = vO(u.current);
|
|
30166
30152
|
e && Ae(a, e);
|
|
30167
30153
|
} catch {}
|
|
30168
|
-
if (
|
|
30154
|
+
if (Ak(n, r)) {
|
|
30169
30155
|
pe("minimized");
|
|
30170
30156
|
return;
|
|
30171
30157
|
}
|
|
@@ -30248,7 +30234,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30248
30234
|
})(), () => {
|
|
30249
30235
|
e = !0, re.current = !0;
|
|
30250
30236
|
try {
|
|
30251
|
-
|
|
30237
|
+
SD();
|
|
30252
30238
|
} catch {}
|
|
30253
30239
|
if (a) try {
|
|
30254
30240
|
Ve(a);
|
|
@@ -30329,7 +30315,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30329
30315
|
},
|
|
30330
30316
|
children: "Muted"
|
|
30331
30317
|
}),
|
|
30332
|
-
/* @__PURE__ */ g(
|
|
30318
|
+
/* @__PURE__ */ g(jk, {
|
|
30333
30319
|
size: 72,
|
|
30334
30320
|
voiceState: h,
|
|
30335
30321
|
isMuted: y,
|
|
@@ -30415,7 +30401,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30415
30401
|
y2: "23"
|
|
30416
30402
|
})
|
|
30417
30403
|
]
|
|
30418
|
-
}) : /* @__PURE__ */ g(
|
|
30404
|
+
}) : /* @__PURE__ */ g(CD, {
|
|
30419
30405
|
size: 16,
|
|
30420
30406
|
color: "currentColor"
|
|
30421
30407
|
})
|
|
@@ -30437,7 +30423,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30437
30423
|
padding: 0,
|
|
30438
30424
|
flexShrink: 0
|
|
30439
30425
|
},
|
|
30440
|
-
children: /* @__PURE__ */ g(
|
|
30426
|
+
children: /* @__PURE__ */ g(jD, {
|
|
30441
30427
|
size: 16,
|
|
30442
30428
|
color: "currentColor"
|
|
30443
30429
|
})
|
|
@@ -30486,7 +30472,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30486
30472
|
onMouseLeave: (e) => {
|
|
30487
30473
|
e.currentTarget.style.background = "none";
|
|
30488
30474
|
},
|
|
30489
|
-
children: [/* @__PURE__ */ g(
|
|
30475
|
+
children: [/* @__PURE__ */ g(MD, {}), "Enter Chat Mode"]
|
|
30490
30476
|
}),
|
|
30491
30477
|
/* @__PURE__ */ _("button", {
|
|
30492
30478
|
onClick: () => {
|
|
@@ -30515,7 +30501,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30515
30501
|
onMouseLeave: (e) => {
|
|
30516
30502
|
e.currentTarget.style.background = "none";
|
|
30517
30503
|
},
|
|
30518
|
-
children: [/* @__PURE__ */ g(
|
|
30504
|
+
children: [/* @__PURE__ */ g(ND, {}), "End Conversation"]
|
|
30519
30505
|
}),
|
|
30520
30506
|
/* @__PURE__ */ g("button", {
|
|
30521
30507
|
onClick: () => S(!1),
|
|
@@ -30567,7 +30553,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30567
30553
|
]
|
|
30568
30554
|
});
|
|
30569
30555
|
}
|
|
30570
|
-
function
|
|
30556
|
+
function Fk({ orbColors: e }) {
|
|
30571
30557
|
return /* @__PURE__ */ g("div", {
|
|
30572
30558
|
style: {
|
|
30573
30559
|
flexShrink: 0,
|
|
@@ -30577,13 +30563,13 @@ function Lk({ orbColors: e }) {
|
|
|
30577
30563
|
alignItems: "center",
|
|
30578
30564
|
justifyContent: "center"
|
|
30579
30565
|
},
|
|
30580
|
-
children: /* @__PURE__ */ g(
|
|
30566
|
+
children: /* @__PURE__ */ g(jk, {
|
|
30581
30567
|
size: 36,
|
|
30582
30568
|
orbColors: e
|
|
30583
30569
|
})
|
|
30584
30570
|
});
|
|
30585
30571
|
}
|
|
30586
|
-
var
|
|
30572
|
+
var Ik = () => /* @__PURE__ */ g("div", {
|
|
30587
30573
|
style: {
|
|
30588
30574
|
display: "flex",
|
|
30589
30575
|
marginBottom: "12px",
|
|
@@ -30613,7 +30599,7 @@ var Rk = () => /* @__PURE__ */ g("div", {
|
|
|
30613
30599
|
} }, e))
|
|
30614
30600
|
})
|
|
30615
30601
|
});
|
|
30616
|
-
function
|
|
30602
|
+
function Lk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: ee, rateLimitMessage: te, selectedFile: ne, onFileSelect: re, onRemoveSelectedFile: E, attachmentError: ie, isUploadingAttachment: ae, requiresEmail: oe, emailInput: D, setEmailInput: se, emailError: ce, emailCaptureSuccess: le, replyContext: ue, setReplyContext: de, webRTCError: fe, micError: pe, setMicError: me, dismissCallError: he, activeCallId: ge, isCallMuted: _e, toggleCallMute: ve, endWebRTCCall: ye, formatCallDuration: be, callDurationSeconds: xe, isCallMinimized: Se, onExpand: Ce, onCollapse: we, onStartVoice: Te, onNewChat: Ee, onEndConversation: De, showPoweredBy: Oe, getVisitorChatHistory: ke, getVisitorChatThread: Ae, resumeChat: je, isSessionRestoring: Me, isClosing: O }) {
|
|
30617
30603
|
let Ne = l.length > 0, Pe = T || ee || w, Fe = !!ge, [Ie, Le] = m(!1), [Re, ze] = m(!1), [Be, Ve] = m([]), [He, Ue] = m(!1), [We, Ge] = m(null), [Ke, qe] = m([]), Je = p(null), Ye = async () => {
|
|
30618
30604
|
Le(!1), ze(!0), Ue(!0), Ge(null);
|
|
30619
30605
|
try {
|
|
@@ -30738,7 +30724,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
30738
30724
|
justifyContent: "center",
|
|
30739
30725
|
height: "40px"
|
|
30740
30726
|
},
|
|
30741
|
-
children: i ? /* @__PURE__ */ g(
|
|
30727
|
+
children: i ? /* @__PURE__ */ g(Ok, {
|
|
30742
30728
|
logo: i,
|
|
30743
30729
|
style: {
|
|
30744
30730
|
height: "34px",
|
|
@@ -30751,7 +30737,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
30751
30737
|
height: "40px",
|
|
30752
30738
|
flexShrink: 0
|
|
30753
30739
|
},
|
|
30754
|
-
children: /* @__PURE__ */ g(
|
|
30740
|
+
children: /* @__PURE__ */ g(kk, { title: e.chatTitle })
|
|
30755
30741
|
})
|
|
30756
30742
|
}), /* @__PURE__ */ g("div", {
|
|
30757
30743
|
style: {
|
|
@@ -31033,7 +31019,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31033
31019
|
})
|
|
31034
31020
|
]
|
|
31035
31021
|
}),
|
|
31036
|
-
/* @__PURE__ */ g(
|
|
31022
|
+
/* @__PURE__ */ g(eO, {
|
|
31037
31023
|
webRTCError: fe,
|
|
31038
31024
|
micError: pe,
|
|
31039
31025
|
setMicError: me,
|
|
@@ -31041,7 +31027,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31041
31027
|
isRateLimited: ee,
|
|
31042
31028
|
rateLimitMessage: te
|
|
31043
31029
|
}),
|
|
31044
|
-
Se && /* @__PURE__ */ g(
|
|
31030
|
+
Se && /* @__PURE__ */ g(_O, {
|
|
31045
31031
|
agentName: v,
|
|
31046
31032
|
agentHeadshot: y,
|
|
31047
31033
|
fallbackAgentName: b,
|
|
@@ -31233,17 +31219,17 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31233
31219
|
children: "No previous chats found."
|
|
31234
31220
|
})
|
|
31235
31221
|
})]
|
|
31236
|
-
}) : null, Ne ? /* @__PURE__ */ g(
|
|
31222
|
+
}) : null, Ne ? /* @__PURE__ */ g(QD, {
|
|
31237
31223
|
chatHistory: l,
|
|
31238
31224
|
isAiTyping: u,
|
|
31239
31225
|
isLoading: T,
|
|
31240
31226
|
isAgentTyping: d,
|
|
31241
31227
|
setReplyContext: de,
|
|
31242
|
-
TypingDots:
|
|
31228
|
+
TypingDots: Ik,
|
|
31243
31229
|
primaryColor: n,
|
|
31244
31230
|
agentHeadshot: y,
|
|
31245
31231
|
agentDisplayName: v || b,
|
|
31246
|
-
botAvatarNode: /* @__PURE__ */ g(
|
|
31232
|
+
botAvatarNode: /* @__PURE__ */ g(Fk, { orbColors: t })
|
|
31247
31233
|
}) : Me ? /* @__PURE__ */ _("div", {
|
|
31248
31234
|
style: {
|
|
31249
31235
|
flex: 1,
|
|
@@ -31284,7 +31270,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31284
31270
|
padding: "28px 24px"
|
|
31285
31271
|
},
|
|
31286
31272
|
children: [
|
|
31287
|
-
/* @__PURE__ */ g(
|
|
31273
|
+
/* @__PURE__ */ g(jk, {
|
|
31288
31274
|
size: 94,
|
|
31289
31275
|
orbColors: t
|
|
31290
31276
|
}),
|
|
@@ -31375,7 +31361,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31375
31361
|
zIndex: 1,
|
|
31376
31362
|
padding: oe ? "6px 0 0" : "12px 0 0"
|
|
31377
31363
|
},
|
|
31378
|
-
children: /* @__PURE__ */ g(
|
|
31364
|
+
children: /* @__PURE__ */ g($D, {
|
|
31379
31365
|
input: x,
|
|
31380
31366
|
setInput: S,
|
|
31381
31367
|
onSubmit: C,
|
|
@@ -31425,7 +31411,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31425
31411
|
]
|
|
31426
31412
|
});
|
|
31427
31413
|
}
|
|
31428
|
-
function
|
|
31414
|
+
function Rk() {
|
|
31429
31415
|
let { status: e, runtimeConfig: t, resolvedConfig: n, chatHistory: r, isOpen: i, activeScreen: a, isHumanHandled: s, agentName: l, agentHeadshot: u, visitorEmail: h, isAgentTyping: v, isAiTyping: y, isLoading: b, isRateLimited: x, rateLimitMessage: S, isConversationEnded: C, incomingCall: w, activeCallId: T, callConnectionState: ee, callConnectedAt: te, isCallMuted: ne, webRTCError: re, language: E, chatId: ie, historyRef: ae, onMessageSync: oe, sendMessage: D, uploadChatFile: se, openWidget: ce, captureVisitorEmail: le, setVoiceMode: ue, endConversation: de, startNewChat: me, acceptCall: he, rejectCall: ge, endWebRTCCall: _e, toggleCallMute: ve, dismissCallError: ye, startTyping: be, stopTyping: xe, updateTypingDraft: Se, getVisitorChatHistory: Ce, getVisitorChatThread: we, resumeChat: Te, isSessionRestoring: Ee, openToChatCounter: De, voiceEndCounter: Oe } = Ln();
|
|
31430
31416
|
c(() => {
|
|
31431
31417
|
try {
|
|
@@ -31443,7 +31429,7 @@ function Bk() {
|
|
|
31443
31429
|
}, Fe = {
|
|
31444
31430
|
...ke.features || {},
|
|
31445
31431
|
...Ae.features || {}
|
|
31446
|
-
}, Ie = Fe.voice !== !1, Re = Array.isArray(Ne.orbColors) && Ne.orbColors.length > 0 ? Ne.orbColors : null, ze = Ne.buttonColor || Ne.primaryColor || Re?.[0] || "#3B82F6", Be = Ne.position || "bottom-right", Ve = O.fallbackAgentName || "Agent", He =
|
|
31432
|
+
}, Ie = Fe.voice !== !1, Re = Array.isArray(Ne.orbColors) && Ne.orbColors.length > 0 ? Ne.orbColors : null, ze = Ne.buttonColor || Ne.primaryColor || Re?.[0] || "#3B82F6", Be = Ne.position || "bottom-right", Ve = O.fallbackAgentName || "Agent", He = Ek(Re ?? Ne.chatBgColors), Ue = O.logo || O.logoUrl || null, We = E || "en", Ge = ke.recommendations?.[We] || [], Ke = (Ae.recommendations?.[We] ?? Ge).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
|
|
31447
31433
|
id: e.key || `qr-${t}`,
|
|
31448
31434
|
label: e.label,
|
|
31449
31435
|
message: e.label,
|
|
@@ -31508,7 +31494,7 @@ function Bk() {
|
|
|
31508
31494
|
let Ft = o(() => {
|
|
31509
31495
|
St(null), wt("");
|
|
31510
31496
|
}, []), It = o((e) => {
|
|
31511
|
-
let t =
|
|
31497
|
+
let t = qD(e);
|
|
31512
31498
|
if (t) {
|
|
31513
31499
|
St(null), wt(t);
|
|
31514
31500
|
return;
|
|
@@ -31614,7 +31600,7 @@ function Bk() {
|
|
|
31614
31600
|
if (xt) {
|
|
31615
31601
|
try {
|
|
31616
31602
|
Et(!0), wt("");
|
|
31617
|
-
let e = await se(xt), n = e?.data || e, r = ct.trim() || `Shared file: ${
|
|
31603
|
+
let e = await se(xt), n = e?.data || e, r = ct.trim() || `Shared file: ${YD(xt)}`;
|
|
31618
31604
|
lt(""), dt(null), Ft(), await D(r, "", t, {
|
|
31619
31605
|
type: "file",
|
|
31620
31606
|
metadata: {
|
|
@@ -31707,7 +31693,7 @@ function Bk() {
|
|
|
31707
31693
|
onWheel: (e) => e.stopPropagation(),
|
|
31708
31694
|
onTouchMove: (e) => e.stopPropagation(),
|
|
31709
31695
|
children: [
|
|
31710
|
-
A === "entry_prompt" && /* @__PURE__ */ g(
|
|
31696
|
+
A === "entry_prompt" && /* @__PURE__ */ g(Mk, {
|
|
31711
31697
|
copy: Ze,
|
|
31712
31698
|
orbColors: Re,
|
|
31713
31699
|
primaryColor: ze,
|
|
@@ -31790,13 +31776,13 @@ function Bk() {
|
|
|
31790
31776
|
children: ee === "connected" ? `${Ht(_t)} with ${nt}` : `Tap to return to ${nt}`
|
|
31791
31777
|
})]
|
|
31792
31778
|
})]
|
|
31793
|
-
}), /* @__PURE__ */ g(
|
|
31779
|
+
}), /* @__PURE__ */ g(jk, {
|
|
31794
31780
|
size: 50,
|
|
31795
31781
|
orbColors: Re,
|
|
31796
31782
|
onClick: T && Dt ? Lt : Ie ? Kt : Jt
|
|
31797
31783
|
})]
|
|
31798
31784
|
}),
|
|
31799
|
-
A === "connection_modal" && /* @__PURE__ */ g(
|
|
31785
|
+
A === "connection_modal" && /* @__PURE__ */ g(Nk, {
|
|
31800
31786
|
copy: Ze,
|
|
31801
31787
|
orbColors: Re,
|
|
31802
31788
|
primaryColor: ze,
|
|
@@ -31806,7 +31792,7 @@ function Bk() {
|
|
|
31806
31792
|
isMobile: Nt,
|
|
31807
31793
|
isClosing: kt
|
|
31808
31794
|
}),
|
|
31809
|
-
A === "voice_mode" && /* @__PURE__ */ g(
|
|
31795
|
+
A === "voice_mode" && /* @__PURE__ */ g(Pk, {
|
|
31810
31796
|
orbColors: Re,
|
|
31811
31797
|
onEnterChat: Jt,
|
|
31812
31798
|
onEndChat: Yt,
|
|
@@ -31819,7 +31805,7 @@ function Bk() {
|
|
|
31819
31805
|
onMessageSync: oe,
|
|
31820
31806
|
voiceEndCounter: Oe
|
|
31821
31807
|
}, "voice"),
|
|
31822
|
-
A === "call_screen" && /* @__PURE__ */ g(
|
|
31808
|
+
A === "call_screen" && /* @__PURE__ */ g(gO, {
|
|
31823
31809
|
incomingCall: w,
|
|
31824
31810
|
activeCallId: T,
|
|
31825
31811
|
callConnectionState: ee,
|
|
@@ -31838,7 +31824,7 @@ function Bk() {
|
|
|
31838
31824
|
orbColors: Re,
|
|
31839
31825
|
chatHistory: r
|
|
31840
31826
|
}),
|
|
31841
|
-
A === "text_chat" && /* @__PURE__ */ g(
|
|
31827
|
+
A === "text_chat" && /* @__PURE__ */ g(Lk, {
|
|
31842
31828
|
isClosing: kt,
|
|
31843
31829
|
copy: Ze,
|
|
31844
31830
|
orbColors: Re,
|
|
@@ -31903,7 +31889,7 @@ function Bk() {
|
|
|
31903
31889
|
}
|
|
31904
31890
|
//#endregion
|
|
31905
31891
|
//#region src/components/ErrorBoundary.jsx
|
|
31906
|
-
var
|
|
31892
|
+
var zk = class extends e.Component {
|
|
31907
31893
|
constructor(e) {
|
|
31908
31894
|
super(e), this.state = { hasError: !1 };
|
|
31909
31895
|
}
|
|
@@ -31918,4 +31904,4 @@ var Vk = class extends e.Component {
|
|
|
31918
31904
|
}
|
|
31919
31905
|
};
|
|
31920
31906
|
//#endregion
|
|
31921
|
-
export {
|
|
31907
|
+
export { lO as AnimatedOrb, zk as ErrorBoundary, Rr as FlowEngageProvider, Rk as FlowEngageWidget, Ln as useFlowEngage };
|