@templatical/editor 0.8.3 → 0.8.5

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 (173) hide show
  1. package/dist/{AiChatSidebar-CXpsSTbt.js → AiChatSidebar-uhkhnXQd.js} +14 -14
  2. package/dist/{AiFeatureMenu-De9ow6Ej.js → AiFeatureMenu-DXNKvXP5.js} +8 -8
  3. package/dist/{BlockIssueBadge-FEuyG1p0.js → BlockIssueBadge-DM-vXeD6.js} +5 -5
  4. package/dist/{CloudEditor-Ccoru8Up.js → CloudEditor-BSkPQjwo.js} +23 -23
  5. package/dist/{CollaboratorBar-CmHq6XiL.js → CollaboratorBar-CP76Sh6c.js} +5 -5
  6. package/dist/{CommentsSidebar-DaWP5ZGl.js → CommentsSidebar-_llWQ4VT.js} +14 -14
  7. package/dist/{CountdownBlock-C51M6s-J.js → CountdownBlock-I99sC0C5.js} +4 -4
  8. package/dist/{CountdownToolbar-C2QkG8S0.js → CountdownToolbar-BUhOUiQ9.js} +4 -4
  9. package/dist/{DesignReferenceSidebar-BwIRFmpA.js → DesignReferenceSidebar-CfJqJ7l6.js} +11 -11
  10. package/dist/{IssuesPanel-B6ukjc1i.js → IssuesPanel-4MKZe8yP.js} +8 -8
  11. package/dist/{LoadingTrack-CZ6tO326.js → LoadingTrack-xCOLUR3o.js} +2 -2
  12. package/dist/{ModuleBrowserModal-0n6DoZtA.js → ModuleBrowserModal-BFQTm6uY.js} +11 -11
  13. package/dist/{ModulePreviewCanvas-DEtTEvMM.js → ModulePreviewCanvas-DeqMpo73.js} +3 -3
  14. package/dist/{NumberWithSuffix-wOM0319c.js → NumberWithSuffix-CxMFy_j3.js} +4 -4
  15. package/dist/{ParagraphEditor-PQZp1plL.js → ParagraphEditor-DqomSbW3.js} +28 -28
  16. package/dist/{RichTextEditorContent-C02UzFoS.js → RichTextEditorContent-B_KCY6T1.js} +6 -6
  17. package/dist/{SaveModuleDialog-WWMn87Oi.js → SaveModuleDialog-DKcpPeWd.js} +7 -7
  18. package/dist/{SnapshotHistory-Dy_Iy7VG.js → SnapshotHistory-Z9RQj53S.js} +10 -10
  19. package/dist/{TemplateScoringPanel-BpQgtaDl.js → TemplateScoringPanel-BIwEwFxD.js} +15 -15
  20. package/dist/{TestEmailModal--4EVFj1A.js → TestEmailModal-C8DhylO1.js} +5 -5
  21. package/dist/{TitleEditor-C6z6Jzeg.js → TitleEditor-CgLrn6R3.js} +15 -15
  22. package/dist/{TplModal-D5xlYbls.js → TplModal-CbwRwmR3.js} +4 -4
  23. package/dist/{blockTypeIcons-jZR-IBPY.js → blockTypeIcons-CccKujXP.js} +2 -2
  24. package/dist/bundle-stats.json +6 -6
  25. package/dist/cdn/chunks/{AiFeatureMenu-8gbvVwXD.js → AiFeatureMenu-ChNv7XXj.js} +3 -3
  26. package/dist/cdn/chunks/{AiFeatureMenu-8gbvVwXD.js.map → AiFeatureMenu-ChNv7XXj.js.map} +1 -1
  27. package/dist/cdn/chunks/{BlockIssueBadge-CYoY-wyI.js → BlockIssueBadge-BovmWgok.js} +3 -3
  28. package/dist/cdn/chunks/{BlockIssueBadge-CYoY-wyI.js.map → BlockIssueBadge-BovmWgok.js.map} +1 -1
  29. package/dist/cdn/chunks/{CloudEditor-DGAV0qxk.js → CloudEditor-CHF_P5OL.js} +9 -9
  30. package/dist/cdn/chunks/{CloudEditor-DGAV0qxk.js.map → CloudEditor-CHF_P5OL.js.map} +1 -1
  31. package/dist/cdn/chunks/{CollaboratorBar-BrzkrQJM.js → CollaboratorBar-Bjr5YSh0.js} +5 -5
  32. package/dist/cdn/chunks/{CollaboratorBar-BrzkrQJM.js.map → CollaboratorBar-Bjr5YSh0.js.map} +1 -1
  33. package/dist/cdn/chunks/{CountdownBlock-BSEKrpZY.js → CountdownBlock-KyzvhjMF.js} +4 -4
  34. package/dist/cdn/chunks/{CountdownBlock-BSEKrpZY.js.map → CountdownBlock-KyzvhjMF.js.map} +1 -1
  35. package/dist/cdn/chunks/{CountdownToolbar-DME9toD5.js → CountdownToolbar-bJtMHGYz.js} +5 -5
  36. package/dist/cdn/chunks/{CountdownToolbar-DME9toD5.js.map → CountdownToolbar-bJtMHGYz.js.map} +1 -1
  37. package/dist/cdn/chunks/{IssuesPanel-BqGOXisb.js → IssuesPanel-DFSYTQXy.js} +4 -4
  38. package/dist/cdn/chunks/{IssuesPanel-BqGOXisb.js.map → IssuesPanel-DFSYTQXy.js.map} +1 -1
  39. package/dist/cdn/chunks/{ModuleBrowserModal-Bz2oCRS9.js → ModuleBrowserModal-DS0BGRhZ.js} +6 -6
  40. package/dist/cdn/chunks/{ModuleBrowserModal-Bz2oCRS9.js.map → ModuleBrowserModal-DS0BGRhZ.js.map} +1 -1
  41. package/dist/cdn/chunks/{ModulePreviewCanvas-8i2U3rd6.js → ModulePreviewCanvas-Dwn2cA5a.js} +3 -3
  42. package/dist/cdn/chunks/{ModulePreviewCanvas-8i2U3rd6.js.map → ModulePreviewCanvas-Dwn2cA5a.js.map} +1 -1
  43. package/dist/cdn/chunks/{NumberWithSuffix-C6HZCvvh.js → NumberWithSuffix-BNBeHv0P.js} +4 -4
  44. package/dist/cdn/chunks/{NumberWithSuffix-C6HZCvvh.js.map → NumberWithSuffix-BNBeHv0P.js.map} +1 -1
  45. package/dist/cdn/chunks/{ParagraphEditor-DfKVmv1W.js → ParagraphEditor-C4TrTIOm.js} +21 -21
  46. package/dist/cdn/chunks/ParagraphEditor-C4TrTIOm.js.map +1 -0
  47. package/dist/cdn/chunks/{RichTextEditorContent-B-HY9asd.js → RichTextEditorContent-HNFFL4aK.js} +3 -3
  48. package/dist/cdn/chunks/{RichTextEditorContent-B-HY9asd.js.map → RichTextEditorContent-HNFFL4aK.js.map} +1 -1
  49. package/dist/cdn/chunks/{SaveModuleDialog-BgwBxW_S.js → SaveModuleDialog-CbHqqeID.js} +3 -3
  50. package/dist/cdn/chunks/{SaveModuleDialog-BgwBxW_S.js.map → SaveModuleDialog-CbHqqeID.js.map} +1 -1
  51. package/dist/cdn/chunks/{TitleEditor-C2p3SosJ.js → TitleEditor-gr-eBUq_.js} +12 -12
  52. package/dist/cdn/chunks/TitleEditor-gr-eBUq_.js.map +1 -0
  53. package/dist/cdn/chunks/{blockTypeIcons-Bck6aYVw.js → blockTypeIcons-BUlgu9JL.js} +3 -3
  54. package/dist/cdn/chunks/{blockTypeIcons-Bck6aYVw.js.map → blockTypeIcons-BUlgu9JL.js.map} +1 -1
  55. package/dist/cdn/chunks/{de-RQrZR56a.js → de-CTYXVU9v.js} +1 -1
  56. package/dist/cdn/chunks/{de-RQrZR56a.js.map → de-CTYXVU9v.js.map} +1 -1
  57. package/dist/cdn/chunks/{de-DG1WWVXM.js → de-DFYCT4QU.js} +1 -1
  58. package/dist/cdn/chunks/{de-DG1WWVXM.js.map → de-DFYCT4QU.js.map} +1 -1
  59. package/dist/cdn/chunks/{de-BBEGQDsd.js → de-ED7c5RpG.js} +1 -2
  60. package/dist/cdn/chunks/{de-BBEGQDsd.js.map → de-ED7c5RpG.js.map} +1 -1
  61. package/dist/cdn/chunks/{draggable-CLpL3kf8.js → draggable-BwWMFq33.js} +2 -2
  62. package/dist/cdn/chunks/{draggable-CLpL3kf8.js.map → draggable-BwWMFq33.js.map} +1 -1
  63. package/dist/cdn/chunks/{emojiData-EMFlj6FJ.js → emojiData-6m0DBh7O.js} +1 -1
  64. package/dist/cdn/chunks/{emojiData-EMFlj6FJ.js.map → emojiData-6m0DBh7O.js.map} +1 -1
  65. package/dist/cdn/chunks/{en-Bl1ecfRF.js → en-BtmIaJeb.js} +1 -1
  66. package/dist/cdn/chunks/{en-Bl1ecfRF.js.map → en-BtmIaJeb.js.map} +1 -1
  67. package/dist/cdn/chunks/{en-BE6OV83-.js → en-DE_y1YWU.js} +1 -1
  68. package/dist/cdn/chunks/{en-BE6OV83-.js.map → en-DE_y1YWU.js.map} +1 -1
  69. package/dist/cdn/chunks/{en-CHha-_ta.js → en-ivilDUn0.js} +1 -2
  70. package/dist/cdn/chunks/{en-CHha-_ta.js.map → en-ivilDUn0.js.map} +1 -1
  71. package/dist/cdn/chunks/{extensions-DdH6DxVo.js → extensions-DK_lVs7A.js} +4 -4
  72. package/dist/cdn/chunks/{extensions-DdH6DxVo.js.map → extensions-DK_lVs7A.js.map} +1 -1
  73. package/dist/cdn/chunks/{features-BOcQhi9B.js → features-LiilsBqW.js} +1037 -1004
  74. package/dist/cdn/chunks/features-LiilsBqW.js.map +1 -0
  75. package/dist/cdn/chunks/{icons-BVyDCkxF.js → icons-Bn2SIR30.js} +2 -2
  76. package/dist/cdn/chunks/{icons-BVyDCkxF.js.map → icons-Bn2SIR30.js.map} +1 -1
  77. package/dist/cdn/chunks/{liquid.browser-cpFt-Vmw.js → liquid.browser-rMoPo2t_.js} +1 -1
  78. package/dist/cdn/chunks/{liquid.browser-cpFt-Vmw.js.map → liquid.browser-rMoPo2t_.js.map} +1 -1
  79. package/dist/cdn/chunks/{media-library-CPZI4Yxq.js → media-library-Bb2PavAd.js} +5 -5
  80. package/dist/cdn/chunks/{media-library-CPZI4Yxq.js.map → media-library-Bb2PavAd.js.map} +1 -1
  81. package/dist/cdn/chunks/{pt-BR-CQl2JxRp.js → pt-BR-B2ZvFlRL.js} +1 -1
  82. package/dist/cdn/chunks/{pt-BR-CQl2JxRp.js.map → pt-BR-B2ZvFlRL.js.map} +1 -1
  83. package/dist/cdn/chunks/{pt-BR-CFomv2R8.js → pt-BR-B5tm2iBl.js} +1 -2
  84. package/dist/cdn/chunks/{pt-BR-CFomv2R8.js.map → pt-BR-B5tm2iBl.js.map} +1 -1
  85. package/dist/cdn/chunks/{pt-BR-BYRTP5Ww.js → pt-BR-BibOQm-o.js} +1 -1
  86. package/dist/cdn/chunks/{pt-BR-BYRTP5Ww.js.map → pt-BR-BibOQm-o.js.map} +1 -1
  87. package/dist/cdn/chunks/{pusher-bjpcqCZG.js → pusher-CHo5Cua0.js} +2 -2
  88. package/dist/cdn/chunks/{pusher-bjpcqCZG.js.map → pusher-CHo5Cua0.js.map} +1 -1
  89. package/dist/cdn/chunks/{quality-Cytz80Z5.js → quality-Bpj6kNxR.js} +181 -155
  90. package/dist/cdn/chunks/{quality-Cytz80Z5.js.map → quality-Bpj6kNxR.js.map} +1 -1
  91. package/dist/cdn/chunks/{readableTextColor-DhoK4XiZ.js → readableTextColor-f8Kykfnh.js} +1 -1
  92. package/dist/cdn/chunks/{readableTextColor-DhoK4XiZ.js.map → readableTextColor-f8Kykfnh.js.map} +1 -1
  93. package/dist/cdn/chunks/{renderer-Bsqzjvsr.js → renderer-CYYyu-Di.js} +133 -99
  94. package/dist/cdn/chunks/{renderer-Bsqzjvsr.js.map → renderer-CYYyu-Di.js.map} +1 -1
  95. package/dist/cdn/chunks/{src-BRhJ_W0W.js → src-CQjZnxvw.js} +8 -8
  96. package/dist/cdn/chunks/{src-BRhJ_W0W.js.map → src-CQjZnxvw.js.map} +1 -1
  97. package/dist/cdn/chunks/{styleConstants-DP1VOca8.js → styleConstants-lGobwiLH.js} +1 -1
  98. package/dist/cdn/chunks/{styleConstants-DP1VOca8.js.map → styleConstants-lGobwiLH.js.map} +1 -1
  99. package/dist/cdn/chunks/{styles-MrOGXwzJ.js → styles-5g8XOS68.js} +11 -11
  100. package/dist/cdn/chunks/{styles-MrOGXwzJ.js.map → styles-5g8XOS68.js.map} +1 -1
  101. package/dist/cdn/chunks/{tiptap-BCvhHXDe.js → tiptap-BBbH3IT9.js} +856 -732
  102. package/dist/cdn/chunks/tiptap-BBbH3IT9.js.map +1 -0
  103. package/dist/cdn/editor.css +1 -1
  104. package/dist/cdn/editor.js +13 -13
  105. package/dist/{check-DwVS7v3N.js → check-ChQyfxJ3.js} +1 -1
  106. package/dist/{chevron-down-CytfFjil.js → chevron-down-DJjo0jSV.js} +1 -1
  107. package/dist/{circle-alert-9J8Q4fwU.js → circle-alert-CPH6l3Lc.js} +1 -1
  108. package/dist/{clock-CL2fYWmc.js → clock-DHl_BIkU.js} +1 -1
  109. package/dist/{cloud-DHsOqOnH.js → cloud-VxYMtfXC.js} +2 -2
  110. package/dist/{createLucideIcon-DTECxBv6.js → createLucideIcon-XgXOJ05E.js} +1 -1
  111. package/dist/{de-KFqjrxG3.js → de-ED7c5RpG.js} +0 -1
  112. package/dist/{dist-B5FKze93.js → dist-BDgf2G-V.js} +453 -314
  113. package/dist/{dist-BoGj0ys1.js → dist-BxP6TB0l.js} +2 -2
  114. package/dist/{dist-DpF3BN6Y.js → dist-BzuC8o3y.js} +451 -459
  115. package/dist/{dist-DiYYRj9J.js → dist-C0jo8wtG.js} +2 -2
  116. package/dist/{dist-3RAjjDZq.js → dist-C8wMh_gi.js} +2 -2
  117. package/dist/{dist-DJmnUmW9.js → dist-CIV3Brg-.js} +37 -4
  118. package/dist/{dist-BjSjVZRA.js → dist-CUpJmrjt.js} +2 -2
  119. package/dist/dist-D5lmdi1F.js +5 -0
  120. package/dist/{dist-D8IxYzaU.js → dist-D8C6jIXM.js} +170 -177
  121. package/dist/dist-DILjuzSv.js +5 -0
  122. package/dist/{dist-DPiqL9q5.js → dist-DXaxGLsw.js} +33 -33
  123. package/dist/{dist-qFGe50Kc.js → dist-DYO-w_Jf.js} +2 -2
  124. package/dist/{dist-CkhqaMca.js → dist-HO0vjY5Z.js} +1 -1
  125. package/dist/{dist-DgD8K8y0.js → dist-UK-lbEBc.js} +2 -2
  126. package/dist/{en-CNm94YYD.js → en-ivilDUn0.js} +0 -1
  127. package/dist/{extensions-BTheidN4.js → extensions-DeNHyWwh.js} +29 -29
  128. package/dist/{formatRelativeTime-bvx5sFh5.js → formatRelativeTime-CyDg5cDD.js} +1 -1
  129. package/dist/{image-up-YgXg9o1y.js → image-up-CPBCOMit.js} +1 -1
  130. package/dist/{info-W-213KLD.js → info-DIY9mguM.js} +1 -1
  131. package/dist/{keys-XS_XrjqL.js → keys-B8K7Z7Ef.js} +1 -1
  132. package/dist/{list-checks-BQrZlWzC.js → list-checks-CSCyu3fH.js} +1 -1
  133. package/dist/{loader-circle-BQPHssrF.js → loader-circle-Rz_4vJLH.js} +1 -1
  134. package/dist/{message-circle-iMgHXBeH.js → message-circle-D-umK_MU.js} +1 -1
  135. package/dist/{pt-BR-gxZZAUWp.js → pt-BR-B5tm2iBl.js} +0 -1
  136. package/dist/{refresh-cw-DFozdLYp.js → refresh-cw-CvWF4jfR.js} +1 -1
  137. package/dist/{scan-line-D3NN0Gre.js → scan-line-wanvAFDr.js} +1 -1
  138. package/dist/{send-DBhq0GU2.js → send-BhbhbIFT.js} +1 -1
  139. package/dist/{shield-check-DquM3-E5.js → shield-check-CXPPMWth.js} +1 -1
  140. package/dist/{sparkles-CTGknLJy.js → sparkles-CrUN0KWY.js} +1 -1
  141. package/dist/style.css +1 -1
  142. package/dist/{styles-DfdDKEGV.js → styles-Bgqv7rLA.js} +29 -29
  143. package/dist/templatical-editor.js +13 -13
  144. package/dist/{text-align-end-BPOHCD7K.js → text-align-end-Bkq8oBrD.js} +1 -1
  145. package/dist/{trash-2-VyX2kcG0.js → trash-2-BpY5BCLT.js} +1 -1
  146. package/dist/{triangle-alert-HIqW9Hwv.js → triangle-alert-MwJBKR2e.js} +1 -1
  147. package/dist/{useAliveFlag-t3e0dokQ.js → useAliveFlag-BLyG8L4d.js} +1 -1
  148. package/dist/{useCloudI18n-oETj4WiF.js → useCloudI18n-DFzVgYhJ.js} +2 -2
  149. package/dist/{useEditorCore-YaOoz7QB.js → useEditorCore-CaOVDL_m.js} +20 -20
  150. package/dist/{useI18n-tMHqPsE4.js → useI18n-CBbStVlD.js} +2 -2
  151. package/dist/{useMergeTag-Bv8ASt6n.js → useMergeTag-RWsgUcSh.js} +3 -3
  152. package/dist/usePopoverRoot-62PlZQQ3.js +8 -0
  153. package/dist/{vue.runtime.esm-bundler-xiAB6UTz.js → vue.runtime.esm-bundler-BDSGA5hA.js} +1 -1
  154. package/dist/{x-C1j-AamY.js → x-rcnxRG8Y.js} +1 -1
  155. package/package.json +23 -23
  156. package/dist/cdn/chunks/ParagraphEditor-DfKVmv1W.js.map +0 -1
  157. package/dist/cdn/chunks/TitleEditor-C2p3SosJ.js.map +0 -1
  158. package/dist/cdn/chunks/features-BOcQhi9B.js.map +0 -1
  159. package/dist/cdn/chunks/tiptap-BCvhHXDe.js.map +0 -1
  160. package/dist/dist-BWVK8w_m.js +0 -5
  161. package/dist/dist-UekZXGFH.js +0 -5
  162. package/dist/usePopoverRoot-Bs6kLsI3.js +0 -8
  163. /package/dist/{_plugin-vue_export-helper-B0hnzhyu.js → _plugin-vue_export-helper-B3ysoDQm.js} +0 -0
  164. /package/dist/cdn/chunks/{rolldown-runtime-C266TIVP.js → rolldown-runtime-Dqa2HsxW.js} +0 -0
  165. /package/dist/{de-GOtR9DwW.js → de-CTYXVU9v.js} +0 -0
  166. /package/dist/{emojiData-DrBuvEoP.js → emojiData-6m0DBh7O.js} +0 -0
  167. /package/dist/{en-dFFQVzNn.js → en-BtmIaJeb.js} +0 -0
  168. /package/dist/{liquid.browser-Dc30h4PN.js → liquid.browser-IgQrXHPQ.js} +0 -0
  169. /package/dist/{pt-BR-iOr79aDg.js → pt-BR-B2ZvFlRL.js} +0 -0
  170. /package/dist/{readableTextColor-CXzrEnNb.js → readableTextColor-f8Kykfnh.js} +0 -0
  171. /package/dist/{rolldown-runtime-CAFD8bLK.js → rolldown-runtime-Dy4uBu1J.js} +0 -0
  172. /package/dist/{styleConstants-DkfOPzGu.js → styleConstants-lGobwiLH.js} +0 -0
  173. /package/dist/{timeouts-BSGxjuUF.js → timeouts-Bmi_yePw.js} +0 -0
