@editora/core 1.0.22 → 1.0.24

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 (65) hide show
  1. package/README.md +247 -243
  2. package/dist/{A11yCheckerPlugin.native-qW_njhLY.mjs → A11yCheckerPlugin.native-BBCsR5Ur.mjs} +7 -5
  3. package/dist/{AnchorPlugin.native-Drmxhy98.mjs → AnchorPlugin.native-Dk9R26cF.mjs} +20 -19
  4. package/dist/{ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs → ApprovalWorkflowPlugin.native-AeJsehXM.mjs} +56 -55
  5. package/dist/{BackgroundColorPlugin.native-H3XyYD7_.mjs → BackgroundColorPlugin.native-DCAd94kp.mjs} +103 -98
  6. package/dist/{BlocksLibraryPlugin.native-CownM6Rk.mjs → BlocksLibraryPlugin.native-D9OPcnQV.mjs} +42 -43
  7. package/dist/{CitationsPlugin.native-C_7wWQ-k.mjs → CitationsPlugin.native-BFChgCSV.mjs} +51 -51
  8. package/dist/{CodePlugin.native-CAHk9ecG.mjs → CodePlugin.native-BRBEIqY7.mjs} +167 -113
  9. package/dist/{CodePlugin.native-DZgIez08.mjs → CodePlugin.native-CPfKDrkr.mjs} +1383 -1094
  10. package/dist/{CodeSamplePlugin.native-svbAFWh_.mjs → CodeSamplePlugin.native-Bai8bgl3.mjs} +5 -5
  11. package/dist/{CommentsPlugin.native-DncTHiEe.mjs → CommentsPlugin.native-DHCDUm9f.mjs} +161 -141
  12. package/dist/{ConditionalContentPlugin.native-Bf7XgRSW.mjs → ConditionalContentPlugin.native-B3R6xcqn.mjs} +3 -3
  13. package/dist/{ContentRulesPlugin.native-vPx5nC73.mjs → ContentRulesPlugin.native-BISqhQKJ.mjs} +52 -52
  14. package/dist/{DataBindingPlugin.native-B7lpI_0c.mjs → DataBindingPlugin.native-DbaDeXNp.mjs} +37 -37
  15. package/dist/{DocumentManagerPlugin.native-B8K-Oqom.mjs → DocumentManagerPlugin.native-tZqIa9o5.mjs} +21 -20
  16. package/dist/{EmbedIframePlugin.native-BfZ_HGlV.mjs → EmbedIframePlugin.native-qHMf1Jtg.mjs} +7 -7
  17. package/dist/{EmojisPlugin.native-D92aaOKi.mjs → EmojisPlugin.native-B64efKg5.mjs} +4 -4
  18. package/dist/{FormatPainterPlugin.native-BhjzsiVq.mjs → FormatPainterPlugin.native-CAc1N6xU.mjs} +183 -161
  19. package/dist/{HeadingPlugin.native-DZdvubrQ.mjs → HeadingPlugin.native-C3YiGERx.mjs} +85 -72
  20. package/dist/HistoryPlugin.native-C8GyxsgC.mjs +330 -0
  21. package/dist/{LinkPlugin.native-BsQXYsK6.mjs → LinkPlugin.native-Dt_p6Ukb.mjs} +4 -4
  22. package/dist/ListPlugin.native-UYaoRiub.mjs +239 -0
  23. package/dist/{MathPlugin.native-Byo3WL0f.mjs → MathPlugin.native-Cq9WQ7cq.mjs} +148 -130
  24. package/dist/MediaManagerPlugin.native-BjrEarV6.mjs +1161 -0
  25. package/dist/{MediaManagerPlugin.native-BT1NZIJS.mjs → MediaManagerPlugin.native-CRi24Mrb.mjs} +340 -281
  26. package/dist/{MentionPlugin.native-S_lwGZQO.mjs → MentionPlugin.native-Zb1dwdxU.mjs} +304 -300
  27. package/dist/{MergeTagPlugin.native-7-6F3S1Y.mjs → MergeTagPlugin.native-BXkVPvCo.mjs} +6 -4
  28. package/dist/{PIIRedactionPlugin.native-g7j4jOmm.mjs → PIIRedactionPlugin.native-Cm0bpzQb.mjs} +2 -2
  29. package/dist/{PreviewPlugin.native-Dv5OsffK.mjs → PreviewPlugin.native-CrfiwP2J.mjs} +2 -2
  30. package/dist/{SlashCommandsPlugin.native-BDIIwGNs.mjs → SlashCommandsPlugin.native-BzGTRmMB.mjs} +264 -240
  31. package/dist/{SmartPastePlugin.native-BATLCds5.mjs → SmartPastePlugin.native-DnOJhDsf.mjs} +2 -2
  32. package/dist/{SpecialCharactersPlugin.native-CdZoc1GB.mjs → SpecialCharactersPlugin.native-B0XaCfjZ.mjs} +4 -4
  33. package/dist/{SpellCheckPlugin.native-BGm2qPfn.mjs → SpellCheckPlugin.native-BE7os1Xj.mjs} +302 -265
  34. package/dist/{TablePlugin.native-C1YZ372P.mjs → TablePlugin.native-CWxEFpV8.mjs} +159 -136
  35. package/dist/{TemplatePlugin.native-Dwk8TgxI.mjs → TemplatePlugin.native-OD8Wc1R7.mjs} +6 -4
  36. package/dist/{TextColorPlugin.native-KMZ2uzlq.mjs → TextColorPlugin.native-C2IjioNM.mjs} +75 -71
  37. package/dist/{TranslationWorkflowPlugin.native-CZtG--06.mjs → TranslationWorkflowPlugin.native-BGXVJD9f.mjs} +101 -98
  38. package/dist/{VersionDiffPlugin.native-Ca1fMWUJ.mjs → VersionDiffPlugin.native-DJZIzFSK.mjs} +11 -11
  39. package/dist/anchoredPopover-QN4jNbW1.mjs +134 -0
  40. package/dist/confirmDialog-BP8hZPpX.mjs +112 -0
  41. package/dist/dialogHelpers-Dzn8DHoF.mjs +194 -0
  42. package/dist/{documentManager-BWK_-KJp.mjs → documentManager-8gnG-uG_.mjs} +1728 -1715
  43. package/dist/editora.min.js +21 -21
  44. package/dist/editora.umd.js +10 -10
  45. package/dist/{index-C1sO7DAC.js → index--wO0CZVN.js} +6 -6
  46. package/dist/{index-DGMYWPLx.mjs → index-BICrB5kg.mjs} +397 -326
  47. package/dist/index.cjs.js +1 -1
  48. package/dist/index.esm.js +2 -2
  49. package/dist/katex-DLIObQUm.mjs +11683 -0
  50. package/dist/katex.min--Ws3c9be.mjs +6 -0
  51. package/dist/notify-DCQGpmq-.mjs +60 -0
  52. package/dist/plugin-loader.js +54 -54
  53. package/dist/webcomponent-core.js +305 -234
  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 +631 -560
  59. package/dist/webcomponent.min.css +1 -1
  60. package/dist/webcomponent.min.js +1677 -1328
  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/anchoredPopover-DJFD2oAP.mjs +0 -116
  65. package/dist/dialogHelpers-DBf7WqYH.mjs +0 -40
@@ -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
  });
@@ -405,10 +405,10 @@ class pn {
405
405
  insertVideo: "insertVideo",
406
406
  codeBlock: "insertCodeBlock"
407
407
  };
