deep-chat-dev 9.0.134 → 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 +1048 -920
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.d.ts +5 -4
- package/dist/deepChat.d.ts.map +1 -1
- package/dist/deepChat.js +701 -645
- 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 +6 -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/dist/views/chat/messages/setupMessages.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;
|
@@ -515,25 +515,40 @@ var fe = /*#__PURE__*/function () {
|
|
515
515
|
var t;
|
516
516
|
(t = e.children[0]) != null && t.classList.contains("deep-chat-update-message") && (console.error('The "deep-chat-update-message" html class is deprecated since version 1.4.4.'), console.error("Please change to using {..., overwrite: true} object: https://deepchat.dev/docs/connect#Response"));
|
517
517
|
}
|
518
|
+
}, {
|
519
|
+
key: "processConnect",
|
520
|
+
value: function processConnect(e) {
|
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 connect object: https://deepchat.dev/docs/connect#connect-1"));
|
523
|
+
}
|
518
524
|
}, {
|
519
525
|
key: "checkForStream",
|
520
526
|
value: function checkForStream(e) {
|
521
527
|
var t = e.stream;
|
522
|
-
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
|
+
}));
|
523
538
|
}
|
524
539
|
}]);
|
525
|
-
return
|
540
|
+
return se;
|
526
541
|
}();
|
527
542
|
var ks = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8c3ZnIGZpbGw9IiMwMDAwMDAiIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIAoJCXZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+Cgk8cGF0aCBkPSJNMjMsMzAuMzZIOWMtMi40MDQsMC00LjM2LTEuOTU2LTQuMzYtNC4zNlYxNWMwLTIuNDA0LDEuOTU2LTQuMzYsNC4zNi00LjM2aDMuNjU5CgkJYzAuMTY3LTEuNTY2LDEuNDE1LTIuODEzLDIuOTgxLTIuOTgxVjUuMzMzYy0xLjEzMS0wLjE3NC0yLTEuMTU0LTItMi4zMzNjMC0xLjMwMSwxLjA1OS0yLjM2LDIuMzYtMi4zNgoJCWMxLjMwMiwwLDIuMzYsMS4wNTksMi4zNiwyLjM2YzAsMS4xNzktMC44NjksMi4xNTktMiwyLjMzM1Y3LjY2YzEuNTY2LDAuMTY3LDIuODE0LDEuNDE1LDIuOTgxLDIuOTgxSDIzCgkJYzIuNDA0LDAsNC4zNiwxLjk1Niw0LjM2LDQuMzZ2MTFDMjcuMzYsMjguNDA0LDI1LjQwNCwzMC4zNiwyMywzMC4zNnogTTksMTEuMzZjLTIuMDA3LDAtMy42NCwxLjYzMy0zLjY0LDMuNjR2MTEKCQljMCwyLjAwNywxLjYzMywzLjY0LDMuNjQsMy42NGgxNGMyLjAwNywwLDMuNjQtMS42MzMsMy42NC0zLjY0VjE1YzAtMi4wMDctMS42MzMtMy42NC0zLjY0LTMuNjRIOXogTTEzLjM4NCwxMC42NGg1LjIzMQoJCUMxOC40MzksOS4zNTQsMTcuMzM0LDguMzYsMTYsOC4zNkMxNC42NjcsOC4zNiwxMy41NjEsOS4zNTQsMTMuMzg0LDEwLjY0eiBNMTYsMS4zNmMtMC45MDQsMC0xLjY0LDAuNzM2LTEuNjQsMS42NAoJCVMxNS4wOTYsNC42NCwxNiw0LjY0YzAuOTA0LDAsMS42NC0wLjczNiwxLjY0LTEuNjRTMTYuOTA0LDEuMzYsMTYsMS4zNnogTTIwLDI3LjM2aC04Yy0xLjMwMSwwLTIuMzYtMS4wNTktMi4zNi0yLjM2CgkJczEuMDU5LTIuMzYsMi4zNi0yLjM2aDhjMS4zMDIsMCwyLjM2LDEuMDU5LDIuMzYsMi4zNlMyMS4zMDIsMjcuMzYsMjAsMjcuMzZ6IE0xMiwyMy4zNmMtMC45MDQsMC0xLjY0LDAuNzM1LTEuNjQsMS42NAoJCXMwLjczNiwxLjY0LDEuNjQsMS42NGg4YzAuOTA0LDAsMS42NC0wLjczNSwxLjY0LTEuNjRzLTAuNzM1LTEuNjQtMS42NC0xLjY0SDEyeiBNMzEsMjMuODZoLTJjLTAuMTk5LDAtMC4zNi0wLjE2MS0wLjM2LTAuMzZWMTUKCQljMC0wLjE5OSwwLjE2MS0wLjM2LDAuMzYtMC4zNmgyYzAuMTk5LDAsMC4zNiwwLjE2MSwwLjM2LDAuMzZ2OC41QzMxLjM2LDIzLjY5OSwzMS4xOTksMjMuODYsMzEsMjMuODZ6IE0yOS4zNiwyMy4xNGgxLjI3OXYtNy43OAoJCUgyOS4zNlYyMy4xNHogTTMsMjMuODZIMWMtMC4xOTksMC0wLjM2LTAuMTYxLTAuMzYtMC4zNlYxNWMwLTAuMTk5LDAuMTYxLTAuMzYsMC4zNi0wLjM2aDJjMC4xOTksMCwwLjM2LDAuMTYxLDAuMzYsMC4zNnY4LjUKCQlDMy4zNiwyMy42OTksMy4xOTksMjMuODYsMywyMy44NnogTTEuMzYsMjMuMTRoMS4yOHYtNy43OEgxLjM2VjIzLjE0eiBNMjAsMjAuMzZjLTEuMzAyLDAtMi4zNi0xLjA1OS0yLjM2LTIuMzYKCQlzMS4wNTktMi4zNiwyLjM2LTIuMzZzMi4zNiwxLjA1OSwyLjM2LDIuMzZDMjIuMzYsMTkuMzAyLDIxLjMwMiwyMC4zNiwyMCwyMC4zNnogTTIwLDE2LjM2Yy0wLjkwNCwwLTEuNjQsMC43MzYtMS42NCwxLjY0CgkJczAuNzM1LDEuNjQsMS42NCwxLjY0czEuNjQtMC43MzUsMS42NC0xLjY0UzIwLjkwNCwxNi4zNiwyMCwxNi4zNnogTTEyLDIwLjM2Yy0xLjMwMSwwLTIuMzYtMS4wNTktMi4zNi0yLjM2czEuMDU5LTIuMzYsMi4zNi0yLjM2CgkJczIuMzYsMS4wNTksMi4zNiwyLjM2QzE0LjM2LDE5LjMwMiwxMy4zMDEsMjAuMzYsMTIsMjAuMzZ6IE0xMiwxNi4zNmMtMC45MDQsMC0xLjY0LDAuNzM2LTEuNjQsMS42NHMwLjczNiwxLjY0LDEuNjQsMS42NAoJCXMxLjY0LTAuNzM1LDEuNjQtMS42NFMxMi45MDQsMTYuMzYsMTIsMTYuMzZ6Ii8+Cgk8cmVjdCBzdHlsZT0iZmlsbDpub25lOyIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIi8+Cjwvc3ZnPg==",
|
528
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==",
|
529
544
|
Kn = /*#__PURE__*/function () {
|
530
|
-
function
|
531
|
-
_classCallCheck(this,
|
545
|
+
function oe() {
|
546
|
+
_classCallCheck(this, oe);
|
532
547
|
}
|
533
|
-
_createClass(
|
548
|
+
_createClass(oe, null, [{
|
534
549
|
key: "hide",
|
535
550
|
value: function hide(e) {
|
536
|
-
e.getElementsByClassName(
|
551
|
+
e.getElementsByClassName(oe.CONTAINER_CLASS)[0].style.visibility = "hidden";
|
537
552
|
}
|
538
553
|
}, {
|
539
554
|
key: "applyCustomStylesToElements",
|
@@ -544,10 +559,10 @@ var ks = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNv
|
|
544
559
|
key: "applyCustomStyles",
|
545
560
|
value: function applyCustomStyles(e, t, i, n) {
|
546
561
|
var r, o, a, l;
|
547
|
-
if ((r = i["default"]) != null && r.styles &&
|
548
|
-
(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);
|
549
564
|
var c = (l = i[n]) == null ? void 0 : l.styles;
|
550
|
-
c &&
|
565
|
+
c && oe.applyCustomStylesToElements(e, t, c);
|
551
566
|
}
|
552
567
|
}
|
553
568
|
}, {
|
@@ -557,7 +572,7 @@ var ks = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNv
|
|
557
572
|
var i = document.createElement("img");
|
558
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");
|
559
574
|
var n = document.createElement("div");
|
560
|
-
return n.classList.add(
|
575
|
+
return n.classList.add(oe.CONTAINER_CLASS), n.appendChild(i), t && oe.applyCustomStyles(n, i, t, e), n;
|
561
576
|
}
|
562
577
|
}, {
|
563
578
|
key: "getPosition",
|
@@ -571,12 +586,12 @@ var ks = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNv
|
|
571
586
|
key: "add",
|
572
587
|
value: function add(e, t, i) {
|
573
588
|
var n = typeof i == "boolean" ? void 0 : i,
|
574
|
-
r =
|
575
|
-
o =
|
589
|
+
r = oe.createAvatar(t, n),
|
590
|
+
o = oe.getPosition(t, n);
|
576
591
|
r.classList.add(o === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(o === "left" ? "beforebegin" : "afterend", r);
|
577
592
|
}
|
578
593
|
}]);
|
579
|
-
return
|
594
|
+
return oe;
|
580
595
|
}();
|
581
596
|
Kn.CONTAINER_CLASS = "avatar-container";
|
582
597
|
var cn = Kn;
|
@@ -628,7 +643,7 @@ var Yn = /*#__PURE__*/function () {
|
|
628
643
|
}();
|
629
644
|
Yn.NAME_CLASS = "name";
|
630
645
|
var dn = Yn;
|
631
|
-
var
|
646
|
+
var si = /*#__PURE__*/function () {
|
632
647
|
function Me() {
|
633
648
|
_classCallCheck(this, Me);
|
634
649
|
}
|
@@ -720,10 +735,10 @@ var ni = /*#__PURE__*/function () {
|
|
720
735
|
}]);
|
721
736
|
return Me;
|
722
737
|
}();
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
var b =
|
738
|
+
si.AI_ROLE = "ai";
|
739
|
+
si.USER_ROLE = "user";
|
740
|
+
si.EMPTY_MESSAGE_CLASS = "empty-message";
|
741
|
+
var b = si;
|
727
742
|
var Le = /*#__PURE__*/function () {
|
728
743
|
function Le() {
|
729
744
|
_classCallCheck(this, Le);
|
@@ -840,7 +855,7 @@ var Ee = /*#__PURE__*/function () {
|
|
840
855
|
var o = i.getElementsByClassName(r);
|
841
856
|
Array.from(o || []).forEach(function (a) {
|
842
857
|
var l = Ee.getProcessedStyles(t, a, r);
|
843
|
-
|
858
|
+
ce.applyStylesToElement(a, l), Ee.applyEvents(a, r);
|
844
859
|
});
|
845
860
|
});
|
846
861
|
var n = i.getElementsByClassName(Rs);
|
@@ -851,11 +866,11 @@ var Ee = /*#__PURE__*/function () {
|
|
851
866
|
}]);
|
852
867
|
return Ee;
|
853
868
|
}();
|
854
|
-
var
|
855
|
-
function
|
856
|
-
_classCallCheck(this,
|
869
|
+
var ce = /*#__PURE__*/function () {
|
870
|
+
function ce() {
|
871
|
+
_classCallCheck(this, ce);
|
857
872
|
}
|
858
|
-
_createClass(
|
873
|
+
_createClass(ce, null, [{
|
859
874
|
key: "applyStylesToElement",
|
860
875
|
value: function applyStylesToElement(e, t) {
|
861
876
|
var i = C.processStateful(t, {}, {});
|
@@ -874,7 +889,7 @@ var le = /*#__PURE__*/function () {
|
|
874
889
|
value: function applyClassUtilitiesToElement(e, t) {
|
875
890
|
var i = t.events,
|
876
891
|
n = t.styles;
|
877
|
-
i &&
|
892
|
+
i && ce.applyEventsToElement(e, i), n && !Ee.doesElementContainDeepChatClass(e) && ce.applyStylesToElement(e, n);
|
878
893
|
}
|
879
894
|
}, {
|
880
895
|
key: "applyCustomClassUtilities",
|
@@ -882,17 +897,17 @@ var le = /*#__PURE__*/function () {
|
|
882
897
|
Object.keys(e).forEach(function (i) {
|
883
898
|
var n = t.getElementsByClassName(i);
|
884
899
|
Array.from(n).forEach(function (r) {
|
885
|
-
e[i] &&
|
900
|
+
e[i] && ce.applyClassUtilitiesToElement(r, e[i]);
|
886
901
|
});
|
887
902
|
});
|
888
903
|
}
|
889
904
|
}, {
|
890
905
|
key: "apply",
|
891
906
|
value: function apply(e, t) {
|
892
|
-
Ee.applyDeepChatUtilities(e, e.htmlClassUtilities, t),
|
907
|
+
Ee.applyDeepChatUtilities(e, e.htmlClassUtilities, t), ce.applyCustomClassUtilities(e.htmlClassUtilities, t);
|
893
908
|
}
|
894
909
|
}]);
|
895
|
-
return
|
910
|
+
return ce;
|
896
911
|
}();
|
897
912
|
var Qe = /*#__PURE__*/function () {
|
898
913
|
function Qe() {
|
@@ -914,7 +929,7 @@ var Qe = /*#__PURE__*/function () {
|
|
914
929
|
value: function overwrite(e, t, i, n) {
|
915
930
|
var r = e.messages,
|
916
931
|
o = b.overwriteMessage(r, n, t, i, "html", "html-message");
|
917
|
-
return o && (o.bubbleElement.innerHTML = t,
|
932
|
+
return o && (o.bubbleElement.innerHTML = t, ce.apply(e, o.outerContainer), se.flagHTMLUpdateClass(o.bubbleElement)), o;
|
918
933
|
}
|
919
934
|
// prettier-ignore
|
920
935
|
}, {
|
@@ -927,7 +942,7 @@ var Qe = /*#__PURE__*/function () {
|
|
927
942
|
r.status = !1;
|
928
943
|
}
|
929
944
|
var o = Qe.createElements(e, t, i);
|
930
|
-
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;
|
931
946
|
}
|
932
947
|
}]);
|
933
948
|
return Qe;
|
@@ -985,11 +1000,11 @@ var Bs = /[&<>"]/,
|
|
985
1000
|
">": ">",
|
986
1001
|
'"': """
|
987
1002
|
};
|
988
|
-
function
|
1003
|
+
function Hs(s) {
|
989
1004
|
return Us[s];
|
990
1005
|
}
|
991
1006
|
function U(s) {
|
992
|
-
return Bs.test(s) ? s.replace(zs,
|
1007
|
+
return Bs.test(s) ? s.replace(zs, Hs) : s;
|
993
1008
|
}
|
994
1009
|
var g = {};
|
995
1010
|
g.blockquote_open = function () {
|
@@ -1297,7 +1312,7 @@ W.prototype.disable = function (s) {
|
|
1297
1312
|
W.prototype.getRules = function (s) {
|
1298
1313
|
return this.__cache__ === null && this.__compile__(), this.__cache__[s] || [];
|
1299
1314
|
};
|
1300
|
-
function
|
1315
|
+
function qs(s) {
|
1301
1316
|
s.inlineMode ? s.tokens.push({
|
1302
1317
|
type: "inline",
|
1303
1318
|
content: s.src.replace(/\n/g, " ").trim(),
|
@@ -1505,7 +1520,7 @@ function Ks(s) {
|
|
1505
1520
|
}
|
1506
1521
|
}
|
1507
1522
|
var hn = " \n()[]'\".,!?-";
|
1508
|
-
function
|
1523
|
+
function Ti(s) {
|
1509
1524
|
return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1");
|
1510
1525
|
}
|
1511
1526
|
function Ys(s) {
|
@@ -1523,11 +1538,11 @@ function Ys(s) {
|
|
1523
1538
|
h,
|
1524
1539
|
p = s.tokens;
|
1525
1540
|
if (s.env.abbreviations) {
|
1526
|
-
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) {
|
1527
1542
|
return m.substr(1);
|
1528
1543
|
}).sort(function (m, f) {
|
1529
1544
|
return f.length - m.length;
|
1530
|
-
}).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") {
|
1531
1546
|
for (n = p[t].children, e = n.length - 1; e >= 0; e--) if (r = n[e], r.type === "text") {
|
1532
1547
|
for (l = 0, o = r.content, d.lastIndex = 0, c = r.level, a = []; u = d.exec(o);) d.lastIndex > l && a.push({
|
1533
1548
|
type: "text",
|
@@ -1580,7 +1595,7 @@ var ir = /['"]/,
|
|
1580
1595
|
function mn(s, e) {
|
1581
1596
|
return e < 0 || e >= s.length ? !1 : !nr.test(s[e]);
|
1582
1597
|
}
|
1583
|
-
function
|
1598
|
+
function qe(s, e, t) {
|
1584
1599
|
return s.substr(0, e) + t + s.substr(e + 1);
|
1585
1600
|
}
|
1586
1601
|
function sr(s) {
|
@@ -1592,12 +1607,12 @@ function sr(s) {
|
|
1592
1607
|
S.length = p + 1, i = t.content, r = 0, o = i.length;
|
1593
1608
|
e: for (; r < o && (pn.lastIndex = r, n = pn.exec(i), !!n);) {
|
1594
1609
|
if (l = !mn(i, n.index - 1), r = n.index + 1, m = n[0] === "'", c = !mn(i, r), !c && !l) {
|
1595
|
-
m && (t.content =
|
1610
|
+
m && (t.content = qe(t.content, n.index, fn));
|
1596
1611
|
continue;
|
1597
1612
|
}
|
1598
1613
|
if (u = !c, h = !l, h) {
|
1599
1614
|
for (p = S.length - 1; p >= 0 && (d = S[p], !(S[p].level < a)); p--) if (d.single === m && S[p].level === a) {
|
1600
|
-
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;
|
1601
1616
|
continue e;
|
1602
1617
|
}
|
1603
1618
|
}
|
@@ -1606,16 +1621,16 @@ function sr(s) {
|
|
1606
1621
|
pos: n.index,
|
1607
1622
|
single: m,
|
1608
1623
|
level: a
|
1609
|
-
}) : h && m && (t.content =
|
1624
|
+
}) : h && m && (t.content = qe(t.content, n.index, fn));
|
1610
1625
|
}
|
1611
1626
|
}
|
1612
1627
|
}
|
1613
1628
|
}
|
1614
1629
|
}
|
1615
|
-
var
|
1630
|
+
var Ci = [["block", qs], ["abbr", Vs], ["references", Js], ["inline", $s], ["footnote_tail", Ks], ["abbr2", Ys], ["replacements", tr], ["smartquotes", sr]];
|
1616
1631
|
function ss() {
|
1617
1632
|
this.options = {}, this.ruler = new W();
|
1618
|
-
for (var s = 0; s <
|
1633
|
+
for (var s = 0; s < Ci.length; s++) this.ruler.push(Ci[s][0], Ci[s][1]);
|
1619
1634
|
}
|
1620
1635
|
ss.prototype.process = function (s) {
|
1621
1636
|
var e, t, i;
|
@@ -1807,7 +1822,7 @@ function dr(s, e, t, i) {
|
|
1807
1822
|
J,
|
1808
1823
|
X,
|
1809
1824
|
O,
|
1810
|
-
|
1825
|
+
q,
|
1811
1826
|
Q = !0,
|
1812
1827
|
ee,
|
1813
1828
|
I,
|
@@ -1827,12 +1842,12 @@ function dr(s, e, t, i) {
|
|
1827
1842
|
level: s.level++
|
1828
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({
|
1829
1844
|
type: "list_item_open",
|
1830
|
-
lines:
|
1845
|
+
lines: q = [e, 0],
|
1831
1846
|
level: s.level++
|
1832
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({
|
1833
1848
|
type: "list_item_close",
|
1834
1849
|
level: --s.level
|
1835
|
-
}), 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));) {
|
1836
1851
|
for (te = !1, I = 0, Rt = ee.length; I < Rt; I++) if (ee[I](s, n, t, !0)) {
|
1837
1852
|
te = !0;
|
1838
1853
|
break;
|
@@ -1952,14 +1967,14 @@ function br(s, e, t, i) {
|
|
1952
1967
|
content: s.getLines(e, o, 0, !0)
|
1953
1968
|
}), !0;
|
1954
1969
|
}
|
1955
|
-
function
|
1970
|
+
function Ai(s, e) {
|
1956
1971
|
var t = s.bMarks[e] + s.blkIndent,
|
1957
1972
|
i = s.eMarks[e];
|
1958
1973
|
return s.src.substr(t, i - t);
|
1959
1974
|
}
|
1960
1975
|
function vr(s, e, t, i) {
|
1961
1976
|
var n, r, o, a, l, c, d, u, h, p, m;
|
1962
|
-
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;
|
1963
1978
|
for (u = [], a = 0; a < c.length; a++) {
|
1964
1979
|
if (h = c[a].trim(), !h) {
|
1965
1980
|
if (a === 0 || a === c.length - 1) continue;
|
@@ -1968,7 +1983,7 @@ function vr(s, e, t, i) {
|
|
1968
1983
|
if (!/^:?-+:?$/.test(h)) return !1;
|
1969
1984
|
h.charCodeAt(h.length - 1) === 58 ? u.push(h.charCodeAt(0) === 58 ? "center" : "right") : h.charCodeAt(0) === 58 ? u.push("left") : u.push("");
|
1970
1985
|
}
|
1971
|
-
if (r =
|
1986
|
+
if (r = Ai(s, e).trim(), r.indexOf("|") === -1 || (c = r.replace(/^\||\|$/g, "").split("|"), u.length !== c.length)) return !1;
|
1972
1987
|
if (i) return !0;
|
1973
1988
|
for (s.tokens.push({
|
1974
1989
|
type: "table_open",
|
@@ -2007,7 +2022,7 @@ function vr(s, e, t, i) {
|
|
2007
2022
|
type: "tbody_open",
|
2008
2023
|
lines: m = [e + 2, 0],
|
2009
2024
|
level: s.level++
|
2010
|
-
}), 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++) {
|
2011
2026
|
for (c = r.replace(/^\||\|$/g, "").split("|"), s.tokens.push({
|
2012
2027
|
type: "tr_open",
|
2013
2028
|
level: s.level++
|
@@ -2526,8 +2541,8 @@ function zr(s, e) {
|
|
2526
2541
|
})), s.pos = i, s.posMax = o, !0);
|
2527
2542
|
}
|
2528
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"],
|
2529
|
-
|
2530
|
-
|
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]*)>/;
|
2531
2546
|
function Gr(s, e) {
|
2532
2547
|
var t,
|
2533
2548
|
i,
|
@@ -2535,7 +2550,7 @@ function Gr(s, e) {
|
|
2535
2550
|
r,
|
2536
2551
|
o,
|
2537
2552
|
a = s.pos;
|
2538
|
-
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({
|
2539
2554
|
type: "link_open",
|
2540
2555
|
href: o,
|
2541
2556
|
level: s.level
|
@@ -2546,7 +2561,7 @@ function Gr(s, e) {
|
|
2546
2561
|
}), s.push({
|
2547
2562
|
type: "link_close",
|
2548
2563
|
level: s.level
|
2549
|
-
})), 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({
|
2550
2565
|
type: "link_open",
|
2551
2566
|
href: o,
|
2552
2567
|
level: s.level
|
@@ -2559,7 +2574,7 @@ function Gr(s, e) {
|
|
2559
2574
|
level: s.level
|
2560
2575
|
})), s.pos += n[0].length, !0) : !1) : !1));
|
2561
2576
|
}
|
2562
|
-
function
|
2577
|
+
function ri(s, e) {
|
2563
2578
|
return s = s.source, e = e || "", function t(i, n) {
|
2564
2579
|
return i ? (n = n.source || n, s = s.replace(i, n), t) : new RegExp(s, e);
|
2565
2580
|
};
|
@@ -2568,15 +2583,15 @@ var Vr = /[a-zA-Z_:][a-zA-Z0-9:._-]*/,
|
|
2568
2583
|
Wr = /[^"'=<>`\x00-\x20]+/,
|
2569
2584
|
Jr = /'[^']*'/,
|
2570
2585
|
$r = /"[^"]*"/,
|
2571
|
-
Kr =
|
2572
|
-
Yr =
|
2573
|
-
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)(),
|
2574
2589
|
Xr = /<\/[A-Za-z][A-Za-z0-9]*\s*>/,
|
2575
2590
|
Qr = /<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,
|
2576
2591
|
eo = /<[?].*?[?]>/,
|
2577
2592
|
to = /<![A-Z]+\s+[^>]*>/,
|
2578
2593
|
io = /<!\[CDATA\[[\s\S]*?\]\]>/,
|
2579
|
-
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)();
|
2580
2595
|
function so(s) {
|
2581
2596
|
var e = s | 32;
|
2582
2597
|
return e >= 97 && e <= 122;
|
@@ -2611,13 +2626,13 @@ function lo(s, e) {
|
|
2611
2626
|
}
|
2612
2627
|
return e || (s.pending += "&"), s.pos++, !0;
|
2613
2628
|
}
|
2614
|
-
var
|
2615
|
-
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() {
|
2616
2631
|
this.ruler = new W();
|
2617
|
-
for (var s = 0; s <
|
2632
|
+
for (var s = 0; s < ki.length; s++) this.ruler.push(ki[s][0], ki[s][1]);
|
2618
2633
|
this.validateLink = co;
|
2619
2634
|
}
|
2620
|
-
|
2635
|
+
oi.prototype.skipToken = function (s) {
|
2621
2636
|
var e = this.ruler.getRules(""),
|
2622
2637
|
t = e.length,
|
2623
2638
|
i = s.pos,
|
@@ -2633,7 +2648,7 @@ ri.prototype.skipToken = function (s) {
|
|
2633
2648
|
}
|
2634
2649
|
s.pos++, s.cacheSet(i, s.pos);
|
2635
2650
|
};
|
2636
|
-
|
2651
|
+
oi.prototype.tokenize = function (s) {
|
2637
2652
|
for (var e = this.ruler.getRules(""), t = e.length, i = s.posMax, n, r; s.pos < i;) {
|
2638
2653
|
for (r = 0; r < t && (n = e[r](s, !1), !n); r++);
|
2639
2654
|
if (n) {
|
@@ -2644,7 +2659,7 @@ ri.prototype.tokenize = function (s) {
|
|
2644
2659
|
}
|
2645
2660
|
s.pending && s.pushPending();
|
2646
2661
|
};
|
2647
|
-
|
2662
|
+
oi.prototype.parse = function (s, e, t, i) {
|
2648
2663
|
var n = new je(s, this, e, t, i);
|
2649
2664
|
this.tokenize(n);
|
2650
2665
|
};
|
@@ -2771,7 +2786,7 @@ function os(s, e, t) {
|
|
2771
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;
|
2772
2787
|
}
|
2773
2788
|
function me(s, e) {
|
2774
|
-
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 || {});
|
2775
2790
|
}
|
2776
2791
|
me.prototype.set = function (s) {
|
2777
2792
|
Xn(this.options, s);
|
@@ -2896,7 +2911,7 @@ var as = /*#__PURE__*/function () {
|
|
2896
2911
|
t.scrollTop = t.scrollHeight;
|
2897
2912
|
}
|
2898
2913
|
}
|
2899
|
-
// 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
|
2900
2915
|
// But it is not actually used by anything in the chat, hence it is removed when adding a message
|
2901
2916
|
// after the body has been stringified and parsed - the file reference will disappear, hence this readds it
|
2902
2917
|
}, {
|
@@ -2919,22 +2934,22 @@ var as = /*#__PURE__*/function () {
|
|
2919
2934
|
return We;
|
2920
2935
|
}();
|
2921
2936
|
as.DEFAULT_FILE_NAME = "file";
|
2922
|
-
var
|
2923
|
-
var
|
2924
|
-
function
|
2925
|
-
_classCallCheck(this,
|
2937
|
+
var le = as;
|
2938
|
+
var Ut = /*#__PURE__*/function () {
|
2939
|
+
function Ut() {
|
2940
|
+
_classCallCheck(this, Ut);
|
2926
2941
|
}
|
2927
|
-
_createClass(
|
2928
|
-
key: "
|
2929
|
-
value: function
|
2942
|
+
_createClass(Ut, null, [{
|
2943
|
+
key: "onMessage",
|
2944
|
+
value: function onMessage(e, t, i) {
|
2930
2945
|
var r;
|
2931
2946
|
var n = JSON.parse(JSON.stringify({
|
2932
2947
|
message: t,
|
2933
|
-
|
2948
|
+
isHistory: i
|
2934
2949
|
}));
|
2935
|
-
|
2950
|
+
le.reAddFileRefToObject(t, n), (r = e.onMessage) == null || r.call(e, n), e.dispatchEvent(new CustomEvent("message", {
|
2936
2951
|
detail: n
|
2937
|
-
}));
|
2952
|
+
})), se.fireOnNewMessage(e, n);
|
2938
2953
|
}
|
2939
2954
|
}, {
|
2940
2955
|
key: "onClearMessages",
|
@@ -2959,7 +2974,7 @@ var zt = /*#__PURE__*/function () {
|
|
2959
2974
|
}));
|
2960
2975
|
}
|
2961
2976
|
}]);
|
2962
|
-
return
|
2977
|
+
return Ut;
|
2963
2978
|
}();
|
2964
2979
|
var D = /*#__PURE__*/function () {
|
2965
2980
|
function D() {
|
@@ -3015,7 +3030,7 @@ var Ye = /*#__PURE__*/function () {
|
|
3015
3030
|
function Ye(e) {
|
3016
3031
|
var _this3 = this;
|
3017
3032
|
_classCallCheck(this, Ye);
|
3018
|
-
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 () {
|
3019
3034
|
_this3.submitUserMessage = e.submitUserMessage;
|
3020
3035
|
});
|
3021
3036
|
}
|
@@ -3099,7 +3114,7 @@ var Ye = /*#__PURE__*/function () {
|
|
3099
3114
|
value: function sendClientUpdate(e) {
|
3100
3115
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
3101
3116
|
var i;
|
3102
|
-
(i = this.
|
3117
|
+
(i = this._onMessage) == null || i.call(this, e, t);
|
3103
3118
|
}
|
3104
3119
|
}, {
|
3105
3120
|
key: "renderText",
|
@@ -3210,7 +3225,7 @@ var Ki = /*#__PURE__*/function () {
|
|
3210
3225
|
var e = this._messages.textElementsToText;
|
3211
3226
|
if (!(this._fileAdded && !this._elements)) {
|
3212
3227
|
if (!this._elements) throw Error(A.NO_VALID_STREAM_EVENTS_SENT);
|
3213
|
-
(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);
|
3214
3229
|
}
|
3215
3230
|
}
|
3216
3231
|
}, {
|
@@ -3291,10 +3306,10 @@ var ls = /*#__PURE__*/function () {
|
|
3291
3306
|
}(function (e, t, i, n) {
|
3292
3307
|
var o, a;
|
3293
3308
|
var r = {
|
3294
|
-
method: ((o = e.
|
3309
|
+
method: ((o = e.connectSettings) == null ? void 0 : o.method) || "POST",
|
3295
3310
|
headers: t
|
3296
3311
|
};
|
3297
|
-
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);
|
3298
3313
|
})
|
3299
3314
|
}, {
|
3300
3315
|
key: "processResponseByType",
|
@@ -3474,7 +3489,7 @@ function Eo(s, e) {
|
|
3474
3489
|
p.accept || (p.accept = Fi);
|
3475
3490
|
var m;
|
3476
3491
|
function f() {
|
3477
|
-
m.abort(), document.hidden ||
|
3492
|
+
m.abort(), document.hidden || q();
|
3478
3493
|
}
|
3479
3494
|
l || document.addEventListener("visibilitychange", f);
|
3480
3495
|
var x = xo,
|
@@ -3487,11 +3502,11 @@ function Eo(s, e) {
|
|
3487
3502
|
});
|
3488
3503
|
var X = c !== null && c !== void 0 ? c : window.fetch,
|
3489
3504
|
O = n !== null && n !== void 0 ? n : _o;
|
3490
|
-
function
|
3491
|
-
return
|
3505
|
+
function q() {
|
3506
|
+
return _q.apply(this, arguments);
|
3492
3507
|
}
|
3493
|
-
function
|
3494
|
-
|
3508
|
+
function _q() {
|
3509
|
+
_q = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
3495
3510
|
var Q, ee, I;
|
3496
3511
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
3497
3512
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -3525,7 +3540,7 @@ function Eo(s, e) {
|
|
3525
3540
|
_context3.t0 = _context3["catch"](1);
|
3526
3541
|
if (!m.signal.aborted) try {
|
3527
3542
|
I = (Q = a == null ? void 0 : a(_context3.t0)) !== null && Q !== void 0 ? Q : x;
|
3528
|
-
window.clearTimeout(S), S = window.setTimeout(
|
3543
|
+
window.clearTimeout(S), S = window.setTimeout(q, I);
|
3529
3544
|
} catch (I) {
|
3530
3545
|
J(), h(I);
|
3531
3546
|
}
|
@@ -3535,9 +3550,9 @@ function Eo(s, e) {
|
|
3535
3550
|
}
|
3536
3551
|
}, _callee3, null, [[1, 14]]);
|
3537
3552
|
}));
|
3538
|
-
return
|
3553
|
+
return _q.apply(this, arguments);
|
3539
3554
|
}
|
3540
|
-
|
3555
|
+
q();
|
3541
3556
|
});
|
3542
3557
|
}
|
3543
3558
|
function _o(s) {
|
@@ -3578,7 +3593,7 @@ var T = /*#__PURE__*/function () {
|
|
3578
3593
|
n = _args6.length > 3 && _args6[3] !== undefined ? _args6[3] : !0;
|
3579
3594
|
r = {
|
3580
3595
|
body: t,
|
3581
|
-
headers: (m = e.
|
3596
|
+
headers: (m = e.connectSettings) == null ? void 0 : m.headers
|
3582
3597
|
};
|
3583
3598
|
_context6.next = 4;
|
3584
3599
|
return v.processRequestInterceptor(e.deepChat, r);
|
@@ -3597,23 +3612,23 @@ var T = /*#__PURE__*/function () {
|
|
3597
3612
|
}
|
3598
3613
|
return _context6.abrupt("return", v.onInterceptorError(i, l, d));
|
3599
3614
|
case 14:
|
3600
|
-
if (!((f = e.
|
3615
|
+
if (!((f = e.connectSettings) != null && f.handler)) {
|
3601
3616
|
_context6.next = 16;
|
3602
3617
|
break;
|
3603
3618
|
}
|
3604
|
-
return _context6.abrupt("return",
|
3619
|
+
return _context6.abrupt("return", pe.stream(e, o, i));
|
3605
3620
|
case 16:
|
3606
|
-
if (!(((x = e.
|
3621
|
+
if (!(((x = e.connectSettings) == null ? void 0 : x.url) === _e.URL)) {
|
3607
3622
|
_context6.next = 18;
|
3608
3623
|
break;
|
3609
3624
|
}
|
3610
3625
|
return _context6.abrupt("return", _e.requestStream(i, e.streamHandlers));
|
3611
3626
|
case 18:
|
3612
3627
|
h = new Oe(i), p = v.fetch.bind(this, e, a, n);
|
3613
|
-
Eo(((S = e.
|
3614
|
-
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",
|
3615
3630
|
headers: a,
|
3616
|
-
credentials: (X = e.
|
3631
|
+
credentials: (X = e.connectSettings) == null ? void 0 : X.credentials,
|
3617
3632
|
body: n ? JSON.stringify(o) : o,
|
3618
3633
|
openWhenHidden: !0,
|
3619
3634
|
// keep stream open when browser tab not open
|
@@ -3641,7 +3656,7 @@ var T = /*#__PURE__*/function () {
|
|
3641
3656
|
},
|
3642
3657
|
onmessage: function onmessage(O) {
|
3643
3658
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
3644
|
-
var
|
3659
|
+
var q, Q, ee, I, Rt;
|
3645
3660
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
3646
3661
|
while (1) switch (_context5.prev = _context5.next) {
|
3647
3662
|
case 0:
|
@@ -3655,7 +3670,7 @@ var T = /*#__PURE__*/function () {
|
|
3655
3670
|
I = {};
|
3656
3671
|
}
|
3657
3672
|
_context5.next = 4;
|
3658
|
-
return (Q = (
|
3673
|
+
return (Q = (q = e.deepChat).responseInterceptor) == null ? void 0 : Q.call(q, I);
|
3659
3674
|
case 4:
|
3660
3675
|
_context5.t0 = _context5.sent;
|
3661
3676
|
if (_context5.t0) {
|
@@ -3685,8 +3700,8 @@ var T = /*#__PURE__*/function () {
|
|
3685
3700
|
},
|
3686
3701
|
signal: u.signal
|
3687
3702
|
})["catch"](function (O) {
|
3688
|
-
var
|
3689
|
-
i.isLastMessageError() || (
|
3703
|
+
var q;
|
3704
|
+
i.isLastMessageError() || (q = e.extractResultData) == null || q.call(e, O).then(function () {
|
3690
3705
|
v.displayError(i, O);
|
3691
3706
|
})["catch"](function (Q) {
|
3692
3707
|
v.displayError(i, Q);
|
@@ -3844,18 +3859,18 @@ var B = /*#__PURE__*/function () {
|
|
3844
3859
|
_createClass(B, null, [{
|
3845
3860
|
key: "setup",
|
3846
3861
|
value: function setup(e) {
|
3847
|
-
e.
|
3862
|
+
e.connectSettings.url !== _e.URL && (e.permittedErrorPrefixes = ["Connection error", "Error in server message"], e.websocket = "pending");
|
3848
3863
|
}
|
3849
3864
|
}, {
|
3850
3865
|
key: "createConnection",
|
3851
3866
|
value: function createConnection(e, t) {
|
3852
3867
|
if (!document.body.contains(e.deepChat)) return;
|
3853
|
-
var i = e.
|
3868
|
+
var i = e.connectSettings.websocket;
|
3854
3869
|
if (i) {
|
3855
|
-
if (e.
|
3870
|
+
if (e.connectSettings.handler) return pe.websocket(e, t);
|
3856
3871
|
try {
|
3857
3872
|
var n = typeof i != "boolean" ? i : void 0,
|
3858
|
-
r = new WebSocket(e.
|
3873
|
+
r = new WebSocket(e.connectSettings.url || "", n);
|
3859
3874
|
e.websocket = r, e.websocket.onopen = function () {
|
3860
3875
|
var o, a;
|
3861
3876
|
t.removeError(), e.websocket && _typeof(e.websocket) == "object" && B.assignListeners(e, r, t), (a = (o = e.deepChat)._validationHandler) == null || a.call(o);
|
@@ -3963,7 +3978,7 @@ var B = /*#__PURE__*/function () {
|
|
3963
3978
|
case 4:
|
3964
3979
|
o = {
|
3965
3980
|
body: t,
|
3966
|
-
headers: (d = e.
|
3981
|
+
headers: (d = e.connectSettings) == null ? void 0 : d.headers
|
3967
3982
|
};
|
3968
3983
|
_context9.next = 7;
|
3969
3984
|
return v.processRequestInterceptor(e.deepChat, o);
|
@@ -3984,7 +3999,7 @@ var B = /*#__PURE__*/function () {
|
|
3984
3999
|
return _context9.abrupt("return", r.newUserMessage.listener(a));
|
3985
4000
|
case 14:
|
3986
4001
|
c = n ? JSON.stringify(a) : a;
|
3987
|
-
if (!(((u = e.
|
4002
|
+
if (!(((u = e.connectSettings) == null ? void 0 : u.url) === _e.URL)) {
|
3988
4003
|
_context9.next = 17;
|
3989
4004
|
break;
|
3990
4005
|
}
|
@@ -4028,11 +4043,11 @@ var B = /*#__PURE__*/function () {
|
|
4028
4043
|
}]);
|
4029
4044
|
return B;
|
4030
4045
|
}();
|
4031
|
-
var
|
4032
|
-
function
|
4033
|
-
_classCallCheck(this,
|
4046
|
+
var pe = /*#__PURE__*/function () {
|
4047
|
+
function pe() {
|
4048
|
+
_classCallCheck(this, pe);
|
4034
4049
|
}
|
4035
|
-
_createClass(
|
4050
|
+
_createClass(pe, null, [{
|
4036
4051
|
key: "request",
|
4037
4052
|
value: function () {
|
4038
4053
|
var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(e, t, i) {
|
@@ -4075,8 +4090,8 @@ var he = /*#__PURE__*/function () {
|
|
4075
4090
|
return function r(_x22) {
|
4076
4091
|
return _ref3.apply(this, arguments);
|
4077
4092
|
};
|
4078
|
-
}(), o =
|
4079
|
-
(l = (a = e.
|
4093
|
+
}(), o = pe.generateOptionalSignals();
|
4094
|
+
(l = (a = e.connectSettings).handler) == null || l.call(a, t, _objectSpread(_objectSpread({}, o), {}, {
|
4080
4095
|
onResponse: r
|
4081
4096
|
}));
|
4082
4097
|
case 3:
|
@@ -4111,7 +4126,7 @@ var he = /*#__PURE__*/function () {
|
|
4111
4126
|
r || !n || (e.streamHandlers.onOpen(), r = !0);
|
4112
4127
|
},
|
4113
4128
|
l = function l() {
|
4114
|
-
n && (
|
4129
|
+
n && (pe.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), n = !1);
|
4115
4130
|
},
|
4116
4131
|
c = /*#__PURE__*/function () {
|
4117
4132
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(p) {
|
@@ -4148,10 +4163,10 @@ var he = /*#__PURE__*/function () {
|
|
4148
4163
|
};
|
4149
4164
|
}();
|
4150
4165
|
e.streamHandlers.abortStream.abort = function () {
|
4151
|
-
|
4166
|
+
pe.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), n = !1;
|
4152
4167
|
};
|
4153
|
-
var d =
|
4154
|
-
(h = (u = e.
|
4168
|
+
var d = pe.generateOptionalSignals();
|
4169
|
+
(h = (u = e.connectSettings).handler) == null || h.call(u, t, _objectSpread(_objectSpread({}, d), {}, {
|
4155
4170
|
onOpen: a,
|
4156
4171
|
onResponse: c,
|
4157
4172
|
onClose: l,
|
@@ -4215,8 +4230,8 @@ var he = /*#__PURE__*/function () {
|
|
4215
4230
|
return _ref5.apply(this, arguments);
|
4216
4231
|
};
|
4217
4232
|
}(),
|
4218
|
-
a =
|
4219
|
-
(c = (l = e.
|
4233
|
+
a = pe.generateOptionalSignals();
|
4234
|
+
(c = (l = e.connectSettings).handler) == null || c.call(l, void 0, _objectSpread(_objectSpread({}, a), {}, {
|
4220
4235
|
onOpen: n,
|
4221
4236
|
onResponse: o,
|
4222
4237
|
onClose: r,
|
@@ -4238,7 +4253,7 @@ var he = /*#__PURE__*/function () {
|
|
4238
4253
|
};
|
4239
4254
|
}
|
4240
4255
|
}]);
|
4241
|
-
return
|
4256
|
+
return pe;
|
4242
4257
|
}();
|
4243
4258
|
var w = /*#__PURE__*/function () {
|
4244
4259
|
function w() {
|
@@ -4268,7 +4283,7 @@ var w = /*#__PURE__*/function () {
|
|
4268
4283
|
n = _args15.length > 3 && _args15[3] !== undefined ? _args15[3] : !0;
|
4269
4284
|
r = {
|
4270
4285
|
body: t,
|
4271
|
-
headers: (h = e.
|
4286
|
+
headers: (h = e.connectSettings) == null ? void 0 : h.headers
|
4272
4287
|
};
|
4273
4288
|
_context15.next = 4;
|
4274
4289
|
return v.processRequestInterceptor(e.deepChat, r);
|
@@ -4284,13 +4299,13 @@ var w = /*#__PURE__*/function () {
|
|
4284
4299
|
}
|
4285
4300
|
return _context15.abrupt("return", v.onInterceptorError(i, l, c));
|
4286
4301
|
case 11:
|
4287
|
-
if (!((p = e.
|
4302
|
+
if (!((p = e.connectSettings) != null && p.handler)) {
|
4288
4303
|
_context15.next = 13;
|
4289
4304
|
break;
|
4290
4305
|
}
|
4291
|
-
return _context15.abrupt("return",
|
4306
|
+
return _context15.abrupt("return", pe.request(e, o, i));
|
4292
4307
|
case 13:
|
4293
|
-
if (!(((m = e.
|
4308
|
+
if (!(((m = e.connectSettings) == null ? void 0 : m.url) === _e.URL)) {
|
4294
4309
|
_context15.next = 15;
|
4295
4310
|
break;
|
4296
4311
|
}
|
@@ -4440,7 +4455,7 @@ var w = /*#__PURE__*/function () {
|
|
4440
4455
|
n = _args17.length > 3 && _args17[3] !== undefined ? _args17[3] : !0;
|
4441
4456
|
r = {
|
4442
4457
|
body: t,
|
4443
|
-
headers: (p = e.
|
4458
|
+
headers: (p = e.connectSettings) == null ? void 0 : p.headers
|
4444
4459
|
};
|
4445
4460
|
_context17.next = 4;
|
4446
4461
|
return v.processRequestInterceptor(e.deepChat, r);
|
@@ -4455,12 +4470,12 @@ var w = /*#__PURE__*/function () {
|
|
4455
4470
|
}
|
4456
4471
|
return _context17.abrupt("return", v.onInterceptorError(i, l));
|
4457
4472
|
case 10:
|
4458
|
-
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 = {
|
4459
4474
|
method: d,
|
4460
4475
|
body: u,
|
4461
4476
|
headers: a
|
4462
4477
|
};
|
4463
|
-
e.
|
4478
|
+
e.connectSettings.credentials && (h.credentials = e.connectSettings.credentials), w.executePollRequest(e, c, h, i);
|
4464
4479
|
case 12:
|
4465
4480
|
case "end":
|
4466
4481
|
return _context17.stop();
|
@@ -4561,7 +4576,7 @@ var L = /*#__PURE__*/function () {
|
|
4561
4576
|
var n = {
|
4562
4577
|
acceptedFormats: ""
|
4563
4578
|
};
|
4564
|
-
e.fileTypes.mixedFiles = L.parseConfig(e.
|
4579
|
+
e.fileTypes.mixedFiles = L.parseConfig(e.connectSettings, n, t, i);
|
4565
4580
|
}
|
4566
4581
|
}
|
4567
4582
|
// needs to be set after audio to overwrite maxNumberOfFiles
|
@@ -4574,7 +4589,7 @@ var L = /*#__PURE__*/function () {
|
|
4574
4589
|
var o = _objectSpread({
|
4575
4590
|
acceptedFormats: "audio/*"
|
4576
4591
|
}, ((a = e.fileTypes.audio) == null ? void 0 : a.files) || {});
|
4577
|
-
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)));
|
4578
4593
|
}
|
4579
4594
|
// prettier-ignore
|
4580
4595
|
}, {
|
@@ -4584,7 +4599,7 @@ var L = /*#__PURE__*/function () {
|
|
4584
4599
|
var o = _objectSpread({
|
4585
4600
|
acceptedFormats: "audio/*"
|
4586
4601
|
}, (n == null ? void 0 : n.files) || {});
|
4587
|
-
e.fileTypes.audio = L.parseConfig(e.
|
4602
|
+
e.fileTypes.audio = L.parseConfig(e.connectSettings, o, t, i);
|
4588
4603
|
}
|
4589
4604
|
// prettier-ignore
|
4590
4605
|
}, {
|
@@ -4594,7 +4609,7 @@ var L = /*#__PURE__*/function () {
|
|
4594
4609
|
var o = _objectSpread({
|
4595
4610
|
acceptedFormats: "image/gif"
|
4596
4611
|
}, (n == null ? void 0 : n.files) || {});
|
4597
|
-
e.fileTypes.gifs = L.parseConfig(e.
|
4612
|
+
e.fileTypes.gifs = L.parseConfig(e.connectSettings, o, t, i);
|
4598
4613
|
}
|
4599
4614
|
// needs to be set after images to overwrite maxNumberOfFiles
|
4600
4615
|
// prettier-ignore
|
@@ -4606,7 +4621,7 @@ var L = /*#__PURE__*/function () {
|
|
4606
4621
|
var o = _objectSpread({
|
4607
4622
|
acceptedFormats: "image/*"
|
4608
4623
|
}, ((a = e.fileTypes.images) == null ? void 0 : a.files) || {});
|
4609
|
-
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)));
|
4610
4625
|
}
|
4611
4626
|
// prettier-ignore
|
4612
4627
|
}, {
|
@@ -4616,7 +4631,7 @@ var L = /*#__PURE__*/function () {
|
|
4616
4631
|
var o = _objectSpread({
|
4617
4632
|
acceptedFormats: "image/*"
|
4618
4633
|
}, (n == null ? void 0 : n.files) || {});
|
4619
|
-
e.fileTypes.images = L.parseConfig(e.
|
4634
|
+
e.fileTypes.images = L.parseConfig(e.connectSettings, o, t, i);
|
4620
4635
|
}
|
4621
4636
|
// default for direct service
|
4622
4637
|
}, {
|
@@ -4641,7 +4656,7 @@ var Pe = /*#__PURE__*/function () {
|
|
4641
4656
|
var _a$url;
|
4642
4657
|
_classCallCheck(this, Pe);
|
4643
4658
|
var n, r, o, a, l;
|
4644
|
-
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);
|
4645
4660
|
}
|
4646
4661
|
_createClass(Pe, [{
|
4647
4662
|
key: "verifyKey",
|
@@ -4692,11 +4707,11 @@ var Pe = /*#__PURE__*/function () {
|
|
4692
4707
|
messages: t
|
4693
4708
|
}, this.rawBody);
|
4694
4709
|
n = !1;
|
4695
|
-
(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);
|
4696
4711
|
_context19.next = 5;
|
4697
4712
|
return this.request(i, e);
|
4698
4713
|
case 5:
|
4699
|
-
n && ((l = this.
|
4714
|
+
n && ((l = this.connectSettings.headers) == null || delete l["Content-Type"]);
|
4700
4715
|
case 6:
|
4701
4716
|
case "end":
|
4702
4717
|
return _context19.stop();
|
@@ -4716,12 +4731,12 @@ var Pe = /*#__PURE__*/function () {
|
|
4716
4731
|
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
4717
4732
|
while (1) switch (_context20.prev = _context20.next) {
|
4718
4733
|
case 0:
|
4719
|
-
n = Pe.createCustomFormDataBody(this.rawBody, t, i), r = this.
|
4720
|
-
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;
|
4721
4736
|
_context20.next = 4;
|
4722
4737
|
return this.request(n, e, !1);
|
4723
4738
|
case 4:
|
4724
|
-
this.
|
4739
|
+
this.connectSettings = r;
|
4725
4740
|
case 5:
|
4726
4741
|
case "end":
|
4727
4742
|
return _context20.stop();
|
@@ -4760,14 +4775,14 @@ var Pe = /*#__PURE__*/function () {
|
|
4760
4775
|
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
4761
4776
|
while (1) switch (_context22.prev = _context22.next) {
|
4762
4777
|
case 0:
|
4763
|
-
if (this.
|
4778
|
+
if (this.connectSettings) {
|
4764
4779
|
_context22.next = 2;
|
4765
4780
|
break;
|
4766
4781
|
}
|
4767
4782
|
throw new Error("Request settings have not been set up");
|
4768
4783
|
case 2:
|
4769
4784
|
i = et.processMessages(t.messages, this.maxMessages, this.totalMessagesMaxCharLength);
|
4770
|
-
if (this.
|
4785
|
+
if (this.connectSettings.websocket) {
|
4771
4786
|
n = _objectSpread({
|
4772
4787
|
messages: i
|
4773
4788
|
}, this.rawBody);
|
@@ -4801,7 +4816,7 @@ var Pe = /*#__PURE__*/function () {
|
|
4801
4816
|
_context23.next = 4;
|
4802
4817
|
break;
|
4803
4818
|
}
|
4804
|
-
return _context23.abrupt("return",
|
4819
|
+
return _context23.abrupt("return", se.handleResponseProperty(e));
|
4805
4820
|
case 4:
|
4806
4821
|
if (!v.validateResponseFormat(e)) {
|
4807
4822
|
_context23.next = 6;
|
@@ -4853,24 +4868,24 @@ var Pe = /*#__PURE__*/function () {
|
|
4853
4868
|
}]);
|
4854
4869
|
return Pe;
|
4855
4870
|
}();
|
4856
|
-
var
|
4857
|
-
_inherits(
|
4871
|
+
var H = /*#__PURE__*/function (_Pe) {
|
4872
|
+
_inherits(H, _Pe);
|
4858
4873
|
// prettier-ignore
|
4859
|
-
function
|
4874
|
+
function H(e, t, i, n, r) {
|
4860
4875
|
var _this8;
|
4861
|
-
_classCallCheck(this,
|
4876
|
+
_classCallCheck(this, H);
|
4862
4877
|
var o;
|
4863
|
-
_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);
|
4864
4879
|
return _this8;
|
4865
4880
|
}
|
4866
|
-
_createClass(
|
4881
|
+
_createClass(H, [{
|
4867
4882
|
key: "setApiKeyProperties",
|
4868
4883
|
value: function setApiKeyProperties(e) {
|
4869
|
-
this.key = e.key, e.validateKeyProperty && (this.
|
4884
|
+
this.key = e.key, e.validateKeyProperty && (this.validateKeyProperty = e.validateKeyProperty);
|
4870
4885
|
}
|
4871
4886
|
}, {
|
4872
|
-
key: "
|
4873
|
-
value: function
|
4887
|
+
key: "buildConnectSettings",
|
4888
|
+
value: function buildConnectSettings(e, t) {
|
4874
4889
|
var _i$headers;
|
4875
4890
|
var i = t !== null && t !== void 0 ? t : {};
|
4876
4891
|
return (_i$headers = i.headers) !== null && _i$headers !== void 0 ? _i$headers : i.headers = {}, Object.assign(i.headers, this.buildHeadersFunc(e)), i;
|
@@ -4878,7 +4893,7 @@ var q = /*#__PURE__*/function (_Pe) {
|
|
4878
4893
|
}, {
|
4879
4894
|
key: "keyAuthenticated",
|
4880
4895
|
value: function keyAuthenticated(e, t) {
|
4881
|
-
this.
|
4896
|
+
this.connectSettings = this.buildConnectSettings(t, this.connectSettings), this.key = t, e();
|
4882
4897
|
}
|
4883
4898
|
// prettier-ignore
|
4884
4899
|
}, {
|
@@ -4899,26 +4914,26 @@ var q = /*#__PURE__*/function (_Pe) {
|
|
4899
4914
|
return !0;
|
4900
4915
|
}
|
4901
4916
|
}]);
|
4902
|
-
return
|
4917
|
+
return H;
|
4903
4918
|
}(Pe);
|
4904
|
-
var
|
4905
|
-
function
|
4906
|
-
_classCallCheck(this,
|
4919
|
+
var Ht = /*#__PURE__*/function () {
|
4920
|
+
function Ht() {
|
4921
|
+
_classCallCheck(this, Ht);
|
4907
4922
|
}
|
4908
|
-
_createClass(
|
4923
|
+
_createClass(Ht, null, [{
|
4909
4924
|
key: "waitForPropertiesToBeUpdatedBeforeRender",
|
4910
4925
|
value: function waitForPropertiesToBeUpdatedBeforeRender(e) {
|
4911
4926
|
e._propUpdated_ = !1, setTimeout(function () {
|
4912
|
-
e._propUpdated_ ?
|
4927
|
+
e._propUpdated_ ? Ht.waitForPropertiesToBeUpdatedBeforeRender(e) : (e._waitingToRender_ = !1, e.onRender());
|
4913
4928
|
});
|
4914
4929
|
}
|
4915
4930
|
}, {
|
4916
4931
|
key: "attemptRender",
|
4917
4932
|
value: function attemptRender(e) {
|
4918
|
-
e._propUpdated_ = !0, e._waitingToRender_ || (e._waitingToRender_ = !0,
|
4933
|
+
e._propUpdated_ = !0, e._waitingToRender_ || (e._waitingToRender_ = !0, Ht.waitForPropertiesToBeUpdatedBeforeRender(e));
|
4919
4934
|
}
|
4920
4935
|
}]);
|
4921
|
-
return
|
4936
|
+
return Ht;
|
4922
4937
|
}();
|
4923
4938
|
var Yi = /*#__PURE__*/function (_HTMLElement) {
|
4924
4939
|
_inherits(Je, _HTMLElement);
|
@@ -4943,7 +4958,7 @@ var Yi = /*#__PURE__*/function (_HTMLElement) {
|
|
4943
4958
|
return i;
|
4944
4959
|
},
|
4945
4960
|
set: function set(o) {
|
4946
|
-
i = o, t ? this[e] = o :
|
4961
|
+
i = o, t ? this[e] = o : Ht.attemptRender(this);
|
4947
4962
|
}
|
4948
4963
|
});
|
4949
4964
|
}
|
@@ -5912,8 +5927,8 @@ var qt = /*#__PURE__*/function () {
|
|
5912
5927
|
}]);
|
5913
5928
|
return qt;
|
5914
5929
|
}();
|
5915
|
-
var us = /*#__PURE__*/function (
|
5916
|
-
_inherits(Bi,
|
5930
|
+
var us = /*#__PURE__*/function (_H) {
|
5931
|
+
_inherits(Bi, _H);
|
5917
5932
|
// prettier-ignore
|
5918
5933
|
function Bi(e, t, i, n, r, o) {
|
5919
5934
|
var _this16;
|
@@ -5940,7 +5955,7 @@ var us = /*#__PURE__*/function (_q) {
|
|
5940
5955
|
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
5941
5956
|
while (1) switch (_context35.prev = _context35.next) {
|
5942
5957
|
case 0:
|
5943
|
-
if (this.
|
5958
|
+
if (this.connectSettings) {
|
5944
5959
|
_context35.next = 2;
|
5945
5960
|
break;
|
5946
5961
|
}
|
@@ -5961,7 +5976,7 @@ var us = /*#__PURE__*/function (_q) {
|
|
5961
5976
|
}()
|
5962
5977
|
}]);
|
5963
5978
|
return Bi;
|
5964
|
-
}(
|
5979
|
+
}(H);
|
5965
5980
|
us.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
5966
5981
|
var Be = us;
|
5967
5982
|
var St = /*#__PURE__*/function (_Be) {
|
@@ -5986,7 +6001,7 @@ var St = /*#__PURE__*/function (_Be) {
|
|
5986
6001
|
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
5987
6002
|
while (1) switch (_context36.prev = _context36.next) {
|
5988
6003
|
case 0:
|
5989
|
-
if (this.
|
6004
|
+
if (this.connectSettings) {
|
5990
6005
|
_context36.next = 2;
|
5991
6006
|
break;
|
5992
6007
|
}
|
@@ -6120,11 +6135,11 @@ var Ao = /*#__PURE__*/function (_St2) {
|
|
6120
6135
|
return Ao;
|
6121
6136
|
}(St);
|
6122
6137
|
var wt = "data:image/png;base64,";
|
6123
|
-
var
|
6124
|
-
function
|
6125
|
-
_classCallCheck(this,
|
6138
|
+
var de = /*#__PURE__*/function () {
|
6139
|
+
function de() {
|
6140
|
+
_classCallCheck(this, de);
|
6126
6141
|
}
|
6127
|
-
_createClass(
|
6142
|
+
_createClass(de, null, [{
|
6128
6143
|
key: "buildHeaders",
|
6129
6144
|
value: function buildHeaders(e) {
|
6130
6145
|
return {
|
@@ -6144,28 +6159,28 @@ var ce = /*#__PURE__*/function () {
|
|
6144
6159
|
return {
|
6145
6160
|
url: "https://api.stability.ai/v1/engines/list",
|
6146
6161
|
method: "GET",
|
6147
|
-
handleVerificationResult:
|
6162
|
+
handleVerificationResult: de.handleVerificationResult
|
6148
6163
|
};
|
6149
6164
|
}
|
6150
6165
|
}]);
|
6151
|
-
return
|
6166
|
+
return de;
|
6152
6167
|
}();
|
6153
|
-
var
|
6154
|
-
_inherits(
|
6168
|
+
var ai = /*#__PURE__*/function (_H2) {
|
6169
|
+
_inherits(ai, _H2);
|
6155
6170
|
// prettier-ignore
|
6156
|
-
function
|
6171
|
+
function ai(e, t, i, n, r) {
|
6157
6172
|
var _this18;
|
6158
|
-
_classCallCheck(this,
|
6159
|
-
_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_"];
|
6160
6175
|
return _this18;
|
6161
6176
|
}
|
6162
|
-
return _createClass(
|
6163
|
-
}(
|
6164
|
-
var
|
6165
|
-
_inherits(
|
6166
|
-
function
|
6177
|
+
return _createClass(ai);
|
6178
|
+
}(H);
|
6179
|
+
var Gt = /*#__PURE__*/function (_ai) {
|
6180
|
+
_inherits(Gt, _ai);
|
6181
|
+
function Gt(e) {
|
6167
6182
|
var _this19;
|
6168
|
-
_classCallCheck(this,
|
6183
|
+
_classCallCheck(this, Gt);
|
6169
6184
|
var o;
|
6170
6185
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6171
6186
|
i = t == null ? void 0 : t.stabilityAI,
|
@@ -6177,12 +6192,12 @@ var Ht = /*#__PURE__*/function (_oi) {
|
|
6177
6192
|
}
|
6178
6193
|
}
|
6179
6194
|
};
|
6180
|
-
_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>";
|
6181
6196
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageUpscale;
|
6182
|
-
_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;
|
6183
6198
|
return _this19;
|
6184
6199
|
}
|
6185
|
-
_createClass(
|
6200
|
+
_createClass(Gt, [{
|
6186
6201
|
key: "createFormDataBody",
|
6187
6202
|
value: function createFormDataBody(e, t) {
|
6188
6203
|
var i = new FormData();
|
@@ -6199,7 +6214,7 @@ var Ht = /*#__PURE__*/function (_oi) {
|
|
6199
6214
|
return _regeneratorRuntime().wrap(function _callee39$(_context39) {
|
6200
6215
|
while (1) switch (_context39.prev = _context39.next) {
|
6201
6216
|
case 0:
|
6202
|
-
if (this.
|
6217
|
+
if (this.connectSettings) {
|
6203
6218
|
_context39.next = 2;
|
6204
6219
|
break;
|
6205
6220
|
}
|
@@ -6212,7 +6227,7 @@ var Ht = /*#__PURE__*/function (_oi) {
|
|
6212
6227
|
throw new Error("Image was not found");
|
6213
6228
|
case 4:
|
6214
6229
|
n = this.createFormDataBody(this.rawBody, i[0]);
|
6215
|
-
v.tempRemoveContentHeader(this.
|
6230
|
+
v.tempRemoveContentHeader(this.connectSettings, w.request.bind(this, this, n, e), !1);
|
6216
6231
|
case 6:
|
6217
6232
|
case "end":
|
6218
6233
|
return _context39.stop();
|
@@ -6267,13 +6282,13 @@ var Ht = /*#__PURE__*/function (_oi) {
|
|
6267
6282
|
return !!(t != null && t[0]);
|
6268
6283
|
}
|
6269
6284
|
}]);
|
6270
|
-
return
|
6271
|
-
}(
|
6272
|
-
var
|
6273
|
-
_inherits(
|
6274
|
-
function
|
6285
|
+
return Gt;
|
6286
|
+
}(ai);
|
6287
|
+
var Vt = /*#__PURE__*/function (_ai2) {
|
6288
|
+
_inherits(Vt, _ai2);
|
6289
|
+
function Vt(e) {
|
6275
6290
|
var _this20;
|
6276
|
-
_classCallCheck(this,
|
6291
|
+
_classCallCheck(this, Vt);
|
6277
6292
|
var o;
|
6278
6293
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6279
6294
|
i = t == null ? void 0 : t.stabilityAI,
|
@@ -6285,12 +6300,12 @@ var Gt = /*#__PURE__*/function (_oi2) {
|
|
6285
6300
|
}
|
6286
6301
|
}
|
6287
6302
|
};
|
6288
|
-
_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>";
|
6289
6304
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
|
6290
|
-
_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;
|
6291
6306
|
return _this20;
|
6292
6307
|
}
|
6293
|
-
_createClass(
|
6308
|
+
_createClass(Vt, [{
|
6294
6309
|
key: "createFormDataBody",
|
6295
6310
|
value: function createFormDataBody(e, t, i, n) {
|
6296
6311
|
var r = new FormData();
|
@@ -6307,7 +6322,7 @@ var Gt = /*#__PURE__*/function (_oi2) {
|
|
6307
6322
|
return _regeneratorRuntime().wrap(function _callee41$(_context41) {
|
6308
6323
|
while (1) switch (_context41.prev = _context41.next) {
|
6309
6324
|
case 0:
|
6310
|
-
if (this.
|
6325
|
+
if (this.connectSettings) {
|
6311
6326
|
_context41.next = 2;
|
6312
6327
|
break;
|
6313
6328
|
}
|
@@ -6320,7 +6335,7 @@ var Gt = /*#__PURE__*/function (_oi2) {
|
|
6320
6335
|
throw new Error("Image was not found");
|
6321
6336
|
case 4:
|
6322
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);
|
6323
|
-
v.tempRemoveContentHeader(this.
|
6338
|
+
v.tempRemoveContentHeader(this.connectSettings, w.request.bind(this, this, r, e), !1);
|
6324
6339
|
case 6:
|
6325
6340
|
case "end":
|
6326
6341
|
return _context41.stop();
|
@@ -6375,8 +6390,8 @@ var Gt = /*#__PURE__*/function (_oi2) {
|
|
6375
6390
|
return !!(t != null && t[0]) && !!(e && e.trim() !== "");
|
6376
6391
|
}
|
6377
6392
|
}]);
|
6378
|
-
return
|
6379
|
-
}(
|
6393
|
+
return Vt;
|
6394
|
+
}(ai);
|
6380
6395
|
var ko = /*#__PURE__*/function (_St3) {
|
6381
6396
|
_inherits(ko, _St3);
|
6382
6397
|
function ko(e) {
|
@@ -6642,11 +6657,11 @@ var No = /*#__PURE__*/function (_Be5) {
|
|
6642
6657
|
}]);
|
6643
6658
|
return No;
|
6644
6659
|
}(Be);
|
6645
|
-
var
|
6646
|
-
_inherits(
|
6647
|
-
function
|
6660
|
+
var Wt = /*#__PURE__*/function (_ai3) {
|
6661
|
+
_inherits(Wt, _ai3);
|
6662
|
+
function Wt(e) {
|
6648
6663
|
var _this23;
|
6649
|
-
_classCallCheck(this,
|
6664
|
+
_classCallCheck(this, Wt);
|
6650
6665
|
var o;
|
6651
6666
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6652
6667
|
i = t.stabilityAI,
|
@@ -6658,12 +6673,12 @@ var Vt = /*#__PURE__*/function (_oi3) {
|
|
6658
6673
|
}
|
6659
6674
|
}
|
6660
6675
|
};
|
6661
|
-
_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>";
|
6662
6677
|
var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
|
6663
|
-
_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;
|
6664
6679
|
return _this23;
|
6665
6680
|
}
|
6666
|
-
_createClass(
|
6681
|
+
_createClass(Wt, [{
|
6667
6682
|
key: "createFormDataBody",
|
6668
6683
|
value: function createFormDataBody(e, t, i) {
|
6669
6684
|
var n = new FormData();
|
@@ -6680,7 +6695,7 @@ var Vt = /*#__PURE__*/function (_oi3) {
|
|
6680
6695
|
return _regeneratorRuntime().wrap(function _callee48$(_context48) {
|
6681
6696
|
while (1) switch (_context48.prev = _context48.next) {
|
6682
6697
|
case 0:
|
6683
|
-
if (this.
|
6698
|
+
if (this.connectSettings) {
|
6684
6699
|
_context48.next = 2;
|
6685
6700
|
break;
|
6686
6701
|
}
|
@@ -6693,7 +6708,7 @@ var Vt = /*#__PURE__*/function (_oi3) {
|
|
6693
6708
|
throw new Error("Image was not found");
|
6694
6709
|
case 4:
|
6695
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);
|
6696
|
-
v.tempRemoveContentHeader(this.
|
6711
|
+
v.tempRemoveContentHeader(this.connectSettings, w.request.bind(this, this, r, e), !1);
|
6697
6712
|
case 6:
|
6698
6713
|
case "end":
|
6699
6714
|
return _context48.stop();
|
@@ -6748,8 +6763,8 @@ var Vt = /*#__PURE__*/function (_oi3) {
|
|
6748
6763
|
return !!(t != null && t[0]) && !!(e && e.trim() !== "");
|
6749
6764
|
}
|
6750
6765
|
}]);
|
6751
|
-
return
|
6752
|
-
}(
|
6766
|
+
return Wt;
|
6767
|
+
}(ai);
|
6753
6768
|
var Oo = /*#__PURE__*/function (_Be6) {
|
6754
6769
|
_inherits(Oo, _Be6);
|
6755
6770
|
function Oo(e) {
|
@@ -6789,20 +6804,20 @@ var Oo = /*#__PURE__*/function (_Be6) {
|
|
6789
6804
|
}]);
|
6790
6805
|
return Oo;
|
6791
6806
|
}(Be);
|
6792
|
-
var
|
6793
|
-
_inherits(
|
6794
|
-
function
|
6807
|
+
var Jt = /*#__PURE__*/function (_ai4) {
|
6808
|
+
_inherits(Jt, _ai4);
|
6809
|
+
function Jt(e) {
|
6795
6810
|
var _this24;
|
6796
|
-
_classCallCheck(this,
|
6811
|
+
_classCallCheck(this, Jt);
|
6797
6812
|
var r;
|
6798
6813
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6799
6814
|
i = t.stabilityAI;
|
6800
|
-
_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>";
|
6801
6816
|
var n = (r = t.stabilityAI) == null ? void 0 : r.textToImage;
|
6802
|
-
_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;
|
6803
6818
|
return _this24;
|
6804
6819
|
}
|
6805
|
-
_createClass(
|
6820
|
+
_createClass(Jt, [{
|
6806
6821
|
key: "preprocessBody",
|
6807
6822
|
value: function preprocessBody(e, t) {
|
6808
6823
|
var i = JSON.parse(JSON.stringify(e)),
|
@@ -6819,7 +6834,7 @@ var Wt = /*#__PURE__*/function (_oi4) {
|
|
6819
6834
|
return _regeneratorRuntime().wrap(function _callee51$(_context51) {
|
6820
6835
|
while (1) switch (_context51.prev = _context51.next) {
|
6821
6836
|
case 0:
|
6822
|
-
if (this.
|
6837
|
+
if (this.connectSettings) {
|
6823
6838
|
_context51.next = 2;
|
6824
6839
|
break;
|
6825
6840
|
}
|
@@ -6881,8 +6896,8 @@ var Wt = /*#__PURE__*/function (_oi4) {
|
|
6881
6896
|
return !!(e && e.trim() !== "");
|
6882
6897
|
}
|
6883
6898
|
}]);
|
6884
|
-
return
|
6885
|
-
}(
|
6899
|
+
return Jt;
|
6900
|
+
}(ai);
|
6886
6901
|
var Po = /*#__PURE__*/function (_Be7) {
|
6887
6902
|
_inherits(Po, _Be7);
|
6888
6903
|
function Po(e) {
|
@@ -6924,11 +6939,11 @@ var Po = /*#__PURE__*/function (_Be7) {
|
|
6924
6939
|
}]);
|
6925
6940
|
return Po;
|
6926
6941
|
}(Be);
|
6927
|
-
var
|
6928
|
-
function
|
6929
|
-
_classCallCheck(this,
|
6942
|
+
var $t = /*#__PURE__*/function () {
|
6943
|
+
function $t() {
|
6944
|
+
_classCallCheck(this, $t);
|
6930
6945
|
}
|
6931
|
-
_createClass(
|
6946
|
+
_createClass($t, null, [{
|
6932
6947
|
key: "buildHeaders",
|
6933
6948
|
value: function buildHeaders(e) {
|
6934
6949
|
return {
|
@@ -6950,25 +6965,25 @@ var Jt = /*#__PURE__*/function () {
|
|
6950
6965
|
return {
|
6951
6966
|
url: "https://api.cohere.ai/v1/generate",
|
6952
6967
|
method: "POST",
|
6953
|
-
handleVerificationResult:
|
6968
|
+
handleVerificationResult: $t.handleVerificationResult,
|
6954
6969
|
body: JSON.stringify({
|
6955
6970
|
prompt: ""
|
6956
6971
|
})
|
6957
6972
|
};
|
6958
6973
|
}
|
6959
6974
|
}]);
|
6960
|
-
return
|
6975
|
+
return $t;
|
6961
6976
|
}();
|
6962
|
-
var Xi = /*#__PURE__*/function (
|
6963
|
-
_inherits(Xi,
|
6977
|
+
var Xi = /*#__PURE__*/function (_H3) {
|
6978
|
+
_inherits(Xi, _H3);
|
6964
6979
|
function Xi(e, t, i, n, r) {
|
6965
6980
|
var _this26;
|
6966
6981
|
_classCallCheck(this, Xi);
|
6967
|
-
_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);
|
6968
6983
|
return _this26;
|
6969
6984
|
}
|
6970
6985
|
return _createClass(Xi);
|
6971
|
-
}(
|
6986
|
+
}(H);
|
6972
6987
|
var Do = /*#__PURE__*/function (_Xi) {
|
6973
6988
|
_inherits(Do, _Xi);
|
6974
6989
|
function Do(e) {
|
@@ -6995,7 +7010,7 @@ var Do = /*#__PURE__*/function (_Xi) {
|
|
6995
7010
|
return _regeneratorRuntime().wrap(function _callee54$(_context54) {
|
6996
7011
|
while (1) switch (_context54.prev = _context54.next) {
|
6997
7012
|
case 0:
|
6998
|
-
if (this.
|
7013
|
+
if (this.connectSettings) {
|
6999
7014
|
_context54.next = 2;
|
7000
7015
|
break;
|
7001
7016
|
}
|
@@ -7071,7 +7086,7 @@ var jo = /*#__PURE__*/function (_Xi2) {
|
|
7071
7086
|
return _regeneratorRuntime().wrap(function _callee56$(_context56) {
|
7072
7087
|
while (1) switch (_context56.prev = _context56.next) {
|
7073
7088
|
case 0:
|
7074
|
-
if (this.
|
7089
|
+
if (this.connectSettings) {
|
7075
7090
|
_context56.next = 2;
|
7076
7091
|
break;
|
7077
7092
|
}
|
@@ -7160,9 +7175,9 @@ var N = /*#__PURE__*/function () {
|
|
7160
7175
|
while (1) switch (_context58.prev = _context58.next) {
|
7161
7176
|
case 0:
|
7162
7177
|
n = _args58.length > 3 && _args58[3] !== undefined ? _args58[3] : !0;
|
7163
|
-
e.
|
7178
|
+
e.connectSettings.method = i;
|
7164
7179
|
_context58.next = 4;
|
7165
|
-
return v.fetch(e, e.
|
7180
|
+
return v.fetch(e, e.connectSettings.headers, n, t).then(function (o) {
|
7166
7181
|
return v.processResponseByType(o);
|
7167
7182
|
});
|
7168
7183
|
case 4:
|
@@ -7188,8 +7203,8 @@ var N = /*#__PURE__*/function () {
|
|
7188
7203
|
}]);
|
7189
7204
|
return N;
|
7190
7205
|
}();
|
7191
|
-
var Qi = /*#__PURE__*/function (
|
7192
|
-
_inherits(zi,
|
7206
|
+
var Qi = /*#__PURE__*/function (_H4) {
|
7207
|
+
_inherits(zi, _H4);
|
7193
7208
|
function zi(e) {
|
7194
7209
|
var _o$model, _a$voice;
|
7195
7210
|
var _this27;
|
@@ -7218,13 +7233,13 @@ var Qi = /*#__PURE__*/function (_q4) {
|
|
7218
7233
|
return _regeneratorRuntime().wrap(function _callee59$(_context59) {
|
7219
7234
|
while (1) switch (_context59.prev = _context59.next) {
|
7220
7235
|
case 0:
|
7221
|
-
if ((n = this.
|
7236
|
+
if ((n = this.connectSettings) != null && n.headers) {
|
7222
7237
|
_context59.next = 2;
|
7223
7238
|
break;
|
7224
7239
|
}
|
7225
7240
|
throw new Error("Request settings have not been set up");
|
7226
7241
|
case 2:
|
7227
|
-
this.url = this.
|
7242
|
+
this.url = this.connectSettings.url || this.url;
|
7228
7243
|
i = this.preprocessBody(this.rawBody, t);
|
7229
7244
|
w.request(this, i, e);
|
7230
7245
|
case 5:
|
@@ -7283,12 +7298,12 @@ var Qi = /*#__PURE__*/function (_q4) {
|
|
7283
7298
|
}()
|
7284
7299
|
}]);
|
7285
7300
|
return zi;
|
7286
|
-
}(
|
7301
|
+
}(H);
|
7287
7302
|
Qi.DEFAULT_MODEL = "tts-1";
|
7288
7303
|
Qi.DEFAULT_VOIDE = "alloy";
|
7289
7304
|
var Fo = Qi;
|
7290
|
-
var
|
7291
|
-
_inherits(Te,
|
7305
|
+
var li = /*#__PURE__*/function (_H5) {
|
7306
|
+
_inherits(Te, _H5);
|
7292
7307
|
function Te(e) {
|
7293
7308
|
var _o$model2;
|
7294
7309
|
var _this28;
|
@@ -7325,7 +7340,7 @@ var ai = /*#__PURE__*/function (_q5) {
|
|
7325
7340
|
return _regeneratorRuntime().wrap(function _callee61$(_context61) {
|
7326
7341
|
while (1) switch (_context61.prev = _context61.next) {
|
7327
7342
|
case 0:
|
7328
|
-
if ((o = this.
|
7343
|
+
if ((o = this.connectSettings) != null && o.headers) {
|
7329
7344
|
_context61.next = 2;
|
7330
7345
|
break;
|
7331
7346
|
}
|
@@ -7337,9 +7352,9 @@ var ai = /*#__PURE__*/function (_q5) {
|
|
7337
7352
|
}
|
7338
7353
|
throw new Error("No file was added");
|
7339
7354
|
case 4:
|
7340
|
-
this.url = this.
|
7355
|
+
this.url = this.connectSettings.url || this._service_url;
|
7341
7356
|
n = this.preprocessBody(this.rawBody, t), r = Te.createFormDataBody(n, i[0]);
|
7342
|
-
v.tempRemoveContentHeader(this.
|
7357
|
+
v.tempRemoveContentHeader(this.connectSettings, w.request.bind(this, this, r, e), !1);
|
7343
7358
|
case 7:
|
7344
7359
|
case "end":
|
7345
7360
|
return _context61.stop();
|
@@ -7398,11 +7413,11 @@ var ai = /*#__PURE__*/function (_q5) {
|
|
7398
7413
|
}
|
7399
7414
|
}]);
|
7400
7415
|
return Te;
|
7401
|
-
}(
|
7402
|
-
|
7403
|
-
|
7404
|
-
|
7405
|
-
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;
|
7406
7421
|
var Z = /*#__PURE__*/function () {
|
7407
7422
|
function Z() {
|
7408
7423
|
_classCallCheck(this, Z);
|
@@ -7505,8 +7520,8 @@ var Z = /*#__PURE__*/function () {
|
|
7505
7520
|
}]);
|
7506
7521
|
return Z;
|
7507
7522
|
}();
|
7508
|
-
var zo = /*#__PURE__*/function (
|
7509
|
-
_inherits(zo,
|
7523
|
+
var zo = /*#__PURE__*/function (_H6) {
|
7524
|
+
_inherits(zo, _H6);
|
7510
7525
|
// prettier-ignore
|
7511
7526
|
function zo(e, t, i, n, r) {
|
7512
7527
|
var _this29;
|
@@ -7517,7 +7532,7 @@ var zo = /*#__PURE__*/function (_q6) {
|
|
7517
7532
|
return _this29;
|
7518
7533
|
}
|
7519
7534
|
return _createClass(zo);
|
7520
|
-
}(
|
7535
|
+
}(H);
|
7521
7536
|
var Uo = /*#__PURE__*/function (_zo) {
|
7522
7537
|
_inherits(Uo, _zo);
|
7523
7538
|
function Uo(e) {
|
@@ -7555,7 +7570,7 @@ var Uo = /*#__PURE__*/function (_zo) {
|
|
7555
7570
|
return _regeneratorRuntime().wrap(function _callee63$(_context63) {
|
7556
7571
|
while (1) switch (_context63.prev = _context63.next) {
|
7557
7572
|
case 0:
|
7558
|
-
if (this.
|
7573
|
+
if (this.connectSettings) {
|
7559
7574
|
_context63.next = 2;
|
7560
7575
|
break;
|
7561
7576
|
}
|
@@ -7591,7 +7606,7 @@ var Uo = /*#__PURE__*/function (_zo) {
|
|
7591
7606
|
if (this.messages && this.completionsHandlers) {
|
7592
7607
|
_i10 = e.headers.get("operation-location"), n = {
|
7593
7608
|
method: "GET",
|
7594
|
-
headers: (t = this.
|
7609
|
+
headers: (t = this.connectSettings) == null ? void 0 : t.headers
|
7595
7610
|
};
|
7596
7611
|
w.executePollRequest(this, _i10, n, this.messages);
|
7597
7612
|
}
|
@@ -7778,8 +7793,8 @@ var ut = /*#__PURE__*/function () {
|
|
7778
7793
|
}]);
|
7779
7794
|
return ut;
|
7780
7795
|
}();
|
7781
|
-
var en = /*#__PURE__*/function (
|
7782
|
-
_inherits(en,
|
7796
|
+
var en = /*#__PURE__*/function (_H7) {
|
7797
|
+
_inherits(en, _H7);
|
7783
7798
|
function en(e) {
|
7784
7799
|
var _this31;
|
7785
7800
|
_classCallCheck(this, en);
|
@@ -7798,7 +7813,7 @@ var en = /*#__PURE__*/function (_q7) {
|
|
7798
7813
|
return _regeneratorRuntime().wrap(function _callee67$(_context67) {
|
7799
7814
|
while (1) switch (_context67.prev = _context67.next) {
|
7800
7815
|
case 0:
|
7801
|
-
if ((n = this.
|
7816
|
+
if ((n = this.connectSettings) != null && n.headers) {
|
7802
7817
|
_context67.next = 2;
|
7803
7818
|
break;
|
7804
7819
|
}
|
@@ -7836,7 +7851,7 @@ var en = /*#__PURE__*/function (_q7) {
|
|
7836
7851
|
}
|
7837
7852
|
throw e.error;
|
7838
7853
|
case 2:
|
7839
|
-
t = (r = (n = this.
|
7854
|
+
t = (r = (n = this.connectSettings) == null ? void 0 : n.headers) == null ? void 0 : r.Authorization;
|
7840
7855
|
_context68.next = 5;
|
7841
7856
|
return ut.poll(t, e.upload_url);
|
7842
7857
|
case 5:
|
@@ -7862,9 +7877,9 @@ var en = /*#__PURE__*/function (_q7) {
|
|
7862
7877
|
}
|
7863
7878
|
}]);
|
7864
7879
|
return en;
|
7865
|
-
}(
|
7866
|
-
var hs = /*#__PURE__*/function (
|
7867
|
-
_inherits(hs,
|
7880
|
+
}(H);
|
7881
|
+
var hs = /*#__PURE__*/function (_H8) {
|
7882
|
+
_inherits(hs, _H8);
|
7868
7883
|
// prettier-ignore
|
7869
7884
|
function hs(e, t, i, n, r) {
|
7870
7885
|
var _this32;
|
@@ -7875,7 +7890,7 @@ var hs = /*#__PURE__*/function (_q8) {
|
|
7875
7890
|
return _this32;
|
7876
7891
|
}
|
7877
7892
|
return _createClass(hs);
|
7878
|
-
}(
|
7893
|
+
}(H);
|
7879
7894
|
var ps = /*#__PURE__*/function (_hs) {
|
7880
7895
|
_inherits(fs, _hs);
|
7881
7896
|
// prettier-ignore
|
@@ -7903,7 +7918,7 @@ var ps = /*#__PURE__*/function (_hs) {
|
|
7903
7918
|
return _regeneratorRuntime().wrap(function _callee69$(_context69) {
|
7904
7919
|
while (1) switch (_context69.prev = _context69.next) {
|
7905
7920
|
case 0:
|
7906
|
-
if (this.
|
7921
|
+
if (this.connectSettings) {
|
7907
7922
|
_context69.next = 2;
|
7908
7923
|
break;
|
7909
7924
|
}
|
@@ -7957,7 +7972,7 @@ var ps = /*#__PURE__*/function (_hs) {
|
|
7957
7972
|
ps.HELP_LINK =
|
7958
7973
|
// eslint-disable-next-line max-len
|
7959
7974
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
7960
|
-
var
|
7975
|
+
var Ho = ps;
|
7961
7976
|
var ms = /*#__PURE__*/function (_hs2) {
|
7962
7977
|
_inherits(Ui, _hs2);
|
7963
7978
|
function Ui(e) {
|
@@ -7986,7 +8001,7 @@ var ms = /*#__PURE__*/function (_hs2) {
|
|
7986
8001
|
return _regeneratorRuntime().wrap(function _callee71$(_context71) {
|
7987
8002
|
while (1) switch (_context71.prev = _context71.next) {
|
7988
8003
|
case 0:
|
7989
|
-
if ((n = this.
|
8004
|
+
if ((n = this.connectSettings) != null && n.headers) {
|
7990
8005
|
_context71.next = 2;
|
7991
8006
|
break;
|
7992
8007
|
}
|
@@ -7998,7 +8013,7 @@ var ms = /*#__PURE__*/function (_hs2) {
|
|
7998
8013
|
}
|
7999
8014
|
throw new Error("No file was added");
|
8000
8015
|
case 4:
|
8001
|
-
(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);
|
8002
8017
|
case 5:
|
8003
8018
|
case "end":
|
8004
8019
|
return _context71.stop();
|
@@ -8048,9 +8063,9 @@ var ms = /*#__PURE__*/function (_hs2) {
|
|
8048
8063
|
ms.HELP_LINK =
|
8049
8064
|
// eslint-disable-next-line max-len
|
8050
8065
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
8051
|
-
var
|
8052
|
-
var Go = /*#__PURE__*/function (
|
8053
|
-
_inherits(Go,
|
8066
|
+
var qo = ms;
|
8067
|
+
var Go = /*#__PURE__*/function (_H9) {
|
8068
|
+
_inherits(Go, _H9);
|
8054
8069
|
// prettier-ignore
|
8055
8070
|
function Go(e) {
|
8056
8071
|
var _this35;
|
@@ -8079,7 +8094,7 @@ var Go = /*#__PURE__*/function (_q9) {
|
|
8079
8094
|
return _regeneratorRuntime().wrap(function _callee73$(_context73) {
|
8080
8095
|
while (1) switch (_context73.prev = _context73.next) {
|
8081
8096
|
case 0:
|
8082
|
-
if (this.
|
8097
|
+
if (this.connectSettings) {
|
8083
8098
|
_context73.next = 2;
|
8084
8099
|
break;
|
8085
8100
|
}
|
@@ -8128,7 +8143,7 @@ var Go = /*#__PURE__*/function (_q9) {
|
|
8128
8143
|
}()
|
8129
8144
|
}]);
|
8130
8145
|
return Go;
|
8131
|
-
}(
|
8146
|
+
}(H);
|
8132
8147
|
var ye = /*#__PURE__*/function () {
|
8133
8148
|
function ye() {
|
8134
8149
|
_classCallCheck(this, ye);
|
@@ -8141,7 +8156,7 @@ var ye = /*#__PURE__*/function () {
|
|
8141
8156
|
return _regeneratorRuntime().wrap(function _callee76$(_context76) {
|
8142
8157
|
while (1) switch (_context76.prev = _context76.next) {
|
8143
8158
|
case 0:
|
8144
|
-
n = e.
|
8159
|
+
n = e.connectSettings.headers;
|
8145
8160
|
if (n) {
|
8146
8161
|
_context76.next = 3;
|
8147
8162
|
break;
|
@@ -8337,16 +8352,16 @@ var ye = /*#__PURE__*/function () {
|
|
8337
8352
|
}]);
|
8338
8353
|
return ye;
|
8339
8354
|
}();
|
8340
|
-
var
|
8341
|
-
_inherits(
|
8342
|
-
function
|
8355
|
+
var ci = /*#__PURE__*/function (_H10) {
|
8356
|
+
_inherits(ae, _H10);
|
8357
|
+
function ae(e) {
|
8343
8358
|
var _c$headers, _d$OpenAIBeta;
|
8344
8359
|
var _this36;
|
8345
|
-
_classCallCheck(this,
|
8360
|
+
_classCallCheck(this, ae);
|
8346
8361
|
var r, o, a, l, c, d;
|
8347
8362
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
8348
8363
|
i = t.openAI;
|
8349
|
-
_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 = {
|
8350
8365
|
model: "gpt-4"
|
8351
8366
|
}, _this36.shouldFetchHistory = !1;
|
8352
8367
|
var n = (r = t.openAI) == null ? void 0 : r.assistant;
|
@@ -8361,10 +8376,10 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8361
8376
|
m = _ref11.function_handler;
|
8362
8377
|
m && (_this36._functionHandler = m);
|
8363
8378
|
} else (l = t.openAI) != null && l.assistant && (t.openAI.assistant = n);
|
8364
|
-
(_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)));
|
8365
8380
|
return _this36;
|
8366
8381
|
}
|
8367
|
-
_createClass(
|
8382
|
+
_createClass(ae, [{
|
8368
8383
|
key: "fetchHistoryFunc",
|
8369
8384
|
value: function () {
|
8370
8385
|
var _fetchHistoryFunc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee80() {
|
@@ -8422,11 +8437,11 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8422
8437
|
key: "callService",
|
8423
8438
|
value: function callService(e, t, i) {
|
8424
8439
|
if (this.sessionId) {
|
8425
|
-
this.url = "".concat(
|
8440
|
+
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/messages");
|
8426
8441
|
var n = this.processMessage(t, i);
|
8427
8442
|
w.request(this, n, e);
|
8428
8443
|
} else {
|
8429
|
-
this.url = "".concat(
|
8444
|
+
this.url = "".concat(ae.THREAD_PREFIX, "/runs");
|
8430
8445
|
var _n2 = this.createNewThreadMessages(this.rawBody, t, i);
|
8431
8446
|
w.request(this, _n2, e);
|
8432
8447
|
}
|
@@ -8441,7 +8456,7 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8441
8456
|
return _regeneratorRuntime().wrap(function _callee81$(_context81) {
|
8442
8457
|
while (1) switch (_context81.prev = _context81.next) {
|
8443
8458
|
case 0:
|
8444
|
-
if (this.
|
8459
|
+
if (this.connectSettings) {
|
8445
8460
|
_context81.next = 2;
|
8446
8461
|
break;
|
8447
8462
|
}
|
@@ -8482,7 +8497,7 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8482
8497
|
_context81.t1 = void 0;
|
8483
8498
|
case 20:
|
8484
8499
|
n = _context81.t1;
|
8485
|
-
this.
|
8500
|
+
this.connectSettings.method = "POST", this.callService(e, t, n);
|
8486
8501
|
case 22:
|
8487
8502
|
case "end":
|
8488
8503
|
return _context81.stop();
|
@@ -8503,7 +8518,7 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8503
8518
|
while (1) switch (_context82.prev = _context82.next) {
|
8504
8519
|
case 0:
|
8505
8520
|
_context82.prev = 0;
|
8506
|
-
this.url =
|
8521
|
+
this.url = ae.NEW_ASSISTANT_URL;
|
8507
8522
|
_context82.next = 4;
|
8508
8523
|
return N.directFetch(this, JSON.parse(JSON.stringify(this.newAssistantDetails)), "POST");
|
8509
8524
|
case 4:
|
@@ -8549,9 +8564,9 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8549
8564
|
_context83.next = 4;
|
8550
8565
|
return this.assignThreadAndRun(e);
|
8551
8566
|
case 4:
|
8552
|
-
t = "".concat(
|
8567
|
+
t = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id), i = {
|
8553
8568
|
method: "GET",
|
8554
|
-
headers: (n = this.
|
8569
|
+
headers: (n = this.connectSettings) == null ? void 0 : n.headers
|
8555
8570
|
};
|
8556
8571
|
return _context83.abrupt("return", (w.executePollRequest(this, t, i, this.messages), {
|
8557
8572
|
makingAnotherRequest: !0
|
@@ -8579,7 +8594,7 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8579
8594
|
_context84.next = 8;
|
8580
8595
|
break;
|
8581
8596
|
}
|
8582
|
-
this.url = "".concat(
|
8597
|
+
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs");
|
8583
8598
|
_context84.next = 4;
|
8584
8599
|
return N.directFetch(this, JSON.parse(JSON.stringify(this.rawBody)), "POST");
|
8585
8600
|
case 4:
|
@@ -8615,7 +8630,7 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8615
8630
|
while (1) switch (_context86.prev = _context86.next) {
|
8616
8631
|
case 0:
|
8617
8632
|
t = _args86.length > 1 && _args86[1] !== undefined ? _args86[1] : !1;
|
8618
|
-
this.url = "".concat(
|
8633
|
+
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(e, "/messages");
|
8619
8634
|
_context86.next = 4;
|
8620
8635
|
return N.directFetch(this, {}, "GET");
|
8621
8636
|
case 4:
|
@@ -8679,7 +8694,7 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8679
8694
|
break;
|
8680
8695
|
}
|
8681
8696
|
return _context87.abrupt("return", {
|
8682
|
-
timeoutMS:
|
8697
|
+
timeoutMS: ae.POLLING_TIMEOUT_MS
|
8683
8698
|
});
|
8684
8699
|
case 3:
|
8685
8700
|
if (!(t === "completed" && this.messages)) {
|
@@ -8770,14 +8785,14 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8770
8785
|
output: r
|
8771
8786
|
};
|
8772
8787
|
});
|
8773
|
-
this.url = "".concat(
|
8788
|
+
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id, "/submit_tool_outputs");
|
8774
8789
|
_context88.next = 12;
|
8775
8790
|
return N.directFetch(this, {
|
8776
8791
|
tool_outputs: n
|
8777
8792
|
}, "POST");
|
8778
8793
|
case 12:
|
8779
8794
|
return _context88.abrupt("return", {
|
8780
|
-
timeoutMS:
|
8795
|
+
timeoutMS: ae.POLLING_TIMEOUT_MS
|
8781
8796
|
});
|
8782
8797
|
case 13:
|
8783
8798
|
case "end":
|
@@ -8791,14 +8806,14 @@ var li = /*#__PURE__*/function (_q10) {
|
|
8791
8806
|
return handleTools;
|
8792
8807
|
}()
|
8793
8808
|
}]);
|
8794
|
-
return
|
8795
|
-
}(
|
8796
|
-
|
8797
|
-
|
8798
|
-
|
8799
|
-
var Vo =
|
8800
|
-
var
|
8801
|
-
_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);
|
8802
8817
|
function Ce(e) {
|
8803
8818
|
var _this39;
|
8804
8819
|
_classCallCheck(this, Ce);
|
@@ -8845,7 +8860,7 @@ var ci = /*#__PURE__*/function (_q11) {
|
|
8845
8860
|
var l = this.preprocessBody(this.rawBody, r);
|
8846
8861
|
n = Ce.createFormDataBody(l, i[0], i[1]);
|
8847
8862
|
} else this.url = Ce.IMAGE_VARIATIONS_URL, n = Ce.createFormDataBody(this.rawBody, i[0]);
|
8848
|
-
v.tempRemoveContentHeader(this.
|
8863
|
+
v.tempRemoveContentHeader(this.connectSettings, w.request.bind(this, this, n, e), !1);
|
8849
8864
|
}
|
8850
8865
|
}, {
|
8851
8866
|
key: "callServiceAPI",
|
@@ -8855,7 +8870,7 @@ var ci = /*#__PURE__*/function (_q11) {
|
|
8855
8870
|
return _regeneratorRuntime().wrap(function _callee89$(_context89) {
|
8856
8871
|
while (1) switch (_context89.prev = _context89.next) {
|
8857
8872
|
case 0:
|
8858
|
-
if ((n = this.
|
8873
|
+
if ((n = this.connectSettings) != null && n.headers) {
|
8859
8874
|
_context89.next = 2;
|
8860
8875
|
break;
|
8861
8876
|
}
|
@@ -8869,7 +8884,7 @@ var ci = /*#__PURE__*/function (_q11) {
|
|
8869
8884
|
_context89.next = 11;
|
8870
8885
|
break;
|
8871
8886
|
case 6:
|
8872
|
-
if (this.
|
8887
|
+
if (this.connectSettings) {
|
8873
8888
|
_context89.next = 8;
|
8874
8889
|
break;
|
8875
8890
|
}
|
@@ -8947,13 +8962,13 @@ var ci = /*#__PURE__*/function (_q11) {
|
|
8947
8962
|
}
|
8948
8963
|
}]);
|
8949
8964
|
return Ce;
|
8950
|
-
}(
|
8951
|
-
|
8952
|
-
|
8953
|
-
|
8954
|
-
var Wo =
|
8955
|
-
var ht = /*#__PURE__*/function (
|
8956
|
-
_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);
|
8957
8972
|
function ht(e) {
|
8958
8973
|
var _this40$maxMessages, _l$model;
|
8959
8974
|
var _this40;
|
@@ -9002,7 +9017,7 @@ var ht = /*#__PURE__*/function (_q12) {
|
|
9002
9017
|
return _regeneratorRuntime().wrap(function _callee91$(_context91) {
|
9003
9018
|
while (1) switch (_context91.prev = _context91.next) {
|
9004
9019
|
case 0:
|
9005
|
-
if (this.
|
9020
|
+
if (this.connectSettings) {
|
9006
9021
|
_context91.next = 2;
|
9007
9022
|
break;
|
9008
9023
|
}
|
@@ -9226,7 +9241,7 @@ var ht = /*#__PURE__*/function (_q12) {
|
|
9226
9241
|
}
|
9227
9242
|
}]);
|
9228
9243
|
return ht;
|
9229
|
-
}(
|
9244
|
+
}(H);
|
9230
9245
|
var Jo = /*#__PURE__*/function (_Xi3) {
|
9231
9246
|
_inherits(Jo, _Xi3);
|
9232
9247
|
function Jo(e) {
|
@@ -9262,7 +9277,7 @@ var Jo = /*#__PURE__*/function (_Xi3) {
|
|
9262
9277
|
return _regeneratorRuntime().wrap(function _callee95$(_context95) {
|
9263
9278
|
while (1) switch (_context95.prev = _context95.next) {
|
9264
9279
|
case 0:
|
9265
|
-
if (this.
|
9280
|
+
if (this.connectSettings) {
|
9266
9281
|
_context95.next = 2;
|
9267
9282
|
break;
|
9268
9283
|
}
|
@@ -9331,35 +9346,35 @@ var $o = /*#__PURE__*/function () {
|
|
9331
9346
|
if (t.cohere) return t.cohere.textGeneration ? new Do(e) : t.cohere.summarization ? new jo(e) : new Jo(e);
|
9332
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);
|
9333
9348
|
if (t.azure) {
|
9334
|
-
if (t.azure.speechToText) return new
|
9335
|
-
if (t.azure.textToSpeech) return new
|
9349
|
+
if (t.azure.speechToText) return new qo(e);
|
9350
|
+
if (t.azure.textToSpeech) return new Ho(e);
|
9336
9351
|
if (t.azure.summarization) return new Uo(e);
|
9337
9352
|
if (t.azure.translation) return new Go(e);
|
9338
9353
|
}
|
9339
|
-
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);
|
9340
9355
|
}
|
9341
|
-
return i ? new Pe(e) : new Pe(e, void 0, n || !0);
|
9356
|
+
return i && !(n && i.stream) ? new Pe(e) : new Pe(e, void 0, n || !0);
|
9342
9357
|
}
|
9343
9358
|
}]);
|
9344
9359
|
return $o;
|
9345
9360
|
}();
|
9346
9361
|
var gs = /*#__PURE__*/function () {
|
9347
|
-
function
|
9348
|
-
_classCallCheck(this,
|
9362
|
+
function Hi() {
|
9363
|
+
_classCallCheck(this, Hi);
|
9349
9364
|
}
|
9350
|
-
_createClass(
|
9365
|
+
_createClass(Hi, null, [{
|
9351
9366
|
key: "appendStyleSheetToHead",
|
9352
9367
|
value: function appendStyleSheetToHead() {
|
9353
9368
|
var e = document.getElementsByTagName("head")[0];
|
9354
9369
|
if (!Array.from(e.getElementsByTagName("link")).some(function (i) {
|
9355
|
-
return i.getAttribute("href") ===
|
9370
|
+
return i.getAttribute("href") === Hi.FONT_URL;
|
9356
9371
|
})) {
|
9357
9372
|
var _i12 = document.createElement("link");
|
9358
|
-
_i12.rel = "stylesheet", _i12.href =
|
9373
|
+
_i12.rel = "stylesheet", _i12.href = Hi.FONT_URL, e.appendChild(_i12);
|
9359
9374
|
}
|
9360
9375
|
}
|
9361
9376
|
}]);
|
9362
|
-
return
|
9377
|
+
return Hi;
|
9363
9378
|
}();
|
9364
9379
|
gs.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap";
|
9365
9380
|
var Ko = gs;
|
@@ -9418,21 +9433,21 @@ var tn = /*#__PURE__*/function () {
|
|
9418
9433
|
}]);
|
9419
9434
|
return tn;
|
9420
9435
|
}();
|
9421
|
-
var
|
9422
|
-
function
|
9423
|
-
_classCallCheck(this,
|
9436
|
+
var Kt = /*#__PURE__*/function () {
|
9437
|
+
function Kt(e, t, i) {
|
9438
|
+
_classCallCheck(this, Kt);
|
9424
9439
|
this._isDisplayed = !1, e ? (this._elementRef = this.createIntroPanelWithChild(e, i), this._isDisplayed = !0) : t && (this._elementRef = this.createInternalIntroPanel(t, i), this._isDisplayed = !0);
|
9425
9440
|
}
|
9426
|
-
_createClass(
|
9441
|
+
_createClass(Kt, [{
|
9427
9442
|
key: "createIntroPanelWithChild",
|
9428
9443
|
value: function createIntroPanelWithChild(e, t) {
|
9429
|
-
var i =
|
9444
|
+
var i = Kt.createIntroPanel(t);
|
9430
9445
|
return e.style.display === "none" && (e.style.display = "block"), i.appendChild(e), i;
|
9431
9446
|
}
|
9432
9447
|
}, {
|
9433
9448
|
key: "createInternalIntroPanel",
|
9434
9449
|
value: function createInternalIntroPanel(e, t) {
|
9435
|
-
var i =
|
9450
|
+
var i = Kt.createIntroPanel(t);
|
9436
9451
|
return i.id = "internal-intro-panel", i.innerHTML = e, i;
|
9437
9452
|
}
|
9438
9453
|
}, {
|
@@ -9452,7 +9467,7 @@ var $t = /*#__PURE__*/function () {
|
|
9452
9467
|
return t.classList.add("intro-panel"), Object.assign(t.style, e), t;
|
9453
9468
|
}
|
9454
9469
|
}]);
|
9455
|
-
return
|
9470
|
+
return Kt;
|
9456
9471
|
}();
|
9457
9472
|
var Yo = /*#__PURE__*/function () {
|
9458
9473
|
function Yo() {
|
@@ -9467,10 +9482,7 @@ var Yo = /*#__PURE__*/function () {
|
|
9467
9482
|
if (!t.isDirectConnection()) return "Please define a valid service inside\n the [directConnection](https://deepchat.dev/docs/directConnection/#directConnection) object.";
|
9468
9483
|
var n = (i = e.directConnection.openAI) == null ? void 0 : i.chat;
|
9469
9484
|
if (_typeof(n) == "object" && n.tools && !n.function_handler) return "Please define the `function_handler` property inside the openAI [chat](https://deepchat.dev/docs/directConnection/openAI#Chat) object.";
|
9470
|
-
} else if (e.connect)
|
9471
|
-
if (e.demo && !e.connect.stream) return "When [demo](https://deepchat.dev/docs/demo) mode is enabled - the [connect](https://deepchat.dev/docs/connect#connect-1) object can only accept the [stream](https://deepchat.dev/docs/connect#Stream) property.";
|
9472
|
-
if (!e.connect.url && !e.connect.handler) return "Please define a `url` or a `handler` property inside the [connect](https://deepchat.dev/docs/connect#connect-1) object.";
|
9473
|
-
}
|
9485
|
+
} else if (e.connect && !e.connect.url && !e.connect.handler) return e.demo ? e.connect.stream ? null : "When [demo](https://deepchat.dev/docs/demo) mode is enabled - the [connect](https://deepchat.dev/docs/connect#connect-1) object can only accept the [stream](https://deepchat.dev/docs/connect#Stream) property." : "Please define a `url` or a `handler` property inside the [connect](https://deepchat.dev/docs/connect#connect-1) object.";
|
9474
9486
|
return null;
|
9475
9487
|
}
|
9476
9488
|
}]);
|
@@ -9485,7 +9497,7 @@ var be = /*#__PURE__*/function () {
|
|
9485
9497
|
key: "createImage",
|
9486
9498
|
value: function createImage(e, t) {
|
9487
9499
|
var i = new Image();
|
9488
|
-
return i.src = e.src,
|
9500
|
+
return i.src = e.src, le.scrollDownOnImageLoad(i.src, t), le.processContent("image", i, i.src, e.name);
|
9489
9501
|
}
|
9490
9502
|
// WORK - image still does not scroll down when loaded
|
9491
9503
|
}, {
|
@@ -9497,7 +9509,7 @@ var be = /*#__PURE__*/function () {
|
|
9497
9509
|
while (1) switch (_context97.prev = _context97.next) {
|
9498
9510
|
case 0:
|
9499
9511
|
n = be.createImage(t, e.elementRef), r = e.createNewMessageElement("", i);
|
9500
|
-
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);
|
9501
9513
|
case 2:
|
9502
9514
|
case "end":
|
9503
9515
|
return _context97.stop();
|
@@ -9520,7 +9532,7 @@ var be = /*#__PURE__*/function () {
|
|
9520
9532
|
value: function addNewAudioMessage(e, t, i) {
|
9521
9533
|
var n = be.createAudioElement(t, i),
|
9522
9534
|
r = e.createNewMessageElement("", i);
|
9523
|
-
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);
|
9524
9536
|
}
|
9525
9537
|
}, {
|
9526
9538
|
key: "createAnyFile",
|
@@ -9532,14 +9544,14 @@ var be = /*#__PURE__*/function () {
|
|
9532
9544
|
var n = V.createSVGElement(Zo);
|
9533
9545
|
n.classList.add("any-file-message-icon"), i.appendChild(n);
|
9534
9546
|
var r = document.createElement("div");
|
9535
|
-
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);
|
9536
9548
|
}
|
9537
9549
|
}, {
|
9538
9550
|
key: "addNewAnyFileMessage",
|
9539
9551
|
value: function addNewAnyFileMessage(e, t, i) {
|
9540
9552
|
var n = e.createNewMessageElement("", i),
|
9541
9553
|
r = be.createAnyFile(t);
|
9542
|
-
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);
|
9543
9555
|
}
|
9544
9556
|
// no overwrite previous message logic as it is complex to track which files are to be overwritten
|
9545
9557
|
}, {
|
@@ -9547,7 +9559,7 @@ var be = /*#__PURE__*/function () {
|
|
9547
9559
|
value: function addMessages(e, t, i) {
|
9548
9560
|
t.forEach(function (n) {
|
9549
9561
|
var r, o;
|
9550
|
-
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);
|
9551
9563
|
});
|
9552
9564
|
}
|
9553
9565
|
}]);
|
@@ -9563,13 +9575,13 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9563
9575
|
var n = t.permittedErrorPrefixes,
|
9564
9576
|
r = t.introPanelMarkUp,
|
9565
9577
|
o = t.demo;
|
9566
|
-
_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 () {
|
9567
9579
|
return JSON.parse(JSON.stringify(_this43.messages));
|
9568
|
-
}, 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.
|
9569
|
-
_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), {}, {
|
9570
9582
|
sendUpdate: !!d
|
9571
9583
|
}), !d);
|
9572
|
-
}, 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) {
|
9573
9585
|
_this43.textToSpeech = c;
|
9574
9586
|
}), t.fetchHistory && _this43.fetchHistory(t.fetchHistory);
|
9575
9587
|
return _this43;
|
@@ -9612,9 +9624,9 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9612
9624
|
key: "populateHistory",
|
9613
9625
|
value: function populateHistory(e) {
|
9614
9626
|
var _this44 = this;
|
9615
|
-
var t = e.history ||
|
9627
|
+
var t = e.history || se.processHistory(e);
|
9616
9628
|
t && (t.forEach(function (i) {
|
9617
|
-
|
9629
|
+
se.processHistoryFile(i), _this44.addNewMessage(i, !0);
|
9618
9630
|
}), setTimeout(function () {
|
9619
9631
|
return G.scrollToBottom(_this44.elementRef);
|
9620
9632
|
}, 0));
|
@@ -9631,7 +9643,7 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9631
9643
|
return e();
|
9632
9644
|
case 2:
|
9633
9645
|
_context98.sent.forEach(function (i) {
|
9634
|
-
|
9646
|
+
return _this45.addAnyMessage(i, !0);
|
9635
9647
|
});
|
9636
9648
|
setTimeout(function () {
|
9637
9649
|
return G.scrollToBottom(_this45.elementRef);
|
@@ -9646,7 +9658,14 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9646
9658
|
return _fetchHistory.apply(this, arguments);
|
9647
9659
|
}
|
9648
9660
|
return fetchHistory;
|
9649
|
-
}()
|
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
|
9650
9669
|
}, {
|
9651
9670
|
key: "addNewMessage",
|
9652
9671
|
value: function addNewMessage(e) {
|
@@ -9655,7 +9674,7 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9655
9674
|
n = {
|
9656
9675
|
status: e.overwrite
|
9657
9676
|
};
|
9658
|
-
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) {
|
9659
9678
|
var r = Qe.add(this, i.html, i.role, this.messageElementRefs, n);
|
9660
9679
|
Ee.isElementTemporary(r) && delete i.html;
|
9661
9680
|
}
|
@@ -9694,7 +9713,7 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9694
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.";
|
9695
9714
|
this.renderText(r, o);
|
9696
9715
|
var a = D.extractParticularSharedStyles(["fontSize", "fontFamily"], (d = this.messageStyles) == null ? void 0 : d["default"]);
|
9697
|
-
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);
|
9698
9717
|
}
|
9699
9718
|
}, {
|
9700
9719
|
key: "getPermittedMessage",
|
@@ -9730,7 +9749,7 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9730
9749
|
}, {
|
9731
9750
|
key: "populateIntroPanel",
|
9732
9751
|
value: function populateIntroPanel(e, t, i) {
|
9733
|
-
(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)));
|
9734
9753
|
}
|
9735
9754
|
}, {
|
9736
9755
|
key: "addMultipleFiles",
|
@@ -9742,7 +9761,7 @@ var ve = /*#__PURE__*/function (_Ye) {
|
|
9742
9761
|
return _context99.abrupt("return", Promise.all((e || []).map(function (t) {
|
9743
9762
|
return new Promise(function (i) {
|
9744
9763
|
if (!t.type || t.type === "any") {
|
9745
|
-
var n = t.file.name ||
|
9764
|
+
var n = t.file.name || le.DEFAULT_FILE_NAME;
|
9746
9765
|
i({
|
9747
9766
|
name: n,
|
9748
9767
|
type: "any",
|
@@ -10315,32 +10334,32 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\"
|
|
10315
10334
|
dropupText: "File"
|
10316
10335
|
}
|
10317
10336
|
};
|
10318
|
-
var
|
10337
|
+
var fe = /*#__PURE__*/function () {
|
10319
10338
|
// prettier-ignore
|
10320
|
-
function
|
10339
|
+
function fe(e, t, i, n) {
|
10321
10340
|
var _this49 = this;
|
10322
|
-
_classCallCheck(this,
|
10341
|
+
_classCallCheck(this, fe);
|
10323
10342
|
this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", t.maxNumberOfFiles && (this._fileCountLimit = t.maxNumberOfFiles), this._toggleContainerDisplay = i, this._fileAttachmentsContainerRef = n, t.acceptedFormats && (this._acceptedFormat = t.acceptedFormats), setTimeout(function () {
|
10324
10343
|
_this49._validationHandler = e._validationHandler;
|
10325
10344
|
});
|
10326
10345
|
}
|
10327
|
-
_createClass(
|
10346
|
+
_createClass(fe, [{
|
10328
10347
|
key: "attemptAddFile",
|
10329
10348
|
value: function attemptAddFile(e, t) {
|
10330
|
-
return
|
10349
|
+
return fe.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), !0) : !1;
|
10331
10350
|
}
|
10332
10351
|
}, {
|
10333
10352
|
key: "addAttachmentBasedOnType",
|
10334
10353
|
value: function addAttachmentBasedOnType(e, t, i) {
|
10335
|
-
var n =
|
10354
|
+
var n = fe.getTypeFromBlob(e);
|
10336
10355
|
if (n === "image") {
|
10337
|
-
var r =
|
10356
|
+
var r = fe.createImageAttachment(t);
|
10338
10357
|
this.addFileAttachment(e, "image", r, i);
|
10339
10358
|
} else if (n === "audio") {
|
10340
|
-
var _r2 =
|
10359
|
+
var _r2 = qi.createAudioAttachment(t);
|
10341
10360
|
this.addFileAttachment(e, "audio", _r2, i);
|
10342
10361
|
} else {
|
10343
|
-
var _r3 =
|
10362
|
+
var _r3 = fe.createAnyFileAttachment(e.name);
|
10344
10363
|
this.addFileAttachment(e, "any", _r3, i);
|
10345
10364
|
}
|
10346
10365
|
}
|
@@ -10348,7 +10367,7 @@ var pe = /*#__PURE__*/function () {
|
|
10348
10367
|
key: "addFileAttachment",
|
10349
10368
|
value: function addFileAttachment(e, t, i, n) {
|
10350
10369
|
var a;
|
10351
|
-
var r =
|
10370
|
+
var r = fe.createContainer(i);
|
10352
10371
|
if (this._attachments.length >= this._fileCountLimit) {
|
10353
10372
|
var l = this._attachments[this._attachments.length - 1].removeButton;
|
10354
10373
|
l == null || l.click();
|
@@ -10378,7 +10397,7 @@ var pe = /*#__PURE__*/function () {
|
|
10378
10397
|
return r === e;
|
10379
10398
|
}),
|
10380
10399
|
i = this._attachments[t].attachmentContainerElement;
|
10381
|
-
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);
|
10382
10401
|
}
|
10383
10402
|
}, {
|
10384
10403
|
key: "getFiles",
|
@@ -10447,12 +10466,12 @@ var pe = /*#__PURE__*/function () {
|
|
10447
10466
|
return t.classList.add("file-attachment"), t.appendChild(e), t;
|
10448
10467
|
}
|
10449
10468
|
}]);
|
10450
|
-
return
|
10469
|
+
return fe;
|
10451
10470
|
}();
|
10452
10471
|
var ra = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>play</title>\n <path d=\"M5.92 24.096q0 1.088 0.928 1.728 0.512 0.288 1.088 0.288 0.448 0 0.896-0.224l16.16-8.064q0.48-0.256 0.8-0.736t0.288-1.088-0.288-1.056-0.8-0.736l-16.16-8.064q-0.448-0.224-0.896-0.224-0.544 0-1.088 0.288-0.928 0.608-0.928 1.728v16.16z\"></path>\n</svg>",
|
10453
10472
|
Tn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n<title>stop</title>\n<path d=\"M5.92 24.096q0 0.832 0.576 1.408t1.44 0.608h16.128q0.832 0 1.44-0.608t0.576-1.408v-16.16q0-0.832-0.576-1.44t-1.44-0.576h-16.128q-0.832 0-1.44 0.576t-0.576 1.44v16.16z\"></path>\n</svg>",
|
10454
|
-
vs = /*#__PURE__*/function (
|
10455
|
-
_inherits(Ae,
|
10473
|
+
vs = /*#__PURE__*/function (_fe) {
|
10474
|
+
_inherits(Ae, _fe);
|
10456
10475
|
// prettier-ignore
|
10457
10476
|
function Ae(e, t, i, n) {
|
10458
10477
|
_classCallCheck(this, Ae);
|
@@ -10563,9 +10582,9 @@ var ra = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10563
10582
|
}
|
10564
10583
|
}]);
|
10565
10584
|
return Ae;
|
10566
|
-
}(
|
10585
|
+
}(fe);
|
10567
10586
|
vs.TIMER_LIMIT_S = 5999;
|
10568
|
-
var
|
10587
|
+
var qi = vs;
|
10569
10588
|
var oa = /*#__PURE__*/function () {
|
10570
10589
|
function oa() {
|
10571
10590
|
_classCallCheck(this, oa);
|
@@ -10575,7 +10594,7 @@ var oa = /*#__PURE__*/function () {
|
|
10575
10594
|
value:
|
10576
10595
|
// prettier-ignore
|
10577
10596
|
function create(e, t, i, n, r) {
|
10578
|
-
return r === "audio" ? new
|
10597
|
+
return r === "audio" ? new qi(e, t, i, n) : new fe(e, t, i, n);
|
10579
10598
|
}
|
10580
10599
|
}]);
|
10581
10600
|
return oa;
|
@@ -10680,11 +10699,11 @@ var Ct = /*#__PURE__*/function () {
|
|
10680
10699
|
return Ct;
|
10681
10700
|
}();
|
10682
10701
|
var ys = /*#__PURE__*/function () {
|
10683
|
-
function
|
10684
|
-
_classCallCheck(this,
|
10685
|
-
this._isOpen = !1, this._contentRef =
|
10702
|
+
function ue(e, t, i) {
|
10703
|
+
_classCallCheck(this, ue);
|
10704
|
+
this._isOpen = !1, this._contentRef = ue.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = ue.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = ue.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = ue.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents(e);
|
10686
10705
|
}
|
10687
|
-
_createClass(
|
10706
|
+
_createClass(ue, [{
|
10688
10707
|
key: "isOpen",
|
10689
10708
|
value: function isOpen() {
|
10690
10709
|
return this._isOpen;
|
@@ -10706,7 +10725,7 @@ var ys = /*#__PURE__*/function () {
|
|
10706
10725
|
var _this53 = this;
|
10707
10726
|
this._elementRef.classList.remove("show-modal"), this._elementRef.classList.add("hide-modal"), this._backgroundPanelRef.classList.remove("show-modal-background"), this._backgroundPanelRef.classList.add("hide-modal-background"), this._isOpen = !1, setTimeout(function () {
|
10708
10727
|
_this53._elementRef.style.display = "none", _this53._backgroundPanelRef.style.display = "none";
|
10709
|
-
},
|
10728
|
+
}, ue.MODAL_CLOSE_TIMEOUT_MS);
|
10710
10729
|
}
|
10711
10730
|
}, {
|
10712
10731
|
key: "displayModalElements",
|
@@ -10722,7 +10741,7 @@ var ys = /*#__PURE__*/function () {
|
|
10722
10741
|
key: "addCloseButton",
|
10723
10742
|
value: function addCloseButton(e, t, i) {
|
10724
10743
|
var _this54 = this;
|
10725
|
-
var n = t ?
|
10744
|
+
var n = t ? ue.createSVGButton(e) : ue.createTextButton(e);
|
10726
10745
|
return this.addButtons(n), n.onclick = function () {
|
10727
10746
|
_this54.close(), setTimeout(function () {
|
10728
10747
|
i == null || i();
|
@@ -10784,12 +10803,12 @@ var ys = /*#__PURE__*/function () {
|
|
10784
10803
|
value: function createTextModalFunc(e, t, i) {
|
10785
10804
|
var n;
|
10786
10805
|
if (_typeof(t) == "object" && (n = t.files) != null && n.infoModal) {
|
10787
|
-
var r = new
|
10806
|
+
var r = new ue(e, ["modal-content"], t.files.infoModal.containerStyle);
|
10788
10807
|
return r.addCloseButton("OK", !1, i), r.openTextModal.bind(r, t.infoModalTextMarkUp || "");
|
10789
10808
|
}
|
10790
10809
|
}
|
10791
10810
|
}]);
|
10792
|
-
return
|
10811
|
+
return ue;
|
10793
10812
|
}();
|
10794
10813
|
ys.MODAL_CLOSE_TIMEOUT_MS = 190;
|
10795
10814
|
var ct = ys;
|
@@ -10861,15 +10880,15 @@ var pt = /*#__PURE__*/function (_Tt2) {
|
|
10861
10880
|
}]);
|
10862
10881
|
return pt;
|
10863
10882
|
}(Tt);
|
10864
|
-
var
|
10865
|
-
function
|
10866
|
-
_classCallCheck(this,
|
10883
|
+
var he = /*#__PURE__*/function () {
|
10884
|
+
function he() {
|
10885
|
+
_classCallCheck(this, he);
|
10867
10886
|
}
|
10868
|
-
_createClass(
|
10887
|
+
_createClass(he, null, [{
|
10869
10888
|
key: "create",
|
10870
10889
|
value: function create(e, t, i) {
|
10871
|
-
var n =
|
10872
|
-
|
10890
|
+
var n = he.createElement(i);
|
10891
|
+
he.addEvents(n, e, t), e.appendChild(n);
|
10873
10892
|
}
|
10874
10893
|
}, {
|
10875
10894
|
key: "createElement",
|
@@ -10881,13 +10900,13 @@ var ue = /*#__PURE__*/function () {
|
|
10881
10900
|
key: "addEvents",
|
10882
10901
|
value: function addEvents(e, t, i) {
|
10883
10902
|
t.ondragenter = function (n) {
|
10884
|
-
n.preventDefault(),
|
10903
|
+
n.preventDefault(), he.display(e);
|
10885
10904
|
}, e.ondragleave = function (n) {
|
10886
|
-
n.preventDefault(),
|
10905
|
+
n.preventDefault(), he.hide(e);
|
10887
10906
|
}, e.ondragover = function (n) {
|
10888
10907
|
n.preventDefault();
|
10889
10908
|
}, e.ondrop = function (n) {
|
10890
|
-
n.preventDefault(),
|
10909
|
+
n.preventDefault(), he.uploadFile(i, n), he.hide(e);
|
10891
10910
|
};
|
10892
10911
|
}
|
10893
10912
|
}, {
|
@@ -10913,7 +10932,7 @@ var ue = /*#__PURE__*/function () {
|
|
10913
10932
|
return t !== void 0 && t === !1 ? !1 : !!t || e.getNumberOfTypes() > 0;
|
10914
10933
|
}
|
10915
10934
|
}]);
|
10916
|
-
return
|
10935
|
+
return he;
|
10917
10936
|
}();
|
10918
10937
|
var Ie = /*#__PURE__*/function () {
|
10919
10938
|
function Ie() {
|
@@ -10987,7 +11006,7 @@ var Ie = /*#__PURE__*/function () {
|
|
10987
11006
|
}, {
|
10988
11007
|
key: "attach",
|
10989
11008
|
value: function attach(e, t, i, n, r) {
|
10990
|
-
var o = e.validateInput ||
|
11009
|
+
var o = e.validateInput || se.processValidateInput(e);
|
10991
11010
|
e._validationHandler = /*#__PURE__*/function () {
|
10992
11011
|
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee104(a) {
|
10993
11012
|
var l;
|
@@ -11094,8 +11113,8 @@ var xt = /*#__PURE__*/function (_Tt3) {
|
|
11094
11113
|
return xt;
|
11095
11114
|
}(Tt);
|
11096
11115
|
var xs = {},
|
11097
|
-
di = {},
|
11098
11116
|
ui = {},
|
11117
|
+
hi = {},
|
11099
11118
|
At = {},
|
11100
11119
|
ze = {};
|
11101
11120
|
Object.defineProperty(ze, "__esModule", {
|
@@ -11156,10 +11175,10 @@ var ca = /*#__PURE__*/function () {
|
|
11156
11175
|
return ca;
|
11157
11176
|
}();
|
11158
11177
|
At.Translate = ca;
|
11159
|
-
Object.defineProperty(
|
11178
|
+
Object.defineProperty(hi, "__esModule", {
|
11160
11179
|
value: !0
|
11161
11180
|
});
|
11162
|
-
|
11181
|
+
hi.WebSpeechTranscript = void 0;
|
11163
11182
|
var Cn = At;
|
11164
11183
|
var da = /*#__PURE__*/function () {
|
11165
11184
|
function da() {
|
@@ -11197,7 +11216,7 @@ var da = /*#__PURE__*/function () {
|
|
11197
11216
|
}]);
|
11198
11217
|
return da;
|
11199
11218
|
}();
|
11200
|
-
|
11219
|
+
hi.WebSpeechTranscript = da;
|
11201
11220
|
var nt = {};
|
11202
11221
|
Object.defineProperty(nt, "__esModule", {
|
11203
11222
|
value: !0
|
@@ -11211,11 +11230,11 @@ dt.IS_SAFARI = function () {
|
|
11211
11230
|
return dt._IS_SAFARI === void 0 && (dt._IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), dt._IS_SAFARI;
|
11212
11231
|
};
|
11213
11232
|
var kt = {},
|
11214
|
-
|
11215
|
-
Object.defineProperty(
|
11233
|
+
pi = {};
|
11234
|
+
Object.defineProperty(pi, "__esModule", {
|
11216
11235
|
value: !0
|
11217
11236
|
});
|
11218
|
-
|
11237
|
+
pi.EventListeners = void 0;
|
11219
11238
|
var Y = /*#__PURE__*/function () {
|
11220
11239
|
function Y() {
|
11221
11240
|
_classCallCheck(this, Y);
|
@@ -11259,13 +11278,13 @@ var Y = /*#__PURE__*/function () {
|
|
11259
11278
|
}]);
|
11260
11279
|
return Y;
|
11261
11280
|
}();
|
11262
|
-
|
11281
|
+
pi.EventListeners = Y;
|
11263
11282
|
Y.KEY_DOWN_TIMEOUT = null;
|
11264
|
-
var
|
11265
|
-
Object.defineProperty(
|
11283
|
+
var fi = {};
|
11284
|
+
Object.defineProperty(fi, "__esModule", {
|
11266
11285
|
value: !0
|
11267
11286
|
});
|
11268
|
-
|
11287
|
+
fi.PreResultUtils = void 0;
|
11269
11288
|
var ua = /*#__PURE__*/function () {
|
11270
11289
|
function ua() {
|
11271
11290
|
_classCallCheck(this, ua);
|
@@ -11281,7 +11300,7 @@ var ua = /*#__PURE__*/function () {
|
|
11281
11300
|
}]);
|
11282
11301
|
return ua;
|
11283
11302
|
}();
|
11284
|
-
|
11303
|
+
fi.PreResultUtils = ua;
|
11285
11304
|
var It = {},
|
11286
11305
|
Lt = {};
|
11287
11306
|
Object.defineProperty(Lt, "__esModule", {
|
@@ -11378,11 +11397,11 @@ var ha = /*#__PURE__*/function () {
|
|
11378
11397
|
return ha;
|
11379
11398
|
}();
|
11380
11399
|
Ue.Elements = ha;
|
11381
|
-
var
|
11382
|
-
Object.defineProperty(
|
11400
|
+
var He = {};
|
11401
|
+
Object.defineProperty(He, "__esModule", {
|
11383
11402
|
value: !0
|
11384
11403
|
});
|
11385
|
-
|
11404
|
+
He.Cursor = void 0;
|
11386
11405
|
var ft = /*#__PURE__*/function () {
|
11387
11406
|
function ft() {
|
11388
11407
|
_classCallCheck(this, ft);
|
@@ -11464,7 +11483,7 @@ var ft = /*#__PURE__*/function () {
|
|
11464
11483
|
}]);
|
11465
11484
|
return ft;
|
11466
11485
|
}();
|
11467
|
-
|
11486
|
+
He.Cursor = ft;
|
11468
11487
|
Object.defineProperty(It, "__esModule", {
|
11469
11488
|
value: !0
|
11470
11489
|
});
|
@@ -11472,7 +11491,7 @@ It.CommandUtils = void 0;
|
|
11472
11491
|
var An = Lt,
|
11473
11492
|
pa = Ue,
|
11474
11493
|
fa = nt,
|
11475
|
-
kn =
|
11494
|
+
kn = He,
|
11476
11495
|
In = ze;
|
11477
11496
|
var K = /*#__PURE__*/function () {
|
11478
11497
|
function K() {
|
@@ -11570,18 +11589,18 @@ var K = /*#__PURE__*/function () {
|
|
11570
11589
|
return K;
|
11571
11590
|
}();
|
11572
11591
|
It.CommandUtils = K;
|
11573
|
-
var
|
11574
|
-
Object.defineProperty(
|
11592
|
+
var mi = {};
|
11593
|
+
Object.defineProperty(mi, "__esModule", {
|
11575
11594
|
value: !0
|
11576
11595
|
});
|
11577
|
-
|
11596
|
+
mi.Highlight = void 0;
|
11578
11597
|
var ma = Ue,
|
11579
|
-
st =
|
11580
|
-
var
|
11581
|
-
function
|
11582
|
-
_classCallCheck(this,
|
11598
|
+
st = He;
|
11599
|
+
var Yt = /*#__PURE__*/function () {
|
11600
|
+
function Yt() {
|
11601
|
+
_classCallCheck(this, Yt);
|
11583
11602
|
}
|
11584
|
-
_createClass(
|
11603
|
+
_createClass(Yt, null, [{
|
11585
11604
|
key: "setStateForPrimitive",
|
11586
11605
|
value: function setStateForPrimitive(e, t) {
|
11587
11606
|
var i, n;
|
@@ -11600,7 +11619,7 @@ var Kt = /*#__PURE__*/function () {
|
|
11600
11619
|
}, {
|
11601
11620
|
key: "setState",
|
11602
11621
|
value: function setState(e, t) {
|
11603
|
-
document.activeElement === t && (ma.Elements.isPrimitiveElement(t) ?
|
11622
|
+
document.activeElement === t && (ma.Elements.isPrimitiveElement(t) ? Yt.setStateForPrimitive(e, t) : Yt.setStateForGeneric(e, t));
|
11604
11623
|
}
|
11605
11624
|
}, {
|
11606
11625
|
key: "removeForGeneric",
|
@@ -11624,22 +11643,22 @@ var Kt = /*#__PURE__*/function () {
|
|
11624
11643
|
e.isHighlighted = !1;
|
11625
11644
|
}
|
11626
11645
|
}]);
|
11627
|
-
return
|
11646
|
+
return Yt;
|
11628
11647
|
}();
|
11629
|
-
|
11630
|
-
var
|
11631
|
-
Object.defineProperty(
|
11648
|
+
mi.Highlight = Yt;
|
11649
|
+
var gi = {};
|
11650
|
+
Object.defineProperty(gi, "__esModule", {
|
11632
11651
|
value: !0
|
11633
11652
|
});
|
11634
|
-
|
11653
|
+
gi.Padding = void 0;
|
11635
11654
|
var ga = Ue,
|
11636
|
-
Ln =
|
11655
|
+
Ln = He,
|
11637
11656
|
Ge = ze;
|
11638
|
-
var
|
11639
|
-
function
|
11640
|
-
_classCallCheck(this,
|
11657
|
+
var Zt = /*#__PURE__*/function () {
|
11658
|
+
function Zt() {
|
11659
|
+
_classCallCheck(this, Zt);
|
11641
11660
|
}
|
11642
|
-
_createClass(
|
11661
|
+
_createClass(Zt, null, [{
|
11643
11662
|
key: "setStateForPrimitiveElement",
|
11644
11663
|
value: function setStateForPrimitiveElement(e, t) {
|
11645
11664
|
if (document.activeElement === t && t.selectionStart !== null) {
|
@@ -11674,7 +11693,7 @@ var Yt = /*#__PURE__*/function () {
|
|
11674
11693
|
}, {
|
11675
11694
|
key: "setState",
|
11676
11695
|
value: function setState(e, t) {
|
11677
|
-
ga.Elements.isPrimitiveElement(t) ?
|
11696
|
+
ga.Elements.isPrimitiveElement(t) ? Zt.setStateForPrimitiveElement(e, t) : Zt.setStateForGenericElement(e, t);
|
11678
11697
|
}
|
11679
11698
|
}, {
|
11680
11699
|
key: "adjustStateAfterRecodingPrimitiveElement",
|
@@ -11691,27 +11710,27 @@ var Yt = /*#__PURE__*/function () {
|
|
11691
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);
|
11692
11711
|
}
|
11693
11712
|
}]);
|
11694
|
-
return
|
11713
|
+
return Zt;
|
11695
11714
|
}();
|
11696
|
-
|
11715
|
+
gi.Padding = Zt;
|
11697
11716
|
Object.defineProperty(kt, "__esModule", {
|
11698
11717
|
value: !0
|
11699
11718
|
});
|
11700
11719
|
kt.Speech = void 0;
|
11701
|
-
var Rn =
|
11702
|
-
ba =
|
11720
|
+
var Rn = pi,
|
11721
|
+
ba = fi,
|
11703
11722
|
Nn = It,
|
11704
11723
|
Dt = Lt,
|
11705
|
-
ki = fi,
|
11706
|
-
se = Ue,
|
11707
11724
|
Ii = mi,
|
11725
|
+
re = Ue,
|
11726
|
+
Li = gi,
|
11708
11727
|
On = nt,
|
11709
|
-
Pn =
|
11710
|
-
|
11728
|
+
Pn = He,
|
11729
|
+
Ri = ze;
|
11711
11730
|
var va = /*#__PURE__*/function () {
|
11712
11731
|
function va() {
|
11713
11732
|
_classCallCheck(this, va);
|
11714
|
-
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();
|
11715
11734
|
}
|
11716
11735
|
_createClass(va, [{
|
11717
11736
|
key: "prepareBeforeStart",
|
@@ -11724,12 +11743,12 @@ var va = /*#__PURE__*/function () {
|
|
11724
11743
|
if (!r) return;
|
11725
11744
|
this.prepare(r);
|
11726
11745
|
} else this.prepare(e.element);
|
11727
|
-
(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));
|
11728
11747
|
}
|
11729
11748
|
}, {
|
11730
11749
|
key: "prepare",
|
11731
11750
|
value: function prepare(e) {
|
11732
|
-
|
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);
|
11733
11752
|
}
|
11734
11753
|
// there was an attempt to optimize this by not having to restart the service and just reset state:
|
11735
11754
|
// unfortunately it did not work because the service would still continue firing the intermediate and final results
|
@@ -11744,7 +11763,7 @@ var va = /*#__PURE__*/function () {
|
|
11744
11763
|
key: "updateElements",
|
11745
11764
|
value: function updateElements(e, t, i) {
|
11746
11765
|
var n;
|
11747
|
-
var r =
|
11766
|
+
var r = Ri.Text.capitalize(t);
|
11748
11767
|
if (this.finalTranscript === r && e === "") return;
|
11749
11768
|
ba.PreResultUtils.process(this, i, e === "", this._onPreResult, this._options) && (e = "", i = "");
|
11750
11769
|
var o = this.commands && Nn.CommandUtils.execCommand(this, i, this._options, this._primitiveElement || this._genericElement, this._originalText);
|
@@ -11762,7 +11781,7 @@ var va = /*#__PURE__*/function () {
|
|
11762
11781
|
}, {
|
11763
11782
|
key: "updatePrimitiveElement",
|
11764
11783
|
value: function updatePrimitiveElement(e, t, i) {
|
11765
|
-
this.isHighlighted &&
|
11784
|
+
this.isHighlighted && Ii.Highlight.removeForPrimitive(this, e), this.primitiveTextRecorded || Li.Padding.adjustStateAfterRecodingPrimitiveElement(this, e), i && Li.Padding.adjustSateForNoTextPrimitiveElement(this);
|
11766
11785
|
var n = this.startPadding + this.finalTranscript + t;
|
11767
11786
|
if (e.value = n + this.endPadding, !this.isTargetInShadow) {
|
11768
11787
|
var r = n.length + this.numberOfSpacesAfterNewText;
|
@@ -11773,18 +11792,18 @@ var va = /*#__PURE__*/function () {
|
|
11773
11792
|
}, {
|
11774
11793
|
key: "updateGenericElement",
|
11775
11794
|
value: function updateGenericElement(e, t, i) {
|
11776
|
-
this.isHighlighted &&
|
11777
|
-
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);
|
11778
11797
|
this.finalSpan.innerHTML = n;
|
11779
11798
|
var r = Dt.AutoScroll.isRequired(this.autoScroll, e);
|
11780
11799
|
Dt.AutoScroll.changeStateIfNeeded(this, r);
|
11781
|
-
var o =
|
11800
|
+
var o = Ri.Text.lineBreak(t) + (i ? "" : this.endPadding);
|
11782
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 = "");
|
11783
11802
|
}
|
11784
11803
|
}, {
|
11785
11804
|
key: "finalise",
|
11786
11805
|
value: function finalise(e) {
|
11787
|
-
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);
|
11788
11807
|
}
|
11789
11808
|
}, {
|
11790
11809
|
key: "setInterimColorToFinal",
|
@@ -11818,20 +11837,20 @@ var va = /*#__PURE__*/function () {
|
|
11818
11837
|
return va;
|
11819
11838
|
}();
|
11820
11839
|
kt.Speech = va;
|
11821
|
-
Object.defineProperty(
|
11840
|
+
Object.defineProperty(ui, "__esModule", {
|
11822
11841
|
value: !0
|
11823
11842
|
});
|
11824
|
-
|
11825
|
-
var Dn =
|
11843
|
+
ui.WebSpeech = void 0;
|
11844
|
+
var Dn = hi,
|
11826
11845
|
jn = nt,
|
11827
11846
|
ya = kt;
|
11828
|
-
var
|
11829
|
-
_inherits(
|
11830
|
-
function
|
11831
|
-
_classCallCheck(this,
|
11832
|
-
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);
|
11833
11852
|
}
|
11834
|
-
_createClass(
|
11853
|
+
_createClass(Xt, [{
|
11835
11854
|
key: "start",
|
11836
11855
|
value: function start(e) {
|
11837
11856
|
var t;
|
@@ -11840,13 +11859,13 @@ var Zt = /*#__PURE__*/function (_ya$Speech) {
|
|
11840
11859
|
}, {
|
11841
11860
|
key: "validate",
|
11842
11861
|
value: function validate() {
|
11843
|
-
return
|
11862
|
+
return Xt.getAPI() ? !0 : (this.error("Speech Recognition is unsupported"), !1);
|
11844
11863
|
}
|
11845
11864
|
}, {
|
11846
11865
|
key: "instantiateService",
|
11847
11866
|
value: function instantiateService(e) {
|
11848
11867
|
var t, i;
|
11849
|
-
var n =
|
11868
|
+
var n = Xt.getAPI();
|
11850
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();
|
11851
11870
|
}
|
11852
11871
|
}, {
|
@@ -11888,14 +11907,14 @@ var Zt = /*#__PURE__*/function (_ya$Speech) {
|
|
11888
11907
|
return window.webkitSpeechRecognition || window.SpeechRecognition;
|
11889
11908
|
}
|
11890
11909
|
}]);
|
11891
|
-
return
|
11910
|
+
return Xt;
|
11892
11911
|
}(ya.Speech);
|
11893
|
-
|
11894
|
-
var
|
11895
|
-
Object.defineProperty(
|
11912
|
+
ui.WebSpeech = Xt;
|
11913
|
+
var bi = {};
|
11914
|
+
Object.defineProperty(bi, "__esModule", {
|
11896
11915
|
value: !0
|
11897
11916
|
});
|
11898
|
-
|
11917
|
+
bi.GlobalState = void 0;
|
11899
11918
|
var Xe = /*#__PURE__*/function () {
|
11900
11919
|
function Xe() {
|
11901
11920
|
_classCallCheck(this, Xe);
|
@@ -11910,14 +11929,14 @@ var Xe = /*#__PURE__*/function () {
|
|
11910
11929
|
}]);
|
11911
11930
|
return Xe;
|
11912
11931
|
}();
|
11913
|
-
|
11932
|
+
bi.GlobalState = Xe;
|
11914
11933
|
Xe.doubleClickPending = !1;
|
11915
|
-
var
|
11916
|
-
|
11917
|
-
Object.defineProperty(
|
11934
|
+
var vi = {},
|
11935
|
+
yi = {};
|
11936
|
+
Object.defineProperty(yi, "__esModule", {
|
11918
11937
|
value: !0
|
11919
11938
|
});
|
11920
|
-
|
11939
|
+
yi.PreventConnectionStop = void 0;
|
11921
11940
|
var xa = /*#__PURE__*/function () {
|
11922
11941
|
function xa() {
|
11923
11942
|
_classCallCheck(this, xa);
|
@@ -11937,27 +11956,27 @@ var xa = /*#__PURE__*/function () {
|
|
11937
11956
|
}]);
|
11938
11957
|
return xa;
|
11939
11958
|
}();
|
11940
|
-
|
11941
|
-
var
|
11942
|
-
|
11943
|
-
Object.defineProperty(
|
11959
|
+
yi.PreventConnectionStop = xa;
|
11960
|
+
var xi = {},
|
11961
|
+
Ei = {};
|
11962
|
+
Object.defineProperty(Ei, "__esModule", {
|
11944
11963
|
value: !0
|
11945
11964
|
});
|
11946
|
-
|
11947
|
-
|
11948
|
-
Object.defineProperty(
|
11965
|
+
Ei.README_URL = void 0;
|
11966
|
+
Ei.README_URL = "https://github.com/OvidijusParsiunas/speech-to-element";
|
11967
|
+
Object.defineProperty(xi, "__esModule", {
|
11949
11968
|
value: !0
|
11950
11969
|
});
|
11951
|
-
|
11952
|
-
var
|
11953
|
-
var
|
11954
|
-
function
|
11955
|
-
_classCallCheck(this,
|
11970
|
+
xi.AzureSpeechConfig = void 0;
|
11971
|
+
var Ni = Ei;
|
11972
|
+
var Qt = /*#__PURE__*/function () {
|
11973
|
+
function Qt() {
|
11974
|
+
_classCallCheck(this, Qt);
|
11956
11975
|
}
|
11957
|
-
_createClass(
|
11976
|
+
_createClass(Qt, null, [{
|
11958
11977
|
key: "validateOptions",
|
11959
11978
|
value: function validateOptions(e, t) {
|
11960
|
-
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);
|
11961
11980
|
}
|
11962
11981
|
}, {
|
11963
11982
|
key: "getNewSpeechConfig",
|
@@ -12000,10 +12019,10 @@ var Xt = /*#__PURE__*/function () {
|
|
12000
12019
|
while (1) switch (_context106.prev = _context106.next) {
|
12001
12020
|
case 0:
|
12002
12021
|
_context106.next = 2;
|
12003
|
-
return
|
12022
|
+
return Qt.getNewSpeechConfig(e, t);
|
12004
12023
|
case 2:
|
12005
12024
|
i = _context106.sent;
|
12006
|
-
return _context106.abrupt("return", (i &&
|
12025
|
+
return _context106.abrupt("return", (i && Qt.process(i, t), i));
|
12007
12026
|
case 4:
|
12008
12027
|
case "end":
|
12009
12028
|
return _context106.stop();
|
@@ -12016,14 +12035,14 @@ var Xt = /*#__PURE__*/function () {
|
|
12016
12035
|
return get;
|
12017
12036
|
}()
|
12018
12037
|
}]);
|
12019
|
-
return
|
12038
|
+
return Qt;
|
12020
12039
|
}();
|
12021
|
-
|
12022
|
-
var
|
12023
|
-
Object.defineProperty(
|
12040
|
+
xi.AzureSpeechConfig = Qt;
|
12041
|
+
var _i = {};
|
12042
|
+
Object.defineProperty(_i, "__esModule", {
|
12024
12043
|
value: !0
|
12025
12044
|
});
|
12026
|
-
|
12045
|
+
_i.StopTimeout = void 0;
|
12027
12046
|
var Et = /*#__PURE__*/function () {
|
12028
12047
|
function Et() {
|
12029
12048
|
_classCallCheck(this, Et);
|
@@ -12043,13 +12062,13 @@ var Et = /*#__PURE__*/function () {
|
|
12043
12062
|
}]);
|
12044
12063
|
return Et;
|
12045
12064
|
}();
|
12046
|
-
|
12065
|
+
_i.StopTimeout = Et;
|
12047
12066
|
Et.DEFAULT_MS = 2e4;
|
12048
|
-
var
|
12049
|
-
Object.defineProperty(
|
12067
|
+
var Si = {};
|
12068
|
+
Object.defineProperty(Si, "__esModule", {
|
12050
12069
|
value: !0
|
12051
12070
|
});
|
12052
|
-
|
12071
|
+
Si.AzureTranscript = void 0;
|
12053
12072
|
var Ea = At;
|
12054
12073
|
var _a = /*#__PURE__*/function () {
|
12055
12074
|
function _a() {
|
@@ -12073,28 +12092,28 @@ var _a = /*#__PURE__*/function () {
|
|
12073
12092
|
}]);
|
12074
12093
|
return _a;
|
12075
12094
|
}();
|
12076
|
-
|
12077
|
-
Object.defineProperty(
|
12095
|
+
Si.AzureTranscript = _a;
|
12096
|
+
Object.defineProperty(vi, "__esModule", {
|
12078
12097
|
value: !0
|
12079
12098
|
});
|
12080
|
-
|
12081
|
-
var Fn =
|
12082
|
-
Bn =
|
12083
|
-
|
12084
|
-
zn =
|
12099
|
+
vi.Azure = void 0;
|
12100
|
+
var Fn = yi,
|
12101
|
+
Bn = xi,
|
12102
|
+
Oi = _i,
|
12103
|
+
zn = Si,
|
12085
12104
|
Sa = kt;
|
12086
|
-
var
|
12087
|
-
_inherits(
|
12088
|
-
function
|
12105
|
+
var ei = /*#__PURE__*/function (_Sa$Speech) {
|
12106
|
+
_inherits(ei, _Sa$Speech);
|
12107
|
+
function ei() {
|
12089
12108
|
var _this59;
|
12090
|
-
_classCallCheck(this,
|
12091
|
-
_this59 = _callSuper(this,
|
12109
|
+
_classCallCheck(this, ei);
|
12110
|
+
_this59 = _callSuper(this, ei, arguments), _this59._newTextPadding = "";
|
12092
12111
|
return _this59;
|
12093
12112
|
}
|
12094
|
-
_createClass(
|
12113
|
+
_createClass(ei, [{
|
12095
12114
|
key: "start",
|
12096
12115
|
value: function start(e, t) {
|
12097
|
-
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);
|
12098
12117
|
}
|
12099
12118
|
}, {
|
12100
12119
|
key: "startAsync",
|
@@ -12128,7 +12147,7 @@ var Qt = /*#__PURE__*/function (_Sa$Speech) {
|
|
12128
12147
|
}, {
|
12129
12148
|
key: "validate",
|
12130
12149
|
value: function validate(e) {
|
12131
|
-
return
|
12150
|
+
return ei.getAPI() ? Bn.AzureSpeechConfig.validateOptions(this.error.bind(this), e) : (this.moduleNotFound(), !1);
|
12132
12151
|
}
|
12133
12152
|
}, {
|
12134
12153
|
key: "instantiateService",
|
@@ -12138,7 +12157,7 @@ var Qt = /*#__PURE__*/function (_Sa$Speech) {
|
|
12138
12157
|
return _regeneratorRuntime().wrap(function _callee108$(_context108) {
|
12139
12158
|
while (1) switch (_context108.prev = _context108.next) {
|
12140
12159
|
case 0:
|
12141
|
-
t =
|
12160
|
+
t = ei.getAPI();
|
12142
12161
|
i = t.AudioConfig.fromDefaultMicrophoneInput();
|
12143
12162
|
_context108.next = 4;
|
12144
12163
|
return Bn.AzureSpeechConfig.get(t.SpeechConfig, e);
|
@@ -12173,7 +12192,7 @@ var Qt = /*#__PURE__*/function (_Sa$Speech) {
|
|
12173
12192
|
i = _zn$AzureTranscript$e.interimTranscript,
|
12174
12193
|
n = _zn$AzureTranscript$e.finalTranscript,
|
12175
12194
|
r = _zn$AzureTranscript$e.newText;
|
12176
|
-
|
12195
|
+
Oi.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(i, n, r);
|
12177
12196
|
}
|
12178
12197
|
// WORK - huge opportunity to fix this in the repo!!!!!
|
12179
12198
|
// function onRecognized(sender, recognitionEventArgs) {
|
@@ -12194,7 +12213,7 @@ var Qt = /*#__PURE__*/function (_Sa$Speech) {
|
|
12194
12213
|
n = _zn$AzureTranscript$e2.interimTranscript,
|
12195
12214
|
r = _zn$AzureTranscript$e2.finalTranscript,
|
12196
12215
|
o = _zn$AzureTranscript$e2.newText;
|
12197
|
-
|
12216
|
+
Oi.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(n, r, o), r !== "" && (this._newTextPadding = " ");
|
12198
12217
|
}
|
12199
12218
|
break;
|
12200
12219
|
}
|
@@ -12248,16 +12267,16 @@ var Qt = /*#__PURE__*/function (_Sa$Speech) {
|
|
12248
12267
|
return window.SpeechSDK;
|
12249
12268
|
}
|
12250
12269
|
}]);
|
12251
|
-
return
|
12270
|
+
return ei;
|
12252
12271
|
}(Sa.Speech);
|
12253
|
-
|
12272
|
+
vi.Azure = ei;
|
12254
12273
|
Object.defineProperty(xs, "__esModule", {
|
12255
12274
|
value: !0
|
12256
12275
|
});
|
12257
|
-
var Un =
|
12276
|
+
var Un = ui,
|
12258
12277
|
wa = It,
|
12259
|
-
ie =
|
12260
|
-
Ma =
|
12278
|
+
ie = bi,
|
12279
|
+
Ma = vi;
|
12261
12280
|
var Ke = /*#__PURE__*/function () {
|
12262
12281
|
function Ke() {
|
12263
12282
|
_classCallCheck(this, Ke);
|
@@ -12299,33 +12318,66 @@ var Ke = /*#__PURE__*/function () {
|
|
12299
12318
|
}]);
|
12300
12319
|
return Ke;
|
12301
12320
|
}();
|
12302
|
-
var
|
12303
|
-
var
|
12304
|
-
_inherits(
|
12305
|
-
function
|
12321
|
+
var jt = xs["default"] = Ke;
|
12322
|
+
var ti = /*#__PURE__*/function (_xt) {
|
12323
|
+
_inherits(ti, _xt);
|
12324
|
+
function ti(e, t, i) {
|
12306
12325
|
var _this61;
|
12307
|
-
_classCallCheck(this,
|
12326
|
+
_classCallCheck(this, ti);
|
12308
12327
|
var o;
|
12309
|
-
_this61 = _callSuper(this,
|
12310
|
-
var
|
12311
|
-
n =
|
12312
|
-
r =
|
12313
|
-
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 {
|
12314
12333
|
var a = !e.textInput || !e.textInput.disabled;
|
12315
12334
|
_this61.elementRef.onclick = _this61.buttonClick.bind(_assertThisInitialized(_this61), t, a, n, r);
|
12316
12335
|
}
|
12317
12336
|
return _this61;
|
12318
12337
|
}
|
12338
|
+
// fix bug to be able to submit after recording
|
12319
12339
|
// prettier-ignore
|
12320
|
-
_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
|
+
}, {
|
12321
12364
|
key: "buttonClick",
|
12322
12365
|
value: function buttonClick(e, t, i, n) {
|
12323
|
-
|
12366
|
+
var _this63 = this;
|
12367
|
+
e.removeTextIfPlaceholder(), jt.toggle(i, _objectSpread({
|
12324
12368
|
insertInCursorLocation: !1,
|
12325
12369
|
element: t ? e.inputElementRef : void 0,
|
12326
|
-
onError:
|
12370
|
+
onError: function onError() {
|
12371
|
+
_this63.onError(), _this63.clearSilenceTimeout();
|
12372
|
+
},
|
12327
12373
|
onStart: this.changeToActive.bind(this),
|
12328
|
-
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),
|
12329
12381
|
onCommandModeTrigger: this.onCommandModeTrigger.bind(this)
|
12330
12382
|
}, n));
|
12331
12383
|
}
|
@@ -12342,8 +12394,8 @@ var ei = /*#__PURE__*/function (_xt) {
|
|
12342
12394
|
}], [{
|
12343
12395
|
key: "processConfiguration",
|
12344
12396
|
value: function processConfiguration(e, t) {
|
12345
|
-
var _i$displayInterimResu, _i$textColor, _i$translations, _i$commands;
|
12346
|
-
var c;
|
12397
|
+
var _i$displayInterimResu, _i$textColor, _i$translations, _i$commands, _i$submitAfterSilence, _i$submitAfterSilence2;
|
12398
|
+
var c, d;
|
12347
12399
|
var i = _typeof(t) == "object" ? t : {},
|
12348
12400
|
n = _typeof(i.webSpeech) == "object" ? i.webSpeech : {},
|
12349
12401
|
r = i.azure || {},
|
@@ -12351,29 +12403,33 @@ var ei = /*#__PURE__*/function (_xt) {
|
|
12351
12403
|
displayInterimResults: (_i$displayInterimResu = i.displayInterimResults) !== null && _i$displayInterimResu !== void 0 ? _i$displayInterimResu : void 0,
|
12352
12404
|
textColor: (_i$textColor = i.textColor) !== null && _i$textColor !== void 0 ? _i$textColor : void 0,
|
12353
12405
|
translations: (_i$translations = i.translations) !== null && _i$translations !== void 0 ? _i$translations : void 0,
|
12354
|
-
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
|
12355
12408
|
}, n), r),
|
12356
12409
|
a = (c = i.commands) == null ? void 0 : c.submit;
|
12357
|
-
return a && (o.onPreResult = function (
|
12358
|
-
return
|
12359
|
-
var
|
12360
|
-
return (
|
12361
|
-
}),
|
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(), {
|
12362
12415
|
restart: !0,
|
12363
12416
|
removeNewText: !0
|
12364
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
|
12365
12421
|
}), {
|
12366
|
-
serviceName:
|
12422
|
+
serviceName: ti.getServiceName(i),
|
12367
12423
|
processedConfig: o
|
12368
12424
|
};
|
12369
12425
|
}
|
12370
12426
|
}, {
|
12371
12427
|
key: "getServiceName",
|
12372
12428
|
value: function getServiceName(e) {
|
12373
|
-
return e.
|
12429
|
+
return e.azure ? "azure" : "webspeech";
|
12374
12430
|
}
|
12375
12431
|
}]);
|
12376
|
-
return
|
12432
|
+
return ti;
|
12377
12433
|
}(xt);
|
12378
12434
|
var Es = /*#__PURE__*/function () {
|
12379
12435
|
function Es() {
|
@@ -12394,11 +12450,11 @@ var Es = /*#__PURE__*/function () {
|
|
12394
12450
|
var Ta = /*#__PURE__*/function (_xt2) {
|
12395
12451
|
_inherits(Ta, _xt2);
|
12396
12452
|
function Ta(e, t) {
|
12397
|
-
var
|
12453
|
+
var _this64;
|
12398
12454
|
_classCallCheck(this, Ta);
|
12399
12455
|
var i, n;
|
12400
|
-
|
12401
|
-
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;
|
12402
12458
|
}
|
12403
12459
|
_createClass(Ta, [{
|
12404
12460
|
key: "buttonClick",
|
@@ -12408,10 +12464,10 @@ var Ta = /*#__PURE__*/function (_xt2) {
|
|
12408
12464
|
}, {
|
12409
12465
|
key: "stop",
|
12410
12466
|
value: function stop() {
|
12411
|
-
var
|
12467
|
+
var _this65 = this;
|
12412
12468
|
return new Promise(function (e) {
|
12413
12469
|
var t, i;
|
12414
|
-
|
12470
|
+
_this65.changeToDefault(), (t = _this65._mediaRecorder) == null || t.stop(), (i = _this65._mediaStream) == null || i.getTracks().forEach(function (n) {
|
12415
12471
|
return n.stop();
|
12416
12472
|
}), setTimeout(function () {
|
12417
12473
|
e();
|
@@ -12421,23 +12477,23 @@ var Ta = /*#__PURE__*/function (_xt2) {
|
|
12421
12477
|
}, {
|
12422
12478
|
key: "record",
|
12423
12479
|
value: function record() {
|
12424
|
-
var
|
12480
|
+
var _this66 = this;
|
12425
12481
|
navigator.mediaDevices.getUserMedia({
|
12426
12482
|
audio: !0
|
12427
12483
|
}).then(function (e) {
|
12428
|
-
|
12429
|
-
|
12430
|
-
}),
|
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();
|
12431
12487
|
})["catch"](function (e) {
|
12432
|
-
console.error(e),
|
12488
|
+
console.error(e), _this66.stop();
|
12433
12489
|
})["finally"](function () {
|
12434
|
-
|
12490
|
+
_this66._waitingForBrowserApproval = !1;
|
12435
12491
|
});
|
12436
12492
|
}
|
12437
12493
|
}, {
|
12438
12494
|
key: "createFile",
|
12439
12495
|
value: function createFile(e) {
|
12440
|
-
var
|
12496
|
+
var _this67 = this;
|
12441
12497
|
var t = new Blob([e.data], {
|
12442
12498
|
type: "audio/".concat(this._extension)
|
12443
12499
|
}),
|
@@ -12447,7 +12503,7 @@ var Ta = /*#__PURE__*/function (_xt2) {
|
|
12447
12503
|
}),
|
12448
12504
|
r = new FileReader();
|
12449
12505
|
r.readAsDataURL(n), r.onload = function (o) {
|
12450
|
-
|
12506
|
+
_this67._audioType.completePlaceholderAttachment(n, o.target.result);
|
12451
12507
|
};
|
12452
12508
|
}
|
12453
12509
|
}]);
|
@@ -12522,23 +12578,23 @@ var Re = /*#__PURE__*/function () {
|
|
12522
12578
|
}]);
|
12523
12579
|
return Re;
|
12524
12580
|
}();
|
12525
|
-
var
|
12581
|
+
var wi = /*#__PURE__*/function (_Tt4) {
|
12526
12582
|
_inherits(k, _Tt4);
|
12527
12583
|
// prettier-ignore
|
12528
12584
|
function k(e, t, i, n, r) {
|
12529
|
-
var
|
12585
|
+
var _this68;
|
12530
12586
|
_classCallCheck(this, k);
|
12531
12587
|
var o = Re.process(e.submitButtonStyles);
|
12532
|
-
|
12588
|
+
_this68 = _callSuper(this, k, [k.createButtonContainerElement(), o == null ? void 0 : o.position, o]), _this68._isSVGLoadingIconOverriden = !1, _this68.status = {
|
12533
12589
|
requestInProgress: !1,
|
12534
12590
|
loadingActive: !1
|
12535
|
-
},
|
12591
|
+
}, _this68._messages = i, _this68._inputElementRef = t, _this68._fileAttachments = r, _this68._innerElements = _this68.createInnerElements(), _this68._abortStream = new AbortController(), _this68._stopClicked = {
|
12536
12592
|
listener: function listener() {}
|
12537
|
-
},
|
12593
|
+
}, _this68._serviceIO = n, _this68._alwaysEnabled = !!(o != null && o.alwaysEnabled), e.disableSubmitButton = _this68.disableSubmitButton.bind(_assertThisInitialized(_this68), n), _this68.attemptOverwriteLoadingStyle(e), setTimeout(function () {
|
12538
12594
|
var a;
|
12539
|
-
|
12595
|
+
_this68._validationHandler = e._validationHandler, _this68.assignHandlers(_this68._validationHandler), (a = _this68._validationHandler) == null || a.call(_assertThisInitialized(_this68));
|
12540
12596
|
});
|
12541
|
-
return
|
12597
|
+
return _this68;
|
12542
12598
|
}
|
12543
12599
|
// prettier-ignore
|
12544
12600
|
_createClass(k, [{
|
@@ -12627,22 +12683,22 @@ var Si = /*#__PURE__*/function (_Tt4) {
|
|
12627
12683
|
key: "programmaticSubmit",
|
12628
12684
|
value: function () {
|
12629
12685
|
var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee110(e) {
|
12630
|
-
var
|
12686
|
+
var _this69 = this;
|
12631
12687
|
var t;
|
12632
12688
|
return _regeneratorRuntime().wrap(function _callee110$(_context110) {
|
12633
12689
|
while (1) switch (_context110.prev = _context110.next) {
|
12634
12690
|
case 0:
|
12635
|
-
typeof e == "string" && (e =
|
12691
|
+
typeof e == "string" && (e = se.processSubmitUserMessage(e));
|
12636
12692
|
t = {
|
12637
12693
|
text: e.text
|
12638
12694
|
};
|
12639
12695
|
e.files && (t.files = Array.from(e.files).map(function (i) {
|
12640
12696
|
return {
|
12641
12697
|
file: i,
|
12642
|
-
type:
|
12698
|
+
type: fe.getTypeFromBlob(i)
|
12643
12699
|
};
|
12644
12700
|
})), setTimeout(function () {
|
12645
|
-
return
|
12701
|
+
return _this69.attemptSubmit(t, !0);
|
12646
12702
|
});
|
12647
12703
|
case 3:
|
12648
12704
|
case "end":
|
@@ -12806,10 +12862,10 @@ var Si = /*#__PURE__*/function (_Tt4) {
|
|
12806
12862
|
}]);
|
12807
12863
|
return k;
|
12808
12864
|
}(Tt);
|
12809
|
-
|
12810
|
-
|
12811
|
-
|
12812
|
-
var Aa =
|
12865
|
+
wi.SUBMIT_CLASS = "submit-button";
|
12866
|
+
wi.LOADING_CLASS = "loading-button";
|
12867
|
+
wi.DISABLED_CLASS = "disabled-button";
|
12868
|
+
var Aa = wi;
|
12813
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",
|
12814
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",
|
12815
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>",
|
@@ -12818,14 +12874,14 @@ var rn = /*#__PURE__*/function (_ct) {
|
|
12818
12874
|
_inherits(rn, _ct);
|
12819
12875
|
// prettier-ignore
|
12820
12876
|
function rn(e, t, i, n) {
|
12821
|
-
var
|
12877
|
+
var _this70;
|
12822
12878
|
_classCallCheck(this, rn);
|
12823
|
-
|
12824
|
-
var
|
12825
|
-
r =
|
12826
|
-
o =
|
12827
|
-
|
12828
|
-
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;
|
12829
12885
|
}
|
12830
12886
|
_createClass(rn, [{
|
12831
12887
|
key: "addButtonsAndTheirEvents",
|
@@ -12844,38 +12900,38 @@ var rn = /*#__PURE__*/function (_ct) {
|
|
12844
12900
|
}, {
|
12845
12901
|
key: "addButtonEvents",
|
12846
12902
|
value: function addButtonEvents(e, t, i, n) {
|
12847
|
-
var
|
12903
|
+
var _this71 = this;
|
12848
12904
|
e.onclick = function () {
|
12849
|
-
|
12905
|
+
_this71.capture();
|
12850
12906
|
}, t.addEventListener("click", this.stop.bind(this)), i.onclick = function () {
|
12851
|
-
var r =
|
12852
|
-
r && Ct.addFilesToType([r], [n]),
|
12907
|
+
var r = _this71.getFile();
|
12908
|
+
r && Ct.addFilesToType([r], [n]), _this71.stop(), _this71.close();
|
12853
12909
|
};
|
12854
12910
|
}
|
12855
12911
|
}, {
|
12856
12912
|
key: "stop",
|
12857
12913
|
value: function stop() {
|
12858
|
-
var
|
12914
|
+
var _this72 = this;
|
12859
12915
|
this._mediaStream && this._mediaStream.getTracks().forEach(function (e) {
|
12860
12916
|
return e.stop();
|
12861
12917
|
}), this._stopped = !0, setTimeout(function () {
|
12862
|
-
|
12863
|
-
var e =
|
12864
|
-
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);
|
12865
12921
|
}, ct.MODAL_CLOSE_TIMEOUT_MS);
|
12866
12922
|
}
|
12867
12923
|
}, {
|
12868
12924
|
key: "start",
|
12869
12925
|
value: function start() {
|
12870
|
-
var
|
12926
|
+
var _this73 = this;
|
12871
12927
|
this._dataURL = void 0, this._submitButton.classList.add("modal-svg-submit-disabled"), this._stopped = !1, navigator.mediaDevices.getUserMedia({
|
12872
12928
|
video: this._dimensions || !0
|
12873
12929
|
}).then(function (e) {
|
12874
|
-
if (
|
12930
|
+
if (_this73._mediaStream = e, !_this73.isOpen()) return _this73.stop();
|
12875
12931
|
var t = document.createElement("video");
|
12876
|
-
t.srcObject = e, t.play(), requestAnimationFrame(
|
12932
|
+
t.srcObject = e, t.play(), requestAnimationFrame(_this73.updateCanvas.bind(_this73, t, _this73._canvas));
|
12877
12933
|
})["catch"](function (e) {
|
12878
|
-
console.error(e),
|
12934
|
+
console.error(e), _this73.stop(), _this73.close();
|
12879
12935
|
});
|
12880
12936
|
}
|
12881
12937
|
}, {
|
@@ -12929,22 +12985,22 @@ var rn = /*#__PURE__*/function (_ct) {
|
|
12929
12985
|
return rn;
|
12930
12986
|
}(ct);
|
12931
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>";
|
12932
|
-
var
|
12933
|
-
_inherits(
|
12934
|
-
function
|
12935
|
-
var
|
12936
|
-
_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);
|
12937
12993
|
var r;
|
12938
|
-
|
12939
|
-
var n =
|
12940
|
-
i &&
|
12941
|
-
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;
|
12942
12998
|
}
|
12943
|
-
_createClass(
|
12999
|
+
_createClass(ii, [{
|
12944
13000
|
key: "createInnerElements",
|
12945
13001
|
value: function createInnerElements(e) {
|
12946
13002
|
return {
|
12947
|
-
styles: this.createInnerElement(
|
13003
|
+
styles: this.createInnerElement(ii.createSVGIconElement(), "styles", e)
|
12948
13004
|
};
|
12949
13005
|
}
|
12950
13006
|
}, {
|
@@ -12973,7 +13029,7 @@ var ti = /*#__PURE__*/function (_Tt5) {
|
|
12973
13029
|
return e.id = "camera-icon", e;
|
12974
13030
|
}
|
12975
13031
|
}]);
|
12976
|
-
return
|
13032
|
+
return ii;
|
12977
13033
|
}(Tt);
|
12978
13034
|
var mt = /*#__PURE__*/function () {
|
12979
13035
|
function mt(e, t, i, n) {
|
@@ -12983,7 +13039,7 @@ var mt = /*#__PURE__*/function () {
|
|
12983
13039
|
o = {},
|
12984
13040
|
a = this.createFileUploadComponents(e, i, n, o);
|
12985
13041
|
e.speechToText && !o.microphone && (o.microphone = {
|
12986
|
-
button: new
|
13042
|
+
button: new ti(e, r, t.addNewErrorMessage.bind(t))
|
12987
13043
|
});
|
12988
13044
|
var l = new Aa(e, r.inputElementRef, t, i, a);
|
12989
13045
|
r.submit = l.submitFromInput.bind(l), Ie.attach(e, i, r, a, l), e.submitUserMessage = l.programmaticSubmit.bind(l), o.submit = {
|
@@ -13000,7 +13056,7 @@ var mt = /*#__PURE__*/function () {
|
|
13000
13056
|
if (mt.createUploadButtons(e, t.fileTypes || {}, r, i, n), (o = t.camera) != null && o.files) {
|
13001
13057
|
var d = ((a = n.images) == null ? void 0 : a.fileType) || r.addType(e, t.camera.files, "images");
|
13002
13058
|
n.camera = {
|
13003
|
-
button: new
|
13059
|
+
button: new ii(i, d, t.camera)
|
13004
13060
|
};
|
13005
13061
|
}
|
13006
13062
|
if ((l = t.recordAudio) != null && l.files) {
|
@@ -13009,7 +13065,7 @@ var mt = /*#__PURE__*/function () {
|
|
13009
13065
|
button: new Ta(_d, t.recordAudio)
|
13010
13066
|
};
|
13011
13067
|
}
|
13012
|
-
return
|
13068
|
+
return he.isEnabled(r, e.dragAndDrop) && he.create(i, r, e.dragAndDrop), r;
|
13013
13069
|
}
|
13014
13070
|
// prettier-ignore
|
13015
13071
|
}], [{
|
@@ -13073,7 +13129,7 @@ var on = /*#__PURE__*/function () {
|
|
13073
13129
|
}]);
|
13074
13130
|
return on;
|
13075
13131
|
}();
|
13076
|
-
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";
|
13077
13133
|
var Pa = Object.defineProperty,
|
13078
13134
|
Da = Object.getOwnPropertyDescriptor,
|
13079
13135
|
_ = function _(s, e, t, i) {
|
@@ -13083,34 +13139,34 @@ var Pa = Object.defineProperty,
|
|
13083
13139
|
var y = /*#__PURE__*/function (_So) {
|
13084
13140
|
_inherits(y, _So);
|
13085
13141
|
function y() {
|
13086
|
-
var
|
13142
|
+
var _this75;
|
13087
13143
|
_classCallCheck(this, y);
|
13088
|
-
|
13144
|
+
_this75 = _callSuper(this, y), _this75.getMessages = function () {
|
13089
13145
|
return [];
|
13090
|
-
},
|
13146
|
+
}, _this75.submitUserMessage = function () {
|
13091
13147
|
return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
|
13092
|
-
},
|
13093
|
-
return ii.focusFromParentElement(_this73._elementRef);
|
13094
|
-
}, _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 () {
|
13095
13149
|
return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
|
13096
|
-
},
|
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({
|
13097
13153
|
mode: "open"
|
13098
|
-
}).appendChild(
|
13099
|
-
|
13154
|
+
}).appendChild(_this75._elementRef), Mi.apply(Oa, _this75.shadowRoot), setTimeout(function () {
|
13155
|
+
_this75._hasBeenRendered || _this75.onRender();
|
13100
13156
|
}, 20);
|
13101
|
-
return
|
13157
|
+
return _this75;
|
13102
13158
|
}
|
13103
13159
|
_createClass(y, [{
|
13104
13160
|
key: "changeToChatView",
|
13105
13161
|
value: function changeToChatView() {
|
13106
|
-
this._activeService && (this._activeService.
|
13162
|
+
this._activeService && (this._activeService.validateKeyProperty = !1), this.onRender();
|
13107
13163
|
}
|
13108
13164
|
// prettier-ignore
|
13109
13165
|
}, {
|
13110
13166
|
key: "onRender",
|
13111
13167
|
value: function onRender() {
|
13112
13168
|
var _this$_childElement;
|
13113
|
-
(!this._activeService || this._activeService.demo) && (this._activeService = $o.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (
|
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);
|
13114
13170
|
}
|
13115
13171
|
}, {
|
13116
13172
|
key: "disconnectedCallback",
|
@@ -13120,8 +13176,8 @@ var y = /*#__PURE__*/function (_So) {
|
|
13120
13176
|
}]);
|
13121
13177
|
return y;
|
13122
13178
|
}(So);
|
13123
|
-
_([E("object")], y.prototype, "directConnection", 2);
|
13124
13179
|
_([E("object")], y.prototype, "connect", 2);
|
13180
|
+
_([E("object")], y.prototype, "directConnection", 2);
|
13125
13181
|
_([E("object")], y.prototype, "webModel", 2);
|
13126
13182
|
_([E("object")], y.prototype, "requestBodyLimits", 2);
|
13127
13183
|
_([E("function")], y.prototype, "requestInterceptor", 2);
|
@@ -13152,7 +13208,7 @@ _([E("object")], y.prototype, "mixedFiles", 2);
|
|
13152
13208
|
_([E("object")], y.prototype, "dragAndDrop", 2);
|
13153
13209
|
_([E("object")], y.prototype, "introPanelStyle", 2);
|
13154
13210
|
_([E("object")], y.prototype, "htmlClassUtilities", 2);
|
13155
|
-
_([E("function")], y.prototype, "
|
13211
|
+
_([E("function")], y.prototype, "onMessage", 2);
|
13156
13212
|
_([E("function")], y.prototype, "onClearMessages", 2);
|
13157
13213
|
_([E("function")], y.prototype, "onComponentRender", 2);
|
13158
13214
|
_([E("function")], y.prototype, "onError", 2);
|