deep-chat-dev 9.0.105 → 9.0.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/custom-elements.json +750 -604
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.js +559 -595
- package/dist/services/serviceIO.d.ts.map +1 -1
- package/dist/types/submitButton.d.ts +1 -1
- package/dist/types/submitButton.d.ts.map +1 -1
- package/dist/types/webModel/webModel.d.ts +1 -0
- package/dist/types/webModel/webModel.d.ts.map +1 -1
- package/dist/views/chat/input/dropup/dropupMenu.d.ts +4 -0
- package/dist/views/chat/input/dropup/dropupMenu.d.ts.map +1 -1
- package/dist/views/chat/input/fileAttachments/modal/modal.d.ts +2 -0
- package/dist/views/chat/input/fileAttachments/modal/modal.d.ts.map +1 -1
- package/dist/views/chat/messages/messages.d.ts.map +1 -1
- package/dist/webModel/webModel.d.ts.map +1 -1
- package/dist/webModel/webModelConfig.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -240,29 +240,29 @@ var ys = /*#__PURE__*/function () {
|
|
240
240
|
}]);
|
241
241
|
return ys;
|
242
242
|
}();
|
243
|
-
var
|
244
|
-
function
|
243
|
+
var Un = /*#__PURE__*/function () {
|
244
|
+
function qe(e, t) {
|
245
245
|
var _this = this;
|
246
|
-
_classCallCheck(this,
|
246
|
+
_classCallCheck(this, qe);
|
247
247
|
var n;
|
248
|
-
var i =
|
249
|
-
this.elementRef =
|
248
|
+
var i = qe.processConfig(t, e.textInput);
|
249
|
+
this.elementRef = qe.createContainerElement((n = i == null ? void 0 : i.styles) == null ? void 0 : n.container), this.inputElementRef = this.createInputElement(i), this._config = i, this.elementRef.appendChild(this.inputElementRef), setTimeout(function () {
|
250
250
|
var r;
|
251
251
|
vs.add(_this.inputElementRef, (r = e.textInput) == null ? void 0 : r.characterLimit, e._validationHandler);
|
252
252
|
});
|
253
253
|
}
|
254
|
-
_createClass(
|
254
|
+
_createClass(qe, [{
|
255
255
|
key: "createInputElement",
|
256
256
|
value: function createInputElement(e) {
|
257
257
|
var i, n, r;
|
258
258
|
var t = document.createElement("div");
|
259
|
-
return t.id =
|
259
|
+
return t.id = qe.TEXT_INPUT_ID, t.classList.add("text-input-styling", "text-input-placeholder"), t.innerText = ((i = e == null ? void 0 : e.placeholder) == null ? void 0 : i.text) || "Ask me anything!", ge.IS_CHROMIUM && qe.preventAutomaticScrollUpOnNewLine(t), typeof (e == null ? void 0 : e.disabled) == "boolean" && e.disabled === !0 ? (t.contentEditable = "false", t.classList.add("text-input-disabled")) : (t.contentEditable = "true", this.addEventListeners(t, e)), Object.assign(t.style, (n = e == null ? void 0 : e.styles) == null ? void 0 : n.text), Object.assign(t.style, (r = e == null ? void 0 : e.placeholder) == null ? void 0 : r.style), t;
|
260
260
|
}
|
261
261
|
}, {
|
262
262
|
key: "removeTextIfPlaceholder",
|
263
263
|
value: function removeTextIfPlaceholder() {
|
264
264
|
var e, t, i, n;
|
265
|
-
this.inputElementRef.classList.contains("text-input-placeholder") && !this.inputElementRef.classList.contains("text-input-disabled") && ((e = this._config.placeholder) != null && e.style && (T.unsetStyle(this.inputElementRef, (t = this._config.placeholder) == null ? void 0 : t.style), Object.assign(this.inputElementRef.style, (n = (i = this._config) == null ? void 0 : i.styles) == null ? void 0 : n.text)),
|
265
|
+
this.inputElementRef.classList.contains("text-input-placeholder") && !this.inputElementRef.classList.contains("text-input-disabled") && ((e = this._config.placeholder) != null && e.style && (T.unsetStyle(this.inputElementRef, (t = this._config.placeholder) == null ? void 0 : t.style), Object.assign(this.inputElementRef.style, (n = (i = this._config) == null ? void 0 : i.styles) == null ? void 0 : n.text)), qe.clear(this.inputElementRef), this.inputElementRef.classList.remove("text-input-placeholder"));
|
266
266
|
}
|
267
267
|
}, {
|
268
268
|
key: "addEventListeners",
|
@@ -334,10 +334,10 @@ var qn = /*#__PURE__*/function () {
|
|
334
334
|
return t.id = "text-input-container", Object.assign(t.style, e), t;
|
335
335
|
}
|
336
336
|
}]);
|
337
|
-
return
|
337
|
+
return qe;
|
338
338
|
}();
|
339
|
-
|
340
|
-
var
|
339
|
+
Un.TEXT_INPUT_ID = "text-input";
|
340
|
+
var qi = Un;
|
341
341
|
var Qt = /*#__PURE__*/function () {
|
342
342
|
function Qt() {
|
343
343
|
_classCallCheck(this, Qt);
|
@@ -353,7 +353,7 @@ var Qt = /*#__PURE__*/function () {
|
|
353
353
|
}, {
|
354
354
|
key: "focusFromParentElement",
|
355
355
|
value: function focusFromParentElement(e) {
|
356
|
-
var t = e.querySelector("#".concat(
|
356
|
+
var t = e.querySelector("#".concat(qi.TEXT_INPUT_ID));
|
357
357
|
t && Qt.focusEndOfInput(t);
|
358
358
|
}
|
359
359
|
}]);
|
@@ -373,11 +373,11 @@ function Hi(s, e, t, i) {
|
|
373
373
|
function Es(s, e, t, i) {
|
374
374
|
return "".concat(Hi(s, e, t, i), "Make sure the ").concat(e, " message is using the Response format: https://deepchat.dev/docs/connect/#Response \nYou can also augment it using the responseInterceptor property: https://deepchat.dev/docs/interceptors#responseInterceptor");
|
375
375
|
}
|
376
|
-
function
|
376
|
+
function Ss(s, e, t) {
|
377
377
|
var i = "response";
|
378
378
|
return "".concat(Hi(s, i, e, t), "Make sure the ").concat(i, " message is using the {text: string} format, e.g: {text: \"Model Response\"}");
|
379
379
|
}
|
380
|
-
function
|
380
|
+
function ws(s, e) {
|
381
381
|
var t = "request";
|
382
382
|
return "".concat(Hi(s, t, e), "Make sure the ").concat(t, " message is using the {body: {text: string}} format, e.g: {body: {text: \"Model Response\"}}");
|
383
383
|
}
|
@@ -386,13 +386,13 @@ var an = "Make sure the events are using {text: string} or {html: string} format
|
|
386
386
|
INVALID_KEY: "Invalid API Key",
|
387
387
|
CONNECTION_FAILED: "Failed to connect",
|
388
388
|
INVALID_RESPONSE: Es,
|
389
|
-
INVALID_MODEL_REQUEST:
|
390
|
-
INVALID_MODEL_RESPONSE:
|
389
|
+
INVALID_MODEL_REQUEST: ws,
|
390
|
+
INVALID_MODEL_RESPONSE: Ss,
|
391
391
|
INVALID_STREAM_EVENT: an,
|
392
392
|
INVALID_STREAM_EVENT_MIX: "Cannot mix {text: string} and {html: string} responses.",
|
393
393
|
NO_VALID_STREAM_EVENTS_SENT: "No valid stream events were sent.\n".concat(an)
|
394
394
|
},
|
395
|
-
|
395
|
+
qn = /*#__PURE__*/function () {
|
396
396
|
function Hn() {
|
397
397
|
_classCallCheck(this, Hn);
|
398
398
|
}
|
@@ -434,13 +434,13 @@ var an = "Make sure the events are using {text: string} or {html: string} format
|
|
434
434
|
}]);
|
435
435
|
return Hn;
|
436
436
|
}();
|
437
|
-
|
438
|
-
var Y =
|
439
|
-
var
|
440
|
-
function
|
441
|
-
_classCallCheck(this,
|
437
|
+
qn.CODE_SNIPPET_GENERATION_JUMP = 0.5;
|
438
|
+
var Y = qn;
|
439
|
+
var Gn = /*#__PURE__*/function () {
|
440
|
+
function Vn() {
|
441
|
+
_classCallCheck(this, Vn);
|
442
442
|
}
|
443
|
-
_createClass(
|
443
|
+
_createClass(Vn, null, [{
|
444
444
|
key: "speak",
|
445
445
|
value: function speak(e, t) {
|
446
446
|
if (window.SpeechSynthesisUtterance) {
|
@@ -461,13 +461,13 @@ var Vn = /*#__PURE__*/function () {
|
|
461
461
|
n && (i.voice = n);
|
462
462
|
}
|
463
463
|
t(i);
|
464
|
-
},
|
464
|
+
}, Vn.LOAD_VOICES_MS);
|
465
465
|
}
|
466
466
|
}]);
|
467
|
-
return
|
467
|
+
return Vn;
|
468
468
|
}();
|
469
|
-
|
470
|
-
var Nt =
|
469
|
+
Gn.LOAD_VOICES_MS = 200;
|
470
|
+
var Nt = Gn;
|
471
471
|
var ke = /*#__PURE__*/function () {
|
472
472
|
function ke() {
|
473
473
|
_classCallCheck(this, ke);
|
@@ -629,7 +629,7 @@ var Te = /*#__PURE__*/function () {
|
|
629
629
|
}]);
|
630
630
|
return Te;
|
631
631
|
}();
|
632
|
-
var
|
632
|
+
var _s = "deep-chat-temporary-message",
|
633
633
|
Ms = "deep-chat-suggestion-button",
|
634
634
|
Ri = {
|
635
635
|
"deep-chat-button": {
|
@@ -673,7 +673,7 @@ var be = /*#__PURE__*/function () {
|
|
673
673
|
key: "isElementTemporary",
|
674
674
|
value: function isElementTemporary(e) {
|
675
675
|
var t;
|
676
|
-
return e ? (t = e.bubbleElement.children[0]) == null ? void 0 : t.classList.contains(
|
676
|
+
return e ? (t = e.bubbleElement.children[0]) == null ? void 0 : t.classList.contains(_s) : !1;
|
677
677
|
}
|
678
678
|
}, {
|
679
679
|
key: "doesElementContainDeepChatClass",
|
@@ -1083,14 +1083,14 @@ function $n(s, e) {
|
|
1083
1083
|
var Re = f.getBreak = function (e, t) {
|
1084
1084
|
return t = $n(e, t), t < e.length && e[t].type === "list_item_close" ? "" : "\n";
|
1085
1085
|
};
|
1086
|
-
function
|
1086
|
+
function Gi() {
|
1087
1087
|
this.rules = Kn({}, f), this.getBreak = f.getBreak;
|
1088
1088
|
}
|
1089
|
-
|
1089
|
+
Gi.prototype.renderInline = function (s, e, t) {
|
1090
1090
|
for (var i = this.rules, n = s.length, r = 0, o = ""; n--;) o += i[s[r].type](s, r++, e, t, this);
|
1091
1091
|
return o;
|
1092
1092
|
};
|
1093
|
-
|
1093
|
+
Gi.prototype.render = function (s, e, t) {
|
1094
1094
|
for (var i = this.rules, n = s.length, r = -1, o = ""; ++r < n;) s[r].type === "inline" ? o += this.renderInline(s[r].children, e, t) : o += i[s[r].type](s, r, e, t, this);
|
1095
1095
|
return o;
|
1096
1096
|
};
|
@@ -1316,14 +1316,14 @@ function zs(s) {
|
|
1316
1316
|
}
|
1317
1317
|
}
|
1318
1318
|
}
|
1319
|
-
function
|
1319
|
+
function Us(s) {
|
1320
1320
|
var e = s.tokens,
|
1321
1321
|
t,
|
1322
1322
|
i,
|
1323
1323
|
n;
|
1324
1324
|
for (i = 0, n = e.length; i < n; i++) t = e[i], t.type === "inline" && s.inline.parse(t.content, s.options, s.env, t.children);
|
1325
1325
|
}
|
1326
|
-
function
|
1326
|
+
function qs(s) {
|
1327
1327
|
var e,
|
1328
1328
|
t,
|
1329
1329
|
i,
|
@@ -1378,7 +1378,7 @@ function Us(s) {
|
|
1378
1378
|
}
|
1379
1379
|
}
|
1380
1380
|
var cn = " \n()[]'\".,!?-";
|
1381
|
-
function
|
1381
|
+
function Si(s) {
|
1382
1382
|
return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1");
|
1383
1383
|
}
|
1384
1384
|
function Hs(s) {
|
@@ -1396,11 +1396,11 @@ function Hs(s) {
|
|
1396
1396
|
h,
|
1397
1397
|
p = s.tokens;
|
1398
1398
|
if (s.env.abbreviations) {
|
1399
|
-
for (s.env.abbrRegExp || (h = "(^|[" + cn.split("").map(
|
1399
|
+
for (s.env.abbrRegExp || (h = "(^|[" + cn.split("").map(Si).join("") + "])(" + Object.keys(s.env.abbreviations).map(function (g) {
|
1400
1400
|
return g.substr(1);
|
1401
1401
|
}).sort(function (g, m) {
|
1402
1402
|
return m.length - g.length;
|
1403
|
-
}).map(
|
1403
|
+
}).map(Si).join("|") + ")($|[" + cn.split("").map(Si).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") {
|
1404
1404
|
for (n = p[t].children, e = n.length - 1; e >= 0; e--) if (r = n[e], r.type === "text") {
|
1405
1405
|
for (l = 0, o = r.content, d.lastIndex = 0, c = r.level, a = []; u = d.exec(o);) d.lastIndex > l && a.push({
|
1406
1406
|
type: "text",
|
@@ -1427,8 +1427,8 @@ function Hs(s) {
|
|
1427
1427
|
}
|
1428
1428
|
}
|
1429
1429
|
}
|
1430
|
-
var
|
1431
|
-
|
1430
|
+
var Gs = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/,
|
1431
|
+
Vs = /\((c|tm|r|p)\)/ig,
|
1432
1432
|
Ws = {
|
1433
1433
|
c: "©",
|
1434
1434
|
r: "®",
|
@@ -1436,14 +1436,14 @@ var Vs = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/,
|
|
1436
1436
|
tm: "™"
|
1437
1437
|
};
|
1438
1438
|
function Ks(s) {
|
1439
|
-
return s.indexOf("(") < 0 ? s : s.replace(
|
1439
|
+
return s.indexOf("(") < 0 ? s : s.replace(Vs, function (e, t) {
|
1440
1440
|
return Ws[t.toLowerCase()];
|
1441
1441
|
});
|
1442
1442
|
}
|
1443
1443
|
function Js(s) {
|
1444
1444
|
var e, t, i, n, r;
|
1445
1445
|
if (s.options.typographer) {
|
1446
|
-
for (r = s.tokens.length - 1; r >= 0; r--) if (s.tokens[r].type === "inline") for (n = s.tokens[r].children, e = n.length - 1; e >= 0; e--) t = n[e], t.type === "text" && (i = t.content, i = Ks(i),
|
1446
|
+
for (r = s.tokens.length - 1; r >= 0; r--) if (s.tokens[r].type === "inline") for (n = s.tokens[r].children, e = n.length - 1; e >= 0; e--) t = n[e], t.type === "text" && (i = t.content, i = Ks(i), Gs.test(i) && (i = i.replace(/\+-/g, "±").replace(/\.{2,}/g, "…").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---([^-]|$)/mg, "$1—$2").replace(/(^|\s)--(\s|$)/mg, "$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/mg, "$1–$2")), t.content = i);
|
1447
1447
|
}
|
1448
1448
|
}
|
1449
1449
|
var $s = /['"]/,
|
@@ -1457,24 +1457,24 @@ function ze(s, e, t) {
|
|
1457
1457
|
return s.substr(0, e) + t + s.substr(e + 1);
|
1458
1458
|
}
|
1459
1459
|
function Zs(s) {
|
1460
|
-
var e, t, i, n, r, o, a, l, c, d, u, h, p, g, m,
|
1460
|
+
var e, t, i, n, r, o, a, l, c, d, u, h, p, g, m, S, w;
|
1461
1461
|
if (s.options.typographer) {
|
1462
|
-
for (
|
1463
|
-
for (
|
1464
|
-
for (a =
|
1465
|
-
|
1462
|
+
for (w = [], m = s.tokens.length - 1; m >= 0; m--) if (s.tokens[m].type === "inline") {
|
1463
|
+
for (S = s.tokens[m].children, w.length = 0, e = 0; e < S.length; e++) if (t = S[e], !(t.type !== "text" || $s.test(t.text))) {
|
1464
|
+
for (a = S[e].level, p = w.length - 1; p >= 0 && !(w[p].level <= a); p--);
|
1465
|
+
w.length = p + 1, i = t.content, r = 0, o = i.length;
|
1466
1466
|
e: for (; r < o && (dn.lastIndex = r, n = dn.exec(i), !!n);) {
|
1467
1467
|
if (l = !hn(i, n.index - 1), r = n.index + 1, g = n[0] === "'", c = !hn(i, r), !c && !l) {
|
1468
1468
|
g && (t.content = ze(t.content, n.index, un));
|
1469
1469
|
continue;
|
1470
1470
|
}
|
1471
1471
|
if (u = !c, h = !l, h) {
|
1472
|
-
for (p =
|
1473
|
-
d =
|
1472
|
+
for (p = w.length - 1; p >= 0 && (d = w[p], !(w[p].level < a)); p--) if (d.single === g && w[p].level === a) {
|
1473
|
+
d = w[p], g ? (S[d.token].content = ze(S[d.token].content, d.pos, s.options.quotes[2]), t.content = ze(t.content, n.index, s.options.quotes[3])) : (S[d.token].content = ze(S[d.token].content, d.pos, s.options.quotes[0]), t.content = ze(t.content, n.index, s.options.quotes[1])), w.length = p;
|
1474
1474
|
continue e;
|
1475
1475
|
}
|
1476
1476
|
}
|
1477
|
-
u ?
|
1477
|
+
u ? w.push({
|
1478
1478
|
token: e,
|
1479
1479
|
pos: n.index,
|
1480
1480
|
single: g,
|
@@ -1485,10 +1485,10 @@ function Zs(s) {
|
|
1485
1485
|
}
|
1486
1486
|
}
|
1487
1487
|
}
|
1488
|
-
var
|
1488
|
+
var wi = [["block", Ds], ["abbr", Fs], ["references", zs], ["inline", Us], ["footnote_tail", qs], ["abbr2", Hs], ["replacements", Js], ["smartquotes", Zs]];
|
1489
1489
|
function Qn() {
|
1490
1490
|
this.options = {}, this.ruler = new H();
|
1491
|
-
for (var s = 0; s <
|
1491
|
+
for (var s = 0; s < wi.length; s++) this.ruler.push(wi[s][0], wi[s][1]);
|
1492
1492
|
}
|
1493
1493
|
Qn.prototype.process = function (s) {
|
1494
1494
|
var e, t, i;
|
@@ -1595,12 +1595,12 @@ function er(s, e, t, i) {
|
|
1595
1595
|
p,
|
1596
1596
|
g,
|
1597
1597
|
m = s.bMarks[e] + s.tShift[e],
|
1598
|
-
|
1599
|
-
if (m >
|
1598
|
+
S = s.eMarks[e];
|
1599
|
+
if (m > S || s.src.charCodeAt(m++) !== 62 || s.level >= s.options.maxNesting) return !1;
|
1600
1600
|
if (i) return !0;
|
1601
|
-
for (s.src.charCodeAt(m) === 32 && m++, l = s.blkIndent, s.blkIndent = 0, a = [s.bMarks[e]], s.bMarks[e] = m, m = m <
|
1601
|
+
for (s.src.charCodeAt(m) === 32 && m++, l = s.blkIndent, s.blkIndent = 0, a = [s.bMarks[e]], s.bMarks[e] = m, m = m < S ? s.skipSpaces(m) : m, r = m >= S, o = [s.tShift[e]], s.tShift[e] = m - s.bMarks[e], u = s.parser.ruler.getRules("blockquote"), n = e + 1; n < t && (m = s.bMarks[n] + s.tShift[n], S = s.eMarks[n], !(m >= S)); n++) {
|
1602
1602
|
if (s.src.charCodeAt(m++) === 62) {
|
1603
|
-
s.src.charCodeAt(m) === 32 && m++, a.push(s.bMarks[n]), s.bMarks[n] = m, m = m <
|
1603
|
+
s.src.charCodeAt(m) === 32 && m++, a.push(s.bMarks[n]), s.bMarks[n] = m, m = m < S ? s.skipSpaces(m) : m, r = m >= S, o.push(s.tShift[n]), s.tShift[n] = m - s.bMarks[n];
|
1604
1604
|
continue;
|
1605
1605
|
}
|
1606
1606
|
if (r) break;
|
@@ -1675,51 +1675,51 @@ function nr(s, e, t, i) {
|
|
1675
1675
|
p,
|
1676
1676
|
g,
|
1677
1677
|
m,
|
1678
|
-
_,
|
1679
1678
|
S,
|
1680
|
-
|
1681
|
-
A,
|
1679
|
+
w,
|
1682
1680
|
G,
|
1681
|
+
A,
|
1682
|
+
V,
|
1683
1683
|
X,
|
1684
1684
|
oe = !0,
|
1685
1685
|
Q,
|
1686
1686
|
N,
|
1687
1687
|
Be,
|
1688
1688
|
xi;
|
1689
|
-
if ((u = fn(s, e)) >= 0)
|
1689
|
+
if ((u = fn(s, e)) >= 0) S = !0;else if ((u = pn(s, e)) >= 0) S = !1;else return !1;
|
1690
1690
|
if (s.level >= s.options.maxNesting) return !1;
|
1691
1691
|
if (m = s.src.charCodeAt(u - 1), i) return !0;
|
1692
|
-
for (
|
1692
|
+
for (G = s.tokens.length, S ? (d = s.bMarks[e] + s.tShift[e], g = Number(s.src.substr(d, u - d - 1)), s.tokens.push({
|
1693
1693
|
type: "ordered_list_open",
|
1694
1694
|
order: g,
|
1695
|
-
lines:
|
1695
|
+
lines: V = [e, 0],
|
1696
1696
|
level: s.level++
|
1697
1697
|
})) : s.tokens.push({
|
1698
1698
|
type: "bullet_list_open",
|
1699
|
-
lines:
|
1699
|
+
lines: V = [e, 0],
|
1700
1700
|
level: s.level++
|
1701
|
-
}), n = e, A = !1, Q = s.parser.ruler.getRules("list"); n < t && (
|
1701
|
+
}), n = e, A = !1, Q = s.parser.ruler.getRules("list"); n < t && (w = s.skipSpaces(u), h = s.eMarks[n], w >= h ? p = 1 : p = w - u, p > 4 && (p = 1), p < 1 && (p = 1), r = u - s.bMarks[n] + p, s.tokens.push({
|
1702
1702
|
type: "list_item_open",
|
1703
1703
|
lines: X = [e, 0],
|
1704
1704
|
level: s.level++
|
1705
|
-
}), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] =
|
1705
|
+
}), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] = w - s.bMarks[e], s.blkIndent = r, s.tight = !0, s.parentType = "list", s.parser.tokenize(s, e, t, !0), (!s.tight || A) && (oe = !1), A = 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({
|
1706
1706
|
type: "list_item_close",
|
1707
1707
|
level: --s.level
|
1708
|
-
}), n = e = s.line, X[1] = n,
|
1708
|
+
}), n = e = s.line, X[1] = n, w = s.bMarks[e], !(n >= t || s.isEmpty(n) || s.tShift[n] < s.blkIndent));) {
|
1709
1709
|
for (xi = !1, N = 0, Be = Q.length; N < Be; N++) if (Q[N](s, n, t, !0)) {
|
1710
1710
|
xi = !0;
|
1711
1711
|
break;
|
1712
1712
|
}
|
1713
1713
|
if (xi) break;
|
1714
|
-
if (
|
1714
|
+
if (S) {
|
1715
1715
|
if (u = fn(s, n), u < 0) break;
|
1716
1716
|
} else if (u = pn(s, n), u < 0) break;
|
1717
1717
|
if (m !== s.src.charCodeAt(u - 1)) break;
|
1718
1718
|
}
|
1719
1719
|
return s.tokens.push({
|
1720
|
-
type:
|
1720
|
+
type: S ? "ordered_list_close" : "bullet_list_close",
|
1721
1721
|
level: --s.level
|
1722
|
-
}),
|
1722
|
+
}), V[1] = n, s.line = n, oe && ir(s, G), !0;
|
1723
1723
|
}
|
1724
1724
|
function sr(s, e, t, i) {
|
1725
1725
|
var n,
|
@@ -1825,14 +1825,14 @@ function dr(s, e, t, i) {
|
|
1825
1825
|
content: s.getLines(e, o, 0, !0)
|
1826
1826
|
}), !0;
|
1827
1827
|
}
|
1828
|
-
function
|
1828
|
+
function _i(s, e) {
|
1829
1829
|
var t = s.bMarks[e] + s.blkIndent,
|
1830
1830
|
i = s.eMarks[e];
|
1831
1831
|
return s.src.substr(t, i - t);
|
1832
1832
|
}
|
1833
1833
|
function ur(s, e, t, i) {
|
1834
1834
|
var n, r, o, a, l, c, d, u, h, p, g;
|
1835
|
-
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 =
|
1835
|
+
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 = _i(s, e + 1), !/^[-:| ]+$/.test(r)) || (c = r.split("|"), c <= 2)) return !1;
|
1836
1836
|
for (u = [], a = 0; a < c.length; a++) {
|
1837
1837
|
if (h = c[a].trim(), !h) {
|
1838
1838
|
if (a === 0 || a === c.length - 1) continue;
|
@@ -1841,7 +1841,7 @@ function ur(s, e, t, i) {
|
|
1841
1841
|
if (!/^:?-+:?$/.test(h)) return !1;
|
1842
1842
|
h.charCodeAt(h.length - 1) === 58 ? u.push(h.charCodeAt(0) === 58 ? "center" : "right") : h.charCodeAt(0) === 58 ? u.push("left") : u.push("");
|
1843
1843
|
}
|
1844
|
-
if (r =
|
1844
|
+
if (r = _i(s, e).trim(), r.indexOf("|") === -1 || (c = r.replace(/^\||\|$/g, "").split("|"), u.length !== c.length)) return !1;
|
1845
1845
|
if (i) return !0;
|
1846
1846
|
for (s.tokens.push({
|
1847
1847
|
type: "table_open",
|
@@ -1880,7 +1880,7 @@ function ur(s, e, t, i) {
|
|
1880
1880
|
type: "tbody_open",
|
1881
1881
|
lines: g = [e + 2, 0],
|
1882
1882
|
level: s.level++
|
1883
|
-
}), l = e + 2; l < t && !(s.tShift[l] < s.blkIndent || (r =
|
1883
|
+
}), l = e + 2; l < t && !(s.tShift[l] < s.blkIndent || (r = _i(s, l).trim(), r.indexOf("|") === -1)); l++) {
|
1884
1884
|
for (c = r.replace(/^\||\|$/g, "").split("|"), s.tokens.push({
|
1885
1885
|
type: "tr_open",
|
1886
1886
|
level: s.level++
|
@@ -1924,7 +1924,7 @@ function hr(s, e) {
|
|
1924
1924
|
for (t = e + 2, i = s.tokens.length - 2; t < i; t++) s.tokens[t].level === n && s.tokens[t].type === "paragraph_open" && (s.tokens[t + 2].tight = !0, s.tokens[t].tight = !0, t += 2);
|
1925
1925
|
}
|
1926
1926
|
function pr(s, e, t, i) {
|
1927
|
-
var n, r, o, a, l, c, d, u, h, p, g, m,
|
1927
|
+
var n, r, o, a, l, c, d, u, h, p, g, m, S, w;
|
1928
1928
|
if (i) return s.ddIndent < 0 ? !1 : It(s, e) >= 0;
|
1929
1929
|
if (d = e + 1, s.isEmpty(d) && ++d > t || s.tShift[d] < s.blkIndent || (n = It(s, d), n < 0) || s.level >= s.options.maxNesting) return !1;
|
1930
1930
|
c = s.tokens.length, s.tokens.push({
|
@@ -1933,7 +1933,7 @@ function pr(s, e, t, i) {
|
|
1933
1933
|
level: s.level++
|
1934
1934
|
}), o = e, r = d;
|
1935
1935
|
e: for (;;) {
|
1936
|
-
for (
|
1936
|
+
for (w = !0, S = !1, s.tokens.push({
|
1937
1937
|
type: "dt_open",
|
1938
1938
|
lines: [o, o],
|
1939
1939
|
level: s.level++
|
@@ -1951,7 +1951,7 @@ function pr(s, e, t, i) {
|
|
1951
1951
|
type: "dd_open",
|
1952
1952
|
lines: a = [d, 0],
|
1953
1953
|
level: s.level++
|
1954
|
-
}), m = s.tight, h = s.ddIndent, u = s.blkIndent, g = s.tShift[r], p = s.parentType, s.blkIndent = s.ddIndent = s.tShift[r] + 2, s.tShift[r] = n - s.bMarks[r], s.tight = !0, s.parentType = "deflist", s.parser.tokenize(s, r, t, !0), (!s.tight ||
|
1954
|
+
}), m = s.tight, h = s.ddIndent, u = s.blkIndent, g = s.tShift[r], p = s.parentType, s.blkIndent = s.ddIndent = s.tShift[r] + 2, s.tShift[r] = n - s.bMarks[r], s.tight = !0, s.parentType = "deflist", s.parser.tokenize(s, r, t, !0), (!s.tight || S) && (w = !1), S = s.line - r > 1 && s.isEmpty(s.line - 1), s.tShift[r] = g, s.tight = m, s.parentType = p, s.blkIndent = u, s.ddIndent = h, s.tokens.push({
|
1955
1955
|
type: "dd_close",
|
1956
1956
|
level: --s.level
|
1957
1957
|
}), a[1] = d = s.line, d >= t || s.tShift[d] < s.blkIndent) break e;
|
@@ -1963,7 +1963,7 @@ function pr(s, e, t, i) {
|
|
1963
1963
|
return s.tokens.push({
|
1964
1964
|
type: "dl_close",
|
1965
1965
|
level: --s.level
|
1966
|
-
}), l[1] = d, s.line = d,
|
1966
|
+
}), l[1] = d, s.line = d, w && hr(s, c), !0;
|
1967
1967
|
}
|
1968
1968
|
function fr(s, e) {
|
1969
1969
|
var t,
|
@@ -2000,13 +2000,13 @@ function fr(s, e) {
|
|
2000
2000
|
})), !0;
|
2001
2001
|
}
|
2002
2002
|
var Lt = [["code", Xs], ["fences", Qs, ["paragraph", "blockquote", "list"]], ["blockquote", er, ["paragraph", "blockquote", "list"]], ["hr", tr, ["paragraph", "blockquote", "list"]], ["list", nr, ["paragraph", "blockquote"]], ["footnote", sr, ["paragraph"]], ["heading", rr, ["paragraph", "blockquote"]], ["lheading", or], ["htmlblock", dr, ["paragraph", "blockquote"]], ["table", ur, ["paragraph"]], ["deflist", pr, ["paragraph"]], ["paragraph", fr]];
|
2003
|
-
function
|
2003
|
+
function Vi() {
|
2004
2004
|
this.ruler = new H();
|
2005
2005
|
for (var s = 0; s < Lt.length; s++) this.ruler.push(Lt[s][0], Lt[s][1], {
|
2006
2006
|
alt: (Lt[s][2] || []).slice()
|
2007
2007
|
});
|
2008
2008
|
}
|
2009
|
-
|
2009
|
+
Vi.prototype.tokenize = function (s, e, t) {
|
2010
2010
|
for (var i = this.ruler.getRules(""), n = i.length, r = e, o = !1, a, l; r < t && (s.line = r = s.skipEmptyLines(r), !(r >= t || s.tShift[r] < s.blkIndent));) {
|
2011
2011
|
for (l = 0; l < n && (a = i[l](s, r, t, !1), !a); l++);
|
2012
2012
|
if (s.tight = !o, s.isEmpty(s.line - 1) && (o = !0), r = s.line, r < t && s.isEmpty(r)) {
|
@@ -2018,7 +2018,7 @@ Gi.prototype.tokenize = function (s, e, t) {
|
|
2018
2018
|
var mr = /[\n\t]/g,
|
2019
2019
|
gr = /\r[\n\u0085]|[\u2424\u2028\u0085]/g,
|
2020
2020
|
br = /\u00a0/g;
|
2021
|
-
|
2021
|
+
Vi.prototype.parse = function (s, e, t, i) {
|
2022
2022
|
var n,
|
2023
2023
|
r = 0,
|
2024
2024
|
o = 0;
|
@@ -2108,7 +2108,7 @@ function Er(s, e) {
|
|
2108
2108
|
}
|
2109
2109
|
return e || (s.pending += "\\"), s.pos++, !0;
|
2110
2110
|
}
|
2111
|
-
function
|
2111
|
+
function Sr(s, e) {
|
2112
2112
|
var t,
|
2113
2113
|
i,
|
2114
2114
|
n,
|
@@ -2129,7 +2129,7 @@ function _r(s, e) {
|
|
2129
2129
|
}
|
2130
2130
|
return e || (s.pending += n), s.pos += n.length, !0;
|
2131
2131
|
}
|
2132
|
-
function
|
2132
|
+
function wr(s, e) {
|
2133
2133
|
var t,
|
2134
2134
|
i,
|
2135
2135
|
n,
|
@@ -2155,7 +2155,7 @@ function Sr(s, e) {
|
|
2155
2155
|
level: --s.level
|
2156
2156
|
})), s.pos = s.posMax + 2, s.posMax = r, !0) : (s.pos = o, !1);
|
2157
2157
|
}
|
2158
|
-
function
|
2158
|
+
function _r(s, e) {
|
2159
2159
|
var t,
|
2160
2160
|
i,
|
2161
2161
|
n,
|
@@ -2440,16 +2440,16 @@ function ti(s, e) {
|
|
2440
2440
|
var Fr = /[a-zA-Z_:][a-zA-Z0-9:._-]*/,
|
2441
2441
|
Br = /[^"'=<>`\x00-\x20]+/,
|
2442
2442
|
zr = /'[^']*'/,
|
2443
|
-
|
2444
|
-
|
2445
|
-
Hr = ti(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name", Fr)("attr_value",
|
2446
|
-
|
2447
|
-
|
2443
|
+
Ur = /"[^"]*"/,
|
2444
|
+
qr = ti(/(?:unquoted|single_quoted|double_quoted)/)("unquoted", Br)("single_quoted", zr)("double_quoted", Ur)(),
|
2445
|
+
Hr = ti(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name", Fr)("attr_value", qr)(),
|
2446
|
+
Gr = ti(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute", Hr)(),
|
2447
|
+
Vr = /<\/[A-Za-z][A-Za-z0-9]*\s*>/,
|
2448
2448
|
Wr = /<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,
|
2449
2449
|
Kr = /<[?].*?[?]>/,
|
2450
2450
|
Jr = /<![A-Z]+\s+[^>]*>/,
|
2451
2451
|
$r = /<!\[CDATA\[[\s\S]*?\]\]>/,
|
2452
|
-
Yr = ti(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",
|
2452
|
+
Yr = ti(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag", Gr)("close_tag", Vr)("comment", Wr)("processing", Kr)("declaration", Jr)("cdata", $r)();
|
2453
2453
|
function Zr(s) {
|
2454
2454
|
var e = s | 32;
|
2455
2455
|
return e >= 97 && e <= 122;
|
@@ -2484,7 +2484,7 @@ function to(s, e) {
|
|
2484
2484
|
}
|
2485
2485
|
return e || (s.pending += "&"), s.pos++, !0;
|
2486
2486
|
}
|
2487
|
-
var Mi = [["text", yr], ["newline", xr], ["escape", Er], ["backticks",
|
2487
|
+
var Mi = [["text", yr], ["newline", xr], ["escape", Er], ["backticks", Sr], ["del", wr], ["ins", _r], ["mark", Mr], ["emphasis", Tr], ["sub", Ar], ["sup", Ir], ["links", Lr], ["footnote_inline", Rr], ["footnote_ref", Or], ["autolink", jr], ["htmltag", Xr], ["entity", to]];
|
2488
2488
|
function ii() {
|
2489
2489
|
this.ruler = new H();
|
2490
2490
|
for (var s = 0; s < Mi.length; s++) this.ruler.push(Mi[s][0], Mi[s][1]);
|
@@ -2644,7 +2644,7 @@ function ts(s, e, t) {
|
|
2644
2644
|
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;
|
2645
2645
|
}
|
2646
2646
|
function he(s, e) {
|
2647
|
-
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 ii(), this.block = new
|
2647
|
+
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 ii(), this.block = new Vi(), this.core = new Qn(), this.renderer = new Gi(), this.ruler = new H(), this.options = {}, this.configure(oo[s]), this.set(e || {});
|
2648
2648
|
}
|
2649
2649
|
he.prototype.set = function (s) {
|
2650
2650
|
Kn(this.options, s);
|
@@ -2921,11 +2921,11 @@ var ce = /*#__PURE__*/function () {
|
|
2921
2921
|
}]);
|
2922
2922
|
return ce;
|
2923
2923
|
}();
|
2924
|
-
var
|
2925
|
-
function
|
2926
|
-
_classCallCheck(this,
|
2924
|
+
var Ve = /*#__PURE__*/function () {
|
2925
|
+
function Ve() {
|
2926
|
+
_classCallCheck(this, Ve);
|
2927
2927
|
}
|
2928
|
-
_createClass(
|
2928
|
+
_createClass(Ve, null, [{
|
2929
2929
|
key: "getPosition",
|
2930
2930
|
value: function getPosition(e, t) {
|
2931
2931
|
var _i5, _i6, _i7;
|
@@ -2949,18 +2949,18 @@ var Ge = /*#__PURE__*/function () {
|
|
2949
2949
|
key: "createName",
|
2950
2950
|
value: function createName(e, t) {
|
2951
2951
|
var i = document.createElement("div");
|
2952
|
-
return i.classList.add("name"), i.textContent =
|
2952
|
+
return i.classList.add("name"), i.textContent = Ve.getNameText(e, t), Ve.applyStyle(i, e, t), i;
|
2953
2953
|
}
|
2954
2954
|
}, {
|
2955
2955
|
key: "add",
|
2956
2956
|
value: function add(e, t, i) {
|
2957
2957
|
var n = typeof i == "boolean" ? {} : i,
|
2958
|
-
r =
|
2959
|
-
o =
|
2958
|
+
r = Ve.createName(t, n),
|
2959
|
+
o = Ve.getPosition(t, n);
|
2960
2960
|
r.classList.add(o === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(o === "left" ? "beforebegin" : "afterend", r);
|
2961
2961
|
}
|
2962
2962
|
}]);
|
2963
|
-
return
|
2963
|
+
return Ve;
|
2964
2964
|
}();
|
2965
2965
|
var Ke = /*#__PURE__*/function () {
|
2966
2966
|
function Ke(e) {
|
@@ -3023,7 +3023,7 @@ var Ke = /*#__PURE__*/function () {
|
|
3023
3023
|
value:
|
3024
3024
|
// prettier-ignore
|
3025
3025
|
function addInnerContainerElements(e, t, i) {
|
3026
|
-
return e.classList.add("message-bubble", v.getRoleClass(i), i === v.USER_ROLE ? "user-message-text" : "ai-message-text"), this.renderText(e, t), this._avatars && ce.add(e, i, this._avatars), this._names &&
|
3026
|
+
return e.classList.add("message-bubble", v.getRoleClass(i), i === v.USER_ROLE ? "user-message-text" : "ai-message-text"), this.renderText(e, t), this._avatars && ce.add(e, i, this._avatars), this._names && Ve.add(e, i, this._names), {
|
3027
3027
|
bubbleElement: e
|
3028
3028
|
};
|
3029
3029
|
}
|
@@ -3419,16 +3419,16 @@ function go(s, e) {
|
|
3419
3419
|
g.abort(), document.hidden || X();
|
3420
3420
|
}
|
3421
3421
|
l || document.addEventListener("visibilitychange", m);
|
3422
|
-
var
|
3423
|
-
|
3424
|
-
function
|
3425
|
-
document.removeEventListener("visibilitychange", m), window.clearTimeout(
|
3422
|
+
var S = mo,
|
3423
|
+
w = 0;
|
3424
|
+
function G() {
|
3425
|
+
document.removeEventListener("visibilitychange", m), window.clearTimeout(w), g.abort();
|
3426
3426
|
}
|
3427
3427
|
t == null || t.addEventListener("abort", function () {
|
3428
|
-
|
3428
|
+
G(), u();
|
3429
3429
|
});
|
3430
3430
|
var A = c !== null && c !== void 0 ? c : window.fetch,
|
3431
|
-
|
3431
|
+
V = n !== null && n !== void 0 ? n : bo;
|
3432
3432
|
function X() {
|
3433
3433
|
return _X.apply(this, arguments);
|
3434
3434
|
}
|
@@ -3448,17 +3448,17 @@ function go(s, e) {
|
|
3448
3448
|
case 4:
|
3449
3449
|
Q = _context3.sent;
|
3450
3450
|
_context3.next = 7;
|
3451
|
-
return
|
3451
|
+
return V(Q);
|
3452
3452
|
case 7:
|
3453
3453
|
_context3.next = 9;
|
3454
3454
|
return co(Q.body, uo(ho(function (N) {
|
3455
3455
|
N ? p[yn] = N : delete p[yn];
|
3456
3456
|
}, function (N) {
|
3457
|
-
|
3457
|
+
S = N;
|
3458
3458
|
}, r)));
|
3459
3459
|
case 9:
|
3460
3460
|
o == null || o();
|
3461
|
-
|
3461
|
+
G();
|
3462
3462
|
u();
|
3463
3463
|
_context3.next = 17;
|
3464
3464
|
break;
|
@@ -3466,10 +3466,10 @@ function go(s, e) {
|
|
3466
3466
|
_context3.prev = 14;
|
3467
3467
|
_context3.t0 = _context3["catch"](1);
|
3468
3468
|
if (!g.signal.aborted) try {
|
3469
|
-
N = (oe = a == null ? void 0 : a(_context3.t0)) !== null && oe !== void 0 ? oe :
|
3470
|
-
window.clearTimeout(
|
3469
|
+
N = (oe = a == null ? void 0 : a(_context3.t0)) !== null && oe !== void 0 ? oe : S;
|
3470
|
+
window.clearTimeout(w), w = window.setTimeout(X, N);
|
3471
3471
|
} catch (N) {
|
3472
|
-
|
3472
|
+
G(), h(N);
|
3473
3473
|
}
|
3474
3474
|
case 17:
|
3475
3475
|
case "end":
|
@@ -3573,9 +3573,9 @@ var I = /*#__PURE__*/function () {
|
|
3573
3573
|
p,
|
3574
3574
|
g,
|
3575
3575
|
m,
|
3576
|
-
_,
|
3577
3576
|
S,
|
3578
|
-
|
3577
|
+
w,
|
3578
|
+
G,
|
3579
3579
|
r,
|
3580
3580
|
_yield$E$processReque,
|
3581
3581
|
o,
|
@@ -3625,10 +3625,10 @@ var I = /*#__PURE__*/function () {
|
|
3625
3625
|
return _context7.abrupt("return", ve.requestStream(i, e.streamHandlers));
|
3626
3626
|
case 18:
|
3627
3627
|
h = new Ze(i);
|
3628
|
-
go(((
|
3629
|
-
method: ((
|
3628
|
+
go(((S = e.requestSettings) == null ? void 0 : S.url) || e.url || "", {
|
3629
|
+
method: ((w = e.requestSettings) == null ? void 0 : w.method) || "POST",
|
3630
3630
|
headers: a,
|
3631
|
-
credentials: (
|
3631
|
+
credentials: (G = e.requestSettings) == null ? void 0 : G.credentials,
|
3632
3632
|
body: n ? JSON.stringify(o) : o,
|
3633
3633
|
openWhenHidden: !0,
|
3634
3634
|
// keep stream open when browser tab not open
|
@@ -3656,7 +3656,7 @@ var I = /*#__PURE__*/function () {
|
|
3656
3656
|
},
|
3657
3657
|
onmessage: function onmessage(A) {
|
3658
3658
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
3659
|
-
var
|
3659
|
+
var V, X, oe, Q, N;
|
3660
3660
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
3661
3661
|
while (1) switch (_context6.prev = _context6.next) {
|
3662
3662
|
case 0:
|
@@ -3666,7 +3666,7 @@ var I = /*#__PURE__*/function () {
|
|
3666
3666
|
}
|
3667
3667
|
Q = JSON.parse(A.data);
|
3668
3668
|
_context6.next = 4;
|
3669
|
-
return (X = (
|
3669
|
+
return (X = (V = e.deepChat).responseInterceptor) == null ? void 0 : X.call(V, Q);
|
3670
3670
|
case 4:
|
3671
3671
|
_context6.t0 = _context6.sent;
|
3672
3672
|
if (_context6.t0) {
|
@@ -3696,8 +3696,8 @@ var I = /*#__PURE__*/function () {
|
|
3696
3696
|
},
|
3697
3697
|
signal: u.signal
|
3698
3698
|
})["catch"](function (A) {
|
3699
|
-
var
|
3700
|
-
(
|
3699
|
+
var V;
|
3700
|
+
(V = e.extractResultData) == null || V.call(e, A).then(function () {
|
3701
3701
|
E.displayError(i, A);
|
3702
3702
|
})["catch"](function (X) {
|
3703
3703
|
E.displayError(i, X);
|
@@ -3923,11 +3923,11 @@ var Ae = /*#__PURE__*/function () {
|
|
3923
3923
|
}]);
|
3924
3924
|
return Ae;
|
3925
3925
|
}();
|
3926
|
-
var
|
3927
|
-
function
|
3928
|
-
_classCallCheck(this,
|
3926
|
+
var _ = /*#__PURE__*/function () {
|
3927
|
+
function _() {
|
3928
|
+
_classCallCheck(this, _);
|
3929
3929
|
}
|
3930
|
-
_createClass(
|
3930
|
+
_createClass(_, null, [{
|
3931
3931
|
key: "request",
|
3932
3932
|
value: // prettier-ignore
|
3933
3933
|
function () {
|
@@ -3987,7 +3987,7 @@ var w = /*#__PURE__*/function () {
|
|
3987
3987
|
return E.processResponseByType(m);
|
3988
3988
|
}).then( /*#__PURE__*/function () {
|
3989
3989
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(m) {
|
3990
|
-
var
|
3990
|
+
var G, A, S, w;
|
3991
3991
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
3992
3992
|
while (1) switch (_context11.prev = _context11.next) {
|
3993
3993
|
case 0:
|
@@ -3998,7 +3998,7 @@ var w = /*#__PURE__*/function () {
|
|
3998
3998
|
return _context11.abrupt("return");
|
3999
3999
|
case 2:
|
4000
4000
|
_context11.next = 4;
|
4001
|
-
return (A = (
|
4001
|
+
return (A = (G = e.deepChat).responseInterceptor) == null ? void 0 : A.call(G, m);
|
4002
4002
|
case 4:
|
4003
4003
|
_context11.t0 = _context11.sent;
|
4004
4004
|
if (_context11.t0) {
|
@@ -4007,24 +4007,24 @@ var w = /*#__PURE__*/function () {
|
|
4007
4007
|
}
|
4008
4008
|
_context11.t0 = m;
|
4009
4009
|
case 7:
|
4010
|
-
|
4010
|
+
S = _context11.t0;
|
4011
4011
|
_context11.next = 10;
|
4012
|
-
return e.extractResultData(
|
4012
|
+
return e.extractResultData(S, u, o);
|
4013
4013
|
case 10:
|
4014
|
-
|
4014
|
+
w = _context11.sent;
|
4015
4015
|
if (d) {
|
4016
4016
|
_context11.next = 13;
|
4017
4017
|
break;
|
4018
4018
|
}
|
4019
4019
|
throw m;
|
4020
4020
|
case 13:
|
4021
|
-
if (!(!
|
4021
|
+
if (!(!w || _typeof(w) != "object")) {
|
4022
4022
|
_context11.next = 15;
|
4023
4023
|
break;
|
4024
4024
|
}
|
4025
|
-
throw Error(C.INVALID_RESPONSE(m, "response", !!e.deepChat.responseInterceptor,
|
4025
|
+
throw Error(C.INVALID_RESPONSE(m, "response", !!e.deepChat.responseInterceptor, S));
|
4026
4026
|
case 15:
|
4027
|
-
|
4027
|
+
w.makingAnotherRequest || (I.isSimulation(e.deepChat.stream) ? I.simulate(i, e.streamHandlers, w) : (i.addNewMessage(w), c()));
|
4028
4028
|
case 16:
|
4029
4029
|
case "end":
|
4030
4030
|
return _context11.stop();
|
@@ -4083,7 +4083,7 @@ var w = /*#__PURE__*/function () {
|
|
4083
4083
|
case 11:
|
4084
4084
|
a = _context13.sent;
|
4085
4085
|
a.timeoutMS ? setTimeout(function () {
|
4086
|
-
|
4086
|
+
_.executePollRequest(e, t, i, n);
|
4087
4087
|
}, a.timeoutMS) : I.isSimulation(e.deepChat.stream) ? I.simulate(n, e.streamHandlers, a) : (n.addNewMessage(a), r());
|
4088
4088
|
case 13:
|
4089
4089
|
case "end":
|
@@ -4143,7 +4143,7 @@ var w = /*#__PURE__*/function () {
|
|
4143
4143
|
body: u,
|
4144
4144
|
headers: a
|
4145
4145
|
};
|
4146
|
-
e.requestSettings.credentials && (h.credentials = e.requestSettings.credentials),
|
4146
|
+
e.requestSettings.credentials && (h.credentials = e.requestSettings.credentials), _.executePollRequest(e, c, h, i);
|
4147
4147
|
case 12:
|
4148
4148
|
case "end":
|
4149
4149
|
return _context14.stop();
|
@@ -4172,7 +4172,7 @@ var w = /*#__PURE__*/function () {
|
|
4172
4172
|
});
|
4173
4173
|
}
|
4174
4174
|
}]);
|
4175
|
-
return
|
4175
|
+
return _;
|
4176
4176
|
}();
|
4177
4177
|
var Xe = /*#__PURE__*/function () {
|
4178
4178
|
function Xe() {
|
@@ -4526,7 +4526,7 @@ var Le = /*#__PURE__*/function () {
|
|
4526
4526
|
case 0:
|
4527
4527
|
i = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : !0;
|
4528
4528
|
n = this.deepChat.stream;
|
4529
|
-
return _context17.abrupt("return", n && !I.isSimulation(n) ? I.request(this, e, t) :
|
4529
|
+
return _context17.abrupt("return", n && !I.isSimulation(n) ? I.request(this, e, t) : _.request(this, e, t, i));
|
4530
4530
|
case 3:
|
4531
4531
|
case "end":
|
4532
4532
|
return _context17.stop();
|
@@ -4712,18 +4712,18 @@ var Le = /*#__PURE__*/function () {
|
|
4712
4712
|
}]);
|
4713
4713
|
return Le;
|
4714
4714
|
}();
|
4715
|
-
var
|
4716
|
-
_inherits(
|
4717
|
-
var _super = _createSuper(
|
4715
|
+
var U = /*#__PURE__*/function (_Le) {
|
4716
|
+
_inherits(U, _Le);
|
4717
|
+
var _super = _createSuper(U);
|
4718
4718
|
// prettier-ignore
|
4719
|
-
function
|
4719
|
+
function U(e, t, i, n, r) {
|
4720
4720
|
var _this6;
|
4721
|
-
_classCallCheck(this,
|
4721
|
+
_classCallCheck(this, U);
|
4722
4722
|
var o;
|
4723
4723
|
_this6 = _super.call(this, e, r), _this6.insertKeyPlaceholderText = "API Key", _this6.getKeyLink = "", Object.assign(_this6.rawBody, (o = e.request) == null ? void 0 : o.additionalBodyProps), _this6.keyVerificationDetails = t, _this6.buildHeadersFunc = i, n && _this6.setApiKeyProperties(n), _this6.requestSettings = _this6.buildRequestSettings(_this6.key || "", e.request);
|
4724
4724
|
return _this6;
|
4725
4725
|
}
|
4726
|
-
_createClass(
|
4726
|
+
_createClass(U, [{
|
4727
4727
|
key: "setApiKeyProperties",
|
4728
4728
|
value: function setApiKeyProperties(e) {
|
4729
4729
|
this.key = e.key, e.validateKeyProperty && (this.validateConfigKey = e.validateKeyProperty);
|
@@ -4751,7 +4751,7 @@ var q = /*#__PURE__*/function (_Le) {
|
|
4751
4751
|
o = _this$keyVerification.createHeaders,
|
4752
4752
|
a = _this$keyVerification.body,
|
4753
4753
|
l = (o == null ? void 0 : o(e)) || this.buildHeadersFunc(e);
|
4754
|
-
|
4754
|
+
_.verifyKey(e, i, l, n, this.keyAuthenticated.bind(this, t.onSuccess), t.onFail, t.onLoad, r, a);
|
4755
4755
|
}
|
4756
4756
|
}, {
|
4757
4757
|
key: "isDirectConnection",
|
@@ -4759,7 +4759,7 @@ var q = /*#__PURE__*/function (_Le) {
|
|
4759
4759
|
return !0;
|
4760
4760
|
}
|
4761
4761
|
}]);
|
4762
|
-
return
|
4762
|
+
return U;
|
4763
4763
|
}(Le);
|
4764
4764
|
var Ft = /*#__PURE__*/function () {
|
4765
4765
|
function Ft() {
|
@@ -4832,33 +4832,33 @@ Ji._attributeToProperty_ = {};
|
|
4832
4832
|
var vo = Ji;
|
4833
4833
|
var yo = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path d=\"\n\t\t\tM669.727,273.516c-22.891-2.476-46.15-3.895-69.727-4.248c-103.025,0.457-209.823,25.517-310.913,73.536\n\t\t\tc-75.058,37.122-148.173,89.529-211.67,154.174C46.232,529.978,6.431,577.76,0,628.74c0.76,44.162,48.153,98.67,77.417,131.764\n\t\t\tc59.543,62.106,130.754,113.013,211.67,154.174c2.75,1.335,5.51,2.654,8.276,3.955l-75.072,131.102l102.005,60.286l551.416-960.033\n\t\t\tl-98.186-60.008L669.727,273.516z M902.563,338.995l-74.927,129.857c34.47,44.782,54.932,100.006,54.932,159.888\n\t\t\tc0,149.257-126.522,270.264-282.642,270.264c-6.749,0-13.29-0.728-19.922-1.172l-49.585,85.84c22.868,2.449,45.99,4.233,69.58,4.541\n\t\t\tc103.123-0.463,209.861-25.812,310.84-73.535c75.058-37.122,148.246-89.529,211.743-154.174\n\t\t\tc31.186-32.999,70.985-80.782,77.417-131.764c-0.76-44.161-48.153-98.669-77.417-131.763\n\t\t\tc-59.543-62.106-130.827-113.013-211.743-154.175C908.108,341.478,905.312,340.287,902.563,338.995L902.563,338.995z\n\t\t\tM599.927,358.478c6.846,0,13.638,0.274,20.361,0.732l-58.081,100.561c-81.514,16.526-142.676,85.88-142.676,168.897\n\t\t\tc0,20.854,3.841,40.819,10.913,59.325c0.008,0.021-0.008,0.053,0,0.074l-58.228,100.854\n\t\t\tc-34.551-44.823-54.932-100.229-54.932-160.182C317.285,479.484,443.808,358.477,599.927,358.478L599.927,358.478z M768.896,570.513\n\t\t\tL638.013,797.271c81.076-16.837,141.797-85.875,141.797-168.603C779.81,608.194,775.724,588.729,768.896,570.513L768.896,570.513z\"\n\t\t\t/>\n</svg>\n",
|
4834
4834
|
xo = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path id=\"path6686\" inkscape:connector-curvature=\"0\" d=\"M779.843,599.925c0,95.331-80.664,172.612-180.169,172.612\n\t\t\tc-99.504,0-180.168-77.281-180.168-172.612c0-95.332,80.664-172.612,180.168-172.612\n\t\t\tC699.179,427.312,779.843,504.594,779.843,599.925z M600,240.521c-103.025,0.457-209.814,25.538-310.904,73.557\n\t\t\tc-75.058,37.122-148.206,89.496-211.702,154.141C46.208,501.218,6.431,549,0,599.981c0.76,44.161,48.13,98.669,77.394,131.763\n\t\t\tc59.543,62.106,130.786,113.018,211.702,154.179c94.271,45.751,198.616,72.092,310.904,73.557\n\t\t\tc103.123-0.464,209.888-25.834,310.866-73.557c75.058-37.122,148.243-89.534,211.74-154.179\n\t\t\tc31.185-32.999,70.962-80.782,77.394-131.763c-0.76-44.161-48.13-98.671-77.394-131.764\n\t\t\tc-59.543-62.106-130.824-112.979-211.74-154.141C816.644,268.36,712.042,242.2,600,240.521z M599.924,329.769\n\t\t\tc156.119,0,282.675,120.994,282.675,270.251c0,149.256-126.556,270.25-282.675,270.25S317.249,749.275,317.249,600.02\n\t\t\tC317.249,450.763,443.805,329.769,599.924,329.769L599.924,329.769z\"/>\n</svg>\n";
|
4835
|
-
var
|
4836
|
-
function
|
4837
|
-
_classCallCheck(this,
|
4835
|
+
var q = /*#__PURE__*/function () {
|
4836
|
+
function q() {
|
4837
|
+
_classCallCheck(this, q);
|
4838
4838
|
}
|
4839
|
-
_createClass(
|
4839
|
+
_createClass(q, null, [{
|
4840
4840
|
key: "createSVGElement",
|
4841
4841
|
value: function createSVGElement(e) {
|
4842
4842
|
return new DOMParser().parseFromString(e, "image/svg+xml").documentElement;
|
4843
4843
|
}
|
4844
4844
|
}]);
|
4845
|
-
return
|
4845
|
+
return q;
|
4846
4846
|
}();
|
4847
4847
|
var rs = /*#__PURE__*/function () {
|
4848
|
-
function
|
4849
|
-
_classCallCheck(this,
|
4848
|
+
function Ge() {
|
4849
|
+
_classCallCheck(this, Ge);
|
4850
4850
|
}
|
4851
|
-
_createClass(
|
4851
|
+
_createClass(Ge, null, [{
|
4852
4852
|
key: "changeVisibility",
|
4853
4853
|
value:
|
4854
4854
|
// prettier-ignore
|
4855
4855
|
function changeVisibility(e, t, i, n) {
|
4856
|
-
n.target.id ===
|
4856
|
+
n.target.id === Ge.VISIBLE_ICON_ID ? (t.style.display = "none", i.style.display = "block", e.type = "password") : (t.style.display = "block", i.style.display = "none", e.type = "text");
|
4857
4857
|
}
|
4858
4858
|
}, {
|
4859
4859
|
key: "createIconElement",
|
4860
4860
|
value: function createIconElement(e, t) {
|
4861
|
-
var i =
|
4861
|
+
var i = q.createSVGElement(e);
|
4862
4862
|
return i.id = t, i.classList.add("visibility-icon"), i;
|
4863
4863
|
}
|
4864
4864
|
// prettier-ignore
|
@@ -4867,13 +4867,13 @@ var rs = /*#__PURE__*/function () {
|
|
4867
4867
|
value: function create(e) {
|
4868
4868
|
var t = document.createElement("div");
|
4869
4869
|
t.id = "visibility-icon-container";
|
4870
|
-
var i =
|
4870
|
+
var i = Ge.createIconElement(xo, Ge.VISIBLE_ICON_ID);
|
4871
4871
|
i.style.display = "none", t.appendChild(i);
|
4872
|
-
var n =
|
4873
|
-
return t.appendChild(n), t.onclick =
|
4872
|
+
var n = Ge.createIconElement(yo, "not-visible-icon");
|
4873
|
+
return t.appendChild(n), t.onclick = Ge.changeVisibility.bind(this, e, i, n), t;
|
4874
4874
|
}
|
4875
4875
|
}]);
|
4876
|
-
return
|
4876
|
+
return Ge;
|
4877
4877
|
}();
|
4878
4878
|
rs.VISIBLE_ICON_ID = "visible-icon";
|
4879
4879
|
var Eo = rs;
|
@@ -5077,113 +5077,69 @@ yt.EXPORT_BUTTON_CLASS = "deep-chat-export-button";
|
|
5077
5077
|
var xn = yt;
|
5078
5078
|
var En = {
|
5079
5079
|
model_list: [{
|
5080
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5080
|
+
model_url: "https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f32_1-MLC/resolve/main/",
|
5081
5081
|
local_id: "Llama-2-7b-chat-hf-q4f32_1",
|
5082
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf-q4f32_1-webgpu.wasm"
|
5083
|
-
}, {
|
5084
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-Llama-2-13b-chat-hf-q4f32_1/resolve/main/",
|
5085
|
-
local_id: "Llama-2-13b-chat-hf-q4f32_1",
|
5086
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-13b-chat-hf-q4f32_1-webgpu.wasm"
|
5082
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf/Llama-2-7b-chat-hf-q4f32_1-ctx4k_cs1k-webgpu.wasm"
|
5087
5083
|
}, {
|
5088
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5084
|
+
model_url: "https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f16_1-MLC/resolve/main/",
|
5089
5085
|
local_id: "Llama-2-7b-chat-hf-q4f16_1",
|
5090
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf-q4f16_1-webgpu.wasm",
|
5086
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf/Llama-2-7b-chat-hf-q4f16_1-ctx4k_cs1k-webgpu.wasm",
|
5091
5087
|
required_features: ["shader-f16"]
|
5092
5088
|
}, {
|
5093
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5089
|
+
model_url: "https://huggingface.co/mlc-ai/Llama-2-13b-chat-hf-q4f16_1-MLC/resolve/main/",
|
5094
5090
|
local_id: "Llama-2-13b-chat-hf-q4f16_1",
|
5095
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-13b-chat-hf-q4f16_1-webgpu.wasm",
|
5091
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-13b-chat-hf/Llama-2-13b-chat-hf-q4f16_1-ctx4k_cs1k-webgpu.wasm",
|
5096
5092
|
required_features: ["shader-f16"]
|
5097
5093
|
}, {
|
5098
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5094
|
+
model_url: "https://huggingface.co/mlc-ai/Llama-2-70b-chat-hf-q4f16_1-MLC/resolve/main/",
|
5099
5095
|
local_id: "Llama-2-70b-chat-hf-q4f16_1",
|
5100
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-70b-chat-hf-q4f16_1-webgpu.wasm",
|
5096
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-70b-chat-hf/Llama-2-70b-chat-hf-q4f16_1-ctx4k_cs1k-webgpu.wasm",
|
5101
5097
|
required_features: ["shader-f16"]
|
5102
5098
|
}, {
|
5103
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5099
|
+
model_url: "https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f16_1-MLC/resolve/main/",
|
5104
5100
|
local_id: "RedPajama-INCITE-Chat-3B-v1-q4f16_1",
|
5105
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1-q4f16_1-webgpu.wasm",
|
5101
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f16_1-ctx2k-webgpu.wasm",
|
5106
5102
|
required_features: ["shader-f16"]
|
5107
5103
|
}, {
|
5108
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5104
|
+
model_url: "https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f32_1-MLC/resolve/main/",
|
5109
5105
|
local_id: "RedPajama-INCITE-Chat-3B-v1-q4f32_1",
|
5110
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1-q4f32_1-webgpu.wasm"
|
5106
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f32_1-ctx2k-webgpu.wasm"
|
5111
5107
|
}, {
|
5112
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5113
|
-
local_id: "WizardCoder-15B-V1.0-q4f16_1",
|
5114
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/WizardCoder-15B-V1.0-q4f16_1-webgpu.wasm",
|
5115
|
-
required_features: ["shader-f16"]
|
5116
|
-
}, {
|
5117
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-WizardCoder-15B-V1.0-q4f32_1/resolve/main/",
|
5118
|
-
local_id: "WizardCoder-15B-V1.0-q4f32_1",
|
5119
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/WizardCoder-15B-V1.0-q4f32_1-webgpu.wasm"
|
5120
|
-
}, {
|
5121
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-WizardMath-7B-V1.0-q4f16_1/resolve/main/",
|
5122
|
-
local_id: "WizardMath-7B-V1.0-q4f16_1",
|
5123
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf-q4f16_1-webgpu.wasm",
|
5124
|
-
required_features: ["shader-f16"]
|
5125
|
-
}, {
|
5126
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-WizardMath-7B-V1.0-q4f32_1/resolve/main/",
|
5127
|
-
local_id: "WizardMath-7B-V1.0-q4f32_1",
|
5128
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf-q4f32_1-webgpu.wasm"
|
5129
|
-
}, {
|
5130
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-WizardMath-7B-V1.1-q4f16_1/resolve/main/",
|
5108
|
+
model_url: "https://huggingface.co/mlc-ai/WizardMath-7B-V1.1-q4f16_1-MLC/resolve/main/",
|
5131
5109
|
local_id: "WizardMath-7B-V1.1-q4f16_1",
|
5132
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.
|
5110
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.2/Mistral-7B-Instruct-v0.2-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5133
5111
|
required_features: ["shader-f16"]
|
5134
5112
|
}, {
|
5135
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5136
|
-
local_id: "
|
5137
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/
|
5113
|
+
model_url: "https://huggingface.co/mlc-ai/Mistral-7B-Instruct-v0.2-q4f16_1-MLC/resolve/main/",
|
5114
|
+
local_id: "Mistral-7B-Instruct-v0.2-q4f16_1",
|
5115
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.2/Mistral-7B-Instruct-v0.2-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5138
5116
|
required_features: ["shader-f16"]
|
5139
5117
|
}, {
|
5140
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5141
|
-
local_id: "WizardMath-70B-V1.0-q4f16_1",
|
5142
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-70b-chat-hf-q4f16_1-webgpu.wasm",
|
5143
|
-
required_features: ["shader-f16"]
|
5144
|
-
}, {
|
5145
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-Mistral-7B-Instruct-v0.1-q4f16_1/resolve/main/",
|
5146
|
-
local_id: "Mistral-7B-Instruct-v0.1-q4f16_1",
|
5147
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.1-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5148
|
-
required_features: ["shader-f16"]
|
5149
|
-
}, {
|
5150
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-Mistral-7B-Instruct-v0.1-q4f32_1/resolve/main/",
|
5151
|
-
local_id: "Mistral-7B-Instruct-v0.1-q4f32_1",
|
5152
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.1-q4f32_1-sw4k_cs1k-webgpu.wasm"
|
5153
|
-
}, {
|
5154
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-OpenHermes-2.5-Mistral-7B-q4f16_1/resolve/main/",
|
5118
|
+
model_url: "https://huggingface.co/mlc-ai/OpenHermes-2.5-Mistral-7B-q4f16_1-MLC/resolve/main/",
|
5155
5119
|
local_id: "OpenHermes-2.5-Mistral-7B-q4f16_1",
|
5156
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.
|
5120
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.2/Mistral-7B-Instruct-v0.2-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5157
5121
|
required_features: ["shader-f16"]
|
5158
5122
|
}, {
|
5159
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5160
|
-
local_id: "OpenHermes-2.5-Mistral-7B-q4f32_1",
|
5161
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.1-q4f32_1-sw4k_cs1k-webgpu.wasm"
|
5162
|
-
}, {
|
5163
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-NeuralHermes-2.5-Mistral-7B-q4f16_1/resolve/main/",
|
5123
|
+
model_url: "https://huggingface.co/mlc-ai/NeuralHermes-2.5-Mistral-7B-q4f16_1-MLC/resolve/main/",
|
5164
5124
|
local_id: "NeuralHermes-2.5-Mistral-7B-q4f16_1",
|
5165
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.
|
5125
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.2/Mistral-7B-Instruct-v0.2-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5166
5126
|
required_features: ["shader-f16"]
|
5167
|
-
}, {
|
5168
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-NeuralHermes-2.5-Mistral-7B-q4f32_1/resolve/main/",
|
5169
|
-
local_id: "NeuralHermes-2.5-Mistral-7B-q4f32_1",
|
5170
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.1-q4f32_1-sw4k_cs1k-webgpu.wasm"
|
5171
5127
|
},
|
5172
5128
|
// Models below fit for 128MB buffer limit (e.g. webgpu on Android)
|
5173
5129
|
{
|
5174
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5130
|
+
model_url: "https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f16_1-MLC/resolve/main/",
|
5175
5131
|
local_id: "Llama-2-7b-chat-hf-q4f16_1-1k",
|
5176
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf-q4f16_1-
|
5132
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf/Llama-2-7b-chat-hf-q4f16_1-ctx1k-webgpu.wasm",
|
5177
5133
|
required_features: ["shader-f16"]
|
5178
5134
|
}, {
|
5179
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5135
|
+
model_url: "https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f16_1-MLC/resolve/main/",
|
5180
5136
|
local_id: "RedPajama-INCITE-Chat-3B-v1-q4f16_1-1k",
|
5181
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1-q4f16_1-
|
5137
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f16_1-ctx1k-webgpu.wasm",
|
5182
5138
|
required_features: ["shader-f16"]
|
5183
5139
|
}, {
|
5184
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5140
|
+
model_url: "https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f32_1-MLC/resolve/main/",
|
5185
5141
|
local_id: "RedPajama-INCITE-Chat-3B-v1-q4f32_1-1k",
|
5186
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1-q4f32_1-
|
5142
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f32_1-ctx1k-webgpu.wasm"
|
5187
5143
|
}],
|
5188
5144
|
use_web_worker: !0
|
5189
5145
|
},
|
@@ -5366,23 +5322,22 @@ var En = {
|
|
5366
5322
|
};
|
5367
5323
|
M.chat.setInitProgressCallback(n);
|
5368
5324
|
_context25.prev = 4;
|
5369
|
-
_this$getConfig = this.getConfig(), u = _this$getConfig.model, h = _this$getConfig.appConfig, p = {
|
5370
|
-
|
5371
|
-
|
5372
|
-
|
5373
|
-
};
|
5325
|
+
_this$getConfig = this.getConfig(), u = _this$getConfig.model, h = _this$getConfig.appConfig, p = {};
|
5326
|
+
this._webModel.instruction && (p.conv_config = {
|
5327
|
+
system: this._webModel.instruction
|
5328
|
+
});
|
5374
5329
|
this._conversationHistory.length > 0 && (p.conversation_history = this._conversationHistory);
|
5375
|
-
_context25.next =
|
5330
|
+
_context25.next = 10;
|
5376
5331
|
return M.chat.reload(u, p, h, t);
|
5377
|
-
case
|
5332
|
+
case 10:
|
5378
5333
|
r = _context25.sent;
|
5379
|
-
_context25.next =
|
5334
|
+
_context25.next = 16;
|
5380
5335
|
break;
|
5381
|
-
case
|
5382
|
-
_context25.prev =
|
5336
|
+
case 13:
|
5337
|
+
_context25.prev = 13;
|
5383
5338
|
_context25.t0 = _context25["catch"](4);
|
5384
5339
|
return _context25.abrupt("return", this.unloadChat(_context25.t0));
|
5385
|
-
case
|
5340
|
+
case 16:
|
5386
5341
|
if ((a = this._webModel.introMessage) != null && a.removeAfterLoad) this._webModel.introMessage.displayed === !1 ? (c = this._messages) == null || c.removeLastMessage() : (d = this._removeIntro) == null || d.call(this);else {
|
5387
5342
|
_u = xn.setUpAfterLoad(r, this._webModel.introMessage, this._chatEl, !!this._webModel.worker);
|
5388
5343
|
(l = this._messages) == null || l.addNewMessage({
|
@@ -5392,11 +5347,11 @@ var En = {
|
|
5392
5347
|
});
|
5393
5348
|
}
|
5394
5349
|
this._isModelLoaded = !0, this._isModelLoading = !1;
|
5395
|
-
case
|
5350
|
+
case 18:
|
5396
5351
|
case "end":
|
5397
5352
|
return _context25.stop();
|
5398
5353
|
}
|
5399
|
-
}, _callee25, this, [[4,
|
5354
|
+
}, _callee25, this, [[4, 13]]);
|
5400
5355
|
}));
|
5401
5356
|
function loadModel(_x47, _x48) {
|
5402
5357
|
return _loadModel.apply(this, arguments);
|
@@ -5587,7 +5542,7 @@ var En = {
|
|
5587
5542
|
console.error(l);
|
5588
5543
|
c = a ? this.streamHandlers.onClose : this.completionsHandlers.onFinish;
|
5589
5544
|
E.onInterceptorError(e, l, c);
|
5590
|
-
} else this.generateRespByType(e, r, !!this.deepChat.stream, i);
|
5545
|
+
} else this.generateRespByType(e, r.text, !!this.deepChat.stream, i);
|
5591
5546
|
} catch (l) {
|
5592
5547
|
this.unloadChat(l);
|
5593
5548
|
}
|
@@ -5761,8 +5716,8 @@ var Bt = /*#__PURE__*/function () {
|
|
5761
5716
|
}]);
|
5762
5717
|
return Bt;
|
5763
5718
|
}();
|
5764
|
-
var os = /*#__PURE__*/function (
|
5765
|
-
_inherits(ji,
|
5719
|
+
var os = /*#__PURE__*/function (_U) {
|
5720
|
+
_inherits(ji, _U);
|
5766
5721
|
var _super4 = _createSuper(ji);
|
5767
5722
|
// prettier-ignore
|
5768
5723
|
function ji(e, t, i, n, r, o) {
|
@@ -5797,7 +5752,7 @@ var os = /*#__PURE__*/function (_q) {
|
|
5797
5752
|
throw new Error("Request settings have not been set up");
|
5798
5753
|
case 2:
|
5799
5754
|
n = this.preprocessBody(this.rawBody, t, i);
|
5800
|
-
|
5755
|
+
_.request(this, n, e);
|
5801
5756
|
case 4:
|
5802
5757
|
case "end":
|
5803
5758
|
return _context34.stop();
|
@@ -5811,7 +5766,7 @@ var os = /*#__PURE__*/function (_q) {
|
|
5811
5766
|
}()
|
5812
5767
|
}]);
|
5813
5768
|
return ji;
|
5814
|
-
}(
|
5769
|
+
}(U);
|
5815
5770
|
os.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
5816
5771
|
var Pe = os;
|
5817
5772
|
var xt = /*#__PURE__*/function (_Pe) {
|
@@ -5849,7 +5804,7 @@ var xt = /*#__PURE__*/function (_Pe) {
|
|
5849
5804
|
}
|
5850
5805
|
throw new Error("No file was added");
|
5851
5806
|
case 4:
|
5852
|
-
|
5807
|
+
_.poll(this, i[0], e, !1);
|
5853
5808
|
case 5:
|
5854
5809
|
case "end":
|
5855
5810
|
return _context35.stop();
|
@@ -5869,12 +5824,12 @@ var xt = /*#__PURE__*/function (_Pe) {
|
|
5869
5824
|
}]);
|
5870
5825
|
return xt;
|
5871
5826
|
}(Pe);
|
5872
|
-
var
|
5873
|
-
_inherits(
|
5874
|
-
var _super6 = _createSuper(
|
5827
|
+
var So = /*#__PURE__*/function (_xt) {
|
5828
|
+
_inherits(So, _xt);
|
5829
|
+
var _super6 = _createSuper(So);
|
5875
5830
|
// prettier-ignore
|
5876
|
-
function
|
5877
|
-
_classCallCheck(this,
|
5831
|
+
function So(e) {
|
5832
|
+
_classCallCheck(this, So);
|
5878
5833
|
var n, r, o;
|
5879
5834
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.audioClassification,
|
5880
5835
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
@@ -5882,7 +5837,7 @@ var _o = /*#__PURE__*/function (_xt) {
|
|
5882
5837
|
audio: {}
|
5883
5838
|
});
|
5884
5839
|
}
|
5885
|
-
_createClass(
|
5840
|
+
_createClass(So, [{
|
5886
5841
|
key: "extractPollResultData",
|
5887
5842
|
value: function () {
|
5888
5843
|
var _extractPollResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(e) {
|
@@ -5919,13 +5874,13 @@ var _o = /*#__PURE__*/function (_xt) {
|
|
5919
5874
|
return extractPollResultData;
|
5920
5875
|
}()
|
5921
5876
|
}]);
|
5922
|
-
return
|
5877
|
+
return So;
|
5923
5878
|
}(xt);
|
5924
|
-
var
|
5925
|
-
_inherits(
|
5926
|
-
var _super7 = _createSuper(
|
5927
|
-
function
|
5928
|
-
_classCallCheck(this,
|
5879
|
+
var wo = /*#__PURE__*/function (_xt2) {
|
5880
|
+
_inherits(wo, _xt2);
|
5881
|
+
var _super7 = _createSuper(wo);
|
5882
|
+
function wo(e) {
|
5883
|
+
_classCallCheck(this, wo);
|
5929
5884
|
var n, r, o;
|
5930
5885
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.imageClassification,
|
5931
5886
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
@@ -5933,7 +5888,7 @@ var So = /*#__PURE__*/function (_xt2) {
|
|
5933
5888
|
images: {}
|
5934
5889
|
});
|
5935
5890
|
}
|
5936
|
-
_createClass(
|
5891
|
+
_createClass(wo, [{
|
5937
5892
|
key: "extractPollResultData",
|
5938
5893
|
value: function () {
|
5939
5894
|
var _extractPollResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(e) {
|
@@ -5970,7 +5925,7 @@ var So = /*#__PURE__*/function (_xt2) {
|
|
5970
5925
|
return extractPollResultData;
|
5971
5926
|
}()
|
5972
5927
|
}]);
|
5973
|
-
return
|
5928
|
+
return wo;
|
5974
5929
|
}(xt);
|
5975
5930
|
var Et = "data:image/png;base64,";
|
5976
5931
|
var re = /*#__PURE__*/function () {
|
@@ -6003,8 +5958,8 @@ var re = /*#__PURE__*/function () {
|
|
6003
5958
|
}]);
|
6004
5959
|
return re;
|
6005
5960
|
}();
|
6006
|
-
var ni = /*#__PURE__*/function (
|
6007
|
-
_inherits(ni,
|
5961
|
+
var ni = /*#__PURE__*/function (_U2) {
|
5962
|
+
_inherits(ni, _U2);
|
6008
5963
|
var _super8 = _createSuper(ni);
|
6009
5964
|
// prettier-ignore
|
6010
5965
|
function ni(e, t, i, n, r) {
|
@@ -6014,7 +5969,7 @@ var ni = /*#__PURE__*/function (_q2) {
|
|
6014
5969
|
return _this16;
|
6015
5970
|
}
|
6016
5971
|
return _createClass(ni);
|
6017
|
-
}(
|
5972
|
+
}(U);
|
6018
5973
|
var zt = /*#__PURE__*/function (_ni) {
|
6019
5974
|
_inherits(zt, _ni);
|
6020
5975
|
var _super9 = _createSuper(zt);
|
@@ -6067,7 +6022,7 @@ var zt = /*#__PURE__*/function (_ni) {
|
|
6067
6022
|
throw new Error("Image was not found");
|
6068
6023
|
case 4:
|
6069
6024
|
n = this.createFormDataBody(this.rawBody, i[0]);
|
6070
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
6025
|
+
E.tempRemoveContentHeader(this.requestSettings, _.request.bind(this, this, n, e), !1);
|
6071
6026
|
case 6:
|
6072
6027
|
case "end":
|
6073
6028
|
return _context38.stop();
|
@@ -6124,12 +6079,12 @@ var zt = /*#__PURE__*/function (_ni) {
|
|
6124
6079
|
}]);
|
6125
6080
|
return zt;
|
6126
6081
|
}(ni);
|
6127
|
-
var
|
6128
|
-
_inherits(
|
6129
|
-
var _super10 = _createSuper(
|
6130
|
-
function
|
6082
|
+
var Ut = /*#__PURE__*/function (_ni2) {
|
6083
|
+
_inherits(Ut, _ni2);
|
6084
|
+
var _super10 = _createSuper(Ut);
|
6085
|
+
function Ut(e) {
|
6131
6086
|
var _this18;
|
6132
|
-
_classCallCheck(this,
|
6087
|
+
_classCallCheck(this, Ut);
|
6133
6088
|
var o;
|
6134
6089
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6135
6090
|
i = t == null ? void 0 : t.stabilityAI,
|
@@ -6143,10 +6098,10 @@ var qt = /*#__PURE__*/function (_ni2) {
|
|
6143
6098
|
};
|
6144
6099
|
_this18 = _super10.call(this, e, re.buildKeyVerificationDetails(), re.buildHeaders, i, n), _this18.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this18._maskSource = "MASK_IMAGE_WHITE", _this18.textInputPlaceholderText = "Describe image changes", _this18.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>";
|
6145
6100
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
|
6146
|
-
_typeof(r) == "object" && (r.engine_id && (_this18.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this18._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this18._maskSource = r.mask_source),
|
6101
|
+
_typeof(r) == "object" && (r.engine_id && (_this18.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this18._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this18._maskSource = r.mask_source), Ut.cleanConfig(r), Object.assign(_this18.rawBody, r)), _this18.canSendMessage = Ut.canSendFileTextMessage;
|
6147
6102
|
return _this18;
|
6148
6103
|
}
|
6149
|
-
_createClass(
|
6104
|
+
_createClass(Ut, [{
|
6150
6105
|
key: "createFormDataBody",
|
6151
6106
|
value: function createFormDataBody(e, t, i, n) {
|
6152
6107
|
var r = new FormData();
|
@@ -6176,7 +6131,7 @@ var qt = /*#__PURE__*/function (_ni2) {
|
|
6176
6131
|
throw new Error("Image was not found");
|
6177
6132
|
case 4:
|
6178
6133
|
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);
|
6179
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
6134
|
+
E.tempRemoveContentHeader(this.requestSettings, _.request.bind(this, this, r, e), !1);
|
6180
6135
|
case 6:
|
6181
6136
|
case "end":
|
6182
6137
|
return _context40.stop();
|
@@ -6231,13 +6186,13 @@ var qt = /*#__PURE__*/function (_ni2) {
|
|
6231
6186
|
return !!(t != null && t[0]) && !!(e && e.trim() !== "");
|
6232
6187
|
}
|
6233
6188
|
}]);
|
6234
|
-
return
|
6189
|
+
return Ut;
|
6235
6190
|
}(ni);
|
6236
|
-
var
|
6237
|
-
_inherits(
|
6238
|
-
var _super11 = _createSuper(
|
6239
|
-
function
|
6240
|
-
_classCallCheck(this,
|
6191
|
+
var _o = /*#__PURE__*/function (_xt3) {
|
6192
|
+
_inherits(_o, _xt3);
|
6193
|
+
var _super11 = _createSuper(_o);
|
6194
|
+
function _o(e) {
|
6195
|
+
_classCallCheck(this, _o);
|
6241
6196
|
var n, r, o;
|
6242
6197
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.audioSpeechRecognition,
|
6243
6198
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
@@ -6245,7 +6200,7 @@ var wo = /*#__PURE__*/function (_xt3) {
|
|
6245
6200
|
audio: {}
|
6246
6201
|
});
|
6247
6202
|
}
|
6248
|
-
_createClass(
|
6203
|
+
_createClass(_o, [{
|
6249
6204
|
key: "extractPollResultData",
|
6250
6205
|
value: function () {
|
6251
6206
|
var _extractPollResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(e) {
|
@@ -6281,7 +6236,7 @@ var wo = /*#__PURE__*/function (_xt3) {
|
|
6281
6236
|
return extractPollResultData;
|
6282
6237
|
}()
|
6283
6238
|
}]);
|
6284
|
-
return
|
6239
|
+
return _o;
|
6285
6240
|
}(xt);
|
6286
6241
|
var Mo = /*#__PURE__*/function (_Pe2) {
|
6287
6242
|
_inherits(Mo, _Pe2);
|
@@ -6503,12 +6458,12 @@ var Ao = /*#__PURE__*/function (_Pe5) {
|
|
6503
6458
|
}]);
|
6504
6459
|
return Ao;
|
6505
6460
|
}(Pe);
|
6506
|
-
var
|
6507
|
-
_inherits(
|
6508
|
-
var _super16 = _createSuper(
|
6509
|
-
function
|
6461
|
+
var qt = /*#__PURE__*/function (_ni3) {
|
6462
|
+
_inherits(qt, _ni3);
|
6463
|
+
var _super16 = _createSuper(qt);
|
6464
|
+
function qt(e) {
|
6510
6465
|
var _this21;
|
6511
|
-
_classCallCheck(this,
|
6466
|
+
_classCallCheck(this, qt);
|
6512
6467
|
var o;
|
6513
6468
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6514
6469
|
i = t.stabilityAI,
|
@@ -6522,10 +6477,10 @@ var Ut = /*#__PURE__*/function (_ni3) {
|
|
6522
6477
|
};
|
6523
6478
|
_this21 = _super16.call(this, e, re.buildKeyVerificationDetails(), re.buildHeaders, i, n), _this21.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this21.textInputPlaceholderText = "Describe image changes", _this21.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>";
|
6524
6479
|
var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
|
6525
|
-
_typeof(r) == "object" && (r.engine_id && (_this21.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this21._imageWeight = r.weight),
|
6480
|
+
_typeof(r) == "object" && (r.engine_id && (_this21.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this21._imageWeight = r.weight), qt.cleanConfig(r), Object.assign(_this21.rawBody, r)), _this21.canSendMessage = qt.canSendFileTextMessage;
|
6526
6481
|
return _this21;
|
6527
6482
|
}
|
6528
|
-
_createClass(
|
6483
|
+
_createClass(qt, [{
|
6529
6484
|
key: "createFormDataBody",
|
6530
6485
|
value: function createFormDataBody(e, t, i) {
|
6531
6486
|
var n = new FormData();
|
@@ -6555,7 +6510,7 @@ var Ut = /*#__PURE__*/function (_ni3) {
|
|
6555
6510
|
throw new Error("Image was not found");
|
6556
6511
|
case 4:
|
6557
6512
|
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);
|
6558
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
6513
|
+
E.tempRemoveContentHeader(this.requestSettings, _.request.bind(this, this, r, e), !1);
|
6559
6514
|
case 6:
|
6560
6515
|
case "end":
|
6561
6516
|
return _context47.stop();
|
@@ -6610,7 +6565,7 @@ var Ut = /*#__PURE__*/function (_ni3) {
|
|
6610
6565
|
return !!(t != null && t[0]) && !!(e && e.trim() !== "");
|
6611
6566
|
}
|
6612
6567
|
}]);
|
6613
|
-
return
|
6568
|
+
return qt;
|
6614
6569
|
}(ni);
|
6615
6570
|
var ko = /*#__PURE__*/function (_Pe6) {
|
6616
6571
|
_inherits(ko, _Pe6);
|
@@ -6690,7 +6645,7 @@ var Ht = /*#__PURE__*/function (_ni4) {
|
|
6690
6645
|
throw new Error("Request settings have not been set up");
|
6691
6646
|
case 2:
|
6692
6647
|
i = this.preprocessBody(this.rawBody, t[t.length - 1].text);
|
6693
|
-
|
6648
|
+
_.request(this, i, e);
|
6694
6649
|
case 4:
|
6695
6650
|
case "end":
|
6696
6651
|
return _context50.stop();
|
@@ -6789,11 +6744,11 @@ var Io = /*#__PURE__*/function (_Pe7) {
|
|
6789
6744
|
}]);
|
6790
6745
|
return Io;
|
6791
6746
|
}(Pe);
|
6792
|
-
var
|
6793
|
-
function
|
6794
|
-
_classCallCheck(this,
|
6747
|
+
var Gt = /*#__PURE__*/function () {
|
6748
|
+
function Gt() {
|
6749
|
+
_classCallCheck(this, Gt);
|
6795
6750
|
}
|
6796
|
-
_createClass(
|
6751
|
+
_createClass(Gt, null, [{
|
6797
6752
|
key: "buildHeaders",
|
6798
6753
|
value: function buildHeaders(e) {
|
6799
6754
|
return {
|
@@ -6815,26 +6770,26 @@ var Vt = /*#__PURE__*/function () {
|
|
6815
6770
|
return {
|
6816
6771
|
url: "https://api.cohere.ai/v1/generate",
|
6817
6772
|
method: "POST",
|
6818
|
-
handleVerificationResult:
|
6773
|
+
handleVerificationResult: Gt.handleVerificationResult,
|
6819
6774
|
body: JSON.stringify({
|
6820
6775
|
prompt: ""
|
6821
6776
|
})
|
6822
6777
|
};
|
6823
6778
|
}
|
6824
6779
|
}]);
|
6825
|
-
return
|
6780
|
+
return Gt;
|
6826
6781
|
}();
|
6827
|
-
var Yi = /*#__PURE__*/function (
|
6828
|
-
_inherits(Yi,
|
6782
|
+
var Yi = /*#__PURE__*/function (_U3) {
|
6783
|
+
_inherits(Yi, _U3);
|
6829
6784
|
var _super20 = _createSuper(Yi);
|
6830
6785
|
function Yi(e, t, i, n, r) {
|
6831
6786
|
var _this24;
|
6832
6787
|
_classCallCheck(this, Yi);
|
6833
|
-
_this24 = _super20.call(this, e,
|
6788
|
+
_this24 = _super20.call(this, e, Gt.buildKeyVerificationDetails(), Gt.buildHeaders, r), _this24.insertKeyPlaceholderText = "Cohere API Key", _this24.getKeyLink = "https://dashboard.cohere.ai/api-keys", _this24.permittedErrorPrefixes = ["invalid"], _this24.url = t, _this24.textInputPlaceholderText = i, n && _typeof(n) == "object" && Object.assign(_this24.rawBody, n);
|
6834
6789
|
return _this24;
|
6835
6790
|
}
|
6836
6791
|
return _createClass(Yi);
|
6837
|
-
}(
|
6792
|
+
}(U);
|
6838
6793
|
var Lo = /*#__PURE__*/function (_Yi) {
|
6839
6794
|
_inherits(Lo, _Yi);
|
6840
6795
|
var _super21 = _createSuper(Lo);
|
@@ -6869,7 +6824,7 @@ var Lo = /*#__PURE__*/function (_Yi) {
|
|
6869
6824
|
throw new Error("Request settings have not been set up");
|
6870
6825
|
case 2:
|
6871
6826
|
i = this.preprocessBody(this.rawBody, t);
|
6872
|
-
|
6827
|
+
_.request(this, i, e);
|
6873
6828
|
case 4:
|
6874
6829
|
case "end":
|
6875
6830
|
return _context53.stop();
|
@@ -6946,7 +6901,7 @@ var Ro = /*#__PURE__*/function (_Yi2) {
|
|
6946
6901
|
throw new Error("Request settings have not been set up");
|
6947
6902
|
case 2:
|
6948
6903
|
i = this.preprocessBody(this.rawBody, t);
|
6949
|
-
|
6904
|
+
_.request(this, i, e);
|
6950
6905
|
case 4:
|
6951
6906
|
case "end":
|
6952
6907
|
return _context55.stop();
|
@@ -7116,8 +7071,8 @@ var O = /*#__PURE__*/function () {
|
|
7116
7071
|
}]);
|
7117
7072
|
return O;
|
7118
7073
|
}();
|
7119
|
-
var Zi = /*#__PURE__*/function (
|
7120
|
-
_inherits(Fi,
|
7074
|
+
var Zi = /*#__PURE__*/function (_U4) {
|
7075
|
+
_inherits(Fi, _U4);
|
7121
7076
|
var _super23 = _createSuper(Fi);
|
7122
7077
|
function Fi(e) {
|
7123
7078
|
var _o$model, _a$voice;
|
@@ -7155,7 +7110,7 @@ var Zi = /*#__PURE__*/function (_q4) {
|
|
7155
7110
|
case 2:
|
7156
7111
|
this.url = this.requestSettings.url || this.url;
|
7157
7112
|
i = this.preprocessBody(this.rawBody, t);
|
7158
|
-
|
7113
|
+
_.request(this, i, e);
|
7159
7114
|
case 5:
|
7160
7115
|
case "end":
|
7161
7116
|
return _context60.stop();
|
@@ -7212,12 +7167,12 @@ var Zi = /*#__PURE__*/function (_q4) {
|
|
7212
7167
|
}()
|
7213
7168
|
}]);
|
7214
7169
|
return Fi;
|
7215
|
-
}(
|
7170
|
+
}(U);
|
7216
7171
|
Zi.DEFAULT_MODEL = "tts-1";
|
7217
7172
|
Zi.DEFAULT_VOIDE = "alloy";
|
7218
7173
|
var Oo = Zi;
|
7219
|
-
var si = /*#__PURE__*/function (
|
7220
|
-
_inherits(Ee,
|
7174
|
+
var si = /*#__PURE__*/function (_U5) {
|
7175
|
+
_inherits(Ee, _U5);
|
7221
7176
|
var _super24 = _createSuper(Ee);
|
7222
7177
|
function Ee(e) {
|
7223
7178
|
var _o$model2;
|
@@ -7269,7 +7224,7 @@ var si = /*#__PURE__*/function (_q5) {
|
|
7269
7224
|
case 4:
|
7270
7225
|
this.url = this.requestSettings.url || this._service_url;
|
7271
7226
|
n = this.preprocessBody(this.rawBody, t), r = Ee.createFormDataBody(n, i[0]);
|
7272
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
7227
|
+
E.tempRemoveContentHeader(this.requestSettings, _.request.bind(this, this, r, e), !1);
|
7273
7228
|
case 7:
|
7274
7229
|
case "end":
|
7275
7230
|
return _context62.stop();
|
@@ -7328,7 +7283,7 @@ var si = /*#__PURE__*/function (_q5) {
|
|
7328
7283
|
}
|
7329
7284
|
}]);
|
7330
7285
|
return Ee;
|
7331
|
-
}(
|
7286
|
+
}(U);
|
7332
7287
|
si.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions";
|
7333
7288
|
si.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations";
|
7334
7289
|
si.DEFAULT_MODEL = "whisper-1";
|
@@ -7435,8 +7390,8 @@ var Z = /*#__PURE__*/function () {
|
|
7435
7390
|
}]);
|
7436
7391
|
return Z;
|
7437
7392
|
}();
|
7438
|
-
var Po = /*#__PURE__*/function (
|
7439
|
-
_inherits(Po,
|
7393
|
+
var Po = /*#__PURE__*/function (_U6) {
|
7394
|
+
_inherits(Po, _U6);
|
7440
7395
|
var _super25 = _createSuper(Po);
|
7441
7396
|
// prettier-ignore
|
7442
7397
|
function Po(e, t, i, n, r) {
|
@@ -7448,7 +7403,7 @@ var Po = /*#__PURE__*/function (_q6) {
|
|
7448
7403
|
return _this27;
|
7449
7404
|
}
|
7450
7405
|
return _createClass(Po);
|
7451
|
-
}(
|
7406
|
+
}(U);
|
7452
7407
|
var Do = /*#__PURE__*/function (_Po) {
|
7453
7408
|
_inherits(Do, _Po);
|
7454
7409
|
var _super26 = _createSuper(Do);
|
@@ -7494,7 +7449,7 @@ var Do = /*#__PURE__*/function (_Po) {
|
|
7494
7449
|
throw new Error("Request settings have not been set up");
|
7495
7450
|
case 2:
|
7496
7451
|
i = this.preprocessBody(this.rawBody, t);
|
7497
|
-
|
7452
|
+
_.request(this, i, e), this.messages = e;
|
7498
7453
|
case 4:
|
7499
7454
|
case "end":
|
7500
7455
|
return _context64.stop();
|
@@ -7525,7 +7480,7 @@ var Do = /*#__PURE__*/function (_Po) {
|
|
7525
7480
|
method: "GET",
|
7526
7481
|
headers: (t = this.requestSettings) == null ? void 0 : t.headers
|
7527
7482
|
};
|
7528
|
-
|
7483
|
+
_.executePollRequest(this, _i9, n, this.messages);
|
7529
7484
|
}
|
7530
7485
|
return _context65.abrupt("return", {
|
7531
7486
|
makingAnotherRequest: !0
|
@@ -7710,8 +7665,8 @@ var ct = /*#__PURE__*/function () {
|
|
7710
7665
|
}]);
|
7711
7666
|
return ct;
|
7712
7667
|
}();
|
7713
|
-
var Xi = /*#__PURE__*/function (
|
7714
|
-
_inherits(Xi,
|
7668
|
+
var Xi = /*#__PURE__*/function (_U7) {
|
7669
|
+
_inherits(Xi, _U7);
|
7715
7670
|
var _super27 = _createSuper(Xi);
|
7716
7671
|
function Xi(e) {
|
7717
7672
|
var _this29;
|
@@ -7743,7 +7698,7 @@ var Xi = /*#__PURE__*/function (_q7) {
|
|
7743
7698
|
}
|
7744
7699
|
throw new Error("No file was added");
|
7745
7700
|
case 4:
|
7746
|
-
|
7701
|
+
_.request(this, i[0], e, !1);
|
7747
7702
|
case 5:
|
7748
7703
|
case "end":
|
7749
7704
|
return _context68.stop();
|
@@ -7795,9 +7750,9 @@ var Xi = /*#__PURE__*/function (_q7) {
|
|
7795
7750
|
}
|
7796
7751
|
}]);
|
7797
7752
|
return Xi;
|
7798
|
-
}(
|
7799
|
-
var as = /*#__PURE__*/function (
|
7800
|
-
_inherits(as,
|
7753
|
+
}(U);
|
7754
|
+
var as = /*#__PURE__*/function (_U8) {
|
7755
|
+
_inherits(as, _U8);
|
7801
7756
|
var _super28 = _createSuper(as);
|
7802
7757
|
// prettier-ignore
|
7803
7758
|
function as(e, t, i, n, r) {
|
@@ -7809,7 +7764,7 @@ var as = /*#__PURE__*/function (_q8) {
|
|
7809
7764
|
return _this30;
|
7810
7765
|
}
|
7811
7766
|
return _createClass(as);
|
7812
|
-
}(
|
7767
|
+
}(U);
|
7813
7768
|
var ls = /*#__PURE__*/function (_as) {
|
7814
7769
|
_inherits(cs, _as);
|
7815
7770
|
var _super29 = _createSuper(cs);
|
@@ -7845,7 +7800,7 @@ var ls = /*#__PURE__*/function (_as) {
|
|
7845
7800
|
throw new Error("Request settings have not been set up");
|
7846
7801
|
case 2:
|
7847
7802
|
i = this.preprocessBody(this.rawBody, t);
|
7848
|
-
|
7803
|
+
_.request(this, i, e, !1);
|
7849
7804
|
case 4:
|
7850
7805
|
case "end":
|
7851
7806
|
return _context70.stop();
|
@@ -7934,7 +7889,7 @@ var ds = /*#__PURE__*/function (_as2) {
|
|
7934
7889
|
}
|
7935
7890
|
throw new Error("No file was added");
|
7936
7891
|
case 4:
|
7937
|
-
(r = this.requestSettings) != null && r.headers && (this.requestSettings.headers["Content-Type"] = i[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"),
|
7892
|
+
(r = this.requestSettings) != null && r.headers && (this.requestSettings.headers["Content-Type"] = i[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"), _.request(this, i[0], e, !1);
|
7938
7893
|
case 5:
|
7939
7894
|
case "end":
|
7940
7895
|
return _context72.stop();
|
@@ -7985,8 +7940,8 @@ ds.HELP_LINK =
|
|
7985
7940
|
// eslint-disable-next-line max-len
|
7986
7941
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
7987
7942
|
var Fo = ds;
|
7988
|
-
var Bo = /*#__PURE__*/function (
|
7989
|
-
_inherits(Bo,
|
7943
|
+
var Bo = /*#__PURE__*/function (_U9) {
|
7944
|
+
_inherits(Bo, _U9);
|
7990
7945
|
var _super31 = _createSuper(Bo);
|
7991
7946
|
// prettier-ignore
|
7992
7947
|
function Bo(e) {
|
@@ -8023,7 +7978,7 @@ var Bo = /*#__PURE__*/function (_q9) {
|
|
8023
7978
|
throw new Error("Request settings have not been set up");
|
8024
7979
|
case 2:
|
8025
7980
|
i = this.preprocessBody(t);
|
8026
|
-
|
7981
|
+
_.request(this, i, e);
|
8027
7982
|
case 4:
|
8028
7983
|
case "end":
|
8029
7984
|
return _context74.stop();
|
@@ -8065,9 +8020,9 @@ var Bo = /*#__PURE__*/function (_q9) {
|
|
8065
8020
|
}()
|
8066
8021
|
}]);
|
8067
8022
|
return Bo;
|
8068
|
-
}(
|
8069
|
-
var Qi = /*#__PURE__*/function (
|
8070
|
-
_inherits(ae,
|
8023
|
+
}(U);
|
8024
|
+
var Qi = /*#__PURE__*/function (_U10) {
|
8025
|
+
_inherits(ae, _U10);
|
8071
8026
|
var _super32 = _createSuper(ae);
|
8072
8027
|
function ae(e) {
|
8073
8028
|
var _l$headers, _c$OpenAIBeta;
|
@@ -8112,11 +8067,11 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8112
8067
|
if (this.sessionId) {
|
8113
8068
|
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/messages");
|
8114
8069
|
var n = this.processMessage(t, i);
|
8115
|
-
|
8070
|
+
_.request(this, n, e);
|
8116
8071
|
} else {
|
8117
8072
|
this.url = "".concat(ae.THREAD_PREFIX, "/runs");
|
8118
8073
|
var _n2 = this.createNewThreadMessages(this.rawBody, t, i);
|
8119
|
-
|
8074
|
+
_.request(this, _n2, e);
|
8120
8075
|
}
|
8121
8076
|
this.messages = e;
|
8122
8077
|
}
|
@@ -8190,7 +8145,7 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8190
8145
|
method: "GET",
|
8191
8146
|
headers: (n = this.requestSettings) == null ? void 0 : n.headers
|
8192
8147
|
};
|
8193
|
-
return _context77.abrupt("return", (
|
8148
|
+
return _context77.abrupt("return", (_.executePollRequest(this, t, i, this.messages), {
|
8194
8149
|
makingAnotherRequest: !0
|
8195
8150
|
}));
|
8196
8151
|
case 6:
|
@@ -8351,16 +8306,16 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8351
8306
|
}()
|
8352
8307
|
}]);
|
8353
8308
|
return ae;
|
8354
|
-
}(
|
8309
|
+
}(U);
|
8355
8310
|
Qi.THREAD_PREFIX = "https://api.openai.com/v1/threads";
|
8356
8311
|
Qi.POLLING_TIMEOUT_MS = 800;
|
8357
8312
|
var zo = Qi;
|
8358
|
-
var ri = /*#__PURE__*/function (
|
8359
|
-
_inherits(
|
8360
|
-
var _super33 = _createSuper(
|
8361
|
-
function
|
8313
|
+
var ri = /*#__PURE__*/function (_U11) {
|
8314
|
+
_inherits(Se, _U11);
|
8315
|
+
var _super33 = _createSuper(Se);
|
8316
|
+
function Se(e) {
|
8362
8317
|
var _this35;
|
8363
|
-
_classCallCheck(this,
|
8318
|
+
_classCallCheck(this, Se);
|
8364
8319
|
var o;
|
8365
8320
|
var t = e.directConnection,
|
8366
8321
|
i = t == null ? void 0 : t.openAI,
|
@@ -8383,10 +8338,10 @@ var ri = /*#__PURE__*/function (_q11) {
|
|
8383
8338
|
}
|
8384
8339
|
};
|
8385
8340
|
}
|
8386
|
-
_typeof(r) == "object" && Object.assign(_this35.rawBody, r), _this35.canSendMessage =
|
8341
|
+
_typeof(r) == "object" && Object.assign(_this35.rawBody, r), _this35.canSendMessage = Se.canFileSendMessage;
|
8387
8342
|
return _this35;
|
8388
8343
|
}
|
8389
|
-
_createClass(
|
8344
|
+
_createClass(Se, [{
|
8390
8345
|
key: "preprocessBody",
|
8391
8346
|
value: function preprocessBody(e, t) {
|
8392
8347
|
var i = JSON.parse(JSON.stringify(e));
|
@@ -8400,11 +8355,11 @@ var ri = /*#__PURE__*/function (_q11) {
|
|
8400
8355
|
var n;
|
8401
8356
|
var r = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim();
|
8402
8357
|
if (i[1] || r && r !== "") {
|
8403
|
-
this.url =
|
8358
|
+
this.url = Se.IMAGE_EDIT_URL;
|
8404
8359
|
var l = this.preprocessBody(this.rawBody, r);
|
8405
|
-
n =
|
8406
|
-
} else this.url =
|
8407
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
8360
|
+
n = Se.createFormDataBody(l, i[0], i[1]);
|
8361
|
+
} else this.url = Se.IMAGE_VARIATIONS_URL, n = Se.createFormDataBody(this.rawBody, i[0]);
|
8362
|
+
E.tempRemoveContentHeader(this.requestSettings, _.request.bind(this, this, n, e), !1);
|
8408
8363
|
}
|
8409
8364
|
}, {
|
8410
8365
|
key: "callServiceAPI",
|
@@ -8434,9 +8389,9 @@ var ri = /*#__PURE__*/function (_q11) {
|
|
8434
8389
|
}
|
8435
8390
|
throw new Error("Request settings have not been set up");
|
8436
8391
|
case 8:
|
8437
|
-
this.url =
|
8392
|
+
this.url = Se.IMAGE_GENERATION_URL;
|
8438
8393
|
r = this.preprocessBody(this.rawBody, t[t.length - 1].text);
|
8439
|
-
|
8394
|
+
_.request(this, r, e);
|
8440
8395
|
case 11:
|
8441
8396
|
case "end":
|
8442
8397
|
return _context81.stop();
|
@@ -8505,14 +8460,14 @@ var ri = /*#__PURE__*/function (_q11) {
|
|
8505
8460
|
}), n;
|
8506
8461
|
}
|
8507
8462
|
}]);
|
8508
|
-
return
|
8509
|
-
}(
|
8463
|
+
return Se;
|
8464
|
+
}(U);
|
8510
8465
|
ri.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations";
|
8511
8466
|
ri.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations";
|
8512
8467
|
ri.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
|
8513
|
-
var
|
8514
|
-
var dt = /*#__PURE__*/function (
|
8515
|
-
_inherits(dt,
|
8468
|
+
var Uo = ri;
|
8469
|
+
var dt = /*#__PURE__*/function (_U12) {
|
8470
|
+
_inherits(dt, _U12);
|
8516
8471
|
var _super34 = _createSuper(dt);
|
8517
8472
|
function dt(e) {
|
8518
8473
|
var _this36$maxMessages, _l$model;
|
@@ -8569,7 +8524,7 @@ var dt = /*#__PURE__*/function (_q12) {
|
|
8569
8524
|
throw new Error("Request settings have not been set up");
|
8570
8525
|
case 2:
|
8571
8526
|
i = this.preprocessBody(this.rawBody, t), n = this.deepChat.stream;
|
8572
|
-
n && (_typeof(n) != "object" || !n.simulation) || i.stream ? (i.stream = !0, I.request(this, i, e)) :
|
8527
|
+
n && (_typeof(n) != "object" || !n.simulation) || i.stream ? (i.stream = !0, I.request(this, i, e)) : _.request(this, i, e);
|
8573
8528
|
case 4:
|
8574
8529
|
case "end":
|
8575
8530
|
return _context83.stop();
|
@@ -8718,14 +8673,14 @@ var dt = /*#__PURE__*/function (_q12) {
|
|
8718
8673
|
}
|
8719
8674
|
}]);
|
8720
8675
|
return dt;
|
8721
|
-
}(
|
8722
|
-
var
|
8723
|
-
_inherits(
|
8724
|
-
var _super35 = _createSuper(
|
8725
|
-
function
|
8676
|
+
}(U);
|
8677
|
+
var qo = /*#__PURE__*/function (_Yi3) {
|
8678
|
+
_inherits(qo, _Yi3);
|
8679
|
+
var _super35 = _createSuper(qo);
|
8680
|
+
function qo(e) {
|
8726
8681
|
var _this37$maxMessages;
|
8727
8682
|
var _this37;
|
8728
|
-
_classCallCheck(this,
|
8683
|
+
_classCallCheck(this, qo);
|
8729
8684
|
var r;
|
8730
8685
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
8731
8686
|
i = (r = t.cohere) == null ? void 0 : r.chat,
|
@@ -8733,7 +8688,7 @@ var Uo = /*#__PURE__*/function (_Yi3) {
|
|
8733
8688
|
_this37 = _super35.call(this, e, "https://api.cohere.ai/v1/chat", "Ask me anything!", i, n), _typeof(i) == "object" && Object.assign(_this37.rawBody, i), (_this37$maxMessages = _this37.maxMessages) !== null && _this37$maxMessages !== void 0 ? _this37$maxMessages : _this37.maxMessages = -1;
|
8734
8689
|
return _this37;
|
8735
8690
|
}
|
8736
|
-
_createClass(
|
8691
|
+
_createClass(qo, [{
|
8737
8692
|
key: "preprocessBody",
|
8738
8693
|
value: function preprocessBody(e, t) {
|
8739
8694
|
var i = JSON.parse(JSON.stringify(e)),
|
@@ -8762,7 +8717,7 @@ var Uo = /*#__PURE__*/function (_Yi3) {
|
|
8762
8717
|
throw new Error("Request settings have not been set up");
|
8763
8718
|
case 2:
|
8764
8719
|
i = this.preprocessBody(this.rawBody, t);
|
8765
|
-
|
8720
|
+
_.request(this, i, e);
|
8766
8721
|
case 4:
|
8767
8722
|
case "end":
|
8768
8723
|
return _context86.stop();
|
@@ -8802,7 +8757,7 @@ var Uo = /*#__PURE__*/function (_Yi3) {
|
|
8802
8757
|
return extractResultData;
|
8803
8758
|
}()
|
8804
8759
|
}]);
|
8805
|
-
return
|
8760
|
+
return qo;
|
8806
8761
|
}(Yi);
|
8807
8762
|
var Ho = /*#__PURE__*/function () {
|
8808
8763
|
function Ho() {
|
@@ -8819,17 +8774,17 @@ var Ho = /*#__PURE__*/function () {
|
|
8819
8774
|
r = e.webModel;
|
8820
8775
|
if (r) return new $i(e);
|
8821
8776
|
if (t) {
|
8822
|
-
if (t.openAI) return t.openAI.images ? new
|
8777
|
+
if (t.openAI) return t.openAI.images ? new Uo(e) : t.openAI.speechToText ? new No(e) : t.openAI.textToSpeech ? new Oo(e) : t.openAI.assistant ? new zo(e) : new dt(e);
|
8823
8778
|
if (t.assemblyAI) return new Xi(e);
|
8824
|
-
if (t.cohere) return t.cohere.textGeneration ? new Lo(e) : t.cohere.summarization ? new Ro(e) : new
|
8825
|
-
if (t.huggingFace) return t.huggingFace.textGeneration ? new Mo(e) : t.huggingFace.summarization ? new Co(e) : t.huggingFace.translation ? new ko(e) : t.huggingFace.fillMask ? new Io(e) : t.huggingFace.questionAnswer ? new To(e) : t.huggingFace.audioSpeechRecognition ? new
|
8779
|
+
if (t.cohere) return t.cohere.textGeneration ? new Lo(e) : t.cohere.summarization ? new Ro(e) : new qo(e);
|
8780
|
+
if (t.huggingFace) return t.huggingFace.textGeneration ? new Mo(e) : t.huggingFace.summarization ? new Co(e) : t.huggingFace.translation ? new ko(e) : t.huggingFace.fillMask ? new Io(e) : t.huggingFace.questionAnswer ? new To(e) : t.huggingFace.audioSpeechRecognition ? new _o(e) : t.huggingFace.audioClassification ? new So(e) : t.huggingFace.imageClassification ? new wo(e) : new Ao(e);
|
8826
8781
|
if (t.azure) {
|
8827
8782
|
if (t.azure.speechToText) return new Fo(e);
|
8828
8783
|
if (t.azure.textToSpeech) return new jo(e);
|
8829
8784
|
if (t.azure.summarization) return new Do(e);
|
8830
8785
|
if (t.azure.translation) return new Bo(e);
|
8831
8786
|
}
|
8832
|
-
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new
|
8787
|
+
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new qt(e) : t.stabilityAI.imageToImageUpscale ? new zt(e) : t.stabilityAI.imageToImageMasking ? new Ut(e) : new Ht(e);
|
8833
8788
|
}
|
8834
8789
|
return i ? new Le(e) : new Le(e, void 0, n || !0);
|
8835
8790
|
}
|
@@ -8855,7 +8810,7 @@ var us = /*#__PURE__*/function () {
|
|
8855
8810
|
return zi;
|
8856
8811
|
}();
|
8857
8812
|
us.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap";
|
8858
|
-
var
|
8813
|
+
var Go = us;
|
8859
8814
|
var hs = /*#__PURE__*/_createClass(function hs() {
|
8860
8815
|
_classCallCheck(this, hs);
|
8861
8816
|
});
|
@@ -8911,21 +8866,21 @@ var en = /*#__PURE__*/function () {
|
|
8911
8866
|
}]);
|
8912
8867
|
return en;
|
8913
8868
|
}();
|
8914
|
-
var
|
8915
|
-
function
|
8916
|
-
_classCallCheck(this,
|
8869
|
+
var Vt = /*#__PURE__*/function () {
|
8870
|
+
function Vt(e, t, i) {
|
8871
|
+
_classCallCheck(this, Vt);
|
8917
8872
|
this._isDisplayed = !1, e ? (this._elementRef = this.createIntroPanelWithChild(e, i), this._isDisplayed = !0) : t && (this._elementRef = this.createInternalIntroPanel(t, i), this._isDisplayed = !0);
|
8918
8873
|
}
|
8919
|
-
_createClass(
|
8874
|
+
_createClass(Vt, [{
|
8920
8875
|
key: "createIntroPanelWithChild",
|
8921
8876
|
value: function createIntroPanelWithChild(e, t) {
|
8922
|
-
var i =
|
8877
|
+
var i = Vt.createIntroPanel(t);
|
8923
8878
|
return e.style.display === "none" && (e.style.display = "block"), i.appendChild(e), i;
|
8924
8879
|
}
|
8925
8880
|
}, {
|
8926
8881
|
key: "createInternalIntroPanel",
|
8927
8882
|
value: function createInternalIntroPanel(e, t) {
|
8928
|
-
var i =
|
8883
|
+
var i = Vt.createIntroPanel(t);
|
8929
8884
|
return i.id = "internal-intro-panel", i.innerHTML = e, i;
|
8930
8885
|
}
|
8931
8886
|
}, {
|
@@ -8945,17 +8900,17 @@ var Gt = /*#__PURE__*/function () {
|
|
8945
8900
|
return t.classList.add("intro-panel"), Object.assign(t.style, e), t;
|
8946
8901
|
}
|
8947
8902
|
}]);
|
8948
|
-
return
|
8903
|
+
return Vt;
|
8949
8904
|
}();
|
8950
|
-
var
|
8951
|
-
function
|
8952
|
-
_classCallCheck(this,
|
8905
|
+
var Vo = /*#__PURE__*/function () {
|
8906
|
+
function Vo() {
|
8907
|
+
_classCallCheck(this, Vo);
|
8953
8908
|
}
|
8954
|
-
_createClass(
|
8909
|
+
_createClass(Vo, null, [{
|
8955
8910
|
key: "getText",
|
8956
8911
|
value: function getText(e, t) {
|
8957
8912
|
var i, n;
|
8958
|
-
if (!e.directConnection && !e.request && !e.webModel && !e.demo) return "Connect to any API using the [request](https://deepchat.dev/docs/connect#Request)\n property or a popular service via\n [directConnection](https://deepchat.dev/docs/directConnection/#directConnection).\n \n Host AI entirely on your browser via a [webModel](
|
8913
|
+
if (!e.directConnection && !e.request && !e.webModel && !e.demo) return "Connect to any API using the [request](https://deepchat.dev/docs/connect#Request)\n property or a popular service via\n [directConnection](https://deepchat.dev/docs/directConnection/#directConnection).\n \n Host AI entirely on your browser via a [webModel](WORK).\n \n To get started checkout the [Start](https://deepchat.dev/start) page and\n live code [examples](https://deepchat.dev/examples/frameworks).\n \n To remove this message set the [demo](https://deepchat.dev/docs/demo#demo) property to true.";
|
8959
8914
|
if (e.directConnection) {
|
8960
8915
|
if (!t.isDirectConnection()) return "Please define a valid service inside\n the [directConnection](https://deepchat.dev/docs/directConnection/#directConnection) object.";
|
8961
8916
|
var r = (i = e.directConnection.openAI) == null ? void 0 : i.chat;
|
@@ -8966,7 +8921,7 @@ var Go = /*#__PURE__*/function () {
|
|
8966
8921
|
return null;
|
8967
8922
|
}
|
8968
8923
|
}]);
|
8969
|
-
return
|
8924
|
+
return Vo;
|
8970
8925
|
}();
|
8971
8926
|
var Wo = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" \n\t viewBox=\"50 30 420 450\" xml:space=\"preserve\">\n<g filter=\"brightness(0) saturate(100%) invert(16%) sepia(0%) saturate(1942%) hue-rotate(215deg) brightness(99%) contrast(93%)\">\n\t<g>\n\t\t<path d=\"M447.933,103.629c-0.034-3.076-1.224-6.09-3.485-8.352L352.683,3.511c-0.004-0.004-0.007-0.005-0.011-0.008\n\t\t\tC350.505,1.338,347.511,0,344.206,0H89.278C75.361,0,64.04,11.32,64.04,25.237v461.525c0,13.916,11.32,25.237,25.237,25.237\n\t\t\th333.444c13.916,0,25.237-11.32,25.237-25.237V103.753C447.96,103.709,447.937,103.672,447.933,103.629z M356.194,40.931\n\t\t\tl50.834,50.834h-49.572c-0.695,0-1.262-0.567-1.262-1.262V40.931z M423.983,486.763c0,0.695-0.566,1.261-1.261,1.261H89.278\n\t\t\tc-0.695,0-1.261-0.566-1.261-1.261V25.237c0-0.695,0.566-1.261,1.261-1.261h242.94v66.527c0,13.916,11.322,25.239,25.239,25.239\n\t\t\th66.527V486.763z\"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path d=\"M362.088,164.014H149.912c-6.62,0-11.988,5.367-11.988,11.988c0,6.62,5.368,11.988,11.988,11.988h212.175\n\t\t\tc6.62,0,11.988-5.368,11.988-11.988C374.076,169.381,368.707,164.014,362.088,164.014z\"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path d=\"M362.088,236.353H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.62,5.368,11.988,11.988,11.988h212.175\n\t\t\tc6.62,0,11.988-5.368,11.988-11.988C374.076,241.721,368.707,236.353,362.088,236.353z\"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path d=\"M362.088,308.691H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.621,5.368,11.988,11.988,11.988h212.175\n\t\t\tc6.62,0,11.988-5.367,11.988-11.988C374.076,314.06,368.707,308.691,362.088,308.691z\"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path d=\"M256,381.031H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.621,5.368,11.988,11.988,11.988H256\n\t\t\tc6.62,0,11.988-5.367,11.988-11.988C267.988,386.398,262.62,381.031,256,381.031z\"/>\n\t</g>\n</g>\n</svg>";
|
8972
8927
|
var fe = /*#__PURE__*/function () {
|
@@ -9022,7 +8977,7 @@ var fe = /*#__PURE__*/function () {
|
|
9022
8977
|
t.classList.add("any-file-message-contents");
|
9023
8978
|
var i = document.createElement("div");
|
9024
8979
|
i.classList.add("any-file-message-icon-container");
|
9025
|
-
var n =
|
8980
|
+
var n = q.createSVGElement(Wo);
|
9026
8981
|
n.classList.add("any-file-message-icon"), i.appendChild(n);
|
9027
8982
|
var r = document.createElement("div");
|
9028
8983
|
return r.classList.add("any-file-message-text"), r.textContent = e.name || ne.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), ne.processContent(t, e.src);
|
@@ -9057,7 +9012,7 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9057
9012
|
var n = t.permittedErrorPrefixes,
|
9058
9013
|
r = t.introPanelMarkUp,
|
9059
9014
|
o = t.demo;
|
9060
|
-
_this38._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this38._onClearMessages = jt.onClearMessages.bind(_assertThisInitialized(_this38), e), _this38._onError = jt.onError.bind(_assertThisInitialized(_this38), e), _this38._displayLoadingMessage = me.getDisplayLoadingMessage(e, t), _this38._permittedErrorPrefixes = n, _this38.addSetupMessageIfNeeded(e, t)
|
9015
|
+
_this38._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this38._onClearMessages = jt.onClearMessages.bind(_assertThisInitialized(_this38), e), _this38._onError = jt.onError.bind(_assertThisInitialized(_this38), e), _this38._displayLoadingMessage = me.getDisplayLoadingMessage(e, t), _this38._permittedErrorPrefixes = n, _this38.addSetupMessageIfNeeded(e, t) || _this38.populateIntroPanel(i, r, e.introPanelStyle), _this38.addIntroductoryMessage(e, t), e.initialMessages && _this38.populateInitialMessages(e.initialMessages), _this38._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
|
9061
9016
|
return JSON.parse(JSON.stringify(_this38.messages));
|
9062
9017
|
}, e.clearMessages = _this38.clearMessages.bind(_assertThisInitialized(_this38), t), e.refreshMessages = _this38.refreshTextMessages.bind(_assertThisInitialized(_this38)), e.scrollToBottom = Y.scrollToBottom.bind(_assertThisInitialized(_this38), _this38.elementRef), e._addMessage = function (c, d) {
|
9063
9018
|
_this38.addNewMessage(_objectSpread(_objectSpread({}, c), {}, {
|
@@ -9076,11 +9031,12 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9076
9031
|
}, {
|
9077
9032
|
key: "addSetupMessageIfNeeded",
|
9078
9033
|
value: function addSetupMessageIfNeeded(e, t) {
|
9079
|
-
var i =
|
9034
|
+
var i = Vo.getText(e, t);
|
9080
9035
|
if (i) {
|
9081
9036
|
var n = this.createAndAppendNewMessageElement(i, v.AI_ROLE);
|
9082
9037
|
this.applyCustomStyles(n, v.AI_ROLE, !1);
|
9083
9038
|
}
|
9039
|
+
return !!i;
|
9084
9040
|
}
|
9085
9041
|
// WORK - const file for deep chat classes
|
9086
9042
|
}, {
|
@@ -9109,7 +9065,7 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9109
9065
|
ke.processInitialMessageFile(t), _this39.addNewMessage(t, !0);
|
9110
9066
|
}), setTimeout(function () {
|
9111
9067
|
return Y.scrollToBottom(_this39.elementRef);
|
9112
|
-
});
|
9068
|
+
}, 0);
|
9113
9069
|
}
|
9114
9070
|
// this should not be activated by streamed messages
|
9115
9071
|
}, {
|
@@ -9201,7 +9157,7 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9201
9157
|
}, {
|
9202
9158
|
key: "populateIntroPanel",
|
9203
9159
|
value: function populateIntroPanel(e, t, i) {
|
9204
|
-
(e || t) && (this._introPanel = new
|
9160
|
+
(e || t) && (this._introPanel = new Vt(e, t, i), this._introPanel._elementRef && (se.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
|
9205
9161
|
}
|
9206
9162
|
}, {
|
9207
9163
|
key: "addMultipleFiles",
|
@@ -9270,7 +9226,7 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9270
9226
|
}]);
|
9271
9227
|
return me;
|
9272
9228
|
}(Ke);
|
9273
|
-
var
|
9229
|
+
var St = /*#__PURE__*/function () {
|
9274
9230
|
function W() {
|
9275
9231
|
_classCallCheck(this, W);
|
9276
9232
|
}
|
@@ -9306,11 +9262,11 @@ var _t = /*#__PURE__*/function () {
|
|
9306
9262
|
}]);
|
9307
9263
|
return W;
|
9308
9264
|
}();
|
9309
|
-
|
9310
|
-
|
9311
|
-
|
9312
|
-
|
9313
|
-
var Ko =
|
9265
|
+
St.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS = "text-input-container-left-adjustment";
|
9266
|
+
St.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS = "text-input-container-right-adjustment";
|
9267
|
+
St.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS = "text-input-container-left-small-adjustment";
|
9268
|
+
St.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS = "text-input-container-right-small-adjustment";
|
9269
|
+
var Ko = St;
|
9314
9270
|
var Qe = /*#__PURE__*/function () {
|
9315
9271
|
function Qe() {
|
9316
9272
|
_classCallCheck(this, Qe);
|
@@ -9345,7 +9301,7 @@ var Qe = /*#__PURE__*/function () {
|
|
9345
9301
|
}]);
|
9346
9302
|
return Qe;
|
9347
9303
|
}();
|
9348
|
-
var
|
9304
|
+
var Sn = ["camera", "gifs", "images", "audio", "mixedFiles", "submit", "microphone"];
|
9349
9305
|
var j = /*#__PURE__*/function () {
|
9350
9306
|
function j() {
|
9351
9307
|
_classCallCheck(this, j);
|
@@ -9359,7 +9315,7 @@ var j = /*#__PURE__*/function () {
|
|
9359
9315
|
}, {
|
9360
9316
|
key: "createElement",
|
9361
9317
|
value: function createElement(e, t) {
|
9362
|
-
return t ? j.createTextElement(e) :
|
9318
|
+
return t ? j.createTextElement(e) : q.createSVGElement(e);
|
9363
9319
|
}
|
9364
9320
|
}, {
|
9365
9321
|
key: "createCustomElement",
|
@@ -9430,14 +9386,14 @@ var te = /*#__PURE__*/function () {
|
|
9430
9386
|
}]);
|
9431
9387
|
return te;
|
9432
9388
|
}();
|
9433
|
-
var
|
9434
|
-
function
|
9435
|
-
_classCallCheck(this,
|
9389
|
+
var wt = /*#__PURE__*/function () {
|
9390
|
+
function wt(e, t, i, n) {
|
9391
|
+
_classCallCheck(this, wt);
|
9436
9392
|
this._mouseState = {
|
9437
9393
|
state: "default"
|
9438
9394
|
}, this.elementRef = e, this._customStyles = i, this.position = t, this.dropupText = n;
|
9439
9395
|
}
|
9440
|
-
_createClass(
|
9396
|
+
_createClass(wt, [{
|
9441
9397
|
key: "buttonMouseLeave",
|
9442
9398
|
value: function buttonMouseLeave(e) {
|
9443
9399
|
this._mouseState.state = "default", e && (te.unsetAllCSS(this.elementRef, e), te.setElementsCSS(this.elementRef, e, "default"));
|
@@ -9481,7 +9437,7 @@ var St = /*#__PURE__*/function () {
|
|
9481
9437
|
i && te.setElementCssUpToState(this.elementRef, i, this._mouseState.state), this.setEvents(i);
|
9482
9438
|
}
|
9483
9439
|
}]);
|
9484
|
-
return
|
9440
|
+
return wt;
|
9485
9441
|
}();
|
9486
9442
|
var gt = /*#__PURE__*/function () {
|
9487
9443
|
function gt() {
|
@@ -9505,11 +9461,11 @@ var gt = /*#__PURE__*/function () {
|
|
9505
9461
|
}]);
|
9506
9462
|
return gt;
|
9507
9463
|
}();
|
9508
|
-
var
|
9509
|
-
function
|
9510
|
-
_classCallCheck(this,
|
9464
|
+
var _e = /*#__PURE__*/function () {
|
9465
|
+
function _e() {
|
9466
|
+
_classCallCheck(this, _e);
|
9511
9467
|
}
|
9512
|
-
_createClass(
|
9468
|
+
_createClass(_e, null, [{
|
9513
9469
|
key: "addItemEvents",
|
9514
9470
|
value: function addItemEvents(e, t, i, n) {
|
9515
9471
|
Te.add(t, n), t.addEventListener("click", function () {
|
@@ -9536,7 +9492,7 @@ var we = /*#__PURE__*/function () {
|
|
9536
9492
|
key: "populateItem",
|
9537
9493
|
value: function populateItem(e, t, i, n) {
|
9538
9494
|
var r = e.children[0];
|
9539
|
-
r.classList.contains("text-button") ? t.appendChild(
|
9495
|
+
r.classList.contains("text-button") ? t.appendChild(_e.createItemText(r.textContent, n == null ? void 0 : n.text)) : (t.appendChild(_e.createItemIcon(e, n == null ? void 0 : n.iconContainer)), t.appendChild(_e.createItemText(i, n == null ? void 0 : n.text)));
|
9540
9496
|
}
|
9541
9497
|
// prettier-ignore
|
9542
9498
|
}, {
|
@@ -9546,16 +9502,16 @@ var we = /*#__PURE__*/function () {
|
|
9546
9502
|
var n = t.elementRef,
|
9547
9503
|
r = t.dropupText,
|
9548
9504
|
o = document.createElement("div");
|
9549
|
-
Object.assign(o.style, (l = i == null ? void 0 : i.item) == null ? void 0 : l["default"]),
|
9505
|
+
Object.assign(o.style, (l = i == null ? void 0 : i.item) == null ? void 0 : l["default"]), _e.populateItem(n, o, r, i), o.classList.add("dropup-menu-item");
|
9550
9506
|
var a = T.processStateful((i == null ? void 0 : i.item) || {}, {
|
9551
9507
|
backgroundColor: "#f3f3f3"
|
9552
9508
|
}, {
|
9553
9509
|
backgroundColor: "#ebebeb"
|
9554
9510
|
});
|
9555
|
-
return
|
9511
|
+
return _e.addItemEvents(e, o, n, a), o;
|
9556
9512
|
}
|
9557
9513
|
}]);
|
9558
|
-
return
|
9514
|
+
return _e;
|
9559
9515
|
}();
|
9560
9516
|
var tn = /*#__PURE__*/function () {
|
9561
9517
|
function tn(e, t) {
|
@@ -9584,21 +9540,27 @@ var tn = /*#__PURE__*/function () {
|
|
9584
9540
|
}, {
|
9585
9541
|
key: "addItem",
|
9586
9542
|
value: function addItem(e) {
|
9587
|
-
var t =
|
9543
|
+
var t = _e.createItem(this, e, this._styles);
|
9588
9544
|
this.elementRef.appendChild(t);
|
9589
9545
|
}
|
9590
9546
|
// prettier-ignore
|
9591
9547
|
}, {
|
9592
9548
|
key: "addWindowEvents",
|
9593
9549
|
value: function addWindowEvents(e) {
|
9594
|
-
|
9595
|
-
|
9596
|
-
|
9597
|
-
|
9598
|
-
|
9599
|
-
|
9600
|
-
|
9601
|
-
|
9550
|
+
this.clickEvent = this.windowClick.bind(this, e), window.addEventListener("click", this.clickEvent), this.keyDownEvent = this.windowKeyDown.bind(this, e), window.addEventListener("keydown", this.keyDownEvent);
|
9551
|
+
}
|
9552
|
+
}, {
|
9553
|
+
key: "windowClick",
|
9554
|
+
value: function windowClick(e, t) {
|
9555
|
+
var i;
|
9556
|
+
!e.isConnected && this.clickEvent ? window.removeEventListener("click", this.clickEvent) : e.parentElement !== ((i = t.target.shadowRoot) == null ? void 0 : i.children[0]) && this.close();
|
9557
|
+
}
|
9558
|
+
// prettier-ignore
|
9559
|
+
}, {
|
9560
|
+
key: "windowKeyDown",
|
9561
|
+
value: function windowKeyDown(e, t) {
|
9562
|
+
var i, n, r;
|
9563
|
+
!e.isConnected && this.keyDownEvent ? window.removeEventListener("keydown", this.keyDownEvent) : this._isOpen && (t.key === R.ESCAPE ? (this.close(), (i = this.highlightedItem) == null || i.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === R.ENTER ? ((n = this.highlightedItem) == null || n.click(), (r = this.highlightedItem) == null || r.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === R.ARROW_DOWN ? gt.focusSiblingItem(this.highlightedItem || this.elementRef.children[this.elementRef.children.length - 1], this.elementRef, !0) : t.key === R.ARROW_UP && gt.focusSiblingItem(this.highlightedItem || this.elementRef.children[0], this.elementRef, !1));
|
9602
9564
|
}
|
9603
9565
|
}], [{
|
9604
9566
|
key: "createElement",
|
@@ -9609,19 +9571,19 @@ var tn = /*#__PURE__*/function () {
|
|
9609
9571
|
}]);
|
9610
9572
|
return tn;
|
9611
9573
|
}();
|
9612
|
-
var Je = /*#__PURE__*/function (
|
9613
|
-
_inherits(Je,
|
9574
|
+
var Je = /*#__PURE__*/function (_wt) {
|
9575
|
+
_inherits(Je, _wt);
|
9614
9576
|
var _super37 = _createSuper(Je);
|
9615
9577
|
function Je(e, t) {
|
9616
|
-
var
|
9578
|
+
var _this41;
|
9617
9579
|
_classCallCheck(this, Je);
|
9618
9580
|
var n;
|
9619
|
-
|
9581
|
+
_this41 = _super37.call(this, Je.createButtonElement(), void 0, {
|
9620
9582
|
styles: (n = t == null ? void 0 : t.button) == null ? void 0 : n.styles
|
9621
9583
|
});
|
9622
|
-
var i =
|
9623
|
-
|
9624
|
-
return
|
9584
|
+
var i = _this41.createInnerElements(_this41._customStyles);
|
9585
|
+
_this41._menu = new tn(e, t == null ? void 0 : t.menu), _this41.addClickEvent(), _this41.buttonContainer = Je.createButtonContainer(), _this41.elementRef.appendChild(i.styles), _this41.buttonContainer.appendChild(_this41.elementRef), _this41.elementRef.classList.add("dropup-icon", "upload-file-button"), _this41.buttonContainer.appendChild(_this41._menu.elementRef), _this41.reapplyStateStyle("styles"), _this41.addContainerEvents(e);
|
9586
|
+
return _this41;
|
9625
9587
|
}
|
9626
9588
|
_createClass(Je, [{
|
9627
9589
|
key: "createInnerElements",
|
@@ -9648,9 +9610,9 @@ var Je = /*#__PURE__*/function (_St) {
|
|
9648
9610
|
}, {
|
9649
9611
|
key: "addContainerEvents",
|
9650
9612
|
value: function addContainerEvents(e) {
|
9651
|
-
var
|
9613
|
+
var _this42 = this;
|
9652
9614
|
e.addEventListener("click", function (t) {
|
9653
|
-
t.target.classList.contains("dropup-icon") ||
|
9615
|
+
t.target.classList.contains("dropup-icon") || _this42._menu.close();
|
9654
9616
|
});
|
9655
9617
|
}
|
9656
9618
|
}], [{
|
@@ -9662,7 +9624,7 @@ var Je = /*#__PURE__*/function (_St) {
|
|
9662
9624
|
}, {
|
9663
9625
|
key: "createSVGIconElement",
|
9664
9626
|
value: function createSVGIconElement() {
|
9665
|
-
var e =
|
9627
|
+
var e = q.createSVGElement(Jo);
|
9666
9628
|
return e.id = "dropup-icon", e;
|
9667
9629
|
}
|
9668
9630
|
}, {
|
@@ -9679,7 +9641,7 @@ var Je = /*#__PURE__*/function (_St) {
|
|
9679
9641
|
}
|
9680
9642
|
}]);
|
9681
9643
|
return Je;
|
9682
|
-
}(
|
9644
|
+
}(wt);
|
9683
9645
|
var F = /*#__PURE__*/function () {
|
9684
9646
|
function F() {
|
9685
9647
|
_classCallCheck(this, F);
|
@@ -9690,7 +9652,7 @@ var F = /*#__PURE__*/function () {
|
|
9690
9652
|
// prettier-ignore
|
9691
9653
|
function addToDropup(e, t, i, n) {
|
9692
9654
|
var r = new Je(i, n);
|
9693
|
-
|
9655
|
+
Sn.forEach(function (a) {
|
9694
9656
|
var l = t["dropup-menu"].findIndex(function (d) {
|
9695
9657
|
return d.buttonType === a;
|
9696
9658
|
}),
|
@@ -9740,7 +9702,7 @@ var F = /*#__PURE__*/function () {
|
|
9740
9702
|
r && F.setPosition(e, n, t[r]);
|
9741
9703
|
}), t["inside-right"].length === 0 && e.submit && F.setPosition(e, "submit", t["inside-right"]), t["outside-right"].length === 0 && (e.submit ? F.setPosition(e, "submit", t["outside-right"]) : e.microphone ? F.setPosition(e, "microphone", t["outside-right"]) : e.camera && F.setPosition(e, "camera", t["outside-right"])), e.submit && F.setPosition(e, "submit", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]), e.microphone && F.setPosition(e, "microphone", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]);
|
9742
9704
|
var i = Object.keys(e);
|
9743
|
-
return i.length > 1 || t["dropup-menu"].length > 0 ?
|
9705
|
+
return i.length > 1 || t["dropup-menu"].length > 0 ? Sn.forEach(function (n) {
|
9744
9706
|
e[n] && t["dropup-menu"].push(_objectSpread(_objectSpread({}, e[n]), {}, {
|
9745
9707
|
buttonType: n
|
9746
9708
|
}));
|
@@ -9785,10 +9747,10 @@ var $o = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\"
|
|
9785
9747
|
var ue = /*#__PURE__*/function () {
|
9786
9748
|
// prettier-ignore
|
9787
9749
|
function ue(e, t, i, n) {
|
9788
|
-
var
|
9750
|
+
var _this43 = this;
|
9789
9751
|
_classCallCheck(this, ue);
|
9790
9752
|
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 () {
|
9791
|
-
|
9753
|
+
_this43._validationHandler = e._validationHandler;
|
9792
9754
|
});
|
9793
9755
|
}
|
9794
9756
|
_createClass(ue, [{
|
@@ -9804,7 +9766,7 @@ var ue = /*#__PURE__*/function () {
|
|
9804
9766
|
var r = ue.createImageAttachment(t);
|
9805
9767
|
this.addFileAttachment(e, "image", r, i);
|
9806
9768
|
} else if (n === "audio") {
|
9807
|
-
var _r2 =
|
9769
|
+
var _r2 = Ui.createAudioAttachment(t);
|
9808
9770
|
this.addFileAttachment(e, "audio", _r2, i);
|
9809
9771
|
} else {
|
9810
9772
|
var _r3 = ue.createAnyFileAttachment(e.name);
|
@@ -9845,7 +9807,7 @@ var ue = /*#__PURE__*/function () {
|
|
9845
9807
|
return r === e;
|
9846
9808
|
}),
|
9847
9809
|
i = this._attachments[t].attachmentContainerElement;
|
9848
|
-
this._attachments.splice(t, 1),
|
9810
|
+
this._attachments.splice(t, 1), Ui.stopAttachmentPlayback(i), i.remove(), this._toggleContainerDisplay(!1), (n = this._validationHandler) == null || n.call(this);
|
9849
9811
|
}
|
9850
9812
|
}, {
|
9851
9813
|
key: "getFiles",
|
@@ -9917,24 +9879,24 @@ var ue = /*#__PURE__*/function () {
|
|
9917
9879
|
return ue;
|
9918
9880
|
}();
|
9919
9881
|
var ea = "<?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>",
|
9920
|
-
|
9882
|
+
wn = "<?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>",
|
9921
9883
|
ps = /*#__PURE__*/function (_ue) {
|
9922
|
-
_inherits(
|
9923
|
-
var _super38 = _createSuper(
|
9884
|
+
_inherits(we, _ue);
|
9885
|
+
var _super38 = _createSuper(we);
|
9924
9886
|
// prettier-ignore
|
9925
|
-
function
|
9926
|
-
_classCallCheck(this,
|
9887
|
+
function we(e, t, i, n) {
|
9888
|
+
_classCallCheck(this, we);
|
9927
9889
|
return _super38.call(this, e, t, i, n);
|
9928
9890
|
}
|
9929
|
-
_createClass(
|
9891
|
+
_createClass(we, [{
|
9930
9892
|
key: "createTimer",
|
9931
9893
|
value: function createTimer(e, t) {
|
9932
|
-
var
|
9894
|
+
var _this44 = this;
|
9933
9895
|
var i = 0;
|
9934
|
-
var n = t !== void 0 && t <
|
9896
|
+
var n = t !== void 0 && t < we.TIMER_LIMIT_S ? t : we.TIMER_LIMIT_S;
|
9935
9897
|
return setInterval(function () {
|
9936
9898
|
var a;
|
9937
|
-
i += 1, i === n && ((a =
|
9899
|
+
i += 1, i === n && ((a = _this44.stopPlaceholderCallback) == null || a.call(_this44), _this44.clearTimer()), i === 600 && e.classList.add("audio-placeholder-text-4-digits");
|
9938
9900
|
var r = Math.floor(i / 60),
|
9939
9901
|
o = (i % 60).toString().padStart(2, "0");
|
9940
9902
|
e.textContent = "".concat(r, ":").concat(o);
|
@@ -9943,18 +9905,18 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9943
9905
|
}, {
|
9944
9906
|
key: "createPlaceholderAudioAttachment",
|
9945
9907
|
value: function createPlaceholderAudioAttachment(e) {
|
9946
|
-
var t =
|
9908
|
+
var t = we.createAudioContainer(),
|
9947
9909
|
i = document.createElement("div");
|
9948
9910
|
i.classList.add("audio-placeholder-text-3-digits");
|
9949
9911
|
var n = document.createElement("div");
|
9950
9912
|
n.classList.add("file-attachment-text-container", "audio-placeholder-text-3-digits-container"), n.appendChild(i);
|
9951
|
-
var r =
|
9913
|
+
var r = q.createSVGElement(wn);
|
9952
9914
|
return r.classList.add("attachment-icon", "stop-icon", "not-removable-attachment-icon"), i.textContent = "0:00", this._activePlaceholderTimer = this.createTimer(i, e), t.appendChild(n), this.addPlaceholderAudioAttachmentEvents(t, r, n), t;
|
9953
9915
|
}
|
9954
9916
|
}, {
|
9955
9917
|
key: "addPlaceholderAudioAttachmentEvents",
|
9956
9918
|
value: function addPlaceholderAudioAttachmentEvents(e, t, i) {
|
9957
|
-
var
|
9919
|
+
var _this45 = this;
|
9958
9920
|
var n = function n() {
|
9959
9921
|
return e.replaceChildren(t);
|
9960
9922
|
};
|
@@ -9965,7 +9927,7 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9965
9927
|
e.addEventListener("mouseleave", r);
|
9966
9928
|
var o = function o() {
|
9967
9929
|
var a;
|
9968
|
-
return (a =
|
9930
|
+
return (a = _this45.stopPlaceholderCallback) == null ? void 0 : a.call(_this45);
|
9969
9931
|
};
|
9970
9932
|
e.addEventListener("click", o);
|
9971
9933
|
}
|
@@ -9980,7 +9942,7 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9980
9942
|
key: "completePlaceholderAttachment",
|
9981
9943
|
value: function completePlaceholderAttachment(e, t) {
|
9982
9944
|
var i = this._activePlaceholderAttachment;
|
9983
|
-
i && (i.file = e,
|
9945
|
+
i && (i.file = e, we.addAudioElements(i.attachmentContainerElement.children[0], t), i.removeButton = this.createRemoveAttachmentButton(i), i.attachmentContainerElement.appendChild(i.removeButton), this._activePlaceholderAttachment = void 0, this.clearTimer());
|
9984
9946
|
}
|
9985
9947
|
}, {
|
9986
9948
|
key: "removePlaceholderAttachment",
|
@@ -10004,9 +9966,9 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10004
9966
|
var i = e.parentElement ? Y.cloneElement(e) : e,
|
10005
9967
|
n = document.createElement("audio");
|
10006
9968
|
n.src = t;
|
10007
|
-
var r =
|
9969
|
+
var r = q.createSVGElement(ea);
|
10008
9970
|
r.classList.add("attachment-icon", "play-icon");
|
10009
|
-
var o =
|
9971
|
+
var o = q.createSVGElement(wn);
|
10010
9972
|
o.classList.add("attachment-icon", "stop-icon"), i.replaceChildren(r), n.onplay = function () {
|
10011
9973
|
i.replaceChildren(o);
|
10012
9974
|
}, n.onpause = function () {
|
@@ -10020,8 +9982,8 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10020
9982
|
}, {
|
10021
9983
|
key: "createAudioAttachment",
|
10022
9984
|
value: function createAudioAttachment(e) {
|
10023
|
-
var t =
|
10024
|
-
return
|
9985
|
+
var t = we.createAudioContainer();
|
9986
|
+
return we.addAudioElements(t, e), t;
|
10025
9987
|
}
|
10026
9988
|
}, {
|
10027
9989
|
key: "stopAttachmentPlayback",
|
@@ -10030,10 +9992,10 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10030
9992
|
(n = (i = (t = e.children[0]) == null ? void 0 : t.children) == null ? void 0 : i[0]) != null && n.classList.contains("stop-icon") && e.children[0].click();
|
10031
9993
|
}
|
10032
9994
|
}]);
|
10033
|
-
return
|
9995
|
+
return we;
|
10034
9996
|
}(ue);
|
10035
9997
|
ps.TIMER_LIMIT_S = 5999;
|
10036
|
-
var
|
9998
|
+
var Ui = ps;
|
10037
9999
|
var ta = /*#__PURE__*/function () {
|
10038
10000
|
function ta() {
|
10039
10001
|
_classCallCheck(this, ta);
|
@@ -10043,20 +10005,20 @@ var ta = /*#__PURE__*/function () {
|
|
10043
10005
|
value:
|
10044
10006
|
// prettier-ignore
|
10045
10007
|
function create(e, t, i, n, r) {
|
10046
|
-
return r === "audio" ? new
|
10008
|
+
return r === "audio" ? new Ui(e, t, i, n) : new ue(e, t, i, n);
|
10047
10009
|
}
|
10048
10010
|
}]);
|
10049
10011
|
return ta;
|
10050
10012
|
}();
|
10051
|
-
var
|
10052
|
-
function
|
10053
|
-
_classCallCheck(this,
|
10013
|
+
var _t = /*#__PURE__*/function () {
|
10014
|
+
function _t(e, t, i) {
|
10015
|
+
_classCallCheck(this, _t);
|
10054
10016
|
this._fileAttachmentsTypes = [], this.elementRef = this.createAttachmentContainer();
|
10055
10017
|
var n = _typeof(i) == "object" && !!i.displayFileAttachmentContainer;
|
10056
10018
|
this.toggleContainerDisplay(n), e.appendChild(this.elementRef), t && Object.assign(this.elementRef.style, t);
|
10057
10019
|
}
|
10058
10020
|
// prettier-ignore
|
10059
|
-
_createClass(
|
10021
|
+
_createClass(_t, [{
|
10060
10022
|
key: "addType",
|
10061
10023
|
value: function addType(e, t, i) {
|
10062
10024
|
var n = ta.create(e, t, this.toggleContainerDisplay.bind(this), this.elementRef, i);
|
@@ -10120,7 +10082,7 @@ var wt = /*#__PURE__*/function () {
|
|
10120
10082
|
}, {
|
10121
10083
|
key: "addFilesToAnyType",
|
10122
10084
|
value: function addFilesToAnyType(e) {
|
10123
|
-
|
10085
|
+
_t.addFilesToType(e, this._fileAttachmentsTypes);
|
10124
10086
|
}
|
10125
10087
|
}, {
|
10126
10088
|
key: "removeAllFiles",
|
@@ -10145,12 +10107,12 @@ var wt = /*#__PURE__*/function () {
|
|
10145
10107
|
});
|
10146
10108
|
}
|
10147
10109
|
}]);
|
10148
|
-
return
|
10110
|
+
return _t;
|
10149
10111
|
}();
|
10150
10112
|
var fs = /*#__PURE__*/function () {
|
10151
10113
|
function le(e, t, i) {
|
10152
10114
|
_classCallCheck(this, le);
|
10153
|
-
this._isOpen = !1, this._contentRef = le.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = le.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = le.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = le.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents();
|
10115
|
+
this._isOpen = !1, this._contentRef = le.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = le.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = le.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = le.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents(e);
|
10154
10116
|
}
|
10155
10117
|
_createClass(le, [{
|
10156
10118
|
key: "isOpen",
|
@@ -10160,20 +10122,20 @@ var fs = /*#__PURE__*/function () {
|
|
10160
10122
|
}, {
|
10161
10123
|
key: "addButtons",
|
10162
10124
|
value: function addButtons() {
|
10163
|
-
var
|
10125
|
+
var _this46 = this;
|
10164
10126
|
for (var _len2 = arguments.length, e = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
10165
10127
|
e[_key2] = arguments[_key2];
|
10166
10128
|
}
|
10167
10129
|
e.forEach(function (t) {
|
10168
|
-
return
|
10130
|
+
return _this46._buttonPanel.appendChild(t);
|
10169
10131
|
});
|
10170
10132
|
}
|
10171
10133
|
}, {
|
10172
10134
|
key: "close",
|
10173
10135
|
value: function close() {
|
10174
|
-
var
|
10136
|
+
var _this47 = this;
|
10175
10137
|
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 () {
|
10176
|
-
|
10138
|
+
_this47._elementRef.style.display = "none", _this47._backgroundPanelRef.style.display = "none";
|
10177
10139
|
}, le.MODAL_CLOSE_TIMEOUT_MS);
|
10178
10140
|
}
|
10179
10141
|
}, {
|
@@ -10189,22 +10151,24 @@ var fs = /*#__PURE__*/function () {
|
|
10189
10151
|
}, {
|
10190
10152
|
key: "addCloseButton",
|
10191
10153
|
value: function addCloseButton(e, t, i) {
|
10192
|
-
var
|
10154
|
+
var _this48 = this;
|
10193
10155
|
var n = t ? le.createSVGButton(e) : le.createTextButton(e);
|
10194
10156
|
return this.addButtons(n), n.onclick = function () {
|
10195
|
-
|
10157
|
+
_this48.close(), setTimeout(function () {
|
10196
10158
|
i == null || i();
|
10197
10159
|
}, 140);
|
10198
10160
|
}, n;
|
10199
10161
|
}
|
10200
10162
|
}, {
|
10201
10163
|
key: "addWindowEvents",
|
10202
|
-
value: function addWindowEvents() {
|
10203
|
-
|
10204
|
-
|
10205
|
-
|
10206
|
-
|
10207
|
-
|
10164
|
+
value: function addWindowEvents(e) {
|
10165
|
+
this.keyDownEvent = this.windowKeyDown.bind(this, e), window.addEventListener("keydown", this.keyDownEvent);
|
10166
|
+
}
|
10167
|
+
}, {
|
10168
|
+
key: "windowKeyDown",
|
10169
|
+
value: function windowKeyDown(e, t) {
|
10170
|
+
var i, n;
|
10171
|
+
!e.isConnected && this.keyDownEvent ? window.removeEventListener("keydown", this.keyDownEvent) : this._isOpen && (t.key === R.ESCAPE ? (this.close(), (i = this.extensionCloseCallback) == null || i.call(this)) : t.key === R.ENTER && (this.close(), (n = this.extensionCloseCallback) == null || n.call(this)));
|
10208
10172
|
}
|
10209
10173
|
}], [{
|
10210
10174
|
key: "createContainer",
|
@@ -10242,7 +10206,7 @@ var fs = /*#__PURE__*/function () {
|
|
10242
10206
|
value: function createSVGButton(e) {
|
10243
10207
|
var t = document.createElement("div");
|
10244
10208
|
t.classList.add("modal-button", "modal-svg-button");
|
10245
|
-
var i =
|
10209
|
+
var i = q.createSVGElement(e);
|
10246
10210
|
return i.classList.add("modal-svg-button-icon"), t.appendChild(i), t;
|
10247
10211
|
}
|
10248
10212
|
}, {
|
@@ -10259,18 +10223,18 @@ var fs = /*#__PURE__*/function () {
|
|
10259
10223
|
}();
|
10260
10224
|
fs.MODAL_CLOSE_TIMEOUT_MS = 190;
|
10261
10225
|
var at = fs;
|
10262
|
-
var ut = /*#__PURE__*/function (
|
10263
|
-
_inherits(ut,
|
10226
|
+
var ut = /*#__PURE__*/function (_wt2) {
|
10227
|
+
_inherits(ut, _wt2);
|
10264
10228
|
var _super39 = _createSuper(ut);
|
10265
10229
|
// prettier-ignore
|
10266
10230
|
function ut(e, t, i, n, r, o) {
|
10267
|
-
var
|
10231
|
+
var _this49;
|
10268
10232
|
_classCallCheck(this, ut);
|
10269
10233
|
var l, c, d, u, h, p;
|
10270
|
-
|
10271
|
-
var a =
|
10272
|
-
|
10273
|
-
return
|
10234
|
+
_this49 = _super39.call(this, ut.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o);
|
10235
|
+
var a = _this49.createInnerElements(n, r, _this49._customStyles);
|
10236
|
+
_this49._inputElement = ut.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this49.addClickEvent(e, i), _this49.elementRef.replaceChildren(a.styles), _this49.reapplyStateStyle("styles"), _this49._fileAttachmentsType = t, _this49._openModalOnce = ((u = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : u.openModalOnce) === !1 || (p = (h = i.files) == null ? void 0 : h.infoModal) == null ? void 0 : p.openModalOnce;
|
10237
|
+
return _this49;
|
10274
10238
|
}
|
10275
10239
|
_createClass(ut, [{
|
10276
10240
|
key: "createInnerElements",
|
@@ -10288,7 +10252,7 @@ var ut = /*#__PURE__*/function (_St2) {
|
|
10288
10252
|
}, {
|
10289
10253
|
key: "import",
|
10290
10254
|
value: function _import(e) {
|
10291
|
-
|
10255
|
+
_t.addFilesToType(Array.from(e.files || []), [this._fileAttachmentsType]), e.value = "";
|
10292
10256
|
}
|
10293
10257
|
}, {
|
10294
10258
|
key: "createInnerElement",
|
@@ -10322,12 +10286,12 @@ var ut = /*#__PURE__*/function (_St2) {
|
|
10322
10286
|
}, {
|
10323
10287
|
key: "createSVGIconElement",
|
10324
10288
|
value: function createSVGIconElement(e, t) {
|
10325
|
-
var i =
|
10289
|
+
var i = q.createSVGElement(t);
|
10326
10290
|
return i.id = e, i;
|
10327
10291
|
}
|
10328
10292
|
}]);
|
10329
10293
|
return ut;
|
10330
|
-
}(
|
10294
|
+
}(wt);
|
10331
10295
|
var de = /*#__PURE__*/function () {
|
10332
10296
|
function de() {
|
10333
10297
|
_classCallCheck(this, de);
|
@@ -10484,14 +10448,14 @@ var Me = /*#__PURE__*/function () {
|
|
10484
10448
|
return Me;
|
10485
10449
|
}();
|
10486
10450
|
var ia = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg height=\"1.4em\" width=\"1.4em\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t viewBox=\"0 0 490.9 490.9\" xml:space=\"preserve\">\n\t<g>\n\t\t<g>\n\t\t\t<path d=\"M245.5,322.9c53,0,96.2-43.2,96.2-96.2V96.2c0-53-43.2-96.2-96.2-96.2s-96.2,43.2-96.2,96.2v130.5\n\t\t\t\tC149.3,279.8,192.5,322.9,245.5,322.9z M173.8,96.2c0-39.5,32.2-71.7,71.7-71.7s71.7,32.2,71.7,71.7v130.5\n\t\t\t\tc0,39.5-32.2,71.7-71.7,71.7s-71.7-32.2-71.7-71.7V96.2z\"/>\n\t\t\t<path d=\"M94.4,214.5c-6.8,0-12.3,5.5-12.3,12.3c0,85.9,66.7,156.6,151.1,162.8v76.7h-63.9c-6.8,0-12.3,5.5-12.3,12.3\n\t\t\t\ts5.5,12.3,12.3,12.3h152.3c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3h-63.9v-76.7c84.4-6.3,151.1-76.9,151.1-162.8\n\t\t\t\tc0-6.8-5.5-12.3-12.3-12.3s-12.3,5.5-12.3,12.3c0,76.6-62.3,138.9-138.9,138.9s-138.9-62.3-138.9-138.9\n\t\t\t\tC106.6,220,101.2,214.5,94.4,214.5z\"/>\n\t\t</g>\n\t</g>\n</svg>\n";
|
10487
|
-
var bt = /*#__PURE__*/function (
|
10488
|
-
_inherits(bt,
|
10451
|
+
var bt = /*#__PURE__*/function (_wt3) {
|
10452
|
+
_inherits(bt, _wt3);
|
10489
10453
|
var _super40 = _createSuper(bt);
|
10490
10454
|
function bt(e) {
|
10491
|
-
var
|
10455
|
+
var _this50;
|
10492
10456
|
_classCallCheck(this, bt);
|
10493
|
-
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"),
|
10494
|
-
return
|
10457
|
+
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this50 = _super40.call(this, bt.createMicrophoneElement(), e == null ? void 0 : e.position, e), _this50.isActive = !1, _this50._innerElements = _this50.createInnerElements(_this50._customStyles), _this50.changeToDefault();
|
10458
|
+
return _this50;
|
10495
10459
|
}
|
10496
10460
|
_createClass(bt, [{
|
10497
10461
|
key: "createInnerElements",
|
@@ -10555,12 +10519,12 @@ var bt = /*#__PURE__*/function (_St3) {
|
|
10555
10519
|
}, {
|
10556
10520
|
key: "createSVGIconElement",
|
10557
10521
|
value: function createSVGIconElement() {
|
10558
|
-
var e =
|
10522
|
+
var e = q.createSVGElement(ia);
|
10559
10523
|
return e.id = "microphone-icon", e;
|
10560
10524
|
}
|
10561
10525
|
}]);
|
10562
10526
|
return bt;
|
10563
|
-
}(
|
10527
|
+
}(wt);
|
10564
10528
|
var ms = {},
|
10565
10529
|
oi = {},
|
10566
10530
|
ai = {},
|
@@ -10628,7 +10592,7 @@ Object.defineProperty(ai, "__esModule", {
|
|
10628
10592
|
value: !0
|
10629
10593
|
});
|
10630
10594
|
ai.WebSpeechTranscript = void 0;
|
10631
|
-
var
|
10595
|
+
var _n = Mt;
|
10632
10596
|
var ra = /*#__PURE__*/function () {
|
10633
10597
|
function ra() {
|
10634
10598
|
_classCallCheck(this, ra);
|
@@ -10639,7 +10603,7 @@ var ra = /*#__PURE__*/function () {
|
|
10639
10603
|
var n = "";
|
10640
10604
|
for (var r = e.resultIndex; r < e.results.length; ++r) {
|
10641
10605
|
var o = e.results[r][0].transcript;
|
10642
|
-
i && (o =
|
10606
|
+
i && (o = _n.Translate.translate(o, i)), e.results[r].isFinal ? t += o : n += o;
|
10643
10607
|
}
|
10644
10608
|
return {
|
10645
10609
|
interimTranscript: n,
|
@@ -10654,7 +10618,7 @@ var ra = /*#__PURE__*/function () {
|
|
10654
10618
|
var r = "";
|
10655
10619
|
for (var o = e.resultIndex; o < e.results.length; ++o) {
|
10656
10620
|
var a = e.results[o][0].transcript;
|
10657
|
-
i && (a =
|
10621
|
+
i && (a = _n.Translate.translate(a, i)), n += a;
|
10658
10622
|
}
|
10659
10623
|
return {
|
10660
10624
|
interimTranscript: r,
|
@@ -10698,9 +10662,9 @@ var J = /*#__PURE__*/function () {
|
|
10698
10662
|
}, {
|
10699
10663
|
key: "keyDownWindow",
|
10700
10664
|
value: function keyDownWindow(e) {
|
10701
|
-
var
|
10665
|
+
var _this51 = this;
|
10702
10666
|
e.element && J.getElementIfFocusedOnAvailable(e.element, document.activeElement) && (J.KEY_DOWN_TIMEOUT !== null && clearTimeout(J.KEY_DOWN_TIMEOUT), J.KEY_DOWN_TIMEOUT = setTimeout(function () {
|
10703
|
-
J.KEY_DOWN_TIMEOUT = null,
|
10667
|
+
J.KEY_DOWN_TIMEOUT = null, _this51.resetRecording(e);
|
10704
10668
|
}, 500));
|
10705
10669
|
}
|
10706
10670
|
}, {
|
@@ -11102,7 +11066,7 @@ Object.defineProperty(ui, "__esModule", {
|
|
11102
11066
|
ui.Padding = void 0;
|
11103
11067
|
var ua = je,
|
11104
11068
|
An = Fe,
|
11105
|
-
|
11069
|
+
Ue = De;
|
11106
11070
|
var Kt = /*#__PURE__*/function () {
|
11107
11071
|
function Kt() {
|
11108
11072
|
_classCallCheck(this, Kt);
|
@@ -11115,11 +11079,11 @@ var Kt = /*#__PURE__*/function () {
|
|
11115
11079
|
r = t.value[n - 1],
|
11116
11080
|
o = t.selectionEnd === null ? n : t.selectionEnd,
|
11117
11081
|
a = t.value[o];
|
11118
|
-
|
11082
|
+
Ue.Text.isCharDefined(r) && (e.startPadding = " ", e.numberOfSpacesBeforeNewText = 1), Ue.Text.isCharDefined(a) && (e.endPadding = " ", e.numberOfSpacesAfterNewText = 1), e.isCursorAtEnd = t.value.length === o;
|
11119
11083
|
return;
|
11120
11084
|
}
|
11121
11085
|
var i = t.value[t.value.length - 1];
|
11122
|
-
|
11086
|
+
Ue.Text.isCharDefined(i) && (e.startPadding = " ", e.numberOfSpacesBeforeNewText = 1), e.isCursorAtEnd = !0;
|
11123
11087
|
}
|
11124
11088
|
}, {
|
11125
11089
|
key: "setStateForGenericElement",
|
@@ -11132,12 +11096,12 @@ var Kt = /*#__PURE__*/function () {
|
|
11132
11096
|
c = (i = t.textContent) === null || i === void 0 ? void 0 : i[l - 1],
|
11133
11097
|
d = An.Cursor.getGenericElementCursorOffset(t, a, !1),
|
11134
11098
|
u = (n = t.textContent) === null || n === void 0 ? void 0 : n[d];
|
11135
|
-
|
11099
|
+
Ue.Text.isCharDefined(c) && (e.startPadding = " "), Ue.Text.isCharDefined(u) && (e.endPadding = " "), e.isCursorAtEnd = ((r = t.textContent) === null || r === void 0 ? void 0 : r.length) === d;
|
11136
11100
|
return;
|
11137
11101
|
}
|
11138
11102
|
}
|
11139
11103
|
var o = t.innerText.charAt(t.innerText.length - 1);
|
11140
|
-
|
11104
|
+
Ue.Text.isCharDefined(o) && (e.startPadding = " "), e.isCursorAtEnd = !0;
|
11141
11105
|
}
|
11142
11106
|
}, {
|
11143
11107
|
key: "setState",
|
@@ -11321,22 +11285,22 @@ var Jt = /*#__PURE__*/function (_fa$Speech) {
|
|
11321
11285
|
}, {
|
11322
11286
|
key: "setEvents",
|
11323
11287
|
value: function setEvents() {
|
11324
|
-
var
|
11288
|
+
var _this52 = this;
|
11325
11289
|
this._service && (this._service.onstart = function () {
|
11326
|
-
|
11290
|
+
_this52.setStateOnStart();
|
11327
11291
|
}, this._service.onerror = function (e) {
|
11328
|
-
Nn.Browser.IS_SAFARI() && e.message === "Another request is started" || e.error === "aborted" &&
|
11292
|
+
Nn.Browser.IS_SAFARI() && e.message === "Another request is started" || e.error === "aborted" && _this52.isRestarting || e.error !== "no-speech" && _this52.error(e.message || e.error);
|
11329
11293
|
}, this._service.onaudioend = function () {
|
11330
|
-
|
11294
|
+
_this52.setStateOnStop();
|
11331
11295
|
}, this._service.onend = function () {
|
11332
|
-
|
11296
|
+
_this52._stopping = !1;
|
11333
11297
|
}, this._service.onresult = function (e) {
|
11334
|
-
if (_typeof(e.results) > "u" &&
|
11335
|
-
var
|
11336
|
-
t =
|
11337
|
-
_i17 =
|
11338
|
-
n =
|
11339
|
-
|
11298
|
+
if (_typeof(e.results) > "u" && _this52._service) _this52._service.onend = null, _this52._service.stop();else if (_this52._extractText && !_this52._stopping) {
|
11299
|
+
var _this52$_extractText = _this52._extractText(e, _this52.finalTranscript, _this52._translations),
|
11300
|
+
t = _this52$_extractText.interimTranscript,
|
11301
|
+
_i17 = _this52$_extractText.finalTranscript,
|
11302
|
+
n = _this52$_extractText.newText;
|
11303
|
+
_this52.updateElements(t, _i17, n);
|
11340
11304
|
}
|
11341
11305
|
});
|
11342
11306
|
}
|
@@ -11556,10 +11520,10 @@ var Yt = /*#__PURE__*/function (_va$Speech) {
|
|
11556
11520
|
_inherits(Yt, _va$Speech);
|
11557
11521
|
var _super42 = _createSuper(Yt);
|
11558
11522
|
function Yt() {
|
11559
|
-
var
|
11523
|
+
var _this53;
|
11560
11524
|
_classCallCheck(this, Yt);
|
11561
|
-
|
11562
|
-
return
|
11525
|
+
_this53 = _super42.apply(this, arguments), _this53._newTextPadding = "";
|
11526
|
+
return _this53;
|
11563
11527
|
}
|
11564
11528
|
_createClass(Yt, [{
|
11565
11529
|
key: "start",
|
@@ -11687,12 +11651,12 @@ var Yt = /*#__PURE__*/function (_va$Speech) {
|
|
11687
11651
|
}, {
|
11688
11652
|
key: "retrieveTokenInterval",
|
11689
11653
|
value: function retrieveTokenInterval(e) {
|
11690
|
-
var
|
11654
|
+
var _this54 = this;
|
11691
11655
|
this._retrieveTokenInterval = setInterval(function () {
|
11692
11656
|
e == null || e().then(function (t) {
|
11693
|
-
|
11657
|
+
_this54._service && (_this54._service.authorizationToken = (t == null ? void 0 : t.trim()) || "");
|
11694
11658
|
})["catch"](function (t) {
|
11695
|
-
|
11659
|
+
_this54.error(t);
|
11696
11660
|
});
|
11697
11661
|
}, 1e4);
|
11698
11662
|
}
|
@@ -11774,18 +11738,18 @@ var Zt = /*#__PURE__*/function (_bt) {
|
|
11774
11738
|
_inherits(Zt, _bt);
|
11775
11739
|
var _super43 = _createSuper(Zt);
|
11776
11740
|
function Zt(e, t, i) {
|
11777
|
-
var
|
11741
|
+
var _this55;
|
11778
11742
|
_classCallCheck(this, Zt);
|
11779
11743
|
var o;
|
11780
|
-
|
11744
|
+
_this55 = _super43.call(this, _typeof(e.speechToText) == "object" ? (o = e.speechToText) == null ? void 0 : o.button : {});
|
11781
11745
|
var _Zt$processConfigurat = Zt.processConfiguration(t, e.speechToText),
|
11782
11746
|
n = _Zt$processConfigurat.serviceName,
|
11783
11747
|
r = _Zt$processConfigurat.processedConfig;
|
11784
|
-
if (
|
11748
|
+
if (_this55._addErrorMessage = i, n === "webspeech" && !Li.isWebSpeechSupported()) _this55.changeToUnsupported();else {
|
11785
11749
|
var a = !e.textInput || !e.textInput.disabled;
|
11786
|
-
|
11750
|
+
_this55.elementRef.onclick = _this55.buttonClick.bind(_assertThisInitialized(_this55), t, a, n, r);
|
11787
11751
|
}
|
11788
|
-
return
|
11752
|
+
return _this55;
|
11789
11753
|
}
|
11790
11754
|
// prettier-ignore
|
11791
11755
|
_createClass(Zt, [{
|
@@ -11866,11 +11830,11 @@ var Ea = /*#__PURE__*/function (_bt2) {
|
|
11866
11830
|
_inherits(Ea, _bt2);
|
11867
11831
|
var _super44 = _createSuper(Ea);
|
11868
11832
|
function Ea(e, t) {
|
11869
|
-
var
|
11833
|
+
var _this56;
|
11870
11834
|
_classCallCheck(this, Ea);
|
11871
11835
|
var i, n;
|
11872
|
-
|
11873
|
-
return
|
11836
|
+
_this56 = _super44.call(this, t.button), _this56._waitingForBrowserApproval = !1, _this56._audioType = e, _this56._extension = ((i = t.files) == null ? void 0 : i.format) || "mp3", _this56._maxDurationSeconds = (n = t.files) == null ? void 0 : n.maxDurationSeconds, _this56.elementRef.onclick = _this56.buttonClick.bind(_assertThisInitialized(_this56));
|
11837
|
+
return _this56;
|
11874
11838
|
}
|
11875
11839
|
_createClass(Ea, [{
|
11876
11840
|
key: "buttonClick",
|
@@ -11880,10 +11844,10 @@ var Ea = /*#__PURE__*/function (_bt2) {
|
|
11880
11844
|
}, {
|
11881
11845
|
key: "stop",
|
11882
11846
|
value: function stop() {
|
11883
|
-
var
|
11847
|
+
var _this57 = this;
|
11884
11848
|
return new Promise(function (e) {
|
11885
11849
|
var t, i;
|
11886
|
-
|
11850
|
+
_this57.changeToDefault(), (t = _this57._mediaRecorder) == null || t.stop(), (i = _this57._mediaStream) == null || i.getTracks().forEach(function (n) {
|
11887
11851
|
return n.stop();
|
11888
11852
|
}), setTimeout(function () {
|
11889
11853
|
e();
|
@@ -11893,23 +11857,23 @@ var Ea = /*#__PURE__*/function (_bt2) {
|
|
11893
11857
|
}, {
|
11894
11858
|
key: "record",
|
11895
11859
|
value: function record() {
|
11896
|
-
var
|
11860
|
+
var _this58 = this;
|
11897
11861
|
navigator.mediaDevices.getUserMedia({
|
11898
11862
|
audio: !0
|
11899
11863
|
}).then(function (e) {
|
11900
|
-
|
11901
|
-
|
11902
|
-
}),
|
11864
|
+
_this58.changeToActive(), _this58._mediaRecorder = new MediaRecorder(e), _this58._audioType.addPlaceholderAttachment(_this58.stop.bind(_this58), _this58._maxDurationSeconds), _this58._mediaStream = e, _this58._mediaRecorder.addEventListener("dataavailable", function (t) {
|
11865
|
+
_this58.createFile(t);
|
11866
|
+
}), _this58._mediaRecorder.start();
|
11903
11867
|
})["catch"](function (e) {
|
11904
|
-
console.error(e),
|
11868
|
+
console.error(e), _this58.stop();
|
11905
11869
|
})["finally"](function () {
|
11906
|
-
|
11870
|
+
_this58._waitingForBrowserApproval = !1;
|
11907
11871
|
});
|
11908
11872
|
}
|
11909
11873
|
}, {
|
11910
11874
|
key: "createFile",
|
11911
11875
|
value: function createFile(e) {
|
11912
|
-
var
|
11876
|
+
var _this59 = this;
|
11913
11877
|
var t = new Blob([e.data], {
|
11914
11878
|
type: "audio/".concat(this._extension)
|
11915
11879
|
}),
|
@@ -11919,13 +11883,13 @@ var Ea = /*#__PURE__*/function (_bt2) {
|
|
11919
11883
|
}),
|
11920
11884
|
r = new FileReader();
|
11921
11885
|
r.readAsDataURL(n), r.onload = function (o) {
|
11922
|
-
|
11886
|
+
_this59._audioType.completePlaceholderAttachment(n, o.target.result);
|
11923
11887
|
};
|
11924
11888
|
}
|
11925
11889
|
}]);
|
11926
11890
|
return Ea;
|
11927
11891
|
}(bt);
|
11928
|
-
var
|
11892
|
+
var Sa = "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n<svg xmlns=\"http://www.w3.org/2000/svg\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"1\" viewBox=\"0 0 24 24\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"14\"></line>\n <polygon points=\"22 2 15 22 11 14 2 10 22 2\"></polygon>\n</svg>\n";
|
11929
11893
|
var B = /*#__PURE__*/function () {
|
11930
11894
|
function B() {
|
11931
11895
|
_classCallCheck(this, B);
|
@@ -11994,24 +11958,24 @@ var Ce = /*#__PURE__*/function () {
|
|
11994
11958
|
}]);
|
11995
11959
|
return Ce;
|
11996
11960
|
}();
|
11997
|
-
var yi = /*#__PURE__*/function (
|
11998
|
-
_inherits(k,
|
11961
|
+
var yi = /*#__PURE__*/function (_wt4) {
|
11962
|
+
_inherits(k, _wt4);
|
11999
11963
|
var _super45 = _createSuper(k);
|
12000
11964
|
// prettier-ignore
|
12001
11965
|
function k(e, t, i, n, r) {
|
12002
|
-
var
|
11966
|
+
var _this60;
|
12003
11967
|
_classCallCheck(this, k);
|
12004
11968
|
var o = Ce.process(e.submitButtonStyles);
|
12005
|
-
|
11969
|
+
_this60 = _super45.call(this, k.createButtonContainerElement(), o == null ? void 0 : o.position, o), _this60._isSVGLoadingIconOverriden = !1, _this60.status = {
|
12006
11970
|
requestInProgress: !1,
|
12007
11971
|
loadingActive: !1
|
12008
|
-
},
|
11972
|
+
}, _this60._messages = i, _this60._inputElementRef = t, _this60._fileAttachments = r, _this60._innerElements = _this60.createInnerElements(), _this60._abortStream = new AbortController(), _this60._stopClicked = {
|
12009
11973
|
listener: function listener() {}
|
12010
|
-
},
|
11974
|
+
}, _this60._serviceIO = n, _this60._alwaysEnabled = !!(o != null && o.alwaysEnabled), e.disableSubmitButton = _this60.disableSubmitButton.bind(_assertThisInitialized(_this60), n), _this60.attemptOverwriteLoadingStyle(e), setTimeout(function () {
|
12011
11975
|
var a;
|
12012
|
-
|
11976
|
+
_this60._validationHandler = e._validationHandler, _this60.assignHandlers(_this60._validationHandler), (a = _this60._validationHandler) == null || a.call(_assertThisInitialized(_this60));
|
12013
11977
|
});
|
12014
|
-
return
|
11978
|
+
return _this60;
|
12015
11979
|
}
|
12016
11980
|
// prettier-ignore
|
12017
11981
|
_createClass(k, [{
|
@@ -12100,7 +12064,7 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12100
12064
|
key: "programmaticSubmit",
|
12101
12065
|
value: function () {
|
12102
12066
|
var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee100(e) {
|
12103
|
-
var
|
12067
|
+
var _this61 = this;
|
12104
12068
|
var t;
|
12105
12069
|
return _regeneratorRuntime().wrap(function _callee100$(_context100) {
|
12106
12070
|
while (1) switch (_context100.prev = _context100.next) {
|
@@ -12115,7 +12079,7 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12115
12079
|
type: ue.getTypeFromBlob(i)
|
12116
12080
|
};
|
12117
12081
|
})), setTimeout(function () {
|
12118
|
-
return
|
12082
|
+
return _this61.attemptSubmit(t, !0);
|
12119
12083
|
});
|
12120
12084
|
case 3:
|
12121
12085
|
case "end":
|
@@ -12159,7 +12123,7 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12159
12123
|
return this.addNewMessage(e);
|
12160
12124
|
case 10:
|
12161
12125
|
this._serviceIO.isWebModel() || this._messages.addLoadingMessage();
|
12162
|
-
|
12126
|
+
qi.clear(this._inputElementRef);
|
12163
12127
|
i = (o = e.files) == null ? void 0 : o.map(function (l) {
|
12164
12128
|
return l.file;
|
12165
12129
|
}), n = {
|
@@ -12262,7 +12226,7 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12262
12226
|
}, {
|
12263
12227
|
key: "createSubmitIconElement",
|
12264
12228
|
value: function createSubmitIconElement() {
|
12265
|
-
var e =
|
12229
|
+
var e = q.createSVGElement(Sa);
|
12266
12230
|
return e.id = "submit-icon", e;
|
12267
12231
|
}
|
12268
12232
|
}, {
|
@@ -12279,12 +12243,12 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12279
12243
|
}
|
12280
12244
|
}]);
|
12281
12245
|
return k;
|
12282
|
-
}(
|
12246
|
+
}(wt);
|
12283
12247
|
yi.SUBMIT_CLASS = "submit-button";
|
12284
12248
|
yi.LOADING_CLASS = "loading-button";
|
12285
12249
|
yi.DISABLED_CLASS = "disabled-button";
|
12286
|
-
var
|
12287
|
-
var
|
12250
|
+
var wa = yi;
|
12251
|
+
var _a = "<?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",
|
12288
12252
|
Ma = "<?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",
|
12289
12253
|
Ta = "<?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>",
|
12290
12254
|
Ca = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M4.89163 13.2687L9.16582 17.5427L18.7085 8\" stroke=\"#000000\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
|
@@ -12293,14 +12257,14 @@ var sn = /*#__PURE__*/function (_at) {
|
|
12293
12257
|
var _super46 = _createSuper(sn);
|
12294
12258
|
// prettier-ignore
|
12295
12259
|
function sn(e, t, i, n) {
|
12296
|
-
var
|
12260
|
+
var _this62;
|
12297
12261
|
_classCallCheck(this, sn);
|
12298
|
-
|
12299
|
-
var
|
12300
|
-
r =
|
12301
|
-
o =
|
12302
|
-
|
12303
|
-
return
|
12262
|
+
_this62 = _super46.call(this, e, ["modal-content", "modal-camera-content"], i), _this62._stopped = !1, _this62._format = "image/png", _this62._canvas = document.createElement("canvas"), _this62._canvas.classList.add("camera-modal-canvas");
|
12263
|
+
var _this62$addButtonsAnd = _this62.addButtonsAndTheirEvents(t),
|
12264
|
+
r = _this62$addButtonsAnd.captureButton,
|
12265
|
+
o = _this62$addButtonsAnd.submitButton;
|
12266
|
+
_this62._captureButton = r, _this62._submitButton = o, _this62._captureIcon = _this62._captureButton.children[0], _this62._refreshIcon = q.createSVGElement(_a), _this62._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (n == null ? void 0 : n.format) === "jpeg" && (_this62._format = "image/jpeg"), n != null && n.dimensions && (_this62._dimensions = n.dimensions), _this62._contentRef.appendChild(_this62._canvas), _this62.extensionCloseCallback = _this62.stop;
|
12267
|
+
return _this62;
|
12304
12268
|
}
|
12305
12269
|
_createClass(sn, [{
|
12306
12270
|
key: "addButtonsAndTheirEvents",
|
@@ -12319,38 +12283,38 @@ var sn = /*#__PURE__*/function (_at) {
|
|
12319
12283
|
}, {
|
12320
12284
|
key: "addButtonEvents",
|
12321
12285
|
value: function addButtonEvents(e, t, i, n) {
|
12322
|
-
var
|
12286
|
+
var _this63 = this;
|
12323
12287
|
e.onclick = function () {
|
12324
|
-
|
12288
|
+
_this63.capture();
|
12325
12289
|
}, t.addEventListener("click", this.stop.bind(this)), i.onclick = function () {
|
12326
|
-
var r =
|
12327
|
-
r &&
|
12290
|
+
var r = _this63.getFile();
|
12291
|
+
r && _t.addFilesToType([r], [n]), _this63.stop(), _this63.close();
|
12328
12292
|
};
|
12329
12293
|
}
|
12330
12294
|
}, {
|
12331
12295
|
key: "stop",
|
12332
12296
|
value: function stop() {
|
12333
|
-
var
|
12297
|
+
var _this64 = this;
|
12334
12298
|
this._mediaStream && this._mediaStream.getTracks().forEach(function (e) {
|
12335
12299
|
return e.stop();
|
12336
12300
|
}), this._stopped = !0, setTimeout(function () {
|
12337
|
-
|
12338
|
-
var e =
|
12339
|
-
e == null || e.clearRect(0, 0,
|
12301
|
+
_this64._captureButton.replaceChildren(_this64._captureIcon), _this64._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
|
12302
|
+
var e = _this64._canvas.getContext("2d");
|
12303
|
+
e == null || e.clearRect(0, 0, _this64._canvas.width, _this64._canvas.height);
|
12340
12304
|
}, at.MODAL_CLOSE_TIMEOUT_MS);
|
12341
12305
|
}
|
12342
12306
|
}, {
|
12343
12307
|
key: "start",
|
12344
12308
|
value: function start() {
|
12345
|
-
var
|
12309
|
+
var _this65 = this;
|
12346
12310
|
this._dataURL = void 0, this._submitButton.classList.add("modal-svg-submit-disabled"), this._stopped = !1, navigator.mediaDevices.getUserMedia({
|
12347
12311
|
video: this._dimensions || !0
|
12348
12312
|
}).then(function (e) {
|
12349
|
-
if (
|
12313
|
+
if (_this65._mediaStream = e, !_this65.isOpen()) return _this65.stop();
|
12350
12314
|
var t = document.createElement("video");
|
12351
|
-
t.srcObject = e, t.play(), requestAnimationFrame(
|
12315
|
+
t.srcObject = e, t.play(), requestAnimationFrame(_this65.updateCanvas.bind(_this65, t, _this65._canvas));
|
12352
12316
|
})["catch"](function (e) {
|
12353
|
-
console.error(e),
|
12317
|
+
console.error(e), _this65.stop(), _this65.close();
|
12354
12318
|
});
|
12355
12319
|
}
|
12356
12320
|
}, {
|
@@ -12404,17 +12368,17 @@ var sn = /*#__PURE__*/function (_at) {
|
|
12404
12368
|
return sn;
|
12405
12369
|
}(at);
|
12406
12370
|
var Aa = "<?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>";
|
12407
|
-
var Xt = /*#__PURE__*/function (
|
12408
|
-
_inherits(Xt,
|
12371
|
+
var Xt = /*#__PURE__*/function (_wt5) {
|
12372
|
+
_inherits(Xt, _wt5);
|
12409
12373
|
var _super47 = _createSuper(Xt);
|
12410
12374
|
function Xt(e, t, i) {
|
12411
|
-
var
|
12375
|
+
var _this66;
|
12412
12376
|
_classCallCheck(this, Xt);
|
12413
12377
|
var r;
|
12414
|
-
|
12415
|
-
var n =
|
12416
|
-
i &&
|
12417
|
-
return
|
12378
|
+
_this66 = _super47.call(this, Xt.createButtonElement(), (r = i == null ? void 0 : i.button) == null ? void 0 : r.position, (i == null ? void 0 : i.button) || {}, "Photo");
|
12379
|
+
var n = _this66.createInnerElements(_this66._customStyles);
|
12380
|
+
i && _this66.addClickEvent(e, t, i.modalContainerStyle, i.files), _this66.elementRef.classList.add("upload-file-button"), _this66.elementRef.appendChild(n.styles), _this66.reapplyStateStyle("styles");
|
12381
|
+
return _this66;
|
12418
12382
|
}
|
12419
12383
|
_createClass(Xt, [{
|
12420
12384
|
key: "createInnerElements",
|
@@ -12445,24 +12409,24 @@ var Xt = /*#__PURE__*/function (_St5) {
|
|
12445
12409
|
}, {
|
12446
12410
|
key: "createSVGIconElement",
|
12447
12411
|
value: function createSVGIconElement() {
|
12448
|
-
var e =
|
12412
|
+
var e = q.createSVGElement(Aa);
|
12449
12413
|
return e.id = "camera-icon", e;
|
12450
12414
|
}
|
12451
12415
|
}]);
|
12452
12416
|
return Xt;
|
12453
|
-
}(
|
12417
|
+
}(wt);
|
12454
12418
|
var pt = /*#__PURE__*/function () {
|
12455
12419
|
// prettier-ignore
|
12456
12420
|
function pt(e, t, i, n) {
|
12457
12421
|
_classCallCheck(this, pt);
|
12458
12422
|
this.elementRef = pt.createPanelElement(e.inputAreaStyle);
|
12459
|
-
var r = new
|
12423
|
+
var r = new qi(e, i),
|
12460
12424
|
o = {},
|
12461
12425
|
a = this.createFileUploadComponents(e, i, n, o);
|
12462
12426
|
e.speechToText && !o.microphone && (o.microphone = {
|
12463
12427
|
button: new Zt(e, r, t.addNewErrorMessage.bind(t))
|
12464
12428
|
});
|
12465
|
-
var l = new
|
12429
|
+
var l = new wa(e, r.inputElementRef, t, i, a);
|
12466
12430
|
r.submit = l.submitFromInput.bind(l), Me.attach(e, i, r, a, l), e.submitUserMessage = l.programmaticSubmit.bind(l), o.submit = {
|
12467
12431
|
button: l
|
12468
12432
|
}, pt.addElements(this.elementRef, r, o, n, a, e.dropupStyles);
|
@@ -12473,7 +12437,7 @@ var pt = /*#__PURE__*/function () {
|
|
12473
12437
|
// prettier-ignore
|
12474
12438
|
function createFileUploadComponents(e, t, i, n) {
|
12475
12439
|
var o, a, l, c;
|
12476
|
-
var r = new
|
12440
|
+
var r = new _t(this.elementRef, e.attachmentContainerStyle, t.demo);
|
12477
12441
|
if (pt.createUploadButtons(e, t.fileTypes || {}, r, i, n), (o = t.camera) != null && o.files) {
|
12478
12442
|
var d = ((a = n.images) == null ? void 0 : a.fileType) || r.addType(e, t.camera.files, "images");
|
12479
12443
|
n.camera = {
|
@@ -12561,22 +12525,22 @@ var b = /*#__PURE__*/function (_vo) {
|
|
12561
12525
|
_inherits(b, _vo);
|
12562
12526
|
var _super48 = _createSuper(b);
|
12563
12527
|
function b() {
|
12564
|
-
var
|
12528
|
+
var _this67;
|
12565
12529
|
_classCallCheck(this, b);
|
12566
|
-
|
12530
|
+
_this67 = _super48.call(this), _this67.getMessages = function () {
|
12567
12531
|
return [];
|
12568
|
-
},
|
12532
|
+
}, _this67.submitUserMessage = function () {
|
12569
12533
|
return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
|
12570
|
-
},
|
12571
|
-
return Qt.focusFromParentElement(
|
12572
|
-
},
|
12534
|
+
}, _this67.focusInput = function () {
|
12535
|
+
return Qt.focusFromParentElement(_this67._elementRef);
|
12536
|
+
}, _this67.refreshMessages = function () {}, _this67.clearMessages = function () {}, _this67.scrollToBottom = function () {}, _this67.disableSubmitButton = function () {}, _this67._hasBeenRendered = !1, _this67._auxiliaryStyleApplied = !1, _this67._addMessage = function () {
|
12573
12537
|
return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
|
12574
|
-
},
|
12538
|
+
}, Go.appendStyleSheetToHead(), _this67._elementRef = document.createElement("div"), _this67._elementRef.id = "container", _this67.attachShadow({
|
12575
12539
|
mode: "open"
|
12576
|
-
}).appendChild(
|
12577
|
-
|
12540
|
+
}).appendChild(_this67._elementRef), Ei.apply(ka, _this67.shadowRoot), setTimeout(function () {
|
12541
|
+
_this67._hasBeenRendered || _this67.onRender();
|
12578
12542
|
}, 20);
|
12579
|
-
return
|
12543
|
+
return _this67;
|
12580
12544
|
}
|
12581
12545
|
_createClass(b, [{
|
12582
12546
|
key: "changeToChatView",
|
@@ -12588,7 +12552,7 @@ var b = /*#__PURE__*/function (_vo) {
|
|
12588
12552
|
key: "onRender",
|
12589
12553
|
value: function onRender() {
|
12590
12554
|
var _this$_childElement;
|
12591
|
-
(!this._activeService || this._activeService.demo) && (this._activeService = Ho.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (Ei.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Ei.applyDefaultStyleToComponent(this.style, this.chatStyle), ke.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? Dt.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof
|
12555
|
+
(!this._activeService || this._activeService.demo) && (this._activeService = Ho.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (Ei.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Ei.applyDefaultStyleToComponent(this.style, this.chatStyle), ke.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? Dt.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof U) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], rn.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof U && P.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, jt.onRender(this);
|
12592
12556
|
}
|
12593
12557
|
}, {
|
12594
12558
|
key: "disconnectedCallback",
|