@burdenoff/microfe-support 2026.1031.1 → 2026.1109.1

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 (147) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +6 -0
  2. package/dist/dev/main.d.ts +0 -0
  3. package/dist/generated/global-operations.d.ts +60 -60
  4. package/dist/node_modules/@tiptap/core/dist/index.js +949 -674
  5. package/dist/node_modules/@tiptap/core/dist/index.js.map +1 -1
  6. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -1
  7. package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
  8. package/dist/node_modules/@tiptap/extension-code/dist/index.js +14 -3
  9. package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
  10. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +1 -3
  11. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -1
  12. package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +1 -1
  13. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
  14. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +4 -1
  15. package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -1
  16. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
  17. package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
  18. package/dist/node_modules/@tiptap/extension-link/dist/index.js +76 -51
  19. package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
  20. package/dist/node_modules/@tiptap/extension-list/dist/index.js +143 -127
  21. package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +1 -1
  22. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +3 -2
  23. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -1
  24. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +1 -1
  25. package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
  26. package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +1 -1
  27. package/dist/node_modules/@tiptap/extension-underline/dist/index.js +21 -11
  28. package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -1
  29. package/dist/node_modules/@tiptap/extensions/dist/index.js +8 -9
  30. package/dist/node_modules/@tiptap/extensions/dist/index.js.map +1 -1
  31. package/dist/node_modules/@tiptap/react/dist/index.js +70 -49
  32. package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
  33. package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -1
  34. package/dist/node_modules/fast-equals/dist/es/index.js +108 -76
  35. package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
  36. package/dist/node_modules/linkifyjs/dist/linkify.js +127 -113
  37. package/dist/node_modules/linkifyjs/dist/linkify.js.map +1 -1
  38. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +1 -1
  39. package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +1 -1
  40. package/dist/node_modules/prosemirror-history/dist/index.js +21 -14
  41. package/dist/node_modules/prosemirror-history/dist/index.js.map +1 -1
  42. package/dist/node_modules/prosemirror-model/dist/index.js +98 -105
  43. package/dist/node_modules/prosemirror-model/dist/index.js.map +1 -1
  44. package/dist/node_modules/prosemirror-schema-list/dist/index.js +37 -34
  45. package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +1 -1
  46. package/dist/node_modules/prosemirror-transform/dist/index.js +153 -101
  47. package/dist/node_modules/prosemirror-transform/dist/index.js.map +1 -1
  48. package/dist/node_modules/prosemirror-view/dist/index.js +742 -693
  49. package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -1
  50. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +96 -17
  51. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
  52. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +55 -0
  53. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -0
  54. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +53 -0
  55. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +1 -0
  56. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +53 -0
  57. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
  58. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +45 -0
  59. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -0
  60. package/dist/node_modules/use-sync-external-store/shim/index.js +11 -0
  61. package/dist/node_modules/use-sync-external-store/shim/index.js.map +1 -0
  62. package/dist/node_modules/use-sync-external-store/shim/with-selector.js +11 -0
  63. package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +1 -0
  64. package/dist/support/SupportAdminRoot.d.ts +2 -2
  65. package/dist/support/SupportAdminRoutes.d.ts +1 -1
  66. package/dist/support/SupportUserRoot.d.ts +2 -2
  67. package/dist/support/SupportUserRoutes.d.ts +1 -1
  68. package/dist/support/components/NotificationToast.d.ts +2 -2
  69. package/dist/support/components/PageLayout.d.ts +4 -4
  70. package/dist/support/components/RouteHelpers.d.ts +1 -1
  71. package/dist/support/components/analytics/CategoryBreakdown.d.ts +1 -1
  72. package/dist/support/components/analytics/MetricCard.d.ts +1 -1
  73. package/dist/support/components/analytics/PriorityBreakdown.d.ts +1 -1
  74. package/dist/support/components/analytics/SLAReport.d.ts +1 -1
  75. package/dist/support/components/analytics/SatisfactionDistribution.d.ts +1 -1
  76. package/dist/support/components/analytics/TopAgents.d.ts +1 -1
  77. package/dist/support/components/analytics/TrendChart.d.ts +1 -1
  78. package/dist/support/components/careers/BulkCandidateActionGuidance.d.ts +1 -1
  79. package/dist/support/components/careers/BulkCandidateDialogs.d.ts +7 -7
  80. package/dist/support/components/careers/BulkOperationFeedback.d.ts +8 -8
  81. package/dist/support/components/careers/BulkSelectionSummary.d.ts +2 -2
  82. package/dist/support/components/careers/RichTextEditor.d.ts +1 -2
  83. package/dist/support/components/careers/RichTextEditor.js.map +1 -1
  84. package/dist/support/components/kb/ArticleForm.d.ts +1 -1
  85. package/dist/support/components/settings/CannedResponsesSettings.d.ts +1 -1
  86. package/dist/support/components/settings/SLAPoliciesSettings.d.ts +1 -1
  87. package/dist/support/components/settings/TicketCategoriesSettings.d.ts +1 -1
  88. package/dist/support/components/tickets/AttachmentList.d.ts +1 -1
  89. package/dist/support/components/tickets/MarkdownContent.d.ts +1 -1
  90. package/dist/support/components/tickets/MessageComposer.d.ts +1 -1
  91. package/dist/support/components/tickets/MessageThread.d.ts +2 -2
  92. package/dist/support/components/tickets/TicketDetailHeader.d.ts +2 -2
  93. package/dist/support/components/tickets/TicketHeader.d.ts +2 -2
  94. package/dist/support/components/tickets/TicketSidebar.d.ts +2 -2
  95. package/dist/support/components/tickets/TriagePanel.d.ts +2 -2
  96. package/dist/support/constants/pipeline.d.ts +0 -6
  97. package/dist/support/events/rybbit.d.ts +1 -1
  98. package/dist/support/hooks/useAnalyticsOperations.d.ts +10 -25
  99. package/dist/support/hooks/useAnalyticsOperations.js +40 -39
  100. package/dist/support/hooks/useAnalyticsOperations.js.map +1 -1
  101. package/dist/support/hooks/useAttachmentsFailedToast.d.ts +1 -1
  102. package/dist/support/hooks/useChatOperations.d.ts +2 -2
  103. package/dist/support/hooks/useKnowledgeBaseOperations.d.ts +7 -13
  104. package/dist/support/hooks/useKnowledgeBaseOperations.js +84 -83
  105. package/dist/support/hooks/useKnowledgeBaseOperations.js.map +1 -1
  106. package/dist/support/hooks/useRegisterFooter.d.ts +1 -1
  107. package/dist/support/hooks/useSettingsOperations.d.ts +7 -16
  108. package/dist/support/hooks/useSupportAttachments.d.ts +1 -1
  109. package/dist/support/hooks/useTicketListOperations.d.ts +3 -6
  110. package/dist/support/hooks/useTicketOperations.d.ts +5 -11
  111. package/dist/support/hooks/useTicketOperations.js +80 -79
  112. package/dist/support/hooks/useTicketOperations.js.map +1 -1
  113. package/dist/support/pages/AnalyticsPage.d.ts +1 -1
  114. package/dist/support/pages/ArticleDetailAdminPage.d.ts +1 -1
  115. package/dist/support/pages/ArticleDetailUserPage.d.ts +1 -1
  116. package/dist/support/pages/ContactInquiriesPage.d.ts +1 -1
  117. package/dist/support/pages/ContactInquiryDetailPage.d.ts +1 -1
  118. package/dist/support/pages/CreateArticlePage.d.ts +1 -1
  119. package/dist/support/pages/CreateTicketPage.d.ts +1 -1
  120. package/dist/support/pages/EditArticlePage.d.ts +1 -1
  121. package/dist/support/pages/InterviewersPage.d.ts +1 -1
  122. package/dist/support/pages/JobApplicationDetailPage.d.ts +1 -2
  123. package/dist/support/pages/JobApplicationsPage.d.ts +1 -1
  124. package/dist/support/pages/JobPostingDetailPage.d.ts +1 -1
  125. package/dist/support/pages/JobPostingsPage.d.ts +1 -1
  126. package/dist/support/pages/KnowledgeBaseAdminPage.d.ts +1 -1
  127. package/dist/support/pages/KnowledgeBaseUserPage.d.ts +1 -1
  128. package/dist/support/pages/SettingsPage.d.ts +1 -1
  129. package/dist/support/pages/SettingsPage.js.map +1 -1
  130. package/dist/support/pages/TicketDetailAdminPage.d.ts +1 -1
  131. package/dist/support/pages/TicketDetailUserPage.d.ts +1 -1
  132. package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
  133. package/dist/support/pages/TicketListPage.d.ts +1 -1
  134. package/dist/support/providers/SupportProvider.d.ts +2 -2
  135. package/dist/support/store/supportStore.d.ts +2 -2
  136. package/dist/support/utils/bulkCandidateTargetQuery.d.ts +1 -1
  137. package/dist/support/utils/cn.d.ts +1 -1
  138. package/dist/support/utils/index.d.ts +1 -1
  139. package/dist/support/utils/markdown.d.ts +0 -1
  140. package/dist/support/utils/refetch.d.ts +12 -0
  141. package/dist/support/utils/refetch.js +7 -0
  142. package/dist/support/utils/refetch.js.map +1 -0
  143. package/dist/support/utils/ticketFilters.d.ts +2 -2
  144. package/dist/support/utils/uiTokens.d.ts +1 -1
  145. package/dist/test/dom.d.ts +1 -0
  146. package/dist/test/setup.d.ts +1 -0
  147. package/package.json +65 -54
