deep-chat-dev 9.0.166 → 9.0.168
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/README.md +11 -5
- package/custom-elements.json +4746 -4706
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.js +439 -415
- package/dist/services/openAI/utils/openAIAssistantUtils.d.ts.map +1 -1
- package/dist/utils/HTTP/stream.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/camera/cameraButton.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/customButtonInnerElements.d.ts.map +1 -1
- package/dist/views/chat/messages/html/htmlUtils.d.ts +2 -0
- package/dist/views/chat/messages/html/htmlUtils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -2,7 +2,7 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
|
|
2
2
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
3
3
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
4
4
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
5
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(
|
5
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e3) { throw _e3; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e4) { didErr = true; err = _e4; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
6
6
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
7
7
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
8
8
|
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
@@ -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 U = gi;
|
454
454
|
var bi = /*#__PURE__*/function () {
|
455
455
|
function bi() {
|
456
456
|
_classCallCheck(this, bi);
|
@@ -482,11 +482,11 @@ var bi = /*#__PURE__*/function () {
|
|
482
482
|
}();
|
483
483
|
bi.LOAD_VOICES_MS = 200;
|
484
484
|
var rt = bi;
|
485
|
-
var
|
486
|
-
function
|
487
|
-
_classCallCheck(this,
|
485
|
+
var ue = /*#__PURE__*/function () {
|
486
|
+
function ue() {
|
487
|
+
_classCallCheck(this, ue);
|
488
488
|
}
|
489
|
-
return _createClass(
|
489
|
+
return _createClass(ue, null, [{
|
490
490
|
key: "checkForContainerStyles",
|
491
491
|
value: function checkForContainerStyles(e, t) {
|
492
492
|
var i = e.containerStyle;
|
@@ -554,15 +554,15 @@ var he = /*#__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
|
+
ie = /*#__PURE__*/function () {
|
558
|
+
function ie() {
|
559
|
+
_classCallCheck(this, ie);
|
560
560
|
}
|
561
|
-
return _createClass(
|
561
|
+
return _createClass(ie, null, [{
|
562
562
|
key: "hide",
|
563
563
|
value: function hide(e) {
|
564
564
|
var t;
|
565
|
-
(t = e.getElementsByClassName(
|
565
|
+
(t = e.getElementsByClassName(ie.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 && ie.applyCustomStylesToElements(e, t, i["default"].styles), n === b.USER_ROLE) (o = i.user) != null && o.styles && ie.applyCustomStylesToElements(e, t, i.user.styles);else {
|
577
|
+
(a = i.ai) != null && a.styles && ie.applyCustomStylesToElements(e, t, i.ai.styles);
|
578
578
|
var c = (l = i[n]) == null ? void 0 : l.styles;
|
579
|
-
c &&
|
579
|
+
c && ie.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(ie.CONTAINER_CLASS), n.appendChild(i), t && ie.applyCustomStyles(n, i, t, e), n;
|
590
590
|
}
|
591
591
|
}, {
|
592
592
|
key: "getPosition",
|
@@ -600,23 +600,23 @@ 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 = ie.createAvatar(t, n),
|
604
|
+
o = ie.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 =
|
611
|
-
var
|
612
|
-
function
|
613
|
-
_classCallCheck(this,
|
609
|
+
ie.CONTAINER_CLASS = "avatar-container";
|
610
|
+
var Zt = ie;
|
611
|
+
var be = /*#__PURE__*/function () {
|
612
|
+
function be() {
|
613
|
+
_classCallCheck(this, be);
|
614
614
|
}
|
615
|
-
return _createClass(
|
615
|
+
return _createClass(be, null, [{
|
616
616
|
key: "hide",
|
617
617
|
value: function hide(e) {
|
618
618
|
var t;
|
619
|
-
(t = e.getElementsByClassName(
|
619
|
+
(t = e.getElementsByClassName(be.NAME_CLASS)[0].style).visibility || (t.visibility = "hidden");
|
620
620
|
}
|
621
621
|
}, {
|
622
622
|
key: "getPosition",
|
@@ -642,25 +642,25 @@ var ge = /*#__PURE__*/function () {
|
|
642
642
|
key: "createName",
|
643
643
|
value: function createName(e, t) {
|
644
644
|
var i = document.createElement("div");
|
645
|
-
return i.classList.add(
|
645
|
+
return i.classList.add(be.NAME_CLASS), i.textContent = be.getNameText(e, t), be.applyStyle(i, e, t), i;
|
646
646
|
}
|
647
647
|
}, {
|
648
648
|
key: "add",
|
649
649
|
value: function add(e, t, i) {
|
650
650
|
var n = typeof i == "boolean" ? {} : i,
|
651
|
-
r =
|
652
|
-
o =
|
651
|
+
r = be.createName(t, n),
|
652
|
+
o = be.getPosition(t, n);
|
653
653
|
r.classList.add(o === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(o === "left" ? "beforebegin" : "afterend", r);
|
654
654
|
}
|
655
655
|
}]);
|
656
656
|
}();
|
657
|
-
|
658
|
-
var Yt =
|
659
|
-
var
|
660
|
-
function
|
661
|
-
_classCallCheck(this,
|
657
|
+
be.NAME_CLASS = "name";
|
658
|
+
var Yt = be;
|
659
|
+
var ae = /*#__PURE__*/function () {
|
660
|
+
function ae() {
|
661
|
+
_classCallCheck(this, ae);
|
662
662
|
}
|
663
|
-
return _createClass(
|
663
|
+
return _createClass(ae, null, [{
|
664
664
|
key: "getLastElementsByClass",
|
665
665
|
value: function getLastElementsByClass(e, t, i) {
|
666
666
|
var _loop = function _loop() {
|
@@ -701,8 +701,8 @@ var oe = /*#__PURE__*/function () {
|
|
701
701
|
}, {
|
702
702
|
key: "overwriteMessage",
|
703
703
|
value: function overwriteMessage(e, t, i, n, r, o) {
|
704
|
-
var a =
|
705
|
-
l =
|
704
|
+
var a = ae.getLastElementsByClass(t, [ae.getRoleClass(n), o], ["loading-message-text"]),
|
705
|
+
l = ae.getLastMessage(e, n, r);
|
706
706
|
return l && (l[r] = i), a;
|
707
707
|
}
|
708
708
|
}, {
|
@@ -714,18 +714,18 @@ var oe = /*#__PURE__*/function () {
|
|
714
714
|
}, {
|
715
715
|
key: "fillEmptyMessageElement",
|
716
716
|
value: function fillEmptyMessageElement(e, t) {
|
717
|
-
t.trim().length === 0 && (e.classList.add(
|
717
|
+
t.trim().length === 0 && (e.classList.add(ae.EMPTY_MESSAGE_CLASS), e.innerHTML = '<div style="color:#00000000">.</div>');
|
718
718
|
}
|
719
719
|
}, {
|
720
720
|
key: "unfillEmptyMessageElement",
|
721
721
|
value: function unfillEmptyMessageElement(e, t) {
|
722
|
-
e.classList.contains(
|
722
|
+
e.classList.contains(ae.EMPTY_MESSAGE_CLASS) && t.trim().length > 0 && e.replaceChildren();
|
723
723
|
}
|
724
724
|
}, {
|
725
725
|
key: "getLastMessageBubbleElement",
|
726
726
|
value: function getLastMessageBubbleElement(e) {
|
727
727
|
var t, i, n;
|
728
|
-
return Array.from(((n = (i = (t =
|
728
|
+
return Array.from(((n = (i = (t = ae.getLastMessageElement(e)) == null ? void 0 : t.children) == null ? void 0 : i[0]) == null ? void 0 : n.children) || []).find(function (r) {
|
729
729
|
return r.classList.contains("message-bubble");
|
730
730
|
});
|
731
731
|
}
|
@@ -747,8 +747,8 @@ var oe = /*#__PURE__*/function () {
|
|
747
747
|
}
|
748
748
|
}]);
|
749
749
|
}();
|
750
|
-
|
751
|
-
var b =
|
750
|
+
ae.AI_ROLE = "ai", ae.USER_ROLE = "user", ae.EMPTY_MESSAGE_CLASS = "empty-message";
|
751
|
+
var b = ae;
|
752
752
|
var qe = /*#__PURE__*/function () {
|
753
753
|
function qe() {
|
754
754
|
_classCallCheck(this, qe);
|
@@ -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
|
+
X.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 X = /*#__PURE__*/function () {
|
878
|
+
function X() {
|
879
|
+
_classCallCheck(this, X);
|
880
880
|
}
|
881
|
-
return _createClass(
|
881
|
+
return _createClass(X, null, [{
|
882
882
|
key: "applyStylesToElement",
|
883
883
|
value: function applyStylesToElement(e, t) {
|
884
884
|
var i = M.processStateful(t, {}, {});
|
@@ -897,7 +897,7 @@ var fe = /*#__PURE__*/function () {
|
|
897
897
|
value: function applyClassUtilitiesToElement(e, t) {
|
898
898
|
var i = t.events,
|
899
899
|
n = t.styles;
|
900
|
-
i &&
|
900
|
+
i && X.applyEventsToElement(e, i), n && !Le.doesElementContainDeepChatClass(e) && X.applyStylesToElement(e, n);
|
901
901
|
}
|
902
902
|
}, {
|
903
903
|
key: "applyCustomClassUtilities",
|
@@ -905,14 +905,30 @@ var fe = /*#__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] && X.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), X.applyCustomClassUtilities(e.htmlClassUtilities, t);
|
916
|
+
}
|
917
|
+
}, {
|
918
|
+
key: "traverseNodes",
|
919
|
+
value: function traverseNodes(e, t) {
|
920
|
+
e.nodeType === Node.ELEMENT_NODE && t.push(e.outerHTML), e.childNodes.forEach(function (i) {
|
921
|
+
X.traverseNodes(i, t);
|
922
|
+
});
|
923
|
+
}
|
924
|
+
}, {
|
925
|
+
key: "splitHTML",
|
926
|
+
value: function splitHTML(e) {
|
927
|
+
var i = new DOMParser().parseFromString(e, "text/html"),
|
928
|
+
n = [];
|
929
|
+
return i.body.childNodes.forEach(function (r) {
|
930
|
+
X.traverseNodes(r, n);
|
931
|
+
}), n;
|
916
932
|
}
|
917
933
|
}]);
|
918
934
|
}();
|
@@ -936,7 +952,7 @@ var ct = /*#__PURE__*/function () {
|
|
936
952
|
value: function overwrite(e, t, i, n) {
|
937
953
|
var r = e.messages,
|
938
954
|
o = b.overwriteMessage(r, n, t, i, "html", "html-message");
|
939
|
-
return o && (o.bubbleElement.innerHTML = t,
|
955
|
+
return o && (o.bubbleElement.innerHTML = t, X.apply(e, o.outerContainer), ue.flagHTMLUpdateClass(o.bubbleElement)), o;
|
940
956
|
}
|
941
957
|
// prettier-ignore
|
942
958
|
}, {
|
@@ -949,7 +965,7 @@ var ct = /*#__PURE__*/function () {
|
|
949
965
|
r.status = !1;
|
950
966
|
}
|
951
967
|
var o = ct.createElements(e, t, i);
|
952
|
-
return b.fillEmptyMessageElement(o.bubbleElement, t),
|
968
|
+
return b.fillEmptyMessageElement(o.bubbleElement, t), X.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;
|
953
969
|
}
|
954
970
|
}]);
|
955
971
|
}();
|
@@ -1242,14 +1258,14 @@ cn.prototype.render = function (s, e, t) {
|
|
1242
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);
|
1243
1259
|
return o;
|
1244
1260
|
};
|
1245
|
-
function
|
1261
|
+
function Q() {
|
1246
1262
|
this.__rules__ = [], this.__cache__ = null;
|
1247
1263
|
}
|
1248
|
-
|
1264
|
+
Q.prototype.__find__ = function (s) {
|
1249
1265
|
for (var e = this.__rules__.length, t = -1; e--;) if (this.__rules__[++t].name === s) return t;
|
1250
1266
|
return -1;
|
1251
1267
|
};
|
1252
|
-
|
1268
|
+
Q.prototype.__compile__ = function () {
|
1253
1269
|
var s = this,
|
1254
1270
|
e = [""];
|
1255
1271
|
s.__rules__.forEach(function (t) {
|
@@ -1262,13 +1278,13 @@ Y.prototype.__compile__ = function () {
|
|
1262
1278
|
});
|
1263
1279
|
});
|
1264
1280
|
};
|
1265
|
-
|
1281
|
+
Q.prototype.at = function (s, e, t) {
|
1266
1282
|
var i = this.__find__(s),
|
1267
1283
|
n = t || {};
|
1268
1284
|
if (i === -1) throw new Error("Parser rule not found: " + s);
|
1269
1285
|
this.__rules__[i].fn = e, this.__rules__[i].alt = n.alt || [], this.__cache__ = null;
|
1270
1286
|
};
|
1271
|
-
|
1287
|
+
Q.prototype.before = function (s, e, t, i) {
|
1272
1288
|
var n = this.__find__(s),
|
1273
1289
|
r = i || {};
|
1274
1290
|
if (n === -1) throw new Error("Parser rule not found: " + s);
|
@@ -1279,7 +1295,7 @@ Y.prototype.before = function (s, e, t, i) {
|
|
1279
1295
|
alt: r.alt || []
|
1280
1296
|
}), this.__cache__ = null;
|
1281
1297
|
};
|
1282
|
-
|
1298
|
+
Q.prototype.after = function (s, e, t, i) {
|
1283
1299
|
var n = this.__find__(s),
|
1284
1300
|
r = i || {};
|
1285
1301
|
if (n === -1) throw new Error("Parser rule not found: " + s);
|
@@ -1290,7 +1306,7 @@ Y.prototype.after = function (s, e, t, i) {
|
|
1290
1306
|
alt: r.alt || []
|
1291
1307
|
}), this.__cache__ = null;
|
1292
1308
|
};
|
1293
|
-
|
1309
|
+
Q.prototype.push = function (s, e, t) {
|
1294
1310
|
var i = t || {};
|
1295
1311
|
this.__rules__.push({
|
1296
1312
|
name: s,
|
@@ -1299,7 +1315,7 @@ Y.prototype.push = function (s, e, t) {
|
|
1299
1315
|
alt: i.alt || []
|
1300
1316
|
}), this.__cache__ = null;
|
1301
1317
|
};
|
1302
|
-
|
1318
|
+
Q.prototype.enable = function (s, e) {
|
1303
1319
|
s = Array.isArray(s) ? s : [s], e && this.__rules__.forEach(function (t) {
|
1304
1320
|
t.enabled = !1;
|
1305
1321
|
}), s.forEach(function (t) {
|
@@ -1308,14 +1324,14 @@ Y.prototype.enable = function (s, e) {
|
|
1308
1324
|
this.__rules__[i].enabled = !0;
|
1309
1325
|
}, this), this.__cache__ = null;
|
1310
1326
|
};
|
1311
|
-
|
1327
|
+
Q.prototype.disable = function (s) {
|
1312
1328
|
s = Array.isArray(s) ? s : [s], s.forEach(function (e) {
|
1313
1329
|
var t = this.__find__(e);
|
1314
1330
|
if (t < 0) throw new Error("Rules manager: invalid rule name " + e);
|
1315
1331
|
this.__rules__[t].enabled = !1;
|
1316
1332
|
}, this), this.__cache__ = null;
|
1317
1333
|
};
|
1318
|
-
|
1334
|
+
Q.prototype.getRules = function (s) {
|
1319
1335
|
return this.__cache__ === null && this.__compile__(), this.__cache__[s] || [];
|
1320
1336
|
};
|
1321
1337
|
function Is(s) {
|
@@ -1635,7 +1651,7 @@ function Ws(s) {
|
|
1635
1651
|
}
|
1636
1652
|
var Fi = [["block", Is], ["abbr", Ps], ["references", Ns], ["inline", Ds], ["footnote_tail", Fs], ["abbr2", Bs], ["replacements", zs], ["smartquotes", Ws]];
|
1637
1653
|
function rs() {
|
1638
|
-
this.options = {}, this.ruler = new
|
1654
|
+
this.options = {}, this.ruler = new Q();
|
1639
1655
|
for (var s = 0; s < Fi.length; s++) this.ruler.push(Fi[s][0], Fi[s][1]);
|
1640
1656
|
}
|
1641
1657
|
rs.prototype.process = function (s) {
|
@@ -1825,8 +1841,8 @@ function Ys(s, e, t, i) {
|
|
1825
1841
|
p,
|
1826
1842
|
x,
|
1827
1843
|
S,
|
1828
|
-
|
1829
|
-
|
1844
|
+
ee,
|
1845
|
+
re,
|
1830
1846
|
Te,
|
1831
1847
|
R,
|
1832
1848
|
$ = !0,
|
@@ -1837,7 +1853,7 @@ function Ys(s, e, t, i) {
|
|
1837
1853
|
if ((h = An(s, e)) >= 0) x = !0;else if ((h = kn(s, e)) >= 0) x = !1;else return !1;
|
1838
1854
|
if (s.level >= s.options.maxNesting) return !1;
|
1839
1855
|
if (p = s.src.charCodeAt(h - 1), i) return !0;
|
1840
|
-
for (
|
1856
|
+
for (ee = s.tokens.length, x ? (d = s.bMarks[e] + s.tShift[e], m = Number(s.src.substr(d, h - d - 1)), s.tokens.push({
|
1841
1857
|
type: "ordered_list_open",
|
1842
1858
|
order: m,
|
1843
1859
|
lines: Te = [e, 0],
|
@@ -1846,11 +1862,11 @@ function Ys(s, e, t, i) {
|
|
1846
1862
|
type: "bullet_list_open",
|
1847
1863
|
lines: Te = [e, 0],
|
1848
1864
|
level: s.level++
|
1849
|
-
}), n = e,
|
1865
|
+
}), n = e, re = !1, K = s.parser.ruler.getRules("list"); n < t && (S = s.skipSpaces(h), u = s.eMarks[n], S >= u ? f = 1 : f = S - h, f > 4 && (f = 1), f < 1 && (f = 1), r = h - s.bMarks[n] + f, s.tokens.push({
|
1850
1866
|
type: "list_item_open",
|
1851
1867
|
lines: R = [e, 0],
|
1852
1868
|
level: s.level++
|
1853
|
-
}), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] = S - s.bMarks[e], s.blkIndent = r, s.tight = !0, s.parentType = "list", s.parser.tokenize(s, e, t, !0), (!s.tight ||
|
1869
|
+
}), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] = S - s.bMarks[e], s.blkIndent = r, s.tight = !0, s.parentType = "list", s.parser.tokenize(s, e, t, !0), (!s.tight || re) && ($ = !1), re = 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({
|
1854
1870
|
type: "list_item_close",
|
1855
1871
|
level: --s.level
|
1856
1872
|
}), n = e = s.line, R[1] = n, S = s.bMarks[e], !(n >= t || s.isEmpty(n) || s.tShift[n] < s.blkIndent));) {
|
@@ -1867,7 +1883,7 @@ function Ys(s, e, t, i) {
|
|
1867
1883
|
return s.tokens.push({
|
1868
1884
|
type: x ? "ordered_list_close" : "bullet_list_close",
|
1869
1885
|
level: --s.level
|
1870
|
-
}), Te[1] = n, s.line = n, $ && Zs(s,
|
1886
|
+
}), Te[1] = n, s.line = n, $ && Zs(s, ee), !0;
|
1871
1887
|
}
|
1872
1888
|
function Qs(s, e, t, i) {
|
1873
1889
|
var n,
|
@@ -2149,7 +2165,7 @@ function cr(s, e) {
|
|
2149
2165
|
}
|
2150
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]];
|
2151
2167
|
function dn() {
|
2152
|
-
this.ruler = new
|
2168
|
+
this.ruler = new Q();
|
2153
2169
|
for (var s = 0; s < Wt.length; s++) this.ruler.push(Wt[s][0], Wt[s][1], {
|
2154
2170
|
alt: (Wt[s][2] || []).slice()
|
2155
2171
|
});
|
@@ -2634,7 +2650,7 @@ function Xr(s, e) {
|
|
2634
2650
|
}
|
2635
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]];
|
2636
2652
|
function Ei() {
|
2637
|
-
this.ruler = new
|
2653
|
+
this.ruler = new Q();
|
2638
2654
|
for (var s = 0; s < ji.length; s++) this.ruler.push(ji[s][0], ji[s][1]);
|
2639
2655
|
this.validateLink = Zr;
|
2640
2656
|
}
|
@@ -2791,34 +2807,34 @@ var Yr = {
|
|
2791
2807
|
function as(s, e, t) {
|
2792
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;
|
2793
2809
|
}
|
2794
|
-
function
|
2795
|
-
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
|
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 Q(), this.options = {}, this.configure(to[s]), this.set(e || {});
|
2796
2812
|
}
|
2797
|
-
|
2813
|
+
Se.prototype.set = function (s) {
|
2798
2814
|
Qn(this.options, s);
|
2799
2815
|
};
|
2800
|
-
|
2816
|
+
Se.prototype.configure = function (s) {
|
2801
2817
|
var e = this;
|
2802
2818
|
if (!s) throw new Error("Wrong `remarkable` preset, check name/content");
|
2803
2819
|
s.options && e.set(s.options), s.components && Object.keys(s.components).forEach(function (t) {
|
2804
2820
|
s.components[t].rules && e[t].ruler.enable(s.components[t].rules, !0);
|
2805
2821
|
});
|
2806
2822
|
};
|
2807
|
-
|
2823
|
+
Se.prototype.use = function (s, e) {
|
2808
2824
|
return s(this, e), this;
|
2809
2825
|
};
|
2810
|
-
|
2826
|
+
Se.prototype.parse = function (s, e) {
|
2811
2827
|
var t = new as(this, s, e);
|
2812
2828
|
return this.core.process(t), t.tokens;
|
2813
2829
|
};
|
2814
|
-
|
2830
|
+
Se.prototype.render = function (s, e) {
|
2815
2831
|
return e = e || {}, this.renderer.render(this.parse(s, e), this.options, e);
|
2816
2832
|
};
|
2817
|
-
|
2833
|
+
Se.prototype.parseInline = function (s, e) {
|
2818
2834
|
var t = new as(this, s, e);
|
2819
2835
|
return t.inlineMode = !0, this.core.process(t), t.tokens;
|
2820
2836
|
};
|
2821
|
-
|
2837
|
+
Se.prototype.renderInline = function (s, e) {
|
2822
2838
|
return e = e || {}, this.renderer.render(this.parseInline(s, e), this.options, e);
|
2823
2839
|
};
|
2824
2840
|
var Mt = /*#__PURE__*/function () {
|
@@ -2829,7 +2845,7 @@ var Mt = /*#__PURE__*/function () {
|
|
2829
2845
|
key: "instantiate",
|
2830
2846
|
value: function instantiate() {
|
2831
2847
|
var e = window.hljs;
|
2832
|
-
return e ? new
|
2848
|
+
return e ? new Se({
|
2833
2849
|
highlight: function highlight(t, i) {
|
2834
2850
|
if (i && e.getLanguage(i)) try {
|
2835
2851
|
return e.highlight(i, t).value;
|
@@ -2855,7 +2871,7 @@ var Mt = /*#__PURE__*/function () {
|
|
2855
2871
|
// set target to open in a new tab
|
2856
2872
|
typographer: !0
|
2857
2873
|
// Enable smartypants and other sweet transforms
|
2858
|
-
}) : new
|
2874
|
+
}) : new Se({
|
2859
2875
|
linkTarget: "_blank"
|
2860
2876
|
// set target to open in a new tab
|
2861
2877
|
});
|
@@ -2954,7 +2970,7 @@ var Me = /*#__PURE__*/function () {
|
|
2954
2970
|
}]);
|
2955
2971
|
}();
|
2956
2972
|
Me.DEFAULT_FILE_NAME = "file";
|
2957
|
-
var
|
2973
|
+
var B = Me;
|
2958
2974
|
var Qt = /*#__PURE__*/function () {
|
2959
2975
|
function Qt() {
|
2960
2976
|
_classCallCheck(this, Qt);
|
@@ -2968,9 +2984,9 @@ var Qt = /*#__PURE__*/function () {
|
|
2968
2984
|
isHistory: i,
|
2969
2985
|
isInitial: i
|
2970
2986
|
}));
|
2971
|
-
|
2987
|
+
B.reAddFileRefToObject(t, n), (r = e.onMessage) == null || r.call(e, n), e.dispatchEvent(new CustomEvent("message", {
|
2972
2988
|
detail: n
|
2973
|
-
})),
|
2989
|
+
})), ue.fireOnNewMessage(e, n);
|
2974
2990
|
}
|
2975
2991
|
}, {
|
2976
2992
|
key: "onClearMessages",
|
@@ -2996,11 +3012,11 @@ var Qt = /*#__PURE__*/function () {
|
|
2996
3012
|
}
|
2997
3013
|
}]);
|
2998
3014
|
}();
|
2999
|
-
var
|
3000
|
-
function
|
3001
|
-
_classCallCheck(this,
|
3015
|
+
var j = /*#__PURE__*/function () {
|
3016
|
+
function j() {
|
3017
|
+
_classCallCheck(this, j);
|
3002
3018
|
}
|
3003
|
-
return _createClass(
|
3019
|
+
return _createClass(j, null, [{
|
3004
3020
|
key: "applyCustomStylesToElements",
|
3005
3021
|
value: function applyCustomStylesToElements(e, t, i) {
|
3006
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)) {
|
@@ -3012,7 +3028,7 @@ var B = /*#__PURE__*/function () {
|
|
3012
3028
|
}, {
|
3013
3029
|
key: "applySideStyles",
|
3014
3030
|
value: function applySideStyles(e, t, i, n) {
|
3015
|
-
n && (
|
3031
|
+
n && (j.applyCustomStylesToElements(e, i, n.shared), t === b.USER_ROLE ? j.applyCustomStylesToElements(e, i, n.user) : (j.applyCustomStylesToElements(e, i, n.ai), j.applyCustomStylesToElements(e, i, n[t])));
|
3016
3032
|
}
|
3017
3033
|
}, {
|
3018
3034
|
key: "isElementsStyles",
|
@@ -3024,7 +3040,7 @@ var B = /*#__PURE__*/function () {
|
|
3024
3040
|
key: "applyCustomStyles",
|
3025
3041
|
value: function applyCustomStyles(e, t, i, n, r) {
|
3026
3042
|
var o;
|
3027
|
-
r && e["default"] !== r ?
|
3043
|
+
r && e["default"] !== r ? j.isElementsStyles(r) ? (j.applyCustomStylesToElements(t, n, (o = e["default"]) == null ? void 0 : o.shared), j.applyCustomStylesToElements(t, n, r)) : (j.applySideStyles(t, i, n, e["default"]), j.applySideStyles(t, i, n, r)) : j.applySideStyles(t, i, n, e["default"]);
|
3028
3044
|
}
|
3029
3045
|
// prettier-ignore
|
3030
3046
|
}, {
|
@@ -3081,7 +3097,7 @@ var ot = /*#__PURE__*/function () {
|
|
3081
3097
|
var _this4 = this;
|
3082
3098
|
var i = this.createNewMessageElement(e, t);
|
3083
3099
|
return this.elementRef.appendChild(i.outerContainer), setTimeout(function () {
|
3084
|
-
return
|
3100
|
+
return U.scrollToBottom(_this4.elementRef);
|
3085
3101
|
}), i;
|
3086
3102
|
}
|
3087
3103
|
}, {
|
@@ -3115,7 +3131,7 @@ var ot = /*#__PURE__*/function () {
|
|
3115
3131
|
}, {
|
3116
3132
|
key: "applyCustomStyles",
|
3117
3133
|
value: function applyCustomStyles(e, t, i, n) {
|
3118
|
-
e && this.messageStyles &&
|
3134
|
+
e && this.messageStyles && j.applyCustomStyles(this.messageStyles, e, t, i, n);
|
3119
3135
|
}
|
3120
3136
|
}, {
|
3121
3137
|
key: "removeLastMessage",
|
@@ -3201,13 +3217,13 @@ var Re = /*#__PURE__*/function () {
|
|
3201
3217
|
if (this._hasStreamEnded) return;
|
3202
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);
|
3203
3219
|
var t = (e == null ? void 0 : e.text) || (e == null ? void 0 : e.html) || "",
|
3204
|
-
i =
|
3220
|
+
i = U.isScrollbarAtBottomOfElement(this._messages.elementRef),
|
3205
3221
|
n = (e == null ? void 0 : e.text) !== void 0 ? "text" : "html";
|
3206
3222
|
if (!this._elements && this._streamedContent === "") this.setInitialState(n, t, e == null ? void 0 : e.role);else {
|
3207
3223
|
if (this._streamType !== n) return console.error(A.INVALID_STREAM_EVENT_MIX);
|
3208
3224
|
this.updateBasedOnType(t, n, (r = this._elements) == null ? void 0 : r.bubbleElement, e == null ? void 0 : e.overwrite);
|
3209
3225
|
}
|
3210
|
-
i &&
|
3226
|
+
i && U.scrollToBottom(this._messages.elementRef);
|
3211
3227
|
}
|
3212
3228
|
}, {
|
3213
3229
|
key: "setInitialState",
|
@@ -3243,7 +3259,7 @@ var Re = /*#__PURE__*/function () {
|
|
3243
3259
|
var e = this._messages.textElementsToText;
|
3244
3260
|
if (!this._endStreamAfterOperation && !(this._fileAdded && !this._elements)) {
|
3245
3261
|
if (!this._elements) throw Error(A.NO_VALID_STREAM_EVENTS_SENT);
|
3246
|
-
(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 && X.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);
|
3247
3263
|
}
|
3248
3264
|
}
|
3249
3265
|
}, {
|
@@ -3289,7 +3305,7 @@ var Re = /*#__PURE__*/function () {
|
|
3289
3305
|
}]);
|
3290
3306
|
}();
|
3291
3307
|
Re.MESSAGE_CLASS = "streamed-message", Re.HTML_CONTENT_PLACEHOLDER = "htmlplaceholder";
|
3292
|
-
var
|
3308
|
+
var pe = Re;
|
3293
3309
|
var Ue = /*#__PURE__*/function () {
|
3294
3310
|
function Ue() {
|
3295
3311
|
_classCallCheck(this, Ue);
|
@@ -3544,13 +3560,13 @@ function lo(s, e) {
|
|
3544
3560
|
l || document.addEventListener("visibilitychange", p);
|
3545
3561
|
var x = ao,
|
3546
3562
|
S = 0;
|
3547
|
-
function
|
3563
|
+
function ee() {
|
3548
3564
|
document.removeEventListener("visibilitychange", p), window.clearTimeout(S), m.abort();
|
3549
3565
|
}
|
3550
3566
|
t == null || t.addEventListener("abort", function () {
|
3551
|
-
|
3567
|
+
ee(), h();
|
3552
3568
|
});
|
3553
|
-
var
|
3569
|
+
var re = c !== null && c !== void 0 ? c : window.fetch,
|
3554
3570
|
Te = n !== null && n !== void 0 ? n : co;
|
3555
3571
|
function R() {
|
3556
3572
|
return _R.apply(this, arguments);
|
@@ -3564,7 +3580,7 @@ function lo(s, e) {
|
|
3564
3580
|
m = new AbortController();
|
3565
3581
|
_context4.prev = 1;
|
3566
3582
|
_context4.next = 4;
|
3567
|
-
return
|
3583
|
+
return re(s, Object.assign(Object.assign({}, d), {
|
3568
3584
|
headers: f,
|
3569
3585
|
signal: m.signal
|
3570
3586
|
}));
|
@@ -3581,7 +3597,7 @@ function lo(s, e) {
|
|
3581
3597
|
}, r)));
|
3582
3598
|
case 9:
|
3583
3599
|
o == null || o();
|
3584
|
-
|
3600
|
+
ee();
|
3585
3601
|
h();
|
3586
3602
|
_context4.next = 17;
|
3587
3603
|
break;
|
@@ -3592,7 +3608,7 @@ function lo(s, e) {
|
|
3592
3608
|
N = ($ = a == null ? void 0 : a(_context4.t0)) !== null && $ !== void 0 ? $ : x;
|
3593
3609
|
window.clearTimeout(S), S = window.setTimeout(R, N);
|
3594
3610
|
} catch (N) {
|
3595
|
-
|
3611
|
+
ee(), u(N);
|
3596
3612
|
}
|
3597
3613
|
case 17:
|
3598
3614
|
case "end":
|
@@ -3623,8 +3639,8 @@ var C = /*#__PURE__*/function () {
|
|
3623
3639
|
p,
|
3624
3640
|
x,
|
3625
3641
|
S,
|
3626
|
-
|
3627
|
-
|
3642
|
+
ee,
|
3643
|
+
re,
|
3628
3644
|
Te,
|
3629
3645
|
o,
|
3630
3646
|
_yield$v$processReque,
|
@@ -3668,17 +3684,17 @@ var C = /*#__PURE__*/function () {
|
|
3668
3684
|
_context7.next = 17;
|
3669
3685
|
break;
|
3670
3686
|
}
|
3671
|
-
return _context7.abrupt("return",
|
3687
|
+
return _context7.abrupt("return", Ee.stream(e, a, i));
|
3672
3688
|
case 17:
|
3673
|
-
if (!(((S = e.connectSettings) == null ? void 0 : S.url) ===
|
3689
|
+
if (!(((S = e.connectSettings) == null ? void 0 : S.url) === me.URL)) {
|
3674
3690
|
_context7.next = 19;
|
3675
3691
|
break;
|
3676
3692
|
}
|
3677
|
-
return _context7.abrupt("return",
|
3693
|
+
return _context7.abrupt("return", me.requestStream(i, e.streamHandlers));
|
3678
3694
|
case 19:
|
3679
|
-
f = new
|
3680
|
-
return _context7.abrupt("return", (lo(((
|
3681
|
-
method: ((
|
3695
|
+
f = new pe(i), m = v.fetch.bind(this, e, l, n);
|
3696
|
+
return _context7.abrupt("return", (lo(((ee = e.connectSettings) == null ? void 0 : ee.url) || e.url || "", {
|
3697
|
+
method: ((re = e.connectSettings) == null ? void 0 : re.method) || "POST",
|
3682
3698
|
headers: l,
|
3683
3699
|
credentials: (Te = e.connectSettings) == null ? void 0 : Te.credentials,
|
3684
3700
|
body: n ? JSON.stringify(a) : a,
|
@@ -3778,29 +3794,33 @@ var C = /*#__PURE__*/function () {
|
|
3778
3794
|
key: "simulate",
|
3779
3795
|
value: function simulate(e, t, i) {
|
3780
3796
|
var n = t;
|
3781
|
-
if (
|
3797
|
+
if (i.files && e.addNewMessage(_objectSpread({
|
3782
3798
|
sendUpdate: !1,
|
3783
3799
|
ignoreText: !0
|
3784
3800
|
}, i), !1), i.text) {
|
3785
3801
|
t.onOpen();
|
3786
3802
|
var r = i.text.split("");
|
3787
|
-
C.populateMessages(r, new
|
3803
|
+
C.populateMessages(r, new pe(e), n, "text");
|
3804
|
+
}
|
3805
|
+
if (i.html) {
|
3806
|
+
t.onOpen();
|
3807
|
+
var _r2 = X.splitHTML(i.html);
|
3808
|
+
C.populateMessages(_r2, new pe(e), n, "html");
|
3788
3809
|
}
|
3789
3810
|
}
|
3811
|
+
// prettier-ignore
|
3790
3812
|
}, {
|
3791
3813
|
key: "populateMessages",
|
3792
|
-
value: function populateMessages(e, t, i) {
|
3793
|
-
var
|
3794
|
-
var
|
3795
|
-
if (
|
3796
|
-
t.upsertStreamedMessage({
|
3797
|
-
|
3798
|
-
|
3799
|
-
var o = setTimeout(function () {
|
3800
|
-
C.populateMessages(e, t, i, n + 1);
|
3814
|
+
value: function populateMessages(e, t, i, n) {
|
3815
|
+
var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
3816
|
+
var o = e[r];
|
3817
|
+
if (o) {
|
3818
|
+
t.upsertStreamedMessage(_defineProperty({}, n, o));
|
3819
|
+
var a = setTimeout(function () {
|
3820
|
+
C.populateMessages(e, t, i, n, r + 1);
|
3801
3821
|
}, i.simulationInterim || 6);
|
3802
3822
|
i.abortStream.abort = function () {
|
3803
|
-
C.abort(
|
3823
|
+
C.abort(a, t, i.onClose);
|
3804
3824
|
};
|
3805
3825
|
} else t.finaliseStreamedMessage(), i.onClose();
|
3806
3826
|
}
|
@@ -3905,7 +3925,7 @@ var He = /*#__PURE__*/function () {
|
|
3905
3925
|
}]);
|
3906
3926
|
}();
|
3907
3927
|
He.URL = "deep-chat-demo";
|
3908
|
-
var
|
3928
|
+
var me = He;
|
3909
3929
|
var V = /*#__PURE__*/function () {
|
3910
3930
|
function V() {
|
3911
3931
|
_classCallCheck(this, V);
|
@@ -3913,7 +3933,7 @@ var V = /*#__PURE__*/function () {
|
|
3913
3933
|
return _createClass(V, null, [{
|
3914
3934
|
key: "setup",
|
3915
3935
|
value: function setup(e) {
|
3916
|
-
e.connectSettings.url !==
|
3936
|
+
e.connectSettings.url !== me.URL && (e.permittedErrorPrefixes = ["Connection error", "Error in server message"], e.websocket = "pending");
|
3917
3937
|
}
|
3918
3938
|
}, {
|
3919
3939
|
key: "createConnection",
|
@@ -3921,7 +3941,7 @@ var V = /*#__PURE__*/function () {
|
|
3921
3941
|
if (!document.body.contains(e.deepChat)) return;
|
3922
3942
|
var i = e.connectSettings.websocket;
|
3923
3943
|
if (i) {
|
3924
|
-
if (e.connectSettings.handler) return
|
3944
|
+
if (e.connectSettings.handler) return Ee.websocket(e, t);
|
3925
3945
|
try {
|
3926
3946
|
var n = typeof i != "boolean" ? i : void 0,
|
3927
3947
|
r = new WebSocket(e.connectSettings.url || "", n);
|
@@ -4053,11 +4073,11 @@ var V = /*#__PURE__*/function () {
|
|
4053
4073
|
return _context10.abrupt("return", r.newUserMessage.listener(a));
|
4054
4074
|
case 14:
|
4055
4075
|
c = n ? JSON.stringify(a) : a;
|
4056
|
-
if (!(((h = e.connectSettings) == null ? void 0 : h.url) ===
|
4076
|
+
if (!(((h = e.connectSettings) == null ? void 0 : h.url) === me.URL)) {
|
4057
4077
|
_context10.next = 17;
|
4058
4078
|
break;
|
4059
4079
|
}
|
4060
|
-
return _context10.abrupt("return",
|
4080
|
+
return _context10.abrupt("return", me.request(e, i));
|
4061
4081
|
case 17:
|
4062
4082
|
r.readyState === void 0 || r.readyState !== r.OPEN ? (console.error("Connection is not open"), i.isLastMessageError() || i.addNewErrorMessage("service", "Connection error")) : (r.send(JSON.stringify(c)), e.completionsHandlers.onFinish());
|
4063
4083
|
case 18:
|
@@ -4091,16 +4111,16 @@ var V = /*#__PURE__*/function () {
|
|
4091
4111
|
var _i$o;
|
4092
4112
|
var o = n.role || b.AI_ROLE,
|
4093
4113
|
a = i[o];
|
4094
|
-
n.text === r || n.html === r ? (a == null || a.finaliseStreamedMessage(), delete i[o]) : ((_i$o = i[o]) !== null && _i$o !== void 0 ? _i$o : i[o] = new
|
4114
|
+
n.text === r || n.html === r ? (a == null || a.finaliseStreamedMessage(), delete i[o]) : ((_i$o = i[o]) !== null && _i$o !== void 0 ? _i$o : i[o] = new pe(t), i[o].upsertStreamedMessage(n));
|
4095
4115
|
} else C.simulate(t, e.streamHandlers, n);
|
4096
4116
|
}
|
4097
4117
|
}]);
|
4098
4118
|
}();
|
4099
|
-
var
|
4100
|
-
function
|
4101
|
-
_classCallCheck(this,
|
4119
|
+
var Ee = /*#__PURE__*/function () {
|
4120
|
+
function Ee() {
|
4121
|
+
_classCallCheck(this, Ee);
|
4102
4122
|
}
|
4103
|
-
return _createClass(
|
4123
|
+
return _createClass(Ee, null, [{
|
4104
4124
|
key: "request",
|
4105
4125
|
value: function () {
|
4106
4126
|
var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(e, t, i) {
|
@@ -4143,7 +4163,7 @@ var xe = /*#__PURE__*/function () {
|
|
4143
4163
|
return function r(_x24) {
|
4144
4164
|
return _ref3.apply(this, arguments);
|
4145
4165
|
};
|
4146
|
-
}(), o =
|
4166
|
+
}(), o = Ee.generateOptionalSignals();
|
4147
4167
|
(l = (a = e.connectSettings).handler) == null || l.call(a, t, _objectSpread(_objectSpread({}, o), {}, {
|
4148
4168
|
onResponse: r
|
4149
4169
|
}));
|
@@ -4174,12 +4194,12 @@ var xe = /*#__PURE__*/function () {
|
|
4174
4194
|
var h, u;
|
4175
4195
|
var n = !0,
|
4176
4196
|
r = !1;
|
4177
|
-
var o = new
|
4197
|
+
var o = new pe(i),
|
4178
4198
|
a = function a() {
|
4179
4199
|
r || !n || (e.streamHandlers.onOpen(), r = !0);
|
4180
4200
|
},
|
4181
4201
|
l = function l() {
|
4182
|
-
n && (
|
4202
|
+
n && (Ee.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), n = !1);
|
4183
4203
|
},
|
4184
4204
|
c = /*#__PURE__*/function () {
|
4185
4205
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(f) {
|
@@ -4216,9 +4236,9 @@ var xe = /*#__PURE__*/function () {
|
|
4216
4236
|
};
|
4217
4237
|
}();
|
4218
4238
|
e.streamHandlers.abortStream.abort = function () {
|
4219
|
-
|
4239
|
+
Ee.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), n = !1;
|
4220
4240
|
};
|
4221
|
-
var d =
|
4241
|
+
var d = Ee.generateOptionalSignals();
|
4222
4242
|
(u = (h = e.connectSettings).handler) == null || u.call(h, t, _objectSpread(_objectSpread({}, d), {}, {
|
4223
4243
|
onOpen: a,
|
4224
4244
|
onResponse: c,
|
@@ -4283,7 +4303,7 @@ var xe = /*#__PURE__*/function () {
|
|
4283
4303
|
return _ref5.apply(this, arguments);
|
4284
4304
|
};
|
4285
4305
|
}(),
|
4286
|
-
a =
|
4306
|
+
a = Ee.generateOptionalSignals();
|
4287
4307
|
(c = (l = e.connectSettings).handler) == null || c.call(l, void 0, _objectSpread(_objectSpread({}, a), {}, {
|
4288
4308
|
onOpen: n,
|
4289
4309
|
onResponse: o,
|
@@ -4355,13 +4375,13 @@ var T = /*#__PURE__*/function () {
|
|
4355
4375
|
_context16.next = 13;
|
4356
4376
|
break;
|
4357
4377
|
}
|
4358
|
-
return _context16.abrupt("return",
|
4378
|
+
return _context16.abrupt("return", Ee.request(e, o, i));
|
4359
4379
|
case 13:
|
4360
|
-
if (!(((m = e.connectSettings) == null ? void 0 : m.url) ===
|
4380
|
+
if (!(((m = e.connectSettings) == null ? void 0 : m.url) === me.URL)) {
|
4361
4381
|
_context16.next = 15;
|
4362
4382
|
break;
|
4363
4383
|
}
|
4364
|
-
return _context16.abrupt("return",
|
4384
|
+
return _context16.abrupt("return", me.request(e, i));
|
4365
4385
|
case 15:
|
4366
4386
|
d = !0;
|
4367
4387
|
h = v.fetch.bind(this, e, a, n);
|
@@ -4371,7 +4391,7 @@ var T = /*#__PURE__*/function () {
|
|
4371
4391
|
return v.processResponseByType(p);
|
4372
4392
|
}).then( /*#__PURE__*/function () {
|
4373
4393
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(p) {
|
4374
|
-
var
|
4394
|
+
var ee, re, x, S;
|
4375
4395
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
4376
4396
|
while (1) switch (_context15.prev = _context15.next) {
|
4377
4397
|
case 0:
|
@@ -4382,7 +4402,7 @@ var T = /*#__PURE__*/function () {
|
|
4382
4402
|
return _context15.abrupt("return");
|
4383
4403
|
case 2:
|
4384
4404
|
_context15.next = 4;
|
4385
|
-
return (
|
4405
|
+
return (re = (ee = e.deepChat).responseInterceptor) == null ? void 0 : re.call(ee, p);
|
4386
4406
|
case 4:
|
4387
4407
|
_context15.t0 = _context15.sent;
|
4388
4408
|
if (_context15.t0) {
|
@@ -4705,7 +4725,7 @@ var We = /*#__PURE__*/function () {
|
|
4705
4725
|
var _a$url;
|
4706
4726
|
_classCallCheck(this, We);
|
4707
4727
|
var n, r, o, a, l;
|
4708
|
-
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 =
|
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 && V.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || ue.checkForStream(this.deepChat);
|
4709
4729
|
}
|
4710
4730
|
return _createClass(We, [{
|
4711
4731
|
key: "verifyKey",
|
@@ -4865,7 +4885,7 @@ var We = /*#__PURE__*/function () {
|
|
4865
4885
|
_context24.next = 4;
|
4866
4886
|
break;
|
4867
4887
|
}
|
4868
|
-
return _context24.abrupt("return",
|
4888
|
+
return _context24.abrupt("return", ue.handleResponseProperty(e));
|
4869
4889
|
case 4:
|
4870
4890
|
if (!v.validateResponseFormat(e)) {
|
4871
4891
|
_context24.next = 6;
|
@@ -4916,17 +4936,17 @@ var We = /*#__PURE__*/function () {
|
|
4916
4936
|
}
|
4917
4937
|
}]);
|
4918
4938
|
}();
|
4919
|
-
var
|
4939
|
+
var H = /*#__PURE__*/function (_We) {
|
4920
4940
|
// prettier-ignore
|
4921
|
-
function
|
4941
|
+
function H(e, t, i, n, r) {
|
4922
4942
|
var _this8;
|
4923
|
-
_classCallCheck(this,
|
4943
|
+
_classCallCheck(this, H);
|
4924
4944
|
var o;
|
4925
|
-
_this8 = _callSuper(this,
|
4945
|
+
_this8 = _callSuper(this, H, [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);
|
4926
4946
|
return _this8;
|
4927
4947
|
}
|
4928
|
-
_inherits(
|
4929
|
-
return _createClass(
|
4948
|
+
_inherits(H, _We);
|
4949
|
+
return _createClass(H, [{
|
4930
4950
|
key: "setApiKeyProperties",
|
4931
4951
|
value: function setApiKeyProperties(e) {
|
4932
4952
|
this.key = e.key, e.validateKeyProperty && (this.validateKeyProperty = e.validateKeyProperty);
|
@@ -4981,19 +5001,19 @@ var ei = /*#__PURE__*/function () {
|
|
4981
5001
|
}
|
4982
5002
|
}]);
|
4983
5003
|
}();
|
4984
|
-
var
|
5004
|
+
var ve = /*#__PURE__*/function (_HTMLElement) {
|
4985
5005
|
// If this is not working, try using propertyName directly
|
4986
|
-
function
|
5006
|
+
function ve() {
|
4987
5007
|
var _this9;
|
4988
|
-
_classCallCheck(this,
|
4989
|
-
_this9 = _callSuper(this,
|
4990
|
-
var t =
|
5008
|
+
_classCallCheck(this, ve);
|
5009
|
+
_this9 = _callSuper(this, ve), _this9._waitingToRender_ = !1, _this9._propUpdated_ = !1, Object.keys(ve._attributeToProperty_).forEach(function (e) {
|
5010
|
+
var t = ve._attributeToProperty_[e];
|
4991
5011
|
_this9.constructPropertyAccessors(t), _this9.hasOwnProperty(e) || _this9.constructPropertyAccessors(t, e);
|
4992
5012
|
});
|
4993
5013
|
return _this9;
|
4994
5014
|
}
|
4995
|
-
_inherits(
|
4996
|
-
return _createClass(
|
5015
|
+
_inherits(ve, _HTMLElement);
|
5016
|
+
return _createClass(ve, [{
|
4997
5017
|
key: "constructPropertyAccessors",
|
4998
5018
|
value:
|
4999
5019
|
// need to be called here as accessors need to be set for the class instance
|
@@ -5012,8 +5032,8 @@ var be = /*#__PURE__*/function (_HTMLElement) {
|
|
5012
5032
|
key: "attributeChangedCallback",
|
5013
5033
|
value: function attributeChangedCallback(e, t, i) {
|
5014
5034
|
if (t === i) return;
|
5015
|
-
var n =
|
5016
|
-
r =
|
5035
|
+
var n = ve._attributes_[e](i),
|
5036
|
+
r = ve._attributeToProperty_[e];
|
5017
5037
|
this[r] = n;
|
5018
5038
|
}
|
5019
5039
|
}, {
|
@@ -5022,19 +5042,19 @@ var be = /*#__PURE__*/function (_HTMLElement) {
|
|
5022
5042
|
}], [{
|
5023
5043
|
key: "observedAttributes",
|
5024
5044
|
get: function get() {
|
5025
|
-
return Object.keys(
|
5045
|
+
return Object.keys(ve._attributes_) || [];
|
5026
5046
|
}
|
5027
5047
|
}]);
|
5028
5048
|
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
5029
|
-
|
5030
|
-
var Xi =
|
5049
|
+
ve._attributes_ = {}, ve._attributeToProperty_ = {};
|
5050
|
+
var Xi = ve;
|
5031
5051
|
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",
|
5032
5052
|
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";
|
5033
|
-
var
|
5034
|
-
function
|
5035
|
-
_classCallCheck(this,
|
5053
|
+
var Y = /*#__PURE__*/function () {
|
5054
|
+
function Y() {
|
5055
|
+
_classCallCheck(this, Y);
|
5036
5056
|
}
|
5037
|
-
return _createClass(
|
5057
|
+
return _createClass(Y, null, [{
|
5038
5058
|
key: "createSVGElement",
|
5039
5059
|
value: function createSVGElement(e) {
|
5040
5060
|
return new DOMParser().parseFromString(e, "image/svg+xml").documentElement;
|
@@ -5055,7 +5075,7 @@ var Ie = /*#__PURE__*/function () {
|
|
5055
5075
|
}, {
|
5056
5076
|
key: "createIconElement",
|
5057
5077
|
value: function createIconElement(e, t) {
|
5058
|
-
var i =
|
5078
|
+
var i = Y.createSVGElement(e);
|
5059
5079
|
return i.id = t, i.classList.add("visibility-icon"), i;
|
5060
5080
|
}
|
5061
5081
|
// prettier-ignore
|
@@ -5433,7 +5453,7 @@ var On = {
|
|
5433
5453
|
var t;
|
5434
5454
|
((t = this._webModel.introMessage) == null ? void 0 : t.autoScroll) !== !1 && setTimeout(function () {
|
5435
5455
|
var i, n;
|
5436
|
-
(i = _this13._messages) != null && i.elementRef &&
|
5456
|
+
(i = _this13._messages) != null && i.elementRef && U.scrollToTop((n = _this13._messages) == null ? void 0 : n.elementRef);
|
5437
5457
|
}, e);
|
5438
5458
|
}
|
5439
5459
|
// prettier-ignore
|
@@ -5565,7 +5585,7 @@ var On = {
|
|
5565
5585
|
sendUpdate: !1
|
5566
5586
|
}), i && (setTimeout(function () {
|
5567
5587
|
var p;
|
5568
|
-
return
|
5588
|
+
return U.scrollToBottom((p = _this14._messages) == null ? void 0 : p.elementRef);
|
5569
5589
|
}), i = !1);
|
5570
5590
|
};
|
5571
5591
|
w.chat.setInitProgressCallback(n);
|
@@ -5681,7 +5701,7 @@ var On = {
|
|
5681
5701
|
this.streamHandlers.abortStream.abort = function () {
|
5682
5702
|
i.interruptGenerate();
|
5683
5703
|
}, this.streamHandlers.onOpen();
|
5684
|
-
n = new
|
5704
|
+
n = new pe(e);
|
5685
5705
|
_context31.next = 4;
|
5686
5706
|
return i.generate(t, /*#__PURE__*/function () {
|
5687
5707
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(r, o) {
|
@@ -5958,7 +5978,7 @@ var ii = /*#__PURE__*/function () {
|
|
5958
5978
|
}
|
5959
5979
|
}]);
|
5960
5980
|
}();
|
5961
|
-
var St = /*#__PURE__*/function (
|
5981
|
+
var St = /*#__PURE__*/function (_H) {
|
5962
5982
|
// prettier-ignore
|
5963
5983
|
function St(e, t, i, n, r, o) {
|
5964
5984
|
var _this16;
|
@@ -5967,7 +5987,7 @@ var St = /*#__PURE__*/function (_U) {
|
|
5967
5987
|
return _this16;
|
5968
5988
|
}
|
5969
5989
|
// prettier-ignore
|
5970
|
-
_inherits(St,
|
5990
|
+
_inherits(St, _H);
|
5971
5991
|
return _createClass(St, [{
|
5972
5992
|
key: "preprocessBody",
|
5973
5993
|
value: function preprocessBody(e, t, i) {
|
@@ -6006,7 +6026,7 @@ var St = /*#__PURE__*/function (_U) {
|
|
6006
6026
|
return callServiceAPI;
|
6007
6027
|
}()
|
6008
6028
|
}]);
|
6009
|
-
}(
|
6029
|
+
}(H);
|
6010
6030
|
St.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
6011
6031
|
var we = St;
|
6012
6032
|
var Dt = /*#__PURE__*/function (_we) {
|
@@ -6162,11 +6182,11 @@ var po = /*#__PURE__*/function (_Dt2) {
|
|
6162
6182
|
}]);
|
6163
6183
|
}(Dt);
|
6164
6184
|
var Ft = "data:image/png;base64,";
|
6165
|
-
var
|
6166
|
-
function
|
6167
|
-
_classCallCheck(this,
|
6185
|
+
var ge = /*#__PURE__*/function () {
|
6186
|
+
function ge() {
|
6187
|
+
_classCallCheck(this, ge);
|
6168
6188
|
}
|
6169
|
-
return _createClass(
|
6189
|
+
return _createClass(ge, null, [{
|
6170
6190
|
key: "buildHeaders",
|
6171
6191
|
value: function buildHeaders(e) {
|
6172
6192
|
return {
|
@@ -6186,12 +6206,12 @@ var me = /*#__PURE__*/function () {
|
|
6186
6206
|
return {
|
6187
6207
|
url: "https://api.stability.ai/v1/engines/list",
|
6188
6208
|
method: "GET",
|
6189
|
-
handleVerificationResult:
|
6209
|
+
handleVerificationResult: ge.handleVerificationResult
|
6190
6210
|
};
|
6191
6211
|
}
|
6192
6212
|
}]);
|
6193
6213
|
}();
|
6194
|
-
var _i = /*#__PURE__*/function (
|
6214
|
+
var _i = /*#__PURE__*/function (_H2) {
|
6195
6215
|
// prettier-ignore
|
6196
6216
|
function _i(e, t, i, n, r) {
|
6197
6217
|
var _this18;
|
@@ -6199,9 +6219,9 @@ var _i = /*#__PURE__*/function (_U2) {
|
|
6199
6219
|
_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_"];
|
6200
6220
|
return _this18;
|
6201
6221
|
}
|
6202
|
-
_inherits(_i,
|
6222
|
+
_inherits(_i, _H2);
|
6203
6223
|
return _createClass(_i);
|
6204
|
-
}(
|
6224
|
+
}(H);
|
6205
6225
|
var ni = /*#__PURE__*/function (_i10) {
|
6206
6226
|
function ni(e) {
|
6207
6227
|
var _this19;
|
@@ -6217,7 +6237,7 @@ var ni = /*#__PURE__*/function (_i10) {
|
|
6217
6237
|
}
|
6218
6238
|
}
|
6219
6239
|
};
|
6220
|
-
_this19 = _callSuper(this, ni, [e,
|
6240
|
+
_this19 = _callSuper(this, ni, [e, ge.buildKeyVerificationDetails(), ge.buildHeaders, i, n]), _this19.url = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale", _this19.textInputPlaceholderText = "Describe image changes", _this19.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Upscale</b></div>\n <p>Upload an image to generate a new one with higher resolution.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
6221
6241
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageUpscale;
|
6222
6242
|
_typeof(r) == "object" && (r.engine_id && (_this19.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")), ni.cleanConfig(r), Object.assign(_this19.rawBody, r)), _this19.canSendMessage = ni.canSendFileMessage;
|
6223
6243
|
return _this19;
|
@@ -6324,7 +6344,7 @@ var si = /*#__PURE__*/function (_i11) {
|
|
6324
6344
|
}
|
6325
6345
|
}
|
6326
6346
|
};
|
6327
|
-
_this20 = _callSuper(this, si, [e,
|
6347
|
+
_this20 = _callSuper(this, si, [e, ge.buildKeyVerificationDetails(), ge.buildHeaders, i, n]), _this20.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this20._maskSource = "MASK_IMAGE_WHITE", _this20.textInputPlaceholderText = "Describe image changes", _this20.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Masking</b></div>\n <p>Upload an image, its mask image to create a new one based on the changes you have described for the mask area.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
6328
6348
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
|
6329
6349
|
_typeof(r) == "object" && (r.engine_id && (_this20.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this20._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this20._maskSource = r.mask_source), si.cleanConfig(r), Object.assign(_this20.rawBody, r)), _this20.canSendMessage = si.canSendFileTextMessage;
|
6330
6350
|
return _this20;
|
@@ -6693,7 +6713,7 @@ var ri = /*#__PURE__*/function (_i12) {
|
|
6693
6713
|
}
|
6694
6714
|
}
|
6695
6715
|
};
|
6696
|
-
_this23 = _callSuper(this, ri, [e,
|
6716
|
+
_this23 = _callSuper(this, ri, [e, ge.buildKeyVerificationDetails(), ge.buildHeaders, i, n]), _this23.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this23.textInputPlaceholderText = "Describe image changes", _this23.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Image to Image</b></div>\n <p>Upload an image to create a new one with the changes you have described.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
6697
6717
|
var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
|
6698
6718
|
_typeof(r) == "object" && (r.engine_id && (_this23.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this23._imageWeight = r.weight), ri.cleanConfig(r), Object.assign(_this23.rawBody, r)), _this23.canSendMessage = ri.canSendFileTextMessage;
|
6699
6719
|
return _this23;
|
@@ -6831,7 +6851,7 @@ var oi = /*#__PURE__*/function (_i13) {
|
|
6831
6851
|
var r;
|
6832
6852
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6833
6853
|
i = t.stabilityAI;
|
6834
|
-
_this24 = _callSuper(this, oi, [e,
|
6854
|
+
_this24 = _callSuper(this, oi, [e, ge.buildKeyVerificationDetails(), ge.buildHeaders, i]), _this24.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/text-to-image", _this24.textInputPlaceholderText = "Describe an image", _this24.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Text to Image</b></div>\n <p>Insert text to generate an image.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
6835
6855
|
var n = (r = t.stabilityAI) == null ? void 0 : r.textToImage;
|
6836
6856
|
_typeof(n) == "object" && (n.engine_id && (_this24.url = "https://api.stability.ai/v1/generation/".concat(n.engine_id, "/text-to-image")), n.weight !== void 0 && n.weight !== null && (_this24._imageWeight = n.weight), oi.cleanConfig(n), Object.assign(_this24.rawBody, n)), _this24.canSendMessage = oi.canSendTextMessage;
|
6837
6857
|
return _this24;
|
@@ -6992,16 +7012,16 @@ var ai = /*#__PURE__*/function () {
|
|
6992
7012
|
}
|
6993
7013
|
}]);
|
6994
7014
|
}();
|
6995
|
-
var un = /*#__PURE__*/function (
|
7015
|
+
var un = /*#__PURE__*/function (_H3) {
|
6996
7016
|
function un(e, t, i, n, r) {
|
6997
7017
|
var _this26;
|
6998
7018
|
_classCallCheck(this, un);
|
6999
7019
|
_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);
|
7000
7020
|
return _this26;
|
7001
7021
|
}
|
7002
|
-
_inherits(un,
|
7022
|
+
_inherits(un, _H3);
|
7003
7023
|
return _createClass(un);
|
7004
|
-
}(
|
7024
|
+
}(H);
|
7005
7025
|
var _o = /*#__PURE__*/function (_un) {
|
7006
7026
|
function _o(e) {
|
7007
7027
|
_classCallCheck(this, _o);
|
@@ -7218,7 +7238,7 @@ var P = /*#__PURE__*/function () {
|
|
7218
7238
|
}()
|
7219
7239
|
}]);
|
7220
7240
|
}();
|
7221
|
-
var nt = /*#__PURE__*/function (
|
7241
|
+
var nt = /*#__PURE__*/function (_H4) {
|
7222
7242
|
function nt(e) {
|
7223
7243
|
var _o$model, _a$voice;
|
7224
7244
|
var _this27;
|
@@ -7231,7 +7251,7 @@ var nt = /*#__PURE__*/function (_U4) {
|
|
7231
7251
|
_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";
|
7232
7252
|
return _this27;
|
7233
7253
|
}
|
7234
|
-
_inherits(nt,
|
7254
|
+
_inherits(nt, _H4);
|
7235
7255
|
return _createClass(nt, [{
|
7236
7256
|
key: "preprocessBody",
|
7237
7257
|
value: function preprocessBody(e, t) {
|
@@ -7312,29 +7332,29 @@ var nt = /*#__PURE__*/function (_U4) {
|
|
7312
7332
|
return extractResultData;
|
7313
7333
|
}()
|
7314
7334
|
}]);
|
7315
|
-
}(
|
7335
|
+
}(H);
|
7316
7336
|
nt.DEFAULT_MODEL = "tts-1", nt.DEFAULT_VOIDE = "alloy";
|
7317
7337
|
var Yi = nt;
|
7318
|
-
var
|
7319
|
-
function
|
7338
|
+
var le = /*#__PURE__*/function (_H5) {
|
7339
|
+
function le(e) {
|
7320
7340
|
var _o$model2;
|
7321
7341
|
var _this28;
|
7322
|
-
_classCallCheck(this,
|
7342
|
+
_classCallCheck(this, le);
|
7323
7343
|
var r, o;
|
7324
7344
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
7325
7345
|
i = t == null ? void 0 : t.openAI;
|
7326
|
-
_this28 = _callSuper(this,
|
7346
|
+
_this28 = _callSuper(this, le, [e, P.buildKeyVerificationDetails(), P.buildHeaders, i, {
|
7327
7347
|
audio: {}
|
7328
|
-
}]), _this28.insertKeyPlaceholderText = "OpenAI API Key", _this28.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this28.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Speech To Text</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/guides/speech-to-text\">here</a> for more info.</p>", _this28.url = "", _this28.permittedErrorPrefixes = ["Invalid"], _this28.textInputPlaceholderText = "Upload an audio file", _this28._service_url =
|
7348
|
+
}]), _this28.insertKeyPlaceholderText = "OpenAI API Key", _this28.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this28.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Speech To Text</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/guides/speech-to-text\">here</a> for more info.</p>", _this28.url = "", _this28.permittedErrorPrefixes = ["Invalid"], _this28.textInputPlaceholderText = "Upload an audio file", _this28._service_url = le.AUDIO_TRANSCRIPTIONS_URL;
|
7329
7349
|
var n = (r = t == null ? void 0 : t.openAI) == null ? void 0 : r.audio;
|
7330
|
-
_typeof(n) == "object" && (_this28.processConfig(n),
|
7350
|
+
_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;
|
7331
7351
|
return _this28;
|
7332
7352
|
}
|
7333
|
-
_inherits(
|
7334
|
-
return _createClass(
|
7353
|
+
_inherits(le, _H5);
|
7354
|
+
return _createClass(le, [{
|
7335
7355
|
key: "processConfig",
|
7336
7356
|
value: function processConfig(e) {
|
7337
|
-
e != null && e.type && e.type === "translation" && (this._service_url =
|
7357
|
+
e != null && e.type && e.type === "translation" && (this._service_url = le.AUDIO_TRANSLATIONS_URL, delete e.language);
|
7338
7358
|
}
|
7339
7359
|
}, {
|
7340
7360
|
key: "preprocessBody",
|
@@ -7366,7 +7386,7 @@ var ae = /*#__PURE__*/function (_U5) {
|
|
7366
7386
|
throw new Error("No file was added");
|
7367
7387
|
case 4:
|
7368
7388
|
this.url = this.connectSettings.url || this._service_url;
|
7369
|
-
n = this.preprocessBody(this.rawBody, t), r =
|
7389
|
+
n = this.preprocessBody(this.rawBody, t), r = le.createFormDataBody(n, i[0]);
|
7370
7390
|
v.tempRemoveContentHeader(this.connectSettings, T.request.bind(this, this, r, e), !1);
|
7371
7391
|
case 7:
|
7372
7392
|
case "end":
|
@@ -7425,14 +7445,14 @@ var ae = /*#__PURE__*/function (_U5) {
|
|
7425
7445
|
}), i;
|
7426
7446
|
}
|
7427
7447
|
}]);
|
7428
|
-
}(
|
7429
|
-
|
7430
|
-
var Qi =
|
7431
|
-
var
|
7432
|
-
function
|
7433
|
-
_classCallCheck(this,
|
7448
|
+
}(H);
|
7449
|
+
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
|
+
var Qi = le;
|
7451
|
+
var se = /*#__PURE__*/function () {
|
7452
|
+
function se() {
|
7453
|
+
_classCallCheck(this, se);
|
7434
7454
|
}
|
7435
|
-
return _createClass(
|
7455
|
+
return _createClass(se, null, [{
|
7436
7456
|
key: "buildTextToSpeechHeaders",
|
7437
7457
|
value: function buildTextToSpeechHeaders(e, t) {
|
7438
7458
|
return {
|
@@ -7466,7 +7486,7 @@ var ne = /*#__PURE__*/function () {
|
|
7466
7486
|
"Ocp-Apim-Subscription-Key": "".concat(t)
|
7467
7487
|
};
|
7468
7488
|
},
|
7469
|
-
handleVerificationResult:
|
7489
|
+
handleVerificationResult: se.handleSpeechVerificationResult
|
7470
7490
|
};
|
7471
7491
|
}
|
7472
7492
|
}, {
|
@@ -7495,7 +7515,7 @@ var ne = /*#__PURE__*/function () {
|
|
7495
7515
|
"Ocp-Apim-Subscription-Key": "".concat(t)
|
7496
7516
|
};
|
7497
7517
|
},
|
7498
|
-
handleVerificationResult:
|
7518
|
+
handleVerificationResult: se.handleLanguageVerificationResult
|
7499
7519
|
};
|
7500
7520
|
}
|
7501
7521
|
// prettier-ignore
|
@@ -7513,9 +7533,9 @@ var ne = /*#__PURE__*/function () {
|
|
7513
7533
|
url: "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=es",
|
7514
7534
|
method: "POST",
|
7515
7535
|
createHeaders: function createHeaders(t) {
|
7516
|
-
return
|
7536
|
+
return se.buildTranslationHeaders(e, t);
|
7517
7537
|
},
|
7518
|
-
handleVerificationResult:
|
7538
|
+
handleVerificationResult: se.handleTranslationVerificationResult
|
7519
7539
|
};
|
7520
7540
|
}
|
7521
7541
|
}, {
|
@@ -7529,19 +7549,19 @@ var ne = /*#__PURE__*/function () {
|
|
7529
7549
|
}
|
7530
7550
|
}]);
|
7531
7551
|
}();
|
7532
|
-
var wo = /*#__PURE__*/function (
|
7552
|
+
var wo = /*#__PURE__*/function (_H6) {
|
7533
7553
|
// prettier-ignore
|
7534
7554
|
function wo(e, t, i, n, r) {
|
7535
7555
|
var _this29;
|
7536
7556
|
_classCallCheck(this, wo);
|
7537
|
-
_this29 = _callSuper(this, wo, [e,
|
7557
|
+
_this29 = _callSuper(this, wo, [e, se.buildLanguageKeyVerificationDetails(i), t, n, r]), _this29.insertKeyPlaceholderText = "Azure Language Subscription Key", _this29.keyHelpUrl =
|
7538
7558
|
// eslint-disable-next-line max-len
|
7539
7559
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this29.permittedErrorPrefixes = ["Access"];
|
7540
7560
|
return _this29;
|
7541
7561
|
}
|
7542
|
-
_inherits(wo,
|
7562
|
+
_inherits(wo, _H6);
|
7543
7563
|
return _createClass(wo);
|
7544
|
-
}(
|
7564
|
+
}(H);
|
7545
7565
|
var To = /*#__PURE__*/function (_wo) {
|
7546
7566
|
function To(e) {
|
7547
7567
|
var _a$language;
|
@@ -7550,7 +7570,7 @@ var To = /*#__PURE__*/function (_wo) {
|
|
7550
7570
|
var n, r, o, a;
|
7551
7571
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.summarization,
|
7552
7572
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
7553
|
-
_this30 = _callSuper(this, To, [e,
|
7573
|
+
_this30 = _callSuper(this, To, [e, se.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");
|
7554
7574
|
return _this30;
|
7555
7575
|
}
|
7556
7576
|
_inherits(To, _wo);
|
@@ -7800,7 +7820,7 @@ var vt = /*#__PURE__*/function () {
|
|
7800
7820
|
}
|
7801
7821
|
}]);
|
7802
7822
|
}();
|
7803
|
-
var fn = /*#__PURE__*/function (
|
7823
|
+
var fn = /*#__PURE__*/function (_H7) {
|
7804
7824
|
function fn(e) {
|
7805
7825
|
var _this31;
|
7806
7826
|
_classCallCheck(this, fn);
|
@@ -7811,7 +7831,7 @@ var fn = /*#__PURE__*/function (_U7) {
|
|
7811
7831
|
}]), _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;
|
7812
7832
|
return _this31;
|
7813
7833
|
}
|
7814
|
-
_inherits(fn,
|
7834
|
+
_inherits(fn, _H7);
|
7815
7835
|
return _createClass(fn, [{
|
7816
7836
|
key: "callServiceAPI",
|
7817
7837
|
value: function () {
|
@@ -7883,20 +7903,20 @@ var fn = /*#__PURE__*/function (_U7) {
|
|
7883
7903
|
return !!(t != null && t[0]);
|
7884
7904
|
}
|
7885
7905
|
}]);
|
7886
|
-
}(
|
7887
|
-
var ls = /*#__PURE__*/function (
|
7906
|
+
}(H);
|
7907
|
+
var ls = /*#__PURE__*/function (_H8) {
|
7888
7908
|
// prettier-ignore
|
7889
7909
|
function ls(e, t, i, n, r) {
|
7890
7910
|
var _this32;
|
7891
7911
|
_classCallCheck(this, ls);
|
7892
|
-
_this32 = _callSuper(this, ls, [e,
|
7912
|
+
_this32 = _callSuper(this, ls, [e, se.buildSpeechKeyVerificationDetails(i), t, n, r]), _this32.insertKeyPlaceholderText = "Azure Speech Subscription Key", _this32.keyHelpUrl =
|
7893
7913
|
// eslint-disable-next-line max-len
|
7894
7914
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal";
|
7895
7915
|
return _this32;
|
7896
7916
|
}
|
7897
|
-
_inherits(ls,
|
7917
|
+
_inherits(ls, _H8);
|
7898
7918
|
return _createClass(ls);
|
7899
|
-
}(
|
7919
|
+
}(H);
|
7900
7920
|
var vi = /*#__PURE__*/function (_ls) {
|
7901
7921
|
// prettier-ignore
|
7902
7922
|
function vi(e) {
|
@@ -7906,7 +7926,7 @@ var vi = /*#__PURE__*/function (_ls) {
|
|
7906
7926
|
var n, r, o, a, l, c;
|
7907
7927
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.textToSpeech,
|
7908
7928
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
7909
|
-
_this33 = _callSuper(this, vi, [e,
|
7929
|
+
_this33 = _callSuper(this, vi, [e, se.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");
|
7910
7930
|
return _this33;
|
7911
7931
|
}
|
7912
7932
|
_inherits(vi, _ls);
|
@@ -7992,7 +8012,7 @@ var wt = /*#__PURE__*/function (_ls2) {
|
|
7992
8012
|
}
|
7993
8013
|
}
|
7994
8014
|
};
|
7995
|
-
_this34 = _callSuper(this, wt, [e,
|
8015
|
+
_this34 = _callSuper(this, wt, [e, se.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;
|
7996
8016
|
var r = t.lang || "en-US";
|
7997
8017
|
_this34.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(r, "&format=detailed"), _this34.recordAudio = void 0;
|
7998
8018
|
return _this34;
|
@@ -8068,7 +8088,7 @@ wt.HELP_LINK =
|
|
8068
8088
|
// eslint-disable-next-line max-len
|
8069
8089
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
8070
8090
|
var tn = wt;
|
8071
|
-
var Co = /*#__PURE__*/function (
|
8091
|
+
var Co = /*#__PURE__*/function (_H9) {
|
8072
8092
|
// prettier-ignore
|
8073
8093
|
function Co(e) {
|
8074
8094
|
var _this35;
|
@@ -8076,12 +8096,12 @@ var Co = /*#__PURE__*/function (_U9) {
|
|
8076
8096
|
var n, r, o;
|
8077
8097
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.translation,
|
8078
8098
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
8079
|
-
_this35 = _callSuper(this, Co, [e,
|
8099
|
+
_this35 = _callSuper(this, Co, [e, se.buildTranslationKeyVerificationDetails(t.region), se.buildTranslationHeaders.bind({}, t == null ? void 0 : t.region), i]), _this35.insertKeyPlaceholderText = "Azure Translate Subscription Key", _this35.keyHelpUrl =
|
8080
8100
|
// eslint-disable-next-line max-len
|
8081
8101
|
"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");
|
8082
8102
|
return _this35;
|
8083
8103
|
}
|
8084
|
-
_inherits(Co,
|
8104
|
+
_inherits(Co, _H9);
|
8085
8105
|
return _createClass(Co, [{
|
8086
8106
|
key: "preprocessBody",
|
8087
8107
|
value: function preprocessBody(e) {
|
@@ -8146,7 +8166,7 @@ var Co = /*#__PURE__*/function (_U9) {
|
|
8146
8166
|
return extractResultData;
|
8147
8167
|
}()
|
8148
8168
|
}]);
|
8149
|
-
}(
|
8169
|
+
}(H);
|
8150
8170
|
var z = /*#__PURE__*/function () {
|
8151
8171
|
function z() {
|
8152
8172
|
_classCallCheck(this, z);
|
@@ -8268,6 +8288,7 @@ var z = /*#__PURE__*/function () {
|
|
8268
8288
|
var t = e.split("/");
|
8269
8289
|
return t[t.length - 1];
|
8270
8290
|
}
|
8291
|
+
// prettier-ignore
|
8271
8292
|
}, {
|
8272
8293
|
key: "getFileDetails",
|
8273
8294
|
value: function getFileDetails(e, t) {
|
@@ -8277,7 +8298,9 @@ var z = /*#__PURE__*/function () {
|
|
8277
8298
|
var o, a;
|
8278
8299
|
(a = (o = r.text) == null ? void 0 : o.annotations) == null || a.forEach(function (l) {
|
8279
8300
|
var c;
|
8280
|
-
l.text && l.text.startsWith("sandbox:") &&
|
8301
|
+
l.text && l.text.startsWith("sandbox:") && !B.isImageFile({
|
8302
|
+
src: l.text
|
8303
|
+
}) && (c = l.file_path) != null && c.file_id && i.push({
|
8281
8304
|
path: l.text,
|
8282
8305
|
fileId: l.file_path.file_id,
|
8283
8306
|
name: z.getFileName(l.text)
|
@@ -8360,7 +8383,7 @@ var z = /*#__PURE__*/function () {
|
|
8360
8383
|
var r = e.data[n];
|
8361
8384
|
if (r.role === "assistant") i.push(r);else break;
|
8362
8385
|
}
|
8363
|
-
return i;
|
8386
|
+
return i.reverse();
|
8364
8387
|
}
|
8365
8388
|
// test this using this prompt and it should give 2 text mesages and a file:
|
8366
8389
|
// "give example data for a csv and create a suitable bar chart"
|
@@ -8449,7 +8472,7 @@ var z = /*#__PURE__*/function () {
|
|
8449
8472
|
}()
|
8450
8473
|
}]);
|
8451
8474
|
}();
|
8452
|
-
var F = /*#__PURE__*/function (
|
8475
|
+
var F = /*#__PURE__*/function (_H10) {
|
8453
8476
|
function F(e) {
|
8454
8477
|
var _c$headers, _d$OpenAIBeta;
|
8455
8478
|
var _this36;
|
@@ -8475,7 +8498,7 @@ var F = /*#__PURE__*/function (_U10) {
|
|
8475
8498
|
(_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));
|
8476
8499
|
return _this36;
|
8477
8500
|
}
|
8478
|
-
_inherits(F,
|
8501
|
+
_inherits(F, _H10);
|
8479
8502
|
return _createClass(F, [{
|
8480
8503
|
key: "fetchHistoryFunc",
|
8481
8504
|
value: function () {
|
@@ -8767,7 +8790,7 @@ var F = /*#__PURE__*/function (_U10) {
|
|
8767
8790
|
value: function () {
|
8768
8791
|
var _extractPollResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee91(e) {
|
8769
8792
|
var _this38 = this;
|
8770
|
-
var r, t, i, o, _o$
|
8793
|
+
var r, t, i, o, _o$shift, a, l, n;
|
8771
8794
|
return _regeneratorRuntime().wrap(function _callee91$(_context91) {
|
8772
8795
|
while (1) switch (_context91.prev = _context91.next) {
|
8773
8796
|
case 0:
|
@@ -8788,9 +8811,9 @@ var F = /*#__PURE__*/function (_U10) {
|
|
8788
8811
|
return this.getThreadMessages(e.thread_id);
|
8789
8812
|
case 6:
|
8790
8813
|
o = _context91.sent;
|
8791
|
-
_o$
|
8792
|
-
a = _o$
|
8793
|
-
l = _o$
|
8814
|
+
_o$shift = o.shift();
|
8815
|
+
a = _o$shift.text;
|
8816
|
+
l = _o$shift.files;
|
8794
8817
|
return _context91.abrupt("return", (setTimeout(function () {
|
8795
8818
|
o.forEach(function (c) {
|
8796
8819
|
return _this38.deepChat.addMessage(c);
|
@@ -9032,13 +9055,13 @@ var F = /*#__PURE__*/function (_U10) {
|
|
9032
9055
|
return createStreamRun;
|
9033
9056
|
}()
|
9034
9057
|
}]);
|
9035
|
-
}(
|
9058
|
+
}(H);
|
9036
9059
|
F.THREAD_PREFIX = "https://api.openai.com/v1/threads", F.NEW_ASSISTANT_URL = "https://api.openai.com/v1/assistants", F.POLLING_TIMEOUT_MS = 800;
|
9037
9060
|
var nn = F;
|
9038
|
-
var
|
9039
|
-
function
|
9061
|
+
var ce = /*#__PURE__*/function (_H11) {
|
9062
|
+
function ce(e) {
|
9040
9063
|
var _this39;
|
9041
|
-
_classCallCheck(this,
|
9064
|
+
_classCallCheck(this, ce);
|
9042
9065
|
var o;
|
9043
9066
|
var t = e.directConnection,
|
9044
9067
|
i = t == null ? void 0 : t.openAI,
|
@@ -9050,7 +9073,7 @@ var le = /*#__PURE__*/function (_U11) {
|
|
9050
9073
|
}
|
9051
9074
|
}
|
9052
9075
|
};
|
9053
|
-
_this39 = _callSuper(this,
|
9076
|
+
_this39 = _callSuper(this, ce, [e, P.buildKeyVerificationDetails(), P.buildHeaders, i, n]), _this39.insertKeyPlaceholderText = "OpenAI API Key", _this39.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this39.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI DALL\xB7E</b></div>\n <p><b>Insert text</b> to generate an image.</p>\n <p><b>Upload 1</b> PNG image to generate its variation and optionally insert text to specify the change.</p>\n <p><b>Upload 2</b> PNG images where the second is a copy of the first with a transparent area where the edit should\n take place and text to specify the edit.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/images/introduction\">here</a> for more info.</p>", _this39.url = "", _this39.permittedErrorPrefixes = ["Incorrect", "Invalid input image"];
|
9054
9077
|
var r = (o = t == null ? void 0 : t.openAI) == null ? void 0 : o.images;
|
9055
9078
|
if (_this39.camera) {
|
9056
9079
|
var a = _typeof(r) == "object" && r.size ? Number.parseInt(r.size) : 1024;
|
@@ -9061,11 +9084,11 @@ var le = /*#__PURE__*/function (_U11) {
|
|
9061
9084
|
}
|
9062
9085
|
};
|
9063
9086
|
}
|
9064
|
-
_typeof(r) == "object" && Object.assign(_this39.rawBody, r), _this39.canSendMessage =
|
9087
|
+
_typeof(r) == "object" && Object.assign(_this39.rawBody, r), _this39.canSendMessage = ce.canFileSendMessage;
|
9065
9088
|
return _this39;
|
9066
9089
|
}
|
9067
|
-
_inherits(
|
9068
|
-
return _createClass(
|
9090
|
+
_inherits(ce, _H11);
|
9091
|
+
return _createClass(ce, [{
|
9069
9092
|
key: "preprocessBody",
|
9070
9093
|
value: function preprocessBody(e, t) {
|
9071
9094
|
var i = JSON.parse(JSON.stringify(e));
|
@@ -9079,10 +9102,10 @@ var le = /*#__PURE__*/function (_U11) {
|
|
9079
9102
|
var n;
|
9080
9103
|
var r = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim();
|
9081
9104
|
if (i[1] || r && r !== "") {
|
9082
|
-
this.url =
|
9105
|
+
this.url = ce.IMAGE_EDIT_URL;
|
9083
9106
|
var l = this.preprocessBody(this.rawBody, r);
|
9084
|
-
n =
|
9085
|
-
} else this.url =
|
9107
|
+
n = ce.createFormDataBody(l, i[0], i[1]);
|
9108
|
+
} else this.url = ce.IMAGE_VARIATIONS_URL, n = ce.createFormDataBody(this.rawBody, i[0]);
|
9086
9109
|
v.tempRemoveContentHeader(this.connectSettings, T.request.bind(this, this, n, e), !1);
|
9087
9110
|
}
|
9088
9111
|
}, {
|
@@ -9113,7 +9136,7 @@ var le = /*#__PURE__*/function (_U11) {
|
|
9113
9136
|
}
|
9114
9137
|
throw new Error("Request settings have not been set up");
|
9115
9138
|
case 8:
|
9116
|
-
this.url =
|
9139
|
+
this.url = ce.IMAGE_GENERATION_URL;
|
9117
9140
|
r = this.preprocessBody(this.rawBody, t[t.length - 1].text);
|
9118
9141
|
T.request(this, r, e);
|
9119
9142
|
case 11:
|
@@ -9184,10 +9207,10 @@ var le = /*#__PURE__*/function (_U11) {
|
|
9184
9207
|
}), n;
|
9185
9208
|
}
|
9186
9209
|
}]);
|
9187
|
-
}(
|
9188
|
-
|
9189
|
-
var sn =
|
9190
|
-
var yt = /*#__PURE__*/function (
|
9210
|
+
}(H);
|
9211
|
+
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
|
+
var sn = ce;
|
9213
|
+
var yt = /*#__PURE__*/function (_H12) {
|
9191
9214
|
function yt(e) {
|
9192
9215
|
var _this40$maxMessages, _l$model;
|
9193
9216
|
var _this40;
|
@@ -9206,7 +9229,7 @@ var yt = /*#__PURE__*/function (_U12) {
|
|
9206
9229
|
(_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";
|
9207
9230
|
return _this40;
|
9208
9231
|
}
|
9209
|
-
_inherits(yt,
|
9232
|
+
_inherits(yt, _H12);
|
9210
9233
|
return _createClass(yt, [{
|
9211
9234
|
key: "cleanConfig",
|
9212
9235
|
value: function cleanConfig(e) {
|
@@ -9460,7 +9483,7 @@ var yt = /*#__PURE__*/function (_U12) {
|
|
9460
9483
|
return e.text;
|
9461
9484
|
}
|
9462
9485
|
}]);
|
9463
|
-
}(
|
9486
|
+
}(H);
|
9464
9487
|
var ko = /*#__PURE__*/function (_un3) {
|
9465
9488
|
function ko(e) {
|
9466
9489
|
var _this42$maxMessages;
|
@@ -9575,7 +9598,7 @@ var li = /*#__PURE__*/function () {
|
|
9575
9598
|
}
|
9576
9599
|
}]);
|
9577
9600
|
}();
|
9578
|
-
var Ao = /*#__PURE__*/function (
|
9601
|
+
var Ao = /*#__PURE__*/function (_H13) {
|
9579
9602
|
function Ao(e) {
|
9580
9603
|
var _this43$maxMessages, _n$model;
|
9581
9604
|
var _this43;
|
@@ -9585,7 +9608,7 @@ var Ao = /*#__PURE__*/function (_U13) {
|
|
9585
9608
|
_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";
|
9586
9609
|
return _this43;
|
9587
9610
|
}
|
9588
|
-
_inherits(Ao,
|
9611
|
+
_inherits(Ao, _H13);
|
9589
9612
|
return _createClass(Ao, [{
|
9590
9613
|
key: "cleanConfig",
|
9591
9614
|
value: function cleanConfig(e) {
|
@@ -9661,7 +9684,7 @@ var Ao = /*#__PURE__*/function (_U13) {
|
|
9661
9684
|
return extractResultData;
|
9662
9685
|
}()
|
9663
9686
|
}]);
|
9664
|
-
}(
|
9687
|
+
}(H);
|
9665
9688
|
var Mo = /*#__PURE__*/function () {
|
9666
9689
|
function Mo() {
|
9667
9690
|
_classCallCheck(this, Mo);
|
@@ -9811,7 +9834,7 @@ var Ce = /*#__PURE__*/function () {
|
|
9811
9834
|
key: "createImage",
|
9812
9835
|
value: function createImage(e, t) {
|
9813
9836
|
var i = new Image();
|
9814
|
-
return i.src = e.src,
|
9837
|
+
return i.src = e.src, B.scrollDownOnImageLoad(i.src, t), B.processContent("image", i, i.src, e.name);
|
9815
9838
|
}
|
9816
9839
|
// WORK - image still does not scroll down when loaded
|
9817
9840
|
}, {
|
@@ -9823,7 +9846,7 @@ var Ce = /*#__PURE__*/function () {
|
|
9823
9846
|
while (1) switch (_context106.prev = _context106.next) {
|
9824
9847
|
case 0:
|
9825
9848
|
n = Ce.createImage(t, e.elementRef), r = e.createNewMessageElement("", i);
|
9826
|
-
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"),
|
9849
|
+
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"), B.addMessage(e, r, "image", i);
|
9827
9850
|
case 2:
|
9828
9851
|
case "end":
|
9829
9852
|
return _context106.stop();
|
@@ -9846,7 +9869,7 @@ var Ce = /*#__PURE__*/function () {
|
|
9846
9869
|
value: function addNewAudioMessage(e, t, i) {
|
9847
9870
|
var n = Ce.createAudioElement(t, i),
|
9848
9871
|
r = e.createNewMessageElement("", i);
|
9849
|
-
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"),
|
9872
|
+
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"), B.addMessage(e, r, "audio", i);
|
9850
9873
|
}
|
9851
9874
|
}, {
|
9852
9875
|
key: "createAnyFile",
|
@@ -9855,24 +9878,24 @@ var Ce = /*#__PURE__*/function () {
|
|
9855
9878
|
t.classList.add("any-file-message-contents");
|
9856
9879
|
var i = document.createElement("div");
|
9857
9880
|
i.classList.add("any-file-message-icon-container");
|
9858
|
-
var n =
|
9881
|
+
var n = Y.createSVGElement(Io);
|
9859
9882
|
n.classList.add("any-file-message-icon"), i.appendChild(n);
|
9860
9883
|
var r = document.createElement("div");
|
9861
|
-
return r.classList.add("any-file-message-text"), r.textContent = e.name ||
|
9884
|
+
return r.classList.add("any-file-message-text"), r.textContent = e.name || B.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), B.processContent("any", t, e.src, r.textContent);
|
9862
9885
|
}
|
9863
9886
|
}, {
|
9864
9887
|
key: "addNewAnyFileMessage",
|
9865
9888
|
value: function addNewAnyFileMessage(e, t, i) {
|
9866
9889
|
var n = e.createNewMessageElement("", i),
|
9867
9890
|
r = Ce.createAnyFile(t);
|
9868
|
-
n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r),
|
9891
|
+
n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r), B.addMessage(e, n, "file", i);
|
9869
9892
|
}
|
9870
9893
|
// no overwrite previous message logic as it is complex to track which files are to be overwritten
|
9871
9894
|
}, {
|
9872
9895
|
key: "addMessages",
|
9873
9896
|
value: function addMessages(e, t, i) {
|
9874
9897
|
t.forEach(function (n) {
|
9875
|
-
n.ref && (n =
|
9898
|
+
n.ref && (n = B.removeFileRef(n)), B.isAudioFile(n) ? Ce.addNewAudioMessage(e, n, i) : B.isImageFile(n) ? Ce.addNewImageMessage(e, n, i) : Ce.addNewAnyFileMessage(e, n, i);
|
9876
9899
|
});
|
9877
9900
|
}
|
9878
9901
|
}]);
|
@@ -9888,7 +9911,7 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
9888
9911
|
o = t.demo;
|
9889
9912
|
_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 () {
|
9890
9913
|
return JSON.parse(JSON.stringify(_this44.messages));
|
9891
|
-
}, e.clearMessages = _this44.clearMessages.bind(_this44, t), e.refreshMessages = _this44.refreshTextMessages.bind(_this44), e.scrollToBottom =
|
9914
|
+
}, e.clearMessages = _this44.clearMessages.bind(_this44, t), e.refreshMessages = _this44.refreshTextMessages.bind(_this44), e.scrollToBottom = U.scrollToBottom.bind(_this44, _this44.elementRef), e.addMessage = function (c, d) {
|
9892
9915
|
_this44.addAnyMessage(_objectSpread(_objectSpread({}, c), {}, {
|
9893
9916
|
sendUpdate: !!d
|
9894
9917
|
}), !d);
|
@@ -9936,11 +9959,11 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
9936
9959
|
key: "populateHistory",
|
9937
9960
|
value: function populateHistory(e) {
|
9938
9961
|
var _this45 = this;
|
9939
|
-
var t = e.history ||
|
9962
|
+
var t = e.history || ue.processHistory(e);
|
9940
9963
|
t && (t.forEach(function (i) {
|
9941
|
-
|
9964
|
+
ue.processHistoryFile(i), _this45.addNewMessage(i, !0);
|
9942
9965
|
}), setTimeout(function () {
|
9943
|
-
return
|
9966
|
+
return U.scrollToBottom(_this45.elementRef);
|
9944
9967
|
}, 0));
|
9945
9968
|
}
|
9946
9969
|
}, {
|
@@ -9958,7 +9981,7 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
9958
9981
|
return _this46.addAnyMessage(i, !0);
|
9959
9982
|
});
|
9960
9983
|
setTimeout(function () {
|
9961
|
-
return
|
9984
|
+
return U.scrollToBottom(_this46.elementRef);
|
9962
9985
|
}, 0);
|
9963
9986
|
case 4:
|
9964
9987
|
case "end":
|
@@ -10010,7 +10033,7 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
10010
10033
|
value: function removeMessageOnError() {
|
10011
10034
|
var e = this.messageElementRefs[this.messageElementRefs.length - 1],
|
10012
10035
|
t = e == null ? void 0 : e.bubbleElement;
|
10013
|
-
(t != null && t.classList.contains(
|
10036
|
+
(t != null && t.classList.contains(pe.MESSAGE_CLASS) && t.textContent === "" || ke.isTemporaryElement(e)) && this.removeLastMessage();
|
10014
10037
|
}
|
10015
10038
|
// prettier-ignore
|
10016
10039
|
}, {
|
@@ -10024,8 +10047,8 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
10024
10047
|
r.classList.add("error-message-text");
|
10025
10048
|
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.";
|
10026
10049
|
this.renderText(r, o);
|
10027
|
-
var a =
|
10028
|
-
|
10050
|
+
var a = j.extractParticularSharedStyles(["fontSize", "fontFamily"], (d = this.messageStyles) == null ? void 0 : d["default"]);
|
10051
|
+
j.applyCustomStylesToElements(i, !1, a), j.applyCustomStylesToElements(i, !1, (h = this.messageStyles) == null ? void 0 : h.error), this.elementRef.appendChild(n), U.scrollToBottom(this.elementRef), this.textToSpeech && rt.speak(o, this.textToSpeech), (u = this._onError) == null || u.call(this, o);
|
10029
10052
|
}
|
10030
10053
|
}, {
|
10031
10054
|
key: "getPermittedMessage",
|
@@ -10056,12 +10079,12 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
10056
10079
|
i = e.bubbleElement;
|
10057
10080
|
i.classList.add("loading-message-text");
|
10058
10081
|
var n = document.createElement("div");
|
10059
|
-
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),
|
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), U.scrollToBottom(this.elementRef);
|
10060
10083
|
}
|
10061
10084
|
}, {
|
10062
10085
|
key: "populateIntroPanel",
|
10063
10086
|
value: function populateIntroPanel(e, t, i) {
|
10064
|
-
(e || t) && (this._introPanel = new ci(e, t, i), this._introPanel._elementRef && (
|
10087
|
+
(e || t) && (this._introPanel = new ci(e, t, i), this._introPanel._elementRef && (X.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
|
10065
10088
|
}
|
10066
10089
|
}, {
|
10067
10090
|
key: "addMultipleFiles",
|
@@ -10073,7 +10096,7 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
10073
10096
|
return _context108.abrupt("return", Promise.all((e || []).map(function (t) {
|
10074
10097
|
return new Promise(function (i) {
|
10075
10098
|
if (!t.type || t.type === "any") {
|
10076
|
-
var n = t.file.name ||
|
10099
|
+
var n = t.file.name || B.DEFAULT_FILE_NAME;
|
10077
10100
|
i({
|
10078
10101
|
name: n,
|
10079
10102
|
type: "any",
|
@@ -10109,7 +10132,7 @@ var ke = /*#__PURE__*/function (_ot) {
|
|
10109
10132
|
var i = [];
|
10110
10133
|
this.messageElementRefs.forEach(function (o) {
|
10111
10134
|
var a = o.bubbleElement.classList;
|
10112
|
-
a.contains("loading-message-text") || a.contains(
|
10135
|
+
a.contains("loading-message-text") || a.contains(pe.MESSAGE_CLASS) ? i.push(o) : o.outerContainer.remove();
|
10113
10136
|
}), Array.from(this.elementRef.children).forEach(function (o) {
|
10114
10137
|
var l;
|
10115
10138
|
var a = (l = o.children[0]) == null ? void 0 : l.children[0];
|
@@ -10200,11 +10223,11 @@ var ht = /*#__PURE__*/function () {
|
|
10200
10223
|
}]);
|
10201
10224
|
}();
|
10202
10225
|
var Nn = ["camera", "gifs", "images", "audio", "mixedFiles", "submit", "microphone"];
|
10203
|
-
var
|
10204
|
-
function
|
10205
|
-
_classCallCheck(this,
|
10226
|
+
var Z = /*#__PURE__*/function () {
|
10227
|
+
function Z() {
|
10228
|
+
_classCallCheck(this, Z);
|
10206
10229
|
}
|
10207
|
-
return _createClass(
|
10230
|
+
return _createClass(Z, null, [{
|
10208
10231
|
key: "createTextElement",
|
10209
10232
|
value: function createTextElement(e) {
|
10210
10233
|
var t = document.createElement("div");
|
@@ -10213,15 +10236,15 @@ var X = /*#__PURE__*/function () {
|
|
10213
10236
|
}, {
|
10214
10237
|
key: "createElement",
|
10215
10238
|
value: function createElement(e, t) {
|
10216
|
-
return t ?
|
10239
|
+
return t ? Z.createTextElement(e) : Y.createSVGElement(e);
|
10217
10240
|
}
|
10218
10241
|
}, {
|
10219
10242
|
key: "createCustomElement",
|
10220
10243
|
value: function createCustomElement(e, t) {
|
10221
10244
|
var n, r, o, a;
|
10222
10245
|
var i = t == null ? void 0 : t[e];
|
10223
|
-
if ((n = i == null ? void 0 : i.text) != null && n.content) return
|
10224
|
-
if ((o = i == null ? void 0 : i.svg) != null && o.content) return
|
10246
|
+
if ((n = i == null ? void 0 : i.text) != null && n.content) return Z.createElement((r = i == null ? void 0 : i.text) == null ? void 0 : r.content, !0);
|
10247
|
+
if ((o = i == null ? void 0 : i.svg) != null && o.content) return Z.createElement((a = i == null ? void 0 : i.svg) == null ? void 0 : a.content, !1);
|
10225
10248
|
}
|
10226
10249
|
}, {
|
10227
10250
|
key: "processElement",
|
@@ -10234,16 +10257,16 @@ var X = /*#__PURE__*/function () {
|
|
10234
10257
|
key: "createSpecificStateElement",
|
10235
10258
|
value: function createSpecificStateElement(e, t, i) {
|
10236
10259
|
var n;
|
10237
|
-
return i && (n =
|
10260
|
+
return i && (n = Z.createCustomElement(t, i)), Z.processElement(e, n), n;
|
10238
10261
|
}
|
10239
10262
|
}]);
|
10240
10263
|
}();
|
10241
10264
|
var Lo = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16 0c-8.836 0-16 7.163-16 16s7.163 16 16 16c8.837 0 16-7.163 16-16s-7.163-16-16-16zM16 30.032c-7.72 0-14-6.312-14-14.032s6.28-14 14-14 14 6.28 14 14-6.28 14.032-14 14.032zM23 15h-6v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1v6h-6c-0.552 0-1 0.448-1 1s0.448 1 1 1h6v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6h6c0.552 0 1-0.448 1-1s-0.448-1-1-1z\"></path>\n</svg>";
|
10242
|
-
var
|
10243
|
-
function
|
10244
|
-
_classCallCheck(this,
|
10265
|
+
var he = /*#__PURE__*/function () {
|
10266
|
+
function he() {
|
10267
|
+
_classCallCheck(this, he);
|
10245
10268
|
}
|
10246
|
-
return _createClass(
|
10269
|
+
return _createClass(he, null, [{
|
10247
10270
|
key: "unsetAllCSS",
|
10248
10271
|
value: function unsetAllCSS(e, t) {
|
10249
10272
|
var i, n;
|
@@ -10264,7 +10287,7 @@ var de = /*#__PURE__*/function () {
|
|
10264
10287
|
}, {
|
10265
10288
|
key: "setElementCssUpToState",
|
10266
10289
|
value: function setElementCssUpToState(e, t, i) {
|
10267
|
-
|
10290
|
+
he.setElementsCSS(e, t, "default"), i !== "default" && (he.setElementsCSS(e, t, "hover"), i !== "hover" && he.setElementsCSS(e, t, "click"));
|
10268
10291
|
}
|
10269
10292
|
}]);
|
10270
10293
|
}();
|
@@ -10278,22 +10301,22 @@ var Bt = /*#__PURE__*/function () {
|
|
10278
10301
|
return _createClass(Bt, [{
|
10279
10302
|
key: "buttonMouseLeave",
|
10280
10303
|
value: function buttonMouseLeave(e) {
|
10281
|
-
this._mouseState.state = "default", e && (
|
10304
|
+
this._mouseState.state = "default", e && (he.unsetAllCSS(this.elementRef, e), he.setElementsCSS(this.elementRef, e, "default"));
|
10282
10305
|
}
|
10283
10306
|
}, {
|
10284
10307
|
key: "buttonMouseEnter",
|
10285
10308
|
value: function buttonMouseEnter(e) {
|
10286
|
-
this._mouseState.state = "hover", e &&
|
10309
|
+
this._mouseState.state = "hover", e && he.setElementsCSS(this.elementRef, e, "hover");
|
10287
10310
|
}
|
10288
10311
|
}, {
|
10289
10312
|
key: "buttonMouseUp",
|
10290
10313
|
value: function buttonMouseUp(e) {
|
10291
|
-
e &&
|
10314
|
+
e && he.unsetActionCSS(this.elementRef, e), this.buttonMouseEnter(e);
|
10292
10315
|
}
|
10293
10316
|
}, {
|
10294
10317
|
key: "buttonMouseDown",
|
10295
10318
|
value: function buttonMouseDown(e) {
|
10296
|
-
this._mouseState.state = "click", e &&
|
10319
|
+
this._mouseState.state = "click", e && he.setElementsCSS(this.elementRef, e, "click");
|
10297
10320
|
}
|
10298
10321
|
// be careful not to use onclick as that is used for button functionality
|
10299
10322
|
}, {
|
@@ -10307,7 +10330,7 @@ var Bt = /*#__PURE__*/function () {
|
|
10307
10330
|
if (this._customStyles) for (var t = 0; t < e.length; t += 1) {
|
10308
10331
|
var _i19 = e[t],
|
10309
10332
|
n = _i19 && this._customStyles[_i19];
|
10310
|
-
n &&
|
10333
|
+
n && he.unsetActionCSS(this.elementRef, n);
|
10311
10334
|
}
|
10312
10335
|
}
|
10313
10336
|
}, {
|
@@ -10316,7 +10339,7 @@ var Bt = /*#__PURE__*/function () {
|
|
10316
10339
|
if (!this._customStyles) return;
|
10317
10340
|
t && this.unsetCustomStateStyles(t);
|
10318
10341
|
var i = this._customStyles[e];
|
10319
|
-
i &&
|
10342
|
+
i && he.setElementCssUpToState(this.elementRef, i, this._mouseState.state), this.setEvents(i);
|
10320
10343
|
}
|
10321
10344
|
}]);
|
10322
10345
|
}();
|
@@ -10472,7 +10495,7 @@ var at = /*#__PURE__*/function (_Bt) {
|
|
10472
10495
|
}, {
|
10473
10496
|
key: "createInnerElement",
|
10474
10497
|
value: function createInnerElement(e, t, i) {
|
10475
|
-
return
|
10498
|
+
return Z.createSpecificStateElement(this.elementRef, t, i) || e;
|
10476
10499
|
}
|
10477
10500
|
}, {
|
10478
10501
|
key: "addClickEvent",
|
@@ -10501,7 +10524,7 @@ var at = /*#__PURE__*/function (_Bt) {
|
|
10501
10524
|
}, {
|
10502
10525
|
key: "createSVGIconElement",
|
10503
10526
|
value: function createSVGIconElement() {
|
10504
|
-
return
|
10527
|
+
return Y.createSVGElement(Lo);
|
10505
10528
|
}
|
10506
10529
|
}, {
|
10507
10530
|
key: "createButtonContainer",
|
@@ -10517,11 +10540,11 @@ var at = /*#__PURE__*/function (_Bt) {
|
|
10517
10540
|
}
|
10518
10541
|
}]);
|
10519
10542
|
}(Bt);
|
10520
|
-
var
|
10521
|
-
function
|
10522
|
-
_classCallCheck(this,
|
10543
|
+
var q = /*#__PURE__*/function () {
|
10544
|
+
function q() {
|
10545
|
+
_classCallCheck(this, q);
|
10523
10546
|
}
|
10524
|
-
return _createClass(
|
10547
|
+
return _createClass(q, null, [{
|
10525
10548
|
key: "addToDropup",
|
10526
10549
|
value:
|
10527
10550
|
// prettier-ignore
|
@@ -10570,25 +10593,25 @@ var H = /*#__PURE__*/function () {
|
|
10570
10593
|
}, {
|
10571
10594
|
key: "generatePositions",
|
10572
10595
|
value: function generatePositions(e) {
|
10573
|
-
var t =
|
10596
|
+
var t = q.createPositionsObj();
|
10574
10597
|
Object.keys(e).forEach(function (n) {
|
10575
10598
|
var o;
|
10576
10599
|
var r = (o = e[n]) == null ? void 0 : o.button.position;
|
10577
|
-
r &&
|
10578
|
-
}), t["inside-right"].length === 0 && e.submit &&
|
10600
|
+
r && q.setPosition(e, n, t[r]);
|
10601
|
+
}), t["inside-right"].length === 0 && e.submit && q.setPosition(e, "submit", t["inside-right"]), t["outside-right"].length === 0 && (e.submit ? q.setPosition(e, "submit", t["outside-right"]) : e.microphone ? q.setPosition(e, "microphone", t["outside-right"]) : e.camera && q.setPosition(e, "camera", t["outside-right"])), e.submit && q.setPosition(e, "submit", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]), e.microphone && q.setPosition(e, "microphone", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]);
|
10579
10602
|
var i = Object.keys(e);
|
10580
10603
|
return i.length > 1 || t["dropup-menu"].length > 0 ? Nn.forEach(function (n) {
|
10581
10604
|
e[n] && t["dropup-menu"].push(_objectSpread(_objectSpread({}, e[n]), {}, {
|
10582
10605
|
buttonType: n
|
10583
10606
|
}));
|
10584
|
-
}) : i.length === 1 &&
|
10607
|
+
}) : i.length === 1 && q.setPosition(e, i[0], t["outside-right"].length === 0 ? t["outside-right"] : t["outside-left"]), t;
|
10585
10608
|
}
|
10586
10609
|
// prettier-ignore
|
10587
10610
|
}, {
|
10588
10611
|
key: "addButtons",
|
10589
10612
|
value: function addButtons(e, t, i, n) {
|
10590
|
-
var r =
|
10591
|
-
return
|
10613
|
+
var r = q.generatePositions(t);
|
10614
|
+
return q.addToSideContainer(e, r), r["dropup-menu"].length > 0 && q.addToDropup(e, r, i, n), r;
|
10592
10615
|
}
|
10593
10616
|
}]);
|
10594
10617
|
}();
|
@@ -10642,7 +10665,7 @@ var Lt = /*#__PURE__*/function (_Bt2) {
|
|
10642
10665
|
}, {
|
10643
10666
|
key: "createInnerElement",
|
10644
10667
|
value: function createInnerElement(e, t, i) {
|
10645
|
-
return
|
10668
|
+
return Z.createSpecificStateElement(this.elementRef, t, i) || e;
|
10646
10669
|
}
|
10647
10670
|
}, {
|
10648
10671
|
key: "changeToActive",
|
@@ -10689,7 +10712,7 @@ var Lt = /*#__PURE__*/function (_Bt2) {
|
|
10689
10712
|
}, {
|
10690
10713
|
key: "createSVGIconElement",
|
10691
10714
|
value: function createSVGIconElement() {
|
10692
|
-
var e =
|
10715
|
+
var e = Y.createSVGElement(Bo);
|
10693
10716
|
return e.id = "microphone-icon", e;
|
10694
10717
|
}
|
10695
10718
|
}]);
|
@@ -10814,11 +10837,11 @@ Object.defineProperty(Ti, "__esModule", {
|
|
10814
10837
|
value: !0
|
10815
10838
|
});
|
10816
10839
|
Ti.EventListeners = void 0;
|
10817
|
-
var
|
10818
|
-
function
|
10819
|
-
_classCallCheck(this,
|
10840
|
+
var ne = /*#__PURE__*/function () {
|
10841
|
+
function ne() {
|
10842
|
+
_classCallCheck(this, ne);
|
10820
10843
|
}
|
10821
|
-
return _createClass(
|
10844
|
+
return _createClass(ne, null, [{
|
10822
10845
|
key: "getElementIfFocusedOnAvailable",
|
10823
10846
|
value: function getElementIfFocusedOnAvailable(e, t) {
|
10824
10847
|
return Array.isArray(e) ? e.find(function (i) {
|
@@ -10829,14 +10852,14 @@ var ie = /*#__PURE__*/function () {
|
|
10829
10852
|
key: "keyDownWindow",
|
10830
10853
|
value: function keyDownWindow(e) {
|
10831
10854
|
var _this51 = this;
|
10832
|
-
e.element &&
|
10833
|
-
|
10855
|
+
e.element && ne.getElementIfFocusedOnAvailable(e.element, document.activeElement) && (ne.KEY_DOWN_TIMEOUT !== null && clearTimeout(ne.KEY_DOWN_TIMEOUT), ne.KEY_DOWN_TIMEOUT = setTimeout(function () {
|
10856
|
+
ne.KEY_DOWN_TIMEOUT = null, _this51.resetRecording(e);
|
10834
10857
|
}, 500));
|
10835
10858
|
}
|
10836
10859
|
}, {
|
10837
10860
|
key: "mouseDownWindow",
|
10838
10861
|
value: function mouseDownWindow(e, t) {
|
10839
|
-
this.mouseDownElement =
|
10862
|
+
this.mouseDownElement = ne.getElementIfFocusedOnAvailable(e, t.target);
|
10840
10863
|
}
|
10841
10864
|
}, {
|
10842
10865
|
key: "mouseUpWindow",
|
@@ -10847,7 +10870,7 @@ var ie = /*#__PURE__*/function () {
|
|
10847
10870
|
key: "add",
|
10848
10871
|
value: function add(e, t) {
|
10849
10872
|
var i = (t == null ? void 0 : t.insertInCursorLocation) === void 0 || (t == null ? void 0 : t.insertInCursorLocation);
|
10850
|
-
t != null && t.element && i && (e.mouseDownEvent =
|
10873
|
+
t != null && t.element && i && (e.mouseDownEvent = ne.mouseDownWindow.bind(e, t.element), document.addEventListener("mousedown", e.mouseDownEvent), e.mouseUpEvent = ne.mouseUpWindow.bind(e, t), document.addEventListener("mouseup", e.mouseUpEvent), e.keyDownEvent = ne.keyDownWindow.bind(e, t), document.addEventListener("keydown", e.keyDownEvent));
|
10851
10874
|
}
|
10852
10875
|
}, {
|
10853
10876
|
key: "remove",
|
@@ -10856,8 +10879,8 @@ var ie = /*#__PURE__*/function () {
|
|
10856
10879
|
}
|
10857
10880
|
}]);
|
10858
10881
|
}();
|
10859
|
-
Ti.EventListeners =
|
10860
|
-
|
10882
|
+
Ti.EventListeners = ne;
|
10883
|
+
ne.KEY_DOWN_TIMEOUT = null;
|
10861
10884
|
var Ci = {};
|
10862
10885
|
Object.defineProperty(Ci, "__esModule", {
|
10863
10886
|
value: !0
|
@@ -11067,11 +11090,11 @@ var Fn = qt,
|
|
11067
11090
|
Go = ft,
|
11068
11091
|
Bn = Ye,
|
11069
11092
|
jn = Xe;
|
11070
|
-
var
|
11071
|
-
function
|
11072
|
-
_classCallCheck(this,
|
11093
|
+
var te = /*#__PURE__*/function () {
|
11094
|
+
function te() {
|
11095
|
+
_classCallCheck(this, te);
|
11073
11096
|
}
|
11074
|
-
return _createClass(
|
11097
|
+
return _createClass(te, null, [{
|
11075
11098
|
key: "processCommand",
|
11076
11099
|
value: function processCommand(e, t) {
|
11077
11100
|
return (!t || !t.caseSensitive) && (e = e.toLowerCase()), (t == null ? void 0 : t.substrings) === !1 ? jn.Text.breakupIntoWordsArr(e) : e;
|
@@ -11082,7 +11105,7 @@ var ee = /*#__PURE__*/function () {
|
|
11082
11105
|
var t;
|
11083
11106
|
return ((t = e.settings) === null || t === void 0 ? void 0 : t.caseSensitive) === !0 ? e : Object.keys(e).reduce(function (n, r) {
|
11084
11107
|
var o = e[r];
|
11085
|
-
return n[r] = typeof o == "string" ?
|
11108
|
+
return n[r] = typeof o == "string" ? te.processCommand(o, e.settings) : o, n;
|
11086
11109
|
}, {});
|
11087
11110
|
}
|
11088
11111
|
}, {
|
@@ -11100,7 +11123,7 @@ var ee = /*#__PURE__*/function () {
|
|
11100
11123
|
}, {
|
11101
11124
|
key: "setText",
|
11102
11125
|
value: function setText(e, t, i, n) {
|
11103
|
-
|
11126
|
+
te.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 () {
|
11104
11127
|
return Fn.AutoScroll.scrollGeneric(e, n);
|
11105
11128
|
})), e.resetRecording(t);
|
11106
11129
|
}
|
@@ -11130,38 +11153,38 @@ var ee = /*#__PURE__*/function () {
|
|
11130
11153
|
if (!c || !n || !i) return;
|
11131
11154
|
var d = ((o = c.settings) === null || o === void 0 ? void 0 : o.caseSensitive) === !0 ? t : t.toLowerCase(),
|
11132
11155
|
h = jn.Text.breakupIntoWordsArr(d),
|
11133
|
-
u = ((a = c.settings) === null || a === void 0 ? void 0 : a.substrings) === !1 ?
|
11156
|
+
u = ((a = c.settings) === null || a === void 0 ? void 0 : a.substrings) === !1 ? te.checkIfMatchesWord : te.checkIfMatchesSubstring;
|
11134
11157
|
if (c.commandMode && u(c.commandMode, d, h)) return e.setInterimColorToFinal(), setTimeout(function () {
|
11135
|
-
return
|
11158
|
+
return te.toggleCommandModeOn(e);
|
11136
11159
|
}), {
|
11137
11160
|
doNotProcessTranscription: !1
|
11138
11161
|
};
|
11139
11162
|
if (!(c.commandMode && !e.isWaitingForCommand)) {
|
11140
|
-
if (c.stop && u(c.stop, d, h)) return
|
11163
|
+
if (c.stop && u(c.stop, d, h)) return te.toggleCommandModeOff(e), setTimeout(function () {
|
11141
11164
|
return e.stop();
|
11142
11165
|
}), {
|
11143
11166
|
doNotProcessTranscription: !1
|
11144
11167
|
};
|
11145
|
-
if (c.pause && u(c.pause, d, h)) return
|
11168
|
+
if (c.pause && u(c.pause, d, h)) return te.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
|
11146
11169
|
var f;
|
11147
11170
|
e.isPaused = !0, (f = e.onPauseTrigger) === null || f === void 0 || f.call(e, !0);
|
11148
11171
|
}), {
|
11149
11172
|
doNotProcessTranscription: !1
|
11150
11173
|
};
|
11151
|
-
if (c.resume && u(c.resume, d, h)) return e.isPaused = !1, (l = e.onPauseTrigger) === null || l === void 0 || l.call(e, !1),
|
11174
|
+
if (c.resume && u(c.resume, d, h)) return e.isPaused = !1, (l = e.onPauseTrigger) === null || l === void 0 || l.call(e, !1), te.toggleCommandModeOff(e), e.resetRecording(i), {
|
11152
11175
|
doNotProcessTranscription: !0
|
11153
11176
|
};
|
11154
|
-
if (c.reset && u(c.reset, d, h)) return r !== void 0 &&
|
11177
|
+
if (c.reset && u(c.reset, d, h)) return r !== void 0 && te.setText(e, i, r, n), {
|
11155
11178
|
doNotProcessTranscription: !0
|
11156
11179
|
};
|
11157
|
-
if (c.removeAllText && u(c.removeAllText, d, h)) return
|
11180
|
+
if (c.removeAllText && u(c.removeAllText, d, h)) return te.setText(e, i, "", n), {
|
11158
11181
|
doNotProcessTranscription: !0
|
11159
11182
|
};
|
11160
11183
|
}
|
11161
11184
|
}
|
11162
11185
|
}]);
|
11163
11186
|
}();
|
11164
|
-
Ht.CommandUtils =
|
11187
|
+
Ht.CommandUtils = te;
|
11165
11188
|
var ki = {};
|
11166
11189
|
Object.defineProperty(ki, "__esModule", {
|
11167
11190
|
value: !0
|
@@ -11293,7 +11316,7 @@ var Hn = Ti,
|
|
11293
11316
|
qn = Ht,
|
11294
11317
|
$t = qt,
|
11295
11318
|
Ui = ki,
|
11296
|
-
|
11319
|
+
fe = Ze,
|
11297
11320
|
Hi = Ai,
|
11298
11321
|
zn = ft,
|
11299
11322
|
Vn = Ye,
|
@@ -11301,7 +11324,7 @@ var Hn = Ti,
|
|
11301
11324
|
var Jo = /*#__PURE__*/function () {
|
11302
11325
|
function Jo() {
|
11303
11326
|
_classCallCheck(this, Jo);
|
11304
|
-
this.finalTranscript = "", this.interimSpan =
|
11327
|
+
this.finalTranscript = "", this.interimSpan = fe.Elements.createInterimSpan(), this.finalSpan = fe.Elements.createGenericSpan(), this.scrollingSpan = fe.Elements.createGenericSpan(), this.isCursorAtEnd = !1, this.spansPopulated = !1, this.startPadding = "", this.endPadding = "", this.numberOfSpacesBeforeNewText = 0, this.numberOfSpacesAfterNewText = 0, this.isHighlighted = !1, this.primitiveTextRecorded = !1, this.recognizing = !1, this._displayInterimResults = !0, this.insertInCursorLocation = !0, this.autoScroll = !0, this.isRestarting = !1, this.isPaused = !1, this.isWaitingForCommand = !1, this.isTargetInShadow = !1, this.cannotBeStopped = !1, this.resetState();
|
11305
11328
|
}
|
11306
11329
|
return _createClass(Jo, [{
|
11307
11330
|
key: "prepareBeforeStart",
|
@@ -11314,12 +11337,12 @@ var Jo = /*#__PURE__*/function () {
|
|
11314
11337
|
if (!r) return;
|
11315
11338
|
this.prepare(r);
|
11316
11339
|
} else this.prepare(e.element);
|
11317
|
-
(e == null ? void 0 : e.displayInterimResults) !== void 0 && (this._displayInterimResults = e.displayInterimResults), e != null && e.textColor && (this._finalTextColor = (t = e == null ? void 0 : e.textColor) === null || t === void 0 ? void 0 : t["final"],
|
11340
|
+
(e == null ? void 0 : e.displayInterimResults) !== void 0 && (this._displayInterimResults = e.displayInterimResults), e != null && e.textColor && (this._finalTextColor = (t = e == null ? void 0 : e.textColor) === null || t === void 0 ? void 0 : t["final"], fe.Elements.applyCustomColors(this, e.textColor)), (e == null ? void 0 : e.insertInCursorLocation) !== void 0 && (this.insertInCursorLocation = e.insertInCursorLocation), (e == null ? void 0 : e.autoScroll) !== void 0 && (this.autoScroll = e.autoScroll), this._onResult = e == null ? void 0 : e.onResult, this._onPreResult = e == null ? void 0 : e.onPreResult, this._onStart = e == null ? void 0 : e.onStart, this._onStop = e == null ? void 0 : e.onStop, this._onError = e == null ? void 0 : e.onError, this.onCommandModeTrigger = e == null ? void 0 : e.onCommandModeTrigger, this.onPauseTrigger = e == null ? void 0 : e.onPauseTrigger, this._options = e, !((i = this._options) === null || i === void 0) && i.commands && (this.commands = qn.CommandUtils.process(this._options.commands));
|
11318
11341
|
}
|
11319
11342
|
}, {
|
11320
11343
|
key: "prepare",
|
11321
11344
|
value: function prepare(e) {
|
11322
|
-
Hi.Padding.setState(this, e), Ui.Highlight.setState(this, e), this.isTargetInShadow =
|
11345
|
+
Hi.Padding.setState(this, e), Ui.Highlight.setState(this, e), this.isTargetInShadow = fe.Elements.isInsideShadowDOM(e), fe.Elements.isPrimitiveElement(e) ? (this._primitiveElement = e, this._originalText = this._primitiveElement.value) : (this._genericElement = e, this._originalText = this._genericElement.textContent);
|
11323
11346
|
}
|
11324
11347
|
// there was an attempt to optimize this by not having to restart the service and just reset state:
|
11325
11348
|
// unfortunately it did not work because the service would still continue firing the intermediate and final results
|
@@ -11363,7 +11386,7 @@ var Jo = /*#__PURE__*/function () {
|
|
11363
11386
|
}, {
|
11364
11387
|
key: "updateGenericElement",
|
11365
11388
|
value: function updateGenericElement(e, t, i) {
|
11366
|
-
this.isHighlighted && Ui.Highlight.removeForGeneric(this, e), this.spansPopulated ||
|
11389
|
+
this.isHighlighted && Ui.Highlight.removeForGeneric(this, e), this.spansPopulated || fe.Elements.appendSpans(this, e);
|
11367
11390
|
var n = (i ? "" : this.startPadding) + qi.Text.lineBreak(this.finalTranscript);
|
11368
11391
|
this.finalSpan.innerHTML = n;
|
11369
11392
|
var r = $t.AutoScroll.isRequired(this.autoScroll, e);
|
@@ -11374,7 +11397,7 @@ var Jo = /*#__PURE__*/function () {
|
|
11374
11397
|
}, {
|
11375
11398
|
key: "finalise",
|
11376
11399
|
value: function finalise(e) {
|
11377
|
-
this._genericElement && (e ? (this.finalSpan =
|
11400
|
+
this._genericElement && (e ? (this.finalSpan = fe.Elements.createGenericSpan(), this.setInterimColorToFinal(), this.interimSpan = fe.Elements.createInterimSpan(), this.scrollingSpan = fe.Elements.createGenericSpan()) : this._genericElement.textContent = this._genericElement.textContent, this.spansPopulated = !1), Hn.EventListeners.remove(this);
|
11378
11401
|
}
|
11379
11402
|
}, {
|
11380
11403
|
key: "setInterimColorToFinal",
|
@@ -11838,7 +11861,7 @@ Object.defineProperty(cs, "__esModule", {
|
|
11838
11861
|
});
|
11839
11862
|
var Xn = Si,
|
11840
11863
|
ta = Ht,
|
11841
|
-
|
11864
|
+
oe = Mi,
|
11842
11865
|
ia = Ri;
|
11843
11866
|
var tt = /*#__PURE__*/function () {
|
11844
11867
|
function tt() {
|
@@ -11849,12 +11872,12 @@ var tt = /*#__PURE__*/function () {
|
|
11849
11872
|
value: function toggle(e, t) {
|
11850
11873
|
var i, n;
|
11851
11874
|
var r = e.toLocaleLowerCase().trim();
|
11852
|
-
!((i =
|
11875
|
+
!((i = oe.GlobalState.service) === null || i === void 0) && i.recognizing ? this.stop() : r === "webspeech" ? tt.startWebSpeech(t) : r === "azure" ? tt.startAzure(t) : (console.error("service not found - must be either 'webspeech' or 'azure'"), (n = t == null ? void 0 : t.onError) === null || n === void 0 || n.call(t, "service not found - must be either 'webspeech' or 'azure'"));
|
11853
11876
|
}
|
11854
11877
|
}, {
|
11855
11878
|
key: "startWebSpeech",
|
11856
11879
|
value: function startWebSpeech(e) {
|
11857
|
-
tt.stop() || (
|
11880
|
+
tt.stop() || (oe.GlobalState.service = new Xn.WebSpeech(), oe.GlobalState.service.start(e));
|
11858
11881
|
}
|
11859
11882
|
}, {
|
11860
11883
|
key: "isWebSpeechSupported",
|
@@ -11865,18 +11888,18 @@ var tt = /*#__PURE__*/function () {
|
|
11865
11888
|
key: "startAzure",
|
11866
11889
|
value: function startAzure(e) {
|
11867
11890
|
var t;
|
11868
|
-
tt.stop() || !((t =
|
11891
|
+
tt.stop() || !((t = oe.GlobalState.service) === null || t === void 0) && t.cannotBeStopped || (oe.GlobalState.service = new ia.Azure(), oe.GlobalState.service.start(e));
|
11869
11892
|
}
|
11870
11893
|
}, {
|
11871
11894
|
key: "stop",
|
11872
11895
|
value: function stop() {
|
11873
11896
|
var e;
|
11874
|
-
return
|
11897
|
+
return oe.GlobalState.doubleClickDetector() ? !0 : (!((e = oe.GlobalState.service) === null || e === void 0) && e.recognizing && oe.GlobalState.service.stop(), !1);
|
11875
11898
|
}
|
11876
11899
|
}, {
|
11877
11900
|
key: "endCommandMode",
|
11878
11901
|
value: function endCommandMode() {
|
11879
|
-
|
11902
|
+
oe.GlobalState.service && ta.CommandUtils.toggleCommandModeOff(oe.GlobalState.service);
|
11880
11903
|
}
|
11881
11904
|
}]);
|
11882
11905
|
}();
|
@@ -12014,40 +12037,40 @@ var Tt = /*#__PURE__*/function (_Lt) {
|
|
12014
12037
|
}(Lt);
|
12015
12038
|
Tt.MICROPHONE_RESET_TIMEOUT_MS = 300;
|
12016
12039
|
var Ot = Tt;
|
12017
|
-
var
|
12040
|
+
var _e = /*#__PURE__*/function () {
|
12018
12041
|
// prettier-ignore
|
12019
|
-
function
|
12042
|
+
function _e(e, t, i, n) {
|
12020
12043
|
var _this58 = this;
|
12021
|
-
_classCallCheck(this,
|
12044
|
+
_classCallCheck(this, _e);
|
12022
12045
|
this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", t.maxNumberOfFiles && (this._fileCountLimit = t.maxNumberOfFiles), this._toggleContainerDisplay = i, this._fileAttachmentsContainerRef = n, t.acceptedFormats && (this._acceptedFormat = t.acceptedFormats), setTimeout(function () {
|
12023
12046
|
_this58._validationHandler = e._validationHandler;
|
12024
12047
|
});
|
12025
12048
|
}
|
12026
|
-
return _createClass(
|
12049
|
+
return _createClass(_e, [{
|
12027
12050
|
key: "attemptAddFile",
|
12028
12051
|
value: function attemptAddFile(e, t) {
|
12029
|
-
return
|
12052
|
+
return _e.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), !0) : !1;
|
12030
12053
|
}
|
12031
12054
|
}, {
|
12032
12055
|
key: "addAttachmentBasedOnType",
|
12033
12056
|
value: function addAttachmentBasedOnType(e, t, i) {
|
12034
|
-
var n =
|
12057
|
+
var n = _e.getTypeFromBlob(e);
|
12035
12058
|
if (n === "image") {
|
12036
|
-
var r =
|
12059
|
+
var r = _e.createImageAttachment(t);
|
12037
12060
|
this.addFileAttachment(e, "image", r, i);
|
12038
12061
|
} else if (n === "audio") {
|
12039
|
-
var
|
12040
|
-
this.addFileAttachment(e, "audio",
|
12062
|
+
var _r3 = Nt.createAudioAttachment(t);
|
12063
|
+
this.addFileAttachment(e, "audio", _r3, i);
|
12041
12064
|
} else {
|
12042
|
-
var
|
12043
|
-
this.addFileAttachment(e, "any",
|
12065
|
+
var _r4 = _e.createAnyFileAttachment(e.name);
|
12066
|
+
this.addFileAttachment(e, "any", _r4, i);
|
12044
12067
|
}
|
12045
12068
|
}
|
12046
12069
|
}, {
|
12047
12070
|
key: "addFileAttachment",
|
12048
12071
|
value: function addFileAttachment(e, t, i, n) {
|
12049
12072
|
var a;
|
12050
|
-
var r =
|
12073
|
+
var r = _e.createContainer(i);
|
12051
12074
|
if (this._attachments.length >= this._fileCountLimit) {
|
12052
12075
|
var l = this._attachments[this._attachments.length - 1].removeButton;
|
12053
12076
|
l == null || l.click();
|
@@ -12149,19 +12172,19 @@ var Ee = /*#__PURE__*/function () {
|
|
12149
12172
|
}();
|
12150
12173
|
var sa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>play</title>\n <path d=\"M5.92 24.096q0 1.088 0.928 1.728 0.512 0.288 1.088 0.288 0.448 0 0.896-0.224l16.16-8.064q0.48-0.256 0.8-0.736t0.288-1.088-0.288-1.056-0.8-0.736l-16.16-8.064q-0.448-0.224-0.896-0.224-0.544 0-1.088 0.288-0.928 0.608-0.928 1.728v16.16z\"></path>\n</svg>",
|
12151
12174
|
Zn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n<title>stop</title>\n<path d=\"M5.92 24.096q0 0.832 0.576 1.408t1.44 0.608h16.128q0.832 0 1.44-0.608t0.576-1.408v-16.16q0-0.832-0.576-1.44t-1.44-0.576h-16.128q-0.832 0-1.44 0.576t-0.576 1.44v16.16z\"></path>\n</svg>",
|
12152
|
-
|
12175
|
+
ye = /*#__PURE__*/function (_e2) {
|
12153
12176
|
// prettier-ignore
|
12154
|
-
function
|
12155
|
-
_classCallCheck(this,
|
12156
|
-
return _callSuper(this,
|
12177
|
+
function ye(e, t, i, n) {
|
12178
|
+
_classCallCheck(this, ye);
|
12179
|
+
return _callSuper(this, ye, [e, t, i, n]);
|
12157
12180
|
}
|
12158
|
-
_inherits(
|
12159
|
-
return _createClass(
|
12181
|
+
_inherits(ye, _e2);
|
12182
|
+
return _createClass(ye, [{
|
12160
12183
|
key: "createTimer",
|
12161
12184
|
value: function createTimer(e, t) {
|
12162
12185
|
var _this59 = this;
|
12163
12186
|
var i = 0;
|
12164
|
-
var n = t !== void 0 && t <
|
12187
|
+
var n = t !== void 0 && t < ye.TIMER_LIMIT_S ? t : ye.TIMER_LIMIT_S;
|
12165
12188
|
return setInterval(function () {
|
12166
12189
|
var a;
|
12167
12190
|
i += 1, i === n && ((a = _this59.stopPlaceholderCallback) == null || a.call(_this59), _this59.clearTimer()), i === 600 && e.classList.add("audio-placeholder-text-4-digits");
|
@@ -12173,12 +12196,12 @@ var sa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
12173
12196
|
}, {
|
12174
12197
|
key: "createPlaceholderAudioAttachment",
|
12175
12198
|
value: function createPlaceholderAudioAttachment(e) {
|
12176
|
-
var t =
|
12199
|
+
var t = ye.createAudioContainer(),
|
12177
12200
|
i = document.createElement("div");
|
12178
12201
|
i.classList.add("audio-placeholder-text-3-digits");
|
12179
12202
|
var n = document.createElement("div");
|
12180
12203
|
n.classList.add("file-attachment-text-container", "audio-placeholder-text-3-digits-container"), n.appendChild(i);
|
12181
|
-
var r =
|
12204
|
+
var r = Y.createSVGElement(Zn);
|
12182
12205
|
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;
|
12183
12206
|
}
|
12184
12207
|
}, {
|
@@ -12210,7 +12233,7 @@ var sa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
12210
12233
|
key: "completePlaceholderAttachment",
|
12211
12234
|
value: function completePlaceholderAttachment(e, t) {
|
12212
12235
|
var i = this._activePlaceholderAttachment;
|
12213
|
-
i && (i.file = e,
|
12236
|
+
i && (i.file = e, ye.addAudioElements(i.attachmentContainerElement.children[0], t), i.removeButton = this.createRemoveAttachmentButton(i), i.attachmentContainerElement.appendChild(i.removeButton), this._activePlaceholderAttachment = void 0, this.clearTimer());
|
12214
12237
|
}
|
12215
12238
|
}, {
|
12216
12239
|
key: "removePlaceholderAttachment",
|
@@ -12231,12 +12254,12 @@ var sa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
12231
12254
|
}, {
|
12232
12255
|
key: "addAudioElements",
|
12233
12256
|
value: function addAudioElements(e, t) {
|
12234
|
-
var i = e.parentElement ?
|
12257
|
+
var i = e.parentElement ? U.cloneElement(e) : e,
|
12235
12258
|
n = document.createElement("audio");
|
12236
12259
|
n.src = t;
|
12237
|
-
var r =
|
12260
|
+
var r = Y.createSVGElement(sa);
|
12238
12261
|
r.classList.add("attachment-icon", "play-icon");
|
12239
|
-
var o =
|
12262
|
+
var o = Y.createSVGElement(Zn);
|
12240
12263
|
o.classList.add("attachment-icon", "stop-icon"), i.replaceChildren(r), n.onplay = function () {
|
12241
12264
|
i.replaceChildren(o);
|
12242
12265
|
}, n.onpause = function () {
|
@@ -12250,8 +12273,8 @@ var sa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
12250
12273
|
}, {
|
12251
12274
|
key: "createAudioAttachment",
|
12252
12275
|
value: function createAudioAttachment(e) {
|
12253
|
-
var t =
|
12254
|
-
return
|
12276
|
+
var t = ye.createAudioContainer();
|
12277
|
+
return ye.addAudioElements(t, e), t;
|
12255
12278
|
}
|
12256
12279
|
}, {
|
12257
12280
|
key: "stopAttachmentPlayback",
|
@@ -12260,9 +12283,9 @@ var sa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
12260
12283
|
(n = (i = (t = e.children[0]) == null ? void 0 : t.children) == null ? void 0 : i[0]) != null && n.classList.contains("stop-icon") && e.children[0].click();
|
12261
12284
|
}
|
12262
12285
|
}]);
|
12263
|
-
}(
|
12264
|
-
|
12265
|
-
var Nt =
|
12286
|
+
}(_e);
|
12287
|
+
ye.TIMER_LIMIT_S = 5999;
|
12288
|
+
var Nt = ye;
|
12266
12289
|
var ra = /*#__PURE__*/function () {
|
12267
12290
|
function ra() {
|
12268
12291
|
_classCallCheck(this, ra);
|
@@ -12272,7 +12295,7 @@ var ra = /*#__PURE__*/function () {
|
|
12272
12295
|
value:
|
12273
12296
|
// prettier-ignore
|
12274
12297
|
function create(e, t, i, n, r) {
|
12275
|
-
return r === "audio" ? new Nt(e, t, i, n) : new
|
12298
|
+
return r === "audio" ? new Nt(e, t, i, n) : new _e(e, t, i, n);
|
12276
12299
|
}
|
12277
12300
|
}]);
|
12278
12301
|
}();
|
@@ -12374,12 +12397,12 @@ var zt = /*#__PURE__*/function () {
|
|
12374
12397
|
}
|
12375
12398
|
}]);
|
12376
12399
|
}();
|
12377
|
-
var
|
12378
|
-
function
|
12379
|
-
_classCallCheck(this,
|
12380
|
-
this._isOpen = !1, this._contentRef =
|
12400
|
+
var de = /*#__PURE__*/function () {
|
12401
|
+
function de(e, t, i) {
|
12402
|
+
_classCallCheck(this, de);
|
12403
|
+
this._isOpen = !1, this._contentRef = de.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = de.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = de.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = de.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents(e);
|
12381
12404
|
}
|
12382
|
-
return _createClass(
|
12405
|
+
return _createClass(de, [{
|
12383
12406
|
key: "isOpen",
|
12384
12407
|
value: function isOpen() {
|
12385
12408
|
return this._isOpen;
|
@@ -12401,7 +12424,7 @@ var ce = /*#__PURE__*/function () {
|
|
12401
12424
|
var _this62 = this;
|
12402
12425
|
this._elementRef.classList.remove("show-modal"), this._elementRef.classList.add("hide-modal"), this._backgroundPanelRef.classList.remove("show-modal-background"), this._backgroundPanelRef.classList.add("hide-modal-background"), this._isOpen = !1, setTimeout(function () {
|
12403
12426
|
_this62._elementRef.style.display = "none", _this62._backgroundPanelRef.style.display = "none";
|
12404
|
-
},
|
12427
|
+
}, de.MODAL_CLOSE_TIMEOUT_MS);
|
12405
12428
|
}
|
12406
12429
|
}, {
|
12407
12430
|
key: "displayModalElements",
|
@@ -12417,7 +12440,7 @@ var ce = /*#__PURE__*/function () {
|
|
12417
12440
|
key: "addCloseButton",
|
12418
12441
|
value: function addCloseButton(e, t, i) {
|
12419
12442
|
var _this63 = this;
|
12420
|
-
var n = t ?
|
12443
|
+
var n = t ? de.createSVGButton(e) : de.createTextButton(e);
|
12421
12444
|
return this.addButtons(n), n.onclick = function () {
|
12422
12445
|
_this63.close(), setTimeout(function () {
|
12423
12446
|
i == null || i();
|
@@ -12471,7 +12494,7 @@ var ce = /*#__PURE__*/function () {
|
|
12471
12494
|
value: function createSVGButton(e) {
|
12472
12495
|
var t = document.createElement("div");
|
12473
12496
|
t.classList.add("modal-button", "modal-svg-button");
|
12474
|
-
var i =
|
12497
|
+
var i = Y.createSVGElement(e);
|
12475
12498
|
return i.classList.add("modal-svg-button-icon"), t.appendChild(i), t;
|
12476
12499
|
}
|
12477
12500
|
}, {
|
@@ -12479,14 +12502,14 @@ var ce = /*#__PURE__*/function () {
|
|
12479
12502
|
value: function createTextModalFunc(e, t, i) {
|
12480
12503
|
var n;
|
12481
12504
|
if (_typeof(t) == "object" && (n = t.files) != null && n.infoModal) {
|
12482
|
-
var r = new
|
12505
|
+
var r = new de(e, ["modal-content"], t.files.infoModal.containerStyle);
|
12483
12506
|
return r.addCloseButton("OK", !1, i), r.openTextModal.bind(r, t.infoModalTextMarkUp || "");
|
12484
12507
|
}
|
12485
12508
|
}
|
12486
12509
|
}]);
|
12487
12510
|
}();
|
12488
|
-
|
12489
|
-
var ze =
|
12511
|
+
de.MODAL_CLOSE_TIMEOUT_MS = 190;
|
12512
|
+
var ze = de;
|
12490
12513
|
var Et = /*#__PURE__*/function (_Bt3) {
|
12491
12514
|
// prettier-ignore
|
12492
12515
|
function Et(e, t, i, n, r, o) {
|
@@ -12520,7 +12543,7 @@ var Et = /*#__PURE__*/function (_Bt3) {
|
|
12520
12543
|
}, {
|
12521
12544
|
key: "createInnerElement",
|
12522
12545
|
value: function createInnerElement(e, t, i) {
|
12523
|
-
return
|
12546
|
+
return Z.createSpecificStateElement(this.elementRef, t, i) || e;
|
12524
12547
|
}
|
12525
12548
|
}, {
|
12526
12549
|
key: "addClickEvent",
|
@@ -12549,20 +12572,20 @@ var Et = /*#__PURE__*/function (_Bt3) {
|
|
12549
12572
|
}, {
|
12550
12573
|
key: "createSVGIconElement",
|
12551
12574
|
value: function createSVGIconElement(e, t) {
|
12552
|
-
var i =
|
12575
|
+
var i = Y.createSVGElement(t);
|
12553
12576
|
return i.id = e, i;
|
12554
12577
|
}
|
12555
12578
|
}]);
|
12556
12579
|
}(Bt);
|
12557
|
-
var
|
12558
|
-
function
|
12559
|
-
_classCallCheck(this,
|
12580
|
+
var xe = /*#__PURE__*/function () {
|
12581
|
+
function xe() {
|
12582
|
+
_classCallCheck(this, xe);
|
12560
12583
|
}
|
12561
|
-
return _createClass(
|
12584
|
+
return _createClass(xe, null, [{
|
12562
12585
|
key: "create",
|
12563
12586
|
value: function create(e, t, i) {
|
12564
|
-
var n =
|
12565
|
-
|
12587
|
+
var n = xe.createElement(i);
|
12588
|
+
xe.addEvents(n, e, t), e.appendChild(n);
|
12566
12589
|
}
|
12567
12590
|
}, {
|
12568
12591
|
key: "createElement",
|
@@ -12574,13 +12597,13 @@ var ye = /*#__PURE__*/function () {
|
|
12574
12597
|
key: "addEvents",
|
12575
12598
|
value: function addEvents(e, t, i) {
|
12576
12599
|
t.ondragenter = function (n) {
|
12577
|
-
n.preventDefault(),
|
12600
|
+
n.preventDefault(), xe.display(e);
|
12578
12601
|
}, e.ondragleave = function (n) {
|
12579
|
-
n.preventDefault(),
|
12602
|
+
n.preventDefault(), xe.hide(e);
|
12580
12603
|
}, e.ondragover = function (n) {
|
12581
12604
|
n.preventDefault();
|
12582
12605
|
}, e.ondrop = function (n) {
|
12583
|
-
n.preventDefault(),
|
12606
|
+
n.preventDefault(), xe.uploadFile(i, n), xe.hide(e);
|
12584
12607
|
};
|
12585
12608
|
}
|
12586
12609
|
}, {
|
@@ -12679,7 +12702,7 @@ var Fe = /*#__PURE__*/function () {
|
|
12679
12702
|
}, {
|
12680
12703
|
key: "attach",
|
12681
12704
|
value: function attach(e, t, i, n, r) {
|
12682
|
-
var o = e.validateInput ||
|
12705
|
+
var o = e.validateInput || ue.processValidateInput(e);
|
12683
12706
|
e._validationHandler = /*#__PURE__*/function () {
|
12684
12707
|
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee117(a) {
|
12685
12708
|
var l;
|
@@ -12887,21 +12910,21 @@ var k = /*#__PURE__*/function (_Bt4) {
|
|
12887
12910
|
key: "createCustomElements",
|
12888
12911
|
value: function createCustomElements() {
|
12889
12912
|
var _this70 = this;
|
12890
|
-
var e =
|
12913
|
+
var e = Z.createSpecificStateElement(this.elementRef, "submit", this._customStyles),
|
12891
12914
|
t = {
|
12892
12915
|
loading: void 0,
|
12893
12916
|
stop: void 0
|
12894
12917
|
};
|
12895
12918
|
return Object.keys(t).forEach(function (i) {
|
12896
12919
|
var n = i,
|
12897
|
-
r =
|
12920
|
+
r = Z.createCustomElement(n, _this70._customStyles);
|
12898
12921
|
r && (t[n] = r);
|
12899
12922
|
}), t.submit = e, t;
|
12900
12923
|
}
|
12901
12924
|
}, {
|
12902
12925
|
key: "createDisabledIconElement",
|
12903
12926
|
value: function createDisabledIconElement(e) {
|
12904
|
-
return
|
12927
|
+
return Z.createCustomElement("disabled", this._customStyles) || e.cloneNode(!0);
|
12905
12928
|
}
|
12906
12929
|
// prettier-ignore
|
12907
12930
|
}, {
|
@@ -12979,14 +13002,14 @@ var k = /*#__PURE__*/function (_Bt4) {
|
|
12979
13002
|
return _regeneratorRuntime().wrap(function _callee119$(_context119) {
|
12980
13003
|
while (1) switch (_context119.prev = _context119.next) {
|
12981
13004
|
case 0:
|
12982
|
-
typeof e == "string" && (e =
|
13005
|
+
typeof e == "string" && (e = ue.processSubmitUserMessage(e));
|
12983
13006
|
t = {
|
12984
13007
|
text: e.text
|
12985
13008
|
};
|
12986
13009
|
e.files && (t.files = Array.from(e.files).map(function (i) {
|
12987
13010
|
return {
|
12988
13011
|
file: i,
|
12989
|
-
type:
|
13012
|
+
type: _e.getTypeFromBlob(i)
|
12990
13013
|
};
|
12991
13014
|
})), setTimeout(function () {
|
12992
13015
|
return _this71.attemptSubmit(t, !0);
|
@@ -13139,7 +13162,7 @@ var k = /*#__PURE__*/function (_Bt4) {
|
|
13139
13162
|
}, {
|
13140
13163
|
key: "createSubmitIconElement",
|
13141
13164
|
value: function createSubmitIconElement() {
|
13142
|
-
var e =
|
13165
|
+
var e = Y.createSVGElement(aa);
|
13143
13166
|
return e.id = "submit-icon", e;
|
13144
13167
|
}
|
13145
13168
|
}, {
|
@@ -13171,7 +13194,7 @@ var bn = /*#__PURE__*/function (_ze) {
|
|
13171
13194
|
var _this73$addButtonsAnd = _this73.addButtonsAndTheirEvents(t),
|
13172
13195
|
r = _this73$addButtonsAnd.captureButton,
|
13173
13196
|
o = _this73$addButtonsAnd.submitButton;
|
13174
|
-
_this73._captureButton = r, _this73._submitButton = o, _this73._captureIcon = _this73._captureButton.children[0], _this73._refreshIcon =
|
13197
|
+
_this73._captureButton = r, _this73._submitButton = o, _this73._captureIcon = _this73._captureButton.children[0], _this73._refreshIcon = Y.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;
|
13175
13198
|
return _this73;
|
13176
13199
|
}
|
13177
13200
|
_inherits(bn, _ze);
|
@@ -13286,6 +13309,7 @@ var mi = /*#__PURE__*/function (_Bt5) {
|
|
13286
13309
|
i && _this77.addClickEvent(e, t, i.modalContainerStyle, i.files), _this77.elementRef.classList.add("upload-file-button"), _this77.elementRef.appendChild(n.styles), _this77.reapplyStateStyle("styles");
|
13287
13310
|
return _this77;
|
13288
13311
|
}
|
13312
|
+
// need to know if the button is going to be stored inside a menu
|
13289
13313
|
_inherits(mi, _Bt5);
|
13290
13314
|
return _createClass(mi, [{
|
13291
13315
|
key: "createInnerElements",
|
@@ -13297,7 +13321,7 @@ var mi = /*#__PURE__*/function (_Bt5) {
|
|
13297
13321
|
}, {
|
13298
13322
|
key: "createInnerElement",
|
13299
13323
|
value: function createInnerElement(e, t, i) {
|
13300
|
-
return
|
13324
|
+
return Z.createSpecificStateElement(this.elementRef, t, i) || e;
|
13301
13325
|
}
|
13302
13326
|
}, {
|
13303
13327
|
key: "addClickEvent",
|
@@ -13316,7 +13340,7 @@ var mi = /*#__PURE__*/function (_Bt5) {
|
|
13316
13340
|
}, {
|
13317
13341
|
key: "createSVGIconElement",
|
13318
13342
|
value: function createSVGIconElement() {
|
13319
|
-
var e =
|
13343
|
+
var e = Y.createSVGElement(ua);
|
13320
13344
|
return e.id = "camera-icon", e;
|
13321
13345
|
}
|
13322
13346
|
}]);
|
@@ -13355,7 +13379,7 @@ var _t = /*#__PURE__*/function () {
|
|
13355
13379
|
button: new oa(_d, t.recordAudio)
|
13356
13380
|
};
|
13357
13381
|
}
|
13358
|
-
return
|
13382
|
+
return xe.isEnabled(r, e.dragAndDrop) && xe.create(i, r, e.dragAndDrop), r;
|
13359
13383
|
}
|
13360
13384
|
// prettier-ignore
|
13361
13385
|
}], [{
|
@@ -13388,9 +13412,9 @@ var _t = /*#__PURE__*/function () {
|
|
13388
13412
|
}, {
|
13389
13413
|
key: "addElements",
|
13390
13414
|
value: function addElements(e, t, i, n, r, o) {
|
13391
|
-
|
13415
|
+
U.addElements(e, t.elementRef);
|
13392
13416
|
var a = ht.create(),
|
13393
|
-
l =
|
13417
|
+
l = q.addButtons(a, i, n, o);
|
13394
13418
|
on.set(t.inputElementRef, a, r.elementRef, l), ht.add(e, a);
|
13395
13419
|
}
|
13396
13420
|
}]);
|
@@ -13407,7 +13431,7 @@ var vn = /*#__PURE__*/function () {
|
|
13407
13431
|
var r = new ke(e, t, i);
|
13408
13432
|
t.websocket && V.createConnection(t, r);
|
13409
13433
|
var o = new _t(e, r, t, n);
|
13410
|
-
return
|
13434
|
+
return U.addElements(n, r.elementRef, o.elementRef), n;
|
13411
13435
|
}
|
13412
13436
|
}, {
|
13413
13437
|
key: "render",
|
@@ -13454,7 +13478,7 @@ var y = /*#__PURE__*/function (_Xi) {
|
|
13454
13478
|
key: "onRender",
|
13455
13479
|
value: function onRender() {
|
13456
13480
|
var _this$_childElement;
|
13457
|
-
Xt.attemptAppendStyleSheetToHead(this.style),
|
13481
|
+
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 H) || 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 H && D.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, Qt.onRender(this);
|
13458
13482
|
}
|
13459
13483
|
}, {
|
13460
13484
|
key: "disconnectedCallback",
|