408
- return n.forEach((c) => {
408
+ return o.forEach((c) => {
409
409
  const f = [];
410
- c.split(/\s+/).filter(Boolean).forEach((E) => {
411
- if (E === "direction") {
410
+ c.split(/\s+/).filter(Boolean).forEach((g) => {
411
+ if (g === "direction") {
412
412
  const w = a.get("setDirectionLTR"), v = a.get("setDirectionRTL");
413
413
  w && f.push({
414
414
  id: "directionLTR",
@@ -427,7 +427,7 @@ class pn {
427
427
  });
428
428
  return;
429
429
  }
430
- if (E === "comments") {
430
+ if (g === "comments") {
431
431
  const w = a.get("addComment"), v = a.get("toggleComments");
432
432
  w && f.push({
433
433
  id: "addComment",
@@ -446,16 +446,16 @@ class pn {
446
446
  });
447
447
  return;
448
448
  }
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
449
+ const k = l[g] || g;
450
+ let T = a.get(k);
451
+ T || (T = a.get(g)), T && f.push({
452
+ id: g,
453
+ label: T.label,
454
+ command: T.command,
455
+ icon: T.icon,
456
+ type: T.type === "separator" ? "separator" : T.type || "button",
457
+ options: T.options,
458
+ items: T.items
459
459
  });
460
460
  }), f.length > 0 && e.push(f);
461
461
  }), e;
@@ -473,7 +473,7 @@ class pn {
473
473
  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
474
  const e = document.createElement("div");
475
475
  e.className = "editora-toolbar-items-container", this.itemsContainer = e, this.overflowUnits = [];
476
- const n = this.config.items || this.getDefaultToolbarString(), r = this.parseToolbarString(n);
476
+ const o = this.config.items || this.getDefaultToolbarString(), r = this.parseToolbarString(o);
477
477
  r.forEach((a, l) => {
478
478
  const c = document.createElement("div");
479
479
  if (c.className = "editora-toolbar-group", a.forEach((f) => {
@@ -490,10 +490,10 @@ class pn {
490
490
  * fit into a collapsible "more options" row, re-measuring on resize. */
491
491
  setupOverflow(t) {
492
492
  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) => {
493
+ const o = document.createElement("button");
494
+ 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
495
  c.preventDefault(), this.setExpandedOpen(!this.expandedOpen);
496
- }), this.moreButton = n, t.appendChild(n);
496
+ }), this.moreButton = o, t.appendChild(o);
497
497
  const r = document.createElement("div");
498
498
  r.className = "editora-toolbar-expanded-row", this.expandedRow = r, t.appendChild(r), document.addEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0);
499
499
  const a = () => {
@@ -503,18 +503,18 @@ class pn {
503
503
  var R;
504
504
  D.parentElement === r && ((R = this.overflowUnitHomes.get(D)) == null || R.appendChild(D));
505
505
  });
506
- const f = t.clientWidth, m = 16, E = 40, x = 4, A = Math.max(0, f - m - E - x);
506
+ const f = t.clientWidth, m = 16, g = 40, k = 4, T = Math.max(0, f - m - g - k);
507
507
  let w = 0, v = 0;
508
508
  for (const D of c) {
509
- const R = D.getBoundingClientRect().width + x;
510
- if (w + R <= A)
509
+ const R = D.getBoundingClientRect().width + k;
510
+ if (w + R <= T)
511
511
  w += R, v++;
512
512
  else
513
513
  break;
514
514
  }
515
515
  v = Math.max(1, Math.min(v, c.length));
516
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
+ o.style.display = Y ? "" : "none", o.classList.toggle("active", Y && this.expandedOpen), !Y && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((D, R) => {
518
518
  R >= v && r.appendChild(D);
519
519
  });
520
520
  }, l = () => {
@@ -523,39 +523,39 @@ class pn {
523
523
  this.resizeObserver = new ResizeObserver(() => l()), this.resizeObserver.observe(t), l();
524
524
  }
525
525
  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);
526
+ var e, o;
527
+ this.expandedOpen = t, (e = this.expandedRow) == null || e.classList.toggle("show", t), (o = this.moreButton) == null || o.classList.toggle("active", t);
528
528
  }
529
529
  /**
530
530
  * Append a toolbar button or group to a parent element
531
531
  */
532
532
  appendToolbarButton(t, e) {
533
533
  if (e.type === "separator") {
534
- const n = document.createElement("div");
535
- n.className = "editora-toolbar-separator", t.appendChild(n);
534
+ const o = document.createElement("div");
535
+ o.className = "editora-toolbar-separator", t.appendChild(o);
536
536
  } else if (e.type === "dropdown") {
537
- const n = this.createDropdown(e);
538
- t.appendChild(n);
537
+ const o = this.createDropdown(e);
538
+ t.appendChild(o);
539
539
  } else if (e.type === "inline-menu") {
540
- const n = this.createInlineMenu(e);
541
- t.appendChild(n);
540
+ const o = this.createInlineMenu(e);
541
+ t.appendChild(o);
542
542
  } else if (e.type === "group" && e.items && e.items.length) {
543
- const n = this.createGroupButton(e);
544
- t.appendChild(n);
543
+ const o = this.createGroupButton(e);
544
+ t.appendChild(o);
545
545
  } else if (e.type === "input") {
546
- const n = this.createInput(e);
547
- t.appendChild(n);
546
+ const o = this.createInput(e);
547
+ t.appendChild(o);
548
548
  } else {
549
- const n = this.createButton(e);
550
- t.appendChild(n);
549
+ const o = this.createButton(e);
550
+ t.appendChild(o);
551
551
  }
552
552
  }
553
553
  /**
554
554
  * Create a toolbar button element
555
555
  */
556
556
  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)
557
+ const e = document.createElement("div"), o = t.label.toLowerCase().replace(/\s+/g, "-");
558
+ if (e.className = `editora-toolbar-group-button ${o}`, e.title = t.label, t.icon)
559
559
  if (t.icon.startsWith("<svg") && t.icon.endsWith("</svg>")) {
560
560
  const r = document.createElement("span");
561
561
  r.className = "editora-toolbar-icon", r.innerHTML = t.icon, e.appendChild(r);
@@ -563,7 +563,7 @@ class pn {
563
563
  e.innerHTML = t.icon;
564
564
  if (t.items && t.items.length) {
565
565
  const r = document.createElement("div");
566
- r.className = `editora-toolbar-group-items ${n}`, t.items.forEach((a) => {
566
+ r.className = `editora-toolbar-group-items ${o}`, t.items.forEach((a) => {
567
567
  this.appendToolbarButton(r, a);
568
568
  }), e.appendChild(r);
569
569
  }
@@ -574,8 +574,8 @@ class pn {
574
574
  */
575
575
  createInput(t) {
576
576
  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);
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", (o) => {
578
+ o.preventDefault(), this.setLastCommandTrigger(e, t.command), this.commandHandler && t.command && this.commandHandler(t.command);
579
579
  }), e;
580
580
  }
581
581
  /**
@@ -585,32 +585,83 @@ class pn {
585
585
  const e = document.createElement("button");
586
586
  if (e.className = "editora-toolbar-button", e.type = "button", e.title = t.label, t.command && e.setAttribute("data-command", t.command), t.icon)
587
587
  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);
588
+ const o = document.createElement("span");
589
+ o.className = "editora-toolbar-icon", o.innerHTML = t.icon, e.appendChild(o);
590
590
  } else
591
591
  e.innerHTML = t.icon;
592
592
  else
593
593
  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);
594
+ return t.active && e.classList.add("active"), t.disabled && (e.disabled = !0), e.addEventListener("click", (o) => {
595
+ o.preventDefault(), this.commandHandler && t.command && this.commandHandler(t.command);
596
596
  }), e;
597
597
  }
598
+ /**
599
+ * What a toolbar menu needs besides its look, so it can be used without a mouse: the trigger says it opens a menu
600
+ * and whether it is open, the menu and its items have menu roles, and the keyboard works in it. Enter, Space or an
601
+ * arrow key on the trigger opens it and moves the focus to the first (or, with ArrowUp, the last) item; arrows,
602
+ * Home and End move between items; Escape closes it and gives the focus back to the trigger; Tab closes it. A
603
+ * mouse click leaves the focus alone, so the editor keeps its selection.
604
+ */
605
+ makeMenuAccessible(t, e, o, r) {
606
+ 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) => {
607
+ m.setAttribute("role", "menuitem"), m.tabIndex = -1;
608
+ });
609
+ const a = () => Array.from(o.querySelectorAll('[role="menuitem"]')), l = () => o.style.display === "block", c = new MutationObserver(() => {
610
+ e.setAttribute("aria-expanded", l() ? "true" : "false");
611
+ });
612
+ c.observe(o, { attributes: !0, attributeFilter: ["style"] });
613
+ const f = t._cleanupDropdown;
614
+ t._cleanupDropdown = () => {
615
+ c.disconnect(), f == null || f();
616
+ }, e.addEventListener("click", (m) => {
617
+ var g;
618
+ m.detail === 0 && l() && ((g = a()[0]) == null || g.focus());
619
+ }), e.addEventListener("keydown", (m) => {
620
+ var k;
621
+ if (m.key !== "ArrowDown" && m.key !== "ArrowUp") return;
622
+ m.preventDefault(), l() || e.click();
623
+ const g = a();
624
+ (k = m.key === "ArrowUp" ? g[g.length - 1] : g[0]) == null || k.focus();
625
+ }), o.addEventListener("keydown", (m) => {
626
+ const g = a();
627
+ if (g.length === 0) return;
628
+ const k = g.indexOf(document.activeElement), T = (w) => {
629
+ m.preventDefault(), g[(w + g.length) % g.length].focus();
630
+ };
631
+ switch (m.key) {
632
+ case "ArrowDown":
633
+ return T(k + 1);
634
+ case "ArrowUp":
635
+ return T(k < 0 ? g.length - 1 : k - 1);
636
+ case "Home":
637
+ return T(0);
638
+ case "End":
639
+ return T(g.length - 1);
640
+ case "Escape":
641
+ m.preventDefault(), m.stopPropagation(), o.style.display = "none", e.focus();
642
+ return;
643
+ case "Tab":
644
+ o.style.display = "none";
645
+ return;
646
+ }
647
+ });
648
+ }
598
649
  /**
599
650
  * Create a dropdown element
600
651
  */
601
652
  createDropdown(t) {
602
653
  const e = document.createElement("div");
603
654
  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;
655
+ const o = document.createElement("button");
656
+ o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
606
657
  const r = document.createElement("div");
607
658
  r.className = "editora-toolbar-dropdown-menu", r.style.display = "none", t.options && t.options.forEach((c) => {
608
659
  const f = document.createElement("button");
609
660
  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";
661
+ m.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), r.style.display = "none";
611
662
  }), r.appendChild(f);
612
- }), n.addEventListener("click", (c) => {
613
- c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(n, t.command);
663
+ }), o.addEventListener("click", (c) => {
664
+ c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
614
665
  const f = r.style.display === "block";
615
666
  r.style.display = f ? "none" : "block";
616
667
  });
@@ -621,7 +672,7 @@ class pn {
621
672
  };
622
673
  return document.addEventListener("mousedown", a, !0), document.addEventListener("keydown", l), e._cleanupDropdown = () => {
623
674
  document.removeEventListener("mousedown", a, !0), document.removeEventListener("keydown", l);
624
- }, e.appendChild(n), e.appendChild(r), e;
675
+ }, e.appendChild(o), e.appendChild(r), this.makeMenuAccessible(e, o, r, t.label), e;
625
676
  }
626
677
  /**
627
678
  * Create an inline menu element (like dropdown but triggered by button click)
@@ -629,29 +680,29 @@ class pn {
629
680
  createInlineMenu(t) {
630
681
  const e = document.createElement("div");
631
682
  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)
683
+ const o = document.createElement("button");
684
+ if (o.className = "editora-toolbar-button", o.type = "button", o.title = t.label, t.icon)
634
685
  if (t.icon.startsWith("<svg") && t.icon.endsWith("</svg>")) {
635
686
  const c = document.createElement("span");
636
- c.className = "editora-toolbar-icon", c.innerHTML = t.icon, n.appendChild(c);
687
+ c.className = "editora-toolbar-icon", c.innerHTML = t.icon, o.appendChild(c);
637
688
  } else
638
- n.innerHTML = t.icon;
689
+ o.innerHTML = t.icon;
639
690
  else
640
- n.textContent = t.label;
691
+ o.textContent = t.label;
641
692
  const r = document.createElement("div");
642
693
  r.className = "editora-toolbar-dropdown-menu", r.style.display = "none", t.options && t.options.forEach((c) => {
643
694
  const f = document.createElement("button");
644
695
  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";
696
+ m.preventDefault(), m.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), r.style.display = "none";
646
697
  }), r.appendChild(f);
647
- }), n.addEventListener("click", (c) => {
698
+ }), o.addEventListener("click", (c) => {
648
699
  var m;
649
- c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(n, t.command);
700
+ c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
650
701
  const f = (m = this.container) == null ? void 0 : m.querySelectorAll(
651
702
  ".editora-toolbar-dropdown-menu"
652
703
  );
653
- f == null || f.forEach((E) => {
654
- E !== r && (E.style.display = "none");
704
+ f == null || f.forEach((g) => {
705
+ g !== r && (g.style.display = "none");
655
706
  }), r.style.display = r.style.display === "none" ? "block" : "none";
656
707
  });
657
708
  const a = (c) => {
@@ -661,7 +712,7 @@ class pn {
661
712
  };
662
713
  return document.addEventListener("mousedown", a, !0), document.addEventListener("keydown", l), e._cleanupDropdown = () => {
663
714
  document.removeEventListener("mousedown", a, !0), document.removeEventListener("keydown", l);
664
- }, e.appendChild(n), e.appendChild(r), e;
715
+ }, e.appendChild(o), e.appendChild(r), this.makeMenuAccessible(e, o, r, t.label), e;
665
716
  }
666
717
  /**
667
718
  * Get default toolbar string if none provided
@@ -674,18 +725,18 @@ class pn {
674
725
  */
675
726
  updateButtonState(t, e) {
676
727
  if (!this.container) return;
677
- const n = this.container.querySelector(
728
+ const o = this.container.querySelector(
678
729
  `[data-command="${t}"]`
679
730
  );
680
- n && (e.active !== void 0 && n.classList.toggle("active", e.active), e.disabled !== void 0 && (n.disabled = e.disabled));
731
+ o && (e.active !== void 0 && o.classList.toggle("active", e.active), e.disabled !== void 0 && (o.disabled = e.disabled));
681
732
  }
682
733
  /**
683
734
  * Destroy toolbar
684
735
  */
685
736
  destroy() {
686
737
  var t;
687
- this.container && (this.container.querySelectorAll(".editora-toolbar-dropdown").forEach((n) => {
688
- const r = n._cleanupDropdown;
738
+ this.container && (this.container.querySelectorAll(".editora-toolbar-dropdown").forEach((o) => {
739
+ const r = o._cleanupDropdown;
689
740
  r && r();
690
741
  }), 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
742
  }
@@ -759,21 +810,21 @@ class hn {
759
810
  t.className = "editora-statusbar-left";
760
811
  const e = document.createElement("div");
761
812
  e.className = "editora-statusbar-right";
762
- const n = [];
813
+ const o = [];
763
814
  if (this.statusInfo.selectionInfo) {
764
815
  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`));
816
+ 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
817
  } else if (this.statusInfo.cursorPosition) {
767
818
  const a = this.statusInfo.cursorPosition;
768
- n.push(`Ln ${a.line}, Col ${a.column}`);
819
+ o.push(`Ln ${a.line}, Col ${a.column}`);
769
820
  }
770
- this.statusInfo.language && n.push(this.statusInfo.language);
821
+ this.statusInfo.language && o.push(this.statusInfo.language);
771
822
  const r = [];
772
823
  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
824
  r.push(`${a}: ${l}`);
774
- }), n.forEach((a, l) => {
825
+ }), o.forEach((a, l) => {
775
826
  const c = document.createElement("span");
776
- if (c.className = "editora-statusbar-item", c.textContent = a, t.appendChild(c), l < n.length - 1) {
827
+ if (c.className = "editora-statusbar-item", c.textContent = a, t.appendChild(c), l < o.length - 1) {
777
828
  const f = document.createElement("span");
778
829
  f.className = "editora-statusbar-separator", f.textContent = "|", t.appendChild(f);
779
830
  }
@@ -792,50 +843,50 @@ class hn {
792
843
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
793
844
  }
794
845
  }
795
- function mn(o, t) {
796
- const e = o.textContent || "", n = gn(o, t.startContainer, t.startOffset), a = e.substring(0, n).split(`
846
+ function mn(n, t) {
847
+ const e = n.textContent || "", o = gn(n, t.startContainer, t.startOffset), a = e.substring(0, o).split(`
797
848
  `), l = a.length, c = a[a.length - 1].length + 1;
798
849
  return { line: l, column: c };
799
850
  }
800
- function gn(o, t, e) {
851
+ function gn(n, t, e) {
801
852
  var l;
802
- let n = 0;
853
+ let o = 0;
803
854
  const r = document.createTreeWalker(
804
- o,
855
+ n,
805
856
  NodeFilter.SHOW_TEXT,
806
857
  null
807
858
  );
808
859
  let a = r.firstChild();
809
860
  for (; a; ) {
810
861
  if (a === t) {
811
- n += e;
862
+ o += e;
812
863
  break;
813
- } else a.nodeType === Node.TEXT_NODE && (n += ((l = a.textContent) == null ? void 0 : l.length) || 0);
864
+ } else a.nodeType === Node.TEXT_NODE && (o += ((l = a.textContent) == null ? void 0 : l.length) || 0);
814
865
  a = r.nextNode();
815
866
  }
816
- return n;
867
+ return o;
817
868
  }
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");
869
+ function bn(n) {
870
+ var o, r;
871
+ const t = n.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
821
872
  let e = 1;
822
873
  if (t.length > 0) {
823
874
  e = t.length;
824
875
  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++;
876
+ (a.tagName === "BR" || ((o = a.innerHTML) == null ? void 0 : o.trim()) === "" || ((r = a.textContent) == null ? void 0 : r.trim()) === "") && e++;
826
877
  } else {
827
- const l = (o.textContent || "").split(`
878
+ const l = (n.textContent || "").split(`
828
879
  `).length;
829
880
  e = Math.max(1, l);
830
881
  }
831
882
  return e;
832
883
  }
833
- function yn(o) {
834
- const t = o.trim() ? o.trim().split(/\s+/).length : 0, e = o.length;
884
+ function yn(n) {
885
+ const t = n.trim() ? n.trim().split(/\s+/).length : 0, e = n.length;
835
886
  return { words: t, chars: e };
836
887
  }
837
- function vn(o, t) {
838
- const e = o.toString();
888
+ function En(n, t) {
889
+ const e = n.toString();
839
890
  return {
840
891
  startLine: t.line,
841
892
  startColumn: t.column,
@@ -846,7 +897,7 @@ function vn(o, t) {
846
897
  selectedWords: e.trim().split(/\s+/).filter(Boolean).length
847
898
  };
848
899
  }
849
- class En {
900
+ class vn {
850
901
  constructor(t) {
851
902
  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
903
  this.registerShortcut(e);
@@ -1133,7 +1184,7 @@ class En {
1133
1184
  }
1134
1185
  handleKeyDown(t, e) {
1135
1186
  if (!this.enabled) return !1;
1136
- const n = this.getEventKey(t), r = this.shortcuts.get(n);
1187
+ const o = this.getEventKey(t), r = this.shortcuts.get(o);
1137
1188
  return r ? (r.preventDefault !== !1 && (t.preventDefault(), t.stopPropagation()), e(r.command, r.params), !0) : !1;
1138
1189
  }
1139
1190
  enable() {
@@ -1154,8 +1205,8 @@ class En {
1154
1205
  getShortcutDescription(t) {
1155
1206
  const e = [];
1156
1207
  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("+");
1208
+ const o = t.key.length === 1 ? t.key.toUpperCase() : t.key;
1209
+ return e.push(o), e.join("+");
1159
1210
  }
1160
1211
  getShortcutsHelp() {
1161
1212
  const t = this.getAllShortcuts(), e = /* @__PURE__ */ new Map();
@@ -1163,40 +1214,40 @@ class En {
1163
1214
  const a = this.getShortcutCategory(r.command);
1164
1215
  e.has(a) || e.set(a, []), e.get(a).push(r);
1165
1216
  });
1166
- let n = `# Keyboard Shortcuts
1217
+ let o = `# Keyboard Shortcuts
1167
1218
 
1168
1219
  `;
1169
1220
  return e.forEach((r, a) => {
1170
- n += `## ${a}
1221
+ o += `## ${a}
1171
1222
 
1172
1223
  `, r.forEach((l) => {
1173
1224
  const c = this.getShortcutDescription(l);
1174
- n += `- **${c}**: ${l.description || l.command}
1225
+ o += `- **${c}**: ${l.description || l.command}
1175
1226
  `;
1176
- }), n += `
1227
+ }), o += `
1177
1228
  `;
1178
- }), n;
1229
+ }), o;
1179
1230
  }
1180
1231
  getShortcutCategory(t) {
1181
1232
  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
1233
  }
1183
1234
  }
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;
1235
+ function ro(n, t) {
1236
+ (t == null || t > n.length) && (t = n.length);
1237
+ for (var e = 0, o = Array(t); e < t; e++) o[e] = n[e];
1238
+ return o;
1188
1239
  }
1189
- function wn(o) {
1190
- if (Array.isArray(o)) return o;
1240
+ function wn(n) {
1241
+ if (Array.isArray(n)) return n;
1191
1242
  }
1192
- function kn(o, t) {
1193
- var e = o == null ? null : typeof Symbol != "undefined" && o[Symbol.iterator] || o["@@iterator"];
1243
+ function kn(n, t) {
1244
+ var e = n == null ? null : typeof Symbol != "undefined" && n[Symbol.iterator] || n["@@iterator"];
1194
1245
  if (e != null) {
1195
- var n, r, a, l, c = [], f = !0, m = !1;
1246
+ var o, r, a, l, c = [], f = !0, m = !1;
1196
1247
  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;
1248
+ 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) ;
1249
+ } catch (g) {
1250
+ m = !0, r = g;
1200
1251
  } finally {
1201
1252
  try {
1202
1253
  if (!f && e.return != null && (l = e.return(), Object(l) !== l)) return;
@@ -1211,14 +1262,14 @@ function Tn() {
1211
1262
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1212
1263
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1213
1264
  }
1214
- function Cn(o, t) {
1215
- return wn(o) || kn(o, t) || xn(o, t) || Tn();
1265
+ function Cn(n, t) {
1266
+ return wn(n) || kn(n, t) || xn(n, t) || Tn();
1216
1267
  }
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;
1268
+ function xn(n, t) {
1269
+ if (n) {
1270
+ if (typeof n == "string") return ro(n, t);
1271
+ var e = {}.toString.call(n).slice(8, -1);
1272
+ 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
1273
  }
1223
1274
  }
1224
1275
  const So = Object.entries, ao = Object.setPrototypeOf, An = Object.isFrozen, Sn = Object.getPrototypeOf, _n = Object.getOwnPropertyDescriptor;
@@ -1230,99 +1281,99 @@ I || (I = function(t) {
1230
1281
  return t;
1231
1282
  });
1232
1283
  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];
1284
+ for (var o = arguments.length, r = new Array(o > 2 ? o - 2 : 0), a = 2; a < o; a++) r[a - 2] = arguments[a];
1234
1285
  return t.apply(e, r);
1235
1286
  });
1236
1287
  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);
1288
+ for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) o[r - 1] = arguments[r];
1289
+ return new t(...o);
1239
1290
  });
1240
1291
  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
+ function L(n) {
1242
1293
  return function(t) {
1243
1294
  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);
1295
+ for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) o[r - 1] = arguments[r];
1296
+ return ke(n, t, o);
1246
1297
  };
1247
1298
  }
1248
- function On(o) {
1299
+ function On(n) {
1249
1300
  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);
1301
+ for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
1302
+ return Te(n, e);
1252
1303
  };
1253
1304
  }
1254
- function y(o, t) {
1305
+ function E(n, t) {
1255
1306
  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];
1307
+ if (ao && ao(n, null), !bt(t)) return n;
1308
+ let o = t.length;
1309
+ for (; o--; ) {
1310
+ let r = t[o];
1260
1311
  if (typeof r == "string") {
1261
1312
  const a = e(r);
1262
- a !== r && (An(t) || (t[n] = a), r = a);
1313
+ a !== r && (An(t) || (t[o] = a), r = a);
1263
1314
  }
1264
- o[r] = !0;
1315
+ n[r] = !0;
1265
1316
  }
1266
- return o;
1317
+ return n;
1267
1318
  }
1268
- function Rn(o) {
1269
- for (let t = 0; t < o.length; t++) z(o, t) || (o[t] = null);
1270
- return o;
1319
+ function Rn(n) {
1320
+ for (let t = 0; t < n.length; t++) z(n, t) || (n[t] = null);
1321
+ return n;
1271
1322
  }
1272
- function H(o) {
1323
+ function H(n) {
1273
1324
  const t = gt(null);
1274
- for (const n of So(o)) {
1275
- var e = Cn(n, 2);
1325
+ for (const o of So(n)) {
1326
+ var e = Cn(o, 2);
1276
1327
  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);
1328
+ z(n, r) && (bt(a) ? t[r] = Rn(a) : a && typeof a == "object" && a.constructor === Object ? t[r] = H(a) : t[r] = a);
1278
1329
  }
1279
1330
  return t;
1280
1331
  }
1281
- function Nn(o) {
1282
- switch (typeof o) {
1332
+ function Nn(n) {
1333
+ switch (typeof n) {
1283
1334
  case "string":
1284
- return o;
1335
+ return n;
1285
1336
  case "number":
1286
- return Pn(o);
1337
+ return Pn(n);
1287
1338
  case "boolean":
1288
- return Dn(o);
1339
+ return Dn(n);
1289
1340
  case "bigint":
1290
- return uo ? uo(o) : "0";
1341
+ return uo ? uo(n) : "0";
1291
1342
  case "symbol":
1292
- return po ? po(o) : "Symbol()";
1343
+ return po ? po(n) : "Symbol()";
1293
1344
  case "undefined":
1294
- return xt(o);
1345
+ return xt(n);
1295
1346
  case "function":
1296
1347
  case "object": {
1297
- if (o === null) return xt(o);
1298
- const t = o, e = j(t, "toString");
1348
+ if (n === null) return xt(n);
1349
+ const t = n, e = j(t, "toString");
1299
1350
  if (typeof e == "function") {
1300
- const n = e(t);
1301
- return typeof n == "string" ? n : xt(n);
1351
+ const o = e(t);
1352
+ return typeof o == "string" ? o : xt(o);
1302
1353
  }
1303
- return xt(o);
1354
+ return xt(n);
1304
1355
  }
1305
1356
  default:
1306
- return xt(o);
1357
+ return xt(n);
1307
1358
  }
1308
1359
  }
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);
1360
+ function j(n, t) {
1361
+ for (; n !== null; ) {
1362
+ const o = _n(n, t);
1363
+ if (o) {
1364
+ if (o.get) return L(o.get);
1365
+ if (typeof o.value == "function") return L(o.value);
1315
1366
  }
1316
- o = Sn(o);
1367
+ n = Sn(n);
1317
1368
  }
1318
1369
  function e() {
1319
1370
  return null;
1320
1371
  }
1321
1372
  return e;
1322
1373
  }
1323
- function zn(o) {
1374
+ function zn(n) {
1324
1375
  try {
1325
- return P(o, ""), !0;
1376
+ return P(n, ""), !0;
1326
1377
  } catch (t) {
1327
1378
  return !1;
1328
1379
  }
@@ -1964,7 +2015,7 @@ const fo = M([
1964
2015
  "xlink:title",
1965
2016
  "xml:space",
1966
2017
  "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 = {
2018
+ ]), 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), Eo = I(/<[/\w]/g), Vn = I(/<\/no(script|embed|frames)/i), Xn = I(/\/>/i), F = {
1968
2019
  element: 1,
1969
2020
  attribute: 2,
1970
2021
  text: 3,
@@ -1986,19 +2037,19 @@ const fo = M([
1986
2037
  "noframes",
1987
2038
  "plaintext",
1988
2039
  "noscript"
1989
- ], Zn = M(y({}, Lo)), Jn = (function() {
1990
- const o = {};
2040
+ ], Zn = M(E({}, Lo)), Jn = (function() {
2041
+ const n = {};
1991
2042
  return rt(Lo, (t) => {
1992
- o[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
1993
- }), M(o);
2043
+ n[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
2044
+ }), M(n);
1994
2045
  })(), Qn = function() {
1995
2046
  return typeof window == "undefined" ? null : window;
1996
2047
  }, ti = function(t, e) {
1997
2048
  if (typeof t != "object" || typeof t.createPolicy != "function") return null;
1998
- let n = null;
2049
+ let o = null;
1999
2050
  const r = "data-tt-policy-suffix";
2000
- e && e.hasAttribute(r) && (n = e.getAttribute(r));
2001
- const a = "dompurify" + (n ? "#" + n : "");
2051
+ e && e.hasAttribute(r) && (o = e.getAttribute(r));
2052
+ const a = "dompurify" + (o ? "#" + o : "");
2002
2053
  try {
2003
2054
  return t.createPolicy(a, {
2004
2055
  createHTML(l) {
@@ -2011,7 +2062,7 @@ const fo = M([
2011
2062
  } catch (l) {
2012
2063
  return console.warn("TrustedTypes policy " + a + " could not be created."), null;
2013
2064
  }
2014
- }, Eo = function() {
2065
+ }, vo = function() {
2015
2066
  return {
2016
2067
  afterSanitizeAttributes: [],
2017
2068
  afterSanitizeElements: [],
@@ -2023,23 +2074,23 @@ const fo = M([
2023
2074
  uponSanitizeElement: [],
2024
2075
  uponSanitizeShadowNode: []
2025
2076
  };
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) {
2077
+ }, J = function(t, e, o, r) {
2078
+ return z(t, e) && bt(t[e]) ? E(r.base ? H(r.base) : {}, t[e], r.transform) : o;
2079
+ }, Ee = function(t, e, o) {
2029
2080
  const r = z(t, e) ? t[e] : void 0;
2030
- return r && typeof r == "object" ? H(r) : n();
2081
+ return r && typeof r == "object" ? H(r) : o();
2031
2082
  };
2032
2083
  function Mo() {
2033
- let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Qn();
2084
+ let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Qn();
2034
2085
  const t = (u) => Mo(u);
2035
- if (t.version = "3.4.16", t.removed = [], !o || !o.document || o.document.nodeType !== F.document || !o.Element)
2086
+ if (t.version = "3.4.16", t.removed = [], !n || !n.document || n.document.nodeType !== F.document || !n.Element)
2036
2087
  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) {
2088
+ let e = n.document;
2089
+ const o = e, r = o.currentScript;
2090
+ n.DocumentFragment;
2091
+ const a = n.HTMLTemplateElement, l = n.Node, c = n.Element, f = n.NodeFilter;
2092
+ n.NamedNodeMap === void 0 && (n.NamedNodeMap || n.MozNamedAttrMap), n.HTMLFormElement;
2093
+ const m = n.DOMParser, g = n.trustedTypes, k = c.prototype, T = j(k, "cloneNode"), w = j(k, "remove"), v = j(k, "removeAttributeNode"), Y = j(k, "nextSibling"), D = j(k, "childNodes"), R = j(k, "parentNode"), Ae = 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
2094
  return tt ? tt(i) : i.nodeType;
2044
2095
  }, Xt = function(i) {
2045
2096
  return at ? at(i) : i.nodeName;
@@ -2048,39 +2099,39 @@ function Mo() {
2048
2099
  const u = e.createElement("template");
2049
2100
  u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
2050
2101
  }
2051
- let N, et = "", Zt, Se = !1, vt = 0;
2102
+ let N, et = "", Zt, Se = !1, Et = 0;
2052
2103
  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.');
2104
+ 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
2105
  }, st = function(i) {
2055
- _e(), vt++;
2106
+ _e(), Et++;
2056
2107
  try {
2057
2108
  return N.createHTML(i);
2058
2109
  } finally {
2059
- vt--;
2110
+ Et--;
2060
2111
  }
2061
2112
  }, Do = function(i) {
2062
- _e(), vt++;
2113
+ _e(), Et++;
2063
2114
  try {
2064
2115
  return N.createScriptURL(i);
2065
2116
  } finally {
2066
- vt--;
2117
+ Et--;
2067
2118
  }
2068
2119
  }, 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();
2120
+ return Se || (Zt = ti(g, r), Se = !0), Zt;
2121
+ }, Mt = e, Jt = Mt.implementation, Le = Mt.createNodeIterator, Ro = Mt.createDocumentFragment, No = Mt.getElementsByTagName, zo = o.importNode;
2122
+ let C = vo();
2072
2123
  t.isSupported = typeof So == "function" && typeof R == "function" && Jt && Jt.createHTMLDocument !== void 0;
2073
2124
  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
+ let Ie = bo, x = null;
2126
+ const Qt = E({}, [
2076
2127
  ...fo,
2077
2128
  ...me,
2078
2129
  ...ge,
2079
2130
  ...be,
2080
2131
  ...ho
2081
2132
  ]);
2082
- let C = null;
2083
- const te = y({}, [
2133
+ let A = null;
2134
+ const te = E({}, [
2084
2135
  ...mo,
2085
2136
  ...ye,
2086
2137
  ...go,
@@ -2105,7 +2156,7 @@ function Mo() {
2105
2156
  enumerable: !0,
2106
2157
  value: !1
2107
2158
  }
2108
- })), Et = null, Pe = null;
2159
+ })), vt = null, Pe = null;
2109
2160
  const q = Object.seal(gt(null, {
2110
2161
  tagCheck: {
2111
2162
  writable: !0,
@@ -2123,7 +2174,7 @@ function Mo() {
2123
2174
  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
2175
  const Be = "user-content-";
2125
2176
  let ie = !0, re = !1, ct = {}, dt = null;
2126
- const Fe = y({}, [
2177
+ const Fe = E({}, [
2127
2178
  "annotation-xml",
2128
2179
  "audio",
2129
2180
  "colgroup",
@@ -2152,7 +2203,7 @@ function Mo() {
2152
2203
  "xmp"
2153
2204
  ]);
2154
2205
  let He = null;
2155
- const Ue = y({}, [
2206
+ const Ue = E({}, [
2156
2207
  "audio",
2157
2208
  "video",
2158
2209
  "img",
@@ -2161,7 +2212,7 @@ function Mo() {
2161
2212
  "track"
2162
2213
  ]);
2163
2214
  let je = null;
2164
- const We = y({}, [
2215
+ const We = E({}, [
2165
2216
  "alt",
2166
2217
  "class",
2167
2218
  "for",
@@ -2178,7 +2229,7 @@ function Mo() {
2178
2229
  "xmlns"
2179
2230
  ]), Rt = "http://www.w3.org/1998/Math/MathML", Nt = "http://www.w3.org/2000/svg", G = "http://www.w3.org/1999/xhtml";
2180
2231
  let ut = G, ae = !1, se = null;
2181
- const Go = y({}, [
2232
+ const Go = E({}, [
2182
2233
  Rt,
2183
2234
  Nt,
2184
2235
  G
@@ -2189,10 +2240,10 @@ function Mo() {
2189
2240
  "ms",
2190
2241
  "mtext"
2191
2242
  ]);
2192
- let le = y({}, $e);
2243
+ let le = E({}, $e);
2193
2244
  const Ge = M(["annotation-xml"]);
2194
- let ce = y({}, Ge);
2195
- const Ko = y({}, [
2245
+ let ce = E({}, Ge);
2246
+ const Ko = E({}, [
2196
2247
  "title",
2197
2248
  "style",
2198
2249
  "font",
@@ -2207,19 +2258,19 @@ function Mo() {
2207
2258
  }, de = function() {
2208
2259
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2209
2260
  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, {
2261
+ (!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, x = J(i, "ALLOWED_TAGS", Qt, { transform: _ }), A = J(i, "ALLOWED_ATTR", te, { transform: _ }), se = J(i, "ALLOWED_NAMESPACES", Go, { transform: he }), je = J(i, "ADD_URI_SAFE_ATTR", We, {
2211
2262
  transform: _,
2212
2263
  base: We
2213
2264
  }), He = J(i, "ADD_DATA_URI_TAGS", Ue, {
2214
2265
  transform: _,
2215
2266
  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, [
2267
+ }), 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));
2268
+ const s = Ee(i, "CUSTOM_ELEMENT_HANDLING", () => gt(null));
2269
+ 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 && (x = E({}, ho), A = gt(null), ct.html === !0 && (E(x, fo), E(A, mo)), ct.svg === !0 && (E(x, me), E(A, ye), E(A, Wt)), ct.svgFilters === !0 && (E(x, ge), E(A, ye), E(A, Wt)), ct.mathMl === !0 && (E(x, be), E(A, go), E(A, 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) && (x === Qt && (x = H(x)), E(x, i.ADD_TAGS, _))), z(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? q.attributeCheck = i.ADD_ATTR : bt(i.ADD_ATTR) && (A === te && (A = H(A)), E(A, 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 && (x["#text"] = !0), nt && E(x, [
2219
2270
  "html",
2220
2271
  "head",
2221
2272
  "body"
2222
- ]), T.table && (y(T, ["tbody"]), delete Et.tbody), i.TRUSTED_TYPES_POLICY) {
2273
+ ]), x.table && (E(x, ["tbody"]), delete vt.tbody), i.TRUSTED_TYPES_POLICY) {
2223
2274
  if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2224
2275
  if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2225
2276
  const d = N;
@@ -2231,11 +2282,11 @@ function Mo() {
2231
2282
  }
2232
2283
  } else i.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Oo()), N && typeof et == "string" && (et = st("")));
2233
2284
  M && M(i), pt = i;
2234
- }, Ye = y({}, [
2285
+ }, Ye = E({}, [
2235
2286
  ...me,
2236
2287
  ...ge,
2237
2288
  ...Bn
2238
- ]), qe = y({}, [...be, ...Fn]), Xo = function(i, s, d) {
2289
+ ]), qe = E({}, [...be, ...Fn]), Xo = function(i, s, d) {
2239
2290
  return s.namespaceURI === G ? i === "svg" : s.namespaceURI === Rt ? i === "svg" && (d === "annotation-xml" || le[d]) : !!Ye[i];
2240
2291
  }, Zo = function(i, s, d) {
2241
2292
  return s.namespaceURI === G ? i === "math" : s.namespaceURI === Nt ? i === "math" && ce[d] : !!qe[i];
@@ -2275,14 +2326,14 @@ function Mo() {
2275
2326
  }), rt(p, (h) => {
2276
2327
  try {
2277
2328
  w(h);
2278
- } catch (g) {
2329
+ } catch (b) {
2279
2330
  }
2280
2331
  });
2281
2332
  }
2282
2333
  const d = Vt(i);
2283
2334
  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);
2335
+ const h = d[p], b = h && h.name;
2336
+ typeof b == "string" && Ve(i, h, b);
2286
2337
  }
2287
2338
  }, it = function(i, s, d) {
2288
2339
  if (!d) try {
@@ -2316,7 +2367,7 @@ function Mo() {
2316
2367
  if (s)
2317
2368
  for (let d = s.length - 1; d >= 0; --d) {
2318
2369
  const p = s[d], h = p && p.name;
2319
- typeof h != "string" || C[_(h)] || Ve(i, p, h);
2370
+ typeof h != "string" || A[_(h)] || Ve(i, p, h);
2320
2371
  }
2321
2372
  }, Bt = function(i) {
2322
2373
  const s = [i];
@@ -2333,41 +2384,41 @@ function Mo() {
2333
2384
  const s = [i];
2334
2385
  for (; s.length > 0; ) {
2335
2386
  const d = s.pop(), p = yt(d);
2336
- if (p === F.processingInstruction || p === F.comment && P(vo, d.data)) {
2387
+ if (p === F.processingInstruction || p === F.comment && P(Eo, d.data)) {
2337
2388
  try {
2338
2389
  w(d);
2339
- } catch (g) {
2390
+ } catch (b) {
2340
2391
  }
2341
2392
  continue;
2342
2393
  }
2343
2394
  if (p === F.element) {
2344
- const g = d, b = _(Xt(d));
2395
+ const b = d, y = _(Xt(d));
2345
2396
  try {
2346
- g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") && Xe("for", b) && g.removeAttribute("for");
2397
+ b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Xe("for", y) && b.removeAttribute("for");
2347
2398
  } catch (S) {
2348
2399
  }
2349
2400
  }
2350
2401
  const h = D(d);
2351
- if (h) for (let g = h.length - 1; g >= 0; --g) s.push(h[g]);
2402
+ if (h) for (let b = h.length - 1; b >= 0; --b) s.push(h[b]);
2352
2403
  }
2353
2404
  }, Ze = function(i) {
2354
2405
  let s = null, d = null;
2355
2406
  if (ne) i = "<remove></remove>" + i;
2356
2407
  else {
2357
- const g = lo(i, /^[\r\n\t ]+/);
2358
- d = g && g[0];
2408
+ const b = lo(i, /^[\r\n\t ]+/);
2409
+ d = b && b[0];
2359
2410
  }
2360
2411
  wt === "application/xhtml+xml" && ut === G && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
2361
2412
  const p = N ? st(i) : i;
2362
2413
  if (ut === G) try {
2363
2414
  s = new m().parseFromString(p, wt);
2364
- } catch (g) {
2415
+ } catch (b) {
2365
2416
  }
2366
2417
  if (!s || !s.documentElement) {
2367
2418
  s = Jt.createDocument(ut, "template", null);
2368
2419
  try {
2369
2420
  s.documentElement.innerHTML = ae ? et : p;
2370
- } catch (g) {
2421
+ } catch (b) {
2371
2422
  }
2372
2423
  }
2373
2424
  const h = s.body || s.documentElement;
@@ -2384,9 +2435,9 @@ function Mo() {
2384
2435
  let h = p.nextNode();
2385
2436
  for (; h; )
2386
2437
  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);
2438
+ const b = (s = i.querySelectorAll) === null || s === void 0 ? void 0 : s.call(i, "template");
2439
+ b && rt(b, (y) => {
2440
+ ft(y.content) && ue(y.content);
2390
2441
  });
2391
2442
  }, Ht = function(i) {
2392
2443
  const s = at ? at(i) : null;
@@ -2412,7 +2463,7 @@ function Mo() {
2412
2463
  });
2413
2464
  }
2414
2465
  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));
2466
+ 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
2467
  }, Ut = function(i, s) {
2417
2468
  if (i instanceof RegExp) return P(i, s);
2418
2469
  if (i instanceof Function) {
@@ -2421,13 +2472,13 @@ function Mo() {
2421
2472
  }
2422
2473
  return !1;
2423
2474
  }, nn = function(i, s, d) {
2424
- if (!Et[s] && oo(s) && Ut($.tagNameCheck, s)) return !1;
2475
+ if (!vt[s] && oo(s) && Ut($.tagNameCheck, s)) return !1;
2425
2476
  if (ie && !dt[s]) {
2426
2477
  const p = R(i), h = D(i);
2427
2478
  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];
2479
+ const b = h.length;
2480
+ for (let y = b - 1; y >= 0; --y) {
2481
+ const S = i === d ? T(h[y], !0) : h[y];
2431
2482
  p.insertBefore(S, Y(i));
2432
2483
  }
2433
2484
  }
@@ -2438,19 +2489,19 @@ function Mo() {
2438
2489
  }, ht = function(i, s) {
2439
2490
  return i === s || R(i) !== null ? !1 : (re && Bt(i), !0);
2440
2491
  }, to = function(i, s) {
2441
- if (K(k.beforeSanitizeElements, i, null), ht(i, s)) return !0;
2492
+ if (K(C.beforeSanitizeElements, i, null), ht(i, s)) return !0;
2442
2493
  if (Ht(i))
2443
2494
  return X(i), !0;
2444
2495
  const d = _(Xt(i));
2445
- if (T = Qe(k.uponSanitizeElement, T, Qt, It), K(k.uponSanitizeElement, i, {
2496
+ if (x = Qe(C.uponSanitizeElement, x, Qt, It), K(C.uponSanitizeElement, i, {
2446
2497
  tagName: d,
2447
- allowedTags: T
2498
+ allowedTags: x
2448
2499
  }), ht(i, s)) return !0;
2449
2500
  if (on(i, d))
2450
2501
  return X(i), !0;
2451
- if (Et[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !T[d]) {
2502
+ if (vt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !x[d]) {
2452
2503
  const p = nn(i, d, s);
2453
- return p === !1 && (K(k.afterSanitizeElements, i, null), ht(i, s)) ? !0 : p;
2504
+ return p === !1 && (K(C.afterSanitizeElements, i, null), ht(i, s)) ? !0 : p;
2454
2505
  }
2455
2506
  if (yt(i) === F.element && !Qo(i) || (d === "noscript" || d === "noembed" || d === "noframes") && P(Vn, i.innerHTML))
2456
2507
  return X(i), !0;
@@ -2458,12 +2509,12 @@ function Mo() {
2458
2509
  const p = Ft(i.textContent);
2459
2510
  i.textContent !== p && (Tt(t.removed, { element: i.cloneNode() }), i.textContent = p);
2460
2511
  }
2461
- return K(k.afterSanitizeElements, i, null), ht(i, s);
2512
+ return K(C.afterSanitizeElements, i, null), ht(i, s);
2462
2513
  }, eo = function(i, s, d) {
2463
2514
  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);
2515
+ const p = A[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, i);
2465
2516
  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({}, [
2517
+ }, rn = E({}, [
2467
2518
  "annotation-xml",
2468
2519
  "color-profile",
2469
2520
  "font-face",
@@ -2475,7 +2526,7 @@ function Mo() {
2475
2526
  ]), oo = function(i) {
2476
2527
  return !rn[_t(i)] && P($o, i);
2477
2528
  }, an = function(i, s, d, p) {
2478
- if (N && typeof E == "object" && typeof E.getAttributeType == "function" && !d) switch (E.getAttributeType(i, s)) {
2529
+ if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(i, s)) {
2479
2530
  case "TrustedHTML":
2480
2531
  return st(p);
2481
2532
  case "TrustedScriptURL":
@@ -2489,56 +2540,56 @@ function Mo() {
2489
2540
  return it(s, i), !1;
2490
2541
  }
2491
2542
  }, no = function(i, s) {
2492
- if (K(k.beforeSanitizeAttributes, i, null), ht(i, s)) return;
2543
+ if (K(C.beforeSanitizeAttributes, i, null), ht(i, s)) return;
2493
2544
  const d = i.attributes;
2494
2545
  if (!d || Ht(i)) return;
2495
- C = Qe(k.uponSanitizeAttribute, C, te, Pt);
2546
+ A = Qe(C.uponSanitizeAttribute, A, te, Pt);
2496
2547
  const p = {
2497
2548
  attrName: "",
2498
2549
  attrValue: "",
2499
2550
  keepAttr: !0,
2500
- allowedAttributes: C,
2551
+ allowedAttributes: A,
2501
2552
  forceKeepAttr: void 0
2502
2553
  };
2503
2554
  let h = d.length;
2504
- const g = _(i.nodeName);
2555
+ const b = _(i.nodeName);
2505
2556
  for (; h--; ) {
2506
- const b = d[h], S = b.name, U = b.namespaceURI, B = b.value, mt = _(S), fe = B;
2557
+ const y = d[h], S = y.name, U = y.namespaceURI, B = y.value, mt = _(S), fe = B;
2507
2558
  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);
2559
+ 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)) {
2560
+ it(S, i, y);
2510
2561
  continue;
2511
2562
  }
2512
2563
  if (mt === "attributename" && lo(O, "href")) {
2513
- it(S, i, b);
2564
+ it(S, i, y);
2514
2565
  continue;
2515
2566
  }
2516
2567
  if (!p.forceKeepAttr) {
2517
2568
  if (!p.keepAttr) {
2518
- it(S, i, b);
2569
+ it(S, i, y);
2519
2570
  continue;
2520
2571
  }
2521
2572
  if (!Re && P(Xn, O)) {
2522
- it(S, i, b);
2573
+ it(S, i, y);
2523
2574
  continue;
2524
2575
  }
2525
- if (V && (O = Ft(O)), !eo(g, mt, O)) {
2526
- it(S, i, b);
2576
+ if (V && (O = Ft(O)), !eo(b, mt, O)) {
2577
+ it(S, i, y);
2527
2578
  continue;
2528
2579
  }
2529
- O = an(g, mt, U, O), O !== fe && sn(i, S, U, O) && io && so(t.removed);
2580
+ O = an(b, mt, U, O), O !== fe && sn(i, S, U, O) && io && so(t.removed);
2530
2581
  }
2531
2582
  }
2532
- K(k.afterSanitizeAttributes, i, null), ht(i, s);
2583
+ K(C.afterSanitizeAttributes, i, null), ht(i, s);
2533
2584
  }, jt = function(i) {
2534
2585
  let s = null;
2535
2586
  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) {
2587
+ for (K(C.beforeSanitizeShadowDOM, i, null); s = d.nextNode(); )
2588
+ if (K(C.uponSanitizeShadowNode, s, null), to(s, i), no(s, i), ft(s.content) && jt(s.content), yt(s) === F.element) {
2538
2589
  const p = Ae(s);
2539
2590
  ft(p) && (pe(p), jt(p));
2540
2591
  }
2541
- K(k.afterSanitizeShadowDOM, i, null);
2592
+ K(C.afterSanitizeShadowDOM, i, null);
2542
2593
  }, pe = function(i) {
2543
2594
  const s = [{
2544
2595
  node: i,
@@ -2550,14 +2601,14 @@ function Mo() {
2550
2601
  jt(d.shadow);
2551
2602
  continue;
2552
2603
  }
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],
2604
+ const p = d.node, h = yt(p) === F.element, b = D(p);
2605
+ if (b) for (let y = b.length - 1; y >= 0; --y) s.push({
2606
+ node: b[y],
2556
2607
  shadow: null
2557
2608
  });
2558
2609
  if (h) {
2559
- const b = at ? at(p) : null;
2560
- if (typeof b == "string" && _(b) === "template") {
2610
+ const y = at ? at(p) : null;
2611
+ if (typeof y == "string" && _(y) === "template") {
2561
2612
  const S = p.content;
2562
2613
  ft(S) && s.push({
2563
2614
  node: S,
@@ -2566,12 +2617,12 @@ function Mo() {
2566
2617
  }
2567
2618
  }
2568
2619
  if (h) {
2569
- const b = Ae(p);
2570
- ft(b) && s.push({
2620
+ const y = Ae(p);
2621
+ ft(y) && s.push({
2571
2622
  node: null,
2572
- shadow: b
2623
+ shadow: y
2573
2624
  }, {
2574
- node: b,
2625
+ node: y,
2575
2626
  shadow: null
2576
2627
  });
2577
2628
  }
@@ -2582,14 +2633,14 @@ function Mo() {
2582
2633
  if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !kt(u) && (u = Nn(u), typeof u != "string"))
2583
2634
  throw Z("dirty is not a string, aborting");
2584
2635
  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) {
2636
+ oe ? (x = It, A = Pt) : de(i), (C.uponSanitizeElement.length > 0 || C.uponSanitizeAttribute.length > 0) && (x = H(x)), C.uponSanitizeAttribute.length > 0 && (A = H(A)), t.removed = [];
2637
+ const b = re && typeof u != "string" && kt(u);
2638
+ if (b) {
2588
2639
  en(u);
2589
2640
  const U = Xt(u);
2590
2641
  if (typeof U == "string") {
2591
2642
  const B = _(U);
2592
- if (!T[B] || Et[B])
2643
+ if (!x[B] || vt[B])
2593
2644
  throw zt(u), Z("root node is forbidden and cannot be sanitized in-place");
2594
2645
  }
2595
2646
  if (Ht(u))
@@ -2606,17 +2657,17 @@ function Mo() {
2606
2657
  if (s = Ze(u), !s) return lt ? null : Ot ? et : "";
2607
2658
  }
2608
2659
  s && ne && X(s.firstChild);
2609
- const b = g ? u : s;
2660
+ const y = b ? u : s;
2610
2661
  try {
2611
- const U = Je(b);
2662
+ const U = Je(y);
2612
2663
  for (; p = U.nextNode(); )
2613
- to(p, b), no(p, b), ft(p.content) && jt(p.content);
2664
+ to(p, y), no(p, y), ft(p.content) && jt(p.content);
2614
2665
  } catch (U) {
2615
- throw g && (zt(u), rt(t.removed, (B) => {
2666
+ throw b && (zt(u), rt(t.removed, (B) => {
2616
2667
  B.element && Bt(B.element);
2617
2668
  })), U;
2618
2669
  }
2619
- if (g) {
2670
+ if (b) {
2620
2671
  let U = !1;
2621
2672
  if (rt(t.removed, (B) => {
2622
2673
  B.element && (B.element === u && (U = !0), Bt(B.element));
@@ -2627,14 +2678,14 @@ function Mo() {
2627
2678
  if (V && ue(s), Dt)
2628
2679
  for (h = Ro.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
2629
2680
  else h = s;
2630
- return (C.shadowroot || C.shadowrootmode) && (h = zo.call(n, h, !0)), h;
2681
+ return (A.shadowroot || A.shadowrootmode) && (h = zo.call(o, h, !0)), h;
2631
2682
  }
2632
2683
  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 + `>
2684
+ return nt && x["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && P(Yn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2634
2685
  ` + S), V && (S = Ft(S)), N && Ot ? st(S) : S;
2635
2686
  }, t.setConfig = function() {
2636
2687
  let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2637
- de(u), oe = !0, It = T, Pt = C;
2688
+ de(u), oe = !0, It = x, Pt = A;
2638
2689
  }, t.clearConfig = function() {
2639
2690
  pt = null, oe = !1, It = null, Pt = null, N = Zt, et = "";
2640
2691
  }, t.isValidAttribute = function(u, i, s) {
@@ -2642,19 +2693,19 @@ function Mo() {
2642
2693
  const d = _(u), p = _(i);
2643
2694
  return eo(d, p, s);
2644
2695
  }, t.addHook = function(u, i) {
2645
- typeof i == "function" && z(k, u) && Tt(k[u], i);
2696
+ typeof i == "function" && z(C, u) && Tt(C[u], i);
2646
2697
  }, t.removeHook = function(u, i) {
2647
- if (z(k, u)) {
2698
+ if (z(C, u)) {
2648
2699
  if (i !== void 0) {
2649
- const s = Ln(k[u], i);
2650
- return s === -1 ? void 0 : Mn(k[u], s, 1)[0];
2700
+ const s = Ln(C[u], i);
2701
+ return s === -1 ? void 0 : Mn(C[u], s, 1)[0];
2651
2702
  }
2652
- return so(k[u]);
2703
+ return so(C[u]);
2653
2704
  }
2654
2705
  }, t.removeHooks = function(u) {
2655
- z(k, u) && (k[u] = []);
2706
+ z(C, u) && (C[u] = []);
2656
2707
  }, t.removeAllHooks = function() {
2657
- k = Eo();
2708
+ C = vo();
2658
2709
  }, t;
2659
2710
  }
2660
2711
  var $t = Mo();
@@ -2722,68 +2773,68 @@ const ei = [
2722
2773
  // iframe actually usable (src, sizing, fullscreen, scrolling/border).
2723
2774
  iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
2724
2775
  }, ni = "data-editora-embed";
2725
- function ii(o) {
2726
- if (!o || /\s/.test(o.trim())) return !1;
2776
+ function ii(n) {
2777
+ if (!n || /\s/.test(n.trim())) return !1;
2727
2778
  try {
2728
- const t = new URL(o.trim());
2779
+ const t = new URL(n.trim());
2729
2780
  return (t.protocol === "https:" || t.protocol === "http:") && t.hostname.length > 0;
2730
2781
  } catch (t) {
2731
2782
  return !1;
2732
2783
  }
2733
2784
  }
2734
- function Io(o, t, e, n) {
2785
+ function Io(n, t, e, o) {
2735
2786
  if ((t == null ? void 0 : t.sanitize) === !1)
2736
- return o;
2787
+ return n;
2737
2788
  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);
2789
+ for (const k of Object.values(c))
2790
+ for (const T of k) f.add(T);
2740
2791
  const m = {
2741
2792
  ALLOWED_TAGS: a,
2742
2793
  ALLOWED_ATTR: Array.from(f)
2743
2794
  };
2744
- if (!n)
2745
- return $t.sanitize(o, m);
2746
- const E = a.includes("iframe");
2795
+ if (!o)
2796
+ return $t.sanitize(n, m);
2797
+ const g = a.includes("iframe");
2747
2798
  $t.addHook(
2748
2799
  "uponSanitizeElement",
2749
- (x, A) => {
2800
+ (k, T) => {
2750
2801
  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"));
2802
+ if (T.tagName !== "iframe") return;
2803
+ const w = k;
2804
+ T.allowedTags.iframe = g || ((v = w.getAttribute) == null ? void 0 : v.call(w, ni)) === "true" && ii(w.getAttribute("src"));
2754
2805
  }
2755
2806
  );
2756
2807
  try {
2757
- return $t.sanitize(o, m);
2808
+ return $t.sanitize(n, m);
2758
2809
  } finally {
2759
2810
  $t.removeHook("uponSanitizeElement");
2760
2811
  }
2761
2812
  }
2762
- function ri(o, t, e, n) {
2763
- return Io(o, t, n, !1);
2813
+ function ri(n, t, e, o) {
2814
+ return Io(n, t, o, !1);
2764
2815
  }
2765
- function ai(o, t, e) {
2766
- return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? o : ri(o, t);
2816
+ function ai(n, t, e) {
2817
+ return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? n : ri(n, t);
2767
2818
  }
2768
- function wo(o, t, e, n) {
2769
- return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? o : Io(o, t, n, !0);
2819
+ function wo(n, t, e, o) {
2820
+ return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? n : Io(n, t, o, !0);
2770
2821
  }
2771
2822
  const si = ".resize-handle, .table-resize-handle", li = /resize-handle/;
2772
- function Po(o) {
2773
- if (!o || !li.test(o)) return o;
2823
+ function Po(n) {
2824
+ if (!n || !li.test(n)) return n;
2774
2825
  const t = document.createElement("template");
2775
- t.innerHTML = o;
2826
+ t.innerHTML = n;
2776
2827
  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) => {
2828
+ return t.content.querySelectorAll(si).forEach((o) => {
2829
+ const r = o.parentElement;
2830
+ r && (r.tagName === "TD" || r.tagName === "TH") && e.add(r), o.remove();
2831
+ }), e.forEach((o) => {
2781
2832
  var r;
2782
- n.style.position === "relative" && (n.style.removeProperty("position"), (r = n.getAttribute("style")) != null && r.trim() || n.removeAttribute("style"));
2833
+ o.style.position === "relative" && (o.style.removeProperty("position"), (r = o.getAttribute("style")) != null && r.trim() || o.removeAttribute("style"));
2783
2834
  }), t.innerHTML;
2784
2835
  }
2785
- function At(o) {
2786
- return o ? Po(o.innerHTML) : "";
2836
+ function At(n) {
2837
+ return n ? Po(n.innerHTML) : "";
2787
2838
  }
2788
2839
  const qt = class qt {
2789
2840
  /**
@@ -2792,8 +2843,8 @@ const qt = class qt {
2792
2843
  static resolve(t) {
2793
2844
  const e = {};
2794
2845
  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);
2846
+ const o = this.parseAttributes(t.attributes);
2847
+ Object.assign(e, o);
2797
2848
  }
2798
2849
  return t.jsConfig && Object.assign(e, t.jsConfig), this.normalizeConfig(e);
2799
2850
  }
@@ -2810,7 +2861,7 @@ const qt = class qt {
2810
2861
  const l = typeof e.autosave == "object" && e.autosave ? { ...e.autosave } : {};
2811
2862
  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
2863
  }
2813
- const n = {
2864
+ const o = {
2814
2865
  enabled: !1,
2815
2866
  intervalMs: 3e4,
2816
2867
  storageKey: "rte-autosave",
@@ -2819,17 +2870,17 @@ const qt = class qt {
2819
2870
  };
2820
2871
  if (typeof e.autosave == "boolean")
2821
2872
  e.autosave = {
2822
- ...n,
2873
+ ...o,
2823
2874
  enabled: e.autosave
2824
2875
  };
2825
2876
  else if (typeof e.autosave == "object" && e.autosave) {
2826
2877
  const l = {
2827
- ...n,
2878
+ ...o,
2828
2879
  ...e.autosave
2829
2880
  };
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;
2881
+ 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
2882
  } else
2832
- e.autosave = n;
2883
+ e.autosave = o;
2833
2884
  if (e.languageLocale !== void 0 || e.languageDirection !== void 0) {
2834
2885
  const l = typeof e.language == "object" && e.language ? { ...e.language } : {};
2835
2886
  e.languageLocale !== void 0 && (l.locale = e.languageLocale), e.languageDirection !== void 0 && (l.direction = e.languageDirection), e.language = l;
@@ -2922,9 +2973,9 @@ const qt = class qt {
2922
2973
  */
2923
2974
  static parseAttributes(t) {
2924
2975
  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);
2976
+ for (const [o, r] of Object.entries(t)) {
2977
+ const a = this.kebabToCamel(o);
2978
+ e[a] = this.BOOLEAN_ATTRIBUTES.has(o) && (r === "" || r === o) ? !0 : this.parseAttributeValue(r);
2928
2979
  }
2929
2980
  return e;
2930
2981
  }
@@ -2948,7 +2999,7 @@ const qt = class qt {
2948
2999
  * Convert kebab-case to camelCase
2949
3000
  */
2950
3001
  static kebabToCamel(t) {
2951
- return t.replace(/-([a-z])/g, (e, n) => n.toUpperCase());
3002
+ return t.replace(/-([a-z])/g, (e, o) => o.toUpperCase());
2952
3003
  }
2953
3004
  /**
2954
3005
  * Validate configuration
@@ -2971,8 +3022,8 @@ const qt = class qt {
2971
3022
  */
2972
3023
  static merge(...t) {
2973
3024
  const e = {};
2974
- for (const n of t)
2975
- for (const [r, a] of Object.entries(n))
3025
+ for (const o of t)
3026
+ for (const [r, a] of Object.entries(o))
2976
3027
  a != null && (typeof a == "object" && !Array.isArray(a) && e[r] ? e[r] = this.merge(e[r], a) : e[r] = a);
2977
3028
  return e;
2978
3029
  }
@@ -3050,30 +3101,30 @@ let Ce = qt;
3050
3101
  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
3102
  let Gt;
3052
3103
  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;
3104
+ let Q = null, Co = !1, ve = null, we = null;
3105
+ function xo(n) {
3106
+ if (!(n instanceof HTMLElement)) return !1;
3107
+ const t = n;
3057
3108
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
3058
3109
  }
3059
- function fi(o) {
3060
- return o ? o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement : null;
3110
+ function fi(n) {
3111
+ return n ? n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement : null;
3061
3112
  }
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);
3113
+ function St(n) {
3114
+ if (!n) return null;
3115
+ if (xo(n))
3116
+ return n;
3117
+ const t = n.matches(ko) ? n : n.closest(ko);
3067
3118
  return !t || !xo(t) ? null : t;
3068
3119
  }
3069
3120
  function hi() {
3070
3121
  var r;
3071
3122
  if (typeof window == "undefined") return null;
3072
- const o = window[di];
3073
- if (o instanceof HTMLElement) {
3074
- const a = St(o);
3123
+ const n = window[di];
3124
+ if (n instanceof HTMLElement) {
3125
+ const a = St(n);
3075
3126
  if (a) return a;
3076
- const l = o.matches(To) ? o : o.querySelector(To);
3127
+ const l = n.matches(To) ? n : n.querySelector(To);
3077
3128
  if (l) {
3078
3129
  const c = St(l);
3079
3130
  if (c) return c;
@@ -3089,9 +3140,9 @@ function hi() {
3089
3140
  const a = St(e);
3090
3141
  if (a) return a;
3091
3142
  }
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));
3143
+ const o = (r = window.getSelection) == null ? void 0 : r.call(window);
3144
+ if (o && o.rangeCount > 0) {
3145
+ const a = St(fi(o.getRangeAt(0).startContainer));
3095
3146
  if (a) return a;
3096
3147
  }
3097
3148
  if (Q && Q.isConnected)
@@ -3102,30 +3153,30 @@ function hi() {
3102
3153
  }
3103
3154
  function mi() {
3104
3155
  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;
3156
+ ve = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3157
+ const n = (t, ...e) => {
3158
+ const o = hi();
3159
+ return o ? o.execCommand(t, ...e) : ve ? ve(t, ...e) : we ? we(t, ...e) : !1;
3109
3160
  };
3110
- window.executeEditorCommand = o, window.execEditorCommand = o, Co = !0;
3161
+ window.executeEditorCommand = n, window.execEditorCommand = n, Co = !0;
3111
3162
  }
3112
3163
  function gi() {
3113
- const o = "editora-webcomponent-styles";
3114
- if (!document.getElementById(o)) {
3164
+ const n = "editora-webcomponent-styles";
3165
+ if (!document.getElementById(n)) {
3115
3166
  const t = document.createElement("style");
3116
- t.id = o, t.textContent = ci, document.head.appendChild(t);
3167
+ t.id = n, t.textContent = ci, document.head.appendChild(t);
3117
3168
  }
3118
3169
  }
3119
3170
  function bi() {
3120
3171
  if (!Gt) {
3121
- const o = W.__globalPluginLoader;
3122
- o ? Gt = o : Gt = new Ao();
3172
+ const n = W.__globalPluginLoader;
3173
+ n ? Gt = n : Gt = new Ao();
3123
3174
  }
3124
3175
  return Gt;
3125
3176
  }
3126
3177
  class W extends HTMLElement {
3127
3178
  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")) {
3179
+ 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
3180
  const t = this.innerHTML.trim();
3130
3181
  t && this.setAttribute("data-initial-content", t);
3131
3182
  }
@@ -3212,8 +3263,8 @@ class W extends HTMLElement {
3212
3263
  /**
3213
3264
  * Called when an observed attribute changes
3214
3265
  */
3215
- attributeChangedCallback(t, e, n) {
3216
- e !== n && (this.config = this.resolveConfig(), this.handleAttributeChange(t, n));
3266
+ attributeChangedCallback(t, e, o) {
3267
+ e !== o && (this.config = this.resolveConfig(), this.handleAttributeChange(t, o));
3217
3268
  }
3218
3269
  /**
3219
3270
  * Set configuration via JavaScript API
@@ -3242,14 +3293,14 @@ class W extends HTMLElement {
3242
3293
  }
3243
3294
  const e = this.preservedContent;
3244
3295
  this.preservedContent = null;
3245
- const n = this.sanitizeLoadedContent(
3296
+ const o = this.sanitizeLoadedContent(
3246
3297
  (r = e != null ? e : this.restoreAutosavedContent()) != null ? r : this.getAttribute("data-initial-content") || ""
3247
3298
  );
3248
3299
  this.engine = new un({
3249
- content: n,
3300
+ content: o,
3250
3301
  plugins: t,
3251
3302
  readonly: this.config.readonly
3252
- }), this.createUI(t, n), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.dispatchEvent(new CustomEvent("editor-ready", {
3303
+ }), this.createUI(t, o), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.dispatchEvent(new CustomEvent("editor-ready", {
3253
3304
  detail: { api: this.getAPI() },
3254
3305
  bubbles: !0
3255
3306
  }));
@@ -3261,7 +3312,7 @@ class W extends HTMLElement {
3261
3312
  if (this.config.content)
3262
3313
  return this.config.content;
3263
3314
  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() : "";
3315
+ 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
3316
  }
3266
3317
  /**
3267
3318
  * Load plugins based on configuration
@@ -3305,9 +3356,9 @@ class W extends HTMLElement {
3305
3356
  const e = this.config.toolbar;
3306
3357
  if (typeof e == "string") return e;
3307
3358
  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(" ");
3359
+ const o = e.items;
3360
+ if (typeof o == "string") return o;
3361
+ if (Array.isArray(o)) return o.join(" ");
3311
3362
  }
3312
3363
  isToolbarStickyEnabled() {
3313
3364
  const t = this.config.toolbar;
@@ -3357,9 +3408,9 @@ class W extends HTMLElement {
3357
3408
  viewportOnlyScan: t
3358
3409
  };
3359
3410
  if (t && typeof t == "object") {
3360
- const n = Number((e = t.debounceInputMs) != null ? e : 100);
3411
+ const o = Number((e = t.debounceInputMs) != null ? e : 100);
3361
3412
  return {
3362
- debounceInputMs: Number.isFinite(n) && n >= 0 ? n : 100,
3413
+ debounceInputMs: Number.isFinite(o) && o >= 0 ? o : 100,
3363
3414
  viewportOnlyScan: t.viewportOnlyScan !== !1
3364
3415
  };
3365
3416
  }
@@ -3379,8 +3430,8 @@ class W extends HTMLElement {
3379
3430
  const t = this.getAccessibilityConfig();
3380
3431
  if (t.enableARIA) {
3381
3432
  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);
3433
+ const o = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), r = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
3434
+ this.contentElement.setAttribute("aria-label", o || r || pi);
3384
3435
  } else
3385
3436
  this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
3386
3437
  this.contentElement.tabIndex = t.keyboardNavigation ? 0 : -1;
@@ -3415,7 +3466,7 @@ class W extends HTMLElement {
3415
3466
  executeCommand(t, ...e) {
3416
3467
  var a;
3417
3468
  typeof window != "undefined" && (window.__editoraCommandEditorRoot = this);
3418
- const n = {
3469
+ const o = {
3419
3470
  editorElement: this,
3420
3471
  contentElement: this.contentElement,
3421
3472
  toolbarElement: this.toolbarElement
@@ -3424,7 +3475,7 @@ class W extends HTMLElement {
3424
3475
  const l = r.commands[t];
3425
3476
  if (typeof l == "function")
3426
3477
  try {
3427
- return t === "toggleFullscreen" ? l(this, n) : l(...e, n), !0;
3478
+ return t === "toggleFullscreen" ? l(this, o) : l(...e, o), !0;
3428
3479
  } catch (c) {
3429
3480
  return console.error(`[RichTextEditor] Error executing native command ${t}:`, c), !1;
3430
3481
  }
@@ -3438,7 +3489,7 @@ class W extends HTMLElement {
3438
3489
  if (a && typeof a == "object")
3439
3490
  return a;
3440
3491
  }
3441
- const n = {
3492
+ const o = {
3442
3493
  spellCheck: ["spellcheck", "spellCheck"],
3443
3494
  trackChanges: ["trackchanges", "track-changes", "trackChanges"],
3444
3495
  versionDiff: ["versiondiff", "version-diff", "versionDiff"],
@@ -3458,7 +3509,7 @@ class W extends HTMLElement {
3458
3509
  }, r = [
3459
3510
  t,
3460
3511
  t.toLowerCase(),
3461
- ...n[t] || []
3512
+ ...o[t] || []
3462
3513
  ];
3463
3514
  for (const a of r) {
3464
3515
  const l = this.config[a];
@@ -3483,7 +3534,7 @@ class W extends HTMLElement {
3483
3534
  return wo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3484
3535
  }
3485
3536
  getAutosaveConfig() {
3486
- var e, n;
3537
+ var e, o;
3487
3538
  const t = this.config.autosave;
3488
3539
  if (typeof t == "boolean")
3489
3540
  return {
@@ -3493,7 +3544,7 @@ class W extends HTMLElement {
3493
3544
  provider: "localStorage"
3494
3545
  };
3495
3546
  if (t && typeof t == "object") {
3496
- const r = Number((n = (e = t.intervalMs) != null ? e : t.interval) != null ? n : 3e4);
3547
+ const r = Number((o = (e = t.intervalMs) != null ? e : t.interval) != null ? o : 3e4);
3497
3548
  return {
3498
3549
  enabled: !!t.enabled,
3499
3550
  intervalMs: Number.isFinite(r) && r > 0 ? r : 3e4,
@@ -3515,8 +3566,8 @@ class W extends HTMLElement {
3515
3566
  if (this.lastAutosavedContent = t, e.provider === "localStorage") {
3516
3567
  try {
3517
3568
  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);
3569
+ } catch (o) {
3570
+ console.error("[RichTextEditor] Failed to save autosave content to localStorage:", o);
3520
3571
  }
3521
3572
  return;
3522
3573
  }
@@ -3524,8 +3575,8 @@ class W extends HTMLElement {
3524
3575
  method: "POST",
3525
3576
  headers: { "Content-Type": "application/json" },
3526
3577
  body: JSON.stringify({ content: t, timestamp: Date.now() })
3527
- }).catch((n) => {
3528
- console.error("[RichTextEditor] Failed to save autosave content to API:", n);
3578
+ }).catch((o) => {
3579
+ console.error("[RichTextEditor] Failed to save autosave content to API:", o);
3529
3580
  });
3530
3581
  }
3531
3582
  }
@@ -3555,14 +3606,14 @@ class W extends HTMLElement {
3555
3606
  if (!this.contentElement) return;
3556
3607
  const e = window.getSelection();
3557
3608
  if (e && e.rangeCount > 0) {
3558
- const n = e.getRangeAt(0);
3559
- n.deleteContents();
3609
+ const o = e.getRangeAt(0);
3610
+ o.deleteContents();
3560
3611
  const r = document.createElement("div");
3561
3612
  r.innerHTML = t;
3562
3613
  const a = document.createDocumentFragment();
3563
3614
  for (; r.firstChild; )
3564
3615
  a.appendChild(r.firstChild);
3565
- n.insertNode(a), n.collapse(!1), e.removeAllRanges(), e.addRange(n);
3616
+ o.insertNode(a), o.collapse(!1), e.removeAllRanges(), e.addRange(o);
3566
3617
  } else
3567
3618
  this.contentElement.focus(), document.execCommand("insertHTML", !1, t);
3568
3619
  }
@@ -3570,8 +3621,8 @@ class W extends HTMLElement {
3570
3621
  * Create UI elements
3571
3622
  */
3572
3623
  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(
3624
+ const o = this.querySelector('[slot="toolbar"]'), r = this.querySelector('[slot="statusbar"]');
3625
+ 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
3626
  {
3576
3627
  items: this.resolveToolbarItems(),
3577
3628
  sticky: this.isToolbarStickyEnabled(),
@@ -3586,12 +3637,12 @@ class W extends HTMLElement {
3586
3637
  this.contentElement.focus();
3587
3638
  const f = window.getSelection();
3588
3639
  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);
3640
+ const m = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
3641
+ 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
3642
  }
3592
3643
  }
3593
3644
  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);
3645
+ }), 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
3646
  try {
3596
3647
  document.execCommand("defaultParagraphSeparator", !1, "p");
3597
3648
  } catch (a) {
@@ -3613,19 +3664,39 @@ class W extends HTMLElement {
3613
3664
  return (a = this.contentElement) == null ? void 0 : a.focus();
3614
3665
  }, 0);
3615
3666
  }
3667
+ /**
3668
+ * Hands what a keystroke changed to the history plugin, so Undo takes back typing. Without this the
3669
+ * plugin only knew about changes that plugins reported themselves, and typed text could not be undone.
3670
+ */
3671
+ recordInputHistory(t) {
3672
+ const e = this.pendingHistorySnapshot;
3673
+ if (this.pendingHistorySnapshot = null, !e || !this.contentElement || e.beforeHTML === t) return;
3674
+ const o = window.execEditorCommand;
3675
+ typeof o == "function" && o("recordDomTransaction", this.contentElement, e.beforeHTML, t, {
3676
+ inputType: e.inputType,
3677
+ data: e.data,
3678
+ selectionCollapsed: e.selectionCollapsed
3679
+ });
3680
+ }
3616
3681
  /**
3617
3682
  * Setup event listeners
3618
3683
  */
3619
3684
  setupEventListeners() {
3620
3685
  if (!this.contentElement || !this.engine) return;
3621
3686
  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;
3687
+ this.contentElement.addEventListener("beforeinput", (o) => {
3688
+ var r, a;
3689
+ this.lastBeforeInputType = o.inputType || null, o.inputType === "historyUndo" || o.inputType === "historyRedo" ? this.pendingHistorySnapshot = null : this.contentElement && (this.pendingHistorySnapshot = {
3690
+ beforeHTML: this.contentElement.innerHTML,
3691
+ inputType: o.inputType || null,
3692
+ data: typeof o.data == "string" ? o.data : null,
3693
+ selectionCollapsed: (a = (r = window.getSelection()) == null ? void 0 : r.isCollapsed) != null ? a : !0
3694
+ });
3695
+ }), this.contentElement.addEventListener("input", (o) => {
3696
+ var T;
3626
3697
  if (!this.contentElement) return;
3627
3698
  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;
3699
+ 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
3700
  if (this.lastBeforeInputType = null, f.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3630
3701
  const w = wo(r, c, f, a);
3631
3702
  if (w !== r) {
@@ -3638,25 +3709,25 @@ class W extends HTMLElement {
3638
3709
  r = w;
3639
3710
  }
3640
3711
  }
3641
- this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
3642
- const x = () => {
3712
+ this.recordInputHistory(r), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
3713
+ const k = () => {
3643
3714
  this.dispatchEvent(new CustomEvent("content-change", {
3644
3715
  detail: { html: Po(r) },
3645
3716
  bubbles: !0
3646
3717
  }));
3647
3718
  };
3648
- l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(x, l.debounceInputMs) : x(), this.updateStatusBar();
3649
- }), this.contentElement.addEventListener("contextmenu", (n) => {
3719
+ l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(k, l.debounceInputMs) : k(), this.updateStatusBar();
3720
+ }), this.contentElement.addEventListener("contextmenu", (o) => {
3650
3721
  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)
3722
+ (r === !1 || typeof r == "object" && r !== null && r.enabled === !1) && o.preventDefault();
3723
+ }), this.contentElement.addEventListener("paste", (o) => {
3724
+ var g, k;
3725
+ if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
3655
3726
  return;
3656
- n.preventDefault();
3727
+ o.preventDefault();
3657
3728
  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);
3729
+ let a = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
3730
+ 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
3731
  if ((r.clean || !r.keepFormatting) && l) {
3661
3732
  document.execCommand("insertText", !1, l);
3662
3733
  return;
@@ -3677,14 +3748,14 @@ class W extends HTMLElement {
3677
3748
  detail: { html: At(this.contentElement) },
3678
3749
  bubbles: !0
3679
3750
  })), 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) => {
3751
+ }), this.contentElement.addEventListener("keydown", (o) => {
3752
+ this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (a, l) => {
3682
3753
  this.executeCommand(a, l);
3683
3754
  });
3684
3755
  });
3685
3756
  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());
3757
+ const o = this.getSelectionRangeInEditor(), r = document.activeElement, a = !!r && !!this.contentElement && (r === this.contentElement || this.contentElement.contains(r));
3758
+ this.getPerformanceConfig().viewportOnlyScan && !this.isEditorInViewport() && !a || !o && !a || (this.updateFloatingToolbar(), this.updateStatusBar());
3688
3759
  };
3689
3760
  this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
3690
3761
  }
@@ -3693,8 +3764,8 @@ class W extends HTMLElement {
3693
3764
  const t = window.getSelection();
3694
3765
  if (!t || t.rangeCount === 0)
3695
3766
  return null;
3696
- const e = t.getRangeAt(0), n = e.commonAncestorContainer;
3697
- return this.contentElement.contains(n) ? e : null;
3767
+ const e = t.getRangeAt(0), o = e.commonAncestorContainer;
3768
+ return this.contentElement.contains(o) ? e : null;
3698
3769
  }
3699
3770
  isSelectionBackward(t) {
3700
3771
  if (!t.anchorNode || !t.focusNode) return !1;
@@ -3706,8 +3777,8 @@ class W extends HTMLElement {
3706
3777
  }
3707
3778
  }
3708
3779
  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];
3780
+ const o = Array.from(e.getClientRects()).filter((a) => a.width > 0 || a.height > 0);
3781
+ return o.length === 0 ? e.getBoundingClientRect() : this.isSelectionBackward(t) ? o[0] : o[o.length - 1];
3711
3782
  }
3712
3783
  /**
3713
3784
  * Update floating toolbar position
@@ -3718,8 +3789,8 @@ class W extends HTMLElement {
3718
3789
  this.floatingToolbar.hide();
3719
3790
  return;
3720
3791
  }
3721
- const e = this.getPerformanceConfig(), n = document.activeElement === this.contentElement || !!this.contentElement && this.contentElement.contains(document.activeElement);
3722
- if (e.viewportOnlyScan && !this.isEditorInViewport() && !n) {
3792
+ const e = this.getPerformanceConfig(), o = document.activeElement === this.contentElement || !!this.contentElement && this.contentElement.contains(document.activeElement);
3793
+ if (e.viewportOnlyScan && !this.isEditorInViewport() && !o) {
3723
3794
  this.floatingToolbar.hide();
3724
3795
  return;
3725
3796
  }
@@ -3755,10 +3826,10 @@ class W extends HTMLElement {
3755
3826
  const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
3756
3827
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
3757
3828
  return;
3758
- const n = this.contentElement.textContent || "", { words: r, chars: a } = yn(n), l = bn(this.contentElement);
3829
+ const o = this.contentElement.textContent || "", { words: r, chars: a } = yn(o), l = bn(this.contentElement);
3759
3830
  let c, f;
3760
3831
  const m = this.getSelectionRangeInEditor();
3761
- m && (c = mn(this.contentElement, m), m.collapsed || (f = vn(m, c), c = void 0)), this.statusBar.update({
3832
+ m && (c = mn(this.contentElement, m), m.collapsed || (f = En(m, c), c = void 0)), this.statusBar.update({
3762
3833
  wordCount: r,
3763
3834
  charCount: a,
3764
3835
  lineCount: l,
@@ -3782,8 +3853,8 @@ class W extends HTMLElement {
3782
3853
  this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e));
3783
3854
  break;
3784
3855
  case "theme":
3785
- this.classList.forEach((n) => {
3786
- n.startsWith("editora-theme-") && this.classList.remove(n);
3856
+ this.classList.forEach((o) => {
3857
+ o.startsWith("editora-theme-") && this.classList.remove(o);
3787
3858
  }), e && this.classList.add(`editora-theme-${e}`);
3788
3859
  break;
3789
3860
  case "placeholder":
@@ -3835,8 +3906,8 @@ class W extends HTMLElement {
3835
3906
  case "plugins":
3836
3907
  case "statusbar":
3837
3908
  this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
3838
- this.initialize().catch((n) => {
3839
- console.error("[RichTextEditor] Error during attribute change re-initialization:", n);
3909
+ this.initialize().catch((o) => {
3910
+ console.error("[RichTextEditor] Error during attribute change re-initialization:", o);
3840
3911
  });
3841
3912
  }));
3842
3913
  break;
@@ -3848,8 +3919,8 @@ class W extends HTMLElement {
3848
3919
  resolveConfig() {
3849
3920
  const t = {};
3850
3921
  for (let e = 0; e < this.attributes.length; e++) {
3851
- const n = this.attributes[e];
3852
- t[n.name] = n.value;
3922
+ const o = this.attributes[e];
3923
+ t[o.name] = o.value;
3853
3924
  }
3854
3925
  return Ce.resolve({
3855
3926
  jsConfig: this.jsConfig,
@@ -3888,8 +3959,8 @@ class W extends HTMLElement {
3888
3959
  * Destroy the editor
3889
3960
  */
3890
3961
  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 }));
3962
+ var t, e, o, r;
3963
+ 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(), (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, xe.delete(this), Q === this && (Q = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
3893
3964
  }
3894
3965
  // Public API methods
3895
3966
  getContent() {
@@ -3914,104 +3985,104 @@ const Yt = new Ao();
3914
3985
  W.__globalPluginLoader = Yt;
3915
3986
  const yi = {
3916
3987
  // 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()),
3988
+ bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((n) => n.BoldPlugin()),
3989
+ italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((n) => n.ItalicPlugin()),
3990
+ underline: () => import("./UnderlinePlugin.native-DZzg23rv.mjs").then((n) => n.UnderlinePlugin()),
3991
+ strikethrough: () => import("./StrikethroughPlugin.native-V0TL4F48.mjs").then((n) => n.StrikethroughPlugin()),
3992
+ clearFormatting: () => import("./ClearFormattingPlugin.native-Pp0O-SBf.mjs").then((n) => n.ClearFormattingPlugin()),
3993
+ heading: () => import("./HeadingPlugin.native-C3YiGERx.mjs").then((n) => n.HeadingPlugin()),
3994
+ blockquote: () => import("./BlockquotePlugin.native-D8jjGd0c.mjs").then((n) => n.BlockquotePlugin()),
3995
+ code: () => import("./CodePlugin.native-BRBEIqY7.mjs").then((n) => n.CodePlugin()),
3996
+ codeSample: () => import("./CodeSamplePlugin.native-Bai8bgl3.mjs").then((n) => n.CodeSamplePlugin()),
3997
+ list: () => import("./ListPlugin.native-UYaoRiub.mjs").then((n) => n.ListPlugin()),
3998
+ checklist: () => import("./ChecklistPlugin.native-DLedNLsb.mjs").then((n) => n.ChecklistPlugin()),
3999
+ textAlignment: () => import("./TextAlignmentPlugin.native-sM_1s00t.mjs").then((n) => n.TextAlignmentPlugin()),
4000
+ indent: () => import("./IndentPlugin.native-BHixp8sP.mjs").then((n) => n.IndentPlugin()),
4001
+ direction: () => import("./DirectionPlugin.native-B-Zj-EAt.mjs").then((n) => n.DirectionPlugin()),
4002
+ textColor: () => import("./TextColorPlugin.native-C2IjioNM.mjs").then((n) => n.TextColorPlugin()),
4003
+ backgroundColor: () => import("./BackgroundColorPlugin.native-DCAd94kp.mjs").then((n) => n.BackgroundColorPlugin()),
4004
+ fontSize: () => import("./FontSizePlugin.native-DsLrH8eq.mjs").then((n) => n.FontSizePlugin()),
4005
+ fontFamily: () => import("./FontFamilyPlugin.native-DLq9x046.mjs").then((n) => n.FontFamilyPlugin()),
4006
+ formatPainter: () => import("./FormatPainterPlugin.native-CAc1N6xU.mjs").then((n) => n.FormatPainterPlugin()),
4007
+ "format-painter": () => import("./FormatPainterPlugin.native-CAc1N6xU.mjs").then((n) => n.FormatPainterPlugin()),
4008
+ formatpainter: () => import("./FormatPainterPlugin.native-CAc1N6xU.mjs").then((n) => n.FormatPainterPlugin()),
4009
+ lineHeight: () => import("./LineHeightPlugin.native-CM7iXdQj.mjs").then((n) => n.LineHeightPlugin()),
4010
+ capitalization: () => import("./CapitalizationPlugin.native-Mh-kUy-x.mjs").then((n) => n.CapitalizationPlugin()),
4011
+ history: () => import("./HistoryPlugin.native-C8GyxsgC.mjs").then((n) => n.HistoryPlugin()),
3941
4012
  // 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())
4013
+ link: () => import("./LinkPlugin.native-Dt_p6Ukb.mjs").then((n) => n.LinkPlugin()),
4014
+ table: () => import("./TablePlugin.native-CWxEFpV8.mjs").then((n) => n.TablePlugin()),
4015
+ trackChanges: () => import("./TrackChangesPlugin.native-Bghu2q4a.mjs").then((n) => n.TrackChangesPlugin()),
4016
+ versionDiff: () => import("./VersionDiffPlugin.native-DJZIzFSK.mjs").then((n) => n.VersionDiffPlugin()),
4017
+ "version-diff": () => import("./VersionDiffPlugin.native-DJZIzFSK.mjs").then((n) => n.VersionDiffPlugin()),
4018
+ versiondiff: () => import("./VersionDiffPlugin.native-DJZIzFSK.mjs").then((n) => n.VersionDiffPlugin()),
4019
+ conditionalContent: () => import("./ConditionalContentPlugin.native-B3R6xcqn.mjs").then((n) => n.ConditionalContentPlugin()),
4020
+ "conditional-content": () => import("./ConditionalContentPlugin.native-B3R6xcqn.mjs").then((n) => n.ConditionalContentPlugin()),
4021
+ conditionalcontent: () => import("./ConditionalContentPlugin.native-B3R6xcqn.mjs").then((n) => n.ConditionalContentPlugin()),
4022
+ dataBinding: () => import("./DataBindingPlugin.native-DbaDeXNp.mjs").then((n) => n.DataBindingPlugin()),
4023
+ "data-binding": () => import("./DataBindingPlugin.native-DbaDeXNp.mjs").then((n) => n.DataBindingPlugin()),
4024
+ databinding: () => import("./DataBindingPlugin.native-DbaDeXNp.mjs").then((n) => n.DataBindingPlugin()),
4025
+ docSchema: () => import("./DocSchemaPlugin.native-DUSVRHqT.mjs").then((n) => n.DocSchemaPlugin()),
4026
+ "doc-schema": () => import("./DocSchemaPlugin.native-DUSVRHqT.mjs").then((n) => n.DocSchemaPlugin()),
4027
+ docschema: () => import("./DocSchemaPlugin.native-DUSVRHqT.mjs").then((n) => n.DocSchemaPlugin()),
4028
+ translationWorkflow: () => import("./TranslationWorkflowPlugin.native-BGXVJD9f.mjs").then((n) => n.TranslationWorkflowPlugin()),
4029
+ "translation-workflow": () => import("./TranslationWorkflowPlugin.native-BGXVJD9f.mjs").then((n) => n.TranslationWorkflowPlugin()),
4030
+ translationworkflow: () => import("./TranslationWorkflowPlugin.native-BGXVJD9f.mjs").then((n) => n.TranslationWorkflowPlugin()),
4031
+ contentRules: () => import("./ContentRulesPlugin.native-BISqhQKJ.mjs").then((n) => n.ContentRulesPlugin()),
4032
+ "content-rules": () => import("./ContentRulesPlugin.native-BISqhQKJ.mjs").then((n) => n.ContentRulesPlugin()),
4033
+ contentrules: () => import("./ContentRulesPlugin.native-BISqhQKJ.mjs").then((n) => n.ContentRulesPlugin()),
4034
+ citations: () => import("./CitationsPlugin.native-BFChgCSV.mjs").then((n) => n.CitationsPlugin()),
4035
+ citation: () => import("./CitationsPlugin.native-BFChgCSV.mjs").then((n) => n.CitationsPlugin()),
4036
+ approvalWorkflow: () => import("./ApprovalWorkflowPlugin.native-AeJsehXM.mjs").then((n) => n.ApprovalWorkflowPlugin()),
4037
+ "approval-workflow": () => import("./ApprovalWorkflowPlugin.native-AeJsehXM.mjs").then((n) => n.ApprovalWorkflowPlugin()),
4038
+ approvalworkflow: () => import("./ApprovalWorkflowPlugin.native-AeJsehXM.mjs").then((n) => n.ApprovalWorkflowPlugin()),
4039
+ piiRedaction: () => import("./PIIRedactionPlugin.native-Cm0bpzQb.mjs").then((n) => n.PIIRedactionPlugin()),
4040
+ "pii-redaction": () => import("./PIIRedactionPlugin.native-Cm0bpzQb.mjs").then((n) => n.PIIRedactionPlugin()),
4041
+ piiredaction: () => import("./PIIRedactionPlugin.native-Cm0bpzQb.mjs").then((n) => n.PIIRedactionPlugin()),
4042
+ smartPaste: () => import("./SmartPastePlugin.native-DnOJhDsf.mjs").then((n) => n.SmartPastePlugin()),
4043
+ "smart-paste": () => import("./SmartPastePlugin.native-DnOJhDsf.mjs").then((n) => n.SmartPastePlugin()),
4044
+ smartpaste: () => import("./SmartPastePlugin.native-DnOJhDsf.mjs").then((n) => n.SmartPastePlugin()),
4045
+ blocksLibrary: () => import("./BlocksLibraryPlugin.native-D9OPcnQV.mjs").then((n) => n.BlocksLibraryPlugin()),
4046
+ "blocks-library": () => import("./BlocksLibraryPlugin.native-D9OPcnQV.mjs").then((n) => n.BlocksLibraryPlugin()),
4047
+ blockslibrary: () => import("./BlocksLibraryPlugin.native-D9OPcnQV.mjs").then((n) => n.BlocksLibraryPlugin()),
4048
+ mentions: () => import("./MentionPlugin.native-Zb1dwdxU.mjs").then((n) => n.MentionPlugin()),
4049
+ mention: () => import("./MentionPlugin.native-Zb1dwdxU.mjs").then((n) => n.MentionPlugin()),
4050
+ anchor: () => import("./AnchorPlugin.native-Dk9R26cF.mjs").then((n) => n.AnchorPlugin()),
4051
+ embedIframe: () => import("./EmbedIframePlugin.native-qHMf1Jtg.mjs").then((n) => n.EmbedIframePlugin()),
4052
+ math: () => import("./MathPlugin.native-Cq9WQ7cq.mjs").then((n) => n.MathPlugin()),
4053
+ image: () => import("./MediaManagerPlugin.native-CRi24Mrb.mjs").then((n) => n.MediaManagerPlugin()),
4054
+ mergeTag: () => import("./MergeTagPlugin.native-BXkVPvCo.mjs").then((n) => n.MergeTagPlugin()),
4055
+ pageBreak: () => import("./PageBreakPlugin.native-DijGuHJZ.mjs").then((n) => n.PageBreakPlugin()),
4056
+ print: () => import("./PrintPlugin.native-7qt5v7L5.mjs").then((n) => n.PrintPlugin()),
4057
+ preview: () => import("./PreviewPlugin.native-CrfiwP2J.mjs").then((n) => n.PreviewPlugin()),
4058
+ specialCharacters: () => import("./SpecialCharactersPlugin.native-B0XaCfjZ.mjs").then((n) => n.SpecialCharactersPlugin()),
4059
+ slashCommands: () => import("./SlashCommandsPlugin.native-BzGTRmMB.mjs").then((n) => n.SlashCommandsPlugin()),
4060
+ "slash-commands": () => import("./SlashCommandsPlugin.native-BzGTRmMB.mjs").then((n) => n.SlashCommandsPlugin()),
4061
+ spellCheck: () => import("./SpellCheckPlugin.native-BE7os1Xj.mjs").then((n) => n.SpellCheckPlugin()),
4062
+ emojis: () => import("./EmojisPlugin.native-B64efKg5.mjs").then((n) => n.EmojisPlugin()),
4063
+ a11yChecker: () => import("./A11yCheckerPlugin.native-BBCsR5Ur.mjs").then((n) => n.A11yCheckerPlugin()),
4064
+ comments: () => import("./CommentsPlugin.native-DHCDUm9f.mjs").then((n) => n.CommentsPlugin()),
4065
+ collaboration: () => import("./CollaborationPlugin.native-Bl3R9CRI.mjs").then((n) => n.CollaborationPlugin()),
4066
+ "document-manager": () => import("./DocumentManagerPlugin.native-tZqIa9o5.mjs").then((n) => n.DocumentManagerPlugin()),
4067
+ fullscreen: () => import("./FullscreenPlugin.native-ChXyxeNw.mjs").then((n) => n.FullscreenPlugin()),
4068
+ template: () => import("./TemplatePlugin.native-OD8Wc1R7.mjs").then((n) => n.TemplatePlugin()),
4069
+ footnote: () => import("./FootnotePlugin.native-D730OGRm.mjs").then((n) => n.FootnotePlugin())
3999
4070
  };
4000
- async function vi() {
4001
- return Object.entries(yi).forEach(([o, t]) => {
4002
- Yt.register(o, t);
4071
+ async function Ei() {
4072
+ return Object.entries(yi).forEach(([n, t]) => {
4073
+ Yt.register(n, t);
4003
4074
  }), Yt;
4004
4075
  }
4005
- typeof window != "undefined" && vi().then((o) => {
4006
- W.__globalPluginLoader = o, customElements.get("editora-editor") || customElements.define("editora-editor", W);
4076
+ typeof window != "undefined" && Ei().then((n) => {
4077
+ W.__globalPluginLoader = n, customElements.get("editora-editor") || customElements.define("editora-editor", W);
4007
4078
  const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
4008
4079
  t.forEach((a) => {
4009
4080
  const l = a.innerHTML.trim();
4010
4081
  e.push(l), l && a.setAttribute("data-initial-content", l);
4011
4082
  });
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);
4083
+ const o = document.querySelectorAll("editora-editor");
4084
+ Array.from(o).filter((a) => !a.hasAttribute("data-initial-content")).forEach((a) => {
4085
+ const l = Array.from(o).indexOf(a);
4015
4086
  e[l] && a.setAttribute("data-initial-content", e[l]);
4016
4087
  }), window.Editora = {
4017
4088
  version: "1.0.0",
@@ -4025,6 +4096,6 @@ typeof window != "undefined" && vi().then((o) => {
4025
4096
  });
4026
4097
  export {
4027
4098
  W as RichTextEditorElement,
4028
- vi as initWebComponent
4099
+ Ei as initWebComponent
4029
4100
  };
4030
4101
  //# sourceMappingURL=webcomponent.js.map