deep-chat-dev 9.0.98 → 9.0.99

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
@@ -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 st() {
196
- _classCallCheck(this, st);
195
+ function nt() {
196
+ _classCallCheck(this, nt);
197
197
  }
198
- _createClass(st, null, [{
198
+ _createClass(nt, null, [{
199
199
  key: "add",
200
200
  value: function add(e, t, i) {
201
- t !== void 0 && e.addEventListener("keydown", st.onKeyDown.bind(this, t)), e.oninput = st.onInput.bind(this, t, i);
201
+ t !== void 0 && e.addEventListener("keydown", nt.onKeyDown.bind(this, t)), e.oninput = nt.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 && !st.PERMITTED_KEYS.has(t.key) && !st.isKeyCombinationPermitted(t) && t.preventDefault();
209
+ n && n.length >= e && !nt.PERMITTED_KEYS.has(t.key) && !nt.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 st;
224
+ return nt;
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
- re.applyStylesToElement(a, l), be.applyEvents(a, r);
703
+ se.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 re = /*#__PURE__*/function () {
715
- function re() {
716
- _classCallCheck(this, re);
714
+ var se = /*#__PURE__*/function () {
715
+ function se() {
716
+ _classCallCheck(this, se);
717
717
  }
718
- _createClass(re, null, [{
718
+ _createClass(se, null, [{
719
719
  key: "applyStylesToElement",
720
720
  value: function applyStylesToElement(e, t) {
721
721
  var i = M.processStateful(t, {}, {});
@@ -734,7 +734,7 @@ var re = /*#__PURE__*/function () {
734
734
  value: function applyClassUtilitiesToElement(e, t) {
735
735
  var i = t.events,
736
736
  n = t.styles;
737
- i && re.applyEventsToElement(e, i), n && !be.doesElementContainDeepChatClass(e) && re.applyStylesToElement(e, n);
737
+ i && se.applyEventsToElement(e, i), n && !be.doesElementContainDeepChatClass(e) && se.applyStylesToElement(e, n);
738
738
  }
739
739
  }, {
740
740
  key: "applyCustomClassUtilities",
@@ -742,17 +742,17 @@ var re = /*#__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] && re.applyClassUtilitiesToElement(r, e[i]);
745
+ e[i] && se.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), re.applyCustomClassUtilities(e.htmlClassUtilities, t);
752
+ be.applyDeepChatUtilities(e, e.htmlClassUtilities, t), se.applyCustomClassUtilities(e.htmlClassUtilities, t);
753
753
  }
754
754
  }]);
755
- return re;
755
+ return se;
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, re.apply(e, o.outerContainer), ke.flagHTMLUpdateClass(o.bubbleElement)), o;
777
+ return o && (o.bubbleElement.innerHTML = t, se.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), 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;
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;
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 mt(s) {
815
+ function ft(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(mt(d))), o = ' class="' + a + l + '"';
874
+ l = z(Ie(ft(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(mt(s[e].alt))) : "") + '"',
926
+ r = ' alt="' + (s[e].alt ? z(Ie(ft(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 gt(s, e) {
1189
+ function mt(s, e) {
1190
1190
  var t,
1191
1191
  i,
1192
1192
  n,
@@ -1207,7 +1207,7 @@ function gt(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 = gt(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 = mt(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(mt(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(ft(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 = mt(s.src.slice(r, e)), !s.parser.validateLink(n)) ? !1 : (s.linkContent = n, s.pos = e, !0);
1260
+ return r === e || (n = ft(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 = mt(s.src.slice(i + 1, e)), !0;
1269
+ if (t = s.src.charCodeAt(e), t === r) return s.pos = e + 1, s.linkContent = ft(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 = gt(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 = mt(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
- ae = !0,
1671
+ oe = !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) && (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({
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({
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, ae && Qs(s, V), !0;
1709
+ }), G[1] = n, s.line = n, oe && 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 = gt(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 = mt(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 = 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;
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;
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 = 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({
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({
2359
2359
  type: "footnote_ref",
2360
2360
  id: n,
2361
2361
  level: s.level
@@ -2630,34 +2630,34 @@ var eo = {
2630
2630
  function Qn(s, e, t) {
2631
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;
2632
2632
  }
2633
- function pe(s, e) {
2633
+ function he(s, e) {
2634
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 || {});
2635
2635
  }
2636
- pe.prototype.set = function (s) {
2636
+ he.prototype.set = function (s) {
2637
2637
  Gn(this.options, s);
2638
2638
  };
2639
- pe.prototype.configure = function (s) {
2639
+ he.prototype.configure = function (s) {
2640
2640
  var e = this;
2641
2641
  if (!s) throw new Error("Wrong `remarkable` preset, check name/content");
2642
2642
  s.options && e.set(s.options), s.components && Object.keys(s.components).forEach(function (t) {
2643
2643
  s.components[t].rules && e[t].ruler.enable(s.components[t].rules, !0);
2644
2644
  });
2645
2645
  };
2646
- pe.prototype.use = function (s, e) {
2646
+ he.prototype.use = function (s, e) {
2647
2647
  return s(this, e), this;
2648
2648
  };
2649
- pe.prototype.parse = function (s, e) {
2649
+ he.prototype.parse = function (s, e) {
2650
2650
  var t = new Qn(this, s, e);
2651
2651
  return this.core.process(t), t.tokens;
2652
2652
  };
2653
- pe.prototype.render = function (s, e) {
2653
+ he.prototype.render = function (s, e) {
2654
2654
  return e = e || {}, this.renderer.render(this.parse(s, e), this.options, e);
2655
2655
  };
2656
- pe.prototype.parseInline = function (s, e) {
2656
+ he.prototype.parseInline = function (s, e) {
2657
2657
  var t = new Qn(this, s, e);
2658
2658
  return t.inlineMode = !0, this.core.process(t), t.tokens;
2659
2659
  };
2660
- pe.prototype.renderInline = function (s, e) {
2660
+ he.prototype.renderInline = function (s, e) {
2661
2661
  return e = e || {}, this.renderer.render(this.parseInline(s, e), this.options, e);
2662
2662
  };
2663
2663
  var Pi = /*#__PURE__*/function () {
@@ -2668,7 +2668,7 @@ var Pi = /*#__PURE__*/function () {
2668
2668
  key: "createNew",
2669
2669
  value: function createNew() {
2670
2670
  var e = window.hljs;
2671
- return e ? new pe({
2671
+ return e ? new he({
2672
2672
  highlight: function highlight(t, i) {
2673
2673
  if (i && e.getLanguage(i)) try {
2674
2674
  return e.highlight(i, t).value;
@@ -2694,7 +2694,7 @@ var Pi = /*#__PURE__*/function () {
2694
2694
  // set target to open in a new tab
2695
2695
  typographer: !0
2696
2696
  // Enable smartypants and other sweet transforms
2697
- }) : new pe({
2697
+ }) : new he({
2698
2698
  highlight: function highlight(t) {
2699
2699
  return t;
2700
2700
  },
@@ -2769,7 +2769,7 @@ var es = /*#__PURE__*/function () {
2769
2769
  return Pt;
2770
2770
  }();
2771
2771
  es.DEFAULT_FILE_NAME = "file";
2772
- var se = es;
2772
+ var ne = es;
2773
2773
  var jt = /*#__PURE__*/function () {
2774
2774
  function jt() {
2775
2775
  _classCallCheck(this, jt);
@@ -2781,7 +2781,7 @@ var jt = /*#__PURE__*/function () {
2781
2781
  message: t,
2782
2782
  isInitial: i
2783
2783
  }));
2784
- se.reAddFileRefToObject(t, n), e.onNewMessage(n), e.dispatchEvent(new CustomEvent("new-message", {
2784
+ ne.reAddFileRefToObject(t, n), e.onNewMessage(n), e.dispatchEvent(new CustomEvent("new-message", {
2785
2785
  detail: n
2786
2786
  }));
2787
2787
  }
@@ -2857,11 +2857,11 @@ var D = /*#__PURE__*/function () {
2857
2857
  }();
2858
2858
  var so = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8c3ZnIGZpbGw9IiMwMDAwMDAiIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIAoJCXZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+Cgk8cGF0aCBkPSJNMjMsMzAuMzZIOWMtMi40MDQsMC00LjM2LTEuOTU2LTQuMzYtNC4zNlYxNWMwLTIuNDA0LDEuOTU2LTQuMzYsNC4zNi00LjM2aDMuNjU5CgkJYzAuMTY3LTEuNTY2LDEuNDE1LTIuODEzLDIuOTgxLTIuOTgxVjUuMzMzYy0xLjEzMS0wLjE3NC0yLTEuMTU0LTItMi4zMzNjMC0xLjMwMSwxLjA1OS0yLjM2LDIuMzYtMi4zNgoJCWMxLjMwMiwwLDIuMzYsMS4wNTksMi4zNiwyLjM2YzAsMS4xNzktMC44NjksMi4xNTktMiwyLjMzM1Y3LjY2YzEuNTY2LDAuMTY3LDIuODE0LDEuNDE1LDIuOTgxLDIuOTgxSDIzCgkJYzIuNDA0LDAsNC4zNiwxLjk1Niw0LjM2LDQuMzZ2MTFDMjcuMzYsMjguNDA0LDI1LjQwNCwzMC4zNiwyMywzMC4zNnogTTksMTEuMzZjLTIuMDA3LDAtMy42NCwxLjYzMy0zLjY0LDMuNjR2MTEKCQljMCwyLjAwNywxLjYzMywzLjY0LDMuNjQsMy42NGgxNGMyLjAwNywwLDMuNjQtMS42MzMsMy42NC0zLjY0VjE1YzAtMi4wMDctMS42MzMtMy42NC0zLjY0LTMuNjRIOXogTTEzLjM4NCwxMC42NGg1LjIzMQoJCUMxOC40MzksOS4zNTQsMTcuMzM0LDguMzYsMTYsOC4zNkMxNC42NjcsOC4zNiwxMy41NjEsOS4zNTQsMTMuMzg0LDEwLjY0eiBNMTYsMS4zNmMtMC45MDQsMC0xLjY0LDAuNzM2LTEuNjQsMS42NAoJCVMxNS4wOTYsNC42NCwxNiw0LjY0YzAuOTA0LDAsMS42NC0wLjczNiwxLjY0LTEuNjRTMTYuOTA0LDEuMzYsMTYsMS4zNnogTTIwLDI3LjM2aC04Yy0xLjMwMSwwLTIuMzYtMS4wNTktMi4zNi0yLjM2CgkJczEuMDU5LTIuMzYsMi4zNi0yLjM2aDhjMS4zMDIsMCwyLjM2LDEuMDU5LDIuMzYsMi4zNlMyMS4zMDIsMjcuMzYsMjAsMjcuMzZ6IE0xMiwyMy4zNmMtMC45MDQsMC0xLjY0LDAuNzM1LTEuNjQsMS42NAoJCXMwLjczNiwxLjY0LDEuNjQsMS42NGg4YzAuOTA0LDAsMS42NC0wLjczNSwxLjY0LTEuNjRzLTAuNzM1LTEuNjQtMS42NC0xLjY0SDEyeiBNMzEsMjMuODZoLTJjLTAuMTk5LDAtMC4zNi0wLjE2MS0wLjM2LTAuMzZWMTUKCQljMC0wLjE5OSwwLjE2MS0wLjM2LDAuMzYtMC4zNmgyYzAuMTk5LDAsMC4zNiwwLjE2MSwwLjM2LDAuMzZ2OC41QzMxLjM2LDIzLjY5OSwzMS4xOTksMjMuODYsMzEsMjMuODZ6IE0yOS4zNiwyMy4xNGgxLjI3OXYtNy43OAoJCUgyOS4zNlYyMy4xNHogTTMsMjMuODZIMWMtMC4xOTksMC0wLjM2LTAuMTYxLTAuMzYtMC4zNlYxNWMwLTAuMTk5LDAuMTYxLTAuMzYsMC4zNi0wLjM2aDJjMC4xOTksMCwwLjM2LDAuMTYxLDAuMzYsMC4zNnY4LjUKCQlDMy4zNiwyMy42OTksMy4xOTksMjMuODYsMywyMy44NnogTTEuMzYsMjMuMTRoMS4yOHYtNy43OEgxLjM2VjIzLjE0eiBNMjAsMjAuMzZjLTEuMzAyLDAtMi4zNi0xLjA1OS0yLjM2LTIuMzYKCQlzMS4wNTktMi4zNiwyLjM2LTIuMzZzMi4zNiwxLjA1OSwyLjM2LDIuMzZDMjIuMzYsMTkuMzAyLDIxLjMwMiwyMC4zNiwyMCwyMC4zNnogTTIwLDE2LjM2Yy0wLjkwNCwwLTEuNjQsMC43MzYtMS42NCwxLjY0CgkJczAuNzM1LDEuNjQsMS42NCwxLjY0czEuNjQtMC43MzUsMS42NC0xLjY0UzIwLjkwNCwxNi4zNiwyMCwxNi4zNnogTTEyLDIwLjM2Yy0xLjMwMSwwLTIuMzYtMS4wNTktMi4zNi0yLjM2czEuMDU5LTIuMzYsMi4zNi0yLjM2CgkJczIuMzYsMS4wNTksMi4zNiwyLjM2QzE0LjM2LDE5LjMwMiwxMy4zMDEsMjAuMzYsMTIsMjAuMzZ6IE0xMiwxNi4zNmMtMC45MDQsMC0xLjY0LDAuNzM2LTEuNjQsMS42NHMwLjczNiwxLjY0LDEuNjQsMS42NAoJCXMxLjY0LTAuNzM1LDEuNjQtMS42NFMxMi45MDQsMTYuMzYsMTIsMTYuMzZ6Ii8+Cgk8cmVjdCBzdHlsZT0iZmlsbDpub25lOyIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIi8+Cjwvc3ZnPg==",
2859
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==";
2860
- var de = /*#__PURE__*/function () {
2861
- function de() {
2862
- _classCallCheck(this, de);
2860
+ var ce = /*#__PURE__*/function () {
2861
+ function ce() {
2862
+ _classCallCheck(this, ce);
2863
2863
  }
2864
- _createClass(de, null, [{
2864
+ _createClass(ce, null, [{
2865
2865
  key: "applyCustomStylesToElements",
2866
2866
  value: function applyCustomStylesToElements(e, t, i) {
2867
2867
  Object.assign(e.style, i.container), Object.assign(t.style, i.avatar);
@@ -2870,10 +2870,10 @@ var de = /*#__PURE__*/function () {
2870
2870
  key: "applyCustomStyles",
2871
2871
  value: function applyCustomStyles(e, t, i, n) {
2872
2872
  var r, o, a, l;
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);
2873
+ 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 {
2874
+ (a = i.ai) != null && a.styles && ce.applyCustomStylesToElements(e, t, i.ai.styles);
2875
2875
  var c = (l = i[n]) == null ? void 0 : l.styles;
2876
- c && de.applyCustomStylesToElements(e, t, c);
2876
+ c && ce.applyCustomStylesToElements(e, t, c);
2877
2877
  }
2878
2878
  }
2879
2879
  }, {
@@ -2883,7 +2883,7 @@ var de = /*#__PURE__*/function () {
2883
2883
  var i = document.createElement("img");
2884
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");
2885
2885
  var n = document.createElement("div");
2886
- return n.classList.add("avatar-container"), n.appendChild(i), t && de.applyCustomStyles(n, i, t, e), n;
2886
+ return n.classList.add("avatar-container"), n.appendChild(i), t && ce.applyCustomStyles(n, i, t, e), n;
2887
2887
  }
2888
2888
  }, {
2889
2889
  key: "getPosition",
@@ -2897,12 +2897,12 @@ var de = /*#__PURE__*/function () {
2897
2897
  key: "add",
2898
2898
  value: function add(e, t, i) {
2899
2899
  var n = typeof i == "boolean" ? void 0 : i,
2900
- r = de.createAvatar(t, n),
2901
- o = de.getPosition(t, n);
2900
+ r = ce.createAvatar(t, n),
2901
+ o = ce.getPosition(t, n);
2902
2902
  r.classList.add(o === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(o === "left" ? "beforebegin" : "afterend", r);
2903
2903
  }
2904
2904
  }]);
2905
- return de;
2905
+ return ce;
2906
2906
  }();
2907
2907
  var Ge = /*#__PURE__*/function () {
2908
2908
  function Ge() {
@@ -3006,7 +3006,7 @@ var Ke = /*#__PURE__*/function () {
3006
3006
  value:
3007
3007
  // prettier-ignore
3008
3008
  function addInnerContainerElements(e, t, i) {
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), {
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 && ce.add(e, i, this._avatars), this._names && Ge.add(e, i, this._names), {
3010
3010
  bubbleElement: e
3011
3011
  };
3012
3012
  }
@@ -3084,11 +3084,11 @@ var Ke = /*#__PURE__*/function () {
3084
3084
  }();
3085
3085
  var Wi = /*#__PURE__*/function () {
3086
3086
  // used for extracting at end and for isStreaming
3087
- function rt(e) {
3088
- _classCallCheck(this, rt);
3087
+ function st(e) {
3088
+ _classCallCheck(this, st);
3089
3089
  this._streamedContent = "", this._streamType = "", this._hasStreamEnded = !1, this._messages = e;
3090
3090
  }
3091
- _createClass(rt, [{
3091
+ _createClass(st, [{
3092
3092
  key: "upsertStreamedMessage",
3093
3093
  value: function upsertStreamedMessage(e) {
3094
3094
  var r;
@@ -3107,7 +3107,7 @@ var Wi = /*#__PURE__*/function () {
3107
3107
  key: "setInitialState",
3108
3108
  value: function setInitialState(e, t, i) {
3109
3109
  var _i8;
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;
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(st.MESSAGE_CLASS), this._streamedContent = t, this._activeMessageRole = i;
3111
3111
  }
3112
3112
  }, {
3113
3113
  key: "updateBasedOnType",
@@ -3125,7 +3125,7 @@ var Wi = /*#__PURE__*/function () {
3125
3125
  value: function updateHTML(e, t, i) {
3126
3126
  if (i) this._streamedContent = e, t.innerHTML = e;else {
3127
3127
  var n = document.createElement("span");
3128
- n.innerHTML = e, t.appendChild(n), this._streamedContent = rt.HTML_CONTENT_PLACEHOLDER;
3128
+ n.innerHTML = e, t.appendChild(n), this._streamedContent = st.HTML_CONTENT_PLACEHOLDER;
3129
3129
  }
3130
3130
  }
3131
3131
  }, {
@@ -3137,23 +3137,23 @@ var Wi = /*#__PURE__*/function () {
3137
3137
  t = _this$_messages.elementRef,
3138
3138
  i = (r = v.getLastMessageBubbleElement(t)) == null ? void 0 : r.classList;
3139
3139
  if (i != null && i.contains("loading-message-text")) throw Error(A.NO_VALID_STREAM_EVENTS_SENT);
3140
- if (!(i != null && i.contains(rt.MESSAGE_CLASS))) return;
3140
+ if (!(i != null && i.contains(st.MESSAGE_CLASS))) return;
3141
3141
  var n = {
3142
3142
  role: this._activeMessageRole || v.AI_ROLE
3143
3143
  };
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;
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 === 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;
3145
3145
  }
3146
3146
  }]);
3147
- return rt;
3147
+ return st;
3148
3148
  }();
3149
3149
  Wi.MESSAGE_CLASS = "streamed-message";
3150
3150
  Wi.HTML_CONTENT_PLACEHOLDER = "htmlplaceholder";
3151
3151
  var Ze = Wi;
3152
3152
  var ts = /*#__PURE__*/function () {
3153
- function ot() {
3154
- _classCallCheck(this, ot);
3153
+ function rt() {
3154
+ _classCallCheck(this, rt);
3155
3155
  }
3156
- _createClass(ot, null, [{
3156
+ _createClass(rt, null, [{
3157
3157
  key: "tempRemoveContentHeader",
3158
3158
  value: // need to pass stringifyBody boolean separately as binding is throwing an error for some reason
3159
3159
  // prettier-ignore
@@ -3169,8 +3169,8 @@ var ts = /*#__PURE__*/function () {
3169
3169
  }
3170
3170
  throw new Error("Request settings have not been set up");
3171
3171
  case 2:
3172
- n = e.headers[ot.CONTENT_TYPE];
3173
- delete e.headers[ot.CONTENT_TYPE];
3172
+ n = e.headers[rt.CONTENT_TYPE];
3173
+ delete e.headers[rt.CONTENT_TYPE];
3174
3174
  _context.prev = 4;
3175
3175
  _context.next = 7;
3176
3176
  return t(i);
@@ -3181,9 +3181,9 @@ var ts = /*#__PURE__*/function () {
3181
3181
  case 10:
3182
3182
  _context.prev = 10;
3183
3183
  _context.t0 = _context["catch"](4);
3184
- throw e.headers[ot.CONTENT_TYPE] = n, _context.t0;
3184
+ throw e.headers[rt.CONTENT_TYPE] = n, _context.t0;
3185
3185
  case 13:
3186
- return _context.abrupt("return", (e.headers[ot.CONTENT_TYPE] = n, r));
3186
+ return _context.abrupt("return", (e.headers[rt.CONTENT_TYPE] = n, r));
3187
3187
  case 14:
3188
3188
  case "end":
3189
3189
  return _context.stop();
@@ -3270,7 +3270,7 @@ var ts = /*#__PURE__*/function () {
3270
3270
  return e && _typeof(e) == "object" && (typeof e.error == "string" || typeof e.text == "string" || typeof e.html == "string" || Array.isArray(e.files));
3271
3271
  }
3272
3272
  }]);
3273
- return ot;
3273
+ return rt;
3274
3274
  }();
3275
3275
  ts.CONTENT_TYPE = "Content-Type";
3276
3276
  var _ = ts;
@@ -3412,7 +3412,7 @@ function po(s, e) {
3412
3412
  }
3413
3413
  function _X() {
3414
3414
  _X = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
3415
- var ae, Q, N;
3415
+ var oe, Q, N;
3416
3416
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3417
3417
  while (1) switch (_context3.prev = _context3.next) {
3418
3418
  case 0:
@@ -3444,7 +3444,7 @@ function po(s, e) {
3444
3444
  _context3.prev = 14;
3445
3445
  _context3.t0 = _context3["catch"](1);
3446
3446
  if (!g.signal.aborted) try {
3447
- N = (ae = a == null ? void 0 : a(_context3.t0)) !== null && ae !== void 0 ? ae : E;
3447
+ N = (oe = a == null ? void 0 : a(_context3.t0)) !== null && oe !== void 0 ? oe : E;
3448
3448
  window.clearTimeout(S), S = window.setTimeout(X, N);
3449
3449
  } catch (N) {
3450
3450
  V(), h(N);
@@ -3465,10 +3465,10 @@ function fo(s) {
3465
3465
  if (!(e != null && e.startsWith(Di))) throw new Error("Expected content-type to be ".concat(Di, ", Actual: ").concat(e));
3466
3466
  }
3467
3467
  var is = /*#__PURE__*/function () {
3468
- function at() {
3469
- _classCallCheck(this, at);
3468
+ function ot() {
3469
+ _classCallCheck(this, ot);
3470
3470
  }
3471
- _createClass(at, null, [{
3471
+ _createClass(ot, null, [{
3472
3472
  key: "generateResponse",
3473
3473
  value: function generateResponse(e) {
3474
3474
  var t = e.messages[e.messages.length - 1];
@@ -3491,15 +3491,15 @@ var is = /*#__PURE__*/function () {
3491
3491
  }, {
3492
3492
  key: "getResponse",
3493
3493
  value: function getResponse(e) {
3494
- return e.customDemoResponse ? at.getCustomResponse(e.customDemoResponse, e.messages[e.messages.length - 1]) : {
3495
- text: at.generateResponse(e)
3494
+ return e.customDemoResponse ? ot.getCustomResponse(e.customDemoResponse, e.messages[e.messages.length - 1]) : {
3495
+ text: ot.generateResponse(e)
3496
3496
  };
3497
3497
  }
3498
3498
  // timeout is used to simulate a timeout for a response to come back
3499
3499
  }, {
3500
3500
  key: "request",
3501
3501
  value: function request(e, t) {
3502
- var i = at.getResponse(t);
3502
+ var i = ot.getResponse(t);
3503
3503
  setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3504
3504
  var r, o, n;
3505
3505
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
@@ -3529,12 +3529,12 @@ var is = /*#__PURE__*/function () {
3529
3529
  key: "requestStream",
3530
3530
  value: function requestStream(e, t) {
3531
3531
  setTimeout(function () {
3532
- var i = at.getResponse(e);
3532
+ var i = ot.getResponse(e);
3533
3533
  C.simulate(e, t, i);
3534
3534
  }, 400);
3535
3535
  }
3536
3536
  }]);
3537
- return at;
3537
+ return ot;
3538
3538
  }();
3539
3539
  is.URL = "deep-chat-demo";
3540
3540
  var ve = is;
@@ -3634,7 +3634,7 @@ var C = /*#__PURE__*/function () {
3634
3634
  },
3635
3635
  onmessage: function onmessage(k) {
3636
3636
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
3637
- var G, X, ae, Q, N;
3637
+ var G, X, oe, Q, N;
3638
3638
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
3639
3639
  while (1) switch (_context6.prev = _context6.next) {
3640
3640
  case 0:
@@ -3654,7 +3654,7 @@ var C = /*#__PURE__*/function () {
3654
3654
  _context6.t0 = Q;
3655
3655
  case 7:
3656
3656
  N = _context6.t0;
3657
- (ae = e.extractResultData) == null || ae.call(e, N).then(function (Fe) {
3657
+ (oe = e.extractResultData) == null || oe.call(e, N).then(function (Fe) {
3658
3658
  h.upsertStreamedMessage(Fe);
3659
3659
  })["catch"](function (Fe) {
3660
3660
  return _.displayError(i, Fe);
@@ -5079,17 +5079,17 @@ var ss = /*#__PURE__*/function (_U) {
5079
5079
  }(U);
5080
5080
  ss.URL_PREFIX = "https://api-inference.huggingface.co/models/";
5081
5081
  var Pe = ss;
5082
- var xt = /*#__PURE__*/function (_Pe) {
5083
- _inherits(xt, _Pe);
5084
- var _super4 = _createSuper(xt);
5082
+ var yt = /*#__PURE__*/function (_Pe) {
5083
+ _inherits(yt, _Pe);
5084
+ var _super4 = _createSuper(yt);
5085
5085
  // prettier-ignore
5086
- function xt(e, t, i, n, r, o) {
5086
+ function yt(e, t, i, n, r, o) {
5087
5087
  var _this9;
5088
- _classCallCheck(this, xt);
5089
- _this9 = _super4.call(this, e, t, i, n, r, o), _this9.isTextInputDisabled = !0, _this9.canSendMessage = xt.canSendFile;
5088
+ _classCallCheck(this, yt);
5089
+ _this9 = _super4.call(this, e, t, i, n, r, o), _this9.isTextInputDisabled = !0, _this9.canSendMessage = yt.canSendFile;
5090
5090
  return _this9;
5091
5091
  }
5092
- _createClass(xt, [{
5092
+ _createClass(yt, [{
5093
5093
  key: "preprocessBody",
5094
5094
  value: function preprocessBody(e, t, i) {
5095
5095
  return i[0];
@@ -5132,10 +5132,10 @@ var xt = /*#__PURE__*/function (_Pe) {
5132
5132
  return !!(t != null && t[0]);
5133
5133
  }
5134
5134
  }]);
5135
- return xt;
5135
+ return yt;
5136
5136
  }(Pe);
5137
- var yo = /*#__PURE__*/function (_xt) {
5138
- _inherits(yo, _xt);
5137
+ var yo = /*#__PURE__*/function (_yt) {
5138
+ _inherits(yo, _yt);
5139
5139
  var _super5 = _createSuper(yo);
5140
5140
  // prettier-ignore
5141
5141
  function yo(e) {
@@ -5185,9 +5185,9 @@ var yo = /*#__PURE__*/function (_xt) {
5185
5185
  }()
5186
5186
  }]);
5187
5187
  return yo;
5188
- }(xt);
5189
- var xo = /*#__PURE__*/function (_xt2) {
5190
- _inherits(xo, _xt2);
5188
+ }(yt);
5189
+ var xo = /*#__PURE__*/function (_yt2) {
5190
+ _inherits(xo, _yt2);
5191
5191
  var _super6 = _createSuper(xo);
5192
5192
  function xo(e) {
5193
5193
  _classCallCheck(this, xo);
@@ -5236,13 +5236,13 @@ var xo = /*#__PURE__*/function (_xt2) {
5236
5236
  }()
5237
5237
  }]);
5238
5238
  return xo;
5239
- }(xt);
5240
- var Et = "data:image/png;base64,";
5241
- var oe = /*#__PURE__*/function () {
5242
- function oe() {
5243
- _classCallCheck(this, oe);
5239
+ }(yt);
5240
+ var xt = "data:image/png;base64,";
5241
+ var re = /*#__PURE__*/function () {
5242
+ function re() {
5243
+ _classCallCheck(this, re);
5244
5244
  }
5245
- _createClass(oe, null, [{
5245
+ _createClass(re, null, [{
5246
5246
  key: "buildHeaders",
5247
5247
  value: function buildHeaders(e) {
5248
5248
  return {
@@ -5262,11 +5262,11 @@ var oe = /*#__PURE__*/function () {
5262
5262
  return {
5263
5263
  url: "https://api.stability.ai/v1/engines/list",
5264
5264
  method: "GET",
5265
- handleVerificationResult: oe.handleVerificationResult
5265
+ handleVerificationResult: re.handleVerificationResult
5266
5266
  };
5267
5267
  }
5268
5268
  }]);
5269
- return oe;
5269
+ return re;
5270
5270
  }();
5271
5271
  var ni = /*#__PURE__*/function (_U2) {
5272
5272
  _inherits(ni, _U2);
@@ -5297,7 +5297,7 @@ var zt = /*#__PURE__*/function (_ni) {
5297
5297
  }
5298
5298
  }
5299
5299
  };
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>";
5300
+ _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>";
5301
5301
  var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageUpscale;
5302
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;
5303
5303
  return _this11;
@@ -5360,7 +5360,7 @@ var zt = /*#__PURE__*/function (_ni) {
5360
5360
  return _context28.abrupt("return", {
5361
5361
  files: e.artifacts.map(function (i) {
5362
5362
  return {
5363
- src: "".concat(Et).concat(i.base64),
5363
+ src: "".concat(xt).concat(i.base64),
5364
5364
  type: "image"
5365
5365
  };
5366
5366
  })
@@ -5406,7 +5406,7 @@ var Ut = /*#__PURE__*/function (_ni2) {
5406
5406
  }
5407
5407
  }
5408
5408
  };
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>";
5409
+ _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>";
5410
5410
  var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
5411
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;
5412
5412
  return _this12;
@@ -5469,7 +5469,7 @@ var Ut = /*#__PURE__*/function (_ni2) {
5469
5469
  return _context30.abrupt("return", {
5470
5470
  files: e.artifacts.map(function (i) {
5471
5471
  return {
5472
- src: "".concat(Et).concat(i.base64),
5472
+ src: "".concat(xt).concat(i.base64),
5473
5473
  type: "image"
5474
5474
  };
5475
5475
  })
@@ -5498,8 +5498,8 @@ var Ut = /*#__PURE__*/function (_ni2) {
5498
5498
  }]);
5499
5499
  return Ut;
5500
5500
  }(ni);
5501
- var Eo = /*#__PURE__*/function (_xt3) {
5502
- _inherits(Eo, _xt3);
5501
+ var Eo = /*#__PURE__*/function (_yt3) {
5502
+ _inherits(Eo, _yt3);
5503
5503
  var _super10 = _createSuper(Eo);
5504
5504
  function Eo(e) {
5505
5505
  _classCallCheck(this, Eo);
@@ -5547,7 +5547,7 @@ var Eo = /*#__PURE__*/function (_xt3) {
5547
5547
  }()
5548
5548
  }]);
5549
5549
  return Eo;
5550
- }(xt);
5550
+ }(yt);
5551
5551
  var So = /*#__PURE__*/function (_Pe2) {
5552
5552
  _inherits(So, _Pe2);
5553
5553
  var _super11 = _createSuper(So);
@@ -5785,7 +5785,7 @@ var qt = /*#__PURE__*/function (_ni3) {
5785
5785
  }
5786
5786
  }
5787
5787
  };
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>";
5788
+ _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>";
5789
5789
  var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
5790
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;
5791
5791
  return _this15;
@@ -5848,7 +5848,7 @@ var qt = /*#__PURE__*/function (_ni3) {
5848
5848
  return _context37.abrupt("return", {
5849
5849
  files: e.artifacts.map(function (i) {
5850
5850
  return {
5851
- src: "".concat(Et).concat(i.base64),
5851
+ src: "".concat(xt).concat(i.base64),
5852
5852
  type: "image"
5853
5853
  };
5854
5854
  })
@@ -5926,7 +5926,7 @@ var Ht = /*#__PURE__*/function (_ni4) {
5926
5926
  var r;
5927
5927
  var t = JSON.parse(JSON.stringify(e.directConnection)),
5928
5928
  i = t.stabilityAI;
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>";
5929
+ _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>";
5930
5930
  var n = (r = t.stabilityAI) == null ? void 0 : r.textToImage;
5931
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;
5932
5932
  return _this16;
@@ -5983,7 +5983,7 @@ var Ht = /*#__PURE__*/function (_ni4) {
5983
5983
  return _context40.abrupt("return", {
5984
5984
  files: e.artifacts.map(function (i) {
5985
5985
  return {
5986
- src: "".concat(Et).concat(i.base64),
5986
+ src: "".concat(xt).concat(i.base64),
5987
5987
  type: "image"
5988
5988
  };
5989
5989
  })
@@ -6869,11 +6869,11 @@ var Oo = /*#__PURE__*/function (_Ro) {
6869
6869
  }]);
6870
6870
  return Oo;
6871
6871
  }(Ro);
6872
- var dt = /*#__PURE__*/function () {
6873
- function dt() {
6874
- _classCallCheck(this, dt);
6872
+ var ct = /*#__PURE__*/function () {
6873
+ function ct() {
6874
+ _classCallCheck(this, ct);
6875
6875
  }
6876
- _createClass(dt, null, [{
6876
+ _createClass(ct, null, [{
6877
6877
  key: "poll",
6878
6878
  value: function () {
6879
6879
  var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(e, t) {
@@ -6969,11 +6969,11 @@ var dt = /*#__PURE__*/function () {
6969
6969
  return {
6970
6970
  url: "https://api.assemblyai.com/v2/upload",
6971
6971
  method: "POST",
6972
- handleVerificationResult: dt.handleVerificationResult
6972
+ handleVerificationResult: ct.handleVerificationResult
6973
6973
  };
6974
6974
  }
6975
6975
  }]);
6976
- return dt;
6976
+ return ct;
6977
6977
  }();
6978
6978
  var Yi = /*#__PURE__*/function (_U7) {
6979
6979
  _inherits(Yi, _U7);
@@ -6983,7 +6983,7 @@ var Yi = /*#__PURE__*/function (_U7) {
6983
6983
  _classCallCheck(this, Yi);
6984
6984
  var i;
6985
6985
  var t = (i = e.directConnection) == null ? void 0 : i.assemblyAI;
6986
- _this23 = _super26.call(this, e, dt.buildKeyVerificationDetails(), dt.buildHeaders, t, {
6986
+ _this23 = _super26.call(this, e, ct.buildKeyVerificationDetails(), ct.buildHeaders, t, {
6987
6987
  audio: {}
6988
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;
6989
6989
  return _this23;
@@ -7036,7 +7036,7 @@ var Yi = /*#__PURE__*/function (_U7) {
7036
7036
  case 2:
7037
7037
  t = (r = (n = this.requestSettings) == null ? void 0 : n.headers) == null ? void 0 : r.Authorization;
7038
7038
  _context58.next = 5;
7039
- return dt.poll(t, e.upload_url);
7039
+ return ct.poll(t, e.upload_url);
7040
7040
  case 5:
7041
7041
  _context58.t0 = _context58.sent.text;
7042
7042
  return _context58.abrupt("return", {
@@ -7332,12 +7332,12 @@ var Do = /*#__PURE__*/function (_U9) {
7332
7332
  return Do;
7333
7333
  }(U);
7334
7334
  var Zi = /*#__PURE__*/function (_U10) {
7335
- _inherits(le, _U10);
7336
- var _super31 = _createSuper(le);
7337
- function le(e) {
7335
+ _inherits(ae, _U10);
7336
+ var _super31 = _createSuper(ae);
7337
+ function ae(e) {
7338
7338
  var _l$headers, _c$OpenAIBeta;
7339
7339
  var _this28;
7340
- _classCallCheck(this, le);
7340
+ _classCallCheck(this, ae);
7341
7341
  var r, o, a, l, c;
7342
7342
  var t = JSON.parse(JSON.stringify(e.directConnection)),
7343
7343
  i = t.openAI;
@@ -7352,7 +7352,7 @@ var Zi = /*#__PURE__*/function (_U10) {
7352
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;
7353
7353
  return _this28;
7354
7354
  }
7355
- _createClass(le, [{
7355
+ _createClass(ae, [{
7356
7356
  key: "processMessage",
7357
7357
  value: function processMessage(e, t) {
7358
7358
  var i = this.totalMessagesMaxCharLength || -1;
@@ -7375,11 +7375,11 @@ var Zi = /*#__PURE__*/function (_U10) {
7375
7375
  key: "callService",
7376
7376
  value: function callService(e, t, i) {
7377
7377
  if (this.sessionId) {
7378
- this.url = "".concat(le.THREAD_PREFIX, "/").concat(this.sessionId, "/messages");
7378
+ this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/messages");
7379
7379
  var n = this.processMessage(t, i);
7380
7380
  w.request(this, n, e);
7381
7381
  } else {
7382
- this.url = "".concat(le.THREAD_PREFIX, "/runs");
7382
+ this.url = "".concat(ae.THREAD_PREFIX, "/runs");
7383
7383
  var _n2 = this.createNewThreadMessages(this.rawBody, t, i);
7384
7384
  w.request(this, _n2, e);
7385
7385
  }
@@ -7451,7 +7451,7 @@ var Zi = /*#__PURE__*/function (_U10) {
7451
7451
  _context66.next = 4;
7452
7452
  return this.assignThreadAndRun(e);
7453
7453
  case 4:
7454
- t = "".concat(le.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id), i = {
7454
+ t = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id), i = {
7455
7455
  method: "GET",
7456
7456
  headers: (n = this.requestSettings) == null ? void 0 : n.headers
7457
7457
  };
@@ -7481,7 +7481,7 @@ var Zi = /*#__PURE__*/function (_U10) {
7481
7481
  _context67.next = 8;
7482
7482
  break;
7483
7483
  }
7484
- this.url = "".concat(le.THREAD_PREFIX, "/").concat(this.sessionId, "/runs");
7484
+ this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs");
7485
7485
  _context67.next = 4;
7486
7486
  return O.directFetch(this, JSON.parse(JSON.stringify(this.rawBody)), "POST");
7487
7487
  case 4:
@@ -7516,14 +7516,14 @@ var Zi = /*#__PURE__*/function (_U10) {
7516
7516
  break;
7517
7517
  }
7518
7518
  return _context68.abrupt("return", {
7519
- timeoutMS: le.POLLING_TIMEOUT_MS
7519
+ timeoutMS: ae.POLLING_TIMEOUT_MS
7520
7520
  });
7521
7521
  case 3:
7522
7522
  if (!(t === "completed" && this.messages)) {
7523
7523
  _context68.next = 10;
7524
7524
  break;
7525
7525
  }
7526
- this.url = "".concat(le.THREAD_PREFIX, "/").concat(e.thread_id, "/messages");
7526
+ this.url = "".concat(ae.THREAD_PREFIX, "/").concat(e.thread_id, "/messages");
7527
7527
  _context68.next = 7;
7528
7528
  return O.directFetch(this, {}, "GET");
7529
7529
  case 7:
@@ -7594,14 +7594,14 @@ var Zi = /*#__PURE__*/function (_U10) {
7594
7594
  output: r
7595
7595
  };
7596
7596
  });
7597
- this.url = "".concat(le.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id, "/submit_tool_outputs");
7597
+ this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id, "/submit_tool_outputs");
7598
7598
  _context69.next = 12;
7599
7599
  return O.directFetch(this, {
7600
7600
  tool_outputs: n
7601
7601
  }, "POST");
7602
7602
  case 12:
7603
7603
  return _context69.abrupt("return", {
7604
- timeoutMS: le.POLLING_TIMEOUT_MS
7604
+ timeoutMS: ae.POLLING_TIMEOUT_MS
7605
7605
  });
7606
7606
  case 13:
7607
7607
  case "end":
@@ -7615,7 +7615,7 @@ var Zi = /*#__PURE__*/function (_U10) {
7615
7615
  return handleTools;
7616
7616
  }()
7617
7617
  }]);
7618
- return le;
7618
+ return ae;
7619
7619
  }(U);
7620
7620
  Zi.THREAD_PREFIX = "https://api.openai.com/v1/threads";
7621
7621
  Zi.POLLING_TIMEOUT_MS = 800;
@@ -7732,7 +7732,7 @@ var ri = /*#__PURE__*/function (_U11) {
7732
7732
  src: i.url,
7733
7733
  type: "image"
7734
7734
  } : {
7735
- src: "".concat(Et).concat(i.b64_json),
7735
+ src: "".concat(xt).concat(i.b64_json),
7736
7736
  type: "image"
7737
7737
  };
7738
7738
  })
@@ -7776,20 +7776,20 @@ ri.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations";
7776
7776
  ri.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations";
7777
7777
  ri.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
7778
7778
  var Bo = ri;
7779
- var ut = /*#__PURE__*/function (_U12) {
7780
- _inherits(ut, _U12);
7781
- var _super33 = _createSuper(ut);
7782
- function ut(e) {
7779
+ var dt = /*#__PURE__*/function (_U12) {
7780
+ _inherits(dt, _U12);
7781
+ var _super33 = _createSuper(dt);
7782
+ function dt(e) {
7783
7783
  var _this30$maxMessages, _l$model;
7784
7784
  var _this30;
7785
- _classCallCheck(this, ut);
7785
+ _classCallCheck(this, dt);
7786
7786
  var r, o, a, l;
7787
7787
  var t = JSON.parse(JSON.stringify(e.directConnection)),
7788
7788
  i = t.openAI;
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.");
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 = dt.generateSystemMessage("You are a helpful assistant.");
7790
7790
  var n = (r = t.openAI) == null ? void 0 : r.chat;
7791
7791
  if (_typeof(n) == "object") {
7792
- n.system_prompt && (_this30._systemMessage = ut.generateSystemMessage(n.system_prompt));
7792
+ n.system_prompt && (_this30._systemMessage = dt.generateSystemMessage(n.system_prompt));
7793
7793
  var _ref9 = (a = (o = e.directConnection) == null ? void 0 : o.openAI) == null ? void 0 : a.chat,
7794
7794
  c = _ref9.function_handler;
7795
7795
  c && (_this30._functionHandler = c), _this30.cleanConfig(n), Object.assign(_this30.rawBody, n);
@@ -7797,7 +7797,7 @@ var ut = /*#__PURE__*/function (_U12) {
7797
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";
7798
7798
  return _this30;
7799
7799
  }
7800
- _createClass(ut, [{
7800
+ _createClass(dt, [{
7801
7801
  key: "cleanConfig",
7802
7802
  value: function cleanConfig(e) {
7803
7803
  delete e.system_prompt, delete e.function_handler;
@@ -7811,7 +7811,7 @@ var ut = /*#__PURE__*/function (_U12) {
7811
7811
  var i = JSON.parse(JSON.stringify(e)),
7812
7812
  n = Xe.getCharacterLimitMessages(t, this.totalMessagesMaxCharLength ? this.totalMessagesMaxCharLength - this._systemMessage.content.length : -1).map(function (r) {
7813
7813
  return {
7814
- content: ut.getContent(r),
7814
+ content: dt.getContent(r),
7815
7815
  role: r.role === v.USER_ROLE ? "user" : "assistant"
7816
7816
  };
7817
7817
  });
@@ -7982,7 +7982,7 @@ var ut = /*#__PURE__*/function (_U12) {
7982
7982
  return e.text;
7983
7983
  }
7984
7984
  }]);
7985
- return ut;
7985
+ return dt;
7986
7986
  }(U);
7987
7987
  var Fo = /*#__PURE__*/function (_Ji3) {
7988
7988
  _inherits(Fo, _Ji3);
@@ -8069,40 +8069,36 @@ var Fo = /*#__PURE__*/function (_Ji3) {
8069
8069
  }]);
8070
8070
  return Fo;
8071
8071
  }(Ji);
8072
- var et = /*#__PURE__*/function () {
8073
- function ne() {
8074
- _classCallCheck(this, ne);
8072
+ var Et = /*#__PURE__*/function () {
8073
+ function pe() {
8074
+ _classCallCheck(this, pe);
8075
8075
  }
8076
- _createClass(ne, null, [{
8076
+ _createClass(pe, null, [{
8077
8077
  key: "enableButtons",
8078
- value: function enableButtons(e, t, i) {
8079
- var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
8080
- window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1), i && (i.disabled = !1)) : n < cs.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
8081
- return ne.enableButtons(e, t, i, n + 1);
8078
+ value: function enableButtons(e, t) {
8079
+ var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
8080
+ window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i < cs.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
8081
+ return pe.enableButtons(e, t, i + 1);
8082
8082
  }, 250);
8083
8083
  }
8084
8084
  }, {
8085
8085
  key: "setUpInitial",
8086
8086
  value: function setUpInitial(e, t, i) {
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;
8087
+ var n = (t == null ? void 0 : t.downloadClass) || pe.DOWNLOAD_BUTTON_CLASS,
8088
+ r = (t == null ? void 0 : t.uploadClass) || pe.UPLOAD_BUTTON_CLASS,
8089
+ o = (t == null ? void 0 : t.fileInputClass) || pe.FILE_INPUT_CLASS;
8091
8090
  return setTimeout(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 () {
8091
+ var a = i == null ? void 0 : i.getElementsByClassName(o)[0],
8092
+ l = i == null ? void 0 : i.getElementsByClassName(n)[0],
8093
+ c = i == null ? void 0 : i.getElementsByClassName(r)[0];
8094
+ l && (l.onclick = function () {
8097
8095
  return e();
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 || u) && ne.enableButtons(c, d, u);
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(a, " deep-chat-button deep-chat-web-model-button\">Clear cache</button>\n </div>");
8096
+ }), a && (a.onchange = function () {
8097
+ a.files && a.files.length > 0 && e(a.files);
8098
+ }), c && (c.onclick = function () {
8099
+ return a.click();
8100
+ }), (l || c) && pe.enableButtons(l, c);
8101
+ }), (t == null ? void 0 : t.initialHtml) || "<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>");
8106
8102
  }
8107
8103
  }, {
8108
8104
  key: "exportFile",
@@ -8125,34 +8121,22 @@ var et = /*#__PURE__*/function () {
8125
8121
  }, {
8126
8122
  key: "setUpAfterLoad",
8127
8123
  value: function setUpAfterLoad(e, t, i) {
8128
- var n = (t == null ? void 0 : t.exportFilesClass) || ne.EXPORT_BUTTON_CLASS;
8124
+ var n = (t == null ? void 0 : t.exportFilesClass) || pe.EXPORT_BUTTON_CLASS;
8129
8125
  return setTimeout(function () {
8130
8126
  var r = i == null ? void 0 : i.getElementsByClassName(n)[0];
8131
8127
  r && (r.onclick = function () {
8132
- return ne.exportFile(e);
8128
+ return pe.exportFile(e);
8133
8129
  });
8134
8130
  }), (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>");
8135
8131
  }
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
- }
8147
8132
  }]);
8148
- return ne;
8133
+ return pe;
8149
8134
  }();
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;
8135
+ Et.DOWNLOAD_BUTTON_CLASS = "deep-chat-download-button";
8136
+ Et.UPLOAD_BUTTON_CLASS = "deep-chat-upload-button";
8137
+ Et.FILE_INPUT_CLASS = "deep-chat-file-input";
8138
+ Et.EXPORT_BUTTON_CLASS = "deep-chat-export-button";
8139
+ var vn = Et;
8156
8140
  var yn = {
8157
8141
  model_list: [{
8158
8142
  model_url: "https://huggingface.co/mlc-ai/mlc-chat-Llama-2-7b-chat-hf-q4f32_1/resolve/main/",
@@ -8245,14 +8229,14 @@ var yn = {
8245
8229
  },
8246
8230
  use_web_worker: !0
8247
8231
  },
8248
- tt = /*#__PURE__*/function (_Le2) {
8232
+ et = /*#__PURE__*/function (_Le2) {
8249
8233
  _inherits(T, _Le2);
8250
8234
  var _super35 = _createSuper(T);
8251
8235
  function T(e) {
8252
8236
  var _this32;
8253
8237
  _classCallCheck(this, T);
8254
- var t;
8255
- _this32 = _super35.call(this, e), _this32._isModelLoaded = !1, _this32._isModelLoading = !1, _this32._loadOnFirstMessage = !1, _this32._webModel = {}, _this32.permittedErrorPrefixes = [T.MULTIPLE_MODELS_ERROR, T.WEB_LLM_NOT_FOUND_ERROR, T.GENERIC_ERROR], _this32._conversationHistory = [], _typeof(e.webModel) == "object" && (_this32._webModel = e.webModel), _this32.findModelInWindow(e), _this32.canSendMessage = _this32.canSubmit.bind(_assertThisInitialized(_this32)), _this32._chatEl = (t = e.shadowRoot) == null ? void 0 : t.children[0], e.initialMessages && T.setUpHistory(_this32._conversationHistory, e.initialMessages);
8238
+ var t, i;
8239
+ _this32 = _super35.call(this, e), _this32._isModelLoaded = !1, _this32._isModelLoading = !1, _this32._loadOnFirstMessage = !1, _this32._webModel = {}, _this32.permittedErrorPrefixes = [T.MULTIPLE_MODELS_ERROR, T.WEB_LLM_NOT_FOUND_ERROR, T.GENERIC_ERROR], _this32._conversationHistory = [], _typeof(e.webModel) == "object" && (_this32._webModel = e.webModel), (t = _this32._webModel.load) != null && t.clearCache && T.clearCache(), _this32.findModelInWindow(e), _this32.canSendMessage = _this32.canSubmit.bind(_assertThisInitialized(_this32)), _this32._chatEl = (i = e.shadowRoot) == null ? void 0 : i.children[0], e.initialMessages && T.setUpHistory(_this32._conversationHistory, e.initialMessages);
8256
8240
  return _this32;
8257
8241
  }
8258
8242
  // need ref of messages object as web model exhibits unique behaviour to manipulate chat
@@ -8382,21 +8366,21 @@ var yn = {
8382
8366
  }, {
8383
8367
  key: "getConfig",
8384
8368
  value: function getConfig() {
8385
- var i, n;
8369
+ var i, n, r;
8386
8370
  var e = T.DEFAULT_MODEL;
8387
8371
  this._webModel.model && (e = this._webModel.model);
8388
8372
  var t = JSON.parse(JSON.stringify(yn));
8389
8373
  if ((i = this._webModel.urls) != null && i.model) {
8390
- var r = t.model_list.find(function (o) {
8391
- return o.local_id = e;
8374
+ var o = t.model_list.find(function (a) {
8375
+ return a.local_id = e;
8392
8376
  });
8393
- r && (r.model_url = this._webModel.urls.model);
8377
+ o && (o.model_url = this._webModel.urls.model);
8394
8378
  }
8395
8379
  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);
8380
+ var _o3 = e;
8381
+ t.model_lib_map[_o3] && (t.model_lib_map[_o3] = this._webModel.urls.wasm);
8398
8382
  }
8399
- return {
8383
+ return (r = this._webModel.load) != null && r.skipCache && (t.use_cache = !1), {
8400
8384
  model: e,
8401
8385
  appConfig: t
8402
8386
  };
@@ -8634,15 +8618,26 @@ var yn = {
8634
8618
  }
8635
8619
  });
8636
8620
  }
8621
+ }, {
8622
+ key: "clearCache",
8623
+ value: function clearCache() {
8624
+ caches.open("webllm/model").then(function (e) {
8625
+ e.keys().then(function (t) {
8626
+ t.forEach(function (i) {
8627
+ e["delete"](i);
8628
+ });
8629
+ });
8630
+ });
8631
+ }
8637
8632
  }]);
8638
8633
  return T;
8639
8634
  }(Le);
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;
8635
+ et.GENERIC_ERROR = "Error, please check the following list of [instructions](https://deepchat.dev/docs/webModel#error) to fix this.";
8636
+ et.MULTIPLE_MODELS_ERROR = "Cannot run multiple web models";
8637
+ et.WEB_LLM_NOT_FOUND_ERROR = "WebLLM module not found";
8638
+ et.DEFAULT_MODEL = "Llama-2-7b-chat-hf-q4f32_1";
8639
+ et.MODULE_SEARCH_LIMIT_S = 5;
8640
+ var cs = et;
8646
8641
  var zo = /*#__PURE__*/function () {
8647
8642
  function zo() {
8648
8643
  _classCallCheck(this, zo);
@@ -8656,7 +8651,7 @@ var zo = /*#__PURE__*/function () {
8656
8651
  r = e.webModel;
8657
8652
  if (r) return new cs(e);
8658
8653
  if (t) {
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);
8654
+ 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);
8660
8655
  if (t.assemblyAI) return new Yi(e);
8661
8656
  if (t.cohere) return t.cohere.textGeneration ? new Ao(e) : t.cohere.summarization ? new ko(e) : new Fo(e);
8662
8657
  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);
@@ -8814,7 +8809,7 @@ var fe = /*#__PURE__*/function () {
8814
8809
  key: "createImage",
8815
8810
  value: function createImage(e, t) {
8816
8811
  var i = new Image();
8817
- return i.src = e.src, se.scrollDownOnImageLoad(i.src, t), se.processContent(i, i.src);
8812
+ return i.src = e.src, ne.scrollDownOnImageLoad(i.src, t), ne.processContent(i, i.src);
8818
8813
  }
8819
8814
  // WORK - should base64 images be clickable?
8820
8815
  // WORK - image still does not scroll down when loaded
@@ -8827,7 +8822,7 @@ var fe = /*#__PURE__*/function () {
8827
8822
  while (1) switch (_context85.prev = _context85.next) {
8828
8823
  case 0:
8829
8824
  n = fe.createImage(t, e.elementRef), r = e.createNewMessageElement("", i);
8830
- r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"), se.addMessage(e, r, "image", i);
8825
+ r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"), ne.addMessage(e, r, "image", i);
8831
8826
  case 2:
8832
8827
  case "end":
8833
8828
  return _context85.stop();
@@ -8850,7 +8845,7 @@ var fe = /*#__PURE__*/function () {
8850
8845
  value: function addNewAudioMessage(e, t, i) {
8851
8846
  var n = fe.createAudioElement(t, i),
8852
8847
  r = e.createNewMessageElement("", i);
8853
- r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"), se.addMessage(e, r, "audio", i);
8848
+ r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"), ne.addMessage(e, r, "audio", i);
8854
8849
  }
8855
8850
  }, {
8856
8851
  key: "createAnyFile",
@@ -8862,14 +8857,14 @@ var fe = /*#__PURE__*/function () {
8862
8857
  var n = q.createSVGElement(Ho);
8863
8858
  n.classList.add("any-file-message-icon"), i.appendChild(n);
8864
8859
  var r = document.createElement("div");
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);
8860
+ 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);
8866
8861
  }
8867
8862
  }, {
8868
8863
  key: "addNewAnyFileMessage",
8869
8864
  value: function addNewAnyFileMessage(e, t, i) {
8870
8865
  var n = e.createNewMessageElement("", i),
8871
8866
  r = fe.createAnyFile(t);
8872
- n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r), se.addMessage(e, n, "file", i);
8867
+ n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r), ne.addMessage(e, n, "file", i);
8873
8868
  }
8874
8869
  // no overwrite previous message logic as it is complex to track which files are to be overwritten
8875
8870
  }, {
@@ -8877,7 +8872,7 @@ var fe = /*#__PURE__*/function () {
8877
8872
  value: function addMessages(e, t, i) {
8878
8873
  t.forEach(function (n) {
8879
8874
  var r, o;
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);
8875
+ 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);
8881
8876
  });
8882
8877
  }
8883
8878
  }]);
@@ -9034,7 +9029,7 @@ var me = /*#__PURE__*/function (_Ke) {
9034
9029
  }, {
9035
9030
  key: "populateIntroPanel",
9036
9031
  value: function populateIntroPanel(e, t, i) {
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)));
9032
+ (e || t) && (this._introPanel = new Gt(e, t, i), this._introPanel._elementRef && (se.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
9038
9033
  }
9039
9034
  }, {
9040
9035
  key: "addMultipleFiles",
@@ -9046,7 +9041,7 @@ var me = /*#__PURE__*/function (_Ke) {
9046
9041
  return _context86.abrupt("return", Promise.all((e || []).map(function (t) {
9047
9042
  return new Promise(function (i) {
9048
9043
  if (!t.type || t.type === "any") {
9049
- var n = t.file.name || se.DEFAULT_FILE_NAME;
9044
+ var n = t.file.name || ne.DEFAULT_FILE_NAME;
9050
9045
  i({
9051
9046
  name: n,
9052
9047
  type: "any",
@@ -9316,15 +9311,15 @@ var _t = /*#__PURE__*/function () {
9316
9311
  }]);
9317
9312
  return _t;
9318
9313
  }();
9319
- var bt = /*#__PURE__*/function () {
9320
- function bt() {
9321
- _classCallCheck(this, bt);
9314
+ var gt = /*#__PURE__*/function () {
9315
+ function gt() {
9316
+ _classCallCheck(this, gt);
9322
9317
  }
9323
- _createClass(bt, null, [{
9318
+ _createClass(gt, null, [{
9324
9319
  key: "focusItemWhenOnEdge",
9325
9320
  value: function focusItemWhenOnEdge(e, t) {
9326
9321
  var i = t ? e.children[0] : e.children[e.children.length - 1];
9327
- bt.focusSiblingItem(i, e, t, !0);
9322
+ gt.focusSiblingItem(i, e, t, !0);
9328
9323
  }
9329
9324
  // isEdgeItem means is it a start or end item
9330
9325
  // prettier-ignore
@@ -9333,10 +9328,10 @@ var bt = /*#__PURE__*/function () {
9333
9328
  value: function focusSiblingItem(e, t, i) {
9334
9329
  var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
9335
9330
  var r = n ? e : e[i ? "nextSibling" : "previousSibling"];
9336
- r ? (e.dispatchEvent(new MouseEvent("mouseleave")), r.dispatchEvent(new MouseEvent("mouseenter"))) : (e.dispatchEvent(new MouseEvent("mouseleave")), bt.focusItemWhenOnEdge(t, i));
9331
+ r ? (e.dispatchEvent(new MouseEvent("mouseleave")), r.dispatchEvent(new MouseEvent("mouseenter"))) : (e.dispatchEvent(new MouseEvent("mouseleave")), gt.focusItemWhenOnEdge(t, i));
9337
9332
  }
9338
9333
  }]);
9339
- return bt;
9334
+ return gt;
9340
9335
  }();
9341
9336
  var we = /*#__PURE__*/function () {
9342
9337
  function we() {
@@ -9430,7 +9425,7 @@ var Qi = /*#__PURE__*/function () {
9430
9425
  e.parentElement !== ((i = t.target.shadowRoot) == null ? void 0 : i.children[0]) && _this40.close();
9431
9426
  }), window.addEventListener("keydown", function (t) {
9432
9427
  var i, n, r;
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));
9428
+ _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));
9434
9429
  });
9435
9430
  }
9436
9431
  }], [{
@@ -9615,40 +9610,40 @@ var Wo = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\"
9615
9610
  dropupText: "File"
9616
9611
  }
9617
9612
  };
9618
- var he = /*#__PURE__*/function () {
9613
+ var ue = /*#__PURE__*/function () {
9619
9614
  // prettier-ignore
9620
- function he(e, t, i, n) {
9615
+ function ue(e, t, i, n) {
9621
9616
  var _this43 = this;
9622
- _classCallCheck(this, he);
9617
+ _classCallCheck(this, ue);
9623
9618
  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 () {
9624
9619
  _this43._validationHandler = e._validationHandler;
9625
9620
  });
9626
9621
  }
9627
- _createClass(he, [{
9622
+ _createClass(ue, [{
9628
9623
  key: "attemptAddFile",
9629
9624
  value: function attemptAddFile(e, t) {
9630
- return he.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), !0) : !1;
9625
+ return ue.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), !0) : !1;
9631
9626
  }
9632
9627
  }, {
9633
9628
  key: "addAttachmentBasedOnType",
9634
9629
  value: function addAttachmentBasedOnType(e, t, i) {
9635
- var n = he.getTypeFromBlob(e);
9630
+ var n = ue.getTypeFromBlob(e);
9636
9631
  if (n === "image") {
9637
- var r = he.createImageAttachment(t);
9632
+ var r = ue.createImageAttachment(t);
9638
9633
  this.addFileAttachment(e, "image", r, i);
9639
9634
  } else if (n === "audio") {
9640
- var _r3 = Ui.createAudioAttachment(t);
9641
- this.addFileAttachment(e, "audio", _r3, i);
9635
+ var _r2 = Ui.createAudioAttachment(t);
9636
+ this.addFileAttachment(e, "audio", _r2, i);
9642
9637
  } else {
9643
- var _r4 = he.createAnyFileAttachment(e.name);
9644
- this.addFileAttachment(e, "any", _r4, i);
9638
+ var _r3 = ue.createAnyFileAttachment(e.name);
9639
+ this.addFileAttachment(e, "any", _r3, i);
9645
9640
  }
9646
9641
  }
9647
9642
  }, {
9648
9643
  key: "addFileAttachment",
9649
9644
  value: function addFileAttachment(e, t, i, n) {
9650
9645
  var a;
9651
- var r = he.createContainer(i);
9646
+ var r = ue.createContainer(i);
9652
9647
  if (this._attachments.length >= this._fileCountLimit) {
9653
9648
  var l = this._attachments[this._attachments.length - 1].removeButton;
9654
9649
  l == null || l.click();
@@ -9747,12 +9742,12 @@ var he = /*#__PURE__*/function () {
9747
9742
  return t.classList.add("file-attachment"), t.appendChild(e), t;
9748
9743
  }
9749
9744
  }]);
9750
- return he;
9745
+ return ue;
9751
9746
  }();
9752
9747
  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>",
9753
9748
  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>",
9754
- hs = /*#__PURE__*/function (_he) {
9755
- _inherits(_e, _he);
9749
+ hs = /*#__PURE__*/function (_ue) {
9750
+ _inherits(_e, _ue);
9756
9751
  var _super38 = _createSuper(_e);
9757
9752
  // prettier-ignore
9758
9753
  function _e(e, t, i, n) {
@@ -9864,7 +9859,7 @@ var Zo = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
9864
9859
  }
9865
9860
  }]);
9866
9861
  return _e;
9867
- }(he);
9862
+ }(ue);
9868
9863
  hs.TIMER_LIMIT_S = 5999;
9869
9864
  var Ui = hs;
9870
9865
  var Xo = /*#__PURE__*/function () {
@@ -9876,7 +9871,7 @@ var Xo = /*#__PURE__*/function () {
9876
9871
  value:
9877
9872
  // prettier-ignore
9878
9873
  function create(e, t, i, n, r) {
9879
- return r === "audio" ? new Ui(e, t, i, n) : new he(e, t, i, n);
9874
+ return r === "audio" ? new Ui(e, t, i, n) : new ue(e, t, i, n);
9880
9875
  }
9881
9876
  }]);
9882
9877
  return Xo;
@@ -9981,11 +9976,11 @@ var wt = /*#__PURE__*/function () {
9981
9976
  return wt;
9982
9977
  }();
9983
9978
  var ps = /*#__PURE__*/function () {
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();
9979
+ function le(e, t, i) {
9980
+ _classCallCheck(this, le);
9981
+ 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();
9987
9982
  }
9988
- _createClass(ce, [{
9983
+ _createClass(le, [{
9989
9984
  key: "isOpen",
9990
9985
  value: function isOpen() {
9991
9986
  return this._isOpen;
@@ -10007,7 +10002,7 @@ var ps = /*#__PURE__*/function () {
10007
10002
  var _this47 = this;
10008
10003
  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 () {
10009
10004
  _this47._elementRef.style.display = "none", _this47._backgroundPanelRef.style.display = "none";
10010
- }, ce.MODAL_CLOSE_TIMEOUT_MS);
10005
+ }, le.MODAL_CLOSE_TIMEOUT_MS);
10011
10006
  }
10012
10007
  }, {
10013
10008
  key: "displayModalElements",
@@ -10023,7 +10018,7 @@ var ps = /*#__PURE__*/function () {
10023
10018
  key: "addCloseButton",
10024
10019
  value: function addCloseButton(e, t, i) {
10025
10020
  var _this48 = this;
10026
- var n = t ? ce.createSVGButton(e) : ce.createTextButton(e);
10021
+ var n = t ? le.createSVGButton(e) : le.createTextButton(e);
10027
10022
  return this.addButtons(n), n.onclick = function () {
10028
10023
  _this48.close(), setTimeout(function () {
10029
10024
  i == null || i();
@@ -10083,32 +10078,32 @@ var ps = /*#__PURE__*/function () {
10083
10078
  value: function createTextModalFunc(e, t, i) {
10084
10079
  var n;
10085
10080
  if (_typeof(t) == "object" && (n = t.files) != null && n.infoModal) {
10086
- var r = new ce(e, ["modal-content"], t.files.infoModal.containerStyle);
10081
+ var r = new le(e, ["modal-content"], t.files.infoModal.containerStyle);
10087
10082
  return r.addCloseButton("OK", !1, i), r.openTextModal.bind(r, t.infoModalTextMarkUp || "");
10088
10083
  }
10089
10084
  }
10090
10085
  }]);
10091
- return ce;
10086
+ return le;
10092
10087
  }();
10093
10088
  ps.MODAL_CLOSE_TIMEOUT_MS = 190;
10094
- var lt = ps;
10095
- var ht = /*#__PURE__*/function (_t5) {
10096
- _inherits(ht, _t5);
10097
- var _super39 = _createSuper(ht);
10089
+ var at = ps;
10090
+ var ut = /*#__PURE__*/function (_t5) {
10091
+ _inherits(ut, _t5);
10092
+ var _super39 = _createSuper(ut);
10098
10093
  // prettier-ignore
10099
- function ht(e, t, i, n, r, o) {
10094
+ function ut(e, t, i, n, r, o) {
10100
10095
  var _this50;
10101
- _classCallCheck(this, ht);
10096
+ _classCallCheck(this, ut);
10102
10097
  var l, c, d, u, h, p;
10103
- _this50 = _super39.call(this, ht.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o);
10098
+ _this50 = _super39.call(this, ut.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o);
10104
10099
  var a = _this50.createInnerElements(n, r, _this50._customStyles);
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;
10100
+ _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;
10106
10101
  return _this50;
10107
10102
  }
10108
- _createClass(ht, [{
10103
+ _createClass(ut, [{
10109
10104
  key: "createInnerElements",
10110
10105
  value: function createInnerElements(e, t, i) {
10111
- var n = ht.createSVGIconElement(e, t);
10106
+ var n = ut.createSVGIconElement(e, t);
10112
10107
  return {
10113
10108
  styles: this.createInnerElement(n, "styles", i)
10114
10109
  };
@@ -10132,7 +10127,7 @@ var ht = /*#__PURE__*/function (_t5) {
10132
10127
  key: "addClickEvent",
10133
10128
  value: function addClickEvent(e, t) {
10134
10129
  var i = this.triggerImportPrompt.bind(this, this._inputElement),
10135
- n = lt.createTextModalFunc(e, t, i);
10130
+ n = at.createTextModalFunc(e, t, i);
10136
10131
  this.elementRef.onclick = this.click.bind(this, n);
10137
10132
  }
10138
10133
  }, {
@@ -10159,17 +10154,17 @@ var ht = /*#__PURE__*/function (_t5) {
10159
10154
  return i.id = e, i;
10160
10155
  }
10161
10156
  }]);
10162
- return ht;
10157
+ return ut;
10163
10158
  }(_t);
10164
- var ue = /*#__PURE__*/function () {
10165
- function ue() {
10166
- _classCallCheck(this, ue);
10159
+ var de = /*#__PURE__*/function () {
10160
+ function de() {
10161
+ _classCallCheck(this, de);
10167
10162
  }
10168
- _createClass(ue, null, [{
10163
+ _createClass(de, null, [{
10169
10164
  key: "create",
10170
10165
  value: function create(e, t, i) {
10171
- var n = ue.createElement(i);
10172
- ue.addEvents(n, e, t), e.appendChild(n);
10166
+ var n = de.createElement(i);
10167
+ de.addEvents(n, e, t), e.appendChild(n);
10173
10168
  }
10174
10169
  }, {
10175
10170
  key: "createElement",
@@ -10181,13 +10176,13 @@ var ue = /*#__PURE__*/function () {
10181
10176
  key: "addEvents",
10182
10177
  value: function addEvents(e, t, i) {
10183
10178
  t.ondragenter = function (n) {
10184
- n.preventDefault(), ue.display(e);
10179
+ n.preventDefault(), de.display(e);
10185
10180
  }, e.ondragleave = function (n) {
10186
- n.preventDefault(), ue.hide(e);
10181
+ n.preventDefault(), de.hide(e);
10187
10182
  }, e.ondragover = function (n) {
10188
10183
  n.preventDefault();
10189
10184
  }, e.ondrop = function (n) {
10190
- n.preventDefault(), ue.uploadFile(i, n), ue.hide(e);
10185
+ n.preventDefault(), de.uploadFile(i, n), de.hide(e);
10191
10186
  };
10192
10187
  }
10193
10188
  }, {
@@ -10213,7 +10208,7 @@ var ue = /*#__PURE__*/function () {
10213
10208
  return t !== void 0 && t === !1 ? !1 : !!t || e.getNumberOfTypes() > 0;
10214
10209
  }
10215
10210
  }]);
10216
- return ue;
10211
+ return de;
10217
10212
  }();
10218
10213
  var Me = /*#__PURE__*/function () {
10219
10214
  function Me() {
@@ -10317,19 +10312,19 @@ var Me = /*#__PURE__*/function () {
10317
10312
  return Me;
10318
10313
  }();
10319
10314
  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";
10320
- var vt = /*#__PURE__*/function (_t6) {
10321
- _inherits(vt, _t6);
10322
- var _super40 = _createSuper(vt);
10323
- function vt(e) {
10315
+ var bt = /*#__PURE__*/function (_t6) {
10316
+ _inherits(bt, _t6);
10317
+ var _super40 = _createSuper(bt);
10318
+ function bt(e) {
10324
10319
  var _this51;
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();
10320
+ _classCallCheck(this, bt);
10321
+ (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();
10327
10322
  return _this51;
10328
10323
  }
10329
- _createClass(vt, [{
10324
+ _createClass(bt, [{
10330
10325
  key: "createInnerElements",
10331
10326
  value: function createInnerElements(e) {
10332
- var t = vt.createSVGIconElement();
10327
+ var t = bt.createSVGIconElement();
10333
10328
  return {
10334
10329
  "default": this.createInnerElement(t, "default", e),
10335
10330
  active: this.createInnerElement(t, "active", e),
@@ -10392,7 +10387,7 @@ var vt = /*#__PURE__*/function (_t6) {
10392
10387
  return e.id = "microphone-icon", e;
10393
10388
  }
10394
10389
  }]);
10395
- return vt;
10390
+ return bt;
10396
10391
  }(_t);
10397
10392
  var fs = {},
10398
10393
  oi = {},
@@ -10499,17 +10494,17 @@ var ia = /*#__PURE__*/function () {
10499
10494
  return ia;
10500
10495
  }();
10501
10496
  ai.WebSpeechTranscript = ia;
10502
- var it = {};
10503
- Object.defineProperty(it, "__esModule", {
10497
+ var tt = {};
10498
+ Object.defineProperty(tt, "__esModule", {
10504
10499
  value: !0
10505
10500
  });
10506
- it.Browser = void 0;
10507
- var ct = /*#__PURE__*/_createClass(function ct() {
10508
- _classCallCheck(this, ct);
10501
+ tt.Browser = void 0;
10502
+ var lt = /*#__PURE__*/_createClass(function lt() {
10503
+ _classCallCheck(this, lt);
10509
10504
  });
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;
10505
+ tt.Browser = lt;
10506
+ lt.IS_SAFARI = function () {
10507
+ return lt._IS_SAFARI === void 0 && (lt._IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), lt._IS_SAFARI;
10513
10508
  };
10514
10509
  var Tt = {},
10515
10510
  li = {};
@@ -10684,11 +10679,11 @@ Object.defineProperty(Be, "__esModule", {
10684
10679
  value: !0
10685
10680
  });
10686
10681
  Be.Cursor = void 0;
10687
- var pt = /*#__PURE__*/function () {
10688
- function pt() {
10689
- _classCallCheck(this, pt);
10682
+ var ht = /*#__PURE__*/function () {
10683
+ function ht() {
10684
+ _classCallCheck(this, ht);
10690
10685
  }
10691
- _createClass(pt, null, [{
10686
+ _createClass(ht, null, [{
10692
10687
  key: "setOffsetForGeneric",
10693
10688
  value: function setOffsetForGeneric(e, t) {
10694
10689
  var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
@@ -10696,7 +10691,7 @@ var pt = /*#__PURE__*/function () {
10696
10691
  for (var r = 0; r < e.childNodes.length; r += 1) {
10697
10692
  var o = e.childNodes[r];
10698
10693
  if (o.childNodes.length > 0) {
10699
- var a = pt.setOffsetForGeneric(o, t, i);
10694
+ var a = ht.setOffsetForGeneric(o, t, i);
10700
10695
  if (a === -1) return -1;
10701
10696
  i += a;
10702
10697
  } else if (o.textContent !== null) {
@@ -10724,8 +10719,8 @@ var pt = /*#__PURE__*/function () {
10724
10719
  value: function setOffsetForSafariGeneric(e, t) {
10725
10720
  var i = window.getSelection();
10726
10721
  if (i) {
10727
- var n = pt.getGenericElementCursorOffset(e, i, !0);
10728
- console.log(n), setTimeout(function () {}, 100), pt.setOffsetForGeneric(e, n + t);
10722
+ var n = ht.getGenericElementCursorOffset(e, i, !0);
10723
+ console.log(n), setTimeout(function () {}, 100), ht.setOffsetForGeneric(e, n + t);
10729
10724
  }
10730
10725
  }
10731
10726
  // set to automatically scroll to cursor (scroll does not work in Safari)
@@ -10763,16 +10758,16 @@ var pt = /*#__PURE__*/function () {
10763
10758
  return n;
10764
10759
  }
10765
10760
  }]);
10766
- return pt;
10761
+ return ht;
10767
10762
  }();
10768
- Be.Cursor = pt;
10763
+ Be.Cursor = ht;
10769
10764
  Object.defineProperty(Ct, "__esModule", {
10770
10765
  value: !0
10771
10766
  });
10772
10767
  Ct.CommandUtils = void 0;
10773
10768
  var _n = At,
10774
10769
  ra = je,
10775
- oa = it,
10770
+ oa = tt,
10776
10771
  wn = Be,
10777
10772
  Mn = De;
10778
10773
  var K = /*#__PURE__*/function () {
@@ -10877,7 +10872,7 @@ Object.defineProperty(di, "__esModule", {
10877
10872
  });
10878
10873
  di.Highlight = void 0;
10879
10874
  var aa = je,
10880
- nt = Be;
10875
+ it = Be;
10881
10876
  var Wt = /*#__PURE__*/function () {
10882
10877
  function Wt() {
10883
10878
  _classCallCheck(this, Wt);
@@ -10893,8 +10888,8 @@ var Wt = /*#__PURE__*/function () {
10893
10888
  value: function setStateForGeneric(e, t) {
10894
10889
  var i = window.getSelection();
10895
10890
  if (i != null && i.focusNode) {
10896
- var n = nt.Cursor.getGenericElementCursorOffset(t, i, !0),
10897
- r = nt.Cursor.getGenericElementCursorOffset(t, i, !1);
10891
+ var n = it.Cursor.getGenericElementCursorOffset(t, i, !0),
10892
+ r = it.Cursor.getGenericElementCursorOffset(t, i, !1);
10898
10893
  e.isHighlighted = n !== r;
10899
10894
  }
10900
10895
  }
@@ -10908,8 +10903,8 @@ var Wt = /*#__PURE__*/function () {
10908
10903
  value: function removeForGeneric(e, t) {
10909
10904
  var i = window.getSelection();
10910
10905
  if (i) {
10911
- var n = nt.Cursor.getGenericElementCursorOffset(t, i, !0);
10912
- i.deleteFromDocument(), nt.Cursor.setOffsetForGeneric(t, n), e.isHighlighted = !1;
10906
+ var n = it.Cursor.getGenericElementCursorOffset(t, i, !0);
10907
+ i.deleteFromDocument(), it.Cursor.setOffsetForGeneric(t, n), e.isHighlighted = !1;
10913
10908
  }
10914
10909
  }
10915
10910
  }, {
@@ -10920,7 +10915,7 @@ var Wt = /*#__PURE__*/function () {
10920
10915
  r = t.value;
10921
10916
  if (i && n) {
10922
10917
  var o = r.substring(0, i) + r.substring(n);
10923
- t.value = o, nt.Cursor.setOffsetForPrimitive(t, i, e.autoScroll);
10918
+ t.value = o, it.Cursor.setOffsetForPrimitive(t, i, e.autoScroll);
10924
10919
  }
10925
10920
  e.isHighlighted = !1;
10926
10921
  }
@@ -11006,7 +11001,7 @@ var Cn = li,
11006
11001
  Ti = di,
11007
11002
  ie = je,
11008
11003
  Ci = ui,
11009
- kn = it,
11004
+ kn = tt,
11010
11005
  In = Be,
11011
11006
  Ai = De;
11012
11007
  var da = /*#__PURE__*/function () {
@@ -11124,7 +11119,7 @@ Object.defineProperty(oi, "__esModule", {
11124
11119
  });
11125
11120
  oi.WebSpeech = void 0;
11126
11121
  var Ln = ai,
11127
- Rn = it,
11122
+ Rn = tt,
11128
11123
  ua = Tt;
11129
11124
  var Jt = /*#__PURE__*/function (_ua$Speech) {
11130
11125
  _inherits(Jt, _ua$Speech);
@@ -11326,11 +11321,11 @@ Object.defineProperty(bi, "__esModule", {
11326
11321
  value: !0
11327
11322
  });
11328
11323
  bi.StopTimeout = void 0;
11329
- var yt = /*#__PURE__*/function () {
11330
- function yt() {
11331
- _classCallCheck(this, yt);
11324
+ var vt = /*#__PURE__*/function () {
11325
+ function vt() {
11326
+ _classCallCheck(this, vt);
11332
11327
  }
11333
- _createClass(yt, null, [{
11328
+ _createClass(vt, null, [{
11334
11329
  key: "set",
11335
11330
  value: function set(e) {
11336
11331
  e.stopTimeout = setTimeout(function () {
@@ -11340,13 +11335,13 @@ var yt = /*#__PURE__*/function () {
11340
11335
  }, {
11341
11336
  key: "reset",
11342
11337
  value: function reset(e, t) {
11343
- e.stopTimeoutMS = t || yt.DEFAULT_MS, e.stopTimeout && clearTimeout(e.stopTimeout), yt.set(e);
11338
+ e.stopTimeoutMS = t || vt.DEFAULT_MS, e.stopTimeout && clearTimeout(e.stopTimeout), vt.set(e);
11344
11339
  }
11345
11340
  }]);
11346
- return yt;
11341
+ return vt;
11347
11342
  }();
11348
- bi.StopTimeout = yt;
11349
- yt.DEFAULT_MS = 2e4;
11343
+ bi.StopTimeout = vt;
11344
+ vt.DEFAULT_MS = 2e4;
11350
11345
  var vi = {};
11351
11346
  Object.defineProperty(vi, "__esModule", {
11352
11347
  value: !0
@@ -11603,8 +11598,8 @@ var We = /*#__PURE__*/function () {
11603
11598
  return We;
11604
11599
  }();
11605
11600
  var Li = fs["default"] = We;
11606
- var Zt = /*#__PURE__*/function (_vt) {
11607
- _inherits(Zt, _vt);
11601
+ var Zt = /*#__PURE__*/function (_bt) {
11602
+ _inherits(Zt, _bt);
11608
11603
  var _super43 = _createSuper(Zt);
11609
11604
  function Zt(e, t, i) {
11610
11605
  var _this56;
@@ -11678,7 +11673,7 @@ var Zt = /*#__PURE__*/function (_vt) {
11678
11673
  }
11679
11674
  }]);
11680
11675
  return Zt;
11681
- }(vt);
11676
+ }(bt);
11682
11677
  var ms = /*#__PURE__*/function () {
11683
11678
  function ms() {
11684
11679
  _classCallCheck(this, ms);
@@ -11695,8 +11690,8 @@ var ms = /*#__PURE__*/function () {
11695
11690
  }]);
11696
11691
  return ms;
11697
11692
  }();
11698
- var va = /*#__PURE__*/function (_vt2) {
11699
- _inherits(va, _vt2);
11693
+ var va = /*#__PURE__*/function (_bt2) {
11694
+ _inherits(va, _bt2);
11700
11695
  var _super44 = _createSuper(va);
11701
11696
  function va(e, t) {
11702
11697
  var _this57;
@@ -11757,7 +11752,7 @@ var va = /*#__PURE__*/function (_vt2) {
11757
11752
  }
11758
11753
  }]);
11759
11754
  return va;
11760
- }(vt);
11755
+ }(bt);
11761
11756
  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";
11762
11757
  var F = /*#__PURE__*/function () {
11763
11758
  function F() {
@@ -11945,7 +11940,7 @@ var yi = /*#__PURE__*/function (_t7) {
11945
11940
  e.files && (t.files = Array.from(e.files).map(function (i) {
11946
11941
  return {
11947
11942
  file: i,
11948
- type: he.getTypeFromBlob(i)
11943
+ type: ue.getTypeFromBlob(i)
11949
11944
  };
11950
11945
  })), setTimeout(function () {
11951
11946
  return _this62.attemptSubmit(t, !0);
@@ -12121,8 +12116,8 @@ var Ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
12121
12116
  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",
12122
12117
  _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>",
12123
12118
  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>";
12124
- var tn = /*#__PURE__*/function (_lt) {
12125
- _inherits(tn, _lt);
12119
+ var tn = /*#__PURE__*/function (_at) {
12120
+ _inherits(tn, _at);
12126
12121
  var _super46 = _createSuper(tn);
12127
12122
  // prettier-ignore
12128
12123
  function tn(e, t, i, n) {
@@ -12138,11 +12133,11 @@ var tn = /*#__PURE__*/function (_lt) {
12138
12133
  _createClass(tn, [{
12139
12134
  key: "addButtonsAndTheirEvents",
12140
12135
  value: function addButtonsAndTheirEvents(e) {
12141
- var t = lt.createSVGButton(Sa);
12136
+ var t = at.createSVGButton(Sa);
12142
12137
  t.classList.add("modal-svg-camera-button"), t.children[0].classList.add("modal-svg-camera-icon");
12143
12138
  var i = this.addCloseButton(_a, !0);
12144
12139
  i.classList.add("modal-svg-close-button"), i.children[0].classList.add("modal-svg-close-icon");
12145
- var n = lt.createSVGButton(wa);
12140
+ var n = at.createSVGButton(wa);
12146
12141
  return n.classList.add("modal-svg-submit-button"), this.addButtons(t, n), this.addButtonEvents(t, i, n, e), {
12147
12142
  captureButton: t,
12148
12143
  submitButton: n
@@ -12170,7 +12165,7 @@ var tn = /*#__PURE__*/function (_lt) {
12170
12165
  _this65._captureButton.replaceChildren(_this65._captureIcon), _this65._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
12171
12166
  var e = _this65._canvas.getContext("2d");
12172
12167
  e == null || e.clearRect(0, 0, _this65._canvas.width, _this65._canvas.height);
12173
- }, lt.MODAL_CLOSE_TIMEOUT_MS);
12168
+ }, at.MODAL_CLOSE_TIMEOUT_MS);
12174
12169
  }
12175
12170
  }, {
12176
12171
  key: "start",
@@ -12235,7 +12230,7 @@ var tn = /*#__PURE__*/function (_lt) {
12235
12230
  }
12236
12231
  }]);
12237
12232
  return tn;
12238
- }(lt);
12233
+ }(at);
12239
12234
  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>";
12240
12235
  var Xt = /*#__PURE__*/function (_t8) {
12241
12236
  _inherits(Xt, _t8);
@@ -12284,11 +12279,11 @@ var Xt = /*#__PURE__*/function (_t8) {
12284
12279
  }]);
12285
12280
  return Xt;
12286
12281
  }(_t);
12287
- var ft = /*#__PURE__*/function () {
12282
+ var pt = /*#__PURE__*/function () {
12288
12283
  // prettier-ignore
12289
- function ft(e, t, i, n) {
12290
- _classCallCheck(this, ft);
12291
- this.elementRef = ft.createPanelElement(e.inputAreaStyle);
12284
+ function pt(e, t, i, n) {
12285
+ _classCallCheck(this, pt);
12286
+ this.elementRef = pt.createPanelElement(e.inputAreaStyle);
12292
12287
  var r = new qi(e, i),
12293
12288
  o = {},
12294
12289
  a = this.createFileUploadComponents(e, i, n, o);
@@ -12298,16 +12293,16 @@ var ft = /*#__PURE__*/function () {
12298
12293
  var l = new xa(e, r.inputElementRef, t, i, a);
12299
12294
  r.submit = l.submitFromInput.bind(l), Me.attach(e, i, r, a, l), e.submitUserMessage = l.programmaticSubmit.bind(l), o.submit = {
12300
12295
  button: l
12301
- }, ft.addElements(this.elementRef, r, o, n, a, e.dropupStyles);
12296
+ }, pt.addElements(this.elementRef, r, o, n, a, e.dropupStyles);
12302
12297
  }
12303
- _createClass(ft, [{
12298
+ _createClass(pt, [{
12304
12299
  key: "createFileUploadComponents",
12305
12300
  value:
12306
12301
  // prettier-ignore
12307
12302
  function createFileUploadComponents(e, t, i, n) {
12308
12303
  var o, a, l, c;
12309
12304
  var r = new wt(this.elementRef, e.attachmentContainerStyle, t.demo);
12310
- if (ft.createUploadButtons(e, t.fileTypes || {}, r, i, n), (o = t.camera) != null && o.files) {
12305
+ if (pt.createUploadButtons(e, t.fileTypes || {}, r, i, n), (o = t.camera) != null && o.files) {
12311
12306
  var d = ((a = n.images) == null ? void 0 : a.fileType) || r.addType(e, t.camera.files, "images");
12312
12307
  n.camera = {
12313
12308
  button: new Xt(i, d, t.camera)
@@ -12319,7 +12314,7 @@ var ft = /*#__PURE__*/function () {
12319
12314
  button: new va(_d, t.recordAudio)
12320
12315
  };
12321
12316
  }
12322
- return ue.isEnabled(r, e.dragAndDrop) && ue.create(i, r, e.dragAndDrop), r;
12317
+ return de.isEnabled(r, e.dragAndDrop) && de.create(i, r, e.dragAndDrop), r;
12323
12318
  }
12324
12319
  // prettier-ignore
12325
12320
  }], [{
@@ -12340,7 +12335,7 @@ var ft = /*#__PURE__*/function () {
12340
12335
  d = _Yo$a.id,
12341
12336
  u = _Yo$a.svgString,
12342
12337
  h = _Yo$a.dropupText,
12343
- p = new ht(n, c, l, d, u, h);
12338
+ p = new ut(n, c, l, d, u, h);
12344
12339
  r[a] = {
12345
12340
  button: p,
12346
12341
  fileType: c
@@ -12358,7 +12353,7 @@ var ft = /*#__PURE__*/function () {
12358
12353
  Vo.set(t.inputElementRef, a, r.elementRef, l), Qe.add(e, a);
12359
12354
  }
12360
12355
  }]);
12361
- return ft;
12356
+ return pt;
12362
12357
  }();
12363
12358
  var nn = /*#__PURE__*/function () {
12364
12359
  function nn() {
@@ -12371,7 +12366,7 @@ var nn = /*#__PURE__*/function () {
12371
12366
  n.id = "chat-view";
12372
12367
  var r = new me(e, t, i);
12373
12368
  t.websocket && $.createConnection(t, r);
12374
- var o = new ft(e, r, t, n);
12369
+ var o = new pt(e, r, t, n);
12375
12370
  return Y.addElements(n, r.elementRef, o.elementRef), n;
12376
12371
  }
12377
12372
  }, {