deep-chat-dev 9.0.216 → 9.0.218

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/deepChat.js CHANGED
@@ -136,26 +136,26 @@ var R = /*#__PURE__*/function () {
136
136
  }
137
137
  }]);
138
138
  }();
139
- var $e = /*#__PURE__*/function () {
140
- function $e() {
141
- _classCallCheck(this, $e);
139
+ var We = /*#__PURE__*/function () {
140
+ function We() {
141
+ _classCallCheck(this, We);
142
142
  }
143
- return _createClass($e, null, [{
143
+ return _createClass(We, null, [{
144
144
  key: "attemptAppendStyleSheetToHead",
145
145
  value: function attemptAppendStyleSheetToHead(e) {
146
- if (e.fontFamily && e.fontFamily !== $e.DEFAULT_FONT_FAMILY) return;
146
+ if (e.fontFamily && e.fontFamily !== We.DEFAULT_FONT_FAMILY) return;
147
147
  var t = document.getElementsByTagName("head")[0];
148
148
  if (!Array.from(t.getElementsByTagName("link")).some(function (s) {
149
- return s.getAttribute("href") === $e.FONT_URL;
149
+ return s.getAttribute("href") === We.FONT_URL;
150
150
  })) {
151
151
  var s = document.createElement("link");
152
- s.rel = "stylesheet", s.href = $e.FONT_URL, t.appendChild(s);
152
+ s.rel = "stylesheet", s.href = We.FONT_URL, t.appendChild(s);
153
153
  }
154
154
  }
155
155
  }]);
156
156
  }();
157
- $e.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap", $e.DEFAULT_FONT_FAMILY = "'Inter', sans-serif, Avenir, Helvetica, Arial";
158
- var fi = $e;
157
+ We.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap", We.DEFAULT_FONT_FAMILY = "'Inter', sans-serif, Avenir, Helvetica, Arial";
158
+ var fi = We;
159
159
  var pt = /*#__PURE__*/function () {
160
160
  function pt() {
161
161
  _classCallCheck(this, pt);
@@ -213,16 +213,16 @@ var Ct = (it = /*#__PURE__*/_createClass(function it() {
213
213
  var N = /* @__PURE__ */function (n) {
214
214
  return n.ESCAPE = "Escape", n.ENTER = "Enter", n.TAB = "Tab", n.ARROW_UP = "ArrowUp", n.ARROW_DOWN = "ArrowDown", n.ARROW_RIGHT = "ArrowRight", n.ARROW_LEFT = "ArrowLeft", n.BACKSPACE = "Backspace", n.DELETE = "Delete", n.META = "Meta", n.CONTROL = "Control", n;
215
215
  }(N || {});
216
- var We = /*#__PURE__*/function () {
217
- function We() {
218
- _classCallCheck(this, We);
216
+ var Ke = /*#__PURE__*/function () {
217
+ function Ke() {
218
+ _classCallCheck(this, Ke);
219
219
  }
220
- return _createClass(We, null, [{
220
+ return _createClass(Ke, null, [{
221
221
  key: "add",
222
222
  value:
223
223
  // prettier-ignore
224
224
  function add(e, t, i, s) {
225
- i !== void 0 && e.addEventListener("keydown", We.onKeyDown.bind(this, i)), e.oninput = We.onInput.bind(this, i, s), e.addEventListener("paste", function (r) {
225
+ i !== void 0 && e.addEventListener("keydown", Ke.onKeyDown.bind(this, i)), e.oninput = Ke.onInput.bind(this, i, s), e.addEventListener("paste", function (r) {
226
226
  var o;
227
227
  r.preventDefault(), (o = r.clipboardData) != null && o.files.length && t.addFilesToAnyType(Array.from(r.clipboardData.files));
228
228
  });
@@ -233,7 +233,7 @@ var We = /*#__PURE__*/function () {
233
233
  key: "onKeyDown",
234
234
  value: function onKeyDown(e, t) {
235
235
  var s = t.target.textContent;
236
- s && s.length >= e && !We.PERMITTED_KEYS.has(t.key) && !We.isKeyCombinationPermitted(t) && t.preventDefault();
236
+ s && s.length >= e && !Ke.PERMITTED_KEYS.has(t.key) && !Ke.isKeyCombinationPermitted(t) && t.preventDefault();
237
237
  }
238
238
  }, {
239
239
  key: "isKeyCombinationPermitted",
@@ -249,8 +249,8 @@ var We = /*#__PURE__*/function () {
249
249
  }
250
250
  }]);
251
251
  }();
252
- We.PERMITTED_KEYS = /* @__PURE__ */new Set([N.BACKSPACE, N.DELETE, N.ARROW_RIGHT, N.ARROW_LEFT, N.ARROW_DOWN, N.ARROW_UP, N.META, N.CONTROL, N.ENTER]);
253
- var ls = We;
252
+ Ke.PERMITTED_KEYS = /* @__PURE__ */new Set([N.BACKSPACE, N.DELETE, N.ARROW_RIGHT, N.ARROW_LEFT, N.ARROW_DOWN, N.ARROW_UP, N.META, N.CONTROL, N.ENTER]);
253
+ var ls = Ke;
254
254
  var Ln = /*#__PURE__*/function () {
255
255
  function Ln() {
256
256
  _classCallCheck(this, Ln);
@@ -265,17 +265,17 @@ var Ln = /*#__PURE__*/function () {
265
265
  }
266
266
  }]);
267
267
  }();
268
- var Ke = /*#__PURE__*/function () {
269
- function Ke(e, t, i) {
268
+ var Je = /*#__PURE__*/function () {
269
+ function Je(e, t, i) {
270
270
  var _this = this;
271
- _classCallCheck(this, Ke);
271
+ _classCallCheck(this, Je);
272
272
  var r, o;
273
- var s = Ke.processConfig(t, e.textInput);
274
- this.elementRef = Ke.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 () {
273
+ var s = Je.processConfig(t, e.textInput);
274
+ this.elementRef = Je.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 () {
275
275
  ls.add(_this.inputElementRef, i, _this._config.characterLimit, e._validationHandler);
276
276
  });
277
277
  }
278
- return _createClass(Ke, [{
278
+ return _createClass(Je, [{
279
279
  key: "clear",
280
280
  value:
281
281
  // this also similarly prevents scroll up
@@ -291,7 +291,7 @@ var Ke = /*#__PURE__*/function () {
291
291
  value: function createInputElement() {
292
292
  var t, i, s, r;
293
293
  var e = document.createElement("div");
294
- return e.id = Ke.TEXT_INPUT_ID, e.classList.add("text-input-styling"), Ct.IS_CHROMIUM && Ke.preventAutomaticScrollUpOnNewLine(e), typeof this._config.disabled == "boolean" && this._config.disabled === !0 ? (e.contentEditable = "false", e.classList.add("text-input-disabled")) : (e.contentEditable = "true", this.addEventListeners(e)), Object.assign(e.style, (t = this._config.styles) == null ? void 0 : t.text), Object.assign(e.style, (i = this._config.placeholder) == null ? void 0 : i.style), (r = (s = this._config.placeholder) == null ? void 0 : s.style) != null && r.color || e.setAttribute("textcolor", ""), e;
294
+ return e.id = Je.TEXT_INPUT_ID, e.classList.add("text-input-styling"), Ct.IS_CHROMIUM && Je.preventAutomaticScrollUpOnNewLine(e), typeof this._config.disabled == "boolean" && this._config.disabled === !0 ? (e.contentEditable = "false", e.classList.add("text-input-disabled")) : (e.contentEditable = "true", this.addEventListeners(e)), Object.assign(e.style, (t = this._config.styles) == null ? void 0 : t.text), Object.assign(e.style, (i = this._config.placeholder) == null ? void 0 : i.style), (r = (s = this._config.placeholder) == null ? void 0 : s.style) != null && r.color || e.setAttribute("textcolor", ""), e;
295
295
  }
296
296
  }, {
297
297
  key: "removePlaceholderStyle",
@@ -368,8 +368,8 @@ var Ke = /*#__PURE__*/function () {
368
368
  }
369
369
  }]);
370
370
  }();
371
- Ke.TEXT_INPUT_ID = "text-input";
372
- var pi = Ke;
371
+ Je.TEXT_INPUT_ID = "text-input";
372
+ var pi = Je;
373
373
  var Yt = /*#__PURE__*/function () {
374
374
  function Yt() {
375
375
  _classCallCheck(this, Yt);
@@ -634,11 +634,11 @@ var le = /*#__PURE__*/function () {
634
634
  }();
635
635
  le.DEFAULT_FILE_NAME = "file", le.FILE_BUBBLE_CLASS = "file-message";
636
636
  var j = le;
637
- var ne = /*#__PURE__*/function () {
638
- function ne() {
639
- _classCallCheck(this, ne);
637
+ var X = /*#__PURE__*/function () {
638
+ function X() {
639
+ _classCallCheck(this, X);
640
640
  }
641
- return _createClass(ne, null, [{
641
+ return _createClass(X, null, [{
642
642
  key: "checkForContainerStyles",
643
643
  value: function checkForContainerStyles(e, t) {
644
644
  var i = e.containerStyle;
@@ -714,19 +714,26 @@ var ne = /*#__PURE__*/function () {
714
714
  if (!e) return;
715
715
  var t = structuredClone(e),
716
716
  i = t.loading;
717
- return i && (i.outerContainer || i.innerContainer || i.bubble || i.media) && (console.error("The loading message styles are defined using LoadingMessageStyles interface since version 2.0.2."), console.error("Check it out here: https://deepchat.dev/docs/messages/styles#LoadingMessageStyles"), t.loading = {
717
+ return i && (i.outerContainer || i.innerContainer || i.bubble || i.media) && (console.error("The loading message styles are defined using LoadingMessageStyles interface since version 2.1.0."), console.error("Check it out here: https://deepchat.dev/docs/messages/styles#LoadingMessageStyles"), t.loading = {
718
718
  message: {
719
719
  styles: i
720
720
  }
721
721
  }), t;
722
722
  }
723
+ }, {
724
+ key: "processDemo",
725
+ value: function processDemo(e) {
726
+ return typeof e == "boolean" || e.displayLoadingBubble && (console.error("The demo displayLoadingBubble property is deprecated since version 2.1.0."), console.error("Please use displayLoading instead: https://deepchat.dev/docs/messages/styles#LoadingMessageStyles"), e.displayLoading = {
727
+ message: !0
728
+ }), e;
729
+ }
723
730
  }]);
724
731
  }();
725
- var Ye = /*#__PURE__*/function () {
726
- function Ye() {
727
- _classCallCheck(this, Ye);
732
+ var Qe = /*#__PURE__*/function () {
733
+ function Qe() {
734
+ _classCallCheck(this, Qe);
728
735
  }
729
- return _createClass(Ye, null, [{
736
+ return _createClass(Qe, null, [{
730
737
  key: "mouseUp",
731
738
  value: function mouseUp(e, t) {
732
739
  R.unsetAllCSSMouseStates(e, t), Object.assign(e.style, t["default"]), Object.assign(e.style, t.hover);
@@ -749,7 +756,7 @@ var Ye = /*#__PURE__*/function () {
749
756
  }, {
750
757
  key: "add",
751
758
  value: function add(e, t) {
752
- e.addEventListener("mouseenter", Ye.mouseEnter.bind(this, e, t)), e.addEventListener("mouseleave", Ye.mouseLeave.bind(this, e, t)), e.addEventListener("mousedown", Ye.mouseDown.bind(this, e, t)), e.addEventListener("mouseup", Ye.mouseUp.bind(this, e, t));
759
+ e.addEventListener("mouseenter", Qe.mouseEnter.bind(this, e, t)), e.addEventListener("mouseleave", Qe.mouseLeave.bind(this, e, t)), e.addEventListener("mousedown", Qe.mouseDown.bind(this, e, t)), e.addEventListener("mouseup", Qe.mouseUp.bind(this, e, t));
753
760
  }
754
761
  }]);
755
762
  }();
@@ -837,7 +844,7 @@ var Oe = /*#__PURE__*/function () {
837
844
  var o = i.getElementsByClassName(r);
838
845
  Array.from(o || []).forEach(function (a) {
839
846
  var l = Oe.getProcessedStyles(t, a, r);
840
- ie.applyStylesToElement(a, l), Oe.applyEvents(a, r);
847
+ se.applyStylesToElement(a, l), Oe.applyEvents(a, r);
841
848
  });
842
849
  });
843
850
  var s = i.getElementsByClassName(Fn);
@@ -847,15 +854,15 @@ var Oe = /*#__PURE__*/function () {
847
854
  }
848
855
  }]);
849
856
  }();
850
- var ie = /*#__PURE__*/function () {
851
- function ie() {
852
- _classCallCheck(this, ie);
857
+ var se = /*#__PURE__*/function () {
858
+ function se() {
859
+ _classCallCheck(this, se);
853
860
  }
854
- return _createClass(ie, null, [{
861
+ return _createClass(se, null, [{
855
862
  key: "applyStylesToElement",
856
863
  value: function applyStylesToElement(e, t) {
857
864
  var i = R.processStateful(t, {}, {});
858
- Ye.add(e, i), Object.assign(e.style, i["default"]);
865
+ Qe.add(e, i), Object.assign(e.style, i["default"]);
859
866
  }
860
867
  }, {
861
868
  key: "applyEventsToElement",
@@ -870,7 +877,7 @@ var ie = /*#__PURE__*/function () {
870
877
  value: function applyClassUtilitiesToElement(e, t) {
871
878
  var i = t.events,
872
879
  s = t.styles;
873
- i && ie.applyEventsToElement(e, i), s && !Oe.doesElementContainDeepChatClass(e) && ie.applyStylesToElement(e, s);
880
+ i && se.applyEventsToElement(e, i), s && !Oe.doesElementContainDeepChatClass(e) && se.applyStylesToElement(e, s);
874
881
  }
875
882
  }, {
876
883
  key: "applyCustomClassUtilities",
@@ -878,20 +885,20 @@ var ie = /*#__PURE__*/function () {
878
885
  Object.keys(e).forEach(function (i) {
879
886
  var s = t.getElementsByClassName(i);
880
887
  Array.from(s).forEach(function (r) {
881
- e[i] && ie.applyClassUtilitiesToElement(r, e[i]);
888
+ e[i] && se.applyClassUtilitiesToElement(r, e[i]);
882
889
  });
883
890
  });
884
891
  }
885
892
  }, {
886
893
  key: "apply",
887
894
  value: function apply(e, t) {
888
- Oe.applyDeepChatUtilities(e, e.htmlClassUtilities, t), ie.applyCustomClassUtilities(e.htmlClassUtilities, t);
895
+ Oe.applyDeepChatUtilities(e, e.htmlClassUtilities, t), se.applyCustomClassUtilities(e.htmlClassUtilities, t);
889
896
  }
890
897
  }, {
891
898
  key: "traverseNodes",
892
899
  value: function traverseNodes(e, t) {
893
900
  e.nodeType === Node.ELEMENT_NODE && t.push(e.outerHTML), e.childNodes.forEach(function (i) {
894
- ie.traverseNodes(i, t);
901
+ se.traverseNodes(i, t);
895
902
  });
896
903
  }
897
904
  }, {
@@ -900,7 +907,7 @@ var ie = /*#__PURE__*/function () {
900
907
  var i = new DOMParser().parseFromString(e, "text/html"),
901
908
  s = [];
902
909
  return i.body.childNodes.forEach(function (r) {
903
- ie.traverseNodes(r, s);
910
+ se.traverseNodes(r, s);
904
911
  }), s;
905
912
  }
906
913
  }]);
@@ -923,7 +930,7 @@ var Ae = /*#__PURE__*/function () {
923
930
  }, {
924
931
  key: "overwriteElements",
925
932
  value: function overwriteElements(e, t, i) {
926
- i.bubbleElement.innerHTML = t, ie.apply(e, i.outerContainer), ne.flagHTMLUpdateClass(i.bubbleElement);
933
+ i.bubbleElement.innerHTML = t, se.apply(e, i.outerContainer), X.flagHTMLUpdateClass(i.bubbleElement);
927
934
  }
928
935
  // prettier-ignore
929
936
  }, {
@@ -939,7 +946,7 @@ var Ae = /*#__PURE__*/function () {
939
946
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
940
947
  var o;
941
948
  var r = Ae.createElements(e, t, i, s);
942
- return b.fillEmptyMessageElement(r.bubbleElement, t), ie.apply(e, r.outerContainer), ne.flagHTMLUpdateClass(r.bubbleElement), e.applyCustomStyles(r, i, !1, (o = e.messageStyles) == null ? void 0 : o.html), r;
949
+ return b.fillEmptyMessageElement(r.bubbleElement, t), se.apply(e, r.outerContainer), X.flagHTMLUpdateClass(r.bubbleElement), e.applyCustomStyles(r, i, !1, (o = e.messageStyles) == null ? void 0 : o.html), r;
943
950
  }
944
951
  // prettier-ignore
945
952
  }, {
@@ -1832,12 +1839,12 @@ function gr(n, e, t, i) {
1832
1839
  y,
1833
1840
  P,
1834
1841
  V,
1835
- Be,
1842
+ Fe,
1836
1843
  I,
1837
- X = !0,
1838
- Y,
1844
+ Y = !0,
1845
+ Q,
1839
1846
  B,
1840
- qe,
1847
+ ze,
1841
1848
  Mt;
1842
1849
  if ((h = Ws(n, e)) >= 0) v = !0;else if ((h = $s(n, e)) >= 0) v = !1;else return !1;
1843
1850
  if (n.level >= n.options.maxNesting) return !1;
@@ -1845,21 +1852,21 @@ function gr(n, e, t, i) {
1845
1852
  for (P = n.tokens.length, v ? (d = n.bMarks[e] + n.tShift[e], m = Number(n.src.substr(d, h - d - 1)), n.tokens.push({
1846
1853
  type: "ordered_list_open",
1847
1854
  order: m,
1848
- lines: Be = [e, 0],
1855
+ lines: Fe = [e, 0],
1849
1856
  level: n.level++
1850
1857
  })) : n.tokens.push({
1851
1858
  type: "bullet_list_open",
1852
- lines: Be = [e, 0],
1859
+ lines: Fe = [e, 0],
1853
1860
  level: n.level++
1854
- }), s = e, V = !1, Y = n.parser.ruler.getRules("list"); s < t && (y = n.skipSpaces(h), u = n.eMarks[s], y >= u ? f = 1 : f = y - h, f > 4 && (f = 1), f < 1 && (f = 1), r = h - n.bMarks[s] + f, n.tokens.push({
1861
+ }), s = e, V = !1, Q = n.parser.ruler.getRules("list"); s < t && (y = n.skipSpaces(h), u = n.eMarks[s], y >= u ? f = 1 : f = y - h, f > 4 && (f = 1), f < 1 && (f = 1), r = h - n.bMarks[s] + f, n.tokens.push({
1855
1862
  type: "list_item_open",
1856
1863
  lines: I = [e, 0],
1857
1864
  level: n.level++
1858
- }), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] = y - n.bMarks[e], n.blkIndent = r, n.tight = !0, n.parentType = "list", n.parser.tokenize(n, e, t, !0), (!n.tight || V) && (X = !1), V = n.line - e > 1 && n.isEmpty(n.line - 1), n.blkIndent = a, n.tShift[e] = o, n.tight = l, n.parentType = c, n.tokens.push({
1865
+ }), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] = y - n.bMarks[e], n.blkIndent = r, n.tight = !0, n.parentType = "list", n.parser.tokenize(n, e, t, !0), (!n.tight || V) && (Y = !1), V = n.line - e > 1 && n.isEmpty(n.line - 1), n.blkIndent = a, n.tShift[e] = o, n.tight = l, n.parentType = c, n.tokens.push({
1859
1866
  type: "list_item_close",
1860
1867
  level: --n.level
1861
1868
  }), s = e = n.line, I[1] = s, y = n.bMarks[e], !(s >= t || n.isEmpty(s) || n.tShift[s] < n.blkIndent));) {
1862
- for (Mt = !1, B = 0, qe = Y.length; B < qe; B++) if (Y[B](n, s, t, !0)) {
1869
+ for (Mt = !1, B = 0, ze = Q.length; B < ze; B++) if (Q[B](n, s, t, !0)) {
1863
1870
  Mt = !0;
1864
1871
  break;
1865
1872
  }
@@ -1872,7 +1879,7 @@ function gr(n, e, t, i) {
1872
1879
  return n.tokens.push({
1873
1880
  type: v ? "ordered_list_close" : "bullet_list_close",
1874
1881
  level: --n.level
1875
- }), Be[1] = s, n.line = s, X && mr(n, P), !0;
1882
+ }), Fe[1] = s, n.line = s, Y && mr(n, P), !0;
1876
1883
  }
1877
1884
  function br(n, e, t, i) {
1878
1885
  var s,
@@ -2945,7 +2952,7 @@ var mi = /*#__PURE__*/function () {
2945
2952
  }));
2946
2953
  j.reAddFileRefToObject(t, s), (r = e.onMessage) == null || r.call(e, s), e.dispatchEvent(new CustomEvent("message", {
2947
2954
  detail: s
2948
- })), ne.fireOnNewMessage(e, s);
2955
+ })), X.fireOnNewMessage(e, s);
2949
2956
  }
2950
2957
  }, {
2951
2958
  key: "onClearMessages",
@@ -3029,12 +3036,12 @@ var F = /*#__PURE__*/function () {
3029
3036
  }]);
3030
3037
  }();
3031
3038
  F.CLASS = "loading-history-message", F.FULL_VIEW_CLASS = "loading-history-message-full-view", F.SMALL_CLASS = "loading-history-message-small";
3032
- var tt = F;
3039
+ var Ne = F;
3033
3040
  var pe = /*#__PURE__*/function () {
3034
3041
  function pe(e) {
3035
3042
  var _this3 = this;
3036
3043
  _classCallCheck(this, pe);
3037
- this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = pe.createContainerElement(), this.messageStyles = ne.processMessageStyles(e.messageStyles), this._remarkable = Gt.createNew(e.remarkable), this._avatars = e.avatars, this._names = e.names, this._onMessage = mi.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), setTimeout(function () {
3044
+ this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = pe.createContainerElement(), this.messageStyles = X.processMessageStyles(e.messageStyles), this._remarkable = Gt.createNew(e.remarkable), this._avatars = e.avatars, this._names = e.names, this._onMessage = mi.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), setTimeout(function () {
3038
3045
  _this3.submitUserMessage = e.submitUserMessage;
3039
3046
  });
3040
3047
  }
@@ -3090,7 +3097,7 @@ var pe = /*#__PURE__*/function () {
3090
3097
  var r;
3091
3098
  (r = this._introPanel) == null || r.hide();
3092
3099
  var s = this.messageElementRefs[this.messageElementRefs.length - 1];
3093
- return tt.changeFullViewToSmall(this, s), pe.isTemporaryElement(s) && (this.revealRoleElementsIfTempRemoved(s, t), s.outerContainer.remove(), this.messageElementRefs.pop()), this.createMessageElements(e, t, i);
3100
+ return Ne.changeFullViewToSmall(this, s), pe.isTemporaryElement(s) && (this.revealRoleElementsIfTempRemoved(s, t), s.outerContainer.remove(), this.messageElementRefs.pop()), this.createMessageElements(e, t, i);
3094
3101
  }
3095
3102
  // this can be tested by having an ai message, then a temp ai message with html that submits new user message:
3096
3103
  // https://github.com/OvidijusParsiunas/deep-chat/issues/258
@@ -3135,6 +3142,7 @@ var pe = /*#__PURE__*/function () {
3135
3142
  value: function applyCustomStyles(e, t, i, s) {
3136
3143
  e && this.messageStyles && z.applyCustomStyles(this.messageStyles, e, t, i, s);
3137
3144
  }
3145
+ // WORK - add a customProps to allow devs to add custom properties
3138
3146
  }, {
3139
3147
  key: "removeMessage",
3140
3148
  value: function removeMessage(e) {
@@ -3221,23 +3229,23 @@ var pe = /*#__PURE__*/function () {
3221
3229
  }]);
3222
3230
  }();
3223
3231
  pe.TEXT_BUBBLE_CLASS = "text-message", pe.INTRO_CLASS = "deep-chat-intro";
3224
- var Ne = pe;
3232
+ var De = pe;
3225
3233
  var So = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3csvg%20fill='%23000000'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2032%2032'%20xml:space='preserve'%3e%3cpath%20d='M23,30.36H9c-2.404,0-4.36-1.956-4.36-4.36V15c0-2.404,1.956-4.36,4.36-4.36h3.659%20c0.167-1.566,1.415-2.813,2.981-2.981V5.333c-1.131-0.174-2-1.154-2-2.333c0-1.301,1.059-2.36,2.36-2.36%20c1.302,0,2.36,1.059,2.36,2.36c0,1.179-0.869,2.159-2,2.333V7.66c1.566,0.167,2.814,1.415,2.981,2.981H23%20c2.404,0,4.36,1.956,4.36,4.36v11C27.36,28.404,25.404,30.36,23,30.36z%20M9,11.36c-2.007,0-3.64,1.633-3.64,3.64v11%20c0,2.007,1.633,3.64,3.64,3.64h14c2.007,0,3.64-1.633,3.64-3.64V15c0-2.007-1.633-3.64-3.64-3.64H9z%20M13.384,10.64h5.231%20C18.439,9.354,17.334,8.36,16,8.36C14.667,8.36,13.561,9.354,13.384,10.64z%20M16,1.36c-0.904,0-1.64,0.736-1.64,1.64%20S15.096,4.64,16,4.64c0.904,0,1.64-0.736,1.64-1.64S16.904,1.36,16,1.36z%20M20,27.36h-8c-1.301,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36h8c1.302,0,2.36,1.059,2.36,2.36S21.302,27.36,20,27.36z%20M12,23.36c-0.904,0-1.64,0.735-1.64,1.64%20s0.736,1.64,1.64,1.64h8c0.904,0,1.64-0.735,1.64-1.64s-0.735-1.64-1.64-1.64H12z%20M31,23.86h-2c-0.199,0-0.36-0.161-0.36-0.36V15%20c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5C31.36,23.699,31.199,23.86,31,23.86z%20M29.36,23.14h1.279v-7.78%20H29.36V23.14z%20M3,23.86H1c-0.199,0-0.36-0.161-0.36-0.36V15c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5%20C3.36,23.699,3.199,23.86,3,23.86z%20M1.36,23.14h1.28v-7.78H1.36V23.14z%20M20,20.36c-1.302,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36s2.36,1.059,2.36,2.36C22.36,19.302,21.302,20.36,20,20.36z%20M20,16.36c-0.904,0-1.64,0.736-1.64,1.64%20s0.735,1.64,1.64,1.64s1.64-0.735,1.64-1.64S20.904,16.36,20,16.36z%20M12,20.36c-1.301,0-2.36-1.059-2.36-2.36s1.059-2.36,2.36-2.36%20s2.36,1.059,2.36,2.36C14.36,19.302,13.301,20.36,12,20.36z%20M12,16.36c-0.904,0-1.64,0.736-1.64,1.64s0.736,1.64,1.64,1.64%20s1.64-0.735,1.64-1.64S12.904,16.36,12,16.36z'/%3e%3crect%20style='fill:none;'%20width='32'%20height='32'/%3e%3c/svg%3e",
3226
3234
  xo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAMAAAC/MqoPAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAADNQTFRF////9vX18vLy/Pz86enp4+Li2tnZ1tbWzczM+fn57Ozs4N/f09LS0M/P5uXl7+/v3dzcwtncCAAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAZNSURBVHja7d3bdtsqEABQYABZSLH9/3+ZpnUsIcF5iOM6PfElNoMHMfPQdq3GmL0GkLhEUqLaUExnOtOZznSmM53pTGc605nOdKYznelMZzrTmV4LXSqllKyJDkob26xWq8Zae/iH0QoWTm9d1xur4WuypQJtTd+5dqn0VjcxzNO5/57mEBvdLo8Oron6aseWOjYOFkVvjQs3DmgyONMuht52EfztP+4hdu0i6LCO808/M8c1lE/fuPGej41uUzgdtoO/75N+2ELJ9I3b3//hPXbiMenm3pR/Jt4USgcLBIp4Bh10gqKVhvLo0klCxeSky96nKcj3siw6pJIL4XsoiQ7apyvMY/V3HHrSRioLopvEhSpTCn2TPEuwKYMOIX0tAxRBf/Hpa+lfSqBv9gi1FPsNfTrMAiVmIE/vJhz61FGnQxRIEYE4vfNYdN8Rp6MlHaHotHTn8ejekaZPAjEmyvQWdZFTtYTpXqCGJ0zvcek9Yfoel76nS0ffv1NMp1ca+pkgyfRCGind4L7OWWc605l+cxjsyhqy9AGbPpClc1/nvl5VX0c/3Alk6RU3+Am7shNZ+h6bvidLr7jBB+zKBrL0irOOudmIUDzTmf5gIP+iEuXtRuTVaEmY/oZLfyNMrzjryPc0gerMTdpVg0tvjJUU6bLPcGOoUv46SLL6Wi8yhLf06C7TUyekI0efRaaYqdFltkeNpPumRPSMDxgBYvSM035FrKAmH72hRW99PrpvSdEHkTEGUvSsK3yKVDkuJ92RohcZaehzzirPpOg+J92Tolfc4Cumx5xVXpGiZ34+ICX6W84qv5GiR5NPbiIpOv6BCoSvSkTX+eiaGP092zINvBOj4x8mSf9FqejvNo/cvpOji19ZbmviL0GPLsYMFzgzCor0+Bv/ePDvSJKOb9dJ5UlnbnEHiHgzv6cdTpJOWuc/u3FEucLDOL75xGtBiefrcwgoC9NDSH/jkH6pAuXmBqPQ9HSUPVdZBH1GGOrMXAQdYxcKZfxAoK+KKBKFLosoEoX+u4giUehz8jlcnAuhp78I46yDYNAd+QLR6K+pr+yvxdBTHyVDubQh0UfSxaHSd0lbvNkVRE87JGOtc+PQd2QLQ6fHhJkKsSh6yg13tO08JPprsgrrXWH0dJd2vH1MLPprot4eXoujpzrdhngiD40ek2y92lggPcnWa8qN1Yz0BFuvZhRl0uOfR0v4Ewuli/Bg4Qr3lArqGdndQ3UPO1EunXYwnelMZzrTmc50pjOd6UxnOtOZznSmM53pTGf6kuj6oedFKV0s3fX6sX1S3bsi6a4PD7+/YAqYeBw6pIB/4qEgOqxdSPbGiim4NRRCbzs3Jj0L4UfXtQXQVRfn5IdA/Bw7RZzurEV6EtdsLeGXkIPuA+K1UoVeA0l62zmN/LqfSSft9KkepmoRuvi3nd5uKNFB9zbbXEANqdr941XO0NJx2v2jdJenpf+/3bvn0ts16ph+sd6hX7dPo2+2cZzE02Ia43bzDHqr+2Evnhz74ZHU30ffbKOeng1/NPV30Ns1gYQnSP2P6e65Pfxc6h02XZqXQCjhJ6kPL6bFo4NrGvAU4UII4SE2P1vQuZkuOxckVfehisF1MjUddN/MZBN+kvq5uf0O/xa66gyNS9ktMWlz44rO1Z8C19i5FPdHzPamXn+F3hryPfxMr78+4F+kq22kO6Rf6fUQt+puuustyWv4rbG3l/duztFB96GYoe1cTBdXMr+nw9qVM6ZfxOvzezff0nXi/ZOndvrR6Zvpm0c3h6nhdb+5iS7tsIim/qXZD9+97/Jf+rpZ5BET1ayv0GUzLhEuhBBjIy/RdVPgndutIRt9nt7p5cKFEEJ3Z+jQFDZL+XnMDXxHB73gxn5s9Kc3d3/pFciFkN/QTSXHJpX5l66gDrkQoP6hL3xsPw39la4qOiV8tH78XeSbue6N9mvWa6J/ybpc1CT1Wnh5Qq9meP8IOKH3ddH7E/ri1iYux/SXDrXR4UiPdck/wUpU+FtPf6/orja6O9KL3l56LOvVxe5Ib2qjN0d6Vbex4ghWlU3bPqI90If66MNng680FNpbJijH6kCvaF3uMzQ3+IrpFerV4Y9dffQdN3im10ivbuImhD3Qq5u4HdZkua8znelMZ/pS4z9CPVKkxowNxgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0wMy0yN1QxNTo0NToxNSswMDowMN1xSg4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDMtMjdUMTU6NDU6MTUrMDA6MDCsLPKyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==",
3227
- Q = /*#__PURE__*/function () {
3228
- function Q() {
3229
- _classCallCheck(this, Q);
3235
+ ee = /*#__PURE__*/function () {
3236
+ function ee() {
3237
+ _classCallCheck(this, ee);
3230
3238
  }
3231
- return _createClass(Q, null, [{
3239
+ return _createClass(ee, null, [{
3232
3240
  key: "hide",
3233
3241
  value: function hide(e) {
3234
3242
  var t;
3235
- (t = e.getElementsByClassName(Q.CONTAINER_CLASS)[0].style).visibility || (t.visibility = "hidden");
3243
+ (t = e.getElementsByClassName(ee.CONTAINER_CLASS)[0].style).visibility || (t.visibility = "hidden");
3236
3244
  }
3237
3245
  }, {
3238
3246
  key: "reveal",
3239
3247
  value: function reveal(e) {
3240
- e.getElementsByClassName(Q.CONTAINER_CLASS)[0].style.visibility = "";
3248
+ e.getElementsByClassName(ee.CONTAINER_CLASS)[0].style.visibility = "";
3241
3249
  }
3242
3250
  }, {
3243
3251
  key: "applyCustomStylesToElements",
@@ -3248,10 +3256,10 @@ var So = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
3248
3256
  key: "applyCustomStyles",
3249
3257
  value: function applyCustomStyles(e, t, i, s) {
3250
3258
  var r, o, a, l;
3251
- if ((r = i["default"]) != null && r.styles && Q.applyCustomStylesToElements(e, t, i["default"].styles), s === b.USER_ROLE) (o = i.user) != null && o.styles && Q.applyCustomStylesToElements(e, t, i.user.styles);else {
3252
- (a = i.ai) != null && a.styles && Q.applyCustomStylesToElements(e, t, i.ai.styles);
3259
+ if ((r = i["default"]) != null && r.styles && ee.applyCustomStylesToElements(e, t, i["default"].styles), s === b.USER_ROLE) (o = i.user) != null && o.styles && ee.applyCustomStylesToElements(e, t, i.user.styles);else {
3260
+ (a = i.ai) != null && a.styles && ee.applyCustomStylesToElements(e, t, i.ai.styles);
3253
3261
  var c = (l = i[s]) == null ? void 0 : l.styles;
3254
- c && Q.applyCustomStylesToElements(e, t, c);
3262
+ c && ee.applyCustomStylesToElements(e, t, c);
3255
3263
  }
3256
3264
  }
3257
3265
  }, {
@@ -3261,7 +3269,7 @@ var So = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
3261
3269
  var i = document.createElement("img");
3262
3270
  e === b.USER_ROLE ? i.src = ((r = t == null ? void 0 : t.user) == null ? void 0 : r.src) || ((o = t == null ? void 0 : t["default"]) == null ? void 0 : o.src) || xo : i.src = ((a = t == null ? void 0 : t[e]) == null ? void 0 : a.src) || ((l = t == null ? void 0 : t.ai) == null ? void 0 : l.src) || ((c = t == null ? void 0 : t["default"]) == null ? void 0 : c.src) || So, i.classList.add("avatar"), i.alt = "".concat(e, " avatar");
3263
3271
  var s = document.createElement("div");
3264
- return s.classList.add(Q.CONTAINER_CLASS), s.appendChild(i), t && Q.applyCustomStyles(s, i, t, e), s;
3272
+ return s.classList.add(ee.CONTAINER_CLASS), s.appendChild(i), t && ee.applyCustomStyles(s, i, t, e), s;
3265
3273
  }
3266
3274
  }, {
3267
3275
  key: "getPosition",
@@ -3275,14 +3283,14 @@ var So = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
3275
3283
  key: "add",
3276
3284
  value: function add(e, t, i) {
3277
3285
  var s = typeof i == "boolean" ? void 0 : i,
3278
- r = Q.createAvatar(t, s),
3279
- o = Q.getPosition(t, s);
3286
+ r = ee.createAvatar(t, s),
3287
+ o = ee.getPosition(t, s);
3280
3288
  r.classList.add(o === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(o === "left" ? "beforebegin" : "afterend", r);
3281
3289
  }
3282
3290
  }]);
3283
3291
  }();
3284
- Q.CONTAINER_CLASS = "avatar-container";
3285
- var Pt = Q;
3292
+ ee.CONTAINER_CLASS = "avatar-container";
3293
+ var Pt = ee;
3286
3294
  var Ee = /*#__PURE__*/function () {
3287
3295
  function Ee() {
3288
3296
  _classCallCheck(this, Ee);
@@ -3470,7 +3478,7 @@ var w = /*#__PURE__*/function () {
3470
3478
  key: "generateMessageBodyElements",
3471
3479
  value: function generateMessageBodyElements(e, t) {
3472
3480
  var i = {};
3473
- return e.text && (i.text = w.findMessageElements(t, Ne.TEXT_BUBBLE_CLASS)), e.html && (i.html = w.findMessageElements(t, Se.HTML_BUBBLE_CLASS)), e.files && (i.files = w.filterdMessageElements(t, j.FILE_BUBBLE_CLASS)), i;
3481
+ return e.text && (i.text = w.findMessageElements(t, De.TEXT_BUBBLE_CLASS)), e.html && (i.html = w.findMessageElements(t, Se.HTML_BUBBLE_CLASS)), e.files && (i.files = w.filterdMessageElements(t, j.FILE_BUBBLE_CLASS)), i;
3474
3482
  }
3475
3483
  }, {
3476
3484
  key: "generateMessageBody",
@@ -3549,7 +3557,7 @@ var bt = /*#__PURE__*/function () {
3549
3557
  var e;
3550
3558
  if (!(this._endStreamAfterOperation || !this._message) && !(this._fileAdded && !this._elements)) {
3551
3559
  if (!this._elements) throw Error(M.NO_VALID_STREAM_EVENTS_SENT);
3552
- (e = this._elements.bubbleElement) != null && e.classList.contains(bt.MESSAGE_CLASS) && (this._streamType === "text" ? this._messages.textToSpeech && St.speak(this._message.text || "", this._messages.textToSpeech) : this._streamType === "html" && this._elements && ie.apply(this._messages, this._elements.outerContainer), this._elements.bubbleElement.classList.remove(bt.MESSAGE_CLASS), this._message && this._messages.sendClientUpdate(Ne.createMessageContent(this._message), !1), this._hasStreamEnded = !0);
3560
+ (e = this._elements.bubbleElement) != null && e.classList.contains(bt.MESSAGE_CLASS) && (this._streamType === "text" ? this._messages.textToSpeech && St.speak(this._message.text || "", this._messages.textToSpeech) : this._streamType === "html" && this._elements && se.apply(this._messages, this._elements.outerContainer), this._elements.bubbleElement.classList.remove(bt.MESSAGE_CLASS), this._message && this._messages.sendClientUpdate(De.createMessageContent(this._message), !1), this._hasStreamEnded = !0);
3553
3561
  }
3554
3562
  }
3555
3563
  }, {
@@ -3596,11 +3604,11 @@ var bt = /*#__PURE__*/function () {
3596
3604
  }();
3597
3605
  bt.MESSAGE_CLASS = "streamed-message";
3598
3606
  var _e = bt;
3599
- var Je = /*#__PURE__*/function () {
3600
- function Je() {
3601
- _classCallCheck(this, Je);
3607
+ var Ze = /*#__PURE__*/function () {
3608
+ function Ze() {
3609
+ _classCallCheck(this, Ze);
3602
3610
  }
3603
- return _createClass(Je, null, [{
3611
+ return _createClass(Ze, null, [{
3604
3612
  key: "tempRemoveContentHeader",
3605
3613
  value: // need to pass stringifyBody boolean separately as binding is throwing an error for some reason
3606
3614
  // prettier-ignore
@@ -3616,8 +3624,8 @@ var Je = /*#__PURE__*/function () {
3616
3624
  }
3617
3625
  throw new Error("Request settings have not been set up");
3618
3626
  case 2:
3619
- s = e.headers[Je.CONTENT_TYPE];
3620
- delete e.headers[Je.CONTENT_TYPE];
3627
+ s = e.headers[Ze.CONTENT_TYPE];
3628
+ delete e.headers[Ze.CONTENT_TYPE];
3621
3629
  _context2.prev = 4;
3622
3630
  _context2.next = 7;
3623
3631
  return t(i);
@@ -3628,9 +3636,9 @@ var Je = /*#__PURE__*/function () {
3628
3636
  case 10:
3629
3637
  _context2.prev = 10;
3630
3638
  _context2.t0 = _context2["catch"](4);
3631
- throw e.headers[Je.CONTENT_TYPE] = s, _context2.t0;
3639
+ throw e.headers[Ze.CONTENT_TYPE] = s, _context2.t0;
3632
3640
  case 13:
3633
- return _context2.abrupt("return", (e.headers[Je.CONTENT_TYPE] = s, r));
3641
+ return _context2.abrupt("return", (e.headers[Ze.CONTENT_TYPE] = s, r));
3634
3642
  case 14:
3635
3643
  case "end":
3636
3644
  return _context2.stop();
@@ -3723,8 +3731,8 @@ var Je = /*#__PURE__*/function () {
3723
3731
  }
3724
3732
  }]);
3725
3733
  }();
3726
- Je.CONTENT_TYPE = "Content-Type";
3727
- var E = Je;
3734
+ Ze.CONTENT_TYPE = "Content-Type";
3735
+ var E = Ze;
3728
3736
  function _o(_x12, _x13) {
3729
3737
  return _o2.apply(this, arguments);
3730
3738
  }
@@ -3857,13 +3865,13 @@ function Mo(n, e) {
3857
3865
  P(), h();
3858
3866
  });
3859
3867
  var V = c !== null && c !== void 0 ? c : window.fetch,
3860
- Be = s !== null && s !== void 0 ? s : Ro;
3868
+ Fe = s !== null && s !== void 0 ? s : Ro;
3861
3869
  function I() {
3862
3870
  return _I.apply(this, arguments);
3863
3871
  }
3864
3872
  function _I() {
3865
3873
  _I = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3866
- var X, Y, B;
3874
+ var Y, Q, B;
3867
3875
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3868
3876
  while (1) switch (_context4.prev = _context4.next) {
3869
3877
  case 0:
@@ -3875,12 +3883,12 @@ function Mo(n, e) {
3875
3883
  signal: m.signal
3876
3884
  }));
3877
3885
  case 4:
3878
- Y = _context4.sent;
3886
+ Q = _context4.sent;
3879
3887
  _context4.next = 7;
3880
- return Be(Y);
3888
+ return Fe(Q);
3881
3889
  case 7:
3882
3890
  _context4.next = 9;
3883
- return _o(Y.body, wo(Co(function (B) {
3891
+ return _o(Q.body, wo(Co(function (B) {
3884
3892
  B ? f[Ys] = B : delete f[Ys];
3885
3893
  }, function (B) {
3886
3894
  v = B;
@@ -3895,7 +3903,7 @@ function Mo(n, e) {
3895
3903
  _context4.prev = 14;
3896
3904
  _context4.t0 = _context4["catch"](1);
3897
3905
  if (!m.signal.aborted) try {
3898
- B = (X = a == null ? void 0 : a(_context4.t0)) !== null && X !== void 0 ? X : v;
3906
+ B = (Y = a == null ? void 0 : a(_context4.t0)) !== null && Y !== void 0 ? Y : v;
3899
3907
  window.clearTimeout(y), y = window.setTimeout(I, B);
3900
3908
  } catch (B) {
3901
3909
  P(), u(B);
@@ -3931,7 +3939,7 @@ var A = /*#__PURE__*/function () {
3931
3939
  y,
3932
3940
  P,
3933
3941
  V,
3934
- Be,
3942
+ Fe,
3935
3943
  o,
3936
3944
  _yield$E$processReque,
3937
3945
  a,
@@ -3986,7 +3994,7 @@ var A = /*#__PURE__*/function () {
3986
3994
  return _context7.abrupt("return", (Mo(((P = e.connectSettings) == null ? void 0 : P.url) || e.url || "", {
3987
3995
  method: ((V = e.connectSettings) == null ? void 0 : V.method) || "POST",
3988
3996
  headers: l,
3989
- credentials: (Be = e.connectSettings) == null ? void 0 : Be.credentials,
3997
+ credentials: (Fe = e.connectSettings) == null ? void 0 : Fe.credentials,
3990
3998
  body: s ? JSON.stringify(a) : a,
3991
3999
  openWhenHidden: !0,
3992
4000
  // keep stream open when browser tab not open
@@ -4014,7 +4022,7 @@ var A = /*#__PURE__*/function () {
4014
4022
  },
4015
4023
  onmessage: function onmessage(I) {
4016
4024
  return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
4017
- var X, Y, B, qe, Mt;
4025
+ var Y, Q, B, ze, Mt;
4018
4026
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
4019
4027
  while (1) switch (_context6.prev = _context6.next) {
4020
4028
  case 0:
@@ -4023,25 +4031,25 @@ var A = /*#__PURE__*/function () {
4023
4031
  break;
4024
4032
  }
4025
4033
  try {
4026
- qe = JSON.parse(I.data);
4034
+ ze = JSON.parse(I.data);
4027
4035
  } catch (_unused6) {
4028
- qe = {};
4036
+ ze = {};
4029
4037
  }
4030
4038
  _context6.next = 4;
4031
- return (Y = (X = e.deepChat).responseInterceptor) == null ? void 0 : Y.call(X, qe);
4039
+ return (Q = (Y = e.deepChat).responseInterceptor) == null ? void 0 : Q.call(Y, ze);
4032
4040
  case 4:
4033
4041
  _context6.t0 = _context6.sent;
4034
4042
  if (_context6.t0) {
4035
4043
  _context6.next = 7;
4036
4044
  break;
4037
4045
  }
4038
- _context6.t0 = qe;
4046
+ _context6.t0 = ze;
4039
4047
  case 7:
4040
4048
  Mt = _context6.t0;
4041
- (B = e.extractResultData) == null || B.call(e, Mt, m, a).then(function (ze) {
4042
- e.asyncCallInProgress && ze && ze.text !== "" ? (A.simulate(i, e.streamHandlers, ze), h(), e.asyncCallInProgress = !1) : A.upsertWFiles(i, f.upsertStreamedMessage.bind(f), f, ze);
4043
- })["catch"](function (ze) {
4044
- return E.displayError(i, ze);
4049
+ (B = e.extractResultData) == null || B.call(e, Mt, m, a).then(function (Ge) {
4050
+ e.asyncCallInProgress && Ge && Ge.text !== "" ? (A.simulate(i, e.streamHandlers, Ge), h(), e.asyncCallInProgress = !1) : A.upsertWFiles(i, f.upsertStreamedMessage.bind(f), f, Ge);
4051
+ })["catch"](function (Ge) {
4052
+ return E.displayError(i, Ge);
4045
4053
  });
4046
4054
  case 9:
4047
4055
  case "end":
@@ -4062,11 +4070,11 @@ var A = /*#__PURE__*/function () {
4062
4070
  },
4063
4071
  signal: u.signal
4064
4072
  })["catch"](function (I) {
4065
- var X;
4066
- i.isLastMessageError() || (X = e.extractResultData) == null || X.call(e, I).then(function () {
4073
+ var Y;
4074
+ i.isLastMessageError() || (Y = e.extractResultData) == null || Y.call(e, I).then(function () {
4067
4075
  E.displayError(i, I);
4068
- })["catch"](function (Y) {
4069
- E.displayError(i, Y);
4076
+ })["catch"](function (Q) {
4077
+ E.displayError(i, Q);
4070
4078
  });
4071
4079
  }), f));
4072
4080
  case 21:
@@ -4094,7 +4102,7 @@ var A = /*#__PURE__*/function () {
4094
4102
  }
4095
4103
  if (i.html) {
4096
4104
  t.onOpen();
4097
- var _r2 = ie.splitHTML(i.html);
4105
+ var _r2 = se.splitHTML(i.html);
4098
4106
  _r2.length === 0 && (_r2 = i.html.split("")), A.populateMessages(_r2, new _e(e), s, "html");
4099
4107
  }
4100
4108
  }
@@ -4143,11 +4151,11 @@ var A = /*#__PURE__*/function () {
4143
4151
  }
4144
4152
  }]);
4145
4153
  }();
4146
- var Ze = /*#__PURE__*/function () {
4147
- function Ze() {
4148
- _classCallCheck(this, Ze);
4154
+ var Xe = /*#__PURE__*/function () {
4155
+ function Xe() {
4156
+ _classCallCheck(this, Xe);
4149
4157
  }
4150
- return _createClass(Ze, null, [{
4158
+ return _createClass(Xe, null, [{
4151
4159
  key: "generateResponse",
4152
4160
  value: function generateResponse(e) {
4153
4161
  var t = e[e.length - 1][0];
@@ -4172,15 +4180,15 @@ var Ze = /*#__PURE__*/function () {
4172
4180
  value: function getResponse(_ref3) {
4173
4181
  var e = _ref3.customDemoResponse,
4174
4182
  t = _ref3.messageToElements;
4175
- return e ? Ze.getCustomResponse(e, t[t.length - 1][0]) : {
4176
- text: Ze.generateResponse(t)
4183
+ return e ? Xe.getCustomResponse(e, t[t.length - 1][0]) : {
4184
+ text: Xe.generateResponse(t)
4177
4185
  };
4178
4186
  }
4179
4187
  // timeout is used to simulate a timeout for a response to come back
4180
4188
  }, {
4181
4189
  key: "request",
4182
4190
  value: function request(e, t) {
4183
- var i = Ze.getResponse(t);
4191
+ var i = Xe.getResponse(t);
4184
4192
  setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
4185
4193
  var r, o, s;
4186
4194
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
@@ -4210,14 +4218,14 @@ var Ze = /*#__PURE__*/function () {
4210
4218
  key: "requestStream",
4211
4219
  value: function requestStream(e, t) {
4212
4220
  setTimeout(function () {
4213
- var i = Ze.getResponse(e);
4221
+ var i = Xe.getResponse(e);
4214
4222
  A.simulate(e, t, i);
4215
4223
  }, 400);
4216
4224
  }
4217
4225
  }]);
4218
4226
  }();
4219
- Ze.URL = "deep-chat-demo";
4220
- var we = Ze;
4227
+ Xe.URL = "deep-chat-demo";
4228
+ var we = Xe;
4221
4229
  var U = /*#__PURE__*/function () {
4222
4230
  function U() {
4223
4231
  _classCallCheck(this, U);
@@ -4482,7 +4490,7 @@ var Ie = /*#__PURE__*/function () {
4482
4490
  value: function attemptToFinaliseStream(e, t) {
4483
4491
  try {
4484
4492
  var i = t.messageElementRefs[t.messageElementRefs.length - 1];
4485
- Ne.isLoadingMessage(i) ? t.removeLastMessage() : e.finaliseStreamedMessage();
4493
+ De.isLoadingMessage(i) ? t.removeLastMessage() : e.finaliseStreamedMessage();
4486
4494
  } catch (i) {
4487
4495
  console.error(i), t.addNewErrorMessage("service", i);
4488
4496
  }
@@ -4891,7 +4899,7 @@ var vt = /*#__PURE__*/function () {
4891
4899
  return _regeneratorRuntime().wrap(function _callee19$(_context19) {
4892
4900
  while (1) switch (_context19.prev = _context19.next) {
4893
4901
  case 0:
4894
- t = tt.addMessage(this._messages);
4902
+ t = Ne.addMessage(this._messages);
4895
4903
  _context19.next = 3;
4896
4904
  return e();
4897
4905
  case 3:
@@ -4922,7 +4930,7 @@ var vt = /*#__PURE__*/function () {
4922
4930
  i = _this$_messages.messageToElements,
4923
4931
  s = _this$_messages.elementRef,
4924
4932
  r = (a = t.find(function (l) {
4925
- return !l.outerContainer.classList.contains(Ne.INTRO_CLASS);
4933
+ return !l.outerContainer.classList.contains(De.INTRO_CLASS);
4926
4934
  })) == null ? void 0 : a.outerContainer,
4927
4935
  o = s.scrollTop;
4928
4936
  e == null || e.reverse().map(function (l) {
@@ -4969,7 +4977,7 @@ var vt = /*#__PURE__*/function () {
4969
4977
  break;
4970
4978
  }
4971
4979
  _this10._isLoading = !0;
4972
- t = tt.addMessage(_this10._messages, !1);
4980
+ t = Ne.addMessage(_this10._messages, !1);
4973
4981
  _context20.prev = 3;
4974
4982
  _context20.next = 6;
4975
4983
  return e(_this10._index++);
@@ -5004,7 +5012,7 @@ var vt = /*#__PURE__*/function () {
5004
5012
  value: function populateInitialHistory(e) {
5005
5013
  var _this11 = this;
5006
5014
  e.forEach(function (t) {
5007
- ne.processHistoryFile(t), _this11._messages.addNewMessage(t, !0);
5015
+ X.processHistoryFile(t), _this11._messages.addNewMessage(t, !0);
5008
5016
  });
5009
5017
  }
5010
5018
  }, {
@@ -5017,7 +5025,7 @@ var vt = /*#__PURE__*/function () {
5017
5025
  while (1) switch (_context22.prev = _context22.next) {
5018
5026
  case 0:
5019
5027
  this._isLoading = !0;
5020
- t = tt.addMessage(this._messages);
5028
+ t = Ne.addMessage(this._messages);
5021
5029
  _context22.prev = 2;
5022
5030
  _context22.next = 5;
5023
5031
  return e(this._index++);
@@ -5055,7 +5063,7 @@ var vt = /*#__PURE__*/function () {
5055
5063
  while (1) switch (_context23.prev = _context23.next) {
5056
5064
  case 0:
5057
5065
  e.loadHistory && this.loadInitialHistory(e.loadHistory);
5058
- t = e.history || ne.processHistory(e);
5066
+ t = e.history || X.processHistory(e);
5059
5067
  t && (this.populateInitialHistory(t), this._index += 1);
5060
5068
  case 3:
5061
5069
  case "end":
@@ -5127,7 +5135,7 @@ var O = /*#__PURE__*/function () {
5127
5135
  files: t
5128
5136
  };
5129
5137
  if (_typeof(s) == "object") {
5130
- ne.processFileConfigConnect(s);
5138
+ X.processFileConfigConnect(s);
5131
5139
  var a = s.files,
5132
5140
  l = s.connect,
5133
5141
  c = s.button;
@@ -5226,7 +5234,7 @@ var nt = /*#__PURE__*/function () {
5226
5234
  var _a$url;
5227
5235
  _classCallCheck(this, nt);
5228
5236
  var s, r, o, a, l;
5229
- this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = nt.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, O.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 = we.URL), this.connectSettings.websocket && U.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || ne.checkForStream(this.deepChat), e.loadHistory && Vt.addErrorPrefix(this);
5237
+ this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = nt.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, O.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 = we.URL), this.connectSettings.websocket && U.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || X.checkForStream(this.deepChat), e.loadHistory && Vt.addErrorPrefix(this);
5230
5238
  }
5231
5239
  return _createClass(nt, [{
5232
5240
  key: "verifyKey",
@@ -5390,7 +5398,7 @@ var nt = /*#__PURE__*/function () {
5390
5398
  _context29.next = 4;
5391
5399
  break;
5392
5400
  }
5393
- return _context29.abrupt("return", ne.handleResponseProperty(e));
5401
+ return _context29.abrupt("return", X.handleResponseProperty(e));
5394
5402
  case 4:
5395
5403
  if (!E.validateResponseFormat(e)) {
5396
5404
  _context29.next = 6;
@@ -5555,32 +5563,32 @@ ke._attributes_ = {}, ke._attributeToProperty_ = {};
5555
5563
  var fs = ke;
5556
5564
  var Io = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path d=\"\n\t\t\tM669.727,273.516c-22.891-2.476-46.15-3.895-69.727-4.248c-103.025,0.457-209.823,25.517-310.913,73.536\n\t\t\tc-75.058,37.122-148.173,89.529-211.67,154.174C46.232,529.978,6.431,577.76,0,628.74c0.76,44.162,48.153,98.67,77.417,131.764\n\t\t\tc59.543,62.106,130.754,113.013,211.67,154.174c2.75,1.335,5.51,2.654,8.276,3.955l-75.072,131.102l102.005,60.286l551.416-960.033\n\t\t\tl-98.186-60.008L669.727,273.516z M902.563,338.995l-74.927,129.857c34.47,44.782,54.932,100.006,54.932,159.888\n\t\t\tc0,149.257-126.522,270.264-282.642,270.264c-6.749,0-13.29-0.728-19.922-1.172l-49.585,85.84c22.868,2.449,45.99,4.233,69.58,4.541\n\t\t\tc103.123-0.463,209.861-25.812,310.84-73.535c75.058-37.122,148.246-89.529,211.743-154.174\n\t\t\tc31.186-32.999,70.985-80.782,77.417-131.764c-0.76-44.161-48.153-98.669-77.417-131.763\n\t\t\tc-59.543-62.106-130.827-113.013-211.743-154.175C908.108,341.478,905.312,340.287,902.563,338.995L902.563,338.995z\n\t\t\tM599.927,358.478c6.846,0,13.638,0.274,20.361,0.732l-58.081,100.561c-81.514,16.526-142.676,85.88-142.676,168.897\n\t\t\tc0,20.854,3.841,40.819,10.913,59.325c0.008,0.021-0.008,0.053,0,0.074l-58.228,100.854\n\t\t\tc-34.551-44.823-54.932-100.229-54.932-160.182C317.285,479.484,443.808,358.477,599.927,358.478L599.927,358.478z M768.896,570.513\n\t\t\tL638.013,797.271c81.076-16.837,141.797-85.875,141.797-168.603C779.81,608.194,775.724,588.729,768.896,570.513L768.896,570.513z\"\n\t\t\t/>\n</svg>\n",
5557
5565
  Lo = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path id=\"path6686\" inkscape:connector-curvature=\"0\" d=\"M779.843,599.925c0,95.331-80.664,172.612-180.169,172.612\n\t\t\tc-99.504,0-180.168-77.281-180.168-172.612c0-95.332,80.664-172.612,180.168-172.612\n\t\t\tC699.179,427.312,779.843,504.594,779.843,599.925z M600,240.521c-103.025,0.457-209.814,25.538-310.904,73.557\n\t\t\tc-75.058,37.122-148.206,89.496-211.702,154.141C46.208,501.218,6.431,549,0,599.981c0.76,44.161,48.13,98.669,77.394,131.763\n\t\t\tc59.543,62.106,130.786,113.018,211.702,154.179c94.271,45.751,198.616,72.092,310.904,73.557\n\t\t\tc103.123-0.464,209.888-25.834,310.866-73.557c75.058-37.122,148.243-89.534,211.74-154.179\n\t\t\tc31.185-32.999,70.962-80.782,77.394-131.763c-0.76-44.161-48.13-98.671-77.394-131.764\n\t\t\tc-59.543-62.106-130.824-112.979-211.74-154.141C816.644,268.36,712.042,242.2,600,240.521z M599.924,329.769\n\t\t\tc156.119,0,282.675,120.994,282.675,270.251c0,149.256-126.556,270.25-282.675,270.25S317.249,749.275,317.249,600.02\n\t\t\tC317.249,450.763,443.805,329.769,599.924,329.769L599.924,329.769z\"/>\n</svg>\n";
5558
- var se = /*#__PURE__*/function () {
5559
- function se() {
5560
- _classCallCheck(this, se);
5566
+ var ne = /*#__PURE__*/function () {
5567
+ function ne() {
5568
+ _classCallCheck(this, ne);
5561
5569
  }
5562
- return _createClass(se, null, [{
5570
+ return _createClass(ne, null, [{
5563
5571
  key: "createSVGElement",
5564
5572
  value: function createSVGElement(e) {
5565
5573
  return new DOMParser().parseFromString(e, "image/svg+xml").documentElement;
5566
5574
  }
5567
5575
  }]);
5568
5576
  }();
5569
- var Fe = /*#__PURE__*/function () {
5570
- function Fe() {
5571
- _classCallCheck(this, Fe);
5577
+ var Ue = /*#__PURE__*/function () {
5578
+ function Ue() {
5579
+ _classCallCheck(this, Ue);
5572
5580
  }
5573
- return _createClass(Fe, null, [{
5581
+ return _createClass(Ue, null, [{
5574
5582
  key: "changeVisibility",
5575
5583
  value:
5576
5584
  // prettier-ignore
5577
5585
  function changeVisibility(e, t, i, s) {
5578
- s.target.id === Fe.VISIBLE_ICON_ID ? (t.style.display = "none", i.style.display = "block", e.type = "password") : (t.style.display = "block", i.style.display = "none", e.type = "text");
5586
+ s.target.id === Ue.VISIBLE_ICON_ID ? (t.style.display = "none", i.style.display = "block", e.type = "password") : (t.style.display = "block", i.style.display = "none", e.type = "text");
5579
5587
  }
5580
5588
  }, {
5581
5589
  key: "createIconElement",
5582
5590
  value: function createIconElement(e, t) {
5583
- var i = se.createSVGElement(e);
5591
+ var i = ne.createSVGElement(e);
5584
5592
  return i.id = t, i.classList.add("visibility-icon"), i;
5585
5593
  }
5586
5594
  // prettier-ignore
@@ -5589,15 +5597,15 @@ var Fe = /*#__PURE__*/function () {
5589
5597
  value: function create(e) {
5590
5598
  var t = document.createElement("div");
5591
5599
  t.id = "visibility-icon-container";
5592
- var i = Fe.createIconElement(Lo, Fe.VISIBLE_ICON_ID);
5600
+ var i = Ue.createIconElement(Lo, Ue.VISIBLE_ICON_ID);
5593
5601
  i.style.display = "none", t.appendChild(i);
5594
- var s = Fe.createIconElement(Io, "not-visible-icon");
5595
- return t.appendChild(s), t.onclick = Fe.changeVisibility.bind(this, e, i, s), t;
5602
+ var s = Ue.createIconElement(Io, "not-visible-icon");
5603
+ return t.appendChild(s), t.onclick = Ue.changeVisibility.bind(this, e, i, s), t;
5596
5604
  }
5597
5605
  }]);
5598
5606
  }();
5599
- Fe.VISIBLE_ICON_ID = "visible-icon";
5600
- var ps = Fe;
5607
+ Ue.VISIBLE_ICON_ID = "visible-icon";
5608
+ var ps = Ue;
5601
5609
  var H = /*#__PURE__*/function () {
5602
5610
  function H() {
5603
5611
  _classCallCheck(this, H);
@@ -5725,25 +5733,25 @@ var H = /*#__PURE__*/function () {
5725
5733
  }
5726
5734
  }]);
5727
5735
  }();
5728
- var ee = /*#__PURE__*/function () {
5729
- function ee() {
5730
- _classCallCheck(this, ee);
5736
+ var te = /*#__PURE__*/function () {
5737
+ function te() {
5738
+ _classCallCheck(this, te);
5731
5739
  }
5732
- return _createClass(ee, null, [{
5740
+ return _createClass(te, null, [{
5733
5741
  key: "enableButtons",
5734
5742
  value: function enableButtons(e, t) {
5735
5743
  var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
5736
5744
  window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i < $t.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
5737
- return ee.enableButtons(e, t, i + 1);
5745
+ return te.enableButtons(e, t, i + 1);
5738
5746
  }, 250);
5739
5747
  }
5740
5748
  // prettier-ignore
5741
5749
  }, {
5742
5750
  key: "setUpInitial",
5743
5751
  value: function setUpInitial(e, t, i, s) {
5744
- var r = (t == null ? void 0 : t.downloadClass) || ee.DOWNLOAD_BUTTON_CLASS,
5745
- o = (t == null ? void 0 : t.uploadClass) || ee.UPLOAD_BUTTON_CLASS,
5746
- a = (t == null ? void 0 : t.fileInputClass) || ee.FILE_INPUT_CLASS;
5752
+ var r = (t == null ? void 0 : t.downloadClass) || te.DOWNLOAD_BUTTON_CLASS,
5753
+ o = (t == null ? void 0 : t.uploadClass) || te.UPLOAD_BUTTON_CLASS,
5754
+ a = (t == null ? void 0 : t.fileInputClass) || te.FILE_INPUT_CLASS;
5747
5755
  return setTimeout(function () {
5748
5756
  var l = i == null ? void 0 : i.getElementsByClassName(r)[0],
5749
5757
  c = i == null ? void 0 : i.getElementsByClassName(a)[0],
@@ -5754,7 +5762,7 @@ var ee = /*#__PURE__*/function () {
5754
5762
  c.files && c.files.length > 0 && e(c.files);
5755
5763
  }), d && (d.onclick = function () {
5756
5764
  return c.click();
5757
- }), (l || d) && ee.enableButtons(l, d);
5765
+ }), (l || d) && te.enableButtons(l, d);
5758
5766
  }), (t == null ? void 0 : t.initialHtml) || "<div>\n Download or upload a web model that will run entirely on your browser: <br/> \n <button disabled class=\"".concat(r, " deep-chat-button deep-chat-web-model-button\">Download</button>\n ").concat(s ? "" : "<input type=\"file\" class=\"".concat(a, "\" hidden multiple />\n <button disabled class=\"").concat(o, " deep-chat-button deep-chat-web-model-button\">Upload</button>"), "\n </div>");
5759
5767
  }
5760
5768
  }, {
@@ -5779,18 +5787,18 @@ var ee = /*#__PURE__*/function () {
5779
5787
  }, {
5780
5788
  key: "setUpAfterLoad",
5781
5789
  value: function setUpAfterLoad(e, t, i, s) {
5782
- var r = (t == null ? void 0 : t.exportFilesClass) || ee.EXPORT_BUTTON_CLASS;
5790
+ var r = (t == null ? void 0 : t.exportFilesClass) || te.EXPORT_BUTTON_CLASS;
5783
5791
  return setTimeout(function () {
5784
5792
  var o = i == null ? void 0 : i.getElementsByClassName(r)[0];
5785
5793
  o && (o.onclick = function () {
5786
- return ee.exportFile(e);
5794
+ return te.exportFile(e);
5787
5795
  });
5788
5796
  }), (t == null ? void 0 : t.afterLoadHtml) || "<div>\n Model loaded successfully and has been cached for future requests.\n ".concat(s ? "" : "<br/> <button style=\"margin-top: 5px\" class=\"".concat(r, " deep-chat-button\">Export</button>"), "\n </div>");
5789
5797
  }
5790
5798
  }]);
5791
5799
  }();
5792
- ee.DOWNLOAD_BUTTON_CLASS = "deep-chat-download-button", ee.UPLOAD_BUTTON_CLASS = "deep-chat-upload-button", ee.FILE_INPUT_CLASS = "deep-chat-file-input", ee.EXPORT_BUTTON_CLASS = "deep-chat-export-button";
5793
- var bi = ee;
5800
+ te.DOWNLOAD_BUTTON_CLASS = "deep-chat-download-button", te.UPLOAD_BUTTON_CLASS = "deep-chat-upload-button", te.FILE_INPUT_CLASS = "deep-chat-file-input", te.EXPORT_BUTTON_CLASS = "deep-chat-export-button";
5801
+ var bi = te;
5794
5802
  var Qs = {
5795
5803
  model_list: [
5796
5804
  // Llama-2
@@ -6533,8 +6541,8 @@ var Ut = /*#__PURE__*/function (_G) {
6533
6541
  }]);
6534
6542
  }(G);
6535
6543
  Ut.URL_PREFIX = "https://api-inference.huggingface.co/models/";
6536
- var De = Ut;
6537
- var Qt = /*#__PURE__*/function (_De) {
6544
+ var Be = Ut;
6545
+ var Qt = /*#__PURE__*/function (_Be) {
6538
6546
  // prettier-ignore
6539
6547
  function Qt(e, t, i, s, r, o) {
6540
6548
  var _this22;
@@ -6542,7 +6550,7 @@ var Qt = /*#__PURE__*/function (_De) {
6542
6550
  _this22 = _callSuper(this, Qt, [e, t, i, s, r, o]), _this22.isTextInputDisabled = !0, _this22.canSendMessage = Qt.canSendFile;
6543
6551
  return _this22;
6544
6552
  }
6545
- _inherits(Qt, _De);
6553
+ _inherits(Qt, _Be);
6546
6554
  return _createClass(Qt, [{
6547
6555
  key: "preprocessBody",
6548
6556
  value: function preprocessBody(e, t, i) {
@@ -6586,7 +6594,7 @@ var Qt = /*#__PURE__*/function (_De) {
6586
6594
  return !!(t != null && t[0]);
6587
6595
  }
6588
6596
  }]);
6589
- }(De);
6597
+ }(Be);
6590
6598
  var Po = /*#__PURE__*/function (_Qt) {
6591
6599
  // prettier-ignore
6592
6600
  function Po(e) {
@@ -6989,7 +6997,7 @@ var No = /*#__PURE__*/function (_Qt3) {
6989
6997
  }()
6990
6998
  }]);
6991
6999
  }(Qt);
6992
- var Do = /*#__PURE__*/function (_De2) {
7000
+ var Do = /*#__PURE__*/function (_Be2) {
6993
7001
  function Do(e) {
6994
7002
  _classCallCheck(this, Do);
6995
7003
  var s, r, o;
@@ -6997,7 +7005,7 @@ var Do = /*#__PURE__*/function (_De2) {
6997
7005
  i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
6998
7006
  return _callSuper(this, Do, [e, "Once upon a time", "gpt2", t, i]);
6999
7007
  }
7000
- _inherits(Do, _De2);
7008
+ _inherits(Do, _Be2);
7001
7009
  return _createClass(Do, [{
7002
7010
  key: "extractResultData",
7003
7011
  value: function () {
@@ -7027,8 +7035,8 @@ var Do = /*#__PURE__*/function (_De2) {
7027
7035
  return extractResultData;
7028
7036
  }()
7029
7037
  }]);
7030
- }(De);
7031
- var Bo = /*#__PURE__*/function (_De3) {
7038
+ }(Be);
7039
+ var Bo = /*#__PURE__*/function (_Be3) {
7032
7040
  function Bo(e) {
7033
7041
  var _this26;
7034
7042
  _classCallCheck(this, Bo);
@@ -7038,7 +7046,7 @@ var Bo = /*#__PURE__*/function (_De3) {
7038
7046
  _this26 = _callSuper(this, Bo, [e, "Ask a question", "bert-large-uncased-whole-word-masking-finetuned-squad", t, i]), _this26.permittedErrorPrefixes = ["Authorization header", "Error in"], _this26.context = t.context;
7039
7047
  return _this26;
7040
7048
  }
7041
- _inherits(Bo, _De3);
7049
+ _inherits(Bo, _Be3);
7042
7050
  return _createClass(Bo, [{
7043
7051
  key: "preprocessBody",
7044
7052
  value: function preprocessBody(e, t) {
@@ -7081,8 +7089,8 @@ var Bo = /*#__PURE__*/function (_De3) {
7081
7089
  return extractResultData;
7082
7090
  }()
7083
7091
  }]);
7084
- }(De);
7085
- var Fo = /*#__PURE__*/function (_De4) {
7092
+ }(Be);
7093
+ var Fo = /*#__PURE__*/function (_Be4) {
7086
7094
  function Fo(e) {
7087
7095
  _classCallCheck(this, Fo);
7088
7096
  var s, r, o;
@@ -7090,7 +7098,7 @@ var Fo = /*#__PURE__*/function (_De4) {
7090
7098
  i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
7091
7099
  return _callSuper(this, Fo, [e, "Insert text to summarize", "facebook/bart-large-cnn", t, i]);
7092
7100
  }
7093
- _inherits(Fo, _De4);
7101
+ _inherits(Fo, _Be4);
7094
7102
  return _createClass(Fo, [{
7095
7103
  key: "extractResultData",
7096
7104
  value: function () {
@@ -7120,8 +7128,8 @@ var Fo = /*#__PURE__*/function (_De4) {
7120
7128
  return extractResultData;
7121
7129
  }()
7122
7130
  }]);
7123
- }(De);
7124
- var Uo = /*#__PURE__*/function (_De5) {
7131
+ }(Be);
7132
+ var Uo = /*#__PURE__*/function (_Be5) {
7125
7133
  function Uo(e) {
7126
7134
  var _this27$maxMessages;
7127
7135
  var _this27;
@@ -7133,7 +7141,7 @@ var Uo = /*#__PURE__*/function (_De5) {
7133
7141
  return _this27;
7134
7142
  }
7135
7143
  // prettier-ignore
7136
- _inherits(Uo, _De5);
7144
+ _inherits(Uo, _Be5);
7137
7145
  return _createClass(Uo, [{
7138
7146
  key: "processMessages",
7139
7147
  value: function processMessages(e) {
@@ -7202,7 +7210,7 @@ var Uo = /*#__PURE__*/function (_De5) {
7202
7210
  return extractResultData;
7203
7211
  }()
7204
7212
  }]);
7205
- }(De);
7213
+ }(Be);
7206
7214
  var Si = /*#__PURE__*/function (_Ui3) {
7207
7215
  function Si(e) {
7208
7216
  var _this28;
@@ -7310,7 +7318,7 @@ var Si = /*#__PURE__*/function (_Ui3) {
7310
7318
  }
7311
7319
  }]);
7312
7320
  }(Ui);
7313
- var jo = /*#__PURE__*/function (_De6) {
7321
+ var jo = /*#__PURE__*/function (_Be6) {
7314
7322
  function jo(e) {
7315
7323
  _classCallCheck(this, jo);
7316
7324
  var s, r, o;
@@ -7318,7 +7326,7 @@ var jo = /*#__PURE__*/function (_De6) {
7318
7326
  i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
7319
7327
  return _callSuper(this, jo, [e, "Insert text to translate", "Helsinki-NLP/opus-tatoeba-en-ja", t, i]);
7320
7328
  }
7321
- _inherits(jo, _De6);
7329
+ _inherits(jo, _Be6);
7322
7330
  return _createClass(jo, [{
7323
7331
  key: "extractResultData",
7324
7332
  value: function () {
@@ -7348,7 +7356,7 @@ var jo = /*#__PURE__*/function (_De6) {
7348
7356
  return extractResultData;
7349
7357
  }()
7350
7358
  }]);
7351
- }(De);
7359
+ }(Be);
7352
7360
  var xi = /*#__PURE__*/function (_Ui4) {
7353
7361
  function xi(e) {
7354
7362
  var _this29;
@@ -7442,7 +7450,7 @@ var xi = /*#__PURE__*/function (_Ui4) {
7442
7450
  }
7443
7451
  }]);
7444
7452
  }(Ui);
7445
- var Ho = /*#__PURE__*/function (_De7) {
7453
+ var Ho = /*#__PURE__*/function (_Be7) {
7446
7454
  function Ho(e) {
7447
7455
  var _this30;
7448
7456
  _classCallCheck(this, Ho);
@@ -7452,7 +7460,7 @@ var Ho = /*#__PURE__*/function (_De7) {
7452
7460
  _this30 = _callSuper(this, Ho, [e, "The goal of life is [MASK].", "bert-base-uncased", t, i]), _this30.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>Insert a sentence with the word [MASK] and the model will try to fill it for you. E.g. I want [MASK].</p>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this30.permittedErrorPrefixes = ["Authorization header", "No mask_token"];
7453
7461
  return _this30;
7454
7462
  }
7455
- _inherits(Ho, _De7);
7463
+ _inherits(Ho, _Be7);
7456
7464
  return _createClass(Ho, [{
7457
7465
  key: "extractResultData",
7458
7466
  value: function () {
@@ -7482,7 +7490,7 @@ var Ho = /*#__PURE__*/function (_De7) {
7482
7490
  return extractResultData;
7483
7491
  }()
7484
7492
  }]);
7485
- }(De);
7493
+ }(Be);
7486
7494
  var L = /*#__PURE__*/function () {
7487
7495
  function L() {
7488
7496
  _classCallCheck(this, L);
@@ -7550,11 +7558,11 @@ var L = /*#__PURE__*/function () {
7550
7558
  }()
7551
7559
  }]);
7552
7560
  }();
7553
- var te = /*#__PURE__*/function () {
7554
- function te() {
7555
- _classCallCheck(this, te);
7561
+ var ie = /*#__PURE__*/function () {
7562
+ function ie() {
7563
+ _classCallCheck(this, ie);
7556
7564
  }
7557
- return _createClass(te, null, [{
7565
+ return _createClass(ie, null, [{
7558
7566
  key: "storeFiles",
7559
7567
  value: function () {
7560
7568
  var _storeFiles = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee62(e, t, i, s) {
@@ -7648,7 +7656,7 @@ var te = /*#__PURE__*/function () {
7648
7656
  d({
7649
7657
  src: u.target.result,
7650
7658
  name: t[c].name,
7651
- type: te.getType(t, c)
7659
+ type: ie.getType(t, c)
7652
7660
  });
7653
7661
  };
7654
7662
  });
@@ -7690,7 +7698,7 @@ var te = /*#__PURE__*/function () {
7690
7698
  break;
7691
7699
  }
7692
7700
  _context64.next = 5;
7693
- return te.getFiles(e, t, a, l);
7701
+ return ie.getFiles(e, t, a, l);
7694
7702
  case 5:
7695
7703
  o = _context64.sent;
7696
7704
  (c = r == null ? void 0 : r.text) != null && c.value && o.forEach(function (h, u) {
@@ -7734,7 +7742,7 @@ var te = /*#__PURE__*/function () {
7734
7742
  l.text && l.text.startsWith("sandbox:") && (c = l.file_path) != null && c.file_id && i.push({
7735
7743
  path: l.text,
7736
7744
  fileId: l.file_path.file_id,
7737
- name: te.getFileName(l.text)
7745
+ name: ie.getFileName(l.text)
7738
7746
  });
7739
7747
  });
7740
7748
  }), t != null && t.image_file && i.push({
@@ -7750,9 +7758,9 @@ var te = /*#__PURE__*/function () {
7750
7758
  return _regeneratorRuntime().wrap(function _callee65$(_context65) {
7751
7759
  while (1) switch (_context65.prev = _context65.next) {
7752
7760
  case 0:
7753
- r = te.getFileDetails(t, s);
7761
+ r = ie.getFileDetails(t, s);
7754
7762
  _context65.next = 3;
7755
- return te.getFilesAndNewText(e, r, i, t.role, s);
7763
+ return ie.getFilesAndNewText(e, r, i, t.role, s);
7756
7764
  case 3:
7757
7765
  return _context65.abrupt("return", _context65.sent);
7758
7766
  case 4:
@@ -7796,7 +7804,7 @@ var te = /*#__PURE__*/function () {
7796
7804
  return _regeneratorRuntime().wrap(function _callee66$(_context66) {
7797
7805
  while (1) switch (_context66.prev = _context66.next) {
7798
7806
  case 0:
7799
- s.push(te.getFilesAndText(e, r, i, o));
7807
+ s.push(ie.getFilesAndText(e, r, i, o));
7800
7808
  case 1:
7801
7809
  case "end":
7802
7810
  return _context66.stop();
@@ -7825,7 +7833,7 @@ var te = /*#__PURE__*/function () {
7825
7833
  return _regeneratorRuntime().wrap(function _callee68$(_context68) {
7826
7834
  while (1) switch (_context68.prev = _context68.next) {
7827
7835
  case 0:
7828
- return _context68.abrupt("return", te.parseMessages(e, [{
7836
+ return _context68.abrupt("return", ie.parseMessages(e, [{
7829
7837
  content: t,
7830
7838
  role: "assistant"
7831
7839
  }], i));
@@ -7848,8 +7856,8 @@ var te = /*#__PURE__*/function () {
7848
7856
  return _regeneratorRuntime().wrap(function _callee69$(_context69) {
7849
7857
  while (1) switch (_context69.prev = _context69.next) {
7850
7858
  case 0:
7851
- r = te.parseResult(t, i);
7852
- return _context69.abrupt("return", te.parseMessages(e, r, s));
7859
+ r = ie.parseResult(t, i);
7860
+ return _context69.abrupt("return", ie.parseMessages(e, r, s));
7853
7861
  case 2:
7854
7862
  case "end":
7855
7863
  return _context69.stop();
@@ -7863,14 +7871,14 @@ var te = /*#__PURE__*/function () {
7863
7871
  }()
7864
7872
  }]);
7865
7873
  }();
7866
- te.FILES_WITH_TEXT_ERROR = "content with type `text` must have `text` values", te.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.";
7867
- var Te = te;
7868
- var Ue = /*#__PURE__*/function (_G3) {
7874
+ ie.FILES_WITH_TEXT_ERROR = "content with type `text` must have `text` values", ie.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.";
7875
+ var Te = ie;
7876
+ var je = /*#__PURE__*/function (_G3) {
7869
7877
  // prettier-ignore
7870
- function Ue(e, t, i, s, r, o) {
7878
+ function je(e, t, i, s, r, o) {
7871
7879
  var _this31;
7872
- _classCallCheck(this, Ue);
7873
- if (_this31 = _callSuper(this, Ue, [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", Vt.FAILED_ERROR_MESSAGE], _this31.shouldFetchHistory = !1, _this31.searchedForThreadId = !1, _this31.config = {}, _this31.newAssistantDetails = {
7880
+ _classCallCheck(this, je);
7881
+ if (_this31 = _callSuper(this, je, [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", Vt.FAILED_ERROR_MESSAGE], _this31.shouldFetchHistory = !1, _this31.searchedForThreadId = !1, _this31.config = {}, _this31.newAssistantDetails = {
7874
7882
  model: "gpt-4"
7875
7883
  }, _this31.waitingForStreamResponse = !1, _this31.isSSEStream = !1, _this31.urlSegments = i, _typeof(t) == "object") {
7876
7884
  _this31.config = t;
@@ -7883,8 +7891,8 @@ var Ue = /*#__PURE__*/function (_G3) {
7883
7891
  _this31.maxMessages = 1, _this31.isSSEStream = !!(_this31.stream && (_typeof(_this31.stream) != "object" || !_this31.stream.simulation));
7884
7892
  return _assertThisInitialized(_this31);
7885
7893
  }
7886
- _inherits(Ue, _G3);
7887
- return _createClass(Ue, [{
7894
+ _inherits(je, _G3);
7895
+ return _createClass(je, [{
7888
7896
  key: "fetchHistoryFunc",
7889
7897
  value: function () {
7890
7898
  var _fetchHistoryFunc = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee70() {
@@ -7933,13 +7941,13 @@ var Ue = /*#__PURE__*/function (_G3) {
7933
7941
  }));
7934
7942
  a === "code_interpreter" || a === "file_search" || a === "images" ? r = a : (console.error("Tool type \"".concat(a, "\" is not valid")), console.error('Expected "code_interpreter" or "file_search" or "images". Going to default to "images"'));
7935
7943
  }
7936
- if (r === "file_search") return Ue.processAttachmentsMessage(s, t, "file_search");
7937
- if (r === "code_interpreter") return Ue.processAttachmentsMessage(s, t, "code_interpreter");
7944
+ if (r === "file_search") return je.processAttachmentsMessage(s, t, "file_search");
7945
+ if (r === "code_interpreter") return je.processAttachmentsMessage(s, t, "code_interpreter");
7938
7946
  if (t.find(function (_ref20) {
7939
7947
  var a = _ref20.name;
7940
7948
  return !j.isImageFileExtension(a);
7941
7949
  })) 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 {
7942
- var _a2 = Ue.processImageMessage(s, t);
7950
+ var _a2 = je.processImageMessage(s, t);
7943
7951
  if (_a2) return _a2;
7944
7952
  }
7945
7953
  }
@@ -8205,7 +8213,7 @@ var Ue = /*#__PURE__*/function (_G3) {
8205
8213
  break;
8206
8214
  }
8207
8215
  return _context76.abrupt("return", {
8208
- timeoutMS: Ue.POLLING_TIMEOUT_MS
8216
+ timeoutMS: je.POLLING_TIMEOUT_MS
8209
8217
  });
8210
8218
  case 3:
8211
8219
  if (!(t === "completed" && this.messages)) {
@@ -8318,7 +8326,7 @@ var Ue = /*#__PURE__*/function (_G3) {
8318
8326
  }, "POST");
8319
8327
  case 22:
8320
8328
  return _context77.abrupt("return", {
8321
- timeoutMS: Ue.POLLING_TIMEOUT_MS
8329
+ timeoutMS: je.POLLING_TIMEOUT_MS
8322
8330
  });
8323
8331
  case 23:
8324
8332
  case "end":
@@ -8513,8 +8521,8 @@ var Ue = /*#__PURE__*/function (_G3) {
8513
8521
  }
8514
8522
  }]);
8515
8523
  }(G);
8516
- Ue.POLLING_TIMEOUT_MS = 800;
8517
- var _i = Ue;
8524
+ je.POLLING_TIMEOUT_MS = 800;
8525
+ var _i = je;
8518
8526
  var Di = /*#__PURE__*/function (_i10) {
8519
8527
  function Di(e) {
8520
8528
  var _o$headers2, _a$OpenAIBeta;
@@ -9503,26 +9511,26 @@ var kn = /*#__PURE__*/function (_G9) {
9503
9511
  _inherits(kn, _G9);
9504
9512
  return _createClass(kn);
9505
9513
  }(G);
9506
- var Xe = /*#__PURE__*/function (_kn) {
9514
+ var Ye = /*#__PURE__*/function (_kn) {
9507
9515
  // prettier-ignore
9508
- function Xe(e) {
9516
+ function Ye(e) {
9509
9517
  var _a$lang, _l$name, _c$gender;
9510
9518
  var _this43;
9511
- _classCallCheck(this, Xe);
9519
+ _classCallCheck(this, Ye);
9512
9520
  var s, r, o, a, l, c;
9513
9521
  var t = (r = (s = e.directConnection) == null ? void 0 : s.azure) == null ? void 0 : r.textToSpeech,
9514
9522
  i = (o = e.directConnection) == null ? void 0 : o.azure;
9515
- _this43 = _callSuper(this, Xe, [e, ue.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, i]), _this43.permittedErrorPrefixes = [Xe.REGION_ERROR_MESSAGE], _this43.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(Xe.HELP_LINK, "\">here</a> for more info.\n </p>"), _this43.isTextInputDisabled = !1, _this43.url = "", t.region ? (Object.assign(_this43.rawBody, t), (_a$lang = (a = _this43.rawBody).lang) !== null && _a$lang !== void 0 ? _a$lang : a.lang = "en-US", (_l$name = (l = _this43.rawBody).name) !== null && _l$name !== void 0 ? _l$name : l.name = "en-US-JennyNeural", (_c$gender = (c = _this43.rawBody).gender) !== null && _c$gender !== void 0 ? _c$gender : c.gender = "Female", _this43.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1")) : (_this43.isTextInputDisabled = !0, _this43.canSendMessage = function () {
9523
+ _this43 = _callSuper(this, Ye, [e, ue.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, i]), _this43.permittedErrorPrefixes = [Ye.REGION_ERROR_MESSAGE], _this43.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(Ye.HELP_LINK, "\">here</a> for more info.\n </p>"), _this43.isTextInputDisabled = !1, _this43.url = "", t.region ? (Object.assign(_this43.rawBody, t), (_a$lang = (a = _this43.rawBody).lang) !== null && _a$lang !== void 0 ? _a$lang : a.lang = "en-US", (_l$name = (l = _this43.rawBody).name) !== null && _l$name !== void 0 ? _l$name : l.name = "en-US-JennyNeural", (_c$gender = (c = _this43.rawBody).gender) !== null && _c$gender !== void 0 ? _c$gender : c.gender = "Female", _this43.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1")) : (_this43.isTextInputDisabled = !0, _this43.canSendMessage = function () {
9516
9524
  return !1;
9517
9525
  }, setTimeout(function () {
9518
9526
  e.addMessage({
9519
- error: Xe.REGION_ERROR_MESSAGE
9527
+ error: Ye.REGION_ERROR_MESSAGE
9520
9528
  });
9521
9529
  }));
9522
9530
  return _this43;
9523
9531
  }
9524
- _inherits(Xe, _kn);
9525
- return _createClass(Xe, [{
9532
+ _inherits(Ye, _kn);
9533
+ return _createClass(Ye, [{
9526
9534
  key: "preprocessBody",
9527
9535
  value: function preprocessBody(e, t) {
9528
9536
  var i = t[t.length - 1].text;
@@ -9586,16 +9594,16 @@ var Xe = /*#__PURE__*/function (_kn) {
9586
9594
  }()
9587
9595
  }]);
9588
9596
  }(kn);
9589
- Xe.HELP_LINK =
9597
+ Ye.HELP_LINK =
9590
9598
  // eslint-disable-next-line max-len
9591
- "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", Xe.REGION_ERROR_MESSAGE =
9599
+ "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", Ye.REGION_ERROR_MESSAGE =
9592
9600
  // eslint-disable-next-line max-len
9593
9601
  "Please define a region config property. [More Information](https://deepchat.dev/docs/directConnection/Azure#TextToSpeech)";
9594
- var Es = Xe;
9595
- var je = /*#__PURE__*/function (_kn2) {
9596
- function je(e) {
9602
+ var Es = Ye;
9603
+ var He = /*#__PURE__*/function (_kn2) {
9604
+ function He(e) {
9597
9605
  var _this44;
9598
- _classCallCheck(this, je);
9606
+ _classCallCheck(this, He);
9599
9607
  var r, o, a;
9600
9608
  var t = (o = (r = e.directConnection) == null ? void 0 : r.azure) == null ? void 0 : o.speechToText,
9601
9609
  i = (a = e.directConnection) == null ? void 0 : a.azure,
@@ -9606,21 +9614,21 @@ var je = /*#__PURE__*/function (_kn2) {
9606
9614
  }
9607
9615
  }
9608
9616
  };
9609
- if (_this44 = _callSuper(this, je, [e, ue.buildSpeechToTextHeaders, t.region, i, s]), _this44.permittedErrorPrefixes = [je.REGION_ERROR_MESSAGE], _this44.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(je.HELP_LINK, "\">here</a> for more info.\n </p>"), _this44.url = "", _this44.isTextInputDisabled = !0, _this44.textInputPlaceholderText = "Upload an audio file", !t.region) _this44.isTextInputDisabled = !0, _this44.canSendMessage = function () {
9617
+ if (_this44 = _callSuper(this, He, [e, ue.buildSpeechToTextHeaders, t.region, i, s]), _this44.permittedErrorPrefixes = [He.REGION_ERROR_MESSAGE], _this44.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(He.HELP_LINK, "\">here</a> for more info.\n </p>"), _this44.url = "", _this44.isTextInputDisabled = !0, _this44.textInputPlaceholderText = "Upload an audio file", !t.region) _this44.isTextInputDisabled = !0, _this44.canSendMessage = function () {
9610
9618
  return !1;
9611
9619
  }, setTimeout(function () {
9612
9620
  e.addMessage({
9613
- error: je.REGION_ERROR_MESSAGE
9621
+ error: He.REGION_ERROR_MESSAGE
9614
9622
  });
9615
9623
  });else {
9616
- _this44.canSendMessage = je.canFileSendMessage;
9624
+ _this44.canSendMessage = He.canFileSendMessage;
9617
9625
  var l = t.lang || "en-US";
9618
9626
  _this44.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(l, "&format=detailed"), _this44.recordAudio = void 0;
9619
9627
  }
9620
9628
  return _assertThisInitialized(_this44);
9621
9629
  }
9622
- _inherits(je, _kn2);
9623
- return _createClass(je, [{
9630
+ _inherits(He, _kn2);
9631
+ return _createClass(He, [{
9624
9632
  key: "callServiceAPI",
9625
9633
  value: function () {
9626
9634
  var _callServiceAPI17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee97(e, t, i) {
@@ -9686,12 +9694,12 @@ var je = /*#__PURE__*/function (_kn2) {
9686
9694
  }
9687
9695
  }]);
9688
9696
  }(kn);
9689
- je.HELP_LINK =
9697
+ He.HELP_LINK =
9690
9698
  // eslint-disable-next-line max-len
9691
- "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", je.REGION_ERROR_MESSAGE =
9699
+ "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", He.REGION_ERROR_MESSAGE =
9692
9700
  // eslint-disable-next-line max-len
9693
9701
  "Please define a region config property. [More Information](https://deepchat.dev/docs/directConnection/Azure#SpeechToText)";
9694
- var Ss = je;
9702
+ var Ss = He;
9695
9703
  var Vo = /*#__PURE__*/function (_G10) {
9696
9704
  // prettier-ignore
9697
9705
  function Vo(e) {
@@ -10585,7 +10593,7 @@ var Jo = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
10585
10593
  t.classList.add("any-file-message-contents");
10586
10594
  var i = document.createElement("div");
10587
10595
  i.classList.add("any-file-message-icon-container");
10588
- var s = se.createSVGElement(Jo);
10596
+ var s = ne.createSVGElement(Jo);
10589
10597
  s.classList.add("any-file-message-icon"), i.appendChild(s);
10590
10598
  var r = document.createElement("div");
10591
10599
  return r.classList.add("any-file-message-text"), r.textContent = e.name || j.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), j.processContent("any", t, e.src, r.textContent);
@@ -10740,7 +10748,7 @@ var Zo = /*#__PURE__*/function () {
10740
10748
  }
10741
10749
  }]);
10742
10750
  }();
10743
- var de = /*#__PURE__*/function (_Ne) {
10751
+ var de = /*#__PURE__*/function (_De) {
10744
10752
  function de(e, t, i) {
10745
10753
  var _this52;
10746
10754
  _classCallCheck(this, de);
@@ -10761,16 +10769,16 @@ var de = /*#__PURE__*/function (_Ne) {
10761
10769
  }), !d);
10762
10770
  }, e.updateMessage = function (c, d) {
10763
10771
  return oe.update(_this52, c, d);
10764
- }, t.isWebModel() && t.setUpMessages(_this52), o && _this52.prepareDemo(o), e.textToSpeech && St.processConfig(e.textToSpeech, function (c) {
10772
+ }, t.isWebModel() && t.setUpMessages(_this52), o && _this52.prepareDemo(X.processDemo(o)), e.textToSpeech && St.processConfig(e.textToSpeech, function (c) {
10765
10773
  _this52.textToSpeech = c;
10766
10774
  });
10767
10775
  return _this52;
10768
10776
  }
10769
- _inherits(de, _Ne);
10777
+ _inherits(de, _De);
10770
10778
  return _createClass(de, [{
10771
10779
  key: "prepareDemo",
10772
10780
  value: function prepareDemo(e) {
10773
- _typeof(e) == "object" && (e.response && (this.customDemoResponse = e.response), e.displayErrors && (e.displayErrors["default"] && this.addNewErrorMessage("", ""), e.displayErrors.service && this.addNewErrorMessage("service", ""), e.displayErrors.speechToText && this.addNewErrorMessage("speechToText", "")), e.displayLoadingBubble && this.addLoadingMessage());
10781
+ _typeof(e) == "object" && (e.response && (this.customDemoResponse = e.response), e.displayLoading && (e.displayLoading.history && (e.displayLoading.history.full && Ne.addMessage(this), e.displayLoading.history.small && Ne.addMessage(this, !1)), e.displayLoading.message && this.addLoadingMessage()), e.displayErrors && (e.displayErrors["default"] && this.addNewErrorMessage("", ""), e.displayErrors.service && this.addNewErrorMessage("service", ""), e.displayErrors.speechToText && this.addNewErrorMessage("speechToText", "")));
10774
10782
  }
10775
10783
  }, {
10776
10784
  key: "addSetupMessageIfNeeded",
@@ -10799,13 +10807,13 @@ var de = /*#__PURE__*/function (_Ne) {
10799
10807
  value: function addIntroductoryMessage(e) {
10800
10808
  var i;
10801
10809
  var t;
10802
- e != null && e.text ? t = this.createAndAppendNewMessageElement(e.text, b.AI_ROLE) : e != null && e.html && (t = Se.add(this, e.html, b.AI_ROLE, this.messageElementRefs)), t && (this.applyCustomStyles(t, b.AI_ROLE, !1, (i = this.messageStyles) == null ? void 0 : i.intro), t.outerContainer.classList.add(Ne.INTRO_CLASS));
10810
+ e != null && e.text ? t = this.createAndAppendNewMessageElement(e.text, b.AI_ROLE) : e != null && e.html && (t = Se.add(this, e.html, b.AI_ROLE, this.messageElementRefs)), t && (this.applyCustomStyles(t, b.AI_ROLE, !1, (i = this.messageStyles) == null ? void 0 : i.intro), t.outerContainer.classList.add(De.INTRO_CLASS));
10803
10811
  }
10804
10812
  }, {
10805
10813
  key: "removeIntroductoryMessage",
10806
10814
  value: function removeIntroductoryMessage() {
10807
10815
  var e = this.messageElementRefs[0];
10808
- e.outerContainer.classList.contains(Ne.INTRO_CLASS) && (e.outerContainer.remove(), this.messageElementRefs.shift());
10816
+ e.outerContainer.classList.contains(De.INTRO_CLASS) && (e.outerContainer.remove(), this.messageElementRefs.shift());
10809
10817
  }
10810
10818
  }, {
10811
10819
  key: "addAnyMessage",
@@ -10913,7 +10921,7 @@ var de = /*#__PURE__*/function (_Ne) {
10913
10921
  }, {
10914
10922
  key: "populateIntroPanel",
10915
10923
  value: function populateIntroPanel(e, t, i) {
10916
- (e || t) && (this._introPanel = new Ti(e, t, i), this._introPanel._elementRef && (ie.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
10924
+ (e || t) && (this._introPanel = new Ti(e, t, i), this._introPanel._elementRef && (se.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
10917
10925
  }
10918
10926
  }, {
10919
10927
  key: "addMultipleFiles",
@@ -10993,10 +11001,10 @@ var de = /*#__PURE__*/function (_Ne) {
10993
11001
  }, {
10994
11002
  key: "isActiveElement",
10995
11003
  value: function isActiveElement(e) {
10996
- return e ? e.contains(Pe.BUBBLE_CLASS) || e.contains(tt.CLASS) || e.contains(_e.MESSAGE_CLASS) : !1;
11004
+ return e ? e.contains(Pe.BUBBLE_CLASS) || e.contains(Ne.CLASS) || e.contains(_e.MESSAGE_CLASS) : !1;
10997
11005
  }
10998
11006
  }]);
10999
- }(Ne);
11007
+ }(De);
11000
11008
  var D = /*#__PURE__*/function () {
11001
11009
  function D() {
11002
11010
  _classCallCheck(this, D);
@@ -11081,7 +11089,7 @@ var K = /*#__PURE__*/function () {
11081
11089
  }, {
11082
11090
  key: "createElement",
11083
11091
  value: function createElement(e, t) {
11084
- return t ? K.createTextElement(e) : se.createSVGElement(e);
11092
+ return t ? K.createTextElement(e) : ne.createSVGElement(e);
11085
11093
  }
11086
11094
  }, {
11087
11095
  key: "createCustomElement",
@@ -11219,14 +11227,14 @@ var Wt = /*#__PURE__*/function () {
11219
11227
  }
11220
11228
  }]);
11221
11229
  }();
11222
- var Ge = /*#__PURE__*/function () {
11223
- function Ge() {
11224
- _classCallCheck(this, Ge);
11230
+ var Ve = /*#__PURE__*/function () {
11231
+ function Ve() {
11232
+ _classCallCheck(this, Ve);
11225
11233
  }
11226
- return _createClass(Ge, null, [{
11234
+ return _createClass(Ve, null, [{
11227
11235
  key: "addItemEvents",
11228
11236
  value: function addItemEvents(e, t, i, s) {
11229
- Ye.add(t, s), t.addEventListener("click", function () {
11237
+ Qe.add(t, s), t.addEventListener("click", function () {
11230
11238
  i.click();
11231
11239
  }), t.addEventListener("mouseenter", function (r) {
11232
11240
  e.highlightedItem = r.target;
@@ -11250,7 +11258,7 @@ var Ge = /*#__PURE__*/function () {
11250
11258
  key: "populateItem",
11251
11259
  value: function populateItem(e, t, i, s) {
11252
11260
  var r = e.children[0];
11253
- r.classList.contains("text-button") ? t.appendChild(Ge.createItemText(r.textContent, s == null ? void 0 : s.text)) : (t.appendChild(Ge.createItemIcon(e, s == null ? void 0 : s.iconContainer)), t.appendChild(Ge.createItemText(i, s == null ? void 0 : s.text)));
11261
+ r.classList.contains("text-button") ? t.appendChild(Ve.createItemText(r.textContent, s == null ? void 0 : s.text)) : (t.appendChild(Ve.createItemIcon(e, s == null ? void 0 : s.iconContainer)), t.appendChild(Ve.createItemText(i, s == null ? void 0 : s.text)));
11254
11262
  }
11255
11263
  // prettier-ignore
11256
11264
  }, {
@@ -11260,13 +11268,13 @@ var Ge = /*#__PURE__*/function () {
11260
11268
  var s = t.elementRef,
11261
11269
  r = t.dropupText,
11262
11270
  o = document.createElement("div");
11263
- Object.assign(o.style, (l = i == null ? void 0 : i.item) == null ? void 0 : l["default"]), Ge.populateItem(s, o, r, i), o.classList.add("dropup-menu-item");
11271
+ Object.assign(o.style, (l = i == null ? void 0 : i.item) == null ? void 0 : l["default"]), Ve.populateItem(s, o, r, i), o.classList.add("dropup-menu-item");
11264
11272
  var a = R.processStateful((i == null ? void 0 : i.item) || {}, {
11265
11273
  backgroundColor: "#f3f3f3"
11266
11274
  }, {
11267
11275
  backgroundColor: "#ebebeb"
11268
11276
  });
11269
- return Ge.addItemEvents(e, o, s, a), o;
11277
+ return Ve.addItemEvents(e, o, s, a), o;
11270
11278
  }
11271
11279
  }]);
11272
11280
  }();
@@ -11297,7 +11305,7 @@ var Ps = /*#__PURE__*/function () {
11297
11305
  }, {
11298
11306
  key: "addItem",
11299
11307
  value: function addItem(e) {
11300
- var t = Ge.createItem(this, e, this._styles);
11308
+ var t = Ve.createItem(this, e, this._styles);
11301
11309
  this.elementRef.appendChild(t);
11302
11310
  }
11303
11311
  // prettier-ignore
@@ -11379,7 +11387,7 @@ var _t = /*#__PURE__*/function (_ti) {
11379
11387
  }, {
11380
11388
  key: "createSVGIconElement",
11381
11389
  value: function createSVGIconElement() {
11382
- return se.createSVGElement(Xo);
11390
+ return ne.createSVGElement(Xo);
11383
11391
  }
11384
11392
  }, {
11385
11393
  key: "createButtonContainer",
@@ -11567,7 +11575,7 @@ var Kt = /*#__PURE__*/function (_ti2) {
11567
11575
  }, {
11568
11576
  key: "createSVGIconElement",
11569
11577
  value: function createSVGIconElement() {
11570
- var e = se.createSVGElement(sa);
11578
+ var e = ne.createSVGElement(sa);
11571
11579
  return e.id = "microphone-icon", e;
11572
11580
  }
11573
11581
  }]);
@@ -11581,21 +11589,21 @@ Object.defineProperty(lt, "__esModule", {
11581
11589
  value: !0
11582
11590
  });
11583
11591
  lt.Text = void 0;
11584
- var He = /*#__PURE__*/function () {
11585
- function He() {
11586
- _classCallCheck(this, He);
11592
+ var qe = /*#__PURE__*/function () {
11593
+ function qe() {
11594
+ _classCallCheck(this, qe);
11587
11595
  }
11588
- return _createClass(He, null, [{
11596
+ return _createClass(qe, null, [{
11589
11597
  key: "capitalize",
11590
11598
  value: function capitalize(e) {
11591
- return e.replace(He.FIRST_CHAR_REGEX, function (t) {
11599
+ return e.replace(qe.FIRST_CHAR_REGEX, function (t) {
11592
11600
  return t.toUpperCase();
11593
11601
  });
11594
11602
  }
11595
11603
  }, {
11596
11604
  key: "lineBreak",
11597
11605
  value: function lineBreak(e) {
11598
- return e.replace(He.DOUBLE_LINE, "<p></p>").replace(He.ONE_LINE, "<br>");
11606
+ return e.replace(qe.DOUBLE_LINE, "<p></p>").replace(qe.ONE_LINE, "<br>");
11599
11607
  }
11600
11608
  }, {
11601
11609
  key: "isCharDefined",
@@ -11610,10 +11618,10 @@ var He = /*#__PURE__*/function () {
11610
11618
  }
11611
11619
  }]);
11612
11620
  }();
11613
- lt.Text = He;
11614
- He.FIRST_CHAR_REGEX = /\S/;
11615
- He.DOUBLE_LINE = /\n\n/g;
11616
- He.ONE_LINE = /\n/g;
11621
+ lt.Text = qe;
11622
+ qe.FIRST_CHAR_REGEX = /\S/;
11623
+ qe.DOUBLE_LINE = /\n\n/g;
11624
+ qe.ONE_LINE = /\n/g;
11617
11625
  Object.defineProperty(ii, "__esModule", {
11618
11626
  value: !0
11619
11627
  });
@@ -13068,7 +13076,7 @@ var _a = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
13068
13076
  i.classList.add("audio-placeholder-text-3-digits");
13069
13077
  var s = document.createElement("div");
13070
13078
  s.classList.add("file-attachment-text-container", "audio-placeholder-text-3-digits-container"), s.appendChild(i);
13071
- var r = se.createSVGElement(bn);
13079
+ var r = ne.createSVGElement(bn);
13072
13080
  return r.classList.add("attachment-icon", "stop-icon", "not-removable-attachment-icon"), i.textContent = "0:00", this._activePlaceholderTimer = this.createTimer(i, e), t.appendChild(s), this.addPlaceholderAudioAttachmentEvents(t, r, s), t;
13073
13081
  }
13074
13082
  }, {
@@ -13124,9 +13132,9 @@ var _a = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
13124
13132
  var i = e.parentElement ? Z.cloneElement(e) : e,
13125
13133
  s = document.createElement("audio");
13126
13134
  s.src = t;
13127
- var r = se.createSVGElement(_a);
13135
+ var r = ne.createSVGElement(_a);
13128
13136
  r.classList.add("attachment-icon", "play-icon");
13129
- var o = se.createSVGElement(bn);
13137
+ var o = ne.createSVGElement(bn);
13130
13138
  o.classList.add("attachment-icon", "stop-icon"), i.replaceChildren(r), s.onplay = function () {
13131
13139
  i.replaceChildren(o);
13132
13140
  }, s.onpause = function () {
@@ -13361,7 +13369,7 @@ var be = /*#__PURE__*/function () {
13361
13369
  value: function createSVGButton(e) {
13362
13370
  var t = document.createElement("div");
13363
13371
  t.classList.add("modal-button", "modal-svg-button");
13364
- var i = se.createSVGElement(e);
13372
+ var i = ne.createSVGElement(e);
13365
13373
  return i.classList.add("modal-svg-button-icon"), t.appendChild(i), t;
13366
13374
  }
13367
13375
  }, {
@@ -13376,7 +13384,7 @@ var be = /*#__PURE__*/function () {
13376
13384
  }]);
13377
13385
  }();
13378
13386
  be.MODAL_CLOSE_TIMEOUT_MS = 190;
13379
- var Qe = be;
13387
+ var et = be;
13380
13388
  var Bt = /*#__PURE__*/function (_ti3) {
13381
13389
  // prettier-ignore
13382
13390
  function Bt(e, t, i, s, r, o) {
@@ -13415,7 +13423,7 @@ var Bt = /*#__PURE__*/function (_ti3) {
13415
13423
  key: "addClickEvent",
13416
13424
  value: function addClickEvent(e, t) {
13417
13425
  var i = this.triggerImportPrompt.bind(this, this._inputElement),
13418
- s = Qe.createTextModalFunc(e, t, i);
13426
+ s = et.createTextModalFunc(e, t, i);
13419
13427
  this.elementRef.onclick = this.click.bind(this, s);
13420
13428
  }
13421
13429
  }, {
@@ -13438,7 +13446,7 @@ var Bt = /*#__PURE__*/function (_ti3) {
13438
13446
  }, {
13439
13447
  key: "createSVGIconElement",
13440
13448
  value: function createSVGIconElement(e, t) {
13441
- var i = se.createSVGElement(t);
13449
+ var i = ne.createSVGElement(t);
13442
13450
  return i.id = e, i;
13443
13451
  }
13444
13452
  }]);
@@ -13496,11 +13504,11 @@ var Re = /*#__PURE__*/function () {
13496
13504
  }
13497
13505
  }]);
13498
13506
  }();
13499
- var Ve = /*#__PURE__*/function () {
13500
- function Ve() {
13501
- _classCallCheck(this, Ve);
13507
+ var $e = /*#__PURE__*/function () {
13508
+ function $e() {
13509
+ _classCallCheck(this, $e);
13502
13510
  }
13503
- return _createClass(Ve, null, [{
13511
+ return _createClass($e, null, [{
13504
13512
  key: "validate",
13505
13513
  value:
13506
13514
  // prettier-ignore
@@ -13524,7 +13532,7 @@ var Ve = /*#__PURE__*/function () {
13524
13532
  o = i.getAllFileData(), a = o == null ? void 0 : o.map(function (l) {
13525
13533
  return l.file;
13526
13534
  });
13527
- return _context118.abrupt("return", Ve.validate(e, s, r, a));
13535
+ return _context118.abrupt("return", $e.validate(e, s, r, a));
13528
13536
  case 5:
13529
13537
  case "end":
13530
13538
  return _context118.stop();
@@ -13547,7 +13555,7 @@ var Ve = /*#__PURE__*/function () {
13547
13555
  s = (r = t.files) == null ? void 0 : r.map(function (o) {
13548
13556
  return o.file;
13549
13557
  });
13550
- return _context119.abrupt("return", Ve.validate(e, i, t.text, s, !0));
13558
+ return _context119.abrupt("return", $e.validate(e, i, t.text, s, !0));
13551
13559
  case 2:
13552
13560
  case "end":
13553
13561
  return _context119.stop();
@@ -13568,21 +13576,21 @@ var Ve = /*#__PURE__*/function () {
13568
13576
  }, {
13569
13577
  key: "attach",
13570
13578
  value: function attach(e, t, i, s, r) {
13571
- var o = e.validateInput || ne.processValidateInput(e);
13579
+ var o = e.validateInput || X.processValidateInput(e);
13572
13580
  e._validationHandler = /*#__PURE__*/function () {
13573
13581
  var _ref33 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee120(a) {
13574
13582
  var l;
13575
13583
  return _regeneratorRuntime().wrap(function _callee120$(_context120) {
13576
13584
  while (1) switch (_context120.prev = _context120.next) {
13577
13585
  case 0:
13578
- if (!(r.status.loadingActive || r.status.requestInProgress || t.isSubmitProgrammaticallyDisabled === !0 || !Ve.validateWebsocket(t, r))) {
13586
+ if (!(r.status.loadingActive || r.status.requestInProgress || t.isSubmitProgrammaticallyDisabled === !0 || !$e.validateWebsocket(t, r))) {
13579
13587
  _context120.next = 2;
13580
13588
  break;
13581
13589
  }
13582
13590
  return _context120.abrupt("return", !1);
13583
13591
  case 2:
13584
13592
  l = o || t.canSendMessage;
13585
- return _context120.abrupt("return", l ? a ? Ve.useValidationFuncProgrammatic(l, a, r) : Ve.useValidationFunc(l, i, s, r) : null);
13593
+ return _context120.abrupt("return", l ? a ? $e.useValidationFuncProgrammatic(l, a, r) : $e.useValidationFunc(l, i, s, r) : null);
13586
13594
  case 4:
13587
13595
  case "end":
13588
13596
  return _context120.stop();
@@ -13709,11 +13717,11 @@ var W = /*#__PURE__*/function () {
13709
13717
  }
13710
13718
  }]);
13711
13719
  }();
13712
- var et = /*#__PURE__*/function () {
13713
- function et() {
13714
- _classCallCheck(this, et);
13720
+ var tt = /*#__PURE__*/function () {
13721
+ function tt() {
13722
+ _classCallCheck(this, tt);
13715
13723
  }
13716
- return _createClass(et, null, [{
13724
+ return _createClass(tt, null, [{
13717
13725
  key: "resetSubmit",
13718
13726
  value: function resetSubmit(e, t) {
13719
13727
  t ? e.unsetCustomStateStyles(["loading", "submit"]) : e.unsetCustomStateStyles(["stop", "loading", "submit"]), e.reapplyStateStyle("submit");
@@ -13729,13 +13737,13 @@ var et = /*#__PURE__*/function () {
13729
13737
  }, {
13730
13738
  key: "setUpDisabledButton",
13731
13739
  value: function setUpDisabledButton(e) {
13732
- W.setPropertyValueIfDoesNotExist(e, ["submit", "container", "default", "backgroundColor"], ""), W.setPropertyValueIfDoesNotExist(e, ["disabled", "container", "default", "backgroundColor"], "unset"), W.setPropertyValueIfDoesNotExist(e.submit, ["svg", "styles", "default", "filter"], ""), W.setPropertyValueIfDoesNotExist(e.disabled, ["svg", "styles", "default", "filter"], "brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(5564%) hue-rotate(207deg) brightness(100%) contrast(97%)"), et.overwriteDefaultStyleWithSubmit(e, "disabled");
13740
+ W.setPropertyValueIfDoesNotExist(e, ["submit", "container", "default", "backgroundColor"], ""), W.setPropertyValueIfDoesNotExist(e, ["disabled", "container", "default", "backgroundColor"], "unset"), W.setPropertyValueIfDoesNotExist(e.submit, ["svg", "styles", "default", "filter"], ""), W.setPropertyValueIfDoesNotExist(e.disabled, ["svg", "styles", "default", "filter"], "brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(5564%) hue-rotate(207deg) brightness(100%) contrast(97%)"), tt.overwriteDefaultStyleWithSubmit(e, "disabled");
13733
13741
  }
13734
13742
  }, {
13735
13743
  key: "process",
13736
13744
  value: function process(e) {
13737
13745
  var t = JSON.parse(JSON.stringify(e || {}));
13738
- return et.overwriteDefaultStyleWithSubmit(t, "loading"), et.overwriteDefaultStyleWithSubmit(t, "stop"), e != null && e.alwaysEnabled || et.setUpDisabledButton(t), t;
13746
+ return tt.overwriteDefaultStyleWithSubmit(t, "loading"), tt.overwriteDefaultStyleWithSubmit(t, "stop"), e != null && e.alwaysEnabled || tt.setUpDisabledButton(t), t;
13739
13747
  }
13740
13748
  }]);
13741
13749
  }();
@@ -13744,7 +13752,7 @@ var k = /*#__PURE__*/function (_ti4) {
13744
13752
  function k(e, t, i, s, r, o) {
13745
13753
  var _this76;
13746
13754
  _classCallCheck(this, k);
13747
- var a = et.process(e.submitButtonStyles);
13755
+ var a = tt.process(e.submitButtonStyles);
13748
13756
  _this76 = _callSuper(this, k, [k.createButtonContainerElement(), a == null ? void 0 : a.position, a]), _this76._isSVGLoadingIconOverriden = !1, _this76.status = {
13749
13757
  requestInProgress: !1,
13750
13758
  loadingActive: !1
@@ -13868,7 +13876,7 @@ var k = /*#__PURE__*/function (_ti4) {
13868
13876
  return _regeneratorRuntime().wrap(function _callee122$(_context122) {
13869
13877
  while (1) switch (_context122.prev = _context122.next) {
13870
13878
  case 0:
13871
- typeof e == "string" && (e = ne.processSubmitUserMessage(e));
13879
+ typeof e == "string" && (e = X.processSubmitUserMessage(e));
13872
13880
  t = {
13873
13881
  text: e.text
13874
13882
  };
@@ -14001,7 +14009,7 @@ var k = /*#__PURE__*/function (_ti4) {
14001
14009
  key: "changeToSubmitIcon",
14002
14010
  value: function changeToSubmitIcon() {
14003
14011
  var _this79 = this;
14004
- this.elementRef.classList.contains(k.SUBMIT_CLASS) || (this.elementRef.classList.remove(k.LOADING_CLASS, k.DISABLED_CLASS), this.elementRef.classList.add(k.SUBMIT_CLASS), this.elementRef.replaceChildren(this._innerElements.submit), et.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = function () {
14012
+ this.elementRef.classList.contains(k.SUBMIT_CLASS) || (this.elementRef.classList.remove(k.LOADING_CLASS, k.DISABLED_CLASS), this.elementRef.classList.add(k.SUBMIT_CLASS), this.elementRef.replaceChildren(this._innerElements.submit), tt.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = function () {
14005
14013
  var e;
14006
14014
  _this79.submitFromInput(), (e = _this79._microphoneButton) != null && e.isActive && Zt.toggleSpeechAfterSubmit(_this79._microphoneButton.elementRef, !!_this79._stopSTTAfterSubmit);
14007
14015
  });
@@ -14028,7 +14036,7 @@ var k = /*#__PURE__*/function (_ti4) {
14028
14036
  }, {
14029
14037
  key: "createSubmitIconElement",
14030
14038
  value: function createSubmitIconElement() {
14031
- var e = se.createSVGElement(Ta);
14039
+ var e = ne.createSVGElement(Ta);
14032
14040
  return e.id = "submit-icon", e;
14033
14041
  }
14034
14042
  }, {
@@ -14051,7 +14059,7 @@ var Aa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
14051
14059
  ka = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>capture</title>\n <path d=\"M0 16q0 3.264 1.28 6.208t3.392 5.12 5.12 3.424 6.208 1.248 6.208-1.248 5.12-3.424 3.392-5.12 1.28-6.208-1.28-6.208-3.392-5.12-5.088-3.392-6.24-1.28q-3.264 0-6.208 1.28t-5.12 3.392-3.392 5.12-1.28 6.208zM4 16q0-3.264 1.6-6.016t4.384-4.352 6.016-1.632 6.016 1.632 4.384 4.352 1.6 6.016-1.6 6.048-4.384 4.352-6.016 1.6-6.016-1.6-4.384-4.352-1.6-6.048z\"></path>\n</svg>\n",
14052
14060
  Ma = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z\"/>\n</svg>",
14053
14061
  Ra = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M4.89163 13.2687L9.16582 17.5427L18.7085 8\" stroke=\"#000000\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
14054
- var Ns = /*#__PURE__*/function (_Qe) {
14062
+ var Ns = /*#__PURE__*/function (_et) {
14055
14063
  // prettier-ignore
14056
14064
  function Ns(e, t, i, s) {
14057
14065
  var _this80;
@@ -14060,18 +14068,18 @@ var Ns = /*#__PURE__*/function (_Qe) {
14060
14068
  var _this80$addButtonsAnd = _this80.addButtonsAndTheirEvents(t),
14061
14069
  r = _this80$addButtonsAnd.captureButton,
14062
14070
  o = _this80$addButtonsAnd.submitButton;
14063
- _this80._captureButton = r, _this80._submitButton = o, _this80._captureIcon = _this80._captureButton.children[0], _this80._refreshIcon = se.createSVGElement(Aa), _this80._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (s == null ? void 0 : s.format) === "jpeg" && (_this80._format = "image/jpeg"), s != null && s.dimensions && (_this80._dimensions = s.dimensions), _this80._contentRef.appendChild(_this80._canvas), _this80.extensionCloseCallback = _this80.stop;
14071
+ _this80._captureButton = r, _this80._submitButton = o, _this80._captureIcon = _this80._captureButton.children[0], _this80._refreshIcon = ne.createSVGElement(Aa), _this80._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (s == null ? void 0 : s.format) === "jpeg" && (_this80._format = "image/jpeg"), s != null && s.dimensions && (_this80._dimensions = s.dimensions), _this80._contentRef.appendChild(_this80._canvas), _this80.extensionCloseCallback = _this80.stop;
14064
14072
  return _this80;
14065
14073
  }
14066
- _inherits(Ns, _Qe);
14074
+ _inherits(Ns, _et);
14067
14075
  return _createClass(Ns, [{
14068
14076
  key: "addButtonsAndTheirEvents",
14069
14077
  value: function addButtonsAndTheirEvents(e) {
14070
- var t = Qe.createSVGButton(ka);
14078
+ var t = et.createSVGButton(ka);
14071
14079
  t.classList.add("modal-svg-camera-button"), t.children[0].classList.add("modal-svg-camera-icon");
14072
14080
  var i = this.addCloseButton(Ma, !0);
14073
14081
  i.classList.add("modal-svg-close-button"), i.children[0].classList.add("modal-svg-close-icon");
14074
- var s = Qe.createSVGButton(Ra);
14082
+ var s = et.createSVGButton(Ra);
14075
14083
  return s.classList.add("modal-svg-submit-button"), this.addButtons(t, s), this.addButtonEvents(t, i, s, e), {
14076
14084
  captureButton: t,
14077
14085
  submitButton: s
@@ -14099,7 +14107,7 @@ var Ns = /*#__PURE__*/function (_Qe) {
14099
14107
  _this82._captureButton.replaceChildren(_this82._captureIcon), _this82._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
14100
14108
  var e = _this82._canvas.getContext("2d");
14101
14109
  e == null || e.clearRect(0, 0, _this82._canvas.width, _this82._canvas.height);
14102
- }, Qe.MODAL_CLOSE_TIMEOUT_MS);
14110
+ }, et.MODAL_CLOSE_TIMEOUT_MS);
14103
14111
  }
14104
14112
  }, {
14105
14113
  key: "start",
@@ -14163,7 +14171,7 @@ var Ns = /*#__PURE__*/function (_Qe) {
14163
14171
  return r.openCameraModal.bind(r, r);
14164
14172
  }
14165
14173
  }]);
14166
- }(Qe);
14174
+ }(et);
14167
14175
  var Ia = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M29 7h-4.599l-2.401-4h-12l-2.4 4h-4.6c-1 0-3 1-3 2.969v16.031c0 1.657 1.5 3 2.792 3h26.271c1.313 0 2.938-1.406 2.938-2.968v-16.032c0-1-1-3-3-3zM30 26.032c0 0.395-0.639 0.947-0.937 0.969h-26.265c-0.232-0.019-0.797-0.47-0.797-1v-16.031c0-0.634 0.851-0.953 1-0.969h5.732l2.4-4h9.802l1.785 3.030 0.55 0.97h5.731c0.705 0 0.99 0.921 1 1v16.032zM16 10c-3.866 0-7 3.134-7 7s3.134 7 7 7 7-3.134 7-7-3.134-7-7-7zM16 22c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5z\"></path>\n</svg>";
14168
14176
  var Pi = /*#__PURE__*/function (_ti5) {
14169
14177
  function Pi(e, t, i) {
@@ -14204,7 +14212,7 @@ var Pi = /*#__PURE__*/function (_ti5) {
14204
14212
  }, {
14205
14213
  key: "createSVGIconElement",
14206
14214
  value: function createSVGIconElement() {
14207
- var e = se.createSVGElement(Ia);
14215
+ var e = ne.createSVGElement(Ia);
14208
14216
  return e.id = "camera-icon", e;
14209
14217
  }
14210
14218
  }]);
@@ -14220,7 +14228,7 @@ var Ft = /*#__PURE__*/function () {
14220
14228
  button: new Zt(e, a, t.addNewErrorMessage.bind(t))
14221
14229
  });
14222
14230
  var l = new Cs(e, a, t, i, o, r);
14223
- a.submit = l.submitFromInput.bind(l), Ve.attach(e, i, a, o, l), e.submitUserMessage = l.programmaticSubmit.bind(l), r.submit = {
14231
+ a.submit = l.submitFromInput.bind(l), $e.attach(e, i, a, o, l), e.submitUserMessage = l.programmaticSubmit.bind(l), r.submit = {
14224
14232
  button: l
14225
14233
  }, Ft.addElements(this.elementRef, a, r, s, o, e.dropupStyles);
14226
14234
  }
@@ -14341,7 +14349,7 @@ var S = /*#__PURE__*/function (_fs) {
14341
14349
  key: "onRender",
14342
14350
  value: function onRender() {
14343
14351
  var _this$_childElement;
14344
- fi.attemptAppendStyleSheetToHead(this.style), ne.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = Ko.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (Lt.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Lt.applyDefaultStyleToComponent(this.style, this.chatStyle), ne.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? ui.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof G) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Ds.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof G && H.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, mi.onRender(this);
14352
+ fi.attemptAppendStyleSheetToHead(this.style), X.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = Ko.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (Lt.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Lt.applyDefaultStyleToComponent(this.style, this.chatStyle), X.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? ui.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof G) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Ds.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof G && H.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, mi.onRender(this);
14345
14353
  }
14346
14354
  }, {
14347
14355
  key: "disconnectedCallback",