@notectl/core 1.7.1 → 1.7.3

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 (182) hide show
  1. package/dist/chunks/{AttrRegistry-Ci0qAvtS.mjs → AttrRegistry-D9Jx_RVb.mjs} +2 -2
  2. package/dist/chunks/{AttrRegistry-Ci0qAvtS.mjs.map → AttrRegistry-D9Jx_RVb.mjs.map} +1 -1
  3. package/dist/chunks/AttributedMarkCommands-BtLea72z.mjs +80 -0
  4. package/dist/chunks/AttributedMarkCommands-BtLea72z.mjs.map +1 -0
  5. package/dist/chunks/{CaretNavigation-qLfeL0So.mjs → CaretNavigation-7JYpIKbs.mjs} +3 -3
  6. package/dist/chunks/{CaretNavigation-qLfeL0So.mjs.map → CaretNavigation-7JYpIKbs.mjs.map} +1 -1
  7. package/dist/chunks/{ColorGrid-BBkN0AOb.mjs → ColorGrid--lBQ7jCK.mjs} +56 -55
  8. package/dist/chunks/ColorGrid--lBQ7jCK.mjs.map +1 -0
  9. package/dist/chunks/{ColorPickerPopup-D3ysvOH-.mjs → ColorPickerPopup-TpIRlXc8.mjs} +15 -15
  10. package/dist/chunks/ColorPickerPopup-TpIRlXc8.mjs.map +1 -0
  11. package/dist/chunks/{Document-DfZ1NOjs.mjs → Document-Brtw2jL1.mjs} +6 -6
  12. package/dist/chunks/Document-Brtw2jL1.mjs.map +1 -0
  13. package/dist/chunks/{MarkCommands-uybmkw9l.mjs → MarkCommands-6RUJ4L3r.mjs} +3 -3
  14. package/dist/chunks/MarkCommands-6RUJ4L3r.mjs.map +1 -0
  15. package/dist/chunks/{NodeResolver-CzLmmrph.mjs → NodeResolver-C2XYkeOi.mjs} +2 -2
  16. package/dist/chunks/{NodeResolver-CzLmmrph.mjs.map → NodeResolver-C2XYkeOi.mjs.map} +1 -1
  17. package/dist/chunks/NodeSpec-NZVvcCuH.mjs.map +1 -1
  18. package/dist/chunks/PopupPositioning-CgjgAKjp.mjs +34 -0
  19. package/dist/chunks/PopupPositioning-CgjgAKjp.mjs.map +1 -0
  20. package/dist/chunks/RangeIterator-Bh4Vl_6D.mjs +16 -0
  21. package/dist/chunks/{RangeIterator-Bye0UtbY.mjs.map → RangeIterator-Bh4Vl_6D.mjs.map} +1 -1
  22. package/dist/chunks/StyleRuntime-CP4NCwKT.mjs +235 -0
  23. package/dist/chunks/StyleRuntime-CP4NCwKT.mjs.map +1 -0
  24. package/dist/chunks/ToolbarItem-BpZggUGo.mjs.map +1 -1
  25. package/dist/chunks/{index-Bt_d4IqB.mjs → index--7pBhSF4.mjs} +74 -73
  26. package/dist/chunks/index--7pBhSF4.mjs.map +1 -0
  27. package/dist/chunks/{index-DayTn6Re.mjs → index-BXCkjDax.mjs} +78 -83
  28. package/dist/chunks/index-BXCkjDax.mjs.map +1 -0
  29. package/dist/chunks/{index-DGKQhSAl.mjs → index-BXtw5PNN.mjs} +2 -2
  30. package/dist/chunks/{index-DGKQhSAl.mjs.map → index-BXtw5PNN.mjs.map} +1 -1
  31. package/dist/chunks/{ToolbarPlugin-B7oJRzpl.mjs → index-BcDRT4K2.mjs} +110 -121
  32. package/dist/chunks/index-BcDRT4K2.mjs.map +1 -0
  33. package/dist/chunks/{index-DoCvDkfj.mjs → index-BjFBWBOC.mjs} +23 -25
  34. package/dist/chunks/index-BjFBWBOC.mjs.map +1 -0
  35. package/dist/chunks/{index-CrKz_IEn.mjs → index-C1opJocO.mjs} +2 -2
  36. package/dist/chunks/{index-CrKz_IEn.mjs.map → index-C1opJocO.mjs.map} +1 -1
  37. package/dist/chunks/{index-CfyS_pgH.mjs → index-CCyqQ0Dz.mjs} +32 -31
  38. package/dist/chunks/index-CCyqQ0Dz.mjs.map +1 -0
  39. package/dist/chunks/{index-E7OgN7hM.mjs → index-Cd3uJLP3.mjs} +2 -2
  40. package/dist/chunks/{index-E7OgN7hM.mjs.map → index-Cd3uJLP3.mjs.map} +1 -1
  41. package/dist/chunks/{index-yhz2qeeh.mjs → index-DSAuGP4n.mjs} +131 -127
  42. package/dist/chunks/index-DSAuGP4n.mjs.map +1 -0
  43. package/dist/chunks/{index-CH1r7DL-.mjs → index-DtRfqsq5.mjs} +211 -210
  44. package/dist/chunks/index-DtRfqsq5.mjs.map +1 -0
  45. package/dist/chunks/{index-CFPP456m.mjs → index-DxbQirny.mjs} +8 -8
  46. package/dist/chunks/{index-CFPP456m.mjs.map → index-DxbQirny.mjs.map} +1 -1
  47. package/dist/chunks/{index-DuRNETFv.mjs → index-ErZ5_a1o.mjs} +3 -3
  48. package/dist/chunks/{index-DuRNETFv.mjs.map → index-ErZ5_a1o.mjs.map} +1 -1
  49. package/dist/chunks/{index-Deag_lVi.mjs → index-WpbK_s_H.mjs} +29 -31
  50. package/dist/chunks/index-WpbK_s_H.mjs.map +1 -0
  51. package/dist/chunks/{index-DIvHQtE2.mjs → index-WrqH1wG8.mjs} +15 -14
  52. package/dist/chunks/index-WrqH1wG8.mjs.map +1 -0
  53. package/dist/chunks/{index-Dy6SllXW.mjs → index-fsVJLutn.mjs} +3 -3
  54. package/dist/chunks/{index-Dy6SllXW.mjs.map → index-fsVJLutn.mjs.map} +1 -1
  55. package/dist/chunks/{index-Ckzqtn5D.mjs → index-fx3KIap3.mjs} +15 -14
  56. package/dist/chunks/index-fx3KIap3.mjs.map +1 -0
  57. package/dist/chunks/{index-DmuuFS5D.mjs → index-oOJo-ywB.mjs} +4 -4
  58. package/dist/chunks/{index-DmuuFS5D.mjs.map → index-oOJo-ywB.mjs.map} +1 -1
  59. package/dist/chunks/{index-CFJFD4lF.mjs → index-toj88jtL.mjs} +19 -18
  60. package/dist/chunks/index-toj88jtL.mjs.map +1 -0
  61. package/dist/commands/AttributedMarkCommands.d.ts.map +1 -1
  62. package/dist/commands/MarkCommands.d.ts +3 -3
  63. package/dist/commands/MarkCommands.d.ts.map +1 -1
  64. package/dist/editor/CSSClassCollector.d.ts +36 -0
  65. package/dist/editor/CSSClassCollector.d.ts.map +1 -0
  66. package/dist/editor/ContentHTMLTypes.d.ts +29 -0
  67. package/dist/editor/ContentHTMLTypes.d.ts.map +1 -0
  68. package/dist/editor/ContentStyleInjector.d.ts +69 -0
  69. package/dist/editor/ContentStyleInjector.d.ts.map +1 -0
  70. package/dist/editor/DocumentParser.d.ts +9 -1
  71. package/dist/editor/DocumentParser.d.ts.map +1 -1
  72. package/dist/editor/DocumentSerializer.d.ts +6 -0
  73. package/dist/editor/DocumentSerializer.d.ts.map +1 -1
  74. package/dist/editor/EditorThemeController.d.ts +3 -0
  75. package/dist/editor/EditorThemeController.d.ts.map +1 -1
  76. package/dist/editor/MarkSerializer.d.ts +7 -0
  77. package/dist/editor/MarkSerializer.d.ts.map +1 -1
  78. package/dist/editor/NotectlEditor.d.ts +13 -3
  79. package/dist/editor/NotectlEditor.d.ts.map +1 -1
  80. package/dist/editor/PaperLayoutController.d.ts.map +1 -1
  81. package/dist/editor/styles/font-select.d.ts +1 -1
  82. package/dist/editor/styles/font-select.d.ts.map +1 -1
  83. package/dist/editor/styles/font-size-select.d.ts +1 -1
  84. package/dist/editor/styles/font-size-select.d.ts.map +1 -1
  85. package/dist/editor/styles/heading-select.d.ts +1 -1
  86. package/dist/editor/styles/heading-select.d.ts.map +1 -1
  87. package/dist/editor/styles/toolbar.d.ts +1 -1
  88. package/dist/editor/styles/toolbar.d.ts.map +1 -1
  89. package/dist/index.d.ts +10 -12
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/input/LegacyHTMLNormalizer.d.ts.map +1 -1
  92. package/dist/model/Document.d.ts +0 -4
  93. package/dist/model/Document.d.ts.map +1 -1
  94. package/dist/model/NodeSpec.d.ts +19 -2
  95. package/dist/model/NodeSpec.d.ts.map +1 -1
  96. package/dist/notectl-core.mjs +613 -477
  97. package/dist/notectl-core.mjs.map +1 -1
  98. package/dist/notectl-core.umd.js +1571 -1225
  99. package/dist/notectl-core.umd.js.map +1 -1
  100. package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -1
  101. package/dist/plugins/alignment.mjs +1 -1
  102. package/dist/plugins/caret-navigation.mjs +1 -1
  103. package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -1
  104. package/dist/plugins/code-block/CodeBlockPlugin.d.ts +0 -1
  105. package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
  106. package/dist/plugins/code-block/index.d.ts +2 -1
  107. package/dist/plugins/code-block/index.d.ts.map +1 -1
  108. package/dist/plugins/code-block.mjs +1 -1
  109. package/dist/plugins/font/FontPlugin.d.ts +0 -1
  110. package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
  111. package/dist/plugins/font-size/FontSizePlugin.d.ts +0 -2
  112. package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
  113. package/dist/plugins/font-size/FontSizePopup.d.ts +3 -1
  114. package/dist/plugins/font-size/FontSizePopup.d.ts.map +1 -1
  115. package/dist/plugins/font-size.mjs +1 -1
  116. package/dist/plugins/font.mjs +1 -1
  117. package/dist/plugins/gap-cursor.mjs +6 -6
  118. package/dist/plugins/hard-break.mjs +1 -1
  119. package/dist/plugins/heading/HeadingBlockTypePicker.d.ts.map +1 -1
  120. package/dist/plugins/heading.mjs +1 -1
  121. package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -1
  122. package/dist/plugins/highlight.mjs +1 -1
  123. package/dist/plugins/horizontal-rule.mjs +1 -1
  124. package/dist/plugins/image/ImageNodeView.d.ts.map +1 -1
  125. package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
  126. package/dist/plugins/image.mjs +1 -1
  127. package/dist/plugins/link.mjs +1 -1
  128. package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
  129. package/dist/plugins/list.mjs +1 -1
  130. package/dist/plugins/print/PrintContentPreparer.d.ts.map +1 -1
  131. package/dist/plugins/shared/ColorGrid.d.ts.map +1 -1
  132. package/dist/plugins/shared/ColorPickerPopup.d.ts +2 -1
  133. package/dist/plugins/shared/ColorPickerPopup.d.ts.map +1 -1
  134. package/dist/plugins/shared/PopupManager.d.ts +12 -2
  135. package/dist/plugins/shared/PopupManager.d.ts.map +1 -1
  136. package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -1
  137. package/dist/plugins/strikethrough.mjs +1 -1
  138. package/dist/plugins/super-sub.mjs +1 -1
  139. package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
  140. package/dist/plugins/table/TableControls.d.ts.map +1 -1
  141. package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -1
  142. package/dist/plugins/table/TableControlsLayout.d.ts.map +1 -1
  143. package/dist/plugins/table/TableNodeViews.d.ts.map +1 -1
  144. package/dist/plugins/table/TablePlugin.d.ts.map +1 -1
  145. package/dist/plugins/table.mjs +1 -1
  146. package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
  147. package/dist/plugins/text-color.mjs +1 -1
  148. package/dist/plugins/text-formatting.mjs +1 -1
  149. package/dist/plugins/toolbar/ToolbarItem.d.ts +3 -2
  150. package/dist/plugins/toolbar/ToolbarItem.d.ts.map +1 -1
  151. package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
  152. package/dist/plugins/toolbar/ToolbarPopupController.d.ts +0 -3
  153. package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -1
  154. package/dist/plugins/toolbar/ToolbarRenderers.d.ts.map +1 -1
  155. package/dist/plugins/toolbar/ToolbarTooltip.d.ts.map +1 -1
  156. package/dist/plugins/toolbar.mjs +2 -2
  157. package/dist/presets/PresetTypes.d.ts +1 -1
  158. package/dist/presets/PresetTypes.d.ts.map +1 -1
  159. package/dist/style/StyleRuntime.d.ts +34 -0
  160. package/dist/style/StyleRuntime.d.ts.map +1 -0
  161. package/dist/view/Reconciler.d.ts.map +1 -1
  162. package/package.json +1 -1
  163. package/dist/chunks/AttributedMarkCommands-BETuHXj8.mjs +0 -58
  164. package/dist/chunks/AttributedMarkCommands-BETuHXj8.mjs.map +0 -1
  165. package/dist/chunks/ColorGrid-BBkN0AOb.mjs.map +0 -1
  166. package/dist/chunks/ColorPickerPopup-D3ysvOH-.mjs.map +0 -1
  167. package/dist/chunks/Document-DfZ1NOjs.mjs.map +0 -1
  168. package/dist/chunks/MarkCommands-uybmkw9l.mjs.map +0 -1
  169. package/dist/chunks/PopupPositioning-Cn6L_mO2.mjs +0 -30
  170. package/dist/chunks/PopupPositioning-Cn6L_mO2.mjs.map +0 -1
  171. package/dist/chunks/RangeIterator-Bye0UtbY.mjs +0 -16
  172. package/dist/chunks/ToolbarPlugin-B7oJRzpl.mjs.map +0 -1
  173. package/dist/chunks/index-Bt_d4IqB.mjs.map +0 -1
  174. package/dist/chunks/index-CFJFD4lF.mjs.map +0 -1
  175. package/dist/chunks/index-CH1r7DL-.mjs.map +0 -1
  176. package/dist/chunks/index-CfyS_pgH.mjs.map +0 -1
  177. package/dist/chunks/index-Ckzqtn5D.mjs.map +0 -1
  178. package/dist/chunks/index-DIvHQtE2.mjs.map +0 -1
  179. package/dist/chunks/index-DayTn6Re.mjs.map +0 -1
  180. package/dist/chunks/index-Deag_lVi.mjs.map +0 -1
  181. package/dist/chunks/index-DoCvDkfj.mjs.map +0 -1
  182. package/dist/chunks/index-yhz2qeeh.mjs.map +0 -1
@@ -1,70 +1,71 @@
1
- import { b as S, i as C, f as T, d as R, j as L, r as M, c as I, n as N, a as O, k as _, l as H, m as $, g as K, e as U, o as W, p as V, q as J, s as Q, t as X, u as Y } from "./chunks/Document-DfZ1NOjs.mjs";
2
- import { v, w, h } from "./chunks/Document-DfZ1NOjs.mjs";
3
- import { f as Z, a as ee, C as te, b as ne } from "./chunks/index-DmuuFS5D.mjs";
4
- import { e, c, d, g, h as h2, i, j, k, l, m, n, o, p, q, r, s, t, u, v as v2, w as w2, x, y, z, A, B, D, E, F, G } from "./chunks/index-DmuuFS5D.mjs";
1
+ import { d as S, b as C, f as T, i as R, j as L, r as M, a as I, n as N, c as O, k as _, l as H, m as $, g as K, e as U, o as W, p as V, q as J, s as Q, t as X, u as Y } from "./chunks/Document-Brtw2jL1.mjs";
2
+ import { v, w, h } from "./chunks/Document-Brtw2jL1.mjs";
3
+ import { f as Z, a as ee, C as te, b as ne } from "./chunks/index-oOJo-ywB.mjs";
4
+ import { e, c, d, g, h as h2, i, j, k, l, m, n, o, p, q, r, s, t, u, v as v2, w as w2, x, y, z, A, B, D, E, F, G } from "./chunks/index-oOJo-ywB.mjs";
5
5
  import { e as se, d as re, i as ie, a as oe, c as ae, f as ce, b as le, g as he, h as de, s as ue } from "./chunks/Selection-BRTab5hO.mjs";
6
6
  import { j as j2, k as k2 } from "./chunks/Selection-BRTab5hO.mjs";
7
- import { d as pe, i as fe, a as ge, s as me } from "./chunks/MarkCommands-uybmkw9l.mjs";
8
- import { b, t as t2, c as c2, e as e2, f } from "./chunks/MarkCommands-uybmkw9l.mjs";
9
- import { b as ye, n as ke, i as ve, m as be } from "./chunks/TypeBrands-C09nE2qO.mjs";
7
+ import { d as pe, i as fe, a as ge, s as me } from "./chunks/MarkCommands-6RUJ4L3r.mjs";
8
+ import { b, t as t2, c as c2, e as e2, f } from "./chunks/MarkCommands-6RUJ4L3r.mjs";
9
+ import { b as ye, n as ke, i as be, m as ve } from "./chunks/TypeBrands-C09nE2qO.mjs";
10
10
  import { c as c3, p as p2 } from "./chunks/TypeBrands-C09nE2qO.mjs";
11
- import { a as we } from "./chunks/AttrRegistry-Ci0qAvtS.mjs";
12
- import { b as b2, i as i2 } from "./chunks/AttrRegistry-Ci0qAvtS.mjs";
13
- import { c as Se } from "./chunks/NodeSpec-NZVvcCuH.mjs";
11
+ import { a as Se } from "./chunks/AttrRegistry-D9Jx_RVb.mjs";
12
+ import { b as b2, i as i2 } from "./chunks/AttrRegistry-D9Jx_RVb.mjs";
13
+ import { c as we } from "./chunks/NodeSpec-NZVvcCuH.mjs";
14
14
  import { e as Ee, f as xe } from "./chunks/HTMLUtils-DTqQzcKR.mjs";
15
- import { a as Ce, r as Te, f as Ae } from "./chunks/NodeResolver-CzLmmrph.mjs";
16
- import { b as b3, c as c4, w as w3 } from "./chunks/NodeResolver-CzLmmrph.mjs";
17
- import { n as Re, g as Le, s as Me, r as Ie, d as Ne, a as Be, b as Oe, e as Pe, c as _e, f as De, h as He } from "./chunks/CaretNavigation-qLfeL0So.mjs";
18
- import { i as i3, m as m2, j as j3 } from "./chunks/CaretNavigation-qLfeL0So.mjs";
19
- import { d as ze, a as je, m as $e, b as Ke, s as Fe, n as Ue, c as We, e as Ve, f as Ge, i as qe, g as Je, h as Qe, r as Xe, H as Ye } from "./chunks/index-DuRNETFv.mjs";
15
+ import { a as Ce, r as Te, f as Ae } from "./chunks/NodeResolver-C2XYkeOi.mjs";
16
+ import { b as b3, c as c4, w as w3 } from "./chunks/NodeResolver-C2XYkeOi.mjs";
17
+ import { n as Re, g as Le, s as Me, r as Ie, d as Ne, a as Be, b as Oe, e as _e, c as De, f as Pe, h as He } from "./chunks/CaretNavigation-7JYpIKbs.mjs";
18
+ import { i as i3, m as m2, j as j3 } from "./chunks/CaretNavigation-7JYpIKbs.mjs";
19
+ import { d as ze, a as je, m as $e, b as Ke, s as Fe, n as Ue, c as We, e as Ve, f as Ge, i as qe, g as Je, h as Qe, r as Xe, H as Ye } from "./chunks/index-ErZ5_a1o.mjs";
20
20
  import { g as Ze } from "./chunks/Platform-S_xqIqcM.mjs";
21
21
  import { a, i as i4, b as b4 } from "./chunks/Platform-S_xqIqcM.mjs";
22
22
  import { E as et, S as tt, r as nt, L as st, a as rt } from "./chunks/resolvePluginLocale-B4w1OkPy.mjs";
23
- import { T as it } from "./chunks/ToolbarPlugin-B7oJRzpl.mjs";
24
- import { P, b as b5, c as c5, d as d2, e as e3, a as a2 } from "./chunks/ToolbarPlugin-B7oJRzpl.mjs";
23
+ import { T as it } from "./chunks/index-BcDRT4K2.mjs";
24
+ import { P, a as a2, b as b5, c as c5, d as d2, e as e3 } from "./chunks/index-BcDRT4K2.mjs";
25
25
  import { n as ot, a as at, f as ct } from "./chunks/ToolbarKeyboardNav-DhpL8zNV.mjs";
26
- import { a as a3, p as p3 } from "./chunks/PopupPositioning-Cn6L_mO2.mjs";
27
- import { r as r2 } from "./chunks/ColorGrid-BBkN0AOb.mjs";
28
- import { D as lt, d as ht, C as dt } from "./chunks/index-Bt_d4IqB.mjs";
29
- import { a as a4, b as b6, c as c6, i as i5, n as n2, w as w4 } from "./chunks/index-Bt_d4IqB.mjs";
26
+ import { a as a3, p as p3 } from "./chunks/PopupPositioning-CgjgAKjp.mjs";
27
+ import { r as r2 } from "./chunks/ColorGrid--lBQ7jCK.mjs";
28
+ import { D as lt, d as ht, C as dt } from "./chunks/index--7pBhSF4.mjs";
29
+ import { a as a4, b as b6, c as c6, i as i5, n as n2, w as w4 } from "./chunks/index--7pBhSF4.mjs";
30
30
  import { f as ut } from "./chunks/ToolbarItem-BpZggUGo.mjs";
31
- import { T as pt } from "./chunks/index-E7OgN7hM.mjs";
32
- import { a as a5, b as b7 } from "./chunks/index-E7OgN7hM.mjs";
33
- import { H as ft } from "./chunks/index-DoCvDkfj.mjs";
34
- import { a as a6, b as b8 } from "./chunks/index-DoCvDkfj.mjs";
35
- import { L as gt } from "./chunks/index-Dy6SllXW.mjs";
36
- import { a as a7, b as b9 } from "./chunks/index-Dy6SllXW.mjs";
37
- import { L as mt } from "./chunks/index-CfyS_pgH.mjs";
38
- import { a as a8, b as b10 } from "./chunks/index-CfyS_pgH.mjs";
31
+ import { T as pt } from "./chunks/index-Cd3uJLP3.mjs";
32
+ import { a as a5, b as b7 } from "./chunks/index-Cd3uJLP3.mjs";
33
+ import { H as ft } from "./chunks/index-BjFBWBOC.mjs";
34
+ import { a as a6, b as b8 } from "./chunks/index-BjFBWBOC.mjs";
35
+ import { L as gt } from "./chunks/index-fsVJLutn.mjs";
36
+ import { a as a7, b as b9 } from "./chunks/index-fsVJLutn.mjs";
37
+ import { L as mt } from "./chunks/index-CCyqQ0Dz.mjs";
38
+ import { a as a8, b as b10 } from "./chunks/index-CCyqQ0Dz.mjs";
39
39
  import { B as yt } from "./chunks/index-Dum8yE_t.mjs";
40
40
  import { a as a9, b as b11 } from "./chunks/index-Dum8yE_t.mjs";
