deep-chat-dev 9.0.269 → 9.0.270

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.
Files changed (31) hide show
  1. package/custom-elements.json +11733 -11602
  2. package/dist/deepChat.bundle.js +1 -1
  3. package/dist/deepChat.d.ts +2 -1
  4. package/dist/deepChat.d.ts.map +1 -1
  5. package/dist/deepChat.js +535 -501
  6. package/dist/services/serviceIO.d.ts +1 -0
  7. package/dist/services/serviceIO.d.ts.map +1 -1
  8. package/dist/types/stream.d.ts +6 -1
  9. package/dist/types/stream.d.ts.map +1 -1
  10. package/dist/types/textInput.d.ts +4 -0
  11. package/dist/types/textInput.d.ts.map +1 -1
  12. package/dist/utils/HTTP/stream.d.ts.map +1 -1
  13. package/dist/utils/events/fireEvents.d.ts +4 -0
  14. package/dist/utils/events/fireEvents.d.ts.map +1 -1
  15. package/dist/views/chat/input/fileAttachments/fileAttachmentTypes/audioFileAttachmentType.d.ts +2 -1
  16. package/dist/views/chat/input/fileAttachments/fileAttachmentTypes/audioFileAttachmentType.d.ts.map +1 -1
  17. package/dist/views/chat/input/fileAttachments/fileAttachmentTypes/fileAttachmentTypeFactory.d.ts +2 -2
  18. package/dist/views/chat/input/fileAttachments/fileAttachmentTypes/fileAttachmentTypeFactory.d.ts.map +1 -1
  19. package/dist/views/chat/input/fileAttachments/fileAttachmentTypes/fileAttachmentsType.d.ts +4 -2
  20. package/dist/views/chat/input/fileAttachments/fileAttachmentTypes/fileAttachmentsType.d.ts.map +1 -1
  21. package/dist/views/chat/input/fileAttachments/fileAttachments.d.ts +2 -2
  22. package/dist/views/chat/input/fileAttachments/fileAttachments.d.ts.map +1 -1
  23. package/dist/views/chat/input/input.d.ts +1 -0
  24. package/dist/views/chat/input/input.d.ts.map +1 -1
  25. package/dist/views/chat/input/textInput/textInput.d.ts +2 -1
  26. package/dist/views/chat/input/textInput/textInput.d.ts.map +1 -1
  27. package/dist/views/chat/messages/stream/messageStream.d.ts +1 -1
  28. package/dist/views/chat/messages/stream/messageStream.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/dist/types/streamWrapper.d.ts +0 -7
  31. package/dist/types/streamWrapper.d.ts.map +0 -1
package/dist/deepChat.js CHANGED
@@ -43,11 +43,11 @@ var Hn = /*#__PURE__*/function () {
43
43
  }
44
44
  }]);
45
45
  }();
