deep-chat-dev 9.0.238 → 9.0.240
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/custom-elements.json +8467 -8401
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.js +324 -284
- package/dist/views/chat/input/buttons/custom/customButton.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/custom/customButtonDropupStyle.d.ts.map +1 -1
- package/dist/views/chat/input/dropup/dropupItem.d.ts.map +1 -1
- package/dist/views/chat/messages/history/history.d.ts.map +1 -1
- package/dist/views/chat/messages/messages.d.ts.map +1 -1
- package/dist/views/chat/messages/messagesBase.d.ts +2 -2
- package/dist/views/chat/messages/messagesBase.d.ts.map +1 -1
- package/dist/views/chat/messages/utils/messageUtils.d.ts +8 -4
- package/dist/views/chat/messages/utils/messageUtils.d.ts.map +1 -1
- package/dist/views/chat/messages/utils/updateMessage.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -71,11 +71,11 @@ var Ei = /*#__PURE__*/function () {
|
|
71
71
|
}
|
72
72
|
}]);
|
73
73
|
}();
|
74
|
-
var
|
75
|
-
function
|
76
|
-
_classCallCheck(this,
|
74
|
+
var O = /*#__PURE__*/function () {
|
75
|
+
function O() {
|
76
|
+
_classCallCheck(this, O);
|
77
77
|
}
|
78
|
-
return _createClass(
|
78
|
+
return _createClass(O, null, [{
|
79
79
|
key: "unsetStyle",
|
80
80
|
value: function unsetStyle(e, t) {
|
81
81
|
var i = Object.keys(t).reduce(function (s, r) {
|
@@ -86,12 +86,12 @@ var P = /*#__PURE__*/function () {
|
|
86
86
|
}, {
|
87
87
|
key: "unsetActivityCSSMouseStates",
|
88
88
|
value: function unsetActivityCSSMouseStates(e, t) {
|
89
|
-
t.click &&
|
89
|
+
t.click && O.unsetStyle(e, t.click), t.hover && O.unsetStyle(e, t.hover);
|
90
90
|
}
|
91
91
|
}, {
|
92
92
|
key: "unsetAllCSSMouseStates",
|
93
93
|
value: function unsetAllCSSMouseStates(e, t) {
|
94
|
-
|
94
|
+
O.unsetActivityCSSMouseStates(e, t), t["default"] && O.unsetStyle(e, t["default"]);
|
95
95
|
}
|
96
96
|
}, {
|
97
97
|
key: "processStateful",
|
@@ -184,7 +184,7 @@ var ht = /*#__PURE__*/function () {
|
|
184
184
|
}, {
|
185
185
|
key: "applyDefaultStyleToComponent",
|
186
186
|
value: function applyDefaultStyleToComponent(e, t) {
|
187
|
-
t &&
|
187
|
+
t && O.applyToStyleIfNotDefined(e, t), O.applyToStyleIfNotDefined(e, ht.DEFAULT_COMPONENT_STYLE);
|
188
188
|
}
|
189
189
|
}]);
|
190
190
|
}();
|
@@ -298,7 +298,7 @@ var Qe = /*#__PURE__*/function () {
|
|
298
298
|
key: "removePlaceholderStyle",
|
299
299
|
value: function removePlaceholderStyle() {
|
300
300
|
var e, t, i, s;
|
301
|
-
!this.inputElementRef.classList.contains("text-input-disabled") && (e = this._config.placeholder) != null && e.style && (
|
301
|
+
!this.inputElementRef.classList.contains("text-input-disabled") && (e = this._config.placeholder) != null && e.style && (O.unsetStyle(this.inputElementRef, (t = this._config.placeholder) == null ? void 0 : t.style), Object.assign(this.inputElementRef.style, (s = (i = this._config) == null ? void 0 : i.styles) == null ? void 0 : s.text));
|
302
302
|
}
|
303
303
|
}, {
|
304
304
|
key: "addEventListeners",
|
@@ -313,7 +313,7 @@ var Qe = /*#__PURE__*/function () {
|
|
313
313
|
}, {
|
314
314
|
key: "onBlur",
|
315
315
|
value: function onBlur(e, t) {
|
316
|
-
|
316
|
+
O.unsetStyle(this.elementRef, e), t && Object.assign(this.elementRef.style, t);
|
317
317
|
}
|
318
318
|
}, {
|
319
319
|
key: "onKeydown",
|
@@ -543,7 +543,7 @@ var ut = /*#__PURE__*/function () {
|
|
543
543
|
}]);
|
544
544
|
}();
|
545
545
|
ut.BUBBLE_CLASS = "deep-chat-loading-message-bubble", ut.DOTS_CONTAINER_CLASS = "deep-chat-loading-message-dots-container";
|
546
|
-
var
|
546
|
+
var Pe = ut;
|
547
547
|
var he = /*#__PURE__*/function () {
|
548
548
|
function he() {
|
549
549
|
_classCallCheck(this, he);
|
@@ -743,7 +743,7 @@ var Ge = /*#__PURE__*/function () {
|
|
743
743
|
return _createClass(Ge, null, [{
|
744
744
|
key: "mouseUp",
|
745
745
|
value: function mouseUp(e, t) {
|
746
|
-
|
746
|
+
O.unsetAllCSSMouseStates(e, t), Object.assign(e.style, t["default"]), Object.assign(e.style, t.hover);
|
747
747
|
}
|
748
748
|
}, {
|
749
749
|
key: "mouseDown",
|
@@ -753,7 +753,7 @@ var Ge = /*#__PURE__*/function () {
|
|
753
753
|
}, {
|
754
754
|
key: "mouseLeave",
|
755
755
|
value: function mouseLeave(e, t) {
|
756
|
-
|
756
|
+
O.unsetAllCSSMouseStates(e, t), Object.assign(e.style, t["default"]);
|
757
757
|
}
|
758
758
|
}, {
|
759
759
|
key: "mouseEnter",
|
@@ -839,10 +839,10 @@ var Ne = /*#__PURE__*/function () {
|
|
839
839
|
r = ts[i].styles;
|
840
840
|
if (r) {
|
841
841
|
var a = JSON.parse(JSON.stringify(r));
|
842
|
-
a["default"] &&
|
842
|
+
a["default"] && O.overwriteDefaultWithAlreadyApplied(a, t), s.unshift(a);
|
843
843
|
}
|
844
|
-
var o =
|
845
|
-
return
|
844
|
+
var o = O.mergeStatefulStyles(s);
|
845
|
+
return O.processStateful(o, {}, {});
|
846
846
|
}
|
847
847
|
}, {
|
848
848
|
key: "applyDeepChatUtilities",
|
@@ -868,7 +868,7 @@ var ie = /*#__PURE__*/function () {
|
|
868
868
|
return _createClass(ie, null, [{
|
869
869
|
key: "applyStylesToElement",
|
870
870
|
value: function applyStylesToElement(e, t) {
|
871
|
-
var i =
|
871
|
+
var i = O.processStateful(t, {}, {});
|
872
872
|
Ge.add(e, i), Object.assign(e.style, i["default"]);
|
873
873
|
}
|
874
874
|
}, {
|
@@ -952,7 +952,7 @@ var Me = /*#__PURE__*/function () {
|
|
952
952
|
key: "overwrite",
|
953
953
|
value: function overwrite(e, t, i, s) {
|
954
954
|
var r = e.messageToElements,
|
955
|
-
o =
|
955
|
+
o = v.overwriteMessage(r, s, t, i, "html", Me.HTML_BUBBLE_CLASS);
|
956
956
|
return o && Me.overwriteElements(e, t, o), o;
|
957
957
|
}
|
958
958
|
}, {
|
@@ -961,7 +961,7 @@ var Me = /*#__PURE__*/function () {
|
|
961
961
|
var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
962
962
|
var o;
|
963
963
|
var r = Me.createElements(e, t, i, s);
|
964
|
-
return
|
964
|
+
return v.fillEmptyMessageElement(r.bubbleElement, t), ie.apply(e, r.outerContainer), ne.flagHTMLUpdateClass(r.bubbleElement), e.applyCustomStyles(r, i, !1, (o = e.messageStyles) == null ? void 0 : o.html), r;
|
965
965
|
}
|
966
966
|
// prettier-ignore
|
967
967
|
}, {
|
@@ -1632,24 +1632,24 @@ function dt(n, e, t) {
|
|
1632
1632
|
return n.substr(0, e) + t + n.substr(e + 1);
|
1633
1633
|
}
|
1634
1634
|
function Er(n) {
|
1635
|
-
var e, t, i, s, r, o, a, l, c, d, u, h, f, m, p, g,
|
1635
|
+
var e, t, i, s, r, o, a, l, c, d, u, h, f, m, p, g, y;
|
1636
1636
|
if (n.options.typographer) {
|
1637
|
-
for (
|
1638
|
-
for (g = n.tokens[p].children,
|
1639
|
-
for (a = g[e].level, f =
|
1640
|
-
|
1637
|
+
for (y = [], p = n.tokens.length - 1; p >= 0; p--) if (n.tokens[p].type === "inline") {
|
1638
|
+
for (g = n.tokens[p].children, y.length = 0, e = 0; e < g.length; e++) if (t = g[e], !(t.type !== "text" || vr.test(t.text))) {
|
1639
|
+
for (a = g[e].level, f = y.length - 1; f >= 0 && !(y[f].level <= a); f--);
|
1640
|
+
y.length = f + 1, i = t.content, r = 0, o = i.length;
|
1641
1641
|
e: for (; r < o && (Us.lastIndex = r, s = Us.exec(i), !!s);) {
|
1642
1642
|
if (l = !qs(i, s.index - 1), r = s.index + 1, m = s[0] === "'", c = !qs(i, r), !c && !l) {
|
1643
1643
|
m && (t.content = dt(t.content, s.index, js));
|
1644
1644
|
continue;
|
1645
1645
|
}
|
1646
1646
|
if (u = !c, h = !l, h) {
|
1647
|
-
for (f =
|
1648
|
-
d =
|
1647
|
+
for (f = y.length - 1; f >= 0 && (d = y[f], !(y[f].level < a)); f--) if (d.single === m && y[f].level === a) {
|
1648
|
+
d = y[f], m ? (g[d.token].content = dt(g[d.token].content, d.pos, n.options.quotes[2]), t.content = dt(t.content, s.index, n.options.quotes[3])) : (g[d.token].content = dt(g[d.token].content, d.pos, n.options.quotes[0]), t.content = dt(t.content, s.index, n.options.quotes[1])), y.length = f;
|
1649
1649
|
continue e;
|
1650
1650
|
}
|
1651
1651
|
}
|
1652
|
-
u ?
|
1652
|
+
u ? y.push({
|
1653
1653
|
token: e,
|
1654
1654
|
pos: s.index,
|
1655
1655
|
single: m,
|
@@ -1851,7 +1851,7 @@ function Cr(n, e, t, i) {
|
|
1851
1851
|
m,
|
1852
1852
|
p,
|
1853
1853
|
g,
|
1854
|
-
|
1854
|
+
y,
|
1855
1855
|
R,
|
1856
1856
|
B,
|
1857
1857
|
Te,
|
@@ -1873,14 +1873,14 @@ function Cr(n, e, t, i) {
|
|
1873
1873
|
type: "bullet_list_open",
|
1874
1874
|
lines: Te = [e, 0],
|
1875
1875
|
level: n.level++
|
1876
|
-
}), s = e, B = !1, oe = n.parser.ruler.getRules("list"); s < t && (
|
1876
|
+
}), s = e, B = !1, oe = n.parser.ruler.getRules("list"); s < t && (y = n.skipSpaces(u), h = n.eMarks[s], y >= h ? f = 1 : f = y - u, f > 4 && (f = 1), f < 1 && (f = 1), r = u - n.bMarks[s] + f, n.tokens.push({
|
1877
1877
|
type: "list_item_open",
|
1878
1878
|
lines: N = [e, 0],
|
1879
1879
|
level: n.level++
|
1880
|
-
}), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] =
|
1880
|
+
}), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] = y - n.bMarks[e], n.blkIndent = r, n.tight = !0, n.parentType = "list", n.parser.tokenize(n, e, t, !0), (!n.tight || B) && (re = !1), B = n.line - e > 1 && n.isEmpty(n.line - 1), n.blkIndent = a, n.tShift[e] = o, n.tight = l, n.parentType = c, n.tokens.push({
|
1881
1881
|
type: "list_item_close",
|
1882
1882
|
level: --n.level
|
1883
|
-
}), s = e = n.line, N[1] = s,
|
1883
|
+
}), s = e = n.line, N[1] = s, y = n.bMarks[e], !(s >= t || n.isEmpty(s) || n.tShift[s] < n.blkIndent));) {
|
1884
1884
|
for (_t = !1, z = 0, We = oe.length; z < We; z++) if (oe[z](n, s, t, !0)) {
|
1885
1885
|
_t = !0;
|
1886
1886
|
break;
|
@@ -1975,7 +1975,7 @@ function Ir(n) {
|
|
1975
1975
|
var e = n | 32;
|
1976
1976
|
return e >= 97 && e <= 122;
|
1977
1977
|
}
|
1978
|
-
function
|
1978
|
+
function Or(n, e, t, i) {
|
1979
1979
|
var s,
|
1980
1980
|
r,
|
1981
1981
|
o,
|
@@ -2005,7 +2005,7 @@ function Zi(n, e) {
|
|
2005
2005
|
i = n.eMarks[e];
|
2006
2006
|
return n.src.substr(t, i - t);
|
2007
2007
|
}
|
2008
|
-
function
|
2008
|
+
function Pr(n, e, t, i) {
|
2009
2009
|
var s, r, o, a, l, c, d, u, h, f, m;
|
2010
2010
|
if (e + 2 > t || (l = e + 1, n.tShift[l] < n.blkIndent) || (o = n.bMarks[l] + n.tShift[l], o >= n.eMarks[l]) || (s = n.src.charCodeAt(o), s !== 124 && s !== 45 && s !== 58) || (r = Zi(n, e + 1), !/^[-:| ]+$/.test(r)) || (c = r.split("|"), c <= 2)) return !1;
|
2011
2011
|
for (u = [], a = 0; a < c.length; a++) {
|
@@ -2099,7 +2099,7 @@ function Nr(n, e) {
|
|
2099
2099
|
for (t = e + 2, i = n.tokens.length - 2; t < i; t++) n.tokens[t].level === s && n.tokens[t].type === "paragraph_open" && (n.tokens[t + 2].tight = !0, n.tokens[t].tight = !0, t += 2);
|
2100
2100
|
}
|
2101
2101
|
function Dr(n, e, t, i) {
|
2102
|
-
var s, r, o, a, l, c, d, u, h, f, m, p, g,
|
2102
|
+
var s, r, o, a, l, c, d, u, h, f, m, p, g, y;
|
2103
2103
|
if (i) return n.ddIndent < 0 ? !1 : gi(n, e) >= 0;
|
2104
2104
|
if (d = e + 1, n.isEmpty(d) && ++d > t || n.tShift[d] < n.blkIndent || (s = gi(n, d), s < 0) || n.level >= n.options.maxNesting) return !1;
|
2105
2105
|
c = n.tokens.length, n.tokens.push({
|
@@ -2108,7 +2108,7 @@ function Dr(n, e, t, i) {
|
|
2108
2108
|
level: n.level++
|
2109
2109
|
}), o = e, r = d;
|
2110
2110
|
e: for (;;) {
|
2111
|
-
for (
|
2111
|
+
for (y = !0, g = !1, n.tokens.push({
|
2112
2112
|
type: "dt_open",
|
2113
2113
|
lines: [o, o],
|
2114
2114
|
level: n.level++
|
@@ -2126,7 +2126,7 @@ function Dr(n, e, t, i) {
|
|
2126
2126
|
type: "dd_open",
|
2127
2127
|
lines: a = [d, 0],
|
2128
2128
|
level: n.level++
|
2129
|
-
}), p = n.tight, h = n.ddIndent, u = n.blkIndent, m = n.tShift[r], f = n.parentType, n.blkIndent = n.ddIndent = n.tShift[r] + 2, n.tShift[r] = s - n.bMarks[r], n.tight = !0, n.parentType = "deflist", n.parser.tokenize(n, r, t, !0), (!n.tight || g) && (
|
2129
|
+
}), p = n.tight, h = n.ddIndent, u = n.blkIndent, m = n.tShift[r], f = n.parentType, n.blkIndent = n.ddIndent = n.tShift[r] + 2, n.tShift[r] = s - n.bMarks[r], n.tight = !0, n.parentType = "deflist", n.parser.tokenize(n, r, t, !0), (!n.tight || g) && (y = !1), g = n.line - r > 1 && n.isEmpty(n.line - 1), n.tShift[r] = m, n.tight = p, n.parentType = f, n.blkIndent = u, n.ddIndent = h, n.tokens.push({
|
2130
2130
|
type: "dd_close",
|
2131
2131
|
level: --n.level
|
2132
2132
|
}), a[1] = d = n.line, d >= t || n.tShift[d] < n.blkIndent) break e;
|
@@ -2138,7 +2138,7 @@ function Dr(n, e, t, i) {
|
|
2138
2138
|
return n.tokens.push({
|
2139
2139
|
type: "dl_close",
|
2140
2140
|
level: --n.level
|
2141
|
-
}), l[1] = d, n.line = d,
|
2141
|
+
}), l[1] = d, n.line = d, y && Nr(n, c), !0;
|
2142
2142
|
}
|
2143
2143
|
function Br(n, e) {
|
2144
2144
|
var t,
|
@@ -2174,7 +2174,7 @@ function Br(n, e) {
|
|
2174
2174
|
level: n.level
|
2175
2175
|
})), !0;
|
2176
2176
|
}
|
2177
|
-
var bi = [["code", Sr], ["fences", _r, ["paragraph", "blockquote", "list"]], ["blockquote", xr, ["paragraph", "blockquote", "list"]], ["hr", wr, ["paragraph", "blockquote", "list"]], ["list", Cr, ["paragraph", "blockquote"]], ["footnote", Tr, ["paragraph"]], ["heading", Rr, ["paragraph", "blockquote"]], ["lheading", Mr], ["htmlblock",
|
2177
|
+
var bi = [["code", Sr], ["fences", _r, ["paragraph", "blockquote", "list"]], ["blockquote", xr, ["paragraph", "blockquote", "list"]], ["hr", wr, ["paragraph", "blockquote", "list"]], ["list", Cr, ["paragraph", "blockquote"]], ["footnote", Tr, ["paragraph"]], ["heading", Rr, ["paragraph", "blockquote"]], ["lheading", Mr], ["htmlblock", Or, ["paragraph", "blockquote"]], ["table", Pr, ["paragraph"]], ["deflist", Dr, ["paragraph"]], ["paragraph", Br]];
|
2178
2178
|
function _s() {
|
2179
2179
|
this.ruler = new ce();
|
2180
2180
|
for (var n = 0; n < bi.length; n++) this.ruler.push(bi[n][0], bi[n][1], {
|
@@ -2861,7 +2861,9 @@ var ft = /*#__PURE__*/function () {
|
|
2861
2861
|
return new we({
|
2862
2862
|
highlight: function highlight(i, s) {
|
2863
2863
|
if (s && t.getLanguage(s)) try {
|
2864
|
-
return t.highlight(
|
2864
|
+
return t.highlight(i, {
|
2865
|
+
language: s
|
2866
|
+
}).value;
|
2865
2867
|
} catch (_unused4) {
|
2866
2868
|
console.error("failed to setup the highlight dependency");
|
2867
2869
|
}
|
@@ -2919,7 +2921,7 @@ var Q = /*#__PURE__*/function () {
|
|
2919
2921
|
}, {
|
2920
2922
|
key: "applySideStyles",
|
2921
2923
|
value: function applySideStyles(e, t, i, s) {
|
2922
|
-
s && (Q.applyCustomStylesToElements(e, i, s.shared), t ===
|
2924
|
+
s && (Q.applyCustomStylesToElements(e, i, s.shared), t === v.USER_ROLE ? Q.applyCustomStylesToElements(e, i, s.user) : (Q.applyCustomStylesToElements(e, i, s.ai), Q.applyCustomStylesToElements(e, i, s[t])));
|
2923
2925
|
}
|
2924
2926
|
}, {
|
2925
2927
|
key: "isElementsStyles",
|
@@ -3006,7 +3008,7 @@ var U = /*#__PURE__*/function () {
|
|
3006
3008
|
}, {
|
3007
3009
|
key: "apply",
|
3008
3010
|
value: function apply(e, t, i) {
|
3009
|
-
|
3011
|
+
Pe.setRing(t.bubbleElement, i == null ? void 0 : i.bubble), i != null && i.bubble && (i = JSON.parse(JSON.stringify(i)), delete i.bubble), e.applyCustomStyles(t, "history", !1, i);
|
3010
3012
|
}
|
3011
3013
|
}, {
|
3012
3014
|
key: "addLoadHistoryMessage",
|
@@ -3022,7 +3024,7 @@ var U = /*#__PURE__*/function () {
|
|
3022
3024
|
}, {
|
3023
3025
|
key: "createDefaultElements",
|
3024
3026
|
value: function createDefaultElements(e) {
|
3025
|
-
var t = e.createMessageElements("",
|
3027
|
+
var t = e.createMessageElements("", v.AI_ROLE),
|
3026
3028
|
i = t.bubbleElement,
|
3027
3029
|
s = U.generateLoadingRingElement();
|
3028
3030
|
return i.appendChild(s), t;
|
@@ -3033,7 +3035,7 @@ var U = /*#__PURE__*/function () {
|
|
3033
3035
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
3034
3036
|
var r, o, a, l;
|
3035
3037
|
var i = (l = (a = (o = (r = e.messageStyles) == null ? void 0 : r.loading) == null ? void 0 : o.history) == null ? void 0 : a.full) == null ? void 0 : l.html,
|
3036
|
-
s = i ? xe.createElements(e, i,
|
3038
|
+
s = i ? xe.createElements(e, i, v.AI_ROLE, !0) : U.createDefaultElements(e);
|
3037
3039
|
return U.addLoadHistoryMessage(s, e, t), s;
|
3038
3040
|
}
|
3039
3041
|
}, {
|
@@ -3106,7 +3108,7 @@ var te = /*#__PURE__*/function () {
|
|
3106
3108
|
var _this3 = this;
|
3107
3109
|
_classCallCheck(this, te);
|
3108
3110
|
var t;
|
3109
|
-
this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = te.createContainerElement(), this.messageStyles = ne.processMessageStyles(e.messageStyles), this._remarkable = ni.createNew(e.remarkable), this.
|
3111
|
+
this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = te.createContainerElement(), this.messageStyles = ne.processMessageStyles(e.messageStyles), this._remarkable = ni.createNew(e.remarkable), this.avatars = e.avatars, this.names = e.names, this._onMessage = xi.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), this.focusMode = e.focusMode, this.focusMode || (this._lastGroupMessagesElement = document.createElement("div")), typeof this.focusMode != "boolean" && (t = this.focusMode) != null && t.fade && wi.setFade(this.elementRef, this.focusMode.fade), setTimeout(function () {
|
3110
3112
|
_this3.submitUserMessage = e.submitUserMessage;
|
3111
3113
|
});
|
3112
3114
|
}
|
@@ -3120,13 +3122,13 @@ var te = /*#__PURE__*/function () {
|
|
3120
3122
|
i.status = !1;
|
3121
3123
|
}
|
3122
3124
|
var r = s ? this.createAndPrependNewMessageElement(e, t, s) : this.createAndAppendNewMessageElement(e, t);
|
3123
|
-
return r.bubbleElement.classList.add(te.TEXT_BUBBLE_CLASS), this.applyCustomStyles(r, t, !1),
|
3125
|
+
return r.bubbleElement.classList.add(te.TEXT_BUBBLE_CLASS), this.applyCustomStyles(r, t, !1), v.fillEmptyMessageElement(r.bubbleElement, e), r;
|
3124
3126
|
}
|
3125
3127
|
// prettier-ignore
|
3126
3128
|
}, {
|
3127
3129
|
key: "overwriteText",
|
3128
3130
|
value: function overwriteText(e, t, i) {
|
3129
|
-
var s =
|
3131
|
+
var s = v.overwriteMessage(this.messageToElements, i, t, e, "text", te.TEXT_BUBBLE_CLASS);
|
3130
3132
|
return s && this.renderText(s.bubbleElement, t), s;
|
3131
3133
|
}
|
3132
3134
|
}, {
|
@@ -3203,9 +3205,9 @@ var te = /*#__PURE__*/function () {
|
|
3203
3205
|
}, {
|
3204
3206
|
key: "revealRoleElementsIfTempRemoved",
|
3205
3207
|
value: function revealRoleElementsIfTempRemoved(e, t) {
|
3206
|
-
if ((this.
|
3208
|
+
if ((this.avatars || this.names) && Ne.isElementTemporary(e)) {
|
3207
3209
|
var i = this.messageElementRefs[this.messageElementRefs.length - 2];
|
3208
|
-
i && this.messageToElements.length > 0 && !e.bubbleElement.classList.contains(
|
3210
|
+
i && this.messageToElements.length > 0 && !e.bubbleElement.classList.contains(v.getRoleClass(t)) && v.revealRoleElements(i.innerContainer, !!this.avatars, !!this.names);
|
3209
3211
|
}
|
3210
3212
|
}
|
3211
3213
|
}, {
|
@@ -3222,15 +3224,15 @@ var te = /*#__PURE__*/function () {
|
|
3222
3224
|
value: function createMessageElements(e, t) {
|
3223
3225
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
3224
3226
|
var s = this.createElements(e, t);
|
3225
|
-
return
|
3227
|
+
return v.updateRefArr(this.messageElementRefs, s, i), v.classifyRoleMessages(this.messageElementRefs, t), s;
|
3226
3228
|
}
|
3227
3229
|
}, {
|
3228
3230
|
key: "addInnerContainerElements",
|
3229
3231
|
value:
|
3230
3232
|
// prettier-ignore
|
3231
3233
|
function addInnerContainerElements(e, t, i) {
|
3232
|
-
var s;
|
3233
|
-
return (
|
3234
|
+
var s = this.messageElementRefs[this.messageElementRefs.length - 1];
|
3235
|
+
return v.areOuterContainerClassRolesSame(i, s) && !this.isLastMessageError() && v.hideRoleElements(s.innerContainer, !!this.avatars, !!this.names), e.classList.add("message-bubble", v.getRoleClass(i), i === v.USER_ROLE ? "user-message-text" : "ai-message-text"), this.renderText(e, t), v.addRoleElements(e, i, this.avatars, this.names), {
|
3234
3236
|
bubbleElement: e
|
3235
3237
|
};
|
3236
3238
|
}
|
@@ -3259,7 +3261,7 @@ var te = /*#__PURE__*/function () {
|
|
3259
3261
|
key: "isLastMessageError",
|
3260
3262
|
value: function isLastMessageError() {
|
3261
3263
|
var e;
|
3262
|
-
return (e =
|
3264
|
+
return (e = v.getLastMessageBubbleElement(this.elementRef)) == null ? void 0 : e.classList.contains(v.ERROR_MESSAGE_TEXT_CLASS);
|
3263
3265
|
}
|
3264
3266
|
}, {
|
3265
3267
|
key: "sendClientUpdate",
|
@@ -3298,7 +3300,7 @@ var te = /*#__PURE__*/function () {
|
|
3298
3300
|
value: function createBaseElements(e) {
|
3299
3301
|
var t = document.createElement("div"),
|
3300
3302
|
i = document.createElement("div");
|
3301
|
-
i.classList.add("inner-message-container"), t.appendChild(i), t.classList.add("outer-message-container"), t.classList.add(
|
3303
|
+
i.classList.add("inner-message-container"), t.appendChild(i), t.classList.add("outer-message-container"), t.classList.add(v.buildRoleOuterContainerClass(e));
|
3302
3304
|
var s = document.createElement("div");
|
3303
3305
|
return s.classList.add("message-bubble"), i.appendChild(s), {
|
3304
3306
|
outerContainer: t,
|
@@ -3315,14 +3317,14 @@ var te = /*#__PURE__*/function () {
|
|
3315
3317
|
r = e._sessionId,
|
3316
3318
|
o = e.role,
|
3317
3319
|
a = {
|
3318
|
-
role: o ||
|
3320
|
+
role: o || v.AI_ROLE
|
3319
3321
|
};
|
3320
3322
|
return t && (a.text = t), i && (a.files = i), s && (a.html = s), !t && !i && !s && (a.text = ""), r && (a._sessionId = r), a;
|
3321
3323
|
}
|
3322
3324
|
}, {
|
3323
3325
|
key: "isLoadingMessage",
|
3324
3326
|
value: function isLoadingMessage(e) {
|
3325
|
-
return e == null ? void 0 : e.bubbleElement.classList.contains(
|
3327
|
+
return e == null ? void 0 : e.bubbleElement.classList.contains(Pe.BUBBLE_CLASS);
|
3326
3328
|
}
|
3327
3329
|
}]);
|
3328
3330
|
}();
|
@@ -3360,7 +3362,7 @@ var $s = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
|
|
3360
3362
|
key: "applyCustomStyles",
|
3361
3363
|
value: function applyCustomStyles(e, t, i, s) {
|
3362
3364
|
var r, o, a, l;
|
3363
|
-
if ((r = i["default"]) != null && r.styles && Y.applyCustomStylesToElements(e, t, i["default"].styles), s ===
|
3365
|
+
if ((r = i["default"]) != null && r.styles && Y.applyCustomStylesToElements(e, t, i["default"].styles), s === v.USER_ROLE) (o = i.user) != null && o.styles && Y.applyCustomStylesToElements(e, t, i.user.styles);else {
|
3364
3366
|
(a = i.ai) != null && a.styles && Y.applyCustomStylesToElements(e, t, i.ai.styles);
|
3365
3367
|
var c = (l = i[s]) == null ? void 0 : l.styles;
|
3366
3368
|
c && Y.applyCustomStylesToElements(e, t, c);
|
@@ -3371,7 +3373,7 @@ var $s = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
|
|
3371
3373
|
value: function createAvatar(e, t) {
|
3372
3374
|
var r, o, a, l, c;
|
3373
3375
|
var i = document.createElement("img");
|
3374
|
-
e ===
|
3376
|
+
e === v.USER_ROLE ? (i.src = ((r = t == null ? void 0 : t.user) == null ? void 0 : r.src) || ((o = t == null ? void 0 : t["default"]) == null ? void 0 : o.src) || ns, i.onerror = Y.errorFallback.bind(this, ns)) : (i.src = ((a = t == null ? void 0 : t[e]) == null ? void 0 : a.src) || ((l = t == null ? void 0 : t.ai) == null ? void 0 : l.src) || ((c = t == null ? void 0 : t["default"]) == null ? void 0 : c.src) || $s, i.onerror = Y.errorFallback.bind(this, $s)), i.classList.add("avatar"), i.alt = "".concat(e, " avatar");
|
3375
3377
|
var s = document.createElement("div");
|
3376
3378
|
return s.classList.add(Y.CONTAINER_CLASS), s.appendChild(i), t && Y.applyCustomStyles(s, i, t, e), s;
|
3377
3379
|
}
|
@@ -3380,7 +3382,7 @@ var $s = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
|
|
3380
3382
|
value: function getPosition(e, t) {
|
3381
3383
|
var s, r, o, a, l, c;
|
3382
3384
|
var i = (r = (s = t == null ? void 0 : t[e]) == null ? void 0 : s.styles) == null ? void 0 : r.position;
|
3383
|
-
return e !==
|
3385
|
+
return e !== v.USER_ROLE && (i !== null && i !== void 0 ? i : i = (a = (o = t == null ? void 0 : t.ai) == null ? void 0 : o.styles) == null ? void 0 : a.position), i !== null && i !== void 0 ? i : i = (c = (l = t == null ? void 0 : t["default"]) == null ? void 0 : l.styles) == null ? void 0 : c.position, i !== null && i !== void 0 ? i : i = e === v.USER_ROLE ? "right" : "left", i;
|
3384
3386
|
}
|
3385
3387
|
}, {
|
3386
3388
|
key: "add",
|
@@ -3414,19 +3416,19 @@ var Se = /*#__PURE__*/function () {
|
|
3414
3416
|
value: function getPosition(e, t) {
|
3415
3417
|
var s, r, o;
|
3416
3418
|
var i = (s = t == null ? void 0 : t[e]) == null ? void 0 : s.position;
|
3417
|
-
return e !==
|
3419
|
+
return e !== v.USER_ROLE && (i !== null && i !== void 0 ? i : i = (r = t == null ? void 0 : t.ai) == null ? void 0 : r.position), i !== null && i !== void 0 ? i : i = (o = t == null ? void 0 : t["default"]) == null ? void 0 : o.position, i !== null && i !== void 0 ? i : i = e === v.USER_ROLE ? "right" : "left", i;
|
3418
3420
|
}
|
3419
3421
|
}, {
|
3420
3422
|
key: "applyStyle",
|
3421
3423
|
value: function applyStyle(e, t, i) {
|
3422
3424
|
var s, r, o, a;
|
3423
|
-
Object.assign(e.style, (s = i["default"]) == null ? void 0 : s.style), t ===
|
3425
|
+
Object.assign(e.style, (s = i["default"]) == null ? void 0 : s.style), t === v.USER_ROLE ? Object.assign(e.style, (r = i.user) == null ? void 0 : r.style) : (Object.assign(e.style, (o = i.ai) == null ? void 0 : o.style), Object.assign(e.style, (a = i[t]) == null ? void 0 : a.style));
|
3424
3426
|
}
|
3425
3427
|
}, {
|
3426
3428
|
key: "getNameText",
|
3427
3429
|
value: function getNameText(e, t) {
|
3428
3430
|
var i, s, r, o, a, l;
|
3429
|
-
return e ===
|
3431
|
+
return e === v.USER_ROLE ? ((i = t.user) == null ? void 0 : i.text) || ((s = t["default"]) == null ? void 0 : s.text) || "User" : e === v.AI_ROLE ? ((r = t.ai) == null ? void 0 : r.text) || ((o = t["default"]) == null ? void 0 : o.text) || "AI" : ((a = t[e]) == null ? void 0 : a.text) || ((l = t["default"]) == null ? void 0 : l.text) || e;
|
3430
3432
|
}
|
3431
3433
|
}, {
|
3432
3434
|
key: "createName",
|
@@ -3446,11 +3448,11 @@ var Se = /*#__PURE__*/function () {
|
|
3446
3448
|
}();
|
3447
3449
|
Se.NAME_CLASS = "name";
|
3448
3450
|
var $t = Se;
|
3449
|
-
var
|
3450
|
-
function
|
3451
|
-
_classCallCheck(this,
|
3451
|
+
var _ = /*#__PURE__*/function () {
|
3452
|
+
function _() {
|
3453
|
+
_classCallCheck(this, _);
|
3452
3454
|
}
|
3453
|
-
return _createClass(
|
3455
|
+
return _createClass(_, null, [{
|
3454
3456
|
key: "getLastElementsByClass",
|
3455
3457
|
value: function getLastElementsByClass(e, t, i) {
|
3456
3458
|
var _loop = function _loop() {
|
@@ -3491,8 +3493,8 @@ var w = /*#__PURE__*/function () {
|
|
3491
3493
|
}, {
|
3492
3494
|
key: "overwriteMessage",
|
3493
3495
|
value: function overwriteMessage(e, t, i, s, r, o) {
|
3494
|
-
var a =
|
3495
|
-
l =
|
3496
|
+
var a = _.getLastElementsByClass(t, [_.getRoleClass(s), o], [Pe.BUBBLE_CLASS]),
|
3497
|
+
l = _.getLastMessage(e, s, r);
|
3496
3498
|
return l && (l[r] = i), a;
|
3497
3499
|
}
|
3498
3500
|
}, {
|
@@ -3504,18 +3506,18 @@ var w = /*#__PURE__*/function () {
|
|
3504
3506
|
}, {
|
3505
3507
|
key: "fillEmptyMessageElement",
|
3506
3508
|
value: function fillEmptyMessageElement(e, t) {
|
3507
|
-
t.trim().length === 0 && (e.classList.add(
|
3509
|
+
t.trim().length === 0 && (e.classList.add(_.EMPTY_MESSAGE_CLASS), e.innerHTML = '<div style="color:#00000000">.</div>');
|
3508
3510
|
}
|
3509
3511
|
}, {
|
3510
3512
|
key: "unfillEmptyMessageElement",
|
3511
3513
|
value: function unfillEmptyMessageElement(e, t) {
|
3512
|
-
e.classList.contains(
|
3514
|
+
e.classList.contains(_.EMPTY_MESSAGE_CLASS) && t.trim().length > 0 && e.replaceChildren();
|
3513
3515
|
}
|
3514
3516
|
}, {
|
3515
3517
|
key: "getLastMessageBubbleElement",
|
3516
3518
|
value: function getLastMessageBubbleElement(e) {
|
3517
3519
|
var t, i, s;
|
3518
|
-
return Array.from(((s = (i = (t =
|
3520
|
+
return Array.from(((s = (i = (t = _.getLastMessageElement(e)) == null ? void 0 : t.children) == null ? void 0 : i[0]) == null ? void 0 : s.children) || []).find(function (r) {
|
3519
3521
|
return r.classList.contains("message-bubble");
|
3520
3522
|
});
|
3521
3523
|
}
|
@@ -3532,8 +3534,7 @@ var w = /*#__PURE__*/function () {
|
|
3532
3534
|
}, {
|
3533
3535
|
key: "hideRoleElements",
|
3534
3536
|
value: function hideRoleElements(e, t, i) {
|
3535
|
-
|
3536
|
-
t && Kt.hide(s), i && $t.hide(s);
|
3537
|
+
t && Kt.hide(e), i && $t.hide(e);
|
3537
3538
|
}
|
3538
3539
|
}, {
|
3539
3540
|
key: "revealRoleElements",
|
@@ -3546,15 +3547,15 @@ var w = /*#__PURE__*/function () {
|
|
3546
3547
|
i ? e.unshift(t) : e.push(t);
|
3547
3548
|
}
|
3548
3549
|
}, {
|
3549
|
-
key: "
|
3550
|
-
value: function
|
3551
|
-
return "
|
3550
|
+
key: "buildRoleOuterContainerClass",
|
3551
|
+
value: function buildRoleOuterContainerClass(e) {
|
3552
|
+
return "".concat(_.OUTER_CONTAINER_CLASS_ROLE_PREFIX).concat(e);
|
3552
3553
|
}
|
3553
3554
|
}, {
|
3554
3555
|
key: "addNewPositionClasses",
|
3555
3556
|
value: function addNewPositionClasses(e, t) {
|
3556
3557
|
var _e$outerContainer$cla;
|
3557
|
-
e.outerContainer.classList.remove(
|
3558
|
+
e.outerContainer.classList.remove(_.POSITION_TOP_MESSAGE_CLASS, _.POSITION_MIDDLE_MESSAGE_CLASS, _.POSITION_BOTTOM_MESSAGE_CLASS), (_e$outerContainer$cla = e.outerContainer.classList).add.apply(_e$outerContainer$cla, _toConsumableArray(t));
|
3558
3559
|
}
|
3559
3560
|
}, {
|
3560
3561
|
key: "getNumberOfElements",
|
@@ -3580,32 +3581,57 @@ var w = /*#__PURE__*/function () {
|
|
3580
3581
|
key: "generateMessageBodyElements",
|
3581
3582
|
value: function generateMessageBodyElements(e, t) {
|
3582
3583
|
var i = {};
|
3583
|
-
return e.text && (i.text =
|
3584
|
+
return e.text && (i.text = _.findMessageElements(t, fe.TEXT_BUBBLE_CLASS)), e.html && (i.html = _.findMessageElements(t, xe.HTML_BUBBLE_CLASS)), e.files && (i.files = _.filterdMessageElements(t, V.FILE_BUBBLE_CLASS)), i;
|
3584
3585
|
}
|
3585
3586
|
}, {
|
3586
3587
|
key: "generateMessageBody",
|
3587
3588
|
value: function generateMessageBody(e, t) {
|
3588
|
-
var i =
|
3589
|
+
var i = _.getNumberOfElements(e),
|
3589
3590
|
s = t.slice(t.length - i);
|
3590
|
-
return
|
3591
|
+
return _.generateMessageBodyElements(e, s);
|
3591
3592
|
}
|
3593
|
+
// if role not present - traverse all
|
3592
3594
|
}, {
|
3593
|
-
key: "
|
3594
|
-
value: function
|
3595
|
-
var i =
|
3596
|
-
|
3597
|
-
|
3598
|
-
|
3599
|
-
|
3595
|
+
key: "classifyRoleMessages",
|
3596
|
+
value: function classifyRoleMessages(e, t) {
|
3597
|
+
var i = t ? _.buildRoleOuterContainerClass(t) : void 0;
|
3598
|
+
for (var s = e.length - 1; s >= 0; s -= 1) {
|
3599
|
+
if (t || (i = Array.from(e[s].outerContainer.classList).find(function (u) {
|
3600
|
+
return u.startsWith(_.OUTER_CONTAINER_CLASS_ROLE_PREFIX);
|
3601
|
+
})), !i) continue;
|
3602
|
+
var r = e[s],
|
3603
|
+
o = r.outerContainer.classList.contains(i),
|
3604
|
+
a = e[s - 1],
|
3605
|
+
l = e[s + 1],
|
3600
3606
|
c = a == null ? void 0 : a.outerContainer.classList.contains(i),
|
3601
3607
|
d = l == null ? void 0 : l.outerContainer.classList.contains(i);
|
3602
|
-
o
|
3608
|
+
if (o) !c && d ? _.addNewPositionClasses(r, [_.POSITION_TOP_MESSAGE_CLASS]) : c && d ? _.addNewPositionClasses(r, [_.POSITION_MIDDLE_MESSAGE_CLASS]) : c && !d ? _.addNewPositionClasses(r, [_.POSITION_BOTTOM_MESSAGE_CLASS]) : !c && !d && _.addNewPositionClasses(r, [_.POSITION_TOP_MESSAGE_CLASS, _.POSITION_BOTTOM_MESSAGE_CLASS]);else if (t) break;
|
3609
|
+
}
|
3610
|
+
}
|
3611
|
+
}, {
|
3612
|
+
key: "areOuterContainerClassRolesSame",
|
3613
|
+
value: function areOuterContainerClassRolesSame(e, t) {
|
3614
|
+
return t ? Array.from(t.outerContainer.classList).find(function (s) {
|
3615
|
+
return s.startsWith(_.OUTER_CONTAINER_CLASS_ROLE_PREFIX);
|
3616
|
+
}) === _.buildRoleOuterContainerClass(e) : !1;
|
3617
|
+
}
|
3618
|
+
}, {
|
3619
|
+
key: "resetAllRoleElements",
|
3620
|
+
value: function resetAllRoleElements(e, t, i) {
|
3621
|
+
if (!t && !i) return;
|
3622
|
+
var s = "";
|
3623
|
+
e.forEach(function (r, o) {
|
3624
|
+
r.bubbleElement.classList.contains(_.ERROR_MESSAGE_TEXT_CLASS) || _.revealRoleElements(r.innerContainer, t, i);
|
3625
|
+
var a = Array.from(r.outerContainer.classList).find(function (l) {
|
3626
|
+
return l.startsWith(_.OUTER_CONTAINER_CLASS_ROLE_PREFIX);
|
3627
|
+
});
|
3628
|
+
s === a && _.hideRoleElements(e[o - 1].innerContainer, t, i), s = a;
|
3603
3629
|
});
|
3604
3630
|
}
|
3605
3631
|
}]);
|
3606
3632
|
}();
|
3607
|
-
|
3608
|
-
var
|
3633
|
+
_.AI_ROLE = "ai", _.USER_ROLE = "user", _.ERROR_MESSAGE_TEXT_CLASS = "error-message-text", _.OUTER_CONTAINER_CLASS_ROLE_PREFIX = "deep-chat-outer-container-role-", _.EMPTY_MESSAGE_CLASS = "empty-message", _.POSITION_TOP_MESSAGE_CLASS = "deep-chat-top-message", _.POSITION_MIDDLE_MESSAGE_CLASS = "deep-chat-middle-message", _.POSITION_BOTTOM_MESSAGE_CLASS = "deep-chat-bottom-message";
|
3634
|
+
var v = _;
|
3609
3635
|
var pt = /*#__PURE__*/function () {
|
3610
3636
|
function pt(e) {
|
3611
3637
|
_classCallCheck(this, pt);
|
@@ -3629,7 +3655,7 @@ var pt = /*#__PURE__*/function () {
|
|
3629
3655
|
}, {
|
3630
3656
|
key: "setInitialState",
|
3631
3657
|
value: function setInitialState(e, t, i) {
|
3632
|
-
this._streamType = e, i !== null && i !== void 0 ? i : i =
|
3658
|
+
this._streamType = e, i !== null && i !== void 0 ? i : i = v.AI_ROLE, this._elements = e === "text" ? this._messages.addNewTextMessage(t, i) : xe.add(this._messages, t, i, this._messages.messageElementRefs), this._elements.bubbleElement.classList.add(pt.MESSAGE_CLASS), this._activeMessageRole = i, this._message = _defineProperty({
|
3633
3659
|
role: this._activeMessageRole
|
3634
3660
|
}, e, t), this._messages.messageToElements.push([this._message, _defineProperty({}, e, this._elements)]);
|
3635
3661
|
}
|
@@ -3637,7 +3663,7 @@ var pt = /*#__PURE__*/function () {
|
|
3637
3663
|
key: "updateBasedOnType",
|
3638
3664
|
value: function updateBasedOnType(e, t, i) {
|
3639
3665
|
var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
3640
|
-
|
3666
|
+
v.unfillEmptyMessageElement(i, e), (t === "text" ? this.updateText : this.updateHTML).bind(this)(e, i, s);
|
3641
3667
|
}
|
3642
3668
|
}, {
|
3643
3669
|
key: "updateText",
|
@@ -3939,7 +3965,7 @@ function Io(n) {
|
|
3939
3965
|
i,
|
3940
3966
|
s = !1;
|
3941
3967
|
return function (o) {
|
3942
|
-
e === void 0 ? (e = o, t = 0, i = -1) : e =
|
3968
|
+
e === void 0 ? (e = o, t = 0, i = -1) : e = Po(e, o);
|
3943
3969
|
var a = e.length;
|
3944
3970
|
var l = 0;
|
3945
3971
|
for (; t < a;) {
|
@@ -3961,7 +3987,7 @@ function Io(n) {
|
|
3961
3987
|
l === a ? e = void 0 : l !== 0 && (e = e.subarray(l), t -= l);
|
3962
3988
|
};
|
3963
3989
|
}
|
3964
|
-
function
|
3990
|
+
function Oo(n, e, t) {
|
3965
3991
|
var i = Ws();
|
3966
3992
|
var s = new TextDecoder();
|
3967
3993
|
return function (o, a) {
|
@@ -3987,7 +4013,7 @@ function Po(n, e, t) {
|
|
3987
4013
|
}
|
3988
4014
|
};
|
3989
4015
|
}
|
3990
|
-
function
|
4016
|
+
function Po(n, e) {
|
3991
4017
|
var t = new Uint8Array(n.length + e.length);
|
3992
4018
|
return t.set(n), t.set(e, n.length), t;
|
3993
4019
|
}
|
@@ -4027,9 +4053,9 @@ function Bo(n, e) {
|
|
4027
4053
|
}
|
4028
4054
|
l || document.addEventListener("visibilitychange", p);
|
4029
4055
|
var g = Do,
|
4030
|
-
|
4056
|
+
y = 0;
|
4031
4057
|
function R() {
|
4032
|
-
document.removeEventListener("visibilitychange", p), window.clearTimeout(
|
4058
|
+
document.removeEventListener("visibilitychange", p), window.clearTimeout(y), m.abort();
|
4033
4059
|
}
|
4034
4060
|
t == null || t.addEventListener("abort", function () {
|
4035
4061
|
R(), u();
|
@@ -4058,7 +4084,7 @@ function Bo(n, e) {
|
|
4058
4084
|
return Te(oe);
|
4059
4085
|
case 7:
|
4060
4086
|
_context6.next = 9;
|
4061
|
-
return Lo(oe.body, Io(
|
4087
|
+
return Lo(oe.body, Io(Oo(function (z) {
|
4062
4088
|
z ? f[Js] = z : delete f[Js];
|
4063
4089
|
}, function (z) {
|
4064
4090
|
g = z;
|
@@ -4074,7 +4100,7 @@ function Bo(n, e) {
|
|
4074
4100
|
_context6.t0 = _context6["catch"](1);
|
4075
4101
|
if (!m.signal.aborted) try {
|
4076
4102
|
z = (re = a == null ? void 0 : a(_context6.t0)) !== null && re !== void 0 ? re : g;
|
4077
|
-
window.clearTimeout(
|
4103
|
+
window.clearTimeout(y), y = window.setTimeout(N, z);
|
4078
4104
|
} catch (z) {
|
4079
4105
|
R(), h(z);
|
4080
4106
|
}
|
@@ -4106,7 +4132,7 @@ var M = /*#__PURE__*/function () {
|
|
4106
4132
|
r,
|
4107
4133
|
p,
|
4108
4134
|
g,
|
4109
|
-
|
4135
|
+
y,
|
4110
4136
|
R,
|
4111
4137
|
B,
|
4112
4138
|
Te,
|
@@ -4154,7 +4180,7 @@ var M = /*#__PURE__*/function () {
|
|
4154
4180
|
}
|
4155
4181
|
return _context9.abrupt("return", ye.stream(e, a, i));
|
4156
4182
|
case 17:
|
4157
|
-
if (!(((
|
4183
|
+
if (!(((y = e.connectSettings) == null ? void 0 : y.url) === Ee.URL)) {
|
4158
4184
|
_context9.next = 19;
|
4159
4185
|
break;
|
4160
4186
|
}
|
@@ -4544,7 +4570,7 @@ var G = /*#__PURE__*/function () {
|
|
4544
4570
|
throw Error(k.INVALID_RESPONSE(o, "server", !!e.deepChat.responseInterceptor, a));
|
4545
4571
|
case 8:
|
4546
4572
|
if (M.isSimulation(e.stream)) {
|
4547
|
-
l = G.stream.bind(_this7, e, i, s), c = s[o.role ||
|
4573
|
+
l = G.stream.bind(_this7, e, i, s), c = s[o.role || v.AI_ROLE];
|
4548
4574
|
M.upsertWFiles(i, l, c, a);
|
4549
4575
|
} else (Array.isArray(a) ? a : [a]).forEach(function (c) {
|
4550
4576
|
return i.addNewMessage(c);
|
@@ -4652,7 +4678,7 @@ var G = /*#__PURE__*/function () {
|
|
4652
4678
|
var r = e.stream.simulation;
|
4653
4679
|
if (typeof r == "string") {
|
4654
4680
|
var _i$o;
|
4655
|
-
var o = s.role ||
|
4681
|
+
var o = s.role || v.AI_ROLE,
|
4656
4682
|
a = i[o];
|
4657
4683
|
s.text === r || s.html === r ? (a == null || a.finaliseStreamedMessage(), delete i[o]) : ((_i$o = i[o]) !== null && _i$o !== void 0 ? _i$o : i[o] = new Ae(t), i[o].upsertStreamedMessage(s));
|
4658
4684
|
} else M.simulate(t, e.streamHandlers, s);
|
@@ -4841,7 +4867,7 @@ var ye = /*#__PURE__*/function () {
|
|
4841
4867
|
return typeof m.error == "string";
|
4842
4868
|
});
|
4843
4869
|
if (f) console.error(f.error), t.isLastMessageError() || t.addNewErrorMessage("service", f.error);else if (M.isSimulation(e.stream)) {
|
4844
|
-
m = u, p = G.stream.bind(_this8, e, t, i.roleToStream), g = i.roleToStream[m.role ||
|
4870
|
+
m = u, p = G.stream.bind(_this8, e, t, i.roleToStream), g = i.roleToStream[m.role || v.AI_ROLE];
|
4845
4871
|
M.upsertWFiles(t, p, g, m);
|
4846
4872
|
} else h.forEach(function (m) {
|
4847
4873
|
return t.addNewMessage(m);
|
@@ -4945,7 +4971,7 @@ var T = /*#__PURE__*/function () {
|
|
4945
4971
|
return E.processResponseByType(p);
|
4946
4972
|
}).then(/*#__PURE__*/function () {
|
4947
4973
|
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(p) {
|
4948
|
-
var R, B, g,
|
4974
|
+
var R, B, g, y;
|
4949
4975
|
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
4950
4976
|
while (1) switch (_context19.prev = _context19.next) {
|
4951
4977
|
case 0:
|
@@ -4969,20 +4995,20 @@ var T = /*#__PURE__*/function () {
|
|
4969
4995
|
_context19.next = 10;
|
4970
4996
|
return e.extractResultData(g, u, o);
|
4971
4997
|
case 10:
|
4972
|
-
|
4998
|
+
y = _context19.sent;
|
4973
4999
|
if (d) {
|
4974
5000
|
_context19.next = 13;
|
4975
5001
|
break;
|
4976
5002
|
}
|
4977
5003
|
throw p;
|
4978
5004
|
case 13:
|
4979
|
-
if (!(!
|
5005
|
+
if (!(!y || _typeof(y) != "object" && !Array.isArray(y))) {
|
4980
5006
|
_context19.next = 15;
|
4981
5007
|
break;
|
4982
5008
|
}
|
4983
5009
|
throw Error(k.INVALID_RESPONSE(p, "response", !!e.deepChat.responseInterceptor, g));
|
4984
5010
|
case 15:
|
4985
|
-
|
5011
|
+
y.makingAnotherRequest || (M.isSimulatable(e.stream, y) ? M.simulate(i, e.streamHandlers, y) : ((Array.isArray(y) ? y : [y]).forEach(function (N) {
|
4986
5012
|
return i.addNewMessage(N);
|
4987
5013
|
}), c()));
|
4988
5014
|
case 16:
|
@@ -5186,7 +5212,7 @@ var Ue = /*#__PURE__*/function () {
|
|
5186
5212
|
sendUpdate: !0
|
5187
5213
|
}), !0, !0);
|
5188
5214
|
if (c) {
|
5189
|
-
var d =
|
5215
|
+
var d = v.generateMessageBody(c, t);
|
5190
5216
|
i.unshift([c, d]);
|
5191
5217
|
}
|
5192
5218
|
return c;
|
@@ -5199,13 +5225,18 @@ var Ue = /*#__PURE__*/function () {
|
|
5199
5225
|
}, {
|
5200
5226
|
key: "populateMessages",
|
5201
5227
|
value: function populateMessages(e, t) {
|
5202
|
-
this._messages.removeMessage(e), this._isPaginationComplete = t.findIndex(function (
|
5203
|
-
return !
|
5228
|
+
this._messages.removeMessage(e), this._isPaginationComplete = t.findIndex(function (a) {
|
5229
|
+
return !a;
|
5204
5230
|
}) < 0;
|
5205
|
-
var i = t.filter(function (
|
5206
|
-
return !!
|
5231
|
+
var i = t.filter(function (a) {
|
5232
|
+
return !!a;
|
5207
5233
|
});
|
5208
5234
|
this.processLoadedHistory(i);
|
5235
|
+
var _this$_messages2 = this._messages,
|
5236
|
+
s = _this$_messages2.messageElementRefs,
|
5237
|
+
r = _this$_messages2.avatars,
|
5238
|
+
o = _this$_messages2.names;
|
5239
|
+
v.resetAllRoleElements(s, !!r, !!o);
|
5209
5240
|
}
|
5210
5241
|
}, {
|
5211
5242
|
key: "setupLoadHistoryOnScroll",
|
@@ -5260,7 +5291,7 @@ var Ue = /*#__PURE__*/function () {
|
|
5260
5291
|
value: function populateInitialHistory(e) {
|
5261
5292
|
var _this12 = this;
|
5262
5293
|
e.forEach(function (t) {
|
5263
|
-
ne.processHistoryFile(t), _this12._messages.
|
5294
|
+
ne.processHistoryFile(t), _this12._messages.addAnyMessage(t, !0);
|
5264
5295
|
});
|
5265
5296
|
}
|
5266
5297
|
}, {
|
@@ -6237,7 +6268,7 @@ var Xs = {
|
|
6237
6268
|
if (!this.shouldAddIntroMessage(e) || !this._chatEl) return;
|
6238
6269
|
var t = Ci.setUpInitial(this.init.bind(this), this._webModel.introMessage, this._chatEl, !!this._webModel.worker);
|
6239
6270
|
return this.scrollToTop(1), {
|
6240
|
-
role:
|
6271
|
+
role: v.AI_ROLE,
|
6241
6272
|
html: t,
|
6242
6273
|
sendUpdate: !1
|
6243
6274
|
};
|
@@ -6651,9 +6682,9 @@ var Xs = {
|
|
6651
6682
|
key: "setUpHistory",
|
6652
6683
|
value: function setUpHistory(e, t) {
|
6653
6684
|
t.forEach(function (i, s) {
|
6654
|
-
if (i.role ===
|
6685
|
+
if (i.role === v.USER_ROLE && i.text) {
|
6655
6686
|
var r = t[s + 1];
|
6656
|
-
r != null && r.text && r.role !==
|
6687
|
+
r != null && r.text && r.role !== v.USER_ROLE && e.push([i.text, r.text]);
|
6657
6688
|
}
|
6658
6689
|
});
|
6659
6690
|
}
|
@@ -8836,11 +8867,11 @@ var ws = /*#__PURE__*/function (_Ii) {
|
|
8836
8867
|
}
|
8837
8868
|
}]);
|
8838
8869
|
}(Ii);
|
8839
|
-
var
|
8840
|
-
function
|
8841
|
-
_classCallCheck(this,
|
8870
|
+
var Oi = /*#__PURE__*/function () {
|
8871
|
+
function Oi() {
|
8872
|
+
_classCallCheck(this, Oi);
|
8842
8873
|
}
|
8843
|
-
return _createClass(
|
8874
|
+
return _createClass(Oi, null, [{
|
8844
8875
|
key: "buildHeaders",
|
8845
8876
|
value: function buildHeaders(e) {
|
8846
8877
|
return {
|
@@ -8862,7 +8893,7 @@ var Pi = /*#__PURE__*/function () {
|
|
8862
8893
|
return {
|
8863
8894
|
url: "https://api.cohere.ai/v1/generate",
|
8864
8895
|
method: "POST",
|
8865
|
-
handleVerificationResult:
|
8896
|
+
handleVerificationResult: Oi.handleVerificationResult,
|
8866
8897
|
body: JSON.stringify({
|
8867
8898
|
prompt: ""
|
8868
8899
|
})
|
@@ -8874,7 +8905,7 @@ var As = /*#__PURE__*/function (_W4) {
|
|
8874
8905
|
function As(e, t, i, s, r) {
|
8875
8906
|
var _this36;
|
8876
8907
|
_classCallCheck(this, As);
|
8877
|
-
_this36 = _callSuper(this, As, [e,
|
8908
|
+
_this36 = _callSuper(this, As, [e, Oi.buildKeyVerificationDetails(), Oi.buildHeaders, r]), _this36.insertKeyPlaceholderText = "Cohere API Key", _this36.keyHelpUrl = "https://dashboard.cohere.ai/api-keys", _this36.permittedErrorPrefixes = ["invalid"], _this36.url = t, _this36.textInputPlaceholderText = i, s && _typeof(s) == "object" && Object.assign(_this36.rawBody, s);
|
8878
8909
|
return _this36;
|
8879
8910
|
}
|
8880
8911
|
_inherits(As, _W4);
|
@@ -8955,11 +8986,11 @@ var Xo = /*#__PURE__*/function (_As) {
|
|
8955
8986
|
}()
|
8956
8987
|
}]);
|
8957
8988
|
}(As);
|
8958
|
-
var
|
8959
|
-
function
|
8960
|
-
_classCallCheck(this,
|
8989
|
+
var Os = /*#__PURE__*/function () {
|
8990
|
+
function Os() {
|
8991
|
+
_classCallCheck(this, Os);
|
8961
8992
|
}
|
8962
|
-
return _createClass(
|
8993
|
+
return _createClass(Os, null, [{
|
8963
8994
|
key: "buildHeaders",
|
8964
8995
|
value: function buildHeaders(e) {
|
8965
8996
|
return {
|
@@ -8986,8 +9017,8 @@ var Ps = /*#__PURE__*/function () {
|
|
8986
9017
|
}
|
8987
9018
|
}]);
|
8988
9019
|
}();
|
8989
|
-
|
8990
|
-
var pe =
|
9020
|
+
Os.URL_DETAILS_ERROR_MESSAGE = "Please define the Azure URL Details. [More Information](https://deepchat.dev/docs/directConnection/Azure)";
|
9021
|
+
var pe = Os;
|
8991
9022
|
var mt = /*#__PURE__*/function (_Ii2) {
|
8992
9023
|
function mt(e) {
|
8993
9024
|
var _g$headers;
|
@@ -9012,9 +9043,9 @@ var mt = /*#__PURE__*/function (_Ii2) {
|
|
9012
9043
|
};
|
9013
9044
|
if (_this37 = _callSuper(this, mt, [e, s == null ? void 0 : s.assistant, l, pe.buildKeyVerificationDetails(r), pe.buildHeaders, i]), _this37.permittedErrorPrefixes = [pe.URL_DETAILS_ERROR_MESSAGE], _this37.insertKeyPlaceholderText = "Azure OpenAI API Key", _this37.keyHelpUrl = "https://learn.microsoft.com/en-us/answers/questions/1193991/how-to-get-the-value-of-openai-api-key", _this37.isTextInputDisabled = !1, _typeof(s == null ? void 0 : s.assistant) == "object") {
|
9014
9045
|
var _ref24 = (p = (m = (f = e.directConnection) == null ? void 0 : f.azure) == null ? void 0 : m.openAI) == null ? void 0 : p.assistant,
|
9015
|
-
|
9046
|
+
y = _ref24.function_handler,
|
9016
9047
|
R = _ref24.files_tool_type;
|
9017
|
-
|
9048
|
+
y && (_this37.functionHandler = y), R && (_this37.filesToolType = R);
|
9018
9049
|
}
|
9019
9050
|
pe.validateURLDetails(r) ? (_g$headers = (g = _this37.connectSettings).headers) !== null && _g$headers !== void 0 ? _g$headers : g.headers = {} : (_this37.isTextInputDisabled = !0, _this37.canSendMessage = function () {
|
9020
9051
|
return !1;
|
@@ -9104,11 +9135,11 @@ var Yo = /*#__PURE__*/function (_As2) {
|
|
9104
9135
|
}()
|
9105
9136
|
}]);
|
9106
9137
|
}(As);
|
9107
|
-
var
|
9108
|
-
function
|
9109
|
-
_classCallCheck(this,
|
9138
|
+
var P = /*#__PURE__*/function () {
|
9139
|
+
function P() {
|
9140
|
+
_classCallCheck(this, P);
|
9110
9141
|
}
|
9111
|
-
return _createClass(
|
9142
|
+
return _createClass(P, null, [{
|
9112
9143
|
key: "addAttributes",
|
9113
9144
|
value: function addAttributes(e) {
|
9114
9145
|
e.role = "button", e.setAttribute("tabindex", "0");
|
@@ -9136,7 +9167,7 @@ var O = /*#__PURE__*/function () {
|
|
9136
9167
|
}, {
|
9137
9168
|
key: "removeAriaAttributes",
|
9138
9169
|
value: function removeAriaAttributes(e) {
|
9139
|
-
|
9170
|
+
P.removeAriaBusy(e), P.removeAriaDisabled(e);
|
9140
9171
|
}
|
9141
9172
|
}]);
|
9142
9173
|
}();
|
@@ -9196,13 +9227,13 @@ var D = /*#__PURE__*/function () {
|
|
9196
9227
|
key: "unsetAllCSS",
|
9197
9228
|
value: function unsetAllCSS(e, t) {
|
9198
9229
|
var i, s;
|
9199
|
-
t.container &&
|
9230
|
+
t.container && O.unsetAllCSSMouseStates(e, t.container), (i = t.svg) != null && i.styles && O.unsetAllCSSMouseStates(e.children[0], t.svg.styles), (s = t.text) != null && s.styles && O.unsetAllCSSMouseStates(e.children[0], t.text.styles);
|
9200
9231
|
}
|
9201
9232
|
}, {
|
9202
9233
|
key: "unsetActionCSS",
|
9203
9234
|
value: function unsetActionCSS(e, t) {
|
9204
9235
|
var i, s;
|
9205
|
-
t.container &&
|
9236
|
+
t.container && O.unsetActivityCSSMouseStates(e, t.container), (i = t.svg) != null && i.styles && O.unsetActivityCSSMouseStates(e.children[0], t.svg.styles), (s = t.text) != null && s.styles && O.unsetActivityCSSMouseStates(e.children[0], t.text.styles);
|
9206
9237
|
}
|
9207
9238
|
}, {
|
9208
9239
|
key: "setElementsCSS",
|
@@ -9222,7 +9253,7 @@ var ct = /*#__PURE__*/function () {
|
|
9222
9253
|
_classCallCheck(this, ct);
|
9223
9254
|
this._mouseState = {
|
9224
9255
|
state: "default"
|
9225
|
-
},
|
9256
|
+
}, P.addAttributes(e), this.elementRef = e, this._customStyles = i, this.position = t, this.dropupText = s;
|
9226
9257
|
}
|
9227
9258
|
return _createClass(ct, [{
|
9228
9259
|
key: "buttonMouseLeave",
|
@@ -9314,7 +9345,7 @@ var zi = /*#__PURE__*/function (_ct) {
|
|
9314
9345
|
}]);
|
9315
9346
|
}(ct);
|
9316
9347
|
zi.EMPTY_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"></svg>';
|
9317
|
-
var
|
9348
|
+
var Pi = zi;
|
9318
9349
|
var q = /*#__PURE__*/function () {
|
9319
9350
|
function q() {
|
9320
9351
|
_classCallCheck(this, q);
|
@@ -9367,7 +9398,7 @@ var q = /*#__PURE__*/function () {
|
|
9367
9398
|
}
|
9368
9399
|
}]);
|
9369
9400
|
}();
|
9370
|
-
var
|
9401
|
+
var On = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>play</title>\n <path d=\"M5.92 24.096q0 1.088 0.928 1.728 0.512 0.288 1.088 0.288 0.448 0 0.896-0.224l16.16-8.064q0.48-0.256 0.8-0.736t0.288-1.088-0.288-1.056-0.8-0.736l-16.16-8.064q-0.448-0.224-0.896-0.224-0.544 0-1.088 0.288-0.928 0.608-0.928 1.728v16.16z\"></path>\n</svg>",
|
9371
9402
|
cs = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n<title>stop</title>\n<path d=\"M5.92 24.096q0 0.832 0.576 1.408t1.44 0.608h16.128q0.832 0 1.44-0.608t0.576-1.408v-16.16q0-0.832-0.576-1.44t-1.44-0.576h-16.128q-0.832 0-1.44 0.576t-0.576 1.44v16.16z\"></path>\n</svg>",
|
9372
9403
|
C = /*#__PURE__*/function (_W5) {
|
9373
9404
|
function C(e) {
|
@@ -9575,9 +9606,9 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9575
9606
|
value: function createMuteButton() {
|
9576
9607
|
var _this40 = this;
|
9577
9608
|
var t;
|
9578
|
-
var e = new
|
9609
|
+
var e = new Pi((t = this._buttonsConfig) == null ? void 0 : t.microphone);
|
9579
9610
|
return e.elementRef.classList.replace("input-button-svg", "deep-chat-openai-realtime-button"), e.elementRef.classList.add(C.BUTTON_DEFAULT, "deep-chat-openai-realtime-mute"), e.elementRef.onclick = function () {
|
9580
|
-
e.isActive ? (_this40.toggleMute(!0), e.elementRef.classList.replace(C.MUTE_ACTIVE, C.BUTTON_DEFAULT), e.changeToDefault(), _this40._isMuted = !1) : (_this40.toggleMute(!1), e.elementRef.classList.replace(C.BUTTON_DEFAULT, C.MUTE_ACTIVE),
|
9611
|
+
e.isActive ? (_this40.toggleMute(!0), e.elementRef.classList.replace(C.MUTE_ACTIVE, C.BUTTON_DEFAULT), e.changeToDefault(), _this40._isMuted = !1) : (_this40.toggleMute(!1), e.elementRef.classList.replace(C.BUTTON_DEFAULT, C.MUTE_ACTIVE), P.removeAriaAttributes(e.elementRef), e.changeToActive(), _this40._isMuted = !0);
|
9581
9612
|
}, e;
|
9582
9613
|
}
|
9583
9614
|
}, {
|
@@ -9593,7 +9624,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9593
9624
|
value: function createToggleButton() {
|
9594
9625
|
var _this41 = this;
|
9595
9626
|
var t;
|
9596
|
-
var e = new
|
9627
|
+
var e = new Pi((t = this._buttonsConfig) == null ? void 0 : t.toggle);
|
9597
9628
|
return e.elementRef.classList.replace("input-button-svg", "deep-chat-openai-realtime-button"), e.elementRef.classList.add(C.BUTTON_DEFAULT, "deep-chat-openai-realtime-toggle"), e.elementRef.onclick = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee92() {
|
9598
9629
|
var i, s;
|
9599
9630
|
return _regeneratorRuntime().wrap(function _callee92$(_context92) {
|
@@ -9730,7 +9761,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9730
9761
|
_context94.next = 5;
|
9731
9762
|
break;
|
9732
9763
|
}
|
9733
|
-
_this42.removeUnavailable(), _this42._toggleButton && (
|
9764
|
+
_this42.removeUnavailable(), _this42._toggleButton && (P.removeAriaAttributes(_this42._toggleButton.elementRef), _this42._toggleButton.changeToActive()), _this42.hideLoading();
|
9734
9765
|
_context94.next = 20;
|
9735
9766
|
break;
|
9736
9767
|
case 5:
|
@@ -9932,12 +9963,12 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9932
9963
|
key: "displayLoading",
|
9933
9964
|
value: function displayLoading() {
|
9934
9965
|
var e, t, i;
|
9935
|
-
this._toggleButton && (this._toggleButton.changeToActive(), this._toggleButton.elementRef.classList.add(C.BUTTON_LOADING),
|
9966
|
+
this._toggleButton && (this._toggleButton.changeToActive(), this._toggleButton.elementRef.classList.add(C.BUTTON_LOADING), P.removeAriaDisabled(this._toggleButton.elementRef), P.addAriaBusy(this._toggleButton.elementRef)), (typeof ((e = this._loadingConfig) == null ? void 0 : e.display) != "boolean" || this._loadingConfig.display) && this._loadingElement && (this._loadingElement.style.display = "block", (t = this._loadingConfig) != null && t.html || (this._loadingElement.textContent = ((i = this._loadingConfig) == null ? void 0 : i.text) || "Loading"));
|
9936
9967
|
}
|
9937
9968
|
}, {
|
9938
9969
|
key: "hideLoading",
|
9939
9970
|
value: function hideLoading() {
|
9940
|
-
this._toggleButton && (this._toggleButton.elementRef.classList.remove(C.BUTTON_LOADING),
|
9971
|
+
this._toggleButton && (this._toggleButton.elementRef.classList.remove(C.BUTTON_LOADING), P.removeAriaBusy(this._toggleButton.elementRef)), this._loadingElement && (this._loadingElement.style.display = "none");
|
9941
9972
|
}
|
9942
9973
|
// https://platform.openai.com/docs/guides/realtime-model-capabilities#function-calling
|
9943
9974
|
}, {
|
@@ -10018,7 +10049,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10018
10049
|
var _t$microphone, _o$default, _a$svg, _t$toggle, _u$default, _h$svg, _f$active, _m$svg;
|
10019
10050
|
var i, s, r, o, a, l, c, d, u, h, f, m;
|
10020
10051
|
var t = _typeof(e) == "object" && e.buttons ? JSON.parse(JSON.stringify(e.buttons)) : {};
|
10021
|
-
return (r = (s = (i = t.microphone) == null ? void 0 : i["default"]) == null ? void 0 : s.text) != null && r.content || ((_t$microphone = t.microphone) !== null && _t$microphone !== void 0 ? _t$microphone : t.microphone = {}, (_o$default = (o = t.microphone)["default"]) !== null && _o$default !== void 0 ? _o$default : o["default"] = {}, (_a$svg = (a = t.microphone["default"]).svg) !== null && _a$svg !== void 0 ? _a$svg : a.svg = {}, t.microphone["default"].svg.content = In), (d = (c = (l = t.toggle) == null ? void 0 : l["default"]) == null ? void 0 : c.text) != null && d.content || ((_t$toggle = t.toggle) !== null && _t$toggle !== void 0 ? _t$toggle : t.toggle = {}, (_u$default = (u = t.toggle)["default"]) !== null && _u$default !== void 0 ? _u$default : u["default"] = {}, (_h$svg = (h = t.toggle["default"]).svg) !== null && _h$svg !== void 0 ? _h$svg : h.svg = {}, t.toggle["default"].svg.content =
|
10052
|
+
return (r = (s = (i = t.microphone) == null ? void 0 : i["default"]) == null ? void 0 : s.text) != null && r.content || ((_t$microphone = t.microphone) !== null && _t$microphone !== void 0 ? _t$microphone : t.microphone = {}, (_o$default = (o = t.microphone)["default"]) !== null && _o$default !== void 0 ? _o$default : o["default"] = {}, (_a$svg = (a = t.microphone["default"]).svg) !== null && _a$svg !== void 0 ? _a$svg : a.svg = {}, t.microphone["default"].svg.content = In), (d = (c = (l = t.toggle) == null ? void 0 : l["default"]) == null ? void 0 : c.text) != null && d.content || ((_t$toggle = t.toggle) !== null && _t$toggle !== void 0 ? _t$toggle : t.toggle = {}, (_u$default = (u = t.toggle)["default"]) !== null && _u$default !== void 0 ? _u$default : u["default"] = {}, (_h$svg = (h = t.toggle["default"]).svg) !== null && _h$svg !== void 0 ? _h$svg : h.svg = {}, t.toggle["default"].svg.content = On, (_f$active = (f = t.toggle).active) !== null && _f$active !== void 0 ? _f$active : f.active = {}, (_m$svg = (m = t.toggle.active).svg) !== null && _m$svg !== void 0 ? _m$svg : m.svg = {}, t.toggle.active.svg.content = cs), t;
|
10022
10053
|
}
|
10023
10054
|
}, {
|
10024
10055
|
key: "createAvatar",
|
@@ -10036,7 +10067,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10036
10067
|
}, {
|
10037
10068
|
key: "changeButtonToUnavailable",
|
10038
10069
|
value: function changeButtonToUnavailable(e) {
|
10039
|
-
e.elementRef.classList.add(C.UNAVAILABLE),
|
10070
|
+
e.elementRef.classList.add(C.UNAVAILABLE), P.removeAriaBusy(e.elementRef), P.addAriaDisabled(e.elementRef), e.changeToUnavailable();
|
10040
10071
|
}
|
10041
10072
|
}, {
|
10042
10073
|
key: "changeButtonToAvailable",
|
@@ -10046,7 +10077,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10046
10077
|
}, {
|
10047
10078
|
key: "removeButtonUnavailable",
|
10048
10079
|
value: function removeButtonUnavailable(e) {
|
10049
|
-
|
10080
|
+
P.removeAriaDisabled(e.elementRef), e.elementRef.classList.remove(C.UNAVAILABLE);
|
10050
10081
|
}
|
10051
10082
|
}]);
|
10052
10083
|
}(W);
|
@@ -10728,20 +10759,20 @@ var Cs = /*#__PURE__*/function (_W9) {
|
|
10728
10759
|
}
|
10729
10760
|
}]);
|
10730
10761
|
}(W);
|
10731
|
-
var
|
10762
|
+
var Pn = /*#__PURE__*/function (_W10) {
|
10732
10763
|
// prettier-ignore
|
10733
|
-
function
|
10764
|
+
function Pn(e, t, i, s, r) {
|
10734
10765
|
var _this49;
|
10735
|
-
_classCallCheck(this,
|
10736
|
-
_this49 = _callSuper(this,
|
10766
|
+
_classCallCheck(this, Pn);
|
10767
|
+
_this49 = _callSuper(this, Pn, [e, me.buildSpeechKeyVerificationDetails(i), t, s, r]), _this49.insertKeyPlaceholderText = "Azure Speech Subscription Key", _this49.keyHelpUrl =
|
10737
10768
|
// eslint-disable-next-line max-len
|
10738
10769
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal";
|
10739
10770
|
return _this49;
|
10740
10771
|
}
|
10741
|
-
_inherits(
|
10742
|
-
return _createClass(
|
10772
|
+
_inherits(Pn, _W10);
|
10773
|
+
return _createClass(Pn);
|
10743
10774
|
}(W);
|
10744
|
-
var tt = /*#__PURE__*/function (
|
10775
|
+
var tt = /*#__PURE__*/function (_Pn) {
|
10745
10776
|
// prettier-ignore
|
10746
10777
|
function tt(e) {
|
10747
10778
|
var _a$lang, _l$name, _c$gender;
|
@@ -10759,7 +10790,7 @@ var tt = /*#__PURE__*/function (_On) {
|
|
10759
10790
|
}));
|
10760
10791
|
return _this50;
|
10761
10792
|
}
|
10762
|
-
_inherits(tt,
|
10793
|
+
_inherits(tt, _Pn);
|
10763
10794
|
return _createClass(tt, [{
|
10764
10795
|
key: "preprocessBody",
|
10765
10796
|
value: function preprocessBody(e, t) {
|
@@ -10823,14 +10854,14 @@ var tt = /*#__PURE__*/function (_On) {
|
|
10823
10854
|
return extractResultData;
|
10824
10855
|
}()
|
10825
10856
|
}]);
|
10826
|
-
}(
|
10857
|
+
}(Pn);
|
10827
10858
|
tt.HELP_LINK =
|
10828
10859
|
// eslint-disable-next-line max-len
|
10829
10860
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", tt.REGION_ERROR_MESSAGE =
|
10830
10861
|
// eslint-disable-next-line max-len
|
10831
10862
|
"Please define a region config property. [More Information](https://deepchat.dev/docs/directConnection/Azure#TextToSpeech)";
|
10832
10863
|
var ps = tt;
|
10833
|
-
var He = /*#__PURE__*/function (
|
10864
|
+
var He = /*#__PURE__*/function (_Pn2) {
|
10834
10865
|
function He(e) {
|
10835
10866
|
var _this51;
|
10836
10867
|
_classCallCheck(this, He);
|
@@ -10857,7 +10888,7 @@ var He = /*#__PURE__*/function (_On2) {
|
|
10857
10888
|
}
|
10858
10889
|
return _this51;
|
10859
10890
|
}
|
10860
|
-
_inherits(He,
|
10891
|
+
_inherits(He, _Pn2);
|
10861
10892
|
return _createClass(He, [{
|
10862
10893
|
key: "callServiceAPI",
|
10863
10894
|
value: function () {
|
@@ -10923,7 +10954,7 @@ var He = /*#__PURE__*/function (_On2) {
|
|
10923
10954
|
return !!(t != null && t[0]);
|
10924
10955
|
}
|
10925
10956
|
}]);
|
10926
|
-
}(
|
10957
|
+
}(Pn);
|
10927
10958
|
He.HELP_LINK =
|
10928
10959
|
// eslint-disable-next-line max-len
|
10929
10960
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", He.REGION_ERROR_MESSAGE =
|
@@ -11047,7 +11078,7 @@ var yt = /*#__PURE__*/function (_W12) {
|
|
11047
11078
|
s = Et.getCharacterLimitMessages(t, this.totalMessagesMaxCharLength ? this.totalMessagesMaxCharLength - this._systemMessage.content.length : -1).map(function (r) {
|
11048
11079
|
return {
|
11049
11080
|
content: yt.getContent(r),
|
11050
|
-
role: r.role ===
|
11081
|
+
role: r.role === v.USER_ROLE ? "user" : "assistant"
|
11051
11082
|
};
|
11052
11083
|
});
|
11053
11084
|
return t.find(function (r) {
|
@@ -11727,10 +11758,10 @@ var ia = /*#__PURE__*/function () {
|
|
11727
11758
|
}
|
11728
11759
|
}]);
|
11729
11760
|
}();
|
11730
|
-
var
|
11731
|
-
_classCallCheck(this,
|
11761
|
+
var Ps = /*#__PURE__*/_createClass(function Ps() {
|
11762
|
+
_classCallCheck(this, Ps);
|
11732
11763
|
});
|
11733
|
-
|
11764
|
+
Ps.attibutes = {
|
11734
11765
|
string: function string(e) {
|
11735
11766
|
return e;
|
11736
11767
|
},
|
@@ -11750,8 +11781,8 @@ Os.attibutes = {
|
|
11750
11781
|
return new Function("return ".concat(e))();
|
11751
11782
|
}
|
11752
11783
|
};
|
11753
|
-
var bs =
|
11754
|
-
function
|
11784
|
+
var bs = Ps;
|
11785
|
+
function x(n) {
|
11755
11786
|
return function (e, t) {
|
11756
11787
|
Object.defineProperty(e, t, {});
|
11757
11788
|
var i = e.constructor,
|
@@ -11820,7 +11851,7 @@ var sa = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
|
|
11820
11851
|
key: "createAudioElement",
|
11821
11852
|
value: function createAudioElement(e, t) {
|
11822
11853
|
var i = document.createElement("audio");
|
11823
|
-
return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, $e.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t ===
|
11854
|
+
return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, $e.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t === v.USER_ROLE ? "audio-player-safari-right" : "audio-player-safari-left")), i;
|
11824
11855
|
}
|
11825
11856
|
}, {
|
11826
11857
|
key: "createNewAudioMessage",
|
@@ -11965,6 +11996,7 @@ var de = /*#__PURE__*/function () {
|
|
11965
11996
|
var t, i;
|
11966
11997
|
return ue.isActiveElement((t = e.text) == null ? void 0 : t.bubbleElement.classList) || ue.isActiveElement((i = e.html) == null ? void 0 : i.bubbleElement.classList);
|
11967
11998
|
}
|
11999
|
+
// WORK - update message does not work on loaded history messages
|
11968
12000
|
// note that overwrite and 'deep-chat-temporary-message' are used to remove a message
|
11969
12001
|
}, {
|
11970
12002
|
key: "update",
|
@@ -11972,7 +12004,11 @@ var de = /*#__PURE__*/function () {
|
|
11972
12004
|
var s = e.messageToElements[i];
|
11973
12005
|
if (s) {
|
11974
12006
|
if (de.isElementActive(s[1])) return console.error("Cannot update a message that is being streamed");
|
11975
|
-
t.text && de.updateTextMessage(e, s, t.text), t.
|
12007
|
+
t.text && de.updateTextMessage(e, s, t.text), t.files ? de.updateFileMessages(e, s, t.files) : de.removeFilesMessages(e, s), t.html && de.updateHTMLMessage(e, s, t.html), !t.text && s[1].text && de.removeTextHTMLMessage(e, s, "text"), !t.html && s[1].html && de.removeTextHTMLMessage(e, s, "html");
|
12008
|
+
var r = e.messageElementRefs,
|
12009
|
+
o = e.avatars,
|
12010
|
+
a = e.names;
|
12011
|
+
v.classifyRoleMessages(r), v.resetAllRoleElements(r, !!o, !!a);
|
11976
12012
|
} else console.error("Message index not found. Please use the `getMessages` method to find the correct index");
|
11977
12013
|
}
|
11978
12014
|
}]);
|
@@ -12045,8 +12081,8 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12045
12081
|
value: function addSetupMessageIfNeeded(e, t) {
|
12046
12082
|
var i = na.getText(e, t);
|
12047
12083
|
if (i) {
|
12048
|
-
var s = this.createAndAppendNewMessageElement(i,
|
12049
|
-
this.applyCustomStyles(s,
|
12084
|
+
var s = this.createAndAppendNewMessageElement(i, v.AI_ROLE);
|
12085
|
+
this.applyCustomStyles(s, v.AI_ROLE, !1);
|
12050
12086
|
}
|
12051
12087
|
return !!i;
|
12052
12088
|
}
|
@@ -12060,7 +12096,11 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12060
12096
|
t != null && t.isWebModel() && (i !== null && i !== void 0 ? i : i = t.getIntroMessage(i));
|
12061
12097
|
var s = !(e != null && e.history) && !!(e != null && e.loadHistory || t != null && t.fetchHistory);
|
12062
12098
|
i && (Array.isArray(i) ? i.forEach(function (r, o) {
|
12063
|
-
o !== 0
|
12099
|
+
if (o !== 0) {
|
12100
|
+
var a = _this60.messageElementRefs[_this60.messageElementRefs.length - 1].innerContainer;
|
12101
|
+
v.hideRoleElements(a, !!_this60.avatars, !!_this60.names);
|
12102
|
+
}
|
12103
|
+
_this60.addIntroductoryMessage(r, s);
|
12064
12104
|
}) : this.addIntroductoryMessage(i, s));
|
12065
12105
|
}
|
12066
12106
|
}, {
|
@@ -12068,7 +12108,7 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12068
12108
|
value: function addIntroductoryMessage(e, t) {
|
12069
12109
|
var s;
|
12070
12110
|
var i;
|
12071
|
-
return e != null && e.text ? i = this.createAndAppendNewMessageElement(e.text,
|
12111
|
+
return e != null && e.text ? i = this.createAndAppendNewMessageElement(e.text, v.AI_ROLE) : e != null && e.html && (i = xe.add(this, e.html, v.AI_ROLE, this.messageElementRefs)), i && (this.applyCustomStyles(i, v.AI_ROLE, !1, (s = this.messageStyles) == null ? void 0 : s.intro), i.outerContainer.classList.add(fe.INTRO_CLASS), t && (i.outerContainer.style.display = "none")), i;
|
12072
12112
|
}
|
12073
12113
|
}, {
|
12074
12114
|
key: "removeIntroductoryMessage",
|
@@ -12081,7 +12121,7 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12081
12121
|
value: function addAnyMessage(e) {
|
12082
12122
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
12083
12123
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
12084
|
-
return e.error ? this.addNewErrorMessage("service", e.error) : this.addNewMessage(e, t, i);
|
12124
|
+
return e.error ? this.addNewErrorMessage("service", e.error, i) : this.addNewMessage(e, t, i);
|
12085
12125
|
}
|
12086
12126
|
// this should not be activated by streamed messages
|
12087
12127
|
}, {
|
@@ -12093,7 +12133,7 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12093
12133
|
r = {
|
12094
12134
|
status: e.overwrite
|
12095
12135
|
};
|
12096
|
-
if (!e.ignoreText && s.text !== void 0 && e.text !== null && (this.addNewTextMessage(s.text, s.role, r, i), !t && this.textToSpeech && s.role !==
|
12136
|
+
if (!e.ignoreText && s.text !== void 0 && e.text !== null && (this.addNewTextMessage(s.text, s.role, r, i), !t && this.textToSpeech && s.role !== v.USER_ROLE && vt.speak(s.text, this.textToSpeech)), s.files && Array.isArray(s.files) && Bi.addMessages(this, s.files, s.role, i), s.html !== void 0 && s.html !== null) {
|
12097
12137
|
var o = xe.add(this, s.html, s.role, this.messageElementRefs, r, i);
|
12098
12138
|
Ne.isElementTemporary(o) && delete s.html;
|
12099
12139
|
}
|
@@ -12110,7 +12150,7 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12110
12150
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
12111
12151
|
var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
12112
12152
|
if (!t) {
|
12113
|
-
var r =
|
12153
|
+
var r = v.generateMessageBody(e, this.messageElementRefs);
|
12114
12154
|
this.messageToElements.push([e, r]);
|
12115
12155
|
}
|
12116
12156
|
i && this.sendClientUpdate(e, s);
|
@@ -12132,10 +12172,10 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12132
12172
|
this.removeMessageOnError();
|
12133
12173
|
var s = this.getPermittedMessage(t) || ((c = this._errorMessageOverrides) == null ? void 0 : c[e]) || ((d = this._errorMessageOverrides) == null ? void 0 : d["default"]) || "Error, please try again.",
|
12134
12174
|
r = this.createMessageElementsOnOrientation(s, "error", i);
|
12135
|
-
|
12175
|
+
v.hideRoleElements(r.innerContainer, !!this.avatars, !!this.names);
|
12136
12176
|
var o = r.bubbleElement,
|
12137
12177
|
a = r.outerContainer;
|
12138
|
-
o.classList.add(
|
12178
|
+
o.classList.add(v.ERROR_MESSAGE_TEXT_CLASS), this.renderText(o, s);
|
12139
12179
|
var l = Q.extractParticularSharedStyles(["fontSize", "fontFamily"], (u = this.messageStyles) == null ? void 0 : u["default"]);
|
12140
12180
|
Q.applyCustomStylesToElements(r, !1, l), Q.applyCustomStylesToElements(r, !1, (h = this.messageStyles) == null ? void 0 : h.error), i || this.appendOuterContainerElemet(a), this.textToSpeech && vt.speak(s, this.textToSpeech), (f = this._onError) == null || f.call(this, s);
|
12141
12181
|
}
|
@@ -12159,16 +12199,16 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12159
12199
|
}, {
|
12160
12200
|
key: "removeError",
|
12161
12201
|
value: function removeError() {
|
12162
|
-
this.isLastMessageError() &&
|
12202
|
+
this.isLastMessageError() && v.getLastMessageElement(this.elementRef).remove();
|
12163
12203
|
}
|
12164
12204
|
}, {
|
12165
12205
|
key: "addDefaultLoadingMessage",
|
12166
12206
|
value: function addDefaultLoadingMessage() {
|
12167
|
-
var e = this.createMessageElements("",
|
12207
|
+
var e = this.createMessageElements("", v.AI_ROLE),
|
12168
12208
|
t = e.bubbleElement;
|
12169
|
-
e.bubbleElement.classList.add(
|
12209
|
+
e.bubbleElement.classList.add(Pe.DOTS_CONTAINER_CLASS);
|
12170
12210
|
var i = document.createElement("div");
|
12171
|
-
return i.classList.add("loading-message-dots"), t.appendChild(i),
|
12211
|
+
return i.classList.add("loading-message-dots"), t.appendChild(i), Pe.setDots(t, this.messageStyles), e;
|
12172
12212
|
}
|
12173
12213
|
}, {
|
12174
12214
|
key: "addLoadingMessage",
|
@@ -12178,8 +12218,8 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12178
12218
|
var t = this.messageElementRefs[this.messageElementRefs.length - 1];
|
12179
12219
|
if (fe.isLoadingMessage(t) || !e && !this._isLoadingMessageAllowed) return;
|
12180
12220
|
var i = (a = (o = (r = this.messageStyles) == null ? void 0 : r.loading) == null ? void 0 : o.message) == null ? void 0 : a.html,
|
12181
|
-
s = i ? xe.createElements(this, i,
|
12182
|
-
this.appendOuterContainerElemet(s.outerContainer), s.bubbleElement.classList.add(
|
12221
|
+
s = i ? xe.createElements(this, i, v.AI_ROLE, !1) : this.addDefaultLoadingMessage();
|
12222
|
+
this.appendOuterContainerElemet(s.outerContainer), s.bubbleElement.classList.add(Pe.BUBBLE_CLASS), this.applyCustomStyles(s, v.AI_ROLE, !1, (d = (c = (l = this.messageStyles) == null ? void 0 : l.loading) == null ? void 0 : c.message) == null ? void 0 : d.styles), this.focusMode || ee.scrollToBottom(this.elementRef);
|
12183
12223
|
}
|
12184
12224
|
}, {
|
12185
12225
|
key: "populateIntroPanel",
|
@@ -12238,7 +12278,7 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12238
12278
|
}), Array.from(this.elementRef.children).forEach(function (a) {
|
12239
12279
|
var c;
|
12240
12280
|
var l = (c = a.children[0]) == null ? void 0 : c.children[0];
|
12241
|
-
l != null && l.classList.contains(
|
12281
|
+
l != null && l.classList.contains(v.ERROR_MESSAGE_TEXT_CLASS) && a.remove();
|
12242
12282
|
}), this.messageElementRefs = i;
|
12243
12283
|
var s = this.messageToElements.filter(function (a) {
|
12244
12284
|
return a[1].text && ue.isActiveElement(a[1].text.bubbleElement.classList) || a[1].html && ue.isActiveElement(a[1].html.bubbleElement.classList);
|
@@ -12264,7 +12304,7 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12264
12304
|
}, {
|
12265
12305
|
key: "isActiveElement",
|
12266
12306
|
value: function isActiveElement(e) {
|
12267
|
-
return e ? e.contains(
|
12307
|
+
return e ? e.contains(Pe.BUBBLE_CLASS) || e.contains(De.CLASS) || e.contains(Ae.MESSAGE_CLASS) : !1;
|
12268
12308
|
}
|
12269
12309
|
}]);
|
12270
12310
|
}(fe);
|
@@ -12454,7 +12494,7 @@ var Nn = "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W
|
|
12454
12494
|
r = t.dropupText,
|
12455
12495
|
o = document.createElement("div");
|
12456
12496
|
if (Object.assign(o.style, (a = i == null ? void 0 : i.item) == null ? void 0 : a["default"]), _e.populateItem(s, o, r, i), o.classList.add(_e.MENU_ITEM_CLASS), s.classList.contains(Ke.BUTTOM_CLASS)) t.setDropupItem(o);else {
|
12457
|
-
var l =
|
12497
|
+
var l = O.processStateful((i == null ? void 0 : i.item) || {}, {
|
12458
12498
|
backgroundColor: "#f3f3f3"
|
12459
12499
|
}, {
|
12460
12500
|
backgroundColor: "#ebebeb"
|
@@ -12531,7 +12571,7 @@ var bt = /*#__PURE__*/function (_ct2) {
|
|
12531
12571
|
key: "assignDropupItemStyle",
|
12532
12572
|
value: function assignDropupItemStyle(e) {
|
12533
12573
|
this.elementRef.parentElement && this._originalElementRef && (this.elementRef = ie.replaceElementWithNewClone(this.elementRef, this._originalElementRef)), Object.assign(this.elementRef.style, e.item["default"]);
|
12534
|
-
var t =
|
12574
|
+
var t = O.processStateful(e.item, e.item.hover || {}, e.item.click || {});
|
12535
12575
|
Ge.add(this.elementRef, t), this.addClickListener();
|
12536
12576
|
var i = this.elementRef.children[0];
|
12537
12577
|
i.classList.contains("text-button") || Object.assign(i.style, e.iconContainer);
|
@@ -12540,18 +12580,18 @@ var bt = /*#__PURE__*/function (_ct2) {
|
|
12540
12580
|
key: "changeToDefault",
|
12541
12581
|
value: function changeToDefault(e) {
|
12542
12582
|
var t, i, s, r;
|
12543
|
-
!e && this._state === "default" || (this.elementRef.classList.contains(Ve.MENU_ITEM_CLASS) ? this.assignDropupItemStyle(this._dropupStyles["default"]) : (this.elementRef.replaceChildren(this._innerElements["default"]), (t = this._customStyles) != null && t.active && D.unsetAllCSS(this.elementRef, (i = this._customStyles) == null ? void 0 : i.active), (s = this._customStyles) != null && s.disabled && D.unsetAllCSS(this.elementRef, (r = this._customStyles) == null ? void 0 : r.disabled), this.reapplyStateStyle("default", ["active", "disabled"])),
|
12583
|
+
!e && this._state === "default" || (this.elementRef.classList.contains(Ve.MENU_ITEM_CLASS) ? this.assignDropupItemStyle(this._dropupStyles["default"]) : (this.elementRef.replaceChildren(this._innerElements["default"]), (t = this._customStyles) != null && t.active && D.unsetAllCSS(this.elementRef, (i = this._customStyles) == null ? void 0 : i.active), (s = this._customStyles) != null && s.disabled && D.unsetAllCSS(this.elementRef, (r = this._customStyles) == null ? void 0 : r.disabled), this.reapplyStateStyle("default", ["active", "disabled"])), P.removeAriaDisabled(this.elementRef), this._state = "default");
|
12544
12584
|
}
|
12545
12585
|
}, {
|
12546
12586
|
key: "changeToActive",
|
12547
12587
|
value: function changeToActive(e) {
|
12548
|
-
!e && this._state === "active" || (this.elementRef.classList.contains(Ve.MENU_ITEM_CLASS) ? this.assignDropupItemStyle(this._dropupStyles.active) : (this.elementRef.replaceChildren(this._innerElements.active), this.reapplyStateStyle("active", ["disabled", "default"])),
|
12588
|
+
!e && this._state === "active" || (this.elementRef.classList.contains(Ve.MENU_ITEM_CLASS) ? this.assignDropupItemStyle(this._dropupStyles.active) : (this.elementRef.replaceChildren(this._innerElements.active), this.reapplyStateStyle("active", ["disabled", "default"])), P.removeAriaDisabled(this.elementRef), this._state = "active");
|
12549
12589
|
}
|
12550
12590
|
}, {
|
12551
12591
|
key: "changeToDisabled",
|
12552
12592
|
value: function changeToDisabled(e) {
|
12553
12593
|
var t, i, s, r;
|
12554
|
-
!e && this._state === "disabled" || (this.elementRef.classList.contains(Ve.MENU_ITEM_CLASS) ? (this.elementRef.classList.add(Ve.DISABLED_ITEM_CLASS), this.assignDropupItemStyle(this._dropupStyles.disabled)) : (this.elementRef.replaceChildren(this._innerElements.disabled), (t = this._customStyles) != null && t.active && D.unsetAllCSS(this.elementRef, (i = this._customStyles) == null ? void 0 : i.active), (s = this._customStyles) != null && s["default"] && D.unsetAllCSS(this.elementRef, (r = this._customStyles) == null ? void 0 : r["default"]), this.reapplyStateStyle("disabled", ["default", "active"])),
|
12594
|
+
!e && this._state === "disabled" || (this.elementRef.classList.contains(Ve.MENU_ITEM_CLASS) ? (this.elementRef.classList.add(Ve.DISABLED_ITEM_CLASS), this.assignDropupItemStyle(this._dropupStyles.disabled)) : (this.elementRef.replaceChildren(this._innerElements.disabled), (t = this._customStyles) != null && t.active && D.unsetAllCSS(this.elementRef, (i = this._customStyles) == null ? void 0 : i.active), (s = this._customStyles) != null && s["default"] && D.unsetAllCSS(this.elementRef, (r = this._customStyles) == null ? void 0 : r["default"]), this.reapplyStateStyle("disabled", ["default", "active"])), P.addAriaDisabled(this.elementRef), this._state = "disabled");
|
12555
12595
|
}
|
12556
12596
|
}, {
|
12557
12597
|
key: "setDropupItem",
|
@@ -13146,13 +13186,13 @@ function Bn() {
|
|
13146
13186
|
}();
|
13147
13187
|
return It.AutoScroll = n, It;
|
13148
13188
|
}
|
13149
|
-
var
|
13189
|
+
var Ot = {},
|
13150
13190
|
on;
|
13151
13191
|
function Wi() {
|
13152
|
-
if (on) return
|
13153
|
-
on = 1, Object.defineProperty(
|
13192
|
+
if (on) return Ot;
|
13193
|
+
on = 1, Object.defineProperty(Ot, "__esModule", {
|
13154
13194
|
value: !0
|
13155
|
-
}),
|
13195
|
+
}), Ot.Elements = void 0;
|
13156
13196
|
var n = /*#__PURE__*/function () {
|
13157
13197
|
function n() {
|
13158
13198
|
_classCallCheck(this, n);
|
@@ -13199,15 +13239,15 @@ function Wi() {
|
|
13199
13239
|
}
|
13200
13240
|
}]);
|
13201
13241
|
}();
|
13202
|
-
return
|
13242
|
+
return Ot.Elements = n, Ot;
|
13203
13243
|
}
|
13204
|
-
var
|
13244
|
+
var Pt = {},
|
13205
13245
|
an;
|
13206
13246
|
function Ji() {
|
13207
|
-
if (an) return
|
13208
|
-
an = 1, Object.defineProperty(
|
13247
|
+
if (an) return Pt;
|
13248
|
+
an = 1, Object.defineProperty(Pt, "__esModule", {
|
13209
13249
|
value: !0
|
13210
|
-
}),
|
13250
|
+
}), Pt.Cursor = void 0;
|
13211
13251
|
var n = /*#__PURE__*/function () {
|
13212
13252
|
function n() {
|
13213
13253
|
_classCallCheck(this, n);
|
@@ -13288,7 +13328,7 @@ function Ji() {
|
|
13288
13328
|
}
|
13289
13329
|
}]);
|
13290
13330
|
}();
|
13291
|
-
return
|
13331
|
+
return Pt.Cursor = n, Pt;
|
13292
13332
|
}
|
13293
13333
|
var ln;
|
13294
13334
|
function Fn() {
|
@@ -13363,32 +13403,32 @@ function Fn() {
|
|
13363
13403
|
var p = a.commands;
|
13364
13404
|
if (!p || !d || !c) return;
|
13365
13405
|
var g = ((h = p.settings) === null || h === void 0 ? void 0 : h.caseSensitive) === !0 ? l : l.toLowerCase(),
|
13366
|
-
|
13406
|
+
y = s.Text.breakupIntoWordsArr(g),
|
13367
13407
|
R = ((f = p.settings) === null || f === void 0 ? void 0 : f.substrings) === !1 ? r.checkIfMatchesWord : r.checkIfMatchesSubstring;
|
13368
|
-
if (p.commandMode && R(p.commandMode, g,
|
13408
|
+
if (p.commandMode && R(p.commandMode, g, y)) return a.setInterimColorToFinal(), setTimeout(function () {
|
13369
13409
|
return r.toggleCommandModeOn(a);
|
13370
13410
|
}), {
|
13371
13411
|
doNotProcessTranscription: !1
|
13372
13412
|
};
|
13373
13413
|
if (!(p.commandMode && !a.isWaitingForCommand)) {
|
13374
|
-
if (p.stop && R(p.stop, g,
|
13414
|
+
if (p.stop && R(p.stop, g, y)) return r.toggleCommandModeOff(a), setTimeout(function () {
|
13375
13415
|
return a.stop();
|
13376
13416
|
}), {
|
13377
13417
|
doNotProcessTranscription: !1
|
13378
13418
|
};
|
13379
|
-
if (p.pause && R(p.pause, g,
|
13419
|
+
if (p.pause && R(p.pause, g, y)) return r.toggleCommandModeOff(a), a.setInterimColorToFinal(), setTimeout(function () {
|
13380
13420
|
var B;
|
13381
13421
|
a.isPaused = !0, (B = a.onPauseTrigger) === null || B === void 0 || B.call(a, !0);
|
13382
13422
|
}), {
|
13383
13423
|
doNotProcessTranscription: !1
|
13384
13424
|
};
|
13385
|
-
if (p.resume && R(p.resume, g,
|
13425
|
+
if (p.resume && R(p.resume, g, y)) return a.isPaused = !1, (m = a.onPauseTrigger) === null || m === void 0 || m.call(a, !1), r.toggleCommandModeOff(a), a.resetRecording(c), {
|
13386
13426
|
doNotProcessTranscription: !0
|
13387
13427
|
};
|
13388
|
-
if (p.reset && R(p.reset, g,
|
13428
|
+
if (p.reset && R(p.reset, g, y)) return u !== void 0 && r.setText(a, c, u, d), {
|
13389
13429
|
doNotProcessTranscription: !0
|
13390
13430
|
};
|
13391
|
-
if (p.removeAllText && R(p.removeAllText, g,
|
13431
|
+
if (p.removeAllText && R(p.removeAllText, g, y)) return r.setText(a, c, "", d), {
|
13392
13432
|
doNotProcessTranscription: !0
|
13393
13433
|
};
|
13394
13434
|
}
|
@@ -13551,8 +13591,8 @@ function Un() {
|
|
13551
13591
|
value: function prepareBeforeStart(h) {
|
13552
13592
|
var f, m;
|
13553
13593
|
if (h != null && h.element) if (n.EventListeners.add(this, h), Array.isArray(h.element)) {
|
13554
|
-
var g = h.element.find(function (
|
13555
|
-
return
|
13594
|
+
var g = h.element.find(function (y) {
|
13595
|
+
return y === document.activeElement;
|
13556
13596
|
}) || h.element[0];
|
13557
13597
|
if (!g) return;
|
13558
13598
|
this.prepare(g);
|
@@ -13580,9 +13620,9 @@ function Un() {
|
|
13580
13620
|
var g = c.Text.capitalize(f);
|
13581
13621
|
if (this.finalTranscript === g && h === "") return;
|
13582
13622
|
e.PreResultUtils.process(this, m, h === "", this._onPreResult, this._options) && (h = "", m = "");
|
13583
|
-
var
|
13584
|
-
if (
|
13585
|
-
if (
|
13623
|
+
var y = this.commands && t.CommandUtils.execCommand(this, m, this._options, this._primitiveElement || this._genericElement, this._originalText);
|
13624
|
+
if (y) {
|
13625
|
+
if (y.doNotProcessTranscription) return;
|
13586
13626
|
h = "", m = "";
|
13587
13627
|
}
|
13588
13628
|
if (this.isPaused || this.isWaitingForCommand) return;
|
@@ -13611,8 +13651,8 @@ function Un() {
|
|
13611
13651
|
this.finalSpan.innerHTML = p;
|
13612
13652
|
var g = i.AutoScroll.isRequired(this.autoScroll, h);
|
13613
13653
|
i.AutoScroll.changeStateIfNeeded(this, g);
|
13614
|
-
var
|
13615
|
-
this.interimSpan.innerHTML =
|
13654
|
+
var y = c.Text.lineBreak(f) + (m ? "" : this.endPadding);
|
13655
|
+
this.interimSpan.innerHTML = y, a.Browser.IS_SAFARI() && this.insertInCursorLocation && l.Cursor.setOffsetForSafariGeneric(h, p.length + y.length), g && i.AutoScroll.scrollGeneric(this, h), m && (this.scrollingSpan.innerHTML = "");
|
13616
13656
|
}
|
13617
13657
|
}, {
|
13618
13658
|
key: "finalise",
|
@@ -14320,32 +14360,32 @@ var ti = /*#__PURE__*/function (_li) {
|
|
14320
14360
|
}(li);
|
14321
14361
|
ti.MICROPHONE_RESET_TIMEOUT_MS = 300;
|
14322
14362
|
var ci = ti;
|
14323
|
-
var
|
14363
|
+
var Oe = /*#__PURE__*/function () {
|
14324
14364
|
// prettier-ignore
|
14325
|
-
function
|
14365
|
+
function Oe(e, t, i, s) {
|
14326
14366
|
var _this75 = this;
|
14327
|
-
_classCallCheck(this,
|
14367
|
+
_classCallCheck(this, Oe);
|
14328
14368
|
this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", t.maxNumberOfFiles && (this._fileCountLimit = t.maxNumberOfFiles), this._toggleContainerDisplay = i, this._fileAttachmentsContainerRef = s, t.acceptedFormats && (this._acceptedFormat = t.acceptedFormats), setTimeout(function () {
|
14329
14369
|
_this75._validationHandler = e._validationHandler;
|
14330
14370
|
});
|
14331
14371
|
}
|
14332
|
-
return _createClass(
|
14372
|
+
return _createClass(Oe, [{
|
14333
14373
|
key: "attemptAddFile",
|
14334
14374
|
value: function attemptAddFile(e, t) {
|
14335
|
-
return
|
14375
|
+
return Oe.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), !0) : !1;
|
14336
14376
|
}
|
14337
14377
|
}, {
|
14338
14378
|
key: "addAttachmentBasedOnType",
|
14339
14379
|
value: function addAttachmentBasedOnType(e, t, i) {
|
14340
|
-
var s =
|
14380
|
+
var s = Oe.getTypeFromBlob(e);
|
14341
14381
|
if (s === "image") {
|
14342
|
-
var r =
|
14382
|
+
var r = Oe.createImageAttachment(t);
|
14343
14383
|
this.addFileAttachment(e, "image", r, i);
|
14344
14384
|
} else if (s === "audio") {
|
14345
14385
|
var _r2 = di.createAudioAttachment(t);
|
14346
14386
|
this.addFileAttachment(e, "audio", _r2, i);
|
14347
14387
|
} else {
|
14348
|
-
var _r3 =
|
14388
|
+
var _r3 = Oe.createAnyFileAttachment(e.name);
|
14349
14389
|
this.addFileAttachment(e, "any", _r3, i);
|
14350
14390
|
}
|
14351
14391
|
}
|
@@ -14353,7 +14393,7 @@ var Pe = /*#__PURE__*/function () {
|
|
14353
14393
|
key: "addFileAttachment",
|
14354
14394
|
value: function addFileAttachment(e, t, i, s) {
|
14355
14395
|
var a;
|
14356
|
-
var r =
|
14396
|
+
var r = Oe.createContainer(i);
|
14357
14397
|
if (this._attachments.length >= this._fileCountLimit) {
|
14358
14398
|
var l = this._attachments[this._attachments.length - 1].removeButton;
|
14359
14399
|
l == null || l.click();
|
@@ -14453,13 +14493,13 @@ var Pe = /*#__PURE__*/function () {
|
|
14453
14493
|
}
|
14454
14494
|
}]);
|
14455
14495
|
}();
|
14456
|
-
var Le = /*#__PURE__*/function (
|
14496
|
+
var Le = /*#__PURE__*/function (_Oe) {
|
14457
14497
|
// prettier-ignore
|
14458
14498
|
function Le(e, t, i, s) {
|
14459
14499
|
_classCallCheck(this, Le);
|
14460
14500
|
return _callSuper(this, Le, [e, t, i, s]);
|
14461
14501
|
}
|
14462
|
-
_inherits(Le,
|
14502
|
+
_inherits(Le, _Oe);
|
14463
14503
|
return _createClass(Le, [{
|
14464
14504
|
key: "createTimer",
|
14465
14505
|
value: function createTimer(e, t) {
|
@@ -14538,7 +14578,7 @@ var Le = /*#__PURE__*/function (_Pe) {
|
|
14538
14578
|
var i = e.parentElement ? ee.cloneElement(e) : e,
|
14539
14579
|
s = document.createElement("audio");
|
14540
14580
|
s.src = t;
|
14541
|
-
var r = $.createSVGElement(
|
14581
|
+
var r = $.createSVGElement(On);
|
14542
14582
|
r.classList.add("attachment-icon", "play-icon");
|
14543
14583
|
var o = $.createSVGElement(cs);
|
14544
14584
|
o.classList.add("attachment-icon", "stop-icon"), i.replaceChildren(r), s.onplay = function () {
|
@@ -14564,7 +14604,7 @@ var Le = /*#__PURE__*/function (_Pe) {
|
|
14564
14604
|
(s = (i = (t = e.children[0]) == null ? void 0 : t.children) == null ? void 0 : i[0]) != null && s.classList.contains("stop-icon") && e.children[0].click();
|
14565
14605
|
}
|
14566
14606
|
}]);
|
14567
|
-
}(
|
14607
|
+
}(Oe);
|
14568
14608
|
Le.TIMER_LIMIT_S = 5999;
|
14569
14609
|
var di = Le;
|
14570
14610
|
var Ma = /*#__PURE__*/function () {
|
@@ -14576,7 +14616,7 @@ var Ma = /*#__PURE__*/function () {
|
|
14576
14616
|
value:
|
14577
14617
|
// prettier-ignore
|
14578
14618
|
function create(e, t, i, s, r) {
|
14579
|
-
return r === "audio" ? new di(e, t, i, s) : new
|
14619
|
+
return r === "audio" ? new di(e, t, i, s) : new Oe(e, t, i, s);
|
14580
14620
|
}
|
14581
14621
|
}]);
|
14582
14622
|
}();
|
@@ -14696,7 +14736,7 @@ var ve = /*#__PURE__*/function () {
|
|
14696
14736
|
e[_key2] = arguments[_key2];
|
14697
14737
|
}
|
14698
14738
|
e.forEach(function (t) {
|
14699
|
-
|
14739
|
+
P.addAttributes(t), _this78._buttonPanel.appendChild(t);
|
14700
14740
|
});
|
14701
14741
|
}
|
14702
14742
|
}, {
|
@@ -14796,13 +14836,13 @@ var Jt = /*#__PURE__*/function (_ct5) {
|
|
14796
14836
|
function Jt(e, t, i, s, r, o) {
|
14797
14837
|
var _this81;
|
14798
14838
|
_classCallCheck(this, Jt);
|
14799
|
-
var u, h, f, m, p, g,
|
14839
|
+
var u, h, f, m, p, g, y, R, B;
|
14800
14840
|
var a = (u = i == null ? void 0 : i.button) == null ? void 0 : u.position,
|
14801
14841
|
l = ((m = (f = (h = i == null ? void 0 : i.button) == null ? void 0 : h.styles) == null ? void 0 : f.text) == null ? void 0 : m.content) || o;
|
14802
14842
|
_this81 = _callSuper(this, Jt, [Jt.createButtonElement(), a, i.button, l]);
|
14803
14843
|
var c = a === "dropup-menu",
|
14804
14844
|
d = _this81.createInnerElements(s, r, _this81._customStyles, c);
|
14805
|
-
_this81._inputElement = Jt.createInputElement((p = i == null ? void 0 : i.files) == null ? void 0 : p.acceptedFormats), _this81.addClickEvent(e, i), _this81.elementRef.replaceChildren(d.styles), _this81.reapplyStateStyle("styles"), _this81._fileAttachmentsType = t, _this81._openModalOnce = ((
|
14845
|
+
_this81._inputElement = Jt.createInputElement((p = i == null ? void 0 : i.files) == null ? void 0 : p.acceptedFormats), _this81.addClickEvent(e, i), _this81.elementRef.replaceChildren(d.styles), _this81.reapplyStateStyle("styles"), _this81._fileAttachmentsType = t, _this81._openModalOnce = ((y = (g = i.files) == null ? void 0 : g.infoModal) == null ? void 0 : y.openModalOnce) === !1 || (B = (R = i.files) == null ? void 0 : R.infoModal) == null ? void 0 : B.openModalOnce;
|
14806
14846
|
return _this81;
|
14807
14847
|
}
|
14808
14848
|
_inherits(Jt, _ct5);
|
@@ -15254,7 +15294,7 @@ var I = /*#__PURE__*/function (_ct6) {
|
|
15254
15294
|
e.files && (t.files = Array.from(e.files).map(function (i) {
|
15255
15295
|
return {
|
15256
15296
|
file: i,
|
15257
|
-
type:
|
15297
|
+
type: Oe.getTypeFromBlob(i)
|
15258
15298
|
};
|
15259
15299
|
})), setTimeout(function () {
|
15260
15300
|
return _this88.attemptSubmit(t, !0);
|
@@ -15342,7 +15382,7 @@ var I = /*#__PURE__*/function (_ct6) {
|
|
15342
15382
|
case 0:
|
15343
15383
|
e = _ref41.text, t = _ref41.files;
|
15344
15384
|
i = {
|
15345
|
-
role:
|
15385
|
+
role: v.USER_ROLE
|
15346
15386
|
};
|
15347
15387
|
e && (i.text = e);
|
15348
15388
|
_context136.t0 = t;
|
@@ -15377,19 +15417,19 @@ var I = /*#__PURE__*/function (_ct6) {
|
|
15377
15417
|
}, {
|
15378
15418
|
key: "changeToStopIcon",
|
15379
15419
|
value: function changeToStopIcon() {
|
15380
|
-
this._serviceIO.websocket || (this.elementRef.classList.remove(I.LOADING_CLASS, I.DISABLED_CLASS, I.SUBMIT_CLASS),
|
15420
|
+
this._serviceIO.websocket || (this.elementRef.classList.remove(I.LOADING_CLASS, I.DISABLED_CLASS, I.SUBMIT_CLASS), P.removeAriaAttributes(this.elementRef), this.elementRef.replaceChildren(this._innerElements.stop), this.reapplyStateStyle("stop", ["loading", "submit"]), this.elementRef.onclick = this.stopStream.bind(this), this.status.loadingActive = !1);
|
15381
15421
|
}
|
15382
15422
|
}, {
|
15383
15423
|
key: "changeToLoadingIcon",
|
15384
15424
|
value: function changeToLoadingIcon() {
|
15385
|
-
this._serviceIO.websocket || (this._isSVGLoadingIconOverriden || this.elementRef.replaceChildren(this._innerElements.loading), this.elementRef.classList.remove(I.SUBMIT_CLASS, I.DISABLED_CLASS),
|
15425
|
+
this._serviceIO.websocket || (this._isSVGLoadingIconOverriden || this.elementRef.replaceChildren(this._innerElements.loading), this.elementRef.classList.remove(I.SUBMIT_CLASS, I.DISABLED_CLASS), P.removeAriaDisabled(this.elementRef), this.elementRef.classList.add(I.LOADING_CLASS), P.addAriaBusy(this.elementRef), this.reapplyStateStyle("loading", ["submit"]), this.elementRef.onclick = function () {}, this.status.requestInProgress = !0, this.status.loadingActive = !0);
|
15386
15426
|
}
|
15387
15427
|
// called every time when user triggers an input via ValidationHandler - hence use class to check if not already present
|
15388
15428
|
}, {
|
15389
15429
|
key: "changeToSubmitIcon",
|
15390
15430
|
value: function changeToSubmitIcon() {
|
15391
15431
|
var _this89 = this;
|
15392
|
-
this.elementRef.classList.contains(I.SUBMIT_CLASS) || (this.elementRef.classList.remove(I.LOADING_CLASS, I.DISABLED_CLASS),
|
15432
|
+
this.elementRef.classList.contains(I.SUBMIT_CLASS) || (this.elementRef.classList.remove(I.LOADING_CLASS, I.DISABLED_CLASS), P.removeAriaAttributes(this.elementRef), this.elementRef.classList.add(I.SUBMIT_CLASS), this.elementRef.replaceChildren(this._innerElements.submit), st.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = function () {
|
15393
15433
|
var e;
|
15394
15434
|
_this89.submitFromInput(), (e = _this89._microphoneButton) != null && e.isActive && ci.toggleSpeechAfterSubmit(_this89._microphoneButton.elementRef, !!_this89._stopSTTAfterSubmit);
|
15395
15435
|
});
|
@@ -15399,7 +15439,7 @@ var I = /*#__PURE__*/function (_ct6) {
|
|
15399
15439
|
key: "changeToDisabledIcon",
|
15400
15440
|
value: function changeToDisabledIcon() {
|
15401
15441
|
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
15402
|
-
this._alwaysEnabled && !e ? this.changeToSubmitIcon() : this.elementRef.classList.contains(I.DISABLED_CLASS) || (this.elementRef.classList.remove(I.LOADING_CLASS, I.SUBMIT_CLASS),
|
15442
|
+
this._alwaysEnabled && !e ? this.changeToSubmitIcon() : this.elementRef.classList.contains(I.DISABLED_CLASS) || (this.elementRef.classList.remove(I.LOADING_CLASS, I.SUBMIT_CLASS), P.removeAriaBusy(this.elementRef), this.elementRef.classList.add(I.DISABLED_CLASS), P.addAriaDisabled(this.elementRef), this.elementRef.replaceChildren(this._innerElements.disabled), this.reapplyStateStyle("disabled", ["submit"]), this.elementRef.onclick = function () {});
|
15403
15443
|
}
|
15404
15444
|
}, {
|
15405
15445
|
key: "disableSubmitButton",
|
@@ -15437,8 +15477,8 @@ I.SUBMIT_CLASS = "submit-button", I.LOADING_CLASS = "loading-button", I.DISABLED
|
|
15437
15477
|
var ys = I;
|
15438
15478
|
var La = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M27.1 14.313V5.396L24.158 8.34c-2.33-2.325-5.033-3.503-8.11-3.503C9.902 4.837 4.901 9.847 4.899 16c.001 6.152 5.003 11.158 11.15 11.16 4.276 0 9.369-2.227 10.836-8.478l.028-.122h-3.23l-.022.068c-1.078 3.242-4.138 5.421-7.613 5.421a8 8 0 0 1-5.691-2.359A7.993 7.993 0 0 1 8 16.001c0-4.438 3.611-8.049 8.05-8.049 2.069 0 3.638.58 5.924 2.573l-3.792 3.789H27.1z\"/>\n</svg>\n",
|
15439
15479
|
Ia = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>capture</title>\n <path d=\"M0 16q0 3.264 1.28 6.208t3.392 5.12 5.12 3.424 6.208 1.248 6.208-1.248 5.12-3.424 3.392-5.12 1.28-6.208-1.28-6.208-3.392-5.12-5.088-3.392-6.24-1.28q-3.264 0-6.208 1.28t-5.12 3.392-3.392 5.12-1.28 6.208zM4 16q0-3.264 1.6-6.016t4.384-4.352 6.016-1.632 6.016 1.632 4.384 4.352 1.6 6.016-1.6 6.048-4.384 4.352-6.016 1.6-6.016-1.6-4.384-4.352-1.6-6.048z\"></path>\n</svg>\n",
|
15440
|
-
|
15441
|
-
|
15480
|
+
Oa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z\"/>\n</svg>",
|
15481
|
+
Pa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M4.89163 13.2687L9.16582 17.5427L18.7085 8\" stroke=\"#000000\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
|
15442
15482
|
var Ls = /*#__PURE__*/function (_it) {
|
15443
15483
|
// prettier-ignore
|
15444
15484
|
function Ls(e, t, i, s) {
|
@@ -15457,9 +15497,9 @@ var Ls = /*#__PURE__*/function (_it) {
|
|
15457
15497
|
value: function addButtonsAndTheirEvents(e) {
|
15458
15498
|
var t = it.createSVGButton(Ia);
|
15459
15499
|
t.classList.add("modal-svg-camera-button"), t.children[0].classList.add("modal-svg-camera-icon");
|
15460
|
-
var i = this.addCloseButton(
|
15500
|
+
var i = this.addCloseButton(Oa, !0);
|
15461
15501
|
i.classList.add("modal-svg-close-button"), i.children[0].classList.add("modal-svg-close-icon");
|
15462
|
-
var s = it.createSVGButton(
|
15502
|
+
var s = it.createSVGButton(Pa);
|
15463
15503
|
return s.classList.add("modal-svg-submit-button"), this.addButtons(t, s), this.addButtonEvents(t, i, s, e), {
|
15464
15504
|
captureButton: t,
|
15465
15505
|
submitButton: s
|
@@ -15700,7 +15740,7 @@ var Is = /*#__PURE__*/function () {
|
|
15700
15740
|
}();
|
15701
15741
|
var Da = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#loading-validate-key-property{display:inline-block;width:50px;height:50px}#loading-validate-key-property:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:loading-spinner 1.4s linear infinite}#deep-chat-openai-realtime-container{height:100%;width:100%}#deep-chat-openai-realtime-avatar-container{height:60%;width:100%;display:flex;justify-content:center;align-items:center}#deep-chat-openai-realtime-avatar{border-radius:50%;height:110px;border:1px solid rgb(215,215,215);padding:8px;-webkit-user-select:none;user-select:none;margin-top:20px}#deep-chat-openai-realtime-buttons-container{height:40%;display:flex;position:relative}.deep-chat-openai-realtime-button-container{height:100%;width:50%;display:flex;justify-content:center;align-items:center}.deep-chat-openai-realtime-button{width:70px;height:70px;border-radius:50%;display:flex;justify-content:center;align-items:center;cursor:pointer}.deep-chat-openai-realtime-button-default{background-color:#e3e3e3}.deep-chat-openai-realtime-button-default:hover{background-color:#d4d4d4}.deep-chat-openai-realtime-button-default:active{background-color:#c5c5c5}.deep-chat-openai-realtime-button-loading{opacity:.7;pointer-events:none}.deep-chat-openai-realtime-mute-active{background-color:#ffe7e7}.deep-chat-openai-realtime-mute-active:hover{background-color:#ffdede}.deep-chat-openai-realtime-mute-active:active{background-color:#ffd2d2}.deep-chat-openai-realtime-mute>*{height:30px;width:30px}.deep-chat-openai-realtime-mute-active>*{filter:brightness(0) saturate(100%) invert(35%) sepia(60%) saturate(1360%) hue-rotate(325deg) brightness(95%) contrast(92%)}.deep-chat-openai-realtime-toggle>*{height:32px;width:32px;padding-left:3px;filter:brightness(0) saturate(100%) invert(22%) sepia(0%) saturate(4537%) hue-rotate(208deg) brightness(105%) contrast(91%)}.deep-chat-openai-realtime-button-unavailable{opacity:.45;pointer-events:none}#deep-chat-openai-realtime-error{color:red;position:absolute;top:calc(50% + 40px);left:50%;transform:translate(-50%,-50%);font-size:17px}#deep-chat-openai-realtime-loading{position:absolute;font-size:15px;top:50%;left:50%;transform:translate(-50%,-50%)}#insert-key-view{height:100%;position:relative}#insert-key-contents{text-align:center;position:absolute;top:44%;left:50%;transform:translate(-50%,-50%);width:82%;display:flex;max-width:700px}#insert-key-title{margin-bottom:15px}#insert-key-input-container{margin-right:2.7em;width:calc(100% - 80px)}#insert-key-input{padding:.3em 1.7em .3em .3em;border-width:1px;border-style:solid;border-radius:3px;width:100%;font-size:inherit}.insert-key-input-valid{border-color:gray}.insert-key-input-invalid{border-color:red}#visibility-icon-container{position:relative;float:right;cursor:pointer;-webkit-user-select:none;user-select:none}.visibility-icon{filter:brightness(0) saturate(100%) invert(63%) sepia(1%) saturate(9%) hue-rotate(43deg) brightness(98%) contrast(92%);position:absolute;right:-1.7em;top:-1.43em}#visible-icon{top:-1.4em}.visibility-icon:hover{filter:unset}.visibility-icon>*{pointer-events:none}#start-button{border:1px solid grey;color:#454545;border-radius:4px;width:3em;display:flex;justify-content:center;align-items:center;cursor:pointer;padding:.28em .3em;-webkit-user-select:none;user-select:none;background-color:#fff}#start-button:hover{background-color:#f2f2f2}#start-button:active{background-color:#d2d2d2}#insert-key-help-text-container{width:100%;position:absolute;margin-top:32px;margin-bottom:20px}#insert-key-help-text-contents{width:100%;position:absolute}#insert-key-input-invalid-text{display:block;margin-top:1em;margin-bottom:.5em;color:red}.insert-key-input-help-text{display:block;margin-top:16px}#loading-key{display:inline-block;width:16px;height:16px}#loading-key:after{content:\" \";display:block;width:11px;height:11px;margin:1px;border-radius:50%;border:2px solid #0084ff;border-color:#0084ff transparent #0084ff transparent;animation:loading-spinner 1.2s linear infinite}#error-view{color:red;font-size:1.2em;line-height:1.3em;margin-top:-5px;text-align:center;height:100%;display:flex;justify-content:center;align-items:center;padding-left:8px;padding-right:8px}@keyframes loading-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.intro-panel{position:absolute;display:flex;justify-content:center;right:0;bottom:0;left:0;margin:auto;height:fit-content;top:-2.5em}#internal-intro-panel{width:250px;height:min-content;display:block;border-radius:5px;overflow:auto;border:1px solid rgb(203,203,203);padding:10px;max-height:calc(100% - 6.8em)}#internal-intro-panel>p{margin-block-start:.8em;margin-block-end:.8em}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!\n Theme: a11y-dark\n Author: @ericwbailey\n Maintainer: @ericwbailey\n\n Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css\n*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.deep-chat-last-group-messages-active{height:100%}.loading-history-message-full-view{position:absolute;height:70%;width:100%;display:flex;align-items:center}.loading-history-message-small{height:20px;margin-bottom:30px}.loading-history-message-small>div>div{scale:.6}.loading-history-message{margin-top:0;width:100%;max-width:100%;display:flex;justify-content:center;background-color:unset}.loading-history{width:70px}.loading-history div{position:absolute;width:var(--loading-history-width);height:var(--loading-history-height);margin:var(--loading-history-margin);border:var(--loading-history-border);border-radius:50%;animation:loading-spinner 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--loading-history-color) transparent transparent transparent}.loading-history div:nth-child(1){animation-delay:-.45s}.loading-history div:nth-child(2){animation-delay:-.3s}.loading-history div:nth-child(3){animation-delay:-.15s}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.deep-chat-loading-message-dots-container{width:1em;padding:.6em .75em .6em 1.3em}.loading-message-dots{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite linear alternate;animation-delay:.5s}.loading-message-dots:before,.loading-message-dots:after{content:\"\";display:inline-block;position:absolute;top:0}.loading-message-dots:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:0s}.loading-message-dots:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:1s}@keyframes loading-message-dots{0%{background-color:var(--loading-message-color)}50%,to{background-color:var(--loading-message-color-fade)}}.message-bubble>p:first-child{margin-top:0}.message-bubble>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:2}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:1;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.loading-submit-button{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:loading-submit-button 1.5s infinite linear;bottom:-.75em}@keyframes loading-submit-button{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button:hover,.input-button:focus-visible{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.loading-button{cursor:auto}.loading-button:hover{background-color:unset}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}[contenteditable]:empty:before{content:attr(deep-chat-placeholder-text);pointer-events:none}[contenteditable][textcolor]:empty:before{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative;margin-right:.56em}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}.dropup-menu-item-text{margin-top:.08em;width:max-content}.dropup-menu-item-disabled>div{pointer-events:none}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}.deep-chat-web-model-button{margin-top:10px;margin-bottom:5px;margin-left:1px}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}";
|
15702
15742
|
var Ba = Object.defineProperty,
|
15703
|
-
|
15743
|
+
w = function w(n, e, t, i) {
|
15704
15744
|
for (var s = void 0, r = n.length - 1, o; r >= 0; r--) (o = n[r]) && (s = o(e, t, s) || s);
|
15705
15745
|
return s && Ba(e, t, s), s;
|
15706
15746
|
};
|
@@ -15743,47 +15783,47 @@ var S = /*#__PURE__*/function (_os) {
|
|
15743
15783
|
}
|
15744
15784
|
}]);
|
15745
15785
|
}(os);
|
15746
|
-
|
15747
|
-
|
15748
|
-
|
15749
|
-
|
15750
|
-
|
15751
|
-
|
15752
|
-
|
15753
|
-
|
15754
|
-
|
15755
|
-
|
15756
|
-
|
15757
|
-
|
15758
|
-
|
15759
|
-
|
15760
|
-
|
15761
|
-
|
15762
|
-
|
15763
|
-
|
15764
|
-
|
15765
|
-
|
15766
|
-
|
15767
|
-
|
15768
|
-
|
15769
|
-
|
15770
|
-
|
15771
|
-
|
15772
|
-
|
15773
|
-
|
15774
|
-
|
15775
|
-
|
15776
|
-
|
15777
|
-
|
15778
|
-
|
15779
|
-
|
15780
|
-
|
15781
|
-
|
15782
|
-
|
15783
|
-
|
15784
|
-
|
15785
|
-
|
15786
|
-
|
15787
|
-
|
15786
|
+
w([x("object")], S.prototype, "connect");
|
15787
|
+
w([x("object")], S.prototype, "directConnection");
|
15788
|
+
w([x("object")], S.prototype, "webModel");
|
15789
|
+
w([x("object")], S.prototype, "requestBodyLimits");
|
15790
|
+
w([x("function")], S.prototype, "requestInterceptor");
|
15791
|
+
w([x("function")], S.prototype, "responseInterceptor");
|
15792
|
+
w([x("function")], S.prototype, "validateInput");
|
15793
|
+
w([x("function")], S.prototype, "loadHistory");
|
15794
|
+
w([x("object")], S.prototype, "chatStyle");
|
15795
|
+
w([x("object")], S.prototype, "attachmentContainerStyle");
|
15796
|
+
w([x("object")], S.prototype, "dropupStyles");
|
15797
|
+
w([x("object")], S.prototype, "inputAreaStyle");
|
15798
|
+
w([x("object")], S.prototype, "textInput");
|
15799
|
+
w([x("object")], S.prototype, "submitButtonStyles");
|
15800
|
+
w([x("object")], S.prototype, "customButtons");
|
15801
|
+
w([x("string")], S.prototype, "auxiliaryStyle");
|
15802
|
+
w([x("array")], S.prototype, "history");
|
15803
|
+
w([x("object")], S.prototype, "introMessage");
|
15804
|
+
w([x("object")], S.prototype, "avatars");
|
15805
|
+
w([x("object")], S.prototype, "names");
|
15806
|
+
w([x("object")], S.prototype, "displayLoadingBubble");
|
15807
|
+
w([x("object")], S.prototype, "errorMessages");
|
15808
|
+
w([x("object")], S.prototype, "messageStyles");
|
15809
|
+
w([x("object")], S.prototype, "textToSpeech");
|
15810
|
+
w([x("object")], S.prototype, "speechToText");
|
15811
|
+
w([x("object")], S.prototype, "images");
|
15812
|
+
w([x("object")], S.prototype, "gifs");
|
15813
|
+
w([x("object")], S.prototype, "camera");
|
15814
|
+
w([x("object")], S.prototype, "audio");
|
15815
|
+
w([x("object")], S.prototype, "microphone");
|
15816
|
+
w([x("object")], S.prototype, "mixedFiles");
|
15817
|
+
w([x("object")], S.prototype, "dragAndDrop");
|
15818
|
+
w([x("object")], S.prototype, "introPanelStyle");
|
15819
|
+
w([x("object")], S.prototype, "htmlClassUtilities");
|
15820
|
+
w([x("object")], S.prototype, "remarkable");
|
15821
|
+
w([x("object")], S.prototype, "focusMode");
|
15822
|
+
w([x("function")], S.prototype, "onMessage");
|
15823
|
+
w([x("function")], S.prototype, "onClearMessages");
|
15824
|
+
w([x("function")], S.prototype, "onComponentRender");
|
15825
|
+
w([x("function")], S.prototype, "onError");
|
15826
|
+
w([x("object")], S.prototype, "demo");
|
15827
|
+
w([x("object")], S.prototype, "_insertKeyViewStyles");
|
15788
15828
|
customElements.define("deep-chat", S);
|
15789
15829
|
export { S as DeepChat };
|