@editora/core 1.0.33 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- class qt {
1
+ class Yt {
2
2
  constructor(t, e, o) {
3
3
  this.doc = t, this.selection = e, this.schema = o;
4
4
  }
5
5
  static create(t, e) {
6
6
  const o = e || t.node("doc", {}, [t.node("paragraph")]);
7
- return new qt(o, { anchor: 0, head: 0 }, t);
7
+ return new Yt(o, { anchor: 0, head: 0 }, t);
8
8
  }
9
9
  apply(t, e) {
10
- return new qt(t, e || this.selection, this.schema);
10
+ return new Yt(t, e || this.selection, this.schema);
11
11
  }
12
12
  }
13
- class dn {
13
+ class fn {
14
14
  constructor(t, e) {
15
15
  this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
16
16
  }
@@ -21,7 +21,7 @@ class dn {
21
21
  return { type: "text", text: t, marks: e };
22
22
  }
23
23
  }
24
- class So {
24
+ class Lo {
25
25
  constructor() {
26
26
  this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
27
27
  }
@@ -58,7 +58,7 @@ class So {
58
58
  const t = {}, e = {};
59
59
  return this.plugins.forEach((o) => {
60
60
  o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
61
- }), new dn(t, e);
61
+ }), new fn(t, e);
62
62
  }
63
63
  getCommands() {
64
64
  const t = {};
@@ -112,10 +112,10 @@ class So {
112
112
  await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
113
113
  }
114
114
  }
115
- function Ti() {
116
- return new So();
115
+ function Li() {
116
+ return new Lo();
117
117
  }
118
- class un {
118
+ class pn {
119
119
  constructor(t) {
120
120
  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) => {
121
121
  this.registerShortcut(e);
@@ -450,7 +450,7 @@ class un {
450
450
  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";
451
451
  }
452
452
  }
453
- class fn {
453
+ class hn {
454
454
  constructor(t = {}) {
455
455
  this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
456
456
  this.register(e, o);
@@ -493,11 +493,11 @@ class fn {
493
493
  this.commands.clear();
494
494
  }
495
495
  }
496
- class pn {
496
+ class mn {
497
497
  constructor(t = {}) {
498
- this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new So(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
498
+ this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new Lo(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
499
499
  const e = this.pluginManager.buildSchema();
500
- this.state = qt.create(e), this.commandRegistry = new fn(this.pluginManager.getCommands());
500
+ this.state = Yt.create(e), this.commandRegistry = new hn(this.pluginManager.getCommands());
501
501
  }
502
502
  /**
503
503
  * Execute a command
@@ -579,7 +579,70 @@ class pn {
579
579
  return this.isDestroyed;
580
580
  }
581
581
  }
582
- class hn {
582
+ const _o = {
583
+ bold: "toggleBold",
584
+ italic: "toggleItalic",
585
+ underline: "toggleUnderline",
586
+ strikethrough: "toggleStrikethrough",
587
+ bullist: "toggleBulletList",
588
+ numlist: "toggleOrderedList",
589
+ checklist: "toggleChecklist",
590
+ link: "openLinkDialog",
591
+ image: "insertImage",
592
+ table: "insertTable",
593
+ trackChanges: "toggleTrackChanges",
594
+ acceptTrackChanges: "acceptAllTrackChanges",
595
+ rejectTrackChanges: "rejectAllTrackChanges",
596
+ anchor: "insertAnchor",
597
+ code: "toggleSourceView",
598
+ blockquote: "toggleBlockquote",
599
+ undo: "undo",
600
+ redo: "redo",
601
+ textColor: "openTextColorPicker",
602
+ backgroundColor: "openBackgroundColorPicker",
603
+ fontSize: "fontSize",
604
+ fontFamily: "setFontFamily",
605
+ lineHeight: "setLineHeight",
606
+ heading: "setBlockType",
607
+ paragraph: "setParagraph",
608
+ textAlignment: "setTextAlignment",
609
+ direction: "setDirectionLTR",
610
+ indent: "increaseIndent",
611
+ outdent: "decreaseIndent",
612
+ capitalization: "setCapitalization",
613
+ math: "insertMath",
614
+ specialCharacters: "insertSpecialCharacter",
615
+ emojis: "openEmojiDialog",
616
+ embedIframe: "openEmbedIframeDialog",
617
+ fullscreen: "toggleFullscreen",
618
+ preview: "togglePreview",
619
+ print: "print",
620
+ a11yChecker: "toggleA11yChecker",
621
+ spellCheck: "toggleSpellCheck",
622
+ comments: "addComment",
623
+ showHideComments: "toggleComments",
624
+ toggleComments: "toggleComments",
625
+ footnote: "insertFootnote",
626
+ mergeTags: "insertMergeTag",
627
+ dataBinding: "openDataBindingDialog",
628
+ dataBindingPreview: "openDataBindingDialog",
629
+ contentRules: "toggleContentRulesPanel",
630
+ contentRulesAudit: "runContentRulesAudit",
631
+ contentRulesRealtime: "toggleContentRulesRealtime",
632
+ mention: "insertMention",
633
+ slash: "openSlashCommands",
634
+ slashCommands: "openSlashCommands",
635
+ pageBreak: "insertPageBreak",
636
+ template: "insertTemplate",
637
+ importWord: "importWord",
638
+ exportWord: "exportWord",
639
+ exportPdf: "exportPdf",
640
+ insertImage: "insertImage",
641
+ insertVideo: "insertVideo",
642
+ insertAudio: "insertAudio",
643
+ codeBlock: "insertCodeBlock"
644
+ };
645
+ class gn {
583
646
  constructor(t, e, o) {
584
647
  this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (i) => {
585
648
  var l, c;
@@ -603,126 +666,62 @@ class hn {
603
666
  * Parse toolbar string into button groups
604
667
  */
605
668
  parseToolbarString(t) {
606
- const e = [], o = t.split("|").map((c) => c.trim()), i = this.getAvailableToolbarItems(), r = /* @__PURE__ */ new Map();
607
- i.forEach((c) => {
608
- c.command && r.set(c.command, c), c.type === "group" && c.label && r.set(c.label, c);
609
- });
610
- const l = {
611
- bold: "toggleBold",
612
- italic: "toggleItalic",
613
- underline: "toggleUnderline",
614
- strikethrough: "toggleStrikethrough",
615
- bullist: "toggleBulletList",
616
- numlist: "toggleOrderedList",
617
- checklist: "toggleChecklist",
618
- link: "openLinkDialog",
619
- image: "openImageDialog",
620
- table: "insertTable",
621
- trackChanges: "toggleTrackChanges",
622
- acceptTrackChanges: "acceptAllTrackChanges",
623
- rejectTrackChanges: "rejectAllTrackChanges",
624
- anchor: "insertAnchor",
625
- code: "toggleSourceView",
626
- blockquote: "toggleBlockquote",
627
- undo: "undo",
628
- redo: "redo",
629
- textColor: "openTextColorPicker",
630
- backgroundColor: "openBackgroundColorPicker",
631
- fontSize: "fontSize",
632
- fontFamily: "setFontFamily",
633
- lineHeight: "setLineHeight",
634
- heading: "setBlockType",
635
- paragraph: "setParagraph",
636
- textAlignment: "setTextAlignment",
637
- direction: "setDirectionLTR",
638
- indent: "increaseIndent",
639
- outdent: "decreaseIndent",
640
- capitalization: "setCapitalization",
641
- math: "insertMath",
642
- specialCharacters: "insertSpecialCharacter",
643
- emojis: "openEmojiDialog",
644
- embedIframe: "openEmbedIframeDialog",
645
- fullscreen: "toggleFullscreen",
646
- preview: "togglePreview",
647
- print: "print",
648
- a11yChecker: "toggleA11yChecker",
649
- spellCheck: "toggleSpellCheck",
650
- comments: "addComment",
651
- showHideComments: "toggleComments",
652
- toggleComments: "toggleComments",
653
- footnote: "insertFootnote",
654
- mergeTags: "insertMergeTag",
655
- dataBinding: "openDataBindingDialog",
656
- dataBindingPreview: "openDataBindingDialog",
657
- contentRules: "toggleContentRulesPanel",
658
- contentRulesAudit: "runContentRulesAudit",
659
- contentRulesRealtime: "toggleContentRulesRealtime",
660
- mention: "insertMention",
661
- slash: "openSlashCommands",
662
- slashCommands: "openSlashCommands",
663
- pageBreak: "insertPageBreak",
664
- template: "insertTemplate",
665
- importWord: "importWord",
666
- exportWord: "exportWord",
667
- exportPdf: "exportPdf",
668
- insertImage: "insertImage",
669
- insertVideo: "insertVideo",
670
- insertAudio: "insertAudio",
671
- codeBlock: "insertCodeBlock"
672
- };
673
- return o.forEach((c) => {
674
- const f = [];
675
- c.split(/\s+/).filter(Boolean).forEach((g) => {
676
- if (g === "direction") {
677
- const v = r.get("setDirectionLTR"), k = r.get("setDirectionRTL");
678
- v && f.push({
669
+ const e = [], o = t.split("|").map((l) => l.trim()), i = this.getAvailableToolbarItems(), r = /* @__PURE__ */ new Map();
670
+ return i.forEach((l) => {
671
+ l.command && r.set(l.command, l), l.type === "group" && l.label && r.set(l.label, l);
672
+ }), o.forEach((l) => {
673
+ const c = [];
674
+ l.split(/\s+/).filter(Boolean).forEach((h) => {
675
+ if (h === "direction") {
676
+ const k = r.get("setDirectionLTR"), w = r.get("setDirectionRTL");
677
+ k && c.push({
679
678
  id: "directionLTR",
680
- label: v.label,
681
- command: v.command,
682
- icon: v.icon,
683
- type: v.type || "button",
684
- options: v.options
685
- }), k && f.push({
686
- id: "directionRTL",
687
679
  label: k.label,
688
680
  command: k.command,
689
681
  icon: k.icon,
690
682
  type: k.type || "button",
691
683
  options: k.options
684
+ }), w && c.push({
685
+ id: "directionRTL",
686
+ label: w.label,
687
+ command: w.command,
688
+ icon: w.icon,
689
+ type: w.type || "button",
690
+ options: w.options
692
691
  });
693
692
  return;
694
693
  }
695
- if (g === "comments") {
696
- const v = r.get("addComment"), k = r.get("toggleComments");
697
- v && f.push({
694
+ if (h === "comments") {
695
+ const k = r.get("addComment"), w = r.get("toggleComments");
696
+ k && c.push({
698
697
  id: "addComment",
699
- label: v.label,
700
- command: v.command,
701
- icon: v.icon,
702
- type: v.type || "button",
703
- options: v.options
704
- }), k && f.push({
705
- id: "toggleComments",
706
698
  label: k.label,
707
699
  command: k.command,
708
700
  icon: k.icon,
709
701
  type: k.type || "button",
710
702
  options: k.options
703
+ }), w && c.push({
704
+ id: "toggleComments",
705
+ label: w.label,
706
+ command: w.command,
707
+ icon: w.icon,
708
+ type: w.type || "button",
709
+ options: w.options
711
710
  });
712
711
  return;
713
712
  }
714
- const w = l[g] || g;
715
- let T = r.get(w);
716
- T || (T = r.get(g)), T && f.push({
717
- id: g,
718
- label: T.label,
719
- command: T.command,
720
- icon: T.icon,
721
- type: T.type === "separator" ? "separator" : T.type || "button",
722
- options: T.options,
723
- items: T.items
713
+ const g = _o[h] || h;
714
+ let b = r.get(g);
715
+ b || (b = r.get(h)), b && c.push({
716
+ id: h,
717
+ label: b.label,
718
+ command: b.command,
719
+ icon: b.icon,
720
+ type: b.type === "separator" ? "separator" : b.type || "button",
721
+ options: b.options,
722
+ items: b.items
724
723
  });
725
- }), f.length > 0 && e.push(f);
724
+ }), c.length > 0 && e.push(c);
726
725
  }), e;
727
726
  }
728
727
  /**
@@ -741,13 +740,13 @@ class hn {
741
740
  const o = this.config.items || this.getDefaultToolbarString(), i = this.parseToolbarString(o);
742
741
  i.forEach((r, l) => {
743
742
  const c = document.createElement("div");
744
- if (c.className = "editora-toolbar-group", r.forEach((f) => {
745
- this.appendToolbarButton(c, f);
746
- const m = c.lastElementChild;
747
- m instanceof HTMLElement && (this.overflowUnits.push(m), this.overflowUnitHomes.set(m, c));
743
+ if (c.className = "editora-toolbar-group", r.forEach((p) => {
744
+ this.appendToolbarButton(c, p);
745
+ const h = c.lastElementChild;
746
+ h instanceof HTMLElement && (this.overflowUnits.push(h), this.overflowUnitHomes.set(h, c));
748
747
  }), e.appendChild(c), l < i.length - 1) {
749
- const f = document.createElement("div");
750
- f.className = "editora-toolbar-separator", e.appendChild(f);
748
+ const p = document.createElement("div");
749
+ p.className = "editora-toolbar-separator", e.appendChild(p);
751
750
  }
752
751
  }), t.appendChild(e), this.setupOverflow(t);
753
752
  }
@@ -766,24 +765,24 @@ class hn {
766
765
  const c = this.overflowUnits;
767
766
  if (c.length === 0) return;
768
767
  c.forEach((B) => {
769
- var O;
770
- B.parentElement === i && ((O = this.overflowUnitHomes.get(B)) == null || O.appendChild(B));
768
+ var I;
769
+ B.parentElement === i && ((I = this.overflowUnitHomes.get(B)) == null || I.appendChild(B));
771
770
  });
772
- const f = t.clientWidth, m = 16, g = 40, w = 4, T = Math.max(0, f - m), v = Math.max(0, T - g - w), k = getComputedStyle(t).direction === "rtl", tt = e.getBoundingClientRect(), $ = (B) => {
773
- const O = B.getBoundingClientRect();
774
- return k ? tt.right - O.left : O.right - tt.left;
771
+ const p = t.clientWidth, h = 16, g = 40, b = 4, k = Math.max(0, p - h), w = Math.max(0, k - g - b), R = getComputedStyle(t).direction === "rtl", tt = e.getBoundingClientRect(), $ = (B) => {
772
+ const I = B.getBoundingClientRect();
773
+ return R ? tt.right - I.left : I.right - tt.left;
775
774
  };
776
775
  let z = 0;
777
- if ($(c[c.length - 1]) <= T)
776
+ if ($(c[c.length - 1]) <= k)
778
777
  z = c.length;
779
778
  else
780
779
  for (const B of c)
781
- if ($(B) <= v) z++;
780
+ if ($(B) <= w) z++;
782
781
  else break;
783
782
  z = Math.max(1, Math.min(z, c.length));
784
783
  const at = z < c.length;
785
- o.style.display = at ? "" : "none", o.classList.toggle("active", at && this.expandedOpen), !at && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, O) => {
786
- O >= z && i.appendChild(B);
784
+ o.style.display = at ? "" : "none", o.classList.toggle("active", at && this.expandedOpen), !at && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, I) => {
785
+ I >= z && i.appendChild(B);
787
786
  });
788
787
  }, l = () => {
789
788
  this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
@@ -871,42 +870,42 @@ class hn {
871
870
  * mouse click leaves the focus alone, so the editor keeps its selection.
872
871
  */
873
872
  makeMenuAccessible(t, e, o, i) {
874
- e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", "false"), o.setAttribute("role", "menu"), o.setAttribute("aria-label", i), o.querySelectorAll(".editora-toolbar-dropdown-item").forEach((m) => {
875
- m.setAttribute("role", "menuitem"), m.tabIndex = -1;
873
+ e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", "false"), o.setAttribute("role", "menu"), o.setAttribute("aria-label", i), o.querySelectorAll(".editora-toolbar-dropdown-item").forEach((h) => {
874
+ h.setAttribute("role", "menuitem"), h.tabIndex = -1;
876
875
  });
877
876
  const r = () => Array.from(o.querySelectorAll('[role="menuitem"]')), l = () => o.style.display === "block", c = new MutationObserver(() => {
878
877
  e.setAttribute("aria-expanded", l() ? "true" : "false");
879
878
  });
880
879
  c.observe(o, { attributes: !0, attributeFilter: ["style"] });
881
- const f = t._cleanupDropdown;
880
+ const p = t._cleanupDropdown;
882
881
  t._cleanupDropdown = () => {
883
- c.disconnect(), f == null || f();
884
- }, e.addEventListener("click", (m) => {
882
+ c.disconnect(), p == null || p();
883
+ }, e.addEventListener("click", (h) => {
885
884
  var g;
886
- m.detail === 0 && l() && ((g = r()[0]) == null || g.focus());
887
- }), e.addEventListener("keydown", (m) => {
888
- var w;
889
- if (m.key !== "ArrowDown" && m.key !== "ArrowUp") return;
890
- m.preventDefault(), l() || e.click();
885
+ h.detail === 0 && l() && ((g = r()[0]) == null || g.focus());
886
+ }), e.addEventListener("keydown", (h) => {
887
+ var b;
888
+ if (h.key !== "ArrowDown" && h.key !== "ArrowUp") return;
889
+ h.preventDefault(), l() || e.click();
891
890
  const g = r();
892
- (w = m.key === "ArrowUp" ? g[g.length - 1] : g[0]) == null || w.focus();
893
- }), o.addEventListener("keydown", (m) => {
891
+ (b = h.key === "ArrowUp" ? g[g.length - 1] : g[0]) == null || b.focus();
892
+ }), o.addEventListener("keydown", (h) => {
894
893
  const g = r();
895
894
  if (g.length === 0) return;
896
- const w = g.indexOf(document.activeElement), T = (v) => {
897
- m.preventDefault(), g[(v + g.length) % g.length].focus();
895
+ const b = g.indexOf(document.activeElement), k = (w) => {
896
+ h.preventDefault(), g[(w + g.length) % g.length].focus();
898
897
  };
899
- switch (m.key) {
898
+ switch (h.key) {
900
899
  case "ArrowDown":
901
- return T(w + 1);
900
+ return k(b + 1);
902
901
  case "ArrowUp":
903
- return T(w < 0 ? g.length - 1 : w - 1);
902
+ return k(b < 0 ? g.length - 1 : b - 1);
904
903
  case "Home":
905
- return T(0);
904
+ return k(0);
906
905
  case "End":
907
- return T(g.length - 1);
906
+ return k(g.length - 1);
908
907
  case "Escape":
909
- m.preventDefault(), m.stopPropagation(), o.style.display = "none", e.focus();
908
+ h.preventDefault(), h.stopPropagation(), o.style.display = "none", e.focus();
910
909
  return;
911
910
  case "Tab":
912
911
  o.style.display = "none";
@@ -924,14 +923,14 @@ class hn {
924
923
  o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
925
924
  const i = document.createElement("div");
926
925
  i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
927
- const f = document.createElement("button");
928
- f.className = "editora-toolbar-dropdown-item", f.type = "button", f.textContent = c.label, f.setAttribute("data-value", c.value), f.addEventListener("click", (m) => {
929
- m.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
930
- }), i.appendChild(f);
926
+ const p = document.createElement("button");
927
+ p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (h) => {
928
+ h.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
929
+ }), i.appendChild(p);
931
930
  }), o.addEventListener("click", (c) => {
932
931
  c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
933
- const f = i.style.display === "block";
934
- i.style.display = f ? "none" : "block";
932
+ const p = i.style.display === "block";
933
+ i.style.display = p ? "none" : "block";
935
934
  });
936
935
  const r = (c) => {
937
936
  e.contains(c.target) || (i.style.display = "none");
@@ -959,17 +958,17 @@ class hn {
959
958
  o.textContent = t.label;
960
959
  const i = document.createElement("div");
961
960
  i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
962
- const f = document.createElement("button");
963
- f.className = "editora-toolbar-dropdown-item", f.type = "button", f.textContent = c.label, f.setAttribute("data-value", c.value), f.addEventListener("click", (m) => {
964
- m.preventDefault(), m.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
965
- }), i.appendChild(f);
961
+ const p = document.createElement("button");
962
+ p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (h) => {
963
+ h.preventDefault(), h.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
964
+ }), i.appendChild(p);
966
965
  }), o.addEventListener("click", (c) => {
967
- var m;
966
+ var h;
968
967
  c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
969
- const f = (m = this.container) == null ? void 0 : m.querySelectorAll(
968
+ const p = (h = this.container) == null ? void 0 : h.querySelectorAll(
970
969
  ".editora-toolbar-dropdown-menu"
971
970
  );
972
- f == null || f.forEach((g) => {
971
+ p == null || p.forEach((g) => {
973
972
  g !== i && (g.style.display = "none");
974
973
  }), i.style.display = i.style.display === "none" ? "block" : "none";
975
974
  });
@@ -1009,7 +1008,7 @@ class hn {
1009
1008
  }), 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;
1010
1009
  }
1011
1010
  }
1012
- class mn {
1011
+ class bn {
1013
1012
  constructor(t) {
1014
1013
  this.visible = !1, this.config = t;
1015
1014
  }
@@ -1051,7 +1050,7 @@ class mn {
1051
1050
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
1052
1051
  }
1053
1052
  }
1054
- class gn {
1053
+ class yn {
1055
1054
  constructor(t = {}) {
1056
1055
  this.statusInfo = {}, this.config = t;
1057
1056
  }
@@ -1093,14 +1092,14 @@ class gn {
1093
1092
  }), o.forEach((r, l) => {
1094
1093
  const c = document.createElement("span");
1095
1094
  if (c.className = "editora-statusbar-item", c.textContent = r, t.appendChild(c), l < o.length - 1) {
1096
- const f = document.createElement("span");
1097
- f.className = "editora-statusbar-separator", f.textContent = "|", t.appendChild(f);
1095
+ const p = document.createElement("span");
1096
+ p.className = "editora-statusbar-separator", p.textContent = "|", t.appendChild(p);
1098
1097
  }
1099
1098
  }), i.forEach((r, l) => {
1100
1099
  const c = document.createElement("span");
1101
1100
  if (c.className = "editora-statusbar-item", c.textContent = r, e.appendChild(c), l < i.length - 1) {
1102
- const f = document.createElement("span");
1103
- f.className = "editora-statusbar-separator", f.textContent = "|", e.appendChild(f);
1101
+ const p = document.createElement("span");
1102
+ p.className = "editora-statusbar-separator", p.textContent = "|", e.appendChild(p);
1104
1103
  }
1105
1104
  }), this.container.appendChild(t), this.container.appendChild(e);
1106
1105
  }
@@ -1111,12 +1110,12 @@ class gn {
1111
1110
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
1112
1111
  }
1113
1112
  }
1114
- function bn(a, t) {
1115
- const e = a.textContent || "", o = yn(a, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
1113
+ function En(a, t) {
1114
+ const e = a.textContent || "", o = vn(a, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
1116
1115
  `), l = r.length, c = r[r.length - 1].length + 1;
1117
1116
  return { line: l, column: c };
1118
1117
  }
1119
- function yn(a, t, e) {
1118
+ function vn(a, t, e) {
1120
1119
  var l;
1121
1120
  let o = 0;
1122
1121
  const i = document.createTreeWalker(
@@ -1134,7 +1133,7 @@ function yn(a, t, e) {
1134
1133
  }
1135
1134
  return o;
1136
1135
  }
1137
- function En(a) {
1136
+ function kn(a) {
1138
1137
  var o, i;
1139
1138
  const t = a.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
1140
1139
  let e = 1;
@@ -1149,11 +1148,11 @@ function En(a) {
1149
1148
  }
1150
1149
  return e;
1151
1150
  }
1152
- function vn(a) {
1151
+ function wn(a) {
1153
1152
  const t = a.trim() ? a.trim().split(/\s+/).length : 0, e = a.length;
1154
1153
  return { words: t, chars: e };
1155
1154
  }
1156
- function wn(a, t) {
1155
+ function Tn(a, t) {
1157
1156
  const e = a.toString();
1158
1157
  return {
1159
1158
  startLine: t.line,
@@ -1170,72 +1169,72 @@ function ro(a, t) {
1170
1169
  for (var e = 0, o = Array(t); e < t; e++) o[e] = a[e];
1171
1170
  return o;
1172
1171
  }
1173
- function Tn(a) {
1172
+ function Cn(a) {
1174
1173
  if (Array.isArray(a)) return a;
1175
1174
  }
1176
- function kn(a, t) {
1175
+ function xn(a, t) {
1177
1176
  var e = a == null ? null : typeof Symbol != "undefined" && a[Symbol.iterator] || a["@@iterator"];
1178
1177
  if (e != null) {
1179
- var o, i, r, l, c = [], f = !0, m = !1;
1178
+ var o, i, r, l, c = [], p = !0, h = !1;
1180
1179
  try {
1181
- if (r = (e = e.call(a)).next, t !== 0) for (; !(f = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); f = !0) ;
1180
+ if (r = (e = e.call(a)).next, t !== 0) for (; !(p = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); p = !0) ;
1182
1181
  } catch (g) {
1183
- m = !0, i = g;
1182
+ h = !0, i = g;
1184
1183
  } finally {
1185
1184
  try {
1186
- if (!f && e.return != null && (l = e.return(), Object(l) !== l)) return;
1185
+ if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
1187
1186
  } finally {
1188
- if (m) throw i;
1187
+ if (h) throw i;
1189
1188
  }
1190
1189
  }
1191
1190
  return c;
1192
1191
  }
1193
1192
  }
1194
- function xn() {
1193
+ function An() {
1195
1194
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1196
1195
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1197
1196
  }
1198
- function An(a, t) {
1199
- return Tn(a) || kn(a, t) || Cn(a, t) || xn();
1197
+ function Sn(a, t) {
1198
+ return Cn(a) || xn(a, t) || Ln(a, t) || An();
1200
1199
  }
1201
- function Cn(a, t) {
1200
+ function Ln(a, t) {
1202
1201
  if (a) {
1203
1202
  if (typeof a == "string") return ro(a, t);
1204
1203
  var e = {}.toString.call(a).slice(8, -1);
1205
1204
  return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ro(a, t) : void 0;
1206
1205
  }
1207
1206
  }
1208
- const _o = Object.entries, ao = Object.setPrototypeOf, Sn = Object.isFrozen, _n = Object.getPrototypeOf, Ln = Object.getOwnPropertyDescriptor;
1209
- let M = Object.freeze, D = Object.seal, yt = Object.create, Lo = typeof Reflect != "undefined" && Reflect, ke = Lo.apply, xe = Lo.construct;
1210
- M || (M = function(t) {
1207
+ const Mo = Object.entries, ao = Object.setPrototypeOf, _n = Object.isFrozen, Mn = Object.getPrototypeOf, Dn = Object.getOwnPropertyDescriptor;
1208
+ let _ = Object.freeze, M = Object.seal, yt = Object.create, Do = typeof Reflect != "undefined" && Reflect, Te = Do.apply, Ce = Do.construct;
1209
+ _ || (_ = function(t) {
1211
1210
  return t;
1212
1211
  });
1213
- D || (D = function(t) {
1212
+ M || (M = function(t) {
1214
1213
  return t;
1215
1214
  });
1216
- ke || (ke = function(t, e) {
1215
+ Te || (Te = function(t, e) {
1217
1216
  for (var o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), r = 2; r < o; r++) i[r - 2] = arguments[r];
1218
1217
  return t.apply(e, i);
1219
1218
  });
1220
- xe || (xe = function(t) {
1219
+ Ce || (Ce = function(t) {
1221
1220
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
1222
1221
  return new t(...o);
1223
1222
  });
1224
- const rt = L(Array.prototype.forEach), Mn = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), Ct = L(Array.prototype.push), Dn = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), lo = L(String.prototype.match), St = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), On = L(Number.prototype.toString), Rn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), fo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), P = L(Object.prototype.hasOwnProperty), _t = L(Object.prototype.toString), I = L(RegExp.prototype.test), Q = Nn(TypeError);
1223
+ const rt = L(Array.prototype.forEach), In = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), At = L(Array.prototype.push), On = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), lo = L(String.prototype.match), St = L(String.prototype.replace), co = L(String.prototype.indexOf), Rn = L(String.prototype.trim), Pn = L(Number.prototype.toString), Nn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), fo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), N = L(Object.prototype.hasOwnProperty), Lt = L(Object.prototype.toString), D = L(RegExp.prototype.test), Q = zn(TypeError);
1225
1224
  function L(a) {
1226
1225
  return function(t) {
1227
1226
  t instanceof RegExp && (t.lastIndex = 0);
1228
1227
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
1229
- return ke(a, t, o);
1228
+ return Te(a, t, o);
1230
1229
  };
1231
1230
  }
1232
- function Nn(a) {
1231
+ function zn(a) {
1233
1232
  return function() {
1234
1233
  for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
1235
- return xe(a, e);
1234
+ return Ce(a, e);
1236
1235
  };
1237
1236
  }
1238
- function E(a, t) {
1237
+ function v(a, t) {
1239
1238
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Mt;
1240
1239
  if (ao && ao(a, null), !vt(t)) return a;
1241
1240
  let o = t.length;
@@ -1243,75 +1242,75 @@ function E(a, t) {
1243
1242
  let i = t[o];
1244
1243
  if (typeof i == "string") {
1245
1244
  const r = e(i);
1246
- r !== i && (Sn(t) || (t[o] = r), i = r);
1245
+ r !== i && (_n(t) || (t[o] = r), i = r);
1247
1246
  }
1248
1247
  a[i] = !0;
1249
1248
  }
1250
1249
  return a;
1251
1250
  }
1252
- function Pn(a) {
1253
- for (let t = 0; t < a.length; t++) P(a, t) || (a[t] = null);
1251
+ function Bn(a) {
1252
+ for (let t = 0; t < a.length; t++) N(a, t) || (a[t] = null);
1254
1253
  return a;
1255
1254
  }
1256
1255
  function U(a) {
1257
1256
  const t = yt(null);
1258
- for (const o of _o(a)) {
1259
- var e = An(o, 2);
1257
+ for (const o of Mo(a)) {
1258
+ var e = Sn(o, 2);
1260
1259
  const i = e[0], r = e[1];
1261
- P(a, i) && (vt(r) ? t[i] = Pn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = U(r) : t[i] = r);
1260
+ N(a, i) && (vt(r) ? t[i] = Bn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = U(r) : t[i] = r);
1262
1261
  }
1263
1262
  return t;
1264
1263
  }
1265
- function zn(a) {
1264
+ function Fn(a) {
1266
1265
  switch (typeof a) {
1267
1266
  case "string":
1268
1267
  return a;
1269
1268
  case "number":
1270
- return On(a);
1269
+ return Pn(a);
1271
1270
  case "boolean":
1272
- return Rn(a);
1271
+ return Nn(a);
1273
1272
  case "bigint":
1274
1273
  return uo ? uo(a) : "0";
1275
1274
  case "symbol":
1276
1275
  return fo ? fo(a) : "Symbol()";
1277
1276
  case "undefined":
1278
- return _t(a);
1277
+ return Lt(a);
1279
1278
  case "function":
1280
1279
  case "object": {
1281
- if (a === null) return _t(a);
1280
+ if (a === null) return Lt(a);
1282
1281
  const t = a, e = W(t, "toString");
1283
1282
  if (typeof e == "function") {
1284
1283
  const o = e(t);
1285
- return typeof o == "string" ? o : _t(o);
1284
+ return typeof o == "string" ? o : Lt(o);
1286
1285
  }
1287
- return _t(a);
1286
+ return Lt(a);
1288
1287
  }
1289
1288
  default:
1290
- return _t(a);
1289
+ return Lt(a);
1291
1290
  }
1292
1291
  }
1293
1292
  function W(a, t) {
1294
1293
  for (; a !== null; ) {
1295
- const o = Ln(a, t);
1294
+ const o = Dn(a, t);
1296
1295
  if (o) {
1297
1296
  if (o.get) return L(o.get);
1298
1297
  if (typeof o.value == "function") return L(o.value);
1299
1298
  }
1300
- a = _n(a);
1299
+ a = Mn(a);
1301
1300
  }
1302
1301
  function e() {
1303
1302
  return null;
1304
1303
  }
1305
1304
  return e;
1306
1305
  }
1307
- function Bn(a) {
1306
+ function Hn(a) {
1308
1307
  try {
1309
- return I(a, ""), !0;
1308
+ return D(a, ""), !0;
1310
1309
  } catch (t) {
1311
1310
  return !1;
1312
1311
  }
1313
1312
  }
1314
- const po = M([
1313
+ const po = _([
1315
1314
  "a",
1316
1315
  "abbr",
1317
1316
  "acronym",
@@ -1431,7 +1430,7 @@ const po = M([
1431
1430
  "var",
1432
1431
  "video",
1433
1432
  "wbr"
1434
- ]), me = M([
1433
+ ]), me = _([
1435
1434
  "svg",
1436
1435
  "a",
1437
1436
  "altglyph",
@@ -1479,7 +1478,7 @@ const po = M([
1479
1478
  "tspan",
1480
1479
  "view",
1481
1480
  "vkern"
1482
- ]), ge = M([
1481
+ ]), ge = _([
1483
1482
  "feBlend",
1484
1483
  "feColorMatrix",
1485
1484
  "feComponentTransfer",
@@ -1505,7 +1504,7 @@ const po = M([
1505
1504
  "feSpotLight",
1506
1505
  "feTile",
1507
1506
  "feTurbulence"
1508
- ]), Hn = M([
1507
+ ]), Un = _([
1509
1508
  "animate",
1510
1509
  "color-profile",
1511
1510
  "cursor",
@@ -1528,7 +1527,7 @@ const po = M([
1528
1527
  "solidcolor",
1529
1528
  "unknown",
1530
1529
  "use"
1531
- ]), be = M([
1530
+ ]), be = _([
1532
1531
  "math",
1533
1532
  "menclose",
1534
1533
  "merror",
@@ -1559,7 +1558,7 @@ const po = M([
1559
1558
  "munder",
1560
1559
  "munderover",
1561
1560
  "mprescripts"
1562
- ]), Fn = M([
1561
+ ]), jn = _([
1563
1562
  "maction",
1564
1563
  "maligngroup",
1565
1564
  "malignmark",
@@ -1575,7 +1574,7 @@ const po = M([
1575
1574
  "annotation-xml",
1576
1575
  "mprescripts",
1577
1576
  "none"
1578
- ]), ho = M(["#text"]), mo = M([
1577
+ ]), ho = _(["#text"]), mo = _([
1579
1578
  "accept",
1580
1579
  "action",
1581
1580
  "align",
@@ -1694,7 +1693,7 @@ const po = M([
1694
1693
  "width",
1695
1694
  "wrap",
1696
1695
  "xmlns"
1697
- ]), ye = M([
1696
+ ]), ye = _([
1698
1697
  "accent-height",
1699
1698
  "accumulate",
1700
1699
  "additive",
@@ -1887,7 +1886,7 @@ const po = M([
1887
1886
  "y2",
1888
1887
  "z",
1889
1888
  "zoomandpan"
1890
- ]), go = M([
1889
+ ]), go = _([
1891
1890
  "accent",
1892
1891
  "accentunder",
1893
1892
  "align",
@@ -1942,13 +1941,13 @@ const po = M([
1942
1941
  "voffset",
1943
1942
  "width",
1944
1943
  "xmlns"
1945
- ]), Gt = M([
1944
+ ]), Gt = _([
1946
1945
  "xlink:href",
1947
1946
  "xml:id",
1948
1947
  "xlink:title",
1949
1948
  "xml:space",
1950
1949
  "xmlns:xlink"
1951
- ]), Un = D(/{{[\w\W]*|^[\w\W]*}}/g), jn = D(/<%[\w\W]*|^[\w\W]*%>/g), Wn = D(/\${[\w\W]*/g), $n = D(/^data-[\-\w.\u00B7-\uFFFF]+$/), Gn = D(/^aria-[\-\w]+$/), bo = D(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Kn = D(/^(?:\w+script|data):/i), Yn = D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), qn = D(/^html$/i), Vn = D(/^[a-z][.\w]*(-[.\w]+)+$/i), yo = D(/<[/\w!]/g), Eo = D(/<[/\w]/g), Xn = D(/<\/no(script|embed|frames)/i), Qn = D(/\/>/i), F = {
1950
+ ]), Wn = M(/{{[\w\W]*|^[\w\W]*}}/g), $n = M(/<%[\w\W]*|^[\w\W]*%>/g), Gn = M(/\${[\w\W]*/g), Kn = M(/^data-[\-\w.\u00B7-\uFFFF]+$/), qn = M(/^aria-[\-\w]+$/), bo = M(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Yn = M(/^(?:\w+script|data):/i), Vn = M(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Xn = M(/^html$/i), Qn = M(/^[a-z][.\w]*(-[.\w]+)+$/i), yo = M(/<[/\w!]/g), Eo = M(/<[/\w]/g), Zn = M(/<\/no(script|embed|frames)/i), Jn = M(/\/>/i), H = {
1952
1951
  element: 1,
1953
1952
  attribute: 2,
1954
1953
  text: 3,
@@ -1961,7 +1960,7 @@ const po = M([
1961
1960
  documentType: 10,
1962
1961
  documentFragment: 11,
1963
1962
  notation: 12
1964
- }, Mo = [
1963
+ }, Io = [
1965
1964
  "style",
1966
1965
  "script",
1967
1966
  "xmp",
@@ -1970,14 +1969,14 @@ const po = M([
1970
1969
  "noframes",
1971
1970
  "plaintext",
1972
1971
  "noscript"
1973
- ], Zn = M(E({}, Mo)), Jn = (function() {
1972
+ ], ti = _(v({}, Io)), ei = (function() {
1974
1973
  const a = {};
1975
- return rt(Mo, (t) => {
1976
- a[t] = D(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
1977
- }), M(a);
1978
- })(), ti = function() {
1974
+ return rt(Io, (t) => {
1975
+ a[t] = M(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
1976
+ }), _(a);
1977
+ })(), oi = function() {
1979
1978
  return typeof window == "undefined" ? null : window;
1980
- }, ei = function(t, e) {
1979
+ }, ni = function(t, e) {
1981
1980
  if (typeof t != "object" || typeof t.createPolicy != "function") return null;
1982
1981
  let o = null;
1983
1982
  const i = "data-tt-policy-suffix";
@@ -2008,23 +2007,23 @@ const po = M([
2008
2007
  uponSanitizeShadowNode: []
2009
2008
  };
2010
2009
  }, Z = function(t, e, o, i) {
2011
- return P(t, e) && vt(t[e]) ? E(i.base ? U(i.base) : {}, t[e], i.transform) : o;
2010
+ return N(t, e) && vt(t[e]) ? v(i.base ? U(i.base) : {}, t[e], i.transform) : o;
2012
2011
  }, Ee = function(t, e, o) {
2013
- const i = P(t, e) ? t[e] : void 0;
2012
+ const i = N(t, e) ? t[e] : void 0;
2014
2013
  return i && typeof i == "object" ? U(i) : o();
2015
2014
  };
2016
- function Do() {
2017
- let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ti();
2018
- const t = (u) => Do(u);
2019
- if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !== F.document || !a.Element)
2015
+ function Oo() {
2016
+ let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : oi();
2017
+ const t = (u) => Oo(u);
2018
+ if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !== H.document || !a.Element)
2020
2019
  return t.isSupported = !1, t;
2021
2020
  let e = a.document;
2022
2021
  const o = e, i = o.currentScript;
2023
2022
  a.DocumentFragment;
2024
- const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, f = a.NodeFilter;
2023
+ const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, p = a.NodeFilter;
2025
2024
  a.NamedNodeMap === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
2026
- const m = a.DOMParser, g = a.trustedTypes, w = c.prototype, T = W(w, "cloneNode"), v = W(w, "remove"), k = W(w, "removeAttributeNode"), tt = W(w, "nextSibling"), $ = W(w, "childNodes"), z = W(w, "parentNode"), at = W(w, "shadowRoot"), B = W(w, "attributes"), O = l && l.prototype ? W(l.prototype, "nodeType") : null, st = l && l.prototype ? W(l.prototype, "nodeName") : null, Dt = l && l.prototype ? W(l.prototype, "ownerDocument") : null, wt = function(n) {
2027
- return O ? O(n) : n.nodeType;
2025
+ const h = a.DOMParser, g = a.trustedTypes, b = c.prototype, k = W(b, "cloneNode"), w = W(b, "remove"), R = W(b, "removeAttributeNode"), tt = W(b, "nextSibling"), $ = W(b, "childNodes"), z = W(b, "parentNode"), at = W(b, "shadowRoot"), B = W(b, "attributes"), I = l && l.prototype ? W(l.prototype, "nodeType") : null, st = l && l.prototype ? W(l.prototype, "nodeName") : null, Dt = l && l.prototype ? W(l.prototype, "ownerDocument") : null, kt = function(n) {
2026
+ return I ? I(n) : n.nodeType;
2028
2027
  }, Xt = function(n) {
2029
2028
  return st ? st(n) : n.nodeName;
2030
2029
  };
@@ -2032,39 +2031,39 @@ function Do() {
2032
2031
  const u = e.createElement("template");
2033
2032
  u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
2034
2033
  }
2035
- let N, et = "", Qt, Se = !1, Tt = 0;
2036
- const _e = function() {
2037
- if (Tt > 0) throw Q('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.');
2034
+ let P, et = "", Qt, Se = !1, wt = 0;
2035
+ const Le = function() {
2036
+ if (wt > 0) throw Q('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.');
2038
2037
  }, lt = function(n) {
2039
- _e(), Tt++;
2038
+ Le(), wt++;
2040
2039
  try {
2041
- return N.createHTML(n);
2040
+ return P.createHTML(n);
2042
2041
  } finally {
2043
- Tt--;
2042
+ wt--;
2044
2043
  }
2045
- }, No = function(n) {
2046
- _e(), Tt++;
2044
+ }, zo = function(n) {
2045
+ Le(), wt++;
2047
2046
  try {
2048
- return N.createScriptURL(n);
2047
+ return P.createScriptURL(n);
2049
2048
  } finally {
2050
- Tt--;
2049
+ wt--;
2051
2050
  }
2052
- }, Po = function() {
2053
- return Se || (Qt = ei(g, i), Se = !0), Qt;
2054
- }, It = e, Zt = It.implementation, Le = It.createNodeIterator, zo = It.createDocumentFragment, Bo = It.getElementsByTagName, Ho = o.importNode;
2055
- let x = vo();
2056
- t.isSupported = typeof _o == "function" && typeof z == "function" && Zt && Zt.createHTMLDocument !== void 0;
2057
- const Fo = Un, Uo = jn, jo = Wn, Wo = $n, $o = Gn, Go = Kn, Me = Yn, Ko = Vn;
2058
- let De = bo, A = null;
2059
- const Jt = E({}, [
2051
+ }, Bo = function() {
2052
+ return Se || (Qt = ni(g, i), Se = !0), Qt;
2053
+ }, It = e, Zt = It.implementation, _e = It.createNodeIterator, Fo = It.createDocumentFragment, Ho = It.getElementsByTagName, Uo = o.importNode;
2054
+ let T = vo();
2055
+ t.isSupported = typeof Mo == "function" && typeof z == "function" && Zt && Zt.createHTMLDocument !== void 0;
2056
+ const jo = Wn, Wo = $n, $o = Gn, Go = Kn, Ko = qn, qo = Yn, Me = Vn, Yo = Qn;
2057
+ let De = bo, C = null;
2058
+ const Jt = v({}, [
2060
2059
  ...po,
2061
2060
  ...me,
2062
2061
  ...ge,
2063
2062
  ...be,
2064
2063
  ...ho
2065
2064
  ]);
2066
- let C = null;
2067
- const te = E({}, [
2065
+ let x = null;
2066
+ const te = v({}, [
2068
2067
  ...mo,
2069
2068
  ...ye,
2070
2069
  ...go,
@@ -2089,8 +2088,8 @@ function Do() {
2089
2088
  enumerable: !0,
2090
2089
  value: !1
2091
2090
  }
2092
- })), kt = null, Ie = null;
2093
- const q = Object.seal(yt(null, {
2091
+ })), Tt = null, Ie = null;
2092
+ const Y = Object.seal(yt(null, {
2094
2093
  tagCheck: {
2095
2094
  writable: !0,
2096
2095
  configurable: !1,
@@ -2104,10 +2103,10 @@ function Do() {
2104
2103
  value: null
2105
2104
  }
2106
2105
  }));
2107
- let Oe = !0, ee = !0, Re = !1, Ne = !0, V = !1, ot = !0, nt = !1, oe = !1, Ot = null, Rt = null, ne = !1, ct = !1, Nt = !1, Pt = !1, Pe = !0, ze = !1;
2106
+ let Oe = !0, ee = !0, Re = !1, Pe = !0, V = !1, ot = !0, nt = !1, oe = !1, Ot = null, Rt = null, ne = !1, ct = !1, Pt = !1, Nt = !1, Ne = !0, ze = !1;
2108
2107
  const Be = "user-content-";
2109
2108
  let ie = !0, re = !1, dt = {}, ut = null;
2110
- const He = E({}, [
2109
+ const Fe = v({}, [
2111
2110
  "annotation-xml",
2112
2111
  "audio",
2113
2112
  "colgroup",
@@ -2135,8 +2134,8 @@ function Do() {
2135
2134
  "video",
2136
2135
  "xmp"
2137
2136
  ]);
2138
- let Fe = null;
2139
- const Ue = E({}, [
2137
+ let He = null;
2138
+ const Ue = v({}, [
2140
2139
  "audio",
2141
2140
  "video",
2142
2141
  "img",
@@ -2145,7 +2144,7 @@ function Do() {
2145
2144
  "track"
2146
2145
  ]);
2147
2146
  let je = null;
2148
- const We = E({}, [
2147
+ const We = v({}, [
2149
2148
  "alt",
2150
2149
  "class",
2151
2150
  "for",
@@ -2162,292 +2161,292 @@ function Do() {
2162
2161
  "xmlns"
2163
2162
  ]), zt = "http://www.w3.org/1998/Math/MathML", Bt = "http://www.w3.org/2000/svg", K = "http://www.w3.org/1999/xhtml";
2164
2163
  let ft = K, ae = !1, se = null;
2165
- const Yo = E({}, [
2164
+ const Vo = v({}, [
2166
2165
  zt,
2167
2166
  Bt,
2168
2167
  K
2169
- ], he), $e = M([
2168
+ ], he), $e = _([
2170
2169
  "mi",
2171
2170
  "mo",
2172
2171
  "mn",
2173
2172
  "ms",
2174
2173
  "mtext"
2175
2174
  ]);
2176
- let le = E({}, $e);
2177
- const Ge = M(["annotation-xml"]);
2178
- let ce = E({}, Ge);
2179
- const qo = E({}, [
2175
+ let le = v({}, $e);
2176
+ const Ge = _(["annotation-xml"]);
2177
+ let ce = v({}, Ge);
2178
+ const Xo = v({}, [
2180
2179
  "title",
2181
2180
  "style",
2182
2181
  "font",
2183
2182
  "a",
2184
2183
  "script"
2185
2184
  ]);
2186
- let xt = null;
2187
- const Vo = ["application/xhtml+xml", "text/html"], Xo = "text/html";
2188
- let _ = null, pt = null;
2189
- const Qo = e.createElement("form"), Ke = function(n) {
2185
+ let Ct = null;
2186
+ const Qo = ["application/xhtml+xml", "text/html"], Zo = "text/html";
2187
+ let S = null, pt = null;
2188
+ const Jo = e.createElement("form"), Ke = function(n) {
2190
2189
  return n instanceof RegExp || n instanceof Function;
2191
2190
  }, de = function() {
2192
2191
  let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2193
2192
  if (pt && pt === n) return;
2194
- (!n || typeof n != "object") && (n = {}), n = U(n), xt = Vo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? Xo : n.PARSER_MEDIA_TYPE, _ = xt === "application/xhtml+xml" ? he : Mt, A = Z(n, "ALLOWED_TAGS", Jt, { transform: _ }), C = Z(n, "ALLOWED_ATTR", te, { transform: _ }), se = Z(n, "ALLOWED_NAMESPACES", Yo, { transform: he }), je = Z(n, "ADD_URI_SAFE_ATTR", We, {
2195
- transform: _,
2193
+ (!n || typeof n != "object") && (n = {}), n = U(n), Ct = Qo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? Zo : n.PARSER_MEDIA_TYPE, S = Ct === "application/xhtml+xml" ? he : Mt, C = Z(n, "ALLOWED_TAGS", Jt, { transform: S }), x = Z(n, "ALLOWED_ATTR", te, { transform: S }), se = Z(n, "ALLOWED_NAMESPACES", Vo, { transform: he }), je = Z(n, "ADD_URI_SAFE_ATTR", We, {
2194
+ transform: S,
2196
2195
  base: We
2197
- }), Fe = Z(n, "ADD_DATA_URI_TAGS", Ue, {
2198
- transform: _,
2196
+ }), He = Z(n, "ADD_DATA_URI_TAGS", Ue, {
2197
+ transform: S,
2199
2198
  base: Ue
2200
- }), ut = Z(n, "FORBID_CONTENTS", He, { transform: _ }), kt = Z(n, "FORBID_TAGS", U({}), { transform: _ }), Ie = Z(n, "FORBID_ATTR", U({}), { transform: _ }), dt = P(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? U(n.USE_PROFILES) : n.USE_PROFILES : !1, Oe = n.ALLOW_ARIA_ATTR !== !1, ee = n.ALLOW_DATA_ATTR !== !1, Re = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = n.SAFE_FOR_TEMPLATES || !1, ot = n.SAFE_FOR_XML !== !1, nt = n.WHOLE_DOCUMENT || !1, ct = n.RETURN_DOM || !1, Nt = n.RETURN_DOM_FRAGMENT || !1, Pt = n.RETURN_TRUSTED_TYPE || !1, ne = n.FORCE_BODY || !1, Pe = n.SANITIZE_DOM !== !1, ze = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, De = Bn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : bo, ft = typeof n.NAMESPACE == "string" ? n.NAMESPACE : K, le = Ee(n, "MATHML_TEXT_INTEGRATION_POINTS", () => E({}, $e)), ce = Ee(n, "HTML_INTEGRATION_POINTS", () => E({}, Ge));
2199
+ }), ut = Z(n, "FORBID_CONTENTS", Fe, { transform: S }), Tt = Z(n, "FORBID_TAGS", U({}), { transform: S }), Ie = Z(n, "FORBID_ATTR", U({}), { transform: S }), dt = N(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? U(n.USE_PROFILES) : n.USE_PROFILES : !1, Oe = n.ALLOW_ARIA_ATTR !== !1, ee = n.ALLOW_DATA_ATTR !== !1, Re = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Pe = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = n.SAFE_FOR_TEMPLATES || !1, ot = n.SAFE_FOR_XML !== !1, nt = n.WHOLE_DOCUMENT || !1, ct = n.RETURN_DOM || !1, Pt = n.RETURN_DOM_FRAGMENT || !1, Nt = n.RETURN_TRUSTED_TYPE || !1, ne = n.FORCE_BODY || !1, Ne = n.SANITIZE_DOM !== !1, ze = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, De = Hn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : bo, ft = typeof n.NAMESPACE == "string" ? n.NAMESPACE : K, le = Ee(n, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, $e)), ce = Ee(n, "HTML_INTEGRATION_POINTS", () => v({}, Ge));
2201
2200
  const s = Ee(n, "CUSTOM_ELEMENT_HANDLING", () => yt(null));
2202
- if (G = yt(null), P(s, "tagNameCheck") && Ke(s.tagNameCheck) && (G.tagNameCheck = s.tagNameCheck), P(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (G.attributeNameCheck = s.attributeNameCheck), P(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), D(G), V && (ee = !1), Nt && (ct = !0), dt && (A = E({}, ho), C = yt(null), dt.html === !0 && (E(A, po), E(C, mo)), dt.svg === !0 && (E(A, me), E(C, ye), E(C, Gt)), dt.svgFilters === !0 && (E(A, ge), E(C, ye), E(C, Gt)), dt.mathMl === !0 && (E(A, be), E(C, go), E(C, Gt))), q.tagCheck = null, q.attributeCheck = null, P(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? q.tagCheck = n.ADD_TAGS : vt(n.ADD_TAGS) && (A === Jt && (A = U(A)), E(A, n.ADD_TAGS, _))), P(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? q.attributeCheck = n.ADD_ATTR : vt(n.ADD_ATTR) && (C === te && (C = U(C)), E(C, n.ADD_ATTR, _))), P(n, "ADD_FORBID_CONTENTS") && vt(n.ADD_FORBID_CONTENTS) && (ut === He && (ut = U(ut)), E(ut, n.ADD_FORBID_CONTENTS, _)), ie && (A["#text"] = !0), nt && E(A, [
2201
+ if (G = yt(null), N(s, "tagNameCheck") && Ke(s.tagNameCheck) && (G.tagNameCheck = s.tagNameCheck), N(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (G.attributeNameCheck = s.attributeNameCheck), N(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), M(G), V && (ee = !1), Pt && (ct = !0), dt && (C = v({}, ho), x = yt(null), dt.html === !0 && (v(C, po), v(x, mo)), dt.svg === !0 && (v(C, me), v(x, ye), v(x, Gt)), dt.svgFilters === !0 && (v(C, ge), v(x, ye), v(x, Gt)), dt.mathMl === !0 && (v(C, be), v(x, go), v(x, Gt))), Y.tagCheck = null, Y.attributeCheck = null, N(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? Y.tagCheck = n.ADD_TAGS : vt(n.ADD_TAGS) && (C === Jt && (C = U(C)), v(C, n.ADD_TAGS, S))), N(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? Y.attributeCheck = n.ADD_ATTR : vt(n.ADD_ATTR) && (x === te && (x = U(x)), v(x, n.ADD_ATTR, S))), N(n, "ADD_FORBID_CONTENTS") && vt(n.ADD_FORBID_CONTENTS) && (ut === Fe && (ut = U(ut)), v(ut, n.ADD_FORBID_CONTENTS, S)), ie && (C["#text"] = !0), nt && v(C, [
2203
2202
  "html",
2204
2203
  "head",
2205
2204
  "body"
2206
- ]), A.table && (E(A, ["tbody"]), delete kt.tbody), n.TRUSTED_TYPES_POLICY) {
2205
+ ]), C.table && (v(C, ["tbody"]), delete Tt.tbody), n.TRUSTED_TYPES_POLICY) {
2207
2206
  if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2208
2207
  if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2209
- const d = N;
2210
- N = n.TRUSTED_TYPES_POLICY;
2208
+ const d = P;
2209
+ P = n.TRUSTED_TYPES_POLICY;
2211
2210
  try {
2212
2211
  et = lt("");
2213
- } catch (p) {
2214
- throw N = d, p;
2212
+ } catch (f) {
2213
+ throw P = d, f;
2215
2214
  }
2216
- } else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Po()), N && typeof et == "string" && (et = lt("")));
2217
- M && M(n), pt = n;
2218
- }, Ye = E({}, [
2215
+ } else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, et = "") : (P === void 0 && (P = Bo()), P && typeof et == "string" && (et = lt("")));
2216
+ _ && _(n), pt = n;
2217
+ }, qe = v({}, [
2219
2218
  ...me,
2220
2219
  ...ge,
2221
- ...Hn
2222
- ]), qe = E({}, [...be, ...Fn]), Zo = function(n, s, d) {
2223
- return s.namespaceURI === K ? n === "svg" : s.namespaceURI === zt ? n === "svg" && (d === "annotation-xml" || le[d]) : !!Ye[n];
2224
- }, Jo = function(n, s, d) {
2225
- return s.namespaceURI === K ? n === "math" : s.namespaceURI === Bt ? n === "math" && ce[d] : !!qe[n];
2226
- }, tn = function(n, s, d) {
2227
- return s.namespaceURI === Bt && !ce[d] || s.namespaceURI === zt && !le[d] ? !1 : !qe[n] && (qo[n] || !Ye[n]);
2228
- }, en = function(n) {
2220
+ ...Un
2221
+ ]), Ye = v({}, [...be, ...jn]), tn = function(n, s, d) {
2222
+ return s.namespaceURI === K ? n === "svg" : s.namespaceURI === zt ? n === "svg" && (d === "annotation-xml" || le[d]) : !!qe[n];
2223
+ }, en = function(n, s, d) {
2224
+ return s.namespaceURI === K ? n === "math" : s.namespaceURI === Bt ? n === "math" && ce[d] : !!Ye[n];
2225
+ }, on = function(n, s, d) {
2226
+ return s.namespaceURI === Bt && !ce[d] || s.namespaceURI === zt && !le[d] ? !1 : !Ye[n] && (Xo[n] || !qe[n]);
2227
+ }, nn = function(n) {
2229
2228
  let s = z(n);
2230
2229
  (!s || !s.tagName) && (s = {
2231
2230
  namespaceURI: ft,
2232
2231
  tagName: "template"
2233
2232
  });
2234
- const d = Mt(n.tagName), p = Mt(s.tagName);
2235
- return se[n.namespaceURI] ? n.namespaceURI === Bt ? Zo(d, s, p) : n.namespaceURI === zt ? Jo(d, s, p) : n.namespaceURI === K ? tn(d, s, p) : !!(xt === "application/xhtml+xml" && se[n.namespaceURI]) : !1;
2233
+ const d = Mt(n.tagName), f = Mt(s.tagName);
2234
+ return se[n.namespaceURI] ? n.namespaceURI === Bt ? tn(d, s, f) : n.namespaceURI === zt ? en(d, s, f) : n.namespaceURI === K ? on(d, s, f) : !!(Ct === "application/xhtml+xml" && se[n.namespaceURI]) : !1;
2236
2235
  }, X = function(n) {
2237
- Ct(t.removed, { element: n });
2236
+ At(t.removed, { element: n });
2238
2237
  try {
2239
2238
  z(n).removeChild(n);
2240
2239
  } catch (s) {
2241
- if (v(n), !z(n)) throw Q("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2240
+ if (w(n), !z(n)) throw Q("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2242
2241
  }
2243
2242
  }, Ve = function(n, s, d) {
2244
2243
  try {
2245
- k(n, s);
2246
- } catch (p) {
2244
+ R(n, s);
2245
+ } catch (f) {
2247
2246
  try {
2248
2247
  n.removeAttribute(d);
2249
- } catch (h) {
2248
+ } catch (m) {
2250
2249
  }
2251
2250
  }
2252
- }, Ht = function(n) {
2253
- Ft(n);
2251
+ }, Ft = function(n) {
2252
+ Ht(n);
2254
2253
  const s = $(n);
2255
2254
  if (s) {
2256
- const p = [];
2257
- rt(s, (h) => {
2258
- Ct(p, h);
2259
- }), rt(p, (h) => {
2255
+ const f = [];
2256
+ rt(s, (m) => {
2257
+ At(f, m);
2258
+ }), rt(f, (m) => {
2260
2259
  try {
2261
- v(h);
2262
- } catch (b) {
2260
+ w(m);
2261
+ } catch (y) {
2263
2262
  }
2264
2263
  });
2265
2264
  }
2266
2265
  const d = B(n);
2267
- if (d) for (let p = d.length - 1; p >= 0; --p) {
2268
- const h = d[p], b = h && h.name;
2269
- typeof b == "string" && Ve(n, h, b);
2266
+ if (d) for (let f = d.length - 1; f >= 0; --f) {
2267
+ const m = d[f], y = m && m.name;
2268
+ typeof y == "string" && Ve(n, m, y);
2270
2269
  }
2271
2270
  }, it = function(n, s, d) {
2272
2271
  if (!d) try {
2273
2272
  d = s.getAttributeNode(n);
2274
- } catch (p) {
2273
+ } catch (f) {
2275
2274
  d = null;
2276
2275
  }
2277
- Ct(t.removed, {
2276
+ At(t.removed, {
2278
2277
  attribute: d || null,
2279
2278
  from: s
2280
2279
  });
2281
2280
  try {
2282
- d ? k(s, d) : s.removeAttribute(n);
2283
- } catch (p) {
2281
+ d ? R(s, d) : s.removeAttribute(n);
2282
+ } catch (f) {
2284
2283
  try {
2285
2284
  s.removeAttribute(n);
2286
- } catch (h) {
2285
+ } catch (m) {
2287
2286
  }
2288
2287
  }
2289
2288
  if (n === "is")
2290
- if (ct || Nt) try {
2289
+ if (ct || Pt) try {
2291
2290
  X(s);
2292
- } catch (p) {
2291
+ } catch (f) {
2293
2292
  }
2294
2293
  else try {
2295
2294
  s.setAttribute(n, "");
2296
- } catch (p) {
2295
+ } catch (f) {
2297
2296
  }
2298
- }, on = function(n) {
2297
+ }, rn = function(n) {
2299
2298
  const s = B(n);
2300
2299
  if (s)
2301
2300
  for (let d = s.length - 1; d >= 0; --d) {
2302
- const p = s[d], h = p && p.name;
2303
- typeof h != "string" || C[_(h)] || Ve(n, p, h);
2301
+ const f = s[d], m = f && f.name;
2302
+ typeof m != "string" || x[S(m)] || Ve(n, f, m);
2304
2303
  }
2305
- }, Ft = function(n) {
2304
+ }, Ht = function(n) {
2306
2305
  const s = [n];
2307
2306
  for (; s.length > 0; ) {
2308
2307
  const d = s.pop();
2309
- wt(d) === F.element && on(d);
2310
- const p = $(d);
2311
- if (p) for (let h = p.length - 1; h >= 0; --h) s.push(p[h]);
2308
+ kt(d) === H.element && rn(d);
2309
+ const f = $(d);
2310
+ if (f) for (let m = f.length - 1; m >= 0; --m) s.push(f[m]);
2312
2311
  }
2313
2312
  }, Xe = function(n, s) {
2314
2313
  return ot ? n === "patchsrc" ? !0 : n === "for" && s !== "label" && s !== "output" : !1;
2315
- }, nn = function(n) {
2314
+ }, an = function(n) {
2316
2315
  if (!ot) return;
2317
2316
  const s = [n];
2318
2317
  for (; s.length > 0; ) {
2319
- const d = s.pop(), p = wt(d);
2320
- if (p === F.processingInstruction || p === F.comment && I(Eo, d.data)) {
2318
+ const d = s.pop(), f = kt(d);
2319
+ if (f === H.processingInstruction || f === H.comment && D(Eo, d.data)) {
2321
2320
  try {
2322
- v(d);
2323
- } catch (b) {
2321
+ w(d);
2322
+ } catch (y) {
2324
2323
  }
2325
2324
  continue;
2326
2325
  }
2327
- if (p === F.element) {
2328
- const b = d, y = _(Xt(d));
2326
+ if (f === H.element) {
2327
+ const y = d, E = S(Xt(d));
2329
2328
  try {
2330
- b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Xe("for", y) && b.removeAttribute("for");
2331
- } catch (S) {
2329
+ y.hasAttribute && y.hasAttribute("patchsrc") && y.removeAttribute("patchsrc"), y.hasAttribute && y.hasAttribute("for") && Xe("for", E) && y.removeAttribute("for");
2330
+ } catch (A) {
2332
2331
  }
2333
2332
  }
2334
- const h = $(d);
2335
- if (h) for (let b = h.length - 1; b >= 0; --b) s.push(h[b]);
2333
+ const m = $(d);
2334
+ if (m) for (let y = m.length - 1; y >= 0; --y) s.push(m[y]);
2336
2335
  }
2337
2336
  }, Qe = function(n) {
2338
2337
  let s = null, d = null;
2339
2338
  if (ne) n = "<remove></remove>" + n;
2340
2339
  else {
2341
- const b = lo(n, /^[\r\n\t ]+/);
2342
- d = b && b[0];
2340
+ const y = lo(n, /^[\r\n\t ]+/);
2341
+ d = y && y[0];
2343
2342
  }
2344
- xt === "application/xhtml+xml" && ft === K && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
2345
- const p = N ? lt(n) : n;
2343
+ Ct === "application/xhtml+xml" && ft === K && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
2344
+ const f = P ? lt(n) : n;
2346
2345
  if (ft === K) try {
2347
- s = new m().parseFromString(p, xt);
2348
- } catch (b) {
2346
+ s = new h().parseFromString(f, Ct);
2347
+ } catch (y) {
2349
2348
  }
2350
2349
  if (!s || !s.documentElement) {
2351
2350
  s = Zt.createDocument(ft, "template", null);
2352
2351
  try {
2353
- s.documentElement.innerHTML = ae ? et : p;
2354
- } catch (b) {
2352
+ s.documentElement.innerHTML = ae ? et : f;
2353
+ } catch (y) {
2355
2354
  }
2356
2355
  }
2357
- const h = s.body || s.documentElement;
2358
- return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ft === K ? Bo.call(s, nt ? "html" : "body")[0] : nt ? s.documentElement : h;
2356
+ const m = s.body || s.documentElement;
2357
+ return n && d && m.insertBefore(e.createTextNode(d), m.childNodes[0] || null), ft === K ? Ho.call(s, nt ? "html" : "body")[0] : nt ? s.documentElement : m;
2359
2358
  }, Ze = function(n) {
2360
2359
  const s = Dt ? Dt(n) : n.ownerDocument;
2361
- return Le.call(s || n, n, f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION, null);
2360
+ return _e.call(s || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
2362
2361
  }, Ut = function(n) {
2363
- return n = St(n, Fo, " "), n = St(n, Uo, " "), n = St(n, jo, " "), n;
2362
+ return n = St(n, jo, " "), n = St(n, Wo, " "), n = St(n, $o, " "), n;
2364
2363
  }, ue = function(n) {
2365
2364
  var s;
2366
2365
  n.normalize();
2367
- const d = Dt ? Dt(n) : n.ownerDocument, p = Le.call(d || n, n, f.SHOW_TEXT | f.SHOW_COMMENT | f.SHOW_CDATA_SECTION | f.SHOW_PROCESSING_INSTRUCTION, null);
2368
- let h = p.nextNode();
2369
- for (; h; )
2370
- h.data = Ut(h.data), h = p.nextNode();
2371
- const b = (s = n.querySelectorAll) === null || s === void 0 ? void 0 : s.call(n, "template");
2372
- b && rt(b, (y) => {
2373
- ht(y.content) && ue(y.content);
2366
+ const d = Dt ? Dt(n) : n.ownerDocument, f = _e.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
2367
+ let m = f.nextNode();
2368
+ for (; m; )
2369
+ m.data = Ut(m.data), m = f.nextNode();
2370
+ const y = (s = n.querySelectorAll) === null || s === void 0 ? void 0 : s.call(n, "template");
2371
+ y && rt(y, (E) => {
2372
+ ht(E.content) && ue(E.content);
2374
2373
  });
2375
2374
  }, jt = function(n) {
2376
2375
  const s = st ? st(n) : null;
2377
- return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== B(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== O(n) || n.childNodes !== $(n);
2376
+ return typeof s != "string" || S(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== B(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== I(n) || n.childNodes !== $(n);
2378
2377
  }, ht = function(n) {
2379
- if (!O || typeof n != "object" || n === null) return !1;
2378
+ if (!I || typeof n != "object" || n === null) return !1;
2380
2379
  try {
2381
- return O(n) === F.documentFragment;
2380
+ return I(n) === H.documentFragment;
2382
2381
  } catch (s) {
2383
2382
  return !1;
2384
2383
  }
2385
- }, At = function(n) {
2386
- if (!O || typeof n != "object" || n === null) return !1;
2384
+ }, xt = function(n) {
2385
+ if (!I || typeof n != "object" || n === null) return !1;
2387
2386
  try {
2388
- return typeof O(n) == "number";
2387
+ return typeof I(n) == "number";
2389
2388
  } catch (s) {
2390
2389
  return !1;
2391
2390
  }
2392
2391
  };
2393
- function Y(u, n, s) {
2392
+ function q(u, n, s) {
2394
2393
  u.length !== 0 && rt(u, (d) => {
2395
2394
  d.call(t, n, s, pt);
2396
2395
  });
2397
2396
  }
2398
- const rn = function(n, s) {
2399
- return !!(ot && n.hasChildNodes() && !At(n.firstElementChild) && I(yo, n.textContent) && I(yo, n.innerHTML) || ot && n.namespaceURI === K && Zn[s] && (At(n.firstElementChild) || typeof n.textContent == "string" && I(Jn[s], n.textContent)) || n.nodeType === F.processingInstruction || ot && n.nodeType === F.comment && I(Eo, n.data));
2397
+ const sn = function(n, s) {
2398
+ return !!(ot && n.hasChildNodes() && !xt(n.firstElementChild) && D(yo, n.textContent) && D(yo, n.innerHTML) || ot && n.namespaceURI === K && ti[s] && (xt(n.firstElementChild) || typeof n.textContent == "string" && D(ei[s], n.textContent)) || n.nodeType === H.processingInstruction || ot && n.nodeType === H.comment && D(Eo, n.data));
2400
2399
  }, Wt = function(n, s) {
2401
- if (n instanceof RegExp) return I(n, s);
2400
+ if (n instanceof RegExp) return D(n, s);
2402
2401
  if (n instanceof Function) {
2403
- for (var d = arguments.length, p = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) p[h - 2] = arguments[h];
2404
- return !!n(s, ...p);
2402
+ for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), m = 2; m < d; m++) f[m - 2] = arguments[m];
2403
+ return !!n(s, ...f);
2405
2404
  }
2406
2405
  return !1;
2407
- }, an = function(n, s, d) {
2408
- if (!kt[s] && oo(s) && Wt(G.tagNameCheck, s)) return !1;
2406
+ }, ln = function(n, s, d) {
2407
+ if (!Tt[s] && oo(s) && Wt(G.tagNameCheck, s)) return !1;
2409
2408
  if (ie && !ut[s]) {
2410
- const p = z(n), h = $(n);
2411
- if (h && p) {
2412
- const b = h.length;
2413
- for (let y = b - 1; y >= 0; --y) {
2414
- const S = n === d ? T(h[y], !0) : h[y];
2415
- p.insertBefore(S, tt(n));
2409
+ const f = z(n), m = $(n);
2410
+ if (m && f) {
2411
+ const y = m.length;
2412
+ for (let E = y - 1; E >= 0; --E) {
2413
+ const A = n === d ? k(m[E], !0) : m[E];
2414
+ f.insertBefore(A, tt(n));
2416
2415
  }
2417
2416
  }
2418
2417
  }
2419
2418
  return X(n), !0;
2420
- }, Je = function(n, s, d, p) {
2421
- return n.length === 0 ? s : s === d || s === p ? U(s) : s;
2419
+ }, Je = function(n, s, d, f) {
2420
+ return n.length === 0 ? s : s === d || s === f ? U(s) : s;
2422
2421
  }, mt = function(n, s) {
2423
- return n === s || z(n) !== null ? !1 : (re && Ft(n), !0);
2422
+ return n === s || z(n) !== null ? !1 : (re && Ht(n), !0);
2424
2423
  }, to = function(n, s) {
2425
- if (Y(x.beforeSanitizeElements, n, null), mt(n, s)) return !0;
2424
+ if (q(T.beforeSanitizeElements, n, null), mt(n, s)) return !0;
2426
2425
  if (jt(n))
2427
2426
  return X(n), !0;
2428
- const d = _(Xt(n));
2429
- if (A = Je(x.uponSanitizeElement, A, Jt, Ot), Y(x.uponSanitizeElement, n, {
2427
+ const d = S(Xt(n));
2428
+ if (C = Je(T.uponSanitizeElement, C, Jt, Ot), q(T.uponSanitizeElement, n, {
2430
2429
  tagName: d,
2431
- allowedTags: A
2430
+ allowedTags: C
2432
2431
  }), mt(n, s)) return !0;
2433
- if (rn(n, d))
2432
+ if (sn(n, d))
2434
2433
  return X(n), !0;
2435
- if (kt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !A[d]) {
2436
- const p = an(n, d, s);
2437
- return p === !1 && (Y(x.afterSanitizeElements, n, null), mt(n, s)) ? !0 : p;
2434
+ if (Tt[d] || !(Y.tagCheck instanceof Function && Y.tagCheck(d)) && !C[d]) {
2435
+ const f = ln(n, d, s);
2436
+ return f === !1 && (q(T.afterSanitizeElements, n, null), mt(n, s)) ? !0 : f;
2438
2437
  }
2439
- if (wt(n) === F.element && !en(n) || (d === "noscript" || d === "noembed" || d === "noframes") && I(Xn, n.innerHTML))
2438
+ if (kt(n) === H.element && !nn(n) || (d === "noscript" || d === "noembed" || d === "noframes") && D(Zn, n.innerHTML))
2440
2439
  return X(n), !0;
2441
- if (V && n.nodeType === F.text) {
2442
- const p = Ut(n.textContent);
2443
- n.textContent !== p && (Ct(t.removed, { element: n.cloneNode() }), n.textContent = p);
2440
+ if (V && n.nodeType === H.text) {
2441
+ const f = Ut(n.textContent);
2442
+ n.textContent !== f && (At(t.removed, { element: n.cloneNode() }), n.textContent = f);
2444
2443
  }
2445
- return Y(x.afterSanitizeElements, n, null), mt(n, s);
2444
+ return q(T.afterSanitizeElements, n, null), mt(n, s);
2446
2445
  }, eo = function(n, s, d) {
2447
- if (Ie[s] || Xe(s, n) || Pe && (s === "id" || s === "name") && (d in e || d in Qo)) return !1;
2448
- const p = C[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, n);
2449
- return ee && I(Wo, s) || Oe && I($o, s) ? !0 : p ? je[s] || I(De, St(d, Me, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && co(d, "data:") === 0 && Fe[n] || Re && !I(Go, St(d, Me, "")) ? !0 : !d : oo(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, s, n) || s === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
2450
- }, sn = E({}, [
2446
+ if (Ie[s] || Xe(s, n) || Ne && (s === "id" || s === "name") && (d in e || d in Jo)) return !1;
2447
+ const f = x[s] || Y.attributeCheck instanceof Function && Y.attributeCheck(s, n);
2448
+ return ee && D(Go, s) || Oe && D(Ko, s) ? !0 : f ? je[s] || D(De, St(d, Me, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && co(d, "data:") === 0 && He[n] || Re && !D(qo, St(d, Me, "")) ? !0 : !d : oo(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, s, n) || s === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
2449
+ }, cn = v({}, [
2451
2450
  "annotation-xml",
2452
2451
  "color-profile",
2453
2452
  "font-face",
@@ -2457,72 +2456,72 @@ function Do() {
2457
2456
  "font-face-uri",
2458
2457
  "missing-glyph"
2459
2458
  ]), oo = function(n) {
2460
- return !sn[Mt(n)] && I(Ko, n);
2461
- }, ln = function(n, s, d, p) {
2462
- if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, s)) {
2459
+ return !cn[Mt(n)] && D(Yo, n);
2460
+ }, dn = function(n, s, d, f) {
2461
+ if (P && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, s)) {
2463
2462
  case "TrustedHTML":
2464
- return lt(p);
2463
+ return lt(f);
2465
2464
  case "TrustedScriptURL":
2466
- return No(p);
2465
+ return zo(f);
2467
2466
  }
2468
- return p;
2469
- }, cn = function(n, s, d, p) {
2467
+ return f;
2468
+ }, un = function(n, s, d, f) {
2470
2469
  try {
2471
- return d ? n.setAttributeNS(d, s, p) : n.setAttribute(s, p), jt(n) ? (X(n), !1) : !0;
2472
- } catch (h) {
2470
+ return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f), jt(n) ? (X(n), !1) : !0;
2471
+ } catch (m) {
2473
2472
  return it(s, n), !1;
2474
2473
  }
2475
2474
  }, no = function(n, s) {
2476
- if (Y(x.beforeSanitizeAttributes, n, null), mt(n, s)) return;
2475
+ if (q(T.beforeSanitizeAttributes, n, null), mt(n, s)) return;
2477
2476
  const d = n.attributes;
2478
2477
  if (!d || jt(n)) return;
2479
- C = Je(x.uponSanitizeAttribute, C, te, Rt);
2480
- const p = {
2478
+ x = Je(T.uponSanitizeAttribute, x, te, Rt);
2479
+ const f = {
2481
2480
  attrName: "",
2482
2481
  attrValue: "",
2483
2482
  keepAttr: !0,
2484
- allowedAttributes: C,
2483
+ allowedAttributes: x,
2485
2484
  forceKeepAttr: void 0
2486
2485
  };
2487
- let h = d.length;
2488
- const b = _(n.nodeName);
2489
- for (; h--; ) {
2490
- const y = d[h], S = y.name, j = y.namespaceURI, H = y.value, gt = _(S), pe = H;
2491
- let R = S === "value" ? pe : In(pe), io = !1;
2492
- if (p.attrName = gt, p.attrValue = R, p.keepAttr = !0, p.forceKeepAttr = void 0, Y(x.uponSanitizeAttribute, n, p), R = p.attrValue, ze && (gt === "id" || gt === "name") && co(R, Be) !== 0 && (it(S, n, y), R = Be + R, io = !0), ot && I(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
2493
- it(S, n, y);
2486
+ let m = d.length;
2487
+ const y = S(n.nodeName);
2488
+ for (; m--; ) {
2489
+ const E = d[m], A = E.name, j = E.namespaceURI, F = E.value, gt = S(A), pe = F;
2490
+ let O = A === "value" ? pe : Rn(pe), io = !1;
2491
+ if (f.attrName = gt, f.attrValue = O, f.keepAttr = !0, f.forceKeepAttr = void 0, q(T.uponSanitizeAttribute, n, f), O = f.attrValue, ze && (gt === "id" || gt === "name") && co(O, Be) !== 0 && (it(A, n, E), O = Be + O, io = !0), ot && D(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
2492
+ it(A, n, E);
2494
2493
  continue;
2495
2494
  }
2496
- if (gt === "attributename" && lo(R, "href")) {
2497
- it(S, n, y);
2495
+ if (gt === "attributename" && lo(O, "href")) {
2496
+ it(A, n, E);
2498
2497
  continue;
2499
2498
  }
2500
- if (!p.forceKeepAttr) {
2501
- if (!p.keepAttr) {
2502
- it(S, n, y);
2499
+ if (!f.forceKeepAttr) {
2500
+ if (!f.keepAttr) {
2501
+ it(A, n, E);
2503
2502
  continue;
2504
2503
  }
2505
- if (!Ne && I(Qn, R)) {
2506
- it(S, n, y);
2504
+ if (!Pe && D(Jn, O)) {
2505
+ it(A, n, E);
2507
2506
  continue;
2508
2507
  }
2509
- if (V && (R = Ut(R)), !eo(b, gt, R)) {
2510
- it(S, n, y);
2508
+ if (V && (O = Ut(O)), !eo(y, gt, O)) {
2509
+ it(A, n, E);
2511
2510
  continue;
2512
2511
  }
2513
- R = ln(b, gt, j, R), R !== pe && cn(n, S, j, R) && io && so(t.removed);
2512
+ O = dn(y, gt, j, O), O !== pe && un(n, A, j, O) && io && so(t.removed);
2514
2513
  }
2515
2514
  }
2516
- Y(x.afterSanitizeAttributes, n, null), mt(n, s);
2515
+ q(T.afterSanitizeAttributes, n, null), mt(n, s);
2517
2516
  }, $t = function(n) {
2518
2517
  let s = null;
2519
2518
  const d = Ze(n);
2520
- for (Y(x.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
2521
- if (Y(x.uponSanitizeShadowNode, s, null), to(s, n), no(s, n), ht(s.content) && $t(s.content), wt(s) === F.element) {
2522
- const p = at(s);
2523
- ht(p) && (fe(p), $t(p));
2519
+ for (q(T.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
2520
+ if (q(T.uponSanitizeShadowNode, s, null), to(s, n), no(s, n), ht(s.content) && $t(s.content), kt(s) === H.element) {
2521
+ const f = at(s);
2522
+ ht(f) && (fe(f), $t(f));
2524
2523
  }
2525
- Y(x.afterSanitizeShadowDOM, n, null);
2524
+ q(T.afterSanitizeShadowDOM, n, null);
2526
2525
  }, fe = function(n) {
2527
2526
  const s = [{
2528
2527
  node: n,
@@ -2534,115 +2533,115 @@ function Do() {
2534
2533
  $t(d.shadow);
2535
2534
  continue;
2536
2535
  }
2537
- const p = d.node, h = wt(p) === F.element, b = $(p);
2538
- if (b) for (let y = b.length - 1; y >= 0; --y) s.push({
2539
- node: b[y],
2536
+ const f = d.node, m = kt(f) === H.element, y = $(f);
2537
+ if (y) for (let E = y.length - 1; E >= 0; --E) s.push({
2538
+ node: y[E],
2540
2539
  shadow: null
2541
2540
  });
2542
- if (h) {
2543
- const y = st ? st(p) : null;
2544
- if (typeof y == "string" && _(y) === "template") {
2545
- const S = p.content;
2546
- ht(S) && s.push({
2547
- node: S,
2541
+ if (m) {
2542
+ const E = st ? st(f) : null;
2543
+ if (typeof E == "string" && S(E) === "template") {
2544
+ const A = f.content;
2545
+ ht(A) && s.push({
2546
+ node: A,
2548
2547
  shadow: null
2549
2548
  });
2550
2549
  }
2551
2550
  }
2552
- if (h) {
2553
- const y = at(p);
2554
- ht(y) && s.push({
2551
+ if (m) {
2552
+ const E = at(f);
2553
+ ht(E) && s.push({
2555
2554
  node: null,
2556
- shadow: y
2555
+ shadow: E
2557
2556
  }, {
2558
- node: y,
2557
+ node: E,
2559
2558
  shadow: null
2560
2559
  });
2561
2560
  }
2562
2561
  }
2563
2562
  };
2564
2563
  return t.sanitize = function(u) {
2565
- let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, p = null, h = null;
2566
- if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !At(u) && (u = zn(u), typeof u != "string"))
2564
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, f = null, m = null;
2565
+ if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !xt(u) && (u = Fn(u), typeof u != "string"))
2567
2566
  throw Q("dirty is not a string, aborting");
2568
2567
  if (!t.isSupported) return u;
2569
- oe ? (A = Ot, C = Rt) : de(n), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (A = U(A)), x.uponSanitizeAttribute.length > 0 && (C = U(C)), t.removed = [];
2570
- const b = re && typeof u != "string" && At(u);
2571
- if (b) {
2572
- nn(u);
2568
+ oe ? (C = Ot, x = Rt) : de(n), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (C = U(C)), T.uponSanitizeAttribute.length > 0 && (x = U(x)), t.removed = [];
2569
+ const y = re && typeof u != "string" && xt(u);
2570
+ if (y) {
2571
+ an(u);
2573
2572
  const j = Xt(u);
2574
2573
  if (typeof j == "string") {
2575
- const H = _(j);
2576
- if (!A[H] || kt[H])
2577
- throw Ht(u), Q("root node is forbidden and cannot be sanitized in-place");
2574
+ const F = S(j);
2575
+ if (!C[F] || Tt[F])
2576
+ throw Ft(u), Q("root node is forbidden and cannot be sanitized in-place");
2578
2577
  }
2579
2578
  if (jt(u))
2580
- throw Ht(u), Q("root node is clobbered and cannot be sanitized in-place");
2579
+ throw Ft(u), Q("root node is clobbered and cannot be sanitized in-place");
2581
2580
  try {
2582
2581
  fe(u);
2583
- } catch (H) {
2584
- throw Ht(u), H;
2582
+ } catch (F) {
2583
+ throw Ft(u), F;
2585
2584
  }
2586
- } else if (At(u))
2587
- s = Qe("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType === F.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? s = d : s.appendChild(d), fe(s);
2585
+ } else if (xt(u))
2586
+ s = Qe("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType === H.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? s = d : s.appendChild(d), fe(s);
2588
2587
  else {
2589
- if (!ct && !V && !nt && u.indexOf("<") === -1) return N && Pt ? lt(u) : u;
2590
- if (s = Qe(u), !s) return ct ? null : Pt ? et : "";
2588
+ if (!ct && !V && !nt && u.indexOf("<") === -1) return P && Nt ? lt(u) : u;
2589
+ if (s = Qe(u), !s) return ct ? null : Nt ? et : "";
2591
2590
  }
2592
2591
  s && ne && X(s.firstChild);
2593
- const y = b ? u : s;
2592
+ const E = y ? u : s;
2594
2593
  try {
2595
- const j = Ze(y);
2596
- for (; p = j.nextNode(); )
2597
- to(p, y), no(p, y), ht(p.content) && $t(p.content);
2594
+ const j = Ze(E);
2595
+ for (; f = j.nextNode(); )
2596
+ to(f, E), no(f, E), ht(f.content) && $t(f.content);
2598
2597
  } catch (j) {
2599
- throw b && (Ht(u), rt(t.removed, (H) => {
2600
- H.element && Ft(H.element);
2598
+ throw y && (Ft(u), rt(t.removed, (F) => {
2599
+ F.element && Ht(F.element);
2601
2600
  })), j;
2602
2601
  }
2603
- if (b) {
2602
+ if (y) {
2604
2603
  let j = !1;
2605
- if (rt(t.removed, (H) => {
2606
- H.element && (H.element === u && (j = !0), Ft(H.element));
2604
+ if (rt(t.removed, (F) => {
2605
+ F.element && (F.element === u && (j = !0), Ht(F.element));
2607
2606
  }), j) throw Q("a node selected for removal could not be safely returned; refusing to sanitize in place");
2608
2607
  return V && ue(u), u;
2609
2608
  }
2610
2609
  if (ct) {
2611
- if (V && ue(s), Nt)
2612
- for (h = zo.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
2613
- else h = s;
2614
- return (C.shadowroot || C.shadowrootmode) && (h = Ho.call(o, h, !0)), h;
2610
+ if (V && ue(s), Pt)
2611
+ for (m = Fo.call(s.ownerDocument); s.firstChild; ) m.appendChild(s.firstChild);
2612
+ else m = s;
2613
+ return (x.shadowroot || x.shadowrootmode) && (m = Uo.call(o, m, !0)), m;
2615
2614
  }
2616
- let S = nt ? s.outerHTML : s.innerHTML;
2617
- return nt && A["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && I(qn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2618
- ` + S), V && (S = Ut(S)), N && Pt ? lt(S) : S;
2615
+ let A = nt ? s.outerHTML : s.innerHTML;
2616
+ return nt && C["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && D(Xn, s.ownerDocument.doctype.name) && (A = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2617
+ ` + A), V && (A = Ut(A)), P && Nt ? lt(A) : A;
2619
2618
  }, t.setConfig = function() {
2620
2619
  let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2621
- de(u), oe = !0, Ot = A, Rt = C;
2620
+ de(u), oe = !0, Ot = C, Rt = x;
2622
2621
  }, t.clearConfig = function() {
2623
- pt = null, oe = !1, Ot = null, Rt = null, N = Qt, et = "";
2622
+ pt = null, oe = !1, Ot = null, Rt = null, P = Qt, et = "";
2624
2623
  }, t.isValidAttribute = function(u, n, s) {
2625
2624
  pt || de({});
2626
- const d = _(u), p = _(n);
2627
- return eo(d, p, s);
2625
+ const d = S(u), f = S(n);
2626
+ return eo(d, f, s);
2628
2627
  }, t.addHook = function(u, n) {
2629
- typeof n == "function" && P(x, u) && Ct(x[u], n);
2628
+ typeof n == "function" && N(T, u) && At(T[u], n);
2630
2629
  }, t.removeHook = function(u, n) {
2631
- if (P(x, u)) {
2630
+ if (N(T, u)) {
2632
2631
  if (n !== void 0) {
2633
- const s = Mn(x[u], n);
2634
- return s === -1 ? void 0 : Dn(x[u], s, 1)[0];
2632
+ const s = In(T[u], n);
2633
+ return s === -1 ? void 0 : On(T[u], s, 1)[0];
2635
2634
  }
2636
- return so(x[u]);
2635
+ return so(T[u]);
2637
2636
  }
2638
2637
  }, t.removeHooks = function(u) {
2639
- P(x, u) && (x[u] = []);
2638
+ N(T, u) && (T[u] = []);
2640
2639
  }, t.removeAllHooks = function() {
2641
- x = vo();
2640
+ T = vo();
2642
2641
  }, t;
2643
2642
  }
2644
- var Kt = Do();
2645
- const oi = [
2643
+ var Kt = Oo();
2644
+ const ii = [
2646
2645
  "p",
2647
2646
  "br",
2648
2647
  "strong",
@@ -2691,7 +2690,7 @@ const oi = [
2691
2690
  // user-initiated dialog, a different trust boundary that never calls
2692
2691
  // through this sanitizer. A consumer that genuinely wants iframes in
2693
2692
  // pasted/typed content can still opt in via a custom allowedTags list.
2694
- ], ni = {
2693
+ ], ri = {
2695
2694
  "*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
2696
2695
  a: ["href", "target", "rel", "title"],
2697
2696
  img: ["src", "alt", "width", "height", "loading"],
@@ -2708,8 +2707,8 @@ const oi = [
2708
2707
  // additionalAllowedTags), restoring the attributes that make an inserted
2709
2708
  // iframe actually usable (src, sizing, fullscreen, scrolling/border).
2710
2709
  iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
2711
- }, ii = "data-editora-embed";
2712
- function ri(a) {
2710
+ }, ai = "data-editora-embed";
2711
+ function si(a) {
2713
2712
  if (!a || /\s/.test(a.trim())) return !1;
2714
2713
  try {
2715
2714
  const t = new URL(a.trim());
@@ -2718,50 +2717,50 @@ function ri(a) {
2718
2717
  return !1;
2719
2718
  }
2720
2719
  }
2721
- function Io(a, t, e, o) {
2720
+ function Ro(a, t, e, o) {
2722
2721
  if ((t == null ? void 0 : t.sanitize) === !1)
2723
2722
  return a;
2724
- const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : oi, r = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...i, ...e])) : i, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : ni, f = /* @__PURE__ */ new Set();
2725
- for (const w of Object.values(c))
2726
- for (const T of w) f.add(T);
2727
- const m = {
2723
+ const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ii, r = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...i, ...e])) : i, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : ri, p = /* @__PURE__ */ new Set();
2724
+ for (const b of Object.values(c))
2725
+ for (const k of b) p.add(k);
2726
+ const h = {
2728
2727
  ALLOWED_TAGS: r,
2729
- ALLOWED_ATTR: Array.from(f)
2728
+ ALLOWED_ATTR: Array.from(p)
2730
2729
  };
2731
2730
  if (!o)
2732
- return Kt.sanitize(a, m);
2731
+ return Kt.sanitize(a, h);
2733
2732
  const g = r.includes("iframe");
2734
2733
  Kt.addHook(
2735
2734
  "uponSanitizeElement",
2736
- (w, T) => {
2737
- var k;
2738
- if (T.tagName !== "iframe") return;
2739
- const v = w;
2740
- T.allowedTags.iframe = g || ((k = v.getAttribute) == null ? void 0 : k.call(v, ii)) === "true" && ri(v.getAttribute("src"));
2735
+ (b, k) => {
2736
+ var R;
2737
+ if (k.tagName !== "iframe") return;
2738
+ const w = b;
2739
+ k.allowedTags.iframe = g || ((R = w.getAttribute) == null ? void 0 : R.call(w, ai)) === "true" && si(w.getAttribute("src"));
2741
2740
  }
2742
2741
  );
2743
2742
  try {
2744
- return Kt.sanitize(a, m);
2743
+ return Kt.sanitize(a, h);
2745
2744
  } finally {
2746
2745
  Kt.removeHook("uponSanitizeElement");
2747
2746
  }
2748
2747
  }
2749
- function ai(a, t, e, o) {
2750
- return Io(a, t, o, !1);
2748
+ function li(a, t, e, o) {
2749
+ return Ro(a, t, o, !1);
2751
2750
  }
2752
- function si(a, t, e) {
2753
- return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : ai(a, t);
2751
+ function ci(a, t, e) {
2752
+ return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : li(a, t);
2754
2753
  }
2755
- function wo(a, t, e, o) {
2756
- return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Io(a, t, o, !0);
2754
+ function ko(a, t, e, o) {
2755
+ return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Ro(a, t, o, !0);
2757
2756
  }
2758
- const li = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", ci = /resize-handle|data-rte-media-pending|rte-media/;
2759
- function Oo(a) {
2760
- if (!a || !ci.test(a)) return a;
2757
+ const di = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", ui = /resize-handle|data-rte-media-pending|rte-media/;
2758
+ function Po(a) {
2759
+ if (!a || !ui.test(a)) return a;
2761
2760
  const t = document.createElement("template");
2762
2761
  t.innerHTML = a;
2763
2762
  const e = /* @__PURE__ */ new Set();
2764
- return t.content.querySelectorAll(li).forEach((o) => {
2763
+ return t.content.querySelectorAll(di).forEach((o) => {
2765
2764
  const i = o.parentElement;
2766
2765
  i && (i.tagName === "TD" || i.tagName === "TH") && e.add(i), o.remove();
2767
2766
  }), e.forEach((o) => {
@@ -2775,7 +2774,7 @@ function Oo(a) {
2775
2774
  }), t.innerHTML;
2776
2775
  }
2777
2776
  function bt(a) {
2778
- return a ? Oo(a.innerHTML) : "";
2777
+ return a ? Po(a.innerHTML) : "";
2779
2778
  }
2780
2779
  const Vt = class Vt {
2781
2780
  /**
@@ -3038,8 +3037,8 @@ Vt.EDITOR_DEFAULTS = {
3038
3037
  "security-sanitize-on-paste",
3039
3038
  "security-sanitize-on-input"
3040
3039
  ]);
3041
- let Ae = Vt;
3042
- class di {
3040
+ let xe = Vt;
3041
+ class fi {
3043
3042
  constructor() {
3044
3043
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
3045
3044
  }
@@ -3127,99 +3126,269 @@ class di {
3127
3126
  return this.loadedPlugins.has(t);
3128
3127
  }
3129
3128
  }
3130
- const To = /* @__PURE__ */ new Set();
3131
- function ui(a, t) {
3132
- To.has(a) || (To.add(a), console.warn(
3129
+ const wo = /* @__PURE__ */ new Set();
3130
+ function pi(a, t) {
3131
+ wo.has(a) || (wo.add(a), console.warn(
3133
3132
  `[Editora] The "${a}" option has no effect: ${t} It is still accepted so existing code keeps working, and will be removed in a future major release.`
3134
3133
  ));
3135
3134
  }
3136
- const fi = '.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.editora-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}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
3137
- let Yt;
3138
- const pi = "__editoraCommandEditorRoot", hi = "__editoraLastCommandButton", ko = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", xo = ".rte-content, .editora-content", mi = "Rich text editor", gi = /* @__PURE__ */ new Set(["collaboration"]), ve = "data-editora-disabled-by-host", Ce = /* @__PURE__ */ new Set();
3139
- let J = null, Ao = !1, we = null, Te = null;
3140
- function Co(a) {
3135
+ const hi = [
3136
+ "bold",
3137
+ "italic",
3138
+ "underline",
3139
+ "strikethrough",
3140
+ "clearFormatting",
3141
+ "heading",
3142
+ "blockquote",
3143
+ "list",
3144
+ "link",
3145
+ "table",
3146
+ "history"
3147
+ ], mi = /* @__PURE__ */ new Set([
3148
+ "bold",
3149
+ "italic",
3150
+ "underline",
3151
+ "strikethrough",
3152
+ "clearFormatting",
3153
+ "heading",
3154
+ "blockquote",
3155
+ "code",
3156
+ "codeSample",
3157
+ "list",
3158
+ "checklist",
3159
+ "textAlignment",
3160
+ "indent",
3161
+ "direction",
3162
+ "textColor",
3163
+ "backgroundColor",
3164
+ "fontSize",
3165
+ "fontFamily",
3166
+ "formatPainter",
3167
+ "format-painter",
3168
+ "formatpainter",
3169
+ "lineHeight",
3170
+ "capitalization",
3171
+ "history",
3172
+ "link",
3173
+ "table",
3174
+ "trackChanges",
3175
+ "versionDiff",
3176
+ "version-diff",
3177
+ "versiondiff",
3178
+ "conditionalContent",
3179
+ "conditional-content",
3180
+ "conditionalcontent",
3181
+ "dataBinding",
3182
+ "data-binding",
3183
+ "databinding",
3184
+ "docSchema",
3185
+ "doc-schema",
3186
+ "docschema",
3187
+ "translationWorkflow",
3188
+ "translation-workflow",
3189
+ "translationworkflow",
3190
+ "contentRules",
3191
+ "content-rules",
3192
+ "contentrules",
3193
+ "citations",
3194
+ "citation",
3195
+ "approvalWorkflow",
3196
+ "approval-workflow",
3197
+ "approvalworkflow",
3198
+ "piiRedaction",
3199
+ "pii-redaction",
3200
+ "piiredaction",
3201
+ "smartPaste",
3202
+ "smart-paste",
3203
+ "smartpaste",
3204
+ "blocksLibrary",
3205
+ "blocks-library",
3206
+ "blockslibrary",
3207
+ "mentions",
3208
+ "mention",
3209
+ "anchor",
3210
+ "embedIframe",
3211
+ "math",
3212
+ "image",
3213
+ "mergeTag",
3214
+ "pageBreak",
3215
+ "print",
3216
+ "preview",
3217
+ "specialCharacters",
3218
+ "slashCommands",
3219
+ "slash-commands",
3220
+ "spellCheck",
3221
+ "emojis",
3222
+ "a11yChecker",
3223
+ "comments",
3224
+ "collaboration",
3225
+ "document-manager",
3226
+ "fullscreen",
3227
+ "template",
3228
+ "footnote"
3229
+ ]), gi = "all", To = {
3230
+ toggleBold: "bold",
3231
+ toggleItalic: "italic",
3232
+ toggleUnderline: "underline",
3233
+ toggleStrikethrough: "strikethrough",
3234
+ clearFormatting: "clearFormatting",
3235
+ setBlockType: "heading",
3236
+ toggleBlockquote: "blockquote",
3237
+ toggleSourceView: "code",
3238
+ insertCodeBlock: "codeSample",
3239
+ toggleBulletList: "list",
3240
+ toggleOrderedList: "list",
3241
+ toggleChecklist: "checklist",
3242
+ setTextAlignment: "textAlignment",
3243
+ increaseIndent: "indent",
3244
+ decreaseIndent: "indent",
3245
+ setDirectionLTR: "direction",
3246
+ setDirectionRTL: "direction",
3247
+ openTextColorPicker: "textColor",
3248
+ openBackgroundColorPicker: "backgroundColor",
3249
+ fontSize: "fontSize",
3250
+ setFontFamily: "fontFamily",
3251
+ toggleFormatPainter: "formatPainter",
3252
+ setLineHeight: "lineHeight",
3253
+ setCapitalization: "capitalization",
3254
+ undo: "history",
3255
+ redo: "history",
3256
+ openLinkDialog: "link",
3257
+ insertTable: "table",
3258
+ toggleTrackChanges: "trackChanges",
3259
+ openVersionDiff: "versionDiff",
3260
+ conditionalContent: "conditionalContent",
3261
+ openDataBindingDialog: "dataBinding",
3262
+ docSchema: "docSchema",
3263
+ translationWorkflow: "translationWorkflow",
3264
+ contentRules: "contentRules",
3265
+ citations: "citations",
3266
+ approvalWorkflow: "approvalWorkflow",
3267
+ piiRedaction: "piiRedaction",
3268
+ smartPaste: "smartPaste",
3269
+ blocksLibrary: "blocksLibrary",
3270
+ insertMention: "mentions",
3271
+ insertAnchor: "anchor",
3272
+ openEmbedIframeDialog: "embedIframe",
3273
+ insertMath: "math",
3274
+ insertImage: "image",
3275
+ insertVideo: "image",
3276
+ insertMergeTag: "mergeTag",
3277
+ insertPageBreak: "pageBreak",
3278
+ print: "print",
3279
+ togglePreview: "preview",
3280
+ insertSpecialCharacter: "specialCharacters",
3281
+ openSlashCommands: "slashCommands",
3282
+ toggleSpellCheck: "spellCheck",
3283
+ openEmojiDialog: "emojis",
3284
+ toggleA11yChecker: "a11yChecker",
3285
+ addComment: "comments",
3286
+ toggleComments: "comments",
3287
+ importWord: "document-manager",
3288
+ exportWord: "document-manager",
3289
+ exportPdf: "document-manager",
3290
+ toggleFullscreen: "fullscreen",
3291
+ insertTemplate: "template",
3292
+ insertFootnote: "footnote"
3293
+ };
3294
+ function bi(a, t) {
3295
+ var o, i;
3296
+ if (!a) return [];
3297
+ const e = [];
3298
+ for (const r of a.split(/[\s|]+/)) {
3299
+ if (!r) continue;
3300
+ const l = _o[r] || r, c = (i = (o = To[l]) != null ? o : To[r]) != null ? i : t(r) ? r : void 0;
3301
+ c && !e.includes(c) && e.push(c);
3302
+ }
3303
+ return e;
3304
+ }
3305
+ const yi = '.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.editora-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}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
3306
+ let qt;
3307
+ const Ei = "__editoraCommandEditorRoot", vi = "__editoraLastCommandButton", Co = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", xo = ".rte-content, .editora-content", ki = "Rich text editor", wi = /* @__PURE__ */ new Set(["collaboration"]), ve = "data-editora-disabled-by-host", Ae = /* @__PURE__ */ new Set();
3308
+ let J = null, Ao = !1, ke = null, we = null;
3309
+ function So(a) {
3141
3310
  if (!(a instanceof HTMLElement)) return !1;
3142
3311
  const t = a;
3143
3312
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
3144
3313
  }
3145
- function bi(a) {
3314
+ function Ti(a) {
3146
3315
  return a ? a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement : null;
3147
3316
  }
3148
- function Lt(a) {
3317
+ function _t(a) {
3149
3318
  if (!a) return null;
3150
- if (Co(a))
3319
+ if (So(a))
3151
3320
  return a;
3152
- const t = a.matches(ko) ? a : a.closest(ko);
3153
- return !t || !Co(t) ? null : t;
3321
+ const t = a.matches(Co) ? a : a.closest(Co);
3322
+ return !t || !So(t) ? null : t;
3154
3323
  }
3155
- function yi() {
3324
+ function Ci() {
3156
3325
  var i;
3157
3326
  if (typeof window == "undefined") return null;
3158
- const a = window[pi];
3327
+ const a = window[Ei];
3159
3328
  if (a instanceof HTMLElement) {
3160
- const r = Lt(a);
3329
+ const r = _t(a);
3161
3330
  if (r) return r;
3162
3331
  const l = a.matches(xo) ? a : a.querySelector(xo);
3163
3332
  if (l) {
3164
- const c = Lt(l);
3333
+ const c = _t(l);
3165
3334
  if (c) return c;
3166
3335
  }
3167
3336
  }
3168
- const t = window[hi];
3337
+ const t = window[vi];
3169
3338
  if (t instanceof HTMLElement) {
3170
- const r = Lt(t);
3339
+ const r = _t(t);
3171
3340
  if (r) return r;
3172
3341
  }
3173
3342
  const e = document.activeElement;
3174
3343
  if (e) {
3175
- const r = Lt(e);
3344
+ const r = _t(e);
3176
3345
  if (r) return r;
3177
3346
  }
3178
3347
  const o = (i = window.getSelection) == null ? void 0 : i.call(window);
3179
3348
  if (o && o.rangeCount > 0) {
3180
- const r = Lt(bi(o.getRangeAt(0).startContainer));
3349
+ const r = _t(Ti(o.getRangeAt(0).startContainer));
3181
3350
  if (r) return r;
3182
3351
  }
3183
3352
  if (J && J.isConnected)
3184
3353
  return J;
3185
- for (const r of Ce)
3354
+ for (const r of Ae)
3186
3355
  if (r.isConnected) return r;
3187
3356
  return null;
3188
3357
  }
3189
- function Ei() {
3358
+ function xi() {
3190
3359
  if (typeof window == "undefined" || Ao) return;
3191
- we = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, Te = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3360
+ ke = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3192
3361
  const a = (t, ...e) => {
3193
- const o = yi();
3194
- return o ? o.execCommand(t, ...e) : we ? we(t, ...e) : Te ? Te(t, ...e) : !1;
3362
+ const o = Ci();
3363
+ return o ? o.execCommand(t, ...e) : ke ? ke(t, ...e) : we ? we(t, ...e) : !1;
3195
3364
  };
3196
3365
  window.executeEditorCommand = a, window.execEditorCommand = a, Ao = !0;
3197
3366
  }
3198
- function vi() {
3367
+ function Ai() {
3199
3368
  const a = "editora-webcomponent-styles";
3200
3369
  if (!document.getElementById(a)) {
3201
3370
  const t = document.createElement("style");
3202
- t.id = a, t.textContent = fi, document.head.appendChild(t);
3371
+ t.id = a, t.textContent = yi, document.head.appendChild(t);
3203
3372
  }
3204
3373
  }
3205
- function Ro() {
3206
- if (!Yt) {
3374
+ function No() {
3375
+ if (!qt) {
3207
3376
  const a = Et.__globalPluginLoader;
3208
- a ? Yt = a : Yt = new di();
3377
+ a ? qt = a : qt = new fi();
3209
3378
  }
3210
- return Yt;
3379
+ return qt;
3211
3380
  }
3212
- function ki(a) {
3213
- const t = Ro();
3381
+ function _i(a) {
3382
+ const t = No();
3214
3383
  Object.entries(a).forEach(([e, o]) => {
3215
3384
  t.register(e, o);
3216
3385
  });
3217
3386
  }
3218
- const wi = typeof HTMLElement == "undefined" ? class {
3387
+ const Si = typeof HTMLElement == "undefined" ? class {
3219
3388
  } : HTMLElement;
3220
- class Et extends wi {
3389
+ class Et extends Si {
3221
3390
  constructor() {
3222
- if (super(), this.pluginLoader = Ro(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new un(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.pluginInstances = /* @__PURE__ */ new Map(), this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, this.hasConnected = !1, this.reinitializeQueued = !1, this.lastReportedContent = null, vi(), !this.hasAttribute("data-initial-content")) {
3391
+ if (super(), this.pluginLoader = No(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new pn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.pluginInstances = /* @__PURE__ */ new Map(), this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, this.hasConnected = !1, this.reinitializeQueued = !1, this.lastReportedContent = null, Ai(), !this.hasAttribute("data-initial-content")) {
3223
3392
  const t = this.innerHTML.trim();
3224
3393
  t && this.setAttribute("data-initial-content", t);
3225
3394
  }
@@ -3337,7 +3506,7 @@ class Et extends wi {
3337
3506
  var r;
3338
3507
  if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
3339
3508
  const t = ++this.buildGeneration;
3340
- this.setAttribute("data-editora-editor", "true"), Ce.add(this), J || (J = this), Ei(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.classList.toggle("editora-disabled", this.isEditorDisabled()), this.applyThemeClass(this.config.theme), this.isMenubarRequested() && ui("menubar", "<editora-editor> does not render a menu bar."), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
3509
+ this.setAttribute("data-editora-editor", "true"), Ae.add(this), J || (J = this), xi(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.classList.toggle("editora-disabled", this.isEditorDisabled()), this.applyThemeClass(this.config.theme), this.isMenubarRequested() && pi("menubar", "<editora-editor> does not render a menu bar."), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
3341
3510
  const e = await this.loadPlugins();
3342
3511
  if (t !== this.buildGeneration || !this.isConnected) return;
3343
3512
  if (this.loadedPlugins = e, e.forEach((l) => {
@@ -3356,7 +3525,7 @@ class Et extends wi {
3356
3525
  const i = this.sanitizeLoadedContent(
3357
3526
  (r = o != null ? o : this.restoreAutosavedContent()) != null ? r : this.getAttribute("data-initial-content") || ""
3358
3527
  );
3359
- this.engine = new pn({
3528
+ this.engine = new mn({
3360
3529
  content: i,
3361
3530
  plugins: e,
3362
3531
  readonly: !!this.config.readonly || this.isEditorDisabled()
@@ -3375,41 +3544,76 @@ class Et extends wi {
3375
3544
  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() : "";
3376
3545
  }
3377
3546
  /**
3378
- * Load plugins based on configuration
3547
+ * Load plugins based on configuration.
3548
+ *
3549
+ * With `plugins` listed, exactly those load (`all` stands for every registered plugin). Without it,
3550
+ * the editor loads DEFAULT_PLUGINS plus whatever the page asks for in other ways: a toolbar item, a
3551
+ * `pluginConfig` entry, `accessibility.checker`, a plugin it registered itself, or one it already
3552
+ * loaded through the plugin loader.
3379
3553
  */
3380
3554
  async loadPlugins() {
3381
3555
  this.pluginLoader || await this.waitForPluginLoader();
3382
- const t = [], e = this.config.plugins && (typeof this.config.plugins == "string" && this.config.plugins.length > 0 || Array.isArray(this.config.plugins) && this.config.plugins.length > 0), i = this.getAccessibilityConfig().checker === !0;
3383
- if (e) {
3384
- if (typeof this.config.plugins == "string") {
3385
- const r = this.config.plugins.split(/\s+/).filter(Boolean);
3386
- i && !r.includes("a11yChecker") && r.push("a11yChecker");
3387
- for (const l of r) {
3388
- const c = await this.loadPlugin(l, this.getPluginLoadConfig(l));
3389
- c && t.push(c);
3390
- }
3391
- } else if (Array.isArray(this.config.plugins)) {
3392
- for (const r of this.config.plugins)
3393
- if (typeof r == "string") {
3394
- const l = await this.loadPlugin(r, this.getPluginLoadConfig(r));
3395
- l && t.push(l);
3396
- } else
3397
- t.push(r);
3398
- if (i && !t.some((r) => (r == null ? void 0 : r.name) === "a11yChecker")) {
3399
- const r = await this.loadPlugin("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
3400
- r && t.push(r);
3401
- }
3402
- }
3403
- } else {
3404
- const r = this.pluginLoader.getRegisteredPluginNames();
3405
- for (const l of r) {
3406
- const c = this.getPluginLoadConfig(l);
3407
- if (gi.has(l) && !c) continue;
3408
- const f = await this.loadPlugin(l, c);
3409
- f && t.push(f);
3556
+ const t = this.config.plugins, e = typeof t == "string" ? t.split(/\s+/).filter(Boolean) : Array.isArray(t) ? t : [], o = this.getAccessibilityConfig().checker === !0;
3557
+ if (e.length === 0) {
3558
+ const r = this.resolveDefaultPluginNames();
3559
+ return o && r.push("a11yChecker"), this.loadPluginsByName(r);
3560
+ }
3561
+ const i = [];
3562
+ for (const r of e)
3563
+ if (typeof r != "string")
3564
+ i.push(r);
3565
+ else if (r === gi)
3566
+ i.push(...await this.loadPluginsByName(this.resolveAllPluginNames()));
3567
+ else {
3568
+ const l = await this.loadPlugin(r, this.getPluginLoadConfig(r));
3569
+ l && i.push(l);
3410
3570
  }
3571
+ if (o && !i.some((r) => (r == null ? void 0 : r.name) === "a11yChecker")) {
3572
+ const r = await this.loadPlugin("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
3573
+ r && i.push(r);
3411
3574
  }
3412
- return t;
3575
+ return this.withoutDuplicatePlugins(i);
3576
+ }
3577
+ /** The plugins a bare editor loads: see loadPlugins(). Only registered names, in a stable order. */
3578
+ resolveDefaultPluginNames() {
3579
+ const t = this.pluginLoader.getRegisteredPluginNames(), e = (i) => t.includes(i), o = /* @__PURE__ */ new Set([
3580
+ ...hi,
3581
+ ...bi(this.resolveToolbarItems(), e)
3582
+ ]);
3583
+ for (const i of t)
3584
+ (!mi.has(i) || this.pluginLoader.isLoaded(i) || this.isPluginRequestedByConfig(i)) && o.add(i);
3585
+ return t.filter((i) => o.has(i));
3586
+ }
3587
+ /** Every registered plugin, except the ones that act on their own and have not been configured. */
3588
+ resolveAllPluginNames() {
3589
+ return this.pluginLoader.getRegisteredPluginNames().filter((t) => !wi.has(t) || this.getPluginLoadConfig(t));
3590
+ }
3591
+ async loadPluginsByName(t) {
3592
+ const e = [];
3593
+ for (const o of t) {
3594
+ const i = await this.loadPlugin(o, this.getPluginLoadConfig(o));
3595
+ i && e.push(i);
3596
+ }
3597
+ return this.withoutDuplicatePlugins(e);
3598
+ }
3599
+ /**
3600
+ * One instance per plugin. Several registered names can create the same plugin (`formatPainter`,
3601
+ * `format-painter`, `formatpainter`), and loading each of them put its buttons on the toolbar again.
3602
+ */
3603
+ withoutDuplicatePlugins(t) {
3604
+ const e = /* @__PURE__ */ new Set();
3605
+ return t.filter((o) => o != null && o.name ? e.has(o.name) ? !1 : (e.add(o.name), !0) : !0);
3606
+ }
3607
+ /**
3608
+ * True when the page configured this plugin, under `pluginConfig` or as a top-level option of its own
3609
+ * name. `spellcheck` does not count: it is the editor's own setting (the browser's spell checking) and
3610
+ * always has a value.
3611
+ */
3612
+ isPluginRequestedByConfig(t) {
3613
+ if (!this.getPluginLoadConfig(t)) return !1;
3614
+ if (t !== "spellCheck") return !0;
3615
+ const o = this.config.pluginConfig;
3616
+ return !!(o && typeof o == "object" && (o.spellCheck || o.spellcheck));
3413
3617
  }
3414
3618
  /**
3415
3619
  * This editor's instance of a registered plugin: created on first use, then reused (with the
@@ -3507,7 +3711,7 @@ class Et extends wi {
3507
3711
  this.config.readonly || this.isEditorDisabled() ? "true" : "false"
3508
3712
  );
3509
3713
  const o = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), i = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
3510
- this.contentElement.setAttribute("aria-label", o || i || mi);
3714
+ this.contentElement.setAttribute("aria-label", o || i || ki);
3511
3715
  } else
3512
3716
  this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
3513
3717
  this.contentElement.tabIndex = t.keyboardNavigation && !this.isEditorDisabled() ? 0 : -1;
@@ -3607,7 +3811,7 @@ class Et extends wi {
3607
3811
  * editable DOM: sanitizing only after the first edit leaves the page exposed until then.
3608
3812
  */
3609
3813
  sanitizeLoadedContent(t) {
3610
- return wo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3814
+ return ko(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3611
3815
  }
3612
3816
  getAutosaveConfig() {
3613
3817
  var e, o;
@@ -3698,7 +3902,7 @@ class Et extends wi {
3698
3902
  */
3699
3903
  createUI(t, e) {
3700
3904
  const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
3701
- 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 hn(
3905
+ 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 gn(
3702
3906
  {
3703
3907
  items: this.resolveToolbarItems(),
3704
3908
  sticky: this.isToolbarStickyEnabled(),
@@ -3712,10 +3916,10 @@ class Et extends wi {
3712
3916
  if (this.isEditorDisabled()) return !1;
3713
3917
  if (this.contentElement) {
3714
3918
  this.contentElement.focus();
3715
- const f = window.getSelection();
3716
- if (!f || f.rangeCount === 0 || !this.contentElement.contains(f.anchorNode)) {
3717
- const m = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
3718
- 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);
3919
+ const p = window.getSelection();
3920
+ if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
3921
+ const h = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
3922
+ g.nodeType === Node.TEXT_NODE ? h.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (h.selectNodeContents(g), h.collapse(!1)) : h.setStart(this.contentElement, 0), h.collapse(!0), p == null || p.removeAllRanges(), p == null || p.addRange(h);
3719
3923
  }
3720
3924
  }
3721
3925
  return this.executeCommand(r, l);
@@ -3729,14 +3933,14 @@ class Et extends wi {
3729
3933
  const r = document.createElement("div");
3730
3934
  r.innerHTML = e.trim(), !Array.from(r.childNodes).some((c) => {
3731
3935
  if (c.nodeType === Node.ELEMENT_NODE) {
3732
- const f = c.tagName;
3733
- return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(f);
3936
+ const p = c.tagName;
3937
+ return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(p);
3734
3938
  }
3735
3939
  return !1;
3736
3940
  }) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
3737
3941
  } else
3738
3942
  this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
3739
- this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new mn({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new gn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.setToolbarControlsDisabled(this.isEditorDisabled()), this.lastReportedContent = bt(this.contentElement), this.config.autofocus && !this.isEditorDisabled() && setTimeout(() => {
3943
+ this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new bn({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new yn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.setToolbarControlsDisabled(this.isEditorDisabled()), this.lastReportedContent = bt(this.contentElement), this.config.autofocus && !this.isEditorDisabled() && setTimeout(() => {
3740
3944
  var r;
3741
3945
  return (r = this.contentElement) == null ? void 0 : r.focus();
3742
3946
  }, 0);
@@ -3803,48 +4007,48 @@ class Et extends wi {
3803
4007
  selectionCollapsed: (r = (i = window.getSelection()) == null ? void 0 : i.isCollapsed) != null ? r : !0
3804
4008
  });
3805
4009
  }), this.contentElement.addEventListener("input", (o) => {
3806
- var T;
4010
+ var k;
3807
4011
  if (!this.contentElement) return;
3808
4012
  let i = this.contentElement.innerHTML;
3809
- const r = (T = o == null ? void 0 : o.detail) == null ? void 0 : T.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = this.lastBeforeInputType;
3810
- if (this.lastBeforeInputType = null, f.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3811
- const v = wo(i, c, f, r);
3812
- if (v !== i) {
3813
- const k = window.getSelection(), tt = k && k.rangeCount > 0 ? k.getRangeAt(0) : null;
3814
- if (this.contentElement.innerHTML = v, tt && k)
4013
+ const r = (k = o == null ? void 0 : o.detail) == null ? void 0 : k.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), h = this.lastBeforeInputType;
4014
+ if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !h) {
4015
+ const w = ko(i, c, p, r);
4016
+ if (w !== i) {
4017
+ const R = window.getSelection(), tt = R && R.rangeCount > 0 ? R.getRangeAt(0) : null;
4018
+ if (this.contentElement.innerHTML = w, tt && R)
3815
4019
  try {
3816
- k.removeAllRanges(), k.addRange(tt);
4020
+ R.removeAllRanges(), R.addRange(tt);
3817
4021
  } catch ($) {
3818
4022
  }
3819
- i = v;
4023
+ i = w;
3820
4024
  }
3821
4025
  }
3822
4026
  this.recordInputHistory(i), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
3823
- const w = () => {
3824
- this.emitContentChange(Oo(i));
4027
+ const b = () => {
4028
+ this.emitContentChange(Po(i));
3825
4029
  };
3826
- l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(w, l.debounceInputMs) : w(), this.updateStatusBar();
4030
+ l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(b, l.debounceInputMs) : b(), this.updateStatusBar();
3827
4031
  }), this.contentElement.addEventListener("contextmenu", (o) => {
3828
4032
  const i = this.config.contextMenu;
3829
4033
  (i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
3830
4034
  }), this.contentElement.addEventListener("paste", (o) => {
3831
- var g, w;
4035
+ var g, b;
3832
4036
  if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
3833
4037
  return;
3834
4038
  o.preventDefault();
3835
4039
  const i = this.config.paste || {};
3836
4040
  let r = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
3837
- const l = ((w = o.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
4041
+ const l = ((b = o.clipboardData) == null ? void 0 : b.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), h = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
3838
4042
  if ((i.clean || !i.keepFormatting) && l) {
3839
4043
  document.execCommand("insertText", !1, l);
3840
4044
  return;
3841
4045
  }
3842
- if (i.convertWord === !1 && m && l) {
4046
+ if (i.convertWord === !1 && h && l) {
3843
4047
  document.execCommand("insertText", !1, l);
3844
4048
  return;
3845
4049
  }
3846
4050
  if (r) {
3847
- f.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = si(r, c, f)), this.insertHTMLAtSelection(r);
4051
+ p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ci(r, c, p)), this.insertHTMLAtSelection(r);
3848
4052
  return;
3849
4053
  }
3850
4054
  l && document.execCommand("insertText", !1, l);
@@ -3940,15 +4144,15 @@ class Et extends wi {
3940
4144
  const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
3941
4145
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
3942
4146
  return;
3943
- const o = this.contentElement.textContent || "", { words: i, chars: r } = vn(o), l = En(this.contentElement);
3944
- let c, f;
3945
- const m = this.getSelectionRangeInEditor();
3946
- m && (c = bn(this.contentElement, m), m.collapsed || (f = wn(m, c), c = void 0)), this.statusBar.update({
4147
+ const o = this.contentElement.textContent || "", { words: i, chars: r } = wn(o), l = kn(this.contentElement);
4148
+ let c, p;
4149
+ const h = this.getSelectionRangeInEditor();
4150
+ h && (c = En(this.contentElement, h), h.collapsed || (p = Tn(h, c), c = void 0)), this.statusBar.update({
3947
4151
  wordCount: i,
3948
4152
  charCount: r,
3949
4153
  lineCount: l,
3950
4154
  cursorPosition: c,
3951
- selectionInfo: f
4155
+ selectionInfo: p
3952
4156
  });
3953
4157
  }
3954
4158
  /**
@@ -4043,7 +4247,7 @@ class Et extends wi {
4043
4247
  const o = this.attributes[e];
4044
4248
  t[o.name] = o.value;
4045
4249
  }
4046
- return Ae.resolve({
4250
+ return xe.resolve({
4047
4251
  jsConfig: this.jsConfig,
4048
4252
  attributes: t
4049
4253
  });
@@ -4081,7 +4285,7 @@ class Et extends wi {
4081
4285
  */
4082
4286
  destroy() {
4083
4287
  var t, e, o, i;
4084
- this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = bt(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(), (i = this.statusBar) == null || i.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.lastReportedContent = null, this.isInitialized = !1, Ce.delete(this), J === this && (J = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
4288
+ this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = bt(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(), (i = this.statusBar) == null || i.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.lastReportedContent = null, this.isInitialized = !1, Ae.delete(this), J === this && (J = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
4085
4289
  }
4086
4290
  // Public API methods
4087
4291
  getContent() {
@@ -4103,29 +4307,29 @@ class Et extends wi {
4103
4307
  }
4104
4308
  }
4105
4309
  export {
4106
- fn as C,
4107
- qt as E,
4108
- mn as F,
4109
- un as K,
4110
- So as P,
4310
+ hn as C,
4311
+ Yt as E,
4312
+ bn as F,
4313
+ pn as K,
4314
+ Lo as P,
4111
4315
  Et as R,
4112
- dn as S,
4113
- hn as T,
4114
- pn as a,
4115
- Ae as b,
4116
- di as c,
4117
- gn as d,
4118
- vn as e,
4119
- En as f,
4120
- Ti as g,
4316
+ fn as S,
4317
+ gn as T,
4318
+ mn as a,
4319
+ xe as b,
4320
+ fi as c,
4321
+ yn as d,
4322
+ wn as e,
4323
+ kn as f,
4324
+ Li as g,
4121
4325
  bt as h,
4122
- bn as i,
4123
- wn as j,
4124
- yn as k,
4125
- wo as l,
4126
- si as m,
4127
- Oo as n,
4128
- ki as o,
4129
- ai as s
4326
+ En as i,
4327
+ Tn as j,
4328
+ vn as k,
4329
+ ko as l,
4330
+ ci as m,
4331
+ Po as n,
4332
+ _i as o,
4333
+ li as s
4130
4334
  };
4131
- //# sourceMappingURL=index-BlsTuyTe.mjs.map
4335
+ //# sourceMappingURL=index-aIPU3kLC.mjs.map