@grapesjs/studio-sdk-plugins 1.0.35 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/accordionComponent/index.cjs.js +7 -7
  2. package/dist/accordionComponent/index.es.js +175 -162
  3. package/dist/accordionComponent/index.umd.js +7 -7
  4. package/dist/aiChat/index.cjs.js +64 -64
  5. package/dist/aiChat/index.es.js +5785 -5757
  6. package/dist/aiChat/index.js +64 -64
  7. package/dist/aiChat/index.umd.js +63 -63
  8. package/dist/animationComponent/index.cjs.js +3 -3
  9. package/dist/animationComponent/index.es.js +204 -191
  10. package/dist/animationComponent/index.umd.js +3 -3
  11. package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
  12. package/dist/canvasAbsoluteMode/index.es.js +183 -170
  13. package/dist/canvasAbsoluteMode/index.umd.js +1 -1
  14. package/dist/canvasEmptyState/index.cjs.js +1 -1
  15. package/dist/canvasEmptyState/index.es.js +134 -121
  16. package/dist/canvasEmptyState/index.umd.js +1 -1
  17. package/dist/canvasFullSize/index.cjs.js +9 -9
  18. package/dist/canvasFullSize/index.es.js +165 -152
  19. package/dist/canvasFullSize/index.umd.js +9 -9
  20. package/dist/canvasGridMode/index.cjs.js +5 -5
  21. package/dist/canvasGridMode/index.es.js +245 -232
  22. package/dist/canvasGridMode/index.umd.js +4 -4
  23. package/dist/canvasScreenshot/index.cjs.js +1 -1
  24. package/dist/canvasScreenshot/index.es.js +155 -142
  25. package/dist/canvasScreenshot/index.umd.js +1 -1
  26. package/dist/dataSourceEjs/index.cjs.js +9 -9
  27. package/dist/dataSourceEjs/index.es.js +257 -244
  28. package/dist/dataSourceEjs/index.umd.js +9 -9
  29. package/dist/dataSourceHandlebars/index.cjs.js +8 -8
  30. package/dist/dataSourceHandlebars/index.es.js +216 -203
  31. package/dist/dataSourceHandlebars/index.umd.js +7 -7
  32. package/dist/dialogComponent/index.cjs.js +14 -14
  33. package/dist/dialogComponent/index.es.js +141 -128
  34. package/dist/dialogComponent/index.umd.js +14 -14
  35. package/dist/flexComponent/index.cjs.js +13 -13
  36. package/dist/flexComponent/index.es.js +484 -471
  37. package/dist/flexComponent/index.umd.js +13 -13
  38. package/dist/fsLightboxComponent/index.cjs.js +3 -3
  39. package/dist/fsLightboxComponent/index.es.js +173 -160
  40. package/dist/fsLightboxComponent/index.umd.js +3 -3
  41. package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
  42. package/dist/googleFontsAssetProvider/index.es.js +160 -147
  43. package/dist/googleFontsAssetProvider/index.umd.js +1 -1
  44. package/dist/iconifyComponent/index.cjs.js +2 -2
  45. package/dist/iconifyComponent/index.es.js +196 -183
  46. package/dist/iconifyComponent/index.umd.js +2 -2
  47. package/dist/index.cjs.js +25 -25
  48. package/dist/index.es.js +121 -108
  49. package/dist/index.umd.js +18 -18
  50. package/dist/layoutSidebarButtons/index.cjs.js +1 -1
  51. package/dist/layoutSidebarButtons/index.es.js +157 -144
  52. package/dist/layoutSidebarButtons/index.umd.js +1 -1
  53. package/dist/lightGalleryComponent/index.cjs.js +1 -1
  54. package/dist/lightGalleryComponent/index.es.js +245 -232
  55. package/dist/lightGalleryComponent/index.umd.js +1 -1
  56. package/dist/linkImageComponent/index.cjs.js +2 -2
  57. package/dist/linkImageComponent/index.es.js +106 -93
  58. package/dist/linkImageComponent/index.umd.js +2 -2
  59. package/dist/listPagesComponent/index.cjs.js +5 -5
  60. package/dist/listPagesComponent/index.es.js +157 -144
  61. package/dist/listPagesComponent/index.umd.js +5 -5
  62. package/dist/presetPrintable/index.cjs.js +3 -3
  63. package/dist/presetPrintable/index.es.js +181 -168
  64. package/dist/presetPrintable/index.umd.js +3 -3
  65. package/dist/prosemirror/index.cjs.js +7 -7
  66. package/dist/prosemirror/index.es.js +385 -372
  67. package/dist/prosemirror/index.umd.js +8 -8
  68. package/dist/rendererReact/index.cjs.js +1 -1
  69. package/dist/rendererReact/index.es.js +200 -187
  70. package/dist/rendererReact/index.js +1 -1
  71. package/dist/rendererReact/index.umd.js +1 -1
  72. package/dist/rteTinyMce/index.cjs.js +2 -2
  73. package/dist/rteTinyMce/index.es.js +118 -105
  74. package/dist/rteTinyMce/index.umd.js +2 -2
  75. package/dist/shapeDividerComponent/index.cjs.js +4 -4
  76. package/dist/shapeDividerComponent/index.es.js +129 -116
  77. package/dist/shapeDividerComponent/index.umd.js +4 -4
  78. package/dist/swiperComponent/index.cjs.js +9 -9
  79. package/dist/swiperComponent/index.es.js +203 -190
  80. package/dist/swiperComponent/index.umd.js +7 -7
  81. package/dist/tableComponent/index.cjs.js +1 -1
  82. package/dist/tableComponent/index.es.js +257 -244
  83. package/dist/tableComponent/index.umd.js +1 -1
  84. package/dist/types.d.ts +1 -1
  85. package/dist/youtubeAssetProvider/index.cjs.js +1 -1
  86. package/dist/youtubeAssetProvider/index.es.js +121 -108
  87. package/dist/youtubeAssetProvider/index.umd.js +1 -1
  88. package/package.json +1 -1
