@editora/core 1.0.32 → 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 ln {
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 ln {
21
21
  return { type: "text", text: t, marks: e };
22
22
  }
23
23
  }
24
- class Ao {
24
+ class Lo {
25
25
  constructor() {
26
26
  this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
27
27
  }
@@ -58,7 +58,7 @@ class Ao {
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 ln(t, e);
61
+ }), new fn(t, e);
62
62
  }
63
63
  getCommands() {
64
64
  const t = {};
@@ -112,10 +112,10 @@ class Ao {
112
112
  await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
113
113
  }
114
114
  }
115
- function vi() {
116
- return new Ao();
115
+ function Li() {
116
+ return new Lo();
117
117
  }
118
- class cn {
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 cn {
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 dn {
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 dn {
493
493
  this.commands.clear();
494
494
  }
495
495
  }
496
- class un {
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 Ao(), 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 dn(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 un {
579
579
  return this.isDestroyed;
580
580
  }
581
581
  }
582
- class pn {
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 pn {
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 p = [];
675
- c.split(/\s+/).filter(Boolean).forEach((g) => {
676
- if (g === "direction") {
677
- const E = r.get("setDirectionLTR"), k = r.get("setDirectionRTL");
678
- E && p.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: E.label,
681
- command: E.command,
682
- icon: E.icon,
683
- type: E.type || "button",
684
- options: E.options
685
- }), k && p.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 E = r.get("addComment"), k = r.get("toggleComments");
697
- E && p.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: E.label,
700
- command: E.command,
701
- icon: E.icon,
702
- type: E.type || "button",
703
- options: E.options
704
- }), k && p.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 && p.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
- }), p.length > 0 && e.push(p);
724
+ }), c.length > 0 && e.push(c);
726
725
  }), e;
727
726
  }
