deep-chat-dev 9.0.135 → 9.0.136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +12980 -12866
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.d.ts +4 -3
- package/dist/deepChat.d.ts.map +1 -1
- package/dist/deepChat.js +642 -589
- package/dist/services/serviceIO.d.ts +2 -2
- package/dist/services/serviceIO.d.ts.map +1 -1
- package/dist/services/utils/baseServiceIO.d.ts +2 -2
- package/dist/services/utils/baseServiceIO.d.ts.map +1 -1
- package/dist/services/utils/directServiceIO.d.ts +1 -1
- package/dist/types/messages.d.ts +2 -2
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/types/microphone.d.ts +4 -0
- package/dist/types/microphone.d.ts.map +1 -1
- package/dist/utils/HTTP/requestUtils.d.ts +1 -1
- package/dist/utils/events/fireEvents.d.ts +1 -1
- package/dist/utils/events/fireEvents.d.ts.map +1 -1
- package/dist/utils/legacy/legacy.d.ts +5 -1
- package/dist/utils/legacy/legacy.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/microphone/speechToText.d.ts +5 -0
- package/dist/views/chat/input/buttons/microphone/speechToText.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/submit/submitButton.d.ts.map +1 -1
- package/dist/views/chat/messages/fileMessageUtils.d.ts +1 -1
- package/dist/views/chat/messages/messages.d.ts +2 -1
- package/dist/views/chat/messages/messages.d.ts.map +1 -1
- package/dist/views/chat/messages/messagesBase.d.ts +2 -2
- package/dist/views/chat/messages/messagesBase.d.ts.map +1 -1
- package/package.json +2 -4
package/dist/deepChat.js
CHANGED
@@ -40,11 +40,11 @@ var _s = /*#__PURE__*/function () {
|
|
40
40
|
}]);
|
41
41
|
return _s;
|
42
42
|
}();
|
43
|
-
var
|
44
|
-
function
|
45
|
-
_classCallCheck(this,
|
43
|
+
var zt = /*#__PURE__*/function () {
|
44
|
+
function zt() {
|
45
|
+
_classCallCheck(this, zt);
|
46
46
|
}
|
47
|
-
_createClass(
|
47
|
+
_createClass(zt, null, [{
|
48
48
|
key: "onLoad",
|
49
49
|
value: function onLoad(e) {
|
50
50
|
e.innerHTML = '<div id="large-loading-ring"></div>';
|
@@ -58,16 +58,16 @@ var Bt = /*#__PURE__*/function () {
|
|
58
58
|
}, {
|
59
59
|
key: "render",
|
60
60
|
value: function render(e, t, i) {
|
61
|
-
var n =
|
61
|
+
var n = zt.createElements(),
|
62
62
|
r = {
|
63
63
|
onSuccess: t,
|
64
64
|
onFail: _s.render.bind(this, e, "Your 'key' has failed authentication"),
|
65
|
-
onLoad:
|
65
|
+
onLoad: zt.onLoad.bind(this, n)
|
66
66
|
};
|
67
67
|
i.key && i.verifyKey(i.key, r), e.replaceChildren(n);
|
68
68
|
}
|
69
69
|
}]);
|
70
|
-
return
|
70
|
+
return zt;
|
71
71
|
}();
|
72
72
|
var C = /*#__PURE__*/function () {
|
73
73
|
function C() {
|
@@ -135,17 +135,17 @@ var C = /*#__PURE__*/function () {
|
|
135
135
|
}]);
|
136
136
|
return C;
|
137
137
|
}();
|
138
|
-
var
|
139
|
-
function
|
140
|
-
_classCallCheck(this,
|
138
|
+
var Hn = /*#__PURE__*/function () {
|
139
|
+
function Ft() {
|
140
|
+
_classCallCheck(this, Ft);
|
141
141
|
}
|
142
|
-
_createClass(
|
142
|
+
_createClass(Ft, null, [{
|
143
143
|
key: "apply",
|
144
144
|
value: function apply(e, t) {
|
145
145
|
if (t) try {
|
146
|
-
|
146
|
+
Ft.applyStyleSheet(e, t);
|
147
147
|
} catch (_unused) {
|
148
|
-
|
148
|
+
Ft.addStyleElement(e, t);
|
149
149
|
}
|
150
150
|
}
|
151
151
|
}, {
|
@@ -163,12 +163,12 @@ var qn = /*#__PURE__*/function () {
|
|
163
163
|
}, {
|
164
164
|
key: "applyDefaultStyleToComponent",
|
165
165
|
value: function applyDefaultStyleToComponent(e, t) {
|
166
|
-
t && C.applyToStyleIfNotDefined(e, t), C.applyToStyleIfNotDefined(e,
|
166
|
+
t && C.applyToStyleIfNotDefined(e, t), C.applyToStyleIfNotDefined(e, Ft.DEFAULT_COMPONENT_STYLE);
|
167
167
|
}
|
168
168
|
}]);
|
169
|
-
return
|
169
|
+
return Ft;
|
170
170
|
}();
|
171
|
-
|
171
|
+
Hn.DEFAULT_COMPONENT_STYLE = {
|
172
172
|
height: "350px",
|
173
173
|
width: "320px",
|
174
174
|
border: "1px solid #cacaca",
|
@@ -182,7 +182,7 @@ qn.DEFAULT_COMPONENT_STYLE = {
|
|
182
182
|
// this is also causing the chat to squeeze when there is no space
|
183
183
|
overflow: "hidden"
|
184
184
|
};
|
185
|
-
var
|
185
|
+
var Mi = Hn;
|
186
186
|
var R = /* @__PURE__ */function (s) {
|
187
187
|
return s.ESCAPE = "Escape", s.ENTER = "Enter", s.TAB = "Tab", s.ARROW_UP = "ArrowUp", s.ARROW_DOWN = "ArrowDown", s.ARROW_RIGHT = "ArrowRight", s.ARROW_LEFT = "ArrowLeft", s.BACKSPACE = "Backspace", s.DELETE = "Delete", s.META = "Meta", s.CONTROL = "Control", s;
|
188
188
|
}(R || {});
|
@@ -191,7 +191,7 @@ var xe = /*#__PURE__*/_createClass(function xe() {
|
|
191
191
|
});
|
192
192
|
xe.IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
193
193
|
xe.IS_CHROMIUM = window.chrome;
|
194
|
-
var
|
194
|
+
var qn = /*#__PURE__*/function () {
|
195
195
|
function rt() {
|
196
196
|
_classCallCheck(this, rt);
|
197
197
|
}
|
@@ -218,13 +218,13 @@ var Hn = /*#__PURE__*/function () {
|
|
218
218
|
value: function onInput(e, t, i) {
|
219
219
|
var n = i.target,
|
220
220
|
r = n.textContent || "";
|
221
|
-
e !== void 0 && r.length > e && (n.textContent = r.substring(0, e),
|
221
|
+
e !== void 0 && r.length > e && (n.textContent = r.substring(0, e), ni.focusEndOfInput(n)), t == null || t();
|
222
222
|
}
|
223
223
|
}]);
|
224
224
|
return rt;
|
225
225
|
}();
|
226
|
-
|
227
|
-
var Ss =
|
226
|
+
qn.PERMITTED_KEYS = /* @__PURE__ */new Set([R.BACKSPACE, R.DELETE, R.ARROW_RIGHT, R.ARROW_LEFT, R.ARROW_DOWN, R.ARROW_UP, R.META, R.CONTROL, R.ENTER]);
|
227
|
+
var Ss = qn;
|
228
228
|
var ws = /*#__PURE__*/function () {
|
229
229
|
function ws() {
|
230
230
|
_classCallCheck(this, ws);
|
@@ -338,11 +338,11 @@ var Gn = /*#__PURE__*/function () {
|
|
338
338
|
}();
|
339
339
|
Gn.TEXT_INPUT_ID = "text-input";
|
340
340
|
var Gi = Gn;
|
341
|
-
var
|
342
|
-
function
|
343
|
-
_classCallCheck(this,
|
341
|
+
var ni = /*#__PURE__*/function () {
|
342
|
+
function ni() {
|
343
|
+
_classCallCheck(this, ni);
|
344
344
|
}
|
345
|
-
_createClass(
|
345
|
+
_createClass(ni, null, [{
|
346
346
|
key: "focusEndOfInput",
|
347
347
|
value: function focusEndOfInput(e) {
|
348
348
|
var t = document.createRange();
|
@@ -354,10 +354,10 @@ var ii = /*#__PURE__*/function () {
|
|
354
354
|
key: "focusFromParentElement",
|
355
355
|
value: function focusFromParentElement(e) {
|
356
356
|
var t = e.querySelector("#".concat(Gi.TEXT_INPUT_ID));
|
357
|
-
t &&
|
357
|
+
t && ni.focusEndOfInput(t);
|
358
358
|
}
|
359
359
|
}]);
|
360
|
-
return
|
360
|
+
return ni;
|
361
361
|
}();
|
362
362
|
function an(s) {
|
363
363
|
return s.charAt(0).toUpperCase() + s.slice(1);
|
@@ -467,12 +467,12 @@ var Jn = /*#__PURE__*/function () {
|
|
467
467
|
return $n;
|
468
468
|
}();
|
469
469
|
Jn.LOAD_VOICES_MS = 200;
|
470
|
-
var
|
471
|
-
var
|
472
|
-
function
|
473
|
-
_classCallCheck(this,
|
470
|
+
var Bt = Jn;
|
471
|
+
var se = /*#__PURE__*/function () {
|
472
|
+
function se() {
|
473
|
+
_classCallCheck(this, se);
|
474
474
|
}
|
475
|
-
_createClass(
|
475
|
+
_createClass(se, null, [{
|
476
476
|
key: "checkForContainerStyles",
|
477
477
|
value: function checkForContainerStyles(e, t) {
|
478
478
|
var i = e.containerStyle;
|
@@ -519,27 +519,36 @@ var ce = /*#__PURE__*/function () {
|
|
519
519
|
key: "processConnect",
|
520
520
|
value: function processConnect(e) {
|
521
521
|
var t = e;
|
522
|
-
t.request && (t.connect ? Object.assign(t.connect, t.request) : t.connect = t.request, console.error("The request property is deprecated since version 1.5.0."), console.error("Please see the
|
522
|
+
t.request && (t.connect ? Object.assign(t.connect, t.request) : t.connect = t.request, console.error("The request property is deprecated since version 1.5.0."), console.error("Please see the connect object: https://deepchat.dev/docs/connect#connect-1"));
|
523
523
|
}
|
524
524
|
}, {
|
525
525
|
key: "checkForStream",
|
526
526
|
value: function checkForStream(e) {
|
527
527
|
var t = e.stream;
|
528
|
-
if (t) return console.error("The stream property has been moved to the connect object in version 1.5.0."), console.error("Please see the
|
528
|
+
if (t) return console.error("The stream property has been moved to the connect object in version 1.5.0."), console.error("Please see the connect object: https://deepchat.dev/docs/connect#connect-1"), t;
|
529
|
+
}
|
530
|
+
}, {
|
531
|
+
key: "fireOnNewMessage",
|
532
|
+
value: function fireOnNewMessage(e, t) {
|
533
|
+
var n;
|
534
|
+
var i = e;
|
535
|
+
i.onNewMessage && (console.error("The onNewMessage event has deprecated since version 1.5.0."), console.error("Please see the onMessage event: https://deepchat.dev/docs/events#onMessage"), (n = i.onNewMessage) == null || n.call(i, t)), e.dispatchEvent(new CustomEvent("new-message", {
|
536
|
+
detail: t
|
537
|
+
}));
|
529
538
|
}
|
530
539
|
}]);
|
531
|
-
return
|
540
|
+
return se;
|
532
541
|
}();
|
533
542
|
var ks = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8c3ZnIGZpbGw9IiMwMDAwMDAiIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIAoJCXZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+Cgk8cGF0aCBkPSJNMjMsMzAuMzZIOWMtMi40MDQsMC00LjM2LTEuOTU2LTQuMzYtNC4zNlYxNWMwLTIuNDA0LDEuOTU2LTQuMzYsNC4zNi00LjM2aDMuNjU5CgkJYzAuMTY3LTEuNTY2LDEuNDE1LTIuODEzLDIuOTgxLTIuOTgxVjUuMzMzYy0xLjEzMS0wLjE3NC0yLTEuMTU0LTItMi4zMzNjMC0xLjMwMSwxLjA1OS0yLjM2LDIuMzYtMi4zNgoJCWMxLjMwMiwwLDIuMzYsMS4wNTksMi4zNiwyLjM2YzAsMS4xNzktMC44NjksMi4xNTktMiwyLjMzM1Y3LjY2YzEuNTY2LDAuMTY3LDIuODE0LDEuNDE1LDIuOTgxLDIuOTgxSDIzCgkJYzIuNDA0LDAsNC4zNiwxLjk1Niw0LjM2LDQuMzZ2MTFDMjcuMzYsMjguNDA0LDI1LjQwNCwzMC4zNiwyMywzMC4zNnogTTksMTEuMzZjLTIuMDA3LDAtMy42NCwxLjYzMy0zLjY0LDMuNjR2MTEKCQljMCwyLjAwNywxLjYzMywzLjY0LDMuNjQsMy42NGgxNGMyLjAwNywwLDMuNjQtMS42MzMsMy42NC0zLjY0VjE1YzAtMi4wMDctMS42MzMtMy42NC0zLjY0LTMuNjRIOXogTTEzLjM4NCwxMC42NGg1LjIzMQoJCUMxOC40MzksOS4zNTQsMTcuMzM0LDguMzYsMTYsOC4zNkMxNC42NjcsOC4zNiwxMy41NjEsOS4zNTQsMTMuMzg0LDEwLjY0eiBNMTYsMS4zNmMtMC45MDQsMC0xLjY0LDAuNzM2LTEuNjQsMS42NAoJCVMxNS4wOTYsNC42NCwxNiw0LjY0YzAuOTA0LDAsMS42NC0wLjczNiwxLjY0LTEuNjRTMTYuOTA0LDEuMzYsMTYsMS4zNnogTTIwLDI3LjM2aC04Yy0xLjMwMSwwLTIuMzYtMS4wNTktMi4zNi0yLjM2CgkJczEuMDU5LTIuMzYsMi4zNi0yLjM2aDhjMS4zMDIsMCwyLjM2LDEuMDU5LDIuMzYsMi4zNlMyMS4zMDIsMjcuMzYsMjAsMjcuMzZ6IE0xMiwyMy4zNmMtMC45MDQsMC0xLjY0LDAuNzM1LTEuNjQsMS42NAoJCXMwLjczNiwxLjY0LDEuNjQsMS42NGg4YzAuOTA0LDAsMS42NC0wLjczNSwxLjY0LTEuNjRzLTAuNzM1LTEuNjQtMS42NC0xLjY0SDEyeiBNMzEsMjMuODZoLTJjLTAuMTk5LDAtMC4zNi0wLjE2MS0wLjM2LTAuMzZWMTUKCQljMC0wLjE5OSwwLjE2MS0wLjM2LDAuMzYtMC4zNmgyYzAuMTk5LDAsMC4zNiwwLjE2MSwwLjM2LDAuMzZ2OC41QzMxLjM2LDIzLjY5OSwzMS4xOTksMjMuODYsMzEsMjMuODZ6IE0yOS4zNiwyMy4xNGgxLjI3OXYtNy43OAoJCUgyOS4zNlYyMy4xNHogTTMsMjMuODZIMWMtMC4xOTksMC0wLjM2LTAuMTYxLTAuMzYtMC4zNlYxNWMwLTAuMTk5LDAuMTYxLTAuMzYsMC4zNi0wLjM2aDJjMC4xOTksMCwwLjM2LDAuMTYxLDAuMzYsMC4zNnY4LjUKCQlDMy4zNiwyMy42OTksMy4xOTksMjMuODYsMywyMy44NnogTTEuMzYsMjMuMTRoMS4yOHYtNy43OEgxLjM2VjIzLjE0eiBNMjAsMjAuMzZjLTEuMzAyLDAtMi4zNi0xLjA1OS0yLjM2LTIuMzYKCQlzMS4wNTktMi4zNiwyLjM2LTIuMzZzMi4zNiwxLjA1OSwyLjM2LDIuMzZDMjIuMzYsMTkuMzAyLDIxLjMwMiwyMC4zNiwyMCwyMC4zNnogTTIwLDE2LjM2Yy0wLjkwNCwwLTEuNjQsMC43MzYtMS42NCwxLjY0CgkJczAuNzM1LDEuNjQsMS42NCwxLjY0czEuNjQtMC43MzUsMS42NC0xLjY0UzIwLjkwNCwxNi4zNiwyMCwxNi4zNnogTTEyLDIwLjM2Yy0xLjMwMSwwLTIuMzYtMS4wNTktMi4zNi0yLjM2czEuMDU5LTIuMzYsMi4zNi0yLjM2CgkJczIuMzYsMS4wNTksMi4zNiwyLjM2QzE0LjM2LDE5LjMwMiwxMy4zMDEsMjAuMzYsMTIsMjAuMzZ6IE0xMiwxNi4zNmMtMC45MDQsMC0xLjY0LDAuNzM2LTEuNjQsMS42NHMwLjczNiwxLjY0LDEuNjQsMS42NAoJCXMxLjY0LTAuNzM1LDEuNjQtMS42NFMxMi45MDQsMTYuMzYsMTIsMTYuMzZ6Ii8+Cgk8cmVjdCBzdHlsZT0iZmlsbDpub25lOyIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIi8+Cjwvc3ZnPg==",
|
534
543
|
Is = "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==",
|
535
544
|
Kn = /*#__PURE__*/function () {
|
536
|
-
function
|
537
|
-
_classCallCheck(this,
|
545
|
+
function oe() {
|
546
|
+
_classCallCheck(this, oe);
|
538
547
|
}
|
539
|
-
_createClass(
|
548
|
+
_createClass(oe, null, [{
|
540
549
|
key: "hide",
|
541
550
|
value: function hide(e) {
|
542
|
-
e.getElementsByClassName(
|
551
|
+
e.getElementsByClassName(oe.CONTAINER_CLASS)[0].style.visibility = "hidden";
|
543
552
|
}
|
544
553
|
}, {
|
545
554
|
key: "applyCustomStylesToElements",
|
@@ -550,10 +559,10 @@ var ks = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNv
|
|
550
559
|
key: "applyCustomStyles",
|
551
560
|
value: function applyCustomStyles(e, t, i, n) {
|
552
561
|
var r, o, a, l;
|
553
|
-
if ((r = i["default"]) != null && r.styles &&
|
554
|
-
(a = i.ai) != null && a.styles &&
|
562
|
+
if ((r = i["default"]) != null && r.styles && oe.applyCustomStylesToElements(e, t, i["default"].styles), n === b.USER_ROLE) (o = i.user) != null && o.styles && oe.applyCustomStylesToElements(e, t, i.user.styles);else {
|
563
|
+
(a = i.ai) != null && a.styles && oe.applyCustomStylesToElements(e, t, i.ai.styles);
|
555
564
|
var c = (l = i[n]) == null ? void 0 : l.styles;
|
556
|
-
c &&
|
565
|
+
c && oe.applyCustomStylesToElements(e, t, c);
|
557
566
|
}
|
558
567
|
}
|
559
568
|
}, {
|
@@ -563,7 +572,7 @@ var ks = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNv
|
|
563
572
|
var i = document.createElement("img");
|
564
573
|
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) || Is : 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) || ks, i.classList.add("avatar");
|
565
574
|
var n = document.createElement("div");
|
566
|
-
return n.classList.add(
|
575
|
+
return n.classList.add(oe.CONTAINER_CLASS), n.appendChild(i), t && oe.applyCustomStyles(n, i, t, e), n;
|
567
576
|
}
|
568
577
|
}, {
|
569
578
|
key: "getPosition",
|
@@ -577,12 +586,12 @@ var ks = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNv
|
|
577
586
|
key: "add",
|
578
587
|
value: function add(e, t, i) {
|
579
588
|
var n = typeof i == "boolean" ? void 0 : i,
|
580
|
-
r =
|
581
|
-
o =
|
589
|
+
r = oe.createAvatar(t, n),
|
590
|
+
o = oe.getPosition(t, n);
|
582
591
|
r.classList.add(o === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(o === "left" ? "beforebegin" : "afterend", r);
|
583
592
|
}
|
584
593
|
}]);
|
585
|
-
return
|
594
|
+
return oe;
|
586
595
|
}();
|
587
596
|
Kn.CONTAINER_CLASS = "avatar-container";
|
588
597
|
var cn = Kn;
|
@@ -634,7 +643,7 @@ var Yn = /*#__PURE__*/function () {
|
|
634
643
|
}();
|
635
644
|
Yn.NAME_CLASS = "name";
|
636
645
|
var dn = Yn;
|
637
|
-
var
|
646
|
+
var si = /*#__PURE__*/function () {
|
638
647
|
function Me() {
|
639
648
|
_classCallCheck(this, Me);
|
640
649
|
}
|
@@ -726,10 +735,10 @@ var ni = /*#__PURE__*/function () {
|
|
726
735
|
}]);
|
727
736
|
return Me;
|
728
737
|
}();
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
var b =
|
738
|
+
si.AI_ROLE = "ai";
|
739
|
+
si.USER_ROLE = "user";
|
740
|
+
si.EMPTY_MESSAGE_CLASS = "empty-message";
|
741
|
+
var b = si;
|
733
742
|
var Le = /*#__PURE__*/function () {
|
734
743
|
function Le() {
|
735
744
|
_classCallCheck(this, Le);
|
@@ -846,7 +855,7 @@ var Ee = /*#__PURE__*/function () {
|
|
846
855
|
var o = i.getElementsByClassName(r);
|
847
856
|
Array.from(o || []).forEach(function (a) {
|
848
857
|
var l = Ee.getProcessedStyles(t, a, r);
|
849
|
-
|
858
|
+
ce.applyStylesToElement(a, l), Ee.applyEvents(a, r);
|
850
859
|
});
|
851
860
|
});
|
852
861
|
var n = i.getElementsByClassName(Rs);
|
@@ -857,11 +866,11 @@ var Ee = /*#__PURE__*/function () {
|
|
857
866
|
}]);
|
858
867
|
return Ee;
|
859
868
|
}();
|
860
|
-
var
|
861
|
-
function
|
862
|
-
_classCallCheck(this,
|
869
|
+
var ce = /*#__PURE__*/function () {
|
870
|
+
function ce() {
|
871
|
+
_classCallCheck(this, ce);
|
863
872
|
}
|
864
|
-
_createClass(
|
873
|
+
_createClass(ce, null, [{
|
865
874
|
key: "applyStylesToElement",
|
866
875
|
value: function applyStylesToElement(e, t) {
|
867
876
|
var i = C.processStateful(t, {}, {});
|
@@ -880,7 +889,7 @@ var le = /*#__PURE__*/function () {
|
|
880
889
|
value: function applyClassUtilitiesToElement(e, t) {
|
881
890
|
var i = t.events,
|
882
891
|
n = t.styles;
|
883
|
-
i &&
|
892
|
+
i && ce.applyEventsToElement(e, i), n && !Ee.doesElementContainDeepChatClass(e) && ce.applyStylesToElement(e, n);
|
884
893
|
}
|
885
894
|
}, {
|
886
895
|
key: "applyCustomClassUtilities",
|
@@ -888,17 +897,17 @@ var le = /*#__PURE__*/function () {
|
|
888
897
|
Object.keys(e).forEach(function (i) {
|
889
898
|
var n = t.getElementsByClassName(i);
|
890
899
|
Array.from(n).forEach(function (r) {
|
891
|
-
e[i] &&
|
900
|
+
e[i] && ce.applyClassUtilitiesToElement(r, e[i]);
|
892
901
|
});
|
893
902
|
});
|
894
903
|
}
|
895
904
|
}, {
|
896
905
|
key: "apply",
|
897
906
|
value: function apply(e, t) {
|
898
|
-
Ee.applyDeepChatUtilities(e, e.htmlClassUtilities, t),
|
907
|
+
Ee.applyDeepChatUtilities(e, e.htmlClassUtilities, t), ce.applyCustomClassUtilities(e.htmlClassUtilities, t);
|
899
908
|
}
|
900
909
|
}]);
|
901
|
-
return
|
910
|
+
return ce;
|
902
911
|
}();
|
903
912
|
var Qe = /*#__PURE__*/function () {
|
904
913
|
function Qe() {
|
@@ -920,7 +929,7 @@ var Qe = /*#__PURE__*/function () {
|
|
920
929
|
value: function overwrite(e, t, i, n) {
|
921
930
|
var r = e.messages,
|
922
931
|
o = b.overwriteMessage(r, n, t, i, "html", "html-message");
|
923
|
-
return o && (o.bubbleElement.innerHTML = t,
|
932
|
+
return o && (o.bubbleElement.innerHTML = t, ce.apply(e, o.outerContainer), se.flagHTMLUpdateClass(o.bubbleElement)), o;
|
924
933
|
}
|
925
934
|
// prettier-ignore
|
926
935
|
}, {
|
@@ -933,7 +942,7 @@ var Qe = /*#__PURE__*/function () {
|
|
933
942
|
r.status = !1;
|
934
943
|
}
|
935
944
|
var o = Qe.createElements(e, t, i);
|
936
|
-
return b.fillEmptyMessageElement(o.bubbleElement, t),
|
945
|
+
return b.fillEmptyMessageElement(o.bubbleElement, t), ce.apply(e, o.outerContainer), se.flagHTMLUpdateClass(o.bubbleElement), e.applyCustomStyles(o, i, !1, (a = e.messageStyles) == null ? void 0 : a.html), Qe.addElement(e, o.outerContainer), o;
|
937
946
|
}
|
938
947
|
}]);
|
939
948
|
return Qe;
|
@@ -991,11 +1000,11 @@ var Bs = /[&<>"]/,
|
|
991
1000
|
">": ">",
|
992
1001
|
'"': """
|
993
1002
|
};
|
994
|
-
function
|
1003
|
+
function Hs(s) {
|
995
1004
|
return Us[s];
|
996
1005
|
}
|
997
1006
|
function U(s) {
|
998
|
-
return Bs.test(s) ? s.replace(zs,
|
1007
|
+
return Bs.test(s) ? s.replace(zs, Hs) : s;
|
999
1008
|
}
|
1000
1009
|
var g = {};
|
1001
1010
|
g.blockquote_open = function () {
|
@@ -1303,7 +1312,7 @@ W.prototype.disable = function (s) {
|
|
1303
1312
|
W.prototype.getRules = function (s) {
|
1304
1313
|
return this.__cache__ === null && this.__compile__(), this.__cache__[s] || [];
|
1305
1314
|
};
|
1306
|
-
function
|
1315
|
+
function qs(s) {
|
1307
1316
|
s.inlineMode ? s.tokens.push({
|
1308
1317
|
type: "inline",
|
1309
1318
|
content: s.src.replace(/\n/g, " ").trim(),
|
@@ -1511,7 +1520,7 @@ function Ks(s) {
|
|
1511
1520
|
}
|
1512
1521
|
}
|
1513
1522
|
var hn = " \n()[]'\".,!?-";
|
1514
|
-
function
|
1523
|
+
function Ti(s) {
|
1515
1524
|
return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1");
|
1516
1525
|
}
|
1517
1526
|
function Ys(s) {
|
@@ -1529,11 +1538,11 @@ function Ys(s) {
|
|
1529
1538
|
h,
|
1530
1539
|
p = s.tokens;
|
1531
1540
|
if (s.env.abbreviations) {
|
1532
|
-
for (s.env.abbrRegExp || (h = "(^|[" + hn.split("").map(
|
1541
|
+
for (s.env.abbrRegExp || (h = "(^|[" + hn.split("").map(Ti).join("") + "])(" + Object.keys(s.env.abbreviations).map(function (m) {
|
1533
1542
|
return m.substr(1);
|
1534
1543
|
}).sort(function (m, f) {
|
1535
1544
|
return f.length - m.length;
|
1536
|
-
}).map(
|
1545
|
+
}).map(Ti).join("|") + ")($|[" + hn.split("").map(Ti).join("") + "])", s.env.abbrRegExp = new RegExp(h, "g")), d = s.env.abbrRegExp, t = 0, i = p.length; t < i; t++) if (p[t].type === "inline") {
|
1537
1546
|
for (n = p[t].children, e = n.length - 1; e >= 0; e--) if (r = n[e], r.type === "text") {
|
1538
1547
|
for (l = 0, o = r.content, d.lastIndex = 0, c = r.level, a = []; u = d.exec(o);) d.lastIndex > l && a.push({
|
1539
1548
|
type: "text",
|
@@ -1586,7 +1595,7 @@ var ir = /['"]/,
|
|
1586
1595
|
function mn(s, e) {
|
1587
1596
|
return e < 0 || e >= s.length ? !1 : !nr.test(s[e]);
|
1588
1597
|
}
|
1589
|
-
function
|
1598
|
+
function qe(s, e, t) {
|
1590
1599
|
return s.substr(0, e) + t + s.substr(e + 1);
|
1591
1600
|
}
|
1592
1601
|
function sr(s) {
|
@@ -1598,12 +1607,12 @@ function sr(s) {
|
|
1598
1607
|
S.length = p + 1, i = t.content, r = 0, o = i.length;
|
1599
1608
|
e: for (; r < o && (pn.lastIndex = r, n = pn.exec(i), !!n);) {
|
1600
1609
|
if (l = !mn(i, n.index - 1), r = n.index + 1, m = n[0] === "'", c = !mn(i, r), !c && !l) {
|
1601
|
-
m && (t.content =
|
1610
|
+
m && (t.content = qe(t.content, n.index, fn));
|
1602
1611
|
continue;
|
1603
1612
|
}
|
1604
1613
|
if (u = !c, h = !l, h) {
|
1605
1614
|
for (p = S.length - 1; p >= 0 && (d = S[p], !(S[p].level < a)); p--) if (d.single === m && S[p].level === a) {
|
1606
|
-
d = S[p], m ? (x[d.token].content =
|
1615
|
+
d = S[p], m ? (x[d.token].content = qe(x[d.token].content, d.pos, s.options.quotes[2]), t.content = qe(t.content, n.index, s.options.quotes[3])) : (x[d.token].content = qe(x[d.token].content, d.pos, s.options.quotes[0]), t.content = qe(t.content, n.index, s.options.quotes[1])), S.length = p;
|
1607
1616
|
continue e;
|
1608
1617
|
}
|
1609
1618
|
}
|
@@ -1612,16 +1621,16 @@ function sr(s) {
|
|
1612
1621
|
pos: n.index,
|
1613
1622
|
single: m,
|
1614
1623
|
level: a
|
1615
|
-
}) : h && m && (t.content =
|
1624
|
+
}) : h && m && (t.content = qe(t.content, n.index, fn));
|
1616
1625
|
}
|
1617
1626
|
}
|
1618
1627
|
}
|
1619
1628
|
}
|
1620
1629
|
}
|
1621
|
-
var
|
1630
|
+
var Ci = [["block", qs], ["abbr", Vs], ["references", Js], ["inline", $s], ["footnote_tail", Ks], ["abbr2", Ys], ["replacements", tr], ["smartquotes", sr]];
|
1622
1631
|
function ss() {
|
1623
1632
|
this.options = {}, this.ruler = new W();
|
1624
|
-
for (var s = 0; s <
|
1633
|
+
for (var s = 0; s < Ci.length; s++) this.ruler.push(Ci[s][0], Ci[s][1]);
|
1625
1634
|
}
|
1626
1635
|
ss.prototype.process = function (s) {
|
1627
1636
|
var e, t, i;
|
@@ -1813,7 +1822,7 @@ function dr(s, e, t, i) {
|
|
1813
1822
|
J,
|
1814
1823
|
X,
|
1815
1824
|
O,
|
1816
|
-
|
1825
|
+
q,
|
1817
1826
|
Q = !0,
|
1818
1827
|
ee,
|
1819
1828
|
I,
|
@@ -1833,12 +1842,12 @@ function dr(s, e, t, i) {
|
|
1833
1842
|
level: s.level++
|
1834
1843
|
}), n = e, X = !1, ee = s.parser.ruler.getRules("list"); n < t && (S = s.skipSpaces(u), h = s.eMarks[n], S >= h ? p = 1 : p = S - u, p > 4 && (p = 1), p < 1 && (p = 1), r = u - s.bMarks[n] + p, s.tokens.push({
|
1835
1844
|
type: "list_item_open",
|
1836
|
-
lines:
|
1845
|
+
lines: q = [e, 0],
|
1837
1846
|
level: s.level++
|
1838
1847
|
}), 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 || X) && (Q = !1), X = 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({
|
1839
1848
|
type: "list_item_close",
|
1840
1849
|
level: --s.level
|
1841
|
-
}), n = e = s.line,
|
1850
|
+
}), n = e = s.line, q[1] = n, S = s.bMarks[e], !(n >= t || s.isEmpty(n) || s.tShift[n] < s.blkIndent));) {
|
1842
1851
|
for (te = !1, I = 0, Rt = ee.length; I < Rt; I++) if (ee[I](s, n, t, !0)) {
|
1843
1852
|
te = !0;
|
1844
1853
|
break;
|
@@ -1958,14 +1967,14 @@ function br(s, e, t, i) {
|
|
1958
1967
|
content: s.getLines(e, o, 0, !0)
|
1959
1968
|
}), !0;
|
1960
1969
|
}
|
1961
|
-
function
|
1970
|
+
function Ai(s, e) {
|
1962
1971
|
var t = s.bMarks[e] + s.blkIndent,
|
1963
1972
|
i = s.eMarks[e];
|
1964
1973
|
return s.src.substr(t, i - t);
|
1965
1974
|
}
|
1966
1975
|
function vr(s, e, t, i) {
|
1967
1976
|
var n, r, o, a, l, c, d, u, h, p, m;
|
1968
|
-
if (e + 2 > t || (l = e + 1, s.tShift[l] < s.blkIndent) || (o = s.bMarks[l] + s.tShift[l], o >= s.eMarks[l]) || (n = s.src.charCodeAt(o), n !== 124 && n !== 45 && n !== 58) || (r =
|
1977
|
+
if (e + 2 > t || (l = e + 1, s.tShift[l] < s.blkIndent) || (o = s.bMarks[l] + s.tShift[l], o >= s.eMarks[l]) || (n = s.src.charCodeAt(o), n !== 124 && n !== 45 && n !== 58) || (r = Ai(s, e + 1), !/^[-:| ]+$/.test(r)) || (c = r.split("|"), c <= 2)) return !1;
|
1969
1978
|
for (u = [], a = 0; a < c.length; a++) {
|
1970
1979
|
if (h = c[a].trim(), !h) {
|
1971
1980
|
if (a === 0 || a === c.length - 1) continue;
|
@@ -1974,7 +1983,7 @@ function vr(s, e, t, i) {
|
|
1974
1983
|
if (!/^:?-+:?$/.test(h)) return !1;
|
1975
1984
|
h.charCodeAt(h.length - 1) === 58 ? u.push(h.charCodeAt(0) === 58 ? "center" : "right") : h.charCodeAt(0) === 58 ? u.push("left") : u.push("");
|
1976
1985
|
}
|
1977
|
-
if (r =
|
1986
|
+
if (r = Ai(s, e).trim(), r.indexOf("|") === -1 || (c = r.replace(/^\||\|$/g, "").split("|"), u.length !== c.length)) return !1;
|
1978
1987
|
if (i) return !0;
|
1979
1988
|
for (s.tokens.push({
|
1980
1989
|
type: "table_open",
|
@@ -2013,7 +2022,7 @@ function vr(s, e, t, i) {
|
|
2013
2022
|
type: "tbody_open",
|
2014
2023
|
lines: m = [e + 2, 0],
|
2015
2024
|
level: s.level++
|
2016
|
-
}), l = e + 2; l < t && !(s.tShift[l] < s.blkIndent || (r =
|
2025
|
+
}), l = e + 2; l < t && !(s.tShift[l] < s.blkIndent || (r = Ai(s, l).trim(), r.indexOf("|") === -1)); l++) {
|
2017
2026
|
for (c = r.replace(/^\||\|$/g, "").split("|"), s.tokens.push({
|
2018
2027
|
type: "tr_open",
|
2019
2028
|
level: s.level++
|
@@ -2532,8 +2541,8 @@ function zr(s, e) {
|
|
2532
2541
|
})), s.pos = i, s.posMax = o, !0);
|
2533
2542
|
}
|
2534
2543
|
var Ur = ["coap", "doi", "javascript", "aaa", "aaas", "about", "acap", "cap", "cid", "crid", "data", "dav", "dict", "dns", "file", "ftp", "geo", "go", "gopher", "h323", "http", "https", "iax", "icap", "im", "imap", "info", "ipp", "iris", "iris.beep", "iris.xpc", "iris.xpcs", "iris.lwz", "ldap", "mailto", "mid", "msrp", "msrps", "mtqp", "mupdate", "news", "nfs", "ni", "nih", "nntp", "opaquelocktoken", "pop", "pres", "rtsp", "service", "session", "shttp", "sieve", "sip", "sips", "sms", "snmp", "soap.beep", "soap.beeps", "tag", "tel", "telnet", "tftp", "thismessage", "tn3270", "tip", "tv", "urn", "vemmi", "ws", "wss", "xcon", "xcon-userid", "xmlrpc.beep", "xmlrpc.beeps", "xmpp", "z39.50r", "z39.50s", "adiumxtra", "afp", "afs", "aim", "apt", "attachment", "aw", "beshare", "bitcoin", "bolo", "callto", "chrome", "chrome-extension", "com-eventbrite-attendee", "content", "cvs", "dlna-playsingle", "dlna-playcontainer", "dtn", "dvb", "ed2k", "facetime", "feed", "finger", "fish", "gg", "git", "gizmoproject", "gtalk", "hcp", "icon", "ipn", "irc", "irc6", "ircs", "itms", "jar", "jms", "keyparc", "lastfm", "ldaps", "magnet", "maps", "market", "message", "mms", "ms-help", "msnim", "mumble", "mvn", "notes", "oid", "palm", "paparazzi", "platform", "proxy", "psyc", "query", "res", "resource", "rmi", "rsync", "rtmp", "secondlife", "sftp", "sgn", "skype", "smb", "soldat", "spotify", "ssh", "steam", "svn", "teamspeak", "things", "udp", "unreal", "ut2004", "ventrilo", "view-source", "webcal", "wtai", "wyciwyg", "xfire", "xri", "ymsgr"],
|
2535
|
-
|
2536
|
-
|
2544
|
+
Hr = /^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,
|
2545
|
+
qr = /^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;
|
2537
2546
|
function Gr(s, e) {
|
2538
2547
|
var t,
|
2539
2548
|
i,
|
@@ -2541,7 +2550,7 @@ function Gr(s, e) {
|
|
2541
2550
|
r,
|
2542
2551
|
o,
|
2543
2552
|
a = s.pos;
|
2544
|
-
return s.src.charCodeAt(a) !== 60 || (t = s.src.slice(a), t.indexOf(">") < 0) ? !1 : (i = t.match(
|
2553
|
+
return s.src.charCodeAt(a) !== 60 || (t = s.src.slice(a), t.indexOf(">") < 0) ? !1 : (i = t.match(qr), i ? Ur.indexOf(i[1].toLowerCase()) < 0 || (r = i[0].slice(1, -1), o = ji(r), !s.parser.validateLink(r)) ? !1 : (e || (s.push({
|
2545
2554
|
type: "link_open",
|
2546
2555
|
href: o,
|
2547
2556
|
level: s.level
|
@@ -2552,7 +2561,7 @@ function Gr(s, e) {
|
|
2552
2561
|
}), s.push({
|
2553
2562
|
type: "link_close",
|
2554
2563
|
level: s.level
|
2555
|
-
})), s.pos += i[0].length, !0) : (n = t.match(
|
2564
|
+
})), s.pos += i[0].length, !0) : (n = t.match(Hr), n ? (r = n[0].slice(1, -1), o = ji("mailto:" + r), s.parser.validateLink(o) ? (e || (s.push({
|
2556
2565
|
type: "link_open",
|
2557
2566
|
href: o,
|
2558
2567
|
level: s.level
|
@@ -2565,7 +2574,7 @@ function Gr(s, e) {
|
|
2565
2574
|
level: s.level
|
2566
2575
|
})), s.pos += n[0].length, !0) : !1) : !1));
|
2567
2576
|
}
|
2568
|
-
function
|
2577
|
+
function ri(s, e) {
|
2569
2578
|
return s = s.source, e = e || "", function t(i, n) {
|
2570
2579
|
return i ? (n = n.source || n, s = s.replace(i, n), t) : new RegExp(s, e);
|
2571
2580
|
};
|
@@ -2574,15 +2583,15 @@ var Vr = /[a-zA-Z_:][a-zA-Z0-9:._-]*/,
|
|
2574
2583
|
Wr = /[^"'=<>`\x00-\x20]+/,
|
2575
2584
|
Jr = /'[^']*'/,
|
2576
2585
|
$r = /"[^"]*"/,
|
2577
|
-
Kr =
|
2578
|
-
Yr =
|
2579
|
-
Zr =
|
2586
|
+
Kr = ri(/(?:unquoted|single_quoted|double_quoted)/)("unquoted", Wr)("single_quoted", Jr)("double_quoted", $r)(),
|
2587
|
+
Yr = ri(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name", Vr)("attr_value", Kr)(),
|
2588
|
+
Zr = ri(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute", Yr)(),
|
2580
2589
|
Xr = /<\/[A-Za-z][A-Za-z0-9]*\s*>/,
|
2581
2590
|
Qr = /<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,
|
2582
2591
|
eo = /<[?].*?[?]>/,
|
2583
2592
|
to = /<![A-Z]+\s+[^>]*>/,
|
2584
2593
|
io = /<!\[CDATA\[[\s\S]*?\]\]>/,
|
2585
|
-
no =
|
2594
|
+
no = ri(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag", Zr)("close_tag", Xr)("comment", Qr)("processing", eo)("declaration", to)("cdata", io)();
|
2586
2595
|
function so(s) {
|
2587
2596
|
var e = s | 32;
|
2588
2597
|
return e >= 97 && e <= 122;
|
@@ -2617,13 +2626,13 @@ function lo(s, e) {
|
|
2617
2626
|
}
|
2618
2627
|
return e || (s.pending += "&"), s.pos++, !0;
|
2619
2628
|
}
|
2620
|
-
var
|
2621
|
-
function
|
2629
|
+
var ki = [["text", Tr], ["newline", Cr], ["escape", Ar], ["backticks", kr], ["del", Ir], ["ins", Lr], ["mark", Rr], ["emphasis", Nr], ["sub", Pr], ["sup", jr], ["links", Fr], ["footnote_inline", Br], ["footnote_ref", zr], ["autolink", Gr], ["htmltag", ro], ["entity", lo]];
|
2630
|
+
function oi() {
|
2622
2631
|
this.ruler = new W();
|
2623
|
-
for (var s = 0; s <
|
2632
|
+
for (var s = 0; s < ki.length; s++) this.ruler.push(ki[s][0], ki[s][1]);
|
2624
2633
|
this.validateLink = co;
|
2625
2634
|
}
|
2626
|
-
|
2635
|
+
oi.prototype.skipToken = function (s) {
|
2627
2636
|
var e = this.ruler.getRules(""),
|
2628
2637
|
t = e.length,
|
2629
2638
|
i = s.pos,
|
@@ -2639,7 +2648,7 @@ ri.prototype.skipToken = function (s) {
|
|
2639
2648
|
}
|
2640
2649
|
s.pos++, s.cacheSet(i, s.pos);
|
2641
2650
|
};
|
2642
|
-
|
2651
|
+
oi.prototype.tokenize = function (s) {
|
2643
2652
|
for (var e = this.ruler.getRules(""), t = e.length, i = s.posMax, n, r; s.pos < i;) {
|
2644
2653
|
for (r = 0; r < t && (n = e[r](s, !1), !n); r++);
|
2645
2654
|
if (n) {
|
@@ -2650,7 +2659,7 @@ ri.prototype.tokenize = function (s) {
|
|
2650
2659
|
}
|
2651
2660
|
s.pending && s.pushPending();
|
2652
2661
|
};
|
2653
|
-
|
2662
|
+
oi.prototype.parse = function (s, e, t, i) {
|
2654
2663
|
var n = new je(s, this, e, t, i);
|
2655
2664
|
this.tokenize(n);
|
2656
2665
|
};
|
@@ -2777,7 +2786,7 @@ function os(s, e, t) {
|
|
2777
2786
|
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;
|
2778
2787
|
}
|
2779
2788
|
function me(s, e) {
|
2780
|
-
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
|
2789
|
+
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 oi(), this.block = new Ji(), this.core = new ss(), this.renderer = new Wi(), this.ruler = new W(), this.options = {}, this.configure(fo[s]), this.set(e || {});
|
2781
2790
|
}
|
2782
2791
|
me.prototype.set = function (s) {
|
2783
2792
|
Xn(this.options, s);
|
@@ -2902,7 +2911,7 @@ var as = /*#__PURE__*/function () {
|
|
2902
2911
|
t.scrollTop = t.scrollHeight;
|
2903
2912
|
}
|
2904
2913
|
}
|
2905
|
-
// The strategy is to emit the actual file reference in the `
|
2914
|
+
// The strategy is to emit the actual file reference in the `onMessage` event for the user to inspect it
|
2906
2915
|
// But it is not actually used by anything in the chat, hence it is removed when adding a message
|
2907
2916
|
// after the body has been stringified and parsed - the file reference will disappear, hence this readds it
|
2908
2917
|
}, {
|
@@ -2925,22 +2934,22 @@ var as = /*#__PURE__*/function () {
|
|
2925
2934
|
return We;
|
2926
2935
|
}();
|
2927
2936
|
as.DEFAULT_FILE_NAME = "file";
|
2928
|
-
var
|
2929
|
-
var
|
2930
|
-
function
|
2931
|
-
_classCallCheck(this,
|
2937
|
+
var le = as;
|
2938
|
+
var Ut = /*#__PURE__*/function () {
|
2939
|
+
function Ut() {
|
2940
|
+
_classCallCheck(this, Ut);
|
2932
2941
|
}
|
2933
|
-
_createClass(
|
2934
|
-
key: "
|
2935
|
-
value: function
|
2942
|
+
_createClass(Ut, null, [{
|
2943
|
+
key: "onMessage",
|
2944
|
+
value: function onMessage(e, t, i) {
|
2936
2945
|
var r;
|
2937
2946
|
var n = JSON.parse(JSON.stringify({
|
2938
2947
|
message: t,
|
2939
|
-
|
2948
|
+
isHistory: i
|
2940
2949
|
}));
|
2941
|
-
|
2950
|
+
le.reAddFileRefToObject(t, n), (r = e.onMessage) == null || r.call(e, n), e.dispatchEvent(new CustomEvent("message", {
|
2942
2951
|
detail: n
|
2943
|
-
}));
|
2952
|
+
})), se.fireOnNewMessage(e, n);
|
2944
2953
|
}
|
2945
2954
|
}, {
|
2946
2955
|
key: "onClearMessages",
|
@@ -2965,7 +2974,7 @@ var zt = /*#__PURE__*/function () {
|
|
2965
2974
|
}));
|
2966
2975
|
}
|
2967
2976
|
}]);
|
2968
|
-
return
|
2977
|
+
return Ut;
|
2969
2978
|
}();
|
2970
2979
|
var D = /*#__PURE__*/function () {
|
2971
2980
|
function D() {
|
@@ -3021,7 +3030,7 @@ var Ye = /*#__PURE__*/function () {
|
|
3021
3030
|
function Ye(e) {
|
3022
3031
|
var _this3 = this;
|
3023
3032
|
_classCallCheck(this, Ye);
|
3024
|
-
this.messageElementRefs = [], this.messages = [], this.htmlClassUtilities = {}, this.textElementsToText = [], this.elementRef = Ye.createContainerElement(), this.messageStyles = e.messageStyles, this._remarkable = vt.createNew(), this._avatars = e.avatars, this._names = e.names, this.
|
3033
|
+
this.messageElementRefs = [], this.messages = [], this.htmlClassUtilities = {}, this.textElementsToText = [], this.elementRef = Ye.createContainerElement(), this.messageStyles = e.messageStyles, this._remarkable = vt.createNew(), this._avatars = e.avatars, this._names = e.names, this._onMessage = Ut.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), setTimeout(function () {
|
3025
3034
|
_this3.submitUserMessage = e.submitUserMessage;
|
3026
3035
|
});
|
3027
3036
|
}
|
@@ -3105,7 +3114,7 @@ var Ye = /*#__PURE__*/function () {
|
|
3105
3114
|
value: function sendClientUpdate(e) {
|
3106
3115
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
3107
3116
|
var i;
|
3108
|
-
(i = this.
|
3117
|
+
(i = this._onMessage) == null || i.call(this, e, t);
|
3109
3118
|
}
|
3110
3119
|
}, {
|
3111
3120
|
key: "renderText",
|
@@ -3216,7 +3225,7 @@ var Ki = /*#__PURE__*/function () {
|
|
3216
3225
|
var e = this._messages.textElementsToText;
|
3217
3226
|
if (!(this._fileAdded && !this._elements)) {
|
3218
3227
|
if (!this._elements) throw Error(A.NO_VALID_STREAM_EVENTS_SENT);
|
3219
|
-
(t = this._elements.bubbleElement) != null && t.classList.contains(ot.MESSAGE_CLASS) && (this._streamType === "text" ? (e[e.length - 1][1] = this._streamedContent, this._message && (this._message.text = this._streamedContent), this._messages.textToSpeech &&
|
3228
|
+
(t = this._elements.bubbleElement) != null && t.classList.contains(ot.MESSAGE_CLASS) && (this._streamType === "text" ? (e[e.length - 1][1] = this._streamedContent, this._message && (this._message.text = this._streamedContent), this._messages.textToSpeech && Bt.speak(this._streamedContent, this._messages.textToSpeech)) : this._streamType === "html" && (this._streamedContent === ot.HTML_CONTENT_PLACEHOLDER && (this._streamedContent = ((i = this._elements.bubbleElement) == null ? void 0 : i.innerHTML) || ""), this._elements && ce.apply(this._messages, this._elements.outerContainer), this._message && (this._message.html = this._streamedContent)), this._message && this._messages.sendClientUpdate(Ye.createMessageContent(this._message), !1), this._hasStreamEnded = !0);
|
3220
3229
|
}
|
3221
3230
|
}
|
3222
3231
|
}, {
|
@@ -3297,10 +3306,10 @@ var ls = /*#__PURE__*/function () {
|
|
3297
3306
|
}(function (e, t, i, n) {
|
3298
3307
|
var o, a;
|
3299
3308
|
var r = {
|
3300
|
-
method: ((o = e.
|
3309
|
+
method: ((o = e.connectSettings) == null ? void 0 : o.method) || "POST",
|
3301
3310
|
headers: t
|
3302
3311
|
};
|
3303
|
-
return r.method !== "GET" && (r.body = i ? JSON.stringify(n) : n), e.
|
3312
|
+
return r.method !== "GET" && (r.body = i ? JSON.stringify(n) : n), e.connectSettings.credentials && (r.credentials = e.connectSettings.credentials), fetch(((a = e.connectSettings) == null ? void 0 : a.url) || e.url || "", r);
|
3304
3313
|
})
|
3305
3314
|
}, {
|
3306
3315
|
key: "processResponseByType",
|
@@ -3480,7 +3489,7 @@ function Eo(s, e) {
|
|
3480
3489
|
p.accept || (p.accept = Fi);
|
3481
3490
|
var m;
|
3482
3491
|
function f() {
|
3483
|
-
m.abort(), document.hidden ||
|
3492
|
+
m.abort(), document.hidden || q();
|
3484
3493
|
}
|
3485
3494
|
l || document.addEventListener("visibilitychange", f);
|
3486
3495
|
var x = xo,
|
@@ -3493,11 +3502,11 @@ function Eo(s, e) {
|
|
3493
3502
|
});
|
3494
3503
|
var X = c !== null && c !== void 0 ? c : window.fetch,
|
3495
3504
|
O = n !== null && n !== void 0 ? n : _o;
|
3496
|
-
function
|
3497
|
-
return
|
3505
|
+
function q() {
|
3506
|
+
return _q.apply(this, arguments);
|
3498
3507
|
}
|
3499
|
-
function
|
3500
|
-
|
3508
|
+
function _q() {
|
3509
|
+
_q = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
3501
3510
|
var Q, ee, I;
|
3502
3511
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
3503
3512
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -3531,7 +3540,7 @@ function Eo(s, e) {
|
|
3531
3540
|
_context3.t0 = _context3["catch"](1);
|
3532
3541
|
if (!m.signal.aborted) try {
|
3533
3542
|
I = (Q = a == null ? void 0 : a(_context3.t0)) !== null && Q !== void 0 ? Q : x;
|
3534
|
-
window.clearTimeout(S), S = window.setTimeout(
|
3543
|
+
window.clearTimeout(S), S = window.setTimeout(q, I);
|
3535
3544
|
} catch (I) {
|
3536
3545
|
J(), h(I);
|
3537
3546
|
}
|
@@ -3541,9 +3550,9 @@ function Eo(s, e) {
|
|
3541
3550
|
}
|
3542
3551
|
}, _callee3, null, [[1, 14]]);
|
3543
3552
|
}));
|
3544
|
-
return
|
3553
|
+
return _q.apply(this, arguments);
|
3545
3554
|
}
|
3546
|
-
|
3555
|
+
q();
|
3547
3556
|
});
|
3548
3557
|
}
|
3549
3558
|
function _o(s) {
|
@@ -3584,7 +3593,7 @@ var T = /*#__PURE__*/function () {
|
|
3584
3593
|
n = _args6.length > 3 && _args6[3] !== undefined ? _args6[3] : !0;
|
3585
3594
|
r = {
|
3586
3595
|
body: t,
|
3587
|
-
headers: (m = e.
|
3596
|
+
headers: (m = e.connectSettings) == null ? void 0 : m.headers
|
3588
3597
|
};
|
3589
3598
|
_context6.next = 4;
|
3590
3599
|
return v.processRequestInterceptor(e.deepChat, r);
|
@@ -3603,23 +3612,23 @@ var T = /*#__PURE__*/function () {
|
|
3603
3612
|
}
|
3604
3613
|
return _context6.abrupt("return", v.onInterceptorError(i, l, d));
|
3605
3614
|
case 14:
|
3606
|
-
if (!((f = e.
|
3615
|
+
if (!((f = e.connectSettings) != null && f.handler)) {
|
3607
3616
|
_context6.next = 16;
|
3608
3617
|
break;
|
3609
3618
|
}
|
3610
3619
|
return _context6.abrupt("return", pe.stream(e, o, i));
|
3611
3620
|
case 16:
|
3612
|
-
if (!(((x = e.
|
3621
|
+
if (!(((x = e.connectSettings) == null ? void 0 : x.url) === _e.URL)) {
|
3613
3622
|
_context6.next = 18;
|
3614
3623
|
break;
|
3615
3624
|
}
|
3616
3625
|
return _context6.abrupt("return", _e.requestStream(i, e.streamHandlers));
|
3617
3626
|
case 18:
|
3618
3627
|
h = new Oe(i), p = v.fetch.bind(this, e, a, n);
|
3619
|
-
Eo(((S = e.
|
3620
|
-
method: ((J = e.
|
3628
|
+
Eo(((S = e.connectSettings) == null ? void 0 : S.url) || e.url || "", {
|
3629
|
+
method: ((J = e.connectSettings) == null ? void 0 : J.method) || "POST",
|
3621
3630
|
headers: a,
|
3622
|
-
credentials: (X = e.
|
3631
|
+
credentials: (X = e.connectSettings) == null ? void 0 : X.credentials,
|
3623
3632
|
body: n ? JSON.stringify(o) : o,
|
3624
3633
|
openWhenHidden: !0,
|
3625
3634
|
// keep stream open when browser tab not open
|
@@ -3647,7 +3656,7 @@ var T = /*#__PURE__*/function () {
|
|
3647
3656
|
},
|
3648
3657
|
onmessage: function onmessage(O) {
|
3649
3658
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
3650
|
-
var
|
3659
|
+
var q, Q, ee, I, Rt;
|
3651
3660
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
3652
3661
|
while (1) switch (_context5.prev = _context5.next) {
|
3653
3662
|
case 0:
|
@@ -3661,7 +3670,7 @@ var T = /*#__PURE__*/function () {
|
|
3661
3670
|
I = {};
|
3662
3671
|
}
|
3663
3672
|
_context5.next = 4;
|
3664
|
-
return (Q = (
|
3673
|
+
return (Q = (q = e.deepChat).responseInterceptor) == null ? void 0 : Q.call(q, I);
|
3665
3674
|
case 4:
|
3666
3675
|
_context5.t0 = _context5.sent;
|
3667
3676
|
if (_context5.t0) {
|
@@ -3691,8 +3700,8 @@ var T = /*#__PURE__*/function () {
|
|
3691
3700
|
},
|
3692
3701
|
signal: u.signal
|
3693
3702
|
})["catch"](function (O) {
|
3694
|
-
var
|
3695
|
-
i.isLastMessageError() || (
|
3703
|
+
var q;
|
3704
|
+
i.isLastMessageError() || (q = e.extractResultData) == null || q.call(e, O).then(function () {
|
3696
3705
|
v.displayError(i, O);
|
3697
3706
|
})["catch"](function (Q) {
|
3698
3707
|
v.displayError(i, Q);
|
@@ -3850,18 +3859,18 @@ var B = /*#__PURE__*/function () {
|
|
3850
3859
|
_createClass(B, null, [{
|
3851
3860
|
key: "setup",
|
3852
3861
|
value: function setup(e) {
|
3853
|
-
e.
|
3862
|
+
e.connectSettings.url !== _e.URL && (e.permittedErrorPrefixes = ["Connection error", "Error in server message"], e.websocket = "pending");
|
3854
3863
|
}
|
3855
3864
|
}, {
|
3856
3865
|
key: "createConnection",
|
3857
3866
|
value: function createConnection(e, t) {
|
3858
3867
|
if (!document.body.contains(e.deepChat)) return;
|
3859
|
-
var i = e.
|
3868
|
+
var i = e.connectSettings.websocket;
|
3860
3869
|
if (i) {
|
3861
|
-
if (e.
|
3870
|
+
if (e.connectSettings.handler) return pe.websocket(e, t);
|
3862
3871
|
try {
|
3863
3872
|
var n = typeof i != "boolean" ? i : void 0,
|
3864
|
-
r = new WebSocket(e.
|
3873
|
+
r = new WebSocket(e.connectSettings.url || "", n);
|
3865
3874
|
e.websocket = r, e.websocket.onopen = function () {
|
3866
3875
|
var o, a;
|
3867
3876
|
t.removeError(), e.websocket && _typeof(e.websocket) == "object" && B.assignListeners(e, r, t), (a = (o = e.deepChat)._validationHandler) == null || a.call(o);
|
@@ -3969,7 +3978,7 @@ var B = /*#__PURE__*/function () {
|
|
3969
3978
|
case 4:
|
3970
3979
|
o = {
|
3971
3980
|
body: t,
|
3972
|
-
headers: (d = e.
|
3981
|
+
headers: (d = e.connectSettings) == null ? void 0 : d.headers
|
3973
3982
|
};
|
3974
3983
|
_context9.next = 7;
|
3975
3984
|
return v.processRequestInterceptor(e.deepChat, o);
|
@@ -3990,7 +3999,7 @@ var B = /*#__PURE__*/function () {
|
|
3990
3999
|
return _context9.abrupt("return", r.newUserMessage.listener(a));
|
3991
4000
|
case 14:
|
3992
4001
|
c = n ? JSON.stringify(a) : a;
|
3993
|
-
if (!(((u = e.
|
4002
|
+
if (!(((u = e.connectSettings) == null ? void 0 : u.url) === _e.URL)) {
|
3994
4003
|
_context9.next = 17;
|
3995
4004
|
break;
|
3996
4005
|
}
|
@@ -4082,7 +4091,7 @@ var pe = /*#__PURE__*/function () {
|
|
4082
4091
|
return _ref3.apply(this, arguments);
|
4083
4092
|
};
|
4084
4093
|
}(), o = pe.generateOptionalSignals();
|
4085
|
-
(l = (a = e.
|
4094
|
+
(l = (a = e.connectSettings).handler) == null || l.call(a, t, _objectSpread(_objectSpread({}, o), {}, {
|
4086
4095
|
onResponse: r
|
4087
4096
|
}));
|
4088
4097
|
case 3:
|
@@ -4157,7 +4166,7 @@ var pe = /*#__PURE__*/function () {
|
|
4157
4166
|
pe.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), n = !1;
|
4158
4167
|
};
|
4159
4168
|
var d = pe.generateOptionalSignals();
|
4160
|
-
(h = (u = e.
|
4169
|
+
(h = (u = e.connectSettings).handler) == null || h.call(u, t, _objectSpread(_objectSpread({}, d), {}, {
|
4161
4170
|
onOpen: a,
|
4162
4171
|
onResponse: c,
|
4163
4172
|
onClose: l,
|
@@ -4222,7 +4231,7 @@ var pe = /*#__PURE__*/function () {
|
|
4222
4231
|
};
|
4223
4232
|
}(),
|
4224
4233
|
a = pe.generateOptionalSignals();
|
4225
|
-
(c = (l = e.
|
4234
|
+
(c = (l = e.connectSettings).handler) == null || c.call(l, void 0, _objectSpread(_objectSpread({}, a), {}, {
|
4226
4235
|
onOpen: n,
|
4227
4236
|
onResponse: o,
|
4228
4237
|
onClose: r,
|
@@ -4274,7 +4283,7 @@ var w = /*#__PURE__*/function () {
|
|
4274
4283
|
n = _args15.length > 3 && _args15[3] !== undefined ? _args15[3] : !0;
|
4275
4284
|
r = {
|
4276
4285
|
body: t,
|
4277
|
-
headers: (h = e.
|
4286
|
+
headers: (h = e.connectSettings) == null ? void 0 : h.headers
|
4278
4287
|
};
|
4279
4288
|
_context15.next = 4;
|
4280
4289
|
return v.processRequestInterceptor(e.deepChat, r);
|
@@ -4290,13 +4299,13 @@ var w = /*#__PURE__*/function () {
|
|
4290
4299
|
}
|
4291
4300
|
return _context15.abrupt("return", v.onInterceptorError(i, l, c));
|
4292
4301
|
case 11:
|
4293
|
-
if (!((p = e.
|
4302
|
+
if (!((p = e.connectSettings) != null && p.handler)) {
|
4294
4303
|
_context15.next = 13;
|
4295
4304
|
break;
|
4296
4305
|
}
|
4297
4306
|
return _context15.abrupt("return", pe.request(e, o, i));
|
4298
4307
|
case 13:
|
4299
|
-
if (!(((m = e.
|
4308
|
+
if (!(((m = e.connectSettings) == null ? void 0 : m.url) === _e.URL)) {
|
4300
4309
|
_context15.next = 15;
|
4301
4310
|
break;
|
4302
4311
|
}
|
@@ -4446,7 +4455,7 @@ var w = /*#__PURE__*/function () {
|
|
4446
4455
|
n = _args17.length > 3 && _args17[3] !== undefined ? _args17[3] : !0;
|
4447
4456
|
r = {
|
4448
4457
|
body: t,
|
4449
|
-
headers: (p = e.
|
4458
|
+
headers: (p = e.connectSettings) == null ? void 0 : p.headers
|
4450
4459
|
};
|
4451
4460
|
_context17.next = 4;
|
4452
4461
|
return v.processRequestInterceptor(e.deepChat, r);
|
@@ -4461,12 +4470,12 @@ var w = /*#__PURE__*/function () {
|
|
4461
4470
|
}
|
4462
4471
|
return _context17.abrupt("return", v.onInterceptorError(i, l));
|
4463
4472
|
case 10:
|
4464
|
-
c = ((m = e.
|
4473
|
+
c = ((m = e.connectSettings) == null ? void 0 : m.url) || e.url || "", d = ((f = e.connectSettings) == null ? void 0 : f.method) || "POST", u = n ? JSON.stringify(o) : o, h = {
|
4465
4474
|
method: d,
|
4466
4475
|
body: u,
|
4467
4476
|
headers: a
|
4468
4477
|
};
|
4469
|
-
e.
|
4478
|
+
e.connectSettings.credentials && (h.credentials = e.connectSettings.credentials), w.executePollRequest(e, c, h, i);
|
4470
4479
|
case 12:
|
4471
4480
|
case "end":
|
4472
4481
|
return _context17.stop();
|
@@ -4567,7 +4576,7 @@ var L = /*#__PURE__*/function () {
|
|
4567
4576
|
var n = {
|
4568
4577
|
acceptedFormats: ""
|
4569
4578
|
};
|
4570
|
-
e.fileTypes.mixedFiles = L.parseConfig(e.
|
4579
|
+
e.fileTypes.mixedFiles = L.parseConfig(e.connectSettings, n, t, i);
|
4571
4580
|
}
|
4572
4581
|
}
|
4573
4582
|
// needs to be set after audio to overwrite maxNumberOfFiles
|
@@ -4580,7 +4589,7 @@ var L = /*#__PURE__*/function () {
|
|
4580
4589
|
var o = _objectSpread({
|
4581
4590
|
acceptedFormats: "audio/*"
|
4582
4591
|
}, ((a = e.fileTypes.audio) == null ? void 0 : a.files) || {});
|
4583
|
-
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = L.parseConfig(e.
|
4592
|
+
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = L.parseConfig(e.connectSettings, o, t, i), _typeof(i) == "object" && i.files && ((_l$files = (l = e.recordAudio).files) !== null && _l$files !== void 0 ? _l$files : l.files = {}, e.recordAudio.files.format = (c = i.files) == null ? void 0 : c.format, e.recordAudio.files.maxDurationSeconds = (d = i.files) == null ? void 0 : d.maxDurationSeconds, (u = e.fileTypes.audio) != null && u.files && ((_h$maxNumberOfFiles = (h = e.fileTypes.audio.files).maxNumberOfFiles) !== null && _h$maxNumberOfFiles !== void 0 ? _h$maxNumberOfFiles : h.maxNumberOfFiles = i.files.maxNumberOfFiles))) : n || (e.fileTypes.audio = L.parseConfig(e.connectSettings, o, t, i)));
|
4584
4593
|
}
|
4585
4594
|
// prettier-ignore
|
4586
4595
|
}, {
|
@@ -4590,7 +4599,7 @@ var L = /*#__PURE__*/function () {
|
|
4590
4599
|
var o = _objectSpread({
|
4591
4600
|
acceptedFormats: "audio/*"
|
4592
4601
|
}, (n == null ? void 0 : n.files) || {});
|
4593
|
-
e.fileTypes.audio = L.parseConfig(e.
|
4602
|
+
e.fileTypes.audio = L.parseConfig(e.connectSettings, o, t, i);
|
4594
4603
|
}
|
4595
4604
|
// prettier-ignore
|
4596
4605
|
}, {
|
@@ -4600,7 +4609,7 @@ var L = /*#__PURE__*/function () {
|
|
4600
4609
|
var o = _objectSpread({
|
4601
4610
|
acceptedFormats: "image/gif"
|
4602
4611
|
}, (n == null ? void 0 : n.files) || {});
|
4603
|
-
e.fileTypes.gifs = L.parseConfig(e.
|
4612
|
+
e.fileTypes.gifs = L.parseConfig(e.connectSettings, o, t, i);
|
4604
4613
|
}
|
4605
4614
|
// needs to be set after images to overwrite maxNumberOfFiles
|
4606
4615
|
// prettier-ignore
|
@@ -4612,7 +4621,7 @@ var L = /*#__PURE__*/function () {
|
|
4612
4621
|
var o = _objectSpread({
|
4613
4622
|
acceptedFormats: "image/*"
|
4614
4623
|
}, ((a = e.fileTypes.images) == null ? void 0 : a.files) || {});
|
4615
|
-
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.camera = L.parseConfig(e.
|
4624
|
+
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.camera = L.parseConfig(e.connectSettings, o, t, i), _typeof(i) == "object" && (e.camera.modalContainerStyle = i.modalContainerStyle, i.files && ((_l$files2 = (l = e.camera).files) !== null && _l$files2 !== void 0 ? _l$files2 : l.files = {}, e.camera.files.format = (c = i.files) == null ? void 0 : c.format, e.camera.files.dimensions = (d = i.files) == null ? void 0 : d.dimensions))) : n || (e.fileTypes.images = L.parseConfig(e.connectSettings, o, t, i)));
|
4616
4625
|
}
|
4617
4626
|
// prettier-ignore
|
4618
4627
|
}, {
|
@@ -4622,7 +4631,7 @@ var L = /*#__PURE__*/function () {
|
|
4622
4631
|
var o = _objectSpread({
|
4623
4632
|
acceptedFormats: "image/*"
|
4624
4633
|
}, (n == null ? void 0 : n.files) || {});
|
4625
|
-
e.fileTypes.images = L.parseConfig(e.
|
4634
|
+
e.fileTypes.images = L.parseConfig(e.connectSettings, o, t, i);
|
4626
4635
|
}
|
4627
4636
|
// default for direct service
|
4628
4637
|
}, {
|
@@ -4647,7 +4656,7 @@ var Pe = /*#__PURE__*/function () {
|
|
4647
4656
|
var _a$url;
|
4648
4657
|
_classCallCheck(this, Pe);
|
4649
4658
|
var n, r, o, a, l;
|
4650
|
-
this.rawBody = {}, this.
|
4659
|
+
this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = Pe.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, L.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 = _e.URL), this.connectSettings.websocket && B.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || se.checkForStream(this.deepChat);
|
4651
4660
|
}
|
4652
4661
|
_createClass(Pe, [{
|
4653
4662
|
key: "verifyKey",
|
@@ -4698,11 +4707,11 @@ var Pe = /*#__PURE__*/function () {
|
|
4698
4707
|
messages: t
|
4699
4708
|
}, this.rawBody);
|
4700
4709
|
n = !1;
|
4701
|
-
(r = this.
|
4710
|
+
(r = this.connectSettings.headers) != null && r["Content-Type"] || ((_o$headers = (o = this.connectSettings).headers) !== null && _o$headers !== void 0 ? _o$headers : o.headers = {}, (_a$ContentType = (a = this.connectSettings.headers)["Content-Type"]) !== null && _a$ContentType !== void 0 ? _a$ContentType : a["Content-Type"] = "application/json", n = !0);
|
4702
4711
|
_context19.next = 5;
|
4703
4712
|
return this.request(i, e);
|
4704
4713
|
case 5:
|
4705
|
-
n && ((l = this.
|
4714
|
+
n && ((l = this.connectSettings.headers) == null || delete l["Content-Type"]);
|
4706
4715
|
case 6:
|
4707
4716
|
case "end":
|
4708
4717
|
return _context19.stop();
|
@@ -4722,12 +4731,12 @@ var Pe = /*#__PURE__*/function () {
|
|
4722
4731
|
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
4723
4732
|
while (1) switch (_context20.prev = _context20.next) {
|
4724
4733
|
case 0:
|
4725
|
-
n = Pe.createCustomFormDataBody(this.rawBody, t, i), r = this.
|
4726
|
-
this.
|
4734
|
+
n = Pe.createCustomFormDataBody(this.rawBody, t, i), r = this.connectSettings, o = this.getServiceIOByType(i[0]);
|
4735
|
+
this.connectSettings = (o == null ? void 0 : o.connect) || this.connectSettings;
|
4727
4736
|
_context20.next = 4;
|
4728
4737
|
return this.request(n, e, !1);
|
4729
4738
|
case 4:
|
4730
|
-
this.
|
4739
|
+
this.connectSettings = r;
|
4731
4740
|
case 5:
|
4732
4741
|
case "end":
|
4733
4742
|
return _context20.stop();
|
@@ -4766,14 +4775,14 @@ var Pe = /*#__PURE__*/function () {
|
|
4766
4775
|
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
4767
4776
|
while (1) switch (_context22.prev = _context22.next) {
|
4768
4777
|
case 0:
|
4769
|
-
if (this.
|
4778
|
+
if (this.connectSettings) {
|
4770
4779
|
_context22.next = 2;
|
4771
4780
|
break;
|
4772
4781
|
}
|
4773
4782
|
throw new Error("Request settings have not been set up");
|
4774
4783
|
case 2:
|
4775
4784
|
i = et.processMessages(t.messages, this.maxMessages, this.totalMessagesMaxCharLength);
|
4776
|
-
if (this.
|
4785
|
+
if (this.connectSettings.websocket) {
|
4777
4786
|
n = _objectSpread({
|
4778
4787
|
messages: i
|
4779
4788
|
}, this.rawBody);
|
@@ -4807,7 +4816,7 @@ var Pe = /*#__PURE__*/function () {
|
|
4807
4816
|
_context23.next = 4;
|
4808
4817
|
break;
|
4809
4818
|
}
|
4810
|
-
return _context23.abrupt("return",
|
4819
|
+
return _context23.abrupt("return", se.handleResponseProperty(e));
|
4811
4820
|
case 4:
|
4812
4821
|
if (!v.validateResponseFormat(e)) {
|
4813
4822
|
_context23.next = 6;
|
@@ -4859,24 +4868,24 @@ var Pe = /*#__PURE__*/function () {
|
|
4859
4868
|
}]);
|
4860
4869
|
return Pe;
|
4861
4870
|
}();
|
4862
|
-
var
|
4863
|
-
_inherits(
|
4871
|
+
var H = /*#__PURE__*/function (_Pe) {
|
4872
|
+
_inherits(H, _Pe);
|
4864
4873
|
// prettier-ignore
|
4865
|
-
function
|
4874
|
+
function H(e, t, i, n, r) {
|
4866
4875
|
var _this8;
|
4867
|
-
_classCallCheck(this,
|
4876
|
+
_classCallCheck(this, H);
|
4868
4877
|
var o;
|
4869
|
-
_this8 = _callSuper(this,
|
4878
|
+
_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);
|
4870
4879
|
return _this8;
|
4871
4880
|
}
|
4872
|
-
_createClass(
|
4881
|
+
_createClass(H, [{
|
4873
4882
|
key: "setApiKeyProperties",
|
4874
4883
|
value: function setApiKeyProperties(e) {
|
4875
|
-
this.key = e.key, e.validateKeyProperty && (this.
|
4884
|
+
this.key = e.key, e.validateKeyProperty && (this.validateKeyProperty = e.validateKeyProperty);
|
4876
4885
|
}
|
4877
4886
|
}, {
|
4878
|
-
key: "
|
4879
|
-
value: function
|
4887
|
+
key: "buildConnectSettings",
|
4888
|
+
value: function buildConnectSettings(e, t) {
|
4880
4889
|
var _i$headers;
|
4881
4890
|
var i = t !== null && t !== void 0 ? t : {};
|
4882
4891
|
return (_i$headers = i.headers) !== null && _i$headers !== void 0 ? _i$headers : i.headers = {}, Object.assign(i.headers, this.buildHeadersFunc(e)), i;
|
@@ -4884,7 +4893,7 @@ var q = /*#__PURE__*/function (_Pe) {
|
|
4884
4893
|
}, {
|
4885
4894
|
key: "keyAuthenticated",
|
4886
4895
|
value: function keyAuthenticated(e, t) {
|
4887
|
-
this.
|
4896
|
+
this.connectSettings = this.buildConnectSettings(t, this.connectSettings), this.key = t, e();
|
4888
4897
|
}
|
4889
4898
|
// prettier-ignore
|
4890
4899
|
}, {
|
@@ -4905,26 +4914,26 @@ var q = /*#__PURE__*/function (_Pe) {
|
|
4905
4914
|
return !0;
|
4906
4915
|
}
|
4907
4916
|
}]);
|
4908
|
-
return
|
4917
|
+
return H;
|
4909
4918
|
}(Pe);
|
4910
|
-
var
|
4911
|
-
function
|
4912
|
-
_classCallCheck(this,
|
4919
|
+
var Ht = /*#__PURE__*/function () {
|
4920
|
+
function Ht() {
|
4921
|
+
_classCallCheck(this, Ht);
|
4913
4922
|
}
|
4914
|
-
_createClass(
|
4923
|
+
_createClass(Ht, null, [{
|
4915
4924
|
key: "waitForPropertiesToBeUpdatedBeforeRender",
|
4916
4925
|
value: function waitForPropertiesToBeUpdatedBeforeRender(e) {
|
4917
4926
|
e._propUpdated_ = !1, setTimeout(function () {
|
4918
|
-
e._propUpdated_ ?
|
4927
|
+
e._propUpdated_ ? Ht.waitForPropertiesToBeUpdatedBeforeRender(e) : (e._waitingToRender_ = !1, e.onRender());
|
4919
4928
|
});
|
4920
4929
|
}
|
4921
4930
|
}, {
|
4922
4931
|
key: "attemptRender",
|
4923
4932
|
value: function attemptRender(e) {
|
4924
|
-
e._propUpdated_ = !0, e._waitingToRender_ || (e._waitingToRender_ = !0,
|
4933
|
+
e._propUpdated_ = !0, e._waitingToRender_ || (e._waitingToRender_ = !0, Ht.waitForPropertiesToBeUpdatedBeforeRender(e));
|
4925
4934
|
}
|
4926
4935
|
}]);
|
4927
|
-
return
|
4936
|
+
return Ht;
|
4928
4937
|
}();
|
4929
4938
|
var Yi = /*#__PURE__*/function (_HTMLElement) {
|
4930
4939
|
_inherits(Je, _HTMLElement);
|
@@ -4949,7 +4958,7 @@ var Yi = /*#__PURE__*/function (_HTMLElement) {
|
|
4949
4958
|
return i;
|
4950
4959
|
},
|
4951
4960
|
set: function set(o) {
|
4952
|
-
i = o, t ? this[e] = o :
|
4961
|
+
i = o, t ? this[e] = o : Ht.attemptRender(this);
|
4953
4962
|
}
|
4954
4963
|
});
|
4955
4964
|
}
|
@@ -5918,8 +5927,8 @@ var qt = /*#__PURE__*/function () {
|
|
5918
5927
|
}]);
|
5919
5928
|
return qt;
|
5920
5929
|
}();
|
5921
|
-
var us = /*#__PURE__*/function (
|
5922
|
-
_inherits(Bi,
|
5930
|
+
var us = /*#__PURE__*/function (_H) {
|
5931
|
+
_inherits(Bi, _H);
|
5923
5932
|
// prettier-ignore
|
5924
5933
|
function Bi(e, t, i, n, r, o) {
|
5925
5934
|
var _this16;
|
@@ -5946,7 +5955,7 @@ var us = /*#__PURE__*/function (_q) {
|
|
5946
5955
|
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
5947
5956
|
while (1) switch (_context35.prev = _context35.next) {
|
5948
5957
|
case 0:
|
5949
|
-
if (this.
|
5958
|
+
if (this.connectSettings) {
|
5950
5959
|
_context35.next = 2;
|
5951
5960
|
break;
|
5952
5961
|
}
|
@@ -5967,7 +5976,7 @@ var us = /*#__PURE__*/function (_q) {
|
|
5967
5976
|
}()
|
5968
5977
|
}]);
|
5969
5978
|
return Bi;
|
5970
|
-
}(
|
5979
|
+
}(H);
|
5971
5980
|
us.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
5972
5981
|
var Be = us;
|
5973
5982
|
var St = /*#__PURE__*/function (_Be) {
|
@@ -5992,7 +6001,7 @@ var St = /*#__PURE__*/function (_Be) {
|
|
5992
6001
|
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
5993
6002
|
while (1) switch (_context36.prev = _context36.next) {
|
5994
6003
|
case 0:
|
5995
|
-
if (this.
|
6004
|
+
if (this.connectSettings) {
|
5996
6005
|
_context36.next = 2;
|
5997
6006
|
break;
|
5998
6007
|
}
|
@@ -6156,22 +6165,22 @@ var de = /*#__PURE__*/function () {
|
|
6156
6165
|
}]);
|
6157
6166
|
return de;
|
6158
6167
|
}();
|
6159
|
-
var
|
6160
|
-
_inherits(
|
6168
|
+
var ai = /*#__PURE__*/function (_H2) {
|
6169
|
+
_inherits(ai, _H2);
|
6161
6170
|
// prettier-ignore
|
6162
|
-
function
|
6171
|
+
function ai(e, t, i, n, r) {
|
6163
6172
|
var _this18;
|
6164
|
-
_classCallCheck(this,
|
6165
|
-
_this18 = _callSuper(this,
|
6173
|
+
_classCallCheck(this, ai);
|
6174
|
+
_this18 = _callSuper(this, ai, [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_"];
|
6166
6175
|
return _this18;
|
6167
6176
|
}
|
6168
|
-
return _createClass(
|
6169
|
-
}(
|
6170
|
-
var
|
6171
|
-
_inherits(
|
6172
|
-
function
|
6177
|
+
return _createClass(ai);
|
6178
|
+
}(H);
|
6179
|
+
var Gt = /*#__PURE__*/function (_ai) {
|
6180
|
+
_inherits(Gt, _ai);
|
6181
|
+
function Gt(e) {
|
6173
6182
|
var _this19;
|
6174
|
-
_classCallCheck(this,
|
6183
|
+
_classCallCheck(this, Gt);
|
6175
6184
|
var o;
|
6176
6185
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6177
6186
|
i = t == null ? void 0 : t.stabilityAI,
|
@@ -6183,12 +6192,12 @@ var Ht = /*#__PURE__*/function (_oi) {
|
|
6183
6192
|
}
|
6184
6193
|
}
|
6185
6194
|
};
|
6186
|
-
_this19 = _callSuper(this,
|
6195
|
+
_this19 = _callSuper(this, Gt, [e, de.buildKeyVerificationDetails(), de.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>";
|
6187
6196
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageUpscale;
|
6188
|
-
_typeof(r) == "object" && (r.engine_id && (_this19.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")),
|
6197
|
+
_typeof(r) == "object" && (r.engine_id && (_this19.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")), Gt.cleanConfig(r), Object.assign(_this19.rawBody, r)), _this19.canSendMessage = Gt.canSendFileMessage;
|
6189
6198
|
return _this19;
|
6190
6199
|
}
|
6191
|
-
_createClass(
|
6200
|
+
_createClass(Gt, [{
|
6192
6201
|
key: "createFormDataBody",
|
6193
6202
|
value: function createFormDataBody(e, t) {
|
6194
6203
|
var i = new FormData();
|
@@ -6205,7 +6214,7 @@ var Ht = /*#__PURE__*/function (_oi) {
|
|
6205
6214
|
return _regeneratorRuntime().wrap(function _callee39$(_context39) {
|
6206
6215
|
while (1) switch (_context39.prev = _context39.next) {
|
6207
6216
|
case 0:
|
6208
|
-
if (this.
|
6217
|
+
if (this.connectSettings) {
|
6209
6218
|
_context39.next = 2;
|
6210
6219
|
break;
|
6211
6220
|
}
|
@@ -6218,7 +6227,7 @@ var Ht = /*#__PURE__*/function (_oi) {
|
|
6218
6227
|
throw new Error("Image was not found");
|
6219
6228
|
case 4:
|
6220
6229
|
n = this.createFormDataBody(this.rawBody, i[0]);
|
6221
|
-
v.tempRemoveContentHeader(this.
|
6230
|
+
v.tempRemoveContentHeader(this.connectSettings, w.request.bind(this, this, n, e), !1);
|
6222
6231
|
case 6:
|
6223
6232
|
case "end":
|
6224
6233
|
return _context39.stop();
|
@@ -6273,13 +6282,13 @@ var Ht = /*#__PURE__*/function (_oi) {
|
|
6273
6282
|
return !!(t != null && t[0]);
|
6274
6283
|
}
|
6275
6284
|
}]);
|
6276
|
-
return
|
6277
|
-
}(
|
6278
|
-
var
|
6279
|
-
_inherits(
|
6280
|
-
function
|
6285
|
+
return Gt;
|
6286
|
+
}(ai);
|
6287
|
+
var Vt = /*#__PURE__*/function (_ai2) {
|
6288
|
+
_inherits(Vt, _ai2);
|
6289
|
+
function Vt(e) {
|
6281
6290
|
var _this20;
|
6282
|
-
_classCallCheck(this,
|
6291
|
+
_classCallCheck(this, Vt);
|
6283
6292
|
var o;
|
6284
6293
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6285
6294
|
i = t == null ? void 0 : t.stabilityAI,
|
@@ -6291,12 +6300,12 @@ var Gt = /*#__PURE__*/function (_oi2) {
|
|
6291
6300
|
}
|
6292
6301
|
}
|
6293
6302
|
};
|
6294
|
-
_this20 = _callSuper(this,
|
6303
|
+
_this20 = _callSuper(this, Vt, [e, de.buildKeyVerificationDetails(), de.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>";
|
6295
6304
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
|
6296
|
-
_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),
|
6305
|
+
_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), Vt.cleanConfig(r), Object.assign(_this20.rawBody, r)), _this20.canSendMessage = Vt.canSendFileTextMessage;
|
6297
6306
|
return _this20;
|
6298
6307
|
}
|
6299
|
-
_createClass(
|
6308
|
+
_createClass(Vt, [{
|
6300
6309
|
key: "createFormDataBody",
|
6301
6310
|
value: function createFormDataBody(e, t, i, n) {
|
6302
6311
|
var r = new FormData();
|
@@ -6313,7 +6322,7 @@ var Gt = /*#__PURE__*/function (_oi2) {
|
|
6313
6322
|
return _regeneratorRuntime().wrap(function _callee41$(_context41) {
|
6314
6323
|
while (1) switch (_context41.prev = _context41.next) {
|
6315
6324
|
case 0:
|
6316
|
-
if (this.
|
6325
|
+
if (this.connectSettings) {
|
6317
6326
|
_context41.next = 2;
|
6318
6327
|
break;
|
6319
6328
|
}
|
@@ -6326,7 +6335,7 @@ var Gt = /*#__PURE__*/function (_oi2) {
|
|
6326
6335
|
throw new Error("Image was not found");
|
6327
6336
|
case 4:
|
6328
6337
|
n = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim(), r = this.createFormDataBody(this.rawBody, i[0], i[1], n);
|
6329
|
-
v.tempRemoveContentHeader(this.
|
6338
|
+
v.tempRemoveContentHeader(this.connectSettings, w.request.bind(this, this, r, e), !1);
|
6330
6339
|
case 6:
|
6331
6340
|
case "end":
|
6332
6341
|
return _context41.stop();
|
@@ -6381,8 +6390,8 @@ var Gt = /*#__PURE__*/function (_oi2) {
|
|
6381
6390
|
return !!(t != null && t[0]) && !!(e && e.trim() !== "");
|
6382
6391
|
}
|
6383
6392
|
}]);
|
6384
|
-
return
|
6385
|
-
}(
|
6393
|
+
return Vt;
|
6394
|
+
}(ai);
|
6386
6395
|
var ko = /*#__PURE__*/function (_St3) {
|
6387
6396
|
_inherits(ko, _St3);
|
6388
6397
|
function ko(e) {
|
@@ -6648,11 +6657,11 @@ var No = /*#__PURE__*/function (_Be5) {
|
|
6648
6657
|
}]);
|
6649
6658
|
return No;
|
6650
6659
|
}(Be);
|
6651
|
-
var
|
6652
|
-
_inherits(
|
6653
|
-
function
|
6660
|
+
var Wt = /*#__PURE__*/function (_ai3) {
|
6661
|
+
_inherits(Wt, _ai3);
|
6662
|
+
function Wt(e) {
|
6654
6663
|
var _this23;
|
6655
|
-
_classCallCheck(this,
|
6664
|
+
_classCallCheck(this, Wt);
|
6656
6665
|
var o;
|
6657
6666
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6658
6667
|
i = t.stabilityAI,
|
@@ -6664,12 +6673,12 @@ var Vt = /*#__PURE__*/function (_oi3) {
|
|
6664
6673
|
}
|
6665
6674
|
}
|
6666
6675
|
};
|
6667
|
-
_this23 = _callSuper(this,
|
6676
|
+
_this23 = _callSuper(this, Wt, [e, de.buildKeyVerificationDetails(), de.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>";
|
6668
6677
|
var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
|
6669
|
-
_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),
|
6678
|
+
_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), Wt.cleanConfig(r), Object.assign(_this23.rawBody, r)), _this23.canSendMessage = Wt.canSendFileTextMessage;
|
6670
6679
|
return _this23;
|
6671
6680
|
}
|
6672
|
-
_createClass(
|
6681
|
+
_createClass(Wt, [{
|
6673
6682
|
key: "createFormDataBody",
|
6674
6683
|
value: function createFormDataBody(e, t, i) {
|
6675
6684
|
var n = new FormData();
|
@@ -6686,7 +6695,7 @@ var Vt = /*#__PURE__*/function (_oi3) {
|
|
6686
6695
|
return _regeneratorRuntime().wrap(function _callee48$(_context48) {
|
6687
6696
|
while (1) switch (_context48.prev = _context48.next) {
|
6688
6697
|
case 0:
|
6689
|
-
if (this.
|
6698
|
+
if (this.connectSettings) {
|
6690
6699
|
_context48.next = 2;
|
6691
6700
|
break;
|
6692
6701
|
}
|
@@ -6699,7 +6708,7 @@ var Vt = /*#__PURE__*/function (_oi3) {
|
|
6699
6708
|
throw new Error("Image was not found");
|
6700
6709
|
case 4:
|
6701
6710
|
n = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim(), r = this.createFormDataBody(this.rawBody, i[0], n);
|
6702
|
-
v.tempRemoveContentHeader(this.
|
6711
|
+
v.tempRemoveContentHeader(this.connectSettings, w.request.bind(this, this, r, e), !1);
|
6703
6712
|
case 6:
|
6704
6713
|
case "end":
|
6705
6714
|
return _context48.stop();
|
@@ -6754,8 +6763,8 @@ var Vt = /*#__PURE__*/function (_oi3) {
|
|
6754
6763
|
return !!(t != null && t[0]) && !!(e && e.trim() !== "");
|
6755
6764
|
}
|
6756
6765
|
}]);
|
6757
|
-
return
|
6758
|
-
}(
|
6766
|
+
return Wt;
|
6767
|
+
}(ai);
|
6759
6768
|
var Oo = /*#__PURE__*/function (_Be6) {
|
6760
6769
|
_inherits(Oo, _Be6);
|
6761
6770
|
function Oo(e) {
|
@@ -6795,20 +6804,20 @@ var Oo = /*#__PURE__*/function (_Be6) {
|
|
6795
6804
|
}]);
|
6796
6805
|
return Oo;
|
6797
6806
|
}(Be);
|
6798
|
-
var
|
6799
|
-
_inherits(
|
6800
|
-
function
|
6807
|
+
var Jt = /*#__PURE__*/function (_ai4) {
|
6808
|
+
_inherits(Jt, _ai4);
|
6809
|
+
function Jt(e) {
|
6801
6810
|
var _this24;
|
6802
|
-
_classCallCheck(this,
|
6811
|
+
_classCallCheck(this, Jt);
|
6803
6812
|
var r;
|
6804
6813
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6805
6814
|
i = t.stabilityAI;
|
6806
|
-
_this24 = _callSuper(this,
|
6815
|
+
_this24 = _callSuper(this, Jt, [e, de.buildKeyVerificationDetails(), de.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>";
|
6807
6816
|
var n = (r = t.stabilityAI) == null ? void 0 : r.textToImage;
|
6808
|
-
_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),
|
6817
|
+
_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), Jt.cleanConfig(n), Object.assign(_this24.rawBody, n)), _this24.canSendMessage = Jt.canSendTextMessage;
|
6809
6818
|
return _this24;
|
6810
6819
|
}
|
6811
|
-
_createClass(
|
6820
|
+
_createClass(Jt, [{
|
6812
6821
|
key: "preprocessBody",
|
6813
6822
|
value: function preprocessBody(e, t) {
|
6814
6823
|
var i = JSON.parse(JSON.stringify(e)),
|
@@ -6825,7 +6834,7 @@ var Wt = /*#__PURE__*/function (_oi4) {
|
|
6825
6834
|
return _regeneratorRuntime().wrap(function _callee51$(_context51) {
|
6826
6835
|
while (1) switch (_context51.prev = _context51.next) {
|
6827
6836
|
case 0:
|
6828
|
-
if (this.
|
6837
|
+
if (this.connectSettings) {
|
6829
6838
|
_context51.next = 2;
|
6830
6839
|
break;
|
6831
6840
|
}
|
@@ -6887,8 +6896,8 @@ var Wt = /*#__PURE__*/function (_oi4) {
|
|
6887
6896
|
return !!(e && e.trim() !== "");
|
6888
6897
|
}
|
6889
6898
|
}]);
|
6890
|
-
return
|
6891
|
-
}(
|
6899
|
+
return Jt;
|
6900
|
+
}(ai);
|
6892
6901
|
var Po = /*#__PURE__*/function (_Be7) {
|
6893
6902
|
_inherits(Po, _Be7);
|
6894
6903
|
function Po(e) {
|
@@ -6930,11 +6939,11 @@ var Po = /*#__PURE__*/function (_Be7) {
|
|
6930
6939
|
}]);
|
6931
6940
|
return Po;
|
6932
6941
|
}(Be);
|
6933
|
-
var
|
6934
|
-
function
|
6935
|
-
_classCallCheck(this,
|
6942
|
+
var $t = /*#__PURE__*/function () {
|
6943
|
+
function $t() {
|
6944
|
+
_classCallCheck(this, $t);
|
6936
6945
|
}
|
6937
|
-
_createClass(
|
6946
|
+
_createClass($t, null, [{
|
6938
6947
|
key: "buildHeaders",
|
6939
6948
|
value: function buildHeaders(e) {
|
6940
6949
|
return {
|
@@ -6956,25 +6965,25 @@ var Jt = /*#__PURE__*/function () {
|
|
6956
6965
|
return {
|
6957
6966
|
url: "https://api.cohere.ai/v1/generate",
|
6958
6967
|
method: "POST",
|
6959
|
-
handleVerificationResult:
|
6968
|
+
handleVerificationResult: $t.handleVerificationResult,
|
6960
6969
|
body: JSON.stringify({
|
6961
6970
|
prompt: ""
|
6962
6971
|
})
|
6963
6972
|
};
|
6964
6973
|
}
|
6965
6974
|
}]);
|
6966
|
-
return
|
6975
|
+
return $t;
|
6967
6976
|
}();
|
6968
|
-
var Xi = /*#__PURE__*/function (
|
6969
|
-
_inherits(Xi,
|
6977
|
+
var Xi = /*#__PURE__*/function (_H3) {
|
6978
|
+
_inherits(Xi, _H3);
|
6970
6979
|
function Xi(e, t, i, n, r) {
|
6971
6980
|
var _this26;
|
6972
6981
|
_classCallCheck(this, Xi);
|
6973
|
-
_this26 = _callSuper(this, Xi, [e,
|
6982
|
+
_this26 = _callSuper(this, Xi, [e, $t.buildKeyVerificationDetails(), $t.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);
|
6974
6983
|
return _this26;
|
6975
6984
|
}
|
6976
6985
|
return _createClass(Xi);
|
6977
|
-
}(
|
6986
|
+
}(H);
|
6978
6987
|
var Do = /*#__PURE__*/function (_Xi) {
|
6979
6988
|
_inherits(Do, _Xi);
|
6980
6989
|
function Do(e) {
|
@@ -7001,7 +7010,7 @@ var Do = /*#__PURE__*/function (_Xi) {
|
|
7001
7010
|
return _regeneratorRuntime().wrap(function _callee54$(_context54) {
|
7002
7011
|
while (1) switch (_context54.prev = _context54.next) {
|
7003
7012
|
case 0:
|
7004
|
-
if (this.
|
7013
|
+
if (this.connectSettings) {
|
7005
7014
|
_context54.next = 2;
|
7006
7015
|
break;
|
7007
7016
|
}
|
@@ -7077,7 +7086,7 @@ var jo = /*#__PURE__*/function (_Xi2) {
|
|
7077
7086
|
return _regeneratorRuntime().wrap(function _callee56$(_context56) {
|
7078
7087
|
while (1) switch (_context56.prev = _context56.next) {
|
7079
7088
|
case 0:
|
7080
|
-
if (this.
|
7089
|
+
if (this.connectSettings) {
|
7081
7090
|
_context56.next = 2;
|
7082
7091
|
break;
|
7083
7092
|
}
|
@@ -7166,9 +7175,9 @@ var N = /*#__PURE__*/function () {
|
|
7166
7175
|
while (1) switch (_context58.prev = _context58.next) {
|
7167
7176
|
case 0:
|
7168
7177
|
n = _args58.length > 3 && _args58[3] !== undefined ? _args58[3] : !0;
|
7169
|
-
e.
|
7178
|
+
e.connectSettings.method = i;
|
7170
7179
|
_context58.next = 4;
|
7171
|
-
return v.fetch(e, e.
|
7180
|
+
return v.fetch(e, e.connectSettings.headers, n, t).then(function (o) {
|
7172
7181
|
return v.processResponseByType(o);
|
7173
7182
|
});
|
7174
7183
|
case 4:
|
@@ -7194,8 +7203,8 @@ var N = /*#__PURE__*/function () {
|
|
7194
7203
|
}]);
|
7195
7204
|
return N;
|
7196
7205
|
}();
|
7197
|
-
var Qi = /*#__PURE__*/function (
|
7198
|
-
_inherits(zi,
|
7206
|
+
var Qi = /*#__PURE__*/function (_H4) {
|
7207
|
+
_inherits(zi, _H4);
|
7199
7208
|
function zi(e) {
|
7200
7209
|
var _o$model, _a$voice;
|
7201
7210
|
var _this27;
|
@@ -7224,13 +7233,13 @@ var Qi = /*#__PURE__*/function (_q4) {
|
|
7224
7233
|
return _regeneratorRuntime().wrap(function _callee59$(_context59) {
|
7225
7234
|
while (1) switch (_context59.prev = _context59.next) {
|
7226
7235
|
case 0:
|
7227
|
-
if ((n = this.
|
7236
|
+
if ((n = this.connectSettings) != null && n.headers) {
|
7228
7237
|
_context59.next = 2;
|
7229
7238
|
break;
|
7230
7239
|
}
|
7231
7240
|
throw new Error("Request settings have not been set up");
|
7232
7241
|
case 2:
|
7233
|
-
this.url = this.
|
7242
|
+
this.url = this.connectSettings.url || this.url;
|
7234
7243
|
i = this.preprocessBody(this.rawBody, t);
|
7235
7244
|
w.request(this, i, e);
|
7236
7245
|
case 5:
|
@@ -7289,12 +7298,12 @@ var Qi = /*#__PURE__*/function (_q4) {
|
|
7289
7298
|
}()
|
7290
7299
|
}]);
|
7291
7300
|
return zi;
|
7292
|
-
}(
|
7301
|
+
}(H);
|
7293
7302
|
Qi.DEFAULT_MODEL = "tts-1";
|
7294
7303
|
Qi.DEFAULT_VOIDE = "alloy";
|
7295
7304
|
var Fo = Qi;
|
7296
|
-
var
|
7297
|
-
_inherits(Te,
|
7305
|
+
var li = /*#__PURE__*/function (_H5) {
|
7306
|
+
_inherits(Te, _H5);
|
7298
7307
|
function Te(e) {
|
7299
7308
|
var _o$model2;
|
7300
7309
|
var _this28;
|
@@ -7331,7 +7340,7 @@ var ai = /*#__PURE__*/function (_q5) {
|
|
7331
7340
|
return _regeneratorRuntime().wrap(function _callee61$(_context61) {
|
7332
7341
|
while (1) switch (_context61.prev = _context61.next) {
|
7333
7342
|
case 0:
|
7334
|
-
if ((o = this.
|
7343
|
+
if ((o = this.connectSettings) != null && o.headers) {
|
7335
7344
|
_context61.next = 2;
|
7336
7345
|
break;
|
7337
7346
|
}
|
@@ -7343,9 +7352,9 @@ var ai = /*#__PURE__*/function (_q5) {
|
|
7343
7352
|
}
|
7344
7353
|
throw new Error("No file was added");
|
7345
7354
|
case 4:
|
7346
|
-
this.url = this.
|
7355
|
+
this.url = this.connectSettings.url || this._service_url;
|
7347
7356
|
n = this.preprocessBody(this.rawBody, t), r = Te.createFormDataBody(n, i[0]);
|
7348
|
-
v.tempRemoveContentHeader(this.
|
7357
|
+
v.tempRemoveContentHeader(this.connectSettings, w.request.bind(this, this, r, e), !1);
|
7349
7358
|
case 7:
|
7350
7359
|
case "end":
|
7351
7360
|
return _context61.stop();
|
@@ -7404,11 +7413,11 @@ var ai = /*#__PURE__*/function (_q5) {
|
|
7404
7413
|
}
|
7405
7414
|
}]);
|
7406
7415
|
return Te;
|
7407
|
-
}(
|
7408
|
-
|
7409
|
-
|
7410
|
-
|
7411
|
-
var Bo =
|
7416
|
+
}(H);
|
7417
|
+
li.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions";
|
7418
|
+
li.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations";
|
7419
|
+
li.DEFAULT_MODEL = "whisper-1";
|
7420
|
+
var Bo = li;
|
7412
7421
|
var Z = /*#__PURE__*/function () {
|
7413
7422
|
function Z() {
|
7414
7423
|
_classCallCheck(this, Z);
|
@@ -7511,8 +7520,8 @@ var Z = /*#__PURE__*/function () {
|
|
7511
7520
|
}]);
|
7512
7521
|
return Z;
|
7513
7522
|
}();
|
7514
|
-
var zo = /*#__PURE__*/function (
|
7515
|
-
_inherits(zo,
|
7523
|
+
var zo = /*#__PURE__*/function (_H6) {
|
7524
|
+
_inherits(zo, _H6);
|
7516
7525
|
// prettier-ignore
|
7517
7526
|
function zo(e, t, i, n, r) {
|
7518
7527
|
var _this29;
|
@@ -7523,7 +7532,7 @@ var zo = /*#__PURE__*/function (_q6) {
|
|
7523
7532
|
return _this29;
|
7524
7533
|
}
|
7525
7534
|
return _createClass(zo);
|
7526
|
-
}(
|
7535
|
+
}(H);
|
7527
7536
|
var Uo = /*#__PURE__*/function (_zo) {
|
7528
7537
|
_inherits(Uo, _zo);
|
7529
7538
|
function Uo(e) {
|
@@ -7561,7 +7570,7 @@ var Uo = /*#__PURE__*/function (_zo) {
|
|
7561
7570
|
return _regeneratorRuntime().wrap(function _callee63$(_context63) {
|
7562
7571
|
while (1) switch (_context63.prev = _context63.next) {
|
7563
7572
|
case 0:
|
7564
|
-
if (this.
|
7573
|
+
if (this.connectSettings) {
|
7565
7574
|
_context63.next = 2;
|
7566
7575
|
break;
|
7567
7576
|
}
|
@@ -7597,7 +7606,7 @@ var Uo = /*#__PURE__*/function (_zo) {
|
|
7597
7606
|
if (this.messages && this.completionsHandlers) {
|
7598
7607
|
_i10 = e.headers.get("operation-location"), n = {
|
7599
7608
|
method: "GET",
|
7600
|
-
headers: (t = this.
|
7609
|
+
headers: (t = this.connectSettings) == null ? void 0 : t.headers
|
7601
7610
|
};
|
7602
7611
|
w.executePollRequest(this, _i10, n, this.messages);
|
7603
7612
|
}
|
@@ -7784,8 +7793,8 @@ var ut = /*#__PURE__*/function () {
|
|
7784
7793
|
}]);
|
7785
7794
|
return ut;
|
7786
7795
|
}();
|
7787
|
-
var en = /*#__PURE__*/function (
|
7788
|
-
_inherits(en,
|
7796
|
+
var en = /*#__PURE__*/function (_H7) {
|
7797
|
+
_inherits(en, _H7);
|
7789
7798
|
function en(e) {
|
7790
7799
|
var _this31;
|
7791
7800
|
_classCallCheck(this, en);
|
@@ -7804,7 +7813,7 @@ var en = /*#__PURE__*/function (_q7) {
|
|
7804
7813
|
return _regeneratorRuntime().wrap(function _callee67$(_context67) {
|
7805
7814
|
while (1) switch (_context67.prev = _context67.next) {
|
7806
7815
|
case 0:
|
7807
|
-
if ((n = this.
|
7816
|
+
if ((n = this.connectSettings) != null && n.headers) {
|
7808
7817
|
_context67.next = 2;
|
7809
7818
|
break;
|
7810
7819
|
}
|
@@ -7842,7 +7851,7 @@ var en = /*#__PURE__*/function (_q7) {
|
|
7842
7851
|
}
|
7843
7852
|
throw e.error;
|
7844
7853
|
case 2:
|
7845
|
-
t = (r = (n = this.
|
7854
|
+
t = (r = (n = this.connectSettings) == null ? void 0 : n.headers) == null ? void 0 : r.Authorization;
|
7846
7855
|
_context68.next = 5;
|
7847
7856
|
return ut.poll(t, e.upload_url);
|
7848
7857
|
case 5:
|
@@ -7868,9 +7877,9 @@ var en = /*#__PURE__*/function (_q7) {
|
|
7868
7877
|
}
|
7869
7878
|
}]);
|
7870
7879
|
return en;
|
7871
|
-
}(
|
7872
|
-
var hs = /*#__PURE__*/function (
|
7873
|
-
_inherits(hs,
|
7880
|
+
}(H);
|
7881
|
+
var hs = /*#__PURE__*/function (_H8) {
|
7882
|
+
_inherits(hs, _H8);
|
7874
7883
|
// prettier-ignore
|
7875
7884
|
function hs(e, t, i, n, r) {
|
7876
7885
|
var _this32;
|
@@ -7881,7 +7890,7 @@ var hs = /*#__PURE__*/function (_q8) {
|
|
7881
7890
|
return _this32;
|
7882
7891
|
}
|
7883
7892
|
return _createClass(hs);
|
7884
|
-
}(
|
7893
|
+
}(H);
|
7885
7894
|
var ps = /*#__PURE__*/function (_hs) {
|
7886
7895
|
_inherits(fs, _hs);
|
7887
7896
|
// prettier-ignore
|
@@ -7909,7 +7918,7 @@ var ps = /*#__PURE__*/function (_hs) {
|
|
7909
7918
|
return _regeneratorRuntime().wrap(function _callee69$(_context69) {
|
7910
7919
|
while (1) switch (_context69.prev = _context69.next) {
|
7911
7920
|
case 0:
|
7912
|
-
if (this.
|
7921
|
+
if (this.connectSettings) {
|
7913
7922
|
_context69.next = 2;
|
7914
7923
|
break;
|
7915
7924
|
}
|
@@ -7963,7 +7972,7 @@ var ps = /*#__PURE__*/function (_hs) {
|
|
7963
7972
|
ps.HELP_LINK =
|
7964
7973
|
// eslint-disable-next-line max-len
|
7965
7974
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
7966
|
-
var
|
7975
|
+
var Ho = ps;
|
7967
7976
|
var ms = /*#__PURE__*/function (_hs2) {
|
7968
7977
|
_inherits(Ui, _hs2);
|
7969
7978
|
function Ui(e) {
|
@@ -7992,7 +8001,7 @@ var ms = /*#__PURE__*/function (_hs2) {
|
|
7992
8001
|
return _regeneratorRuntime().wrap(function _callee71$(_context71) {
|
7993
8002
|
while (1) switch (_context71.prev = _context71.next) {
|
7994
8003
|
case 0:
|
7995
|
-
if ((n = this.
|
8004
|
+
if ((n = this.connectSettings) != null && n.headers) {
|
7996
8005
|
_context71.next = 2;
|
7997
8006
|
break;
|
7998
8007
|
}
|
@@ -8004,7 +8013,7 @@ var ms = /*#__PURE__*/function (_hs2) {
|
|
8004
8013
|
}
|
8005
8014
|
throw new Error("No file was added");
|
8006
8015
|
case 4:
|
8007
|
-
(r = this.
|
8016
|
+
(r = this.connectSettings) != null && r.headers && (this.connectSettings.headers["Content-Type"] = i[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"), w.request(this, i[0], e, !1);
|
8008
8017
|
case 5:
|
8009
8018
|
case "end":
|
8010
8019
|
return _context71.stop();
|
@@ -8054,9 +8063,9 @@ var ms = /*#__PURE__*/function (_hs2) {
|
|
8054
8063
|
ms.HELP_LINK =
|
8055
8064
|
// eslint-disable-next-line max-len
|
8056
8065
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
8057
|
-
var
|
8058
|
-
var Go = /*#__PURE__*/function (
|
8059
|
-
_inherits(Go,
|
8066
|
+
var qo = ms;
|
8067
|
+
var Go = /*#__PURE__*/function (_H9) {
|
8068
|
+
_inherits(Go, _H9);
|
8060
8069
|
// prettier-ignore
|
8061
8070
|
function Go(e) {
|
8062
8071
|
var _this35;
|
@@ -8085,7 +8094,7 @@ var Go = /*#__PURE__*/function (_q9) {
|
|
8085
8094
|
return _regeneratorRuntime().wrap(function _callee73$(_context73) {
|
8086
8095
|
while (1) switch (_context73.prev = _context73.next) {
|
8087
8096
|
case 0:
|
8088
|
-
if (this.
|
8097
|
+
if (this.connectSettings) {
|
8089
8098
|
_context73.next = 2;
|
8090
8099
|
break;
|
8091
8100
|
}
|
@@ -8134,7 +8143,7 @@ var Go = /*#__PURE__*/function (_q9) {
|
|
8134
8143
|
}()
|
8135
8144
|
}]);
|
8136
8145
|
return Go;
|
8137
|
-
}(
|
8146
|
+
}(H);
|
8138
8147
|
var ye = /*#__PURE__*/function () {
|
8139
8148
|
function ye() {
|
8140
8149
|
_classCallCheck(this, ye);
|
@@ -8147,7 +8156,7 @@ var ye = /*#__PURE__*/function () {
|
|
8147
8156
|
return _regeneratorRuntime().wrap(function _callee76$(_context76) {
|
8148
8157
|
while (1) switch (_context76.prev = _context76.next) {
|
8149
8158
|
case 0:
|
8150
|
-
n = e.
|
8159
|
+
n = e.connectSettings.headers;
|
8151
8160
|
if (n) {
|
8152
8161
|
_context76.next = 3;
|
8153
8162
|
break;
|
@@ -8343,16 +8352,16 @@ var ye = /*#__PURE__*/function () {
|
|
8343
8352
|
}]);
|
8344
8353
|
return ye;
|
8345
8354
|
}();
|
8346
|
-
var
|
8347
|
-
_inherits(
|
8348
|
-
function
|
8355
|
+
var ci = /*#__PURE__*/function (_H10) {
|
8356
|
+
_inherits(ae, _H10);
|
8357
|
+
function ae(e) {
|
8349
8358
|
var _c$headers, _d$OpenAIBeta;
|
8350
8359
|
var _this36;
|
8351
|
-
_classCallCheck(this,
|
8360
|
+
_classCallCheck(this, ae);
|
8352
8361
|
var r, o, a, l, c, d;
|
8353
8362
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
8354
8363
|
i = t.openAI;
|
8355
|
-
_this36 = _callSuper(this,
|
8364
|
+
_this36 = _callSuper(this, ae, [e, N.buildKeyVerificationDetails(), N.buildHeaders, i]), _this36.insertKeyPlaceholderText = "OpenAI API Key", _this36.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this36.url = "", _this36.permittedErrorPrefixes = ["Incorrect"], _this36.searchedForThreadId = !1, _this36.config = {}, _this36.newAssistantDetails = {
|
8356
8365
|
model: "gpt-4"
|
8357
8366
|
}, _this36.shouldFetchHistory = !1;
|
8358
8367
|
var n = (r = t.openAI) == null ? void 0 : r.assistant;
|
@@ -8367,10 +8376,10 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8367
8376
|
m = _ref11.function_handler;
|
8368
8377
|
m && (_this36._functionHandler = m);
|
8369
8378
|
} else (l = t.openAI) != null && l.assistant && (t.openAI.assistant = n);
|
8370
|
-
(_c$headers = (c = _this36.
|
8379
|
+
(_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.shouldFetchHistory && _this36.sessionId && (_this36.fetchHistory = _this36.fetchHistoryFunc.bind(_assertThisInitialized(_this36)));
|
8371
8380
|
return _this36;
|
8372
8381
|
}
|
8373
|
-
_createClass(
|
8382
|
+
_createClass(ae, [{
|
8374
8383
|
key: "fetchHistoryFunc",
|
8375
8384
|
value: function () {
|
8376
8385
|
var _fetchHistoryFunc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee80() {
|
@@ -8428,11 +8437,11 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8428
8437
|
key: "callService",
|
8429
8438
|
value: function callService(e, t, i) {
|
8430
8439
|
if (this.sessionId) {
|
8431
|
-
this.url = "".concat(
|
8440
|
+
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/messages");
|
8432
8441
|
var n = this.processMessage(t, i);
|
8433
8442
|
w.request(this, n, e);
|
8434
8443
|
} else {
|
8435
|
-
this.url = "".concat(
|
8444
|
+
this.url = "".concat(ae.THREAD_PREFIX, "/runs");
|
8436
8445
|
var _n2 = this.createNewThreadMessages(this.rawBody, t, i);
|
8437
8446
|
w.request(this, _n2, e);
|
8438
8447
|
}
|
@@ -8447,7 +8456,7 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8447
8456
|
return _regeneratorRuntime().wrap(function _callee81$(_context81) {
|
8448
8457
|
while (1) switch (_context81.prev = _context81.next) {
|
8449
8458
|
case 0:
|
8450
|
-
if (this.
|
8459
|
+
if (this.connectSettings) {
|
8451
8460
|
_context81.next = 2;
|
8452
8461
|
break;
|
8453
8462
|
}
|
@@ -8488,7 +8497,7 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8488
8497
|
_context81.t1 = void 0;
|
8489
8498
|
case 20:
|
8490
8499
|
n = _context81.t1;
|
8491
|
-
this.
|
8500
|
+
this.connectSettings.method = "POST", this.callService(e, t, n);
|
8492
8501
|
case 22:
|
8493
8502
|
case "end":
|
8494
8503
|
return _context81.stop();
|
@@ -8509,7 +8518,7 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8509
8518
|
while (1) switch (_context82.prev = _context82.next) {
|
8510
8519
|
case 0:
|
8511
8520
|
_context82.prev = 0;
|
8512
|
-
this.url =
|
8521
|
+
this.url = ae.NEW_ASSISTANT_URL;
|
8513
8522
|
_context82.next = 4;
|
8514
8523
|
return N.directFetch(this, JSON.parse(JSON.stringify(this.newAssistantDetails)), "POST");
|
8515
8524
|
case 4:
|
@@ -8555,9 +8564,9 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8555
8564
|
_context83.next = 4;
|
8556
8565
|
return this.assignThreadAndRun(e);
|
8557
8566
|
case 4:
|
8558
|
-
t = "".concat(
|
8567
|
+
t = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id), i = {
|
8559
8568
|
method: "GET",
|
8560
|
-
headers: (n = this.
|
8569
|
+
headers: (n = this.connectSettings) == null ? void 0 : n.headers
|
8561
8570
|
};
|
8562
8571
|
return _context83.abrupt("return", (w.executePollRequest(this, t, i, this.messages), {
|
8563
8572
|
makingAnotherRequest: !0
|
@@ -8585,7 +8594,7 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8585
8594
|
_context84.next = 8;
|
8586
8595
|
break;
|
8587
8596
|
}
|
8588
|
-
this.url = "".concat(
|
8597
|
+
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs");
|
8589
8598
|
_context84.next = 4;
|
8590
8599
|
return N.directFetch(this, JSON.parse(JSON.stringify(this.rawBody)), "POST");
|
8591
8600
|
case 4:
|
@@ -8621,7 +8630,7 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8621
8630
|
while (1) switch (_context86.prev = _context86.next) {
|
8622
8631
|
case 0:
|
8623
8632
|
t = _args86.length > 1 && _args86[1] !== undefined ? _args86[1] : !1;
|
8624
|
-
this.url = "".concat(
|
8633
|
+
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(e, "/messages");
|
8625
8634
|
_context86.next = 4;
|
8626
8635
|
return N.directFetch(this, {}, "GET");
|
8627
8636
|
case 4:
|
@@ -8685,7 +8694,7 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8685
8694
|
break;
|
8686
8695
|
}
|
8687
8696
|
return _context87.abrupt("return", {
|
8688
|
-
timeoutMS:
|
8697
|
+
timeoutMS: ae.POLLING_TIMEOUT_MS
|
8689
8698
|
});
|
8690
8699
|
case 3:
|
8691
8700
|
if (!(t === "completed" && this.messages)) {
|
@@ -8776,14 +8785,14 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8776
8785
|
output: r
|
8777
8786
|
};
|
8778
8787
|
});
|
8779
|
-
this.url = "".concat(
|
8788
|
+
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id, "/submit_tool_outputs");
|
8780
8789
|
_context88.next = 12;
|
8781
8790
|
return N.directFetch(this, {
|
8782
8791
|
tool_outputs: n
|
8783
8792
|
}, "POST");
|
8784
8793
|
case 12:
|
8785
8794
|
return _context88.abrupt("return", {
|
8786
|
-
timeoutMS:
|
8795
|
+
timeoutMS: ae.POLLING_TIMEOUT_MS
|
8787
8796
|
});
|
8788
8797
|
case 13:
|
8789
8798
|
case "end":
|
@@ -8797,14 +8806,14 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8797
8806
|
return handleTools;
|
8798
8807
|
}()
|
8799
8808
|
}]);
|
8800
|
-
return
|
8801
|
-
}(
|
8802
|
-
|
8803
|
-
|
8804
|
-
|
8805
|
-
var Vo =
|
8806
|
-
var
|
8807
|
-
_inherits(Ce,
|
8809
|
+
return ae;
|
8810
|
+
}(H);
|
8811
|
+
ci.THREAD_PREFIX = "https://api.openai.com/v1/threads";
|
8812
|
+
ci.NEW_ASSISTANT_URL = "https://api.openai.com/v1/assistants";
|
8813
|
+
ci.POLLING_TIMEOUT_MS = 800;
|
8814
|
+
var Vo = ci;
|
8815
|
+
var di = /*#__PURE__*/function (_H11) {
|
8816
|
+
_inherits(Ce, _H11);
|
8808
8817
|
function Ce(e) {
|
8809
8818
|
var _this39;
|
8810
8819
|
_classCallCheck(this, Ce);
|
@@ -8851,7 +8860,7 @@ var ci = /*#__PURE__*/function (_q11) {
|
|
8851
8860
|
var l = this.preprocessBody(this.rawBody, r);
|
8852
8861
|
n = Ce.createFormDataBody(l, i[0], i[1]);
|
8853
8862
|
} else this.url = Ce.IMAGE_VARIATIONS_URL, n = Ce.createFormDataBody(this.rawBody, i[0]);
|
8854
|
-
v.tempRemoveContentHeader(this.
|
8863
|
+
v.tempRemoveContentHeader(this.connectSettings, w.request.bind(this, this, n, e), !1);
|
8855
8864
|
}
|
8856
8865
|
}, {
|
8857
8866
|
key: "callServiceAPI",
|
@@ -8861,7 +8870,7 @@ var ci = /*#__PURE__*/function (_q11) {
|
|
8861
8870
|
return _regeneratorRuntime().wrap(function _callee89$(_context89) {
|
8862
8871
|
while (1) switch (_context89.prev = _context89.next) {
|
8863
8872
|
case 0:
|
8864
|
-
if ((n = this.
|
8873
|
+
if ((n = this.connectSettings) != null && n.headers) {
|
8865
8874
|
_context89.next = 2;
|
8866
8875
|
break;
|
8867
8876
|
}
|
@@ -8875,7 +8884,7 @@ var ci = /*#__PURE__*/function (_q11) {
|
|
8875
8884
|
_context89.next = 11;
|
8876
8885
|
break;
|
8877
8886
|
case 6:
|
8878
|
-
if (this.
|
8887
|
+
if (this.connectSettings) {
|
8879
8888
|
_context89.next = 8;
|
8880
8889
|
break;
|
8881
8890
|
}
|
@@ -8953,13 +8962,13 @@ var ci = /*#__PURE__*/function (_q11) {
|
|
8953
8962
|
}
|
8954
8963
|
}]);
|
8955
8964
|
return Ce;
|
8956
|
-
}(
|
8957
|
-
|
8958
|
-
|
8959
|
-
|
8960
|
-
var Wo =
|
8961
|
-
var ht = /*#__PURE__*/function (
|
8962
|
-
_inherits(ht,
|
8965
|
+
}(H);
|
8966
|
+
di.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations";
|
8967
|
+
di.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations";
|
8968
|
+
di.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
|
8969
|
+
var Wo = di;
|
8970
|
+
var ht = /*#__PURE__*/function (_H12) {
|
8971
|
+
_inherits(ht, _H12);
|
8963
8972
|
function ht(e) {
|
8964
8973
|
var _this40$maxMessages, _l$model;
|
8965
8974
|
var _this40;
|
@@ -9008,7 +9017,7 @@ var ht = /*#__PURE__*/function (_q12) {
|
|
9008
9017
|
return _regeneratorRuntime().wrap(function _callee91$(_context91) {
|
9009
9018
|
while (1) switch (_context91.prev = _context91.next) {
|
9010
9019
|
case 0:
|
9011
|
-
if (this.
|
9020
|
+
if (this.connectSettings) {
|
9012
9021
|
_context91.next = 2;
|
9013
9022
|
break;
|
9014
9023
|
}
|
@@ -9232,7 +9241,7 @@ var ht = /*#__PURE__*/function (_q12) {
|
|
9232
9241
|
}
|
9233
9242
|
}]);
|
9234
9243
|
return ht;
|
9235
|
-
}(
|
9244
|
+
}(H);
|
9236
9245
|
var Jo = /*#__PURE__*/function (_Xi3) {
|
9237
9246
|
_inherits(Jo, _Xi3);
|
9238
9247
|
function Jo(e) {
|
@@ -9268,7 +9277,7 @@ var Jo = /*#__PURE__*/function (_Xi3) {
|
|
9268
9277
|
return _regeneratorRuntime().wrap(function _callee95$(_context95) {
|
9269
9278
|
while (1) switch (_context95.prev = _context95.next) {
|
9270
9279
|
case 0:
|
9271
|
-
if (this.
|
9280
|
+
if (this.connectSettings) {
|
9272
9281
|
_context95.next = 2;
|
9273
9282
|
break;
|
9274
9283
|
}
|
@@ -9337,12 +9346,12 @@ var $o = /*#__PURE__*/function () {
|
|
9337
9346
|
if (t.cohere) return t.cohere.textGeneration ? new Do(e) : t.cohere.summarization ? new jo(e) : new Jo(e);
|
9338
9347
|
if (t.huggingFace) return t.huggingFace.textGeneration ? new Io(e) : t.huggingFace.summarization ? new Ro(e) : t.huggingFace.translation ? new Oo(e) : t.huggingFace.fillMask ? new Po(e) : t.huggingFace.questionAnswer ? new Lo(e) : t.huggingFace.audioSpeechRecognition ? new ko(e) : t.huggingFace.audioClassification ? new Co(e) : t.huggingFace.imageClassification ? new Ao(e) : new No(e);
|
9339
9348
|
if (t.azure) {
|
9340
|
-
if (t.azure.speechToText) return new
|
9341
|
-
if (t.azure.textToSpeech) return new
|
9349
|
+
if (t.azure.speechToText) return new qo(e);
|
9350
|
+
if (t.azure.textToSpeech) return new Ho(e);
|
9342
9351
|
if (t.azure.summarization) return new Uo(e);
|
9343
9352
|
if (t.azure.translation) return new Go(e);
|
9344
9353
|
}
|
9345
|
-
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new
|
9354
|
+
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new Wt(e) : t.stabilityAI.imageToImageUpscale ? new Gt(e) : t.stabilityAI.imageToImageMasking ? new Vt(e) : new Jt(e);
|
9346
9355
|
}
|
9347
9356
|
return i && !(n && i.stream) ? new Pe(e) : new Pe(e, void 0, n || !0);
|
9348
9357
|
}
|
@@ -9350,22 +9359,22 @@ var $o = /*#__PURE__*/function () {
|
|
9350
9359
|
return $o;
|
9351
9360
|
}();
|
9352
9361
|
var gs = /*#__PURE__*/function () {
|
9353
|
-
function
|
9354
|
-
_classCallCheck(this,
|
9362
|
+
function Hi() {
|
9363
|
+
_classCallCheck(this, Hi);
|
9355
9364
|
}
|
9356
|
-
_createClass(
|
9365
|
+
_createClass(Hi, null, [{
|
9357
9366
|
key: "appendStyleSheetToHead",
|
9358
9367
|
value: function appendStyleSheetToHead() {
|
9359
9368
|
var e = document.getElementsByTagName("head")[0];
|
9360
9369
|
if (!Array.from(e.getElementsByTagName("link")).some(function (i) {
|
9361
|
-
return i.getAttribute("href") ===
|
9370
|
+
return i.getAttribute("href") === Hi.FONT_URL;
|
9362
9371
|
})) {
|
9363
9372
|
var _i12 = document.createElement("link");
|
9364
|
-
_i12.rel = "stylesheet", _i12.href =
|
9373
|
+
_i12.rel = "stylesheet", _i12.href = Hi.FONT_URL, e.appendChild(_i12);
|
9365
9374
|
}
|
9366
9375
|
}
|
9367
9376
|
}]);
|
9368
|
-
return
|
9377
|
+
return Hi;
|
9369
9378
|
}();
|
9370
9379
|
gs.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap";
|
9371
9380
|
var Ko = gs;
|
@@ -9424,21 +9433,21 @@ var tn = /*#__PURE__*/function () {
|
|
9424
9433
|
}]);
|
9425
9434
|
return tn;
|
9426
9435
|
}();
|
9427
|
-
var
|
9428
|
-
function
|
9429
|
-
_classCallCheck(this,
|
9436
|
+
var Kt = /*#__PURE__*/function () {
|
9437
|
+
function Kt(e, t, i) {
|
9438
|
+
_classCallCheck(this, Kt);
|
9430
9439
|
this._isDisplayed = !1, e ? (this._elementRef = this.createIntroPanelWithChild(e, i), this._isDisplayed = !0) : t && (this._elementRef = this.createInternalIntroPanel(t, i), this._isDisplayed = !0);
|
9431
9440
|
}
|
9432
|
-
_createClass(
|
9441
|
+
_createClass(Kt, [{
|
9433
9442
|
key: "createIntroPanelWithChild",
|
9434
9443
|
value: function createIntroPanelWithChild(e, t) {
|
9435
|
-
var i =
|
9444
|
+
var i = Kt.createIntroPanel(t);
|
9436
9445
|
return e.style.display === "none" && (e.style.display = "block"), i.appendChild(e), i;
|
9437
9446
|
}
|
9438
9447
|
}, {
|
9439
9448
|
key: "createInternalIntroPanel",
|
9440
9449
|
value: function createInternalIntroPanel(e, t) {
|
9441
|
-
var i =
|
9450
|
+
var i = Kt.createIntroPanel(t);
|
9442
9451
|
return i.id = "internal-intro-panel", i.innerHTML = e, i;
|
9443
9452
|
}
|
9444
9453
|
}, {
|
@@ -9458,7 +9467,7 @@ var $t = /*#__PURE__*/function () {
|
|
9458
9467
|
return t.classList.add("intro-panel"), Object.assign(t.style, e), t;
|
9459
9468
|
}
|
9460
9469
|
}]);
|
9461
|
-
return
|
9470
|
+
return Kt;
|
9462
9471
|
}();
|
9463
9472
|
var Yo = /*#__PURE__*/function () {
|
9464
9473
|
function Yo() {
|
@@ -9488,7 +9497,7 @@ var be = /*#__PURE__*/function () {
|
|
9488
9497
|
key: "createImage",
|
9489
9498
|
value: function createImage(e, t) {
|
9490
9499
|
var i = new Image();
|
9491
|
-
return i.src = e.src,
|
9500
|
+
return i.src = e.src, le.scrollDownOnImageLoad(i.src, t), le.processContent("image", i, i.src, e.name);
|
9492
9501
|
}
|
9493
9502
|
// WORK - image still does not scroll down when loaded
|
9494
9503
|
}, {
|
@@ -9500,7 +9509,7 @@ var be = /*#__PURE__*/function () {
|
|
9500
9509
|
while (1) switch (_context97.prev = _context97.next) {
|
9501
9510
|
case 0:
|
9502
9511
|
n = be.createImage(t, e.elementRef), r = e.createNewMessageElement("", i);
|
9503
|
-
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"),
|
9512
|
+
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"), le.addMessage(e, r, "image", i);
|
9504
9513
|
case 2:
|
9505
9514
|
case "end":
|
9506
9515
|
return _context97.stop();
|
@@ -9523,7 +9532,7 @@ var be = /*#__PURE__*/function () {
|
|
9523
9532
|
value: function addNewAudioMessage(e, t, i) {
|
9524
9533
|
var n = be.createAudioElement(t, i),
|
9525
9534
|
r = e.createNewMessageElement("", i);
|
9526
|
-
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"),
|
9535
|
+
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"), le.addMessage(e, r, "audio", i);
|
9527
9536
|
}
|
9528
9537
|
}, {
|
9529
9538
|
key: "createAnyFile",
|
@@ -9535,14 +9544,14 @@ var be = /*#__PURE__*/function () {
|
|
9535
9544
|
var n = V.createSVGElement(Zo);
|
9536
9545
|
n.classList.add("any-file-message-icon"), i.appendChild(n);
|
9537
9546
|
var r = document.createElement("div");
|
9538
|
-
return r.classList.add("any-file-message-text"), r.textContent = e.name ||
|
9547
|
+
return r.classList.add("any-file-message-text"), r.textContent = e.name || le.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), le.processContent("any", t, e.src, r.textContent);
|
9539
9548
|
}
|
9540
9549
|
}, {
|
9541
9550
|
key: "addNewAnyFileMessage",
|
9542
9551
|
value: function addNewAnyFileMessage(e, t, i) {
|
9543
9552
|
var n = e.createNewMessageElement("", i),
|
9544
9553
|
r = be.createAnyFile(t);
|
9545
|
-
n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r),
|
9554
|
+
n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r), le.addMessage(e, n, "file", i);
|
9546
9555
|
}
|
9547
9556
|
// no overwrite previous message logic as it is complex to track which files are to be overwritten
|
9548
9557
|
}, {
|
@@ -9550,7 +9559,7 @@ var be = /*#__PURE__*/function () {
|
|
9550
9559
|
value: function addMessages(e, t, i) {
|
9551
9560
|
t.forEach(function (n) {
|
9552
9561
|
var r, o;
|
9553
|
-
n.ref && (n =
|
9562
|
+
n.ref && (n = le.removeFileRef(n)), n.type === "audio" || (r = n.src) != null && r.startsWith("data:audio") ? be.addNewAudioMessage(e, n, i) : n.type === "image" || (o = n.src) != null && o.startsWith("data:image") ? be.addNewImageMessage(e, n, i) : be.addNewAnyFileMessage(e, n, i);
|
9554
9563
|
});
|
9555
9564
|
}
|
9556
9565
|
}]);
|
@@ -9566,13 +9575,13 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9566
9575
|
var n = t.permittedErrorPrefixes,
|
9567
9576
|
r = t.introPanelMarkUp,
|
9568
9577
|
o = t.demo;
|
9569
|
-
_this43._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this43._onClearMessages =
|
9578
|
+
_this43._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this43._onClearMessages = Ut.onClearMessages.bind(_assertThisInitialized(_this43), e), _this43._onError = Ut.onError.bind(_assertThisInitialized(_this43), e), _this43._displayLoadingMessage = ve.getDisplayLoadingMessage(e, t), _this43._permittedErrorPrefixes = n, _this43.addSetupMessageIfNeeded(e, t) || _this43.populateIntroPanel(i, r, e.introPanelStyle), _this43.addIntroductoryMessage(e, t), _this43.populateHistory(e), _this43._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
|
9570
9579
|
return JSON.parse(JSON.stringify(_this43.messages));
|
9571
|
-
}, e.clearMessages = _this43.clearMessages.bind(_assertThisInitialized(_this43), t), e.refreshMessages = _this43.refreshTextMessages.bind(_assertThisInitialized(_this43)), e.scrollToBottom = G.scrollToBottom.bind(_assertThisInitialized(_this43), _this43.elementRef), e.
|
9572
|
-
_this43.
|
9580
|
+
}, e.clearMessages = _this43.clearMessages.bind(_assertThisInitialized(_this43), t), e.refreshMessages = _this43.refreshTextMessages.bind(_assertThisInitialized(_this43)), e.scrollToBottom = G.scrollToBottom.bind(_assertThisInitialized(_this43), _this43.elementRef), e.addMessage = function (c, d) {
|
9581
|
+
_this43.addAnyMessage(_objectSpread(_objectSpread({}, c), {}, {
|
9573
9582
|
sendUpdate: !!d
|
9574
9583
|
}), !d);
|
9575
|
-
}, t.isWebModel() && t.setUpMessages(_assertThisInitialized(_this43)), o && _this43.prepareDemo(o), e.textToSpeech &&
|
9584
|
+
}, t.isWebModel() && t.setUpMessages(_assertThisInitialized(_this43)), o && _this43.prepareDemo(o), e.textToSpeech && Bt.processConfig(e.textToSpeech, function (c) {
|
9576
9585
|
_this43.textToSpeech = c;
|
9577
9586
|
}), t.fetchHistory && _this43.fetchHistory(t.fetchHistory);
|
9578
9587
|
return _this43;
|
@@ -9615,9 +9624,9 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9615
9624
|
key: "populateHistory",
|
9616
9625
|
value: function populateHistory(e) {
|
9617
9626
|
var _this44 = this;
|
9618
|
-
var t = e.history ||
|
9627
|
+
var t = e.history || se.processHistory(e);
|
9619
9628
|
t && (t.forEach(function (i) {
|
9620
|
-
|
9629
|
+
se.processHistoryFile(i), _this44.addNewMessage(i, !0);
|
9621
9630
|
}), setTimeout(function () {
|
9622
9631
|
return G.scrollToBottom(_this44.elementRef);
|
9623
9632
|
}, 0));
|
@@ -9634,7 +9643,7 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9634
9643
|
return e();
|
9635
9644
|
case 2:
|
9636
9645
|
_context98.sent.forEach(function (i) {
|
9637
|
-
|
9646
|
+
return _this45.addAnyMessage(i, !0);
|
9638
9647
|
});
|
9639
9648
|
setTimeout(function () {
|
9640
9649
|
return G.scrollToBottom(_this45.elementRef);
|
@@ -9649,7 +9658,14 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9649
9658
|
return _fetchHistory.apply(this, arguments);
|
9650
9659
|
}
|
9651
9660
|
return fetchHistory;
|
9652
|
-
}()
|
9661
|
+
}()
|
9662
|
+
}, {
|
9663
|
+
key: "addAnyMessage",
|
9664
|
+
value: function addAnyMessage(e) {
|
9665
|
+
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
9666
|
+
e.error ? this.addNewErrorMessage("service", e.error) : this.addNewMessage(e, t);
|
9667
|
+
}
|
9668
|
+
// this should not be activated by streamed messages
|
9653
9669
|
}, {
|
9654
9670
|
key: "addNewMessage",
|
9655
9671
|
value: function addNewMessage(e) {
|
@@ -9658,7 +9674,7 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9658
9674
|
n = {
|
9659
9675
|
status: e.overwrite
|
9660
9676
|
};
|
9661
|
-
if (!e.ignoreText && i.text !== void 0 && e.text !== null && (this.addNewTextMessage(i.text, i.role, n), !t && this.textToSpeech && i.role !== b.USER_ROLE &&
|
9677
|
+
if (!e.ignoreText && i.text !== void 0 && e.text !== null && (this.addNewTextMessage(i.text, i.role, n), !t && this.textToSpeech && i.role !== b.USER_ROLE && Bt.speak(i.text, this.textToSpeech)), i.files && Array.isArray(i.files) && be.addMessages(this, i.files, i.role), i.html !== void 0 && i.html !== null) {
|
9662
9678
|
var r = Qe.add(this, i.html, i.role, this.messageElementRefs, n);
|
9663
9679
|
Ee.isElementTemporary(r) && delete i.html;
|
9664
9680
|
}
|
@@ -9697,7 +9713,7 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9697
9713
|
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.";
|
9698
9714
|
this.renderText(r, o);
|
9699
9715
|
var a = D.extractParticularSharedStyles(["fontSize", "fontFamily"], (d = this.messageStyles) == null ? void 0 : d["default"]);
|
9700
|
-
D.applyCustomStylesToElements(i, !1, a), D.applyCustomStylesToElements(i, !1, (u = this.messageStyles) == null ? void 0 : u.error), this.elementRef.appendChild(n), G.scrollToBottom(this.elementRef), this.textToSpeech &&
|
9716
|
+
D.applyCustomStylesToElements(i, !1, a), D.applyCustomStylesToElements(i, !1, (u = this.messageStyles) == null ? void 0 : u.error), this.elementRef.appendChild(n), G.scrollToBottom(this.elementRef), this.textToSpeech && Bt.speak(o, this.textToSpeech), (h = this._onError) == null || h.call(this, o);
|
9701
9717
|
}
|
9702
9718
|
}, {
|
9703
9719
|
key: "getPermittedMessage",
|
@@ -9733,7 +9749,7 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9733
9749
|
}, {
|
9734
9750
|
key: "populateIntroPanel",
|
9735
9751
|
value: function populateIntroPanel(e, t, i) {
|
9736
|
-
(e || t) && (this._introPanel = new
|
9752
|
+
(e || t) && (this._introPanel = new Kt(e, t, i), this._introPanel._elementRef && (ce.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
|
9737
9753
|
}
|
9738
9754
|
}, {
|
9739
9755
|
key: "addMultipleFiles",
|
@@ -9745,7 +9761,7 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9745
9761
|
return _context99.abrupt("return", Promise.all((e || []).map(function (t) {
|
9746
9762
|
return new Promise(function (i) {
|
9747
9763
|
if (!t.type || t.type === "any") {
|
9748
|
-
var n = t.file.name ||
|
9764
|
+
var n = t.file.name || le.DEFAULT_FILE_NAME;
|
9749
9765
|
i({
|
9750
9766
|
name: n,
|
9751
9767
|
type: "any",
|
@@ -10340,7 +10356,7 @@ var fe = /*#__PURE__*/function () {
|
|
10340
10356
|
var r = fe.createImageAttachment(t);
|
10341
10357
|
this.addFileAttachment(e, "image", r, i);
|
10342
10358
|
} else if (n === "audio") {
|
10343
|
-
var _r2 =
|
10359
|
+
var _r2 = qi.createAudioAttachment(t);
|
10344
10360
|
this.addFileAttachment(e, "audio", _r2, i);
|
10345
10361
|
} else {
|
10346
10362
|
var _r3 = fe.createAnyFileAttachment(e.name);
|
@@ -10381,7 +10397,7 @@ var fe = /*#__PURE__*/function () {
|
|
10381
10397
|
return r === e;
|
10382
10398
|
}),
|
10383
10399
|
i = this._attachments[t].attachmentContainerElement;
|
10384
|
-
this._attachments.splice(t, 1),
|
10400
|
+
this._attachments.splice(t, 1), qi.stopAttachmentPlayback(i), i.remove(), this._toggleContainerDisplay(!1), (n = this._validationHandler) == null || n.call(this);
|
10385
10401
|
}
|
10386
10402
|
}, {
|
10387
10403
|
key: "getFiles",
|
@@ -10568,7 +10584,7 @@ var ra = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10568
10584
|
return Ae;
|
10569
10585
|
}(fe);
|
10570
10586
|
vs.TIMER_LIMIT_S = 5999;
|
10571
|
-
var
|
10587
|
+
var qi = vs;
|
10572
10588
|
var oa = /*#__PURE__*/function () {
|
10573
10589
|
function oa() {
|
10574
10590
|
_classCallCheck(this, oa);
|
@@ -10578,7 +10594,7 @@ var oa = /*#__PURE__*/function () {
|
|
10578
10594
|
value:
|
10579
10595
|
// prettier-ignore
|
10580
10596
|
function create(e, t, i, n, r) {
|
10581
|
-
return r === "audio" ? new
|
10597
|
+
return r === "audio" ? new qi(e, t, i, n) : new fe(e, t, i, n);
|
10582
10598
|
}
|
10583
10599
|
}]);
|
10584
10600
|
return oa;
|
@@ -10990,7 +11006,7 @@ var Ie = /*#__PURE__*/function () {
|
|
10990
11006
|
}, {
|
10991
11007
|
key: "attach",
|
10992
11008
|
value: function attach(e, t, i, n, r) {
|
10993
|
-
var o = e.validateInput ||
|
11009
|
+
var o = e.validateInput || se.processValidateInput(e);
|
10994
11010
|
e._validationHandler = /*#__PURE__*/function () {
|
10995
11011
|
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee104(a) {
|
10996
11012
|
var l;
|
@@ -11097,8 +11113,8 @@ var xt = /*#__PURE__*/function (_Tt3) {
|
|
11097
11113
|
return xt;
|
11098
11114
|
}(Tt);
|
11099
11115
|
var xs = {},
|
11100
|
-
di = {},
|
11101
11116
|
ui = {},
|
11117
|
+
hi = {},
|
11102
11118
|
At = {},
|
11103
11119
|
ze = {};
|
11104
11120
|
Object.defineProperty(ze, "__esModule", {
|
@@ -11159,10 +11175,10 @@ var ca = /*#__PURE__*/function () {
|
|
11159
11175
|
return ca;
|
11160
11176
|
}();
|
11161
11177
|
At.Translate = ca;
|
11162
|
-
Object.defineProperty(
|
11178
|
+
Object.defineProperty(hi, "__esModule", {
|
11163
11179
|
value: !0
|
11164
11180
|
});
|
11165
|
-
|
11181
|
+
hi.WebSpeechTranscript = void 0;
|
11166
11182
|
var Cn = At;
|
11167
11183
|
var da = /*#__PURE__*/function () {
|
11168
11184
|
function da() {
|
@@ -11200,7 +11216,7 @@ var da = /*#__PURE__*/function () {
|
|
11200
11216
|
}]);
|
11201
11217
|
return da;
|
11202
11218
|
}();
|
11203
|
-
|
11219
|
+
hi.WebSpeechTranscript = da;
|
11204
11220
|
var nt = {};
|
11205
11221
|
Object.defineProperty(nt, "__esModule", {
|
11206
11222
|
value: !0
|
@@ -11214,11 +11230,11 @@ dt.IS_SAFARI = function () {
|
|
11214
11230
|
return dt._IS_SAFARI === void 0 && (dt._IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), dt._IS_SAFARI;
|
11215
11231
|
};
|
11216
11232
|
var kt = {},
|
11217
|
-
|
11218
|
-
Object.defineProperty(
|
11233
|
+
pi = {};
|
11234
|
+
Object.defineProperty(pi, "__esModule", {
|
11219
11235
|
value: !0
|
11220
11236
|
});
|
11221
|
-
|
11237
|
+
pi.EventListeners = void 0;
|
11222
11238
|
var Y = /*#__PURE__*/function () {
|
11223
11239
|
function Y() {
|
11224
11240
|
_classCallCheck(this, Y);
|
@@ -11262,13 +11278,13 @@ var Y = /*#__PURE__*/function () {
|
|
11262
11278
|
}]);
|
11263
11279
|
return Y;
|
11264
11280
|
}();
|
11265
|
-
|
11281
|
+
pi.EventListeners = Y;
|
11266
11282
|
Y.KEY_DOWN_TIMEOUT = null;
|
11267
|
-
var
|
11268
|
-
Object.defineProperty(
|
11283
|
+
var fi = {};
|
11284
|
+
Object.defineProperty(fi, "__esModule", {
|
11269
11285
|
value: !0
|
11270
11286
|
});
|
11271
|
-
|
11287
|
+
fi.PreResultUtils = void 0;
|
11272
11288
|
var ua = /*#__PURE__*/function () {
|
11273
11289
|
function ua() {
|
11274
11290
|
_classCallCheck(this, ua);
|
@@ -11284,7 +11300,7 @@ var ua = /*#__PURE__*/function () {
|
|
11284
11300
|
}]);
|
11285
11301
|
return ua;
|
11286
11302
|
}();
|
11287
|
-
|
11303
|
+
fi.PreResultUtils = ua;
|
11288
11304
|
var It = {},
|
11289
11305
|
Lt = {};
|
11290
11306
|
Object.defineProperty(Lt, "__esModule", {
|
@@ -11381,11 +11397,11 @@ var ha = /*#__PURE__*/function () {
|
|
11381
11397
|
return ha;
|
11382
11398
|
}();
|
11383
11399
|
Ue.Elements = ha;
|
11384
|
-
var
|
11385
|
-
Object.defineProperty(
|
11400
|
+
var He = {};
|
11401
|
+
Object.defineProperty(He, "__esModule", {
|
11386
11402
|
value: !0
|
11387
11403
|
});
|
11388
|
-
|
11404
|
+
He.Cursor = void 0;
|
11389
11405
|
var ft = /*#__PURE__*/function () {
|
11390
11406
|
function ft() {
|
11391
11407
|
_classCallCheck(this, ft);
|
@@ -11467,7 +11483,7 @@ var ft = /*#__PURE__*/function () {
|
|
11467
11483
|
}]);
|
11468
11484
|
return ft;
|
11469
11485
|
}();
|
11470
|
-
|
11486
|
+
He.Cursor = ft;
|
11471
11487
|
Object.defineProperty(It, "__esModule", {
|
11472
11488
|
value: !0
|
11473
11489
|
});
|
@@ -11475,7 +11491,7 @@ It.CommandUtils = void 0;
|
|
11475
11491
|
var An = Lt,
|
11476
11492
|
pa = Ue,
|
11477
11493
|
fa = nt,
|
11478
|
-
kn =
|
11494
|
+
kn = He,
|
11479
11495
|
In = ze;
|
11480
11496
|
var K = /*#__PURE__*/function () {
|
11481
11497
|
function K() {
|
@@ -11573,18 +11589,18 @@ var K = /*#__PURE__*/function () {
|
|
11573
11589
|
return K;
|
11574
11590
|
}();
|
11575
11591
|
It.CommandUtils = K;
|
11576
|
-
var
|
11577
|
-
Object.defineProperty(
|
11592
|
+
var mi = {};
|
11593
|
+
Object.defineProperty(mi, "__esModule", {
|
11578
11594
|
value: !0
|
11579
11595
|
});
|
11580
|
-
|
11596
|
+
mi.Highlight = void 0;
|
11581
11597
|
var ma = Ue,
|
11582
|
-
st =
|
11583
|
-
var
|
11584
|
-
function
|
11585
|
-
_classCallCheck(this,
|
11598
|
+
st = He;
|
11599
|
+
var Yt = /*#__PURE__*/function () {
|
11600
|
+
function Yt() {
|
11601
|
+
_classCallCheck(this, Yt);
|
11586
11602
|
}
|
11587
|
-
_createClass(
|
11603
|
+
_createClass(Yt, null, [{
|
11588
11604
|
key: "setStateForPrimitive",
|
11589
11605
|
value: function setStateForPrimitive(e, t) {
|
11590
11606
|
var i, n;
|
@@ -11603,7 +11619,7 @@ var Kt = /*#__PURE__*/function () {
|
|
11603
11619
|
}, {
|
11604
11620
|
key: "setState",
|
11605
11621
|
value: function setState(e, t) {
|
11606
|
-
document.activeElement === t && (ma.Elements.isPrimitiveElement(t) ?
|
11622
|
+
document.activeElement === t && (ma.Elements.isPrimitiveElement(t) ? Yt.setStateForPrimitive(e, t) : Yt.setStateForGeneric(e, t));
|
11607
11623
|
}
|
11608
11624
|
}, {
|
11609
11625
|
key: "removeForGeneric",
|
@@ -11627,22 +11643,22 @@ var Kt = /*#__PURE__*/function () {
|
|
11627
11643
|
e.isHighlighted = !1;
|
11628
11644
|
}
|
11629
11645
|
}]);
|
11630
|
-
return
|
11646
|
+
return Yt;
|
11631
11647
|
}();
|
11632
|
-
|
11633
|
-
var
|
11634
|
-
Object.defineProperty(
|
11648
|
+
mi.Highlight = Yt;
|
11649
|
+
var gi = {};
|
11650
|
+
Object.defineProperty(gi, "__esModule", {
|
11635
11651
|
value: !0
|
11636
11652
|
});
|
11637
|
-
|
11653
|
+
gi.Padding = void 0;
|
11638
11654
|
var ga = Ue,
|
11639
|
-
Ln =
|
11655
|
+
Ln = He,
|
11640
11656
|
Ge = ze;
|
11641
|
-
var
|
11642
|
-
function
|
11643
|
-
_classCallCheck(this,
|
11657
|
+
var Zt = /*#__PURE__*/function () {
|
11658
|
+
function Zt() {
|
11659
|
+
_classCallCheck(this, Zt);
|
11644
11660
|
}
|
11645
|
-
_createClass(
|
11661
|
+
_createClass(Zt, null, [{
|
11646
11662
|
key: "setStateForPrimitiveElement",
|
11647
11663
|
value: function setStateForPrimitiveElement(e, t) {
|
11648
11664
|
if (document.activeElement === t && t.selectionStart !== null) {
|
@@ -11677,7 +11693,7 @@ var Yt = /*#__PURE__*/function () {
|
|
11677
11693
|
}, {
|
11678
11694
|
key: "setState",
|
11679
11695
|
value: function setState(e, t) {
|
11680
|
-
ga.Elements.isPrimitiveElement(t) ?
|
11696
|
+
ga.Elements.isPrimitiveElement(t) ? Zt.setStateForPrimitiveElement(e, t) : Zt.setStateForGenericElement(e, t);
|
11681
11697
|
}
|
11682
11698
|
}, {
|
11683
11699
|
key: "adjustStateAfterRecodingPrimitiveElement",
|
@@ -11694,27 +11710,27 @@ var Yt = /*#__PURE__*/function () {
|
|
11694
11710
|
e.numberOfSpacesBeforeNewText === 1 && (e.startPadding = e.startPadding.substring(0, e.startPadding.length - 1), e.numberOfSpacesBeforeNewText = 0), e.numberOfSpacesAfterNewText === 1 && (e.endPadding = e.endPadding.substring(1), e.numberOfSpacesAfterNewText = 0);
|
11695
11711
|
}
|
11696
11712
|
}]);
|
11697
|
-
return
|
11713
|
+
return Zt;
|
11698
11714
|
}();
|
11699
|
-
|
11715
|
+
gi.Padding = Zt;
|
11700
11716
|
Object.defineProperty(kt, "__esModule", {
|
11701
11717
|
value: !0
|
11702
11718
|
});
|
11703
11719
|
kt.Speech = void 0;
|
11704
|
-
var Rn =
|
11705
|
-
ba =
|
11720
|
+
var Rn = pi,
|
11721
|
+
ba = fi,
|
11706
11722
|
Nn = It,
|
11707
11723
|
Dt = Lt,
|
11708
|
-
ki = fi,
|
11709
|
-
se = Ue,
|
11710
11724
|
Ii = mi,
|
11725
|
+
re = Ue,
|
11726
|
+
Li = gi,
|
11711
11727
|
On = nt,
|
11712
|
-
Pn =
|
11713
|
-
|
11728
|
+
Pn = He,
|
11729
|
+
Ri = ze;
|
11714
11730
|
var va = /*#__PURE__*/function () {
|
11715
11731
|
function va() {
|
11716
11732
|
_classCallCheck(this, va);
|
11717
|
-
this.finalTranscript = "", this.interimSpan =
|
11733
|
+
this.finalTranscript = "", this.interimSpan = re.Elements.createInterimSpan(), this.finalSpan = re.Elements.createGenericSpan(), this.scrollingSpan = re.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();
|
11718
11734
|
}
|
11719
11735
|
_createClass(va, [{
|
11720
11736
|
key: "prepareBeforeStart",
|
@@ -11727,12 +11743,12 @@ var va = /*#__PURE__*/function () {
|
|
11727
11743
|
if (!r) return;
|
11728
11744
|
this.prepare(r);
|
11729
11745
|
} else this.prepare(e.element);
|
11730
|
-
(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"],
|
11746
|
+
(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"], re.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 = Nn.CommandUtils.process(this._options.commands));
|
11731
11747
|
}
|
11732
11748
|
}, {
|
11733
11749
|
key: "prepare",
|
11734
11750
|
value: function prepare(e) {
|
11735
|
-
|
11751
|
+
Li.Padding.setState(this, e), Ii.Highlight.setState(this, e), this.isTargetInShadow = re.Elements.isInsideShadowDOM(e), re.Elements.isPrimitiveElement(e) ? (this._primitiveElement = e, this._originalText = this._primitiveElement.value) : (this._genericElement = e, this._originalText = this._genericElement.textContent);
|
11736
11752
|
}
|
11737
11753
|
// there was an attempt to optimize this by not having to restart the service and just reset state:
|
11738
11754
|
// unfortunately it did not work because the service would still continue firing the intermediate and final results
|
@@ -11747,7 +11763,7 @@ var va = /*#__PURE__*/function () {
|
|
11747
11763
|
key: "updateElements",
|
11748
11764
|
value: function updateElements(e, t, i) {
|
11749
11765
|
var n;
|
11750
|
-
var r =
|
11766
|
+
var r = Ri.Text.capitalize(t);
|
11751
11767
|
if (this.finalTranscript === r && e === "") return;
|
11752
11768
|
ba.PreResultUtils.process(this, i, e === "", this._onPreResult, this._options) && (e = "", i = "");
|
11753
11769
|
var o = this.commands && Nn.CommandUtils.execCommand(this, i, this._options, this._primitiveElement || this._genericElement, this._originalText);
|
@@ -11765,7 +11781,7 @@ var va = /*#__PURE__*/function () {
|
|
11765
11781
|
}, {
|
11766
11782
|
key: "updatePrimitiveElement",
|
11767
11783
|
value: function updatePrimitiveElement(e, t, i) {
|
11768
|
-
this.isHighlighted &&
|
11784
|
+
this.isHighlighted && Ii.Highlight.removeForPrimitive(this, e), this.primitiveTextRecorded || Li.Padding.adjustStateAfterRecodingPrimitiveElement(this, e), i && Li.Padding.adjustSateForNoTextPrimitiveElement(this);
|
11769
11785
|
var n = this.startPadding + this.finalTranscript + t;
|
11770
11786
|
if (e.value = n + this.endPadding, !this.isTargetInShadow) {
|
11771
11787
|
var r = n.length + this.numberOfSpacesAfterNewText;
|
@@ -11776,18 +11792,18 @@ var va = /*#__PURE__*/function () {
|
|
11776
11792
|
}, {
|
11777
11793
|
key: "updateGenericElement",
|
11778
11794
|
value: function updateGenericElement(e, t, i) {
|
11779
|
-
this.isHighlighted &&
|
11780
|
-
var n = (i ? "" : this.startPadding) +
|
11795
|
+
this.isHighlighted && Ii.Highlight.removeForGeneric(this, e), this.spansPopulated || re.Elements.appendSpans(this, e);
|
11796
|
+
var n = (i ? "" : this.startPadding) + Ri.Text.lineBreak(this.finalTranscript);
|
11781
11797
|
this.finalSpan.innerHTML = n;
|
11782
11798
|
var r = Dt.AutoScroll.isRequired(this.autoScroll, e);
|
11783
11799
|
Dt.AutoScroll.changeStateIfNeeded(this, r);
|
11784
|
-
var o =
|
11800
|
+
var o = Ri.Text.lineBreak(t) + (i ? "" : this.endPadding);
|
11785
11801
|
this.interimSpan.innerHTML = o, On.Browser.IS_SAFARI() && this.insertInCursorLocation && Pn.Cursor.setOffsetForSafariGeneric(e, n.length + o.length), r && Dt.AutoScroll.scrollGeneric(this, e), i && (this.scrollingSpan.innerHTML = "");
|
11786
11802
|
}
|
11787
11803
|
}, {
|
11788
11804
|
key: "finalise",
|
11789
11805
|
value: function finalise(e) {
|
11790
|
-
this._genericElement && (e ? (this.finalSpan =
|
11806
|
+
this._genericElement && (e ? (this.finalSpan = re.Elements.createGenericSpan(), this.setInterimColorToFinal(), this.interimSpan = re.Elements.createInterimSpan(), this.scrollingSpan = re.Elements.createGenericSpan()) : this._genericElement.textContent = this._genericElement.textContent, this.spansPopulated = !1), Rn.EventListeners.remove(this);
|
11791
11807
|
}
|
11792
11808
|
}, {
|
11793
11809
|
key: "setInterimColorToFinal",
|
@@ -11821,20 +11837,20 @@ var va = /*#__PURE__*/function () {
|
|
11821
11837
|
return va;
|
11822
11838
|
}();
|
11823
11839
|
kt.Speech = va;
|
11824
|
-
Object.defineProperty(
|
11840
|
+
Object.defineProperty(ui, "__esModule", {
|
11825
11841
|
value: !0
|
11826
11842
|
});
|
11827
|
-
|
11828
|
-
var Dn =
|
11843
|
+
ui.WebSpeech = void 0;
|
11844
|
+
var Dn = hi,
|
11829
11845
|
jn = nt,
|
11830
11846
|
ya = kt;
|
11831
|
-
var
|
11832
|
-
_inherits(
|
11833
|
-
function
|
11834
|
-
_classCallCheck(this,
|
11835
|
-
return _callSuper(this,
|
11847
|
+
var Xt = /*#__PURE__*/function (_ya$Speech) {
|
11848
|
+
_inherits(Xt, _ya$Speech);
|
11849
|
+
function Xt() {
|
11850
|
+
_classCallCheck(this, Xt);
|
11851
|
+
return _callSuper(this, Xt);
|
11836
11852
|
}
|
11837
|
-
_createClass(
|
11853
|
+
_createClass(Xt, [{
|
11838
11854
|
key: "start",
|
11839
11855
|
value: function start(e) {
|
11840
11856
|
var t;
|
@@ -11843,13 +11859,13 @@ var Zt = /*#__PURE__*/function (_ya$Speech) {
|
|
11843
11859
|
}, {
|
11844
11860
|
key: "validate",
|
11845
11861
|
value: function validate() {
|
11846
|
-
return
|
11862
|
+
return Xt.getAPI() ? !0 : (this.error("Speech Recognition is unsupported"), !1);
|
11847
11863
|
}
|
11848
11864
|
}, {
|
11849
11865
|
key: "instantiateService",
|
11850
11866
|
value: function instantiateService(e) {
|
11851
11867
|
var t, i;
|
11852
|
-
var n =
|
11868
|
+
var n = Xt.getAPI();
|
11853
11869
|
this._service = new n(), this._service.continuous = !0, this._service.interimResults = (t = e == null ? void 0 : e.displayInterimResults) !== null && t !== void 0 ? t : !0, this._service.lang = ((i = e == null ? void 0 : e.language) === null || i === void 0 ? void 0 : i.trim()) || "en-US", this.setEvents();
|
11854
11870
|
}
|
11855
11871
|
}, {
|
@@ -11891,14 +11907,14 @@ var Zt = /*#__PURE__*/function (_ya$Speech) {
|
|
11891
11907
|
return window.webkitSpeechRecognition || window.SpeechRecognition;
|
11892
11908
|
}
|
11893
11909
|
}]);
|
11894
|
-
return
|
11910
|
+
return Xt;
|
11895
11911
|
}(ya.Speech);
|
11896
|
-
|
11897
|
-
var
|
11898
|
-
Object.defineProperty(
|
11912
|
+
ui.WebSpeech = Xt;
|
11913
|
+
var bi = {};
|
11914
|
+
Object.defineProperty(bi, "__esModule", {
|
11899
11915
|
value: !0
|
11900
11916
|
});
|
11901
|
-
|
11917
|
+
bi.GlobalState = void 0;
|
11902
11918
|
var Xe = /*#__PURE__*/function () {
|
11903
11919
|
function Xe() {
|
11904
11920
|
_classCallCheck(this, Xe);
|
@@ -11913,14 +11929,14 @@ var Xe = /*#__PURE__*/function () {
|
|
11913
11929
|
}]);
|
11914
11930
|
return Xe;
|
11915
11931
|
}();
|
11916
|
-
|
11932
|
+
bi.GlobalState = Xe;
|
11917
11933
|
Xe.doubleClickPending = !1;
|
11918
|
-
var
|
11919
|
-
|
11920
|
-
Object.defineProperty(
|
11934
|
+
var vi = {},
|
11935
|
+
yi = {};
|
11936
|
+
Object.defineProperty(yi, "__esModule", {
|
11921
11937
|
value: !0
|
11922
11938
|
});
|
11923
|
-
|
11939
|
+
yi.PreventConnectionStop = void 0;
|
11924
11940
|
var xa = /*#__PURE__*/function () {
|
11925
11941
|
function xa() {
|
11926
11942
|
_classCallCheck(this, xa);
|
@@ -11940,27 +11956,27 @@ var xa = /*#__PURE__*/function () {
|
|
11940
11956
|
}]);
|
11941
11957
|
return xa;
|
11942
11958
|
}();
|
11943
|
-
|
11944
|
-
var
|
11945
|
-
|
11946
|
-
Object.defineProperty(
|
11959
|
+
yi.PreventConnectionStop = xa;
|
11960
|
+
var xi = {},
|
11961
|
+
Ei = {};
|
11962
|
+
Object.defineProperty(Ei, "__esModule", {
|
11947
11963
|
value: !0
|
11948
11964
|
});
|
11949
|
-
|
11950
|
-
|
11951
|
-
Object.defineProperty(
|
11965
|
+
Ei.README_URL = void 0;
|
11966
|
+
Ei.README_URL = "https://github.com/OvidijusParsiunas/speech-to-element";
|
11967
|
+
Object.defineProperty(xi, "__esModule", {
|
11952
11968
|
value: !0
|
11953
11969
|
});
|
11954
|
-
|
11955
|
-
var
|
11956
|
-
var
|
11957
|
-
function
|
11958
|
-
_classCallCheck(this,
|
11970
|
+
xi.AzureSpeechConfig = void 0;
|
11971
|
+
var Ni = Ei;
|
11972
|
+
var Qt = /*#__PURE__*/function () {
|
11973
|
+
function Qt() {
|
11974
|
+
_classCallCheck(this, Qt);
|
11959
11975
|
}
|
11960
|
-
_createClass(
|
11976
|
+
_createClass(Qt, null, [{
|
11961
11977
|
key: "validateOptions",
|
11962
11978
|
value: function validateOptions(e, t) {
|
11963
|
-
return t ? !t.subscriptionKey && !t.token && !t.retrieveToken ? (e("Please define a 'subscriptionKey', 'token' or 'retrieveToken' property - more info: ".concat(
|
11979
|
+
return t ? !t.subscriptionKey && !t.token && !t.retrieveToken ? (e("Please define a 'subscriptionKey', 'token' or 'retrieveToken' property - more info: ".concat(Ni.README_URL)), !1) : t.region ? !0 : (e("Please define a 'region' property - more info: ".concat(Ni.README_URL)), !1) : (e("Please provide subscription details - more info: ".concat(Ni.README_URL)), !1);
|
11964
11980
|
}
|
11965
11981
|
}, {
|
11966
11982
|
key: "getNewSpeechConfig",
|
@@ -12003,10 +12019,10 @@ var Xt = /*#__PURE__*/function () {
|
|
12003
12019
|
while (1) switch (_context106.prev = _context106.next) {
|
12004
12020
|
case 0:
|
12005
12021
|
_context106.next = 2;
|
12006
|
-
return
|
12022
|
+
return Qt.getNewSpeechConfig(e, t);
|
12007
12023
|
case 2:
|
12008
12024
|
i = _context106.sent;
|
12009
|
-
return _context106.abrupt("return", (i &&
|
12025
|
+
return _context106.abrupt("return", (i && Qt.process(i, t), i));
|
12010
12026
|
case 4:
|
12011
12027
|
case "end":
|
12012
12028
|
return _context106.stop();
|
@@ -12019,14 +12035,14 @@ var Xt = /*#__PURE__*/function () {
|
|
12019
12035
|
return get;
|
12020
12036
|
}()
|
12021
12037
|
}]);
|
12022
|
-
return
|
12038
|
+
return Qt;
|
12023
12039
|
}();
|
12024
|
-
|
12025
|
-
var
|
12026
|
-
Object.defineProperty(
|
12040
|
+
xi.AzureSpeechConfig = Qt;
|
12041
|
+
var _i = {};
|
12042
|
+
Object.defineProperty(_i, "__esModule", {
|
12027
12043
|
value: !0
|
12028
12044
|
});
|
12029
|
-
|
12045
|
+
_i.StopTimeout = void 0;
|
12030
12046
|
var Et = /*#__PURE__*/function () {
|
12031
12047
|
function Et() {
|
12032
12048
|
_classCallCheck(this, Et);
|
@@ -12046,13 +12062,13 @@ var Et = /*#__PURE__*/function () {
|
|
12046
12062
|
}]);
|
12047
12063
|
return Et;
|
12048
12064
|
}();
|
12049
|
-
|
12065
|
+
_i.StopTimeout = Et;
|
12050
12066
|
Et.DEFAULT_MS = 2e4;
|
12051
|
-
var
|
12052
|
-
Object.defineProperty(
|
12067
|
+
var Si = {};
|
12068
|
+
Object.defineProperty(Si, "__esModule", {
|
12053
12069
|
value: !0
|
12054
12070
|
});
|
12055
|
-
|
12071
|
+
Si.AzureTranscript = void 0;
|
12056
12072
|
var Ea = At;
|
12057
12073
|
var _a = /*#__PURE__*/function () {
|
12058
12074
|
function _a() {
|
@@ -12076,28 +12092,28 @@ var _a = /*#__PURE__*/function () {
|
|
12076
12092
|
}]);
|
12077
12093
|
return _a;
|
12078
12094
|
}();
|
12079
|
-
|
12080
|
-
Object.defineProperty(
|
12095
|
+
Si.AzureTranscript = _a;
|
12096
|
+
Object.defineProperty(vi, "__esModule", {
|
12081
12097
|
value: !0
|
12082
12098
|
});
|
12083
|
-
|
12084
|
-
var Fn =
|
12085
|
-
Bn =
|
12086
|
-
|
12087
|
-
zn =
|
12099
|
+
vi.Azure = void 0;
|
12100
|
+
var Fn = yi,
|
12101
|
+
Bn = xi,
|
12102
|
+
Oi = _i,
|
12103
|
+
zn = Si,
|
12088
12104
|
Sa = kt;
|
12089
|
-
var
|
12090
|
-
_inherits(
|
12091
|
-
function
|
12105
|
+
var ei = /*#__PURE__*/function (_Sa$Speech) {
|
12106
|
+
_inherits(ei, _Sa$Speech);
|
12107
|
+
function ei() {
|
12092
12108
|
var _this59;
|
12093
|
-
_classCallCheck(this,
|
12094
|
-
_this59 = _callSuper(this,
|
12109
|
+
_classCallCheck(this, ei);
|
12110
|
+
_this59 = _callSuper(this, ei, arguments), _this59._newTextPadding = "";
|
12095
12111
|
return _this59;
|
12096
12112
|
}
|
12097
|
-
_createClass(
|
12113
|
+
_createClass(ei, [{
|
12098
12114
|
key: "start",
|
12099
12115
|
value: function start(e, t) {
|
12100
|
-
this._newTextPadding = "", this.stopTimeout === void 0 &&
|
12116
|
+
this._newTextPadding = "", this.stopTimeout === void 0 && Oi.StopTimeout.reset(this, e == null ? void 0 : e.stopAfterSilenceMs), this.prepareBeforeStart(e), this.startAsync(e), t || Fn.PreventConnectionStop.applyPrevention(this);
|
12101
12117
|
}
|
12102
12118
|
}, {
|
12103
12119
|
key: "startAsync",
|
@@ -12131,7 +12147,7 @@ var Qt = /*#__PURE__*/function (_Sa$Speech) {
|
|
12131
12147
|
}, {
|
12132
12148
|
key: "validate",
|
12133
12149
|
value: function validate(e) {
|
12134
|
-
return
|
12150
|
+
return ei.getAPI() ? Bn.AzureSpeechConfig.validateOptions(this.error.bind(this), e) : (this.moduleNotFound(), !1);
|
12135
12151
|
}
|
12136
12152
|
}, {
|
12137
12153
|
key: "instantiateService",
|
@@ -12141,7 +12157,7 @@ var Qt = /*#__PURE__*/function (_Sa$Speech) {
|
|
12141
12157
|
return _regeneratorRuntime().wrap(function _callee108$(_context108) {
|
12142
12158
|
while (1) switch (_context108.prev = _context108.next) {
|
12143
12159
|
case 0:
|
12144
|
-
t =
|
12160
|
+
t = ei.getAPI();
|
12145
12161
|
i = t.AudioConfig.fromDefaultMicrophoneInput();
|
12146
12162
|
_context108.next = 4;
|
12147
12163
|
return Bn.AzureSpeechConfig.get(t.SpeechConfig, e);
|
@@ -12176,7 +12192,7 @@ var Qt = /*#__PURE__*/function (_Sa$Speech) {
|
|
12176
12192
|
i = _zn$AzureTranscript$e.interimTranscript,
|
12177
12193
|
n = _zn$AzureTranscript$e.finalTranscript,
|
12178
12194
|
r = _zn$AzureTranscript$e.newText;
|
12179
|
-
|
12195
|
+
Oi.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(i, n, r);
|
12180
12196
|
}
|
12181
12197
|
// WORK - huge opportunity to fix this in the repo!!!!!
|
12182
12198
|
// function onRecognized(sender, recognitionEventArgs) {
|
@@ -12197,7 +12213,7 @@ var Qt = /*#__PURE__*/function (_Sa$Speech) {
|
|
12197
12213
|
n = _zn$AzureTranscript$e2.interimTranscript,
|
12198
12214
|
r = _zn$AzureTranscript$e2.finalTranscript,
|
12199
12215
|
o = _zn$AzureTranscript$e2.newText;
|
12200
|
-
|
12216
|
+
Oi.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(n, r, o), r !== "" && (this._newTextPadding = " ");
|
12201
12217
|
}
|
12202
12218
|
break;
|
12203
12219
|
}
|
@@ -12251,16 +12267,16 @@ var Qt = /*#__PURE__*/function (_Sa$Speech) {
|
|
12251
12267
|
return window.SpeechSDK;
|
12252
12268
|
}
|
12253
12269
|
}]);
|
12254
|
-
return
|
12270
|
+
return ei;
|
12255
12271
|
}(Sa.Speech);
|
12256
|
-
|
12272
|
+
vi.Azure = ei;
|
12257
12273
|
Object.defineProperty(xs, "__esModule", {
|
12258
12274
|
value: !0
|
12259
12275
|
});
|
12260
|
-
var Un =
|
12276
|
+
var Un = ui,
|
12261
12277
|
wa = It,
|
12262
|
-
ie =
|
12263
|
-
Ma =
|
12278
|
+
ie = bi,
|
12279
|
+
Ma = vi;
|
12264
12280
|
var Ke = /*#__PURE__*/function () {
|
12265
12281
|
function Ke() {
|
12266
12282
|
_classCallCheck(this, Ke);
|
@@ -12302,33 +12318,66 @@ var Ke = /*#__PURE__*/function () {
|
|
12302
12318
|
}]);
|
12303
12319
|
return Ke;
|
12304
12320
|
}();
|
12305
|
-
var
|
12306
|
-
var
|
12307
|
-
_inherits(
|
12308
|
-
function
|
12321
|
+
var jt = xs["default"] = Ke;
|
12322
|
+
var ti = /*#__PURE__*/function (_xt) {
|
12323
|
+
_inherits(ti, _xt);
|
12324
|
+
function ti(e, t, i) {
|
12309
12325
|
var _this61;
|
12310
|
-
_classCallCheck(this,
|
12326
|
+
_classCallCheck(this, ti);
|
12311
12327
|
var o;
|
12312
|
-
_this61 = _callSuper(this,
|
12313
|
-
var
|
12314
|
-
n =
|
12315
|
-
r =
|
12316
|
-
if (_this61._addErrorMessage = i, n === "webspeech" && !
|
12328
|
+
_this61 = _callSuper(this, ti, [_typeof(e.speechToText) == "object" ? (o = e.speechToText) == null ? void 0 : o.button : {}]);
|
12329
|
+
var _ti$processConfigurat = ti.processConfiguration(t, e.speechToText),
|
12330
|
+
n = _ti$processConfigurat.serviceName,
|
12331
|
+
r = _ti$processConfigurat.processedConfig;
|
12332
|
+
if (_this61._addErrorMessage = i, n === "webspeech" && !jt.isWebSpeechSupported()) _this61.changeToUnsupported();else {
|
12317
12333
|
var a = !e.textInput || !e.textInput.disabled;
|
12318
12334
|
_this61.elementRef.onclick = _this61.buttonClick.bind(_assertThisInitialized(_this61), t, a, n, r);
|
12319
12335
|
}
|
12320
12336
|
return _this61;
|
12321
12337
|
}
|
12338
|
+
// fix bug to be able to submit after recording
|
12322
12339
|
// prettier-ignore
|
12323
|
-
_createClass(
|
12340
|
+
_createClass(ti, [{
|
12341
|
+
key: "setSilenceTimeout",
|
12342
|
+
value: function setSilenceTimeout(e, t, i, n) {
|
12343
|
+
var _this62 = this;
|
12344
|
+
var r;
|
12345
|
+
this.timeout = setTimeout(function () {
|
12346
|
+
var o, a;
|
12347
|
+
(o = e.submit) == null || o.call(e), jt.stop(), (a = n == null ? void 0 : n.submitAfterSilence) != null && a.stop || setTimeout(function () {
|
12348
|
+
_this62.buttonClick(e, t, i, n);
|
12349
|
+
}, 300);
|
12350
|
+
}, (r = n == null ? void 0 : n.submitAfterSilence) == null ? void 0 : r.ms);
|
12351
|
+
}
|
12352
|
+
}, {
|
12353
|
+
key: "clearSilenceTimeout",
|
12354
|
+
value: function clearSilenceTimeout() {
|
12355
|
+
this.timeout && clearTimeout(this.timeout);
|
12356
|
+
}
|
12357
|
+
}, {
|
12358
|
+
key: "resetSilenceTimeout",
|
12359
|
+
value: function resetSilenceTimeout(e, t, i, n) {
|
12360
|
+
var r;
|
12361
|
+
(r = n == null ? void 0 : n.submitAfterSilence) != null && r.ms && (this.clearSilenceTimeout(), this.setSilenceTimeout(e, t, i, n));
|
12362
|
+
}
|
12363
|
+
}, {
|
12324
12364
|
key: "buttonClick",
|
12325
12365
|
value: function buttonClick(e, t, i, n) {
|
12326
|
-
|
12366
|
+
var _this63 = this;
|
12367
|
+
e.removeTextIfPlaceholder(), jt.toggle(i, _objectSpread({
|
12327
12368
|
insertInCursorLocation: !1,
|
12328
12369
|
element: t ? e.inputElementRef : void 0,
|
12329
|
-
onError:
|
12370
|
+
onError: function onError() {
|
12371
|
+
_this63.onError(), _this63.clearSilenceTimeout();
|
12372
|
+
},
|
12330
12373
|
onStart: this.changeToActive.bind(this),
|
12331
|
-
onStop:
|
12374
|
+
onStop: function onStop() {
|
12375
|
+
_this63.clearSilenceTimeout(), _this63.changeToDefault();
|
12376
|
+
},
|
12377
|
+
onPauseTrigger: function onPauseTrigger(r) {
|
12378
|
+
r ? _this63.resetSilenceTimeout(e, t, i, n) : _this63.clearSilenceTimeout();
|
12379
|
+
},
|
12380
|
+
onResult: this.resetSilenceTimeout.bind(this, e, t, i, n),
|
12332
12381
|
onCommandModeTrigger: this.onCommandModeTrigger.bind(this)
|
12333
12382
|
}, n));
|
12334
12383
|
}
|
@@ -12345,8 +12394,8 @@ var ei = /*#__PURE__*/function (_xt) {
|
|
12345
12394
|
}], [{
|
12346
12395
|
key: "processConfiguration",
|
12347
12396
|
value: function processConfiguration(e, t) {
|
12348
|
-
var _i$displayInterimResu, _i$textColor, _i$translations, _i$commands;
|
12349
|
-
var c;
|
12397
|
+
var _i$displayInterimResu, _i$textColor, _i$translations, _i$commands, _i$submitAfterSilence, _i$submitAfterSilence2;
|
12398
|
+
var c, d;
|
12350
12399
|
var i = _typeof(t) == "object" ? t : {},
|
12351
12400
|
n = _typeof(i.webSpeech) == "object" ? i.webSpeech : {},
|
12352
12401
|
r = i.azure || {},
|
@@ -12354,29 +12403,33 @@ var ei = /*#__PURE__*/function (_xt) {
|
|
12354
12403
|
displayInterimResults: (_i$displayInterimResu = i.displayInterimResults) !== null && _i$displayInterimResu !== void 0 ? _i$displayInterimResu : void 0,
|
12355
12404
|
textColor: (_i$textColor = i.textColor) !== null && _i$textColor !== void 0 ? _i$textColor : void 0,
|
12356
12405
|
translations: (_i$translations = i.translations) !== null && _i$translations !== void 0 ? _i$translations : void 0,
|
12357
|
-
commands: (_i$commands = i.commands) !== null && _i$commands !== void 0 ? _i$commands : void 0
|
12406
|
+
commands: (_i$commands = i.commands) !== null && _i$commands !== void 0 ? _i$commands : void 0,
|
12407
|
+
submitAfterSilence: (_i$submitAfterSilence = i.submitAfterSilence) !== null && _i$submitAfterSilence !== void 0 ? _i$submitAfterSilence : void 0
|
12358
12408
|
}, n), r),
|
12359
12409
|
a = (c = i.commands) == null ? void 0 : c.submit;
|
12360
|
-
return a && (o.onPreResult = function (
|
12361
|
-
return
|
12362
|
-
var
|
12363
|
-
return (
|
12364
|
-
}),
|
12410
|
+
return a && (o.onPreResult = function (u) {
|
12411
|
+
return u.toLowerCase().includes(a) ? (setTimeout(function () {
|
12412
|
+
var h;
|
12413
|
+
return (h = e.submit) == null ? void 0 : h.call(e);
|
12414
|
+
}), jt.endCommandMode(), {
|
12365
12415
|
restart: !0,
|
12366
12416
|
removeNewText: !0
|
12367
12417
|
}) : null;
|
12418
|
+
}), (d = i.submitAfterSilence) != null && d.ms && i.submitAfterSilence.ms > 0 && (o.submitAfterSilence = {
|
12419
|
+
ms: i.submitAfterSilence.ms,
|
12420
|
+
stop: (_i$submitAfterSilence2 = i.submitAfterSilence.stop) !== null && _i$submitAfterSilence2 !== void 0 ? _i$submitAfterSilence2 : !0
|
12368
12421
|
}), {
|
12369
|
-
serviceName:
|
12422
|
+
serviceName: ti.getServiceName(i),
|
12370
12423
|
processedConfig: o
|
12371
12424
|
};
|
12372
12425
|
}
|
12373
12426
|
}, {
|
12374
12427
|
key: "getServiceName",
|
12375
12428
|
value: function getServiceName(e) {
|
12376
|
-
return e.
|
12429
|
+
return e.azure ? "azure" : "webspeech";
|
12377
12430
|
}
|
12378
12431
|
}]);
|
12379
|
-
return
|
12432
|
+
return ti;
|
12380
12433
|
}(xt);
|
12381
12434
|
var Es = /*#__PURE__*/function () {
|
12382
12435
|
function Es() {
|
@@ -12397,11 +12450,11 @@ var Es = /*#__PURE__*/function () {
|
|
12397
12450
|
var Ta = /*#__PURE__*/function (_xt2) {
|
12398
12451
|
_inherits(Ta, _xt2);
|
12399
12452
|
function Ta(e, t) {
|
12400
|
-
var
|
12453
|
+
var _this64;
|
12401
12454
|
_classCallCheck(this, Ta);
|
12402
12455
|
var i, n;
|
12403
|
-
|
12404
|
-
return
|
12456
|
+
_this64 = _callSuper(this, Ta, [t.button]), _this64._waitingForBrowserApproval = !1, _this64._audioType = e, _this64._extension = ((i = t.files) == null ? void 0 : i.format) || "mp3", _this64._maxDurationSeconds = (n = t.files) == null ? void 0 : n.maxDurationSeconds, _this64.elementRef.onclick = _this64.buttonClick.bind(_assertThisInitialized(_this64));
|
12457
|
+
return _this64;
|
12405
12458
|
}
|
12406
12459
|
_createClass(Ta, [{
|
12407
12460
|
key: "buttonClick",
|
@@ -12411,10 +12464,10 @@ var Ta = /*#__PURE__*/function (_xt2) {
|
|
12411
12464
|
}, {
|
12412
12465
|
key: "stop",
|
12413
12466
|
value: function stop() {
|
12414
|
-
var
|
12467
|
+
var _this65 = this;
|
12415
12468
|
return new Promise(function (e) {
|
12416
12469
|
var t, i;
|
12417
|
-
|
12470
|
+
_this65.changeToDefault(), (t = _this65._mediaRecorder) == null || t.stop(), (i = _this65._mediaStream) == null || i.getTracks().forEach(function (n) {
|
12418
12471
|
return n.stop();
|
12419
12472
|
}), setTimeout(function () {
|
12420
12473
|
e();
|
@@ -12424,23 +12477,23 @@ var Ta = /*#__PURE__*/function (_xt2) {
|
|
12424
12477
|
}, {
|
12425
12478
|
key: "record",
|
12426
12479
|
value: function record() {
|
12427
|
-
var
|
12480
|
+
var _this66 = this;
|
12428
12481
|
navigator.mediaDevices.getUserMedia({
|
12429
12482
|
audio: !0
|
12430
12483
|
}).then(function (e) {
|
12431
|
-
|
12432
|
-
|
12433
|
-
}),
|
12484
|
+
_this66.changeToActive(), _this66._mediaRecorder = new MediaRecorder(e), _this66._audioType.addPlaceholderAttachment(_this66.stop.bind(_this66), _this66._maxDurationSeconds), _this66._mediaStream = e, _this66._mediaRecorder.addEventListener("dataavailable", function (t) {
|
12485
|
+
_this66.createFile(t);
|
12486
|
+
}), _this66._mediaRecorder.start();
|
12434
12487
|
})["catch"](function (e) {
|
12435
|
-
console.error(e),
|
12488
|
+
console.error(e), _this66.stop();
|
12436
12489
|
})["finally"](function () {
|
12437
|
-
|
12490
|
+
_this66._waitingForBrowserApproval = !1;
|
12438
12491
|
});
|
12439
12492
|
}
|
12440
12493
|
}, {
|
12441
12494
|
key: "createFile",
|
12442
12495
|
value: function createFile(e) {
|
12443
|
-
var
|
12496
|
+
var _this67 = this;
|
12444
12497
|
var t = new Blob([e.data], {
|
12445
12498
|
type: "audio/".concat(this._extension)
|
12446
12499
|
}),
|
@@ -12450,7 +12503,7 @@ var Ta = /*#__PURE__*/function (_xt2) {
|
|
12450
12503
|
}),
|
12451
12504
|
r = new FileReader();
|
12452
12505
|
r.readAsDataURL(n), r.onload = function (o) {
|
12453
|
-
|
12506
|
+
_this67._audioType.completePlaceholderAttachment(n, o.target.result);
|
12454
12507
|
};
|
12455
12508
|
}
|
12456
12509
|
}]);
|
@@ -12525,23 +12578,23 @@ var Re = /*#__PURE__*/function () {
|
|
12525
12578
|
}]);
|
12526
12579
|
return Re;
|
12527
12580
|
}();
|
12528
|
-
var
|
12581
|
+
var wi = /*#__PURE__*/function (_Tt4) {
|
12529
12582
|
_inherits(k, _Tt4);
|
12530
12583
|
// prettier-ignore
|
12531
12584
|
function k(e, t, i, n, r) {
|
12532
|
-
var
|
12585
|
+
var _this68;
|
12533
12586
|
_classCallCheck(this, k);
|
12534
12587
|
var o = Re.process(e.submitButtonStyles);
|
12535
|
-
|
12588
|
+
_this68 = _callSuper(this, k, [k.createButtonContainerElement(), o == null ? void 0 : o.position, o]), _this68._isSVGLoadingIconOverriden = !1, _this68.status = {
|
12536
12589
|
requestInProgress: !1,
|
12537
12590
|
loadingActive: !1
|
12538
|
-
},
|
12591
|
+
}, _this68._messages = i, _this68._inputElementRef = t, _this68._fileAttachments = r, _this68._innerElements = _this68.createInnerElements(), _this68._abortStream = new AbortController(), _this68._stopClicked = {
|
12539
12592
|
listener: function listener() {}
|
12540
|
-
},
|
12593
|
+
}, _this68._serviceIO = n, _this68._alwaysEnabled = !!(o != null && o.alwaysEnabled), e.disableSubmitButton = _this68.disableSubmitButton.bind(_assertThisInitialized(_this68), n), _this68.attemptOverwriteLoadingStyle(e), setTimeout(function () {
|
12541
12594
|
var a;
|
12542
|
-
|
12595
|
+
_this68._validationHandler = e._validationHandler, _this68.assignHandlers(_this68._validationHandler), (a = _this68._validationHandler) == null || a.call(_assertThisInitialized(_this68));
|
12543
12596
|
});
|
12544
|
-
return
|
12597
|
+
return _this68;
|
12545
12598
|
}
|
12546
12599
|
// prettier-ignore
|
12547
12600
|
_createClass(k, [{
|
@@ -12630,12 +12683,12 @@ var Si = /*#__PURE__*/function (_Tt4) {
|
|
12630
12683
|
key: "programmaticSubmit",
|
12631
12684
|
value: function () {
|
12632
12685
|
var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee110(e) {
|
12633
|
-
var
|
12686
|
+
var _this69 = this;
|
12634
12687
|
var t;
|
12635
12688
|
return _regeneratorRuntime().wrap(function _callee110$(_context110) {
|
12636
12689
|
while (1) switch (_context110.prev = _context110.next) {
|
12637
12690
|
case 0:
|
12638
|
-
typeof e == "string" && (e =
|
12691
|
+
typeof e == "string" && (e = se.processSubmitUserMessage(e));
|
12639
12692
|
t = {
|
12640
12693
|
text: e.text
|
12641
12694
|
};
|
@@ -12645,7 +12698,7 @@ var Si = /*#__PURE__*/function (_Tt4) {
|
|
12645
12698
|
type: fe.getTypeFromBlob(i)
|
12646
12699
|
};
|
12647
12700
|
})), setTimeout(function () {
|
12648
|
-
return
|
12701
|
+
return _this69.attemptSubmit(t, !0);
|
12649
12702
|
});
|
12650
12703
|
case 3:
|
12651
12704
|
case "end":
|
@@ -12809,10 +12862,10 @@ var Si = /*#__PURE__*/function (_Tt4) {
|
|
12809
12862
|
}]);
|
12810
12863
|
return k;
|
12811
12864
|
}(Tt);
|
12812
|
-
|
12813
|
-
|
12814
|
-
|
12815
|
-
var Aa =
|
12865
|
+
wi.SUBMIT_CLASS = "submit-button";
|
12866
|
+
wi.LOADING_CLASS = "loading-button";
|
12867
|
+
wi.DISABLED_CLASS = "disabled-button";
|
12868
|
+
var Aa = wi;
|
12816
12869
|
var ka = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M27.1 14.313V5.396L24.158 8.34c-2.33-2.325-5.033-3.503-8.11-3.503C9.902 4.837 4.901 9.847 4.899 16c.001 6.152 5.003 11.158 11.15 11.16 4.276 0 9.369-2.227 10.836-8.478l.028-.122h-3.23l-.022.068c-1.078 3.242-4.138 5.421-7.613 5.421a8 8 0 0 1-5.691-2.359A7.993 7.993 0 0 1 8 16.001c0-4.438 3.611-8.049 8.05-8.049 2.069 0 3.638.58 5.924 2.573l-3.792 3.789H27.1z\"/>\n</svg>\n",
|
12817
12870
|
Ia = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>capture</title>\n <path d=\"M0 16q0 3.264 1.28 6.208t3.392 5.12 5.12 3.424 6.208 1.248 6.208-1.248 5.12-3.424 3.392-5.12 1.28-6.208-1.28-6.208-3.392-5.12-5.088-3.392-6.24-1.28q-3.264 0-6.208 1.28t-5.12 3.392-3.392 5.12-1.28 6.208zM4 16q0-3.264 1.6-6.016t4.384-4.352 6.016-1.632 6.016 1.632 4.384 4.352 1.6 6.016-1.6 6.048-4.384 4.352-6.016 1.6-6.016-1.6-4.384-4.352-1.6-6.048z\"></path>\n</svg>\n",
|
12818
12871
|
La = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z\"/>\n</svg>",
|
@@ -12821,14 +12874,14 @@ var rn = /*#__PURE__*/function (_ct) {
|
|
12821
12874
|
_inherits(rn, _ct);
|
12822
12875
|
// prettier-ignore
|
12823
12876
|
function rn(e, t, i, n) {
|
12824
|
-
var
|
12877
|
+
var _this70;
|
12825
12878
|
_classCallCheck(this, rn);
|
12826
|
-
|
12827
|
-
var
|
12828
|
-
r =
|
12829
|
-
o =
|
12830
|
-
|
12831
|
-
return
|
12879
|
+
_this70 = _callSuper(this, rn, [e, ["modal-content", "modal-camera-content"], i]), _this70._stopped = !1, _this70._format = "image/png", _this70._canvas = document.createElement("canvas"), _this70._canvas.classList.add("camera-modal-canvas");
|
12880
|
+
var _this70$addButtonsAnd = _this70.addButtonsAndTheirEvents(t),
|
12881
|
+
r = _this70$addButtonsAnd.captureButton,
|
12882
|
+
o = _this70$addButtonsAnd.submitButton;
|
12883
|
+
_this70._captureButton = r, _this70._submitButton = o, _this70._captureIcon = _this70._captureButton.children[0], _this70._refreshIcon = V.createSVGElement(ka), _this70._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (n == null ? void 0 : n.format) === "jpeg" && (_this70._format = "image/jpeg"), n != null && n.dimensions && (_this70._dimensions = n.dimensions), _this70._contentRef.appendChild(_this70._canvas), _this70.extensionCloseCallback = _this70.stop;
|
12884
|
+
return _this70;
|
12832
12885
|
}
|
12833
12886
|
_createClass(rn, [{
|
12834
12887
|
key: "addButtonsAndTheirEvents",
|
@@ -12847,38 +12900,38 @@ var rn = /*#__PURE__*/function (_ct) {
|
|
12847
12900
|
}, {
|
12848
12901
|
key: "addButtonEvents",
|
12849
12902
|
value: function addButtonEvents(e, t, i, n) {
|
12850
|
-
var
|
12903
|
+
var _this71 = this;
|
12851
12904
|
e.onclick = function () {
|
12852
|
-
|
12905
|
+
_this71.capture();
|
12853
12906
|
}, t.addEventListener("click", this.stop.bind(this)), i.onclick = function () {
|
12854
|
-
var r =
|
12855
|
-
r && Ct.addFilesToType([r], [n]),
|
12907
|
+
var r = _this71.getFile();
|
12908
|
+
r && Ct.addFilesToType([r], [n]), _this71.stop(), _this71.close();
|
12856
12909
|
};
|
12857
12910
|
}
|
12858
12911
|
}, {
|
12859
12912
|
key: "stop",
|
12860
12913
|
value: function stop() {
|
12861
|
-
var
|
12914
|
+
var _this72 = this;
|
12862
12915
|
this._mediaStream && this._mediaStream.getTracks().forEach(function (e) {
|
12863
12916
|
return e.stop();
|
12864
12917
|
}), this._stopped = !0, setTimeout(function () {
|
12865
|
-
|
12866
|
-
var e =
|
12867
|
-
e == null || e.clearRect(0, 0,
|
12918
|
+
_this72._captureButton.replaceChildren(_this72._captureIcon), _this72._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
|
12919
|
+
var e = _this72._canvas.getContext("2d");
|
12920
|
+
e == null || e.clearRect(0, 0, _this72._canvas.width, _this72._canvas.height);
|
12868
12921
|
}, ct.MODAL_CLOSE_TIMEOUT_MS);
|
12869
12922
|
}
|
12870
12923
|
}, {
|
12871
12924
|
key: "start",
|
12872
12925
|
value: function start() {
|
12873
|
-
var
|
12926
|
+
var _this73 = this;
|
12874
12927
|
this._dataURL = void 0, this._submitButton.classList.add("modal-svg-submit-disabled"), this._stopped = !1, navigator.mediaDevices.getUserMedia({
|
12875
12928
|
video: this._dimensions || !0
|
12876
12929
|
}).then(function (e) {
|
12877
|
-
if (
|
12930
|
+
if (_this73._mediaStream = e, !_this73.isOpen()) return _this73.stop();
|
12878
12931
|
var t = document.createElement("video");
|
12879
|
-
t.srcObject = e, t.play(), requestAnimationFrame(
|
12932
|
+
t.srcObject = e, t.play(), requestAnimationFrame(_this73.updateCanvas.bind(_this73, t, _this73._canvas));
|
12880
12933
|
})["catch"](function (e) {
|
12881
|
-
console.error(e),
|
12934
|
+
console.error(e), _this73.stop(), _this73.close();
|
12882
12935
|
});
|
12883
12936
|
}
|
12884
12937
|
}, {
|
@@ -12932,22 +12985,22 @@ var rn = /*#__PURE__*/function (_ct) {
|
|
12932
12985
|
return rn;
|
12933
12986
|
}(ct);
|
12934
12987
|
var Na = "<?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=\"M29 7h-4.599l-2.401-4h-12l-2.4 4h-4.6c-1 0-3 1-3 2.969v16.031c0 1.657 1.5 3 2.792 3h26.271c1.313 0 2.938-1.406 2.938-2.968v-16.032c0-1-1-3-3-3zM30 26.032c0 0.395-0.639 0.947-0.937 0.969h-26.265c-0.232-0.019-0.797-0.47-0.797-1v-16.031c0-0.634 0.851-0.953 1-0.969h5.732l2.4-4h9.802l1.785 3.030 0.55 0.97h5.731c0.705 0 0.99 0.921 1 1v16.032zM16 10c-3.866 0-7 3.134-7 7s3.134 7 7 7 7-3.134 7-7-3.134-7-7-7zM16 22c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5z\"></path>\n</svg>";
|
12935
|
-
var
|
12936
|
-
_inherits(
|
12937
|
-
function
|
12938
|
-
var
|
12939
|
-
_classCallCheck(this,
|
12988
|
+
var ii = /*#__PURE__*/function (_Tt5) {
|
12989
|
+
_inherits(ii, _Tt5);
|
12990
|
+
function ii(e, t, i) {
|
12991
|
+
var _this74;
|
12992
|
+
_classCallCheck(this, ii);
|
12940
12993
|
var r;
|
12941
|
-
|
12942
|
-
var n =
|
12943
|
-
i &&
|
12944
|
-
return
|
12994
|
+
_this74 = _callSuper(this, ii, [ii.createButtonElement(), (r = i == null ? void 0 : i.button) == null ? void 0 : r.position, (i == null ? void 0 : i.button) || {}, "Photo"]);
|
12995
|
+
var n = _this74.createInnerElements(_this74._customStyles);
|
12996
|
+
i && _this74.addClickEvent(e, t, i.modalContainerStyle, i.files), _this74.elementRef.classList.add("upload-file-button"), _this74.elementRef.appendChild(n.styles), _this74.reapplyStateStyle("styles");
|
12997
|
+
return _this74;
|
12945
12998
|
}
|
12946
|
-
_createClass(
|
12999
|
+
_createClass(ii, [{
|
12947
13000
|
key: "createInnerElements",
|
12948
13001
|
value: function createInnerElements(e) {
|
12949
13002
|
return {
|
12950
|
-
styles: this.createInnerElement(
|
13003
|
+
styles: this.createInnerElement(ii.createSVGIconElement(), "styles", e)
|
12951
13004
|
};
|
12952
13005
|
}
|
12953
13006
|
}, {
|
@@ -12976,7 +13029,7 @@ var ti = /*#__PURE__*/function (_Tt5) {
|
|
12976
13029
|
return e.id = "camera-icon", e;
|
12977
13030
|
}
|
12978
13031
|
}]);
|
12979
|
-
return
|
13032
|
+
return ii;
|
12980
13033
|
}(Tt);
|
12981
13034
|
var mt = /*#__PURE__*/function () {
|
12982
13035
|
function mt(e, t, i, n) {
|
@@ -12986,7 +13039,7 @@ var mt = /*#__PURE__*/function () {
|
|
12986
13039
|
o = {},
|
12987
13040
|
a = this.createFileUploadComponents(e, i, n, o);
|
12988
13041
|
e.speechToText && !o.microphone && (o.microphone = {
|
12989
|
-
button: new
|
13042
|
+
button: new ti(e, r, t.addNewErrorMessage.bind(t))
|
12990
13043
|
});
|
12991
13044
|
var l = new Aa(e, r.inputElementRef, t, i, a);
|
12992
13045
|
r.submit = l.submitFromInput.bind(l), Ie.attach(e, i, r, a, l), e.submitUserMessage = l.programmaticSubmit.bind(l), o.submit = {
|
@@ -13003,7 +13056,7 @@ var mt = /*#__PURE__*/function () {
|
|
13003
13056
|
if (mt.createUploadButtons(e, t.fileTypes || {}, r, i, n), (o = t.camera) != null && o.files) {
|
13004
13057
|
var d = ((a = n.images) == null ? void 0 : a.fileType) || r.addType(e, t.camera.files, "images");
|
13005
13058
|
n.camera = {
|
13006
|
-
button: new
|
13059
|
+
button: new ii(i, d, t.camera)
|
13007
13060
|
};
|
13008
13061
|
}
|
13009
13062
|
if ((l = t.recordAudio) != null && l.files) {
|
@@ -13076,7 +13129,7 @@ var on = /*#__PURE__*/function () {
|
|
13076
13129
|
}]);
|
13077
13130
|
return on;
|
13078
13131
|
}();
|
13079
|
-
var Oa = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#large-loading-ring{display:inline-block;width:50px;height:50px}#large-loading-ring:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:large-loading-ring 1.4s linear infinite}@keyframes large-loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#insert-key-view{height:100%;position:relative}#insert-key-contents{text-align:center;position:absolute;top:44%;left:50%;transform:translate(-50%,-50%);width:82%;display:flex;max-width:700px}#insert-key-title{margin-bottom:15px}#insert-key-input-container{margin-right:2.7em;width:calc(100% - 80px)}#insert-key-input{padding:.3em 1.7em .3em .3em;border-width:1px;border-style:solid;border-radius:3px;width:100%;font-size:inherit}.insert-key-input-valid{border-color:gray}.insert-key-input-invalid{border-color:red}#visibility-icon-container{position:relative;float:right;cursor:pointer;-webkit-user-select:none;user-select:none}.visibility-icon{filter:brightness(0) saturate(100%) invert(63%) sepia(1%) saturate(9%) hue-rotate(43deg) brightness(98%) contrast(92%);position:absolute;right:-1.7em;top:-1.43em}#visible-icon{top:-1.4em}.visibility-icon:hover{filter:unset}.visibility-icon>*{pointer-events:none}#start-button{border:1px solid grey;color:#454545;border-radius:4px;width:3em;display:flex;justify-content:center;align-items:center;cursor:pointer;padding:.28em .3em;-webkit-user-select:none;user-select:none;background-color:#fff}#start-button:hover{background-color:#f2f2f2}#start-button:active{background-color:#d2d2d2}#insert-key-help-text-container{width:100%;position:absolute;margin-top:32px;margin-bottom:20px}#insert-key-help-text-contents{width:100%;position:absolute}#insert-key-input-invalid-text{display:block;margin-top:1em;margin-bottom:.5em;color:red}.insert-key-input-help-text{display:block;margin-top:16px}#loading-ring{display:inline-block;width:16px;height:16px}#loading-ring:after{content:\" \";display:block;width:11px;height:11px;margin:1px;border-radius:50%;border:2px solid #0084ff;border-color:#0084ff transparent #0084ff transparent;animation:loading-ring 1.2s linear infinite}@keyframes loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#error-view{color:red;font-size:1.2em;line-height:1.3em;margin-top:-5px;text-align:center;height:100%;display:flex;justify-content:center;align-items:center;padding-left:8px;padding-right:8px}.intro-panel{position:absolute;display:flex;justify-content:center;right:0;bottom:0;left:0;margin:auto;height:fit-content;top:-2.5em}#internal-intro-panel{width:250px;height:min-content;display:block;border-radius:5px;overflow:auto;border:1px solid rgb(203,203,203);padding:10px;max-height:calc(100% - 6.8em)}#internal-intro-panel>p{margin-block-start:.8em;margin-block-end:.8em}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!\n Theme: a11y-dark\n Author: @ericwbailey\n Maintainer: @ericwbailey\n\n Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css\n*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.loading-message-text{width:1em;padding:.6em .75em .6em 1.3em}.message-bubble>p:first-child{margin-top:0}.message-bubble>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message-bubble{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.deep-chat-web-model-button{margin-top:10px;margin-bottom:5px;margin-left:1px}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:2}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:1;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.dots-jumping{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:dots-jumping 1.5s infinite linear;bottom:-.75em}@keyframes dots-jumping{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.dots-flashing{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite linear alternate;animation-delay:.5s}.dots-flashing:before,.dots-flashing:after{content:\"\";display:inline-block;position:absolute;top:0}.dots-flashing:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:0s}.dots-flashing:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:1s}@keyframes dots-flashing{0%{background-color:var(--message-dots-color)}50%,to{background-color:var(--message-dots-color-fade)}}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button:hover{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.loading-button{cursor:auto}.loading-button:hover{background-color:unset}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}.text-input-placeholder{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative;margin-right:.56em}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}.dropup-menu-item-text{margin-top:.08em;width:max-content}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}\n";
|
13132
|
+
var Oa = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#large-loading-ring{display:inline-block;width:50px;height:50px}#large-loading-ring:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:large-loading-ring 1.4s linear infinite}@keyframes large-loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#insert-key-view{height:100%;position:relative}#insert-key-contents{text-align:center;position:absolute;top:44%;left:50%;transform:translate(-50%,-50%);width:82%;display:flex;max-width:700px}#insert-key-title{margin-bottom:15px}#insert-key-input-container{margin-right:2.7em;width:calc(100% - 80px)}#insert-key-input{padding:.3em 1.7em .3em .3em;border-width:1px;border-style:solid;border-radius:3px;width:100%;font-size:inherit}.insert-key-input-valid{border-color:gray}.insert-key-input-invalid{border-color:red}#visibility-icon-container{position:relative;float:right;cursor:pointer;-webkit-user-select:none;user-select:none}.visibility-icon{filter:brightness(0) saturate(100%) invert(63%) sepia(1%) saturate(9%) hue-rotate(43deg) brightness(98%) contrast(92%);position:absolute;right:-1.7em;top:-1.43em}#visible-icon{top:-1.4em}.visibility-icon:hover{filter:unset}.visibility-icon>*{pointer-events:none}#start-button{border:1px solid grey;color:#454545;border-radius:4px;width:3em;display:flex;justify-content:center;align-items:center;cursor:pointer;padding:.28em .3em;-webkit-user-select:none;user-select:none;background-color:#fff}#start-button:hover{background-color:#f2f2f2}#start-button:active{background-color:#d2d2d2}#insert-key-help-text-container{width:100%;position:absolute;margin-top:32px;margin-bottom:20px}#insert-key-help-text-contents{width:100%;position:absolute}#insert-key-input-invalid-text{display:block;margin-top:1em;margin-bottom:.5em;color:red}.insert-key-input-help-text{display:block;margin-top:16px}#loading-ring{display:inline-block;width:16px;height:16px}#loading-ring:after{content:\" \";display:block;width:11px;height:11px;margin:1px;border-radius:50%;border:2px solid #0084ff;border-color:#0084ff transparent #0084ff transparent;animation:loading-ring 1.2s linear infinite}@keyframes loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#error-view{color:red;font-size:1.2em;line-height:1.3em;margin-top:-5px;text-align:center;height:100%;display:flex;justify-content:center;align-items:center;padding-left:8px;padding-right:8px}.intro-panel{position:absolute;display:flex;justify-content:center;right:0;bottom:0;left:0;margin:auto;height:fit-content;top:-2.5em}#internal-intro-panel{width:250px;height:min-content;display:block;border-radius:5px;overflow:auto;border:1px solid rgb(203,203,203);padding:10px;max-height:calc(100% - 6.8em)}#internal-intro-panel>p{margin-block-start:.8em;margin-block-end:.8em}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!\n Theme: a11y-dark\n Author: @ericwbailey\n Maintainer: @ericwbailey\n\n Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css\n*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.loading-message-text{width:1em;padding:.6em .75em .6em 1.3em}.message-bubble>p:first-child{margin-top:0}.message-bubble>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message-bubble{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:2}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:1;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.dots-jumping{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:dots-jumping 1.5s infinite linear;bottom:-.75em}@keyframes dots-jumping{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.dots-flashing{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite linear alternate;animation-delay:.5s}.dots-flashing:before,.dots-flashing:after{content:\"\";display:inline-block;position:absolute;top:0}.dots-flashing:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:0s}.dots-flashing:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:1s}@keyframes dots-flashing{0%{background-color:var(--message-dots-color)}50%,to{background-color:var(--message-dots-color-fade)}}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button:hover{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.loading-button{cursor:auto}.loading-button:hover{background-color:unset}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}.text-input-placeholder{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative;margin-right:.56em}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}.dropup-menu-item-text{margin-top:.08em;width:max-content}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}.deep-chat-web-model-button{margin-top:10px;margin-bottom:5px;margin-left:1px}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}\n";
|
13080
13133
|
var Pa = Object.defineProperty,
|
13081
13134
|
Da = Object.getOwnPropertyDescriptor,
|
13082
13135
|
_ = function _(s, e, t, i) {
|
@@ -13086,34 +13139,34 @@ var Pa = Object.defineProperty,
|
|
13086
13139
|
var y = /*#__PURE__*/function (_So) {
|
13087
13140
|
_inherits(y, _So);
|
13088
13141
|
function y() {
|
13089
|
-
var
|
13142
|
+
var _this75;
|
13090
13143
|
_classCallCheck(this, y);
|
13091
|
-
|
13144
|
+
_this75 = _callSuper(this, y), _this75.getMessages = function () {
|
13092
13145
|
return [];
|
13093
|
-
},
|
13146
|
+
}, _this75.submitUserMessage = function () {
|
13094
13147
|
return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
|
13095
|
-
},
|
13096
|
-
return ii.focusFromParentElement(_this73._elementRef);
|
13097
|
-
}, _this73.refreshMessages = function () {}, _this73.clearMessages = function () {}, _this73.scrollToBottom = function () {}, _this73.disableSubmitButton = function () {}, _this73._hasBeenRendered = !1, _this73._auxiliaryStyleApplied = !1, _this73._addMessage = function () {
|
13148
|
+
}, _this75.addMessage = function () {
|
13098
13149
|
return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
|
13099
|
-
},
|
13150
|
+
}, _this75.focusInput = function () {
|
13151
|
+
return ni.focusFromParentElement(_this75._elementRef);
|
13152
|
+
}, _this75.refreshMessages = function () {}, _this75.clearMessages = function () {}, _this75.scrollToBottom = function () {}, _this75.disableSubmitButton = function () {}, _this75._hasBeenRendered = !1, _this75._auxiliaryStyleApplied = !1, Ko.appendStyleSheetToHead(), _this75._elementRef = document.createElement("div"), _this75._elementRef.id = "container", _this75.attachShadow({
|
13100
13153
|
mode: "open"
|
13101
|
-
}).appendChild(
|
13102
|
-
|
13154
|
+
}).appendChild(_this75._elementRef), Mi.apply(Oa, _this75.shadowRoot), setTimeout(function () {
|
13155
|
+
_this75._hasBeenRendered || _this75.onRender();
|
13103
13156
|
}, 20);
|
13104
|
-
return
|
13157
|
+
return _this75;
|
13105
13158
|
}
|
13106
13159
|
_createClass(y, [{
|
13107
13160
|
key: "changeToChatView",
|
13108
13161
|
value: function changeToChatView() {
|
13109
|
-
this._activeService && (this._activeService.
|
13162
|
+
this._activeService && (this._activeService.validateKeyProperty = !1), this.onRender();
|
13110
13163
|
}
|
13111
13164
|
// prettier-ignore
|
13112
13165
|
}, {
|
13113
13166
|
key: "onRender",
|
13114
13167
|
value: function onRender() {
|
13115
13168
|
var _this$_childElement;
|
13116
|
-
|
13169
|
+
se.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = $o.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (Mi.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Mi.applyDefaultStyleToComponent(this.style, this.chatStyle), se.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? zt.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], on.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof H && P.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, Ut.onRender(this);
|
13117
13170
|
}
|
13118
13171
|
}, {
|
13119
13172
|
key: "disconnectedCallback",
|
@@ -13155,7 +13208,7 @@ _([E("object")], y.prototype, "mixedFiles", 2);
|
|
13155
13208
|
_([E("object")], y.prototype, "dragAndDrop", 2);
|
13156
13209
|
_([E("object")], y.prototype, "introPanelStyle", 2);
|
13157
13210
|
_([E("object")], y.prototype, "htmlClassUtilities", 2);
|
13158
|
-
_([E("function")], y.prototype, "
|
13211
|
+
_([E("function")], y.prototype, "onMessage", 2);
|
13159
13212
|
_([E("function")], y.prototype, "onClearMessages", 2);
|
13160
13213
|
_([E("function")], y.prototype, "onComponentRender", 2);
|
13161
13214
|
_([E("function")], y.prototype, "onError", 2);
|