@@ -50,8 +50,8 @@ var u = 1, d = 2, f = 4, p = 8, m = class {
50
50
  if (e <= g) {
51
51
  let i = l ? e == c ? -1 : e == g ? 1 : t : t, a = c + r + (i < 0 ? 0 : h);
52
52
  if (n) return a;
53
- let _ = e == (t < 0 ? c : g) ? null : s(o / 3, e - c), v = e == c ? d : e == g ? u : f;
54
- return (t < 0 ? e != c : e != g) && (v |= p), new m(a, v, _);
53
+ let _ = e == (t < 0 ? c : g) ? null : s(o / 3, e - c), v = 0;
54
+ return l && (v |= e == c ? d : e == g ? u : f, (t < 0 ? e != c : e != g) && (v |= p)), new m(a, v, _);
55
55
  }
56
56
  r += h - l;
57
57
  }
@@ -206,12 +206,22 @@ var x = class e extends v {
206
206
  let t = e.slice(this.from, this.to), n = e.resolve(this.from), r = n.node(n.sharedDepth(this.to)), a = new i(b(t.content, (e, t) => !e.isAtom || !t.type.allowsMarkType(this.mark.type) ? e : e.mark(this.mark.addToSet(e.marks)), r), t.openStart, t.openEnd);
207
207
  return y.fromReplace(e, this.from, this.to, a);
208
208
  }
209
- invert() {
210
- return new S(this.from, this.to, this.mark);
209
+ invert(n) {
210
+ let r = [];
211
+ return n.nodesBetween(this.from, this.to, (n, i) => {
212
+ if (n.isInline && n.isAtom) {
213
+ let a = this.mark.addToSet(n.marks);
214
+ if (!t.sameSet(a, n.marks)) {
215
+ let t = Math.max(this.from, i), o = Math.min(this.to, i + n.nodeSize);
216
+ C(S, t, o, this.mark, r);
217
+ for (let i of n.marks) i.isInSet(a) || C(e, t, o, i, r);
218
+ }
219
+ }
220
+ }), r.length == 1 ? r[0] : new w(r);
211
221
  }
212
222
  map(t) {
213
- let n = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1);
214
- return n.deleted && r.deleted || n.pos >= r.pos ? null : new e(n.pos, r.pos, this.mark);
223
+ let n = t.map(this.from, 1), r = t.map(this.to, -1);
224
+ return n >= r ? null : new e(n, r, this.mark);
215
225
  }