728
727
  /**
@@ -743,8 +742,8 @@ class pn {
743
742
  const c = document.createElement("div");
744
743
  if (c.className = "editora-toolbar-group", r.forEach((p) => {
745
744
  this.appendToolbarButton(c, p);
746
- const m = c.lastElementChild;
747
- m instanceof HTMLElement && (this.overflowUnits.push(m), this.overflowUnitHomes.set(m, c));
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
748
  const p = document.createElement("div");
750
749
  p.className = "editora-toolbar-separator", e.appendChild(p);
@@ -766,24 +765,24 @@ class pn {
766
765
  const c = this.overflowUnits;
767
766
  if (c.length === 0) return;
768
767
  c.forEach((B) => {
769
- var D;
770
- B.parentElement === i && ((D = this.overflowUnitHomes.get(B)) == null || D.appendChild(B));
768
+ var I;
769
+ B.parentElement === i && ((I = this.overflowUnitHomes.get(B)) == null || I.appendChild(B));
771
770
  });
772
- const p = t.clientWidth, m = 16, g = 40, w = 4, T = Math.max(0, p - m), E = Math.max(0, T - g - w), k = getComputedStyle(t).direction === "rtl", tt = e.getBoundingClientRect(), $ = (B) => {
773
- const D = B.getBoundingClientRect();
774
- return k ? tt.right - D.left : D.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) <= E) 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, D) => {
786
- D >= 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,8 +870,8 @@ class pn {
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");
@@ -881,32 +880,32 @@ class pn {
881
880
  const p = t._cleanupDropdown;
882
881
  t._cleanupDropdown = () => {
883
882
  c.disconnect(), p == null || p();
884
- }, e.addEventListener("click", (m) => {
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 = (E) => {
897
- m.preventDefault(), g[(E + 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";
@@ -925,8 +924,8 @@ class pn {
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
926
  const p = document.createElement("button");
928
- p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.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";
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";
930
929
  }), i.appendChild(p);
931
930
  }), o.addEventListener("click", (c) => {
932
931
  c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
@@ -960,13 +959,13 @@ class pn {
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
961
  const p = document.createElement("button");
963
- p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.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";
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";
965
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 p = (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
971
  p == null || p.forEach((g) => {
@@ -1009,7 +1008,7 @@ class pn {
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 fn {
1011
+ class bn {
1013
1012
  constructor(t) {
1014
1013
  this.visible = !1, this.config = t;
1015
1014
  }
@@ -1051,7 +1050,7 @@ class fn {
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 hn {
1053
+ class yn {
1055
1054
  constructor(t = {}) {
1056
1055
  this.statusInfo = {}, this.config = t;
1057
1056
  }
@@ -1111,16 +1110,16 @@ class hn {
1111
1110
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
1112
1111
  }
1113
1112
  }
1114
- function mn(s, t) {
1115
- const e = s.textContent || "", o = gn(s, 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 gn(s, t, e) {
1118
+ function vn(a, t, e) {
1120
1119
  var l;
1121
1120
  let o = 0;
1122
1121
  const i = document.createTreeWalker(
1123
- s,
1122
+ a,
1124
1123
  NodeFilter.SHOW_TEXT,
1125
1124
  null
1126
1125
  );
@@ -1134,27 +1133,27 @@ function gn(s, t, e) {
1134
1133
  }
1135
1134
  return o;
1136
1135
  }
1137
- function bn(s) {
1136
+ function kn(a) {
1138
1137
  var o, i;
1139
- const t = s.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
1138
+ const t = a.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
1140
1139
  let e = 1;
1141
1140
  if (t.length > 0) {
1142
1141
  e = t.length;
1143
1142
  const r = t[t.length - 1];
1144
1143
  (r.tagName === "BR" || ((o = r.innerHTML) == null ? void 0 : o.trim()) === "" || ((i = r.textContent) == null ? void 0 : i.trim()) === "") && e++;
1145
1144
  } else {
1146
- const l = (s.textContent || "").split(`
1145
+ const l = (a.textContent || "").split(`
1147
1146
  `).length;
1148
1147
  e = Math.max(1, l);
1149
1148
  }
1150
1149
  return e;
1151
1150
  }
1152
- function yn(s) {
1153
- const t = s.trim() ? s.trim().split(/\s+/).length : 0, e = s.length;
1151
+ function wn(a) {
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 vn(s, t) {
1157
- const e = s.toString();
1155
+ function Tn(a, t) {
1156
+ const e = a.toString();
1158
1157
  return {
1159
1158
  startLine: t.line,
1160
1159
  startColumn: t.column,
@@ -1165,153 +1164,153 @@ function vn(s, t) {
1165
1164
  selectedWords: e.trim().split(/\s+/).filter(Boolean).length
1166
1165
  };
1167
1166
  }
1168
- function io(s, t) {
1169
- (t == null || t > s.length) && (t = s.length);
1170
- for (var e = 0, o = Array(t); e < t; e++) o[e] = s[e];
1167
+ function ro(a, t) {
1168
+ (t == null || t > a.length) && (t = a.length);
1169
+ for (var e = 0, o = Array(t); e < t; e++) o[e] = a[e];
1171
1170
  return o;
1172
1171
  }
1173
- function En(s) {
1174
- if (Array.isArray(s)) return s;
1172
+ function Cn(a) {
1173
+ if (Array.isArray(a)) return a;
1175
1174
  }
1176
- function wn(s, t) {
1177
- var e = s == null ? null : typeof Symbol != "undefined" && s[Symbol.iterator] || s["@@iterator"];
1175
+ function xn(a, t) {
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 = [], p = !0, m = !1;
1178
+ var o, i, r, l, c = [], p = !0, h = !1;
1180
1179
  try {
1181
- if (r = (e = e.call(s)).next, t !== 0) for (; !(p = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); p = !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
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 Tn() {
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 kn(s, t) {
1199
- return En(s) || wn(s, t) || xn(s, t) || Tn();
1197
+ function Sn(a, t) {
1198
+ return Cn(a) || xn(a, t) || Ln(a, t) || An();
1200
1199
  }
1201
- function xn(s, t) {
1202
- if (s) {
1203
- if (typeof s == "string") return io(s, t);
1204
- var e = {}.toString.call(s).slice(8, -1);
1205
- return e === "Object" && s.constructor && (e = s.constructor.name), e === "Map" || e === "Set" ? Array.from(s) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? io(s, t) : void 0;
1200
+ function Ln(a, t) {
1201
+ if (a) {
1202
+ if (typeof a == "string") return ro(a, t);
1203
+ var e = {}.toString.call(a).slice(8, -1);
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 Co = Object.entries, ro = Object.setPrototypeOf, An = Object.isFrozen, Cn = Object.getPrototypeOf, Sn = Object.getOwnPropertyDescriptor;
1209
- let M = Object.freeze, I = Object.seal, bt = Object.create, So = typeof Reflect != "undefined" && Reflect, Te = So.apply, ke = So.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
- I || (I = function(t) {
1212
+ M || (M = function(t) {
1214
1213
  return t;
1215
1214
  });
1216
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
- ke || (ke = 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), _n = L(Array.prototype.lastIndexOf), ao = L(Array.prototype.pop), At = L(Array.prototype.push), Ln = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), so = L(String.prototype.match), Ct = L(String.prototype.replace), lo = L(String.prototype.indexOf), Mn = L(String.prototype.trim), In = L(Number.prototype.toString), On = L(Boolean.prototype.toString), co = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), uo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), P = L(Object.prototype.hasOwnProperty), St = L(Object.prototype.toString), O = L(RegExp.prototype.test), Z = Dn(TypeError);
1225
- function L(s) {
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);
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 Te(s, t, o);
1228
+ return Te(a, t, o);
1230
1229
  };
1231
1230
  }
1232
- function Dn(s) {
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 ke(s, e);
1234
+ return Ce(a, e);
1236
1235
  };
1237
1236
  }
1238
- function v(s, t) {
1237
+ function v(a, t) {
1239
1238
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Mt;
1240
- if (ro && ro(s, null), !vt(t)) return s;
1239
+ if (ao && ao(a, null), !vt(t)) return a;
1241
1240
  let o = t.length;
1242
1241
  for (; o--; ) {
1243
1242
  let i = t[o];
1244
1243
  if (typeof i == "string") {
1245
1244
  const r = e(i);
1246
- r !== i && (An(t) || (t[o] = r), i = r);
1245
+ r !== i && (_n(t) || (t[o] = r), i = r);
1247
1246
  }
1248
- s[i] = !0;
1247
+ a[i] = !0;
1249
1248
  }
1250
- return s;
1249
+ return a;
1251
1250
  }
1252
- function Rn(s) {
1253
- for (let t = 0; t < s.length; t++) P(s, t) || (s[t] = null);
1254
- return s;
1251
+ function Bn(a) {
1252
+ for (let t = 0; t < a.length; t++) N(a, t) || (a[t] = null);
1253
+ return a;
1255
1254
  }
1256
- function U(s) {
1257
- const t = bt(null);
1258
- for (const o of Co(s)) {
1259
- var e = kn(o, 2);
1255
+ function U(a) {
1256
+ const t = yt(null);
1257
+ for (const o of Mo(a)) {
1258
+ var e = Sn(o, 2);
1260
1259
  const i = e[0], r = e[1];
1261
- P(s, i) && (vt(r) ? t[i] = Rn(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 Nn(s) {
1266
- switch (typeof s) {
1264
+ function Fn(a) {
1265
+ switch (typeof a) {
1267
1266
  case "string":
1268
- return s;
1267
+ return a;
1269
1268
  case "number":
1270
- return In(s);
1269
+ return Pn(a);
1271
1270
  case "boolean":
1272
- return On(s);
1271
+ return Nn(a);
1273
1272
  case "bigint":
1274
- return co ? co(s) : "0";
1273
+ return uo ? uo(a) : "0";
1275
1274
  case "symbol":
1276
- return uo ? uo(s) : "Symbol()";
1275
+ return fo ? fo(a) : "Symbol()";
1277
1276
  case "undefined":
1278
- return St(s);
1277
+ return Lt(a);
1279
1278
  case "function":
1280
1279
  case "object": {
1281
- if (s === null) return St(s);
1282
- const t = s, e = W(t, "toString");
1280
+ if (a === null) return Lt(a);
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 : St(o);
1284
+ return typeof o == "string" ? o : Lt(o);
1286
1285
  }
1287
- return St(s);
1286
+ return Lt(a);
1288
1287
  }
1289
1288
  default:
1290
- return St(s);
1289
+ return Lt(a);
1291
1290
  }
1292
1291
  }
1293
- function W(s, t) {
1294
- for (; s !== null; ) {
1295
- const o = Sn(s, t);
1292
+ function W(a, t) {
1293
+ for (; a !== null; ) {
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
- s = Cn(s);
1299
+ a = Mn(a);
1301
1300
  }
1302
1301
  function e() {
1303
1302
  return null;
1304
1303
  }
1305
1304
  return e;
1306
1305
  }
1307
- function Pn(s) {
1306
+ function Hn(a) {
1308
1307
  try {
1309
- return O(s, ""), !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
- ]), zn = 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
- ]), Bn = 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
- ]), fo = M(["#text"]), ho = 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
- ]), mo = 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
- ]), Hn = I(/{{[\w\W]*|^[\w\W]*}}/g), Fn = I(/<%[\w\W]*|^[\w\W]*%>/g), Un = I(/\${[\w\W]*/g), jn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), Wn = I(/^aria-[\-\w]+$/), go = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), $n = I(/^(?:\w+script|data):/i), Gn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Kn = I(/^html$/i), Yn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), bo = I(/<[/\w!]/g), yo = I(/<[/\w]/g), qn = I(/<\/no(script|embed|frames)/i), Vn = I(/\/>/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
- }, _o = [
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
- ], Xn = M(v({}, _o)), Zn = (function() {
1974
- const s = {};
1975
- return rt(_o, (t) => {
1976
- s[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
1977
- }), M(s);
1978
- })(), Jn = function() {
1972
+ ], ti = _(v({}, Io)), ei = (function() {
1973
+ const a = {};
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
- }, Qn = 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";
@@ -2007,24 +2006,24 @@ const po = M([
2007
2006
  uponSanitizeElement: [],
2008
2007
  uponSanitizeShadowNode: []
2009
2008
  };
2010
- }, J = function(t, e, o, i) {
2011
- return P(t, e) && vt(t[e]) ? v(i.base ? U(i.base) : {}, t[e], i.transform) : o;
2012
- }, ve = function(t, e, o) {
2013
- const i = P(t, e) ? t[e] : void 0;
2009
+ }, Z = function(t, e, o, i) {
2010
+ return N(t, e) && vt(t[e]) ? v(i.base ? U(i.base) : {}, t[e], i.transform) : o;
2011
+ }, Ee = function(t, e, o) {
2012
+ const i = N(t, e) ? t[e] : void 0;
2014
2013
  return i && typeof i == "object" ? U(i) : o();
2015
2014
  };
2016
- function Lo() {
2017
- let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Jn();
2018
- const t = (u) => Lo(u);
2019
- if (t.version = "3.4.16", t.removed = [], !s || !s.document || s.document.nodeType !== F.document || !s.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
- let e = s.document;
2020
+ let e = a.document;
2022
2021
  const o = e, i = o.currentScript;
2023
- s.DocumentFragment;
2024
- const r = s.HTMLTemplateElement, l = s.Node, c = s.Element, p = s.NodeFilter;
2025
- s.NamedNodeMap === void 0 && (s.NamedNodeMap || s.MozNamedAttrMap), s.HTMLFormElement;
2026
- const m = s.DOMParser, g = s.trustedTypes, w = c.prototype, T = W(w, "cloneNode"), E = 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"), D = l && l.prototype ? W(l.prototype, "nodeType") : null, st = l && l.prototype ? W(l.prototype, "nodeName") : null, It = l && l.prototype ? W(l.prototype, "ownerDocument") : null, Et = function(n) {
2027
- return D ? D(n) : n.nodeType;
2022
+ a.DocumentFragment;
2023
+ const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, p = a.NodeFilter;
2024
+ a.NamedNodeMap === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
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,45 +2031,45 @@ function Lo() {
2032
2031
  const u = e.createElement("template");
2033
2032
  u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
2034
2033
  }
2035
- let N, et = "", Zt, Ce = !1, wt = 0;
2036
- const Se = function() {
2037
- if (wt > 0) throw Z('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
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
- Se(), wt++;
2038
+ Le(), wt++;
2040
2039
  try {
2041
- return N.createHTML(n);
2040
+ return P.createHTML(n);
2042
2041
  } finally {
2043
2042
  wt--;
2044
2043
  }
2045
- }, Do = function(n) {
2046
- Se(), wt++;
2044
+ }, zo = function(n) {
2045
+ Le(), wt++;
2047
2046
  try {
2048
- return N.createScriptURL(n);
2047
+ return P.createScriptURL(n);
2049
2048
  } finally {
2050
2049
  wt--;
2051
2050
  }
2052
- }, Ro = function() {
2053
- return Ce || (Zt = Qn(g, i), Ce = !0), Zt;
2054
- }, Ot = e, Jt = Ot.implementation, _e = Ot.createNodeIterator, No = Ot.createDocumentFragment, Po = Ot.getElementsByTagName, zo = o.importNode;
2055
- let x = vo();
2056
- t.isSupported = typeof Co == "function" && typeof z == "function" && Jt && Jt.createHTMLDocument !== void 0;
2057
- const Bo = Hn, Ho = Fn, Fo = Un, Uo = jn, jo = Wn, Wo = $n, Le = Gn, $o = Yn;
2058
- let Me = go, A = null;
2059
- const Qt = v({}, [
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
- ...fo
2063
+ ...ho
2065
2064
  ]);
2066
- let C = null;
2065
+ let x = null;
2067
2066
  const te = v({}, [
2068
- ...ho,
2069
- ...ye,
2070
2067
  ...mo,
2068
+ ...ye,
2069
+ ...go,
2071
2070
  ...Gt
2072
2071
  ]);
2073
- let G = Object.seal(bt(null, {
2072
+ let G = Object.seal(yt(null, {
2074
2073
  tagNameCheck: {
2075
2074
  writable: !0,
2076
2075
  configurable: !1,
@@ -2090,7 +2089,7 @@ function Lo() {
2090
2089
  value: !1
2091
2090
  }
2092
2091
  })), Tt = null, Ie = null;
2093
- const q = Object.seal(bt(null, {
2092
+ const Y = Object.seal(yt(null, {
2094
2093
  tagCheck: {
2095
2094
  writable: !0,
2096
2095
  configurable: !1,
@@ -2104,10 +2103,10 @@ function Lo() {
2104
2103
  value: null
2105
2104
  }
2106
2105
  }));
2107
- let Oe = !0, ee = !0, De = !1, Re = !0, V = !1, ot = !0, nt = !1, oe = !1, Dt = null, Rt = null, ne = !1, ct = !1, Nt = !1, Pt = !1, Ne = !0, Pe = !1;
2108
- const ze = "user-content-";
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;
2107
+ const Be = "user-content-";
2109
2108
  let ie = !0, re = !1, dt = {}, ut = null;
2110
- const Be = v({}, [
2109
+ const Fe = v({}, [
2111
2110
  "annotation-xml",
2112
2111
  "audio",
2113
2112
  "colgroup",
@@ -2136,7 +2135,7 @@ function Lo() {
2136
2135
  "xmp"
2137
2136
  ]);
2138
2137
  let He = null;
2139
- const Fe = v({}, [
2138
+ const Ue = v({}, [
2140
2139
  "audio",
2141
2140
  "video",
2142
2141
  "img",
@@ -2144,8 +2143,8 @@ function Lo() {
2144
2143
  "image",
2145
2144
  "track"
2146
2145
  ]);
2147
- let Ue = null;
2148
- const je = v({}, [
2146
+ let je = null;
2147
+ const We = v({}, [
2149
2148
  "alt",
2150
2149
  "class",
2151
2150
  "for",
@@ -2161,293 +2160,293 @@ function Lo() {
2161
2160
  "style",
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
- let pt = K, ae = !1, se = null;
2165
- const Go = v({}, [
2163
+ let ft = K, ae = !1, se = null;
2164
+ const Vo = v({}, [
2166
2165
  zt,
2167
2166
  Bt,
2168
2167
  K
2169
- ], he), We = M([
2168
+ ], he), $e = _([
2170
2169
  "mi",
2171
2170
  "mo",
2172
2171
  "mn",
2173
2172
  "ms",
2174
2173
  "mtext"
2175
2174
  ]);
2176
- let le = v({}, We);
2177
- const $e = M(["annotation-xml"]);
2178
- let ce = v({}, $e);
2179
- const Ko = v({}, [
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 kt = null;
2187
- const Yo = ["application/xhtml+xml", "text/html"], qo = "text/html";
2188
- let _ = null, ft = null;
2189
- const Vo = e.createElement("form"), Ge = 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
- if (ft && ft === n) return;
2194
- (!n || typeof n != "object") && (n = {}), n = U(n), kt = Yo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? qo : n.PARSER_MEDIA_TYPE, _ = kt === "application/xhtml+xml" ? he : Mt, A = J(n, "ALLOWED_TAGS", Qt, { transform: _ }), C = J(n, "ALLOWED_ATTR", te, { transform: _ }), se = J(n, "ALLOWED_NAMESPACES", Go, { transform: he }), Ue = J(n, "ADD_URI_SAFE_ATTR", je, {
2195
- transform: _,
2196
- base: je
2197
- }), He = J(n, "ADD_DATA_URI_TAGS", Fe, {
2198
- transform: _,
2199
- base: Fe
2200
- }), ut = J(n, "FORBID_CONTENTS", Be, { transform: _ }), Tt = J(n, "FORBID_TAGS", U({}), { transform: _ }), Ie = J(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, De = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = 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, Ne = n.SANITIZE_DOM !== !1, Pe = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, Me = Pn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : go, pt = typeof n.NAMESPACE == "string" ? n.NAMESPACE : K, le = ve(n, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, We)), ce = ve(n, "HTML_INTEGRATION_POINTS", () => v({}, $e));
2201
- const a = ve(n, "CUSTOM_ELEMENT_HANDLING", () => bt(null));
2202
- if (G = bt(null), P(a, "tagNameCheck") && Ge(a.tagNameCheck) && (G.tagNameCheck = a.tagNameCheck), P(a, "attributeNameCheck") && Ge(a.attributeNameCheck) && (G.attributeNameCheck = a.attributeNameCheck), P(a, "allowCustomizedBuiltInElements") && typeof a.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = a.allowCustomizedBuiltInElements), I(G), V && (ee = !1), Nt && (ct = !0), dt && (A = v({}, fo), C = bt(null), dt.html === !0 && (v(A, po), v(C, ho)), dt.svg === !0 && (v(A, me), v(C, ye), v(C, Gt)), dt.svgFilters === !0 && (v(A, ge), v(C, ye), v(C, Gt)), dt.mathMl === !0 && (v(A, be), v(C, mo), v(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 === Qt && (A = U(A)), v(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)), v(C, n.ADD_ATTR, _))), P(n, "ADD_FORBID_CONTENTS") && vt(n.ADD_FORBID_CONTENTS) && (ut === Be && (ut = U(ut)), v(ut, n.ADD_FORBID_CONTENTS, _)), ie && (A["#text"] = !0), nt && v(A, [
2192
+ if (pt && pt === n) return;
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,
2195
+ base: We
2196
+ }), He = Z(n, "ADD_DATA_URI_TAGS", Ue, {
2197
+ transform: S,
2198
+ base: Ue
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));
2200
+ const s = Ee(n, "CUSTOM_ELEMENT_HANDLING", () => yt(null));
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 && (v(A, ["tbody"]), delete Tt.tbody), n.TRUSTED_TYPES_POLICY) {
2207
- if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2208
- if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2209
- const d = N;
2210
- N = n.TRUSTED_TYPES_POLICY;
2205
+ ]), C.table && (v(C, ["tbody"]), delete Tt.tbody), n.TRUSTED_TYPES_POLICY) {
2206
+ if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2207
+ if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2208
+ const d = P;
2209
+ P = n.TRUSTED_TYPES_POLICY;
2211
2210
  try {
2212
2211
  et = lt("");
2213
2212
  } catch (f) {
2214
- throw N = d, f;
2213
+ throw P = d, f;
2215
2214
  }
2216
- } else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Ro()), N && typeof et == "string" && (et = lt("")));
2217
- M && M(n), ft = n;
2218
- }, Ke = v({}, [
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
- ...zn
2222
- ]), Ye = v({}, [...be, ...Bn]), Xo = function(n, a, d) {
2223
- return a.namespaceURI === K ? n === "svg" : a.namespaceURI === zt ? n === "svg" && (d === "annotation-xml" || le[d]) : !!Ke[n];
2224
- }, Zo = function(n, a, d) {
2225
- return a.namespaceURI === K ? n === "math" : a.namespaceURI === Bt ? n === "math" && ce[d] : !!Ye[n];
2226
- }, Jo = function(n, a, d) {
2227
- return a.namespaceURI === Bt && !ce[d] || a.namespaceURI === zt && !le[d] ? !1 : !Ye[n] && (Ko[n] || !Ke[n]);
2228
- }, Qo = function(n) {
2229
- let a = z(n);
2230
- (!a || !a.tagName) && (a = {
2231
- namespaceURI: pt,
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) {
2228
+ let s = z(n);
2229
+ (!s || !s.tagName) && (s = {
2230
+ namespaceURI: ft,
2232
2231
  tagName: "template"
2233
2232
  });
2234
- const d = Mt(n.tagName), f = Mt(a.tagName);
2235
- return se[n.namespaceURI] ? n.namespaceURI === Bt ? Xo(d, a, f) : n.namespaceURI === zt ? Zo(d, a, f) : n.namespaceURI === K ? Jo(d, a, f) : !!(kt === "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
2236
  At(t.removed, { element: n });
2238
2237
  try {
2239
2238
  z(n).removeChild(n);
2240
- } catch (a) {
2241
- if (E(n), !z(n)) throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2239
+ } catch (s) {
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
- }, qe = function(n, a, d) {
2242
+ }, Ve = function(n, s, d) {
2244
2243
  try {
2245
- k(n, a);
2244
+ R(n, s);
2246
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);
2254
- const a = $(n);
2255
- if (a) {
2251
+ }, Ft = function(n) {
2252
+ Ht(n);
2253
+ const s = $(n);
2254
+ if (s) {
2256
2255
  const f = [];
2257
- rt(a, (h) => {
2258
- At(f, h);
2259
- }), rt(f, (h) => {
2256
+ rt(s, (m) => {
2257
+ At(f, m);
2258
+ }), rt(f, (m) => {
2260
2259
  try {
2261
- E(h);
2262
- } catch (b) {
2260
+ w(m);
2261
+ } catch (y) {
2263
2262
  }
2264
2263
  });
2265
2264
  }
2266
2265
  const d = B(n);
2267
2266
  if (d) for (let f = d.length - 1; f >= 0; --f) {
2268
- const h = d[f], b = h && h.name;
2269
- typeof b == "string" && qe(n, h, b);
2267
+ const m = d[f], y = m && m.name;
2268
+ typeof y == "string" && Ve(n, m, y);
2270
2269
  }
2271
- }, it = function(n, a, d) {
2270
+ }, it = function(n, s, d) {
2272
2271
  if (!d) try {
2273
- d = a.getAttributeNode(n);
2272
+ d = s.getAttributeNode(n);
2274
2273
  } catch (f) {
2275
2274
  d = null;
2276
2275
  }
2277
2276
  At(t.removed, {
2278
2277
  attribute: d || null,
2279
- from: a
2278
+ from: s
2280
2279
  });
2281
2280
  try {
2282
- d ? k(a, d) : a.removeAttribute(n);
2281
+ d ? R(s, d) : s.removeAttribute(n);
2283
2282
  } catch (f) {
2284
2283
  try {
2285
- a.removeAttribute(n);
2286
- } catch (h) {
2284
+ s.removeAttribute(n);
2285
+ } catch (m) {
2287
2286
  }
2288
2287
  }
2289
2288
  if (n === "is")
2290
- if (ct || Nt) try {
2291
- X(a);
2289
+ if (ct || Pt) try {
2290
+ X(s);
2292
2291
  } catch (f) {
2293
2292
  }
2294
2293
  else try {
2295
- a.setAttribute(n, "");
2294
+ s.setAttribute(n, "");
2296
2295
  } catch (f) {
2297
2296
  }
2298
- }, tn = function(n) {
2299
- const a = B(n);
2300
- if (a)
2301
- for (let d = a.length - 1; d >= 0; --d) {
2302
- const f = a[d], h = f && f.name;
2303
- typeof h != "string" || C[_(h)] || qe(n, f, h);
2297
+ }, rn = function(n) {
2298
+ const s = B(n);
2299
+ if (s)
2300
+ for (let d = s.length - 1; d >= 0; --d) {
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) {
2306
- const a = [n];
2307
- for (; a.length > 0; ) {
2308
- const d = a.pop();
2309
- Et(d) === F.element && tn(d);
2304
+ }, Ht = function(n) {
2305
+ const s = [n];
2306
+ for (; s.length > 0; ) {
2307
+ const d = s.pop();
2308
+ kt(d) === H.element && rn(d);
2310
2309
  const f = $(d);
2311
- if (f) for (let h = f.length - 1; h >= 0; --h) a.push(f[h]);
2310
+ if (f) for (let m = f.length - 1; m >= 0; --m) s.push(f[m]);
2312
2311
  }
2313
- }, Ve = function(n, a) {
2314
- return ot ? n === "patchsrc" ? !0 : n === "for" && a !== "label" && a !== "output" : !1;
2315
- }, en = function(n) {
2312
+ }, Xe = function(n, s) {
2313
+ return ot ? n === "patchsrc" ? !0 : n === "for" && s !== "label" && s !== "output" : !1;
2314
+ }, an = function(n) {
2316
2315
  if (!ot) return;
2317
- const a = [n];
2318
- for (; a.length > 0; ) {
2319
- const d = a.pop(), f = Et(d);
2320
- if (f === F.processingInstruction || f === F.comment && O(yo, d.data)) {
2316
+ const s = [n];
2317
+ for (; s.length > 0; ) {
2318
+ const d = s.pop(), f = kt(d);
2319
+ if (f === H.processingInstruction || f === H.comment && D(Eo, d.data)) {
2321
2320
  try {
2322
- E(d);
2323
- } catch (b) {
2321
+ w(d);
2322
+ } catch (y) {
2324
2323
  }
2325
2324
  continue;
2326
2325
  }
2327
- if (f === 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") && Ve("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) a.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
- }, Xe = function(n) {
2338
- let a = null, d = null;
2336
+ }, Qe = function(n) {
2337
+ let s = null, d = null;
2339
2338
  if (ne) n = "<remove></remove>" + n;
2340
2339
  else {
2341
- const b = so(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
- kt === "application/xhtml+xml" && pt === K && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
2345
- const f = N ? lt(n) : n;
2346
- if (pt === K) try {
2347
- a = new m().parseFromString(f, kt);
2348
- } catch (b) {
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;
2345
+ if (ft === K) try {
2346
+ s = new h().parseFromString(f, Ct);
2347
+ } catch (y) {
2349
2348
  }
2350
- if (!a || !a.documentElement) {
2351
- a = Jt.createDocument(pt, "template", null);
2349
+ if (!s || !s.documentElement) {
2350
+ s = Zt.createDocument(ft, "template", null);
2352
2351
  try {
2353
- a.documentElement.innerHTML = ae ? et : f;
2354
- } catch (b) {
2352
+ s.documentElement.innerHTML = ae ? et : f;
2353
+ } catch (y) {
2355
2354
  }
2356
2355
  }
2357
- const h = a.body || a.documentElement;
2358
- return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), pt === K ? Po.call(a, nt ? "html" : "body")[0] : nt ? a.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
- const a = It ? It(n) : n.ownerDocument;
2361
- return _e.call(a || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
2359
+ const s = Dt ? Dt(n) : n.ownerDocument;
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 = Ct(n, Bo, " "), n = Ct(n, Ho, " "), n = Ct(n, Fo, " "), n;
2362
+ return n = St(n, jo, " "), n = St(n, Wo, " "), n = St(n, $o, " "), n;
2364
2363
  }, ue = function(n) {
2365
- var a;
2364
+ var s;
2366
2365
  n.normalize();
2367
- const d = It ? It(n) : n.ownerDocument, f = _e.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
2368
- let h = f.nextNode();
2369
- for (; h; )
2370
- h.data = Ut(h.data), h = f.nextNode();
2371
- const b = (a = n.querySelectorAll) === null || a === void 0 ? void 0 : a.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
- const a = st ? st(n) : null;
2377
- return typeof a != "string" || _(a) !== "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 !== D(n) || n.childNodes !== $(n);
2375
+ const s = st ? st(n) : null;
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 (!D || typeof n != "object" || n === null) return !1;
2378
+ if (!I || typeof n != "object" || n === null) return !1;
2380
2379
  try {
2381
- return D(n) === F.documentFragment;
2382
- } catch (a) {
2380
+ return I(n) === H.documentFragment;
2381
+ } catch (s) {
2383
2382
  return !1;
2384
2383
  }
2385
2384
  }, xt = function(n) {
2386
- if (!D || typeof n != "object" || n === null) return !1;
2385
+ if (!I || typeof n != "object" || n === null) return !1;
2387
2386
  try {
2388
- return typeof D(n) == "number";
2389
- } catch (a) {
2387
+ return typeof I(n) == "number";
2388
+ } catch (s) {
2390
2389
  return !1;
2391
2390
  }
2392
2391
  };
2393
- function Y(u, n, a) {
2392
+ function q(u, n, s) {
2394
2393
  u.length !== 0 && rt(u, (d) => {
2395
- d.call(t, n, a, ft);
2394
+ d.call(t, n, s, pt);
2396
2395
  });
2397
2396
  }
2398
- const on = function(n, a) {
2399
- return !!(ot && n.hasChildNodes() && !xt(n.firstElementChild) && O(bo, n.textContent) && O(bo, n.innerHTML) || ot && n.namespaceURI === K && Xn[a] && (xt(n.firstElementChild) || typeof n.textContent == "string" && O(Zn[a], n.textContent)) || n.nodeType === F.processingInstruction || ot && n.nodeType === F.comment && O(yo, n.data));
2400
- }, Wt = function(n, a) {
2401
- if (n instanceof RegExp) return O(n, a);
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));
2399
+ }, Wt = function(n, s) {
2400
+ if (n instanceof RegExp) return D(n, s);
2402
2401
  if (n instanceof Function) {
2403
- for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) f[h - 2] = arguments[h];
2404
- return !!n(a, ...f);
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
- }, nn = function(n, a, d) {
2408
- if (!Tt[a] && eo(a) && Wt(G.tagNameCheck, a)) return !1;
2409
- if (ie && !ut[a]) {
2410
- const f = z(n), h = $(n);
2411
- if (h && f) {
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
- f.insertBefore(S, tt(n));
2406
+ }, ln = function(n, s, d) {
2407
+ if (!Tt[s] && oo(s) && Wt(G.tagNameCheck, s)) return !1;
2408
+ if (ie && !ut[s]) {
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, a, d, f) {
2421
- return n.length === 0 ? a : a === d || a === f ? U(a) : a;
2422
- }, mt = function(n, a) {
2423
- return n === a || z(n) !== null ? !1 : (re && Ft(n), !0);
2424
- }, Qe = function(n, a) {
2425
- if (Y(x.beforeSanitizeElements, n, null), mt(n, a)) return !0;
2419
+ }, Je = function(n, s, d, f) {
2420
+ return n.length === 0 ? s : s === d || s === f ? U(s) : s;
2421
+ }, mt = function(n, s) {
2422
+ return n === s || z(n) !== null ? !1 : (re && Ht(n), !0);
2423
+ }, to = function(n, s) {
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, Qt, Dt), 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
2432
- }), mt(n, a)) return !0;
2433
- if (on(n, d))
2430
+ allowedTags: C
2431
+ }), mt(n, s)) return !0;
2432
+ if (sn(n, d))
2434
2433
  return X(n), !0;
2435
- if (Tt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !A[d]) {
2436
- const f = nn(n, d, a);
2437
- return f === !1 && (Y(x.afterSanitizeElements, n, null), mt(n, a)) ? !0 : f;
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 (Et(n) === F.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && O(qn, 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) {
2440
+ if (V && n.nodeType === H.text) {
2442
2441
  const f = Ut(n.textContent);
2443
2442
  n.textContent !== f && (At(t.removed, { element: n.cloneNode() }), n.textContent = f);
2444
2443
  }
2445
- return Y(x.afterSanitizeElements, n, null), mt(n, a);
2446
- }, to = function(n, a, d) {
2447
- if (Ie[a] || Ve(a, n) || Ne && (a === "id" || a === "name") && (d in e || d in Vo)) return !1;
2448
- const f = C[a] || q.attributeCheck instanceof Function && q.attributeCheck(a, n);
2449
- return ee && O(Uo, a) || Oe && O(jo, a) ? !0 : f ? Ue[a] || O(Me, Ct(d, Le, "")) || (a === "src" || a === "xlink:href" || a === "href") && n !== "script" && lo(d, "data:") === 0 && He[n] || De && !O(Wo, Ct(d, Le, "")) ? !0 : !d : eo(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, a, n) || a === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
2450
- }, rn = v({}, [
2444
+ return q(T.afterSanitizeElements, n, null), mt(n, s);
2445
+ }, eo = function(n, s, d) {
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",
@@ -2456,193 +2455,193 @@ function Lo() {
2456
2455
  "font-face-src",
2457
2456
  "font-face-uri",
2458
2457
  "missing-glyph"
2459
- ]), eo = function(n) {
2460
- return !rn[Mt(n)] && O($o, n);
2461
- }, an = function(n, a, d, f) {
2462
- if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, a)) {
2458
+ ]), oo = function(n) {
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
2463
  return lt(f);
2465
2464
  case "TrustedScriptURL":
2466
- return Do(f);
2465
+ return zo(f);
2467
2466
  }
2468
2467
  return f;
2469
- }, sn = function(n, a, d, f) {
2468
+ }, un = function(n, s, d, f) {
2470
2469
  try {
2471
- return d ? n.setAttributeNS(d, a, f) : n.setAttribute(a, f), jt(n) ? (X(n), !1) : !0;
2472
- } catch (h) {
2473
- return it(a, n), !1;
2470
+ return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f), jt(n) ? (X(n), !1) : !0;
2471
+ } catch (m) {
2472
+ return it(s, n), !1;
2474
2473
  }
2475
- }, oo = function(n, a) {
2476
- if (Y(x.beforeSanitizeAttributes, n, null), mt(n, a)) return;
2474
+ }, no = function(n, s) {
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);
2478
+ x = Je(T.uponSanitizeAttribute, x, te, Rt);
2480
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), fe = H;
2491
- let R = S === "value" ? fe : Mn(fe), no = !1;
2492
- if (f.attrName = gt, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, Y(x.uponSanitizeAttribute, n, f), R = f.attrValue, Pe && (gt === "id" || gt === "name") && lo(R, ze) !== 0 && (it(S, n, y), R = ze + R, no = !0), ot && O(/((--!?|])>)|<\/(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" && so(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
2499
  if (!f.forceKeepAttr) {
2501
2500
  if (!f.keepAttr) {
2502
- it(S, n, y);
2501
+ it(A, n, E);
2503
2502
  continue;
2504
2503
  }
2505
- if (!Re && O(Vn, 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)), !to(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 = an(b, gt, j, R), R !== fe && sn(n, S, j, R) && no && ao(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, a);
2515
+ q(T.afterSanitizeAttributes, n, null), mt(n, s);
2517
2516
  }, $t = function(n) {
2518
- let a = null;
2517
+ let s = null;
2519
2518
  const d = Ze(n);
2520
- for (Y(x.beforeSanitizeShadowDOM, n, null); a = d.nextNode(); )
2521
- if (Y(x.uponSanitizeShadowNode, a, null), Qe(a, n), oo(a, n), ht(a.content) && $t(a.content), Et(a) === F.element) {
2522
- const f = at(a);
2523
- ht(f) && (pe(f), $t(f));
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);
2526
- }, pe = function(n) {
2527
- const a = [{
2524
+ q(T.afterSanitizeShadowDOM, n, null);
2525
+ }, fe = function(n) {
2526
+ const s = [{
2528
2527
  node: n,
2529
2528
  shadow: null
2530
2529
  }];
2531
- for (; a.length > 0; ) {
2532
- const d = a.pop();
2530
+ for (; s.length > 0; ) {
2531
+ const d = s.pop();
2533
2532
  if (d.shadow) {
2534
2533
  $t(d.shadow);
2535
2534
  continue;
2536
2535
  }
2537
- const f = d.node, h = Et(f) === F.element, b = $(f);
2538
- if (b) for (let y = b.length - 1; y >= 0; --y) a.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(f) : null;
2544
- if (typeof y == "string" && _(y) === "template") {
2545
- const S = f.content;
2546
- ht(S) && a.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(f);
2554
- ht(y) && a.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] : {}, a = null, d = null, f = null, h = null;
2566
- if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !xt(u) && (u = Nn(u), typeof u != "string"))
2567
- throw Z("dirty is not a string, aborting");
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"))
2566
+ throw Q("dirty is not a string, aborting");
2568
2567
  if (!t.isSupported) return u;
2569
- oe ? (A = Dt, 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" && xt(u);
2571
- if (b) {
2572
- en(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] || Tt[H])
2577
- throw Ht(u), Z("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), Z("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
- pe(u);
2583
- } catch (H) {
2584
- throw Ht(u), H;
2581
+ fe(u);
2582
+ } catch (F) {
2583
+ throw Ft(u), F;
2585
2584
  }
2586
2585
  } else if (xt(u))
2587
- a = Xe("<!---->"), d = a.ownerDocument.importNode(u, !0), d.nodeType === F.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? a = d : a.appendChild(d), pe(a);
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 (a = Xe(u), !a) 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
- a && ne && X(a.firstChild);
2593
- const y = b ? u : a;
2591
+ s && ne && X(s.firstChild);
2592
+ const E = y ? u : s;
2594
2593
  try {
2595
- const j = Ze(y);
2594
+ const j = Ze(E);
2596
2595
  for (; f = j.nextNode(); )
2597
- Qe(f, y), oo(f, y), ht(f.content) && $t(f.content);
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));
2607
- }), j) throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");
2604
+ if (rt(t.removed, (F) => {
2605
+ F.element && (F.element === u && (j = !0), Ht(F.element));
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(a), Nt)
2612
- for (h = No.call(a.ownerDocument); a.firstChild; ) h.appendChild(a.firstChild);
2613
- else h = a;
2614
- return (C.shadowroot || C.shadowrootmode) && (h = zo.call(o, h, !0)), h;
2615
- }
2616
- let S = nt ? a.outerHTML : a.innerHTML;
2617
- return nt && A["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && O(Kn, a.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
2618
- ` + S), V && (S = Ut(S)), N && Pt ? lt(S) : S;
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;
2614
+ }
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, Dt = A, Rt = C;
2620
+ de(u), oe = !0, Ot = C, Rt = x;
2622
2621
  }, t.clearConfig = function() {
2623
- ft = null, oe = !1, Dt = null, Rt = null, N = Zt, et = "";
2624
- }, t.isValidAttribute = function(u, n, a) {
2625
- ft || de({});
2626
- const d = _(u), f = _(n);
2627
- return to(d, f, a);
2622
+ pt = null, oe = !1, Ot = null, Rt = null, P = Qt, et = "";
2623
+ }, t.isValidAttribute = function(u, n, s) {
2624
+ pt || de({});
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) && At(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 a = _n(x[u], n);
2634
- return a === -1 ? void 0 : Ln(x[u], a, 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 ao(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 = Lo();
2645
- const ti = [
2643
+ var Kt = Oo();
2644
+ const ii = [
2646
2645
  "p",
2647
2646
  "br",
2648
2647
  "strong",
@@ -2691,7 +2690,7 @@ const ti = [
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
- ], ei = {
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,60 +2707,60 @@ const ti = [
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
- }, oi = "data-editora-embed";
2712
- function ni(s) {
2713
- if (!s || /\s/.test(s.trim())) return !1;
2710
+ }, ai = "data-editora-embed";
2711
+ function si(a) {
2712
+ if (!a || /\s/.test(a.trim())) return !1;
2714
2713
  try {
2715
- const t = new URL(s.trim());
2714
+ const t = new URL(a.trim());
2716
2715
  return (t.protocol === "https:" || t.protocol === "http:") && t.hostname.length > 0;
2717
2716
  } catch (t) {
2718
2717
  return !1;
2719
2718
  }
2720
2719
  }
2721
- function Mo(s, t, e, o) {
2720
+ function Ro(a, t, e, o) {
2722
2721
  if ((t == null ? void 0 : t.sanitize) === !1)
2723
- return s;
2724
- const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ti, 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 : ei, p = /* @__PURE__ */ new Set();
2725
- for (const w of Object.values(c))
2726
- for (const T of w) p.add(T);
2727
- const m = {
2722
+ return a;
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
2728
  ALLOWED_ATTR: Array.from(p)
2730
2729
  };
2731
2730
  if (!o)
2732
- return Kt.sanitize(s, 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 E = w;
2740
- T.allowedTags.iframe = g || ((k = E.getAttribute) == null ? void 0 : k.call(E, oi)) === "true" && ni(E.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(s, m);
2743
+ return Kt.sanitize(a, h);
2745
2744
  } finally {
2746
2745
  Kt.removeHook("uponSanitizeElement");
2747
2746
  }
2748
2747
  }
2749
- function ii(s, t, e, o) {
2750
- return Mo(s, t, o, !1);
2748
+ function li(a, t, e, o) {
2749
+ return Ro(a, t, o, !1);
2751
2750
  }
2752
- function ri(s, t, e) {
2753
- return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? s : ii(s, t);
2751
+ function ci(a, t, e) {
2752
+ return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : li(a, t);
2754
2753
  }
2755
- function Eo(s, t, e, o) {
2756
- return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? s : Mo(s, 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 ai = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", si = /resize-handle|data-rte-media-pending|rte-media/;
2759
- function Io(s) {
2760
- if (!s || !si.test(s)) return s;
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
- t.innerHTML = s;
2761
+ t.innerHTML = a;
2763
2762
  const e = /* @__PURE__ */ new Set();
2764
- return t.content.querySelectorAll(ai).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) => {
@@ -2774,8 +2773,8 @@ function Io(s) {
2774
2773
  i && (i.removeAttribute("contenteditable"), !((r = i.textContent) != null && r.trim()) && !i.querySelector("img, video, a") && i.remove());
2775
2774
  }), t.innerHTML;
2776
2775
  }
2777
- function _t(s) {
2778
- return s ? Io(s.innerHTML) : "";
2776
+ function bt(a) {
2777
+ return a ? Po(a.innerHTML) : "";
2779
2778
  }
2780
2779
  const Vt = class Vt {
2781
2780
  /**
@@ -2974,7 +2973,7 @@ Vt.EDITOR_DEFAULTS = {
2974
2973
  width: "100%",
2975
2974
  readonly: !1,
2976
2975
  disabled: !1,
2977
- menubar: !0,
2976
+ menubar: !1,
2978
2977
  toolbar: !0,
2979
2978
  plugins: [],
2980
2979
  theme: "light",
@@ -3039,7 +3038,7 @@ Vt.EDITOR_DEFAULTS = {
3039
3038
  "security-sanitize-on-input"
3040
3039
  ]);
3041
3040
  let xe = Vt;
3042
- class li {
3041
+ class fi {
3043
3042
  constructor() {
3044
3043
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
3045
3044
  }
@@ -3127,93 +3126,269 @@ class li {
3127
3126
  return this.loadedPlugins.has(t);
3128
3127
  }
3129
3128
  }
3130
- const ci = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}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}}';
3131
- let Yt;
3132
- const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", wo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", pi = "Rich text editor", fi = /* @__PURE__ */ new Set(["collaboration"]), Ae = /* @__PURE__ */ new Set();
3133
- let Q = null, ko = !1, Ee = null, we = null;
3134
- function xo(s) {
3135
- if (!(s instanceof HTMLElement)) return !1;
3136
- const t = s;
3129
+ const wo = /* @__PURE__ */ new Set();
3130
+ function pi(a, t) {
3131
+ wo.has(a) || (wo.add(a), console.warn(
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.`
3133
+ ));
3134
+ }
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) {
3310
+ if (!(a instanceof HTMLElement)) return !1;
3311
+ const t = a;
3137
3312
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
3138
3313
  }
3139
- function hi(s) {
3140
- return s ? s.nodeType === Node.ELEMENT_NODE ? s : s.parentElement : null;
3314
+ function Ti(a) {
3315
+ return a ? a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement : null;
3141
3316
  }
3142
- function Lt(s) {
3143
- if (!s) return null;
3144
- if (xo(s))
3145
- return s;
3146
- const t = s.matches(wo) ? s : s.closest(wo);
3147
- return !t || !xo(t) ? null : t;
3317
+ function _t(a) {
3318
+ if (!a) return null;
3319
+ if (So(a))
3320
+ return a;
3321
+ const t = a.matches(Co) ? a : a.closest(Co);
3322
+ return !t || !So(t) ? null : t;
3148
3323
  }
3149
- function mi() {
3324
+ function Ci() {
3150
3325
  var i;
3151
3326
  if (typeof window == "undefined") return null;
3152
- const s = window[di];
3153
- if (s instanceof HTMLElement) {
3154
- const r = Lt(s);
3327
+ const a = window[Ei];
3328
+ if (a instanceof HTMLElement) {
3329
+ const r = _t(a);
3155
3330
  if (r) return r;
3156
- const l = s.matches(To) ? s : s.querySelector(To);
3331
+ const l = a.matches(xo) ? a : a.querySelector(xo);
3157
3332
  if (l) {
3158
- const c = Lt(l);
3333
+ const c = _t(l);
3159
3334
  if (c) return c;
3160
3335
  }
3161
3336
  }
3162
- const t = window[ui];
3337
+ const t = window[vi];
3163
3338
  if (t instanceof HTMLElement) {
3164
- const r = Lt(t);
3339
+ const r = _t(t);
3165
3340
  if (r) return r;
3166
3341
  }
3167
3342
  const e = document.activeElement;
3168
3343
  if (e) {
3169
- const r = Lt(e);
3344
+ const r = _t(e);
3170
3345
  if (r) return r;
3171
3346
  }
3172
3347
  const o = (i = window.getSelection) == null ? void 0 : i.call(window);
3173
3348
  if (o && o.rangeCount > 0) {
3174
- const r = Lt(hi(o.getRangeAt(0).startContainer));
3349
+ const r = _t(Ti(o.getRangeAt(0).startContainer));
3175
3350
  if (r) return r;
3176
3351
  }
3177
- if (Q && Q.isConnected)
3178
- return Q;
3352
+ if (J && J.isConnected)
3353
+ return J;
3179
3354
  for (const r of Ae)
3180
3355
  if (r.isConnected) return r;
3181
3356
  return null;
3182
3357
  }
3183
- function gi() {
3184
- if (typeof window == "undefined" || ko) return;
3185
- Ee = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3186
- const s = (t, ...e) => {
3187
- const o = mi();
3188
- return o ? o.execCommand(t, ...e) : Ee ? Ee(t, ...e) : we ? we(t, ...e) : !1;
3358
+ function xi() {
3359
+ if (typeof window == "undefined" || Ao) return;
3360
+ ke = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3361
+ const a = (t, ...e) => {
3362
+ const o = Ci();
3363
+ return o ? o.execCommand(t, ...e) : ke ? ke(t, ...e) : we ? we(t, ...e) : !1;
3189
3364
  };
3190
- window.executeEditorCommand = s, window.execEditorCommand = s, ko = !0;
3365
+ window.executeEditorCommand = a, window.execEditorCommand = a, Ao = !0;
3191
3366
  }
3192
- function bi() {
3193
- const s = "editora-webcomponent-styles";
3194
- if (!document.getElementById(s)) {
3367
+ function Ai() {
3368
+ const a = "editora-webcomponent-styles";
3369
+ if (!document.getElementById(a)) {
3195
3370
  const t = document.createElement("style");
3196
- t.id = s, t.textContent = ci, document.head.appendChild(t);
3371
+ t.id = a, t.textContent = yi, document.head.appendChild(t);
3197
3372
  }
3198
3373
  }
3199
- function Oo() {
3200
- if (!Yt) {
3201
- const s = yt.__globalPluginLoader;
3202
- s ? Yt = s : Yt = new li();
3374
+ function No() {
3375
+ if (!qt) {
3376
+ const a = Et.__globalPluginLoader;
3377
+ a ? qt = a : qt = new fi();
3203
3378
  }
3204
- return Yt;
3379
+ return qt;
3205
3380
  }
3206
- function Ei(s) {
3207
- const t = Oo();
3208
- Object.entries(s).forEach(([e, o]) => {
3381
+ function _i(a) {
3382
+ const t = No();
3383
+ Object.entries(a).forEach(([e, o]) => {
3209
3384
  t.register(e, o);
3210
3385
  });
3211
3386
  }
3212
- const yi = typeof HTMLElement == "undefined" ? class {
3387
+ const Si = typeof HTMLElement == "undefined" ? class {
3213
3388
  } : HTMLElement;
3214
- class yt extends yi {
3389
+ class Et extends Si {
3215
3390
  constructor() {
3216
- if (super(), this.pluginLoader = Oo(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new cn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.pluginInstances = /* @__PURE__ */ new Map(), this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, bi(), !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")) {
3217
3392
  const t = this.innerHTML.trim();
3218
3393
  t && this.setAttribute("data-initial-content", t);
3219
3394
  }
@@ -3270,7 +3445,7 @@ class yt extends yi {
3270
3445
  * Called when element is added to DOM
3271
3446
  */
3272
3447
  connectedCallback() {
3273
- this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
3448
+ this.hasConnected = !0, this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
3274
3449
  setTimeout(async () => {
3275
3450
  await this.initialize();
3276
3451
  }, 0);
@@ -3280,13 +3455,13 @@ class yt extends yi {
3280
3455
  * Wait for the global plugin loader to be available
3281
3456
  */
3282
3457
  async waitForPluginLoader() {
3283
- if (yt.__globalPluginLoader) {
3284
- this.pluginLoader = yt.__globalPluginLoader;
3458
+ if (Et.__globalPluginLoader) {
3459
+ this.pluginLoader = Et.__globalPluginLoader;
3285
3460
  return;
3286
3461
  }
3287
3462
  return new Promise((t) => {
3288
3463
  const e = () => {
3289
- yt.__globalPluginLoader ? (this.pluginLoader = yt.__globalPluginLoader, t()) : setTimeout(e, 0);
3464
+ Et.__globalPluginLoader ? (this.pluginLoader = Et.__globalPluginLoader, t()) : setTimeout(e, 0);
3290
3465
  };
3291
3466
  e();
3292
3467
  });
@@ -3307,7 +3482,22 @@ class yt extends yi {
3307
3482
  * Set configuration via JavaScript API
3308
3483
  */
3309
3484
  async setConfig(t) {
3310
- this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected && (this.destroy(), await this.waitForPluginLoader(), await this.initialize());
3485
+ this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected ? (this.destroy(), this.adoptConfiguredContent(t), await this.waitForPluginLoader(), await this.initialize()) : this.adoptConfiguredContent(t);
3486
+ }
3487
+ /**
3488
+ * `content` in setConfig() is a one-off replacement, not a setting: it feeds the next initialize()
3489
+ * the same way the live content that destroy() keeps does, so a later rebuild (a `plugins`
3490
+ * attribute change, the element being moved) resumes from what the user typed, not from this value.
3491
+ * It outranks that kept content, autosave and the element's own markup.
3492
+ */
3493
+ adoptConfiguredContent(t) {
3494
+ typeof t.content == "string" && (this.preservedContent = t.content);
3495
+ }
3496
+ /** Replace the `editora-theme-*` class (there is only ever one) with the one for `theme`. */
3497
+ applyThemeClass(t) {
3498
+ Array.from(this.classList).forEach((e) => {
3499
+ e.startsWith("editora-theme-") && this.classList.remove(e);
3500
+ }), t && this.classList.add(`editora-theme-${t}`);
3311
3501
  }
3312
3502
  /**
3313
3503
  * Initialize the editor
@@ -3316,7 +3506,7 @@ class yt extends yi {
3316
3506
  var r;
3317
3507
  if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
3318
3508
  const t = ++this.buildGeneration;
3319
- this.setAttribute("data-editora-editor", "true"), Ae.add(this), Q || (Q = this), gi(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.config.theme && this.classList.add(`editora-theme-${this.config.theme}`), 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");
3320
3510
  const e = await this.loadPlugins();
3321
3511
  if (t !== this.buildGeneration || !this.isConnected) return;
3322
3512
  if (this.loadedPlugins = e, e.forEach((l) => {
@@ -3335,10 +3525,10 @@ class yt extends yi {
3335
3525
  const i = this.sanitizeLoadedContent(
3336
3526
  (r = o != null ? o : this.restoreAutosavedContent()) != null ? r : this.getAttribute("data-initial-content") || ""
3337
3527
  );
3338
- this.engine = new un({
3528
+ this.engine = new mn({
3339
3529
  content: i,
3340
3530
  plugins: e,
3341
- readonly: this.config.readonly
3531
+ readonly: !!this.config.readonly || this.isEditorDisabled()
3342
3532
  }), this.createUI(e, i), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.removeAttribute("data-loading"), this.removeAttribute("aria-busy"), this.dispatchEvent(new CustomEvent("editor-ready", {
3343
3533
  detail: { api: this.getAPI() },
3344
3534
  bubbles: !0
@@ -3354,41 +3544,76 @@ class yt extends yi {
3354
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() : "";
3355
3545
  }
3356
3546
  /**
3357
- * 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.
3358
3553
  */
3359
3554
  async loadPlugins() {
3360
3555
  this.pluginLoader || await this.waitForPluginLoader();
3361
- 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;
3362
- if (e) {
3363
- if (typeof this.config.plugins == "string") {
3364
- const r = this.config.plugins.split(/\s+/).filter(Boolean);
3365
- i && !r.includes("a11yChecker") && r.push("a11yChecker");
3366
- for (const l of r) {
3367
- const c = await this.loadPlugin(l, this.getPluginLoadConfig(l));
3368
- c && t.push(c);
3369
- }
3370
- } else if (Array.isArray(this.config.plugins)) {
3371
- for (const r of this.config.plugins)
3372
- if (typeof r == "string") {
3373
- const l = await this.loadPlugin(r, this.getPluginLoadConfig(r));
3374
- l && t.push(l);
3375
- } else
3376
- t.push(r);
3377
- if (i && !t.some((r) => (r == null ? void 0 : r.name) === "a11yChecker")) {
3378
- const r = await this.loadPlugin("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
3379
- r && t.push(r);
3380
- }
3381
- }
3382
- } else {
3383
- const r = this.pluginLoader.getRegisteredPluginNames();
3384
- for (const l of r) {
3385
- const c = this.getPluginLoadConfig(l);
3386
- if (fi.has(l) && !c) continue;
3387
- const p = await this.loadPlugin(l, c);
3388
- p && t.push(p);
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);
3389
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);
3390
3574
  }
3391
- 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));
3392
3617
  }
3393
3618
  /**
3394
3619
  * This editor's instance of a registered plugin: created on first use, then reused (with the
@@ -3481,12 +3706,15 @@ class yt extends yi {
3481
3706
  if (!this.contentElement) return;
3482
3707
  const t = this.getAccessibilityConfig();
3483
3708
  if (t.enableARIA) {
3484
- this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute("aria-disabled", this.config.readonly ? "true" : "false");
3709
+ this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute(
3710
+ "aria-disabled",
3711
+ this.config.readonly || this.isEditorDisabled() ? "true" : "false"
3712
+ );
3485
3713
  const o = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), i = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
3486
- this.contentElement.setAttribute("aria-label", o || i || pi);
3714
+ this.contentElement.setAttribute("aria-label", o || i || ki);
3487
3715
  } else
3488
3716
  this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
3489
- this.contentElement.tabIndex = t.keyboardNavigation ? 0 : -1;
3717
+ this.contentElement.tabIndex = t.keyboardNavigation && !this.isEditorDisabled() ? 0 : -1;
3490
3718
  }
3491
3719
  applyLanguageSettings() {
3492
3720
  if (!this.contentElement) return;
@@ -3583,7 +3811,7 @@ class yt extends yi {
3583
3811
  * editable DOM: sanitizing only after the first edit leaves the page exposed until then.
3584
3812
  */
3585
3813
  sanitizeLoadedContent(t) {
3586
- return Eo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3814
+ return ko(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3587
3815
  }
3588
3816
  getAutosaveConfig() {
3589
3817
  var e, o;
@@ -3651,7 +3879,7 @@ class yt extends yi {
3651
3879
  this.stopAutosave();
3652
3880
  const t = this.getAutosaveConfig();
3653
3881
  !t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
3654
- this.persistAutosave(_t(this.contentElement));
3882
+ this.persistAutosave(bt(this.contentElement));
3655
3883
  }, t.intervalMs));
3656
3884
  }
3657
3885
  insertHTMLAtSelection(t) {
@@ -3674,7 +3902,7 @@ class yt extends yi {
3674
3902
  */
3675
3903
  createUI(t, e) {
3676
3904
  const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
3677
- this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new pn(
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(
3678
3906
  {
3679
3907
  items: this.resolveToolbarItems(),
3680
3908
  sticky: this.isToolbarStickyEnabled(),
@@ -3685,16 +3913,17 @@ class yt extends yi {
3685
3913
  // Pass plugin loader to get all registered plugins
3686
3914
  ), this.toolbar.setCommandHandler((r, l) => {
3687
3915
  var c;
3916
+ if (this.isEditorDisabled()) return !1;
3688
3917
  if (this.contentElement) {
3689
3918
  this.contentElement.focus();
3690
3919
  const p = window.getSelection();
3691
3920
  if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
3692
- const m = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
3693
- 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), p == null || p.removeAllRanges(), p == null || p.addRange(m);
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);
3694
3923
  }
3695
3924
  }
3696
3925
  return this.executeCommand(r, l);
3697
- }), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
3926
+ }), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly || this.isEditorDisabled() ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
3698
3927
  try {
3699
3928
  document.execCommand("defaultParagraphSeparator", !1, "p");
3700
3929
  } catch (r) {
@@ -3711,11 +3940,20 @@ class yt extends yi {
3711
3940
  }) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
3712
3941
  } else
3713
3942
  this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
3714
- this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new fn({ 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 hn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && 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(() => {
3715
3944
  var r;
3716
3945
  return (r = this.contentElement) == null ? void 0 : r.focus();
3717
3946
  }, 0);
3718
3947
  }
3948
+ /** True only when the page asked for a menu bar (the default is not a request), through setConfig() or the attribute. */
3949
+ isMenubarRequested() {
3950
+ var o;
3951
+ const t = (o = this.jsConfig) == null ? void 0 : o.menubar;
3952
+ if (t !== void 0)
3953
+ return t === !0 || typeof t == "object" && t !== null && t.enabled !== !1;
3954
+ const e = this.getAttribute("menubar");
3955
+ return e !== null && e !== "false";
3956
+ }
3719
3957
  /**
3720
3958
  * Hands what a keystroke changed to the history plugin, so Undo takes back typing. Without this the
3721
3959
  * plugin only knew about changes that plugins reported themselves, and typed text could not be undone.
@@ -3730,6 +3968,30 @@ class yt extends yi {
3730
3968
  selectionCollapsed: e.selectionCollapsed
3731
3969
  });
3732
3970
  }
3971
+ /**
3972
+ * `disabled` is `readonly` plus a toolbar that cannot be pressed and a surface that leaves the tab
3973
+ * order, like a disabled form control.
3974
+ */
3975
+ isEditorDisabled() {
3976
+ return this.config.disabled === !0;
3977
+ }
3978
+ applyDisabledState() {
3979
+ var e, o;
3980
+ const t = this.isEditorDisabled();
3981
+ this.classList.toggle("editora-disabled", t), t && ((e = this.floatingToolbar) == null || e.hide()), this.contentElement && (this.contentElement.contentEditable = t || this.config.readonly ? "false" : "true", this.applyAccessibilitySettings()), (o = this.engine) == null || o.setReadonly(t || !!this.config.readonly), this.setToolbarControlsDisabled(t);
3982
+ }
3983
+ /**
3984
+ * Disable (or give back) every control the default toolbar rendered. Controls that were already
3985
+ * disabled for another reason are marked untouched, so enabling the editor does not wake them up.
3986
+ */
3987
+ setToolbarControlsDisabled(t) {
3988
+ if (!this.toolbarElement) return;
3989
+ this.toolbarElement.querySelectorAll(
3990
+ "button, input, select, textarea"
3991
+ ).forEach((o) => {
3992
+ t ? o.disabled || (o.disabled = !0, o.setAttribute(ve, "")) : o.hasAttribute(ve) && (o.disabled = !1, o.removeAttribute(ve));
3993
+ });
3994
+ }
3733
3995
  /**
3734
3996
  * Setup event listeners
3735
3997
  */
@@ -3745,63 +4007,61 @@ class yt extends yi {
3745
4007
  selectionCollapsed: (r = (i = window.getSelection()) == null ? void 0 : i.isCollapsed) != null ? r : !0
3746
4008
  });
3747
4009
  }), this.contentElement.addEventListener("input", (o) => {
3748
- var T;
4010
+ var k;
3749
4011
  if (!this.contentElement) return;
3750
4012
  let i = this.contentElement.innerHTML;
3751
- const r = (T = o == null ? void 0 : o.detail) == null ? void 0 : T.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = this.lastBeforeInputType;
3752
- if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3753
- const E = Eo(i, c, p, r);
3754
- if (E !== i) {
3755
- const k = window.getSelection(), tt = k && k.rangeCount > 0 ? k.getRangeAt(0) : null;
3756
- if (this.contentElement.innerHTML = E, 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)
3757
4019
  try {
3758
- k.removeAllRanges(), k.addRange(tt);
4020
+ R.removeAllRanges(), R.addRange(tt);
3759
4021
  } catch ($) {
3760
4022
  }
3761
- i = E;
4023
+ i = w;
3762
4024
  }
3763
4025
  }
3764
4026
  this.recordInputHistory(i), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
3765
- const w = () => {
3766
- this.dispatchEvent(new CustomEvent("content-change", {
3767
- detail: { html: Io(i) },
3768
- bubbles: !0
3769
- }));
4027
+ const b = () => {
4028
+ this.emitContentChange(Po(i));
3770
4029
  };
3771
- 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();
3772
4031
  }), this.contentElement.addEventListener("contextmenu", (o) => {
3773
4032
  const i = this.config.contextMenu;
3774
4033
  (i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
3775
4034
  }), this.contentElement.addEventListener("paste", (o) => {
3776
- var g, w;
4035
+ var g, b;
3777
4036
  if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
3778
4037
  return;
3779
4038
  o.preventDefault();
3780
4039
  const i = this.config.paste || {};
3781
4040
  let r = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
3782
- const l = ((w = o.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = 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);
3783
4042
  if ((i.clean || !i.keepFormatting) && l) {
3784
4043
  document.execCommand("insertText", !1, l);
3785
4044
  return;
3786
4045
  }
3787
- if (i.convertWord === !1 && m && l) {
4046
+ if (i.convertWord === !1 && h && l) {
3788
4047
  document.execCommand("insertText", !1, l);
3789
4048
  return;
3790
4049
  }
3791
4050
  if (r) {
3792
- p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ri(r, c, p)), this.insertHTMLAtSelection(r);
4051
+ p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ci(r, c, p)), this.insertHTMLAtSelection(r);
3793
4052
  return;
3794
4053
  }
3795
4054
  l && document.execCommand("insertText", !1, l);
3796
4055
  }), this.contentElement.addEventListener("focus", () => {
3797
- Q = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
4056
+ J = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
3798
4057
  }), this.contentElement.addEventListener("blur", () => {
3799
- this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
3800
- detail: { html: _t(this.contentElement) },
3801
- bubbles: !0
3802
- })), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
4058
+ if (this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement) {
4059
+ const o = bt(this.contentElement);
4060
+ o !== this.lastReportedContent && this.emitContentChange(o);
4061
+ }
4062
+ this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
3803
4063
  }), this.contentElement.addEventListener("keydown", (o) => {
3804
- this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (r, l) => {
4064
+ !this.getAccessibilityConfig().keyboardNavigation || this.isEditorDisabled() || t.handleKeyDown(o, (r, l) => {
3805
4065
  this.executeCommand(r, l);
3806
4066
  });
3807
4067
  });
@@ -3811,6 +4071,12 @@ class yt extends yi {
3811
4071
  };
3812
4072
  this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
3813
4073
  }
4074
+ emitContentChange(t) {
4075
+ this.lastReportedContent = t, this.dispatchEvent(new CustomEvent("content-change", {
4076
+ detail: { html: t },
4077
+ bubbles: !0
4078
+ }));
4079
+ }
3814
4080
  getSelectionRangeInEditor() {
3815
4081
  if (!this.contentElement) return null;
3816
4082
  const t = window.getSelection();
@@ -3878,10 +4144,10 @@ class yt extends yi {
3878
4144
  const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
3879
4145
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
3880
4146
  return;
3881
- const o = this.contentElement.textContent || "", { words: i, chars: r } = yn(o), l = bn(this.contentElement);
4147
+ const o = this.contentElement.textContent || "", { words: i, chars: r } = wn(o), l = kn(this.contentElement);
3882
4148
  let c, p;
3883
- const m = this.getSelectionRangeInEditor();
3884
- m && (c = mn(this.contentElement, m), m.collapsed || (p = vn(m, c), c = void 0)), this.statusBar.update({
4149
+ const h = this.getSelectionRangeInEditor();
4150
+ h && (c = En(this.contentElement, h), h.collapsed || (p = Tn(h, c), c = void 0)), this.statusBar.update({
3885
4151
  wordCount: i,
3886
4152
  charCount: r,
3887
4153
  lineCount: l,
@@ -3902,12 +4168,13 @@ class yt extends yi {
3902
4168
  handleAttributeChange(t, e) {
3903
4169
  switch (t) {
3904
4170
  case "readonly":
3905
- this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e));
4171
+ this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) || this.isEditorDisabled() ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e) || this.isEditorDisabled());
4172
+ break;
4173
+ case "disabled":
4174
+ this.applyDisabledState();
3906
4175
  break;
3907
4176
  case "theme":
3908
- this.classList.forEach((o) => {
3909
- o.startsWith("editora-theme-") && this.classList.remove(o);
3910
- }), e && this.classList.add(`editora-theme-${e}`);
4177
+ this.applyThemeClass(e);
3911
4178
  break;
3912
4179
  case "placeholder":
3913
4180
  this.contentElement && (this.contentElement.setAttribute("data-placeholder", e), this.applyAccessibilitySettings());
@@ -3957,14 +4224,20 @@ class yt extends yi {
3957
4224
  case "toolbar-sticky":
3958
4225
  case "plugins":
3959
4226
  case "statusbar":
3960
- this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
3961
- this.initialize().catch((o) => {
3962
- console.error("[RichTextEditor] Error during attribute change re-initialization:", o);
3963
- });
3964
- }));
4227
+ this.isConnected && this.hasConnected && this.scheduleReinitialize();
3965
4228
  break;
3966
4229
  }
3967
4230
  }
4231
+ /** One rebuild for however many attributes are changed in the same task. */
4232
+ scheduleReinitialize() {
4233
+ this.reinitializeQueued || (this.reinitializeQueued = !0, queueMicrotask(() => {
4234
+ this.reinitializeQueued = !1, this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
4235
+ this.initialize().catch((t) => {
4236
+ console.error("[RichTextEditor] Error during attribute change re-initialization:", t);
4237
+ });
4238
+ }));
4239
+ }));
4240
+ }
3968
4241
  /**
3969
4242
  * Resolve configuration from all sources
3970
4243
  */
@@ -3984,7 +4257,7 @@ class yt extends yi {
3984
4257
  */
3985
4258
  getAPI() {
3986
4259
  return {
3987
- getContent: () => _t(this.contentElement),
4260
+ getContent: () => bt(this.contentElement),
3988
4261
  setContent: (t) => {
3989
4262
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
3990
4263
  },
@@ -4012,11 +4285,11 @@ class yt extends yi {
4012
4285
  */
4013
4286
  destroy() {
4014
4287
  var t, e, o, i;
4015
- this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = _t(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.isInitialized = !1, Ae.delete(this), Q === this && (Q = 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 }));
4016
4289
  }
4017
4290
  // Public API methods
4018
4291
  getContent() {
4019
- return _t(this.contentElement);
4292
+ return bt(this.contentElement);
4020
4293
  }
4021
4294
  setContent(t) {
4022
4295
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
@@ -4034,29 +4307,29 @@ class yt extends yi {
4034
4307
  }
4035
4308
  }
4036
4309
  export {
4037
- dn as C,
4038
- qt as E,
4039
- fn as F,
4040
- cn as K,
4041
- Ao as P,
4042
- yt as R,
4043
- ln as S,
4044
- pn as T,
4045
- un as a,
4310
+ hn as C,
4311
+ Yt as E,
4312
+ bn as F,
4313
+ pn as K,
4314
+ Lo as P,
4315
+ Et as R,
4316
+ fn as S,
4317
+ gn as T,
4318
+ mn as a,
4046
4319
  xe as b,
4047
- li as c,
4048
- hn as d,
4049
- yn as e,
4050
- bn as f,
4051
- vi as g,
4052
- _t as h,
4053
- mn as i,
4054
- vn as j,
4055
- gn as k,
4056
- Eo as l,
4057
- ri as m,
4058
- Io as n,
4059
- Ei as o,
4060
- ii as s
4320
+ fi as c,
4321
+ yn as d,
4322
+ wn as e,
4323
+ kn as f,
4324
+ Li as g,
4325
+ bt as h,
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
4061
4334
  };
4062
- //# sourceMappingURL=index-BV8-D8fY.mjs.map
4335
+ //# sourceMappingURL=index-aIPU3kLC.mjs.map