@editora/core 1.0.23 → 1.0.25

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 (67) hide show
  1. package/dist/{A11yCheckerPlugin.native-qW_njhLY.mjs → A11yCheckerPlugin.native-BBCsR5Ur.mjs} +7 -5
  2. package/dist/{AnchorPlugin.native-Drmxhy98.mjs → AnchorPlugin.native-Dk9R26cF.mjs} +20 -19
  3. package/dist/{ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs → ApprovalWorkflowPlugin.native-AeJsehXM.mjs} +56 -55
  4. package/dist/{BackgroundColorPlugin.native-H3XyYD7_.mjs → BackgroundColorPlugin.native-DCAd94kp.mjs} +103 -98
  5. package/dist/{BlocksLibraryPlugin.native-CownM6Rk.mjs → BlocksLibraryPlugin.native-D9OPcnQV.mjs} +42 -43
  6. package/dist/{CitationsPlugin.native-C_7wWQ-k.mjs → CitationsPlugin.native-BFChgCSV.mjs} +51 -51
  7. package/dist/{CodePlugin.native-DZgIez08.mjs → CodePlugin.native-CPfKDrkr.mjs} +1383 -1094
  8. package/dist/{CodePlugin.native-CAHk9ecG.mjs → CodePlugin.native-CRpX2G93.mjs} +167 -113
  9. package/dist/{CodeSamplePlugin.native-svbAFWh_.mjs → CodeSamplePlugin.native-Bai8bgl3.mjs} +5 -5
  10. package/dist/{CommentsPlugin.native-DncTHiEe.mjs → CommentsPlugin.native-DHCDUm9f.mjs} +161 -141
  11. package/dist/{ConditionalContentPlugin.native-Bf7XgRSW.mjs → ConditionalContentPlugin.native-B3R6xcqn.mjs} +3 -3
  12. package/dist/{ContentRulesPlugin.native-vPx5nC73.mjs → ContentRulesPlugin.native-BISqhQKJ.mjs} +52 -52
  13. package/dist/{DataBindingPlugin.native-B7lpI_0c.mjs → DataBindingPlugin.native-DbaDeXNp.mjs} +37 -37
  14. package/dist/{DocumentManagerPlugin.native-B8K-Oqom.mjs → DocumentManagerPlugin.native-CaBqCH-p.mjs} +21 -20
  15. package/dist/{EmbedIframePlugin.native-BfZ_HGlV.mjs → EmbedIframePlugin.native-qHMf1Jtg.mjs} +7 -7
  16. package/dist/{EmojisPlugin.native-D92aaOKi.mjs → EmojisPlugin.native-B64efKg5.mjs} +4 -4
  17. package/dist/{FormatPainterPlugin.native-BhjzsiVq.mjs → FormatPainterPlugin.native-CAc1N6xU.mjs} +183 -161
  18. package/dist/{HeadingPlugin.native-DZdvubrQ.mjs → HeadingPlugin.native-C3YiGERx.mjs} +85 -72
  19. package/dist/HistoryPlugin.native-C8GyxsgC.mjs +330 -0
  20. package/dist/{LinkPlugin.native-BsQXYsK6.mjs → LinkPlugin.native-Dt_p6Ukb.mjs} +4 -4
  21. package/dist/ListPlugin.native-UYaoRiub.mjs +239 -0
  22. package/dist/{MathPlugin.native-Byo3WL0f.mjs → MathPlugin.native-Cq9WQ7cq.mjs} +148 -130
  23. package/dist/MediaManagerPlugin.native-0YFHZfsb.mjs +4823 -0
  24. package/dist/MediaManagerPlugin.native-mXWWARRX.mjs +4908 -0
  25. package/dist/{MentionPlugin.native-S_lwGZQO.mjs → MentionPlugin.native-Zb1dwdxU.mjs} +304 -300
  26. package/dist/{MergeTagPlugin.native-7-6F3S1Y.mjs → MergeTagPlugin.native-BXkVPvCo.mjs} +6 -4
  27. package/dist/{PIIRedactionPlugin.native-g7j4jOmm.mjs → PIIRedactionPlugin.native-Cm0bpzQb.mjs} +2 -2
  28. package/dist/{PreviewPlugin.native-Dv5OsffK.mjs → PreviewPlugin.native-CrfiwP2J.mjs} +2 -2
  29. package/dist/{SlashCommandsPlugin.native-BDIIwGNs.mjs → SlashCommandsPlugin.native-BzGTRmMB.mjs} +264 -240
  30. package/dist/{SmartPastePlugin.native-BATLCds5.mjs → SmartPastePlugin.native-DnOJhDsf.mjs} +2 -2
  31. package/dist/{SpecialCharactersPlugin.native-CdZoc1GB.mjs → SpecialCharactersPlugin.native-B0XaCfjZ.mjs} +4 -4
  32. package/dist/{SpellCheckPlugin.native-BGm2qPfn.mjs → SpellCheckPlugin.native-BE7os1Xj.mjs} +302 -265
  33. package/dist/{TablePlugin.native-C1YZ372P.mjs → TablePlugin.native-CWxEFpV8.mjs} +159 -136
  34. package/dist/{TemplatePlugin.native-Dwk8TgxI.mjs → TemplatePlugin.native-OD8Wc1R7.mjs} +6 -4
  35. package/dist/{TextColorPlugin.native-KMZ2uzlq.mjs → TextColorPlugin.native-C2IjioNM.mjs} +75 -71
  36. package/dist/{TranslationWorkflowPlugin.native-CZtG--06.mjs → TranslationWorkflowPlugin.native-BGXVJD9f.mjs} +101 -98
  37. package/dist/{VersionDiffPlugin.native-Ca1fMWUJ.mjs → VersionDiffPlugin.native-DJZIzFSK.mjs} +11 -11
  38. package/dist/anchoredPopover-QN4jNbW1.mjs +134 -0
  39. package/dist/confirmDialog-CNqPHT5x.mjs +92 -0
  40. package/dist/dialogHelpers-Dzn8DHoF.mjs +194 -0
  41. package/dist/{documentManager-BWK_-KJp.mjs → documentManager-DHLCoWzw.mjs} +1963 -1969
  42. package/dist/editora.min.js +21 -21
  43. package/dist/editora.umd.js +10 -10
  44. package/dist/index-DHPPVQwx.js +12 -0
  45. package/dist/{index-DGMYWPLx.mjs → index-gI4djib2.mjs} +407 -327
  46. package/dist/index.cjs.js +1 -1
  47. package/dist/index.esm.js +2 -2
  48. package/dist/katex-DLIObQUm.mjs +11683 -0
  49. package/dist/katex.min--Ws3c9be.mjs +6 -0
  50. package/dist/notify-DCQGpmq-.mjs +60 -0
  51. package/dist/plugin-loader.js +54 -54
  52. package/dist/shared-config-DuA34Iii.mjs +26 -0
  53. package/dist/webcomponent-core.js +315 -235
  54. package/dist/webcomponent-core.min.css +1 -1
  55. package/dist/webcomponent-core.min.js +153 -80
  56. package/dist/webcomponent.cjs.js +1 -1
  57. package/dist/webcomponent.esm.js +1 -1
  58. package/dist/webcomponent.js +672 -592
  59. package/dist/webcomponent.min.css +1 -1
  60. package/dist/webcomponent.min.js +3099 -1532
  61. package/package.json +1 -1
  62. package/dist/HistoryPlugin.native-DPvhks6h.mjs +0 -246
  63. package/dist/ListPlugin.native-Bt0LANbO.mjs +0 -139
  64. package/dist/MediaManagerPlugin.native-BT1NZIJS.mjs +0 -998
  65. package/dist/anchoredPopover-DJFD2oAP.mjs +0 -116
  66. package/dist/dialogHelpers-DBf7WqYH.mjs +0 -40
  67. package/dist/index-C1sO7DAC.js +0 -12
