@richscripts/richtexteditor 2.12.1 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/package.json +1 -1
  2. package/richtexteditor/all_plugins.js +211 -6
  3. package/richtexteditor/all_plugins.min.js +47 -47
  4. package/richtexteditor/plugins/a11yenhance.min.js +1 -0
  5. package/richtexteditor/plugins/accessibilitychecker.js +168 -0
  6. package/richtexteditor/plugins/accessibilitychecker.min.js +1 -0
  7. package/richtexteditor/plugins/aitoolkit.min.js +14 -0
  8. package/richtexteditor/plugins/all_plugins.js +211 -6
  9. package/richtexteditor/plugins/all_plugins.min.js +47 -47
  10. package/richtexteditor/plugins/autocorrect.min.js +1 -0
  11. package/richtexteditor/plugins/autoembed.min.js +1 -0
  12. package/richtexteditor/plugins/blocktypes.min.js +2 -0
  13. package/richtexteditor/plugins/bookmarkcard.min.js +2 -0
  14. package/richtexteditor/plugins/changecase.min.js +1 -0
  15. package/richtexteditor/plugins/charlimit.min.js +2 -0
  16. package/richtexteditor/plugins/comments.min.js +3 -0
  17. package/richtexteditor/plugins/contentminimap.min.js +1 -0
  18. package/richtexteditor/plugins/crossreference.min.js +1 -0
  19. package/richtexteditor/plugins/dialoga11y.min.js +1 -0
  20. package/richtexteditor/plugins/dictation.min.js +1 -0
  21. package/richtexteditor/plugins/documentimport.min.js +4 -0
  22. package/richtexteditor/plugins/documentoutline.js +43 -6
  23. package/richtexteditor/plugins/documentoutline.min.js +1 -0
  24. package/richtexteditor/plugins/docxexport.min.js +2 -0
  25. package/richtexteditor/plugins/draghandle.min.js +1 -0
  26. package/richtexteditor/plugins/emailtoolkit.min.js +1 -0
  27. package/richtexteditor/plugins/emojiautocomplete.min.js +1 -0
  28. package/richtexteditor/plugins/foldheadings.min.js +1 -0
  29. package/richtexteditor/plugins/footnotes.min.js +1 -0
  30. package/richtexteditor/plugins/formatpainter.min.js +1 -0
  31. package/richtexteditor/plugins/formattingmarks.min.js +1 -0
  32. package/richtexteditor/plugins/gapcursor.min.js +1 -0
  33. package/richtexteditor/plugins/ghostcomplete.min.js +1 -0
  34. package/richtexteditor/plugins/html2pdf.min.js +1 -0
  35. package/richtexteditor/plugins/imageeditor.min.js +1 -0
  36. package/richtexteditor/plugins/importstyles.min.js +1 -0
  37. package/richtexteditor/plugins/inlinecode.min.js +1 -0
  38. package/richtexteditor/plugins/insertcode.min.js +8 -0
  39. package/richtexteditor/plugins/insertemoji.min.js +1 -0
  40. package/richtexteditor/plugins/insertgallery.min.js +1 -0
  41. package/richtexteditor/plugins/inserttemplate.min.js +1 -0
  42. package/richtexteditor/plugins/keyboarda11y.min.js +1 -0
  43. package/richtexteditor/plugins/layouttable.min.js +1 -0
  44. package/richtexteditor/plugins/linenumbers.min.js +1 -0
  45. package/richtexteditor/plugins/linkchecker.min.js +1 -0
  46. package/richtexteditor/plugins/localdraft.min.js +1 -0
  47. package/richtexteditor/plugins/markdownexport.min.js +2 -0
  48. package/richtexteditor/plugins/mathdialog.min.js +1 -0
  49. package/richtexteditor/plugins/mentionplugin.min.js +3 -0
  50. package/richtexteditor/plugins/mergefields.min.js +1 -0
  51. package/richtexteditor/plugins/mermaiddiagram.min.js +16 -0
  52. package/richtexteditor/plugins/multilevellist.min.js +1 -0
  53. package/richtexteditor/plugins/multiroot.min.js +1 -0
  54. package/richtexteditor/plugins/nodetypes.min.js +1 -0
  55. package/richtexteditor/plugins/pagination.min.js +1 -0
  56. package/richtexteditor/plugins/pdfexport.min.js +19 -0
  57. package/richtexteditor/plugins/permanentpen.min.js +1 -0
  58. package/richtexteditor/plugins/readabilitystats.min.js +1 -0
  59. package/richtexteditor/plugins/readaloud.min.js +1 -0
  60. package/richtexteditor/plugins/restrictedediting.min.js +2 -0
  61. package/richtexteditor/plugins/revisionhistory.min.js +3 -0
  62. package/richtexteditor/plugins/rtlui.min.js +2 -0
  63. package/richtexteditor/plugins/rubyannotation.min.js +1 -0
  64. package/richtexteditor/plugins/sanitizer.min.js +1 -0
  65. package/richtexteditor/plugins/shadowdom.min.js +1 -0
  66. package/richtexteditor/plugins/slashcommand.min.js +2 -0
  67. package/richtexteditor/plugins/smartchips.min.js +2 -0
  68. package/richtexteditor/plugins/spellcheck.min.js +2 -0
  69. package/richtexteditor/plugins/stateinspector.min.js +2 -0
  70. package/richtexteditor/plugins/structured-content-bridge.js +5178 -0
  71. package/richtexteditor/plugins/structured-content-bridge.min.js +19 -0
  72. package/richtexteditor/plugins/tableofcontents.min.js +1 -0
  73. package/richtexteditor/plugins/tabletools.min.js +1 -0
  74. package/richtexteditor/plugins/textdirection.min.js +1 -0
  75. package/richtexteditor/plugins/textpartlanguage.min.js +1 -0
  76. package/richtexteditor/plugins/todolist.min.js +1 -0
  77. package/richtexteditor/plugins/trackedchanges.min.js +3 -0
  78. package/richtexteditor/plugins/typewriter.min.js +1 -0
  79. package/richtexteditor/plugins/watermark.min.js +1 -0
  80. package/richtexteditor/plugins/wordexport.min.js +23 -0
  81. package/richtexteditor/plugins/yjscollab.min.js +2 -0
  82. package/richtexteditor/plugins/zz_richtextbox_dialog_style.min.js +1 -0
  83. package/richtexteditor/rte-config.js +2 -0
  84. package/richtexteditor/rte.js +4 -2