46
- var gi = /*#__PURE__*/function () {
47
- function gi() {
48
- _classCallCheck(this, gi);
46
+ var bi = /*#__PURE__*/function () {
47
+ function bi() {
48
+ _classCallCheck(this, bi);
49
49
  }
50
- return _createClass(gi, null, [{
50
+ return _createClass(bi, null, [{
51
51
  key: "onLoad",
52
52
  value: function onLoad(e) {
53
53
  e.innerHTML = '<div id="loading-validate-key-property"></div>';
@@ -61,11 +61,11 @@ var gi = /*#__PURE__*/function () {
61
61
  }, {
62
62
  key: "render",
63
63
  value: function render(e, t, i) {
64
- var s = gi.createElements(),
64
+ var s = bi.createElements(),
65
65
  r = {
66
66
  onSuccess: t,
67
67
  onFail: Hn.render.bind(this, e, "Your 'key' has failed authentication"),
68
- onLoad: gi.onLoad.bind(this, s)
68
+ onLoad: bi.onLoad.bind(this, s)
69
69
  };
70
70
  i.key && i.verifyKey(i.key, r), e.replaceChildren(s);
71
71
  }
@@ -156,18 +156,18 @@ var Je = /*#__PURE__*/function () {
156
156
  }]);
157
157
  }();
158
158
  Je.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap", Je.DEFAULT_FONT_FAMILY = "'Inter', sans-serif, Avenir, Helvetica, Arial";
159
- var bi = Je;
160
- var ht = /*#__PURE__*/function () {
161
- function ht() {
162
- _classCallCheck(this, ht);
159
+ var vi = Je;
160
+ var ut = /*#__PURE__*/function () {
161
+ function ut() {
162
+ _classCallCheck(this, ut);
163
163
  }
164
- return _createClass(ht, null, [{
164
+ return _createClass(ut, null, [{
165
165
  key: "apply",
166
166
  value: function apply(e, t) {
167
167
  if (t) try {
168
- ht.applyStyleSheet(e, t);
168
+ ut.applyStyleSheet(e, t);
169
169
  } catch (_unused) {
170
- ht.addStyleElement(e, t);
170
+ ut.addStyleElement(e, t);
171
171
  }
172
172
  }
173
173
  }, {
@@ -185,18 +185,18 @@ var ht = /*#__PURE__*/function () {
185
185
  }, {
186
186
  key: "applyDefaultStyleToComponent",
187
187
  value: function applyDefaultStyleToComponent(e, t) {
188
- t && I.applyToStyleIfNotDefined(e, t), I.applyToStyleIfNotDefined(e, ht.DEFAULT_COMPONENT_STYLE);
188
+ t && I.applyToStyleIfNotDefined(e, t), I.applyToStyleIfNotDefined(e, ut.DEFAULT_COMPONENT_STYLE);
189
189
  }
190
190
  }]);
191
191
  }();
192
- ht.DEFAULT_COMPONENT_STYLE = {
192
+ ut.DEFAULT_COMPONENT_STYLE = {
193
193
  height: "350px",
194
194
  width: "320px",
195
195
  borderTop: "1px solid #cacaca",
196
196
  borderRight: "1px solid #cacaca",
197
197
  borderLeft: "1px solid #cacaca",
198
198
  borderBottom: "1px solid #cacaca",
199
- fontFamily: bi.DEFAULT_FONT_FAMILY,
199
+ fontFamily: vi.DEFAULT_FONT_FAMILY,
200
200
  fontSize: "0.9rem",
201
201
  backgroundColor: "white",
202
202
  position: "relative",
@@ -206,7 +206,7 @@ ht.DEFAULT_COMPONENT_STYLE = {
206
206
  // this is also causing the chat to squeeze when there is no space
207
207
  overflow: "hidden"
208
208
  };
209
- var qt = ht;
209
+ var zt = ut;
210
210
  var Wt = /*#__PURE__*/_createClass(function Wt() {
211
211
  _classCallCheck(this, Wt);
212
212
  });
@@ -247,7 +247,7 @@ var Xe = /*#__PURE__*/function () {
247
247
  value: function onInput(e, t, i) {
248
248
  var s = i.target,
249
249
  r = s.textContent || "";
250
- e !== void 0 && r.length > e && (s.textContent = r.substring(0, e), ai.focusEndOfInput(s)), t == null || t();
250
+ e !== void 0 && r.length > e && (s.textContent = r.substring(0, e), li.focusEndOfInput(s)), t == null || t();
251
251
  }
252
252
  }]);
253
253
  }();
@@ -275,7 +275,7 @@ var Ye = /*#__PURE__*/function () {
275
275
  this._isComposing = !1;
276
276
  var s = Ye.processConfig(t, e.textInput);
277
277
  this.elementRef = Ye.createContainerElement((r = s == null ? void 0 : s.styles) == null ? void 0 : r.container), this._config = s, this.inputElementRef = this.createInputElement(), this.elementRef.appendChild(this.inputElementRef), e.setPlaceholderText = this.setPlaceholderText.bind(this), e.setPlaceholderText(((o = this._config.placeholder) == null ? void 0 : o.text) || "Ask me anything!"), setTimeout(function () {
278
- Qi.add(_this.inputElementRef, i, _this._config.characterLimit, e._validationHandler);
278
+ Qi.add(_this.inputElementRef, i, _this._config.characterLimit, e._validationHandler), _this._onInput = t.onInput;
279
279
  });
280
280
  }
281
281
  return _createClass(Ye, [{
@@ -283,9 +283,9 @@ var Ye = /*#__PURE__*/function () {
283
283
  value:
284
284
  // this also similarly prevents scroll up
285
285
  function clear() {
286
- var t;
286
+ var t, i;
287
287
  var e = window.scrollY;
288
- this.inputElementRef.classList.contains("text-input-disabled") || (Object.assign(this.inputElementRef.style, (t = this._config.placeholder) == null ? void 0 : t.style), this.inputElementRef.textContent = "", ai.focusEndOfInput(this.inputElementRef)), Be.IS_CHROMIUM && window.scrollTo({
288
+ this.inputElementRef.classList.contains("text-input-disabled") || (Object.assign(this.inputElementRef.style, (t = this._config.placeholder) == null ? void 0 : t.style), this.inputElementRef.textContent = "", li.focusEndOfInput(this.inputElementRef), (i = this._onInput) == null || i.call(this, !1)), Be.IS_CHROMIUM && window.scrollTo({
289
289
  top: e
290
290
  });
291
291
  }
@@ -330,8 +330,8 @@ var Ye = /*#__PURE__*/function () {
330
330
  }, {
331
331
  key: "onInput",
332
332
  value: function onInput() {
333
- var e;
334
- this.isTextInputEmpty() ? Object.assign(this.inputElementRef.style, (e = this._config.placeholder) == null ? void 0 : e.style) : this.removePlaceholderStyle();
333
+ var e, t;
334
+ this.isTextInputEmpty() ? Object.assign(this.inputElementRef.style, (e = this._config.placeholder) == null ? void 0 : e.style) : this.removePlaceholderStyle(), (t = this._onInput) == null || t.call(this, !0);
335
335
  }
336
336
  }, {
337
337
  key: "setPlaceholderText",
@@ -376,12 +376,12 @@ var Ye = /*#__PURE__*/function () {
376
376
  }]);
377
377
  }();
378
378
  Ye.TEXT_INPUT_ID = "text-input";
379
- var vi = Ye;
380
- var ai = /*#__PURE__*/function () {
381
- function ai() {
382
- _classCallCheck(this, ai);
379
+ var yi = Ye;
380
+ var li = /*#__PURE__*/function () {
381
+ function li() {
382
+ _classCallCheck(this, li);
383
383
  }
384
- return _createClass(ai, null, [{
384
+ return _createClass(li, null, [{
385
385
  key: "focusEndOfInput",
386
386
  value: function focusEndOfInput(e) {
387
387
  var t = document.createRange();
@@ -392,8 +392,8 @@ var ai = /*#__PURE__*/function () {
392
392
  }, {
393
393
  key: "focusFromParentElement",
394
394
  value: function focusFromParentElement(e) {
395
- var t = e.querySelector("#".concat(vi.TEXT_INPUT_ID));
396
- t && (Be.IS_SAFARI && t.focus(), ai.focusEndOfInput(t));
395
+ var t = e.querySelector("#".concat(yi.TEXT_INPUT_ID));
396
+ t && (Be.IS_SAFARI && t.focus(), li.focusEndOfInput(t));
397
397
  }
398
398
  }]);
399
399
  }();
@@ -479,7 +479,7 @@ var Ds = "Make sure the events are using {text: string} or {html: string} format
479
479
  }]);
480
480
  }();
481
481
  Bi.CODE_SNIPPET_GENERATION_JUMP = 0.5;
482
- var G = Bi;
482
+ var V = Bi;
483
483
  var Fi = /*#__PURE__*/function () {
484
484
  function Fi() {
485
485
  _classCallCheck(this, Fi);
@@ -510,12 +510,12 @@ var Fi = /*#__PURE__*/function () {
510
510
  }]);
511
511
  }();
512
512
  Fi.LOAD_VOICES_MS = 200;
513
- var gt = Fi;
514
- var ut = /*#__PURE__*/function () {
515
- function ut() {
516
- _classCallCheck(this, ut);
513
+ var bt = Fi;
514
+ var ft = /*#__PURE__*/function () {
515
+ function ft() {
516
+ _classCallCheck(this, ft);
517
517
  }
518
- return _createClass(ut, null, [{
518
+ return _createClass(ft, null, [{
519
519
  key: "colorToHex",
520
520
  value: function colorToHex(e) {
521
521
  var t = document.createElement("div");
@@ -528,7 +528,7 @@ var ut = /*#__PURE__*/function () {
528
528
  value: function setDots(e, t) {
529
529
  var i, s, r, o;
530
530
  if ((o = (r = (s = (i = t == null ? void 0 : t.loading) == null ? void 0 : i.message) == null ? void 0 : s.styles) == null ? void 0 : r.bubble) != null && o.color) {
531
- var a = ut.colorToHex(t.loading.message.styles.bubble.color);
531
+ var a = ft.colorToHex(t.loading.message.styles.bubble.color);
532
532
  e.style.setProperty("--loading-message-color", a), e.style.setProperty("--loading-message-color-fade", "".concat(a, "33"));
533
533
  } else e.style.setProperty("--loading-message-color", "#848484"), e.style.setProperty("--loading-message-color-fade", "#55555533");
534
534
  }
@@ -542,15 +542,15 @@ var ut = /*#__PURE__*/function () {
542
542
  o = _ref.margin,
543
543
  a = _ref.border;
544
544
  if (i) {
545
- var l = ut.colorToHex(i);
545
+ var l = ft.colorToHex(i);
546
546
  e.style.setProperty("--loading-history-color", l);
547
547
  } else e.style.setProperty("--loading-history-color", "#dbdbdb");
548
548
  e.style.setProperty("--loading-history-height", r || "57px"), e.style.setProperty("--loading-history-width", s || "57px"), e.style.setProperty("--loading-history-margin", o || "7px"), e.style.setProperty("--loading-history-border", a || "6px solid");
549
549
  }
550
550
  }]);
551
551
  }();
552
- ut.BUBBLE_CLASS = "deep-chat-loading-message-bubble", ut.DOTS_CONTAINER_CLASS = "deep-chat-loading-message-dots-container";
553
- var De = ut;
552
+ ft.BUBBLE_CLASS = "deep-chat-loading-message-bubble", ft.DOTS_CONTAINER_CLASS = "deep-chat-loading-message-dots-container";
553
+ var De = ft;
554
554
  var ce = /*#__PURE__*/function () {
555
555
  function ce() {
556
556
  _classCallCheck(this, ce);
@@ -858,7 +858,7 @@ var _e = /*#__PURE__*/function () {
858
858
  var o = i.getElementsByClassName(r);
859
859
  Array.from(o || []).forEach(function (a) {
860
860
  var l = _e.getProcessedStyles(t, a, r);
861
- X.applyStylesToElement(a, l), _e.applyEvents(a, r);
861
+ G.applyStylesToElement(a, l), _e.applyEvents(a, r);
862
862
  });
863
863
  });
864
864
  var s = i.getElementsByClassName($n);
@@ -868,11 +868,11 @@ var _e = /*#__PURE__*/function () {
868
868
  }
869
869
  }]);
870
870
  }();
871
- var X = /*#__PURE__*/function () {
872
- function X() {
873
- _classCallCheck(this, X);
871
+ var G = /*#__PURE__*/function () {
872
+ function G() {
873
+ _classCallCheck(this, G);
874
874
  }
875
- return _createClass(X, null, [{
875
+ return _createClass(G, null, [{
876
876
  key: "applyStylesToElement",
877
877
  value: function applyStylesToElement(e, t) {
878
878
  var i = I.processStateful(t);
@@ -891,7 +891,7 @@ var X = /*#__PURE__*/function () {
891
891
  value: function applyClassUtilitiesToElement(e, t) {
892
892
  var i = t.events,
893
893
  s = t.styles;
894
- i && X.applyEventsToElement(e, i), s && !_e.doesElementContainDeepChatClass(e) && X.applyStylesToElement(e, s);
894
+ i && G.applyEventsToElement(e, i), s && !_e.doesElementContainDeepChatClass(e) && G.applyStylesToElement(e, s);
895
895
  }
896
896
  }, {
897
897
  key: "applyCustomClassUtilities",
@@ -899,20 +899,20 @@ var X = /*#__PURE__*/function () {
899
899
  Object.keys(e).forEach(function (i) {
900
900
  var s = t.getElementsByClassName(i);
901
901
  Array.from(s).forEach(function (r) {
902
- e[i] && X.applyClassUtilitiesToElement(r, e[i]);
902
+ e[i] && G.applyClassUtilitiesToElement(r, e[i]);
903
903
  });
904
904
  });
905
905
  }
906
906
  }, {
907
907
  key: "apply",
908
908
  value: function apply(e, t) {
909
- _e.applyDeepChatUtilities(e, e.htmlClassUtilities, t), X.applyCustomClassUtilities(e.htmlClassUtilities, t);
909
+ _e.applyDeepChatUtilities(e, e.htmlClassUtilities, t), G.applyCustomClassUtilities(e.htmlClassUtilities, t);
910
910
  }
911
911
  }, {
912
912
  key: "traverseNodes",
913
913
  value: function traverseNodes(e, t) {
914
914
  e.nodeType === Node.ELEMENT_NODE && t.push(e.outerHTML), e.childNodes.forEach(function (i) {
915
- X.traverseNodes(i, t);
915
+ G.traverseNodes(i, t);
916
916
  });
917
917
  }
918
918
  }, {
@@ -921,7 +921,7 @@ var X = /*#__PURE__*/function () {
921
921
  var i = new DOMParser().parseFromString(e, "text/html"),
922
922
  s = [];
923
923
  return i.body.childNodes.forEach(function (r) {
924
- X.traverseNodes(r, s);
924
+ G.traverseNodes(r, s);
925
925
  }), s;
926
926
  }
927
927
  }, {
@@ -963,7 +963,7 @@ var Le = /*#__PURE__*/function () {
963
963
  }, {
964
964
  key: "overwriteElements",
965
965
  value: function overwriteElements(e, t, i) {
966
- i.bubbleElement.innerHTML = t, X.apply(e, i.outerContainer), te.flagHTMLUpdateClass(i.bubbleElement);
966
+ i.bubbleElement.innerHTML = t, G.apply(e, i.outerContainer), te.flagHTMLUpdateClass(i.bubbleElement);
967
967
  }
968
968
  // prettier-ignore
969
969
  }, {
@@ -979,7 +979,7 @@ var Le = /*#__PURE__*/function () {
979
979
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
980
980
  var o;
981
981
  var r = Le.createElements(e, t, i, s);
982
- return y.fillEmptyMessageElement(r.bubbleElement, t), X.apply(e, r.outerContainer), te.flagHTMLUpdateClass(r.bubbleElement), e.applyCustomStyles(r, i, !1, (o = e.messageStyles) == null ? void 0 : o.html), r;
982
+ return y.fillEmptyMessageElement(r.bubbleElement, t), G.apply(e, r.outerContainer), te.flagHTMLUpdateClass(r.bubbleElement), e.applyCustomStyles(r, i, !1, (o = e.messageStyles) == null ? void 0 : o.html), r;
983
983
  }
984
984
  }, {
985
985
  key: "add",
@@ -990,7 +990,7 @@ var Le = /*#__PURE__*/function () {
990
990
  if (a) return a;
991
991
  s.status = !1;
992
992
  }
993
- if (r && e.messageElementRefs.length > 0 && X.isTemporaryBasedOnHTML(t)) return;
993
+ if (r && e.messageElementRefs.length > 0 && G.isTemporaryBasedOnHTML(t)) return;
994
994
  var o = Le.create(e, t, i, r);
995
995
  return r || Le.addElement(e, o.outerContainer), o;
996
996
  }
@@ -998,9 +998,9 @@ var Le = /*#__PURE__*/function () {
998
998
  }();
999
999
  Le.HTML_BUBBLE_CLASS = "html-message";
1000
1000
  var xe = Le;
1001
- var hi;
1001
+ var ui;
1002
1002
  function _n(n) {
1003
- return hi = hi || document.createElement("textarea"), hi.innerHTML = "&" + n + ";", hi.value;
1003
+ return ui = ui || document.createElement("textarea"), ui.innerHTML = "&" + n + ";", ui.value;
1004
1004
  }
1005
1005
  var Jn = Object.prototype.hasOwnProperty;
1006
1006
  function Xn(n, e) {
@@ -2103,7 +2103,7 @@ function Pr(n, e, t, i) {
2103
2103
  level: --n.level
2104
2104
  }), f[1] = m[1] = l, n.line = l, !0;
2105
2105
  }
2106
- function ui(n, e) {
2106
+ function fi(n, e) {
2107
2107
  var t,
2108
2108
  i,
2109
2109
  s = n.bMarks[e] + n.tShift[e],
@@ -2118,8 +2118,8 @@ function Nr(n, e) {
2118
2118
  }
2119
2119
  function Dr(n, e, t, i) {
2120
2120
  var s, r, o, a, l, c, d, u, h, f, m, p, g, b;
2121
- if (i) return n.ddIndent < 0 ? !1 : ui(n, e) >= 0;
2122
- if (d = e + 1, n.isEmpty(d) && ++d > t || n.tShift[d] < n.blkIndent || (s = ui(n, d), s < 0) || n.level >= n.options.maxNesting) return !1;
2121
+ if (i) return n.ddIndent < 0 ? !1 : fi(n, e) >= 0;
2122
+ if (d = e + 1, n.isEmpty(d) && ++d > t || n.tShift[d] < n.blkIndent || (s = fi(n, d), s < 0) || n.level >= n.options.maxNesting) return !1;
2123
2123
  c = n.tokens.length, n.tokens.push({
2124
2124
  type: "dl_open",
2125
2125
  lines: l = [e, 0],
@@ -2148,10 +2148,10 @@ function Dr(n, e, t, i) {
2148
2148
  type: "dd_close",
2149
2149
  level: --n.level
2150
2150
  }), a[1] = d = n.line, d >= t || n.tShift[d] < n.blkIndent) break e;
2151
- if (s = ui(n, d), s < 0) break;
2151
+ if (s = fi(n, d), s < 0) break;
2152
2152
  r = d;
2153
2153
  }
2154
- if (d >= t || (o = d, n.isEmpty(o)) || n.tShift[o] < n.blkIndent || (r = o + 1, r >= t) || (n.isEmpty(r) && r++, r >= t) || n.tShift[r] < n.blkIndent || (s = ui(n, r), s < 0)) break;
2154
+ if (d >= t || (o = d, n.isEmpty(o)) || n.tShift[o] < n.blkIndent || (r = o + 1, r >= t) || (n.isEmpty(r) && r++, r >= t) || n.tShift[r] < n.blkIndent || (s = fi(n, r), s < 0)) break;
2155
2155
  }
2156
2156
  return n.tokens.push({
2157
2157
  type: "dl_close",
@@ -2192,11 +2192,11 @@ function Br(n, e) {
2192
2192
  level: n.level
2193
2193
  })), !0;
2194
2194
  }
2195
- var fi = [["code", Sr], ["fences", _r, ["paragraph", "blockquote", "list"]], ["blockquote", xr, ["paragraph", "blockquote", "list"]], ["hr", wr, ["paragraph", "blockquote", "list"]], ["list", Tr, ["paragraph", "blockquote"]], ["footnote", Cr, ["paragraph"]], ["heading", Rr, ["paragraph", "blockquote"]], ["lheading", Mr], ["htmlblock", Or, ["paragraph", "blockquote"]], ["table", Pr, ["paragraph"]], ["deflist", Dr, ["paragraph"]], ["paragraph", Br]];
2195
+ var pi = [["code", Sr], ["fences", _r, ["paragraph", "blockquote", "list"]], ["blockquote", xr, ["paragraph", "blockquote", "list"]], ["hr", wr, ["paragraph", "blockquote", "list"]], ["list", Tr, ["paragraph", "blockquote"]], ["footnote", Cr, ["paragraph"]], ["heading", Rr, ["paragraph", "blockquote"]], ["lheading", Mr], ["htmlblock", Or, ["paragraph", "blockquote"]], ["table", Pr, ["paragraph"]], ["deflist", Dr, ["paragraph"]], ["paragraph", Br]];
2196
2196
  function Ss() {
2197
2197
  this.ruler = new oe();
2198
- for (var n = 0; n < fi.length; n++) this.ruler.push(fi[n][0], fi[n][1], {
2199
- alt: (fi[n][2] || []).slice()
2198
+ for (var n = 0; n < pi.length; n++) this.ruler.push(pi[n][0], pi[n][1], {
2199
+ alt: (pi[n][2] || []).slice()
2200
2200
  });
2201
2201
  }
2202
2202
  Ss.prototype.tokenize = function (n, e, t) {
@@ -2866,14 +2866,14 @@ we.prototype.parseInline = function (n, e) {
2866
2866
  we.prototype.renderInline = function (n, e) {
2867
2867
  return e = e || {}, this.renderer.render(this.parseInline(n, e), this.options, e);
2868
2868
  };
2869
- var ft = /*#__PURE__*/function () {
2870
- function ft() {
2871
- _classCallCheck(this, ft);
2869
+ var pt = /*#__PURE__*/function () {
2870
+ function pt() {
2871
+ _classCallCheck(this, pt);
2872
2872
  }
2873
- return _createClass(ft, null, [{
2873
+ return _createClass(pt, null, [{
2874
2874
  key: "instantiate",
2875
2875
  value: function instantiate(e) {
2876
- if (e) return new we(_objectSpread(_objectSpread({}, ft.DEFAULT_PROPERTIES), e));
2876
+ if (e) return new we(_objectSpread(_objectSpread({}, pt.DEFAULT_PROPERTIES), e));
2877
2877
  if (window.hljs) {
2878
2878
  var t = window.hljs;
2879
2879
  return new we({
@@ -2905,29 +2905,29 @@ var ft = /*#__PURE__*/function () {
2905
2905
  typographer: !0
2906
2906
  // Enable smartypants and other sweet transforms
2907
2907
  });
2908
- } else return new we(ft.DEFAULT_PROPERTIES);
2908
+ } else return new we(pt.DEFAULT_PROPERTIES);
2909
2909
  }
2910
2910
  }, {
2911
2911
  key: "createNew",
2912
2912
  value: function createNew(e) {
2913
- var t = ft.instantiate(e);
2913
+ var t = pt.instantiate(e);
2914
2914
  return t.inline.validateLink = function () {
2915
2915
  return !0;
2916
2916
  }, t;
2917
2917
  }
2918
2918
  }]);
2919
2919
  }();
2920
- ft.DEFAULT_PROPERTIES = {
2920
+ pt.DEFAULT_PROPERTIES = {
2921
2921
  breaks: !0,
2922
2922
  linkTarget: "_blank"
2923
2923
  // set target to open in a new tab
2924
2924
  };
2925
- var ti = ft;
2926
- var J = /*#__PURE__*/function () {
2927
- function J() {
2928
- _classCallCheck(this, J);
2925
+ var ti = pt;
2926
+ var X = /*#__PURE__*/function () {
2927
+ function X() {
2928
+ _classCallCheck(this, X);
2929
2929
  }
2930
- return _createClass(J, null, [{
2930
+ return _createClass(X, null, [{
2931
2931
  key: "applyCustomStylesToElements",
2932
2932
  value: function applyCustomStylesToElements(e, t, i) {
2933
2933
  if (i && (Object.assign(e.outerContainer.style, i.outerContainer), Object.assign(e.innerContainer.style, i.innerContainer), Object.assign(e.bubbleElement.style, i.bubble), t)) {
@@ -2939,7 +2939,7 @@ var J = /*#__PURE__*/function () {
2939
2939
  }, {
2940
2940
  key: "applySideStyles",
2941
2941
  value: function applySideStyles(e, t, i, s) {
2942
- s && (J.applyCustomStylesToElements(e, i, s.shared), t === y.USER_ROLE ? J.applyCustomStylesToElements(e, i, s.user) : (J.applyCustomStylesToElements(e, i, s.ai), J.applyCustomStylesToElements(e, i, s[t])));
2942
+ s && (X.applyCustomStylesToElements(e, i, s.shared), t === y.USER_ROLE ? X.applyCustomStylesToElements(e, i, s.user) : (X.applyCustomStylesToElements(e, i, s.ai), X.applyCustomStylesToElements(e, i, s[t])));
2943
2943
  }
2944
2944
  }, {
2945
2945
  key: "isElementsStyles",
@@ -2951,7 +2951,7 @@ var J = /*#__PURE__*/function () {
2951
2951
  key: "applyCustomStyles",
2952
2952
  value: function applyCustomStyles(e, t, i, s, r) {
2953
2953
  var o;
2954
- r && e["default"] !== r ? J.isElementsStyles(r) ? (J.applyCustomStylesToElements(t, s, (o = e["default"]) == null ? void 0 : o.shared), J.applyCustomStylesToElements(t, s, r)) : (J.applySideStyles(t, i, s, e["default"]), J.applySideStyles(t, i, s, r)) : J.applySideStyles(t, i, s, e["default"]);
2954
+ r && e["default"] !== r ? X.isElementsStyles(r) ? (X.applyCustomStylesToElements(t, s, (o = e["default"]) == null ? void 0 : o.shared), X.applyCustomStylesToElements(t, s, r)) : (X.applySideStyles(t, i, s, e["default"]), X.applySideStyles(t, i, s, r)) : X.applySideStyles(t, i, s, e["default"]);
2955
2955
  }
2956
2956
  // prettier-ignore
2957
2957
  }, {
@@ -2972,11 +2972,11 @@ var J = /*#__PURE__*/function () {
2972
2972
  }
2973
2973
  }]);
2974
2974
  }();
2975
- var yi = /*#__PURE__*/function () {
2976
- function yi() {
2977
- _classCallCheck(this, yi);
2975
+ var ii = /*#__PURE__*/function () {
2976
+ function ii() {
2977
+ _classCallCheck(this, ii);
2978
2978
  }
2979
- return _createClass(yi, null, [{
2979
+ return _createClass(ii, null, [{
2980
2980
  key: "onMessage",
2981
2981
  value: function onMessage(e, t, i) {
2982
2982
  var r;
@@ -3003,6 +3003,17 @@ var yi = /*#__PURE__*/function () {
3003
3003
  detail: e
3004
3004
  }));
3005
3005
  }
3006
+ }, {
3007
+ key: "onInput",
3008
+ value: function onInput(e, t, i) {
3009
+ var s;
3010
+ (s = e.onInput) == null || s.call(e, t, i), e.dispatchEvent(new CustomEvent("input", {
3011
+ detail: {
3012
+ content: t,
3013
+ isUser: i
3014
+ }
3015
+ }));
3016
+ }
3006
3017
  }, {
3007
3018
  key: "onError",
3008
3019
  value: function onError(e, t) {
@@ -3201,27 +3212,27 @@ var Me = /*#__PURE__*/function (_In) {
3201
3212
  }
3202
3213
  }]);
3203
3214
  }(In);
3204
- var zt = /*#__PURE__*/function (_In2) {
3205
- function zt(e) {
3215
+ var Gt = /*#__PURE__*/function (_In2) {
3216
+ function Gt(e) {
3206
3217
  var _this4;
3207
- _classCallCheck(this, zt);
3208
- _this4 = _callSuper(this, zt, ["name"]), _this4._names = e;
3218
+ _classCallCheck(this, Gt);
3219
+ _this4 = _callSuper(this, Gt, ["name"]), _this4._names = e;
3209
3220
  return _this4;
3210
3221
  }
3211
- _inherits(zt, _In2);
3212
- return _createClass(zt, [{
3222
+ _inherits(Gt, _In2);
3223
+ return _createClass(Gt, [{
3213
3224
  key: "addBesideMsg",
3214
3225
  value: function addBesideMsg(e, t) {
3215
3226
  var i = typeof this._names == "boolean" ? {} : this._names,
3216
3227
  s = this.createName(t, i),
3217
- r = zt.getPosition(t, i);
3228
+ r = Gt.getPosition(t, i);
3218
3229
  s.classList.add(r === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(r === "left" ? "beforebegin" : "afterend", s);
3219
3230
  }
3220
3231
  }, {
3221
3232
  key: "createName",
3222
3233
  value: function createName(e, t) {
3223
3234
  var i = document.createElement("div");
3224
- return i.classList.add(this.className), i.textContent = zt.getNameText(e, t), zt.applyStyle(i, e, t), i;
3235
+ return i.classList.add(this.className), i.textContent = Gt.getNameText(e, t), Gt.applyStyle(i, e, t), i;
3225
3236
  }
3226
3237
  }], [{
3227
3238
  key: "getPosition",
@@ -3249,7 +3260,7 @@ var Z = /*#__PURE__*/function () {
3249
3260
  var _this5 = this;
3250
3261
  _classCallCheck(this, Z);
3251
3262
  var t;
3252
- this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = Z.createContainerElement(), this.messageStyles = te.processMessageStyles(e.messageStyles), this._remarkable = ti.createNew(e.remarkable), e.avatars && (this.avatar = new Me(e.avatars)), e.names && (this.name = new zt(e.names)), this._onMessage = yi.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), this.focusMode = e.focusMode, this.focusMode || (this._lastGroupMessagesElement = document.createElement("div")), typeof this.focusMode != "boolean" && (t = this.focusMode) != null && t.fade && Ei.setFade(this.elementRef, this.focusMode.fade), setTimeout(function () {
3263
+ this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = Z.createContainerElement(), this.messageStyles = te.processMessageStyles(e.messageStyles), this._remarkable = ti.createNew(e.remarkable), e.avatars && (this.avatar = new Me(e.avatars)), e.names && (this.name = new Gt(e.names)), this._onMessage = ii.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), this.focusMode = e.focusMode, this.focusMode || (this._lastGroupMessagesElement = document.createElement("div")), typeof this.focusMode != "boolean" && (t = this.focusMode) != null && t.fade && Ei.setFade(this.elementRef, this.focusMode.fade), setTimeout(function () {
3253
3264
  _this5.submitUserMessage = e.submitUserMessage;
3254
3265
  });
3255
3266
  }
@@ -3284,7 +3295,7 @@ var Z = /*#__PURE__*/function () {
3284
3295
  var i = this.createNewMessageElement(e, t);
3285
3296
  if (this.appendOuterContainerElemet(i.outerContainer, t), t === "user") {
3286
3297
  var r = typeof this.focusMode != "boolean" && ((s = this.focusMode) == null ? void 0 : s.scroll);
3287
- G.scrollToBottom(this.elementRef, r);
3298
+ V.scrollToBottom(this.elementRef, r);
3288
3299
  }
3289
3300
  return i;
3290
3301
  }
@@ -3302,7 +3313,7 @@ var Z = /*#__PURE__*/function () {
3302
3313
  var _this6 = this;
3303
3314
  var i = this.createNewMessageElement(e, t);
3304
3315
  return this.appendOuterContainerElemet(i.outerContainer), setTimeout(function () {
3305
- return G.scrollToBottom(_this6.elementRef);
3316
+ return V.scrollToBottom(_this6.elementRef);
3306
3317
  }), i;
3307
3318
  }
3308
3319
  }, {
@@ -3381,7 +3392,7 @@ var Z = /*#__PURE__*/function () {
3381
3392
  }, {
3382
3393
  key: "applyCustomStyles",
3383
3394
  value: function applyCustomStyles(e, t, i, s) {
3384
- e && this.messageStyles && J.applyCustomStyles(this.messageStyles, e, t, i, s);
3395
+ e && this.messageStyles && X.applyCustomStyles(this.messageStyles, e, t, i, s);
3385
3396
  }
3386
3397
  }, {
3387
3398
  key: "removeMessage",
@@ -3700,27 +3711,29 @@ var pe = /*#__PURE__*/function () {
3700
3711
  if ((e == null ? void 0 : e.text) === void 0 && (e == null ? void 0 : e.html) === void 0) return console.error(k.INVALID_STREAM_EVENT);
3701
3712
  e != null && e.custom && this._message && (this._message.custom = e.custom);
3702
3713
  var t = (e == null ? void 0 : e.text) || (e == null ? void 0 : e.html) || "",
3703
- i = G.isScrollbarAtBottomOfElement(this._messages.elementRef),
3714
+ i = V.isScrollbarAtBottomOfElement(this._messages.elementRef),
3704
3715
  s = (e == null ? void 0 : e.text) !== void 0 ? "text" : "html";
3705
3716
  if (!this._elements && !this._message) this.setInitialState(s, t, e == null ? void 0 : e.role);else {
3706
3717
  if (this._streamType !== s) return console.error(k.INVALID_STREAM_EVENT_MIX);
3707
3718
  this.updateBasedOnType(t, s, e == null ? void 0 : e.overwrite);
3708
3719
  }
3709
- i && G.scrollToBottom(this._messages.elementRef);
3720
+ i && V.scrollToBottom(this._messages.elementRef);
3710
3721
  }
3711
3722
  }, {
3712
3723
  key: "setInitialState",
3713
3724
  value: function setInitialState(e, t, i) {
3714
- this._streamType = e, i !== null && i !== void 0 ? i : i = y.AI_ROLE, this._elements = e === "text" ? this._messages.addNewTextMessage("", i) : xe.add(this._messages, t, i), this._elements && (this._elements.bubbleElement.classList.add(pe.MESSAGE_CLASS), this.setTargetWrapperIfNeeded(this._elements, i), this._activeMessageRole = i, this._message = _defineProperty({
3725
+ var o, a;
3726
+ this._streamType = e, i !== null && i !== void 0 ? i : i = y.AI_ROLE;
3727
+ var s = ((o = this._customWrappers) == null ? void 0 : o[i]) || ((a = this._customWrappers) == null ? void 0 : a["default"]),
3728
+ r = s ? "" : t;
3729
+ this._elements = e === "text" ? this._messages.addNewTextMessage(r, i) : xe.add(this._messages, r, i), this._elements && (this._elements.bubbleElement.classList.add(pe.MESSAGE_CLASS), this._activeMessageRole = i, this._message = _defineProperty({
3715
3730
  role: this._activeMessageRole
3716
- }, e, t), this._messages.messageToElements.push([this._message, _defineProperty({}, e, this._elements)]));
3731
+ }, e, r), this._messages.messageToElements.push([this._message, _defineProperty({}, e, this._elements)]), s && this.setTargetWrapperIfNeeded(this._elements, t, this._streamType, s));
3717
3732
  }
3718
3733
  }, {
3719
3734
  key: "setTargetWrapperIfNeeded",
3720
- value: function setTargetWrapperIfNeeded(e, t) {
3721
- var s, r;
3722
- var i = ((s = this._customWrappers) == null ? void 0 : s[t]) || ((r = this._customWrappers) == null ? void 0 : r["default"]);
3723
- i && (e.bubbleElement.innerHTML = i, this._targetWrapper = e.bubbleElement.getElementsByClassName(pe.TARGET_WRAPPER_CLASS)[0]);
3735
+ value: function setTargetWrapperIfNeeded(e, t, i, s) {
3736
+ e.bubbleElement.innerHTML = s, this._targetWrapper = e.bubbleElement.getElementsByClassName(pe.TARGET_WRAPPER_CLASS)[0], this._elements && G.apply(this._messages, this._elements.bubbleElement), this.updateBasedOnType(t, i);
3724
3737
  }
3725
3738
  }, {
3726
3739
  key: "updateBasedOnType",
@@ -3765,7 +3778,7 @@ var pe = /*#__PURE__*/function () {
3765
3778
  var e;
3766
3779
  if (!(this._endStreamAfterOperation || !this._message) && !(this._fileAdded && !this._elements)) {
3767
3780
  if (!this._elements) throw Error(k.NO_VALID_STREAM_EVENTS_SENT);
3768
- (e = this._elements.bubbleElement) != null && e.classList.contains(pe.MESSAGE_CLASS) && (this._streamType === "text" ? this._messages.textToSpeech && gt.speak(this._message.text || "", this._messages.textToSpeech) : this._streamType === "html" && this._elements && X.apply(this._messages, this._elements.outerContainer), this._elements.bubbleElement.classList.remove(pe.MESSAGE_CLASS), this._message && (this._targetWrapper && (this._message.html = this._elements.bubbleElement.children[0].outerHTML, this._streamType === "text" && delete this._message.text), this._messages.sendClientUpdate(he.createMessageContent(this._message), !1)), this._hasStreamEnded = !0);
3781
+ (e = this._elements.bubbleElement) != null && e.classList.contains(pe.MESSAGE_CLASS) && (this._streamType === "text" ? this._messages.textToSpeech && bt.speak(this._message.text || "", this._messages.textToSpeech) : this._streamType === "html" && this._elements && G.apply(this._messages, this._elements.outerContainer), this._elements.bubbleElement.classList.remove(pe.MESSAGE_CLASS), this._message && (this._targetWrapper && (this._message.html = this._elements.bubbleElement.children[0].outerHTML, this._streamType === "text" && delete this._message.text), this._messages.sendClientUpdate(he.createMessageContent(this._message), !1)), this._hasStreamEnded = !0);
3769
3782
  }
3770
3783
  }
3771
3784
  }, {
@@ -4471,7 +4484,7 @@ var A = /*#__PURE__*/function () {
4471
4484
  key: "simulate",
4472
4485
  value: function () {
4473
4486
  var _simulate = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee1(e, t, i, s) {
4474
- var r, o, _o2, a, _o3;
4487
+ var r, o, _o2, a, _o3, _a2;
4475
4488
  return _regeneratorRuntime().wrap(function _callee1$(_context1) {
4476
4489
  while (1) switch (_context1.prev = _context1.next) {
4477
4490
  case 0:
@@ -4512,8 +4525,10 @@ var A = /*#__PURE__*/function () {
4512
4525
  }
4513
4526
  if (i.html) {
4514
4527
  t.onOpen();
4515
- _o3 = X.splitHTML(i.html);
4516
- _o3.length === 0 && (_o3 = i.html.split("")), A.populateMessages(e, _o3, new Ae(e), r, "html", 0, s);
4528
+ _o3 = G.splitHTML(i.html);
4529
+ _o3.length === 0 && (_o3 = i.html.split(""));
4530
+ _a2 = new Ae(e, s == null ? void 0 : s.stream);
4531
+ A.populateMessages(e, _o3, _a2, r, "html", 0, s);
4517
4532
  }
4518
4533
  i.error && (E.displayError(e, i.error), t.onClose());
4519
4534
  case 13:
@@ -5381,7 +5396,7 @@ var ze = /*#__PURE__*/function () {
5381
5396
  this._messages.removeMessage(t), ze.displayIntroMessages(this._messages.messageElementRefs), i.forEach(function (s) {
5382
5397
  return _this0._messages.addAnyMessage(s, !0);
5383
5398
  }), setTimeout(function () {
5384
- return G.scrollToBottom(_this0._messages.elementRef);
5399
+ return V.scrollToBottom(_this0._messages.elementRef);
5385
5400
  }, 0);
5386
5401
  case 5:
5387
5402
  case "end":
@@ -5512,7 +5527,7 @@ var ze = /*#__PURE__*/function () {
5512
5527
  i = _context25.sent;
5513
5528
  s = this._messages.elementRef.scrollTop;
5514
5529
  this.populateMessages(t, i), s === 0 && setTimeout(function () {
5515
- return G.scrollToBottom(_this12._messages.elementRef);
5530
+ return V.scrollToBottom(_this12._messages.elementRef);
5516
5531
  }, 0);
5517
5532
  _context25.next = 13;
5518
5533
  break;
@@ -5572,12 +5587,12 @@ var ze = /*#__PURE__*/function () {
5572
5587
  }]);
5573
5588
  }();
5574
5589
  ze.FAILED_ERROR_MESSAGE = "Failed to load history";
5575
- var ii = ze;
5576
- var vt = /*#__PURE__*/function () {
5577
- function vt() {
5578
- _classCallCheck(this, vt);
5590
+ var si = ze;
5591
+ var yt = /*#__PURE__*/function () {
5592
+ function yt() {
5593
+ _classCallCheck(this, yt);
5579
5594
  }
5580
- return _createClass(vt, null, [{
5595
+ return _createClass(yt, null, [{
5581
5596
  key: "getCharacterLimitMessages",
5582
5597
  value: function getCharacterLimitMessages(e, t) {
5583
5598
  var r;
@@ -5604,7 +5619,7 @@ var vt = /*#__PURE__*/function () {
5604
5619
  }, {
5605
5620
  key: "processMessages",
5606
5621
  value: function processMessages(e, t, i) {
5607
- return t !== void 0 ? t > 0 && (e = vt.getMaxMessages(e, t)) : e = [e[e.length - 1]], e = JSON.parse(JSON.stringify(e)), i === void 0 ? e : vt.getCharacterLimitMessages(e, i);
5622
+ return t !== void 0 ? t > 0 && (e = yt.getMaxMessages(e, t)) : e = [e[e.length - 1]], e = JSON.parse(JSON.stringify(e)), i === void 0 ? e : yt.getCharacterLimitMessages(e, i);
5608
5623
  }
5609
5624
  }]);
5610
5625
  }();
@@ -5721,7 +5736,7 @@ var rt = /*#__PURE__*/function () {
5721
5736
  var _a$url;
5722
5737
  _classCallCheck(this, rt);
5723
5738
  var s, r, o, a, l;
5724
- this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = rt.canSendMessage, this.connectSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (s = e.connect) == null ? void 0 : s.additionalBodyProps), this.totalMessagesMaxCharLength = (r = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : r.totalMessagesMaxCharLength, this.maxMessages = (o = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : o.maxMessages, B.set(e, this, t), e.connect && (this.connectSettings = e.connect), this.demo && ((_a$url = (a = this.connectSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = ye.URL), this.connectSettings.websocket && H.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || te.checkForStream(this.deepChat), e.loadHistory && ii.addErrorPrefix(this);
5739
+ this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = rt.canSendMessage, this.connectSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (s = e.connect) == null ? void 0 : s.additionalBodyProps), this.totalMessagesMaxCharLength = (r = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : r.totalMessagesMaxCharLength, this.maxMessages = (o = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : o.maxMessages, B.set(e, this, t), e.connect && (this.connectSettings = e.connect), this.demo && ((_a$url = (a = this.connectSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = ye.URL), this.connectSettings.websocket && H.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || te.checkForStream(this.deepChat), e.loadHistory && si.addErrorPrefix(this);
5725
5740
  }
5726
5741
  return _createClass(rt, [{
5727
5742
  key: "verifyKey",
@@ -5846,7 +5861,7 @@ var rt = /*#__PURE__*/function () {
5846
5861
  }
5847
5862
  throw new Error("Request settings have not been set up");
5848
5863
  case 2:
5849
- i = vt.processMessages(t.messageToElements.map(function (_ref13) {
5864
+ i = yt.processMessages(t.messageToElements.map(function (_ref13) {
5850
5865
  var _ref14 = _slicedToArray(_ref13, 1),
5851
5866
  s = _ref14[0];
5852
5867
  return s;
@@ -5935,17 +5950,17 @@ var rt = /*#__PURE__*/function () {
5935
5950
  }
5936
5951
  }]);
5937
5952
  }();
5938
- var V = /*#__PURE__*/function (_rt) {
5953
+ var K = /*#__PURE__*/function (_rt) {
5939
5954
  // prettier-ignore
5940
- function V(e, t, i, s, r) {
5955
+ function K(e, t, i, s, r) {
5941
5956
  var _this13;
5942
- _classCallCheck(this, V);
5957
+ _classCallCheck(this, K);
5943
5958
  var o;
5944
- _this13 = _callSuper(this, V, [e, r]), _this13.insertKeyPlaceholderText = "API Key", _this13.keyHelpUrl = "", Object.assign(_this13.rawBody, (o = e.connect) == null ? void 0 : o.additionalBodyProps), _this13._keyVerificationDetails = t, _this13._buildHeadersFunc = i, s && _this13.setApiKeyProperties(s), _this13.connectSettings = _this13.buildConnectSettings(_this13.key || "", e.connect);
5959
+ _this13 = _callSuper(this, K, [e, r]), _this13.insertKeyPlaceholderText = "API Key", _this13.keyHelpUrl = "", Object.assign(_this13.rawBody, (o = e.connect) == null ? void 0 : o.additionalBodyProps), _this13._keyVerificationDetails = t, _this13._buildHeadersFunc = i, s && _this13.setApiKeyProperties(s), _this13.connectSettings = _this13.buildConnectSettings(_this13.key || "", e.connect);
5945
5960
  return _this13;
5946
5961
  }
5947
- _inherits(V, _rt);
5948
- return _createClass(V, [{
5962
+ _inherits(K, _rt);
5963
+ return _createClass(K, [{
5949
5964
  key: "setApiKeyProperties",
5950
5965
  value: function setApiKeyProperties(e) {
5951
5966
  this.key = e.key, e.validateKeyProperty && (this.validateKeyProperty = e.validateKeyProperty);
@@ -6092,11 +6107,11 @@ var Ge = /*#__PURE__*/function () {
6092
6107
  }();
6093
6108
  Ge.VISIBLE_ICON_ID = "visible-icon";
6094
6109
  var os = Ge;
6095
- var K = /*#__PURE__*/function () {
6096
- function K() {
6097
- _classCallCheck(this, K);
6110
+ var W = /*#__PURE__*/function () {
6111
+ function W() {
6112
+ _classCallCheck(this, W);
6098
6113
  }
6099
- return _createClass(K, null, [{
6114
+ return _createClass(W, null, [{
6100
6115
  key: "createCautionText",
6101
6116
  value: function createCautionText() {
6102
6117
  var e = document.createElement("a");
@@ -6122,13 +6137,13 @@ var K = /*#__PURE__*/function () {
6122
6137
  i.id = "insert-key-help-text-container";
6123
6138
  var s = document.createElement("div");
6124
6139
  s.id = "insert-key-help-text-contents";
6125
- var r = K.createFailText();
6140
+ var r = W.createFailText();
6126
6141
  if (s.appendChild(r), e) {
6127
- var o = K.createHelpLink(e);
6142
+ var o = W.createHelpLink(e);
6128
6143
  s.appendChild(o);
6129
6144
  }
6130
6145
  if (t === !0) {
6131
- var _o4 = K.createCautionText();
6146
+ var _o4 = W.createCautionText();
6132
6147
  s.appendChild(_o4);
6133
6148
  }
6134
6149
  return i.appendChild(s), {
@@ -6159,10 +6174,10 @@ var K = /*#__PURE__*/function () {
6159
6174
  value: function addVerificationEvents(e, t, i, s, r) {
6160
6175
  var o = {
6161
6176
  onSuccess: s,
6162
- onFail: K.onFail.bind(this, e, t, i),
6163
- onLoad: K.onLoad.bind(this, e, t)
6177
+ onFail: W.onFail.bind(this, e, t, i),
6178
+ onLoad: W.onLoad.bind(this, e, t)
6164
6179
  },
6165
- a = K.verifyKey.bind(this, e, o, r);
6180
+ a = W.verifyKey.bind(this, e, o, r);
6166
6181
  t.onclick = a, e.onkeydown = function (l) {
6167
6182
  !e.classList.contains("loading") && l.key === U.ENTER && a();
6168
6183
  };
@@ -6184,7 +6199,7 @@ var K = /*#__PURE__*/function () {
6184
6199
  var t = document.createElement("div");
6185
6200
  t.id = "insert-key-input-container";
6186
6201
  var i = document.createElement("input");
6187
- return i.id = "insert-key-input", i.placeholder = e || "API Key", i.type = "password", i.classList.add("insert-key-input-valid"), i.onfocus = K.onInputFocus, t.appendChild(i), t;
6202
+ return i.id = "insert-key-input", i.placeholder = e || "API Key", i.type = "password", i.classList.add("insert-key-input-valid"), i.onfocus = W.onInputFocus, t.appendChild(i), t;
6188
6203
  }
6189
6204
  // prettier-ignore
6190
6205
  }, {
@@ -6193,28 +6208,28 @@ var K = /*#__PURE__*/function () {
6193
6208
  var d;
6194
6209
  var i = document.createElement("div");
6195
6210
  i.id = "insert-key-contents";
6196
- var s = K.createInput(t.insertKeyPlaceholderText),
6211
+ var s = W.createInput(t.insertKeyPlaceholderText),
6197
6212
  r = s.children[0],
6198
6213
  o = os.create(r);
6199
6214
  s.appendChild(o), i.appendChild(s);
6200
- var a = K.createStartButton(),
6201
- _K$createHelpTextCont = K.createHelpTextContainer(t.keyHelpUrl, (d = t.deepChat._insertKeyViewStyles) == null ? void 0 : d.displayCautionText),
6202
- l = _K$createHelpTextCont.helpTextContainerElement,
6203
- c = _K$createHelpTextCont.failTextElement;
6204
- return i.appendChild(a), i.appendChild(l), K.addVerificationEvents(r, a, c, e, t), i;
6215
+ var a = W.createStartButton(),
6216
+ _W$createHelpTextCont = W.createHelpTextContainer(t.keyHelpUrl, (d = t.deepChat._insertKeyViewStyles) == null ? void 0 : d.displayCautionText),
6217
+ l = _W$createHelpTextCont.helpTextContainerElement,
6218
+ c = _W$createHelpTextCont.failTextElement;
6219
+ return i.appendChild(a), i.appendChild(l), W.addVerificationEvents(r, a, c, e, t), i;
6205
6220
  }
6206
6221
  }, {
6207
6222
  key: "createElements",
6208
6223
  value: function createElements(e, t) {
6209
6224
  var i = document.createElement("div");
6210
6225
  i.id = "insert-key-view";
6211
- var s = K.createContents(e, t);
6226
+ var s = W.createContents(e, t);
6212
6227
  return i.appendChild(s), i;
6213
6228
  }
6214
6229
  }, {
6215
6230
  key: "render",
6216
6231
  value: function render(e, t, i) {
6217
- var s = K.createElements(t, i);
6232
+ var s = W.createElements(t, i);
6218
6233
  e.replaceChildren(s);
6219
6234
  }
6220
6235
  }]);
@@ -6227,7 +6242,7 @@ var se = /*#__PURE__*/function () {
6227
6242
  key: "enableButtons",
6228
6243
  value: function enableButtons(e, t) {
6229
6244
  var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
6230
- window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i < si.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
6245
+ window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i < ni.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
6231
6246
  return se.enableButtons(e, t, i + 1);
6232
6247
  }, 250);
6233
6248
  }
@@ -6452,7 +6467,7 @@ var Xs = {
6452
6467
  var t;
6453
6468
  ((t = this._webModel.introMessage) == null ? void 0 : t.autoScroll) !== !1 && setTimeout(function () {
6454
6469
  var i, s;
6455
- (i = _this18._messages) != null && i.elementRef && G.scrollToTop((s = _this18._messages) == null ? void 0 : s.elementRef);
6470
+ (i = _this18._messages) != null && i.elementRef && V.scrollToTop((s = _this18._messages) == null ? void 0 : s.elementRef);
6456
6471
  }, e);
6457
6472
  }
6458
6473
  // prettier-ignore
@@ -6584,7 +6599,7 @@ var Xs = {
6584
6599
  sendUpdate: !1
6585
6600
  }), i && (setTimeout(function () {
6586
6601
  var p;
6587
- return G.scrollToBottom((p = _this19._messages) == null ? void 0 : p.elementRef);
6602
+ return V.scrollToBottom((p = _this19._messages) == null ? void 0 : p.elementRef);
6588
6603
  }), i = !1);
6589
6604
  };
6590
6605
  T.chat.setInitProgressCallback(s);
@@ -6959,7 +6974,7 @@ var Xs = {
6959
6974
  }]);
6960
6975
  }(rt);
6961
6976
  T.GENERIC_ERROR = "Error, please check the [troubleshooting](https://deepchat.dev/docs/webModel#troubleshooting) section of documentation for help.", T.MULTIPLE_MODELS_ERROR = "Cannot run multiple web models", T.WEB_LLM_NOT_FOUND_ERROR = "WebLLM module not found", T.DEFAULT_MODEL = "Llama-2-7b-chat-hf-q4f32_1", T.MODULE_SEARCH_LIMIT_S = 5;
6962
- var si = T;
6977
+ var ni = T;
6963
6978
  var xi = /*#__PURE__*/function () {
6964
6979
  function xi() {
6965
6980
  _classCallCheck(this, xi);
@@ -6991,7 +7006,7 @@ var xi = /*#__PURE__*/function () {
6991
7006
  }
6992
7007
  }]);
6993
7008
  }();
6994
- var Jt = /*#__PURE__*/function (_V) {
7009
+ var Jt = /*#__PURE__*/function (_K) {
6995
7010
  // prettier-ignore
6996
7011
  function Jt(e, t, i, s, r, o) {
6997
7012
  var _this21;
@@ -7000,7 +7015,7 @@ var Jt = /*#__PURE__*/function (_V) {
7000
7015
  return _this21;
7001
7016
  }
7002
7017
  // prettier-ignore
7003
- _inherits(Jt, _V);
7018
+ _inherits(Jt, _K);
7004
7019
  return _createClass(Jt, [{
7005
7020
  key: "preprocessBody",
7006
7021
  value: function preprocessBody(e, t, i) {
@@ -7039,19 +7054,19 @@ var Jt = /*#__PURE__*/function (_V) {
7039
7054
  return callServiceAPI;
7040
7055
  }()
7041
7056
  }]);
7042
- }(V);
7057
+ }(K);
7043
7058
  Jt.URL_PREFIX = "https://api-inference.huggingface.co/models/";
7044
7059
  var je = Jt;
7045
- var li = /*#__PURE__*/function (_je) {
7060
+ var ci = /*#__PURE__*/function (_je) {
7046
7061
  // prettier-ignore
7047
- function li(e, t, i, s, r, o) {
7062
+ function ci(e, t, i, s, r, o) {
7048
7063
  var _this22;
7049
- _classCallCheck(this, li);
7050
- _this22 = _callSuper(this, li, [e, t, i, s, r, o]), _this22.isTextInputDisabled = !0, _this22.canSendMessage = li.canSendFile;
7064
+ _classCallCheck(this, ci);
7065
+ _this22 = _callSuper(this, ci, [e, t, i, s, r, o]), _this22.isTextInputDisabled = !0, _this22.canSendMessage = ci.canSendFile;
7051
7066
  return _this22;
7052
7067
  }
7053
- _inherits(li, _je);
7054
- return _createClass(li, [{
7068
+ _inherits(ci, _je);
7069
+ return _createClass(ci, [{
7055
7070
  key: "preprocessBody",
7056
7071
  value: function preprocessBody(e, t, i) {
7057
7072
  return i[0];
@@ -7095,7 +7110,7 @@ var li = /*#__PURE__*/function (_je) {
7095
7110
  }
7096
7111
  }]);
7097
7112
  }(je);
7098
- var Ho = /*#__PURE__*/function (_li) {
7113
+ var Ho = /*#__PURE__*/function (_ci) {
7099
7114
  // prettier-ignore
7100
7115
  function Ho(e) {
7101
7116
  _classCallCheck(this, Ho);
@@ -7106,7 +7121,7 @@ var Ho = /*#__PURE__*/function (_li) {
7106
7121
  audio: {}
7107
7122
  }]);
7108
7123
  }
7109
- _inherits(Ho, _li);
7124
+ _inherits(Ho, _ci);
7110
7125
  return _createClass(Ho, [{
7111
7126
  key: "extractPollResultData",
7112
7127
  value: function () {
@@ -7144,8 +7159,8 @@ var Ho = /*#__PURE__*/function (_li) {
7144
7159
  return extractPollResultData;
7145
7160
  }()
7146
7161
  }]);
7147
- }(li);
7148
- var qo = /*#__PURE__*/function (_li2) {
7162
+ }(ci);
7163
+ var qo = /*#__PURE__*/function (_ci2) {
7149
7164
  function qo(e) {
7150
7165
  _classCallCheck(this, qo);
7151
7166
  var s, r, o;
@@ -7155,7 +7170,7 @@ var qo = /*#__PURE__*/function (_li2) {
7155
7170
  images: {}
7156
7171
  }]);
7157
7172
  }
7158
- _inherits(qo, _li2);
7173
+ _inherits(qo, _ci2);
7159
7174
  return _createClass(qo, [{
7160
7175
  key: "extractPollResultData",
7161
7176
  value: function () {
@@ -7193,8 +7208,8 @@ var qo = /*#__PURE__*/function (_li2) {
7193
7208
  return extractPollResultData;
7194
7209
  }()
7195
7210
  }]);
7196
- }(li);
7197
- var ci = "data:image/png;base64,";
7211
+ }(ci);
7212
+ var di = "data:image/png;base64,";
7198
7213
  var Ce = /*#__PURE__*/function () {
7199
7214
  function Ce() {
7200
7215
  _classCallCheck(this, Ce);
@@ -7224,7 +7239,7 @@ var Ce = /*#__PURE__*/function () {
7224
7239
  }
7225
7240
  }]);
7226
7241
  }();
7227
- var zi = /*#__PURE__*/function (_V2) {
7242
+ var zi = /*#__PURE__*/function (_K2) {
7228
7243
  // prettier-ignore
7229
7244
  function zi(e, t, i, s, r) {
7230
7245
  var _this23;
@@ -7232,9 +7247,9 @@ var zi = /*#__PURE__*/function (_V2) {
7232
7247
  _this23 = _callSuper(this, zi, [e, t, i, s, r]), _this23.insertKeyPlaceholderText = "Stability AI API Key", _this23.keyHelpUrl = "https://platform.stability.ai/docs/getting-started/authentication", _this23.permittedErrorPrefixes = ["Incorrect", "invalid_"];
7233
7248
  return _this23;
7234
7249
  }
7235
- _inherits(zi, _V2);
7250
+ _inherits(zi, _K2);
7236
7251
  return _createClass(zi);
7237
- }(V);
7252
+ }(K);
7238
7253
  var wi = /*#__PURE__*/function (_zi) {
7239
7254
  function wi(e) {
7240
7255
  var _this24;
@@ -7314,7 +7329,7 @@ var wi = /*#__PURE__*/function (_zi) {
7314
7329
  return _context49.abrupt("return", {
7315
7330
  files: e.artifacts.map(function (i) {
7316
7331
  return {
7317
- src: "".concat(ci).concat(i.base64),
7332
+ src: "".concat(di).concat(i.base64),
7318
7333
  type: "image"
7319
7334
  };
7320
7335
  })
@@ -7421,7 +7436,7 @@ var Ai = /*#__PURE__*/function (_zi2) {
7421
7436
  return _context51.abrupt("return", {
7422
7437
  files: e.artifacts.map(function (i) {
7423
7438
  return {
7424
- src: "".concat(ci).concat(i.base64),
7439
+ src: "".concat(di).concat(i.base64),
7425
7440
  type: "image"
7426
7441
  };
7427
7442
  })
@@ -7449,7 +7464,7 @@ var Ai = /*#__PURE__*/function (_zi2) {
7449
7464
  }
7450
7465
  }]);
7451
7466
  }(zi);
7452
- var zo = /*#__PURE__*/function (_li3) {
7467
+ var zo = /*#__PURE__*/function (_ci3) {
7453
7468
  function zo(e) {
7454
7469
  _classCallCheck(this, zo);
7455
7470
  var s, r, o;
@@ -7459,7 +7474,7 @@ var zo = /*#__PURE__*/function (_li3) {
7459
7474
  audio: {}
7460
7475
  }]);
7461
7476
  }
7462
- _inherits(zo, _li3);
7477
+ _inherits(zo, _ci3);
7463
7478
  return _createClass(zo, [{
7464
7479
  key: "extractPollResultData",
7465
7480
  value: function () {
@@ -7496,7 +7511,7 @@ var zo = /*#__PURE__*/function (_li3) {
7496
7511
  return extractPollResultData;
7497
7512
  }()
7498
7513
  }]);
7499
- }(li);
7514
+ }(ci);
7500
7515
  var Go = /*#__PURE__*/function (_je2) {
7501
7516
  function Go(e) {
7502
7517
  _classCallCheck(this, Go);
@@ -7790,7 +7805,7 @@ var Ti = /*#__PURE__*/function (_zi3) {
7790
7805
  return _context58.abrupt("return", {
7791
7806
  files: e.artifacts.map(function (i) {
7792
7807
  return {
7793
- src: "".concat(ci).concat(i.base64),
7808
+ src: "".concat(di).concat(i.base64),
7794
7809
  type: "image"
7795
7810
  };
7796
7811
  })
@@ -7922,7 +7937,7 @@ var Ci = /*#__PURE__*/function (_zi4) {
7922
7937
  return _context61.abrupt("return", {
7923
7938
  files: e.artifacts.map(function (i) {
7924
7939
  return {
7925
- src: "".concat(ci).concat(i.base64),
7940
+ src: "".concat(di).concat(i.base64),
7926
7941
  type: "image"
7927
7942
  };
7928
7943
  })
@@ -8375,12 +8390,12 @@ var ne = /*#__PURE__*/function () {
8375
8390
  }();
8376
8391
  ne.FILES_WITH_TEXT_ERROR = "content with type `text` must have `text` values", ne.FUNCTION_TOOL_RESP_ERROR = "Response must contain an array of strings for each individual function/tool_call, see https://deepchat.dev/docs/directConnection/OpenAI/#assistant-functions.";
8377
8392
  var ke = ne;
8378
- var Ve = /*#__PURE__*/function (_V3) {
8393
+ var Ve = /*#__PURE__*/function (_K3) {
8379
8394
  // prettier-ignore
8380
8395
  function Ve(e, t, i, s, r, o) {
8381
8396
  var _this31;
8382
8397
  _classCallCheck(this, Ve);
8383
- if (_this31 = _callSuper(this, Ve, [e, s, r, o]), _this31.insertKeyPlaceholderText = "OpenAI API Key", _this31.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this31.url = "", _this31.permittedErrorPrefixes = ["Incorrect", "Please send text", ii.FAILED_ERROR_MESSAGE], _this31.shouldFetchHistory = !1, _this31._searchedForThreadId = !1, _this31._config = {}, _this31._newAssistantDetails = {
8398
+ if (_this31 = _callSuper(this, Ve, [e, s, r, o]), _this31.insertKeyPlaceholderText = "OpenAI API Key", _this31.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this31.url = "", _this31.permittedErrorPrefixes = ["Incorrect", "Please send text", si.FAILED_ERROR_MESSAGE], _this31.shouldFetchHistory = !1, _this31._searchedForThreadId = !1, _this31._config = {}, _this31._newAssistantDetails = {
8384
8399
  model: "gpt-4"
8385
8400
  }, _this31._waitingForStreamResponse = !1, _this31._isSSEStream = !1, _this31.urlSegments = i, _typeof(t) == "object") {
8386
8401
  _this31._config = t;
@@ -8393,7 +8408,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8393
8408
  _this31.maxMessages = 1, _this31._isSSEStream = !!(_this31.stream && (_typeof(_this31.stream) != "object" || !_this31.stream.simulation));
8394
8409
  return _this31;
8395
8410
  }
8396
- _inherits(Ve, _V3);
8411
+ _inherits(Ve, _K3);
8397
8412
  return _createClass(Ve, [{
8398
8413
  key: "fetchHistoryFunc",
8399
8414
  value: function () {
@@ -8433,7 +8448,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8433
8448
  key: "processMessage",
8434
8449
  value: function processMessage(e, t) {
8435
8450
  var i = this.totalMessagesMaxCharLength || -1,
8436
- s = vt.getCharacterLimitMessages(e, i)[0];
8451
+ s = yt.getCharacterLimitMessages(e, i)[0];
8437
8452
  if (t && t.length > 0) {
8438
8453
  var r = this.filesToolType;
8439
8454
  if (typeof this.filesToolType == "function") {
@@ -8449,8 +8464,8 @@ var Ve = /*#__PURE__*/function (_V3) {
8449
8464
  var a = _ref21.name;
8450
8465
  return !q.isImageFileExtension(a);
8451
8466
  })) console.error("The uploaded files contained a non-image file"), console.error('Make sure only images can be uploaded or define a "code_interpreter" or "file_search" value in the "files_tool_type" property'), console.warn('Make sure your existing assistant supports these "tools" or specify them in the "new_assistant" property');else {
8452
- var _a2 = Ve.processImageMessage(s, t);
8453
- if (_a2) return _a2;
8467
+ var _a3 = Ve.processImageMessage(s, t);
8468
+ if (_a3) return _a3;
8454
8469
  }
8455
8470
  }
8456
8471
  return {
@@ -8889,7 +8904,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8889
8904
  key: "parseStreamResult",
8890
8905
  value: function () {
8891
8906
  var _parseStreamResult = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(e) {
8892
- var t, i, s, r, o, a, l, c, _a3, _l2;
8907
+ var t, i, s, r, o, a, l, c, _a4, _l2;
8893
8908
  return _regeneratorRuntime().wrap(function _callee82$(_context82) {
8894
8909
  while (1) switch (_context82.prev = _context82.next) {
8895
8910
  case 0:
@@ -8922,10 +8937,10 @@ var Ve = /*#__PURE__*/function (_V3) {
8922
8937
  _context82.next = 13;
8923
8938
  break;
8924
8939
  }
8925
- _a3 = e.delta.content.find(function (l) {
8940
+ _a4 = e.delta.content.find(function (l) {
8926
8941
  return l.text;
8927
8942
  });
8928
- if (!((r = _a3 == null ? void 0 : _a3.text) != null && r.annotations && _a3.text.annotations.length === 0)) {
8943
+ if (!((r = _a4 == null ? void 0 : _a4.text) != null && r.annotations && _a4.text.annotations.length === 0)) {
8929
8944
  _context82.next = 13;
8930
8945
  break;
8931
8946
  }
@@ -9022,7 +9037,7 @@ var Ve = /*#__PURE__*/function (_V3) {
9022
9037
  };
9023
9038
  }
9024
9039
  }]);
9025
- }(V);
9040
+ }(K);
9026
9041
  Ve.POLLING_TIMEOUT_MS = 500;
9027
9042
  var Ri = Ve;
9028
9043
  var xs = /*#__PURE__*/function (_Ri) {
@@ -9095,16 +9110,16 @@ var Mi = /*#__PURE__*/function () {
9095
9110
  }
9096
9111
  }]);
9097
9112
  }();
9098
- var ws = /*#__PURE__*/function (_V4) {
9113
+ var ws = /*#__PURE__*/function (_K4) {
9099
9114
  function ws(e, t, i, s, r) {
9100
9115
  var _this35;
9101
9116
  _classCallCheck(this, ws);
9102
9117
  _this35 = _callSuper(this, ws, [e, Mi.buildKeyVerificationDetails(), Mi.buildHeaders, r]), _this35.insertKeyPlaceholderText = "Cohere API Key", _this35.keyHelpUrl = "https://dashboard.cohere.ai/api-keys", _this35.permittedErrorPrefixes = ["invalid"], _this35.url = t, _this35.textInputPlaceholderText = i, s && _typeof(s) == "object" && Object.assign(_this35.rawBody, s);
9103
9118
  return _this35;
9104
9119
  }
9105
- _inherits(ws, _V4);
9120
+ _inherits(ws, _K4);
9106
9121
  return _createClass(ws);
9107
- }(V);
9122
+ }(K);
9108
9123
  var Xo = /*#__PURE__*/function (_ws) {
9109
9124
  function Xo(e) {
9110
9125
  _classCallCheck(this, Xo);
@@ -9213,11 +9228,11 @@ var Is = /*#__PURE__*/function () {
9213
9228
  }();
9214
9229
  Is.URL_DETAILS_ERROR_MESSAGE = "Please define the Azure URL Details. [More Information](https://deepchat.dev/docs/directConnection/Azure)";
9215
9230
  var ue = Is;
9216
- var pt = /*#__PURE__*/function (_Ri2) {
9217
- function pt(e) {
9231
+ var mt = /*#__PURE__*/function (_Ri2) {
9232
+ function mt(e) {
9218
9233
  var _g$headers;
9219
9234
  var _this36;
9220
- _classCallCheck(this, pt);
9235
+ _classCallCheck(this, mt);
9221
9236
  var c, d, u, h, f, m, p, g;
9222
9237
  var t = JSON.parse(JSON.stringify(e.directConnection)),
9223
9238
  i = t.azure,
@@ -9226,16 +9241,16 @@ var pt = /*#__PURE__*/function (_Ri2) {
9226
9241
  o = "".concat((d = s == null ? void 0 : s.urlDetails) == null ? void 0 : d.endpoint, "/openai/"),
9227
9242
  a = "?api-version=".concat((u = s == null ? void 0 : s.urlDetails) == null ? void 0 : u.version),
9228
9243
  l = {
9229
- threadsPrefix: "".concat(o).concat(pt.THREAD_RESOURCE),
9244
+ threadsPrefix: "".concat(o).concat(mt.THREAD_RESOURCE),
9230
9245
  threadsPosfix: a,
9231
- newAssistantUrl: "".concat(o).concat(pt.NEW_ASSISTANT_RESOURCE).concat(a),
9246
+ newAssistantUrl: "".concat(o).concat(mt.NEW_ASSISTANT_RESOURCE).concat(a),
9232
9247
  createMessagePostfix: a,
9233
9248
  listMessagesPostfix: "order=desc&api-version=".concat((h = s == null ? void 0 : s.urlDetails) == null ? void 0 : h.version),
9234
9249
  storeFiles: "".concat(o, "files").concat(a),
9235
9250
  getFilesPrefix: "".concat(o, "files/"),
9236
9251
  getFilesPostfix: "/content".concat(a)
9237
9252
  };
9238
- if (_this36 = _callSuper(this, pt, [e, s == null ? void 0 : s.assistant, l, ue.buildKeyVerificationDetails(r), ue.buildHeaders, i]), _this36.permittedErrorPrefixes = [ue.URL_DETAILS_ERROR_MESSAGE], _this36.insertKeyPlaceholderText = "Azure OpenAI API Key", _this36.keyHelpUrl = "https://learn.microsoft.com/en-us/answers/questions/1193991/how-to-get-the-value-of-openai-api-key", _this36.isTextInputDisabled = !1, _typeof(s == null ? void 0 : s.assistant) == "object") {
9253
+ if (_this36 = _callSuper(this, mt, [e, s == null ? void 0 : s.assistant, l, ue.buildKeyVerificationDetails(r), ue.buildHeaders, i]), _this36.permittedErrorPrefixes = [ue.URL_DETAILS_ERROR_MESSAGE], _this36.insertKeyPlaceholderText = "Azure OpenAI API Key", _this36.keyHelpUrl = "https://learn.microsoft.com/en-us/answers/questions/1193991/how-to-get-the-value-of-openai-api-key", _this36.isTextInputDisabled = !1, _typeof(s == null ? void 0 : s.assistant) == "object") {
9239
9254
  var _ref25 = (p = (m = (f = e.directConnection) == null ? void 0 : f.azure) == null ? void 0 : m.openAI) == null ? void 0 : p.assistant,
9240
9255
  b = _ref25.function_handler,
9241
9256
  M = _ref25.files_tool_type;
@@ -9250,11 +9265,11 @@ var pt = /*#__PURE__*/function (_Ri2) {
9250
9265
  }));
9251
9266
  return _this36;
9252
9267
  }
9253
- _inherits(pt, _Ri2);
9254
- return _createClass(pt);
9268
+ _inherits(mt, _Ri2);
9269
+ return _createClass(mt);
9255
9270
  }(Ri);
9256
- pt.THREAD_RESOURCE = "threads", pt.NEW_ASSISTANT_RESOURCE = "assistants";
9257
- var as = pt;
9271
+ mt.THREAD_RESOURCE = "threads", mt.NEW_ASSISTANT_RESOURCE = "assistants";
9272
+ var as = mt;
9258
9273
  var Yo = /*#__PURE__*/function (_ws2) {
9259
9274
  function Yo(e) {
9260
9275
  _classCallCheck(this, Yo);
@@ -9402,11 +9417,11 @@ var On = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg height=\"1.4em\"
9402
9417
  }();
9403
9418
  re.INPUT_BUTTON_SVG_TEXT_CLASS = "input-button-svg-text", re.INPUT_BUTTON_INNER_TEXT_CLASS = "text-button", re.INPUT_BUTTON_SVG_CLASS = "input-button-svg";
9404
9419
  var Te = re;
9405
- var Gt = /*#__PURE__*/function () {
9406
- function Gt() {
9407
- _classCallCheck(this, Gt);
9420
+ var Vt = /*#__PURE__*/function () {
9421
+ function Vt() {
9422
+ _classCallCheck(this, Vt);
9408
9423
  }
9409
- return _createClass(Gt, null, [{
9424
+ return _createClass(Vt, null, [{
9410
9425
  key: "parseSVGTextElements",
9411
9426
  value: function parseSVGTextElements(e) {
9412
9427
  return {
@@ -9429,9 +9444,9 @@ var D = /*#__PURE__*/function () {
9429
9444
  value: function unsetAllCSS(e, t) {
9430
9445
  var r, o;
9431
9446
  t.container && I.unsetAllCSSMouseStates(e, t.container);
9432
- var _Gt$parseSVGTextEleme = Gt.parseSVGTextElements(Array.from(e.children)),
9433
- i = _Gt$parseSVGTextEleme.svg,
9434
- s = _Gt$parseSVGTextEleme.text;
9447
+ var _Vt$parseSVGTextEleme = Vt.parseSVGTextElements(Array.from(e.children)),
9448
+ i = _Vt$parseSVGTextEleme.svg,
9449
+ s = _Vt$parseSVGTextEleme.text;
9435
9450
  (r = t.svg) != null && r.styles && i && I.unsetAllCSSMouseStates(i, t.svg.styles), (o = t.text) != null && o.styles && s && I.unsetAllCSSMouseStates(s, t.text.styles);
9436
9451
  }
9437
9452
  }, {
@@ -9439,9 +9454,9 @@ var D = /*#__PURE__*/function () {
9439
9454
  value: function unsetActionCSS(e, t) {
9440
9455
  var r, o;
9441
9456
  t.container && I.unsetActivityCSSMouseStates(e, t.container);
9442
- var _Gt$parseSVGTextEleme2 = Gt.parseSVGTextElements(Array.from(e.children)),
9443
- i = _Gt$parseSVGTextEleme2.svg,
9444
- s = _Gt$parseSVGTextEleme2.text;
9457
+ var _Vt$parseSVGTextEleme2 = Vt.parseSVGTextElements(Array.from(e.children)),
9458
+ i = _Vt$parseSVGTextEleme2.svg,
9459
+ s = _Vt$parseSVGTextEleme2.text;
9445
9460
  (r = t.svg) != null && r.styles && i && I.unsetActivityCSSMouseStates(i, t.svg.styles), (o = t.text) != null && o.styles && s && I.unsetActivityCSSMouseStates(s, t.text.styles);
9446
9461
  }
9447
9462
  }, {
@@ -9449,9 +9464,9 @@ var D = /*#__PURE__*/function () {
9449
9464
  value: function setElementsCSS(e, t, i) {
9450
9465
  var o, a, l, c, d;
9451
9466
  Object.assign(e.style, (o = t.container) == null ? void 0 : o[i]);
9452
- var _Gt$parseSVGTextEleme3 = Gt.parseSVGTextElements(Array.from(e.children)),
9453
- s = _Gt$parseSVGTextEleme3.svg,
9454
- r = _Gt$parseSVGTextEleme3.text;
9467
+ var _Vt$parseSVGTextEleme3 = Vt.parseSVGTextElements(Array.from(e.children)),
9468
+ s = _Vt$parseSVGTextEleme3.svg,
9469
+ r = _Vt$parseSVGTextEleme3.text;
9455
9470
  s && Object.assign(s.style, (l = (a = t.svg) == null ? void 0 : a.styles) == null ? void 0 : l[i]), r && Object.assign(r.style, (d = (c = t.text) == null ? void 0 : c.styles) == null ? void 0 : d[i]);
9456
9471
  }
9457
9472
  }, {
@@ -9647,7 +9662,7 @@ ji.SESSION_STARTED = "sts-session-started", ji.SESSION_STOPPED = "sts-session-st
9647
9662
  var Li = ji;
9648
9663
  var Pn = "<?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=\"M5.92 24.096q0 1.088 0.928 1.728 0.512 0.288 1.088 0.288 0.448 0 0.896-0.224l16.16-8.064q0.48-0.256 0.8-0.736t0.288-1.088-0.288-1.056-0.8-0.736l-16.16-8.064q-0.448-0.224-0.896-0.224-0.544 0-1.088 0.288-0.928 0.608-0.928 1.728v16.16z\"></path>\n</svg>",
9649
9664
  ls = "<?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=\"M5.92 24.096q0 0.832 0.576 1.408t1.44 0.608h16.128q0.832 0 1.44-0.608t0.576-1.408v-16.16q0-0.832-0.576-1.44t-1.44-0.576h-16.128q-0.832 0-1.44 0.576t-0.576 1.44v16.16z\"></path>\n</svg>",
9650
- C = /*#__PURE__*/function (_V5) {
9665
+ C = /*#__PURE__*/function (_K5) {
9651
9666
  function C(e) {
9652
9667
  var _l$model;
9653
9668
  var _this38;
@@ -9669,7 +9684,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
9669
9684
  (_l$model = (l = _this38.rawBody).model) !== null && _l$model !== void 0 ? _l$model : l.model = "gpt-4o-realtime-preview-2024-12-17", _this38._avatarConfig = C.buildAvatarConfig(s), _this38._buttonsConfig = C.buildButtonsConfig(s), _this38._avatarEl = C.createAvatar(_this38._avatarConfig), _this38._containerEl = _this38.createContainer(), _this38._deepChat = e;
9670
9685
  return _this38;
9671
9686
  }
9672
- _inherits(C, _V5);
9687
+ _inherits(C, _K5);
9673
9688
  return _createClass(C, [{
9674
9689
  key: "setUpView",
9675
9690
  value:
@@ -10359,24 +10374,24 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
10359
10374
  N.removeAriaDisabled(e.elementRef), e.elementRef.classList.remove(C.UNAVAILABLE);
10360
10375
  }
10361
10376
  }]);
10362
- }(V);
10377
+ }(K);
10363
10378
  C.BUTTON_DEFAULT = "deep-chat-openai-realtime-button-default", C.BUTTON_LOADING = "deep-chat-openai-realtime-button-loading", C.MICROPHONE_ACTIVE = "deep-chat-openai-realtime-microphone-active", C.UNAVAILABLE = "deep-chat-openai-realtime-button-unavailable";
10364
10379
  var cs = C;
10365
- var mt = /*#__PURE__*/function (_V6) {
10366
- function mt(e) {
10380
+ var gt = /*#__PURE__*/function (_K6) {
10381
+ function gt(e) {
10367
10382
  var _o$model, _a$voice;
10368
10383
  var _this44;
10369
- _classCallCheck(this, mt);
10384
+ _classCallCheck(this, gt);
10370
10385
  var r, o, a;
10371
10386
  var t = JSON.parse(JSON.stringify(e.directConnection)),
10372
10387
  i = t == null ? void 0 : t.openAI;
10373
- _this44 = _callSuper(this, mt, [e, L.buildKeyVerificationDetails(), L.buildHeaders, i]), _this44.insertKeyPlaceholderText = "OpenAI API Key", _this44.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this44.url = "https://api.openai.com/v1/audio/speech", _this44.permittedErrorPrefixes = ["Invalid"], _this44.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Text To Speech</b></div>\n <p>Generate an audio file based on your text input.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/text-to-speech\">here</a> for more information.</p>";
10388
+ _this44 = _callSuper(this, gt, [e, L.buildKeyVerificationDetails(), L.buildHeaders, i]), _this44.insertKeyPlaceholderText = "OpenAI API Key", _this44.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this44.url = "https://api.openai.com/v1/audio/speech", _this44.permittedErrorPrefixes = ["Invalid"], _this44.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Text To Speech</b></div>\n <p>Generate an audio file based on your text input.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/text-to-speech\">here</a> for more information.</p>";
10374
10389
  var s = (r = t == null ? void 0 : t.openAI) == null ? void 0 : r.textToSpeech;
10375
- _typeof(s) == "object" && Object.assign(_this44.rawBody, s), (_o$model = (o = _this44.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model = mt.DEFAULT_MODEL, (_a$voice = (a = _this44.rawBody).voice) !== null && _a$voice !== void 0 ? _a$voice : a.voice = mt.DEFAULT_VOIDE, _this44.textInputPlaceholderText = "Insert text to generate audio", _this44.rawBody.response_format = "mp3";
10390
+ _typeof(s) == "object" && Object.assign(_this44.rawBody, s), (_o$model = (o = _this44.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model = gt.DEFAULT_MODEL, (_a$voice = (a = _this44.rawBody).voice) !== null && _a$voice !== void 0 ? _a$voice : a.voice = gt.DEFAULT_VOIDE, _this44.textInputPlaceholderText = "Insert text to generate audio", _this44.rawBody.response_format = "mp3";
10376
10391
  return _this44;
10377
10392
  }
10378
- _inherits(mt, _V6);
10379
- return _createClass(mt, [{
10393
+ _inherits(gt, _K6);
10394
+ return _createClass(gt, [{
10380
10395
  key: "preprocessBody",
10381
10396
  value: function preprocessBody(e, t) {
10382
10397
  var r, o;
@@ -10456,10 +10471,10 @@ var mt = /*#__PURE__*/function (_V6) {
10456
10471
  return extractResultData;
10457
10472
  }()
10458
10473
  }]);
10459
- }(V);
10460
- mt.DEFAULT_MODEL = "tts-1", mt.DEFAULT_VOIDE = "alloy";
10461
- var ds = mt;
10462
- var me = /*#__PURE__*/function (_V7) {
10474
+ }(K);
10475
+ gt.DEFAULT_MODEL = "tts-1", gt.DEFAULT_VOIDE = "alloy";
10476
+ var ds = gt;
10477
+ var me = /*#__PURE__*/function (_K7) {
10463
10478
  function me(e) {
10464
10479
  var _o$model2;
10465
10480
  var _this45;
@@ -10474,7 +10489,7 @@ var me = /*#__PURE__*/function (_V7) {
10474
10489
  _typeof(s) == "object" && (_this45.processConfig(s), me.cleanConfig(s), Object.assign(_this45.rawBody, s)), (_o$model2 = (o = _this45.rawBody).model) !== null && _o$model2 !== void 0 ? _o$model2 : o.model = me.DEFAULT_MODEL, _this45.rawBody.response_format = "json", _this45.canSendMessage = me.canSendFileMessage;
10475
10490
  return _this45;
10476
10491
  }
10477
- _inherits(me, _V7);
10492
+ _inherits(me, _K7);
10478
10493
  return _createClass(me, [{
10479
10494
  key: "processConfig",
10480
10495
  value: function processConfig(e) {
@@ -10569,7 +10584,7 @@ var me = /*#__PURE__*/function (_V7) {
10569
10584
  }), i;
10570
10585
  }
10571
10586
  }]);
10572
- }(V);
10587
+ }(K);
10573
10588
  me.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions", me.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations", me.DEFAULT_MODEL = "whisper-1";
10574
10589
  var hs = me;
10575
10590
  var fe = /*#__PURE__*/function () {
@@ -10673,7 +10688,7 @@ var fe = /*#__PURE__*/function () {
10673
10688
  }
10674
10689
  }]);
10675
10690
  }();
10676
- var Zo = /*#__PURE__*/function (_V8) {
10691
+ var Zo = /*#__PURE__*/function (_K8) {
10677
10692
  // prettier-ignore
10678
10693
  function Zo(e, t, i, s, r) {
10679
10694
  var _this46;
@@ -10683,9 +10698,9 @@ var Zo = /*#__PURE__*/function (_V8) {
10683
10698
  "https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this46.permittedErrorPrefixes = ["Access"];
10684
10699
  return _this46;
10685
10700
  }
10686
- _inherits(Zo, _V8);
10701
+ _inherits(Zo, _K8);
10687
10702
  return _createClass(Zo);
10688
- }(V);
10703
+ }(K);
10689
10704
  var Yt = /*#__PURE__*/function (_Zo) {
10690
10705
  function Yt(e) {
10691
10706
  var _a$language;
@@ -10849,11 +10864,11 @@ Yt.ENDPOINT_ERROR_MESSAGE =
10849
10864
  // eslint-disable-next-line max-len
10850
10865
  "Please define the azure endpoint. [More Information](https://deepchat.dev/docs/directConnection/Azure#Summarization)";
10851
10866
  var us = Yt;
10852
- var Vt = /*#__PURE__*/function () {
10853
- function Vt() {
10854
- _classCallCheck(this, Vt);
10867
+ var Kt = /*#__PURE__*/function () {
10868
+ function Kt() {
10869
+ _classCallCheck(this, Kt);
10855
10870
  }
10856
- return _createClass(Vt, null, [{
10871
+ return _createClass(Kt, null, [{
10857
10872
  key: "poll",
10858
10873
  value: function () {
10859
10874
  var _poll2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee103(e, t) {
@@ -10949,23 +10964,23 @@ var Vt = /*#__PURE__*/function () {
10949
10964
  return {
10950
10965
  url: "https://api.assemblyai.com/v2/upload",
10951
10966
  method: "POST",
10952
- handleVerificationResult: Vt.handleVerificationResult
10967
+ handleVerificationResult: Kt.handleVerificationResult
10953
10968
  };
10954
10969
  }
10955
10970
  }]);
10956
10971
  }();
10957
- var As = /*#__PURE__*/function (_V9) {
10972
+ var As = /*#__PURE__*/function (_K9) {
10958
10973
  function As(e) {
10959
10974
  var _this48;
10960
10975
  _classCallCheck(this, As);
10961
10976
  var i;
10962
10977
  var t = (i = e.directConnection) == null ? void 0 : i.assemblyAI;
10963
- _this48 = _callSuper(this, As, [e, Vt.buildKeyVerificationDetails(), Vt.buildHeaders, t, {
10978
+ _this48 = _callSuper(this, As, [e, Kt.buildKeyVerificationDetails(), Kt.buildHeaders, t, {
10964
10979
  audio: {}
10965
10980
  }]), _this48.insertKeyPlaceholderText = "AssemblyAI API Key", _this48.keyHelpUrl = "https://www.assemblyai.com/app/account", _this48.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>", _this48.url = "https://api.assemblyai.com/v2/upload", _this48.isTextInputDisabled = !0, _this48.textInputPlaceholderText = "Upload an audio file", _this48.permittedErrorPrefixes = ["Authentication", "Invalid"], _this48.canSendMessage = As.canFileSendMessage;
10966
10981
  return _this48;
10967
10982
  }
10968
- _inherits(As, _V9);
10983
+ _inherits(As, _K9);
10969
10984
  return _createClass(As, [{
10970
10985
  key: "callServiceAPI",
10971
10986
  value: function () {
@@ -11014,7 +11029,7 @@ var As = /*#__PURE__*/function (_V9) {
11014
11029
  case 2:
11015
11030
  t = (r = (s = this.connectSettings) == null ? void 0 : s.headers) == null ? void 0 : r.Authorization;
11016
11031
  _context105.next = 5;
11017
- return Vt.poll(t, e.upload_url);
11032
+ return Kt.poll(t, e.upload_url);
11018
11033
  case 5:
11019
11034
  _context105.t0 = _context105.sent.text;
11020
11035
  return _context105.abrupt("return", {
@@ -11037,8 +11052,8 @@ var As = /*#__PURE__*/function (_V9) {
11037
11052
  return !!(t != null && t[0]);
11038
11053
  }
11039
11054
  }]);
11040
- }(V);
11041
- var Nn = /*#__PURE__*/function (_V0) {
11055
+ }(K);
11056
+ var Nn = /*#__PURE__*/function (_K0) {
11042
11057
  // prettier-ignore
11043
11058
  function Nn(e, t, i, s, r) {
11044
11059
  var _this49;
@@ -11048,9 +11063,9 @@ var Nn = /*#__PURE__*/function (_V0) {
11048
11063
  "https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal";
11049
11064
  return _this49;
11050
11065
  }
11051
- _inherits(Nn, _V0);
11066
+ _inherits(Nn, _K0);
11052
11067
  return _createClass(Nn);
11053
- }(V);
11068
+ }(K);
11054
11069
  var Qe = /*#__PURE__*/function (_Nn) {
11055
11070
  // prettier-ignore
11056
11071
  function Qe(e) {
@@ -11240,7 +11255,7 @@ Ke.HELP_LINK =
11240
11255
  // eslint-disable-next-line max-len
11241
11256
  "Please define a region config property. [More Information](https://deepchat.dev/docs/directConnection/Azure#SpeechToText)";
11242
11257
  var ps = Ke;
11243
- var Qo = /*#__PURE__*/function (_V1) {
11258
+ var Qo = /*#__PURE__*/function (_K1) {
11244
11259
  // prettier-ignore
11245
11260
  function Qo(e) {
11246
11261
  var _this52;
@@ -11253,7 +11268,7 @@ var Qo = /*#__PURE__*/function (_V1) {
11253
11268
  "https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this52.url = "", _this52.url = "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=".concat(t.language || "es");
11254
11269
  return _this52;
11255
11270
  }
11256
- _inherits(Qo, _V1);
11271
+ _inherits(Qo, _K1);
11257
11272
  return _createClass(Qo, [{
11258
11273
  key: "preprocessBody",
11259
11274
  value: function preprocessBody(e) {
@@ -11318,30 +11333,30 @@ var Qo = /*#__PURE__*/function (_V1) {
11318
11333
  return extractResultData;
11319
11334
  }()
11320
11335
  }]);
11321
- }(V);
11322
- var bt = /*#__PURE__*/function (_V10) {
11336
+ }(K);
11337
+ var vt = /*#__PURE__*/function (_K10) {
11323
11338
  // prettier-ignore
11324
- function bt(e, t, i, s, r) {
11339
+ function vt(e, t, i, s, r) {
11325
11340
  var _this53$maxMessages, _p$model;
11326
11341
  var _this53;
11327
- _classCallCheck(this, bt);
11342
+ _classCallCheck(this, vt);
11328
11343
  var u, h, f, m, p;
11329
11344
  var o = JSON.parse(JSON.stringify(e.directConnection)),
11330
11345
  a = t || L.buildKeyVerificationDetails(),
11331
11346
  l = i || L.buildHeaders,
11332
11347
  c = s || o.openAI;
11333
- _this53 = _callSuper(this, bt, [e, a, l, c]), _this53.insertKeyPlaceholderText = "OpenAI API Key", _this53.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this53.url = "https://api.openai.com/v1/chat/completions", _this53.permittedErrorPrefixes = ["Incorrect"], _this53.asyncCallInProgress = !1, _this53._systemMessage = bt.generateSystemMessage("You are a helpful assistant.");
11348
+ _this53 = _callSuper(this, vt, [e, a, l, c]), _this53.insertKeyPlaceholderText = "OpenAI API Key", _this53.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this53.url = "https://api.openai.com/v1/chat/completions", _this53.permittedErrorPrefixes = ["Incorrect"], _this53.asyncCallInProgress = !1, _this53._systemMessage = vt.generateSystemMessage("You are a helpful assistant.");
11334
11349
  var d = r || ((u = o.openAI) == null ? void 0 : u.chat);
11335
11350
  if (_typeof(d) == "object") {
11336
- d.system_prompt && (_this53._systemMessage = bt.generateSystemMessage(d.system_prompt));
11351
+ d.system_prompt && (_this53._systemMessage = vt.generateSystemMessage(d.system_prompt));
11337
11352
  var g = (m = (f = (h = e.directConnection) == null ? void 0 : h.openAI) == null ? void 0 : f.chat) == null ? void 0 : m.function_handler;
11338
11353
  g && (_this53._functionHandler = g), _this53.cleanConfig(d), Object.assign(_this53.rawBody, d);
11339
11354
  }
11340
11355
  (_this53$maxMessages = _this53.maxMessages) !== null && _this53$maxMessages !== void 0 ? _this53$maxMessages : _this53.maxMessages = -1, (_p$model = (p = _this53.rawBody).model) !== null && _p$model !== void 0 ? _p$model : p.model = "gpt-4o";
11341
11356
  return _this53;
11342
11357
  }
11343
- _inherits(bt, _V10);
11344
- return _createClass(bt, [{
11358
+ _inherits(vt, _K10);
11359
+ return _createClass(vt, [{
11345
11360
  key: "cleanConfig",
11346
11361
  value: function cleanConfig(e) {
11347
11362
  delete e.system_prompt, delete e.function_handler;
@@ -11353,9 +11368,9 @@ var bt = /*#__PURE__*/function (_V10) {
11353
11368
  function preprocessBody(e, t) {
11354
11369
  var _i$max_tokens;
11355
11370
  var i = JSON.parse(JSON.stringify(e)),
11356
- s = vt.getCharacterLimitMessages(t, this.totalMessagesMaxCharLength ? this.totalMessagesMaxCharLength - this._systemMessage.content.length : -1).map(function (r) {
11371
+ s = yt.getCharacterLimitMessages(t, this.totalMessagesMaxCharLength ? this.totalMessagesMaxCharLength - this._systemMessage.content.length : -1).map(function (r) {
11357
11372
  return {
11358
- content: bt.getContent(r),
11373
+ content: vt.getContent(r),
11359
11374
  role: r.role === y.USER_ROLE ? "user" : "assistant"
11360
11375
  };
11361
11376
  });
@@ -11612,8 +11627,8 @@ var bt = /*#__PURE__*/function (_V10) {
11612
11627
  return e.text;
11613
11628
  }
11614
11629
  }]);
11615
- }(V);
11616
- var Ts = /*#__PURE__*/function (_bt) {
11630
+ }(K);
11631
+ var Ts = /*#__PURE__*/function (_vt) {
11617
11632
  function Ts(e) {
11618
11633
  var _this55;
11619
11634
  _classCallCheck(this, Ts);
@@ -11636,7 +11651,7 @@ var Ts = /*#__PURE__*/function (_bt) {
11636
11651
  }));
11637
11652
  return _this55;
11638
11653
  }
11639
- _inherits(Ts, _bt);
11654
+ _inherits(Ts, _vt);
11640
11655
  return _createClass(Ts, null, [{
11641
11656
  key: "buildURL",
11642
11657
  value: function buildURL(e) {
@@ -11646,8 +11661,8 @@ var Ts = /*#__PURE__*/function (_bt) {
11646
11661
  return "".concat(t, "/openai/deployments/").concat(i, "/completions?api-version=").concat(s);
11647
11662
  }
11648
11663
  }]);
11649
- }(bt);
11650
- var ge = /*#__PURE__*/function (_V11) {
11664
+ }(vt);
11665
+ var ge = /*#__PURE__*/function (_K11) {
11651
11666
  function ge(e) {
11652
11667
  var _this56;
11653
11668
  _classCallCheck(this, ge);
@@ -11676,7 +11691,7 @@ var ge = /*#__PURE__*/function (_V11) {
11676
11691
  _typeof(r) == "object" && Object.assign(_this56.rawBody, r), _this56.canSendMessage = ge.canFileSendMessage;
11677
11692
  return _this56;
11678
11693
  }
11679
- _inherits(ge, _V11);
11694
+ _inherits(ge, _K11);
11680
11695
  return _createClass(ge, [{
11681
11696
  key: "preprocessBody",
11682
11697
  value: function preprocessBody(e, t) {
@@ -11758,7 +11773,7 @@ var ge = /*#__PURE__*/function (_V11) {
11758
11773
  src: i.url,
11759
11774
  type: "image"
11760
11775
  } : {
11761
- src: "".concat(ci).concat(i.b64_json),
11776
+ src: "".concat(di).concat(i.b64_json),
11762
11777
  type: "image"
11763
11778
  };
11764
11779
  })
@@ -11796,7 +11811,7 @@ var ge = /*#__PURE__*/function (_V11) {
11796
11811
  }), s;
11797
11812
  }
11798
11813
  }]);
11799
- }(V);
11814
+ }(K);
11800
11815
  ge.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations", ge.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations", ge.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
11801
11816
  var ms = ge;
11802
11817
  var ea = /*#__PURE__*/function (_ws3) {
@@ -11913,7 +11928,7 @@ var Ii = /*#__PURE__*/function () {
11913
11928
  }
11914
11929
  }]);
11915
11930
  }();
11916
- var ta = /*#__PURE__*/function (_V12) {
11931
+ var ta = /*#__PURE__*/function (_K12) {
11917
11932
  function ta(e) {
11918
11933
  var _this58$maxMessages, _s$model;
11919
11934
  var _this58;
@@ -11923,7 +11938,7 @@ var ta = /*#__PURE__*/function (_V12) {
11923
11938
  _this58 = _callSuper(this, ta, [e, Ii.buildKeyVerificationDetails(), Ii.buildHeaders, i]), _this58.insertKeyPlaceholderText = "Mistral API Key", _this58.keyHelpUrl = "https://console.mistral.ai/api-keys/", _this58.url = "https://api.mistral.ai/v1/chat/completions", _this58.permittedErrorPrefixes = ["invalid"], i && (_this58.cleanConfig(i), Object.assign(_this58.rawBody, i)), (_this58$maxMessages = _this58.maxMessages) !== null && _this58$maxMessages !== void 0 ? _this58$maxMessages : _this58.maxMessages = -1, (_s$model = (s = _this58.rawBody).model) !== null && _s$model !== void 0 ? _s$model : s.model = "open-mistral-7b";
11924
11939
  return _this58;
11925
11940
  }
11926
- _inherits(ta, _V12);
11941
+ _inherits(ta, _K12);
11927
11942
  return _createClass(ta, [{
11928
11943
  key: "cleanConfig",
11929
11944
  value: function cleanConfig(e) {
@@ -11999,7 +12014,7 @@ var ta = /*#__PURE__*/function (_V12) {
11999
12014
  return extractResultData;
12000
12015
  }()
12001
12016
  }]);
12002
- }(V);
12017
+ }(K);
12003
12018
  var ia = /*#__PURE__*/function () {
12004
12019
  function ia() {
12005
12020
  _classCallCheck(this, ia);
@@ -12013,9 +12028,9 @@ var ia = /*#__PURE__*/function () {
12013
12028
  i = e.connect,
12014
12029
  s = e.demo,
12015
12030
  r = e.webModel;
12016
- if (r) return new si(e);
12031
+ if (r) return new ni(e);
12017
12032
  if (t) {
12018
- if (t.openAI) return t.openAI.images ? new ms(e) : t.openAI.speechToText ? new hs(e) : t.openAI.textToSpeech ? new ds(e) : t.openAI.assistant ? new xs(e) : t.openAI.realtime ? new cs(e) : new bt(e);
12033
+ if (t.openAI) return t.openAI.images ? new ms(e) : t.openAI.speechToText ? new hs(e) : t.openAI.textToSpeech ? new ds(e) : t.openAI.assistant ? new xs(e) : t.openAI.realtime ? new cs(e) : new vt(e);
12019
12034
  if (t.assemblyAI) return new As(e);
12020
12035
  if (t.cohere) return t.cohere.textGeneration ? new Xo(e) : t.cohere.summarization ? new Yo(e) : new ea(e);
12021
12036
  if (t.huggingFace) return t.huggingFace.textGeneration ? new Go(e) : t.huggingFace.summarization ? new Ko(e) : t.huggingFace.translation ? new $o(e) : t.huggingFace.fillMask ? new Jo(e) : t.huggingFace.questionAnswer ? new Vo(e) : t.huggingFace.audioSpeechRecognition ? new zo(e) : t.huggingFace.audioClassification ? new Ho(e) : t.huggingFace.imageClassification ? new qo(e) : new Wo(e);
@@ -12104,11 +12119,11 @@ var Oi = /*#__PURE__*/function () {
12104
12119
  }]);
12105
12120
  }();
12106
12121
  var sa = "<?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>",
12107
- $ = /*#__PURE__*/function () {
12108
- function $() {
12109
- _classCallCheck(this, $);
12122
+ J = /*#__PURE__*/function () {
12123
+ function J() {
12124
+ _classCallCheck(this, J);
12110
12125
  }
12111
- return _createClass($, null, [{
12126
+ return _createClass(J, null, [{
12112
12127
  key: "createImage",
12113
12128
  value: function createImage(e, t, i) {
12114
12129
  var s = new Image();
@@ -12118,9 +12133,9 @@ var sa = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
12118
12133
  }, {
12119
12134
  key: "createImageMessage",
12120
12135
  value: function createImageMessage(e, t, i, s) {
12121
- var r = $.createImage(t, e.elementRef, !s && !e.focusMode),
12136
+ var r = J.createImage(t, e.elementRef, !s && !e.focusMode),
12122
12137
  o = e.createNewMessageElement("", i);
12123
- return o.bubbleElement.appendChild(r), o.bubbleElement.classList.add($.IMAGE_BUBBLE_CLASS), {
12138
+ return o.bubbleElement.appendChild(r), o.bubbleElement.classList.add(J.IMAGE_BUBBLE_CLASS), {
12124
12139
  type: "image",
12125
12140
  elements: o
12126
12141
  };
@@ -12134,9 +12149,9 @@ var sa = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
12134
12149
  }, {
12135
12150
  key: "createNewAudioMessage",
12136
12151
  value: function createNewAudioMessage(e, t, i, s) {
12137
- var r = $.createAudioElement(t, i),
12152
+ var r = J.createAudioElement(t, i),
12138
12153
  o = e.createMessageElementsOnOrientation("", i, s);
12139
- return o.bubbleElement.appendChild(r), o.bubbleElement.classList.add($.AUDIO_BUBBLE_CLASS), {
12154
+ return o.bubbleElement.appendChild(r), o.bubbleElement.classList.add(J.AUDIO_BUBBLE_CLASS), {
12140
12155
  type: "audio",
12141
12156
  elements: o
12142
12157
  };
@@ -12157,8 +12172,8 @@ var sa = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
12157
12172
  key: "createNewAnyFileMessage",
12158
12173
  value: function createNewAnyFileMessage(e, t, i, s) {
12159
12174
  var r = e.createMessageElementsOnOrientation("", i, s),
12160
- o = $.createAnyFile(t);
12161
- return r.bubbleElement.classList.add($.ANY_FILE_BUBBLE_CLASS), r.bubbleElement.appendChild(o), {
12175
+ o = J.createAnyFile(t);
12176
+ return r.bubbleElement.classList.add(J.ANY_FILE_BUBBLE_CLASS), r.bubbleElement.appendChild(o), {
12162
12177
  type: "file",
12163
12178
  elements: r
12164
12179
  };
@@ -12168,14 +12183,14 @@ var sa = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
12168
12183
  value: function createMessages(e, t, i) {
12169
12184
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
12170
12185
  return t.map(function (r) {
12171
- return r.ref && (r = q.removeFileRef(r)), q.isAudioFile(r) ? $.createNewAudioMessage(e, r, i, s) : q.isImageFile(r) ? $.createImageMessage(e, r, i, s) : $.createNewAnyFileMessage(e, r, i, s);
12186
+ return r.ref && (r = q.removeFileRef(r)), q.isAudioFile(r) ? J.createNewAudioMessage(e, r, i, s) : q.isImageFile(r) ? J.createImageMessage(e, r, i, s) : J.createNewAnyFileMessage(e, r, i, s);
12172
12187
  });
12173
12188
  }
12174
12189
  // no overwrite previous message logic as it is complex to track which files are to be overwritten
12175
12190
  }, {
12176
12191
  key: "addMessages",
12177
12192
  value: function addMessages(e, t, i, s) {
12178
- $.createMessages(e, t, i, s).forEach(function (_ref32) {
12193
+ J.createMessages(e, t, i, s).forEach(function (_ref32) {
12179
12194
  var o = _ref32.type,
12180
12195
  a = _ref32.elements;
12181
12196
  q.addMessage(e, a, o, i, s);
@@ -12183,8 +12198,8 @@ var sa = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
12183
12198
  }
12184
12199
  }]);
12185
12200
  }();
12186
- $.IMAGE_BUBBLE_CLASS = "image-message", $.AUDIO_BUBBLE_CLASS = "audio-message", $.ANY_FILE_BUBBLE_CLASS = "any-file-message";
12187
- var Pi = $;
12201
+ J.IMAGE_BUBBLE_CLASS = "image-message", J.AUDIO_BUBBLE_CLASS = "audio-message", J.ANY_FILE_BUBBLE_CLASS = "any-file-message";
12202
+ var Pi = J;
12188
12203
  var le = /*#__PURE__*/function () {
12189
12204
  function le() {
12190
12205
  _classCallCheck(this, le);
@@ -12317,19 +12332,19 @@ var de = /*#__PURE__*/function (_he) {
12317
12332
  var s = t.permittedErrorPrefixes,
12318
12333
  r = t.introPanelMarkUp,
12319
12334
  o = t.demo;
12320
- _this59._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this59._onClearMessages = yi.onClearMessages.bind(_this59, e), _this59._onError = yi.onError.bind(_this59, e), _this59._isLoadingMessageAllowed = de.getDefaultDisplayLoadingMessage(e, t), _typeof(e.displayLoadingBubble) == "object" && e.displayLoadingBubble.toggle && (e.displayLoadingBubble.toggle = _this59.setLoadingToggle.bind(_this59)), _this59._permittedErrorPrefixes = s, _this59.addSetupMessageIfNeeded(e, t) || _this59.populateIntroPanel(i, r, e.introPanelStyle), o && _this59.prepareDemo(te.processDemo(o), e.loadHistory), _this59.addIntroductoryMessages(e, t), new ii(e, _this59, t), _this59._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
12335
+ _this59._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this59._onClearMessages = ii.onClearMessages.bind(_this59, e), _this59._onError = ii.onError.bind(_this59, e), _this59._isLoadingMessageAllowed = de.getDefaultDisplayLoadingMessage(e, t), _typeof(e.displayLoadingBubble) == "object" && e.displayLoadingBubble.toggle && (e.displayLoadingBubble.toggle = _this59.setLoadingToggle.bind(_this59)), _this59._permittedErrorPrefixes = s, _this59.addSetupMessageIfNeeded(e, t) || _this59.populateIntroPanel(i, r, e.introPanelStyle), o && _this59.prepareDemo(te.processDemo(o), e.loadHistory), _this59.addIntroductoryMessages(e, t), new si(e, _this59, t), _this59._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
12321
12336
  return y.deepCloneMessagesWithReferences(_this59.messageToElements.map(function (_ref35) {
12322
12337
  var _ref36 = _slicedToArray(_ref35, 1),
12323
12338
  c = _ref36[0];
12324
12339
  return c;
12325
12340
  }));
12326
- }, e.clearMessages = _this59.clearMessages.bind(_this59, t), e.refreshMessages = _this59.refreshTextMessages.bind(_this59, e.remarkable), e.scrollToBottom = G.scrollToBottom.bind(_this59, _this59.elementRef), e.addMessage = function (c, d) {
12341
+ }, e.clearMessages = _this59.clearMessages.bind(_this59, t), e.refreshMessages = _this59.refreshTextMessages.bind(_this59, e.remarkable), e.scrollToBottom = V.scrollToBottom.bind(_this59, _this59.elementRef), e.addMessage = function (c, d) {
12327
12342
  _this59.addAnyMessage(_objectSpread(_objectSpread({}, c), {}, {
12328
12343
  sendUpdate: !!d
12329
12344
  }), !d);
12330
12345
  }, e.updateMessage = function (c, d) {
12331
12346
  return le.update(_this59, c, d);
12332
- }, t.isWebModel() && t.setUpMessages(_this59), e.textToSpeech && gt.processConfig(e.textToSpeech, function (c) {
12347
+ }, t.isWebModel() && t.setUpMessages(_this59), e.textToSpeech && bt.processConfig(e.textToSpeech, function (c) {
12333
12348
  _this59.textToSpeech = c;
12334
12349
  });
12335
12350
  return _this59;
@@ -12405,7 +12420,7 @@ var de = /*#__PURE__*/function (_he) {
12405
12420
  value: function tryAddTextMessage(e, t, i) {
12406
12421
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
12407
12422
  var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
12408
- !i.ignoreText && e.text !== void 0 && i.text !== null && (this.addNewTextMessage(e.text, e.role, t, r), !s && this.textToSpeech && e.role !== y.USER_ROLE && gt.speak(e.text, this.textToSpeech));
12423
+ !i.ignoreText && e.text !== void 0 && i.text !== null && (this.addNewTextMessage(e.text, e.role, t, r), !s && this.textToSpeech && e.role !== y.USER_ROLE && bt.speak(e.text, this.textToSpeech));
12409
12424
  }
12410
12425
  }, {
12411
12426
  key: "tryAddFileMessages",
@@ -12474,9 +12489,9 @@ var de = /*#__PURE__*/function (_he) {
12474
12489
  var o = r.bubbleElement,
12475
12490
  a = r.outerContainer;
12476
12491
  o.classList.add(y.ERROR_MESSAGE_TEXT_CLASS), this.renderText(o, s);
12477
- var l = J.extractParticularSharedStyles(["fontSize", "fontFamily"], (h = this.messageStyles) == null ? void 0 : h["default"]);
12478
- J.applyCustomStylesToElements(r, !1, l), J.applyCustomStylesToElements(r, !1, (f = this.messageStyles) == null ? void 0 : f.error), i || this.appendOuterContainerElemet(a), this.textToSpeech && gt.speak(s, this.textToSpeech), (m = this._onError) == null || m.call(this, s), setTimeout(function () {
12479
- return G.scrollToBottom(_this61.elementRef);
12492
+ var l = X.extractParticularSharedStyles(["fontSize", "fontFamily"], (h = this.messageStyles) == null ? void 0 : h["default"]);
12493
+ X.applyCustomStylesToElements(r, !1, l), X.applyCustomStylesToElements(r, !1, (f = this.messageStyles) == null ? void 0 : f.error), i || this.appendOuterContainerElemet(a), this.textToSpeech && bt.speak(s, this.textToSpeech), (m = this._onError) == null || m.call(this, s), setTimeout(function () {
12494
+ return V.scrollToBottom(_this61.elementRef);
12480
12495
  });
12481
12496
  }
12482
12497
  }, {
@@ -12519,12 +12534,12 @@ var de = /*#__PURE__*/function (_he) {
12519
12534
  if (he.isLoadingMessage(t) || !e && !this._isLoadingMessageAllowed) return;
12520
12535
  var i = (a = (o = (r = this.messageStyles) == null ? void 0 : r.loading) == null ? void 0 : o.message) == null ? void 0 : a.html,
12521
12536
  s = i ? xe.createElements(this, i, y.AI_ROLE, !1) : this.addDefaultLoadingMessage();
12522
- this.appendOuterContainerElemet(s.outerContainer), s.bubbleElement.classList.add(De.BUBBLE_CLASS), this.applyCustomStyles(s, y.AI_ROLE, !1, (d = (c = (l = this.messageStyles) == null ? void 0 : l.loading) == null ? void 0 : c.message) == null ? void 0 : d.styles), this.focusMode || G.scrollToBottom(this.elementRef);
12537
+ this.appendOuterContainerElemet(s.outerContainer), s.bubbleElement.classList.add(De.BUBBLE_CLASS), this.applyCustomStyles(s, y.AI_ROLE, !1, (d = (c = (l = this.messageStyles) == null ? void 0 : l.loading) == null ? void 0 : c.message) == null ? void 0 : d.styles), this.focusMode || V.scrollToBottom(this.elementRef);
12523
12538
  }
12524
12539
  }, {
12525
12540
  key: "populateIntroPanel",
12526
12541
  value: function populateIntroPanel(e, t, i) {
12527
- (e || t) && (this._introPanel = new Oi(e, t, i), this._introPanel._elementRef && (X.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
12542
+ (e || t) && (this._introPanel = new Oi(e, t, i), this._introPanel._elementRef && (G.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
12528
12543
  }
12529
12544
  }, {
12530
12545
  key: "addMultipleFiles",
@@ -12646,11 +12661,11 @@ var j = /*#__PURE__*/function () {
12646
12661
  }();
12647
12662
  j.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS = "text-input-container-left-adjustment", j.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS = "text-input-container-right-adjustment", j.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS = "text-input-container-left-small-adjustment", j.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS = "text-input-container-right-small-adjustment";
12648
12663
  var bs = j;
12649
- var yt = /*#__PURE__*/function () {
12650
- function yt() {
12651
- _classCallCheck(this, yt);
12664
+ var Et = /*#__PURE__*/function () {
12665
+ function Et() {
12666
+ _classCallCheck(this, Et);
12652
12667
  }
12653
- return _createClass(yt, null, [{
12668
+ return _createClass(Et, null, [{
12654
12669
  key: "create",
12655
12670
  value: function create() {
12656
12671
  return Array.from({
@@ -12674,7 +12689,7 @@ var yt = /*#__PURE__*/function () {
12674
12689
  key: "addButton",
12675
12690
  value: function addButton(e, t, i) {
12676
12691
  t.classList.add(i);
12677
- var s = yt.getContainerIndex(i);
12692
+ var s = Et.getContainerIndex(i);
12678
12693
  e[s].appendChild(t), s === 3 && t.classList.add("outside-right");
12679
12694
  }
12680
12695
  }]);
@@ -12805,7 +12820,7 @@ var O = /*#__PURE__*/function (_ct2) {
12805
12820
  key: "resetDropupItem",
12806
12821
  value: function resetDropupItem(e) {
12807
12822
  var i, s, r;
12808
- this.elementRef = X.replaceElementWithNewClone(this.elementRef, this._originalElementRef), this.elementRef.innerHTML = "", ((i = e == null ? void 0 : e.svg) == null ? void 0 : i.content) === "" || this.elementRef.appendChild(Se.createItemIcon(this.svg, (s = this._menuStyles) == null ? void 0 : s.iconContainer)), this.elementRef.appendChild(Se.createItemText(this.dropupText, (r = this._menuStyles) == null ? void 0 : r.text));
12823
+ this.elementRef = G.replaceElementWithNewClone(this.elementRef, this._originalElementRef), this.elementRef.innerHTML = "", ((i = e == null ? void 0 : e.svg) == null ? void 0 : i.content) === "" || this.elementRef.appendChild(Se.createItemIcon(this.svg, (s = this._menuStyles) == null ? void 0 : s.iconContainer)), this.elementRef.appendChild(Se.createItemText(this.dropupText, (r = this._menuStyles) == null ? void 0 : r.text));
12809
12824
  }
12810
12825
  }, {
12811
12826
  key: "assignDropupItemStyle",
@@ -12847,12 +12862,12 @@ var O = /*#__PURE__*/function (_ct2) {
12847
12862
  var o = (c = (l = s == null ? void 0 : s[t]) == null ? void 0 : l.svg) == null ? void 0 : c.content,
12848
12863
  a = (u = (d = s == null ? void 0 : s[t]) == null ? void 0 : d.text) == null ? void 0 : u.content;
12849
12864
  if (o === void 0 || a === void 0) {
12850
- var _Gt$parseSVGTextEleme4 = Gt.parseSVGTextElements(i),
12851
- h = _Gt$parseSVGTextEleme4.svg,
12852
- f = _Gt$parseSVGTextEleme4.text,
12853
- _Gt$parseSVGTextEleme5 = Gt.parseSVGTextElements(r),
12854
- m = _Gt$parseSVGTextEleme5.svg,
12855
- p = _Gt$parseSVGTextEleme5.text,
12865
+ var _Vt$parseSVGTextEleme4 = Vt.parseSVGTextElements(i),
12866
+ h = _Vt$parseSVGTextEleme4.svg,
12867
+ f = _Vt$parseSVGTextEleme4.text,
12868
+ _Vt$parseSVGTextEleme5 = Vt.parseSVGTextElements(r),
12869
+ m = _Vt$parseSVGTextEleme5.svg,
12870
+ p = _Vt$parseSVGTextEleme5.text,
12856
12871
  g = [];
12857
12872
  O.addToInnerElements(g, o, h, m), O.addToInnerElements(g, a, f, p), r = g;
12858
12873
  }
@@ -12887,15 +12902,15 @@ var O = /*#__PURE__*/function (_ct2) {
12887
12902
  O.INDICATOR_PREFIX = "custom", O.BUTTON_CLASS = "custom-button", O.DISABLED_CONTAINER_CLASS = "custom-button-container-disabled", O.DEFAULT_CONTAINER_CLASS = "custom-button-container-default", O.ACTIVE_CONTAINER_CLASS = "custom-button-container-active";
12888
12903
  var st = O;
12889
12904
  var oa = "<?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>";
12890
- var ni = /*#__PURE__*/function () {
12891
- function ni() {
12892
- _classCallCheck(this, ni);
12905
+ var ri = /*#__PURE__*/function () {
12906
+ function ri() {
12907
+ _classCallCheck(this, ri);
12893
12908
  }
12894
- return _createClass(ni, null, [{
12909
+ return _createClass(ri, null, [{
12895
12910
  key: "focusItemWhenOnEdge",
12896
12911
  value: function focusItemWhenOnEdge(e, t) {
12897
12912
  var i = t ? e.children[0] : e.children[e.children.length - 1];
12898
- ni.focusSiblingItem(i, e, t, !0);
12913
+ ri.focusSiblingItem(i, e, t, !0);
12899
12914
  }
12900
12915
  // isEdgeItem means is it a start or end item
12901
12916
  // prettier-ignore
@@ -12904,7 +12919,7 @@ var ni = /*#__PURE__*/function () {
12904
12919
  value: function focusSiblingItem(e, t, i) {
12905
12920
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
12906
12921
  var r = s ? e : e[i ? "nextSibling" : "previousSibling"];
12907
- r ? (e.dispatchEvent(new MouseEvent("mouseleave")), r.dispatchEvent(new MouseEvent("mouseenter"))) : (e.dispatchEvent(new MouseEvent("mouseleave")), ni.focusItemWhenOnEdge(t, i));
12922
+ r ? (e.dispatchEvent(new MouseEvent("mouseleave")), r.dispatchEvent(new MouseEvent("mouseenter"))) : (e.dispatchEvent(new MouseEvent("mouseleave")), ri.focusItemWhenOnEdge(t, i));
12908
12923
  }
12909
12924
  }]);
12910
12925
  }();
@@ -12955,7 +12970,7 @@ var Cs = /*#__PURE__*/function () {
12955
12970
  key: "windowKeyDown",
12956
12971
  value: function windowKeyDown(e, t) {
12957
12972
  var i, s, r;
12958
- !e.isConnected && this.keyDownEvent ? window.removeEventListener("keydown", this.keyDownEvent) : this._isOpen && (t.key === U.ESCAPE ? (this.close(), (i = this.highlightedItem) == null || i.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === U.ENTER ? ((s = this.highlightedItem) == null || s.click(), (r = this.highlightedItem) == null || r.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === U.ARROW_DOWN ? ni.focusSiblingItem(this.highlightedItem || this.elementRef.children[this.elementRef.children.length - 1], this.elementRef, !0) : t.key === U.ARROW_UP && ni.focusSiblingItem(this.highlightedItem || this.elementRef.children[0], this.elementRef, !1));
12973
+ !e.isConnected && this.keyDownEvent ? window.removeEventListener("keydown", this.keyDownEvent) : this._isOpen && (t.key === U.ESCAPE ? (this.close(), (i = this.highlightedItem) == null || i.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === U.ENTER ? ((s = this.highlightedItem) == null || s.click(), (r = this.highlightedItem) == null || r.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === U.ARROW_DOWN ? ri.focusSiblingItem(this.highlightedItem || this.elementRef.children[this.elementRef.children.length - 1], this.elementRef, !0) : t.key === U.ARROW_UP && ri.focusSiblingItem(this.highlightedItem || this.elementRef.children[0], this.elementRef, !1));
12959
12974
  }
12960
12975
  }], [{
12961
12976
  key: "createElement",
@@ -13026,11 +13041,11 @@ var et = /*#__PURE__*/function (_ct3) {
13026
13041
  }(ct);
13027
13042
  et.BUTTON_ICON_CLASS = "dropup-button";
13028
13043
  var Ni = et;
13029
- var W = /*#__PURE__*/function () {
13030
- function W() {
13031
- _classCallCheck(this, W);
13044
+ var $ = /*#__PURE__*/function () {
13045
+ function $() {
13046
+ _classCallCheck(this, $);
13032
13047
  }
13033
- return _createClass(W, null, [{
13048
+ return _createClass($, null, [{
13034
13049
  key: "addToDropup",
13035
13050
  value:
13036
13051
  // prettier-ignore
@@ -13047,7 +13062,7 @@ var W = /*#__PURE__*/function () {
13047
13062
  return r.addItem(a);
13048
13063
  });
13049
13064
  var o = Ni.getPosition(t, s);
13050
- yt.addButton(e, r.buttonContainer, o), t[o].push({});
13065
+ Et.addButton(e, r.buttonContainer, o), t[o].push({});
13051
13066
  }
13052
13067
  }, {
13053
13068
  key: "addToSideContainer",
@@ -13055,7 +13070,7 @@ var W = /*#__PURE__*/function () {
13055
13070
  ["inside-left", "inside-right", "outside-left", "outside-right"].forEach(function (s) {
13056
13071
  var r = s;
13057
13072
  t[r].forEach(function (o) {
13058
- yt.addButton(e, o.button.elementRef, r);
13073
+ Et.addButton(e, o.button.elementRef, r);
13059
13074
  });
13060
13075
  });
13061
13076
  }
@@ -13082,12 +13097,12 @@ var W = /*#__PURE__*/function () {
13082
13097
  }, {
13083
13098
  key: "generatePositionToButtons",
13084
13099
  value: function generatePositionToButtons(e) {
13085
- var t = W.createPositionsToButtonsObj();
13100
+ var t = $.createPositionsToButtonsObj();
13086
13101
  Object.keys(e).forEach(function (s) {
13087
13102
  var o;
13088
13103
  var r = (o = e[s]) == null ? void 0 : o.button.position;
13089
- r && W.setPosition(e, s, t[r]);
13090
- }), t["inside-right"].length === 0 && e.submit && W.setPosition(e, "submit", t["inside-right"]), t["outside-right"].length === 0 && (e.submit ? W.setPosition(e, "submit", t["outside-right"]) : e.microphone ? W.setPosition(e, "microphone", t["outside-right"]) : e.camera ? W.setPosition(e, "camera", t["outside-right"]) : e["".concat(st.INDICATOR_PREFIX, "1")] && W.setPosition(e, "".concat(st.INDICATOR_PREFIX, "1"), t["outside-right"])), e.submit && W.setPosition(e, "submit", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]), e.microphone && W.setPosition(e, "microphone", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]);
13104
+ r && $.setPosition(e, s, t[r]);
13105
+ }), t["inside-right"].length === 0 && e.submit && $.setPosition(e, "submit", t["inside-right"]), t["outside-right"].length === 0 && (e.submit ? $.setPosition(e, "submit", t["outside-right"]) : e.microphone ? $.setPosition(e, "microphone", t["outside-right"]) : e.camera ? $.setPosition(e, "camera", t["outside-right"]) : e["".concat(st.INDICATOR_PREFIX, "1")] && $.setPosition(e, "".concat(st.INDICATOR_PREFIX, "1"), t["outside-right"])), e.submit && $.setPosition(e, "submit", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]), e.microphone && $.setPosition(e, "microphone", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]);
13091
13106
  var i = Object.keys(e);
13092
13107
  return i.length > 1 || t["dropup-menu"].length > 0 ? (Ys.forEach(function (s) {
13093
13108
  e[s] && t["dropup-menu"].push(_objectSpread(_objectSpread({}, e[s]), {}, {
@@ -13098,14 +13113,14 @@ var W = /*#__PURE__*/function () {
13098
13113
  r.startsWith(st.INDICATOR_PREFIX) && e[r] && t["dropup-menu"].push(_objectSpread(_objectSpread({}, e[r]), {}, {
13099
13114
  customType: r
13100
13115
  }));
13101
- })) : i.length === 1 && W.setPosition(e, i[0], t["outside-right"].length === 0 ? t["outside-right"] : t["outside-left"]), t;
13116
+ })) : i.length === 1 && $.setPosition(e, i[0], t["outside-right"].length === 0 ? t["outside-right"] : t["outside-left"]), t;
13102
13117
  }
13103
13118
  // prettier-ignore
13104
13119
  }, {
13105
13120
  key: "addButtons",
13106
13121
  value: function addButtons(e, t, i, s) {
13107
- var r = W.generatePositionToButtons(t);
13108
- return W.addToSideContainer(e, r), r["dropup-menu"].length > 0 && W.addToDropup(e, r, i, s), r;
13122
+ var r = $.generatePositionToButtons(t);
13123
+ return $.addToSideContainer(e, r), r["dropup-menu"].length > 0 && $.addToDropup(e, r, i, s), r;
13109
13124
  }
13110
13125
  }]);
13111
13126
  }();
@@ -13201,17 +13216,17 @@ var Gi = /*#__PURE__*/function (_ct4) {
13201
13216
  function ua(n) {
13202
13217
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n["default"] : n;
13203
13218
  }
13204
- var pi = {},
13205
- Et = {},
13219
+ var mi = {},
13206
13220
  St = {},
13207
13221
  _t = {},
13208
13222
  xt = {},
13223
+ wt = {},
13209
13224
  Zs;
13210
13225
  function Vi() {
13211
- if (Zs) return xt;
13212
- Zs = 1, Object.defineProperty(xt, "__esModule", {
13226
+ if (Zs) return wt;
13227
+ Zs = 1, Object.defineProperty(wt, "__esModule", {
13213
13228
  value: !0
13214
- }), xt.Text = void 0;
13229
+ }), wt.Text = void 0;
13215
13230
  var n = /*#__PURE__*/function () {
13216
13231
  function n() {
13217
13232
  _classCallCheck(this, n);
@@ -13240,14 +13255,14 @@ function Vi() {
13240
13255
  }
13241
13256
  }]);
13242
13257
  }();
13243
- return xt.Text = n, n.FIRST_CHAR_REGEX = /\S/, n.DOUBLE_LINE = /\n\n/g, n.ONE_LINE = /\n/g, xt;
13258
+ return wt.Text = n, n.FIRST_CHAR_REGEX = /\S/, n.DOUBLE_LINE = /\n\n/g, n.ONE_LINE = /\n/g, wt;
13244
13259
  }
13245
13260
  var Qs;
13246
13261
  function Dn() {
13247
- if (Qs) return _t;
13248
- Qs = 1, Object.defineProperty(_t, "__esModule", {
13262
+ if (Qs) return xt;
13263
+ Qs = 1, Object.defineProperty(xt, "__esModule", {
13249
13264
  value: !0
13250
- }), _t.Translate = void 0;
13265
+ }), xt.Translate = void 0;
13251
13266
  var n = Vi();
13252
13267
  var e = /*#__PURE__*/function () {
13253
13268
  function e() {
@@ -13262,14 +13277,14 @@ function Dn() {
13262
13277
  }
13263
13278
  }]);
13264
13279
  }();
13265
- return _t.Translate = e, _t;
13280
+ return xt.Translate = e, xt;
13266
13281
  }
13267
13282
  var en;
13268
13283
  function fa() {
13269
- if (en) return St;
13270
- en = 1, Object.defineProperty(St, "__esModule", {
13284
+ if (en) return _t;
13285
+ en = 1, Object.defineProperty(_t, "__esModule", {
13271
13286
  value: !0
13272
- }), St.WebSpeechTranscript = void 0;
13287
+ }), _t.WebSpeechTranscript = void 0;
13273
13288
  var n = Dn();
13274
13289
  var e = /*#__PURE__*/function () {
13275
13290
  function e() {
@@ -13306,30 +13321,30 @@ function fa() {
13306
13321
  }
13307
13322
  }]);
13308
13323
  }();
13309
- return St.WebSpeechTranscript = e, St;
13324
+ return _t.WebSpeechTranscript = e, _t;
13310
13325
  }
13311
- var wt = {},
13326
+ var At = {},
13312
13327
  tn;
13313
13328
  function Rs() {
13314
- if (tn) return wt;
13315
- tn = 1, Object.defineProperty(wt, "__esModule", {
13329
+ if (tn) return At;
13330
+ tn = 1, Object.defineProperty(At, "__esModule", {
13316
13331
  value: !0
13317
- }), wt.Browser = void 0;
13332
+ }), At.Browser = void 0;
13318
13333
  var n = /*#__PURE__*/_createClass(function n() {
13319
13334
  _classCallCheck(this, n);
13320
13335
  });
13321
- return wt.Browser = n, n.IS_SAFARI = function () {
13336
+ return At.Browser = n, n.IS_SAFARI = function () {
13322
13337
  return n._IS_SAFARI === void 0 && (n._IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), n._IS_SAFARI;
13323
- }, wt;
13338
+ }, At;
13324
13339
  }
13325
- var At = {},
13326
- Tt = {},
13340
+ var Tt = {},
13341
+ Ct = {},
13327
13342
  sn;
13328
13343
  function pa() {
13329
- if (sn) return Tt;
13330
- sn = 1, Object.defineProperty(Tt, "__esModule", {
13344
+ if (sn) return Ct;
13345
+ sn = 1, Object.defineProperty(Ct, "__esModule", {
13331
13346
  value: !0
13332
- }), Tt.EventListeners = void 0;
13347
+ }), Ct.EventListeners = void 0;
13333
13348
  var n = /*#__PURE__*/function () {
13334
13349
  function n() {
13335
13350
  _classCallCheck(this, n);
@@ -13372,15 +13387,15 @@ function pa() {
13372
13387
  }
13373
13388
  }]);
13374
13389
  }();
13375
- return Tt.EventListeners = n, n.KEY_DOWN_TIMEOUT = null, Tt;
13390
+ return Ct.EventListeners = n, n.KEY_DOWN_TIMEOUT = null, Ct;
13376
13391
  }
13377
- var Ct = {},
13392
+ var Rt = {},
13378
13393
  nn;
13379
13394
  function ma() {
13380
- if (nn) return Ct;
13381
- nn = 1, Object.defineProperty(Ct, "__esModule", {
13395
+ if (nn) return Rt;
13396
+ nn = 1, Object.defineProperty(Rt, "__esModule", {
13382
13397
  value: !0
13383
- }), Ct.PreResultUtils = void 0;
13398
+ }), Rt.PreResultUtils = void 0;
13384
13399
  var n = /*#__PURE__*/function () {
13385
13400
  function n() {
13386
13401
  _classCallCheck(this, n);
@@ -13395,16 +13410,16 @@ function ma() {
13395
13410
  }
13396
13411
  }]);
13397
13412
  }();
13398
- return Ct.PreResultUtils = n, Ct;
13413
+ return Rt.PreResultUtils = n, Rt;
13399
13414
  }
13400
- var Rt = {},
13401
- Mt = {},
13415
+ var Mt = {},
13416
+ kt = {},
13402
13417
  rn;
13403
13418
  function Bn() {
13404
- if (rn) return Mt;
13405
- rn = 1, Object.defineProperty(Mt, "__esModule", {
13419
+ if (rn) return kt;
13420
+ rn = 1, Object.defineProperty(kt, "__esModule", {
13406
13421
  value: !0
13407
- }), Mt.AutoScroll = void 0;
13422
+ }), kt.AutoScroll = void 0;
13408
13423
  var n = /*#__PURE__*/function () {
13409
13424
  function n() {
13410
13425
  _classCallCheck(this, n);
@@ -13440,15 +13455,15 @@ function Bn() {
13440
13455
  }
13441
13456
  }]);
13442
13457
  }();
13443
- return Mt.AutoScroll = n, Mt;
13458
+ return kt.AutoScroll = n, kt;
13444
13459
  }
13445
- var kt = {},
13460
+ var Lt = {},
13446
13461
  on;
13447
13462
  function Ki() {
13448
- if (on) return kt;
13449
- on = 1, Object.defineProperty(kt, "__esModule", {
13463
+ if (on) return Lt;
13464
+ on = 1, Object.defineProperty(Lt, "__esModule", {
13450
13465
  value: !0
13451
- }), kt.Elements = void 0;
13466
+ }), Lt.Elements = void 0;
13452
13467
  var n = /*#__PURE__*/function () {
13453
13468
  function n() {
13454
13469
  _classCallCheck(this, n);
@@ -13495,15 +13510,15 @@ function Ki() {
13495
13510
  }
13496
13511
  }]);
13497
13512
  }();
13498
- return kt.Elements = n, kt;
13513
+ return Lt.Elements = n, Lt;
13499
13514
  }
13500
- var Lt = {},
13515
+ var It = {},
13501
13516
  an;
13502
13517
  function Wi() {
13503
- if (an) return Lt;
13504
- an = 1, Object.defineProperty(Lt, "__esModule", {
13518
+ if (an) return It;
13519
+ an = 1, Object.defineProperty(It, "__esModule", {
13505
13520
  value: !0
13506
- }), Lt.Cursor = void 0;
13521
+ }), It.Cursor = void 0;
13507
13522
  var n = /*#__PURE__*/function () {
13508
13523
  function n() {
13509
13524
  _classCallCheck(this, n);
@@ -13584,14 +13599,14 @@ function Wi() {
13584
13599
  }
13585
13600
  }]);
13586
13601
  }();
13587
- return Lt.Cursor = n, Lt;
13602
+ return It.Cursor = n, It;
13588
13603
  }
13589
13604
  var ln;
13590
13605
  function Fn() {
13591
- if (ln) return Rt;
13592
- ln = 1, Object.defineProperty(Rt, "__esModule", {
13606
+ if (ln) return Mt;
13607
+ ln = 1, Object.defineProperty(Mt, "__esModule", {
13593
13608
  value: !0
13594
- }), Rt.CommandUtils = void 0;
13609
+ }), Mt.CommandUtils = void 0;
13595
13610
  var n = Bn(),
13596
13611
  e = Ki(),
13597
13612
  t = Rs(),
@@ -13691,15 +13706,15 @@ function Fn() {
13691
13706
  }
13692
13707
  }]);
13693
13708
  }();
13694
- return Rt.CommandUtils = r, Rt;
13709
+ return Mt.CommandUtils = r, Mt;
13695
13710
  }
13696
- var It = {},
13711
+ var Ot = {},
13697
13712
  cn;
13698
13713
  function ga() {
13699
- if (cn) return It;
13700
- cn = 1, Object.defineProperty(It, "__esModule", {
13714
+ if (cn) return Ot;
13715
+ cn = 1, Object.defineProperty(Ot, "__esModule", {
13701
13716
  value: !0
13702
- }), It.Highlight = void 0;
13717
+ }), Ot.Highlight = void 0;
13703
13718
  var n = Ki(),
13704
13719
  e = Wi();
13705
13720
  var t = /*#__PURE__*/function () {
@@ -13750,15 +13765,15 @@ function ga() {
13750
13765
  }
13751
13766
  }]);
13752
13767
  }();
13753
- return It.Highlight = t, It;
13768
+ return Ot.Highlight = t, Ot;
13754
13769
  }
13755
- var Ot = {},
13770
+ var Pt = {},
13756
13771
  dn;
13757
13772
  function ba() {
13758
- if (dn) return Ot;
13759
- dn = 1, Object.defineProperty(Ot, "__esModule", {
13773
+ if (dn) return Pt;
13774
+ dn = 1, Object.defineProperty(Pt, "__esModule", {
13760
13775
  value: !0
13761
- }), Ot.Padding = void 0;
13776
+ }), Pt.Padding = void 0;
13762
13777
  var n = Ki(),
13763
13778
  e = Wi(),
13764
13779
  t = Vi();
@@ -13819,14 +13834,14 @@ function ba() {
13819
13834
  }
13820
13835
  }]);
13821
13836
  }();
13822
- return Ot.Padding = i, Ot;
13837
+ return Pt.Padding = i, Pt;
13823
13838
  }
13824
13839
  var hn;
13825
13840
  function Un() {
13826
- if (hn) return At;
13827
- hn = 1, Object.defineProperty(At, "__esModule", {
13841
+ if (hn) return Tt;
13842
+ hn = 1, Object.defineProperty(Tt, "__esModule", {
13828
13843
  value: !0
13829
- }), At.Speech = void 0;
13844
+ }), Tt.Speech = void 0;
13830
13845
  var n = pa(),
13831
13846
  e = ma(),
13832
13847
  t = Fn(),
@@ -13945,14 +13960,14 @@ function Un() {
13945
13960
  }
13946
13961
  }]);
13947
13962
  }();
13948
- return At.Speech = d, At;
13963
+ return Tt.Speech = d, Tt;
13949
13964
  }
13950
13965
  var un;
13951
13966
  function va() {
13952
- if (un) return Et;
13953
- un = 1, Object.defineProperty(Et, "__esModule", {
13967
+ if (un) return St;
13968
+ un = 1, Object.defineProperty(St, "__esModule", {
13954
13969
  value: !0
13955
- }), Et.WebSpeech = void 0;
13970
+ }), St.WebSpeech = void 0;
13956
13971
  var n = fa(),
13957
13972
  e = Rs(),
13958
13973
  t = Un();
@@ -14020,15 +14035,15 @@ function va() {
14020
14035
  }
14021
14036
  }]);
14022
14037
  }(t.Speech);
14023
- return Et.WebSpeech = i, Et;
14038
+ return St.WebSpeech = i, St;
14024
14039
  }
14025
- var Pt = {},
14040
+ var Nt = {},
14026
14041
  fn;
14027
14042
  function ya() {
14028
- if (fn) return Pt;
14029
- fn = 1, Object.defineProperty(Pt, "__esModule", {
14043
+ if (fn) return Nt;
14044
+ fn = 1, Object.defineProperty(Nt, "__esModule", {
14030
14045
  value: !0
14031
- }), Pt.GlobalState = void 0;
14046
+ }), Nt.GlobalState = void 0;
14032
14047
  var n = /*#__PURE__*/function () {
14033
14048
  function n() {
14034
14049
  _classCallCheck(this, n);
@@ -14042,16 +14057,16 @@ function ya() {
14042
14057
  }
14043
14058
  }]);
14044
14059
  }();
14045
- return Pt.GlobalState = n, n.doubleClickPending = !1, Pt;
14060
+ return Nt.GlobalState = n, n.doubleClickPending = !1, Nt;
14046
14061
  }
14047
- var Nt = {},
14048
- Dt = {},
14062
+ var Dt = {},
14063
+ Bt = {},
14049
14064
  pn;
14050
14065
  function Ea() {
14051
- if (pn) return Dt;
14052
- pn = 1, Object.defineProperty(Dt, "__esModule", {
14066
+ if (pn) return Bt;
14067
+ pn = 1, Object.defineProperty(Bt, "__esModule", {
14053
14068
  value: !0
14054
- }), Dt.PreventConnectionStop = void 0;
14069
+ }), Bt.PreventConnectionStop = void 0;
14055
14070
  var n = /*#__PURE__*/function () {
14056
14071
  function n() {
14057
14072
  _classCallCheck(this, n);
@@ -14070,22 +14085,22 @@ function Ea() {
14070
14085
  }
14071
14086
  }]);
14072
14087
  }();
14073
- return Dt.PreventConnectionStop = n, Dt;
14088
+ return Bt.PreventConnectionStop = n, Bt;
14074
14089
  }
14075
- var Bt = {},
14076
- Ft = {},
14090
+ var Ft = {},
14091
+ Ut = {},
14077
14092
  mn;
14078
14093
  function Sa() {
14079
- return mn || (mn = 1, Object.defineProperty(Ft, "__esModule", {
14094
+ return mn || (mn = 1, Object.defineProperty(Ut, "__esModule", {
14080
14095
  value: !0
14081
- }), Ft.README_URL = void 0, Ft.README_URL = "https://github.com/OvidijusParsiunas/speech-to-element"), Ft;
14096
+ }), Ut.README_URL = void 0, Ut.README_URL = "https://github.com/OvidijusParsiunas/speech-to-element"), Ut;
14082
14097
  }
14083
14098
  var gn;
14084
14099
  function _a() {
14085
- if (gn) return Bt;
14086
- gn = 1, Object.defineProperty(Bt, "__esModule", {
14100
+ if (gn) return Ft;
14101
+ gn = 1, Object.defineProperty(Ft, "__esModule", {
14087
14102
  value: !0
14088
- }), Bt.AzureSpeechConfig = void 0;
14103
+ }), Ft.AzureSpeechConfig = void 0;
14089
14104
  var n = Sa();
14090
14105
  var e = /*#__PURE__*/function () {
14091
14106
  function e() {
@@ -14154,15 +14169,15 @@ function _a() {
14154
14169
  }()
14155
14170
  }]);
14156
14171
  }();
14157
- return Bt.AzureSpeechConfig = e, Bt;
14172
+ return Ft.AzureSpeechConfig = e, Ft;
14158
14173
  }
14159
- var Ut = {},
14174
+ var jt = {},
14160
14175
  bn;
14161
14176
  function xa() {
14162
- if (bn) return Ut;
14163
- bn = 1, Object.defineProperty(Ut, "__esModule", {
14177
+ if (bn) return jt;
14178
+ bn = 1, Object.defineProperty(jt, "__esModule", {
14164
14179
  value: !0
14165
- }), Ut.StopTimeout = void 0;
14180
+ }), jt.StopTimeout = void 0;
14166
14181
  var n = /*#__PURE__*/function () {
14167
14182
  function n() {
14168
14183
  _classCallCheck(this, n);
@@ -14186,15 +14201,15 @@ function xa() {
14186
14201
  }
14187
14202
  }]);
14188
14203
  }();
14189
- return Ut.StopTimeout = n, n.DEFAULT_MS = 2e4, Ut;
14204
+ return jt.StopTimeout = n, n.DEFAULT_MS = 2e4, jt;
14190
14205
  }
14191
- var jt = {},
14206
+ var Ht = {},
14192
14207
  vn;
14193
14208
  function wa() {
14194
- if (vn) return jt;
14195
- vn = 1, Object.defineProperty(jt, "__esModule", {
14209
+ if (vn) return Ht;
14210
+ vn = 1, Object.defineProperty(Ht, "__esModule", {
14196
14211
  value: !0
14197
- }), jt.AzureAudioConfig = void 0;
14212
+ }), Ht.AzureAudioConfig = void 0;
14198
14213
  var n = /*#__PURE__*/function () {
14199
14214
  function n() {
14200
14215
  _classCallCheck(this, n);
@@ -14206,15 +14221,15 @@ function wa() {
14206
14221
  }
14207
14222
  }]);
14208
14223
  }();
14209
- return jt.AzureAudioConfig = n, jt;
14224
+ return Ht.AzureAudioConfig = n, Ht;
14210
14225
  }
14211
- var Ht = {},
14226
+ var qt = {},
14212
14227
  yn;
14213
14228
  function Aa() {
14214
- if (yn) return Ht;
14215
- yn = 1, Object.defineProperty(Ht, "__esModule", {
14229
+ if (yn) return qt;
14230
+ yn = 1, Object.defineProperty(qt, "__esModule", {
14216
14231
  value: !0
14217
- }), Ht.AzureTranscript = void 0;
14232
+ }), qt.AzureTranscript = void 0;
14218
14233
  var n = Dn();
14219
14234
  var e = /*#__PURE__*/function () {
14220
14235
  function e() {
@@ -14237,14 +14252,14 @@ function Aa() {
14237
14252
  }
14238
14253
  }]);
14239
14254
  }();
14240
- return Ht.AzureTranscript = e, Ht;
14255
+ return qt.AzureTranscript = e, qt;
14241
14256
  }
14242
14257
  var En;
14243
14258
  function Ta() {
14244
- if (En) return Nt;
14245
- En = 1, Object.defineProperty(Nt, "__esModule", {
14259
+ if (En) return Dt;
14260
+ En = 1, Object.defineProperty(Dt, "__esModule", {
14246
14261
  value: !0
14247
- }), Nt.Azure = void 0;
14262
+ }), Dt.Azure = void 0;
14248
14263
  var n = Ea(),
14249
14264
  e = _a(),
14250
14265
  t = xa(),
@@ -14415,12 +14430,12 @@ function Ta() {
14415
14430
  }
14416
14431
  }]);
14417
14432
  }(r.Speech);
14418
- return Nt.Azure = o, Nt;
14433
+ return Dt.Azure = o, Dt;
14419
14434
  }
14420
14435
  var Sn;
14421
14436
  function Ca() {
14422
- if (Sn) return pi;
14423
- Sn = 1, Object.defineProperty(pi, "__esModule", {
14437
+ if (Sn) return mi;
14438
+ Sn = 1, Object.defineProperty(mi, "__esModule", {
14424
14439
  value: !0
14425
14440
  });
14426
14441
  var n = va(),
@@ -14467,10 +14482,10 @@ function Ca() {
14467
14482
  }
14468
14483
  }]);
14469
14484
  }();
14470
- return pi["default"] = s, pi;
14485
+ return mi["default"] = s, mi;
14471
14486
  }
14472
14487
  var Ra = Ca();
14473
- var mi = /* @__PURE__ */ua(Ra);
14488
+ var gi = /* @__PURE__ */ua(Ra);
14474
14489
  var Ma = /*#__PURE__*/function () {
14475
14490
  function Ma(e, t) {
14476
14491
  _classCallCheck(this, Ma);
@@ -14482,7 +14497,7 @@ var Ma = /*#__PURE__*/function () {
14482
14497
  var _this73 = this;
14483
14498
  this._silenceTimeout = setTimeout(function () {
14484
14499
  var i;
14485
- (i = e.submit) == null || i.call(e), mi.stop(), _this73._stop || setTimeout(t, ri.MICROPHONE_RESET_TIMEOUT_MS);
14500
+ (i = e.submit) == null || i.call(e), gi.stop(), _this73._stop || setTimeout(t, oi.MICROPHONE_RESET_TIMEOUT_MS);
14486
14501
  }, this._silenceMS);
14487
14502
  }
14488
14503
  }, {
@@ -14511,7 +14526,7 @@ var Zt = /*#__PURE__*/function (_Gi) {
14511
14526
  var _this74$processConfig = _this74.processConfiguration(t, e.speechToText),
14512
14527
  r = _this74$processConfig.serviceName,
14513
14528
  o = _this74$processConfig.processedConfig;
14514
- if (_this74._addErrorMessage = i, r === "webspeech" && !mi.isWebSpeechSupported()) _this74.changeToUnsupported();else {
14529
+ if (_this74._addErrorMessage = i, r === "webspeech" && !gi.isWebSpeechSupported()) _this74.changeToUnsupported();else {
14515
14530
  var a = !e.textInput || !e.textInput.disabled;
14516
14531
  _this74.elementRef.onclick = _this74.buttonClick.bind(_this74, t, a, r, o);
14517
14532
  }
@@ -14542,7 +14557,7 @@ var Zt = /*#__PURE__*/function (_Gi) {
14542
14557
  return d.toLowerCase().includes(a) ? (setTimeout(function () {
14543
14558
  var u;
14544
14559
  return (u = e.submit) == null ? void 0 : u.call(e);
14545
- }), mi.endCommandMode(), {
14560
+ }), gi.endCommandMode(), {
14546
14561
  restart: !0,
14547
14562
  removeNewText: !0
14548
14563
  }) : null;
@@ -14556,7 +14571,7 @@ var Zt = /*#__PURE__*/function (_Gi) {
14556
14571
  value: function buttonClick(e, t, i, s) {
14557
14572
  var _this75 = this;
14558
14573
  var r = s == null ? void 0 : s.events;
14559
- e.removePlaceholderStyle(), mi.toggle(i, _objectSpread({
14574
+ e.removePlaceholderStyle(), gi.toggle(i, _objectSpread({
14560
14575
  insertInCursorLocation: !1,
14561
14576
  element: t ? e.inputElementRef : void 0,
14562
14577
  onError: function onError() {
@@ -14615,20 +14630,21 @@ var Zt = /*#__PURE__*/function (_Gi) {
14615
14630
  }]);
14616
14631
  }(Gi);
14617
14632
  Zt.MICROPHONE_RESET_TIMEOUT_MS = 300;
14618
- var ri = Zt;
14633
+ var oi = Zt;
14619
14634
  var Ne = /*#__PURE__*/function () {
14620
14635
  // prettier-ignore
14621
- function Ne(e, t, i, s) {
14636
+ function Ne(e, t, i, s, r) {
14622
14637
  var _this76 = this;
14623
14638
  _classCallCheck(this, Ne);
14624
- this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", this._hiddenAttachments = /* @__PURE__ */new Set(), t.maxNumberOfFiles && (this._fileCountLimit = t.maxNumberOfFiles), this._toggleContainerDisplay = i, this._fileAttachmentsContainerRef = s, t.acceptedFormats && (this._acceptedFormat = t.acceptedFormats), setTimeout(function () {
14625
- _this76._validationHandler = e._validationHandler;
14639
+ this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", this._hiddenAttachments = /* @__PURE__ */new Set(), i.maxNumberOfFiles && (this._fileCountLimit = i.maxNumberOfFiles), this._toggleContainerDisplay = s, this._fileAttachmentsContainerRef = r, i.acceptedFormats && (this._acceptedFormat = i.acceptedFormats), setTimeout(function () {
14640
+ _this76._validationHandler = e._validationHandler, _this76._onInput = t.onInput;
14626
14641
  });
14627
14642
  }
14628
14643
  return _createClass(Ne, [{
14629
14644
  key: "attemptAddFile",
14630
14645
  value: function attemptAddFile(e, t) {
14631
- return Ne.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), !0) : !1;
14646
+ var i;
14647
+ return Ne.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), (i = this._onInput) == null || i.call(this, !0), !0) : !1;
14632
14648
  }
14633
14649
  }, {
14634
14650
  key: "addAttachmentBasedOnType",
@@ -14638,7 +14654,7 @@ var Ne = /*#__PURE__*/function () {
14638
14654
  var r = Ne.createImageAttachment(t);
14639
14655
  this.addFileAttachment(e, "image", r, i);
14640
14656
  } else if (s === "audio") {
14641
- var _r3 = oi.createAudioAttachment(t);
14657
+ var _r3 = ai.createAudioAttachment(t);
14642
14658
  this.addFileAttachment(e, "audio", _r3, i);
14643
14659
  } else {
14644
14660
  var _r4 = Ne.createAnyFileAttachment(e.name);
@@ -14673,13 +14689,14 @@ var Ne = /*#__PURE__*/function () {
14673
14689
  }
14674
14690
  }, {
14675
14691
  key: "removeAttachment",
14676
- value: function removeAttachment(e) {
14677
- var s;
14678
- var t = this._attachments.findIndex(function (r) {
14679
- return r === e;
14692
+ value: function removeAttachment(e, t) {
14693
+ var r, o;
14694
+ (r = this._onInput) == null || r.call(this, !!(t != null && t.isTrusted));
14695
+ var i = this._attachments.findIndex(function (a) {
14696
+ return a === e;
14680
14697
  }),
14681
- i = this._attachments[t].attachmentContainerElement;
14682
- this._attachments.splice(t, 1), oi.stopAttachmentPlayback(i), i.remove(), this._toggleContainerDisplay(!1), (s = this._validationHandler) == null || s.call(this);
14698
+ s = this._attachments[i].attachmentContainerElement;
14699
+ this._attachments.splice(i, 1), ai.stopAttachmentPlayback(s), s.remove(), this._toggleContainerDisplay(!1), (o = this._validationHandler) == null || o.call(this);
14683
14700
  }
14684
14701
  }, {
14685
14702
  key: "getFiles",
@@ -14716,9 +14733,10 @@ var Ne = /*#__PURE__*/function () {
14716
14733
  key: "readdAttachments",
14717
14734
  value: function readdAttachments() {
14718
14735
  var _this78 = this;
14719
- Array.from(this._hiddenAttachments).forEach(function (e) {
14720
- _this78._fileAttachmentsContainerRef.appendChild(e.attachmentContainerElement), _this78._attachments.push(e);
14721
- }), this._hiddenAttachments.clear();
14736
+ var e;
14737
+ Array.from(this._hiddenAttachments).forEach(function (t) {
14738
+ _this78._fileAttachmentsContainerRef.appendChild(t.attachmentContainerElement), _this78._attachments.push(t);
14739
+ }), (e = this._onInput) == null || e.call(this, !1), this._hiddenAttachments.clear();
14722
14740
  }
14723
14741
  }], [{
14724
14742
  key: "isFileTypeValid",
@@ -14770,9 +14788,9 @@ var Ne = /*#__PURE__*/function () {
14770
14788
  }();
14771
14789
  var Oe = /*#__PURE__*/function (_Ne) {
14772
14790
  // prettier-ignore
14773
- function Oe(e, t, i, s) {
14791
+ function Oe(e, t, i, s, r) {
14774
14792
  _classCallCheck(this, Oe);
14775
- return _callSuper(this, Oe, [e, t, i, s]);
14793
+ return _callSuper(this, Oe, [e, t, i, s, r]);
14776
14794
  }
14777
14795
  _inherits(Oe, _Ne);
14778
14796
  return _createClass(Oe, [{
@@ -14850,7 +14868,7 @@ var Oe = /*#__PURE__*/function (_Ne) {
14850
14868
  }, {
14851
14869
  key: "addAudioElements",
14852
14870
  value: function addAudioElements(e, t) {
14853
- var i = e.parentElement ? G.cloneElement(e) : e,
14871
+ var i = e.parentElement ? V.cloneElement(e) : e,
14854
14872
  s = document.createElement("audio");
14855
14873
  s.src = t;
14856
14874
  var r = Ue.createSVGElement(Pn);
@@ -14881,7 +14899,7 @@ var Oe = /*#__PURE__*/function (_Ne) {
14881
14899
  }]);
14882
14900
  }(Ne);
14883
14901
  Oe.TIMER_LIMIT_S = 5999;
14884
- var oi = Oe;
14902
+ var ai = Oe;
14885
14903
  var ka = /*#__PURE__*/function () {
14886
14904
  function ka() {
14887
14905
  _classCallCheck(this, ka);
@@ -14890,24 +14908,24 @@ var ka = /*#__PURE__*/function () {
14890
14908
  key: "create",
14891
14909
  value:
14892
14910
  // prettier-ignore
14893
- function create(e, t, i, s, r) {
14894
- return r === "audio" ? new oi(e, t, i, s) : new Ne(e, t, i, s);
14911
+ function create(e, t, i, s, r, o) {
14912
+ return o === "audio" ? new ai(e, t, i, s, r) : new Ne(e, t, i, s, r);
14895
14913
  }
14896
14914
  }]);
14897
14915
  }();
14898
- var di = /*#__PURE__*/function () {
14899
- function di(e, t, i) {
14900
- _classCallCheck(this, di);
14916
+ var hi = /*#__PURE__*/function () {
14917
+ function hi(e, t, i) {
14918
+ _classCallCheck(this, hi);
14901
14919
  this._fileAttachmentsTypes = [], this.elementRef = this.createAttachmentContainer();
14902
14920
  var s = _typeof(i) == "object" && !!i.displayFileAttachmentContainer;
14903
14921
  this.toggleContainerDisplay(s), e.appendChild(this.elementRef), t && Object.assign(this.elementRef.style, t);
14904
14922
  }
14905
14923
  // prettier-ignore
14906
- return _createClass(di, [{
14924
+ return _createClass(hi, [{
14907
14925
  key: "addType",
14908
- value: function addType(e, t, i) {
14909
- var s = ka.create(e, t, this.toggleContainerDisplay.bind(this), this.elementRef, i);
14910
- return this._fileAttachmentsTypes.push(s), s;
14926
+ value: function addType(e, t, i, s) {
14927
+ var r = ka.create(e, t, i, this.toggleContainerDisplay.bind(this), this.elementRef, s);
14928
+ return this._fileAttachmentsTypes.push(r), r;
14911
14929
  }
14912
14930
  }, {
14913
14931
  key: "createAttachmentContainer",
@@ -14967,7 +14985,7 @@ var di = /*#__PURE__*/function () {
14967
14985
  }, {
14968
14986
  key: "addFilesToAnyType",
14969
14987
  value: function addFilesToAnyType(e) {
14970
- di.addFilesToType(e, this._fileAttachmentsTypes);
14988
+ hi.addFilesToType(e, this._fileAttachmentsTypes);
14971
14989
  }
14972
14990
  }, {
14973
14991
  key: "hideFiles",
@@ -15149,7 +15167,7 @@ var Di = /*#__PURE__*/function (_ct5) {
15149
15167
  }, {
15150
15168
  key: "import",
15151
15169
  value: function _import(e) {
15152
- di.addFilesToType(Array.from(e.files || []), [this._fileAttachmentsType]), e.value = "";
15170
+ hi.addFilesToType(Array.from(e.files || []), [this._fileAttachmentsType]), e.value = "";
15153
15171
  }
15154
15172
  }, {
15155
15173
  key: "addClickEvent",
@@ -15713,7 +15731,7 @@ var P = /*#__PURE__*/function (_ct6) {
15713
15731
  var _this92 = this;
15714
15732
  this.elementRef.classList.contains(P.SUBMIT_CLASS) || (this.elementRef.classList.remove(P.LOADING_CLASS, P.DISABLED_CLASS), N.removeAriaAttributes(this.elementRef), this.elementRef.classList.add(P.SUBMIT_CLASS), this.changeElementsByState(this._innerElements.submit), it.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = function () {
15715
15733
  var e;
15716
- _this92.submitFromInput(), (e = _this92._microphoneButton) != null && e.isActive && ri.toggleSpeechAfterSubmit(_this92._microphoneButton.elementRef, !!_this92._stopSTTAfterSubmit);
15734
+ _this92.submitFromInput(), (e = _this92._microphoneButton) != null && e.isActive && oi.toggleSpeechAfterSubmit(_this92._microphoneButton.elementRef, !!_this92._stopSTTAfterSubmit);
15717
15735
  });
15718
15736
  }
15719
15737
  // called every time when user triggers an input via ValidationHandler - hence use class to check if not already present
@@ -15790,7 +15808,7 @@ var Ms = /*#__PURE__*/function (_tt) {
15790
15808
  _this94.capture();
15791
15809
  }, t.addEventListener("click", this.stop.bind(this)), i.onclick = function () {
15792
15810
  var r = _this94.getFile();
15793
- r && di.addFilesToType([r], [s]), _this94.stop(), _this94.close();
15811
+ r && hi.addFilesToType([r], [s]), _this94.stop(), _this94.close();
15794
15812
  };
15795
15813
  }
15796
15814
  }, {
@@ -15905,36 +15923,36 @@ var ks = /*#__PURE__*/function (_ct7) {
15905
15923
  }
15906
15924
  }]);
15907
15925
  }(ct);
15908
- var Kt = /*#__PURE__*/function () {
15909
- function Kt(e, t, i, s) {
15910
- _classCallCheck(this, Kt);
15911
- this.elementRef = Kt.createPanelElement(e.inputAreaStyle);
15926
+ var ht = /*#__PURE__*/function () {
15927
+ function ht(e, t, i, s) {
15928
+ _classCallCheck(this, ht);
15929
+ this.elementRef = ht.createPanelElement(e.inputAreaStyle);
15912
15930
  var r = {},
15913
15931
  o = this.createFileUploadComponents(e, i, s, r),
15914
- a = new vi(e, i, o);
15932
+ a = new yi(e, i, o);
15915
15933
  e.speechToText && !r.microphone && (r.microphone = {
15916
- button: new ri(e, a, t.addNewErrorMessage.bind(t))
15934
+ button: new oi(e, a, t.addNewErrorMessage.bind(t))
15917
15935
  });
15918
15936
  var l = new vs(e, a, t, i, o, r);
15919
15937
  a.submit = l.submitFromInput.bind(l), $e.attach(e, i, a, o, l), e.submitUserMessage = l.programmaticSubmit.bind(l), r.submit = {
15920
15938
  button: l
15921
- }, e.customButtons && st.add(e, r), Kt.addElements(this.elementRef, a, r, s, o, e.dropupStyles);
15939
+ }, e.customButtons && st.add(e, r), ht.addElements(this.elementRef, a, r, s, o, e.dropupStyles), ht.assignOnInput(e, i, o, a);
15922
15940
  }
15923
- return _createClass(Kt, [{
15941
+ return _createClass(ht, [{
15924
15942
  key: "createFileUploadComponents",
15925
15943
  value:
15926
15944
  // prettier-ignore
15927
15945
  function createFileUploadComponents(e, t, i, s) {
15928
15946
  var o, a, l, c;
15929
- var r = new di(this.elementRef, e.attachmentContainerStyle, t.demo);
15930
- if (Kt.createUploadButtons(e, t.fileTypes || {}, r, i, s), (o = t.camera) != null && o.files) {
15931
- var d = ((a = s.images) == null ? void 0 : a.fileType) || r.addType(e, t.camera.files, "images");
15947
+ var r = new hi(this.elementRef, e.attachmentContainerStyle, t.demo);
15948
+ if (ht.createUploadButtons(e, t, t.fileTypes || {}, r, i, s), (o = t.camera) != null && o.files) {
15949
+ var d = ((a = s.images) == null ? void 0 : a.fileType) || r.addType(e, t, t.camera.files, "images");
15932
15950
  s.camera = {
15933
15951
  button: new ks(i, d, t.camera)
15934
15952
  };
15935
15953
  }
15936
15954
  if ((l = t.recordAudio) != null && l.files) {
15937
- var _d = ((c = s.audio) == null ? void 0 : c.fileType) || r.addType(e, t.recordAudio.files, "audio");
15955
+ var _d = ((c = s.audio) == null ? void 0 : c.fileType) || r.addType(e, t, t.recordAudio.files, "audio");
15938
15956
  s.microphone = {
15939
15957
  button: new La(_d, t.recordAudio)
15940
15958
  };
@@ -15950,20 +15968,20 @@ var Kt = /*#__PURE__*/function () {
15950
15968
  }
15951
15969
  }, {
15952
15970
  key: "createUploadButtons",
15953
- value: function createUploadButtons(e, t, i, s, r) {
15954
- Object.keys(t).forEach(function (o) {
15955
- var a = o,
15956
- l = t[a];
15957
- if (l.files) {
15958
- var c = i.addType(e, l.files, a),
15959
- _ha$a = ha[a],
15960
- d = _ha$a.id,
15961
- u = _ha$a.svgString,
15962
- h = _ha$a.dropupText,
15963
- f = new Di(s, c, l, d, u, h);
15964
- r[a] = {
15965
- button: f,
15966
- fileType: c
15971
+ value: function createUploadButtons(e, t, i, s, r, o) {
15972
+ Object.keys(i).forEach(function (a) {
15973
+ var l = a,
15974
+ c = i[l];
15975
+ if (c.files) {
15976
+ var d = s.addType(e, t, c.files, l),
15977
+ _ha$l = ha[l],
15978
+ u = _ha$l.id,
15979
+ h = _ha$l.svgString,
15980
+ f = _ha$l.dropupText,
15981
+ m = new Di(r, d, c, u, h, f);
15982
+ o[l] = {
15983
+ button: m,
15984
+ fileType: d
15967
15985
  };
15968
15986
  }
15969
15987
  });
@@ -15972,10 +15990,25 @@ var Kt = /*#__PURE__*/function () {
15972
15990
  }, {
15973
15991
  key: "addElements",
15974
15992
  value: function addElements(e, t, i, s, r, o) {
15975
- G.addElements(e, t.elementRef);
15976
- var a = yt.create(),
15977
- l = W.addButtons(a, i, s, o);
15978
- bs.set(t.inputElementRef, a, r.elementRef, l), yt.add(e, a);
15993
+ V.addElements(e, t.elementRef);
15994
+ var a = Et.create(),
15995
+ l = $.addButtons(a, i, s, o);
15996
+ bs.set(t.inputElementRef, a, r.elementRef, l), Et.add(e, a);
15997
+ }
15998
+ }, {
15999
+ key: "assignOnInput",
16000
+ value: function assignOnInput(e, t, i, s) {
16001
+ t.onInput = function (r) {
16002
+ setTimeout(function () {
16003
+ var o = i.getAllFileData(),
16004
+ l = {
16005
+ text: s.inputElementRef.innerText.trim()
16006
+ };
16007
+ o && (l.files = o.map(function (c) {
16008
+ return c.file;
16009
+ })), ii.onInput(e, l, r);
16010
+ });
16011
+ };
15979
16012
  }
15980
16013
  }]);
15981
16014
  }();
@@ -15990,8 +16023,8 @@ var Ls = /*#__PURE__*/function () {
15990
16023
  s.id = "chat-view";
15991
16024
  var r = new de(e, t, i);
15992
16025
  t.websocket && H.createConnection(t, r);
15993
- var o = new Kt(e, r, t, s);
15994
- return G.addElements(s, r.elementRef, o.elementRef), s;
16026
+ var o = new ht(e, r, t, s);
16027
+ return V.addElements(s, r.elementRef, o.elementRef), s;
15995
16028
  }
15996
16029
  }, {
15997
16030
  key: "render",
@@ -16018,10 +16051,10 @@ var _ = /*#__PURE__*/function (_rs) {
16018
16051
  }, _this98.addMessage = function () {
16019
16052
  return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
16020
16053
  }, _this98.updateMessage = function () {}, _this98.clearMessages = function () {}, _this98.focusInput = function () {
16021
- return ai.focusFromParentElement(_this98._elementRef);
16054
+ return li.focusFromParentElement(_this98._elementRef);
16022
16055
  }, _this98.refreshMessages = function () {}, _this98.scrollToBottom = function () {}, _this98.disableSubmitButton = function () {}, _this98.setPlaceholderText = function () {}, _this98._hasBeenRendered = !1, _this98._auxiliaryStyleApplied = !1, _this98._elementRef = document.createElement("div"), _this98._elementRef.id = "container", _this98.attachShadow({
16023
16056
  mode: "open"
16024
- }).appendChild(_this98._elementRef), qt.apply(Fa, _this98.shadowRoot), setTimeout(function () {
16057
+ }).appendChild(_this98._elementRef), zt.apply(Fa, _this98.shadowRoot), setTimeout(function () {
16025
16058
  _this98._hasBeenRendered || _this98.onRender();
16026
16059
  }, 20);
16027
16060
  return _this98;
@@ -16037,12 +16070,12 @@ var _ = /*#__PURE__*/function (_rs) {
16037
16070
  key: "onRender",
16038
16071
  value: function onRender() {
16039
16072
  var _this$_childElement;
16040
- bi.attemptAppendStyleSheetToHead(this.style), te.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = ia.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (qt.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), qt.applyDefaultStyleToComponent(this.style, this.chatStyle), te.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? gi.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof V) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Ls.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof V && K.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered || yi.onRender(this), this._hasBeenRendered = !0;
16073
+ vi.attemptAppendStyleSheetToHead(this.style), te.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = ia.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (zt.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), zt.applyDefaultStyleToComponent(this.style, this.chatStyle), te.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? bi.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof K) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Ls.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof K && W.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered || ii.onRender(this), this._hasBeenRendered = !0;
16041
16074
  }
16042
16075
  }, {
16043
16076
  key: "disconnectedCallback",
16044
16077
  value: function disconnectedCallback() {
16045
- si.chat = void 0;
16078
+ ni.chat = void 0;
16046
16079
  }
16047
16080
  }]);
16048
16081
  }(rs);
@@ -16085,6 +16118,7 @@ w([x("object")], _.prototype, "focusMode");
16085
16118
  w([x("function")], _.prototype, "onMessage");
16086
16119
  w([x("function")], _.prototype, "onClearMessages");
16087
16120
  w([x("function")], _.prototype, "onComponentRender");
16121
+ w([x("function")], _.prototype, "onInput");
16088
16122
  w([x("function")], _.prototype, "onError");
16089
16123
  w([x("object")], _.prototype, "demo");
16090
16124
  w([x("object")], _.prototype, "_insertKeyViewStyles");