41
- import { S as kt } from "./chunks/index-DGKQhSAl.mjs";
42
- import { a as a10, b as b12 } from "./chunks/index-DGKQhSAl.mjs";
43
- import { T as vt } from "./chunks/index-Ckzqtn5D.mjs";
44
- import { a as a11, b as b13 } from "./chunks/index-Ckzqtn5D.mjs";
45
- import { H as bt } from "./chunks/index-CFPP456m.mjs";
46
- import { a as a12, b as b14 } from "./chunks/index-CFPP456m.mjs";
47
- import { A as wt } from "./chunks/index-CFJFD4lF.mjs";
48
- import { a as a13, b as b15, c as c7, d as d3 } from "./chunks/index-CFJFD4lF.mjs";
49
- import { F as St } from "./chunks/index-Deag_lVi.mjs";
50
- import { a as a14, b as b16 } from "./chunks/index-Deag_lVi.mjs";
51
- import { F as Et } from "./chunks/index-DayTn6Re.mjs";
52
- import { a as a15, b as b17 } from "./chunks/index-DayTn6Re.mjs";
53
- import { T as xt } from "./chunks/index-CH1r7DL-.mjs";
54
- import { a as a16, b as b18, c as c8, d as d4, e as e4, f as f2, g as g2, h as h3, i as i6, j as j4, k as k3, l as l2 } from "./chunks/index-CH1r7DL-.mjs";
55
- import { H as Ct } from "./chunks/index-DIvHQtE2.mjs";
56
- import { a as a17, b as b19 } from "./chunks/index-DIvHQtE2.mjs";
57
- import { S as Tt } from "./chunks/index-CrKz_IEn.mjs";
58
- import { a as a18, b as b20 } from "./chunks/index-CrKz_IEn.mjs";
59
- import { I as At } from "./chunks/index-yhz2qeeh.mjs";
60
- import { D as D2, a as a19, b as b21, c as c9 } from "./chunks/index-yhz2qeeh.mjs";
41
+ import { S as kt } from "./chunks/index-BXtw5PNN.mjs";
42
+ import { a as a10, b as b12 } from "./chunks/index-BXtw5PNN.mjs";
43
+ import { T as bt } from "./chunks/index-fx3KIap3.mjs";
44
+ import { a as a11, b as b13 } from "./chunks/index-fx3KIap3.mjs";
45
+ import { H as vt } from "./chunks/index-DxbQirny.mjs";
46
+ import { a as a12, b as b14 } from "./chunks/index-DxbQirny.mjs";
47
+ import { A as St } from "./chunks/index-toj88jtL.mjs";
48
+ import { a as a13, b as b15, c as c7, d as d3 } from "./chunks/index-toj88jtL.mjs";
49
+ import { F as wt } from "./chunks/index-WpbK_s_H.mjs";
50
+ import { a as a14, b as b16 } from "./chunks/index-WpbK_s_H.mjs";
51
+ import { F as Et } from "./chunks/index-BXCkjDax.mjs";
52
+ import { a as a15, b as b17 } from "./chunks/index-BXCkjDax.mjs";
53
+ import { T as xt } from "./chunks/index-DtRfqsq5.mjs";
54
+ import { a as a16, b as b18, c as c8, d as d4, e as e4, f as f2, g as g2, h as h3, i as i6, j as j4, k as k3, l as l2 } from "./chunks/index-DtRfqsq5.mjs";
55
+ import { H as Ct } from "./chunks/index-WrqH1wG8.mjs";
56
+ import { a as a17, b as b19 } from "./chunks/index-WrqH1wG8.mjs";
57
+ import { S as Tt } from "./chunks/index-C1opJocO.mjs";
58
+ import { a as a18, b as b20 } from "./chunks/index-C1opJocO.mjs";
59
+ import { I as At } from "./chunks/index-DSAuGP4n.mjs";
60
+ import { D as D2, a as a19, b as b21, c as c9 } from "./chunks/index-DSAuGP4n.mjs";
61
61
  import { GapCursorPlugin as Rt } from "./plugins/gap-cursor.mjs";
62
- import Lt from "dompurify";
63
- import { STARTER_FONTS as Mt } from "./fonts.mjs";
64
- import { a as a20, g as g3, i as i7, r as r3 } from "./chunks/AttributedMarkCommands-BETuHXj8.mjs";
62
+ import { s as Lt, b as Mt, c as It, a as Nt, u as Bt, d as Ot, r as _t } from "./chunks/StyleRuntime-CP4NCwKT.mjs";
63
+ import Dt from "dompurify";
64
+ import { STARTER_FONTS as Pt } from "./fonts.mjs";
65
+ import { a as a20, g as g3, i as i7, r as r3 } from "./chunks/AttributedMarkCommands-BtLea72z.mjs";
65
66
  import { c as c10, a as a21, b as b22, i as i8, s as s2 } from "./chunks/NavigationUtils-Cspt2ZrK.mjs";
