@richscripts/richtexteditor 2.14.1 → 2.16.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 (244) hide show
  1. package/README.md +182 -10
  2. package/angular/build-manifest.json +23 -0
  3. package/angular/index.d.ts +71 -76
  4. package/angular/index.mjs +2 -0
  5. package/angular/package.json +4 -0
  6. package/headless/index.d.ts +3 -1
  7. package/headless/index.js +72 -16
  8. package/index.d.ts +40 -52
  9. package/integrations/initialization-scope.js +27 -0
  10. package/integrations/native-mount.js +30 -0
  11. package/integrations/shared.d.ts +23 -1
  12. package/integrations/shared.js +68 -22
  13. package/package.json +25 -3
  14. package/react/index.js +118 -37
  15. package/react/index.mjs +29 -0
  16. package/richtexteditor/all_plugins.js +8816 -2373
  17. package/richtexteditor/all_plugins.min.js +77 -59
  18. package/richtexteditor/lang/emoji/LICENSE-CLDR.txt +41 -0
  19. package/richtexteditor/lang/emoji/rte-emoji-de.js +3 -0
  20. package/richtexteditor/lang/emoji/rte-emoji-es.js +3 -0
  21. package/richtexteditor/lang/emoji/rte-emoji-fr.js +3 -0
  22. package/richtexteditor/lang/emoji/rte-emoji-it.js +3 -0
  23. package/richtexteditor/lang/emoji/rte-emoji-ja.js +3 -0
  24. package/richtexteditor/lang/emoji/rte-emoji-ko.js +3 -0
  25. package/richtexteditor/lang/emoji/rte-emoji-nl.js +3 -0
  26. package/richtexteditor/lang/emoji/rte-emoji-pt-pt.js +3 -0
  27. package/richtexteditor/lang/emoji/rte-emoji-pt.js +3 -0
  28. package/richtexteditor/lang/emoji/rte-emoji-ru.js +3 -0
  29. package/richtexteditor/lang/emoji/rte-emoji-zh-Hans.js +3 -0
  30. package/richtexteditor/lang/emoji/rte-emoji-zh-Hant.js +3 -0
  31. package/richtexteditor/lang/rte-lang-af.js +1 -0
  32. package/richtexteditor/lang/rte-lang-ar.js +1 -0
  33. package/richtexteditor/lang/rte-lang-bg.js +1 -0
  34. package/richtexteditor/lang/rte-lang-bn.js +1 -0
  35. package/richtexteditor/lang/rte-lang-bs.js +1 -0
  36. package/richtexteditor/lang/rte-lang-ca.js +1 -0
  37. package/richtexteditor/lang/rte-lang-cs.js +1 -0
  38. package/richtexteditor/lang/rte-lang-cy.js +1 -0
  39. package/richtexteditor/lang/rte-lang-da.js +1 -0
  40. package/richtexteditor/lang/rte-lang-de.js +1050 -2
  41. package/richtexteditor/lang/rte-lang-el.js +1 -0
  42. package/richtexteditor/lang/rte-lang-en.js +1 -0
  43. package/richtexteditor/lang/rte-lang-es.js +1056 -2
  44. package/richtexteditor/lang/rte-lang-et.js +1 -0
  45. package/richtexteditor/lang/rte-lang-fa.js +1 -0
  46. package/richtexteditor/lang/rte-lang-fi.js +1 -0
  47. package/richtexteditor/lang/rte-lang-fil.js +1 -0
  48. package/richtexteditor/lang/rte-lang-fj.js +1 -0
  49. package/richtexteditor/lang/rte-lang-fr.js +1056 -2
  50. package/richtexteditor/lang/rte-lang-ga.js +1 -0
  51. package/richtexteditor/lang/rte-lang-gu.js +1 -0
  52. package/richtexteditor/lang/rte-lang-he.js +1 -0
  53. package/richtexteditor/lang/rte-lang-hi.js +1 -0
  54. package/richtexteditor/lang/rte-lang-hr.js +1 -0
  55. package/richtexteditor/lang/rte-lang-ht.js +1 -0
  56. package/richtexteditor/lang/rte-lang-hu.js +1 -0
  57. package/richtexteditor/lang/rte-lang-id.js +1 -0
  58. package/richtexteditor/lang/rte-lang-is.js +1 -0
  59. package/richtexteditor/lang/rte-lang-it.js +1056 -2
  60. package/richtexteditor/lang/rte-lang-ja.js +1056 -2
  61. package/richtexteditor/lang/rte-lang-kn.js +1 -0
  62. package/richtexteditor/lang/rte-lang-ko.js +1056 -2
  63. package/richtexteditor/lang/rte-lang-lt.js +1 -0
  64. package/richtexteditor/lang/rte-lang-lv.js +1 -0
  65. package/richtexteditor/lang/rte-lang-mg.js +1 -0
  66. package/richtexteditor/lang/rte-lang-mi.js +1 -0
  67. package/richtexteditor/lang/rte-lang-ml.js +1 -0
  68. package/richtexteditor/lang/rte-lang-mr.js +1 -0
  69. package/richtexteditor/lang/rte-lang-ms.js +1 -0
  70. package/richtexteditor/lang/rte-lang-mt.js +1 -0
  71. package/richtexteditor/lang/rte-lang-mww.js +1 -0
  72. package/richtexteditor/lang/rte-lang-nb.js +1 -0
  73. package/richtexteditor/lang/rte-lang-nl.js +1056 -2
  74. package/richtexteditor/lang/rte-lang-otq.js +1 -0
  75. package/richtexteditor/lang/rte-lang-pa.js +1 -0
  76. package/richtexteditor/lang/rte-lang-pl.js +1 -0
  77. package/richtexteditor/lang/rte-lang-pt-pt.js +1056 -2
  78. package/richtexteditor/lang/rte-lang-pt.js +1056 -2
  79. package/richtexteditor/lang/rte-lang-ro.js +1 -0
  80. package/richtexteditor/lang/rte-lang-ru.js +1056 -2
  81. package/richtexteditor/lang/rte-lang-sk.js +1 -0
  82. package/richtexteditor/lang/rte-lang-sl.js +1 -0
  83. package/richtexteditor/lang/rte-lang-sm.js +1 -0
  84. package/richtexteditor/lang/rte-lang-sr-Cyrl.js +1 -0
  85. package/richtexteditor/lang/rte-lang-sr-Latn.js +1 -0
  86. package/richtexteditor/lang/rte-lang-sv.js +1 -0
  87. package/richtexteditor/lang/rte-lang-sw.js +1 -0
  88. package/richtexteditor/lang/rte-lang-ta.js +1 -0
  89. package/richtexteditor/lang/rte-lang-te.js +1 -0
  90. package/richtexteditor/lang/rte-lang-th.js +1 -0
  91. package/richtexteditor/lang/rte-lang-tlh-Latn.js +1 -0
  92. package/richtexteditor/lang/rte-lang-tlh-Piqd.js +1 -0
  93. package/richtexteditor/lang/rte-lang-to.js +1 -0
  94. package/richtexteditor/lang/rte-lang-tr.js +1 -0
  95. package/richtexteditor/lang/rte-lang-ty.js +1 -0
  96. package/richtexteditor/lang/rte-lang-uk.js +1 -0
  97. package/richtexteditor/lang/rte-lang-ur.js +1 -0
  98. package/richtexteditor/lang/rte-lang-vi.js +1 -0
  99. package/richtexteditor/lang/rte-lang-yua.js +1 -0
  100. package/richtexteditor/lang/rte-lang-zh-Hans.js +1050 -2
  101. package/richtexteditor/lang/rte-lang-zh-Hant.js +1050 -2
  102. package/richtexteditor/plugins/a11yenhance.js +4 -1
  103. package/richtexteditor/plugins/a11yenhance.min.js +1 -1
  104. package/richtexteditor/plugins/accessibilitychecker.js +256 -64
  105. package/richtexteditor/plugins/accessibilitychecker.min.js +1 -1
  106. package/richtexteditor/plugins/aitoolkit.js +1057 -386
  107. package/richtexteditor/plugins/aitoolkit.min.js +7 -7
  108. package/richtexteditor/plugins/all_plugins.js +8816 -2373
  109. package/richtexteditor/plugins/all_plugins.min.js +77 -59
  110. package/richtexteditor/plugins/autocorrect.js +66 -31
  111. package/richtexteditor/plugins/autocorrect.min.js +1 -1
  112. package/richtexteditor/plugins/autoembed.js +18 -1
  113. package/richtexteditor/plugins/autoembed.min.js +1 -1
  114. package/richtexteditor/plugins/blocktypes.js +18 -9
  115. package/richtexteditor/plugins/blocktypes.min.js +1 -1
  116. package/richtexteditor/plugins/bookmarkcard.js +12 -5
  117. package/richtexteditor/plugins/bookmarkcard.min.js +2 -2
  118. package/richtexteditor/plugins/changecase.js +72 -19
  119. package/richtexteditor/plugins/changecase.min.js +1 -1
  120. package/richtexteditor/plugins/charlimit.js +62 -2
  121. package/richtexteditor/plugins/charlimit.min.js +2 -2
  122. package/richtexteditor/plugins/comments.js +460 -61
  123. package/richtexteditor/plugins/comments.min.js +4 -3
  124. package/richtexteditor/plugins/contentminimap.js +28 -9
  125. package/richtexteditor/plugins/contentminimap.min.js +1 -1
  126. package/richtexteditor/plugins/crdt-engine.js +27 -1
  127. package/richtexteditor/plugins/crossreference.js +1 -1
  128. package/richtexteditor/plugins/crossreference.min.js +1 -1
  129. package/richtexteditor/plugins/dialoga11y.js +26 -4
  130. package/richtexteditor/plugins/dialoga11y.min.js +1 -1
  131. package/richtexteditor/plugins/dictation.js +1 -1
  132. package/richtexteditor/plugins/documentimport.js +250 -59
  133. package/richtexteditor/plugins/documentimport.min.js +4 -4
  134. package/richtexteditor/plugins/documentoutline.js +47 -8
  135. package/richtexteditor/plugins/documentoutline.min.js +1 -1
  136. package/richtexteditor/plugins/docxexport.js +233 -32
  137. package/richtexteditor/plugins/docxexport.min.js +2 -2
  138. package/richtexteditor/plugins/draghandle.js +267 -3
  139. package/richtexteditor/plugins/draghandle.min.js +1 -1
  140. package/richtexteditor/plugins/emailtoolkit.js +28 -14
  141. package/richtexteditor/plugins/emailtoolkit.min.js +1 -1
  142. package/richtexteditor/plugins/emojiautocomplete.js +111 -57
  143. package/richtexteditor/plugins/emojiautocomplete.min.js +1 -1
  144. package/richtexteditor/plugins/footnotes.js +65 -11
  145. package/richtexteditor/plugins/footnotes.min.js +1 -1
  146. package/richtexteditor/plugins/formatpainter.js +10 -0
  147. package/richtexteditor/plugins/formatpainter.min.js +1 -1
  148. package/richtexteditor/plugins/formattingmarks.js +6 -6
  149. package/richtexteditor/plugins/formattingmarks.min.js +1 -1
  150. package/richtexteditor/plugins/gapcursor.js +60 -0
  151. package/richtexteditor/plugins/gapcursor.min.js +1 -1
  152. package/richtexteditor/plugins/ghostcomplete.js +1 -1
  153. package/richtexteditor/plugins/html2pdf.js +8 -8
  154. package/richtexteditor/plugins/html2pdf.min.js +1 -1
  155. package/richtexteditor/plugins/imageeditor.js +31 -12
  156. package/richtexteditor/plugins/imageeditor.min.js +1 -1
  157. package/richtexteditor/plugins/importstyles.js +1 -1
  158. package/richtexteditor/plugins/inlinecode.js +25 -0
  159. package/richtexteditor/plugins/inlinecode.min.js +1 -1
  160. package/richtexteditor/plugins/insertcode.js +29 -11
  161. package/richtexteditor/plugins/insertcode.min.js +6 -6
  162. package/richtexteditor/plugins/insertemoji.js +113 -16
  163. package/richtexteditor/plugins/insertemoji.min.js +1 -1
  164. package/richtexteditor/plugins/insertgallery.js +46 -40
  165. package/richtexteditor/plugins/insertgallery.min.js +1 -1
  166. package/richtexteditor/plugins/inserttemplate.js +43 -19
  167. package/richtexteditor/plugins/inserttemplate.min.js +1 -1
  168. package/richtexteditor/plugins/keyboarda11y.js +66 -3
  169. package/richtexteditor/plugins/keyboarda11y.min.js +1 -1
  170. package/richtexteditor/plugins/layouttable.js +20 -0
  171. package/richtexteditor/plugins/layouttable.min.js +1 -1
  172. package/richtexteditor/plugins/linkchecker.js +29 -9
  173. package/richtexteditor/plugins/linkchecker.min.js +1 -1
  174. package/richtexteditor/plugins/localdraft.js +51 -7
  175. package/richtexteditor/plugins/localdraft.min.js +1 -1
  176. package/richtexteditor/plugins/markdownexport.js +159 -0
  177. package/richtexteditor/plugins/markdownexport.min.js +2 -2
  178. package/richtexteditor/plugins/mathdialog.js +11 -5
  179. package/richtexteditor/plugins/mathdialog.min.js +1 -1
  180. package/richtexteditor/plugins/mentionplugin.js +90 -27
  181. package/richtexteditor/plugins/mentionplugin.min.js +1 -1
  182. package/richtexteditor/plugins/mermaiddiagram.js +14 -8
  183. package/richtexteditor/plugins/mermaiddiagram.min.js +2 -2
  184. package/richtexteditor/plugins/multilevellist.js +4 -0
  185. package/richtexteditor/plugins/multilevellist.min.js +1 -1
  186. package/richtexteditor/plugins/nodetypes.js +1 -1
  187. package/richtexteditor/plugins/nodetypes.min.js +1 -1
  188. package/richtexteditor/plugins/pagination.js +2 -2
  189. package/richtexteditor/plugins/pagination.min.js +1 -1
  190. package/richtexteditor/plugins/pdfexport.js +1752 -1167
  191. package/richtexteditor/plugins/pdfexport.min.js +28 -13
  192. package/richtexteditor/plugins/permanentpen.js +3 -3
  193. package/richtexteditor/plugins/permanentpen.min.js +1 -1
  194. package/richtexteditor/plugins/readabilitystats.js +25 -11
  195. package/richtexteditor/plugins/readabilitystats.min.js +1 -1
  196. package/richtexteditor/plugins/readaloud.js +30 -16
  197. package/richtexteditor/plugins/readaloud.min.js +1 -1
  198. package/richtexteditor/plugins/restrictedediting.js +166 -0
  199. package/richtexteditor/plugins/restrictedediting.min.js +2 -2
  200. package/richtexteditor/plugins/revisionhistory.js +173 -41
  201. package/richtexteditor/plugins/revisionhistory.min.js +3 -3
  202. package/richtexteditor/plugins/rubyannotation.js +21 -11
  203. package/richtexteditor/plugins/rubyannotation.min.js +1 -1
  204. package/richtexteditor/plugins/sanitizer.js +119 -7
  205. package/richtexteditor/plugins/sanitizer.min.js +1 -1
  206. package/richtexteditor/plugins/slashcommand.js +32 -18
  207. package/richtexteditor/plugins/slashcommand.min.js +2 -2
  208. package/richtexteditor/plugins/smartchips.js +39 -25
  209. package/richtexteditor/plugins/smartchips.min.js +2 -2
  210. package/richtexteditor/plugins/spellcheck.js +20 -11
  211. package/richtexteditor/plugins/spellcheck.min.js +2 -2
  212. package/richtexteditor/plugins/stateinspector.js +21 -11
  213. package/richtexteditor/plugins/stateinspector.min.js +2 -2
  214. package/richtexteditor/plugins/structured-content-bridge.js +90 -32
  215. package/richtexteditor/plugins/structured-content-bridge.min.js +8 -8
  216. package/richtexteditor/plugins/tableofcontents.js +5 -2
  217. package/richtexteditor/plugins/tableofcontents.min.js +1 -1
  218. package/richtexteditor/plugins/tabletools.js +388 -3
  219. package/richtexteditor/plugins/tabletools.min.js +1 -1
  220. package/richtexteditor/plugins/textdirection.js +19 -6
  221. package/richtexteditor/plugins/textdirection.min.js +1 -1
  222. package/richtexteditor/plugins/textpartlanguage.js +161 -32
  223. package/richtexteditor/plugins/textpartlanguage.min.js +1 -1
  224. package/richtexteditor/plugins/todolist.js +90 -6
  225. package/richtexteditor/plugins/todolist.min.js +1 -1
  226. package/richtexteditor/plugins/trackedchanges.js +1812 -25
  227. package/richtexteditor/plugins/trackedchanges.min.js +5 -3
  228. package/richtexteditor/plugins/wordexport.js +2 -2
  229. package/richtexteditor/plugins/yjscollab.js +11 -6
  230. package/richtexteditor/plugins/yjscollab.min.js +1 -1
  231. package/richtexteditor/plugins/zz_richtextbox_dialog_style.js +22 -13
  232. package/richtexteditor/plugins/zz_richtextbox_dialog_style.min.js +1 -1
  233. package/richtexteditor/rte-config.js +144 -86
  234. package/richtexteditor/rte-headless.js +19 -4
  235. package/richtexteditor/rte-watchdog.js +3 -1
  236. package/richtexteditor/rte-webcomponent.js +91 -16
  237. package/richtexteditor/rte.js +146 -88
  238. package/richtexteditor/runtime/colorpicker_more_ns.htm +3 -1
  239. package/scripts/build-angular.mjs +97 -0
  240. package/svelte/index.d.ts +2 -1
  241. package/svelte/index.js +80 -9
  242. package/vue/index.js +130 -34
  243. package/angular/component.ts +0 -297
  244. package/angular/index.ts +0 -24