@@ -0,0 +1 @@
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_a11yenhance=RTE_Plugin_A11yEnhance,typeof RTE_DefaultConfig.a11yEnhance>"u"&&(RTE_DefaultConfig.a11yEnhance=!0);function RTE_Plugin_A11yEnhance(){var c=this,e,a;c.PluginName="A11yEnhance",c.InitConfig=function(t){e=t},c.InitEditor=function(t){if(a=t,e.a11yEnhance!==!1){r();try{a.attachEvent("ready",r)}catch{}try{a.attachEvent("aftersethtml",r)}catch{}setTimeout(r,0),setTimeout(r,200),a.applyAccessibilityMetadata=r}};function o(){return e.contentAriaLabel||e.contentLabel||"Rich text editor. Editing area."}function f(){if(e.contentLang)return e.contentLang;try{var t=e.container&&e.container.ownerDocument&&e.container.ownerDocument.documentElement.getAttribute("lang");if(t)return t}catch{}try{var i=typeof document<"u"&&document.documentElement.getAttribute("lang");if(i)return i}catch{}return"en"}function r(){var t=a.getDocument();if(t){try{var i=f();i&&t.documentElement&&t.documentElement.getAttribute("lang")!==i&&t.documentElement.setAttribute("lang",i)}catch{}try{var u=t.defaultView&&t.defaultView.frameElement;u&&!u.getAttribute("title")&&u.setAttribute("title",o())}catch{}try{var n=a.getEditable();n&&n.nodeType===1&&(n.getAttribute("role")||n.setAttribute("role","textbox"),n.getAttribute("aria-multiline")||n.setAttribute("aria-multiline","true"),!n.getAttribute("aria-label")&&!n.getAttribute("aria-labelledby")&&n.setAttribute("aria-label",o()))}catch{}}}}
@@ -654,6 +654,125 @@ function RTE_Plugin_AccessibilityChecker() {
654
654
  }
655
655
  }
656
656
 
657
+ // 2026-09-22 Six rules the commercial checkers have and this one did not
658
+ // (TinyMCE's paid checker: D1, D3, D4, I3, I4, T1). One pass over the whole
659
+ // editable, like duplicate-id, because several need to see neighbours.
660
+ if (editable && editable.querySelectorAll) {
661
+ // D1 paragraph-as-heading: a short paragraph whose whole text is bold and
662
+ // visibly large looks like a heading but cannot be reached by heading
663
+ // navigation and is missing from the outline.
664
+ var paras = editable.querySelectorAll("p");
665
+ for (var pi = 0; pi < paras.length; pi++) {
666
+ var pEl = paras[pi];
667
+ var pText = getText(pEl);
668
+ if (!pText || pText.length > 80 || /[.!?:;,]$/.test(pText)) continue;
669
+ var win = pEl.ownerDocument.defaultView;
670
+ var strong = pEl.querySelector("strong, b");
671
+ var pStyle = win.getComputedStyle(pEl);
672
+ var boldAll = (strong && getText(strong) === pText) || parseInt(pStyle.fontWeight, 10) >= 600;
673
+ if (!boldAll) continue;
674
+ var sizeEl = strong || pEl;
675
+ var bodySize = parseFloat(win.getComputedStyle(pEl.ownerDocument.body).fontSize) || 16;
676
+ if (parseFloat(win.getComputedStyle(sizeEl).fontSize) < bodySize * 1.2) continue;
677
+ issues.push({
678
+ code: "paragraph-as-heading",
679
+ severity: "warning",
680
+ message: "\"" + pText + "\" looks like a heading (bold, large, on its own line) but is a paragraph. Screen-reader users cannot jump to it. Use a heading level instead.",
681
+ path: "document.p[" + pi + "]",
682
+ _target: pEl
683
+ });
684
+ }
685
+
686
+ // D4 fake-list: two or more consecutive paragraphs that start with the same
687
+ // kind of hand-typed marker ("1." "2." / "-" "*" "•").
688
+ var markerKind = function (el) {
689
+ if (!el || String(el.nodeName).toLowerCase() !== "p") return null;
690
+ var t = getText(el);
691
+ if (/^\d{1,3}[.)]\s+\S/.test(t)) return "ol";
692
+ if (/^[-*•▪●]\s+\S/.test(t)) return "ul";
693
+ return null;
694
+ };
695
+ var kids = editable.children;
696
+ for (var ki = 0; ki < kids.length; ki++) {
697
+ var kind = markerKind(kids[ki]);
698
+ if (!kind) continue;
699
+ var run = 1;
700
+ while (ki + run < kids.length && markerKind(kids[ki + run]) === kind) run++;
701
+ if (run >= 2) {
702
+ issues.push({
703
+ code: "fake-list",
704
+ severity: "warning",
705
+ message: run + " paragraphs are typed as a " + (kind === "ol" ? "numbered" : "bulleted") + " list. Screen readers do not announce them as a list or say how many items it has. Use the list button instead.",
706
+ path: "content[" + ki + "]",
707
+ _target: kids[ki]
708
+ });
709
+ }
710
+ ki += run - 1;
711
+ }
712
+
713
+ // I3 / I4: alt text that is a file name, or too long to be heard comfortably.
714
+ var imgs = editable.querySelectorAll("img[alt]");
715
+ for (var ii = 0; ii < imgs.length; ii++) {
716
+ var alt = (imgs[ii].getAttribute("alt") || "").trim();
717
+ if (!alt) continue; // alt="" is a deliberate decorative marker
718
+ var srcName = ((imgs[ii].getAttribute("src") || "").split(/[?#]/)[0].split("/").pop() || "").toLowerCase();
719
+ if (/\.(jpe?g|png|gif|webp|bmp|svg|avif|tiff?)$/i.test(alt) || (srcName && alt.toLowerCase() === srcName) || /^(img|image|dsc|photo|screenshot)[-_ ]?\d+/i.test(alt)) {
720
+ issues.push({
721
+ code: "image-alt-filename",
722
+ severity: "error",
723
+ message: "Alt text \"" + alt + "\" is a file name, which describes nothing. Say what the image shows.",
724
+ path: "document.img[" + ii + "]",
725
+ _target: imgs[ii]
726
+ });
727
+ } else if (alt.length > 150) {
728
+ issues.push({
729
+ code: "image-alt-too-long",
730
+ severity: "warning",
731
+ message: "Alt text is " + alt.length + " characters. Keep it to a short description; put longer detail in the text or a caption.",
732
+ path: "document.img[" + ii + "]",
733
+ _target: imgs[ii]
734
+ });
735
+ }
736
+ }
737
+
738
+ // D3 link-adjacent-duplicate: two links next to each other with the same
739
+ // href (typically an image link and a text link) are announced twice.
740
+ var links = editable.querySelectorAll("a[href]");
741
+ for (var li = 1; li < links.length; li++) {
742
+ var prev = links[li - 1], cur = links[li];
743
+ if (prev.getAttribute("href") !== cur.getAttribute("href")) continue;
744
+ var between = prev.nextSibling, adjacent = true;
745
+ while (between && between !== cur) {
746
+ if (between.nodeType === 1 || (between.nodeType === 3 && /\S/.test(between.data))) { adjacent = false; break; }
747
+ between = between.nextSibling;
748
+ }
749
+ if (adjacent && between === cur) {
750
+ issues.push({
751
+ code: "link-adjacent-duplicate",
752
+ severity: "warning",
753
+ message: "Two links next to each other go to the same place, so it is announced twice. Combine them into one link.",
754
+ path: "document.link[" + li + "]",
755
+ _target: cur
756
+ });
757
+ }
758
+ }
759
+
760
+ // T1 table-missing-caption: a DATA table (it has header cells) without a caption.
761
+ var tables = editable.querySelectorAll("table");
762
+ for (var ti = 0; ti < tables.length; ti++) {
763
+ var tb = tables[ti];
764
+ if ((tb.getAttribute("role") || "").toLowerCase() === "presentation") continue;
765
+ if (!tb.querySelector("th") || tb.querySelector("caption")) continue;
766
+ issues.push({
767
+ code: "table-missing-caption",
768
+ severity: "warning",
769
+ message: "Data table has no caption. A short caption lets screen-reader users know what the table is before they enter it.",
770
+ path: "document.table[" + ti + "]",
771
+ _target: tb
772
+ });
773
+ }
774
+ }
775
+
657
776
  return { document: null, issues: issues, valid: !issues.length, source: "dom" };
658
777
  }
659
778
 
@@ -710,6 +829,55 @@ function RTE_Plugin_AccessibilityChecker() {
710
829
  markLanguageRuns(target, options && options.lang ? options.lang : issue._lang, issue._script);
711
830
  }
712
831
 
832
+ else if (issue.code === "paragraph-as-heading") {
833
+ var lvl = Math.max(1, Math.min(6, parseInt(options && options.targetLevel, 10) || 2));
834
+ var h = target.ownerDocument.createElement("h" + lvl);
835
+ // the paragraph's whole text was bold/large: that styling is the heading now
836
+ h.textContent = (target.textContent || "").replace(/^\s+|\s+$/g, "");
837
+ copyAttributes(target, h);
838
+ h.removeAttribute("style");
839
+ target.parentNode.replaceChild(h, target);
840
+ }
841
+ else if (issue.code === "fake-list") {
842
+ var d = target.ownerDocument;
843
+ var listParent = target.parentNode;
844
+ var ordered = /^\d/.test((target.textContent || "").replace(/^\s+/, ""));
845
+ var list = d.createElement(ordered ? "ol" : "ul");
846
+ var node = target;
847
+ while (node && node.nodeName === "P") {
848
+ var t = (node.textContent || "").replace(/^\s+/, "");
849
+ var m = ordered ? /^\d{1,3}[.)]\s+([\s\S]*)$/.exec(t) : /^[-*•▪●]\s+([\s\S]*)$/.exec(t);
850
+ if (!m) break;
851
+ var li = d.createElement("li");
852
+ li.textContent = m[1].replace(/\s+$/, "");
853
+ list.appendChild(li);
854
+ var next = node.nextElementSibling;
855
+ node.parentNode.removeChild(node);
856
+ node = next;
857
+ }
858
+ if (node && node.parentNode === listParent) listParent.insertBefore(list, node);
859
+ else listParent.appendChild(list);
860
+ }
861
+ else if (issue.code === "table-missing-caption") {
862
+ var capText = String((options && options.captionText) || "").replace(/^\s+|\s+$/g, "");
863
+ if (capText) {
864
+ var cap = target.ownerDocument.createElement("caption");
865
+ cap.textContent = capText;
866
+ target.insertBefore(cap, target.firstChild);
867
+ }
868
+ }
869
+ else if (issue.code === "link-adjacent-duplicate") {
870
+ // merge the second link into the first: one link, one announcement
871
+ var prevLink = target.previousSibling;
872
+ while (prevLink && prevLink.nodeType !== 1) prevLink = prevLink.previousSibling;
873
+ if (prevLink && prevLink.nodeName === "A") {
874
+ while (target.firstChild) prevLink.appendChild(target.firstChild);
875
+ target.parentNode.removeChild(target);
876
+ }
877
+ }
878
+ else if (issue.code === "image-alt-filename" || issue.code === "image-alt-too-long") {
879
+ target.setAttribute("alt", String((options && options.altText) || "").replace(/^\s+|\s+$/g, ""));
880
+ }
713
881
  selectedIssueIndex = 0;