@@ -327,15 +327,15 @@ class y {
327
327
  */
328
328
  findIndex(e, t = -1) {
329
329
  if (e == 0)
330
- return Ht(0, e);
330
+ return $t(0, e);
331
331
  if (e == this.size)
332
- return Ht(this.content.length, e);
332
+ return $t(this.content.length, e);
333
333
  if (e > this.size || e < 0)
334
334
  throw new RangeError(`Position ${e} outside of fragment (${this})`);
335
335
  for (let r = 0, i = 0; ; r++) {
336
336
  let s = this.child(r), o = i + s.nodeSize;
337
337
  if (o >= e)
338
- return o == e || t > 0 ? Ht(r + 1, o) : Ht(r, i);
338
+ return o == e || t > 0 ? $t(r + 1, o) : $t(r, i);
339
339
  i = o;
340
340
  }
341
341
  }
@@ -401,10 +401,10 @@ class y {
401
401
  }
402
402
  y.empty = new y([], 0);
403
403
  const On = { index: 0, offset: 0 };
404
- function Ht(n, e) {
404
+ function $t(n, e) {
405
405
  return On.index = n, On.offset = e, On;
406
406
  }
407
- function Zt(n, e) {
407
+ function Qt(n, e) {
408
408
  if (n === e)
409
409
  return !0;
410
410
  if (!(n && typeof n == "object") || !(e && typeof e == "object"))
@@ -416,11 +416,11 @@ function Zt(n, e) {
416
416
  if (n.length != e.length)
417
417
  return !1;
418
418
  for (let r = 0; r < n.length; r++)
419
- if (!Zt(n[r], e[r]))
419
+ if (!Qt(n[r], e[r]))
420
420
  return !1;
421
421
  } else {
422
422
  for (let r in n)
423
- if (!(r in e) || !Zt(n[r], e[r]))
423
+ if (!(r in e) || !Qt(n[r], e[r]))
424
424
  return !1;
425
425
  for (let r in e)
426
426
  if (!(r in n))
@@ -482,7 +482,7 @@ class O {
482
482
  another mark.
483
483
  */
484
484
  eq(e) {
485
- return this == e || this.type == e.type && Zt(this.attrs, e.attrs);
485
+ return this == e || this.type == e.type && Qt(this.attrs, e.attrs);
486
486
  }
487
487
  /**
488
488
  Convert this mark to a JSON-serializeable representation.
@@ -534,7 +534,7 @@ class O {
534
534
  }
535
535
  }
536
536
  O.none = [];
537
- class Qt extends Error {
537
+ class en extends Error {
538
538
  }
539
539
  class k {
540
540
  /**
@@ -637,9 +637,9 @@ function ss(n, e, t, r) {
637
637
  }
638
638
  function _o(n, e, t) {
639
639
  if (t.openStart > n.depth)
640
- throw new Qt("Inserted content deeper than insertion position");
640
+ throw new en("Inserted content deeper than insertion position");
641
641
  if (n.depth - t.openStart != e.depth - t.openEnd)
642
- throw new Qt("Inconsistent open depths");
642
+ throw new en("Inconsistent open depths");
643
643
  return ls(n, e, t, 0);
644
644
  }
645
645
  function ls(n, e, t, r) {
@@ -655,11 +655,11 @@ function ls(n, e, t, r) {
655
655
  let { start: o, end: l } = Xo(t, n);
656
656
  return We(s, cs(n, o, l, e, r));
657
657
  }
658
- else return We(s, en(n, e, r));
658
+ else return We(s, tn(n, e, r));
659
659
  }
660
660
  function as(n, e) {
661
661
  if (!e.type.compatibleContent(n.type))
662
- throw new Qt("Cannot join " + e.type.name + " onto " + n.type.name);
662
+ throw new en("Cannot join " + e.type.name + " onto " + n.type.name);
663
663
  }
664
664
  function Un(n, e, t) {
665
665
  let r = n.node(t);
@@ -669,7 +669,7 @@ function $e(n, e) {
669
669
  let t = e.length - 1;
670
670
  t >= 0 && n.isText && n.sameMarkup(e[t]) ? e[t] = n.withText(e[t].text + n.text) : e.push(n);
671
671
  }
672
- function St(n, e, t, r) {
672
+ function Ct(n, e, t, r) {
673
673
  let i = (e || n).node(t), s = 0, o = e ? e.index(t) : i.childCount;
674
674
  n && (s = n.index(t), n.depth > t ? s++ : n.textOffset && ($e(n.nodeAfter, r), s++));
675
675
  for (let l = s; l < o; l++)
@@ -681,15 +681,15 @@ function We(n, e) {
681
681
  }
682
682
  function cs(n, e, t, r, i) {
683
683
  let s = n.depth > i && Un(n, e, i + 1), o = r.depth > i && Un(t, r, i + 1), l = [];
684
- return St(null, n, i, l), s && o && e.index(i) == t.index(i) ? (as(s, o), $e(We(s, cs(n, e, t, r, i + 1)), l)) : (s && $e(We(s, en(n, e, i + 1)), l), St(e, t, i, l), o && $e(We(o, en(t, r, i + 1)), l)), St(r, null, i, l), new y(l);
684
+ return Ct(null, n, i, l), s && o && e.index(i) == t.index(i) ? (as(s, o), $e(We(s, cs(n, e, t, r, i + 1)), l)) : (s && $e(We(s, tn(n, e, i + 1)), l), Ct(e, t, i, l), o && $e(We(o, tn(t, r, i + 1)), l)), Ct(r, null, i, l), new y(l);
685
685
  }
686
- function en(n, e, t) {
686
+ function tn(n, e, t) {
687
687
  let r = [];
688
- if (St(null, n, t, r), n.depth > t) {
688
+ if (Ct(null, n, t, r), n.depth > t) {
689
689
  let i = Un(n, e, t + 1);
690
- $e(We(i, en(n, e, t + 1)), r);
690
+ $e(We(i, tn(n, e, t + 1)), r);
691
691
  }
692
- return St(e, null, t, r), new y(r);
692
+ return Ct(e, null, t, r), new y(r);
693
693
  }
694
694
  function Xo(n, e) {
695
695
  let t = e.depth - n.openStart, i = e.node(t).copy(n.content);
@@ -700,7 +700,7 @@ function Xo(n, e) {
700
700
  end: i.resolveNoCache(i.content.size - n.openEnd - t)
701
701
  };
702
702
  }
703
- class Nt {
703
+ class Tt {
704
704
  /**
705
705
  @internal
706
706
  */
@@ -885,7 +885,7 @@ class Nt {
885
885
  return e.blockRange(this);
886
886
  for (let r = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); r >= 0; r--)
887
887
  if (e.pos <= this.end(r) && (!t || t(this.node(r))))
888
- return new tn(this, e, r);
888
+ return new nn(this, e, r);
889
889
  return null;
890
890
  }
891
891
  /**
@@ -928,7 +928,7 @@ class Nt {
928
928
  break;
929
929
  s = c - 1, i += a + 1;
930
930
  }
931
- return new Nt(t, r, s);
931
+ return new Tt(t, r, s);
932
932
  }
933
933
  /**
934
934
  @internal
@@ -943,7 +943,7 @@ class Nt {
943
943
  }
944
944
  else
945
945
  Br.set(e, r = new Yo());
946
- let i = r.elts[r.i] = Nt.resolve(e, t);
946
+ let i = r.elts[r.i] = Tt.resolve(e, t);
947
947
  return r.i = (r.i + 1) % Zo, i;
948
948
  }
949
949
  }
@@ -953,7 +953,7 @@ class Yo {
953
953
  }
954
954
  }
955
955
  const Zo = 12, Br = /* @__PURE__ */ new WeakMap();
956
- class tn {
956
+ class nn {
957
957
  /**
958
958
  Construct a node range. `$from` and `$to` should point into the
959
959
  same node until at least the given `depth`, since a node range
@@ -1112,7 +1112,7 @@ let Je = class Gn {
1112
1112
  attributes, and marks.
1113
1113
  */
1114
1114
  hasMarkup(e, t, r) {
1115
- return this.type == e && Zt(this.attrs, t || e.defaultAttrs || Qo) && O.sameSet(this.marks, r || O.none);
1115
+ return this.type == e && Qt(this.attrs, t || e.defaultAttrs || Qo) && O.sameSet(this.marks, r || O.none);
1116
1116
  }
1117
1117
  /**
1118
1118
  Create a new node with the same markup as this node, containing
@@ -1198,13 +1198,13 @@ let Je = class Gn {
1198
1198
  [object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.
1199
1199
  */
1200
1200
  resolve(e) {
1201
- return Nt.resolveCached(this, e);
1201
+ return Tt.resolveCached(this, e);
1202
1202
  }
1203
1203
  /**
1204
1204
  @internal
1205
1205
  */
1206
1206
  resolveNoCache(e) {
1207
- return Nt.resolve(this, e);
1207
+ return Tt.resolve(this, e);
1208
1208
  }
1209
1209
  /**
1210
1210
  Test whether a given mark or mark type occurs in this document
@@ -1364,7 +1364,7 @@ let Je = class Gn {
1364
1364
  }
1365
1365
  };
1366
1366
  Je.prototype.text = void 0;
1367
- class nn extends Je {
1367
+ class rn extends Je {
1368
1368
  /**
1369
1369
  @internal
1370
1370
  */
@@ -1386,10 +1386,10 @@ class nn extends Je {
1386
1386
  return this.text.length;
1387
1387
  }
1388
1388
  mark(e) {
1389
- return e == this.marks ? this : new nn(this.type, this.attrs, this.text, e);
1389
+ return e == this.marks ? this : new rn(this.type, this.attrs, this.text, e);
1390
1390
  }
1391
1391
  withText(e) {
1392
- return e == this.text ? this : new nn(this.type, this.attrs, e, this.marks);
1392
+ return e == this.text ? this : new rn(this.type, this.attrs, e, this.marks);
1393
1393
  }
1394
1394
  cut(e = 0, t = this.text.length) {
1395
1395
  return e == 0 && t == this.text.length ? this : this.withText(this.text.slice(e, t));
@@ -1791,7 +1791,7 @@ function gs(n, e) {
1791
1791
  t[r] = new fl(n, r, e[r]);
1792
1792
  return t;
1793
1793
  }
1794
- let Fr = class ys {
1794
+ let Lr = class ys {
1795
1795
  /**
1796
1796
  @internal
1797
1797
  */
@@ -2050,7 +2050,7 @@ class hl {
2050
2050
  let t = this.spec = {};
2051
2051
  for (let i in e)
2052
2052
  t[i] = e[i];
2053
- t.nodes = B.from(e.nodes), t.marks = B.from(e.marks || {}), this.nodes = Fr.compile(this.spec.nodes, this), this.marks = mn.compile(this.spec.marks, this);
2053
+ t.nodes = B.from(e.nodes), t.marks = B.from(e.marks || {}), this.nodes = Lr.compile(this.spec.nodes, this), this.marks = mn.compile(this.spec.marks, this);
2054
2054
  let r = /* @__PURE__ */ Object.create(null);
2055
2055
  for (let i in this.nodes) {
2056
2056
  if (i in this.marks)
@@ -2063,11 +2063,11 @@ class hl {
2063
2063
  throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");
2064
2064
  this.linebreakReplacement = s;
2065
2065
  }
2066
- s.markSet = l == "_" ? null : l ? Lr(this, l.split(" ")) : l == "" || !s.inlineContent ? [] : null;
2066
+ s.markSet = l == "_" ? null : l ? Fr(this, l.split(" ")) : l == "" || !s.inlineContent ? [] : null;
2067
2067
  }
2068
2068
  for (let i in this.marks) {
2069
2069
  let s = this.marks[i], o = s.spec.excludes;
2070
- s.excluded = o == null ? [s] : o == "" ? [] : Lr(this, o.split(" "));
2070
+ s.excluded = o == null ? [s] : o == "" ? [] : Fr(this, o.split(" "));
2071
2071
  }
2072
2072
  this.nodeFromJSON = this.nodeFromJSON.bind(this), this.markFromJSON = this.markFromJSON.bind(this), this.topNodeType = this.nodes[this.spec.topNode || "doc"], this.cached.wrappings = /* @__PURE__ */ Object.create(null);
2073
2073
  }
@@ -2080,7 +2080,7 @@ class hl {
2080
2080
  node(e, t = null, r, i) {
2081
2081
  if (typeof e == "string")
2082
2082
  e = this.nodeType(e);
2083
- else if (e instanceof Fr) {
2083
+ else if (e instanceof Lr) {
2084
2084
  if (e.schema != this)
2085
2085
  throw new RangeError("Node type from different schema used (" + e.name + ")");
2086
2086
  } else throw new RangeError("Invalid node type: " + e);
@@ -2092,7 +2092,7 @@ class hl {
2092
2092
  */
2093
2093
  text(e, t) {
2094
2094
  let r = this.nodes.text;
2095
- return new nn(r, r.defaultAttrs, e, O.setFrom(t));
2095
+ return new rn(r, r.defaultAttrs, e, O.setFrom(t));
2096
2096
  }
2097
2097
  /**
2098
2098
  Create a mark with the given type and attributes.
@@ -2124,7 +2124,7 @@ class hl {
2124
2124
  return t;
2125
2125
  }
2126
2126
  }
2127
- function Lr(n, e) {
2127
+ function Fr(n, e) {
2128
2128
  let t = [];
2129
2129
  for (let r = 0; r < e.length; r++) {
2130
2130
  let i = e[r], s = n.marks[i], o = s;
@@ -2301,13 +2301,13 @@ const bs = {
2301
2301
  script: !0,
2302
2302
  style: !0,
2303
2303
  title: !0
2304
- }, ks = { ol: !0, ul: !0 }, rn = 1, sn = 2, Ct = 4;
2304
+ }, ks = { ol: !0, ul: !0 }, sn = 1, on = 2, wt = 4;
2305
2305
  function Hr(n, e, t) {
2306
- return e != null ? (e ? rn : 0) | (e === "full" ? sn : 0) : n && n.whitespace == "pre" ? rn | sn : t & ~Ct;
2306
+ return e != null ? (e ? sn : 0) | (e === "full" ? on : 0) : n && n.whitespace == "pre" ? sn | on : t & ~wt;
2307
2307
  }
2308
- class $t {
2308
+ class Wt {
2309
2309
  constructor(e, t, r, i, s, o) {
2310
- this.type = e, this.attrs = t, this.marks = r, this.solid = i, this.options = o, this.content = [], this.activeMarks = O.none, this.match = s || (o & Ct ? null : e.contentMatch);
2310
+ this.type = e, this.attrs = t, this.marks = r, this.solid = i, this.options = o, this.content = [], this.activeMarks = O.none, this.match = s || (o & wt ? null : e.contentMatch);
2311
2311
  }
2312
2312
  findWrapping(e) {
2313
2313
  if (!this.match) {
@@ -2324,7 +2324,7 @@ class $t {
2324
2324
  return this.match.findWrapping(e.type);
2325
2325
  }
2326
2326
  finish(e) {
2327
- if (!(this.options & rn)) {
2327
+ if (!(this.options & sn)) {
2328
2328
  let r = this.content[this.content.length - 1], i;
2329
2329
  if (r && r.isText && (i = /[ \t\r\n\u000c]+$/.exec(r.text))) {
2330
2330
  let s = r;
@@ -2341,8 +2341,8 @@ class $t {
2341
2341
  class $r {
2342
2342
  constructor(e, t, r) {
2343
2343
  this.parser = e, this.options = t, this.isOpen = r, this.open = 0;
2344
- let i = t.topNode, s, o = Hr(null, t.preserveWhitespace, 0) | (r ? Ct : 0);
2345
- i ? s = new $t(i.type, i.attrs, O.none, !0, t.topMatch || i.type.contentMatch, o) : r ? s = new $t(null, null, O.none, !0, null, o) : s = new $t(e.schema.topNodeType, null, O.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
2344
+ let i = t.topNode, s, o = Hr(null, t.preserveWhitespace, 0) | (r ? wt : 0);
2345
+ i ? s = new Wt(i.type, i.attrs, O.none, !0, t.topMatch || i.type.contentMatch, o) : r ? s = new Wt(null, null, O.none, !0, null, o) : s = new Wt(e.schema.topNodeType, null, O.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
2346
2346
  }
2347
2347
  get top() {
2348
2348
  return this.nodes[this.open];
@@ -2355,9 +2355,9 @@ class $r {
2355
2355
  }
2356
2356
  addTextNode(e, t) {
2357
2357
  let r = e.nodeValue, i = this.top;
2358
- if (i.options & sn || i.inlineContext(e) || /[^ \t\r\n\u000c]/.test(r)) {
2359
- if (i.options & rn)
2360
- i.options & sn ? r = r.replace(/\r\n?/g, `
2358
+ if (i.options & on || i.inlineContext(e) || /[^ \t\r\n\u000c]/.test(r)) {
2359
+ if (i.options & sn)
2360
+ i.options & on ? r = r.replace(/\r\n?/g, `
2361
2361
  `) : r = r.replace(/\r?\n|\r/g, " ");
2362
2362
  else if (r = r.replace(/[ \t\r\n\u000c]+/g, " "), /^[ \t\r\n\u000c]/.test(r) && this.open == this.nodes.length - 1) {
2363
2363
  let s = i.content[i.content.length - 1], o = e.previousSibling;
@@ -2508,9 +2508,9 @@ class $r {
2508
2508
  let o = this.top;
2509
2509
  o.match = o.match && o.match.matchType(e);
2510
2510
  let l = Hr(e, s, o.options);
2511
- o.options & Ct && o.content.length == 0 && (l |= Ct);
2511
+ o.options & wt && o.content.length == 0 && (l |= wt);
2512
2512
  let a = O.none;
2513
- return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : Jr(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new $t(e, t, a, i, null, l)), this.open++, r;
2513
+ return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : Jr(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new Wt(e, t, a, i, null, l)), this.open++, r;
2514
2514
  }
2515
2515
  // Make sure all nodes above this.open are finished and added to
2516
2516
  // their parents
@@ -2684,7 +2684,7 @@ class Ye {
2684
2684
  @internal
2685
2685
  */
2686
2686
  serializeNodeInner(e, t) {
2687
- let { dom: r, contentDOM: i } = jt(Nn(t), this.nodes[e.type.name](e), null, e.attrs);
2687
+ let { dom: r, contentDOM: i } = Ut(Nn(t), this.nodes[e.type.name](e), null, e.attrs);
2688
2688
  if (i) {
2689
2689
  if (e.isLeaf)
2690
2690
  throw new RangeError("Content hole not allowed in a leaf node spec");
@@ -2712,10 +2712,10 @@ class Ye {
2712
2712
  */
2713
2713
  serializeMark(e, t, r = {}) {
2714
2714
  let i = this.marks[e.type.name];
2715
- return i && jt(Nn(r), i(e, t), null, e.attrs);
2715
+ return i && Ut(Nn(r), i(e, t), null, e.attrs);
2716
2716
  }
2717
2717
  static renderSpec(e, t, r = null, i) {
2718
- return jt(e, t, r, i);
2718
+ return Ut(e, t, r, i);
2719
2719
  }
2720
2720
  /**
2721
2721
  Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
@@ -2771,7 +2771,7 @@ function bl(n) {
2771
2771
  }
2772
2772
  return t(n), e;
2773
2773
  }
2774
- function jt(n, e, t, r) {
2774
+ function Ut(n, e, t, r) {
2775
2775
  if (typeof e == "string")
2776
2776
  return { dom: n.createTextNode(e) };
2777
2777
  if (e.nodeType != null)
@@ -2801,7 +2801,7 @@ function jt(n, e, t, r) {
2801
2801
  throw new RangeError("Content hole must be the only child of its parent node");
2802
2802
  return { dom: a, contentDOM: a };
2803
2803
  } else {
2804
- let { dom: u, contentDOM: p } = jt(n, d, t, r);
2804
+ let { dom: u, contentDOM: p } = Ut(n, d, t, r);
2805
2805
  if (a.appendChild(u), p) {
2806
2806
  if (l)
2807
2807
  throw new RangeError("Multiple content holes");
@@ -2821,7 +2821,7 @@ function jr(n) {
2821
2821
  function xl(n) {
2822
2822
  return (n - (n & xs)) / Ss;
2823
2823
  }
2824
- const Cs = 1, ws = 2, Ut = 4, Ms = 8;
2824
+ const Cs = 1, ws = 2, Gt = 4, Ms = 8;
2825
2825
  class _n {
2826
2826
  /**
2827
2827
  @internal
@@ -2841,13 +2841,13 @@ class _n {
2841
2841
  Tells you whether the token before the mapped position was deleted.
2842
2842
  */
2843
2843
  get deletedBefore() {
2844
- return (this.delInfo & (Cs | Ut)) > 0;
2844
+ return (this.delInfo & (Cs | Gt)) > 0;
2845
2845
  }
2846
2846
  /**
2847
2847
  True when the token after the mapped position was deleted.
2848
2848
  */
2849
2849
  get deletedAfter() {
2850
- return (this.delInfo & (ws | Ut)) > 0;
2850
+ return (this.delInfo & (ws | Gt)) > 0;
2851
2851
  }
2852
2852
  /**
2853
2853
  Tells whether any of the steps mapped through deletes across the
@@ -2855,7 +2855,7 @@ class _n {
2855
2855
  position).
2856
2856
  */
2857
2857
  get deletedAcross() {
2858
- return (this.delInfo & Ut) > 0;
2858
+ return (this.delInfo & Gt) > 0;
2859
2859
  }
2860
2860
  }
2861
2861
  class X {
@@ -2898,7 +2898,7 @@ class X {
2898
2898
  let d = c ? e == a ? -1 : e == h ? 1 : t : t, u = a + i + (d < 0 ? 0 : f);
2899
2899
  if (r)
2900
2900
  return u;
2901
- let p = e == (t < 0 ? a : h) ? null : kl(l / 3, e - a), m = e == a ? ws : e == h ? Cs : Ut;
2901
+ let p = e == (t < 0 ? a : h) ? null : kl(l / 3, e - a), m = e == a ? ws : e == h ? Cs : Gt;
2902
2902
  return (t < 0 ? e != a : e != h) && (m |= Ms), new _n(u, m, p);
2903
2903
  }
2904
2904
  i += f - c;
@@ -3132,7 +3132,7 @@ class E {
3132
3132
  try {
3133
3133
  return E.ok(e.replace(t, r, i));
3134
3134
  } catch (s) {
3135
- if (s instanceof Qt)
3135
+ if (s instanceof en)
3136
3136
  return E.fail(s.message);
3137
3137
  throw s;
3138
3138
  }
@@ -3355,7 +3355,7 @@ class $ extends J {
3355
3355
  }
3356
3356
  }
3357
3357
  J.jsonID("replace", $);
3358
- class F extends J {
3358
+ class L extends J {
3359
3359
  /**
3360
3360
  Create a replace-around step with the given range and gap.
3361
3361
  `insert` should be the point in the slice into which the content
@@ -3386,11 +3386,11 @@ class F extends J {
3386
3386
  }
3387
3387
  invert(e) {
3388
3388
  let t = this.gapTo - this.gapFrom;
3389
- return new F(this.from, this.from + this.slice.size + t, this.from + this.insert, this.from + this.insert + t, e.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
3389
+ return new L(this.from, this.from + this.slice.size + t, this.from + this.insert, this.from + this.insert + t, e.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
3390
3390
  }
3391
3391
  map(e) {
3392
3392
  let t = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1), i = this.from == this.gapFrom ? t.pos : e.map(this.gapFrom, -1), s = this.to == this.gapTo ? r.pos : e.map(this.gapTo, 1);
3393
- return t.deletedAcross && r.deletedAcross || i < t.pos || s > r.pos ? null : new F(t.pos, r.pos, i, s, this.slice, this.insert, this.structure);
3393
+ return t.deletedAcross && r.deletedAcross || i < t.pos || s > r.pos ? null : new L(t.pos, r.pos, i, s, this.slice, this.insert, this.structure);
3394
3394
  }
3395
3395
  toJSON() {
3396
3396
  let e = {
@@ -3409,10 +3409,10 @@ class F extends J {
3409
3409
  static fromJSON(e, t) {
3410
3410
  if (typeof t.from != "number" || typeof t.to != "number" || typeof t.gapFrom != "number" || typeof t.gapTo != "number" || typeof t.insert != "number")
3411
3411
  throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
3412
- return new F(t.from, t.to, t.gapFrom, t.gapTo, k.fromJSON(e, t.slice), t.insert, !!t.structure);
3412
+ return new L(t.from, t.to, t.gapFrom, t.gapTo, k.fromJSON(e, t.slice), t.insert, !!t.structure);
3413
3413
  }
3414
3414
  }
3415
- J.jsonID("replaceAround", F);
3415
+ J.jsonID("replaceAround", L);
3416
3416
  function Xn(n, e, t) {
3417
3417
  let r = n.resolve(e), i = t - e, s = r.depth;
3418
3418
  for (; i > 0 && s > 0 && r.indexAfter(s) == r.node(s).childCount; )
@@ -3512,7 +3512,7 @@ function Ml(n, e, t) {
3512
3512
  let d = y.empty, u = 0;
3513
3513
  for (let p = s, m = !1; p > t; p--)
3514
3514
  m || i.after(p + 1) < i.end(p) ? (m = !0, d = y.from(i.node(p).copy(d)), u++) : c++;
3515
- n.step(new F(a, c, o, l, new k(f.append(d), h, u), f.size - h, !0));
3515
+ n.step(new L(a, c, o, l, new k(f.append(d), h, u), f.size - h, !0));
3516
3516
  }
3517
3517
  function Os(n, e, t = null, r = n) {
3518
3518
  let i = Ol(n, e), s = i && Nl(r, e);
@@ -3548,7 +3548,7 @@ function Tl(n, e, t) {
3548
3548
  r = y.from(t[o].type.create(t[o].attrs, r));
3549
3549
  }
3550
3550
  let i = e.start, s = e.end;
3551
- n.step(new F(i, s, i, s, new k(r, 0, 0), t.length, !0));
3551
+ n.step(new L(i, s, i, s, new k(r, 0, 0), t.length, !0));
3552
3552
  }
3553
3553
  function Al(n, e, t, r, i) {
3554
3554
  if (!r.isTextblock)
@@ -3564,7 +3564,7 @@ function Al(n, e, t, r, i) {
3564
3564
  }
3565
3565
  c === !1 && Ts(n, o, l, s), yr(n, n.mapping.slice(s).map(l, 1), r, void 0, c === null);
3566
3566
  let f = n.mapping.slice(s), h = f.map(l, 1), d = f.map(l + o.nodeSize, 1);
3567
- return n.step(new F(h, d, h + 1, d - 1, new k(y.from(r.create(a, null, o.marks)), 0, 0), 1, !0)), c === !0 && Ns(n, o, l, s), !1;
3567
+ return n.step(new L(h, d, h + 1, d - 1, new k(y.from(r.create(a, null, o.marks)), 0, 0), 1, !0)), c === !0 && Ns(n, o, l, s), !1;
3568
3568
  }
3569
3569
  });
3570
3570
  }
@@ -3602,7 +3602,7 @@ function El(n, e, t, r, i) {
3602
3602
  return n.replaceWith(e, e + s.nodeSize, o);
3603
3603
  if (!t.validContent(s.content))
3604
3604
  throw new RangeError("Invalid content for node type " + t.name);
3605
- n.step(new F(e, e + s.nodeSize, e + 1, e + s.nodeSize - 1, new k(y.from(o), 0, 0), 1, !0));
3605
+ n.step(new L(e, e + s.nodeSize, e + 1, e + s.nodeSize - 1, new k(y.from(o), 0, 0), 1, !0));
3606
3606
  }
3607
3607
  function st(n, e, t = 1, r) {
3608
3608
  let i = n.resolve(e), s = i.depth - t, o = r && r[r.length - 1] || i.parent;
@@ -3746,7 +3746,7 @@ class Vl {
3746
3746
  for (; o && l && s.childCount == 1; )
3747
3747
  s = s.firstChild.content, o--, l--;
3748
3748
  let a = new k(s, o, l);
3749
- return e > -1 ? new F(r.pos, e, this.$to.pos, this.$to.end(), a, t) : a.size || r.pos != this.$to.pos ? new $(r.pos, i.pos, a) : null;
3749
+ return e > -1 ? new L(r.pos, e, this.$to.pos, this.$to.end(), a, t) : a.size || r.pos != this.$to.pos ? new $(r.pos, i.pos, a) : null;
3750
3750
  }
3751
3751
  // Find a position on the start spine of `this.unplaced` that has
3752
3752
  // content that can be moved somewhere on the frontier. Returns two
@@ -3785,9 +3785,9 @@ class Vl {
3785
3785
  let { content: e, openStart: t, openEnd: r } = this.unplaced, i = An(e, t);
3786
3786
  if (i.childCount <= 1 && t > 0) {
3787
3787
  let s = e.size - t <= t + i.size;
3788
- this.unplaced = new k(bt(e, t - 1, 1), t - 1, s ? t - 1 : r);
3788
+ this.unplaced = new k(kt(e, t - 1, 1), t - 1, s ? t - 1 : r);
3789
3789
  } else
3790
- this.unplaced = new k(bt(e, t, 1), t, r);
3790
+ this.unplaced = new k(kt(e, t, 1), t, r);
3791
3791
  }
3792
3792
  // Move content from the unplaced slice at `sliceDepth` to the
3793
3793
  // frontier node at `frontierDepth`. Close that frontier node when
@@ -3812,12 +3812,12 @@ class Vl {
3812
3812
  c++, (c > 1 || a == 0 || m.content.size) && (h = g, f.push(Ds(m.mark(d.allowedMarks(m.marks)), c == 1 ? a : 0, c == l.childCount ? u : -1)));
3813
3813
  }
3814
3814
  let p = c == l.childCount;
3815
- p || (u = -1), this.placed = kt(this.placed, t, y.from(f)), this.frontier[t].match = h, p && u < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
3815
+ p || (u = -1), this.placed = xt(this.placed, t, y.from(f)), this.frontier[t].match = h, p && u < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
3816
3816
  for (let m = 0, g = l; m < u; m++) {
3817
3817
  let b = g.lastChild;
3818
3818
  this.frontier.push({ type: b.type, match: b.contentMatchAt(b.childCount) }), g = b.content;
3819
3819
  }
3820
- this.unplaced = p ? e == 0 ? k.empty : new k(bt(o.content, e - 1, 1), e - 1, u < 0 ? o.openEnd : e - 1) : new k(bt(o.content, e, c), o.openStart, o.openEnd);
3820
+ this.unplaced = p ? e == 0 ? k.empty : new k(kt(o.content, e - 1, 1), e - 1, u < 0 ? o.openEnd : e - 1) : new k(kt(o.content, e, c), o.openStart, o.openEnd);
3821
3821
  }
3822
3822
  mustMoveInline() {
3823
3823
  if (!this.$to.parent.isTextblock)
@@ -3849,7 +3849,7 @@ class Vl {
3849
3849
  return null;
3850
3850
  for (; this.depth > t.depth; )
3851
3851
  this.closeFrontierNode();
3852
- t.fit.childCount && (this.placed = kt(this.placed, t.depth, t.fit)), e = t.move;
3852
+ t.fit.childCount && (this.placed = xt(this.placed, t.depth, t.fit)), e = t.move;
3853
3853
  for (let r = t.depth + 1; r <= e.depth; r++) {
3854
3854
  let i = e.node(r), s = i.type.contentMatch.fillBefore(i.content, !0, e.index(r));
3855
3855
  this.openFrontierNode(i.type, i.attrs, s);
@@ -3858,18 +3858,18 @@ class Vl {
3858
3858
  }
3859
3859
  openFrontierNode(e, t = null, r) {
3860
3860
  let i = this.frontier[this.depth];
3861
- i.match = i.match.matchType(e), this.placed = kt(this.placed, this.depth, y.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
3861
+ i.match = i.match.matchType(e), this.placed = xt(this.placed, this.depth, y.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
3862
3862
  }
3863
3863
  closeFrontierNode() {
3864
3864
  let t = this.frontier.pop().match.fillBefore(y.empty, !0);
3865
- t.childCount && (this.placed = kt(this.placed, this.frontier.length, t));
3865
+ t.childCount && (this.placed = xt(this.placed, this.frontier.length, t));
3866
3866
  }
3867
3867
  }
3868
- function bt(n, e, t) {
3869
- return e == 0 ? n.cutByIndex(t, n.childCount) : n.replaceChild(0, n.firstChild.copy(bt(n.firstChild.content, e - 1, t)));
3870
- }
3871
3868
  function kt(n, e, t) {
3872
- return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(kt(n.lastChild.content, e - 1, t)));
3869
+ return e == 0 ? n.cutByIndex(t, n.childCount) : n.replaceChild(0, n.firstChild.copy(kt(n.firstChild.content, e - 1, t)));
3870
+ }
3871
+ function xt(n, e, t) {
3872
+ return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(xt(n.lastChild.content, e - 1, t)));
3873
3873
  }
3874
3874
  function An(n, e) {
3875
3875
  for (let t = 0; t < e; t++)
@@ -3887,15 +3887,15 @@ function Dn(n, e, t, r, i) {
3887
3887
  if (o == s.childCount && !t.compatibleContent(s.type))
3888
3888
  return null;
3889
3889
  let l = r.fillBefore(s.content, !0, o);
3890
- return l && !Fl(t, s.content, o) ? l : null;
3890
+ return l && !Ll(t, s.content, o) ? l : null;
3891
3891
  }
3892
- function Fl(n, e, t) {
3892
+ function Ll(n, e, t) {
3893
3893
  for (let r = t; r < e.childCount; r++)
3894
3894
  if (!n.allowsMarks(e.child(r).marks))
3895
3895
  return !0;
3896
3896
  return !1;
3897
3897
  }
3898
- function Ll(n) {
3898
+ function Fl(n) {
3899
3899
  return n.spec.defining || n.spec.definingForContent;
3900
3900
  }
3901
3901
  function Hl(n, e, t, r) {
@@ -3922,7 +3922,7 @@ function Hl(n, e, t, r) {
3922
3922
  d = p.content;
3923
3923
  }
3924
3924
  for (let d = f - 1; d >= 0; d--) {
3925
- let u = c[d], p = Ll(u.type);
3925
+ let u = c[d], p = Fl(u.type);
3926
3926
  if (p && !u.sameMarkup(i.node(Math.abs(l) - 1)))
3927
3927
  f = d;
3928
3928
  else if (p || !u.type.isTextblock)
@@ -4025,7 +4025,7 @@ class ot extends J {
4025
4025
  }
4026
4026
  }
4027
4027
  J.jsonID("attr", ot);
4028
- class Tt extends J {
4028
+ class At extends J {
4029
4029
  /**
4030
4030
  Construct an attribute step.
4031
4031
  */
@@ -4044,7 +4044,7 @@ class Tt extends J {
4044
4044
  return X.empty;
4045
4045
  }
4046
4046
  invert(e) {
4047
- return new Tt(this.attr, e.attrs[this.attr]);
4047
+ return new At(this.attr, e.attrs[this.attr]);
4048
4048
  }
4049
4049
  map(e) {
4050
4050
  return this;
@@ -4055,10 +4055,10 @@ class Tt extends J {
4055
4055
  static fromJSON(e, t) {
4056
4056
  if (typeof t.attr != "string")
4057
4057
  throw new RangeError("Invalid input for DocAttrStep.fromJSON");
4058
- return new Tt(t.attr, t.value);
4058
+ return new At(t.attr, t.value);
4059
4059
  }
4060
4060
  }
4061
- J.jsonID("docAttr", Tt);
4061
+ J.jsonID("docAttr", At);
4062
4062
  let ct = class extends Error {
4063
4063
  };
4064
4064
  ct = function n(e) {
@@ -4231,7 +4231,7 @@ class Is {
4231
4231
  Set a single attribute on the document to a new value.
4232
4232
  */
4233
4233
  setDocAttribute(e, t) {
4234
- return this.step(new Tt(e, t)), this;
4234
+ return this.step(new At(e, t)), this;
4235
4235
  }
4236
4236
  /**
4237
4237
  Add a mark to the node at position `pos`.
@@ -4676,14 +4676,14 @@ function Xr(n, e, t) {
4676
4676
  if (r < e)
4677
4677
  return;
4678
4678
  let i = n.steps[r];
4679
- if (!(i instanceof $ || i instanceof F))
4679
+ if (!(i instanceof $ || i instanceof L))
4680
4680
  return;
4681
4681
  let s = n.mapping.maps[r], o;
4682
4682
  s.forEach((l, a, c, f) => {
4683
4683
  o == null && (o = f);
4684
4684
  }), n.setSelection(S.near(n.doc.resolve(o), t));
4685
4685
  }
4686
- const Yr = 1, Wt = 2, Zr = 4;
4686
+ const Yr = 1, Jt = 2, Zr = 4;
4687
4687
  class ql extends Is {
4688
4688
  /**
4689
4689
  @internal
@@ -4707,7 +4707,7 @@ class ql extends Is {
4707
4707
  setSelection(e) {
4708
4708
  if (e.$from.doc != this.doc)
4709
4709
  throw new RangeError("Selection passed to setSelection must point at the current document");
4710
- return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | Yr) & ~Wt, this.storedMarks = null, this;
4710
+ return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | Yr) & ~Jt, this.storedMarks = null, this;
4711
4711
  }
4712
4712
  /**
4713
4713
  Whether the selection was explicitly updated by this transaction.
@@ -4719,7 +4719,7 @@ class ql extends Is {
4719
4719
  Set the current stored marks.
4720
4720
  */
4721
4721
  setStoredMarks(e) {
4722
- return this.storedMarks = e, this.updated |= Wt, this;
4722
+ return this.storedMarks = e, this.updated |= Jt, this;
4723
4723
  }
4724
4724
  /**
4725
4725
  Make sure the current stored marks or, if that is null, the marks
@@ -4745,13 +4745,13 @@ class ql extends Is {
4745
4745
  Whether the stored marks were explicitly set for this transaction.
4746
4746
  */
4747
4747
  get storedMarksSet() {
4748
- return (this.updated & Wt) > 0;
4748
+ return (this.updated & Jt) > 0;
4749
4749
  }
4750
4750
  /**
4751
4751
  @internal
4752
4752
  */
4753
4753
  addStep(e, t) {
4754
- super.addStep(e, t), this.updated = this.updated & ~Wt, this.storedMarks = null;
4754
+ super.addStep(e, t), this.updated = this.updated & ~Jt, this.storedMarks = null;
4755
4755
  }
4756
4756
  /**
4757
4757
  Update the timestamp for the transaction.
@@ -4838,13 +4838,13 @@ class ql extends Is {
4838
4838
  function Qr(n, e) {
4839
4839
  return !e || !n ? n : n.bind(e);
4840
4840
  }
4841
- class xt {
4841
+ class St {
4842
4842
  constructor(e, t, r) {
4843
4843
  this.name = e, this.init = Qr(t.init, r), this.apply = Qr(t.apply, r);
4844
4844
  }
4845
4845
  }
4846
4846
  const Kl = [
4847
- new xt("doc", {
4847
+ new St("doc", {
4848
4848
  init(n) {
4849
4849
  return n.doc || n.schema.topNodeType.createAndFill();
4850
4850
  },
@@ -4852,7 +4852,7 @@ const Kl = [
4852
4852
  return n.doc;
4853
4853
  }
4854
4854
  }),
4855
- new xt("selection", {
4855
+ new St("selection", {
4856
4856
  init(n, e) {
4857
4857
  return n.selection || S.atStart(e.doc);
4858
4858
  },
@@ -4860,7 +4860,7 @@ const Kl = [
4860
4860
  return n.selection;
4861
4861
  }
4862
4862
  }),
4863
- new xt("storedMarks", {
4863
+ new St("storedMarks", {
4864
4864
  init(n) {
4865
4865
  return n.storedMarks || null;
4866
4866
  },
@@ -4868,7 +4868,7 @@ const Kl = [
4868
4868
  return r.selection.$cursor ? n.storedMarks : null;
4869
4869
  }
4870
4870
  }),
4871
- new xt("scrollToSelection", {
4871
+ new St("scrollToSelection", {
4872
4872
  init() {
4873
4873
  return 0;
4874
4874
  },
@@ -4882,7 +4882,7 @@ class Rn {
4882
4882
  this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Kl.slice(), t && t.forEach((r) => {
4883
4883
  if (this.pluginsByKey[r.key])
4884
4884
  throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
4885
- this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new xt(r.key, r.spec.state, r));
4885
+ this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new St(r.key, r.spec.state, r));
4886
4886
  });
4887
4887
  }
4888
4888
  }
@@ -5058,7 +5058,7 @@ function zs(n, e, t) {
5058
5058
  }
5059
5059
  return t;
5060
5060
  }
5061
- class ut {
5061
+ class pt {
5062
5062
  /**
5063
5063
  Create a plugin.
5064
5064
  */
@@ -5076,7 +5076,7 @@ const In = /* @__PURE__ */ Object.create(null);
5076
5076
  function Bs(n) {
5077
5077
  return n in In ? n + "$" + ++In[n] : (In[n] = 0, n + "$");
5078
5078
  }
5079
- class vt {
5079
+ class zt {
5080
5080
  /**
5081
5081
  Create a plugin key.
5082
5082
  */
@@ -5168,7 +5168,7 @@ const Xl = (n, e, t) => {
5168
5168
  let r = _l(n, t);
5169
5169
  if (!r)
5170
5170
  return !1;
5171
- let i = Fs(r);
5171
+ let i = Ls(r);
5172
5172
  if (!i)
5173
5173
  return !1;
5174
5174
  let s = i.nodeAfter;
@@ -5192,12 +5192,12 @@ const Xl = (n, e, t) => {
5192
5192
  if (r.parent.isTextblock) {
5193
5193
  if (t ? !t.endOfTextblock("forward", n) : r.parentOffset < r.parent.content.size)
5194
5194
  return !1;
5195
- s = Fs(r);
5195
+ s = Ls(r);
5196
5196
  }
5197
5197
  let o = s && s.nodeAfter;
5198
5198
  return !o || !x.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(x.create(n.doc, s.pos)).scrollIntoView()), !0);
5199
5199
  };
5200
- function Fs(n) {
5200
+ function Ls(n) {
5201
5201
  if (!n.parent.type.spec.isolating)
5202
5202
  for (let e = n.depth - 1; e >= 0; e--) {
5203
5203
  let t = n.node(e);
@@ -5221,7 +5221,7 @@ function xr(n) {
5221
5221
  }
5222
5222
  return null;
5223
5223
  }
5224
- const Ls = (n, e) => {
5224
+ const Fs = (n, e) => {
5225
5225
  let { $head: t, $anchor: r } = n.selection;
5226
5226
  if (!t.parent.type.spec.code || !t.sameParent(r))
5227
5227
  return !1;
@@ -5302,7 +5302,7 @@ function Js(n, e, t, r) {
5302
5302
  for (let b = o.length - 1; b >= 0; b--)
5303
5303
  p = y.from(o[b].create(null, p));
5304
5304
  p = y.from(i.copy(p));
5305
- let m = n.tr.step(new F(e.pos - 1, u, e.pos, u, new k(p, 1, 0), o.length, !0)), g = m.doc.resolve(u + 2 * o.length);
5305
+ let m = n.tr.step(new L(e.pos - 1, u, e.pos, u, new k(p, 1, 0), o.length, !0)), g = m.doc.resolve(u + 2 * o.length);
5306
5306
  g.nodeAfter && g.nodeAfter.type == i.type && yn(m.doc, g.pos) && m.join(g.pos), t(m.scrollIntoView());
5307
5307
  }
5308
5308
  return !0;
@@ -5322,7 +5322,7 @@ function Js(n, e, t, r) {
5322
5322
  let b = y.empty;
5323
5323
  for (let N = p.length - 1; N >= 0; N--)
5324
5324
  b = y.from(p[N].copy(b));
5325
- let w = n.tr.step(new F(e.pos - p.length, e.pos + s.nodeSize, e.pos + g, e.pos + s.nodeSize - g, new k(b, p.length, 0), 0, !0));
5325
+ let w = n.tr.step(new L(e.pos - p.length, e.pos + s.nodeSize, e.pos + g, e.pos + s.nodeSize - g, new k(b, p.length, 0), 0, !0));
5326
5326
  t(w.scrollIntoView());
5327
5327
  }
5328
5328
  return !0;
@@ -5410,7 +5410,7 @@ function Pe(n, e = null, t) {
5410
5410
  return !0;
5411
5411
  };
5412
5412
  }
5413
- function At(...n) {
5413
+ function Dt(...n) {
5414
5414
  return function(e, t, r) {
5415
5415
  for (let i = 0; i < n.length; i++)
5416
5416
  if (n[i](e, t, r))
@@ -5418,10 +5418,10 @@ function At(...n) {
5418
5418
  return !1;
5419
5419
  };
5420
5420
  }
5421
- let vn = At(Ps, Ul, Gl), ei = At(Ps, Xl, Yl);
5421
+ let vn = Dt(Ps, Ul, Gl), ei = Dt(Ps, Xl, Yl);
5422
5422
  const ye = {
5423
- Enter: At(Zl, Ql, Hs, ea),
5424
- "Mod-Enter": Ls,
5423
+ Enter: Dt(Zl, Ql, Hs, ea),
5424
+ "Mod-Enter": Fs,
5425
5425
  Backspace: vn,
5426
5426
  "Mod-Backspace": vn,
5427
5427
  "Shift-Backspace": vn,
@@ -5441,10 +5441,10 @@ const ye = {
5441
5441
  for (let n in ye)
5442
5442
  Ks[n] = ye[n];
5443
5443
  const oa = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform ? os.platform() == "darwin" : !1, la = oa ? Ks : ye;
5444
- var on = 200, v = function() {
5444
+ var ln = 200, v = function() {
5445
5445
  };
5446
5446
  v.prototype.append = function(e) {
5447
- return e.length ? (e = v.from(e), !this.length && e || e.length < on && this.leafAppend(e) || this.length < on && e.leafPrepend(this) || this.appendInner(e)) : this;
5447
+ return e.length ? (e = v.from(e), !this.length && e || e.length < ln && this.leafAppend(e) || this.length < ln && e.leafPrepend(this) || this.appendInner(e)) : this;
5448
5448
  };
5449
5449
  v.prototype.prepend = function(e) {
5450
5450
  return e.length ? v.from(e).append(this) : this;
@@ -5493,10 +5493,10 @@ var js = /* @__PURE__ */ function(n) {
5493
5493
  if (i(this.values[a], l + a) === !1)
5494
5494
  return !1;
5495
5495
  }, e.prototype.leafAppend = function(i) {
5496
- if (this.length + i.length <= on)
5496
+ if (this.length + i.length <= ln)
5497
5497
  return new e(this.values.concat(i.flatten()));
5498
5498
  }, e.prototype.leafPrepend = function(i) {
5499
- if (this.length + i.length <= on)
5499
+ if (this.length + i.length <= ln)
5500
5500
  return new e(i.flatten().concat(this.values));
5501
5501
  }, t.length.get = function() {
5502
5502
  return this.values.length;
@@ -5686,10 +5686,10 @@ function da(n, e, t, r) {
5686
5686
  if (t.steps.length == 0)
5687
5687
  return n;
5688
5688
  if (o && o.getMeta(qe))
5689
- return o.getMeta(qe).redo ? new we(n.done.addTransform(t, void 0, r, Gt(e)), n.undone, ti(t.mapping.maps), n.prevTime, n.prevComposition) : new we(n.done, n.undone.addTransform(t, void 0, r, Gt(e)), null, n.prevTime, n.prevComposition);
5689
+ return o.getMeta(qe).redo ? new we(n.done.addTransform(t, void 0, r, _t(e)), n.undone, ti(t.mapping.maps), n.prevTime, n.prevComposition) : new we(n.done, n.undone.addTransform(t, void 0, r, _t(e)), null, n.prevTime, n.prevComposition);
5690
5690
  if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
5691
5691
  let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !ua(t, n.prevRanges)), c = o ? zn(n.prevRanges, t.mapping) : ti(t.mapping.maps);
5692
- return new we(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, Gt(e)), ie.empty, c, t.time, l ?? n.prevComposition);
5692
+ return new we(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, _t(e)), ie.empty, c, t.time, l ?? n.prevComposition);
5693
5693
  } else return (s = t.getMeta("rebased")) ? new we(n.done.rebased(t, s), n.undone.rebased(t, s), zn(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new we(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), zn(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
5694
5694
  }
5695
5695
  function ua(n, e) {
@@ -5720,14 +5720,14 @@ function zn(n, e) {
5720
5720
  return t;
5721
5721
  }
5722
5722
  function pa(n, e, t) {
5723
- let r = Gt(e), i = qe.get(e).spec.config, s = (t ? n.undone : n.done).popEvent(e, r);
5723
+ let r = _t(e), i = qe.get(e).spec.config, s = (t ? n.undone : n.done).popEvent(e, r);
5724
5724
  if (!s)
5725
5725
  return null;
5726
5726
  let o = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), i, r), a = new we(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
5727
5727
  return s.transform.setSelection(o).setMeta(qe, { redo: t, historyState: a });
5728
5728
  }
5729
5729
  let Bn = !1, ni = null;
5730
- function Gt(n) {
5730
+ function _t(n) {
5731
5731
  let e = n.plugins;
5732
5732
  if (ni != e) {
5733
5733
  Bn = !1, ni = e;
@@ -5739,12 +5739,12 @@ function Gt(n) {
5739
5739
  }
5740
5740
  return Bn;
5741
5741
  }
5742
- const qe = new vt("history"), ma = new vt("closeHistory");
5742
+ const qe = new zt("history"), ma = new zt("closeHistory");
5743
5743
  function ga(n = {}) {
5744
5744
  return n = {
5745
5745
  depth: n.depth || 100,
5746
5746
  newGroupDelay: n.newGroupDelay || 500
5747
- }, new ut({
5747
+ }, new pt({
5748
5748
  key: qe,
5749
5749
  state: {
5750
5750
  init() {
@@ -5831,7 +5831,7 @@ var ve = {
5831
5831
  220: "\\",
5832
5832
  221: "]",
5833
5833
  222: "'"
5834
- }, ln = {
5834
+ }, an = {
5835
5835
  48: ")",
5836
5836
  49: "!",
5837
5837
  50: "@",
@@ -5860,10 +5860,10 @@ var ve = {
5860
5860
  for (var P = 0; P < 10; P++) ve[48 + P] = ve[96 + P] = String(P);
5861
5861
  for (var P = 1; P <= 24; P++) ve[P + 111] = "F" + P;
5862
5862
  for (var P = 65; P <= 90; P++)
5863
- ve[P] = String.fromCharCode(P + 32), ln[P] = String.fromCharCode(P);
5864
- for (var Pn in ve) ln.hasOwnProperty(Pn) || (ln[Pn] = ve[Pn]);
5863
+ ve[P] = String.fromCharCode(P + 32), an[P] = String.fromCharCode(P);
5864
+ for (var Pn in ve) an.hasOwnProperty(Pn) || (an[Pn] = ve[Pn]);
5865
5865
  function ka(n) {
5866
- var e = ya && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || ba && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? ln : ve)[n.keyCode] || n.key || "Unidentified";
5866
+ var e = ya && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || ba && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? an : ve)[n.keyCode] || n.key || "Unidentified";
5867
5867
  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;
5868
5868
  }
5869
5869
  const xa = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
@@ -5897,8 +5897,8 @@ function Ca(n) {
5897
5897
  function Vn(n, e, t = !0) {
5898
5898
  return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
5899
5899
  }
5900
- function Fn(n) {
5901
- return new ut({ props: { handleKeyDown: _s(n) } });
5900
+ function Ln(n) {
5901
+ return new pt({ props: { handleKeyDown: _s(n) } });
5902
5902
  }
5903
5903
  function _s(n) {
5904
5904
  let e = Ca(n);
@@ -5930,7 +5930,7 @@ function ri(n, e = null) {
5930
5930
  if (i.index(o.depth - 1) == 0)
5931
5931
  return !1;
5932
5932
  let f = t.doc.resolve(o.start - 2);
5933
- a = new tn(f, f, o.depth), o.endIndex < o.parent.childCount && (o = new tn(i, t.doc.resolve(s.end(o.depth)), o.depth)), l = !0;
5933
+ a = new nn(f, f, o.depth), o.endIndex < o.parent.childCount && (o = new nn(i, t.doc.resolve(s.end(o.depth)), o.depth)), l = !0;
5934
5934
  }
5935
5935
  let c = Os(a, n, e, o);
5936
5936
  return c ? (r && r(wa(t.tr, o, c, l, n).scrollIntoView()), !0) : !1;
@@ -5940,7 +5940,7 @@ function wa(n, e, t, r, i) {
5940
5940
  let s = y.empty;
5941
5941
  for (let f = t.length - 1; f >= 0; f--)
5942
5942
  s = y.from(t[f].type.create(t[f].attrs, s));
5943
- n.step(new F(e.start - (r ? 2 : 0), e.end, e.start, e.end, new k(s, 0, 0), t.length, !0));
5943
+ n.step(new L(e.start - (r ? 2 : 0), e.end, e.start, e.end, new k(s, 0, 0), t.length, !0));
5944
5944
  let o = 0;
5945
5945
  for (let f = 0; f < t.length; f++)
5946
5946
  t[f].type == i && (o = f + 1);
@@ -5987,7 +5987,7 @@ function Zn(n) {
5987
5987
  }
5988
5988
  function Oa(n, e, t, r) {
5989
5989
  let i = n.tr, s = r.end, o = r.$to.end(r.depth);
5990
- s < o && (i.step(new F(s - 1, o, s, o, new k(y.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new tn(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
5990
+ s < o && (i.step(new L(s - 1, o, s, o, new k(y.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new nn(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
5991
5991
  const l = gn(r);
5992
5992
  if (l == null)
5993
5993
  return !1;
@@ -6006,7 +6006,7 @@ function Na(n, e, t) {
6006
6006
  if (!c.canReplace(f + (l ? 0 : 1), f + 1, o.content.append(a ? y.empty : y.from(i))))
6007
6007
  return !1;
6008
6008
  let h = s.pos, d = h + o.nodeSize;
6009
- return r.step(new F(h - (l ? 1 : 0), d + (a ? 1 : 0), h + 1, d - 1, new k((l ? y.empty : y.from(i.copy(y.empty))).append(a ? y.empty : y.from(i.copy(y.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
6009
+ return r.step(new L(h - (l ? 1 : 0), d + (a ? 1 : 0), h + 1, d - 1, new k((l ? y.empty : y.from(i.copy(y.empty))).append(a ? y.empty : y.from(i.copy(y.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
6010
6010
  }
6011
6011
  function Ta(n) {
6012
6012
  return function(e, t) {
@@ -6021,7 +6021,7 @@ function Ta(n) {
6021
6021
  return !1;
6022
6022
  if (t) {
6023
6023
  let c = a.lastChild && a.lastChild.type == l.type, f = y.from(c ? n.create() : null), h = new k(y.from(n.create(null, y.from(l.type.create(null, f)))), c ? 3 : 1, 0), d = s.start, u = s.end;
6024
- t(e.tr.step(new F(d - (c ? 3 : 1), u, d, u, h, 1, !0)).scrollIntoView());
6024
+ t(e.tr.step(new L(d - (c ? 3 : 1), u, d, u, h, 1, !0)).scrollIntoView());
6025
6025
  }
6026
6026
  return !0;
6027
6027
  };
@@ -6030,7 +6030,7 @@ const V = function(n) {
6030
6030
  for (var e = 0; ; e++)
6031
6031
  if (n = n.previousSibling, !n)
6032
6032
  return e;
6033
- }, Dt = function(n) {
6033
+ }, Et = function(n) {
6034
6034
  let e = n.assignedSlot || n.parentNode;
6035
6035
  return e && e.nodeType == 11 ? e.host : e;
6036
6036
  };
@@ -6049,7 +6049,7 @@ function ii(n, e, t, r, i) {
6049
6049
  return !0;
6050
6050
  if (e == (i < 0 ? 0 : te(n))) {
6051
6051
  let s = n.parentNode;
6052
- if (!s || s.nodeType != 1 || zt(n) || Da.test(n.nodeName) || n.contentEditable == "false")
6052
+ if (!s || s.nodeType != 1 || Bt(n) || Da.test(n.nodeName) || n.contentEditable == "false")
6053
6053
  return !1;
6054
6054
  e = V(n) + (i < 0 ? 0 : 1), n = s;
6055
6055
  } else if (n.nodeType == 1) {
@@ -6071,7 +6071,7 @@ function Ea(n, e) {
6071
6071
  if (n.contentEditable == "false")
6072
6072
  return null;
6073
6073
  n = n.childNodes[e - 1], e = te(n);
6074
- } else if (n.parentNode && !zt(n))
6074
+ } else if (n.parentNode && !Bt(n))
6075
6075
  e = V(n), n = n.parentNode;
6076
6076
  else
6077
6077
  return null;
@@ -6085,7 +6085,7 @@ function Ra(n, e) {
6085
6085
  if (n.contentEditable == "false")
6086
6086
  return null;
6087
6087
  n = n.childNodes[e], e = 0;
6088
- } else if (n.parentNode && !zt(n))
6088
+ } else if (n.parentNode && !Bt(n))
6089
6089
  e = V(n) + 1, n = n.parentNode;
6090
6090
  else
6091
6091
  return null;
@@ -6101,7 +6101,7 @@ function Ia(n, e, t) {
6101
6101
  r = r && s == 0, i = i && s == te(n);
6102
6102
  }
6103
6103
  }
6104
- function zt(n) {
6104
+ function Bt(n) {
6105
6105
  let e;
6106
6106
  for (let t = n; t && !(e = t.pmViewDesc); t = t.parentNode)
6107
6107
  ;
@@ -6136,7 +6136,7 @@ function za(n, e, t) {
6136
6136
  }
6137
6137
  const he = typeof navigator < "u" ? navigator : null, si = typeof document < "u" ? document : null, ze = he && he.userAgent || "", er = /Edge\/(\d+)/.exec(ze), Xs = /MSIE \d/.exec(ze), tr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ze), _ = !!(Xs || tr || er), Ee = Xs ? document.documentMode : tr ? +tr[1] : er ? +er[1] : 0, se = !_ && /gecko\/(\d+)/i.test(ze);
6138
6138
  se && +(/Firefox\/(\d+)/.exec(ze) || [0, 0])[1];
6139
- const nr = !_ && /Chrome\/(\d+)/.exec(ze), W = !!nr, Ys = nr ? +nr[1] : 0, K = !_ && !!he && /Apple Computer/.test(he.vendor), ht = K && (/Mobile\/\w+/.test(ze) || !!he && he.maxTouchPoints > 2), ee = ht || (he ? /Mac/.test(he.platform) : !1), Ba = he ? /Win/.test(he.platform) : !1, re = /Android \d/.test(ze), Bt = !!si && "webkitFontSmoothing" in si.documentElement.style, Pa = Bt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
6139
+ const nr = !_ && /Chrome\/(\d+)/.exec(ze), W = !!nr, Ys = nr ? +nr[1] : 0, K = !_ && !!he && /Apple Computer/.test(he.vendor), ht = K && (/Mobile\/\w+/.test(ze) || !!he && he.maxTouchPoints > 2), ee = ht || (he ? /Mac/.test(he.platform) : !1), Ba = he ? /Win/.test(he.platform) : !1, re = /Android \d/.test(ze), Pt = !!si && "webkitFontSmoothing" in si.documentElement.style, Pa = Pt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
6140
6140
  function Va(n) {
6141
6141
  let e = n.defaultView && n.defaultView.visualViewport;
6142
6142
  return e ? {
@@ -6154,7 +6154,7 @@ function Va(n) {
6154
6154
  function pe(n, e) {
6155
6155
  return typeof n == "number" ? n : n[e];
6156
6156
  }
6157
- function Fa(n) {
6157
+ function La(n) {
6158
6158
  let e = n.getBoundingClientRect(), t = e.width / n.offsetWidth || 1, r = e.height / n.offsetHeight || 1;
6159
6159
  return {
6160
6160
  left: e.left,
@@ -6165,10 +6165,10 @@ function Fa(n) {
6165
6165
  }
6166
6166
  function oi(n, e, t) {
6167
6167
  let r = n.someProp("scrollThreshold") || 0, i = n.someProp("scrollMargin") || 5, s = n.dom.ownerDocument;
6168
- for (let o = t || n.dom; o; o = Dt(o)) {
6168
+ for (let o = t || n.dom; o; o = Et(o)) {
6169
6169
  if (o.nodeType != 1)
6170
6170
  continue;
6171
- let l = o, a = l == s.body, c = a ? Va(s) : Fa(l), f = 0, h = 0;
6171
+ let l = o, a = l == s.body, c = a ? Va(s) : La(l), f = 0, h = 0;
6172
6172
  if (e.top < c.top + pe(r, "top") ? h = -(c.top - e.top + pe(i, "top")) : e.bottom > c.bottom - pe(r, "bottom") && (h = e.bottom - e.top > c.bottom - c.top ? e.top + pe(i, "top") - c.top : e.bottom - c.bottom + pe(i, "bottom")), e.left < c.left + pe(r, "left") ? f = -(c.left - e.left + pe(i, "left")) : e.right > c.right - pe(r, "right") && (f = e.right - c.right + pe(i, "right")), f || h)
6173
6173
  if (a)
6174
6174
  s.defaultView.scrollBy(f, h);
@@ -6182,7 +6182,7 @@ function oi(n, e, t) {
6182
6182
  break;
6183
6183
  }
6184
6184
  }
6185
- function La(n) {
6185
+ function Fa(n) {
6186
6186
  let e = n.dom.getBoundingClientRect(), t = Math.max(0, e.top), r, i;
6187
6187
  for (let s = (e.left + e.right) / 2, o = t + 1; o < Math.min(innerHeight, e.bottom); o += 5) {
6188
6188
  let l = n.root.elementFromPoint(s, o);
@@ -6198,7 +6198,7 @@ function La(n) {
6198
6198
  }
6199
6199
  function Zs(n) {
6200
6200
  let e = [], t = n.ownerDocument;
6201
- for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r = Dt(r))
6201
+ for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r = Et(r))
6202
6202
  ;
6203
6203
  return e;
6204
6204
  }
@@ -6321,7 +6321,7 @@ function ja(n, e) {
6321
6321
  return null;
6322
6322
  }
6323
6323
  if (K)
6324
- for (let c = o; r && c; c = Dt(c))
6324
+ for (let c = o; r && c; c = Et(c))
6325
6325
  c.draggable && (r = void 0);
6326
6326
  if (o = Ja(o, e), r) {
6327
6327
  if (se && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
@@ -6329,7 +6329,7 @@ function ja(n, e) {
6329
6329
  f.nodeName == "IMG" && (h = f.getBoundingClientRect()).right <= e.left && h.bottom > e.top && i++;
6330
6330
  }
6331
6331
  let c;
6332
- Bt && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = Ka(n, r, i, e));
6332
+ Pt && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = Ka(n, r, i, e));
6333
6333
  }
6334
6334
  l == null && (l = qa(n, o, e));
6335
6335
  let a = n.docView.nearestDesc(o, !0);
@@ -6349,7 +6349,7 @@ function Ce(n, e) {
6349
6349
  }
6350
6350
  const Ua = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
6351
6351
  function no(n, e, t) {
6352
- let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = Bt || se;
6352
+ let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = Pt || se;
6353
6353
  if (r.nodeType == 3)
6354
6354
  if (o && (Ua.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
6355
6355
  let a = Ce(ge(r, i, i), t);
@@ -6358,31 +6358,31 @@ function no(n, e, t) {
6358
6358
  if (c.top == a.top) {
6359
6359
  let f = Ce(ge(r, i, i + 1), -1);
6360
6360
  if (f.top != a.top)
6361
- return pt(f, f.left < c.left);
6361
+ return mt(f, f.left < c.left);
6362
6362
  }
6363
6363
  }
6364
6364
  return a;
6365
6365
  } else {
6366
6366
  let a = i, c = i, f = t < 0 ? 1 : -1;
6367
- return t < 0 && !i ? (c++, f = -1) : t >= 0 && i == r.nodeValue.length ? (a--, f = 1) : t < 0 ? a-- : c++, pt(Ce(ge(r, a, c), f), f < 0);
6367
+ return t < 0 && !i ? (c++, f = -1) : t >= 0 && i == r.nodeValue.length ? (a--, f = 1) : t < 0 ? a-- : c++, mt(Ce(ge(r, a, c), f), f < 0);
6368
6368
  }
6369
6369
  if (!n.state.doc.resolve(e - (s || 0)).parent.inlineContent) {
6370
6370
  if (s == null && i && (t < 0 || i == te(r))) {
6371
6371
  let a = r.childNodes[i - 1];
6372
6372
  if (a.nodeType == 1)
6373
- return Ln(a.getBoundingClientRect(), !1);
6373
+ return Fn(a.getBoundingClientRect(), !1);
6374
6374
  }
6375
6375
  if (s == null && i < te(r)) {
6376
6376
  let a = r.childNodes[i];
6377
6377
  if (a.nodeType == 1)
6378
- return Ln(a.getBoundingClientRect(), !0);
6378
+ return Fn(a.getBoundingClientRect(), !0);
6379
6379
  }
6380
- return Ln(r.getBoundingClientRect(), t >= 0);
6380
+ return Fn(r.getBoundingClientRect(), t >= 0);
6381
6381
  }
6382
6382
  if (s == null && i && (t < 0 || i == te(r))) {
6383
6383
  let a = r.childNodes[i - 1], c = a.nodeType == 3 ? ge(a, te(a) - (o ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
6384
6384
  if (c)
6385
- return pt(Ce(c, 1), !1);
6385
+ return mt(Ce(c, 1), !1);
6386
6386
  }
6387
6387
  if (s == null && i < te(r)) {
6388
6388
  let a = r.childNodes[i];
@@ -6390,17 +6390,17 @@ function no(n, e, t) {
6390
6390
  a = a.nextSibling;
6391
6391
  let c = a ? a.nodeType == 3 ? ge(a, 0, o ? 0 : 1) : a.nodeType == 1 ? a : null : null;
6392
6392
  if (c)
6393
- return pt(Ce(c, -1), !0);
6393
+ return mt(Ce(c, -1), !0);
6394
6394
  }
6395
- return pt(Ce(r.nodeType == 3 ? ge(r) : r, -t), t >= 0);
6395
+ return mt(Ce(r.nodeType == 3 ? ge(r) : r, -t), t >= 0);
6396
6396
  }
6397
- function pt(n, e) {
6397
+ function mt(n, e) {
6398
6398
  if (n.width == 0)
6399
6399
  return n;
6400
6400
  let t = e ? n.left : n.right;
6401
6401
  return { top: n.top, bottom: n.bottom, left: t, right: t };
6402
6402
  }
6403
- function Ln(n, e) {
6403
+ function Fn(n, e) {
6404
6404
  if (n.height == 0)
6405
6405
  return n;
6406
6406
  let t = e ? n.top : n.bottom;
@@ -6468,8 +6468,8 @@ let ai = null, ci = null, fi = !1;
6468
6468
  function Ya(n, e, t) {
6469
6469
  return ai == e && ci == t ? fi : (ai = e, ci = t, fi = t == "up" || t == "down" ? Ga(n, e, t) : Xa(n, e, t));
6470
6470
  }
6471
- const ne = 0, hi = 1, Fe = 2, de = 3;
6472
- class Pt {
6471
+ const ne = 0, hi = 1, Le = 2, de = 3;
6472
+ class Vt {
6473
6473
  constructor(e, t, r, i) {
6474
6474
  this.parent = e, this.children = t, this.dom = r, this.contentDOM = i, this.dirty = ne, r.pmViewDesc = this;
6475
6475
  }
@@ -6778,19 +6778,19 @@ class Pt {
6778
6778
  if (r == o ? e <= o && t >= r : e < o && t > r) {
6779
6779
  let l = r + s.border, a = o - s.border;
6780
6780
  if (e >= l && t <= a) {
6781
- this.dirty = e == r || t == o ? Fe : hi, e == l && t == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = de : s.markDirty(e - l, t - l);
6781
+ this.dirty = e == r || t == o ? Le : hi, e == l && t == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = de : s.markDirty(e - l, t - l);
6782
6782
  return;
6783
6783
  } else
6784
- s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? Fe : de;
6784
+ s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? Le : de;
6785
6785
  }
6786
6786
  r = o;
6787
6787
  }
6788
- this.dirty = Fe;
6788
+ this.dirty = Le;
6789
6789
  }
6790
6790
  markParentsDirty() {
6791
6791
  let e = 1;
6792
6792
  for (let t = this.parent; t; t = t.parent, e++) {
6793
- let r = e == 1 ? Fe : hi;
6793
+ let r = e == 1 ? Le : hi;
6794
6794
  t.dirty < r && (t.dirty = r);
6795
6795
  }
6796
6796
  }
@@ -6804,7 +6804,7 @@ class Pt {
6804
6804
  return !1;
6805
6805
  }
6806
6806
  }
6807
- class io extends Pt {
6807
+ class io extends Vt {
6808
6808
  constructor(e, t, r, i) {
6809
6809
  let s, o = t.type.toDOM;
6810
6810
  if (typeof o == "function" && (o = o(r, () => {
@@ -6844,7 +6844,7 @@ class io extends Pt {
6844
6844
  return this.widget.type.side;
6845
6845
  }
6846
6846
  }
6847
- class Za extends Pt {
6847
+ class Za extends Vt {
6848
6848
  constructor(e, t, r, i) {
6849
6849
  super(e, [], t, null), this.textDOM = r, this.text = i;
6850
6850
  }
@@ -6861,7 +6861,7 @@ class Za extends Pt {
6861
6861
  return e.type === "characterData" && e.target.nodeValue == e.oldValue;
6862
6862
  }
6863
6863
  }
6864
- class Xe extends Pt {
6864
+ class Xe extends Vt {
6865
6865
  constructor(e, t, r, i, s) {
6866
6866
  super(e, [], r, i), this.mark = t, this.spec = s;
6867
6867
  }
@@ -6897,7 +6897,7 @@ class Xe extends Pt {
6897
6897
  this.spec.destroy && this.spec.destroy(), super.destroy();
6898
6898
  }
6899
6899
  }
6900
- class Re extends Pt {
6900
+ class Re extends Vt {
6901
6901
  constructor(e, t, r, i, s, o, l, a, c) {
6902
6902
  super(e, [], s, o), this.node = t, this.outerDeco = r, this.innerDeco = i, this.nodeDOM = l;
6903
6903
  }
@@ -6948,7 +6948,7 @@ class Re extends Pt {
6948
6948
  return e;
6949
6949
  }
6950
6950
  matchesNode(e, t, r) {
6951
- return this.dirty == ne && e.eq(this.node) && an(t, this.outerDeco) && r.eq(this.innerDeco);
6951
+ return this.dirty == ne && e.eq(this.node) && cn(t, this.outerDeco) && r.eq(this.innerDeco);
6952
6952
  }
6953
6953
  get size() {
6954
6954
  return this.node.nodeSize;
@@ -6968,7 +6968,7 @@ class Re extends Pt {
6968
6968
  a.syncToMarks(c.marks, r, e);
6969
6969
  let u;
6970
6970
  a.findNodeMatch(c, f, h, d) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (u = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, f, h, u, e) || a.updateNextNode(c, f, h, e, d, i) || a.addNode(c, f, h, e, i), i += c.nodeSize;
6971
- }), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Fe) && (o && this.protectLocalComposition(e, o), oo(this.contentDOM, this.children, e), ht && sc(this.dom));
6971
+ }), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Le) && (o && this.protectLocalComposition(e, o), oo(this.contentDOM, this.children, e), ht && sc(this.dom));
6972
6972
  }
6973
6973
  localCompositionInfo(e, t) {
6974
6974
  let { from: r, to: i } = e.state.selection;
@@ -7006,7 +7006,7 @@ class Re extends Pt {
7006
7006
  this.updateOuterDeco(t), this.node = e, this.innerDeco = r, this.contentDOM && this.updateChildren(i, this.posAtStart), this.dirty = ne;
7007
7007
  }
7008
7008
  updateOuterDeco(e) {
7009
- if (an(e, this.outerDeco))
7009
+ if (cn(e, this.outerDeco))
7010
7010
  return;
7011
7011
  let t = this.nodeDOM.nodeType != 1, r = this.dom;
7012
7012
  this.dom = lo(this.dom, this.nodeDOM, rr(this.outerDeco, this.node, t), rr(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
@@ -7071,7 +7071,7 @@ class xn extends Re {
7071
7071
  return this.node.text == e;
7072
7072
  }
7073
7073
  }
7074
- class so extends Pt {
7074
+ class so extends Vt {
7075
7075
  parseRule() {
7076
7076
  return { ignore: !0 };
7077
7077
  }
@@ -7138,38 +7138,38 @@ function oo(n, e, t) {
7138
7138
  r = ui(r), i = !0;
7139
7139
  i && t.trackWrites == n && (t.trackWrites = null);
7140
7140
  }
7141
- const wt = function(n) {
7141
+ const Mt = function(n) {
7142
7142
  n && (this.nodeName = n);
7143
7143
  };
7144
- wt.prototype = /* @__PURE__ */ Object.create(null);
7145
- const Le = [new wt()];
7144
+ Mt.prototype = /* @__PURE__ */ Object.create(null);
7145
+ const Fe = [new Mt()];
7146
7146
  function rr(n, e, t) {
7147
7147
  if (n.length == 0)
7148
- return Le;
7149
- let r = t ? Le[0] : new wt(), i = [r];
7148
+ return Fe;
7149
+ let r = t ? Fe[0] : new Mt(), i = [r];
7150
7150
  for (let s = 0; s < n.length; s++) {
7151
7151
  let o = n[s].type.attrs;
7152
7152
  if (o) {
7153
- o.nodeName && i.push(r = new wt(o.nodeName));
7153
+ o.nodeName && i.push(r = new Mt(o.nodeName));
7154
7154
  for (let l in o) {
7155
7155
  let a = o[l];
7156
- a != null && (t && i.length == 1 && i.push(r = new wt(e.isInline ? "span" : "div")), l == "class" ? r.class = (r.class ? r.class + " " : "") + a : l == "style" ? r.style = (r.style ? r.style + ";" : "") + a : l != "nodeName" && (r[l] = a));
7156
+ a != null && (t && i.length == 1 && i.push(r = new Mt(e.isInline ? "span" : "div")), l == "class" ? r.class = (r.class ? r.class + " " : "") + a : l == "style" ? r.style = (r.style ? r.style + ";" : "") + a : l != "nodeName" && (r[l] = a));
7157
7157
  }
7158
7158
  }
7159
7159
  }
7160
7160
  return i;
7161
7161
  }
7162
7162
  function lo(n, e, t, r) {
7163
- if (t == Le && r == Le)
7163
+ if (t == Fe && r == Fe)
7164
7164
  return e;
7165
7165
  let i = e;
7166
7166
  for (let s = 0; s < r.length; s++) {
7167
7167
  let o = r[s], l = t[s];
7168
7168
  if (s) {
7169
7169
  let a;
7170
- l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = Le[0]), i = a;
7170
+ l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = Fe[0]), i = a;
7171
7171
  }
7172
- ec(i, l || Le[0], o);
7172
+ ec(i, l || Fe[0], o);
7173
7173
  }
7174
7174
  return i;
7175
7175
  }
@@ -7196,9 +7196,9 @@ function ec(n, e, t) {
7196
7196
  }
7197
7197
  }
7198
7198
  function ao(n, e, t) {
7199
- return lo(n, n, Le, rr(e, t, n.nodeType != 1));
7199
+ return lo(n, n, Fe, rr(e, t, n.nodeType != 1));
7200
7200
  }
7201
- function an(n, e) {
7201
+ function cn(n, e) {
7202
7202
  if (n.length != e.length)
7203
7203
  return !1;
7204
7204
  for (let t = 0; t < n.length; t++)
@@ -7272,7 +7272,7 @@ class tc {
7272
7272
  }
7273
7273
  updateNodeAt(e, t, r, i, s) {
7274
7274
  let o = this.top.children[i];
7275
- return o.dirty == de && o.dom == o.contentDOM && (o.dirty = Fe), o.update(e, t, r, s) ? (this.destroyBetween(this.index, i), this.index++, !0) : !1;
7275
+ return o.dirty == de && o.dom == o.contentDOM && (o.dirty = Le), o.update(e, t, r, s) ? (this.destroyBetween(this.index, i), this.index++, !0) : !1;
7276
7276
  }
7277
7277
  findIndexWithChild(e) {
7278
7278
  for (; ; ) {
@@ -7300,11 +7300,11 @@ class tc {
7300
7300
  let c = this.preMatch.matched.get(a);
7301
7301
  if (c != null && c != s)
7302
7302
  return !1;
7303
- let f = a.dom, h, d = this.isLocked(f) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != de && an(t, a.outerDeco));
7303
+ let f = a.dom, h, d = this.isLocked(f) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != de && cn(t, a.outerDeco));
7304
7304
  if (!d && a.update(e, t, r, i))
7305
7305
  return this.destroyBetween(this.index, l), a.dom != f && (this.changed = !0), this.index++, !0;
7306
7306
  if (!d && (h = this.recreateWrapper(a, e, t, r, i, o)))
7307
- return this.destroyBetween(this.index, l), this.top.children[this.index] = h, h.contentDOM && (h.dirty = Fe, h.updateChildren(i, o + 1), h.dirty = ne), this.changed = !0, this.index++, !0;
7307
+ return this.destroyBetween(this.index, l), this.top.children[this.index] = h, h.contentDOM && (h.dirty = Le, h.updateChildren(i, o + 1), h.dirty = ne), this.changed = !0, this.index++, !0;
7308
7308
  break;
7309
7309
  }
7310
7310
  }
@@ -7313,7 +7313,7 @@ class tc {
7313
7313
  // When a node with content is replaced by a different node with
7314
7314
  // identical content, move over its children.
7315
7315
  recreateWrapper(e, t, r, i, s, o) {
7316
- if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !an(r, e.outerDeco) || !i.eq(e.innerDeco))
7316
+ if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !cn(r, e.outerDeco) || !i.eq(e.innerDeco))
7317
7317
  return null;
7318
7318
  let l = Re.create(this.top, t, r, i, s, o);
7319
7319
  if (l.contentDOM) {
@@ -7626,7 +7626,7 @@ function ki(n, e, t) {
7626
7626
  if (!s || s.isText)
7627
7627
  return !1;
7628
7628
  let l = e < 0 ? i.pos - s.nodeSize : i.pos;
7629
- return s.isAtom || (o = n.docView.descAt(l)) && !o.contentDOM ? x.isSelectable(s) ? Me(n, new x(e < 0 ? n.state.doc.resolve(i.pos - s.nodeSize) : i)) : Bt ? Me(n, new C(n.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
7629
+ return s.isAtom || (o = n.docView.descAt(l)) && !o.contentDOM ? x.isSelectable(s) ? Me(n, new x(e < 0 ? n.state.doc.resolve(i.pos - s.nodeSize) : i)) : Pt ? Me(n, new C(n.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
7630
7630
  }
7631
7631
  } else return !1;
7632
7632
  else {
@@ -7638,10 +7638,10 @@ function ki(n, e, t) {
7638
7638
  }
7639
7639
  }
7640
7640
  }
7641
- function cn(n) {
7641
+ function fn(n) {
7642
7642
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
7643
7643
  }
7644
- function Mt(n, e) {
7644
+ function Ot(n, e) {
7645
7645
  let t = n.pmViewDesc;
7646
7646
  return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
7647
7647
  }
@@ -7653,13 +7653,13 @@ function fc(n) {
7653
7653
  if (!t)
7654
7654
  return;
7655
7655
  let i, s, o = !1;
7656
- for (se && t.nodeType == 1 && r < cn(t) && Mt(t.childNodes[r], -1) && (o = !0); ; )
7656
+ for (se && t.nodeType == 1 && r < fn(t) && Ot(t.childNodes[r], -1) && (o = !0); ; )
7657
7657
  if (r > 0) {
7658
7658
  if (t.nodeType != 1)
7659
7659
  break;
7660
7660
  {
7661
7661
  let l = t.childNodes[r - 1];
7662
- if (Mt(l, -1))
7662
+ if (Ot(l, -1))
7663
7663
  i = t, s = --r;
7664
7664
  else if (l.nodeType == 3)
7665
7665
  t = l, r = t.nodeValue.length;
@@ -7671,10 +7671,10 @@ function fc(n) {
7671
7671
  break;
7672
7672
  {
7673
7673
  let l = t.previousSibling;
7674
- for (; l && Mt(l, -1); )
7674
+ for (; l && Ot(l, -1); )
7675
7675
  i = t.parentNode, s = V(l), l = l.previousSibling;
7676
7676
  if (l)
7677
- t = l, r = cn(t);
7677
+ t = l, r = fn(t);
7678
7678
  else {
7679
7679
  if (t = t.parentNode, t == n.dom)
7680
7680
  break;
@@ -7688,13 +7688,13 @@ function hc(n) {
7688
7688
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
7689
7689
  if (!t)
7690
7690
  return;
7691
- let i = cn(t), s, o;
7691
+ let i = fn(t), s, o;
7692
7692
  for (; ; )
7693
7693
  if (r < i) {
7694
7694
  if (t.nodeType != 1)
7695
7695
  break;
7696
7696
  let l = t.childNodes[r];
7697
- if (Mt(l, 1))
7697
+ if (Ot(l, 1))
7698
7698
  s = t, o = ++r;
7699
7699
  else
7700
7700
  break;
@@ -7703,10 +7703,10 @@ function hc(n) {
7703
7703
  break;
7704
7704
  {
7705
7705
  let l = t.nextSibling;
7706
- for (; l && Mt(l, 1); )
7706
+ for (; l && Ot(l, 1); )
7707
7707
  s = l.parentNode, o = V(l) + 1, l = l.nextSibling;
7708
7708
  if (l)
7709
- t = l, r = 0, i = cn(t);
7709
+ t = l, r = 0, i = fn(t);
7710
7710
  else {
7711
7711
  if (t = t.parentNode, t == n.dom)
7712
7712
  break;
@@ -7721,7 +7721,7 @@ function uo(n) {
7721
7721
  return e && e.node && e.node.isBlock;
7722
7722
  }
7723
7723
  function dc(n, e) {
7724
- for (; n && e == n.childNodes.length && !zt(n); )
7724
+ for (; n && e == n.childNodes.length && !Bt(n); )
7725
7725
  e = V(n) + 1, n = n.parentNode;
7726
7726
  for (; n && e < n.childNodes.length; ) {
7727
7727
  let t = n.childNodes[e];
@@ -7733,7 +7733,7 @@ function dc(n, e) {
7733
7733
  }
7734
7734
  }
7735
7735
  function uc(n, e) {
7736
- for (; n && !e && !zt(n); )
7736
+ for (; n && !e && !Bt(n); )
7737
7737
  e = V(n), n = n.parentNode;
7738
7738
  for (; n && e; ) {
7739
7739
  let t = n.childNodes[e - 1];
@@ -7905,7 +7905,7 @@ function mo(n, e, t, r, i) {
7905
7905
  } else
7906
7906
  n.someProp("transformPastedHTML", (h) => {
7907
7907
  t = h(t, n);
7908
- }), o = xc(t), Bt && Sc(o);
7908
+ }), o = xc(t), Pt && Sc(o);
7909
7909
  let c = o && o.querySelector("[data-pm-slice]"), f = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
7910
7910
  if (f && f[3])
7911
7911
  for (let h = +f[3]; h > 0; h--) {
@@ -8188,7 +8188,7 @@ function Bc(n, e, t) {
8188
8188
  }
8189
8189
  }
8190
8190
  function Nr(n) {
8191
- return fn(n);
8191
+ return hn(n);
8192
8192
  }
8193
8193
  const So = ee ? "metaKey" : "ctrlKey";
8194
8194
  j.mousedown = (n, e) => {
@@ -8261,8 +8261,8 @@ U.compositionstart = U.compositionupdate = (n) => {
8261
8261
  n.domObserver.flush();
8262
8262
  let { state: e } = n, t = e.selection.$to;
8263
8263
  if (e.selection instanceof C && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1)))
8264
- n.markCursor = n.state.storedMarks || t.marks(), fn(n, !0), n.markCursor = null;
8265
- else if (fn(n, !e.selection.empty), se && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
8264
+ n.markCursor = n.state.storedMarks || t.marks(), hn(n, !0), n.markCursor = null;
8265
+ else if (hn(n, !e.selection.empty), se && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
8266
8266
  let r = n.domSelectionRange();
8267
8267
  for (let i = r.focusNode, s = r.focusOffset; i && i.nodeType == 1 && s != 0; ) {
8268
8268
  let o = s < 0 ? i.lastChild : i.childNodes[s - 1];
@@ -8284,13 +8284,13 @@ U.compositionend = (n, e) => {
8284
8284
  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++, wo(n, 20));
8285
8285
  };
8286
8286
  function wo(n, e) {
8287
- clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => fn(n), e));
8287
+ clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => hn(n), e));
8288
8288
  }
8289
8289
  function Mo(n) {
8290
- for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Lc()); n.input.compositionNodes.length > 0; )
8290
+ for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Fc()); n.input.compositionNodes.length > 0; )
8291
8291
  n.input.compositionNodes.pop().markParentsDirty();
8292
8292
  }
8293
- function Fc(n) {
8293
+ function Lc(n) {
8294
8294
  let e = n.domSelectionRange();
8295
8295
  if (!e.focusNode)
8296
8296
  return null;
@@ -8309,11 +8309,11 @@ function Fc(n) {
8309
8309
  }
8310
8310
  return t || r;
8311
8311
  }
8312
- function Lc() {
8312
+ function Fc() {
8313
8313
  let n = document.createEvent("Event");
8314
8314
  return n.initEvent("event", !0, !0), n.timeStamp;
8315
8315
  }
8316
- function fn(n, e = !1) {
8316
+ function hn(n, e = !1) {
8317
8317
  if (!(re && n.domObserver.flushingSoon >= 0)) {
8318
8318
  if (n.domObserver.forceFlush(), Mo(n), e || n.docView && n.docView.dirty) {
8319
8319
  let t = Cr(n);
@@ -8332,12 +8332,12 @@ function Hc(n, e) {
8332
8332
  t.parentNode && t.parentNode.removeChild(t), n.focus();
8333
8333
  }, 50);
8334
8334
  }
8335
- const Et = _ && Ee < 15 || ht && Pa < 604;
8335
+ const Rt = _ && Ee < 15 || ht && Pa < 604;
8336
8336
  j.copy = U.cut = (n, e) => {
8337
8337
  let t = e, r = n.state.selection, i = t.type == "cut";
8338
8338
  if (r.empty)
8339
8339
  return;
8340
- let s = Et ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = po(n, o);
8340
+ let s = Rt ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = po(n, o);
8341
8341
  s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : Hc(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
8342
8342
  };
8343
8343
  function $c(n) {
@@ -8350,10 +8350,10 @@ function Wc(n, e) {
8350
8350
  t || (r.contentEditable = "true"), r.style.cssText = "position: fixed; left: -10000px; top: 10px", r.focus();
8351
8351
  let i = n.input.shiftKey && n.input.lastKeyCode != 45;
8352
8352
  setTimeout(() => {
8353
- n.focus(), r.parentNode && r.parentNode.removeChild(r), t ? Rt(n, r.value, null, i, e) : Rt(n, r.textContent, r.innerHTML, i, e);
8353
+ n.focus(), r.parentNode && r.parentNode.removeChild(r), t ? It(n, r.value, null, i, e) : It(n, r.textContent, r.innerHTML, i, e);
8354
8354
  }, 50);
8355
8355
  }
8356
- function Rt(n, e, t, r, i) {
8356
+ function It(n, e, t, r, i) {
8357
8357
  let s = mo(n, e, t, r, n.state.selection.$from);
8358
8358
  if (n.someProp("handlePaste", (a) => a(n, i, s || k.empty)))
8359
8359
  return !0;
@@ -8373,8 +8373,8 @@ U.paste = (n, e) => {
8373
8373
  let t = e;
8374
8374
  if (n.composing && !re)
8375
8375
  return;
8376
- let r = Et ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
8377
- r && Rt(n, Oo(r), r.getData("text/html"), i, t) ? t.preventDefault() : Wc(n, t);
8376
+ let r = Rt ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
8377
+ r && It(n, Oo(r), r.getData("text/html"), i, t) ? t.preventDefault() : Wc(n, t);
8378
8378
  };
8379
8379
  class No {
8380
8380
  constructor(e, t, r) {
@@ -8396,7 +8396,7 @@ j.dragstart = (n, e) => {
8396
8396
  }
8397
8397
  }
8398
8398
  let l = (o || n.state.selection).content(), { dom: a, text: c, slice: f } = po(n, l);
8399
- (!t.dataTransfer.files.length || !W || Ys > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Et ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Et || t.dataTransfer.setData("text/plain", c), n.dragging = new No(f, !t[To], o);
8399
+ (!t.dataTransfer.files.length || !W || Ys > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Rt ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Rt || t.dataTransfer.setData("text/plain", c), n.dragging = new No(f, !t[To], o);
8400
8400
  };
8401
8401
  j.dragend = (n) => {
8402
8402
  let e = n.dragging;
@@ -8415,7 +8415,7 @@ U.drop = (n, e) => {
8415
8415
  let s = n.state.doc.resolve(i.pos), o = r && r.slice;
8416
8416
  o ? n.someProp("transformPasted", (p) => {
8417
8417
  o = p(o, n);
8418
- }) : o = mo(n, Oo(t.dataTransfer), Et ? null : t.dataTransfer.getData("text/html"), !1, s);
8418
+ }) : o = mo(n, Oo(t.dataTransfer), Rt ? null : t.dataTransfer.getData("text/html"), !1, s);
8419
8419
  let l = !!(r && !t[To]);
8420
8420
  if (n.someProp("handleDrop", (p) => p(n, t, o || k.empty, l))) {
8421
8421
  t.preventDefault();
@@ -8466,7 +8466,7 @@ j.beforeinput = (n, e) => {
8466
8466
  };
8467
8467
  for (let n in U)
8468
8468
  j[n] = U[n];
8469
- function It(n, e) {
8469
+ function vt(n, e) {
8470
8470
  if (n == e)
8471
8471
  return !0;
8472
8472
  for (let t in n)
@@ -8477,7 +8477,7 @@ function It(n, e) {
8477
8477
  return !1;
8478
8478
  return !0;
8479
8479
  }
8480
- class hn {
8480
+ class dn {
8481
8481
  constructor(e, t) {
8482
8482
  this.toDOM = e, this.spec = t || Ke, this.side = this.spec.side || 0;
8483
8483
  }
@@ -8489,7 +8489,7 @@ class hn {
8489
8489
  return !0;
8490
8490
  }
8491
8491
  eq(e) {
8492
- return this == e || e instanceof hn && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && It(this.spec, e.spec));
8492
+ return this == e || e instanceof dn && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && vt(this.spec, e.spec));
8493
8493
  }
8494
8494
  destroy(e) {
8495
8495
  this.spec.destroy && this.spec.destroy(e);
@@ -8507,7 +8507,7 @@ class Ie {
8507
8507
  return t.from < t.to;
8508
8508
  }
8509
8509
  eq(e) {
8510
- return this == e || e instanceof Ie && It(this.attrs, e.attrs) && It(this.spec, e.spec);
8510
+ return this == e || e instanceof Ie && vt(this.attrs, e.attrs) && vt(this.spec, e.spec);
8511
8511
  }
8512
8512
  static is(e) {
8513
8513
  return e.type instanceof Ie;
@@ -8531,7 +8531,7 @@ class Tr {
8531
8531
  return i == t.from && !(s = e.child(r)).isText && i + s.nodeSize == t.to;
8532
8532
  }
8533
8533
  eq(e) {
8534
- return this == e || e instanceof Tr && It(this.attrs, e.attrs) && It(this.spec, e.spec);
8534
+ return this == e || e instanceof Tr && vt(this.attrs, e.attrs) && vt(this.spec, e.spec);
8535
8535
  }
8536
8536
  destroy() {
8537
8537
  }
@@ -8570,7 +8570,7 @@ class G {
8570
8570
  widget's current document position.
8571
8571
  */
8572
8572
  static widget(e, t, r) {
8573
- return new G(e, e, new hn(t, r));
8573
+ return new G(e, e, new dn(t, r));
8574
8574
  }
8575
8575
  /**
8576
8576
  Creates an inline decoration, which adds the given attributes to
@@ -8604,7 +8604,7 @@ class G {
8604
8604
  @internal
8605
8605
  */
8606
8606
  get widget() {
8607
- return this.type instanceof hn;
8607
+ return this.type instanceof dn;
8608
8608
  }
8609
8609
  }
8610
8610
  const tt = [], Ke = {};
@@ -8621,7 +8621,7 @@ class T {
8621
8621
  you must make a copy if you want need to preserve that.
8622
8622
  */
8623
8623
  static create(e, t) {
8624
- return t.length ? dn(t, e, 0, Ke) : H;
8624
+ return t.length ? un(t, e, 0, Ke) : H;
8625
8625
  }
8626
8626
  /**
8627
8627
  Find all decorations in this set which touch the given range
@@ -8680,7 +8680,7 @@ class T {
8680
8680
  if (f = Do(t, l, c)) {
8681
8681
  for (i || (i = this.children.slice()); s < i.length && i[s] < a; )
8682
8682
  s += 3;
8683
- i[s] == a ? i[s + 2] = i[s + 2].addInner(l, f, c + 1) : i.splice(s, 0, a, a + l.nodeSize, dn(f, l, c + 1, Ke)), s += 3;
8683
+ i[s] == a ? i[s + 2] = i[s + 2].addInner(l, f, c + 1) : i.splice(s, 0, a, a + l.nodeSize, un(f, l, c + 1, Ke)), s += 3;
8684
8684
  }
8685
8685
  });
8686
8686
  let o = Ao(s ? Eo(t) : t, -r);
@@ -8876,7 +8876,7 @@ function Jc(n, e, t, r, i, s, o) {
8876
8876
  a = !0;
8877
8877
  }
8878
8878
  if (a) {
8879
- let c = qc(l, n, e, t, i, s, o), f = dn(c, r, 0, o);
8879
+ let c = qc(l, n, e, t, i, s, o), f = un(c, r, 0, o);
8880
8880
  e = f.local;
8881
8881
  for (let h = 0; h < l.length; h += 3)
8882
8882
  l[h + 1] < 0 && (l.splice(h, 3), h -= 3);
@@ -8926,13 +8926,13 @@ function Eo(n) {
8926
8926
  n[t] != null && e.push(n[t]);
8927
8927
  return e;
8928
8928
  }
8929
- function dn(n, e, t, r) {
8929
+ function un(n, e, t, r) {
8930
8930
  let i = [], s = !1;
8931
8931
  e.forEach((l, a) => {
8932
8932
  let c = Do(n, l, a + t);
8933
8933
  if (c) {
8934
8934
  s = !0;
8935
- let f = dn(c, l, t + a + 1, r);
8935
+ let f = un(c, l, t + a + 1, r);
8936
8936
  f != H && i.push(a, a + l.nodeSize, f);
8937
8937
  }
8938
8938
  });
@@ -9057,9 +9057,9 @@ class Gc {
9057
9057
  if (!e.focusNode)
9058
9058
  return !0;
9059
9059
  let t = /* @__PURE__ */ new Set(), r;
9060
- for (let s = e.focusNode; s; s = Dt(s))
9060
+ for (let s = e.focusNode; s; s = Et(s))
9061
9061
  t.add(s);
9062
- for (let s = e.anchorNode; s; s = Dt(s))
9062
+ for (let s = e.anchorNode; s; s = Et(s))
9063
9063
  if (t.has(s)) {
9064
9064
  r = s;
9065
9065
  break;
@@ -9221,8 +9221,8 @@ function tf(n, e, t, r, i) {
9221
9221
  if (Se && !n.state.selection.eq(Se)) {
9222
9222
  if (W && re && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (Go) => Go(n, Ve(13, "Enter"))))
9223
9223
  return;
9224
- let Lt = n.state.tr.setSelection(Se);
9225
- M == "pointer" ? Lt.setMeta("pointer", !0) : M == "key" && Lt.scrollIntoView(), s && Lt.setMeta("composition", s), n.dispatch(Lt);
9224
+ let Ht = n.state.tr.setSelection(Se);
9225
+ M == "pointer" ? Ht.setMeta("pointer", !0) : M == "key" && Ht.scrollIntoView(), s && Ht.setMeta("composition", s), n.dispatch(Ht);
9226
9226
  }
9227
9227
  return;
9228
9228
  }
@@ -9263,25 +9263,25 @@ function tf(n, e, t, r, i) {
9263
9263
  return M(n, Ve(13, "Enter"));
9264
9264
  });
9265
9265
  }, 20));
9266
- let L = p.start, R = p.endA, A, Q, xe;
9266
+ let F = p.start, R = p.endA, A, Q, xe;
9267
9267
  if (w) {
9268
9268
  if (m.pos == g.pos)
9269
- _ && Ee <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => be(n), 20)), A = n.state.tr.delete(L, R), Q = f.resolve(p.start).marksAcross(f.resolve(p.endA));
9269
+ _ && Ee <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => be(n), 20)), A = n.state.tr.delete(F, R), Q = f.resolve(p.start).marksAcross(f.resolve(p.endA));
9270
9270
  else if (
9271
9271
  // Adding or removing a mark
9272
9272
  p.endA == p.endB && (xe = nf(m.parent.content.cut(m.parentOffset, g.parentOffset), b.parent.content.cut(b.parentOffset, p.endA - b.start())))
9273
9273
  )
9274
- A = n.state.tr, xe.type == "add" ? A.addMark(L, R, xe.mark) : A.removeMark(L, R, xe.mark);
9274
+ A = n.state.tr, xe.type == "add" ? A.addMark(F, R, xe.mark) : A.removeMark(F, R, xe.mark);
9275
9275
  else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
9276
9276
  let M = m.parent.textBetween(m.parentOffset, g.parentOffset);
9277
- if (n.someProp("handleTextInput", (Se) => Se(n, L, R, M)))
9277
+ if (n.someProp("handleTextInput", (Se) => Se(n, F, R, M)))
9278
9278
  return;
9279
- A = n.state.tr.insertText(M, L, R);
9279
+ A = n.state.tr.insertText(M, F, R);
9280
9280
  }
9281
9281
  }
9282
- if (A || (A = n.state.tr.replace(L, R, c.doc.slice(p.start - c.from, p.endB - c.from))), c.sel) {
9282
+ if (A || (A = n.state.tr.replace(F, R, c.doc.slice(p.start - c.from, p.endB - c.from))), c.sel) {
9283
9283
  let M = Ei(n, A.doc, c.sel);
9284
- M && !(W && re && n.composing && M.empty && (p.start != p.endB || n.input.lastAndroidDelete < Date.now() - 100) && (M.head == L || M.head == A.mapping.map(R) - 1) || _ && M.empty && M.head == L) && A.setSelection(M);
9284
+ M && !(W && re && n.composing && M.empty && (p.start != p.endB || n.input.lastAndroidDelete < Date.now() - 100) && (M.head == F || M.head == A.mapping.map(R) - 1) || _ && M.empty && M.head == F) && A.setSelection(M);
9285
9285
  }
9286
9286
  Q && A.ensureMarks(Q), s && A.setMeta("composition", s), n.dispatch(A.scrollIntoView());
9287
9287
  }
@@ -9432,13 +9432,13 @@ class of {
9432
9432
  (l || t.handleDOMEvents != this._props.handleDOMEvents) && ar(this), this.editable = zi(this), vi(this);
9433
9433
  let a = Wn(this), c = Ii(this), f = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", h = s || !this.docView.matchesNode(e.doc, c, a);
9434
9434
  (h || !e.selection.eq(i.selection)) && (o = !0);
9435
- let d = f == "preserve" && o && this.dom.style.overflowAnchor == null && La(this);
9435
+ let d = f == "preserve" && o && this.dom.style.overflowAnchor == null && Fa(this);
9436
9436
  if (o) {
9437
9437
  this.domObserver.stop();
9438
9438
  let u = h && (_ || W) && !this.composing && !i.selection.empty && !e.selection.empty && lf(i.selection, e.selection);
9439
9439
  if (h) {
9440
9440
  let p = W ? this.trackWrites = this.domSelectionRange().focusNode : null;
9441
- this.composing && (this.input.compositionNode = Fc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = di(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (u = !0);
9441
+ this.composing && (this.input.compositionNode = Lc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = di(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (u = !0);
9442
9442
  }
9443
9443
  u || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && cc(this)) ? be(this, u) : (fo(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9444
9444
  }
@@ -9634,13 +9634,13 @@ class of {
9634
9634
  [`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
9635
9635
  */
9636
9636
  pasteHTML(e, t) {
9637
- return Rt(this, "", e, !1, t || new ClipboardEvent("paste"));
9637
+ return It(this, "", e, !1, t || new ClipboardEvent("paste"));
9638
9638
  }
9639
9639
  /**
9640
9640
  Run the editor's paste logic with the given plain-text input.
9641
9641
  */
9642
9642
  pasteText(e, t) {
9643
- return Rt(this, e, null, !0, t || new ClipboardEvent("paste"));
9643
+ return It(this, e, null, !0, t || new ClipboardEvent("paste"));
9644
9644
  }
9645
9645
  /**
9646
9646
  Removes the editor from the DOM and destroys all [node
@@ -9858,9 +9858,9 @@ function cf(n) {
9858
9858
  });
9859
9859
  break;
9860
9860
  }
9861
- const L = i + N * e;
9861
+ const F = i + N * e;
9862
9862
  for (let R = 0; R < g; R++) {
9863
- r[L + R] == 0 ? r[L + R] = f : (s || (s = [])).push({
9863
+ r[F + R] == 0 ? r[F + R] = f : (s || (s = [])).push({
9864
9864
  type: "collision",
9865
9865
  row: c,
9866
9866
  pos: f,
@@ -9868,7 +9868,7 @@ function cf(n) {
9868
9868
  });
9869
9869
  const A = w && w[R];
9870
9870
  if (A) {
9871
- const Q = (L + R) % e * 2, xe = o[Q];
9871
+ const Q = (F + R) % e * 2, xe = o[Q];
9872
9872
  xe == null || xe != A && o[Q + 1] == 1 ? (o[Q] = A, o[Q + 1] = 1) : xe == A && o[Q + 1]++;
9873
9873
  }
9874
9874
  }
@@ -9954,7 +9954,7 @@ function Vi(n, e) {
9954
9954
  }
9955
9955
  return s;
9956
9956
  }
9957
- function Fi(n, e) {
9957
+ function Li(n, e) {
9958
9958
  const t = {};
9959
9959
  n.attrs.colspan != 1 && (t.colspan = n.attrs.colspan), n.attrs.rowspan != 1 && (t.rowspan = n.attrs.rowspan), n.attrs.colwidth && (t["data-colwidth"] = n.attrs.colwidth.join(","));
9960
9960
  for (const r in e) {
@@ -9999,7 +9999,7 @@ function uf(n) {
9999
9999
  { tag: "td", getAttrs: (r) => Vi(r, e) }
10000
10000
  ],
10001
10001
  toDOM(r) {
10002
- return ["td", Fi(r, e), 0];
10002
+ return ["td", Li(r, e), 0];
10003
10003
  }
10004
10004
  },
10005
10005
  table_header: {
@@ -10011,7 +10011,7 @@ function uf(n) {
10011
10011
  { tag: "th", getAttrs: (r) => Vi(r, e) }
10012
10012
  ],
10013
10013
  toDOM(r) {
10014
- return ["th", Fi(r, e), 0];
10014
+ return ["th", Li(r, e), 0];
10015
10015
  }
10016
10016
  }
10017
10017
  };
@@ -10027,8 +10027,8 @@ function ue(n) {
10027
10027
  }
10028
10028
  return e;
10029
10029
  }
10030
- var Ne = new vt("selectingCells");
10031
- function Vt(n) {
10030
+ var Ne = new zt("selectingCells");
10031
+ function Lt(n) {
10032
10032
  for (let e = n.depth - 1; e > 0; e--)
10033
10033
  if (n.node(e).type.spec.tableRole == "row")
10034
10034
  return n.node(0).resolve(n.before(e + 1));
@@ -10047,7 +10047,7 @@ function Dr(n) {
10047
10047
  return e.$anchorCell.pos > e.$headCell.pos ? e.$anchorCell : e.$headCell;
10048
10048
  if ("node" in e && e.node && e.node.type.spec.tableRole == "cell")
10049
10049
  return e.$anchor;
10050
- const t = Vt(e.$head) || pf(e.$head);
10050
+ const t = Lt(e.$head) || pf(e.$head);
10051
10051
  if (t)
10052
10052
  return t;
10053
10053
  throw new RangeError(`No cell found around position ${e.head}`);
@@ -10316,7 +10316,7 @@ function xf(n, e, t) {
10316
10316
  } else r instanceof C && bf(r) ? s = C.create(i, r.from) : r instanceof C && kf(r) && (s = C.create(i, r.$from.start(), r.$from.end()));
10317
10317
  return s && (e || (e = n.tr)).setSelection(s), e;
10318
10318
  }
10319
- var Sf = new vt("fix-tables");
10319
+ var Sf = new zt("fix-tables");
10320
10320
  function vo(n, e, t, r) {
10321
10321
  const i = n.childCount, s = e.childCount;
10322
10322
  e:
@@ -10442,7 +10442,7 @@ function Mf(n) {
10442
10442
  return !0;
10443
10443
  };
10444
10444
  }
10445
- function Li(n, e, t) {
10445
+ function Fi(n, e, t) {
10446
10446
  const r = e.map.cellsInRect({
10447
10447
  left: 0,
10448
10448
  top: 0,
@@ -10461,7 +10461,7 @@ function Rr(n, e) {
10461
10461
  if (!Cn(t))
10462
10462
  return !1;
10463
10463
  if (r) {
10464
- const i = ue(t.schema), s = zo(t), o = t.tr, l = Li("row", s, i), a = Li(
10464
+ const i = ue(t.schema), s = zo(t), o = t.tr, l = Fi("row", s, i), a = Fi(
10465
10465
  "column",
10466
10466
  s,
10467
10467
  i
@@ -10533,7 +10533,7 @@ function Hi(n) {
10533
10533
  return !0;
10534
10534
  };
10535
10535
  }
10536
- function Jt(n, e) {
10536
+ function qt(n, e) {
10537
10537
  const t = n.selection;
10538
10538
  if (!(t instanceof z))
10539
10539
  return !1;
@@ -10752,29 +10752,29 @@ function Ji(n, e, t, r, i) {
10752
10752
  ), e(h);
10753
10753
  }
10754
10754
  var Ef = _s({
10755
- ArrowLeft: qt("horiz", -1),
10756
- ArrowRight: qt("horiz", 1),
10757
- ArrowUp: qt("vert", -1),
10758
- ArrowDown: qt("vert", 1),
10759
- "Shift-ArrowLeft": Kt("horiz", -1),
10760
- "Shift-ArrowRight": Kt("horiz", 1),
10761
- "Shift-ArrowUp": Kt("vert", -1),
10762
- "Shift-ArrowDown": Kt("vert", 1),
10763
- Backspace: Jt,
10764
- "Mod-Backspace": Jt,
10765
- Delete: Jt,
10766
- "Mod-Delete": Jt
10755
+ ArrowLeft: Kt("horiz", -1),
10756
+ ArrowRight: Kt("horiz", 1),
10757
+ ArrowUp: Kt("vert", -1),
10758
+ ArrowDown: Kt("vert", 1),
10759
+ "Shift-ArrowLeft": jt("horiz", -1),
10760
+ "Shift-ArrowRight": jt("horiz", 1),
10761
+ "Shift-ArrowUp": jt("vert", -1),
10762
+ "Shift-ArrowDown": jt("vert", 1),
10763
+ Backspace: qt,
10764
+ "Mod-Backspace": qt,
10765
+ Delete: qt,
10766
+ "Mod-Delete": qt
10767
10767
  });
10768
- function _t(n, e, t) {
10768
+ function Xt(n, e, t) {
10769
10769
  return t.eq(n.selection) ? !1 : (e && e(n.tr.setSelection(t).scrollIntoView()), !0);
10770
10770
  }
10771
- function qt(n, e) {
10771
+ function Kt(n, e) {
10772
10772
  return (t, r, i) => {
10773
10773
  if (!i)
10774
10774
  return !1;
10775
10775
  const s = t.selection;
10776
10776
  if (s instanceof z)
10777
- return _t(
10777
+ return Xt(
10778
10778
  t,
10779
10779
  r,
10780
10780
  S.near(s.$headCell, e)
@@ -10785,7 +10785,7 @@ function qt(n, e) {
10785
10785
  if (o == null)
10786
10786
  return !1;
10787
10787
  if (n == "horiz")
10788
- return _t(
10788
+ return Xt(
10789
10789
  t,
10790
10790
  r,
10791
10791
  S.near(t.doc.resolve(s.head + e), e)
@@ -10793,11 +10793,11 @@ function qt(n, e) {
10793
10793
  {
10794
10794
  const l = t.doc.resolve(o), a = Ro(l, n, e);
10795
10795
  let c;
10796
- return a ? c = S.near(a, 1) : e < 0 ? c = S.near(t.doc.resolve(l.before(-1)), -1) : c = S.near(t.doc.resolve(l.after(-1)), 1), _t(t, r, c);
10796
+ return a ? c = S.near(a, 1) : e < 0 ? c = S.near(t.doc.resolve(l.before(-1)), -1) : c = S.near(t.doc.resolve(l.after(-1)), 1), Xt(t, r, c);
10797
10797
  }
10798
10798
  };
10799
10799
  }
10800
- function Kt(n, e) {
10800
+ function jt(n, e) {
10801
10801
  return (t, r, i) => {
10802
10802
  if (!i)
10803
10803
  return !1;
@@ -10812,7 +10812,7 @@ function Kt(n, e) {
10812
10812
  o = new z(t.doc.resolve(a));
10813
10813
  }
10814
10814
  const l = Ro(o.$headCell, n, e);
10815
- return l ? _t(
10815
+ return l ? Xt(
10816
10816
  t,
10817
10817
  r,
10818
10818
  new z(o.$anchorCell, l)
@@ -10820,7 +10820,7 @@ function Kt(n, e) {
10820
10820
  };
10821
10821
  }
10822
10822
  function Rf(n, e) {
10823
- const t = n.state.doc, r = Vt(t.resolve(e));
10823
+ const t = n.state.doc, r = Lt(t.resolve(e));
10824
10824
  return r ? (n.dispatch(n.state.tr.setSelection(new z(r))), !0) : !1;
10825
10825
  }
10826
10826
  function If(n, e, t) {
@@ -10863,7 +10863,7 @@ function vf(n, e) {
10863
10863
  let i;
10864
10864
  if (e.shiftKey && n.state.selection instanceof z)
10865
10865
  s(n.state.selection.$anchorCell, e), e.preventDefault();
10866
- else if (e.shiftKey && r && (i = Vt(n.state.selection.$anchor)) != null && ((t = qn(n, e)) == null ? void 0 : t.pos) != i.pos)
10866
+ else if (e.shiftKey && r && (i = Lt(n.state.selection.$anchor)) != null && ((t = qn(n, e)) == null ? void 0 : t.pos) != i.pos)
10867
10867
  s(i, e), e.preventDefault();
10868
10868
  else if (!r)
10869
10869
  return;
@@ -10921,7 +10921,7 @@ function qn(n, e) {
10921
10921
  left: e.clientX,
10922
10922
  top: e.clientY
10923
10923
  });
10924
- return t && t ? Vt(n.state.doc.resolve(t.pos)) : null;
10924
+ return t && t ? Lt(n.state.doc.resolve(t.pos)) : null;
10925
10925
  }
10926
10926
  var zf = class {
10927
10927
  constructor(n, e) {
@@ -10966,7 +10966,7 @@ function ur(n, e, t, r, i, s) {
10966
10966
  a ? (t.style.width = l + "px", t.style.minWidth = "") : (t.style.width = "", t.style.minWidth = l + "px");
10967
10967
  }
10968
10968
  }
10969
- var Y = new vt(
10969
+ var Y = new zt(
10970
10970
  "tableColumnResizing"
10971
10971
  );
10972
10972
  function Bf({
@@ -10976,7 +10976,7 @@ function Bf({
10976
10976
  View: r = zf,
10977
10977
  lastColumnResizable: i = !0
10978
10978
  } = {}) {
10979
- const s = new ut({
10979
+ const s = new pt({
10980
10980
  key: Y,
10981
10981
  state: {
10982
10982
  init(o, l) {
@@ -10998,10 +10998,10 @@ function Bf({
10998
10998
  Vf(o, l, n, i);
10999
10999
  },
11000
11000
  mouseleave: (o) => {
11001
- Ff(o);
11001
+ Lf(o);
11002
11002
  },
11003
11003
  mousedown: (o, l) => {
11004
- Lf(o, l, e, t);
11004
+ Ff(o, l, e, t);
11005
11005
  }
11006
11006
  },
11007
11007
  decorations: (o) => {
@@ -11014,19 +11014,19 @@ function Bf({
11014
11014
  });
11015
11015
  return s;
11016
11016
  }
11017
- var Pf = class Xt {
11017
+ var Pf = class Yt {
11018
11018
  constructor(e, t) {
11019
11019
  this.activeHandle = e, this.dragging = t;
11020
11020
  }
11021
11021
  apply(e) {
11022
11022
  const t = this, r = e.getMeta(Y);
11023
11023
  if (r && r.setHandle != null)
11024
- return new Xt(r.setHandle, !1);
11024
+ return new Yt(r.setHandle, !1);
11025
11025
  if (r && r.setDragging !== void 0)
11026
- return new Xt(t.activeHandle, r.setDragging);
11026
+ return new Yt(t.activeHandle, r.setDragging);
11027
11027
  if (t.activeHandle > -1 && e.docChanged) {
11028
11028
  let i = e.mapping.map(t.activeHandle, -1);
11029
- return hr(e.doc.resolve(i)) || (i = -1), new Xt(i, t.dragging);
11029
+ return hr(e.doc.resolve(i)) || (i = -1), new Yt(i, t.dragging);
11030
11030
  }
11031
11031
  return t;
11032
11032
  }
@@ -11050,11 +11050,11 @@ function Vf(n, e, t, r) {
11050
11050
  }
11051
11051
  }
11052
11052
  }
11053
- function Ff(n) {
11053
+ function Lf(n) {
11054
11054
  const e = Y.getState(n.state);
11055
11055
  e && e.activeHandle > -1 && !e.dragging && Po(n, -1);
11056
11056
  }
11057
- function Lf(n, e, t, r) {
11057
+ function Ff(n, e, t, r) {
11058
11058
  var i;
11059
11059
  const s = (i = n.dom.ownerDocument.defaultView) != null ? i : window, o = Y.getState(n.state);
11060
11060
  if (!o || o.activeHandle == -1 || o.dragging)
@@ -11120,7 +11120,7 @@ function Ki(n, e, t, r) {
11120
11120
  });
11121
11121
  if (!s)
11122
11122
  return -1;
11123
- const { pos: o } = s, l = Vt(n.state.doc.resolve(o));
11123
+ const { pos: o } = s, l = Lt(n.state.doc.resolve(o));
11124
11124
  if (!l)
11125
11125
  return -1;
11126
11126
  if (t == "right")
@@ -11194,7 +11194,7 @@ function qf(n, e) {
11194
11194
  function Kf({
11195
11195
  allowTableNodeSelection: n = !1
11196
11196
  } = {}) {
11197
- return new ut({
11197
+ return new pt({
11198
11198
  key: Ne,
11199
11199
  // This piece of state is used to remember when a mouse-drag
11200
11200
  // cell-selection is happening, so that it can continue even as
@@ -11234,10 +11234,10 @@ function Kf({
11234
11234
  }
11235
11235
  });
11236
11236
  }
11237
- const Vo = "app.grapesjs.com", Fo = "app-stage.grapesjs.com", jf = "app2.grapesjs.com", Uf = "app-stage2.grapesjs.com", Gi = [
11237
+ const Vo = "app.grapesjs.com", Lo = "app-stage.grapesjs.com", jf = "app2.grapesjs.com", Uf = "app-stage2.grapesjs.com", Gi = [
11238
11238
  Vo,
11239
11239
  jf,
11240
- Fo,
11240
+ Lo,
11241
11241
  Uf,
11242
11242
  "localhost",
11243
11243
  "127.0.0.1",
@@ -11247,15 +11247,15 @@ const Vo = "app.grapesjs.com", Fo = "app-stage.grapesjs.com", jf = "app2.grapesj
11247
11247
  // For stackblitz.com demos
11248
11248
  "-sandpack.codesandbox.io"
11249
11249
  // For Sandpack demos
11250
- ], Gf = "license:check:start", _f = "license:check:end", Xf = () => typeof window < "u", Yf = ({
11250
+ ], Gf = "license:check:end", _f = () => typeof window < "u", Xf = ({
11251
11251
  isDev: n,
11252
11252
  isStage: e,
11253
11253
  isPlatform: t
11254
- }) => `${n ? "" : `https://${e ? Fo : Vo}`}/${t ? "platform-api" : "api"}`, Zf = () => {
11255
- const n = Xf() && window.location.hostname;
11254
+ }) => `${n ? "" : `https://${e ? Lo : Vo}`}/${t ? "platform-api" : "api"}`, Yf = () => {
11255
+ const n = _f() && window.location.hostname;
11256
11256
  return !!n && (Gi.includes(n) || Gi.some((e) => n.endsWith(e)));
11257
11257
  };
11258
- async function Qf({
11258
+ async function Zf({
11259
11259
  path: n,
11260
11260
  baseApiUrl: e,
11261
11261
  method: t = "GET",
@@ -11263,7 +11263,7 @@ async function Qf({
11263
11263
  params: i,
11264
11264
  body: s
11265
11265
  }) {
11266
- const l = `${e || Yf({ isDev: !1, isStage: !1 })}${n}`, a = {
11266
+ const l = `${e || Xf({ isDev: !1, isStage: !1 })}${n}`, a = {
11267
11267
  method: t,
11268
11268
  headers: {
11269
11269
  "Content-Type": "application/json",
@@ -11276,19 +11276,19 @@ async function Qf({
11276
11276
  throw new Error(`HTTP error! status: ${h.status}`);
11277
11277
  return h.json();
11278
11278
  }
11279
- var rt = /* @__PURE__ */ ((n) => (n.free = "free", n.startup = "startup", n.business = "business", n.enterprise = "enterprise", n))(rt || {}), un = /* @__PURE__ */ ((n) => (n.toastAdd = "studio:toastAdd", n.toastRemove = "studio:toastRemove", n.dialogOpen = "studio:dialogOpen", n.dialogClose = "studio:dialogClose", n.dialogExportCode = "studio:dialogExportCode", n.dialogImportCode = "studio:dialogImportCode", n.sidebarLeftSet = "studio:sidebarLeft:set", n.sidebarLeftGet = "studio:sidebarLeft:get", n.sidebarLeftToggle = "studio:sidebarLeft:toggle", n.sidebarRightSet = "studio:sidebarRight:set", n.sidebarRightGet = "studio:sidebarRight:get", n.sidebarRightToggle = "studio:sidebarRight:toggle", n.sidebarTopSet = "studio:sidebarTop:set", n.sidebarTopGet = "studio:sidebarTop:get", n.sidebarTopToggle = "studio:sidebarTop:toggle", n.sidebarBottomSet = "studio:sidebarBottom:set", n.sidebarBottomGet = "studio:sidebarBottom:get", n.sidebarBottomToggle = "studio:sidebarBottom:toggle", n.symbolAdd = "studio:symbolAdd", n.symbolDetach = "studio:symbolDetach", n.symbolOverride = "studio:symbolOverride", n.symbolPropagateStyles = "studio:propagateStyles", n.getPagesConfig = "studio:getPagesConfig", n.setPagesConfig = "studio:setPagesConfig", n.getPageSettings = "studio:getPageSettings", n.setPageSettings = "studio:setPageSettings", n.clearPage = "studio:clearPage", n.projectFiles = "studio:projectFiles", n.validateCode = "studio:validateCode", n.canvasReload = "studio:canvasReload", n.getBlocksPanel = "studio:getBlocksPanel", n.setBlocksPanel = "studio:setBlocksPanel", n.getStateContextMenu = "studio:getStateContextMenu", n.setStateContextMenu = "studio:setStateContextMenu", n.contextMenuComponent = "studio:contextMenuComponent", n.layoutAdd = "studio:layoutAdd", n.layoutRemove = "studio:layoutRemove", n.layoutToggle = "studio:layoutToggle", n.layoutUpdate = "studio:layoutUpdate", n.layoutGet = "studio:layoutGet", n.layoutConfigGet = "studio:layoutConfigGet", n.layoutConfigSet = "studio:layoutConfigSet", n.layoutComponentAdd = "studio:layoutComponentAdd", n.layoutComponentGet = "studio:layoutComponentGet", n.layoutComponentRemove = "studio:layoutComponentRemove", n.layoutComponentRender = "studio:layoutComponentRender", n.getStateTheme = "studio:getStateTheme", n.setStateTheme = "studio:setStateTheme", n.assetProviderGet = "studio:assetProviderGet", n.assetProviderAdd = "studio:assetProviderAdd", n.assetProviderRemove = "studio:assetProviderRemove", n.fontGet = "studio:fontGet", n.fontAdd = "studio:fontAdd", n.fontRemove = "studio:fontRemove", n.fontManagerOpen = "studio:fontManagerOpen", n.menuFontLoad = "studio:menuFontLoad", n.toggleStateDataSource = "studio:toggleStateDataSource", n.getStateDataSource = "studio:getStateDataSource", n.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", n.dataSourceSetImporter = "studio:dataSourceSetImporter", n.dataSourceSetExporter = "studio:dataSourceSetExporter", n.setDragAbsolute = "studio:setDragAbsolute", n))(un || {});
11279
+ var rt = /* @__PURE__ */ ((n) => (n.free = "free", n.startup = "startup", n.business = "business", n.enterprise = "enterprise", n))(rt || {}), ut = /* @__PURE__ */ ((n) => (n.toastAdd = "studio:toastAdd", n.toastRemove = "studio:toastRemove", n.dialogOpen = "studio:dialogOpen", n.dialogClose = "studio:dialogClose", n.dialogExportCode = "studio:dialogExportCode", n.dialogImportCode = "studio:dialogImportCode", n.sidebarLeftSet = "studio:sidebarLeft:set", n.sidebarLeftGet = "studio:sidebarLeft:get", n.sidebarLeftToggle = "studio:sidebarLeft:toggle", n.sidebarRightSet = "studio:sidebarRight:set", n.sidebarRightGet = "studio:sidebarRight:get", n.sidebarRightToggle = "studio:sidebarRight:toggle", n.sidebarTopSet = "studio:sidebarTop:set", n.sidebarTopGet = "studio:sidebarTop:get", n.sidebarTopToggle = "studio:sidebarTop:toggle", n.sidebarBottomSet = "studio:sidebarBottom:set", n.sidebarBottomGet = "studio:sidebarBottom:get", n.sidebarBottomToggle = "studio:sidebarBottom:toggle", n.symbolAdd = "studio:symbolAdd", n.symbolDetach = "studio:symbolDetach", n.symbolOverride = "studio:symbolOverride", n.symbolPropagateStyles = "studio:propagateStyles", n.getPagesConfig = "studio:getPagesConfig", n.setPagesConfig = "studio:setPagesConfig", n.getPageSettings = "studio:getPageSettings", n.setPageSettings = "studio:setPageSettings", n.clearPage = "studio:clearPage", n.projectFiles = "studio:projectFiles", n.validateCode = "studio:validateCode", n.canvasReload = "studio:canvasReload", n.getBlocksPanel = "studio:getBlocksPanel", n.setBlocksPanel = "studio:setBlocksPanel", n.getStateContextMenu = "studio:getStateContextMenu", n.setStateContextMenu = "studio:setStateContextMenu", n.contextMenuComponent = "studio:contextMenuComponent", n.layoutAdd = "studio:layoutAdd", n.layoutRemove = "studio:layoutRemove", n.layoutToggle = "studio:layoutToggle", n.layoutUpdate = "studio:layoutUpdate", n.layoutGet = "studio:layoutGet", n.layoutConfigGet = "studio:layoutConfigGet", n.layoutConfigSet = "studio:layoutConfigSet", n.layoutComponentAdd = "studio:layoutComponentAdd", n.layoutComponentGet = "studio:layoutComponentGet", n.layoutComponentRemove = "studio:layoutComponentRemove", n.layoutComponentRender = "studio:layoutComponentRender", n.getStateTheme = "studio:getStateTheme", n.setStateTheme = "studio:setStateTheme", n.settings = "studio:settings", n.assetProviderGet = "studio:assetProviderGet", n.assetProviderAdd = "studio:assetProviderAdd", n.assetProviderRemove = "studio:assetProviderRemove", n.fontGet = "studio:fontGet", n.fontAdd = "studio:fontAdd", n.fontRemove = "studio:fontRemove", n.fontManagerOpen = "studio:fontManagerOpen", n.menuFontLoad = "studio:menuFontLoad", n.toggleStateDataSource = "studio:toggleStateDataSource", n.getStateDataSource = "studio:getStateDataSource", n.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", n.dataSourceSetImporter = "studio:dataSourceSetImporter", n.dataSourceSetExporter = "studio:dataSourceSetExporter", n.setDragAbsolute = "studio:setDragAbsolute", n))(ut || {});
11280
11280
  const _i = {
11281
11281
  [rt.free]: 0,
11282
11282
  [rt.startup]: 10,
11283
11283
  [rt.business]: 20,
11284
11284
  [rt.enterprise]: 30
11285
11285
  };
11286
- function eh(n) {
11286
+ function Qf(n) {
11287
11287
  const e = n;
11288
11288
  return e.init = (t) => (r) => n(r, t), e;
11289
11289
  }
11290
- const th = (n) => /* @__PURE__ */ eh(n);
11291
- async function nh({
11290
+ const eh = (n) => /* @__PURE__ */ Qf(n);
11291
+ async function th({
11292
11292
  editor: n,
11293
11293
  plan: e,
11294
11294
  pluginName: t,
@@ -11296,38 +11296,51 @@ async function nh({
11296
11296
  onLicenseCheckResponse: i,
11297
11297
  cleanup: s
11298
11298
  }) {
11299
- let o = "", l = !1;
11300
- const a = Zf(), c = (h) => {
11299
+ let o = "", l;
11300
+ const a = (h) => {
11301
11301
  console.warn("Cleanup plugin:", t, "Reason:", h), s();
11302
- }, f = (h = {}) => {
11302
+ }, c = (h = {}) => {
11303
11303
  var g;
11304
11304
  const { error: d, sdkLicense: u } = h, p = (g = h.plan) == null ? void 0 : g.category;
11305
11305
  if (!(u || h.license) || d)
11306
- c(d || "Invalid license");
11306
+ a(d || "Invalid license");
11307
11307
  else if (p) {
11308
11308
  const b = _i[e], w = _i[p];
11309
- b > w && c({ pluginRequiredPlan: e, licensePlan: p });
11309
+ b > w && a({ pluginRequiredPlan: e, licensePlan: p });
11310
11310
  }
11311
11311
  };
11312
- n.on(Gf, (h) => {
11313
- o = h == null ? void 0 : h.baseApiUrl, l = !0;
11314
- }), n.on(_f, (h) => {
11315
- i == null || i(h), f(h);
11316
- }), setTimeout(async () => {
11317
- if (!l) {
11318
- if (a) return;
11319
- if (r) {
11320
- const h = await rh({ licenseKey: r, pluginName: t, baseApiUrl: o });
11321
- i == null || i(h), h && f(h);
11322
- } else
11323
- c("The `licenseKey` option not provided");
11324
- }
11325
- }, 2e3);
11312
+ n.Commands.has(ut.settings) && (l = n.runCommand(ut.settings), o = (l == null ? void 0 : l.baseUrl) || "");
11313
+ const f = (h) => {
11314
+ i == null || i(h), h && c(h);
11315
+ };
11316
+ if (!l) {
11317
+ n.onReady(async () => {
11318
+ if (!Yf())
11319
+ if (r) {
11320
+ const h = await rh({ licenseKey: r, pluginName: t, baseApiUrl: o });
11321
+ f(h);
11322
+ } else
11323
+ a("The `licenseKey` option not provided");
11324
+ });
11325
+ return;
11326
+ }
11327
+ if (l.licensePlan || l.licenseError) {
11328
+ const h = nh(l);
11329
+ f(h);
11330
+ return;
11331
+ }
11332
+ n.on(Gf, (h) => f(h));
11326
11333
  }
11334
+ const nh = (n) => ({
11335
+ sdkLicense: n.license,
11336
+ license: n.license,
11337
+ error: n.licenseError,
11338
+ plan: n.licensePlan
11339
+ });
11327
11340
  async function rh(n) {
11328
11341
  const { licenseKey: e, pluginName: t, baseApiUrl: r } = n;
11329
11342
  try {
11330
- return (await Qf({
11343
+ return (await Zf({
11331
11344
  baseApiUrl: r,
11332
11345
  path: `/sdk/${e || "na"}`,
11333
11346
  method: "POST",
@@ -11368,7 +11381,7 @@ function sh(n, e) {
11368
11381
  n.off(t.select, a), n.off(t.selectBefore, c);
11369
11382
  };
11370
11383
  }
11371
- const Ot = (n) => {
11384
+ const Nt = (n) => {
11372
11385
  const e = Object.fromEntries(Array.from(n.attributes).map((t) => [t.name, t.value]));
11373
11386
  return delete e.draggable, e;
11374
11387
  }, pr = (n) => {
@@ -11395,13 +11408,13 @@ const Ot = (n) => {
11395
11408
  return o && (l.style = `${t}: ${o}`), [r, l, 0];
11396
11409
  }
11397
11410
  };
11398
- }, Xi = "data-gs-mrk-fs", oh = "data-gs-mrk-color", lh = "data-gs-mrk-bgcolor", Lo = "data-gs-mrk-wrap", pn = "data-gs-ifrg", ke = "attrs", wn = {
11411
+ }, Xi = "data-gs-mrk-fs", oh = "data-gs-mrk-color", lh = "data-gs-mrk-bgcolor", Fo = "data-gs-mrk-wrap", pn = "data-gs-ifrg", ke = "attrs", wn = {
11399
11412
  [ke]: { default: "{}" }
11400
11413
  }, oe = {
11401
11414
  [ke]: { default: {} }
11402
11415
  }, Mn = (n) => ({
11403
- [ke]: JSON.stringify(Ot(n))
11404
- }), le = (n) => ({ attrs: Ot(n) }), mt = (n) => (e) => [n, e.attrs.attrs, 0], ce = (n) => n.attrs[ke] ? JSON.parse(n.attrs[ke]) : {}, ah = {
11416
+ [ke]: JSON.stringify(Nt(n))
11417
+ }), le = (n) => ({ attrs: Nt(n) }), gt = (n) => (e) => [n, e.attrs.attrs, 0], ce = (n) => n.attrs[ke] ? JSON.parse(n.attrs[ke]) : {}, ah = {
11405
11418
  doc: {
11406
11419
  content: "block+"
11407
11420
  },
@@ -11421,35 +11434,35 @@ const Ot = (n) => {
11421
11434
  content: "inline*",
11422
11435
  attrs: oe,
11423
11436
  parseDOM: [{ tag: "div", getAttrs: le }],
11424
- toDOM: mt("div")
11437
+ toDOM: gt("div")
11425
11438
  },
11426
11439
  paragraph: {
11427
11440
  group: "block",
11428
11441
  content: "inline*",
11429
11442
  attrs: oe,
11430
11443
  parseDOM: [{ tag: "p", getAttrs: le }],
11431
- toDOM: mt("p")
11444
+ toDOM: gt("p")
11432
11445
  },
11433
11446
  orderedList: {
11434
11447
  group: "block",
11435
11448
  content: "listItem+",
11436
11449
  attrs: oe,
11437
11450
  parseDOM: [{ tag: "ol", getAttrs: le }],
11438
- toDOM: mt("ol")
11451
+ toDOM: gt("ol")
11439
11452
  },
11440
11453
  bulletList: {
11441
11454
  group: "block",
11442
11455
  content: "listItem+",
11443
11456
  attrs: oe,
11444
11457
  parseDOM: [{ tag: "ul", getAttrs: le }],
11445
- toDOM: mt("ul")
11458
+ toDOM: gt("ul")
11446
11459
  },
11447
11460
  listItem: {
11448
11461
  content: "block*",
11449
11462
  group: "block",
11450
11463
  attrs: oe,
11451
11464
  parseDOM: [{ tag: "li", getAttrs: le }],
11452
- toDOM: mt("li"),
11465
+ toDOM: gt("li"),
11453
11466
  defining: !0
11454
11467
  },
11455
11468
  codeBlock: {
@@ -11497,7 +11510,7 @@ const Ot = (n) => {
11497
11510
  tag: `h${e + 1}`,
11498
11511
  getAttrs: (t) => ({
11499
11512
  level: e + 1,
11500
- attrs: Ot(t)
11513
+ attrs: Nt(t)
11501
11514
  })
11502
11515
  })),
11503
11516
  toDOM({ attrs: n }) {
@@ -11511,7 +11524,7 @@ const Ot = (n) => {
11511
11524
  cellAttributes: {
11512
11525
  [ke]: {
11513
11526
  default: oe[ke].default,
11514
- getFromDOM: Ot,
11527
+ getFromDOM: Nt,
11515
11528
  setDOMAttr: (n, e) => {
11516
11529
  n && Object.assign(e, n);
11517
11530
  }
@@ -11540,7 +11553,7 @@ const Ot = (n) => {
11540
11553
  tag: "*:not(tbody)",
11541
11554
  getAttrs: (n) => ({
11542
11555
  tagName: n.tagName.toLowerCase(),
11543
- attrs: Ot(n)
11556
+ attrs: Nt(n)
11544
11557
  }),
11545
11558
  priority: 0
11546
11559
  }
@@ -11550,7 +11563,7 @@ const Ot = (n) => {
11550
11563
  return [e, t, 0];
11551
11564
  }
11552
11565
  }
11553
- }, gt = (n, e) => ({
11566
+ }, yt = (n, e) => ({
11554
11567
  attrs: wn,
11555
11568
  parseDOM: n.map((t) => ({
11556
11569
  tag: t,
@@ -11572,12 +11585,12 @@ const Ot = (n) => {
11572
11585
  }, 0];
11573
11586
  }
11574
11587
  }), fh = {
11575
- strong: gt(["strong", "b"], (n) => ["b", ce(n)]),
11576
- link: gt(["a"], (n) => ["a", ce(n), 0]),
11577
- em: gt(["em", "i"], (n) => ["em", ce(n)]),
11578
- underline: gt(["u"], (n) => ["u", ce(n), 0]),
11579
- strikethrough: gt(["s"], (n) => ["s", ce(n), 0]),
11580
- wrapStyle: ch(Lo),
11588
+ strong: yt(["strong", "b"], (n) => ["b", ce(n)]),
11589
+ link: yt(["a"], (n) => ["a", ce(n), 0]),
11590
+ em: yt(["em", "i"], (n) => ["em", ce(n)]),
11591
+ underline: yt(["u"], (n) => ["u", ce(n), 0]),
11592
+ strikethrough: yt(["s"], (n) => ["s", ce(n), 0]),
11593
+ wrapStyle: ch(Fo),
11581
11594
  font_size: {
11582
11595
  attrs: {
11583
11596
  ...wn,
@@ -11615,8 +11628,8 @@ const Ot = (n) => {
11615
11628
  Ft.set(n, { view: e, gjsView: t, initialDoc: e.state.doc }), Ir.set(e, { el: n, gjsView: t });
11616
11629
  }, dh = (n, e) => {
11617
11630
  Ft.delete(n), Ir.delete(e);
11618
- }, Yt = (n) => Ft.get(n), Ho = (n) => Ir.get(n), Zi = (n) => {
11619
- const e = Yt(n), t = e == null ? void 0 : e.view, r = e == null ? void 0 : e.initialDoc;
11631
+ }, Zt = (n) => Ft.get(n), Ho = (n) => Ir.get(n), Zi = (n) => {
11632
+ const e = Zt(n), t = e == null ? void 0 : e.view, r = e == null ? void 0 : e.initialDoc;
11620
11633
  return !(t && r && r.eq(t.state.doc));
11621
11634
  }, Kn = (n) => {
11622
11635
  var e, t;
@@ -11720,7 +11733,7 @@ function bh(n, e, t) {
11720
11733
  }
11721
11734
  o.docChanged && i(o.scrollIntoView());
11722
11735
  }
11723
- const yt = (n, e) => {
11736
+ const bt = (n, e) => {
11724
11737
  const { from: t, to: r } = n.selection;
11725
11738
  let i = !1;
11726
11739
  return n.doc.nodesBetween(t, r, (s) => {
@@ -11856,7 +11869,7 @@ const Oh = (n, e) => {
11856
11869
  },
11857
11870
  wrapStyle: () => {
11858
11871
  const l = Kn(n), a = o.text.selected(), c = `i${e.Components._createId().slice(0, 4)}`;
11859
- o.text.replaceHtml(`<span id="${c}" ${Lo}>${a}</span>`), l == null || l.trigger("disable"), setTimeout(() => {
11872
+ o.text.replaceHtml(`<span id="${c}" ${Fo}>${a}</span>`), l == null || l.trigger("disable"), setTimeout(() => {
11860
11873
  const f = l == null ? void 0 : l.find(`#${c}`)[0];
11861
11874
  f && e.select(f);
11862
11875
  });
@@ -11868,19 +11881,19 @@ const Oh = (n, e) => {
11868
11881
  },
11869
11882
  bold: {
11870
11883
  toggle: () => Pe(s.strong)(n.state, r),
11871
- isActive: () => yt(n.state, s.strong)
11884
+ isActive: () => bt(n.state, s.strong)
11872
11885
  },
11873
11886
  italic: {
11874
11887
  toggle: () => Pe(s.em)(n.state, r),
11875
- isActive: () => yt(n.state, s.em)
11888
+ isActive: () => bt(n.state, s.em)
11876
11889
  },
11877
11890
  underline: {
11878
11891
  toggle: () => Pe(s.underline)(n.state, r),
11879
- isActive: () => yt(n.state, s.underline)
11892
+ isActive: () => bt(n.state, s.underline)
11880
11893
  },
11881
11894
  strikethrough: {
11882
11895
  toggle: () => Pe(s.strikethrough)(n.state, r),
11883
- isActive: () => yt(n.state, s.strikethrough)
11896
+ isActive: () => bt(n.state, s.strikethrough)
11884
11897
  },
11885
11898
  link: {
11886
11899
  get: () => {
@@ -11895,7 +11908,7 @@ const Oh = (n, e) => {
11895
11908
  }
11896
11909
  },
11897
11910
  toggle: () => Pe(s.link)(n.state, r),
11898
- isActive: () => yt(n.state, s.link),
11911
+ isActive: () => bt(n.state, s.link),
11899
11912
  create: (l) => {
11900
11913
  const a = Kn(n), c = a == null ? void 0 : a.getTrait("href"), { url: f, target: h } = l, d = () => {
11901
11914
  var p, m;
@@ -11936,7 +11949,7 @@ const Oh = (n, e) => {
11936
11949
  }
11937
11950
  }
11938
11951
  };
11939
- e.runCommand(un.layoutToggle, u);
11952
+ e.runCommand(ut.layoutToggle, u);
11940
11953
  }
11941
11954
  },
11942
11955
  heading: {
@@ -12007,7 +12020,7 @@ function Eh(n) {
12007
12020
  }
12008
12021
  const Rh = 500;
12009
12022
  function Ih({ rules: n }) {
12010
- let e = new ut({
12023
+ let e = new pt({
12011
12024
  state: {
12012
12025
  init() {
12013
12026
  return null;
@@ -12051,7 +12064,7 @@ function es(n, e, t, r, i, s) {
12051
12064
  }
12052
12065
  return !1;
12053
12066
  }
12054
- const vh = new Be(/--$/, "—"), zh = new Be(/\.\.\.$/, "…"), Bh = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/, "“"), Ph = new Be(/"$/, "”"), Vh = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/, "‘"), Fh = new Be(/'$/, "’"), Lh = [Bh, Ph, Vh, Fh];
12067
+ const vh = new Be(/--$/, "—"), zh = new Be(/\.\.\.$/, "…"), Bh = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/, "“"), Ph = new Be(/"$/, "”"), Vh = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/, "‘"), Lh = new Be(/'$/, "’"), Fh = [Bh, Ph, Vh, Lh];
12055
12068
  function zr(n, e, t = null, r) {
12056
12069
  return new Be(n, (i, s, o, l) => {
12057
12070
  let a = t instanceof Function ? t(s) : t, c = i.tr.delete(o, l), f = c.doc.resolve(o), h = f.blockRange(), d = h && Os(h, e, a);
@@ -12091,7 +12104,7 @@ function qh(n, e) {
12091
12104
  }));
12092
12105
  }
12093
12106
  function Kh(n) {
12094
- const e = Lh.concat(zh, vh);
12107
+ const e = Fh.concat(zh, vh);
12095
12108
  let t;
12096
12109
  return (t = n.nodes.blockquote) && e.push(Hh(t)), (t = n.nodes.orderedList) && e.push($h(t)), (t = n.nodes.bulletList) && e.push(Wh(t)), (t = n.nodes.codeBlock) && e.push(Jh(t)), (t = n.nodes.heading) && e.push(qh(t, 6)), Ih({ rules: e });
12097
12110
  }
@@ -12225,7 +12238,7 @@ const jh = "rteProseMirror", Uh = rt.free, q = "rte:selectionchange", I = {
12225
12238
  }
12226
12239
  },
12227
12240
  onClick: ({ event: c }) => {
12228
- const f = c.currentTarget || c.target, h = "linkLayout", d = () => t.runCommand(un.layoutRemove, { id: h }), u = s.link.get(), p = {
12241
+ const f = c.currentTarget || c.target, h = "linkLayout", d = () => t.runCommand(ut.layoutRemove, { id: h }), u = s.link.get(), p = {
12229
12242
  id: h,
12230
12243
  style: { width: 240 },
12231
12244
  disablePropagation: !0,
@@ -12286,7 +12299,7 @@ const jh = "rteProseMirror", Uh = rt.free, q = "rte:selectionchange", I = {
12286
12299
  ]
12287
12300
  }
12288
12301
  };
12289
- t.runCommand(un.layoutToggle, p);
12302
+ t.runCommand(ut.layoutToggle, p);
12290
12303
  }
12291
12304
  },
12292
12305
  alignText: {
@@ -12518,19 +12531,19 @@ const Xh = function(n, e = {}) {
12518
12531
  schema: c,
12519
12532
  plugins: (b = t.plugins) == null ? void 0 : b.call(t, {
12520
12533
  editor: n,
12521
- Plugin: ut,
12534
+ Plugin: pt,
12522
12535
  plugins: [
12523
12536
  Bf(),
12524
12537
  Kf(),
12525
12538
  Kh(c),
12526
12539
  ga(),
12527
- Fn({
12540
+ Ln({
12528
12541
  Tab: Hi(1),
12529
12542
  "Shift-Tab": Hi(-1)
12530
12543
  }),
12531
- Fn({
12532
- Enter: At(Hs, Ma(f.listItem), gh(d, t)),
12533
- "Shift-Enter": At(Ls, (w, N) => (N && N(w.tr.replaceSelectionWith(f.inlineBreak.create()).scrollIntoView()), !0)),
12544
+ Ln({
12545
+ Enter: Dt(Hs, Ma(f.listItem), gh(d, t)),
12546
+ "Shift-Enter": Dt(Fs, (w, N) => (N && N(w.tr.replaceSelectionWith(f.inlineBreak.create()).scrollIntoView()), !0)),
12534
12547
  "Mod-z": Gs,
12535
12548
  "Mod-y": Yn,
12536
12549
  // On Windows
@@ -12541,7 +12554,7 @@ const Xh = function(n, e = {}) {
12541
12554
  "Shift-Tab": Zn(f.listItem),
12542
12555
  Tab: Ta(f.listItem)
12543
12556
  }),
12544
- Fn(la)
12557
+ Ln(la)
12545
12558
  ]
12546
12559
  })
12547
12560
  }), m = new of(
@@ -12551,9 +12564,9 @@ const Xh = function(n, e = {}) {
12551
12564
  state: p,
12552
12565
  dispatchTransaction(w) {
12553
12566
  var Q;
12554
- const { state: N } = m, L = N.apply(w), R = !N.doc.eq(L.doc);
12555
- m.updateState(L);
12556
- const A = !N.selection.eq(L.selection);
12567
+ const { state: N } = m, F = N.apply(w), R = !N.doc.eq(F.doc);
12568
+ m.updateState(F);
12569
+ const A = !N.selection.eq(F.selection);
12557
12570
  R && (uh(((Q = a == null ? void 0 : a.view) == null ? void 0 : Q.el) || l), m.focus()), (A || R) && n.trigger(q);
12558
12571
  }
12559
12572
  }
@@ -12572,13 +12585,13 @@ const Xh = function(n, e = {}) {
12572
12585
  parseContent: !0,
12573
12586
  // @ts-expect-error - Type 'CustomRteOptions' is missing the following properties from type 'CustomRteOptions': editor, component, el
12574
12587
  async enable(l, a, c) {
12575
- const f = Yt(l);
12588
+ const f = Zt(l);
12576
12589
  if (f) return f;
12577
12590
  const h = r(l, c);
12578
12591
  return hh(l, h, c.view), Oh(h, c), h;
12579
12592
  },
12580
12593
  disable(l) {
12581
- const a = Yt(l), c = a == null ? void 0 : a.view;
12594
+ const a = Zt(l), c = a == null ? void 0 : a.view;
12582
12595
  if (c) {
12583
12596
  const f = Zi(l);
12584
12597
  return dh(l, c), f || n.once(n.RichTextEditor.events.disable, () => {
@@ -12588,7 +12601,7 @@ const Xh = function(n, e = {}) {
12588
12601
  },
12589
12602
  getContent(l, a, c) {
12590
12603
  var h;
12591
- const f = (h = Yt(l)) == null ? void 0 : h.view;
12604
+ const f = (h = Zt(l)) == null ? void 0 : h.view;
12592
12605
  if (f) {
12593
12606
  const { schema: d, doc: u } = f.state;
12594
12607
  if (!Zi(l))
@@ -12603,7 +12616,7 @@ const Xh = function(n, e = {}) {
12603
12616
  }
12604
12617
  });
12605
12618
  const s = sh(n, t.enableOnClick), o = ih(n, t.disableOnEsc);
12606
- nh({
12619
+ th({
12607
12620
  editor: n,
12608
12621
  licenseKey: t.licenseKey,
12609
12622
  plan: Uh,
@@ -12612,7 +12625,7 @@ const Xh = function(n, e = {}) {
12612
12625
  n.RichTextEditor.customRte = void 0, s(), o();
12613
12626
  }
12614
12627
  });
12615
- }, Yh = th(Xh);
12628
+ }, Yh = eh(Xh);
12616
12629
  export {
12617
12630
  Yh as default
12618
12631
  };