66
- import { f as f3 } from "./chunks/RangeIterator-Bye0UtbY.mjs";
67
- class It {
67
+ import { f as f3 } from "./chunks/RangeIterator-Bh4Vl_6D.mjs";
68
+ class Ht {
68
69
  _nodeSpecs = /* @__PURE__ */ new Map();
69
70
  _markSpecs = /* @__PURE__ */ new Map();
70
71
  _inlineNodeSpecs = /* @__PURE__ */ new Map();
@@ -140,7 +141,7 @@ class It {
140
141
  this._nodeSpecs.clear(), this._markSpecs.clear(), this._inlineNodeSpecs.clear();
141
142
  }
142
143
  }
143
- function Nt(e5, t3, n3) {
144
+ function zt(e5, t3, n3) {
144
145
  const s3 = e5.getNodeSpec(t3);
145
146
  if (!s3?.content) return true;
146
147
  const r4 = e5.getNodeSpec(n3), i9 = r4?.group;
@@ -150,50 +151,50 @@ function Nt(e5, t3, n3) {
150
151
  }
151
152
  return false;
152
153
  }
153
- function Bt(e5, t3, n3) {
154
+ function jt(e5, t3, n3) {
154
155
  const s3 = e5.getNodeSpec(t3);
155
156
  if (!s3?.content) return true;
156
157
  const { min: r4 = 0, max: i9 = Number.POSITIVE_INFINITY } = s3.content, o2 = n3.filter((e6) => "text" !== e6);
157
158
  if (o2.length < r4 || o2.length > i9) return false;
158
- for (const n4 of o2) if (!Nt(e5, t3, n4)) return false;
159
+ for (const n4 of o2) if (!zt(e5, t3, n4)) return false;
159
160
  return true;
160
161
  }
161
- function Ot(e5) {
162
- e5.registerNodeSpec({ type: "paragraph", group: "block", content: { allow: ["text"] }, toDOM: (e6) => Se("p", e6.id), toHTML: (e6, t3) => `<p>${t3 || "<br>"}</p>`, parseHTML: [{ tag: "p" }, { tag: "div", priority: 10 }], sanitize: { tags: ["p"] } });
162
+ function $t(e5) {
163
+ e5.registerNodeSpec({ type: "paragraph", group: "block", content: { allow: ["text"] }, toDOM: (e6) => we("p", e6.id), toHTML: (e6, t3) => `<p>${t3 || "<br>"}</p>`, parseHTML: [{ tag: "p" }, { tag: "div", priority: 10 }], sanitize: { tags: ["p"] } });
163
164
  }
164
- function Pt(e5, t3, n3) {
165
- return { children: _t(e5.children, t3, n3) };
165
+ function Kt(e5, t3, n3) {
166
+ return { children: Ft(e5.children, t3, n3) };
166
167
  }
167
- function _t(e5, t3, n3) {
168
+ function Ft(e5, t3, n3) {
168
169
  return e5.map((e6) => {
169
170
  if (!S(e6)) return e6;
170
171
  if (e6.id === t3) return n3(e6);
171
- const s3 = _t(e6.children, t3, n3);
172
+ const s3 = Ft(e6.children, t3, n3);
172
173
  return s3 === e6.children ? e6 : { ...e6, children: s3 };
173
174
  });
174
175
  }
175
- function Dt(e5, t3, n3) {
176
+ function Ut(e5, t3, n3) {
176
177
  if (0 === t3.length) return e5;
177
178
  const s3 = t3[0];
178
- return s3 ? { children: e5.children.map((e6) => S(e6) && e6.id === s3 ? 1 === t3.length ? n3(e6) : Ht(e6, t3, 1, n3) : e6) } : e5;
179
+ return s3 ? { children: e5.children.map((e6) => S(e6) && e6.id === s3 ? 1 === t3.length ? n3(e6) : Wt(e6, t3, 1, n3) : e6) } : e5;
179
180
  }
180
- function Ht(e5, t3, n3, s3) {
181
+ function Wt(e5, t3, n3, s3) {
181
182
  const r4 = t3[n3];
182
183
  if (!r4) return e5;
183
- const i9 = e5.children.map((e6) => S(e6) && e6.id === r4 ? n3 === t3.length - 1 ? s3(e6) : Ht(e6, t3, n3 + 1, s3) : e6);
184
+ const i9 = e5.children.map((e6) => S(e6) && e6.id === r4 ? n3 === t3.length - 1 ? s3(e6) : Wt(e6, t3, n3 + 1, s3) : e6);
184
185
  return { ...e5, children: i9 };
185
186
  }
186
- function zt(e5, t3, n3) {
187
+ function Vt(e5, t3, n3) {
187
188
  if (t3(e5)) return n3(e5);
188
189
  let s3 = false;
189
190
  const r4 = e5.map((e6) => {
190
191
  if (!S(e6)) return e6;
191
- const r5 = zt(e6.children, t3, n3);
192
+ const r5 = Vt(e6.children, t3, n3);
192
193
  return r5 ? (s3 = true, { ...e6, children: r5 }) : e6;
193
194
  });
194
195
  return s3 ? r4 : null;
195
196
  }
196
- function jt(e5, t3, n3) {
197
+ function Gt(e5, t3, n3) {
197
198
  const s3 = [];
198
199
  let r4 = 0;
199
200
  for (const i9 of e5) {
@@ -212,7 +213,7 @@ function jt(e5, t3, n3) {
212
213
  }
213
214
  return 0 === s3.length && s3.push(T("")), s3;
214
215
  }
215
- function $t(e5, t3, n3, s3, r4) {
216
+ function qt(e5, t3, n3, s3, r4) {
216
217
  const i9 = [];
217
218
  let o2 = 0;
218
219
  for (const a22 of e5) {
@@ -237,16 +238,16 @@ function $t(e5, t3, n3, s3, r4) {
237
238
  }
238
239
  return i9;
239
240
  }
240
- function Kt(e5, t3) {
241
+ function Jt(e5, t3) {
241
242
  if (e5.every((e6) => R(e6) || C(e6))) return t3;
242
243
  const n3 = e5.filter((e6) => !R(e6) && !C(e6));
243
244
  return [...t3, ...n3];
244
245
  }
245
- function Ft(e5, t3) {
246
+ function Qt(e5, t3) {
246
247
  switch (t3.type) {
247
248
  case "insertText":
248
249
  return (function(e6, t4) {
249
- return Pt(e6, t4.blockId, (e7) => {
250
+ return Kt(e6, t4.blockId, (e7) => {
250
251
  const n3 = I(e7), s3 = t4.segments ? (function(e8, t5, n4) {
251
252
  const s4 = [];
252
253
  let r4 = 0, i9 = false;
@@ -287,12 +288,12 @@ function Ft(e5, t3) {
287
288
  }
288
289
  return o2 || r4.push(T(n4, s4)), r4;
289
290
  })(n3, t4.offset, t4.text, t4.marks);
290
- return { ...e7, children: Kt(e7.children, N(s3)) };
291
+ return { ...e7, children: Jt(e7.children, N(s3)) };
291
292
  });
292
293
  })(e5, t3);
293
294
  case "deleteText":
294
295
  return (function(e6, t4) {
295
- return Pt(e6, t4.blockId, (e7) => {
296
+ return Kt(e6, t4.blockId, (e7) => {
296
297
  const n3 = (function(e8, t5, n4) {
297
298
  const s3 = [];
298
299
  let r4 = 0;
@@ -312,22 +313,22 @@ function Ft(e5, t3) {
312
313
  }
313
314
  return s3;
314
315
  })(I(e7), t4.from, t4.to);
315
- return { ...e7, children: Kt(e7.children, N(n3)) };
316
+ return { ...e7, children: Jt(e7.children, N(n3)) };
316
317
  });
317
318
  })(e5, t3);
318
319
  case "splitBlock":
319
320
  return (function(e6, t4) {
320
- const n3 = zt(e6.children, (e7) => e7.some((e8) => S(e8) && e8.id === t4.blockId), (e7) => {
321
+ const n3 = Vt(e6.children, (e7) => e7.some((e8) => S(e8) && e8.id === t4.blockId), (e7) => {
321
322
  const n4 = e7.findIndex((e8) => S(e8) && e8.id === t4.blockId);
322
323
  if (-1 === n4) return e7;
323
- const s3 = e7[n4], r4 = I(s3), i9 = O(s3), o2 = jt(r4, 0, t4.offset), a22 = jt(r4, t4.offset, i9), c11 = { ...s3, children: N(o2) }, l3 = _(s3.type, N(a22), t4.newBlockId, s3.attrs), h4 = [...e7];
324
+ const s3 = e7[n4], r4 = I(s3), i9 = O(s3), o2 = Gt(r4, 0, t4.offset), a22 = Gt(r4, t4.offset, i9), c11 = { ...s3, children: N(o2) }, l3 = _(s3.type, N(a22), t4.newBlockId, s3.attrs), h4 = [...e7];
324
325
  return h4.splice(n4, 1, c11, l3), h4;
325
326
  });
326
327
  return n3 ? { children: n3 } : e6;
327
328
  })(e5, t3);
328
329
  case "mergeBlocks":
329
330
  return (function(e6, t4) {
330
- const n3 = zt(e6.children, (e7) => e7.some((e8) => S(e8) && e8.id === t4.targetBlockId) && e7.some((e8) => S(e8) && e8.id === t4.sourceBlockId), (e7) => {
331
+ const n3 = Vt(e6.children, (e7) => e7.some((e8) => S(e8) && e8.id === t4.targetBlockId) && e7.some((e8) => S(e8) && e8.id === t4.sourceBlockId), (e7) => {
331
332
  const n4 = e7.findIndex((e8) => S(e8) && e8.id === t4.targetBlockId), s3 = e7.findIndex((e8) => S(e8) && e8.id === t4.sourceBlockId);
332
333
  if (-1 === n4 || -1 === s3) return e7;
333
334
  const r4 = e7[n4], i9 = e7[s3], o2 = I(r4), a22 = I(i9), c11 = N([...o2, ...a22]), l3 = { ...r4, children: c11 };
@@ -337,23 +338,23 @@ function Ft(e5, t3) {
337
338
  })(e5, t3);
338
339
  case "addMark":
339
340
  return (function(e6, t4) {
340
- return Pt(e6, t4.blockId, (e7) => {
341
- const n3 = $t(I(e7), t4.from, t4.to, t4.mark, true);
342
- return { ...e7, children: Kt(e7.children, N(n3)) };
341
+ return Kt(e6, t4.blockId, (e7) => {
342
+ const n3 = qt(I(e7), t4.from, t4.to, t4.mark, true);
343
+ return { ...e7, children: Jt(e7.children, N(n3)) };
343
344
  });
344
345
  })(e5, t3);
345
346
  case "removeMark":
346
347
  return (function(e6, t4) {
347
- return Pt(e6, t4.blockId, (e7) => {
348
- const n3 = $t(I(e7), t4.from, t4.to, t4.mark, false);
349
- return { ...e7, children: Kt(e7.children, N(n3)) };
348
+ return Kt(e6, t4.blockId, (e7) => {
349
+ const n3 = qt(I(e7), t4.from, t4.to, t4.mark, false);
350
+ return { ...e7, children: Jt(e7.children, N(n3)) };
350
351
  });
351
352
  })(e5, t3);
352
353
  case "setStoredMarks":
353
354
  return e5;
354
355
  case "setBlockType":
355
356
  return (function(e6, t4) {
356
- return Pt(e6, t4.blockId, (e7) => ({ ...e7, type: t4.nodeType, ...t4.attrs ? { attrs: t4.attrs } : { attrs: void 0 } }));
357
+ return Kt(e6, t4.blockId, (e7) => ({ ...e7, type: t4.nodeType, ...t4.attrs ? { attrs: t4.attrs } : { attrs: void 0 } }));
357
358
  })(e5, t3);
358
359
  case "insertNode":
359
360
  return (function(e6, t4) {
@@ -361,7 +362,7 @@ function Ft(e5, t3) {
361
362
  const n3 = [...e6.children];
362
363
  return n3.splice(t4.index, 0, t4.node), { children: n3 };
363
364
  }
364
- return Dt(e6, t4.parentPath, (e7) => {
365
+ return Ut(e6, t4.parentPath, (e7) => {
365
366
  const n3 = [...e7.children];
366
367
  return n3.splice(t4.index, 0, t4.node), { ...e7, children: n3 };
367
368
  });
@@ -372,7 +373,7 @@ function Ft(e5, t3) {
372
373
  const n3 = [...e6.children];
373
374
  return n3.splice(t4.index, 1), { children: n3 };
374
375
  }
375
- return Dt(e6, t4.parentPath, (e7) => {
376
+ return Ut(e6, t4.parentPath, (e7) => {
376
377
  const n3 = [...e7.children];
377
378
  return n3.splice(t4.index, 1), { ...e7, children: n3 };
378
379
  });
@@ -380,11 +381,11 @@ function Ft(e5, t3) {
380
381
  case "setNodeAttr":
381
382
  return (function(e6, t4) {
382
383
  const n3 = t4.path[t4.path.length - 1];
383
- return n3 ? Pt(e6, n3, (e7) => ({ ...e7, attrs: t4.attrs })) : e6;
384
+ return n3 ? Kt(e6, n3, (e7) => ({ ...e7, attrs: t4.attrs })) : e6;
384
385
  })(e5, t3);
385
386
  case "insertInlineNode":
386
387
  return (function(e6, t4) {
387
- return Pt(e6, t4.blockId, (e7) => {
388
+ return Kt(e6, t4.blockId, (e7) => {
388
389
  const n3 = (function(e8, t5, n4) {
389
390
  const s3 = [];
390
391
  let r4 = 0, i9 = false;
@@ -402,36 +403,36 @@ function Ft(e5, t3) {
402
403
  }
403
404
  return i9 || s3.push(n4), s3;
404
405
  })(I(e7), t4.offset, t4.node);
405
- return { ...e7, children: Kt(e7.children, N(n3)) };
406
+ return { ...e7, children: Jt(e7.children, N(n3)) };
406
407
  });
407
408
  })(e5, t3);
408
409
  case "removeInlineNode":
409
410
  return (function(e6, t4) {
410
- return Pt(e6, t4.blockId, (e7) => {
411
+ return Kt(e6, t4.blockId, (e7) => {
411
412
  const n3 = (function(e8, t5) {
412
413
  const n4 = [];
413
414
  let s3 = 0;
414
415
  for (const r4 of e8) C(r4) ? (s3 !== t5 && n4.push(r4), s3 += 1) : (n4.push(r4), s3 += r4.text.length);
415
416
  return n4;
416
417
  })(I(e7), t4.offset);
417
- return { ...e7, children: Kt(e7.children, N(n3)) };
418
+ return { ...e7, children: Jt(e7.children, N(n3)) };
418
419
  });
419
420
  })(e5, t3);
420
421
  case "setInlineNodeAttr":
421
422
  return (function(e6, t4) {
422
- return Pt(e6, t4.blockId, (e7) => {
423
+ return Kt(e6, t4.blockId, (e7) => {
423
424
  const n3 = (function(e8, t5, n4) {
424
425
  const s3 = [];
425
426
  let r4 = 0;
426
427
  for (const i9 of e8) C(i9) ? (r4 === t5 ? s3.push({ ...i9, attrs: n4 }) : s3.push(i9), r4 += 1) : (s3.push(i9), r4 += i9.text.length);
427
428
  return s3;
428
429
  })(I(e7), t4.offset, t4.attrs);
429
- return { ...e7, children: Kt(e7.children, n3) };
430
+ return { ...e7, children: Jt(e7.children, n3) };
430
431
  });
431
432
  })(e5, t3);
432
433
  }
433
434
  }
434
- function Ut(e5) {
435
+ function Xt(e5) {
435
436
  switch (e5.type) {
436
437
  case "insertText":
437
438
  return { type: "deleteText", blockId: e5.blockId, from: e5.offset, to: e5.offset + e5.text.length, deletedText: e5.text, deletedMarks: e5.marks, deletedSegments: e5.segments ?? [{ text: e5.text, marks: [...e5.marks] }], ...e5.path ? { path: e5.path } : {} };
@@ -463,10 +464,10 @@ function Ut(e5) {
463
464
  return { type: "setInlineNodeAttr", blockId: e5.blockId, offset: e5.offset, attrs: e5.previousAttrs, previousAttrs: e5.attrs, ...e5.path ? { path: e5.path } : {} };
464
465
  }
465
466
  }
466
- function Wt(e5) {
467
- return { steps: e5.steps.map(Ut).reverse(), selectionBefore: e5.selectionAfter, selectionAfter: e5.selectionBefore, storedMarksAfter: null, metadata: { origin: "history", timestamp: Date.now() } };
467
+ function Yt(e5) {
468
+ return { steps: e5.steps.map(Xt).reverse(), selectionBefore: e5.selectionAfter, selectionAfter: e5.selectionBefore, storedMarksAfter: null, metadata: { origin: "history", timestamp: Date.now() } };
468
469
  }
469
- class Vt {
470
+ class Zt {
470
471
  steps = [];
471
472
  selection;
472
473
  storedMarks;
@@ -606,10 +607,10 @@ class Vt {
606
607
  return { steps: [...this.steps], selectionBefore: this.selectionBefore, selectionAfter: this.selection, storedMarksAfter: this.storedMarks, metadata: { origin: this.origin, timestamp: Date.now(), ...this._readonlyAllowed ? { readonlyAllowed: true } : {} } };
607
608
  }
608
609
  advanceDoc(e5) {
609
- this.workingDoc && (this.workingDoc = Ft(this.workingDoc, e5));
610
+ this.workingDoc && (this.workingDoc = Qt(this.workingDoc, e5));
610
611
  }
611
612
  }
612
- class Gt {
613
+ class en {
613
614
  doc;
614
615
  selection;
615
616
  storedMarks;
@@ -621,21 +622,21 @@ class Gt {
621
622
  }
622
623
  static create(e5) {
623
624
  const t3 = e5?.schema ?? pe(), n3 = e5?.doc ?? W(), s3 = n3.children[0], r4 = e5?.selection ?? re(s3 ? s3.id : ye(""), 0);
624
- return new Gt(n3, r4, null, t3);
625
+ return new en(n3, r4, null, t3);
625
626
  }
626
627
  transaction(e5 = "api") {
627
- return new Vt(this.selection, this.storedMarks, e5, this.doc);
628
+ return new Zt(this.selection, this.storedMarks, e5, this.doc);
628
629
  }
629
630
  apply(e5) {
630
631
  let t3 = this.doc;
631
- for (const n4 of e5.steps) t3 = Ft(t3, n4);
632
+ for (const n4 of e5.steps) t3 = Qt(t3, n4);
632
633
  const n3 = (function(e6, t4) {
633
- if (ie(t4)) return Ce(e6, t4.nodeId) ? t4 : Jt(e6, t4);
634
- if (oe(t4)) return Ce(e6, t4.blockId) ? t4 : Jt(e6, t4);
635
- const n4 = qt(e6, t4.anchor), s3 = qt(e6, t4.head);
634
+ if (ie(t4)) return Ce(e6, t4.nodeId) ? t4 : nn(e6, t4);
635
+ if (oe(t4)) return Ce(e6, t4.blockId) ? t4 : nn(e6, t4);
636
+ const n4 = tn(e6, t4.anchor), s3 = tn(e6, t4.head);
636
637
  return n4 === t4.anchor && s3 === t4.head ? t4 : ae(n4, s3);
637
638
  })(t3, e5.selectionAfter);
638
- return new Gt(t3, n3, e5.storedMarksAfter, this.schema);
639
+ return new en(t3, n3, e5.storedMarksAfter, this.schema);
639
640
  }
640
641
  getBlock(e5) {
641
642
  return this._blockMap ??= (function(e6) {
@@ -666,10 +667,10 @@ class Gt {
666
667
  return { doc: this.doc, selection: this.selection };
667
668
  }
668
669
  static fromJSON(e5, t3) {
669
- return new Gt(e5.doc, e5.selection, null, t3 ?? pe());
670
+ return new en(e5.doc, e5.selection, null, t3 ?? pe());
670
671
  }
671
672
  }
672
- function qt(e5, t3) {
673
+ function tn(e5, t3) {
673
674
  const n3 = Ce(e5, t3.blockId);
674
675
  if (n3) {
675
676
  const e6 = O(n3);
@@ -678,27 +679,27 @@ function qt(e5, t3) {
678
679
  const s3 = e5.children[0];
679
680
  return s3 ? ce(s3.id, 0) : t3;
680
681
  }
681
- function Jt(e5, t3) {
682
- const n3 = Qt(e5.children);
682
+ function nn(e5, t3) {
683
+ const n3 = sn(e5.children);
683
684
  return n3 ? re(n3.id, 0) : t3;
684
685
  }
685
- function Qt(e5) {
686
+ function sn(e5) {
686
687
  for (const t3 of e5) {
687
688
  if (!S(t3)) continue;
688
689
  if (V(t3)) return t3;
689
- const e6 = Qt(t3.children);
690
+ const e6 = sn(t3.children);
690
691
  if (e6) return e6;
691
692
  }
692
693
  return null;
693
694
  }
694
- function Xt(e5) {
695
+ function rn(e5) {
695
696
  for (const t3 of e5.steps) if ("setStoredMarks" !== t3.type) return false;
696
697
  return true;
697
698
  }
698
- function Yt(e5) {
699
- return !!e5.metadata.readonlyAllowed || Xt(e5);
699
+ function on(e5) {
700
+ return !!e5.metadata.readonlyAllowed || rn(e5);
700
701
  }
701
- class Zt {
702
+ class an {
702
703
  undoStack = [];
703
704
  redoStack = [];
704
705
  groupTimeoutMs;
@@ -721,7 +722,7 @@ class Zt {
721
722
  for (let e6 = t3.transactions.length - 1; e6 >= 0; e6--) {
722
723
  const r4 = t3.transactions[e6];
723
724
  if (!r4) continue;
724
- const i9 = Wt(r4);
725
+ const i9 = Yt(r4);
725
726
  n3 = n3.apply(i9), s3.push(...i9.steps);
726
727
  }
727
728
  return this.redoStack.push({ transactions: t3.transactions, timestamp: Date.now() }), this.lastOrigin = null, { state: n3, transaction: { steps: s3, selectionBefore: e5.selection, selectionAfter: n3.selection, storedMarksAfter: n3.storedMarks, metadata: { origin: "history", timestamp: Date.now(), historyDirection: "undo" } } };
@@ -750,7 +751,7 @@ class Zt {
750
751
  return s3 === r4;
751
752
  }
752
753
  }
753
- function en(e5, t3) {
754
+ function cn(e5, t3) {
754
755
  const n3 = e5.selection;
755
756
  if (ie(n3)) return ze(e5, n3);
756
757
  if (oe(n3)) return null;
@@ -762,13 +763,13 @@ function en(e5, t3) {
762
763
  const [i9, o2] = r4;
763
764
  return e5.transaction("input").deleteTextAt(s3.id, i9, o2).setSelection(re(s3.id, i9)).build();
764
765
  }
765
- function tn(e5) {
766
- return en(e5, { merge: Ke, range: (e6, t3) => t3 > 0 ? [t3 - 1, t3] : null });
766
+ function ln(e5) {
767
+ return cn(e5, { merge: Ke, range: (e6, t3) => t3 > 0 ? [t3 - 1, t3] : null });
767
768
  }
768
- function nn(e5) {
769
- return en(e5, { merge: $e, range: (e6, t3) => t3 < O(e6) ? [t3, t3 + 1] : null });
769
+ function hn(e5) {
770
+ return cn(e5, { merge: $e, range: (e6, t3) => t3 < O(e6) ? [t3, t3 + 1] : null });
770
771
  }
771
- class sn {
772
+ class dn {
772
773
  constructor(e5, t3) {
773
774
  this.element = e5, this.getState = t3.getState, this.dispatch = t3.dispatch, this.undo = t3.undo, this.redo = t3.redo, this.keymapRegistry = t3.keymapRegistry, this.isReadOnly = t3.isReadOnly ?? (() => false), this.compositionTracker = t3.compositionTracker, this.handleKeydown = this.onKeydown.bind(this), e5.addEventListener("keydown", this.handleKeydown);
774
775
  }
@@ -786,7 +787,7 @@ class sn {
786
787
  if (this.handleGapCursorKeys(e5)) return;
787
788
  if (this.isReadOnly()) {
788
789
  if (this.keymapRegistry) {
789
- const t4 = rn(e5), n4 = this.keymapRegistry.getKeymapsByPriority().navigation;
790
+ const t4 = un(e5), n4 = this.keymapRegistry.getKeymapsByPriority().navigation;
790
791
  for (let s4 = n4.length - 1; s4 >= 0; s4--) {
791
792
  const r4 = n4[s4]?.[t4];
792
793
  if (r4?.()) return void e5.preventDefault();
@@ -795,7 +796,7 @@ class sn {
795
796
  return void this.handleEscape(e5);
796
797
  }
797
798
  if (this.keymapRegistry) {
798
- const t4 = rn(e5), n4 = this.keymapRegistry.getKeymapsByPriority();
799
+ const t4 = un(e5), n4 = this.keymapRegistry.getKeymapsByPriority();
799
800
  for (const s4 of [n4.context, n4.navigation, n4.default]) for (let n5 = s4.length - 1; n5 >= 0; n5--) {
800
801
  const r4 = s4[n5]?.[t4];
801
802
  if (r4?.()) return void e5.preventDefault();
@@ -891,13 +892,13 @@ class sn {
891
892
  this.element.removeEventListener("keydown", this.handleKeydown);
892
893
  }
893
894
  }
894
- function rn(e5) {
895
+ function un(e5) {
895
896
  const t3 = [];
896
897
  (e5.metaKey || e5.ctrlKey) && t3.push("Mod"), e5.shiftKey && t3.push("Shift"), e5.altKey && t3.push("Alt");
897
898
  let n3 = e5.key;
898
899
  return " " === n3 ? n3 = "Space" : 1 === n3.length && (n3 = n3.toUpperCase()), t3.push(n3), t3.join("-");
899
900
  }
900
- function on(e5) {
901
+ function pn(e5) {
901
902
  const t3 = e5.getMarkTypes(), n3 = /* @__PURE__ */ new Map();
902
903
  for (const s3 of t3) {
903
904
  const t4 = e5.getMarkSpec(s3);
@@ -905,11 +906,11 @@ function on(e5) {
905
906
  }
906
907
  return n3;
907
908
  }
908
- function an(e5, t3, n3, s3) {
909
+ function fn(e5, t3, n3, s3) {
909
910
  if ("" === e5) return "";
910
911
  let r4 = Ee(e5);
911
912
  if (0 === t3.length) return r4;
912
- const i9 = s3 ?? on(n3), o2 = [...t3].sort((e6, t4) => (i9.get(e6.type) ?? 99) - (i9.get(t4.type) ?? 99)), a22 = [], c11 = [];
913
+ const i9 = s3 ?? pn(n3), o2 = [...t3].sort((e6, t4) => (i9.get(e6.type) ?? 99) - (i9.get(t4.type) ?? 99)), a22 = [], c11 = [];
913
914
  for (const e6 of o2) {
914
915
  const t4 = n3.getMarkSpec(e6.type);
915
916
  if (t4?.toHTMLStyle) {
@@ -924,8 +925,30 @@ function an(e5, t3, n3, s3) {
924
925
  }
925
926
  return r4;
926
927
  }
927
- let cn;
928
- class ln {
928
+ function gn(e5, t3, n3, s3, r4) {
929
+ if ("" === e5) return "";
930
+ let i9 = Ee(e5);
931
+ if (0 === t3.length) return i9;
932
+ const o2 = r4 ?? pn(n3), a22 = [...t3].sort((e6, t4) => (o2.get(e6.type) ?? 99) - (o2.get(t4.type) ?? 99)), c11 = [], l3 = [];
933
+ for (const e6 of a22) {
934
+ const t4 = n3.getMarkSpec(e6.type);
935
+ if (t4?.toHTMLStyle) {
936
+ const n4 = t4.toHTMLStyle(e6);
937
+ n4 && c11.push(n4);
938
+ } else l3.push(e6);
939
+ }
940
+ if (c11.length > 0) {
941
+ const e6 = c11.join("; ");
942
+ i9 = `<span class="${s3.getClassName(e6)}">${i9}</span>`;
943
+ }
944
+ for (const e6 of l3) {
945
+ const t4 = n3.getMarkSpec(e6.type);
946
+ t4?.toHTMLString && (i9 = t4.toHTMLString(e6, i9));
947
+ }
948
+ return i9;
949
+ }
950
+ let mn;
951
+ class yn {
929
952
  constructor(e5, t3) {
930
953
  this.element = e5, this.getState = t3.getState, this.dispatch = t3.dispatch, this.schemaRegistry = t3.schemaRegistry, this.syncSelection = t3.syncSelection, this.isReadOnly = t3.isReadOnly ?? (() => false), this.handleCopy = this.onCopy.bind(this), this.handleCut = this.onCut.bind(this), e5.addEventListener("copy", this.handleCopy), e5.addEventListener("cut", this.handleCut);
931
954
  }
@@ -991,7 +1014,7 @@ class ln {
991
1014
  }
992
1015
  const l3 = a22.join("\n");
993
1016
  if (e5.setData("text/plain", l3), this.schemaRegistry) {
994
- const n4 = on(this.schemaRegistry), a23 = [];
1017
+ const n4 = pn(this.schemaRegistry), a23 = [];
995
1018
  for (let e6 = i9; e6 <= o2; e6++) {
996
1019
  const c12 = s3[e6];
997
1020
  if (!c12) continue;
@@ -1003,7 +1026,7 @@ class ln {
1003
1026
  e5.setData("text/html", a23.join(""));
1004
1027
  }
1005
1028
  !(function(e6, t4) {
1006
- cn = { plainText: e6, blocks: t4 };
1029
+ mn = { plainText: e6, blocks: t4 };
1007
1030
  })(l3, c11);
1008
1031
  }
1009
1032
  serializeBlockRangeToHTML(e5, t3, n3, s3) {
@@ -1015,7 +1038,7 @@ class ln {
1015
1038
  else {
1016
1039
  if (R(e6)) {
1017
1040
  const r6 = Math.max(0, t3 - o2), a22 = Math.min(e6.text.length, n3 - o2), c11 = e6.text.slice(r6, a22);
1018
- c11.length > 0 && this.schemaRegistry && i9.push(an(c11, e6.marks, this.schemaRegistry, s3));
1041
+ c11.length > 0 && this.schemaRegistry && i9.push(fn(c11, e6.marks, this.schemaRegistry, s3));
1019
1042
  } else if (C(e6)) {
1020
1043
  const t4 = this.schemaRegistry?.getInlineNodeSpec(e6.inlineType);
1021
1044
  t4?.toHTMLString && i9.push(t4.toHTMLString(e6));
@@ -1029,7 +1052,7 @@ class ln {
1029
1052
  this.element.removeEventListener("copy", this.handleCopy), this.element.removeEventListener("cut", this.handleCut);
1030
1053
  }
1031
1054
  }
1032
- class hn {
1055
+ class kn {
1033
1056
  _composing = false;
1034
1057
  _activeBlockId = null;
1035
1058
  get isComposing() {
@@ -1045,7 +1068,7 @@ class hn {
1045
1068
  this._composing = false, this._activeBlockId = null;
1046
1069
  }
1047
1070
  }
1048
- class dn {
1071
+ class bn {
1049
1072
  _contextKeymaps = [];
1050
1073
  _navigationKeymaps = [];
1051
1074
  _defaultKeymaps = [];
@@ -1083,7 +1106,7 @@ class dn {
1083
1106
  }
1084
1107
  }
1085
1108
  }
1086
- class un {
1109
+ class vn {
1087
1110
  _inputRules = [];
1088
1111
  registerInputRule(e5) {
1089
1112
  this._inputRules.push(e5);
@@ -1099,7 +1122,7 @@ class un {
1099
1122
  this._inputRules.length = 0;
1100
1123
  }
1101
1124
  }
1102
- class pn {
1125
+ class Sn {
1103
1126
  _fileHandlers = [];
1104
1127
  registerFileHandler(e5, t3) {
1105
1128
  this._fileHandlers.push({ pattern: e5, handler: t3 });
@@ -1109,7 +1132,7 @@ class pn {
1109
1132
  }
1110
1133
  matchFileHandlers(e5) {
1111
1134
  const t3 = [];
1112
- for (const n3 of this._fileHandlers) fn(n3.pattern, e5) && t3.push(n3.handler);
1135
+ for (const n3 of this._fileHandlers) wn(n3.pattern, e5) && t3.push(n3.handler);
1113
1136
  return t3;
1114
1137
  }
1115
1138
  removeFileHandler(e5) {
@@ -1120,7 +1143,7 @@ class pn {
1120
1143
  this._fileHandlers.length = 0;
1121
1144
  }
1122
1145
  }
1123
- function fn(e5, t3) {
1146
+ function wn(e5, t3) {
1124
1147
  if ("*" === e5 || "*/*" === e5) return true;
1125
1148
  if (e5 === t3) return true;
1126
1149
  if (e5.endsWith("/*")) {
@@ -1129,7 +1152,7 @@ function fn(e5, t3) {
1129
1152
  }
1130
1153
  return false;
1131
1154
  }
1132
- class gn {
1155
+ class En {
1133
1156
  _nodeViews = /* @__PURE__ */ new Map();
1134
1157
  registerNodeView(e5, t3) {
1135
1158
  if (this._nodeViews.has(e5)) throw new Error(`NodeView for type "${e5}" is already registered.`);
@@ -1145,7 +1168,7 @@ class gn {
1145
1168
  this._nodeViews.clear();
1146
1169
  }
1147
1170
  }
1148
- class mn {
1171
+ class xn {
1149
1172
  _toolbarItems = /* @__PURE__ */ new Map();
1150
1173
  _toolbarItemPluginMap = /* @__PURE__ */ new Map();
1151
1174
  registerToolbarItem(e5, t3) {
@@ -1183,7 +1206,7 @@ class mn {
1183
1206
  this._toolbarItems.clear(), this._toolbarItemPluginMap.clear();
1184
1207
  }
1185
1208
  }
1186
- class yn {
1209
+ class Cn {
1187
1210
  _entries = /* @__PURE__ */ new Map();
1188
1211
  registerBlockTypePickerEntry(e5) {
1189
1212
  if (this._entries.has(e5.id)) throw new Error(`BlockTypePickerEntry with id "${e5.id}" is already registered.`);
@@ -1199,7 +1222,7 @@ class yn {
1199
1222
  this._entries.clear();
1200
1223
  }
1201
1224
  }
1202
- function kn(e5, t3) {
1225
+ function Tn(e5, t3) {
1203
1226
  if (t3) {
1204
1227
  const n3 = t3.getMarkSpec(e5.type);
1205
1228
  if (n3) return n3.rank ?? 100;
@@ -1215,7 +1238,7 @@ function kn(e5, t3) {
1215
1238
  return 100;
1216
1239
  }
1217
1240
  }
1218
- function vn(e5, t3) {
1241
+ function An(e5, t3) {
1219
1242
  if (t3) {
1220
1243
  const n3 = t3.getMarkSpec(e5.type);
1221
1244
  if (n3) return n3.toDOM(e5);
@@ -1231,7 +1254,7 @@ function vn(e5, t3) {
1231
1254
  return document.createElement("span");
1232
1255
  }
1233
1256
  }
1234
- class bn {
1257
+ class Rn {
1235
1258
  wrapperElement = null;
1236
1259
  container;
1237
1260
  registry;
@@ -1252,11 +1275,11 @@ class bn {
1252
1275
  s3.setAttribute("data-cursor-wrapper", "");
1253
1276
  const r4 = document.createTextNode("​");
1254
1277
  let i9 = r4;
1255
- const o2 = [...t3].sort((e6, t4) => kn(e6, this.registry) - kn(t4, this.registry));
1278
+ const o2 = [...t3].sort((e6, t4) => Tn(e6, this.registry) - Tn(t4, this.registry));
1256
1279
  for (let e6 = o2.length - 1; e6 >= 0; e6--) {
1257
1280
  const t4 = o2[e6];
1258
1281
  if (!t4) continue;
1259
- const n4 = vn(t4, this.registry);
1282
+ const n4 = An(t4, this.registry);
1260
1283
  n4.appendChild(i9), i9 = n4;
1261
1284
  }
1262
1285
  s3.appendChild(i9);
@@ -1274,8 +1297,8 @@ class bn {
1274
1297
  this.wrapperElement && (this.wrapperElement.remove(), this.wrapperElement = null);
1275
1298
  }
1276
1299
  }
1277
- const wn = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
1278
- function Sn(e5) {
1300
+ const Ln = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
1301
+ function Mn(e5) {
1279
1302
  let t3 = 0;
1280
1303
  const n3 = (n4) => {
1281
1304
  n4.stopPropagation();
@@ -1301,7 +1324,7 @@ function Sn(e5) {
1301
1324
  };
1302
1325
  return e5.container.addEventListener("keydown", n3), () => e5.container.removeEventListener("keydown", n3);
1303
1326
  }
1304
- function En(e5) {
1327
+ function In(e5) {
1305
1328
  let t3 = 0;
1306
1329
  const n3 = (n4) => {
1307
1330
  const s3 = Array.from(e5.container.querySelectorAll(e5.itemSelector));
@@ -1322,7 +1345,7 @@ function En(e5) {
1322
1345
  };
1323
1346
  return e5.container.addEventListener("keydown", n3), () => e5.container.removeEventListener("keydown", n3);
1324
1347
  }
1325
- function xn(e5) {
1348
+ function Nn(e5) {
1326
1349
  let t3 = 0;
1327
1350
  const n3 = e5.columns, s3 = e5.totalCells, r4 = Math.ceil(s3 / n3), i9 = (i10) => {
1328
1351
  const o2 = Array.from(e5.container.querySelectorAll(e5.cellSelector));
@@ -1333,7 +1356,7 @@ function xn(e5) {
1333
1356
  const n4 = o2[t3];
1334
1357
  return void (n4 && e5.onSelect(n4));
1335
1358
  }
1336
- if (wn.has(i10.key)) {
1359
+ if (Ln.has(i10.key)) {
1337
1360
  i10.preventDefault();
1338
1361
  const a22 = Math.floor(t3 / n3) + 1, c11 = t3 % n3 + 1, [l3, h4] = ot(a22, c11, r4, n3, i10.key);
1339
1362
  let d5 = (l3 - 1) * n3 + (h4 - 1);
@@ -1348,7 +1371,7 @@ function xn(e5) {
1348
1371
  };
1349
1372
  return e5.container.addEventListener("keydown", i9), () => e5.container.removeEventListener("keydown", i9);
1350
1373
  }
1351
- class Cn {
1374
+ class Bn {
1352
1375
  listeners = /* @__PURE__ */ new Map();
1353
1376
  emit(e5, t3) {
1354
1377
  const n3 = this.listeners.get(e5.id);
@@ -1374,21 +1397,21 @@ class Cn {
1374
1397
  this.listeners.clear();
1375
1398
  }
1376
1399
  }
1377
- class Tn {
1400
+ class On {
1378
1401
  plugins = /* @__PURE__ */ new Map();
1379
1402
  commands = /* @__PURE__ */ new Map();
1380
1403
  services = /* @__PURE__ */ new Map();
1381
1404
  middlewares = [];
1382
1405
  registrations = /* @__PURE__ */ new Map();
1383
- eventBus = new Cn();
1406
+ eventBus = new Bn();
1384
1407
  pluginStyleSheets = [];
1385
- schemaRegistry = new It();
1386
- keymapRegistry = new dn();
1387
- inputRuleRegistry = new un();
1388
- fileHandlerRegistry = new pn();
1389
- nodeViewRegistry = new gn();
1390
- toolbarRegistry = new mn();
1391
- blockTypePickerRegistry = new yn();
1408
+ schemaRegistry = new Ht();
1409
+ keymapRegistry = new bn();
1410
+ inputRuleRegistry = new vn();
1411
+ fileHandlerRegistry = new Sn();
1412
+ nodeViewRegistry = new En();
1413
+ toolbarRegistry = new xn();
1414
+ blockTypePickerRegistry = new Cn();
1392
1415
  middlewareSorted = null;
1393
1416
  initOrder = [];
1394
1417
  initialized = false;
@@ -1670,32 +1693,32 @@ class Tn {
1670
1693
  return r4;
1671
1694
  }
1672
1695
  }
1673
- const An = { label: "Print", tooltip: (e5) => `Print (${e5})`, printingAnnouncement: "Printing" }, Rn = { en: An, de: { label: "Drucken", tooltip: (e5) => `Drucken (${e5})`, printingAnnouncement: "Druckvorgang" }, es: { label: "Imprimir", tooltip: (e5) => `Imprimir (${e5})`, printingAnnouncement: "Imprimiendo" }, fr: { label: "Imprimer", tooltip: (e5) => `Imprimer (${e5})`, printingAnnouncement: "Impression" }, zh: { label: "打印", tooltip: (e5) => `打印 (${e5})`, printingAnnouncement: "正在打印" }, ru: { label: "Печать", tooltip: (e5) => `Печать (${e5})`, printingAnnouncement: "Печать" }, ar: { label: "طباعة", tooltip: (e5) => `طباعة (${e5})`, printingAnnouncement: "جارٍ الطباعة" }, hi: { label: "प्रिंट", tooltip: (e5) => `प्रिंट (${e5})`, printingAnnouncement: "प्रिंट हो रहा है" } };
1674
- function Ln(e5) {
1696
+ const _n = { label: "Print", tooltip: (e5) => `Print (${e5})`, printingAnnouncement: "Printing" }, Dn = { en: _n, de: { label: "Drucken", tooltip: (e5) => `Drucken (${e5})`, printingAnnouncement: "Druckvorgang" }, es: { label: "Imprimir", tooltip: (e5) => `Imprimir (${e5})`, printingAnnouncement: "Imprimiendo" }, fr: { label: "Imprimer", tooltip: (e5) => `Imprimer (${e5})`, printingAnnouncement: "Impression" }, zh: { label: "打印", tooltip: (e5) => `打印 (${e5})`, printingAnnouncement: "正在打印" }, ru: { label: "Печать", tooltip: (e5) => `Печать (${e5})`, printingAnnouncement: "Печать" }, ar: { label: "طباعة", tooltip: (e5) => `طباعة (${e5})`, printingAnnouncement: "جارٍ الطباعة" }, hi: { label: "प्रिंट", tooltip: (e5) => `प्रिंट (${e5})`, printingAnnouncement: "प्रिंट हो रहा है" } };
1697
+ function Pn(e5) {
1675
1698
  return "function" == typeof e5 ? e5() : e5;
1676
1699
  }
1677
- const Mn = 96 / 25.4, In = { DINA4: "din-a4", DINA5: "din-a5", USLetter: "us-letter", USLegal: "us-legal" };
1678
- function Nn(e5) {
1679
- return Math.round(e5 * Mn);
1700
+ const Hn = 96 / 25.4, zn = { DINA4: "din-a4", DINA5: "din-a5", USLetter: "us-letter", USLegal: "us-legal" };
1701
+ function jn(e5) {
1702
+ return Math.round(e5 * Hn);
1680
1703
  }
1681
- const Bn = /* @__PURE__ */ new Map([[In.DINA4, { widthMm: 210, heightMm: 297, widthPx: Nn(210), heightPx: Nn(297) }], [In.DINA5, { widthMm: 148, heightMm: 210, widthPx: Nn(148), heightPx: Nn(210) }], [In.USLetter, { widthMm: 215.9, heightMm: 279.4, widthPx: Nn(215.9), heightPx: Nn(279.4) }], [In.USLegal, { widthMm: 215.9, heightMm: 355.6, widthPx: Nn(215.9), heightPx: Nn(355.6) }]]), On = /* @__PURE__ */ new Map([[In.DINA4, "A4"], [In.DINA5, "A5"], [In.USLetter, "letter"], [In.USLegal, "legal"]]);
1682
- function Pn(e5) {
1683
- const t3 = Bn.get(e5);
1704
+ const $n = /* @__PURE__ */ new Map([[zn.DINA4, { widthMm: 210, heightMm: 297, widthPx: jn(210), heightPx: jn(297) }], [zn.DINA5, { widthMm: 148, heightMm: 210, widthPx: jn(148), heightPx: jn(210) }], [zn.USLetter, { widthMm: 215.9, heightMm: 279.4, widthPx: jn(215.9), heightPx: jn(279.4) }], [zn.USLegal, { widthMm: 215.9, heightMm: 355.6, widthPx: jn(215.9), heightPx: jn(355.6) }]]), Kn = /* @__PURE__ */ new Map([[zn.DINA4, "A4"], [zn.DINA5, "A5"], [zn.USLetter, "letter"], [zn.USLegal, "legal"]]);
1705
+ function Fn(e5) {
1706
+ const t3 = $n.get(e5);
1684
1707
  if (!t3) throw new Error(`Unknown paper size: ${e5}`);
1685
1708
  return t3;
1686
1709
  }
1687
- const _n = 48, Dn = 56, Hn = 24;
1688
- function zn(e5) {
1689
- return Object.values(In).includes(e5);
1710
+ const Un = 48, Wn = 56, Vn = 24;
1711
+ function Gn(e5) {
1712
+ return Object.values(zn).includes(e5);
1690
1713
  }
1691
- function jn(e5) {
1692
- const t3 = On.get(e5);
1714
+ function qn(e5) {
1715
+ const t3 = Kn.get(e5);
1693
1716
  if (!t3) throw new Error(`Unknown paper size: ${e5}`);
1694
1717
  return t3;
1695
1718
  }
1696
- const $n = new tt("print"), Kn = new et("print:before"), Fn = new et("print:after"), Un = { print() {
1719
+ const Jn = new tt("print"), Qn = new et("print:before"), Xn = new et("print:after"), Yn = { print() {
1697
1720
  }, toHTML: () => "" };
1698
- class Wn {
1721
+ class Zn {
1699
1722
  id = "print";
1700
1723
  name = "Print";
1701
1724
  config;
@@ -1705,7 +1728,7 @@ class Wn {
1705
1728
  this.config = e5 ?? {};
1706
1729
  }
1707
1730
  init(e5) {
1708
- this.locale = nt(Rn, e5, this.config.locale);
1731
+ this.locale = nt(Dn, e5, this.config.locale);
1709
1732
  const t3 = e5.getContainer(), n3 = t3.getRootNode();
1710
1733
  if (n3 instanceof ShadowRoot) {
1711
1734
  const s4 = n3.host, r5 = e5.getEventBus();
@@ -1715,7 +1738,7 @@ class Wn {
1715
1738
  }
1716
1739
  function i10(r7) {
1717
1740
  const i11 = { options: r7, cancelled: false };
1718
- if (s5.emit(Kn, i11), i11.cancelled) return null;
1741
+ if (s5.emit(Qn, i11), i11.cancelled) return null;
1719
1742
  const o3 = i11.options, a22 = (function(e7, t5, n5, s6 = "en") {
1720
1743
  return ["<!DOCTYPE html>", `<html lang="${s6}">`, "<head>", '<meta charset="utf-8">', `<title>${n5.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")}</title>`, `<style>${e7}</style>`, "</head>", `<body>${t5}</body>`, "</html>"].join("\n");
1721
1744
  })((function(e7, t5, n5) {
@@ -1751,7 +1774,7 @@ ${s7.join("\n")}
1751
1774
  const o4 = (function(e8) {
1752
1775
  const t6 = [], n6 = [];
1753
1776
  if (e8.margin ? n6.push(` margin: ${e8.margin};`) : e8.paperSize && n6.push(" margin: 0;"), e8.paperSize || e8.orientation) {
1754
- const t7 = [e8.paperSize ? jn(e8.paperSize) : "A4"];
1777
+ const t7 = [e8.paperSize ? qn(e8.paperSize) : "A4"];
1755
1778
  e8.orientation && t7.push(e8.orientation), n6.push(` size: ${t7.join(" ")};`);
1756
1779
  }
1757
1780
  n6.length > 0 && t6.push(`@page {
@@ -1782,20 +1805,20 @@ ${n6.join("\n")}
1782
1805
  }
1783
1806
  if (t6.pageBreakBefore) for (const n6 of t6.pageBreakBefore) {
1784
1807
  const t7 = e8.querySelectorAll(`[data-block-type="${n6}"]`);
1785
- for (const e9 of t7) e9.style.breakBefore = "page", e9.style.pageBreakBefore = "always";
1808
+ for (const e9 of t7) Lt(e9, { breakBefore: "page", pageBreakBefore: "always" });
1786
1809
  }
1787
1810
  })(n5, t5), (function(e8, t6) {
1788
1811
  if (t6.header) {
1789
1812
  const n6 = document.createElement("div");
1790
- n6.className = "notectl-print-header", n6.innerHTML = Ln(t6.header), e8.insertBefore(n6, e8.firstChild);
1813
+ n6.className = "notectl-print-header", n6.innerHTML = Pn(t6.header), e8.insertBefore(n6, e8.firstChild);
1791
1814
  }
1792
1815
  if (t6.footer) {
1793
1816
  const n6 = document.createElement("div");
1794
- n6.className = "notectl-print-footer", n6.innerHTML = Ln(t6.footer), e8.appendChild(n6);
1817
+ n6.className = "notectl-print-footer", n6.innerHTML = Pn(t6.footer), e8.appendChild(n6);
1795
1818
  }
1796
1819
  })(n5, t5), n5;
1797
1820
  })(n4, o3).outerHTML, o3.title ?? "", t4.closest("[lang]")?.getAttribute("lang") ?? (document.documentElement.lang || "en")), c11 = { html: a22 };
1798
- return s5.emit(Fn, c11), a22;
1821
+ return s5.emit(Xn, c11), a22;
1799
1822
  }
1800
1823
  return { print(e7) {
1801
1824
  const t5 = i10(r6(e7));
@@ -1811,8 +1834,8 @@ ${n6.join("\n")}
1811
1834
  n5.contentWindow ? (n5.contentWindow.addEventListener("afterprint", o3, { once: true }), n5.contentWindow.print()) : o3();
1812
1835
  }, toHTML: (e7) => i10(r6(e7)) ?? "" };
1813
1836
  })(n3, s4, t3, r5);
1814
- } else this.service = Un;
1815
- e5.registerService($n, this.service);
1837
+ } else this.service = Yn;
1838
+ e5.registerService(Jn, this.service);
1816
1839
  const s3 = this.config.defaults ?? {}, r4 = this.service, i9 = this.locale;
1817
1840
  e5.registerCommand("print", () => (e5.announce(i9.printingAnnouncement), r4.print(s3), true));
1818
1841
  const o2 = this.config.keyBinding ?? "Mod-P";
@@ -1825,23 +1848,23 @@ ${n6.join("\n")}
1825
1848
  this.service = null;
1826
1849
  }
1827
1850
  }
1828
- const Vn = { Light: "light", Dark: "dark", System: "system" }, Gn = { name: "light", primitives: { background: "#ffffff", foreground: "#1a1a1a", mutedForeground: "#666666", border: "#d0d0d0", borderFocus: "#4a90d9", primary: "#4a90d9", primaryForeground: "#1a5fa0", primaryMuted: "#d0e0f0", surfaceRaised: "#f8f8f8", surfaceOverlay: "#ffffff", hoverBackground: "#e8e8e8", activeBackground: "#d0e0f0", danger: "#dc2626", dangerMuted: "#fee2e2", success: "#1a8c1a", shadow: "rgba(0, 0, 0, 0.15)", focusRing: "rgba(74, 144, 217, 0.2)" }, codeBlock: { background: "#f8fafc", foreground: "#334155", headerBackground: "#f1f5f9", headerForeground: "#64748b", headerBorder: "#e2e8f0" }, tooltip: { background: "#1a1a1a", foreground: "#ffffff" } }, qn = { name: "dark", primitives: { background: "#1e1e2e", foreground: "#cdd6f4", mutedForeground: "#7f849c", border: "#45475a", borderFocus: "#89b4fa", primary: "#89b4fa", primaryForeground: "#89b4fa", primaryMuted: "rgba(137, 180, 250, 0.15)", surfaceRaised: "#313244", surfaceOverlay: "#313244", hoverBackground: "#45475a", activeBackground: "rgba(137, 180, 250, 0.15)", danger: "#f38ba8", dangerMuted: "rgba(243, 139, 168, 0.15)", success: "#a6e3a1", shadow: "rgba(0, 0, 0, 0.4)", focusRing: "rgba(137, 180, 250, 0.25)" }, codeBlock: { background: "#11111b", foreground: "#cdd6f4", headerBackground: "#181825", headerForeground: "#7f849c", headerBorder: "rgba(205, 214, 244, 0.08)" }, tooltip: { background: "#585b70", foreground: "#cdd6f4" } };
1829
- function Jn(e5, t3) {
1851
+ const es = { Light: "light", Dark: "dark", System: "system" }, ts = { name: "light", primitives: { background: "#ffffff", foreground: "#1a1a1a", mutedForeground: "#666666", border: "#d0d0d0", borderFocus: "#4a90d9", primary: "#4a90d9", primaryForeground: "#1a5fa0", primaryMuted: "#d0e0f0", surfaceRaised: "#f8f8f8", surfaceOverlay: "#ffffff", hoverBackground: "#e8e8e8", activeBackground: "#d0e0f0", danger: "#dc2626", dangerMuted: "#fee2e2", success: "#1a8c1a", shadow: "rgba(0, 0, 0, 0.15)", focusRing: "rgba(74, 144, 217, 0.2)" }, codeBlock: { background: "#f8fafc", foreground: "#334155", headerBackground: "#f1f5f9", headerForeground: "#64748b", headerBorder: "#e2e8f0" }, tooltip: { background: "#1a1a1a", foreground: "#ffffff" } }, ns = { name: "dark", primitives: { background: "#1e1e2e", foreground: "#cdd6f4", mutedForeground: "#7f849c", border: "#45475a", borderFocus: "#89b4fa", primary: "#89b4fa", primaryForeground: "#89b4fa", primaryMuted: "rgba(137, 180, 250, 0.15)", surfaceRaised: "#313244", surfaceOverlay: "#313244", hoverBackground: "#45475a", activeBackground: "rgba(137, 180, 250, 0.15)", danger: "#f38ba8", dangerMuted: "rgba(243, 139, 168, 0.15)", success: "#a6e3a1", shadow: "rgba(0, 0, 0, 0.4)", focusRing: "rgba(137, 180, 250, 0.25)" }, codeBlock: { background: "#11111b", foreground: "#cdd6f4", headerBackground: "#181825", headerForeground: "#7f849c", headerBorder: "rgba(205, 214, 244, 0.08)" }, tooltip: { background: "#585b70", foreground: "#cdd6f4" } };
1852
+ function ss(e5, t3) {
1830
1853
  return { name: t3.name, primitives: { ...e5.primitives, ...t3.primitives }, toolbar: t3.toolbar ? { ...e5.toolbar, ...t3.toolbar } : e5.toolbar, codeBlock: t3.codeBlock ? { ...e5.codeBlock, ...t3.codeBlock } : e5.codeBlock, tooltip: t3.tooltip ? { ...e5.tooltip, ...t3.tooltip } : e5.tooltip };
1831
1854
  }
1832
- function Qn(e5) {
1855
+ function rs(e5) {
1833
1856
  if ("object" == typeof e5) return e5;
1834
1857
  switch (e5) {
1835
- case Vn.Light:
1836
- return Gn;
1837
- case Vn.Dark:
1838
- return qn;
1858
+ case es.Light:
1859
+ return ts;
1860
+ case es.Dark:
1861
+ return ns;
1839
1862
  default:
1840
- return Gn;
1863
+ return ts;
1841
1864
  }
1842
1865
  }
1843
- const Xn = [["primitives.background", "--notectl-bg"], ["primitives.foreground", "--notectl-fg"], ["primitives.mutedForeground", "--notectl-fg-muted"], ["primitives.border", "--notectl-border"], ["primitives.borderFocus", "--notectl-border-focus"], ["primitives.primary", "--notectl-primary"], ["primitives.primaryForeground", "--notectl-primary-fg"], ["primitives.primaryMuted", "--notectl-primary-muted"], ["primitives.surfaceRaised", "--notectl-surface-raised"], ["primitives.surfaceOverlay", "--notectl-surface-overlay"], ["primitives.hoverBackground", "--notectl-hover-bg"], ["primitives.activeBackground", "--notectl-active-bg"], ["primitives.danger", "--notectl-danger"], ["primitives.dangerMuted", "--notectl-danger-muted"], ["primitives.success", "--notectl-success"], ["primitives.shadow", "--notectl-shadow"], ["primitives.focusRing", "--notectl-focus-ring"], ["toolbar.background", "--notectl-toolbar-bg"], ["toolbar.borderColor", "--notectl-toolbar-border"], ["codeBlock.background", "--notectl-code-block-bg"], ["codeBlock.foreground", "--notectl-code-block-color"], ["codeBlock.headerBackground", "--notectl-code-block-header-bg"], ["codeBlock.headerForeground", "--notectl-code-block-header-color"], ["codeBlock.headerBorder", "--notectl-code-block-header-border"], ["tooltip.background", "--notectl-tooltip-bg"], ["tooltip.foreground", "--notectl-tooltip-fg"]], Yn = /* @__PURE__ */ new Map([["--notectl-toolbar-bg", "var(--notectl-surface-raised)"], ["--notectl-toolbar-border", "var(--notectl-border)"], ["--notectl-code-block-bg", "var(--notectl-surface-raised)"], ["--notectl-code-block-color", "var(--notectl-fg)"], ["--notectl-code-block-header-bg", "var(--notectl-surface-raised)"], ["--notectl-code-block-header-color", "var(--notectl-fg-muted)"], ["--notectl-code-block-header-border", "var(--notectl-border)"], ["--notectl-tooltip-bg", "var(--notectl-fg)"], ["--notectl-tooltip-fg", "var(--notectl-bg)"]]);
1844
- function Zn(e5, t3) {
1866
+ const is = [["primitives.background", "--notectl-bg"], ["primitives.foreground", "--notectl-fg"], ["primitives.mutedForeground", "--notectl-fg-muted"], ["primitives.border", "--notectl-border"], ["primitives.borderFocus", "--notectl-border-focus"], ["primitives.primary", "--notectl-primary"], ["primitives.primaryForeground", "--notectl-primary-fg"], ["primitives.primaryMuted", "--notectl-primary-muted"], ["primitives.surfaceRaised", "--notectl-surface-raised"], ["primitives.surfaceOverlay", "--notectl-surface-overlay"], ["primitives.hoverBackground", "--notectl-hover-bg"], ["primitives.activeBackground", "--notectl-active-bg"], ["primitives.danger", "--notectl-danger"], ["primitives.dangerMuted", "--notectl-danger-muted"], ["primitives.success", "--notectl-success"], ["primitives.shadow", "--notectl-shadow"], ["primitives.focusRing", "--notectl-focus-ring"], ["toolbar.background", "--notectl-toolbar-bg"], ["toolbar.borderColor", "--notectl-toolbar-border"], ["codeBlock.background", "--notectl-code-block-bg"], ["codeBlock.foreground", "--notectl-code-block-color"], ["codeBlock.headerBackground", "--notectl-code-block-header-bg"], ["codeBlock.headerForeground", "--notectl-code-block-header-color"], ["codeBlock.headerBorder", "--notectl-code-block-header-border"], ["tooltip.background", "--notectl-tooltip-bg"], ["tooltip.foreground", "--notectl-tooltip-fg"]], os = /* @__PURE__ */ new Map([["--notectl-toolbar-bg", "var(--notectl-surface-raised)"], ["--notectl-toolbar-border", "var(--notectl-border)"], ["--notectl-code-block-bg", "var(--notectl-surface-raised)"], ["--notectl-code-block-color", "var(--notectl-fg)"], ["--notectl-code-block-header-bg", "var(--notectl-surface-raised)"], ["--notectl-code-block-header-color", "var(--notectl-fg-muted)"], ["--notectl-code-block-header-border", "var(--notectl-border)"], ["--notectl-tooltip-bg", "var(--notectl-fg)"], ["--notectl-tooltip-fg", "var(--notectl-bg)"]]);
1867
+ function as(e5, t3) {
1845
1868
  const n3 = t3.split(".");
1846
1869
  let s3 = e5;
1847
1870
  for (const e6 of n3) {
@@ -1851,46 +1874,91 @@ function Zn(e5, t3) {
1851
1874
  }
1852
1875
  return "string" == typeof s3 ? s3 : void 0;
1853
1876
  }
1854
- function es(e5) {
1877
+ function cs(e5) {
1855
1878
  const t3 = [":host {"];
1856
- for (const [n3, s3] of Xn) {
1857
- const r4 = Zn(e5, n3);
1879
+ for (const [n3, s3] of is) {
1880
+ const r4 = as(e5, n3);
1858
1881
  if (void 0 !== r4) t3.push(` ${s3}: ${r4};`);
1859
1882
  else {
1860
- const e6 = Yn.get(s3);
1883
+ const e6 = os.get(s3);
1861
1884
  e6 && t3.push(` ${s3}: ${e6};`);
1862
1885
  }
1863
1886
  }
1864
1887
  return t3.push("}"), t3.join("\n");
1865
1888
  }
1866
- function ts(e5) {
1889
+ function ls(e5) {
1867
1890
  const t3 = new CSSStyleSheet();
1868
- return t3.replaceSync(es(e5)), t3;
1869
- }
1870
- const ns = { EN: "en", DE: "de", ES: "es", FR: "fr", ZH: "zh", RU: "ru", AR: "ar", HI: "hi", BROWSER: "browser" }, ss = /* @__PURE__ */ new Set(["left", "center", "right", "justify"]);
1871
- function rs(e5, t3) {
1872
- const n3 = is(e5.children, t3), s3 = t3 ? t3.getAllowedTags() : ["p", "br", "div", "span"], r4 = t3 ? t3.getAllowedAttrs() : ["style"];
1873
- return Lt.sanitize(n3, { ALLOWED_TAGS: s3, ALLOWED_ATTR: r4 });
1891
+ return t3.replaceSync(cs(e5)), t3;
1892
+ }
1893
+ const hs = { EN: "en", DE: "de", ES: "es", FR: "fr", ZH: "zh", RU: "ru", AR: "ar", HI: "hi", BROWSER: "browser" };
1894
+ function ds(e5) {
1895
+ let t3 = 2166136261;
1896
+ for (let n3 = 0; n3 < e5.length; n3++) t3 ^= e5.charCodeAt(n3), t3 = Math.imul(t3, 16777619);
1897
+ return (t3 >>> 0).toString(36).padStart(6, "0");
1898
+ }
1899
+ class us {
1900
+ classMap = /* @__PURE__ */ new Map();
1901
+ usedHashes = /* @__PURE__ */ new Set();
1902
+ getClassName(e5) {
1903
+ const t3 = (function(e6) {
1904
+ return e6.split(";").map((e7) => e7.trim()).filter((e7) => e7.length > 0).sort().join("; ");
1905
+ })(e5), n3 = this.classMap.get(t3);
1906
+ if (n3) return n3;
1907
+ let s3 = ds(t3), r4 = 0;
1908
+ for (; this.usedHashes.has(s3); ) r4++, s3 = ds(t3 + String(r4));
1909
+ const i9 = `notectl-s-${s3}`;
1910
+ return this.usedHashes.add(s3), this.classMap.set(t3, i9), i9;
1911
+ }
1912
+ getAlignmentClassName(e5) {
1913
+ const t3 = `text-align: ${e5}`, n3 = this.classMap.get(t3);
1914
+ if (n3) return n3;
1915
+ const s3 = `notectl-align-${e5}`;
1916
+ return this.classMap.set(t3, s3), s3;
1917
+ }
1918
+ toCSS() {
1919
+ if (0 === this.classMap.size) return "";
1920
+ const e5 = [];
1921
+ for (const [t3, n3] of this.classMap) e5.push(`.${n3} { ${t3}; }`);
1922
+ return e5.join("\n");
1923
+ }
1924
+ toStyleMap() {
1925
+ const e5 = /* @__PURE__ */ new Map();
1926
+ for (const [t3, n3] of this.classMap) e5.set(n3, t3);
1927
+ return e5;
1928
+ }
1874
1929
  }
1875
- function is(e5, t3) {
1930
+ const ps = /* @__PURE__ */ new Set(["left", "center", "right", "justify"]);
1931
+ function fs(e5, t3) {
1932
+ const n3 = { registry: t3, exportCtx: { styleAttr: (e6) => e6 ? ` style="${e6}"` : "" } }, s3 = ms(e5.children, n3), r4 = t3 ? t3.getAllowedTags() : ["p", "br", "div", "span"], i9 = t3 ? t3.getAllowedAttrs() : ["style"];
1933
+ return Dt.sanitize(s3, { ALLOWED_TAGS: r4, ALLOWED_ATTR: i9 });
1934
+ }
1935
+ function gs(e5, t3) {
1936
+ const n3 = new us(), s3 = /* @__PURE__ */ (function(e6) {
1937
+ return { styleAttr: (t4) => t4 ? ` class="${e6.getClassName(t4)}"` : "" };
1938
+ })(n3), r4 = { registry: t3, collector: n3, exportCtx: s3 }, i9 = ms(e5.children, r4), o2 = t3 ? t3.getAllowedTags() : ["p", "br", "div", "span"], a22 = t3 ? t3.getAllowedAttrs() : ["style", "class"];
1939
+ a22.includes("class") || a22.push("class");
1940
+ const c11 = a22.filter((e6) => "style" !== e6);
1941
+ return { html: Dt.sanitize(i9, { ALLOWED_TAGS: o2, ALLOWED_ATTR: c11 }), css: n3.toCSS(), styleMap: n3.toStyleMap() };
1942
+ }
1943
+ function ms(e5, t3) {
1876
1944
  const n3 = [];
1877
1945
  let s3 = 0;
1878
1946
  for (; s3 < e5.length; ) {
1879
1947
  const r4 = e5[s3];
1880
- if (r4) if (we(r4, "list_item")) {
1948
+ if (r4) if (Se(r4, "list_item")) {
1881
1949
  const r5 = [];
1882
1950
  for (; s3 < e5.length; ) {
1883
1951
  const t4 = e5[s3];
1884
- if (!t4 || !we(t4, "list_item")) break;
1952
+ if (!t4 || !Se(t4, "list_item")) break;
1885
1953
  r5.push(t4), s3++;
1886
1954
  }
1887
- n3.push(os(r5, t3));
1888
- } else n3.push(cs(r4, t3)), s3++;
1955
+ n3.push(ys(r5, t3));
1956
+ } else n3.push(bs(r4, t3)), s3++;
1889
1957
  else s3++;
1890
1958
  }
1891
1959
  return n3.join("");
1892
1960
  }
1893
- function os(e5, t3) {
1961
+ function ys(e5, t3) {
1894
1962
  const n3 = [], s3 = [];
1895
1963
  for (let r4 = 0; r4 < e5.length; r4++) {
1896
1964
  const i9 = e5[r4];
@@ -1910,8 +1978,8 @@ function os(e5, t3) {
1910
1978
  const e6 = s3[s3.length - 1];
1911
1979
  e6 && a22 > e6.indent && (n3.push(`<${c11}>`), s3.push({ tag: c11, indent: a22 }));
1912
1980
  }
1913
- const l3 = cs(i9, t3), h4 = e5[r4 + 1], d5 = h4 ? h4.attrs?.indent ?? 0 : void 0;
1914
- void 0 !== d5 && d5 > a22 ? n3.push(as(l3)) : n3.push(l3);
1981
+ const l3 = bs(i9, t3), h4 = e5[r4 + 1], d5 = h4 ? h4.attrs?.indent ?? 0 : void 0;
1982
+ void 0 !== d5 && d5 > a22 ? n3.push(ks(l3)) : n3.push(l3);
1915
1983
  }
1916
1984
  for (; s3.length > 0; ) {
1917
1985
  const e6 = s3.pop();
@@ -1920,10 +1988,10 @@ function os(e5, t3) {
1920
1988
  }
1921
1989
  return n3.join("");
1922
1990
  }
1923
- function as(e5) {
1991
+ function ks(e5) {
1924
1992
  return e5.endsWith("</li>") ? e5.slice(0, -5) : e5;
1925
1993
  }
1926
- function cs(e5, t3) {
1994
+ function bs(e5, t3) {
1927
1995
  const n3 = V(e5) ? (function(e6, t4) {
1928
1996
  const n4 = (function(e7) {
1929
1997
  if (e7.length <= 1) return e7;
@@ -1937,57 +2005,81 @@ function cs(e5, t3) {
1937
2005
  e8 && R(e8) && Q(e8.marks, n5.marks) ? t5[t5.length - 1] = { type: "text", text: e8.text + n5.text, marks: e8.marks } : t5.push(n5);
1938
2006
  }
1939
2007
  return t5;
1940
- })(I(e6)), s4 = [], r5 = t4 ? on(t4) : void 0;
2008
+ })(I(e6)), s4 = [], r5 = t4.registry ? pn(t4.registry) : void 0;
1941
2009
  for (const e7 of n4) if (C(e7)) {
1942
- const n5 = t4?.getInlineNodeSpec(e7.inlineType);
2010
+ const n5 = t4.registry?.getInlineNodeSpec(e7.inlineType);
1943
2011
  n5?.toHTMLString && s4.push(n5.toHTMLString(e7));
1944
- } else t4 ? s4.push(an(e7.text, e7.marks, t4, r5)) : "" !== e7.text && s4.push(Ee(e7.text));
2012
+ } else t4.registry && t4.collector ? s4.push(gn(e7.text, e7.marks, t4.registry, t4.collector, r5)) : t4.registry ? s4.push(fn(e7.text, e7.marks, t4.registry, r5)) : "" !== e7.text && s4.push(Ee(e7.text));
1945
2013
  return s4.join("");
1946
- })(e5, t3) : is(J(e5), t3), s3 = t3?.getNodeSpec(e5.type);
2014
+ })(e5, t3) : ms(J(e5), t3), s3 = t3.registry?.getNodeSpec(e5.type);
1947
2015
  let r4;
1948
- r4 = s3?.toHTML ? s3.toHTML(e5, n3) : `<p>${n3 || "<br>"}</p>`;
1949
- const i9 = e5.attrs?.align, o2 = /style="[^"]*text-align:/.test(r4);
1950
- return i9 && "left" !== i9 && ss.has(i9) && !o2 && (r4 = r4.replace(/>/, ` style="text-align: ${i9}">`)), r4;
1951
- }
1952
- function ls(e5, t3) {
1953
- const n3 = t3 ? t3.getAllowedTags() : ["p", "br", "div", "span"], s3 = t3 ? t3.getAllowedAttrs() : ["style"], r4 = document.createElement("template");
1954
- r4.innerHTML = Lt.sanitize(e5, { ALLOWED_TAGS: n3, ALLOWED_ATTR: s3 });
1955
- const i9 = r4.content, o2 = t3?.getBlockParseRules() ?? [], a22 = [];
1956
- for (const e6 of Array.from(i9.childNodes)) if (e6.nodeType === Node.ELEMENT_NODE) {
2016
+ r4 = s3?.toHTML ? s3.toHTML(e5, n3, t3.exportCtx) : `<p>${n3 || "<br>"}</p>`;
2017
+ const i9 = e5.attrs?.align;
2018
+ if (i9 && "left" !== i9 && ps.has(i9)) if (t3.collector) {
2019
+ const e6 = t3.collector.getAlignmentClassName(i9), n4 = r4.indexOf(">"), s4 = r4.slice(0, n4 + 1).match(/class="([^"]*)"/);
2020
+ r4 = s4 ? r4.replace(`class="${s4[1]}"`, `class="${s4[1]} ${e6}"`) : r4.replace(/>/, ` class="${e6}">`);
2021
+ } else {
2022
+ const e6 = r4.indexOf(">"), t4 = r4.slice(0, e6 + 1).match(/style="([^"]*)"/), n4 = t4?.[1];
2023
+ void 0 !== n4 ? /text-align:/.test(n4) || (r4 = r4.replace(`style="${n4}"`, `style="${n4}; text-align: ${i9}"`)) : r4 = r4.replace(/>/, ` style="text-align: ${i9}">`);
2024
+ }
2025
+ return r4;
2026
+ }
2027
+ function vs(e5, t3, n3) {
2028
+ const s3 = t3 ? t3.getAllowedTags() : ["p", "br", "div", "span"], r4 = t3 ? t3.getAllowedAttrs() : ["style"];
2029
+ n3?.styleMap && !r4.includes("class") && r4.push("class");
2030
+ const i9 = document.createElement("template");
2031
+ i9.innerHTML = Dt.sanitize(e5, { ALLOWED_TAGS: s3, ALLOWED_ATTR: r4 });
2032
+ const o2 = i9.content;
2033
+ n3?.styleMap && (function(e6, t4) {
2034
+ const n4 = e6.querySelectorAll("[class]");
2035
+ for (const e7 of Array.from(n4)) {
2036
+ const n5 = e7, s4 = Array.from(n5.classList), r5 = [];
2037
+ for (const e8 of s4) {
2038
+ const s5 = t4.get(e8);
2039
+ if (s5) {
2040
+ const t5 = n5.getAttribute("style") ?? "", i10 = t5 && !t5.endsWith(";") ? "; " : "";
2041
+ n5.setAttribute("style", t5 + i10 + s5), r5.push(e8);
2042
+ }
2043
+ }
2044
+ for (const e8 of r5) n5.classList.remove(e8);
2045
+ }
2046
+ })(o2, n3.styleMap);
2047
+ const a22 = t3?.getBlockParseRules() ?? [], c11 = [];
2048
+ for (const e6 of Array.from(o2.childNodes)) if (e6.nodeType === Node.ELEMENT_NODE) {
1957
2049
  const n4 = e6, s4 = n4.tagName.toLowerCase();
1958
2050
  if ("ul" === s4 || "ol" === s4) {
1959
- hs(n4, "ol" === s4 ? "ordered" : "bullet", 0, a22, t3);
2051
+ Ss(n4, "ol" === s4 ? "ordered" : "bullet", 0, c11, t3);
1960
2052
  continue;
1961
2053
  }
1962
- const r5 = fs(n4, o2);
2054
+ const r5 = Cs(n4, a22);
1963
2055
  if (r5) {
1964
- const e7 = ds(n4, t3), s5 = { ...r5.attrs };
1965
- ps(n4, s5), a22.push(_(ke(r5.type), e7, void 0, Object.keys(s5).length > 0 ? s5 : void 0));
2056
+ const e7 = ws(n4, t3), s5 = { ...r5.attrs };
2057
+ xs(n4, s5), c11.push(_(ke(r5.type), e7, void 0, Object.keys(s5).length > 0 ? s5 : void 0));
1966
2058
  continue;
1967
2059
  }
1968
- const i10 = ds(n4, t3), c11 = {};
1969
- ps(n4, c11), a22.push(_(ke("paragraph"), i10, void 0, Object.keys(c11).length > 0 ? c11 : void 0));
1970
- } else e6.nodeType === Node.TEXT_NODE && e6.textContent?.trim() && a22.push(_(ke("paragraph"), [T(e6.textContent.trim())]));
1971
- return 0 === a22.length ? W() : W(a22);
2060
+ const i10 = ws(n4, t3), o3 = {};
2061
+ xs(n4, o3), c11.push(_(ke("paragraph"), i10, void 0, Object.keys(o3).length > 0 ? o3 : void 0));
2062
+ } else e6.nodeType === Node.TEXT_NODE && e6.textContent?.trim() && c11.push(_(ke("paragraph"), [T(e6.textContent.trim())]));
2063
+ return 0 === c11.length ? W() : W(c11);
1972
2064
  }
1973
- function hs(e5, t3, n3, s3, r4) {
2065
+ function Ss(e5, t3, n3, s3, r4) {
1974
2066
  for (const i9 of Array.from(e5.children)) {
1975
2067
  const e6 = i9.tagName.toLowerCase();
1976
2068
  if ("li" === e6) {
1977
- const e7 = i9, o2 = e7.querySelector(':scope > input[type="checkbox"]'), a22 = null !== o2, c11 = o2?.hasAttribute("checked") ?? false, l3 = a22 ? "checklist" : t3, h4 = ds(e7, r4, true), d5 = { listType: l3, indent: n3, checked: c11 };
2069
+ const e7 = i9, o2 = e7.querySelector(':scope > input[type="checkbox"]'), a22 = null !== o2, c11 = o2?.hasAttribute("checked") ?? false, l3 = a22 ? "checklist" : t3, h4 = ws(e7, r4, true), d5 = { listType: l3, indent: n3, checked: c11 };
1978
2070
  s3.push(_(ke("list_item"), h4, void 0, d5));
1979
2071
  for (const t4 of Array.from(e7.children)) {
1980
2072
  const e8 = t4.tagName.toLowerCase();
1981
- "ul" !== e8 && "ol" !== e8 || hs(t4, "ol" === e8 ? "ordered" : "bullet", n3 + 1, s3, r4);
2073
+ "ul" !== e8 && "ol" !== e8 || Ss(t4, "ol" === e8 ? "ordered" : "bullet", n3 + 1, s3, r4);
1982
2074
  }
1983
- } else "ul" !== e6 && "ol" !== e6 || hs(i9, "ol" === e6 ? "ordered" : "bullet", n3 + 1, s3, r4);
2075
+ } else "ul" !== e6 && "ol" !== e6 || Ss(i9, "ol" === e6 ? "ordered" : "bullet", n3 + 1, s3, r4);
1984
2076
  }
1985
2077
  }
1986
- function ds(e5, t3, n3) {
2078
+ function ws(e5, t3, n3) {
1987
2079
  const s3 = [];
1988
- return us(e5, [], s3, t3?.getMarkParseRules() ?? [], t3?.getInlineParseRules() ?? [], n3), s3.length > 0 ? s3 : [T("")];
2080
+ return Es(e5, [], s3, t3?.getMarkParseRules() ?? [], t3?.getInlineParseRules() ?? [], n3), s3.length > 0 ? s3 : [T("")];
1989
2081
  }
1990
- function us(e5, t3, n3, s3, r4, i9) {
2082
+ function Es(e5, t3, n3, s3, r4, i9) {
1991
2083
  if (e5.nodeType === Node.TEXT_NODE) {
1992
2084
  const s4 = e5.textContent ?? "";
1993
2085
  return void (s4 && n3.push(T(s4, [...t3])));
@@ -2000,23 +2092,27 @@ function us(e5, t3, n3, s3, r4, i9) {
2000
2092
  if (e6.rule.getAttrs) {
2001
2093
  const t4 = e6.rule.getAttrs(o2);
2002
2094
  if (false === t4) continue;
2003
- return void n3.push(X(ve(e6.type), t4));
2095
+ return void n3.push(X(be(e6.type), t4));
2004
2096
  }
2005
- return void n3.push(X(ve(e6.type)));
2097
+ return void n3.push(X(be(e6.type)));
2006
2098
  }
2007
2099
  const c11 = [...t3], l3 = /* @__PURE__ */ new Set();
2008
2100
  for (const e6 of s3) if (e6.rule.tag === a22 && !l3.has(e6.type)) if (e6.rule.getAttrs) {
2009
2101
  const t4 = e6.rule.getAttrs(o2);
2010
2102
  if (false === t4) continue;
2011
- c11.some((t5) => t5.type === e6.type) || (c11.push({ type: be(e6.type), ...Object.keys(t4).length > 0 ? { attrs: t4 } : {} }), l3.add(e6.type));
2012
- } else c11.some((t4) => t4.type === e6.type) || (c11.push({ type: be(e6.type) }), l3.add(e6.type));
2013
- for (const e6 of Array.from(o2.childNodes)) us(e6, c11, n3, s3, r4, i9);
2103
+ c11.some((t5) => t5.type === e6.type) || (c11.push({ type: ve(e6.type), ...Object.keys(t4).length > 0 ? { attrs: t4 } : {} }), l3.add(e6.type));
2104
+ } else c11.some((t4) => t4.type === e6.type) || (c11.push({ type: ve(e6.type) }), l3.add(e6.type));
2105
+ for (const e6 of Array.from(o2.childNodes)) Es(e6, c11, n3, s3, r4, i9);
2014
2106
  }
2015
- function ps(e5, t3) {
2107
+ function xs(e5, t3) {
2016
2108
  const n3 = e5.style?.textAlign ?? "";
2017
- n3 && ss.has(n3) && (t3.align = n3);
2109
+ if (n3 && ps.has(n3)) t3.align = n3;
2110
+ else for (const n4 of Array.from(e5.classList)) {
2111
+ const e6 = n4.match(/^notectl-align-(\w+)$/), s3 = e6?.[1];
2112
+ if (s3 && ps.has(s3)) return void (t3.align = s3);
2113
+ }
2018
2114
  }
2019
- function fs(e5, t3) {
2115
+ function Cs(e5, t3) {
2020
2116
  const n3 = e5.tagName.toLowerCase();
2021
2117
  for (const s3 of t3) if (s3.rule.tag === n3) {
2022
2118
  if (s3.rule.getAttrs) {
@@ -2028,9 +2124,31 @@ function fs(e5, t3) {
2028
2124
  }
2029
2125
  return null;
2030
2126
  }
2031
- class gs {
2127
+ function Ts(e5, t3) {
2128
+ const n3 = t3?.document ?? globalThis.document, s3 = t3?.container ?? n3.head;
2129
+ if (t3?.id) {
2130
+ const s4 = n3.getElementById(t3.id);
2131
+ if (s4 instanceof HTMLStyleElement) return s4.textContent = e5, t3.nonce && s4.setAttribute("nonce", t3.nonce), s4;
2132
+ }
2133
+ const r4 = n3.createElement("style");
2134
+ return r4.textContent = e5, t3?.id && (r4.id = t3.id), t3?.nonce && r4.setAttribute("nonce", t3.nonce), s3.appendChild(r4), r4;
2135
+ }
2136
+ function As(e5, t3) {
2137
+ const n3 = (t3 ?? globalThis.document).getElementById(e5);
2138
+ n3 && n3.remove();
2139
+ }
2140
+ const Rs = /* @__PURE__ */ new WeakSet();
2141
+ function Ls(e5, t3) {
2142
+ const n3 = t3?.target ?? globalThis.document, s3 = new CSSStyleSheet();
2143
+ return s3.replaceSync(e5), Rs.add(s3), t3?.replace && (n3.adoptedStyleSheets = n3.adoptedStyleSheets.filter((e6) => !Rs.has(e6))), n3.adoptedStyleSheets = [...n3.adoptedStyleSheets, s3], s3;
2144
+ }
2145
+ function Ms(e5, t3) {
2146
+ const n3 = t3 ?? globalThis.document;
2147
+ n3.adoptedStyleSheets = n3.adoptedStyleSheets.filter((t4) => t4 !== e5);
2148
+ }
2149
+ class Is {
2032
2150
  constructor(e5, t3) {
2033
- this.element = e5, this.getState = t3.getState, this.dispatch = t3.dispatch, this.syncSelection = t3.syncSelection, this.inputRuleRegistry = t3.inputRuleRegistry, this.isReadOnly = t3.isReadOnly ?? (() => false), this.compositionTracker = t3.compositionTracker ?? new hn(), this.handleBeforeInput = this.onBeforeInput.bind(this), this.handleCompositionStart = this.onCompositionStart.bind(this), this.handleCompositionEnd = this.onCompositionEnd.bind(this), e5.addEventListener("beforeinput", this.handleBeforeInput), e5.addEventListener("compositionstart", this.handleCompositionStart), e5.addEventListener("compositionend", this.handleCompositionEnd);
2151
+ this.element = e5, this.getState = t3.getState, this.dispatch = t3.dispatch, this.syncSelection = t3.syncSelection, this.inputRuleRegistry = t3.inputRuleRegistry, this.isReadOnly = t3.isReadOnly ?? (() => false), this.compositionTracker = t3.compositionTracker ?? new kn(), this.handleBeforeInput = this.onBeforeInput.bind(this), this.handleCompositionStart = this.onCompositionStart.bind(this), this.handleCompositionEnd = this.onCompositionEnd.bind(this), e5.addEventListener("beforeinput", this.handleBeforeInput), e5.addEventListener("compositionstart", this.handleCompositionStart), e5.addEventListener("compositionend", this.handleCompositionEnd);
2034
2152
  }
2035
2153
  getState;
2036
2154
  dispatch;
@@ -2059,29 +2177,29 @@ class gs {
2059
2177
  break;
2060
2178
  case "deleteContentBackward":
2061
2179
  case "deleteByCut":
2062
- n3 = tn(t3);
2180
+ n3 = ln(t3);
2063
2181
  break;
2064
2182
  case "deleteContentForward":
2065
- n3 = nn(t3);
2183
+ n3 = hn(t3);
2066
2184
  break;
2067
2185
  case "deleteWordBackward":
2068
2186
  n3 = (function(e6) {
2069
- return en(e6, { merge: Ke, range: (e7, t4) => t4 > 0 ? [ee(e7, t4), t4] : null });
2187
+ return cn(e6, { merge: Ke, range: (e7, t4) => t4 > 0 ? [ee(e7, t4), t4] : null });
2070
2188
  })(t3);
2071
2189
  break;
2072
2190
  case "deleteWordForward":
2073
2191
  n3 = (function(e6) {
2074
- return en(e6, { merge: $e, range: (e7, t4) => t4 < O(e7) ? [t4, Z(e7, t4)] : null });
2192
+ return cn(e6, { merge: $e, range: (e7, t4) => t4 < O(e7) ? [t4, Z(e7, t4)] : null });
2075
2193
  })(t3);
2076
2194
  break;
2077
2195
  case "deleteSoftLineBackward":
2078
2196
  n3 = (function(e6) {
2079
- return en(e6, { merge: Ke, range: (e7, t4) => t4 > 0 ? [0, t4] : null });
2197
+ return cn(e6, { merge: Ke, range: (e7, t4) => t4 > 0 ? [0, t4] : null });
2080
2198
  })(t3);
2081
2199
  break;
2082
2200
  case "deleteSoftLineForward":
2083
2201
  n3 = (function(e6) {
2084
- return en(e6, { merge: $e, range: (e7, t4) => {
2202
+ return cn(e6, { merge: $e, range: (e7, t4) => {
2085
2203
  const n4 = O(e7);
2086
2204
  return t4 < n4 ? [t4, n4] : null;
2087
2205
  } });
@@ -2121,13 +2239,13 @@ class gs {
2121
2239
  this.element.removeEventListener("beforeinput", this.handleBeforeInput), this.element.removeEventListener("compositionstart", this.handleCompositionStart), this.element.removeEventListener("compositionend", this.handleCompositionEnd);
2122
2240
  }
2123
2241
  }
2124
- function ms(e5) {
2242
+ function Ns(e5) {
2125
2243
  return e5.reduce((e6, t3) => e6 + t3.text, "");
2126
2244
  }
2127
- function ys(e5) {
2245
+ function Bs(e5) {
2128
2246
  return e5.reduce((e6, t3) => e6 + t3.text.length, 0);
2129
2247
  }
2130
- function ks(e5, t3) {
2248
+ function Os(e5, t3) {
2131
2249
  const n3 = Ae(e5.doc, t3.blockId);
2132
2250
  if (!n3) return null;
2133
2251
  const s3 = n3.length > 1 ? n3.slice(0, -1) : [], r4 = (0 === s3.length ? e5.doc.children : (() => {
@@ -2138,19 +2256,19 @@ function ks(e5, t3) {
2138
2256
  const i9 = "before" === t3.side ? r4 : r4 + 1;
2139
2257
  return { parentPath: s3, insertIndex: i9 };
2140
2258
  }
2141
- function vs(e5, t3, n3) {
2142
- const s3 = ks(e5, t3);
2259
+ function _s(e5, t3, n3) {
2260
+ const s3 = Os(e5, t3);
2143
2261
  if (!s3) return e5.transaction("paste").setSelection(t3).build();
2144
2262
  const r4 = e5.transaction("paste");
2145
2263
  let i9, o2 = s3.insertIndex, a22 = 0;
2146
2264
  for (const e6 of n3) {
2147
- const t4 = Y(), n4 = ms(e6.segments), c11 = e6.segments.map((e7) => T(e7.text, [...e7.marks])), l3 = _(e6.type, c11.length > 0 ? c11 : [T("")], t4, e6.attrs);
2265
+ const t4 = Y(), n4 = Ns(e6.segments), c11 = e6.segments.map((e7) => T(e7.text, [...e7.marks])), l3 = _(e6.type, c11.length > 0 ? c11 : [T("")], t4, e6.attrs);
2148
2266
  r4.insertNode(s3.parentPath, o2, l3), o2++, i9 = t4, a22 = n4.length;
2149
2267
  }
2150
2268
  return i9 && r4.setSelection(re(i9, a22)), r4.build();
2151
2269
  }
2152
- const bs = /* @__PURE__ */ new Set(["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "BLOCKQUOTE", "UL", "OL", "LI", "HR", "PRE", "TABLE", "THEAD", "TBODY", "TR"]), ws = /* @__PURE__ */ new Set(["STRONG", "B", "EM", "I", "U", "S", "STRIKE", "DEL", "A", "SPAN", "BR", "SUB", "SUP", "CODE"]);
2153
- class Ss {
2270
+ const Ds = /* @__PURE__ */ new Set(["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "BLOCKQUOTE", "UL", "OL", "LI", "HR", "PRE", "TABLE", "THEAD", "TBODY", "TR"]), Ps = /* @__PURE__ */ new Set(["STRONG", "B", "EM", "I", "U", "S", "STRIKE", "DEL", "A", "SPAN", "BR", "SUB", "SUP", "CODE"]);
2271
+ class Hs {
2154
2272
  schema;
2155
2273
  blockParseRules;
2156
2274
  markParseRules;
@@ -2247,7 +2365,7 @@ class Ss {
2247
2365
  if (e5.nodeType !== Node.ELEMENT_NODE) return [];
2248
2366
  const n3 = e5, s3 = n3.tagName;
2249
2367
  if ("BR" === s3) return [{ text: "\n", marks: this.resolveMarks(t3) }];
2250
- if (this.isBlockElement(n3) && !ws.has(s3)) return this.parseInlineChildren(n3, t3);
2368
+ if (this.isBlockElement(n3) && !Ps.has(s3)) return this.parseInlineChildren(n3, t3);
2251
2369
  const r4 = this.mergeMarks(t3, this.marksFromElement(n3));
2252
2370
  return this.parseInlineChildren(n3, r4);
2253
2371
  }
@@ -2270,18 +2388,18 @@ class Ss {
2270
2388
  for (const r4 of this.markParseRules) if (r4.rule.tag === n3 && !s4.has(r4.type)) if (r4.rule.getAttrs) {
2271
2389
  const n4 = r4.rule.getAttrs(e5);
2272
2390
  if (false === n4) continue;
2273
- t3.push({ type: be(r4.type), ...Object.keys(n4).length > 0 ? { attrs: n4 } : {} }), s4.add(r4.type);
2274
- } else t3.push({ type: be(r4.type) }), s4.add(r4.type);
2391
+ t3.push({ type: ve(r4.type), ...Object.keys(n4).length > 0 ? { attrs: n4 } : {} }), s4.add(r4.type);
2392
+ } else t3.push({ type: ve(r4.type) }), s4.add(r4.type);
2275
2393
  if (s4.size > 0) return t3;
2276
2394
  }
2277
2395
  const s3 = e5.tagName;
2278
2396
  if ("STRONG" === s3 || "B" === s3) {
2279
2397
  const n4 = e5.style.fontWeight, s4 = Number.parseInt(n4, 10);
2280
- "normal" === n4 || !Number.isNaN(s4) && s4 < 700 || t3.push({ type: be("bold") });
2398
+ "normal" === n4 || !Number.isNaN(s4) && s4 < 700 || t3.push({ type: ve("bold") });
2281
2399
  }
2282
- if ("EM" !== s3 && "I" !== s3 || t3.push({ type: be("italic") }), "U" === s3 && t3.push({ type: be("underline") }), "S" !== s3 && "STRIKE" !== s3 && "DEL" !== s3 || t3.push({ type: be("strikethrough") }), "A" === s3) {
2400
+ if ("EM" !== s3 && "I" !== s3 || t3.push({ type: ve("italic") }), "U" === s3 && t3.push({ type: ve("underline") }), "S" !== s3 && "STRIKE" !== s3 && "DEL" !== s3 || t3.push({ type: ve("strikethrough") }), "A" === s3) {
2283
2401
  const n4 = e5.getAttribute("href") ?? "";
2284
- t3.push({ type: be("link"), attrs: { href: n4 } });
2402
+ t3.push({ type: ve("link"), attrs: { href: n4 } });
2285
2403
  }
2286
2404
  return t3;
2287
2405
  }
@@ -2321,7 +2439,7 @@ class Ss {
2321
2439
  return null;
2322
2440
  }
2323
2441
  isBlockElement(e5) {
2324
- if (bs.has(e5.tagName)) return true;
2442
+ if (Ds.has(e5.tagName)) return true;
2325
2443
  const t3 = e5.tagName.toLowerCase();
2326
2444
  return this.blockParseRules.some((e6) => e6.rule.tag === t3);
2327
2445
  }
@@ -2366,21 +2484,21 @@ class Ss {
2366
2484
  0 !== n3.length && (n3.every((e6) => "" === e6.text.trim()) || e5.push({ type: this.resolveBlockType(ke("paragraph")), segments: n3 }));
2367
2485
  }
2368
2486
  }
2369
- const Es = { 1: "x-small", 2: "small", 3: "medium", 4: "large", 5: "x-large", 6: "xx-large", 7: "xxx-large" };
2370
- function xs(e5) {
2487
+ const zs = { 1: "x-small", 2: "small", 3: "medium", 4: "large", 5: "x-large", 6: "xx-large", 7: "xxx-large" };
2488
+ function js(e5) {
2371
2489
  return e5.toLowerCase().includes("font-size");
2372
2490
  }
2373
- function Cs(e5, t3) {
2491
+ function $s(e5, t3) {
2374
2492
  for (; e5.firstChild; ) t3.appendChild(e5.firstChild);
2375
2493
  }
2376
- function Ts(e5) {
2494
+ function Ks(e5) {
2377
2495
  const t3 = e5.parentNode;
2378
2496
  if (t3) {
2379
2497
  for (; e5.firstChild; ) t3.insertBefore(e5.firstChild, e5);
2380
2498
  t3.removeChild(e5);
2381
2499
  }
2382
2500
  }
2383
- function As(e5, t3) {
2501
+ function Fs(e5, t3) {
2384
2502
  if (!t3) return;
2385
2503
  const n3 = {};
2386
2504
  let s3 = false;
@@ -2390,7 +2508,7 @@ function As(e5, t3) {
2390
2508
  }
2391
2509
  return s3 ? n3 : void 0;
2392
2510
  }
2393
- class Rs {
2511
+ class Us {
2394
2512
  constructor(e5, t3) {
2395
2513
  this.element = e5, this.getState = t3.getState, this.dispatch = t3.dispatch, this.schemaRegistry = t3.schemaRegistry, this.fileHandlerRegistry = t3.fileHandlerRegistry, this.isReadOnly = t3.isReadOnly ?? (() => false), this.handlePaste = this.onPaste.bind(this), e5.addEventListener("paste", this.handlePaste);
2396
2514
  }
@@ -2410,7 +2528,7 @@ class Rs {
2410
2528
  const s3 = t3.getData("text/plain");
2411
2529
  if (s3) {
2412
2530
  const e6 = (function(e7) {
2413
- if (cn && cn.plainText === e7) return cn.blocks;
2531
+ if (mn && mn.plainText === e7) return mn.blocks;
2414
2532
  })(s3);
2415
2533
  if (e6 && this.handleRichPaste(e6)) return;
2416
2534
  }
@@ -2424,20 +2542,20 @@ class Rs {
2424
2542
  for (const e8 of t5) {
2425
2543
  const t6 = e8.getAttribute("color"), n5 = e8.getAttribute("face"), s5 = e8.getAttribute("size"), r5 = e8.getAttribute("style") ?? "";
2426
2544
  if (!(null !== t6 || null !== n5 || null !== s5 || r5.length > 0)) {
2427
- Ts(e8);
2545
+ Ks(e8);
2428
2546
  continue;
2429
2547
  }
2430
2548
  const i10 = document.createElement("span"), o3 = [];
2431
- if (r5 && o3.push(r5.endsWith(";") ? r5 : `${r5};`), t6 && o3.push(`color: ${t6};`), n5 && o3.push(`font-family: ${n5};`), s5 && !xs(r5)) {
2432
- const e9 = Es[s5];
2549
+ if (r5 && o3.push(r5.endsWith(";") ? r5 : `${r5};`), t6 && o3.push(`color: ${t6};`), n5 && o3.push(`font-family: ${n5};`), s5 && !js(r5)) {
2550
+ const e9 = zs[s5];
2433
2551
  e9 && o3.push(`font-size: ${e9};`);
2434
2552
  }
2435
- i10.setAttribute("style", o3.join(" ")), Cs(e8, i10), e8.parentNode?.replaceChild(i10, e8);
2553
+ Mt(i10, o3.join(" ")), $s(e8, i10), e8.parentNode?.replaceChild(i10, e8);
2436
2554
  }
2437
2555
  })(t4.content);
2438
- const n4 = t4.innerHTML, s4 = this.schemaRegistry ? this.schemaRegistry.getAllowedTags() : ["strong", "em", "u", "b", "i", "p", "br", "div", "span"], o2 = this.schemaRegistry ? this.schemaRegistry.getAllowedAttrs() : [], a22 = Lt.sanitize(n4, { ALLOWED_TAGS: s4, ALLOWED_ATTR: o2 });
2556
+ const n4 = t4.innerHTML, s4 = this.schemaRegistry ? this.schemaRegistry.getAllowedTags() : ["strong", "em", "u", "b", "i", "p", "br", "div", "span"], o2 = this.schemaRegistry ? this.schemaRegistry.getAllowedAttrs() : [], a22 = Dt.sanitize(n4, { ALLOWED_TAGS: s4, ALLOWED_ATTR: o2 });
2439
2557
  if (this.schemaRegistry) {
2440
- const e7 = me(this.schemaRegistry), t5 = new Ss({ schema: e7, schemaRegistry: this.schemaRegistry }), n5 = document.createElement("template");
2558
+ const e7 = me(this.schemaRegistry), t5 = new Hs({ schema: e7, schemaRegistry: this.schemaRegistry }), n5 = document.createElement("template");
2441
2559
  n5.innerHTML = a22;
2442
2560
  const s5 = (function(e8, t6) {
2443
2561
  if (0 === t6.blocks.length) return e8.transaction("paste").setSelection(e8.selection).build();
@@ -2446,33 +2564,33 @@ class Rs {
2446
2564
  const n7 = e9.selection;
2447
2565
  if (ie(n7)) return e9.transaction("paste").setSelection(n7).build();
2448
2566
  if (oe(n7)) return (function(e10, t8, n8) {
2449
- const s7 = ks(e10, t8);
2567
+ const s7 = Os(e10, t8);
2450
2568
  if (!s7) return e10.transaction("paste").setSelection(t8).build();
2451
- const r6 = Y(), i11 = ms(n8), o4 = ys(n8), a24 = e10.transaction("paste");
2569
+ const r6 = Y(), i11 = Ns(n8), o4 = Bs(n8), a24 = e10.transaction("paste");
2452
2570
  return a24.insertNode(s7.parentPath, s7.insertIndex, _(ke("paragraph"), [T("")], r6)), i11.length > 0 && a24.insertText(r6, 0, i11, [], n8), a24.setSelection(re(r6, o4)), a24.build();
2453
2571
  })(e9, n7, t7);
2454
2572
  const s6 = e9.transaction("paste");
2455
2573
  le(n7) || Qe(e9, s6);
2456
- const { blockId: r5, offset: i10 } = Xe(n7, e9.getBlockOrder()), o3 = ys(t7), a23 = ms(t7);
2574
+ const { blockId: r5, offset: i10 } = Xe(n7, e9.getBlockOrder()), o3 = Bs(t7), a23 = Ns(t7);
2457
2575
  return s6.insertText(r5, i10, a23, [], t7), s6.setSelection(re(r5, i10 + o3)), s6.build();
2458
2576
  })(e8, n6.segments) : 1 === t6.blocks.length ? (function(e9, t7) {
2459
2577
  const n7 = e9.selection;
2460
2578
  if (ie(n7)) return e9.transaction("paste").setSelection(n7).build();
2461
- if (oe(n7)) return vs(e9, n7, [t7]);
2579
+ if (oe(n7)) return _s(e9, n7, [t7]);
2462
2580
  const s6 = e9.transaction("paste");
2463
2581
  le(n7) || Qe(e9, s6);
2464
- const { blockId: r5, offset: i10 } = Xe(n7, e9.getBlockOrder()), o3 = ys(t7.segments), a23 = ms(t7.segments);
2582
+ const { blockId: r5, offset: i10 } = Xe(n7, e9.getBlockOrder()), o3 = Bs(t7.segments), a23 = Ns(t7.segments);
2465
2583
  return s6.setBlockType(r5, t7.type, t7.attrs), s6.insertText(r5, i10, a23, [], t7.segments), s6.setSelection(re(r5, i10 + o3)), s6.build();
2466
2584
  })(e8, n6) : (function(e9, t7) {
2467
2585
  const n7 = e9.selection;
2468
2586
  if (ie(n7)) return e9.transaction("paste").setSelection(n7).build();
2469
- if (oe(n7)) return vs(e9, n7, t7.blocks);
2587
+ if (oe(n7)) return _s(e9, n7, t7.blocks);
2470
2588
  const s6 = e9.transaction("paste");
2471
2589
  le(n7) || Qe(e9, s6);
2472
2590
  const r5 = e9.getBlockOrder(), { blockId: i10, offset: o3 } = Xe(n7, r5), a23 = r5.indexOf(i10), c11 = t7.blocks[0], l3 = t7.blocks[t7.blocks.length - 1];
2473
2591
  if (!c11 || !l3) return s6.build();
2474
- const h4 = t7.blocks.slice(1, -1), d5 = ys(c11.segments);
2475
- c11.segments.length > 0 && d5 > 0 && s6.insertText(i10, o3, ms(c11.segments), [], c11.segments), c11.type !== ke("paragraph") && s6.setBlockType(i10, c11.type, c11.attrs);
2592
+ const h4 = t7.blocks.slice(1, -1), d5 = Bs(c11.segments);
2593
+ c11.segments.length > 0 && d5 > 0 && s6.insertText(i10, o3, Ns(c11.segments), [], c11.segments), c11.type !== ke("paragraph") && s6.setBlockType(i10, c11.type, c11.attrs);
2476
2594
  const u2 = o3 + d5, p4 = Y();
2477
2595
  s6.splitBlock(i10, u2, p4);
2478
2596
  let f4 = a23 + 1;
@@ -2480,8 +2598,8 @@ class Rs {
2480
2598
  const t8 = e10.segments.map((e11) => T(e11.text, [...e11.marks])), n8 = _(e10.type, t8.length > 0 ? t8 : void 0, Y(), e10.attrs);
2481
2599
  s6.insertNode([], f4, n8), f4++;
2482
2600
  }
2483
- const g4 = ys(l3.segments);
2484
- return l3.segments.length > 0 && g4 > 0 && s6.insertText(p4, 0, ms(l3.segments), [], l3.segments), l3.type !== ke("paragraph") && s6.setBlockType(p4, l3.type, l3.attrs), s6.setSelection(re(p4, g4)), s6.build();
2601
+ const g4 = Bs(l3.segments);
2602
+ return l3.segments.length > 0 && g4 > 0 && s6.insertText(p4, 0, Ns(l3.segments), [], l3.segments), l3.type !== ke("paragraph") && s6.setBlockType(p4, l3.type, l3.attrs), s6.setSelection(re(p4, g4)), s6.build();
2485
2603
  })(e8, t6) : e8.transaction("paste").setSelection(e8.selection).build();
2486
2604
  })(r4, t5.parse(n5.content));
2487
2605
  this.dispatch(s5);
@@ -2510,7 +2628,7 @@ class Rs {
2510
2628
  if (!n3) return;
2511
2629
  const s3 = this.schemaRegistry?.getNodeSpec(n3);
2512
2630
  if (this.schemaRegistry && !s3) return;
2513
- const r4 = this.getState(), i9 = r4.selection, o2 = ie(i9) ? i9.nodeId : oe(i9) ? i9.blockId : i9.anchor.blockId, a22 = Y(), c11 = As(t3.attrs, s3?.attrs), l3 = _(ke(n3), [], a22, c11), h4 = this.findTableCellAncestor(r4, o2);
2631
+ const r4 = this.getState(), i9 = r4.selection, o2 = ie(i9) ? i9.nodeId : oe(i9) ? i9.blockId : i9.anchor.blockId, a22 = Y(), c11 = Fs(t3.attrs, s3?.attrs), l3 = _(ke(n3), [], a22, c11), h4 = this.findTableCellAncestor(r4, o2);
2514
2632
  if (h4) {
2515
2633
  const e6 = Ae(r4.doc, h4);
2516
2634
  if (!e6) return;
@@ -2582,7 +2700,7 @@ class Rs {
2582
2700
  if (!this.schemaRegistry) return e5;
2583
2701
  const t3 = this.schemaRegistry.getNodeSpec(e5.type);
2584
2702
  if (!t3) return;
2585
- const n3 = As(e5.attrs, t3.attrs);
2703
+ const n3 = Fs(e5.attrs, t3.attrs);
2586
2704
  return { ...e5, attrs: n3 };
2587
2705
  }
2588
2706
  findTableCellAncestor(e5, t3) {
@@ -2632,7 +2750,7 @@ class Rs {
2632
2750
  this.element.removeEventListener("paste", this.handlePaste);
2633
2751
  }
2634
2752
  }
2635
- function Ls(e5, t3, n3, s3) {
2753
+ function Ws(e5, t3, n3, s3) {
2636
2754
  const r4 = t3?.doc.children ?? [], i9 = n3.doc.children, o2 = s3?.registry, a22 = s3?.nodeViews, c11 = null != s3?.compositionBlockId;
2637
2755
  c11 || (function(e6) {
2638
2756
  const t4 = Array.from(e6.querySelectorAll(":scope > [data-block-wrapper]"));
@@ -2655,7 +2773,7 @@ function Ls(e5, t3, n3, s3) {
2655
2773
  }
2656
2774
  const h4 = new Set(i9.map((e6) => e6.id));
2657
2775
  for (const [e6, t4] of l3) if (!h4.has(e6)) {
2658
- js(t4), l3.delete(e6);
2776
+ nr(t4), l3.delete(e6);
2659
2777
  const n4 = a22?.get(e6);
2660
2778
  n4 && (n4.destroy?.(), a22?.delete(e6));
2661
2779
  }
@@ -2670,7 +2788,7 @@ function Ls(e5, t3, n3, s3) {
2670
2788
  continue;
2671
2789
  }
2672
2790
  const i10 = s3?.oldDecorations?.find(t4.id), c12 = s3?.decorations?.find(t4.id);
2673
- if (n4 && r5 && !Ms(r5, t4, i10, c12)) u2 = n4;
2791
+ if (n4 && r5 && !Vs(r5, t4, i10, c12)) u2 = n4;
2674
2792
  else if (n4) {
2675
2793
  const r6 = a22?.get(t4.id);
2676
2794
  if (r6) {
@@ -2678,18 +2796,18 @@ function Ls(e5, t3, n3, s3) {
2678
2796
  if (V(t4) && r6.contentDOM) {
2679
2797
  r6.contentDOM.textContent = "";
2680
2798
  const e6 = s3?.decorations?.findInline(t4.id);
2681
- Ns(r6.contentDOM, t4, o2, e6);
2799
+ qs(r6.contentDOM, t4, o2, e6);
2682
2800
  }
2683
2801
  u2 = r6.dom;
2684
2802
  continue;
2685
2803
  }
2686
2804
  r6.destroy?.(), a22?.delete(t4.id);
2687
2805
  }
2688
- const i11 = Is(t4, o2, a22, s3);
2689
- $s(n4, i11, e5), u2 = i11;
2806
+ const i11 = Gs(t4, o2, a22, s3);
2807
+ sr(n4, i11, e5), u2 = i11;
2690
2808
  } else {
2691
- const n5 = Is(t4, o2, a22, s3);
2692
- Ks(e5, u2, n5), u2 = n5;
2809
+ const n5 = Gs(t4, o2, a22, s3);
2810
+ rr(e5, u2, n5), u2 = n5;
2693
2811
  }
2694
2812
  if (p4 === t4.id) {
2695
2813
  const e6 = a22?.get(t4.id);
@@ -2715,9 +2833,9 @@ function Ls(e5, t3, n3, s3) {
2715
2833
  const e6 = a22?.get(p4);
2716
2834
  e6 && e6.selectNode?.();
2717
2835
  }
2718
- c11 || zs(e5, i9, o2);
2836
+ c11 || tr(e5, i9, o2);
2719
2837
  }
2720
- function Ms(e5, t3, n3, s3) {
2838
+ function Vs(e5, t3, n3, s3) {
2721
2839
  if (e5.type !== t3.type) return true;
2722
2840
  if (e5.children.length !== t3.children.length) return true;
2723
2841
  const r4 = e5.attrs, i9 = t3.attrs;
@@ -2735,16 +2853,16 @@ function Ms(e5, t3, n3, s3) {
2735
2853
  if (!Q(s4.marks, r5.marks)) return true;
2736
2854
  } else if (C(s4) && C(r5)) {
2737
2855
  if (s4.inlineType !== r5.inlineType) return true;
2738
- if (!_s(s4.attrs, r5.attrs)) return true;
2856
+ if (!Ys(s4.attrs, r5.attrs)) return true;
2739
2857
  } else {
2740
2858
  if (R(s4) || R(r5) || C(s4) || C(r5)) return true;
2741
- if (Ms(s4, r5)) return true;
2859
+ if (Vs(s4, r5)) return true;
2742
2860
  }
2743
2861
  }
2744
2862
  const o2 = n3 ?? [], a22 = s3 ?? [];
2745
2863
  return o2 !== a22 && !ht(o2, a22);
2746
2864
  }
2747
- function Is(e5, t3, n3, s3) {
2865
+ function Gs(e5, t3, n3, s3) {
2748
2866
  const r4 = s3?.decorations?.findInline(e5.id), i9 = s3?.nodeViewRegistry;
2749
2867
  if (i9 && t3 && n3 && s3?.getState && s3?.dispatch) {
2750
2868
  const o2 = i9.getNodeViewFactory(e5.type);
@@ -2752,45 +2870,45 @@ function Is(e5, t3, n3, s3) {
2752
2870
  const i10 = o2(e5, s3.getState, s3.dispatch);
2753
2871
  n3.set(e5.id, i10);
2754
2872
  const a22 = t3.getNodeSpec(e5.type);
2755
- if (a22?.isVoid && i10.dom.setAttribute("data-void", "true"), a22?.selectable && i10.dom.setAttribute("data-selectable", "true"), i10.contentDOM && i10.contentDOM !== i10.dom && i10.contentDOM.setAttribute("data-content-dom", "true"), V(e5) && i10.contentDOM) Ns(i10.contentDOM, e5, t3, r4);
2873
+ if (a22?.isVoid && i10.dom.setAttribute("data-void", "true"), a22?.selectable && i10.dom.setAttribute("data-selectable", "true"), i10.contentDOM && i10.contentDOM !== i10.dom && i10.contentDOM.setAttribute("data-content-dom", "true"), V(e5) && i10.contentDOM) qs(i10.contentDOM, e5, t3, r4);
2756
2874
  else {
2757
2875
  const r5 = J(e5), o3 = /* @__PURE__ */ new Map();
2758
2876
  for (const e6 of r5) {
2759
2877
  const r6 = i10.getContentDOM?.(e6.id) ?? i10.contentDOM;
2760
2878
  if (r6) {
2761
- const i11 = Is(e6, t3, n3, s3);
2879
+ const i11 = Gs(e6, t3, n3, s3);
2762
2880
  r6.appendChild(i11);
2763
2881
  let a23 = o3.get(r6);
2764
2882
  a23 || (a23 = [], o3.set(r6, a23)), a23.push(e6);
2765
2883
  }
2766
2884
  }
2767
- for (const [e6, n4] of o3) zs(e6, n4, t3);
2885
+ for (const [e6, n4] of o3) tr(e6, n4, t3);
2768
2886
  }
2769
- return i10.dom.setAttribute("data-block-type", e5.type), Hs(i10.dom, e5.id, s3), i10.dom;
2887
+ return i10.dom.setAttribute("data-block-type", e5.type), er(i10.dom, e5.id, s3), i10.dom;
2770
2888
  }
2771
2889
  }
2772
2890
  if (t3) {
2773
2891
  const i10 = t3.getNodeSpec(e5.type);
2774
2892
  if (i10) {
2775
2893
  const o2 = i10.toDOM(e5);
2776
- if (i10.isVoid && o2.setAttribute("data-void", "true"), i10.selectable && o2.setAttribute("data-selectable", "true"), !i10.isVoid) if (V(e5)) Ns(o2, e5, t3, r4);
2894
+ if (i10.isVoid && o2.setAttribute("data-void", "true"), i10.selectable && o2.setAttribute("data-selectable", "true"), !i10.isVoid) if (V(e5)) qs(o2, e5, t3, r4);
2777
2895
  else {
2778
2896
  const r5 = J(e5);
2779
2897
  for (const e6 of r5) {
2780
- const r6 = Is(e6, t3, n3, s3);
2898
+ const r6 = Gs(e6, t3, n3, s3);
2781
2899
  o2.appendChild(r6);
2782
2900
  }
2783
- zs(o2, r5, t3);
2901
+ tr(o2, r5, t3);
2784
2902
  }
2785
- return o2.setAttribute("data-block-type", e5.type), Hs(o2, e5.id, s3), o2;
2903
+ return o2.setAttribute("data-block-type", e5.type), er(o2, e5.id, s3), o2;
2786
2904
  }
2787
2905
  }
2788
2906
  return (function(e6, t4, n4) {
2789
- const s4 = Se("p", e6.id);
2790
- return s4.setAttribute("data-block-type", e6.type), Ns(s4, e6, t4, n4), s4;
2907
+ const s4 = we("p", e6.id);
2908
+ return s4.setAttribute("data-block-type", e6.type), qs(s4, e6, t4, n4), s4;
2791
2909
  })(e5, t3, r4);
2792
2910
  }
2793
- function Ns(e5, t3, n3, s3) {
2911
+ function qs(e5, t3, n3, s3) {
2794
2912
  for (const t4 of e5.querySelectorAll("[data-cursor-wrapper]")) t4.remove();
2795
2913
  const r4 = I(t3);
2796
2914
  if (1 === r4.length && R(r4[0]) && "" === r4[0].text) return void e5.appendChild(document.createElement("br"));
@@ -2798,7 +2916,7 @@ function Ns(e5, t3, n3, s3) {
2798
2916
  let r5 = 0;
2799
2917
  for (const i10 of t4) {
2800
2918
  if (C(i10)) {
2801
- e6.appendChild(Ps(i10, s4)), r5 += 1;
2919
+ e6.appendChild(Xs(i10, s4)), r5 += 1;
2802
2920
  continue;
2803
2921
  }
2804
2922
  const t5 = r5, o2 = r5 + i10.text.length;
@@ -2818,18 +2936,18 @@ function Ns(e5, t3, n3, s3) {
2818
2936
  if (void 0 === o3 || void 0 === a23 || o3 >= a23) continue;
2819
2937
  const l3 = o3 - t5, h4 = a23 - t5, d5 = i10.text.slice(l3, h4), u2 = [];
2820
2938
  for (const e7 of n4) e7.from <= o3 && e7.to >= a23 && u2.push(e7);
2821
- let p4 = document.createTextNode(Bs(d5));
2939
+ let p4 = document.createTextNode(Js(d5));
2822
2940
  if (i10.marks.length > 0) {
2823
- const e7 = [...i10.marks].sort((e8, t6) => kn(e8, s4) - kn(t6, s4));
2941
+ const e7 = [...i10.marks].sort((e8, t6) => Tn(e8, s4) - Tn(t6, s4));
2824
2942
  for (let t6 = e7.length - 1; t6 >= 0; t6--) {
2825
2943
  const n5 = e7[t6];
2826
2944
  if (!n5) continue;
2827
- const r7 = vn(n5, s4);
2945
+ const r7 = An(n5, s4);
2828
2946
  r7.appendChild(p4), p4 = r7;
2829
2947
  }
2830
2948
  }
2831
2949
  for (const e7 of u2) {
2832
- const t6 = Ds(e7.attrs);
2950
+ const t6 = Zs(e7.attrs);
2833
2951
  t6.appendChild(p4), p4 = t6;
2834
2952
  }
2835
2953
  e6.appendChild(p4);
@@ -2837,29 +2955,29 @@ function Ns(e5, t3, n3, s3) {
2837
2955
  r5 = o2;
2838
2956
  }
2839
2957
  })(e5, r4, s3, n3);
2840
- else for (const t4 of r4) R(t4) ? e5.appendChild(Os(t4, n3)) : e5.appendChild(Ps(t4, n3));
2958
+ else for (const t4 of r4) R(t4) ? e5.appendChild(Qs(t4, n3)) : e5.appendChild(Xs(t4, n3));
2841
2959
  const i9 = r4[r4.length - 1];
2842
2960
  i9 && C(i9) && "hard_break" === i9.inlineType && e5.appendChild(document.createElement("br"));
2843
2961
  }
2844
- function Bs(e5) {
2962
+ function Js(e5) {
2845
2963
  let t3 = e5.replace(/ {2}/g, "  ");
2846
2964
  return t3.endsWith(" ") && (t3 = `${t3.slice(0, -1)} `), t3.startsWith(" ") && (t3 = ` ${t3.slice(1)}`), t3;
2847
2965
  }
2848
- function Os(e5, t3) {
2966
+ function Qs(e5, t3) {
2849
2967
  if ("" === e5.text) return document.createTextNode("");
2850
- const n3 = document.createTextNode(Bs(e5.text));
2968
+ const n3 = document.createTextNode(Js(e5.text));
2851
2969
  if (0 === e5.marks.length) return n3;
2852
- const s3 = [...e5.marks].sort((e6, n4) => kn(e6, t3) - kn(n4, t3));
2970
+ const s3 = [...e5.marks].sort((e6, n4) => Tn(e6, t3) - Tn(n4, t3));
2853
2971
  let r4 = n3;
2854
2972
  for (let e6 = s3.length - 1; e6 >= 0; e6--) {
2855
2973
  const n4 = s3[e6];
2856
2974
  if (!n4) continue;
2857
- const i9 = vn(n4, t3);
2975
+ const i9 = An(n4, t3);
2858
2976
  i9.appendChild(r4), r4 = i9;
2859
2977
  }
2860
2978
  return r4;
2861
2979
  }
2862
- function Ps(e5, t3) {
2980
+ function Xs(e5, t3) {
2863
2981
  if (t3) {
2864
2982
  const n4 = t3.getInlineNodeSpec(e5.inlineType);
2865
2983
  if (n4) {
@@ -2870,30 +2988,27 @@ function Ps(e5, t3) {
2870
2988
  const n3 = document.createElement("span");
2871
2989
  return n3.setAttribute("data-inline-type", e5.inlineType), n3.setAttribute("contenteditable", "false"), n3;
2872
2990
  }
2873
- function _s(e5, t3) {
2991
+ function Ys(e5, t3) {
2874
2992
  const n3 = Object.keys(e5), s3 = Object.keys(t3);
2875
2993
  if (n3.length !== s3.length) return false;
2876
2994
  for (const s4 of n3) if (e5[s4] !== t3[s4]) return false;
2877
2995
  return true;
2878
2996
  }
2879
- function Ds(e5) {
2997
+ function Zs(e5) {
2880
2998
  const t3 = e5.nodeName ?? "span", n3 = document.createElement(t3);
2881
2999
  if (n3.setAttribute("data-decoration", "true"), e5.class) for (const t4 of e5.class.split(" ")) t4 && n3.classList.add(t4);
2882
- e5.style && (n3.style.cssText = e5.style);
3000
+ e5.style && Mt(n3, e5.style);
2883
3001
  for (const [t4, s3] of Object.entries(e5)) "class" !== t4 && "style" !== t4 && "nodeName" !== t4 && void 0 !== s3 && n3.setAttribute(t4, s3);
2884
3002
  return n3;
2885
3003
  }
2886
- function Hs(e5, t3, n3) {
3004
+ function er(e5, t3, n3) {
2887
3005
  const s3 = n3?.decorations?.findNode(t3);
2888
3006
  if (s3 && 0 !== s3.length) for (const t4 of s3) {
2889
3007
  if (t4.attrs.class) for (const n4 of t4.attrs.class.split(" ")) n4 && e5.classList.add(n4);
2890
- if (t4.attrs.style) {
2891
- const n4 = e5.style.cssText;
2892
- e5.style.cssText = n4 ? `${n4}; ${t4.attrs.style}` : t4.attrs.style;
2893
- }
3008
+ t4.attrs.style && It(e5, t4.attrs.style);
2894
3009
  }
2895
3010
  }
2896
- function zs(e5, t3, n3) {
3011
+ function tr(e5, t3, n3) {
2897
3012
  if (!n3) return;
2898
3013
  const s3 = [];
2899
3014
  let r4 = null, i9 = [];
@@ -2914,21 +3029,21 @@ function zs(e5, t3, n3) {
2914
3029
  }
2915
3030
  }
2916
3031
  }
2917
- function js(e5) {
3032
+ function nr(e5) {
2918
3033
  e5.parentElement?.removeChild(e5);
2919
3034
  }
2920
- function $s(e5, t3, n3) {
3035
+ function sr(e5, t3, n3) {
2921
3036
  const s3 = e5.parentElement;
2922
3037
  s3 ? s3.replaceChild(t3, e5) : n3.replaceChild(t3, e5);
2923
3038
  }
2924
- function Ks(e5, t3, n3) {
3039
+ function rr(e5, t3, n3) {
2925
3040
  if (t3?.parentElement) {
2926
3041
  const e6 = t3.parentElement;
2927
3042
  return void (t3.nextSibling ? e6.insertBefore(n3, t3.nextSibling) : e6.appendChild(n3));
2928
3043
  }
2929
3044
  e5.firstChild ? e5.insertBefore(n3, e5.firstChild) : e5.appendChild(n3);
2930
3045
  }
2931
- class Fs {
3046
+ class ir {
2932
3047
  state;
2933
3048
  contentElement;
2934
3049
  inputHandler;
@@ -2955,16 +3070,16 @@ class Fs {
2955
3070
  getDecorations;
2956
3071
  isReadOnly;
2957
3072
  navigationKeymap = null;
2958
- compositionTracker = new hn();
3073
+ compositionTracker = new kn();
2959
3074
  cursorWrapper;
2960
3075
  goalColumn = null;
2961
3076
  preserveGoalColumn = false;
2962
3077
  constructor(e5, t3) {
2963
- this.state = t3.state, this.contentElement = e5, this.schemaRegistry = t3.schemaRegistry, this.keymapRegistry = t3.keymapRegistry, this.fileHandlerRegistry = t3.fileHandlerRegistry, this.nodeViewRegistry = t3.nodeViewRegistry, this.getDecorations = t3.getDecorations, this.isReadOnly = t3.isReadOnly ?? (() => false), this.history = new Zt({ maxDepth: t3.maxHistoryDepth ?? 100 }), t3.onStateChange && this.stateChangeCallbacks.push(t3.onStateChange), this.inputHandler = new gs(e5, { getState: () => this.state, dispatch: (e6) => this.dispatch(e6), syncSelection: () => this.syncSelectionFromDOM(), inputRuleRegistry: t3.inputRuleRegistry, isReadOnly: this.isReadOnly, compositionTracker: this.compositionTracker }), this.keyboardHandler = new sn(e5, { getState: () => this.state, dispatch: (e6) => this.dispatch(e6), undo: () => this.undo(), redo: () => this.redo(), keymapRegistry: this.keymapRegistry, isReadOnly: this.isReadOnly, compositionTracker: this.compositionTracker }), this.pasteHandler = new Rs(e5, { getState: () => this.state, dispatch: (e6) => this.dispatch(e6), schemaRegistry: this.schemaRegistry, fileHandlerRegistry: this.fileHandlerRegistry, isReadOnly: this.isReadOnly }), this.clipboardHandler = new ln(e5, { getState: () => this.state, dispatch: (e6) => this.dispatch(e6), schemaRegistry: this.schemaRegistry, syncSelection: () => this.syncSelectionFromDOM(), isReadOnly: this.isReadOnly }), this.cursorWrapper = new bn(e5, this.schemaRegistry), this.handleCompositionStartForWrapper = () => {
3078
+ this.state = t3.state, this.contentElement = e5, this.schemaRegistry = t3.schemaRegistry, this.keymapRegistry = t3.keymapRegistry, this.fileHandlerRegistry = t3.fileHandlerRegistry, this.nodeViewRegistry = t3.nodeViewRegistry, this.getDecorations = t3.getDecorations, this.isReadOnly = t3.isReadOnly ?? (() => false), this.history = new an({ maxDepth: t3.maxHistoryDepth ?? 100 }), t3.onStateChange && this.stateChangeCallbacks.push(t3.onStateChange), this.inputHandler = new Is(e5, { getState: () => this.state, dispatch: (e6) => this.dispatch(e6), syncSelection: () => this.syncSelectionFromDOM(), inputRuleRegistry: t3.inputRuleRegistry, isReadOnly: this.isReadOnly, compositionTracker: this.compositionTracker }), this.keyboardHandler = new dn(e5, { getState: () => this.state, dispatch: (e6) => this.dispatch(e6), undo: () => this.undo(), redo: () => this.redo(), keymapRegistry: this.keymapRegistry, isReadOnly: this.isReadOnly, compositionTracker: this.compositionTracker }), this.pasteHandler = new Us(e5, { getState: () => this.state, dispatch: (e6) => this.dispatch(e6), schemaRegistry: this.schemaRegistry, fileHandlerRegistry: this.fileHandlerRegistry, isReadOnly: this.isReadOnly }), this.clipboardHandler = new yn(e5, { getState: () => this.state, dispatch: (e6) => this.dispatch(e6), schemaRegistry: this.schemaRegistry, syncSelection: () => this.syncSelectionFromDOM(), isReadOnly: this.isReadOnly }), this.cursorWrapper = new Rn(e5, this.schemaRegistry), this.handleCompositionStartForWrapper = () => {
2964
3079
  this.cursorWrapper.onCompositionStart(this.state);
2965
3080
  }, this.handleCompositionEndForWrapper = () => {
2966
3081
  this.cursorWrapper.cleanup();
2967
- }, e5.addEventListener("compositionstart", this.handleCompositionStartForWrapper), e5.addEventListener("compositionend", this.handleCompositionEndForWrapper), this.handleSelectionChange = this.onSelectionChange.bind(this), document.addEventListener("selectionchange", this.handleSelectionChange), this.handleMousedown = this.onMousedown.bind(this), e5.addEventListener("mousedown", this.handleMousedown), this.handleDragover = this.onDragover.bind(this), e5.addEventListener("dragover", this.handleDragover), this.handleDrop = this.onDrop.bind(this), e5.addEventListener("drop", this.handleDrop), this.decorations = this.getDecorations?.(this.state) ?? lt.empty, Ls(e5, null, this.state, { ...this.reconcileOptions(), decorations: this.decorations }), Me(e5, this.state.selection), this.registerNavigationKeymaps();
3082
+ }, e5.addEventListener("compositionstart", this.handleCompositionStartForWrapper), e5.addEventListener("compositionend", this.handleCompositionEndForWrapper), this.handleSelectionChange = this.onSelectionChange.bind(this), document.addEventListener("selectionchange", this.handleSelectionChange), this.handleMousedown = this.onMousedown.bind(this), e5.addEventListener("mousedown", this.handleMousedown), this.handleDragover = this.onDragover.bind(this), e5.addEventListener("dragover", this.handleDragover), this.handleDrop = this.onDrop.bind(this), e5.addEventListener("drop", this.handleDrop), this.decorations = this.getDecorations?.(this.state) ?? lt.empty, Ws(e5, null, this.state, { ...this.reconcileOptions(), decorations: this.decorations }), Me(e5, this.state.selection), this.registerNavigationKeymaps();
2968
3083
  }
2969
3084
  getState() {
2970
3085
  return this.state;
@@ -2976,7 +3091,7 @@ class Fs {
2976
3091
  const s3 = this.state;
2977
3092
  this.state = e5, this.cursorWrapper.isActive && !e5.storedMarks?.length && this.cursorWrapper.cleanup(), n3?.pushHistory && "history" !== t3.metadata.origin && this.history.push(t3);
2978
3093
  const r4 = this.decorations, i9 = this.getDecorations?.(e5, t3) ?? lt.empty;
2979
- this.decorations = i9, Ls(this.contentElement, s3, e5, { ...this.reconcileOptions(s3.selection), decorations: i9, oldDecorations: r4, compositionBlockId: this.compositionTracker.isComposing ? this.compositionTracker.activeBlockId ?? void 0 : void 0 }), this.compositionTracker.isComposing || Me(this.contentElement, e5.selection);
3094
+ this.decorations = i9, Ws(this.contentElement, s3, e5, { ...this.reconcileOptions(s3.selection), decorations: i9, oldDecorations: r4, compositionBlockId: this.compositionTracker.isComposing ? this.compositionTracker.activeBlockId ?? void 0 : void 0 }), this.compositionTracker.isComposing || Me(this.contentElement, e5.selection);
2980
3095
  for (const n4 of this.stateChangeCallbacks) n4(s3, e5, t3);
2981
3096
  this.preserveGoalColumn || (this.goalColumn = null);
2982
3097
  } finally {
@@ -3011,7 +3126,7 @@ class Fs {
3011
3126
  const t3 = this.state;
3012
3127
  this.state = e5, this.history.clear();
3013
3128
  const n3 = this.decorations, s3 = this.getDecorations?.(e5) ?? lt.empty;
3014
- this.decorations = s3, Ls(this.contentElement, t3, e5, { ...this.reconcileOptions(t3.selection), decorations: s3, oldDecorations: n3, compositionBlockId: this.compositionTracker.isComposing ? this.compositionTracker.activeBlockId ?? void 0 : void 0 }), this.compositionTracker.isComposing || Me(this.contentElement, e5.selection);
3129
+ this.decorations = s3, Ws(this.contentElement, t3, e5, { ...this.reconcileOptions(t3.selection), decorations: s3, oldDecorations: n3, compositionBlockId: this.compositionTracker.isComposing ? this.compositionTracker.activeBlockId ?? void 0 : void 0 }), this.compositionTracker.isComposing || Me(this.contentElement, e5.selection);
3015
3130
  } finally {
3016
3131
  this.isUpdating = false;
3017
3132
  }
@@ -3114,8 +3229,8 @@ class Fs {
3114
3229
  this.goalColumn = null;
3115
3230
  const t3 = this.resolveLogicalHorizontalDirection(e5), n3 = Oe(this.state, t3);
3116
3231
  if (n3) return this.dispatch(n3), this.validateSelectionAfterInlineSkip(), true;
3117
- if (!Pe(this.contentElement, this.state, e5)) return false;
3118
- const s3 = _e(this.state, t3);
3232
+ if (!_e(this.contentElement, this.state, e5)) return false;
3233
+ const s3 = De(this.state, t3);
3119
3234
  return !!s3 && (this.dispatch(s3), true);
3120
3235
  }
3121
3236
  resolveLogicalHorizontalDirection(e5) {
@@ -3125,8 +3240,8 @@ class Fs {
3125
3240
  return n3 instanceof HTMLElement && "rtl" === Ze(n3) ? "left" === e5 ? "right" : "left" : e5;
3126
3241
  }
3127
3242
  handleVerticalArrow(e5) {
3128
- const t3 = this.contentElement.ownerDocument.getSelection?.() ?? null, n3 = t3 ? De(t3) : null;
3129
- if (!Pe(this.contentElement, this.state, e5, n3)) return false;
3243
+ const t3 = this.contentElement.ownerDocument.getSelection?.() ?? null, n3 = t3 ? Pe(t3) : null;
3244
+ if (!_e(this.contentElement, this.state, e5, n3)) return false;
3130
3245
  null === this.goalColumn && n3 && (this.goalColumn = n3.left), this.preserveGoalColumn = true;
3131
3246
  const s3 = He(this.contentElement, this.state, e5, this.goalColumn);
3132
3247
  return s3 ? (this.dispatch(s3), this.preserveGoalColumn = false, true) : (this.preserveGoalColumn = false, false);
@@ -3141,39 +3256,43 @@ class Fs {
3141
3256
  this.nodeViews.clear();
3142
3257
  }
3143
3258
  }
3144
- const Us = ["\n:host {\n display: block;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n font-size: 16px;\n line-height: 1.6;\n color: var(--notectl-fg);\n}\n\n.notectl-editor {\n display: flex;\n flex-direction: column;\n border: 1px solid var(--notectl-border);\n border-radius: 6px;\n overflow: hidden;\n background: var(--notectl-bg);\n}\n\n.notectl-editor:focus-within {\n border-color: var(--notectl-border-focus);\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* Content Area */\n.notectl-content {\n flex: 1;\n padding: 12px 16px;\n outline: none;\n min-height: var(--notectl-content-min-height, 400px);\n cursor: text;\n position: relative;\n white-space: pre-wrap;\n word-wrap: break-word;\n -moz-tab-size: 4;\n tab-size: 4;\n}\n\n.notectl-content p {\n margin: 0;\n padding: 2px 0;\n min-height: 1.6em;\n}\n\n.notectl-content p + p {\n margin-top: 0;\n}\n\n/* Horizontal Rule */\n.notectl-content hr {\n border: none;\n border-top: 1px solid var(--notectl-border);\n margin: 8px 0;\n padding: 0;\n cursor: default;\n user-select: none;\n}\n\n/* Placeholder */\n.notectl-content.notectl-content--empty::before {\n content: attr(data-placeholder);\n color: var(--notectl-fg-muted);\n pointer-events: none;\n position: absolute;\n top: 12px;\n left: 16px;\n}\n\n/* Plugin container bottom */\n.notectl-plugin-container--bottom {\n border-top: 1px solid var(--notectl-border);\n}\n\n/* Screen reader announcements */\n.notectl-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Node selection */\n.notectl-node-selected {\n outline: 2px solid var(--notectl-primary);\n outline-offset: 2px;\n}\n", "\n@media (prefers-reduced-motion: reduce) {\n .notectl-toolbar-btn,\n .notectl-image__resize-handle,\n .notectl-image__size-indicator,\n .notectl-color-picker__swatch,\n .notectl-font-picker__item,\n .notectl-heading-picker__item,\n .notectl-font-size-picker__item,\n .ntbl-handle,\n .ntbl-handle-delete,\n .ntbl-insert-line,\n .ntbl-insert-btn,\n .ntbl-add-zone,\n .ntbl-add-icon,\n .ntbl-col-bar,\n .ntbl-row-bar,\n .ntbl-delete-table-btn,\n .notectl-code-block__copy {\n transition: none !important;\n }\n}\n", '\n/* Paper viewport: scroll container with centered gray background */\n.notectl-paper-viewport {\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n background: var(--notectl-paper-viewport-bg, #e8e8e8);\n padding: 24px 0;\n}\n\n/* Paper surface: white page with shadow, centered */\n.notectl-paper-surface {\n margin: 0 auto;\n background: var(--notectl-bg);\n border-radius: 2px;\n box-shadow: 0 2px 8px var(--notectl-shadow, rgba(0, 0, 0, 0.15));\n transform-origin: top center;\n transition: transform 0.15s ease-out;\n}\n\n/* Content overrides in paper mode: wider document margins */\n.notectl-editor[data-paper-mode] .notectl-content {\n flex: none;\n padding: 48px 56px;\n min-height: auto;\n}\n\n/* Placeholder position override for paper mode */\n.notectl-editor[data-paper-mode] .notectl-content.notectl-content--empty::before {\n top: 48px;\n left: 56px;\n}\n\n/* Dark mode: darker viewport background */\n:host([theme="dark"]) .notectl-paper-viewport {\n --notectl-paper-viewport-bg: #181825;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .notectl-paper-surface {\n transition: none !important;\n }\n}\n'].join("\n");
3145
- let Ws = null;
3146
- class Vs {
3259
+ const or = ["\n:host {\n display: block;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n font-size: 16px;\n line-height: 1.6;\n color: var(--notectl-fg);\n}\n\n.notectl-editor {\n display: flex;\n flex-direction: column;\n border: 1px solid var(--notectl-border);\n border-radius: 6px;\n overflow: hidden;\n background: var(--notectl-bg);\n}\n\n.notectl-editor:focus-within {\n border-color: var(--notectl-border-focus);\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* Content Area */\n.notectl-content {\n flex: 1;\n padding: 12px 16px;\n outline: none;\n min-height: var(--notectl-content-min-height, 400px);\n cursor: text;\n position: relative;\n white-space: pre-wrap;\n word-wrap: break-word;\n -moz-tab-size: 4;\n tab-size: 4;\n}\n\n.notectl-content p {\n margin: 0;\n padding: 2px 0;\n min-height: 1.6em;\n}\n\n.notectl-content p + p {\n margin-top: 0;\n}\n\n/* Horizontal Rule */\n.notectl-content hr {\n border: none;\n border-top: 1px solid var(--notectl-border);\n margin: 8px 0;\n padding: 0;\n cursor: default;\n user-select: none;\n}\n\n/* Placeholder */\n.notectl-content.notectl-content--empty::before {\n content: attr(data-placeholder);\n color: var(--notectl-fg-muted);\n pointer-events: none;\n position: absolute;\n top: 12px;\n left: 16px;\n}\n\n/* Plugin container bottom */\n.notectl-plugin-container--bottom {\n border-top: 1px solid var(--notectl-border);\n}\n\n/* Screen reader announcements */\n.notectl-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Node selection */\n.notectl-node-selected {\n outline: 2px solid var(--notectl-primary);\n outline-offset: 2px;\n}\n", "\n@media (prefers-reduced-motion: reduce) {\n .notectl-toolbar-btn,\n .notectl-image__resize-handle,\n .notectl-image__size-indicator,\n .notectl-color-picker__swatch,\n .notectl-font-picker__item,\n .notectl-heading-picker__item,\n .notectl-font-size-picker__item,\n .ntbl-handle,\n .ntbl-handle-delete,\n .ntbl-insert-line,\n .ntbl-insert-btn,\n .ntbl-add-zone,\n .ntbl-add-icon,\n .ntbl-col-bar,\n .ntbl-row-bar,\n .ntbl-delete-table-btn,\n .notectl-code-block__copy {\n transition: none !important;\n }\n}\n", '\n/* Paper viewport: scroll container with centered gray background */\n.notectl-paper-viewport {\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n background: var(--notectl-paper-viewport-bg, #e8e8e8);\n padding: 24px 0;\n}\n\n/* Paper surface: white page with shadow, centered */\n.notectl-paper-surface {\n margin: 0 auto;\n background: var(--notectl-bg);\n border-radius: 2px;\n box-shadow: 0 2px 8px var(--notectl-shadow, rgba(0, 0, 0, 0.15));\n transform-origin: top center;\n transition: transform 0.15s ease-out;\n}\n\n/* Content overrides in paper mode: wider document margins */\n.notectl-editor[data-paper-mode] .notectl-content {\n flex: none;\n padding: 48px 56px;\n min-height: auto;\n}\n\n/* Placeholder position override for paper mode */\n.notectl-editor[data-paper-mode] .notectl-content.notectl-content--empty::before {\n top: 48px;\n left: 56px;\n}\n\n/* Dark mode: darker viewport background */\n:host([theme="dark"]) .notectl-paper-viewport {\n --notectl-paper-viewport-bg: #181825;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .notectl-paper-surface {\n transition: none !important;\n }\n}\n'].join("\n");
3260
+ let ar = null;
3261
+ class cr {
3147
3262
  themeStyleSheet = new CSSStyleSheet();
3148
3263
  systemThemeQuery = null;
3149
3264
  systemThemeHandler = null;
3150
3265
  pluginSheets = [];
3266
+ runtimeSheets = [];
3151
3267
  shadow;
3152
3268
  constructor(e5) {
3153
3269
  this.shadow = e5;
3154
3270
  }
3155
3271
  apply(e5) {
3156
- if (this.cleanupSystemThemeListener(), e5 === Vn.System) {
3272
+ if (this.cleanupSystemThemeListener(), e5 === es.System) {
3157
3273
  this.setupSystemThemeListener();
3158
- const e6 = Qn(this.getSystemTheme());
3274
+ const e6 = rs(this.getSystemTheme());
3159
3275
  this.setThemeStyleSheet(e6);
3160
- } else this.setThemeStyleSheet(Qn(e5));
3276
+ } else this.setThemeStyleSheet(rs(e5));
3161
3277
  }
3162
3278
  setPluginStyleSheets(e5) {
3163
3279
  this.pluginSheets = e5, this.refreshAdoptedStyleSheets();
3164
3280
  }
3281
+ setRuntimeStyleSheets(e5) {
3282
+ this.runtimeSheets = e5, this.refreshAdoptedStyleSheets();
3283
+ }
3165
3284
  destroy() {
3166
3285
  this.cleanupSystemThemeListener();
3167
3286
  }
3168
3287
  setThemeStyleSheet(e5) {
3169
- this.themeStyleSheet.replaceSync(es(e5)), this.refreshAdoptedStyleSheets();
3288
+ this.themeStyleSheet.replaceSync(cs(e5)), this.refreshAdoptedStyleSheets();
3170
3289
  }
3171
3290
  refreshAdoptedStyleSheets() {
3172
- this.shadow.adoptedStyleSheets = [this.themeStyleSheet, (Ws || (Ws = new CSSStyleSheet(), Ws.replaceSync(Us)), Ws), ...this.pluginSheets];
3291
+ this.shadow.adoptedStyleSheets = [this.themeStyleSheet, (ar || (ar = new CSSStyleSheet(), ar.replaceSync(or)), ar), ...this.pluginSheets, ...this.runtimeSheets];
3173
3292
  }
3174
3293
  setupSystemThemeListener() {
3175
3294
  this.systemThemeQuery = window.matchMedia("(prefers-color-scheme: dark)"), this.systemThemeHandler = (e5) => {
3176
- const t3 = Qn(this.getSystemTheme());
3295
+ const t3 = rs(this.getSystemTheme());
3177
3296
  this.setThemeStyleSheet(t3);
3178
3297
  }, this.systemThemeQuery.addEventListener("change", this.systemThemeHandler);
3179
3298
  }
@@ -3181,10 +3300,10 @@ class Vs {
3181
3300
  this.systemThemeQuery && this.systemThemeHandler && this.systemThemeQuery.removeEventListener("change", this.systemThemeHandler), this.systemThemeQuery = null, this.systemThemeHandler = null;
3182
3301
  }
3183
3302
  getSystemTheme() {
3184
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? Vn.Dark : Vn.Light;
3303
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? es.Dark : es.Light;
3185
3304
  }
3186
3305
  }
3187
- class Gs {
3306
+ class lr {
3188
3307
  wrapper;
3189
3308
  content;
3190
3309
  viewport = null;
@@ -3201,7 +3320,7 @@ class Gs {
3201
3320
  }
3202
3321
  apply(e5) {
3203
3322
  if (null === e5) return void this.disable();
3204
- const t3 = Pn(e5);
3323
+ const t3 = Fn(e5);
3205
3324
  this.currentPaperWidthPx = t3.widthPx, this.currentPaperHeightPx = t3.heightPx, this.currentSize = e5, this.viewport || this.enable(), this.updateSurfaceDimensions(), this.wrapper.setAttribute("data-paper-mode", e5);
3206
3325
  }
3207
3326
  destroy() {
@@ -3228,12 +3347,12 @@ class Gs {
3228
3347
  this.viewport = null, this.surface = null, this.currentSize = null, this.currentPaperWidthPx = 0, this.currentPaperHeightPx = 0, this.currentScale = 1, this.wrapper.removeAttribute("data-paper-mode");
3229
3348
  }
3230
3349
  updateSurfaceDimensions() {
3231
- this.surface && (this.surface.style.width = `${this.currentPaperWidthPx}px`, this.surface.style.minHeight = `${this.currentPaperHeightPx}px`);
3350
+ this.surface && (Nt(this.surface, "width", `${this.currentPaperWidthPx}px`), Nt(this.surface, "minHeight", `${this.currentPaperHeightPx}px`));
3232
3351
  }
3233
3352
  onViewportResize(e5) {
3234
3353
  if (!this.surface || 0 === this.currentPaperWidthPx) return;
3235
3354
  const t3 = e5 - 48, n3 = Math.min(1, t3 / this.currentPaperWidthPx);
3236
- this.currentScale = n3, this.surface.style.transform = n3 < 1 ? `scale(${n3})` : "", this.scheduleHeightCompensation(n3);
3355
+ this.currentScale = n3, Nt(this.surface, "transform", n3 < 1 ? `scale(${n3})` : ""), this.scheduleHeightCompensation(n3);
3237
3356
  }
3238
3357
  onSurfaceResize(e5) {
3239
3358
  this.surface && this.viewport && this.scheduleHeightCompensation(this.currentScale);
@@ -3245,12 +3364,12 @@ class Gs {
3245
3364
  }
3246
3365
  updateHeightCompensation(e5) {
3247
3366
  if (!this.surface) return;
3248
- if (e5 >= 1) return void (this.surface.style.marginBottom = "");
3367
+ if (e5 >= 1) return void Nt(this.surface, "marginBottom", "");
3249
3368
  const t3 = this.surface.scrollHeight, n3 = t3 * e5 - t3;
3250
- this.surface.style.marginBottom = `${n3}px`;
3369
+ Nt(this.surface, "marginBottom", `${n3}px`);
3251
3370
  }
3252
3371
  }
3253
- class qs extends HTMLElement {
3372
+ class hr extends HTMLElement {
3254
3373
  view = null;
3255
3374
  pluginManager = null;
3256
3375
  contentElement = null;
@@ -3266,6 +3385,7 @@ class qs extends HTMLElement {
3266
3385
  preInitPlugins = [];
3267
3386
  themeController = null;
3268
3387
  paperLayout = null;
3388
+ runtimeStyleSheet = null;
3269
3389
  constructor() {
3270
3390
  super(), this.readyPromise = new Promise((e5) => {
3271
3391
  this.readyPromiseResolve = e5;
@@ -3287,7 +3407,7 @@ class qs extends HTMLElement {
3287
3407
  const e6 = null !== n3;
3288
3408
  this.contentElement.contentEditable = e6 ? "false" : "true", e6 ? this.contentElement.setAttribute("aria-readonly", "true") : this.contentElement.removeAttribute("aria-readonly"), this.config = { ...this.config, readonly: e6 }, this.pluginManager?.setReadOnly(e6);
3289
3409
  }
3290
- "theme" === e5 && this.themeController && this.themeController.apply(n3 ?? Vn.Light), "paper-size" === e5 && (null === n3 ? this.configure({ paperSize: void 0 }) : zn(n3) && this.configure({ paperSize: n3 }));
3410
+ "theme" === e5 && this.themeController && this.themeController.apply(n3 ?? es.Light), "paper-size" === e5 && (null === n3 ? this.configure({ paperSize: void 0 }) : Gn(n3) && this.configure({ paperSize: n3 }));
3291
3411
  }
3292
3412
  registerPlugin(e5) {
3293
3413
  if (this.initialized) throw new Error("Cannot register plugins after initialization. Register before calling init() or adding to DOM.");
@@ -3298,7 +3418,7 @@ class qs extends HTMLElement {
3298
3418
  this.initialized = true, e5 && (this.config = e5);
3299
3419
  const t3 = this.shadowRoot;
3300
3420
  if (!t3) return;
3301
- this.themeController = new Vs(t3), this.themeController.apply(this.config.theme ?? Vn.Light);
3421
+ this.themeController = new cr(t3), this.setupStyleRuntime(t3), this.themeController.apply(this.config.theme ?? es.Light);
3302
3422
  const n3 = (function(e6) {
3303
3423
  const t4 = document.createElement("div");
3304
3424
  t4.className = "notectl-editor";
@@ -3311,9 +3431,9 @@ class qs extends HTMLElement {
3311
3431
  const i10 = document.createElement("div");
3312
3432
  return i10.className = "notectl-sr-only", i10.setAttribute("data-notectl-no-print", ""), i10.setAttribute("aria-live", "polite"), i10.setAttribute("aria-atomic", "true"), t4.appendChild(n4), t4.appendChild(s4), t4.appendChild(r5), t4.appendChild(i10), { wrapper: t4, content: s4, topPluginContainer: n4, bottomPluginContainer: r5, announcer: i10 };
3313
3433
  })({ readonly: this.config.readonly, placeholder: this.config.placeholder });
3314
- this.editorWrapper = n3.wrapper, this.contentElement = n3.content, this.topPluginContainer = n3.topPluginContainer, this.bottomPluginContainer = n3.bottomPluginContainer, this.announcer = n3.announcer, t3.appendChild(this.editorWrapper), this.config.paperSize && (this.paperLayout = new Gs(this.editorWrapper, this.contentElement), this.paperLayout.apply(this.config.paperSize)), this.pluginManager = new Tn();
3434
+ this.editorWrapper = n3.wrapper, this.contentElement = n3.content, this.topPluginContainer = n3.topPluginContainer, this.bottomPluginContainer = n3.bottomPluginContainer, this.announcer = n3.announcer, t3.appendChild(this.editorWrapper), this.config.paperSize && (this.paperLayout = new lr(this.editorWrapper, this.contentElement), this.paperLayout.apply(this.config.paperSize)), this.pluginManager = new On();
3315
3435
  const s3 = new st(this.config.locale ?? "browser");
3316
- this.pluginManager.registerService(rt, s3), Ot(this.pluginManager.schemaRegistry), this.processToolbarConfig();
3436
+ this.pluginManager.registerService(rt, s3), $t(this.pluginManager.schemaRegistry), this.processToolbarConfig();
3317
3437
  for (const e6 of this.config.plugins ?? []) this.pluginManager.register(e6);
3318
3438
  for (const e6 of this.preInitPlugins) this.pluginManager.register(e6);
3319
3439
  this.preInitPlugins = [], this.ensureTextFormattingPlugin(), this.ensureCaretNavigationPlugin(), this.ensureGapCursorPlugin(), this.contentElement.addEventListener("focus", () => this.emit("focus", void 0)), this.contentElement.addEventListener("blur", () => this.emit("blur", void 0));
@@ -3326,13 +3446,13 @@ class qs extends HTMLElement {
3326
3446
  }, dispatch: (e6) => this.dispatch(e6), getContainer: () => r4, getPluginContainer: (e6) => "top" === e6 ? o2 : a22, announce: (e6) => {
3327
3447
  c11 && (c11.textContent = e6);
3328
3448
  }, hasAnnouncement: () => !!c11?.textContent, onBeforeReady: () => {
3329
- const e6 = me(i9.schemaRegistry), t4 = Gt.create({ schema: e6 });
3330
- this.view = new Fs(r4, { state: t4, schemaRegistry: i9.schemaRegistry, keymapRegistry: i9.keymapRegistry, inputRuleRegistry: i9.inputRuleRegistry, fileHandlerRegistry: i9.fileHandlerRegistry, nodeViewRegistry: i9.nodeViewRegistry, maxHistoryDepth: this.config.maxHistoryDepth, getDecorations: (e7, t5) => this.pluginManager?.collectDecorations(e7, t5) ?? lt.empty, onStateChange: (e7, t5, n5) => {
3449
+ const e6 = me(i9.schemaRegistry), t4 = en.create({ schema: e6 });
3450
+ this.view = new ir(r4, { state: t4, schemaRegistry: i9.schemaRegistry, keymapRegistry: i9.keymapRegistry, inputRuleRegistry: i9.inputRuleRegistry, fileHandlerRegistry: i9.fileHandlerRegistry, nodeViewRegistry: i9.nodeViewRegistry, maxHistoryDepth: this.config.maxHistoryDepth, getDecorations: (e7, t5) => this.pluginManager?.collectDecorations(e7, t5) ?? lt.empty, onStateChange: (e7, t5, n5) => {
3331
3451
  this.onStateChange(e7, t5, n5);
3332
3452
  }, isReadOnly: () => this.config.readonly ?? false }), this.updateEmptyState();
3333
3453
  const n4 = i9.getPluginStyleSheets();
3334
3454
  n4.length > 0 && this.themeController?.setPluginStyleSheets(n4);
3335
- } }), this.pluginManager && (this.config.readonly && this.pluginManager.setReadOnly(true), this.pluginManager.onEvent(Kn, (e6) => {
3455
+ } }), this.pluginManager && (this.config.readonly && this.pluginManager.setReadOnly(true), this.pluginManager.onEvent(Qn, (e6) => {
3336
3456
  !e6.options.paperSize && this.config.paperSize && (e6.options = { ...e6.options, paperSize: this.config.paperSize });
3337
3457
  }), this.config.autofocus && requestAnimationFrame(() => this.contentElement?.focus()), this.readyPromiseResolve?.(), this.emit("ready", void 0));
3338
3458
  }
@@ -3344,17 +3464,22 @@ class qs extends HTMLElement {
3344
3464
  return this.view.getState().doc;
3345
3465
  }
3346
3466
  setJSON(e5) {
3347
- const t3 = this.pluginManager ? me(this.pluginManager.schemaRegistry) : void 0, n3 = Gt.create({ doc: e5, schema: t3, selection: re(e5.children[0]?.id ?? ye(""), 0) });
3467
+ const t3 = this.pluginManager ? me(this.pluginManager.schemaRegistry) : void 0, n3 = en.create({ doc: e5, schema: t3, selection: re(e5.children[0]?.id ?? ye(""), 0) });
3348
3468
  this.replaceState(n3);
3349
3469
  }
3350
3470
  getContentHTML(e5) {
3351
3471
  if (!this.view) throw new Error("Editor not initialized");
3352
- const t3 = rs(this.view.getState().doc, this.pluginManager?.schemaRegistry);
3353
- return e5?.pretty ? xe(t3) : t3;
3472
+ const t3 = this.view.getState().doc, n3 = this.pluginManager?.schemaRegistry;
3473
+ if ("classes" === e5?.cssMode) {
3474
+ const s4 = gs(t3, n3);
3475
+ return e5.pretty ? { html: xe(s4.html), css: s4.css, styleMap: s4.styleMap } : s4;
3476
+ }
3477
+ const s3 = fs(t3, n3);
3478
+ return e5?.pretty ? xe(s3) : s3;
3354
3479
  }
3355
- setContentHTML(e5) {
3356
- const t3 = ls(e5, this.pluginManager?.schemaRegistry);
3357
- this.setJSON(t3);
3480
+ setContentHTML(e5, t3) {
3481
+ const n3 = vs(e5, this.pluginManager?.schemaRegistry, t3);
3482
+ this.setJSON(n3);
3358
3483
  }
3359
3484
  getText() {
3360
3485
  if (!this.view) throw new Error("Editor not initialized");
@@ -3402,7 +3527,7 @@ class qs extends HTMLElement {
3402
3527
  return this.view.getState();
3403
3528
  }
3404
3529
  dispatch(e5) {
3405
- this.view && this.pluginManager && (!this.config.readonly || Yt(e5) || this.pluginManager.isReadonlyBypassed()) && this.pluginManager.dispatchWithMiddleware(e5, this.view.getState(), (e6) => this.view?.dispatch(e6));
3530
+ this.view && this.pluginManager && (!this.config.readonly || on(e5) || this.pluginManager.isReadonlyBypassed()) && this.pluginManager.dispatchWithMiddleware(e5, this.view.getState(), (e6) => this.view?.dispatch(e6));
3406
3531
  }
3407
3532
  on(e5, t3) {
3408
3533
  this.eventListeners.has(e5) || this.eventListeners.set(e5, /* @__PURE__ */ new Set()), this.eventListeners.get(e5)?.add(t3);
@@ -3420,13 +3545,13 @@ class qs extends HTMLElement {
3420
3545
  this.config = { ...this.config, theme: e5 }, this.themeController?.apply(e5);
3421
3546
  }
3422
3547
  getTheme() {
3423
- return this.config.theme ?? Vn.Light;
3548
+ return this.config.theme ?? es.Light;
3424
3549
  }
3425
3550
  getPaperSize() {
3426
3551
  return this.config.paperSize;
3427
3552
  }
3428
3553
  destroy() {
3429
- this.paperLayout?.destroy(), this.paperLayout = null, this.themeController?.destroy(), this.themeController = null, this.view?.destroy();
3554
+ this.paperLayout?.destroy(), this.paperLayout = null, this.teardownStyleRuntime(), this.themeController?.destroy(), this.themeController = null, this.view?.destroy();
3430
3555
  const e5 = this.pluginManager?.destroy() ?? Promise.resolve();
3431
3556
  return this.view = null, this.pluginManager = null, this.initialized = false, this.editorWrapper?.remove(), this.editorWrapper = null, this.contentElement = null, this.topPluginContainer = null, this.bottomPluginContainer = null, this.announcer = null, e5;
3432
3557
  }
@@ -3454,7 +3579,14 @@ class qs extends HTMLElement {
3454
3579
  this.pluginManager && void 0 === this.pluginManager.get("gap-cursor") && this.pluginManager.register(new Rt());
3455
3580
  }
3456
3581
  applyPaperSize(e5) {
3457
- this.editorWrapper && this.contentElement && (e5 ? (this.paperLayout || (this.paperLayout = new Gs(this.editorWrapper, this.contentElement)), this.paperLayout.apply(e5)) : this.paperLayout?.apply(null));
3582
+ this.editorWrapper && this.contentElement && (e5 ? (this.paperLayout || (this.paperLayout = new lr(this.editorWrapper, this.contentElement)), this.paperLayout.apply(e5)) : this.paperLayout?.apply(null));
3583
+ }
3584
+ setupStyleRuntime(e5) {
3585
+ Bt(e5), this.runtimeStyleSheet = Ot(), this.themeController?.setRuntimeStyleSheets(this.runtimeStyleSheet ? [this.runtimeStyleSheet] : []), _t(e5, { nonce: this.config.styleNonce, sheet: this.runtimeStyleSheet });
3586
+ }
3587
+ teardownStyleRuntime() {
3588
+ const e5 = this.shadowRoot;
3589
+ e5 && Bt(e5), this.runtimeStyleSheet = null, this.themeController?.setRuntimeStyleSheets([]);
3458
3590
  }
3459
3591
  emit(e5, t3) {
3460
3592
  const n3 = this.eventListeners.get(e5);
@@ -3473,49 +3605,49 @@ class qs extends HTMLElement {
3473
3605
  this.view && (this.view.replaceState(e5), this.updateEmptyState());
3474
3606
  }
3475
3607
  }
3476
- async function Js(e5) {
3608
+ async function dr(e5) {
3477
3609
  const t3 = document.createElement("notectl-editor");
3478
3610
  return await t3.init(e5), t3;
3479
3611
  }
3480
- function Qs(e5) {
3481
- return { toolbar: [[new St({ fonts: Mt, ...e5?.font })]], plugins: [] };
3612
+ function ur(e5) {
3613
+ return { toolbar: [[new wt({ fonts: Pt, ...e5?.font })]], plugins: [] };
3482
3614
  }
3483
- function Xs(e5) {
3484
- return { toolbar: [[new St({ fonts: Mt, ...e5?.font }), new Et(e5?.fontSize)], [new pt(e5?.textFormatting), new kt(e5?.strikethrough), new Tt(e5?.superSub)], [new vt(e5?.textColor), new Ct(e5?.highlight)], [new ft(e5?.heading), new yt(e5?.blockquote), new dt(e5?.codeBlock)], [new wt(e5?.alignment)], [new mt(e5?.list)], [new gt(e5?.link), new xt(e5?.table), new bt(e5?.horizontalRule), new At(e5?.image)], [new Wn(e5?.print)]], plugins: [new Ye()] };
3615
+ function pr(e5) {
3616
+ return { toolbar: [[new wt({ fonts: Pt, ...e5?.font }), new Et(e5?.fontSize)], [new pt(e5?.textFormatting), new kt(e5?.strikethrough), new Tt(e5?.superSub)], [new bt(e5?.textColor), new Ct(e5?.highlight)], [new ft(e5?.heading), new yt(e5?.blockquote), new dt(e5?.codeBlock)], [new St(e5?.alignment)], [new mt(e5?.list)], [new gt(e5?.link), new xt(e5?.table), new vt(e5?.horizontalRule), new At(e5?.image)], [new Zn(e5?.print)]], plugins: [new Ye()] };
3485
3617
  }
3486
- "undefined" == typeof customElements || customElements.get("notectl-editor") || customElements.define("notectl-editor", qs);
3618
+ "undefined" == typeof customElements || customElements.get("notectl-editor") || customElements.define("notectl-editor", hr);
3487
3619
  export {
3488
- Fn as AFTER_PRINT,
3620
+ Xn as AFTER_PRINT,
3489
3621
  a13 as ALIGNMENT_ICONS,
3490
3622
  b15 as ALIGNMENT_LOCALES,
3491
3623
  c7 as ALIGNMENT_LOCALE_DE,
3492
3624
  d3 as ALIGNMENT_LOCALE_EN,
3493
- wt as AlignmentPlugin,
3494
- Kn as BEFORE_PRINT,
3625
+ St as AlignmentPlugin,
3626
+ Qn as BEFORE_PRINT,
3495
3627
  a9 as BLOCKQUOTE_LOCALES,
3496
3628
  b11 as BLOCKQUOTE_LOCALE_EN,
3497
- yn as BlockTypePickerRegistry,
3629
+ Cn as BlockTypePickerRegistry,
3498
3630
  yt as BlockquotePlugin,
3499
3631
  a4 as CODE_BLOCK_LOCALES,
3500
3632
  b6 as CODE_BLOCK_LOCALE_EN,
3501
3633
  c6 as CODE_BLOCK_SERVICE_KEY,
3502
3634
  te as CaretNavigationPlugin,
3503
- ln as ClipboardHandler,
3635
+ yn as ClipboardHandler,
3504
3636
  dt as CodeBlockPlugin,
3505
- hn as CompositionTracker,
3506
- bn as CursorWrapper,
3507
- qn as DARK_THEME,
3637
+ kn as CompositionTracker,
3638
+ Rn as CursorWrapper,
3639
+ ns as DARK_THEME,
3508
3640
  D2 as DEFAULT_IMAGE_KEYMAP,
3509
3641
  lt as DecorationSet,
3510
- Gt as EditorState,
3511
- Cn as EventBus,
3642
+ en as EditorState,
3643
+ Bn as EventBus,
3512
3644
  et as EventKey,
3513
3645
  a14 as FONT_LOCALES,
3514
3646
  b16 as FONT_LOCALE_EN,
3515
3647
  a15 as FONT_SIZE_LOCALES,
3516
3648
  b17 as FONT_SIZE_LOCALE_EN,
3517
- pn as FileHandlerRegistry,
3518
- St as FontPlugin,
3649
+ Sn as FileHandlerRegistry,
3650
+ wt as FontPlugin,
3519
3651
  Et as FontSizePlugin,
3520
3652
  Rt as GapCursorPlugin,
3521
3653
  a6 as HEADING_LOCALES,
@@ -3527,42 +3659,42 @@ export {
3527
3659
  Ye as HardBreakPlugin,
3528
3660
  ft as HeadingPlugin,
3529
3661
  Ct as HighlightPlugin,
3530
- Zt as HistoryManager,
3531
- bt as HorizontalRulePlugin,
3662
+ an as HistoryManager,
3663
+ vt as HorizontalRulePlugin,
3532
3664
  a19 as IMAGE_LOCALES,
3533
3665
  b21 as IMAGE_LOCALE_EN,
3534
3666
  c9 as IMAGE_UPLOAD_SERVICE,
3535
3667
  At as ImagePlugin,
3536
- un as InputRuleRegistry,
3537
- dn as KeymapRegistry,
3538
- Gn as LIGHT_THEME,
3668
+ vn as InputRuleRegistry,
3669
+ bn as KeymapRegistry,
3670
+ ts as LIGHT_THEME,
3539
3671
  a7 as LINK_LOCALES,
3540
3672
  b9 as LINK_LOCALE_EN,
3541
3673
  a8 as LIST_LOCALES,
3542
3674
  b10 as LIST_LOCALE_EN,
3543
3675
  gt as LinkPlugin,
3544
3676
  mt as ListPlugin,
3545
- ns as Locale,
3677
+ hs as Locale,
3546
3678
  st as LocaleService,
3547
3679
  rt as LocaleServiceKey,
3548
- gn as NodeViewRegistry,
3549
- qs as NotectlEditor,
3550
- Dn as PAPER_MARGIN_HORIZONTAL_PX,
3551
- _n as PAPER_MARGIN_TOP_PX,
3552
- Hn as PAPER_VIEWPORT_PADDING_PX,
3553
- Rn as PRINT_LOCALES,
3554
- An as PRINT_LOCALE_EN,
3555
- $n as PRINT_SERVICE_KEY,
3556
- In as PaperSize,
3557
- Tn as PluginManager,
3680
+ En as NodeViewRegistry,
3681
+ hr as NotectlEditor,
3682
+ Wn as PAPER_MARGIN_HORIZONTAL_PX,
3683
+ Un as PAPER_MARGIN_TOP_PX,
3684
+ Vn as PAPER_VIEWPORT_PADDING_PX,
3685
+ Dn as PRINT_LOCALES,
3686
+ _n as PRINT_LOCALE_EN,
3687
+ Jn as PRINT_SERVICE_KEY,
3688
+ zn as PaperSize,
3689
+ On as PluginManager,
3558
3690
  P as PopupManager,
3559
- b5 as PopupServiceKey,
3560
- Wn as PrintPlugin,
3691
+ a2 as PopupServiceKey,
3692
+ Zn as PrintPlugin,
3561
3693
  a10 as STRIKETHROUGH_LOCALES,
3562
3694
  b12 as STRIKETHROUGH_LOCALE_EN,
3563
3695
  a18 as SUPER_SUB_LOCALES,
3564
3696
  b20 as SUPER_SUB_LOCALE_EN,
3565
- It as SchemaRegistry,
3697
+ Ht as SchemaRegistry,
3566
3698
  tt as ServiceKey,
3567
3699
  kt as StrikethroughPlugin,
3568
3700
  Tt as SuperSubPlugin,
@@ -3579,54 +3711,54 @@ export {
3579
3711
  b13 as TEXT_COLOR_LOCALE_EN,
3580
3712
  a5 as TEXT_FORMATTING_LOCALES,
3581
3713
  b7 as TEXT_FORMATTING_LOCALE_EN,
3582
- c5 as TOOLBAR_LOCALES,
3583
- d2 as TOOLBAR_LOCALE_EN,
3714
+ b5 as TOOLBAR_LOCALES,
3715
+ c5 as TOOLBAR_LOCALE_EN,
3584
3716
  xt as TablePlugin,
3585
3717
  j4 as TableSelectionServiceKey,
3586
- wt as TextAlignmentPlugin,
3587
- vt as TextColorPlugin,
3718
+ bt as TextColorPlugin,
3588
3719
  pt as TextFormattingPlugin,
3589
- Vn as ThemePreset,
3590
- e3 as ToolbarOverflowBehavior,
3720
+ es as ThemePreset,
3721
+ d2 as ToolbarOverflowBehavior,
3591
3722
  it as ToolbarPlugin,
3592
- mn as ToolbarRegistry,
3593
- a2 as ToolbarServiceKey,
3594
- Vt as TransactionBuilder,
3595
- ss as VALID_ALIGNMENTS,
3723
+ xn as ToolbarRegistry,
3724
+ e3 as ToolbarServiceKey,
3725
+ Zt as TransactionBuilder,
3726
+ ps as VALID_ALIGNMENTS,
3727
+ Ls as adoptContentStyles,
3596
3728
  a3 as appendToRoot,
3597
3729
  a20 as applyAttributedMark,
3598
- Ft as applyStep,
3599
- xn as attachGridKeyboard,
3600
- En as attachListboxKeyboard,
3601
- Sn as attachMenuKeyboard,
3730
+ Qt as applyStep,
3731
+ Nn as attachGridKeyboard,
3732
+ In as attachListboxKeyboard,
3733
+ Mn as attachMenuKeyboard,
3602
3734
  ye as blockId,
3603
3735
  v as blockOffsetToTextOffset,
3604
- Nt as canContain,
3736
+ zt as canContain,
3605
3737
  c10 as canCrossBlockBoundary,
3606
3738
  c3 as commandName,
3607
- Se as createBlockElement,
3739
+ we as createBlockElement,
3608
3740
  _ as createBlockNode,
3609
3741
  re as createCollapsedSelection,
3610
3742
  W as createDocument,
3611
- Js as createEditor,
3612
- Xs as createFullPreset,
3743
+ dr as createEditor,
3744
+ pr as createFullPreset,
3613
3745
  j2 as createGapCursor,
3614
3746
  X as createInlineNode,
3615
- Qs as createMinimalPreset,
3747
+ ur as createMinimalPreset,
3616
3748
  se as createNodeSelection,
3617
3749
  ce as createPosition,
3618
3750
  ae as createSelection,
3619
3751
  T as createTextNode,
3620
- Jn as createTheme,
3621
- ts as createThemeStyleSheet,
3752
+ ss as createTheme,
3753
+ ls as createThemeStyleSheet,
3622
3754
  pe as defaultSchema,
3623
- tn as deleteBackward,
3755
+ ln as deleteBackward,
3624
3756
  Ve as deleteBackwardAtGap,
3625
- nn as deleteForward,
3757
+ hn as deleteForward,
3626
3758
  Ge as deleteForwardAtGap,
3627
3759
  ze as deleteNodeSelection,
3628
3760
  je as deleteSelectionCommand,
3629
- Pe as endOfTextblock,
3761
+ _e as endOfTextblock,
3630
3762
  Ee as escapeHTML,
3631
3763
  e as extendCharacterBackward,
3632
3764
  c as extendCharacterForward,
@@ -3650,28 +3782,29 @@ export {
3650
3782
  f3 as forEachBlockInRange,
3651
3783
  xe as formatHTML,
3652
3784
  ut as formatShortcut,
3653
- es as generateThemeCSS,
3785
+ cs as generateThemeCSS,
3654
3786
  J as getBlockChildren,
3655
3787
  O as getBlockLength,
3656
3788
  K as getBlockMarksAtOffset,
3657
3789
  $ as getBlockText,
3658
3790
  p as getBlockTypeLabel,
3659
- De as getCaretRectFromSelection,
3791
+ Pe as getCaretRectFromSelection,
3660
3792
  U as getContentAtOffset,
3661
3793
  I as getInlineChildren,
3662
3794
  g3 as getMarkAttrAtSelection,
3663
- jn as getPaperCSSSize,
3664
- Pn as getPaperDimensions,
3795
+ qn as getPaperCSSSize,
3796
+ Fn as getPaperDimensions,
3665
3797
  w as getTextChildren,
3666
3798
  Ze as getTextDirection,
3667
3799
  h as hasMark,
3800
+ Ts as injectContentStyles,
3668
3801
  i5 as inlineDecoration,
3669
- ve as inlineType,
3802
+ be as inlineType,
3670
3803
  Je as insertHardBreakCommand,
3671
3804
  qe as insertTextCommand,
3672
- Ut as invertStep,
3673
- Wt as invertTransaction,
3674
- Yt as isAllowedInReadonly,
3805
+ Xt as invertStep,
3806
+ Yt as invertTransaction,
3807
+ on as isAllowedInReadonly,
3675
3808
  i7 as isAttributedMarkActive,
3676
3809
  S as isBlockNode,
3677
3810
  le as isCollapsed,
@@ -3688,16 +3821,16 @@ export {
3688
3821
  b as isMarkActive,
3689
3822
  fe as isMarkAllowed,
3690
3823
  i2 as isMarkOfType,
3691
- we as isNodeOfType,
3824
+ Se as isNodeOfType,
3692
3825
  ie as isNodeSelection,
3693
- Xt as isSelectionOnlyTransaction,
3826
+ rn as isSelectionOnlyTransaction,
3694
3827
  R as isTextNode,
3695
3828
  de as isTextSelection,
3696
- zn as isValidPaperSize,
3829
+ Gn as isValidPaperSize,
3697
3830
  i8 as isVoidBlock,
3698
3831
  b4 as isWebKit,
3699
3832
  Q as markSetsEqual,
3700
- be as markType,
3833
+ ve as markType,
3701
3834
  Ke as mergeBlockBackward,
3702
3835
  q as moveCharacterBackward,
3703
3836
  r as moveCharacterForward,
@@ -3712,7 +3845,7 @@ export {
3712
3845
  m2 as moveTx,
3713
3846
  A as moveWordBackward,
3714
3847
  B as moveWordForward,
3715
- _e as navigateAcrossBlocks,
3848
+ De as navigateAcrossBlocks,
3716
3849
  Ue as navigateArrowIntoVoid,
3717
3850
  Re as navigateFromGapCursor,
3718
3851
  He as navigateVerticalWithGoalColumn,
@@ -3720,23 +3853,26 @@ export {
3720
3853
  n2 as nodeDecoration,
3721
3854
  j3 as nodeSelTx,
3722
3855
  ke as nodeType,
3723
- rn as normalizeKeyDescriptor,
3724
- ls as parseHTMLToDocument,
3856
+ un as normalizeKeyDescriptor,
3857
+ vs as parseHTMLToDocument,
3725
3858
  p2 as pluginId,
3726
3859
  p3 as positionPopup,
3727
3860
  E as prevGraphemeSize,
3728
- Ot as registerBuiltinSpecs,
3861
+ $t as registerBuiltinSpecs,
3862
+ Ms as removeAdoptedStyles,
3729
3863
  r3 as removeAttributedMark,
3864
+ As as removeContentStyles,
3730
3865
  r2 as renderColorGrid,
3731
3866
  Te as resolveNodeByPath,
3732
3867
  c4 as resolveParentByPath,
3733
3868
  nt as resolvePluginLocale,
3734
- Qn as resolveTheme,
3869
+ rs as resolveTheme,
3735
3870
  me as schemaFromRegistry,
3736
3871
  Fe as selectAll,
3737
3872
  ue as selectionRange,
3738
3873
  he as selectionsEqual,
3739
- rs as serializeDocumentToHTML,
3874
+ gs as serializeDocumentToCSS,
3875
+ fs as serializeDocumentToHTML,
3740
3876
  s2 as sharesParent,
3741
3877
  Oe as skipInlineNode,
3742
3878
  We as splitBlockCommand,
@@ -3744,7 +3880,7 @@ export {
3744
3880
  c2 as toggleItalic,
3745
3881
  e2 as toggleMark,
3746
3882
  f as toggleUnderline,
3747
- Bt as validateContent,
3883
+ jt as validateContent,
3748
3884
  F as viewExtend,
3749
3885
  G as viewMove,
3750
3886
  w3 as walkNodes,