@@ -1,2 +1,2 @@
1
- window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_smartchips=RTE_Plugin_SmartChips,RTE_DefaultConfig.chipResolver=RTE_DefaultConfig.chipResolver||null,RTE_DefaultConfig.chipDateFormat=RTE_DefaultConfig.chipDateFormat||null;function RTE_Plugin_SmartChips(){var g=this,b,o;g.PluginName="SmartChips",g.InitConfig=function(e){b=e},g.InitEditor=function(e){o=e,o.attachEvent("exec_command_insertdatechip",function(t){t.returnValue=!0,g.OpenDateChip()}),o.attachEvent("exec_command_insertchip",function(t){t.returnValue=!0,g.OpenChipMenu()}),_()};function a(e,t,i,n){var s=e.ownerDocument.createElement(t);return i&&(s.style.cssText=i),n&&(s.className=n),e.appendChild(s),s}function k(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function y(e){if(b.chipDateFormat&&typeof b.chipDateFormat=="function")try{return String(b.chipDateFormat(e))}catch{}return M[e.getMonth()]+" "+e.getDate()+", "+e.getFullYear()}function R(e){function t(i){return(i<10?"0":"")+i}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())}var A={date:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><rect x="2" y="3" width="12" height="11" rx="1.5"/><path d="M2 6.5h12"/><path d="M5 1.5v3"/><path d="M11 1.5v3"/></svg>',person:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><circle cx="8" cy="5" r="2.6"/><path d="M3 13.5c0-2.5 2.2-4 5-4s5 1.5 5 4"/></svg>',link:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M6.5 9.5a3 3 0 004.2 0l2-2a3 3 0 10-4.2-4.2L7.4 4.3"/><path d="M9.5 6.5a3 3 0 00-4.2 0l-2 2a3 3 0 104.2 4.2l1-1"/></svg>'};function I(e,t,i,n){var s=A[e]||"",l='class="rte-chip rte-chip-'+k(e)+'" data-rte-chip="'+k(e)+'" data-rte-chip-value="'+k(i||t)+'" contenteditable="false"',u='<span class="rte-chip-icon">'+s+'</span><span class="rte-chip-label">'+k(t)+"</span>";if(e==="link"&&n){var d=/^(javascript|data|vbscript):/i.test(n)?"#":n;return"<a "+l+' href="'+k(d)+'" target="_blank" rel="noopener noreferrer">'+u+"</a>"}return"<span "+l+">"+u+"</span>"}function x(e,t,i,n){_(),o.insertHTML(I(e,t,i,n)+"\u200B"),o.focus()}g.OpenDateChip=function(){var e=o.createDialog(o.getLangText&&o.getLangText("insertdatechiptitle")||"Date","rte-dialog-datechip"),t=typeof e.close=="function"?function(){e.close()}:function(){o.closeCurrentPopup()},i=a(e,"div","","rte-chip-dialog rte-chip-date-dialog");a(i,"div","","rte-chip-dialog-copy").textContent="Choose a quick date or insert a custom date chip.";function n(h,v){var r=a(i,"button","","rte-chip-quick");return r.type="button",r.textContent=h+" \u2014 "+y(v),r.onmouseover=function(){r.style.background="#eef2ff"},r.onmouseout=function(){r.style.background="transparent"},r.textContent="",a(r,"span","","rte-chip-quick-label").textContent=h,a(r,"span","","rte-chip-quick-value").textContent=y(v),r.onmouseover=null,r.onmouseout=null,r.setAttribute("aria-label","Insert "+h+", "+y(v)),r.onclick=function(){t(),x("date",y(v),R(v))},r}var s=new Date(o.__chipNow||Date.now());function l(h,v){var r=new Date(h.getTime());return r.setDate(r.getDate()+v),r}n("Today",s),n("Tomorrow",l(s,1)),n("Yesterday",l(s,-1)),n("Next week",l(s,7));var u=a(i,"div","","rte-chip-pick-row"),d=a(u,"input","","rte-chip-input");d.type="date",d.value=R(s),d.setAttribute("aria-label","Custom date");var C=a(u,"button","","rte-chip-action rte-chip-action-primary");C.type="button",C.textContent="Insert",C.onclick=function(){var h=(d.value||"").split("-");if(h.length===3){var v=new Date(parseInt(h[0],10),parseInt(h[1],10)-1,parseInt(h[2],10));t(),x("date",y(v),d.value)}else t()},setTimeout(function(){d.focus()},0)},g.OpenChipMenu=function(){var e=o.createDialog(o.getLangText&&o.getLangText("insertchiptitle")||"Insert chip","rte-dialog-chip"),t=typeof e.close=="function"?function(){e.close()}:function(){o.closeCurrentPopup()},i=a(e,"div","","rte-chip-dialog rte-chip-menu-dialog");a(i,"div","","rte-chip-dialog-copy").textContent="Insert a date, person, or link chip into the document.";var n=a(i,"div","","rte-chip-type-tabs");n.setAttribute("role","tablist"),n.setAttribute("aria-label","Chip type");var s=[["date","Date"],["person","Person"],["link","Link"]],l="date",u=a(i,"div","","rte-chip-dialog-body"),d={};s.forEach(function(r){var p=a(n,"button","","rte-chip-type-tab");p.type="button",p.textContent=r[1],p.setAttribute("role","tab"),p.setAttribute("aria-selected",r[0]===l?"true":"false"),d[r[0]]=p,p.onclick=function(){l=r[0],C(),h()}});function C(){s.forEach(function(r){var p=r[0]===l;d[r[0]].classList.toggle("is-selected",p),d[r[0]].setAttribute("aria-selected",p?"true":"false")})}function h(){if(u.innerHTML="",l==="date"){var r=a(u,"div","","rte-chip-field-label");r.textContent="Insert a date chip:";var p=a(u,"input","","rte-chip-input");p.type="date",p.value=R(new Date(o.__chipNow||Date.now())),p.setAttribute("aria-label","Date chip value"),v(function(){var c=(p.value||"").split("-");if(c.length===3){var T=new Date(+c[0],+c[1]-1,+c[2]);t(),x("date",y(T),p.value)}})}else{var D=a(u,"div","","rte-chip-field-label");D.textContent=l==="person"?"Name (or search):":"URL:";var f=a(u,"input","","rte-chip-input");f.type=l==="link"?"url":"text",f.placeholder=l==="person"?"Jane Doe":"https://example.com",f.setAttribute("aria-label",l==="person"?"Person chip name":"Link chip URL");var w=a(u,"div","","rte-chip-results");w.setAttribute("role","listbox"),w.setAttribute("aria-label","Chip suggestions"),b.chipResolver&&typeof b.chipResolver=="function"&&(f.oninput=function(){var c=f.value.trim();if(w.innerHTML="",!!c)try{var T=b.chipResolver(c,l);T&&T.then&&T.then(function(L){w.innerHTML="",(L||[]).slice(0,6).forEach(function(m){var E=a(w,"button","","rte-chip-suggestion");E.type="button",E.textContent=m.label||m.value,E.setAttribute("role","option"),E.onclick=function(){t(),x(l,m.label||m.value,m.value||m.label,m.href)}})})}catch{}}),v(function(){var c=f.value.trim();if(!c){t();return}if(l==="link"){if(/^(javascript|data|vbscript|file):/i.test(c)){f.style.borderColor="#dc2626",f.placeholder="Enter a valid http(s) URL",f.value="";return}if(!/^https?:\/\//i.test(c))if(/^[a-z0-9.-]+\.[a-z]{2,}([\/?#].*)?$/i.test(c))c="https://"+c;else{f.style.borderColor="#dc2626",f.placeholder="Enter a valid http(s) URL",f.value="";return}t(),x("link",c.replace(/^https?:\/\//i,"").replace(/\/$/,""),c,c)}else t(),x("person",c,c)}),setTimeout(function(){f.focus()},0)}}function v(r){var p=a(u,"div","","rte-chip-dialog-footer"),D=a(p,"button","","rte-chip-action rte-chip-action-primary");D.type="button",D.textContent="Insert",D.onclick=r}C(),h()};function _(){var e=[".rte-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px 2px 6px;margin:0 1px;border:1px solid rgba(100,116,139,.16);border-radius:999px;background:linear-gradient(180deg,#f8fbff,#eef4ff);color:#315277;font-size:.92em;line-height:1.45;white-space:nowrap;text-decoration:none;vertical-align:baseline;cursor:default;user-select:none;box-shadow:0 1px 2px rgba(15,23,42,.06)}",".rte-chip-icon{display:inline-flex;align-items:center;opacity:.9}",".rte-chip-date{background:linear-gradient(180deg,#f0fdff,#e6f8fb);color:#0e7490;border-color:rgba(14,116,144,.18)}",".rte-chip-person{background:linear-gradient(180deg,#f6f7ff,#eef2ff);color:#3730a3;border-color:rgba(55,48,163,.18)}",".rte-chip-link{background:linear-gradient(180deg,#f5fff8,#ecfdf4);color:#15803d;border-color:rgba(21,128,61,.18);cursor:pointer}",".rte-chip-link:hover{text-decoration:underline}"].join(`
2
- `);try{var t=o.getDocument();if(!t)return;var i=t.head||t.getElementsByTagName&&t.getElementsByTagName("head")[0]||t.documentElement;if(i&&!t.querySelector("style[data-rte-smartchips]")){var n=t.createElement("style");n.setAttribute("data-rte-smartchips","1"),n.textContent=e,i.appendChild(n),o&&typeof o.ensureStyleSheetLive=="function"&&o.ensureStyleSheetLive(t,n,"rte-smartchips-st",n.textContent)}}catch{}}}
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_smartchips=RTE_Plugin_SmartChips,RTE_DefaultConfig.chipResolver=RTE_DefaultConfig.chipResolver||null,RTE_DefaultConfig.chipDateFormat=RTE_DefaultConfig.chipDateFormat||null;function RTE_Plugin_SmartChips(){var m=this,b,c;m.PluginName="SmartChips",m.InitConfig=function(e){b=e};function i(e,t){for(var a=b&&b["text_"+e]||t,n=2;n<arguments.length;n++)a=a.split("{"+(n-2)+"}").join(String(arguments[n]));return a}m.InitEditor=function(e){c=e,c.attachEvent("exec_command_insertdatechip",function(t){t.returnValue=!0,m.OpenDateChip()}),c.attachEvent("exec_command_insertchip",function(t){t.returnValue=!0,m.OpenChipMenu()}),L()};function o(e,t,a,n){var s=e.ownerDocument.createElement(t);return a&&(s.style.cssText=a),n&&(s.className=n),e.appendChild(s),s}function k(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _(e){if(b.chipDateFormat&&typeof b.chipDateFormat=="function")try{return String(b.chipDateFormat(e))}catch{}var t=b&&b.text_uilocale;if(t&&!/^en(-|$)/i.test(t)&&typeof Intl<"u"&&Intl.DateTimeFormat)try{return new Intl.DateTimeFormat(t,{year:"numeric",month:"short",day:"numeric"}).format(e)}catch{}return I[e.getMonth()]+" "+e.getDate()+", "+e.getFullYear()}function R(e){function t(a){return(a<10?"0":"")+a}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())}var A={date:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><rect x="2" y="3" width="12" height="11" rx="1.5"/><path d="M2 6.5h12"/><path d="M5 1.5v3"/><path d="M11 1.5v3"/></svg>',person:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><circle cx="8" cy="5" r="2.6"/><path d="M3 13.5c0-2.5 2.2-4 5-4s5 1.5 5 4"/></svg>',link:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M6.5 9.5a3 3 0 004.2 0l2-2a3 3 0 10-4.2-4.2L7.4 4.3"/><path d="M9.5 6.5a3 3 0 00-4.2 0l-2 2a3 3 0 104.2 4.2l1-1"/></svg>'};function S(e,t,a,n){var s=A[e]||"",p='class="rte-chip rte-chip-'+k(e)+'" data-rte-chip="'+k(e)+'" data-rte-chip-value="'+k(a||t)+'" contenteditable="false"',h='<span class="rte-chip-icon">'+s+'</span><span class="rte-chip-label">'+k(t)+"</span>";if(e==="link"&&n){var v=/^(javascript|data|vbscript):/i.test(n)?"#":n;return"<a "+p+' href="'+k(v)+'" target="_blank" rel="noopener noreferrer">'+h+"</a>"}return"<span "+p+">"+h+"</span>"}function x(e,t,a,n){L(),c.insertHTML(S(e,t,a,n)+"\u200B"),c.focus()}m.OpenDateChip=function(){var e=c.createDialog(c.getLangText&&c.getLangText("insertdatechiptitle")||"Date","rte-dialog-datechip"),t=typeof e.close=="function"?function(){e.close()}:function(){c.closeCurrentPopup()},a=o(e,"div","","rte-chip-dialog rte-chip-date-dialog");o(a,"div","","rte-chip-dialog-copy").textContent=i("ch_datecopy","Choose a quick date or insert a custom date chip.");function n(f,g){var r=o(a,"button","","rte-chip-quick");return r.type="button",r.textContent=f+" \u2014 "+_(g),r.onmouseover=function(){r.style.background="#eef2ff"},r.onmouseout=function(){r.style.background="transparent"},r.textContent="",o(r,"span","","rte-chip-quick-label").textContent=f,o(r,"span","","rte-chip-quick-value").textContent=_(g),r.onmouseover=null,r.onmouseout=null,r.setAttribute("aria-label",i("ch_insertlabel","Insert {0}, {1}",f,_(g))),r.onclick=function(){t(),x("date",_(g),R(g))},r}var s=new Date(c.__chipNow||Date.now());function p(f,g){var r=new Date(f.getTime());return r.setDate(r.getDate()+g),r}n(i("ch_today","Today"),s),n(i("ch_tomorrow","Tomorrow"),p(s,1)),n(i("ch_yesterday","Yesterday"),p(s,-1)),n(i("ch_nextweek","Next week"),p(s,7));var h=o(a,"div","","rte-chip-pick-row"),v=o(h,"input","","rte-chip-input");v.type="date",v.value=R(s),v.setAttribute("aria-label",i("ch_customdate","Custom date"));var C=o(h,"button","","rte-chip-action rte-chip-action-primary");C.type="button",C.textContent=i("insert","Insert"),C.onclick=function(){var f=(v.value||"").split("-");if(f.length===3){var g=new Date(parseInt(f[0],10),parseInt(f[1],10)-1,parseInt(f[2],10));t(),x("date",_(g),v.value)}else t()},setTimeout(function(){v.focus()},0)},m.OpenChipMenu=function(){var e=c.createDialog(c.getLangText&&c.getLangText("insertchiptitle")||"Insert chip","rte-dialog-chip"),t=typeof e.close=="function"?function(){e.close()}:function(){c.closeCurrentPopup()},a=o(e,"div","","rte-chip-dialog rte-chip-menu-dialog");o(a,"div","","rte-chip-dialog-copy").textContent=i("ch_chipcopy","Insert a date, person, or link chip into the document.");var n=o(a,"div","","rte-chip-type-tabs");n.setAttribute("role","tablist"),n.setAttribute("aria-label",i("ch_chiptype","Chip type"));var s=[["date",i("ch_date","Date")],["person",i("ch_person","Person")],["link",i("link","Link")]],p="date",h=o(a,"div","","rte-chip-dialog-body"),v={};s.forEach(function(r){var u=o(n,"button","","rte-chip-type-tab");u.type="button",u.textContent=r[1],u.setAttribute("role","tab"),u.setAttribute("aria-selected",r[0]===p?"true":"false"),v[r[0]]=u,u.onclick=function(){p=r[0],C(),f()}});function C(){s.forEach(function(r){var u=r[0]===p;v[r[0]].classList.toggle("is-selected",u),v[r[0]].setAttribute("aria-selected",u?"true":"false")})}function f(){if(h.innerHTML=__RTE_TT(""),p==="date"){var r=o(h,"div","","rte-chip-field-label");r.textContent=i("ch_insertdate","Insert a date chip:");var u=o(h,"input","","rte-chip-input");u.type="date",u.value=R(new Date(c.__chipNow||Date.now())),u.setAttribute("aria-label",i("ch_datevalue","Date chip value")),g(function(){var l=(u.value||"").split("-");if(l.length===3){var T=new Date(+l[0],+l[1]-1,+l[2]);t(),x("date",_(T),u.value)}})}else{var D=o(h,"div","","rte-chip-field-label");D.textContent=p==="person"?i("ch_name","Name (or search):"):i("ch_url","URL:");var d=o(h,"input","","rte-chip-input");d.type=p==="link"?"url":"text",d.placeholder=p==="person"?i("ch_nameph","Jane Doe"):"https://example.com",d.setAttribute("aria-label",p==="person"?i("ch_personname","Person chip name"):i("ch_linkurl","Link chip URL"));var w=o(h,"div","","rte-chip-results");w.setAttribute("role","listbox"),w.setAttribute("aria-label",i("ch_suggestions","Chip suggestions")),b.chipResolver&&typeof b.chipResolver=="function"&&(d.oninput=function(){var l=d.value.trim();if(w.innerHTML=__RTE_TT(""),!!l)try{var T=b.chipResolver(l,p);T&&T.then&&T.then(function(M){w.innerHTML=__RTE_TT(""),(M||[]).slice(0,6).forEach(function(y){var E=o(w,"button","","rte-chip-suggestion");E.type="button",E.textContent=y.label||y.value,E.setAttribute("role","option"),E.onclick=function(){t(),x(p,y.label||y.value,y.value||y.label,y.href)}})})}catch{}}),g(function(){var l=d.value.trim();if(!l){t();return}if(p==="link"){if(/^(javascript|data|vbscript|file):/i.test(l)){d.style.borderColor="#dc2626",d.placeholder=i("ch_invalidurl","Enter a valid http(s) URL"),d.value="";return}if(!/^https?:\/\//i.test(l))if(/^[a-z0-9.-]+\.[a-z]{2,}([\/?#].*)?$/i.test(l))l="https://"+l;else{d.style.borderColor="#dc2626",d.placeholder=i("ch_invalidurl","Enter a valid http(s) URL"),d.value="";return}t(),x("link",l.replace(/^https?:\/\//i,"").replace(/\/$/,""),l,l)}else t(),x("person",l,l)}),setTimeout(function(){d.focus()},0)}}function g(r){var u=o(h,"div","","rte-chip-dialog-footer"),D=o(u,"button","","rte-chip-action rte-chip-action-primary");D.type="button",D.textContent=i("insert","Insert"),D.onclick=r}C(),f()};function L(){var e=[".rte-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px 2px 6px;margin:0 1px;border:1px solid rgba(100,116,139,.16);border-radius:999px;background:linear-gradient(180deg,#f8fbff,#eef4ff);color:#315277;font-size:.92em;line-height:1.45;white-space:nowrap;text-decoration:none;vertical-align:baseline;cursor:default;user-select:none;box-shadow:0 1px 2px rgba(15,23,42,.06)}",".rte-chip-icon{display:inline-flex;align-items:center;opacity:.9}",".rte-chip-date{background:linear-gradient(180deg,#f0fdff,#e6f8fb);color:#0e7490;border-color:rgba(14,116,144,.18)}",".rte-chip-person{background:linear-gradient(180deg,#f6f7ff,#eef2ff);color:#3730a3;border-color:rgba(55,48,163,.18)}",".rte-chip-link{background:linear-gradient(180deg,#f5fff8,#ecfdf4);color:#15803d;border-color:rgba(21,128,61,.18);cursor:pointer}",".rte-chip-link:hover{text-decoration:underline}"].join(`
2
+ `);try{var t=c.getDocument();if(!t)return;var a=t.head||t.getElementsByTagName&&t.getElementsByTagName("head")[0]||t.documentElement;if(a&&!t.querySelector("style[data-rte-smartchips]")){var n=t.createElement("style");n.setAttribute("data-rte-smartchips","1"),n.textContent=e,a.appendChild(n),c&&typeof c.ensureStyleSheetLive=="function"&&c.ensureStyleSheetLive(t,n,"rte-smartchips-st",n.textContent)}}catch{}}}
@@ -26,6 +26,13 @@ function RTE_Plugin_SpellCheck() {
26
26
  obj.PluginName = "SpellCheck";
27
27
 
28
28
  obj.InitConfig = function (argconfig) { config = argconfig; };
29
+ // 2026-10-18 the words read config.text_ keys (language packs), English as the fallback; {0} / {1} fill a template.
30
+ // tools/i18n/plugin-bars-language.mjs
31
+ function pText(key, fallback) {
32
+ var s = (config && config["text_" + key]) || fallback;
33
+ for (var i = 2; i < arguments.length; i++) s = s.split("{" + (i - 2) + "}").join(String(arguments[i]));
34
+ return s;
35
+ }
29
36
 
30
37
  obj.InitEditor = function (argeditor) {
31
38
  editor = argeditor;
@@ -59,7 +66,9 @@ function RTE_Plugin_SpellCheck() {
59
66
  try { if (!editor.InvokeEventHook || !editor.InvokeEventHook("customdialog", "spellcheck", msg)) { /* fall through to toast */ } } catch (e) { }
60
67
  try {
61
68
  var editable = editor.getEditable();
62
- var host = editable.ownerDocument;
69
+ // 2026-10-14 The toast is a message for the person, so it goes to the host page (where its stylesheet is),
70
+ // never into the editable's own body, where it would be saved with the content. tools/spellcheck/spellcheck-toast.mjs
71
+ var host = (editor && editor.iframe && editor.iframe.ownerDocument) || editable.ownerDocument;
63
72
  var t = host.createElement("div");
64
73
  t.className = "rte-spell-toast";
65
74
  t.setAttribute("role", "status");
@@ -100,13 +109,13 @@ function RTE_Plugin_SpellCheck() {
100
109
  editable.setAttribute("spellcheck", "true");
101
110
  editable.focus();
102
111
  } catch (e) { }
103
- notify((editor.getLangText && editor.getLangText("spellchecknative")) || "Browser spell-check is on — misspellings are underlined as you type.");
112
+ notify((editor.getLangText && editor.getLangText("spellchecknative")) || "Browser spell-check is on \u2014 misspellings are underlined as you type.");
104
113
  return;
105
114
  }
106
115
 
107
116
  var text;
108
117
  try { text = editor.getEditable().innerText || ""; } catch (e) { text = ""; }
109
- if (!text.trim()) { notify("Nothing to check."); return; }
118
+ if (!text.trim()) { notify(pText("sp_nothing", "Nothing to check.")); return; }
110
119
 
111
120
  var dlg = editor.createDialog(
112
121
  (editor.getLangText && editor.getLangText("spellchecktitle")) || "Spelling",
@@ -115,11 +124,11 @@ function RTE_Plugin_SpellCheck() {
115
124
  var close = typeof dlg.close === "function" ? function () { dlg.close(); } : function () { editor.closeCurrentPopup(); };
116
125
  var wrap = append(dlg, "div", "box-sizing:border-box;width:min(420px,calc(100vw - 32px));max-height:60vh;overflow:auto;padding:14px;font:13px -apple-system,Segoe UI,sans-serif");
117
126
  var status = append(wrap, "div", "color:#64748b;margin-bottom:8px");
118
- status.innerText = "Checking…";
127
+ status.innerText = pText("sp_checking", "Checking\u2026");
119
128
  var list = append(wrap, "div", "");
120
129
 
121
130
  function renderIssues(issues) {
122
- list.innerHTML = "";
131
+ list.innerHTML = __RTE_TT("");
123
132
  if (!issues || !issues.length) {
124
133
  status.innerText = (editor.getLangText && editor.getLangText("spellcheckclean")) || "No spelling issues found.";
125
134
  return;
@@ -142,8 +151,8 @@ function RTE_Plugin_SpellCheck() {
142
151
  chip.onclick = function () {
143
152
  if (replaceFirst(iss.word, s)) {
144
153
  row.style.opacity = "0.45";
145
- head.innerHTML = esc(iss.word) + ' &rarr; <span style="color:#16a34a">' + esc(s) + "</span>";
146
- sug.innerHTML = "";
154
+ head.innerHTML = __RTE_TT(esc(iss.word) + ' &rarr; <span style="color:#16a34a">' + esc(s) + "</span>");
155
+ sug.innerHTML = __RTE_TT("");
147
156
  }
148
157
  };
149
158
  });
@@ -155,14 +164,14 @@ function RTE_Plugin_SpellCheck() {
155
164
  try {
156
165
  var p = config.spellCheckResolver(text);
157
166
  if (p && typeof p.then === "function") {
158
- p.then(function (r) { finish(r || []); }, function () { status.innerText = "Spell-check service error."; });
159
- setTimeout(function () { if (!done) { status.innerText = "Spell-check timed out."; done = true; } }, 12000);
167
+ p.then(function (r) { finish(r || []); }, function () { status.innerText = pText("sp_serviceerror", "Spell-check service error."); });
168
+ setTimeout(function () { if (!done) { status.innerText = pText("sp_timeout", "Spell-check timed out."); done = true; } }, 12000);
160
169
  } else { finish(p || []); }
161
- } catch (e) { status.innerText = "Spell-check error."; }
170
+ } catch (e) { status.innerText = pText("sp_error", "Spell-check error."); }
162
171
 
163
172
  var footer = append(wrap, "div", "display:flex;justify-content:flex-end;margin-top:12px");
164
173
  var closeBtn = append(footer, "button", "padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");
165
- closeBtn.type = "button"; closeBtn.textContent = "Done"; closeBtn.onclick = function () { close(); editor.focus(); };
174
+ closeBtn.type = "button"; closeBtn.textContent = pText("sp_done", "Done"); closeBtn.onclick = function () { close(); editor.focus(); };
166
175
  };
167
176
 
168
177
  function injectStyles() {
@@ -1,2 +1,2 @@
1
- window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_spellcheck=RTE_Plugin_SpellCheck,RTE_DefaultConfig.spellCheckResolver=RTE_DefaultConfig.spellCheckResolver||null,typeof RTE_DefaultConfig.spellCheckEnabled>"u"&&(RTE_DefaultConfig.spellCheckEnabled=!0);function RTE_Plugin_SpellCheck(){var u=this,s,e;u.PluginName="SpellCheck",u.InitConfig=function(t){s=t},u.InitEditor=function(t){e=t;try{var r=e.getEditable&&e.getEditable();r&&r.setAttribute("spellcheck",s.spellCheckEnabled===!1?"false":"true")}catch{}e.attachEvent("exec_command_spellcheck",function(n){n.returnValue=!0,u.RunSpellCheck()}),R()};function c(t,r,n,o){var i=t.ownerDocument.createElement(r);return n&&(i.style.cssText=n),o&&(i.className=o),t.appendChild(i),i}function C(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function E(t){try{!e.InvokeEventHook||e.InvokeEventHook("customdialog","spellcheck",t)}catch{}try{var r=e.getEditable(),n=r.ownerDocument,o=n.createElement("div");o.className="rte-spell-toast",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.textContent=t,n.body.appendChild(o),setTimeout(function(){o.parentNode&&o.parentNode.removeChild(o)},2600)}catch{}}function S(t,r){try{for(var n=e.getEditable(),o=e.getDocument(),i=o.createTreeWalker(n,NodeFilter.SHOW_TEXT,null),l,g=new RegExp("\\b"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b");l=i.nextNode();){var d=l.parentNode;if(!(d&&(d.nodeName==="CODE"||d.nodeName==="PRE"))){var p=l.data.search(g);if(p>=0)return l.data=l.data.substring(0,p)+r+l.data.substring(p+t.length),!0}}}catch{}return!1}u.RunSpellCheck=function(){if(!s.spellCheckResolver||typeof s.spellCheckResolver!="function"){try{var t=e.getEditable();t.setAttribute("spellcheck","true"),t.focus()}catch{}E(e.getLangText&&e.getLangText("spellchecknative")||"Browser spell-check is on \u2014 misspellings are underlined as you type.");return}var r;try{r=e.getEditable().innerText||""}catch{r=""}if(!r.trim()){E("Nothing to check.");return}var n=e.createDialog(e.getLangText&&e.getLangText("spellchecktitle")||"Spelling","rte-dialog-spell"),o=typeof n.close=="function"?function(){n.close()}:function(){e.closeCurrentPopup()},i=c(n,"div","box-sizing:border-box;width:min(420px,calc(100vw - 32px));max-height:60vh;overflow:auto;padding:14px;font:13px -apple-system,Segoe UI,sans-serif"),l=c(i,"div","color:#64748b;margin-bottom:8px");l.innerText="Checking\u2026";var g=c(i,"div","");function d(a){if(g.innerHTML="",!a||!a.length){l.innerText=e.getLangText&&e.getLangText("spellcheckclean")||"No spelling issues found.";return}l.innerText=a.length+" issue"+(a.length===1?"":"s")+" found.",a.forEach(function(f){if(!(!f||!f.word)){var b=c(g,"div","padding:8px 0;border-bottom:1px solid rgba(15,23,42,.08)","rte-spell-row"),T=c(b,"div","font-weight:600;color:#b91c1c;margin-bottom:4px");T.textContent=f.word;var k=c(b,"div","display:flex;flex-wrap:wrap;gap:6px"),w=(f.suggestions||[]).slice(0,6);w.length||(c(k,"span","font-size:12px;color:#94a3b8").textContent="(no suggestions)"),w.forEach(function(m){var y=c(k,"button","font-size:12px;padding:4px 9px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fbff;color:#315277;cursor:pointer");y.type="button",y.textContent=m,y.onclick=function(){S(f.word,m)&&(b.style.opacity="0.45",T.innerHTML=C(f.word)+' &rarr; <span style="color:#16a34a">'+C(m)+"</span>",k.innerHTML="")}})}})}var p=!1;function x(a){p||(p=!0,d(a))}try{var h=s.spellCheckResolver(r);h&&typeof h.then=="function"?(h.then(function(a){x(a||[])},function(){l.innerText="Spell-check service error."}),setTimeout(function(){p||(l.innerText="Spell-check timed out.",p=!0)},12e3)):x(h||[])}catch{l.innerText="Spell-check error."}var D=c(i,"div","display:flex;justify-content:flex-end;margin-top:12px"),v=c(D,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");v.type="button",v.textContent="Done",v.onclick=function(){o(),e.focus()}};function R(){var t=["/* 2026-07-12 spell-check feedback precision */",".rte-spell-toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);max-width:calc(100vw - 32px);padding:9px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#172033;font:600 13px/1.35 -apple-system,Segoe UI,sans-serif;z-index:2147483600;box-shadow:0 10px 24px rgba(15,23,42,.14)}",".rte-spell-row:last-child{border-bottom:0}"].join(`
2
- `);try{var r=e&&e.iframe&&e.iframe.ownerDocument||document;if(!r.querySelector("style[data-rte-spellcheck]")){var n=r.createElement("style");n.setAttribute("data-rte-spellcheck","1"),n.textContent=t,(r.head||r.documentElement).appendChild(n),e&&typeof e.ensureStyleSheetLive=="function"&&e.ensureStyleSheetLive(r,n,"rte-spellcheck-st",n.textContent)}}catch{}}}
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_spellcheck=RTE_Plugin_SpellCheck,RTE_DefaultConfig.spellCheckResolver=RTE_DefaultConfig.spellCheckResolver||null,typeof RTE_DefaultConfig.spellCheckEnabled>"u"&&(RTE_DefaultConfig.spellCheckEnabled=!0);function RTE_Plugin_SpellCheck(){var d=this,s,e;d.PluginName="SpellCheck",d.InitConfig=function(n){s=n};function u(n,r){for(var t=s&&s["text_"+n]||r,o=2;o<arguments.length;o++)t=t.split("{"+(o-2)+"}").join(String(arguments[o]));return t}d.InitEditor=function(n){e=n;try{var r=e.getEditable&&e.getEditable();r&&r.setAttribute("spellcheck",s.spellCheckEnabled===!1?"false":"true")}catch{}e.attachEvent("exec_command_spellcheck",function(t){t.returnValue=!0,d.RunSpellCheck()}),S()};function c(n,r,t,o){var i=n.ownerDocument.createElement(r);return t&&(i.style.cssText=t),o&&(i.className=o),n.appendChild(i),i}function C(n){return String(n??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function E(n){try{!e.InvokeEventHook||e.InvokeEventHook("customdialog","spellcheck",n)}catch{}try{var r=e.getEditable(),t=e&&e.iframe&&e.iframe.ownerDocument||r.ownerDocument,o=t.createElement("div");o.className="rte-spell-toast",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.textContent=n,t.body.appendChild(o),setTimeout(function(){o.parentNode&&o.parentNode.removeChild(o)},2600)}catch{}}function R(n,r){try{for(var t=e.getEditable(),o=e.getDocument(),i=o.createTreeWalker(t,NodeFilter.SHOW_TEXT,null),l,h=new RegExp("\\b"+n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b");l=i.nextNode();){var g=l.parentNode;if(!(g&&(g.nodeName==="CODE"||g.nodeName==="PRE"))){var p=l.data.search(h);if(p>=0)return l.data=l.data.substring(0,p)+r+l.data.substring(p+n.length),!0}}}catch{}return!1}d.RunSpellCheck=function(){if(!s.spellCheckResolver||typeof s.spellCheckResolver!="function"){try{var n=e.getEditable();n.setAttribute("spellcheck","true"),n.focus()}catch{}E(e.getLangText&&e.getLangText("spellchecknative")||"Browser spell-check is on \u2014 misspellings are underlined as you type.");return}var r;try{r=e.getEditable().innerText||""}catch{r=""}if(!r.trim()){E(u("sp_nothing","Nothing to check."));return}var t=e.createDialog(e.getLangText&&e.getLangText("spellchecktitle")||"Spelling","rte-dialog-spell"),o=typeof t.close=="function"?function(){t.close()}:function(){e.closeCurrentPopup()},i=c(t,"div","box-sizing:border-box;width:min(420px,calc(100vw - 32px));max-height:60vh;overflow:auto;padding:14px;font:13px -apple-system,Segoe UI,sans-serif"),l=c(i,"div","color:#64748b;margin-bottom:8px");l.innerText=u("sp_checking","Checking\u2026");var h=c(i,"div","");function g(a){if(h.innerHTML=__RTE_TT(""),!a||!a.length){l.innerText=e.getLangText&&e.getLangText("spellcheckclean")||"No spelling issues found.";return}l.innerText=a.length+" issue"+(a.length===1?"":"s")+" found.",a.forEach(function(f){if(!(!f||!f.word)){var m=c(h,"div","padding:8px 0;border-bottom:1px solid rgba(15,23,42,.08)","rte-spell-row"),_=c(m,"div","font-weight:600;color:#b91c1c;margin-bottom:4px");_.textContent=f.word;var k=c(m,"div","display:flex;flex-wrap:wrap;gap:6px"),w=(f.suggestions||[]).slice(0,6);w.length||(c(k,"span","font-size:12px;color:#94a3b8").textContent="(no suggestions)"),w.forEach(function(T){var y=c(k,"button","font-size:12px;padding:4px 9px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fbff;color:#315277;cursor:pointer");y.type="button",y.textContent=T,y.onclick=function(){R(f.word,T)&&(m.style.opacity="0.45",_.innerHTML=__RTE_TT(C(f.word)+' &rarr; <span style="color:#16a34a">'+C(T)+"</span>"),k.innerHTML=__RTE_TT(""))}})}})}var p=!1;function x(a){p||(p=!0,g(a))}try{var v=s.spellCheckResolver(r);v&&typeof v.then=="function"?(v.then(function(a){x(a||[])},function(){l.innerText=u("sp_serviceerror","Spell-check service error.")}),setTimeout(function(){p||(l.innerText=u("sp_timeout","Spell-check timed out."),p=!0)},12e3)):x(v||[])}catch{l.innerText=u("sp_error","Spell-check error.")}var D=c(i,"div","display:flex;justify-content:flex-end;margin-top:12px"),b=c(D,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");b.type="button",b.textContent=u("sp_done","Done"),b.onclick=function(){o(),e.focus()}};function S(){var n=["/* 2026-07-12 spell-check feedback precision */",".rte-spell-toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);max-width:calc(100vw - 32px);padding:9px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#172033;font:600 13px/1.35 -apple-system,Segoe UI,sans-serif;z-index:2147483600;box-shadow:0 10px 24px rgba(15,23,42,.14)}",".rte-spell-row:last-child{border-bottom:0}"].join(`
2
+ `);try{var r=e&&e.iframe&&e.iframe.ownerDocument||document;if(!r.querySelector("style[data-rte-spellcheck]")){var t=r.createElement("style");t.setAttribute("data-rte-spellcheck","1"),t.textContent=n,(r.head||r.documentElement).appendChild(t),e&&typeof e.ensureStyleSheetLive=="function"&&e.ensureStyleSheetLive(r,t,"rte-spellcheck-st",t.textContent)}}catch{}}}
@@ -104,6 +104,16 @@ function RTE_Plugin_StateInspector() {
104
104
  appendToolbarCommand("toolbar_default", "#{stateinspector}");
105
105
  appendToolbarCommand("toolbar_full", "#{stateinspector}");
106
106
  }
107
+ // 2026-10-03 Build the shell NOW, before the editor creates its iframe. ensureShell() moves the
108
+ // editor container; done in InitEditor it moved the live iframe, which then gets a fresh
109
+ // document - and every plugin that had already bound listeners to the old one went deaf (the
110
+ // slash menu, @mentions and emoji autocomplete, until they moved to editor.bindDocumentEvent;
111
+ // customer plugins binding the document directly still were). Nothing is loaded yet here.
112
+ // InitEditor's own ensureShell() call finds the shell and returns it.
113
+ // tools/keyboard/plugin-listeners.mjs
114
+ if (config.stateInspectorEnabled !== false && config.container && config.container.parentNode) {
115
+ try { ensureShell(); } catch (e) { /* InitEditor builds it */ }
116
+ }
107
117
  };
108
118
 
109
119
  obj.InitEditor = function (argeditor) {
@@ -198,7 +208,7 @@ function RTE_Plugin_StateInspector() {
198
208
  if (!list) return attrs;
199
209
  for (var i = 0; i < list.length; i++) {
200
210
  var value = list[i].value;
201
- attrs[list[i].name] = value.length > 220 ? value.substring(0, 220) + "…" : value;
211
+ attrs[list[i].name] = value.length > 220 ? value.substring(0, 220) + "\u2026" : value;
202
212
  }
203
213
  return attrs;
204
214
  }
@@ -211,7 +221,7 @@ function RTE_Plugin_StateInspector() {
211
221
  return {
212
222
  type: "text",
213
223
  length: text.length,
214
- text: text.length > 80 ? text.substring(0, 80) + "…" : text
224
+ text: text.length > 80 ? text.substring(0, 80) + "\u2026" : text
215
225
  };
216
226
  }
217
227
  if (node.nodeType === 8) {
@@ -284,7 +294,7 @@ function RTE_Plugin_StateInspector() {
284
294
  try {
285
295
  var selected = String(range.toString() || "");
286
296
  info.textLength = selected.length;
287
- info.text = selected.length > 120 ? selected.substring(0, 120) + "…" : selected;
297
+ info.text = selected.length > 120 ? selected.substring(0, 120) + "\u2026" : selected;
288
298
  } catch (e) {
289
299
  info.textLength = 0;
290
300
  }
@@ -518,7 +528,7 @@ function RTE_Plugin_StateInspector() {
518
528
  if (hostDoc.getElementById("rte-state-inspector-style")) return;
519
529
  var style = hostDoc.createElement("style");
520
530
  style.id = "rte-state-inspector-style";
521
- style.innerHTML = [
531
+ style.innerHTML = __RTE_TT([
522
532
  ".rte-state-inspector-shell{display:flex;align-items:stretch;gap:10px;}",
523
533
  ".rte-state-inspector-shell>.rte-state-inspector-host{flex:1 1 auto;min-width:0;}",
524
534
  ".rte-state-inspector-panel{display:none;flex:0 0 340px;min-width:290px;max-width:min(400px,36vw);border:1px solid rgba(148,163,184,.22);border-radius:8px;background:#fff;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;}",
@@ -550,7 +560,7 @@ function RTE_Plugin_StateInspector() {
550
560
  ".rte-state-inspector-row-val{flex:1 1 auto;min-width:0;font-family:Consolas,'Cascadia Mono',monospace;word-break:break-all;}",
551
561
  ".rte-state-inspector-row.is-flagged .rte-state-inspector-row-val{color:#b91c1c;font-weight:750;}",
552
562
  "@media (max-width: 1100px){.rte-state-inspector-shell{display:block;}.rte-state-inspector-panel{margin-top:12px;max-width:none;width:100%;}.rte-state-inspector-body{max-height:340px;}}"
553
- ].join("");
563
+ ].join(""));
554
564
  hostDoc.head.appendChild(style);
555
565
  // A <style> element's rules are dropped under a strict style-src; this
556
566
  // re-injects them through the CSSOM in that case only. Missed in 2.9.0,
@@ -716,9 +726,9 @@ function RTE_Plugin_StateInspector() {
716
726
  // Kept short on purpose: the toolbar row ellipsises, and "3 errors" is
717
727
  // the part that must survive the truncation. Full counts are in the
718
728
  // snapshot and the tree tab.
719
- summaryEl.innerText = tree.counters.elements + " el · " +
729
+ summaryEl.innerText = tree.counters.elements + " el \xb7 " +
720
730
  analysis.issues.length + " issue" + (analysis.issues.length === 1 ? "" : "s") +
721
- (errors ? " · " + errors + " error" + (errors === 1 ? "" : "s") : "");
731
+ (errors ? " \xb7 " + errors + " error" + (errors === 1 ? "" : "s") : "");
722
732
  }
723
733
 
724
734
  clear(body);
@@ -747,7 +757,7 @@ function RTE_Plugin_StateInspector() {
747
757
  msg.innerText = item.message;
748
758
  var meta = hostDoc.createElement("div");
749
759
  meta.className = "rte-state-inspector-issue-meta";
750
- meta.innerText = (item.detail || "(document root)") + " · " + item.id;
760
+ meta.innerText = (item.detail || "(document root)") + " \xb7 " + item.id;
751
761
  wrap.appendChild(msg);
752
762
  wrap.appendChild(meta);
753
763
  body.appendChild(wrap);
@@ -787,10 +797,10 @@ function RTE_Plugin_StateInspector() {
787
797
  for (var i = 0; i < keys.length && i < 4; i++) {
788
798
  label += " " + keys[i] + "=" + JSON.stringify(node.attrs[keys[i]]);
789
799
  }
790
- if (keys.length > 4) label += " …+" + (keys.length - 4);
800
+ if (keys.length > 4) label += " \u2026+" + (keys.length - 4);
791
801
  }
792
802
  label += ">";
793
- if (node.truncated) label += " … " + node.childCount + " children (depth limit)";
803
+ if (node.truncated) label += " \u2026 " + node.childCount + " children (depth limit)";
794
804
  lines.push(label);
795
805
  for (var c = 0; c < (node.children || []).length; c++) {
796
806
  lines = lines.concat(formatTree(node.children[c], depth + 1));
@@ -821,7 +831,7 @@ function RTE_Plugin_StateInspector() {
821
831
  var out = boundary.node + " @ " + boundary.offset;
822
832
  if (typeof boundary.length === "number") out += " (len " + boundary.length + ")";
823
833
  if (typeof boundary.childCount === "number") out += " (" + boundary.childCount + " children)";
824
- if (boundary.zeroLength) out += " ← zero-length text node";
834
+ if (boundary.zeroLength) out += " \u2190 zero-length text node";
825
835
  return out;
826
836
  }
827
837
 
@@ -1,2 +1,2 @@
1
- window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_stateinspector=RTE_Plugin_StateInspector;function RTE_Plugin_StateInspector(){var T=this,o,c,p=null,g=null,u=null,b=null,y=null,R=0,v="issues",C=[],h=[],I=60,M=[{id:"issues",label:"Issues"},{id:"tree",label:"Tree"},{id:"selection",label:"Selection"},{id:"plugins",label:"Plugins"},{id:"log",label:"Log"}],A={A:1,ABBR:1,B:1,BDI:1,BDO:1,CITE:1,CODE:1,DEL:1,DFN:1,EM:1,I:1,INS:1,KBD:1,MARK:1,Q:1,S:1,SAMP:1,SMALL:1,SPAN:1,STRONG:1,SUB:1,SUP:1,U:1,VAR:1,FONT:1},q={AREA:1,BASE:1,BR:1,COL:1,EMBED:1,HR:1,IMG:1,INPUT:1,LINK:1,META:1,PARAM:1,SOURCE:1,TRACK:1,WBR:1},Z={ADDRESS:1,ARTICLE:1,ASIDE:1,BLOCKQUOTE:1,DIV:1,DL:1,DT:1,DD:1,FIELDSET:1,FIGCAPTION:1,FIGURE:1,FOOTER:1,FORM:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,HEADER:1,HR:1,LI:1,MAIN:1,NAV:1,OL:1,P:1,PRE:1,SECTION:1,TABLE:1,UL:1},X=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/;T.PluginName="StateInspector",T.InitConfig=function(e){o=e,o.stateInspectorEnabled!==!1&&(o.stateInspectorTitle=o.stateInspectorTitle||"State inspector",o.stateInspectorHint=o.stateInspectorHint||"Derived document model, structural checks, and a copyable snapshot for bug reports.",o.stateInspectorEmptyText=o.stateInspectorEmptyText||"No content to inspect yet.",typeof o.stateInspectorAutoOpen!="boolean"&&(o.stateInspectorAutoOpen=!1),typeof o.stateInspectorToolbarButton!="boolean"&&(o.stateInspectorToolbarButton=!1),typeof o.stateInspectorMaxDepth!="number"&&(o.stateInspectorMaxDepth=24),typeof o.stateInspectorLogLimit=="number"&&(I=Math.max(10,Math.min(500,o.stateInspectorLogLimit))),C=Y(o),o.stateInspectorToolbarButton&&(D("toolbar_default","#{stateinspector}"),D("toolbar_full","#{stateinspector}")))},T.InitEditor=function(e){c=e,o.stateInspectorEnabled!==!1&&(c.stateInspector={close:function(){k()},isOpen:function(){return!!(p&&p.classList.contains("is-open"))},issues:function(){return S(L()).issues},log:function(){return h.slice(0)},open:function(){E()},plugins:function(){return C.slice(0)},refresh:function(){N()},snapshot:function(){return _()},toggle:function(){G()}},ie(),c.toolbarFactoryMap=c.toolbarFactoryMap||{},c.toolbarFactoryMap.stateinspector=function(t){return c.createToolbarButton(t)},c.attachEvent("exec_command_stateinspector",function(t){t.returnValue=!0,t.stopBubble=!0,G()}),c.attachEvent("change",function(){z("change"),K()}),c.attachEvent("selectionchange",function(){z("selectionchange"),K()}),c.slashCommands&&c.slashCommands.register&&c.slashCommands.register({id:"stateinspector",section:"Tools",title:o.stateInspectorTitle,description:"Inspect document structure, selection, and structural issues",keywords:["inspect","debug","devtools","state","structure"],run:function(){E()}}),U(),o.stateInspectorAutoOpen&&E())};function D(e,t){o[e]&&o[e].indexOf(t)===-1&&(o[e]=o[e]+t)}function Y(e){var t=[];for(var r in e)r[0]!=="p"||r.substr(0,7)!=="plugin_"||!e[r]||!(e[r]instanceof Function)||t.push({index:t.length,key:r,name:r.substring(7)});return t}function z(e){h.push({at:Date.now(),event:e}),h.length>I&&h.splice(0,h.length-I)}function $(e){var t={},r=e.attributes;if(!r)return t;for(var n=0;n<r.length;n++){var a=r[n].value;t[r[n].name]=a.length>220?a.substring(0,220)+"\u2026":a}return t}function H(e,t,r,n){if(e.nodeType===3){var a=e.nodeValue||"";return n.textNodes++,n.characters+=a.length,{type:"text",length:a.length,text:a.length>80?a.substring(0,80)+"\u2026":a}}if(e.nodeType===8)return n.comments++,{type:"comment",length:(e.nodeValue||"").length};if(e.nodeType!==1)return null;n.elements++;var i=e.nodeName;n.tags[i]=(n.tags[i]||0)+1;var s={type:"element",name:i.toLowerCase(),attrs:$(e),children:[]};if(t>=r)return s.truncated=!0,s.childCount=e.childNodes.length,s;for(var l=0;l<e.childNodes.length;l++){var d=H(e.childNodes[l],t+1,r,n);d&&s.children.push(d)}return s}function L(){var e=c&&c.getEditable?c.getEditable():null,t={elements:0,textNodes:0,comments:0,characters:0,tags:{}};if(!e)return{root:null,counters:t,editable:null};for(var r=Math.max(2,o.stateInspectorMaxDepth||24),n={type:"element",name:"root",attrs:{},children:[]},a=0;a<e.childNodes.length;a++){var i=H(e.childNodes[a],1,r,t);i&&n.children.push(i)}return{root:n,counters:t,editable:e}}function P(){var e=c&&c.getDocument?c.getDocument():null,t=c&&c.getEditable?c.getEditable():null,r={available:!1};if(!e||!e.getSelection)return r;var n;try{n=e.getSelection()}catch{return r}if(!n||n.rangeCount===0)return r;var a;try{a=n.getRangeAt(0)}catch{return r}if(!a)return r;r.available=!0,r.collapsed=!!a.collapsed,r.anchor=F(a.startContainer,a.startOffset),r.focus=F(a.endContainer,a.endOffset),r.insideEditable=!!(t&&t.contains(a.startContainer)&&t.contains(a.endContainer));try{var i=String(a.toString()||"");r.textLength=i.length,r.text=i.length>120?i.substring(0,120)+"\u2026":i}catch{r.textLength=0}return r.block=ee(a.startContainer,t),r}function F(e,t){if(!e)return{node:"(none)",offset:t};if(e.nodeType===3){var r=e.nodeValue||"";return{node:"#text",offset:t,length:r.length,zeroLength:r.length===0}}return{node:e.nodeName?e.nodeName.toLowerCase():"(unknown)",offset:t,childCount:e.childNodes?e.childNodes.length:0}}function ee(e,t){for(var r=[],n=e;n&&n!==t;)n.nodeType===1&&r.unshift(n.nodeName.toLowerCase()),n=n.parentNode;return r.join(" > ")}function _(){var e=L(),t=S(e);return{snapshotVersion:1,generatedAt:new Date().toISOString(),counters:e.counters,issues:t.issues,plugins:C.slice(0),recentEvents:h.slice(-20),selection:P(),tree:e.root}}function f(e,t,r,n,a){e.push({id:t,severity:r,message:n,detail:a||""})}function w(e,t){for(var r=[],n=e;n&&n!==t&&n.nodeType===1;){var a=n.nodeName.toLowerCase();n.id&&(a+="#"+n.id),r.unshift(a),n=n.parentNode}return r.join(" > ")}function te(e){if((e.textContent||"").replace(/[\s\u200B\uFEFF]/g,"")!=="")return!0;for(var t=0;t<e.childNodes.length;t++){var r=e.childNodes[t];if(r.nodeType===1&&q[r.nodeName])return!0}return!1}function S(e){var t=[],r=e.editable;if(!r)return{issues:t};for(var n=r.ownerDocument.createTreeWalker(r,5,null,!1),a=0,i;i=n.nextNode();){if(i.nodeType===3){ne(i,r,t);continue}ae(i,r,t);var s=re(i);s&&(a&&s>a+1&&f(t,"heading-skip","warn","Heading level jumps from h"+a+" to h"+s,w(i,r)),a=s)}for(var l=0;l<r.childNodes.length;l++){var d=r.childNodes[l];d.nodeType===1&&d.nodeName==="IMG"&&j(d,r,t)}return{issues:t}}function re(e){var t=e.nodeName;return t.length===2&&t[0]==="H"&&t[1]>="1"&&t[1]<="6"?parseInt(t[1],10):0}function ne(e,t,r){var n=e.nodeValue||"";if(n.length===0){f(r,"zero-length-text","warn","Zero-length text node",w(e.parentNode,t));return}X.test(n)&&f(r,"control-characters","error","Text contains control characters - Word will reject an exported .docx",w(e.parentNode,t))}function ae(e,t,r){for(var n=e.nodeName,a=w(e,t),i=e.attributes,s=0;i&&s<i.length;s++){var l=i[s].name.toLowerCase(),d=i[s].value||"";if(l.indexOf("on")===0&&l.length>2&&f(r,"event-handler-attribute","error","Inline event handler "+l+" present in document content",a),l==="href"||l==="src"||l==="xlink:href"){var x=d.replace(/[\u0000-\u0020]/g,"").toLowerCase();x.indexOf("javascript:")===0?f(r,"unsafe-url-scheme","error","javascript: URL in "+l,a):(x.indexOf("data:text/html")===0||x.indexOf("data:image/svg+xml")===0)&&f(r,"unsafe-url-scheme","error","Scriptable data: URL in "+l,a)}}if(n==="IFRAME"&&e.hasAttribute("srcdoc")&&f(r,"iframe-srcdoc","error","iframe[srcdoc] executes when the saved content is rendered downstream",a),A[n]&&!te(e)&&f(r,"empty-inline","warn","Empty inline <"+n.toLowerCase()+"> - a caret entering it cannot leave by typing",a),A[n]&&e.parentNode&&e.parentNode.nodeName===n&&f(r,"nested-duplicate-inline","warn","<"+n.toLowerCase()+"> nested directly inside another <"+n.toLowerCase()+">",a),A[n])for(var O=0;O<e.childNodes.length;O++){var B=e.childNodes[O];if(B.nodeType===1&&Z[B.nodeName]){f(r,"block-inside-inline","warn","Block <"+B.nodeName.toLowerCase()+"> inside inline <"+n.toLowerCase()+">",a);break}}if(n==="LI"){var Q=e.parentNode?e.parentNode.nodeName:"";Q!=="UL"&&Q!=="OL"&&f(r,"orphan-list-item","warn","<li> outside a <ul> or <ol>",a)}n==="IMG"&&j(e,t,r),e.hasAttribute&&e.hasAttribute("data-rte-atomic")&&e.getAttribute("contenteditable")!=="false"&&f(r,"atomic-not-protected","error",'Atomic element without contenteditable="false"',a)}function j(e,t,r){if(!(e.getAttribute("role")==="presentation"||e.getAttribute("aria-hidden")==="true")){var n=e.getAttribute("alt");n===null&&f(r,"image-missing-alt","warn","Image has no alt attribute",w(e,t))}}function ie(){var e=o.container.ownerDocument;if(!e.getElementById("rte-state-inspector-style")){var t=e.createElement("style");t.id="rte-state-inspector-style",t.innerHTML=[".rte-state-inspector-shell{display:flex;align-items:stretch;gap:10px;}",".rte-state-inspector-shell>.rte-state-inspector-host{flex:1 1 auto;min-width:0;}",".rte-state-inspector-panel{display:none;flex:0 0 340px;min-width:290px;max-width:min(400px,36vw);border:1px solid rgba(148,163,184,.22);border-radius:8px;background:#fff;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-state-inspector-shell.is-open>.rte-state-inspector-panel{display:flex;flex-direction:column;}",".rte-state-inspector-header{padding:12px 12px 9px 14px;border-bottom:1px solid rgba(148,163,184,.16);background:rgba(248,251,255,.72);}",".rte-state-inspector-kicker{font-size:10px;line-height:1.3;letter-spacing:.08em;text-transform:uppercase;color:#52657e;font-weight:850;}",".rte-state-inspector-title{margin-top:3px;font-size:15px;line-height:1.2;font-weight:850;color:#172033;}",".rte-state-inspector-copy{margin-top:5px;font-size:12px;line-height:1.42;color:#52657e;}",".rte-state-inspector-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px 8px 14px;border-bottom:1px solid rgba(148,163,184,.16);}",".rte-state-inspector-summary{min-width:0;font-size:12px;font-weight:750;color:#52657e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}",".rte-state-inspector-actions{display:flex;gap:6px;flex:0 0 auto;}",".rte-state-inspector-btn{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-state-inspector-btn:hover,.rte-state-inspector-btn:focus-visible{background:#eef4ff;color:#0f3f9f;border-color:rgba(37,99,235,.28);}",".rte-state-inspector-tabs{display:flex;gap:2px;padding:8px 10px 0 10px;border-bottom:1px solid rgba(148,163,184,.16);}",".rte-state-inspector-tab{appearance:none;border:1px solid transparent;border-bottom:none;background:transparent;color:#52657e;cursor:pointer;font-size:12px;font-weight:800;padding:7px 10px;border-radius:7px 7px 0 0;line-height:1;}",".rte-state-inspector-tab:hover,.rte-state-inspector-tab:focus-visible{background:#f8fbff;color:#0f3f9f;}",".rte-state-inspector-tab[aria-selected='true']{background:#eef4ff;border-color:rgba(37,99,235,.26);color:#0f3f9f;}",".rte-state-inspector-body{padding:10px;overflow:auto;min-height:160px;max-height:540px;scrollbar-width:thin;font-size:12px;line-height:1.5;}",".rte-state-inspector-issue{display:block;padding:8px 10px;margin-bottom:6px;border:1px solid rgba(148,163,184,.24);border-left-width:3px;border-radius:7px;background:#fff;}",".rte-state-inspector-issue.is-error{border-left-color:#dc2626;background:#fef4f4;}",".rte-state-inspector-issue.is-warn{border-left-color:#d97706;background:#fffaf1;}",".rte-state-inspector-issue-msg{font-weight:750;color:#172033;}",".rte-state-inspector-issue-meta{margin-top:3px;font-size:11px;color:#52657e;font-family:Consolas,'Cascadia Mono',monospace;word-break:break-all;}",".rte-state-inspector-ok{padding:14px;color:#166534;font-weight:750;background:#f0fdf4;border:1px dashed rgba(22,101,52,.3);border-radius:8px;}",".rte-state-inspector-empty{padding:14px;color:#52657e;font-weight:700;background:#fff;border:1px dashed rgba(148,163,184,.34);border-radius:8px;}",".rte-state-inspector-pre{margin:0;font-family:Consolas,'Cascadia Mono',monospace;font-size:11px;line-height:1.55;color:#172033;white-space:pre;}",".rte-state-inspector-row{display:flex;gap:8px;padding:4px 0;border-bottom:1px solid rgba(148,163,184,.14);}",".rte-state-inspector-row-key{flex:0 0 116px;color:#52657e;font-weight:750;}",".rte-state-inspector-row-val{flex:1 1 auto;min-width:0;font-family:Consolas,'Cascadia Mono',monospace;word-break:break-all;}",".rte-state-inspector-row.is-flagged .rte-state-inspector-row-val{color:#b91c1c;font-weight:750;}","@media (max-width: 1100px){.rte-state-inspector-shell{display:block;}.rte-state-inspector-panel{margin-top:12px;max-width:none;width:100%;}.rte-state-inspector-body{max-height:340px;}}"].join(""),e.head.appendChild(t),c&&typeof c.ensureStyleSheetLive=="function"&&c.ensureStyleSheetLive(e,t,"rte-state-inspector-style",t.textContent)}}function U(){if(p)return p;var e=o.container,t=e.ownerDocument;p=t.createElement("div"),p.className="rte-state-inspector-shell";var r=t.createElement("div");r.className="rte-state-inspector-host",e.parentNode.insertBefore(p,e),p.appendChild(r),r.appendChild(e),g=t.createElement("aside"),g.className="rte-state-inspector-panel",g.setAttribute("role","complementary"),g.setAttribute("aria-label",o.stateInspectorTitle);var n=t.createElement("div");n.className="rte-state-inspector-header";var a=t.createElement("div");a.className="rte-state-inspector-kicker",a.innerText="Developer";var i=t.createElement("div");i.className="rte-state-inspector-title",i.innerText=o.stateInspectorTitle;var s=t.createElement("div");s.className="rte-state-inspector-copy",s.innerText=o.stateInspectorHint,n.appendChild(a),n.appendChild(i),n.appendChild(s);var l=t.createElement("div");l.className="rte-state-inspector-toolbar",y=t.createElement("div"),y.className="rte-state-inspector-summary",y.setAttribute("data-rte-inspector-summary","1");var d=t.createElement("div");d.className="rte-state-inspector-actions",d.appendChild(V(t,"Copy","Copy the state snapshot as JSON",le)),d.appendChild(V(t,"Hide","Hide the state inspector",k)),l.appendChild(y),l.appendChild(d),b=t.createElement("div"),b.className="rte-state-inspector-tabs",b.setAttribute("role","tablist");for(var x=0;x<M.length;x++)b.appendChild(oe(t,M[x]));return u=t.createElement("div"),u.className="rte-state-inspector-body",g.appendChild(n),g.appendChild(l),g.appendChild(b),g.appendChild(u),p.appendChild(g),p}function V(e,t,r,n){var a=e.createElement("button");return a.type="button",a.className="rte-state-inspector-btn",a.innerText=t,a.setAttribute("aria-label",r),a.onclick=n,a}function oe(e,t){var r=e.createElement("button");return r.type="button",r.className="rte-state-inspector-tab",r.innerText=t.label,r.setAttribute("role","tab"),r.setAttribute("data-rte-inspector-tab",t.id),r.setAttribute("aria-selected",t.id===v?"true":"false"),r.onclick=function(){v=t.id,se(),N()},r}function se(){if(b)for(var e=b.querySelectorAll("[data-rte-inspector-tab]"),t=0;t<e.length;t++){var r=e[t].getAttribute("data-rte-inspector-tab");e[t].setAttribute("aria-selected",r===v?"true":"false")}}function G(){p&&p.classList.contains("is-open")?k():E()}function E(){U(),p.classList.add("is-open"),N()}function k(){p&&p.classList.remove("is-open")}function K(){!p||!p.classList.contains("is-open")||(clearTimeout(R),R=setTimeout(function(){N()},120))}function le(){var e=JSON.stringify(_(),null,2);if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(e);return}var t=o.container.ownerDocument,r=t.createElement("textarea");r.value=e,r.style.position="fixed",r.style.opacity="0",t.body.appendChild(r),r.select();try{t.execCommand("copy")}catch{}t.body.removeChild(r)}function ce(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function N(){if(!(!p||!u)){for(var e=L(),t=S(e),r=o.container.ownerDocument,n=0,a=0;a<t.issues.length;a++)t.issues[a].severity==="error"&&n++;y&&(y.innerText=e.counters.elements+" el \xB7 "+t.issues.length+" issue"+(t.issues.length===1?"":"s")+(n?" \xB7 "+n+" error"+(n===1?"":"s"):"")),ce(u),v==="issues"?pe(r,t.issues):v==="tree"?de(r,e):v==="selection"?ue(r):v==="plugins"?fe(r):v==="log"&&he(r)}}function pe(e,t){if(!t.length){var r=e.createElement("div");r.className="rte-state-inspector-ok",r.innerText="No structural issues found.",u.appendChild(r);return}for(var n=0;n<t.length;n++){var a=t[n],i=e.createElement("div");i.className="rte-state-inspector-issue is-"+(a.severity==="error"?"error":"warn"),i.setAttribute("data-rte-issue-id",a.id);var s=e.createElement("div");s.className="rte-state-inspector-issue-msg",s.innerText=a.message;var l=e.createElement("div");l.className="rte-state-inspector-issue-meta",l.innerText=(a.detail||"(document root)")+" \xB7 "+a.id,i.appendChild(s),i.appendChild(l),u.appendChild(i)}}function de(e,t){if(!t.root||!t.root.children.length){var r=e.createElement("div");r.className="rte-state-inspector-empty",r.innerText=o.stateInspectorEmptyText,u.appendChild(r);return}var n=e.createElement("pre");n.className="rte-state-inspector-pre",n.innerText=J(t.root,0).join(`
2
- `),u.appendChild(n)}function J(e,t){var r=[],n=new Array(t+1).join(" ");if(e.type==="text")return r.push(n+"#text("+e.length+") "+JSON.stringify(e.text)),r;if(e.type==="comment")return r.push(n+"#comment("+e.length+")"),r;var a=n+"<"+e.name,i=[];for(var s in e.attrs)i.push(s);if(i.length){i.sort();for(var l=0;l<i.length&&l<4;l++)a+=" "+i[l]+"="+JSON.stringify(e.attrs[i[l]]);i.length>4&&(a+=" \u2026+"+(i.length-4))}a+=">",e.truncated&&(a+=" \u2026 "+e.childCount+" children (depth limit)"),r.push(a);for(var d=0;d<(e.children||[]).length;d++)r=r.concat(J(e.children[d],t+1));return r}function ue(e){var t=P();if(!t.available){var r=e.createElement("div");r.className="rte-state-inspector-empty",r.innerText="No selection in the document.",u.appendChild(r);return}m(e,"Collapsed",String(t.collapsed)),m(e,"In editable",String(t.insideEditable),!t.insideEditable),m(e,"Block path",t.block||"(root)"),m(e,"Anchor",W(t.anchor),!!(t.anchor&&t.anchor.zeroLength)),m(e,"Focus",W(t.focus),!!(t.focus&&t.focus.zeroLength)),m(e,"Selected",t.textLength+" chars"),t.text&&m(e,"Text",t.text)}function W(e){if(!e)return"(none)";var t=e.node+" @ "+e.offset;return typeof e.length=="number"&&(t+=" (len "+e.length+")"),typeof e.childCount=="number"&&(t+=" ("+e.childCount+" children)"),e.zeroLength&&(t+=" \u2190 zero-length text node"),t}function m(e,t,r,n){var a=e.createElement("div");a.className="rte-state-inspector-row"+(n?" is-flagged":"");var i=e.createElement("div");i.className="rte-state-inspector-row-key",i.innerText=t;var s=e.createElement("div");s.className="rte-state-inspector-row-val",s.innerText=r,a.appendChild(i),a.appendChild(s),u.appendChild(a)}function fe(e){if(!C.length){var t=e.createElement("div");t.className="rte-state-inspector-empty",t.innerText="No plugins registered.",u.appendChild(t);return}var r=e.createElement("div");r.className="rte-state-inspector-copy",r.innerText="Initialization order. A plugin can only register into another plugin's API if it appears below it.",u.appendChild(r);for(var n=0;n<C.length;n++)m(e,String(n+1).padStart?String(n+1).padStart(3,"0"):String(n+1),C[n].name)}function he(e){if(!h.length){var t=e.createElement("div");t.className="rte-state-inspector-empty",t.innerText="No editor events recorded yet.",u.appendChild(t);return}for(var r=h[0].at,n=h.length-1;n>=0;n--)m(e,"+"+(h[n].at-r)+"ms",h[n].event)}}
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_stateinspector=RTE_Plugin_StateInspector;function RTE_Plugin_StateInspector(){var N=this,o,c,p=null,g=null,u=null,b=null,y=null,M=0,v="issues",C=[],h=[],I=60,D=[{id:"issues",label:"Issues"},{id:"tree",label:"Tree"},{id:"selection",label:"Selection"},{id:"plugins",label:"Plugins"},{id:"log",label:"Log"}],A={A:1,ABBR:1,B:1,BDI:1,BDO:1,CITE:1,CODE:1,DEL:1,DFN:1,EM:1,I:1,INS:1,KBD:1,MARK:1,Q:1,S:1,SAMP:1,SMALL:1,SPAN:1,STRONG:1,SUB:1,SUP:1,U:1,VAR:1,FONT:1},q={AREA:1,BASE:1,BR:1,COL:1,EMBED:1,HR:1,IMG:1,INPUT:1,LINK:1,META:1,PARAM:1,SOURCE:1,TRACK:1,WBR:1},Z={ADDRESS:1,ARTICLE:1,ASIDE:1,BLOCKQUOTE:1,DIV:1,DL:1,DT:1,DD:1,FIELDSET:1,FIGCAPTION:1,FIGURE:1,FOOTER:1,FORM:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,HEADER:1,HR:1,LI:1,MAIN:1,NAV:1,OL:1,P:1,PRE:1,SECTION:1,TABLE:1,UL:1},X=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/;N.PluginName="StateInspector",N.InitConfig=function(e){if(o=e,o.stateInspectorEnabled!==!1&&(o.stateInspectorTitle=o.stateInspectorTitle||"State inspector",o.stateInspectorHint=o.stateInspectorHint||"Derived document model, structural checks, and a copyable snapshot for bug reports.",o.stateInspectorEmptyText=o.stateInspectorEmptyText||"No content to inspect yet.",typeof o.stateInspectorAutoOpen!="boolean"&&(o.stateInspectorAutoOpen=!1),typeof o.stateInspectorToolbarButton!="boolean"&&(o.stateInspectorToolbarButton=!1),typeof o.stateInspectorMaxDepth!="number"&&(o.stateInspectorMaxDepth=24),typeof o.stateInspectorLogLimit=="number"&&(I=Math.max(10,Math.min(500,o.stateInspectorLogLimit))),C=Y(o),o.stateInspectorToolbarButton&&(z("toolbar_default","#{stateinspector}"),z("toolbar_full","#{stateinspector}")),o.stateInspectorEnabled!==!1&&o.container&&o.container.parentNode))try{k()}catch{}},N.InitEditor=function(e){c=e,o.stateInspectorEnabled!==!1&&(c.stateInspector={close:function(){O()},isOpen:function(){return!!(p&&p.classList.contains("is-open"))},issues:function(){return S(L()).issues},log:function(){return h.slice(0)},open:function(){E()},plugins:function(){return C.slice(0)},refresh:function(){T()},snapshot:function(){return j()},toggle:function(){G()}},ie(),c.toolbarFactoryMap=c.toolbarFactoryMap||{},c.toolbarFactoryMap.stateinspector=function(t){return c.createToolbarButton(t)},c.attachEvent("exec_command_stateinspector",function(t){t.returnValue=!0,t.stopBubble=!0,G()}),c.attachEvent("change",function(){H("change"),K()}),c.attachEvent("selectionchange",function(){H("selectionchange"),K()}),c.slashCommands&&c.slashCommands.register&&c.slashCommands.register({id:"stateinspector",section:"Tools",title:o.stateInspectorTitle,description:"Inspect document structure, selection, and structural issues",keywords:["inspect","debug","devtools","state","structure"],run:function(){E()}}),k(),o.stateInspectorAutoOpen&&E())};function z(e,t){o[e]&&o[e].indexOf(t)===-1&&(o[e]=o[e]+t)}function Y(e){var t=[];for(var r in e)r[0]!=="p"||r.substr(0,7)!=="plugin_"||!e[r]||!(e[r]instanceof Function)||t.push({index:t.length,key:r,name:r.substring(7)});return t}function H(e){h.push({at:Date.now(),event:e}),h.length>I&&h.splice(0,h.length-I)}function $(e){var t={},r=e.attributes;if(!r)return t;for(var n=0;n<r.length;n++){var a=r[n].value;t[r[n].name]=a.length>220?a.substring(0,220)+"\u2026":a}return t}function P(e,t,r,n){if(e.nodeType===3){var a=e.nodeValue||"";return n.textNodes++,n.characters+=a.length,{type:"text",length:a.length,text:a.length>80?a.substring(0,80)+"\u2026":a}}if(e.nodeType===8)return n.comments++,{type:"comment",length:(e.nodeValue||"").length};if(e.nodeType!==1)return null;n.elements++;var i=e.nodeName;n.tags[i]=(n.tags[i]||0)+1;var s={type:"element",name:i.toLowerCase(),attrs:$(e),children:[]};if(t>=r)return s.truncated=!0,s.childCount=e.childNodes.length,s;for(var l=0;l<e.childNodes.length;l++){var d=P(e.childNodes[l],t+1,r,n);d&&s.children.push(d)}return s}function L(){var e=c&&c.getEditable?c.getEditable():null,t={elements:0,textNodes:0,comments:0,characters:0,tags:{}};if(!e)return{root:null,counters:t,editable:null};for(var r=Math.max(2,o.stateInspectorMaxDepth||24),n={type:"element",name:"root",attrs:{},children:[]},a=0;a<e.childNodes.length;a++){var i=P(e.childNodes[a],1,r,t);i&&n.children.push(i)}return{root:n,counters:t,editable:e}}function _(){var e=c&&c.getDocument?c.getDocument():null,t=c&&c.getEditable?c.getEditable():null,r={available:!1};if(!e||!e.getSelection)return r;var n;try{n=e.getSelection()}catch{return r}if(!n||n.rangeCount===0)return r;var a;try{a=n.getRangeAt(0)}catch{return r}if(!a)return r;r.available=!0,r.collapsed=!!a.collapsed,r.anchor=F(a.startContainer,a.startOffset),r.focus=F(a.endContainer,a.endOffset),r.insideEditable=!!(t&&t.contains(a.startContainer)&&t.contains(a.endContainer));try{var i=String(a.toString()||"");r.textLength=i.length,r.text=i.length>120?i.substring(0,120)+"\u2026":i}catch{r.textLength=0}return r.block=ee(a.startContainer,t),r}function F(e,t){if(!e)return{node:"(none)",offset:t};if(e.nodeType===3){var r=e.nodeValue||"";return{node:"#text",offset:t,length:r.length,zeroLength:r.length===0}}return{node:e.nodeName?e.nodeName.toLowerCase():"(unknown)",offset:t,childCount:e.childNodes?e.childNodes.length:0}}function ee(e,t){for(var r=[],n=e;n&&n!==t;)n.nodeType===1&&r.unshift(n.nodeName.toLowerCase()),n=n.parentNode;return r.join(" > ")}function j(){var e=L(),t=S(e);return{snapshotVersion:1,generatedAt:new Date().toISOString(),counters:e.counters,issues:t.issues,plugins:C.slice(0),recentEvents:h.slice(-20),selection:_(),tree:e.root}}function f(e,t,r,n,a){e.push({id:t,severity:r,message:n,detail:a||""})}function w(e,t){for(var r=[],n=e;n&&n!==t&&n.nodeType===1;){var a=n.nodeName.toLowerCase();n.id&&(a+="#"+n.id),r.unshift(a),n=n.parentNode}return r.join(" > ")}function te(e){if((e.textContent||"").replace(/[\s\u200B\uFEFF]/g,"")!=="")return!0;for(var t=0;t<e.childNodes.length;t++){var r=e.childNodes[t];if(r.nodeType===1&&q[r.nodeName])return!0}return!1}function S(e){var t=[],r=e.editable;if(!r)return{issues:t};for(var n=r.ownerDocument.createTreeWalker(r,5,null,!1),a=0,i;i=n.nextNode();){if(i.nodeType===3){ne(i,r,t);continue}ae(i,r,t);var s=re(i);s&&(a&&s>a+1&&f(t,"heading-skip","warn","Heading level jumps from h"+a+" to h"+s,w(i,r)),a=s)}for(var l=0;l<r.childNodes.length;l++){var d=r.childNodes[l];d.nodeType===1&&d.nodeName==="IMG"&&U(d,r,t)}return{issues:t}}function re(e){var t=e.nodeName;return t.length===2&&t[0]==="H"&&t[1]>="1"&&t[1]<="6"?parseInt(t[1],10):0}function ne(e,t,r){var n=e.nodeValue||"";if(n.length===0){f(r,"zero-length-text","warn","Zero-length text node",w(e.parentNode,t));return}X.test(n)&&f(r,"control-characters","error","Text contains control characters - Word will reject an exported .docx",w(e.parentNode,t))}function ae(e,t,r){for(var n=e.nodeName,a=w(e,t),i=e.attributes,s=0;i&&s<i.length;s++){var l=i[s].name.toLowerCase(),d=i[s].value||"";if(l.indexOf("on")===0&&l.length>2&&f(r,"event-handler-attribute","error","Inline event handler "+l+" present in document content",a),l==="href"||l==="src"||l==="xlink:href"){var x=d.replace(/[\u0000-\u0020]/g,"").toLowerCase();x.indexOf("javascript:")===0?f(r,"unsafe-url-scheme","error","javascript: URL in "+l,a):(x.indexOf("data:text/html")===0||x.indexOf("data:image/svg+xml")===0)&&f(r,"unsafe-url-scheme","error","Scriptable data: URL in "+l,a)}}if(n==="IFRAME"&&e.hasAttribute("srcdoc")&&f(r,"iframe-srcdoc","error","iframe[srcdoc] executes when the saved content is rendered downstream",a),A[n]&&!te(e)&&f(r,"empty-inline","warn","Empty inline <"+n.toLowerCase()+"> - a caret entering it cannot leave by typing",a),A[n]&&e.parentNode&&e.parentNode.nodeName===n&&f(r,"nested-duplicate-inline","warn","<"+n.toLowerCase()+"> nested directly inside another <"+n.toLowerCase()+">",a),A[n])for(var R=0;R<e.childNodes.length;R++){var B=e.childNodes[R];if(B.nodeType===1&&Z[B.nodeName]){f(r,"block-inside-inline","warn","Block <"+B.nodeName.toLowerCase()+"> inside inline <"+n.toLowerCase()+">",a);break}}if(n==="LI"){var Q=e.parentNode?e.parentNode.nodeName:"";Q!=="UL"&&Q!=="OL"&&f(r,"orphan-list-item","warn","<li> outside a <ul> or <ol>",a)}n==="IMG"&&U(e,t,r),e.hasAttribute&&e.hasAttribute("data-rte-atomic")&&e.getAttribute("contenteditable")!=="false"&&f(r,"atomic-not-protected","error",'Atomic element without contenteditable="false"',a)}function U(e,t,r){if(!(e.getAttribute("role")==="presentation"||e.getAttribute("aria-hidden")==="true")){var n=e.getAttribute("alt");n===null&&f(r,"image-missing-alt","warn","Image has no alt attribute",w(e,t))}}function ie(){var e=o.container.ownerDocument;if(!e.getElementById("rte-state-inspector-style")){var t=e.createElement("style");t.id="rte-state-inspector-style",t.innerHTML=__RTE_TT([".rte-state-inspector-shell{display:flex;align-items:stretch;gap:10px;}",".rte-state-inspector-shell>.rte-state-inspector-host{flex:1 1 auto;min-width:0;}",".rte-state-inspector-panel{display:none;flex:0 0 340px;min-width:290px;max-width:min(400px,36vw);border:1px solid rgba(148,163,184,.22);border-radius:8px;background:#fff;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-state-inspector-shell.is-open>.rte-state-inspector-panel{display:flex;flex-direction:column;}",".rte-state-inspector-header{padding:12px 12px 9px 14px;border-bottom:1px solid rgba(148,163,184,.16);background:rgba(248,251,255,.72);}",".rte-state-inspector-kicker{font-size:10px;line-height:1.3;letter-spacing:.08em;text-transform:uppercase;color:#52657e;font-weight:850;}",".rte-state-inspector-title{margin-top:3px;font-size:15px;line-height:1.2;font-weight:850;color:#172033;}",".rte-state-inspector-copy{margin-top:5px;font-size:12px;line-height:1.42;color:#52657e;}",".rte-state-inspector-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px 8px 14px;border-bottom:1px solid rgba(148,163,184,.16);}",".rte-state-inspector-summary{min-width:0;font-size:12px;font-weight:750;color:#52657e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}",".rte-state-inspector-actions{display:flex;gap:6px;flex:0 0 auto;}",".rte-state-inspector-btn{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-state-inspector-btn:hover,.rte-state-inspector-btn:focus-visible{background:#eef4ff;color:#0f3f9f;border-color:rgba(37,99,235,.28);}",".rte-state-inspector-tabs{display:flex;gap:2px;padding:8px 10px 0 10px;border-bottom:1px solid rgba(148,163,184,.16);}",".rte-state-inspector-tab{appearance:none;border:1px solid transparent;border-bottom:none;background:transparent;color:#52657e;cursor:pointer;font-size:12px;font-weight:800;padding:7px 10px;border-radius:7px 7px 0 0;line-height:1;}",".rte-state-inspector-tab:hover,.rte-state-inspector-tab:focus-visible{background:#f8fbff;color:#0f3f9f;}",".rte-state-inspector-tab[aria-selected='true']{background:#eef4ff;border-color:rgba(37,99,235,.26);color:#0f3f9f;}",".rte-state-inspector-body{padding:10px;overflow:auto;min-height:160px;max-height:540px;scrollbar-width:thin;font-size:12px;line-height:1.5;}",".rte-state-inspector-issue{display:block;padding:8px 10px;margin-bottom:6px;border:1px solid rgba(148,163,184,.24);border-left-width:3px;border-radius:7px;background:#fff;}",".rte-state-inspector-issue.is-error{border-left-color:#dc2626;background:#fef4f4;}",".rte-state-inspector-issue.is-warn{border-left-color:#d97706;background:#fffaf1;}",".rte-state-inspector-issue-msg{font-weight:750;color:#172033;}",".rte-state-inspector-issue-meta{margin-top:3px;font-size:11px;color:#52657e;font-family:Consolas,'Cascadia Mono',monospace;word-break:break-all;}",".rte-state-inspector-ok{padding:14px;color:#166534;font-weight:750;background:#f0fdf4;border:1px dashed rgba(22,101,52,.3);border-radius:8px;}",".rte-state-inspector-empty{padding:14px;color:#52657e;font-weight:700;background:#fff;border:1px dashed rgba(148,163,184,.34);border-radius:8px;}",".rte-state-inspector-pre{margin:0;font-family:Consolas,'Cascadia Mono',monospace;font-size:11px;line-height:1.55;color:#172033;white-space:pre;}",".rte-state-inspector-row{display:flex;gap:8px;padding:4px 0;border-bottom:1px solid rgba(148,163,184,.14);}",".rte-state-inspector-row-key{flex:0 0 116px;color:#52657e;font-weight:750;}",".rte-state-inspector-row-val{flex:1 1 auto;min-width:0;font-family:Consolas,'Cascadia Mono',monospace;word-break:break-all;}",".rte-state-inspector-row.is-flagged .rte-state-inspector-row-val{color:#b91c1c;font-weight:750;}","@media (max-width: 1100px){.rte-state-inspector-shell{display:block;}.rte-state-inspector-panel{margin-top:12px;max-width:none;width:100%;}.rte-state-inspector-body{max-height:340px;}}"].join("")),e.head.appendChild(t),c&&typeof c.ensureStyleSheetLive=="function"&&c.ensureStyleSheetLive(e,t,"rte-state-inspector-style",t.textContent)}}function k(){if(p)return p;var e=o.container,t=e.ownerDocument;p=t.createElement("div"),p.className="rte-state-inspector-shell";var r=t.createElement("div");r.className="rte-state-inspector-host",e.parentNode.insertBefore(p,e),p.appendChild(r),r.appendChild(e),g=t.createElement("aside"),g.className="rte-state-inspector-panel",g.setAttribute("role","complementary"),g.setAttribute("aria-label",o.stateInspectorTitle);var n=t.createElement("div");n.className="rte-state-inspector-header";var a=t.createElement("div");a.className="rte-state-inspector-kicker",a.innerText="Developer";var i=t.createElement("div");i.className="rte-state-inspector-title",i.innerText=o.stateInspectorTitle;var s=t.createElement("div");s.className="rte-state-inspector-copy",s.innerText=o.stateInspectorHint,n.appendChild(a),n.appendChild(i),n.appendChild(s);var l=t.createElement("div");l.className="rte-state-inspector-toolbar",y=t.createElement("div"),y.className="rte-state-inspector-summary",y.setAttribute("data-rte-inspector-summary","1");var d=t.createElement("div");d.className="rte-state-inspector-actions",d.appendChild(V(t,"Copy","Copy the state snapshot as JSON",le)),d.appendChild(V(t,"Hide","Hide the state inspector",O)),l.appendChild(y),l.appendChild(d),b=t.createElement("div"),b.className="rte-state-inspector-tabs",b.setAttribute("role","tablist");for(var x=0;x<D.length;x++)b.appendChild(oe(t,D[x]));return u=t.createElement("div"),u.className="rte-state-inspector-body",g.appendChild(n),g.appendChild(l),g.appendChild(b),g.appendChild(u),p.appendChild(g),p}function V(e,t,r,n){var a=e.createElement("button");return a.type="button",a.className="rte-state-inspector-btn",a.innerText=t,a.setAttribute("aria-label",r),a.onclick=n,a}function oe(e,t){var r=e.createElement("button");return r.type="button",r.className="rte-state-inspector-tab",r.innerText=t.label,r.setAttribute("role","tab"),r.setAttribute("data-rte-inspector-tab",t.id),r.setAttribute("aria-selected",t.id===v?"true":"false"),r.onclick=function(){v=t.id,se(),T()},r}function se(){if(b)for(var e=b.querySelectorAll("[data-rte-inspector-tab]"),t=0;t<e.length;t++){var r=e[t].getAttribute("data-rte-inspector-tab");e[t].setAttribute("aria-selected",r===v?"true":"false")}}function G(){p&&p.classList.contains("is-open")?O():E()}function E(){k(),p.classList.add("is-open"),T()}function O(){p&&p.classList.remove("is-open")}function K(){!p||!p.classList.contains("is-open")||(clearTimeout(M),M=setTimeout(function(){T()},120))}function le(){var e=JSON.stringify(j(),null,2);if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(e);return}var t=o.container.ownerDocument,r=t.createElement("textarea");r.value=e,r.style.position="fixed",r.style.opacity="0",t.body.appendChild(r),r.select();try{t.execCommand("copy")}catch{}t.body.removeChild(r)}function ce(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function T(){if(!(!p||!u)){for(var e=L(),t=S(e),r=o.container.ownerDocument,n=0,a=0;a<t.issues.length;a++)t.issues[a].severity==="error"&&n++;y&&(y.innerText=e.counters.elements+" el \xB7 "+t.issues.length+" issue"+(t.issues.length===1?"":"s")+(n?" \xB7 "+n+" error"+(n===1?"":"s"):"")),ce(u),v==="issues"?pe(r,t.issues):v==="tree"?de(r,e):v==="selection"?ue(r):v==="plugins"?fe(r):v==="log"&&he(r)}}function pe(e,t){if(!t.length){var r=e.createElement("div");r.className="rte-state-inspector-ok",r.innerText="No structural issues found.",u.appendChild(r);return}for(var n=0;n<t.length;n++){var a=t[n],i=e.createElement("div");i.className="rte-state-inspector-issue is-"+(a.severity==="error"?"error":"warn"),i.setAttribute("data-rte-issue-id",a.id);var s=e.createElement("div");s.className="rte-state-inspector-issue-msg",s.innerText=a.message;var l=e.createElement("div");l.className="rte-state-inspector-issue-meta",l.innerText=(a.detail||"(document root)")+" \xB7 "+a.id,i.appendChild(s),i.appendChild(l),u.appendChild(i)}}function de(e,t){if(!t.root||!t.root.children.length){var r=e.createElement("div");r.className="rte-state-inspector-empty",r.innerText=o.stateInspectorEmptyText,u.appendChild(r);return}var n=e.createElement("pre");n.className="rte-state-inspector-pre",n.innerText=J(t.root,0).join(`
2
+ `),u.appendChild(n)}function J(e,t){var r=[],n=new Array(t+1).join(" ");if(e.type==="text")return r.push(n+"#text("+e.length+") "+JSON.stringify(e.text)),r;if(e.type==="comment")return r.push(n+"#comment("+e.length+")"),r;var a=n+"<"+e.name,i=[];for(var s in e.attrs)i.push(s);if(i.length){i.sort();for(var l=0;l<i.length&&l<4;l++)a+=" "+i[l]+"="+JSON.stringify(e.attrs[i[l]]);i.length>4&&(a+=" \u2026+"+(i.length-4))}a+=">",e.truncated&&(a+=" \u2026 "+e.childCount+" children (depth limit)"),r.push(a);for(var d=0;d<(e.children||[]).length;d++)r=r.concat(J(e.children[d],t+1));return r}function ue(e){var t=_();if(!t.available){var r=e.createElement("div");r.className="rte-state-inspector-empty",r.innerText="No selection in the document.",u.appendChild(r);return}m(e,"Collapsed",String(t.collapsed)),m(e,"In editable",String(t.insideEditable),!t.insideEditable),m(e,"Block path",t.block||"(root)"),m(e,"Anchor",W(t.anchor),!!(t.anchor&&t.anchor.zeroLength)),m(e,"Focus",W(t.focus),!!(t.focus&&t.focus.zeroLength)),m(e,"Selected",t.textLength+" chars"),t.text&&m(e,"Text",t.text)}function W(e){if(!e)return"(none)";var t=e.node+" @ "+e.offset;return typeof e.length=="number"&&(t+=" (len "+e.length+")"),typeof e.childCount=="number"&&(t+=" ("+e.childCount+" children)"),e.zeroLength&&(t+=" \u2190 zero-length text node"),t}function m(e,t,r,n){var a=e.createElement("div");a.className="rte-state-inspector-row"+(n?" is-flagged":"");var i=e.createElement("div");i.className="rte-state-inspector-row-key",i.innerText=t;var s=e.createElement("div");s.className="rte-state-inspector-row-val",s.innerText=r,a.appendChild(i),a.appendChild(s),u.appendChild(a)}function fe(e){if(!C.length){var t=e.createElement("div");t.className="rte-state-inspector-empty",t.innerText="No plugins registered.",u.appendChild(t);return}var r=e.createElement("div");r.className="rte-state-inspector-copy",r.innerText="Initialization order. A plugin can only register into another plugin's API if it appears below it.",u.appendChild(r);for(var n=0;n<C.length;n++)m(e,String(n+1).padStart?String(n+1).padStart(3,"0"):String(n+1),C[n].name)}function he(e){if(!h.length){var t=e.createElement("div");t.className="rte-state-inspector-empty",t.innerText="No editor events recorded yet.",u.appendChild(t);return}for(var r=h[0].at,n=h.length-1;n>=0;n--)m(e,"+"+(h[n].at-r)+"ms",h[n].event)}}