@@ -1433,7 +1433,7 @@ var Pe = class e {
1433
1433
  ul: !0
1434
1434
  }, Re = 1, ze = 2, Be = 4;
1435
1435
  function Ve(e, t, n) {
1436
- return t == null ? e && e.whitespace == "pre" ? Re | ze : n & ~Be : (t ? Re : 0) | (t === "full" ? ze : 0);
1436
+ return t == null ? e && e.whitespace == "pre" ? 3 : n & -5 : (t ? Re : 0) | (t === "full" ? ze : 0);
1437
1437
  }
1438
1438
  var He = class {
1439
1439
  constructor(e, t, n, r, i, a) {
@@ -1850,10 +1850,10 @@ var ot = 1, st = 2, ct = 4, lt = 8, ut = class {
1850
1850
  return (this.delInfo & lt) > 0;
1851
1851
  }
1852
1852
  get deletedBefore() {
1853
- return (this.delInfo & (ot | ct)) > 0;
1853
+ return (this.delInfo & 5) > 0;
1854
1854
  }
1855
1855
  get deletedAfter() {
1856
- return (this.delInfo & (st | ct)) > 0;
1856
+ return (this.delInfo & 6) > 0;
1857
1857
  }
1858
1858
  get deletedAcross() {
1859
1859
  return (this.delInfo & ct) > 0;
@@ -3239,7 +3239,7 @@ var yn = 1, bn = 2, xn = 4, Sn = class extends ln {
3239
3239
  }
3240
3240
  setSelection(e) {
3241
3241
  if (e.$from.doc != this.doc) throw RangeError("Selection passed to setSelection must point at the current document");
3242
- return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | yn) & ~bn, this.storedMarks = null, this;
3242
+ return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | yn) & -3, this.storedMarks = null, this;
3243
3243
  }
3244
3244
  get selectionSet() {
3245
3245
  return (this.updated & yn) > 0;
@@ -3260,7 +3260,7 @@ var yn = 1, bn = 2, xn = 4, Sn = class extends ln {
3260
3260
  return (this.updated & bn) > 0;
3261
3261
  }
3262
3262
  addStep(e, t) {
3263
- super.addStep(e, t), this.updated &= ~bn, this.storedMarks = null;
3263
+ super.addStep(e, t), this.updated &= -3, this.storedMarks = null;
3264
3264
  }
3265
3265
  setTime(e) {
3266
3266
  return this.time = e, this;
@@ -7237,7 +7237,7 @@ function Gs(e) {
7237
7237
  };
7238
7238
  }
7239
7239
  //#endregion
7240
- //#region ../../node_modules/.pnpm/@tiptap+core@3.23.4_@tiptap+pm@3.23.4/node_modules/@tiptap/core/dist/index.js
7240
+ //#region ../../node_modules/.pnpm/@tiptap+core@3.23.6_@tiptap+pm@3.23.6/node_modules/@tiptap/core/dist/index.js
7241
7241
  var Ks = Object.defineProperty, qs = (e, t) => {
7242
7242
  for (var n in t) Ks(e, n, {
7243
7243
  get: t[n],
@@ -7340,57 +7340,57 @@ qs(Xs, {
7340
7340
  deleteCurrentNode: () => rc,
7341
7341
  deleteNode: () => ic,
7342
7342
  deleteRange: () => ac,
7343
- deleteSelection: () => oc,
7344
- enter: () => sc,
7345
- exitCode: () => cc,
7346
- extendMarkRange: () => mc,
7347
- first: () => hc,
7348
- focus: () => xc,
7349
- forEach: () => Sc,
7350
- insertContent: () => Cc,
7351
- insertContentAt: () => kc,
7352
- joinBackward: () => Mc,
7353
- joinDown: () => jc,
7354
- joinForward: () => Nc,
7355
- joinItemBackward: () => Pc,
7356
- joinItemForward: () => Fc,
7357
- joinTextblockBackward: () => Ic,
7358
- joinTextblockForward: () => Lc,
7359
- joinUp: () => Ac,
7360
- keyboardShortcut: () => Bc,
7361
- lift: () => Hc,
7362
- liftEmptyBlock: () => Uc,
7363
- liftListItem: () => Wc,
7364
- newlineInCode: () => Gc,
7365
- resetAttributes: () => Jc,
7366
- scrollIntoView: () => Yc,
7367
- selectAll: () => Xc,
7368
- selectNodeBackward: () => Zc,
7369
- selectNodeForward: () => Qc,
7370
- selectParentNode: () => $c,
7371
- selectTextblockEnd: () => el,
7372
- selectTextblockStart: () => tl,
7373
- setContent: () => rl,
7374
- setMark: () => lu,
7375
- setMeta: () => uu,
7376
- setNode: () => du,
7377
- setNodeSelection: () => fu,
7378
- setTextDirection: () => pu,
7379
- setTextSelection: () => mu,
7380
- sinkListItem: () => hu,
7381
- splitBlock: () => _u,
7382
- splitListItem: () => vu,
7383
- toggleList: () => Su,
7384
- toggleMark: () => Cu,
7385
- toggleNode: () => wu,
7386
- toggleWrap: () => Tu,
7387
- undoInputRule: () => Eu,
7388
- unsetAllMarks: () => Du,
7389
- unsetMark: () => Ou,
7390
- unsetTextDirection: () => ku,
7391
- updateAttributes: () => Au,
7392
- wrapIn: () => ju,
7393
- wrapInList: () => Mu
7343
+ deleteSelection: () => lc,
7344
+ enter: () => uc,
7345
+ exitCode: () => dc,
7346
+ extendMarkRange: () => _c,
7347
+ first: () => vc,
7348
+ focus: () => wc,
7349
+ forEach: () => Tc,
7350
+ insertContent: () => Ec,
7351
+ insertContentAt: () => Mc,
7352
+ joinBackward: () => Fc,
7353
+ joinDown: () => Pc,
7354
+ joinForward: () => Ic,
7355
+ joinItemBackward: () => Lc,
7356
+ joinItemForward: () => Rc,
7357
+ joinTextblockBackward: () => zc,
7358
+ joinTextblockForward: () => Bc,
7359
+ joinUp: () => Nc,
7360
+ keyboardShortcut: () => Uc,
7361
+ lift: () => Gc,
7362
+ liftEmptyBlock: () => Kc,
7363
+ liftListItem: () => qc,
7364
+ newlineInCode: () => Jc,
7365
+ resetAttributes: () => Zc,
7366
+ scrollIntoView: () => Qc,
7367
+ selectAll: () => $c,
7368
+ selectNodeBackward: () => el,
7369
+ selectNodeForward: () => tl,
7370
+ selectParentNode: () => nl,
7371
+ selectTextblockEnd: () => rl,
7372
+ selectTextblockStart: () => il,
7373
+ setContent: () => ol,
7374
+ setMark: () => fu,
7375
+ setMeta: () => pu,
7376
+ setNode: () => mu,
7377
+ setNodeSelection: () => hu,
7378
+ setTextDirection: () => gu,
7379
+ setTextSelection: () => _u,
7380
+ sinkListItem: () => vu,
7381
+ splitBlock: () => bu,
7382
+ splitListItem: () => xu,
7383
+ toggleList: () => Tu,
7384
+ toggleMark: () => Eu,
7385
+ toggleNode: () => Du,
7386
+ toggleWrap: () => Ou,
7387
+ undoInputRule: () => ku,
7388
+ unsetAllMarks: () => Au,
7389
+ unsetMark: () => ju,
7390
+ unsetTextDirection: () => Mu,
7391
+ updateAttributes: () => Nu,
7392
+ wrapIn: () => Pu,
7393
+ wrapInList: () => Fu
7394
7394
  });
7395
7395
  var Zs = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
7396
7396
  var n;
@@ -7448,21 +7448,33 @@ var ic = (e) => ({ tr: t, state: n, dispatch: r }) => {
7448
7448
  }, ac = (e) => ({ tr: t, dispatch: n }) => {
7449
7449
  let { from: r, to: i } = e;
7450
7450
  return n && t.delete(r, i), !0;
7451
- }, oc = () => ({ state: e, dispatch: t }) => Mn(e, t), sc = () => ({ commands: e }) => e.keyboardShortcut("Enter"), cc = () => ({ state: e, dispatch: t }) => Xn(e, t);
7452
- function lc(e) {
7451
+ }, oc = (e) => e.content ? /^text(\*|\+)/.test(e.content) : !1, sc = (e, t, n) => {
7452
+ if (!e.parent.isInline || n === "left" && e.pos > e.start() || n === "right" && e.pos < e.end()) return e.pos;
7453
+ let r = t.nodes[e.parent.type.name].spec;
7454
+ return oc(r) ? n === "left" ? e.start() - 1 : e.end() + 1 : e.pos;
7455
+ }, cc = (e, t, n) => ({
7456
+ from: sc(e, n, "left"),
7457
+ to: sc(t, n, "right")
7458
+ }), lc = () => ({ state: e, dispatch: t }) => {
7459
+ let { $from: n, $to: r } = e.selection;
7460
+ if (e.selection.empty) return !1;
7461
+ let { from: i, to: a } = cc(n, r, e.schema);
7462
+ return t && (e.tr.deleteRange(i, a).scrollIntoView(), t(e.tr)), !0;
7463
+ }, uc = () => ({ commands: e }) => e.keyboardShortcut("Enter"), dc = () => ({ state: e, dispatch: t }) => Xn(e, t);
7464
+ function fc(e) {
7453
7465
  return Object.prototype.toString.call(e) === "[object RegExp]";
7454
7466
  }
7455
- function uc(e, t, n = { strict: !0 }) {
7467
+ function pc(e, t, n = { strict: !0 }) {
7456
7468
  let r = Object.keys(t);
7457
- return r.length ? r.every((r) => n.strict ? t[r] === e[r] : lc(t[r]) ? t[r].test(e[r]) : t[r] === e[r]) : !0;
7469
+ return r.length ? r.every((r) => n.strict ? t[r] === e[r] : fc(t[r]) ? t[r].test(e[r]) : t[r] === e[r]) : !0;
7458
7470
  }
7459
- function dc(e, t, n = {}) {
7460
- return e.find((e) => e.type === t && uc(Object.fromEntries(Object.keys(n).map((t) => [t, e.attrs[t]])), n));
7471
+ function mc(e, t, n = {}) {
7472
+ return e.find((e) => e.type === t && pc(Object.fromEntries(Object.keys(n).map((t) => [t, e.attrs[t]])), n));
7461
7473
  }
7462
- function fc(e, t, n = {}) {
7463
- return !!dc(e, t, n);
7474
+ function hc(e, t, n = {}) {
7475
+ return !!mc(e, t, n);
7464
7476
  }
7465
- function pc(e, t, n) {
7477
+ function gc(e, t, n) {
7466
7478
  if (!e || !t) return;
7467
7479
  let r = e.parent.childAfter(e.parentOffset);
7468
7480
  if ((!r.node || !r.node.marks.some((e) => e.type === t)) && (r = e.parent.childBefore(e.parentOffset)), !r.node || !r.node.marks.some((e) => e.type === t)) return;
@@ -7470,10 +7482,10 @@ function pc(e, t, n) {
7470
7482
  let e = r.node.marks.find((e) => e.type === t);
7471
7483
  e && (n = e.attrs);
7472
7484
  }
7473
- if (!dc([...r.node.marks], t, n)) return;
7485
+ if (!mc([...r.node.marks], t, n)) return;
7474
7486
  let i = r.index, a = e.start() + r.offset, o = i + 1, s = a + r.node.nodeSize;
7475
- for (; i > 0 && fc([...e.parent.child(i - 1).marks], t, n);) --i, a -= e.parent.child(i).nodeSize;
7476
- for (; o < e.parent.childCount && fc([...e.parent.child(o).marks], t, n);) s += e.parent.child(o).nodeSize, o += 1;
7487
+ for (; i > 0 && hc([...e.parent.child(i - 1).marks], t, n);) --i, a -= e.parent.child(i).nodeSize;
7488
+ for (; o < e.parent.childCount && hc([...e.parent.child(o).marks], t, n);) s += e.parent.child(o).nodeSize, o += 1;
7477
7489
  return {
7478
7490
  from: a,
7479
7491
  to: s
@@ -7486,28 +7498,28 @@ function Y(e, t) {
7486
7498
  }
7487
7499
  return e;
7488
7500
  }
7489
- var mc = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
7501
+ var _c = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
7490
7502
  let a = Y(e, r.schema), { doc: o, selection: s } = n, { $from: c, from: l, to: u } = s;
7491
7503
  if (i) {
7492
- let e = pc(c, a, t);
7504
+ let e = gc(c, a, t);
7493
7505
  if (e && e.from <= l && e.to >= u) {
7494
7506
  let t = k.create(o, e.from, e.to);
7495
7507
  n.setSelection(t);
7496
7508
  }
7497
7509
  }
7498
7510
  return !0;
7499
- }, hc = (e) => (t) => {
7511
+ }, vc = (e) => (t) => {
7500
7512
  let n = typeof e == "function" ? e(t) : e;
7501
7513
  for (let e = 0; e < n.length; e += 1) if (n[e](t)) return !0;
7502
7514
  return !1;
7503
7515
  };
7504
- function gc(e) {
7516
+ function yc(e) {
7505
7517
  return e instanceof k;
7506
7518
  }
7507
7519
  function X(e = 0, t = 0, n = 0) {
7508
7520
  return Math.min(Math.max(e, t), n);
7509
7521
  }
7510
- function _c(e, t = null) {
7522
+ function bc(e, t = null) {
7511
7523
  if (!t) return null;
7512
7524
  let n = O.atStart(e), r = O.atEnd(e);
7513
7525
  if (t === "start" || t === !0) return n;
@@ -7515,10 +7527,10 @@ function _c(e, t = null) {
7515
7527
  let i = n.from, a = r.to;
7516
7528
  return t === "all" ? k.create(e, X(0, i, a), X(e.content.size, i, a)) : k.create(e, X(t, i, a), X(t, i, a));
7517
7529
  }
7518
- function vc() {
7530
+ function xc() {
7519
7531
  return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
7520
7532
  }
7521
- function yc() {
7533
+ function Sc() {
7522
7534
  return [
7523
7535
  "iPad Simulator",
7524
7536
  "iPhone Simulator",
@@ -7528,16 +7540,16 @@ function yc() {
7528
7540
  "iPod"
7529
7541
  ].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
7530
7542
  }
7531
- function bc() {
7543
+ function Cc() {
7532
7544
  return typeof navigator < "u" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : !1;
7533
7545
  }
7534
- var xc = (e = null, t = {}) => ({ editor: n, view: r, tr: i, dispatch: a }) => {
7546
+ var wc = (e = null, t = {}) => ({ editor: n, view: r, tr: i, dispatch: a }) => {
7535
7547
  t = {
7536
7548
  scrollIntoView: !0,
7537
7549
  ...t
7538
7550
  };
7539
7551
  let o = () => {
7540
- (yc() || vc()) && r.dom.focus(), bc() && !yc() && !vc() && r.dom.focus({ preventScroll: !0 }), requestAnimationFrame(() => {
7552
+ (Sc() || xc()) && r.dom.focus(), Cc() && !Sc() && !xc() && r.dom.focus({ preventScroll: !0 }), requestAnimationFrame(() => {
7541
7553
  n.isDestroyed || (r.focus(), t?.scrollIntoView && n.commands.scrollIntoView());
7542
7554
  });
7543
7555
  };
@@ -7546,29 +7558,29 @@ var xc = (e = null, t = {}) => ({ editor: n, view: r, tr: i, dispatch: a }) => {
7546
7558
  } catch {
7547
7559
  return !1;
7548
7560
  }
7549
- if (a && e === null && !gc(n.state.selection)) return o(), !0;
7550
- let s = _c(i.doc, e) || n.state.selection, c = n.state.selection.eq(s);
7561
+ if (a && e === null && !yc(n.state.selection)) return o(), !0;
7562
+ let s = bc(i.doc, e) || n.state.selection, c = n.state.selection.eq(s);
7551
7563
  return a && (c || i.setSelection(s), c && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
7552
- }, Sc = (e, t) => (n) => e.every((e, r) => t(e, {
7564
+ }, Tc = (e, t) => (n) => e.every((e, r) => t(e, {
7553
7565
  ...n,
7554
7566
  index: r
7555
- })), Cc = (e, t) => ({ tr: n, commands: r }) => r.insertContentAt({
7567
+ })), Ec = (e, t) => ({ tr: n, commands: r }) => r.insertContentAt({
7556
7568
  from: n.selection.from,
7557
7569
  to: n.selection.to
7558
- }, e, t), wc = (e) => {
7570
+ }, e, t), Dc = (e) => {
7559
7571
  let t = e.childNodes;
7560
7572
  for (let n = t.length - 1; n >= 0; --n) {
7561
7573
  let r = t[n];
7562
- r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? e.removeChild(r) : r.nodeType === 1 && wc(r);
7574
+ r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? e.removeChild(r) : r.nodeType === 1 && Dc(r);
7563
7575
  }
7564
7576
  return e;
7565
7577
  };
7566
- function Tc(e) {
7578
+ function Oc(e) {
7567
7579
  if (typeof window > "u") throw Error("[tiptap error]: there is no window object available, so this function cannot be used");
7568
7580
  let t = `<body>${e}</body>`, n = new window.DOMParser().parseFromString(t, "text/html").body;
7569
- return wc(n);
7581
+ return Dc(n);
7570
7582
  }
7571
- function Ec(e, t, n) {
7583
+ function kc(e, t, n) {
7572
7584
  if (e instanceof S || e instanceof r) return e;
7573
7585
  n = {
7574
7586
  slice: !0,
@@ -7582,7 +7594,7 @@ function Ec(e, t, n) {
7582
7594
  return n.errorOnInvalidContent && i.check(), i;
7583
7595
  } catch (r) {
7584
7596
  if (n.errorOnInvalidContent) throw Error("[tiptap error]: Invalid JSON content", { cause: r });
7585
- return console.warn("[tiptap warn]: Invalid content.", "Passed value:", e, "Error:", r), Ec("", t, n);
7597
+ return console.warn("[tiptap warn]: Invalid content.", "Passed value:", e, "Error:", r), kc("", t, n);
7586
7598
  }
7587
7599
  if (a) {
7588
7600
  if (n.errorOnInvalidContent) {
@@ -7598,14 +7610,14 @@ function Ec(e, t, n) {
7598
7610
  }]
7599
7611
  } })
7600
7612
  });
7601
- if (n.slice ? Pe.fromSchema(a).parseSlice(Tc(e), n.parseOptions) : Pe.fromSchema(a).parse(Tc(e), n.parseOptions), n.errorOnInvalidContent && r) throw Error("[tiptap error]: Invalid HTML content", { cause: /* @__PURE__ */ Error(`Invalid element found: ${i}`) });
7613
+ if (n.slice ? Pe.fromSchema(a).parseSlice(Oc(e), n.parseOptions) : Pe.fromSchema(a).parse(Oc(e), n.parseOptions), n.errorOnInvalidContent && r) throw Error("[tiptap error]: Invalid HTML content", { cause: /* @__PURE__ */ Error(`Invalid element found: ${i}`) });
7602
7614
  }
7603
7615
  let r = Pe.fromSchema(t);
7604
- return n.slice ? r.parseSlice(Tc(e), n.parseOptions).content : r.parse(Tc(e), n.parseOptions);
7616
+ return n.slice ? r.parseSlice(Oc(e), n.parseOptions).content : r.parse(Oc(e), n.parseOptions);
7605
7617
  }
7606
- return Ec("", t, n);
7618
+ return kc("", t, n);
7607
7619
  }
7608
- function Dc(e, t, n) {
7620
+ function Ac(e, t, n) {
7609
7621
  let r = e.steps.length - 1;
7610
7622
  if (r < t) return;
7611
7623
  let i = e.steps[r];
@@ -7615,7 +7627,7 @@ function Dc(e, t, n) {
7615
7627
  o === 0 && (o = r);
7616
7628
  }), e.setSelection(O.near(e.doc.resolve(o), n));
7617
7629
  }
7618
- var Oc = (e) => !("type" in e), kc = (e, t, n) => ({ tr: i, dispatch: a, editor: o }) => {
7630
+ var jc = (e) => !("type" in e), Mc = (e, t, n) => ({ tr: i, dispatch: a, editor: o }) => {
7619
7631
  if (a) {
7620
7632
  n = {
7621
7633
  parseOptions: o.options.parseOptions,
@@ -7637,7 +7649,7 @@ var Oc = (e) => !("type" in e), kc = (e, t, n) => ({ tr: i, dispatch: a, editor:
7637
7649
  ...n.parseOptions
7638
7650
  };
7639
7651
  if (!n.errorOnInvalidContent && !o.options.enableContentCheck && o.options.emitContentError) try {
7640
- Ec(t, o.schema, {
7652
+ kc(t, o.schema, {
7641
7653
  parseOptions: c,
7642
7654
  errorOnInvalidContent: !0
7643
7655
  });
@@ -7645,7 +7657,7 @@ var Oc = (e) => !("type" in e), kc = (e, t, n) => ({ tr: i, dispatch: a, editor:
7645
7657
  s(e);
7646
7658
  }
7647
7659
  try {
7648
- a = Ec(t, o.schema, {
7660
+ a = kc(t, o.schema, {
7649
7661
  parseOptions: c,
7650
7662
  errorOnInvalidContent: n.errorOnInvalidContent ?? o.options.enableContentCheck
7651
7663
  });
@@ -7659,7 +7671,7 @@ var Oc = (e) => !("type" in e), kc = (e, t, n) => ({ tr: i, dispatch: a, editor:
7659
7671
  from: e.from,
7660
7672
  to: e.to
7661
7673
  }, d = !0, f = !0;
7662
- if ((Oc(a) ? a : [a]).forEach((e) => {
7674
+ if ((jc(a) ? a : [a]).forEach((e) => {
7663
7675
  e.check(), d = d ? e.isText && e.marks.length === 0 : !1, f = f ? e.isBlock : !1;
7664
7676
  }), l === u && f) {
7665
7677
  let { parent: e } = i.doc.resolve(l);
@@ -7680,7 +7692,7 @@ var Oc = (e) => !("type" in e), kc = (e, t, n) => ({ tr: i, dispatch: a, editor:
7680
7692
  let e = i.doc.resolve(l), t = e.node(), n = e.parentOffset === 0, r = t.isText || t.isTextblock, o = t.content.size > 0;
7681
7693
  n && r && o && f && (l = Math.max(0, l - 1)), i.replaceWith(l, u, p);
7682
7694
  }
7683
- n.updateSelection && Dc(i, i.steps.length - 1, -1), n.applyInputRules && i.setMeta("applyInputRules", {
7695
+ n.updateSelection && Ac(i, i.steps.length - 1, -1), n.applyInputRules && i.setMeta("applyInputRules", {
7684
7696
  from: l,
7685
7697
  text: p
7686
7698
  }), n.applyPasteRules && i.setMeta("applyPasteRules", {
@@ -7689,25 +7701,25 @@ var Oc = (e) => !("type" in e), kc = (e, t, n) => ({ tr: i, dispatch: a, editor:
7689
7701
  });
7690
7702
  }
7691
7703
  return !0;
7692
- }, Ac = () => ({ state: e, dispatch: t }) => Gn(e, t), jc = () => ({ state: e, dispatch: t }) => Kn(e, t), Mc = () => ({ state: e, dispatch: t }) => Pn(e, t), Nc = () => ({ state: e, dispatch: t }) => Hn(e, t), Pc = () => ({ state: e, dispatch: t, tr: n }) => {
7704
+ }, Nc = () => ({ state: e, dispatch: t }) => Gn(e, t), Pc = () => ({ state: e, dispatch: t }) => Kn(e, t), Fc = () => ({ state: e, dispatch: t }) => Pn(e, t), Ic = () => ({ state: e, dispatch: t }) => Hn(e, t), Lc = () => ({ state: e, dispatch: t, tr: n }) => {
7693
7705
  try {
7694
7706
  let r = Bt(e.doc, e.selection.$from.pos, -1);
7695
7707
  return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
7696
7708
  } catch {
7697
7709
  return !1;
7698
7710
  }
7699
- }, Fc = () => ({ state: e, dispatch: t, tr: n }) => {
7711
+ }, Rc = () => ({ state: e, dispatch: t, tr: n }) => {
7700
7712
  try {
7701
7713
  let r = Bt(e.doc, e.selection.$from.pos, 1);
7702
7714
  return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
7703
7715
  } catch {
7704
7716
  return !1;
7705
7717
  }
7706
- }, Ic = () => ({ state: e, dispatch: t }) => Fn(e, t), Lc = () => ({ state: e, dispatch: t }) => In(e, t);
7707
- function Rc() {
7718
+ }, zc = () => ({ state: e, dispatch: t }) => Fn(e, t), Bc = () => ({ state: e, dispatch: t }) => In(e, t);
7719
+ function Vc() {
7708
7720
  return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
7709
7721
  }
7710
- function zc(e) {
7722
+ function Hc(e) {
7711
7723
  let t = e.split(/-(?!$)/), n = t[t.length - 1];
7712
7724
  n === "Space" && (n = " ");
7713
7725
  let r, i, a, o;
@@ -7717,13 +7729,13 @@ function zc(e) {
7717
7729
  else if (/^a(lt)?$/i.test(n)) r = !0;
7718
7730
  else if (/^(c|ctrl|control)$/i.test(n)) i = !0;
7719
7731
  else if (/^s(hift)?$/i.test(n)) a = !0;
7720
- else if (/^mod$/i.test(n)) yc() || Rc() ? o = !0 : i = !0;
7732
+ else if (/^mod$/i.test(n)) Sc() || Vc() ? o = !0 : i = !0;
7721
7733
  else throw Error(`Unrecognized modifier name: ${n}`);
7722
7734
  }
7723
7735
  return r && (n = `Alt-${n}`), i && (n = `Ctrl-${n}`), o && (n = `Meta-${n}`), a && (n = `Shift-${n}`), n;
7724
7736
  }
7725
- var Bc = (e) => ({ editor: t, view: n, tr: r, dispatch: i }) => {
7726
- let a = zc(e).split(/-(?!$)/), o = a.find((e) => ![
7737
+ var Uc = (e) => ({ editor: t, view: n, tr: r, dispatch: i }) => {
7738
+ let a = Hc(e).split(/-(?!$)/), o = a.find((e) => ![
7727
7739
  "Alt",
7728
7740
  "Ctrl",
7729
7741
  "Meta",
@@ -7744,7 +7756,7 @@ var Bc = (e) => ({ editor: t, view: n, tr: r, dispatch: i }) => {
7744
7756
  t && i && r.maybeStep(t);
7745
7757
  }), !0;
7746
7758
  };
7747
- function Vc(e, t, n = {}) {
7759
+ function Wc(e, t, n = {}) {
7748
7760
  let { from: r, to: i, empty: a } = e.selection, o = t ? J(t, e.schema) : null, s = [];
7749
7761
  e.doc.nodesBetween(r, i, (e, t) => {
7750
7762
  if (e.isText) return;
@@ -7755,47 +7767,47 @@ function Vc(e, t, n = {}) {
7755
7767
  to: a
7756
7768
  });
7757
7769
  });
7758
- let c = i - r, l = s.filter((e) => o ? o.name === e.node.type.name : !0).filter((e) => uc(e.node.attrs, n, { strict: !1 }));
7770
+ let c = i - r, l = s.filter((e) => o ? o.name === e.node.type.name : !0).filter((e) => pc(e.node.attrs, n, { strict: !1 }));
7759
7771
  return a ? !!l.length : l.reduce((e, t) => e + t.to - t.from, 0) >= c;
7760
7772
  }
7761
- var Hc = (e, t = {}) => ({ state: n, dispatch: r }) => Vc(n, J(e, n.schema), t) ? qn(n, r) : !1, Uc = () => ({ state: e, dispatch: t }) => Qn(e, t), Wc = (e) => ({ state: t, dispatch: n }) => vr(J(e, t.schema))(t, n), Gc = () => ({ state: e, dispatch: t }) => Jn(e, t);
7762
- function Kc(e, t) {
7773
+ var Gc = (e, t = {}) => ({ state: n, dispatch: r }) => Wc(n, J(e, n.schema), t) ? qn(n, r) : !1, Kc = () => ({ state: e, dispatch: t }) => Qn(e, t), qc = (e) => ({ state: t, dispatch: n }) => vr(J(e, t.schema))(t, n), Jc = () => ({ state: e, dispatch: t }) => Jn(e, t);
7774
+ function Yc(e, t) {
7763
7775
  return t.nodes[e] ? "node" : t.marks[e] ? "mark" : null;
7764
7776
  }
7765
- function qc(e, t) {
7777
+ function Xc(e, t) {
7766
7778
  let n = typeof t == "string" ? [t] : t;
7767
7779
  return Object.keys(e).reduce((t, r) => (n.includes(r) || (t[r] = e[r]), t), {});
7768
7780
  }
7769
- var Jc = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
7770
- let a = null, o = null, s = Kc(typeof e == "string" ? e : e.name, r.schema);
7781
+ var Zc = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
7782
+ let a = null, o = null, s = Yc(typeof e == "string" ? e : e.name, r.schema);
7771
7783
  if (!s) return !1;
7772
7784
  s === "node" && (a = J(e, r.schema)), s === "mark" && (o = Y(e, r.schema));
7773
7785
  let c = !1;
7774
7786
  return n.selection.ranges.forEach((e) => {
7775
7787
  r.doc.nodesBetween(e.$from.pos, e.$to.pos, (e, r) => {
7776
- a && a === e.type && (c = !0, i && n.setNodeMarkup(r, void 0, qc(e.attrs, t))), o && e.marks.length && e.marks.forEach((a) => {
7777
- o === a.type && (c = !0, i && n.addMark(r, r + e.nodeSize, o.create(qc(a.attrs, t))));
7788
+ a && a === e.type && (c = !0, i && n.setNodeMarkup(r, void 0, Xc(e.attrs, t))), o && e.marks.length && e.marks.forEach((a) => {
7789
+ o === a.type && (c = !0, i && n.addMark(r, r + e.nodeSize, o.create(Xc(a.attrs, t))));
7778
7790
  });
7779
7791
  });
7780
7792
  }), c;
7781
- }, Yc = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), Xc = () => ({ tr: e, dispatch: t }) => {
7793
+ }, Qc = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), $c = () => ({ tr: e, dispatch: t }) => {
7782
7794
  if (t) {
7783
7795
  let t = new j(e.doc);
7784
7796
  e.setSelection(t);
7785
7797
  }
7786
7798
  return !0;
7787
- }, Zc = () => ({ state: e, dispatch: t }) => zn(e, t), Qc = () => ({ state: e, dispatch: t }) => Un(e, t), $c = () => ({ state: e, dispatch: t }) => tr(e, t), el = () => ({ state: e, dispatch: t }) => sr(e, t), tl = () => ({ state: e, dispatch: t }) => or(e, t);
7788
- function nl(e, t, n = {}, r = {}) {
7789
- return Ec(e, t, {
7799
+ }, el = () => ({ state: e, dispatch: t }) => zn(e, t), tl = () => ({ state: e, dispatch: t }) => Un(e, t), nl = () => ({ state: e, dispatch: t }) => tr(e, t), rl = () => ({ state: e, dispatch: t }) => sr(e, t), il = () => ({ state: e, dispatch: t }) => or(e, t);
7800
+ function al(e, t, n = {}, r = {}) {
7801
+ return kc(e, t, {
7790
7802
  slice: !1,
7791
7803
  parseOptions: n,
7792
7804
  errorOnInvalidContent: r.errorOnInvalidContent
7793
7805
  });
7794
7806
  }
7795
- var rl = (e, { errorOnInvalidContent: t, emitUpdate: n = !0, parseOptions: r = {} } = {}) => ({ editor: i, tr: a, dispatch: o, commands: s }) => {
7807
+ var ol = (e, { errorOnInvalidContent: t, emitUpdate: n = !0, parseOptions: r = {} } = {}) => ({ editor: i, tr: a, dispatch: o, commands: s }) => {
7796
7808
  let { doc: c } = a;
7797
7809
  if (r.preserveWhitespace !== "full") {
7798
- let s = nl(e, i.schema, r, { errorOnInvalidContent: t ?? i.options.enableContentCheck });
7810
+ let s = al(e, i.schema, r, { errorOnInvalidContent: t ?? i.options.enableContentCheck });
7799
7811
  return o && a.replaceWith(0, c.content.size, s).setMeta("preventUpdate", !n), !0;
7800
7812
  }
7801
7813
  return o && a.setMeta("preventUpdate", !n), s.insertContentAt({
@@ -7806,7 +7818,7 @@ var rl = (e, { errorOnInvalidContent: t, emitUpdate: n = !0, parseOptions: r = {
7806
7818
  errorOnInvalidContent: t ?? i.options.enableContentCheck
7807
7819
  });
7808
7820
  };
7809
- function il(e, t) {
7821
+ function sl(e, t) {
7810
7822
  let n = Y(t, e.schema), { from: r, to: i, empty: a } = e.selection, o = [];
7811
7823
  a ? (e.storedMarks && o.push(...e.storedMarks), o.push(...e.selection.$head.marks())) : e.doc.nodesBetween(r, i, (e) => {
7812
7824
  o.push(...e.marks);
@@ -7814,7 +7826,7 @@ function il(e, t) {
7814
7826
  let s = o.find((e) => e.type.name === n.name);
7815
7827
  return s ? { ...s.attrs } : {};
7816
7828
  }
7817
- function al(e, t) {
7829
+ function cl(e, t) {
7818
7830
  let n = new ln(e);
7819
7831
  return t.forEach((e) => {
7820
7832
  e.steps.forEach((e) => {
@@ -7822,14 +7834,14 @@ function al(e, t) {
7822
7834
  });
7823
7835
  }), n;
7824
7836
  }
7825
- function ol(e) {
7837
+ function ll(e) {
7826
7838
  for (let t = 0; t < e.edgeCount; t += 1) {
7827
7839
  let { type: n } = e.edge(t);
7828
7840
  if (n.isTextblock && !n.hasRequiredAttrs()) return n;
7829
7841
  }
7830
7842
  return null;
7831
7843
  }
7832
- function sl(e, t) {
7844
+ function ul(e, t) {
7833
7845
  let n = [];
7834
7846
  return e.descendants((e, r) => {
7835
7847
  t(e) && n.push({
@@ -7838,7 +7850,7 @@ function sl(e, t) {
7838
7850
  });
7839
7851
  }), n;
7840
7852
  }
7841
- function cl(e, t, n) {
7853
+ function dl(e, t, n) {
7842
7854
  let r = [];
7843
7855
  return e.nodesBetween(t.from, t.to, (e, t) => {
7844
7856
  n(e) && r.push({
@@ -7847,7 +7859,7 @@ function cl(e, t, n) {
7847
7859
  });
7848
7860
  }), r;
7849
7861
  }
7850
- function ll(e, t) {
7862
+ function fl(e, t) {
7851
7863
  for (let n = e.depth; n > 0; --n) {
7852
7864
  let r = e.node(n);
7853
7865
  if (t(r)) return {
@@ -7858,8 +7870,8 @@ function ll(e, t) {
7858
7870
  };
7859
7871
  }
7860
7872
  }
7861
- function ul(e) {
7862
- return (t) => ll(t.$from, e);
7873
+ function pl(e) {
7874
+ return (t) => fl(t.$from, e);
7863
7875
  }
7864
7876
  function Z(e, t, n) {
7865
7877
  return e.config[t] === void 0 && e.parent ? Z(e.parent, t, n) : typeof e.config[t] == "function" ? e.config[t].bind({
@@ -7867,38 +7879,38 @@ function Z(e, t, n) {
7867
7879
  parent: e.parent ? Z(e.parent, t, n) : null
7868
7880
  }) : e.config[t];
7869
7881
  }
7870
- function dl(e) {
7882
+ function ml(e) {
7871
7883
  return e.map((e) => {
7872
7884
  let t = Z(e, "addExtensions", {
7873
7885
  name: e.name,
7874
7886
  options: e.options,
7875
7887
  storage: e.storage
7876
7888
  });
7877
- return t ? [e, ...dl(t())] : e;
7889
+ return t ? [e, ...ml(t())] : e;
7878
7890
  }).flat(10);
7879
7891
  }
7880
- function fl(e, t) {
7892
+ function hl(e, t) {
7881
7893
  let n = Je.fromSchema(t).serializeFragment(e), r = document.implementation.createHTMLDocument().createElement("div");
7882
7894
  return r.appendChild(n), r.innerHTML;
7883
7895
  }
7884
- function pl(e) {
7896
+ function gl(e) {
7885
7897
  return typeof e == "function";
7886
7898
  }
7887
7899
  function Q(e, t = void 0, ...n) {
7888
- return pl(e) ? t ? e.bind(t)(...n) : e(...n) : e;
7900
+ return gl(e) ? t ? e.bind(t)(...n) : e(...n) : e;
7889
7901
  }
7890
- function ml(e = {}) {
7902
+ function _l(e = {}) {
7891
7903
  return Object.keys(e).length === 0 && e.constructor === Object;
7892
7904
  }
7893
- function hl(e) {
7905
+ function vl(e) {
7894
7906
  return {
7895
7907
  baseExtensions: e.filter((e) => e.type === "extension"),
7896
7908
  nodeExtensions: e.filter((e) => e.type === "node"),
7897
7909
  markExtensions: e.filter((e) => e.type === "mark")
7898
7910
  };
7899
7911
  }
7900
- function gl(e) {
7901
- let t = [], { nodeExtensions: n, markExtensions: r } = hl(e), i = [...n, ...r], a = {
7912
+ function yl(e) {
7913
+ let t = [], { nodeExtensions: n, markExtensions: r } = vl(e), i = [...n, ...r], a = {
7902
7914
  default: null,
7903
7915
  validate: void 0,
7904
7916
  rendered: !0,
@@ -7950,7 +7962,7 @@ function gl(e) {
7950
7962
  });
7951
7963
  }), t;
7952
7964
  }
7953
- function _l(e) {
7965
+ function bl(e) {
7954
7966
  let t = [], n = "", r = !1, i = !1, a = 0, o = e.length;
7955
7967
  for (let s = 0; s < o; s += 1) {
7956
7968
  let o = e[s];
@@ -7980,8 +7992,8 @@ function _l(e) {
7980
7992
  }
7981
7993
  return n && t.push(n), t;
7982
7994
  }
7983
- function vl(e) {
7984
- let t = [], n = _l(e || ""), r = n.length;
7995
+ function xl(e) {
7996
+ let t = [], n = bl(e || ""), r = n.length;
7985
7997
  for (let e = 0; e < r; e += 1) {
7986
7998
  let r = n[e], i = r.indexOf(":");
7987
7999
  if (i === -1) continue;
@@ -7990,7 +8002,7 @@ function vl(e) {
7990
8002
  }
7991
8003
  return t;
7992
8004
  }
7993
- function yl(...e) {
8005
+ function Sl(...e) {
7994
8006
  return e.filter((e) => !!e).reduce((e, t) => {
7995
8007
  let n = { ...e };
7996
8008
  return Object.entries(t).forEach(([e, t]) => {
@@ -8002,26 +8014,26 @@ function yl(...e) {
8002
8014
  let r = t ? String(t).split(" ") : [], i = n[e] ? n[e].split(" ") : [], a = r.filter((e) => !i.includes(e));
8003
8015
  n[e] = [...i, ...a].join(" ");
8004
8016
  } else if (e === "style") {
8005
- let r = new Map([...vl(n[e]), ...vl(t)]);
8017
+ let r = new Map([...xl(n[e]), ...xl(t)]);
8006
8018
  n[e] = Array.from(r.entries()).map(([e, t]) => `${e}: ${t}`).join("; ");
8007
8019
  } else n[e] = t;
8008
8020
  }), n;
8009
8021
  }, {});
8010
8022
  }
8011
- function bl(e, t) {
8012
- return t.filter((t) => t.type === e.type.name).filter((e) => e.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(e.attrs) || {} : { [t.name]: e.attrs[t.name] }).reduce((e, t) => yl(e, t), {});
8023
+ function Cl(e, t) {
8024
+ return t.filter((t) => t.type === e.type.name).filter((e) => e.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(e.attrs) || {} : { [t.name]: e.attrs[t.name] }).reduce((e, t) => Sl(e, t), {});
8013
8025
  }
8014
- function xl(e) {
8026
+ function wl(e) {
8015
8027
  return typeof e == "string" ? e.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(e) : e === "true" ? !0 : e === "false" ? !1 : e : e;
8016
8028
  }
8017
- function Sl(e, t) {
8029
+ function Tl(e, t) {
8018
8030
  return "style" in e ? e : {
8019
8031
  ...e,
8020
8032
  getAttrs: (n) => {
8021
8033
  let r = e.getAttrs ? e.getAttrs(n) : e.attrs;
8022
8034
  if (r === !1) return !1;
8023
8035
  let i = t.reduce((e, t) => {
8024
- let r = t.attribute.parseHTML ? t.attribute.parseHTML(n) : xl(n.getAttribute(t.name));
8036
+ let r = t.attribute.parseHTML ? t.attribute.parseHTML(n) : wl(n.getAttribute(t.name));
8025
8037
  return r == null ? e : {
8026
8038
  ...e,
8027
8039
  [t.name]: r
@@ -8034,15 +8046,15 @@ function Sl(e, t) {
8034
8046
  }
8035
8047
  };
8036
8048
  }
8037
- function Cl(e) {
8038
- return Object.fromEntries(Object.entries(e).filter(([e, t]) => e === "attrs" && ml(t) ? !1 : t != null));
8049
+ function El(e) {
8050
+ return Object.fromEntries(Object.entries(e).filter(([e, t]) => e === "attrs" && _l(t) ? !1 : t != null));
8039
8051
  }
8040
- function wl(e) {
8052
+ function Dl(e) {
8041
8053
  let t = {};
8042
8054
  return !e?.attribute?.isRequired && "default" in (e?.attribute || {}) && (t.default = e.attribute.default), e?.attribute?.validate !== void 0 && (t.validate = e.attribute.validate), [e.name, t];
8043
8055
  }
8044
- function Tl(e, t) {
8045
- let n = gl(e), { nodeExtensions: r, markExtensions: i } = hl(e);
8056
+ function Ol(e, t) {
8057
+ let n = yl(e), { nodeExtensions: r, markExtensions: i } = vl(e);
8046
8058
  return new Ae({
8047
8059
  topNode: r.find((e) => Z(e, "topNode"))?.name,
8048
8060
  nodes: Object.fromEntries(r.map((r) => {
@@ -8051,7 +8063,7 @@ function Tl(e, t) {
8051
8063
  options: r.options,
8052
8064
  storage: r.storage,
8053
8065
  editor: t
8054
- }, o = Cl({
8066
+ }, o = El({
8055
8067
  ...e.reduce((e, t) => {
8056
8068
  let n = Z(t, "extendNodeSchema", a);
8057
8069
  return {
@@ -8071,13 +8083,13 @@ function Tl(e, t) {
8071
8083
  linebreakReplacement: Q(Z(r, "linebreakReplacement", a)),
8072
8084
  defining: Q(Z(r, "defining", a)),
8073
8085
  isolating: Q(Z(r, "isolating", a)),
8074
- attrs: Object.fromEntries(i.map(wl))
8086
+ attrs: Object.fromEntries(i.map(Dl))
8075
8087
  }), s = Q(Z(r, "parseHTML", a));
8076
- s && (o.parseDOM = s.map((e) => Sl(e, i)));
8088
+ s && (o.parseDOM = s.map((e) => Tl(e, i)));
8077
8089
  let c = Z(r, "renderHTML", a);
8078
8090
  c && (o.toDOM = (e) => c({
8079
8091
  node: e,
8080
- HTMLAttributes: bl(e, i)
8092
+ HTMLAttributes: Cl(e, i)
8081
8093
  }));
8082
8094
  let l = Z(r, "renderText", a);
8083
8095
  return l && (o.toText = l), [r.name, o];
@@ -8088,7 +8100,7 @@ function Tl(e, t) {
8088
8100
  options: r.options,
8089
8101
  storage: r.storage,
8090
8102
  editor: t
8091
- }, o = Cl({
8103
+ }, o = El({
8092
8104
  ...e.reduce((e, t) => {
8093
8105
  let n = Z(t, "extendMarkSchema", a);
8094
8106
  return {
@@ -8101,43 +8113,43 @@ function Tl(e, t) {
8101
8113
  group: Q(Z(r, "group", a)),
8102
8114
  spanning: Q(Z(r, "spanning", a)),
8103
8115
  code: Q(Z(r, "code", a)),
8104
- attrs: Object.fromEntries(i.map(wl))
8116
+ attrs: Object.fromEntries(i.map(Dl))
8105
8117
  }), s = Q(Z(r, "parseHTML", a));
8106
- s && (o.parseDOM = s.map((e) => Sl(e, i)));
8118
+ s && (o.parseDOM = s.map((e) => Tl(e, i)));
8107
8119
  let c = Z(r, "renderHTML", a);
8108
8120
  return c && (o.toDOM = (e) => c({
8109
8121
  mark: e,
8110
- HTMLAttributes: bl(e, i)
8122
+ HTMLAttributes: Cl(e, i)
8111
8123
  })), [r.name, o];
8112
8124
  }))
8113
8125
  });
8114
8126
  }
8115
- function El(e) {
8127
+ function kl(e) {
8116
8128
  let t = e.filter((t, n) => e.indexOf(t) !== n);
8117
8129
  return Array.from(new Set(t));
8118
8130
  }
8119
- function Dl(e) {
8131
+ function Al(e) {
8120
8132
  return e.sort((e, t) => {
8121
8133
  let n = Z(e, "priority") || 100, r = Z(t, "priority") || 100;
8122
8134
  return n > r ? -1 : +(n < r);
8123
8135
  });
8124
8136
  }
8125
- function Ol(e) {
8126
- let t = Dl(dl(e)), n = El(t.map((e) => e.name));
8137
+ function jl(e) {
8138
+ let t = Al(ml(e)), n = kl(t.map((e) => e.name));
8127
8139
  return n.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e) => `'${e}'`).join(", ")}]. This can lead to issues.`), t;
8128
8140
  }
8129
- function kl(e, t) {
8130
- return Tl(Ol(e), t);
8141
+ function Ml(e, t) {
8142
+ return Ol(jl(e), t);
8131
8143
  }
8132
- function Al(e, t) {
8133
- let n = kl(t);
8134
- return fl(S.fromJSON(n, e).content, n);
8144
+ function Nl(e, t) {
8145
+ let n = Ml(t);
8146
+ return hl(S.fromJSON(n, e).content, n);
8135
8147
  }
8136
- function jl(e, t) {
8137
- let n = kl(t), r = Tc(e);
8148
+ function Pl(e, t) {
8149
+ let n = Ml(t), r = Oc(e);
8138
8150
  return Pe.fromSchema(n).parse(r).toJSON();
8139
8151
  }
8140
- function Ml(e, t, n) {
8152
+ function Fl(e, t, n) {
8141
8153
  let { from: r, to: i } = t, { blockSeparator: a = "\n\n", textSerializers: o = {} } = n || {}, s = "";
8142
8154
  return e.nodesBetween(r, i, (e, n, c, l) => {
8143
8155
  e.isBlock && n > r && (s += a);
@@ -8152,26 +8164,26 @@ function Ml(e, t, n) {
8152
8164
  e.isText && (s += (e?.text)?.slice(Math.max(r, n) - n, i - n));
8153
8165
  }), s;
8154
8166
  }
8155
- function Nl(e, t) {
8156
- return Ml(e, {
8167
+ function Il(e, t) {
8168
+ return Fl(e, {
8157
8169
  from: 0,
8158
8170
  to: e.content.size
8159
8171
  }, t);
8160
8172
  }
8161
- function Pl(e) {
8173
+ function Ll(e) {
8162
8174
  return Object.fromEntries(Object.entries(e.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText]));
8163
8175
  }
8164
- function Fl(e, t, n) {
8165
- let { blockSeparator: r = "\n\n", textSerializers: i = {} } = n || {}, a = kl(t);
8166
- return Nl(S.fromJSON(a, e), {
8176
+ function Rl(e, t, n) {
8177
+ let { blockSeparator: r = "\n\n", textSerializers: i = {} } = n || {}, a = Ml(t);
8178
+ return Il(S.fromJSON(a, e), {
8167
8179
  blockSeparator: r,
8168
8180
  textSerializers: {
8169
- ...Pl(a),
8181
+ ...Ll(a),
8170
8182
  ...i
8171
8183
  }
8172
8184
  });
8173
8185
  }
8174
- function Il(e, t) {
8186
+ function zl(e, t) {
8175
8187
  let n = J(t, e.schema), { from: r, to: i } = e.selection, a = [];
8176
8188
  e.doc.nodesBetween(r, i, (e) => {
8177
8189
  a.push(e);
@@ -8179,22 +8191,22 @@ function Il(e, t) {
8179
8191
  let o = a.reverse().find((e) => e.type.name === n.name);
8180
8192
  return o ? { ...o.attrs } : {};
8181
8193
  }
8182
- function Ll(e, t) {
8183
- let n = Kc(typeof t == "string" ? t : t.name, e.schema);
8184
- return n === "node" ? Il(e, t) : n === "mark" ? il(e, t) : {};
8194
+ function Bl(e, t) {
8195
+ let n = Yc(typeof t == "string" ? t : t.name, e.schema);
8196
+ return n === "node" ? zl(e, t) : n === "mark" ? sl(e, t) : {};
8185
8197
  }
8186
- function Rl(e, t = JSON.stringify) {
8198
+ function Vl(e, t = JSON.stringify) {
8187
8199
  let n = {};
8188
8200
  return e.filter((e) => {
8189
8201
  let r = t(e);
8190
8202
  return Object.prototype.hasOwnProperty.call(n, r) ? !1 : n[r] = !0;
8191
8203
  });
8192
8204
  }
8193
- function zl(e) {
8194
- let t = Rl(e);
8205
+ function Hl(e) {
8206
+ let t = Vl(e);
8195
8207
  return t.length === 1 ? t : t.filter((e, n) => !t.filter((e, t) => t !== n).some((t) => e.oldRange.from >= t.oldRange.from && e.oldRange.to <= t.oldRange.to && e.newRange.from >= t.newRange.from && e.newRange.to <= t.newRange.to));
8196
8208
  }
8197
- function Bl(e) {
8209
+ function Ul(e) {
8198
8210
  let { mapping: t, steps: n } = e, r = [];
8199
8211
  return t.maps.forEach((e, i) => {
8200
8212
  let a = [];
@@ -8225,9 +8237,9 @@ function Bl(e) {
8225
8237
  }
8226
8238
  });
8227
8239
  });
8228
- }), zl(r);
8240
+ }), Hl(r);
8229
8241
  }
8230
- function Vl(e, t = 0) {
8242
+ function Wl(e, t = 0) {
8231
8243
  let n = e.type === e.type.schema.topNodeType ? 0 : 1, r = t, i = r + e.nodeSize, a = e.marks.map((e) => {
8232
8244
  let t = { type: e.type.name };
8233
8245
  return Object.keys(e.attrs).length && (t.attrs = { ...e.attrs }), t;
@@ -8238,13 +8250,13 @@ function Vl(e, t = 0) {
8238
8250
  };
8239
8251
  return Object.keys(o).length && (s.attrs = o), a.length && (s.marks = a), e.content.childCount && (s.content = [], e.forEach((e, r) => {
8240
8252
  var i;
8241
- (i = s.content) == null || i.push(Vl(e, t + r + n));
8253
+ (i = s.content) == null || i.push(Wl(e, t + r + n));
8242
8254
  })), e.text && (s.text = e.text), s;
8243
8255
  }
8244
- function Hl(e, t, n) {
8256
+ function Gl(e, t, n) {
8245
8257
  let r = [];
8246
8258
  return e === t ? n.resolve(e).marks().forEach((t) => {
8247
- let i = pc(n.resolve(e), t.type);
8259
+ let i = gc(n.resolve(e), t.type);
8248
8260
  i && r.push({
8249
8261
  mark: t,
8250
8262
  ...i
@@ -8257,7 +8269,7 @@ function Hl(e, t, n) {
8257
8269
  })));
8258
8270
  }), r;
8259
8271
  }
8260
- var Ul = (e, t, n, r = 20) => {
8272
+ var Kl = (e, t, n, r = 20) => {
8261
8273
  let i = e.doc.resolve(n), a = r, o = null;
8262
8274
  for (; a > 0 && o === null;) {
8263
8275
  let e = i.node(a);
@@ -8265,16 +8277,16 @@ var Ul = (e, t, n, r = 20) => {
8265
8277
  }
8266
8278
  return [o, a];
8267
8279
  };
8268
- function Wl(e, t) {
8280
+ function ql(e, t) {
8269
8281
  return t.nodes[e] || t.marks[e] || null;
8270
8282
  }
8271
- function Gl(e, t, n) {
8283
+ function Jl(e, t, n) {
8272
8284
  return Object.fromEntries(Object.entries(n).filter(([n]) => {
8273
8285
  let r = e.find((e) => e.type === t && e.name === n);
8274
8286
  return r ? r.attribute.keepOnSplit : !1;
8275
8287
  }));
8276
8288
  }
8277
- var Kl = (e, t = 500) => {
8289
+ var Yl = (e, t = 500) => {
8278
8290
  let n = "", r = e.parentOffset;
8279
8291
  return e.parent.nodesBetween(Math.max(0, r - t), r, (e, t, i, a) => {
8280
8292
  var o;
@@ -8287,9 +8299,9 @@ var Kl = (e, t = 500) => {
8287
8299
  n += e.isAtom && !e.isText ? s : s.slice(0, Math.max(0, r - t));
8288
8300
  }), n;
8289
8301
  };
8290
- function ql(e, t, n = {}) {
8302
+ function Xl(e, t, n = {}) {
8291
8303
  let { empty: r, ranges: i } = e.selection, a = t ? Y(t, e.schema) : null;
8292
- if (r) return !!(e.storedMarks || e.selection.$from.marks()).filter((e) => a ? a.name === e.type.name : !0).find((e) => uc(e.attrs, n, { strict: !1 }));
8304
+ if (r) return !!(e.storedMarks || e.selection.$from.marks()).filter((e) => a ? a.name === e.type.name : !0).find((e) => pc(e.attrs, n, { strict: !1 }));
8293
8305
  let o = 0, s = [];
8294
8306
  if (i.forEach(({ $from: t, $to: n }) => {
8295
8307
  let r = t.pos, i = n.pos;
@@ -8304,32 +8316,32 @@ function ql(e, t, n = {}) {
8304
8316
  })));
8305
8317
  });
8306
8318
  }), o === 0) return !1;
8307
- let c = s.filter((e) => a ? a.name === e.mark.type.name : !0).filter((e) => uc(e.mark.attrs, n, { strict: !1 })).reduce((e, t) => e + t.to - t.from, 0), l = s.filter((e) => a ? e.mark.type !== a && e.mark.type.excludes(a) : !0).reduce((e, t) => e + t.to - t.from, 0);
8319
+ let c = s.filter((e) => a ? a.name === e.mark.type.name : !0).filter((e) => pc(e.mark.attrs, n, { strict: !1 })).reduce((e, t) => e + t.to - t.from, 0), l = s.filter((e) => a ? e.mark.type !== a && e.mark.type.excludes(a) : !0).reduce((e, t) => e + t.to - t.from, 0);
8308
8320
  return (c > 0 ? c + l : c) >= o;
8309
8321
  }
8310
- function Jl(e, t, n = {}) {
8311
- if (!t) return Vc(e, null, n) || ql(e, null, n);
8312
- let r = Kc(t, e.schema);
8313
- return r === "node" ? Vc(e, t, n) : r === "mark" ? ql(e, t, n) : !1;
8322
+ function Zl(e, t, n = {}) {
8323
+ if (!t) return Wc(e, null, n) || Xl(e, null, n);
8324
+ let r = Yc(t, e.schema);
8325
+ return r === "node" ? Wc(e, t, n) : r === "mark" ? Xl(e, t, n) : !1;
8314
8326
  }
8315
- var Yl = (e, t) => {
8327
+ var Ql = (e, t) => {
8316
8328
  let { $from: n, $to: r, $anchor: i } = e.selection;
8317
8329
  if (t) {
8318
- let n = ul((e) => e.type.name === t)(e.selection);
8330
+ let n = pl((e) => e.type.name === t)(e.selection);
8319
8331
  if (!n) return !1;
8320
8332
  let r = e.doc.resolve(n.pos + 1);
8321
8333
  return i.pos + 1 === r.end();
8322
8334
  }
8323
8335
  return !(r.parentOffset < r.parent.nodeSize - 2 || n.pos !== r.pos);
8324
- }, Xl = (e) => {
8336
+ }, $l = (e) => {
8325
8337
  let { $from: t, $to: n } = e.selection;
8326
8338
  return !(t.parentOffset > 0 || t.pos !== n.pos);
8327
8339
  };
8328
- function Zl(e, t) {
8340
+ function eu(e, t) {
8329
8341
  return Array.isArray(t) ? t.some((t) => (typeof t == "string" ? t : t.name) === e.name) : t;
8330
8342
  }
8331
- function Ql(e, t) {
8332
- let { nodeExtensions: n } = hl(t), r = n.find((t) => t.name === e);
8343
+ function tu(e, t) {
8344
+ let { nodeExtensions: n } = vl(t), r = n.find((t) => t.name === e);
8333
8345
  if (!r) return !1;
8334
8346
  let i = Q(Z(r, "group", {
8335
8347
  name: r.name,
@@ -8338,7 +8350,7 @@ function Ql(e, t) {
8338
8350
  }));
8339
8351
  return typeof i == "string" ? i.split(" ").includes("list") : !1;
8340
8352
  }
8341
- function $l(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
8353
+ function nu(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
8342
8354
  if (n) {
8343
8355
  if (e.type.name === "hardBreak") return !0;
8344
8356
  if (e.isText) return !/\S/.test(e.text ?? "");
@@ -8349,7 +8361,7 @@ function $l(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
8349
8361
  if (t) {
8350
8362
  let r = !0;
8351
8363
  return e.content.forEach((e) => {
8352
- r !== !1 && ($l(e, {
8364
+ r !== !1 && (nu(e, {
8353
8365
  ignoreWhitespace: n,
8354
8366
  checkChildren: t
8355
8367
  }) || (r = !1));
@@ -8357,14 +8369,14 @@ function $l(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
8357
8369
  }
8358
8370
  return !1;
8359
8371
  }
8360
- function eu(e) {
8372
+ function ru(e) {
8361
8373
  return e instanceof A;
8362
8374
  }
8363
- function tu({ selection: e, pos: t, nodeSize: n, selectedOnTextSelection: r = !1 }) {
8375
+ function iu({ selection: e, pos: t, nodeSize: n, selectedOnTextSelection: r = !1 }) {
8364
8376
  let { from: i, to: a } = e;
8365
- return !!(i <= t && a >= t + n || r && gc(e) && i > t && a < t + n);
8377
+ return !!(i <= t && a >= t + n || r && yc(e) && i > t && a < t + n);
8366
8378
  }
8367
- var nu = class e {
8379
+ var au = class e {
8368
8380
  constructor(e) {
8369
8381
  this.position = e;
8370
8382
  }
@@ -8375,17 +8387,17 @@ var nu = class e {
8375
8387
  return { position: this.position };
8376
8388
  }
8377
8389
  };
8378
- function ru(e, t) {
8390
+ function ou(e, t) {
8379
8391
  let n = t.mapping.mapResult(e.position);
8380
8392
  return {
8381
- position: new nu(n.pos),
8393
+ position: new au(n.pos),
8382
8394
  mapResult: n
8383
8395
  };
8384
8396
  }
8385
- function iu(e) {
8386
- return new nu(e);
8397
+ function su(e) {
8398
+ return new au(e);
8387
8399
  }
8388
- function au(e, t, n) {
8400
+ function cu(e, t, n) {
8389
8401
  let r = e.state.doc.content.size, i = X(t, 0, r), a = X(n, 0, r), o = e.coordsAtPos(i), s = e.coordsAtPos(a, -1), c = Math.min(o.top, s.top), l = Math.max(o.bottom, s.bottom), u = Math.min(o.left, s.left), d = Math.max(o.right, s.right), f = {
8390
8402
  top: c,
8391
8403
  bottom: l,
@@ -8401,14 +8413,14 @@ function au(e, t, n) {
8401
8413
  toJSON: () => f
8402
8414
  };
8403
8415
  }
8404
- function ou({ json: e, validMarks: t, validNodes: n, options: r, rewrittenContent: i = [] }) {
8416
+ function lu({ json: e, validMarks: t, validNodes: n, options: r, rewrittenContent: i = [] }) {
8405
8417
  return e.marks && Array.isArray(e.marks) && (e.marks = e.marks.filter((e) => {
8406
8418
  let n = typeof e == "string" ? e : e.type;
8407
8419
  return t.has(n) ? !0 : (i.push({
8408
8420
  original: JSON.parse(JSON.stringify(e)),
8409
8421
  unsupported: n
8410
8422
  }), !1);
8411
- })), e.content && Array.isArray(e.content) && (e.content = e.content.map((e) => ou({
8423
+ })), e.content && Array.isArray(e.content) && (e.content = e.content.map((e) => lu({
8412
8424
  json: e,
8413
8425
  validMarks: t,
8414
8426
  validNodes: n,
@@ -8428,17 +8440,17 @@ function ou({ json: e, validMarks: t, validNodes: n, options: r, rewrittenConten
8428
8440
  rewrittenContent: i
8429
8441
  };
8430
8442
  }
8431
- function su(e, t, n) {
8432
- return ou({
8443
+ function uu(e, t, n) {
8444
+ return lu({
8433
8445
  json: e,
8434
8446
  validNodes: new Set(Object.keys(t.nodes)),
8435
8447
  validMarks: new Set(Object.keys(t.marks)),
8436
8448
  options: n
8437
8449
  });
8438
8450
  }
8439
- function cu(e, t, n) {
8451
+ function du(e, t, n) {
8440
8452
  let { selection: r } = t, i = null;
8441
- if (gc(r) && (i = r.$cursor), i) {
8453
+ if (yc(r) && (i = r.$cursor), i) {
8442
8454
  let t = e.storedMarks ?? i.marks();
8443
8455
  return i.parent.type.allowsMarkType(n) && (!!n.isInSet(t) || !t.some((e) => e.type.excludes(n)));
8444
8456
  }
@@ -8455,10 +8467,10 @@ function cu(e, t, n) {
8455
8467
  }), i;
8456
8468
  });
8457
8469
  }
8458
- var lu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
8470
+ var fu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
8459
8471
  let { selection: a } = n, { empty: o, ranges: s } = a, c = Y(e, r.schema);
8460
8472
  if (i) if (o) {
8461
- let e = il(r, c);
8473
+ let e = sl(r, c);
8462
8474
  n.addStoredMark(c.create({
8463
8475
  ...e,
8464
8476
  ...t
@@ -8475,8 +8487,8 @@ var lu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
8475
8487
  }) : n.addMark(o, s, c.create(t));
8476
8488
  });
8477
8489
  });
8478
- return cu(r, n, c);
8479
- }, uu = (e, t) => ({ tr: n }) => (n.setMeta(e, t), !0), du = (e, t = {}) => ({ state: n, dispatch: r, chain: i }) => {
8490
+ return du(r, n, c);
8491
+ }, pu = (e, t) => ({ tr: n }) => (n.setMeta(e, t), !0), mu = (e, t = {}) => ({ state: n, dispatch: r, chain: i }) => {
8480
8492
  let a = J(e, n.schema), o;
8481
8493
  return n.selection.$anchor.sameParent(n.selection.$head) && (o = n.selection.$anchor.parent.attrs), a.isTextblock ? i().command(({ commands: e }) => lr(a, {
8482
8494
  ...o,
@@ -8485,13 +8497,13 @@ var lu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
8485
8497
  ...o,
8486
8498
  ...t
8487
8499
  })(e, r)).run() : (console.warn("[tiptap warn]: Currently \"setNode()\" only supports text block nodes."), !1);
8488
- }, fu = (e) => ({ tr: t, dispatch: n }) => {
8500
+ }, hu = (e) => ({ tr: t, dispatch: n }) => {
8489
8501
  if (n) {
8490
8502
  let { doc: n } = t, r = X(e, 0, n.content.size), i = A.create(n, r);
8491
8503
  t.setSelection(i);
8492
8504
  }
8493
8505
  return !0;
8494
- }, pu = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
8506
+ }, gu = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
8495
8507
  let { selection: a } = r, o, s;
8496
8508
  return typeof t == "number" ? (o = t, s = t) : t && "from" in t && "to" in t ? (o = t.from, s = t.to) : (o = a.from, s = a.to), i && n.doc.nodesBetween(o, s, (t, r) => {
8497
8509
  t.isText || n.setNodeMarkup(r, void 0, {
@@ -8499,7 +8511,7 @@ var lu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
8499
8511
  dir: e
8500
8512
  });
8501
8513
  }), !0;
8502
- }, mu = (e) => ({ tr: t, dispatch: n }) => {
8514
+ }, _u = (e) => ({ tr: t, dispatch: n }) => {
8503
8515
  if (n) {
8504
8516
  let { doc: n } = t, { from: r, to: i } = typeof e == "number" ? {
8505
8517
  from: e,
@@ -8508,19 +8520,19 @@ var lu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
8508
8520
  t.setSelection(l);
8509
8521
  }
8510
8522
  return !0;
8511
- }, hu = (e) => ({ state: t, dispatch: n }) => xr(J(e, t.schema))(t, n);
8512
- function gu(e, t) {
8523
+ }, vu = (e) => ({ state: t, dispatch: n }) => xr(J(e, t.schema))(t, n);
8524
+ function yu(e, t) {
8513
8525
  let n = e.storedMarks || e.selection.$to.parentOffset && e.selection.$from.marks();
8514
8526
  if (n) {
8515
8527
  let r = n.filter((e) => t?.includes(e.type.name));
8516
8528
  e.tr.ensureMarks(r);
8517
8529
  }
8518
8530
  }
8519
- var _u = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor: i }) => {
8520
- let { selection: a, doc: o } = t, { $from: s, $to: c } = a, l = i.extensionManager.attributes, u = Gl(l, s.node().type.name, s.node().attrs);
8521
- if (a instanceof A && a.node.isBlock) return !s.parentOffset || !D(o, s.pos) ? !1 : (r && (e && gu(n, i.extensionManager.splittableMarks), t.split(s.pos).scrollIntoView()), !0);
8531
+ var bu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor: i }) => {
8532
+ let { selection: a, doc: o } = t, { $from: s, $to: c } = a, l = i.extensionManager.attributes, u = Jl(l, s.node().type.name, s.node().attrs);
8533
+ if (a instanceof A && a.node.isBlock) return !s.parentOffset || !D(o, s.pos) ? !1 : (r && (e && yu(n, i.extensionManager.splittableMarks), t.split(s.pos).scrollIntoView()), !0);
8522
8534
  if (!s.parent.isBlock) return !1;
8523
- let d = c.parentOffset === c.parent.content.size, f = s.depth === 0 ? void 0 : ol(s.node(-1).contentMatchAt(s.indexAfter(-1))), p = d && f ? [{
8535
+ let d = c.parentOffset === c.parent.content.size, f = s.depth === 0 ? void 0 : ll(s.node(-1).contentMatchAt(s.indexAfter(-1))), p = d && f ? [{
8524
8536
  type: f,
8525
8537
  attrs: u
8526
8538
  }] : void 0, m = D(t.doc, t.mapping.map(s.pos), 1, p);
@@ -8532,10 +8544,10 @@ var _u = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
8532
8544
  let e = t.mapping.map(s.before()), n = t.doc.resolve(e);
8533
8545
  s.node(-1).canReplaceWith(n.index(), n.index() + 1, f) && t.setNodeMarkup(t.mapping.map(s.before()), f);
8534
8546
  }
8535
- e && gu(n, i.extensionManager.splittableMarks), t.scrollIntoView();
8547
+ e && yu(n, i.extensionManager.splittableMarks), t.scrollIntoView();
8536
8548
  }
8537
8549
  return m;
8538
- }, vu = (e, t = {}) => ({ tr: n, state: i, dispatch: a, editor: o }) => {
8550
+ }, xu = (e, t = {}) => ({ tr: n, state: i, dispatch: a, editor: o }) => {
8539
8551
  let s = J(e, i.schema), { $from: c, $to: u } = i.selection, d = i.selection.node;
8540
8552
  if (d && d.isBlock || c.depth < 2 || !c.sameParent(u)) return !1;
8541
8553
  let f = c.node(-1);
@@ -8547,7 +8559,7 @@ var _u = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
8547
8559
  let e = r.empty, i = c.index(-1) ? 1 : c.index(-2) ? 2 : 3;
8548
8560
  for (let t = c.depth - i; t >= c.depth - 3; --t) e = r.from(c.node(t).copy(e));
8549
8561
  let a = c.indexAfter(-1) < c.node(-2).childCount ? 1 : c.indexAfter(-2) < c.node(-3).childCount ? 2 : 3, o = {
8550
- ...Gl(p, c.node().type.name, c.node().attrs),
8562
+ ...Jl(p, c.node().type.name, c.node().attrs),
8551
8563
  ...t
8552
8564
  }, u = s.contentMatch.defaultType?.createAndFill(o) || void 0;
8553
8565
  e = e.append(r.from(s.createAndFill(null, u) || void 0));
@@ -8562,10 +8574,10 @@ var _u = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
8562
8574
  return !0;
8563
8575
  }
8564
8576
  let m = u.pos === c.end() ? f.contentMatchAt(0).defaultType : null, h = {
8565
- ...Gl(p, f.type.name, f.attrs),
8577
+ ...Jl(p, f.type.name, f.attrs),
8566
8578
  ...t
8567
8579
  }, g = {
8568
- ...Gl(p, c.node().type.name, c.node().attrs),
8580
+ ...Jl(p, c.node().type.name, c.node().attrs),
8569
8581
  ...t
8570
8582
  };
8571
8583
  n.delete(c.pos, u.pos);
@@ -8587,59 +8599,59 @@ var _u = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
8587
8599
  n.ensureMarks(l);
8588
8600
  }
8589
8601
  return !0;
8590
- }, yu = (e, t) => {
8591
- let n = ul((e) => e.type === t)(e.selection);
8602
+ }, Su = (e, t) => {
8603
+ let n = pl((e) => e.type === t)(e.selection);
8592
8604
  if (!n) return !0;
8593
8605
  let r = e.doc.resolve(Math.max(0, n.pos - 1)).before(n.depth);
8594
8606
  if (r === void 0) return !0;
8595
8607
  let i = e.doc.nodeAt(r);
8596
8608
  return n.node.type === i?.type && Lt(e.doc, n.pos) && e.join(n.pos), !0;
8597
- }, bu = (e, t) => {
8598
- let n = ul((e) => e.type === t)(e.selection);
8609
+ }, Cu = (e, t) => {
8610
+ let n = pl((e) => e.type === t)(e.selection);
8599
8611
  if (!n) return !0;
8600
8612
  let r = e.doc.resolve(n.start).after(n.depth);
8601
8613
  if (r === void 0) return !0;
8602
8614
  let i = e.doc.nodeAt(r);
8603
8615
  return n.node.type === i?.type && Lt(e.doc, r) && e.join(r), !0;
8604
8616
  };
8605
- function xu(e) {
8617
+ function wu(e) {
8606
8618
  let t = e.doc, n = t.firstChild;
8607
8619
  if (!n) return null;
8608
8620
  let r = t.resolve(1), i = t.resolve(n.nodeSize - 1);
8609
8621
  return k.between(r, i);
8610
8622
  }
8611
- var Su = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain: c, commands: l, can: u }) => {
8623
+ var Tu = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain: c, commands: l, can: u }) => {
8612
8624
  let { extensions: d, splittableMarks: f } = i.extensionManager, p = J(e, o.schema), m = J(t, o.schema), { selection: h, storedMarks: g } = o, { $from: _, $to: v } = h, y = _.blockRange(v), b = g || h.$to.parentOffset && h.$from.marks();
8613
8625
  if (!y) return !1;
8614
- let ee = ul((e) => Ql(e.type.name, d))(h), te = h.from === 0 && h.to === o.doc.content.size, ne = o.doc.content.content, re = ne.length === 1 ? ne[0] : null, ie = te && re && Ql(re.type.name, d) ? {
8626
+ let ee = pl((e) => tu(e.type.name, d))(h), te = h.from === 0 && h.to === o.doc.content.size, ne = o.doc.content.content, re = ne.length === 1 ? ne[0] : null, ie = te && re && tu(re.type.name, d) ? {
8615
8627
  node: re,
8616
8628
  pos: 0,
8617
8629
  depth: 0
8618
8630
  } : null, x = ee ?? ie, ae = !!ee && y.depth >= 1 && y.depth - ee.depth <= 1, S = !!ie;
8619
8631
  if ((ae || S) && x) {
8620
8632
  if (x.node.type === p) return te && S ? c().command(({ tr: e, dispatch: t }) => {
8621
- let n = xu(e);
8633
+ let n = wu(e);
8622
8634
  return n ? (e.setSelection(n), t && t(e), !0) : !1;
8623
8635
  }).liftListItem(m).run() : l.liftListItem(m);
8624
- if (Ql(x.node.type.name, d) && p.validContent(x.node.content)) return c().command(() => (a.setNodeMarkup(x.pos, p), !0)).command(() => yu(a, p)).command(() => bu(a, p)).run();
8636
+ if (tu(x.node.type.name, d) && p.validContent(x.node.content)) return c().command(() => (a.setNodeMarkup(x.pos, p), !0)).command(() => Su(a, p)).command(() => Cu(a, p)).run();
8625
8637
  }
8626
- return !n || !b || !s ? c().command(() => u().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() => yu(a, p)).command(() => bu(a, p)).run() : c().command(() => {
8638
+ return !n || !b || !s ? c().command(() => u().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() => Su(a, p)).command(() => Cu(a, p)).run() : c().command(() => {
8627
8639
  let e = u().wrapInList(p, r), t = b.filter((e) => f.includes(e.type.name));
8628
8640
  return a.ensureMarks(t), e ? !0 : l.clearNodes();
8629
- }).wrapInList(p, r).command(() => yu(a, p)).command(() => bu(a, p)).run();
8630
- }, Cu = (e, t = {}, n = {}) => ({ state: r, commands: i }) => {
8641
+ }).wrapInList(p, r).command(() => Su(a, p)).command(() => Cu(a, p)).run();
8642
+ }, Eu = (e, t = {}, n = {}) => ({ state: r, commands: i }) => {
8631
8643
  let { extendEmptyMarkRange: a = !1 } = n, o = Y(e, r.schema);
8632
- return ql(r, o, t) ? i.unsetMark(o, { extendEmptyMarkRange: a }) : i.setMark(o, t);
8633
- }, wu = (e, t, n = {}) => ({ state: r, commands: i }) => {
8634
- let a = J(e, r.schema), o = J(t, r.schema), s = Vc(r, a, n), c;
8644
+ return Xl(r, o, t) ? i.unsetMark(o, { extendEmptyMarkRange: a }) : i.setMark(o, t);
8645
+ }, Du = (e, t, n = {}) => ({ state: r, commands: i }) => {
8646
+ let a = J(e, r.schema), o = J(t, r.schema), s = Wc(r, a, n), c;
8635
8647
  return r.selection.$anchor.sameParent(r.selection.$head) && (c = r.selection.$anchor.parent.attrs), s ? i.setNode(o, c) : i.setNode(a, {
8636
8648
  ...c,
8637
8649
  ...n
8638
8650
  });
8639
- }, Tu = (e, t = {}) => ({ state: n, commands: r }) => {
8651
+ }, Ou = (e, t = {}) => ({ state: n, commands: r }) => {
8640
8652
  let i = J(e, n.schema);
8641
- return Vc(n, i, t) ? r.lift(i) : r.wrapIn(i, t);
8642
- }, Eu = () => ({ state: e, dispatch: t }) => {
8653
+ return Wc(n, i, t) ? r.lift(i) : r.wrapIn(i, t);
8654
+ }, ku = () => ({ state: e, dispatch: t }) => {
8643
8655
  let n = e.plugins;
8644
8656
  for (let r = 0; r < n.length; r += 1) {
8645
8657
  let i = n[r], a;
@@ -8656,30 +8668,30 @@ var Su = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
8656
8668
  }
8657
8669
  }
8658
8670
  return !1;
8659
- }, Du = () => ({ tr: e, dispatch: t }) => {
8671
+ }, Au = () => ({ tr: e, dispatch: t }) => {
8660
8672
  let { selection: n } = e, { empty: r, ranges: i } = n;
8661
8673
  return r || t && i.forEach((t) => {
8662
8674
  e.removeMark(t.$from.pos, t.$to.pos);
8663
8675
  }), !0;
8664
- }, Ou = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
8676
+ }, ju = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
8665
8677
  let { extendEmptyMarkRange: a = !1 } = t, { selection: o } = n, s = Y(e, r.schema), { $from: c, empty: l, ranges: u } = o;
8666
8678
  if (!i) return !0;
8667
8679
  if (l && a) {
8668
- let { from: e, to: t } = o, r = pc(c, s, c.marks().find((e) => e.type === s)?.attrs);
8680
+ let { from: e, to: t } = o, r = gc(c, s, c.marks().find((e) => e.type === s)?.attrs);
8669
8681
  r && (e = r.from, t = r.to), n.removeMark(e, t, s);
8670
8682
  } else u.forEach((e) => {
8671
8683
  n.removeMark(e.$from.pos, e.$to.pos, s);
8672
8684
  });
8673
8685
  return n.removeStoredMark(s), !0;
8674
- }, ku = (e) => ({ tr: t, state: n, dispatch: r }) => {
8686
+ }, Mu = (e) => ({ tr: t, state: n, dispatch: r }) => {
8675
8687
  let { selection: i } = n, a, o;
8676
8688
  return typeof e == "number" ? (a = e, o = e) : e && "from" in e && "to" in e ? (a = e.from, o = e.to) : (a = i.from, o = i.to), r && t.doc.nodesBetween(a, o, (e, n) => {
8677
8689
  if (e.isText) return;
8678
8690
  let r = { ...e.attrs };
8679
8691
  delete r.dir, t.setNodeMarkup(n, void 0, r);
8680
8692
  }), !0;
8681
- }, Au = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
8682
- let a = null, o = null, s = Kc(typeof e == "string" ? e : e.name, r.schema);
8693
+ }, Nu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
8694
+ let a = null, o = null, s = Yc(typeof e == "string" ? e : e.name, r.schema);
8683
8695
  if (!s) return !1;
8684
8696
  s === "node" && (a = J(e, r.schema)), s === "mark" && (o = Y(e, r.schema));
8685
8697
  let c = !1;
@@ -8710,7 +8722,7 @@ var Su = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
8710
8722
  }));
8711
8723
  }));
8712
8724
  }), c;
8713
- }, ju = (e, t = {}) => ({ state: n, dispatch: r }) => cr(J(e, n.schema), t)(n, r), Mu = (e, t = {}) => ({ state: n, dispatch: r }) => hr(J(e, n.schema), t)(n, r), Nu = class {
8725
+ }, Pu = (e, t = {}) => ({ state: n, dispatch: r }) => cr(J(e, n.schema), t)(n, r), Fu = (e, t = {}) => ({ state: n, dispatch: r }) => hr(J(e, n.schema), t)(n, r), Iu = class {
8714
8726
  constructor() {
8715
8727
  this.callbacks = {};
8716
8728
  }
@@ -8734,26 +8746,26 @@ var Su = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
8734
8746
  removeAllListeners() {
8735
8747
  this.callbacks = {};
8736
8748
  }
8737
- }, Pu = class {
8749
+ }, Lu = class {
8738
8750
  constructor(e) {
8739
8751
  this.find = e.find, this.handler = e.handler, this.undoable = e.undoable ?? !0;
8740
8752
  }
8741
- }, Fu = (e, t) => {
8742
- if (lc(t)) return t.exec(e);
8753
+ }, Ru = (e, t) => {
8754
+ if (fc(t)) return t.exec(e);
8743
8755
  let n = t(e);
8744
8756
  if (!n) return null;
8745
8757
  let r = [n.text];
8746
8758
  return r.index = n.index, r.input = e, r.data = n.data, n.replaceWith && (n.text.includes(n.replaceWith) || console.warn("[tiptap warn]: \"inputRuleMatch.replaceWith\" must be part of \"inputRuleMatch.text\"."), r.push(n.replaceWith)), r;
8747
8759
  };
8748
- function Iu(e) {
8760
+ function zu(e) {
8749
8761
  let { editor: t, from: n, to: r, text: i, rules: a, plugin: o } = e, { view: s } = t;
8750
8762
  if (s.composing) return !1;
8751
8763
  let c = s.state.doc.resolve(n);
8752
8764
  if (c.parent.type.spec.code || (c.nodeBefore || c.nodeAfter)?.marks.find((e) => e.type.spec.code)) return !1;
8753
- let l = !1, u = Kl(c) + i;
8765
+ let l = !1, u = Yl(c) + i;
8754
8766
  return a.forEach((e) => {
8755
8767
  if (l) return;
8756
- let a = Fu(u, e.find);
8768
+ let a = Ru(u, e.find);
8757
8769
  if (!a) return;
8758
8770
  let c = s.state.tr, d = Js({
8759
8771
  state: s.state,
@@ -8780,7 +8792,7 @@ function Iu(e) {
8780
8792
  }), s.dispatch(c), l = !0);
8781
8793
  }), l;
8782
8794
  }
8783
- function Lu(e) {
8795
+ function Bu(e) {
8784
8796
  let { editor: t, rules: n } = e, i = new M({
8785
8797
  state: {
8786
8798
  init() {
@@ -8792,9 +8804,9 @@ function Lu(e) {
8792
8804
  let c = e.getMeta("applyInputRules");
8793
8805
  return c && setTimeout(() => {
8794
8806
  let { text: e } = c;
8795
- e = typeof e == "string" ? e : fl(r.from(e), o.schema);
8807
+ e = typeof e == "string" ? e : hl(r.from(e), o.schema);
8796
8808
  let { from: a } = c;
8797
- Iu({
8809
+ zu({
8798
8810
  editor: t,
8799
8811
  from: a,
8800
8812
  to: a + e.length,
@@ -8807,7 +8819,7 @@ function Lu(e) {
8807
8819
  },
8808
8820
  props: {
8809
8821
  handleTextInput(e, r, a, o) {
8810
- return Iu({
8822
+ return zu({
8811
8823
  editor: t,
8812
8824
  from: r,
8813
8825
  to: a,
@@ -8818,7 +8830,7 @@ function Lu(e) {
8818
8830
  },
8819
8831
  handleDOMEvents: { compositionend: (e) => (setTimeout(() => {
8820
8832
  let { $cursor: r } = e.state.selection;
8821
- r && Iu({
8833
+ r && zu({
8822
8834
  editor: t,
8823
8835
  from: r.pos,
8824
8836
  to: r.pos,
@@ -8830,7 +8842,7 @@ function Lu(e) {
8830
8842
  handleKeyDown(e, r) {
8831
8843
  if (r.key !== "Enter") return !1;
8832
8844
  let { $cursor: a } = e.state.selection;
8833
- return a ? Iu({
8845
+ return a ? zu({
8834
8846
  editor: t,
8835
8847
  from: a.pos,
8836
8848
  to: a.pos,
@@ -8844,19 +8856,19 @@ function Lu(e) {
8844
8856
  });
8845
8857
  return i;
8846
8858
  }
8847
- function Ru(e) {
8859
+ function Vu(e) {
8848
8860
  return Object.prototype.toString.call(e).slice(8, -1);
8849
8861
  }
8850
- function zu(e) {
8851
- return Ru(e) === "Object" ? e.constructor === Object && Object.getPrototypeOf(e) === Object.prototype : !1;
8862
+ function Hu(e) {
8863
+ return Vu(e) === "Object" ? e.constructor === Object && Object.getPrototypeOf(e) === Object.prototype : !1;
8852
8864
  }
8853
- function Bu(e, t) {
8865
+ function Uu(e, t) {
8854
8866
  let n = { ...e };
8855
- return zu(e) && zu(t) && Object.keys(t).forEach((r) => {
8856
- zu(t[r]) && zu(e[r]) ? n[r] = Bu(e[r], t[r]) : n[r] = t[r];
8867
+ return Hu(e) && Hu(t) && Object.keys(t).forEach((r) => {
8868
+ Hu(t[r]) && Hu(e[r]) ? n[r] = Uu(e[r], t[r]) : n[r] = t[r];
8857
8869
  }), n;
8858
8870
  }
8859
- var Vu = class {
8871
+ var Wu = class {
8860
8872
  constructor(e = {}) {
8861
8873
  this.type = "extendable", this.parent = null, this.child = null, this.name = "", this.config = { name: this.name }, this.config = {
8862
8874
  ...this.config,
@@ -8875,7 +8887,7 @@ var Vu = class {
8875
8887
  configure(e = {}) {
8876
8888
  let t = this.extend({
8877
8889
  ...this.config,
8878
- addOptions: () => Bu(this.options, e)
8890
+ addOptions: () => Uu(this.options, e)
8879
8891
  });
8880
8892
  return t.name = this.name, t.parent = this.parent, this.child = null, t;
8881
8893
  }
@@ -8886,7 +8898,7 @@ var Vu = class {
8886
8898
  });
8887
8899
  return t.parent = this, this.child = t, t.name = "name" in e ? e.name : t.parent.name, t;
8888
8900
  }
8889
- }, Hu = class e extends Vu {
8901
+ }, Gu = class e extends Wu {
8890
8902
  constructor() {
8891
8903
  super(...arguments), this.type = "mark";
8892
8904
  }
@@ -8911,22 +8923,22 @@ var Vu = class {
8911
8923
  return super.extend(t);
8912
8924
  }
8913
8925
  };
8914
- function Uu(e) {
8926
+ function Ku(e) {
8915
8927
  return typeof e == "number";
8916
8928
  }
8917
- var Wu = class {
8929
+ var qu = class {
8918
8930
  constructor(e) {
8919
8931
  this.find = e.find, this.handler = e.handler;
8920
8932
  }
8921
- }, Gu = (e, t, n) => {
8922
- if (lc(t)) return [...e.matchAll(t)];
8933
+ }, Ju = (e, t, n) => {
8934
+ if (fc(t)) return [...e.matchAll(t)];
8923
8935
  let r = t(e, n);
8924
8936
  return r ? r.map((t) => {
8925
8937
  let n = [t.text];
8926
8938
  return n.index = t.index, n.input = e, n.data = t.data, t.replaceWith && (t.text.includes(t.replaceWith) || console.warn("[tiptap warn]: \"pasteRuleMatch.replaceWith\" must be part of \"pasteRuleMatch.text\"."), n.push(t.replaceWith)), n;
8927
8939
  }) : [];
8928
8940
  };
8929
- function Ku(e) {
8941
+ function Yu(e) {
8930
8942
  let { editor: t, state: n, from: r, to: i, rule: a, pasteEvent: o, dropEvent: s } = e, { commands: c, chain: l, can: u } = new Ys({
8931
8943
  editor: t,
8932
8944
  state: n
@@ -8934,7 +8946,7 @@ function Ku(e) {
8934
8946
  return n.doc.nodesBetween(r, i, (e, t) => {
8935
8947
  if (e.type?.spec?.code || !(e.isText || e.isTextblock || e.isInline)) return;
8936
8948
  let f = e.content?.size ?? e.nodeSize ?? 0, p = Math.max(r, t), m = Math.min(i, t + f);
8937
- p >= m || Gu(e.isText ? e.text || "" : e.textBetween(p - t, m - t, void 0, ""), a.find, o).forEach((e) => {
8949
+ p >= m || Ju(e.isText ? e.text || "" : e.textBetween(p - t, m - t, void 0, ""), a.find, o).forEach((e) => {
8938
8950
  if (e.index === void 0) return;
8939
8951
  let t = p + e.index + 1, r = t + e[0].length, i = {
8940
8952
  from: n.tr.mapping.map(t),
@@ -8953,12 +8965,12 @@ function Ku(e) {
8953
8965
  });
8954
8966
  }), d.every((e) => e !== null);
8955
8967
  }
8956
- var qu = null, Ju = (e) => {
8968
+ var Xu = null, Zu = (e) => {
8957
8969
  var t;
8958
8970
  let n = new ClipboardEvent("paste", { clipboardData: new DataTransfer() });
8959
8971
  return (t = n.clipboardData) == null || t.setData("text/html", e), n;
8960
8972
  };
8961
- function Yu(e) {
8973
+ function Qu(e) {
8962
8974
  let { editor: t, rules: n } = e, i = null, a = !1, o = !1, s = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, c;
8963
8975
  try {
8964
8976
  c = typeof DragEvent < "u" ? new DragEvent("drop") : null;
@@ -8967,7 +8979,7 @@ function Yu(e) {
8967
8979
  }
8968
8980
  let l = ({ state: e, from: n, to: r, rule: i, pasteEvt: a }) => {
8969
8981
  let o = e.tr;
8970
- if (!(!Ku({
8982
+ if (!(!Yu({
8971
8983
  editor: t,
8972
8984
  state: Js({
8973
8985
  state: e,
@@ -8990,9 +9002,9 @@ function Yu(e) {
8990
9002
  return n.map((e) => new M({
8991
9003
  view(e) {
8992
9004
  let n = (n) => {
8993
- i = e.dom.parentElement?.contains(n.target) ? e.dom.parentElement : null, i && (qu = t);
9005
+ i = e.dom.parentElement?.contains(n.target) ? e.dom.parentElement : null, i && (Xu = t);
8994
9006
  }, r = () => {
8995
- qu &&= null;
9007
+ Xu &&= null;
8996
9008
  };
8997
9009
  return window.addEventListener("dragstart", n), window.addEventListener("dragend", r), { destroy() {
8998
9010
  window.removeEventListener("dragstart", n), window.removeEventListener("dragend", r);
@@ -9001,7 +9013,7 @@ function Yu(e) {
9001
9013
  props: { handleDOMEvents: {
9002
9014
  drop: (e, t) => {
9003
9015
  if (o = i === e.dom.parentElement, c = t, !o) {
9004
- let e = qu;
9016
+ let e = Xu;
9005
9017
  e?.isEditable && setTimeout(() => {
9006
9018
  let t = e.state.selection;
9007
9019
  t && e.commands.deleteRange({
@@ -9022,8 +9034,8 @@ function Yu(e) {
9022
9034
  if (!u && !d && !p) return;
9023
9035
  if (p) {
9024
9036
  let { text: t } = f;
9025
- t = typeof t == "string" ? t : fl(r.from(t), i.schema);
9026
- let { from: n } = f, a = n + t.length, o = Ju(t);
9037
+ t = typeof t == "string" ? t : hl(r.from(t), i.schema);
9038
+ let { from: n } = f, a = n + t.length, o = Zu(t);
9027
9039
  return l({
9028
9040
  rule: e,
9029
9041
  state: i,
@@ -9033,7 +9045,7 @@ function Yu(e) {
9033
9045
  });
9034
9046
  }
9035
9047
  let m = n.doc.content.findDiffStart(i.doc.content), h = n.doc.content.findDiffEnd(i.doc.content);
9036
- if (!(!Uu(m) || !h || m === h.b)) return l({
9048
+ if (!(!Ku(m) || !h || m === h.b)) return l({
9037
9049
  rule: e,
9038
9050
  state: i,
9039
9051
  from: m,
@@ -9043,9 +9055,9 @@ function Yu(e) {
9043
9055
  }
9044
9056
  }));
9045
9057
  }
9046
- var Xu = class {
9058
+ var $u = class {
9047
9059
  constructor(e, t) {
9048
- this.splittableMarks = [], this.editor = t, this.baseExtensions = e, this.extensions = Ol(e), this.schema = Tl(this.extensions, t), this.setupExtensions();
9060
+ this.splittableMarks = [], this.editor = t, this.baseExtensions = e, this.extensions = jl(e), this.schema = Ol(this.extensions, t), this.setupExtensions();
9049
9061
  }
9050
9062
  get commands() {
9051
9063
  return this.extensions.reduce((e, t) => {
@@ -9054,7 +9066,7 @@ var Xu = class {
9054
9066
  options: t.options,
9055
9067
  storage: this.editor.extensionStorage[t.name],
9056
9068
  editor: this.editor,
9057
- type: Wl(t.name, this.schema)
9069
+ type: ql(t.name, this.schema)
9058
9070
  });
9059
9071
  return n ? {
9060
9072
  ...e,
@@ -9064,15 +9076,15 @@ var Xu = class {
9064
9076
  }
9065
9077
  get plugins() {
9066
9078
  let { editor: e } = this;
9067
- return Dl([...this.extensions].reverse()).flatMap((t) => {
9079
+ return Al([...this.extensions].reverse()).flatMap((t) => {
9068
9080
  let n = {
9069
9081
  name: t.name,
9070
9082
  options: t.options,
9071
9083
  storage: this.editor.extensionStorage[t.name],
9072
9084
  editor: e,
9073
- type: Wl(t.name, this.schema)
9085
+ type: ql(t.name, this.schema)
9074
9086
  }, r = [], i = Z(t, "addKeyboardShortcuts", n), a = {};
9075
- if (t.type === "mark" && Z(t, "exitable", n) && (a.ArrowRight = () => Hu.handleExit({
9087
+ if (t.type === "mark" && Z(t, "exitable", n) && (a.ArrowRight = () => Gu.handleExit({
9076
9088
  editor: e,
9077
9089
  mark: t
9078
9090
  })), i) {
@@ -9085,10 +9097,10 @@ var Xu = class {
9085
9097
  let o = Ws(a);
9086
9098
  r.push(o);
9087
9099
  let s = Z(t, "addInputRules", n);
9088
- if (Zl(t, e.options.enableInputRules) && s) {
9100
+ if (eu(t, e.options.enableInputRules) && s) {
9089
9101
  let t = s();
9090
9102
  if (t && t.length) {
9091
- let n = Lu({
9103
+ let n = Bu({
9092
9104
  editor: e,
9093
9105
  rules: t
9094
9106
  }), i = Array.isArray(n) ? n : [n];
@@ -9096,10 +9108,10 @@ var Xu = class {
9096
9108
  }
9097
9109
  }
9098
9110
  let c = Z(t, "addPasteRules", n);
9099
- if (Zl(t, e.options.enablePasteRules) && c) {
9111
+ if (eu(t, e.options.enablePasteRules) && c) {
9100
9112
  let t = c();
9101
9113
  if (t && t.length) {
9102
- let n = Yu({
9114
+ let n = Qu({
9103
9115
  editor: e,
9104
9116
  rules: t
9105
9117
  });
@@ -9115,10 +9127,10 @@ var Xu = class {
9115
9127
  });
9116
9128
  }
9117
9129
  get attributes() {
9118
- return gl(this.extensions);
9130
+ return yl(this.extensions);
9119
9131
  }
9120
9132
  get nodeViews() {
9121
- let { editor: e } = this, { nodeExtensions: t } = hl(this.extensions);
9133
+ let { editor: e } = this, { nodeExtensions: t } = vl(this.extensions);
9122
9134
  return Object.fromEntries(t.filter((e) => !!Z(e, "addNodeView")).map((t) => {
9123
9135
  let n = this.attributes.filter((e) => e.type === t.name), r = Z(t, "addNodeView", {
9124
9136
  name: t.name,
@@ -9137,19 +9149,19 @@ var Xu = class {
9137
9149
  innerDecorations: c,
9138
9150
  editor: e,
9139
9151
  extension: t,
9140
- HTMLAttributes: bl(r, n)
9152
+ HTMLAttributes: Cl(r, n)
9141
9153
  })] : [];
9142
9154
  }));
9143
9155
  }
9144
9156
  dispatchTransaction(e) {
9145
9157
  let { editor: t } = this;
9146
- return Dl([...this.extensions].reverse()).reduceRight((e, n) => {
9158
+ return Al([...this.extensions].reverse()).reduceRight((e, n) => {
9147
9159
  let r = {
9148
9160
  name: n.name,
9149
9161
  options: n.options,
9150
9162
  storage: this.editor.extensionStorage[n.name],
9151
9163
  editor: t,
9152
- type: Wl(n.name, this.schema)
9164
+ type: ql(n.name, this.schema)
9153
9165
  }, i = Z(n, "dispatchTransaction", r);
9154
9166
  return i ? (t) => {
9155
9167
  i.call(r, {
@@ -9161,13 +9173,13 @@ var Xu = class {
9161
9173
  }
9162
9174
  transformPastedHTML(e) {
9163
9175
  let { editor: t } = this;
9164
- return Dl([...this.extensions]).reduce((e, n) => {
9176
+ return Al([...this.extensions]).reduce((e, n) => {
9165
9177
  let r = {
9166
9178
  name: n.name,
9167
9179
  options: n.options,
9168
9180
  storage: this.editor.extensionStorage[n.name],
9169
9181
  editor: t,
9170
- type: Wl(n.name, this.schema)
9182
+ type: ql(n.name, this.schema)
9171
9183
  }, i = Z(n, "transformPastedHTML", r);
9172
9184
  return i ? (t, n) => {
9173
9185
  let a = e(t, n);
@@ -9176,7 +9188,7 @@ var Xu = class {
9176
9188
  }, e || ((e) => e));
9177
9189
  }
9178
9190
  get markViews() {
9179
- let { editor: e } = this, { markExtensions: t } = hl(this.extensions);
9191
+ let { editor: e } = this, { markExtensions: t } = vl(this.extensions);
9180
9192
  return Object.fromEntries(t.filter((e) => !!Z(e, "addMarkView")).map((t) => {
9181
9193
  let n = this.attributes.filter((e) => e.type === t.name), r = Z(t, "addMarkView", {
9182
9194
  name: t.name,
@@ -9186,7 +9198,7 @@ var Xu = class {
9186
9198
  type: Y(t.name, this.schema)
9187
9199
  });
9188
9200
  return r ? [t.name, (i, a, o) => {
9189
- let s = bl(i, n);
9201
+ let s = Cl(i, n);
9190
9202
  return r()({
9191
9203
  mark: i,
9192
9204
  view: a,
@@ -9218,7 +9230,7 @@ var Xu = class {
9218
9230
  options: e.options,
9219
9231
  storage: this.editor.extensionStorage[e.name],
9220
9232
  editor: this.editor,
9221
- type: Wl(e.name, this.schema)
9233
+ type: ql(e.name, this.schema)
9222
9234
  };
9223
9235
  e.type === "mark" && (Q(Z(e, "keepOnSplit", t)) ?? !0) && this.splittableMarks.push(e.name);
9224
9236
  let n = Z(e, "onBeforeCreate", t), r = Z(e, "onCreate", t), i = Z(e, "onUpdate", t), a = Z(e, "onSelectionUpdate", t), o = Z(e, "onTransaction", t), s = Z(e, "onFocus", t), c = Z(e, "onBlur", t), l = Z(e, "onDestroy", t);
@@ -9226,22 +9238,22 @@ var Xu = class {
9226
9238
  });
9227
9239
  }
9228
9240
  };
9229
- Xu.resolve = Ol, Xu.sort = Dl, Xu.flatten = dl;
9230
- var Zu = {};
9231
- qs(Zu, {
9232
- ClipboardTextSerializer: () => Qu,
9233
- Commands: () => $u,
9234
- Delete: () => ed,
9235
- Drop: () => td,
9236
- Editable: () => nd,
9237
- FocusEvents: () => id,
9238
- Keymap: () => ad,
9239
- Paste: () => od,
9240
- Tabindex: () => sd,
9241
- TextDirection: () => cd,
9242
- focusEventsPluginKey: () => rd
9241
+ $u.resolve = jl, $u.sort = Al, $u.flatten = ml;
9242
+ var ed = {};
9243
+ qs(ed, {
9244
+ ClipboardTextSerializer: () => td,
9245
+ Commands: () => nd,
9246
+ Delete: () => rd,
9247
+ Drop: () => id,
9248
+ Editable: () => ad,
9249
+ FocusEvents: () => sd,
9250
+ Keymap: () => cd,
9251
+ Paste: () => ld,
9252
+ Tabindex: () => ud,
9253
+ TextDirection: () => dd,
9254
+ focusEventsPluginKey: () => od
9243
9255
  });
9244
- var $ = class e extends Vu {
9256
+ var $ = class e extends Wu {
9245
9257
  constructor() {
9246
9258
  super(...arguments), this.type = "extension";
9247
9259
  }
@@ -9255,7 +9267,7 @@ var $ = class e extends Vu {
9255
9267
  let t = typeof e == "function" ? e() : e;
9256
9268
  return super.extend(t);
9257
9269
  }
9258
- }, Qu = $.create({
9270
+ }, td = $.create({
9259
9271
  name: "clipboardTextSerializer",
9260
9272
  addOptions() {
9261
9273
  return { blockSeparator: void 0 };
@@ -9264,8 +9276,8 @@ var $ = class e extends Vu {
9264
9276
  return [new M({
9265
9277
  key: new jn("clipboardTextSerializer"),
9266
9278
  props: { clipboardTextSerializer: () => {
9267
- let { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: i } = t, { ranges: a } = i, o = Math.min(...a.map((e) => e.$from.pos)), s = Math.max(...a.map((e) => e.$to.pos)), c = Pl(n);
9268
- return Ml(r, {
9279
+ let { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: i } = t, { ranges: a } = i, o = Math.min(...a.map((e) => e.$from.pos)), s = Math.max(...a.map((e) => e.$to.pos)), c = Ll(n);
9280
+ return Fl(r, {
9269
9281
  from: o,
9270
9282
  to: s
9271
9283
  }, {
@@ -9275,19 +9287,19 @@ var $ = class e extends Vu {
9275
9287
  } }
9276
9288
  })];
9277
9289
  }
9278
- }), $u = $.create({
9290
+ }), nd = $.create({
9279
9291
  name: "commands",
9280
9292
  addCommands() {
9281
9293
  return { ...Xs };
9282
9294
  }
9283
- }), ed = $.create({
9295
+ }), rd = $.create({
9284
9296
  name: "delete",
9285
9297
  onUpdate({ transaction: e, appendedTransactions: t }) {
9286
9298
  let n = () => {
9287
9299
  var n;
9288
9300
  if (((n = this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n, e) ?? e.getMeta("y-sync$")) return;
9289
- let r = al(e.before, [e, ...t]);
9290
- Bl(r).forEach((t) => {
9301
+ let r = cl(e.before, [e, ...t]);
9302
+ Ul(r).forEach((t) => {
9291
9303
  r.mapping.mapResult(t.oldRange.from).deletedAfter && r.mapping.mapResult(t.oldRange.to).deletedBefore && r.before.nodesBetween(t.oldRange.from, t.oldRange.to, (n, i) => {
9292
9304
  let a = i + n.nodeSize - 2, o = t.oldRange.from <= i && a <= t.oldRange.to;
9293
9305
  this.editor.emit("delete", {
@@ -9333,7 +9345,7 @@ var $ = class e extends Vu {
9333
9345
  };
9334
9346
  this.editor.options.coreExtensionOptions?.delete?.async ?? !0 ? setTimeout(n, 0) : n();
9335
9347
  }
9336
- }), td = $.create({
9348
+ }), id = $.create({
9337
9349
  name: "drop",
9338
9350
  addProseMirrorPlugins() {
9339
9351
  return [new M({
@@ -9348,7 +9360,7 @@ var $ = class e extends Vu {
9348
9360
  } }
9349
9361
  })];
9350
9362
  }
9351
- }), nd = $.create({
9363
+ }), ad = $.create({
9352
9364
  name: "editable",
9353
9365
  addProseMirrorPlugins() {
9354
9366
  return [new M({
@@ -9356,12 +9368,12 @@ var $ = class e extends Vu {
9356
9368
  props: { editable: () => this.editor.options.editable }
9357
9369
  })];
9358
9370
  }
9359
- }), rd = new jn("focusEvents"), id = $.create({
9371
+ }), od = new jn("focusEvents"), sd = $.create({
9360
9372
  name: "focusEvents",
9361
9373
  addProseMirrorPlugins() {
9362
9374
  let { editor: e } = this;
9363
9375
  return [new M({
9364
- key: rd,
9376
+ key: od,
9365
9377
  props: { handleDOMEvents: {
9366
9378
  focus: (t, n) => {
9367
9379
  e.isFocused = !0;
@@ -9376,7 +9388,7 @@ var $ = class e extends Vu {
9376
9388
  } }
9377
9389
  })];
9378
9390
  }
9379
- }), ad = $.create({
9391
+ }), cd = $.create({
9380
9392
  name: "keymap",
9381
9393
  addKeyboardShortcuts() {
9382
9394
  let e = () => this.editor.commands.first(({ commands: e }) => [
@@ -9418,7 +9430,7 @@ var $ = class e extends Vu {
9418
9430
  "Ctrl-a": () => this.editor.commands.selectTextblockStart(),
9419
9431
  "Ctrl-e": () => this.editor.commands.selectTextblockEnd()
9420
9432
  };
9421
- return yc() || Rc() ? i : r;
9433
+ return Sc() || Vc() ? i : r;
9422
9434
  },
9423
9435
  addProseMirrorPlugins() {
9424
9436
  return [new M({
@@ -9428,7 +9440,7 @@ var $ = class e extends Vu {
9428
9440
  let r = e.some((e) => e.docChanged) && !t.doc.eq(n.doc), i = e.some((e) => e.getMeta("preventClearDocument"));
9429
9441
  if (!r || i) return;
9430
9442
  let { empty: a, from: o, to: s } = t.selection, c = O.atStart(t.doc).from, l = O.atEnd(t.doc).to;
9431
- if (a || !(o === c && s === l) || !$l(n.doc)) return;
9443
+ if (a || !(o === c && s === l) || !nu(n.doc)) return;
9432
9444
  let u = n.tr, d = Js({
9433
9445
  state: n,
9434
9446
  transaction: u
@@ -9440,7 +9452,7 @@ var $ = class e extends Vu {
9440
9452
  }
9441
9453
  })];
9442
9454
  }
9443
- }), od = $.create({
9455
+ }), ld = $.create({
9444
9456
  name: "paste",
9445
9457
  addProseMirrorPlugins() {
9446
9458
  return [new M({
@@ -9454,7 +9466,7 @@ var $ = class e extends Vu {
9454
9466
  } }
9455
9467
  })];
9456
9468
  }
9457
- }), sd = $.create({
9469
+ }), ud = $.create({
9458
9470
  name: "tabindex",
9459
9471
  addOptions() {
9460
9472
  return { value: void 0 };
@@ -9465,14 +9477,14 @@ var $ = class e extends Vu {
9465
9477
  props: { attributes: () => !this.editor.isEditable && this.options.value === void 0 ? {} : { tabindex: this.options.value ?? "0" } }
9466
9478
  })];
9467
9479
  }
9468
- }), cd = $.create({
9480
+ }), dd = $.create({
9469
9481
  name: "textDirection",
9470
9482
  addOptions() {
9471
9483
  return { direction: void 0 };
9472
9484
  },
9473
9485
  addGlobalAttributes() {
9474
9486
  if (!this.options.direction) return [];
9475
- let { nodeExtensions: e } = hl(this.extensions);
9487
+ let { nodeExtensions: e } = vl(this.extensions);
9476
9488
  return [{
9477
9489
  types: e.filter((e) => e.name !== "text").map((e) => e.name),
9478
9490
  attributes: { dir: {
@@ -9494,7 +9506,7 @@ var $ = class e extends Vu {
9494
9506
  } }
9495
9507
  })];
9496
9508
  }
9497
- }), ld = class e {
9509
+ }), fd = class e {
9498
9510
  constructor(e, t, n = !1, r = null) {
9499
9511
  this.currentNode = null, this.actualDepth = null, this.isBlock = n, this.resolvedPos = e, this.editor = t, this.currentNode = r;
9500
9512
  }
@@ -9614,14 +9626,14 @@ var $ = class e extends Vu {
9614
9626
  ...e
9615
9627
  }), this.editor.view.dispatch(t);
9616
9628
  }
9617
- }, ud = ".ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}";
9618
- function dd(e, t, n) {
9629
+ }, pd = ".ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}";
9630
+ function md(e, t, n) {
9619
9631
  let r = document.querySelector(`style[data-tiptap-style${n ? `-${n}` : ""}]`);
9620
9632
  if (r !== null) return r;
9621
9633
  let i = document.createElement("style");
9622
9634
  return t && i.setAttribute("nonce", t), i.setAttribute(`data-tiptap-style${n ? `-${n}` : ""}`, ""), i.innerHTML = e, document.getElementsByTagName("head")[0].appendChild(i), i;
9623
9635
  }
9624
- var fd = class extends Nu {
9636
+ var hd = class extends Iu {
9625
9637
  constructor(e = {}) {
9626
9638
  super(), this.css = null, this.className = "tiptap", this.editorView = null, this.isFocused = !1, this.destroyed = !1, this.isInitialized = !1, this.extensionStorage = {}, this.instanceId = Math.random().toString(36).slice(2, 9), this.options = {
9627
9639
  element: typeof document < "u" ? document.createElement("div") : null,
@@ -9658,10 +9670,10 @@ var fd = class extends Nu {
9658
9670
  onDelete: () => null,
9659
9671
  enableExtensionDispatchTransaction: !0
9660
9672
  }, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.utils = {
9661
- getUpdatedPosition: ru,
9662
- createMappablePosition: iu
9673
+ getUpdatedPosition: ou,
9674
+ createMappablePosition: su
9663
9675
  }, this.setOptions(e), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("mount", this.options.onMount), this.on("unmount", this.options.onUnmount), this.on("contentError", this.options.onContentError), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: e, slice: t, moved: n }) => this.options.onDrop(e, t, n)), this.on("paste", ({ event: e, slice: t }) => this.options.onPaste(e, t)), this.on("delete", this.options.onDelete);
9664
- let t = this.createDoc(), n = _c(t, this.options.autofocus);
9676
+ let t = this.createDoc(), n = bc(t, this.options.autofocus);
9665
9677
  this.editorState = Dn.create({
9666
9678
  doc: t,
9667
9679
  schema: this.schema,
@@ -9699,7 +9711,7 @@ var fd = class extends Nu {
9699
9711
  return this.commandManager.can();
9700
9712
  }
9701
9713
  injectCSS() {
9702
- this.options.injectCSS && typeof document < "u" && (this.css = dd(ud, this.options.injectNonce));
9714
+ this.options.injectCSS && typeof document < "u" && (this.css = md(pd, this.options.injectNonce));
9703
9715
  }
9704
9716
  setOptions(e = {}) {
9705
9717
  this.options = {
@@ -9741,7 +9753,7 @@ var fd = class extends Nu {
9741
9753
  return this.editorView && (this.editorState = this.view.state), this.editorState;
9742
9754
  }
9743
9755
  registerPlugin(e, t) {
9744
- let n = pl(t) ? t(e, [...this.state.plugins]) : [...this.state.plugins, e], r = this.state.reconfigure({ plugins: n });
9756
+ let n = gl(t) ? t(e, [...this.state.plugins]) : [...this.state.plugins, e], r = this.state.reconfigure({ plugins: n });
9745
9757
  return this.view.updateState(r), r;
9746
9758
  }
9747
9759
  unregisterPlugin(e) {
@@ -9756,22 +9768,22 @@ var fd = class extends Nu {
9756
9768
  }
9757
9769
  createExtensionManager() {
9758
9770
  let e = [...this.options.enableCoreExtensions ? [
9771
+ ad,
9772
+ td.configure({ blockSeparator: this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator }),
9759
9773
  nd,
9760
- Qu.configure({ blockSeparator: this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator }),
9761
- $u,
9774
+ sd,
9775
+ cd,
9776
+ ud.configure({ value: this.options.coreExtensionOptions?.tabindex?.value }),
9762
9777
  id,
9763
- ad,
9764
- sd.configure({ value: this.options.coreExtensionOptions?.tabindex?.value }),
9765
- td,
9766
- od,
9767
- ed,
9768
- cd.configure({ direction: this.options.textDirection })
9778
+ ld,
9779
+ rd,
9780
+ dd.configure({ direction: this.options.textDirection })
9769
9781
  ].filter((e) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[e.name] !== !1 : !0) : [], ...this.options.extensions].filter((e) => [
9770
9782
  "extension",
9771
9783
  "node",
9772
9784
  "mark"
9773
9785
  ].includes(e?.type));
9774
- this.extensionManager = new Xu(e, this);
9786
+ this.extensionManager = new $u(e, this);
9775
9787
  }
9776
9788
  createCommandManager() {
9777
9789
  this.commandManager = new Ys({ editor: this });
@@ -9782,7 +9794,7 @@ var fd = class extends Nu {
9782
9794
  createDoc() {
9783
9795
  let e;
9784
9796
  try {
9785
- e = nl(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
9797
+ e = al(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
9786
9798
  } catch (t) {
9787
9799
  if (!(t instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(t.message)) throw t;
9788
9800
  this.emit("contentError", {
@@ -9791,7 +9803,7 @@ var fd = class extends Nu {
9791
9803
  disableCollaboration: () => {
9792
9804
  "collaboration" in this.storage && typeof this.storage.collaboration == "object" && this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((e) => e.name !== "collaboration"), this.createExtensionManager();
9793
9805
  }
9794
- }), e = nl(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
9806
+ }), e = al(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
9795
9807
  }
9796
9808
  return e;
9797
9809
  }
@@ -9868,30 +9880,30 @@ var fd = class extends Nu {
9868
9880
  });
9869
9881
  }
9870
9882
  getAttributes(e) {
9871
- return Ll(this.state, e);
9883
+ return Bl(this.state, e);
9872
9884
  }
9873
9885
  isActive(e, t) {
9874
9886
  let n = typeof e == "string" ? e : null, r = typeof e == "string" ? t : e;
9875
- return Jl(this.state, n, r);
9887
+ return Zl(this.state, n, r);
9876
9888
  }
9877
9889
  getJSON() {
9878
9890
  return this.state.doc.toJSON();
9879
9891
  }
9880
9892
  getHTML() {
9881
- return fl(this.state.doc.content, this.schema);
9893
+ return hl(this.state.doc.content, this.schema);
9882
9894
  }
9883
9895
  getText(e) {
9884
9896
  let { blockSeparator: t = "\n\n", textSerializers: n = {} } = e || {};
9885
- return Nl(this.state.doc, {
9897
+ return Il(this.state.doc, {
9886
9898
  blockSeparator: t,
9887
9899
  textSerializers: {
9888
- ...Pl(this.schema),
9900
+ ...Ll(this.schema),
9889
9901
  ...n
9890
9902
  }
9891
9903
  });
9892
9904
  }
9893
9905
  get isEmpty() {
9894
- return $l(this.state.doc);
9906
+ return nu(this.state.doc);
9895
9907
  }
9896
9908
  destroy() {
9897
9909
  this.destroyed || (this.destroyed = !0, this.emit("destroy"), this.unmount(), this.removeAllListeners(), this.extensionManager.destroy(), this.extensionManager = null, this.schema = null, this.commandManager = null, this.extensionStorage = {});
@@ -9906,14 +9918,15 @@ var fd = class extends Nu {
9906
9918
  return this.$doc?.querySelectorAll(e, t) || null;
9907
9919
  }
9908
9920
  $pos(e) {
9909
- return new ld(this.state.doc.resolve(e), this);
9921
+ let t = this.state.doc.resolve(e), n = e > 0 && t.nodeAfter && !t.nodeAfter.isText ? t.nodeAfter : null;
9922
+ return new fd(t, this, !1, n);
9910
9923
  }
9911
9924
  get $doc() {
9912
9925
  return this.$pos(0);
9913
9926
  }
9914
9927
  };
9915
- function pd(e) {
9916
- return new Pu({
9928
+ function gd(e) {
9929
+ return new Lu({
9917
9930
  find: e.find,
9918
9931
  handler: ({ state: t, range: n, match: r }) => {
9919
9932
  let i = Q(e.getAttributes, void 0, r);
@@ -9921,7 +9934,7 @@ function pd(e) {
9921
9934
  let { tr: a } = t, o = r[r.length - 1], s = r[0];
9922
9935
  if (o) {
9923
9936
  let r = s.search(/\S/), c = n.from + s.indexOf(o), l = c + o.length;
9924
- if (Hl(n.from, n.to, t.doc).filter((t) => t.mark.type.excluded.find((n) => n === e.type && n !== t.mark.type)).filter((e) => e.to > c).length) return null;
9937
+ if (Gl(n.from, n.to, t.doc).filter((t) => t.mark.type.excluded.find((n) => n === e.type && n !== t.mark.type)).filter((e) => e.to > c).length) return null;
9925
9938
  l < n.to && a.delete(l, n.to), c > n.from && a.delete(n.from + r, c);
9926
9939
  let u = n.from + r + o.length;
9927
9940
  a.addMark(n.from + r, u, e.type.create(i || {})), a.removeStoredMark(e.type);
@@ -9930,8 +9943,8 @@ function pd(e) {
9930
9943
  undoable: e.undoable
9931
9944
  });
9932
9945
  }
9933
- function md(e) {
9934
- return new Pu({
9946
+ function _d(e) {
9947
+ return new Lu({
9935
9948
  find: e.find,
9936
9949
  handler: ({ state: t, range: n, match: r }) => {
9937
9950
  let i = Q(e.getAttributes, void 0, r) || {}, { tr: a } = t, o = n.from, s = n.to, c = e.type.create(i);
@@ -9949,8 +9962,8 @@ function md(e) {
9949
9962
  undoable: e.undoable
9950
9963
  });
9951
9964
  }
9952
- function hd(e) {
9953
- return new Pu({
9965
+ function vd(e) {
9966
+ return new Lu({
9954
9967
  find: e.find,
9955
9968
  handler: ({ state: t, range: n, match: r }) => {
9956
9969
  let i = t.doc.resolve(n.from), a = Q(e.getAttributes, void 0, r) || {};
@@ -9960,8 +9973,8 @@ function hd(e) {
9960
9973
  undoable: e.undoable
9961
9974
  });
9962
9975
  }
9963
- function gd(e) {
9964
- return new Pu({
9976
+ function yd(e) {
9977
+ return new Lu({
9965
9978
  find: e.find,
9966
9979
  handler: ({ state: t, range: n, match: r }) => {
9967
9980
  let i = e.replace, a = n.from, o = n.to;
@@ -9976,8 +9989,8 @@ function gd(e) {
9976
9989
  undoable: e.undoable
9977
9990
  });
9978
9991
  }
9979
- function _d(e) {
9980
- return new Pu({
9992
+ function bd(e) {
9993
+ return new Lu({
9981
9994
  find: e.find,
9982
9995
  handler: ({ state: t, range: n, match: r, chain: i }) => {
9983
9996
  let a = Q(e.getAttributes, void 0, r) || {}, o = t.tr.delete(n.from, n.to), s = o.doc.resolve(n.from).blockRange(), c = s && Et(s, e.type, a);
@@ -9999,10 +10012,10 @@ function _d(e) {
9999
10012
  undoable: e.undoable
10000
10013
  });
10001
10014
  }
10002
- function vd(e) {
10015
+ function xd(e) {
10003
10016
  return e.children;
10004
10017
  }
10005
- var yd = (e, t) => {
10018
+ var Sd = (e, t) => {
10006
10019
  if (e === "slot") return 0;
10007
10020
  if (e instanceof Function) return e(t);
10008
10021
  let { children: n, ...r } = t ?? {};
@@ -10012,7 +10025,7 @@ var yd = (e, t) => {
10012
10025
  r,
10013
10026
  n
10014
10027
  ];
10015
- }, bd = (e) => "touches" in e, xd = class {
10028
+ }, Cd = (e) => "touches" in e, wd = class {
10016
10029
  constructor(e) {
10017
10030
  this.directions = [
10018
10031
  "bottom-left",
@@ -10101,7 +10114,7 @@ var yd = (e, t) => {
10101
10114
  e ? (this.element.style.width = `${e}px`, this.initialWidth = e) : this.initialWidth = this.element.offsetWidth, t ? (this.element.style.height = `${t}px`, this.initialHeight = t) : this.initialHeight = this.element.offsetHeight, this.initialWidth > 0 && this.initialHeight > 0 && (this.aspectRatio = this.initialWidth / this.initialHeight);
10102
10115
  }
10103
10116
  handleResizeStart(e, t) {
10104
- e.preventDefault(), e.stopPropagation(), this.isResizing = !0, this.activeHandle = t, bd(e) ? (this.startX = e.touches[0].clientX, this.startY = e.touches[0].clientY) : (this.startX = e.clientX, this.startY = e.clientY), this.startWidth = this.element.offsetWidth, this.startHeight = this.element.offsetHeight, this.startWidth > 0 && this.startHeight > 0 && (this.aspectRatio = this.startWidth / this.startHeight), this.getPos(), this.container.dataset.resizeState = "true", this.classNames.resizing && this.container.classList.add(this.classNames.resizing), document.addEventListener("mousemove", this.handleMouseMove), document.addEventListener("touchmove", this.handleTouchMove), document.addEventListener("mouseup", this.handleMouseUp), document.addEventListener("keydown", this.handleKeyDown), document.addEventListener("keyup", this.handleKeyUp);
10117
+ e.preventDefault(), e.stopPropagation(), this.isResizing = !0, this.activeHandle = t, Cd(e) ? (this.startX = e.touches[0].clientX, this.startY = e.touches[0].clientY) : (this.startX = e.clientX, this.startY = e.clientY), this.startWidth = this.element.offsetWidth, this.startHeight = this.element.offsetHeight, this.startWidth > 0 && this.startHeight > 0 && (this.aspectRatio = this.startWidth / this.startHeight), this.getPos(), this.container.dataset.resizeState = "true", this.classNames.resizing && this.container.classList.add(this.classNames.resizing), document.addEventListener("mousemove", this.handleMouseMove), document.addEventListener("touchmove", this.handleTouchMove), document.addEventListener("mouseup", this.handleMouseUp), document.addEventListener("keydown", this.handleKeyDown), document.addEventListener("keyup", this.handleKeyUp);
10105
10118
  }
10106
10119
  handleResize(e, t) {
10107
10120
  if (!this.activeHandle) return;
@@ -10141,8 +10154,8 @@ var yd = (e, t) => {
10141
10154
  height: e / this.aspectRatio
10142
10155
  };
10143
10156
  }
10144
- }, Sd = xd;
10145
- function Cd(e, t) {
10157
+ }, Td = wd;
10158
+ function Ed(e, t) {
10146
10159
  let { selection: n } = e, { $from: r } = n;
10147
10160
  if (n instanceof A) {
10148
10161
  let e = r.index();
@@ -10156,10 +10169,10 @@ function Cd(e, t) {
10156
10169
  }
10157
10170
  return !1;
10158
10171
  }
10159
- function wd(e) {
10172
+ function Dd(e) {
10160
10173
  return e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
10161
10174
  }
10162
- function Td(e, t) {
10175
+ function Od(e, t) {
10163
10176
  let n = e.getAttribute("style");
10164
10177
  if (!n) return null;
10165
10178
  let r = n.split(";").map((e) => e.trim()).filter(Boolean), i = t.toLowerCase();
@@ -10169,29 +10182,29 @@ function Td(e, t) {
10169
10182
  }
10170
10183
  return null;
10171
10184
  }
10172
- function Ed(e) {
10185
+ function kd(e) {
10173
10186
  return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&amp;/g, "&");
10174
10187
  }
10175
- function Dd(e) {
10188
+ function Ad(e) {
10176
10189
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
10177
10190
  }
10178
- function Od() {
10191
+ function jd() {
10179
10192
  return typeof navigator < "u" ? /Firefox/.test(navigator.userAgent) : !1;
10180
10193
  }
10181
- function kd(e) {
10194
+ function Md(e) {
10182
10195
  return typeof e == "string";
10183
10196
  }
10184
- var Ad = {};
10185
- qs(Ad, {
10186
- createAtomBlockMarkdownSpec: () => Nd,
10187
- createBlockMarkdownSpec: () => Pd,
10188
- createInlineMarkdownSpec: () => Ld,
10189
- parseAttributes: () => jd,
10190
- parseIndentedBlocks: () => Rd,
10191
- renderNestedMarkdownContent: () => zd,
10192
- serializeAttributes: () => Md
10197
+ var Nd = {};
10198
+ qs(Nd, {
10199
+ createAtomBlockMarkdownSpec: () => Id,
10200
+ createBlockMarkdownSpec: () => Ld,
10201
+ createInlineMarkdownSpec: () => Bd,
10202
+ parseAttributes: () => Pd,
10203
+ parseIndentedBlocks: () => Vd,
10204
+ renderNestedMarkdownContent: () => Hd,
10205
+ serializeAttributes: () => Fd
10193
10206
  });
10194
- function jd(e) {
10207
+ function Pd(e) {
10195
10208
  if (!e?.trim()) return {};
10196
10209
  let t = {}, n = [], r = e.replace(/["']([^"']*)["']/g, (e) => (n.push(e), `__QUOTED_${n.length - 1}__`)), i = r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);
10197
10210
  i && (t.class = i.map((e) => e.trim().slice(1)).join(" "));
@@ -10205,15 +10218,15 @@ function jd(e) {
10205
10218
  e.match(/^[a-zA-Z][\w-]*$/) && (t[e] = !0);
10206
10219
  }), t;
10207
10220
  }
10208
- function Md(e) {
10221
+ function Fd(e) {
10209
10222
  if (!e || Object.keys(e).length === 0) return "";
10210
10223
  let t = [];
10211
10224
  return e.class && String(e.class).split(/\s+/).filter(Boolean).forEach((e) => t.push(`.${e}`)), e.id && t.push(`#${e.id}`), Object.entries(e).forEach(([e, n]) => {
10212
10225
  e === "class" || e === "id" || (n === !0 ? t.push(e) : n !== !1 && n != null && t.push(`${e}="${String(n)}"`));
10213
10226
  }), t.join(" ");
10214
10227
  }
10215
- function Nd(e) {
10216
- let { nodeName: t, name: n, parseAttributes: r = jd, serializeAttributes: i = Md, defaultAttributes: a = {}, requiredAttributes: o = [], allowedAttributes: s } = e, c = n || t, l = (e) => {
10228
+ function Id(e) {
10229
+ let { nodeName: t, name: n, parseAttributes: r = Pd, serializeAttributes: i = Fd, defaultAttributes: a = {}, requiredAttributes: o = [], allowedAttributes: s } = e, c = n || t, l = (e) => {
10217
10230
  if (!s) return e;
10218
10231
  let t = {};
10219
10232
  return s.forEach((n) => {
@@ -10252,8 +10265,8 @@ function Nd(e) {
10252
10265
  }
10253
10266
  };
10254
10267
  }
10255
- function Pd(e) {
10256
- let { nodeName: t, name: n, getContent: r, parseAttributes: i = jd, serializeAttributes: a = Md, defaultAttributes: o = {}, content: s = "block", allowedAttributes: c } = e, l = n || t, u = (e) => {
10268
+ function Ld(e) {
10269
+ let { nodeName: t, name: n, getContent: r, parseAttributes: i = Pd, serializeAttributes: a = Fd, defaultAttributes: o = {}, content: s = "block", allowedAttributes: c } = e, l = n || t, u = (e) => {
10257
10270
  if (!c) return e;
10258
10271
  let t = {};
10259
10272
  return c.forEach((n) => {
@@ -10327,7 +10340,7 @@ ${t.renderChildren(e.content || [], "\n\n")}
10327
10340
  }
10328
10341
  };
10329
10342
  }
10330
- function Fd(e) {
10343
+ function Rd(e) {
10331
10344
  if (!e.trim()) return {};
10332
10345
  let t = {}, n = /(\w+)=(?:"([^"]*)"|'([^']*)')/g, r = n.exec(e);
10333
10346
  for (; r !== null;) {
@@ -10336,11 +10349,11 @@ function Fd(e) {
10336
10349
  }
10337
10350
  return t;
10338
10351
  }
10339
- function Id(e) {
10352
+ function zd(e) {
10340
10353
  return Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => `${e}="${t}"`).join(" ");
10341
10354
  }
10342
- function Ld(e) {
10343
- let { nodeName: t, name: n, getContent: r, parseAttributes: i = Fd, serializeAttributes: a = Id, defaultAttributes: o = {}, selfClosing: s = !1, allowedAttributes: c } = e, l = n || t, u = (e) => {
10355
+ function Bd(e) {
10356
+ let { nodeName: t, name: n, getContent: r, parseAttributes: i = Rd, serializeAttributes: a = zd, defaultAttributes: o = {}, selfClosing: s = !1, allowedAttributes: c } = e, l = n || t, u = (e) => {
10344
10357
  if (!c) return e;
10345
10358
  let t = {};
10346
10359
  return c.forEach((n) => {
@@ -10397,7 +10410,7 @@ function Ld(e) {
10397
10410
  }
10398
10411
  };
10399
10412
  }
10400
- function Rd(e, t, n) {
10413
+ function Vd(e, t, n) {
10401
10414
  let r = e.split("\n"), i = [], a = "", o = 0, s = t.baseIndentSize || 2;
10402
10415
  for (; o < r.length;) {
10403
10416
  let e = r[o], c = e.match(t.itemPattern);
@@ -10441,7 +10454,7 @@ function Rd(e, t, n) {
10441
10454
  raw: a
10442
10455
  };
10443
10456
  }
10444
- function zd(e, t, n, r) {
10457
+ function Hd(e, t, n, r) {
10445
10458
  if (!e || !Array.isArray(e.content)) return "";
10446
10459
  let i = typeof n == "function" ? n(r) : n, [a, ...o] = e.content, s = `${i}${t.renderChildren([a])}`;
10447
10460
  return o && o.length > 0 && o.forEach((e, n) => {
@@ -10455,27 +10468,6 @@ ${n}`;
10455
10468
  }
10456
10469
  }), s;
10457
10470
  }
10458
- var Bd = /* @__PURE__ */ new WeakMap();
10459
- function Vd(e, t) {
10460
- let n = Bd.get(e);
10461
- if (!n) {
10462
- let t = {
10463
- callbacks: /* @__PURE__ */ new Set(),
10464
- rafId: null,
10465
- handler: () => {
10466
- t.rafId !== null && cancelAnimationFrame(t.rafId), t.rafId = requestAnimationFrame(() => {
10467
- t.rafId = null, t.callbacks.forEach((e) => e());
10468
- });
10469
- }
10470
- };
10471
- Bd.set(e, t), e.on("update", t.handler), n = t;
10472
- }
10473
- n.callbacks.add(t);
10474
- }
10475
- function Hd(e, t) {
10476
- let n = Bd.get(e);
10477
- n && (n.callbacks.delete(t), n.callbacks.size === 0 && (n.rafId !== null && cancelAnimationFrame(n.rafId), e.off("update", n.handler), Bd.delete(e)));
10478
- }
10479
10471
  function Ud(e, t, n = {}) {
10480
10472
  let { state: r } = t, { doc: i, tr: a } = r, o = e;
10481
10473
  i.descendants((t, r) => {
@@ -10510,9 +10502,9 @@ var Wd = class {
10510
10502
  Ud(t || this.mark, this.editor, e);
10511
10503
  }
10512
10504
  ignoreMutation(e) {
10513
- return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : e.type === "selection" || this.dom.contains(e.target) && e.type === "childList" && (yc() || vc()) && this.editor.isFocused && [...Array.from(e.addedNodes), ...Array.from(e.removedNodes)].every((e) => e.isContentEditable) ? !1 : this.contentDOM === e.target && e.type === "attributes" ? !0 : !this.contentDOM.contains(e.target);
10505
+ return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : e.type === "selection" || this.dom.contains(e.target) && e.type === "childList" && (Sc() || xc()) && this.editor.isFocused && [...Array.from(e.addedNodes), ...Array.from(e.removedNodes)].every((e) => e.isContentEditable) ? !1 : this.contentDOM === e.target && e.type === "attributes" ? !0 : !this.contentDOM.contains(e.target);
10514
10506
  }
10515
- }, Gd = class e extends Vu {
10507
+ }, Gd = class e extends Wu {
10516
10508
  constructor() {
10517
10509
  super(...arguments), this.type = "node";
10518
10510
  }
@@ -10597,7 +10589,7 @@ var Wd = class {
10597
10589
  return !(o || r || i || l || u || d || f && c);
10598
10590
  }
10599
10591
  ignoreMutation(e) {
10600
- return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : this.node.isLeaf || this.node.isAtom ? !0 : e.type === "selection" || this.dom.contains(e.target) && e.type === "childList" && (yc() || vc()) && this.editor.isFocused && [...Array.from(e.addedNodes), ...Array.from(e.removedNodes)].every((e) => e.isContentEditable) ? !1 : this.contentDOM === e.target && e.type === "attributes" ? !0 : !this.contentDOM.contains(e.target);
10592
+ return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : this.node.isLeaf || this.node.isAtom ? !0 : e.type === "selection" || this.dom.contains(e.target) && e.type === "childList" && (Sc() || xc()) && this.editor.isFocused && [...Array.from(e.addedNodes), ...Array.from(e.removedNodes)].every((e) => e.isContentEditable) ? !1 : this.contentDOM === e.target && e.type === "attributes" ? !0 : !this.contentDOM.contains(e.target);
10601
10593
  }
10602
10594
  updateAttributes(e) {
10603
10595
  this.editor.commands.command(({ tr: t }) => {
@@ -10619,7 +10611,7 @@ var Wd = class {
10619
10611
  }
10620
10612
  };
10621
10613
  function qd(e) {
10622
- return new Wu({
10614
+ return new qu({
10623
10615
  find: e.find,
10624
10616
  handler: ({ state: t, range: n, match: r, pasteEvent: i }) => {
10625
10617
  let a = Q(e.getAttributes, void 0, r, i);
@@ -10627,14 +10619,14 @@ function qd(e) {
10627
10619
  let { tr: o } = t, s = r[r.length - 1], c = r[0], l = n.to;
10628
10620
  if (s) {
10629
10621
  let i = c.search(/\S/), u = n.from + c.indexOf(s), d = u + s.length;
10630
- if (Hl(n.from, n.to, t.doc).filter((t) => t.mark.type.excluded.find((n) => n === e.type && n !== t.mark.type)).filter((e) => e.to > u).length) return null;
10622
+ if (Gl(n.from, n.to, t.doc).filter((t) => t.mark.type.excluded.find((n) => n === e.type && n !== t.mark.type)).filter((e) => e.to > u).length) return null;
10631
10623
  d < n.to && o.delete(d, n.to), u > n.from && o.delete(n.from + i, u), l = n.from + i + s.length, o.addMark(n.from + i, l, e.type.create(a || {})), r.index !== void 0 && r.input !== void 0 && r.index + r[0].length >= r.input.length || o.removeStoredMark(e.type);
10632
10624
  }
10633
10625
  }
10634
10626
  });
10635
10627
  }
10636
10628
  function Jd(e) {
10637
- return new Wu({
10629
+ return new qu({
10638
10630
  find: e.find,
10639
10631
  handler({ match: t, chain: n, range: r, pasteEvent: i }) {
10640
10632
  let a = Q(e.getAttributes, void 0, t, i), o = Q(e.getContent, void 0, a);
@@ -10648,7 +10640,7 @@ function Jd(e) {
10648
10640
  });
10649
10641
  }
10650
10642
  function Yd(e) {
10651
- return new Wu({
10643
+ return new qu({
10652
10644
  find: e.find,
10653
10645
  handler: ({ state: t, range: n, match: r }) => {
10654
10646
  let i = e.replace, a = n.from, o = n.to;
@@ -10678,4 +10670,4 @@ var Xd = class {
10678
10670
  }
10679
10671
  };
10680
10672
  //#endregion
10681
- export { il as $, Rd as $t, Ed as A, Rc as At, ul as B, kd as Bt, Pd as C, O as Cn, Yl as Ct, iu as D, r as Dn, Od as Dt, Ld as E, Ut as En, Zl as Et, wd as F, tu as Ft, jl as G, Ad as Gt, dl as H, yc as Ht, Zu as I, Uu as It, gl as J, X as Jt, Fl as K, yl as Kt, sl as L, zu as Lt, qc as M, Vc as Mt, Tc as N, $l as Nt, Ec as O, l as On, pl as Ot, Dd as P, eu as Pt, fl as Q, jd as Qt, cl as R, lc as Rt, Nd as S, jn as Sn, vc as St, nl as T, ft as Tn, ml as Tt, xl as U, pd as Ut, ll as V, gc as Vt, Al as W, qd as Wt, Vl as X, Jd as Xt, Bl as Y, md as Yt, Z, uc as Zt, Q as _, Gs as _n, ru as _t, vd as a, _c as an, J as at, al as b, A as bn, Lu as bt, Hu as c, Dc as cn, Tl as ct, ld as d, hl as dn, Gl as dt, Yu as en, pc as et, Kd as f, gd as fn, Td as ft, Xd as g, _d as gn, Pl as gt, Sd as h, Ud as hn, Kl as ht, $ as i, Ol as in, Il as it, ol as j, ql as jt, dd as k, Ql as kt, Wd as l, Md as ln, Wl as lt, xd as m, hd as mn, Ml as mt, fd as n, Rl as nn, Hl as nt, Pu as o, su as on, bl as ot, Wu as p, Yd as pn, Nl as pt, Ll as q, Bu as qt, Vu as r, zd as rn, Ul as rt, nu as s, Vd as sn, kl as st, Ys as t, au as tn, Y as tt, Gd as u, Dl as un, Kc as ut, Cd as v, Uo as vn, yd as vt, Js as w, k as wn, Xl as wt, Xs as x, M as xn, Jl as xt, Hd as y, G as yn, Sl as yt, El as z, bc as zt };
10673
+ export { gc as $, Qu as $t, ll as A, Xl as At, fl as B, yc as Bt, Js as C, ft as Cn, $l as Ct, kc as D, gl as Dt, su as E, l as En, jd as Et, ed as F, Ku as Ft, Rl as G, Sl as Gt, wl as H, gd as Ht, ul as I, Hu as It, Ul as J, _d as Jt, Bl as K, Uu as Kt, dl as L, fc as Lt, Oc as M, nu as Mt, Ad as N, ru as Nt, md as O, tu as Ot, Dd as P, iu as Pt, sl as Q, Vd as Qt, kl as R, Cc as Rt, Ld as S, k as Sn, Ql as St, Bd as T, r as Tn, eu as Tt, Nl as U, qd as Ut, ml as V, Sc as Vt, Pl as W, Nd as Wt, Z as X, pc as Xt, Wl as Y, Jd as Yt, hl as Z, Pd as Zt, Q as _, G as _n, Sd as _t, xd as a, uu as an, Cl as at, Xs as b, jn as bn, Zl as bt, Gu as c, Al as cn, ql as ct, fd as d, Yd as dn, Od as dt, cu as en, Y as et, Kd as f, vd as fn, Il as ft, Xd as g, Uo as gn, ou as gt, Td as h, Gs as hn, Ll as ht, $ as i, bc as in, J as it, Xc as j, Wc as jt, kd as k, Vc as kt, Wd as l, vl as ln, Yc as lt, wd as m, bd as mn, Yl as mt, hd as n, Hd as nn, Kl as nt, Lu as o, Ac as on, Ml as ot, qu as p, Ud as pn, Fl as pt, yl as q, X as qt, Wu as r, jl as rn, zl as rt, au as s, Fd as sn, Ol as st, Ys as t, Vl as tn, Gl as tt, Gd as u, yd as un, Jl as ut, Ed as v, A as vn, Tl as vt, al as w, Ut as wn, _l as wt, Id as x, O as xn, xc as xt, cl as y, M as yn, Bu as yt, pl as z, Md as zt };