@vonage/vivid 5.20.1 → 5.22.0

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 (302) hide show
  1. package/accordion/index.cjs +1 -1
  2. package/accordion/index.js +2 -2
  3. package/alert/index.cjs +1 -1
  4. package/alert/index.js +2 -2
  5. package/audio-player/index.cjs +3 -5
  6. package/audio-player/index.js +30 -32
  7. package/avatar/index.cjs +1 -1
  8. package/avatar/index.js +1 -1
  9. package/banner/index.cjs +1 -1
  10. package/banner/index.js +2 -2
  11. package/bundled/affix.cjs +4 -4
  12. package/bundled/affix.js +4 -4
  13. package/bundled/base-color-picker.cjs +2 -2
  14. package/bundled/base-color-picker.js +2 -2
  15. package/bundled/button.cjs +1 -1
  16. package/bundled/button.js +1 -1
  17. package/bundled/definition10.cjs +1 -1
  18. package/bundled/definition10.js +1 -1
  19. package/bundled/definition13.cjs +1 -1
  20. package/bundled/definition13.js +1 -1
  21. package/bundled/definition15.cjs +1 -1
  22. package/bundled/definition15.js +2 -2
  23. package/bundled/definition16.cjs +2 -2
  24. package/bundled/definition16.js +2 -2
  25. package/bundled/definition17.cjs +1 -1
  26. package/bundled/definition17.js +1 -1
  27. package/bundled/definition18.cjs +2 -2
  28. package/bundled/definition18.js +15 -6
  29. package/bundled/definition19.cjs +1 -1
  30. package/bundled/definition19.js +1 -1
  31. package/bundled/definition20.cjs +1 -1
  32. package/bundled/definition20.js +1 -1
  33. package/bundled/definition21.cjs +1 -1
  34. package/bundled/definition21.js +2 -2
  35. package/bundled/definition24.cjs +1 -1
  36. package/bundled/definition24.js +1 -1
  37. package/bundled/definition3.cjs +1 -1
  38. package/bundled/definition3.js +3 -3
  39. package/bundled/definition4.cjs +1 -1
  40. package/bundled/definition4.js +1 -1
  41. package/bundled/definition5.cjs +1 -1
  42. package/bundled/definition5.js +1 -1
  43. package/bundled/definition6.cjs +1 -1
  44. package/bundled/definition6.js +2 -2
  45. package/bundled/definition8.cjs +1 -1
  46. package/bundled/definition8.js +12 -6
  47. package/bundled/definition9.cjs +1 -1
  48. package/bundled/definition9.js +1 -1
  49. package/bundled/form-associated.cjs +1 -1
  50. package/bundled/form-associated.js +2 -2
  51. package/bundled/listbox.cjs +1 -1
  52. package/bundled/listbox.js +5 -5
  53. package/bundled/numberConverter.cjs +1 -1
  54. package/bundled/numberConverter.js +1 -1
  55. package/bundled/slider.template.cjs +1 -1
  56. package/bundled/slider.template.js +1 -1
  57. package/bundled/vivid-element.cjs +1 -1
  58. package/bundled/vivid-element.js +1 -1
  59. package/bundled/with-contextual-help.cjs +1 -1
  60. package/bundled/with-contextual-help.js +1 -1
  61. package/calendar/index.cjs +1 -1
  62. package/calendar/index.js +3 -3
  63. package/color-picker/index.cjs +20 -20
  64. package/color-picker/index.js +22 -22
  65. package/combobox/index.cjs +1 -1
  66. package/combobox/index.js +7 -7
  67. package/country-group/index.cjs +1 -1
  68. package/country-group/index.js +1 -1
  69. package/custom-elements.json +227 -185
  70. package/data-grid/index.cjs +2 -2
  71. package/data-grid/index.js +12 -10
  72. package/dial-pad/index.cjs +1 -1
  73. package/dial-pad/index.js +2 -2
  74. package/dialog/index.cjs +1 -1
  75. package/dialog/index.js +1 -1
  76. package/file-picker/index.cjs +1 -1
  77. package/file-picker/index.js +1 -1
  78. package/header/index.cjs +1 -1
  79. package/header/index.js +1 -1
  80. package/lib/audio-player/audio-player.d.ts +0 -1
  81. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +1 -1
  82. package/lib/checkbox/checkbox.d.ts +16 -16
  83. package/lib/color-picker/color-picker.d.ts +16 -16
  84. package/lib/combobox/combobox.d.ts +21 -21
  85. package/lib/date-picker/date-picker.d.ts +26 -26
  86. package/lib/date-range-picker/date-range-picker.d.ts +14 -14
  87. package/lib/date-time-picker/date-time-picker.d.ts +24 -24
  88. package/lib/dial-pad/dial-pad.d.ts +1 -1
  89. package/lib/file-picker/file-picker.d.ts +21 -21
  90. package/lib/menu/menu.d.ts +1 -1
  91. package/lib/number-field/number-field.d.ts +22 -22
  92. package/lib/popup/popup.d.ts +2 -1
  93. package/lib/radio/radio.d.ts +16 -16
  94. package/lib/range-slider/range-slider.d.ts +10 -10
  95. package/lib/rich-text-editor/popover.d.ts +1 -1
  96. package/lib/rich-text-editor/rte/exports.d.ts +1 -0
  97. package/lib/rich-text-editor/rte/feature.d.ts +5 -5
  98. package/lib/rich-text-editor/rte/features/base.d.ts +1 -0
  99. package/lib/rich-text-editor/rte/features/drop-handler.d.ts +1 -2
  100. package/lib/rich-text-editor/rte/features/internal/core.d.ts +8 -0
  101. package/lib/rich-text-editor/rte/features/internal/history.d.ts +6 -0
  102. package/lib/rich-text-editor/rte/features/keyboard-shortcuts.d.ts +1 -1
  103. package/lib/rich-text-editor/rte/features/text-color-picker.d.ts +1 -1
  104. package/lib/rich-text-editor/rte/instance.d.ts +1 -0
  105. package/lib/rich-text-editor/rte/public-interface.d.ts +3 -0
  106. package/lib/rich-text-editor/rte/utils/ui.d.ts +1 -1
  107. package/lib/searchable-select/searchable-select.d.ts +21 -21
  108. package/lib/select/select.d.ts +22 -22
  109. package/lib/simple-color-picker/simple-color-picker.d.ts +5 -5
  110. package/lib/slider/slider.d.ts +5 -5
  111. package/lib/switch/switch.d.ts +5 -5
  112. package/lib/table/table-body.template.d.ts +1 -2
  113. package/lib/table/table-cell.template.d.ts +1 -2
  114. package/lib/table/table-head.template.d.ts +1 -2
  115. package/lib/table/table-row.template.d.ts +1 -2
  116. package/lib/table/table.template.d.ts +1 -2
  117. package/lib/text-area/text-area.d.ts +21 -21
  118. package/lib/text-field/text-field.d.ts +22 -22
  119. package/lib/time-picker/time-picker.d.ts +12 -12
  120. package/locales/de-DE.cjs +178 -4
  121. package/locales/de-DE.js +179 -2
  122. package/locales/en-GB.cjs +9 -4
  123. package/locales/en-GB.js +10 -2
  124. package/locales/en-US.cjs +2 -270
  125. package/locales/en-US.js +1 -267
  126. package/locales/ja-JP.cjs +171 -4
  127. package/locales/ja-JP.js +172 -2
  128. package/locales/zh-CN.cjs +172 -4
  129. package/locales/zh-CN.js +173 -2
  130. package/nav-disclosure/index.cjs +1 -1
  131. package/nav-disclosure/index.js +1 -1
  132. package/nav-item/index.cjs +1 -1
  133. package/nav-item/index.js +1 -1
  134. package/package.json +7 -4
  135. package/pagination/index.cjs +1 -1
  136. package/pagination/index.js +9 -2
  137. package/popover/index.cjs +1 -1
  138. package/popover/index.js +1 -1
  139. package/progress/index.cjs +1 -1
  140. package/progress/index.js +1 -1
  141. package/radio-group/index.cjs +1 -1
  142. package/radio-group/index.js +21 -19
  143. package/range-slider/index.cjs +1 -1
  144. package/range-slider/index.js +1 -1
  145. package/rich-text-editor/index.cjs +13 -12
  146. package/rich-text-editor/index.js +1085 -1057
  147. package/searchable-select/index.cjs +1 -1
  148. package/searchable-select/index.js +1 -1
  149. package/selectable-box/index.cjs +1 -1
  150. package/selectable-box/index.js +6 -1
  151. package/shared/color-picker/base-color-picker.d.ts +5 -5
  152. package/shared/feedback/mixins.d.ts +1 -1
  153. package/shared/foundation/button/button.d.ts +5 -5
  154. package/shared/foundation/form-associated/form-associated.d.ts +10 -10
  155. package/shared/foundation/listbox/listbox.d.ts +1 -1
  156. package/shared/patterns/form-elements/form-element.d.ts +5 -5
  157. package/shared/patterns/form-elements/with-contextual-help.d.ts +5 -5
  158. package/shared/patterns/form-elements/with-error-text.d.ts +6 -6
  159. package/shared/picker-field/mixins/calendar-picker.d.ts +6 -6
  160. package/shared/picker-field/mixins/calendar-picker.template.d.ts +6 -6
  161. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +8 -8
  162. package/shared/picker-field/mixins/single-date-picker.d.ts +6 -6
  163. package/shared/picker-field/mixins/single-value-picker.d.ts +6 -6
  164. package/shared/picker-field/mixins/time-selection-picker.d.ts +6 -6
  165. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +12 -12
  166. package/shared/picker-field/picker-field.d.ts +21 -21
  167. package/shared/utils/slottable-request.d.ts +1 -1
  168. package/switch/index.cjs +2 -2
  169. package/switch/index.js +2 -2
  170. package/table/index.cjs +5 -5
  171. package/table/index.js +5 -5
  172. package/tabs/index.cjs +1 -1
  173. package/tabs/index.js +3 -3
  174. package/tag/index.cjs +1 -1
  175. package/tag/index.js +1 -1
  176. package/tree-view/index.cjs +1 -1
  177. package/tree-view/index.js +0 -2
  178. package/unbundled/affix.cjs +4 -4
  179. package/unbundled/affix.js +4 -4
  180. package/unbundled/base-color-picker.cjs +3 -3
  181. package/unbundled/base-color-picker.js +3 -3
  182. package/unbundled/button.cjs +5 -5
  183. package/unbundled/button.js +5 -5
  184. package/unbundled/chunk.cjs +15 -0
  185. package/unbundled/chunk.js +13 -0
  186. package/unbundled/definition10.cjs +15 -4
  187. package/unbundled/definition10.js +15 -4
  188. package/unbundled/definition11.cjs +3 -3
  189. package/unbundled/definition11.js +3 -3
  190. package/unbundled/definition12.cjs +1 -1
  191. package/unbundled/definition12.js +1 -1
  192. package/unbundled/definition13.cjs +2 -2
  193. package/unbundled/definition13.js +2 -2
  194. package/unbundled/definition14.cjs +73 -76
  195. package/unbundled/definition14.js +73 -76
  196. package/unbundled/definition15.cjs +1 -1
  197. package/unbundled/definition15.js +1 -1
  198. package/unbundled/definition17.cjs +2 -2
  199. package/unbundled/definition17.js +2 -2
  200. package/unbundled/definition19.cjs +2 -1
  201. package/unbundled/definition19.js +2 -1
  202. package/unbundled/definition2.cjs +1 -1
  203. package/unbundled/definition2.js +1 -1
  204. package/unbundled/definition21.cjs +3 -3
  205. package/unbundled/definition21.js +3 -3
  206. package/unbundled/definition23.cjs +2 -2
  207. package/unbundled/definition23.js +2 -2
  208. package/unbundled/definition24.cjs +1 -1
  209. package/unbundled/definition24.js +1 -1
  210. package/unbundled/definition27.cjs +1 -1
  211. package/unbundled/definition27.js +1 -1
  212. package/unbundled/definition28.cjs +23 -23
  213. package/unbundled/definition28.js +23 -23
  214. package/unbundled/definition29.cjs +1 -1
  215. package/unbundled/definition29.js +1 -1
  216. package/unbundled/definition3.cjs +2 -2
  217. package/unbundled/definition3.js +2 -2
  218. package/unbundled/definition30.cjs +8 -8
  219. package/unbundled/definition30.js +8 -8
  220. package/unbundled/definition32.cjs +1 -1
  221. package/unbundled/definition32.js +1 -1
  222. package/unbundled/definition34.cjs +9 -8
  223. package/unbundled/definition34.js +9 -8
  224. package/unbundled/definition35.cjs +1 -1
  225. package/unbundled/definition35.js +1 -1
  226. package/unbundled/definition39.cjs +2 -2
  227. package/unbundled/definition39.js +2 -2
  228. package/unbundled/definition40.cjs +1 -1
  229. package/unbundled/definition40.js +1 -1
  230. package/unbundled/definition43.cjs +1 -1
  231. package/unbundled/definition43.js +1 -1
  232. package/unbundled/definition44.cjs +1 -1
  233. package/unbundled/definition44.js +1 -1
  234. package/unbundled/definition48.cjs +1 -1
  235. package/unbundled/definition48.js +1 -1
  236. package/unbundled/definition49.cjs +1 -1
  237. package/unbundled/definition49.js +1 -1
  238. package/unbundled/definition5.cjs +1 -1
  239. package/unbundled/definition5.js +1 -1
  240. package/unbundled/definition53.cjs +10 -3
  241. package/unbundled/definition53.js +10 -3
  242. package/unbundled/definition55.cjs +1 -1
  243. package/unbundled/definition55.js +1 -1
  244. package/unbundled/definition56.cjs +1 -1
  245. package/unbundled/definition56.js +1 -1
  246. package/unbundled/definition57.cjs +4 -5
  247. package/unbundled/definition57.js +4 -5
  248. package/unbundled/definition58.cjs +20 -19
  249. package/unbundled/definition58.js +20 -19
  250. package/unbundled/definition59.cjs +1 -1
  251. package/unbundled/definition59.js +1 -1
  252. package/unbundled/definition60.cjs +890 -851
  253. package/unbundled/definition60.js +890 -851
  254. package/unbundled/definition61.cjs +13 -7
  255. package/unbundled/definition61.js +13 -7
  256. package/unbundled/definition63.cjs +1 -1
  257. package/unbundled/definition63.js +1 -1
  258. package/unbundled/definition64.cjs +4 -1
  259. package/unbundled/definition64.js +4 -1
  260. package/unbundled/definition65.cjs +2 -1
  261. package/unbundled/definition65.js +2 -1
  262. package/unbundled/definition69.cjs +4 -3
  263. package/unbundled/definition69.js +4 -3
  264. package/unbundled/definition7.cjs +2 -2
  265. package/unbundled/definition7.js +2 -2
  266. package/unbundled/definition71.cjs +1 -1
  267. package/unbundled/definition71.js +1 -1
  268. package/unbundled/definition72.cjs +5 -5
  269. package/unbundled/definition72.js +5 -5
  270. package/unbundled/definition73.cjs +3 -3
  271. package/unbundled/definition73.js +3 -3
  272. package/unbundled/definition75.cjs +1 -1
  273. package/unbundled/definition75.js +1 -1
  274. package/unbundled/definition78.cjs +1 -1
  275. package/unbundled/definition78.js +1 -1
  276. package/unbundled/definition79.cjs +0 -2
  277. package/unbundled/definition79.js +0 -2
  278. package/unbundled/definition80.cjs +1 -1
  279. package/unbundled/definition80.js +1 -1
  280. package/unbundled/definition9.cjs +2 -2
  281. package/unbundled/definition9.js +2 -2
  282. package/unbundled/en-US.cjs +449 -0
  283. package/unbundled/en-US.js +445 -0
  284. package/unbundled/form-associated.cjs +2 -2
  285. package/unbundled/form-associated.js +2 -2
  286. package/unbundled/listbox.cjs +7 -7
  287. package/unbundled/listbox.js +7 -7
  288. package/unbundled/localized.cjs +2 -2
  289. package/unbundled/localized.js +1 -1
  290. package/unbundled/numberConverter.cjs +1 -1
  291. package/unbundled/numberConverter.js +1 -1
  292. package/unbundled/slider.template.cjs +1 -1
  293. package/unbundled/slider.template.js +1 -1
  294. package/unbundled/slottable-request.cjs +5 -5
  295. package/unbundled/slottable-request.js +5 -5
  296. package/unbundled/vivid-element.cjs +1 -1
  297. package/unbundled/vivid-element.js +1 -1
  298. package/unbundled/with-contextual-help.cjs +4 -1
  299. package/unbundled/with-contextual-help.js +4 -1
  300. package/video-player/index.cjs +1 -1
  301. package/video-player/index.js +1 -1
  302. package/vivid.api.json +60 -18
@@ -65,12 +65,20 @@ var Ee = (e) => i`<template :_ctx="${() => e}">
65
65
  default: {
66
66
  placement: void 0,
67
67
  placementStrategy: h.AutoPlacementHorizontal,
68
+ shiftCrossAxis: !1,
68
69
  strategy: "absolute"
69
70
  },
70
71
  autocomplete: {
71
72
  placement: "bottom-start",
72
73
  placementStrategy: h.Flip,
74
+ shiftCrossAxis: !1,
73
75
  strategy: "fixed"
76
+ },
77
+ imageOptions: {
78
+ placement: "bottom",
79
+ placementStrategy: h.Flip,
80
+ shiftCrossAxis: !0,
81
+ strategy: "absolute"
74
82
  }
75
83
  }, Oe = (e) => {
76
84
  let t = e.tagFor(m);
@@ -78,6 +86,7 @@ var Ee = (e) => i`<template :_ctx="${() => e}">
78
86
  :anchor="${(e) => e.anchorEl}"
79
87
  :placement="${(e) => De[e.kind].placement}"
80
88
  :placementStrategy="${(e) => De[e.kind].placementStrategy}"
89
+ :shiftCrossAxis="${(e) => De[e.kind].shiftCrossAxis}"
81
90
  :open="${(e) => e.open}"
82
91
  :offset="${(e) => e.offset}"
83
92
  :strategy="${(e) => De[e.kind].strategy}"
@@ -5710,729 +5719,205 @@ var Os = "[data-class=ui-select]{min-inline-size:120px;margin-block:-4px}.ui-div
5710
5719
  setValue(e, t) {
5711
5720
  e.dispatchTransaction(e.tr.setMeta(this.plugin, t));
5712
5721
  }
