deep-chat-dev 9.0.170 → 9.0.172
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 +324 -331
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.js +457 -446
- package/dist/services/mistral/mistralO.d.ts.map +1 -1
- package/dist/types/microphone.d.ts +5 -5
- package/dist/types/microphone.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/camera/cameraButton.d.ts +0 -1
- package/dist/views/chat/input/buttons/camera/cameraButton.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/customButtonInnerElements.d.ts +1 -0
- package/dist/views/chat/input/buttons/customButtonInnerElements.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/uploadFile/uploadFileButton.d.ts +0 -1
- package/dist/views/chat/input/buttons/uploadFile/uploadFileButton.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -450,7 +450,7 @@ var En = "Make sure the events are using {text: string} or {html: string} format
|
|
450
450
|
}]);
|
451
451
|
}();
|
452
452
|
gi.CODE_SNIPPET_GENERATION_JUMP = 0.5;
|
453
|
-
var
|
453
|
+
var H = gi;
|
454
454
|
var bi = /*#__PURE__*/function () {
|
455
455
|
function bi() {
|
456
456
|
_classCallCheck(this, bi);
|
@@ -554,15 +554,15 @@ var ue = /*#__PURE__*/function () {
|
|
554
554
|
}();
|
555
555
|
var bs = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3csvg%20fill='%23000000'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2032%2032'%20xml:space='preserve'%3e%3cpath%20d='M23,30.36H9c-2.404,0-4.36-1.956-4.36-4.36V15c0-2.404,1.956-4.36,4.36-4.36h3.659%20c0.167-1.566,1.415-2.813,2.981-2.981V5.333c-1.131-0.174-2-1.154-2-2.333c0-1.301,1.059-2.36,2.36-2.36%20c1.302,0,2.36,1.059,2.36,2.36c0,1.179-0.869,2.159-2,2.333V7.66c1.566,0.167,2.814,1.415,2.981,2.981H23%20c2.404,0,4.36,1.956,4.36,4.36v11C27.36,28.404,25.404,30.36,23,30.36z%20M9,11.36c-2.007,0-3.64,1.633-3.64,3.64v11%20c0,2.007,1.633,3.64,3.64,3.64h14c2.007,0,3.64-1.633,3.64-3.64V15c0-2.007-1.633-3.64-3.64-3.64H9z%20M13.384,10.64h5.231%20C18.439,9.354,17.334,8.36,16,8.36C14.667,8.36,13.561,9.354,13.384,10.64z%20M16,1.36c-0.904,0-1.64,0.736-1.64,1.64%20S15.096,4.64,16,4.64c0.904,0,1.64-0.736,1.64-1.64S16.904,1.36,16,1.36z%20M20,27.36h-8c-1.301,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36h8c1.302,0,2.36,1.059,2.36,2.36S21.302,27.36,20,27.36z%20M12,23.36c-0.904,0-1.64,0.735-1.64,1.64%20s0.736,1.64,1.64,1.64h8c0.904,0,1.64-0.735,1.64-1.64s-0.735-1.64-1.64-1.64H12z%20M31,23.86h-2c-0.199,0-0.36-0.161-0.36-0.36V15%20c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5C31.36,23.699,31.199,23.86,31,23.86z%20M29.36,23.14h1.279v-7.78%20H29.36V23.14z%20M3,23.86H1c-0.199,0-0.36-0.161-0.36-0.36V15c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5%20C3.36,23.699,3.199,23.86,3,23.86z%20M1.36,23.14h1.28v-7.78H1.36V23.14z%20M20,20.36c-1.302,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36s2.36,1.059,2.36,2.36C22.36,19.302,21.302,20.36,20,20.36z%20M20,16.36c-0.904,0-1.64,0.736-1.64,1.64%20s0.735,1.64,1.64,1.64s1.64-0.735,1.64-1.64S20.904,16.36,20,16.36z%20M12,20.36c-1.301,0-2.36-1.059-2.36-2.36s1.059-2.36,2.36-2.36%20s2.36,1.059,2.36,2.36C14.36,19.302,13.301,20.36,12,20.36z%20M12,16.36c-0.904,0-1.64,0.736-1.64,1.64s0.736,1.64,1.64,1.64%20s1.64-0.735,1.64-1.64S12.904,16.36,12,16.36z'/%3e%3crect%20style='fill:none;'%20width='32'%20height='32'/%3e%3c/svg%3e",
|
556
556
|
vs = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAMAAAC/MqoPAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAADNQTFRF////9vX18vLy/Pz86enp4+Li2tnZ1tbWzczM+fn57Ozs4N/f09LS0M/P5uXl7+/v3dzcwtncCAAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAZNSURBVHja7d3bdtsqEABQYABZSLH9/3+ZpnUsIcF5iOM6PfElNoMHMfPQdq3GmL0GkLhEUqLaUExnOtOZznSmM53pTGc605nOdKYznelMZzrTmV4LXSqllKyJDkob26xWq8Zae/iH0QoWTm9d1xur4WuypQJtTd+5dqn0VjcxzNO5/57mEBvdLo8Oron6aseWOjYOFkVvjQs3DmgyONMuht52EfztP+4hdu0i6LCO808/M8c1lE/fuPGej41uUzgdtoO/75N+2ELJ9I3b3//hPXbiMenm3pR/Jt4USgcLBIp4Bh10gqKVhvLo0klCxeSky96nKcj3siw6pJIL4XsoiQ7apyvMY/V3HHrSRioLopvEhSpTCn2TPEuwKYMOIX0tAxRBf/Hpa+lfSqBv9gi1FPsNfTrMAiVmIE/vJhz61FGnQxRIEYE4vfNYdN8Rp6MlHaHotHTn8ejekaZPAjEmyvQWdZFTtYTpXqCGJ0zvcek9Yfoel76nS0ffv1NMp1ca+pkgyfRCGind4L7OWWc605l+cxjsyhqy9AGbPpClc1/nvl5VX0c/3Alk6RU3+Am7shNZ+h6bvidLr7jBB+zKBrL0irOOudmIUDzTmf5gIP+iEuXtRuTVaEmY/oZLfyNMrzjryPc0gerMTdpVg0tvjJUU6bLPcGOoUv46SLL6Wi8yhLf06C7TUyekI0efRaaYqdFltkeNpPumRPSMDxgBYvSM035FrKAmH72hRW99PrpvSdEHkTEGUvSsK3yKVDkuJ92RohcZaehzzirPpOg+J92Tolfc4Cumx5xVXpGiZ34+ICX6W84qv5GiR5NPbiIpOv6BCoSvSkTX+eiaGP092zINvBOj4x8mSf9FqejvNo/cvpOji19ZbmviL0GPLsYMFzgzCor0+Bv/ePDvSJKOb9dJ5UlnbnEHiHgzv6cdTpJOWuc/u3FEucLDOL75xGtBiefrcwgoC9NDSH/jkH6pAuXmBqPQ9HSUPVdZBH1GGOrMXAQdYxcKZfxAoK+KKBKFLosoEoX+u4giUehz8jlcnAuhp78I46yDYNAd+QLR6K+pr+yvxdBTHyVDubQh0UfSxaHSd0lbvNkVRE87JGOtc+PQd2QLQ6fHhJkKsSh6yg13tO08JPprsgrrXWH0dJd2vH1MLPprot4eXoujpzrdhngiD40ek2y92lggPcnWa8qN1Yz0BFuvZhRl0uOfR0v4Ewuli/Bg4Qr3lArqGdndQ3UPO1EunXYwnelMZzrTmc50pjOd6UxnOtOZznSmM53pTGf6kuj6oedFKV0s3fX6sX1S3bsi6a4PD7+/YAqYeBw6pIB/4qEgOqxdSPbGiim4NRRCbzs3Jj0L4UfXtQXQVRfn5IdA/Bw7RZzurEV6EtdsLeGXkIPuA+K1UoVeA0l62zmN/LqfSSft9KkepmoRuvi3nd5uKNFB9zbbXEANqdr941XO0NJx2v2jdJenpf+/3bvn0ts16ph+sd6hX7dPo2+2cZzE02Ia43bzDHqr+2Evnhz74ZHU30ffbKOeng1/NPV30Ns1gYQnSP2P6e65Pfxc6h02XZqXQCjhJ6kPL6bFo4NrGvAU4UII4SE2P1vQuZkuOxckVfehisF1MjUddN/MZBN+kvq5uf0O/xa66gyNS9ktMWlz44rO1Z8C19i5FPdHzPamXn+F3hryPfxMr78+4F+kq22kO6Rf6fUQt+puuustyWv4rbG3l/duztFB96GYoe1cTBdXMr+nw9qVM6ZfxOvzezff0nXi/ZOndvrR6Zvpm0c3h6nhdb+5iS7tsIim/qXZD9+97/Jf+rpZ5BET1ayv0GUzLhEuhBBjIy/RdVPgndutIRt9nt7p5cKFEEJ3Z+jQFDZL+XnMDXxHB73gxn5s9Kc3d3/pFciFkN/QTSXHJpX5l66gDrkQoP6hL3xsPw39la4qOiV8tH78XeSbue6N9mvWa6J/ybpc1CT1Wnh5Qq9meP8IOKH3ddH7E/ri1iYux/SXDrXR4UiPdck/wUpU+FtPf6/orja6O9KL3l56LOvVxe5Ib2qjN0d6Vbex4ghWlU3bPqI90If66MNng680FNpbJijH6kCvaF3uMzQ3+IrpFerV4Y9dffQdN3im10ivbuImhD3Qq5u4HdZkua8znelMZ/pS4z9CPVKkxowNxgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0wMy0yN1QxNTo0NToxNSswMDowMN1xSg4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDMtMjdUMTU6NDU6MTUrMDA6MDCsLPKyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==",
|
557
|
-
|
558
|
-
function
|
559
|
-
_classCallCheck(this,
|
557
|
+
ne = /*#__PURE__*/function () {
|
558
|
+
function ne() {
|
559
|
+
_classCallCheck(this, ne);
|
560
560
|
}
|
561
|
-
return _createClass(
|
561
|
+
return _createClass(ne, null, [{
|
562
562
|
key: "hide",
|
563
563
|
value: function hide(e) {
|
564
564
|
var t;
|
565
|
-
(t = e.getElementsByClassName(
|
565
|
+
(t = e.getElementsByClassName(ne.CONTAINER_CLASS)[0].style).visibility || (t.visibility = "hidden");
|
566
566
|
}
|
567
567
|
}, {
|
568
568
|
key: "applyCustomStylesToElements",
|
@@ -573,10 +573,10 @@ var bs = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
|
|
573
573
|
key: "applyCustomStyles",
|
574
574
|
value: function applyCustomStyles(e, t, i, n) {
|
575
575
|
var r, o, a, l;
|
576
|
-
if ((r = i["default"]) != null && r.styles &&
|
577
|
-
(a = i.ai) != null && a.styles &&
|
576
|
+
if ((r = i["default"]) != null && r.styles && ne.applyCustomStylesToElements(e, t, i["default"].styles), n === b.USER_ROLE) (o = i.user) != null && o.styles && ne.applyCustomStylesToElements(e, t, i.user.styles);else {
|
577
|
+
(a = i.ai) != null && a.styles && ne.applyCustomStylesToElements(e, t, i.ai.styles);
|
578
578
|
var c = (l = i[n]) == null ? void 0 : l.styles;
|
579
|
-
c &&
|
579
|
+
c && ne.applyCustomStylesToElements(e, t, c);
|
580
580
|
}
|
581
581
|
}
|
582
582
|
}, {
|
@@ -586,7 +586,7 @@ var bs = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
|
|
586
586
|
var i = document.createElement("img");
|
587
587
|
e === b.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) || vs : 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) || bs, i.classList.add("avatar");
|
588
588
|
var n = document.createElement("div");
|
589
|
-
return n.classList.add(
|
589
|
+
return n.classList.add(ne.CONTAINER_CLASS), n.appendChild(i), t && ne.applyCustomStyles(n, i, t, e), n;
|
590
590
|
}
|
591
591
|
}, {
|
592
592
|
key: "getPosition",
|
@@ -600,14 +600,14 @@ var bs = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
|
|
600
600
|
key: "add",
|
601
601
|
value: function add(e, t, i) {
|
602
602
|
var n = typeof i == "boolean" ? void 0 : i,
|
603
|
-
r =
|
604
|
-
o =
|
603
|
+
r = ne.createAvatar(t, n),
|
604
|
+
o = ne.getPosition(t, n);
|
605
605
|
r.classList.add(o === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(o === "left" ? "beforebegin" : "afterend", r);
|
606
606
|
}
|
607
607
|
}]);
|
608
608
|
}();
|
609
|
-
|
610
|
-
var Zt =
|
609
|
+
ne.CONTAINER_CLASS = "avatar-container";
|
610
|
+
var Zt = ne;
|
611
611
|
var be = /*#__PURE__*/function () {
|
612
612
|
function be() {
|
613
613
|
_classCallCheck(this, be);
|
@@ -864,7 +864,7 @@ var Le = /*#__PURE__*/function () {
|
|
864
864
|
var o = i.getElementsByClassName(r);
|
865
865
|
Array.from(o || []).forEach(function (a) {
|
866
866
|
var l = Le.getProcessedStyles(t, a, r);
|
867
|
-
|
867
|
+
Q.applyStylesToElement(a, l), Le.applyEvents(a, r);
|
868
868
|
});
|
869
869
|
});
|
870
870
|
var n = i.getElementsByClassName(xs);
|
@@ -874,11 +874,11 @@ var Le = /*#__PURE__*/function () {
|
|
874
874
|
}
|
875
875
|
}]);
|
876
876
|
}();
|
877
|
-
var
|
878
|
-
function
|
879
|
-
_classCallCheck(this,
|
877
|
+
var Q = /*#__PURE__*/function () {
|
878
|
+
function Q() {
|
879
|
+
_classCallCheck(this, Q);
|
880
880
|
}
|
881
|
-
return _createClass(
|
881
|
+
return _createClass(Q, null, [{
|
882
882
|
key: "applyStylesToElement",
|
883
883
|
value: function applyStylesToElement(e, t) {
|
884
884
|
var i = M.processStateful(t, {}, {});
|
@@ -897,7 +897,7 @@ var X = /*#__PURE__*/function () {
|
|
897
897
|
value: function applyClassUtilitiesToElement(e, t) {
|
898
898
|
var i = t.events,
|
899
899
|
n = t.styles;
|
900
|
-
i &&
|
900
|
+
i && Q.applyEventsToElement(e, i), n && !Le.doesElementContainDeepChatClass(e) && Q.applyStylesToElement(e, n);
|
901
901
|
}
|
902
902
|
}, {
|
903
903
|
key: "applyCustomClassUtilities",
|
@@ -905,20 +905,20 @@ var X = /*#__PURE__*/function () {
|
|
905
905
|
Object.keys(e).forEach(function (i) {
|
906
906
|
var n = t.getElementsByClassName(i);
|
907
907
|
Array.from(n).forEach(function (r) {
|
908
|
-
e[i] &&
|
908
|
+
e[i] && Q.applyClassUtilitiesToElement(r, e[i]);
|
909
909
|
});
|
910
910
|
});
|
911
911
|
}
|
912
912
|
}, {
|
913
913
|
key: "apply",
|
914
914
|
value: function apply(e, t) {
|
915
|
-
Le.applyDeepChatUtilities(e, e.htmlClassUtilities, t),
|
915
|
+
Le.applyDeepChatUtilities(e, e.htmlClassUtilities, t), Q.applyCustomClassUtilities(e.htmlClassUtilities, t);
|
916
916
|
}
|
917
917
|
}, {
|
918
918
|
key: "traverseNodes",
|
919
919
|
value: function traverseNodes(e, t) {
|
920
920
|
e.nodeType === Node.ELEMENT_NODE && t.push(e.outerHTML), e.childNodes.forEach(function (i) {
|
921
|
-
|
921
|
+
Q.traverseNodes(i, t);
|
922
922
|
});
|
923
923
|
}
|
924
924
|
}, {
|
@@ -927,7 +927,7 @@ var X = /*#__PURE__*/function () {
|
|
927
927
|
var i = new DOMParser().parseFromString(e, "text/html"),
|
928
928
|
n = [];
|
929
929
|
return i.body.childNodes.forEach(function (r) {
|
930
|
-
|
930
|
+
Q.traverseNodes(r, n);
|
931
931
|
}), n;
|
932
932
|
}
|
933
933
|
}]);
|
@@ -952,7 +952,7 @@ var ct = /*#__PURE__*/function () {
|
|
952
952
|
value: function overwrite(e, t, i, n) {
|
953
953
|
var r = e.messages,
|
954
954
|
o = b.overwriteMessage(r, n, t, i, "html", "html-message");
|
955
|
-
return o && (o.bubbleElement.innerHTML = t,
|
955
|
+
return o && (o.bubbleElement.innerHTML = t, Q.apply(e, o.outerContainer), ue.flagHTMLUpdateClass(o.bubbleElement)), o;
|
956
956
|
}
|
957
957
|
// prettier-ignore
|
958
958
|
}, {
|
@@ -965,7 +965,7 @@ var ct = /*#__PURE__*/function () {
|
|
965
965
|
r.status = !1;
|
966
966
|
}
|
967
967
|
var o = ct.createElements(e, t, i);
|
968
|
-
return b.fillEmptyMessageElement(o.bubbleElement, t),
|
968
|
+
return b.fillEmptyMessageElement(o.bubbleElement, t), Q.apply(e, o.outerContainer), ue.flagHTMLUpdateClass(o.bubbleElement), e.applyCustomStyles(o, i, !1, (a = e.messageStyles) == null ? void 0 : a.html), ct.addElement(e, o.outerContainer), o;
|
969
969
|
}
|
970
970
|
}]);
|
971
971
|
}();
|
@@ -1025,7 +1025,7 @@ var ks = /[&<>"]/,
|
|
1025
1025
|
function Rs(s) {
|
1026
1026
|
return Ms[s];
|
1027
1027
|
}
|
1028
|
-
function
|
1028
|
+
function J(s) {
|
1029
1029
|
return ks.test(s) ? s.replace(As, Rs) : s;
|
1030
1030
|
}
|
1031
1031
|
var g = {};
|
@@ -1036,7 +1036,7 @@ g.blockquote_close = function (s, e) {
|
|
1036
1036
|
return "</blockquote>" + $e(s, e);
|
1037
1037
|
};
|
1038
1038
|
g.code = function (s, e) {
|
1039
|
-
return s[e].block ? "<pre><code>" +
|
1039
|
+
return s[e].block ? "<pre><code>" + J(s[e].content) + "</code></pre>" + $e(s, e) : "<code>" + J(s[e].content) + "</code>";
|
1040
1040
|
};
|
1041
1041
|
g.fence = function (s, e, t, i, n) {
|
1042
1042
|
var r = s[e],
|
@@ -1048,9 +1048,9 @@ g.fence = function (s, e, t, i, n) {
|
|
1048
1048
|
h;
|
1049
1049
|
if (r.params) {
|
1050
1050
|
if (c = r.params.split(/\s+/g), d = c.join(" "), _s(n.rules.fence_custom, c[0])) return n.rules.fence_custom[c[0]](s, e, t, i, n);
|
1051
|
-
l =
|
1051
|
+
l = J(Ge(kt(d))), o = ' class="' + a + l + '"';
|
1052
1052
|
}
|
1053
|
-
return t.highlight ? h = t.highlight.apply(t.highlight, [r.content].concat(c)) ||
|
1053
|
+
return t.highlight ? h = t.highlight.apply(t.highlight, [r.content].concat(c)) || J(r.content) : h = J(r.content), "<pre><code" + o + ">" + h + "</code></pre>" + $e(s, e);
|
1054
1054
|
};
|
1055
1055
|
g.fence_custom = {};
|
1056
1056
|
g.heading_open = function (s, e) {
|
@@ -1090,17 +1090,17 @@ g.paragraph_close = function (s, e) {
|
|
1090
1090
|
return (s[e].tight ? "" : "</p>") + (t ? $e(s, e) : "");
|
1091
1091
|
};
|
1092
1092
|
g.link_open = function (s, e, t) {
|
1093
|
-
var i = s[e].title ? ' title="' +
|
1093
|
+
var i = s[e].title ? ' title="' + J(Ge(s[e].title)) + '"' : "",
|
1094
1094
|
n = t.linkTarget ? ' target="' + t.linkTarget + '"' : "";
|
1095
|
-
return '<a href="' +
|
1095
|
+
return '<a href="' + J(s[e].href) + '"' + i + n + ">";
|
1096
1096
|
};
|
1097
1097
|
g.link_close = function () {
|
1098
1098
|
return "</a>";
|
1099
1099
|
};
|
1100
1100
|
g.image = function (s, e, t) {
|
1101
|
-
var i = ' src="' +
|
1102
|
-
n = s[e].title ? ' title="' +
|
1103
|
-
r = ' alt="' + (s[e].alt ?
|
1101
|
+
var i = ' src="' + J(s[e].src) + '"',
|
1102
|
+
n = s[e].title ? ' title="' + J(Ge(s[e].title)) + '"' : "",
|
1103
|
+
r = ' alt="' + (s[e].alt ? J(Ge(kt(s[e].alt))) : "") + '"',
|
1104
1104
|
o = t.xhtmlOut ? " /" : "";
|
1105
1105
|
return "<img" + i + r + n + o + ">";
|
1106
1106
|
};
|
@@ -1173,10 +1173,10 @@ g.mark_close = function () {
|
|
1173
1173
|
return "</mark>";
|
1174
1174
|
};
|
1175
1175
|
g.sub = function (s, e) {
|
1176
|
-
return "<sub>" +
|
1176
|
+
return "<sub>" + J(s[e].content) + "</sub>";
|
1177
1177
|
};
|
1178
1178
|
g.sup = function (s, e) {
|
1179
|
-
return "<sup>" +
|
1179
|
+
return "<sup>" + J(s[e].content) + "</sup>";
|
1180
1180
|
};
|
1181
1181
|
g.hardbreak = function (s, e, t) {
|
1182
1182
|
return t.xhtmlOut ? "<br />\n" : "<br>\n";
|
@@ -1185,7 +1185,7 @@ g.softbreak = function (s, e, t) {
|
|
1185
1185
|
return t.breaks ? t.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
|
1186
1186
|
};
|
1187
1187
|
g.text = function (s, e) {
|
1188
|
-
return
|
1188
|
+
return J(s[e].content);
|
1189
1189
|
};
|
1190
1190
|
g.htmlblock = function (s, e) {
|
1191
1191
|
return s[e].content;
|
@@ -1194,7 +1194,7 @@ g.htmltag = function (s, e) {
|
|
1194
1194
|
return s[e].content;
|
1195
1195
|
};
|
1196
1196
|
g.abbr_open = function (s, e) {
|
1197
|
-
return '<abbr title="' +
|
1197
|
+
return '<abbr title="' + J(Ge(s[e].title)) + '">';
|
1198
1198
|
};
|
1199
1199
|
g.abbr_close = function () {
|
1200
1200
|
return "</abbr>";
|
@@ -1258,14 +1258,14 @@ cn.prototype.render = function (s, e, t) {
|
|
1258
1258
|
for (var i = this.rules, n = s.length, r = -1, o = ""; ++r < n;) s[r].type === "inline" ? o += this.renderInline(s[r].children, e, t) : o += i[s[r].type](s, r, e, t, this);
|
1259
1259
|
return o;
|
1260
1260
|
};
|
1261
|
-
function
|
1261
|
+
function te() {
|
1262
1262
|
this.__rules__ = [], this.__cache__ = null;
|
1263
1263
|
}
|
1264
|
-
|
1264
|
+
te.prototype.__find__ = function (s) {
|
1265
1265
|
for (var e = this.__rules__.length, t = -1; e--;) if (this.__rules__[++t].name === s) return t;
|
1266
1266
|
return -1;
|
1267
1267
|
};
|
1268
|
-
|
1268
|
+
te.prototype.__compile__ = function () {
|
1269
1269
|
var s = this,
|
1270
1270
|
e = [""];
|
1271
1271
|
s.__rules__.forEach(function (t) {
|
@@ -1278,13 +1278,13 @@ Q.prototype.__compile__ = function () {
|
|
1278
1278
|
});
|
1279
1279
|
});
|
1280
1280
|
};
|
1281
|
-
|
1281
|
+
te.prototype.at = function (s, e, t) {
|
1282
1282
|
var i = this.__find__(s),
|
1283
1283
|
n = t || {};
|
1284
1284
|
if (i === -1) throw new Error("Parser rule not found: " + s);
|
1285
1285
|
this.__rules__[i].fn = e, this.__rules__[i].alt = n.alt || [], this.__cache__ = null;
|
1286
1286
|
};
|
1287
|
-
|
1287
|
+
te.prototype.before = function (s, e, t, i) {
|
1288
1288
|
var n = this.__find__(s),
|
1289
1289
|
r = i || {};
|
1290
1290
|
if (n === -1) throw new Error("Parser rule not found: " + s);
|
@@ -1295,7 +1295,7 @@ Q.prototype.before = function (s, e, t, i) {
|
|
1295
1295
|
alt: r.alt || []
|
1296
1296
|
}), this.__cache__ = null;
|
1297
1297
|
};
|
1298
|
-
|
1298
|
+
te.prototype.after = function (s, e, t, i) {
|
1299
1299
|
var n = this.__find__(s),
|
1300
1300
|
r = i || {};
|
1301
1301
|
if (n === -1) throw new Error("Parser rule not found: " + s);
|
@@ -1306,7 +1306,7 @@ Q.prototype.after = function (s, e, t, i) {
|
|
1306
1306
|
alt: r.alt || []
|
1307
1307
|
}), this.__cache__ = null;
|
1308
1308
|
};
|
1309
|
-
|
1309
|
+
te.prototype.push = function (s, e, t) {
|
1310
1310
|
var i = t || {};
|
1311
1311
|
this.__rules__.push({
|
1312
1312
|
name: s,
|
@@ -1315,7 +1315,7 @@ Q.prototype.push = function (s, e, t) {
|
|
1315
1315
|
alt: i.alt || []
|
1316
1316
|
}), this.__cache__ = null;
|
1317
1317
|
};
|
1318
|
-
|
1318
|
+
te.prototype.enable = function (s, e) {
|
1319
1319
|
s = Array.isArray(s) ? s : [s], e && this.__rules__.forEach(function (t) {
|
1320
1320
|
t.enabled = !1;
|
1321
1321
|
}), s.forEach(function (t) {
|
@@ -1324,14 +1324,14 @@ Q.prototype.enable = function (s, e) {
|
|
1324
1324
|
this.__rules__[i].enabled = !0;
|
1325
1325
|
}, this), this.__cache__ = null;
|
1326
1326
|
};
|
1327
|
-
|
1327
|
+
te.prototype.disable = function (s) {
|
1328
1328
|
s = Array.isArray(s) ? s : [s], s.forEach(function (e) {
|
1329
1329
|
var t = this.__find__(e);
|
1330
1330
|
if (t < 0) throw new Error("Rules manager: invalid rule name " + e);
|
1331
1331
|
this.__rules__[t].enabled = !1;
|
1332
1332
|
}, this), this.__cache__ = null;
|
1333
1333
|
};
|
1334
|
-
|
1334
|
+
te.prototype.getRules = function (s) {
|
1335
1335
|
return this.__cache__ === null && this.__compile__(), this.__cache__[s] || [];
|
1336
1336
|
};
|
1337
1337
|
function Is(s) {
|
@@ -1621,24 +1621,24 @@ function Qe(s, e, t) {
|
|
1621
1621
|
return s.substr(0, e) + t + s.substr(e + 1);
|
1622
1622
|
}
|
1623
1623
|
function Ws(s) {
|
1624
|
-
var e, t, i, n, r, o, a, l, c, d, h, u, f, m, p,
|
1624
|
+
var e, t, i, n, r, o, a, l, c, d, h, u, f, m, p, y, x;
|
1625
1625
|
if (s.options.typographer) {
|
1626
|
-
for (
|
1627
|
-
for (
|
1628
|
-
for (a =
|
1629
|
-
|
1626
|
+
for (x = [], p = s.tokens.length - 1; p >= 0; p--) if (s.tokens[p].type === "inline") {
|
1627
|
+
for (y = s.tokens[p].children, x.length = 0, e = 0; e < y.length; e++) if (t = y[e], !(t.type !== "text" || Vs.test(t.text))) {
|
1628
|
+
for (a = y[e].level, f = x.length - 1; f >= 0 && !(x[f].level <= a); f--);
|
1629
|
+
x.length = f + 1, i = t.content, r = 0, o = i.length;
|
1630
1630
|
e: for (; r < o && (wn.lastIndex = r, n = wn.exec(i), !!n);) {
|
1631
1631
|
if (l = !Cn(i, n.index - 1), r = n.index + 1, m = n[0] === "'", c = !Cn(i, r), !c && !l) {
|
1632
1632
|
m && (t.content = Qe(t.content, n.index, Tn));
|
1633
1633
|
continue;
|
1634
1634
|
}
|
1635
1635
|
if (h = !c, u = !l, u) {
|
1636
|
-
for (f =
|
1637
|
-
d =
|
1636
|
+
for (f = x.length - 1; f >= 0 && (d = x[f], !(x[f].level < a)); f--) if (d.single === m && x[f].level === a) {
|
1637
|
+
d = x[f], m ? (y[d.token].content = Qe(y[d.token].content, d.pos, s.options.quotes[2]), t.content = Qe(t.content, n.index, s.options.quotes[3])) : (y[d.token].content = Qe(y[d.token].content, d.pos, s.options.quotes[0]), t.content = Qe(t.content, n.index, s.options.quotes[1])), x.length = f;
|
1638
1638
|
continue e;
|
1639
1639
|
}
|
1640
1640
|
}
|
1641
|
-
h ?
|
1641
|
+
h ? x.push({
|
1642
1642
|
token: e,
|
1643
1643
|
pos: n.index,
|
1644
1644
|
single: m,
|
@@ -1651,7 +1651,7 @@ function Ws(s) {
|
|
1651
1651
|
}
|
1652
1652
|
var Fi = [["block", Is], ["abbr", Ps], ["references", Ns], ["inline", Ds], ["footnote_tail", Fs], ["abbr2", Bs], ["replacements", zs], ["smartquotes", Ws]];
|
1653
1653
|
function rs() {
|
1654
|
-
this.options = {}, this.ruler = new
|
1654
|
+
this.options = {}, this.ruler = new te();
|
1655
1655
|
for (var s = 0; s < Fi.length; s++) this.ruler.push(Fi[s][0], Fi[s][1]);
|
1656
1656
|
}
|
1657
1657
|
rs.prototype.process = function (s) {
|
@@ -1759,12 +1759,12 @@ function Js(s, e, t, i) {
|
|
1759
1759
|
f,
|
1760
1760
|
m,
|
1761
1761
|
p = s.bMarks[e] + s.tShift[e],
|
1762
|
-
|
1763
|
-
if (p >
|
1762
|
+
y = s.eMarks[e];
|
1763
|
+
if (p > y || s.src.charCodeAt(p++) !== 62 || s.level >= s.options.maxNesting) return !1;
|
1764
1764
|
if (i) return !0;
|
1765
|
-
for (s.src.charCodeAt(p) === 32 && p++, l = s.blkIndent, s.blkIndent = 0, a = [s.bMarks[e]], s.bMarks[e] = p, p = p <
|
1765
|
+
for (s.src.charCodeAt(p) === 32 && p++, l = s.blkIndent, s.blkIndent = 0, a = [s.bMarks[e]], s.bMarks[e] = p, p = p < y ? s.skipSpaces(p) : p, r = p >= y, o = [s.tShift[e]], s.tShift[e] = p - s.bMarks[e], h = s.parser.ruler.getRules("blockquote"), n = e + 1; n < t && (p = s.bMarks[n] + s.tShift[n], y = s.eMarks[n], !(p >= y)); n++) {
|
1766
1766
|
if (s.src.charCodeAt(p++) === 62) {
|
1767
|
-
s.src.charCodeAt(p) === 32 && p++, a.push(s.bMarks[n]), s.bMarks[n] = p, p = p <
|
1767
|
+
s.src.charCodeAt(p) === 32 && p++, a.push(s.bMarks[n]), s.bMarks[n] = p, p = p < y ? s.skipSpaces(p) : p, r = p >= y, o.push(s.tShift[n]), s.tShift[n] = p - s.bMarks[n];
|
1768
1768
|
continue;
|
1769
1769
|
}
|
1770
1770
|
if (r) break;
|
@@ -1839,21 +1839,21 @@ function Ys(s, e, t, i) {
|
|
1839
1839
|
f,
|
1840
1840
|
m,
|
1841
1841
|
p,
|
1842
|
+
y,
|
1842
1843
|
x,
|
1843
|
-
|
1844
|
-
|
1845
|
-
re,
|
1844
|
+
D,
|
1845
|
+
z,
|
1846
1846
|
Te,
|
1847
1847
|
R,
|
1848
|
-
|
1849
|
-
|
1848
|
+
X = !0,
|
1849
|
+
Z,
|
1850
1850
|
N,
|
1851
1851
|
Oe,
|
1852
1852
|
pt;
|
1853
|
-
if ((h = An(s, e)) >= 0)
|
1853
|
+
if ((h = An(s, e)) >= 0) y = !0;else if ((h = kn(s, e)) >= 0) y = !1;else return !1;
|
1854
1854
|
if (s.level >= s.options.maxNesting) return !1;
|
1855
1855
|
if (p = s.src.charCodeAt(h - 1), i) return !0;
|
1856
|
-
for (
|
1856
|
+
for (D = s.tokens.length, y ? (d = s.bMarks[e] + s.tShift[e], m = Number(s.src.substr(d, h - d - 1)), s.tokens.push({
|
1857
1857
|
type: "ordered_list_open",
|
1858
1858
|
order: m,
|
1859
1859
|
lines: Te = [e, 0],
|
@@ -1862,28 +1862,28 @@ function Ys(s, e, t, i) {
|
|
1862
1862
|
type: "bullet_list_open",
|
1863
1863
|
lines: Te = [e, 0],
|
1864
1864
|
level: s.level++
|
1865
|
-
}), n = e,
|
1865
|
+
}), n = e, z = !1, Z = s.parser.ruler.getRules("list"); n < t && (x = s.skipSpaces(h), u = s.eMarks[n], x >= u ? f = 1 : f = x - h, f > 4 && (f = 1), f < 1 && (f = 1), r = h - s.bMarks[n] + f, s.tokens.push({
|
1866
1866
|
type: "list_item_open",
|
1867
1867
|
lines: R = [e, 0],
|
1868
1868
|
level: s.level++
|
1869
|
-
}), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] =
|
1869
|
+
}), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] = x - s.bMarks[e], s.blkIndent = r, s.tight = !0, s.parentType = "list", s.parser.tokenize(s, e, t, !0), (!s.tight || z) && (X = !1), z = s.line - e > 1 && s.isEmpty(s.line - 1), s.blkIndent = a, s.tShift[e] = o, s.tight = l, s.parentType = c, s.tokens.push({
|
1870
1870
|
type: "list_item_close",
|
1871
1871
|
level: --s.level
|
1872
|
-
}), n = e = s.line, R[1] = n,
|
1873
|
-
for (pt = !1, N = 0, Oe =
|
1872
|
+
}), n = e = s.line, R[1] = n, x = s.bMarks[e], !(n >= t || s.isEmpty(n) || s.tShift[n] < s.blkIndent));) {
|
1873
|
+
for (pt = !1, N = 0, Oe = Z.length; N < Oe; N++) if (Z[N](s, n, t, !0)) {
|
1874
1874
|
pt = !0;
|
1875
1875
|
break;
|
1876
1876
|
}
|
1877
1877
|
if (pt) break;
|
1878
|
-
if (
|
1878
|
+
if (y) {
|
1879
1879
|
if (h = An(s, n), h < 0) break;
|
1880
1880
|
} else if (h = kn(s, n), h < 0) break;
|
1881
1881
|
if (p !== s.src.charCodeAt(h - 1)) break;
|
1882
1882
|
}
|
1883
1883
|
return s.tokens.push({
|
1884
|
-
type:
|
1884
|
+
type: y ? "ordered_list_close" : "bullet_list_close",
|
1885
1885
|
level: --s.level
|
1886
|
-
}), Te[1] = n, s.line = n,
|
1886
|
+
}), Te[1] = n, s.line = n, X && Zs(s, D), !0;
|
1887
1887
|
}
|
1888
1888
|
function Qs(s, e, t, i) {
|
1889
1889
|
var n,
|
@@ -2088,7 +2088,7 @@ function ar(s, e) {
|
|
2088
2088
|
for (t = e + 2, i = s.tokens.length - 2; t < i; t++) s.tokens[t].level === n && s.tokens[t].type === "paragraph_open" && (s.tokens[t + 2].tight = !0, s.tokens[t].tight = !0, t += 2);
|
2089
2089
|
}
|
2090
2090
|
function lr(s, e, t, i) {
|
2091
|
-
var n, r, o, a, l, c, d, h, u, f, m, p,
|
2091
|
+
var n, r, o, a, l, c, d, h, u, f, m, p, y, x;
|
2092
2092
|
if (i) return s.ddIndent < 0 ? !1 : Gt(s, e) >= 0;
|
2093
2093
|
if (d = e + 1, s.isEmpty(d) && ++d > t || s.tShift[d] < s.blkIndent || (n = Gt(s, d), n < 0) || s.level >= s.options.maxNesting) return !1;
|
2094
2094
|
c = s.tokens.length, s.tokens.push({
|
@@ -2097,7 +2097,7 @@ function lr(s, e, t, i) {
|
|
2097
2097
|
level: s.level++
|
2098
2098
|
}), o = e, r = d;
|
2099
2099
|
e: for (;;) {
|
2100
|
-
for (
|
2100
|
+
for (x = !0, y = !1, s.tokens.push({
|
2101
2101
|
type: "dt_open",
|
2102
2102
|
lines: [o, o],
|
2103
2103
|
level: s.level++
|
@@ -2115,7 +2115,7 @@ function lr(s, e, t, i) {
|
|
2115
2115
|
type: "dd_open",
|
2116
2116
|
lines: a = [d, 0],
|
2117
2117
|
level: s.level++
|
2118
|
-
}), p = s.tight, u = s.ddIndent, h = s.blkIndent, m = s.tShift[r], f = s.parentType, s.blkIndent = s.ddIndent = s.tShift[r] + 2, s.tShift[r] = n - s.bMarks[r], s.tight = !0, s.parentType = "deflist", s.parser.tokenize(s, r, t, !0), (!s.tight ||
|
2118
|
+
}), p = s.tight, u = s.ddIndent, h = s.blkIndent, m = s.tShift[r], f = s.parentType, s.blkIndent = s.ddIndent = s.tShift[r] + 2, s.tShift[r] = n - s.bMarks[r], s.tight = !0, s.parentType = "deflist", s.parser.tokenize(s, r, t, !0), (!s.tight || y) && (x = !1), y = s.line - r > 1 && s.isEmpty(s.line - 1), s.tShift[r] = m, s.tight = p, s.parentType = f, s.blkIndent = h, s.ddIndent = u, s.tokens.push({
|
2119
2119
|
type: "dd_close",
|
2120
2120
|
level: --s.level
|
2121
2121
|
}), a[1] = d = s.line, d >= t || s.tShift[d] < s.blkIndent) break e;
|
@@ -2127,7 +2127,7 @@ function lr(s, e, t, i) {
|
|
2127
2127
|
return s.tokens.push({
|
2128
2128
|
type: "dl_close",
|
2129
2129
|
level: --s.level
|
2130
|
-
}), l[1] = d, s.line = d,
|
2130
|
+
}), l[1] = d, s.line = d, x && ar(s, c), !0;
|
2131
2131
|
}
|
2132
2132
|
function cr(s, e) {
|
2133
2133
|
var t,
|
@@ -2165,7 +2165,7 @@ function cr(s, e) {
|
|
2165
2165
|
}
|
2166
2166
|
var Wt = [["code", $s], ["fences", Ks, ["paragraph", "blockquote", "list"]], ["blockquote", Js, ["paragraph", "blockquote", "list"]], ["hr", Xs, ["paragraph", "blockquote", "list"]], ["list", Ys, ["paragraph", "blockquote"]], ["footnote", Qs, ["paragraph"]], ["heading", er, ["paragraph", "blockquote"]], ["lheading", tr], ["htmlblock", rr, ["paragraph", "blockquote"]], ["table", or, ["paragraph"]], ["deflist", lr, ["paragraph"]], ["paragraph", cr]];
|
2167
2167
|
function dn() {
|
2168
|
-
this.ruler = new
|
2168
|
+
this.ruler = new te();
|
2169
2169
|
for (var s = 0; s < Wt.length; s++) this.ruler.push(Wt[s][0], Wt[s][1], {
|
2170
2170
|
alt: (Wt[s][2] || []).slice()
|
2171
2171
|
});
|
@@ -2650,7 +2650,7 @@ function Xr(s, e) {
|
|
2650
2650
|
}
|
2651
2651
|
var ji = [["text", pr], ["newline", mr], ["escape", gr], ["backticks", br], ["del", vr], ["ins", yr], ["mark", xr], ["emphasis", Er], ["sub", Sr], ["sup", Tr], ["links", Cr], ["footnote_inline", kr], ["footnote_ref", Ar], ["autolink", Lr], ["htmltag", $r], ["entity", Xr]];
|
2652
2652
|
function Ei() {
|
2653
|
-
this.ruler = new
|
2653
|
+
this.ruler = new te();
|
2654
2654
|
for (var s = 0; s < ji.length; s++) this.ruler.push(ji[s][0], ji[s][1]);
|
2655
2655
|
this.validateLink = Zr;
|
2656
2656
|
}
|
@@ -2808,7 +2808,7 @@ function as(s, e, t) {
|
|
2808
2808
|
this.src = e, this.env = t, this.options = s.options, this.tokens = [], this.inlineMode = !1, this.inline = s.inline, this.block = s.block, this.renderer = s.renderer, this.typographer = s.typographer;
|
2809
2809
|
}
|
2810
2810
|
function Se(s, e) {
|
2811
|
-
typeof s != "string" && (e = s, s = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new Ei(), this.block = new dn(), this.core = new rs(), this.renderer = new cn(), this.ruler = new
|
2811
|
+
typeof s != "string" && (e = s, s = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new Ei(), this.block = new dn(), this.core = new rs(), this.renderer = new cn(), this.ruler = new te(), this.options = {}, this.configure(to[s]), this.set(e || {});
|
2812
2812
|
}
|
2813
2813
|
Se.prototype.set = function (s) {
|
2814
2814
|
Qn(this.options, s);
|
@@ -2970,7 +2970,7 @@ var Me = /*#__PURE__*/function () {
|
|
2970
2970
|
}]);
|
2971
2971
|
}();
|
2972
2972
|
Me.DEFAULT_FILE_NAME = "file";
|
2973
|
-
var
|
2973
|
+
var j = Me;
|
2974
2974
|
var Qt = /*#__PURE__*/function () {
|
2975
2975
|
function Qt() {
|
2976
2976
|
_classCallCheck(this, Qt);
|
@@ -2984,7 +2984,7 @@ var Qt = /*#__PURE__*/function () {
|
|
2984
2984
|
isHistory: i,
|
2985
2985
|
isInitial: i
|
2986
2986
|
}));
|
2987
|
-
|
2987
|
+
j.reAddFileRefToObject(t, n), (r = e.onMessage) == null || r.call(e, n), e.dispatchEvent(new CustomEvent("message", {
|
2988
2988
|
detail: n
|
2989
2989
|
})), ue.fireOnNewMessage(e, n);
|
2990
2990
|
}
|
@@ -3012,11 +3012,11 @@ var Qt = /*#__PURE__*/function () {
|
|
3012
3012
|
}
|
3013
3013
|
}]);
|
3014
3014
|
}();
|
3015
|
-
var
|
3016
|
-
function
|
3017
|
-
_classCallCheck(this,
|
3015
|
+
var U = /*#__PURE__*/function () {
|
3016
|
+
function U() {
|
3017
|
+
_classCallCheck(this, U);
|
3018
3018
|
}
|
3019
|
-
return _createClass(
|
3019
|
+
return _createClass(U, null, [{
|
3020
3020
|
key: "applyCustomStylesToElements",
|
3021
3021
|
value: function applyCustomStylesToElements(e, t, i) {
|
3022
3022
|
if (i && (Object.assign(e.outerContainer.style, i.outerContainer), Object.assign(e.innerContainer.style, i.innerContainer), Object.assign(e.bubbleElement.style, i.bubble), t)) {
|
@@ -3028,7 +3028,7 @@ var j = /*#__PURE__*/function () {
|
|
3028
3028
|
}, {
|
3029
3029
|
key: "applySideStyles",
|
3030
3030
|
value: function applySideStyles(e, t, i, n) {
|
3031
|
-
n && (
|
3031
|
+
n && (U.applyCustomStylesToElements(e, i, n.shared), t === b.USER_ROLE ? U.applyCustomStylesToElements(e, i, n.user) : (U.applyCustomStylesToElements(e, i, n.ai), U.applyCustomStylesToElements(e, i, n[t])));
|
3032
3032
|
}
|
3033
3033
|
}, {
|
3034
3034
|
key: "isElementsStyles",
|
@@ -3040,7 +3040,7 @@ var j = /*#__PURE__*/function () {
|
|
3040
3040
|
key: "applyCustomStyles",
|
3041
3041
|
value: function applyCustomStyles(e, t, i, n, r) {
|
3042
3042
|
var o;
|
3043
|
-
r && e["default"] !== r ?
|
3043
|
+
r && e["default"] !== r ? U.isElementsStyles(r) ? (U.applyCustomStylesToElements(t, n, (o = e["default"]) == null ? void 0 : o.shared), U.applyCustomStylesToElements(t, n, r)) : (U.applySideStyles(t, i, n, e["default"]), U.applySideStyles(t, i, n, r)) : U.applySideStyles(t, i, n, e["default"]);
|
3044
3044
|
}
|
3045
3045
|
// prettier-ignore
|
3046
3046
|
}, {
|
@@ -3097,7 +3097,7 @@ var ot = /*#__PURE__*/function () {
|
|
3097
3097
|
var _this4 = this;
|
3098
3098
|
var i = this.createNewMessageElement(e, t);
|
3099
3099
|
return this.elementRef.appendChild(i.outerContainer), setTimeout(function () {
|
3100
|
-
return
|
3100
|
+
return H.scrollToBottom(_this4.elementRef);
|
3101
3101
|
}), i;
|
3102
3102
|
}
|
3103
3103
|
}, {
|
@@ -3131,7 +3131,7 @@ var ot = /*#__PURE__*/function () {
|
|
3131
3131
|
}, {
|
3132
3132
|
key: "applyCustomStyles",
|
3133
3133
|
value: function applyCustomStyles(e, t, i, n) {
|
3134
|
-
e && this.messageStyles &&
|
3134
|
+
e && this.messageStyles && U.applyCustomStyles(this.messageStyles, e, t, i, n);
|
3135
3135
|
}
|
3136
3136
|
}, {
|
3137
3137
|
key: "removeLastMessage",
|
@@ -3217,13 +3217,13 @@ var Re = /*#__PURE__*/function () {
|
|
3217
3217
|
if (this._hasStreamEnded) return;
|
3218
3218
|
if ((e == null ? void 0 : e.text) === void 0 && (e == null ? void 0 : e.html) === void 0) return console.error(A.INVALID_STREAM_EVENT);
|
3219
3219
|
var t = (e == null ? void 0 : e.text) || (e == null ? void 0 : e.html) || "",
|
3220
|
-
i =
|
3220
|
+
i = H.isScrollbarAtBottomOfElement(this._messages.elementRef),
|
3221
3221
|
n = (e == null ? void 0 : e.text) !== void 0 ? "text" : "html";
|
3222
3222
|
if (!this._elements && this._streamedContent === "") this.setInitialState(n, t, e == null ? void 0 : e.role);else {
|
3223
3223
|
if (this._streamType !== n) return console.error(A.INVALID_STREAM_EVENT_MIX);
|
3224
3224
|
this.updateBasedOnType(t, n, (r = this._elements) == null ? void 0 : r.bubbleElement, e == null ? void 0 : e.overwrite);
|
3225
3225
|
}
|
3226
|
-
i &&
|
3226
|
+
i && H.scrollToBottom(this._messages.elementRef);
|
3227
3227
|
}
|
3228
3228
|
}, {
|
3229
3229
|
key: "setInitialState",
|
@@ -3259,7 +3259,7 @@ var Re = /*#__PURE__*/function () {
|
|
3259
3259
|
var e = this._messages.textElementsToText;
|
3260
3260
|
if (!this._endStreamAfterOperation && !(this._fileAdded && !this._elements)) {
|
3261
3261
|
if (!this._elements) throw Error(A.NO_VALID_STREAM_EVENTS_SENT);
|
3262
|
-
(t = this._elements.bubbleElement) != null && t.classList.contains(Re.MESSAGE_CLASS) && (this._streamType === "text" ? (e[e.length - 1][1] = this._streamedContent, this._message && (this._message.text = this._streamedContent), this._messages.textToSpeech && rt.speak(this._streamedContent, this._messages.textToSpeech)) : this._streamType === "html" && (this._streamedContent === Re.HTML_CONTENT_PLACEHOLDER && (this._streamedContent = ((i = this._elements.bubbleElement) == null ? void 0 : i.innerHTML) || ""), this._elements &&
|
3262
|
+
(t = this._elements.bubbleElement) != null && t.classList.contains(Re.MESSAGE_CLASS) && (this._streamType === "text" ? (e[e.length - 1][1] = this._streamedContent, this._message && (this._message.text = this._streamedContent), this._messages.textToSpeech && rt.speak(this._streamedContent, this._messages.textToSpeech)) : this._streamType === "html" && (this._streamedContent === Re.HTML_CONTENT_PLACEHOLDER && (this._streamedContent = ((i = this._elements.bubbleElement) == null ? void 0 : i.innerHTML) || ""), this._elements && Q.apply(this._messages, this._elements.outerContainer), this._message && (this._message.html = this._streamedContent)), this._message && this._messages.sendClientUpdate(ot.createMessageContent(this._message), !1), this._hasStreamEnded = !0);
|
3263
3263
|
}
|
3264
3264
|
}
|
3265
3265
|
}, {
|
@@ -3558,46 +3558,46 @@ function lo(s, e) {
|
|
3558
3558
|
m.abort(), document.hidden || R();
|
3559
3559
|
}
|
3560
3560
|
l || document.addEventListener("visibilitychange", p);
|
3561
|
-
var
|
3562
|
-
|
3563
|
-
function
|
3564
|
-
document.removeEventListener("visibilitychange", p), window.clearTimeout(
|
3561
|
+
var y = ao,
|
3562
|
+
x = 0;
|
3563
|
+
function D() {
|
3564
|
+
document.removeEventListener("visibilitychange", p), window.clearTimeout(x), m.abort();
|
3565
3565
|
}
|
3566
3566
|
t == null || t.addEventListener("abort", function () {
|
3567
|
-
|
3567
|
+
D(), h();
|
3568
3568
|
});
|
3569
|
-
var
|
3569
|
+
var z = c !== null && c !== void 0 ? c : window.fetch,
|
3570
3570
|
Te = n !== null && n !== void 0 ? n : co;
|
3571
3571
|
function R() {
|
3572
3572
|
return _R.apply(this, arguments);
|
3573
3573
|
}
|
3574
3574
|
function _R() {
|
3575
3575
|
_R = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
3576
|
-
var
|
3576
|
+
var X, Z, N;
|
3577
3577
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
3578
3578
|
while (1) switch (_context4.prev = _context4.next) {
|
3579
3579
|
case 0:
|
3580
3580
|
m = new AbortController();
|
3581
3581
|
_context4.prev = 1;
|
3582
3582
|
_context4.next = 4;
|
3583
|
-
return
|
3583
|
+
return z(s, Object.assign(Object.assign({}, d), {
|
3584
3584
|
headers: f,
|
3585
3585
|
signal: m.signal
|
3586
3586
|
}));
|
3587
3587
|
case 4:
|
3588
|
-
|
3588
|
+
Z = _context4.sent;
|
3589
3589
|
_context4.next = 7;
|
3590
|
-
return Te(
|
3590
|
+
return Te(Z);
|
3591
3591
|
case 7:
|
3592
3592
|
_context4.next = 9;
|
3593
|
-
return io(
|
3593
|
+
return io(Z.body, no(so(function (N) {
|
3594
3594
|
N ? f[Pn] = N : delete f[Pn];
|
3595
3595
|
}, function (N) {
|
3596
|
-
|
3596
|
+
y = N;
|
3597
3597
|
}, r)));
|
3598
3598
|
case 9:
|
3599
3599
|
o == null || o();
|
3600
|
-
|
3600
|
+
D();
|
3601
3601
|
h();
|
3602
3602
|
_context4.next = 17;
|
3603
3603
|
break;
|
@@ -3605,10 +3605,10 @@ function lo(s, e) {
|
|
3605
3605
|
_context4.prev = 14;
|
3606
3606
|
_context4.t0 = _context4["catch"](1);
|
3607
3607
|
if (!m.signal.aborted) try {
|
3608
|
-
N = (
|
3609
|
-
window.clearTimeout(
|
3608
|
+
N = (X = a == null ? void 0 : a(_context4.t0)) !== null && X !== void 0 ? X : y;
|
3609
|
+
window.clearTimeout(x), x = window.setTimeout(R, N);
|
3610
3610
|
} catch (N) {
|
3611
|
-
|
3611
|
+
D(), u(N);
|
3612
3612
|
}
|
3613
3613
|
case 17:
|
3614
3614
|
case "end":
|
@@ -3637,10 +3637,10 @@ var C = /*#__PURE__*/function () {
|
|
3637
3637
|
var n,
|
3638
3638
|
r,
|
3639
3639
|
p,
|
3640
|
+
y,
|
3640
3641
|
x,
|
3641
|
-
|
3642
|
-
|
3643
|
-
re,
|
3642
|
+
D,
|
3643
|
+
z,
|
3644
3644
|
Te,
|
3645
3645
|
o,
|
3646
3646
|
_yield$v$processReque,
|
@@ -3680,21 +3680,21 @@ var C = /*#__PURE__*/function () {
|
|
3680
3680
|
}
|
3681
3681
|
return _context7.abrupt("return", v.onInterceptorError(i, c, h));
|
3682
3682
|
case 15:
|
3683
|
-
if (!((
|
3683
|
+
if (!((y = e.connectSettings) != null && y.handler)) {
|
3684
3684
|
_context7.next = 17;
|
3685
3685
|
break;
|
3686
3686
|
}
|
3687
3687
|
return _context7.abrupt("return", Ee.stream(e, a, i));
|
3688
3688
|
case 17:
|
3689
|
-
if (!(((
|
3689
|
+
if (!(((x = e.connectSettings) == null ? void 0 : x.url) === me.URL)) {
|
3690
3690
|
_context7.next = 19;
|
3691
3691
|
break;
|
3692
3692
|
}
|
3693
3693
|
return _context7.abrupt("return", me.requestStream(i, e.streamHandlers));
|
3694
3694
|
case 19:
|
3695
3695
|
f = new pe(i), m = v.fetch.bind(this, e, l, n);
|
3696
|
-
return _context7.abrupt("return", (lo(((
|
3697
|
-
method: ((
|
3696
|
+
return _context7.abrupt("return", (lo(((D = e.connectSettings) == null ? void 0 : D.url) || e.url || "", {
|
3697
|
+
method: ((z = e.connectSettings) == null ? void 0 : z.method) || "POST",
|
3698
3698
|
headers: l,
|
3699
3699
|
credentials: (Te = e.connectSettings) == null ? void 0 : Te.credentials,
|
3700
3700
|
body: n ? JSON.stringify(a) : a,
|
@@ -3724,7 +3724,7 @@ var C = /*#__PURE__*/function () {
|
|
3724
3724
|
},
|
3725
3725
|
onmessage: function onmessage(R) {
|
3726
3726
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
3727
|
-
var
|
3727
|
+
var X, Z, N, Oe, pt;
|
3728
3728
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
3729
3729
|
while (1) switch (_context6.prev = _context6.next) {
|
3730
3730
|
case 0:
|
@@ -3738,7 +3738,7 @@ var C = /*#__PURE__*/function () {
|
|
3738
3738
|
Oe = {};
|
3739
3739
|
}
|
3740
3740
|
_context6.next = 4;
|
3741
|
-
return (
|
3741
|
+
return (Z = (X = e.deepChat).responseInterceptor) == null ? void 0 : Z.call(X, Oe);
|
3742
3742
|
case 4:
|
3743
3743
|
_context6.t0 = _context6.sent;
|
3744
3744
|
if (_context6.t0) {
|
@@ -3772,11 +3772,11 @@ var C = /*#__PURE__*/function () {
|
|
3772
3772
|
},
|
3773
3773
|
signal: u.signal
|
3774
3774
|
})["catch"](function (R) {
|
3775
|
-
var
|
3776
|
-
i.isLastMessageError() || (
|
3775
|
+
var X;
|
3776
|
+
i.isLastMessageError() || (X = e.extractResultData) == null || X.call(e, R).then(function () {
|
3777
3777
|
v.displayError(i, R);
|
3778
|
-
})["catch"](function (
|
3779
|
-
v.displayError(i,
|
3778
|
+
})["catch"](function (Z) {
|
3779
|
+
v.displayError(i, Z);
|
3780
3780
|
});
|
3781
3781
|
}), f));
|
3782
3782
|
case 21:
|
@@ -3804,7 +3804,7 @@ var C = /*#__PURE__*/function () {
|
|
3804
3804
|
}
|
3805
3805
|
if (i.html) {
|
3806
3806
|
t.onOpen();
|
3807
|
-
var _r2 =
|
3807
|
+
var _r2 = Q.splitHTML(i.html);
|
3808
3808
|
C.populateMessages(_r2, new pe(e), n, "html");
|
3809
3809
|
}
|
3810
3810
|
}
|
@@ -3926,11 +3926,11 @@ var He = /*#__PURE__*/function () {
|
|
3926
3926
|
}();
|
3927
3927
|
He.URL = "deep-chat-demo";
|
3928
3928
|
var me = He;
|
3929
|
-
var
|
3930
|
-
function
|
3931
|
-
_classCallCheck(this,
|
3929
|
+
var W = /*#__PURE__*/function () {
|
3930
|
+
function W() {
|
3931
|
+
_classCallCheck(this, W);
|
3932
3932
|
}
|
3933
|
-
return _createClass(
|
3933
|
+
return _createClass(W, null, [{
|
3934
3934
|
key: "setup",
|
3935
3935
|
value: function setup(e) {
|
3936
3936
|
e.connectSettings.url !== me.URL && (e.permittedErrorPrefixes = ["Connection error", "Error in server message"], e.websocket = "pending");
|
@@ -3938,7 +3938,9 @@ var V = /*#__PURE__*/function () {
|
|
3938
3938
|
}, {
|
3939
3939
|
key: "createConnection",
|
3940
3940
|
value: function createConnection(e, t) {
|
3941
|
-
if (!
|
3941
|
+
if (!(e.deepChat.getRootNode({
|
3942
|
+
composed: !0
|
3943
|
+
}) instanceof Document)) return;
|
3942
3944
|
var i = e.connectSettings.websocket;
|
3943
3945
|
if (i) {
|
3944
3946
|
if (e.connectSettings.handler) return Ee.websocket(e, t);
|
@@ -3947,12 +3949,12 @@ var V = /*#__PURE__*/function () {
|
|
3947
3949
|
r = new WebSocket(e.connectSettings.url || "", n);
|
3948
3950
|
e.websocket = r, e.websocket.onopen = function () {
|
3949
3951
|
var o, a;
|
3950
|
-
t.removeError(), e.websocket && _typeof(e.websocket) == "object" &&
|
3952
|
+
t.removeError(), e.websocket && _typeof(e.websocket) == "object" && W.assignListeners(e, r, t), (a = (o = e.deepChat)._validationHandler) == null || a.call(o);
|
3951
3953
|
}, e.websocket.onerror = function (o) {
|
3952
|
-
console.error(o),
|
3954
|
+
console.error(o), W.retryConnection(e, t);
|
3953
3955
|
};
|
3954
3956
|
} catch (n) {
|
3955
|
-
console.error(n),
|
3957
|
+
console.error(n), W.retryConnection(e, t);
|
3956
3958
|
}
|
3957
3959
|
}
|
3958
3960
|
}
|
@@ -3960,8 +3962,10 @@ var V = /*#__PURE__*/function () {
|
|
3960
3962
|
key: "retryConnection",
|
3961
3963
|
value: function retryConnection(e, t) {
|
3962
3964
|
var i, n;
|
3963
|
-
(n = (i = e.deepChat)._validationHandler) == null || n.call(i),
|
3964
|
-
|
3965
|
+
(n = (i = e.deepChat)._validationHandler) == null || n.call(i), e.deepChat.getRootNode({
|
3966
|
+
composed: !0
|
3967
|
+
}) instanceof Document && (e.websocket = "pending", t.isLastMessageError() || t.addNewErrorMessage("service", "Connection error"), setTimeout(function () {
|
3968
|
+
W.createConnection(e, t);
|
3965
3969
|
}, 5e3));
|
3966
3970
|
}
|
3967
3971
|
}, {
|
@@ -4003,7 +4007,7 @@ var V = /*#__PURE__*/function () {
|
|
4003
4007
|
throw Error(A.INVALID_RESPONSE(l, "server", !!e.deepChat.responseInterceptor, c));
|
4004
4008
|
case 14:
|
4005
4009
|
if (C.isSimulation(e.stream)) {
|
4006
|
-
h =
|
4010
|
+
h = W.stream.bind(_this6, e, i, n), u = n[l.role || b.AI_ROLE];
|
4007
4011
|
C.upsertWFiles(i, h, u, d);
|
4008
4012
|
} else i.addNewMessage(d);
|
4009
4013
|
_context9.next = 20;
|
@@ -4022,7 +4026,7 @@ var V = /*#__PURE__*/function () {
|
|
4022
4026
|
return _ref2.apply(this, arguments);
|
4023
4027
|
};
|
4024
4028
|
}(), t.onclose = function () {
|
4025
|
-
console.error("Connection closed"), i.isLastMessageError() || i.addNewErrorMessage("service", "Connection error"), e.stream && e.streamHandlers.abortStream.abort(),
|
4029
|
+
console.error("Connection closed"), i.isLastMessageError() || i.addNewErrorMessage("service", "Connection error"), e.stream && e.streamHandlers.abortStream.abort(), W.createConnection(e, i);
|
4026
4030
|
};
|
4027
4031
|
}
|
4028
4032
|
}, {
|
@@ -4066,7 +4070,7 @@ var V = /*#__PURE__*/function () {
|
|
4066
4070
|
}
|
4067
4071
|
return _context10.abrupt("return", i.addNewErrorMessage("service", l));
|
4068
4072
|
case 12:
|
4069
|
-
if (
|
4073
|
+
if (W.isWebSocket(r)) {
|
4070
4074
|
_context10.next = 14;
|
4071
4075
|
break;
|
4072
4076
|
}
|
@@ -4094,7 +4098,7 @@ var V = /*#__PURE__*/function () {
|
|
4094
4098
|
}, {
|
4095
4099
|
key: "canSendMessage",
|
4096
4100
|
value: function canSendMessage(e) {
|
4097
|
-
return e ? e === "pending" ? !1 :
|
4101
|
+
return e ? e === "pending" ? !1 : W.isWebSocket(e) ? e.readyState !== void 0 && e.readyState === e.OPEN : e.isOpen : !0;
|
4098
4102
|
}
|
4099
4103
|
// if false then it is the internal websocket handler
|
4100
4104
|
}, {
|
@@ -4203,7 +4207,7 @@ var Ee = /*#__PURE__*/function () {
|
|
4203
4207
|
},
|
4204
4208
|
c = /*#__PURE__*/function () {
|
4205
4209
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(f) {
|
4206
|
-
var p,
|
4210
|
+
var p, y, m;
|
4207
4211
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
4208
4212
|
while (1) switch (_context13.prev = _context13.next) {
|
4209
4213
|
case 0:
|
@@ -4214,7 +4218,7 @@ var Ee = /*#__PURE__*/function () {
|
|
4214
4218
|
return _context13.abrupt("return");
|
4215
4219
|
case 2:
|
4216
4220
|
_context13.next = 4;
|
4217
|
-
return (
|
4221
|
+
return (y = (p = e.deepChat).responseInterceptor) == null ? void 0 : y.call(p, f);
|
4218
4222
|
case 4:
|
4219
4223
|
_context13.t0 = _context13.sent;
|
4220
4224
|
if (_context13.t0) {
|
@@ -4290,7 +4294,7 @@ var Ee = /*#__PURE__*/function () {
|
|
4290
4294
|
case 7:
|
4291
4295
|
h = _context14.t0;
|
4292
4296
|
if (!v.validateResponseFormat(h)) console.error(A.INVALID_RESPONSE(d, "server", !!e.deepChat.responseInterceptor, h)), t.addNewErrorMessage("service", "Error in server message");else if (typeof h.error == "string") console.error(h.error), t.isLastMessageError() || t.addNewErrorMessage("service", h.error);else if (C.isSimulation(e.stream)) {
|
4293
|
-
m =
|
4297
|
+
m = W.stream.bind(_this7, e, t, i.roleToStream), p = i.roleToStream[d.role || b.AI_ROLE];
|
4294
4298
|
C.upsertWFiles(t, m, p, d);
|
4295
4299
|
} else t.addNewMessage(h);
|
4296
4300
|
case 9:
|
@@ -4391,7 +4395,7 @@ var T = /*#__PURE__*/function () {
|
|
4391
4395
|
return v.processResponseByType(p);
|
4392
4396
|
}).then( /*#__PURE__*/function () {
|
4393
4397
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(p) {
|
4394
|
-
var
|
4398
|
+
var D, z, y, x;
|
4395
4399
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
4396
4400
|
while (1) switch (_context15.prev = _context15.next) {
|
4397
4401
|
case 0:
|
@@ -4402,7 +4406,7 @@ var T = /*#__PURE__*/function () {
|
|
4402
4406
|
return _context15.abrupt("return");
|
4403
4407
|
case 2:
|
4404
4408
|
_context15.next = 4;
|
4405
|
-
return (
|
4409
|
+
return (z = (D = e.deepChat).responseInterceptor) == null ? void 0 : z.call(D, p);
|
4406
4410
|
case 4:
|
4407
4411
|
_context15.t0 = _context15.sent;
|
4408
4412
|
if (_context15.t0) {
|
@@ -4411,24 +4415,24 @@ var T = /*#__PURE__*/function () {
|
|
4411
4415
|
}
|
4412
4416
|
_context15.t0 = p;
|
4413
4417
|
case 7:
|
4414
|
-
|
4418
|
+
y = _context15.t0;
|
4415
4419
|
_context15.next = 10;
|
4416
|
-
return e.extractResultData(
|
4420
|
+
return e.extractResultData(y, h, o);
|
4417
4421
|
case 10:
|
4418
|
-
|
4422
|
+
x = _context15.sent;
|
4419
4423
|
if (d) {
|
4420
4424
|
_context15.next = 13;
|
4421
4425
|
break;
|
4422
4426
|
}
|
4423
4427
|
throw p;
|
4424
4428
|
case 13:
|
4425
|
-
if (!(!
|
4429
|
+
if (!(!x || _typeof(x) != "object")) {
|
4426
4430
|
_context15.next = 15;
|
4427
4431
|
break;
|
4428
4432
|
}
|
4429
|
-
throw Error(A.INVALID_RESPONSE(p, "response", !!e.deepChat.responseInterceptor,
|
4433
|
+
throw Error(A.INVALID_RESPONSE(p, "response", !!e.deepChat.responseInterceptor, y));
|
4430
4434
|
case 15:
|
4431
|
-
|
4435
|
+
x.makingAnotherRequest || (C.isSimulatable(e.stream, x) ? C.simulate(i, e.streamHandlers, x) : (i.addNewMessage(x), c()));
|
4432
4436
|
case 16:
|
4433
4437
|
case "end":
|
4434
4438
|
return _context15.stop();
|
@@ -4725,7 +4729,7 @@ var We = /*#__PURE__*/function () {
|
|
4725
4729
|
var _a$url;
|
4726
4730
|
_classCallCheck(this, We);
|
4727
4731
|
var n, r, o, a, l;
|
4728
|
-
this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = We.canSendMessage, this.connectSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (n = e.connect) == null ? void 0 : n.additionalBodyProps), this.totalMessagesMaxCharLength = (r = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : r.totalMessagesMaxCharLength, this.maxMessages = (o = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : o.maxMessages, I.set(e, this, t), e.connect && (this.connectSettings = e.connect), this.demo && ((_a$url = (a = this.connectSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = me.URL), this.connectSettings.websocket &&
|
4732
|
+
this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = We.canSendMessage, this.connectSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (n = e.connect) == null ? void 0 : n.additionalBodyProps), this.totalMessagesMaxCharLength = (r = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : r.totalMessagesMaxCharLength, this.maxMessages = (o = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : o.maxMessages, I.set(e, this, t), e.connect && (this.connectSettings = e.connect), this.demo && ((_a$url = (a = this.connectSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = me.URL), this.connectSettings.websocket && W.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || ue.checkForStream(this.deepChat);
|
4729
4733
|
}
|
4730
4734
|
return _createClass(We, [{
|
4731
4735
|
key: "verifyKey",
|
@@ -4855,7 +4859,7 @@ var We = /*#__PURE__*/function () {
|
|
4855
4859
|
n = _objectSpread({
|
4856
4860
|
messages: i
|
4857
4861
|
}, this.rawBody);
|
4858
|
-
|
4862
|
+
W.sendWebsocket(this, n, t, !1);
|
4859
4863
|
} else this.callServiceAPI(t, i, e.files);
|
4860
4864
|
case 4:
|
4861
4865
|
case "end":
|
@@ -4936,17 +4940,17 @@ var We = /*#__PURE__*/function () {
|
|
4936
4940
|
}
|
4937
4941
|
}]);
|
4938
4942
|
}();
|
4939
|
-
var
|
4943
|
+
var q = /*#__PURE__*/function (_We) {
|
4940
4944
|
// prettier-ignore
|
4941
|
-
function
|
4945
|
+
function q(e, t, i, n, r) {
|
4942
4946
|
var _this8;
|
4943
|
-
_classCallCheck(this,
|
4947
|
+
_classCallCheck(this, q);
|
4944
4948
|
var o;
|
4945
|
-
_this8 = _callSuper(this,
|
4949
|
+
_this8 = _callSuper(this, q, [e, r]), _this8.insertKeyPlaceholderText = "API Key", _this8.keyHelpUrl = "", Object.assign(_this8.rawBody, (o = e.connect) == null ? void 0 : o.additionalBodyProps), _this8.keyVerificationDetails = t, _this8.buildHeadersFunc = i, n && _this8.setApiKeyProperties(n), _this8.connectSettings = _this8.buildConnectSettings(_this8.key || "", e.connect);
|
4946
4950
|
return _this8;
|
4947
4951
|
}
|
4948
|
-
_inherits(
|
4949
|
-
return _createClass(
|
4952
|
+
_inherits(q, _We);
|
4953
|
+
return _createClass(q, [{
|
4950
4954
|
key: "setApiKeyProperties",
|
4951
4955
|
value: function setApiKeyProperties(e) {
|
4952
4956
|
this.key = e.key, e.validateKeyProperty && (this.validateKeyProperty = e.validateKeyProperty);
|
@@ -5050,11 +5054,11 @@ ve._attributes_ = {}, ve._attributeToProperty_ = {};
|
|
5050
5054
|
var Xi = ve;
|
5051
5055
|
var ho = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path d=\"\n\t\t\tM669.727,273.516c-22.891-2.476-46.15-3.895-69.727-4.248c-103.025,0.457-209.823,25.517-310.913,73.536\n\t\t\tc-75.058,37.122-148.173,89.529-211.67,154.174C46.232,529.978,6.431,577.76,0,628.74c0.76,44.162,48.153,98.67,77.417,131.764\n\t\t\tc59.543,62.106,130.754,113.013,211.67,154.174c2.75,1.335,5.51,2.654,8.276,3.955l-75.072,131.102l102.005,60.286l551.416-960.033\n\t\t\tl-98.186-60.008L669.727,273.516z M902.563,338.995l-74.927,129.857c34.47,44.782,54.932,100.006,54.932,159.888\n\t\t\tc0,149.257-126.522,270.264-282.642,270.264c-6.749,0-13.29-0.728-19.922-1.172l-49.585,85.84c22.868,2.449,45.99,4.233,69.58,4.541\n\t\t\tc103.123-0.463,209.861-25.812,310.84-73.535c75.058-37.122,148.246-89.529,211.743-154.174\n\t\t\tc31.186-32.999,70.985-80.782,77.417-131.764c-0.76-44.161-48.153-98.669-77.417-131.763\n\t\t\tc-59.543-62.106-130.827-113.013-211.743-154.175C908.108,341.478,905.312,340.287,902.563,338.995L902.563,338.995z\n\t\t\tM599.927,358.478c6.846,0,13.638,0.274,20.361,0.732l-58.081,100.561c-81.514,16.526-142.676,85.88-142.676,168.897\n\t\t\tc0,20.854,3.841,40.819,10.913,59.325c0.008,0.021-0.008,0.053,0,0.074l-58.228,100.854\n\t\t\tc-34.551-44.823-54.932-100.229-54.932-160.182C317.285,479.484,443.808,358.477,599.927,358.478L599.927,358.478z M768.896,570.513\n\t\t\tL638.013,797.271c81.076-16.837,141.797-85.875,141.797-168.603C779.81,608.194,775.724,588.729,768.896,570.513L768.896,570.513z\"\n\t\t\t/>\n</svg>\n",
|
5052
5056
|
uo = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path id=\"path6686\" inkscape:connector-curvature=\"0\" d=\"M779.843,599.925c0,95.331-80.664,172.612-180.169,172.612\n\t\t\tc-99.504,0-180.168-77.281-180.168-172.612c0-95.332,80.664-172.612,180.168-172.612\n\t\t\tC699.179,427.312,779.843,504.594,779.843,599.925z M600,240.521c-103.025,0.457-209.814,25.538-310.904,73.557\n\t\t\tc-75.058,37.122-148.206,89.496-211.702,154.141C46.208,501.218,6.431,549,0,599.981c0.76,44.161,48.13,98.669,77.394,131.763\n\t\t\tc59.543,62.106,130.786,113.018,211.702,154.179c94.271,45.751,198.616,72.092,310.904,73.557\n\t\t\tc103.123-0.464,209.888-25.834,310.866-73.557c75.058-37.122,148.243-89.534,211.74-154.179\n\t\t\tc31.185-32.999,70.962-80.782,77.394-131.763c-0.76-44.161-48.13-98.671-77.394-131.764\n\t\t\tc-59.543-62.106-130.824-112.979-211.74-154.141C816.644,268.36,712.042,242.2,600,240.521z M599.924,329.769\n\t\t\tc156.119,0,282.675,120.994,282.675,270.251c0,149.256-126.556,270.25-282.675,270.25S317.249,749.275,317.249,600.02\n\t\t\tC317.249,450.763,443.805,329.769,599.924,329.769L599.924,329.769z\"/>\n</svg>\n";
|
5053
|
-
var
|
5054
|
-
function
|
5055
|
-
_classCallCheck(this,
|
5057
|
+
var ee = /*#__PURE__*/function () {
|
5058
|
+
function ee() {
|
5059
|
+
_classCallCheck(this, ee);
|
5056
5060
|
}
|
5057
|
-
return _createClass(
|
5061
|
+
return _createClass(ee, null, [{
|
5058
5062
|
key: "createSVGElement",
|
5059
5063
|
value: function createSVGElement(e) {
|
5060
5064
|
return new DOMParser().parseFromString(e, "image/svg+xml").documentElement;
|
@@ -5075,7 +5079,7 @@ var Ie = /*#__PURE__*/function () {
|
|
5075
5079
|
}, {
|
5076
5080
|
key: "createIconElement",
|
5077
5081
|
value: function createIconElement(e, t) {
|
5078
|
-
var i =
|
5082
|
+
var i = ee.createSVGElement(e);
|
5079
5083
|
return i.id = t, i.classList.add("visibility-icon"), i;
|
5080
5084
|
}
|
5081
5085
|
// prettier-ignore
|
@@ -5093,11 +5097,11 @@ var Ie = /*#__PURE__*/function () {
|
|
5093
5097
|
}();
|
5094
5098
|
Ie.VISIBLE_ICON_ID = "visible-icon";
|
5095
5099
|
var Zi = Ie;
|
5096
|
-
var
|
5097
|
-
function
|
5098
|
-
_classCallCheck(this,
|
5100
|
+
var F = /*#__PURE__*/function () {
|
5101
|
+
function F() {
|
5102
|
+
_classCallCheck(this, F);
|
5099
5103
|
}
|
5100
|
-
return _createClass(
|
5104
|
+
return _createClass(F, null, [{
|
5101
5105
|
key: "createCautionText",
|
5102
5106
|
value: function createCautionText() {
|
5103
5107
|
var e = document.createElement("a");
|
@@ -5123,13 +5127,13 @@ var D = /*#__PURE__*/function () {
|
|
5123
5127
|
i.id = "insert-key-help-text-container";
|
5124
5128
|
var n = document.createElement("div");
|
5125
5129
|
n.id = "insert-key-help-text-contents";
|
5126
|
-
var r =
|
5130
|
+
var r = F.createFailText();
|
5127
5131
|
if (n.appendChild(r), e) {
|
5128
|
-
var o =
|
5132
|
+
var o = F.createHelpLink(e);
|
5129
5133
|
n.appendChild(o);
|
5130
5134
|
}
|
5131
5135
|
if (t === !0) {
|
5132
|
-
var _o2 =
|
5136
|
+
var _o2 = F.createCautionText();
|
5133
5137
|
n.appendChild(_o2);
|
5134
5138
|
}
|
5135
5139
|
return i.appendChild(n), {
|
@@ -5160,10 +5164,10 @@ var D = /*#__PURE__*/function () {
|
|
5160
5164
|
value: function addVerificationEvents(e, t, i, n, r) {
|
5161
5165
|
var o = {
|
5162
5166
|
onSuccess: n,
|
5163
|
-
onFail:
|
5164
|
-
onLoad:
|
5167
|
+
onFail: F.onFail.bind(this, e, t, i),
|
5168
|
+
onLoad: F.onLoad.bind(this, e, t)
|
5165
5169
|
},
|
5166
|
-
a =
|
5170
|
+
a = F.verifyKey.bind(this, e, o, r);
|
5167
5171
|
t.onclick = a, e.onkeydown = function (l) {
|
5168
5172
|
!e.classList.contains("loading") && l.key === L.ENTER && a();
|
5169
5173
|
};
|
@@ -5185,7 +5189,7 @@ var D = /*#__PURE__*/function () {
|
|
5185
5189
|
var t = document.createElement("div");
|
5186
5190
|
t.id = "insert-key-input-container";
|
5187
5191
|
var i = document.createElement("input");
|
5188
|
-
return i.id = "insert-key-input", i.placeholder = e || "API Key", i.type = "password", i.classList.add("insert-key-input-valid"), i.onfocus =
|
5192
|
+
return i.id = "insert-key-input", i.placeholder = e || "API Key", i.type = "password", i.classList.add("insert-key-input-valid"), i.onfocus = F.onInputFocus, t.appendChild(i), t;
|
5189
5193
|
}
|
5190
5194
|
// prettier-ignore
|
5191
5195
|
}, {
|
@@ -5194,51 +5198,51 @@ var D = /*#__PURE__*/function () {
|
|
5194
5198
|
var d;
|
5195
5199
|
var i = document.createElement("div");
|
5196
5200
|
i.id = "insert-key-contents";
|
5197
|
-
var n =
|
5201
|
+
var n = F.createInput(t.insertKeyPlaceholderText),
|
5198
5202
|
r = n.children[0],
|
5199
5203
|
o = Zi.create(r);
|
5200
5204
|
n.appendChild(o), i.appendChild(n);
|
5201
|
-
var a =
|
5202
|
-
|
5203
|
-
l =
|
5204
|
-
c =
|
5205
|
-
return i.appendChild(a), i.appendChild(l),
|
5205
|
+
var a = F.createStartButton(),
|
5206
|
+
_F$createHelpTextCont = F.createHelpTextContainer(t.keyHelpUrl, (d = t.deepChat._insertKeyViewStyles) == null ? void 0 : d.displayCautionText),
|
5207
|
+
l = _F$createHelpTextCont.helpTextContainerElement,
|
5208
|
+
c = _F$createHelpTextCont.failTextElement;
|
5209
|
+
return i.appendChild(a), i.appendChild(l), F.addVerificationEvents(r, a, c, e, t), i;
|
5206
5210
|
}
|
5207
5211
|
}, {
|
5208
5212
|
key: "createElements",
|
5209
5213
|
value: function createElements(e, t) {
|
5210
5214
|
var i = document.createElement("div");
|
5211
5215
|
i.id = "insert-key-view";
|
5212
|
-
var n =
|
5216
|
+
var n = F.createContents(e, t);
|
5213
5217
|
return i.appendChild(n), i;
|
5214
5218
|
}
|
5215
5219
|
}, {
|
5216
5220
|
key: "render",
|
5217
5221
|
value: function render(e, t, i) {
|
5218
|
-
var n =
|
5222
|
+
var n = F.createElements(t, i);
|
5219
5223
|
e.replaceChildren(n);
|
5220
5224
|
}
|
5221
5225
|
}]);
|
5222
5226
|
}();
|
5223
|
-
var
|
5224
|
-
function
|
5225
|
-
_classCallCheck(this,
|
5227
|
+
var Y = /*#__PURE__*/function () {
|
5228
|
+
function Y() {
|
5229
|
+
_classCallCheck(this, Y);
|
5226
5230
|
}
|
5227
|
-
return _createClass(
|
5231
|
+
return _createClass(Y, null, [{
|
5228
5232
|
key: "enableButtons",
|
5229
5233
|
value: function enableButtons(e, t) {
|
5230
5234
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
5231
5235
|
window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i < Rt.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
|
5232
|
-
return
|
5236
|
+
return Y.enableButtons(e, t, i + 1);
|
5233
5237
|
}, 250);
|
5234
5238
|
}
|
5235
5239
|
// prettier-ignore
|
5236
5240
|
}, {
|
5237
5241
|
key: "setUpInitial",
|
5238
5242
|
value: function setUpInitial(e, t, i, n) {
|
5239
|
-
var r = (t == null ? void 0 : t.downloadClass) ||
|
5240
|
-
o = (t == null ? void 0 : t.uploadClass) ||
|
5241
|
-
a = (t == null ? void 0 : t.fileInputClass) ||
|
5243
|
+
var r = (t == null ? void 0 : t.downloadClass) || Y.DOWNLOAD_BUTTON_CLASS,
|
5244
|
+
o = (t == null ? void 0 : t.uploadClass) || Y.UPLOAD_BUTTON_CLASS,
|
5245
|
+
a = (t == null ? void 0 : t.fileInputClass) || Y.FILE_INPUT_CLASS;
|
5242
5246
|
return setTimeout(function () {
|
5243
5247
|
var l = i == null ? void 0 : i.getElementsByClassName(r)[0],
|
5244
5248
|
c = i == null ? void 0 : i.getElementsByClassName(a)[0],
|
@@ -5249,7 +5253,7 @@ var J = /*#__PURE__*/function () {
|
|
5249
5253
|
c.files && c.files.length > 0 && e(c.files);
|
5250
5254
|
}), d && (d.onclick = function () {
|
5251
5255
|
return c.click();
|
5252
|
-
}), (l || d) &&
|
5256
|
+
}), (l || d) && Y.enableButtons(l, d);
|
5253
5257
|
}), (t == null ? void 0 : t.initialHtml) || "<div>\n Download or upload a web model that will run entirely on your browser: <br/> \n <button disabled class=\"".concat(r, " deep-chat-button deep-chat-web-model-button\">Download</button>\n ").concat(n ? "" : "<input type=\"file\" class=\"".concat(a, "\" hidden multiple />\n <button disabled class=\"").concat(o, " deep-chat-button deep-chat-web-model-button\">Upload</button>"), "\n </div>");
|
5254
5258
|
}
|
5255
5259
|
}, {
|
@@ -5274,18 +5278,18 @@ var J = /*#__PURE__*/function () {
|
|
5274
5278
|
}, {
|
5275
5279
|
key: "setUpAfterLoad",
|
5276
5280
|
value: function setUpAfterLoad(e, t, i, n) {
|
5277
|
-
var r = (t == null ? void 0 : t.exportFilesClass) ||
|
5281
|
+
var r = (t == null ? void 0 : t.exportFilesClass) || Y.EXPORT_BUTTON_CLASS;
|
5278
5282
|
return setTimeout(function () {
|
5279
5283
|
var o = i == null ? void 0 : i.getElementsByClassName(r)[0];
|
5280
5284
|
o && (o.onclick = function () {
|
5281
|
-
return
|
5285
|
+
return Y.exportFile(e);
|
5282
5286
|
});
|
5283
5287
|
}), (t == null ? void 0 : t.afterLoadHtml) || "<div>\n Model loaded successfully and has been cached for future requests.\n ".concat(n ? "" : "<br/> <button style=\"margin-top: 5px\" class=\"".concat(r, " deep-chat-button\">Export</button>"), "\n </div>");
|
5284
5288
|
}
|
5285
5289
|
}]);
|
5286
5290
|
}();
|
5287
|
-
|
5288
|
-
var ti =
|
5291
|
+
Y.DOWNLOAD_BUTTON_CLASS = "deep-chat-download-button", Y.UPLOAD_BUTTON_CLASS = "deep-chat-upload-button", Y.FILE_INPUT_CLASS = "deep-chat-file-input", Y.EXPORT_BUTTON_CLASS = "deep-chat-export-button";
|
5292
|
+
var ti = Y;
|
5289
5293
|
var On = {
|
5290
5294
|
model_list: [
|
5291
5295
|
// Llama-2
|
@@ -5453,7 +5457,7 @@ var On = {
|
|
5453
5457
|
var t;
|
5454
5458
|
((t = this._webModel.introMessage) == null ? void 0 : t.autoScroll) !== !1 && setTimeout(function () {
|
5455
5459
|
var i, n;
|
5456
|
-
(i = _this13._messages) != null && i.elementRef &&
|
5460
|
+
(i = _this13._messages) != null && i.elementRef && H.scrollToTop((n = _this13._messages) == null ? void 0 : n.elementRef);
|
5457
5461
|
}, e);
|
5458
5462
|
}
|
5459
5463
|
// prettier-ignore
|
@@ -5585,7 +5589,7 @@ var On = {
|
|
5585
5589
|
sendUpdate: !1
|
5586
5590
|
}), i && (setTimeout(function () {
|
5587
5591
|
var p;
|
5588
|
-
return
|
5592
|
+
return H.scrollToBottom((p = _this14._messages) == null ? void 0 : p.elementRef);
|
5589
5593
|
}), i = !1);
|
5590
5594
|
};
|
5591
5595
|
w.chat.setInitProgressCallback(n);
|
@@ -5978,7 +5982,7 @@ var ii = /*#__PURE__*/function () {
|
|
5978
5982
|
}
|
5979
5983
|
}]);
|
5980
5984
|
}();
|
5981
|
-
var St = /*#__PURE__*/function (
|
5985
|
+
var St = /*#__PURE__*/function (_q) {
|
5982
5986
|
// prettier-ignore
|
5983
5987
|
function St(e, t, i, n, r, o) {
|
5984
5988
|
var _this16;
|
@@ -5987,7 +5991,7 @@ var St = /*#__PURE__*/function (_H) {
|
|
5987
5991
|
return _this16;
|
5988
5992
|
}
|
5989
5993
|
// prettier-ignore
|
5990
|
-
_inherits(St,
|
5994
|
+
_inherits(St, _q);
|
5991
5995
|
return _createClass(St, [{
|
5992
5996
|
key: "preprocessBody",
|
5993
5997
|
value: function preprocessBody(e, t, i) {
|
@@ -6026,7 +6030,7 @@ var St = /*#__PURE__*/function (_H) {
|
|
6026
6030
|
return callServiceAPI;
|
6027
6031
|
}()
|
6028
6032
|
}]);
|
6029
|
-
}(
|
6033
|
+
}(q);
|
6030
6034
|
St.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
6031
6035
|
var we = St;
|
6032
6036
|
var Dt = /*#__PURE__*/function (_we) {
|
@@ -6211,7 +6215,7 @@ var ge = /*#__PURE__*/function () {
|
|
6211
6215
|
}
|
6212
6216
|
}]);
|
6213
6217
|
}();
|
6214
|
-
var _i = /*#__PURE__*/function (
|
6218
|
+
var _i = /*#__PURE__*/function (_q2) {
|
6215
6219
|
// prettier-ignore
|
6216
6220
|
function _i(e, t, i, n, r) {
|
6217
6221
|
var _this18;
|
@@ -6219,9 +6223,9 @@ var _i = /*#__PURE__*/function (_H2) {
|
|
6219
6223
|
_this18 = _callSuper(this, _i, [e, t, i, n, r]), _this18.insertKeyPlaceholderText = "Stability AI API Key", _this18.keyHelpUrl = "https://platform.stability.ai/docs/getting-started/authentication", _this18.permittedErrorPrefixes = ["Incorrect", "invalid_"];
|
6220
6224
|
return _this18;
|
6221
6225
|
}
|
6222
|
-
_inherits(_i,
|
6226
|
+
_inherits(_i, _q2);
|
6223
6227
|
return _createClass(_i);
|
6224
|
-
}(
|
6228
|
+
}(q);
|
6225
6229
|
var ni = /*#__PURE__*/function (_i10) {
|
6226
6230
|
function ni(e) {
|
6227
6231
|
var _this19;
|
@@ -7012,16 +7016,16 @@ var ai = /*#__PURE__*/function () {
|
|
7012
7016
|
}
|
7013
7017
|
}]);
|
7014
7018
|
}();
|
7015
|
-
var un = /*#__PURE__*/function (
|
7019
|
+
var un = /*#__PURE__*/function (_q3) {
|
7016
7020
|
function un(e, t, i, n, r) {
|
7017
7021
|
var _this26;
|
7018
7022
|
_classCallCheck(this, un);
|
7019
7023
|
_this26 = _callSuper(this, un, [e, ai.buildKeyVerificationDetails(), ai.buildHeaders, r]), _this26.insertKeyPlaceholderText = "Cohere API Key", _this26.keyHelpUrl = "https://dashboard.cohere.ai/api-keys", _this26.permittedErrorPrefixes = ["invalid"], _this26.url = t, _this26.textInputPlaceholderText = i, n && _typeof(n) == "object" && Object.assign(_this26.rawBody, n);
|
7020
7024
|
return _this26;
|
7021
7025
|
}
|
7022
|
-
_inherits(un,
|
7026
|
+
_inherits(un, _q3);
|
7023
7027
|
return _createClass(un);
|
7024
|
-
}(
|
7028
|
+
}(q);
|
7025
7029
|
var _o = /*#__PURE__*/function (_un) {
|
7026
7030
|
function _o(e) {
|
7027
7031
|
_classCallCheck(this, _o);
|
@@ -7238,7 +7242,7 @@ var P = /*#__PURE__*/function () {
|
|
7238
7242
|
}()
|
7239
7243
|
}]);
|
7240
7244
|
}();
|
7241
|
-
var nt = /*#__PURE__*/function (
|
7245
|
+
var nt = /*#__PURE__*/function (_q4) {
|
7242
7246
|
function nt(e) {
|
7243
7247
|
var _o$model, _a$voice;
|
7244
7248
|
var _this27;
|
@@ -7251,7 +7255,7 @@ var nt = /*#__PURE__*/function (_H4) {
|
|
7251
7255
|
_typeof(n) == "object" && Object.assign(_this27.rawBody, n), (_o$model = (o = _this27.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model = nt.DEFAULT_MODEL, (_a$voice = (a = _this27.rawBody).voice) !== null && _a$voice !== void 0 ? _a$voice : a.voice = nt.DEFAULT_VOIDE, _this27.textInputPlaceholderText = "Insert text to generate audio", _this27.rawBody.response_format = "mp3";
|
7252
7256
|
return _this27;
|
7253
7257
|
}
|
7254
|
-
_inherits(nt,
|
7258
|
+
_inherits(nt, _q4);
|
7255
7259
|
return _createClass(nt, [{
|
7256
7260
|
key: "preprocessBody",
|
7257
7261
|
value: function preprocessBody(e, t) {
|
@@ -7332,10 +7336,10 @@ var nt = /*#__PURE__*/function (_H4) {
|
|
7332
7336
|
return extractResultData;
|
7333
7337
|
}()
|
7334
7338
|
}]);
|
7335
|
-
}(
|
7339
|
+
}(q);
|
7336
7340
|
nt.DEFAULT_MODEL = "tts-1", nt.DEFAULT_VOIDE = "alloy";
|
7337
7341
|
var Yi = nt;
|
7338
|
-
var le = /*#__PURE__*/function (
|
7342
|
+
var le = /*#__PURE__*/function (_q5) {
|
7339
7343
|
function le(e) {
|
7340
7344
|
var _o$model2;
|
7341
7345
|
var _this28;
|
@@ -7350,7 +7354,7 @@ var le = /*#__PURE__*/function (_H5) {
|
|
7350
7354
|
_typeof(n) == "object" && (_this28.processConfig(n), le.cleanConfig(n), Object.assign(_this28.rawBody, n)), (_o$model2 = (o = _this28.rawBody).model) !== null && _o$model2 !== void 0 ? _o$model2 : o.model = le.DEFAULT_MODEL, _this28.rawBody.response_format = "json", _this28.canSendMessage = le.canSendFileMessage;
|
7351
7355
|
return _this28;
|
7352
7356
|
}
|
7353
|
-
_inherits(le,
|
7357
|
+
_inherits(le, _q5);
|
7354
7358
|
return _createClass(le, [{
|
7355
7359
|
key: "processConfig",
|
7356
7360
|
value: function processConfig(e) {
|
@@ -7445,14 +7449,14 @@ var le = /*#__PURE__*/function (_H5) {
|
|
7445
7449
|
}), i;
|
7446
7450
|
}
|
7447
7451
|
}]);
|
7448
|
-
}(
|
7452
|
+
}(q);
|
7449
7453
|
le.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions", le.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations", le.DEFAULT_MODEL = "whisper-1";
|
7450
7454
|
var Qi = le;
|
7451
|
-
var
|
7452
|
-
function
|
7453
|
-
_classCallCheck(this,
|
7455
|
+
var re = /*#__PURE__*/function () {
|
7456
|
+
function re() {
|
7457
|
+
_classCallCheck(this, re);
|
7454
7458
|
}
|
7455
|
-
return _createClass(
|
7459
|
+
return _createClass(re, null, [{
|
7456
7460
|
key: "buildTextToSpeechHeaders",
|
7457
7461
|
value: function buildTextToSpeechHeaders(e, t) {
|
7458
7462
|
return {
|
@@ -7486,7 +7490,7 @@ var se = /*#__PURE__*/function () {
|
|
7486
7490
|
"Ocp-Apim-Subscription-Key": "".concat(t)
|
7487
7491
|
};
|
7488
7492
|
},
|
7489
|
-
handleVerificationResult:
|
7493
|
+
handleVerificationResult: re.handleSpeechVerificationResult
|
7490
7494
|
};
|
7491
7495
|
}
|
7492
7496
|
}, {
|
@@ -7515,7 +7519,7 @@ var se = /*#__PURE__*/function () {
|
|
7515
7519
|
"Ocp-Apim-Subscription-Key": "".concat(t)
|
7516
7520
|
};
|
7517
7521
|
},
|
7518
|
-
handleVerificationResult:
|
7522
|
+
handleVerificationResult: re.handleLanguageVerificationResult
|
7519
7523
|
};
|
7520
7524
|
}
|
7521
7525
|
// prettier-ignore
|
@@ -7533,9 +7537,9 @@ var se = /*#__PURE__*/function () {
|
|
7533
7537
|
url: "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=es",
|
7534
7538
|
method: "POST",
|
7535
7539
|
createHeaders: function createHeaders(t) {
|
7536
|
-
return
|
7540
|
+
return re.buildTranslationHeaders(e, t);
|
7537
7541
|
},
|
7538
|
-
handleVerificationResult:
|
7542
|
+
handleVerificationResult: re.handleTranslationVerificationResult
|
7539
7543
|
};
|
7540
7544
|
}
|
7541
7545
|
}, {
|
@@ -7549,19 +7553,19 @@ var se = /*#__PURE__*/function () {
|
|
7549
7553
|
}
|
7550
7554
|
}]);
|
7551
7555
|
}();
|
7552
|
-
var wo = /*#__PURE__*/function (
|
7556
|
+
var wo = /*#__PURE__*/function (_q6) {
|
7553
7557
|
// prettier-ignore
|
7554
7558
|
function wo(e, t, i, n, r) {
|
7555
7559
|
var _this29;
|
7556
7560
|
_classCallCheck(this, wo);
|
7557
|
-
_this29 = _callSuper(this, wo, [e,
|
7561
|
+
_this29 = _callSuper(this, wo, [e, re.buildLanguageKeyVerificationDetails(i), t, n, r]), _this29.insertKeyPlaceholderText = "Azure Language Subscription Key", _this29.keyHelpUrl =
|
7558
7562
|
// eslint-disable-next-line max-len
|
7559
7563
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this29.permittedErrorPrefixes = ["Access"];
|
7560
7564
|
return _this29;
|
7561
7565
|
}
|
7562
|
-
_inherits(wo,
|
7566
|
+
_inherits(wo, _q6);
|
7563
7567
|
return _createClass(wo);
|
7564
|
-
}(
|
7568
|
+
}(q);
|
7565
7569
|
var To = /*#__PURE__*/function (_wo) {
|
7566
7570
|
function To(e) {
|
7567
7571
|
var _a$language;
|
@@ -7570,7 +7574,7 @@ var To = /*#__PURE__*/function (_wo) {
|
|
7570
7574
|
var n, r, o, a;
|
7571
7575
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.summarization,
|
7572
7576
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
7573
|
-
_this30 = _callSuper(this, To, [e,
|
7577
|
+
_this30 = _callSuper(this, To, [e, re.buildSummarizationHeader, t.endpoint, i]), _this30.url = "", _this30.textInputPlaceholderText = "Insert text to summarize", (_a$language = (a = _this30.rawBody).language) !== null && _a$language !== void 0 ? _a$language : a.language = "en", Object.assign(_this30.rawBody, t), _this30.url = "".concat(t.endpoint, "/language/analyze-text/jobs?api-version=2022-10-01-preview");
|
7574
7578
|
return _this30;
|
7575
7579
|
}
|
7576
7580
|
_inherits(To, _wo);
|
@@ -7820,7 +7824,7 @@ var vt = /*#__PURE__*/function () {
|
|
7820
7824
|
}
|
7821
7825
|
}]);
|
7822
7826
|
}();
|
7823
|
-
var fn = /*#__PURE__*/function (
|
7827
|
+
var fn = /*#__PURE__*/function (_q7) {
|
7824
7828
|
function fn(e) {
|
7825
7829
|
var _this31;
|
7826
7830
|
_classCallCheck(this, fn);
|
@@ -7831,7 +7835,7 @@ var fn = /*#__PURE__*/function (_H7) {
|
|
7831
7835
|
}]), _this31.insertKeyPlaceholderText = "AssemblyAI API Key", _this31.keyHelpUrl = "https://www.assemblyai.com/app/account", _this31.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>AssemblyAI Audio</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"https://www.assemblyai.com/docs/Guides/transcribing_an_audio_file#get-started\">here</a> for more info.\n </p>", _this31.url = "https://api.assemblyai.com/v2/upload", _this31.isTextInputDisabled = !0, _this31.textInputPlaceholderText = "Upload an audio file", _this31.permittedErrorPrefixes = ["Authentication", "Invalid"], _this31.canSendMessage = fn.canFileSendMessage;
|
7832
7836
|
return _this31;
|
7833
7837
|
}
|
7834
|
-
_inherits(fn,
|
7838
|
+
_inherits(fn, _q7);
|
7835
7839
|
return _createClass(fn, [{
|
7836
7840
|
key: "callServiceAPI",
|
7837
7841
|
value: function () {
|
@@ -7903,20 +7907,20 @@ var fn = /*#__PURE__*/function (_H7) {
|
|
7903
7907
|
return !!(t != null && t[0]);
|
7904
7908
|
}
|
7905
7909
|
}]);
|
7906
|
-
}(
|
7907
|
-
var ls = /*#__PURE__*/function (
|
7910
|
+
}(q);
|
7911
|
+
var ls = /*#__PURE__*/function (_q8) {
|
7908
7912
|
// prettier-ignore
|
7909
7913
|
function ls(e, t, i, n, r) {
|
7910
7914
|
var _this32;
|
7911
7915
|
_classCallCheck(this, ls);
|
7912
|
-
_this32 = _callSuper(this, ls, [e,
|
7916
|
+
_this32 = _callSuper(this, ls, [e, re.buildSpeechKeyVerificationDetails(i), t, n, r]), _this32.insertKeyPlaceholderText = "Azure Speech Subscription Key", _this32.keyHelpUrl =
|
7913
7917
|
// eslint-disable-next-line max-len
|
7914
7918
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal";
|
7915
7919
|
return _this32;
|
7916
7920
|
}
|
7917
|
-
_inherits(ls,
|
7921
|
+
_inherits(ls, _q8);
|
7918
7922
|
return _createClass(ls);
|
7919
|
-
}(
|
7923
|
+
}(q);
|
7920
7924
|
var vi = /*#__PURE__*/function (_ls) {
|
7921
7925
|
// prettier-ignore
|
7922
7926
|
function vi(e) {
|
@@ -7926,7 +7930,7 @@ var vi = /*#__PURE__*/function (_ls) {
|
|
7926
7930
|
var n, r, o, a, l, c;
|
7927
7931
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.textToSpeech,
|
7928
7932
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
7929
|
-
_this33 = _callSuper(this, vi, [e,
|
7933
|
+
_this33 = _callSuper(this, vi, [e, re.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, i]), _this33.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(vi.HELP_LINK, "\">here</a> for more info.\n </p>"), _this33.url = "", Object.assign(_this33.rawBody, t), (_a$lang = (a = _this33.rawBody).lang) !== null && _a$lang !== void 0 ? _a$lang : a.lang = "en-US", (_l$name = (l = _this33.rawBody).name) !== null && _l$name !== void 0 ? _l$name : l.name = "en-US-JennyNeural", (_c$gender = (c = _this33.rawBody).gender) !== null && _c$gender !== void 0 ? _c$gender : c.gender = "Female", _this33.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1");
|
7930
7934
|
return _this33;
|
7931
7935
|
}
|
7932
7936
|
_inherits(vi, _ls);
|
@@ -8012,7 +8016,7 @@ var wt = /*#__PURE__*/function (_ls2) {
|
|
8012
8016
|
}
|
8013
8017
|
}
|
8014
8018
|
};
|
8015
|
-
_this34 = _callSuper(this, wt, [e,
|
8019
|
+
_this34 = _callSuper(this, wt, [e, re.buildSpeechToTextHeaders, t.region, i, n]), _this34.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(wt.HELP_LINK, "\">here</a> for more info.\n </p>"), _this34.url = "", _this34.isTextInputDisabled = !0, _this34.textInputPlaceholderText = "Upload an audio file", _this34.canSendMessage = wt.canFileSendMessage;
|
8016
8020
|
var r = t.lang || "en-US";
|
8017
8021
|
_this34.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(r, "&format=detailed"), _this34.recordAudio = void 0;
|
8018
8022
|
return _this34;
|
@@ -8088,7 +8092,7 @@ wt.HELP_LINK =
|
|
8088
8092
|
// eslint-disable-next-line max-len
|
8089
8093
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
8090
8094
|
var tn = wt;
|
8091
|
-
var Co = /*#__PURE__*/function (
|
8095
|
+
var Co = /*#__PURE__*/function (_q9) {
|
8092
8096
|
// prettier-ignore
|
8093
8097
|
function Co(e) {
|
8094
8098
|
var _this35;
|
@@ -8096,12 +8100,12 @@ var Co = /*#__PURE__*/function (_H9) {
|
|
8096
8100
|
var n, r, o;
|
8097
8101
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.translation,
|
8098
8102
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
8099
|
-
_this35 = _callSuper(this, Co, [e,
|
8103
|
+
_this35 = _callSuper(this, Co, [e, re.buildTranslationKeyVerificationDetails(t.region), re.buildTranslationHeaders.bind({}, t == null ? void 0 : t.region), i]), _this35.insertKeyPlaceholderText = "Azure Translate Subscription Key", _this35.keyHelpUrl =
|
8100
8104
|
// eslint-disable-next-line max-len
|
8101
8105
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this35.url = "", _this35.url = "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=".concat(t.language || "es");
|
8102
8106
|
return _this35;
|
8103
8107
|
}
|
8104
|
-
_inherits(Co,
|
8108
|
+
_inherits(Co, _q9);
|
8105
8109
|
return _createClass(Co, [{
|
8106
8110
|
key: "preprocessBody",
|
8107
8111
|
value: function preprocessBody(e) {
|
@@ -8166,12 +8170,12 @@ var Co = /*#__PURE__*/function (_H9) {
|
|
8166
8170
|
return extractResultData;
|
8167
8171
|
}()
|
8168
8172
|
}]);
|
8169
|
-
}(
|
8170
|
-
var
|
8171
|
-
function
|
8172
|
-
_classCallCheck(this,
|
8173
|
+
}(q);
|
8174
|
+
var G = /*#__PURE__*/function () {
|
8175
|
+
function G() {
|
8176
|
+
_classCallCheck(this, G);
|
8173
8177
|
}
|
8174
|
-
return _createClass(
|
8178
|
+
return _createClass(G, null, [{
|
8175
8179
|
key: "storeFiles",
|
8176
8180
|
value: function () {
|
8177
8181
|
var _storeFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77(e, t, i) {
|
@@ -8262,7 +8266,7 @@ var z = /*#__PURE__*/function () {
|
|
8262
8266
|
l({
|
8263
8267
|
src: d.target.result,
|
8264
8268
|
name: t[a].name,
|
8265
|
-
type:
|
8269
|
+
type: G.getType(t, a)
|
8266
8270
|
});
|
8267
8271
|
};
|
8268
8272
|
});
|
@@ -8298,12 +8302,12 @@ var z = /*#__PURE__*/function () {
|
|
8298
8302
|
var o, a;
|
8299
8303
|
(a = (o = r.text) == null ? void 0 : o.annotations) == null || a.forEach(function (l) {
|
8300
8304
|
var c;
|
8301
|
-
l.text && l.text.startsWith("sandbox:") && !
|
8305
|
+
l.text && l.text.startsWith("sandbox:") && !j.isImageFile({
|
8302
8306
|
src: l.text
|
8303
8307
|
}) && (c = l.file_path) != null && c.file_id && i.push({
|
8304
8308
|
path: l.text,
|
8305
8309
|
fileId: l.file_path.file_id,
|
8306
|
-
name:
|
8310
|
+
name: G.getFileName(l.text)
|
8307
8311
|
});
|
8308
8312
|
});
|
8309
8313
|
}), t != null && t.image_file && i.push({
|
@@ -8325,7 +8329,7 @@ var z = /*#__PURE__*/function () {
|
|
8325
8329
|
break;
|
8326
8330
|
}
|
8327
8331
|
_context79.next = 4;
|
8328
|
-
return
|
8332
|
+
return G.getFiles(e, t);
|
8329
8333
|
case 4:
|
8330
8334
|
r = _context79.sent;
|
8331
8335
|
(o = n == null ? void 0 : n.text) != null && o.value && r.forEach(function (l, c) {
|
@@ -8359,9 +8363,9 @@ var z = /*#__PURE__*/function () {
|
|
8359
8363
|
return _regeneratorRuntime().wrap(function _callee80$(_context80) {
|
8360
8364
|
while (1) switch (_context80.prev = _context80.next) {
|
8361
8365
|
case 0:
|
8362
|
-
n =
|
8366
|
+
n = G.getFileDetails(t, i);
|
8363
8367
|
_context80.next = 3;
|
8364
|
-
return
|
8368
|
+
return G.getFilesAndNewText(e, n, t.role, i);
|
8365
8369
|
case 3:
|
8366
8370
|
return _context80.abrupt("return", _context80.sent);
|
8367
8371
|
case 4:
|
@@ -8405,7 +8409,7 @@ var z = /*#__PURE__*/function () {
|
|
8405
8409
|
return _regeneratorRuntime().wrap(function _callee81$(_context81) {
|
8406
8410
|
while (1) switch (_context81.prev = _context81.next) {
|
8407
8411
|
case 0:
|
8408
|
-
i.push(
|
8412
|
+
i.push(G.getFilesAndText(e, n, r));
|
8409
8413
|
case 1:
|
8410
8414
|
case "end":
|
8411
8415
|
return _context81.stop();
|
@@ -8434,7 +8438,7 @@ var z = /*#__PURE__*/function () {
|
|
8434
8438
|
return _regeneratorRuntime().wrap(function _callee83$(_context83) {
|
8435
8439
|
while (1) switch (_context83.prev = _context83.next) {
|
8436
8440
|
case 0:
|
8437
|
-
return _context83.abrupt("return",
|
8441
|
+
return _context83.abrupt("return", G.parseMessages(e, [{
|
8438
8442
|
content: t,
|
8439
8443
|
role: "assistant"
|
8440
8444
|
}]));
|
@@ -8457,8 +8461,8 @@ var z = /*#__PURE__*/function () {
|
|
8457
8461
|
return _regeneratorRuntime().wrap(function _callee84$(_context84) {
|
8458
8462
|
while (1) switch (_context84.prev = _context84.next) {
|
8459
8463
|
case 0:
|
8460
|
-
n =
|
8461
|
-
return _context84.abrupt("return",
|
8464
|
+
n = G.parseResult(t, i);
|
8465
|
+
return _context84.abrupt("return", G.parseMessages(e, n));
|
8462
8466
|
case 2:
|
8463
8467
|
case "end":
|
8464
8468
|
return _context84.stop();
|
@@ -8472,15 +8476,15 @@ var z = /*#__PURE__*/function () {
|
|
8472
8476
|
}()
|
8473
8477
|
}]);
|
8474
8478
|
}();
|
8475
|
-
var
|
8476
|
-
function
|
8479
|
+
var B = /*#__PURE__*/function (_q10) {
|
8480
|
+
function B(e) {
|
8477
8481
|
var _c$headers, _d$OpenAIBeta;
|
8478
8482
|
var _this36;
|
8479
|
-
_classCallCheck(this,
|
8483
|
+
_classCallCheck(this, B);
|
8480
8484
|
var r, o, a, l, c, d;
|
8481
8485
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
8482
8486
|
i = t.openAI;
|
8483
|
-
_this36 = _callSuper(this,
|
8487
|
+
_this36 = _callSuper(this, B, [e, P.buildKeyVerificationDetails(), P.buildHeaders, i]), _this36.insertKeyPlaceholderText = "OpenAI API Key", _this36.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this36.url = "", _this36.permittedErrorPrefixes = ["Incorrect"], _this36.searchedForThreadId = !1, _this36.config = {}, _this36.newAssistantDetails = {
|
8484
8488
|
model: "gpt-4"
|
8485
8489
|
}, _this36.shouldFetchHistory = !1, _this36.waitingForStreamResponse = !1, _this36.isSSEStream = !1;
|
8486
8490
|
var n = (r = t.openAI) == null ? void 0 : r.assistant;
|
@@ -8498,8 +8502,8 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8498
8502
|
(_c$headers = (c = _this36.connectSettings).headers) !== null && _c$headers !== void 0 ? _c$headers : c.headers = {}, (_d$OpenAIBeta = (d = _this36.connectSettings.headers)["OpenAI-Beta"]) !== null && _d$OpenAIBeta !== void 0 ? _d$OpenAIBeta : d["OpenAI-Beta"] = "assistants=v1", _this36.maxMessages = 1, _this36.isSSEStream = !!(_this36.stream && (_typeof(_this36.stream) != "object" || !_this36.stream.simulation)), _this36.shouldFetchHistory && _this36.sessionId && (_this36.fetchHistory = _this36.fetchHistoryFunc.bind(_this36));
|
8499
8503
|
return _this36;
|
8500
8504
|
}
|
8501
|
-
_inherits(
|
8502
|
-
return _createClass(
|
8505
|
+
_inherits(B, _q10);
|
8506
|
+
return _createClass(B, [{
|
8503
8507
|
key: "fetchHistoryFunc",
|
8504
8508
|
value: function () {
|
8505
8509
|
var _fetchHistoryFunc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee85() {
|
@@ -8557,11 +8561,11 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8557
8561
|
key: "callService",
|
8558
8562
|
value: function callService(e, t, i) {
|
8559
8563
|
if (this.messages = e, this.sessionId) {
|
8560
|
-
this.url = "".concat(
|
8564
|
+
this.url = "".concat(B.THREAD_PREFIX, "/").concat(this.sessionId, "/messages");
|
8561
8565
|
var n = this.processMessage(t, i);
|
8562
8566
|
T.request(this, n, e);
|
8563
8567
|
} else {
|
8564
|
-
this.url = "".concat(
|
8568
|
+
this.url = "".concat(B.THREAD_PREFIX, "/runs");
|
8565
8569
|
var _n2 = this.createNewThreadMessages(this.rawBody, t, i);
|
8566
8570
|
this.isSSEStream ? this.createStreamRun(_n2) : T.request(this, _n2, e);
|
8567
8571
|
}
|
@@ -8608,7 +8612,7 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8608
8612
|
break;
|
8609
8613
|
}
|
8610
8614
|
_context86.next = 17;
|
8611
|
-
return
|
8615
|
+
return G.storeFiles(this, e, i);
|
8612
8616
|
case 17:
|
8613
8617
|
_context86.t1 = _context86.sent;
|
8614
8618
|
_context86.next = 21;
|
@@ -8638,7 +8642,7 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8638
8642
|
while (1) switch (_context87.prev = _context87.next) {
|
8639
8643
|
case 0:
|
8640
8644
|
_context87.prev = 0;
|
8641
|
-
this.url =
|
8645
|
+
this.url = B.NEW_ASSISTANT_URL;
|
8642
8646
|
_context87.next = 4;
|
8643
8647
|
return P.directFetch(this, JSON.parse(JSON.stringify(this.newAssistantDetails)), "POST");
|
8644
8648
|
case 4:
|
@@ -8694,7 +8698,7 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8694
8698
|
_context88.next = 8;
|
8695
8699
|
return this.assignThreadAndRun(e);
|
8696
8700
|
case 8:
|
8697
|
-
t = "".concat(
|
8701
|
+
t = "".concat(B.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id), i = {
|
8698
8702
|
method: "GET",
|
8699
8703
|
headers: (n = this.connectSettings) == null ? void 0 : n.headers
|
8700
8704
|
};
|
@@ -8724,7 +8728,7 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8724
8728
|
_context89.next = 8;
|
8725
8729
|
break;
|
8726
8730
|
}
|
8727
|
-
this.url = "".concat(
|
8731
|
+
this.url = "".concat(B.THREAD_PREFIX, "/").concat(this.sessionId, "/runs");
|
8728
8732
|
_context89.next = 4;
|
8729
8733
|
return P.directFetch(this, JSON.parse(JSON.stringify(this.rawBody)), "POST");
|
8730
8734
|
case 4:
|
@@ -8758,7 +8762,7 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8758
8762
|
while (1) switch (_context90.prev = _context90.next) {
|
8759
8763
|
case 0:
|
8760
8764
|
t = _args90.length > 1 && _args90[1] !== undefined ? _args90[1] : !1;
|
8761
|
-
this.url = "".concat(
|
8765
|
+
this.url = "".concat(B.THREAD_PREFIX, "/").concat(e, "/messages");
|
8762
8766
|
_context90.next = 4;
|
8763
8767
|
return P.directFetch(this, {}, "GET");
|
8764
8768
|
case 4:
|
@@ -8773,7 +8777,7 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8773
8777
|
case 9:
|
8774
8778
|
i = _context90.sent;
|
8775
8779
|
case 10:
|
8776
|
-
return _context90.abrupt("return",
|
8780
|
+
return _context90.abrupt("return", G.processAPIMessages(this, i, t));
|
8777
8781
|
case 11:
|
8778
8782
|
case "end":
|
8779
8783
|
return _context90.stop();
|
@@ -8800,7 +8804,7 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8800
8804
|
break;
|
8801
8805
|
}
|
8802
8806
|
return _context91.abrupt("return", {
|
8803
|
-
timeoutMS:
|
8807
|
+
timeoutMS: B.POLLING_TIMEOUT_MS
|
8804
8808
|
});
|
8805
8809
|
case 3:
|
8806
8810
|
if (!(t === "completed" && this.messages)) {
|
@@ -8884,7 +8888,7 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8884
8888
|
output: r
|
8885
8889
|
};
|
8886
8890
|
});
|
8887
|
-
this.url = "".concat(
|
8891
|
+
this.url = "".concat(B.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id, "/submit_tool_outputs");
|
8888
8892
|
if (!this.isSSEStream) {
|
8889
8893
|
_context92.next = 15;
|
8890
8894
|
break;
|
@@ -8903,7 +8907,7 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8903
8907
|
}, "POST");
|
8904
8908
|
case 17:
|
8905
8909
|
return _context92.abrupt("return", {
|
8906
|
-
timeoutMS:
|
8910
|
+
timeoutMS: B.POLLING_TIMEOUT_MS
|
8907
8911
|
});
|
8908
8912
|
case 18:
|
8909
8913
|
case "end":
|
@@ -8942,7 +8946,7 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8942
8946
|
return _context93.abrupt("return", this.parseStreamResult(e));
|
8943
8947
|
case 8:
|
8944
8948
|
if (this.isSSEStream && this.sessionId) {
|
8945
|
-
this.url = "".concat(
|
8949
|
+
this.url = "".concat(B.THREAD_PREFIX, "/").concat(this.sessionId, "/runs");
|
8946
8950
|
r = JSON.parse(JSON.stringify(this.rawBody));
|
8947
8951
|
this.createStreamRun(r);
|
8948
8952
|
}
|
@@ -8979,7 +8983,7 @@ var F = /*#__PURE__*/function (_H10) {
|
|
8979
8983
|
_context94.next = 5;
|
8980
8984
|
break;
|
8981
8985
|
}
|
8982
|
-
c =
|
8986
|
+
c = G.getFilesAndText.bind(this, this, {
|
8983
8987
|
role: "assistant",
|
8984
8988
|
content: e.content
|
8985
8989
|
}, e.content[0]);
|
@@ -9003,7 +9007,7 @@ var F = /*#__PURE__*/function (_H10) {
|
|
9003
9007
|
break;
|
9004
9008
|
}
|
9005
9009
|
_context94.next = 11;
|
9006
|
-
return
|
9010
|
+
return G.processStreamMessages(this, e.delta.content);
|
9007
9011
|
case 11:
|
9008
9012
|
_c = _context94.sent;
|
9009
9013
|
return _context94.abrupt("return", {
|
@@ -9055,10 +9059,10 @@ var F = /*#__PURE__*/function (_H10) {
|
|
9055
9059
|
return createStreamRun;
|
9056
9060
|
}()
|
9057
9061
|
}]);
|
9058
|
-
}(
|
9059
|
-
|
9060
|
-
var nn =
|
9061
|
-
var ce = /*#__PURE__*/function (
|
9062
|
+
}(q);
|
9063
|
+
B.THREAD_PREFIX = "https://api.openai.com/v1/threads", B.NEW_ASSISTANT_URL = "https://api.openai.com/v1/assistants", B.POLLING_TIMEOUT_MS = 800;
|
9064
|
+
var nn = B;
|
9065
|
+
var ce = /*#__PURE__*/function (_q11) {
|
9062
9066
|
function ce(e) {
|
9063
9067
|
var _this39;
|
9064
9068
|
_classCallCheck(this, ce);
|
@@ -9087,7 +9091,7 @@ var ce = /*#__PURE__*/function (_H11) {
|
|
9087
9091
|
_typeof(r) == "object" && Object.assign(_this39.rawBody, r), _this39.canSendMessage = ce.canFileSendMessage;
|
9088
9092
|
return _this39;
|
9089
9093
|
}
|
9090
|
-
_inherits(ce,
|
9094
|
+
_inherits(ce, _q11);
|
9091
9095
|
return _createClass(ce, [{
|
9092
9096
|
key: "preprocessBody",
|
9093
9097
|
value: function preprocessBody(e, t) {
|
@@ -9207,10 +9211,10 @@ var ce = /*#__PURE__*/function (_H11) {
|
|
9207
9211
|
}), n;
|
9208
9212
|
}
|
9209
9213
|
}]);
|
9210
|
-
}(
|
9214
|
+
}(q);
|
9211
9215
|
ce.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations", ce.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations", ce.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
|
9212
9216
|
var sn = ce;
|
9213
|
-
var yt = /*#__PURE__*/function (
|
9217
|
+
var yt = /*#__PURE__*/function (_q12) {
|
9214
9218
|
function yt(e) {
|
9215
9219
|
var _this40$maxMessages, _l$model;
|
9216
9220
|
var _this40;
|
@@ -9229,7 +9233,7 @@ var yt = /*#__PURE__*/function (_H12) {
|
|
9229
9233
|
(_this40$maxMessages = _this40.maxMessages) !== null && _this40$maxMessages !== void 0 ? _this40$maxMessages : _this40.maxMessages = -1, (_l$model = (l = _this40.rawBody).model) !== null && _l$model !== void 0 ? _l$model : l.model = "gpt-3.5-turbo";
|
9230
9234
|
return _this40;
|
9231
9235
|
}
|
9232
|
-
_inherits(yt,
|
9236
|
+
_inherits(yt, _q12);
|
9233
9237
|
return _createClass(yt, [{
|
9234
9238
|
key: "cleanConfig",
|
9235
9239
|
value: function cleanConfig(e) {
|
@@ -9483,7 +9487,7 @@ var yt = /*#__PURE__*/function (_H12) {
|
|
9483
9487
|
return e.text;
|
9484
9488
|
}
|
9485
9489
|
}]);
|
9486
|
-
}(
|
9490
|
+
}(q);
|
9487
9491
|
var ko = /*#__PURE__*/function (_un3) {
|
9488
9492
|
function ko(e) {
|
9489
9493
|
var _this42$maxMessages;
|
@@ -9598,7 +9602,7 @@ var li = /*#__PURE__*/function () {
|
|
9598
9602
|
}
|
9599
9603
|
}]);
|
9600
9604
|
}();
|
9601
|
-
var Ao = /*#__PURE__*/function (
|
9605
|
+
var Ao = /*#__PURE__*/function (_q13) {
|
9602
9606
|
function Ao(e) {
|
9603
9607
|
var _this43$maxMessages, _n$model;
|
9604
9608
|
var _this43;
|
@@ -9608,7 +9612,7 @@ var Ao = /*#__PURE__*/function (_H13) {
|
|
9608
9612
|
_this43 = _callSuper(this, Ao, [e, li.buildKeyVerificationDetails(), li.buildHeaders, i]), _this43.insertKeyPlaceholderText = "Mistral API Key", _this43.keyHelpUrl = "https://console.mistral.ai/api-keys/", _this43.url = "https://api.mistral.ai/v1/chat/completions", _this43.permittedErrorPrefixes = ["invalid"], i && (_this43.cleanConfig(i), Object.assign(_this43.rawBody, i)), (_this43$maxMessages = _this43.maxMessages) !== null && _this43$maxMessages !== void 0 ? _this43$maxMessages : _this43.maxMessages = -1, (_n$model = (n = _this43.rawBody).model) !== null && _n$model !== void 0 ? _n$model : n.model = "open-mistral-7b";
|
9609
9613
|
return _this43;
|
9610
9614
|
}
|
9611
|
-
_inherits(Ao,
|
9615
|
+
_inherits(Ao, _q13);
|
9612
9616
|
return _createClass(Ao, [{
|
9613
9617
|
key: "cleanConfig",
|
9614
9618
|
value: function cleanConfig(e) {
|
@@ -9684,7 +9688,7 @@ var Ao = /*#__PURE__*/function (_H13) {
|
|
9684
9688
|
return extractResultData;
|
9685
9689
|
}()
|
9686
9690
|
}]);
|
9687
|
-
}(
|
9691
|
+
}(q);
|
9688
9692
|
var Mo = /*#__PURE__*/function () {
|
9689
9693
|
function Mo() {
|
9690
9694
|
_classCallCheck(this, Mo);
|
@@ -9741,7 +9745,7 @@ yn.attibutes = {
|
|
9741
9745
|
}
|
9742
9746
|
};
|
9743
9747
|
var rn = yn;
|
9744
|
-
function
|
9748
|
+
function _(s) {
|
9745
9749
|
return function (e, t) {
|
9746
9750
|
Object.defineProperty(e, t, {});
|
9747
9751
|
var i = e.constructor,
|
@@ -9834,7 +9838,7 @@ var Ce = /*#__PURE__*/function () {
|
|
9834
9838
|
key: "createImage",
|
9835
9839
|
value: function createImage(e, t) {
|
9836
9840
|
var i = new Image();
|
9837
|
-
return i.src = e.src,
|
9841
|
+
return i.src = e.src, j.scrollDownOnImageLoad(i.src, t), j.processContent("image", i, i.src, e.name);
|
9838
9842
|
}
|
9839
9843
|
// WORK - image still does not scroll down when loaded
|
9840
9844
|
}, {
|
@@ -9846,7 +9850,7 @@ var Ce = /*#__PURE__*/function () {
|
|
9846
9850
|
while (1) switch (_context106.prev = _context106.next) {
|
9847
9851
|
case 0:
|
9848
9852
|
n = Ce.createImage(t, e.elementRef), r = e.createNewMessageElement("", i);
|
9849
|
-
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"),
|
9853
|
+
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"), j.addMessage(e, r, "image", i);
|
9850
9854
|
case 2:
|
9851
9855
|
case "end":
|
9852
9856
|
return _context106.stop();
|
@@ -9869,7 +9873,7 @@ var Ce = /*#__PURE__*/function () {
|
|
9869
9873
|
value: function addNewAudioMessage(e, t, i) {
|
9870
9874
|
var n = Ce.createAudioElement(t, i),
|
9871
9875
|
r = e.createNewMessageElement("", i);
|
9872
|
-
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"),
|
9876
|
+
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"), j.addMessage(e, r, "audio", i);
|
9873
9877
|
}
|
9874
9878
|
}, {
|
9875
9879
|
key: "createAnyFile",
|
@@ -9878,24 +9882,24 @@ var Ce = /*#__PURE__*/function () {
|
|
9878
9882
|
t.classList.add("any-file-message-contents");
|
9879
9883
|
var i = document.createElement("div");
|
9880
9884
|
i.classList.add("any-file-message-icon-container");
|
9881
|
-
var n =
|
9885
|
+
var n = ee.createSVGElement(Io);
|
9882
9886
|
n.classList.add("any-file-message-icon"), i.appendChild(n);
|
9883
9887
|
var r = document.createElement("div");
|
9884
|
-
return r.classList.add("any-file-message-text"), r.textContent = e.name ||
|
9888
|
+
return r.classList.add("any-file-message-text"), r.textContent = e.name || j.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), j.processContent("any", t, e.src, r.textContent);
|
9885
9889
|
}
|
9886
9890
|
}, {
|
9887
9891
|
key: "addNewAnyFileMessage",
|
9888
9892
|
value: function addNewAnyFileMessage(e, t, i) {
|
9889
9893
|
var n = e.createNewMessageElement("", i),
|
9890
9894
|
r = Ce.createAnyFile(t);
|
9891
|
-
n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r),
|
9895
|
+
n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r), j.addMessage(e, n, "file", i);
|
9892
9896
|
}
|
9893
9897
|
// no overwrite previous message logic as it is complex to track which files are to be overwritten
|
9894
9898
|
}, {
|
9895
9899
|
key: "addMessages",
|
9896
9900
|
value: function addMessages(e, t, i) {
|
9897
9901
|
t.forEach(function (n) {
|
9898
|
-
n.ref && (n =
|
9902
|
+
n.ref && (n = j.removeFileRef(n)), j.isAudioFile(n) ? Ce.addNewAudioMessage(e, n, i) : j.isImageFile(n) ? Ce.addNewImageMessage(e, n, i) : Ce.addNewAnyFileMessage(e, n, i);
|
9899
9903
|
});
|
9900
9904
|
}
|
9901
9905
|
}]);
|
@@ -9911,7 +9915,7 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
9911
9915
|
o = t.demo;
|
9912
9916
|
_this44._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this44._onClearMessages = Qt.onClearMessages.bind(_this44, e), _this44._onError = Qt.onError.bind(_this44, e), _this44._displayLoadingMessage = ke.getDisplayLoadingMessage(e, t), _this44._permittedErrorPrefixes = n, _this44.addSetupMessageIfNeeded(e, t) || _this44.populateIntroPanel(i, r, e.introPanelStyle), _this44.addIntroductoryMessage(e, t), _this44.populateHistory(e), _this44._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
|
9913
9917
|
return JSON.parse(JSON.stringify(_this44.messages));
|
9914
|
-
}, e.clearMessages = _this44.clearMessages.bind(_this44, t), e.refreshMessages = _this44.refreshTextMessages.bind(_this44), e.scrollToBottom =
|
9918
|
+
}, e.clearMessages = _this44.clearMessages.bind(_this44, t), e.refreshMessages = _this44.refreshTextMessages.bind(_this44), e.scrollToBottom = H.scrollToBottom.bind(_this44, _this44.elementRef), e.addMessage = function (c, d) {
|
9915
9919
|
_this44.addAnyMessage(_objectSpread(_objectSpread({}, c), {}, {
|
9916
9920
|
sendUpdate: !!d
|
9917
9921
|
}), !d);
|
@@ -9963,7 +9967,7 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
9963
9967
|
t && (t.forEach(function (i) {
|
9964
9968
|
ue.processHistoryFile(i), _this45.addNewMessage(i, !0);
|
9965
9969
|
}), setTimeout(function () {
|
9966
|
-
return
|
9970
|
+
return H.scrollToBottom(_this45.elementRef);
|
9967
9971
|
}, 0));
|
9968
9972
|
}
|
9969
9973
|
}, {
|
@@ -9981,7 +9985,7 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
9981
9985
|
return _this46.addAnyMessage(i, !0);
|
9982
9986
|
});
|
9983
9987
|
setTimeout(function () {
|
9984
|
-
return
|
9988
|
+
return H.scrollToBottom(_this46.elementRef);
|
9985
9989
|
}, 0);
|
9986
9990
|
case 4:
|
9987
9991
|
case "end":
|
@@ -10047,8 +10051,8 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
10047
10051
|
r.classList.add("error-message-text");
|
10048
10052
|
var o = this.getPermittedMessage(t) || ((l = this._errorMessageOverrides) == null ? void 0 : l[e]) || ((c = this._errorMessageOverrides) == null ? void 0 : c["default"]) || "Error, please try again.";
|
10049
10053
|
this.renderText(r, o);
|
10050
|
-
var a =
|
10051
|
-
|
10054
|
+
var a = U.extractParticularSharedStyles(["fontSize", "fontFamily"], (d = this.messageStyles) == null ? void 0 : d["default"]);
|
10055
|
+
U.applyCustomStylesToElements(i, !1, a), U.applyCustomStylesToElements(i, !1, (h = this.messageStyles) == null ? void 0 : h.error), this.elementRef.appendChild(n), H.scrollToBottom(this.elementRef), this.textToSpeech && rt.speak(o, this.textToSpeech), (u = this._onError) == null || u.call(this, o);
|
10052
10056
|
}
|
10053
10057
|
}, {
|
10054
10058
|
key: "getPermittedMessage",
|
@@ -10079,12 +10083,12 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
10079
10083
|
i = e.bubbleElement;
|
10080
10084
|
i.classList.add("loading-message-text");
|
10081
10085
|
var n = document.createElement("div");
|
10082
|
-
n.classList.add("dots-flashing"), i.appendChild(n), this.applyCustomStyles(e, b.AI_ROLE, !1, (r = this.messageStyles) == null ? void 0 : r.loading), pn.set(i, this.messageStyles), this.elementRef.appendChild(t),
|
10086
|
+
n.classList.add("dots-flashing"), i.appendChild(n), this.applyCustomStyles(e, b.AI_ROLE, !1, (r = this.messageStyles) == null ? void 0 : r.loading), pn.set(i, this.messageStyles), this.elementRef.appendChild(t), H.scrollToBottom(this.elementRef);
|
10083
10087
|
}
|
10084
10088
|
}, {
|
10085
10089
|
key: "populateIntroPanel",
|
10086
10090
|
value: function populateIntroPanel(e, t, i) {
|
10087
|
-
(e || t) && (this._introPanel = new ci(e, t, i), this._introPanel._elementRef && (
|
10091
|
+
(e || t) && (this._introPanel = new ci(e, t, i), this._introPanel._elementRef && (Q.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
|
10088
10092
|
}
|
10089
10093
|
}, {
|
10090
10094
|
key: "addMultipleFiles",
|
@@ -10096,7 +10100,7 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
10096
10100
|
return _context108.abrupt("return", Promise.all((e || []).map(function (t) {
|
10097
10101
|
return new Promise(function (i) {
|
10098
10102
|
if (!t.type || t.type === "any") {
|
10099
|
-
var n = t.file.name ||
|
10103
|
+
var n = t.file.name || j.DEFAULT_FILE_NAME;
|
10100
10104
|
i({
|
10101
10105
|
name: n,
|
10102
10106
|
type: "any",
|
@@ -10223,11 +10227,11 @@ var ht = /*#__PURE__*/function () {
|
|
10223
10227
|
}]);
|
10224
10228
|
}();
|
10225
10229
|
var Nn = ["camera", "gifs", "images", "audio", "mixedFiles", "submit", "microphone"];
|
10226
|
-
var
|
10227
|
-
function
|
10228
|
-
_classCallCheck(this,
|
10230
|
+
var K = /*#__PURE__*/function () {
|
10231
|
+
function K() {
|
10232
|
+
_classCallCheck(this, K);
|
10229
10233
|
}
|
10230
|
-
return _createClass(
|
10234
|
+
return _createClass(K, null, [{
|
10231
10235
|
key: "createTextElement",
|
10232
10236
|
value: function createTextElement(e) {
|
10233
10237
|
var t = document.createElement("div");
|
@@ -10236,15 +10240,15 @@ var Z = /*#__PURE__*/function () {
|
|
10236
10240
|
}, {
|
10237
10241
|
key: "createElement",
|
10238
10242
|
value: function createElement(e, t) {
|
10239
|
-
return t ?
|
10243
|
+
return t ? K.createTextElement(e) : ee.createSVGElement(e);
|
10240
10244
|
}
|
10241
10245
|
}, {
|
10242
10246
|
key: "createCustomElement",
|
10243
10247
|
value: function createCustomElement(e, t) {
|
10244
10248
|
var n, r, o, a;
|
10245
10249
|
var i = t == null ? void 0 : t[e];
|
10246
|
-
if ((n = i == null ? void 0 : i.
|
10247
|
-
if ((o = i == null ? void 0 : i.
|
10250
|
+
if ((n = i == null ? void 0 : i.svg) != null && n.content) return K.createElement((r = i == null ? void 0 : i.svg) == null ? void 0 : r.content, !1);
|
10251
|
+
if ((o = i == null ? void 0 : i.text) != null && o.content) return K.createElement((a = i == null ? void 0 : i.text) == null ? void 0 : a.content, !0);
|
10248
10252
|
}
|
10249
10253
|
}, {
|
10250
10254
|
key: "processElement",
|
@@ -10257,7 +10261,17 @@ var Z = /*#__PURE__*/function () {
|
|
10257
10261
|
key: "createSpecificStateElement",
|
10258
10262
|
value: function createSpecificStateElement(e, t, i) {
|
10259
10263
|
var n;
|
10260
|
-
return i && (n =
|
10264
|
+
return i && (n = K.createCustomElement(t, i)), K.processElement(e, n), n;
|
10265
|
+
}
|
10266
|
+
// https://github.com/OvidijusParsiunas/deep-chat/issues/175
|
10267
|
+
// isDropup here is only determined by the user and not when moved to dropup automatically
|
10268
|
+
// prettier-ignore
|
10269
|
+
}, {
|
10270
|
+
key: "createInnerElement",
|
10271
|
+
value: function createInnerElement(e, t, i, n) {
|
10272
|
+
var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
10273
|
+
var o, a;
|
10274
|
+
return r && !((a = (o = n == null ? void 0 : n[i]) == null ? void 0 : o.svg) != null && a.content) ? t : K.createSpecificStateElement(e, i, n) || t;
|
10261
10275
|
}
|
10262
10276
|
}]);
|
10263
10277
|
}();
|
@@ -10495,7 +10509,7 @@ var at = /*#__PURE__*/function (_Bt) {
|
|
10495
10509
|
}, {
|
10496
10510
|
key: "createInnerElement",
|
10497
10511
|
value: function createInnerElement(e, t, i) {
|
10498
|
-
return
|
10512
|
+
return K.createSpecificStateElement(this.elementRef, t, i) || e;
|
10499
10513
|
}
|
10500
10514
|
}, {
|
10501
10515
|
key: "addClickEvent",
|
@@ -10524,7 +10538,7 @@ var at = /*#__PURE__*/function (_Bt) {
|
|
10524
10538
|
}, {
|
10525
10539
|
key: "createSVGIconElement",
|
10526
10540
|
value: function createSVGIconElement() {
|
10527
|
-
return
|
10541
|
+
return ee.createSVGElement(Lo);
|
10528
10542
|
}
|
10529
10543
|
}, {
|
10530
10544
|
key: "createButtonContainer",
|
@@ -10540,11 +10554,11 @@ var at = /*#__PURE__*/function (_Bt) {
|
|
10540
10554
|
}
|
10541
10555
|
}]);
|
10542
10556
|
}(Bt);
|
10543
|
-
var
|
10544
|
-
function
|
10545
|
-
_classCallCheck(this,
|
10557
|
+
var V = /*#__PURE__*/function () {
|
10558
|
+
function V() {
|
10559
|
+
_classCallCheck(this, V);
|
10546
10560
|
}
|
10547
|
-
return _createClass(
|
10561
|
+
return _createClass(V, null, [{
|
10548
10562
|
key: "addToDropup",
|
10549
10563
|
value:
|
10550
10564
|
// prettier-ignore
|
@@ -10593,25 +10607,25 @@ var q = /*#__PURE__*/function () {
|
|
10593
10607
|
}, {
|
10594
10608
|
key: "generatePositions",
|
10595
10609
|
value: function generatePositions(e) {
|
10596
|
-
var t =
|
10610
|
+
var t = V.createPositionsObj();
|
10597
10611
|
Object.keys(e).forEach(function (n) {
|
10598
10612
|
var o;
|
10599
10613
|
var r = (o = e[n]) == null ? void 0 : o.button.position;
|
10600
|
-
r &&
|
10601
|
-
}), t["inside-right"].length === 0 && e.submit &&
|
10614
|
+
r && V.setPosition(e, n, t[r]);
|
10615
|
+
}), t["inside-right"].length === 0 && e.submit && V.setPosition(e, "submit", t["inside-right"]), t["outside-right"].length === 0 && (e.submit ? V.setPosition(e, "submit", t["outside-right"]) : e.microphone ? V.setPosition(e, "microphone", t["outside-right"]) : e.camera && V.setPosition(e, "camera", t["outside-right"])), e.submit && V.setPosition(e, "submit", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]), e.microphone && V.setPosition(e, "microphone", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]);
|
10602
10616
|
var i = Object.keys(e);
|
10603
10617
|
return i.length > 1 || t["dropup-menu"].length > 0 ? Nn.forEach(function (n) {
|
10604
10618
|
e[n] && t["dropup-menu"].push(_objectSpread(_objectSpread({}, e[n]), {}, {
|
10605
10619
|
buttonType: n
|
10606
10620
|
}));
|
10607
|
-
}) : i.length === 1 &&
|
10621
|
+
}) : i.length === 1 && V.setPosition(e, i[0], t["outside-right"].length === 0 ? t["outside-right"] : t["outside-left"]), t;
|
10608
10622
|
}
|
10609
10623
|
// prettier-ignore
|
10610
10624
|
}, {
|
10611
10625
|
key: "addButtons",
|
10612
10626
|
value: function addButtons(e, t, i, n) {
|
10613
|
-
var r =
|
10614
|
-
return
|
10627
|
+
var r = V.generatePositions(t);
|
10628
|
+
return V.addToSideContainer(e, r), r["dropup-menu"].length > 0 && V.addToDropup(e, r, i, n), r;
|
10615
10629
|
}
|
10616
10630
|
}]);
|
10617
10631
|
}();
|
@@ -10665,7 +10679,7 @@ var Lt = /*#__PURE__*/function (_Bt2) {
|
|
10665
10679
|
}, {
|
10666
10680
|
key: "createInnerElement",
|
10667
10681
|
value: function createInnerElement(e, t, i) {
|
10668
|
-
return
|
10682
|
+
return K.createSpecificStateElement(this.elementRef, t, i) || e;
|
10669
10683
|
}
|
10670
10684
|
}, {
|
10671
10685
|
key: "changeToActive",
|
@@ -10712,7 +10726,7 @@ var Lt = /*#__PURE__*/function (_Bt2) {
|
|
10712
10726
|
}, {
|
10713
10727
|
key: "createSVGIconElement",
|
10714
10728
|
value: function createSVGIconElement() {
|
10715
|
-
var e =
|
10729
|
+
var e = ee.createSVGElement(Bo);
|
10716
10730
|
return e.id = "microphone-icon", e;
|
10717
10731
|
}
|
10718
10732
|
}]);
|
@@ -10837,11 +10851,11 @@ Object.defineProperty(Ti, "__esModule", {
|
|
10837
10851
|
value: !0
|
10838
10852
|
});
|
10839
10853
|
Ti.EventListeners = void 0;
|
10840
|
-
var
|
10841
|
-
function
|
10842
|
-
_classCallCheck(this,
|
10854
|
+
var se = /*#__PURE__*/function () {
|
10855
|
+
function se() {
|
10856
|
+
_classCallCheck(this, se);
|
10843
10857
|
}
|
10844
|
-
return _createClass(
|
10858
|
+
return _createClass(se, null, [{
|
10845
10859
|
key: "getElementIfFocusedOnAvailable",
|
10846
10860
|
value: function getElementIfFocusedOnAvailable(e, t) {
|
10847
10861
|
return Array.isArray(e) ? e.find(function (i) {
|
@@ -10852,14 +10866,14 @@ var ne = /*#__PURE__*/function () {
|
|
10852
10866
|
key: "keyDownWindow",
|
10853
10867
|
value: function keyDownWindow(e) {
|
10854
10868
|
var _this51 = this;
|
10855
|
-
e.element &&
|
10856
|
-
|
10869
|
+
e.element && se.getElementIfFocusedOnAvailable(e.element, document.activeElement) && (se.KEY_DOWN_TIMEOUT !== null && clearTimeout(se.KEY_DOWN_TIMEOUT), se.KEY_DOWN_TIMEOUT = setTimeout(function () {
|
10870
|
+
se.KEY_DOWN_TIMEOUT = null, _this51.resetRecording(e);
|
10857
10871
|
}, 500));
|
10858
10872
|
}
|
10859
10873
|
}, {
|
10860
10874
|
key: "mouseDownWindow",
|
10861
10875
|
value: function mouseDownWindow(e, t) {
|
10862
|
-
this.mouseDownElement =
|
10876
|
+
this.mouseDownElement = se.getElementIfFocusedOnAvailable(e, t.target);
|
10863
10877
|
}
|
10864
10878
|
}, {
|
10865
10879
|
key: "mouseUpWindow",
|
@@ -10870,7 +10884,7 @@ var ne = /*#__PURE__*/function () {
|
|
10870
10884
|
key: "add",
|
10871
10885
|
value: function add(e, t) {
|
10872
10886
|
var i = (t == null ? void 0 : t.insertInCursorLocation) === void 0 || (t == null ? void 0 : t.insertInCursorLocation);
|
10873
|
-
t != null && t.element && i && (e.mouseDownEvent =
|
10887
|
+
t != null && t.element && i && (e.mouseDownEvent = se.mouseDownWindow.bind(e, t.element), document.addEventListener("mousedown", e.mouseDownEvent), e.mouseUpEvent = se.mouseUpWindow.bind(e, t), document.addEventListener("mouseup", e.mouseUpEvent), e.keyDownEvent = se.keyDownWindow.bind(e, t), document.addEventListener("keydown", e.keyDownEvent));
|
10874
10888
|
}
|
10875
10889
|
}, {
|
10876
10890
|
key: "remove",
|
@@ -10879,8 +10893,8 @@ var ne = /*#__PURE__*/function () {
|
|
10879
10893
|
}
|
10880
10894
|
}]);
|
10881
10895
|
}();
|
10882
|
-
Ti.EventListeners =
|
10883
|
-
|
10896
|
+
Ti.EventListeners = se;
|
10897
|
+
se.KEY_DOWN_TIMEOUT = null;
|
10884
10898
|
var Ci = {};
|
10885
10899
|
Object.defineProperty(Ci, "__esModule", {
|
10886
10900
|
value: !0
|
@@ -11090,11 +11104,11 @@ var Fn = qt,
|
|
11090
11104
|
Go = ft,
|
11091
11105
|
Bn = Ye,
|
11092
11106
|
jn = Xe;
|
11093
|
-
var
|
11094
|
-
function
|
11095
|
-
_classCallCheck(this,
|
11107
|
+
var ie = /*#__PURE__*/function () {
|
11108
|
+
function ie() {
|
11109
|
+
_classCallCheck(this, ie);
|
11096
11110
|
}
|
11097
|
-
return _createClass(
|
11111
|
+
return _createClass(ie, null, [{
|
11098
11112
|
key: "processCommand",
|
11099
11113
|
value: function processCommand(e, t) {
|
11100
11114
|
return (!t || !t.caseSensitive) && (e = e.toLowerCase()), (t == null ? void 0 : t.substrings) === !1 ? jn.Text.breakupIntoWordsArr(e) : e;
|
@@ -11105,7 +11119,7 @@ var te = /*#__PURE__*/function () {
|
|
11105
11119
|
var t;
|
11106
11120
|
return ((t = e.settings) === null || t === void 0 ? void 0 : t.caseSensitive) === !0 ? e : Object.keys(e).reduce(function (n, r) {
|
11107
11121
|
var o = e[r];
|
11108
|
-
return n[r] = typeof o == "string" ?
|
11122
|
+
return n[r] = typeof o == "string" ? ie.processCommand(o, e.settings) : o, n;
|
11109
11123
|
}, {});
|
11110
11124
|
}
|
11111
11125
|
}, {
|
@@ -11123,7 +11137,7 @@ var te = /*#__PURE__*/function () {
|
|
11123
11137
|
}, {
|
11124
11138
|
key: "setText",
|
11125
11139
|
value: function setText(e, t, i, n) {
|
11126
|
-
|
11140
|
+
ie.toggleCommandModeOff(e), Vo.Elements.isPrimitiveElement(n) ? (n.value = i, e.isTargetInShadow || Bn.Cursor.setOffsetForPrimitive(n, i.length, !0), Go.Browser.IS_SAFARI() && e.autoScroll && Fn.AutoScroll.scrollSafariPrimitiveToEnd(n)) : (n.textContent = i, e.isTargetInShadow || Bn.Cursor.focusEndOfGeneric(n), setTimeout(function () {
|
11127
11141
|
return Fn.AutoScroll.scrollGeneric(e, n);
|
11128
11142
|
})), e.resetRecording(t);
|
11129
11143
|
}
|
@@ -11153,38 +11167,38 @@ var te = /*#__PURE__*/function () {
|
|
11153
11167
|
if (!c || !n || !i) return;
|
11154
11168
|
var d = ((o = c.settings) === null || o === void 0 ? void 0 : o.caseSensitive) === !0 ? t : t.toLowerCase(),
|
11155
11169
|
h = jn.Text.breakupIntoWordsArr(d),
|
11156
|
-
u = ((a = c.settings) === null || a === void 0 ? void 0 : a.substrings) === !1 ?
|
11170
|
+
u = ((a = c.settings) === null || a === void 0 ? void 0 : a.substrings) === !1 ? ie.checkIfMatchesWord : ie.checkIfMatchesSubstring;
|
11157
11171
|
if (c.commandMode && u(c.commandMode, d, h)) return e.setInterimColorToFinal(), setTimeout(function () {
|
11158
|
-
return
|
11172
|
+
return ie.toggleCommandModeOn(e);
|
11159
11173
|
}), {
|
11160
11174
|
doNotProcessTranscription: !1
|
11161
11175
|
};
|
11162
11176
|
if (!(c.commandMode && !e.isWaitingForCommand)) {
|
11163
|
-
if (c.stop && u(c.stop, d, h)) return
|
11177
|
+
if (c.stop && u(c.stop, d, h)) return ie.toggleCommandModeOff(e), setTimeout(function () {
|
11164
11178
|
return e.stop();
|
11165
11179
|
}), {
|
11166
11180
|
doNotProcessTranscription: !1
|
11167
11181
|
};
|
11168
|
-
if (c.pause && u(c.pause, d, h)) return
|
11182
|
+
if (c.pause && u(c.pause, d, h)) return ie.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
|
11169
11183
|
var f;
|
11170
11184
|
e.isPaused = !0, (f = e.onPauseTrigger) === null || f === void 0 || f.call(e, !0);
|
11171
11185
|
}), {
|
11172
11186
|
doNotProcessTranscription: !1
|
11173
11187
|
};
|
11174
|
-
if (c.resume && u(c.resume, d, h)) return e.isPaused = !1, (l = e.onPauseTrigger) === null || l === void 0 || l.call(e, !1),
|
11188
|
+
if (c.resume && u(c.resume, d, h)) return e.isPaused = !1, (l = e.onPauseTrigger) === null || l === void 0 || l.call(e, !1), ie.toggleCommandModeOff(e), e.resetRecording(i), {
|
11175
11189
|
doNotProcessTranscription: !0
|
11176
11190
|
};
|
11177
|
-
if (c.reset && u(c.reset, d, h)) return r !== void 0 &&
|
11191
|
+
if (c.reset && u(c.reset, d, h)) return r !== void 0 && ie.setText(e, i, r, n), {
|
11178
11192
|
doNotProcessTranscription: !0
|
11179
11193
|
};
|
11180
|
-
if (c.removeAllText && u(c.removeAllText, d, h)) return
|
11194
|
+
if (c.removeAllText && u(c.removeAllText, d, h)) return ie.setText(e, i, "", n), {
|
11181
11195
|
doNotProcessTranscription: !0
|
11182
11196
|
};
|
11183
11197
|
}
|
11184
11198
|
}
|
11185
11199
|
}]);
|
11186
11200
|
}();
|
11187
|
-
Ht.CommandUtils =
|
11201
|
+
Ht.CommandUtils = ie;
|
11188
11202
|
var ki = {};
|
11189
11203
|
Object.defineProperty(ki, "__esModule", {
|
11190
11204
|
value: !0
|
@@ -12213,7 +12227,7 @@ var sa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
12213
12227
|
i.classList.add("audio-placeholder-text-3-digits");
|
12214
12228
|
var n = document.createElement("div");
|
12215
12229
|
n.classList.add("file-attachment-text-container", "audio-placeholder-text-3-digits-container"), n.appendChild(i);
|
12216
|
-
var r =
|
12230
|
+
var r = ee.createSVGElement(Zn);
|
12217
12231
|
return r.classList.add("attachment-icon", "stop-icon", "not-removable-attachment-icon"), i.textContent = "0:00", this._activePlaceholderTimer = this.createTimer(i, e), t.appendChild(n), this.addPlaceholderAudioAttachmentEvents(t, r, n), t;
|
12218
12232
|
}
|
12219
12233
|
}, {
|
@@ -12266,12 +12280,12 @@ var sa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
12266
12280
|
}, {
|
12267
12281
|
key: "addAudioElements",
|
12268
12282
|
value: function addAudioElements(e, t) {
|
12269
|
-
var i = e.parentElement ?
|
12283
|
+
var i = e.parentElement ? H.cloneElement(e) : e,
|
12270
12284
|
n = document.createElement("audio");
|
12271
12285
|
n.src = t;
|
12272
|
-
var r =
|
12286
|
+
var r = ee.createSVGElement(sa);
|
12273
12287
|
r.classList.add("attachment-icon", "play-icon");
|
12274
|
-
var o =
|
12288
|
+
var o = ee.createSVGElement(Zn);
|
12275
12289
|
o.classList.add("attachment-icon", "stop-icon"), i.replaceChildren(r), n.onplay = function () {
|
12276
12290
|
i.replaceChildren(o);
|
12277
12291
|
}, n.onpause = function () {
|
@@ -12506,7 +12520,7 @@ var de = /*#__PURE__*/function () {
|
|
12506
12520
|
value: function createSVGButton(e) {
|
12507
12521
|
var t = document.createElement("div");
|
12508
12522
|
t.classList.add("modal-button", "modal-svg-button");
|
12509
|
-
var i =
|
12523
|
+
var i = ee.createSVGElement(e);
|
12510
12524
|
return i.classList.add("modal-svg-button-icon"), t.appendChild(i), t;
|
12511
12525
|
}
|
12512
12526
|
}, {
|
@@ -12527,19 +12541,23 @@ var Et = /*#__PURE__*/function (_Bt3) {
|
|
12527
12541
|
function Et(e, t, i, n, r, o) {
|
12528
12542
|
var _this64;
|
12529
12543
|
_classCallCheck(this, Et);
|
12530
|
-
var
|
12531
|
-
|
12532
|
-
|
12533
|
-
_this64
|
12544
|
+
var h, u, f, m, p, y, x, D, z;
|
12545
|
+
var a = (h = i == null ? void 0 : i.button) == null ? void 0 : h.position,
|
12546
|
+
l = ((m = (f = (u = i == null ? void 0 : i.button) == null ? void 0 : u.styles) == null ? void 0 : f.text) == null ? void 0 : m.content) || o;
|
12547
|
+
_this64 = _callSuper(this, Et, [Et.createButtonElement(), a, i.button, l]);
|
12548
|
+
var c = a === "dropup-menu",
|
12549
|
+
d = _this64.createInnerElements(n, r, _this64._customStyles, c);
|
12550
|
+
_this64._inputElement = Et.createInputElement((p = i == null ? void 0 : i.files) == null ? void 0 : p.acceptedFormats), _this64.addClickEvent(e, i), _this64.elementRef.replaceChildren(d.styles), _this64.reapplyStateStyle("styles"), _this64._fileAttachmentsType = t, _this64._openModalOnce = ((x = (y = i.files) == null ? void 0 : y.infoModal) == null ? void 0 : x.openModalOnce) === !1 || (z = (D = i.files) == null ? void 0 : D.infoModal) == null ? void 0 : z.openModalOnce;
|
12534
12551
|
return _this64;
|
12535
12552
|
}
|
12536
12553
|
_inherits(Et, _Bt3);
|
12537
12554
|
return _createClass(Et, [{
|
12538
12555
|
key: "createInnerElements",
|
12539
12556
|
value: function createInnerElements(e, t, i) {
|
12540
|
-
var n =
|
12557
|
+
var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
12558
|
+
var r = Et.createSVGIconElement(e, t);
|
12541
12559
|
return {
|
12542
|
-
styles:
|
12560
|
+
styles: K.createInnerElement(this.elementRef, r, "styles", i, n)
|
12543
12561
|
};
|
12544
12562
|
}
|
12545
12563
|
}, {
|
@@ -12552,11 +12570,6 @@ var Et = /*#__PURE__*/function (_Bt3) {
|
|
12552
12570
|
value: function _import(e) {
|
12553
12571
|
zt.addFilesToType(Array.from(e.files || []), [this._fileAttachmentsType]), e.value = "";
|
12554
12572
|
}
|
12555
|
-
}, {
|
12556
|
-
key: "createInnerElement",
|
12557
|
-
value: function createInnerElement(e, t, i) {
|
12558
|
-
return Z.createSpecificStateElement(this.elementRef, t, i) || e;
|
12559
|
-
}
|
12560
12573
|
}, {
|
12561
12574
|
key: "addClickEvent",
|
12562
12575
|
value: function addClickEvent(e, t) {
|
@@ -12584,7 +12597,7 @@ var Et = /*#__PURE__*/function (_Bt3) {
|
|
12584
12597
|
}, {
|
12585
12598
|
key: "createSVGIconElement",
|
12586
12599
|
value: function createSVGIconElement(e, t) {
|
12587
|
-
var i =
|
12600
|
+
var i = ee.createSVGElement(t);
|
12588
12601
|
return i.id = e, i;
|
12589
12602
|
}
|
12590
12603
|
}]);
|
@@ -12708,7 +12721,7 @@ var Fe = /*#__PURE__*/function () {
|
|
12708
12721
|
}, {
|
12709
12722
|
key: "validateWebsocket",
|
12710
12723
|
value: function validateWebsocket(e, t) {
|
12711
|
-
return e.websocket && !
|
12724
|
+
return e.websocket && !W.canSendMessage(e.websocket) ? (t.changeToDisabledIcon(), !1) : !0;
|
12712
12725
|
}
|
12713
12726
|
// prettier-ignore
|
12714
12727
|
}, {
|
@@ -12819,38 +12832,38 @@ var oa = /*#__PURE__*/function (_Lt2) {
|
|
12819
12832
|
}]);
|
12820
12833
|
}(Lt);
|
12821
12834
|
var aa = "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n<svg xmlns=\"http://www.w3.org/2000/svg\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"1\" viewBox=\"0 0 24 24\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"14\"></line>\n <polygon points=\"22 2 15 22 11 14 2 10 22 2\"></polygon>\n</svg>\n";
|
12822
|
-
var
|
12823
|
-
function
|
12824
|
-
_classCallCheck(this,
|
12835
|
+
var $ = /*#__PURE__*/function () {
|
12836
|
+
function $() {
|
12837
|
+
_classCallCheck(this, $);
|
12825
12838
|
}
|
12826
|
-
return _createClass(
|
12839
|
+
return _createClass($, null, [{
|
12827
12840
|
key: "setPropertyValueIfDoesNotExist",
|
12828
12841
|
value: function setPropertyValueIfDoesNotExist(e, t, i) {
|
12829
12842
|
var _e$n, _e$n2;
|
12830
12843
|
var n = t[0];
|
12831
|
-
t.length === 1 ? (_e$n = e[n]) !== null && _e$n !== void 0 ? _e$n : e[n] = i : ((_e$n2 = e[n]) !== null && _e$n2 !== void 0 ? _e$n2 : e[n] = {}, t.shift(),
|
12844
|
+
t.length === 1 ? (_e$n = e[n]) !== null && _e$n !== void 0 ? _e$n : e[n] = i : ((_e$n2 = e[n]) !== null && _e$n2 !== void 0 ? _e$n2 : e[n] = {}, t.shift(), $.setPropertyValueIfDoesNotExist(e[n], t, i));
|
12832
12845
|
}
|
12833
12846
|
}, {
|
12834
12847
|
key: "setPropertyValue",
|
12835
12848
|
value: function setPropertyValue(e, t, i) {
|
12836
12849
|
var _e$n3;
|
12837
12850
|
var n = t[0];
|
12838
|
-
t.length === 1 ? e[n] = i : ((_e$n3 = e[n]) !== null && _e$n3 !== void 0 ? _e$n3 : e[n] = {}, t.shift(),
|
12851
|
+
t.length === 1 ? e[n] = i : ((_e$n3 = e[n]) !== null && _e$n3 !== void 0 ? _e$n3 : e[n] = {}, t.shift(), $.setPropertyValue(e[n], t, i));
|
12839
12852
|
}
|
12840
12853
|
}, {
|
12841
12854
|
key: "getObjectValue",
|
12842
12855
|
value: function getObjectValue(e, t) {
|
12843
12856
|
var i = t[0],
|
12844
12857
|
n = e[i];
|
12845
|
-
return n === void 0 || t.length === 1 ? n :
|
12858
|
+
return n === void 0 || t.length === 1 ? n : $.getObjectValue(n, t.slice(1));
|
12846
12859
|
}
|
12847
12860
|
}, {
|
12848
12861
|
key: "overwritePropertyObjectFromAnother",
|
12849
12862
|
value: function overwritePropertyObjectFromAnother(e, t, i) {
|
12850
|
-
var n =
|
12863
|
+
var n = $.getObjectValue(t, i);
|
12851
12864
|
if (n) {
|
12852
|
-
var r = _objectSpread(_objectSpread({}, n),
|
12853
|
-
|
12865
|
+
var r = _objectSpread(_objectSpread({}, n), $.getObjectValue(e, i) || {});
|
12866
|
+
$.setPropertyValue(e, i, r);
|
12854
12867
|
}
|
12855
12868
|
}
|
12856
12869
|
}]);
|
@@ -12869,13 +12882,13 @@ var Ve = /*#__PURE__*/function () {
|
|
12869
12882
|
value: function overwriteDefaultStyleWithSubmit(e, t) {
|
12870
12883
|
if (!e.submit) return;
|
12871
12884
|
var i = JSON.parse(JSON.stringify(e[t] || {}));
|
12872
|
-
|
12885
|
+
$.overwritePropertyObjectFromAnother(i, e.submit, ["container", "default"]), $.overwritePropertyObjectFromAnother(i, e.submit, ["text", "styles", "default"]), $.overwritePropertyObjectFromAnother(i, e.submit, ["svg", "styles", "default"]), e[t] = i;
|
12873
12886
|
}
|
12874
12887
|
// prettier-ignore
|
12875
12888
|
}, {
|
12876
12889
|
key: "setUpDisabledButton",
|
12877
12890
|
value: function setUpDisabledButton(e) {
|
12878
|
-
|
12891
|
+
$.setPropertyValueIfDoesNotExist(e, ["submit", "container", "default", "backgroundColor"], ""), $.setPropertyValueIfDoesNotExist(e, ["disabled", "container", "default", "backgroundColor"], "unset"), $.setPropertyValueIfDoesNotExist(e.submit, ["svg", "styles", "default", "filter"], ""), $.setPropertyValueIfDoesNotExist(e.disabled, ["svg", "styles", "default", "filter"], "brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(5564%) hue-rotate(207deg) brightness(100%) contrast(97%)"), Ve.overwriteDefaultStyleWithSubmit(e, "disabled");
|
12879
12892
|
}
|
12880
12893
|
}, {
|
12881
12894
|
key: "process",
|
@@ -12922,21 +12935,21 @@ var k = /*#__PURE__*/function (_Bt4) {
|
|
12922
12935
|
key: "createCustomElements",
|
12923
12936
|
value: function createCustomElements() {
|
12924
12937
|
var _this70 = this;
|
12925
|
-
var e =
|
12938
|
+
var e = K.createSpecificStateElement(this.elementRef, "submit", this._customStyles),
|
12926
12939
|
t = {
|
12927
12940
|
loading: void 0,
|
12928
12941
|
stop: void 0
|
12929
12942
|
};
|
12930
12943
|
return Object.keys(t).forEach(function (i) {
|
12931
12944
|
var n = i,
|
12932
|
-
r =
|
12945
|
+
r = K.createCustomElement(n, _this70._customStyles);
|
12933
12946
|
r && (t[n] = r);
|
12934
12947
|
}), t.submit = e, t;
|
12935
12948
|
}
|
12936
12949
|
}, {
|
12937
12950
|
key: "createDisabledIconElement",
|
12938
12951
|
value: function createDisabledIconElement(e) {
|
12939
|
-
return
|
12952
|
+
return K.createCustomElement("disabled", this._customStyles) || e.cloneNode(!0);
|
12940
12953
|
}
|
12941
12954
|
// prettier-ignore
|
12942
12955
|
}, {
|
@@ -13174,7 +13187,7 @@ var k = /*#__PURE__*/function (_Bt4) {
|
|
13174
13187
|
}, {
|
13175
13188
|
key: "createSubmitIconElement",
|
13176
13189
|
value: function createSubmitIconElement() {
|
13177
|
-
var e =
|
13190
|
+
var e = ee.createSVGElement(aa);
|
13178
13191
|
return e.id = "submit-icon", e;
|
13179
13192
|
}
|
13180
13193
|
}, {
|
@@ -13206,7 +13219,7 @@ var bn = /*#__PURE__*/function (_ze) {
|
|
13206
13219
|
var _this73$addButtonsAnd = _this73.addButtonsAndTheirEvents(t),
|
13207
13220
|
r = _this73$addButtonsAnd.captureButton,
|
13208
13221
|
o = _this73$addButtonsAnd.submitButton;
|
13209
|
-
_this73._captureButton = r, _this73._submitButton = o, _this73._captureIcon = _this73._captureButton.children[0], _this73._refreshIcon =
|
13222
|
+
_this73._captureButton = r, _this73._submitButton = o, _this73._captureIcon = _this73._captureButton.children[0], _this73._refreshIcon = ee.createSVGElement(la), _this73._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (n == null ? void 0 : n.format) === "jpeg" && (_this73._format = "image/jpeg"), n != null && n.dimensions && (_this73._dimensions = n.dimensions), _this73._contentRef.appendChild(_this73._canvas), _this73.extensionCloseCallback = _this73.stop;
|
13210
13223
|
return _this73;
|
13211
13224
|
}
|
13212
13225
|
_inherits(bn, _ze);
|
@@ -13315,26 +13328,24 @@ var mi = /*#__PURE__*/function (_Bt5) {
|
|
13315
13328
|
function mi(e, t, i) {
|
13316
13329
|
var _this77;
|
13317
13330
|
_classCallCheck(this, mi);
|
13318
|
-
var
|
13319
|
-
|
13320
|
-
|
13321
|
-
|
13331
|
+
var a, l, c, d;
|
13332
|
+
var n = (a = i == null ? void 0 : i.button) == null ? void 0 : a.position,
|
13333
|
+
r = ((d = (c = (l = i == null ? void 0 : i.button) == null ? void 0 : l.styles) == null ? void 0 : c.text) == null ? void 0 : d.content) || "Photo";
|
13334
|
+
_this77 = _callSuper(this, mi, [mi.createButtonElement(), n, (i == null ? void 0 : i.button) || {}, r]);
|
13335
|
+
var o = _this77.createInnerElements(_this77._customStyles, n === "dropup-menu");
|
13336
|
+
i && _this77.addClickEvent(e, t, i.modalContainerStyle, i.files), _this77.elementRef.classList.add("upload-file-button"), _this77.elementRef.appendChild(o.styles), _this77.reapplyStateStyle("styles");
|
13322
13337
|
return _this77;
|
13323
13338
|
}
|
13324
|
-
//
|
13339
|
+
// prettier-ignore
|
13325
13340
|
_inherits(mi, _Bt5);
|
13326
13341
|
return _createClass(mi, [{
|
13327
13342
|
key: "createInnerElements",
|
13328
13343
|
value: function createInnerElements(e) {
|
13344
|
+
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
13329
13345
|
return {
|
13330
|
-
styles:
|
13346
|
+
styles: K.createInnerElement(this.elementRef, mi.createSVGIconElement(), "styles", e, t)
|
13331
13347
|
};
|
13332
13348
|
}
|
13333
|
-
}, {
|
13334
|
-
key: "createInnerElement",
|
13335
|
-
value: function createInnerElement(e, t, i) {
|
13336
|
-
return Z.createSpecificStateElement(this.elementRef, t, i) || e;
|
13337
|
-
}
|
13338
13349
|
}, {
|
13339
13350
|
key: "addClickEvent",
|
13340
13351
|
value:
|
@@ -13352,7 +13363,7 @@ var mi = /*#__PURE__*/function (_Bt5) {
|
|
13352
13363
|
}, {
|
13353
13364
|
key: "createSVGIconElement",
|
13354
13365
|
value: function createSVGIconElement() {
|
13355
|
-
var e =
|
13366
|
+
var e = ee.createSVGElement(ua);
|
13356
13367
|
return e.id = "camera-icon", e;
|
13357
13368
|
}
|
13358
13369
|
}]);
|
@@ -13424,9 +13435,9 @@ var _t = /*#__PURE__*/function () {
|
|
13424
13435
|
}, {
|
13425
13436
|
key: "addElements",
|
13426
13437
|
value: function addElements(e, t, i, n, r, o) {
|
13427
|
-
|
13438
|
+
H.addElements(e, t.elementRef);
|
13428
13439
|
var a = ht.create(),
|
13429
|
-
l =
|
13440
|
+
l = V.addButtons(a, i, n, o);
|
13430
13441
|
on.set(t.inputElementRef, a, r.elementRef, l), ht.add(e, a);
|
13431
13442
|
}
|
13432
13443
|
}]);
|
@@ -13441,9 +13452,9 @@ var vn = /*#__PURE__*/function () {
|
|
13441
13452
|
var n = document.createElement("div");
|
13442
13453
|
n.id = "chat-view";
|
13443
13454
|
var r = new ke(e, t, i);
|
13444
|
-
t.websocket &&
|
13455
|
+
t.websocket && W.createConnection(t, r);
|
13445
13456
|
var o = new _t(e, r, t, n);
|
13446
|
-
return
|
13457
|
+
return H.addElements(n, r.elementRef, o.elementRef), n;
|
13447
13458
|
}
|
13448
13459
|
}, {
|
13449
13460
|
key: "render",
|
@@ -13456,15 +13467,15 @@ var vn = /*#__PURE__*/function () {
|
|
13456
13467
|
var fa = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#large-loading-ring{display:inline-block;width:50px;height:50px}#large-loading-ring:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:large-loading-ring 1.4s linear infinite}@keyframes large-loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#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-ring{display:inline-block;width:16px;height:16px}#loading-ring: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-ring 1.2s linear infinite}@keyframes loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#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}.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}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.loading-message-text{width:1em;padding:.6em .75em .6em 1.3em}.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-bubble{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}.dots-jumping{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:dots-jumping 1.5s infinite linear;bottom:-.75em}@keyframes dots-jumping{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}}.dots-flashing{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite linear alternate;animation-delay:.5s}.dots-flashing:before,.dots-flashing:after{content:\"\";display:inline-block;position:absolute;top:0}.dots-flashing:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:0s}.dots-flashing:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:1s}@keyframes dots-flashing{0%{background-color:var(--message-dots-color)}50%,to{background-color:var(--message-dots-color-fade)}}.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{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}.text-input-placeholder{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}#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}";
|
13457
13468
|
var pa = Object.defineProperty,
|
13458
13469
|
ma = Object.getOwnPropertyDescriptor,
|
13459
|
-
|
13470
|
+
S = function S(s, e, t, i) {
|
13460
13471
|
for (var n = i > 1 ? void 0 : i ? ma(e, t) : e, r = s.length - 1, o; r >= 0; r--) (o = s[r]) && (n = (i ? o(e, t, n) : o(n)) || n);
|
13461
13472
|
return i && n && pa(e, t, n), n;
|
13462
13473
|
};
|
13463
|
-
var
|
13464
|
-
function
|
13474
|
+
var E = /*#__PURE__*/function (_Xi) {
|
13475
|
+
function E() {
|
13465
13476
|
var _this78;
|
13466
|
-
_classCallCheck(this,
|
13467
|
-
_this78 = _callSuper(this,
|
13477
|
+
_classCallCheck(this, E);
|
13478
|
+
_this78 = _callSuper(this, E), _this78.getMessages = function () {
|
13468
13479
|
return [];
|
13469
13480
|
}, _this78.submitUserMessage = function () {
|
13470
13481
|
return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
|
@@ -13479,8 +13490,8 @@ var y = /*#__PURE__*/function (_Xi) {
|
|
13479
13490
|
}, 20);
|
13480
13491
|
return _this78;
|
13481
13492
|
}
|
13482
|
-
_inherits(
|
13483
|
-
return _createClass(
|
13493
|
+
_inherits(E, _Xi);
|
13494
|
+
return _createClass(E, [{
|
13484
13495
|
key: "changeToChatView",
|
13485
13496
|
value: function changeToChatView() {
|
13486
13497
|
this._activeService && (this._activeService.validateKeyProperty = !1), this.onRender();
|
@@ -13490,7 +13501,7 @@ var y = /*#__PURE__*/function (_Xi) {
|
|
13490
13501
|
key: "onRender",
|
13491
13502
|
value: function onRender() {
|
13492
13503
|
var _this$_childElement;
|
13493
|
-
Xt.attemptAppendStyleSheetToHead(this.style), ue.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = Mo.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (bt.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), bt.applyDefaultStyleToComponent(this.style, this.chatStyle), ue.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? Jt.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof
|
13504
|
+
Xt.attemptAppendStyleSheetToHead(this.style), ue.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = Mo.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (bt.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), bt.applyDefaultStyleToComponent(this.style, this.chatStyle), ue.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? Jt.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof q) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], vn.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof q && F.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, Qt.onRender(this);
|
13494
13505
|
}
|
13495
13506
|
}, {
|
13496
13507
|
key: "disconnectedCallback",
|
@@ -13499,43 +13510,43 @@ var y = /*#__PURE__*/function (_Xi) {
|
|
13499
13510
|
}
|
13500
13511
|
}]);
|
13501
13512
|
}(Xi);
|
13502
|
-
|
13503
|
-
|
13504
|
-
|
13505
|
-
|
13506
|
-
|
13507
|
-
|
13508
|
-
|
13509
|
-
|
13510
|
-
|
13511
|
-
|
13512
|
-
|
13513
|
-
|
13514
|
-
|
13515
|
-
|
13516
|
-
|
13517
|
-
|
13518
|
-
|
13519
|
-
|
13520
|
-
|
13521
|
-
|
13522
|
-
|
13523
|
-
|
13524
|
-
|
13525
|
-
|
13526
|
-
|
13527
|
-
|
13528
|
-
|
13529
|
-
|
13530
|
-
|
13531
|
-
|
13532
|
-
|
13533
|
-
|
13534
|
-
|
13535
|
-
|
13536
|
-
|
13537
|
-
|
13538
|
-
|
13539
|
-
|
13540
|
-
customElements.define("deep-chat",
|
13541
|
-
export {
|
13513
|
+
S([_("object")], E.prototype, "connect", 2);
|
13514
|
+
S([_("object")], E.prototype, "directConnection", 2);
|
13515
|
+
S([_("object")], E.prototype, "webModel", 2);
|
13516
|
+
S([_("object")], E.prototype, "requestBodyLimits", 2);
|
13517
|
+
S([_("function")], E.prototype, "requestInterceptor", 2);
|
13518
|
+
S([_("function")], E.prototype, "responseInterceptor", 2);
|
13519
|
+
S([_("function")], E.prototype, "validateInput", 2);
|
13520
|
+
S([_("object")], E.prototype, "chatStyle", 2);
|
13521
|
+
S([_("object")], E.prototype, "attachmentContainerStyle", 2);
|
13522
|
+
S([_("object")], E.prototype, "dropupStyles", 2);
|
13523
|
+
S([_("object")], E.prototype, "inputAreaStyle", 2);
|
13524
|
+
S([_("object")], E.prototype, "textInput", 2);
|
13525
|
+
S([_("object")], E.prototype, "submitButtonStyles", 2);
|
13526
|
+
S([_("string")], E.prototype, "auxiliaryStyle", 2);
|
13527
|
+
S([_("array")], E.prototype, "history", 2);
|
13528
|
+
S([_("object")], E.prototype, "introMessage", 2);
|
13529
|
+
S([_("object")], E.prototype, "avatars", 2);
|
13530
|
+
S([_("object")], E.prototype, "names", 2);
|
13531
|
+
S([_("boolean")], E.prototype, "displayLoadingBubble", 2);
|
13532
|
+
S([_("object")], E.prototype, "errorMessages", 2);
|
13533
|
+
S([_("object")], E.prototype, "messageStyles", 2);
|
13534
|
+
S([_("object")], E.prototype, "textToSpeech", 2);
|
13535
|
+
S([_("object")], E.prototype, "speechToText", 2);
|
13536
|
+
S([_("object")], E.prototype, "images", 2);
|
13537
|
+
S([_("object")], E.prototype, "gifs", 2);
|
13538
|
+
S([_("object")], E.prototype, "camera", 2);
|
13539
|
+
S([_("object")], E.prototype, "audio", 2);
|
13540
|
+
S([_("object")], E.prototype, "microphone", 2);
|
13541
|
+
S([_("object")], E.prototype, "mixedFiles", 2);
|
13542
|
+
S([_("object")], E.prototype, "dragAndDrop", 2);
|
13543
|
+
S([_("object")], E.prototype, "introPanelStyle", 2);
|
13544
|
+
S([_("object")], E.prototype, "htmlClassUtilities", 2);
|
13545
|
+
S([_("function")], E.prototype, "onMessage", 2);
|
13546
|
+
S([_("function")], E.prototype, "onClearMessages", 2);
|
13547
|
+
S([_("function")], E.prototype, "onComponentRender", 2);
|
13548
|
+
S([_("function")], E.prototype, "onError", 2);
|
13549
|
+
S([_("object")], E.prototype, "demo", 2);
|
13550
|
+
S([_("object")], E.prototype, "_insertKeyViewStyles", 2);
|
13551
|
+
customElements.define("deep-chat", E);
|
13552
|
+
export { E as DeepChat };
|