@ibiz-template-plugin/ai-chat 0.0.47 → 0.0.48

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/index.es.js CHANGED
@@ -2,10 +2,10 @@ import './style.css';
2
2
  var Gc = Object.defineProperty;
3
3
  var Zc = (n, e, t) => e in n ? Gc(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
4
4
  var A = (n, e, t) => (Zc(n, typeof e != "symbol" ? e + "" : e, t), t);
5
- import Oi from "interactjs";
5
+ import Di from "interactjs";
6
6
  import dl from "cherry-markdown";
7
7
  import { QXEvent as Qc } from "qx-util";
8
- var hi, D, ul, hl, pt, ys, fl, pl, ml, zr, lr, ar, gl, mn = {}, yl = [], ed = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, _n = Array.isArray;
8
+ var fi, D, ul, hl, pt, ys, fl, pl, ml, zr, ar, cr, gl, mn = {}, yl = [], ed = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, _n = Array.isArray;
9
9
  function qe(n, e) {
10
10
  for (var t in e)
11
11
  n[t] = e[t];
@@ -18,7 +18,7 @@ function ze(n, e, t) {
18
18
  var i, r, s, o = {};
19
19
  for (s in e)
20
20
  s == "key" ? i = e[s] : s == "ref" ? r = e[s] : o[s] = e[s];
21
- if (arguments.length > 2 && (o.children = arguments.length > 3 ? hi.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null)
21
+ if (arguments.length > 2 && (o.children = arguments.length > 3 ? fi.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null)
22
22
  for (s in n.defaultProps)
23
23
  o[s] === void 0 && (o[s] = n.defaultProps[s]);
24
24
  return Hn(n, o, i, r, null);
@@ -55,13 +55,13 @@ function vl(n) {
55
55
  return vl(n);
56
56
  }
57
57
  }
58
- function cr(n) {
59
- (!n.__d && (n.__d = !0) && pt.push(n) && !Kn.__r++ || ys != D.debounceRendering) && ((ys = D.debounceRendering) || fl)(Kn);
58
+ function dr(n) {
59
+ (!n.__d && (n.__d = !0) && pt.push(n) && !Yn.__r++ || ys != D.debounceRendering) && ((ys = D.debounceRendering) || fl)(Yn);
60
60
  }
61
- function Kn() {
61
+ function Yn() {
62
62
  for (var n, e, t, i, r, s, o, l = 1; pt.length; )
63
63
  pt.length > l && pt.sort(pl), n = pt.shift(), l = pt.length, n.__d && (t = void 0, i = void 0, r = (i = (e = n).__v).__e, s = [], o = [], e.__P && ((t = qe({}, i)).__v = i.__v + 1, D.vnode && D.vnode(t), Lr(e.__P, t, i, e.__n, e.__P.namespaceURI, 32 & i.__u ? [r] : null, s, r == null ? Jt(i) : r, !!(32 & i.__u), o), t.__v = i.__v, t.__.__k[t.__i] = t, Cl(s, t, o), i.__e = i.__ = null, t.__e != r && vl(t)));
64
- Kn.__r = 0;
64
+ Yn.__r = 0;
65
65
  }
66
66
  function bl(n, e, t, i, r, s, o, l, a, c, d) {
67
67
  var u, h, f, p, y, g, v, b = i && i.__k || yl, C = e.length;
@@ -91,9 +91,9 @@ function wl(n, e, t, i) {
91
91
  while (e != null && e.nodeType == 8);
92
92
  return e;
93
93
  }
94
- function Yn(n, e) {
94
+ function Xn(n, e) {
95
95
  return e = e || [], n == null || typeof n == "boolean" || (_n(n) ? n.some(function(t) {
96
- Yn(t, e);
96
+ Xn(t, e);
97
97
  }) : e.push(n)), e;
98
98
  }
99
99
  function nd(n, e, t, i) {
@@ -125,7 +125,7 @@ function An(n, e, t, i, r) {
125
125
  i && t[e] == i[e] || bs(n.style, e, t[e]);
126
126
  }
127
127
  else if (e[0] == "o" && e[1] == "n")
128
- s = e != (e = e.replace(ml, "$1")), o = e.toLowerCase(), e = o in n || e == "onFocusOut" || e == "onFocusIn" ? o.slice(2) : e.slice(2), n.l || (n.l = {}), n.l[e + s] = t, t ? i ? t.u = i.u : (t.u = zr, n.addEventListener(e, s ? ar : lr, s)) : n.removeEventListener(e, s ? ar : lr, s);
128
+ s = e != (e = e.replace(ml, "$1")), o = e.toLowerCase(), e = o in n || e == "onFocusOut" || e == "onFocusIn" ? o.slice(2) : e.slice(2), n.l || (n.l = {}), n.l[e + s] = t, t ? i ? t.u = i.u : (t.u = zr, n.addEventListener(e, s ? cr : ar, s)) : n.removeEventListener(e, s ? cr : ar, s);
129
129
  else {
130
130
  if (r == "http://www.w3.org/2000/svg")
131
131
  e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
@@ -191,18 +191,18 @@ function Lr(n, e, t, i, r, s, o, l, a, c) {
191
191
  } else {
192
192
  for (ue = s.length; ue--; )
193
193
  $r(s[ue]);
194
- dr(e);
194
+ ur(e);
195
195
  }
196
196
  else
197
- e.__e = t.__e, e.__k = t.__k, Ae.then || dr(e);
197
+ e.__e = t.__e, e.__k = t.__k, Ae.then || ur(e);
198
198
  D.__e(Ae, e, t);
199
199
  }
200
200
  else
201
201
  s == null && e.__v == t.__v ? (e.__k = t.__k, e.__e = t.__e) : l = e.__e = id(t.__e, e, t, i, r, s, o, a, c);
202
202
  return (d = D.diffed) && d(e), 128 & e.__u ? void 0 : l;
203
203
  }
204
- function dr(n) {
205
- n && n.__c && (n.__c.__e = !0), n && n.__k && n.__k.forEach(dr);
204
+ function ur(n) {
205
+ n && n.__c && (n.__c.__e = !0), n && n.__k && n.__k.forEach(ur);
206
206
  }
207
207
  function Cl(n, e, t) {
208
208
  for (var i = 0; i < t.length; i++)
@@ -237,7 +237,7 @@ function id(n, e, t, i, r, s, o, l, a) {
237
237
  if (b == null)
238
238
  g === v || l && n.data == v || (n.data = v);
239
239
  else {
240
- if (s = s && hi.call(n.childNodes), g = t.props || mn, !l && s != null)
240
+ if (s = s && fi.call(n.childNodes), g = t.props || mn, !l && s != null)
241
241
  for (g = {}, c = 0; c < n.attributes.length; c++)
242
242
  g[(f = n.attributes[c]).name] = f.value;
243
243
  for (c in g)
@@ -293,7 +293,7 @@ function rd(n, e, t) {
293
293
  }
294
294
  function mt(n, e, t) {
295
295
  var i, r, s, o;
296
- e == document && (e = document.documentElement), D.__ && D.__(n, e), r = (i = typeof t == "function") ? null : t && t.__k || e.__k, s = [], o = [], Lr(e, n = (!i && t || e).__k = ze($e, null, [n]), r || mn, mn, e.namespaceURI, !i && t ? [t] : r ? null : e.firstChild ? hi.call(e.childNodes) : null, s, !i && t ? t : r ? r.__e : e.firstChild, i, o), Cl(s, n, o);
296
+ e == document && (e = document.documentElement), D.__ && D.__(n, e), r = (i = typeof t == "function") ? null : t && t.__k || e.__k, s = [], o = [], Lr(e, n = (!i && t || e).__k = ze($e, null, [n]), r || mn, mn, e.namespaceURI, !i && t ? [t] : r ? null : e.firstChild ? fi.call(e.childNodes) : null, s, !i && t ? t : r ? r.__e : e.firstChild, i, o), Cl(s, n, o);
297
297
  }
298
298
  function sd(n) {
299
299
  function e(t) {
@@ -304,7 +304,7 @@ function sd(n) {
304
304
  i = null;
305
305
  }, this.shouldComponentUpdate = function(s) {
306
306
  this.props.value != s.value && i.forEach(function(o) {
307
- o.__e = !0, cr(o);
307
+ o.__e = !0, dr(o);
308
308
  });
309
309
  }, this.sub = function(s) {
310
310
  i.add(s);
@@ -318,7 +318,7 @@ function sd(n) {
318
318
  return t.children(i);
319
319
  }).contextType = e, e;
320
320
  }
321
- hi = yl.slice, D = { __e: function(n, e, t, i) {
321
+ fi = yl.slice, D = { __e: function(n, e, t, i) {
322
322
  for (var r, s, o; e = e.__; )
323
323
  if ((r = e.__c) && !r.__)
324
324
  try {
@@ -332,12 +332,12 @@ hi = yl.slice, D = { __e: function(n, e, t, i) {
332
332
  return n != null && n.constructor == null;
333
333
  }, Ie.prototype.setState = function(n, e) {
334
334
  var t;
335
- t = this.__s != null && this.__s != this.state ? this.__s : this.__s = qe({}, this.state), typeof n == "function" && (n = n(qe({}, t), this.props)), n && qe(t, n), n != null && this.__v && (e && this._sb.push(e), cr(this));
335
+ t = this.__s != null && this.__s != this.state ? this.__s : this.__s = qe({}, this.state), typeof n == "function" && (n = n(qe({}, t), this.props)), n && qe(t, n), n != null && this.__v && (e && this._sb.push(e), dr(this));
336
336
  }, Ie.prototype.forceUpdate = function(n) {
337
- this.__v && (this.__e = !0, n && this.__h.push(n), cr(this));
337
+ this.__v && (this.__e = !0, n && this.__h.push(n), dr(this));
338
338
  }, Ie.prototype.render = $e, pt = [], fl = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, pl = function(n, e) {
339
339
  return n.__v.__b - e.__v.__b;
340
- }, Kn.__r = 0, ml = /(PointerCapture)$|Capture$/i, zr = 0, lr = ws(!1), ar = ws(!0), gl = 0;
340
+ }, Yn.__r = 0, ml = /(PointerCapture)$|Capture$/i, zr = 0, ar = ws(!1), cr = ws(!0), gl = 0;
341
341
  var od = 0;
342
342
  function m(n, e, t, i, r, s) {
343
343
  e || (e = {});
@@ -729,7 +729,7 @@ function Sl(n) {
729
729
  return e === -1 ? n : n.substring(0, e);
730
730
  }
731
731
  const dd = /<svg\b[^>]*>[\s\S]*?<\/svg>/;
732
- function fi(n) {
732
+ function pi(n) {
733
733
  return dd.test(n);
734
734
  }
735
735
  const ud = "topic", hd = "inline", fd = "temp", pd = "unknow";
@@ -1104,7 +1104,7 @@ class gd {
1104
1104
  return "".concat((e / 1024 ** i).toFixed(2), " ").concat(t[i]);
1105
1105
  }
1106
1106
  }
1107
- class ur {
1107
+ class Wn {
1108
1108
  /**
1109
1109
  * 从XML元素中提取CDATA内容
1110
1110
  *
@@ -1360,8 +1360,8 @@ class vd {
1360
1360
  return r;
1361
1361
  }
1362
1362
  }
1363
- var Kt, V, Di, ks, gn = 0, Tl = [], q = D, xs = q.__b, Ss = q.__r, Ms = q.diffed, _s = q.__c, Ts = q.unmount, Ns = q.__;
1364
- function pi(n, e) {
1363
+ var Kt, V, Ii, ks, gn = 0, Tl = [], q = D, xs = q.__b, Ss = q.__r, Ms = q.diffed, _s = q.__c, Ts = q.unmount, Ns = q.__;
1364
+ function mi(n, e) {
1365
1365
  q.__h && q.__h(V, n, gn || e), gn = 0;
1366
1366
  var t = V.__H || (V.__H = { __: [], __h: [] });
1367
1367
  return n >= t.__.length && t.__.push({}), t.__[n];
@@ -1370,7 +1370,7 @@ function Me(n) {
1370
1370
  return gn = 1, bd(El, n);
1371
1371
  }
1372
1372
  function bd(n, e, t) {
1373
- var i = pi(Kt++, 2);
1373
+ var i = mi(Kt++, 2);
1374
1374
  if (i.t = n, !i.__c && (i.__ = [t ? t(e) : El(void 0, e), function(l) {
1375
1375
  var a = i.__N ? i.__N[0] : i.__[0], c = i.t(a, l);
1376
1376
  a !== c && (i.__N = [c, i.__[1]], i.__c.setState({}));
@@ -1406,7 +1406,7 @@ function bd(n, e, t) {
1406
1406
  return i.__N || i.__;
1407
1407
  }
1408
1408
  function K(n, e) {
1409
- var t = pi(Kt++, 3);
1409
+ var t = mi(Kt++, 3);
1410
1410
  !q.__s && Nl(t.__H, e) && (t.__ = n, t.u = e, V.__H.__h.push(t));
1411
1411
  }
1412
1412
  function Q(n) {
@@ -1415,7 +1415,7 @@ function Q(n) {
1415
1415
  }, []);
1416
1416
  }
1417
1417
  function Ee(n, e) {
1418
- var t = pi(Kt++, 7);
1418
+ var t = mi(Kt++, 7);
1419
1419
  return Nl(t.__H, e) && (t.__ = n(), t.__H = e, t.__h = n), t.__;
1420
1420
  }
1421
1421
  function Es(n, e) {
@@ -1424,14 +1424,14 @@ function Es(n, e) {
1424
1424
  }, e);
1425
1425
  }
1426
1426
  function Fr(n) {
1427
- var e = V.context[n.__c], t = pi(Kt++, 9);
1427
+ var e = V.context[n.__c], t = mi(Kt++, 9);
1428
1428
  return t.c = n, e ? (t.__ == null && (t.__ = !0, e.sub(V)), e.props.value) : n.__;
1429
1429
  }
1430
1430
  function wd() {
1431
1431
  for (var n; n = Tl.shift(); )
1432
1432
  if (n.__P && n.__H)
1433
1433
  try {
1434
- n.__H.__h.forEach(Wn), n.__H.__h.forEach(fr), n.__H.__h = [];
1434
+ n.__H.__h.forEach(jn), n.__H.__h.forEach(fr), n.__H.__h = [];
1435
1435
  } catch (e) {
1436
1436
  n.__H.__h = [], q.__e(e, n.__v);
1437
1437
  }
@@ -1443,19 +1443,19 @@ q.__b = function(n) {
1443
1443
  }, q.__r = function(n) {
1444
1444
  Ss && Ss(n), Kt = 0;
1445
1445
  var e = (V = n.__c).__H;
1446
- e && (Di === V ? (e.__h = [], V.__h = [], e.__.forEach(function(t) {
1446
+ e && (Ii === V ? (e.__h = [], V.__h = [], e.__.forEach(function(t) {
1447
1447
  t.__N && (t.__ = t.__N), t.u = t.__N = void 0;
1448
- })) : (e.__h.forEach(Wn), e.__h.forEach(fr), e.__h = [], Kt = 0)), Di = V;
1448
+ })) : (e.__h.forEach(jn), e.__h.forEach(fr), e.__h = [], Kt = 0)), Ii = V;
1449
1449
  }, q.diffed = function(n) {
1450
1450
  Ms && Ms(n);
1451
1451
  var e = n.__c;
1452
1452
  e && e.__H && (e.__H.__h.length && (Tl.push(e) !== 1 && ks === q.requestAnimationFrame || ((ks = q.requestAnimationFrame) || Cd)(wd)), e.__H.__.forEach(function(t) {
1453
1453
  t.u && (t.__H = t.u), t.u = void 0;
1454
- })), Di = V = null;
1454
+ })), Ii = V = null;
1455
1455
  }, q.__c = function(n, e) {
1456
1456
  e.some(function(t) {
1457
1457
  try {
1458
- t.__h.forEach(Wn), t.__h = t.__h.filter(function(i) {
1458
+ t.__h.forEach(jn), t.__h = t.__h.filter(function(i) {
1459
1459
  return !i.__ || fr(i);
1460
1460
  });
1461
1461
  } catch (i) {
@@ -1469,7 +1469,7 @@ q.__b = function(n) {
1469
1469
  var e, t = n.__c;
1470
1470
  t && t.__H && (t.__H.__.forEach(function(i) {
1471
1471
  try {
1472
- Wn(i);
1472
+ jn(i);
1473
1473
  } catch (r) {
1474
1474
  e = r;
1475
1475
  }
@@ -1482,7 +1482,7 @@ function Cd(n) {
1482
1482
  }, i = setTimeout(t, 35);
1483
1483
  As && (e = requestAnimationFrame(t));
1484
1484
  }
1485
- function Wn(n) {
1485
+ function jn(n) {
1486
1486
  var e = V, t = n.__c;
1487
1487
  typeof t == "function" && (n.__c = void 0, t()), V = e;
1488
1488
  }
@@ -1530,7 +1530,7 @@ function Al(n) {
1530
1530
  z = e;
1531
1531
  }
1532
1532
  }
1533
- var cn = void 0, Wt = 0, pr = 0, Xn = 0;
1533
+ var cn = void 0, Wt = 0, pr = 0, Gn = 0;
1534
1534
  function Ol(n) {
1535
1535
  if (z !== void 0) {
1536
1536
  var e = n.n;
@@ -1601,7 +1601,7 @@ Object.defineProperty(oe.prototype, "value", { get: function() {
1601
1601
  if (n !== this.v) {
1602
1602
  if (pr > 100)
1603
1603
  throw new Error("Cycle detected");
1604
- this.v = n, this.i++, Xn++, Wt++;
1604
+ this.v = n, this.i++, Gn++, Wt++;
1605
1605
  try {
1606
1606
  for (var e = this.t; e !== void 0; e = e.x)
1607
1607
  e.t.N();
@@ -1636,15 +1636,15 @@ function Rl(n) {
1636
1636
  n.s = t;
1637
1637
  }
1638
1638
  function Et(n, e) {
1639
- oe.call(this, void 0), this.x = n, this.s = void 0, this.g = Xn - 1, this.f = 4, this.W = e == null ? void 0 : e.watched, this.Z = e == null ? void 0 : e.unwatched, this.name = e == null ? void 0 : e.name;
1639
+ oe.call(this, void 0), this.x = n, this.s = void 0, this.g = Gn - 1, this.f = 4, this.W = e == null ? void 0 : e.watched, this.Z = e == null ? void 0 : e.unwatched, this.name = e == null ? void 0 : e.name;
1640
1640
  }
1641
1641
  Et.prototype = new oe();
1642
1642
  Et.prototype.h = function() {
1643
1643
  if (this.f &= -3, 1 & this.f)
1644
1644
  return !1;
1645
- if ((36 & this.f) == 32 || (this.f &= -5, this.g === Xn))
1645
+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === Gn))
1646
1646
  return !0;
1647
- if (this.g = Xn, this.f |= 1, this.i > 0 && !Dl(this))
1647
+ if (this.g = Gn, this.f |= 1, this.i > 0 && !Dl(this))
1648
1648
  return this.f &= -2, !0;
1649
1649
  var n = z;
1650
1650
  try {
@@ -1754,13 +1754,13 @@ function Wr(n, e) {
1754
1754
  var i = t.d.bind(t);
1755
1755
  return i[Symbol.dispose] = i, i;
1756
1756
  }
1757
- var mi, Ii;
1757
+ var gi, Ri;
1758
1758
  function tn(n, e) {
1759
1759
  D[n] = e.bind(null, D[n] || function() {
1760
1760
  });
1761
1761
  }
1762
- function Gn(n) {
1763
- Ii && Ii(), Ii = n && n.S();
1762
+ function Zn(n) {
1763
+ Ri && Ri(), Ri = n && n.S();
1764
1764
  }
1765
1765
  function $l(n) {
1766
1766
  var e = this, t = n.data, i = F(t);
@@ -1797,7 +1797,7 @@ tn("__b", function(n, e) {
1797
1797
  n(e);
1798
1798
  });
1799
1799
  tn("__r", function(n, e) {
1800
- Gn();
1800
+ Zn();
1801
1801
  var t, i = e.__c;
1802
1802
  i && (i.__$f &= -2, (t = i.__$u) === void 0 && (i.__$u = t = function(r) {
1803
1803
  var s;
@@ -1806,13 +1806,13 @@ tn("__r", function(n, e) {
1806
1806
  }), s.c = function() {
1807
1807
  i.__$f |= 1, i.setState({});
1808
1808
  }, s;
1809
- }())), mi = i, Gn(t), n(e);
1809
+ }())), gi = i, Zn(t), n(e);
1810
1810
  });
1811
1811
  tn("__e", function(n, e, t, i) {
1812
- Gn(), mi = void 0, n(e, t, i);
1812
+ Zn(), gi = void 0, n(e, t, i);
1813
1813
  });
1814
1814
  tn("diffed", function(n, e) {
1815
- Gn(), mi = void 0;
1815
+ Zn(), gi = void 0;
1816
1816
  var t;
1817
1817
  if (typeof e.type == "string" && (t = e.__e)) {
1818
1818
  var i = e.__np, r = e.props;
@@ -1891,7 +1891,7 @@ function F(n) {
1891
1891
  }
1892
1892
  function he(n) {
1893
1893
  var e = Q(n);
1894
- return e.current = n, mi.__$f |= 4, Ee(function() {
1894
+ return e.current = n, gi.__$f |= 4, Ee(function() {
1895
1895
  return Pl(function() {
1896
1896
  return e.current();
1897
1897
  });
@@ -2050,7 +2050,7 @@ const Md = () => /* @__PURE__ */ m("svg", { viewBox: "0 0 1024 1024", version: "
2050
2050
  }
2051
2051
  )
2052
2052
  }
2053
- ), Ri = (n) => /* @__PURE__ */ m(
2053
+ ), Pi = (n) => /* @__PURE__ */ m(
2054
2054
  "svg",
2055
2055
  {
2056
2056
  xmlns: "http://www.w3.org/2000/svg",
@@ -2058,7 +2058,7 @@ const Md = () => /* @__PURE__ */ m("svg", { viewBox: "0 0 1024 1024", version: "
2058
2058
  viewBox: "0 0 512 512",
2059
2059
  children: /* @__PURE__ */ m("path", { d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z" })
2060
2060
  }
2061
- ), Pi = (n) => /* @__PURE__ */ m(
2061
+ ), zi = (n) => /* @__PURE__ */ m(
2062
2062
  "svg",
2063
2063
  {
2064
2064
  className: n.className,
@@ -2628,7 +2628,7 @@ const be = new L("chat-select"), ou = (n) => {
2628
2628
  }
2629
2629
  );
2630
2630
  };
2631
- const zi = new L("messsage-toolbar"), lu = (n) => {
2631
+ const $i = new L("messsage-toolbar"), lu = (n) => {
2632
2632
  const { controller: e, message: t } = n, i = [
2633
2633
  {
2634
2634
  id: "islike",
@@ -2658,7 +2658,7 @@ const zi = new L("messsage-toolbar"), lu = (n) => {
2658
2658
  if ((a = l.icon) != null && a.showIcon && ((c = l.icon) != null && c.cssClass))
2659
2659
  return /* @__PURE__ */ m("i", { className: l.icon.cssClass });
2660
2660
  if ((d = l.icon) != null && d.showIcon && ((u = l.icon) != null && u.imagePath))
2661
- return fi(l.icon.imagePath) ? /* @__PURE__ */ m(
2661
+ return pi(l.icon.imagePath) ? /* @__PURE__ */ m(
2662
2662
  "div",
2663
2663
  {
2664
2664
  dangerouslySetInnerHTML: {
@@ -2667,14 +2667,14 @@ const zi = new L("messsage-toolbar"), lu = (n) => {
2667
2667
  }
2668
2668
  ) : /* @__PURE__ */ m("img", { src: l.icon.imagePath });
2669
2669
  };
2670
- return Ee(() => t.state === 20 && t.completed !== !0 || e.resourceMode !== "REMOTE" || !t.realmessageid || e.currentTopicDisableStorage, [t.state, t.completed]) ? /* @__PURE__ */ m($e, {}) : /* @__PURE__ */ m("div", { className: "".concat(zi.b()), children: i.map((l, a) => {
2670
+ return Ee(() => t.state === 20 && t.completed !== !0 || e.resourceMode !== "REMOTE" || !t.realmessageid || e.currentTopicDisableStorage, [t.state, t.completed]) ? /* @__PURE__ */ m($e, {}) : /* @__PURE__ */ m("div", { className: "".concat($i.b()), children: i.map((l, a) => {
2671
2671
  const c = l.id === "islike" && t.islike === "1" || l.id === "isdislike" && t.isdislike === "1";
2672
2672
  return /* @__PURE__ */ m(
2673
2673
  "div",
2674
2674
  {
2675
2675
  title: l.title,
2676
2676
  onClick: (d) => r(d, l),
2677
- className: "".concat(zi.e("item"), " ").concat(zi.is("actived", c)),
2677
+ className: "".concat($i.e("item"), " ").concat($i.is("actived", c)),
2678
2678
  children: s(l)
2679
2679
  },
2680
2680
  a
@@ -2685,7 +2685,7 @@ const ht = new L("markdown-message"), au = (n) => {
2685
2685
  const { message: e, size: t } = n, i = F(We()), r = F(null), s = Ee(() => e.state === 20 && e.completed !== !0, [e.state, e.completed]), o = Ee(() => e.state === 20 && e.completed === !0, [e.state, e.completed]), l = F({
2686
2686
  title: "",
2687
2687
  description: "",
2688
- icon: /* @__PURE__ */ m(Pi, {})
2688
+ icon: /* @__PURE__ */ m(zi, {})
2689
2689
  }), a = F({ hasSuggestions: !1, suggestions: [] }), c = (h) => {
2690
2690
  h && h.length > 0 ? a.value = {
2691
2691
  hasSuggestions: !0,
@@ -2702,7 +2702,7 @@ const ht = new L("markdown-message"), au = (n) => {
2702
2702
  if (t >= 0 && r.value) {
2703
2703
  if (e.content.indexOf("<think>") !== -1) {
2704
2704
  const { isThoughtCompleted: h, thoughtContent: f, answerContent: p } = u(e.content);
2705
- h ? (l.value.icon = /* @__PURE__ */ m(Ri, {}), l.value.title = "思考完成") : e.completed === !0 ? (l.value.icon = /* @__PURE__ */ m(Ri, {}), l.value.title = "思考已停止") : (l.value.icon = /* @__PURE__ */ m(Pi, {}), l.value.title = "思考中..."), l.value.description = f || "", r.value.setMarkdown(p || "");
2705
+ h ? (l.value.icon = /* @__PURE__ */ m(Pi, {}), l.value.title = "思考完成") : e.completed === !0 ? (l.value.icon = /* @__PURE__ */ m(Pi, {}), l.value.title = "思考已停止") : (l.value.icon = /* @__PURE__ */ m(zi, {}), l.value.title = "思考中..."), l.value.description = f || "", r.value.setMarkdown(p || "");
2706
2706
  } else if (e.content.indexOf("<tool_call>") !== -1) {
2707
2707
  const h = e.content.replace(new RegExp("\\<tool_call\\>[^]*?\\<\\/tool_call\\>", "gs"), "").trim();
2708
2708
  r.value.setMarkdown(h || "");
@@ -2717,7 +2717,7 @@ const ht = new L("markdown-message"), au = (n) => {
2717
2717
  l.value = {
2718
2718
  title: f ? "思考完成" : e.completed === !0 ? "思考已停止" : "思考中...",
2719
2719
  description: p || "",
2720
- icon: f || e.completed === !0 ? /* @__PURE__ */ m(Ri, {}) : /* @__PURE__ */ m(Pi, {})
2720
+ icon: f || e.completed === !0 ? /* @__PURE__ */ m(Pi, {}) : /* @__PURE__ */ m(zi, {})
2721
2721
  }, y && (h = y);
2722
2722
  } else
2723
2723
  e.content.indexOf("<tool_call>") !== -1 ? h = e.content.replace(new RegExp("\\<tool_call\\>[^]*?\\<\\/tool_call\\>", "gs"), "").trim() : h = e.content;
@@ -2869,7 +2869,7 @@ const It = new L("common-material"), du = (n) => {
2869
2869
  }
2870
2870
  };
2871
2871
  return /* @__PURE__ */ m("div", { className: It.b(), children: [
2872
- /* @__PURE__ */ m("div", { className: It.b("left"), children: e && e.icon ? typeof e.icon == "function" ? e.icon() : ((o = e.icon) == null ? void 0 : o.showIcon) && /* @__PURE__ */ m($e, { children: (l = e.icon) != null && l.cssClass ? /* @__PURE__ */ m("i", { className: e.icon.cssClass }) : (a = e.icon) != null && a.imagePath ? fi(e.icon.imagePath) ? /* @__PURE__ */ m(
2872
+ /* @__PURE__ */ m("div", { className: It.b("left"), children: e && e.icon ? typeof e.icon == "function" ? e.icon() : ((o = e.icon) == null ? void 0 : o.showIcon) && /* @__PURE__ */ m($e, { children: (l = e.icon) != null && l.cssClass ? /* @__PURE__ */ m("i", { className: e.icon.cssClass }) : (a = e.icon) != null && a.imagePath ? pi(e.icon.imagePath) ? /* @__PURE__ */ m(
2873
2873
  "div",
2874
2874
  {
2875
2875
  dangerouslySetInnerHTML: {
@@ -2894,7 +2894,7 @@ const It = new L("common-material"), du = (n) => {
2894
2894
  ] })
2895
2895
  ] });
2896
2896
  };
2897
- const $i = new L("chat-input-material-item"), Vl = (n) => {
2897
+ const Li = new L("chat-input-material-item"), Vl = (n) => {
2898
2898
  const { material: e } = n;
2899
2899
  let t = null;
2900
2900
  switch (e.type) {
@@ -2907,8 +2907,8 @@ const $i = new L("chat-input-material-item"), Vl = (n) => {
2907
2907
  const i = () => {
2908
2908
  n.controller.deleteMaterial(e);
2909
2909
  };
2910
- return /* @__PURE__ */ m("div", { className: "".concat($i.b(), " ").concat($i.is("disabled", n.disabled)), children: [
2911
- /* @__PURE__ */ m("div", { className: $i.e("icon"), onClick: i, children: /* @__PURE__ */ m(Vd, {}) }),
2910
+ return /* @__PURE__ */ m("div", { className: "".concat(Li.b(), " ").concat(Li.is("disabled", n.disabled)), children: [
2911
+ /* @__PURE__ */ m("div", { className: Li.e("icon"), onClick: i, children: /* @__PURE__ */ m(Vd, {}) }),
2912
2912
  ze(t, {
2913
2913
  material: e,
2914
2914
  controller: n.controller
@@ -2916,7 +2916,7 @@ const $i = new L("chat-input-material-item"), Vl = (n) => {
2916
2916
  ] });
2917
2917
  };
2918
2918
  const ke = new L("user-message-question"), uu = (n) => {
2919
- const e = F(We()), t = F(null), i = F(135), r = F(!0), s = F(!1), o = Q(null), l = he(() => n.message.content), a = he(() => ur.parseMixedContent(l.value));
2919
+ const e = F(We()), t = F(null), i = F(135), r = F(!0), s = F(!1), o = Q(null), l = he(() => n.message.content), a = he(() => Wn.parseMixedContent(l.value));
2920
2920
  K(() => {
2921
2921
  t.value = new dl({
2922
2922
  id: e,
@@ -3181,9 +3181,6 @@ class Rt {
3181
3181
  get captionMode() {
3182
3182
  return this.data.captionMode;
3183
3183
  }
3184
- get captionFilled() {
3185
- return this.data.captionFilled;
3186
- }
3187
3184
  get realid() {
3188
3185
  return this.data.realid;
3189
3186
  }
@@ -3197,7 +3194,7 @@ class Rt {
3197
3194
  return this.data.disableStorage || !1;
3198
3195
  }
3199
3196
  }
3200
- class Li {
3197
+ class Bi {
3201
3198
  constructor(e) {
3202
3199
  this.material = e;
3203
3200
  }
@@ -3256,7 +3253,7 @@ const ye = new L("chat-toolbar-item"), yu = (n) => {
3256
3253
  if ((C = b.icon) != null && C.showIcon && ((w = b.icon) != null && w.cssClass))
3257
3254
  return /* @__PURE__ */ m("i", { className: b.icon.cssClass });
3258
3255
  if ((x = b.icon) != null && x.showIcon && ((M = b.icon) != null && M.imagePath))
3259
- return fi(b.icon.imagePath) ? /* @__PURE__ */ m(
3256
+ return pi(b.icon.imagePath) ? /* @__PURE__ */ m(
3260
3257
  "div",
3261
3258
  {
3262
3259
  dangerouslySetInnerHTML: {
@@ -3332,7 +3329,7 @@ const vu = new L("chat-toolbar"), gr = (n) => {
3332
3329
  className: s,
3333
3330
  mode: o,
3334
3331
  hideTopicSidebar: l
3335
- } = n, a = Fr(Ei);
3332
+ } = n, a = Fr(Ai);
3336
3333
  let c = [];
3337
3334
  const d = [
3338
3335
  {
@@ -3613,7 +3610,7 @@ function Wl(n, e, t) {
3613
3610
  return Wl(i, e, t);
3614
3611
  }), n.__c && n.__c.__P === e && (n.__e && t.appendChild(n.__e), n.__c.__e = !0, n.__c.__P = t)), n;
3615
3612
  }
3616
- function Bi() {
3613
+ function Fi() {
3617
3614
  this.__u = 0, this.o = null, this.__b = null;
3618
3615
  }
3619
3616
  function jl(n) {
@@ -3626,7 +3623,7 @@ function Dn() {
3626
3623
  D.unmount = function(n) {
3627
3624
  var e = n.__c;
3628
3625
  e && e.__R && e.__R(), e && 32 & n.__u && (n.type = null), Ls && Ls(n);
3629
- }, (Bi.prototype = new Ie()).__c = function(n, e) {
3626
+ }, (Fi.prototype = new Ie()).__c = function(n, e) {
3630
3627
  var t = e.__c, i = this;
3631
3628
  i.o == null && (i.o = []), i.o.push(t);
3632
3629
  var r = jl(i.__v), s = !1, o = function() {
@@ -3645,9 +3642,9 @@ D.unmount = function(n) {
3645
3642
  }
3646
3643
  };
3647
3644
  i.__u++ || 32 & e.__u || i.setState({ __a: i.__b = i.__v.__k[0] }), n.then(o, o);
3648
- }, Bi.prototype.componentWillUnmount = function() {
3645
+ }, Fi.prototype.componentWillUnmount = function() {
3649
3646
  this.o = [];
3650
- }, Bi.prototype.render = function(n, e) {
3647
+ }, Fi.prototype.render = function(n, e) {
3651
3648
  if (this.__b) {
3652
3649
  if (this.__v.__k) {
3653
3650
  var t = document.createElement("div"), i = this.__v.__k[0].__c;
@@ -3704,7 +3701,7 @@ function Mu(n, e) {
3704
3701
  };
3705
3702
  }, Dn.prototype.render = function(n) {
3706
3703
  this.i = null, this.l = /* @__PURE__ */ new Map();
3707
- var e = Yn(n.children);
3704
+ var e = Xn(n.children);
3708
3705
  n.revealOrder && n.revealOrder[0] === "b" && e.reverse();
3709
3706
  for (var t = e.length; t--; )
3710
3707
  this.l.set(e[t], this.i = [1, 0, this.i]);
@@ -3750,9 +3747,9 @@ D.vnode = function(n) {
3750
3747
  o === "defaultValue" && "value" in t && t.value == null ? o = "value" : o === "download" && l === !0 ? l = "" : a === "translate" && l === "no" ? l = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? o = "ondblclick" : a !== "onchange" || i !== "input" && i !== "textarea" || Ou(t.type) ? a === "onfocus" ? o = "onfocusin" : a === "onblur" ? o = "onfocusout" : Nu.test(o) && (o = a) : a = o = "oninput" : s && Tu.test(o) ? o = o.replace(Eu, "-$&").toLowerCase() : l === null && (l = void 0), a === "oninput" && r[o = a] && (o = "oninputCapture"), r[o] = l;
3751
3748
  }
3752
3749
  }
3753
- i == "select" && r.multiple && Array.isArray(r.value) && (r.value = Yn(t.children).forEach(function(c) {
3750
+ i == "select" && r.multiple && Array.isArray(r.value) && (r.value = Xn(t.children).forEach(function(c) {
3754
3751
  c.props.selected = r.value.indexOf(c.props.value) != -1;
3755
- })), i == "select" && r.defaultValue != null && (r.value = Yn(t.children).forEach(function(c) {
3752
+ })), i == "select" && r.defaultValue != null && (r.value = Xn(t.children).forEach(function(c) {
3756
3753
  c.props.selected = r.multiple ? r.defaultValue.indexOf(c.props.value) != -1 : r.defaultValue == c.props.value;
3757
3754
  })), t.class && !t.className ? (r.class = t.class, Object.defineProperty(r, "className", Pu)) : (t.className && !t.class || t.class && t.className) && (r.class = r.className = t.className), e.props = r;
3758
3755
  }(n), n.$$typeof = _u, Vs && Vs(n);
@@ -3938,6 +3935,10 @@ class js {
3938
3935
  * 模式参数,用于业务区分
3939
3936
  */
3940
3937
  A(this, "chatMode");
3938
+ /**
3939
+ * 摘要是否正在处理完成
3940
+ */
3941
+ A(this, "isDigestProcessed", !1);
3941
3942
  this.opts = e, this.resourceOptions = t, this.context = e.context, this.params = e.params, this.appDataEntityId = e.appDataEntityId, this.aiTopic = e.aiTopic, this.topicId = e.topicId, this.topic = e.topic, this.activeAIAgentID = e.activeAIAgentID, this.enableAIAgentChange = !!e.enableAIAgentChange, this.chatMode = e.srfMode, this.chatSessionid = e.sessionid, this.initAIChat();
3942
3943
  }
3943
3944
  /**
@@ -3958,6 +3959,28 @@ class js {
3958
3959
  }
3959
3960
  return !1;
3960
3961
  }
3962
+ /**
3963
+ * 当前话题标题模式
3964
+ */
3965
+ get sessionCaptionMode() {
3966
+ if (this.aiTopic && this.topicId) {
3967
+ const e = this.aiTopic.getCurrentTopicByID(this.topicId);
3968
+ if (e && e.captionMode)
3969
+ return e.captionMode;
3970
+ }
3971
+ return "default";
3972
+ }
3973
+ /**
3974
+ * 当前话题标题
3975
+ */
3976
+ get sessionDefaultCaption() {
3977
+ if (this.aiTopic && this.topicId) {
3978
+ const e = this.aiTopic.getCurrentTopicByID(this.topicId);
3979
+ if (e && e.caption)
3980
+ return e.caption;
3981
+ }
3982
+ return this.opts.caption || "新会话";
3983
+ }
3961
3984
  /**
3962
3985
  * 初始化
3963
3986
  */
@@ -4050,7 +4073,7 @@ class js {
4050
4073
  completed: !0,
4051
4074
  status: "sent"
4052
4075
  }), this.opts.appendCurResource) {
4053
- const { hasResources: e, resources: t } = ur.parseMixedContent(this.opts.appendCurResource);
4076
+ const { hasResources: e, resources: t } = Wn.parseMixedContent(this.opts.appendCurResource);
4054
4077
  e && t && t.length > 0 && t.forEach((i) => {
4055
4078
  this.replaceMaterial(i.id, i);
4056
4079
  });
@@ -4199,7 +4222,7 @@ class js {
4199
4222
  s.state && s.state === "successed" && i.push(r);
4200
4223
  } else
4201
4224
  i.push(r);
4202
- }), e && (this.materials.value = [])), i && i.length > 0 && (t = ur.stringify(i)), t;
4225
+ }), e && (this.materials.value = [])), i && i.length > 0 && (t = Wn.stringify(i)), t;
4203
4226
  }
4204
4227
  /**
4205
4228
  * @description 获取当前会话的消息集合
@@ -4402,7 +4425,7 @@ class js {
4402
4425
  * @param {IMaterial} data
4403
4426
  */
4404
4427
  addMaterial(e) {
4405
- this.materials.value.find((i) => i.id === e.id) ? this.materials.value = [...this.materials.value] : this.materials.value = [...this.materials.value, new Li(e)];
4428
+ this.materials.value.find((i) => i.id === e.id) ? this.materials.value = [...this.materials.value] : this.materials.value = [...this.materials.value, new Bi(e)];
4406
4429
  }
4407
4430
  /**
4408
4431
  * 替换素材资源
@@ -4414,7 +4437,7 @@ class js {
4414
4437
  */
4415
4438
  replaceMaterial(e, t) {
4416
4439
  const i = this.materials.value.findIndex((r) => r.id === e);
4417
- i !== -1 ? (this.materials.value[i] = new Li(t), this.materials.value = [...this.materials.value]) : this.materials.value = [...this.materials.value, new Li(t)];
4440
+ i !== -1 ? (this.materials.value[i] = new Bi(t), this.materials.value = [...this.materials.value]) : this.materials.value = [...this.materials.value, new Bi(t)];
4418
4441
  }
4419
4442
  /**
4420
4443
  * 删除指定素材资源
@@ -4522,23 +4545,50 @@ class js {
4522
4545
  * 更新当前话题标题
4523
4546
  */
4524
4547
  async updateTopicCaption() {
4548
+ if (this.isDigestProcessed === !0)
4549
+ return;
4525
4550
  const e = this.messages.value.find((t) => t.role === "USER");
4526
4551
  if (e) {
4527
- if (this.topicId && this.aiTopic)
4528
- this.aiTopic.updateTopicCaption(this.topicId, e.content);
4529
- else if (this.resourceMode === "REMOTE" && this.resourceOptions) {
4530
- const t = await this.resourceOptions.getSessionList({
4552
+ let t = "";
4553
+ if (this.sessionCaptionMode)
4554
+ switch (this.sessionCaptionMode) {
4555
+ case "snippet":
4556
+ const i = e.content, { remainingText: r } = Wn.parseMixedContent(i);
4557
+ t = r.substring(0, 15);
4558
+ break;
4559
+ case "summary":
4560
+ const s = await this.opts.chatDigest(
4561
+ this.context,
4562
+ this.params,
4563
+ {
4564
+ appDataEntityId: this.appDataEntityId,
4565
+ message: {
4566
+ messages: [e._origin],
4567
+ sessionid: this.chatSessionid,
4568
+ srfaiagent: this.activeAIAgentID
4569
+ }
4570
+ }
4571
+ );
4572
+ s && s.content && (t = s.content);
4573
+ break;
4574
+ default:
4575
+ t = this.sessionDefaultCaption;
4576
+ break;
4577
+ }
4578
+ if (this.resourceMode === "REMOTE" && this.resourceOptions && // 禁用存储不做处理
4579
+ !this.currentTopicDisableStorage) {
4580
+ const i = await this.resourceOptions.getSessionList({
4531
4581
  n_session_id_eq: this.chatSessionid
4532
4582
  });
4533
- if (t && t.length > 0) {
4534
- const i = e.content.substring(0, 15) || this.opts.caption;
4535
- if (t[0].caption === i)
4583
+ if (i && i.length > 0) {
4584
+ if (i[0].caption === t)
4536
4585
  return;
4537
- await this.resourceOptions.updateSession(t[0].realid, {
4538
- caption: i
4586
+ await this.resourceOptions.updateSession(i[0].realid, {
4587
+ caption: t
4539
4588
  });
4540
4589
  }
4541
4590
  }
4591
+ this.topicId && this.aiTopic && this.aiTopic.updateTopicCaption(this.topicId, t), this.isDigestProcessed = !0;
4542
4592
  }
4543
4593
  }
4544
4594
  /**
@@ -4882,7 +4932,6 @@ class Fu {
4882
4932
  id: "".concat(r, "@").concat(Date.now()),
4883
4933
  type: i.type,
4884
4934
  captionMode: i.captionMode,
4885
- captionFilled: !1,
4886
4935
  caption: o,
4887
4936
  sourceCaption: i.sourceCaption,
4888
4937
  url: i.url,
@@ -4945,37 +4994,7 @@ class Fu {
4945
4994
  */
4946
4995
  async updateTopicCaption(e, t) {
4947
4996
  const i = this.topics.value.find((r) => r.id === e);
4948
- if (i && !i.captionFilled) {
4949
- if (i.captionMode !== "default") {
4950
- switch (i.captionMode) {
4951
- case "snippet":
4952
- i.data.caption = t.substring(0, 15);
4953
- break;
4954
- }
4955
- this.topics.value = [...this.topics.value], this.backupOptions && await this.updateTopic(this.backupOptions);
4956
- }
4957
- if (i.disableStorage)
4958
- return;
4959
- if (this.resourceMode === "REMOTE" && this.resourceOptions) {
4960
- if (i.realid)
4961
- await this.resourceOptions.updateSession(i.realid, {
4962
- caption: i.caption
4963
- });
4964
- else if (i.aiChat && i.aiChat.sessionid) {
4965
- const r = await this.resourceOptions.getSessionList({
4966
- n_session_id_eq: i.aiChat.sessionid
4967
- });
4968
- if (r && r.length > 0) {
4969
- if (r[0].caption === i.caption)
4970
- return;
4971
- await this.resourceOptions.updateSession(r[0].realid, {
4972
- caption: i.caption
4973
- });
4974
- }
4975
- }
4976
- }
4977
- i.data.captionFilled = !0;
4978
- }
4997
+ i && i.caption !== t && (i.data.caption = t, this.topics.value = [...this.topics.value], this.backupOptions && await this.updateTopic(this.backupOptions));
4979
4998
  }
4980
4999
  /**
4981
5000
  * 更新话题数据
@@ -4994,7 +5013,6 @@ class Fu {
4994
5013
  id: r.id,
4995
5014
  type: r.type,
4996
5015
  captionMode: r.captionMode,
4997
- captionFilled: r.captionFilled,
4998
5016
  caption: r.caption || r.sourceCaption,
4999
5017
  sourceCaption: r.sourceCaption,
5000
5018
  url: r.url,
@@ -5256,7 +5274,7 @@ class Wu {
5256
5274
  this.resourceOptions = e.resourceOptions, (((o = e.resourceOptions) == null ? void 0 : o.resourceMode) || "LOCAL") === "LOCAL" && await this.initIndexDB(), this.backupChatOptions = e, this.close(), this.container = document.createElement("div"), this.container.classList.add("ibiz-ai-chat"), document.body.appendChild(this.container);
5257
5275
  const i = e.chatOptions;
5258
5276
  mt(
5259
- ze(or, {
5277
+ ze(lr, {
5260
5278
  mode: e.mode ? e.mode : "DEFAULT",
5261
5279
  containerOptions: e.containerOptions,
5262
5280
  caption: e.mode && e.mode === "TOPIC" ? "AI助手" : i.caption,
@@ -5311,7 +5329,7 @@ class Wu {
5311
5329
  });
5312
5330
  const s = new js(i, this.resourceOptions);
5313
5331
  return this.aiTopicMap.set("".concat(r == null ? void 0 : r.id), s), mt(
5314
- ze(or, {
5332
+ ze(lr, {
5315
5333
  aiChat: s,
5316
5334
  aiTopic: this.aiTopic,
5317
5335
  mode: e.mode ? e.mode : "DEFAULT",
@@ -5358,7 +5376,7 @@ class Wu {
5358
5376
  syncHistoryOptions(e, t, i) {
5359
5377
  if (e.disableStorage) {
5360
5378
  const o = md("TEMP");
5361
- t.sessionid = o, e.aiChat.sessionid = o, e.caption = "临时会话", e.sourceCaption = "临时会话", e.captionFilled = !0;
5379
+ t.sessionid = o, e.aiChat.sessionid = o, e.caption = "临时会话", e.sourceCaption = "临时会话";
5362
5380
  return;
5363
5381
  }
5364
5382
  const r = this.aiTopic.getCurrentTopicByID(
@@ -5374,7 +5392,7 @@ class Wu {
5374
5392
  }
5375
5393
  r && r.aiChat && r.aiChat.sessionid && (t.sessionid = r.aiChat.sessionid, e.aiChat.sessionid = r.aiChat.sessionid);
5376
5394
  const s = i.resourceMode;
5377
- s === "LOCAL" ? e.captionMode !== "default" ? (e.sourceCaption = "新会话", r && r.captionFilled && r.caption ? (e.captionFilled = r.captionFilled, e.caption = r.caption) : e.caption = "新会话") : (e.sourceCaption = e.caption, e.captionFilled = !0) : s === "REMOTE" && (e.sourceCaption = e.caption, r && r.caption && (e.caption = r.caption), e.captionFilled = !1), s === "REMOTE" && r && r.realid && (e.realid = r.realid);
5395
+ s === "LOCAL" ? e.captionMode !== "default" ? (e.sourceCaption = "新会话", r && r.caption ? e.caption = r.caption : e.caption = "新会话") : e.sourceCaption = e.caption : s === "REMOTE" && (e.sourceCaption = e.caption, r && r.caption && (e.caption = r.caption)), s === "REMOTE" && r && r.realid && (e.realid = r.realid);
5378
5396
  }
5379
5397
  /**
5380
5398
  * 切换聊天控制器
@@ -5409,14 +5427,15 @@ class Wu {
5409
5427
  topic: e,
5410
5428
  aiTopic: this.aiTopic,
5411
5429
  extendToolbarClick: this.backupChatOptions.chatOptions.extendToolbarClick,
5412
- recommendPrompt: this.backupChatOptions.chatOptions.recommendPrompt
5430
+ recommendPrompt: this.backupChatOptions.chatOptions.recommendPrompt,
5431
+ chatDigest: this.backupChatOptions.chatOptions.chatDigest
5413
5432
  });
5414
5433
  const i = new js(
5415
5434
  t,
5416
5435
  this.resourceOptions
5417
5436
  );
5418
5437
  this.aiTopicMap.set("".concat(e.id), i), this.container && (mt(null, this.container), mt(
5419
- ze(or, {
5438
+ ze(lr, {
5420
5439
  aiChat: i,
5421
5440
  aiTopic: this.aiTopic,
5422
5441
  mode: (r = this.backupChatOptions) != null && r.mode ? this.backupChatOptions.mode : "DEFAULT",
@@ -5498,7 +5517,7 @@ const Ul = ({
5498
5517
  onAction: l
5499
5518
  // 接收行为事件回调
5500
5519
  }) => {
5501
- const a = new L("pop"), c = Fr(Ei), [d, u] = Me(s || !1), h = Q(null), f = Q(null), p = Q(null);
5520
+ const a = new L("pop"), c = Fr(Ai), [d, u] = Me(s || !1), h = Q(null), f = Q(null), p = Q(null);
5502
5521
  K(() => {
5503
5522
  s !== void 0 && u(s);
5504
5523
  }, [s]), K(() => (f.current || (f.current = document.createElement("div"), f.current.className = a.b("content-container"), document.body.appendChild(f.current)), () => {
@@ -6013,11 +6032,11 @@ class k {
6013
6032
  }
6014
6033
  }
6015
6034
  k.empty = new k([], 0);
6016
- const Fi = { index: 0, offset: 0 };
6035
+ const Vi = { index: 0, offset: 0 };
6017
6036
  function In(n, e) {
6018
- return Fi.index = n, Fi.offset = e, Fi;
6037
+ return Vi.index = n, Vi.offset = e, Vi;
6019
6038
  }
6020
- function Zn(n, e) {
6039
+ function Qn(n, e) {
6021
6040
  if (n === e)
6022
6041
  return !0;
6023
6042
  if (!(n && typeof n == "object") || !(e && typeof e == "object"))
@@ -6029,11 +6048,11 @@ function Zn(n, e) {
6029
6048
  if (n.length != e.length)
6030
6049
  return !1;
6031
6050
  for (let i = 0; i < n.length; i++)
6032
- if (!Zn(n[i], e[i]))
6051
+ if (!Qn(n[i], e[i]))
6033
6052
  return !1;
6034
6053
  } else {
6035
6054
  for (let i in n)
6036
- if (!(i in e) || !Zn(n[i], e[i]))
6055
+ if (!(i in e) || !Qn(n[i], e[i]))
6037
6056
  return !1;
6038
6057
  for (let i in e)
6039
6058
  if (!(i in n))
@@ -6095,7 +6114,7 @@ let $ = class yr {
6095
6114
  another mark.
6096
6115
  */
6097
6116
  eq(e) {
6098
- return this == e || this.type == e.type && Zn(this.attrs, e.attrs);
6117
+ return this == e || this.type == e.type && Qn(this.attrs, e.attrs);
6099
6118
  }
6100
6119
  /**
6101
6120
  Convert this mark to a JSON-serializeable representation.
@@ -6147,7 +6166,7 @@ let $ = class yr {
6147
6166
  }
6148
6167
  };
6149
6168
  $.none = [];
6150
- class Qn extends Error {
6169
+ class ei extends Error {
6151
6170
  }
6152
6171
  class S {
6153
6172
  /**
@@ -6250,9 +6269,9 @@ function Xl(n, e, t, i) {
6250
6269
  }
6251
6270
  function Uu(n, e, t) {
6252
6271
  if (t.openStart > n.depth)
6253
- throw new Qn("Inserted content deeper than insertion position");
6272
+ throw new ei("Inserted content deeper than insertion position");
6254
6273
  if (n.depth - t.openStart != e.depth - t.openEnd)
6255
- throw new Qn("Inconsistent open depths");
6274
+ throw new ei("Inconsistent open depths");
6256
6275
  return Gl(n, e, t, 0);
6257
6276
  }
6258
6277
  function Gl(n, e, t, i) {
@@ -6269,11 +6288,11 @@ function Gl(n, e, t, i) {
6269
6288
  return Ct(s, Ql(n, o, l, e, i));
6270
6289
  }
6271
6290
  else
6272
- return Ct(s, ei(n, e, i));
6291
+ return Ct(s, ti(n, e, i));
6273
6292
  }
6274
6293
  function Zl(n, e) {
6275
6294
  if (!e.type.compatibleContent(n.type))
6276
- throw new Qn("Cannot join " + e.type.name + " onto " + n.type.name);
6295
+ throw new ei("Cannot join " + e.type.name + " onto " + n.type.name);
6277
6296
  }
6278
6297
  function vr(n, e, t) {
6279
6298
  let i = n.node(t);
@@ -6295,13 +6314,13 @@ function Ct(n, e) {
6295
6314
  }
6296
6315
  function Ql(n, e, t, i, r) {
6297
6316
  let s = n.depth > r && vr(n, e, r + 1), o = i.depth > r && vr(t, i, r + 1), l = [];
6298
- return dn(null, n, r, l), s && o && e.index(r) == t.index(r) ? (Zl(s, o), wt(Ct(s, Ql(n, e, t, i, r + 1)), l)) : (s && wt(Ct(s, ei(n, e, r + 1)), l), dn(e, t, r, l), o && wt(Ct(o, ei(t, i, r + 1)), l)), dn(i, null, r, l), new k(l);
6317
+ return dn(null, n, r, l), s && o && e.index(r) == t.index(r) ? (Zl(s, o), wt(Ct(s, Ql(n, e, t, i, r + 1)), l)) : (s && wt(Ct(s, ti(n, e, r + 1)), l), dn(e, t, r, l), o && wt(Ct(o, ti(t, i, r + 1)), l)), dn(i, null, r, l), new k(l);
6299
6318
  }
6300
- function ei(n, e, t) {
6319
+ function ti(n, e, t) {
6301
6320
  let i = [];
6302
6321
  if (dn(null, n, t, i), n.depth > t) {
6303
6322
  let r = vr(n, e, t + 1);
6304
- wt(Ct(r, ei(n, e, t + 1)), i);
6323
+ wt(Ct(r, ti(n, e, t + 1)), i);
6305
6324
  }
6306
6325
  return dn(e, null, t, i), new k(i);
6307
6326
  }
@@ -6499,7 +6518,7 @@ class yn {
6499
6518
  return e.blockRange(this);
6500
6519
  for (let i = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); i >= 0; i--)
6501
6520
  if (e.pos <= this.end(i) && (!t || t(this.node(i))))
6502
- return new ti(this, e, i);
6521
+ return new ni(this, e, i);
6503
6522
  return null;
6504
6523
  }
6505
6524
  /**
@@ -6567,7 +6586,7 @@ class Ku {
6567
6586
  }
6568
6587
  }
6569
6588
  const Yu = 12, Us = /* @__PURE__ */ new WeakMap();
6570
- class ti {
6589
+ class ni {
6571
6590
  /**
6572
6591
  Construct a node range. `$from` and `$to` should point into the
6573
6592
  same node until at least the given `depth`, since a node range
@@ -6726,7 +6745,7 @@ let st = class br {
6726
6745
  attributes, and marks.
6727
6746
  */
6728
6747
  hasMarkup(e, t, i) {
6729
- return this.type == e && Zn(this.attrs, t || e.defaultAttrs || Xu) && $.sameSet(this.marks, i || $.none);
6748
+ return this.type == e && Qn(this.attrs, t || e.defaultAttrs || Xu) && $.sameSet(this.marks, i || $.none);
6730
6749
  }
6731
6750
  /**
6732
6751
  Create a new node with the same markup as this node, containing
@@ -6978,7 +6997,7 @@ let st = class br {
6978
6997
  }
6979
6998
  };
6980
6999
  st.prototype.text = void 0;
6981
- class ni extends st {
7000
+ class ii extends st {
6982
7001
  /**
6983
7002
  @internal
6984
7003
  */
@@ -7000,10 +7019,10 @@ class ni extends st {
7000
7019
  return this.text.length;
7001
7020
  }
7002
7021
  mark(e) {
7003
- return e == this.marks ? this : new ni(this.type, this.attrs, this.text, e);
7022
+ return e == this.marks ? this : new ii(this.type, this.attrs, this.text, e);
7004
7023
  }
7005
7024
  withText(e) {
7006
- return e == this.text ? this : new ni(this.type, this.attrs, e, this.marks);
7025
+ return e == this.text ? this : new ii(this.type, this.attrs, e, this.marks);
7007
7026
  }
7008
7027
  cut(e = 0, t = this.text.length) {
7009
7028
  return e == 0 && t == this.text.length ? this : this.withText(this.text.slice(e, t));
@@ -7599,7 +7618,7 @@ class lh {
7599
7618
  return !this.hasDefault;
7600
7619
  }
7601
7620
  }
7602
- class gi {
7621
+ class yi {
7603
7622
  /**
7604
7623
  @internal
7605
7624
  */
@@ -7621,7 +7640,7 @@ class gi {
7621
7640
  */
7622
7641
  static compile(e, t) {
7623
7642
  let i = /* @__PURE__ */ Object.create(null), r = 0;
7624
- return e.forEach((s, o) => i[s] = new gi(s, r++, t, o)), i;
7643
+ return e.forEach((s, o) => i[s] = new yi(s, r++, t, o)), i;
7625
7644
  }
7626
7645
  /**
7627
7646
  When there is a mark of this type in the given set, a new set
@@ -7663,7 +7682,7 @@ class aa {
7663
7682
  let t = this.spec = {};
7664
7683
  for (let r in e)
7665
7684
  t[r] = e[r];
7666
- t.nodes = ie.from(e.nodes), t.marks = ie.from(e.marks || {}), this.nodes = Ys.compile(this.spec.nodes, this), this.marks = gi.compile(this.spec.marks, this);
7685
+ t.nodes = ie.from(e.nodes), t.marks = ie.from(e.marks || {}), this.nodes = Ys.compile(this.spec.nodes, this), this.marks = yi.compile(this.spec.marks, this);
7667
7686
  let i = /* @__PURE__ */ Object.create(null);
7668
7687
  for (let r in this.nodes) {
7669
7688
  if (r in this.marks)
@@ -7706,7 +7725,7 @@ class aa {
7706
7725
  */
7707
7726
  text(e, t) {
7708
7727
  let i = this.nodes.text;
7709
- return new ni(i, i.defaultAttrs, e, $.setFrom(t));
7728
+ return new ii(i, i.defaultAttrs, e, $.setFrom(t));
7710
7729
  }
7711
7730
  /**
7712
7731
  Create a mark with the given type and attributes.
@@ -8272,7 +8291,7 @@ class At {
8272
8291
  nodes.
8273
8292
  */
8274
8293
  serializeFragment(e, t = {}, i) {
8275
- i || (i = Vi(t).createDocumentFragment());
8294
+ i || (i = Hi(t).createDocumentFragment());
8276
8295
  let r = i, s = [];
8277
8296
  return e.forEach((o) => {
8278
8297
  if (s.length || o.marks.length) {
@@ -8301,7 +8320,7 @@ class At {
8301
8320
  @internal
8302
8321
  */
8303
8322
  serializeNodeInner(e, t) {
8304
- let { dom: i, contentDOM: r } = jn(Vi(t), this.nodes[e.type.name](e), null, e.attrs);
8323
+ let { dom: i, contentDOM: r } = qn(Hi(t), this.nodes[e.type.name](e), null, e.attrs);
8305
8324
  if (r) {
8306
8325
  if (e.isLeaf)
8307
8326
  throw new RangeError("Content hole not allowed in a leaf node spec");
@@ -8329,10 +8348,10 @@ class At {
8329
8348
  */
8330
8349
  serializeMark(e, t, i = {}) {
8331
8350
  let r = this.marks[e.type.name];
8332
- return r && jn(Vi(i), r(e, t), null, e.attrs);
8351
+ return r && qn(Hi(i), r(e, t), null, e.attrs);
8333
8352
  }
8334
8353
  static renderSpec(e, t, i = null, r) {
8335
- return jn(e, t, i, r);
8354
+ return qn(e, t, i, r);
8336
8355
  }
8337
8356
  /**
8338
8357
  Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
@@ -8364,7 +8383,7 @@ function to(n) {
8364
8383
  }
8365
8384
  return e;
8366
8385
  }
8367
- function Vi(n) {
8386
+ function Hi(n) {
8368
8387
  return n.document || window.document;
8369
8388
  }
8370
8389
  const no = /* @__PURE__ */ new WeakMap();
@@ -8388,7 +8407,7 @@ function ph(n) {
8388
8407
  }
8389
8408
  return t(n), e;
8390
8409
  }
8391
- function jn(n, e, t, i) {
8410
+ function qn(n, e, t, i) {
8392
8411
  if (typeof e == "string")
8393
8412
  return { dom: n.createTextNode(e) };
8394
8413
  if (e.nodeType != null)
@@ -8418,7 +8437,7 @@ function jn(n, e, t, i) {
8418
8437
  throw new RangeError("Content hole must be the only child of its parent node");
8419
8438
  return { dom: a, contentDOM: a };
8420
8439
  } else {
8421
- let { dom: f, contentDOM: p } = jn(n, h, t, i);
8440
+ let { dom: f, contentDOM: p } = qn(n, h, t, i);
8422
8441
  if (a.appendChild(f), p) {
8423
8442
  if (l)
8424
8443
  throw new RangeError("Multiple content holes");
@@ -8438,7 +8457,7 @@ function io(n) {
8438
8457
  function gh(n) {
8439
8458
  return (n - (n & ua)) / ha;
8440
8459
  }
8441
- const fa = 1, pa = 2, qn = 4, ma = 8;
8460
+ const fa = 1, pa = 2, Un = 4, ma = 8;
8442
8461
  class kr {
8443
8462
  /**
8444
8463
  @internal
@@ -8458,13 +8477,13 @@ class kr {
8458
8477
  Tells you whether the token before the mapped position was deleted.
8459
8478
  */
8460
8479
  get deletedBefore() {
8461
- return (this.delInfo & (fa | qn)) > 0;
8480
+ return (this.delInfo & (fa | Un)) > 0;
8462
8481
  }
8463
8482
  /**
8464
8483
  True when the token after the mapped position was deleted.
8465
8484
  */
8466
8485
  get deletedAfter() {
8467
- return (this.delInfo & (pa | qn)) > 0;
8486
+ return (this.delInfo & (pa | Un)) > 0;
8468
8487
  }
8469
8488
  /**
8470
8489
  Tells whether any of the steps mapped through deletes across the
@@ -8472,7 +8491,7 @@ class kr {
8472
8491
  position).
8473
8492
  */
8474
8493
  get deletedAcross() {
8475
- return (this.delInfo & qn) > 0;
8494
+ return (this.delInfo & Un) > 0;
8476
8495
  }
8477
8496
  }
8478
8497
  class Ce {
@@ -8515,7 +8534,7 @@ class Ce {
8515
8534
  let h = c ? e == a ? -1 : e == u ? 1 : t : t, f = a + r + (h < 0 ? 0 : d);
8516
8535
  if (i)
8517
8536
  return f;
8518
- let p = e == (t < 0 ? a : u) ? null : mh(l / 3, e - a), y = e == a ? pa : e == u ? fa : qn;
8537
+ let p = e == (t < 0 ? a : u) ? null : mh(l / 3, e - a), y = e == a ? pa : e == u ? fa : Un;
8519
8538
  return (t < 0 ? e != a : e != u) && (y |= ma), new kr(f, y, p);
8520
8539
  }
8521
8540
  r += d - c;
@@ -8679,7 +8698,7 @@ class bn {
8679
8698
  return i ? e : new kr(e, r, null);
8680
8699
  }
8681
8700
  }
8682
- const Hi = /* @__PURE__ */ Object.create(null);
8701
+ const Wi = /* @__PURE__ */ Object.create(null);
8683
8702
  class de {
8684
8703
  /**
8685
8704
  Get the step map that represents the changes made by this step,
@@ -8704,7 +8723,7 @@ class de {
8704
8723
  static fromJSON(e, t) {
8705
8724
  if (!t || !t.stepType)
8706
8725
  throw new RangeError("Invalid input for Step.fromJSON");
8707
- let i = Hi[t.stepType];
8726
+ let i = Wi[t.stepType];
8708
8727
  if (!i)
8709
8728
  throw new RangeError("No step type ".concat(t.stepType, " defined"));
8710
8729
  return i.fromJSON(e, t);
@@ -8716,9 +8735,9 @@ class de {
8716
8735
  that's unlikely to clash with steps from other modules.
8717
8736
  */
8718
8737
  static jsonID(e, t) {
8719
- if (e in Hi)
8738
+ if (e in Wi)
8720
8739
  throw new RangeError("Duplicate use of step JSON ID " + e);
8721
- return Hi[e] = t, t.prototype.jsonID = e, t;
8740
+ return Wi[e] = t, t.prototype.jsonID = e, t;
8722
8741
  }
8723
8742
  }
8724
8743
  class J {
@@ -8749,7 +8768,7 @@ class J {
8749
8768
  try {
8750
8769
  return J.ok(e.replace(t, i, r));
8751
8770
  } catch (s) {
8752
- if (s instanceof Qn)
8771
+ if (s instanceof ei)
8753
8772
  return J.fail(s.message);
8754
8773
  throw s;
8755
8774
  }
@@ -9065,7 +9084,7 @@ function vh(n, e, t, i) {
9065
9084
  return;
9066
9085
  s++;
9067
9086
  let a = null;
9068
- if (i instanceof gi) {
9087
+ if (i instanceof yi) {
9069
9088
  let c = o.marks, d;
9070
9089
  for (; d = i.isInSet(c); )
9071
9090
  (a || (a = [])).push(d), c = d.removeFromSet(c);
@@ -9265,7 +9284,7 @@ function Nh(n, e) {
9265
9284
  function ba(n, e) {
9266
9285
  return !!(n && e && !n.isLeaf && Nh(n, e));
9267
9286
  }
9268
- function yi(n, e, t = -1) {
9287
+ function vi(n, e, t = -1) {
9269
9288
  let i = n.resolve(e);
9270
9289
  for (let r = i.depth; ; r--) {
9271
9290
  let s, o, l = i.index(r);
@@ -9338,7 +9357,7 @@ function wa(n, e, t) {
9338
9357
  }
9339
9358
  return null;
9340
9359
  }
9341
- function vi(n, e, t = e, i = S.empty) {
9360
+ function bi(n, e, t = e, i = S.empty) {
9342
9361
  if (e == t && !i.size)
9343
9362
  return null;
9344
9363
  let r = n.resolve(e), s = n.resolve(t);
@@ -9393,7 +9412,7 @@ class Oh {
9393
9412
  for (let t = 1; t <= 2; t++)
9394
9413
  for (let i = t == 1 ? e : this.unplaced.openStart; i >= 0; i--) {
9395
9414
  let r, s = null;
9396
- i ? (s = Wi(this.unplaced.content, i - 1).firstChild, r = s.content) : r = this.unplaced.content;
9415
+ i ? (s = ji(this.unplaced.content, i - 1).firstChild, r = s.content) : r = this.unplaced.content;
9397
9416
  let o = r.firstChild;
9398
9417
  for (let l = this.depth; l >= 0; l--) {
9399
9418
  let { type: a, match: c } = this.frontier[l], d, u = null;
@@ -9407,11 +9426,11 @@ class Oh {
9407
9426
  }
9408
9427
  }
9409
9428
  openMore() {
9410
- let { content: e, openStart: t, openEnd: i } = this.unplaced, r = Wi(e, t);
9429
+ let { content: e, openStart: t, openEnd: i } = this.unplaced, r = ji(e, t);
9411
9430
  return !r.childCount || r.firstChild.isLeaf ? !1 : (this.unplaced = new S(e, t + 1, Math.max(i, r.size + t >= e.size - i ? t + 1 : 0)), !0);
9412
9431
  }
9413
9432
  dropNode() {
9414
- let { content: e, openStart: t, openEnd: i } = this.unplaced, r = Wi(e, t);
9433
+ let { content: e, openStart: t, openEnd: i } = this.unplaced, r = ji(e, t);
9415
9434
  if (r.childCount <= 1 && t > 0) {
9416
9435
  let s = e.size - t <= t + r.size;
9417
9436
  this.unplaced = new S(sn(e, t - 1, 1), t - 1, s ? t - 1 : i);
@@ -9452,7 +9471,7 @@ class Oh {
9452
9471
  if (!this.$to.parent.isTextblock)
9453
9472
  return -1;
9454
9473
  let e = this.frontier[this.depth], t;
9455
- if (!e.type.isTextblock || !ji(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
9474
+ if (!e.type.isTextblock || !qi(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
9456
9475
  return -1;
9457
9476
  let { depth: i } = this.$to, r = this.$to.after(i);
9458
9477
  for (; i > 1 && r == this.$to.end(--i); )
@@ -9462,10 +9481,10 @@ class Oh {
9462
9481
  findCloseLevel(e) {
9463
9482
  e:
9464
9483
  for (let t = Math.min(this.depth, e.depth); t >= 0; t--) {
9465
- let { match: i, type: r } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = ji(e, t, r, i, s);
9484
+ let { match: i, type: r } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = qi(e, t, r, i, s);
9466
9485
  if (o) {
9467
9486
  for (let l = t - 1; l >= 0; l--) {
9468
- let { match: a, type: c } = this.frontier[l], d = ji(e, l, c, a, !0);
9487
+ let { match: a, type: c } = this.frontier[l], d = qi(e, l, c, a, !0);
9469
9488
  if (!d || d.childCount)
9470
9489
  continue e;
9471
9490
  }
@@ -9501,7 +9520,7 @@ function sn(n, e, t) {
9501
9520
  function on(n, e, t) {
9502
9521
  return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(on(n.lastChild.content, e - 1, t)));
9503
9522
  }
9504
- function Wi(n, e) {
9523
+ function ji(n, e) {
9505
9524
  for (let t = 0; t < e; t++)
9506
9525
  n = n.firstChild.content;
9507
9526
  return n;
@@ -9512,7 +9531,7 @@ function ka(n, e, t) {
9512
9531
  let i = n.content;
9513
9532
  return e > 1 && (i = i.replaceChild(0, ka(i.firstChild, e - 1, i.childCount == 1 ? t - 1 : 0))), e > 0 && (i = n.type.contentMatch.fillBefore(i).append(i), t <= 0 && (i = i.append(n.type.contentMatch.matchFragment(i).fillBefore(k.empty, !0)))), n.copy(i);
9514
9533
  }
9515
- function ji(n, e, t, i, r) {
9534
+ function qi(n, e, t, i, r) {
9516
9535
  let s = n.node(e), o = r ? n.indexAfter(e) : n.index(e);
9517
9536
  if (o == s.childCount && !t.compatibleContent(s.type))
9518
9537
  return null;
@@ -9747,7 +9766,7 @@ class Ma {
9747
9766
  given `slice`.
9748
9767
  */
9749
9768
  replace(e, t = e, i = S.empty) {
9750
- let r = vi(this.doc, e, t, i);
9769
+ let r = bi(this.doc, e, t, i);
9751
9770
  return r && this.step(r), this;
9752
9771
  }
9753
9772
  /**
@@ -9923,7 +9942,7 @@ class Ma {
9923
9942
  return qr(this, e, t, i), this;
9924
9943
  }
9925
9944
  }
9926
- const qi = /* @__PURE__ */ Object.create(null);
9945
+ const Ui = /* @__PURE__ */ Object.create(null);
9927
9946
  class P {
9928
9947
  /**
9929
9948
  Initialize a selection with the head and anchor and ranges. If no
@@ -10059,7 +10078,7 @@ class P {
10059
10078
  static fromJSON(e, t) {
10060
10079
  if (!t || !t.type)
10061
10080
  throw new RangeError("Invalid input for Selection.fromJSON");
10062
- let i = qi[t.type];
10081
+ let i = Ui[t.type];
10063
10082
  if (!i)
10064
10083
  throw new RangeError("No selection type ".concat(t.type, " defined"));
10065
10084
  return i.fromJSON(e, t);
@@ -10071,9 +10090,9 @@ class P {
10071
10090
  clash with classes from other modules.
10072
10091
  */
10073
10092
  static jsonID(e, t) {
10074
- if (e in qi)
10093
+ if (e in Ui)
10075
10094
  throw new RangeError("Duplicate use of selection JSON ID " + e);
10076
- return qi[e] = t, t.prototype.jsonID = e, t;
10095
+ return Ui[e] = t, t.prototype.jsonID = e, t;
10077
10096
  }
10078
10097
  /**
10079
10098
  Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
@@ -10132,7 +10151,7 @@ class R extends P {
10132
10151
  return e instanceof R && e.anchor == this.anchor && e.head == this.head;
10133
10152
  }
10134
10153
  getBookmark() {
10135
- return new bi(this.anchor, this.head);
10154
+ return new wi(this.anchor, this.head);
10136
10155
  }
10137
10156
  toJSON() {
10138
10157
  return { type: "text", anchor: this.anchor, head: this.head };
@@ -10173,12 +10192,12 @@ class R extends P {
10173
10192
  }
10174
10193
  }
10175
10194
  P.jsonID("text", R);
10176
- class bi {
10195
+ class wi {
10177
10196
  constructor(e, t) {
10178
10197
  this.anchor = e, this.head = t;
10179
10198
  }
10180
10199
  map(e) {
10181
- return new bi(e.map(this.anchor), e.map(this.head));
10200
+ return new wi(e.map(this.anchor), e.map(this.head));
10182
10201
  }
10183
10202
  resolve(e) {
10184
10203
  return R.between(e.resolve(this.anchor), e.resolve(this.head));
@@ -10239,7 +10258,7 @@ class Ur {
10239
10258
  }
10240
10259
  map(e) {
10241
10260
  let { deleted: t, pos: i } = e.mapResult(this.anchor);
10242
- return t ? new bi(i, i) : new Ur(i);
10261
+ return t ? new wi(i, i) : new Ur(i);
10243
10262
  }
10244
10263
  resolve(e) {
10245
10264
  let t = e.resolve(this.anchor), i = t.nodeAfter;
@@ -10512,7 +10531,7 @@ const Fh = [
10512
10531
  }
10513
10532
  })
10514
10533
  ];
10515
- class Ui {
10534
+ class Ji {
10516
10535
  constructor(e, t) {
10517
10536
  this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Fh.slice(), t && t.forEach((i) => {
10518
10537
  if (this.pluginsByKey[i.key])
@@ -10613,7 +10632,7 @@ class Ht {
10613
10632
  Create a new state.
10614
10633
  */
10615
10634
  static create(e) {
10616
- let t = new Ui(e.doc ? e.doc.type.schema : e.schema, e.plugins), i = new Ht(t);
10635
+ let t = new Ji(e.doc ? e.doc.type.schema : e.schema, e.plugins), i = new Ht(t);
10617
10636
  for (let r = 0; r < t.fields.length; r++)
10618
10637
  i[t.fields[r].name] = t.fields[r].init(e, i);
10619
10638
  return i;
@@ -10627,7 +10646,7 @@ class Ht {
10627
10646
  configuration object..
10628
10647
  */
10629
10648
  reconfigure(e) {
10630
- let t = new Ui(this.schema, e.plugins), i = t.fields, r = new Ht(t);
10649
+ let t = new Ji(this.schema, e.plugins), i = t.fields, r = new Ht(t);
10631
10650
  for (let s = 0; s < i.length; s++) {
10632
10651
  let o = i[s].name;
10633
10652
  r[o] = this.hasOwnProperty(o) ? this[o] : i[s].init(e, r);
@@ -10664,7 +10683,7 @@ class Ht {
10664
10683
  throw new RangeError("Invalid input for EditorState.fromJSON");
10665
10684
  if (!e.schema)
10666
10685
  throw new RangeError("Required config field 'schema' missing");
10667
- let r = new Ui(e.schema, e.plugins), s = new Ht(r);
10686
+ let r = new Ji(e.schema, e.plugins), s = new Ht(r);
10668
10687
  return r.fields.forEach((o) => {
10669
10688
  if (o.name == "doc")
10670
10689
  s.doc = st.fromJSON(e.schema, t.doc);
@@ -10707,9 +10726,9 @@ class Y {
10707
10726
  return e[this.key];
10708
10727
  }
10709
10728
  }
10710
- const Ji = /* @__PURE__ */ Object.create(null);
10729
+ const Ki = /* @__PURE__ */ Object.create(null);
10711
10730
  function Ta(n) {
10712
- return n in Ji ? n + "$" + ++Ji[n] : (Ji[n] = 0, n + "$");
10731
+ return n in Ki ? n + "$" + ++Ki[n] : (Ki[n] = 0, n + "$");
10713
10732
  }
10714
10733
  class le {
10715
10734
  /**
@@ -10751,7 +10770,7 @@ const Hh = (n, e, t) => {
10751
10770
  return !0;
10752
10771
  if (i.parent.content.size == 0 && (Xt(s, "end") || E.isSelectable(s)))
10753
10772
  for (let o = i.depth; ; o--) {
10754
- let l = vi(n.doc, i.before(o), i.after(o), S.empty);
10773
+ let l = bi(n.doc, i.before(o), i.after(o), S.empty);
10755
10774
  if (l && l.slice.size < l.to - l.from) {
10756
10775
  if (e) {
10757
10776
  let a = n.tr.step(l);
@@ -10795,7 +10814,7 @@ function Ea(n, e, t) {
10795
10814
  return !1;
10796
10815
  l = d;
10797
10816
  }
10798
- let c = vi(n.doc, s, a, S.empty);
10817
+ let c = bi(n.doc, s, a, S.empty);
10799
10818
  if (!c || c.from != s || c instanceof G && c.slice.size >= a - s)
10800
10819
  return !1;
10801
10820
  if (t) {
@@ -10850,7 +10869,7 @@ const Uh = (n, e, t) => {
10850
10869
  if (Da(n, r, e, 1))
10851
10870
  return !0;
10852
10871
  if (i.parent.content.size == 0 && (Xt(s, "start") || E.isSelectable(s))) {
10853
- let o = vi(n.doc, i.before(), i.after(), S.empty);
10872
+ let o = bi(n.doc, i.before(), i.after(), S.empty);
10854
10873
  if (o && o.slice.size < o.to - o.from) {
10855
10874
  if (e) {
10856
10875
  let l = n.tr.step(o);
@@ -10889,7 +10908,7 @@ const Kh = (n, e) => {
10889
10908
  if (t.node.isTextblock || !Ot(n.doc, t.from))
10890
10909
  return !1;
10891
10910
  r = t.from;
10892
- } else if (r = yi(n.doc, t.from, -1), r == null)
10911
+ } else if (r = vi(n.doc, t.from, -1), r == null)
10893
10912
  return !1;
10894
10913
  if (e) {
10895
10914
  let s = n.tr.join(r);
@@ -10902,7 +10921,7 @@ const Kh = (n, e) => {
10902
10921
  if (t.node.isTextblock || !Ot(n.doc, t.to))
10903
10922
  return !1;
10904
10923
  i = t.to;
10905
- } else if (i = yi(n.doc, t.to, 1), i == null)
10924
+ } else if (i = vi(n.doc, t.to, 1), i == null)
10906
10925
  return !1;
10907
10926
  return e && e(n.tr.join(i).scrollIntoView()), !0;
10908
10927
  }, Xh = (n, e) => {
@@ -11066,7 +11085,7 @@ function af(n, e, t, i = null) {
11066
11085
  if (e.$from.index(e.depth - 1) == 0)
11067
11086
  return !1;
11068
11087
  let a = o.resolve(e.start - 2);
11069
- s = new ti(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new ti(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), r = !0;
11088
+ s = new ni(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new ni(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), r = !0;
11070
11089
  }
11071
11090
  let l = ga(s, t, i, e);
11072
11091
  return l ? (n && cf(n, e, l, r, t), !0) : !1;
@@ -11092,7 +11111,7 @@ function df(n) {
11092
11111
  }
11093
11112
  function uf(n, e, t, i) {
11094
11113
  let r = n.tr, s = i.end, o = i.$to.end(i.depth);
11095
- s < o && (r.step(new ee(s - 1, o, s, o, new S(k.from(t.create(null, i.parent.copy())), 1, 0), 1, !0)), i = new ti(r.doc.resolve(i.$from.pos), r.doc.resolve(o), i.depth));
11114
+ s < o && (r.step(new ee(s - 1, o, s, o, new S(k.from(t.create(null, i.parent.copy())), 1, 0), 1, !0)), i = new ni(r.doc.resolve(i.$from.pos), r.doc.resolve(o), i.depth));
11096
11115
  const l = nn(i);
11097
11116
  if (l == null)
11098
11117
  return !1;
@@ -11217,7 +11236,7 @@ function Tn(n) {
11217
11236
  ;
11218
11237
  return e && e.node && e.node.isBlock && (e.dom == n || e.contentDOM == n);
11219
11238
  }
11220
- const wi = function(n) {
11239
+ const Ci = function(n) {
11221
11240
  return n.focusNode && Tt(n.focusNode, n.focusOffset, n.anchorNode, n.anchorOffset);
11222
11241
  };
11223
11242
  function gt(n, e) {
@@ -11485,14 +11504,14 @@ function Va(n, e, t) {
11485
11504
  if (s == null && r && (t < 0 || r == Se(i))) {
11486
11505
  let a = i.childNodes[r - 1];
11487
11506
  if (a.nodeType == 1)
11488
- return Ki(a.getBoundingClientRect(), !1);
11507
+ return Yi(a.getBoundingClientRect(), !1);
11489
11508
  }
11490
11509
  if (s == null && r < Se(i)) {
11491
11510
  let a = i.childNodes[r];
11492
11511
  if (a.nodeType == 1)
11493
- return Ki(a.getBoundingClientRect(), !0);
11512
+ return Yi(a.getBoundingClientRect(), !0);
11494
11513
  }
11495
- return Ki(i.getBoundingClientRect(), t >= 0);
11514
+ return Yi(i.getBoundingClientRect(), t >= 0);
11496
11515
  }
11497
11516
  if (s == null && r && (t < 0 || r == Se(i))) {
11498
11517
  let a = i.childNodes[r - 1], c = a.nodeType == 3 ? He(a, Se(a) - (o ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
@@ -11515,7 +11534,7 @@ function rn(n, e) {
11515
11534
  let t = e ? n.left : n.right;
11516
11535
  return { top: n.top, bottom: n.bottom, left: t, right: t };
11517
11536
  }
11518
- function Ki(n, e) {
11537
+ function Yi(n, e) {
11519
11538
  if (n.height == 0)
11520
11539
  return n;
11521
11540
  let t = e ? n.top : n.bottom;
@@ -12052,7 +12071,7 @@ class lt extends En {
12052
12071
  d || ({ dom: d, contentDOM: u } = At.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
12053
12072
  !u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
12054
12073
  let h = d;
12055
- return d = Ja(d, i, t), c ? a = new Lf(e, t, i, r, d, u || null, h, c, s, o + 1) : t.isText ? new Ci(e, t, i, r, d, h, s) : new lt(e, t, i, r, d, u || null, h, s, o + 1);
12074
+ return d = Ja(d, i, t), c ? a = new Lf(e, t, i, r, d, u || null, h, c, s, o + 1) : t.isText ? new ki(e, t, i, r, d, h, s) : new lt(e, t, i, r, d, u || null, h, s, o + 1);
12056
12075
  }
12057
12076
  parseRule() {
12058
12077
  if (this.node.type.spec.reparseInView)
@@ -12075,7 +12094,7 @@ class lt extends En {
12075
12094
  return e;
12076
12095
  }
12077
12096
  matchesNode(e, t, i) {
12078
- return this.dirty == Ne && e.eq(this.node) && ii(t, this.outerDeco) && i.eq(this.innerDeco);
12097
+ return this.dirty == Ne && e.eq(this.node) && ri(t, this.outerDeco) && i.eq(this.innerDeco);
12079
12098
  }
12080
12099
  get size() {
12081
12100
  return this.node.nodeSize;
@@ -12133,7 +12152,7 @@ class lt extends En {
12133
12152
  this.updateOuterDeco(t), this.node = e, this.innerDeco = i, this.contentDOM && this.updateChildren(r, this.posAtStart), this.dirty = Ne;
12134
12153
  }
12135
12154
  updateOuterDeco(e) {
12136
- if (ii(e, this.outerDeco))
12155
+ if (ri(e, this.outerDeco))
12137
12156
  return;
12138
12157
  let t = this.nodeDOM.nodeType != 1, i = this.dom;
12139
12158
  this.dom = Ua(this.dom, this.nodeDOM, Nr(this.outerDeco, this.node, t), Nr(e, this.node, t)), this.dom != i && (i.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
@@ -12155,7 +12174,7 @@ function Co(n, e, t, i, r) {
12155
12174
  let s = new lt(void 0, n, e, t, i, i, i, r, 0);
12156
12175
  return s.contentDOM && s.updateChildren(r, 0), s;
12157
12176
  }
12158
- class Ci extends lt {
12177
+ class ki extends lt {
12159
12178
  constructor(e, t, i, r, s, o, l) {
12160
12179
  super(e, t, i, r, s, null, o, l, 0);
12161
12180
  }
@@ -12186,7 +12205,7 @@ class Ci extends lt {
12186
12205
  }
12187
12206
  slice(e, t, i) {
12188
12207
  let r = this.node.cut(e, t), s = document.createTextNode(r.text);
12189
- return new Ci(this.parent, r, this.outerDeco, this.innerDeco, s, s, i);
12208
+ return new ki(this.parent, r, this.outerDeco, this.innerDeco, s, s, i);
12190
12209
  }
12191
12210
  markDirty(e, t) {
12192
12211
  super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Be);
@@ -12326,7 +12345,7 @@ function Bf(n, e, t) {
12326
12345
  function Ja(n, e, t) {
12327
12346
  return Ua(n, n, vt, Nr(e, t, n.nodeType != 1));
12328
12347
  }
12329
- function ii(n, e) {
12348
+ function ri(n, e) {
12330
12349
  if (n.length != e.length)
12331
12350
  return !1;
12332
12351
  for (let t = 0; t < n.length; t++)
@@ -12428,7 +12447,7 @@ class Ff {
12428
12447
  let c = this.preMatch.matched.get(a);
12429
12448
  if (c != null && c != s)
12430
12449
  return !1;
12431
- let d = a.dom, u, h = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != Be && ii(t, a.outerDeco));
12450
+ let d = a.dom, u, h = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != Be && ri(t, a.outerDeco));
12432
12451
  if (!h && a.update(e, t, i, r))
12433
12452
  return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
12434
12453
  if (!h && (u = this.recreateWrapper(a, e, t, i, r, o)))
@@ -12441,7 +12460,7 @@ class Ff {
12441
12460
  // When a node with content is replaced by a different node with
12442
12461
  // identical content, move over its children.
12443
12462
  recreateWrapper(e, t, i, r, s, o) {
12444
- if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !ii(i, e.outerDeco) || !r.eq(e.innerDeco))
12463
+ if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !ri(i, e.outerDeco) || !r.eq(e.innerDeco))
12445
12464
  return null;
12446
12465
  let l = lt.create(this.top, t, i, r, s, o);
12447
12466
  if (l.contentDOM) {
@@ -12472,7 +12491,7 @@ class Ff {
12472
12491
  for (; e instanceof Nt; )
12473
12492
  t = e, e = t.children[t.children.length - 1];
12474
12493
  (!e || // Empty textblock
12475
- !(e instanceof Ci) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((ce || Z) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
12494
+ !(e instanceof ki) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((ce || Z) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
12476
12495
  }
12477
12496
  addHackNode(e, t) {
12478
12497
  if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))
@@ -12613,7 +12632,7 @@ function Xr(n, e = null) {
12613
12632
  if (o < 0)
12614
12633
  return null;
12615
12634
  let l = i.resolve(o), a, c;
12616
- if (wi(t)) {
12635
+ if (Ci(t)) {
12617
12636
  for (a = o; r && !r.node; )
12618
12637
  r = r.parent;
12619
12638
  let u = r.node;
@@ -12669,15 +12688,15 @@ const xo = ce || Z && Pa < 63;
12669
12688
  function So(n, e) {
12670
12689
  let { node: t, offset: i } = n.docView.domFromPos(e, 0), r = i < t.childNodes.length ? t.childNodes[i] : null, s = i ? t.childNodes[i - 1] : null;
12671
12690
  if (ce && r && r.contentEditable == "false")
12672
- return Yi(r);
12691
+ return Xi(r);
12673
12692
  if ((!r || r.contentEditable == "false") && (!s || s.contentEditable == "false")) {
12674
12693
  if (r)
12675
- return Yi(r);
12694
+ return Xi(r);
12676
12695
  if (s)
12677
- return Yi(s);
12696
+ return Xi(s);
12678
12697
  }
12679
12698
  }
12680
- function Yi(n) {
12699
+ function Xi(n) {
12681
12700
  return n.contentEditable = "true", ce && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
12682
12701
  }
12683
12702
  function Mo(n) {
@@ -12768,7 +12787,7 @@ function No(n, e, t) {
12768
12787
  }
12769
12788
  }
12770
12789
  }
12771
- function ri(n) {
12790
+ function si(n) {
12772
12791
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
12773
12792
  }
12774
12793
  function pn(n, e) {
@@ -12783,7 +12802,7 @@ function Yf(n) {
12783
12802
  if (!t)
12784
12803
  return;
12785
12804
  let r, s, o = !1;
12786
- for (Te && t.nodeType == 1 && i < ri(t) && pn(t.childNodes[i], -1) && (o = !0); ; )
12805
+ for (Te && t.nodeType == 1 && i < si(t) && pn(t.childNodes[i], -1) && (o = !0); ; )
12787
12806
  if (i > 0) {
12788
12807
  if (t.nodeType != 1)
12789
12808
  break;
@@ -12804,7 +12823,7 @@ function Yf(n) {
12804
12823
  for (; l && pn(l, -1); )
12805
12824
  r = t.parentNode, s = re(l), l = l.previousSibling;
12806
12825
  if (l)
12807
- t = l, i = ri(t);
12826
+ t = l, i = si(t);
12808
12827
  else {
12809
12828
  if (t = t.parentNode, t == n.dom)
12810
12829
  break;
@@ -12818,7 +12837,7 @@ function Xf(n) {
12818
12837
  let e = n.domSelectionRange(), t = e.focusNode, i = e.focusOffset;
12819
12838
  if (!t)
12820
12839
  return;
12821
- let r = ri(t), s, o;
12840
+ let r = si(t), s, o;
12822
12841
  for (; ; )
12823
12842
  if (i < r) {
12824
12843
  if (t.nodeType != 1)
@@ -12836,7 +12855,7 @@ function Xf(n) {
12836
12855
  for (; l && pn(l, 1); )
12837
12856
  s = l.parentNode, o = re(l) + 1, l = l.nextSibling;
12838
12857
  if (l)
12839
- t = l, i = 0, r = ri(t);
12858
+ t = l, i = 0, r = si(t);
12840
12859
  else {
12841
12860
  if (t = t.parentNode, t == n.dom)
12842
12861
  break;
@@ -12882,7 +12901,7 @@ function Or(n, e, t) {
12882
12901
  let i = n.domSelection();
12883
12902
  if (!i)
12884
12903
  return;
12885
- if (wi(i)) {
12904
+ if (Ci(i)) {
12886
12905
  let s = document.createRange();
12887
12906
  s.setEnd(e, t), s.setStart(e, t), i.removeAllRanges(), i.addRange(s);
12888
12907
  } else
@@ -13132,10 +13151,10 @@ let Ro = null;
13132
13151
  function ic() {
13133
13152
  return Ro || (Ro = document.implementation.createHTMLDocument("title"));
13134
13153
  }
13135
- let Xi = null;
13154
+ let Gi = null;
13136
13155
  function rp(n) {
13137
13156
  let e = window.trustedTypes;
13138
- return e ? (Xi || (Xi = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), Xi.createHTML(n)) : n;
13157
+ return e ? (Gi || (Gi = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), Gi.createHTML(n)) : n;
13139
13158
  }
13140
13159
  function sp(n) {
13141
13160
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
@@ -13248,7 +13267,7 @@ me.keypress = (n, e) => {
13248
13267
  !/[\r\n]/.test(r) && !n.someProp("handleTextInput", (o) => o(n, i.$from.pos, i.$to.pos, r, s)) && n.dispatch(s()), t.preventDefault();
13249
13268
  }
13250
13269
  };
13251
- function ki(n) {
13270
+ function xi(n) {
13252
13271
  return { left: n.clientX, top: n.clientY };
13253
13272
  }
13254
13273
  function pp(n, e) {
@@ -13319,7 +13338,7 @@ function wp(n, e, t) {
13319
13338
  }
13320
13339
  }
13321
13340
  function ts(n) {
13322
- return si(n);
13341
+ return oi(n);
13323
13342
  }
13324
13343
  const rc = xe ? "metaKey" : "ctrlKey";
13325
13344
  pe.mousedown = (n, e) => {
@@ -13327,7 +13346,7 @@ pe.mousedown = (n, e) => {
13327
13346
  n.input.shiftKey = t.shiftKey;
13328
13347
  let i = ts(n), r = Date.now(), s = "singleClick";
13329
13348
  r - n.input.lastClick.time < 500 && pp(t, n.input.lastClick) && !t[rc] && n.input.lastClick.button == t.button && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: r, x: t.clientX, y: t.clientY, type: s, button: t.button };
13330
- let o = n.posAtCoords(ki(t));
13349
+ let o = n.posAtCoords(xi(t));
13331
13350
  o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Cp(n, o, t, !!i)) : (s == "doubleClick" ? vp : bp)(n, o.pos, o.inside, t) ? t.preventDefault() : rt(n, "pointer"));
13332
13351
  };
13333
13352
  class Cp {
@@ -13359,7 +13378,7 @@ class Cp {
13359
13378
  if (this.done(), !this.view.dom.contains(e.target))
13360
13379
  return;
13361
13380
  let t = this.pos;
13362
- this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(ki(e))), this.updateAllowDefault(e), this.allowDefault || !t ? rt(this.view, "pointer") : yp(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
13381
+ this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(xi(e))), this.updateAllowDefault(e), this.allowDefault || !t ? rt(this.view, "pointer") : yp(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
13363
13382
  ce && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
13364
13383
  // cursor, but still report that the node is selected
13365
13384
  // when asked through getSelection. You'll then get a
@@ -13392,8 +13411,8 @@ me.compositionstart = me.compositionupdate = (n) => {
13392
13411
  n.domObserver.flush();
13393
13412
  let { state: e } = n, t = e.selection.$to;
13394
13413
  if (e.selection instanceof R && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((i) => i.type.spec.inclusive === !1) || Z && za && xp(n)))
13395
- n.markCursor = n.state.storedMarks || t.marks(), si(n, !0), n.markCursor = null;
13396
- else if (si(n, !e.selection.empty), Te && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
13414
+ n.markCursor = n.state.storedMarks || t.marks(), oi(n, !0), n.markCursor = null;
13415
+ else if (oi(n, !e.selection.empty), Te && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
13397
13416
  let i = n.domSelectionRange();
13398
13417
  for (let r = i.focusNode, s = i.focusOffset; r && r.nodeType == 1 && s != 0; ) {
13399
13418
  let o = s < 0 ? r.lastChild : r.childNodes[s - 1];
@@ -13422,7 +13441,7 @@ me.compositionend = (n, e) => {
13422
13441
  n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, oc(n, 20));
13423
13442
  };
13424
13443
  function oc(n, e) {
13425
- clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => si(n), e));
13444
+ clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => oi(n), e));
13426
13445
  }
13427
13446
  function lc(n) {
13428
13447
  for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Mp()); n.input.compositionNodes.length > 0; )
@@ -13451,7 +13470,7 @@ function Mp() {
13451
13470
  let n = document.createEvent("Event");
13452
13471
  return n.initEvent("event", !0, !0), n.timeStamp;
13453
13472
  }
13454
- function si(n, e = !1) {
13473
+ function oi(n, e = !1) {
13455
13474
  if (!(Ue && n.domObserver.flushingSoon >= 0)) {
13456
13475
  if (n.domObserver.forceFlush(), lc(n), e || n.docView && n.docView.dirty) {
13457
13476
  let t = Xr(n), i = n.state.selection;
@@ -13528,7 +13547,7 @@ pe.dragstart = (n, e) => {
13528
13547
  let t = e, i = n.input.mouseDown;
13529
13548
  if (i && i.done(), !t.dataTransfer)
13530
13549
  return;
13531
- let r = n.state.selection, s = r.empty ? null : n.posAtCoords(ki(t)), o;
13550
+ let r = n.state.selection, s = r.empty ? null : n.posAtCoords(xi(t)), o;
13532
13551
  if (!(s && s.pos >= r.from && s.pos <= (r instanceof E ? r.to - 1 : r.to))) {
13533
13552
  if (i && i.mightDrag)
13534
13553
  o = E.create(n.state.doc, i.mightDrag.pos);
@@ -13557,7 +13576,7 @@ me.drop = (n, e) => {
13557
13576
  function Ap(n, e, t) {
13558
13577
  if (!e.dataTransfer)
13559
13578
  return;
13560
- let i = n.posAtCoords(ki(e));
13579
+ let i = n.posAtCoords(xi(e));
13561
13580
  if (!i)
13562
13581
  return;
13563
13582
  let r = n.state.doc.resolve(i.pos), s = t && t.slice;
@@ -13625,7 +13644,7 @@ function xn(n, e) {
13625
13644
  return !1;
13626
13645
  return !0;
13627
13646
  }
13628
- class oi {
13647
+ class li {
13629
13648
  constructor(e, t) {
13630
13649
  this.toDOM = e, this.spec = t || kt, this.side = this.spec.side || 0;
13631
13650
  }
@@ -13637,7 +13656,7 @@ class oi {
13637
13656
  return !0;
13638
13657
  }
13639
13658
  eq(e) {
13640
- return this == e || e instanceof oi && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && xn(this.spec, e.spec));
13659
+ return this == e || e instanceof li && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && xn(this.spec, e.spec));
13641
13660
  }
13642
13661
  destroy(e) {
13643
13662
  this.spec.destroy && this.spec.destroy(e);
@@ -13718,7 +13737,7 @@ class fe {
13718
13737
  widget's current document position.
13719
13738
  */
13720
13739
  static widget(e, t, i) {
13721
- return new fe(e, e, new oi(t, i));
13740
+ return new fe(e, e, new li(t, i));
13722
13741
  }
13723
13742
  /**
13724
13743
  Creates an inline decoration, which adds the given attributes to
@@ -13752,7 +13771,7 @@ class fe {
13752
13771
  @internal
13753
13772
  */
13754
13773
  get widget() {
13755
- return this.type instanceof oi;
13774
+ return this.type instanceof li;
13756
13775
  }
13757
13776
  }
13758
13777
  const Ft = [], kt = {};
@@ -13769,7 +13788,7 @@ class H {
13769
13788
  you must make a copy if you want need to preserve that.
13770
13789
  */
13771
13790
  static create(e, t) {
13772
- return t.length ? li(t, e, 0, kt) : ae;
13791
+ return t.length ? ai(t, e, 0, kt) : ae;
13773
13792
  }
13774
13793
  /**
13775
13794
  Find all decorations in this set which touch the given range
@@ -13828,7 +13847,7 @@ class H {
13828
13847
  if (d = hc(t, l, c)) {
13829
13848
  for (r || (r = this.children.slice()); s < r.length && r[s] < a; )
13830
13849
  s += 3;
13831
- r[s] == a ? r[s + 2] = r[s + 2].addInner(l, d, c + 1) : r.splice(s, 0, a, a + l.nodeSize, li(d, l, c + 1, kt)), s += 3;
13850
+ r[s] == a ? r[s + 2] = r[s + 2].addInner(l, d, c + 1) : r.splice(s, 0, a, a + l.nodeSize, ai(d, l, c + 1, kt)), s += 3;
13832
13851
  }
13833
13852
  });
13834
13853
  let o = uc(s ? fc(t) : t, -i);
@@ -14024,7 +14043,7 @@ function Op(n, e, t, i, r, s, o) {
14024
14043
  a = !0;
14025
14044
  }
14026
14045
  if (a) {
14027
- let c = Dp(l, n, e, t, r, s, o), d = li(c, i, 0, o);
14046
+ let c = Dp(l, n, e, t, r, s, o), d = ai(c, i, 0, o);
14028
14047
  e = d.local;
14029
14048
  for (let u = 0; u < l.length; u += 3)
14030
14049
  l[u + 1] < 0 && (l.splice(u, 3), u -= 3);
@@ -14074,13 +14093,13 @@ function fc(n) {
14074
14093
  n[t] != null && e.push(n[t]);
14075
14094
  return e;
14076
14095
  }
14077
- function li(n, e, t, i) {
14096
+ function ai(n, e, t, i) {
14078
14097
  let r = [], s = !1;
14079
14098
  e.forEach((l, a) => {
14080
14099
  let c = hc(n, l, a + t);
14081
14100
  if (c) {
14082
14101
  s = !0;
14083
- let d = li(c, l, t + a + 1, i);
14102
+ let d = ai(c, l, t + a + 1, i);
14084
14103
  d != ae && r.push(a, a + l.nodeSize, d);
14085
14104
  }
14086
14105
  });
@@ -14115,7 +14134,7 @@ function Po(n, e, t) {
14115
14134
  e++;
14116
14135
  n.splice(e, 0, t);
14117
14136
  }
14118
- function Gi(n) {
14137
+ function Zi(n) {
14119
14138
  let e = [];
14120
14139
  return n.someProp("decorations", (t) => {
14121
14140
  let i = t(n.state);
@@ -14257,7 +14276,7 @@ class zp {
14257
14276
  }
14258
14277
  }
14259
14278
  let c = null;
14260
- s < 0 && r && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && wi(i) && (c = Xr(e)) && c.eq(P.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Ke(e), this.currentSelection.set(i), e.scrollToSelection()) : (s > -1 || r) && (s > -1 && (e.docView.markDirty(s, o), $p(e)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(i) || Ke(e), this.currentSelection.set(i));
14279
+ s < 0 && r && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Ci(i) && (c = Xr(e)) && c.eq(P.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Ke(e), this.currentSelection.set(i), e.scrollToSelection()) : (s > -1 || r) && (s > -1 && (e.docView.markDirty(s, o), $p(e)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(i) || Ke(e), this.currentSelection.set(i));
14261
14280
  }
14262
14281
  registerMutation(e, t) {
14263
14282
  if (t.indexOf(e.target) > -1)
@@ -14327,7 +14346,7 @@ function Bp(n, e) {
14327
14346
  }
14328
14347
  function Fp(n, e, t) {
14329
14348
  let { node: i, fromOffset: r, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
14330
- if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], wi(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), Z && n.input.lastKeyCode === 8)
14349
+ if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], Ci(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), Z && n.input.lastKeyCode === 8)
14331
14350
  for (let g = s; g > r; g--) {
14332
14351
  let v = i.childNodes[g - 1], b = v.pmViewDesc;
14333
14352
  if (v.nodeName == "BR" && !b) {
@@ -14470,7 +14489,7 @@ function qp(n, e, t, i, r) {
14470
14489
  if (
14471
14490
  // The content must have shrunk
14472
14491
  t - e <= r.pos - i.pos || // newEnd must point directly at or after the end of the block that newStart points into
14473
- Zi(i, !0, !1) < r.pos
14492
+ Qi(i, !0, !1) < r.pos
14474
14493
  )
14475
14494
  return !1;
14476
14495
  let s = n.resolve(e);
@@ -14480,10 +14499,10 @@ function qp(n, e, t, i, r) {
14480
14499
  }
14481
14500
  if (s.parentOffset < s.parent.content.size || !s.parent.isTextblock)
14482
14501
  return !1;
14483
- let o = n.resolve(Zi(s, !0, !0));
14484
- return !o.parent.isTextblock || o.pos > t || Zi(o, !0, !1) < t ? !1 : i.parent.content.cut(i.parentOffset).eq(o.parent.content);
14502
+ let o = n.resolve(Qi(s, !0, !0));
14503
+ return !o.parent.isTextblock || o.pos > t || Qi(o, !0, !1) < t ? !1 : i.parent.content.cut(i.parentOffset).eq(o.parent.content);
14485
14504
  }
14486
- function Zi(n, e, t) {
14505
+ function Qi(n, e, t) {
14487
14506
  let i = n.depth, r = e ? n.end() : n.pos;
14488
14507
  for (; i > 0 && (e || n.indexAfter(i) == n.node(i).childCount); )
14489
14508
  i--, r++, e = !1;
@@ -14527,7 +14546,7 @@ class pc {
14527
14546
  added to the document.
14528
14547
  */
14529
14548
  constructor(e, t) {
14530
- this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new cp(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(qo), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Wo(this), Ho(this), this.nodeViews = jo(this), this.docView = Co(this.state.doc, Vo(this), Gi(this), this.dom, this), this.domObserver = new zp(this, (i, r, s, o) => Wp(this, i, r, s, o)), this.domObserver.start(), dp(this), this.updatePluginViews();
14549
+ this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new cp(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(qo), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Wo(this), Ho(this), this.nodeViews = jo(this), this.docView = Co(this.state.doc, Vo(this), Zi(this), this.dom, this), this.domObserver = new zp(this, (i, r, s, o) => Wp(this, i, r, s, o)), this.domObserver.start(), dp(this), this.updatePluginViews();
14531
14550
  }
14532
14551
  /**
14533
14552
  Holds `true` when a
@@ -14590,7 +14609,7 @@ class pc {
14590
14609
  Kp(f, this.nodeViews) && (this.nodeViews = f, s = !0);
14591
14610
  }
14592
14611
  (l || t.handleDOMEvents != this._props.handleDOMEvents) && Ir(this), this.editable = Wo(this), Ho(this);
14593
- let a = Gi(this), c = Vo(this), d = r.plugins != e.plugins && !r.doc.eq(e.doc) ? "reset" : e.scrollToSelection > r.scrollToSelection ? "to selection" : "preserve", u = s || !this.docView.matchesNode(e.doc, c, a);
14612
+ let a = Zi(this), c = Vo(this), d = r.plugins != e.plugins && !r.doc.eq(e.doc) ? "reset" : e.scrollToSelection > r.scrollToSelection ? "to selection" : "preserve", u = s || !this.docView.matchesNode(e.doc, c, a);
14594
14613
  (u || !e.selection.eq(r.selection)) && (o = !0);
14595
14614
  let h = d == "preserve" && o && this.dom.style.overflowAnchor == null && Sf(this);
14596
14615
  if (o) {
@@ -14821,7 +14840,7 @@ class pc {
14821
14840
  views](https://prosemirror.net/docs/ref/#view.NodeView).
14822
14841
  */
14823
14842
  destroy() {
14824
- this.docView && (up(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], Gi(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, pf());
14843
+ this.docView && (up(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], Zi(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, pf());
14825
14844
  }
14826
14845
  /**
14827
14846
  This is true when the view has been
@@ -14953,7 +14972,7 @@ var ct = {
14953
14972
  220: "\\",
14954
14973
  221: "]",
14955
14974
  222: "'"
14956
- }, ai = {
14975
+ }, ci = {
14957
14976
  48: ")",
14958
14977
  49: "!",
14959
14978
  50: "@",
@@ -14984,11 +15003,11 @@ for (var se = 0; se < 10; se++)
14984
15003
  for (var se = 1; se <= 24; se++)
14985
15004
  ct[se + 111] = "F" + se;
14986
15005
  for (var se = 65; se <= 90; se++)
14987
- ct[se] = String.fromCharCode(se + 32), ai[se] = String.fromCharCode(se);
14988
- for (var Qi in ct)
14989
- ai.hasOwnProperty(Qi) || (ai[Qi] = ct[Qi]);
15006
+ ct[se] = String.fromCharCode(se + 32), ci[se] = String.fromCharCode(se);
15007
+ for (var er in ct)
15008
+ ci.hasOwnProperty(er) || (ci[er] = ct[er]);
14990
15009
  function Gp(n) {
14991
- var e = Yp && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || Xp && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? ai : ct)[n.keyCode] || n.key || "Unidentified";
15010
+ var e = Yp && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || Xp && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? ci : ct)[n.keyCode] || n.key || "Unidentified";
14992
15011
  return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
14993
15012
  }
14994
15013
  const Zp = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), Qp = typeof navigator < "u" && /Win/.test(navigator.platform);
@@ -15019,7 +15038,7 @@ function tm(n) {
15019
15038
  e[em(t)] = n[t];
15020
15039
  return e;
15021
15040
  }
15022
- function er(n, e, t = !0) {
15041
+ function tr(n, e, t = !0) {
15023
15042
  return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
15024
15043
  }
15025
15044
  function nm(n) {
@@ -15028,18 +15047,18 @@ function nm(n) {
15028
15047
  function mc(n) {
15029
15048
  let e = tm(n);
15030
15049
  return function(t, i) {
15031
- let r = Gp(i), s, o = e[er(r, i)];
15050
+ let r = Gp(i), s, o = e[tr(r, i)];
15032
15051
  if (o && o(t.state, t.dispatch, t))
15033
15052
  return !0;
15034
15053
  if (r.length == 1 && r != " ") {
15035
15054
  if (i.shiftKey) {
15036
- let l = e[er(r, i, !1)];
15055
+ let l = e[tr(r, i, !1)];
15037
15056
  if (l && l(t.state, t.dispatch, t))
15038
15057
  return !0;
15039
15058
  }
15040
15059
  if ((i.altKey || i.metaKey || i.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
15041
15060
  !(Qp && i.ctrlKey && i.altKey) && (s = ct[i.keyCode]) && s != r) {
15042
- let l = e[er(s, i)];
15061
+ let l = e[tr(s, i)];
15043
15062
  if (l && l(t.state, t.dispatch, t))
15044
15063
  return !0;
15045
15064
  }
@@ -15051,7 +15070,7 @@ var im = Object.defineProperty, rs = (n, e) => {
15051
15070
  for (var t in e)
15052
15071
  im(n, t, { get: e[t], enumerable: !0 });
15053
15072
  };
15054
- function xi(n) {
15073
+ function Si(n) {
15055
15074
  const { state: e, transaction: t } = n;
15056
15075
  let { selection: i } = t, { doc: r } = t, { storedMarks: s } = t;
15057
15076
  return {
@@ -15076,7 +15095,7 @@ function xi(n) {
15076
15095
  }
15077
15096
  };
15078
15097
  }
15079
- var Si = class {
15098
+ var Mi = class {
15080
15099
  constructor(n) {
15081
15100
  this.editor = n.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = n.state;
15082
15101
  }
@@ -15127,7 +15146,7 @@ var Si = class {
15127
15146
  tr: n,
15128
15147
  editor: i,
15129
15148
  view: s,
15130
- state: xi({
15149
+ state: Si({
15131
15150
  state: r,
15132
15151
  transaction: n
15133
15152
  }),
@@ -15272,12 +15291,12 @@ var um = (n) => ({ tr: e, state: t, dispatch: i }) => {
15272
15291
  function ss(n) {
15273
15292
  return Object.prototype.toString.call(n) === "[object RegExp]";
15274
15293
  }
15275
- function ci(n, e, t = { strict: !0 }) {
15294
+ function di(n, e, t = { strict: !0 }) {
15276
15295
  const i = Object.keys(e);
15277
15296
  return i.length ? i.every((r) => t.strict ? e[r] === n[r] : ss(e[r]) ? e[r].test(n[r]) : e[r] === n[r]) : !0;
15278
15297
  }
15279
15298
  function yc(n, e, t = {}) {
15280
- return n.find((i) => i.type === e && ci(
15299
+ return n.find((i) => i.type === e && di(
15281
15300
  // Only check equality for the attributes that are provided
15282
15301
  Object.fromEntries(Object.keys(t).map((r) => [r, i.attrs[r]])),
15283
15302
  t
@@ -15515,14 +15534,14 @@ var xm = (n) => !("type" in n), Sm = (n, e, t) => ({ tr: i, dispatch: r, editor:
15515
15534
  return !0;
15516
15535
  }, Mm = () => ({ state: n, dispatch: e }) => Kh(n, e), _m = () => ({ state: n, dispatch: e }) => Yh(n, e), Tm = () => ({ state: n, dispatch: e }) => Hh(n, e), Nm = () => ({ state: n, dispatch: e }) => Uh(n, e), Em = () => ({ state: n, dispatch: e, tr: t }) => {
15517
15536
  try {
15518
- const i = yi(n.doc, n.selection.$from.pos, -1);
15537
+ const i = vi(n.doc, n.selection.$from.pos, -1);
15519
15538
  return i == null ? !1 : (t.join(i, 2), e && e(t), !0);
15520
15539
  } catch (i) {
15521
15540
  return !1;
15522
15541
  }
15523
15542
  }, Am = () => ({ state: n, dispatch: e, tr: t }) => {
15524
15543
  try {
15525
- const i = yi(n.doc, n.selection.$from.pos, 1);
15544
+ const i = vi(n.doc, n.selection.$from.pos, 1);
15526
15545
  return i == null ? !1 : (t.join(i, 2), e && e(t), !0);
15527
15546
  } catch (i) {
15528
15547
  return !1;
@@ -15582,7 +15601,7 @@ function Mn(n, e, t = {}) {
15582
15601
  to: p
15583
15602
  });
15584
15603
  });
15585
- const a = r - i, c = l.filter((u) => o ? o.name === u.node.type.name : !0).filter((u) => ci(u.node.attrs, t, { strict: !1 }));
15604
+ const a = r - i, c = l.filter((u) => o ? o.name === u.node.type.name : !0).filter((u) => di(u.node.attrs, t, { strict: !1 }));
15586
15605
  return s ? !!c.length : c.reduce((u, h) => u + h.to - h.from, 0) >= a;
15587
15606
  }
15588
15607
  var Pm = (n, e = {}) => ({ state: t, dispatch: i }) => {
@@ -15592,7 +15611,7 @@ var Pm = (n, e = {}) => ({ state: t, dispatch: i }) => {
15592
15611
  const i = ne(n, e.schema);
15593
15612
  return df(i)(e, t);
15594
15613
  }, Lm = () => ({ state: n, dispatch: e }) => Gh(n, e);
15595
- function Mi(n, e) {
15614
+ function _i(n, e) {
15596
15615
  return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
15597
15616
  }
15598
15617
  function Jo(n, e) {
@@ -15601,7 +15620,7 @@ function Jo(n, e) {
15601
15620
  }
15602
15621
  var Bm = (n, e) => ({ tr: t, state: i, dispatch: r }) => {
15603
15622
  let s = null, o = null;
15604
- const l = Mi(
15623
+ const l = _i(
15605
15624
  typeof n == "string" ? n : n.name,
15606
15625
  i.schema
15607
15626
  );
@@ -15807,7 +15826,7 @@ function us(...n) {
15807
15826
  }), i;
15808
15827
  }, {});
15809
15828
  }
15810
- function di(n, e) {
15829
+ function ui(n, e) {
15811
15830
  return e.filter((t) => t.type === n.type.name).filter((t) => t.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(n.attrs) || {} : {
15812
15831
  [t.name]: n.attrs[t.name]
15813
15832
  }).reduce((t, i) => us(t, i), {});
@@ -15883,7 +15902,7 @@ function Qm(n, e) {
15883
15902
  const y = T(c, "renderHTML", u);
15884
15903
  y && (f.toDOM = (v) => y({
15885
15904
  node: v,
15886
- HTMLAttributes: di(v, d)
15905
+ HTMLAttributes: ui(v, d)
15887
15906
  }));
15888
15907
  const g = T(c, "renderText", u);
15889
15908
  return g && (f.toText = g), [c.name, f];
@@ -15916,7 +15935,7 @@ function Qm(n, e) {
15916
15935
  const y = T(c, "renderHTML", u);
15917
15936
  return y && (f.toDOM = (g) => y({
15918
15937
  mark: g,
15919
- HTMLAttributes: di(g, d)
15938
+ HTMLAttributes: ui(g, d)
15920
15939
  })), [c.name, f];
15921
15940
  })
15922
15941
  );
@@ -15981,7 +16000,7 @@ function n0(n, e) {
15981
16000
  return o ? { ...o.attrs } : {};
15982
16001
  }
15983
16002
  function i0(n, e) {
15984
- const t = Mi(
16003
+ const t = _i(
15985
16004
  typeof e == "string" ? e : e.name,
15986
16005
  n.schema
15987
16006
  );
@@ -16027,10 +16046,10 @@ function o0(n) {
16027
16046
  });
16028
16047
  }), s0(i);
16029
16048
  }
16030
- function tr(n, e) {
16049
+ function nr(n, e) {
16031
16050
  return e.nodes[n] || e.marks[n] || null;
16032
16051
  }
16033
- function Un(n, e, t) {
16052
+ function Jn(n, e, t) {
16034
16053
  return Object.fromEntries(
16035
16054
  Object.entries(t).filter(([i]) => {
16036
16055
  const r = n.find((s) => s.type === e && s.name === i);
@@ -16055,7 +16074,7 @@ var l0 = (n, e = 500) => {
16055
16074
  function Pr(n, e, t = {}) {
16056
16075
  const { empty: i, ranges: r } = n.selection, s = e ? Ye(e, n.schema) : null;
16057
16076
  if (i)
16058
- return !!(n.storedMarks || n.selection.$from.marks()).filter((u) => s ? s.name === u.type.name : !0).find((u) => ci(u.attrs, t, { strict: !1 }));
16077
+ return !!(n.storedMarks || n.selection.$from.marks()).filter((u) => s ? s.name === u.type.name : !0).find((u) => di(u.attrs, t, { strict: !1 }));
16059
16078
  let o = 0;
16060
16079
  const l = [];
16061
16080
  if (r.forEach(({ $from: u, $to: h }) => {
@@ -16074,13 +16093,13 @@ function Pr(n, e, t = {}) {
16074
16093
  });
16075
16094
  }), o === 0)
16076
16095
  return !1;
16077
- const a = l.filter((u) => s ? s.name === u.mark.type.name : !0).filter((u) => ci(u.mark.attrs, t, { strict: !1 })).reduce((u, h) => u + h.to - h.from, 0), c = l.filter((u) => s ? u.mark.type !== s && u.mark.type.excludes(s) : !0).reduce((u, h) => u + h.to - h.from, 0);
16096
+ const a = l.filter((u) => s ? s.name === u.mark.type.name : !0).filter((u) => di(u.mark.attrs, t, { strict: !1 })).reduce((u, h) => u + h.to - h.from, 0), c = l.filter((u) => s ? u.mark.type !== s && u.mark.type.excludes(s) : !0).reduce((u, h) => u + h.to - h.from, 0);
16078
16097
  return (a > 0 ? a + c : a) >= o;
16079
16098
  }
16080
16099
  function a0(n, e, t = {}) {
16081
16100
  if (!e)
16082
16101
  return Mn(n, null, t) || Pr(n, null, t);
16083
- const i = Mi(e, n.schema);
16102
+ const i = _i(e, n.schema);
16084
16103
  return i === "node" ? Mn(n, e, t) : i === "mark" ? Pr(n, e, t) : !1;
16085
16104
  }
16086
16105
  function Go(n, e) {
@@ -16097,7 +16116,7 @@ function Zo(n, e) {
16097
16116
  }, s = B(T(i, "group", r));
16098
16117
  return typeof s != "string" ? !1 : s.split(" ").includes("list");
16099
16118
  }
16100
- function _i(n, {
16119
+ function Ti(n, {
16101
16120
  checkChildren: e = !0,
16102
16121
  ignoreWhitespace: t = !1
16103
16122
  } = {}) {
@@ -16117,7 +16136,7 @@ function _i(n, {
16117
16136
  if (e) {
16118
16137
  let r = !0;
16119
16138
  return n.content.forEach((s) => {
16120
- r !== !1 && (_i(s, { ignoreWhitespace: t, checkChildren: e }) || (r = !1));
16139
+ r !== !1 && (Ti(s, { ignoreWhitespace: t, checkChildren: e }) || (r = !1));
16121
16140
  }), r;
16122
16141
  }
16123
16142
  return !1;
@@ -16242,7 +16261,7 @@ function Qo(n, e) {
16242
16261
  }
16243
16262
  }
16244
16263
  var w0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor: r }) => {
16245
- const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = r.extensionManager.attributes, d = Un(c, l.node().type.name, l.node().attrs);
16264
+ const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = r.extensionManager.attributes, d = Jn(c, l.node().type.name, l.node().attrs);
16246
16265
  if (s instanceof E && s.node.isBlock)
16247
16266
  return !l.parentOffset || !jt(o, l.pos) ? !1 : (i && (n && Qo(t, r.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
16248
16267
  if (!l.parent.isBlock)
@@ -16288,7 +16307,7 @@ var w0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16288
16307
  // eslint-disable-next-line no-nested-ternary
16289
16308
  a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3
16290
16309
  ), w = {
16291
- ...Un(h, a.node().type.name, a.node().attrs),
16310
+ ...Jn(h, a.node().type.name, a.node().attrs),
16292
16311
  ...e
16293
16312
  }, x = ((o = l.contentMatch.defaultType) == null ? void 0 : o.createAndFill(w)) || void 0;
16294
16313
  v = v.append(k.from(l.createAndFill(null, x) || void 0));
@@ -16304,10 +16323,10 @@ var w0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16304
16323
  return !0;
16305
16324
  }
16306
16325
  const f = c.pos === a.end() ? u.contentMatchAt(0).defaultType : null, p = {
16307
- ...Un(h, u.type.name, u.attrs),
16326
+ ...Jn(h, u.type.name, u.attrs),
16308
16327
  ...e
16309
16328
  }, y = {
16310
- ...Un(h, a.node().type.name, a.node().attrs),
16329
+ ...Jn(h, a.node().type.name, a.node().attrs),
16311
16330
  ...e
16312
16331
  };
16313
16332
  t.delete(a.pos, c.pos);
@@ -16325,7 +16344,7 @@ var w0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16325
16344
  t.ensureMarks(x);
16326
16345
  }
16327
16346
  return !0;
16328
- }, nr = (n, e) => {
16347
+ }, ir = (n, e) => {
16329
16348
  const t = as((o) => o.type === e)(n.selection);
16330
16349
  if (!t)
16331
16350
  return !0;
@@ -16334,7 +16353,7 @@ var w0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16334
16353
  return !0;
16335
16354
  const r = n.doc.nodeAt(i);
16336
16355
  return t.node.type === (r == null ? void 0 : r.type) && Ot(n.doc, t.pos) && n.join(t.pos), !0;
16337
- }, ir = (n, e) => {
16356
+ }, rr = (n, e) => {
16338
16357
  const t = as((o) => o.type === e)(n.selection);
16339
16358
  if (!t)
16340
16359
  return !0;
@@ -16352,12 +16371,12 @@ var w0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16352
16371
  if (x.node.type === f)
16353
16372
  return c.liftListItem(p);
16354
16373
  if (Zo(x.node.type.name, u) && f.validContent(x.node.content) && l)
16355
- return a().command(() => (s.setNodeMarkup(x.pos, f), !0)).command(() => nr(s, f)).command(() => ir(s, f)).run();
16374
+ return a().command(() => (s.setNodeMarkup(x.pos, f), !0)).command(() => ir(s, f)).command(() => rr(s, f)).run();
16356
16375
  }
16357
- return !t || !w || !l ? a().command(() => d().wrapInList(f, i) ? !0 : c.clearNodes()).wrapInList(f, i).command(() => nr(s, f)).command(() => ir(s, f)).run() : a().command(() => {
16376
+ return !t || !w || !l ? a().command(() => d().wrapInList(f, i) ? !0 : c.clearNodes()).wrapInList(f, i).command(() => ir(s, f)).command(() => rr(s, f)).run() : a().command(() => {
16358
16377
  const M = d().wrapInList(f, i), _ = w.filter((O) => h.includes(O.type.name));
16359
16378
  return s.ensureMarks(_), M ? !0 : c.clearNodes();
16360
- }).wrapInList(f, i).command(() => nr(s, f)).command(() => ir(s, f)).run();
16379
+ }).wrapInList(f, i).command(() => ir(s, f)).command(() => rr(s, f)).run();
16361
16380
  }, x0 = (n, e = {}, t = {}) => ({ state: i, commands: r }) => {
16362
16381
  const { extendEmptyMarkRange: s = !1 } = t, o = Ye(n, i.schema);
16363
16382
  return Pr(i, o, e) ? r.unsetMark(o, { extendEmptyMarkRange: s }) : r.setMark(o, e);
@@ -16418,7 +16437,7 @@ var w0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16418
16437
  }), !0;
16419
16438
  }, A0 = (n, e = {}) => ({ tr: t, state: i, dispatch: r }) => {
16420
16439
  let s = null, o = null;
16421
- const l = Mi(
16440
+ const l = _i(
16422
16441
  typeof n == "string" ? n : n.name,
16423
16442
  i.schema
16424
16443
  );
@@ -16525,13 +16544,13 @@ function $n(n) {
16525
16544
  const f = P0(u, h.find);
16526
16545
  if (!f)
16527
16546
  return;
16528
- const p = a.state.tr, y = xi({
16547
+ const p = a.state.tr, y = Si({
16529
16548
  state: a.state,
16530
16549
  transaction: p
16531
16550
  }), g = {
16532
16551
  from: i - (f[0].length - s.length),
16533
16552
  to: r
16534
- }, { commands: v, chain: b, can: C } = new Si({
16553
+ }, { commands: v, chain: b, can: C } = new Mi({
16535
16554
  editor: t,
16536
16555
  state: y
16537
16556
  });
@@ -16716,7 +16735,7 @@ var F0 = (n, e, t) => {
16716
16735
  }) : [];
16717
16736
  };
16718
16737
  function V0(n) {
16719
- const { editor: e, state: t, from: i, to: r, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new Si({
16738
+ const { editor: e, state: t, from: i, to: r, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new Mi({
16720
16739
  editor: e,
16721
16740
  state: t
16722
16741
  }), u = [];
@@ -16734,7 +16753,7 @@ function V0(n) {
16734
16753
  const ue = x + I.index + 1, ge = ue + I[0].length, Ae = {
16735
16754
  from: t.tr.mapping.map(ue),
16736
16755
  to: t.tr.mapping.map(ge)
16737
- }, Ai = s.handler({
16756
+ }, Oi = s.handler({
16738
16757
  state: t,
16739
16758
  range: Ae,
16740
16759
  match: I,
@@ -16744,7 +16763,7 @@ function V0(n) {
16744
16763
  pasteEvent: o,
16745
16764
  dropEvent: l
16746
16765
  });
16747
- u.push(Ai);
16766
+ u.push(Oi);
16748
16767
  });
16749
16768
  }), u.every((f) => f !== null);
16750
16769
  }
@@ -16770,7 +16789,7 @@ function W0(n) {
16770
16789
  rule: f,
16771
16790
  pasteEvt: p
16772
16791
  }) => {
16773
- const y = d.tr, g = xi({
16792
+ const y = d.tr, g = Si({
16774
16793
  state: d,
16775
16794
  transaction: y
16776
16795
  });
@@ -16853,7 +16872,7 @@ function W0(n) {
16853
16872
  }
16854
16873
  }));
16855
16874
  }
16856
- var Ti = class {
16875
+ var Ni = class {
16857
16876
  constructor(n, e) {
16858
16877
  this.splittableMarks = [], this.editor = e, this.baseExtensions = n, this.extensions = _c(n), this.schema = Qm(this.extensions, e), this.setupExtensions();
16859
16878
  }
@@ -16868,7 +16887,7 @@ var Ti = class {
16868
16887
  options: e.options,
16869
16888
  storage: this.editor.extensionStorage[e.name],
16870
16889
  editor: this.editor,
16871
- type: tr(e.name, this.schema)
16890
+ type: nr(e.name, this.schema)
16872
16891
  }, i = T(e, "addCommands", t);
16873
16892
  return i ? {
16874
16893
  ...n,
@@ -16888,7 +16907,7 @@ var Ti = class {
16888
16907
  options: i.options,
16889
16908
  storage: this.editor.extensionStorage[i.name],
16890
16909
  editor: n,
16891
- type: tr(i.name, this.schema)
16910
+ type: nr(i.name, this.schema)
16892
16911
  }, s = [], o = T(
16893
16912
  i,
16894
16913
  "addKeyboardShortcuts",
@@ -16962,7 +16981,7 @@ var Ti = class {
16962
16981
  if (!o)
16963
16982
  return [];
16964
16983
  const l = (a, c, d, u, h) => {
16965
- const f = di(a, i);
16984
+ const f = ui(a, i);
16966
16985
  return o({
16967
16986
  // pass-through
16968
16987
  node: a,
@@ -16994,7 +17013,7 @@ var Ti = class {
16994
17013
  if (!s)
16995
17014
  return [];
16996
17015
  const o = (l, a, c) => {
16997
- const d = di(l, i);
17016
+ const d = ui(l, i);
16998
17017
  return s()({
16999
17018
  // pass-through
17000
17019
  mark: l,
@@ -17028,7 +17047,7 @@ var Ti = class {
17028
17047
  options: e.options,
17029
17048
  storage: this.editor.extensionStorage[e.name],
17030
17049
  editor: this.editor,
17031
- type: tr(e.name, this.schema)
17050
+ type: nr(e.name, this.schema)
17032
17051
  };
17033
17052
  e.type === "mark" && ((t = B(T(e, "keepOnSplit", i))) == null || t) && this.splittableMarks.push(e.name);
17034
17053
  const r = T(e, "onBeforeCreate", i), s = T(e, "onCreate", i), o = T(e, "onUpdate", i), l = T(
@@ -17040,9 +17059,9 @@ var Ti = class {
17040
17059
  });
17041
17060
  }
17042
17061
  };
17043
- Ti.resolve = _c;
17044
- Ti.sort = hs;
17045
- Ti.flatten = cs;
17062
+ Ni.resolve = _c;
17063
+ Ni.sort = hs;
17064
+ Ni.flatten = cs;
17046
17065
  var j0 = {};
17047
17066
  rs(j0, {
17048
17067
  ClipboardTextSerializer: () => Rc,
@@ -17280,12 +17299,12 @@ var X = class Ic extends fs {
17280
17299
  if (!i || r)
17281
17300
  return;
17282
17301
  const { empty: s, from: o, to: l } = e.selection, a = P.atStart(e.doc).from, c = P.atEnd(e.doc).to;
17283
- if (s || !(o === a && l === c) || !_i(t.doc))
17302
+ if (s || !(o === a && l === c) || !Ti(t.doc))
17284
17303
  return;
17285
- const h = t.tr, f = xi({
17304
+ const h = t.tr, f = Si({
17286
17305
  state: t,
17287
17306
  transaction: h
17288
- }), { commands: p } = new Si({
17307
+ }), { commands: p } = new Mi({
17289
17308
  editor: this.editor,
17290
17309
  state: f
17291
17310
  });
@@ -17722,13 +17741,13 @@ var K0 = class extends I0 {
17722
17741
  direction: this.options.textDirection
17723
17742
  })
17724
17743
  ].filter((r) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[r.name] !== !1 : !0) : [], ...this.options.extensions].filter((r) => ["extension", "node", "mark"].includes(r == null ? void 0 : r.type));
17725
- this.extensionManager = new Ti(i, this);
17744
+ this.extensionManager = new Ni(i, this);
17726
17745
  }
17727
17746
  /**
17728
17747
  * Creates an command manager.
17729
17748
  */
17730
17749
  createCommandManager() {
17731
- this.commandManager = new Si({
17750
+ this.commandManager = new Mi({
17732
17751
  editor: this
17733
17752
  });
17734
17753
  }
@@ -17896,7 +17915,7 @@ var K0 = class extends I0 {
17896
17915
  * Check if there is no content.
17897
17916
  */
17898
17917
  get isEmpty() {
17899
- return _i(this.state.doc);
17918
+ return Ti(this.state.doc);
17900
17919
  }
17901
17920
  /**
17902
17921
  * Destroy the editor.
@@ -18347,7 +18366,7 @@ function e1(n) {
18347
18366
  else if (w -= 1, w === 0) {
18348
18367
  const Ae = O.slice(0, ue);
18349
18368
  M = Ae.trim();
18350
- const Ai = u.slice(0, x + ue + I[0].length);
18369
+ const Oi = u.slice(0, x + ue + I[0].length);
18351
18370
  let Xe = [];
18352
18371
  if (M)
18353
18372
  if (l === "block")
@@ -18364,7 +18383,7 @@ function e1(n) {
18364
18383
  Xe = f.inlineTokens(M);
18365
18384
  return {
18366
18385
  type: e,
18367
- raw: Ai,
18386
+ raw: Oi,
18368
18387
  attributes: C,
18369
18388
  content: M,
18370
18389
  tokens: Xe
@@ -18542,7 +18561,7 @@ function o1(n, e, t = {}) {
18542
18561
  }
18543
18562
  }), s.docChanged && e.view.dispatch(s);
18544
18563
  }
18545
- var Ni = class qc extends fs {
18564
+ var Ei = class qc extends fs {
18546
18565
  constructor() {
18547
18566
  super(...arguments), this.type = "node";
18548
18567
  }
@@ -18561,12 +18580,12 @@ var Ni = class qc extends fs {
18561
18580
  const t = typeof e == "function" ? e() : e;
18562
18581
  return super.extend(t);
18563
18582
  }
18564
- }, l1 = Ni.create({
18583
+ }, l1 = Ei.create({
18565
18584
  name: "doc",
18566
18585
  topNode: !0,
18567
18586
  content: "block+",
18568
18587
  renderMarkdown: (n, e) => n.content ? e.renderChildren(n.content, "\n\n") : ""
18569
- }), a1 = l1, c1 = Ni.create({
18588
+ }), a1 = l1, c1 = Ei.create({
18570
18589
  name: "text",
18571
18590
  group: "inline",
18572
18591
  parseMarkdown: (n) => ({
@@ -18574,7 +18593,7 @@ var Ni = class qc extends fs {
18574
18593
  text: n.text || ""
18575
18594
  }),
18576
18595
  renderMarkdown: (n) => n.text || ""
18577
- }), d1 = c1, u1 = Ni.create({
18596
+ }), d1 = c1, u1 = Ei.create({
18578
18597
  name: "paragraph",
18579
18598
  priority: 1e3,
18580
18599
  addOptions() {
@@ -18889,10 +18908,10 @@ function C1(n) {
18889
18908
  let e = document.createElement("div");
18890
18909
  return e.className = "ProseMirror-gapcursor", H.create(n.doc, [fe.widget(n.selection.head, e, { key: "gapcursor" })]);
18891
18910
  }
18892
- var ui = 200, te = function() {
18911
+ var hi = 200, te = function() {
18893
18912
  };
18894
18913
  te.prototype.append = function(e) {
18895
- return e.length ? (e = te.from(e), !this.length && e || e.length < ui && this.leafAppend(e) || this.length < ui && e.leafPrepend(this) || this.appendInner(e)) : this;
18914
+ return e.length ? (e = te.from(e), !this.length && e || e.length < hi && this.leafAppend(e) || this.length < hi && e.leafPrepend(this) || this.appendInner(e)) : this;
18896
18915
  };
18897
18916
  te.prototype.prepend = function(e) {
18898
18917
  return e.length ? te.from(e).append(this) : this;
@@ -18941,10 +18960,10 @@ var Jc = /* @__PURE__ */ function(n) {
18941
18960
  if (r(this.values[a], l + a) === !1)
18942
18961
  return !1;
18943
18962
  }, e.prototype.leafAppend = function(r) {
18944
- if (this.length + r.length <= ui)
18963
+ if (this.length + r.length <= hi)
18945
18964
  return new e(this.values.concat(r.flatten()));
18946
18965
  }, e.prototype.leafPrepend = function(r) {
18947
- if (this.length + r.length <= ui)
18966
+ if (this.length + r.length <= hi)
18948
18967
  return new e(r.flatten().concat(this.values));
18949
18968
  }, t.length.get = function() {
18950
18969
  return this.values.length;
@@ -19135,12 +19154,12 @@ function _1(n, e, t, i) {
19135
19154
  if (t.steps.length == 0)
19136
19155
  return n;
19137
19156
  if (o && o.getMeta(St))
19138
- return o.getMeta(St).redo ? new et(n.done.addTransform(t, void 0, i, Jn(e)), n.undone, el(t.mapping.maps), n.prevTime, n.prevComposition) : new et(n.done, n.undone.addTransform(t, void 0, i, Jn(e)), null, n.prevTime, n.prevComposition);
19157
+ return o.getMeta(St).redo ? new et(n.done.addTransform(t, void 0, i, Kn(e)), n.undone, el(t.mapping.maps), n.prevTime, n.prevComposition) : new et(n.done, n.undone.addTransform(t, void 0, i, Kn(e)), null, n.prevTime, n.prevComposition);
19139
19158
  if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
19140
- let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - i.newGroupDelay || !T1(t, n.prevRanges)), c = o ? rr(n.prevRanges, t.mapping) : el(t.mapping.maps);
19141
- return new et(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, i, Jn(e)), Oe.empty, c, t.time, l == null ? n.prevComposition : l);
19159
+ let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - i.newGroupDelay || !T1(t, n.prevRanges)), c = o ? sr(n.prevRanges, t.mapping) : el(t.mapping.maps);
19160
+ return new et(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, i, Kn(e)), Oe.empty, c, t.time, l == null ? n.prevComposition : l);
19142
19161
  } else
19143
- return (s = t.getMeta("rebased")) ? new et(n.done.rebased(t, s), n.undone.rebased(t, s), rr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new et(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), rr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
19162
+ return (s = t.getMeta("rebased")) ? new et(n.done.rebased(t, s), n.undone.rebased(t, s), sr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new et(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), sr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
19144
19163
  }
19145
19164
  function T1(n, e) {
19146
19165
  if (!e)
@@ -19159,7 +19178,7 @@ function el(n) {
19159
19178
  n[t].forEach((i, r, s, o) => e.push(s, o));
19160
19179
  return e;
19161
19180
  }
19162
- function rr(n, e) {
19181
+ function sr(n, e) {
19163
19182
  if (!n)
19164
19183
  return null;
19165
19184
  let t = [];
@@ -19170,24 +19189,24 @@ function rr(n, e) {
19170
19189
  return t;
19171
19190
  }
19172
19191
  function N1(n, e, t) {
19173
- let i = Jn(e), r = St.get(e).spec.config, s = (t ? n.undone : n.done).popEvent(e, i);
19192
+ let i = Kn(e), r = St.get(e).spec.config, s = (t ? n.undone : n.done).popEvent(e, i);
19174
19193
  if (!s)
19175
19194
  return null;
19176
19195
  let o = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), r, i), a = new et(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
19177
19196
  return s.transform.setSelection(o).setMeta(St, { redo: t, historyState: a });
19178
19197
  }
19179
- let sr = !1, tl = null;
19180
- function Jn(n) {
19198
+ let or = !1, tl = null;
19199
+ function Kn(n) {
19181
19200
  let e = n.plugins;
19182
19201
  if (tl != e) {
19183
- sr = !1, tl = e;
19202
+ or = !1, tl = e;
19184
19203
  for (let t = 0; t < e.length; t++)
19185
19204
  if (e[t].spec.historyPreserveItems) {
19186
- sr = !0;
19205
+ or = !0;
19187
19206
  break;
19188
19207
  }
19189
19208
  }
19190
- return sr;
19209
+ return or;
19191
19210
  }
19192
19211
  const St = new le("history"), E1 = new le("closeHistory");
19193
19212
  function A1(n = {}) {
@@ -19393,7 +19412,7 @@ X.create({
19393
19412
  return null;
19394
19413
  const s = this.editor.isEmpty;
19395
19414
  return n.descendants((o, l) => {
19396
- const a = i >= l && i <= l + o.nodeSize, c = !o.isLeaf && _i(o);
19415
+ const a = i >= l && i <= l + o.nodeSize, c = !o.isLeaf && Ti(o);
19397
19416
  if ((a || !this.options.showOnlyCurrent) && c) {
19398
19417
  const d = [this.options.emptyNodeClass];
19399
19418
  s && d.push(this.options.emptyEditorClass);
@@ -19506,7 +19525,7 @@ var O1 = X.create({
19506
19525
  "Shift-Mod-я": () => this.editor.commands.redo()
19507
19526
  };
19508
19527
  }
19509
- }), D1 = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, I1 = Ni.create({
19528
+ }), D1 = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, I1 = Ei.create({
19510
19529
  name: "image",
19511
19530
  addOptions() {
19512
19531
  return {
@@ -19790,7 +19809,7 @@ const il = new L("chat-editor"), L1 = ({
19790
19809
  const j = new L("chat-input"), rl = window.SpeechRecognition || window.webkitSpeechRecognition, sl = (n) => {
19791
19810
  var g;
19792
19811
  const [e, t] = Me(!1);
19793
- Fr(Ei);
19812
+ Fr(Ai);
19794
19813
  const i = n.controller.input, r = F(!1), s = Q(), o = Q(null);
19795
19814
  rl && !s.current && (s.current = new rl(), s.current.onstart = () => {
19796
19815
  r.value = !0;
@@ -19923,7 +19942,7 @@ const j = new L("chat-input"), rl = window.SpeechRecognition || window.webkitSpe
19923
19942
  p(x, v);
19924
19943
  },
19925
19944
  children: [
19926
- /* @__PURE__ */ m("span", { className: j.b("pop-action-item-icon"), children: typeof v.icon == "function" ? v.icon() : ((b = v.icon) == null ? void 0 : b.showIcon) && /* @__PURE__ */ m($e, { children: (C = v.icon) != null && C.cssClass ? /* @__PURE__ */ m("i", { className: v.icon.cssClass }) : (w = v.icon) != null && w.imagePath ? fi(v.icon.imagePath) ? /* @__PURE__ */ m(
19945
+ /* @__PURE__ */ m("span", { className: j.b("pop-action-item-icon"), children: typeof v.icon == "function" ? v.icon() : ((b = v.icon) == null ? void 0 : b.showIcon) && /* @__PURE__ */ m($e, { children: (C = v.icon) != null && C.cssClass ? /* @__PURE__ */ m("i", { className: v.icon.cssClass }) : (w = v.icon) != null && w.imagePath ? pi(v.icon.imagePath) ? /* @__PURE__ */ m(
19927
19946
  "div",
19928
19947
  {
19929
19948
  dangerouslySetInnerHTML: {
@@ -20245,12 +20264,12 @@ const Lt = new L("chat-minimize"), H1 = (n) => {
20245
20264
  }
20246
20265
  );
20247
20266
  };
20248
- const Ei = sd({
20267
+ const Ai = sd({
20249
20268
  zIndex: 10,
20250
20269
  enableBackFill: !0
20251
20270
  });
20252
20271
  var ol, ll, al, cl;
20253
- class or extends Ie {
20272
+ class lr extends Ie {
20254
20273
  constructor(t) {
20255
20274
  var i, r;
20256
20275
  super(t);
@@ -20415,7 +20434,7 @@ class or extends Ie {
20415
20434
  * @memberof ChatContainer
20416
20435
  */
20417
20436
  registerDragDialogBorder() {
20418
- Oi(this.containerRef.current).resizable({
20437
+ Di(this.containerRef.current).resizable({
20419
20438
  // 可拖拽的边缘
20420
20439
  edges: {
20421
20440
  top: !0,
@@ -20426,9 +20445,9 @@ class or extends Ie {
20426
20445
  margin: 6,
20427
20446
  modifiers: [
20428
20447
  // 保持在父对象内部
20429
- Oi.modifiers.restrictEdges({ outer: document.body }),
20448
+ Di.modifiers.restrictEdges({ outer: document.body }),
20430
20449
  // 缩放最小宽度
20431
- Oi.modifiers.restrictSize({
20450
+ Di.modifiers.restrictSize({
20432
20451
  min: { width: this.data.minWidth, height: this.data.minHeight }
20433
20452
  })
20434
20453
  ],
@@ -20526,7 +20545,7 @@ class or extends Ie {
20526
20545
  t.stopPropagation();
20527
20546
  }
20528
20547
  render() {
20529
- return /* @__PURE__ */ m(Ei.Provider, { value: this.containerContext, children: /* @__PURE__ */ m("div", { className: "".concat(this.ns.b()), children: [
20548
+ return /* @__PURE__ */ m(Ai.Provider, { value: this.containerContext, children: /* @__PURE__ */ m("div", { className: "".concat(this.ns.b()), children: [
20530
20549
  /* @__PURE__ */ m(
20531
20550
  "div",
20532
20551
  {
@@ -20687,6 +20706,6 @@ class or extends Ie {
20687
20706
  }
20688
20707
  }
20689
20708
  export {
20690
- or as ChatContainer,
20709
+ lr as ChatContainer,
20691
20710
  J1 as chat
20692
20711
  };