deep-chat-dev 9.0.94 → 9.0.96

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
@@ -25,8 +25,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
25
25
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26
26
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
27
27
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
28
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
29
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
28
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
29
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
30
30
  var gs = /*#__PURE__*/function () {
31
31
  function gs() {
32
32
  _classCallCheck(this, gs);
@@ -192,13 +192,13 @@ var ge = /*#__PURE__*/_createClass(function ge() {
192
192
  ge.IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
193
193
  ge.IS_CHROMIUM = window.chrome;
194
194
  var Bn = /*#__PURE__*/function () {
195
- function nt() {
196
- _classCallCheck(this, nt);
195
+ function st() {
196
+ _classCallCheck(this, st);
197
197
  }
198
- _createClass(nt, null, [{
198
+ _createClass(st, null, [{
199
199
  key: "add",
200
200
  value: function add(e, t, i) {
201
- t !== void 0 && e.addEventListener("keydown", nt.onKeyDown.bind(this, t)), e.oninput = nt.onInput.bind(this, t, i);
201
+ t !== void 0 && e.addEventListener("keydown", st.onKeyDown.bind(this, t)), e.oninput = st.onInput.bind(this, t, i);
202
202
  }
203
203
  // preventing insertion early for a nicer UX
204
204
  // prettier-ignore
@@ -206,7 +206,7 @@ var Bn = /*#__PURE__*/function () {
206
206
  key: "onKeyDown",
207
207
  value: function onKeyDown(e, t) {
208
208
  var n = t.target.textContent;
209
- n && n.length >= e && !nt.PERMITTED_KEYS.has(t.key) && !nt.isKeyCombinationPermitted(t) && t.preventDefault();
209
+ n && n.length >= e && !st.PERMITTED_KEYS.has(t.key) && !st.isKeyCombinationPermitted(t) && t.preventDefault();
210
210
  }
211
211
  }, {
212
212
  key: "isKeyCombinationPermitted",
@@ -221,7 +221,7 @@ var Bn = /*#__PURE__*/function () {
221
221
  e !== void 0 && r.length > e && (n.textContent = r.substring(0, e), Qt.focusEndOfInput(n)), t == null || t();
222
222
  }
223
223
  }]);
224
- return nt;
224
+ return st;
225
225
  }();
226
226
  Bn.PERMITTED_KEYS = /* @__PURE__ */new Set([R.BACKSPACE, R.DELETE, R.ARROW_RIGHT, R.ARROW_LEFT, R.ARROW_DOWN, R.ARROW_UP, R.META, R.CONTROL, R.ENTER]);
227
227
  var bs = Bn;
@@ -700,7 +700,7 @@ var be = /*#__PURE__*/function () {
700
700
  var o = i.getElementsByClassName(r);
701
701
  Array.from(o || []).forEach(function (a) {
702
702
  var l = be.getProcessedStyles(t, a, r);
703
- se.applyStylesToElement(a, l), be.applyEvents(a, r);
703
+ re.applyStylesToElement(a, l), be.applyEvents(a, r);
704
704
  });
705
705
  });
706
706
  var n = i.getElementsByClassName(Ss);
@@ -711,11 +711,11 @@ var be = /*#__PURE__*/function () {
711
711
  }]);
712
712
  return be;
713
713
  }();
714
- var se = /*#__PURE__*/function () {
715
- function se() {
716
- _classCallCheck(this, se);
714
+ var re = /*#__PURE__*/function () {
715
+ function re() {
716
+ _classCallCheck(this, re);
717
717
  }
718
- _createClass(se, null, [{
718
+ _createClass(re, null, [{
719
719
  key: "applyStylesToElement",
720
720
  value: function applyStylesToElement(e, t) {
721
721
  var i = M.processStateful(t, {}, {});
@@ -734,7 +734,7 @@ var se = /*#__PURE__*/function () {
734
734
  value: function applyClassUtilitiesToElement(e, t) {
735
735
  var i = t.events,
736
736
  n = t.styles;
737
- i && se.applyEventsToElement(e, i), n && !be.doesElementContainDeepChatClass(e) && se.applyStylesToElement(e, n);
737
+ i && re.applyEventsToElement(e, i), n && !be.doesElementContainDeepChatClass(e) && re.applyStylesToElement(e, n);
738
738
  }
739
739
  }, {
740
740
  key: "applyCustomClassUtilities",
@@ -742,17 +742,17 @@ var se = /*#__PURE__*/function () {
742
742
  Object.keys(e).forEach(function (i) {
743
743
  var n = t.getElementsByClassName(i);
744
744
  Array.from(n).forEach(function (r) {
745
- e[i] && se.applyClassUtilitiesToElement(r, e[i]);
745
+ e[i] && re.applyClassUtilitiesToElement(r, e[i]);
746
746
  });
747
747
  });
748
748
  }
749
749
  }, {
750
750
  key: "apply",
751
751
  value: function apply(e, t) {
752
- be.applyDeepChatUtilities(e, e.htmlClassUtilities, t), se.applyCustomClassUtilities(e.htmlClassUtilities, t);
752
+ be.applyDeepChatUtilities(e, e.htmlClassUtilities, t), re.applyCustomClassUtilities(e.htmlClassUtilities, t);
753
753
  }
754
754
  }]);
755
- return se;
755
+ return re;
756
756
  }();
757
757
  var Ye = /*#__PURE__*/function () {
758
758
  function Ye() {
@@ -774,7 +774,7 @@ var Ye = /*#__PURE__*/function () {
774
774
  value: function overwrite(e, t, i, n) {
775
775
  var r = e.messages,
776
776
  o = v.overwriteMessage(r, n, t, i, "html", "html-message");
777
- return o && (o.bubbleElement.innerHTML = t, se.apply(e, o.outerContainer), ke.flagHTMLUpdateClass(o.bubbleElement)), o;
777
+ return o && (o.bubbleElement.innerHTML = t, re.apply(e, o.outerContainer), ke.flagHTMLUpdateClass(o.bubbleElement)), o;
778
778
  }
779
779
  // prettier-ignore
780
780
  }, {
@@ -787,7 +787,7 @@ var Ye = /*#__PURE__*/function () {
787
787
  r.status = !1;
788
788
  }
789
789
  var o = Ye.createElements(e, t, i);
790
- return v.fillEmptyMessageElement(o.bubbleElement, t), se.apply(e, o.outerContainer), ke.flagHTMLUpdateClass(o.bubbleElement), e.applyCustomStyles(o, i, !1, (a = e.messageStyles) == null ? void 0 : a.html), Ye.addElement(e, o.outerContainer), o;
790
+ return v.fillEmptyMessageElement(o.bubbleElement, t), re.apply(e, o.outerContainer), ke.flagHTMLUpdateClass(o.bubbleElement), e.applyCustomStyles(o, i, !1, (a = e.messageStyles) == null ? void 0 : a.html), Ye.addElement(e, o.outerContainer), o;
791
791
  }
792
792
  }]);
793
793
  return Ye;
@@ -812,7 +812,7 @@ function Gn(s) {
812
812
  }), s;
813
813
  }
814
814
  var Ms = /\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;
815
- function ft(s) {
815
+ function mt(s) {
816
816
  return s.indexOf("\\") < 0 ? s : s.replace(Ms, "$1");
817
817
  }
818
818
  function Wn(s) {
@@ -871,7 +871,7 @@ f.fence = function (s, e, t, i, n) {
871
871
  u;
872
872
  if (r.params) {
873
873
  if (c = r.params.split(/\s+/g), d = c.join(" "), ws(n.rules.fence_custom, c[0])) return n.rules.fence_custom[c[0]](s, e, t, i, n);
874
- l = z(Ie(ft(d))), o = ' class="' + a + l + '"';
874
+ l = z(Ie(mt(d))), o = ' class="' + a + l + '"';
875
875
  }
876
876
  return t.highlight ? u = t.highlight.apply(t.highlight, [r.content].concat(c)) || z(r.content) : u = z(r.content), "<pre><code" + o + ">" + u + "</code></pre>" + Re(s, e);
877
877
  };
@@ -923,7 +923,7 @@ f.link_close = function () {
923
923
  f.image = function (s, e, t) {
924
924
  var i = ' src="' + z(s[e].src) + '"',
925
925
  n = s[e].title ? ' title="' + z(Ie(s[e].title)) + '"' : "",
926
- r = ' alt="' + (s[e].alt ? z(Ie(ft(s[e].alt))) : "") + '"',
926
+ r = ' alt="' + (s[e].alt ? z(Ie(mt(s[e].alt))) : "") + '"',
927
927
  o = t.xhtmlOut ? " /" : "";
928
928
  return "<img" + i + r + n + o + ">";
929
929
  };
@@ -1186,7 +1186,7 @@ Oe.prototype.cacheSet = function (s, e) {
1186
1186
  Oe.prototype.cacheGet = function (s) {
1187
1187
  return s < this.cache.length ? this.cache[s] : 0;
1188
1188
  };
1189
- function mt(s, e) {
1189
+ function gt(s, e) {
1190
1190
  var t,
1191
1191
  i,
1192
1192
  n,
@@ -1207,7 +1207,7 @@ function mt(s, e) {
1207
1207
  }
1208
1208
  function Ns(s, e, t, i) {
1209
1209
  var n, r, o, a, l, c;
1210
- if (s.charCodeAt(0) !== 42 || s.charCodeAt(1) !== 91 || s.indexOf("]:") === -1 || (n = new Oe(s, e, t, i, []), r = mt(n, 1), r < 0 || s.charCodeAt(r + 1) !== 58)) return -1;
1210
+ if (s.charCodeAt(0) !== 42 || s.charCodeAt(1) !== 91 || s.indexOf("]:") === -1 || (n = new Oe(s, e, t, i, []), r = gt(n, 1), r < 0 || s.charCodeAt(r + 1) !== 58)) return -1;
1211
1211
  for (a = n.posMax, o = r + 2; o < a && n.src.charCodeAt(o) !== 10; o++);
1212
1212
  return l = s.slice(2, r), c = s.slice(r + 2, o).trim(), c.length === 0 ? -1 : (i.abbreviations || (i.abbreviations = {}), _typeof(i.abbreviations[":" + l]) > "u" && (i.abbreviations[":" + l] = c), o);
1213
1213
  }
@@ -1240,7 +1240,7 @@ function Jn(s, e) {
1240
1240
  if (s.src.charCodeAt(e) === 60) {
1241
1241
  for (e++; e < o;) {
1242
1242
  if (t = s.src.charCodeAt(e), t === 10) return !1;
1243
- if (t === 62) return n = Ni(ft(s.src.slice(r + 1, e))), s.parser.validateLink(n) ? (s.pos = e + 1, s.linkContent = n, !0) : !1;
1243
+ if (t === 62) return n = Ni(mt(s.src.slice(r + 1, e))), s.parser.validateLink(n) ? (s.pos = e + 1, s.linkContent = n, !0) : !1;
1244
1244
  if (t === 92 && e + 1 < o) {
1245
1245
  e += 2;
1246
1246
  continue;
@@ -1257,7 +1257,7 @@ function Jn(s, e) {
1257
1257
  if (t === 40 && (i++, i > 1) || t === 41 && (i--, i < 0)) break;
1258
1258
  e++;
1259
1259
  }
1260
- return r === e || (n = ft(s.src.slice(r, e)), !s.parser.validateLink(n)) ? !1 : (s.linkContent = n, s.pos = e, !0);
1260
+ return r === e || (n = mt(s.src.slice(r, e)), !s.parser.validateLink(n)) ? !1 : (s.linkContent = n, s.pos = e, !0);
1261
1261
  }
1262
1262
  function $n(s, e) {
1263
1263
  var t,
@@ -1266,7 +1266,7 @@ function $n(s, e) {
1266
1266
  r = s.src.charCodeAt(e);
1267
1267
  if (r !== 34 && r !== 39 && r !== 40) return !1;
1268
1268
  for (e++, r === 40 && (r = 41); e < n;) {
1269
- if (t = s.src.charCodeAt(e), t === r) return s.pos = e + 1, s.linkContent = ft(s.src.slice(i + 1, e)), !0;
1269
+ if (t = s.src.charCodeAt(e), t === r) return s.pos = e + 1, s.linkContent = mt(s.src.slice(i + 1, e)), !0;
1270
1270
  if (t === 92 && e + 1 < n) {
1271
1271
  e += 2;
1272
1272
  continue;
@@ -1280,7 +1280,7 @@ function Yn(s) {
1280
1280
  }
1281
1281
  function Ds(s, e, t, i) {
1282
1282
  var n, r, o, a, l, c, d, u, h;
1283
- if (s.charCodeAt(0) !== 91 || s.indexOf("]:") === -1 || (n = new Oe(s, e, t, i, []), r = mt(n, 0), r < 0 || s.charCodeAt(r + 1) !== 58)) return -1;
1283
+ if (s.charCodeAt(0) !== 91 || s.indexOf("]:") === -1 || (n = new Oe(s, e, t, i, []), r = gt(n, 0), r < 0 || s.charCodeAt(r + 1) !== 58)) return -1;
1284
1284
  for (a = n.posMax, o = r + 2; o < a && (l = n.src.charCodeAt(o), !(l !== 32 && l !== 10)); o++);
1285
1285
  if (!Jn(n, o)) return -1;
1286
1286
  for (d = n.linkContent, o = n.pos, c = o, o = o + 1; o < a && (l = n.src.charCodeAt(o), !(l !== 32 && l !== 10)); o++);
@@ -1668,7 +1668,7 @@ function er(s, e, t, i) {
1668
1668
  k,
1669
1669
  G,
1670
1670
  X,
1671
- oe = !0,
1671
+ ae = !0,
1672
1672
  Q,
1673
1673
  N,
1674
1674
  Fe,
@@ -1689,7 +1689,7 @@ function er(s, e, t, i) {
1689
1689
  type: "list_item_open",
1690
1690
  lines: X = [e, 0],
1691
1691
  level: s.level++
1692
- }), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] = S - s.bMarks[e], s.blkIndent = r, s.tight = !0, s.parentType = "list", s.parser.tokenize(s, e, t, !0), (!s.tight || k) && (oe = !1), k = s.line - e > 1 && s.isEmpty(s.line - 1), s.blkIndent = a, s.tShift[e] = o, s.tight = l, s.parentType = c, s.tokens.push({
1692
+ }), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] = S - s.bMarks[e], s.blkIndent = r, s.tight = !0, s.parentType = "list", s.parser.tokenize(s, e, t, !0), (!s.tight || k) && (ae = !1), k = s.line - e > 1 && s.isEmpty(s.line - 1), s.blkIndent = a, s.tShift[e] = o, s.tight = l, s.parentType = c, s.tokens.push({
1693
1693
  type: "list_item_close",
1694
1694
  level: --s.level
1695
1695
  }), n = e = s.line, X[1] = n, S = s.bMarks[e], !(n >= t || s.isEmpty(n) || s.tShift[n] < s.blkIndent));) {
@@ -1706,7 +1706,7 @@ function er(s, e, t, i) {
1706
1706
  return s.tokens.push({
1707
1707
  type: E ? "ordered_list_close" : "bullet_list_close",
1708
1708
  level: --s.level
1709
- }), G[1] = n, s.line = n, oe && Qs(s, V), !0;
1709
+ }), G[1] = n, s.line = n, ae && Qs(s, V), !0;
1710
1710
  }
1711
1711
  function tr(s, e, t, i) {
1712
1712
  var n,
@@ -2318,7 +2318,7 @@ function Ar(s, e) {
2318
2318
  h = s.posMax,
2319
2319
  p = s.pos,
2320
2320
  g = s.src.charCodeAt(p);
2321
- if (g === 33 && (d = !0, g = s.src.charCodeAt(++p)), g !== 91 || s.level >= s.options.maxNesting || (t = p + 1, i = mt(s, p), i < 0)) return !1;
2321
+ if (g === 33 && (d = !0, g = s.src.charCodeAt(++p)), g !== 91 || s.level >= s.options.maxNesting || (t = p + 1, i = gt(s, p), i < 0)) return !1;
2322
2322
  if (a = i + 1, a < h && s.src.charCodeAt(a) === 40) {
2323
2323
  for (a++; a < h && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
2324
2324
  if (a >= h) return !1;
@@ -2329,7 +2329,7 @@ function Ar(s, e) {
2329
2329
  } else {
2330
2330
  if (s.linkLevel > 0) return !1;
2331
2331
  for (; a < h && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
2332
- if (a < h && s.src.charCodeAt(a) === 91 && (p = a + 1, a = mt(s, a), a >= 0 ? n = s.src.slice(p, a++) : a = p - 1), n || (_typeof(n) > "u" && (a = i + 1), n = s.src.slice(t, i)), l = s.env.references[Yn(n)], !l) return s.pos = u, !1;
2332
+ if (a < h && s.src.charCodeAt(a) === 91 && (p = a + 1, a = gt(s, a), a >= 0 ? n = s.src.slice(p, a++) : a = p - 1), n || (_typeof(n) > "u" && (a = i + 1), n = s.src.slice(t, i)), l = s.env.references[Yn(n)], !l) return s.pos = u, !1;
2333
2333
  r = l.href, o = l.title;
2334
2334
  }
2335
2335
  return e || (s.pos = t, s.posMax = i, d ? s.push({
@@ -2355,7 +2355,7 @@ function kr(s, e) {
2355
2355
  r,
2356
2356
  o = s.posMax,
2357
2357
  a = s.pos;
2358
- return a + 2 >= o || s.src.charCodeAt(a) !== 94 || s.src.charCodeAt(a + 1) !== 91 || s.level >= s.options.maxNesting || (t = a + 2, i = mt(s, a + 1), i < 0) ? !1 : (e || (s.env.footnotes || (s.env.footnotes = {}), s.env.footnotes.list || (s.env.footnotes.list = []), n = s.env.footnotes.list.length, s.pos = t, s.posMax = i, s.push({
2358
+ return a + 2 >= o || s.src.charCodeAt(a) !== 94 || s.src.charCodeAt(a + 1) !== 91 || s.level >= s.options.maxNesting || (t = a + 2, i = gt(s, a + 1), i < 0) ? !1 : (e || (s.env.footnotes || (s.env.footnotes = {}), s.env.footnotes.list || (s.env.footnotes.list = []), n = s.env.footnotes.list.length, s.pos = t, s.posMax = i, s.push({
2359
2359
  type: "footnote_ref",
2360
2360
  id: n,
2361
2361
  level: s.level
@@ -2539,7 +2539,6 @@ var eo = {
2539
2539
  maxNesting: 20
2540
2540
  // Internal protection, recursion limit
2541
2541
  },
2542
-
2543
2542
  components: {
2544
2543
  core: {
2545
2544
  rules: ["block", "inline", "references", "replacements", "smartquotes", "references", "abbr2", "footnote_tail"]
@@ -2578,7 +2577,6 @@ var eo = {
2578
2577
  maxNesting: 20
2579
2578
  // Internal protection, recursion limit
2580
2579
  },
2581
-
2582
2580
  components: {
2583
2581
  // Don't restrict core/block/inline rules
2584
2582
  core: {},
@@ -2612,7 +2610,6 @@ var eo = {
2612
2610
  maxNesting: 20
2613
2611
  // Internal protection, recursion limit
2614
2612
  },
2615
-
2616
2613
  components: {
2617
2614
  core: {
2618
2615
  rules: ["block", "inline", "references", "abbr2"]
@@ -2633,34 +2630,34 @@ var eo = {
2633
2630
  function Qn(s, e, t) {
2634
2631
  this.src = e, this.env = t, this.options = s.options, this.tokens = [], this.inlineMode = !1, this.inline = s.inline, this.block = s.block, this.renderer = s.renderer, this.typographer = s.typographer;
2635
2632
  }
2636
- function he(s, e) {
2633
+ function pe(s, e) {
2637
2634
  typeof s != "string" && (e = s, s = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new ii(), this.block = new Vi(), this.core = new Zn(), this.renderer = new Hi(), this.ruler = new H(), this.options = {}, this.configure(no[s]), this.set(e || {});
2638
2635
  }
2639
- he.prototype.set = function (s) {
2636
+ pe.prototype.set = function (s) {
2640
2637
  Gn(this.options, s);
2641
2638
  };
2642
- he.prototype.configure = function (s) {
2639
+ pe.prototype.configure = function (s) {
2643
2640
  var e = this;
2644
2641
  if (!s) throw new Error("Wrong `remarkable` preset, check name/content");
2645
2642
  s.options && e.set(s.options), s.components && Object.keys(s.components).forEach(function (t) {
2646
2643
  s.components[t].rules && e[t].ruler.enable(s.components[t].rules, !0);
2647
2644
  });
2648
2645
  };
2649
- he.prototype.use = function (s, e) {
2646
+ pe.prototype.use = function (s, e) {
2650
2647
  return s(this, e), this;
2651
2648
  };
2652
- he.prototype.parse = function (s, e) {
2649
+ pe.prototype.parse = function (s, e) {
2653
2650
  var t = new Qn(this, s, e);
2654
2651
  return this.core.process(t), t.tokens;
2655
2652
  };
2656
- he.prototype.render = function (s, e) {
2653
+ pe.prototype.render = function (s, e) {
2657
2654
  return e = e || {}, this.renderer.render(this.parse(s, e), this.options, e);
2658
2655
  };
2659
- he.prototype.parseInline = function (s, e) {
2656
+ pe.prototype.parseInline = function (s, e) {
2660
2657
  var t = new Qn(this, s, e);
2661
2658
  return t.inlineMode = !0, this.core.process(t), t.tokens;
2662
2659
  };
2663
- he.prototype.renderInline = function (s, e) {
2660
+ pe.prototype.renderInline = function (s, e) {
2664
2661
  return e = e || {}, this.renderer.render(this.parseInline(s, e), this.options, e);
2665
2662
  };
2666
2663
  var Pi = /*#__PURE__*/function () {
@@ -2671,7 +2668,7 @@ var Pi = /*#__PURE__*/function () {
2671
2668
  key: "createNew",
2672
2669
  value: function createNew() {
2673
2670
  var e = window.hljs;
2674
- return e ? new he({
2671
+ return e ? new pe({
2675
2672
  highlight: function highlight(t, i) {
2676
2673
  if (i && e.getLanguage(i)) try {
2677
2674
  return e.highlight(i, t).value;
@@ -2697,7 +2694,7 @@ var Pi = /*#__PURE__*/function () {
2697
2694
  // set target to open in a new tab
2698
2695
  typographer: !0
2699
2696
  // Enable smartypants and other sweet transforms
2700
- }) : new he({
2697
+ }) : new pe({
2701
2698
  highlight: function highlight(t) {
2702
2699
  return t;
2703
2700
  },
@@ -2772,7 +2769,7 @@ var es = /*#__PURE__*/function () {
2772
2769
  return Pt;
2773
2770
  }();
2774
2771
  es.DEFAULT_FILE_NAME = "file";
2775
- var ne = es;
2772
+ var se = es;
2776
2773
  var jt = /*#__PURE__*/function () {
2777
2774
  function jt() {
2778
2775
  _classCallCheck(this, jt);
@@ -2784,7 +2781,7 @@ var jt = /*#__PURE__*/function () {
2784
2781
  message: t,
2785
2782
  isInitial: i
2786
2783
  }));
2787
- ne.reAddFileRefToObject(t, n), e.onNewMessage(n), e.dispatchEvent(new CustomEvent("new-message", {
2784
+ se.reAddFileRefToObject(t, n), e.onNewMessage(n), e.dispatchEvent(new CustomEvent("new-message", {
2788
2785
  detail: n
2789
2786
  }));
2790
2787
  }
@@ -2860,11 +2857,11 @@ var D = /*#__PURE__*/function () {
2860
2857
  }();
2861
2858
  var so = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8c3ZnIGZpbGw9IiMwMDAwMDAiIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIAoJCXZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+Cgk8cGF0aCBkPSJNMjMsMzAuMzZIOWMtMi40MDQsMC00LjM2LTEuOTU2LTQuMzYtNC4zNlYxNWMwLTIuNDA0LDEuOTU2LTQuMzYsNC4zNi00LjM2aDMuNjU5CgkJYzAuMTY3LTEuNTY2LDEuNDE1LTIuODEzLDIuOTgxLTIuOTgxVjUuMzMzYy0xLjEzMS0wLjE3NC0yLTEuMTU0LTItMi4zMzNjMC0xLjMwMSwxLjA1OS0yLjM2LDIuMzYtMi4zNgoJCWMxLjMwMiwwLDIuMzYsMS4wNTksMi4zNiwyLjM2YzAsMS4xNzktMC44NjksMi4xNTktMiwyLjMzM1Y3LjY2YzEuNTY2LDAuMTY3LDIuODE0LDEuNDE1LDIuOTgxLDIuOTgxSDIzCgkJYzIuNDA0LDAsNC4zNiwxLjk1Niw0LjM2LDQuMzZ2MTFDMjcuMzYsMjguNDA0LDI1LjQwNCwzMC4zNiwyMywzMC4zNnogTTksMTEuMzZjLTIuMDA3LDAtMy42NCwxLjYzMy0zLjY0LDMuNjR2MTEKCQljMCwyLjAwNywxLjYzMywzLjY0LDMuNjQsMy42NGgxNGMyLjAwNywwLDMuNjQtMS42MzMsMy42NC0zLjY0VjE1YzAtMi4wMDctMS42MzMtMy42NC0zLjY0LTMuNjRIOXogTTEzLjM4NCwxMC42NGg1LjIzMQoJCUMxOC40MzksOS4zNTQsMTcuMzM0LDguMzYsMTYsOC4zNkMxNC42NjcsOC4zNiwxMy41NjEsOS4zNTQsMTMuMzg0LDEwLjY0eiBNMTYsMS4zNmMtMC45MDQsMC0xLjY0LDAuNzM2LTEuNjQsMS42NAoJCVMxNS4wOTYsNC42NCwxNiw0LjY0YzAuOTA0LDAsMS42NC0wLjczNiwxLjY0LTEuNjRTMTYuOTA0LDEuMzYsMTYsMS4zNnogTTIwLDI3LjM2aC04Yy0xLjMwMSwwLTIuMzYtMS4wNTktMi4zNi0yLjM2CgkJczEuMDU5LTIuMzYsMi4zNi0yLjM2aDhjMS4zMDIsMCwyLjM2LDEuMDU5LDIuMzYsMi4zNlMyMS4zMDIsMjcuMzYsMjAsMjcuMzZ6IE0xMiwyMy4zNmMtMC45MDQsMC0xLjY0LDAuNzM1LTEuNjQsMS42NAoJCXMwLjczNiwxLjY0LDEuNjQsMS42NGg4YzAuOTA0LDAsMS42NC0wLjczNSwxLjY0LTEuNjRzLTAuNzM1LTEuNjQtMS42NC0xLjY0SDEyeiBNMzEsMjMuODZoLTJjLTAuMTk5LDAtMC4zNi0wLjE2MS0wLjM2LTAuMzZWMTUKCQljMC0wLjE5OSwwLjE2MS0wLjM2LDAuMzYtMC4zNmgyYzAuMTk5LDAsMC4zNiwwLjE2MSwwLjM2LDAuMzZ2OC41QzMxLjM2LDIzLjY5OSwzMS4xOTksMjMuODYsMzEsMjMuODZ6IE0yOS4zNiwyMy4xNGgxLjI3OXYtNy43OAoJCUgyOS4zNlYyMy4xNHogTTMsMjMuODZIMWMtMC4xOTksMC0wLjM2LTAuMTYxLTAuMzYtMC4zNlYxNWMwLTAuMTk5LDAuMTYxLTAuMzYsMC4zNi0wLjM2aDJjMC4xOTksMCwwLjM2LDAuMTYxLDAuMzYsMC4zNnY4LjUKCQlDMy4zNiwyMy42OTksMy4xOTksMjMuODYsMywyMy44NnogTTEuMzYsMjMuMTRoMS4yOHYtNy43OEgxLjM2VjIzLjE0eiBNMjAsMjAuMzZjLTEuMzAyLDAtMi4zNi0xLjA1OS0yLjM2LTIuMzYKCQlzMS4wNTktMi4zNiwyLjM2LTIuMzZzMi4zNiwxLjA1OSwyLjM2LDIuMzZDMjIuMzYsMTkuMzAyLDIxLjMwMiwyMC4zNiwyMCwyMC4zNnogTTIwLDE2LjM2Yy0wLjkwNCwwLTEuNjQsMC43MzYtMS42NCwxLjY0CgkJczAuNzM1LDEuNjQsMS42NCwxLjY0czEuNjQtMC43MzUsMS42NC0xLjY0UzIwLjkwNCwxNi4zNiwyMCwxNi4zNnogTTEyLDIwLjM2Yy0xLjMwMSwwLTIuMzYtMS4wNTktMi4zNi0yLjM2czEuMDU5LTIuMzYsMi4zNi0yLjM2CgkJczIuMzYsMS4wNTksMi4zNiwyLjM2QzE0LjM2LDE5LjMwMiwxMy4zMDEsMjAuMzYsMTIsMjAuMzZ6IE0xMiwxNi4zNmMtMC45MDQsMC0xLjY0LDAuNzM2LTEuNjQsMS42NHMwLjczNiwxLjY0LDEuNjQsMS42NAoJCXMxLjY0LTAuNzM1LDEuNjQtMS42NFMxMi45MDQsMTYuMzYsMTIsMTYuMzZ6Ii8+Cgk8cmVjdCBzdHlsZT0iZmlsbDpub25lOyIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIi8+Cjwvc3ZnPg==",
2862
2859
  ro = "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==";
2863
- var ce = /*#__PURE__*/function () {
2864
- function ce() {
2865
- _classCallCheck(this, ce);
2860
+ var de = /*#__PURE__*/function () {
2861
+ function de() {
2862
+ _classCallCheck(this, de);
2866
2863
  }
2867
- _createClass(ce, null, [{
2864
+ _createClass(de, null, [{
2868
2865
  key: "applyCustomStylesToElements",
2869
2866
  value: function applyCustomStylesToElements(e, t, i) {
2870
2867
  Object.assign(e.style, i.container), Object.assign(t.style, i.avatar);
@@ -2873,10 +2870,10 @@ var ce = /*#__PURE__*/function () {
2873
2870
  key: "applyCustomStyles",
2874
2871
  value: function applyCustomStyles(e, t, i, n) {
2875
2872
  var r, o, a, l;
2876
- if ((r = i["default"]) != null && r.styles && ce.applyCustomStylesToElements(e, t, i["default"].styles), n === v.USER_ROLE) (o = i.user) != null && o.styles && ce.applyCustomStylesToElements(e, t, i.user.styles);else {
2877
- (a = i.ai) != null && a.styles && ce.applyCustomStylesToElements(e, t, i.ai.styles);
2873
+ if ((r = i["default"]) != null && r.styles && de.applyCustomStylesToElements(e, t, i["default"].styles), n === v.USER_ROLE) (o = i.user) != null && o.styles && de.applyCustomStylesToElements(e, t, i.user.styles);else {
2874
+ (a = i.ai) != null && a.styles && de.applyCustomStylesToElements(e, t, i.ai.styles);
2878
2875
  var c = (l = i[n]) == null ? void 0 : l.styles;
2879
- c && ce.applyCustomStylesToElements(e, t, c);
2876
+ c && de.applyCustomStylesToElements(e, t, c);
2880
2877
  }
2881
2878
  }
2882
2879
  }, {
@@ -2886,7 +2883,7 @@ var ce = /*#__PURE__*/function () {
2886
2883
  var i = document.createElement("img");
2887
2884
  e === v.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) || ro : 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");
2888
2885
  var n = document.createElement("div");
2889
- return n.classList.add("avatar-container"), n.appendChild(i), t && ce.applyCustomStyles(n, i, t, e), n;
2886
+ return n.classList.add("avatar-container"), n.appendChild(i), t && de.applyCustomStyles(n, i, t, e), n;
2890
2887
  }
2891
2888
  }, {
2892
2889
  key: "getPosition",
@@ -2900,12 +2897,12 @@ var ce = /*#__PURE__*/function () {
2900
2897
  key: "add",
2901
2898
  value: function add(e, t, i) {
2902
2899
  var n = typeof i == "boolean" ? void 0 : i,
2903
- r = ce.createAvatar(t, n),
2904
- o = ce.getPosition(t, n);
2900
+ r = de.createAvatar(t, n),
2901
+ o = de.getPosition(t, n);
2905
2902
  r.classList.add(o === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(o === "left" ? "beforebegin" : "afterend", r);
2906
2903
  }
2907
2904
  }]);
2908
- return ce;
2905
+ return de;
2909
2906
  }();
2910
2907
  var Ge = /*#__PURE__*/function () {
2911
2908
  function Ge() {
@@ -3009,7 +3006,7 @@ var Ke = /*#__PURE__*/function () {
3009
3006
  value:
3010
3007
  // prettier-ignore
3011
3008
  function addInnerContainerElements(e, t, i) {
3012
- return e.classList.add("message-bubble", v.getRoleClass(i), i === v.USER_ROLE ? "user-message-text" : "ai-message-text"), this.renderText(e, t), this._avatars && ce.add(e, i, this._avatars), this._names && Ge.add(e, i, this._names), {
3009
+ return e.classList.add("message-bubble", v.getRoleClass(i), i === v.USER_ROLE ? "user-message-text" : "ai-message-text"), this.renderText(e, t), this._avatars && de.add(e, i, this._avatars), this._names && Ge.add(e, i, this._names), {
3013
3010
  bubbleElement: e
3014
3011
  };
3015
3012
  }
@@ -3087,11 +3084,11 @@ var Ke = /*#__PURE__*/function () {
3087
3084
  }();
3088
3085
  var Wi = /*#__PURE__*/function () {
3089
3086
  // used for extracting at end and for isStreaming
3090
- function st(e) {
3091
- _classCallCheck(this, st);
3087
+ function rt(e) {
3088
+ _classCallCheck(this, rt);
3092
3089
  this._streamedContent = "", this._streamType = "", this._hasStreamEnded = !1, this._messages = e;
3093
3090
  }
3094
- _createClass(st, [{
3091
+ _createClass(rt, [{
3095
3092
  key: "upsertStreamedMessage",
3096
3093
  value: function upsertStreamedMessage(e) {
3097
3094
  var r;
@@ -3110,7 +3107,7 @@ var Wi = /*#__PURE__*/function () {
3110
3107
  key: "setInitialState",
3111
3108
  value: function setInitialState(e, t, i) {
3112
3109
  var _i8;
3113
- this._streamType = e, (_i8 = i) !== null && _i8 !== void 0 ? _i8 : i = v.AI_ROLE, this._elements = e === "text" ? this._messages.addNewTextMessage(t, i) : Ye.add(this._messages, t, i, this._messages.messageElementRefs), this._elements.bubbleElement.classList.add(st.MESSAGE_CLASS), this._streamedContent = t, this._activeMessageRole = i;
3110
+ this._streamType = e, (_i8 = i) !== null && _i8 !== void 0 ? _i8 : i = v.AI_ROLE, this._elements = e === "text" ? this._messages.addNewTextMessage(t, i) : Ye.add(this._messages, t, i, this._messages.messageElementRefs), this._elements.bubbleElement.classList.add(rt.MESSAGE_CLASS), this._streamedContent = t, this._activeMessageRole = i;
3114
3111
  }
3115
3112
  }, {
3116
3113
  key: "updateBasedOnType",
@@ -3128,7 +3125,7 @@ var Wi = /*#__PURE__*/function () {
3128
3125
  value: function updateHTML(e, t, i) {
3129
3126
  if (i) this._streamedContent = e, t.innerHTML = e;else {
3130
3127
  var n = document.createElement("span");
3131
- n.innerHTML = e, t.appendChild(n), this._streamedContent = st.HTML_CONTENT_PLACEHOLDER;
3128
+ n.innerHTML = e, t.appendChild(n), this._streamedContent = rt.HTML_CONTENT_PLACEHOLDER;
3132
3129
  }
3133
3130
  }
3134
3131
  }, {
@@ -3140,23 +3137,23 @@ var Wi = /*#__PURE__*/function () {
3140
3137
  t = _this$_messages.elementRef,
3141
3138
  i = (r = v.getLastMessageBubbleElement(t)) == null ? void 0 : r.classList;
3142
3139
  if (i != null && i.contains("loading-message-text")) throw Error(A.NO_VALID_STREAM_EVENTS_SENT);
3143
- if (!(i != null && i.contains(st.MESSAGE_CLASS))) return;
3140
+ if (!(i != null && i.contains(rt.MESSAGE_CLASS))) return;
3144
3141
  var n = {
3145
3142
  role: this._activeMessageRole || v.AI_ROLE
3146
3143
  };
3147
- this._streamType === "text" ? (e[e.length - 1][1] = this._streamedContent, n.text = this._streamedContent, this._messages.textToSpeech && Nt.speak(this._streamedContent, this._messages.textToSpeech)) : this._streamType === "html" && (this._streamedContent === st.HTML_CONTENT_PLACEHOLDER && (this._streamedContent = ((o = v.getLastMessageBubbleElement(t)) == null ? void 0 : o.innerHTML) || ""), this._elements && se.apply(this._messages, this._elements.outerContainer), n.html = this._streamedContent), n && (this._messages.messages.push(n), this._messages.sendClientUpdate(Ke.createMessageContent(n), !1)), this._hasStreamEnded = !0;
3144
+ this._streamType === "text" ? (e[e.length - 1][1] = this._streamedContent, n.text = this._streamedContent, this._messages.textToSpeech && Nt.speak(this._streamedContent, this._messages.textToSpeech)) : this._streamType === "html" && (this._streamedContent === rt.HTML_CONTENT_PLACEHOLDER && (this._streamedContent = ((o = v.getLastMessageBubbleElement(t)) == null ? void 0 : o.innerHTML) || ""), this._elements && re.apply(this._messages, this._elements.outerContainer), n.html = this._streamedContent), n && (this._messages.messages.push(n), this._messages.sendClientUpdate(Ke.createMessageContent(n), !1)), this._hasStreamEnded = !0;
3148
3145
  }
3149
3146
  }]);
3150
- return st;
3147
+ return rt;
3151
3148
  }();
3152
3149
  Wi.MESSAGE_CLASS = "streamed-message";
3153
3150
  Wi.HTML_CONTENT_PLACEHOLDER = "htmlplaceholder";
3154
3151
  var Ze = Wi;
3155
3152
  var ts = /*#__PURE__*/function () {
3156
- function rt() {
3157
- _classCallCheck(this, rt);
3153
+ function ot() {
3154
+ _classCallCheck(this, ot);
3158
3155
  }
3159
- _createClass(rt, null, [{
3156
+ _createClass(ot, null, [{
3160
3157
  key: "tempRemoveContentHeader",
3161
3158
  value: // need to pass stringifyBody boolean separately as binding is throwing an error for some reason
3162
3159
  // prettier-ignore
@@ -3172,8 +3169,8 @@ var ts = /*#__PURE__*/function () {
3172
3169
  }
3173
3170
  throw new Error("Request settings have not been set up");
3174
3171
  case 2:
3175
- n = e.headers[rt.CONTENT_TYPE];
3176
- delete e.headers[rt.CONTENT_TYPE];
3172
+ n = e.headers[ot.CONTENT_TYPE];
3173
+ delete e.headers[ot.CONTENT_TYPE];
3177
3174
  _context.prev = 4;
3178
3175
  _context.next = 7;
3179
3176
  return t(i);
@@ -3184,9 +3181,9 @@ var ts = /*#__PURE__*/function () {
3184
3181
  case 10:
3185
3182
  _context.prev = 10;
3186
3183
  _context.t0 = _context["catch"](4);
3187
- throw e.headers[rt.CONTENT_TYPE] = n, _context.t0;
3184
+ throw e.headers[ot.CONTENT_TYPE] = n, _context.t0;
3188
3185
  case 13:
3189
- return _context.abrupt("return", (e.headers[rt.CONTENT_TYPE] = n, r));
3186
+ return _context.abrupt("return", (e.headers[ot.CONTENT_TYPE] = n, r));
3190
3187
  case 14:
3191
3188
  case "end":
3192
3189
  return _context.stop();
@@ -3273,7 +3270,7 @@ var ts = /*#__PURE__*/function () {
3273
3270
  return e && _typeof(e) == "object" && (typeof e.error == "string" || typeof e.text == "string" || typeof e.html == "string" || Array.isArray(e.files));
3274
3271
  }
3275
3272
  }]);
3276
- return rt;
3273
+ return ot;
3277
3274
  }();
3278
3275
  ts.CONTENT_TYPE = "Content-Type";
3279
3276
  var _ = ts;
@@ -3415,7 +3412,7 @@ function po(s, e) {
3415
3412
  }
3416
3413
  function _X() {
3417
3414
  _X = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
3418
- var oe, Q, N;
3415
+ var ae, Q, N;
3419
3416
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3420
3417
  while (1) switch (_context3.prev = _context3.next) {
3421
3418
  case 0:
@@ -3447,7 +3444,7 @@ function po(s, e) {
3447
3444
  _context3.prev = 14;
3448
3445
  _context3.t0 = _context3["catch"](1);
3449
3446
  if (!g.signal.aborted) try {
3450
- N = (oe = a == null ? void 0 : a(_context3.t0)) !== null && oe !== void 0 ? oe : E;
3447
+ N = (ae = a == null ? void 0 : a(_context3.t0)) !== null && ae !== void 0 ? ae : E;
3451
3448
  window.clearTimeout(S), S = window.setTimeout(X, N);
3452
3449
  } catch (N) {
3453
3450
  V(), h(N);
@@ -3468,10 +3465,10 @@ function fo(s) {
3468
3465
  if (!(e != null && e.startsWith(Di))) throw new Error("Expected content-type to be ".concat(Di, ", Actual: ").concat(e));
3469
3466
  }
3470
3467
  var is = /*#__PURE__*/function () {
3471
- function ot() {
3472
- _classCallCheck(this, ot);
3468
+ function at() {
3469
+ _classCallCheck(this, at);
3473
3470
  }
3474
- _createClass(ot, null, [{
3471
+ _createClass(at, null, [{
3475
3472
  key: "generateResponse",
3476
3473
  value: function generateResponse(e) {
3477
3474
  var t = e.messages[e.messages.length - 1];
@@ -3494,15 +3491,15 @@ var is = /*#__PURE__*/function () {
3494
3491
  }, {
3495
3492
  key: "getResponse",
3496
3493
  value: function getResponse(e) {
3497
- return e.customDemoResponse ? ot.getCustomResponse(e.customDemoResponse, e.messages[e.messages.length - 1]) : {
3498
- text: ot.generateResponse(e)
3494
+ return e.customDemoResponse ? at.getCustomResponse(e.customDemoResponse, e.messages[e.messages.length - 1]) : {
3495
+ text: at.generateResponse(e)
3499
3496
  };
3500
3497
  }
3501
3498
  // timeout is used to simulate a timeout for a response to come back
3502
3499
  }, {
3503
3500
  key: "request",
3504
3501
  value: function request(e, t) {
3505
- var i = ot.getResponse(t);
3502
+ var i = at.getResponse(t);
3506
3503
  setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3507
3504
  var r, o, n;
3508
3505
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
@@ -3532,12 +3529,12 @@ var is = /*#__PURE__*/function () {
3532
3529
  key: "requestStream",
3533
3530
  value: function requestStream(e, t) {
3534
3531
  setTimeout(function () {
3535
- var i = ot.getResponse(e);
3532
+ var i = at.getResponse(e);
3536
3533
  C.simulate(e, t, i);
3537
3534
  }, 400);
3538
3535
  }
3539
3536
  }]);
3540
- return ot;
3537
+ return at;
3541
3538
  }();
3542
3539
  is.URL = "deep-chat-demo";
3543
3540
  var ve = is;
@@ -3637,7 +3634,7 @@ var C = /*#__PURE__*/function () {
3637
3634
  },
3638
3635
  onmessage: function onmessage(k) {
3639
3636
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
3640
- var G, X, oe, Q, N;
3637
+ var G, X, ae, Q, N;
3641
3638
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
3642
3639
  while (1) switch (_context6.prev = _context6.next) {
3643
3640
  case 0:
@@ -3657,7 +3654,7 @@ var C = /*#__PURE__*/function () {
3657
3654
  _context6.t0 = Q;
3658
3655
  case 7:
3659
3656
  N = _context6.t0;
3660
- (oe = e.extractResultData) == null || oe.call(e, N).then(function (Fe) {
3657
+ (ae = e.extractResultData) == null || ae.call(e, N).then(function (Fe) {
3661
3658
  h.upsertStreamedMessage(Fe);
3662
3659
  })["catch"](function (Fe) {
3663
3660
  return _.displayError(i, Fe);
@@ -4723,8 +4720,9 @@ var U = /*#__PURE__*/function (_Le) {
4723
4720
  }, {
4724
4721
  key: "buildRequestSettings",
4725
4722
  value: function buildRequestSettings(e, t) {
4723
+ var _i$headers;
4726
4724
  var i = t !== null && t !== void 0 ? t : {};
4727
- return i.headers = this.buildHeadersFunc(e), i;
4725
+ return (_i$headers = i.headers) !== null && _i$headers !== void 0 ? _i$headers : i.headers = {}, Object.assign(i.headers, this.buildHeadersFunc(e)), i;
4728
4726
  }
4729
4727
  }, {
4730
4728
  key: "keyAuthenticated",
@@ -5081,17 +5079,17 @@ var ss = /*#__PURE__*/function (_U) {
5081
5079
  }(U);
5082
5080
  ss.URL_PREFIX = "https://api-inference.huggingface.co/models/";
5083
5081
  var Pe = ss;
5084
- var yt = /*#__PURE__*/function (_Pe) {
5085
- _inherits(yt, _Pe);
5086
- var _super4 = _createSuper(yt);
5082
+ var xt = /*#__PURE__*/function (_Pe) {
5083
+ _inherits(xt, _Pe);
5084
+ var _super4 = _createSuper(xt);
5087
5085
  // prettier-ignore
5088
- function yt(e, t, i, n, r, o) {
5086
+ function xt(e, t, i, n, r, o) {
5089
5087
  var _this9;
5090
- _classCallCheck(this, yt);
5091
- _this9 = _super4.call(this, e, t, i, n, r, o), _this9.isTextInputDisabled = !0, _this9.canSendMessage = yt.canSendFile;
5088
+ _classCallCheck(this, xt);
5089
+ _this9 = _super4.call(this, e, t, i, n, r, o), _this9.isTextInputDisabled = !0, _this9.canSendMessage = xt.canSendFile;
5092
5090
  return _this9;
5093
5091
  }
5094
- _createClass(yt, [{
5092
+ _createClass(xt, [{
5095
5093
  key: "preprocessBody",
5096
5094
  value: function preprocessBody(e, t, i) {
5097
5095
  return i[0];
@@ -5134,10 +5132,10 @@ var yt = /*#__PURE__*/function (_Pe) {
5134
5132
  return !!(t != null && t[0]);
5135
5133
  }
5136
5134
  }]);
5137
- return yt;
5135
+ return xt;
5138
5136
  }(Pe);
5139
- var yo = /*#__PURE__*/function (_yt) {
5140
- _inherits(yo, _yt);
5137
+ var yo = /*#__PURE__*/function (_xt) {
5138
+ _inherits(yo, _xt);
5141
5139
  var _super5 = _createSuper(yo);
5142
5140
  // prettier-ignore
5143
5141
  function yo(e) {
@@ -5187,9 +5185,9 @@ var yo = /*#__PURE__*/function (_yt) {
5187
5185
  }()
5188
5186
  }]);
5189
5187
  return yo;
5190
- }(yt);
5191
- var xo = /*#__PURE__*/function (_yt2) {
5192
- _inherits(xo, _yt2);
5188
+ }(xt);
5189
+ var xo = /*#__PURE__*/function (_xt2) {
5190
+ _inherits(xo, _xt2);
5193
5191
  var _super6 = _createSuper(xo);
5194
5192
  function xo(e) {
5195
5193
  _classCallCheck(this, xo);
@@ -5238,13 +5236,13 @@ var xo = /*#__PURE__*/function (_yt2) {
5238
5236
  }()
5239
5237
  }]);
5240
5238
  return xo;
5241
- }(yt);
5242
- var xt = "data:image/png;base64,";
5243
- var re = /*#__PURE__*/function () {
5244
- function re() {
5245
- _classCallCheck(this, re);
5239
+ }(xt);
5240
+ var Et = "data:image/png;base64,";
5241
+ var oe = /*#__PURE__*/function () {
5242
+ function oe() {
5243
+ _classCallCheck(this, oe);
5246
5244
  }
5247
- _createClass(re, null, [{
5245
+ _createClass(oe, null, [{
5248
5246
  key: "buildHeaders",
5249
5247
  value: function buildHeaders(e) {
5250
5248
  return {
@@ -5264,11 +5262,11 @@ var re = /*#__PURE__*/function () {
5264
5262
  return {
5265
5263
  url: "https://api.stability.ai/v1/engines/list",
5266
5264
  method: "GET",
5267
- handleVerificationResult: re.handleVerificationResult
5265
+ handleVerificationResult: oe.handleVerificationResult
5268
5266
  };
5269
5267
  }
5270
5268
  }]);
5271
- return re;
5269
+ return oe;
5272
5270
  }();
5273
5271
  var ni = /*#__PURE__*/function (_U2) {
5274
5272
  _inherits(ni, _U2);
@@ -5299,7 +5297,7 @@ var zt = /*#__PURE__*/function (_ni) {
5299
5297
  }
5300
5298
  }
5301
5299
  };
5302
- _this11 = _super8.call(this, e, re.buildKeyVerificationDetails(), re.buildHeaders, i, n), _this11.url = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale", _this11.textInputPlaceholderText = "Describe image changes", _this11.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Upscale</b></div>\n <p>Upload an image to generate a new one with higher resolution.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
5300
+ _this11 = _super8.call(this, e, oe.buildKeyVerificationDetails(), oe.buildHeaders, i, n), _this11.url = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale", _this11.textInputPlaceholderText = "Describe image changes", _this11.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Upscale</b></div>\n <p>Upload an image to generate a new one with higher resolution.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
5303
5301
  var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageUpscale;
5304
5302
  _typeof(r) == "object" && (r.engine_id && (_this11.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")), zt.cleanConfig(r), Object.assign(_this11.rawBody, r)), _this11.canSendMessage = zt.canSendFileMessage;
5305
5303
  return _this11;
@@ -5362,7 +5360,7 @@ var zt = /*#__PURE__*/function (_ni) {
5362
5360
  return _context28.abrupt("return", {
5363
5361
  files: e.artifacts.map(function (i) {
5364
5362
  return {
5365
- src: "".concat(xt).concat(i.base64),
5363
+ src: "".concat(Et).concat(i.base64),
5366
5364
  type: "image"
5367
5365
  };
5368
5366
  })
@@ -5408,7 +5406,7 @@ var Ut = /*#__PURE__*/function (_ni2) {
5408
5406
  }
5409
5407
  }
5410
5408
  };
5411
- _this12 = _super9.call(this, e, re.buildKeyVerificationDetails(), re.buildHeaders, i, n), _this12.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this12._maskSource = "MASK_IMAGE_WHITE", _this12.textInputPlaceholderText = "Describe image changes", _this12.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Masking</b></div>\n <p>Upload an image, its mask image to create a new one based on the changes you have described for the mask area.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
5409
+ _this12 = _super9.call(this, e, oe.buildKeyVerificationDetails(), oe.buildHeaders, i, n), _this12.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this12._maskSource = "MASK_IMAGE_WHITE", _this12.textInputPlaceholderText = "Describe image changes", _this12.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Masking</b></div>\n <p>Upload an image, its mask image to create a new one based on the changes you have described for the mask area.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
5412
5410
  var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
5413
5411
  _typeof(r) == "object" && (r.engine_id && (_this12.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this12._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this12._maskSource = r.mask_source), Ut.cleanConfig(r), Object.assign(_this12.rawBody, r)), _this12.canSendMessage = Ut.canSendFileTextMessage;
5414
5412
  return _this12;
@@ -5471,7 +5469,7 @@ var Ut = /*#__PURE__*/function (_ni2) {
5471
5469
  return _context30.abrupt("return", {
5472
5470
  files: e.artifacts.map(function (i) {
5473
5471
  return {
5474
- src: "".concat(xt).concat(i.base64),
5472
+ src: "".concat(Et).concat(i.base64),
5475
5473
  type: "image"
5476
5474
  };
5477
5475
  })
@@ -5500,8 +5498,8 @@ var Ut = /*#__PURE__*/function (_ni2) {
5500
5498
  }]);
5501
5499
  return Ut;
5502
5500
  }(ni);
5503
- var Eo = /*#__PURE__*/function (_yt3) {
5504
- _inherits(Eo, _yt3);
5501
+ var Eo = /*#__PURE__*/function (_xt3) {
5502
+ _inherits(Eo, _xt3);
5505
5503
  var _super10 = _createSuper(Eo);
5506
5504
  function Eo(e) {
5507
5505
  _classCallCheck(this, Eo);
@@ -5549,7 +5547,7 @@ var Eo = /*#__PURE__*/function (_yt3) {
5549
5547
  }()
5550
5548
  }]);
5551
5549
  return Eo;
5552
- }(yt);
5550
+ }(xt);
5553
5551
  var So = /*#__PURE__*/function (_Pe2) {
5554
5552
  _inherits(So, _Pe2);
5555
5553
  var _super11 = _createSuper(So);
@@ -5787,7 +5785,7 @@ var qt = /*#__PURE__*/function (_ni3) {
5787
5785
  }
5788
5786
  }
5789
5787
  };
5790
- _this15 = _super15.call(this, e, re.buildKeyVerificationDetails(), re.buildHeaders, i, n), _this15.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this15.textInputPlaceholderText = "Describe image changes", _this15.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Image to Image</b></div>\n <p>Upload an image to create a new one with the changes you have described.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
5788
+ _this15 = _super15.call(this, e, oe.buildKeyVerificationDetails(), oe.buildHeaders, i, n), _this15.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this15.textInputPlaceholderText = "Describe image changes", _this15.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Image to Image</b></div>\n <p>Upload an image to create a new one with the changes you have described.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
5791
5789
  var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
5792
5790
  _typeof(r) == "object" && (r.engine_id && (_this15.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this15._imageWeight = r.weight), qt.cleanConfig(r), Object.assign(_this15.rawBody, r)), _this15.canSendMessage = qt.canSendFileTextMessage;
5793
5791
  return _this15;
@@ -5850,7 +5848,7 @@ var qt = /*#__PURE__*/function (_ni3) {
5850
5848
  return _context37.abrupt("return", {
5851
5849
  files: e.artifacts.map(function (i) {
5852
5850
  return {
5853
- src: "".concat(xt).concat(i.base64),
5851
+ src: "".concat(Et).concat(i.base64),
5854
5852
  type: "image"
5855
5853
  };
5856
5854
  })
@@ -5928,7 +5926,7 @@ var Ht = /*#__PURE__*/function (_ni4) {
5928
5926
  var r;
5929
5927
  var t = JSON.parse(JSON.stringify(e.directConnection)),
5930
5928
  i = t.stabilityAI;
5931
- _this16 = _super17.call(this, e, re.buildKeyVerificationDetails(), re.buildHeaders, i), _this16.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/text-to-image", _this16.textInputPlaceholderText = "Describe an image", _this16.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Text to Image</b></div>\n <p>Insert text to generate an image.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
5929
+ _this16 = _super17.call(this, e, oe.buildKeyVerificationDetails(), oe.buildHeaders, i), _this16.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/text-to-image", _this16.textInputPlaceholderText = "Describe an image", _this16.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Text to Image</b></div>\n <p>Insert text to generate an image.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
5932
5930
  var n = (r = t.stabilityAI) == null ? void 0 : r.textToImage;
5933
5931
  _typeof(n) == "object" && (n.engine_id && (_this16.url = "https://api.stability.ai/v1/generation/".concat(n.engine_id, "/text-to-image")), n.weight !== void 0 && n.weight !== null && (_this16._imageWeight = n.weight), Ht.cleanConfig(n), Object.assign(_this16.rawBody, n)), _this16.canSendMessage = Ht.canSendTextMessage;
5934
5932
  return _this16;
@@ -5985,7 +5983,7 @@ var Ht = /*#__PURE__*/function (_ni4) {
5985
5983
  return _context40.abrupt("return", {
5986
5984
  files: e.artifacts.map(function (i) {
5987
5985
  return {
5988
- src: "".concat(xt).concat(i.base64),
5986
+ src: "".concat(Et).concat(i.base64),
5989
5987
  type: "image"
5990
5988
  };
5991
5989
  })
@@ -6871,11 +6869,11 @@ var Oo = /*#__PURE__*/function (_Ro) {
6871
6869
  }]);
6872
6870
  return Oo;
6873
6871
  }(Ro);
6874
- var ct = /*#__PURE__*/function () {
6875
- function ct() {
6876
- _classCallCheck(this, ct);
6872
+ var dt = /*#__PURE__*/function () {
6873
+ function dt() {
6874
+ _classCallCheck(this, dt);
6877
6875
  }
6878
- _createClass(ct, null, [{
6876
+ _createClass(dt, null, [{
6879
6877
  key: "poll",
6880
6878
  value: function () {
6881
6879
  var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(e, t) {
@@ -6971,11 +6969,11 @@ var ct = /*#__PURE__*/function () {
6971
6969
  return {
6972
6970
  url: "https://api.assemblyai.com/v2/upload",
6973
6971
  method: "POST",
6974
- handleVerificationResult: ct.handleVerificationResult
6972
+ handleVerificationResult: dt.handleVerificationResult
6975
6973
  };
6976
6974
  }
6977
6975
  }]);
6978
- return ct;
6976
+ return dt;
6979
6977
  }();
6980
6978
  var Yi = /*#__PURE__*/function (_U7) {
6981
6979
  _inherits(Yi, _U7);
@@ -6985,7 +6983,7 @@ var Yi = /*#__PURE__*/function (_U7) {
6985
6983
  _classCallCheck(this, Yi);
6986
6984
  var i;
6987
6985
  var t = (i = e.directConnection) == null ? void 0 : i.assemblyAI;
6988
- _this23 = _super26.call(this, e, ct.buildKeyVerificationDetails(), ct.buildHeaders, t, {
6986
+ _this23 = _super26.call(this, e, dt.buildKeyVerificationDetails(), dt.buildHeaders, t, {
6989
6987
  audio: {}
6990
6988
  }), _this23.insertKeyPlaceholderText = "AssemblyAI API Key", _this23.getKeyLink = "https://www.assemblyai.com/app/account", _this23.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>AssemblyAI Audio</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"https://www.assemblyai.com/docs/Guides/transcribing_an_audio_file#get-started\">here</a> for more info.\n </p>", _this23.url = "https://api.assemblyai.com/v2/upload", _this23.isTextInputDisabled = !0, _this23.textInputPlaceholderText = "Upload an audio file", _this23.permittedErrorPrefixes = ["Authentication", "Invalid"], _this23.canSendMessage = Yi.canFileSendMessage;
6991
6989
  return _this23;
@@ -7038,7 +7036,7 @@ var Yi = /*#__PURE__*/function (_U7) {
7038
7036
  case 2:
7039
7037
  t = (r = (n = this.requestSettings) == null ? void 0 : n.headers) == null ? void 0 : r.Authorization;
7040
7038
  _context58.next = 5;
7041
- return ct.poll(t, e.upload_url);
7039
+ return dt.poll(t, e.upload_url);
7042
7040
  case 5:
7043
7041
  _context58.t0 = _context58.sent.text;
7044
7042
  return _context58.abrupt("return", {
@@ -7334,12 +7332,12 @@ var Do = /*#__PURE__*/function (_U9) {
7334
7332
  return Do;
7335
7333
  }(U);
7336
7334
  var Zi = /*#__PURE__*/function (_U10) {
7337
- _inherits(ae, _U10);
7338
- var _super31 = _createSuper(ae);
7339
- function ae(e) {
7335
+ _inherits(le, _U10);
7336
+ var _super31 = _createSuper(le);
7337
+ function le(e) {
7340
7338
  var _l$headers, _c$OpenAIBeta;
7341
7339
  var _this28;
7342
- _classCallCheck(this, ae);
7340
+ _classCallCheck(this, le);
7343
7341
  var r, o, a, l, c;
7344
7342
  var t = JSON.parse(JSON.stringify(e.directConnection)),
7345
7343
  i = t.openAI;
@@ -7354,7 +7352,7 @@ var Zi = /*#__PURE__*/function (_U10) {
7354
7352
  (_l$headers = (l = _this28.requestSettings).headers) !== null && _l$headers !== void 0 ? _l$headers : l.headers = {}, (_c$OpenAIBeta = (c = _this28.requestSettings.headers)["OpenAI-Beta"]) !== null && _c$OpenAIBeta !== void 0 ? _c$OpenAIBeta : c["OpenAI-Beta"] = "assistants=v1", _this28.maxMessages = 1;
7355
7353
  return _this28;
7356
7354
  }
7357
- _createClass(ae, [{
7355
+ _createClass(le, [{
7358
7356
  key: "processMessage",
7359
7357
  value: function processMessage(e, t) {
7360
7358
  var i = this.totalMessagesMaxCharLength || -1;
@@ -7377,11 +7375,11 @@ var Zi = /*#__PURE__*/function (_U10) {
7377
7375
  key: "callService",
7378
7376
  value: function callService(e, t, i) {
7379
7377
  if (this.sessionId) {
7380
- this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/messages");
7378
+ this.url = "".concat(le.THREAD_PREFIX, "/").concat(this.sessionId, "/messages");
7381
7379
  var n = this.processMessage(t, i);
7382
7380
  w.request(this, n, e);
7383
7381
  } else {
7384
- this.url = "".concat(ae.THREAD_PREFIX, "/runs");
7382
+ this.url = "".concat(le.THREAD_PREFIX, "/runs");
7385
7383
  var _n2 = this.createNewThreadMessages(this.rawBody, t, i);
7386
7384
  w.request(this, _n2, e);
7387
7385
  }
@@ -7453,7 +7451,7 @@ var Zi = /*#__PURE__*/function (_U10) {
7453
7451
  _context66.next = 4;
7454
7452
  return this.assignThreadAndRun(e);
7455
7453
  case 4:
7456
- t = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id), i = {
7454
+ t = "".concat(le.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id), i = {
7457
7455
  method: "GET",
7458
7456
  headers: (n = this.requestSettings) == null ? void 0 : n.headers
7459
7457
  };
@@ -7483,7 +7481,7 @@ var Zi = /*#__PURE__*/function (_U10) {
7483
7481
  _context67.next = 8;
7484
7482
  break;
7485
7483
  }
7486
- this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs");
7484
+ this.url = "".concat(le.THREAD_PREFIX, "/").concat(this.sessionId, "/runs");
7487
7485
  _context67.next = 4;
7488
7486
  return O.directFetch(this, JSON.parse(JSON.stringify(this.rawBody)), "POST");
7489
7487
  case 4:
@@ -7518,14 +7516,14 @@ var Zi = /*#__PURE__*/function (_U10) {
7518
7516
  break;
7519
7517
  }
7520
7518
  return _context68.abrupt("return", {
7521
- timeoutMS: ae.POLLING_TIMEOUT_MS
7519
+ timeoutMS: le.POLLING_TIMEOUT_MS
7522
7520
  });
7523
7521
  case 3:
7524
7522
  if (!(t === "completed" && this.messages)) {
7525
7523
  _context68.next = 10;
7526
7524
  break;
7527
7525
  }
7528
- this.url = "".concat(ae.THREAD_PREFIX, "/").concat(e.thread_id, "/messages");
7526
+ this.url = "".concat(le.THREAD_PREFIX, "/").concat(e.thread_id, "/messages");
7529
7527
  _context68.next = 7;
7530
7528
  return O.directFetch(this, {}, "GET");
7531
7529
  case 7:
@@ -7596,14 +7594,14 @@ var Zi = /*#__PURE__*/function (_U10) {
7596
7594
  output: r
7597
7595
  };
7598
7596
  });
7599
- this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id, "/submit_tool_outputs");
7597
+ this.url = "".concat(le.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id, "/submit_tool_outputs");
7600
7598
  _context69.next = 12;
7601
7599
  return O.directFetch(this, {
7602
7600
  tool_outputs: n
7603
7601
  }, "POST");
7604
7602
  case 12:
7605
7603
  return _context69.abrupt("return", {
7606
- timeoutMS: ae.POLLING_TIMEOUT_MS
7604
+ timeoutMS: le.POLLING_TIMEOUT_MS
7607
7605
  });
7608
7606
  case 13:
7609
7607
  case "end":
@@ -7617,7 +7615,7 @@ var Zi = /*#__PURE__*/function (_U10) {
7617
7615
  return handleTools;
7618
7616
  }()
7619
7617
  }]);
7620
- return ae;
7618
+ return le;
7621
7619
  }(U);
7622
7620
  Zi.THREAD_PREFIX = "https://api.openai.com/v1/threads";
7623
7621
  Zi.POLLING_TIMEOUT_MS = 800;
@@ -7734,7 +7732,7 @@ var ri = /*#__PURE__*/function (_U11) {
7734
7732
  src: i.url,
7735
7733
  type: "image"
7736
7734
  } : {
7737
- src: "".concat(xt).concat(i.b64_json),
7735
+ src: "".concat(Et).concat(i.b64_json),
7738
7736
  type: "image"
7739
7737
  };
7740
7738
  })
@@ -7778,20 +7776,20 @@ ri.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations";
7778
7776
  ri.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations";
7779
7777
  ri.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
7780
7778
  var Bo = ri;
7781
- var dt = /*#__PURE__*/function (_U12) {
7782
- _inherits(dt, _U12);
7783
- var _super33 = _createSuper(dt);
7784
- function dt(e) {
7779
+ var ut = /*#__PURE__*/function (_U12) {
7780
+ _inherits(ut, _U12);
7781
+ var _super33 = _createSuper(ut);
7782
+ function ut(e) {
7785
7783
  var _this30$maxMessages, _l$model;
7786
7784
  var _this30;
7787
- _classCallCheck(this, dt);
7785
+ _classCallCheck(this, ut);
7788
7786
  var r, o, a, l;
7789
7787
  var t = JSON.parse(JSON.stringify(e.directConnection)),
7790
7788
  i = t.openAI;
7791
- _this30 = _super33.call(this, e, O.buildKeyVerificationDetails(), O.buildHeaders, i), _this30.insertKeyPlaceholderText = "OpenAI API Key", _this30.getKeyLink = "https://platform.openai.com/account/api-keys", _this30.url = "https://api.openai.com/v1/chat/completions", _this30.permittedErrorPrefixes = ["Incorrect"], _this30._systemMessage = dt.generateSystemMessage("You are a helpful assistant.");
7789
+ _this30 = _super33.call(this, e, O.buildKeyVerificationDetails(), O.buildHeaders, i), _this30.insertKeyPlaceholderText = "OpenAI API Key", _this30.getKeyLink = "https://platform.openai.com/account/api-keys", _this30.url = "https://api.openai.com/v1/chat/completions", _this30.permittedErrorPrefixes = ["Incorrect"], _this30._systemMessage = ut.generateSystemMessage("You are a helpful assistant.");
7792
7790
  var n = (r = t.openAI) == null ? void 0 : r.chat;
7793
7791
  if (_typeof(n) == "object") {
7794
- n.system_prompt && (_this30._systemMessage = dt.generateSystemMessage(n.system_prompt));
7792
+ n.system_prompt && (_this30._systemMessage = ut.generateSystemMessage(n.system_prompt));
7795
7793
  var _ref9 = (a = (o = e.directConnection) == null ? void 0 : o.openAI) == null ? void 0 : a.chat,
7796
7794
  c = _ref9.function_handler;
7797
7795
  c && (_this30._functionHandler = c), _this30.cleanConfig(n), Object.assign(_this30.rawBody, n);
@@ -7799,7 +7797,7 @@ var dt = /*#__PURE__*/function (_U12) {
7799
7797
  (_this30$maxMessages = _this30.maxMessages) !== null && _this30$maxMessages !== void 0 ? _this30$maxMessages : _this30.maxMessages = -1, (_l$model = (l = _this30.rawBody).model) !== null && _l$model !== void 0 ? _l$model : l.model = "gpt-3.5-turbo";
7800
7798
  return _this30;
7801
7799
  }
7802
- _createClass(dt, [{
7800
+ _createClass(ut, [{
7803
7801
  key: "cleanConfig",
7804
7802
  value: function cleanConfig(e) {
7805
7803
  delete e.system_prompt, delete e.function_handler;
@@ -7813,7 +7811,7 @@ var dt = /*#__PURE__*/function (_U12) {
7813
7811
  var i = JSON.parse(JSON.stringify(e)),
7814
7812
  n = Xe.getCharacterLimitMessages(t, this.totalMessagesMaxCharLength ? this.totalMessagesMaxCharLength - this._systemMessage.content.length : -1).map(function (r) {
7815
7813
  return {
7816
- content: dt.getContent(r),
7814
+ content: ut.getContent(r),
7817
7815
  role: r.role === v.USER_ROLE ? "user" : "assistant"
7818
7816
  };
7819
7817
  });
@@ -7984,7 +7982,7 @@ var dt = /*#__PURE__*/function (_U12) {
7984
7982
  return e.text;
7985
7983
  }
7986
7984
  }]);
7987
- return dt;
7985
+ return ut;
7988
7986
  }(U);
7989
7987
  var Fo = /*#__PURE__*/function (_Ji3) {
7990
7988
  _inherits(Fo, _Ji3);
@@ -8071,36 +8069,40 @@ var Fo = /*#__PURE__*/function (_Ji3) {
8071
8069
  }]);
8072
8070
  return Fo;
8073
8071
  }(Ji);
8074
- var Et = /*#__PURE__*/function () {
8075
- function pe() {
8076
- _classCallCheck(this, pe);
8072
+ var et = /*#__PURE__*/function () {
8073
+ function ne() {
8074
+ _classCallCheck(this, ne);
8077
8075
  }
8078
- _createClass(pe, null, [{
8076
+ _createClass(ne, null, [{
8079
8077
  key: "enableButtons",
8080
8078
  value: function enableButtons(e, t) {
8081
8079
  var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
8082
8080
  window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i < cs.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
8083
- return pe.enableButtons(e, t, i + 1);
8081
+ return ne.enableButtons(e, t, i + 1);
8084
8082
  }, 250);
8085
8083
  }
8086
8084
  }, {
8087
8085
  key: "setUpInitial",
8088
8086
  value: function setUpInitial(e, t, i) {
8089
- var n = (t == null ? void 0 : t.downloadClass) || pe.DOWNLOAD_BUTTON_CLASS,
8090
- r = (t == null ? void 0 : t.uploadClass) || pe.UPLOAD_BUTTON_CLASS,
8091
- o = (t == null ? void 0 : t.fileInputClass) || pe.FILE_INPUT_CLASS;
8087
+ var n = (t == null ? void 0 : t.downloadClass) || ne.DOWNLOAD_BUTTON_CLASS,
8088
+ r = (t == null ? void 0 : t.uploadClass) || ne.UPLOAD_BUTTON_CLASS,
8089
+ o = (t == null ? void 0 : t.fileInputClass) || ne.FILE_INPUT_CLASS,
8090
+ a = (t == null ? void 0 : t.clearCacheClass) || ne.CLEAR_CACHE_CLASS;
8092
8091
  return setTimeout(function () {
8093
- var a = i == null ? void 0 : i.getElementsByClassName(o)[0],
8094
- l = i == null ? void 0 : i.getElementsByClassName(n)[0],
8095
- c = i == null ? void 0 : i.getElementsByClassName(r)[0];
8096
- l && (l.onclick = function () {
8092
+ var l = i == null ? void 0 : i.getElementsByClassName(o)[0],
8093
+ c = i == null ? void 0 : i.getElementsByClassName(n)[0],
8094
+ d = i == null ? void 0 : i.getElementsByClassName(r)[0],
8095
+ u = i == null ? void 0 : i.getElementsByClassName(a)[0];
8096
+ c && (c.onclick = function () {
8097
8097
  return e();
8098
- }), a && (a.onchange = function () {
8099
- a.files && a.files.length > 0 && e(a.files);
8100
- }), c && (c.onclick = function () {
8101
- return a.click();
8102
- }), (l || c) && pe.enableButtons(l, c);
8103
- }), (t == null ? void 0 : t.startHtml) || "<div>\n Initialize or upload a web model that will run entirely on your browser. <br/> \n <button disabled class=\"".concat(n, " deep-chat-button deep-chat-web-model-button\">Start</button>\n <input type=\"file\" class=\"").concat(o, "\" hidden multiple />\n <button disabled class=\"").concat(r, " deep-chat-button deep-chat-web-model-button\">Upload</button>\n </div>");
8098
+ }), l && (l.onchange = function () {
8099
+ l.files && l.files.length > 0 && e(l.files);
8100
+ }), d && (d.onclick = function () {
8101
+ return l.click();
8102
+ }), u && (d.onclick = function () {
8103
+ return ne.clearCache;
8104
+ }), (c || d) && ne.enableButtons(c, d);
8105
+ }), (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(n, " deep-chat-button deep-chat-web-model-button\">Download</button>\n <input type=\"file\" class=\"").concat(o, "\" hidden multiple />\n <button disabled class=\"").concat(r, " deep-chat-button deep-chat-web-model-button\">Upload</button>\n <button disabled class=\"").concat(r, " deep-chat-button deep-chat-web-model-button\">Clear cache</button>\n </div>");
8104
8106
  }
8105
8107
  }, {
8106
8108
  key: "exportFile",
@@ -8123,22 +8125,34 @@ var Et = /*#__PURE__*/function () {
8123
8125
  }, {
8124
8126
  key: "setUpAfterLoad",
8125
8127
  value: function setUpAfterLoad(e, t, i) {
8126
- var n = (t == null ? void 0 : t.exportFilesClass) || pe.EXPORT_BUTTON_CLASS;
8128
+ var n = (t == null ? void 0 : t.exportFilesClass) || ne.EXPORT_BUTTON_CLASS;
8127
8129
  return setTimeout(function () {
8128
8130
  var r = i == null ? void 0 : i.getElementsByClassName(n)[0];
8129
8131
  r && (r.onclick = function () {
8130
- return pe.exportFile(e);
8132
+ return ne.exportFile(e);
8131
8133
  });
8132
8134
  }), (t == null ? void 0 : t.afterLoadHtml) || "<div>\n Model loaded successfully and has been cached for future requests. <br/>\n <button class=\"".concat(n, " deep-chat-button deep-chat-web-model-button\">Export Files</button>\n </div>");
8133
8135
  }
8136
+ }, {
8137
+ key: "clearCache",
8138
+ value: function clearCache() {
8139
+ caches.open("webllm/model").then(function (e) {
8140
+ e.keys().then(function (t) {
8141
+ t.forEach(function (i) {
8142
+ e["delete"](i);
8143
+ });
8144
+ });
8145
+ });
8146
+ }
8134
8147
  }]);
8135
- return pe;
8148
+ return ne;
8136
8149
  }();
8137
- Et.DOWNLOAD_BUTTON_CLASS = "deep-chat-download-button";
8138
- Et.UPLOAD_BUTTON_CLASS = "deep-chat-upload-button";
8139
- Et.FILE_INPUT_CLASS = "deep-chat-file-input";
8140
- Et.EXPORT_BUTTON_CLASS = "deep-chat-export-button";
8141
- var vn = Et;
8150
+ et.DOWNLOAD_BUTTON_CLASS = "deep-chat-download-button";
8151
+ et.UPLOAD_BUTTON_CLASS = "deep-chat-upload-button";
8152
+ et.FILE_INPUT_CLASS = "deep-chat-file-input";
8153
+ et.CLEAR_CACHE_CLASS = "deep-chat-clear-cache-button";
8154
+ et.EXPORT_BUTTON_CLASS = "deep-chat-export-button";
8155
+ var vn = et;
8142
8156
  var yn = {
8143
8157
  model_list: [{
8144
8158
  model_url: "https://huggingface.co/mlc-ai/mlc-chat-Llama-2-7b-chat-hf-q4f32_1/resolve/main/",
@@ -8231,7 +8245,7 @@ var yn = {
8231
8245
  },
8232
8246
  use_web_worker: !0
8233
8247
  },
8234
- et = /*#__PURE__*/function (_Le2) {
8248
+ tt = /*#__PURE__*/function (_Le2) {
8235
8249
  _inherits(T, _Le2);
8236
8250
  var _super35 = _createSuper(T);
8237
8251
  function T(e) {
@@ -8271,7 +8285,7 @@ var yn = {
8271
8285
  value: function scrollToTop(e) {
8272
8286
  var _this35 = this;
8273
8287
  var t;
8274
- ((t = this._webModel.introMessage) == null ? void 0 : t.scroll) !== !1 && setTimeout(function () {
8288
+ ((t = this._webModel.introMessage) == null ? void 0 : t.autoScroll) !== !1 && setTimeout(function () {
8275
8289
  var i, n;
8276
8290
  (i = _this35._messages) != null && i.elementRef && Y.scrollToTop((n = _this35._messages) == null ? void 0 : n.elementRef);
8277
8291
  }, e);
@@ -8368,18 +8382,19 @@ var yn = {
8368
8382
  }, {
8369
8383
  key: "getConfig",
8370
8384
  value: function getConfig() {
8385
+ var i, n;
8371
8386
  var e = T.DEFAULT_MODEL;
8372
8387
  this._webModel.model && (e = this._webModel.model);
8373
8388
  var t = JSON.parse(JSON.stringify(yn));
8374
- if (this._webModel.modelUrl) {
8375
- var i = t.model_list.find(function (n) {
8376
- return n.local_id = e;
8389
+ if ((i = this._webModel.urls) != null && i.model) {
8390
+ var r = t.model_list.find(function (o) {
8391
+ return o.local_id = e;
8377
8392
  });
8378
- i && (i.model_url = this._webModel.modelUrl);
8393
+ r && (r.model_url = this._webModel.urls.model);
8379
8394
  }
8380
- if (this._webModel.wasmUrl) {
8381
- var _i9 = e;
8382
- t.model_lib_map[_i9] && (t.model_lib_map[_i9] = "".concat(this._webModel.wasmUrl).concat(e, "-webgpu.wasm"));
8395
+ if ((n = this._webModel.urls) != null && n.wasm) {
8396
+ var _r2 = e;
8397
+ t.model_lib_map[_r2] && (t.model_lib_map[_r2] = this._webModel.urls.wasm);
8383
8398
  }
8384
8399
  return {
8385
8400
  model: e,
@@ -8622,12 +8637,12 @@ var yn = {
8622
8637
  }]);
8623
8638
  return T;
8624
8639
  }(Le);
8625
- et.GENERIC_ERROR = "ERROR. Your browser may not support this model. Please check the following setup [instructions](https://webllm.mlc.ai/#instructions).";
8626
- et.MULTIPLE_MODELS_ERROR = "Cannot run multiple web models";
8627
- et.WEB_LLM_NOT_FOUND_ERROR = "WebLLM module not found";
8628
- et.DEFAULT_MODEL = "Llama-2-7b-chat-hf-q4f32_1";
8629
- et.MODULE_SEARCH_LIMIT_S = 5;
8630
- var cs = et;
8640
+ tt.GENERIC_ERROR = "Error, please check the following list of [instructions](https://deepchat.dev/docs/webModel#error) to fix this.";
8641
+ tt.MULTIPLE_MODELS_ERROR = "Cannot run multiple web models";
8642
+ tt.WEB_LLM_NOT_FOUND_ERROR = "WebLLM module not found";
8643
+ tt.DEFAULT_MODEL = "Llama-2-7b-chat-hf-q4f32_1";
8644
+ tt.MODULE_SEARCH_LIMIT_S = 5;
8645
+ var cs = tt;
8631
8646
  var zo = /*#__PURE__*/function () {
8632
8647
  function zo() {
8633
8648
  _classCallCheck(this, zo);
@@ -8641,7 +8656,7 @@ var zo = /*#__PURE__*/function () {
8641
8656
  r = e.webModel;
8642
8657
  if (r) return new cs(e);
8643
8658
  if (t) {
8644
- if (t.openAI) return t.openAI.images ? new Bo(e) : t.openAI.speechToText ? new Lo(e) : t.openAI.textToSpeech ? new Io(e) : t.openAI.assistant ? new jo(e) : new dt(e);
8659
+ if (t.openAI) return t.openAI.images ? new Bo(e) : t.openAI.speechToText ? new Lo(e) : t.openAI.textToSpeech ? new Io(e) : t.openAI.assistant ? new jo(e) : new ut(e);
8645
8660
  if (t.assemblyAI) return new Yi(e);
8646
8661
  if (t.cohere) return t.cohere.textGeneration ? new Ao(e) : t.cohere.summarization ? new ko(e) : new Fo(e);
8647
8662
  if (t.huggingFace) return t.huggingFace.textGeneration ? new So(e) : t.huggingFace.summarization ? new wo(e) : t.huggingFace.translation ? new To(e) : t.huggingFace.fillMask ? new Co(e) : t.huggingFace.questionAnswer ? new _o(e) : t.huggingFace.audioSpeechRecognition ? new Eo(e) : t.huggingFace.audioClassification ? new yo(e) : t.huggingFace.imageClassification ? new xo(e) : new Mo(e);
@@ -8669,8 +8684,8 @@ var ds = /*#__PURE__*/function () {
8669
8684
  if (!Array.from(e.getElementsByTagName("link")).some(function (i) {
8670
8685
  return i.getAttribute("href") === zi.FONT_URL;
8671
8686
  })) {
8672
- var _i10 = document.createElement("link");
8673
- _i10.rel = "stylesheet", _i10.href = zi.FONT_URL, e.appendChild(_i10);
8687
+ var _i9 = document.createElement("link");
8688
+ _i9.rel = "stylesheet", _i9.href = zi.FONT_URL, e.appendChild(_i9);
8674
8689
  }
8675
8690
  }
8676
8691
  }]);
@@ -8777,7 +8792,7 @@ var qo = /*#__PURE__*/function () {
8777
8792
  key: "getText",
8778
8793
  value: function getText(e, t) {
8779
8794
  var i, n;
8780
- if (!e.directConnection && !e.request && !e.demo) return "Connect to any API using the [request](https://deepchat.dev/docs/connect#Request)\n property or choose any one of the preconfigured APIs via\n the [directConnection](https://deepchat.dev/docs/directConnection/#directConnection) property.\n \n To get started checkout the [Start](https://deepchat.dev/start) page and\n live code [examples](https://deepchat.dev/examples/frameworks).\n \n To remove this message set the [demo](https://deepchat.dev/docs/demo#demo) property to true.";
8795
+ if (!e.directConnection && !e.request && !e.webModel && !e.demo) return "Connect to any API using the [request](https://deepchat.dev/docs/connect#Request)\n property or a popular service via\n [directConnection](https://deepchat.dev/docs/directConnection/#directConnection).\n \n Host AI entirely on your browser via [webModel](HERE).\n \n To get started checkout the [Start](https://deepchat.dev/start) page and\n live code [examples](https://deepchat.dev/examples/frameworks).\n \n To remove this message set the [demo](https://deepchat.dev/docs/demo#demo) property to true.";
8781
8796
  if (e.directConnection) {
8782
8797
  if (!t.isDirectConnection()) return "Please define a valid service inside\n the [directConnection](https://deepchat.dev/docs/directConnection/#directConnection) object.";
8783
8798
  var r = (i = e.directConnection.openAI) == null ? void 0 : i.chat;
@@ -8799,7 +8814,7 @@ var fe = /*#__PURE__*/function () {
8799
8814
  key: "createImage",
8800
8815
  value: function createImage(e, t) {
8801
8816
  var i = new Image();
8802
- return i.src = e.src, ne.scrollDownOnImageLoad(i.src, t), ne.processContent(i, i.src);
8817
+ return i.src = e.src, se.scrollDownOnImageLoad(i.src, t), se.processContent(i, i.src);
8803
8818
  }
8804
8819
  // WORK - should base64 images be clickable?
8805
8820
  // WORK - image still does not scroll down when loaded
@@ -8812,7 +8827,7 @@ var fe = /*#__PURE__*/function () {
8812
8827
  while (1) switch (_context85.prev = _context85.next) {
8813
8828
  case 0:
8814
8829
  n = fe.createImage(t, e.elementRef), r = e.createNewMessageElement("", i);
8815
- r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"), ne.addMessage(e, r, "image", i);
8830
+ r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"), se.addMessage(e, r, "image", i);
8816
8831
  case 2:
8817
8832
  case "end":
8818
8833
  return _context85.stop();
@@ -8835,7 +8850,7 @@ var fe = /*#__PURE__*/function () {
8835
8850
  value: function addNewAudioMessage(e, t, i) {
8836
8851
  var n = fe.createAudioElement(t, i),
8837
8852
  r = e.createNewMessageElement("", i);
8838
- r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"), ne.addMessage(e, r, "audio", i);
8853
+ r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"), se.addMessage(e, r, "audio", i);
8839
8854
  }
8840
8855
  }, {
8841
8856
  key: "createAnyFile",
@@ -8847,14 +8862,14 @@ var fe = /*#__PURE__*/function () {
8847
8862
  var n = q.createSVGElement(Ho);
8848
8863
  n.classList.add("any-file-message-icon"), i.appendChild(n);
8849
8864
  var r = document.createElement("div");
8850
- return r.classList.add("any-file-message-text"), r.textContent = e.name || ne.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), ne.processContent(t, e.src);
8865
+ return r.classList.add("any-file-message-text"), r.textContent = e.name || se.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), se.processContent(t, e.src);
8851
8866
  }
8852
8867
  }, {
8853
8868
  key: "addNewAnyFileMessage",
8854
8869
  value: function addNewAnyFileMessage(e, t, i) {
8855
8870
  var n = e.createNewMessageElement("", i),
8856
8871
  r = fe.createAnyFile(t);
8857
- n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r), ne.addMessage(e, n, "file", i);
8872
+ n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r), se.addMessage(e, n, "file", i);
8858
8873
  }
8859
8874
  // no overwrite previous message logic as it is complex to track which files are to be overwritten
8860
8875
  }, {
@@ -8862,7 +8877,7 @@ var fe = /*#__PURE__*/function () {
8862
8877
  value: function addMessages(e, t, i) {
8863
8878
  t.forEach(function (n) {
8864
8879
  var r, o;
8865
- n.ref && (n = ne.removeFileRef(n)), n.type === "audio" || (r = n.src) != null && r.startsWith("data:audio") ? fe.addNewAudioMessage(e, n, i) : n.type === "image" || (o = n.src) != null && o.startsWith("data:image") ? fe.addNewImageMessage(e, n, i) : fe.addNewAnyFileMessage(e, n, i);
8880
+ n.ref && (n = se.removeFileRef(n)), n.type === "audio" || (r = n.src) != null && r.startsWith("data:audio") ? fe.addNewAudioMessage(e, n, i) : n.type === "image" || (o = n.src) != null && o.startsWith("data:image") ? fe.addNewImageMessage(e, n, i) : fe.addNewAnyFileMessage(e, n, i);
8866
8881
  });
8867
8882
  }
8868
8883
  }]);
@@ -8881,11 +8896,7 @@ var me = /*#__PURE__*/function (_Ke) {
8881
8896
  o = t.demo;
8882
8897
  _this37._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this37._onClearMessages = jt.onClearMessages.bind(_assertThisInitialized(_this37), e), _this37._onError = jt.onError.bind(_assertThisInitialized(_this37), e), _this37._displayLoadingMessage = me.getDisplayLoadingMessage(e, t), _this37._permittedErrorPrefixes = n, _this37.addSetupMessageIfNeeded(e, t), _this37.populateIntroPanel(i, r, e.introPanelStyle), _this37.addIntroductoryMessage(e, t), e.initialMessages && _this37.populateInitialMessages(e.initialMessages), _this37._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
8883
8898
  return JSON.parse(JSON.stringify(_this37.messages));
8884
- }, e.clearMessages = _this37.clearMessages.bind(_assertThisInitialized(_this37), t), e.refreshMessages = _this37.refreshTextMessages.bind(_assertThisInitialized(_this37)), e.scrollToBottom = Y.scrollToBottom.bind(_assertThisInitialized(_this37), _this37.elementRef), e.addMessage = function (c, d) {
8885
- _this37.addNewMessage(_objectSpread(_objectSpread({}, c), {}, {
8886
- sendUpdate: !!d
8887
- }), !d);
8888
- }, t.isWebModel() && t.setUpMessages(_assertThisInitialized(_this37)), o && _this37.prepareDemo(o), e.textToSpeech && Nt.processConfig(e.textToSpeech, function (c) {
8899
+ }, e.clearMessages = _this37.clearMessages.bind(_assertThisInitialized(_this37), t), e.refreshMessages = _this37.refreshTextMessages.bind(_assertThisInitialized(_this37)), e.scrollToBottom = Y.scrollToBottom.bind(_assertThisInitialized(_this37), _this37.elementRef), t.isWebModel() && t.setUpMessages(_assertThisInitialized(_this37)), o && _this37.prepareDemo(o), e.textToSpeech && Nt.processConfig(e.textToSpeech, function (c) {
8889
8900
  _this37.textToSpeech = c;
8890
8901
  });
8891
8902
  return _this37;
@@ -8908,11 +8919,11 @@ var me = /*#__PURE__*/function (_Ke) {
8908
8919
  }, {
8909
8920
  key: "addIntroductoryMessage",
8910
8921
  value: function addIntroductoryMessage(e, t) {
8911
- var _i11;
8922
+ var _i10;
8912
8923
  var n;
8913
8924
  e != null && e.shadowRoot && (this._introMessage = e.introMessage);
8914
8925
  var i = this._introMessage;
8915
- if (t != null && t.isWebModel() && ((_i11 = i) !== null && _i11 !== void 0 ? _i11 : i = t.getIntroMessage(i)), i) {
8926
+ if (t != null && t.isWebModel() && ((_i10 = i) !== null && _i10 !== void 0 ? _i10 : i = t.getIntroMessage(i)), i) {
8916
8927
  var r;
8917
8928
  i != null && i.text ? r = this.createAndAppendNewMessageElement(i.text, v.AI_ROLE) : i != null && i.html && (r = Ye.add(this, i.html, v.AI_ROLE, this.messageElementRefs)), r && (this.applyCustomStyles(r, v.AI_ROLE, !1, (n = this.messageStyles) == null ? void 0 : n.intro), r.outerContainer.classList.add("deep-chat-intro"));
8918
8929
  }
@@ -8946,7 +8957,12 @@ var me = /*#__PURE__*/function (_Ke) {
8946
8957
  var r = Ye.add(this, i.html, i.role, this.messageElementRefs, n);
8947
8958
  be.isElementTemporary(r) && delete i.html;
8948
8959
  }
8949
- this.updateStateOnMessage(i, e.overwrite, e.sendUpdate, t);
8960
+ this.isValidMessageContent(i) && this.updateStateOnMessage(i, e.overwrite, e.sendUpdate, t);
8961
+ }
8962
+ }, {
8963
+ key: "isValidMessageContent",
8964
+ value: function isValidMessageContent(e) {
8965
+ return e.text || e.html || e.files && e.files.length > 0;
8950
8966
  }
8951
8967
  }, {
8952
8968
  key: "updateStateOnMessage",
@@ -8987,8 +9003,8 @@ var me = /*#__PURE__*/function (_Ke) {
8987
9003
  var t = me.checkPermittedErrorPrefixes(this._permittedErrorPrefixes, e);
8988
9004
  if (t) return t;
8989
9005
  } else if (Array.isArray(e) && this._permittedErrorPrefixes) for (var _t3 = 0; _t3 < e.length; _t3 += 1) {
8990
- var _i12 = me.checkPermittedErrorPrefixes(this._permittedErrorPrefixes, e[_t3]);
8991
- if (_i12) return _i12;
9006
+ var _i11 = me.checkPermittedErrorPrefixes(this._permittedErrorPrefixes, e[_t3]);
9007
+ if (_i11) return _i11;
8992
9008
  }
8993
9009
  }
8994
9010
  }
@@ -9018,7 +9034,7 @@ var me = /*#__PURE__*/function (_Ke) {
9018
9034
  }, {
9019
9035
  key: "populateIntroPanel",
9020
9036
  value: function populateIntroPanel(e, t, i) {
9021
- (e || t) && (this._introPanel = new Gt(e, t, i), this._introPanel._elementRef && (se.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
9037
+ (e || t) && (this._introPanel = new Gt(e, t, i), this._introPanel._elementRef && (re.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
9022
9038
  }
9023
9039
  }, {
9024
9040
  key: "addMultipleFiles",
@@ -9030,7 +9046,7 @@ var me = /*#__PURE__*/function (_Ke) {
9030
9046
  return _context86.abrupt("return", Promise.all((e || []).map(function (t) {
9031
9047
  return new Promise(function (i) {
9032
9048
  if (!t.type || t.type === "any") {
9033
- var n = t.file.name || ne.DEFAULT_FILE_NAME;
9049
+ var n = t.file.name || se.DEFAULT_FILE_NAME;
9034
9050
  i({
9035
9051
  name: n,
9036
9052
  type: "any",
@@ -9082,7 +9098,7 @@ var me = /*#__PURE__*/function (_Ke) {
9082
9098
  }, {
9083
9099
  key: "checkPermittedErrorPrefixes",
9084
9100
  value: function checkPermittedErrorPrefixes(e, t) {
9085
- for (var _i13 = 0; _i13 < e.length; _i13 += 1) if (t.startsWith(e[_i13])) return t;
9101
+ for (var _i12 = 0; _i12 < e.length; _i12 += 1) if (t.startsWith(e[_i12])) return t;
9086
9102
  }
9087
9103
  }]);
9088
9104
  return me;
@@ -9284,8 +9300,8 @@ var _t = /*#__PURE__*/function () {
9284
9300
  key: "unsetCustomStateStyles",
9285
9301
  value: function unsetCustomStateStyles(e) {
9286
9302
  if (this._customStyles) for (var t = 0; t < e.length; t += 1) {
9287
- var _i14 = e[t],
9288
- n = _i14 && this._customStyles[_i14];
9303
+ var _i13 = e[t],
9304
+ n = _i13 && this._customStyles[_i13];
9289
9305
  n && te.unsetActionCSS(this.elementRef, n);
9290
9306
  }
9291
9307
  }
@@ -9300,15 +9316,15 @@ var _t = /*#__PURE__*/function () {
9300
9316
  }]);
9301
9317
  return _t;
9302
9318
  }();
9303
- var gt = /*#__PURE__*/function () {
9304
- function gt() {
9305
- _classCallCheck(this, gt);
9319
+ var bt = /*#__PURE__*/function () {
9320
+ function bt() {
9321
+ _classCallCheck(this, bt);
9306
9322
  }
9307
- _createClass(gt, null, [{
9323
+ _createClass(bt, null, [{
9308
9324
  key: "focusItemWhenOnEdge",
9309
9325
  value: function focusItemWhenOnEdge(e, t) {
9310
9326
  var i = t ? e.children[0] : e.children[e.children.length - 1];
9311
- gt.focusSiblingItem(i, e, t, !0);
9327
+ bt.focusSiblingItem(i, e, t, !0);
9312
9328
  }
9313
9329
  // isEdgeItem means is it a start or end item
9314
9330
  // prettier-ignore
@@ -9317,10 +9333,10 @@ var gt = /*#__PURE__*/function () {
9317
9333
  value: function focusSiblingItem(e, t, i) {
9318
9334
  var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
9319
9335
  var r = n ? e : e[i ? "nextSibling" : "previousSibling"];
9320
- r ? (e.dispatchEvent(new MouseEvent("mouseleave")), r.dispatchEvent(new MouseEvent("mouseenter"))) : (e.dispatchEvent(new MouseEvent("mouseleave")), gt.focusItemWhenOnEdge(t, i));
9336
+ r ? (e.dispatchEvent(new MouseEvent("mouseleave")), r.dispatchEvent(new MouseEvent("mouseenter"))) : (e.dispatchEvent(new MouseEvent("mouseleave")), bt.focusItemWhenOnEdge(t, i));
9321
9337
  }
9322
9338
  }]);
9323
- return gt;
9339
+ return bt;
9324
9340
  }();
9325
9341
  var we = /*#__PURE__*/function () {
9326
9342
  function we() {
@@ -9414,7 +9430,7 @@ var Qi = /*#__PURE__*/function () {
9414
9430
  e.parentElement !== ((i = t.target.shadowRoot) == null ? void 0 : i.children[0]) && _this40.close();
9415
9431
  }), window.addEventListener("keydown", function (t) {
9416
9432
  var i, n, r;
9417
- _this40._isOpen && (t.key === R.ESCAPE ? (_this40.close(), (i = _this40.highlightedItem) == null || i.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === R.ENTER ? ((n = _this40.highlightedItem) == null || n.click(), (r = _this40.highlightedItem) == null || r.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === R.ARROW_DOWN ? gt.focusSiblingItem(_this40.highlightedItem || _this40.elementRef.children[_this40.elementRef.children.length - 1], _this40.elementRef, !0) : t.key === R.ARROW_UP && gt.focusSiblingItem(_this40.highlightedItem || _this40.elementRef.children[0], _this40.elementRef, !1));
9433
+ _this40._isOpen && (t.key === R.ESCAPE ? (_this40.close(), (i = _this40.highlightedItem) == null || i.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === R.ENTER ? ((n = _this40.highlightedItem) == null || n.click(), (r = _this40.highlightedItem) == null || r.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === R.ARROW_DOWN ? bt.focusSiblingItem(_this40.highlightedItem || _this40.elementRef.children[_this40.elementRef.children.length - 1], _this40.elementRef, !0) : t.key === R.ARROW_UP && bt.focusSiblingItem(_this40.highlightedItem || _this40.elementRef.children[0], _this40.elementRef, !1));
9418
9434
  });
9419
9435
  }
9420
9436
  }], [{
@@ -9599,40 +9615,40 @@ var Wo = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\"
9599
9615
  dropupText: "File"
9600
9616
  }
9601
9617
  };
9602
- var ue = /*#__PURE__*/function () {
9618
+ var he = /*#__PURE__*/function () {
9603
9619
  // prettier-ignore
9604
- function ue(e, t, i, n) {
9620
+ function he(e, t, i, n) {
9605
9621
  var _this43 = this;
9606
- _classCallCheck(this, ue);
9622
+ _classCallCheck(this, he);
9607
9623
  this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", t.maxNumberOfFiles && (this._fileCountLimit = t.maxNumberOfFiles), this._toggleContainerDisplay = i, this._fileAttachmentsContainerRef = n, t.acceptedFormats && (this._acceptedFormat = t.acceptedFormats), setTimeout(function () {
9608
9624
  _this43._validationHandler = e._validationHandler;
9609
9625
  });
9610
9626
  }
9611
- _createClass(ue, [{
9627
+ _createClass(he, [{
9612
9628
  key: "attemptAddFile",
9613
9629
  value: function attemptAddFile(e, t) {
9614
- return ue.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), !0) : !1;
9630
+ return he.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), !0) : !1;
9615
9631
  }
9616
9632
  }, {
9617
9633
  key: "addAttachmentBasedOnType",
9618
9634
  value: function addAttachmentBasedOnType(e, t, i) {
9619
- var n = ue.getTypeFromBlob(e);
9635
+ var n = he.getTypeFromBlob(e);
9620
9636
  if (n === "image") {
9621
- var r = ue.createImageAttachment(t);
9637
+ var r = he.createImageAttachment(t);
9622
9638
  this.addFileAttachment(e, "image", r, i);
9623
9639
  } else if (n === "audio") {
9624
- var _r2 = Ui.createAudioAttachment(t);
9625
- this.addFileAttachment(e, "audio", _r2, i);
9640
+ var _r3 = Ui.createAudioAttachment(t);
9641
+ this.addFileAttachment(e, "audio", _r3, i);
9626
9642
  } else {
9627
- var _r3 = ue.createAnyFileAttachment(e.name);
9628
- this.addFileAttachment(e, "any", _r3, i);
9643
+ var _r4 = he.createAnyFileAttachment(e.name);
9644
+ this.addFileAttachment(e, "any", _r4, i);
9629
9645
  }
9630
9646
  }
9631
9647
  }, {
9632
9648
  key: "addFileAttachment",
9633
9649
  value: function addFileAttachment(e, t, i, n) {
9634
9650
  var a;
9635
- var r = ue.createContainer(i);
9651
+ var r = he.createContainer(i);
9636
9652
  if (this._attachments.length >= this._fileCountLimit) {
9637
9653
  var l = this._attachments[this._attachments.length - 1].removeButton;
9638
9654
  l == null || l.click();
@@ -9731,12 +9747,12 @@ var ue = /*#__PURE__*/function () {
9731
9747
  return t.classList.add("file-attachment"), t.appendChild(e), t;
9732
9748
  }
9733
9749
  }]);
9734
- return ue;
9750
+ return he;
9735
9751
  }();
9736
9752
  var Zo = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>play</title>\n <path d=\"M5.92 24.096q0 1.088 0.928 1.728 0.512 0.288 1.088 0.288 0.448 0 0.896-0.224l16.16-8.064q0.48-0.256 0.8-0.736t0.288-1.088-0.288-1.056-0.8-0.736l-16.16-8.064q-0.448-0.224-0.896-0.224-0.544 0-1.088 0.288-0.928 0.608-0.928 1.728v16.16z\"></path>\n</svg>",
9737
9753
  En = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n<title>stop</title>\n<path d=\"M5.92 24.096q0 0.832 0.576 1.408t1.44 0.608h16.128q0.832 0 1.44-0.608t0.576-1.408v-16.16q0-0.832-0.576-1.44t-1.44-0.576h-16.128q-0.832 0-1.44 0.576t-0.576 1.44v16.16z\"></path>\n</svg>",
9738
- hs = /*#__PURE__*/function (_ue) {
9739
- _inherits(_e, _ue);
9754
+ hs = /*#__PURE__*/function (_he) {
9755
+ _inherits(_e, _he);
9740
9756
  var _super38 = _createSuper(_e);
9741
9757
  // prettier-ignore
9742
9758
  function _e(e, t, i, n) {
@@ -9848,7 +9864,7 @@ var Zo = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
9848
9864
  }
9849
9865
  }]);
9850
9866
  return _e;
9851
- }(ue);
9867
+ }(he);
9852
9868
  hs.TIMER_LIMIT_S = 5999;
9853
9869
  var Ui = hs;
9854
9870
  var Xo = /*#__PURE__*/function () {
@@ -9860,7 +9876,7 @@ var Xo = /*#__PURE__*/function () {
9860
9876
  value:
9861
9877
  // prettier-ignore
9862
9878
  function create(e, t, i, n, r) {
9863
- return r === "audio" ? new Ui(e, t, i, n) : new ue(e, t, i, n);
9879
+ return r === "audio" ? new Ui(e, t, i, n) : new he(e, t, i, n);
9864
9880
  }
9865
9881
  }]);
9866
9882
  return Xo;
@@ -9965,11 +9981,11 @@ var wt = /*#__PURE__*/function () {
9965
9981
  return wt;
9966
9982
  }();
9967
9983
  var ps = /*#__PURE__*/function () {
9968
- function le(e, t, i) {
9969
- _classCallCheck(this, le);
9970
- this._isOpen = !1, this._contentRef = le.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = le.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = le.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = le.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents();
9984
+ function ce(e, t, i) {
9985
+ _classCallCheck(this, ce);
9986
+ this._isOpen = !1, this._contentRef = ce.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = ce.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = ce.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = ce.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents();
9971
9987
  }
9972
- _createClass(le, [{
9988
+ _createClass(ce, [{
9973
9989
  key: "isOpen",
9974
9990
  value: function isOpen() {
9975
9991
  return this._isOpen;
@@ -9991,7 +10007,7 @@ var ps = /*#__PURE__*/function () {
9991
10007
  var _this47 = this;
9992
10008
  this._elementRef.classList.remove("show-modal"), this._elementRef.classList.add("hide-modal"), this._backgroundPanelRef.classList.remove("show-modal-background"), this._backgroundPanelRef.classList.add("hide-modal-background"), this._isOpen = !1, setTimeout(function () {
9993
10009
  _this47._elementRef.style.display = "none", _this47._backgroundPanelRef.style.display = "none";
9994
- }, le.MODAL_CLOSE_TIMEOUT_MS);
10010
+ }, ce.MODAL_CLOSE_TIMEOUT_MS);
9995
10011
  }
9996
10012
  }, {
9997
10013
  key: "displayModalElements",
@@ -10007,7 +10023,7 @@ var ps = /*#__PURE__*/function () {
10007
10023
  key: "addCloseButton",
10008
10024
  value: function addCloseButton(e, t, i) {
10009
10025
  var _this48 = this;
10010
- var n = t ? le.createSVGButton(e) : le.createTextButton(e);
10026
+ var n = t ? ce.createSVGButton(e) : ce.createTextButton(e);
10011
10027
  return this.addButtons(n), n.onclick = function () {
10012
10028
  _this48.close(), setTimeout(function () {
10013
10029
  i == null || i();
@@ -10067,32 +10083,32 @@ var ps = /*#__PURE__*/function () {
10067
10083
  value: function createTextModalFunc(e, t, i) {
10068
10084
  var n;
10069
10085
  if (_typeof(t) == "object" && (n = t.files) != null && n.infoModal) {
10070
- var r = new le(e, ["modal-content"], t.files.infoModal.containerStyle);
10086
+ var r = new ce(e, ["modal-content"], t.files.infoModal.containerStyle);
10071
10087
  return r.addCloseButton("OK", !1, i), r.openTextModal.bind(r, t.infoModalTextMarkUp || "");
10072
10088
  }
10073
10089
  }
10074
10090
  }]);
10075
- return le;
10091
+ return ce;
10076
10092
  }();
10077
10093
  ps.MODAL_CLOSE_TIMEOUT_MS = 190;
10078
- var at = ps;
10079
- var ut = /*#__PURE__*/function (_t5) {
10080
- _inherits(ut, _t5);
10081
- var _super39 = _createSuper(ut);
10094
+ var lt = ps;
10095
+ var ht = /*#__PURE__*/function (_t5) {
10096
+ _inherits(ht, _t5);
10097
+ var _super39 = _createSuper(ht);
10082
10098
  // prettier-ignore
10083
- function ut(e, t, i, n, r, o) {
10099
+ function ht(e, t, i, n, r, o) {
10084
10100
  var _this50;
10085
- _classCallCheck(this, ut);
10101
+ _classCallCheck(this, ht);
10086
10102
  var l, c, d, u, h, p;
10087
- _this50 = _super39.call(this, ut.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o);
10103
+ _this50 = _super39.call(this, ht.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o);
10088
10104
  var a = _this50.createInnerElements(n, r, _this50._customStyles);
10089
- _this50._inputElement = ut.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this50.addClickEvent(e, i), _this50.elementRef.replaceChildren(a.styles), _this50.reapplyStateStyle("styles"), _this50._fileAttachmentsType = t, _this50._openModalOnce = ((u = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : u.openModalOnce) === !1 || (p = (h = i.files) == null ? void 0 : h.infoModal) == null ? void 0 : p.openModalOnce;
10105
+ _this50._inputElement = ht.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this50.addClickEvent(e, i), _this50.elementRef.replaceChildren(a.styles), _this50.reapplyStateStyle("styles"), _this50._fileAttachmentsType = t, _this50._openModalOnce = ((u = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : u.openModalOnce) === !1 || (p = (h = i.files) == null ? void 0 : h.infoModal) == null ? void 0 : p.openModalOnce;
10090
10106
  return _this50;
10091
10107
  }
10092
- _createClass(ut, [{
10108
+ _createClass(ht, [{
10093
10109
  key: "createInnerElements",
10094
10110
  value: function createInnerElements(e, t, i) {
10095
- var n = ut.createSVGIconElement(e, t);
10111
+ var n = ht.createSVGIconElement(e, t);
10096
10112
  return {
10097
10113
  styles: this.createInnerElement(n, "styles", i)
10098
10114
  };
@@ -10116,7 +10132,7 @@ var ut = /*#__PURE__*/function (_t5) {
10116
10132
  key: "addClickEvent",
10117
10133
  value: function addClickEvent(e, t) {
10118
10134
  var i = this.triggerImportPrompt.bind(this, this._inputElement),
10119
- n = at.createTextModalFunc(e, t, i);
10135
+ n = lt.createTextModalFunc(e, t, i);
10120
10136
  this.elementRef.onclick = this.click.bind(this, n);
10121
10137
  }
10122
10138
  }, {
@@ -10143,17 +10159,17 @@ var ut = /*#__PURE__*/function (_t5) {
10143
10159
  return i.id = e, i;
10144
10160
  }
10145
10161
  }]);
10146
- return ut;
10162
+ return ht;
10147
10163
  }(_t);
10148
- var de = /*#__PURE__*/function () {
10149
- function de() {
10150
- _classCallCheck(this, de);
10164
+ var ue = /*#__PURE__*/function () {
10165
+ function ue() {
10166
+ _classCallCheck(this, ue);
10151
10167
  }
10152
- _createClass(de, null, [{
10168
+ _createClass(ue, null, [{
10153
10169
  key: "create",
10154
10170
  value: function create(e, t, i) {
10155
- var n = de.createElement(i);
10156
- de.addEvents(n, e, t), e.appendChild(n);
10171
+ var n = ue.createElement(i);
10172
+ ue.addEvents(n, e, t), e.appendChild(n);
10157
10173
  }
10158
10174
  }, {
10159
10175
  key: "createElement",
@@ -10165,13 +10181,13 @@ var de = /*#__PURE__*/function () {
10165
10181
  key: "addEvents",
10166
10182
  value: function addEvents(e, t, i) {
10167
10183
  t.ondragenter = function (n) {
10168
- n.preventDefault(), de.display(e);
10184
+ n.preventDefault(), ue.display(e);
10169
10185
  }, e.ondragleave = function (n) {
10170
- n.preventDefault(), de.hide(e);
10186
+ n.preventDefault(), ue.hide(e);
10171
10187
  }, e.ondragover = function (n) {
10172
10188
  n.preventDefault();
10173
10189
  }, e.ondrop = function (n) {
10174
- n.preventDefault(), de.uploadFile(i, n), de.hide(e);
10190
+ n.preventDefault(), ue.uploadFile(i, n), ue.hide(e);
10175
10191
  };
10176
10192
  }
10177
10193
  }, {
@@ -10197,7 +10213,7 @@ var de = /*#__PURE__*/function () {
10197
10213
  return t !== void 0 && t === !1 ? !1 : !!t || e.getNumberOfTypes() > 0;
10198
10214
  }
10199
10215
  }]);
10200
- return de;
10216
+ return ue;
10201
10217
  }();
10202
10218
  var Me = /*#__PURE__*/function () {
10203
10219
  function Me() {
@@ -10301,19 +10317,19 @@ var Me = /*#__PURE__*/function () {
10301
10317
  return Me;
10302
10318
  }();
10303
10319
  var Qo = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg height=\"1.4em\" width=\"1.4em\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t viewBox=\"0 0 490.9 490.9\" xml:space=\"preserve\">\n\t<g>\n\t\t<g>\n\t\t\t<path d=\"M245.5,322.9c53,0,96.2-43.2,96.2-96.2V96.2c0-53-43.2-96.2-96.2-96.2s-96.2,43.2-96.2,96.2v130.5\n\t\t\t\tC149.3,279.8,192.5,322.9,245.5,322.9z M173.8,96.2c0-39.5,32.2-71.7,71.7-71.7s71.7,32.2,71.7,71.7v130.5\n\t\t\t\tc0,39.5-32.2,71.7-71.7,71.7s-71.7-32.2-71.7-71.7V96.2z\"/>\n\t\t\t<path d=\"M94.4,214.5c-6.8,0-12.3,5.5-12.3,12.3c0,85.9,66.7,156.6,151.1,162.8v76.7h-63.9c-6.8,0-12.3,5.5-12.3,12.3\n\t\t\t\ts5.5,12.3,12.3,12.3h152.3c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3h-63.9v-76.7c84.4-6.3,151.1-76.9,151.1-162.8\n\t\t\t\tc0-6.8-5.5-12.3-12.3-12.3s-12.3,5.5-12.3,12.3c0,76.6-62.3,138.9-138.9,138.9s-138.9-62.3-138.9-138.9\n\t\t\t\tC106.6,220,101.2,214.5,94.4,214.5z\"/>\n\t\t</g>\n\t</g>\n</svg>\n";
10304
- var bt = /*#__PURE__*/function (_t6) {
10305
- _inherits(bt, _t6);
10306
- var _super40 = _createSuper(bt);
10307
- function bt(e) {
10320
+ var vt = /*#__PURE__*/function (_t6) {
10321
+ _inherits(vt, _t6);
10322
+ var _super40 = _createSuper(vt);
10323
+ function vt(e) {
10308
10324
  var _this51;
10309
- _classCallCheck(this, bt);
10310
- (e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this51 = _super40.call(this, bt.createMicrophoneElement(), e == null ? void 0 : e.position, e), _this51.isActive = !1, _this51._innerElements = _this51.createInnerElements(_this51._customStyles), _this51.changeToDefault();
10325
+ _classCallCheck(this, vt);
10326
+ (e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this51 = _super40.call(this, vt.createMicrophoneElement(), e == null ? void 0 : e.position, e), _this51.isActive = !1, _this51._innerElements = _this51.createInnerElements(_this51._customStyles), _this51.changeToDefault();
10311
10327
  return _this51;
10312
10328
  }
10313
- _createClass(bt, [{
10329
+ _createClass(vt, [{
10314
10330
  key: "createInnerElements",
10315
10331
  value: function createInnerElements(e) {
10316
- var t = bt.createSVGIconElement();
10332
+ var t = vt.createSVGIconElement();
10317
10333
  return {
10318
10334
  "default": this.createInnerElement(t, "default", e),
10319
10335
  active: this.createInnerElement(t, "active", e),
@@ -10376,7 +10392,7 @@ var bt = /*#__PURE__*/function (_t6) {
10376
10392
  return e.id = "microphone-icon", e;
10377
10393
  }
10378
10394
  }]);
10379
- return bt;
10395
+ return vt;
10380
10396
  }(_t);
10381
10397
  var fs = {},
10382
10398
  oi = {},
@@ -10483,17 +10499,17 @@ var ia = /*#__PURE__*/function () {
10483
10499
  return ia;
10484
10500
  }();
10485
10501
  ai.WebSpeechTranscript = ia;
10486
- var tt = {};
10487
- Object.defineProperty(tt, "__esModule", {
10502
+ var it = {};
10503
+ Object.defineProperty(it, "__esModule", {
10488
10504
  value: !0
10489
10505
  });
10490
- tt.Browser = void 0;
10491
- var lt = /*#__PURE__*/_createClass(function lt() {
10492
- _classCallCheck(this, lt);
10506
+ it.Browser = void 0;
10507
+ var ct = /*#__PURE__*/_createClass(function ct() {
10508
+ _classCallCheck(this, ct);
10493
10509
  });
10494
- tt.Browser = lt;
10495
- lt.IS_SAFARI = function () {
10496
- return lt._IS_SAFARI === void 0 && (lt._IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), lt._IS_SAFARI;
10510
+ it.Browser = ct;
10511
+ ct.IS_SAFARI = function () {
10512
+ return ct._IS_SAFARI === void 0 && (ct._IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), ct._IS_SAFARI;
10497
10513
  };
10498
10514
  var Tt = {},
10499
10515
  li = {};
@@ -10640,10 +10656,10 @@ var sa = /*#__PURE__*/function () {
10640
10656
  key: "appendSpans",
10641
10657
  value: function appendSpans(e, t) {
10642
10658
  if (e.spansPopulated = !0, e.insertInCursorLocation && document.activeElement === t) {
10643
- var _i15 = window.getSelection();
10644
- if (_i15 != null && _i15.focusNode) {
10645
- var n = _i15.getRangeAt(0);
10646
- n.insertNode(e.scrollingSpan), n.insertNode(e.interimSpan), n.insertNode(e.finalSpan), n.collapse(!1), _i15.removeAllRanges(), _i15.addRange(n);
10659
+ var _i14 = window.getSelection();
10660
+ if (_i14 != null && _i14.focusNode) {
10661
+ var n = _i14.getRangeAt(0);
10662
+ n.insertNode(e.scrollingSpan), n.insertNode(e.interimSpan), n.insertNode(e.finalSpan), n.collapse(!1), _i14.removeAllRanges(), _i14.addRange(n);
10647
10663
  return;
10648
10664
  }
10649
10665
  }
@@ -10668,11 +10684,11 @@ Object.defineProperty(Be, "__esModule", {
10668
10684
  value: !0
10669
10685
  });
10670
10686
  Be.Cursor = void 0;
10671
- var ht = /*#__PURE__*/function () {
10672
- function ht() {
10673
- _classCallCheck(this, ht);
10687
+ var pt = /*#__PURE__*/function () {
10688
+ function pt() {
10689
+ _classCallCheck(this, pt);
10674
10690
  }
10675
- _createClass(ht, null, [{
10691
+ _createClass(pt, null, [{
10676
10692
  key: "setOffsetForGeneric",
10677
10693
  value: function setOffsetForGeneric(e, t) {
10678
10694
  var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
@@ -10680,7 +10696,7 @@ var ht = /*#__PURE__*/function () {
10680
10696
  for (var r = 0; r < e.childNodes.length; r += 1) {
10681
10697
  var o = e.childNodes[r];
10682
10698
  if (o.childNodes.length > 0) {
10683
- var a = ht.setOffsetForGeneric(o, t, i);
10699
+ var a = pt.setOffsetForGeneric(o, t, i);
10684
10700
  if (a === -1) return -1;
10685
10701
  i += a;
10686
10702
  } else if (o.textContent !== null) {
@@ -10708,8 +10724,8 @@ var ht = /*#__PURE__*/function () {
10708
10724
  value: function setOffsetForSafariGeneric(e, t) {
10709
10725
  var i = window.getSelection();
10710
10726
  if (i) {
10711
- var n = ht.getGenericElementCursorOffset(e, i, !0);
10712
- console.log(n), setTimeout(function () {}, 100), ht.setOffsetForGeneric(e, n + t);
10727
+ var n = pt.getGenericElementCursorOffset(e, i, !0);
10728
+ console.log(n), setTimeout(function () {}, 100), pt.setOffsetForGeneric(e, n + t);
10713
10729
  }
10714
10730
  }
10715
10731
  // set to automatically scroll to cursor (scroll does not work in Safari)
@@ -10747,16 +10763,16 @@ var ht = /*#__PURE__*/function () {
10747
10763
  return n;
10748
10764
  }
10749
10765
  }]);
10750
- return ht;
10766
+ return pt;
10751
10767
  }();
10752
- Be.Cursor = ht;
10768
+ Be.Cursor = pt;
10753
10769
  Object.defineProperty(Ct, "__esModule", {
10754
10770
  value: !0
10755
10771
  });
10756
10772
  Ct.CommandUtils = void 0;
10757
10773
  var _n = At,
10758
10774
  ra = je,
10759
- oa = tt,
10775
+ oa = it,
10760
10776
  wn = Be,
10761
10777
  Mn = De;
10762
10778
  var K = /*#__PURE__*/function () {
@@ -10861,7 +10877,7 @@ Object.defineProperty(di, "__esModule", {
10861
10877
  });
10862
10878
  di.Highlight = void 0;
10863
10879
  var aa = je,
10864
- it = Be;
10880
+ nt = Be;
10865
10881
  var Wt = /*#__PURE__*/function () {
10866
10882
  function Wt() {
10867
10883
  _classCallCheck(this, Wt);
@@ -10877,8 +10893,8 @@ var Wt = /*#__PURE__*/function () {
10877
10893
  value: function setStateForGeneric(e, t) {
10878
10894
  var i = window.getSelection();
10879
10895
  if (i != null && i.focusNode) {
10880
- var n = it.Cursor.getGenericElementCursorOffset(t, i, !0),
10881
- r = it.Cursor.getGenericElementCursorOffset(t, i, !1);
10896
+ var n = nt.Cursor.getGenericElementCursorOffset(t, i, !0),
10897
+ r = nt.Cursor.getGenericElementCursorOffset(t, i, !1);
10882
10898
  e.isHighlighted = n !== r;
10883
10899
  }
10884
10900
  }
@@ -10892,8 +10908,8 @@ var Wt = /*#__PURE__*/function () {
10892
10908
  value: function removeForGeneric(e, t) {
10893
10909
  var i = window.getSelection();
10894
10910
  if (i) {
10895
- var n = it.Cursor.getGenericElementCursorOffset(t, i, !0);
10896
- i.deleteFromDocument(), it.Cursor.setOffsetForGeneric(t, n), e.isHighlighted = !1;
10911
+ var n = nt.Cursor.getGenericElementCursorOffset(t, i, !0);
10912
+ i.deleteFromDocument(), nt.Cursor.setOffsetForGeneric(t, n), e.isHighlighted = !1;
10897
10913
  }
10898
10914
  }
10899
10915
  }, {
@@ -10904,7 +10920,7 @@ var Wt = /*#__PURE__*/function () {
10904
10920
  r = t.value;
10905
10921
  if (i && n) {
10906
10922
  var o = r.substring(0, i) + r.substring(n);
10907
- t.value = o, it.Cursor.setOffsetForPrimitive(t, i, e.autoScroll);
10923
+ t.value = o, nt.Cursor.setOffsetForPrimitive(t, i, e.autoScroll);
10908
10924
  }
10909
10925
  e.isHighlighted = !1;
10910
10926
  }
@@ -10990,7 +11006,7 @@ var Cn = li,
10990
11006
  Ti = di,
10991
11007
  ie = je,
10992
11008
  Ci = ui,
10993
- kn = tt,
11009
+ kn = it,
10994
11010
  In = Be,
10995
11011
  Ai = De;
10996
11012
  var da = /*#__PURE__*/function () {
@@ -11108,7 +11124,7 @@ Object.defineProperty(oi, "__esModule", {
11108
11124
  });
11109
11125
  oi.WebSpeech = void 0;
11110
11126
  var Ln = ai,
11111
- Rn = tt,
11127
+ Rn = it,
11112
11128
  ua = Tt;
11113
11129
  var Jt = /*#__PURE__*/function (_ua$Speech) {
11114
11130
  _inherits(Jt, _ua$Speech);
@@ -11151,9 +11167,9 @@ var Jt = /*#__PURE__*/function (_ua$Speech) {
11151
11167
  if (_typeof(e.results) > "u" && _this53._service) _this53._service.onend = null, _this53._service.stop();else if (_this53._extractText && !_this53._stopping) {
11152
11168
  var _this53$_extractText = _this53._extractText(e, _this53.finalTranscript, _this53._translations),
11153
11169
  t = _this53$_extractText.interimTranscript,
11154
- _i16 = _this53$_extractText.finalTranscript,
11170
+ _i15 = _this53$_extractText.finalTranscript,
11155
11171
  n = _this53$_extractText.newText;
11156
- _this53.updateElements(t, _i16, n);
11172
+ _this53.updateElements(t, _i15, n);
11157
11173
  }
11158
11174
  });
11159
11175
  }
@@ -11310,11 +11326,11 @@ Object.defineProperty(bi, "__esModule", {
11310
11326
  value: !0
11311
11327
  });
11312
11328
  bi.StopTimeout = void 0;
11313
- var vt = /*#__PURE__*/function () {
11314
- function vt() {
11315
- _classCallCheck(this, vt);
11329
+ var yt = /*#__PURE__*/function () {
11330
+ function yt() {
11331
+ _classCallCheck(this, yt);
11316
11332
  }
11317
- _createClass(vt, null, [{
11333
+ _createClass(yt, null, [{
11318
11334
  key: "set",
11319
11335
  value: function set(e) {
11320
11336
  e.stopTimeout = setTimeout(function () {
@@ -11324,13 +11340,13 @@ var vt = /*#__PURE__*/function () {
11324
11340
  }, {
11325
11341
  key: "reset",
11326
11342
  value: function reset(e, t) {
11327
- e.stopTimeoutMS = t || vt.DEFAULT_MS, e.stopTimeout && clearTimeout(e.stopTimeout), vt.set(e);
11343
+ e.stopTimeoutMS = t || yt.DEFAULT_MS, e.stopTimeout && clearTimeout(e.stopTimeout), yt.set(e);
11328
11344
  }
11329
11345
  }]);
11330
- return vt;
11346
+ return yt;
11331
11347
  }();
11332
- bi.StopTimeout = vt;
11333
- vt.DEFAULT_MS = 2e4;
11348
+ bi.StopTimeout = yt;
11349
+ yt.DEFAULT_MS = 2e4;
11334
11350
  var vi = {};
11335
11351
  Object.defineProperty(vi, "__esModule", {
11336
11352
  value: !0
@@ -11587,8 +11603,8 @@ var We = /*#__PURE__*/function () {
11587
11603
  return We;
11588
11604
  }();
11589
11605
  var Li = fs["default"] = We;
11590
- var Zt = /*#__PURE__*/function (_bt) {
11591
- _inherits(Zt, _bt);
11606
+ var Zt = /*#__PURE__*/function (_vt) {
11607
+ _inherits(Zt, _vt);
11592
11608
  var _super43 = _createSuper(Zt);
11593
11609
  function Zt(e, t, i) {
11594
11610
  var _this56;
@@ -11662,7 +11678,7 @@ var Zt = /*#__PURE__*/function (_bt) {
11662
11678
  }
11663
11679
  }]);
11664
11680
  return Zt;
11665
- }(bt);
11681
+ }(vt);
11666
11682
  var ms = /*#__PURE__*/function () {
11667
11683
  function ms() {
11668
11684
  _classCallCheck(this, ms);
@@ -11679,8 +11695,8 @@ var ms = /*#__PURE__*/function () {
11679
11695
  }]);
11680
11696
  return ms;
11681
11697
  }();
11682
- var va = /*#__PURE__*/function (_bt2) {
11683
- _inherits(va, _bt2);
11698
+ var va = /*#__PURE__*/function (_vt2) {
11699
+ _inherits(va, _vt2);
11684
11700
  var _super44 = _createSuper(va);
11685
11701
  function va(e, t) {
11686
11702
  var _this57;
@@ -11741,7 +11757,7 @@ var va = /*#__PURE__*/function (_bt2) {
11741
11757
  }
11742
11758
  }]);
11743
11759
  return va;
11744
- }(bt);
11760
+ }(vt);
11745
11761
  var ya = "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n<svg xmlns=\"http://www.w3.org/2000/svg\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"1\" viewBox=\"0 0 24 24\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"14\"></line>\n <polygon points=\"22 2 15 22 11 14 2 10 22 2\"></polygon>\n</svg>\n";
11746
11762
  var F = /*#__PURE__*/function () {
11747
11763
  function F() {
@@ -11884,7 +11900,7 @@ var yi = /*#__PURE__*/function (_t7) {
11884
11900
  key: "submitFromInput",
11885
11901
  value: function () {
11886
11902
  var _submitFromInput = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee96() {
11887
- var t, e, _i17;
11903
+ var t, e, _i16;
11888
11904
  return _regeneratorRuntime().wrap(function _callee96$(_context96) {
11889
11905
  while (1) switch (_context96.prev = _context96.next) {
11890
11906
  case 0:
@@ -11896,9 +11912,9 @@ var yi = /*#__PURE__*/function (_t7) {
11896
11912
  text: "",
11897
11913
  files: e
11898
11914
  });else {
11899
- _i17 = (t = this._inputElementRef.textContent) == null ? void 0 : t.trim();
11915
+ _i16 = (t = this._inputElementRef.textContent) == null ? void 0 : t.trim();
11900
11916
  this.attemptSubmit({
11901
- text: _i17,
11917
+ text: _i16,
11902
11918
  files: e
11903
11919
  });
11904
11920
  }
@@ -11929,7 +11945,7 @@ var yi = /*#__PURE__*/function (_t7) {
11929
11945
  e.files && (t.files = Array.from(e.files).map(function (i) {
11930
11946
  return {
11931
11947
  file: i,
11932
- type: ue.getTypeFromBlob(i)
11948
+ type: he.getTypeFromBlob(i)
11933
11949
  };
11934
11950
  })), setTimeout(function () {
11935
11951
  return _this62.attemptSubmit(t, !0);
@@ -12105,8 +12121,8 @@ var Ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
12105
12121
  Sa = "<?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",
12106
12122
  _a = "<?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>",
12107
12123
  wa = "<?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>";
12108
- var tn = /*#__PURE__*/function (_at) {
12109
- _inherits(tn, _at);
12124
+ var tn = /*#__PURE__*/function (_lt) {
12125
+ _inherits(tn, _lt);
12110
12126
  var _super46 = _createSuper(tn);
12111
12127
  // prettier-ignore
12112
12128
  function tn(e, t, i, n) {
@@ -12122,11 +12138,11 @@ var tn = /*#__PURE__*/function (_at) {
12122
12138
  _createClass(tn, [{
12123
12139
  key: "addButtonsAndTheirEvents",
12124
12140
  value: function addButtonsAndTheirEvents(e) {
12125
- var t = at.createSVGButton(Sa);
12141
+ var t = lt.createSVGButton(Sa);
12126
12142
  t.classList.add("modal-svg-camera-button"), t.children[0].classList.add("modal-svg-camera-icon");
12127
12143
  var i = this.addCloseButton(_a, !0);
12128
12144
  i.classList.add("modal-svg-close-button"), i.children[0].classList.add("modal-svg-close-icon");
12129
- var n = at.createSVGButton(wa);
12145
+ var n = lt.createSVGButton(wa);
12130
12146
  return n.classList.add("modal-svg-submit-button"), this.addButtons(t, n), this.addButtonEvents(t, i, n, e), {
12131
12147
  captureButton: t,
12132
12148
  submitButton: n
@@ -12154,7 +12170,7 @@ var tn = /*#__PURE__*/function (_at) {
12154
12170
  _this65._captureButton.replaceChildren(_this65._captureIcon), _this65._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
12155
12171
  var e = _this65._canvas.getContext("2d");
12156
12172
  e == null || e.clearRect(0, 0, _this65._canvas.width, _this65._canvas.height);
12157
- }, at.MODAL_CLOSE_TIMEOUT_MS);
12173
+ }, lt.MODAL_CLOSE_TIMEOUT_MS);
12158
12174
  }
12159
12175
  }, {
12160
12176
  key: "start",
@@ -12182,8 +12198,8 @@ var tn = /*#__PURE__*/function (_at) {
12182
12198
  var e = atob(this._dataURL.split(",")[1]),
12183
12199
  t = new Array(e.length);
12184
12200
  for (var a = 0; a < e.length; a++) t[a] = e.charCodeAt(a);
12185
- var _i18 = new Uint8Array(t),
12186
- n = new Blob([_i18], {
12201
+ var _i17 = new Uint8Array(t),
12202
+ n = new Blob([_i17], {
12187
12203
  type: this._format
12188
12204
  }),
12189
12205
  r = this._format === "image/jpeg" ? "jpeg" : "png",
@@ -12199,8 +12215,8 @@ var tn = /*#__PURE__*/function (_at) {
12199
12215
  if (!this._stopped) {
12200
12216
  if (!this._dataURL) {
12201
12217
  t.width = e.videoWidth, t.height = e.videoHeight;
12202
- var _i19 = t.getContext("2d");
12203
- _i19 == null || _i19.drawImage(e, 0, 0, t.width, t.height);
12218
+ var _i18 = t.getContext("2d");
12219
+ _i18 == null || _i18.drawImage(e, 0, 0, t.width, t.height);
12204
12220
  }
12205
12221
  requestAnimationFrame(this.updateCanvas.bind(this, e, t));
12206
12222
  }
@@ -12219,7 +12235,7 @@ var tn = /*#__PURE__*/function (_at) {
12219
12235
  }
12220
12236
  }]);
12221
12237
  return tn;
12222
- }(at);
12238
+ }(lt);
12223
12239
  var Ma = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <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>";
12224
12240
  var Xt = /*#__PURE__*/function (_t8) {
12225
12241
  _inherits(Xt, _t8);
@@ -12268,11 +12284,11 @@ var Xt = /*#__PURE__*/function (_t8) {
12268
12284
  }]);
12269
12285
  return Xt;
12270
12286
  }(_t);
12271
- var pt = /*#__PURE__*/function () {
12287
+ var ft = /*#__PURE__*/function () {
12272
12288
  // prettier-ignore
12273
- function pt(e, t, i, n) {
12274
- _classCallCheck(this, pt);
12275
- this.elementRef = pt.createPanelElement(e.inputAreaStyle);
12289
+ function ft(e, t, i, n) {
12290
+ _classCallCheck(this, ft);
12291
+ this.elementRef = ft.createPanelElement(e.inputAreaStyle);
12276
12292
  var r = new qi(e, i),
12277
12293
  o = {},
12278
12294
  a = this.createFileUploadComponents(e, i, n, o);
@@ -12282,16 +12298,16 @@ var pt = /*#__PURE__*/function () {
12282
12298
  var l = new xa(e, r.inputElementRef, t, i, a);
12283
12299
  r.submit = l.submitFromInput.bind(l), Me.attach(e, i, r, a, l), e.submitUserMessage = l.programmaticSubmit.bind(l), o.submit = {
12284
12300
  button: l
12285
- }, pt.addElements(this.elementRef, r, o, n, a, e.dropupStyles);
12301
+ }, ft.addElements(this.elementRef, r, o, n, a, e.dropupStyles);
12286
12302
  }
12287
- _createClass(pt, [{
12303
+ _createClass(ft, [{
12288
12304
  key: "createFileUploadComponents",
12289
12305
  value:
12290
12306
  // prettier-ignore
12291
12307
  function createFileUploadComponents(e, t, i, n) {
12292
12308
  var o, a, l, c;
12293
12309
  var r = new wt(this.elementRef, e.attachmentContainerStyle, t.demo);
12294
- if (pt.createUploadButtons(e, t.fileTypes || {}, r, i, n), (o = t.camera) != null && o.files) {
12310
+ if (ft.createUploadButtons(e, t.fileTypes || {}, r, i, n), (o = t.camera) != null && o.files) {
12295
12311
  var d = ((a = n.images) == null ? void 0 : a.fileType) || r.addType(e, t.camera.files, "images");
12296
12312
  n.camera = {
12297
12313
  button: new Xt(i, d, t.camera)
@@ -12303,7 +12319,7 @@ var pt = /*#__PURE__*/function () {
12303
12319
  button: new va(_d, t.recordAudio)
12304
12320
  };
12305
12321
  }
12306
- return de.isEnabled(r, e.dragAndDrop) && de.create(i, r, e.dragAndDrop), r;
12322
+ return ue.isEnabled(r, e.dragAndDrop) && ue.create(i, r, e.dragAndDrop), r;
12307
12323
  }
12308
12324
  // prettier-ignore
12309
12325
  }], [{
@@ -12324,7 +12340,7 @@ var pt = /*#__PURE__*/function () {
12324
12340
  d = _Yo$a.id,
12325
12341
  u = _Yo$a.svgString,
12326
12342
  h = _Yo$a.dropupText,
12327
- p = new ut(n, c, l, d, u, h);
12343
+ p = new ht(n, c, l, d, u, h);
12328
12344
  r[a] = {
12329
12345
  button: p,
12330
12346
  fileType: c
@@ -12342,7 +12358,7 @@ var pt = /*#__PURE__*/function () {
12342
12358
  Vo.set(t.inputElementRef, a, r.elementRef, l), Qe.add(e, a);
12343
12359
  }
12344
12360
  }]);
12345
- return pt;
12361
+ return ft;
12346
12362
  }();
12347
12363
  var nn = /*#__PURE__*/function () {
12348
12364
  function nn() {
@@ -12355,7 +12371,7 @@ var nn = /*#__PURE__*/function () {
12355
12371
  n.id = "chat-view";
12356
12372
  var r = new me(e, t, i);
12357
12373
  t.websocket && $.createConnection(t, r);
12358
- var o = new pt(e, r, t, n);
12374
+ var o = new ft(e, r, t, n);
12359
12375
  return Y.addElements(n, r.elementRef, o.elementRef), n;
12360
12376
  }
12361
12377
  }, {
@@ -12384,8 +12400,6 @@ var b = /*#__PURE__*/function (_mo) {
12384
12400
  return [];
12385
12401
  }, _this68.submitUserMessage = function () {
12386
12402
  return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
12387
- }, _this68.addMessage = function () {
12388
- return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
12389
12403
  }, _this68.focusInput = function () {
12390
12404
  return Qt.focusFromParentElement(_this68._elementRef);
12391
12405
  }, _this68.refreshMessages = function () {}, _this68.clearMessages = function () {}, _this68.scrollToBottom = function () {}, _this68.disableSubmitButton = function () {}, _this68.onNewMessage = function () {}, _this68.onClearMessages = function () {}, _this68.onComponentRender = function () {}, _this68.onError = function () {}, _this68._hasBeenRendered = !1, _this68._auxiliaryStyleApplied = !1, Uo.appendStyleSheetToHead(), _this68._elementRef = document.createElement("div"), _this68._elementRef.id = "container", _this68.attachShadow({