@@ -1,4 +1,4 @@
1
- class Ao {
1
+ class xo {
2
2
  constructor() {
3
3
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
4
4
  }
@@ -14,10 +14,10 @@ class Ao {
14
14
  async load(t, e) {
15
15
  if (this.loadedPlugins.has(t))
16
16
  return this.loadedPlugins.get(t);
17
- const n = this.pluginRegistry.get(t);
18
- if (!n)
17
+ const o = this.pluginRegistry.get(t);
18
+ if (!o)
19
19
  return console.warn(`Plugin not found: ${t}`), null;
20
- const r = await n();
20
+ const r = await o();
21
21
  return e && this.applyPluginConfig(r, e), this.loadedPlugins.set(t, r), r;
22
22
  }
23
23
  /**
@@ -32,8 +32,8 @@ class Ao {
32
32
  * Parse plugin string "lists link image media"
33
33
  */
34
34
  async parsePluginString(t, e) {
35
- const n = t.split(/\s+/).filter(Boolean);
36
- return this.loadMultiple(n, e);
35
+ const o = t.split(/\s+/).filter(Boolean);
36
+ return this.loadMultiple(o, e);
37
37
  }
38
38
  /**
39
39
  * Apply configuration to plugin
@@ -73,12 +73,12 @@ class Ao {
73
73
  }
74
74
  }
75
75
  class Kt {
76
- constructor(t, e, n) {
77
- this.doc = t, this.selection = e, this.schema = n;
76
+ constructor(t, e, o) {
77
+ this.doc = t, this.selection = e, this.schema = o;
78
78
  }
79
79
  static create(t, e) {
80
- const n = e || t.node("doc", {}, [t.node("paragraph")]);
81
- return new Kt(n, { anchor: 0, head: 0 }, t);
80
+ const o = e || t.node("doc", {}, [t.node("paragraph")]);
81
+ return new Kt(o, { anchor: 0, head: 0 }, t);
82
82
  }
83
83
  apply(t, e) {
84
84
  return new Kt(t, e || this.selection, this.schema);
@@ -88,8 +88,8 @@ class ln {
88
88
  constructor(t, e) {
89
89
  this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
90
90
  }
91
- node(t, e, n) {
92
- return { type: t, attrs: e, content: n };
91
+ node(t, e, o) {
92
+ return { type: t, attrs: e, content: o };
93
93
  }
94
94
  text(t, e) {
95
95
  return { type: "text", text: t, marks: e };
@@ -101,25 +101,25 @@ class cn {
101
101
  }
102
102
  register(t, e) {
103
103
  this.plugins.push(t), e && this.pluginConfigs.set(t.name, e);
104
- const n = this.pluginConfigs.get(t.name) || t.config;
104
+ const o = this.pluginConfigs.get(t.name) || t.config;
105
105
  if (t.initialize)
106
106
  try {
107
- t.initialize(n);
107
+ t.initialize(o);
108
108
  } catch (r) {
109
109
  console.error(`Failed to initialize plugin "${t.name}":`, r);
110
110
  }
111
111
  if (t.init && t.init !== t.initialize)
112
112
  try {
113
- t.init(n);
113
+ t.init(o);
114
114
  } catch (r) {
115
115
  console.error(`Failed to run init hook for plugin "${t.name}":`, r);
116
116
  }
117
117
  }
118
118
  unregister(t) {
119
- const e = this.plugins.findIndex((n) => n.name === t);
119
+ const e = this.plugins.findIndex((o) => o.name === t);
120
120
  if (e > -1) {
121
- const n = this.plugins[e];
122
- n.destroy && n.destroy(), this.plugins.splice(e, 1), this.pluginConfigs.delete(t);
121
+ const o = this.plugins[e];
122
+ o.destroy && o.destroy(), this.plugins.splice(e, 1), this.pluginConfigs.delete(t);
123
123
  }
124
124
  }
125
125
  getPlugin(t) {
@@ -130,8 +130,8 @@ class cn {
130
130
  }
131
131
  buildSchema() {
132
132
  const t = {}, e = {};
133
- return this.plugins.forEach((n) => {
134
- n.nodes && Object.assign(t, n.nodes), n.marks && Object.assign(e, n.marks);
133
+ return this.plugins.forEach((o) => {
134
+ o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
135
135
  }), new ln(t, e);
136
136
  }
137
137
  getCommands() {
@@ -146,7 +146,7 @@ class cn {
146
146
  /**
147
147
  * Execute plugin command with mode awareness
148
148
  */
149
- async executePluginCommand(t, e, ...n) {
149
+ async executePluginCommand(t, e, ...o) {
150
150
  const r = this.getPlugin(t);
151
151
  if (!r)
152
152
  throw new Error(`Plugin not found: ${t}`);
@@ -154,20 +154,20 @@ class cn {
154
154
  try {
155
155
  switch (l) {
156
156
  case "local":
157
- return r.executeLocal ? r.executeLocal(e, ...n) : null;
157
+ return r.executeLocal ? r.executeLocal(e, ...o) : null;
158
158
  case "api":
159
159
  if (!r.executeAPI)
160
160
  throw new Error(`Plugin ${t} does not support API mode`);
161
- return await r.executeAPI(e, ...n);
161
+ return await r.executeAPI(e, ...o);
162
162
  case "hybrid":
163
163
  if (r.executeHybrid)
164
- return await r.executeHybrid(e, ...n);
164
+ return await r.executeHybrid(e, ...o);
165
165
  try {
166
166
  if (r.executeAPI)
167
- return await r.executeAPI(e, ...n);
167
+ return await r.executeAPI(e, ...o);
168
168
  } catch (c) {
169
169
  if (console.warn(`API execution failed for ${t}, falling back to local`, c), r.executeLocal && a.fallbackToLocal !== !1)
170
- return r.executeLocal(e, ...n);
170
+ return r.executeLocal(e, ...o);
171
171
  throw c;
172
172
  }
173
173
  break;
@@ -188,8 +188,8 @@ class cn {
188
188
  }
189
189
  class dn {
190
190
  constructor(t = {}) {
191
- this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, n]) => {
192
- this.register(e, n);
191
+ this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
192
+ this.register(e, o);
193
193
  });
194
194
  }
195
195
  /**
@@ -231,7 +231,7 @@ class dn {
231
231
  }
232
232
  class un {
233
233
  constructor(t = {}) {
234
- this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new cn(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((n) => this.pluginManager.register(n));
234
+ this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new cn(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
235
235
  const e = this.pluginManager.buildSchema();
236
236
  this.state = Kt.create(e), this.commandRegistry = new dn(this.pluginManager.getCommands());
237
237
  }
@@ -243,11 +243,11 @@ class un {
243
243
  return console.warn("Cannot execute commands in readonly mode"), !1;
244
244
  if (this.isDestroyed)
245
245
  return console.warn("Cannot execute commands on destroyed editor"), !1;
246
- const n = this.commandRegistry.get(t);
247
- if (!n)
246
+ const o = this.commandRegistry.get(t);
247
+ if (!o)
248
248
  return console.warn(`Command not found: ${t}`), !1;
249
249
  let r;
250
- return e.length === 0 ? r = n(this.state) : e.length === 1 ? r = n(this.state, e[0]) : r = n(this.state, ...e), r instanceof Promise ? (r.then((a) => {
250
+ return e.length === 0 ? r = o(this.state) : e.length === 1 ? r = o(this.state, e[0]) : r = o(this.state, ...e), r instanceof Promise ? (r.then((a) => {
251
251
  a && typeof a == "object" && "doc" in a && "selection" in a && (this.setState(a), this.emit("change", this.state));
252
252
  }).catch((a) => {
253
253
  console.error(`Async command failed: ${t}`, a);
@@ -282,10 +282,10 @@ class un {
282
282
  */
283
283
  on(t, e) {
284
284
  return this.listeners.has(t) || this.listeners.set(t, []), this.listeners.get(t).push(e), () => {
285
- const n = this.listeners.get(t);
286
- if (n) {
287
- const r = n.indexOf(e);
288
- r > -1 && n.splice(r, 1);
285
+ const o = this.listeners.get(t);
286
+ if (o) {
287
+ const r = o.indexOf(e);
288
+ r > -1 && o.splice(r, 1);
289
289
  }
290
290
  };
291
291
  }
@@ -293,8 +293,8 @@ class un {
293
293
  * Emit event
294
294
  */
295
295
  emit(t, ...e) {
296
- const n = this.listeners.get(t);
297
- n && n.forEach((r) => {
296
+ const o = this.listeners.get(t);
297
+ o && o.forEach((r) => {
298
298
  try {
299
299
  r(...e);
300
300
  } catch (a) {
@@ -316,18 +316,18 @@ class un {
316
316
  }
317
317
  }
318
318
  class pn {
319
- constructor(t, e, n) {
319
+ constructor(t, e, o) {
320
320
  this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (r) => {
321
321
  var l, c;
322
322
  if (!this.expandedOpen) return;
323
323
  const a = r.target;
324
324
  a && ((l = this.moreButton) != null && l.contains(a) || (c = this.expandedRow) != null && c.contains(a)) || this.setExpandedOpen(!1);
325
- }, this.config = t, this.plugins = e, this.pluginLoader = n;
325
+ }, this.config = t, this.plugins = e, this.pluginLoader = o;
326
326
  }
327
327
  setLastCommandTrigger(t, e) {
328
328
  if (typeof window == "undefined" || !t) return;
329
- const n = e || t.getAttribute("data-command") || void 0;
330
- n && (window.__editoraLastCommandButton = t, window.__editoraLastCommand = n);
329
+ const o = e || t.getAttribute("data-command") || void 0;
330
+ o && (window.__editoraLastCommandButton = t, window.__editoraLastCommand = o);
331
331
  }
332
332
  /**
333
333
  * Set command handler for toolbar buttons
@@ -339,7 +339,7 @@ class pn {
339
339
  * Parse toolbar string into button groups
340
340
  */
341
341
  parseToolbarString(t) {
342
- const e = [], n = t.split("|").map((c) => c.trim()), r = this.getAvailableToolbarItems(), a = /* @__PURE__ */ new Map();
342
+ const e = [], o = t.split("|").map((c) => c.trim()), r = this.getAvailableToolbarItems(), a = /* @__PURE__ */ new Map();
343
343
  r.forEach((c) => {
344
344
  c.command && a.set(c.command, c), c.type === "group" && c.label && a.set(c.label, c);
345
345
  });
@@ -403,12 +403,13 @@ class pn {
403
403
  exportPdf: "exportPdf",
404
404
  insertImage: "insertImage",
405
405
  insertVideo: "insertVideo",
406
+ insertAudio: "insertAudio",
406
407
  codeBlock: "insertCodeBlock"
407
408
  };
408
- return n.forEach((c) => {
409
+ return o.forEach((c) => {
409
410
  const f = [];
410
- c.split(/\s+/).filter(Boolean).forEach((E) => {
411
- if (E === "direction") {
411
+ c.split(/\s+/).filter(Boolean).forEach((g) => {
412
+ if (g === "direction") {
412
413
  const w = a.get("setDirectionLTR"), v = a.get("setDirectionRTL");
413
414
  w && f.push({
414
415
  id: "directionLTR",
@@ -427,7 +428,7 @@ class pn {
427
428
  });
428
429
  return;
429
430
  }
430
- if (E === "comments") {
431
+ if (g === "comments") {
431
432
  const w = a.get("addComment"), v = a.get("toggleComments");
432
433
  w && f.push({
433
434
  id: "addComment",
@@ -446,16 +447,16 @@ class pn {
446
447
  });
447
448
  return;
448
449
  }
449
- const x = l[E] || E;
450
- let A = a.get(x);
451
- A || (A = a.get(E)), A && f.push({
452
- id: E,
453
- label: A.label,
454
- command: A.command,
455
- icon: A.icon,
456
- type: A.type === "separator" ? "separator" : A.type || "button",
457
- options: A.options,
458
- items: A.items
450
+ const k = l[g] || g;
451
+ let T = a.get(k);
452
+ T || (T = a.get(g)), T && f.push({
453
+ id: g,
454
+ label: T.label,
455
+ command: T.command,
456
+ icon: T.icon,
457
+ type: T.type === "separator" ? "separator" : T.type || "button",
458
+ options: T.options,
459
+ items: T.items
459
460
  });
460
461
  }), f.length > 0 && e.push(f);
461
462
  }), e;
@@ -473,7 +474,7 @@ class pn {
473
474
  this.container = t, t.innerHTML = "", t.className = "editora-toolbar", this.config.sticky && t.classList.add("editora-toolbar-sticky"), this.config.position && t.classList.add(`editora-toolbar-${this.config.position}`);
474
475
  const e = document.createElement("div");
475
476
  e.className = "editora-toolbar-items-container", this.itemsContainer = e, this.overflowUnits = [];
476
- const n = this.config.items || this.getDefaultToolbarString(), r = this.parseToolbarString(n);
477
+ const o = this.config.items || this.getDefaultToolbarString(), r = this.parseToolbarString(o);
477
478
  r.forEach((a, l) => {
478
479
  const c = document.createElement("div");
479
480
  if (c.className = "editora-toolbar-group", a.forEach((f) => {
@@ -490,10 +491,10 @@ class pn {
490
491
  * fit into a collapsible "more options" row, re-measuring on resize. */
491
492
  setupOverflow(t) {
492
493
  if (!this.itemsContainer || typeof ResizeObserver == "undefined") return;
493
- const n = document.createElement("button");
494
- n.type = "button", n.className = "editora-toolbar-more-button", n.title = "Show more options", n.setAttribute("aria-label", "More toolbar options"), n.textContent = "☰", n.style.display = "none", n.addEventListener("click", (c) => {
494
+ const o = document.createElement("button");
495
+ o.type = "button", o.className = "editora-toolbar-more-button", o.title = "Show more options", o.setAttribute("aria-label", "More toolbar options"), o.textContent = "☰", o.style.display = "none", o.addEventListener("click", (c) => {
495
496
  c.preventDefault(), this.setExpandedOpen(!this.expandedOpen);
496
- }), this.moreButton = n, t.appendChild(n);
497
+ }), this.moreButton = o, t.appendChild(o);
497
498
  const r = document.createElement("div");
498
499
  r.className = "editora-toolbar-expanded-row", this.expandedRow = r, t.appendChild(r), document.addEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0);
499
500
  const a = () => {
@@ -503,18 +504,18 @@ class pn {
503
504
  var R;
504
505
  D.parentElement === r && ((R = this.overflowUnitHomes.get(D)) == null || R.appendChild(D));
505
506
  });
506
- const f = t.clientWidth, m = 16, E = 40, x = 4, A = Math.max(0, f - m - E - x);
507
+ const f = t.clientWidth, m = 16, g = 40, k = 4, T = Math.max(0, f - m - g - k);
507
508
  let w = 0, v = 0;
508
509
  for (const D of c) {
509
- const R = D.getBoundingClientRect().width + x;
510
- if (w + R <= A)
510
+ const R = D.getBoundingClientRect().width + k;
511
+ if (w + R <= T)
511
512
  w += R, v++;
512
513
  else
513
514
  break;
514
515
  }
515
516
  v = Math.max(1, Math.min(v, c.length));
516
- const Y = v < c.length;
517
- n.style.display = Y ? "" : "none", n.classList.toggle("active", Y && this.expandedOpen), !Y && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((D, R) => {
517
+ const q = v < c.length;
518
+ o.style.display = q ? "" : "none", o.classList.toggle("active", q && this.expandedOpen), !q && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((D, R) => {
518
519
  R >= v && r.appendChild(D);
519
520
  });
520
521
  }, l = () => {
@@ -523,39 +524,39 @@ class pn {
523
524
  this.resizeObserver = new ResizeObserver(() => l()), this.resizeObserver.observe(t), l();
524
525
  }
525
526
  setExpandedOpen(t) {
526
- var e, n;
527
- this.expandedOpen = t, (e = this.expandedRow) == null || e.classList.toggle("show", t), (n = this.moreButton) == null || n.classList.toggle("active", t);
527
+ var e, o;
528
+ this.expandedOpen = t, (e = this.expandedRow) == null || e.classList.toggle("show", t), (o = this.moreButton) == null || o.classList.toggle("active", t);
528
529
  }
529
530
  /**
530
531
  * Append a toolbar button or group to a parent element
531
532
  */
532
533
  appendToolbarButton(t, e) {
533
534
  if (e.type === "separator") {
534
- const n = document.createElement("div");
535
- n.className = "editora-toolbar-separator", t.appendChild(n);
535
+ const o = document.createElement("div");
536
+ o.className = "editora-toolbar-separator", t.appendChild(o);
536
537
  } else if (e.type === "dropdown") {
537
- const n = this.createDropdown(e);
538
- t.appendChild(n);
538
+ const o = this.createDropdown(e);
539
+ t.appendChild(o);
539
540
  } else if (e.type === "inline-menu") {
540
- const n = this.createInlineMenu(e);
541
- t.appendChild(n);
541
+ const o = this.createInlineMenu(e);
542
+ t.appendChild(o);
542
543
  } else if (e.type === "group" && e.items && e.items.length) {
543
- const n = this.createGroupButton(e);
544
- t.appendChild(n);
544
+ const o = this.createGroupButton(e);
545
+ t.appendChild(o);
545
546
  } else if (e.type === "input") {
546
- const n = this.createInput(e);
547
- t.appendChild(n);
547
+ const o = this.createInput(e);
548
+ t.appendChild(o);
548
549
  } else {
549
- const n = this.createButton(e);
550
- t.appendChild(n);
550
+ const o = this.createButton(e);
551
+ t.appendChild(o);
551
552
  }
552
553
  }
553
554
  /**
554
555
  * Create a toolbar button element
555
556
  */
556
557
  createGroupButton(t) {
557
- const e = document.createElement("div"), n = t.label.toLowerCase().replace(/\s+/g, "-");
558
- if (e.className = `editora-toolbar-group-button ${n}`, e.title = t.label, t.icon)
558
+ const e = document.createElement("div"), o = t.label.toLowerCase().replace(/\s+/g, "-");
559
+ if (e.className = `editora-toolbar-group-button ${o}`, e.title = t.label, t.icon)
559
560
  if (t.icon.startsWith("<svg") && t.icon.endsWith("</svg>")) {
560
561
  const r = document.createElement("span");
561
562
  r.className = "editora-toolbar-icon", r.innerHTML = t.icon, e.appendChild(r);
@@ -563,7 +564,7 @@ class pn {
563
564
  e.innerHTML = t.icon;
564
565
  if (t.items && t.items.length) {
565
566
  const r = document.createElement("div");
566
- r.className = `editora-toolbar-group-items ${n}`, t.items.forEach((a) => {
567
+ r.className = `editora-toolbar-group-items ${o}`, t.items.forEach((a) => {
567
568
  this.appendToolbarButton(r, a);
568
569
  }), e.appendChild(r);
569
570
  }
@@ -574,8 +575,8 @@ class pn {
574
575
  */
575
576
  createInput(t) {
576
577
  const e = document.createElement("input");
577
- return e.className = `editora-toolbar-input ${t.label.toLowerCase().replace(/\s+/g, "-")}`, e.type = "text", e.title = t.label, e.setAttribute("aria-label", t.label), e.placeholder = t.placeholder || "", t.command && e.setAttribute("data-command", t.command), t.active && e.classList.add("active"), t.disabled && (e.disabled = !0), e.addEventListener("click", (n) => {
578
- n.preventDefault(), this.setLastCommandTrigger(e, t.command), this.commandHandler && t.command && this.commandHandler(t.command);
578
+ return e.className = `editora-toolbar-input ${t.label.toLowerCase().replace(/\s+/g, "-")}`, e.type = "text", e.title = t.label, e.setAttribute("aria-label", t.label), e.placeholder = t.placeholder || "", t.command && e.setAttribute("data-command", t.command), t.active && e.classList.add("active"), t.disabled && (e.disabled = !0), e.addEventListener("click", (o) => {
579
+ o.preventDefault(), this.setLastCommandTrigger(e, t.command), this.commandHandler && t.command && this.commandHandler(t.command);
579
580
  }), e;
580
581
  }
581
582
  /**
@@ -585,32 +586,83 @@ class pn {
585
586
  const e = document.createElement("button");
586
587
  if (e.className = "editora-toolbar-button", e.type = "button", e.title = t.label, t.command && e.setAttribute("data-command", t.command), t.icon)
587
588
  if (t.icon.startsWith("<svg") && t.icon.endsWith("</svg>")) {
588
- const n = document.createElement("span");
589
- n.className = "editora-toolbar-icon", n.innerHTML = t.icon, e.appendChild(n);
589
+ const o = document.createElement("span");
590
+ o.className = "editora-toolbar-icon", o.innerHTML = t.icon, e.appendChild(o);
590
591
  } else
591
592
  e.innerHTML = t.icon;
592
593
  else
593
594
  e.textContent = t.label;
594
- return t.active && e.classList.add("active"), t.disabled && (e.disabled = !0), e.addEventListener("click", (n) => {
595
- n.preventDefault(), this.commandHandler && t.command && this.commandHandler(t.command);
595
+ return t.active && e.classList.add("active"), t.disabled && (e.disabled = !0), e.addEventListener("click", (o) => {
596
+ o.preventDefault(), this.commandHandler && t.command && this.commandHandler(t.command);
596
597
  }), e;
597
598
  }
599
+ /**
600
+ * What a toolbar menu needs besides its look, so it can be used without a mouse: the trigger says it opens a menu
601
+ * and whether it is open, the menu and its items have menu roles, and the keyboard works in it. Enter, Space or an
602
+ * arrow key on the trigger opens it and moves the focus to the first (or, with ArrowUp, the last) item; arrows,
603
+ * Home and End move between items; Escape closes it and gives the focus back to the trigger; Tab closes it. A
604
+ * mouse click leaves the focus alone, so the editor keeps its selection.
605
+ */
606
+ makeMenuAccessible(t, e, o, r) {
607
+ e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", "false"), o.setAttribute("role", "menu"), o.setAttribute("aria-label", r), o.querySelectorAll(".editora-toolbar-dropdown-item").forEach((m) => {
608
+ m.setAttribute("role", "menuitem"), m.tabIndex = -1;
609
+ });
610
+ const a = () => Array.from(o.querySelectorAll('[role="menuitem"]')), l = () => o.style.display === "block", c = new MutationObserver(() => {
611
+ e.setAttribute("aria-expanded", l() ? "true" : "false");
612
+ });
613
+ c.observe(o, { attributes: !0, attributeFilter: ["style"] });
614
+ const f = t._cleanupDropdown;
615
+ t._cleanupDropdown = () => {
616
+ c.disconnect(), f == null || f();
617
+ }, e.addEventListener("click", (m) => {
618
+ var g;
619
+ m.detail === 0 && l() && ((g = a()[0]) == null || g.focus());
620
+ }), e.addEventListener("keydown", (m) => {
621
+ var k;
622
+ if (m.key !== "ArrowDown" && m.key !== "ArrowUp") return;
623
+ m.preventDefault(), l() || e.click();
624
+ const g = a();
625
+ (k = m.key === "ArrowUp" ? g[g.length - 1] : g[0]) == null || k.focus();
626
+ }), o.addEventListener("keydown", (m) => {
627
+ const g = a();
628
+ if (g.length === 0) return;
629
+ const k = g.indexOf(document.activeElement), T = (w) => {
630
+ m.preventDefault(), g[(w + g.length) % g.length].focus();
631
+ };
632
+ switch (m.key) {
633
+ case "ArrowDown":
634
+ return T(k + 1);
635
+ case "ArrowUp":
636
+ return T(k < 0 ? g.length - 1 : k - 1);
637
+ case "Home":
638
+ return T(0);
639
+ case "End":
640
+ return T(g.length - 1);
641
+ case "Escape":
642
+ m.preventDefault(), m.stopPropagation(), o.style.display = "none", e.focus();
643
+ return;
644
+ case "Tab":
645
+ o.style.display = "none";
646
+ return;
647
+ }
648
+ });
649
+ }
598
650
  /**
599
651
  * Create a dropdown element
600
652
  */
601
653
  createDropdown(t) {
602
654
  const e = document.createElement("div");
603
655
  e.className = "editora-toolbar-dropdown";
604
- const n = document.createElement("button");
605
- n.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", n.type = "button", n.textContent = t.label;
656
+ const o = document.createElement("button");
657
+ o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
606
658
  const r = document.createElement("div");
607
659
  r.className = "editora-toolbar-dropdown-menu", r.style.display = "none", t.options && t.options.forEach((c) => {
608
660
  const f = document.createElement("button");
609
661
  f.className = "editora-toolbar-dropdown-item", f.type = "button", f.textContent = c.label, f.setAttribute("data-value", c.value), f.addEventListener("click", (m) => {
610
- m.preventDefault(), this.setLastCommandTrigger(n, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), r.style.display = "none";
662
+ m.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), r.style.display = "none";
611
663
  }), r.appendChild(f);
612
- }), n.addEventListener("click", (c) => {
613
- c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(n, t.command);
664
+ }), o.addEventListener("click", (c) => {
665
+ c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
614
666
  const f = r.style.display === "block";
615
667
  r.style.display = f ? "none" : "block";
616
668
  });
@@ -621,7 +673,7 @@ class pn {
621
673
  };
622
674
  return document.addEventListener("mousedown", a, !0), document.addEventListener("keydown", l), e._cleanupDropdown = () => {
623
675
  document.removeEventListener("mousedown", a, !0), document.removeEventListener("keydown", l);
624
- }, e.appendChild(n), e.appendChild(r), e;
676
+ }, e.appendChild(o), e.appendChild(r), this.makeMenuAccessible(e, o, r, t.label), e;
625
677
  }
626
678
  /**
627
679
  * Create an inline menu element (like dropdown but triggered by button click)
@@ -629,29 +681,29 @@ class pn {
629
681
  createInlineMenu(t) {
630
682
  const e = document.createElement("div");
631
683
  e.className = "editora-toolbar-dropdown editora-toolbar-inline-menu";
632
- const n = document.createElement("button");
633
- if (n.className = "editora-toolbar-button", n.type = "button", n.title = t.label, t.icon)
684
+ const o = document.createElement("button");
685
+ if (o.className = "editora-toolbar-button", o.type = "button", o.title = t.label, t.icon)
634
686
  if (t.icon.startsWith("<svg") && t.icon.endsWith("</svg>")) {
635
687
  const c = document.createElement("span");
636
- c.className = "editora-toolbar-icon", c.innerHTML = t.icon, n.appendChild(c);
688
+ c.className = "editora-toolbar-icon", c.innerHTML = t.icon, o.appendChild(c);
637
689
  } else
638
- n.innerHTML = t.icon;
690
+ o.innerHTML = t.icon;
639
691
  else
640
- n.textContent = t.label;
692
+ o.textContent = t.label;
641
693
  const r = document.createElement("div");
642
694
  r.className = "editora-toolbar-dropdown-menu", r.style.display = "none", t.options && t.options.forEach((c) => {
643
695
  const f = document.createElement("button");
644
696
  f.className = "editora-toolbar-dropdown-item", f.type = "button", f.textContent = c.label, f.setAttribute("data-value", c.value), f.addEventListener("click", (m) => {
645
- m.preventDefault(), m.stopPropagation(), this.setLastCommandTrigger(n, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), r.style.display = "none";
697
+ m.preventDefault(), m.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), r.style.display = "none";
646
698
  }), r.appendChild(f);
647
- }), n.addEventListener("click", (c) => {
699
+ }), o.addEventListener("click", (c) => {
648
700
  var m;
649
- c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(n, t.command);
701
+ c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
650
702
  const f = (m = this.container) == null ? void 0 : m.querySelectorAll(
651
703
  ".editora-toolbar-dropdown-menu"
652
704
  );
653
- f == null || f.forEach((E) => {
654
- E !== r && (E.style.display = "none");
705
+ f == null || f.forEach((g) => {
706
+ g !== r && (g.style.display = "none");
655
707
  }), r.style.display = r.style.display === "none" ? "block" : "none";
656
708
  });
657
709
  const a = (c) => {
@@ -661,7 +713,7 @@ class pn {
661
713
  };
662
714
  return document.addEventListener("mousedown", a, !0), document.addEventListener("keydown", l), e._cleanupDropdown = () => {
663
715
  document.removeEventListener("mousedown", a, !0), document.removeEventListener("keydown", l);
664
- }, e.appendChild(n), e.appendChild(r), e;
716
+ }, e.appendChild(o), e.appendChild(r), this.makeMenuAccessible(e, o, r, t.label), e;
665
717
  }
666
718
  /**
667
719
  * Get default toolbar string if none provided
@@ -674,18 +726,18 @@ class pn {
674
726
  */
675
727
  updateButtonState(t, e) {
676
728
  if (!this.container) return;
677
- const n = this.container.querySelector(
729
+ const o = this.container.querySelector(
678
730
  `[data-command="${t}"]`
679
731
  );
680
- n && (e.active !== void 0 && n.classList.toggle("active", e.active), e.disabled !== void 0 && (n.disabled = e.disabled));
732
+ o && (e.active !== void 0 && o.classList.toggle("active", e.active), e.disabled !== void 0 && (o.disabled = e.disabled));
681
733
  }
682
734
  /**
683
735
  * Destroy toolbar
684
736
  */
685
737
  destroy() {
686
738
  var t;
687
- this.container && (this.container.querySelectorAll(".editora-toolbar-dropdown").forEach((n) => {
688
- const r = n._cleanupDropdown;
739
+ this.container && (this.container.querySelectorAll(".editora-toolbar-dropdown").forEach((o) => {
740
+ const r = o._cleanupDropdown;
689
741
  r && r();
690
742
  }), this.container.innerHTML = ""), (t = this.resizeObserver) == null || t.disconnect(), this.resizeObserver = void 0, this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), document.removeEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0), this.itemsContainer = void 0, this.moreButton = void 0, this.expandedRow = void 0, this.commandHandler = void 0;
691
743
  }
@@ -759,21 +811,21 @@ class hn {
759
811
  t.className = "editora-statusbar-left";
760
812
  const e = document.createElement("div");
761
813
  e.className = "editora-statusbar-right";
762
- const n = [];
814
+ const o = [];
763
815
  if (this.statusInfo.selectionInfo) {
764
816
  const a = this.statusInfo.selectionInfo;
765
- a.startLine === a.endLine && a.startColumn === a.endColumn ? n.push(`Ln ${a.startLine}, Col ${a.startColumn}`) : (a.startLine === a.endLine ? n.push(`Ln ${a.startLine}, Col ${a.startColumn}-${a.endColumn}`) : n.push(`Ln ${a.startLine}:${a.startColumn} - ${a.endLine}:${a.endColumn}`), n.push(`${a.selectedChars} chars selected`));
817
+ a.startLine === a.endLine && a.startColumn === a.endColumn ? o.push(`Ln ${a.startLine}, Col ${a.startColumn}`) : (a.startLine === a.endLine ? o.push(`Ln ${a.startLine}, Col ${a.startColumn}-${a.endColumn}`) : o.push(`Ln ${a.startLine}:${a.startColumn} - ${a.endLine}:${a.endColumn}`), o.push(`${a.selectedChars} chars selected`));
766
818
  } else if (this.statusInfo.cursorPosition) {
767
819
  const a = this.statusInfo.cursorPosition;
768
- n.push(`Ln ${a.line}, Col ${a.column}`);
820
+ o.push(`Ln ${a.line}, Col ${a.column}`);
769
821
  }
770
- this.statusInfo.language && n.push(this.statusInfo.language);
822
+ this.statusInfo.language && o.push(this.statusInfo.language);
771
823
  const r = [];
772
824
  this.statusInfo.wordCount !== void 0 && r.push(`${this.statusInfo.wordCount} words`), this.statusInfo.charCount !== void 0 && r.push(`${this.statusInfo.charCount} chars`), this.statusInfo.lineCount !== void 0 && r.push(`${this.statusInfo.lineCount} lines`), this.statusInfo.custom && Object.entries(this.statusInfo.custom).forEach(([a, l]) => {
773
825
  r.push(`${a}: ${l}`);
774
- }), n.forEach((a, l) => {
826
+ }), o.forEach((a, l) => {
775
827
  const c = document.createElement("span");
776
- if (c.className = "editora-statusbar-item", c.textContent = a, t.appendChild(c), l < n.length - 1) {
828
+ if (c.className = "editora-statusbar-item", c.textContent = a, t.appendChild(c), l < o.length - 1) {
777
829
  const f = document.createElement("span");
778
830
  f.className = "editora-statusbar-separator", f.textContent = "|", t.appendChild(f);
779
831
  }
@@ -792,50 +844,50 @@ class hn {
792
844
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
793
845
  }
794
846
  }
795
- function mn(o, t) {
796
- const e = o.textContent || "", n = gn(o, t.startContainer, t.startOffset), a = e.substring(0, n).split(`
847
+ function mn(n, t) {
848
+ const e = n.textContent || "", o = gn(n, t.startContainer, t.startOffset), a = e.substring(0, o).split(`
797
849
  `), l = a.length, c = a[a.length - 1].length + 1;
798
850
  return { line: l, column: c };
799
851
  }
800
- function gn(o, t, e) {
852
+ function gn(n, t, e) {
801
853
  var l;
802
- let n = 0;
854
+ let o = 0;
803
855
  const r = document.createTreeWalker(
804
- o,
856
+ n,
805
857
  NodeFilter.SHOW_TEXT,
806
858
  null
807
859
  );
808
860
  let a = r.firstChild();
809
861
  for (; a; ) {
810
862
  if (a === t) {
811
- n += e;
863
+ o += e;
812
864
  break;
813
- } else a.nodeType === Node.TEXT_NODE && (n += ((l = a.textContent) == null ? void 0 : l.length) || 0);
865
+ } else a.nodeType === Node.TEXT_NODE && (o += ((l = a.textContent) == null ? void 0 : l.length) || 0);
814
866
  a = r.nextNode();
815
867
  }
816
- return n;
868
+ return o;
817
869
  }
818
- function bn(o) {
819
- var n, r;
820
- const t = o.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
870
+ function bn(n) {
871
+ var o, r;
872
+ const t = n.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
821
873
  let e = 1;
822
874
  if (t.length > 0) {
823
875
  e = t.length;
824
876
  const a = t[t.length - 1];
825
- (a.tagName === "BR" || ((n = a.innerHTML) == null ? void 0 : n.trim()) === "" || ((r = a.textContent) == null ? void 0 : r.trim()) === "") && e++;
877
+ (a.tagName === "BR" || ((o = a.innerHTML) == null ? void 0 : o.trim()) === "" || ((r = a.textContent) == null ? void 0 : r.trim()) === "") && e++;
826
878
  } else {
827
- const l = (o.textContent || "").split(`
879
+ const l = (n.textContent || "").split(`
828
880
  `).length;
829
881
  e = Math.max(1, l);
830
882
  }
831
883
  return e;
832
884
  }
833
- function yn(o) {
834
- const t = o.trim() ? o.trim().split(/\s+/).length : 0, e = o.length;
885
+ function yn(n) {
886
+ const t = n.trim() ? n.trim().split(/\s+/).length : 0, e = n.length;
835
887
  return { words: t, chars: e };
836
888
  }
837
- function vn(o, t) {
838
- const e = o.toString();
889
+ function En(n, t) {
890
+ const e = n.toString();
839
891
  return {
840
892
  startLine: t.line,
841
893
  startColumn: t.column,
@@ -846,7 +898,7 @@ function vn(o, t) {
846
898
  selectedWords: e.trim().split(/\s+/).filter(Boolean).length
847
899
  };
848
900
  }
849
- class En {
901
+ class vn {
850
902
  constructor(t) {
851
903
  this.shortcuts = /* @__PURE__ */ new Map(), this.enabled = !0, this.isMac = typeof navigator != "undefined" && navigator.platform.toUpperCase().indexOf("MAC") >= 0, (t == null ? void 0 : t.enabled) === !1 && (this.enabled = !1), this.registerDefaultShortcuts(), t != null && t.shortcuts && t.shortcuts.forEach((e) => this.registerShortcut(e)), t != null && t.customShortcuts && Object.values(t.customShortcuts).forEach((e) => {
852
904
  this.registerShortcut(e);
@@ -1133,7 +1185,7 @@ class En {
1133
1185
  }
1134
1186
  handleKeyDown(t, e) {
1135
1187
  if (!this.enabled) return !1;
1136
- const n = this.getEventKey(t), r = this.shortcuts.get(n);
1188
+ const o = this.getEventKey(t), r = this.shortcuts.get(o);
1137
1189
  return r ? (r.preventDefault !== !1 && (t.preventDefault(), t.stopPropagation()), e(r.command, r.params), !0) : !1;
1138
1190
  }
1139
1191
  enable() {
@@ -1154,8 +1206,8 @@ class En {
1154
1206
  getShortcutDescription(t) {
1155
1207
  const e = [];
1156
1208
  this.isMac ? (t.meta && e.push("⌘"), t.ctrl && e.push("⌃"), t.alt && e.push("⌥"), t.shift && e.push("⇧")) : (t.ctrl && e.push("Ctrl"), t.alt && e.push("Alt"), t.shift && e.push("Shift"));
1157
- const n = t.key.length === 1 ? t.key.toUpperCase() : t.key;
1158
- return e.push(n), e.join("+");
1209
+ const o = t.key.length === 1 ? t.key.toUpperCase() : t.key;
1210
+ return e.push(o), e.join("+");
1159
1211
  }
1160
1212
  getShortcutsHelp() {
1161
1213
  const t = this.getAllShortcuts(), e = /* @__PURE__ */ new Map();
@@ -1163,40 +1215,40 @@ class En {
1163
1215
  const a = this.getShortcutCategory(r.command);
1164
1216
  e.has(a) || e.set(a, []), e.get(a).push(r);
1165
1217
  });
1166
- let n = `# Keyboard Shortcuts
1218
+ let o = `# Keyboard Shortcuts
1167
1219
 
1168
1220
  `;
1169
1221
  return e.forEach((r, a) => {
1170
- n += `## ${a}
1222
+ o += `## ${a}
1171
1223
 
1172
1224
  `, r.forEach((l) => {
1173
1225
  const c = this.getShortcutDescription(l);
1174
- n += `- **${c}**: ${l.description || l.command}
1226
+ o += `- **${c}**: ${l.description || l.command}
1175
1227
  `;
1176
- }), n += `
1228
+ }), o += `
1177
1229
  `;
1178
- }), n;
1230
+ }), o;
1179
1231
  }
1180
1232
  getShortcutCategory(t) {
1181
1233
  return t.includes("toggle") && (t.includes("Bold") || t.includes("Italic") || t.includes("Underline") || t.includes("Strike") || t.includes("Code") || t.includes("Super") || t.includes("Sub")) ? "Text Formatting" : t.includes("Heading") || t.includes("Paragraph") ? "Block Formatting" : t.includes("List") || t.includes("Checklist") ? "Lists" : t.includes("Alignment") || t.includes("Indent") ? "Alignment & Indentation" : t.includes("undo") || t.includes("redo") ? "History" : t.includes("insert") ? "Insert" : t.includes("find") || t.includes("replace") ? "Find & Replace" : t.includes("Accessibility") || t.includes("spell") ? "Tools" : "Other";
1182
1234
  }
1183
1235
  }
1184
- function ro(o, t) {
1185
- (t == null || t > o.length) && (t = o.length);
1186
- for (var e = 0, n = Array(t); e < t; e++) n[e] = o[e];
1187
- return n;
1236
+ function ro(n, t) {
1237
+ (t == null || t > n.length) && (t = n.length);
1238
+ for (var e = 0, o = Array(t); e < t; e++) o[e] = n[e];
1239
+ return o;
1188
1240
  }
1189
- function wn(o) {
1190
- if (Array.isArray(o)) return o;
1241
+ function wn(n) {
1242
+ if (Array.isArray(n)) return n;
1191
1243
  }
1192
- function kn(o, t) {
1193
- var e = o == null ? null : typeof Symbol != "undefined" && o[Symbol.iterator] || o["@@iterator"];
1244
+ function kn(n, t) {
1245
+ var e = n == null ? null : typeof Symbol != "undefined" && n[Symbol.iterator] || n["@@iterator"];
1194
1246
  if (e != null) {
1195
- var n, r, a, l, c = [], f = !0, m = !1;
1247
+ var o, r, a, l, c = [], f = !0, m = !1;
1196
1248
  try {
1197
- if (a = (e = e.call(o)).next, t !== 0) for (; !(f = (n = a.call(e)).done) && (c.push(n.value), c.length !== t); f = !0) ;
1198
- } catch (E) {
1199
- m = !0, r = E;
1249
+ if (a = (e = e.call(n)).next, t !== 0) for (; !(f = (o = a.call(e)).done) && (c.push(o.value), c.length !== t); f = !0) ;
1250
+ } catch (g) {
1251
+ m = !0, r = g;
1200
1252
  } finally {
1201
1253
  try {
1202
1254
  if (!f && e.return != null && (l = e.return(), Object(l) !== l)) return;
@@ -1211,17 +1263,17 @@ function Tn() {
1211
1263
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1212
1264
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1213
1265
  }
1214
- function Cn(o, t) {
1215
- return wn(o) || kn(o, t) || xn(o, t) || Tn();
1266
+ function Cn(n, t) {
1267
+ return wn(n) || kn(n, t) || An(n, t) || Tn();
1216
1268
  }
1217
- function xn(o, t) {
1218
- if (o) {
1219
- if (typeof o == "string") return ro(o, t);
1220
- var e = {}.toString.call(o).slice(8, -1);
1221
- return e === "Object" && o.constructor && (e = o.constructor.name), e === "Map" || e === "Set" ? Array.from(o) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ro(o, t) : void 0;
1269
+ function An(n, t) {
1270
+ if (n) {
1271
+ if (typeof n == "string") return ro(n, t);
1272
+ var e = {}.toString.call(n).slice(8, -1);
1273
+ return e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set" ? Array.from(n) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ro(n, t) : void 0;
1222
1274
  }
1223
1275
  }
1224
- const So = Object.entries, ao = Object.setPrototypeOf, An = Object.isFrozen, Sn = Object.getPrototypeOf, _n = Object.getOwnPropertyDescriptor;
1276
+ const So = Object.entries, ao = Object.setPrototypeOf, xn = Object.isFrozen, Sn = Object.getPrototypeOf, _n = Object.getOwnPropertyDescriptor;
1225
1277
  let M = Object.freeze, I = Object.seal, gt = Object.create, _o = typeof Reflect != "undefined" && Reflect, ke = _o.apply, Te = _o.construct;
1226
1278
  M || (M = function(t) {
1227
1279
  return t;
@@ -1230,99 +1282,99 @@ I || (I = function(t) {
1230
1282
  return t;
1231
1283
  });
1232
1284
  ke || (ke = function(t, e) {
1233
- for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), a = 2; a < n; a++) r[a - 2] = arguments[a];
1285
+ for (var o = arguments.length, r = new Array(o > 2 ? o - 2 : 0), a = 2; a < o; a++) r[a - 2] = arguments[a];
1234
1286
  return t.apply(e, r);
1235
1287
  });
1236
1288
  Te || (Te = function(t) {
1237
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) n[r - 1] = arguments[r];
1238
- return new t(...n);
1289
+ for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) o[r - 1] = arguments[r];
1290
+ return new t(...o);
1239
1291
  });
1240
- const rt = L(Array.prototype.forEach), Ln = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), Tt = L(Array.prototype.push), Mn = L(Array.prototype.splice), bt = Array.isArray, _t = L(String.prototype.toLowerCase), he = L(String.prototype.toString), lo = L(String.prototype.match), Ct = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), Pn = L(Number.prototype.toString), Dn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), po = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), xt = L(Object.prototype.toString), P = L(RegExp.prototype.test), Z = On(TypeError);
1241
- function L(o) {
1292
+ const rt = L(Array.prototype.forEach), Ln = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), Tt = L(Array.prototype.push), Mn = L(Array.prototype.splice), bt = Array.isArray, _t = L(String.prototype.toLowerCase), he = L(String.prototype.toString), lo = L(String.prototype.match), Ct = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), Pn = L(Number.prototype.toString), Dn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), po = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), At = L(Object.prototype.toString), P = L(RegExp.prototype.test), Z = On(TypeError);
1293
+ function L(n) {
1242
1294
  return function(t) {
1243
1295
  t instanceof RegExp && (t.lastIndex = 0);
1244
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) n[r - 1] = arguments[r];
1245
- return ke(o, t, n);
1296
+ for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) o[r - 1] = arguments[r];
1297
+ return ke(n, t, o);
1246
1298
  };
1247
1299
  }
1248
- function On(o) {
1300
+ function On(n) {
1249
1301
  return function() {
1250
- for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++) e[n] = arguments[n];
1251
- return Te(o, e);
1302
+ for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
1303
+ return Te(n, e);
1252
1304
  };
1253
1305
  }
1254
- function y(o, t) {
1306
+ function E(n, t) {
1255
1307
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _t;
1256
- if (ao && ao(o, null), !bt(t)) return o;
1257
- let n = t.length;
1258
- for (; n--; ) {
1259
- let r = t[n];
1308
+ if (ao && ao(n, null), !bt(t)) return n;
1309
+ let o = t.length;
1310
+ for (; o--; ) {
1311
+ let r = t[o];
1260
1312
  if (typeof r == "string") {
1261
1313
  const a = e(r);
1262
- a !== r && (An(t) || (t[n] = a), r = a);
1314
+ a !== r && (xn(t) || (t[o] = a), r = a);
1263
1315
  }
1264
- o[r] = !0;
1316
+ n[r] = !0;
1265
1317
  }
1266
- return o;
1318
+ return n;
1267
1319
  }
1268
- function Rn(o) {
1269
- for (let t = 0; t < o.length; t++) z(o, t) || (o[t] = null);
1270
- return o;
1320
+ function Rn(n) {
1321
+ for (let t = 0; t < n.length; t++) z(n, t) || (n[t] = null);
1322
+ return n;
1271
1323
  }
1272
- function H(o) {
1324
+ function H(n) {
1273
1325
  const t = gt(null);
1274
- for (const n of So(o)) {
1275
- var e = Cn(n, 2);
1326
+ for (const o of So(n)) {
1327
+ var e = Cn(o, 2);
1276
1328
  const r = e[0], a = e[1];
1277
- z(o, r) && (bt(a) ? t[r] = Rn(a) : a && typeof a == "object" && a.constructor === Object ? t[r] = H(a) : t[r] = a);
1329
+ z(n, r) && (bt(a) ? t[r] = Rn(a) : a && typeof a == "object" && a.constructor === Object ? t[r] = H(a) : t[r] = a);
1278
1330
  }
1279
1331
  return t;
1280
1332
  }
1281
- function Nn(o) {
1282
- switch (typeof o) {
1333
+ function Nn(n) {
1334
+ switch (typeof n) {
1283
1335
  case "string":
1284
- return o;
1336
+ return n;
1285
1337
  case "number":
1286
- return Pn(o);
1338
+ return Pn(n);
1287
1339
  case "boolean":
1288
- return Dn(o);
1340
+ return Dn(n);
1289
1341
  case "bigint":
1290
- return uo ? uo(o) : "0";
1342
+ return uo ? uo(n) : "0";
1291
1343
  case "symbol":
1292
- return po ? po(o) : "Symbol()";
1344
+ return po ? po(n) : "Symbol()";
1293
1345
  case "undefined":
1294
- return xt(o);
1346
+ return At(n);
1295
1347
  case "function":
1296
1348
  case "object": {
1297
- if (o === null) return xt(o);
1298
- const t = o, e = j(t, "toString");
1349
+ if (n === null) return At(n);
1350
+ const t = n, e = j(t, "toString");
1299
1351
  if (typeof e == "function") {
1300
- const n = e(t);
1301
- return typeof n == "string" ? n : xt(n);
1352
+ const o = e(t);
1353
+ return typeof o == "string" ? o : At(o);
1302
1354
  }
1303
- return xt(o);
1355
+ return At(n);
1304
1356
  }
1305
1357
  default:
1306
- return xt(o);
1358
+ return At(n);
1307
1359
  }
1308
1360
  }
1309
- function j(o, t) {
1310
- for (; o !== null; ) {
1311
- const n = _n(o, t);
1312
- if (n) {
1313
- if (n.get) return L(n.get);
1314
- if (typeof n.value == "function") return L(n.value);
1361
+ function j(n, t) {
1362
+ for (; n !== null; ) {
1363
+ const o = _n(n, t);
1364
+ if (o) {
1365
+ if (o.get) return L(o.get);
1366
+ if (typeof o.value == "function") return L(o.value);
1315
1367
  }
1316
- o = Sn(o);
1368
+ n = Sn(n);
1317
1369
  }
1318
1370
  function e() {
1319
1371
  return null;
1320
1372
  }
1321
1373
  return e;
1322
1374
  }
1323
- function zn(o) {
1375
+ function zn(n) {
1324
1376
  try {
1325
- return P(o, ""), !0;
1377
+ return P(n, ""), !0;
1326
1378
  } catch (t) {
1327
1379
  return !1;
1328
1380
  }
@@ -1964,7 +2016,7 @@ const fo = M([
1964
2016
  "xlink:title",
1965
2017
  "xml:space",
1966
2018
  "xmlns:xlink"
1967
- ]), Hn = I(/{{[\w\W]*|^[\w\W]*}}/g), Un = I(/<%[\w\W]*|^[\w\W]*%>/g), jn = I(/\${[\w\W]*/g), Wn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), $n = I(/^aria-[\-\w]+$/), bo = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Gn = I(/^(?:\w+script|data):/i), Kn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Yn = I(/^html$/i), qn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), yo = I(/<[/\w!]/g), vo = I(/<[/\w]/g), Vn = I(/<\/no(script|embed|frames)/i), Xn = I(/\/>/i), F = {
2019
+ ]), Hn = I(/{{[\w\W]*|^[\w\W]*}}/g), Un = I(/<%[\w\W]*|^[\w\W]*%>/g), jn = I(/\${[\w\W]*/g), Wn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), $n = I(/^aria-[\-\w]+$/), bo = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Gn = I(/^(?:\w+script|data):/i), Kn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), qn = I(/^html$/i), Yn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), yo = I(/<[/\w!]/g), Eo = I(/<[/\w]/g), Vn = I(/<\/no(script|embed|frames)/i), Xn = I(/\/>/i), F = {
1968
2020
  element: 1,
1969
2021
  attribute: 2,
1970
2022
  text: 3,
@@ -1986,19 +2038,19 @@ const fo = M([
1986
2038
  "noframes",
1987
2039
  "plaintext",
1988
2040
  "noscript"
1989
- ], Zn = M(y({}, Lo)), Jn = (function() {
1990
- const o = {};
2041
+ ], Zn = M(E({}, Lo)), Jn = (function() {
2042
+ const n = {};
1991
2043
  return rt(Lo, (t) => {
1992
- o[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
1993
- }), M(o);
2044
+ n[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
2045
+ }), M(n);
1994
2046
  })(), Qn = function() {
1995
2047
  return typeof window == "undefined" ? null : window;
1996
2048
  }, ti = function(t, e) {
1997
2049
  if (typeof t != "object" || typeof t.createPolicy != "function") return null;
1998
- let n = null;
2050
+ let o = null;
1999
2051
  const r = "data-tt-policy-suffix";
2000
- e && e.hasAttribute(r) && (n = e.getAttribute(r));
2001
- const a = "dompurify" + (n ? "#" + n : "");
2052
+ e && e.hasAttribute(r) && (o = e.getAttribute(r));
2053
+ const a = "dompurify" + (o ? "#" + o : "");
2002
2054
  try {
2003
2055
  return t.createPolicy(a, {
2004
2056
  createHTML(l) {
@@ -2011,7 +2063,7 @@ const fo = M([
2011
2063
  } catch (l) {
2012
2064
  return console.warn("TrustedTypes policy " + a + " could not be created."), null;
2013
2065
  }
2014
- }, Eo = function() {
2066
+ }, vo = function() {
2015
2067
  return {
2016
2068
  afterSanitizeAttributes: [],
2017
2069
  afterSanitizeElements: [],
@@ -2023,23 +2075,23 @@ const fo = M([
2023
2075
  uponSanitizeElement: [],
2024
2076
  uponSanitizeShadowNode: []
2025
2077
  };
2026
- }, J = function(t, e, n, r) {
2027
- return z(t, e) && bt(t[e]) ? y(r.base ? H(r.base) : {}, t[e], r.transform) : n;
2028
- }, ve = function(t, e, n) {
2078
+ }, J = function(t, e, o, r) {
2079
+ return z(t, e) && bt(t[e]) ? E(r.base ? H(r.base) : {}, t[e], r.transform) : o;
2080
+ }, Ee = function(t, e, o) {
2029
2081
  const r = z(t, e) ? t[e] : void 0;
2030
- return r && typeof r == "object" ? H(r) : n();
2082
+ return r && typeof r == "object" ? H(r) : o();
2031
2083
  };
2032
2084
  function Mo() {
2033
- let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Qn();
2085
+ let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Qn();
2034
2086
  const t = (u) => Mo(u);
2035
- if (t.version = "3.4.16", t.removed = [], !o || !o.document || o.document.nodeType !== F.document || !o.Element)
2087
+ if (t.version = "3.4.16", t.removed = [], !n || !n.document || n.document.nodeType !== F.document || !n.Element)
2036
2088
  return t.isSupported = !1, t;
2037
- let e = o.document;
2038
- const n = e, r = n.currentScript;
2039
- o.DocumentFragment;
2040
- const a = o.HTMLTemplateElement, l = o.Node, c = o.Element, f = o.NodeFilter;
2041
- o.NamedNodeMap === void 0 && (o.NamedNodeMap || o.MozNamedAttrMap), o.HTMLFormElement;
2042
- const m = o.DOMParser, E = o.trustedTypes, x = c.prototype, A = j(x, "cloneNode"), w = j(x, "remove"), v = j(x, "removeAttributeNode"), Y = j(x, "nextSibling"), D = j(x, "childNodes"), R = j(x, "parentNode"), Ae = j(x, "shadowRoot"), Vt = j(x, "attributes"), tt = l && l.prototype ? j(l.prototype, "nodeType") : null, at = l && l.prototype ? j(l.prototype, "nodeName") : null, Lt = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(i) {
2089
+ let e = n.document;
2090
+ const o = e, r = o.currentScript;
2091
+ n.DocumentFragment;
2092
+ const a = n.HTMLTemplateElement, l = n.Node, c = n.Element, f = n.NodeFilter;
2093
+ n.NamedNodeMap === void 0 && (n.NamedNodeMap || n.MozNamedAttrMap), n.HTMLFormElement;
2094
+ const m = n.DOMParser, g = n.trustedTypes, k = c.prototype, T = j(k, "cloneNode"), w = j(k, "remove"), v = j(k, "removeAttributeNode"), q = j(k, "nextSibling"), D = j(k, "childNodes"), R = j(k, "parentNode"), xe = j(k, "shadowRoot"), Vt = j(k, "attributes"), tt = l && l.prototype ? j(l.prototype, "nodeType") : null, at = l && l.prototype ? j(l.prototype, "nodeName") : null, Lt = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(i) {
2043
2095
  return tt ? tt(i) : i.nodeType;
2044
2096
  }, Xt = function(i) {
2045
2097
  return at ? at(i) : i.nodeName;
@@ -2048,39 +2100,39 @@ function Mo() {
2048
2100
  const u = e.createElement("template");
2049
2101
  u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
2050
2102
  }
2051
- let N, et = "", Zt, Se = !1, vt = 0;
2103
+ let N, et = "", Zt, Se = !1, Et = 0;
2052
2104
  const _e = function() {
2053
- if (vt > 0) throw Z('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
2105
+ if (Et > 0) throw Z('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
2054
2106
  }, st = function(i) {
2055
- _e(), vt++;
2107
+ _e(), Et++;
2056
2108
  try {
2057
2109
  return N.createHTML(i);
2058
2110
  } finally {
2059
- vt--;
2111
+ Et--;
2060
2112
  }
2061
2113
  }, Do = function(i) {
2062
- _e(), vt++;
2114
+ _e(), Et++;
2063
2115
  try {
2064
2116
  return N.createScriptURL(i);
2065
2117
  } finally {
2066
- vt--;
2118
+ Et--;
2067
2119
  }
2068
2120
  }, Oo = function() {
2069
- return Se || (Zt = ti(E, r), Se = !0), Zt;
2070
- }, Mt = e, Jt = Mt.implementation, Le = Mt.createNodeIterator, Ro = Mt.createDocumentFragment, No = Mt.getElementsByTagName, zo = n.importNode;
2071
- let k = Eo();
2121
+ return Se || (Zt = ti(g, r), Se = !0), Zt;
2122
+ }, Mt = e, Jt = Mt.implementation, Le = Mt.createNodeIterator, Ro = Mt.createDocumentFragment, No = Mt.getElementsByTagName, zo = o.importNode;
2123
+ let C = vo();
2072
2124
  t.isSupported = typeof So == "function" && typeof R == "function" && Jt && Jt.createHTMLDocument !== void 0;
2073
- const Bo = Hn, Fo = Un, Ho = jn, Uo = Wn, jo = $n, Wo = Gn, Me = Kn, $o = qn;
2074
- let Ie = bo, T = null;
2075
- const Qt = y({}, [
2125
+ const Bo = Hn, Fo = Un, Ho = jn, Uo = Wn, jo = $n, Wo = Gn, Me = Kn, $o = Yn;
2126
+ let Ie = bo, A = null;
2127
+ const Qt = E({}, [
2076
2128
  ...fo,
2077
2129
  ...me,
2078
2130
  ...ge,
2079
2131
  ...be,
2080
2132
  ...ho
2081
2133
  ]);
2082
- let C = null;
2083
- const te = y({}, [
2134
+ let x = null;
2135
+ const te = E({}, [
2084
2136
  ...mo,
2085
2137
  ...ye,
2086
2138
  ...go,
@@ -2105,8 +2157,8 @@ function Mo() {
2105
2157
  enumerable: !0,
2106
2158
  value: !1
2107
2159
  }
2108
- })), Et = null, Pe = null;
2109
- const q = Object.seal(gt(null, {
2160
+ })), vt = null, Pe = null;
2161
+ const Y = Object.seal(gt(null, {
2110
2162
  tagCheck: {
2111
2163
  writable: !0,
2112
2164
  configurable: !1,
@@ -2123,7 +2175,7 @@ function Mo() {
2123
2175
  let De = !0, ee = !0, Oe = !1, Re = !0, V = !1, ot = !0, nt = !1, oe = !1, It = null, Pt = null, ne = !1, lt = !1, Dt = !1, Ot = !1, Ne = !0, ze = !1;
2124
2176
  const Be = "user-content-";
2125
2177
  let ie = !0, re = !1, ct = {}, dt = null;
2126
- const Fe = y({}, [
2178
+ const Fe = E({}, [
2127
2179
  "annotation-xml",
2128
2180
  "audio",
2129
2181
  "colgroup",
@@ -2152,7 +2204,7 @@ function Mo() {
2152
2204
  "xmp"
2153
2205
  ]);
2154
2206
  let He = null;
2155
- const Ue = y({}, [
2207
+ const Ue = E({}, [
2156
2208
  "audio",
2157
2209
  "video",
2158
2210
  "img",
@@ -2161,7 +2213,7 @@ function Mo() {
2161
2213
  "track"
2162
2214
  ]);
2163
2215
  let je = null;
2164
- const We = y({}, [
2216
+ const We = E({}, [
2165
2217
  "alt",
2166
2218
  "class",
2167
2219
  "for",
@@ -2178,7 +2230,7 @@ function Mo() {
2178
2230
  "xmlns"
2179
2231
  ]), Rt = "http://www.w3.org/1998/Math/MathML", Nt = "http://www.w3.org/2000/svg", G = "http://www.w3.org/1999/xhtml";
2180
2232
  let ut = G, ae = !1, se = null;
2181
- const Go = y({}, [
2233
+ const Go = E({}, [
2182
2234
  Rt,
2183
2235
  Nt,
2184
2236
  G
@@ -2189,10 +2241,10 @@ function Mo() {
2189
2241
  "ms",
2190
2242
  "mtext"
2191
2243
  ]);
2192
- let le = y({}, $e);
2244
+ let le = E({}, $e);
2193
2245
  const Ge = M(["annotation-xml"]);
2194
- let ce = y({}, Ge);
2195
- const Ko = y({}, [
2246
+ let ce = E({}, Ge);
2247
+ const Ko = E({}, [
2196
2248
  "title",
2197
2249
  "style",
2198
2250
  "font",
@@ -2200,26 +2252,26 @@ function Mo() {
2200
2252
  "script"
2201
2253
  ]);
2202
2254
  let wt = null;
2203
- const Yo = ["application/xhtml+xml", "text/html"], qo = "text/html";
2255
+ const qo = ["application/xhtml+xml", "text/html"], Yo = "text/html";
2204
2256
  let _ = null, pt = null;
2205
2257
  const Vo = e.createElement("form"), Ke = function(i) {
2206
2258
  return i instanceof RegExp || i instanceof Function;
2207
2259
  }, de = function() {
2208
2260
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2209
2261
  if (pt && pt === i) return;
2210
- (!i || typeof i != "object") && (i = {}), i = H(i), wt = Yo.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? qo : i.PARSER_MEDIA_TYPE, _ = wt === "application/xhtml+xml" ? he : _t, T = J(i, "ALLOWED_TAGS", Qt, { transform: _ }), C = J(i, "ALLOWED_ATTR", te, { transform: _ }), se = J(i, "ALLOWED_NAMESPACES", Go, { transform: he }), je = J(i, "ADD_URI_SAFE_ATTR", We, {
2262
+ (!i || typeof i != "object") && (i = {}), i = H(i), wt = qo.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Yo : i.PARSER_MEDIA_TYPE, _ = wt === "application/xhtml+xml" ? he : _t, A = J(i, "ALLOWED_TAGS", Qt, { transform: _ }), x = J(i, "ALLOWED_ATTR", te, { transform: _ }), se = J(i, "ALLOWED_NAMESPACES", Go, { transform: he }), je = J(i, "ADD_URI_SAFE_ATTR", We, {
2211
2263
  transform: _,
2212
2264
  base: We
2213
2265
  }), He = J(i, "ADD_DATA_URI_TAGS", Ue, {
2214
2266
  transform: _,
2215
2267
  base: Ue
2216
- }), dt = J(i, "FORBID_CONTENTS", Fe, { transform: _ }), Et = J(i, "FORBID_TAGS", H({}), { transform: _ }), Pe = J(i, "FORBID_ATTR", H({}), { transform: _ }), ct = z(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? H(i.USE_PROFILES) : i.USE_PROFILES : !1, De = i.ALLOW_ARIA_ATTR !== !1, ee = i.ALLOW_DATA_ATTR !== !1, Oe = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = i.SAFE_FOR_TEMPLATES || !1, ot = i.SAFE_FOR_XML !== !1, nt = i.WHOLE_DOCUMENT || !1, lt = i.RETURN_DOM || !1, Dt = i.RETURN_DOM_FRAGMENT || !1, Ot = i.RETURN_TRUSTED_TYPE || !1, ne = i.FORCE_BODY || !1, Ne = i.SANITIZE_DOM !== !1, ze = i.SANITIZE_NAMED_PROPS || !1, ie = i.KEEP_CONTENT !== !1, re = i.IN_PLACE || !1, Ie = zn(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : bo, ut = typeof i.NAMESPACE == "string" ? i.NAMESPACE : G, le = ve(i, "MATHML_TEXT_INTEGRATION_POINTS", () => y({}, $e)), ce = ve(i, "HTML_INTEGRATION_POINTS", () => y({}, Ge));
2217
- const s = ve(i, "CUSTOM_ELEMENT_HANDLING", () => gt(null));
2218
- if ($ = gt(null), z(s, "tagNameCheck") && Ke(s.tagNameCheck) && ($.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && ($.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && ($.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I($), V && (ee = !1), Dt && (lt = !0), ct && (T = y({}, ho), C = gt(null), ct.html === !0 && (y(T, fo), y(C, mo)), ct.svg === !0 && (y(T, me), y(C, ye), y(C, Wt)), ct.svgFilters === !0 && (y(T, ge), y(C, ye), y(C, Wt)), ct.mathMl === !0 && (y(T, be), y(C, go), y(C, Wt))), q.tagCheck = null, q.attributeCheck = null, z(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? q.tagCheck = i.ADD_TAGS : bt(i.ADD_TAGS) && (T === Qt && (T = H(T)), y(T, i.ADD_TAGS, _))), z(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? q.attributeCheck = i.ADD_ATTR : bt(i.ADD_ATTR) && (C === te && (C = H(C)), y(C, i.ADD_ATTR, _))), z(i, "ADD_FORBID_CONTENTS") && bt(i.ADD_FORBID_CONTENTS) && (dt === Fe && (dt = H(dt)), y(dt, i.ADD_FORBID_CONTENTS, _)), ie && (T["#text"] = !0), nt && y(T, [
2268
+ }), dt = J(i, "FORBID_CONTENTS", Fe, { transform: _ }), vt = J(i, "FORBID_TAGS", H({}), { transform: _ }), Pe = J(i, "FORBID_ATTR", H({}), { transform: _ }), ct = z(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? H(i.USE_PROFILES) : i.USE_PROFILES : !1, De = i.ALLOW_ARIA_ATTR !== !1, ee = i.ALLOW_DATA_ATTR !== !1, Oe = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = i.SAFE_FOR_TEMPLATES || !1, ot = i.SAFE_FOR_XML !== !1, nt = i.WHOLE_DOCUMENT || !1, lt = i.RETURN_DOM || !1, Dt = i.RETURN_DOM_FRAGMENT || !1, Ot = i.RETURN_TRUSTED_TYPE || !1, ne = i.FORCE_BODY || !1, Ne = i.SANITIZE_DOM !== !1, ze = i.SANITIZE_NAMED_PROPS || !1, ie = i.KEEP_CONTENT !== !1, re = i.IN_PLACE || !1, Ie = zn(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : bo, ut = typeof i.NAMESPACE == "string" ? i.NAMESPACE : G, le = Ee(i, "MATHML_TEXT_INTEGRATION_POINTS", () => E({}, $e)), ce = Ee(i, "HTML_INTEGRATION_POINTS", () => E({}, Ge));
2269
+ const s = Ee(i, "CUSTOM_ELEMENT_HANDLING", () => gt(null));
2270
+ if ($ = gt(null), z(s, "tagNameCheck") && Ke(s.tagNameCheck) && ($.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && ($.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && ($.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I($), V && (ee = !1), Dt && (lt = !0), ct && (A = E({}, ho), x = gt(null), ct.html === !0 && (E(A, fo), E(x, mo)), ct.svg === !0 && (E(A, me), E(x, ye), E(x, Wt)), ct.svgFilters === !0 && (E(A, ge), E(x, ye), E(x, Wt)), ct.mathMl === !0 && (E(A, be), E(x, go), E(x, Wt))), Y.tagCheck = null, Y.attributeCheck = null, z(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? Y.tagCheck = i.ADD_TAGS : bt(i.ADD_TAGS) && (A === Qt && (A = H(A)), E(A, i.ADD_TAGS, _))), z(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? Y.attributeCheck = i.ADD_ATTR : bt(i.ADD_ATTR) && (x === te && (x = H(x)), E(x, i.ADD_ATTR, _))), z(i, "ADD_FORBID_CONTENTS") && bt(i.ADD_FORBID_CONTENTS) && (dt === Fe && (dt = H(dt)), E(dt, i.ADD_FORBID_CONTENTS, _)), ie && (A["#text"] = !0), nt && E(A, [
2219
2271
  "html",
2220
2272
  "head",
2221
2273
  "body"
2222
- ]), T.table && (y(T, ["tbody"]), delete Et.tbody), i.TRUSTED_TYPES_POLICY) {
2274
+ ]), A.table && (E(A, ["tbody"]), delete vt.tbody), i.TRUSTED_TYPES_POLICY) {
2223
2275
  if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2224
2276
  if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2225
2277
  const d = N;
@@ -2231,16 +2283,16 @@ function Mo() {
2231
2283
  }
2232
2284
  } else i.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Oo()), N && typeof et == "string" && (et = st("")));
2233
2285
  M && M(i), pt = i;
2234
- }, Ye = y({}, [
2286
+ }, qe = E({}, [
2235
2287
  ...me,
2236
2288
  ...ge,
2237
2289
  ...Bn
2238
- ]), qe = y({}, [...be, ...Fn]), Xo = function(i, s, d) {
2239
- return s.namespaceURI === G ? i === "svg" : s.namespaceURI === Rt ? i === "svg" && (d === "annotation-xml" || le[d]) : !!Ye[i];
2290
+ ]), Ye = E({}, [...be, ...Fn]), Xo = function(i, s, d) {
2291
+ return s.namespaceURI === G ? i === "svg" : s.namespaceURI === Rt ? i === "svg" && (d === "annotation-xml" || le[d]) : !!qe[i];
2240
2292
  }, Zo = function(i, s, d) {
2241
- return s.namespaceURI === G ? i === "math" : s.namespaceURI === Nt ? i === "math" && ce[d] : !!qe[i];
2293
+ return s.namespaceURI === G ? i === "math" : s.namespaceURI === Nt ? i === "math" && ce[d] : !!Ye[i];
2242
2294
  }, Jo = function(i, s, d) {
2243
- return s.namespaceURI === Nt && !ce[d] || s.namespaceURI === Rt && !le[d] ? !1 : !qe[i] && (Ko[i] || !Ye[i]);
2295
+ return s.namespaceURI === Nt && !ce[d] || s.namespaceURI === Rt && !le[d] ? !1 : !Ye[i] && (Ko[i] || !qe[i]);
2244
2296
  }, Qo = function(i) {
2245
2297
  let s = R(i);
2246
2298
  (!s || !s.tagName) && (s = {
@@ -2275,14 +2327,14 @@ function Mo() {
2275
2327
  }), rt(p, (h) => {
2276
2328
  try {
2277
2329
  w(h);
2278
- } catch (g) {
2330
+ } catch (b) {
2279
2331
  }
2280
2332
  });
2281
2333
  }
2282
2334
  const d = Vt(i);
2283
2335
  if (d) for (let p = d.length - 1; p >= 0; --p) {
2284
- const h = d[p], g = h && h.name;
2285
- typeof g == "string" && Ve(i, h, g);
2336
+ const h = d[p], b = h && h.name;
2337
+ typeof b == "string" && Ve(i, h, b);
2286
2338
  }
2287
2339
  }, it = function(i, s, d) {
2288
2340
  if (!d) try {
@@ -2316,7 +2368,7 @@ function Mo() {
2316
2368
  if (s)
2317
2369
  for (let d = s.length - 1; d >= 0; --d) {
2318
2370
  const p = s[d], h = p && p.name;
2319
- typeof h != "string" || C[_(h)] || Ve(i, p, h);
2371
+ typeof h != "string" || x[_(h)] || Ve(i, p, h);
2320
2372
  }
2321
2373
  }, Bt = function(i) {
2322
2374
  const s = [i];
@@ -2333,41 +2385,41 @@ function Mo() {
2333
2385
  const s = [i];
2334
2386
  for (; s.length > 0; ) {
2335
2387
  const d = s.pop(), p = yt(d);
2336
- if (p === F.processingInstruction || p === F.comment && P(vo, d.data)) {
2388
+ if (p === F.processingInstruction || p === F.comment && P(Eo, d.data)) {
2337
2389
  try {
2338
2390
  w(d);
2339
- } catch (g) {
2391
+ } catch (b) {
2340
2392
  }
2341
2393
  continue;
2342
2394
  }
2343
2395
  if (p === F.element) {
2344
- const g = d, b = _(Xt(d));
2396
+ const b = d, y = _(Xt(d));
2345
2397
  try {
2346
- g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") && Xe("for", b) && g.removeAttribute("for");
2398
+ b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Xe("for", y) && b.removeAttribute("for");
2347
2399
  } catch (S) {
2348
2400
  }
2349
2401
  }
2350
2402
  const h = D(d);
2351
- if (h) for (let g = h.length - 1; g >= 0; --g) s.push(h[g]);
2403
+ if (h) for (let b = h.length - 1; b >= 0; --b) s.push(h[b]);
2352
2404
  }
2353
2405
  }, Ze = function(i) {
2354
2406
  let s = null, d = null;
2355
2407
  if (ne) i = "<remove></remove>" + i;
2356
2408
  else {
2357
- const g = lo(i, /^[\r\n\t ]+/);
2358
- d = g && g[0];
2409
+ const b = lo(i, /^[\r\n\t ]+/);
2410
+ d = b && b[0];
2359
2411
  }
2360
2412
  wt === "application/xhtml+xml" && ut === G && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
2361
2413
  const p = N ? st(i) : i;
2362
2414
  if (ut === G) try {
2363
2415
  s = new m().parseFromString(p, wt);
2364
- } catch (g) {
2416
+ } catch (b) {
2365
2417
  }
2366
2418
  if (!s || !s.documentElement) {
2367
2419
  s = Jt.createDocument(ut, "template", null);
2368
2420
  try {
2369
2421
  s.documentElement.innerHTML = ae ? et : p;
2370
- } catch (g) {
2422
+ } catch (b) {
2371
2423
  }
2372
2424
  }
2373
2425
  const h = s.body || s.documentElement;
@@ -2384,9 +2436,9 @@ function Mo() {
2384
2436
  let h = p.nextNode();
2385
2437
  for (; h; )
2386
2438
  h.data = Ft(h.data), h = p.nextNode();
2387
- const g = (s = i.querySelectorAll) === null || s === void 0 ? void 0 : s.call(i, "template");
2388
- g && rt(g, (b) => {
2389
- ft(b.content) && ue(b.content);
2439
+ const b = (s = i.querySelectorAll) === null || s === void 0 ? void 0 : s.call(i, "template");
2440
+ b && rt(b, (y) => {
2441
+ ft(y.content) && ue(y.content);
2390
2442
  });
2391
2443
  }, Ht = function(i) {
2392
2444
  const s = at ? at(i) : null;
@@ -2412,7 +2464,7 @@ function Mo() {
2412
2464
  });
2413
2465
  }
2414
2466
  const on = function(i, s) {
2415
- return !!(ot && i.hasChildNodes() && !kt(i.firstElementChild) && P(yo, i.textContent) && P(yo, i.innerHTML) || ot && i.namespaceURI === G && Zn[s] && (kt(i.firstElementChild) || typeof i.textContent == "string" && P(Jn[s], i.textContent)) || i.nodeType === F.processingInstruction || ot && i.nodeType === F.comment && P(vo, i.data));
2467
+ return !!(ot && i.hasChildNodes() && !kt(i.firstElementChild) && P(yo, i.textContent) && P(yo, i.innerHTML) || ot && i.namespaceURI === G && Zn[s] && (kt(i.firstElementChild) || typeof i.textContent == "string" && P(Jn[s], i.textContent)) || i.nodeType === F.processingInstruction || ot && i.nodeType === F.comment && P(Eo, i.data));
2416
2468
  }, Ut = function(i, s) {
2417
2469
  if (i instanceof RegExp) return P(i, s);
2418
2470
  if (i instanceof Function) {
@@ -2421,14 +2473,14 @@ function Mo() {
2421
2473
  }
2422
2474
  return !1;
2423
2475
  }, nn = function(i, s, d) {
2424
- if (!Et[s] && oo(s) && Ut($.tagNameCheck, s)) return !1;
2476
+ if (!vt[s] && oo(s) && Ut($.tagNameCheck, s)) return !1;
2425
2477
  if (ie && !dt[s]) {
2426
2478
  const p = R(i), h = D(i);
2427
2479
  if (h && p) {
2428
- const g = h.length;
2429
- for (let b = g - 1; b >= 0; --b) {
2430
- const S = i === d ? A(h[b], !0) : h[b];
2431
- p.insertBefore(S, Y(i));
2480
+ const b = h.length;
2481
+ for (let y = b - 1; y >= 0; --y) {
2482
+ const S = i === d ? T(h[y], !0) : h[y];
2483
+ p.insertBefore(S, q(i));
2432
2484
  }
2433
2485
  }
2434
2486
  }
@@ -2438,19 +2490,19 @@ function Mo() {
2438
2490
  }, ht = function(i, s) {
2439
2491
  return i === s || R(i) !== null ? !1 : (re && Bt(i), !0);
2440
2492
  }, to = function(i, s) {
2441
- if (K(k.beforeSanitizeElements, i, null), ht(i, s)) return !0;
2493
+ if (K(C.beforeSanitizeElements, i, null), ht(i, s)) return !0;
2442
2494
  if (Ht(i))
2443
2495
  return X(i), !0;
2444
2496
  const d = _(Xt(i));
2445
- if (T = Qe(k.uponSanitizeElement, T, Qt, It), K(k.uponSanitizeElement, i, {
2497
+ if (A = Qe(C.uponSanitizeElement, A, Qt, It), K(C.uponSanitizeElement, i, {
2446
2498
  tagName: d,
2447
- allowedTags: T
2499
+ allowedTags: A
2448
2500
  }), ht(i, s)) return !0;
2449
2501
  if (on(i, d))
2450
2502
  return X(i), !0;
2451
- if (Et[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !T[d]) {
2503
+ if (vt[d] || !(Y.tagCheck instanceof Function && Y.tagCheck(d)) && !A[d]) {
2452
2504
  const p = nn(i, d, s);
2453
- return p === !1 && (K(k.afterSanitizeElements, i, null), ht(i, s)) ? !0 : p;
2505
+ return p === !1 && (K(C.afterSanitizeElements, i, null), ht(i, s)) ? !0 : p;
2454
2506
  }
2455
2507
  if (yt(i) === F.element && !Qo(i) || (d === "noscript" || d === "noembed" || d === "noframes") && P(Vn, i.innerHTML))
2456
2508
  return X(i), !0;
@@ -2458,12 +2510,12 @@ function Mo() {
2458
2510
  const p = Ft(i.textContent);
2459
2511
  i.textContent !== p && (Tt(t.removed, { element: i.cloneNode() }), i.textContent = p);
2460
2512
  }
2461
- return K(k.afterSanitizeElements, i, null), ht(i, s);
2513
+ return K(C.afterSanitizeElements, i, null), ht(i, s);
2462
2514
  }, eo = function(i, s, d) {
2463
2515
  if (Pe[s] || Xe(s, i) || Ne && (s === "id" || s === "name") && (d in e || d in Vo)) return !1;
2464
- const p = C[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, i);
2516
+ const p = x[s] || Y.attributeCheck instanceof Function && Y.attributeCheck(s, i);
2465
2517
  return ee && P(Uo, s) || De && P(jo, s) ? !0 : p ? je[s] || P(Ie, Ct(d, Me, "")) || (s === "src" || s === "xlink:href" || s === "href") && i !== "script" && co(d, "data:") === 0 && He[i] || Oe && !P(Wo, Ct(d, Me, "")) ? !0 : !d : oo(i) && Ut($.tagNameCheck, i) && Ut($.attributeNameCheck, s, i) || s === "is" && $.allowCustomizedBuiltInElements && Ut($.tagNameCheck, d);
2466
- }, rn = y({}, [
2518
+ }, rn = E({}, [
2467
2519
  "annotation-xml",
2468
2520
  "color-profile",
2469
2521
  "font-face",
@@ -2475,7 +2527,7 @@ function Mo() {
2475
2527
  ]), oo = function(i) {
2476
2528
  return !rn[_t(i)] && P($o, i);
2477
2529
  }, an = function(i, s, d, p) {
2478
- if (N && typeof E == "object" && typeof E.getAttributeType == "function" && !d) switch (E.getAttributeType(i, s)) {
2530
+ if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(i, s)) {
2479
2531
  case "TrustedHTML":
2480
2532
  return st(p);
2481
2533
  case "TrustedScriptURL":
@@ -2489,56 +2541,56 @@ function Mo() {
2489
2541
  return it(s, i), !1;
2490
2542
  }
2491
2543
  }, no = function(i, s) {
2492
- if (K(k.beforeSanitizeAttributes, i, null), ht(i, s)) return;
2544
+ if (K(C.beforeSanitizeAttributes, i, null), ht(i, s)) return;
2493
2545
  const d = i.attributes;
2494
2546
  if (!d || Ht(i)) return;
2495
- C = Qe(k.uponSanitizeAttribute, C, te, Pt);
2547
+ x = Qe(C.uponSanitizeAttribute, x, te, Pt);
2496
2548
  const p = {
2497
2549
  attrName: "",
2498
2550
  attrValue: "",
2499
2551
  keepAttr: !0,
2500
- allowedAttributes: C,
2552
+ allowedAttributes: x,
2501
2553
  forceKeepAttr: void 0
2502
2554
  };
2503
2555
  let h = d.length;
2504
- const g = _(i.nodeName);
2556
+ const b = _(i.nodeName);
2505
2557
  for (; h--; ) {
2506
- const b = d[h], S = b.name, U = b.namespaceURI, B = b.value, mt = _(S), fe = B;
2558
+ const y = d[h], S = y.name, U = y.namespaceURI, B = y.value, mt = _(S), fe = B;
2507
2559
  let O = S === "value" ? fe : In(fe), io = !1;
2508
- if (p.attrName = mt, p.attrValue = O, p.keepAttr = !0, p.forceKeepAttr = void 0, K(k.uponSanitizeAttribute, i, p), O = p.attrValue, ze && (mt === "id" || mt === "name") && co(O, Be) !== 0 && (it(S, i, b), O = Be + O, io = !0), ot && P(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
2509
- it(S, i, b);
2560
+ if (p.attrName = mt, p.attrValue = O, p.keepAttr = !0, p.forceKeepAttr = void 0, K(C.uponSanitizeAttribute, i, p), O = p.attrValue, ze && (mt === "id" || mt === "name") && co(O, Be) !== 0 && (it(S, i, y), O = Be + O, io = !0), ot && P(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
2561
+ it(S, i, y);
2510
2562
  continue;
2511
2563
  }
2512
2564
  if (mt === "attributename" && lo(O, "href")) {
2513
- it(S, i, b);
2565
+ it(S, i, y);
2514
2566
  continue;
2515
2567
  }
2516
2568
  if (!p.forceKeepAttr) {
2517
2569
  if (!p.keepAttr) {
2518
- it(S, i, b);
2570
+ it(S, i, y);
2519
2571
  continue;
2520
2572
  }
2521
2573
  if (!Re && P(Xn, O)) {
2522
- it(S, i, b);
2574
+ it(S, i, y);
2523
2575
  continue;
2524
2576
  }
2525
- if (V && (O = Ft(O)), !eo(g, mt, O)) {
2526
- it(S, i, b);
2577
+ if (V && (O = Ft(O)), !eo(b, mt, O)) {
2578
+ it(S, i, y);
2527
2579
  continue;
2528
2580
  }
2529
- O = an(g, mt, U, O), O !== fe && sn(i, S, U, O) && io && so(t.removed);
2581
+ O = an(b, mt, U, O), O !== fe && sn(i, S, U, O) && io && so(t.removed);
2530
2582
  }
2531
2583
  }
2532
- K(k.afterSanitizeAttributes, i, null), ht(i, s);
2584
+ K(C.afterSanitizeAttributes, i, null), ht(i, s);
2533
2585
  }, jt = function(i) {
2534
2586
  let s = null;
2535
2587
  const d = Je(i);
2536
- for (K(k.beforeSanitizeShadowDOM, i, null); s = d.nextNode(); )
2537
- if (K(k.uponSanitizeShadowNode, s, null), to(s, i), no(s, i), ft(s.content) && jt(s.content), yt(s) === F.element) {
2538
- const p = Ae(s);
2588
+ for (K(C.beforeSanitizeShadowDOM, i, null); s = d.nextNode(); )
2589
+ if (K(C.uponSanitizeShadowNode, s, null), to(s, i), no(s, i), ft(s.content) && jt(s.content), yt(s) === F.element) {
2590
+ const p = xe(s);
2539
2591
  ft(p) && (pe(p), jt(p));
2540
2592
  }
2541
- K(k.afterSanitizeShadowDOM, i, null);
2593
+ K(C.afterSanitizeShadowDOM, i, null);
2542
2594
  }, pe = function(i) {
2543
2595
  const s = [{
2544
2596
  node: i,
@@ -2550,14 +2602,14 @@ function Mo() {
2550
2602
  jt(d.shadow);
2551
2603
  continue;
2552
2604
  }
2553
- const p = d.node, h = yt(p) === F.element, g = D(p);
2554
- if (g) for (let b = g.length - 1; b >= 0; --b) s.push({
2555
- node: g[b],
2605
+ const p = d.node, h = yt(p) === F.element, b = D(p);
2606
+ if (b) for (let y = b.length - 1; y >= 0; --y) s.push({
2607
+ node: b[y],
2556
2608
  shadow: null
2557
2609
  });
2558
2610
  if (h) {
2559
- const b = at ? at(p) : null;
2560
- if (typeof b == "string" && _(b) === "template") {
2611
+ const y = at ? at(p) : null;
2612
+ if (typeof y == "string" && _(y) === "template") {
2561
2613
  const S = p.content;
2562
2614
  ft(S) && s.push({
2563
2615
  node: S,
@@ -2566,12 +2618,12 @@ function Mo() {
2566
2618
  }
2567
2619
  }
2568
2620
  if (h) {
2569
- const b = Ae(p);
2570
- ft(b) && s.push({
2621
+ const y = xe(p);
2622
+ ft(y) && s.push({
2571
2623
  node: null,
2572
- shadow: b
2624
+ shadow: y
2573
2625
  }, {
2574
- node: b,
2626
+ node: y,
2575
2627
  shadow: null
2576
2628
  });
2577
2629
  }
@@ -2582,14 +2634,14 @@ function Mo() {
2582
2634
  if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !kt(u) && (u = Nn(u), typeof u != "string"))
2583
2635
  throw Z("dirty is not a string, aborting");
2584
2636
  if (!t.isSupported) return u;
2585
- oe ? (T = It, C = Pt) : de(i), (k.uponSanitizeElement.length > 0 || k.uponSanitizeAttribute.length > 0) && (T = H(T)), k.uponSanitizeAttribute.length > 0 && (C = H(C)), t.removed = [];
2586
- const g = re && typeof u != "string" && kt(u);
2587
- if (g) {
2637
+ oe ? (A = It, x = Pt) : de(i), (C.uponSanitizeElement.length > 0 || C.uponSanitizeAttribute.length > 0) && (A = H(A)), C.uponSanitizeAttribute.length > 0 && (x = H(x)), t.removed = [];
2638
+ const b = re && typeof u != "string" && kt(u);
2639
+ if (b) {
2588
2640
  en(u);
2589
2641
  const U = Xt(u);
2590
2642
  if (typeof U == "string") {
2591
2643
  const B = _(U);
2592
- if (!T[B] || Et[B])
2644
+ if (!A[B] || vt[B])
2593
2645
  throw zt(u), Z("root node is forbidden and cannot be sanitized in-place");
2594
2646
  }
2595
2647
  if (Ht(u))
@@ -2606,17 +2658,17 @@ function Mo() {
2606
2658
  if (s = Ze(u), !s) return lt ? null : Ot ? et : "";
2607
2659
  }
2608
2660
  s && ne && X(s.firstChild);
2609
- const b = g ? u : s;
2661
+ const y = b ? u : s;
2610
2662
  try {
2611
- const U = Je(b);
2663
+ const U = Je(y);
2612
2664
  for (; p = U.nextNode(); )
2613
- to(p, b), no(p, b), ft(p.content) && jt(p.content);
2665
+ to(p, y), no(p, y), ft(p.content) && jt(p.content);
2614
2666
  } catch (U) {
2615
- throw g && (zt(u), rt(t.removed, (B) => {
2667
+ throw b && (zt(u), rt(t.removed, (B) => {
2616
2668
  B.element && Bt(B.element);
2617
2669
  })), U;
2618
2670
  }
2619
- if (g) {
2671
+ if (b) {
2620
2672
  let U = !1;
2621
2673
  if (rt(t.removed, (B) => {
2622
2674
  B.element && (B.element === u && (U = !0), Bt(B.element));
@@ -2627,14 +2679,14 @@ function Mo() {
2627
2679
  if (V && ue(s), Dt)
2628
2680
  for (h = Ro.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
2629
2681
  else h = s;
2630
- return (C.shadowroot || C.shadowrootmode) && (h = zo.call(n, h, !0)), h;
2682
+ return (x.shadowroot || x.shadowrootmode) && (h = zo.call(o, h, !0)), h;
2631
2683
  }
2632
2684
  let S = nt ? s.outerHTML : s.innerHTML;
2633
- return nt && T["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && P(Yn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2685
+ return nt && A["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && P(qn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2634
2686
  ` + S), V && (S = Ft(S)), N && Ot ? st(S) : S;
2635
2687
  }, t.setConfig = function() {
2636
2688
  let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2637
- de(u), oe = !0, It = T, Pt = C;
2689
+ de(u), oe = !0, It = A, Pt = x;
2638
2690
  }, t.clearConfig = function() {
2639
2691
  pt = null, oe = !1, It = null, Pt = null, N = Zt, et = "";
2640
2692
  }, t.isValidAttribute = function(u, i, s) {
@@ -2642,19 +2694,19 @@ function Mo() {
2642
2694
  const d = _(u), p = _(i);
2643
2695
  return eo(d, p, s);
2644
2696
  }, t.addHook = function(u, i) {
2645
- typeof i == "function" && z(k, u) && Tt(k[u], i);
2697
+ typeof i == "function" && z(C, u) && Tt(C[u], i);
2646
2698
  }, t.removeHook = function(u, i) {
2647
- if (z(k, u)) {
2699
+ if (z(C, u)) {
2648
2700
  if (i !== void 0) {
2649
- const s = Ln(k[u], i);
2650
- return s === -1 ? void 0 : Mn(k[u], s, 1)[0];
2701
+ const s = Ln(C[u], i);
2702
+ return s === -1 ? void 0 : Mn(C[u], s, 1)[0];
2651
2703
  }
2652
- return so(k[u]);
2704
+ return so(C[u]);
2653
2705
  }
2654
2706
  }, t.removeHooks = function(u) {
2655
- z(k, u) && (k[u] = []);
2707
+ z(C, u) && (C[u] = []);
2656
2708
  }, t.removeAllHooks = function() {
2657
- k = Eo();
2709
+ C = vo();
2658
2710
  }, t;
2659
2711
  }
2660
2712
  var $t = Mo();
@@ -2694,6 +2746,9 @@ const ei = [
2694
2746
  "span",
2695
2747
  "div",
2696
2748
  "section",
2749
+ // A captioned image or video (the media manager's output). Neither carries behaviour of its own.
2750
+ "figure",
2751
+ "figcaption",
2697
2752
  "sup",
2698
2753
  "sub",
2699
2754
  "hr"
@@ -2722,78 +2777,83 @@ const ei = [
2722
2777
  // iframe actually usable (src, sizing, fullscreen, scrolling/border).
2723
2778
  iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
2724
2779
  }, ni = "data-editora-embed";
2725
- function ii(o) {
2726
- if (!o || /\s/.test(o.trim())) return !1;
2780
+ function ii(n) {
2781
+ if (!n || /\s/.test(n.trim())) return !1;
2727
2782
  try {
2728
- const t = new URL(o.trim());
2783
+ const t = new URL(n.trim());
2729
2784
  return (t.protocol === "https:" || t.protocol === "http:") && t.hostname.length > 0;
2730
2785
  } catch (t) {
2731
2786
  return !1;
2732
2787
  }
2733
2788
  }
2734
- function Io(o, t, e, n) {
2789
+ function Io(n, t, e, o) {
2735
2790
  if ((t == null ? void 0 : t.sanitize) === !1)
2736
- return o;
2791
+ return n;
2737
2792
  const r = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ei, a = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...r, ...e])) : r, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : oi, f = /* @__PURE__ */ new Set();
2738
- for (const x of Object.values(c))
2739
- for (const A of x) f.add(A);
2793
+ for (const k of Object.values(c))
2794
+ for (const T of k) f.add(T);
2740
2795
  const m = {
2741
2796
  ALLOWED_TAGS: a,
2742
2797
  ALLOWED_ATTR: Array.from(f)
2743
2798
  };
2744
- if (!n)
2745
- return $t.sanitize(o, m);
2746
- const E = a.includes("iframe");
2799
+ if (!o)
2800
+ return $t.sanitize(n, m);
2801
+ const g = a.includes("iframe");
2747
2802
  $t.addHook(
2748
2803
  "uponSanitizeElement",
2749
- (x, A) => {
2804
+ (k, T) => {
2750
2805
  var v;
2751
- if (A.tagName !== "iframe") return;
2752
- const w = x;
2753
- A.allowedTags.iframe = E || ((v = w.getAttribute) == null ? void 0 : v.call(w, ni)) === "true" && ii(w.getAttribute("src"));
2806
+ if (T.tagName !== "iframe") return;
2807
+ const w = k;
2808
+ T.allowedTags.iframe = g || ((v = w.getAttribute) == null ? void 0 : v.call(w, ni)) === "true" && ii(w.getAttribute("src"));
2754
2809
  }
2755
2810
  );
2756
2811
  try {
2757
- return $t.sanitize(o, m);
2812
+ return $t.sanitize(n, m);
2758
2813
  } finally {
2759
2814
  $t.removeHook("uponSanitizeElement");
2760
2815
  }
2761
2816
  }
2762
- function ri(o, t, e, n) {
2763
- return Io(o, t, n, !1);
2817
+ function ri(n, t, e, o) {
2818
+ return Io(n, t, o, !1);
2764
2819
  }
2765
- function ai(o, t, e) {
2766
- return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? o : ri(o, t);
2820
+ function ai(n, t, e) {
2821
+ return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? n : ri(n, t);
2767
2822
  }
2768
- function wo(o, t, e, n) {
2769
- return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? o : Io(o, t, n, !0);
2823
+ function wo(n, t, e, o) {
2824
+ return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? n : Io(n, t, o, !0);
2770
2825
  }
2771
- const si = ".resize-handle, .table-resize-handle", li = /resize-handle/;
2772
- function Po(o) {
2773
- if (!o || !li.test(o)) return o;
2826
+ const si = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", li = /resize-handle|data-rte-media-pending|rte-media/;
2827
+ function Po(n) {
2828
+ if (!n || !li.test(n)) return n;
2774
2829
  const t = document.createElement("template");
2775
- t.innerHTML = o;
2830
+ t.innerHTML = n;
2776
2831
  const e = /* @__PURE__ */ new Set();
2777
- return t.content.querySelectorAll(si).forEach((n) => {
2778
- const r = n.parentElement;
2779
- r && (r.tagName === "TD" || r.tagName === "TH") && e.add(r), n.remove();
2780
- }), e.forEach((n) => {
2832
+ return t.content.querySelectorAll(si).forEach((o) => {
2833
+ const r = o.parentElement;
2834
+ r && (r.tagName === "TD" || r.tagName === "TH") && e.add(r), o.remove();
2835
+ }), e.forEach((o) => {
2781
2836
  var r;
2782
- n.style.position === "relative" && (n.style.removeProperty("position"), (r = n.getAttribute("style")) != null && r.trim() || n.removeAttribute("style"));
2837
+ o.style.position === "relative" && (o.style.removeProperty("position"), (r = o.getAttribute("style")) != null && r.trim() || o.removeAttribute("style"));
2838
+ }), t.content.querySelectorAll("figure.rte-media").forEach((o) => {
2839
+ var a;
2840
+ o.removeAttribute("contenteditable");
2841
+ const r = o.querySelector(":scope > figcaption");
2842
+ r && (r.removeAttribute("contenteditable"), !((a = r.textContent) != null && a.trim()) && !r.querySelector("img, video, a") && r.remove());
2783
2843
  }), t.innerHTML;
2784
2844
  }
2785
- function At(o) {
2786
- return o ? Po(o.innerHTML) : "";
2845
+ function xt(n) {
2846
+ return n ? Po(n.innerHTML) : "";
2787
2847
  }
2788
- const qt = class qt {
2848
+ const Yt = class Yt {
2789
2849
  /**
2790
2850
  * Resolve configuration from multiple sources with priority
2791
2851
  */
2792
2852
  static resolve(t) {
2793
2853
  const e = {};
2794
2854
  if (Object.assign(e, this.EDITOR_DEFAULTS), t.pluginDefaults && Object.assign(e, t.pluginDefaults), t.attributes) {
2795
- const n = this.parseAttributes(t.attributes);
2796
- Object.assign(e, n);
2855
+ const o = this.parseAttributes(t.attributes);
2856
+ Object.assign(e, o);
2797
2857
  }
2798
2858
  return t.jsConfig && Object.assign(e, t.jsConfig), this.normalizeConfig(e);
2799
2859
  }
@@ -2810,7 +2870,7 @@ const qt = class qt {
2810
2870
  const l = typeof e.autosave == "object" && e.autosave ? { ...e.autosave } : {};
2811
2871
  e.autosaveEnabled !== void 0 && (l.enabled = !!e.autosaveEnabled), e.autosaveIntervalMs !== void 0 && (l.intervalMs = Number(e.autosaveIntervalMs)), e.autosaveStorageKey !== void 0 && (l.storageKey = e.autosaveStorageKey), e.autosaveProvider !== void 0 && (l.provider = e.autosaveProvider), e.autosaveApiUrl !== void 0 && (l.apiUrl = e.autosaveApiUrl), e.autosave = l;
2812
2872
  }
2813
- const n = {
2873
+ const o = {
2814
2874
  enabled: !1,
2815
2875
  intervalMs: 3e4,
2816
2876
  storageKey: "rte-autosave",
@@ -2819,17 +2879,17 @@ const qt = class qt {
2819
2879
  };
2820
2880
  if (typeof e.autosave == "boolean")
2821
2881
  e.autosave = {
2822
- ...n,
2882
+ ...o,
2823
2883
  enabled: e.autosave
2824
2884
  };
2825
2885
  else if (typeof e.autosave == "object" && e.autosave) {
2826
2886
  const l = {
2827
- ...n,
2887
+ ...o,
2828
2888
  ...e.autosave
2829
2889
  };
2830
- l.intervalMs === void 0 && l.interval !== void 0 && (l.intervalMs = Number(l.interval)), l.enabled === void 0 && (l.enabled = !0), (!Number.isFinite(l.intervalMs) || l.intervalMs <= 0) && (l.intervalMs = n.intervalMs), e.autosave = l;
2890
+ l.intervalMs === void 0 && l.interval !== void 0 && (l.intervalMs = Number(l.interval)), l.enabled === void 0 && (l.enabled = !0), (!Number.isFinite(l.intervalMs) || l.intervalMs <= 0) && (l.intervalMs = o.intervalMs), e.autosave = l;
2831
2891
  } else
2832
- e.autosave = n;
2892
+ e.autosave = o;
2833
2893
  if (e.languageLocale !== void 0 || e.languageDirection !== void 0) {
2834
2894
  const l = typeof e.language == "object" && e.language ? { ...e.language } : {};
2835
2895
  e.languageLocale !== void 0 && (l.locale = e.languageLocale), e.languageDirection !== void 0 && (l.direction = e.languageDirection), e.language = l;
@@ -2922,9 +2982,9 @@ const qt = class qt {
2922
2982
  */
2923
2983
  static parseAttributes(t) {
2924
2984
  const e = {};
2925
- for (const [n, r] of Object.entries(t)) {
2926
- const a = this.kebabToCamel(n);
2927
- e[a] = this.BOOLEAN_ATTRIBUTES.has(n) && (r === "" || r === n) ? !0 : this.parseAttributeValue(r);
2985
+ for (const [o, r] of Object.entries(t)) {
2986
+ const a = this.kebabToCamel(o);
2987
+ e[a] = this.BOOLEAN_ATTRIBUTES.has(o) && (r === "" || r === o) ? !0 : this.parseAttributeValue(r);
2928
2988
  }
2929
2989
  return e;
2930
2990
  }
@@ -2948,7 +3008,7 @@ const qt = class qt {
2948
3008
  * Convert kebab-case to camelCase
2949
3009
  */
2950
3010
  static kebabToCamel(t) {
2951
- return t.replace(/-([a-z])/g, (e, n) => n.toUpperCase());
3011
+ return t.replace(/-([a-z])/g, (e, o) => o.toUpperCase());
2952
3012
  }
2953
3013
  /**
2954
3014
  * Validate configuration
@@ -2971,13 +3031,13 @@ const qt = class qt {
2971
3031
  */
2972
3032
  static merge(...t) {
2973
3033
  const e = {};
2974
- for (const n of t)
2975
- for (const [r, a] of Object.entries(n))
3034
+ for (const o of t)
3035
+ for (const [r, a] of Object.entries(o))
2976
3036
  a != null && (typeof a == "object" && !Array.isArray(a) && e[r] ? e[r] = this.merge(e[r], a) : e[r] = a);
2977
3037
  return e;
2978
3038
  }
2979
3039
  };
2980
- qt.EDITOR_DEFAULTS = {
3040
+ Yt.EDITOR_DEFAULTS = {
2981
3041
  height: 400,
2982
3042
  width: "100%",
2983
3043
  readonly: !1,
@@ -3026,7 +3086,7 @@ qt.EDITOR_DEFAULTS = {
3026
3086
  sanitizeOnInput: !0
3027
3087
  },
3028
3088
  statusbar: !1
3029
- }, qt.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
3089
+ }, Yt.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
3030
3090
  "readonly",
3031
3091
  "disabled",
3032
3092
  "autofocus",
@@ -3046,34 +3106,34 @@ qt.EDITOR_DEFAULTS = {
3046
3106
  "security-sanitize-on-paste",
3047
3107
  "security-sanitize-on-input"
3048
3108
  ]);
3049
- let Ce = qt;
3109
+ let Ce = Yt;
3050
3110
  const ci = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}';
3051
3111
  let Gt;
3052
- const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", ko = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", pi = "Rich text editor", xe = /* @__PURE__ */ new Set();
3053
- let Q = null, Co = !1, Ee = null, we = null;
3054
- function xo(o) {
3055
- if (!(o instanceof HTMLElement)) return !1;
3056
- const t = o;
3112
+ const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", ko = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", pi = "Rich text editor", Ae = /* @__PURE__ */ new Set();
3113
+ let Q = null, Co = !1, ve = null, we = null;
3114
+ function Ao(n) {
3115
+ if (!(n instanceof HTMLElement)) return !1;
3116
+ const t = n;
3057
3117
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
3058
3118
  }
3059
- function fi(o) {
3060
- return o ? o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement : null;
3119
+ function fi(n) {
3120
+ return n ? n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement : null;
3061
3121
  }
3062
- function St(o) {
3063
- if (!o) return null;
3064
- if (xo(o))
3065
- return o;
3066
- const t = o.matches(ko) ? o : o.closest(ko);
3067
- return !t || !xo(t) ? null : t;
3122
+ function St(n) {
3123
+ if (!n) return null;
3124
+ if (Ao(n))
3125
+ return n;
3126
+ const t = n.matches(ko) ? n : n.closest(ko);
3127
+ return !t || !Ao(t) ? null : t;
3068
3128
  }
3069
3129
  function hi() {
3070
3130
  var r;
3071
3131
  if (typeof window == "undefined") return null;
3072
- const o = window[di];
3073
- if (o instanceof HTMLElement) {
3074
- const a = St(o);
3132
+ const n = window[di];
3133
+ if (n instanceof HTMLElement) {
3134
+ const a = St(n);
3075
3135
  if (a) return a;
3076
- const l = o.matches(To) ? o : o.querySelector(To);
3136
+ const l = n.matches(To) ? n : n.querySelector(To);
3077
3137
  if (l) {
3078
3138
  const c = St(l);
3079
3139
  if (c) return c;
@@ -3089,43 +3149,43 @@ function hi() {
3089
3149
  const a = St(e);
3090
3150
  if (a) return a;
3091
3151
  }
3092
- const n = (r = window.getSelection) == null ? void 0 : r.call(window);
3093
- if (n && n.rangeCount > 0) {
3094
- const a = St(fi(n.getRangeAt(0).startContainer));
3152
+ const o = (r = window.getSelection) == null ? void 0 : r.call(window);
3153
+ if (o && o.rangeCount > 0) {
3154
+ const a = St(fi(o.getRangeAt(0).startContainer));
3095
3155
  if (a) return a;
3096
3156
  }
3097
3157
  if (Q && Q.isConnected)
3098
3158
  return Q;
3099
- for (const a of xe)
3159
+ for (const a of Ae)
3100
3160
  if (a.isConnected) return a;
3101
3161
  return null;
3102
3162
  }
3103
3163
  function mi() {
3104
3164
  if (typeof window == "undefined" || Co) return;
3105
- Ee = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3106
- const o = (t, ...e) => {
3107
- const n = hi();
3108
- return n ? n.execCommand(t, ...e) : Ee ? Ee(t, ...e) : we ? we(t, ...e) : !1;
3165
+ ve = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3166
+ const n = (t, ...e) => {
3167
+ const o = hi();
3168
+ return o ? o.execCommand(t, ...e) : ve ? ve(t, ...e) : we ? we(t, ...e) : !1;
3109
3169
  };
3110
- window.executeEditorCommand = o, window.execEditorCommand = o, Co = !0;
3170
+ window.executeEditorCommand = n, window.execEditorCommand = n, Co = !0;
3111
3171
  }
3112
3172
  function gi() {
3113
- const o = "editora-webcomponent-styles";
3114
- if (!document.getElementById(o)) {
3173
+ const n = "editora-webcomponent-styles";
3174
+ if (!document.getElementById(n)) {
3115
3175
  const t = document.createElement("style");
3116
- t.id = o, t.textContent = ci, document.head.appendChild(t);
3176
+ t.id = n, t.textContent = ci, document.head.appendChild(t);
3117
3177
  }
3118
3178
  }
3119
3179
  function bi() {
3120
3180
  if (!Gt) {
3121
- const o = W.__globalPluginLoader;
3122
- o ? Gt = o : Gt = new Ao();
3181
+ const n = W.__globalPluginLoader;
3182
+ n ? Gt = n : Gt = new xo();
3123
3183
  }
3124
3184
  return Gt;
3125
3185
  }
3126
3186
  class W extends HTMLElement {
3127
3187
  constructor() {
3128
- if (super(), this.pluginLoader = bi(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new En(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, gi(), !this.hasAttribute("data-initial-content")) {
3188
+ if (super(), this.pluginLoader = bi(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new vn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, gi(), !this.hasAttribute("data-initial-content")) {
3129
3189
  const t = this.innerHTML.trim();
3130
3190
  t && this.setAttribute("data-initial-content", t);
3131
3191
  }
@@ -3212,8 +3272,8 @@ class W extends HTMLElement {
3212
3272
  /**
3213
3273
  * Called when an observed attribute changes
3214
3274
  */
3215
- attributeChangedCallback(t, e, n) {
3216
- e !== n && (this.config = this.resolveConfig(), this.handleAttributeChange(t, n));
3275
+ attributeChangedCallback(t, e, o) {
3276
+ e !== o && (this.config = this.resolveConfig(), this.handleAttributeChange(t, o));
3217
3277
  }
3218
3278
  /**
3219
3279
  * Set configuration via JavaScript API
@@ -3227,7 +3287,7 @@ class W extends HTMLElement {
3227
3287
  async initialize() {
3228
3288
  var r;
3229
3289
  if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
3230
- this.setAttribute("data-editora-editor", "true"), xe.add(this), Q || (Q = this), mi(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.config.theme && this.classList.add(`editora-theme-${this.config.theme}`);
3290
+ this.setAttribute("data-editora-editor", "true"), Ae.add(this), Q || (Q = this), mi(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.config.theme && this.classList.add(`editora-theme-${this.config.theme}`);
3231
3291
  const t = await this.loadPlugins();
3232
3292
  if (this.loadedPlugins = t, t.forEach((a) => {
3233
3293
  if (a.init && typeof a.init == "function")
@@ -3242,14 +3302,14 @@ class W extends HTMLElement {
3242
3302
  }
3243
3303
  const e = this.preservedContent;
3244
3304
  this.preservedContent = null;
3245
- const n = this.sanitizeLoadedContent(
3305
+ const o = this.sanitizeLoadedContent(
3246
3306
  (r = e != null ? e : this.restoreAutosavedContent()) != null ? r : this.getAttribute("data-initial-content") || ""
3247
3307
  );
3248
3308
  this.engine = new un({
3249
- content: n,
3309
+ content: o,
3250
3310
  plugins: t,
3251
3311
  readonly: this.config.readonly
3252
- }), this.createUI(t, n), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.dispatchEvent(new CustomEvent("editor-ready", {
3312
+ }), this.createUI(t, o), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.dispatchEvent(new CustomEvent("editor-ready", {
3253
3313
  detail: { api: this.getAPI() },
3254
3314
  bubbles: !0
3255
3315
  }));
@@ -3261,7 +3321,7 @@ class W extends HTMLElement {
3261
3321
  if (this.config.content)
3262
3322
  return this.config.content;
3263
3323
  const t = this.querySelector("[slot]");
3264
- return t ? t.innerHTML : this.hasChildNodes() ? Array.from(this.childNodes).map((n) => n.nodeType === Node.TEXT_NODE ? n.textContent : n.nodeType === Node.ELEMENT_NODE ? n.outerHTML : "").join("").trim() : "";
3324
+ return t ? t.innerHTML : this.hasChildNodes() ? Array.from(this.childNodes).map((o) => o.nodeType === Node.TEXT_NODE ? o.textContent : o.nodeType === Node.ELEMENT_NODE ? o.outerHTML : "").join("").trim() : "";
3265
3325
  }
3266
3326
  /**
3267
3327
  * Load plugins based on configuration
@@ -3305,9 +3365,9 @@ class W extends HTMLElement {
3305
3365
  const e = this.config.toolbar;
3306
3366
  if (typeof e == "string") return e;
3307
3367
  if (!e || typeof e != "object") return;
3308
- const n = e.items;
3309
- if (typeof n == "string") return n;
3310
- if (Array.isArray(n)) return n.join(" ");
3368
+ const o = e.items;
3369
+ if (typeof o == "string") return o;
3370
+ if (Array.isArray(o)) return o.join(" ");
3311
3371
  }
3312
3372
  isToolbarStickyEnabled() {
3313
3373
  const t = this.config.toolbar;
@@ -3357,9 +3417,9 @@ class W extends HTMLElement {
3357
3417
  viewportOnlyScan: t
3358
3418
  };
3359
3419
  if (t && typeof t == "object") {
3360
- const n = Number((e = t.debounceInputMs) != null ? e : 100);
3420
+ const o = Number((e = t.debounceInputMs) != null ? e : 100);
3361
3421
  return {
3362
- debounceInputMs: Number.isFinite(n) && n >= 0 ? n : 100,
3422
+ debounceInputMs: Number.isFinite(o) && o >= 0 ? o : 100,
3363
3423
  viewportOnlyScan: t.viewportOnlyScan !== !1
3364
3424
  };
3365
3425
  }
@@ -3379,8 +3439,8 @@ class W extends HTMLElement {
3379
3439
  const t = this.getAccessibilityConfig();
3380
3440
  if (t.enableARIA) {
3381
3441
  this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute("aria-disabled", this.config.readonly ? "true" : "false");
3382
- const n = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), r = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
3383
- this.contentElement.setAttribute("aria-label", n || r || pi);
3442
+ const o = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), r = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
3443
+ this.contentElement.setAttribute("aria-label", o || r || pi);
3384
3444
  } else
3385
3445
  this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
3386
3446
  this.contentElement.tabIndex = t.keyboardNavigation ? 0 : -1;
@@ -3415,7 +3475,7 @@ class W extends HTMLElement {
3415
3475
  executeCommand(t, ...e) {
3416
3476
  var a;
3417
3477
  typeof window != "undefined" && (window.__editoraCommandEditorRoot = this);
3418
- const n = {
3478
+ const o = {
3419
3479
  editorElement: this,
3420
3480
  contentElement: this.contentElement,
3421
3481
  toolbarElement: this.toolbarElement
@@ -3424,7 +3484,7 @@ class W extends HTMLElement {
3424
3484
  const l = r.commands[t];
3425
3485
  if (typeof l == "function")
3426
3486
  try {
3427
- return t === "toggleFullscreen" ? l(this, n) : l(...e, n), !0;
3487
+ return t === "toggleFullscreen" ? l(this, o) : l(...e, o), !0;
3428
3488
  } catch (c) {
3429
3489
  return console.error(`[RichTextEditor] Error executing native command ${t}:`, c), !1;
3430
3490
  }
@@ -3438,7 +3498,7 @@ class W extends HTMLElement {
3438
3498
  if (a && typeof a == "object")
3439
3499
  return a;
3440
3500
  }
3441
- const n = {
3501
+ const o = {
3442
3502
  spellCheck: ["spellcheck", "spellCheck"],
3443
3503
  trackChanges: ["trackchanges", "track-changes", "trackChanges"],
3444
3504
  versionDiff: ["versiondiff", "version-diff", "versionDiff"],
@@ -3458,7 +3518,7 @@ class W extends HTMLElement {
3458
3518
  }, r = [
3459
3519
  t,
3460
3520
  t.toLowerCase(),
3461
- ...n[t] || []
3521
+ ...o[t] || []
3462
3522
  ];
3463
3523
  for (const a of r) {
3464
3524
  const l = this.config[a];
@@ -3483,7 +3543,7 @@ class W extends HTMLElement {
3483
3543
  return wo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3484
3544
  }
3485
3545
  getAutosaveConfig() {
3486
- var e, n;
3546
+ var e, o;
3487
3547
  const t = this.config.autosave;
3488
3548
  if (typeof t == "boolean")
3489
3549
  return {
@@ -3493,7 +3553,7 @@ class W extends HTMLElement {
3493
3553
  provider: "localStorage"
3494
3554
  };
3495
3555
  if (t && typeof t == "object") {
3496
- const r = Number((n = (e = t.intervalMs) != null ? e : t.interval) != null ? n : 3e4);
3556
+ const r = Number((o = (e = t.intervalMs) != null ? e : t.interval) != null ? o : 3e4);
3497
3557
  return {
3498
3558
  enabled: !!t.enabled,
3499
3559
  intervalMs: Number.isFinite(r) && r > 0 ? r : 3e4,
@@ -3515,8 +3575,8 @@ class W extends HTMLElement {
3515
3575
  if (this.lastAutosavedContent = t, e.provider === "localStorage") {
3516
3576
  try {
3517
3577
  localStorage.setItem(e.storageKey, t), localStorage.setItem(`${e.storageKey}-timestamp`, Date.now().toString());
3518
- } catch (n) {
3519
- console.error("[RichTextEditor] Failed to save autosave content to localStorage:", n);
3578
+ } catch (o) {
3579
+ console.error("[RichTextEditor] Failed to save autosave content to localStorage:", o);
3520
3580
  }
3521
3581
  return;
3522
3582
  }
@@ -3524,8 +3584,8 @@ class W extends HTMLElement {
3524
3584
  method: "POST",
3525
3585
  headers: { "Content-Type": "application/json" },
3526
3586
  body: JSON.stringify({ content: t, timestamp: Date.now() })
3527
- }).catch((n) => {
3528
- console.error("[RichTextEditor] Failed to save autosave content to API:", n);
3587
+ }).catch((o) => {
3588
+ console.error("[RichTextEditor] Failed to save autosave content to API:", o);
3529
3589
  });
3530
3590
  }
3531
3591
  }
@@ -3548,21 +3608,21 @@ class W extends HTMLElement {
3548
3608
  this.stopAutosave();
3549
3609
  const t = this.getAutosaveConfig();
3550
3610
  !t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
3551
- this.persistAutosave(At(this.contentElement));
3611
+ this.persistAutosave(xt(this.contentElement));
3552
3612
  }, t.intervalMs));
3553
3613
  }
3554
3614
  insertHTMLAtSelection(t) {
3555
3615
  if (!this.contentElement) return;
3556
3616
  const e = window.getSelection();
3557
3617
  if (e && e.rangeCount > 0) {
3558
- const n = e.getRangeAt(0);
3559
- n.deleteContents();
3618
+ const o = e.getRangeAt(0);
3619
+ o.deleteContents();
3560
3620
  const r = document.createElement("div");
3561
3621
  r.innerHTML = t;
3562
3622
  const a = document.createDocumentFragment();
3563
3623
  for (; r.firstChild; )
3564
3624
  a.appendChild(r.firstChild);
3565
- n.insertNode(a), n.collapse(!1), e.removeAllRanges(), e.addRange(n);
3625
+ o.insertNode(a), o.collapse(!1), e.removeAllRanges(), e.addRange(o);
3566
3626
  } else
3567
3627
  this.contentElement.focus(), document.execCommand("insertHTML", !1, t);
3568
3628
  }
@@ -3570,8 +3630,8 @@ class W extends HTMLElement {
3570
3630
  * Create UI elements
3571
3631
  */
3572
3632
  createUI(t, e) {
3573
- const n = this.querySelector('[slot="toolbar"]'), r = this.querySelector('[slot="statusbar"]');
3574
- this.innerHTML = "", this.config.toolbar !== !1 && !n ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new pn(
3633
+ const o = this.querySelector('[slot="toolbar"]'), r = this.querySelector('[slot="statusbar"]');
3634
+ this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new pn(
3575
3635
  {
3576
3636
  items: this.resolveToolbarItems(),
3577
3637
  sticky: this.isToolbarStickyEnabled(),
@@ -3586,12 +3646,12 @@ class W extends HTMLElement {
3586
3646
  this.contentElement.focus();
3587
3647
  const f = window.getSelection();
3588
3648
  if (!f || f.rangeCount === 0 || !this.contentElement.contains(f.anchorNode)) {
3589
- const m = document.createRange(), E = this.contentElement.lastChild || this.contentElement;
3590
- E.nodeType === Node.TEXT_NODE ? m.setStart(E, ((c = E.textContent) == null ? void 0 : c.length) || 0) : E.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(E), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), f == null || f.removeAllRanges(), f == null || f.addRange(m);
3649
+ const m = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
3650
+ g.nodeType === Node.TEXT_NODE ? m.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(g), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), f == null || f.removeAllRanges(), f == null || f.addRange(m);
3591
3651
  }
3592
3652
  }
3593
3653
  return this.executeCommand(a, l);
3594
- }), this.toolbar.render(this.toolbarElement)) : n && this.appendChild(n), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
3654
+ }), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
3595
3655
  try {
3596
3656
  document.execCommand("defaultParagraphSeparator", !1, "p");
3597
3657
  } catch (a) {
@@ -3613,50 +3673,70 @@ class W extends HTMLElement {
3613
3673
  return (a = this.contentElement) == null ? void 0 : a.focus();
3614
3674
  }, 0);
3615
3675
  }
3676
+ /**
3677
+ * Hands what a keystroke changed to the history plugin, so Undo takes back typing. Without this the
3678
+ * plugin only knew about changes that plugins reported themselves, and typed text could not be undone.
3679
+ */
3680
+ recordInputHistory(t) {
3681
+ const e = this.pendingHistorySnapshot;
3682
+ if (this.pendingHistorySnapshot = null, !e || !this.contentElement || e.beforeHTML === t) return;
3683
+ const o = window.execEditorCommand;
3684
+ typeof o == "function" && o("recordDomTransaction", this.contentElement, e.beforeHTML, t, {
3685
+ inputType: e.inputType,
3686
+ data: e.data,
3687
+ selectionCollapsed: e.selectionCollapsed
3688
+ });
3689
+ }
3616
3690
  /**
3617
3691
  * Setup event listeners
3618
3692
  */
3619
3693
  setupEventListeners() {
3620
3694
  if (!this.contentElement || !this.engine) return;
3621
3695
  const t = this.keyboardShortcutManager;
3622
- this.contentElement.addEventListener("beforeinput", (n) => {
3623
- this.lastBeforeInputType = n.inputType || null;
3624
- }), this.contentElement.addEventListener("input", (n) => {
3625
- var A;
3696
+ this.contentElement.addEventListener("beforeinput", (o) => {
3697
+ var r, a;
3698
+ this.lastBeforeInputType = o.inputType || null, o.inputType === "historyUndo" || o.inputType === "historyRedo" ? this.pendingHistorySnapshot = null : this.contentElement && (this.pendingHistorySnapshot = {
3699
+ beforeHTML: this.contentElement.innerHTML,
3700
+ inputType: o.inputType || null,
3701
+ data: typeof o.data == "string" ? o.data : null,
3702
+ selectionCollapsed: (a = (r = window.getSelection()) == null ? void 0 : r.isCollapsed) != null ? a : !0
3703
+ });
3704
+ }), this.contentElement.addEventListener("input", (o) => {
3705
+ var T;
3626
3706
  if (!this.contentElement) return;
3627
3707
  let r = this.contentElement.innerHTML;
3628
- const a = (A = n == null ? void 0 : n.detail) == null ? void 0 : A.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = this.lastBeforeInputType;
3708
+ const a = (T = o == null ? void 0 : o.detail) == null ? void 0 : T.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = this.lastBeforeInputType;
3629
3709
  if (this.lastBeforeInputType = null, f.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3630
3710
  const w = wo(r, c, f, a);
3631
3711
  if (w !== r) {
3632
- const v = window.getSelection(), Y = v && v.rangeCount > 0 ? v.getRangeAt(0) : null;
3633
- if (this.contentElement.innerHTML = w, Y && v)
3712
+ const v = window.getSelection(), q = v && v.rangeCount > 0 ? v.getRangeAt(0) : null;
3713
+ if (this.contentElement.innerHTML = w, q && v)
3634
3714
  try {
3635
- v.removeAllRanges(), v.addRange(Y);
3715
+ v.removeAllRanges(), v.addRange(q);
3636
3716
  } catch (D) {
3637
3717
  }
3638
3718
  r = w;
3639
3719
  }
3640
3720
  }
3641
- this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
3642
- const x = () => {
3721
+ this.recordInputHistory(r), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
3722
+ const k = () => {
3643
3723
  this.dispatchEvent(new CustomEvent("content-change", {
3644
3724
  detail: { html: Po(r) },
3645
3725
  bubbles: !0
3646
3726
  }));
3647
3727
  };
3648
- l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(x, l.debounceInputMs) : x(), this.updateStatusBar();
3649
- }), this.contentElement.addEventListener("contextmenu", (n) => {
3728
+ l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(k, l.debounceInputMs) : k(), this.updateStatusBar();
3729
+ }), this.contentElement.addEventListener("contextmenu", (o) => {
3650
3730
  const r = this.config.contextMenu;
3651
- (r === !1 || typeof r == "object" && r !== null && r.enabled === !1) && n.preventDefault();
3652
- }), this.contentElement.addEventListener("paste", (n) => {
3653
- var E, x;
3654
- if (n.__editoraSmartPasteHandled === !0 || n.defaultPrevented)
3731
+ (r === !1 || typeof r == "object" && r !== null && r.enabled === !1) && o.preventDefault();
3732
+ }), this.contentElement.addEventListener("paste", (o) => {
3733
+ var g, k;
3734
+ if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
3655
3735
  return;
3656
- n.preventDefault();
3736
+ o.preventDefault();
3657
3737
  const r = this.config.paste || {};
3658
- let a = ((E = n.clipboardData) == null ? void 0 : E.getData("text/html")) || "";
3659
- const l = ((x = n.clipboardData) == null ? void 0 : x.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = !!a && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(a);
3738
+ let a = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
3739
+ const l = ((k = o.clipboardData) == null ? void 0 : k.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = !!a && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(a);
3660
3740
  if ((r.clean || !r.keepFormatting) && l) {
3661
3741
  document.execCommand("insertText", !1, l);
3662
3742
  return;
@@ -3674,17 +3754,17 @@ class W extends HTMLElement {
3674
3754
  Q = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
3675
3755
  }), this.contentElement.addEventListener("blur", () => {
3676
3756
  this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
3677
- detail: { html: At(this.contentElement) },
3757
+ detail: { html: xt(this.contentElement) },
3678
3758
  bubbles: !0
3679
3759
  })), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
3680
- }), this.contentElement.addEventListener("keydown", (n) => {
3681
- this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(n, (a, l) => {
3760
+ }), this.contentElement.addEventListener("keydown", (o) => {
3761
+ this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (a, l) => {
3682
3762
  this.executeCommand(a, l);
3683
3763
  });
3684
3764
  });
3685
3765
  const e = () => {
3686
- const n = this.getSelectionRangeInEditor(), r = document.activeElement, a = !!r && !!this.contentElement && (r === this.contentElement || this.contentElement.contains(r));
3687
- this.getPerformanceConfig().viewportOnlyScan && !this.isEditorInViewport() && !a || !n && !a || (this.updateFloatingToolbar(), this.updateStatusBar());
3766
+ const o = this.getSelectionRangeInEditor(), r = document.activeElement, a = !!r && !!this.contentElement && (r === this.contentElement || this.contentElement.contains(r));
3767
+ this.getPerformanceConfig().viewportOnlyScan && !this.isEditorInViewport() && !a || !o && !a || (this.updateFloatingToolbar(), this.updateStatusBar());
3688
3768
  };
3689
3769
  this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
3690
3770
  }
@@ -3693,8 +3773,8 @@ class W extends HTMLElement {
3693
3773
  const t = window.getSelection();
3694
3774
  if (!t || t.rangeCount === 0)
3695
3775
  return null;
3696
- const e = t.getRangeAt(0), n = e.commonAncestorContainer;
3697
- return this.contentElement.contains(n) ? e : null;
3776
+ const e = t.getRangeAt(0), o = e.commonAncestorContainer;
3777
+ return this.contentElement.contains(o) ? e : null;
3698
3778
  }
3699
3779
  isSelectionBackward(t) {
3700
3780
  if (!t.anchorNode || !t.focusNode) return !1;
@@ -3706,8 +3786,8 @@ class W extends HTMLElement {
3706
3786
  }
3707
3787
  }
3708
3788
  getSelectionAnchorRect(t, e) {
3709
- const n = Array.from(e.getClientRects()).filter((a) => a.width > 0 || a.height > 0);
3710
- return n.length === 0 ? e.getBoundingClientRect() : this.isSelectionBackward(t) ? n[0] : n[n.length - 1];
3789
+ const o = Array.from(e.getClientRects()).filter((a) => a.width > 0 || a.height > 0);
3790
+ return o.length === 0 ? e.getBoundingClientRect() : this.isSelectionBackward(t) ? o[0] : o[o.length - 1];
3711
3791
  }
3712
3792
  /**
3713
3793
  * Update floating toolbar position
@@ -3718,8 +3798,8 @@ class W extends HTMLElement {
3718
3798
  this.floatingToolbar.hide();
3719
3799
  return;
3720
3800
  }
3721
- const e = this.getPerformanceConfig(), n = document.activeElement === this.contentElement || !!this.contentElement && this.contentElement.contains(document.activeElement);
3722
- if (e.viewportOnlyScan && !this.isEditorInViewport() && !n) {
3801
+ const e = this.getPerformanceConfig(), o = document.activeElement === this.contentElement || !!this.contentElement && this.contentElement.contains(document.activeElement);
3802
+ if (e.viewportOnlyScan && !this.isEditorInViewport() && !o) {
3723
3803
  this.floatingToolbar.hide();
3724
3804
  return;
3725
3805
  }
@@ -3755,10 +3835,10 @@ class W extends HTMLElement {
3755
3835
  const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
3756
3836
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
3757
3837
  return;
3758
- const n = this.contentElement.textContent || "", { words: r, chars: a } = yn(n), l = bn(this.contentElement);
3838
+ const o = this.contentElement.textContent || "", { words: r, chars: a } = yn(o), l = bn(this.contentElement);
3759
3839
  let c, f;
3760
3840
  const m = this.getSelectionRangeInEditor();
3761
- m && (c = mn(this.contentElement, m), m.collapsed || (f = vn(m, c), c = void 0)), this.statusBar.update({
3841
+ m && (c = mn(this.contentElement, m), m.collapsed || (f = En(m, c), c = void 0)), this.statusBar.update({
3762
3842
  wordCount: r,
3763
3843
  charCount: a,
3764
3844
  lineCount: l,
@@ -3782,8 +3862,8 @@ class W extends HTMLElement {
3782
3862
  this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e));
3783
3863
  break;
3784
3864
  case "theme":
3785
- this.classList.forEach((n) => {
3786
- n.startsWith("editora-theme-") && this.classList.remove(n);
3865
+ this.classList.forEach((o) => {
3866
+ o.startsWith("editora-theme-") && this.classList.remove(o);
3787
3867
  }), e && this.classList.add(`editora-theme-${e}`);
3788
3868
  break;
3789
3869
  case "placeholder":
@@ -3835,8 +3915,8 @@ class W extends HTMLElement {
3835
3915
  case "plugins":
3836
3916
  case "statusbar":
3837
3917
  this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
3838
- this.initialize().catch((n) => {
3839
- console.error("[RichTextEditor] Error during attribute change re-initialization:", n);
3918
+ this.initialize().catch((o) => {
3919
+ console.error("[RichTextEditor] Error during attribute change re-initialization:", o);
3840
3920
  });
3841
3921
  }));
3842
3922
  break;
@@ -3848,8 +3928,8 @@ class W extends HTMLElement {
3848
3928
  resolveConfig() {
3849
3929
  const t = {};
3850
3930
  for (let e = 0; e < this.attributes.length; e++) {
3851
- const n = this.attributes[e];
3852
- t[n.name] = n.value;
3931
+ const o = this.attributes[e];
3932
+ t[o.name] = o.value;
3853
3933
  }
3854
3934
  return Ce.resolve({
3855
3935
  jsConfig: this.jsConfig,
@@ -3861,7 +3941,7 @@ class W extends HTMLElement {
3861
3941
  */
3862
3942
  getAPI() {
3863
3943
  return {
3864
- getContent: () => At(this.contentElement),
3944
+ getContent: () => xt(this.contentElement),
3865
3945
  setContent: (t) => {
3866
3946
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
3867
3947
  },
@@ -3888,12 +3968,12 @@ class W extends HTMLElement {
3888
3968
  * Destroy the editor
3889
3969
  */
3890
3970
  destroy() {
3891
- var t, e, n, r;
3892
- this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = At(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (n = this.floatingToolbar) == null || n.destroy(), (r = this.statusBar) == null || r.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, xe.delete(this), Q === this && (Q = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
3971
+ var t, e, o, r;
3972
+ this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = xt(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (r = this.statusBar) == null || r.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, Ae.delete(this), Q === this && (Q = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
3893
3973
  }
3894
3974
  // Public API methods
3895
3975
  getContent() {
3896
- return At(this.contentElement);
3976
+ return xt(this.contentElement);
3897
3977
  }
3898
3978
  setContent(t) {
3899
3979
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
@@ -3910,112 +3990,112 @@ class W extends HTMLElement {
3910
3990
  (t = this.contentElement) == null || t.blur();
3911
3991
  }
3912
3992
  }
3913
- const Yt = new Ao();
3914
- W.__globalPluginLoader = Yt;
3993
+ const qt = new xo();
3994
+ W.__globalPluginLoader = qt;
3915
3995
  const yi = {
3916
3996
  // Core editing plugins (always loaded)
3917
- bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((o) => o.BoldPlugin()),
3918
- italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((o) => o.ItalicPlugin()),
3919
- underline: () => import("./UnderlinePlugin.native-DZzg23rv.mjs").then((o) => o.UnderlinePlugin()),
3920
- strikethrough: () => import("./StrikethroughPlugin.native-V0TL4F48.mjs").then((o) => o.StrikethroughPlugin()),
3921
- clearFormatting: () => import("./ClearFormattingPlugin.native-Pp0O-SBf.mjs").then((o) => o.ClearFormattingPlugin()),
3922
- heading: () => import("./HeadingPlugin.native-DZdvubrQ.mjs").then((o) => o.HeadingPlugin()),
3923
- blockquote: () => import("./BlockquotePlugin.native-D8jjGd0c.mjs").then((o) => o.BlockquotePlugin()),
3924
- code: () => import("./CodePlugin.native-CAHk9ecG.mjs").then((o) => o.CodePlugin()),
3925
- codeSample: () => import("./CodeSamplePlugin.native-svbAFWh_.mjs").then((o) => o.CodeSamplePlugin()),
3926
- list: () => import("./ListPlugin.native-Bt0LANbO.mjs").then((o) => o.ListPlugin()),
3927
- checklist: () => import("./ChecklistPlugin.native-DLedNLsb.mjs").then((o) => o.ChecklistPlugin()),
3928
- textAlignment: () => import("./TextAlignmentPlugin.native-sM_1s00t.mjs").then((o) => o.TextAlignmentPlugin()),
3929
- indent: () => import("./IndentPlugin.native-BHixp8sP.mjs").then((o) => o.IndentPlugin()),
3930
- direction: () => import("./DirectionPlugin.native-B-Zj-EAt.mjs").then((o) => o.DirectionPlugin()),
3931
- textColor: () => import("./TextColorPlugin.native-KMZ2uzlq.mjs").then((o) => o.TextColorPlugin()),
3932
- backgroundColor: () => import("./BackgroundColorPlugin.native-H3XyYD7_.mjs").then((o) => o.BackgroundColorPlugin()),
3933
- fontSize: () => import("./FontSizePlugin.native-DsLrH8eq.mjs").then((o) => o.FontSizePlugin()),
3934
- fontFamily: () => import("./FontFamilyPlugin.native-DLq9x046.mjs").then((o) => o.FontFamilyPlugin()),
3935
- formatPainter: () => import("./FormatPainterPlugin.native-BhjzsiVq.mjs").then((o) => o.FormatPainterPlugin()),
3936
- "format-painter": () => import("./FormatPainterPlugin.native-BhjzsiVq.mjs").then((o) => o.FormatPainterPlugin()),
3937
- formatpainter: () => import("./FormatPainterPlugin.native-BhjzsiVq.mjs").then((o) => o.FormatPainterPlugin()),
3938
- lineHeight: () => import("./LineHeightPlugin.native-CM7iXdQj.mjs").then((o) => o.LineHeightPlugin()),
3939
- capitalization: () => import("./CapitalizationPlugin.native-Mh-kUy-x.mjs").then((o) => o.CapitalizationPlugin()),
3940
- history: () => import("./HistoryPlugin.native-DPvhks6h.mjs").then((o) => o.HistoryPlugin()),
3997
+ bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((n) => n.BoldPlugin()),
3998
+ italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((n) => n.ItalicPlugin()),
3999
+ underline: () => import("./UnderlinePlugin.native-DZzg23rv.mjs").then((n) => n.UnderlinePlugin()),
4000
+ strikethrough: () => import("./StrikethroughPlugin.native-V0TL4F48.mjs").then((n) => n.StrikethroughPlugin()),
4001
+ clearFormatting: () => import("./ClearFormattingPlugin.native-Pp0O-SBf.mjs").then((n) => n.ClearFormattingPlugin()),
4002
+ heading: () => import("./HeadingPlugin.native-C3YiGERx.mjs").then((n) => n.HeadingPlugin()),
4003
+ blockquote: () => import("./BlockquotePlugin.native-D8jjGd0c.mjs").then((n) => n.BlockquotePlugin()),
4004
+ code: () => import("./CodePlugin.native-CRpX2G93.mjs").then((n) => n.CodePlugin()),
4005
+ codeSample: () => import("./CodeSamplePlugin.native-Bai8bgl3.mjs").then((n) => n.CodeSamplePlugin()),
4006
+ list: () => import("./ListPlugin.native-UYaoRiub.mjs").then((n) => n.ListPlugin()),
4007
+ checklist: () => import("./ChecklistPlugin.native-DLedNLsb.mjs").then((n) => n.ChecklistPlugin()),
4008
+ textAlignment: () => import("./TextAlignmentPlugin.native-sM_1s00t.mjs").then((n) => n.TextAlignmentPlugin()),
4009
+ indent: () => import("./IndentPlugin.native-BHixp8sP.mjs").then((n) => n.IndentPlugin()),
4010
+ direction: () => import("./DirectionPlugin.native-B-Zj-EAt.mjs").then((n) => n.DirectionPlugin()),
4011
+ textColor: () => import("./TextColorPlugin.native-C2IjioNM.mjs").then((n) => n.TextColorPlugin()),
4012
+ backgroundColor: () => import("./BackgroundColorPlugin.native-DCAd94kp.mjs").then((n) => n.BackgroundColorPlugin()),
4013
+ fontSize: () => import("./FontSizePlugin.native-DsLrH8eq.mjs").then((n) => n.FontSizePlugin()),
4014
+ fontFamily: () => import("./FontFamilyPlugin.native-DLq9x046.mjs").then((n) => n.FontFamilyPlugin()),
4015
+ formatPainter: () => import("./FormatPainterPlugin.native-CAc1N6xU.mjs").then((n) => n.FormatPainterPlugin()),
4016
+ "format-painter": () => import("./FormatPainterPlugin.native-CAc1N6xU.mjs").then((n) => n.FormatPainterPlugin()),
4017
+ formatpainter: () => import("./FormatPainterPlugin.native-CAc1N6xU.mjs").then((n) => n.FormatPainterPlugin()),
4018
+ lineHeight: () => import("./LineHeightPlugin.native-CM7iXdQj.mjs").then((n) => n.LineHeightPlugin()),
4019
+ capitalization: () => import("./CapitalizationPlugin.native-Mh-kUy-x.mjs").then((n) => n.CapitalizationPlugin()),
4020
+ history: () => import("./HistoryPlugin.native-C8GyxsgC.mjs").then((n) => n.HistoryPlugin()),
3941
4021
  // Advanced plugins (lazy loaded)
3942
- link: () => import("./LinkPlugin.native-BsQXYsK6.mjs").then((o) => o.LinkPlugin()),
3943
- table: () => import("./TablePlugin.native-C1YZ372P.mjs").then((o) => o.TablePlugin()),
3944
- trackChanges: () => import("./TrackChangesPlugin.native-Bghu2q4a.mjs").then((o) => o.TrackChangesPlugin()),
3945
- versionDiff: () => import("./VersionDiffPlugin.native-Ca1fMWUJ.mjs").then((o) => o.VersionDiffPlugin()),
3946
- "version-diff": () => import("./VersionDiffPlugin.native-Ca1fMWUJ.mjs").then((o) => o.VersionDiffPlugin()),
3947
- versiondiff: () => import("./VersionDiffPlugin.native-Ca1fMWUJ.mjs").then((o) => o.VersionDiffPlugin()),
3948
- conditionalContent: () => import("./ConditionalContentPlugin.native-Bf7XgRSW.mjs").then((o) => o.ConditionalContentPlugin()),
3949
- "conditional-content": () => import("./ConditionalContentPlugin.native-Bf7XgRSW.mjs").then((o) => o.ConditionalContentPlugin()),
3950
- conditionalcontent: () => import("./ConditionalContentPlugin.native-Bf7XgRSW.mjs").then((o) => o.ConditionalContentPlugin()),
3951
- dataBinding: () => import("./DataBindingPlugin.native-B7lpI_0c.mjs").then((o) => o.DataBindingPlugin()),
3952
- "data-binding": () => import("./DataBindingPlugin.native-B7lpI_0c.mjs").then((o) => o.DataBindingPlugin()),
3953
- databinding: () => import("./DataBindingPlugin.native-B7lpI_0c.mjs").then((o) => o.DataBindingPlugin()),
3954
- docSchema: () => import("./DocSchemaPlugin.native-DUSVRHqT.mjs").then((o) => o.DocSchemaPlugin()),
3955
- "doc-schema": () => import("./DocSchemaPlugin.native-DUSVRHqT.mjs").then((o) => o.DocSchemaPlugin()),
3956
- docschema: () => import("./DocSchemaPlugin.native-DUSVRHqT.mjs").then((o) => o.DocSchemaPlugin()),
3957
- translationWorkflow: () => import("./TranslationWorkflowPlugin.native-CZtG--06.mjs").then((o) => o.TranslationWorkflowPlugin()),
3958
- "translation-workflow": () => import("./TranslationWorkflowPlugin.native-CZtG--06.mjs").then((o) => o.TranslationWorkflowPlugin()),
3959
- translationworkflow: () => import("./TranslationWorkflowPlugin.native-CZtG--06.mjs").then((o) => o.TranslationWorkflowPlugin()),
3960
- contentRules: () => import("./ContentRulesPlugin.native-vPx5nC73.mjs").then((o) => o.ContentRulesPlugin()),
3961
- "content-rules": () => import("./ContentRulesPlugin.native-vPx5nC73.mjs").then((o) => o.ContentRulesPlugin()),
3962
- contentrules: () => import("./ContentRulesPlugin.native-vPx5nC73.mjs").then((o) => o.ContentRulesPlugin()),
3963
- citations: () => import("./CitationsPlugin.native-C_7wWQ-k.mjs").then((o) => o.CitationsPlugin()),
3964
- citation: () => import("./CitationsPlugin.native-C_7wWQ-k.mjs").then((o) => o.CitationsPlugin()),
3965
- approvalWorkflow: () => import("./ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs").then((o) => o.ApprovalWorkflowPlugin()),
3966
- "approval-workflow": () => import("./ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs").then((o) => o.ApprovalWorkflowPlugin()),
3967
- approvalworkflow: () => import("./ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs").then((o) => o.ApprovalWorkflowPlugin()),
3968
- piiRedaction: () => import("./PIIRedactionPlugin.native-g7j4jOmm.mjs").then((o) => o.PIIRedactionPlugin()),
3969
- "pii-redaction": () => import("./PIIRedactionPlugin.native-g7j4jOmm.mjs").then((o) => o.PIIRedactionPlugin()),
3970
- piiredaction: () => import("./PIIRedactionPlugin.native-g7j4jOmm.mjs").then((o) => o.PIIRedactionPlugin()),
3971
- smartPaste: () => import("./SmartPastePlugin.native-BATLCds5.mjs").then((o) => o.SmartPastePlugin()),
3972
- "smart-paste": () => import("./SmartPastePlugin.native-BATLCds5.mjs").then((o) => o.SmartPastePlugin()),
3973
- smartpaste: () => import("./SmartPastePlugin.native-BATLCds5.mjs").then((o) => o.SmartPastePlugin()),
3974
- blocksLibrary: () => import("./BlocksLibraryPlugin.native-CownM6Rk.mjs").then((o) => o.BlocksLibraryPlugin()),
3975
- "blocks-library": () => import("./BlocksLibraryPlugin.native-CownM6Rk.mjs").then((o) => o.BlocksLibraryPlugin()),
3976
- blockslibrary: () => import("./BlocksLibraryPlugin.native-CownM6Rk.mjs").then((o) => o.BlocksLibraryPlugin()),
3977
- mentions: () => import("./MentionPlugin.native-S_lwGZQO.mjs").then((o) => o.MentionPlugin()),
3978
- mention: () => import("./MentionPlugin.native-S_lwGZQO.mjs").then((o) => o.MentionPlugin()),
3979
- anchor: () => import("./AnchorPlugin.native-Drmxhy98.mjs").then((o) => o.AnchorPlugin()),
3980
- embedIframe: () => import("./EmbedIframePlugin.native-BfZ_HGlV.mjs").then((o) => o.EmbedIframePlugin()),
3981
- math: () => import("./MathPlugin.native-Byo3WL0f.mjs").then((o) => o.MathPlugin()),
3982
- image: () => import("./MediaManagerPlugin.native-BT1NZIJS.mjs").then((o) => o.MediaManagerPlugin()),
3983
- mergeTag: () => import("./MergeTagPlugin.native-7-6F3S1Y.mjs").then((o) => o.MergeTagPlugin()),
3984
- pageBreak: () => import("./PageBreakPlugin.native-DijGuHJZ.mjs").then((o) => o.PageBreakPlugin()),
3985
- print: () => import("./PrintPlugin.native-7qt5v7L5.mjs").then((o) => o.PrintPlugin()),
3986
- preview: () => import("./PreviewPlugin.native-Dv5OsffK.mjs").then((o) => o.PreviewPlugin()),
3987
- specialCharacters: () => import("./SpecialCharactersPlugin.native-CdZoc1GB.mjs").then((o) => o.SpecialCharactersPlugin()),
3988
- slashCommands: () => import("./SlashCommandsPlugin.native-BDIIwGNs.mjs").then((o) => o.SlashCommandsPlugin()),
3989
- "slash-commands": () => import("./SlashCommandsPlugin.native-BDIIwGNs.mjs").then((o) => o.SlashCommandsPlugin()),
3990
- spellCheck: () => import("./SpellCheckPlugin.native-BGm2qPfn.mjs").then((o) => o.SpellCheckPlugin()),
3991
- emojis: () => import("./EmojisPlugin.native-D92aaOKi.mjs").then((o) => o.EmojisPlugin()),
3992
- a11yChecker: () => import("./A11yCheckerPlugin.native-qW_njhLY.mjs").then((o) => o.A11yCheckerPlugin()),
3993
- comments: () => import("./CommentsPlugin.native-DncTHiEe.mjs").then((o) => o.CommentsPlugin()),
3994
- collaboration: () => import("./CollaborationPlugin.native-Bl3R9CRI.mjs").then((o) => o.CollaborationPlugin()),
3995
- "document-manager": () => import("./DocumentManagerPlugin.native-B8K-Oqom.mjs").then((o) => o.DocumentManagerPlugin()),
3996
- fullscreen: () => import("./FullscreenPlugin.native-ChXyxeNw.mjs").then((o) => o.FullscreenPlugin()),
3997
- template: () => import("./TemplatePlugin.native-Dwk8TgxI.mjs").then((o) => o.TemplatePlugin()),
3998
- footnote: () => import("./FootnotePlugin.native-D730OGRm.mjs").then((o) => o.FootnotePlugin())
4022
+ link: () => import("./LinkPlugin.native-Dt_p6Ukb.mjs").then((n) => n.LinkPlugin()),
4023
+ table: () => import("./TablePlugin.native-CWxEFpV8.mjs").then((n) => n.TablePlugin()),
4024
+ trackChanges: () => import("./TrackChangesPlugin.native-Bghu2q4a.mjs").then((n) => n.TrackChangesPlugin()),
4025
+ versionDiff: () => import("./VersionDiffPlugin.native-DJZIzFSK.mjs").then((n) => n.VersionDiffPlugin()),
4026
+ "version-diff": () => import("./VersionDiffPlugin.native-DJZIzFSK.mjs").then((n) => n.VersionDiffPlugin()),
4027
+ versiondiff: () => import("./VersionDiffPlugin.native-DJZIzFSK.mjs").then((n) => n.VersionDiffPlugin()),
4028
+ conditionalContent: () => import("./ConditionalContentPlugin.native-B3R6xcqn.mjs").then((n) => n.ConditionalContentPlugin()),
4029
+ "conditional-content": () => import("./ConditionalContentPlugin.native-B3R6xcqn.mjs").then((n) => n.ConditionalContentPlugin()),
4030
+ conditionalcontent: () => import("./ConditionalContentPlugin.native-B3R6xcqn.mjs").then((n) => n.ConditionalContentPlugin()),
4031
+ dataBinding: () => import("./DataBindingPlugin.native-DbaDeXNp.mjs").then((n) => n.DataBindingPlugin()),
4032
+ "data-binding": () => import("./DataBindingPlugin.native-DbaDeXNp.mjs").then((n) => n.DataBindingPlugin()),
4033
+ databinding: () => import("./DataBindingPlugin.native-DbaDeXNp.mjs").then((n) => n.DataBindingPlugin()),
4034
+ docSchema: () => import("./DocSchemaPlugin.native-DUSVRHqT.mjs").then((n) => n.DocSchemaPlugin()),
4035
+ "doc-schema": () => import("./DocSchemaPlugin.native-DUSVRHqT.mjs").then((n) => n.DocSchemaPlugin()),
4036
+ docschema: () => import("./DocSchemaPlugin.native-DUSVRHqT.mjs").then((n) => n.DocSchemaPlugin()),
4037
+ translationWorkflow: () => import("./TranslationWorkflowPlugin.native-BGXVJD9f.mjs").then((n) => n.TranslationWorkflowPlugin()),
4038
+ "translation-workflow": () => import("./TranslationWorkflowPlugin.native-BGXVJD9f.mjs").then((n) => n.TranslationWorkflowPlugin()),
4039
+ translationworkflow: () => import("./TranslationWorkflowPlugin.native-BGXVJD9f.mjs").then((n) => n.TranslationWorkflowPlugin()),
4040
+ contentRules: () => import("./ContentRulesPlugin.native-BISqhQKJ.mjs").then((n) => n.ContentRulesPlugin()),
4041
+ "content-rules": () => import("./ContentRulesPlugin.native-BISqhQKJ.mjs").then((n) => n.ContentRulesPlugin()),
4042
+ contentrules: () => import("./ContentRulesPlugin.native-BISqhQKJ.mjs").then((n) => n.ContentRulesPlugin()),
4043
+ citations: () => import("./CitationsPlugin.native-BFChgCSV.mjs").then((n) => n.CitationsPlugin()),
4044
+ citation: () => import("./CitationsPlugin.native-BFChgCSV.mjs").then((n) => n.CitationsPlugin()),
4045
+ approvalWorkflow: () => import("./ApprovalWorkflowPlugin.native-AeJsehXM.mjs").then((n) => n.ApprovalWorkflowPlugin()),
4046
+ "approval-workflow": () => import("./ApprovalWorkflowPlugin.native-AeJsehXM.mjs").then((n) => n.ApprovalWorkflowPlugin()),
4047
+ approvalworkflow: () => import("./ApprovalWorkflowPlugin.native-AeJsehXM.mjs").then((n) => n.ApprovalWorkflowPlugin()),
4048
+ piiRedaction: () => import("./PIIRedactionPlugin.native-Cm0bpzQb.mjs").then((n) => n.PIIRedactionPlugin()),
4049
+ "pii-redaction": () => import("./PIIRedactionPlugin.native-Cm0bpzQb.mjs").then((n) => n.PIIRedactionPlugin()),
4050
+ piiredaction: () => import("./PIIRedactionPlugin.native-Cm0bpzQb.mjs").then((n) => n.PIIRedactionPlugin()),
4051
+ smartPaste: () => import("./SmartPastePlugin.native-DnOJhDsf.mjs").then((n) => n.SmartPastePlugin()),
4052
+ "smart-paste": () => import("./SmartPastePlugin.native-DnOJhDsf.mjs").then((n) => n.SmartPastePlugin()),
4053
+ smartpaste: () => import("./SmartPastePlugin.native-DnOJhDsf.mjs").then((n) => n.SmartPastePlugin()),
4054
+ blocksLibrary: () => import("./BlocksLibraryPlugin.native-D9OPcnQV.mjs").then((n) => n.BlocksLibraryPlugin()),
4055
+ "blocks-library": () => import("./BlocksLibraryPlugin.native-D9OPcnQV.mjs").then((n) => n.BlocksLibraryPlugin()),
4056
+ blockslibrary: () => import("./BlocksLibraryPlugin.native-D9OPcnQV.mjs").then((n) => n.BlocksLibraryPlugin()),
4057
+ mentions: () => import("./MentionPlugin.native-Zb1dwdxU.mjs").then((n) => n.MentionPlugin()),
4058
+ mention: () => import("./MentionPlugin.native-Zb1dwdxU.mjs").then((n) => n.MentionPlugin()),
4059
+ anchor: () => import("./AnchorPlugin.native-Dk9R26cF.mjs").then((n) => n.AnchorPlugin()),
4060
+ embedIframe: () => import("./EmbedIframePlugin.native-qHMf1Jtg.mjs").then((n) => n.EmbedIframePlugin()),
4061
+ math: () => import("./MathPlugin.native-Cq9WQ7cq.mjs").then((n) => n.MathPlugin()),
4062
+ image: () => import("./MediaManagerPlugin.native-0YFHZfsb.mjs").then((n) => n.MediaManagerPlugin()),
4063
+ mergeTag: () => import("./MergeTagPlugin.native-BXkVPvCo.mjs").then((n) => n.MergeTagPlugin()),
4064
+ pageBreak: () => import("./PageBreakPlugin.native-DijGuHJZ.mjs").then((n) => n.PageBreakPlugin()),
4065
+ print: () => import("./PrintPlugin.native-7qt5v7L5.mjs").then((n) => n.PrintPlugin()),
4066
+ preview: () => import("./PreviewPlugin.native-CrfiwP2J.mjs").then((n) => n.PreviewPlugin()),
4067
+ specialCharacters: () => import("./SpecialCharactersPlugin.native-B0XaCfjZ.mjs").then((n) => n.SpecialCharactersPlugin()),
4068
+ slashCommands: () => import("./SlashCommandsPlugin.native-BzGTRmMB.mjs").then((n) => n.SlashCommandsPlugin()),
4069
+ "slash-commands": () => import("./SlashCommandsPlugin.native-BzGTRmMB.mjs").then((n) => n.SlashCommandsPlugin()),
4070
+ spellCheck: () => import("./SpellCheckPlugin.native-BE7os1Xj.mjs").then((n) => n.SpellCheckPlugin()),
4071
+ emojis: () => import("./EmojisPlugin.native-B64efKg5.mjs").then((n) => n.EmojisPlugin()),
4072
+ a11yChecker: () => import("./A11yCheckerPlugin.native-BBCsR5Ur.mjs").then((n) => n.A11yCheckerPlugin()),
4073
+ comments: () => import("./CommentsPlugin.native-DHCDUm9f.mjs").then((n) => n.CommentsPlugin()),
4074
+ collaboration: () => import("./CollaborationPlugin.native-Bl3R9CRI.mjs").then((n) => n.CollaborationPlugin()),
4075
+ "document-manager": () => import("./DocumentManagerPlugin.native-CaBqCH-p.mjs").then((n) => n.DocumentManagerPlugin()),
4076
+ fullscreen: () => import("./FullscreenPlugin.native-ChXyxeNw.mjs").then((n) => n.FullscreenPlugin()),
4077
+ template: () => import("./TemplatePlugin.native-OD8Wc1R7.mjs").then((n) => n.TemplatePlugin()),
4078
+ footnote: () => import("./FootnotePlugin.native-D730OGRm.mjs").then((n) => n.FootnotePlugin())
3999
4079
  };
4000
- async function vi() {
4001
- return Object.entries(yi).forEach(([o, t]) => {
4002
- Yt.register(o, t);
4003
- }), Yt;
4080
+ async function Ei() {
4081
+ return Object.entries(yi).forEach(([n, t]) => {
4082
+ qt.register(n, t);
4083
+ }), qt;
4004
4084
  }
4005
- typeof window != "undefined" && vi().then((o) => {
4006
- W.__globalPluginLoader = o, customElements.get("editora-editor") || customElements.define("editora-editor", W);
4085
+ typeof window != "undefined" && Ei().then((n) => {
4086
+ W.__globalPluginLoader = n, customElements.get("editora-editor") || customElements.define("editora-editor", W);
4007
4087
  const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
4008
4088
  t.forEach((a) => {
4009
4089
  const l = a.innerHTML.trim();
4010
4090
  e.push(l), l && a.setAttribute("data-initial-content", l);
4011
4091
  });
4012
- const n = document.querySelectorAll("editora-editor");
4013
- Array.from(n).filter((a) => !a.hasAttribute("data-initial-content")).forEach((a) => {
4014
- const l = Array.from(n).indexOf(a);
4092
+ const o = document.querySelectorAll("editora-editor");
4093
+ Array.from(o).filter((a) => !a.hasAttribute("data-initial-content")).forEach((a) => {
4094
+ const l = Array.from(o).indexOf(a);
4015
4095
  e[l] && a.setAttribute("data-initial-content", e[l]);
4016
4096
  }), window.Editora = {
4017
4097
  version: "1.0.0",
4018
- plugins: Yt.getRegisteredPluginNames(),
4098
+ plugins: qt.getRegisteredPluginNames(),
4019
4099
  WebComponent: W,
4020
4100
  init: async (a, l) => {
4021
4101
  const c = document.querySelector(a);
@@ -4025,6 +4105,6 @@ typeof window != "undefined" && vi().then((o) => {
4025
4105
  });
4026
4106
  export {
4027
4107
  W as RichTextEditorElement,
4028
- vi as initWebComponent
4108
+ Ei as initWebComponent
4029
4109
  };
4030
4110
  //# sourceMappingURL=webcomponent.js.map