deep-chat-dev 9.0.47 → 9.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +8465 -8358
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.d.ts +2 -2
- package/dist/deepChat.d.ts.map +1 -1
- package/dist/deepChat.js +580 -550
- package/dist/services/utils/baseServiceIO.d.ts +2 -2
- package/dist/services/utils/baseServiceIO.d.ts.map +1 -1
- package/dist/types/submitButton.d.ts +1 -0
- package/dist/types/submitButton.d.ts.map +1 -1
- package/dist/types/validateInput.d.ts +2 -0
- package/dist/types/validateInput.d.ts.map +1 -0
- package/dist/utils/data/objectUtils.d.ts +4 -1
- package/dist/utils/data/objectUtils.d.ts.map +1 -1
- package/dist/utils/legacy/legacy.d.ts +2 -0
- package/dist/utils/legacy/legacy.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/submit/submitButton.d.ts +3 -2
- package/dist/views/chat/input/buttons/submit/submitButton.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/submit/submitButtonStateStyle.d.ts +2 -2
- package/dist/views/chat/input/buttons/submit/submitButtonStateStyle.d.ts.map +1 -1
- package/dist/views/chat/input/textInput/textInput.d.ts.map +1 -1
- package/dist/views/chat/input/textInput/textInputEvents.d.ts.map +1 -1
- package/dist/views/chat/input/validation/validationHandler.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/types/validateMessageBeforeSending.d.ts +0 -2
- package/dist/types/validateMessageBeforeSending.d.ts.map +0 -1
package/dist/deepChat.js
CHANGED
@@ -177,7 +177,7 @@ wn.DEFAULT_COMPONENT_STYLE = {
|
|
177
177
|
backgroundColor: "white",
|
178
178
|
position: "relative"
|
179
179
|
};
|
180
|
-
var
|
180
|
+
var li = wn;
|
181
181
|
var T = /* @__PURE__ */function (n) {
|
182
182
|
return n.ESCAPE = "Escape", n.ENTER = "Enter", n.TAB = "Tab", n.ARROW_UP = "ArrowUp", n.ARROW_DOWN = "ArrowDown", n.ARROW_RIGHT = "ArrowRight", n.ARROW_LEFT = "ArrowLeft", n.BACKSPACE = "Backspace", n.DELETE = "Delete", n.META = "Meta", n.CONTROL = "Control", n;
|
183
183
|
}(T || {});
|
@@ -192,9 +192,7 @@ var _n = /*#__PURE__*/function () {
|
|
192
192
|
}
|
193
193
|
_createClass(He, null, [{
|
194
194
|
key: "add",
|
195
|
-
value:
|
196
|
-
// WORK - check why rendered twice as addEventListeners will be called twice
|
197
|
-
function add(e, t, i) {
|
195
|
+
value: function add(e, t, i) {
|
198
196
|
t !== void 0 && e.addEventListener("keydown", He.onKeyDown.bind(this, t)), e.oninput = He.onInput.bind(this, t, i);
|
199
197
|
}
|
200
198
|
// preventing insertion early for a nicer UX
|
@@ -210,14 +208,12 @@ var _n = /*#__PURE__*/function () {
|
|
210
208
|
value: function isKeyCombinationPermitted(e) {
|
211
209
|
return e.key === "a" ? e.ctrlKey || e.metaKey : !1;
|
212
210
|
}
|
213
|
-
// removing text characters after paste or other events
|
214
|
-
// prettier-ignore
|
215
211
|
}, {
|
216
212
|
key: "onInput",
|
217
213
|
value: function onInput(e, t, i) {
|
218
214
|
var r = i.target,
|
219
|
-
s = r.textContent;
|
220
|
-
|
215
|
+
s = r.textContent || "";
|
216
|
+
e !== void 0 && s.length > e && (r.textContent = s.substring(0, e), Bt.focusEndOfInput(r)), t == null || t();
|
221
217
|
}
|
222
218
|
}]);
|
223
219
|
return He;
|
@@ -336,7 +332,7 @@ var kn = /*#__PURE__*/function () {
|
|
336
332
|
return Ie;
|
337
333
|
}();
|
338
334
|
kn.TEXT_INPUT_ID = "text-input";
|
339
|
-
var
|
335
|
+
var Ai = kn;
|
340
336
|
var Bt = /*#__PURE__*/function () {
|
341
337
|
function Bt() {
|
342
338
|
_classCallCheck(this, Bt);
|
@@ -352,7 +348,7 @@ var Bt = /*#__PURE__*/function () {
|
|
352
348
|
}, {
|
353
349
|
key: "focusFromParentElement",
|
354
350
|
value: function focusFromParentElement(e) {
|
355
|
-
var t = e.querySelector("#".concat(
|
351
|
+
var t = e.querySelector("#".concat(Ai.TEXT_INPUT_ID));
|
356
352
|
t && Bt.focusEndOfInput(t);
|
357
353
|
}
|
358
354
|
}]);
|
@@ -531,10 +527,10 @@ function dr(n) {
|
|
531
527
|
};
|
532
528
|
}
|
533
529
|
function ur(n, e, t) {
|
534
|
-
var i =
|
530
|
+
var i = Wi();
|
535
531
|
var r = new TextDecoder();
|
536
532
|
return function (o, a) {
|
537
|
-
if (o.length === 0) t == null || t(i), i =
|
533
|
+
if (o.length === 0) t == null || t(i), i = Wi();else if (a > 0) {
|
538
534
|
var l = r.decode(o.subarray(0, a)),
|
539
535
|
c = a + (o[a + 1] === 32 ? 2 : 1),
|
540
536
|
d = r.decode(o.subarray(c));
|
@@ -560,7 +556,7 @@ function hr(n, e) {
|
|
560
556
|
var t = new Uint8Array(n.length + e.length);
|
561
557
|
return t.set(n), t.set(e, n.length), t;
|
562
558
|
}
|
563
|
-
function
|
559
|
+
function Wi() {
|
564
560
|
return {
|
565
561
|
data: "",
|
566
562
|
event: "",
|
@@ -574,9 +570,9 @@ var pr = globalThis && globalThis.__rest || function (n, e) {
|
|
574
570
|
if (n != null && typeof Object.getOwnPropertySymbols == "function") for (var r = 0, i = Object.getOwnPropertySymbols(n); r < i.length; r++) e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[r]) && (t[i[r]] = n[i[r]]);
|
575
571
|
return t;
|
576
572
|
};
|
577
|
-
var
|
573
|
+
var yi = "text/event-stream",
|
578
574
|
fr = 1e3,
|
579
|
-
|
575
|
+
Ki = "last-event-id";
|
580
576
|
function mr(n, e) {
|
581
577
|
var t = e.signal,
|
582
578
|
i = e.headers,
|
@@ -589,10 +585,10 @@ function mr(n, e) {
|
|
589
585
|
d = pr(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
590
586
|
return new Promise(function (u, p) {
|
591
587
|
var h = Object.assign({}, i);
|
592
|
-
h.accept || (h.accept =
|
588
|
+
h.accept || (h.accept = yi);
|
593
589
|
var b;
|
594
590
|
function m() {
|
595
|
-
b.abort(), document.hidden ||
|
591
|
+
b.abort(), document.hidden || j();
|
596
592
|
}
|
597
593
|
l || document.addEventListener("visibilitychange", m);
|
598
594
|
var g = fr,
|
@@ -604,13 +600,13 @@ function mr(n, e) {
|
|
604
600
|
w(), u();
|
605
601
|
});
|
606
602
|
var A = c !== null && c !== void 0 ? c : window.fetch,
|
607
|
-
|
608
|
-
function
|
609
|
-
return
|
603
|
+
H = r !== null && r !== void 0 ? r : gr;
|
604
|
+
function j() {
|
605
|
+
return _j.apply(this, arguments);
|
610
606
|
}
|
611
|
-
function
|
612
|
-
|
613
|
-
var Te,
|
607
|
+
function _j() {
|
608
|
+
_j = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
609
|
+
var Te, re, z;
|
614
610
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
615
611
|
while (1) switch (_context3.prev = _context3.next) {
|
616
612
|
case 0:
|
@@ -622,15 +618,15 @@ function mr(n, e) {
|
|
622
618
|
signal: b.signal
|
623
619
|
}));
|
624
620
|
case 4:
|
625
|
-
|
621
|
+
re = _context3.sent;
|
626
622
|
_context3.next = 7;
|
627
|
-
return
|
623
|
+
return H(re);
|
628
624
|
case 7:
|
629
625
|
_context3.next = 9;
|
630
|
-
return cr(
|
631
|
-
|
632
|
-
}, function (
|
633
|
-
g =
|
626
|
+
return cr(re.body, dr(ur(function (z) {
|
627
|
+
z ? h[Ki] = z : delete h[Ki];
|
628
|
+
}, function (z) {
|
629
|
+
g = z;
|
634
630
|
}, s)));
|
635
631
|
case 9:
|
636
632
|
o == null || o();
|
@@ -642,10 +638,10 @@ function mr(n, e) {
|
|
642
638
|
_context3.prev = 14;
|
643
639
|
_context3.t0 = _context3["catch"](1);
|
644
640
|
if (!b.signal.aborted) try {
|
645
|
-
|
646
|
-
window.clearTimeout(E), E = window.setTimeout(
|
647
|
-
} catch (
|
648
|
-
w(), p(
|
641
|
+
z = (Te = a == null ? void 0 : a(_context3.t0)) !== null && Te !== void 0 ? Te : g;
|
642
|
+
window.clearTimeout(E), E = window.setTimeout(j, z);
|
643
|
+
} catch (z) {
|
644
|
+
w(), p(z);
|
649
645
|
}
|
650
646
|
case 17:
|
651
647
|
case "end":
|
@@ -653,14 +649,14 @@ function mr(n, e) {
|
|
653
649
|
}
|
654
650
|
}, _callee3, null, [[1, 14]]);
|
655
651
|
}));
|
656
|
-
return
|
652
|
+
return _j.apply(this, arguments);
|
657
653
|
}
|
658
|
-
|
654
|
+
j();
|
659
655
|
});
|
660
656
|
}
|
661
657
|
function gr(n) {
|
662
658
|
var e = n.headers.get("content-type");
|
663
|
-
if (!(e != null && e.startsWith(
|
659
|
+
if (!(e != null && e.startsWith(yi))) throw new Error("Expected content-type to be ".concat(yi, ", Actual: ").concat(e));
|
664
660
|
}
|
665
661
|
var Tn = /*#__PURE__*/function () {
|
666
662
|
function Ge() {
|
@@ -729,7 +725,7 @@ var Tn = /*#__PURE__*/function () {
|
|
729
725
|
setTimeout(function () {
|
730
726
|
var r;
|
731
727
|
var i = (r = Ge.getResponse(e)) == null ? void 0 : r.text;
|
732
|
-
|
728
|
+
F.simulate(e, t, i);
|
733
729
|
}, 400);
|
734
730
|
}
|
735
731
|
}]);
|
@@ -737,11 +733,11 @@ var Tn = /*#__PURE__*/function () {
|
|
737
733
|
}();
|
738
734
|
Tn.URL = "deep-chat-demo";
|
739
735
|
var de = Tn;
|
740
|
-
var
|
741
|
-
function
|
742
|
-
_classCallCheck(this,
|
736
|
+
var F = /*#__PURE__*/function () {
|
737
|
+
function F() {
|
738
|
+
_classCallCheck(this, F);
|
743
739
|
}
|
744
|
-
_createClass(
|
740
|
+
_createClass(F, null, [{
|
745
741
|
key: "request",
|
746
742
|
value: // prettier-ignore
|
747
743
|
function () {
|
@@ -786,7 +782,7 @@ var z = /*#__PURE__*/function () {
|
|
786
782
|
_context6.next = 14;
|
787
783
|
break;
|
788
784
|
}
|
789
|
-
return _context6.abrupt("return",
|
785
|
+
return _context6.abrupt("return", F.onInterceptorError(i, l, d));
|
790
786
|
case 14:
|
791
787
|
if (!((b = e.requestSettings) != null && b.handler)) {
|
792
788
|
_context6.next = 16;
|
@@ -832,11 +828,11 @@ var z = /*#__PURE__*/function () {
|
|
832
828
|
onmessage: function onmessage(w) {
|
833
829
|
var A;
|
834
830
|
if (JSON.stringify(w.data) !== JSON.stringify("[DONE]")) {
|
835
|
-
var
|
836
|
-
(A = e.extractResultData) == null || A.call(e,
|
837
|
-
(
|
838
|
-
})["catch"](function (
|
839
|
-
return k.displayError(i,
|
831
|
+
var H = JSON.parse(w.data);
|
832
|
+
(A = e.extractResultData) == null || A.call(e, H).then(function (j) {
|
833
|
+
(j == null ? void 0 : j.text) === void 0 ? console.error("Response data: ".concat(w.data, " \n ").concat(C.INVALID_STREAM_RESPONSE)) : p && i.updateStreamedMessage(j.text, p);
|
834
|
+
})["catch"](function (j) {
|
835
|
+
return k.displayError(i, j);
|
840
836
|
});
|
841
837
|
}
|
842
838
|
},
|
@@ -851,8 +847,8 @@ var z = /*#__PURE__*/function () {
|
|
851
847
|
var A;
|
852
848
|
(A = e.extractResultData) == null || A.call(e, w).then(function () {
|
853
849
|
k.displayError(i, w);
|
854
|
-
})["catch"](function (
|
855
|
-
k.displayError(i,
|
850
|
+
})["catch"](function (H) {
|
851
|
+
k.displayError(i, H);
|
856
852
|
});
|
857
853
|
});
|
858
854
|
case 20:
|
@@ -877,7 +873,7 @@ var z = /*#__PURE__*/function () {
|
|
877
873
|
var r = t,
|
878
874
|
s = (i == null ? void 0 : i.split(" ")) || [],
|
879
875
|
o = e.addNewStreamedMessage();
|
880
|
-
t.onOpen(),
|
876
|
+
t.onOpen(), F.populateMessages(o, s, e, r);
|
881
877
|
}
|
882
878
|
// prettier-ignore
|
883
879
|
}, {
|
@@ -888,10 +884,10 @@ var z = /*#__PURE__*/function () {
|
|
888
884
|
if (o) {
|
889
885
|
i.updateStreamedMessage("".concat(o, " "), e);
|
890
886
|
var a = setTimeout(function () {
|
891
|
-
|
887
|
+
F.populateMessages(e, t, i, r, s + 1);
|
892
888
|
}, r.simulationInterim || 70);
|
893
889
|
r.abortStream.abort = function () {
|
894
|
-
return
|
890
|
+
return F.abort(a, i, r.onClose);
|
895
891
|
};
|
896
892
|
} else i.finaliseStreamedMessage(), r.onClose();
|
897
893
|
}
|
@@ -901,7 +897,7 @@ var z = /*#__PURE__*/function () {
|
|
901
897
|
clearTimeout(e), t.finaliseStreamedMessage(), i();
|
902
898
|
}
|
903
899
|
}]);
|
904
|
-
return
|
900
|
+
return F;
|
905
901
|
}();
|
906
902
|
var ve = /*#__PURE__*/function () {
|
907
903
|
function ve() {
|
@@ -940,7 +936,7 @@ var ve = /*#__PURE__*/function () {
|
|
940
936
|
_context7.t0 = c;
|
941
937
|
case 8:
|
942
938
|
d = _context7.t0;
|
943
|
-
k.validateResponseFormat(d) ? typeof d.error == "string" ? (console.error(d.error), i.addNewErrorMessage("service", d.error), e.completionsHandlers.onFinish()) : e.deepChat.stream && d.text ?
|
939
|
+
k.validateResponseFormat(d) ? typeof d.error == "string" ? (console.error(d.error), i.addNewErrorMessage("service", d.error), e.completionsHandlers.onFinish()) : e.deepChat.stream && d.text ? F.simulate(i, e.streamHandlers, d.text) : (i.addNewMessage(d, !0), e.completionsHandlers.onFinish()) : (console.error(C.INVALID_RESPONSE(c, "server", !!e.deepChat.responseInterceptor, d)), i.addNewErrorMessage("service", "Error in server message"), e.completionsHandlers.onFinish());
|
944
940
|
case 10:
|
945
941
|
case "end":
|
946
942
|
return _context7.stop();
|
@@ -1033,7 +1029,7 @@ var ve = /*#__PURE__*/function () {
|
|
1033
1029
|
_context9.t0 = d;
|
1034
1030
|
case 7:
|
1035
1031
|
u = _context9.t0;
|
1036
|
-
k.validateResponseFormat(u) ? typeof u.error == "string" ? (console.error(u.error), t.isLastMessageError() || t.addNewErrorMessage("service", u.error)) : e.deepChat.stream ?
|
1032
|
+
k.validateResponseFormat(u) ? typeof u.error == "string" ? (console.error(u.error), t.isLastMessageError() || t.addNewErrorMessage("service", u.error)) : e.deepChat.stream ? F.simulate(t, e.streamHandlers, u.text) : t.addNewMessage(u, !0) : (console.error(C.INVALID_RESPONSE(d, "server", !!e.deepChat.responseInterceptor, u)), t.addNewErrorMessage("service", "Error in server message"));
|
1037
1033
|
case 9:
|
1038
1034
|
case "end":
|
1039
1035
|
return _context9.stop();
|
@@ -1137,7 +1133,7 @@ var S = /*#__PURE__*/function () {
|
|
1137
1133
|
return k.processResponseByType(g);
|
1138
1134
|
}).then( /*#__PURE__*/function () {
|
1139
1135
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(g) {
|
1140
|
-
var A,
|
1136
|
+
var A, H, E, w;
|
1141
1137
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
1142
1138
|
while (1) switch (_context10.prev = _context10.next) {
|
1143
1139
|
case 0:
|
@@ -1148,7 +1144,7 @@ var S = /*#__PURE__*/function () {
|
|
1148
1144
|
return _context10.abrupt("return");
|
1149
1145
|
case 2:
|
1150
1146
|
_context10.next = 4;
|
1151
|
-
return (
|
1147
|
+
return (H = (A = e.deepChat).responseInterceptor) == null ? void 0 : H.call(A, g);
|
1152
1148
|
case 4:
|
1153
1149
|
_context10.t0 = _context10.sent;
|
1154
1150
|
if (_context10.t0) {
|
@@ -1174,7 +1170,7 @@ var S = /*#__PURE__*/function () {
|
|
1174
1170
|
}
|
1175
1171
|
throw Error(C.INVALID_RESPONSE(g, "response", !!e.deepChat.responseInterceptor, E));
|
1176
1172
|
case 15:
|
1177
|
-
w.pollingInAnotherRequest || (e.deepChat.stream && w.text ?
|
1173
|
+
w.pollingInAnotherRequest || (e.deepChat.stream && w.text ? F.simulate(i, e.streamHandlers, w.text) : (i.addNewMessage(w, !0), c()));
|
1178
1174
|
case 16:
|
1179
1175
|
case "end":
|
1180
1176
|
return _context10.stop();
|
@@ -1441,7 +1437,7 @@ var K = /*#__PURE__*/function () {
|
|
1441
1437
|
}
|
1442
1438
|
throw Error(C.INVALID_RESPONSE(a, "server", !!e.deepChat.responseInterceptor, l));
|
1443
1439
|
case 14:
|
1444
|
-
e.deepChat.stream && c.text ?
|
1440
|
+
e.deepChat.stream && c.text ? F.simulate(i, e.streamHandlers, c.text) : i.addNewMessage(c, !0);
|
1445
1441
|
_context14.next = 20;
|
1446
1442
|
break;
|
1447
1443
|
case 17:
|
@@ -1541,11 +1537,11 @@ var K = /*#__PURE__*/function () {
|
|
1541
1537
|
}]);
|
1542
1538
|
return K;
|
1543
1539
|
}();
|
1544
|
-
var
|
1545
|
-
function
|
1546
|
-
_classCallCheck(this,
|
1540
|
+
var Ut = /*#__PURE__*/function () {
|
1541
|
+
function Ut() {
|
1542
|
+
_classCallCheck(this, Ut);
|
1547
1543
|
}
|
1548
|
-
_createClass(
|
1544
|
+
_createClass(Ut, null, [{
|
1549
1545
|
key: "checkForContainerStyles",
|
1550
1546
|
value: function checkForContainerStyles(e, t) {
|
1551
1547
|
var i = e.containerStyle;
|
@@ -1563,8 +1559,14 @@ var Ai = /*#__PURE__*/function () {
|
|
1563
1559
|
var t = e.file;
|
1564
1560
|
t && (console.error("The file property in MessageContent is deprecated since version 1.3.17."), console.error("Please change to using the files array property: https://deepchat.dev/docs/messages/#MessageContent"), e.files = [t]);
|
1565
1561
|
}
|
1562
|
+
}, {
|
1563
|
+
key: "processValidateInput",
|
1564
|
+
value: function processValidateInput(e) {
|
1565
|
+
var t = e.validateMessageBeforeSending;
|
1566
|
+
if (t) return console.error("The validateMessageBeforeSending property is deprecated since version 1.3.24."), console.error("Please change to using validateInput: https://deepchat.dev/docs/interceptors#validateInput"), t;
|
1567
|
+
}
|
1566
1568
|
}]);
|
1567
|
-
return
|
1569
|
+
return Ut;
|
1568
1570
|
}();
|
1569
1571
|
var ht;
|
1570
1572
|
function Cn(n) {
|
@@ -1592,7 +1594,7 @@ function Qe(n) {
|
|
1592
1594
|
function In(n) {
|
1593
1595
|
return !(n >= 55296 && n <= 57343 || n >= 64976 && n <= 65007 || (n & 65535) === 65535 || (n & 65535) === 65534 || n >= 0 && n <= 8 || n === 11 || n >= 14 && n <= 31 || n >= 127 && n <= 159 || n > 1114111);
|
1594
1596
|
}
|
1595
|
-
function
|
1597
|
+
function xi(n) {
|
1596
1598
|
if (n > 65535) {
|
1597
1599
|
n -= 65536;
|
1598
1600
|
var e = 55296 + (n >> 10),
|
@@ -1606,7 +1608,7 @@ var xr = /&([a-z#][a-z0-9]{1,31});/gi,
|
|
1606
1608
|
function Sr(n, e) {
|
1607
1609
|
var t = 0,
|
1608
1610
|
i = Cn(e);
|
1609
|
-
return e !== i ? i : e.charCodeAt(0) === 35 && Er.test(e) && (t = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10), In(t)) ?
|
1611
|
+
return e !== i ? i : e.charCodeAt(0) === 35 && Er.test(e) && (t = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10), In(t)) ? xi(t) : n;
|
1610
1612
|
}
|
1611
1613
|
function ye(n) {
|
1612
1614
|
return n.indexOf("&") < 0 ? n : n.replace(xr, Sr);
|
@@ -1622,7 +1624,7 @@ var wr = /[&<>"]/,
|
|
1622
1624
|
function Mr(n) {
|
1623
1625
|
return kr[n];
|
1624
1626
|
}
|
1625
|
-
function
|
1627
|
+
function D(n) {
|
1626
1628
|
return wr.test(n) ? n.replace(_r, Mr) : n;
|
1627
1629
|
}
|
1628
1630
|
var f = {};
|
@@ -1633,7 +1635,7 @@ f.blockquote_close = function (n, e) {
|
|
1633
1635
|
return "</blockquote>" + xe(n, e);
|
1634
1636
|
};
|
1635
1637
|
f.code = function (n, e) {
|
1636
|
-
return n[e].block ? "<pre><code>" +
|
1638
|
+
return n[e].block ? "<pre><code>" + D(n[e].content) + "</code></pre>" + xe(n, e) : "<code>" + D(n[e].content) + "</code>";
|
1637
1639
|
};
|
1638
1640
|
f.fence = function (n, e, t, i, r) {
|
1639
1641
|
var s = n[e],
|
@@ -1645,9 +1647,9 @@ f.fence = function (n, e, t, i, r) {
|
|
1645
1647
|
u;
|
1646
1648
|
if (s.params) {
|
1647
1649
|
if (c = s.params.split(/\s+/g), d = c.join(" "), vr(r.rules.fence_custom, c[0])) return r.rules.fence_custom[c[0]](n, e, t, i, r);
|
1648
|
-
l =
|
1650
|
+
l = D(ye(Qe(d))), o = ' class="' + a + l + '"';
|
1649
1651
|
}
|
1650
|
-
return t.highlight ? u = t.highlight.apply(t.highlight, [s.content].concat(c)) ||
|
1652
|
+
return t.highlight ? u = t.highlight.apply(t.highlight, [s.content].concat(c)) || D(s.content) : u = D(s.content), "<pre><code" + o + ">" + u + "</code></pre>" + xe(n, e);
|
1651
1653
|
};
|
1652
1654
|
f.fence_custom = {};
|
1653
1655
|
f.heading_open = function (n, e) {
|
@@ -1687,17 +1689,17 @@ f.paragraph_close = function (n, e) {
|
|
1687
1689
|
return (n[e].tight ? "" : "</p>") + (t ? xe(n, e) : "");
|
1688
1690
|
};
|
1689
1691
|
f.link_open = function (n, e, t) {
|
1690
|
-
var i = n[e].title ? ' title="' +
|
1692
|
+
var i = n[e].title ? ' title="' + D(ye(n[e].title)) + '"' : "",
|
1691
1693
|
r = t.linkTarget ? ' target="' + t.linkTarget + '"' : "";
|
1692
|
-
return '<a href="' +
|
1694
|
+
return '<a href="' + D(n[e].href) + '"' + i + r + ">";
|
1693
1695
|
};
|
1694
1696
|
f.link_close = function () {
|
1695
1697
|
return "</a>";
|
1696
1698
|
};
|
1697
1699
|
f.image = function (n, e, t) {
|
1698
|
-
var i = ' src="' +
|
1699
|
-
r = n[e].title ? ' title="' +
|
1700
|
-
s = ' alt="' + (n[e].alt ?
|
1700
|
+
var i = ' src="' + D(n[e].src) + '"',
|
1701
|
+
r = n[e].title ? ' title="' + D(ye(n[e].title)) + '"' : "",
|
1702
|
+
s = ' alt="' + (n[e].alt ? D(ye(Qe(n[e].alt))) : "") + '"',
|
1701
1703
|
o = t.xhtmlOut ? " /" : "";
|
1702
1704
|
return "<img" + i + s + r + o + ">";
|
1703
1705
|
};
|
@@ -1770,10 +1772,10 @@ f.mark_close = function () {
|
|
1770
1772
|
return "</mark>";
|
1771
1773
|
};
|
1772
1774
|
f.sub = function (n, e) {
|
1773
|
-
return "<sub>" +
|
1775
|
+
return "<sub>" + D(n[e].content) + "</sub>";
|
1774
1776
|
};
|
1775
1777
|
f.sup = function (n, e) {
|
1776
|
-
return "<sup>" +
|
1778
|
+
return "<sup>" + D(n[e].content) + "</sup>";
|
1777
1779
|
};
|
1778
1780
|
f.hardbreak = function (n, e, t) {
|
1779
1781
|
return t.xhtmlOut ? "<br />\n" : "<br>\n";
|
@@ -1782,7 +1784,7 @@ f.softbreak = function (n, e, t) {
|
|
1782
1784
|
return t.breaks ? t.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
|
1783
1785
|
};
|
1784
1786
|
f.text = function (n, e) {
|
1785
|
-
return
|
1787
|
+
return D(n[e].content);
|
1786
1788
|
};
|
1787
1789
|
f.htmlblock = function (n, e) {
|
1788
1790
|
return n[e].content;
|
@@ -1791,7 +1793,7 @@ f.htmltag = function (n, e) {
|
|
1791
1793
|
return n[e].content;
|
1792
1794
|
};
|
1793
1795
|
f.abbr_open = function (n, e) {
|
1794
|
-
return '<abbr title="' +
|
1796
|
+
return '<abbr title="' + D(ye(n[e].title)) + '">';
|
1795
1797
|
};
|
1796
1798
|
f.abbr_close = function () {
|
1797
1799
|
return "</abbr>";
|
@@ -1855,14 +1857,14 @@ Ii.prototype.render = function (n, e, t) {
|
|
1855
1857
|
for (var i = this.rules, r = n.length, s = -1, o = ""; ++s < r;) n[s].type === "inline" ? o += this.renderInline(n[s].children, e, t) : o += i[n[s].type](n, s, e, t, this);
|
1856
1858
|
return o;
|
1857
1859
|
};
|
1858
|
-
function
|
1860
|
+
function q() {
|
1859
1861
|
this.__rules__ = [], this.__cache__ = null;
|
1860
1862
|
}
|
1861
|
-
|
1863
|
+
q.prototype.__find__ = function (n) {
|
1862
1864
|
for (var e = this.__rules__.length, t = -1; e--;) if (this.__rules__[++t].name === n) return t;
|
1863
1865
|
return -1;
|
1864
1866
|
};
|
1865
|
-
|
1867
|
+
q.prototype.__compile__ = function () {
|
1866
1868
|
var n = this,
|
1867
1869
|
e = [""];
|
1868
1870
|
n.__rules__.forEach(function (t) {
|
@@ -1875,13 +1877,13 @@ U.prototype.__compile__ = function () {
|
|
1875
1877
|
});
|
1876
1878
|
});
|
1877
1879
|
};
|
1878
|
-
|
1880
|
+
q.prototype.at = function (n, e, t) {
|
1879
1881
|
var i = this.__find__(n),
|
1880
1882
|
r = t || {};
|
1881
1883
|
if (i === -1) throw new Error("Parser rule not found: " + n);
|
1882
1884
|
this.__rules__[i].fn = e, this.__rules__[i].alt = r.alt || [], this.__cache__ = null;
|
1883
1885
|
};
|
1884
|
-
|
1886
|
+
q.prototype.before = function (n, e, t, i) {
|
1885
1887
|
var r = this.__find__(n),
|
1886
1888
|
s = i || {};
|
1887
1889
|
if (r === -1) throw new Error("Parser rule not found: " + n);
|
@@ -1892,7 +1894,7 @@ U.prototype.before = function (n, e, t, i) {
|
|
1892
1894
|
alt: s.alt || []
|
1893
1895
|
}), this.__cache__ = null;
|
1894
1896
|
};
|
1895
|
-
|
1897
|
+
q.prototype.after = function (n, e, t, i) {
|
1896
1898
|
var r = this.__find__(n),
|
1897
1899
|
s = i || {};
|
1898
1900
|
if (r === -1) throw new Error("Parser rule not found: " + n);
|
@@ -1903,7 +1905,7 @@ U.prototype.after = function (n, e, t, i) {
|
|
1903
1905
|
alt: s.alt || []
|
1904
1906
|
}), this.__cache__ = null;
|
1905
1907
|
};
|
1906
|
-
|
1908
|
+
q.prototype.push = function (n, e, t) {
|
1907
1909
|
var i = t || {};
|
1908
1910
|
this.__rules__.push({
|
1909
1911
|
name: n,
|
@@ -1912,7 +1914,7 @@ U.prototype.push = function (n, e, t) {
|
|
1912
1914
|
alt: i.alt || []
|
1913
1915
|
}), this.__cache__ = null;
|
1914
1916
|
};
|
1915
|
-
|
1917
|
+
q.prototype.enable = function (n, e) {
|
1916
1918
|
n = Array.isArray(n) ? n : [n], e && this.__rules__.forEach(function (t) {
|
1917
1919
|
t.enabled = !1;
|
1918
1920
|
}), n.forEach(function (t) {
|
@@ -1921,14 +1923,14 @@ U.prototype.enable = function (n, e) {
|
|
1921
1923
|
this.__rules__[i].enabled = !0;
|
1922
1924
|
}, this), this.__cache__ = null;
|
1923
1925
|
};
|
1924
|
-
|
1926
|
+
q.prototype.disable = function (n) {
|
1925
1927
|
n = Array.isArray(n) ? n : [n], n.forEach(function (e) {
|
1926
1928
|
var t = this.__find__(e);
|
1927
1929
|
if (t < 0) throw new Error("Rules manager: invalid rule name " + e);
|
1928
1930
|
this.__rules__[t].enabled = !1;
|
1929
1931
|
}, this), this.__cache__ = null;
|
1930
1932
|
};
|
1931
|
-
|
1933
|
+
q.prototype.getRules = function (n) {
|
1932
1934
|
return this.__cache__ === null && this.__compile__(), this.__cache__[n] || [];
|
1933
1935
|
};
|
1934
1936
|
function Tr(n) {
|
@@ -1998,7 +2000,7 @@ function Ar(n) {
|
|
1998
2000
|
}
|
1999
2001
|
}
|
2000
2002
|
}
|
2001
|
-
function
|
2003
|
+
function Ei(n) {
|
2002
2004
|
var e = ye(n);
|
2003
2005
|
try {
|
2004
2006
|
e = decodeURI(e);
|
@@ -2014,7 +2016,7 @@ function Rn(n, e) {
|
|
2014
2016
|
if (n.src.charCodeAt(e) === 60) {
|
2015
2017
|
for (e++; e < o;) {
|
2016
2018
|
if (t = n.src.charCodeAt(e), t === 10) return !1;
|
2017
|
-
if (t === 62) return r =
|
2019
|
+
if (t === 62) return r = Ei(Qe(n.src.slice(s + 1, e))), n.parser.validateLink(r) ? (n.pos = e + 1, n.linkContent = r, !0) : !1;
|
2018
2020
|
if (t === 92 && e + 1 < o) {
|
2019
2021
|
e += 2;
|
2020
2022
|
continue;
|
@@ -2139,7 +2141,7 @@ function Nr(n) {
|
|
2139
2141
|
}
|
2140
2142
|
}
|
2141
2143
|
var Ji = " \n()[]'\".,!?-";
|
2142
|
-
function
|
2144
|
+
function ci(n) {
|
2143
2145
|
return n.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1");
|
2144
2146
|
}
|
2145
2147
|
function Or(n) {
|
@@ -2157,11 +2159,11 @@ function Or(n) {
|
|
2157
2159
|
p,
|
2158
2160
|
h = n.tokens;
|
2159
2161
|
if (n.env.abbreviations) {
|
2160
|
-
for (n.env.abbrRegExp || (p = "(^|[" + Ji.split("").map(
|
2162
|
+
for (n.env.abbrRegExp || (p = "(^|[" + Ji.split("").map(ci).join("") + "])(" + Object.keys(n.env.abbreviations).map(function (b) {
|
2161
2163
|
return b.substr(1);
|
2162
2164
|
}).sort(function (b, m) {
|
2163
2165
|
return m.length - b.length;
|
2164
|
-
}).map(
|
2166
|
+
}).map(ci).join("|") + ")($|[" + Ji.split("").map(ci).join("") + "])", n.env.abbrRegExp = new RegExp(p, "g")), d = n.env.abbrRegExp, t = 0, i = h.length; t < i; t++) if (h[t].type === "inline") {
|
2165
2167
|
for (r = h[t].children, e = r.length - 1; e >= 0; e--) if (s = r[e], s.type === "text") {
|
2166
2168
|
for (l = 0, o = s.content, d.lastIndex = 0, c = s.level, a = []; u = d.exec(o);) d.lastIndex > l && a.push({
|
2167
2169
|
type: "text",
|
@@ -2246,10 +2248,10 @@ function qr(n) {
|
|
2246
2248
|
}
|
2247
2249
|
}
|
2248
2250
|
}
|
2249
|
-
var
|
2251
|
+
var di = [["block", Tr], ["abbr", Ar], ["references", Lr], ["inline", Rr], ["footnote_tail", Nr], ["abbr2", Or], ["replacements", Fr], ["smartquotes", qr]];
|
2250
2252
|
function Pn() {
|
2251
|
-
this.options = {}, this.ruler = new
|
2252
|
-
for (var n = 0; n <
|
2253
|
+
this.options = {}, this.ruler = new q();
|
2254
|
+
for (var n = 0; n < di.length; n++) this.ruler.push(di[n][0], di[n][1]);
|
2253
2255
|
}
|
2254
2256
|
Pn.prototype.process = function (n) {
|
2255
2257
|
var e, t, i;
|
@@ -2382,7 +2384,7 @@ function Vr(n, e, t, i) {
|
|
2382
2384
|
}), n.parentType = c, d[1] = n.line, p = 0; p < o.length; p++) n.bMarks[p + e] = a[p], n.tShift[p + e] = o[p];
|
2383
2385
|
return n.blkIndent = l, !0;
|
2384
2386
|
}
|
2385
|
-
function
|
2387
|
+
function Wr(n, e, t, i) {
|
2386
2388
|
var r,
|
2387
2389
|
s,
|
2388
2390
|
o,
|
@@ -2417,7 +2419,7 @@ function Xi(n, e) {
|
|
2417
2419
|
}
|
2418
2420
|
return i < r && n.src.charCodeAt(i) !== 32 ? -1 : i;
|
2419
2421
|
}
|
2420
|
-
function
|
2422
|
+
function Kr(n, e) {
|
2421
2423
|
var t,
|
2422
2424
|
i,
|
2423
2425
|
r = n.level + 2;
|
@@ -2440,38 +2442,38 @@ function Jr(n, e, t, i) {
|
|
2440
2442
|
E,
|
2441
2443
|
w,
|
2442
2444
|
A,
|
2443
|
-
|
2444
|
-
D,
|
2445
|
-
Te = !0,
|
2446
|
-
ne,
|
2445
|
+
H,
|
2447
2446
|
j,
|
2447
|
+
Te = !0,
|
2448
|
+
re,
|
2449
|
+
z,
|
2448
2450
|
Gi,
|
2449
|
-
|
2451
|
+
ai;
|
2450
2452
|
if ((u = Xi(n, e)) >= 0) g = !0;else if ((u = Qi(n, e)) >= 0) g = !1;else return !1;
|
2451
2453
|
if (n.level >= n.options.maxNesting) return !1;
|
2452
2454
|
if (m = n.src.charCodeAt(u - 1), i) return !0;
|
2453
2455
|
for (w = n.tokens.length, g ? (d = n.bMarks[e] + n.tShift[e], b = Number(n.src.substr(d, u - d - 1)), n.tokens.push({
|
2454
2456
|
type: "ordered_list_open",
|
2455
2457
|
order: b,
|
2456
|
-
lines:
|
2458
|
+
lines: H = [e, 0],
|
2457
2459
|
level: n.level++
|
2458
2460
|
})) : n.tokens.push({
|
2459
2461
|
type: "bullet_list_open",
|
2460
|
-
lines:
|
2462
|
+
lines: H = [e, 0],
|
2461
2463
|
level: n.level++
|
2462
|
-
}), r = e, A = !1,
|
2464
|
+
}), r = e, A = !1, re = n.parser.ruler.getRules("list"); r < t && (E = n.skipSpaces(u), p = n.eMarks[r], E >= p ? h = 1 : h = E - u, h > 4 && (h = 1), h < 1 && (h = 1), s = u - n.bMarks[r] + h, n.tokens.push({
|
2463
2465
|
type: "list_item_open",
|
2464
|
-
lines:
|
2466
|
+
lines: j = [e, 0],
|
2465
2467
|
level: n.level++
|
2466
2468
|
}), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] = E - n.bMarks[e], n.blkIndent = s, n.tight = !0, n.parentType = "list", n.parser.tokenize(n, e, t, !0), (!n.tight || A) && (Te = !1), A = n.line - e > 1 && n.isEmpty(n.line - 1), n.blkIndent = a, n.tShift[e] = o, n.tight = l, n.parentType = c, n.tokens.push({
|
2467
2469
|
type: "list_item_close",
|
2468
2470
|
level: --n.level
|
2469
|
-
}), r = e = n.line,
|
2470
|
-
for (
|
2471
|
-
|
2471
|
+
}), r = e = n.line, j[1] = r, E = n.bMarks[e], !(r >= t || n.isEmpty(r) || n.tShift[r] < n.blkIndent));) {
|
2472
|
+
for (ai = !1, z = 0, Gi = re.length; z < Gi; z++) if (re[z](n, r, t, !0)) {
|
2473
|
+
ai = !0;
|
2472
2474
|
break;
|
2473
2475
|
}
|
2474
|
-
if (
|
2476
|
+
if (ai) break;
|
2475
2477
|
if (g) {
|
2476
2478
|
if (u = Xi(n, r), u < 0) break;
|
2477
2479
|
} else if (u = Qi(n, r), u < 0) break;
|
@@ -2480,7 +2482,7 @@ function Jr(n, e, t, i) {
|
|
2480
2482
|
return n.tokens.push({
|
2481
2483
|
type: g ? "ordered_list_close" : "bullet_list_close",
|
2482
2484
|
level: --n.level
|
2483
|
-
}),
|
2485
|
+
}), H[1] = r, n.line = r, Te && Kr(n, w), !0;
|
2484
2486
|
}
|
2485
2487
|
function Yr(n, e, t, i) {
|
2486
2488
|
var r,
|
@@ -2586,14 +2588,14 @@ function ts(n, e, t, i) {
|
|
2586
2588
|
content: n.getLines(e, o, 0, !0)
|
2587
2589
|
}), !0;
|
2588
2590
|
}
|
2589
|
-
function
|
2591
|
+
function ui(n, e) {
|
2590
2592
|
var t = n.bMarks[e] + n.blkIndent,
|
2591
2593
|
i = n.eMarks[e];
|
2592
2594
|
return n.src.substr(t, i - t);
|
2593
2595
|
}
|
2594
2596
|
function is(n, e, t, i) {
|
2595
2597
|
var r, s, o, a, l, c, d, u, p, h, b;
|
2596
|
-
if (e + 2 > t || (l = e + 1, n.tShift[l] < n.blkIndent) || (o = n.bMarks[l] + n.tShift[l], o >= n.eMarks[l]) || (r = n.src.charCodeAt(o), r !== 124 && r !== 45 && r !== 58) || (s =
|
2598
|
+
if (e + 2 > t || (l = e + 1, n.tShift[l] < n.blkIndent) || (o = n.bMarks[l] + n.tShift[l], o >= n.eMarks[l]) || (r = n.src.charCodeAt(o), r !== 124 && r !== 45 && r !== 58) || (s = ui(n, e + 1), !/^[-:| ]+$/.test(s)) || (c = s.split("|"), c <= 2)) return !1;
|
2597
2599
|
for (u = [], a = 0; a < c.length; a++) {
|
2598
2600
|
if (p = c[a].trim(), !p) {
|
2599
2601
|
if (a === 0 || a === c.length - 1) continue;
|
@@ -2602,7 +2604,7 @@ function is(n, e, t, i) {
|
|
2602
2604
|
if (!/^:?-+:?$/.test(p)) return !1;
|
2603
2605
|
p.charCodeAt(p.length - 1) === 58 ? u.push(p.charCodeAt(0) === 58 ? "center" : "right") : p.charCodeAt(0) === 58 ? u.push("left") : u.push("");
|
2604
2606
|
}
|
2605
|
-
if (s =
|
2607
|
+
if (s = ui(n, e).trim(), s.indexOf("|") === -1 || (c = s.replace(/^\||\|$/g, "").split("|"), u.length !== c.length)) return !1;
|
2606
2608
|
if (i) return !0;
|
2607
2609
|
for (n.tokens.push({
|
2608
2610
|
type: "table_open",
|
@@ -2641,7 +2643,7 @@ function is(n, e, t, i) {
|
|
2641
2643
|
type: "tbody_open",
|
2642
2644
|
lines: b = [e + 2, 0],
|
2643
2645
|
level: n.level++
|
2644
|
-
}), l = e + 2; l < t && !(n.tShift[l] < n.blkIndent || (s =
|
2646
|
+
}), l = e + 2; l < t && !(n.tShift[l] < n.blkIndent || (s = ui(n, l).trim(), s.indexOf("|") === -1)); l++) {
|
2645
2647
|
for (c = s.replace(/^\||\|$/g, "").split("|"), n.tokens.push({
|
2646
2648
|
type: "tr_open",
|
2647
2649
|
level: n.level++
|
@@ -2760,9 +2762,9 @@ function ss(n, e) {
|
|
2760
2762
|
level: n.level
|
2761
2763
|
})), !0;
|
2762
2764
|
}
|
2763
|
-
var ft = [["code", Hr], ["fences", Gr, ["paragraph", "blockquote", "list"]], ["blockquote", Vr, ["paragraph", "blockquote", "list"]], ["hr",
|
2765
|
+
var ft = [["code", Hr], ["fences", Gr, ["paragraph", "blockquote", "list"]], ["blockquote", Vr, ["paragraph", "blockquote", "list"]], ["hr", Wr, ["paragraph", "blockquote", "list"]], ["list", Jr, ["paragraph", "blockquote"]], ["footnote", Yr, ["paragraph"]], ["heading", $r, ["paragraph", "blockquote"]], ["lheading", Zr], ["htmlblock", ts, ["paragraph", "blockquote"]], ["table", is, ["paragraph"]], ["deflist", rs, ["paragraph"]], ["paragraph", ss]];
|
2764
2766
|
function Li() {
|
2765
|
-
this.ruler = new
|
2767
|
+
this.ruler = new q();
|
2766
2768
|
for (var n = 0; n < ft.length; n++) this.ruler.push(ft[n][0], ft[n][1], {
|
2767
2769
|
alt: (ft[n][2] || []).slice()
|
2768
2770
|
});
|
@@ -3169,7 +3171,7 @@ function Cs(n, e) {
|
|
3169
3171
|
s,
|
3170
3172
|
o,
|
3171
3173
|
a = n.pos;
|
3172
|
-
return n.src.charCodeAt(a) !== 60 || (t = n.src.slice(a), t.indexOf(">") < 0) ? !1 : (i = t.match(Ts), i ? ks.indexOf(i[1].toLowerCase()) < 0 || (s = i[0].slice(1, -1), o =
|
3174
|
+
return n.src.charCodeAt(a) !== 60 || (t = n.src.slice(a), t.indexOf(">") < 0) ? !1 : (i = t.match(Ts), i ? ks.indexOf(i[1].toLowerCase()) < 0 || (s = i[0].slice(1, -1), o = Ei(s), !n.parser.validateLink(s)) ? !1 : (e || (n.push({
|
3173
3175
|
type: "link_open",
|
3174
3176
|
href: o,
|
3175
3177
|
level: n.level
|
@@ -3180,7 +3182,7 @@ function Cs(n, e) {
|
|
3180
3182
|
}), n.push({
|
3181
3183
|
type: "link_close",
|
3182
3184
|
level: n.level
|
3183
|
-
})), n.pos += i[0].length, !0) : (r = t.match(Ms), r ? (s = r[0].slice(1, -1), o =
|
3185
|
+
})), n.pos += i[0].length, !0) : (r = t.match(Ms), r ? (s = r[0].slice(1, -1), o = Ei("mailto:" + s), n.parser.validateLink(o) ? (e || (n.push({
|
3184
3186
|
type: "link_open",
|
3185
3187
|
href: o,
|
3186
3188
|
level: n.level
|
@@ -3193,7 +3195,7 @@ function Cs(n, e) {
|
|
3193
3195
|
level: n.level
|
3194
3196
|
})), n.pos += r[0].length, !0) : !1) : !1));
|
3195
3197
|
}
|
3196
|
-
function
|
3198
|
+
function qt(n, e) {
|
3197
3199
|
return n = n.source, e = e || "", function t(i, r) {
|
3198
3200
|
return i ? (r = r.source || r, n = n.replace(i, r), t) : new RegExp(n, e);
|
3199
3201
|
};
|
@@ -3202,15 +3204,15 @@ var As = /[a-zA-Z_:][a-zA-Z0-9:._-]*/,
|
|
3202
3204
|
Is = /[^"'=<>`\x00-\x20]+/,
|
3203
3205
|
Ls = /'[^']*'/,
|
3204
3206
|
Rs = /"[^"]*"/,
|
3205
|
-
Ns =
|
3206
|
-
Os =
|
3207
|
-
Ps =
|
3207
|
+
Ns = qt(/(?:unquoted|single_quoted|double_quoted)/)("unquoted", Is)("single_quoted", Ls)("double_quoted", Rs)(),
|
3208
|
+
Os = qt(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name", As)("attr_value", Ns)(),
|
3209
|
+
Ps = qt(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute", Os)(),
|
3208
3210
|
Ds = /<\/[A-Za-z][A-Za-z0-9]*\s*>/,
|
3209
3211
|
js = /<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,
|
3210
3212
|
zs = /<[?].*?[?]>/,
|
3211
3213
|
Fs = /<![A-Z]+\s+[^>]*>/,
|
3212
3214
|
Bs = /<!\[CDATA\[[\s\S]*?\]\]>/,
|
3213
|
-
Us =
|
3215
|
+
Us = qt(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag", Ps)("close_tag", Ds)("comment", js)("processing", zs)("declaration", Fs)("cdata", Bs)();
|
3214
3216
|
function qs(n) {
|
3215
3217
|
var e = n | 32;
|
3216
3218
|
return e >= 97 && e <= 122;
|
@@ -3228,7 +3230,7 @@ function Hs(n, e) {
|
|
3228
3230
|
}
|
3229
3231
|
var Gs = /^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,
|
3230
3232
|
Vs = /^&([a-z][a-z0-9]{1,31});/i;
|
3231
|
-
function
|
3233
|
+
function Ws(n, e) {
|
3232
3234
|
var t,
|
3233
3235
|
i,
|
3234
3236
|
r,
|
@@ -3237,7 +3239,7 @@ function Ks(n, e) {
|
|
3237
3239
|
if (n.src.charCodeAt(s) !== 38) return !1;
|
3238
3240
|
if (s + 1 < o) {
|
3239
3241
|
if (t = n.src.charCodeAt(s + 1), t === 35) {
|
3240
|
-
if (r = n.src.slice(s).match(Gs), r) return e || (i = r[1][0].toLowerCase() === "x" ? parseInt(r[1].slice(1), 16) : parseInt(r[1], 10), n.pending += In(i) ?
|
3242
|
+
if (r = n.src.slice(s).match(Gs), r) return e || (i = r[1][0].toLowerCase() === "x" ? parseInt(r[1].slice(1), 16) : parseInt(r[1], 10), n.pending += In(i) ? xi(i) : xi(65533)), n.pos += r[0].length, !0;
|
3241
3243
|
} else if (r = n.src.slice(s).match(Vs), r) {
|
3242
3244
|
var a = Cn(r[1]);
|
3243
3245
|
if (r[1] !== a) return e || (n.pending += a), n.pos += r[0].length, !0;
|
@@ -3245,13 +3247,13 @@ function Ks(n, e) {
|
|
3245
3247
|
}
|
3246
3248
|
return e || (n.pending += "&"), n.pos++, !0;
|
3247
3249
|
}
|
3248
|
-
var
|
3249
|
-
function
|
3250
|
-
this.ruler = new
|
3251
|
-
for (var n = 0; n <
|
3252
|
-
this.validateLink =
|
3250
|
+
var hi = [["text", ds], ["newline", us], ["escape", hs], ["backticks", ps], ["del", fs], ["ins", ms], ["mark", gs], ["emphasis", bs], ["sub", ys], ["sup", Es], ["links", Ss], ["footnote_inline", ws], ["footnote_ref", _s], ["autolink", Cs], ["htmltag", Hs], ["entity", Ws]];
|
3251
|
+
function Ht() {
|
3252
|
+
this.ruler = new q();
|
3253
|
+
for (var n = 0; n < hi.length; n++) this.ruler.push(hi[n][0], hi[n][1]);
|
3254
|
+
this.validateLink = Ks;
|
3253
3255
|
}
|
3254
|
-
|
3256
|
+
Ht.prototype.skipToken = function (n) {
|
3255
3257
|
var e = this.ruler.getRules(""),
|
3256
3258
|
t = e.length,
|
3257
3259
|
i = n.pos,
|
@@ -3267,7 +3269,7 @@ qt.prototype.skipToken = function (n) {
|
|
3267
3269
|
}
|
3268
3270
|
n.pos++, n.cacheSet(i, n.pos);
|
3269
3271
|
};
|
3270
|
-
|
3272
|
+
Ht.prototype.tokenize = function (n) {
|
3271
3273
|
for (var e = this.ruler.getRules(""), t = e.length, i = n.posMax, r, s; n.pos < i;) {
|
3272
3274
|
for (s = 0; s < t && (r = e[s](n, !1), !r); s++);
|
3273
3275
|
if (r) {
|
@@ -3278,11 +3280,11 @@ qt.prototype.tokenize = function (n) {
|
|
3278
3280
|
}
|
3279
3281
|
n.pending && n.pushPending();
|
3280
3282
|
};
|
3281
|
-
|
3283
|
+
Ht.prototype.parse = function (n, e, t, i) {
|
3282
3284
|
var r = new Ee(n, this, e, t, i);
|
3283
3285
|
this.tokenize(r);
|
3284
3286
|
};
|
3285
|
-
function
|
3287
|
+
function Ks(n) {
|
3286
3288
|
var e = ["vbscript", "javascript", "file", "data"],
|
3287
3289
|
t = n.trim().toLowerCase();
|
3288
3290
|
return t = ye(t), !(t.indexOf(":") !== -1 && e.indexOf(t.split(":")[0]) !== -1);
|
@@ -3407,45 +3409,45 @@ var Js = {
|
|
3407
3409
|
function jn(n, e, t) {
|
3408
3410
|
this.src = e, this.env = t, this.options = n.options, this.tokens = [], this.inlineMode = !1, this.inline = n.inline, this.block = n.block, this.renderer = n.renderer, this.typographer = n.typographer;
|
3409
3411
|
}
|
3410
|
-
function
|
3411
|
-
typeof n != "string" && (e = n, n = "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
|
3412
|
+
function ne(n, e) {
|
3413
|
+
typeof n != "string" && (e = n, n = "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 Ht(), this.block = new Li(), this.core = new Pn(), this.renderer = new Ii(), this.ruler = new q(), this.options = {}, this.configure(Zs[n]), this.set(e || {});
|
3412
3414
|
}
|
3413
|
-
|
3415
|
+
ne.prototype.set = function (n) {
|
3414
3416
|
An(this.options, n);
|
3415
3417
|
};
|
3416
|
-
|
3418
|
+
ne.prototype.configure = function (n) {
|
3417
3419
|
var e = this;
|
3418
3420
|
if (!n) throw new Error("Wrong `remarkable` preset, check name/content");
|
3419
3421
|
n.options && e.set(n.options), n.components && Object.keys(n.components).forEach(function (t) {
|
3420
3422
|
n.components[t].rules && e[t].ruler.enable(n.components[t].rules, !0);
|
3421
3423
|
});
|
3422
3424
|
};
|
3423
|
-
|
3425
|
+
ne.prototype.use = function (n, e) {
|
3424
3426
|
return n(this, e), this;
|
3425
3427
|
};
|
3426
|
-
|
3428
|
+
ne.prototype.parse = function (n, e) {
|
3427
3429
|
var t = new jn(this, n, e);
|
3428
3430
|
return this.core.process(t), t.tokens;
|
3429
3431
|
};
|
3430
|
-
|
3432
|
+
ne.prototype.render = function (n, e) {
|
3431
3433
|
return e = e || {}, this.renderer.render(this.parse(n, e), this.options, e);
|
3432
3434
|
};
|
3433
|
-
|
3435
|
+
ne.prototype.parseInline = function (n, e) {
|
3434
3436
|
var t = new jn(this, n, e);
|
3435
3437
|
return t.inlineMode = !0, this.core.process(t), t.tokens;
|
3436
3438
|
};
|
3437
|
-
|
3439
|
+
ne.prototype.renderInline = function (n, e) {
|
3438
3440
|
return e = e || {}, this.renderer.render(this.parseInline(n, e), this.options, e);
|
3439
3441
|
};
|
3440
|
-
var
|
3441
|
-
function
|
3442
|
-
_classCallCheck(this,
|
3442
|
+
var Si = /*#__PURE__*/function () {
|
3443
|
+
function Si() {
|
3444
|
+
_classCallCheck(this, Si);
|
3443
3445
|
}
|
3444
|
-
_createClass(
|
3446
|
+
_createClass(Si, null, [{
|
3445
3447
|
key: "createNew",
|
3446
3448
|
value: function createNew() {
|
3447
3449
|
var e = window.hljs;
|
3448
|
-
return e ? new
|
3450
|
+
return e ? new ne({
|
3449
3451
|
highlight: function highlight(t, i) {
|
3450
3452
|
if (i && e.getLanguage(i)) try {
|
3451
3453
|
return e.highlight(i, t).value;
|
@@ -3471,7 +3473,7 @@ var Ei = /*#__PURE__*/function () {
|
|
3471
3473
|
// set target to open in a new tab
|
3472
3474
|
typographer: !0
|
3473
3475
|
// Enable smartypants and other sweet transforms
|
3474
|
-
}) : new
|
3476
|
+
}) : new ne({
|
3475
3477
|
highlight: function highlight(t) {
|
3476
3478
|
return t;
|
3477
3479
|
},
|
@@ -3480,7 +3482,7 @@ var Ei = /*#__PURE__*/function () {
|
|
3480
3482
|
});
|
3481
3483
|
}
|
3482
3484
|
}]);
|
3483
|
-
return
|
3485
|
+
return Si;
|
3484
3486
|
}();
|
3485
3487
|
var M = /*#__PURE__*/function () {
|
3486
3488
|
function M() {
|
@@ -3583,7 +3585,7 @@ var M = /*#__PURE__*/function () {
|
|
3583
3585
|
key: "set",
|
3584
3586
|
value: function set(e, t, i) {
|
3585
3587
|
M.populateDefaultFileIO(i == null ? void 0 : i.audio, ".4a,.mp3,.webm,.mp4,.mpga,.wav,.mpeg,.m4a"), M.populateDefaultFileIO(i == null ? void 0 : i.images, ".png,.jpg");
|
3586
|
-
var r =
|
3588
|
+
var r = Si.createNew();
|
3587
3589
|
M.processImagesConfig(t, r, e.images, i == null ? void 0 : i.images), M.processCamera(t, r, e.camera, e.images), M.processGifConfig(t, r, e.gifs, i == null ? void 0 : i.gifs), M.processAudioConfig(t, r, e.audio, i == null ? void 0 : i.audio), M.processMicrophone(t, r, e.microphone, e.audio), M.processMixedFiles(t, r, e.mixedFiles);
|
3588
3590
|
}
|
3589
3591
|
}]);
|
@@ -3622,7 +3624,7 @@ var Fe = /*#__PURE__*/function () {
|
|
3622
3624
|
case 0:
|
3623
3625
|
i = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : !0;
|
3624
3626
|
r = this.deepChat.stream;
|
3625
|
-
return _context16.abrupt("return", r && (this.demo || _typeof(r) != "object" || !r.simulation) ?
|
3627
|
+
return _context16.abrupt("return", r && (this.demo || _typeof(r) != "object" || !r.simulation) ? F.request(this, e, t) : S.request(this, e, t, i));
|
3626
3628
|
case 3:
|
3627
3629
|
case "end":
|
3628
3630
|
return _context16.stop();
|
@@ -3734,7 +3736,7 @@ var Fe = /*#__PURE__*/function () {
|
|
3734
3736
|
}
|
3735
3737
|
throw e.error;
|
3736
3738
|
case 2:
|
3737
|
-
return _context20.abrupt("return", e.result ?
|
3739
|
+
return _context20.abrupt("return", e.result ? Ut.handleResponseProperty(e) : e);
|
3738
3740
|
case 3:
|
3739
3741
|
case "end":
|
3740
3742
|
return _context20.stop();
|
@@ -3775,18 +3777,18 @@ var Fe = /*#__PURE__*/function () {
|
|
3775
3777
|
}]);
|
3776
3778
|
return Fe;
|
3777
3779
|
}();
|
3778
|
-
var
|
3779
|
-
_inherits(
|
3780
|
-
var _super = _createSuper(
|
3780
|
+
var U = /*#__PURE__*/function (_Fe) {
|
3781
|
+
_inherits(U, _Fe);
|
3782
|
+
var _super = _createSuper(U);
|
3781
3783
|
// prettier-ignore
|
3782
|
-
function
|
3784
|
+
function U(e, t, i, r, s) {
|
3783
3785
|
var _this3;
|
3784
|
-
_classCallCheck(this,
|
3786
|
+
_classCallCheck(this, U);
|
3785
3787
|
var o;
|
3786
3788
|
_this3 = _super.call(this, e, s), _this3.insertKeyPlaceholderText = "API Key", _this3.getKeyLink = "", Object.assign(_this3.rawBody, (o = e.request) == null ? void 0 : o.additionalBodyProps), _this3.keyVerificationDetails = t, _this3.buildHeadersFunc = i, r && _this3.setApiKeyProperties(r), _this3.requestSettings = _this3.buildRequestSettings(_this3.key || "", e.request);
|
3787
3789
|
return _this3;
|
3788
3790
|
}
|
3789
|
-
_createClass(
|
3791
|
+
_createClass(U, [{
|
3790
3792
|
key: "setApiKeyProperties",
|
3791
3793
|
value: function setApiKeyProperties(e) {
|
3792
3794
|
this.key = e.key, e.validateKeyProperty && (this.validateConfigKey = e.validateKeyProperty);
|
@@ -3821,7 +3823,7 @@ var B = /*#__PURE__*/function (_Fe) {
|
|
3821
3823
|
return !0;
|
3822
3824
|
}
|
3823
3825
|
}]);
|
3824
|
-
return
|
3826
|
+
return U;
|
3825
3827
|
}(Fe);
|
3826
3828
|
var St = /*#__PURE__*/function () {
|
3827
3829
|
function St() {
|
@@ -3894,17 +3896,17 @@ Ni._attributeToProperty_ = {};
|
|
3894
3896
|
var Qs = Ni;
|
3895
3897
|
var Xs = "<?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",
|
3896
3898
|
eo = "<?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";
|
3897
|
-
var
|
3898
|
-
function
|
3899
|
-
_classCallCheck(this,
|
3899
|
+
var B = /*#__PURE__*/function () {
|
3900
|
+
function B() {
|
3901
|
+
_classCallCheck(this, B);
|
3900
3902
|
}
|
3901
|
-
_createClass(
|
3903
|
+
_createClass(B, null, [{
|
3902
3904
|
key: "createSVGElement",
|
3903
3905
|
value: function createSVGElement(e) {
|
3904
3906
|
return new DOMParser().parseFromString(e, "image/svg+xml").documentElement;
|
3905
3907
|
}
|
3906
3908
|
}]);
|
3907
|
-
return
|
3909
|
+
return B;
|
3908
3910
|
}();
|
3909
3911
|
var zn = /*#__PURE__*/function () {
|
3910
3912
|
function Re() {
|
@@ -3920,7 +3922,7 @@ var zn = /*#__PURE__*/function () {
|
|
3920
3922
|
}, {
|
3921
3923
|
key: "createIconElement",
|
3922
3924
|
value: function createIconElement(e, t) {
|
3923
|
-
var i =
|
3925
|
+
var i = B.createSVGElement(e);
|
3924
3926
|
return i.id = t, i.classList.add("visibility-icon"), i;
|
3925
3927
|
}
|
3926
3928
|
// prettier-ignore
|
@@ -4099,18 +4101,18 @@ var wt = /*#__PURE__*/function () {
|
|
4099
4101
|
}]);
|
4100
4102
|
return wt;
|
4101
4103
|
}();
|
4102
|
-
var Fn = /*#__PURE__*/function (
|
4103
|
-
_inherits(
|
4104
|
-
var _super3 = _createSuper(
|
4104
|
+
var Fn = /*#__PURE__*/function (_U) {
|
4105
|
+
_inherits(wi, _U);
|
4106
|
+
var _super3 = _createSuper(wi);
|
4105
4107
|
// prettier-ignore
|
4106
|
-
function
|
4108
|
+
function wi(e, t, i, r, s, o) {
|
4107
4109
|
var _this5;
|
4108
|
-
_classCallCheck(this,
|
4109
|
-
_this5 = _super3.call(this, e, wt.buildKeyVerificationDetails(), wt.buildHeaders, s, o), _this5.insertKeyPlaceholderText = "Hugging Face Token", _this5.getKeyLink = "https://huggingface.co/settings/tokens", _this5.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this5.permittedErrorPrefixes = ["Authorization header"], _this5.url = "".concat(
|
4110
|
+
_classCallCheck(this, wi);
|
4111
|
+
_this5 = _super3.call(this, e, wt.buildKeyVerificationDetails(), wt.buildHeaders, s, o), _this5.insertKeyPlaceholderText = "Hugging Face Token", _this5.getKeyLink = "https://huggingface.co/settings/tokens", _this5.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this5.permittedErrorPrefixes = ["Authorization header"], _this5.url = "".concat(wi.URL_PREFIX).concat(i), _this5.textInputPlaceholderText = t, _typeof(r) == "object" && (r.model && (_this5.url = "".concat(wi.URL_PREFIX).concat(r.model)), r.options && (_this5.rawBody.options = r.options), r.parameters && (_this5.rawBody.parameters = r.parameters));
|
4110
4112
|
return _this5;
|
4111
4113
|
}
|
4112
4114
|
// prettier-ignore
|
4113
|
-
_createClass(
|
4115
|
+
_createClass(wi, [{
|
4114
4116
|
key: "preprocessBody",
|
4115
4117
|
value: function preprocessBody(e, t, i) {
|
4116
4118
|
var _r$options;
|
@@ -4148,8 +4150,8 @@ var Fn = /*#__PURE__*/function (_B) {
|
|
4148
4150
|
return callServiceAPI;
|
4149
4151
|
}()
|
4150
4152
|
}]);
|
4151
|
-
return
|
4152
|
-
}(
|
4153
|
+
return wi;
|
4154
|
+
}(U);
|
4153
4155
|
Fn.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
4154
4156
|
var we = Fn;
|
4155
4157
|
var nt = /*#__PURE__*/function (_we) {
|
@@ -4311,11 +4313,11 @@ var no = /*#__PURE__*/function (_nt2) {
|
|
4311
4313
|
return no;
|
4312
4314
|
}(nt);
|
4313
4315
|
var rt = "data:image/png;base64,";
|
4314
|
-
var
|
4315
|
-
function
|
4316
|
-
_classCallCheck(this,
|
4316
|
+
var X = /*#__PURE__*/function () {
|
4317
|
+
function X() {
|
4318
|
+
_classCallCheck(this, X);
|
4317
4319
|
}
|
4318
|
-
_createClass(
|
4320
|
+
_createClass(X, null, [{
|
4319
4321
|
key: "buildHeaders",
|
4320
4322
|
value: function buildHeaders(e) {
|
4321
4323
|
return {
|
@@ -4335,26 +4337,26 @@ var Q = /*#__PURE__*/function () {
|
|
4335
4337
|
return {
|
4336
4338
|
url: "https://api.stability.ai/v1/engines/list",
|
4337
4339
|
method: "GET",
|
4338
|
-
handleVerificationResult:
|
4340
|
+
handleVerificationResult: X.handleVerificationResult
|
4339
4341
|
};
|
4340
4342
|
}
|
4341
4343
|
}]);
|
4342
|
-
return
|
4344
|
+
return X;
|
4343
4345
|
}();
|
4344
|
-
var
|
4345
|
-
_inherits(
|
4346
|
-
var _super7 = _createSuper(
|
4346
|
+
var Gt = /*#__PURE__*/function (_U2) {
|
4347
|
+
_inherits(Gt, _U2);
|
4348
|
+
var _super7 = _createSuper(Gt);
|
4347
4349
|
// prettier-ignore
|
4348
|
-
function
|
4350
|
+
function Gt(e, t, i, r, s) {
|
4349
4351
|
var _this7;
|
4350
|
-
_classCallCheck(this,
|
4352
|
+
_classCallCheck(this, Gt);
|
4351
4353
|
_this7 = _super7.call(this, e, t, i, r, s), _this7.insertKeyPlaceholderText = "Stability AI API Key", _this7.getKeyLink = "https://platform.stability.ai/docs/getting-started/authentication", _this7.permittedErrorPrefixes = ["Incorrect", "invalid_"];
|
4352
4354
|
return _this7;
|
4353
4355
|
}
|
4354
|
-
return _createClass(
|
4355
|
-
}(
|
4356
|
-
var _t = /*#__PURE__*/function (
|
4357
|
-
_inherits(_t,
|
4356
|
+
return _createClass(Gt);
|
4357
|
+
}(U);
|
4358
|
+
var _t = /*#__PURE__*/function (_Gt) {
|
4359
|
+
_inherits(_t, _Gt);
|
4358
4360
|
var _super8 = _createSuper(_t);
|
4359
4361
|
function _t(e) {
|
4360
4362
|
var _this8;
|
@@ -4370,7 +4372,7 @@ var _t = /*#__PURE__*/function (_Ht) {
|
|
4370
4372
|
}
|
4371
4373
|
}
|
4372
4374
|
};
|
4373
|
-
_this8 = _super8.call(this, e,
|
4375
|
+
_this8 = _super8.call(this, e, X.buildKeyVerificationDetails(), X.buildHeaders, i, r), _this8.url = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale", _this8.textInputPlaceholderText = "Describe image changes", _this8.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Upscale</b></div>\n <p>Upload an image to generate a new one with higher resolution.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
4374
4376
|
var s = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageUpscale;
|
4375
4377
|
_typeof(s) == "object" && (s.engine_id && (_this8.url = "https://api.stability.ai/v1/generation/".concat(s.engine_id, "/image-to-image/upscale")), _t.cleanConfig(s), Object.assign(_this8.rawBody, s)), _this8.canSendMessage = _t.canSendFileMessage;
|
4376
4378
|
return _this8;
|
@@ -4461,9 +4463,9 @@ var _t = /*#__PURE__*/function (_Ht) {
|
|
4461
4463
|
}
|
4462
4464
|
}]);
|
4463
4465
|
return _t;
|
4464
|
-
}(
|
4465
|
-
var kt = /*#__PURE__*/function (
|
4466
|
-
_inherits(kt,
|
4466
|
+
}(Gt);
|
4467
|
+
var kt = /*#__PURE__*/function (_Gt2) {
|
4468
|
+
_inherits(kt, _Gt2);
|
4467
4469
|
var _super9 = _createSuper(kt);
|
4468
4470
|
function kt(e) {
|
4469
4471
|
var _this9;
|
@@ -4479,7 +4481,7 @@ var kt = /*#__PURE__*/function (_Ht2) {
|
|
4479
4481
|
}
|
4480
4482
|
}
|
4481
4483
|
};
|
4482
|
-
_this9 = _super9.call(this, e,
|
4484
|
+
_this9 = _super9.call(this, e, X.buildKeyVerificationDetails(), X.buildHeaders, i, r), _this9.url = "https://api.stability.ai/v1/generation/stable-inpainting-512-v2-0/image-to-image/masking", _this9._maskSource = "MASK_IMAGE_WHITE", _this9.textInputPlaceholderText = "Describe image changes", _this9.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>";
|
4483
4485
|
var s = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
|
4484
4486
|
_typeof(s) == "object" && (s.engine_id && (_this9.url = "https://api.stability.ai/v1/generation/".concat(s.engine_id, "/image-to-image/masking")), s.weight !== void 0 && s.weight !== null && (_this9._imageWeight = s.weight), s.mask_source !== void 0 && s.mask_source !== null && (_this9._maskSource = s.mask_source), kt.cleanConfig(s), Object.assign(_this9.rawBody, s)), _this9.canSendMessage = kt.canSendFileTextMessage;
|
4485
4487
|
return _this9;
|
@@ -4570,7 +4572,7 @@ var kt = /*#__PURE__*/function (_Ht2) {
|
|
4570
4572
|
}
|
4571
4573
|
}]);
|
4572
4574
|
return kt;
|
4573
|
-
}(
|
4575
|
+
}(Gt);
|
4574
4576
|
var ro = /*#__PURE__*/function (_nt3) {
|
4575
4577
|
_inherits(ro, _nt3);
|
4576
4578
|
var _super10 = _createSuper(ro);
|
@@ -4841,8 +4843,8 @@ var lo = /*#__PURE__*/function (_we5) {
|
|
4841
4843
|
}]);
|
4842
4844
|
return lo;
|
4843
4845
|
}(we);
|
4844
|
-
var Mt = /*#__PURE__*/function (
|
4845
|
-
_inherits(Mt,
|
4846
|
+
var Mt = /*#__PURE__*/function (_Gt3) {
|
4847
|
+
_inherits(Mt, _Gt3);
|
4846
4848
|
var _super15 = _createSuper(Mt);
|
4847
4849
|
function Mt(e) {
|
4848
4850
|
var _this12;
|
@@ -4858,7 +4860,7 @@ var Mt = /*#__PURE__*/function (_Ht3) {
|
|
4858
4860
|
}
|
4859
4861
|
}
|
4860
4862
|
};
|
4861
|
-
_this12 = _super15.call(this, e,
|
4863
|
+
_this12 = _super15.call(this, e, X.buildKeyVerificationDetails(), X.buildHeaders, i, r), _this12.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-5/image-to-image", _this12.textInputPlaceholderText = "Describe image changes", _this12.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>";
|
4862
4864
|
var s = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
|
4863
4865
|
_typeof(s) == "object" && (s.engine_id && (_this12.url = "https://api.stability.ai/v1/generation/".concat(s.engine_id, "/text-to-image")), s.weight !== void 0 && s.weight !== null && (_this12._imageWeight = s.weight), Mt.cleanConfig(s), Object.assign(_this12.rawBody, s)), _this12.canSendMessage = Mt.canSendFileTextMessage;
|
4864
4866
|
return _this12;
|
@@ -4949,7 +4951,7 @@ var Mt = /*#__PURE__*/function (_Ht3) {
|
|
4949
4951
|
}
|
4950
4952
|
}]);
|
4951
4953
|
return Mt;
|
4952
|
-
}(
|
4954
|
+
}(Gt);
|
4953
4955
|
var co = /*#__PURE__*/function (_we6) {
|
4954
4956
|
_inherits(co, _we6);
|
4955
4957
|
var _super16 = _createSuper(co);
|
@@ -4990,8 +4992,8 @@ var co = /*#__PURE__*/function (_we6) {
|
|
4990
4992
|
}]);
|
4991
4993
|
return co;
|
4992
4994
|
}(we);
|
4993
|
-
var Tt = /*#__PURE__*/function (
|
4994
|
-
_inherits(Tt,
|
4995
|
+
var Tt = /*#__PURE__*/function (_Gt4) {
|
4996
|
+
_inherits(Tt, _Gt4);
|
4995
4997
|
var _super17 = _createSuper(Tt);
|
4996
4998
|
function Tt(e) {
|
4997
4999
|
var _this13;
|
@@ -4999,7 +5001,7 @@ var Tt = /*#__PURE__*/function (_Ht4) {
|
|
4999
5001
|
var s;
|
5000
5002
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
5001
5003
|
i = t.stabilityAI;
|
5002
|
-
_this13 = _super17.call(this, e,
|
5004
|
+
_this13 = _super17.call(this, e, X.buildKeyVerificationDetails(), X.buildHeaders, i), _this13.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-5/text-to-image", _this13.textInputPlaceholderText = "Describe an image", _this13.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Text to Image</b></div>\n <p>Insert text to generate an image.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
5003
5005
|
var r = (s = t.stabilityAI) == null ? void 0 : s.textToImage;
|
5004
5006
|
_typeof(r) == "object" && (r.engine_id && (_this13.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this13._imageWeight = r.weight), Tt.cleanConfig(r), Object.assign(_this13.rawBody, r)), _this13.canSendMessage = Tt.canSendTextMessage;
|
5005
5007
|
return _this13;
|
@@ -5084,7 +5086,7 @@ var Tt = /*#__PURE__*/function (_Ht4) {
|
|
5084
5086
|
}
|
5085
5087
|
}]);
|
5086
5088
|
return Tt;
|
5087
|
-
}(
|
5089
|
+
}(Gt);
|
5088
5090
|
var uo = /*#__PURE__*/function (_we7) {
|
5089
5091
|
_inherits(uo, _we7);
|
5090
5092
|
var _super18 = _createSuper(uo);
|
@@ -5161,8 +5163,8 @@ var Ct = /*#__PURE__*/function () {
|
|
5161
5163
|
}]);
|
5162
5164
|
return Ct;
|
5163
5165
|
}();
|
5164
|
-
var Oi = /*#__PURE__*/function (
|
5165
|
-
_inherits(Oi,
|
5166
|
+
var Oi = /*#__PURE__*/function (_U3) {
|
5167
|
+
_inherits(Oi, _U3);
|
5166
5168
|
var _super19 = _createSuper(Oi);
|
5167
5169
|
function Oi(e, t, i, r, s) {
|
5168
5170
|
var _this15;
|
@@ -5171,7 +5173,7 @@ var Oi = /*#__PURE__*/function (_B3) {
|
|
5171
5173
|
return _this15;
|
5172
5174
|
}
|
5173
5175
|
return _createClass(Oi);
|
5174
|
-
}(
|
5176
|
+
}(U);
|
5175
5177
|
var ho = /*#__PURE__*/function (_Oi) {
|
5176
5178
|
_inherits(ho, _Oi);
|
5177
5179
|
var _super20 = _createSuper(ho);
|
@@ -5325,11 +5327,11 @@ var po = /*#__PURE__*/function (_Oi2) {
|
|
5325
5327
|
}]);
|
5326
5328
|
return po;
|
5327
5329
|
}(Oi);
|
5328
|
-
var
|
5329
|
-
function
|
5330
|
-
_classCallCheck(this,
|
5330
|
+
var J = /*#__PURE__*/function () {
|
5331
|
+
function J() {
|
5332
|
+
_classCallCheck(this, J);
|
5331
5333
|
}
|
5332
|
-
_createClass(
|
5334
|
+
_createClass(J, null, [{
|
5333
5335
|
key: "buildTextToSpeechHeaders",
|
5334
5336
|
value: function buildTextToSpeechHeaders(e, t) {
|
5335
5337
|
return {
|
@@ -5363,7 +5365,7 @@ var W = /*#__PURE__*/function () {
|
|
5363
5365
|
"Ocp-Apim-Subscription-Key": "".concat(t)
|
5364
5366
|
};
|
5365
5367
|
},
|
5366
|
-
handleVerificationResult:
|
5368
|
+
handleVerificationResult: J.handleSpeechVerificationResult
|
5367
5369
|
};
|
5368
5370
|
}
|
5369
5371
|
}, {
|
@@ -5392,7 +5394,7 @@ var W = /*#__PURE__*/function () {
|
|
5392
5394
|
"Ocp-Apim-Subscription-Key": "".concat(t)
|
5393
5395
|
};
|
5394
5396
|
},
|
5395
|
-
handleVerificationResult:
|
5397
|
+
handleVerificationResult: J.handleLanguageVerificationResult
|
5396
5398
|
};
|
5397
5399
|
}
|
5398
5400
|
// prettier-ignore
|
@@ -5410,9 +5412,9 @@ var W = /*#__PURE__*/function () {
|
|
5410
5412
|
url: "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=es",
|
5411
5413
|
method: "POST",
|
5412
5414
|
createHeaders: function createHeaders(t) {
|
5413
|
-
return
|
5415
|
+
return J.buildTranslationHeaders(e, t);
|
5414
5416
|
},
|
5415
|
-
handleVerificationResult:
|
5417
|
+
handleVerificationResult: J.handleTranslationVerificationResult
|
5416
5418
|
};
|
5417
5419
|
}
|
5418
5420
|
}, {
|
@@ -5425,22 +5427,22 @@ var W = /*#__PURE__*/function () {
|
|
5425
5427
|
return e && (i["Ocp-Apim-Subscription-Region"] = e), i;
|
5426
5428
|
}
|
5427
5429
|
}]);
|
5428
|
-
return
|
5430
|
+
return J;
|
5429
5431
|
}();
|
5430
|
-
var fo = /*#__PURE__*/function (
|
5431
|
-
_inherits(fo,
|
5432
|
+
var fo = /*#__PURE__*/function (_U4) {
|
5433
|
+
_inherits(fo, _U4);
|
5432
5434
|
var _super22 = _createSuper(fo);
|
5433
5435
|
// prettier-ignore
|
5434
5436
|
function fo(e, t, i, r, s) {
|
5435
5437
|
var _this16;
|
5436
5438
|
_classCallCheck(this, fo);
|
5437
|
-
_this16 = _super22.call(this, e,
|
5439
|
+
_this16 = _super22.call(this, e, J.buildLanguageKeyVerificationDetails(i), t, r, s), _this16.insertKeyPlaceholderText = "Azure Language Subscription Key", _this16.getKeyLink =
|
5438
5440
|
// eslint-disable-next-line max-len
|
5439
5441
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this16.permittedErrorPrefixes = ["Access"];
|
5440
5442
|
return _this16;
|
5441
5443
|
}
|
5442
5444
|
return _createClass(fo);
|
5443
|
-
}(
|
5445
|
+
}(U);
|
5444
5446
|
var mo = /*#__PURE__*/function (_fo) {
|
5445
5447
|
_inherits(mo, _fo);
|
5446
5448
|
var _super23 = _createSuper(mo);
|
@@ -5451,7 +5453,7 @@ var mo = /*#__PURE__*/function (_fo) {
|
|
5451
5453
|
var r, s, o, a;
|
5452
5454
|
var t = (s = (r = e.directConnection) == null ? void 0 : r.azure) == null ? void 0 : s.summarization,
|
5453
5455
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
5454
|
-
_this17 = _super23.call(this, e,
|
5456
|
+
_this17 = _super23.call(this, e, J.buildSummarizationHeader, t.endpoint, i), _this17.url = "", _this17.textInputPlaceholderText = "Insert text to summarize", (_a$language = (a = _this17.rawBody).language) !== null && _a$language !== void 0 ? _a$language : a.language = "en", Object.assign(_this17.rawBody, t), _this17.url = "".concat(t.endpoint, "/language/analyze-text/jobs?api-version=2022-10-01-preview");
|
5455
5457
|
return _this17;
|
5456
5458
|
}
|
5457
5459
|
_createClass(mo, [{
|
@@ -5652,9 +5654,9 @@ var Di = /*#__PURE__*/function () {
|
|
5652
5654
|
}();
|
5653
5655
|
Di.CONVERSE_MAX_CHAR_LENGTH = 13352;
|
5654
5656
|
Di.FILE_MAX_CHAR_LENGTH = 1e3;
|
5655
|
-
var
|
5656
|
-
var go = /*#__PURE__*/function (
|
5657
|
-
_inherits(go,
|
5657
|
+
var Y = Di;
|
5658
|
+
var go = /*#__PURE__*/function (_U5) {
|
5659
|
+
_inherits(go, _U5);
|
5658
5660
|
var _super24 = _createSuper(go);
|
5659
5661
|
function go(e) {
|
5660
5662
|
var _a$model;
|
@@ -5664,7 +5666,7 @@ var go = /*#__PURE__*/function (_B5) {
|
|
5664
5666
|
var t = e.directConnection,
|
5665
5667
|
i = e.textInput,
|
5666
5668
|
r = t == null ? void 0 : t.openAI;
|
5667
|
-
_this18 = _super24.call(this, e,
|
5669
|
+
_this18 = _super24.call(this, e, Y.buildKeyVerificationDetails(), Y.buildHeaders, r), _this18.insertKeyPlaceholderText = "OpenAI API Key", _this18.getKeyLink = "https://platform.openai.com/account/api-keys", _this18.url = "https://api.openai.com/v1/completions", _this18.permittedErrorPrefixes = ["Incorrect"], _this18._maxCharLength = Y.CONVERSE_MAX_CHAR_LENGTH, _this18.full_transaction_max_tokens = 4e3, _this18.numberOfCharsPerToken = 3.5;
|
5668
5670
|
var s = (o = t == null ? void 0 : t.openAI) == null ? void 0 : o.completions;
|
5669
5671
|
i != null && i.characterLimit && (_this18._maxCharLength = i.characterLimit), _typeof(s) == "object" && Object.assign(_this18.rawBody, s), (_a$model = (a = _this18.rawBody).model) !== null && _a$model !== void 0 ? _a$model : a.model = Un.GPT_COMPLETIONS_DAVINCI_MODEL;
|
5670
5672
|
return _this18;
|
@@ -5702,7 +5704,7 @@ var go = /*#__PURE__*/function (_B5) {
|
|
5702
5704
|
throw new Error("Request settings have not been set up");
|
5703
5705
|
case 2:
|
5704
5706
|
i = this.preprocessBody(this.rawBody, t);
|
5705
|
-
this.deepChat.stream || i.stream ? (i.stream = !0,
|
5707
|
+
this.deepChat.stream || i.stream ? (i.stream = !0, F.request(this, i, e)) : S.request(this, i, e);
|
5706
5708
|
case 4:
|
5707
5709
|
case "end":
|
5708
5710
|
return _context47.stop();
|
@@ -5744,12 +5746,12 @@ var go = /*#__PURE__*/function (_B5) {
|
|
5744
5746
|
}()
|
5745
5747
|
}]);
|
5746
5748
|
return go;
|
5747
|
-
}(
|
5748
|
-
var
|
5749
|
-
function
|
5750
|
-
_classCallCheck(this,
|
5749
|
+
}(U);
|
5750
|
+
var Ke = /*#__PURE__*/function () {
|
5751
|
+
function Ke() {
|
5752
|
+
_classCallCheck(this, Ke);
|
5751
5753
|
}
|
5752
|
-
_createClass(
|
5754
|
+
_createClass(Ke, null, [{
|
5753
5755
|
key: "poll",
|
5754
5756
|
value: function () {
|
5755
5757
|
var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(e, t) {
|
@@ -5845,21 +5847,21 @@ var We = /*#__PURE__*/function () {
|
|
5845
5847
|
return {
|
5846
5848
|
url: "https://api.assemblyai.com/v2/upload",
|
5847
5849
|
method: "POST",
|
5848
|
-
handleVerificationResult:
|
5850
|
+
handleVerificationResult: Ke.handleVerificationResult
|
5849
5851
|
};
|
5850
5852
|
}
|
5851
5853
|
}]);
|
5852
|
-
return
|
5854
|
+
return Ke;
|
5853
5855
|
}();
|
5854
|
-
var ji = /*#__PURE__*/function (
|
5855
|
-
_inherits(ji,
|
5856
|
+
var ji = /*#__PURE__*/function (_U6) {
|
5857
|
+
_inherits(ji, _U6);
|
5856
5858
|
var _super25 = _createSuper(ji);
|
5857
5859
|
function ji(e) {
|
5858
5860
|
var _this19;
|
5859
5861
|
_classCallCheck(this, ji);
|
5860
5862
|
var i;
|
5861
5863
|
var t = (i = e.directConnection) == null ? void 0 : i.assemblyAI;
|
5862
|
-
_this19 = _super25.call(this, e,
|
5864
|
+
_this19 = _super25.call(this, e, Ke.buildKeyVerificationDetails(), Ke.buildHeaders, t, {
|
5863
5865
|
audio: {}
|
5864
5866
|
}), _this19.insertKeyPlaceholderText = "AssemblyAI API Key", _this19.getKeyLink = "https://www.assemblyai.com/app/account", _this19.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>AssemblyAI Audio</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"https://www.assemblyai.com/docs/Guides/transcribing_an_audio_file#get-started\">here</a> for more info.\n </p>", _this19.url = "https://api.assemblyai.com/v2/upload", _this19.isTextInputDisabled = !0, _this19.textInputPlaceholderText = "Upload an audio file", _this19.permittedErrorPrefixes = ["Authentication", "Invalid"], _this19.canSendMessage = ji.canFileSendMessage;
|
5865
5867
|
return _this19;
|
@@ -5912,7 +5914,7 @@ var ji = /*#__PURE__*/function (_B6) {
|
|
5912
5914
|
case 2:
|
5913
5915
|
t = (s = (r = this.requestSettings) == null ? void 0 : r.headers) == null ? void 0 : s.Authorization;
|
5914
5916
|
_context51.next = 5;
|
5915
|
-
return
|
5917
|
+
return Ke.poll(t, e.upload_url);
|
5916
5918
|
case 5:
|
5917
5919
|
_context51.t0 = _context51.sent.text;
|
5918
5920
|
return _context51.abrupt("return", {
|
@@ -5936,21 +5938,21 @@ var ji = /*#__PURE__*/function (_B6) {
|
|
5936
5938
|
}
|
5937
5939
|
}]);
|
5938
5940
|
return ji;
|
5939
|
-
}(
|
5940
|
-
var Hn = /*#__PURE__*/function (
|
5941
|
-
_inherits(Hn,
|
5941
|
+
}(U);
|
5942
|
+
var Hn = /*#__PURE__*/function (_U7) {
|
5943
|
+
_inherits(Hn, _U7);
|
5942
5944
|
var _super26 = _createSuper(Hn);
|
5943
5945
|
// prettier-ignore
|
5944
5946
|
function Hn(e, t, i, r, s) {
|
5945
5947
|
var _this20;
|
5946
5948
|
_classCallCheck(this, Hn);
|
5947
|
-
_this20 = _super26.call(this, e,
|
5949
|
+
_this20 = _super26.call(this, e, J.buildSpeechKeyVerificationDetails(i), t, r, s), _this20.insertKeyPlaceholderText = "Azure Speech Subscription Key", _this20.getKeyLink =
|
5948
5950
|
// eslint-disable-next-line max-len
|
5949
5951
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal";
|
5950
5952
|
return _this20;
|
5951
5953
|
}
|
5952
5954
|
return _createClass(Hn);
|
5953
|
-
}(
|
5955
|
+
}(U);
|
5954
5956
|
var Gn = /*#__PURE__*/function (_Hn) {
|
5955
5957
|
_inherits(Vn, _Hn);
|
5956
5958
|
var _super27 = _createSuper(Vn);
|
@@ -5962,7 +5964,7 @@ var Gn = /*#__PURE__*/function (_Hn) {
|
|
5962
5964
|
var r, s, o, a, l, c;
|
5963
5965
|
var t = (s = (r = e.directConnection) == null ? void 0 : r.azure) == null ? void 0 : s.textToSpeech,
|
5964
5966
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
5965
|
-
_this21 = _super27.call(this, e,
|
5967
|
+
_this21 = _super27.call(this, e, J.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, i), _this21.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(Vn.HELP_LINK, "\">here</a> for more info.\n </p>"), _this21.url = "", Object.assign(_this21.rawBody, t), (_a$lang = (a = _this21.rawBody).lang) !== null && _a$lang !== void 0 ? _a$lang : a.lang = "en-US", (_l$name = (l = _this21.rawBody).name) !== null && _l$name !== void 0 ? _l$name : l.name = "en-US-JennyNeural", (_c$gender = (c = _this21.rawBody).gender) !== null && _c$gender !== void 0 ? _c$gender : c.gender = "Female", _this21.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1");
|
5966
5968
|
return _this21;
|
5967
5969
|
}
|
5968
5970
|
_createClass(Vn, [{
|
@@ -6034,12 +6036,12 @@ Gn.HELP_LINK =
|
|
6034
6036
|
// eslint-disable-next-line max-len
|
6035
6037
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
6036
6038
|
var bo = Gn;
|
6037
|
-
var
|
6038
|
-
_inherits(
|
6039
|
-
var _super28 = _createSuper(
|
6040
|
-
function
|
6039
|
+
var Wn = /*#__PURE__*/function (_Hn2) {
|
6040
|
+
_inherits(_i, _Hn2);
|
6041
|
+
var _super28 = _createSuper(_i);
|
6042
|
+
function _i(e) {
|
6041
6043
|
var _this22;
|
6042
|
-
_classCallCheck(this,
|
6044
|
+
_classCallCheck(this, _i);
|
6043
6045
|
var o, a, l;
|
6044
6046
|
var t = (a = (o = e.directConnection) == null ? void 0 : o.azure) == null ? void 0 : a.speechToText,
|
6045
6047
|
i = (l = e.directConnection) == null ? void 0 : l.azure,
|
@@ -6050,12 +6052,12 @@ var Kn = /*#__PURE__*/function (_Hn2) {
|
|
6050
6052
|
}
|
6051
6053
|
}
|
6052
6054
|
};
|
6053
|
-
_this22 = _super28.call(this, e,
|
6055
|
+
_this22 = _super28.call(this, e, J.buildSpeechToTextHeaders, t.region, i, r), _this22.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(_i.HELP_LINK, "\">here</a> for more info.\n </p>"), _this22.url = "", _this22.isTextInputDisabled = !0, _this22.textInputPlaceholderText = "Upload an audio file", _this22.canSendMessage = _i.canFileSendMessage;
|
6054
6056
|
var s = t.lang || "en-US";
|
6055
6057
|
_this22.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(s, "&format=detailed"), _this22.recordAudio = void 0;
|
6056
6058
|
return _this22;
|
6057
6059
|
}
|
6058
|
-
_createClass(
|
6060
|
+
_createClass(_i, [{
|
6059
6061
|
key: "callServiceAPI",
|
6060
6062
|
value: function () {
|
6061
6063
|
var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(e, t, i) {
|
@@ -6120,14 +6122,14 @@ var Kn = /*#__PURE__*/function (_Hn2) {
|
|
6120
6122
|
return !!(t != null && t[0]);
|
6121
6123
|
}
|
6122
6124
|
}]);
|
6123
|
-
return
|
6125
|
+
return _i;
|
6124
6126
|
}(Hn);
|
6125
|
-
|
6127
|
+
Wn.HELP_LINK =
|
6126
6128
|
// eslint-disable-next-line max-len
|
6127
6129
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
6128
|
-
var vo =
|
6129
|
-
var yo = /*#__PURE__*/function (
|
6130
|
-
_inherits(yo,
|
6130
|
+
var vo = Wn;
|
6131
|
+
var yo = /*#__PURE__*/function (_U8) {
|
6132
|
+
_inherits(yo, _U8);
|
6131
6133
|
var _super29 = _createSuper(yo);
|
6132
6134
|
// prettier-ignore
|
6133
6135
|
function yo(e) {
|
@@ -6136,7 +6138,7 @@ var yo = /*#__PURE__*/function (_B8) {
|
|
6136
6138
|
var r, s, o;
|
6137
6139
|
var t = (s = (r = e.directConnection) == null ? void 0 : r.azure) == null ? void 0 : s.translation,
|
6138
6140
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
6139
|
-
_this23 = _super29.call(this, e,
|
6141
|
+
_this23 = _super29.call(this, e, J.buildTranslationKeyVerificationDetails(t.region), J.buildTranslationHeaders.bind({}, t == null ? void 0 : t.region), i), _this23.insertKeyPlaceholderText = "Azure Translate Subscription Key", _this23.getKeyLink =
|
6140
6142
|
// eslint-disable-next-line max-len
|
6141
6143
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this23.url = "", _this23.url = "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=".concat(t.language || "es");
|
6142
6144
|
return _this23;
|
@@ -6206,9 +6208,9 @@ var yo = /*#__PURE__*/function (_B8) {
|
|
6206
6208
|
}()
|
6207
6209
|
}]);
|
6208
6210
|
return yo;
|
6209
|
-
}(
|
6210
|
-
var
|
6211
|
-
_inherits(he,
|
6211
|
+
}(U);
|
6212
|
+
var Vt = /*#__PURE__*/function (_U9) {
|
6213
|
+
_inherits(he, _U9);
|
6212
6214
|
var _super30 = _createSuper(he);
|
6213
6215
|
function he(e) {
|
6214
6216
|
var _this24;
|
@@ -6225,7 +6227,7 @@ var Gt = /*#__PURE__*/function (_B9) {
|
|
6225
6227
|
}
|
6226
6228
|
}
|
6227
6229
|
};
|
6228
|
-
_this24 = _super30.call(this, e,
|
6230
|
+
_this24 = _super30.call(this, e, Y.buildKeyVerificationDetails(), Y.buildHeaders, r, s), _this24.insertKeyPlaceholderText = "OpenAI API Key", _this24.getKeyLink = "https://platform.openai.com/account/api-keys", _this24.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI DALL\xB7E</b></div>\n <p><b>Insert text</b> to generate an image.</p>\n <p><b>Upload 1</b> PNG image to generate its variation and optionally insert text to specify the change.</p>\n <p><b>Upload 2</b> PNG images where the second is a copy of the first with a transparent area where the edit should\n take place and text to specify the edit.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/images/introduction\">here</a> for more info.</p>", _this24.url = "", _this24.permittedErrorPrefixes = ["Incorrect", "Invalid input image"], _this24._maxCharLength = Y.FILE_MAX_CHAR_LENGTH, i != null && i.characterLimit && (_this24._maxCharLength = i.characterLimit);
|
6229
6231
|
var o = (a = t == null ? void 0 : t.openAI) == null ? void 0 : a.images;
|
6230
6232
|
if (_this24.camera) {
|
6231
6233
|
var l = _typeof(o) == "object" && o.size ? Number.parseInt(o.size) : 1024;
|
@@ -6363,13 +6365,13 @@ var Gt = /*#__PURE__*/function (_B9) {
|
|
6363
6365
|
}
|
6364
6366
|
}]);
|
6365
6367
|
return he;
|
6366
|
-
}(
|
6367
|
-
|
6368
|
-
|
6369
|
-
|
6370
|
-
var xo =
|
6371
|
-
var
|
6372
|
-
_inherits(pe,
|
6368
|
+
}(U);
|
6369
|
+
Vt.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations";
|
6370
|
+
Vt.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations";
|
6371
|
+
Vt.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
|
6372
|
+
var xo = Vt;
|
6373
|
+
var Wt = /*#__PURE__*/function (_U10) {
|
6374
|
+
_inherits(pe, _U10);
|
6373
6375
|
var _super31 = _createSuper(pe);
|
6374
6376
|
function pe(e) {
|
6375
6377
|
var _a$model2;
|
@@ -6379,9 +6381,9 @@ var Vt = /*#__PURE__*/function (_B10) {
|
|
6379
6381
|
var t = e.textInput,
|
6380
6382
|
i = JSON.parse(JSON.stringify(e.directConnection)),
|
6381
6383
|
r = i == null ? void 0 : i.openAI;
|
6382
|
-
_this25 = _super31.call(this, e,
|
6384
|
+
_this25 = _super31.call(this, e, Y.buildKeyVerificationDetails(), Y.buildHeaders, r, {
|
6383
6385
|
audio: {}
|
6384
|
-
}), _this25.insertKeyPlaceholderText = "OpenAI API Key", _this25.getKeyLink = "https://platform.openai.com/account/api-keys", _this25.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI Whisper</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/api-reference/audio/create\">here</a> for more info.</p>", _this25.url = "", _this25.permittedErrorPrefixes = ["Invalid"], _this25._maxCharLength =
|
6386
|
+
}), _this25.insertKeyPlaceholderText = "OpenAI API Key", _this25.getKeyLink = "https://platform.openai.com/account/api-keys", _this25.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI Whisper</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/api-reference/audio/create\">here</a> for more info.</p>", _this25.url = "", _this25.permittedErrorPrefixes = ["Invalid"], _this25._maxCharLength = Y.FILE_MAX_CHAR_LENGTH, _this25._service_url = pe.AUDIO_TRANSCRIPTIONS_URL, t != null && t.characterLimit && (_this25._maxCharLength = t.characterLimit);
|
6385
6387
|
var s = (o = i == null ? void 0 : i.openAI) == null ? void 0 : o.audio;
|
6386
6388
|
_typeof(s) == "object" && (_this25.processConfig(s), pe.cleanConfig(s), Object.assign(_this25.rawBody, s)), (_a$model2 = (a = _this25.rawBody).model) !== null && _a$model2 !== void 0 ? _a$model2 : a.model = pe.DEFAULT_MODEL, _this25.rawBody.response_format = "json", _this25.canSendMessage = pe.canSendFileMessage;
|
6387
6389
|
return _this25;
|
@@ -6485,13 +6487,13 @@ var Vt = /*#__PURE__*/function (_B10) {
|
|
6485
6487
|
}
|
6486
6488
|
}]);
|
6487
6489
|
return pe;
|
6488
|
-
}(
|
6489
|
-
|
6490
|
-
|
6491
|
-
|
6492
|
-
var Eo =
|
6493
|
-
var At = /*#__PURE__*/function (
|
6494
|
-
_inherits(At,
|
6490
|
+
}(U);
|
6491
|
+
Wt.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions";
|
6492
|
+
Wt.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations";
|
6493
|
+
Wt.DEFAULT_MODEL = "whisper-1";
|
6494
|
+
var Eo = Wt;
|
6495
|
+
var At = /*#__PURE__*/function (_U11) {
|
6496
|
+
_inherits(At, _U11);
|
6495
6497
|
var _super32 = _createSuper(At);
|
6496
6498
|
function At(e) {
|
6497
6499
|
var _this26$maxMessages, _o$model;
|
@@ -6500,7 +6502,7 @@ var At = /*#__PURE__*/function (_B11) {
|
|
6500
6502
|
var s, o;
|
6501
6503
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6502
6504
|
i = t.openAI;
|
6503
|
-
_this26 = _super32.call(this, e,
|
6505
|
+
_this26 = _super32.call(this, e, Y.buildKeyVerificationDetails(), Y.buildHeaders, i), _this26.insertKeyPlaceholderText = "OpenAI API Key", _this26.getKeyLink = "https://platform.openai.com/account/api-keys", _this26.url = "https://api.openai.com/v1/chat/completions", _this26.permittedErrorPrefixes = ["Incorrect"], _this26._systemMessage = At.generateSystemMessage("You are a helpful assistant.");
|
6504
6506
|
var r = (s = t.openAI) == null ? void 0 : s.chat;
|
6505
6507
|
_typeof(r) == "object" && (r.system_prompt && (_this26._systemMessage = At.generateSystemMessage(r.system_prompt)), _this26.cleanConfig(r), Object.assign(_this26.rawBody, r)), (_this26$maxMessages = _this26.maxMessages) !== null && _this26$maxMessages !== void 0 ? _this26$maxMessages : _this26.maxMessages = -1, (_o$model = (o = _this26.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model = Un.GPT_CHAT_TURBO_MODEL;
|
6506
6508
|
return _this26;
|
@@ -6515,7 +6517,7 @@ var At = /*#__PURE__*/function (_B11) {
|
|
6515
6517
|
key: "preprocessBody",
|
6516
6518
|
value: function preprocessBody(e, t) {
|
6517
6519
|
var i = JSON.parse(JSON.stringify(e)),
|
6518
|
-
r = this.totalMessagesMaxCharLength ||
|
6520
|
+
r = this.totalMessagesMaxCharLength || Y.CONVERSE_MAX_CHAR_LENGTH,
|
6519
6521
|
s = t.filter(function (a) {
|
6520
6522
|
return a.text;
|
6521
6523
|
}),
|
@@ -6542,7 +6544,7 @@ var At = /*#__PURE__*/function (_B11) {
|
|
6542
6544
|
throw new Error("Request settings have not been set up");
|
6543
6545
|
case 2:
|
6544
6546
|
i = this.preprocessBody(this.rawBody, t);
|
6545
|
-
this.deepChat.stream || i.stream ? (i.stream = !0,
|
6547
|
+
this.deepChat.stream || i.stream ? (i.stream = !0, F.request(this, i, e)) : S.request(this, i, e);
|
6546
6548
|
case 4:
|
6547
6549
|
case "end":
|
6548
6550
|
return _context62.stop();
|
@@ -6595,7 +6597,7 @@ var At = /*#__PURE__*/function (_B11) {
|
|
6595
6597
|
}
|
6596
6598
|
}]);
|
6597
6599
|
return At;
|
6598
|
-
}(
|
6600
|
+
}(U);
|
6599
6601
|
var So = /*#__PURE__*/function (_Oi3) {
|
6600
6602
|
_inherits(So, _Oi3);
|
6601
6603
|
var _super33 = _createSuper(So);
|
@@ -6715,26 +6717,26 @@ var wo = /*#__PURE__*/function () {
|
|
6715
6717
|
}]);
|
6716
6718
|
return wo;
|
6717
6719
|
}();
|
6718
|
-
var
|
6719
|
-
function
|
6720
|
-
_classCallCheck(this,
|
6720
|
+
var Kn = /*#__PURE__*/function () {
|
6721
|
+
function ki() {
|
6722
|
+
_classCallCheck(this, ki);
|
6721
6723
|
}
|
6722
|
-
_createClass(
|
6724
|
+
_createClass(ki, null, [{
|
6723
6725
|
key: "appendStyleSheetToHead",
|
6724
6726
|
value: function appendStyleSheetToHead() {
|
6725
6727
|
var e = document.getElementsByTagName("head")[0];
|
6726
6728
|
if (!Array.from(e.getElementsByTagName("link")).some(function (i) {
|
6727
|
-
return i.getAttribute("href") ===
|
6729
|
+
return i.getAttribute("href") === ki.FONT_URL;
|
6728
6730
|
})) {
|
6729
6731
|
var i = document.createElement("link");
|
6730
|
-
i.rel = "stylesheet", i.href =
|
6732
|
+
i.rel = "stylesheet", i.href = ki.FONT_URL, e.appendChild(i);
|
6731
6733
|
}
|
6732
6734
|
}
|
6733
6735
|
}]);
|
6734
|
-
return
|
6736
|
+
return ki;
|
6735
6737
|
}();
|
6736
|
-
|
6737
|
-
var _o =
|
6738
|
+
Kn.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap";
|
6739
|
+
var _o = Kn;
|
6738
6740
|
var Jn = /*#__PURE__*/_createClass(function Jn() {
|
6739
6741
|
_classCallCheck(this, Jn);
|
6740
6742
|
});
|
@@ -6766,11 +6768,11 @@ function y(n) {
|
|
6766
6768
|
i._attributes_[r] = Jn.attibutes[n], i._attributeToProperty_[r] = t;
|
6767
6769
|
};
|
6768
6770
|
}
|
6769
|
-
var
|
6770
|
-
function
|
6771
|
-
_classCallCheck(this,
|
6771
|
+
var Mi = /*#__PURE__*/function () {
|
6772
|
+
function Mi() {
|
6773
|
+
_classCallCheck(this, Mi);
|
6772
6774
|
}
|
6773
|
-
_createClass(
|
6775
|
+
_createClass(Mi, null, [{
|
6774
6776
|
key: "onNewMessage",
|
6775
6777
|
value: function onNewMessage(e, t, i) {
|
6776
6778
|
var r = JSON.parse(JSON.stringify({
|
@@ -6792,7 +6794,7 @@ var ki = /*#__PURE__*/function () {
|
|
6792
6794
|
e.onComponentRender(), e.dispatchEvent(new CustomEvent("render"));
|
6793
6795
|
}
|
6794
6796
|
}]);
|
6795
|
-
return
|
6797
|
+
return Mi;
|
6796
6798
|
}();
|
6797
6799
|
var Yn = /*#__PURE__*/function () {
|
6798
6800
|
function $n() {
|
@@ -6939,7 +6941,7 @@ var le = /*#__PURE__*/function () {
|
|
6939
6941
|
value: function applyClassUtilitiesToElement(e, t) {
|
6940
6942
|
var i = t.events,
|
6941
6943
|
r = t.styles;
|
6942
|
-
i && le.applyEventsToElement(e, i), r && !
|
6944
|
+
i && le.applyEventsToElement(e, i), r && !ie.doesElementContainDeepChatClass(e) && le.applyStylesToElement(e, r);
|
6943
6945
|
}
|
6944
6946
|
}, {
|
6945
6947
|
key: "applyCustomClassUtilities",
|
@@ -6954,7 +6956,7 @@ var le = /*#__PURE__*/function () {
|
|
6954
6956
|
}, {
|
6955
6957
|
key: "apply",
|
6956
6958
|
value: function apply(e, t) {
|
6957
|
-
|
6959
|
+
ie.applyDeepChatUtilities(e, e.htmlClassUtilities, t), le.applyCustomClassUtilities(e.htmlClassUtilities, t);
|
6958
6960
|
}
|
6959
6961
|
}]);
|
6960
6962
|
return le;
|
@@ -6962,7 +6964,7 @@ var le = /*#__PURE__*/function () {
|
|
6962
6964
|
var ko = "deep-chat-temporary-message",
|
6963
6965
|
Mo = "deep-chat-suggestion-button",
|
6964
6966
|
To = "deep-chat-update-message",
|
6965
|
-
|
6967
|
+
Ti = {
|
6966
6968
|
"deep-chat-button": {
|
6967
6969
|
styles: {
|
6968
6970
|
"default": {
|
@@ -6983,12 +6985,12 @@ var ko = "deep-chat-temporary-message",
|
|
6983
6985
|
}
|
6984
6986
|
}
|
6985
6987
|
},
|
6986
|
-
rn = Object.keys(
|
6987
|
-
var
|
6988
|
-
function
|
6989
|
-
_classCallCheck(this,
|
6988
|
+
rn = Object.keys(Ti);
|
6989
|
+
var ie = /*#__PURE__*/function () {
|
6990
|
+
function ie() {
|
6991
|
+
_classCallCheck(this, ie);
|
6990
6992
|
}
|
6991
|
-
_createClass(
|
6993
|
+
_createClass(ie, null, [{
|
6992
6994
|
key: "applySuggestionEvent",
|
6993
6995
|
value: function applySuggestionEvent(e, t) {
|
6994
6996
|
setTimeout(function () {
|
@@ -7021,7 +7023,7 @@ var te = /*#__PURE__*/function () {
|
|
7021
7023
|
}, {
|
7022
7024
|
key: "applyEvents",
|
7023
7025
|
value: function applyEvents(e, t) {
|
7024
|
-
var i =
|
7026
|
+
var i = Ti[t].events;
|
7025
7027
|
Object.keys(i || []).forEach(function (r) {
|
7026
7028
|
e.addEventListener(r, i == null ? void 0 : i[r]);
|
7027
7029
|
});
|
@@ -7034,7 +7036,7 @@ var te = /*#__PURE__*/function () {
|
|
7034
7036
|
var c = (d = e[l]) == null ? void 0 : d.styles;
|
7035
7037
|
return c && e[l].styles && a.push(c), a;
|
7036
7038
|
}, []),
|
7037
|
-
s =
|
7039
|
+
s = Ti[i].styles;
|
7038
7040
|
if (s) {
|
7039
7041
|
var a = JSON.parse(JSON.stringify(s));
|
7040
7042
|
a["default"] && _.overwriteDefaultWithAlreadyApplied(a, t), r.unshift(a);
|
@@ -7048,17 +7050,17 @@ var te = /*#__PURE__*/function () {
|
|
7048
7050
|
rn.forEach(function (s) {
|
7049
7051
|
var o = i.getElementsByClassName(s);
|
7050
7052
|
Array.from(o || []).forEach(function (a) {
|
7051
|
-
var l =
|
7052
|
-
le.applyStylesToElement(a, l),
|
7053
|
+
var l = ie.getProcessedStyles(t, a, s);
|
7054
|
+
le.applyStylesToElement(a, l), ie.applyEvents(a, s);
|
7053
7055
|
});
|
7054
7056
|
});
|
7055
7057
|
var r = i.getElementsByClassName(Mo);
|
7056
7058
|
Array.from(r).forEach(function (s) {
|
7057
|
-
return
|
7059
|
+
return ie.applySuggestionEvent(e, s);
|
7058
7060
|
});
|
7059
7061
|
}
|
7060
7062
|
}]);
|
7061
|
-
return
|
7063
|
+
return ie;
|
7062
7064
|
}();
|
7063
7065
|
var O = /*#__PURE__*/function () {
|
7064
7066
|
function O() {
|
@@ -7191,7 +7193,7 @@ var Xn = /*#__PURE__*/function () {
|
|
7191
7193
|
return yt;
|
7192
7194
|
}();
|
7193
7195
|
Xn.DEFAULT_FILE_NAME = "file";
|
7194
|
-
var
|
7196
|
+
var se = Xn;
|
7195
7197
|
var Fi = /*#__PURE__*/function () {
|
7196
7198
|
function xt() {
|
7197
7199
|
_classCallCheck(this, xt);
|
@@ -7268,7 +7270,7 @@ var De = /*#__PURE__*/function () {
|
|
7268
7270
|
key: "add",
|
7269
7271
|
value: function add(e, t, i, r) {
|
7270
7272
|
var o;
|
7271
|
-
if (
|
7273
|
+
if (ie.isUpdateMessage(t) && De.updateLastAIMessage(e.messages, t, r)) return;
|
7272
7274
|
var s = De.createElements(e, t, i);
|
7273
7275
|
return t.trim().length === 0 && L.editEmptyMessageElement(s.bubbleElement), le.apply(e, s.outerContainer), e.applyCustomStyles(s, i, !1, (o = e.messageStyles) == null ? void 0 : o.html), De.addElement(e, s.outerContainer), s;
|
7274
7276
|
}
|
@@ -7292,15 +7294,15 @@ var Co = /*#__PURE__*/function () {
|
|
7292
7294
|
return Co;
|
7293
7295
|
}();
|
7294
7296
|
var Ao = "<?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>";
|
7295
|
-
var
|
7296
|
-
function
|
7297
|
-
_classCallCheck(this,
|
7297
|
+
var oe = /*#__PURE__*/function () {
|
7298
|
+
function oe() {
|
7299
|
+
_classCallCheck(this, oe);
|
7298
7300
|
}
|
7299
|
-
_createClass(
|
7301
|
+
_createClass(oe, null, [{
|
7300
7302
|
key: "createImage",
|
7301
7303
|
value: function createImage(e, t) {
|
7302
7304
|
var i = new Image();
|
7303
|
-
return i.src = e.src,
|
7305
|
+
return i.src = e.src, se.scrollDownOnImageLoad(i.src, t), se.processContent(i, i.src);
|
7304
7306
|
}
|
7305
7307
|
// WORK - should base64 images be clickable?
|
7306
7308
|
// WORK - image still does not scroll down when loaded
|
@@ -7312,8 +7314,8 @@ var se = /*#__PURE__*/function () {
|
|
7312
7314
|
return _regeneratorRuntime().wrap(function _callee66$(_context66) {
|
7313
7315
|
while (1) switch (_context66.prev = _context66.next) {
|
7314
7316
|
case 0:
|
7315
|
-
r =
|
7316
|
-
s.bubbleElement.appendChild(r), s.bubbleElement.classList.add("image-message"),
|
7317
|
+
r = oe.createImage(t, e.elementRef), s = e.createNewMessageElement("", i);
|
7318
|
+
s.bubbleElement.appendChild(r), s.bubbleElement.classList.add("image-message"), se.addMessage(e, s, "image", i);
|
7317
7319
|
case 2:
|
7318
7320
|
case "end":
|
7319
7321
|
return _context66.stop();
|
@@ -7334,9 +7336,9 @@ var se = /*#__PURE__*/function () {
|
|
7334
7336
|
}, {
|
7335
7337
|
key: "addNewAudioMessage",
|
7336
7338
|
value: function addNewAudioMessage(e, t, i) {
|
7337
|
-
var r =
|
7339
|
+
var r = oe.createAudioElement(t, i),
|
7338
7340
|
s = e.createNewMessageElement("", i);
|
7339
|
-
s.bubbleElement.appendChild(r), s.bubbleElement.classList.add("audio-message"),
|
7341
|
+
s.bubbleElement.appendChild(r), s.bubbleElement.classList.add("audio-message"), se.addMessage(e, s, "audio", i);
|
7340
7342
|
}
|
7341
7343
|
}, {
|
7342
7344
|
key: "createAnyFile",
|
@@ -7345,36 +7347,36 @@ var se = /*#__PURE__*/function () {
|
|
7345
7347
|
t.classList.add("any-file-message-contents");
|
7346
7348
|
var i = document.createElement("div");
|
7347
7349
|
i.classList.add("any-file-message-icon-container");
|
7348
|
-
var r =
|
7350
|
+
var r = B.createSVGElement(Ao);
|
7349
7351
|
r.classList.add("any-file-message-icon"), i.appendChild(r);
|
7350
7352
|
var s = document.createElement("div");
|
7351
|
-
return s.classList.add("any-file-message-text"), s.textContent = e.name ||
|
7353
|
+
return s.classList.add("any-file-message-text"), s.textContent = e.name || se.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(s), se.processContent(t, e.src);
|
7352
7354
|
}
|
7353
7355
|
}, {
|
7354
7356
|
key: "addNewAnyFileMessage",
|
7355
7357
|
value: function addNewAnyFileMessage(e, t, i) {
|
7356
7358
|
var r = e.createNewMessageElement("", i),
|
7357
|
-
s =
|
7358
|
-
r.bubbleElement.classList.add("any-file-message-bubble"), r.bubbleElement.appendChild(s),
|
7359
|
+
s = oe.createAnyFile(t);
|
7360
|
+
r.bubbleElement.classList.add("any-file-message-bubble"), r.bubbleElement.appendChild(s), se.addMessage(e, r, "file", i);
|
7359
7361
|
}
|
7360
7362
|
}, {
|
7361
7363
|
key: "addMessages",
|
7362
7364
|
value: function addMessages(e, t, i) {
|
7363
7365
|
t.forEach(function (r) {
|
7364
7366
|
var s, o;
|
7365
|
-
r.type === "audio" || (s = r.src) != null && s.startsWith("data:audio") ?
|
7367
|
+
r.type === "audio" || (s = r.src) != null && s.startsWith("data:audio") ? oe.addNewAudioMessage(e, r, i) : r.type === "image" || (o = r.src) != null && o.startsWith("data:image") ? oe.addNewImageMessage(e, r, i) : oe.addNewAnyFileMessage(e, r, i);
|
7366
7368
|
});
|
7367
7369
|
}
|
7368
7370
|
}]);
|
7369
|
-
return
|
7371
|
+
return oe;
|
7370
7372
|
}();
|
7371
7373
|
var Io = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8c3ZnIGZpbGw9IiMwMDAwMDAiIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIAoJCXZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+Cgk8cGF0aCBkPSJNMjMsMzAuMzZIOWMtMi40MDQsMC00LjM2LTEuOTU2LTQuMzYtNC4zNlYxNWMwLTIuNDA0LDEuOTU2LTQuMzYsNC4zNi00LjM2aDMuNjU5CgkJYzAuMTY3LTEuNTY2LDEuNDE1LTIuODEzLDIuOTgxLTIuOTgxVjUuMzMzYy0xLjEzMS0wLjE3NC0yLTEuMTU0LTItMi4zMzNjMC0xLjMwMSwxLjA1OS0yLjM2LDIuMzYtMi4zNgoJCWMxLjMwMiwwLDIuMzYsMS4wNTksMi4zNiwyLjM2YzAsMS4xNzktMC44NjksMi4xNTktMiwyLjMzM1Y3LjY2YzEuNTY2LDAuMTY3LDIuODE0LDEuNDE1LDIuOTgxLDIuOTgxSDIzCgkJYzIuNDA0LDAsNC4zNiwxLjk1Niw0LjM2LDQuMzZ2MTFDMjcuMzYsMjguNDA0LDI1LjQwNCwzMC4zNiwyMywzMC4zNnogTTksMTEuMzZjLTIuMDA3LDAtMy42NCwxLjYzMy0zLjY0LDMuNjR2MTEKCQljMCwyLjAwNywxLjYzMywzLjY0LDMuNjQsMy42NGgxNGMyLjAwNywwLDMuNjQtMS42MzMsMy42NC0zLjY0VjE1YzAtMi4wMDctMS42MzMtMy42NC0zLjY0LTMuNjRIOXogTTEzLjM4NCwxMC42NGg1LjIzMQoJCUMxOC40MzksOS4zNTQsMTcuMzM0LDguMzYsMTYsOC4zNkMxNC42NjcsOC4zNiwxMy41NjEsOS4zNTQsMTMuMzg0LDEwLjY0eiBNMTYsMS4zNmMtMC45MDQsMC0xLjY0LDAuNzM2LTEuNjQsMS42NAoJCVMxNS4wOTYsNC42NCwxNiw0LjY0YzAuOTA0LDAsMS42NC0wLjczNiwxLjY0LTEuNjRTMTYuOTA0LDEuMzYsMTYsMS4zNnogTTIwLDI3LjM2aC04Yy0xLjMwMSwwLTIuMzYtMS4wNTktMi4zNi0yLjM2CgkJczEuMDU5LTIuMzYsMi4zNi0yLjM2aDhjMS4zMDIsMCwyLjM2LDEuMDU5LDIuMzYsMi4zNlMyMS4zMDIsMjcuMzYsMjAsMjcuMzZ6IE0xMiwyMy4zNmMtMC45MDQsMC0xLjY0LDAuNzM1LTEuNjQsMS42NAoJCXMwLjczNiwxLjY0LDEuNjQsMS42NGg4YzAuOTA0LDAsMS42NC0wLjczNSwxLjY0LTEuNjRzLTAuNzM1LTEuNjQtMS42NC0xLjY0SDEyeiBNMzEsMjMuODZoLTJjLTAuMTk5LDAtMC4zNi0wLjE2MS0wLjM2LTAuMzZWMTUKCQljMC0wLjE5OSwwLjE2MS0wLjM2LDAuMzYtMC4zNmgyYzAuMTk5LDAsMC4zNiwwLjE2MSwwLjM2LDAuMzZ2OC41QzMxLjM2LDIzLjY5OSwzMS4xOTksMjMuODYsMzEsMjMuODZ6IE0yOS4zNiwyMy4xNGgxLjI3OXYtNy43OAoJCUgyOS4zNlYyMy4xNHogTTMsMjMuODZIMWMtMC4xOTksMC0wLjM2LTAuMTYxLTAuMzYtMC4zNlYxNWMwLTAuMTk5LDAuMTYxLTAuMzYsMC4zNi0wLjM2aDJjMC4xOTksMCwwLjM2LDAuMTYxLDAuMzYsMC4zNnY4LjUKCQlDMy4zNiwyMy42OTksMy4xOTksMjMuODYsMywyMy44NnogTTEuMzYsMjMuMTRoMS4yOHYtNy43OEgxLjM2VjIzLjE0eiBNMjAsMjAuMzZjLTEuMzAyLDAtMi4zNi0xLjA1OS0yLjM2LTIuMzYKCQlzMS4wNTktMi4zNiwyLjM2LTIuMzZzMi4zNiwxLjA1OSwyLjM2LDIuMzZDMjIuMzYsMTkuMzAyLDIxLjMwMiwyMC4zNiwyMCwyMC4zNnogTTIwLDE2LjM2Yy0wLjkwNCwwLTEuNjQsMC43MzYtMS42NCwxLjY0CgkJczAuNzM1LDEuNjQsMS42NCwxLjY0czEuNjQtMC43MzUsMS42NC0xLjY0UzIwLjkwNCwxNi4zNiwyMCwxNi4zNnogTTEyLDIwLjM2Yy0xLjMwMSwwLTIuMzYtMS4wNTktMi4zNi0yLjM2czEuMDU5LTIuMzYsMi4zNi0yLjM2CgkJczIuMzYsMS4wNTksMi4zNiwyLjM2QzE0LjM2LDE5LjMwMiwxMy4zMDEsMjAuMzYsMTIsMjAuMzZ6IE0xMiwxNi4zNmMtMC45MDQsMC0xLjY0LDAuNzM2LTEuNjQsMS42NHMwLjczNiwxLjY0LDEuNjQsMS42NAoJCXMxLjY0LTAuNzM1LDEuNjQtMS42NFMxMi45MDQsMTYuMzYsMTIsMTYuMzZ6Ii8+Cgk8cmVjdCBzdHlsZT0iZmlsbDpub25lOyIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIi8+Cjwvc3ZnPg==",
|
7372
7374
|
Lo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAMAAAC/MqoPAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAADNQTFRF////9vX18vLy/Pz86enp4+Li2tnZ1tbWzczM+fn57Ozs4N/f09LS0M/P5uXl7+/v3dzcwtncCAAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAZNSURBVHja7d3bdtsqEABQYABZSLH9/3+ZpnUsIcF5iOM6PfElNoMHMfPQdq3GmL0GkLhEUqLaUExnOtOZznSmM53pTGc605nOdKYznelMZzrTmV4LXSqllKyJDkob26xWq8Zae/iH0QoWTm9d1xur4WuypQJtTd+5dqn0VjcxzNO5/57mEBvdLo8Oron6aseWOjYOFkVvjQs3DmgyONMuht52EfztP+4hdu0i6LCO808/M8c1lE/fuPGej41uUzgdtoO/75N+2ELJ9I3b3//hPXbiMenm3pR/Jt4USgcLBIp4Bh10gqKVhvLo0klCxeSky96nKcj3siw6pJIL4XsoiQ7apyvMY/V3HHrSRioLopvEhSpTCn2TPEuwKYMOIX0tAxRBf/Hpa+lfSqBv9gi1FPsNfTrMAiVmIE/vJhz61FGnQxRIEYE4vfNYdN8Rp6MlHaHotHTn8ejekaZPAjEmyvQWdZFTtYTpXqCGJ0zvcek9Yfoel76nS0ffv1NMp1ca+pkgyfRCGind4L7OWWc605l+cxjsyhqy9AGbPpClc1/nvl5VX0c/3Alk6RU3+Am7shNZ+h6bvidLr7jBB+zKBrL0irOOudmIUDzTmf5gIP+iEuXtRuTVaEmY/oZLfyNMrzjryPc0gerMTdpVg0tvjJUU6bLPcGOoUv46SLL6Wi8yhLf06C7TUyekI0efRaaYqdFltkeNpPumRPSMDxgBYvSM035FrKAmH72hRW99PrpvSdEHkTEGUvSsK3yKVDkuJ92RohcZaehzzirPpOg+J92Tolfc4Cumx5xVXpGiZ34+ICX6W84qv5GiR5NPbiIpOv6BCoSvSkTX+eiaGP092zINvBOj4x8mSf9FqejvNo/cvpOji19ZbmviL0GPLsYMFzgzCor0+Bv/ePDvSJKOb9dJ5UlnbnEHiHgzv6cdTpJOWuc/u3FEucLDOL75xGtBiefrcwgoC9NDSH/jkH6pAuXmBqPQ9HSUPVdZBH1GGOrMXAQdYxcKZfxAoK+KKBKFLosoEoX+u4giUehz8jlcnAuhp78I46yDYNAd+QLR6K+pr+yvxdBTHyVDubQh0UfSxaHSd0lbvNkVRE87JGOtc+PQd2QLQ6fHhJkKsSh6yg13tO08JPprsgrrXWH0dJd2vH1MLPprot4eXoujpzrdhngiD40ek2y92lggPcnWa8qN1Yz0BFuvZhRl0uOfR0v4Ewuli/Bg4Qr3lArqGdndQ3UPO1EunXYwnelMZzrTmc50pjOd6UxnOtOZznSmM53pTGf6kuj6oedFKV0s3fX6sX1S3bsi6a4PD7+/YAqYeBw6pIB/4qEgOqxdSPbGiim4NRRCbzs3Jj0L4UfXtQXQVRfn5IdA/Bw7RZzurEV6EtdsLeGXkIPuA+K1UoVeA0l62zmN/LqfSSft9KkepmoRuvi3nd5uKNFB9zbbXEANqdr941XO0NJx2v2jdJenpf+/3bvn0ts16ph+sd6hX7dPo2+2cZzE02Ia43bzDHqr+2Evnhz74ZHU30ffbKOeng1/NPV30Ns1gYQnSP2P6e65Pfxc6h02XZqXQCjhJ6kPL6bFo4NrGvAU4UII4SE2P1vQuZkuOxckVfehisF1MjUddN/MZBN+kvq5uf0O/xa66gyNS9ktMWlz44rO1Z8C19i5FPdHzPamXn+F3hryPfxMr78+4F+kq22kO6Rf6fUQt+puuustyWv4rbG3l/duztFB96GYoe1cTBdXMr+nw9qVM6ZfxOvzezff0nXi/ZOndvrR6Zvpm0c3h6nhdb+5iS7tsIim/qXZD9+97/Jf+rpZ5BET1ayv0GUzLhEuhBBjIy/RdVPgndutIRt9nt7p5cKFEEJ3Z+jQFDZL+XnMDXxHB73gxn5s9Kc3d3/pFciFkN/QTSXHJpX5l66gDrkQoP6hL3xsPw39la4qOiV8tH78XeSbue6N9mvWa6J/ybpc1CT1Wnh5Qq9meP8IOKH3ddH7E/ri1iYux/SXDrXR4UiPdck/wUpU+FtPf6/orja6O9KL3l56LOvVxe5Ib2qjN0d6Vbex4ghWlU3bPqI90If66MNng680FNpbJijH6kCvaF3uMzQ3+IrpFerV4Y9dffQdN3im10ivbuImhD3Qq5u4HdZkua8znelMZ/pS4z9CPVKkxowNxgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0wMy0yN1QxNTo0NToxNSswMDowMN1xSg4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDMtMjdUMTU6NDU6MTUrMDA6MDCsLPKyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==";
|
7373
|
-
var
|
7374
|
-
function
|
7375
|
-
_classCallCheck(this,
|
7375
|
+
var ae = /*#__PURE__*/function () {
|
7376
|
+
function ae() {
|
7377
|
+
_classCallCheck(this, ae);
|
7376
7378
|
}
|
7377
|
-
_createClass(
|
7379
|
+
_createClass(ae, null, [{
|
7378
7380
|
key: "applyCustomStylesToElements",
|
7379
7381
|
value: function applyCustomStylesToElements(e, t, i) {
|
7380
7382
|
Object.assign(e.style, i.container), Object.assign(t.style, i.avatar);
|
@@ -7384,7 +7386,7 @@ var oe = /*#__PURE__*/function () {
|
|
7384
7386
|
key: "applyCustomStyles",
|
7385
7387
|
value: function applyCustomStyles(e, t, i, r) {
|
7386
7388
|
var s, o, a;
|
7387
|
-
(s = i["default"]) != null && s.styles &&
|
7389
|
+
(s = i["default"]) != null && s.styles && ae.applyCustomStylesToElements(e, t, i["default"].styles), r ? (o = i.ai) != null && o.styles && ae.applyCustomStylesToElements(e, t, i.ai.styles) : (a = i.user) != null && a.styles && ae.applyCustomStylesToElements(e, t, i.user.styles);
|
7388
7390
|
}
|
7389
7391
|
}, {
|
7390
7392
|
key: "createAvatar",
|
@@ -7393,7 +7395,7 @@ var oe = /*#__PURE__*/function () {
|
|
7393
7395
|
var i = document.createElement("img");
|
7394
7396
|
e ? i.src = ((s = t == null ? void 0 : t.ai) == null ? void 0 : s.src) || ((o = t == null ? void 0 : t["default"]) == null ? void 0 : o.src) || Io : i.src = ((a = t == null ? void 0 : t.user) == null ? void 0 : a.src) || ((l = t == null ? void 0 : t["default"]) == null ? void 0 : l.src) || Lo, i.classList.add("avatar");
|
7395
7397
|
var r = document.createElement("div");
|
7396
|
-
return r.classList.add("avatar-container"), r.appendChild(i), t &&
|
7398
|
+
return r.classList.add("avatar-container"), r.appendChild(i), t && ae.applyCustomStyles(r, i, t, e), r;
|
7397
7399
|
}
|
7398
7400
|
// prettier-ignore
|
7399
7401
|
}, {
|
@@ -7408,12 +7410,12 @@ var oe = /*#__PURE__*/function () {
|
|
7408
7410
|
key: "add",
|
7409
7411
|
value: function add(e, t, i) {
|
7410
7412
|
var r = typeof i == "boolean" ? void 0 : i,
|
7411
|
-
s =
|
7412
|
-
o =
|
7413
|
+
s = ae.createAvatar(t, r),
|
7414
|
+
o = ae.getPosition(t, r);
|
7413
7415
|
s.classList.add(o === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(o === "left" ? "beforebegin" : "afterend", s);
|
7414
7416
|
}
|
7415
7417
|
}]);
|
7416
|
-
return
|
7418
|
+
return ae;
|
7417
7419
|
}();
|
7418
7420
|
var Ne = /*#__PURE__*/function () {
|
7419
7421
|
function Ne() {
|
@@ -7464,7 +7466,7 @@ var L = /*#__PURE__*/function () {
|
|
7464
7466
|
var r = t.permittedErrorPrefixes,
|
7465
7467
|
s = t.introPanelMarkUp,
|
7466
7468
|
o = t.demo;
|
7467
|
-
this._remarkable =
|
7469
|
+
this._remarkable = Si.createNew(), this.elementRef = L.createContainerElement(), this.messageStyles = e.messageStyles, this._avatars = e.avatars, this._names = e.names, this._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), this._onNewMessage = Mi.onNewMessage.bind(this, e), this._onClearMessages = Mi.onClearMessages.bind(this, e), this._displayLoadingMessage = L.getDisplayLoadingMessage(e, t), this._permittedErrorPrefixes = r, this.addSetupMessageIfNeeded(e, t), this.populateIntroPanel(i, s, e.introPanelStyle), e.introMessage && this.addIntroductoryMessage(e.introMessage), e.initialMessages && this.populateInitialMessages(e.initialMessages), this._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
|
7468
7470
|
return JSON.parse(JSON.stringify(_this29.messages));
|
7469
7471
|
}, e.clearMessages = this.clearMessages.bind(this), e.refreshMessages = this.refreshTextMessages.bind(this), e.scrollToBottom = this.scrollToBottom.bind(this), o && this.prepareDemo(o), e.textToSpeech && mt.processConfig(e.textToSpeech, function (c) {
|
7470
7472
|
_this29._textToSpeech = c;
|
@@ -7503,7 +7505,7 @@ var L = /*#__PURE__*/function () {
|
|
7503
7505
|
value: function populateInitialMessages(e) {
|
7504
7506
|
var _this30 = this;
|
7505
7507
|
e.forEach(function (t) {
|
7506
|
-
|
7508
|
+
Ut.processInitialMessageFile(t), _this30.addNewMessage(t, t.role === Lt.AI_ROLE, !0);
|
7507
7509
|
}), setTimeout(function () {
|
7508
7510
|
return _this30.scrollToBottom();
|
7509
7511
|
});
|
@@ -7517,7 +7519,7 @@ var L = /*#__PURE__*/function () {
|
|
7517
7519
|
}, {
|
7518
7520
|
key: "addInnerContainerElements",
|
7519
7521
|
value: function addInnerContainerElements(e, t, i) {
|
7520
|
-
return e.classList.add("message-bubble", i ? "ai-message-text" : "user-message-text"), e.innerHTML = this._remarkable.render(t), e.innerText.trim().length === 0 && (e.innerText = t), this._avatars &&
|
7522
|
+
return e.classList.add("message-bubble", i ? "ai-message-text" : "user-message-text"), e.innerHTML = this._remarkable.render(t), e.innerText.trim().length === 0 && (e.innerText = t), this._avatars && ae.add(e, i, this._avatars), this._names && Ne.add(e, i, this._names), {
|
7521
7523
|
bubbleElement: e
|
7522
7524
|
};
|
7523
7525
|
}
|
@@ -7558,9 +7560,9 @@ var L = /*#__PURE__*/function () {
|
|
7558
7560
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
7559
7561
|
var r = !0;
|
7560
7562
|
var s = L.createMessageContent(t, e);
|
7561
|
-
if (s.text !== void 0 && e.text !== null && (this.addNewTextMessage(s.text, t), !i && this._textToSpeech && t && mt.speak(s.text, this._textToSpeech)), s.files && Array.isArray(s.files) &&
|
7563
|
+
if (s.text !== void 0 && e.text !== null && (this.addNewTextMessage(s.text, t), !i && this._textToSpeech && t && mt.speak(s.text, this._textToSpeech)), s.files && Array.isArray(s.files) && oe.addMessages(this, s.files, t), s.html !== void 0 && s.html !== null) {
|
7562
7564
|
var o = De.add(this, s.html, t, this._messageElementRefs);
|
7563
|
-
|
7565
|
+
ie.isElementTemporary(o) && delete s.html, r = !!o;
|
7564
7566
|
}
|
7565
7567
|
this.updateStateOnMessage(s, r, i);
|
7566
7568
|
}
|
@@ -7694,7 +7696,7 @@ var L = /*#__PURE__*/function () {
|
|
7694
7696
|
return _context67.abrupt("return", Promise.all((e || []).map(function (t) {
|
7695
7697
|
return new Promise(function (i) {
|
7696
7698
|
if (!t.type || t.type === "any") {
|
7697
|
-
var r = t.file.name ||
|
7699
|
+
var r = t.file.name || se.DEFAULT_FILE_NAME;
|
7698
7700
|
i({
|
7699
7701
|
name: r,
|
7700
7702
|
type: "any"
|
@@ -7745,7 +7747,7 @@ var L = /*#__PURE__*/function () {
|
|
7745
7747
|
key: "refreshTextMessages",
|
7746
7748
|
value: function refreshTextMessages() {
|
7747
7749
|
var _this31 = this;
|
7748
|
-
this._remarkable =
|
7750
|
+
this._remarkable = Si.createNew(), this._textElementsToText.forEach(function (e) {
|
7749
7751
|
e[0].bubbleElement.innerHTML = _this31._remarkable.render(e[1]);
|
7750
7752
|
});
|
7751
7753
|
}
|
@@ -7788,7 +7790,7 @@ var L = /*#__PURE__*/function () {
|
|
7788
7790
|
}, {
|
7789
7791
|
key: "isTemporaryElement",
|
7790
7792
|
value: function isTemporaryElement(e) {
|
7791
|
-
return (e == null ? void 0 : e.bubbleElement.classList.contains("loading-message-text")) ||
|
7793
|
+
return (e == null ? void 0 : e.bubbleElement.classList.contains("loading-message-text")) || ie.isElementTemporary(e);
|
7792
7794
|
}
|
7793
7795
|
}, {
|
7794
7796
|
key: "editEmptyMessageElement",
|
@@ -7804,10 +7806,10 @@ var L = /*#__PURE__*/function () {
|
|
7804
7806
|
return L;
|
7805
7807
|
}();
|
7806
7808
|
var st = /*#__PURE__*/function () {
|
7807
|
-
function
|
7808
|
-
_classCallCheck(this,
|
7809
|
+
function G() {
|
7810
|
+
_classCallCheck(this, G);
|
7809
7811
|
}
|
7810
|
-
_createClass(
|
7812
|
+
_createClass(G, null, [{
|
7811
7813
|
key: "adjustInputPadding",
|
7812
7814
|
value: function adjustInputPadding(e, t) {
|
7813
7815
|
t["inside-left"].length > 0 && e.classList.add("text-input-inner-left-adjustment"), t["inside-right"].length > 0 && e.classList.add("text-input-inner-right-adjustment");
|
@@ -7815,7 +7817,7 @@ var st = /*#__PURE__*/function () {
|
|
7815
7817
|
}, {
|
7816
7818
|
key: "adjustForOutsideButton",
|
7817
7819
|
value: function adjustForOutsideButton(e, t, i) {
|
7818
|
-
i["outside-right"].length === 0 && i["outside-left"].length > 0 ? (e[0].classList.add(
|
7820
|
+
i["outside-right"].length === 0 && i["outside-left"].length > 0 ? (e[0].classList.add(G.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS), t.classList.add(G.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS)) : i["outside-left"].length === 0 && i["outside-right"].length > 0 && (e[3].classList.add(G.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS), t.classList.add(G.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS));
|
7819
7821
|
}
|
7820
7822
|
// when submit is the only button
|
7821
7823
|
// when submit button is outside by itself - we increase the height for a better look
|
@@ -7823,10 +7825,10 @@ var st = /*#__PURE__*/function () {
|
|
7823
7825
|
key: "adjustOutsideSubmit",
|
7824
7826
|
value: function adjustOutsideSubmit(e, t, i) {
|
7825
7827
|
if (!(i["inside-left"].length > 0 || i["inside-right"].length > 0)) {
|
7826
|
-
if (i["outside-right"].length === 0 && i["outside-left"].length > 0) return e[0].classList.add(
|
7828
|
+
if (i["outside-right"].length === 0 && i["outside-left"].length > 0) return e[0].classList.add(G.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), t.classList.add(G.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), i["outside-left"].map(function (r) {
|
7827
7829
|
return r.button.elementRef.classList.add("submit-button-enlarged");
|
7828
7830
|
});
|
7829
|
-
if (i["outside-left"].length === 0 && i["outside-right"].length > 0) return e[3].classList.add(
|
7831
|
+
if (i["outside-left"].length === 0 && i["outside-right"].length > 0) return e[3].classList.add(G.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), t.classList.add(G.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), i["outside-right"].map(function (r) {
|
7830
7832
|
return r.button.elementRef.classList.add("submit-button-enlarged");
|
7831
7833
|
});
|
7832
7834
|
}
|
@@ -7834,10 +7836,10 @@ var st = /*#__PURE__*/function () {
|
|
7834
7836
|
}, {
|
7835
7837
|
key: "set",
|
7836
7838
|
value: function set(e, t, i, r) {
|
7837
|
-
!!
|
7839
|
+
!!G.adjustOutsideSubmit(t, i, r) || G.adjustForOutsideButton(t, i, r), G.adjustInputPadding(e, r);
|
7838
7840
|
}
|
7839
7841
|
}]);
|
7840
|
-
return
|
7842
|
+
return G;
|
7841
7843
|
}();
|
7842
7844
|
st.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS = "text-input-container-left-adjustment";
|
7843
7845
|
st.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS = "text-input-container-right-adjustment";
|
@@ -7892,7 +7894,7 @@ var R = /*#__PURE__*/function () {
|
|
7892
7894
|
}, {
|
7893
7895
|
key: "createElement",
|
7894
7896
|
value: function createElement(e, t) {
|
7895
|
-
return t ? R.createTextElement(e) :
|
7897
|
+
return t ? R.createTextElement(e) : B.createSVGElement(e);
|
7896
7898
|
}
|
7897
7899
|
}, {
|
7898
7900
|
key: "createCustomElement",
|
@@ -7933,11 +7935,11 @@ var R = /*#__PURE__*/function () {
|
|
7933
7935
|
return R;
|
7934
7936
|
}();
|
7935
7937
|
var No = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16 0c-8.836 0-16 7.163-16 16s7.163 16 16 16c8.837 0 16-7.163 16-16s-7.163-16-16-16zM16 30.032c-7.72 0-14-6.312-14-14.032s6.28-14 14-14 14 6.28 14 14-6.28 14.032-14 14.032zM23 15h-6v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1v6h-6c-0.552 0-1 0.448-1 1s0.448 1 1 1h6v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6h6c0.552 0 1-0.448 1-1s-0.448-1-1-1z\"></path>\n</svg>";
|
7936
|
-
var
|
7937
|
-
function
|
7938
|
-
_classCallCheck(this,
|
7938
|
+
var Z = /*#__PURE__*/function () {
|
7939
|
+
function Z() {
|
7940
|
+
_classCallCheck(this, Z);
|
7939
7941
|
}
|
7940
|
-
_createClass(
|
7942
|
+
_createClass(Z, null, [{
|
7941
7943
|
key: "unsetAllCSS",
|
7942
7944
|
value: function unsetAllCSS(e, t) {
|
7943
7945
|
var i, r;
|
@@ -7958,10 +7960,10 @@ var $ = /*#__PURE__*/function () {
|
|
7958
7960
|
}, {
|
7959
7961
|
key: "setElementCssUpToState",
|
7960
7962
|
value: function setElementCssUpToState(e, t, i) {
|
7961
|
-
|
7963
|
+
Z.setElementsCSS(e, t, "default"), i !== "default" && (Z.setElementsCSS(e, t, "hover"), i !== "hover" && Z.setElementsCSS(e, t, "click"));
|
7962
7964
|
}
|
7963
7965
|
}]);
|
7964
|
-
return
|
7966
|
+
return Z;
|
7965
7967
|
}();
|
7966
7968
|
var ot = /*#__PURE__*/function () {
|
7967
7969
|
function ot(e, t, i, r) {
|
@@ -7973,22 +7975,22 @@ var ot = /*#__PURE__*/function () {
|
|
7973
7975
|
_createClass(ot, [{
|
7974
7976
|
key: "buttonMouseLeave",
|
7975
7977
|
value: function buttonMouseLeave(e) {
|
7976
|
-
this._mouseState.state = "default", e && (
|
7978
|
+
this._mouseState.state = "default", e && (Z.unsetAllCSS(this.elementRef, e), Z.setElementsCSS(this.elementRef, e, "default"));
|
7977
7979
|
}
|
7978
7980
|
}, {
|
7979
7981
|
key: "buttonMouseEnter",
|
7980
7982
|
value: function buttonMouseEnter(e) {
|
7981
|
-
this._mouseState.state = "hover", e &&
|
7983
|
+
this._mouseState.state = "hover", e && Z.setElementsCSS(this.elementRef, e, "hover");
|
7982
7984
|
}
|
7983
7985
|
}, {
|
7984
7986
|
key: "buttonMouseUp",
|
7985
7987
|
value: function buttonMouseUp(e) {
|
7986
|
-
e &&
|
7988
|
+
e && Z.unsetActionCSS(this.elementRef, e), this.buttonMouseEnter(e);
|
7987
7989
|
}
|
7988
7990
|
}, {
|
7989
7991
|
key: "buttonMouseDown",
|
7990
7992
|
value: function buttonMouseDown(e) {
|
7991
|
-
this._mouseState.state = "click", e &&
|
7993
|
+
this._mouseState.state = "click", e && Z.setElementsCSS(this.elementRef, e, "click");
|
7992
7994
|
}
|
7993
7995
|
// be careful not to use onclick as that is used for button functionality
|
7994
7996
|
}, {
|
@@ -8002,7 +8004,7 @@ var ot = /*#__PURE__*/function () {
|
|
8002
8004
|
if (this._customStyles) for (var t = 0; t < e.length; t += 1) {
|
8003
8005
|
var i = e[t],
|
8004
8006
|
r = i && this._customStyles[i];
|
8005
|
-
r &&
|
8007
|
+
r && Z.unsetActionCSS(this.elementRef, r);
|
8006
8008
|
}
|
8007
8009
|
}
|
8008
8010
|
}, {
|
@@ -8011,7 +8013,7 @@ var ot = /*#__PURE__*/function () {
|
|
8011
8013
|
if (!this._customStyles) return;
|
8012
8014
|
t && this.unsetCustomStateStyles(t);
|
8013
8015
|
var i = this._customStyles[e];
|
8014
|
-
i &&
|
8016
|
+
i && Z.setElementCssUpToState(this.elementRef, i, this._mouseState.state), this.setEvents(i);
|
8015
8017
|
}
|
8016
8018
|
}]);
|
8017
8019
|
return ot;
|
@@ -8195,7 +8197,7 @@ var je = /*#__PURE__*/function (_ot) {
|
|
8195
8197
|
}, {
|
8196
8198
|
key: "createSVGIconElement",
|
8197
8199
|
value: function createSVGIconElement() {
|
8198
|
-
var e =
|
8200
|
+
var e = B.createSVGElement(No);
|
8199
8201
|
return e.id = "dropup-icon", e;
|
8200
8202
|
}
|
8201
8203
|
}, {
|
@@ -8336,7 +8338,7 @@ var be = /*#__PURE__*/function () {
|
|
8336
8338
|
var r = be.createImageAttachment(t);
|
8337
8339
|
this.addFileAttachment(e, "image", r, i);
|
8338
8340
|
} else if (e.type.startsWith("audio")) {
|
8339
|
-
var _r3 =
|
8341
|
+
var _r3 = Ci.createAudioAttachment(t);
|
8340
8342
|
this.addFileAttachment(e, "audio", _r3, i);
|
8341
8343
|
} else {
|
8342
8344
|
var _r4 = be.createAnyFileAttachment(e.name);
|
@@ -8377,7 +8379,7 @@ var be = /*#__PURE__*/function () {
|
|
8377
8379
|
return s === e;
|
8378
8380
|
}),
|
8379
8381
|
i = this._attachments[t].attachmentContainerElement;
|
8380
|
-
this._attachments.splice(t, 1),
|
8382
|
+
this._attachments.splice(t, 1), Ci.stopAttachmentPlayback(i), i.remove(), this._toggleContainerDisplay(!1), (r = this._validationHandler) == null || r.call(this);
|
8381
8383
|
}
|
8382
8384
|
}, {
|
8383
8385
|
key: "getFiles",
|
@@ -8474,7 +8476,7 @@ var Fo = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
8474
8476
|
i.classList.add("audio-placeholder-text-3-digits");
|
8475
8477
|
var r = document.createElement("div");
|
8476
8478
|
r.classList.add("file-attachment-text-container", "audio-placeholder-text-3-digits-container"), r.appendChild(i);
|
8477
|
-
var s =
|
8479
|
+
var s = B.createSVGElement(on);
|
8478
8480
|
return s.classList.add("attachment-icon", "stop-icon", "not-removable-attachment-icon"), i.textContent = "0:00", this._activePlaceholderTimer = this.createTimer(i, e), t.appendChild(r), this.addPlaceholderAudioAttachmentEvents(t, s, r), t;
|
8479
8481
|
}
|
8480
8482
|
}, {
|
@@ -8530,9 +8532,9 @@ var Fo = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
8530
8532
|
var i = e.parentElement ? Kt.cloneElement(e) : e,
|
8531
8533
|
r = document.createElement("audio");
|
8532
8534
|
r.src = t;
|
8533
|
-
var s =
|
8535
|
+
var s = B.createSVGElement(Fo);
|
8534
8536
|
s.classList.add("attachment-icon", "play-icon");
|
8535
|
-
var o =
|
8537
|
+
var o = B.createSVGElement(on);
|
8536
8538
|
o.classList.add("attachment-icon", "stop-icon"), i.replaceChildren(s), r.onplay = function () {
|
8537
8539
|
i.replaceChildren(o);
|
8538
8540
|
}, r.onpause = function () {
|
@@ -8559,7 +8561,7 @@ var Fo = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
8559
8561
|
return fe;
|
8560
8562
|
}(be);
|
8561
8563
|
er.TIMER_LIMIT_S = 5999;
|
8562
|
-
var
|
8564
|
+
var Ci = er;
|
8563
8565
|
var Bo = /*#__PURE__*/function () {
|
8564
8566
|
function Bo() {
|
8565
8567
|
_classCallCheck(this, Bo);
|
@@ -8569,7 +8571,7 @@ var Bo = /*#__PURE__*/function () {
|
|
8569
8571
|
value:
|
8570
8572
|
// prettier-ignore
|
8571
8573
|
function create(e, t, i, r, s) {
|
8572
|
-
return s === "audio" ? new
|
8574
|
+
return s === "audio" ? new Ci(e, t, i, r) : new be(e, t, i, r);
|
8573
8575
|
}
|
8574
8576
|
}]);
|
8575
8577
|
return Bo;
|
@@ -8674,11 +8676,11 @@ var at = /*#__PURE__*/function () {
|
|
8674
8676
|
return at;
|
8675
8677
|
}();
|
8676
8678
|
var tr = /*#__PURE__*/function () {
|
8677
|
-
function
|
8678
|
-
_classCallCheck(this,
|
8679
|
-
this._isOpen = !1, this._contentRef =
|
8679
|
+
function ee(e, t, i) {
|
8680
|
+
_classCallCheck(this, ee);
|
8681
|
+
this._isOpen = !1, this._contentRef = ee.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = ee.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = ee.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = ee.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents();
|
8680
8682
|
}
|
8681
|
-
_createClass(
|
8683
|
+
_createClass(ee, [{
|
8682
8684
|
key: "isOpen",
|
8683
8685
|
value: function isOpen() {
|
8684
8686
|
return this._isOpen;
|
@@ -8700,7 +8702,7 @@ var tr = /*#__PURE__*/function () {
|
|
8700
8702
|
var _this40 = this;
|
8701
8703
|
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 () {
|
8702
8704
|
_this40._elementRef.style.display = "none", _this40._backgroundPanelRef.style.display = "none";
|
8703
|
-
},
|
8705
|
+
}, ee.MODAL_CLOSE_TIMEOUT_MS);
|
8704
8706
|
}
|
8705
8707
|
}, {
|
8706
8708
|
key: "displayModalElements",
|
@@ -8716,7 +8718,7 @@ var tr = /*#__PURE__*/function () {
|
|
8716
8718
|
key: "addCloseButton",
|
8717
8719
|
value: function addCloseButton(e, t, i) {
|
8718
8720
|
var _this41 = this;
|
8719
|
-
var r = t ?
|
8721
|
+
var r = t ? ee.createSVGButton(e) : ee.createTextButton(e);
|
8720
8722
|
return this.addButtons(r), r.onclick = function () {
|
8721
8723
|
_this41.close(), setTimeout(function () {
|
8722
8724
|
i == null || i();
|
@@ -8768,7 +8770,7 @@ var tr = /*#__PURE__*/function () {
|
|
8768
8770
|
value: function createSVGButton(e) {
|
8769
8771
|
var t = document.createElement("div");
|
8770
8772
|
t.classList.add("modal-button", "modal-svg-button");
|
8771
|
-
var i =
|
8773
|
+
var i = B.createSVGElement(e);
|
8772
8774
|
return i.classList.add("modal-svg-button-icon"), t.appendChild(i), t;
|
8773
8775
|
}
|
8774
8776
|
}, {
|
@@ -8776,12 +8778,12 @@ var tr = /*#__PURE__*/function () {
|
|
8776
8778
|
value: function createTextModalFunc(e, t, i) {
|
8777
8779
|
var r;
|
8778
8780
|
if (_typeof(t) == "object" && (r = t.files) != null && r.infoModal) {
|
8779
|
-
var s = new
|
8781
|
+
var s = new ee(e, ["modal-content"], t.files.infoModal.containerStyle);
|
8780
8782
|
return s.addCloseButton("OK", !1, i), s.openTextModal.bind(s, t.infoModalTextMarkUp || "");
|
8781
8783
|
}
|
8782
8784
|
}
|
8783
8785
|
}]);
|
8784
|
-
return
|
8786
|
+
return ee;
|
8785
8787
|
}();
|
8786
8788
|
tr.MODAL_CLOSE_TIMEOUT_MS = 190;
|
8787
8789
|
var Ve = tr;
|
@@ -8848,21 +8850,21 @@ var Je = /*#__PURE__*/function (_ot2) {
|
|
8848
8850
|
}, {
|
8849
8851
|
key: "createSVGIconElement",
|
8850
8852
|
value: function createSVGIconElement(e, t) {
|
8851
|
-
var i =
|
8853
|
+
var i = B.createSVGElement(t);
|
8852
8854
|
return i.id = e, i;
|
8853
8855
|
}
|
8854
8856
|
}]);
|
8855
8857
|
return Je;
|
8856
8858
|
}(ot);
|
8857
|
-
var
|
8858
|
-
function
|
8859
|
-
_classCallCheck(this,
|
8859
|
+
var te = /*#__PURE__*/function () {
|
8860
|
+
function te() {
|
8861
|
+
_classCallCheck(this, te);
|
8860
8862
|
}
|
8861
|
-
_createClass(
|
8863
|
+
_createClass(te, null, [{
|
8862
8864
|
key: "create",
|
8863
8865
|
value: function create(e, t, i) {
|
8864
|
-
var r =
|
8865
|
-
|
8866
|
+
var r = te.createElement(i);
|
8867
|
+
te.addEvents(r, e, t), e.appendChild(r);
|
8866
8868
|
}
|
8867
8869
|
}, {
|
8868
8870
|
key: "createElement",
|
@@ -8874,13 +8876,13 @@ var ee = /*#__PURE__*/function () {
|
|
8874
8876
|
key: "addEvents",
|
8875
8877
|
value: function addEvents(e, t, i) {
|
8876
8878
|
t.ondragenter = function (r) {
|
8877
|
-
r.preventDefault(),
|
8879
|
+
r.preventDefault(), te.display(e);
|
8878
8880
|
}, e.ondragleave = function (r) {
|
8879
|
-
r.preventDefault(),
|
8881
|
+
r.preventDefault(), te.hide(e);
|
8880
8882
|
}, e.ondragover = function (r) {
|
8881
8883
|
r.preventDefault();
|
8882
8884
|
}, e.ondrop = function (r) {
|
8883
|
-
r.preventDefault(),
|
8885
|
+
r.preventDefault(), te.uploadFile(i, r), te.hide(e);
|
8884
8886
|
};
|
8885
8887
|
}
|
8886
8888
|
}, {
|
@@ -8906,7 +8908,7 @@ var ee = /*#__PURE__*/function () {
|
|
8906
8908
|
return t !== void 0 && t === !1 ? !1 : !!t || e.getNumberOfTypes() > 0;
|
8907
8909
|
}
|
8908
8910
|
}]);
|
8909
|
-
return
|
8911
|
+
return te;
|
8910
8912
|
}();
|
8911
8913
|
var Rt = /*#__PURE__*/function () {
|
8912
8914
|
function Rt() {
|
@@ -8949,22 +8951,23 @@ var Rt = /*#__PURE__*/function () {
|
|
8949
8951
|
}, {
|
8950
8952
|
key: "attach",
|
8951
8953
|
value: function attach(e, t, i, r, s) {
|
8954
|
+
var o = e.validateInput || Ut.processValidateInput(e);
|
8952
8955
|
e._validationHandler = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71() {
|
8953
|
-
var
|
8954
|
-
|
8956
|
+
var a,
|
8957
|
+
l,
|
8955
8958
|
_args71 = arguments;
|
8956
8959
|
return _regeneratorRuntime().wrap(function _callee71$(_context71) {
|
8957
8960
|
while (1) switch (_context71.prev = _context71.next) {
|
8958
8961
|
case 0:
|
8959
|
-
|
8962
|
+
a = _args71.length > 0 && _args71[0] !== undefined ? _args71[0] : !1;
|
8960
8963
|
if (!(t.isSubmitProgrammaticallyDisabled === !0 || !Rt.validateWebsocket(t, s))) {
|
8961
8964
|
_context71.next = 3;
|
8962
8965
|
break;
|
8963
8966
|
}
|
8964
8967
|
return _context71.abrupt("return", !1);
|
8965
8968
|
case 3:
|
8966
|
-
|
8967
|
-
return _context71.abrupt("return",
|
8969
|
+
l = o || t.canSendMessage;
|
8970
|
+
return _context71.abrupt("return", l ? Rt.useValidationFunc(l, i, r, s, a) : null);
|
8968
8971
|
case 5:
|
8969
8972
|
case "end":
|
8970
8973
|
return _context71.stop();
|
@@ -9047,15 +9050,15 @@ var tt = /*#__PURE__*/function (_ot3) {
|
|
9047
9050
|
}, {
|
9048
9051
|
key: "createSVGIconElement",
|
9049
9052
|
value: function createSVGIconElement() {
|
9050
|
-
var e =
|
9053
|
+
var e = B.createSVGElement(Uo);
|
9051
9054
|
return e.id = "microphone-icon", e;
|
9052
9055
|
}
|
9053
9056
|
}]);
|
9054
9057
|
return tt;
|
9055
9058
|
}(ot);
|
9056
9059
|
var ir = {},
|
9057
|
-
Wt = {},
|
9058
9060
|
Jt = {},
|
9061
|
+
Yt = {},
|
9059
9062
|
lt = {},
|
9060
9063
|
_e = {};
|
9061
9064
|
Object.defineProperty(_e, "__esModule", {
|
@@ -9116,10 +9119,10 @@ var Ho = /*#__PURE__*/function () {
|
|
9116
9119
|
return Ho;
|
9117
9120
|
}();
|
9118
9121
|
lt.Translate = Ho;
|
9119
|
-
Object.defineProperty(
|
9122
|
+
Object.defineProperty(Yt, "__esModule", {
|
9120
9123
|
value: !0
|
9121
9124
|
});
|
9122
|
-
|
9125
|
+
Yt.WebSpeechTranscript = void 0;
|
9123
9126
|
var an = lt;
|
9124
9127
|
var Go = /*#__PURE__*/function () {
|
9125
9128
|
function Go() {
|
@@ -9157,30 +9160,30 @@ var Go = /*#__PURE__*/function () {
|
|
9157
9160
|
}]);
|
9158
9161
|
return Go;
|
9159
9162
|
}();
|
9160
|
-
|
9163
|
+
Yt.WebSpeechTranscript = Go;
|
9161
9164
|
var Ue = {};
|
9162
9165
|
Object.defineProperty(Ue, "__esModule", {
|
9163
9166
|
value: !0
|
9164
9167
|
});
|
9165
9168
|
Ue.Browser = void 0;
|
9166
|
-
var
|
9167
|
-
_classCallCheck(this,
|
9169
|
+
var We = /*#__PURE__*/_createClass(function We() {
|
9170
|
+
_classCallCheck(this, We);
|
9168
9171
|
});
|
9169
|
-
Ue.Browser =
|
9170
|
-
|
9171
|
-
return
|
9172
|
+
Ue.Browser = We;
|
9173
|
+
We.IS_SAFARI = function () {
|
9174
|
+
return We._IS_SAFARI === void 0 && (We._IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), We._IS_SAFARI;
|
9172
9175
|
};
|
9173
9176
|
var ct = {},
|
9174
|
-
|
9175
|
-
Object.defineProperty(
|
9177
|
+
$t = {};
|
9178
|
+
Object.defineProperty($t, "__esModule", {
|
9176
9179
|
value: !0
|
9177
9180
|
});
|
9178
|
-
|
9179
|
-
var
|
9180
|
-
function
|
9181
|
-
_classCallCheck(this,
|
9181
|
+
$t.EventListeners = void 0;
|
9182
|
+
var W = /*#__PURE__*/function () {
|
9183
|
+
function W() {
|
9184
|
+
_classCallCheck(this, W);
|
9182
9185
|
}
|
9183
|
-
_createClass(
|
9186
|
+
_createClass(W, null, [{
|
9184
9187
|
key: "getElementIfFocusedOnAvailable",
|
9185
9188
|
value: function getElementIfFocusedOnAvailable(e, t) {
|
9186
9189
|
return Array.isArray(e) ? e.find(function (i) {
|
@@ -9191,14 +9194,14 @@ var V = /*#__PURE__*/function () {
|
|
9191
9194
|
key: "keyDownWindow",
|
9192
9195
|
value: function keyDownWindow(e) {
|
9193
9196
|
var _this45 = this;
|
9194
|
-
e.element &&
|
9195
|
-
|
9197
|
+
e.element && W.getElementIfFocusedOnAvailable(e.element, document.activeElement) && (W.KEY_DOWN_TIMEOUT !== null && clearTimeout(W.KEY_DOWN_TIMEOUT), W.KEY_DOWN_TIMEOUT = setTimeout(function () {
|
9198
|
+
W.KEY_DOWN_TIMEOUT = null, _this45.resetRecording(e);
|
9196
9199
|
}, 500));
|
9197
9200
|
}
|
9198
9201
|
}, {
|
9199
9202
|
key: "mouseDownWindow",
|
9200
9203
|
value: function mouseDownWindow(e, t) {
|
9201
|
-
this.mouseDownElement =
|
9204
|
+
this.mouseDownElement = W.getElementIfFocusedOnAvailable(e, t.target);
|
9202
9205
|
}
|
9203
9206
|
}, {
|
9204
9207
|
key: "mouseUpWindow",
|
@@ -9209,7 +9212,7 @@ var V = /*#__PURE__*/function () {
|
|
9209
9212
|
key: "add",
|
9210
9213
|
value: function add(e, t) {
|
9211
9214
|
var i = (t == null ? void 0 : t.insertInCursorLocation) === void 0 || (t == null ? void 0 : t.insertInCursorLocation);
|
9212
|
-
t != null && t.element && i && (e.mouseDownEvent =
|
9215
|
+
t != null && t.element && i && (e.mouseDownEvent = W.mouseDownWindow.bind(e, t.element), document.addEventListener("mousedown", e.mouseDownEvent), e.mouseUpEvent = W.mouseUpWindow.bind(e, t), document.addEventListener("mouseup", e.mouseUpEvent), e.keyDownEvent = W.keyDownWindow.bind(e, t), document.addEventListener("keydown", e.keyDownEvent));
|
9213
9216
|
}
|
9214
9217
|
}, {
|
9215
9218
|
key: "remove",
|
@@ -9217,15 +9220,15 @@ var V = /*#__PURE__*/function () {
|
|
9217
9220
|
document.removeEventListener("mousedown", e.mouseDownEvent), document.removeEventListener("mouseup", e.mouseUpEvent), document.removeEventListener("keydown", e.keyDownEvent);
|
9218
9221
|
}
|
9219
9222
|
}]);
|
9220
|
-
return
|
9223
|
+
return W;
|
9221
9224
|
}();
|
9222
|
-
|
9223
|
-
|
9224
|
-
var
|
9225
|
-
Object.defineProperty(
|
9225
|
+
$t.EventListeners = W;
|
9226
|
+
W.KEY_DOWN_TIMEOUT = null;
|
9227
|
+
var Zt = {};
|
9228
|
+
Object.defineProperty(Zt, "__esModule", {
|
9226
9229
|
value: !0
|
9227
9230
|
});
|
9228
|
-
|
9231
|
+
Zt.PreResultUtils = void 0;
|
9229
9232
|
var Vo = /*#__PURE__*/function () {
|
9230
9233
|
function Vo() {
|
9231
9234
|
_classCallCheck(this, Vo);
|
@@ -9241,7 +9244,7 @@ var Vo = /*#__PURE__*/function () {
|
|
9241
9244
|
}]);
|
9242
9245
|
return Vo;
|
9243
9246
|
}();
|
9244
|
-
|
9247
|
+
Zt.PreResultUtils = Vo;
|
9245
9248
|
var dt = {},
|
9246
9249
|
ut = {};
|
9247
9250
|
Object.defineProperty(ut, "__esModule", {
|
@@ -9290,11 +9293,11 @@ Object.defineProperty(ke, "__esModule", {
|
|
9290
9293
|
value: !0
|
9291
9294
|
});
|
9292
9295
|
ke.Elements = void 0;
|
9293
|
-
var
|
9294
|
-
function
|
9295
|
-
_classCallCheck(this,
|
9296
|
+
var Wo = /*#__PURE__*/function () {
|
9297
|
+
function Wo() {
|
9298
|
+
_classCallCheck(this, Wo);
|
9296
9299
|
}
|
9297
|
-
_createClass(
|
9300
|
+
_createClass(Wo, null, [{
|
9298
9301
|
key: "isPrimitiveElement",
|
9299
9302
|
value: function isPrimitiveElement(e) {
|
9300
9303
|
return e.tagName === "INPUT" || e.tagName === "TEXTAREA";
|
@@ -9335,9 +9338,9 @@ var Ko = /*#__PURE__*/function () {
|
|
9335
9338
|
return e.getRootNode() instanceof ShadowRoot;
|
9336
9339
|
}
|
9337
9340
|
}]);
|
9338
|
-
return
|
9341
|
+
return Wo;
|
9339
9342
|
}();
|
9340
|
-
ke.Elements =
|
9343
|
+
ke.Elements = Wo;
|
9341
9344
|
var Me = {};
|
9342
9345
|
Object.defineProperty(Me, "__esModule", {
|
9343
9346
|
value: !0
|
@@ -9430,15 +9433,15 @@ Object.defineProperty(dt, "__esModule", {
|
|
9430
9433
|
});
|
9431
9434
|
dt.CommandUtils = void 0;
|
9432
9435
|
var ln = ut,
|
9433
|
-
|
9436
|
+
Ko = ke,
|
9434
9437
|
Jo = Ue,
|
9435
9438
|
cn = Me,
|
9436
9439
|
dn = _e;
|
9437
|
-
var
|
9438
|
-
function
|
9439
|
-
_classCallCheck(this,
|
9440
|
+
var V = /*#__PURE__*/function () {
|
9441
|
+
function V() {
|
9442
|
+
_classCallCheck(this, V);
|
9440
9443
|
}
|
9441
|
-
_createClass(
|
9444
|
+
_createClass(V, null, [{
|
9442
9445
|
key: "processCommand",
|
9443
9446
|
value: function processCommand(e, t) {
|
9444
9447
|
return (!t || !t.caseSensitive) && (e = e.toLowerCase()), (t == null ? void 0 : t.substrings) === !1 ? dn.Text.breakupIntoWordsArr(e) : e;
|
@@ -9449,7 +9452,7 @@ var G = /*#__PURE__*/function () {
|
|
9449
9452
|
var t;
|
9450
9453
|
return ((t = e.settings) === null || t === void 0 ? void 0 : t.caseSensitive) === !0 ? e : Object.keys(e).reduce(function (r, s) {
|
9451
9454
|
var o = e[s];
|
9452
|
-
return r[s] = typeof o == "string" ?
|
9455
|
+
return r[s] = typeof o == "string" ? V.processCommand(o, e.settings) : o, r;
|
9453
9456
|
}, {});
|
9454
9457
|
}
|
9455
9458
|
}, {
|
@@ -9467,7 +9470,7 @@ var G = /*#__PURE__*/function () {
|
|
9467
9470
|
}, {
|
9468
9471
|
key: "setText",
|
9469
9472
|
value: function setText(e, t, i, r) {
|
9470
|
-
|
9473
|
+
V.toggleCommandModeOff(e), Ko.Elements.isPrimitiveElement(r) ? (r.value = i, e.isTargetInShadow || cn.Cursor.setOffsetForPrimitive(r, i.length, !0), Jo.Browser.IS_SAFARI() && e.autoScroll && ln.AutoScroll.scrollSafariPrimitiveToEnd(r)) : (r.textContent = i, e.isTargetInShadow || cn.Cursor.focusEndOfGeneric(r), setTimeout(function () {
|
9471
9474
|
return ln.AutoScroll.scrollGeneric(e, r);
|
9472
9475
|
})), e.resetRecording(t);
|
9473
9476
|
}
|
@@ -9497,44 +9500,44 @@ var G = /*#__PURE__*/function () {
|
|
9497
9500
|
if (!c || !r || !i) return;
|
9498
9501
|
var d = ((o = c.settings) === null || o === void 0 ? void 0 : o.caseSensitive) === !0 ? t : t.toLowerCase(),
|
9499
9502
|
u = dn.Text.breakupIntoWordsArr(d),
|
9500
|
-
p = ((a = c.settings) === null || a === void 0 ? void 0 : a.substrings) === !1 ?
|
9503
|
+
p = ((a = c.settings) === null || a === void 0 ? void 0 : a.substrings) === !1 ? V.checkIfMatchesWord : V.checkIfMatchesSubstring;
|
9501
9504
|
if (c.commandMode && p(c.commandMode, d, u)) return e.setInterimColorToFinal(), setTimeout(function () {
|
9502
|
-
return
|
9505
|
+
return V.toggleCommandModeOn(e);
|
9503
9506
|
}), {
|
9504
9507
|
doNotProcessTranscription: !1
|
9505
9508
|
};
|
9506
9509
|
if (!(c.commandMode && !e.isWaitingForCommand)) {
|
9507
|
-
if (c.stop && p(c.stop, d, u)) return
|
9510
|
+
if (c.stop && p(c.stop, d, u)) return V.toggleCommandModeOff(e), setTimeout(function () {
|
9508
9511
|
return e.stop();
|
9509
9512
|
}), {
|
9510
9513
|
doNotProcessTranscription: !1
|
9511
9514
|
};
|
9512
|
-
if (c.pause && p(c.pause, d, u)) return
|
9515
|
+
if (c.pause && p(c.pause, d, u)) return V.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
|
9513
9516
|
var h;
|
9514
9517
|
e.isPaused = !0, (h = e.onPauseTrigger) === null || h === void 0 || h.call(e, !0);
|
9515
9518
|
}), {
|
9516
9519
|
doNotProcessTranscription: !1
|
9517
9520
|
};
|
9518
|
-
if (c.resume && p(c.resume, d, u)) return e.isPaused = !1, (l = e.onPauseTrigger) === null || l === void 0 || l.call(e, !1),
|
9521
|
+
if (c.resume && p(c.resume, d, u)) return e.isPaused = !1, (l = e.onPauseTrigger) === null || l === void 0 || l.call(e, !1), V.toggleCommandModeOff(e), e.resetRecording(i), {
|
9519
9522
|
doNotProcessTranscription: !0
|
9520
9523
|
};
|
9521
|
-
if (c.reset && p(c.reset, d, u)) return s !== void 0 &&
|
9524
|
+
if (c.reset && p(c.reset, d, u)) return s !== void 0 && V.setText(e, i, s, r), {
|
9522
9525
|
doNotProcessTranscription: !0
|
9523
9526
|
};
|
9524
|
-
if (c.removeAllText && p(c.removeAllText, d, u)) return
|
9527
|
+
if (c.removeAllText && p(c.removeAllText, d, u)) return V.setText(e, i, "", r), {
|
9525
9528
|
doNotProcessTranscription: !0
|
9526
9529
|
};
|
9527
9530
|
}
|
9528
9531
|
}
|
9529
9532
|
}]);
|
9530
|
-
return
|
9533
|
+
return V;
|
9531
9534
|
}();
|
9532
|
-
dt.CommandUtils =
|
9533
|
-
var
|
9534
|
-
Object.defineProperty(
|
9535
|
+
dt.CommandUtils = V;
|
9536
|
+
var Qt = {};
|
9537
|
+
Object.defineProperty(Qt, "__esModule", {
|
9535
9538
|
value: !0
|
9536
9539
|
});
|
9537
|
-
|
9540
|
+
Qt.Highlight = void 0;
|
9538
9541
|
var Yo = ke,
|
9539
9542
|
qe = Me;
|
9540
9543
|
var Nt = /*#__PURE__*/function () {
|
@@ -9586,12 +9589,12 @@ var Nt = /*#__PURE__*/function () {
|
|
9586
9589
|
}]);
|
9587
9590
|
return Nt;
|
9588
9591
|
}();
|
9589
|
-
|
9590
|
-
var
|
9591
|
-
Object.defineProperty(
|
9592
|
+
Qt.Highlight = Nt;
|
9593
|
+
var Xt = {};
|
9594
|
+
Object.defineProperty(Xt, "__esModule", {
|
9592
9595
|
value: !0
|
9593
9596
|
});
|
9594
|
-
|
9597
|
+
Xt.Padding = void 0;
|
9595
9598
|
var $o = ke,
|
9596
9599
|
un = Me,
|
9597
9600
|
Ae = _e;
|
@@ -9653,25 +9656,25 @@ var Ot = /*#__PURE__*/function () {
|
|
9653
9656
|
}]);
|
9654
9657
|
return Ot;
|
9655
9658
|
}();
|
9656
|
-
|
9659
|
+
Xt.Padding = Ot;
|
9657
9660
|
Object.defineProperty(ct, "__esModule", {
|
9658
9661
|
value: !0
|
9659
9662
|
});
|
9660
9663
|
ct.Speech = void 0;
|
9661
|
-
var hn =
|
9662
|
-
Zo =
|
9664
|
+
var hn = $t,
|
9665
|
+
Zo = Zt,
|
9663
9666
|
pn = dt,
|
9664
9667
|
gt = ut,
|
9665
|
-
hi = Zt,
|
9666
|
-
Z = ke,
|
9667
9668
|
pi = Qt,
|
9669
|
+
Q = ke,
|
9670
|
+
fi = Xt,
|
9668
9671
|
fn = Ue,
|
9669
9672
|
mn = Me,
|
9670
|
-
|
9673
|
+
mi = _e;
|
9671
9674
|
var Qo = /*#__PURE__*/function () {
|
9672
9675
|
function Qo() {
|
9673
9676
|
_classCallCheck(this, Qo);
|
9674
|
-
this.finalTranscript = "", this.interimSpan =
|
9677
|
+
this.finalTranscript = "", this.interimSpan = Q.Elements.createInterimSpan(), this.finalSpan = Q.Elements.createGenericSpan(), this.scrollingSpan = Q.Elements.createGenericSpan(), this.isCursorAtEnd = !1, this.spansPopulated = !1, this.startPadding = "", this.endPadding = "", this.numberOfSpacesBeforeNewText = 0, this.numberOfSpacesAfterNewText = 0, this.isHighlighted = !1, this.primitiveTextRecorded = !1, this.recognizing = !1, this._displayInterimResults = !0, this.insertInCursorLocation = !0, this.autoScroll = !0, this.isRestarting = !1, this.isPaused = !1, this.isWaitingForCommand = !1, this.isTargetInShadow = !1, this.cannotBeStopped = !1, this.resetState();
|
9675
9678
|
}
|
9676
9679
|
_createClass(Qo, [{
|
9677
9680
|
key: "prepareBeforeStart",
|
@@ -9684,12 +9687,12 @@ var Qo = /*#__PURE__*/function () {
|
|
9684
9687
|
if (!s) return;
|
9685
9688
|
this.prepare(s);
|
9686
9689
|
} else this.prepare(e.element);
|
9687
|
-
(e == null ? void 0 : e.displayInterimResults) !== void 0 && (this._displayInterimResults = e.displayInterimResults), e != null && e.textColor && (this._finalTextColor = (t = e == null ? void 0 : e.textColor) === null || t === void 0 ? void 0 : t["final"],
|
9690
|
+
(e == null ? void 0 : e.displayInterimResults) !== void 0 && (this._displayInterimResults = e.displayInterimResults), e != null && e.textColor && (this._finalTextColor = (t = e == null ? void 0 : e.textColor) === null || t === void 0 ? void 0 : t["final"], Q.Elements.applyCustomColors(this, e.textColor)), (e == null ? void 0 : e.insertInCursorLocation) !== void 0 && (this.insertInCursorLocation = e.insertInCursorLocation), (e == null ? void 0 : e.autoScroll) !== void 0 && (this.autoScroll = e.autoScroll), this._onResult = e == null ? void 0 : e.onResult, this._onPreResult = e == null ? void 0 : e.onPreResult, this._onStart = e == null ? void 0 : e.onStart, this._onStop = e == null ? void 0 : e.onStop, this._onError = e == null ? void 0 : e.onError, this.onCommandModeTrigger = e == null ? void 0 : e.onCommandModeTrigger, this.onPauseTrigger = e == null ? void 0 : e.onPauseTrigger, this._options = e, !((i = this._options) === null || i === void 0) && i.commands && (this.commands = pn.CommandUtils.process(this._options.commands));
|
9688
9691
|
}
|
9689
9692
|
}, {
|
9690
9693
|
key: "prepare",
|
9691
9694
|
value: function prepare(e) {
|
9692
|
-
|
9695
|
+
fi.Padding.setState(this, e), pi.Highlight.setState(this, e), this.isTargetInShadow = Q.Elements.isInsideShadowDOM(e), Q.Elements.isPrimitiveElement(e) ? (this._primitiveElement = e, this._originalText = this._primitiveElement.value) : (this._genericElement = e, this._originalText = this._genericElement.textContent);
|
9693
9696
|
}
|
9694
9697
|
// there was an attempt to optimize this by not having to restart the service and just reset state:
|
9695
9698
|
// unfortunately it did not work because the service would still continue firing the intermediate and final results
|
@@ -9704,7 +9707,7 @@ var Qo = /*#__PURE__*/function () {
|
|
9704
9707
|
key: "updateElements",
|
9705
9708
|
value: function updateElements(e, t, i) {
|
9706
9709
|
var r;
|
9707
|
-
var s =
|
9710
|
+
var s = mi.Text.capitalize(t);
|
9708
9711
|
if (this.finalTranscript === s && e === "") return;
|
9709
9712
|
Zo.PreResultUtils.process(this, i, e === "", this._onPreResult, this._options) && (e = "", i = "");
|
9710
9713
|
var o = this.commands && pn.CommandUtils.execCommand(this, i, this._options, this._primitiveElement || this._genericElement, this._originalText);
|
@@ -9722,7 +9725,7 @@ var Qo = /*#__PURE__*/function () {
|
|
9722
9725
|
}, {
|
9723
9726
|
key: "updatePrimitiveElement",
|
9724
9727
|
value: function updatePrimitiveElement(e, t, i) {
|
9725
|
-
this.isHighlighted &&
|
9728
|
+
this.isHighlighted && pi.Highlight.removeForPrimitive(this, e), this.primitiveTextRecorded || fi.Padding.adjustStateAfterRecodingPrimitiveElement(this, e), i && fi.Padding.adjustSateForNoTextPrimitiveElement(this);
|
9726
9729
|
var r = this.startPadding + this.finalTranscript + t;
|
9727
9730
|
if (e.value = r + this.endPadding, !this.isTargetInShadow) {
|
9728
9731
|
var s = r.length + this.numberOfSpacesAfterNewText;
|
@@ -9733,18 +9736,18 @@ var Qo = /*#__PURE__*/function () {
|
|
9733
9736
|
}, {
|
9734
9737
|
key: "updateGenericElement",
|
9735
9738
|
value: function updateGenericElement(e, t, i) {
|
9736
|
-
this.isHighlighted &&
|
9737
|
-
var r = (i ? "" : this.startPadding) +
|
9739
|
+
this.isHighlighted && pi.Highlight.removeForGeneric(this, e), this.spansPopulated || Q.Elements.appendSpans(this, e);
|
9740
|
+
var r = (i ? "" : this.startPadding) + mi.Text.lineBreak(this.finalTranscript);
|
9738
9741
|
this.finalSpan.innerHTML = r;
|
9739
9742
|
var s = gt.AutoScroll.isRequired(this.autoScroll, e);
|
9740
9743
|
gt.AutoScroll.changeStateIfNeeded(this, s);
|
9741
|
-
var o =
|
9744
|
+
var o = mi.Text.lineBreak(t) + (i ? "" : this.endPadding);
|
9742
9745
|
this.interimSpan.innerHTML = o, fn.Browser.IS_SAFARI() && this.insertInCursorLocation && mn.Cursor.setOffsetForSafariGeneric(e, r.length + o.length), s && gt.AutoScroll.scrollGeneric(this, e), i && (this.scrollingSpan.innerHTML = "");
|
9743
9746
|
}
|
9744
9747
|
}, {
|
9745
9748
|
key: "finalise",
|
9746
9749
|
value: function finalise(e) {
|
9747
|
-
this._genericElement && (e ? (this.finalSpan =
|
9750
|
+
this._genericElement && (e ? (this.finalSpan = Q.Elements.createGenericSpan(), this.setInterimColorToFinal(), this.interimSpan = Q.Elements.createInterimSpan(), this.scrollingSpan = Q.Elements.createGenericSpan()) : this._genericElement.textContent = this._genericElement.textContent, this.spansPopulated = !1), hn.EventListeners.remove(this);
|
9748
9751
|
}
|
9749
9752
|
}, {
|
9750
9753
|
key: "setInterimColorToFinal",
|
@@ -9778,11 +9781,11 @@ var Qo = /*#__PURE__*/function () {
|
|
9778
9781
|
return Qo;
|
9779
9782
|
}();
|
9780
9783
|
ct.Speech = Qo;
|
9781
|
-
Object.defineProperty(
|
9784
|
+
Object.defineProperty(Jt, "__esModule", {
|
9782
9785
|
value: !0
|
9783
9786
|
});
|
9784
|
-
|
9785
|
-
var gn =
|
9787
|
+
Jt.WebSpeech = void 0;
|
9788
|
+
var gn = Yt,
|
9786
9789
|
bn = Ue,
|
9787
9790
|
Xo = ct;
|
9788
9791
|
var Pt = /*#__PURE__*/function (_Xo$Speech) {
|
@@ -9851,12 +9854,12 @@ var Pt = /*#__PURE__*/function (_Xo$Speech) {
|
|
9851
9854
|
}]);
|
9852
9855
|
return Pt;
|
9853
9856
|
}(Xo.Speech);
|
9854
|
-
|
9855
|
-
var
|
9856
|
-
Object.defineProperty(
|
9857
|
+
Jt.WebSpeech = Pt;
|
9858
|
+
var ei = {};
|
9859
|
+
Object.defineProperty(ei, "__esModule", {
|
9857
9860
|
value: !0
|
9858
9861
|
});
|
9859
|
-
|
9862
|
+
ei.GlobalState = void 0;
|
9860
9863
|
var ze = /*#__PURE__*/function () {
|
9861
9864
|
function ze() {
|
9862
9865
|
_classCallCheck(this, ze);
|
@@ -9871,14 +9874,14 @@ var ze = /*#__PURE__*/function () {
|
|
9871
9874
|
}]);
|
9872
9875
|
return ze;
|
9873
9876
|
}();
|
9874
|
-
|
9877
|
+
ei.GlobalState = ze;
|
9875
9878
|
ze.doubleClickPending = !1;
|
9876
|
-
var
|
9877
|
-
|
9878
|
-
Object.defineProperty(
|
9879
|
+
var ti = {},
|
9880
|
+
ii = {};
|
9881
|
+
Object.defineProperty(ii, "__esModule", {
|
9879
9882
|
value: !0
|
9880
9883
|
});
|
9881
|
-
|
9884
|
+
ii.PreventConnectionStop = void 0;
|
9882
9885
|
var ea = /*#__PURE__*/function () {
|
9883
9886
|
function ea() {
|
9884
9887
|
_classCallCheck(this, ea);
|
@@ -9898,19 +9901,19 @@ var ea = /*#__PURE__*/function () {
|
|
9898
9901
|
}]);
|
9899
9902
|
return ea;
|
9900
9903
|
}();
|
9901
|
-
|
9902
|
-
var
|
9903
|
-
|
9904
|
-
Object.defineProperty(
|
9904
|
+
ii.PreventConnectionStop = ea;
|
9905
|
+
var ni = {},
|
9906
|
+
ri = {};
|
9907
|
+
Object.defineProperty(ri, "__esModule", {
|
9905
9908
|
value: !0
|
9906
9909
|
});
|
9907
|
-
|
9908
|
-
|
9909
|
-
Object.defineProperty(
|
9910
|
+
ri.README_URL = void 0;
|
9911
|
+
ri.README_URL = "https://github.com/OvidijusParsiunas/speech-to-element";
|
9912
|
+
Object.defineProperty(ni, "__esModule", {
|
9910
9913
|
value: !0
|
9911
9914
|
});
|
9912
|
-
|
9913
|
-
var
|
9915
|
+
ni.AzureSpeechConfig = void 0;
|
9916
|
+
var gi = ri;
|
9914
9917
|
var Dt = /*#__PURE__*/function () {
|
9915
9918
|
function Dt() {
|
9916
9919
|
_classCallCheck(this, Dt);
|
@@ -9918,7 +9921,7 @@ var Dt = /*#__PURE__*/function () {
|
|
9918
9921
|
_createClass(Dt, null, [{
|
9919
9922
|
key: "validateOptions",
|
9920
9923
|
value: function validateOptions(e, t) {
|
9921
|
-
return t ? !t.subscriptionKey && !t.token && !t.retrieveToken ? (e("Please define a 'subscriptionKey', 'token' or 'retrieveToken' property - more info: ".concat(
|
9924
|
+
return t ? !t.subscriptionKey && !t.token && !t.retrieveToken ? (e("Please define a 'subscriptionKey', 'token' or 'retrieveToken' property - more info: ".concat(gi.README_URL)), !1) : t.region ? !0 : (e("Please define a 'region' property - more info: ".concat(gi.README_URL)), !1) : (e("Please provide subscription details - more info: ".concat(gi.README_URL)), !1);
|
9922
9925
|
}
|
9923
9926
|
}, {
|
9924
9927
|
key: "getNewSpeechConfig",
|
@@ -9979,12 +9982,12 @@ var Dt = /*#__PURE__*/function () {
|
|
9979
9982
|
}]);
|
9980
9983
|
return Dt;
|
9981
9984
|
}();
|
9982
|
-
|
9983
|
-
var
|
9984
|
-
Object.defineProperty(
|
9985
|
+
ni.AzureSpeechConfig = Dt;
|
9986
|
+
var si = {};
|
9987
|
+
Object.defineProperty(si, "__esModule", {
|
9985
9988
|
value: !0
|
9986
9989
|
});
|
9987
|
-
|
9990
|
+
si.StopTimeout = void 0;
|
9988
9991
|
var it = /*#__PURE__*/function () {
|
9989
9992
|
function it() {
|
9990
9993
|
_classCallCheck(this, it);
|
@@ -10004,13 +10007,13 @@ var it = /*#__PURE__*/function () {
|
|
10004
10007
|
}]);
|
10005
10008
|
return it;
|
10006
10009
|
}();
|
10007
|
-
|
10010
|
+
si.StopTimeout = it;
|
10008
10011
|
it.DEFAULT_MS = 2e4;
|
10009
|
-
var
|
10010
|
-
Object.defineProperty(
|
10012
|
+
var oi = {};
|
10013
|
+
Object.defineProperty(oi, "__esModule", {
|
10011
10014
|
value: !0
|
10012
10015
|
});
|
10013
|
-
|
10016
|
+
oi.AzureTranscript = void 0;
|
10014
10017
|
var ta = lt;
|
10015
10018
|
var ia = /*#__PURE__*/function () {
|
10016
10019
|
function ia() {
|
@@ -10034,15 +10037,15 @@ var ia = /*#__PURE__*/function () {
|
|
10034
10037
|
}]);
|
10035
10038
|
return ia;
|
10036
10039
|
}();
|
10037
|
-
|
10038
|
-
Object.defineProperty(
|
10040
|
+
oi.AzureTranscript = ia;
|
10041
|
+
Object.defineProperty(ti, "__esModule", {
|
10039
10042
|
value: !0
|
10040
10043
|
});
|
10041
|
-
|
10042
|
-
var vn =
|
10043
|
-
yn =
|
10044
|
-
|
10045
|
-
xn =
|
10044
|
+
ti.Azure = void 0;
|
10045
|
+
var vn = ii,
|
10046
|
+
yn = ni,
|
10047
|
+
bi = si,
|
10048
|
+
xn = oi,
|
10046
10049
|
na = ct;
|
10047
10050
|
var jt = /*#__PURE__*/function (_na$Speech) {
|
10048
10051
|
_inherits(jt, _na$Speech);
|
@@ -10056,7 +10059,7 @@ var jt = /*#__PURE__*/function (_na$Speech) {
|
|
10056
10059
|
_createClass(jt, [{
|
10057
10060
|
key: "start",
|
10058
10061
|
value: function start(e, t) {
|
10059
|
-
this._newTextPadding = "", this.stopTimeout === void 0 &&
|
10062
|
+
this._newTextPadding = "", this.stopTimeout === void 0 && bi.StopTimeout.reset(this, e == null ? void 0 : e.stopAfterSilenceMs), this.prepareBeforeStart(e), this.startAsync(e), t || vn.PreventConnectionStop.applyPrevention(this);
|
10060
10063
|
}
|
10061
10064
|
}, {
|
10062
10065
|
key: "startAsync",
|
@@ -10135,7 +10138,7 @@ var jt = /*#__PURE__*/function (_na$Speech) {
|
|
10135
10138
|
i = _xn$AzureTranscript$e.interimTranscript,
|
10136
10139
|
r = _xn$AzureTranscript$e.finalTranscript,
|
10137
10140
|
s = _xn$AzureTranscript$e.newText;
|
10138
|
-
|
10141
|
+
bi.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(i, r, s);
|
10139
10142
|
}
|
10140
10143
|
// WORK - huge opportunity to fix this in the repo!!!!!
|
10141
10144
|
// function onRecognized(sender, recognitionEventArgs) {
|
@@ -10156,7 +10159,7 @@ var jt = /*#__PURE__*/function (_na$Speech) {
|
|
10156
10159
|
r = _xn$AzureTranscript$e2.interimTranscript,
|
10157
10160
|
s = _xn$AzureTranscript$e2.finalTranscript,
|
10158
10161
|
o = _xn$AzureTranscript$e2.newText;
|
10159
|
-
|
10162
|
+
bi.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(r, s, o), s !== "" && (this._newTextPadding = " ");
|
10160
10163
|
}
|
10161
10164
|
break;
|
10162
10165
|
}
|
@@ -10212,14 +10215,14 @@ var jt = /*#__PURE__*/function (_na$Speech) {
|
|
10212
10215
|
}]);
|
10213
10216
|
return jt;
|
10214
10217
|
}(na.Speech);
|
10215
|
-
|
10218
|
+
ti.Azure = jt;
|
10216
10219
|
Object.defineProperty(ir, "__esModule", {
|
10217
10220
|
value: !0
|
10218
10221
|
});
|
10219
|
-
var En =
|
10222
|
+
var En = Jt,
|
10220
10223
|
ra = dt,
|
10221
|
-
|
10222
|
-
sa =
|
10224
|
+
$ = ei,
|
10225
|
+
sa = ti;
|
10223
10226
|
var Oe = /*#__PURE__*/function () {
|
10224
10227
|
function Oe() {
|
10225
10228
|
_classCallCheck(this, Oe);
|
@@ -10229,12 +10232,12 @@ var Oe = /*#__PURE__*/function () {
|
|
10229
10232
|
value: function toggle(e, t) {
|
10230
10233
|
var i, r;
|
10231
10234
|
var s = e.toLocaleLowerCase().trim();
|
10232
|
-
!((i =
|
10235
|
+
!((i = $.GlobalState.service) === null || i === void 0) && i.recognizing ? this.stop() : s === "webspeech" ? Oe.startWebSpeech(t) : s === "azure" ? Oe.startAzure(t) : (console.error("service not found - must be either 'webspeech' or 'azure'"), (r = t == null ? void 0 : t.onError) === null || r === void 0 || r.call(t, "service not found - must be either 'webspeech' or 'azure'"));
|
10233
10236
|
}
|
10234
10237
|
}, {
|
10235
10238
|
key: "startWebSpeech",
|
10236
10239
|
value: function startWebSpeech(e) {
|
10237
|
-
Oe.stop() || (
|
10240
|
+
Oe.stop() || ($.GlobalState.service = new En.WebSpeech(), $.GlobalState.service.start(e));
|
10238
10241
|
}
|
10239
10242
|
}, {
|
10240
10243
|
key: "isWebSpeechSupported",
|
@@ -10245,23 +10248,23 @@ var Oe = /*#__PURE__*/function () {
|
|
10245
10248
|
key: "startAzure",
|
10246
10249
|
value: function startAzure(e) {
|
10247
10250
|
var t;
|
10248
|
-
Oe.stop() || !((t =
|
10251
|
+
Oe.stop() || !((t = $.GlobalState.service) === null || t === void 0) && t.cannotBeStopped || ($.GlobalState.service = new sa.Azure(), $.GlobalState.service.start(e));
|
10249
10252
|
}
|
10250
10253
|
}, {
|
10251
10254
|
key: "stop",
|
10252
10255
|
value: function stop() {
|
10253
10256
|
var e;
|
10254
|
-
return
|
10257
|
+
return $.GlobalState.doubleClickDetector() ? !0 : (!((e = $.GlobalState.service) === null || e === void 0) && e.recognizing && $.GlobalState.service.stop(), !1);
|
10255
10258
|
}
|
10256
10259
|
}, {
|
10257
10260
|
key: "endCommandMode",
|
10258
10261
|
value: function endCommandMode() {
|
10259
|
-
|
10262
|
+
$.GlobalState.service && ra.CommandUtils.toggleCommandModeOff($.GlobalState.service);
|
10260
10263
|
}
|
10261
10264
|
}]);
|
10262
10265
|
return Oe;
|
10263
10266
|
}();
|
10264
|
-
var
|
10267
|
+
var vi = ir["default"] = Oe;
|
10265
10268
|
var zt = /*#__PURE__*/function (_tt) {
|
10266
10269
|
_inherits(zt, _tt);
|
10267
10270
|
var _super40 = _createSuper(zt);
|
@@ -10273,7 +10276,7 @@ var zt = /*#__PURE__*/function (_tt) {
|
|
10273
10276
|
var _zt$processConfigurat = zt.processConfiguration(t, e.speechToText),
|
10274
10277
|
r = _zt$processConfigurat.serviceName,
|
10275
10278
|
s = _zt$processConfigurat.processedConfig;
|
10276
|
-
if (_this49._addErrorMessage = i, r === "webspeech" && !
|
10279
|
+
if (_this49._addErrorMessage = i, r === "webspeech" && !vi.isWebSpeechSupported()) _this49.changeToUnsupported();else {
|
10277
10280
|
var a = !e.textInput || !e.textInput.disabled;
|
10278
10281
|
_this49.elementRef.onclick = _this49.buttonClick.bind(_assertThisInitialized(_this49), t, a, r, s);
|
10279
10282
|
}
|
@@ -10283,7 +10286,7 @@ var zt = /*#__PURE__*/function (_tt) {
|
|
10283
10286
|
_createClass(zt, [{
|
10284
10287
|
key: "buttonClick",
|
10285
10288
|
value: function buttonClick(e, t, i, r) {
|
10286
|
-
e.removeTextIfPlaceholder(),
|
10289
|
+
e.removeTextIfPlaceholder(), vi.toggle(i, _objectSpread({
|
10287
10290
|
insertInCursorLocation: !1,
|
10288
10291
|
element: t ? e.inputElementRef : void 0,
|
10289
10292
|
onError: this.onError.bind(this),
|
@@ -10321,7 +10324,7 @@ var zt = /*#__PURE__*/function (_tt) {
|
|
10321
10324
|
return d.toLowerCase().includes(a) ? (setTimeout(function () {
|
10322
10325
|
var u;
|
10323
10326
|
return (u = e.submit) == null ? void 0 : u.call(e);
|
10324
|
-
}),
|
10327
|
+
}), vi.endCommandMode(), {
|
10325
10328
|
restart: !0,
|
10326
10329
|
removeNewText: !0
|
10327
10330
|
}) : null;
|
@@ -10418,19 +10421,42 @@ var oa = /*#__PURE__*/function (_tt2) {
|
|
10418
10421
|
return oa;
|
10419
10422
|
}(tt);
|
10420
10423
|
var aa = "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n<svg xmlns=\"http://www.w3.org/2000/svg\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"1\" viewBox=\"0 0 24 24\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"14\"></line>\n <polygon points=\"22 2 15 22 11 14 2 10 22 2\"></polygon>\n</svg>\n";
|
10421
|
-
var
|
10422
|
-
function
|
10423
|
-
_classCallCheck(this,
|
10424
|
+
var P = /*#__PURE__*/function () {
|
10425
|
+
function P() {
|
10426
|
+
_classCallCheck(this, P);
|
10424
10427
|
}
|
10425
|
-
_createClass(
|
10428
|
+
_createClass(P, null, [{
|
10426
10429
|
key: "setPropertyValueIfDoesNotExist",
|
10427
10430
|
value: function setPropertyValueIfDoesNotExist(e, t, i) {
|
10428
10431
|
var _e$r, _e$r2;
|
10429
10432
|
var r = t[0];
|
10430
|
-
t.length === 1 ? (_e$r = e[r]) !== null && _e$r !== void 0 ? _e$r : e[r] = i : ((_e$r2 = e[r]) !== null && _e$r2 !== void 0 ? _e$r2 : e[r] = {}, t.shift(),
|
10433
|
+
t.length === 1 ? (_e$r = e[r]) !== null && _e$r !== void 0 ? _e$r : e[r] = i : ((_e$r2 = e[r]) !== null && _e$r2 !== void 0 ? _e$r2 : e[r] = {}, t.shift(), P.setPropertyValueIfDoesNotExist(e[r], t, i));
|
10434
|
+
}
|
10435
|
+
}, {
|
10436
|
+
key: "setPropertyValue",
|
10437
|
+
value: function setPropertyValue(e, t, i) {
|
10438
|
+
var _e$r3;
|
10439
|
+
var r = t[0];
|
10440
|
+
t.length === 1 ? e[r] = i : ((_e$r3 = e[r]) !== null && _e$r3 !== void 0 ? _e$r3 : e[r] = {}, t.shift(), P.setPropertyValue(e[r], t, i));
|
10441
|
+
}
|
10442
|
+
}, {
|
10443
|
+
key: "getObjectValue",
|
10444
|
+
value: function getObjectValue(e, t) {
|
10445
|
+
var i = t[0],
|
10446
|
+
r = e[i];
|
10447
|
+
return r === void 0 || t.length === 1 ? r : P.getObjectValue(r, t.slice(1));
|
10448
|
+
}
|
10449
|
+
}, {
|
10450
|
+
key: "overwritePropertyObjectFromAnother",
|
10451
|
+
value: function overwritePropertyObjectFromAnother(e, t, i) {
|
10452
|
+
var r = P.getObjectValue(t, i);
|
10453
|
+
if (r) {
|
10454
|
+
var s = _objectSpread(_objectSpread({}, r), P.getObjectValue(e, i) || {});
|
10455
|
+
P.setPropertyValue(e, i, s);
|
10456
|
+
}
|
10431
10457
|
}
|
10432
10458
|
}]);
|
10433
|
-
return
|
10459
|
+
return P;
|
10434
10460
|
}();
|
10435
10461
|
var Sn = /*#__PURE__*/function () {
|
10436
10462
|
function Sn() {
|
@@ -10441,12 +10467,14 @@ var Sn = /*#__PURE__*/function () {
|
|
10441
10467
|
value: function resetSubmit(e, t) {
|
10442
10468
|
t ? e.unsetCustomStateStyles(["loading", "submit"]) : e.unsetCustomStateStyles(["stop", "loading", "submit"]), e.reapplyStateStyle("submit");
|
10443
10469
|
}
|
10444
|
-
// prettier-ignore
|
10445
10470
|
}, {
|
10446
|
-
key: "
|
10447
|
-
value: function
|
10448
|
-
|
10449
|
-
|
10471
|
+
key: "process",
|
10472
|
+
value: function process(e) {
|
10473
|
+
if (e != null && e.alwaysEnabled) return e;
|
10474
|
+
var t = JSON.parse(JSON.stringify(e || {}));
|
10475
|
+
P.setPropertyValueIfDoesNotExist(t, ["submit", "container", "default", "backgroundColor"], ""), P.setPropertyValueIfDoesNotExist(t, ["disabled", "container", "default", "backgroundColor"], "unset"), P.setPropertyValueIfDoesNotExist(t.submit, ["svg", "styles", "default", "filter"], ""), P.setPropertyValueIfDoesNotExist(t.disabled, ["svg", "styles", "default", "filter"], "brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(5564%) hue-rotate(207deg) brightness(100%) contrast(97%)");
|
10476
|
+
var i = JSON.parse(JSON.stringify(t.disabled));
|
10477
|
+
return P.overwritePropertyObjectFromAnother(i, t.submit, ["container", "default"]), P.overwritePropertyObjectFromAnother(i, t.submit, ["text", "styles", "default"]), P.overwritePropertyObjectFromAnother(i, t.submit, ["svg", "styles", "default"]), t.disabled = i, t;
|
10450
10478
|
}
|
10451
10479
|
}]);
|
10452
10480
|
return Sn;
|
@@ -10458,10 +10486,10 @@ var Pe = /*#__PURE__*/function (_ot4) {
|
|
10458
10486
|
function Pe(e, t, i, r, s) {
|
10459
10487
|
var _this54;
|
10460
10488
|
_classCallCheck(this, Pe);
|
10461
|
-
var o;
|
10462
|
-
|
10489
|
+
var o = Sn.process(e.submitButtonStyles);
|
10490
|
+
_this54 = _super42.call(this, Pe.createButtonContainerElement(), o == null ? void 0 : o.position, o), _this54._isRequestInProgress = !1, _this54._isLoadingActive = !1, _this54._isSVGLoadingIconOverriden = !1, _this54._messages = i, _this54._inputElementRef = t, _this54._fileAttachments = s, _this54._innerElements = _this54.createInnerElements(), _this54._abortStream = new AbortController(), _this54._stopClicked = {
|
10463
10491
|
listener: function listener() {}
|
10464
|
-
}, _this54._serviceIO = r, e.changeSubmitButtonState = _this54.changeSubmitButtonState.bind(_assertThisInitialized(_this54), r), _this54.attemptOverwriteLoadingStyle(e), setTimeout(function () {
|
10492
|
+
}, _this54._serviceIO = r, _this54._alwaysEnabled = !!(o != null && o.alwaysEnabled), e.changeSubmitButtonState = _this54.changeSubmitButtonState.bind(_assertThisInitialized(_this54), r), _this54.attemptOverwriteLoadingStyle(e), setTimeout(function () {
|
10465
10493
|
var a;
|
10466
10494
|
_this54._validationHandler = e._validationHandler, _this54.assignHandlers(_this54._validationHandler), (a = _this54._validationHandler) == null || a.call(_assertThisInitialized(_this54));
|
10467
10495
|
});
|
@@ -10567,7 +10595,7 @@ var Pe = /*#__PURE__*/function (_ot4) {
|
|
10567
10595
|
return this.addNewMessages(t, i);
|
10568
10596
|
case 18:
|
10569
10597
|
this._messages.addLoadingMessage();
|
10570
|
-
e ||
|
10598
|
+
e || Ai.clear(this._inputElementRef);
|
10571
10599
|
s = {
|
10572
10600
|
text: t === "" ? void 0 : t,
|
10573
10601
|
files: r
|
@@ -10644,12 +10672,14 @@ var Pe = /*#__PURE__*/function (_ot4) {
|
|
10644
10672
|
}, {
|
10645
10673
|
key: "changeToDisabledIcon",
|
10646
10674
|
value: function changeToDisabledIcon() {
|
10647
|
-
|
10675
|
+
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
10676
|
+
var t = e ? !0 : !this._alwaysEnabled;
|
10677
|
+
(this._isRequestInProgress || this._isLoadingActive || !t) && this.changeToSubmitIcon(), t && (this.elementRef.replaceChildren(this._innerElements.disabled), this.reapplyStateStyle("disabled", ["submit"]), this.elementRef.onclick = function () {});
|
10648
10678
|
}
|
10649
10679
|
}, {
|
10650
10680
|
key: "changeSubmitButtonState",
|
10651
10681
|
value: function changeSubmitButtonState(e, t) {
|
10652
|
-
t ? this.changeToSubmitIcon() : this.changeToDisabledIcon()
|
10682
|
+
e.isSubmitProgrammaticallyDisabled = !t, t ? this.changeToSubmitIcon() : this.changeToDisabledIcon(!0);
|
10653
10683
|
}
|
10654
10684
|
}], [{
|
10655
10685
|
key: "createButtonContainerElement",
|
@@ -10660,7 +10690,7 @@ var Pe = /*#__PURE__*/function (_ot4) {
|
|
10660
10690
|
}, {
|
10661
10691
|
key: "createSubmitIconElement",
|
10662
10692
|
value: function createSubmitIconElement() {
|
10663
|
-
var e =
|
10693
|
+
var e = B.createSVGElement(aa);
|
10664
10694
|
return e.id = "submit-icon", e;
|
10665
10695
|
}
|
10666
10696
|
}, {
|
@@ -10693,7 +10723,7 @@ var qi = /*#__PURE__*/function (_Ve) {
|
|
10693
10723
|
var _this55$addButtonsAnd = _this55.addButtonsAndTheirEvents(t),
|
10694
10724
|
s = _this55$addButtonsAnd.captureButton,
|
10695
10725
|
o = _this55$addButtonsAnd.submitButton;
|
10696
|
-
_this55._captureButton = s, _this55._submitButton = o, _this55._captureIcon = _this55._captureButton.children[0], _this55._refreshIcon =
|
10726
|
+
_this55._captureButton = s, _this55._submitButton = o, _this55._captureIcon = _this55._captureButton.children[0], _this55._refreshIcon = B.createSVGElement(la), _this55._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (r == null ? void 0 : r.format) === "jpeg" && (_this55._format = "image/jpeg"), r != null && r.dimensions && (_this55._dimensions = r.dimensions), _this55._contentRef.appendChild(_this55._canvas), _this55.extensionCloseCallback = _this55.stop;
|
10697
10727
|
return _this55;
|
10698
10728
|
}
|
10699
10729
|
_createClass(qi, [{
|
@@ -10839,7 +10869,7 @@ var Ft = /*#__PURE__*/function (_ot5) {
|
|
10839
10869
|
}, {
|
10840
10870
|
key: "createSVGIconElement",
|
10841
10871
|
value: function createSVGIconElement() {
|
10842
|
-
var e =
|
10872
|
+
var e = B.createSVGElement(ha);
|
10843
10873
|
return e.id = "camera-icon", e;
|
10844
10874
|
}
|
10845
10875
|
}]);
|
@@ -10850,7 +10880,7 @@ var $e = /*#__PURE__*/function () {
|
|
10850
10880
|
function $e(e, t, i, r) {
|
10851
10881
|
_classCallCheck(this, $e);
|
10852
10882
|
this.elementRef = $e.createPanelElement(e.inputAreaStyle);
|
10853
|
-
var s = new
|
10883
|
+
var s = new Ai(e, i),
|
10854
10884
|
o = {},
|
10855
10885
|
a = this.createFileUploadComponents(e, i, r, o);
|
10856
10886
|
e.speechToText && !o.microphone && (o.microphone = {
|
@@ -10880,7 +10910,7 @@ var $e = /*#__PURE__*/function () {
|
|
10880
10910
|
button: new oa(_d, t.recordAudio)
|
10881
10911
|
};
|
10882
10912
|
}
|
10883
|
-
return
|
10913
|
+
return te.isEnabled(s, e.dragAndDrop) && te.create(i, s, e.dragAndDrop), s;
|
10884
10914
|
}
|
10885
10915
|
// prettier-ignore
|
10886
10916
|
}], [{
|
@@ -10944,7 +10974,7 @@ var Hi = /*#__PURE__*/function () {
|
|
10944
10974
|
}]);
|
10945
10975
|
return Hi;
|
10946
10976
|
}();
|
10947
|
-
var pa = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#large-loading-ring{display:inline-block;width:50px;height:50px}#large-loading-ring:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:large-loading-ring 1.4s linear infinite}@keyframes large-loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#insert-key-view{height:100%;position:relative}#insert-key-contents{text-align:center;position:absolute;top:44%;left:50%;transform:translate(-50%,-50%);width:82%;display:flex;max-width:700px}#insert-key-title{margin-bottom:15px}#insert-key-input-container{margin-right:2.7em;width:calc(100% - 80px)}#insert-key-input{padding:.3em 1.7em .3em .3em;border-width:1px;border-style:solid;border-radius:3px;width:100%;font-size:inherit}.insert-key-input-valid{border-color:gray}.insert-key-input-invalid{border-color:red}#visibility-icon-container{position:relative;float:right;cursor:pointer;-webkit-user-select:none;user-select:none}.visibility-icon{filter:brightness(0) saturate(100%) invert(63%) sepia(1%) saturate(9%) hue-rotate(43deg) brightness(98%) contrast(92%);position:absolute;right:-1.7em;top:-1.43em}#visible-icon{top:-1.4em}.visibility-icon:hover{filter:unset}.visibility-icon>*{pointer-events:none}#start-button{border:1px solid grey;color:#454545;border-radius:4px;width:3em;display:flex;justify-content:center;align-items:center;cursor:pointer;padding:.28em .3em;-webkit-user-select:none;user-select:none;background-color:#fff}#start-button:hover{background-color:#f2f2f2}#start-button:active{background-color:#d2d2d2}#insert-key-help-text-container{width:100%;position:absolute;margin-top:32px;margin-bottom:20px}#insert-key-help-text-contents{width:100%;position:absolute}#insert-key-input-invalid-text{display:block;margin-top:1em;margin-bottom:.5em;color:red}.insert-key-input-help-text{display:block;margin-top:16px}#loading-ring{display:inline-block;width:16px;height:16px}#loading-ring:after{content:\" \";display:block;width:11px;height:11px;margin:1px;border-radius:50%;border:2px solid #0084ff;border-color:#0084ff transparent #0084ff transparent;animation:loading-ring 1.2s linear infinite}@keyframes loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#error-view{color:red;font-size:1.2em;line-height:1.3em;margin-top:-5px;text-align:center;height:100%;display:flex;justify-content:center;align-items:center;padding-left:8px;padding-right:8px}.intro-panel{position:absolute;display:flex;justify-content:center;right:0;bottom:0;left:0;margin:auto;height:fit-content;top:-2.5em}#internal-intro-panel{width:250px;height:min-content;display:block;border-radius:5px;overflow:auto;border:1px solid rgb(203,203,203);padding:10px;max-height:calc(100% - 6.8em)}#internal-intro-panel>p{margin-block-start:.8em;margin-block-end:.8em}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!\n Theme: a11y-dark\n Author: @ericwbailey\n Maintainer: @ericwbailey\n\n Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css\n*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.loading-message-text{width:1em;padding:.6em .75em .6em 1.3em}.message-bubble>p:first-child{margin-top:0}.message-bubble>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message-bubble{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:2}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:1;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.dots-jumping{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:dots-jumping 1.5s infinite linear;bottom:-.7em}@keyframes dots-jumping{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.dots-flashing{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite linear alternate;animation-delay:.5s}.dots-flashing:before,.dots-flashing:after{content:\"\";display:inline-block;position:absolute;top:0}.dots-flashing:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:0s}.dots-flashing:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:1s}@keyframes dots-flashing{0%{background-color:var(--message-dots-color)}50%,to{background-color:var(--message-dots-color-fade)}}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button:hover{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.loading-button{background-color:#fff;cursor:auto}.loading-button:hover,.loading-button:active{background-color:#fff}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}.text-input-placeholder{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative;margin-right:.56em}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}.dropup-menu-item-text{margin-top:.08em;width:max-content}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}:host{all:initial;display:table-cell}#container{height:inherit;overflow:hidden}\n";
|
10977
|
+
var pa = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#large-loading-ring{display:inline-block;width:50px;height:50px}#large-loading-ring:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:large-loading-ring 1.4s linear infinite}@keyframes large-loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#insert-key-view{height:100%;position:relative}#insert-key-contents{text-align:center;position:absolute;top:44%;left:50%;transform:translate(-50%,-50%);width:82%;display:flex;max-width:700px}#insert-key-title{margin-bottom:15px}#insert-key-input-container{margin-right:2.7em;width:calc(100% - 80px)}#insert-key-input{padding:.3em 1.7em .3em .3em;border-width:1px;border-style:solid;border-radius:3px;width:100%;font-size:inherit}.insert-key-input-valid{border-color:gray}.insert-key-input-invalid{border-color:red}#visibility-icon-container{position:relative;float:right;cursor:pointer;-webkit-user-select:none;user-select:none}.visibility-icon{filter:brightness(0) saturate(100%) invert(63%) sepia(1%) saturate(9%) hue-rotate(43deg) brightness(98%) contrast(92%);position:absolute;right:-1.7em;top:-1.43em}#visible-icon{top:-1.4em}.visibility-icon:hover{filter:unset}.visibility-icon>*{pointer-events:none}#start-button{border:1px solid grey;color:#454545;border-radius:4px;width:3em;display:flex;justify-content:center;align-items:center;cursor:pointer;padding:.28em .3em;-webkit-user-select:none;user-select:none;background-color:#fff}#start-button:hover{background-color:#f2f2f2}#start-button:active{background-color:#d2d2d2}#insert-key-help-text-container{width:100%;position:absolute;margin-top:32px;margin-bottom:20px}#insert-key-help-text-contents{width:100%;position:absolute}#insert-key-input-invalid-text{display:block;margin-top:1em;margin-bottom:.5em;color:red}.insert-key-input-help-text{display:block;margin-top:16px}#loading-ring{display:inline-block;width:16px;height:16px}#loading-ring:after{content:\" \";display:block;width:11px;height:11px;margin:1px;border-radius:50%;border:2px solid #0084ff;border-color:#0084ff transparent #0084ff transparent;animation:loading-ring 1.2s linear infinite}@keyframes loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#error-view{color:red;font-size:1.2em;line-height:1.3em;margin-top:-5px;text-align:center;height:100%;display:flex;justify-content:center;align-items:center;padding-left:8px;padding-right:8px}.intro-panel{position:absolute;display:flex;justify-content:center;right:0;bottom:0;left:0;margin:auto;height:fit-content;top:-2.5em}#internal-intro-panel{width:250px;height:min-content;display:block;border-radius:5px;overflow:auto;border:1px solid rgb(203,203,203);padding:10px;max-height:calc(100% - 6.8em)}#internal-intro-panel>p{margin-block-start:.8em;margin-block-end:.8em}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!\n Theme: a11y-dark\n Author: @ericwbailey\n Maintainer: @ericwbailey\n\n Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css\n*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.loading-message-text{width:1em;padding:.6em .75em .6em 1.3em}.message-bubble>p:first-child{margin-top:0}.message-bubble>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message-bubble{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:2}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:1;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.dots-jumping{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:dots-jumping 1.5s infinite linear;bottom:-.7em}@keyframes dots-jumping{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.dots-flashing{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite linear alternate;animation-delay:.5s}.dots-flashing:before,.dots-flashing:after{content:\"\";display:inline-block;position:absolute;top:0}.dots-flashing:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:0s}.dots-flashing:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:1s}@keyframes dots-flashing{0%{background-color:var(--message-dots-color)}50%,to{background-color:var(--message-dots-color-fade)}}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button:hover{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.loading-button{background-color:#fff;cursor:auto}.loading-button:hover,.loading-button:active{background-color:#fff}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}.text-input-placeholder{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative;margin-right:.56em}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}.dropup-menu-item-text{margin-top:.08em;width:max-content}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}\n";
|
10948
10978
|
var fa = Object.defineProperty,
|
10949
10979
|
ma = Object.getOwnPropertyDescriptor,
|
10950
10980
|
x = function x(n, e, t, i) {
|
@@ -10965,7 +10995,7 @@ var v = /*#__PURE__*/function (_Qs) {
|
|
10965
10995
|
return Bt.focusFromParentElement(_this60._elementRef);
|
10966
10996
|
}, _this60.refreshMessages = function () {}, _this60.clearMessages = function () {}, _this60.scrollToBottom = function () {}, _this60.changeSubmitButtonState = function () {}, _this60.onNewMessage = function () {}, _this60.onClearMessages = function () {}, _this60.onComponentRender = function () {}, _this60._hasBeenRendered = !1, _this60._auxiliaryStyleApplied = !1, _o.appendStyleSheetToHead(), _this60._elementRef = document.createElement("div"), _this60._elementRef.id = "container", _this60.attachShadow({
|
10967
10997
|
mode: "open"
|
10968
|
-
}).appendChild(_this60._elementRef),
|
10998
|
+
}).appendChild(_this60._elementRef), li.apply(pa, _this60.shadowRoot), setTimeout(function () {
|
10969
10999
|
_this60._hasBeenRendered || _this60.onRender();
|
10970
11000
|
}, 20);
|
10971
11001
|
return _this60;
|
@@ -10980,7 +11010,7 @@ var v = /*#__PURE__*/function (_Qs) {
|
|
10980
11010
|
key: "onRender",
|
10981
11011
|
value: function onRender() {
|
10982
11012
|
var _this$_activeService, _this$_childElement;
|
10983
|
-
(_this$_activeService = this._activeService) !== null && _this$_activeService !== void 0 ? _this$_activeService : this._activeService = wo.create(this), this._activeService && (this.auxiliaryStyle && !this._auxiliaryStyleApplied && (
|
11013
|
+
(_this$_activeService = this._activeService) !== null && _this$_activeService !== void 0 ? _this$_activeService : this._activeService = wo.create(this), this._activeService && (this.auxiliaryStyle && !this._auxiliaryStyleApplied && (li.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), li.applyDefaultStyleToComponent(this.style), Ut.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? Et.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], Hi.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof U && I.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, Mi.onRender(this));
|
10984
11014
|
}
|
10985
11015
|
}]);
|
10986
11016
|
return v;
|
@@ -10991,7 +11021,7 @@ x([y("object")], v.prototype, "stream", 2);
|
|
10991
11021
|
x([y("object")], v.prototype, "requestBodyLimits", 2);
|
10992
11022
|
x([y("function")], v.prototype, "requestInterceptor", 2);
|
10993
11023
|
x([y("function")], v.prototype, "responseInterceptor", 2);
|
10994
|
-
x([y("function")], v.prototype, "
|
11024
|
+
x([y("function")], v.prototype, "validateInput", 2);
|
10995
11025
|
x([y("object")], v.prototype, "attachmentContainerStyle", 2);
|
10996
11026
|
x([y("object")], v.prototype, "dropupStyles", 2);
|
10997
11027
|
x([y("object")], v.prototype, "inputAreaStyle", 2);
|