216
226
  merge(t) {
217
227
  return t instanceof e && t.mark.eq(this.mark) && this.from <= t.to && this.to >= t.from ? new e(Math.min(this.from, t.from), Math.max(this.to, t.to), this.mark) : null;
@@ -238,12 +248,15 @@ var S = class e extends v {
238
248
  let t = e.slice(this.from, this.to), n = new i(b(t.content, (e) => e.mark(this.mark.removeFromSet(e.marks)), e), t.openStart, t.openEnd);
239
249
  return y.fromReplace(e, this.from, this.to, n);
240
250
  }
241
- invert() {
242
- return new x(this.from, this.to, this.mark);
251
+ invert(e) {
252
+ let t = [];
253
+ return e.nodesBetween(this.from, this.to, (e, n) => {
254
+ e.isInline && e.isAtom && this.mark.isInSet(e.marks) && C(x, Math.max(this.from, n), Math.min(this.to, n + e.nodeSize), this.mark, t);
255
+ }), t.length == 1 ? t[0] : new w(t);
243
256
  }
244
257
  map(t) {
245
- let n = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1);
246
- return n.deleted && r.deleted || n.pos >= r.pos ? null : new e(n.pos, r.pos, this.mark);
258
+ let n = t.map(this.from, 1), r = t.map(this.to, -1);
259
+ return n >= r ? null : new e(n, r, this.mark);
247
260
  }
248
261
  merge(t) {
249
262
  return t instanceof e && t.mark.eq(this.mark) && this.from <= t.to && this.to >= t.from ? new e(Math.min(this.from, t.from), Math.max(this.to, t.to), this.mark) : null;
@@ -262,7 +275,46 @@ var S = class e extends v {
262
275
  }
263
276
  };
264
277
  v.jsonID("removeMark", S);
265
- var C = class t extends v {
278
+ function C(e, t, n, r, i) {
279
+ let a = i.length ? i[i.length - 1] : null;
280
+ a && a instanceof e && a.to == t && a.mark.eq(r) ? i[i.length - 1] = new e(a.from, n, r) : i.push(new e(t, n, r));
281
+ }
282
+ var w = class e extends v {
283
+ constructor(e) {
284
+ super(), this.steps = e;
285
+ }
286
+ apply(e) {
287
+ for (let t of this.steps) {
288
+ let n = t.apply(e);
289
+ if (!n.doc) return n;
290
+ e = n.doc;
291
+ }
292
+ return new y(e, null);
293
+ }
294
+ invert(t) {
295
+ return new e(this.steps.map((e) => e.invert(t)));
296
+ }
297
+ map(t) {
298
+ let n = [];
299
+ for (let e of this.steps) {
300
+ let r = e.map(t);
301
+ r && n.push(r);
302
+ }
303
+ return n.length ? new e(n) : null;
304
+ }
305
+ toJSON() {
306
+ return {
307
+ stepType: "markSet",
308
+ steps: this.steps.map((e) => e.toJSON())
309
+ };
310
+ }
311
+ static fromJSON(t, n) {
312
+ if (!Array.isArray(n.steps) || !n.steps.every((e) => e.stepType == "addMark" || e.stepType == "removeMark")) throw RangeError("Invalid JSON for MarkSetStep");
313
+ return new e(n.steps.map((e) => v.fromJSON(t, e)));
314
+ }
315
+ };
316
+ v.jsonID("markSet", w);
317
+ var T = class t extends v {
266
318
  constructor(e, t) {
267
319
  super(), this.pos = e, this.mark = t;
268
320
  }
@@ -281,7 +333,7 @@ var C = class t extends v {
281
333
  return new t(this.pos, this.mark);
282
334
  }
283
335
  }
284
- return new w(this.pos, this.mark);
336
+ return new E(this.pos, this.mark);
285
337
  }
286
338
  map(e) {
287
339
  let n = e.mapResult(this.pos, 1);
@@ -299,8 +351,8 @@ var C = class t extends v {
299
351
  return new t(n.pos, e.markFromJSON(n.mark));
300
352
  }
301
353
  };
302
- v.jsonID("addNodeMark", C);
303
- var w = class t extends v {
354
+ v.jsonID("addNodeMark", T);
355
+ var E = class t extends v {
304
356
  constructor(e, t) {
305
357
  super(), this.pos = e, this.mark = t;
306
358
  }
@@ -312,7 +364,7 @@ var w = class t extends v {
312
364
  }
313
365
  invert(e) {
314
366
  let t = e.nodeAt(this.pos);
315
- return !t || !this.mark.isInSet(t.marks) ? this : new C(this.pos, this.mark);
367
+ return !t || !this.mark.isInSet(t.marks) ? this : new T(this.pos, this.mark);
316
368
  }
317
369
  map(e) {
318
370
  let n = e.mapResult(this.pos, 1);
@@ -330,13 +382,13 @@ var w = class t extends v {
330
382
  return new t(n.pos, e.markFromJSON(n.mark));
331
383
  }
332
384
  };
333
- v.jsonID("removeNodeMark", w);
334
- var T = class e extends v {
385
+ v.jsonID("removeNodeMark", E);
386
+ var D = class e extends v {
335
387
  constructor(e, t, n, r = !1) {
336
388
  super(), this.from = e, this.to = t, this.slice = n, this.structure = r;
337
389
  }
338
390
  apply(e) {
339
- return this.structure && D(e, this.from, this.to) ? y.fail("Structure replace would overwrite content") : y.fromReplace(e, this.from, this.to, this.slice);
391
+ return this.structure && k(e, this.from, this.to) ? y.fail("Structure replace would overwrite content") : y.fromReplace(e, this.from, this.to, this.slice);
340
392
  }
341
393
  getMap() {
342
394
  return new h([
@@ -377,13 +429,13 @@ var T = class e extends v {
377
429
  return new e(n.from, n.to, i.fromJSON(t, n.slice), !!n.structure);
378
430
  }
379
431
  };
380
- T.MAP_BIAS = 1, v.jsonID("replace", T);
381
- var E = class e extends v {
432
+ D.MAP_BIAS = 1, v.jsonID("replace", D);
433
+ var O = class e extends v {
382
434
  constructor(e, t, n, r, i, a, o = !1) {
383
435
  super(), this.from = e, this.to = t, this.gapFrom = n, this.gapTo = r, this.slice = i, this.insert = a, this.structure = o;
384
436
  }
385
437
  apply(e) {
386
- if (this.structure && (D(e, this.from, this.gapFrom) || D(e, this.gapTo, this.to))) return y.fail("Structure gap-replace would overwrite content");
438
+ if (this.structure && (k(e, this.from, this.gapFrom) || k(e, this.gapTo, this.to))) return y.fail("Structure gap-replace would overwrite content");
387
439
  let t = e.slice(this.gapFrom, this.gapTo);
388
440
  if (t.openStart || t.openEnd) return y.fail("Gap is not a flat range");
389
441
  let n = this.slice.insertAt(this.insert, t.content);
@@ -405,7 +457,7 @@ var E = class e extends v {
405
457
  }
406
458
  map(t) {
407
459
  let n = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1), i = this.from == this.gapFrom ? n.pos : t.map(this.gapFrom, -1), a = this.to == this.gapTo ? r.pos : t.map(this.gapTo, 1);
408
- return n.deletedAcross && r.deletedAcross || i < n.pos || a > r.pos ? null : new e(n.pos, r.pos, i, a, this.slice, this.insert, this.structure);
460
+ return n.deletedAcross && r.deletedAcross || i < n.pos || a > r.pos || i > a ? null : new e(n.pos, r.pos, i, a, this.slice, this.insert, this.structure);
409
461
  }
410
462
  toJSON() {
411
463
  let e = {
@@ -423,8 +475,8 @@ var E = class e extends v {
423
475
  return new e(n.from, n.to, n.gapFrom, n.gapTo, i.fromJSON(t, n.slice), n.insert, !!n.structure);
424
476
  }
425
477
  };
426
- v.jsonID("replaceAround", E);
427
- function D(e, t, n) {
478
+ v.jsonID("replaceAround", O);
479
+ function k(e, t, n) {
428
480
  let r = e.resolve(t), i = n - t, a = r.depth;
429
481
  for (; i > 0 && a > 0 && r.indexAfter(a) == r.node(a).childCount;) a--, i--;
430
482
  if (i > 0) {
@@ -437,21 +489,17 @@ function D(e, t, n) {
437
489
  return !1;
438
490
  }
439
491
  function ee(e, t, n, r) {
440
- let i = [], a = [], o, s;
441
- e.doc.nodesBetween(t, n, (e, c, l) => {
492
+ let i = [];
493
+ e.doc.nodesBetween(t, n, (e, a, o) => {
442
494
  if (!e.isInline) return;
443
- let u = e.marks;
444
- if (!r.isInSet(u) && l.type.allowsMarkType(r.type)) {
445
- let l = Math.max(c, t), d = Math.min(c + e.nodeSize, n), f = r.addToSet(u);
446
- for (let e = 0; e < u.length; e++) u[e].isInSet(f) || (o && o.to == l && o.mark.eq(u[e]) ? o.to = d : i.push(o = new S(l, d, u[e])));
447
- s && s.to == l ? s.to = d : a.push(s = new x(l, d, r));
448
- }
449
- }), i.forEach((t) => e.step(t)), a.forEach((t) => e.step(t));
495
+ let s = e.marks;
496
+ !r.isInSet(s) && o.type.allowsMarkType(r.type) && C(x, Math.max(a, t), Math.min(a + e.nodeSize, n), r, i);
497
+ }), i.forEach((t) => e.step(t));
450
498
  }
451
499
  function te(e, t, r, i) {
452
500
  let a = [], o = 0;
453
501
  e.doc.nodesBetween(t, r, (e, s) => {
454
- if (!e.isInline) return;
502
+ if (!e.isInline || !e.isAtom) return;
455
503
  o++;
456
504
  let c = null;
457
505
  if (i instanceof n) {
@@ -476,17 +524,17 @@ function te(e, t, r, i) {
476
524
  }
477
525
  }), a.forEach((t) => e.step(new S(t.from, t.to, t.style)));
478
526
  }
479
- function O(t, n, r, a = r.contentMatch, o = !0) {
527
+ function A(t, n, r, a = r.contentMatch, o = !0) {
480
528
  let s = t.doc.nodeAt(n), c = [], l = n + 1;
481
529
  for (let n = 0; n < s.childCount; n++) {
482
530
  let u = s.child(n), d = l + u.nodeSize, f = a.matchType(u.type);
483
- if (!f) c.push(new T(l, d, i.empty));
531
+ if (!f) c.push(new D(l, d, i.empty));
484
532
  else {
485
533
  a = f;
486
534
  for (let e = 0; e < u.marks.length; e++) r.allowsMarkType(u.marks[e].type) || t.step(new S(l, d, u.marks[e]));
487
535
  if (o && u.isText && r.whitespace != "pre") {
488
536
  let t, n = /\r?\n|\r/g, a;
489
- for (; t = n.exec(u.text);) a ||= new i(e.from(r.schema.text(" ", r.allowedMarks(u.marks))), 0, 0), c.push(new T(l + t.index, l + t.index + t[0].length, a));
537
+ for (; t = n.exec(u.text);) a ||= new i(e.from(r.schema.text(" ", r.allowedMarks(u.marks))), 0, 0), c.push(new D(l + t.index, l + t.index + t[0].length, a));
490
538
  }
491
539
  }
492
540
  l = d;
@@ -515,16 +563,16 @@ function ie(t, n, r) {
515
563
  for (let t = s, n = !1; t > r; t--) n || a.index(t) > 0 ? (n = !0, f = e.from(a.node(t).copy(f)), p++) : u--;
516
564
  let m = e.empty, h = 0;
517
565
  for (let t = s, n = !1; t > r; t--) n || o.after(t + 1) < o.end(t) ? (n = !0, m = e.from(o.node(t).copy(m)), h++) : d++;
518
- t.step(new E(u, d, c, l, new i(f.append(m), p, h), f.size - p, !0));
566
+ t.step(new O(u, d, c, l, new i(f.append(m), p, h), f.size - p, !0));
519
567
  }
520
568
  function ae(e, t, n = null, r = e) {
521
- let i = oe(e, t), a = i && se(r, t);
522
- return a ? i.map(k).concat({
569
+ let i = oe(e, t), a = i && M(r, t);
570
+ return a ? i.map(j).concat({
523
571
  type: t,
524
572
  attrs: n
525
- }).concat(a.map(k)) : null;
573
+ }).concat(a.map(j)) : null;
526
574
  }
527
- function k(e) {
575
+ function j(e) {
528
576
  return {
529
577
  type: e,
530
578
  attrs: null
@@ -536,14 +584,14 @@ function oe(e, t) {
536
584
  let o = a.length ? a[0] : t;
537
585
  return n.canReplaceWith(r, i, o) ? a : null;
538
586
  }
539
- function se(e, t) {
587
+ function M(e, t) {
540
588
  let { parent: n, startIndex: r, endIndex: i } = e, a = n.child(r), o = t.contentMatch.findWrapping(a.type);
541
589
  if (!o) return null;
542
590
  let s = (o.length ? o[o.length - 1] : t).contentMatch;
543
591
  for (let e = r; s && e < i; e++) s = s.matchType(n.child(e).type);
544
592
  return !s || !s.validEnd ? null : o;
545
593
  }
546
- function A(t, n, r) {
594
+ function se(t, n, r) {
547
595
  let a = e.empty;
548
596
  for (let t = r.length - 1; t >= 0; t--) {
549
597
  if (a.size) {
@@ -553,26 +601,26 @@ function A(t, n, r) {
553
601
  a = e.from(r[t].type.create(r[t].attrs, a));
554
602
  }
555
603
  let o = n.start, s = n.end;
556
- t.step(new E(o, s, o, s, new i(a, 0, 0), r.length, !0));
604
+ t.step(new O(o, s, o, s, new i(a, 0, 0), r.length, !0));
557
605
  }
558
- function j(t, n, r, a, o) {
606
+ function N(t, n, r, a, o) {
559
607
  if (!a.isTextblock) throw RangeError("Type given to setBlockType should be a textblock");
560
608
  let s = t.steps.length;
561
609
  t.doc.nodesBetween(n, r, (n, r) => {
562
610
  let c = typeof o == "function" ? o(n) : o;
563
- if (n.isTextblock && !n.hasMarkup(a, c) && P(t.doc, t.mapping.slice(s).map(r), a)) {
611
+ if (n.isTextblock && !n.hasMarkup(a, c) && ce(t.doc, t.mapping.slice(s).map(r), a)) {
564
612
  let o = null;
565
613
  if (a.schema.linebreakReplacement) {
566
614
  let e = a.whitespace == "pre", t = !!a.contentMatch.matchType(a.schema.linebreakReplacement);
567
615
  e && !t ? o = !1 : !e && t && (o = !0);
568
616
  }
569
- o === !1 && N(t, n, r, s), O(t, t.mapping.slice(s).map(r, 1), a, void 0, o === null);
617
+ o === !1 && F(t, n, r, s), A(t, t.mapping.slice(s).map(r, 1), a, void 0, o === null);
570
618
  let l = t.mapping.slice(s), u = l.map(r, 1), d = l.map(r + n.nodeSize, 1);
571
- return t.step(new E(u, d, u + 1, d - 1, new i(e.from(a.create(c, null, n.marks)), 0, 0), 1, !0)), o === !0 && M(t, n, r, s), !1;
619
+ return t.step(new O(u, d, u + 1, d - 1, new i(e.from(a.create(c, null, n.marks)), 0, 0), 1, !0)), o === !0 && P(t, n, r, s), !1;
572
620
  }
573
621
  });
574
622
  }
575
- function M(e, t, n, r) {
623
+ function P(e, t, n, r) {
576
624
  t.forEach((i, a) => {
577
625
  if (i.isText) {
578
626
  let o, s = /\r?\n|\r/g;
@@ -583,7 +631,7 @@ function M(e, t, n, r) {
583
631
  }
584
632
  });
585
633
  }
586
- function N(e, t, n, r) {
634
+ function F(e, t, n, r) {
587
635
  t.forEach((i, a) => {
588
636
  if (i.type == i.type.schema.linebreakReplacement) {
589
637
  let i = e.mapping.slice(r).map(n + 1 + a);
@@ -591,20 +639,20 @@ function N(e, t, n, r) {
591
639
  }
592
640
  });
593
641
  }
594
- function P(e, t, n) {
642
+ function ce(e, t, n) {
595
643
  let r = e.resolve(t), i = r.index();
596
644
  return r.parent.canReplaceWith(i, i + 1, n);
597
645
  }
598
- function F(t, n, r, a, o) {
646
+ function le(t, n, r, a, o) {
599
647
  let s = t.doc.nodeAt(n);
600
648
  if (!s) throw RangeError("No node at given position");
601
649
  r ||= s.type;
602
650
  let c = r.create(a, null, o || s.marks);
603
651
  if (s.isLeaf) return t.replaceWith(n, n + s.nodeSize, c);
604
652
  if (!r.validContent(s.content)) throw RangeError("Invalid content for node type " + r.name);
605
- t.step(new E(n, n + s.nodeSize, n + 1, n + s.nodeSize - 1, new i(e.from(c), 0, 0), 1, !0));
653
+ t.step(new O(n, n + s.nodeSize, n + 1, n + s.nodeSize - 1, new i(e.from(c), 0, 0), 1, !0));
606
654
  }
607
- function ce(e, t, n = 1, r) {
655
+ function ue(e, t, n = 1, r) {
608
656
  let i = e.resolve(t), a = i.depth - n, o = r && r[r.length - 1] || i.parent;
609
657
  if (a < 0 || i.parent.type.spec.isolating || !i.parent.canReplace(i.index(), i.parent.childCount) || !o.type.validContent(i.parent.content.cutByIndex(i.index(), i.parent.childCount))) return !1;
610
658
  for (let e = i.depth - 1, t = n - 2; e > a; e--, t--) {
@@ -618,20 +666,20 @@ function ce(e, t, n = 1, r) {
618
666
  let s = i.indexAfter(a), c = r && r[0];
619
667
  return i.node(a).canReplaceWith(s, s, c ? c.type : i.node(a + 1).type);
620
668
  }
621
- function le(t, n, r = 1, a) {
669
+ function de(t, n, r = 1, a) {
622
670
  let o = t.doc.resolve(n), s = e.empty, c = e.empty;
623
671
  for (let t = o.depth, n = o.depth - r, i = r - 1; t > n; t--, i--) {
624
672
  s = e.from(o.node(t).copy(s));
625
673
  let n = a && a[i];
626
674
  c = e.from(n ? n.type.create(n.attrs, c) : o.node(t).copy(c));
627
675
  }
628
- t.step(new T(n, n, new i(s.append(c), r, r), !0));
676
+ t.step(new D(n, n, new i(s.append(c), r, r), !0));
629
677
  }
630
- function ue(e, t) {
678
+ function fe(e, t) {
631
679
  let n = e.resolve(t), r = n.index();
632
680
  return I(n.nodeBefore, n.nodeAfter) && n.parent.canReplace(r, r + 1);
633
681
  }
634
- function de(e, t) {
682
+ function pe(e, t) {
635
683
  t.content.size || e.type.compatibleContent(t.type);
636
684
  let n = e.contentMatchAt(e.childCount), { linebreakReplacement: r } = e.type.schema;
637
685
  for (let i = 0; i < t.childCount; i++) {
@@ -641,7 +689,7 @@ function de(e, t) {
641
689
  return n.validEnd;
642
690
  }
643
691
  function I(e, t) {
644
- return !!(e && t && !e.isLeaf && de(e, t));
692
+ return !!(e && t && !e.isLeaf && pe(e, t));
645
693
  }
646
694
  function L(e, t, n = -1) {
647
695
  let r = e.resolve(t);
@@ -661,13 +709,13 @@ function R(e, t, n) {
661
709
  let c = e.steps.length;
662
710
  if (r === !1) {
663
711
  let r = e.doc.resolve(t + n);
664
- N(e, r.node(), r.before(), c);
712
+ F(e, r.node(), r.before(), c);
665
713
  }
666
- s.inlineContent && O(e, t + n - 1, s, o.node().contentMatchAt(o.index()), r == null);
714
+ s.inlineContent && A(e, t + n - 1, s, o.node().contentMatchAt(o.index()), r == null);
667
715
  let l = e.mapping.slice(c), u = l.map(t - n);
668
- if (e.step(new T(u, l.map(t + n, -1), i.empty, !0)), r === !0) {
716
+ if (e.step(new D(u, l.map(t + n, -1), i.empty, !0)), r === !0) {
669
717
  let t = e.doc.resolve(u);
670
- M(e, t.node(), t.before(), e.steps.length);
718
+ P(e, t.node(), t.before(), e.steps.length);
671
719
  }
672
720
  return e;
673
721
  }
@@ -705,12 +753,12 @@ function B(e, t, n) {
705
753
  function V(e, t, n = t, r = i.empty) {
706
754
  if (t == n && !r.size) return null;
707
755
  let a = e.resolve(t), o = e.resolve(n);
708
- return H(a, o, r) ? new T(t, n, r) : new fe(a, o, r).fit();
756
+ return H(a, o, r) ? new D(t, n, r) : new me(a, o, r).fit();
709
757
  }
710
758
  function H(e, t, n) {
711
759
  return !n.openStart && !n.openEnd && e.start() == t.start() && e.parent.canReplace(e.index(), t.index(), n.content);
712
760
  }
713
- var fe = class {
761
+ var me = class {
714
762
  constructor(t, n, r) {
715
763
  this.$from = t, this.$to = n, this.unplaced = r, this.frontier = [], this.placed = e.empty;
716
764
  for (let e = 0; e <= t.depth; e++) {
@@ -735,7 +783,7 @@ var fe = class {
735
783
  let a = this.placed, o = n.depth, s = r.depth;
736
784
  for (; o && s && a.childCount == 1;) a = a.firstChild.content, o--, s--;
737
785
  let c = new i(a, o, s);
738
- return e > -1 ? new E(n.pos, e, this.$to.pos, this.$to.end(), c, t) : c.size || n.pos != this.$to.pos ? new T(n.pos, r.pos, c) : null;
786
+ return e > -1 ? new O(n.pos, e, this.$to.pos, this.$to.end(), c, t) : c.size || n.pos != this.$to.pos ? new D(n.pos, r.pos, c) : null;
739
787
  }
740
788
  findFittable() {
741
789
  let t = this.unplaced.openStart;
@@ -770,8 +818,8 @@ var fe = class {
770
818
  }
771
819
  }
772
820
  openMore() {
773
- let { content: e, openStart: t, openEnd: n } = this.unplaced, r = G(e, t);
774
- return !r.childCount || r.firstChild.isLeaf ? !1 : (this.unplaced = new i(e, t + 1, Math.max(n, r.size + t >= e.size - n ? t + 1 : 0)), !0);
821
+ let { content: e, openStart: t, openEnd: n } = this.unplaced;
822
+ return J(e, -1) <= t ? !1 : (this.unplaced.size > 1 && J(e, 1) > n && n++, this.unplaced = new i(e, t + 1, n), !0);
775
823
  }
776
824
  dropNode() {
777
825
  let { content: e, openStart: t, openEnd: n } = this.unplaced, r = G(e, t);
@@ -796,14 +844,11 @@ var fe = class {
796
844
  }
797
845
  let h = u == c.childCount;
798
846
  h || (m = -1), this.placed = W(this.placed, n, e.from(d)), this.frontier[n].match = f, h && m < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
799
- for (let e = 0, t = c; e < m; e++) {
800
- let e = t.lastChild;
801
- this.frontier.push({
802
- type: e.type,
803
- match: e.contentMatchAt(e.childCount)
804
- }), t = e.content;
805
- }
806
- this.unplaced = h ? t == 0 ? i.empty : new i(U(s.content, t - 1, 1), t - 1, m < 0 ? s.openEnd : t - 1) : new i(U(s.content, t, u), s.openStart, s.openEnd);
847
+ for (let e = 0, t = d[d.length - 1]; t && e < m; e++) this.frontier.push({
848
+ type: t.type,
849
+ match: t.contentMatchAt(t.childCount)
850
+ }), t = t.lastChild;
851
+ this.unplaced = h ? t == 0 ? i.empty : new i(U(s.content, t - 1, 1), t - 1, m < 0 ? s.openEnd : t - 1) : new i(U(s.content, t, u), t, s.openEnd);
807
852
  }
808
853
  mustMoveInline() {
809
854
  if (!this.$to.parent.isTextblock) return -1;
@@ -871,19 +916,26 @@ function q(e, t, n, r, i) {
871
916
  let a = e.node(t), o = i ? e.indexAfter(t) : e.index(t);
872
917
  if (o == a.childCount && !n.compatibleContent(a.type)) return null;
873
918
  let s = r.fillBefore(a.content, !0, o);
874
- return s && !pe(n, a.content, o) ? s : null;
919
+ return s && !he(n, a.content, o) ? s : null;
875
920
  }
876
- function pe(e, t, n) {
921
+ function he(e, t, n) {
877
922
  for (let r = n; r < t.childCount; r++) if (!e.allowsMarks(t.child(r).marks)) return !0;
878
923
  return !1;
879
924
  }
880
- function me(e) {
925
+ function ge(e) {
881
926
  return e.spec.defining || e.spec.definingForContent;
882
927
  }
883
- function he(e, t, n, r) {
928
+ function J(e, t) {
929
+ for (let n = 0;; n++) {
930
+ let r = t < 0 ? e.firstChild : e.lastChild;
931
+ if (!r || r.isAtom) return n;
932
+ e = r.content;
933
+ }
934
+ }
935
+ function _e(e, t, n, r) {
884
936
  if (!r.size) return e.deleteRange(t, n);
885
937
  let a = e.doc.resolve(t), o = e.doc.resolve(n);
886
- if (H(a, o, r)) return e.step(new T(t, n, r));
938
+ if (H(a, o, r)) return e.step(new D(t, n, r));
887
939
  let s = X(a, o);
888
940
  s[s.length - 1] == 0 && s.pop();
889
941
  let c = -(a.depth + 1);
@@ -900,7 +952,7 @@ function he(e, t, n, r) {
900
952
  e = n.content;
901
953
  }
902
954
  for (let e = d - 1; e >= 0; e--) {
903
- let t = u[e], n = me(t.type);
955
+ let t = u[e], n = ge(t.type);
904
956
  if (n && !t.sameMarkup(a.node(Math.abs(c) - 1))) d = e;
905
957
  else if (n || !t.type.isTextblock) break;
906
958
  }
@@ -910,7 +962,7 @@ function he(e, t, n, r) {
910
962
  let u = s[(t + l) % s.length], d = !0;
911
963
  u < 0 && (d = !1, u = -u);
912
964
  let p = a.node(u - 1), m = a.index(u - 1);
913
- if (p.canReplaceWith(m, m, f.type, f.marks)) return e.replace(a.before(u), d ? o.after(u) : n, new i(J(r.content, 0, r.openStart, c), c, r.openEnd));
965
+ if (p.canReplaceWith(m, m, f.type, f.marks)) return e.replace(a.before(u), d ? o.after(u) : n, new i(Y(r.content, 0, r.openStart, c), c, r.openEnd));
914
966
  }
915
967
  }
916
968
  let f = e.steps.length;
@@ -919,10 +971,10 @@ function he(e, t, n, r) {
919
971
  e < 0 || (t = a.before(e), n = o.after(e));
920
972
  }
921
973
  }
922
- function J(t, n, r, i, a) {
974
+ function Y(t, n, r, i, a) {
923
975
  if (n < r) {
924
976
  let e = t.firstChild;
925
- t = t.replaceChild(0, e.copy(J(e.content, n + 1, r, i, e)));
977
+ t = t.replaceChild(0, e.copy(Y(e.content, n + 1, r, i, e)));
926
978
  }
927
979
  if (n > i) {
928
980
  let n = a.contentMatchAt(0), r = n.fillBefore(t).append(t);
@@ -930,14 +982,14 @@ function J(t, n, r, i, a) {
930
982
  }
931
983
  return t;
932
984
  }
933
- function Y(t, n, r, a) {
985
+ function ve(t, n, r, a) {
934
986
  if (!a.isInline && n == r && t.doc.resolve(n).parent.content.size) {
935
987
  let e = z(t.doc, n, a.type);
936
988
  e != null && (n = r = e);
937
989
  }
938
990
  t.replaceRange(n, r, new i(e.from(a), 0, 0));
939
991
  }
940
- function ge(e, t, n) {
992
+ function ye(e, t, n) {
941
993
  let r = e.doc.resolve(t), i = e.doc.resolve(n);
942
994
  if (r.parent.isTextblock && i.parent.isTextblock && r.start() != i.start() && r.parentOffset == 0 && i.parentOffset == 0) {
943
995
  let a = r.sharedDepth(n), o = !1;
@@ -1042,7 +1094,7 @@ $ = function e(t) {
1042
1094
  let n = Error.call(this, t);
1043
1095
  return n.__proto__ = e.prototype, n;
1044
1096
  }, $.prototype = Object.create(Error.prototype), $.prototype.constructor = $, $.prototype.name = "TransformError";
1045
- var _e = class {
1097
+ var be = class {
1046
1098
  constructor(e) {
1047
1099
  this.doc = e, this.steps = [], this.docs = [], this.mapping = new g();
1048
1100
  }
@@ -1091,13 +1143,13 @@ var _e = class {
1091
1143
  return this.replaceWith(e, e, t);
1092
1144
  }
1093
1145
  replaceRange(e, t, n) {
1094
- return he(this, e, t, n), this;
1146
+ return _e(this, e, t, n), this;
1095
1147
  }
1096
1148
  replaceRangeWith(e, t, n) {
1097
- return Y(this, e, t, n), this;
1149
+ return ve(this, e, t, n), this;
1098
1150
  }
1099
1151
  deleteRange(e, t) {
1100
- return ge(this, e, t), this;
1152
+ return ye(this, e, t), this;
1101
1153
  }
1102
1154
  lift(e, t) {
1103
1155
  return ie(this, e, t), this;
@@ -1106,13 +1158,13 @@ var _e = class {
1106
1158
  return R(this, e, t), this;
1107
1159
  }
1108
1160
  wrap(e, t) {
1109
- return A(this, e, t), this;
1161
+ return se(this, e, t), this;
1110
1162
  }
1111
1163
  setBlockType(e, t = e, n, r = null) {
1112
- return j(this, e, t, n, r), this;
1164
+ return N(this, e, t, n, r), this;
1113
1165
  }
1114
1166
  setNodeMarkup(e, t, n = null, r) {
1115
- return F(this, e, t, n, r), this;
1167
+ return le(this, e, t, n, r), this;
1116
1168
  }
1117
1169
  setNodeAttribute(e, t, n) {
1118
1170
  return this.step(new Z(e, t, n)), this;
@@ -1121,21 +1173,21 @@ var _e = class {
1121
1173
  return this.step(new Q(e, t)), this;
1122
1174
  }
1123
1175
  addNodeMark(e, t) {
1124
- return this.step(new C(e, t)), this;
1176
+ return this.step(new T(e, t)), this;
1125
1177
  }
1126
1178
  removeNodeMark(e, n) {
1127
1179
  let r = this.doc.nodeAt(e);
1128
1180
  if (!r) throw RangeError("No node at position " + e);
1129
- if (n instanceof t) n.isInSet(r.marks) && this.step(new w(e, n));
1181
+ if (n instanceof t) n.isInSet(r.marks) && this.step(new E(e, n));
1130
1182
  else {
1131
1183
  let t = r.marks, i, a = [];
1132
- for (; i = n.isInSet(t);) a.push(new w(e, i)), t = i.removeFromSet(t);
1184
+ for (; i = n.isInSet(t);) a.push(new E(e, i)), t = i.removeFromSet(t);
1133
1185
  for (let e = a.length - 1; e >= 0; e--) this.step(a[e]);
1134
1186
  }
1135
1187
  return this;
1136
1188
  }
1137
1189
  split(e, t = 1, n) {
1138
- return le(this, e, t, n), this;
1190
+ return de(this, e, t, n), this;
1139
1191
  }
1140
1192
  addMark(e, t, n) {
1141
1193
  return ee(this, e, t, n), this;
@@ -1144,9 +1196,9 @@ var _e = class {
1144
1196
  return te(this, e, t, n), this;
1145
1197
  }
1146
1198
  clearIncompatible(e, t, n) {
1147
- return O(this, e, t, n), this;
1199
+ return A(this, e, t, n), this;
1148
1200
  }
1149
1201
  };
1150
- export { x as AddMarkStep, C as AddNodeMarkStep, Z as AttrStep, Q as DocAttrStep, m as MapResult, g as Mapping, S as RemoveMarkStep, w as RemoveNodeMarkStep, E as ReplaceAroundStep, T as ReplaceStep, v as Step, h as StepMap, y as StepResult, _e as Transform, $ as TransformError, ue as canJoin, ce as canSplit, B as dropPoint, ae as findWrapping, z as insertPoint, L as joinPoint, re as liftTarget, V as replaceStep };
1202
+ export { x as AddMarkStep, T as AddNodeMarkStep, Z as AttrStep, Q as DocAttrStep, m as MapResult, g as Mapping, S as RemoveMarkStep, E as RemoveNodeMarkStep, O as ReplaceAroundStep, D as ReplaceStep, v as Step, h as StepMap, y as StepResult, be as Transform, $ as TransformError, fe as canJoin, ue as canSplit, B as dropPoint, ae as findWrapping, z as insertPoint, L as joinPoint, re as liftTarget, V as replaceStep };
1151
1203
 
1152
1204
  //# sourceMappingURL=index.js.map