714
882
  scheduleEditorChange();
715
883
  return runAudit();
@@ -0,0 +1 @@
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_accessibilitychecker=RTE_Plugin_AccessibilityChecker;function RTE_Plugin_AccessibilityChecker(){var fe=this,d,s,A=null,D=null,H=null,R=null,u=null,Ae=0,h=null,v=-1;fe.PluginName="AccessibilityChecker",fe.InitConfig=function(t){d=t,d.accessibilityCheckerEnabled!==!1&&(typeof d.accessibilityCheckerAutoOpen!="boolean"&&(d.accessibilityCheckerAutoOpen=!1),d.accessibilityCheckerTitle=d.accessibilityCheckerTitle||"Accessibility",d.accessibilityCheckerHint=d.accessibilityCheckerHint||"Review heading structure, image alt text, and table headers without leaving the editor.",d.accessibilityCheckerEmptyText=d.accessibilityCheckerEmptyText||"No accessibility issues found in the current document.",Se("toolbar_default","#{accessibilitychecker}"),Se("toolbar_full","#{accessibilitychecker}"))},fe.InitEditor=function(t){s=t,d.accessibilityCheckerEnabled!==!1&&(s.accessibilityChecker={close:function(){pe()},getIssues:function(){return h?h.issues.slice():[]},open:function(){de()},refresh:function(){return _()},repair:function(e,r){return O(e,r)},run:function(){return _()},toggle:function(){ke()}},et(),s.toolbarFactoryMap=s.toolbarFactoryMap||{},s.toolbarFactoryMap.accessibilitychecker=function(e){return s.createToolbarButton(e)},s.attachEvent("exec_command_accessibilitychecker",function(e){e.returnValue=!0,e.stopBubble=!0,ke()}),s.attachEvent("change",function(){tt()}),X(),_(),d.accessibilityCheckerAutoOpen&&de())};function Se(t,e){d[t]&&d[t].indexOf(e)===-1&&(d[t]=d[t]+e)}function et(){var t=d.container.ownerDocument;if(!t.getElementById("rte-accessibility-checker-style")){var e=t.createElement("style");e.id="rte-accessibility-checker-style",e.innerHTML=[".rte-a11y-shell{display:flex;align-items:stretch;gap:10px;}",".rte-a11y-shell>.rte-a11y-host{flex:1 1 auto;min-width:0;}","/* 2026-07-12 accessibility panel precision */",".rte-a11y-panel{display:none;flex:0 0 310px;min-width:270px;max-width:min(360px,32vw);border:1px solid rgba(148,163,184,.22);border-radius:8px;background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,251,255,.96));box-shadow:0 14px 32px rgba(29,78,216,.1),0 2px 8px rgba(15,23,42,.06);overflow:hidden;color:#172033;font-family:Aptos,'Segoe UI',sans-serif;}",".rte-a11y-shell.is-open>.rte-a11y-panel{display:flex;flex-direction:column;}",".rte-a11y-header{padding:12px 12px 9px 14px;border-bottom:1px solid rgba(148,163,184,.16);background:rgba(255,255,255,.72);}",".rte-a11y-kicker{font-size:10px;line-height:1.3;letter-spacing:.08em;text-transform:uppercase;color:#52657e;font-weight:850;}",".rte-a11y-title{margin-top:3px;font-size:15px;line-height:1.2;font-weight:850;color:#172033;}",".rte-a11y-copy{margin-top:5px;font-size:12px;line-height:1.42;color:#52657e;}",".rte-a11y-toolbar{display:flex;align-items:center;justify-content:space-between;padding:8px 10px 8px 14px;border-bottom:1px solid rgba(148,163,184,.16);gap:10px;background:rgba(255,255,255,.52);}",".rte-a11y-count{min-width:0;font-size:12px;font-weight:750;color:#52657e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}",".rte-a11y-actions{display:flex;align-items:center;gap:6px;}",".rte-a11y-link{appearance:none;border:1px solid rgba(100,116,139,.18);background:#fff;color:#315277;cursor:pointer;font-size:12px;font-weight:750;padding:6px 9px;border-radius:7px;line-height:1;}",".rte-a11y-link:hover,.rte-a11y-link:focus-visible{background:#eef4ff;color:#0f3f9f;border-color:rgba(37,99,235,.28);}",".rte-a11y-body{padding:6px;overflow:auto;min-height:160px;max-height:560px;display:flex;flex-direction:column;gap:8px;scrollbar-width:thin;}",".rte-a11y-list{display:flex;flex-direction:column;gap:6px;}",".rte-a11y-item{appearance:none;width:100%;text-align:left;border:1px solid rgba(148,163,184,.16);background:rgba(255,255,255,.84);cursor:pointer;border-radius:8px;padding:10px;box-shadow:0 6px 14px rgba(15,23,42,.04);transition:background 160ms ease,box-shadow 160ms ease,transform 160ms ease;}",".rte-a11y-item:hover,.rte-a11y-item:focus-visible{background:#f8fbff;border-color:rgba(37,99,235,.24);}",".rte-a11y-item.is-active{border-color:rgba(37,99,235,.36);background:#eef4ff;box-shadow:0 12px 28px rgba(37,99,235,.14);transform:translateY(-1px);}",".rte-a11y-item-top{display:flex;align-items:center;justify-content:space-between;gap:10px;}",".rte-a11y-badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 8px;font-size:10px;line-height:1;font-weight:850;letter-spacing:.08em;text-transform:uppercase;}",".rte-a11y-badge-warning{background:#fff8e8;color:#92400e;border:1px solid rgba(245,158,11,.18);}",".rte-a11y-badge-error{background:#fff1f2;color:#9f1239;border:1px solid rgba(159,18,57,.18);}",".rte-a11y-code{font-size:11px;color:#64748b;font-family:Consolas,'Cascadia Mono',monospace;}",".rte-a11y-message{margin-top:7px;font-size:13px;line-height:1.42;color:#172033;}",".rte-a11y-detail{border:1px solid rgba(148,163,184,.16);background:rgba(255,255,255,.86);border-radius:8px;padding:11px;display:flex;flex-direction:column;gap:9px;box-shadow:0 6px 14px rgba(15,23,42,.04);}",".rte-a11y-detail-title{font-size:13px;font-weight:850;color:#172033;}",".rte-a11y-detail-copy{font-size:12px;line-height:1.45;color:#52657e;}",".rte-a11y-field{display:flex;flex-direction:column;gap:6px;}",".rte-a11y-label{font-size:10px;line-height:1.3;letter-spacing:.08em;text-transform:uppercase;color:#52657e;font-weight:850;}",".rte-a11y-input{width:100%;border:1px solid rgba(148,163,184,.24);border-radius:7px;padding:9px 10px;font-size:13px;line-height:1.4;box-sizing:border-box;background:#fff;}",".rte-a11y-input:focus{outline:2px solid rgba(37,99,235,.18);border-color:rgba(37,99,235,.38);}",".rte-a11y-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}",".rte-a11y-button{appearance:none;border:1px solid #1d67ba;border-radius:7px;background:#1d67ba;color:#fff;padding:8px 12px;font-size:12px;font-weight:750;cursor:pointer;box-shadow:0 6px 14px rgba(29,103,186,.16);}",".rte-a11y-button-secondary{background:#fff;color:#315277;border-color:rgba(100,116,139,.18);box-shadow:none;}",".rte-a11y-button:hover,.rte-a11y-button:focus-visible{transform:translateY(-1px);}",".rte-a11y-empty{padding:14px;border-radius:8px;background:#fff;color:#52657e;font-size:13px;font-weight:700;line-height:1.55;border:1px dashed rgba(148,163,184,.34);}","@media (max-width: 1420px){.rte-a11y-shell{display:block;}.rte-a11y-panel{margin-top:12px;max-width:none;width:100%;}.rte-a11y-body{max-height:360px;}}"].join(""),t.head.appendChild(e),s&&typeof s.ensureStyleSheetLive=="function"&&s.ensureStyleSheetLive(t,e,"rte-accessibility-checker-style",e.textContent)}}function X(){if(A)return A;var t=d.container,e=t.ownerDocument;A=e.createElement("div"),A.className="rte-a11y-shell";var r=e.createElement("div");r.className="rte-a11y-host";var a=t.parentNode;a.insertBefore(A,t),A.appendChild(r),r.appendChild(t),D=e.createElement("aside"),D.className="rte-a11y-panel",D.setAttribute("aria-label",d.accessibilityCheckerTitle),D.setAttribute("role","complementary");var n=e.createElement("div");n.className="rte-a11y-header",n.innerHTML='<div class="rte-a11y-kicker">Accessibility</div><div class="rte-a11y-title"></div><div class="rte-a11y-copy"></div>',n.querySelector(".rte-a11y-title").innerText=d.accessibilityCheckerTitle,n.querySelector(".rte-a11y-copy").innerText=d.accessibilityCheckerHint;var i=e.createElement("div");i.className="rte-a11y-toolbar",i.innerHTML='<div class="rte-a11y-count" data-rte-a11y-count="1"></div><div class="rte-a11y-actions"><button type="button" class="rte-a11y-link" data-rte-a11y-refresh="1">Refresh</button><button type="button" class="rte-a11y-link" data-rte-a11y-close="1" aria-label="Hide accessibility checker">Hide</button></div>',i.querySelector("[data-rte-a11y-refresh]").onclick=function(){_()},i.querySelector("[data-rte-a11y-close]").onclick=function(){pe()};var o=e.createElement("div");return o.className="rte-a11y-body",H=e.createElement("div"),H.className="rte-a11y-list",R=e.createElement("div"),R.className="rte-a11y-empty",R.innerText=d.accessibilityCheckerEmptyText,u=e.createElement("div"),u.className="rte-a11y-detail",o.appendChild(H),o.appendChild(R),o.appendChild(u),D.appendChild(n),D.appendChild(i),D.appendChild(o),A.appendChild(D),A}function ke(){A&&A.classList.contains("is-open")?pe():de()}function de(){X(),A.classList.add("is-open"),he(),Ne()}function pe(){A&&(A.classList.remove("is-open"),Ne())}function Ne(){var t=function(){try{s&&typeof s.fireEvent=="function"&&s.fireEvent("resize")}catch{}try{s&&typeof s.updateLayout=="function"&&s.updateLayout()}catch{}try{var r=d.container.ownerDocument,a=r.defaultView||window;a.dispatchEvent(new a.Event("resize"))}catch{}};t();var e=typeof requestAnimationFrame=="function"?requestAnimationFrame:function(r){return setTimeout(r,16)};e(t)}function tt(){clearTimeout(Ae),Ae=setTimeout(function(){_()},120)}function _(){X();var t=window.RichTextEditor,e=s.getJSON?s.getJSON():null;return h=t&&typeof t.auditAccessibility=="function"?t.auditAccessibility(e):it(),h.issues.length?(v<0||v>=h.issues.length)&&(v=0):v=-1,he(),h}function O(t,e){if(!h||!h.issues||!h.issues[t])return _();var r=window.RichTextEditor,a=h.issues[t];if(a._target||h.source==="dom")return De(a,e||{});if(!r||typeof r.repairAccessibilityIssue!="function")return De(a,e||{});var n=r.repairAccessibilityIssue(s.getJSON(),h.issues[t],e||{});return s.setJSON(n),v=t,_()}function V(t){if(t){if(t._target&&typeof t._target.scrollIntoView=="function"){t._target.scrollIntoView({behavior:"smooth",block:"center"}),s.focus();return}var e=s.getEditable?s.getEditable():null;if(e){var r=/^content\[(\d+)\]/.exec(t.path||"");if(r){for(var a=parseInt(r[1],10),n=[],i=0;i<e.childNodes.length;i++)e.childNodes[i]&&e.childNodes[i].nodeType===1&&n.push(e.childNodes[i]);var o=n[a];o&&typeof o.scrollIntoView=="function"&&o.scrollIntoView({behavior:"smooth",block:"center"}),s.focus()}}}}var T=[{name:"Hebrew",lang:"he",re:/[֐-׿]/g},{name:"Arabic",lang:"ar",re:/[؀-ۿݐ-ݿﭐ-﷿ﹰ-]/g},{name:"Greek",lang:"el",re:/[Ͱ-Ͽἀ-῿]/g},{name:"Cyrillic",lang:"ru",re:/[Ѐ-ӿ]/g},{name:"Han",lang:"zh",re:/[㐀-䶿一-鿿]/g},{name:"Kana",lang:"ja",re:/[぀-ゟ゠-ヿ]/g},{name:"Hangul",lang:"ko",re:/[가-힯ᄀ-ᇿ]/g},{name:"Devanagari",lang:"hi",re:/[ऀ-ॿ]/g},{name:"Thai",lang:"th",re:/[฀-๿]/g},{name:"Latin",lang:"en",re:/[A-Za-zÀ-ɏ]/g}],Te=4;function rt(t){for(var e=[],r=0;r<T.length;r++){var a=String(t).match(T[r].re);a&&a.length>=Te&&e.push(T[r])}return e}function at(){var t=s.getEditable?s.getEditable():null,e=t&&t.getAttribute("lang")||typeof document<"u"&&document.documentElement.getAttribute("lang")||"en";e=String(e).toLowerCase().split("-")[0];for(var r=0;r<T.length;r++)if(T[r].lang===e)return T[r];return T[T.length-1]}function Ee(t,e){for(var r=t&&t.nodeType===3?t.parentNode:t;r&&r!==e&&r.nodeType===1;){if(r.hasAttribute&&r.hasAttribute("lang"))return!0;r=r.parentNode}return!1}function nt(t,e,r,a){var n=at(),i=t.ownerDocument;if(!(!i||!i.createTreeWalker))for(var o=i.createTreeWalker(t,4,null,!1),l,c={};l=o.nextNode();){var f=l.nodeValue||"";if(f.replace(/\s+/g,"")&&!Ee(l,e))for(var y=rt(f),b=0;b<y.length;b++){var p=y[b];p!==n&&(c[p.name]||(c[p.name]=!0,a.push({code:"language-of-parts",severity:"warning",message:p.name+" text is not marked with a language. Select the phrase and set its language so assistive technology pronounces it correctly (WCAG 3.1.2).",path:r+".lang",_target:t,_lang:p.lang,_script:p.name})))}}}function it(){var t=s.getEditable?s.getEditable():null,e=[];if(!t)return{document:null,issues:e,valid:!0,source:"dom"};for(var r=[],a=0;a<t.childNodes.length;a++){var n=t.childNodes[a];!n||n.nodeType!==1||r.push(n)}for(var i=0,o=0;o<r.length;o++){var l=r[o],c=String(l.nodeName||"").toLowerCase(),f="content["+o+"]";if(/^h[1-6]$/.test(c)){var y=parseInt(c.substring(1),10),b=I(l);b||e.push({code:"heading-empty",severity:"warning",message:"Heading is empty. Add a concise label or remove the heading.",path:f,_target:l}),i&&y>i+1&&e.push({code:"heading-level-skip",severity:"warning",message:"Heading jumps from H"+i+" to H"+y+". Use the next heading level for a clearer outline.",path:f+".attrs.level",_target:l}),b&&(i=y)}for(var p=c==="img"?[l]:l.querySelectorAll?l.querySelectorAll("img"):[],m=0;m<p.length;m++){var x=p[m];String(x.getAttribute("alt")||"").replace(/^\s+|\s+$/g,"")||e.push({code:"image-missing-alt",severity:"error",message:"Image is missing alt text. Describe the image or mark it decorative in your content workflow.",path:f+".image["+m+"]",_target:x})}for(var g=c==="a"?[l]:l.querySelectorAll?l.querySelectorAll("a"):[],S=0;S<g.length;S++){var k=g[S];!k.getAttribute||k.getAttribute("href")===null||ge(k)||e.push({code:"link-empty",severity:"error",message:'Link has no text, so it is announced only as "link". Add link text, an aria-label, or alt text on the image inside it.',path:f+".link["+S+"]",_target:k})}for(var E=c==="table"?[l]:l.querySelectorAll?l.querySelectorAll("table"):[],w=0;w<E.length;w++){var N=E[w],z=String(N.getAttribute("role")||"").toLowerCase(),C=z==="presentation"||z==="none";if(C){var U=N.querySelector("th, [scope], caption")||N.getAttribute("summary");U&&e.push({code:"layout-table-semantics",severity:"error",message:"Layout table still carries data-table markup (header cells, scope or a caption). A screen reader will announce relationships this table does not have.",path:f+".table["+w+"]",_target:N})}else if(!N.querySelector("th"))e.push({code:"table-missing-header",severity:"warning",message:"Table has no header cells. Promote the first row to headers, or mark it as a layout table when it only positions content.",path:f+".table["+w+"]",_target:N});else{for(var q=N.querySelectorAll("th"),$e=!1,ye=0;ye<q.length;ye++){var He=q[ye].parentNode;if(He&&He.rowIndex>0){$e=!0;break}}for(var ee=0;ee<q.length;ee++){var te=q[ee];if(!ge(te)){var ze=te.parentNode;$e&&ze&&ze.rowIndex===0&&te.cellIndex===0||e.push({code:"table-header-empty",severity:"error",message:"Header cell is empty, so the column or row it labels is announced with no name. Give it text, or make it a normal cell if it labels nothing.",path:f+".table["+w+"].th["+ee+"]",_target:te})}}}}for(var Fe=l.querySelectorAll?l.querySelectorAll("[style*='color']"):[],Be=l.getAttribute&&/(^|;)\s*color\s*:/i.test(l.getAttribute("style")||"")?[l].concat(Array.prototype.slice.call(Fe)):Array.prototype.slice.call(Fe),re=0;re<Be.length;re++){var J=Be[re],Oe=_e(J.style&&J.style.color);if(Oe){var je=st(J),Re=ct(Oe,je.rgb),Ve=ut(J),Pe=Ve?3:4.5;Re<Pe-.001&&e.push({code:"contrast-insufficient",severity:"error",message:"Text contrast is "+Re.toFixed(2)+":1 against "+(je.assumed?"an assumed white background":"its background")+", below the "+Pe+":1 needed for "+(Ve?"large text":"body text")+" (WCAG 1.4.3).",path:f+".contrast["+re+"]",_target:J})}}for(var Ue=c==="blockquote"?[l]:l.querySelectorAll?l.querySelectorAll("blockquote"):[],ae=0;ae<Ue.length;ae++){var Je=Ue[ae],W=Je.style;if(W){var gt=/^\s*[\d.]+\s*[a-z%]+\s*$/i.test(W.marginLeft||"")&&parseFloat(W.marginLeft)>0,ht=/^(none|0|0px)$/i.test(String(W.borderStyle||W.border||"").trim());gt&&ht&&e.push({code:"blockquote-as-indent",severity:"warning",message:"This looks like indentation, not a quotation: a <blockquote> with a left margin and no quote styling. Screen readers announce it as a quotation. Use the indent button instead.",path:f+".blockquote["+ae+"]",_target:Je})}}for(var yt=/^(click here|here|read more|more|link|this|this link|learn more|details|go)$/i,We=c==="a"?[l]:l.querySelectorAll?l.querySelectorAll("a"):[],ne=0;ne<We.length;ne++){var ie=We[ne];if(!(!ie.getAttribute||ie.getAttribute("href")===null)){var ve=ge(ie);ve&&yt.test(ve.replace(/[\s.,!:;]+$/g,"").replace(/^\s+/,""))&&e.push({code:"link-ambiguous-text",severity:"warning",message:'Link text "'+ve+'" does not say where it goes. Out of context a screen reader announces only this text.',path:f+".link["+ne+"]",_target:ie})}}nt(l,t,f,e)}if(t&&t.querySelectorAll)for(var me=t.querySelectorAll("[id]"),Ge={},G=0;G<me.length;G++){var oe=me[G].getAttribute("id");oe&&(Ge[oe]&&e.push({code:"duplicate-id",severity:"error",message:'id "'+oe+'" is used more than once. Any aria-labelledby, aria-describedby or label pointing at it resolves to only the first element.',path:"document.id["+G+"]",_target:me[G]}),Ge[oe]=!0)}if(t&&t.querySelectorAll){for(var Ye=t.querySelectorAll("p"),le=0;le<Ye.length;le++){var F=Ye[le],Y=I(F);if(!(!Y||Y.length>80||/[.!?:;,]$/.test(Y))){var be=F.ownerDocument.defaultView,xe=F.querySelector("strong, b"),vt=be.getComputedStyle(F),mt=xe&&I(xe)===Y||parseInt(vt.fontWeight,10)>=600;if(mt){var bt=xe||F,xt=parseFloat(be.getComputedStyle(F.ownerDocument.body).fontSize)||16;parseFloat(be.getComputedStyle(bt).fontSize)<xt*1.2||e.push({code:"paragraph-as-heading",severity:"warning",message:'"'+Y+'" looks like a heading (bold, large, on its own line) but is a paragraph. Screen-reader users cannot jump to it. Use a heading level instead.',path:"document.p["+le+"]",_target:F})}}}for(var Ke=function(Ce){if(!Ce||String(Ce.nodeName).toLowerCase()!=="p")return null;var Ie=I(Ce);return/^\d{1,3}[.)]\s+\S/.test(Ie)?"ol":/^[-*•▪●]\s+\S/.test(Ie)?"ul":null},K=t.children,L=0;L<K.length;L++){var we=Ke(K[L]);if(we){for(var j=1;L+j<K.length&&Ke(K[L+j])===we;)j++;j>=2&&e.push({code:"fake-list",severity:"warning",message:j+" paragraphs are typed as a "+(we==="ol"?"numbered":"bulleted")+" list. Screen readers do not announce them as a list or say how many items it has. Use the list button instead.",path:"content["+L+"]",_target:K[L]}),L+=j-1}}for(var Z=t.querySelectorAll("img[alt]"),M=0;M<Z.length;M++){var B=(Z[M].getAttribute("alt")||"").trim();if(B){var Ze=((Z[M].getAttribute("src")||"").split(/[?#]/)[0].split("/").pop()||"").toLowerCase();/\.(jpe?g|png|gif|webp|bmp|svg|avif|tiff?)$/i.test(B)||Ze&&B.toLowerCase()===Ze||/^(img|image|dsc|photo|screenshot)[-_ ]?\d+/i.test(B)?e.push({code:"image-alt-filename",severity:"error",message:'Alt text "'+B+'" is a file name, which describes nothing. Say what the image shows.',path:"document.img["+M+"]",_target:Z[M]}):B.length>150&&e.push({code:"image-alt-too-long",severity:"warning",message:"Alt text is "+B.length+" characters. Keep it to a short description; put longer detail in the text or a caption.",path:"document.img["+M+"]",_target:Z[M]})}}for(var g=t.querySelectorAll("a[href]"),Q=1;Q<g.length;Q++){var Qe=g[Q-1],se=g[Q];if(Qe.getAttribute("href")===se.getAttribute("href")){for(var $=Qe.nextSibling,Xe=!0;$&&$!==se;){if($.nodeType===1||$.nodeType===3&&/\S/.test($.data)){Xe=!1;break}$=$.nextSibling}Xe&&$===se&&e.push({code:"link-adjacent-duplicate",severity:"warning",message:"Two links next to each other go to the same place, so it is announced twice. Combine them into one link.",path:"document.link["+Q+"]",_target:se})}}for(var E=t.querySelectorAll("table"),ce=0;ce<E.length;ce++){var ue=E[ce];(ue.getAttribute("role")||"").toLowerCase()!=="presentation"&&(!ue.querySelector("th")||ue.querySelector("caption")||e.push({code:"table-missing-caption",severity:"warning",message:"Data table has no caption. A short caption lets screen-reader users know what the table is before they enter it.",path:"document.table["+ce+"]",_target:ue}))}}return{document:null,issues:e,valid:!e.length,source:"dom"}}function De(t,e){if(!t||!t._target)return _();var r=t._target;if(t.code==="image-missing-alt")r.setAttribute("alt",String(e.altText||"").replace(/^\s+|\s+$/g,""));else if(t.code==="heading-empty")r.textContent=String(e.headingText||"").replace(/^\s+|\s+$/g,"");else if(t.code==="heading-level-skip"){for(var a=Math.max(1,Math.min(6,parseInt(e.targetLevel,10)||2)),n=r.ownerDocument.createElement("h"+a);r.firstChild;)n.appendChild(r.firstChild);P(r,n),r.parentNode.replaceChild(n,r)}else if(t.code==="table-missing-header")e&&e.markLayout?Le(r):lt(r);else if(t.code==="layout-table-semantics")Le(r);else if(t.code==="table-header-empty"){var i=String(e&&e.headerText||"").replace(/^\s+|\s+$/g,"");if(i)r.textContent=i;else if(e&&e.demoteToCell){for(var o=r.ownerDocument.createElement("td");r.firstChild;)o.appendChild(r.firstChild);P(r,o),o.removeAttribute("scope"),r.parentNode.replaceChild(o,r)}}else if(t.code==="link-empty"){var l=String(e&&e.linkText||"").replace(/^\s+|\s+$/g,"");if(l)r.textContent=l;else{var c=String(e&&e.linkLabel||"").replace(/^\s+|\s+$/g,"");c&&r.setAttribute("aria-label",c)}}else if(t.code==="language-of-parts")ot(r,e&&e.lang?e.lang:t._lang,t._script);else if(t.code==="paragraph-as-heading"){var f=Math.max(1,Math.min(6,parseInt(e&&e.targetLevel,10)||2)),y=r.ownerDocument.createElement("h"+f);y.textContent=(r.textContent||"").replace(/^\s+|\s+$/g,""),P(r,y),y.removeAttribute("style"),r.parentNode.replaceChild(y,r)}else if(t.code==="fake-list"){for(var b=r.ownerDocument,p=r.parentNode,m=/^\d/.test((r.textContent||"").replace(/^\s+/,"")),x=b.createElement(m?"ol":"ul"),g=r;g&&g.nodeName==="P";){var S=(g.textContent||"").replace(/^\s+/,""),k=m?/^\d{1,3}[.)]\s+([\s\S]*)$/.exec(S):/^[-*•▪●]\s+([\s\S]*)$/.exec(S);if(!k)break;var E=b.createElement("li");E.textContent=k[1].replace(/\s+$/,""),x.appendChild(E);var w=g.nextElementSibling;g.parentNode.removeChild(g),g=w}g&&g.parentNode===p?p.insertBefore(x,g):p.appendChild(x)}else if(t.code==="table-missing-caption"){var N=String(e&&e.captionText||"").replace(/^\s+|\s+$/g,"");if(N){var z=r.ownerDocument.createElement("caption");z.textContent=N,r.insertBefore(z,r.firstChild)}}else if(t.code==="link-adjacent-duplicate"){for(var C=r.previousSibling;C&&C.nodeType!==1;)C=C.previousSibling;if(C&&C.nodeName==="A"){for(;r.firstChild;)C.appendChild(r.firstChild);r.parentNode.removeChild(r)}}else(t.code==="image-alt-filename"||t.code==="image-alt-too-long")&&r.setAttribute("alt",String(e&&e.altText||"").replace(/^\s+|\s+$/g,""));return v=0,ft(),_()}function ot(t,e,r){if(!(!t||!e)){for(var a=null,n=0;n<T.length;n++)T[n].name===r&&(a=T[n]);if(a){for(var i=t.ownerDocument,o=s.getEditable?s.getEditable():null,l=e==="he"||e==="ar"||e==="fa"||e==="ur",c=i.createTreeWalker(t,4,null,!1),f=[],y;y=c.nextNode();)Ee(y,o)||f.push(y);for(var b=0;b<f.length;b++){for(var p=f[b],m=p.nodeValue||"",x=new RegExp("(?:"+a.re.source+`|[\\s.,;:!?'"()\\u2010-\\u2027\\u00AB\\u00BB\\u201C\\u201D])*`+a.re.source+"(?:"+a.re.source+`|[\\s.,;:!?'"()\\u2010-\\u2027\\u00AB\\u00BB\\u201C\\u201D])*`,"g"),g=i.createDocumentFragment(),S=0,k,E=!1;k=x.exec(m);){var w=k[0],N=w.length-w.replace(/^[\s.,;:!?'"()‐-‧«»“”]+/,"").length,z=w.length-w.replace(/[\s.,;:!?'"()‐-‧«»“”]+$/,"").length,C=k.index+N,U=k.index+w.length-z;if(!(U-C<Te)){C>S&&g.appendChild(i.createTextNode(m.slice(S,C)));var q=i.createElement("span");q.setAttribute("lang",e),l&&q.setAttribute("dir","rtl"),q.appendChild(i.createTextNode(m.slice(C,U))),g.appendChild(q),S=U,E=!0,x.lastIndex===k.index&&x.lastIndex++}}E&&(S<m.length&&g.appendChild(i.createTextNode(m.slice(S))),p.parentNode.replaceChild(g,p))}}}}function lt(t){var e=t&&t.rows&&t.rows.length?t.rows[0]:null;if(e)for(var r=t.ownerDocument,a=0;a<e.cells.length;a++){var n=e.cells[a];if(!(!n||String(n.nodeName||"").toLowerCase()==="th")){for(var i=r.createElement("th");n.firstChild;)i.appendChild(n.firstChild);P(n,i),i.setAttribute("scope","col"),e.replaceChild(i,n)}}}function _e(t){if(!t)return null;var e=String(t).trim(),r=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e);if(r){var a=r[1];return a.length===3&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),[parseInt(a.slice(0,2),16),parseInt(a.slice(2,4),16),parseInt(a.slice(4,6),16)]}var n=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);return n?[Math.round(+n[1]),Math.round(+n[2]),Math.round(+n[3])]:null}function st(t){for(var e=t;e&&e.style;){var r=_e(e.style.backgroundColor);if(r)return{rgb:r,assumed:!1};e=e.parentElement}return{rgb:[255,255,255],assumed:!0}}function qe(t){var e=[t[0],t[1],t[2]].map(function(r){return r=r/255,r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)});return .2126*e[0]+.7152*e[1]+.0722*e[2]}function ct(t,e){var r=qe(t),a=qe(e),n=Math.max(r,a),i=Math.min(r,a);return(n+.05)/(i+.05)}function ut(t){var e=t.style||{},r=String(e.fontSize||""),a=null,n=/^([\d.]+)(px|pt)$/i.exec(r.trim());if(n&&(a=n[2].toLowerCase()==="pt"?parseFloat(n[1]):parseFloat(n[1])*.75),a===null){var i=(t.tagName||"").toLowerCase();return!!/^h[1-3]$/.test(i)}var o=/bold|^[6-9]00$/.test(String(e.fontWeight||""));return a>=18||a>=14&&o}function ge(t){if(!t)return"";var e=function(c){return String(c||"").replace(/^\s+|\s+$/g,"")},r=e(t.getAttribute&&t.getAttribute("aria-label"));if(r)return r;var a=e(t.textContent);if(a)return a;var n=e(t.getAttribute&&t.getAttribute("title"));if(n)return n;if(t.querySelectorAll)for(var i=t.querySelectorAll("img"),o=0;o<i.length;o++){var l=e(i[o].getAttribute("alt"));if(l)return l}return""}function Le(t){if(t){if(s&&typeof s.setTableLayoutMode=="function")try{s.setTableLayoutMode("layout",t);return}catch{}t.setAttribute("role","presentation"),t.removeAttribute("summary");var e=t.querySelector("caption");e&&e.parentNode===t&&e.parentNode.removeChild(e);for(var r=t.querySelectorAll("th,[scope]"),a=0;a<r.length;a++){var n=r[a];if(!(n.closest&&n.closest("table")!==t)&&(n.removeAttribute("scope"),n.removeAttribute("headers"),String(n.nodeName||"").toLowerCase()==="th")){for(var i=t.ownerDocument.createElement("td");n.firstChild;)i.appendChild(n.firstChild);P(n,i),i.removeAttribute("scope"),n.parentNode.replaceChild(i,n)}}}}function P(t,e){if(!(!t||!e||!t.attributes))for(var r=0;r<t.attributes.length;r++){var a=t.attributes[r];!a||!a.name||e.setAttribute(a.name,a.value)}}function ft(){try{s&&typeof s.fireEvent=="function"&&s.fireEvent("change")}catch{}try{s&&typeof s.fireEvent=="function"&&s.fireEvent("contentchange")}catch{}}function I(t){return String(t&&(t.innerText||t.textContent)||"").replace(/\s+/g," ").replace(/^\s+|\s+$/g,"")}function he(){X();for(var t=h&&h.issues?h.issues:[];H.firstChild;)H.removeChild(H.firstChild);var e=D.querySelector("[data-rte-a11y-count]");e&&(e.innerText=t.length?t.length+" issue"+(t.length===1?"":"s")+" to review":"Ready to publish"),R.style.display=t.length?"none":"block";for(var r=0;r<t.length;r++)(function(a,n){var i=D.ownerDocument.createElement("button");i.type="button",i.className="rte-a11y-item"+(n===v?" is-active":""),i.setAttribute("aria-selected",n===v?"true":"false"),i.innerHTML='<div class="rte-a11y-item-top"><span class="rte-a11y-badge rte-a11y-badge-'+a.severity+'">'+a.severity+'</span><span class="rte-a11y-code">'+a.code+'</span></div><div class="rte-a11y-message"></div>',i.querySelector(".rte-a11y-message").innerText=a.message,i.onclick=function(){v=n,V(a),he()},H.appendChild(i)})(t[r],r);dt()}function dt(){for(;u.firstChild;)u.removeChild(u.firstChild);var t=h&&h.issues?h.issues:[];if(!t.length||v<0||!t[v]){u.innerHTML='<div class="rte-a11y-detail-title">No fixes pending</div><div class="rte-a11y-detail-copy">Run the checker again after major content changes to keep headings, image descriptions, and tables in shape.</div>';return}var e=t[v],r=u.ownerDocument.createElement("div");r.className="rte-a11y-detail-title",r.innerText=e.code;var a=u.ownerDocument.createElement("div");if(a.className="rte-a11y-detail-copy",a.innerText=e.message,u.appendChild(r),u.appendChild(a),e.code==="image-missing-alt"){Me("Alt text","Describe the image for screen-reader users.",function(x){O(v,{altText:x})});return}if(e.code==="heading-empty"){Me("Heading text","Add a concise heading label before publishing.",function(x){O(v,{headingText:x})});return}if(e.code==="heading-level-skip"){var n=pt(e),i=u.ownerDocument.createElement("div");i.className="rte-a11y-row";var o=u.ownerDocument.createElement("button");o.type="button",o.className="rte-a11y-button",o.innerText="Normalize to H"+n,o.onclick=function(){O(v,{targetLevel:n})};var l=u.ownerDocument.createElement("button");l.type="button",l.className="rte-a11y-button rte-a11y-button-secondary",l.innerText="Focus issue",l.onclick=function(){V(e)},i.appendChild(o),i.appendChild(l),u.appendChild(i);return}if(e.code==="table-missing-header"){var c=u.ownerDocument.createElement("div");c.className="rte-a11y-row";var f=u.ownerDocument.createElement("button");f.type="button",f.className="rte-a11y-button",f.innerText="Promote first row to headers",f.onclick=function(){O(v,{})};var y=u.ownerDocument.createElement("button");y.type="button",y.className="rte-a11y-button rte-a11y-button-secondary",y.innerText="Focus issue",y.onclick=function(){V(e)},c.appendChild(f),c.appendChild(y),u.appendChild(c);return}if(e.code==="language-of-parts"){var b=u.ownerDocument.createElement("div");b.className="rte-a11y-row";var p=u.ownerDocument.createElement("button");p.type="button",p.className="rte-a11y-button",p.innerText="Mark as "+e._script,p.onclick=function(){O(v,{lang:e._lang})};var m=u.ownerDocument.createElement("button");m.type="button",m.className="rte-a11y-button rte-a11y-button-secondary",m.innerText="Focus issue",m.onclick=function(){V(e)},b.appendChild(p),b.appendChild(m),u.appendChild(b);return}u.innerHTML+='<div class="rte-a11y-detail-copy">This issue is visible here, but does not have an automatic repair action yet.</div>'}function Me(t,e,r){var a=u.ownerDocument.createElement("div");a.className="rte-a11y-field";var n=u.ownerDocument.createElement("div");n.className="rte-a11y-label",n.innerText=t;var i=u.ownerDocument.createElement("input");i.type="text",i.className="rte-a11y-input",i.placeholder=e;var o=u.ownerDocument.createElement("div");o.className="rte-a11y-row";var l=u.ownerDocument.createElement("button");l.type="button",l.className="rte-a11y-button",l.innerText="Apply fix",l.onclick=function(){var f=String(i.value||"").replace(/^\s+|\s+$/g,"");f&&r(f)};var c=u.ownerDocument.createElement("button");c.type="button",c.className="rte-a11y-button rte-a11y-button-secondary",c.innerText="Focus issue",c.onclick=function(){var f=h&&h.issues?h.issues:[];f[v]&&V(f[v])},o.appendChild(l),o.appendChild(c),a.appendChild(n),a.appendChild(i),u.appendChild(a),u.appendChild(o)}function pt(t){var e=(t&&t.path?t.path:"").replace(/\.attrs\.level$/,""),r=s.getJSON?s.getJSON():null;if(!r||!r.content)return 2;var a=0;function n(o,l){if(!o||typeof o.type!="string")return!1;if(l===e)return!0;if(o.type==="heading"&&o.attrs&&typeof o.attrs.level=="number"&&(a=o.attrs.level),!o.content||!o.content.length)return!1;for(var c=0;c<o.content.length;c++)if(n(o.content[c],l+".content["+c+"]"))return!0;return!1}for(var i=0;i<r.content.length&&!n(r.content[i],"content["+i+"]");i++);return Math.max(1,Math.min(6,(a||1)+(a?1:0)))}}