5713
- }, As = ".ProseMirror{box-sizing:border-box;padding:var(--editor-padding-block) var(--editor-padding-inline);outline:none;flex:1 0 0}.ProseMirror-selectednode{--focus-stroke-gap-color:transparent;--focus-border-radius:2px;outline:none;position:relative}.ProseMirror-selectednode:after{box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));border-radius:var(--focus-border-radius,inherit);block-size:calc(100% + var(--focus-block-size-addition,4px));content:\"\";inline-size:calc(100% + var(--focus-block-size-addition,4px));display:block;position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}.editor--disabled .ProseMirror{color:var(--vvd-color-neutral-300);cursor:not-allowed}", js = 200, G = function() {};
5714
- G.prototype.append = function(e) {
5715
- return e.length ? (e = G.from(e), !this.length && e || e.length < js && this.leafAppend(e) || this.length < js && e.leafPrepend(this) || this.appendInner(e)) : this;
5716
- }, G.prototype.prepend = function(e) {
5717
- return e.length ? G.from(e).append(this) : this;
5718
- }, G.prototype.appendInner = function(e) {
5719
- return new Ns(this, e);
5720
- }, G.prototype.slice = function(e, t) {
5721
- return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? G.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
5722
- }, G.prototype.get = function(e) {
5723
- if (!(e < 0 || e >= this.length)) return this.getInner(e);
5724
- }, G.prototype.forEach = function(e, t, n) {
5725
- t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);
5726
- }, G.prototype.map = function(e, t, n) {
5727
- t === void 0 && (t = 0), n === void 0 && (n = this.length);
5728
- var r = [];
5729
- return this.forEach(function(t, n) {
5730
- return r.push(e(t, n));
5731
- }, t, n), r;
5732
- }, G.from = function(e) {
5733
- return e instanceof G ? e : e && e.length ? new Ms(e) : G.empty;
5734
- };
5735
- var Ms = /* @__PURE__ */ function(e) {
5736
- function t(t) {
5737
- e.call(this), this.values = t;
5722
+ }, As = ".ProseMirror{box-sizing:border-box;padding:var(--editor-padding-block) var(--editor-padding-inline);outline:none;flex:1 0 0}.ProseMirror-selectednode{--focus-stroke-gap-color:transparent;--focus-border-radius:2px;outline:none;position:relative}.ProseMirror-selectednode:after{box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));border-radius:var(--focus-border-radius,inherit);block-size:calc(100% + var(--focus-block-size-addition,4px));content:\"\";inline-size:calc(100% + var(--focus-block-size-addition,4px));display:block;position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}.editor--disabled .ProseMirror{color:var(--vvd-color-neutral-300);cursor:not-allowed}", js = class extends w {
5723
+ constructor(...e) {
5724
+ super(...e), this.name = "RteForeignHtmlFeature";
5738
5725
  }
5739
- e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
5740
- var n = {
5741
- length: { configurable: !0 },
5742
- depth: { configurable: !0 }
5743
- };
5744
- return t.prototype.flatten = function() {
5745
- return this.values;
5746
- }, t.prototype.sliceInner = function(e, n) {
5747
- return e == 0 && n == this.length ? this : new t(this.values.slice(e, n));
5748
- }, t.prototype.getInner = function(e) {
5749
- return this.values[e];
5750
- }, t.prototype.forEachInner = function(e, t, n, r) {
5751
- for (var i = t; i < n; i++) if (e(this.values[i], r + i) === !1) return !1;
5752
- }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
5753
- for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
5754
- }, t.prototype.leafAppend = function(e) {
5755
- if (this.length + e.length <= js) return new t(this.values.concat(e.flatten()));
5756
- }, t.prototype.leafPrepend = function(e) {
5757
- if (this.length + e.length <= js) return new t(e.flatten().concat(this.values));
5758
- }, n.length.get = function() {
5759
- return this.values.length;
5760
- }, n.depth.get = function() {
5761
- return 0;
5762
- }, Object.defineProperties(t.prototype, n), t;
5763
- }(G);
5764
- G.empty = new Ms([]);
5765
- var Ns = /* @__PURE__ */ function(e) {
5766
- function t(t, n) {
5767
- e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
5726
+ getPlugins(e) {
5727
+ return [this.contribution(new N({ props: {
5728
+ transformPastedHTML: (t) => e.foreignHtmlParser[b].transform(t),
5729
+ clipboardParser: e.foreignHtmlParser[b].parser,
5730
+ clipboardSerializer: e.foreignHtmlSerializer[b].serializer
5731
+ } }))];
5768
5732
  }
5769
- return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.flatten = function() {
5770
- return this.left.flatten().concat(this.right.flatten());
5771
- }, t.prototype.getInner = function(e) {
5772
- return e < this.left.length ? this.left.get(e) : this.right.get(e - this.left.length);
5773
- }, t.prototype.forEachInner = function(e, t, n, r) {
5774
- var i = this.left.length;
5775
- if (t < i && this.left.forEachInner(e, t, Math.min(n, i), r) === !1 || n > i && this.right.forEachInner(e, Math.max(t - i, 0), Math.min(this.length, n) - i, r + i) === !1) return !1;
5776
- }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
5777
- var i = this.left.length;
5778
- if (t > i && this.right.forEachInvertedInner(e, t - i, Math.max(n, i) - i, r + i) === !1 || n < i && this.left.forEachInvertedInner(e, Math.min(t, i), n, r) === !1) return !1;
5779
- }, t.prototype.sliceInner = function(e, t) {
5780
- if (e == 0 && t == this.length) return this;
5781
- var n = this.left.length;
5782
- return t <= n ? this.left.slice(e, t) : e >= n ? this.right.slice(e - n, t - n) : this.left.slice(e, n).append(this.right.slice(0, t - n));
5783
- }, t.prototype.leafAppend = function(e) {
5784
- var n = this.right.leafAppend(e);
5785
- if (n) return new t(this.left, n);
5786
- }, t.prototype.leafPrepend = function(e) {
5787
- var n = this.left.leafPrepend(e);
5788
- if (n) return new t(n, this.right);
5789
- }, t.prototype.appendInner = function(e) {
5790
- return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
5791
- }, t;
5792
- }(G), Ps = 500, Fs = class e {
5793
- constructor(e, t) {
5794
- this.items = e, this.eventCount = t;
5733
+ }, Ms = (e) => {
5734
+ if (e.parentOffset !== e.parent.content.size) return null;
5735
+ let t = e.nodeBefore;
5736
+ return t && t.isInline && t.isAtom && !t.isText ? {} : null;
5737
+ }, Ns = class extends w {
5738
+ constructor(...e) {
5739
+ super(...e), this.name = "RteCursorFix";
5795
5740
  }
5796
- popEvent(t, n) {
5797
- if (this.eventCount == 0) return null;
5798
- let r = this.items.length;
5799
- for (;; r--) if (this.items.get(r - 1).selection) {
5800
- --r;
5801
- break;
5741
+ getPlugins(e) {
5742
+ let t = [Ms];
5743
+ for (let n of Object.values(e.schema.marks)) {
5744
+ let e = n.spec;
5745
+ e.cursorFix && t.push(e.cursorFix);
5802
5746
  }
5803
- let i, a;
5804
- n && (i = this.remapping(r, this.items.length), a = i.maps.length);
5805
- let o = t.tr, s, c, l = [], u = [];
5806
- return this.items.forEach((t, n) => {
5807
- if (!t.step) {
5808
- i || (i = this.remapping(r, n + 1), a = i.maps.length), a--, u.push(t);
5809
- return;
5747
+ return [this.contribution(new N({ props: { decorations: (e) => {
5748
+ let { $cursor: n } = e.selection;
5749
+ if (!n) return null;
5750
+ let r = null;
5751
+ for (let i of t) {
5752
+ let t = i(n, e);
5753
+ t && Object.assign(r ??= {}, t);
5810
5754
  }
5811
- if (i) {
5812
- u.push(new Ls(t.map));
5813
- let e = t.step.map(i.slice(a)), n;
5814
- e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new Ls(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
5815
- } else o.maybeStep(t.step);
5816
- if (t.selection) return s = i ? t.selection.map(i.slice(a)) : t.selection, c = new e(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
5817
- }, this.items.length, 0), {
5818
- remaining: c,
5819
- transform: o,
5820
- selection: s
5821
- };
5822
- }
5823
- addTransform(t, n, r, i) {
5824
- let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
5825
- for (let e = 0; e < t.steps.length; e++) {
5826
- let r = t.steps[e].invert(t.docs[e]), l = new Ls(t.mapping.maps[e], r, n), u;
5827
- (u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
5828
- }
5829
- let l = o - r.depth;
5830
- return l > zs && (s = Is(s, l), o -= l), new e(s.append(a), o);
5831
- }
5832
- remapping(e, t) {
5833
- let n = new Ve();
5834
- return this.items.forEach((t, r) => {
5835
- let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
5836
- n.appendMap(t.map, i);
5837
- }, e, t), n;
5755
+ return r ? B.create(e.doc, [ja.widget(n.pos, () => {
5756
+ let e = document.createElement("span");
5757
+ e.textContent = "​";
5758
+ for (let [t, n] of Object.entries(r)) e.style.setProperty(t, n);
5759
+ return e;
5760
+ }, { side: -1 })]) : null;
5761
+ } } }))];
5838
5762
  }
5839
- addMaps(t) {
5840
- return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new Ls(e))), this.eventCount);
5763
+ };
5764
+ y(Ns);
5765
+ //#endregion
5766
+ //#region src/lib/rich-text-editor/rte/features/internal/core.ts
5767
+ var Ps = new N({ state: {
5768
+ init() {
5769
+ return null;
5770
+ },
5771
+ apply(e, t) {
5772
+ return e.getMeta(Ps) || t;
5841
5773
  }
5842
- rebased(t, n) {
5843
- if (!this.eventCount) return this;
5844
- let r = [], i = Math.max(0, this.items.length - n), a = t.mapping, o = t.steps.length, s = this.eventCount;
5845
- this.items.forEach((e) => {
5846
- e.selection && s--;
5847
- }, i);
5848
- let c = n;
5849
- this.items.forEach((e) => {
5850
- let n = a.getMirror(--c);
5851
- if (n == null) return;
5852
- o = Math.min(o, n);
5853
- let i = a.maps[n];
5854
- if (e.step) {
5855
- let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
5856
- l && s++, r.push(new Ls(i, o, l));
5857
- } else r.push(new Ls(i));
5858
- }, i);
5859
- let l = [];
5860
- for (let e = n; e < o; e++) l.push(new Ls(a.maps[e]));
5861
- let u = new e(this.items.slice(0, i).append(l).append(r), s);
5862
- return u.emptyItemCount() > Ps && (u = u.compress(this.items.length - r.length)), u;
5774
+ } }), Fs = class extends w {
5775
+ constructor(...e) {
5776
+ super(...e), this.name = "RteCore", this.disabled = new ks(!1), this.scrollThreshold = void 0, this.scrollMargin = void 0;
5863
5777
  }
5864
- emptyItemCount() {
5865
- let e = 0;
5866
- return this.items.forEach((t) => {
5867
- t.step || e++;
5868
- }), e;
5778
+ getStyles() {
5779
+ return [
5780
+ this.contribution(ms),
5781
+ this.contribution(As),
5782
+ this.contribution(Os)
5783
+ ];
5869
5784
  }
5870
- compress(t = this.items.length) {
5871
- let n = this.remapping(0, t), r = n.maps.length, i = [], a = 0;
5872
- return this.items.forEach((e, o) => {
5873
- if (o >= t) i.push(e), e.selection && a++;
5874
- else if (e.step) {
5875
- let t = e.step.map(n.slice(r)), o = t && t.getMap();
5876
- if (r--, o && n.appendMap(o, r), t) {
5877
- let s = e.selection && e.selection.map(n.slice(r));
5878
- s && a++;
5879
- let c = new Ls(o.invert(), t, s), l, u = i.length - 1;
5880
- (l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
5785
+ getPlugins(e) {
5786
+ let t = cs(Uo, Ko, qo, Jo((t, n, r) => n ? {
5787
+ type: Ds(r.node(r.depth - 1).contentMatchAt(r.indexAfter(r.depth - 1))),
5788
+ attrs: e.textblockAttrs.extractFromNode(t)
5789
+ } : {
5790
+ type: t.type,
5791
+ attrs: t.attrs
5792
+ }));
5793
+ return [
5794
+ this.contribution(this.disabled.plugin),
5795
+ this.contribution(new N({
5796
+ props: {
5797
+ editable: () => !this.disabled.getValue(e),
5798
+ handleDOMEvents: { click: (t, n) => this.disabled.getValue(e) ? (n.preventDefault(), !0) : !1 }
5799
+ },
5800
+ view: (t) => {
5801
+ let n = t.dom.getRootNode().querySelector(".popovers"), r = () => {
5802
+ let r = this.disabled.getValue(e);
5803
+ n.classList.toggle("popovers--disabled", r), t.dom.parentElement.classList.toggle("editor--disabled", r);
5804
+ };
5805
+ return r(), { update: () => {
5806
+ r();
5807
+ } };
5881
5808
  }
5882
- } else e.map && r--;
5883
- }, this.items.length, 0), new e(G.from(i.reverse()), a);
5809
+ })),
5810
+ this.contribution(U({
5811
+ ...ps,
5812
+ Enter: t,
5813
+ "Shift-Enter": t
5814
+ })),
5815
+ this.contribution(hs()),
5816
+ this.contribution(xs()),
5817
+ this.contribution(Ps)
5818
+ ];
5819
+ }
5820
+ getFeatures() {
5821
+ return [
5822
+ this,
5823
+ new js(),
5824
+ new Ns()
5825
+ ];
5884
5826
  }
5885
5827
  };
5886
- Fs.empty = new Fs(G.empty, 0);
5887
- function Is(e, t) {
5888
- let n;
5889
- return e.forEach((e, r) => {
5890
- if (e.selection && t-- == 0) return n = r, !1;
5891
- }), e.slice(n);
5828
+ y(Fs);
5829
+ //#endregion
5830
+ //#region ../../node_modules/.pnpm/dompurify@3.4.2/node_modules/dompurify/dist/purify.es.mjs
5831
+ var { entries: Is, setPrototypeOf: Ls, isFrozen: Rs, getPrototypeOf: zs, getOwnPropertyDescriptor: Bs } = Object, { freeze: G, seal: Vs, create: Hs } = Object, { apply: Us, construct: Ws } = typeof Reflect < "u" && Reflect;
5832
+ G ||= function(e) {
5833
+ return e;
5834
+ }, Vs ||= function(e) {
5835
+ return e;
5836
+ }, Us ||= function(e, t) {
5837
+ var n = [...arguments].slice(2);
5838
+ return e.apply(t, n);
5839
+ }, Ws ||= function(e) {
5840
+ return new e(...[...arguments].slice(1));
5841
+ };
5842
+ var Gs = Y(Array.prototype.forEach), Ks = Y(Array.prototype.lastIndexOf), qs = Y(Array.prototype.pop), Js = Y(Array.prototype.push), Ys = Y(Array.prototype.splice), K = Array.isArray, Xs = Y(String.prototype.toLowerCase), Zs = Y(String.prototype.toString), Qs = Y(String.prototype.match), $s = Y(String.prototype.replace), ec = Y(String.prototype.indexOf), tc = Y(String.prototype.trim), nc = Y(Number.prototype.toString), rc = Y(Boolean.prototype.toString), ic = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), ac = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), oc = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), sc = cc(TypeError);
5843
+ function Y(e) {
5844
+ return function(t) {
5845
+ t instanceof RegExp && (t.lastIndex = 0);
5846
+ var n = [...arguments].slice(1);
5847
+ return Us(e, t, n);
5848
+ };
5892
5849
  }
5893
- var Ls = class e {
5894
- constructor(e, t, n, r) {
5895
- this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
5896
- }
5897
- merge(t) {
5898
- if (this.step && t.step && !t.selection) {
5899
- let n = t.step.merge(this.step);
5900
- if (n) return new e(n.getMap().invert(), n, this.selection);
5850
+ function cc(e) {
5851
+ return function() {
5852
+ return Ws(e, [...arguments]);
5853
+ };
5854
+ }
5855
+ function X(e, t) {
5856
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Xs;
5857
+ if (Ls && Ls(e, null), !K(t)) return e;
5858
+ let r = t.length;
5859
+ for (; r--;) {
5860
+ let i = t[r];
5861
+ if (typeof i == "string") {
5862
+ let e = n(i);
5863
+ e !== i && (Rs(t) || (t[r] = e), i = e);
5901
5864
  }
5865
+ e[i] = !0;
5902
5866
  }
5903
- }, Rs = class {
5904
- constructor(e, t, n, r, i) {
5905
- this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
5906
- }
5907
- }, zs = 20;
5908
- function Bs(e, t, n, r) {
5909
- let i = n.getMeta(Ys), a;
5910
- if (i) return i.historyState;
5911
- n.getMeta(Xs) && (e = new Rs(e.done, e.undone, null, 0, -1));
5912
- let o = n.getMeta("appendedTransaction");
5913
- if (n.steps.length == 0) return e;
5914
- if (o && o.getMeta(Ys)) return o.getMeta(Ys).redo ? new Rs(e.done.addTransform(n, void 0, r, qs(t)), e.undone, Hs(n.mapping.maps), e.prevTime, e.prevComposition) : new Rs(e.done, e.undone.addTransform(n, void 0, r, qs(t)), null, e.prevTime, e.prevComposition);
5915
- if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
5916
- let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !Vs(n, e.prevRanges)), s = o ? Us(e.prevRanges, n.mapping) : Hs(n.mapping.maps);
5917
- return new Rs(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, qs(t)), Fs.empty, s, n.time, i ?? e.prevComposition);
5918
- } else if (a = n.getMeta("rebased")) return new Rs(e.done.rebased(n, a), e.undone.rebased(n, a), Us(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
5919
- else return new Rs(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), Us(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
5867
+ return e;
5920
5868
  }
5921
- function Vs(e, t) {
5922
- if (!t) return !1;
5923
- if (!e.docChanged) return !0;
5924
- let n = !1;
5925
- return e.mapping.maps[0].forEach((e, r) => {
5926
- for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
5927
- }), n;
5928
- }
5929
- function Hs(e) {
5930
- let t = [];
5931
- for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
5932
- return t;
5933
- }
5934
- function Us(e, t) {
5935
- if (!e) return null;
5936
- let n = [];
5937
- for (let r = 0; r < e.length; r += 2) {
5938
- let i = t.map(e[r], 1), a = t.map(e[r + 1], -1);
5939
- i <= a && n.push(i, a);
5940
- }
5941
- return n;
5942
- }
5943
- function Ws(e, t, n) {
5944
- let r = qs(t), i = Ys.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
5945
- if (!a) return null;
5946
- let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new Rs(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
5947
- return a.transform.setSelection(o).setMeta(Ys, {
5948
- redo: n,
5949
- historyState: c
5950
- });
5951
- }
5952
- var Gs = !1, Ks = null;
5953
- function qs(e) {
5954
- let t = e.plugins;
5955
- if (Ks != t) {
5956
- Gs = !1, Ks = t;
5957
- for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
5958
- Gs = !0;
5959
- break;
5960
- }
5961
- }
5962
- return Gs;
5963
- }
5964
- function Js(e) {
5965
- return e.setMeta(Xs, !0);
5966
- }
5967
- var Ys = new rn("history"), Xs = new rn("closeHistory");
5968
- function Zs(e = {}) {
5969
- return e = {
5970
- depth: e.depth || 100,
5971
- newGroupDelay: e.newGroupDelay || 500
5972
- }, new N({
5973
- key: Ys,
5974
- state: {
5975
- init() {
5976
- return new Rs(Fs.empty, Fs.empty, null, 0, -1);
5977
- },
5978
- apply(t, n, r) {
5979
- return Bs(n, r, t, e);
5980
- }
5981
- },
5982
- config: e,
5983
- props: { handleDOMEvents: { beforeinput(e, t) {
5984
- let n = t.inputType, r = n == "historyUndo" ? $s : n == "historyRedo" ? ec : null;
5985
- return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
5986
- } } }
5987
- });
5988
- }
5989
- function Qs(e, t) {
5990
- return (n, r) => {
5991
- let i = Ys.getState(n);
5992
- if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
5993
- if (r) {
5994
- let a = Ws(i, n, e);
5995
- a && r(t ? a.scrollIntoView() : a);
5996
- }
5997
- return !0;
5998
- };
5999
- }
6000
- var $s = Qs(!1, !0), ec = Qs(!0, !0), tc = (e) => typeof e == "function", nc = (e, t, n) => [
6001
- e,
6002
- t,
6003
- n
6004
- ], rc = class {
6005
- constructor(e, t, n) {
6006
- this.view = e, this.rte = t, this.props = n, this.bindings = [];
6007
- }
6008
- evalProp(e) {
6009
- return tc(e) ? e(this) : e;
6010
- }
6011
- bindProp(e, t) {
6012
- if (e !== void 0) if (tc(e)) {
6013
- let n = () => t(e(this));
6014
- this.bindings.push(n), n();
6015
- } else t(e);
6016
- }
6017
- updateBindings() {
6018
- for (let e of this.bindings) e();
6019
- }
6020
- shouldReturnFocusToEditor() {
6021
- return this.evalProp(this.props.shouldReturnFocusToEditor);
6022
- }
6023
- bindToEl(e, t = {}, n = [], r = []) {
6024
- for (let n in t) this.bindProp(t[n], (t) => {
6025
- e[n] = t;
6026
- });
6027
- for (let [t, r, i] of n) r && e.addEventListener(t, i(r));
6028
- for (let t of r) e.appendChild(t);
6029
- }
6030
- }, ic = (e, t) => {
6031
- let n = document.createElement("div");
6032
- return e.bindToEl(n, {
6033
- className: t.className,
6034
- slot: t.slot
6035
- }, [], t.children), n;
6036
- }, ac = (e, t) => {
6037
- let n = document.createElement("a");
6038
- return e.bindToEl(n, {
6039
- href: t.href,
6040
- target: t.target,
6041
- rel: t.rel,
6042
- className: t.className
6043
- }, [], t.children), n;
6044
- }, oc = /* @__PURE__ */ new WeakMap(), sc = (e, t) => {
6045
- let n = e.rte.createComponent(te);
6046
- n.setAttribute("exportparts", "vvd-theme-alternate"), e.bindToEl(n, {
6047
- className: "ui-tooltip",
6048
- text: t.label,
6049
- placement: e.props.popupPlacement
6050
- }), e.bindProp(t.enabled, (e) => {
6051
- e || (n.open = !1), n.anchor = e ? t.anchor : void 0;
6052
- });
6053
- let r = ic(e, {
6054
- className: "ui-tooltip-wrapper",
6055
- slot: t.slot,
6056
- children: [t.anchor, n]
6057
- });
6058
- return oc.set(r, t.anchor), r;
6059
- }, K = (e, t) => {
6060
- let n = () => e.evalProp(t.variant) ?? "toolbar", r = () => n() === "toolbar" ? "super-condensed" : "condensed", i = () => n() === "popover-primary" ? "outlined" : "ghost-light", a = () => n() === "toolbar-menu" || n() === "popover" ? "filled" : i(), o = () => e.evalProp(t.active) ? a() : i(), s = () => e.evalProp(t.connotation) ?? (n() === "toolbar-menu" && e.evalProp(t.active) ? "cta" : void 0), c = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), l = e.rte.createComponent(f);
6061
- return e.bindToEl(l, {
6062
- size: r,
6063
- appearance: o,
6064
- disabled: c,
6065
- icon: t.icon,
6066
- autofocus: t.autofocus,
6067
- connotation: s,
6068
- [t.icon ? "ariaLabel" : "label"]: t.label,
6069
- pressed: () => !!e.evalProp(t.active),
6070
- ariaPressed: t.active === void 0 ? void 0 : () => e.evalProp(t.active) ? "true" : "false"
6071
- }, [nc("click", t.onClick, (t) => () => {
6072
- !t() && e.shouldReturnFocusToEditor() && e.view.focus();
6073
- })]), sc(e, {
6074
- enabled: () => !!(e.evalProp(t.icon) && !e.evalProp(t.noTooltip) && !c()),
6075
- label: t.label,
6076
- anchor: l,
6077
- slot: t.slot
6078
- });
6079
- }, cc = (e, t) => {
6080
- let n = e.rte.createComponent(Se);
6081
- e.bindToEl(n, {
6082
- className: "ui-menu",
6083
- autoDismiss: !0,
6084
- ariaLabel: t.label,
6085
- anchor: oc.get(t.trigger) ?? t.trigger,
6086
- placement: e.props.popupPlacement,
6087
- offset: () => e.evalProp(e.props.menuOffset) ?? null
6088
- }, [], t.children);
6089
- let r = document.createDocumentFragment();
6090
- return r.appendChild(t.trigger), r.appendChild(n), r;
6091
- }, lc = (e, t) => {
6092
- let n = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), r = e.rte.createComponent(be);
6093
- return e.bindToEl(r, {
6094
- text: t.text,
6095
- checked: t.checked,
6096
- disabled: n,
6097
- controlType: "radio",
6098
- checkedAppearance: "tick-only"
6099
- }, [nc("change", t.onSelect, (n) => () => {
6100
- r.checked && !r.disabled && e.evalProp(t.checked) !== r.checked && (n(), e.shouldReturnFocusToEditor() && e.view.focus());
6101
- })]), r;
6102
- }, uc = (e, t) => ic(e, {
6103
- slot: t.slot,
6104
- className: "ui-button-group",
6105
- children: t.children
6106
- });
6107
- function dc(e, t) {
6108
- let { from: n, $from: r, to: i, empty: a } = e.selection;
6109
- return a ? !!t.isInSet(e.storedMarks || r.marks()) : e.doc.rangeHasMark(n, i, t);
6110
- }
6111
- var fc = (e, t) => K(e, {
6112
- label: t.label,
6113
- icon: t.icon,
6114
- active: () => dc(e.view.state, t.markType),
6115
- disabled: () => !is(t.markType)(e.view.state),
6116
- onClick: () => {
6117
- is(t.markType)(e.view.state, e.view.dispatch);
6118
- }
6119
- }), pc = (e, t) => {
6120
- let n = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), r = e.rte.createComponent(ie);
6121
- return e.bindToEl(r, {
6122
- value: t.value,
6123
- text: t.text,
6124
- disabled: n
6125
- }), r;
6126
- }, mc = (e, t) => {
6127
- let n = () => !!e.evalProp(e.props.disabled), r = e.rte.createComponent(se);
6128
- r.setAttribute("data-class", "ui-select"), e.bindToEl(r, {
6129
- placeholder: " ",
6130
- ariaLabel: t.label,
6131
- appearance: "ghost",
6132
- disabled: n
6133
- }, [nc("change", t.onSelect, (t) => () => {
6134
- let n = r.value;
6135
- n && (t(n), e.shouldReturnFocusToEditor() && e.view.focus());
6136
- })], t.children), queueMicrotask(() => {
6137
- e.bindProp(t.value, (e) => r.value = e);
6138
- });
6139
- let i = !1;
6140
- return r.addEventListener("vwc-popup:open", () => {
6141
- i = !0, e.updateBindings();
6142
- }), r.addEventListener("vwc-popup:close", () => {
6143
- i = !1, e.updateBindings();
6144
- }), sc(e, {
6145
- enabled: () => !i && !n(),
6146
- label: t.label,
6147
- anchor: r
6148
- });
6149
- }, hc = (e) => {
6150
- let t = e.rte.createComponent(v);
6151
- return e.bindToEl(t, {
6152
- className: "ui-divider",
6153
- orientation: "vertical"
6154
- }), t;
6155
- }, gc = (e, t) => {
6156
- let n = e.rte.createComponent(re);
6157
- return e.bindToEl(n, {
6158
- label: t.label,
6159
- value: t.value,
6160
- placeholder: t.placeholder,
6161
- slot: t.slot,
6162
- autofocus: t.autofocus,
6163
- type: t.type,
6164
- helperText: t.helperText
6165
- }, [nc("input", t.onInput, (e) => () => {
6166
- e(n.value);
6167
- })]), n;
6168
- }, _c = (e, t) => {
6169
- let n = document.createTextNode("");
6170
- return e.bindToEl(n, { textContent: t.text }), n;
6171
- }, vc = (e, t) => {
6172
- let n = document.createElement("slot");
6173
- n.name = t.name;
6174
- let r = null, i = [];
6175
- function a() {
6176
- for (let { el: e, type: t, handler: n } of i) e.removeEventListener(t, n);
6177
- i.length = 0, r = null;
6178
- }
6179
- for (let [n, i] of Object.entries(t.assignedProps)) e.bindProp(i, (e) => {
6180
- r && (r[n] = e);
6181
- });
6182
- function o(n) {
6183
- for (let [r, i] of Object.entries(t.assignedProps)) n[r] = e.evalProp(i);
6184
- for (let [r, a] of Object.entries(t.assignedEvents)) {
6185
- let t = (t) => {
6186
- a(t), e.shouldReturnFocusToEditor() && e.view.focus();
6187
- };
6188
- n.addEventListener(r, t), i.push({
6189
- el: n,
6190
- type: r,
6191
- handler: t
6192
- });
6193
- }
6194
- }
6195
- let s = () => {
6196
- let e = n.assignedElements({ flatten: !0 })[0];
6197
- e !== r && (a(), e && (r = e, o(e)));
6198
- };
6199
- return n.addEventListener("slotchange", s), queueMicrotask(s), n;
6200
- }, yc = class extends w {
6201
- constructor(...e) {
6202
- super(...e), this.name = "RteHistoryFeature";
6203
- }
6204
- getPlugins() {
6205
- return [this.contribution(Zs()), this.contribution(U({
6206
- "Mod-z": $s,
6207
- "Ctrl-y": ec,
6208
- "Cmd-Z": ec
6209
- }))];
6210
- }
6211
- getToolbarItems() {
6212
- return [this.contribution({
6213
- section: "history",
6214
- render: (e) => K(e, {
6215
- label: (e) => e.rte.getLocale().richTextEditor.undo,
6216
- icon: "undo-line",
6217
- disabled: (e) => !$s(e.view.state),
6218
- onClick: () => {
6219
- let { state: t, dispatch: n } = e.view;
6220
- $s(t, n);
6221
- }
6222
- })
6223
- }, 1), this.contribution({
6224
- section: "history",
6225
- render: (e) => K(e, {
6226
- label: (e) => e.rte.getLocale().richTextEditor.redo,
6227
- icon: "redo-line",
6228
- disabled: (e) => !ec(e.view.state),
6229
- onClick: () => {
6230
- let { state: t, dispatch: n } = e.view;
6231
- ec(t, n);
6232
- }
6233
- })
6234
- }, 2)];
6235
- }
6236
- }, bc = class extends w {
6237
- constructor(...e) {
6238
- super(...e), this.name = "RteForeignHtmlFeature";
6239
- }
6240
- getPlugins(e) {
6241
- return [this.contribution(new N({ props: {
6242
- transformPastedHTML: (t) => e.foreignHtmlParser[b].transform(t),
6243
- clipboardParser: e.foreignHtmlParser[b].parser,
6244
- clipboardSerializer: e.foreignHtmlSerializer[b].serializer
6245
- } }))];
6246
- }
6247
- }, xc = (e) => {
6248
- if (e.parentOffset !== e.parent.content.size) return null;
6249
- let t = e.nodeBefore;
6250
- return t && t.isInline && t.isAtom && !t.isText ? {} : null;
6251
- }, Sc = class extends w {
6252
- constructor(...e) {
6253
- super(...e), this.name = "RteCursorFix";
6254
- }
6255
- getPlugins(e) {
6256
- let t = [xc];
6257
- for (let n of Object.values(e.schema.marks)) {
6258
- let e = n.spec;
6259
- e.cursorFix && t.push(e.cursorFix);
6260
- }
6261
- return [this.contribution(new N({ props: { decorations: (e) => {
6262
- let { $cursor: n } = e.selection;
6263
- if (!n) return null;
6264
- let r = null;
6265
- for (let i of t) {
6266
- let t = i(n, e);
6267
- t && Object.assign(r ??= {}, t);
6268
- }
6269
- return r ? B.create(e.doc, [ja.widget(n.pos, () => {
6270
- let e = document.createElement("span");
6271
- e.textContent = "​";
6272
- for (let [t, n] of Object.entries(r)) e.style.setProperty(t, n);
6273
- return e;
6274
- }, { side: -1 })]) : null;
6275
- } } }))];
6276
- }
6277
- };
6278
- y(Sc);
6279
- //#endregion
6280
- //#region src/lib/rich-text-editor/rte/features/internal/core.ts
6281
- var Cc = new N({ state: {
6282
- init() {
6283
- return null;
6284
- },
6285
- apply(e, t) {
6286
- return e.getMeta(Cc) || t;
6287
- }
6288
- } }), wc = class extends w {
6289
- constructor(...e) {
6290
- super(...e), this.name = "RteCore", this.disabled = new ks(!1);
6291
- }
6292
- getStyles() {
6293
- return [
6294
- this.contribution(ms),
6295
- this.contribution(As),
6296
- this.contribution(Os)
6297
- ];
6298
- }
6299
- getPlugins(e) {
6300
- let t = cs(Uo, Ko, qo, Jo((t, n, r) => n ? {
6301
- type: Ds(r.node(r.depth - 1).contentMatchAt(r.indexAfter(r.depth - 1))),
6302
- attrs: e.textblockAttrs.extractFromNode(t)
6303
- } : {
6304
- type: t.type,
6305
- attrs: t.attrs
6306
- }));
6307
- return [
6308
- this.contribution(this.disabled.plugin),
6309
- this.contribution(new N({
6310
- props: {
6311
- editable: () => !this.disabled.getValue(e),
6312
- handleDOMEvents: { click: (t, n) => this.disabled.getValue(e) ? (n.preventDefault(), !0) : !1 }
6313
- },
6314
- view: (t) => {
6315
- let n = t.dom.getRootNode().querySelector(".popovers"), r = () => {
6316
- let r = this.disabled.getValue(e);
6317
- n.classList.toggle("popovers--disabled", r), t.dom.parentElement.classList.toggle("editor--disabled", r);
6318
- };
6319
- return r(), { update: () => {
6320
- r();
6321
- } };
6322
- }
6323
- })),
6324
- this.contribution(U({
6325
- ...ps,
6326
- Enter: t,
6327
- "Shift-Enter": t
6328
- })),
6329
- this.contribution(hs()),
6330
- this.contribution(xs()),
6331
- this.contribution(Cc)
6332
- ];
6333
- }
6334
- getFeatures() {
6335
- return [
6336
- this,
6337
- new yc(),
6338
- new bc(),
6339
- new Sc()
6340
- ];
6341
- }
6342
- };
6343
- y(wc);
6344
- //#endregion
6345
- //#region ../../node_modules/.pnpm/dompurify@3.4.2/node_modules/dompurify/dist/purify.es.mjs
6346
- var { entries: Tc, setPrototypeOf: Ec, isFrozen: Dc, getPrototypeOf: Oc, getOwnPropertyDescriptor: kc } = Object, { freeze: q, seal: Ac, create: jc } = Object, { apply: Mc, construct: Nc } = typeof Reflect < "u" && Reflect;
6347
- q ||= function(e) {
6348
- return e;
6349
- }, Ac ||= function(e) {
6350
- return e;
6351
- }, Mc ||= function(e, t) {
6352
- var n = [...arguments].slice(2);
6353
- return e.apply(t, n);
6354
- }, Nc ||= function(e) {
6355
- return new e(...[...arguments].slice(1));
6356
- };
6357
- var Pc = Z(Array.prototype.forEach), Fc = Z(Array.prototype.lastIndexOf), Ic = Z(Array.prototype.pop), Lc = Z(Array.prototype.push), Rc = Z(Array.prototype.splice), J = Array.isArray, zc = Z(String.prototype.toLowerCase), Bc = Z(String.prototype.toString), Vc = Z(String.prototype.match), Hc = Z(String.prototype.replace), Uc = Z(String.prototype.indexOf), Wc = Z(String.prototype.trim), Gc = Z(Number.prototype.toString), Kc = Z(Boolean.prototype.toString), qc = typeof BigInt > "u" ? null : Z(BigInt.prototype.toString), Jc = typeof Symbol > "u" ? null : Z(Symbol.prototype.toString), Y = Z(Object.prototype.hasOwnProperty), Yc = Z(Object.prototype.toString), X = Z(RegExp.prototype.test), Xc = Zc(TypeError);
6358
- function Z(e) {
6359
- return function(t) {
6360
- t instanceof RegExp && (t.lastIndex = 0);
6361
- var n = [...arguments].slice(1);
6362
- return Mc(e, t, n);
6363
- };
6364
- }
6365
- function Zc(e) {
6366
- return function() {
6367
- return Nc(e, [...arguments]);
6368
- };
6369
- }
6370
- function Q(e, t) {
6371
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : zc;
6372
- if (Ec && Ec(e, null), !J(t)) return e;
6373
- let r = t.length;
6374
- for (; r--;) {
6375
- let i = t[r];
6376
- if (typeof i == "string") {
6377
- let e = n(i);
6378
- e !== i && (Dc(t) || (t[r] = e), i = e);
6379
- }
6380
- e[i] = !0;
6381
- }
6382
- return e;
6383
- }
6384
- function Qc(e) {
6385
- for (let t = 0; t < e.length; t++) Y(e, t) || (e[t] = null);
5869
+ function lc(e) {
5870
+ for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
6386
5871
  return e;
6387
5872
  }
6388
- function $(e) {
6389
- let t = jc(null);
6390
- for (let [n, r] of Tc(e)) Y(e, n) && (J(r) ? t[n] = Qc(r) : r && typeof r == "object" && r.constructor === Object ? t[n] = $(r) : t[n] = r);
5873
+ function Z(e) {
5874
+ let t = Hs(null);
5875
+ for (let [n, r] of Is(e)) q(e, n) && (K(r) ? t[n] = lc(r) : r && typeof r == "object" && r.constructor === Object ? t[n] = Z(r) : t[n] = r);
6391
5876
  return t;
6392
5877
  }
6393
- function $c(e) {
5878
+ function uc(e) {
6394
5879
  switch (typeof e) {
6395
5880
  case "string": return e;
6396
- case "number": return Gc(e);
6397
- case "boolean": return Kc(e);
6398
- case "bigint": return qc ? qc(e) : "0";
6399
- case "symbol": return Jc ? Jc(e) : "Symbol()";
6400
- case "undefined": return Yc(e);
5881
+ case "number": return nc(e);
5882
+ case "boolean": return rc(e);
5883
+ case "bigint": return ic ? ic(e) : "0";
5884
+ case "symbol": return ac ? ac(e) : "Symbol()";
5885
+ case "undefined": return oc(e);
6401
5886
  case "function":
6402
5887
  case "object": {
6403
- if (e === null) return Yc(e);
6404
- let t = e, n = el(t, "toString");
5888
+ if (e === null) return oc(e);
5889
+ let t = e, n = dc(t, "toString");
6405
5890
  if (typeof n == "function") {
6406
5891
  let e = n(t);
6407
- return typeof e == "string" ? e : Yc(e);
5892
+ return typeof e == "string" ? e : oc(e);
6408
5893
  }
6409
- return Yc(e);
5894
+ return oc(e);
6410
5895
  }
6411
- default: return Yc(e);
5896
+ default: return oc(e);
6412
5897
  }
6413
5898
  }
6414
- function el(e, t) {
5899
+ function dc(e, t) {
6415
5900
  for (; e !== null;) {
6416
- let n = kc(e, t);
5901
+ let n = Bs(e, t);
6417
5902
  if (n) {
6418
- if (n.get) return Z(n.get);
6419
- if (typeof n.value == "function") return Z(n.value);
5903
+ if (n.get) return Y(n.get);
5904
+ if (typeof n.value == "function") return Y(n.value);
6420
5905
  }
6421
- e = Oc(e);
5906
+ e = zs(e);
6422
5907
  }
6423
5908
  function n() {
6424
5909
  return null;
6425
5910
  }
6426
5911
  return n;
6427
5912
  }
6428
- function tl(e) {
5913
+ function fc(e) {
6429
5914
  try {
6430
- return X(e, ""), !0;
5915
+ return J(e, ""), !0;
6431
5916
  } catch {
6432
5917
  return !1;
6433
5918
  }
6434
5919
  }
6435
- var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), rl = q(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), il = q([
5920
+ var pc = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), mc = G(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), hc = G([
6436
5921
  "feBlend",
6437
5922
  "feColorMatrix",
6438
5923
  "feComponentTransfer",
@@ -6458,7 +5943,7 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6458
5943
  "feSpotLight",
6459
5944
  "feTile",
6460
5945
  "feTurbulence"
6461
- ]), al = q([
5946
+ ]), gc = G([
6462
5947
  "animate",
6463
5948
  "color-profile",
6464
5949
  "cursor",
@@ -6481,7 +5966,7 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6481
5966
  "solidcolor",
6482
5967
  "unknown",
6483
5968
  "use"
6484
- ]), ol = q(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), sl = q([
5969
+ ]), _c = G(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), vc = G([
6485
5970
  "maction",
6486
5971
  "maligngroup",
6487
5972
  "malignmark",
@@ -6497,33 +5982,33 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6497
5982
  "annotation-xml",
6498
5983
  "mprescripts",
6499
5984
  "none"
6500
- ]), cl = q(["#text"]), ll = q(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), ul = q(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), dl = q(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), fl = q([
5985
+ ]), yc = G(["#text"]), bc = G(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), xc = G(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Sc = G(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Cc = G([
6501
5986
  "xlink:href",
6502
5987
  "xml:id",
6503
5988
  "xlink:title",
6504
5989
  "xml:space",
6505
5990
  "xmlns:xlink"
6506
- ]), pl = Ac(/\{\{[\w\W]*|[\w\W]*\}\}/gm), ml = Ac(/<%[\w\W]*|[\w\W]*%>/gm), hl = Ac(/\$\{[\w\W]*/gm), gl = Ac(/^data-[\-\w.\u00B7-\uFFFF]+$/), _l = Ac(/^aria-[\-\w]+$/), vl = Ac(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), yl = Ac(/^(?:\w+script|data):/i), bl = Ac(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), xl = Ac(/^html$/i), Sl = Ac(/^[a-z][.\w]*(-[.\w]+)+$/i), Cl = /* @__PURE__ */ Object.freeze({
5991
+ ]), wc = Vs(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Tc = Vs(/<%[\w\W]*|[\w\W]*%>/gm), Ec = Vs(/\$\{[\w\W]*/gm), Dc = Vs(/^data-[\-\w.\u00B7-\uFFFF]+$/), Oc = Vs(/^aria-[\-\w]+$/), kc = Vs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Ac = Vs(/^(?:\w+script|data):/i), jc = Vs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Mc = Vs(/^html$/i), Nc = Vs(/^[a-z][.\w]*(-[.\w]+)+$/i), Pc = /* @__PURE__ */ Object.freeze({
6507
5992
  __proto__: null,
6508
- ARIA_ATTR: _l,
6509
- ATTR_WHITESPACE: bl,
6510
- CUSTOM_ELEMENT: Sl,
6511
- DATA_ATTR: gl,
6512
- DOCTYPE_NAME: xl,
6513
- ERB_EXPR: ml,
6514
- IS_ALLOWED_URI: vl,
6515
- IS_SCRIPT_OR_DATA: yl,
6516
- MUSTACHE_EXPR: pl,
6517
- TMPLIT_EXPR: hl
6518
- }), wl = {
5993
+ ARIA_ATTR: Oc,
5994
+ ATTR_WHITESPACE: jc,
5995
+ CUSTOM_ELEMENT: Nc,
5996
+ DATA_ATTR: Dc,
5997
+ DOCTYPE_NAME: Mc,
5998
+ ERB_EXPR: Tc,
5999
+ IS_ALLOWED_URI: kc,
6000
+ IS_SCRIPT_OR_DATA: Ac,
6001
+ MUSTACHE_EXPR: wc,
6002
+ TMPLIT_EXPR: Ec
6003
+ }), Fc = {
6519
6004
  element: 1,
6520
6005
  text: 3,
6521
6006
  progressingInstruction: 7,
6522
6007
  comment: 8,
6523
6008
  document: 9
6524
- }, Tl = function() {
6009
+ }, Ic = function() {
6525
6010
  return typeof window > "u" ? null : window;
6526
- }, El = function(e, t) {
6011
+ }, Lc = function(e, t) {
6527
6012
  if (typeof e != "object" || typeof e.createPolicy != "function") return null;
6528
6013
  let n = null, r = "data-tt-policy-suffix";
6529
6014
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
@@ -6540,7 +6025,7 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6540
6025
  } catch {
6541
6026
  return console.warn("TrustedTypes policy " + i + " could not be created."), null;
6542
6027
  }
6543
- }, Dl = function() {
6028
+ }, Rc = function() {
6544
6029
  return {
6545
6030
  afterSanitizeAttributes: [],
6546
6031
  afterSanitizeElements: [],
@@ -6553,28 +6038,28 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6553
6038
  uponSanitizeShadowNode: []
6554
6039
  };
6555
6040
  };
6556
- function Ol() {
6557
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Tl(), t = (e) => Ol(e);
6558
- if (t.version = "3.4.2", t.removed = [], !e || !e.document || e.document.nodeType !== wl.document || !e.Element) return t.isSupported = !1, t;
6559
- let { document: n } = e, r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: o, Node: s, Element: c, NodeFilter: l, NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: d, DOMParser: f, trustedTypes: p } = e, m = c.prototype, h = el(m, "cloneNode"), g = el(m, "remove"), ee = el(m, "nextSibling"), te = el(m, "childNodes"), ne = el(m, "parentNode");
6041
+ function zc() {
6042
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ic(), t = (e) => zc(e);
6043
+ if (t.version = "3.4.2", t.removed = [], !e || !e.document || e.document.nodeType !== Fc.document || !e.Element) return t.isSupported = !1, t;
6044
+ let { document: n } = e, r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: o, Node: s, Element: c, NodeFilter: l, NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: d, DOMParser: f, trustedTypes: p } = e, m = c.prototype, h = dc(m, "cloneNode"), g = dc(m, "remove"), ee = dc(m, "nextSibling"), te = dc(m, "childNodes"), ne = dc(m, "parentNode");
6560
6045
  if (typeof o == "function") {
6561
6046
  let e = n.createElement("template");
6562
6047
  e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
6563
6048
  }
6564
- let _, re = "", { implementation: ie, createNodeIterator: ae, createDocumentFragment: oe, getElementsByTagName: se } = n, { importNode: ce } = r, v = Dl();
6565
- t.isSupported = typeof Tc == "function" && typeof ne == "function" && ie && ie.createHTMLDocument !== void 0;
6566
- let { MUSTACHE_EXPR: le, ERB_EXPR: y, TMPLIT_EXPR: b, DATA_ATTR: x, ARIA_ATTR: ue, IS_SCRIPT_OR_DATA: de, ATTR_WHITESPACE: fe, CUSTOM_ELEMENT: pe } = Cl, { IS_ALLOWED_URI: me } = Cl, S = null, he = Q({}, [
6567
- ...nl,
6568
- ...rl,
6569
- ...il,
6570
- ...ol,
6571
- ...cl
6572
- ]), C = null, ge = Q({}, [
6573
- ...ll,
6574
- ...ul,
6575
- ...dl,
6576
- ...fl
6577
- ]), w = Object.seal(jc(null, {
6049
+ let _, re = "", { implementation: ie, createNodeIterator: ae, createDocumentFragment: oe, getElementsByTagName: se } = n, { importNode: ce } = r, v = Rc();
6050
+ t.isSupported = typeof Is == "function" && typeof ne == "function" && ie && ie.createHTMLDocument !== void 0;
6051
+ let { MUSTACHE_EXPR: le, ERB_EXPR: y, TMPLIT_EXPR: b, DATA_ATTR: x, ARIA_ATTR: ue, IS_SCRIPT_OR_DATA: de, ATTR_WHITESPACE: fe, CUSTOM_ELEMENT: pe } = Pc, { IS_ALLOWED_URI: me } = Pc, S = null, he = X({}, [
6052
+ ...pc,
6053
+ ...mc,
6054
+ ...hc,
6055
+ ..._c,
6056
+ ...yc
6057
+ ]), C = null, ge = X({}, [
6058
+ ...bc,
6059
+ ...xc,
6060
+ ...Sc,
6061
+ ...Cc
6062
+ ]), w = Object.seal(Hs(null, {
6578
6063
  tagNameCheck: {
6579
6064
  writable: !0,
6580
6065
  configurable: !1,
@@ -6593,7 +6078,7 @@ function Ol() {
6593
6078
  enumerable: !0,
6594
6079
  value: !1
6595
6080
  }
6596
- })), _e = null, ve = null, ye = Object.seal(jc(null, {
6081
+ })), _e = null, ve = null, ye = Object.seal(Hs(null, {
6597
6082
  tagCheck: {
6598
6083
  writable: !0,
6599
6084
  configurable: !1,
@@ -6606,7 +6091,7 @@ function Ol() {
6606
6091
  enumerable: !0,
6607
6092
  value: null
6608
6093
  }
6609
- })), T = !0, be = !0, xe = !1, Se = !0, Ce = !1, we = !0, Te = !1, Ee = !1, De = !1, Oe = !1, E = !1, ke = !1, Ae = !0, je = !1, Me = "user-content-", Ne = !0, Pe = !1, Fe = {}, Ie = null, Le = Q({}, [
6094
+ })), T = !0, be = !0, xe = !1, Se = !0, Ce = !1, we = !0, Te = !1, Ee = !1, De = !1, Oe = !1, E = !1, ke = !1, Ae = !0, je = !1, Me = "user-content-", Ne = !0, Pe = !1, Fe = {}, Ie = null, Le = X({}, [
6610
6095
  "annotation-xml",
6611
6096
  "audio",
6612
6097
  "colgroup",
@@ -6632,14 +6117,14 @@ function Ol() {
6632
6117
  "title",
6633
6118
  "video",
6634
6119
  "xmp"
6635
- ]), Re = null, ze = Q({}, [
6120
+ ]), Re = null, ze = X({}, [
6636
6121
  "audio",
6637
6122
  "video",
6638
6123
  "img",
6639
6124
  "source",
6640
6125
  "image",
6641
6126
  "track"
6642
- ]), Be = null, Ve = Q({}, [
6127
+ ]), Be = null, Ve = X({}, [
6643
6128
  "alt",
6644
6129
  "class",
6645
6130
  "for",
@@ -6654,17 +6139,17 @@ function Ol() {
6654
6139
  "value",
6655
6140
  "style",
6656
6141
  "xmlns"
6657
- ]), He = "http://www.w3.org/1998/Math/MathML", D = "http://www.w3.org/2000/svg", O = "http://www.w3.org/1999/xhtml", Ue = O, We = !1, Ge = null, Ke = Q({}, [
6142
+ ]), He = "http://www.w3.org/1998/Math/MathML", D = "http://www.w3.org/2000/svg", O = "http://www.w3.org/1999/xhtml", Ue = O, We = !1, Ge = null, Ke = X({}, [
6658
6143
  He,
6659
6144
  D,
6660
6145
  O
6661
- ], Bc), qe = Q({}, [
6146
+ ], Zs), qe = X({}, [
6662
6147
  "mi",
6663
6148
  "mo",
6664
6149
  "mn",
6665
6150
  "ms",
6666
6151
  "mtext"
6667
- ]), Je = Q({}, ["annotation-xml"]), Ye = Q({}, [
6152
+ ]), Je = X({}, ["annotation-xml"]), Ye = X({}, [
6668
6153
  "title",
6669
6154
  "style",
6670
6155
  "font",
@@ -6675,38 +6160,38 @@ function Ol() {
6675
6160
  }, tt = function() {
6676
6161
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
6677
6162
  if (Qe && Qe === e) return;
6678
- (!e || typeof e != "object") && (e = {}), e = $(e), Xe = Ze.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, k = Xe === "application/xhtml+xml" ? Bc : zc, S = Y(e, "ALLOWED_TAGS") && J(e.ALLOWED_TAGS) ? Q({}, e.ALLOWED_TAGS, k) : he, C = Y(e, "ALLOWED_ATTR") && J(e.ALLOWED_ATTR) ? Q({}, e.ALLOWED_ATTR, k) : ge, Ge = Y(e, "ALLOWED_NAMESPACES") && J(e.ALLOWED_NAMESPACES) ? Q({}, e.ALLOWED_NAMESPACES, Bc) : Ke, Be = Y(e, "ADD_URI_SAFE_ATTR") && J(e.ADD_URI_SAFE_ATTR) ? Q($(Ve), e.ADD_URI_SAFE_ATTR, k) : Ve, Re = Y(e, "ADD_DATA_URI_TAGS") && J(e.ADD_DATA_URI_TAGS) ? Q($(ze), e.ADD_DATA_URI_TAGS, k) : ze, Ie = Y(e, "FORBID_CONTENTS") && J(e.FORBID_CONTENTS) ? Q({}, e.FORBID_CONTENTS, k) : Le, _e = Y(e, "FORBID_TAGS") && J(e.FORBID_TAGS) ? Q({}, e.FORBID_TAGS, k) : $({}), ve = Y(e, "FORBID_ATTR") && J(e.FORBID_ATTR) ? Q({}, e.FORBID_ATTR, k) : $({}), Fe = Y(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? $(e.USE_PROFILES) : e.USE_PROFILES : !1, T = e.ALLOW_ARIA_ATTR !== !1, be = e.ALLOW_DATA_ATTR !== !1, xe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Se = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ce = e.SAFE_FOR_TEMPLATES || !1, we = e.SAFE_FOR_XML !== !1, Te = e.WHOLE_DOCUMENT || !1, Oe = e.RETURN_DOM || !1, E = e.RETURN_DOM_FRAGMENT || !1, ke = e.RETURN_TRUSTED_TYPE || !1, De = e.FORCE_BODY || !1, Ae = e.SANITIZE_DOM !== !1, je = e.SANITIZE_NAMED_PROPS || !1, Ne = e.KEEP_CONTENT !== !1, Pe = e.IN_PLACE || !1, me = tl(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : vl, Ue = typeof e.NAMESPACE == "string" ? e.NAMESPACE : O, qe = Y(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? $(e.MATHML_TEXT_INTEGRATION_POINTS) : Q({}, [
6163
+ (!e || typeof e != "object") && (e = {}), e = Z(e), Xe = Ze.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, k = Xe === "application/xhtml+xml" ? Zs : Xs, S = q(e, "ALLOWED_TAGS") && K(e.ALLOWED_TAGS) ? X({}, e.ALLOWED_TAGS, k) : he, C = q(e, "ALLOWED_ATTR") && K(e.ALLOWED_ATTR) ? X({}, e.ALLOWED_ATTR, k) : ge, Ge = q(e, "ALLOWED_NAMESPACES") && K(e.ALLOWED_NAMESPACES) ? X({}, e.ALLOWED_NAMESPACES, Zs) : Ke, Be = q(e, "ADD_URI_SAFE_ATTR") && K(e.ADD_URI_SAFE_ATTR) ? X(Z(Ve), e.ADD_URI_SAFE_ATTR, k) : Ve, Re = q(e, "ADD_DATA_URI_TAGS") && K(e.ADD_DATA_URI_TAGS) ? X(Z(ze), e.ADD_DATA_URI_TAGS, k) : ze, Ie = q(e, "FORBID_CONTENTS") && K(e.FORBID_CONTENTS) ? X({}, e.FORBID_CONTENTS, k) : Le, _e = q(e, "FORBID_TAGS") && K(e.FORBID_TAGS) ? X({}, e.FORBID_TAGS, k) : Z({}), ve = q(e, "FORBID_ATTR") && K(e.FORBID_ATTR) ? X({}, e.FORBID_ATTR, k) : Z({}), Fe = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, T = e.ALLOW_ARIA_ATTR !== !1, be = e.ALLOW_DATA_ATTR !== !1, xe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Se = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ce = e.SAFE_FOR_TEMPLATES || !1, we = e.SAFE_FOR_XML !== !1, Te = e.WHOLE_DOCUMENT || !1, Oe = e.RETURN_DOM || !1, E = e.RETURN_DOM_FRAGMENT || !1, ke = e.RETURN_TRUSTED_TYPE || !1, De = e.FORCE_BODY || !1, Ae = e.SANITIZE_DOM !== !1, je = e.SANITIZE_NAMED_PROPS || !1, Ne = e.KEEP_CONTENT !== !1, Pe = e.IN_PLACE || !1, me = fc(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : kc, Ue = typeof e.NAMESPACE == "string" ? e.NAMESPACE : O, qe = q(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Z(e.MATHML_TEXT_INTEGRATION_POINTS) : X({}, [
6679
6164
  "mi",
6680
6165
  "mo",
6681
6166
  "mn",
6682
6167
  "ms",
6683
6168
  "mtext"
6684
- ]), Je = Y(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? $(e.HTML_INTEGRATION_POINTS) : Q({}, ["annotation-xml"]);
6685
- let t = Y(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? $(e.CUSTOM_ELEMENT_HANDLING) : jc(null);
6686
- if (w = jc(null), Y(t, "tagNameCheck") && et(t.tagNameCheck) && (w.tagNameCheck = t.tagNameCheck), Y(t, "attributeNameCheck") && et(t.attributeNameCheck) && (w.attributeNameCheck = t.attributeNameCheck), Y(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), Ce && (be = !1), E && (Oe = !0), Fe && (S = Q({}, cl), C = jc(null), Fe.html === !0 && (Q(S, nl), Q(C, ll)), Fe.svg === !0 && (Q(S, rl), Q(C, ul), Q(C, fl)), Fe.svgFilters === !0 && (Q(S, il), Q(C, ul), Q(C, fl)), Fe.mathMl === !0 && (Q(S, ol), Q(C, dl), Q(C, fl))), ye.tagCheck = null, ye.attributeCheck = null, Y(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ye.tagCheck = e.ADD_TAGS : J(e.ADD_TAGS) && (S === he && (S = $(S)), Q(S, e.ADD_TAGS, k))), Y(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ye.attributeCheck = e.ADD_ATTR : J(e.ADD_ATTR) && (C === ge && (C = $(C)), Q(C, e.ADD_ATTR, k))), Y(e, "ADD_URI_SAFE_ATTR") && J(e.ADD_URI_SAFE_ATTR) && Q(Be, e.ADD_URI_SAFE_ATTR, k), Y(e, "FORBID_CONTENTS") && J(e.FORBID_CONTENTS) && (Ie === Le && (Ie = $(Ie)), Q(Ie, e.FORBID_CONTENTS, k)), Y(e, "ADD_FORBID_CONTENTS") && J(e.ADD_FORBID_CONTENTS) && (Ie === Le && (Ie = $(Ie)), Q(Ie, e.ADD_FORBID_CONTENTS, k)), Ne && (S["#text"] = !0), Te && Q(S, [
6169
+ ]), Je = q(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Z(e.HTML_INTEGRATION_POINTS) : X({}, ["annotation-xml"]);
6170
+ let t = q(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Z(e.CUSTOM_ELEMENT_HANDLING) : Hs(null);
6171
+ if (w = Hs(null), q(t, "tagNameCheck") && et(t.tagNameCheck) && (w.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && et(t.attributeNameCheck) && (w.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), Ce && (be = !1), E && (Oe = !0), Fe && (S = X({}, yc), C = Hs(null), Fe.html === !0 && (X(S, pc), X(C, bc)), Fe.svg === !0 && (X(S, mc), X(C, xc), X(C, Cc)), Fe.svgFilters === !0 && (X(S, hc), X(C, xc), X(C, Cc)), Fe.mathMl === !0 && (X(S, _c), X(C, Sc), X(C, Cc))), ye.tagCheck = null, ye.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ye.tagCheck = e.ADD_TAGS : K(e.ADD_TAGS) && (S === he && (S = Z(S)), X(S, e.ADD_TAGS, k))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ye.attributeCheck = e.ADD_ATTR : K(e.ADD_ATTR) && (C === ge && (C = Z(C)), X(C, e.ADD_ATTR, k))), q(e, "ADD_URI_SAFE_ATTR") && K(e.ADD_URI_SAFE_ATTR) && X(Be, e.ADD_URI_SAFE_ATTR, k), q(e, "FORBID_CONTENTS") && K(e.FORBID_CONTENTS) && (Ie === Le && (Ie = Z(Ie)), X(Ie, e.FORBID_CONTENTS, k)), q(e, "ADD_FORBID_CONTENTS") && K(e.ADD_FORBID_CONTENTS) && (Ie === Le && (Ie = Z(Ie)), X(Ie, e.ADD_FORBID_CONTENTS, k)), Ne && (S["#text"] = !0), Te && X(S, [
6687
6172
  "html",
6688
6173
  "head",
6689
6174
  "body"
6690
- ]), S.table && (Q(S, ["tbody"]), delete _e.tbody), e.TRUSTED_TYPES_POLICY) {
6691
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Xc("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
6692
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Xc("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
6175
+ ]), S.table && (X(S, ["tbody"]), delete _e.tbody), e.TRUSTED_TYPES_POLICY) {
6176
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw sc("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
6177
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw sc("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
6693
6178
  _ = e.TRUSTED_TYPES_POLICY, re = _.createHTML("");
6694
- } else _ === void 0 && (_ = El(p, i)), _ !== null && typeof re == "string" && (re = _.createHTML(""));
6695
- q && q(e), Qe = e;
6696
- }, nt = Q({}, [
6697
- ...rl,
6698
- ...il,
6699
- ...al
6700
- ]), rt = Q({}, [...ol, ...sl]), it = function(e) {
6179
+ } else _ === void 0 && (_ = Lc(p, i)), _ !== null && typeof re == "string" && (re = _.createHTML(""));
6180
+ G && G(e), Qe = e;
6181
+ }, nt = X({}, [
6182
+ ...mc,
6183
+ ...hc,
6184
+ ...gc
6185
+ ]), rt = X({}, [..._c, ...vc]), it = function(e) {
6701
6186
  let t = ne(e);
6702
6187
  (!t || !t.tagName) && (t = {
6703
6188
  namespaceURI: Ue,
6704
6189
  tagName: "template"
6705
6190
  });
6706
- let n = zc(e.tagName), r = zc(t.tagName);
6191
+ let n = Xs(e.tagName), r = Xs(t.tagName);
6707
6192
  return Ge[e.namespaceURI] ? e.namespaceURI === D ? t.namespaceURI === O ? n === "svg" : t.namespaceURI === He ? n === "svg" && (r === "annotation-xml" || qe[r]) : !!nt[n] : e.namespaceURI === He ? t.namespaceURI === O ? n === "math" : t.namespaceURI === D ? n === "math" && Je[r] : !!rt[n] : e.namespaceURI === O ? t.namespaceURI === D && !Je[r] || t.namespaceURI === He && !qe[r] ? !1 : !rt[n] && (Ye[n] || !nt[n]) : !!(Xe === "application/xhtml+xml" && Ge[e.namespaceURI]) : !1;
6708
6193
  }, at = function(e) {
6709
- Lc(t.removed, { element: e });
6194
+ Js(t.removed, { element: e });
6710
6195
  try {
6711
6196
  ne(e).removeChild(e);
6712
6197
  } catch {
@@ -6714,12 +6199,12 @@ function Ol() {
6714
6199
  }
6715
6200
  }, ot = function(e, n) {
6716
6201
  try {
6717
- Lc(t.removed, {
6202
+ Js(t.removed, {
6718
6203
  attribute: n.getAttributeNode(e),
6719
6204
  from: n
6720
6205
  });
6721
6206
  } catch {
6722
- Lc(t.removed, {
6207
+ Js(t.removed, {
6723
6208
  attribute: null,
6724
6209
  from: n
6725
6210
  });
@@ -6734,7 +6219,7 @@ function Ol() {
6734
6219
  let t = null, r = null;
6735
6220
  if (De) e = "<remove></remove>" + e;
6736
6221
  else {
6737
- let t = Vc(e, /^[\r\n\t ]+/);
6222
+ let t = Qs(e, /^[\r\n\t ]+/);
6738
6223
  r = t && t[0];
6739
6224
  }
6740
6225
  Xe === "application/xhtml+xml" && Ue === O && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
@@ -6758,7 +6243,7 @@ function Ol() {
6758
6243
  return typeof s == "function" && e instanceof s;
6759
6244
  };
6760
6245
  function dt(e, n, r) {
6761
- Pc(e, (e) => {
6246
+ Gs(e, (e) => {
6762
6247
  e.call(t, n, r, Qe);
6763
6248
  });
6764
6249
  }
@@ -6769,9 +6254,9 @@ function Ol() {
6769
6254
  if (dt(v.uponSanitizeElement, e, {
6770
6255
  tagName: r,
6771
6256
  allowedTags: S
6772
- }), we && e.hasChildNodes() && !ut(e.firstElementChild) && X(/<[/\w!]/g, e.innerHTML) && X(/<[/\w!]/g, e.textContent) || we && e.namespaceURI === O && r === "style" && ut(e.firstElementChild) || e.nodeType === wl.progressingInstruction || we && e.nodeType === wl.comment && X(/<[/\w]/g, e.data)) return at(e), !0;
6257
+ }), we && e.hasChildNodes() && !ut(e.firstElementChild) && J(/<[/\w!]/g, e.innerHTML) && J(/<[/\w!]/g, e.textContent) || we && e.namespaceURI === O && r === "style" && ut(e.firstElementChild) || e.nodeType === Fc.progressingInstruction || we && e.nodeType === Fc.comment && J(/<[/\w]/g, e.data)) return at(e), !0;
6773
6258
  if (_e[r] || !(ye.tagCheck instanceof Function && ye.tagCheck(r)) && !S[r]) {
6774
- if (!_e[r] && ht(r) && (w.tagNameCheck instanceof RegExp && X(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r))) return !1;
6259
+ if (!_e[r] && ht(r) && (w.tagNameCheck instanceof RegExp && J(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r))) return !1;
6775
6260
  if (Ne && !Ie[r]) {
6776
6261
  let t = ne(e) || e.parentNode, n = te(e) || e.childNodes;
6777
6262
  if (n && t) {
@@ -6784,23 +6269,23 @@ function Ol() {
6784
6269
  }
6785
6270
  return at(e), !0;
6786
6271
  }
6787
- return e instanceof c && !it(e) || (r === "noscript" || r === "noembed" || r === "noframes") && X(/<\/no(script|embed|frames)/i, e.innerHTML) ? (at(e), !0) : (Ce && e.nodeType === wl.text && (n = e.textContent, Pc([
6272
+ return e instanceof c && !it(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(/<\/no(script|embed|frames)/i, e.innerHTML) ? (at(e), !0) : (Ce && e.nodeType === Fc.text && (n = e.textContent, Gs([
6788
6273
  le,
6789
6274
  y,
6790
6275
  b
6791
6276
  ], (e) => {
6792
- n = Hc(n, e, " ");
6793
- }), e.textContent !== n && (Lc(t.removed, { element: e.cloneNode() }), e.textContent = n)), dt(v.afterSanitizeElements, e, null), !1);
6277
+ n = $s(n, e, " ");
6278
+ }), e.textContent !== n && (Js(t.removed, { element: e.cloneNode() }), e.textContent = n)), dt(v.afterSanitizeElements, e, null), !1);
6794
6279
  }, pt = function(e, t, r) {
6795
6280
  if (ve[t] || Ae && (t === "id" || t === "name") && (r in n || r in $e)) return !1;
6796
6281
  let i = C[t] || ye.attributeCheck instanceof Function && ye.attributeCheck(t, e);
6797
- if (!(be && !ve[t] && X(x, t)) && !(T && X(ue, t))) {
6282
+ if (!(be && !ve[t] && J(x, t)) && !(T && J(ue, t))) {
6798
6283
  if (!i || ve[t]) {
6799
- if (!(ht(e) && (w.tagNameCheck instanceof RegExp && X(w.tagNameCheck, e) || w.tagNameCheck instanceof Function && w.tagNameCheck(e)) && (w.attributeNameCheck instanceof RegExp && X(w.attributeNameCheck, t) || w.attributeNameCheck instanceof Function && w.attributeNameCheck(t, e)) || t === "is" && w.allowCustomizedBuiltInElements && (w.tagNameCheck instanceof RegExp && X(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r)))) return !1;
6800
- } else if (!Be[t] && !X(me, Hc(r, fe, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Uc(r, "data:") === 0 && Re[e]) && !(xe && !X(de, Hc(r, fe, ""))) && r) return !1;
6284
+ if (!(ht(e) && (w.tagNameCheck instanceof RegExp && J(w.tagNameCheck, e) || w.tagNameCheck instanceof Function && w.tagNameCheck(e)) && (w.attributeNameCheck instanceof RegExp && J(w.attributeNameCheck, t) || w.attributeNameCheck instanceof Function && w.attributeNameCheck(t, e)) || t === "is" && w.allowCustomizedBuiltInElements && (w.tagNameCheck instanceof RegExp && J(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r)))) return !1;
6285
+ } else if (!Be[t] && !J(me, $s(r, fe, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && ec(r, "data:") === 0 && Re[e]) && !(xe && !J(de, $s(r, fe, ""))) && r) return !1;
6801
6286
  }
6802
6287
  return !0;
6803
- }, mt = Q({}, [
6288
+ }, mt = X({}, [
6804
6289
  "annotation-xml",
6805
6290
  "color-profile",
6806
6291
  "font-face",
@@ -6810,7 +6295,7 @@ function Ol() {
6810
6295
  "font-face-uri",
6811
6296
  "missing-glyph"
6812
6297
  ]), ht = function(e) {
6813
- return !mt[zc(e)] && X(pe, e);
6298
+ return !mt[Xs(e)] && J(pe, e);
6814
6299
  }, gt = function(e) {
6815
6300
  dt(v.beforeSanitizeAttributes, e, null);
6816
6301
  let { attributes: n } = e;
@@ -6823,12 +6308,12 @@ function Ol() {
6823
6308
  forceKeepAttr: void 0
6824
6309
  }, i = n.length;
6825
6310
  for (; i--;) {
6826
- let { name: a, namespaceURI: o, value: s } = n[i], c = k(a), l = s, u = a === "value" ? l : Wc(l);
6827
- if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, dt(v.uponSanitizeAttribute, e, r), u = r.attrValue, je && (c === "id" || c === "name") && Uc(u, Me) !== 0 && (ot(a, e), u = Me + u), we && X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, u)) {
6311
+ let { name: a, namespaceURI: o, value: s } = n[i], c = k(a), l = s, u = a === "value" ? l : tc(l);
6312
+ if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, dt(v.uponSanitizeAttribute, e, r), u = r.attrValue, je && (c === "id" || c === "name") && ec(u, Me) !== 0 && (ot(a, e), u = Me + u), we && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, u)) {
6828
6313
  ot(a, e);
6829
6314
  continue;
6830
6315
  }
6831
- if (c === "attributename" && Vc(u, "href")) {
6316
+ if (c === "attributename" && Qs(u, "href")) {
6832
6317
  ot(a, e);
6833
6318
  continue;
6834
6319
  }
@@ -6837,16 +6322,16 @@ function Ol() {
6837
6322
  ot(a, e);
6838
6323
  continue;
6839
6324
  }
6840
- if (!Se && X(/\/>/i, u)) {
6325
+ if (!Se && J(/\/>/i, u)) {
6841
6326
  ot(a, e);
6842
6327
  continue;
6843
6328
  }
6844
- Ce && Pc([
6329
+ Ce && Gs([
6845
6330
  le,
6846
6331
  y,
6847
6332
  b
6848
6333
  ], (e) => {
6849
- u = Hc(u, e, " ");
6334
+ u = $s(u, e, " ");
6850
6335
  });
6851
6336
  let d = k(e.nodeName);
6852
6337
  if (!pt(d, c, u)) {
@@ -6862,7 +6347,7 @@ function Ol() {
6862
6347
  break;
6863
6348
  }
6864
6349
  if (u !== l) try {
6865
- o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), lt(e) ? at(e) : Ic(t.removed);
6350
+ o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), lt(e) ? at(e) : qs(t.removed);
6866
6351
  } catch {
6867
6352
  ot(a, e);
6868
6353
  }
@@ -6875,15 +6360,15 @@ function Ol() {
6875
6360
  };
6876
6361
  return t.sanitize = function(e) {
6877
6362
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
6878
- if (We = !e, We && (e = "<!-->"), typeof e != "string" && !ut(e) && (e = $c(e), typeof e != "string")) throw Xc("dirty is not a string, aborting");
6363
+ if (We = !e, We && (e = "<!-->"), typeof e != "string" && !ut(e) && (e = uc(e), typeof e != "string")) throw sc("dirty is not a string, aborting");
6879
6364
  if (!t.isSupported) return e;
6880
6365
  if (Ee || tt(n), t.removed = [], typeof e == "string" && (Pe = !1), Pe) {
6881
6366
  let t = e.nodeName;
6882
6367
  if (typeof t == "string") {
6883
6368
  let e = k(t);
6884
- if (!S[e] || _e[e]) throw Xc("root node is forbidden and cannot be sanitized in-place");
6369
+ if (!S[e] || _e[e]) throw sc("root node is forbidden and cannot be sanitized in-place");
6885
6370
  }
6886
- } else if (e instanceof s) i = st("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === wl.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
6371
+ } else if (e instanceof s) i = st("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === Fc.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
6887
6372
  else {
6888
6373
  if (!Oe && !Ce && !Te && e.indexOf("<") === -1) return _ && ke ? _.createHTML(e) : e;
6889
6374
  if (i = st(e), !i) return Oe ? null : ke ? re : "";
@@ -6896,12 +6381,12 @@ function Ol() {
6896
6381
  if (Ce) {
6897
6382
  i.normalize();
6898
6383
  let e = i.innerHTML;
6899
- Pc([
6384
+ Gs([
6900
6385
  le,
6901
6386
  y,
6902
6387
  b
6903
6388
  ], (t) => {
6904
- e = Hc(e, t, " ");
6389
+ e = $s(e, t, " ");
6905
6390
  }), i.innerHTML = e;
6906
6391
  }
6907
6392
  if (E) for (l = oe.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
@@ -6909,12 +6394,12 @@ function Ol() {
6909
6394
  return (C.shadowroot || C.shadowrootmode) && (l = ce.call(r, l, !0)), l;
6910
6395
  }
6911
6396
  let d = Te ? i.outerHTML : i.innerHTML;
6912
- return Te && S["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && X(xl, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), Ce && Pc([
6397
+ return Te && S["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(Mc, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), Ce && Gs([
6913
6398
  le,
6914
6399
  y,
6915
6400
  b
6916
6401
  ], (e) => {
6917
- d = Hc(d, e, " ");
6402
+ d = $s(d, e, " ");
6918
6403
  }), _ && ke ? _.createHTML(d) : d;
6919
6404
  }, t.setConfig = function() {
6920
6405
  tt(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), Ee = !0;
@@ -6923,39 +6408,39 @@ function Ol() {
6923
6408
  }, t.isValidAttribute = function(e, t, n) {
6924
6409
  return Qe || tt({}), pt(k(e), k(t), n);
6925
6410
  }, t.addHook = function(e, t) {
6926
- typeof t == "function" && Lc(v[e], t);
6411
+ typeof t == "function" && Js(v[e], t);
6927
6412
  }, t.removeHook = function(e, t) {
6928
6413
  if (t !== void 0) {
6929
- let n = Fc(v[e], t);
6930
- return n === -1 ? void 0 : Rc(v[e], n, 1)[0];
6414
+ let n = Ks(v[e], t);
6415
+ return n === -1 ? void 0 : Ys(v[e], n, 1)[0];
6931
6416
  }
6932
- return Ic(v[e]);
6417
+ return qs(v[e]);
6933
6418
  }, t.removeHooks = function(e) {
6934
6419
  v[e] = [];
6935
6420
  }, t.removeAllHooks = function() {
6936
- v = Dl();
6421
+ v = Rc();
6937
6422
  }, t;
6938
6423
  }
6939
- var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i, jl = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|blob):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i, Ml = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g, Nl = { ALLOWED_URI_REGEXP: jl }, Pl = (e) => {
6940
- if (!Al.test(e.replace(Ml, ""))) return "";
6424
+ var Bc = zc(), Vc = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i, Hc = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|blob):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i, Uc = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g, Wc = { ALLOWED_URI_REGEXP: Hc }, Gc = (e) => {
6425
+ if (!Vc.test(e.replace(Uc, ""))) return "";
6941
6426
  let t = document.createElement("a");
6942
6427
  /* v8 ignore next -- since href is already validated it's probably always present @preserve */
6943
- return t.setAttribute("href", e), kl.sanitize(t, {
6428
+ return t.setAttribute("href", e), Bc.sanitize(t, {
6944
6429
  RETURN_DOM: !0,
6945
- ...Nl
6430
+ ...Wc
6946
6431
  }).querySelector("a").getAttribute("href") ?? "";
6947
- }, Fl = (e) => {
6432
+ }, Kc = (e) => {
6948
6433
  let t = document.createElement("img");
6949
- return t.setAttribute("src", e), kl.sanitize(t, {
6434
+ return t.setAttribute("src", e), Bc.sanitize(t, {
6950
6435
  RETURN_DOM: !0,
6951
- ...Nl
6436
+ ...Wc
6952
6437
  }).querySelector("img").getAttribute("src") ?? "";
6953
- }, Il = (e) => e.replace(/[;!].*/, ""), Ll = (e) => ({ ...e }), Rl = (e) => ({
6954
- nodes: Object.fromEntries(Object.keys(e.nodes).map((t) => [t, (e.nodes[t].spec.parseDOM ?? []).map(Ll)])),
6955
- marks: Object.fromEntries(Object.keys(e.marks).map((t) => [t, (e.marks[t].spec.parseDOM ?? []).map(Ll)]))
6956
- }), zl = class {
6438
+ }, qc = (e) => e.replace(/[;!].*/, ""), Jc = (e) => ({ ...e }), Yc = (e) => ({
6439
+ nodes: Object.fromEntries(Object.keys(e.nodes).map((t) => [t, (e.nodes[t].spec.parseDOM ?? []).map(Jc)])),
6440
+ marks: Object.fromEntries(Object.keys(e.marks).map((t) => [t, (e.marks[t].spec.parseDOM ?? []).map(Jc)]))
6441
+ }), Xc = class {
6957
6442
  constructor(e, t) {
6958
- this[b] = new Bl(e[b], t);
6443
+ this[b] = new Zc(e[b], t);
6959
6444
  }
6960
6445
  parseDocument(e, t) {
6961
6446
  return this[b].parser.parse(this.parseHtml(e, t), { preserveWhitespace: !0 }).toJSON();
@@ -6964,21 +6449,21 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
6964
6449
  return this[b].parser.parseSlice(this.parseHtml(e, t), { preserveWhitespace: !0 }).content.toJSON() ?? [];
6965
6450
  }
6966
6451
  parseHtml(e, t) {
6967
- let n = kl.sanitize(e, {
6452
+ let n = Bc.sanitize(e, {
6968
6453
  RETURN_DOM: !0,
6969
- ...Nl
6454
+ ...Wc
6970
6455
  }), r = document.createDocumentFragment();
6971
6456
  return r.appendChild(n), t?.modifyDom?.(r), r;
6972
6457
  }
6973
- }, Bl = class {
6458
+ }, Zc = class {
6974
6459
  constructor(e, t) {
6975
- let n = Rl(e.schema);
6976
- t?.modifyParseRules?.(n), this.parser = Vl(e.schema, n);
6460
+ let n = Yc(e.schema);
6461
+ t?.modifyParseRules?.(n), this.parser = Qc(e.schema, n);
6977
6462
  }
6978
6463
  transform(e) {
6979
- return kl.sanitize(e);
6464
+ return Bc.sanitize(e);
6980
6465
  }
6981
- }, Vl = (e, { marks: t, nodes: n }) => {
6466
+ }, Qc = (e, { marks: t, nodes: n }) => {
6982
6467
  let r = [], i = (e) => e.priority ?? 50;
6983
6468
  function a(e) {
6984
6469
  let t = 0;
@@ -6989,18 +6474,18 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
6989
6474
  r.splice(t, 0, e);
6990
6475
  }
6991
6476
  for (let e in t) t[e]?.forEach((t) => {
6992
- a(t = Ll(t)), t.mark || t.ignore || t.clearMark || (t.mark = e);
6477
+ a(t = Jc(t)), t.mark || t.ignore || t.clearMark || (t.mark = e);
6993
6478
  });
6994
6479
  for (let e in n) n[e]?.forEach((t) => {
6995
- a(t = Ll(t)), t.node || t.ignore || t.mark || (t.node = e);
6480
+ a(t = Jc(t)), t.node || t.ignore || t.mark || (t.node = e);
6996
6481
  });
6997
6482
  return r.push({
6998
6483
  tag: "br",
6999
6484
  closeParent: !0
7000
6485
  }), new me(e, r);
7001
- }, Hl = class {
6486
+ }, $c = class {
7002
6487
  constructor(e, t) {
7003
- this[b] = new Ul(e[b], t);
6488
+ this[b] = new el(e[b], t);
7004
6489
  }
7005
6490
  serializeDocument(e, t) {
7006
6491
  return this[b].serializeFragment(e.content, t);
@@ -7008,7 +6493,7 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
7008
6493
  serializeFragment(e, t) {
7009
6494
  return this[b].serializeFragment(e, t);
7010
6495
  }
7011
- }, Ul = class e {
6496
+ }, el = class e {
7012
6497
  constructor(t, n) {
7013
6498
  this.config = t;
7014
6499
  let r = e.domSerializersFromSchema(t.schema);
@@ -7035,211 +6520,741 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
7035
6520
  let a = document.createElement("div");
7036
6521
  return a.appendChild(i), a.innerHTML;
7037
6522
  }
7038
- }, Wl = (e, t) => {
7039
- let n = e.topNodeType.createAndFill(null, t ? x.fromJSON(e, t.content) : null);
7040
- if (!n) throw Error("Document could not be parsed");
7041
- return n.check(), n;
7042
- }, Gl = class {
6523
+ }, tl = (e, t) => {
6524
+ let n = e.topNodeType.createAndFill(null, t ? x.fromJSON(e, t.content) : null);
6525
+ if (!n) throw Error("Document could not be parsed");
6526
+ return n.check(), n;
6527
+ }, nl = class {
6528
+ constructor(e, t) {
6529
+ this.options = t, this.feature = (e, t) => this[b].getPublicInterface(e, t), this[b] = new rl(this, e, t);
6530
+ }
6531
+ getDocument() {
6532
+ return this[b].state.doc.toJSON();
6533
+ }
6534
+ reset(e) {
6535
+ this[b].reset(e);
6536
+ }
6537
+ replaceSelection(e, t) {
6538
+ let { state: n, tr: r, schema: i, dispatchTransaction: a } = this[b];
6539
+ r.replaceSelection(new T(x.fromJSON(i, e), 0, 0)), r.doc.check();
6540
+ let o = r.doc.resolve(r.mapping.map(n.selection.from)), s = r.doc.resolve(r.selection.to), [c, l] = t?.cursorPlacement === "start" ? [o, s] : [s, o];
6541
+ t?.selectContent ? r.setSelection(n.selection instanceof Vt ? new Vt(r.doc) : j.between(l, c)) : r.setSelection(j.between(c, c)), a(r);
6542
+ }
6543
+ replaceDocument(e, t) {
6544
+ let { state: n, tr: r, schema: i, dispatchTransaction: a } = this[b];
6545
+ r.replaceWith(0, n.doc.content.size, tl(i, e)), t?.selectContent ? r.setSelection(new Vt(r.doc)) : t?.cursorPlacement === "end" ? r.setSelection(j.atEnd(r.doc)) : r.setSelection(j.atStart(r.doc)), a(r);
6546
+ }
6547
+ scrollIntoView() {
6548
+ let e = this[b];
6549
+ e.view && e.dispatchTransaction(e.tr.scrollIntoView());
6550
+ }
6551
+ }, rl = class {
6552
+ getFeature(e) {
6553
+ let t = this.config.featureMap.get(e);
6554
+ if (!t) throw Error(`Feature not found: ${e}`);
6555
+ return t;
6556
+ }
6557
+ getPublicInterface(e, t) {
6558
+ let n = this.config.featureFacadesMap.get(e);
6559
+ if (!n || n.length === 0) throw Error("Feature not found");
6560
+ if (n[0].featureId !== void 0) {
6561
+ if (t === void 0) throw Error("No featureId provided for multi-instance feature.");
6562
+ let e = n.find((e) => e.featureId === t);
6563
+ if (!e) throw Error(`Feature with id "${t}" not found`);
6564
+ return e.getPublicInterface(this);
6565
+ }
6566
+ if (t !== void 0) throw Error("Feature does not support featureId");
6567
+ return n[0].getPublicInterface(this);
6568
+ }
6569
+ constructor(e, t, n) {
6570
+ this.options = n, this.view = null, this.dispatchTransaction = (e) => {
6571
+ let t = this.state;
6572
+ return this.state = this.state.apply(e), this.view?.updateState(this.state), t.doc !== this.state.doc && this.options?.onChange?.(), this.state;
6573
+ }, this.facade = e;
6574
+ let r = t[b];
6575
+ this.config = r, this.schema = r.schema, this.textblockAttrs = r.textblockAttrs, this.features = r.features, this.foreignHtmlParser = n?.foreignHtmlParser ?? new Xc(t), this.foreignHtmlSerializer = n?.foreignHtmlSerializer ?? new $c(t), this.styles = new s(_e(r.features.flatMap((e) => e.getStyles()))), this.initState(n?.initialDocument);
6576
+ }
6577
+ initState(e) {
6578
+ this.state = $t.create({
6579
+ doc: tl(this.schema, e),
6580
+ schema: this.config.schema,
6581
+ plugins: _e(this.config.features.flatMap((e) => e.getPlugins(this)))
6582
+ });
6583
+ }
6584
+ reset(e) {
6585
+ let t = Ps.getState(this.state);
6586
+ this.initState(e), this.updateHostState(t), this.view?.updateState(this.state);
6587
+ }
6588
+ createView(e) {
6589
+ let t = this.config.featureMap.get("RteCore");
6590
+ this.view = new po((t) => {
6591
+ t.part = "editor", e.appendChild(t);
6592
+ }, {
6593
+ state: this.state,
6594
+ dispatchTransaction: this.dispatchTransaction,
6595
+ ...t?.scrollThreshold !== void 0 && { scrollThreshold: t.scrollThreshold },
6596
+ ...t?.scrollMargin !== void 0 && { scrollMargin: t.scrollMargin }
6597
+ });
6598
+ }
6599
+ destroyViewIfNeeded() {
6600
+ this.view &&= (this.view.destroy(), null);
6601
+ }
6602
+ createComponent(e) {
6603
+ return document.createElement(this.hostState().ctx.tagFor(e, !0));
6604
+ }
6605
+ getLocale() {
6606
+ return this.hostState().locale;
6607
+ }
6608
+ get tr() {
6609
+ return this.state.tr;
6610
+ }
6611
+ hostState() {
6612
+ let e = Ps.getState(this.state);
6613
+ if (!e) throw Error("No host state available");
6614
+ return e;
6615
+ }
6616
+ updateHostState(e) {
6617
+ this.dispatchTransaction(this.tr.setMeta(Ps, e));
6618
+ }
6619
+ }, il = class {
6620
+ constructor(e) {
6621
+ this.specs = e, this.attrs = {};
6622
+ for (let t of e) this.attrs[t.name] = { default: t.default };
6623
+ }
6624
+ fromDOM(e) {
6625
+ return Object.assign({}, ...this.specs.map((t) => ({ [t.name]: t.fromDOM(e) })));
6626
+ }
6627
+ getStyle(e) {
6628
+ return this.specs.flatMap((t) => t.toStyles(e)).join("; ");
6629
+ }
6630
+ getDOMAttrsProperties(e) {
6631
+ return this.specs.length ? { style: this.getStyle(e) } : {};
6632
+ }
6633
+ getDOMAttrs(e) {
6634
+ return this.specs.length ? [this.getDOMAttrsProperties(e)] : [];
6635
+ }
6636
+ extractFromNode(e) {
6637
+ return Object.assign({}, ...Object.keys(this.attrs).map((t) => ({ [t]: e.attrs[t] })));
6638
+ }
6639
+ }, al = class {
6640
+ constructor(e) {
6641
+ this.specs = e;
6642
+ }
6643
+ getAllowedMarksForNode(e) {
6644
+ return this.specs.filter((t) => !t.onNodeName || t.onNodeName === e).map((e) => e.markName);
6645
+ }
6646
+ getReferencedNodeNames() {
6647
+ return new Set(this.specs.map((e) => e.onNodeName).filter(Boolean));
6648
+ }
6649
+ }, ol = (e, t) => {
6650
+ let n = t.config[b].schema, r = (e) => n.marks[e.type].rank, i = (e, t) => {
6651
+ if (e.type !== t.type) return !1;
6652
+ let n = e.attrs, r = t.attrs;
6653
+ if (n === r) return !0;
6654
+ /* v8 ignore next -- not currently reachable since all attrs are required @preserve */
6655
+ if (!n || !r) return !1;
6656
+ let i = Object.keys(n), a = Object.keys(r);
6657
+ /* v8 ignore next -- not currently reachable since all attrs are required @preserve */
6658
+ if (i.length !== a.length) return !1;
6659
+ for (let e of i) if (n[e] !== r[e]) return !1;
6660
+ return !0;
6661
+ }, a = (e) => {
6662
+ let n = [], o = [], s = [n];
6663
+ for (let n of e) {
6664
+ let e = [...n.marks ?? []].sort((e, t) => r(e) - r(t)), c = 0, l = 0;
6665
+ for (; c < o.length && l < e.length && i(o[c], e[l]);) c++, l++;
6666
+ for (; o.length > c;) o.pop(), s.pop();
6667
+ for (; l < e.length;) {
6668
+ let n = e[l], r = [];
6669
+ s[s.length - 1].push({
6670
+ type: "mark",
6671
+ mark: n,
6672
+ children: {
6673
+ type: "fragment",
6674
+ content: r,
6675
+ [b]: t
6676
+ },
6677
+ [b]: t
6678
+ }), o.push(n), s.push(r), l++;
6679
+ }
6680
+ s[s.length - 1].push({
6681
+ type: "node",
6682
+ node: n,
6683
+ children: a(n.content ?? []),
6684
+ [b]: t
6685
+ });
6686
+ }
6687
+ return {
6688
+ type: "fragment",
6689
+ content: n,
6690
+ [b]: t
6691
+ };
6692
+ };
6693
+ return {
6694
+ type: "node",
6695
+ node: e,
6696
+ children: a(e.content),
6697
+ [b]: t
6698
+ };
6699
+ }, sl = class {
6700
+ constructor(e) {
6701
+ this[b] = new cl(e);
6702
+ }
6703
+ instantiateEditor(e) {
6704
+ return new nl(this, e);
6705
+ }
6706
+ instantiateView(e, t) {
6707
+ return ol(e, {
6708
+ config: this,
6709
+ options: { ...t }
6710
+ });
6711
+ }
6712
+ }, cl = class {
6713
+ constructor(e) {
6714
+ let t = (e) => e.flatMap((e) => e.getFeatures().flatMap((n) => n === e ? e : t([n])));
6715
+ this.features = t(e.map(C)), this.featureMap = /* @__PURE__ */ new Map();
6716
+ for (let e of this.features) {
6717
+ if (this.featureMap.has(e.name)) throw Error(`Duplicate feature: ${e.name}`);
6718
+ this.featureMap.set(e.name, e);
6719
+ }
6720
+ this.featureFacadesMap = /* @__PURE__ */ new Map();
6721
+ for (let t of e) {
6722
+ let e = t.constructor, n = C(t), r = this.featureFacadesMap.get(e);
6723
+ r ? r.push(n) : this.featureFacadesMap.set(e, [n]);
6724
+ }
6725
+ if (!this.featureMap.has("RteBase")) throw Error("RteBase feature is required");
6726
+ if (this.featureMap.has("RteLinkFeature") && !this.featureMap.has("RteToolbarFeature")) throw Error("RteToolbarFeature is required for RteLinkFeature");
6727
+ this.textblockAttrs = new il(_e(this.features.flatMap((e) => e.getTextblockAttrs()))), this.textblockMarks = new al(_e(this.features.flatMap((e) => e.getTextblockMarks())));
6728
+ let n = _e(this.features.flatMap((e) => e.getSchema(this.textblockAttrs, this.textblockMarks))), r = {
6729
+ nodes: {},
6730
+ marks: {}
6731
+ };
6732
+ for (let e of n) Object.assign(r.nodes, e.nodes ?? {}), Object.assign(r.marks, e.marks ?? {});
6733
+ for (let e of this.textblockMarks.getReferencedNodeNames()) if (!(e in r.nodes)) throw Error(`Unknown node "${e}"`);
6734
+ this.schema = new le(r);
6735
+ }
6736
+ }, ll = 200, Q = function() {};
6737
+ Q.prototype.append = function(e) {
6738
+ return e.length ? (e = Q.from(e), !this.length && e || e.length < ll && this.leafAppend(e) || this.length < ll && e.leafPrepend(this) || this.appendInner(e)) : this;
6739
+ }, Q.prototype.prepend = function(e) {
6740
+ return e.length ? Q.from(e).append(this) : this;
6741
+ }, Q.prototype.appendInner = function(e) {
6742
+ return new dl(this, e);
6743
+ }, Q.prototype.slice = function(e, t) {
6744
+ return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? Q.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
6745
+ }, Q.prototype.get = function(e) {
6746
+ if (!(e < 0 || e >= this.length)) return this.getInner(e);
6747
+ }, Q.prototype.forEach = function(e, t, n) {
6748
+ t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);
6749
+ }, Q.prototype.map = function(e, t, n) {
6750
+ t === void 0 && (t = 0), n === void 0 && (n = this.length);
6751
+ var r = [];
6752
+ return this.forEach(function(t, n) {
6753
+ return r.push(e(t, n));
6754
+ }, t, n), r;
6755
+ }, Q.from = function(e) {
6756
+ return e instanceof Q ? e : e && e.length ? new ul(e) : Q.empty;
6757
+ };
6758
+ var ul = /* @__PURE__ */ function(e) {
6759
+ function t(t) {
6760
+ e.call(this), this.values = t;
6761
+ }
6762
+ e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
6763
+ var n = {
6764
+ length: { configurable: !0 },
6765
+ depth: { configurable: !0 }
6766
+ };
6767
+ return t.prototype.flatten = function() {
6768
+ return this.values;
6769
+ }, t.prototype.sliceInner = function(e, n) {
6770
+ return e == 0 && n == this.length ? this : new t(this.values.slice(e, n));
6771
+ }, t.prototype.getInner = function(e) {
6772
+ return this.values[e];
6773
+ }, t.prototype.forEachInner = function(e, t, n, r) {
6774
+ for (var i = t; i < n; i++) if (e(this.values[i], r + i) === !1) return !1;
6775
+ }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
6776
+ for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
6777
+ }, t.prototype.leafAppend = function(e) {
6778
+ if (this.length + e.length <= ll) return new t(this.values.concat(e.flatten()));
6779
+ }, t.prototype.leafPrepend = function(e) {
6780
+ if (this.length + e.length <= ll) return new t(e.flatten().concat(this.values));
6781
+ }, n.length.get = function() {
6782
+ return this.values.length;
6783
+ }, n.depth.get = function() {
6784
+ return 0;
6785
+ }, Object.defineProperties(t.prototype, n), t;
6786
+ }(Q);
6787
+ Q.empty = new ul([]);
6788
+ var dl = /* @__PURE__ */ function(e) {
6789
+ function t(t, n) {
6790
+ e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
6791
+ }
6792
+ return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.flatten = function() {
6793
+ return this.left.flatten().concat(this.right.flatten());
6794
+ }, t.prototype.getInner = function(e) {
6795
+ return e < this.left.length ? this.left.get(e) : this.right.get(e - this.left.length);
6796
+ }, t.prototype.forEachInner = function(e, t, n, r) {
6797
+ var i = this.left.length;
6798
+ if (t < i && this.left.forEachInner(e, t, Math.min(n, i), r) === !1 || n > i && this.right.forEachInner(e, Math.max(t - i, 0), Math.min(this.length, n) - i, r + i) === !1) return !1;
6799
+ }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
6800
+ var i = this.left.length;
6801
+ if (t > i && this.right.forEachInvertedInner(e, t - i, Math.max(n, i) - i, r + i) === !1 || n < i && this.left.forEachInvertedInner(e, Math.min(t, i), n, r) === !1) return !1;
6802
+ }, t.prototype.sliceInner = function(e, t) {
6803
+ if (e == 0 && t == this.length) return this;
6804
+ var n = this.left.length;
6805
+ return t <= n ? this.left.slice(e, t) : e >= n ? this.right.slice(e - n, t - n) : this.left.slice(e, n).append(this.right.slice(0, t - n));
6806
+ }, t.prototype.leafAppend = function(e) {
6807
+ var n = this.right.leafAppend(e);
6808
+ if (n) return new t(this.left, n);
6809
+ }, t.prototype.leafPrepend = function(e) {
6810
+ var n = this.left.leafPrepend(e);
6811
+ if (n) return new t(n, this.right);
6812
+ }, t.prototype.appendInner = function(e) {
6813
+ return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
6814
+ }, t;
6815
+ }(Q), fl = 500, pl = class e {
7043
6816
  constructor(e, t) {
7044
- this.options = t, this.feature = (e, t) => this[b].getPublicInterface(e, t), this[b] = new Kl(this, e, t);
7045
- }
7046
- getDocument() {
7047
- return this[b].state.doc.toJSON();
7048
- }
7049
- reset(e) {
7050
- this[b].reset(e);
7051
- }
7052
- replaceSelection(e, t) {
7053
- let { state: n, tr: r, schema: i, dispatchTransaction: a } = this[b];
7054
- r.replaceSelection(new T(x.fromJSON(i, e), 0, 0)), r.doc.check();
7055
- let o = r.doc.resolve(r.mapping.map(n.selection.from)), s = r.doc.resolve(r.selection.to), [c, l] = t?.cursorPlacement === "start" ? [o, s] : [s, o];
7056
- t?.selectContent ? r.setSelection(n.selection instanceof Vt ? new Vt(r.doc) : j.between(l, c)) : r.setSelection(j.between(c, c)), a(r);
7057
- }
7058
- replaceDocument(e, t) {
7059
- let { state: n, tr: r, schema: i, dispatchTransaction: a } = this[b];
7060
- r.replaceWith(0, n.doc.content.size, Wl(i, e)), t?.selectContent ? r.setSelection(new Vt(r.doc)) : t?.cursorPlacement === "end" ? r.setSelection(j.atEnd(r.doc)) : r.setSelection(j.atStart(r.doc)), a(r);
7061
- }
7062
- }, Kl = class {
7063
- getFeature(e) {
7064
- let t = this.config.featureMap.get(e);
7065
- if (!t) throw Error(`Feature not found: ${e}`);
7066
- return t;
6817
+ this.items = e, this.eventCount = t;
7067
6818
  }
7068
- getPublicInterface(e, t) {
7069
- let n = this.config.featureFacadesMap.get(e);
7070
- if (!n || n.length === 0) throw Error("Feature not found");
7071
- if (n[0].featureId !== void 0) {
7072
- if (t === void 0) throw Error("No featureId provided for multi-instance feature.");
7073
- let e = n.find((e) => e.featureId === t);
7074
- if (!e) throw Error(`Feature with id "${t}" not found`);
7075
- return e.getPublicInterface(this);
6819
+ popEvent(t, n) {
6820
+ if (this.eventCount == 0) return null;
6821
+ let r = this.items.length;
6822
+ for (;; r--) if (this.items.get(r - 1).selection) {
6823
+ --r;
6824
+ break;
7076
6825
  }
7077
- if (t !== void 0) throw Error("Feature does not support featureId");
7078
- return n[0].getPublicInterface(this);
7079
- }
7080
- constructor(e, t, n) {
7081
- this.options = n, this.view = null, this.dispatchTransaction = (e) => {
7082
- let t = this.state;
7083
- return this.state = this.state.apply(e), this.view?.updateState(this.state), t.doc !== this.state.doc && this.options?.onChange?.(), this.state;
7084
- }, this.facade = e;
7085
- let r = t[b];
7086
- this.config = r, this.schema = r.schema, this.textblockAttrs = r.textblockAttrs, this.features = r.features, this.foreignHtmlParser = n?.foreignHtmlParser ?? new zl(t), this.foreignHtmlSerializer = n?.foreignHtmlSerializer ?? new Hl(t), this.styles = new s(_e(r.features.flatMap((e) => e.getStyles()))), this.initState(n?.initialDocument);
6826
+ let i, a;
6827
+ n && (i = this.remapping(r, this.items.length), a = i.maps.length);
6828
+ let o = t.tr, s, c, l = [], u = [];
6829
+ return this.items.forEach((t, n) => {
6830
+ if (!t.step) {
6831
+ i || (i = this.remapping(r, n + 1), a = i.maps.length), a--, u.push(t);
6832
+ return;
6833
+ }
6834
+ if (i) {
6835
+ u.push(new hl(t.map));
6836
+ let e = t.step.map(i.slice(a)), n;
6837
+ e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new hl(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
6838
+ } else o.maybeStep(t.step);
6839
+ if (t.selection) return s = i ? t.selection.map(i.slice(a)) : t.selection, c = new e(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
6840
+ }, this.items.length, 0), {
6841
+ remaining: c,
6842
+ transform: o,
6843
+ selection: s
6844
+ };
7087
6845
  }
7088
- initState(e) {
7089
- this.state = $t.create({
7090
- doc: Wl(this.schema, e),
7091
- schema: this.config.schema,
7092
- plugins: _e(this.config.features.flatMap((e) => e.getPlugins(this)))
7093
- });
6846
+ addTransform(t, n, r, i) {
6847
+ let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
6848
+ for (let e = 0; e < t.steps.length; e++) {
6849
+ let r = t.steps[e].invert(t.docs[e]), l = new hl(t.mapping.maps[e], r, n), u;
6850
+ (u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
6851
+ }
6852
+ let l = o - r.depth;
6853
+ return l > _l && (s = ml(s, l), o -= l), new e(s.append(a), o);
7094
6854
  }
7095
- reset(e) {
7096
- let t = Cc.getState(this.state);
7097
- this.initState(e), this.updateHostState(t), this.view?.updateState(this.state);
6855
+ remapping(e, t) {
6856
+ let n = new Ve();
6857
+ return this.items.forEach((t, r) => {
6858
+ let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
6859
+ n.appendMap(t.map, i);
6860
+ }, e, t), n;
7098
6861
  }
7099
- createView(e) {
7100
- this.view = new po((t) => {
7101
- t.part = "editor", e.appendChild(t);
7102
- }, {
7103
- state: this.state,
7104
- dispatchTransaction: this.dispatchTransaction
7105
- });
6862
+ addMaps(t) {
6863
+ return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new hl(e))), this.eventCount);
7106
6864
  }
7107
- destroyViewIfNeeded() {
7108
- this.view &&= (this.view.destroy(), null);
6865
+ rebased(t, n) {
6866
+ if (!this.eventCount) return this;
6867
+ let r = [], i = Math.max(0, this.items.length - n), a = t.mapping, o = t.steps.length, s = this.eventCount;
6868
+ this.items.forEach((e) => {
6869
+ e.selection && s--;
6870
+ }, i);
6871
+ let c = n;
6872
+ this.items.forEach((e) => {
6873
+ let n = a.getMirror(--c);
6874
+ if (n == null) return;
6875
+ o = Math.min(o, n);
6876
+ let i = a.maps[n];
6877
+ if (e.step) {
6878
+ let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
6879
+ l && s++, r.push(new hl(i, o, l));
6880
+ } else r.push(new hl(i));
6881
+ }, i);
6882
+ let l = [];
6883
+ for (let e = n; e < o; e++) l.push(new hl(a.maps[e]));
6884
+ let u = new e(this.items.slice(0, i).append(l).append(r), s);
6885
+ return u.emptyItemCount() > fl && (u = u.compress(this.items.length - r.length)), u;
7109
6886
  }
7110
- createComponent(e) {
7111
- return document.createElement(this.hostState().ctx.tagFor(e, !0));
6887
+ emptyItemCount() {
6888
+ let e = 0;
6889
+ return this.items.forEach((t) => {
6890
+ t.step || e++;
6891
+ }), e;
7112
6892
  }
7113
- getLocale() {
7114
- return this.hostState().locale;
6893
+ compress(t = this.items.length) {
6894
+ let n = this.remapping(0, t), r = n.maps.length, i = [], a = 0;
6895
+ return this.items.forEach((e, o) => {
6896
+ if (o >= t) i.push(e), e.selection && a++;
6897
+ else if (e.step) {
6898
+ let t = e.step.map(n.slice(r)), o = t && t.getMap();
6899
+ if (r--, o && n.appendMap(o, r), t) {
6900
+ let s = e.selection && e.selection.map(n.slice(r));
6901
+ s && a++;
6902
+ let c = new hl(o.invert(), t, s), l, u = i.length - 1;
6903
+ (l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
6904
+ }
6905
+ } else e.map && r--;
6906
+ }, this.items.length, 0), new e(Q.from(i.reverse()), a);
7115
6907
  }
7116
- get tr() {
7117
- return this.state.tr;
6908
+ };
6909
+ pl.empty = new pl(Q.empty, 0);
6910
+ function ml(e, t) {
6911
+ let n;
6912
+ return e.forEach((e, r) => {
6913
+ if (e.selection && t-- == 0) return n = r, !1;
6914
+ }), e.slice(n);
6915
+ }
6916
+ var hl = class e {
6917
+ constructor(e, t, n, r) {
6918
+ this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
7118
6919
  }
7119
- hostState() {
7120
- let e = Cc.getState(this.state);
7121
- if (!e) throw Error("No host state available");
7122
- return e;
6920
+ merge(t) {
6921
+ if (this.step && t.step && !t.selection) {
6922
+ let n = t.step.merge(this.step);
6923
+ if (n) return new e(n.getMap().invert(), n, this.selection);
6924
+ }
7123
6925
  }
7124
- updateHostState(e) {
7125
- this.dispatchTransaction(this.tr.setMeta(Cc, e));
6926
+ }, gl = class {
6927
+ constructor(e, t, n, r, i) {
6928
+ this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
7126
6929
  }
7127
- }, ql = class {
7128
- constructor(e) {
7129
- this.specs = e, this.attrs = {};
7130
- for (let t of e) this.attrs[t.name] = { default: t.default };
6930
+ }, _l = 20;
6931
+ function vl(e, t, n, r) {
6932
+ let i = n.getMeta(Dl), a;
6933
+ if (i) return i.historyState;
6934
+ n.getMeta(Ol) && (e = new gl(e.done, e.undone, null, 0, -1));
6935
+ let o = n.getMeta("appendedTransaction");
6936
+ if (n.steps.length == 0) return e;
6937
+ if (o && o.getMeta(Dl)) return o.getMeta(Dl).redo ? new gl(e.done.addTransform(n, void 0, r, Tl(t)), e.undone, bl(n.mapping.maps), e.prevTime, e.prevComposition) : new gl(e.done, e.undone.addTransform(n, void 0, r, Tl(t)), null, e.prevTime, e.prevComposition);
6938
+ if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
6939
+ let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !yl(n, e.prevRanges)), s = o ? xl(e.prevRanges, n.mapping) : bl(n.mapping.maps);
6940
+ return new gl(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, Tl(t)), pl.empty, s, n.time, i ?? e.prevComposition);
6941
+ } else if (a = n.getMeta("rebased")) return new gl(e.done.rebased(n, a), e.undone.rebased(n, a), xl(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
6942
+ else return new gl(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), xl(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
6943
+ }
6944
+ function yl(e, t) {
6945
+ if (!t) return !1;
6946
+ if (!e.docChanged) return !0;
6947
+ let n = !1;
6948
+ return e.mapping.maps[0].forEach((e, r) => {
6949
+ for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
6950
+ }), n;
6951
+ }
6952
+ function bl(e) {
6953
+ let t = [];
6954
+ for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
6955
+ return t;
6956
+ }
6957
+ function xl(e, t) {
6958
+ if (!e) return null;
6959
+ let n = [];
6960
+ for (let r = 0; r < e.length; r += 2) {
6961
+ let i = t.map(e[r], 1), a = t.map(e[r + 1], -1);
6962
+ i <= a && n.push(i, a);
7131
6963
  }
7132
- fromDOM(e) {
7133
- return Object.assign({}, ...this.specs.map((t) => ({ [t.name]: t.fromDOM(e) })));
6964
+ return n;
6965
+ }
6966
+ function Sl(e, t, n) {
6967
+ let r = Tl(t), i = Dl.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
6968
+ if (!a) return null;
6969
+ let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new gl(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
6970
+ return a.transform.setSelection(o).setMeta(Dl, {
6971
+ redo: n,
6972
+ historyState: c
6973
+ });
6974
+ }
6975
+ var Cl = !1, wl = null;
6976
+ function Tl(e) {
6977
+ let t = e.plugins;
6978
+ if (wl != t) {
6979
+ Cl = !1, wl = t;
6980
+ for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
6981
+ Cl = !0;
6982
+ break;
6983
+ }
7134
6984
  }
7135
- getStyle(e) {
7136
- return this.specs.flatMap((t) => t.toStyles(e)).join("; ");
6985
+ return Cl;
6986
+ }
6987
+ function El(e) {
6988
+ return e.setMeta(Ol, !0);
6989
+ }
6990
+ var Dl = new rn("history"), Ol = new rn("closeHistory");
6991
+ function kl(e = {}) {
6992
+ return e = {
6993
+ depth: e.depth || 100,
6994
+ newGroupDelay: e.newGroupDelay || 500
6995
+ }, new N({
6996
+ key: Dl,
6997
+ state: {
6998
+ init() {
6999
+ return new gl(pl.empty, pl.empty, null, 0, -1);
7000
+ },
7001
+ apply(t, n, r) {
7002
+ return vl(n, r, t, e);
7003
+ }
7004
+ },
7005
+ config: e,
7006
+ props: { handleDOMEvents: { beforeinput(e, t) {
7007
+ let n = t.inputType, r = n == "historyUndo" ? jl : n == "historyRedo" ? Ml : null;
7008
+ return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
7009
+ } } }
7010
+ });
7011
+ }
7012
+ function Al(e, t) {
7013
+ return (n, r) => {
7014
+ let i = Dl.getState(n);
7015
+ if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
7016
+ if (r) {
7017
+ let a = Sl(i, n, e);
7018
+ a && r(t ? a.scrollIntoView() : a);
7019
+ }
7020
+ return !0;
7021
+ };
7022
+ }
7023
+ var jl = Al(!1, !0), Ml = Al(!0, !0), Nl = (e) => typeof e == "function", Pl = (e, t, n) => [
7024
+ e,
7025
+ t,
7026
+ n
7027
+ ], Fl = class {
7028
+ constructor(e, t, n) {
7029
+ this.view = e, this.rte = t, this.props = n, this.bindings = [];
7137
7030
  }
7138
- getDOMAttrsProperties(e) {
7139
- return this.specs.length ? { style: this.getStyle(e) } : {};
7031
+ evalProp(e) {
7032
+ return Nl(e) ? e(this) : e;
7140
7033
  }
7141
- getDOMAttrs(e) {
7142
- return this.specs.length ? [this.getDOMAttrsProperties(e)] : [];
7034
+ bindProp(e, t) {
7035
+ if (e !== void 0) if (Nl(e)) {
7036
+ let n = () => t(e(this));
7037
+ this.bindings.push(n), n();
7038
+ } else t(e);
7143
7039
  }
7144
- extractFromNode(e) {
7145
- return Object.assign({}, ...Object.keys(this.attrs).map((t) => ({ [t]: e.attrs[t] })));
7040
+ updateBindings() {
7041
+ for (let e of this.bindings) e();
7146
7042
  }
7147
- }, Jl = class {
7148
- constructor(e) {
7149
- this.specs = e;
7043
+ shouldReturnFocusToEditor() {
7044
+ return this.evalProp(this.props.shouldReturnFocusToEditor);
7150
7045
  }
7151
- getAllowedMarksForNode(e) {
7152
- return this.specs.filter((t) => !t.onNodeName || t.onNodeName === e).map((e) => e.markName);
7046
+ bindToEl(e, t = {}, n = [], r = []) {
7047
+ for (let n in t) this.bindProp(t[n], (t) => {
7048
+ e[n] = t;
7049
+ });
7050
+ for (let [t, r, i] of n) r && e.addEventListener(t, i(r));
7051
+ for (let t of r) e.appendChild(t);
7153
7052
  }
7154
- getReferencedNodeNames() {
7155
- return new Set(this.specs.map((e) => e.onNodeName).filter(Boolean));
7053
+ }, Il = (e, t) => {
7054
+ let n = document.createElement("div");
7055
+ return e.bindToEl(n, {
7056
+ className: t.className,
7057
+ slot: t.slot
7058
+ }, [], t.children), n;
7059
+ }, Ll = (e, t) => {
7060
+ let n = document.createElement("a");
7061
+ return e.bindToEl(n, {
7062
+ href: t.href,
7063
+ target: t.target,
7064
+ rel: t.rel,
7065
+ className: t.className
7066
+ }, [], t.children), n;
7067
+ }, Rl = /* @__PURE__ */ new WeakMap(), zl = (e, t) => {
7068
+ let n = e.rte.createComponent(te);
7069
+ n.setAttribute("exportparts", "vvd-theme-alternate"), e.bindToEl(n, {
7070
+ className: "ui-tooltip",
7071
+ text: t.label,
7072
+ placement: e.props.popupPlacement
7073
+ }), e.bindProp(t.enabled, (e) => {
7074
+ e || (n.open = !1), n.anchor = e ? t.anchor : void 0;
7075
+ });
7076
+ let r = Il(e, {
7077
+ className: "ui-tooltip-wrapper",
7078
+ slot: t.slot,
7079
+ children: [t.anchor, n]
7080
+ });
7081
+ return Rl.set(r, t.anchor), r;
7082
+ }, $ = (e, t) => {
7083
+ let n = () => e.evalProp(t.variant) ?? "toolbar", r = () => n() === "toolbar" ? "super-condensed" : "condensed", i = () => n() === "popover-primary" ? "outlined" : "ghost-light", a = () => n() === "toolbar-menu" || n() === "popover" ? "filled" : i(), o = () => e.evalProp(t.active) ? a() : i(), s = () => e.evalProp(t.connotation) ?? (n() === "toolbar-menu" && e.evalProp(t.active) ? "cta" : void 0), c = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), l = e.rte.createComponent(f);
7084
+ return e.bindToEl(l, {
7085
+ size: r,
7086
+ appearance: o,
7087
+ disabled: c,
7088
+ icon: t.icon,
7089
+ autofocus: t.autofocus,
7090
+ connotation: s,
7091
+ [t.icon ? "ariaLabel" : "label"]: t.label,
7092
+ pressed: () => !!e.evalProp(t.active),
7093
+ ariaPressed: t.active === void 0 ? void 0 : () => e.evalProp(t.active) ? "true" : "false"
7094
+ }, [Pl("click", t.onClick, (t) => () => {
7095
+ !t() && e.shouldReturnFocusToEditor() && e.view.focus();
7096
+ })]), zl(e, {
7097
+ enabled: () => !!(e.evalProp(t.icon) && !e.evalProp(t.noTooltip) && !c()),
7098
+ label: t.label,
7099
+ anchor: l,
7100
+ slot: t.slot
7101
+ });
7102
+ }, Bl = (e, t) => {
7103
+ let n = e.rte.createComponent(Se);
7104
+ e.bindToEl(n, {
7105
+ className: "ui-menu",
7106
+ autoDismiss: !0,
7107
+ ariaLabel: t.label,
7108
+ anchor: Rl.get(t.trigger) ?? t.trigger,
7109
+ placement: e.props.popupPlacement,
7110
+ offset: () => e.evalProp(e.props.menuOffset) ?? null
7111
+ }, [], t.children);
7112
+ let r = document.createDocumentFragment();
7113
+ return r.appendChild(t.trigger), r.appendChild(n), r;
7114
+ }, Vl = (e, t) => {
7115
+ let n = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), r = e.rte.createComponent(be);
7116
+ return e.bindToEl(r, {
7117
+ text: t.text,
7118
+ checked: t.checked,
7119
+ disabled: n,
7120
+ controlType: "radio",
7121
+ checkedAppearance: "tick-only"
7122
+ }, [Pl("change", t.onSelect, (n) => () => {
7123
+ r.checked && !r.disabled && e.evalProp(t.checked) !== r.checked && (n(), e.shouldReturnFocusToEditor() && e.view.focus());
7124
+ })]), r;
7125
+ }, Hl = (e, t) => Il(e, {
7126
+ slot: t.slot,
7127
+ className: "ui-button-group",
7128
+ children: t.children
7129
+ });
7130
+ function Ul(e, t) {
7131
+ let { from: n, $from: r, to: i, empty: a } = e.selection;
7132
+ return a ? !!t.isInSet(e.storedMarks || r.marks()) : e.doc.rangeHasMark(n, i, t);
7133
+ }
7134
+ var Wl = (e, t) => $(e, {
7135
+ label: t.label,
7136
+ icon: t.icon,
7137
+ active: () => Ul(e.view.state, t.markType),
7138
+ disabled: () => !is(t.markType)(e.view.state),
7139
+ onClick: () => {
7140
+ is(t.markType)(e.view.state, e.view.dispatch);
7156
7141
  }
7142
+ }), Gl = (e, t) => {
7143
+ let n = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), r = e.rte.createComponent(ie);
7144
+ return e.bindToEl(r, {
7145
+ value: t.value,
7146
+ text: t.text,
7147
+ disabled: n
7148
+ }), r;
7149
+ }, Kl = (e, t) => {
7150
+ let n = () => !!e.evalProp(e.props.disabled), r = e.rte.createComponent(se);
7151
+ r.setAttribute("data-class", "ui-select"), e.bindToEl(r, {
7152
+ placeholder: " ",
7153
+ ariaLabel: t.label,
7154
+ appearance: "ghost",
7155
+ disabled: n
7156
+ }, [Pl("change", t.onSelect, (t) => () => {
7157
+ let n = r.value;
7158
+ n && (t(n), e.shouldReturnFocusToEditor() && e.view.focus());
7159
+ })], t.children), queueMicrotask(() => {
7160
+ e.bindProp(t.value, (e) => r.value = e);
7161
+ });
7162
+ let i = !1;
7163
+ return r.addEventListener("vwc-popup:open", () => {
7164
+ i = !0, e.updateBindings();
7165
+ }), r.addEventListener("vwc-popup:close", () => {
7166
+ i = !1, e.updateBindings();
7167
+ }), zl(e, {
7168
+ enabled: () => !i && !n(),
7169
+ label: t.label,
7170
+ anchor: r
7171
+ });
7172
+ }, ql = (e) => {
7173
+ let t = e.rte.createComponent(v);
7174
+ return e.bindToEl(t, {
7175
+ className: "ui-divider",
7176
+ orientation: "vertical"
7177
+ }), t;
7178
+ }, Jl = (e, t) => {
7179
+ let n = e.rte.createComponent(re);
7180
+ return e.bindToEl(n, {
7181
+ label: t.label,
7182
+ value: t.value,
7183
+ placeholder: t.placeholder,
7184
+ slot: t.slot,
7185
+ autofocus: t.autofocus,
7186
+ type: t.type,
7187
+ helperText: t.helperText
7188
+ }, [Pl("input", t.onInput, (e) => () => {
7189
+ e(n.value);
7190
+ })]), n;
7157
7191
  }, Yl = (e, t) => {
7158
- let n = t.config[b].schema, r = (e) => n.marks[e.type].rank, i = (e, t) => {
7159
- if (e.type !== t.type) return !1;
7160
- let n = e.attrs, r = t.attrs;
7161
- if (n === r) return !0;
7162
- /* v8 ignore next -- not currently reachable since all attrs are required @preserve */
7163
- if (!n || !r) return !1;
7164
- let i = Object.keys(n), a = Object.keys(r);
7165
- /* v8 ignore next -- not currently reachable since all attrs are required @preserve */
7166
- if (i.length !== a.length) return !1;
7167
- for (let e of i) if (n[e] !== r[e]) return !1;
7168
- return !0;
7169
- }, a = (e) => {
7170
- let n = [], o = [], s = [n];
7171
- for (let n of e) {
7172
- let e = [...n.marks ?? []].sort((e, t) => r(e) - r(t)), c = 0, l = 0;
7173
- for (; c < o.length && l < e.length && i(o[c], e[l]);) c++, l++;
7174
- for (; o.length > c;) o.pop(), s.pop();
7175
- for (; l < e.length;) {
7176
- let n = e[l], r = [];
7177
- s[s.length - 1].push({
7178
- type: "mark",
7179
- mark: n,
7180
- children: {
7181
- type: "fragment",
7182
- content: r,
7183
- [b]: t
7184
- },
7185
- [b]: t
7186
- }), o.push(n), s.push(r), l++;
7187
- }
7188
- s[s.length - 1].push({
7189
- type: "node",
7190
- node: n,
7191
- children: a(n.content ?? []),
7192
- [b]: t
7192
+ let n = document.createTextNode("");
7193
+ return e.bindToEl(n, { textContent: t.text }), n;
7194
+ }, Xl = (e, t) => {
7195
+ let n = document.createElement("slot");
7196
+ n.name = t.name;
7197
+ let r = null, i = [];
7198
+ function a() {
7199
+ for (let { el: e, type: t, handler: n } of i) e.removeEventListener(t, n);
7200
+ i.length = 0, r = null;
7201
+ }
7202
+ for (let [n, i] of Object.entries(t.assignedProps)) e.bindProp(i, (e) => {
7203
+ r && (r[n] = e);
7204
+ });
7205
+ function o(n) {
7206
+ for (let [r, i] of Object.entries(t.assignedProps)) n[r] = e.evalProp(i);
7207
+ for (let [r, a] of Object.entries(t.assignedEvents)) {
7208
+ let t = (t) => {
7209
+ a(t), e.shouldReturnFocusToEditor() && e.view.focus();
7210
+ };
7211
+ n.addEventListener(r, t), i.push({
7212
+ el: n,
7213
+ type: r,
7214
+ handler: t
7193
7215
  });
7194
7216
  }
7195
- return {
7196
- type: "fragment",
7197
- content: n,
7198
- [b]: t
7199
- };
7200
- };
7201
- return {
7202
- type: "node",
7203
- node: e,
7204
- children: a(e.content),
7205
- [b]: t
7217
+ }
7218
+ let s = () => {
7219
+ let e = n.assignedElements({ flatten: !0 })[0];
7220
+ e !== r && (a(), e && (r = e, o(e)));
7206
7221
  };
7207
- }, Xl = class {
7222
+ return n.addEventListener("slotchange", s), queueMicrotask(s), n;
7223
+ }, Zl = class extends w {
7208
7224
  constructor(e) {
7209
- this[b] = new Zl(e);
7210
- }
7211
- instantiateEditor(e) {
7212
- return new Gl(this, e);
7225
+ super(), this.config = e, this.name = "RteHistoryFeature";
7213
7226
  }
7214
- instantiateView(e, t) {
7215
- return Yl(e, {
7216
- config: this,
7217
- options: { ...t }
7218
- });
7227
+ getPlugins() {
7228
+ return [this.contribution(kl()), this.contribution(U({
7229
+ "Mod-z": jl,
7230
+ "Ctrl-y": Ml,
7231
+ "Cmd-Z": Ml
7232
+ }))];
7219
7233
  }
7220
- }, Zl = class {
7221
- constructor(e) {
7222
- let t = (e) => e.flatMap((e) => e.getFeatures().flatMap((n) => n === e ? e : t([n])));
7223
- this.features = t(e.map(C)), this.featureMap = /* @__PURE__ */ new Map();
7224
- for (let e of this.features) {
7225
- if (this.featureMap.has(e.name)) throw Error(`Duplicate feature: ${e.name}`);
7226
- this.featureMap.set(e.name, e);
7227
- }
7228
- this.featureFacadesMap = /* @__PURE__ */ new Map();
7229
- for (let t of e) {
7230
- let e = t.constructor, n = C(t), r = this.featureFacadesMap.get(e);
7231
- r ? r.push(n) : this.featureFacadesMap.set(e, [n]);
7232
- }
7233
- if (!this.featureMap.has("RteBase")) throw Error("RteBase feature is required");
7234
- if (this.featureMap.has("RteLinkFeature") && !this.featureMap.has("RteToolbarFeature")) throw Error("RteToolbarFeature is required for RteLinkFeature");
7235
- this.textblockAttrs = new ql(_e(this.features.flatMap((e) => e.getTextblockAttrs()))), this.textblockMarks = new Jl(_e(this.features.flatMap((e) => e.getTextblockMarks())));
7236
- let n = _e(this.features.flatMap((e) => e.getSchema(this.textblockAttrs, this.textblockMarks))), r = {
7237
- nodes: {},
7238
- marks: {}
7239
- };
7240
- for (let e of n) Object.assign(r.nodes, e.nodes ?? {}), Object.assign(r.marks, e.marks ?? {});
7241
- for (let e of this.textblockMarks.getReferencedNodeNames()) if (!(e in r.nodes)) throw Error(`Unknown node "${e}"`);
7242
- this.schema = new le(r);
7234
+ getToolbarItems() {
7235
+ return this.config.showToolbarButtons ? [this.contribution({
7236
+ section: "history",
7237
+ render: (e) => $(e, {
7238
+ label: (e) => e.rte.getLocale().richTextEditor.undo,
7239
+ icon: "undo-line",
7240
+ disabled: (e) => !jl(e.view.state),
7241
+ onClick: () => {
7242
+ let { state: t, dispatch: n } = e.view;
7243
+ jl(t, n);
7244
+ }
7245
+ })
7246
+ }, 1), this.contribution({
7247
+ section: "history",
7248
+ render: (e) => $(e, {
7249
+ label: (e) => e.rte.getLocale().richTextEditor.redo,
7250
+ icon: "redo-line",
7251
+ disabled: (e) => !Ml(e.view.state),
7252
+ onClick: () => {
7253
+ let { state: t, dispatch: n } = e.view;
7254
+ Ml(t, n);
7255
+ }
7256
+ })
7257
+ }, 2)] : [];
7243
7258
  }
7244
7259
  }, Ql = "h1,h2,h3,p{all:unset;display:block}h1:first-child,h2:first-child,h3:first-child,p:first-child{margin-block-start:0}h1:last-child,h2:last-child,h3:last-child,p:last-child{margin-block-end:0}p{font:var(--vvd-typography-base);font-variant-ligatures:unset;font-feature-settings:unset;margin-block:16px;line-height:20px}.heading-step-1{font:var(--vvd-typography-heading-4);font-variant-ligatures:unset;font-feature-settings:unset;margin-block:24px 12px;line-height:28px}.heading-step-2{font:var(--vvd-typography-heading-3);font-variant-ligatures:unset;font-feature-settings:unset;margin-block:24px 12px;line-height:36px}.heading-step-3{font:var(--vvd-typography-heading-2);font-variant-ligatures:unset;font-feature-settings:unset;margin-block:32px 16px;line-height:42px}", $l = class extends w {
7245
7260
  constructor(e) {
@@ -7472,7 +7487,8 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7472
7487
  getFeatures() {
7473
7488
  return [
7474
7489
  this,
7475
- new wc(),
7490
+ new Fs(),
7491
+ new Zl({ showToolbarButtons: this.config?.historyToolbarButtons ?? !0 }),
7476
7492
  new $l({
7477
7493
  heading1: this.config?.heading1 ?? !1,
7478
7494
  heading2: this.config?.heading2 ?? !1,
@@ -7490,6 +7506,18 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7490
7506
  },
7491
7507
  set disabled(n) {
7492
7508
  t.disabled.setValue(e, n);
7509
+ },
7510
+ get scrollThreshold() {
7511
+ return t.scrollThreshold;
7512
+ },
7513
+ set scrollThreshold(n) {
7514
+ t.scrollThreshold = n, e.view?.setProps({ scrollThreshold: n });
7515
+ },
7516
+ get scrollMargin() {
7517
+ return t.scrollMargin;
7518
+ },
7519
+ set scrollMargin(n) {
7520
+ t.scrollMargin = n, e.view?.setProps({ scrollMargin: n });
7493
7521
  }
7494
7522
  };
7495
7523
  }
@@ -7501,14 +7529,14 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7501
7529
  let t = e.getFeature("RteBasicTextBlocks");
7502
7530
  return [this.contribution({
7503
7531
  section: "font",
7504
- render: (n) => mc(n, {
7532
+ render: (n) => Kl(n, {
7505
7533
  label: () => n.rte.getLocale().richTextEditor.paragraphStyles,
7506
7534
  value: (e) => t.getCurrentBlockType(e.view.state) ?? "",
7507
7535
  onSelect: (r) => {
7508
7536
  let { state: i, dispatch: a } = n.view;
7509
7537
  t.setBlockType(e, r)(i, a);
7510
7538
  },
7511
- children: this.config.options.map((r) => pc(n, {
7539
+ children: this.config.options.map((r) => Gl(n, {
7512
7540
  text: r.label,
7513
7541
  value: r.node,
7514
7542
  disabled: () => !t.setBlockType(e, r.node)(n.view.state)
@@ -7534,7 +7562,7 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7534
7562
  for (let t of _e(e.features.flatMap((t) => t.getToolbarItems(e)))) n.get(t.section).push(t);
7535
7563
  let r = e.getFeature("RteCore");
7536
7564
  return [this.contribution(this.hidden.plugin), this.contribution(new N({ view: (i) => {
7537
- let a = !1, o = new rc(i, e, {
7565
+ let a = !1, o = new Fl(i, e, {
7538
7566
  popupPlacement: this.config?.popupDirection === "outward" ? "bottom" : "top",
7539
7567
  menuOffset: 8,
7540
7568
  disabled: () => r.disabled.getValue(e),
@@ -7552,7 +7580,7 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7552
7580
  let f = !1;
7553
7581
  for (let e of t) {
7554
7582
  let t = n.get(e);
7555
- t.length && f && (s.appendChild(hc(o)), f = !1);
7583
+ t.length && f && (s.appendChild(ql(o)), f = !1);
7556
7584
  for (let e of t) s.appendChild(e.render(o)), f = !0;
7557
7585
  }
7558
7586
  return {
@@ -7639,7 +7667,7 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7639
7667
  }],
7640
7668
  toDOM: (e) => [
7641
7669
  "span",
7642
- { style: `font-size: ${Il(e.attrs.size)};` },
7670
+ { style: `font-size: ${qc(e.attrs.size)};` },
7643
7671
  0
7644
7672
  ],
7645
7673
  cursorFix: (e, t) => {
@@ -7664,13 +7692,13 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7664
7692
  getToolbarItems(e) {
7665
7693
  return [this.contribution({
7666
7694
  section: "font",
7667
- render: (t) => cc(t, {
7695
+ render: (t) => Bl(t, {
7668
7696
  label: () => e.getLocale().richTextEditor.textSize,
7669
- trigger: K(t, {
7697
+ trigger: $(t, {
7670
7698
  label: () => e.getLocale().richTextEditor.textSize,
7671
7699
  icon: "text-size-line"
7672
7700
  }),
7673
- children: this.fontSizes.map((e) => lc(t, {
7701
+ children: this.fontSizes.map((e) => Vl(t, {
7674
7702
  text: e.label,
7675
7703
  checked: () => this.getFontSizeFromSelection(t.view.state) === e.size,
7676
7704
  disabled: () => !this.setFontSize(e.size)(t.view.state),
@@ -7941,7 +7969,7 @@ var Du = class extends w {
7941
7969
  getToolbarItems(e) {
7942
7970
  return [this.contribution({
7943
7971
  section: "text-style",
7944
- render: (t) => fc(t, {
7972
+ render: (t) => Wl(t, {
7945
7973
  label: () => t.rte.getLocale().richTextEditor.bold,
7946
7974
  icon: "bold-line",
7947
7975
  markType: e.schema.marks.bold
@@ -7961,7 +7989,7 @@ var Du = class extends w {
7961
7989
  getToolbarItems(e) {
7962
7990
  return [this.contribution({
7963
7991
  section: "text-style",
7964
- render: (t) => fc(t, {
7992
+ render: (t) => Wl(t, {
7965
7993
  label: () => t.rte.getLocale().richTextEditor.italic,
7966
7994
  icon: "italic-line",
7967
7995
  markType: e.schema.marks.italic
@@ -7986,7 +8014,7 @@ var Du = class extends w {
7986
8014
  getToolbarItems(e) {
7987
8015
  return [this.contribution({
7988
8016
  section: "text-style",
7989
- render: (t) => fc(t, {
8017
+ render: (t) => Wl(t, {
7990
8018
  label: () => t.rte.getLocale().richTextEditor.underline,
7991
8019
  icon: "underline-line",
7992
8020
  markType: e.schema.marks.underline
@@ -8014,7 +8042,7 @@ var Du = class extends w {
8014
8042
  getToolbarItems(e) {
8015
8043
  return [this.contribution({
8016
8044
  section: "text-style",
8017
- render: (t) => fc(t, {
8045
+ render: (t) => Wl(t, {
8018
8046
  label: () => t.rte.getLocale().richTextEditor.strikethrough,
8019
8047
  icon: "strikethrough-line",
8020
8048
  markType: e.schema.marks.strikethrough
@@ -8042,7 +8070,7 @@ var Du = class extends w {
8042
8070
  getToolbarItems(e) {
8043
8071
  return [this.contribution({
8044
8072
  section: "text-style",
8045
- render: (t) => fc(t, {
8073
+ render: (t) => Wl(t, {
8046
8074
  label: () => t.rte.getLocale().richTextEditor.monospace,
8047
8075
  icon: "monospace-line",
8048
8076
  markType: e.schema.marks.monospace
@@ -8087,7 +8115,7 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8087
8115
  return [
8088
8116
  "span",
8089
8117
  {
8090
- style: `color: ${Il(t)};`,
8118
+ style: `color: ${qc(t)};`,
8091
8119
  "data-text-color": t
8092
8120
  },
8093
8121
  0
@@ -8100,12 +8128,12 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8100
8128
  return [this.contribution({
8101
8129
  section: "text-style",
8102
8130
  render: (e) => {
8103
- let t = K(e, {
8131
+ let t = $(e, {
8104
8132
  label: () => e.rte.getLocale().richTextEditor.textColor,
8105
8133
  disabled: () => !this.setColor("any")(e.view.state),
8106
8134
  icon: "textcolor-line"
8107
8135
  }), n = t.firstElementChild;
8108
- return ic(e, { children: [t, vc(e, {
8136
+ return Il(e, { children: [t, Xl(e, {
8109
8137
  name: "text-color-picker",
8110
8138
  assignedProps: {
8111
8139
  anchor: n,
@@ -8271,7 +8299,7 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8271
8299
  let t = [];
8272
8300
  return this.config.bulletList && t.push(this.contribution({
8273
8301
  section: "textblock",
8274
- render: (t) => K(t, {
8302
+ render: (t) => $(t, {
8275
8303
  label: () => t.rte.getLocale().richTextEditor.bulletList,
8276
8304
  icon: "bullet-list-2-line",
8277
8305
  active: () => this.isSelectionInList(e.schema.nodes.bulletList, t.rte.state),
@@ -8282,7 +8310,7 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8282
8310
  })
8283
8311
  }, 1)), this.config.numberedList && t.push(this.contribution({
8284
8312
  section: "textblock",
8285
- render: (t) => K(t, {
8313
+ render: (t) => $(t, {
8286
8314
  label: () => t.rte.getLocale().richTextEditor.numberedList,
8287
8315
  icon: "list-numbered-line",
8288
8316
  active: () => this.isSelectionInList(e.schema.nodes.numberedList, t.rte.state),
@@ -8366,18 +8394,18 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8366
8394
  getToolbarItems() {
8367
8395
  return [this.contribution({
8368
8396
  section: "textblock",
8369
- render: (e) => cc(e, {
8397
+ render: (e) => Bl(e, {
8370
8398
  label: () => e.rte.getLocale().richTextEditor.alignment,
8371
- trigger: K(e, {
8399
+ trigger: $(e, {
8372
8400
  label: () => e.rte.getLocale().richTextEditor.alignment,
8373
8401
  icon: () => {
8374
8402
  let t = this.getAlignmentFromSelection(e.view.state);
8375
8403
  return od.find((e) => e.value === t)?.icon ?? "align-left-line";
8376
8404
  }
8377
8405
  }),
8378
- children: [uc(e, {
8406
+ children: [Hl(e, {
8379
8407
  slot: "header",
8380
- children: od.map((t, n) => K(e, {
8408
+ children: od.map((t, n) => $(e, {
8381
8409
  icon: t.icon,
8382
8410
  label: () => e.rte.getLocale().richTextEditor.alignments[t.label],
8383
8411
  noTooltip: !0,
@@ -8444,7 +8472,7 @@ var fd = y(class extends w {
8444
8472
  let { href: t } = e.attrs;
8445
8473
  return [
8446
8474
  "a",
8447
- { href: Pl(t) },
8475
+ { href: Gc(t) },
8448
8476
  0
8449
8477
  ];
8450
8478
  }
@@ -8475,19 +8503,19 @@ var fd = y(class extends w {
8475
8503
  return null;
8476
8504
  } },
8477
8505
  view: (t) => {
8478
- let r = new rc(t, e, {
8506
+ let r = new Fl(t, e, {
8479
8507
  popupPlacement: "bottom",
8480
8508
  shouldReturnFocusToEditor: !0
8481
8509
  });
8482
8510
  n = e.createComponent(E), n.anchorId = "current-link";
8483
- let i = ic(r, {
8511
+ let i = Il(r, {
8484
8512
  className: "link-popover",
8485
- children: [ic(r, {
8513
+ children: [Il(r, {
8486
8514
  className: "link-popover-header",
8487
- children: [ic(r, {
8515
+ children: [Il(r, {
8488
8516
  className: "link-popover-label",
8489
- children: [_c(r, { text: () => this.getCurrentLink(r.view.state)?.text || "" })]
8490
- }), K(r, {
8517
+ children: [Yl(r, { text: () => this.getCurrentLink(r.view.state)?.text || "" })]
8518
+ }), $(r, {
8491
8519
  icon: "close-line",
8492
8520
  label: () => r.rte.getLocale().richTextEditor.close,
8493
8521
  noTooltip: !0,
@@ -8495,17 +8523,17 @@ var fd = y(class extends w {
8495
8523
  n.dismiss();
8496
8524
  }
8497
8525
  })]
8498
- }), ic(r, {
8526
+ }), Il(r, {
8499
8527
  className: "link-popover-content",
8500
- children: [ac(r, {
8528
+ children: [Ll(r, {
8501
8529
  className: "link",
8502
8530
  href: () => this.getCurrentLink(r.view.state)?.href || "",
8503
8531
  target: "_blank",
8504
8532
  rel: "noopener",
8505
- children: [_c(r, { text: () => this.getCurrentLink(r.view.state)?.href || "" })]
8506
- }), ic(r, {
8533
+ children: [Yl(r, { text: () => this.getCurrentLink(r.view.state)?.href || "" })]
8534
+ }), Il(r, {
8507
8535
  className: "link-action-bar",
8508
- children: [K(r, {
8536
+ children: [$(r, {
8509
8537
  icon: "delete-line",
8510
8538
  label: () => r.rte.getLocale().richTextEditor.delete,
8511
8539
  connotation: "alert",
@@ -8515,7 +8543,7 @@ var fd = y(class extends w {
8515
8543
  let { state: e, dispatch: t } = r.view;
8516
8544
  this.removeLink(e, t);
8517
8545
  }
8518
- }), K(r, {
8546
+ }), $(r, {
8519
8547
  icon: "edit-line",
8520
8548
  label: () => r.rte.getLocale().richTextEditor.edit,
8521
8549
  variant: "popover",
@@ -8556,7 +8584,7 @@ var fd = y(class extends w {
8556
8584
  return [this.contribution({
8557
8585
  section: "insert",
8558
8586
  render: (r) => {
8559
- let i = gc(r, {
8587
+ let i = Jl(r, {
8560
8588
  label: () => r.rte.getLocale().richTextEditor.linkText,
8561
8589
  placeholder: () => r.rte.getLocale().richTextEditor.linkTextPlaceholder,
8562
8590
  slot: "header",
@@ -8565,7 +8593,7 @@ var fd = y(class extends w {
8565
8593
  onInput: () => {
8566
8594
  s();
8567
8595
  }
8568
- }), a = gc(r, {
8596
+ }), a = Jl(r, {
8569
8597
  label: () => r.rte.getLocale().richTextEditor.linkUrl,
8570
8598
  type: "url",
8571
8599
  placeholder: () => r.rte.getLocale().richTextEditor.linkUrlPlaceholder,
@@ -8575,7 +8603,7 @@ var fd = y(class extends w {
8575
8603
  onInput: () => {
8576
8604
  s();
8577
8605
  }
8578
- }), o = K(r, {
8606
+ }), o = $(r, {
8579
8607
  label: () => r.rte.getLocale().richTextEditor.apply,
8580
8608
  variant: "popover-primary",
8581
8609
  disabled: () => {
@@ -8588,22 +8616,22 @@ var fd = y(class extends w {
8588
8616
  }
8589
8617
  }), s = () => {
8590
8618
  o.querySelector("[data-vvd-component=\"button\"]").disabled = !(i.value.length && n(a.value));
8591
- }, c = cc(r, {
8619
+ }, c = Bl(r, {
8592
8620
  label: () => r.rte.getLocale().richTextEditor.hyperlink,
8593
- trigger: K(r, {
8621
+ trigger: $(r, {
8594
8622
  label: () => r.rte.getLocale().richTextEditor.hyperlink,
8595
8623
  icon: "link-line"
8596
8624
  }),
8597
- children: [ic(r, {
8625
+ children: [Il(r, {
8598
8626
  className: "link-toolbar-menu",
8599
8627
  slot: "header",
8600
8628
  children: [
8601
8629
  i,
8602
8630
  a,
8603
- ic(r, {
8631
+ Il(r, {
8604
8632
  className: "link-action-bar",
8605
8633
  slot: "header",
8606
- children: [K(r, {
8634
+ children: [$(r, {
8607
8635
  label: () => r.rte.getLocale().richTextEditor.cancel,
8608
8636
  variant: "popover",
8609
8637
  onClick: () => {
@@ -8674,7 +8702,7 @@ var fd = y(class extends w {
8674
8702
  }
8675
8703
  initializeImg(e) {
8676
8704
  this.img.className = "inline-image", this.update(e), this.img.addEventListener("load", () => {
8677
- let e = this.getPos?.();
8705
+ let e = this.getPos();
8678
8706
  if (e) {
8679
8707
  let { state: t, dispatch: n } = this.view, r = t.doc.nodeAt(e);
8680
8708
  if (!r || r.attrs.naturalWidth === this.img.naturalWidth && r.attrs.naturalHeight === this.img.naturalHeight) return;
@@ -8684,7 +8712,7 @@ var fd = y(class extends w {
8684
8712
  });
8685
8713
  }
8686
8714
  renderImg(e) {
8687
- this.img.src = Fl(e), this.setContent(this.img, { allowPopover: !0 });
8715
+ this.img.src = Kc(e), this.setContent(this.img, { allowPopover: !0 });
8688
8716
  }
8689
8717
  update(e) {
8690
8718
  return this.img.alt = e.attrs.alt, this.img.width = e.attrs.naturalWidth, this.img.height = e.attrs.naturalHeight, this.img.style.maxWidth = e.attrs.size, !0;
@@ -8744,11 +8772,11 @@ var fd = y(class extends w {
8744
8772
  let { imageUrl: t, alt: n, size: r, naturalWidth: i, naturalHeight: a } = e.attrs, o = this.config.serializeUrlToHtml ? this.config.serializeUrlToHtml(t) : t;
8745
8773
  if (o === null) return document.createTextNode("");
8746
8774
  let s = {
8747
- src: Fl(o),
8775
+ src: Kc(o),
8748
8776
  "data-src": o,
8749
8777
  alt: n
8750
8778
  };
8751
- return r && (s.style = `max-width: ${Il(r)}; height: auto;`), i && (s.width = i), a && (s.height = a), ["img", s];
8779
+ return r && (s.style = `max-width: ${qc(r)}; height: auto;`), i && (s.width = i), a && (s.height = a), ["img", s];
8752
8780
  }
8753
8781
  } } })];
8754
8782
  }
@@ -8757,15 +8785,15 @@ var fd = y(class extends w {
8757
8785
  return [this.contribution(new N({
8758
8786
  props: { nodeViews: { inlineImage: (e, t, n) => new _d(e, t, n, this.config) } },
8759
8787
  view: (n) => {
8760
- let r = new rc(n, e, {
8788
+ let r = new Fl(n, e, {
8761
8789
  popupPlacement: "bottom",
8762
8790
  shouldReturnFocusToEditor: !0
8763
8791
  });
8764
- t = e.createComponent(E), t.offset = 4;
8765
- let i = ic(r, {
8792
+ t = e.createComponent(E), t.kind = "imageOptions", t.offset = 4;
8793
+ let i = Il(r, {
8766
8794
  className: "inline-image-popover",
8767
8795
  children: [
8768
- K(r, {
8796
+ $(r, {
8769
8797
  label: () => r.rte.getLocale().richTextEditor.imageSizes.small,
8770
8798
  variant: "popover",
8771
8799
  active: () => this.getSelectedImageSize(r.view.state) === "small",
@@ -8773,8 +8801,8 @@ var fd = y(class extends w {
8773
8801
  this.setSelectedImageSize("small")(r.view.state, r.view.dispatch);
8774
8802
  }
8775
8803
  }),
8776
- hc(r),
8777
- K(r, {
8804
+ ql(r),
8805
+ $(r, {
8778
8806
  label: () => r.rte.getLocale().richTextEditor.imageSizes.fit,
8779
8807
  variant: "popover",
8780
8808
  active: () => this.getSelectedImageSize(r.view.state) === "fit",
@@ -8782,8 +8810,8 @@ var fd = y(class extends w {
8782
8810
  this.setSelectedImageSize("fit")(r.view.state, r.view.dispatch);
8783
8811
  }
8784
8812
  }),
8785
- hc(r),
8786
- K(r, {
8813
+ ql(r),
8814
+ $(r, {
8787
8815
  label: () => r.rte.getLocale().richTextEditor.imageSizes.original,
8788
8816
  variant: "popover",
8789
8817
  active: () => this.getSelectedImageSize(r.view.state) === "original",
@@ -8807,7 +8835,7 @@ var fd = y(class extends w {
8807
8835
  })), this.contribution(U({ Escape: (e) => this.getSelectedInlineImage(e) ? (t?.dismiss(), !0) : !1 }))];
8808
8836
  }
8809
8837
  calculateSmallWidth(e) {
8810
- return Math.min(300, e / 2) + "px";
8838
+ return `${Math.min(300, e / 2)}px`;
8811
8839
  }
8812
8840
  getSelectedInlineImage(e) {
8813
8841
  let t = e.selection;
@@ -8914,20 +8942,20 @@ var fd = y(class extends w {
8914
8942
  let n = Array.from(t.clipboardData.files);
8915
8943
  return n.length ? (i(n, { type: "selection" }), !0) : !1;
8916
8944
  },
8917
- handleDrop: (e, t, n, r) => {
8918
- let a = Array.from(t.dataTransfer.files);
8919
- if (!a.length) return !1;
8920
- let o = e.posAtCoords({
8945
+ handleDrop: (e, t) => {
8946
+ let n = Array.from(t.dataTransfer.files);
8947
+ if (!n.length) return !1;
8948
+ let r = e.posAtCoords({
8921
8949
  left: t.clientX,
8922
8950
  top: t.clientY
8923
8951
  }).pos;
8924
8952
  if (e.dragging && e.dragging.slice) {
8925
- let t = ht(e.state.doc, o, e.dragging.slice);
8926
- t != null && (o = t);
8953
+ let t = ht(e.state.doc, r, e.dragging.slice);
8954
+ t != null && (r = t);
8927
8955
  }
8928
- return i(a, {
8956
+ return i(n, {
8929
8957
  type: "pos",
8930
- pos: o
8958
+ pos: r
8931
8959
  }), !0;
8932
8960
  }
8933
8961
  } }))];
@@ -8936,29 +8964,29 @@ var fd = y(class extends w {
8936
8964
  constructor(e) {
8937
8965
  super(), this.config = e, this.name = "RteDebugFeature";
8938
8966
  }
8939
- getPlugins(e) {
8940
- let t = /* @__PURE__ */ new WeakMap(), n = !1, r = (e) => {
8941
- t.get(e) === void 0 && (n = this.config.onViewportDragOver?.(e) ?? !1);
8942
- }, i = (e) => {
8967
+ getPlugins() {
8968
+ let e = /* @__PURE__ */ new WeakMap(), t = !1, n = (n) => {
8969
+ e.get(n) === void 0 && (t = this.config.onViewportDragOver?.(n) ?? !1);
8970
+ }, r = (e) => {
8943
8971
  this.config.onViewportDrop?.(e), this.config.onViewportDragFinish?.();
8944
- }, a = () => {
8972
+ }, i = () => {
8945
8973
  this.config.onViewportDragFinish?.();
8946
- }, o = !1, s = () => {
8947
- o = !0, window.setTimeout(() => o = !1, 0);
8948
- }, c = () => {
8949
- o || this.config.onViewportDragFinish?.();
8974
+ }, a = !1, o = () => {
8975
+ a = !0, window.setTimeout(() => a = !1, 0);
8976
+ }, s = () => {
8977
+ a || this.config.onViewportDragFinish?.();
8950
8978
  };
8951
8979
  return [this.contribution(new N({ view: (e) => {
8952
8980
  let t = e.root.host.editorViewportElement;
8953
- return t.addEventListener("dragover", r), t.addEventListener("drop", i), t.addEventListener("dragend", a), t.addEventListener("dragenter", s), t.addEventListener("dragleave", c), { destroy() {
8954
- t.removeEventListener("dragover", r), t.removeEventListener("drop", i), t.removeEventListener("dragend", a), t.removeEventListener("dragenter", s), t.removeEventListener("dragleave", c);
8981
+ return t.addEventListener("dragover", n), t.addEventListener("drop", r), t.addEventListener("dragend", i), t.addEventListener("dragenter", o), t.addEventListener("dragleave", s), { destroy() {
8982
+ t.removeEventListener("dragover", n), t.removeEventListener("drop", r), t.removeEventListener("dragend", i), t.removeEventListener("dragenter", o), t.removeEventListener("dragleave", s);
8955
8983
  } };
8956
8984
  } })), this.contribution(new N({ props: { handleDOMEvents: {
8957
- dragover: (e, r) => {
8985
+ dragover: (n, r) => {
8958
8986
  let i = this.config.onViewportDragOver?.(r) ?? !1;
8959
- return t.set(r, i), n = i, i ? (r.stopImmediatePropagation(), r.preventDefault(), !0) : !1;
8987
+ return e.set(r, i), t = i, i ? (r.stopImmediatePropagation(), r.preventDefault(), !0) : !1;
8960
8988
  },
8961
- drop: (e, t) => n
8989
+ drop: () => t
8962
8990
  } } }), pe.high)];
8963
8991
  }
8964
8992
  }), Sd = y(class extends w {
@@ -8968,7 +8996,7 @@ var fd = y(class extends w {
8968
8996
  getToolbarItems() {
8969
8997
  return [this.contribution({
8970
8998
  section: "insert",
8971
- render: (e) => K(e, {
8999
+ render: (e) => $(e, {
8972
9000
  label: this.options.label,
8973
9001
  icon: this.options.icon,
8974
9002
  onClick: () => {
@@ -9057,7 +9085,7 @@ var fd = y(class extends w {
9057
9085
  //#endregion
9058
9086
  //#region src/lib/rich-text-editor/rte/features/keyboard-shortcuts.ts
9059
9087
  function Dd(e, t) {
9060
- return e.length === 0 ? (t, n) => e() : (n, r) => e(t);
9088
+ return (n, r) => e(t);
9061
9089
  }
9062
9090
  var Od = y(class extends w {
9063
9091
  constructor(e, t) {
@@ -9084,7 +9112,7 @@ function Md(e, t) {
9084
9112
  }
9085
9113
  var Nd = (e, t, n) => {
9086
9114
  let { state: r } = e;
9087
- e.dispatch(Js(r.tr));
9115
+ e.dispatch(El(r.tr));
9088
9116
  let i = e.state.tr;
9089
9117
  i.replaceWith(t.start, t.end, x.fromJSON(e.state.schema, n));
9090
9118
  let a = i.mapping.map(t.end);
@@ -9183,12 +9211,12 @@ var Nd = (e, t, n) => {
9183
9211
  return t ? t.loadingDecoration.add(e.doc, [ja.inline(t.match.start, t.match.end, { id: `suggest-anchor-${this.featureId}` })]) : null;
9184
9212
  } },
9185
9213
  view: (t) => {
9186
- let n = new rc(t, e, {
9214
+ let n = new Fl(t, e, {
9187
9215
  popupPlacement: "bottom",
9188
9216
  shouldReturnFocusToEditor: !0
9189
9217
  }), r = e.createComponent(E);
9190
9218
  r.anchorId = `suggest-anchor-${this.featureId}`, r.kind = "autocomplete", r.offset = 4;
9191
- let i = ic(n, {
9219
+ let i = Il(n, {
9192
9220
  className: "suggest-popover",
9193
9221
  children: []
9194
9222
  });
@@ -9200,7 +9228,7 @@ var Nd = (e, t, n) => {
9200
9228
  let o = r.suggestions, s = o.items.length === 0;
9201
9229
  if (c(s), s) {
9202
9230
  let t = document.createElement("slot");
9203
- t.name = a, t.textContent = e.getLocale().richTextEditor.suggestNoResults, i.appendChild(ic(n, {
9231
+ t.name = a, t.textContent = e.getLocale().richTextEditor.suggestNoResults, i.appendChild(Il(n, {
9204
9232
  className: "suggest-empty-message",
9205
9233
  children: [t]
9206
9234
  }));
@@ -9291,4 +9319,4 @@ n(o("rich-text-editor", Te, Ee, [
9291
9319
  shadowOptions: { delegatesFocus: !0 }
9292
9320
  }))();
9293
9321
  //#endregion
9294
- export { cd as RteAlignmentFeature, Td as RteAtomFeature, cu as RteBase, Ou as RteBoldFeature, Id as RteCharacterCountFeature, Xl as RteConfig, xd as RteDropHandlerFeature, bd as RteFileHandlerFeature, gu as RteFontSizePickerFeature, mu as RteHardBreakFeature, zl as RteHtmlParser, Hl as RteHtmlSerializer, vd as RteInlineImageFeature, Ed as RteInputRuleFeature, ku as RteItalicFeature, Od as RteKeyboardShortcutsFeature, fd as RteLinkFeature, ad as RteListFeature, Nu as RteMonospaceFeature, pu as RtePlaceholderFeature, ju as RteStrikethroughFeature, Pd as RteSuggestFeature, lu as RteTextBlockPickerFeature, Iu as RteTextColorPickerFeature, Sd as RteToolbarButtonFeature, du as RteToolbarFeature, Au as RteUnderlineFeature };
9322
+ export { cd as RteAlignmentFeature, Td as RteAtomFeature, cu as RteBase, Ou as RteBoldFeature, Id as RteCharacterCountFeature, sl as RteConfig, xd as RteDropHandlerFeature, bd as RteFileHandlerFeature, gu as RteFontSizePickerFeature, mu as RteHardBreakFeature, Xc as RteHtmlParser, $c as RteHtmlSerializer, vd as RteInlineImageFeature, Ed as RteInputRuleFeature, ku as RteItalicFeature, Od as RteKeyboardShortcutsFeature, fd as RteLinkFeature, ad as RteListFeature, Nu as RteMonospaceFeature, pu as RtePlaceholderFeature, ju as RteStrikethroughFeature, Pd as RteSuggestFeature, lu as RteTextBlockPickerFeature, Iu as RteTextColorPickerFeature, Sd as RteToolbarButtonFeature, du as RteToolbarFeature, Au as RteUnderlineFeature };