@richscripts/richtexteditor 2.15.0 → 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 (96) hide show
  1. package/README.md +9 -0
  2. package/angular/build-manifest.json +4 -4
  3. package/angular/index.mjs +1 -1
  4. package/index.d.ts +42 -33
  5. package/integrations/shared.js +10 -0
  6. package/package.json +1 -1
  7. package/richtexteditor/all_plugins.js +2062 -1542
  8. package/richtexteditor/all_plugins.min.js +76 -61
  9. package/richtexteditor/lang/rte-lang-de.js +33 -0
  10. package/richtexteditor/lang/rte-lang-es.js +33 -0
  11. package/richtexteditor/lang/rte-lang-fr.js +33 -0
  12. package/richtexteditor/lang/rte-lang-it.js +33 -0
  13. package/richtexteditor/lang/rte-lang-ja.js +33 -0
  14. package/richtexteditor/lang/rte-lang-ko.js +33 -0
  15. package/richtexteditor/lang/rte-lang-nl.js +33 -0
  16. package/richtexteditor/lang/rte-lang-pt-pt.js +33 -0
  17. package/richtexteditor/lang/rte-lang-pt.js +33 -0
  18. package/richtexteditor/lang/rte-lang-ru.js +33 -0
  19. package/richtexteditor/lang/rte-lang-zh-Hans.js +33 -0
  20. package/richtexteditor/lang/rte-lang-zh-Hant.js +33 -0
  21. package/richtexteditor/plugins/a11yenhance.js +3 -1
  22. package/richtexteditor/plugins/a11yenhance.min.js +1 -1
  23. package/richtexteditor/plugins/accessibilitychecker.js +7 -7
  24. package/richtexteditor/plugins/accessibilitychecker.min.js +1 -1
  25. package/richtexteditor/plugins/aitoolkit.js +91 -83
  26. package/richtexteditor/plugins/aitoolkit.min.js +4 -4
  27. package/richtexteditor/plugins/all_plugins.js +2062 -1542
  28. package/richtexteditor/plugins/all_plugins.min.js +76 -61
  29. package/richtexteditor/plugins/autoembed.js +1 -1
  30. package/richtexteditor/plugins/autoembed.min.js +1 -1
  31. package/richtexteditor/plugins/charlimit.js +2 -2
  32. package/richtexteditor/plugins/charlimit.min.js +2 -2
  33. package/richtexteditor/plugins/comments.js +2 -2
  34. package/richtexteditor/plugins/comments.min.js +2 -2
  35. package/richtexteditor/plugins/contentminimap.js +3 -3
  36. package/richtexteditor/plugins/contentminimap.min.js +1 -1
  37. package/richtexteditor/plugins/crdt-engine.js +27 -1
  38. package/richtexteditor/plugins/documentimport.js +30 -8
  39. package/richtexteditor/plugins/documentimport.min.js +4 -4
  40. package/richtexteditor/plugins/docxexport.js +30 -1
  41. package/richtexteditor/plugins/docxexport.min.js +2 -2
  42. package/richtexteditor/plugins/emojiautocomplete.js +1 -1
  43. package/richtexteditor/plugins/emojiautocomplete.min.js +1 -1
  44. package/richtexteditor/plugins/html2pdf.js +7 -7
  45. package/richtexteditor/plugins/html2pdf.min.js +1 -1
  46. package/richtexteditor/plugins/imageeditor.js +19 -6
  47. package/richtexteditor/plugins/imageeditor.min.js +1 -1
  48. package/richtexteditor/plugins/insertcode.js +8 -8
  49. package/richtexteditor/plugins/insertcode.min.js +4 -4
  50. package/richtexteditor/plugins/insertemoji.js +4 -4
  51. package/richtexteditor/plugins/insertemoji.min.js +1 -1
  52. package/richtexteditor/plugins/insertgallery.js +4 -4
  53. package/richtexteditor/plugins/insertgallery.min.js +1 -1
  54. package/richtexteditor/plugins/inserttemplate.js +10 -2
  55. package/richtexteditor/plugins/inserttemplate.min.js +1 -1
  56. package/richtexteditor/plugins/markdownexport.js +1 -1
  57. package/richtexteditor/plugins/markdownexport.min.js +2 -2
  58. package/richtexteditor/plugins/mentionplugin.js +2 -2
  59. package/richtexteditor/plugins/mentionplugin.min.js +1 -1
  60. package/richtexteditor/plugins/mermaiddiagram.js +5 -5
  61. package/richtexteditor/plugins/mermaiddiagram.min.js +2 -2
  62. package/richtexteditor/plugins/nodetypes.js +1 -1
  63. package/richtexteditor/plugins/nodetypes.min.js +1 -1
  64. package/richtexteditor/plugins/pagination.js +2 -2
  65. package/richtexteditor/plugins/pagination.min.js +1 -1
  66. package/richtexteditor/plugins/pdfexport.js +1751 -1366
  67. package/richtexteditor/plugins/pdfexport.min.js +28 -13
  68. package/richtexteditor/plugins/readaloud.js +1 -1
  69. package/richtexteditor/plugins/readaloud.min.js +1 -1
  70. package/richtexteditor/plugins/revisionhistory.js +4 -4
  71. package/richtexteditor/plugins/revisionhistory.min.js +2 -2
  72. package/richtexteditor/plugins/rubyannotation.js +2 -2
  73. package/richtexteditor/plugins/rubyannotation.min.js +1 -1
  74. package/richtexteditor/plugins/sanitizer.js +57 -4
  75. package/richtexteditor/plugins/sanitizer.min.js +1 -1
  76. package/richtexteditor/plugins/slashcommand.js +2 -2
  77. package/richtexteditor/plugins/slashcommand.min.js +2 -2
  78. package/richtexteditor/plugins/smartchips.js +3 -3
  79. package/richtexteditor/plugins/smartchips.min.js +1 -1
  80. package/richtexteditor/plugins/spellcheck.js +3 -3
  81. package/richtexteditor/plugins/spellcheck.min.js +1 -1
  82. package/richtexteditor/plugins/stateinspector.js +2 -2
  83. package/richtexteditor/plugins/stateinspector.min.js +2 -2
  84. package/richtexteditor/plugins/structured-content-bridge.js +34 -8
  85. package/richtexteditor/plugins/structured-content-bridge.min.js +5 -5
  86. package/richtexteditor/plugins/textdirection.js +1 -1
  87. package/richtexteditor/plugins/textdirection.min.js +1 -1
  88. package/richtexteditor/plugins/trackedchanges.js +1 -1
  89. package/richtexteditor/plugins/trackedchanges.min.js +1 -1
  90. package/richtexteditor/plugins/yjscollab.js +2 -2
  91. package/richtexteditor/plugins/yjscollab.min.js +1 -1
  92. package/richtexteditor/rte-config.js +14 -36
  93. package/richtexteditor/rte-watchdog.js +3 -1
  94. package/richtexteditor/rte-webcomponent.js +3 -1
  95. package/richtexteditor/rte.js +16 -38
  96. package/richtexteditor/runtime/colorpicker_more_ns.htm +3 -1
@@ -1,19 +1,34 @@
1
- window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_pdfexport=RTE_Plugin_PdfExport,typeof RTE_DefaultConfig.pdfExport>"u"&&(RTE_DefaultConfig.pdfExport=!0);function RTE_Plugin_PdfExport(){function De(e,t){if(t==="a"||t==="A"){for(var r="",l=e;l>0;l=Math.floor((l-1)/26))r=String.fromCharCode(97+(l-1)%26)+r;return r?t==="A"?r.toUpperCase():r:String(e)}if((t==="i"||t==="I")&&e>0&&e<4e3){for(var a="",s=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],f=["m","cm","d","cd","c","xc","l","xl","x","ix","v","iv","i"],n=0;n<s.length;n++)for(;e>=s[n];)a+=f[n],e-=s[n];return t==="I"?a.toUpperCase():a}return String(e)}var de=this,te,V;de.PluginName="PdfExport",de.InitConfig=function(e){te=e},de.InitEditor=function(e){V=e,te.pdfExport!==!1&&(V.getPdfBytes=function(t){return Le(t||{})},V.exportToPdf=function(t,r){var l=Le(r||{}),a=Ie(t)||Ie(te.pdfExportFileName)||Qe();return Ye(l,a+".pdf")},V.downloadPdf=V.exportToPdf,V.attachEvent("exec_command_exportpdf",function(t){t.returnValue=!0,t.stopBubble=!0;try{V.exportToPdf()}catch(r){window.console&&console.error("pdfexport:",r)}}))};var oe=72,Te={letter:[612,792],legal:[612,1008],tabloid:[792,1224],a3:[842,1191],a4:[595,842],a5:[420,595]};function le(e,t){if(typeof e=="number"&&isFinite(e))return e*oe;if(typeof e!="string")return t;var r=/^\s*(-?[\d.]+)\s*(mm|cm|in|px|pt)?\s*$/.exec(e);if(!r)return t;var l=parseFloat(r[1]);if(!isFinite(l))return t;switch(r[2]){case"mm":return l*oe/25.4;case"cm":return l*oe/2.54;case"pt":return l;case"px":return l*.75;default:return l*oe}}function Be(e){var t=null;try{typeof V.getDocumentPageSetup=="function"&&(t=V.getDocumentPageSetup())}catch{t=null}t=t||{};var r=String(e.format||t.format||"letter").toLowerCase(),l=Te[r]||Te.letter,a=String(e.orientation||t.orientation||"").toLowerCase()==="landscape",s=a?l[1]:l[0],f=a?l[0]:l[1],n=e.margins||t.margins||{},i=oe/2;return{width:s,height:f,margin:{top:le(n.top,i),right:le(n.right,i),bottom:le(n.bottom,i),left:le(n.left,i)}}}var se={helvetica:{css:"Arial, Helvetica, sans-serif",faces:["Helvetica","Helvetica-Bold","Helvetica-Oblique","Helvetica-BoldOblique"]},times:{css:'"Times New Roman", Times, serif',faces:["Times-Roman","Times-Bold","Times-Italic","Times-BoldItalic"]},courier:{css:'"Courier New", Courier, monospace',faces:["Courier","Courier-Bold","Courier-Oblique","Courier-BoldOblique"]}},he=32,ge=255,ye={};function ve(e,t){var r=e+":"+t;if(ye[r])return ye[r];var l=se[e]||se.helvetica,a=ve.canvas||(ve.canvas=document.createElement("canvas")),s=a.getContext("2d"),f=t&1?"bold ":"",n=t&2?"italic ":"";s.font=f+n+"100px "+l.css;for(var i=[],u=he;u<=ge;u++){var o=s.measureText(String.fromCharCode(u)).width;i.push(Math.round(o*10))}return ye[r]=i,i}function Pe(e,t,r){return(r<he||r>ge)&&(r=63),ve(e,t)[r-he]||500}function me(e,t,r,l){for(var a=0,s=0;s<e.length;s++)a+=Pe(t,r,e.charCodeAt(s));return a*l/1e3}var Fe={8364:128,8218:130,402:131,8222:132,8230:133,8224:134,8225:135,710:136,8240:137,352:138,8249:139,338:140,381:142,8216:145,8217:146,8220:147,8221:148,8226:149,8211:150,8212:151,732:152,8482:153,353:154,8250:155,339:156,382:158,376:159};function J(e){for(var t="",r=0;r<e.length;r++){var l=e.charCodeAt(r);if(l<256){t+=String.fromCharCode(l);continue}var a=Fe[l];if(a){t+=String.fromCharCode(a);continue}if(l===160){t+=" ";continue}if(l>=8192&&l<=8202){t+=" ";continue}if(l===8722){t+="-";continue}t+="?"}return t}function K(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function ue(){this.objects=[]}ue.prototype.alloc=function(){return this.objects.push(null),this.objects.length},ue.prototype.set=function(e,t){this.objects[e-1]=t},ue.prototype.add=function(e){var t=this.alloc();return this.set(t,e),t},ue.prototype.build=function(e,t){var r=[],l=0;function a(y){var p=typeof y=="string"?Se(y):y;return r.push(p),l+=p.length,l}a(`%PDF-1.4
2
- `),a(new Uint8Array([37,226,227,207,211,10]));for(var s=[],f=0;f<this.objects.length;f++){s[f]=l,a(f+1+` 0 obj
3
- `);var n=this.objects[f];if(n&&n.stream){var i=typeof n.stream=="string"?Se(n.stream):n.stream;a(n.dict.replace("/Length 0","/Length "+i.length)+`
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_pdfexport=RTE_Plugin_PdfExport,typeof RTE_DefaultConfig.pdfExport>"u"&&(RTE_DefaultConfig.pdfExport=!0);function RTE_Plugin_PdfExport(){function Ve(e,t){if(t==="a"||t==="A"){for(var r="",a=e;a>0;a=Math.floor((a-1)/26))r=String.fromCharCode(97+(a-1)%26)+r;return r?t==="A"?r.toUpperCase():r:String(e)}if((t==="i"||t==="I")&&e>0&&e<4e3){for(var n="",u=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],s=["m","cm","d","cd","c","xc","l","xl","x","ix","v","iv","i"],i=0;i<u.length;i++)for(;e>=u[i];)n+=s[i],e-=u[i];return t==="I"?n.toUpperCase():n}return String(e)}var Ce=this,Y,W;Ce.PluginName="PdfExport",Ce.InitConfig=function(e){Y=e},Ce.InitEditor=function(e){W=e,Y.pdfExport!==!1&&(W.getPdfBytes=function(t){return We(t||{})},W.getPdfUnsupportedText=function(t){return Le(t||{})},W.loadPdfFont=function(t){return fetch(t).then(function(r){if(!r.ok)throw new Error("pdfexport: font "+t+" returned "+r.status);return r.arrayBuffer()}).then(function(r){var a=new Uint8Array(r);return ze(a),Y.pdfExportUnicodeFont=a,!0})},W.exportToPdf=function(t,r){var a=Le(r||{});if(a){var n=Y.pdfExportRasterFallback!==!1&&W.toolbarFactoryMap&&W.toolbarFactoryMap.html2pdf;if(window.console&&console.warn&&console.warn("pdfexport: the vector PDF cannot encode "+a.length+" character(s) of this document ("+a.slice(0,20)+(a.length>20?"...":"")+"); its standard fonts cover Western European Latin only. "+(n?"Exporting with the html2pdf raster export instead.":'They are written as "?". Load the html2pdf plugin for a raster export that keeps them.')),n)return W.execCommand("html2pdf"),null}var u=We(r||{}),s=Ge(t)||Ge(Y.pdfExportFileName)||yt();return bt(u,s+".pdf")},W.downloadPdf=W.exportToPdf,W.attachEvent("exec_command_exportpdf",function(t){t.returnValue=!0,t.stopBubble=!0;try{W.exportToPdf()}catch(r){window.console&&console.error("pdfexport:",r)}}))};var de=72,Me={letter:[612,792],legal:[612,1008],tabloid:[792,1224],a3:[842,1191],a4:[595,842],a5:[420,595]};function pe(e,t){if(typeof e=="number"&&isFinite(e))return e*de;if(typeof e!="string")return t;var r=/^\s*(-?[\d.]+)\s*(mm|cm|in|px|pt)?\s*$/.exec(e);if(!r)return t;var a=parseFloat(r[1]);if(!isFinite(a))return t;switch(r[2]){case"mm":return a*de/25.4;case"cm":return a*de/2.54;case"pt":return a;case"px":return a*.75;default:return a*de}}function Ze(e){var t=null;try{typeof W.getDocumentPageSetup=="function"&&(t=W.getDocumentPageSetup())}catch{t=null}t=t||{};var r=String(e.format||t.format||"letter").toLowerCase(),a=Me[r]||Me.letter,n=String(e.orientation||t.orientation||"").toLowerCase()==="landscape",u=n?a[1]:a[0],s=n?a[0]:a[1],i=e.margins||t.margins||{},l=de/2;return{width:u,height:s,margin:{top:pe(i.top,l),right:pe(i.right,l),bottom:pe(i.bottom,l),left:pe(i.left,l)}}}var ge={helvetica:{css:"Arial, Helvetica, sans-serif",faces:["Helvetica","Helvetica-Bold","Helvetica-Oblique","Helvetica-BoldOblique"]},times:{css:'"Times New Roman", Times, serif',faces:["Times-Roman","Times-Bold","Times-Italic","Times-BoldItalic"]},courier:{css:'"Courier New", Courier, monospace',faces:["Courier","Courier-Bold","Courier-Oblique","Courier-BoldOblique"]}},we=32,Ae=255,Ee={};function Fe(e,t){var r=e+":"+t;if(Ee[r])return Ee[r];var a=ge[e]||ge.helvetica,n=Fe.canvas||(Fe.canvas=document.createElement("canvas")),u=n.getContext("2d"),s=t&1?"bold ":"",i=t&2?"italic ":"";u.font=s+i+"100px "+a.css;for(var l=[],f=we;f<=Ae;f++){var o=u.measureText(String.fromCharCode(f)).width;l.push(Math.round(o*10))}return Ee[r]=l,l}function Qe(e,t,r){return(r<we||r>Ae)&&(r=63),Fe(e,t)[r-we]||500}function Re(e,t,r,a){for(var n=0,u=0;u<e.length;u++)n+=Qe(t,r,e.charCodeAt(u));return n*a/1e3}var K=null,he=[];function _(e,t){return e[t]<<8|e[t+1]}function J(e,t){var r=_(e,t);return r&32768?r-65536:r}function te(e,t){return(e[t]<<24>>>0)+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]}function ze(e){for(var t=e instanceof Uint8Array?e:new Uint8Array(e),r=0;r<he.length;r++)if(he[r].bytes===t)return he[r].font;var a=te(t,0);if(a!==65536&&a!==1953658213)throw new Error(a===1330926671?"pdfexport: the Unicode font has CFF (PostScript) outlines; supply a TrueType (.ttf) font":a===1953784678?"pdfexport: the Unicode font is a collection (.ttc); supply a single .ttf font":"pdfexport: the Unicode font is not a TrueType font");for(var n={},u=_(t,4),s=0;s<u;s++){var i=12+s*16,l=String.fromCharCode(t[i],t[i+1],t[i+2],t[i+3]);n[l]={offset:te(t,i+8),length:te(t,i+12)}}["head","hhea","hmtx","maxp","cmap","loca","glyf"].forEach(function(w){if(!n[w])throw new Error("pdfexport: the Unicode font has no '"+w+"' table")});var f=n.head.offset,o=n.hhea.offset,h={bytes:t,tables:n,units:_(t,f+18),bbox:[J(t,f+36),J(t,f+38),J(t,f+40),J(t,f+42)],longLoca:J(t,f+50)===1,numGlyphs:_(t,n.maxp.offset+4),numHMetrics:_(t,o+34),ascent:J(t,o+4),descent:J(t,o+6),capHeight:0,italicAngle:0};if(n["OS/2"]){var v=n["OS/2"].offset;h.ascent=J(t,v+68),h.descent=J(t,v+70),_(t,v)>=2&&n["OS/2"].length>=90&&(h.capHeight=J(t,v+88))}h.capHeight||(h.capHeight=h.ascent),n.post&&(h.italicAngle=J(t,n.post.offset+4));for(var c=n.cmap.offset,d=null,x=0,p=0,y=_(t,c+2);p<y;p++){var F=_(t,c+4+p*8),R=_(t,c+6+p*8),M=c+te(t,c+8+p*8),C=_(t,M),E=F===0||F===3&&(R===1||R===10);!E||C!==4&&C!==12||C>x&&(d=M,x=C)}if(!d)throw new Error("pdfexport: the Unicode font has no Unicode character map");var m={};return h.gidFor=function(w){if(m[w]!==void 0)return m[w];var A=0;if(x===12)for(var L=te(t,d+12),k=0;k<L;k++){var g=d+16+k*12,q=te(t,g),T=te(t,g+4);if(w>=q&&w<=T){A=te(t,g+8)+(w-q);break}}else if(w<=65535){for(var P=_(t,d+6),O=d+14,j=O+P+2,V=j+P,D=V+P,S=0;S<P/2;S++)if(!(w>_(t,O+S*2))){var N=_(t,j+S*2);if(w<N)break;var $=_(t,D+S*2);if(!$)A=w+J(t,V+S*2)&65535;else{var z=_(t,D+S*2+$+(w-N)*2);A=z?z+J(t,V+S*2)&65535:0}break}}return A>=h.numGlyphs&&(A=0),m[w]=A,A},h.advance=function(w){var A=h.tables.hmtx.offset,L=w<h.numHMetrics?w:h.numHMetrics-1;return _(t,A+L*4)},he.push({bytes:t,font:h}),he.length>4&&he.shift(),h}function Pe(e,t){var r=e.bytes,a=e.tables.loca.offset,n=e.longLoca?te(r,a+t*4):_(r,a+t*2)*2,u=e.longLoca?te(r,a+t*4+4):_(r,a+t*2+2)*2;return[e.tables.glyf.offset+n,u-n]}function Ye(e,t){var r=e.bytes,a={0:!0},n=[];for(var u in t)a[u]=!0,n.push(+u);for(;n.length;){var s=n.pop(),i=Pe(e,s);if(!(i[1]<10||J(r,i[0])>=0))for(var l=i[0]+10,f=!0;f;){var o=_(r,l),h=_(r,l+2);a[h]||(a[h]=!0,n.push(h)),l+=4+(o&1?4:2)+(o&8?2:o&64?4:o&128?8:0),f=!!(o&32)}}var v=[],c=new Uint8Array((e.numGlyphs+1)*4),d=0;function x(D,S,N){D[S]=N>>>24&255,D[S+1]=N>>>16&255,D[S+2]=N>>>8&255,D[S+3]=N&255}for(var p=0;p<e.numGlyphs;p++)if(x(c,p*4,d),!!a[p]){var y=Pe(e,p);if(!(y[1]<=0)){var F=y[1]+3&-4,R=new Uint8Array(F);R.set(r.subarray(y[0],y[0]+y[1])),v.push(R),d+=F}}x(c,e.numGlyphs*4,d);for(var M=new Uint8Array(d),C=0,E=0;E<v.length;E++)M.set(v[E],C),C+=v[E].length;var m={};["head","hhea","hmtx","maxp","cvt ","fpgm","prep"].forEach(function(D){e.tables[D]&&(m[D]=r.slice(e.tables[D].offset,e.tables[D].offset+e.tables[D].length))}),m.head[50]=0,m.head[51]=1,m.head[8]=m.head[9]=m.head[10]=m.head[11]=0,m.loca=c,m.glyf=M;var w=Object.keys(m).sort(),A=w.length,L=12+A*16,k=L;w.forEach(function(D){k+=m[D].length+3&-4});var g=new Uint8Array(k);x(g,0,65536);var q=Math.floor(Math.log(A)/Math.LN2),T=Math.pow(2,q)*16;g[4]=A>>8,g[5]=A&255,g[6]=T>>8,g[7]=T&255,g[8]=q>>8,g[9]=q&255;var P=A*16-T;g[10]=P>>8,g[11]=P&255;function O(D){for(var S=0,N=0;N<D.length;N+=4)S=S+((D[N]<<24>>>0)+((D[N+1]||0)<<16)+((D[N+2]||0)<<8)+(D[N+3]||0))>>>0;return S}var j=L,V=0;return w.forEach(function(D,S){for(var N=12+S*16,$=0;$<4;$++)g[N+$]=D.charCodeAt($);x(g,N+4,O(m[D])),x(g,N+8,j),x(g,N+12,m[D].length),g.set(m[D],j),D==="head"&&(V=j),j+=m[D].length+3&-4}),x(g,V+8,2981146554-O(g)>>>0),g}function me(e){return("000"+e.toString(16).toUpperCase()).slice(-4)}function Je(e){for(var t="",r=0;r<e.length;r++){var a=e.codePointAt(r);a>65535&&r++;var n=K.font.gidFor(a);K.used[n]=a,t+=me(n)}return"<"+t+">"}function Ke(e,t){for(var r=0,a=0;a<e.length;a++){var n=e.codePointAt(a);n>65535&&a++,r+=K.font.advance(K.font.gidFor(n))}return r*t/K.font.units}function Xe(e){return e==="?"||oe(e).indexOf("?")<0}function et(e){return e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519||e>=12288&&e<=12351||e>=131072&&e<=195103}function tt(e){for(var t=[],r=null,a=0;a<e.length;a++){var n=e.codePointAt(a),u=String.fromCodePoint(n);n>65535&&a++;var s=!Xe(u)&&K.font.gidFor(n)!==0;if(s&&et(n)){r=null,t.push({text:u,uni:!0});continue}(!r||r.uni!==s)&&(r={text:"",uni:s},t.push(r)),r.text+=u}return t}var rt={8364:128,8218:130,402:131,8222:132,8230:133,8224:134,8225:135,710:136,8240:137,352:138,8249:139,338:140,381:142,8216:145,8217:146,8220:147,8221:148,8226:149,8211:150,8212:151,732:152,8482:153,353:154,8250:155,339:156,382:158,376:159};function oe(e){for(var t="",r=0;r<e.length;r++){var a=e.charCodeAt(r);if(a<256){t+=String.fromCharCode(a);continue}var n=rt[a];if(n){t+=String.fromCharCode(n);continue}if(a===160){t+=" ";continue}if(a>=8192&&a<=8202){t+=" ";continue}if(a===8722){t+="-";continue}a>=8203&&a<=8207||a===8288||a===65279||(t+="?")}return t}function Le(e,t){var r="";try{var a=document.createElement("div");a.innerHTML=__RTE_TT(W.getHTMLCode()||""),r=a.textContent||""}catch{r=""}r+=" "+(e.title||Y.pdfExportTitle||"")+" "+(e.headerText||Y.pdfExportHeader||"")+" "+(e.footerText||Y.pdfExportFooter||"");for(var n={},u="",s=t?null:He(e),i=0;i<r.length;i++){var l=r.charAt(i),f=r.charCodeAt(i);f>=55296&&f<=56319&&i+1<r.length&&(l=r.substr(i,2),i++),!(n[l]||l==="?")&&oe(l).indexOf("?")>=0&&!(s&&s.gidFor(l.codePointAt(0)))&&(n[l]=1,u+=l)}return u}function le(e){var t=String(e??""),r=oe(t);if(r.indexOf("?")<0||r.split("?").length===t.split("?").length)return"("+ce(r)+")";for(var a="<FEFF",n=0;n<t.length;n++)a+=("000"+t.charCodeAt(n).toString(16).toUpperCase()).slice(-4);return a+">"}function nt(e){return String(e||"").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g,function(t){try{return encodeURIComponent(t)}catch{return""}})}function ce(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function xe(){this.objects=[]}xe.prototype.alloc=function(){return this.objects.push(null),this.objects.length},xe.prototype.set=function(e,t){this.objects[e-1]=t},xe.prototype.add=function(e){var t=this.alloc();return this.set(t,e),t},xe.prototype.build=function(e,t){var r=[],a=0;function n(x){var p=typeof x=="string"?Be(x):x;return r.push(p),a+=p.length,a}n(`%PDF-1.4
2
+ `),n(new Uint8Array([37,226,227,207,211,10]));for(var u=[],s=0;s<this.objects.length;s++){u[s]=a,n(s+1+` 0 obj
3
+ `);var i=this.objects[s];if(i&&i.stream){var l=typeof i.stream=="string"?Be(i.stream):i.stream;n(i.dict.replace("/Length 0","/Length "+l.length)+`
4
4
  stream
5
- `),a(i),a(`
5
+ `),n(l),n(`
6
6
  endstream
7
- `)}else a(n+`
8
- `);a(`endobj
9
- `)}for(var u=l,o=`xref
7
+ `)}else n(i+`
8
+ `);n(`endobj
9
+ `)}for(var f=a,o=`xref
10
10
  0 `+(this.objects.length+1)+`
11
11
  0000000000 65535 f
12
- `,v=0;v<s.length;v++)o+=Me(s[v])+` 00000 n
13
- `;a(o),a(`trailer
12
+ `,h=0;h<u.length;h++)o+=at(u[h])+` 00000 n
13
+ `;n(o),n(`trailer
14
14
  << /Size `+(this.objects.length+1)+" /Root "+e+" 0 R /Info "+t+` 0 R >>
15
- `),a(`startxref
16
- `+u+`
15
+ `),n(`startxref
16
+ `+f+`
17
17
  %%EOF
18
- `);for(var c=new Uint8Array(l),h=0,d=0;d<r.length;d++)c.set(r[d],h),h+=r[d].length;return c};function Me(e){for(var t=String(e);t.length<10;)t="0"+t;return t}function Se(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r)&255;return t}function ae(e,t){var r={bold:t.bold,italic:t.italic,underline:t.underline,strike:t.strike,size:t.size,color:t.color,mono:t.mono,link:t.link,lang:t.lang},l=e.getAttribute?e.getAttribute("lang"):"";l&&(r.lang=l);var a=e.tagName?e.tagName.toLowerCase():"";(a==="b"||a==="strong")&&(r.bold=!0),(a==="i"||a==="em")&&(r.italic=!0),(a==="u"||a==="ins")&&(r.underline=!0),(a==="s"||a==="strike"||a==="del")&&(r.strike=!0),(a==="code"||a==="kbd"||a==="samp"||a==="pre")&&(r.mono=!0),a==="a"&&e.getAttribute("href")&&(r.link=e.getAttribute("href"),r.color=[0,.33,.8],r.underline=!0),(a==="sup"||a==="sub")&&(r.size=r.size*.75);var s=e.style;if(s){if(/bold|^[6-9]00$/.test(s.fontWeight||"")&&(r.bold=!0),(s.fontStyle==="italic"||s.fontStyle==="oblique")&&(r.italic=!0),(s.textDecorationLine||s.textDecoration||"").indexOf("underline")>=0&&(r.underline=!0),(s.textDecorationLine||s.textDecoration||"").indexOf("line-through")>=0&&(r.strike=!0),s.color){var f=Oe(s.color);f&&(r.color=f)}if(s.fontSize){var n=le(s.fontSize,null);n&&(r.size=n)}}return r}function Oe(e){var t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.replace(/\s/g,""));if(t){var r=t[1];return r.length===3&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]),[parseInt(r.substr(0,2),16)/255,parseInt(r.substr(2,2),16)/255,parseInt(r.substr(4,2),16)/255]}var l=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);return l?[l[1]/255,l[2]/255,l[3]/255]:null}var ie={h1:2,h2:1.6,h3:1.35,h4:1.15,h5:1,h6:.9};function fe(e,t,r){this.geom=e,this.baseSize=t,this.family=r,this.contentWidth=e.width-e.margin.left-e.margin.right,this.blocks=[]}fe.prototype.runsOf=function(e,t){var r=[],l=this;return(function a(s,f){for(var n=0;n<s.childNodes.length;n++){var i=s.childNodes[n];if(i.nodeType===3){var u=(i.nodeValue||"").replace(/\s+/g," ");u&&r.push({text:u,style:f});continue}if(i.nodeType===1){var o=i.tagName.toLowerCase();if(o==="br"){r.push({br:!0,style:f});continue}if(o==="img"){r.push({img:i,style:f});continue}o==="script"||o==="style"||a(i,ae(i,f))}}})(e,t),r},fe.prototype.wrap=function(e,t,r){var l=[],a=[],s=0,f=this,n=this.baseSize;function i(){for(;a.length&&/^\s+$/.test(a[a.length-1].text||"");)a.pop();l.push({parts:a,width:s,size:n}),a=[],s=0,n=f.baseSize}for(var u=0;u<e.length;u++){var o=e[u];if(o.br){i();continue}if(o.img){var v=xe(o.img,t);a.length&&i(),l.push({parts:[{img:o.img,w:v.w,h:v.h,style:o.style}],width:v.w,size:v.h,image:!0});continue}for(var c=(o.style.bold?1:0)|(o.style.italic?2:0),h=o.style.mono?"courier":this.family,d=o.text.split(/(\s+)/),y=0;y<d.length;y++){var p=d[y];if(p){var g=me(J(p),h,c,o.style.size);s+g>t&&a.length&&!/^\s+$/.test(p)&&(i(),/^\s+$/.test(p))||(a.push({text:p,style:o.style,family:h,styleIndex:c,w:g}),s+=g,o.style.size>n&&(n=o.style.size))}}}a.length&&i(),l.length||l.push({parts:[],width:0,size:this.baseSize});for(var b=0;b<l.length;b++)l[b].height=l[b].image?l[b].size:l[b].size*r;return l};function xe(e,t){var r=e.naturalWidth||e.width||0,l=e.naturalHeight||e.height||0;if(!r||!l)return{w:0,h:0};var a=r*.75,s=l*.75;return a>t&&(s=s*t/a,a=t),{w:a,h:s}}fe.prototype.run=function(e){var t=this,r={bold:!1,italic:!1,underline:!1,strike:!1,size:this.baseSize,color:[0,0,0],mono:!1,link:null};function l(i){if(!i||!i.style)return 0;var u=i.style.marginLeft||i.style.paddingLeft||"",o=/^\s*(-?[\d.]+)\s*([a-z%]*)\s*$/i.exec(u);if(!o)return 0;var v=parseFloat(o[1]);if(!v||v<=0)return 0;var c=(o[2]||"px").toLowerCase(),h=c==="px"?v:c==="pt"?v*(4/3):c==="in"?v*96:c==="cm"?v*37.795:c==="mm"?v*3.7795:c==="em"||c==="rem"?v*16:0;return h*.75}function a(i){for(var u=i;u&&u.nodeType===1&&u.tagName.toLowerCase()!=="body";u=u.parentNode)if(u.getAttribute("lang"))return u.getAttribute("lang");for(var o=null,v=i.childNodes,c=0;c<v.length;c++){if(v[c].nodeType===3&&v[c].nodeValue.replace(/[\s\u200b\u00a0]/g,""))return"";if(v[c].nodeType===1){if(o)return"";o=v[c]}}return o&&o.getAttribute("lang")?o.getAttribute("lang"):""}function s(i,u,o,v,c,h,d){var y=i.tagName.toLowerCase(),p=ae(i,u),g="left",b=i.style&&i.style.textAlign||"";(b==="center"||b==="right"||b==="justify")&&(g=b),ie[y]&&(p.size=t.baseSize*ie[y],p.bold=!0),y==="pre"&&(p.mono=!0);var k=t.contentWidth-o,D=t.runsOf(i,p),T=t.wrap(D,k,y==="pre"?1.25:1.4);t.blocks.push({type:"text",lines:T,indent:o,align:g,lang:a(i),spaceBefore:ie[y]?p.size*.6:t.baseSize*.35,spaceAfter:ie[y]?p.size*.3:t.baseSize*.35,marker:v||null,markerStyle:p,keepWithNext:!!ie[y],rule:y==="blockquote"?"quote":null,role:d||(ie[y]?"H"+y.charAt(1):y==="blockquote"?"BlockQuote":"P"),listId:c||null,listOrdered:!!h})}function f(i,u,o,v){for(var c=0;c<i.childNodes.length;c++){var h=i.childNodes[c];if(h.nodeType===3){if(!(h.nodeValue||"").trim())continue;t.blocks.push({type:"text",lines:t.wrap([{text:h.nodeValue.replace(/\s+/g," "),style:u}],t.contentWidth-o,1.4),indent:o,align:"left",spaceBefore:0,spaceAfter:t.baseSize*.35});continue}if(h.nodeType===1){var d=h.tagName.toLowerCase();if(!(d==="script"||d==="style"||d==="noscript")){if(h.getAttribute&&h.getAttribute("data-rte-page-break")!==null){t.blocks.push({type:"pagebreak"});continue}if(h.style&&/always|page/.test(h.style.pageBreakBefore||h.style.breakBefore||"")&&t.blocks.push({type:"pagebreak"}),d==="hr"){t.blocks.push({type:"rule",indent:o});continue}if(d==="ul"||d==="ol"){var y=parseInt(h.getAttribute("start"),10);isNaN(y)&&(y=1);for(var p=String(h.style&&h.style.listStyleType||"").toLowerCase(),g=h.getAttribute("type")||"",b=/^(lower-alpha|lower-latin)$/.test(p)||g==="a"?"a":/^(upper-alpha|upper-latin)$/.test(p)||g==="A"?"A":p==="lower-roman"||g==="i"?"i":p==="upper-roman"||g==="I"?"I":"1",k="L"+(t.listSeq=(t.listSeq||0)+1),D=0;D<h.childNodes.length;D++){var T=h.childNodes[D];if(!(T.nodeType!==1||T.tagName.toLowerCase()!=="li")){var z=d==="ol"?De(y++,b)+".":"\u2022";h.classList&&h.classList.contains("rte-task-list")&&(z=T.getAttribute("data-checked")==="true"?"[x]":"[ ]"),s(T,ae(T,u),o+t.baseSize*1.6,z,k,d==="ol"),n(T,ae(T,u),o+t.baseSize*1.6)}}continue}if(d==="table"){t.table(h,ae(h,u),o);continue}if(d==="img"){var x=xe(h,t.contentWidth-o);x.w&&t.blocks.push({type:"text",role:"Figure",alt:h.getAttribute("alt")||"",lines:[{parts:[{img:h,w:x.w,h:x.h,style:u}],width:x.w,size:x.h,height:x.h,image:!0}],indent:o,align:"left",spaceBefore:4,spaceAfter:4});continue}if(Ce(d)){var A=(d==="blockquote"?t.baseSize*1.5:0)+l(h),E=d==="blockquote"?"BlockQuote":v,C=h.getElementsByTagName("img");if(C.length===1&&!(h.textContent||"").replace(/[\s\u200b\u00a0]/g,"")&&!Ae(h)){var N=xe(C[0],t.contentWidth-o-A);if(N.w){var w=String(h.style&&h.style.textAlign||"").toLowerCase();t.blocks.push({type:"text",role:"Figure",alt:C[0].getAttribute("alt")||"",lines:[{parts:[{img:C[0],w:N.w,h:N.h,style:u}],width:N.w,size:N.h,height:N.h,image:!0}],indent:o+A,align:w==="center"||w==="right"?w:"left",spaceBefore:4,spaceAfter:4});continue}}if(Ae(h)){f(h,ae(h,u),o+A,E);continue}s(h,u,o+A,null,null,!1,E);continue}s(h,u,o,null)}}}}function n(i,u,o){for(var v=0;v<i.childNodes.length;v++){var c=i.childNodes[v];if(c.nodeType===1){var h=c.tagName.toLowerCase();(h==="ul"||h==="ol")&&f({childNodes:[c]},u,o)}}}return f(e,r,0),this.blocks};function Ce(e){return/^(p|div|h[1-6]|blockquote|pre|section|article|header|footer|main|aside|figure|figcaption|dl|dd|dt|li|address)$/.test(e)}function Ae(e){for(var t=0;t<e.childNodes.length;t++){var r=e.childNodes[t];if(r.nodeType===1&&(Ce(r.tagName.toLowerCase())||/^(ul|ol|table|hr)$/.test(r.tagName.toLowerCase())))return!0}return!1}fe.prototype.table=function(e,t,r){for(var l=this,a=[],s=e.getElementsByTagName("tr"),f=0,n={},i=0;i<s.length;i++){for(var u=[],o=0;o<s[i].childNodes.length;o++){var v=s[i].childNodes[o];if(v.nodeType===1){var c=v.tagName.toLowerCase();if(!(c!=="td"&&c!=="th")){var h=Math.max(1,Math.min(50,parseInt(v.getAttribute("colspan"),10)||1)),d=Math.max(1,Math.min(500,parseInt(v.getAttribute("rowspan"),10)||1));u.push({node:v,header:c==="th",span:h,rowspan:d})}}}for(var y=[],p=0,g=0;g<u.length;g++){for(;n[p]>0;)y.push({placeholder:!0,start:p,span:1,header:!1}),p++;if(u[g].start=p,y.push(u[g]),u[g].rowspan>1)for(var b=p;b<p+u[g].span;b++)n[b]=u[g].rowspan;p+=u[g].span}for(var k in n)+k>=p&&n[k]>0&&(y.push({placeholder:!0,start:+k,span:1,header:!1}),+k+1>p&&(p=+k+1));for(var D in n)n[D]--,n[D]<=0&&delete n[D];y.sort(function(H,re){return H.start-re.start}),u=u.length?y:u,u.length&&(a.push(u),p>f&&(f=p))}if(!a.length)return;for(var T=this.contentWidth-r,z=T/f,x=[],A=[],E=0,C=0;C<e.children.length;C++)if(e.children[C].tagName&&e.children[C].tagName.toLowerCase()==="colgroup")for(var N=0;N<e.children[C].children.length;N++)e.children[C].children[N].tagName.toLowerCase()==="col"&&A.push(e.children[C].children[N]);if(A.length===f){for(var w=0;w<A.length;w++){var M=A[w].style&&A[w].style.width||A[w].getAttribute("width")||"",R=/^\s*([\d.]+)(%|px)?\s*$/.exec(M);if(!R||!(parseFloat(R[1])>0)){x=[];break}x.push(parseFloat(R[1]))}for(var U=0;U<x.length;U++)E+=x[U];E>0&&(x=x.map(function(H){return H/E*T}))}if(x.length!==f){x=[];for(var B=0;B<f;B++)x.push(z)}function Z(H,re){for(var F=0,ee=H;ee<H+re&&ee<x.length;ee++)F+=x[ee];return F}for(var Q=4,$=[],I=0;I<a.length;I++){for(var X=[],q=0,P=0;P<a[I].length;P++){if(a[I][P].placeholder){X.push({lines:[],header:!1,start:a[I][P].start,span:1,placeholder:!0});continue}var S=ae(a[I][P].node,t);a[I][P].header&&(S.bold=!0);for(var L=l.wrap(l.runsOf(a[I][P].node,S),Z(a[I][P].start,a[I][P].span)-Q*2,1.35),W=0,G=0;G<L.length;G++)W+=L[G].height;W>q&&(q=W),X.push({lines:L,header:a[I][P].header,start:a[I][P].start,span:a[I][P].span,rowspan:a[I][P].rowspan||1})}$.push({cells:X,height:q+Q*2,header:a[I][0]&&!a[I][0].placeholder&&a[I][0].header})}this.blocks.push({type:"table",rows:$,colWidth:z,colWidths:x,cols:f,indent:r,pad:Q,spaceBefore:this.baseSize*.5,spaceAfter:this.baseSize*.5})};var we="en";function Le(e){we=String(e&&e.lang||document.documentElement.lang||"en").toLowerCase();var t=String(e.font||te.pdfExportFont||"helvetica").toLowerCase();se[t]||(t="helvetica");var r=Number(e.fontSize||te.pdfExportBaseFontSize||11);(!isFinite(r)||r<=0)&&(r=11);var l=Be(e),a=document.createElement("div");a.innerHTML=V.getHTMLCode()||"";var s=V.getEditable().querySelectorAll("ol,ul"),f=a.querySelectorAll("ol,ul");if(s.length===f.length)for(var n=0;n<s.length;n++){var i=s[n].ownerDocument.defaultView.getComputedStyle(s[n]).listStyleType;i&&(f[n].style.listStyleType=i)}var u=new fe(l,r,t),o=u.run(a),v=We(o,l,r);return _e(v,l,t,r,e)}function We(e,t,r){var l=t.height-t.margin.top,a=t.margin.bottom,s=[],f=[],n=l;function i(){s.push(f),f=[],n=l}for(var u=0;u<e.length;u++){var o=e[u];if(o.type==="pagebreak"){f.length&&i();continue}if(o.type==="rule"){n-r<a&&i(),n-=r*.6,f.push({op:"rule",y:n,indent:o.indent}),n-=r*.6;continue}if(o.type==="table"){n-=o.spaceBefore;for(var v=0;v<o.rows.length;v++){var c=o.rows[v];n-c.height<a&&(i(),o.rows[0]&&o.rows[0].header&&v>0&&(f.push({op:"row",row:o.rows[0],y:n,block:o}),n-=o.rows[0].height)),f.push({op:"row",row:c,y:n,block:o}),n-=c.height}n-=o.spaceAfter;continue}n-=o.spaceBefore;for(var h=0;h<o.lines.length;h++){var d=o.lines[h];n-d.height<a&&i(),f.push({op:"line",line:d,y:n,block:o,first:h===0}),n-=d.height}if(n-=o.spaceAfter,o.keepWithNext&&f.length&&e[u+1]&&e[u+1].type!=="pagebreak"){var y=He(e[u+1]);if(n-y<a){for(var p=[];f.length&&f[f.length-1].block===o;)p.unshift(f.pop());if(f.length){i();for(var g=0;g<p.length;g++)p[g].y=n,f.push(p[g]),n-=p[g].line.height}else for(var b=0;b<p.length;b++)f.push(p[b])}}}return(f.length||!s.length)&&s.push(f),s}function He(e){return e.type==="table"?e.rows[0]?e.rows[0].height:0:e.lines&&e.lines[0]?e.lines[0].height:0}function _e(e,t,r,l,a){var s=new ue,f=se[r],n=se.courier,i={},u=[];function o(O,j,_,Y){var ne=ve(j,_),pe=s.add("<< /Type /Font /Subtype /Type1 /BaseFont /"+O+" /Encoding /WinAnsiEncoding /FirstChar "+he+" /LastChar "+ge+" /Widths ["+ne.join(" ")+"] >>");i[Y]=pe,u.push("/"+Y+" "+pe+" 0 R")}for(var v=0;v<4;v++)o(f.faces[v],r,v,"F"+v),o(n.faces[v],"courier",v,"M"+v);var c={},h=[];function d(O){var j=O.getAttribute("src")||"";if(c[j])return c[j];var _=Ze(O);if(!_)return null;var Y=s.add({dict:"<< /Type /XObject /Subtype /Image /Width "+_.width+" /Height "+_.height+" /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length 0 >>",stream:_.bytes}),ne="Im"+(h.length+1);return c[j]={id:Y,alias:ne},h.push("/"+ne+" "+Y+" 0 R"),c[j]}for(var y=[],p=[],g=[],b=0;b<e.length;b++)y.push(s.alloc()),p.push(s.alloc()),g.push([]);for(var k=s.alloc(),D=[],T=[],z=[],x=0;x<e.length;x++){for(var A=new ce(x),E=Ue(e[x],t,r,l,d,x+1,e.length,a,A),C=0;C<(E.headings||[]).length;C++)E.headings[C].page=x,T.push(E.headings[C]);s.set(p[x],{dict:"<< /Length 0 >>",stream:E.content}),D.push(E.marks);for(var N=0;N<E.links.length;N++){var w=E.links[N],M=e.length+z.length,R=s.add("<< /Type /Annot /Subtype /Link /Rect ["+m(w.x0)+" "+m(w.y0)+" "+m(w.x1)+" "+m(w.y1)+"] /Border [0 0 0] /StructParent "+M+" /Contents ("+K(J(String(w.text||w.href).replace(/\s+/g," ").trim()||w.href))+") /A << /S /URI /URI ("+K(J(w.href))+") >> >>");g[x].push(R),z.push({id:R,page:x,key:M,owner:w.owner})}}for(var U=$e(s,D,y,z),B=0;B<e.length;B++)s.set(y[B],"<< /Type /Page /Parent "+k+" 0 R /MediaBox [0 0 "+m(t.width)+" "+m(t.height)+"] /Resources << /Font << "+u.join(" ")+" >>"+(h.length?" /XObject << "+h.join(" ")+" >>":"")+" >> /Contents "+p[B]+" 0 R /StructParents "+B+(g[B].length?" /Annots ["+g[B].map(function(O){return O+" 0 R"}).join(" ")+"] /Tabs /S":"")+" >>");s.set(k,"<< /Type /Pages /Count "+e.length+" /Kids ["+y.map(function(O){return O+" 0 R"}).join(" ")+"] >>");var Z=0;if(T.length){Z=s.alloc();for(var Q={id:Z,kids:[]},$=[Q],I=[],X=0;X<T.length;X++){for(var q={h:T[X],id:s.alloc(),kids:[],parent:null};$.length>1&&$[$.length-1].h.level>=q.h.level;)$.pop();q.parent=$[$.length-1],q.parent.kids.push(q),$.push(q),I.push(q)}for(var P=function(O){for(var j=O.kids.length,_=0;_<O.kids.length;_++)j+=P(O.kids[_]);return j},S=0;S<I.length;S++){var L=I[S],W=L.parent.kids,G=W.indexOf(L);s.set(L.id,"<< /Title ("+K(J(L.h.title))+") /Parent "+L.parent.id+" 0 R"+(G>0?" /Prev "+W[G-1].id+" 0 R":"")+(G<W.length-1?" /Next "+W[G+1].id+" 0 R":"")+(L.kids.length?" /First "+L.kids[0].id+" 0 R /Last "+L.kids[L.kids.length-1].id+" 0 R /Count "+P(L):"")+" /Dest ["+y[L.h.page]+" 0 R /XYZ null "+m(L.h.y)+" null] >>")}s.set(Z,"<< /Type /Outlines /First "+Q.kids[0].id+" 0 R /Last "+Q.kids[Q.kids.length-1].id+" 0 R /Count "+P(Q)+" >>")}var H=a.title||te.pdfExportTitle||document.title||"Document",re=a.author||te.pdfExportAuthor||"",F=s.add("<< /Type /Catalog /Pages "+k+" 0 R /Lang ("+K(String(a.lang||document.documentElement.lang||"en"))+") /MarkInfo << /Marked true >>"+(Z?" /Outlines "+Z+" 0 R":"")+" /StructTreeRoot "+U.rootId+" 0 R /ViewerPreferences << /DisplayDocTitle true >> >>"),ee=s.add("<< /Title ("+K(J(String(H)))+")"+(re?" /Author ("+K(J(String(re)))+")":"")+" /Producer (RichTextEditor) /Creator (RichTextEditor) /CreationDate ("+je(new Date)+") >>");return s.build(F,ee)}function $e(e,t,r,l){var a=e.alloc(),s=[],f=[];function n(S,L){var W={id:e.alloc(),role:S,kids:[],extra:L||"",children:[],parent:null,seq:[]};return s.push(W),W}for(var i=n("Document"),u=new Map,o=new Map,v=new Map,c=new Map,h=new Map,d=new Map,y=new Map,p=new Map,g=0;g<t.length;g++){var b=t[g];f[g]=[];for(var k=0;k<b.length;k++){var D=b[k].owner,T=b[k].mcid,z=N(D);z.kids.push({page:g,mcid:T}),z.seq.push({mcr:{page:g,mcid:T}}),f[g][T]=z.id}}function x(S,L){L.parent||(L.parent=S,S.children.push(L),S.seq.push({elem:L}))}for(var A=[],E=0;E<(l||[]).length;E++){var C;l[E].owner&&l[E].owner.kind==="link"?C=N(l[E].owner):(C=n("Link"),x(N(l[E].owner),C)),C.objr=l[E],A.push(l[E].key+" "+C.id+" 0 R")}function N(S){if(S.kind==="link"){var L=p.get(S);return L||(L=n("Link"),p.set(S,L),x(N(S.parent),L)),L}if(S.kind==="cell"){var W=h.get(S.block);W||(W=n("Table"),h.set(S.block,W),x(i,W));var G=d.get(S.row);G||(G=n("TR"),d.set(S.row,G),x(W,G));var H=y.get(S.row);if(H||(H={},y.set(S.row,H)),!H[S.col]){var re=(S.header?" /Scope /Column":"")+(S.span>1?" /ColSpan "+S.span:"")+(S.rowspan>1?" /RowSpan "+S.rowspan:"");H[S.col]=n(S.header?"TH":"TD",re?" /A << /O /Table"+re+" >>":""),x(G,H[S.col])}return H[S.col]}var F=S.block,ee=i;if(F.listId){var O=u.get(F.listId);O||(O=n("L"),u.set(F.listId,O),x(i,O));var j=o.get(F);j||(j=n("LI"),o.set(F,j),x(O,j)),ee=j}if(S.kind==="lbl"){var _=v.get(F);return _||(_=n("Lbl"),v.set(F,_),x(ee,_)),_}var Y=c.get(F);if(!Y){if(F.listId)Y=n("LBody");else{var ne=F.role==="Figure"?" /Alt ("+K(J(F.alt||"Image"))+")":"",pe=we,be=String(F.lang||"").replace(/[^A-Za-z0-9-]/g,"");be&&be.toLowerCase()!==pe&&(ne+=" /Lang ("+be+")"),Y=n(F.role||"P",ne)}c.set(F,Y),x(ee,Y)}return Y}for(var w=0;w<s.length;w++){for(var M=s[w],R=[],U=0;U<M.seq.length;U++){var B=M.seq[U];B.elem?R.push(B.elem.id+" 0 R"):R.push("<< /Type /MCR /Pg "+r[B.mcr.page]+" 0 R /MCID "+B.mcr.mcid+" >>")}M.objr&&R.push("<< /Type /OBJR /Obj "+M.objr.id+" 0 R /Pg "+r[M.objr.page]+" 0 R >>");var Z=M.parent?M.parent.id:a;e.set(M.id,"<< /Type /StructElem /S /"+M.role+" /P "+Z+" 0 R"+M.extra+(R.length?" /K ["+R.join(" ")+"]":"")+" >>")}for(var Q=[],$=0;$<f.length;$++){for(var I=f[$]||[],X=[],q=0;q<I.length;q++)X.push((I[q]||i.id)+" 0 R");Q.push($+" ["+X.join(" ")+"]")}var P=e.add("<< /Nums ["+Q.concat(A).join(" ")+"] >>");return e.set(a,"<< /Type /StructTreeRoot /K ["+i.id+" 0 R] /ParentTree "+P+" 0 R /ParentTreeNextKey "+(f.length+A.length)+" >>"),{rootId:a}}function je(e){function t(r){return(r<10?"0":"")+r}return"D:"+e.getFullYear()+t(e.getMonth()+1)+t(e.getDate())+t(e.getHours())+t(e.getMinutes())+t(e.getSeconds())+"Z"}function m(e){return(Math.round(e*100)/100).toString()}function ce(e){this.pageIndex=e,this.next=0,this.marks=[]}ce.prototype.open=function(e,t,r){var l=this.next++;return this.marks.push({owner:r,mcid:l,role:t}),e.push("/"+t+" << /MCID "+l+" >> BDC"),l},ce.prototype.close=function(e){e.push("EMC")},ce.prototype.artifact=function(e,t){e.push("/Artifact BMC"),t(),e.push("EMC")};function Ue(e,t,r,l,a,s,f,n,i){for(var u=[],o=[],v=[],c=t.margin.left,h=0;h<e.length;h++){var d=e[h];if(d.op==="line"&&d.first&&d.block&&/^H[1-6]$/.test(d.block.role||"")){var y=(d.block.lines||[]).map(function(g){return(g.parts||[]).map(function(b){return b.text||""}).join("")}).join(" ").replace(/\s+/g," ").trim();y&&v.push({level:+d.block.role.charAt(1),title:y,y:d.y})}if(d.op==="rule"){i.artifact(u,function(){u.push("0.8 0.8 0.8 RG 0.5 w "+m(c+d.indent)+" "+m(d.y)+" m "+m(t.width-t.margin.right)+" "+m(d.y)+" l S")});continue}if(d.op==="row"){Ve(d,t,u,c,a,o,i);continue}ze(d,t,u,c,r,a,o,i)}var p=qe(n);return(p.header||p.footer)&&i.artifact(u,function(){p.header&&ke(u,p.header,t,t.height-t.margin.top*.55,r,l*.85,s,f),p.footer&&ke(u,p.footer,t,t.margin.bottom*.55,r,l*.85,s,f)}),{content:u.join(`
19
- `),links:o,marks:i.marks,headings:v}}function qe(e){var t=null;try{typeof V.getDocumentPageSetup=="function"&&(t=V.getDocumentPageSetup())}catch{}return t=t||{},{header:e.headerText||te.pdfExportHeader||Re(t.headerHtml)||"",footer:e.footerText||te.pdfExportFooter||Re(t.footerHtml)||""}}function Re(e){if(!e||typeof e!="string")return"";var t=document.createElement("div");return t.innerHTML=e,(t.textContent||"").replace(/\s+/g," ").trim()}function ke(e,t,r,l,a,s,f,n){var i=String(t).replace(/\{page\}/g,f).replace(/\{total\}/g,n),u=J(i),o=me(u,a,0,s),v=(r.width-o)/2;e.push("BT /F0 "+m(s)+" Tf 0.4 0.4 0.4 rg "+m(v)+" "+m(l)+" Td ("+K(u)+") Tj ET")}function ze(e,t,r,l,a,s,f,n){var i=e.line,u=e.block,o=l+(u.indent||0),v=t.width-t.margin.right-o;if(u.align==="center"?o+=(v-i.width)/2:u.align==="right"&&(o+=v-i.width),u.rule==="quote"&&!i.image){var c=m(l+u.indent-8),h=function(){r.push("0.8 0.8 0.85 RG 2 w "+c+" "+m(e.y-i.height+4)+" m "+c+" "+m(e.y+i.size*.8)+" l S")};n?n.artifact(r,h):h()}if(e.first&&u.marker){var d=u.markerStyle||{size:i.size,color:[0,0,0]},y=me(u.marker,a,0,d.size);n&&n.open(r,"Lbl",{kind:"lbl",block:u}),r.push("BT /F0 "+m(d.size)+" Tf "+Ee(d.color)+" "+m(o-y-6)+" "+m(e.y-i.size*.85)+" Td ("+K(J(u.marker))+") Tj ET"),n&&n.close(r)}var p=e.cell||{kind:"body",block:u},g=!1;n&&(n.open(r,i.image?"Figure":"Span",p),g=!0);for(var b=[],k=o,D=0;D<i.parts.length;D++){var T=i.parts[D];if(T.img){b.push({img:T,x:k,w:T.w}),k+=T.w;continue}var z=T.style,x=(z.mono?"M":"F")+T.styleIndex,A=b.length?b[b.length-1]:null,E=A&&!A.img&&A.alias===x&&A.style.size===z.size&&Ge(A.style.color,z.color)&&A.style.underline===z.underline&&A.style.strike===z.strike&&A.style.link===z.link&&(A.style.lang||"")===(z.lang||"");E?(A.text+=T.text,A.w+=T.w):b.push({text:T.text,style:z,alias:x,x:k,w:T.w}),k+=T.w}for(var C=e.y-i.size*.85,N=0;N<b.length;N++){var w=b[N];if(w.img){var M=s(w.img.img);M&&r.push("q "+m(w.w)+" 0 0 "+m(w.img.h)+" "+m(w.x)+" "+m(e.y-w.img.h)+" cm /"+M.alias+" Do Q");continue}if(!(!w.text||/^\s+$/.test(w.text))){var R=w.style,U=null;n&&!i.image&&R.link?(g&&(n.close(r),g=!1),U={kind:"link",parent:p},n.open(r,"Span",U)):n&&!g&&(n.open(r,"Span",p),g=!0);var B=String(R.lang||"").replace(/[^A-Za-z0-9-]/g,""),Z=B&&B.toLowerCase()!==String(u.lang||we||"").toLowerCase();Z&&r.push("/Span << /Lang ("+B+") >> BDC"),r.push("BT /"+w.alias+" "+m(R.size)+" Tf "+Ee(R.color)+" "+m(w.x)+" "+m(C)+" Td ("+K(J(w.text))+") Tj ET"),Z&&r.push("EMC"),R.underline&&r.push(Ne(R.color)+" 0.5 w "+m(w.x)+" "+m(C-R.size*.12)+" m "+m(w.x+w.w)+" "+m(C-R.size*.12)+" l S"),R.strike&&r.push(Ne(R.color)+" 0.5 w "+m(w.x)+" "+m(C+R.size*.28)+" m "+m(w.x+w.w)+" "+m(C+R.size*.28)+" l S"),R.link&&f.push({href:R.link,x0:w.x,y0:C-2,x1:w.x+w.w,y1:C+R.size,text:w.text||"",owner:U||p}),U&&n.close(r)}}n&&g&&n.close(r)}function Ge(e,t){return e=e||[0,0,0],t=t||[0,0,0],e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ve(e,t,r,l,a,s,f){for(var n=e.block,i=e.row,u=l+n.indent,o=e.y,v=e.y-i.height,c=0;c<i.cells.length;c++){for(var h=i.cells[c].span||1,d=i.cells[c].start!=null?i.cells[c].start:c,y=u,p=0,g=0;g<d+h;g++){var b=n.colWidths&&n.colWidths[g]!=null?n.colWidths[g]:n.colWidth;g<d?y+=b:p+=b}var k=function(){i.header&&r.push("0.94 0.95 0.97 rg "+m(y)+" "+m(v)+" "+m(p)+" "+m(i.height)+" re f"),r.push("0.75 0.78 0.82 RG 0.5 w "+m(y)+" "+m(v)+" "+m(p)+" "+m(i.height)+" re S")};f?f.artifact(r,k):k();for(var D={kind:"cell",block:n,row:i,col:d,span:h,rowspan:i.cells[c].rowspan||1,header:!!i.cells[c].header},T=o-n.pad,z=i.cells[c].lines,x=0;x<z.length;x++)ze({line:z[x],y:T,block:{indent:0,align:"left"},first:x===0,cell:D},{width:y+p+t.margin.right,margin:{right:t.margin.right}},r,y+n.pad,"helvetica",a,s,f),T-=z[x].height}}function Ee(e){return e=e||[0,0,0],m(e[0])+" "+m(e[1])+" "+m(e[2])+" rg"}function Ne(e){return e=e||[0,0,0],m(e[0])+" "+m(e[1])+" "+m(e[2])+" RG"}function Ze(e){try{var t=e.naturalWidth||e.width,r=e.naturalHeight||e.height;if(!t||!r)return null;var l=2e3,a=Math.min(1,l/Math.max(t,r)),s=Math.max(1,Math.round(t*a)),f=Math.max(1,Math.round(r*a)),n=document.createElement("canvas");n.width=s,n.height=f;var i=n.getContext("2d");i.fillStyle="#ffffff",i.fillRect(0,0,s,f),i.drawImage(e,0,0,s,f);var u=n.toDataURL("image/jpeg",.92),o=u.indexOf(",");if(o<0)return null;for(var v=atob(u.slice(o+1)),c=new Uint8Array(v.length),h=0;h<v.length;h++)c[h]=v.charCodeAt(h);return{bytes:c,width:s,height:f}}catch{return null}}function Ie(e){return!e||typeof e!="string"?"":e.replace(/\.pdf$/i,"").replace(/[\\/:*?"<>|]+/g,"").trim().slice(0,120)}function Qe(){var e=new Date;function t(r){return(r<10?"0":"")+r}return"Export-"+String(e.getFullYear()).slice(2)+t(e.getMonth()+1)+t(e.getDate())+"-"+t(e.getHours())+t(e.getMinutes())+t(e.getSeconds())}function Ye(e,t){var r=new Blob([e],{type:"application/pdf"}),l=URL.createObjectURL(r),a=document.createElement("a");return a.href=l,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(function(){URL.revokeObjectURL(l)},4e3),t}}
18
+ `);for(var v=new Uint8Array(a),c=0,d=0;d<r.length;d++)v.set(r[d],c),c+=r[d].length;return v};function at(e){for(var t=String(e);t.length<10;)t="0"+t;return t}function Be(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r)&255;return t}function ue(e,t){var r={bold:t.bold,italic:t.italic,underline:t.underline,strike:t.strike,size:t.size,color:t.color,mono:t.mono,link:t.link,lang:t.lang,comment:t.comment||null},a=e.getAttribute?e.getAttribute("lang"):"";a&&(r.lang=a);var n=e.tagName?e.tagName.toLowerCase():"";(n==="b"||n==="strong")&&(r.bold=!0),(n==="i"||n==="em")&&(r.italic=!0),(n==="u"||n==="ins")&&(r.underline=!0),(n==="s"||n==="strike"||n==="del")&&(r.strike=!0),(n==="code"||n==="kbd"||n==="samp"||n==="pre")&&(r.mono=!0),n==="a"&&e.getAttribute("href")&&(r.link=e.getAttribute("href"),r.color=[0,.33,.8],r.underline=!0),e.getAttribute&&e.getAttribute("data-comment")&&(r.comment={text:e.getAttribute("data-comment"),author:e.getAttribute("data-comment-author")||""}),(n==="sup"||n==="sub")&&(r.size=r.size*.75);var u=e.style;if(u){if(/bold|^[6-9]00$/.test(u.fontWeight||"")&&(r.bold=!0),(u.fontStyle==="italic"||u.fontStyle==="oblique")&&(r.italic=!0),(u.textDecorationLine||u.textDecoration||"").indexOf("underline")>=0&&(r.underline=!0),(u.textDecorationLine||u.textDecoration||"").indexOf("line-through")>=0&&(r.strike=!0),u.color){var s=it(u.color);s&&(r.color=s)}if(u.fontSize){var i=pe(u.fontSize,null);i&&(r.size=i)}}return r}function it(e){var t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.replace(/\s/g,""));if(t){var r=t[1];return r.length===3&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]),[parseInt(r.substr(0,2),16)/255,parseInt(r.substr(2,2),16)/255,parseInt(r.substr(4,2),16)/255]}var a=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);return a?[a[1]/255,a[2]/255,a[3]/255]:null}var ve={h1:2,h2:1.6,h3:1.35,h4:1.15,h5:1,h6:.9};function ye(e,t,r){this.geom=e,this.baseSize=t,this.family=r,this.contentWidth=e.width-e.margin.left-e.margin.right,this.blocks=[]}ye.prototype.runsOf=function(e,t){var r=[],a=this;return(function n(u,s){for(var i=0;i<u.childNodes.length;i++){var l=u.childNodes[i];if(l.nodeType===3){var f=(l.nodeValue||"").replace(/\s+/g," ");f&&r.push({text:f,style:s});continue}if(l.nodeType===1){var o=l.tagName.toLowerCase();if(o==="br"){r.push({br:!0,style:s});continue}if(o==="img"){r.push({img:l,style:s});continue}o==="script"||o==="style"||n(l,ue(l,s))}}})(e,t),r},ye.prototype.wrap=function(e,t,r){var a=[],n=[],u=0,s=this,i=this.baseSize;function l(){for(;n.length&&/^\s+$/.test(n[n.length-1].text||"");)n.pop();a.push({parts:n,width:u,size:i}),n=[],u=0,i=s.baseSize}for(var f=0;f<e.length;f++){var o=e[f];if(o.br){l();continue}if(o.img){var h=Ie(o.img,t);n.length&&l(),a.push({parts:[{img:o.img,w:h.w,h:h.h,style:o.style}],width:h.w,size:h.h,image:!0});continue}for(var v=(o.style.bold?1:0)|(o.style.italic?2:0),c=o.style.mono?"courier":this.family,d=o.text.split(/(\s+)/),x=0;x<d.length;x++){var p=d[x];if(p)for(var y=K&&!/^\s+$/.test(p)?tt(p):[{text:p,uni:!1}],F=0;F<y.length;F++){var R=y[F].text,M=y[F].uni,C=M?Ke(R,o.style.size):Re(oe(R),c,v,o.style.size);u+C>t&&n.length&&!/^\s+$/.test(R)&&(F===0||M)&&(l(),/^\s+$/.test(R))||(n.push({text:R,style:o.style,family:c,styleIndex:v,w:C,uni:M}),u+=C,o.style.size>i&&(i=o.style.size))}}}n.length&&l(),a.length||a.push({parts:[],width:0,size:this.baseSize});for(var E=0;E<a.length;E++)a[E].height=a[E].image?a[E].size:a[E].size*r;return a};function Ie(e,t){var r=e.naturalWidth||e.width||0,a=e.naturalHeight||e.height||0;if(!r||!a)return{w:0,h:0};var n=r*.75,u=a*.75;return n>t&&(u=u*t/n,n=t),{w:n,h:u}}ye.prototype.run=function(e){var t=this,r={bold:!1,italic:!1,underline:!1,strike:!1,size:this.baseSize,color:[0,0,0],mono:!1,link:null};function a(l){if(!l||!l.style)return 0;var f=l.style.marginLeft||l.style.paddingLeft||"",o=/^\s*(-?[\d.]+)\s*([a-z%]*)\s*$/i.exec(f);if(!o)return 0;var h=parseFloat(o[1]);if(!h||h<=0)return 0;var v=(o[2]||"px").toLowerCase(),c=v==="px"?h:v==="pt"?h*(4/3):v==="in"?h*96:v==="cm"?h*37.795:v==="mm"?h*3.7795:v==="em"||v==="rem"?h*16:0;return c*.75}function n(l){for(var f=l;f&&f.nodeType===1&&f.tagName.toLowerCase()!=="body";f=f.parentNode)if(f.getAttribute("lang"))return f.getAttribute("lang");for(var o=null,h=l.childNodes,v=0;v<h.length;v++){if(h[v].nodeType===3&&h[v].nodeValue.replace(/[\s\u200b\u00a0]/g,""))return"";if(h[v].nodeType===1){if(o)return"";o=h[v]}}return o&&o.getAttribute("lang")?o.getAttribute("lang"):""}function u(l,f,o,h,v,c,d){var x=l.tagName.toLowerCase(),p=ue(l,f),y="left",F=l.style&&l.style.textAlign||"";(F==="center"||F==="right"||F==="justify")&&(y=F),ve[x]&&(p.size=t.baseSize*ve[x],p.bold=!0),x==="pre"&&(p.mono=!0);var R=t.contentWidth-o,M=t.runsOf(l,p),C=t.wrap(M,R,x==="pre"?1.25:1.4);t.blocks.push({type:"text",lines:C,indent:o,align:y,lang:n(l),spaceBefore:ve[x]?p.size*.6:t.baseSize*.35,spaceAfter:ve[x]?p.size*.3:t.baseSize*.35,marker:h||null,markerStyle:p,keepWithNext:!!ve[x],rule:x==="blockquote"?"quote":null,role:d||(ve[x]?"H"+x.charAt(1):x==="blockquote"?"BlockQuote":"P"),listId:v||null,listOrdered:!!c})}function s(l,f,o,h){for(var v=0;v<l.childNodes.length;v++){var c=l.childNodes[v];if(c.nodeType===3){if(!(c.nodeValue||"").trim())continue;t.blocks.push({type:"text",lines:t.wrap([{text:c.nodeValue.replace(/\s+/g," "),style:f}],t.contentWidth-o,1.4),indent:o,align:"left",spaceBefore:0,spaceAfter:t.baseSize*.35});continue}if(c.nodeType===1){var d=c.tagName.toLowerCase();if(!(d==="script"||d==="style"||d==="noscript")){if(c.getAttribute&&c.getAttribute("data-rte-page-break")!==null){t.blocks.push({type:"pagebreak"});continue}if(c.style&&/always|page/.test(c.style.pageBreakBefore||c.style.breakBefore||"")&&t.blocks.push({type:"pagebreak"}),d==="hr"){t.blocks.push({type:"rule",indent:o});continue}if(d==="ul"||d==="ol"){var x=parseInt(c.getAttribute("start"),10);isNaN(x)&&(x=1);for(var p=String(c.style&&c.style.listStyleType||"").toLowerCase(),y=c.getAttribute("type")||"",F=/^(lower-alpha|lower-latin)$/.test(p)||y==="a"?"a":/^(upper-alpha|upper-latin)$/.test(p)||y==="A"?"A":p==="lower-roman"||y==="i"?"i":p==="upper-roman"||y==="I"?"I":"1",R="L"+(t.listSeq=(t.listSeq||0)+1),M=0;M<c.childNodes.length;M++){var C=c.childNodes[M];if(!(C.nodeType!==1||C.tagName.toLowerCase()!=="li")){var E=d==="ol"?Ve(x++,F)+".":"\u2022";c.classList&&c.classList.contains("rte-task-list")&&(E=C.getAttribute("data-checked")==="true"?"[x]":"[ ]"),u(C,ue(C,f),o+t.baseSize*1.6,E,R,d==="ol"),i(C,ue(C,f),o+t.baseSize*1.6)}}continue}if(d==="table"){t.table(c,ue(c,f),o);continue}if(d==="img"){var m=Ie(c,t.contentWidth-o);m.w&&t.blocks.push({type:"text",role:"Figure",alt:c.getAttribute("alt")||"",lines:[{parts:[{img:c,w:m.w,h:m.h,style:f}],width:m.w,size:m.h,height:m.h,image:!0}],indent:o,align:"left",spaceBefore:4,spaceAfter:4});continue}if(Ue(d)){var w=(d==="blockquote"?t.baseSize*1.5:0)+a(c),A=d==="blockquote"?"BlockQuote":h,L=c.getElementsByTagName("img");if(L.length===1&&!(c.textContent||"").replace(/[\s\u200b\u00a0]/g,"")&&!Oe(c)){var k=Ie(L[0],t.contentWidth-o-w);if(k.w){var g=String(c.style&&c.style.textAlign||"").toLowerCase();t.blocks.push({type:"text",role:"Figure",alt:L[0].getAttribute("alt")||"",lines:[{parts:[{img:L[0],w:k.w,h:k.h,style:f}],width:k.w,size:k.h,height:k.h,image:!0}],indent:o+w,align:g==="center"||g==="right"?g:"left",spaceBefore:4,spaceAfter:4});continue}}if(Oe(c)){s(c,ue(c,f),o+w,A);continue}u(c,f,o+w,null,null,!1,A);continue}u(c,f,o,null)}}}}function i(l,f,o){for(var h=0;h<l.childNodes.length;h++){var v=l.childNodes[h];if(v.nodeType===1){var c=v.tagName.toLowerCase();(c==="ul"||c==="ol")&&s({childNodes:[v]},f,o)}}}return s(e,r,0),this.blocks};function Ue(e){return/^(p|div|h[1-6]|blockquote|pre|section|article|header|footer|main|aside|figure|figcaption|dl|dd|dt|li|address)$/.test(e)}function Oe(e){for(var t=0;t<e.childNodes.length;t++){var r=e.childNodes[t];if(r.nodeType===1&&(Ue(r.tagName.toLowerCase())||/^(ul|ol|table|hr)$/.test(r.tagName.toLowerCase())))return!0}return!1}ye.prototype.table=function(e,t,r){for(var a=this,n=[],u=e.getElementsByTagName("tr"),s=0,i={},l=0;l<u.length;l++){for(var f=[],o=0;o<u[l].childNodes.length;o++){var h=u[l].childNodes[o];if(h.nodeType===1){var v=h.tagName.toLowerCase();if(!(v!=="td"&&v!=="th")){var c=Math.max(1,Math.min(50,parseInt(h.getAttribute("colspan"),10)||1)),d=Math.max(1,Math.min(500,parseInt(h.getAttribute("rowspan"),10)||1));f.push({node:h,header:v==="th",span:c,rowspan:d})}}}for(var x=[],p=0,y=0;y<f.length;y++){for(;i[p]>0;)x.push({placeholder:!0,start:p,span:1,header:!1}),p++;if(f[y].start=p,x.push(f[y]),f[y].rowspan>1)for(var F=p;F<p+f[y].span;F++)i[F]=f[y].rowspan;p+=f[y].span}for(var R in i)+R>=p&&i[R]>0&&(x.push({placeholder:!0,start:+R,span:1,header:!1}),+R+1>p&&(p=+R+1));for(var M in i)i[M]--,i[M]<=0&&delete i[M];x.sort(function(Q,B){return Q.start-B.start}),f=f.length?x:f,f.length&&(n.push(f),p>s&&(s=p))}if(!n.length)return;for(var C=this.contentWidth-r,E=C/s,m=[],w=[],A=0,L=0;L<e.children.length;L++)if(e.children[L].tagName&&e.children[L].tagName.toLowerCase()==="colgroup")for(var k=0;k<e.children[L].children.length;k++)e.children[L].children[k].tagName.toLowerCase()==="col"&&w.push(e.children[L].children[k]);if(w.length===s){for(var g=0;g<w.length;g++){var q=w[g].style&&w[g].style.width||w[g].getAttribute("width")||"",T=/^\s*([\d.]+)(%|px)?\s*$/.exec(q);if(!T||!(parseFloat(T[1])>0)){m=[];break}m.push(parseFloat(T[1]))}for(var P=0;P<m.length;P++)A+=m[P];A>0&&(m=m.map(function(Q){return Q/A*C}))}if(m.length!==s){m=[];for(var O=0;O<s;O++)m.push(E)}function j(Q,B){for(var re=0,U=Q;U<Q+B&&U<m.length;U++)re+=m[U];return re}for(var V=4,D=[],S=0;S<n.length;S++){for(var N=[],$=0,z=0;z<n[S].length;z++){if(n[S][z].placeholder){N.push({lines:[],header:!1,start:n[S][z].start,span:1,placeholder:!0});continue}var ae=ue(n[S][z].node,t);n[S][z].header&&(ae.bold=!0);for(var I=a.wrap(a.runsOf(n[S][z].node,ae),j(n[S][z].start,n[S][z].span)-V*2,1.35),H=0,Z=0;Z<I.length;Z++)H+=I[Z].height;H>$&&($=H),N.push({lines:I,header:n[S][z].header,start:n[S][z].start,span:n[S][z].span,rowspan:n[S][z].rowspan||1})}D.push({cells:N,height:$+V*2,header:n[S][0]&&!n[S][0].placeholder&&n[S][0].header})}this.blocks.push({type:"table",rows:D,colWidth:E,colWidths:m,cols:s,indent:r,pad:V,spaceBefore:this.baseSize*.5,spaceAfter:this.baseSize*.5})};var De="en";function ot(e){var t=W.getEditable().querySelectorAll("[data-comment-id]");if(!(!t.length||!W.reviewLedger)){var r={};W.reviewLedger.list().forEach(function(d){d.changeType==="comment"&&(r[d.id]=d)});for(var a={},n=0;n<t.length;n++){var u=t[n].getAttribute("data-comment-id"),s=r[u],i=t[n].textContent||"";if(!(!s||!i||a[u])){a[u]=!0;for(var l=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),f,o=-1;(f=l.nextNode())&&(o=f.data.indexOf(i),o===-1););if(o!==-1){var h=document.createRange();h.setStart(f,o),h.setEnd(f,o+i.length);var v=s.author&&s.author.name||"RichTextEditor user",c=document.createElement("span");c.setAttribute("data-comment",s.text||""),c.setAttribute("data-comment-author",v);try{h.surroundContents(c)}catch{}}}}}}function He(e){var t=e&&e.unicodeFont||Y.pdfExportUnicodeFont;if(!t)return null;try{return ze(t)}catch(r){return window.console&&console.warn&&console.warn(r.message),null}}function We(e){K=null;var t=He(e);t&&Le(e,!0)&&(K={font:t,used:{}});try{return lt(e)}finally{K=null}}function lt(e){De=String(e&&e.lang||document.documentElement.lang||"en").toLowerCase();var t=String(e.font||Y.pdfExportFont||"helvetica").toLowerCase();ge[t]||(t="helvetica");var r=Number(e.fontSize||Y.pdfExportBaseFontSize||11);(!isFinite(r)||r<=0)&&(r=11);var a=Ze(e),n=document.createElement("div");n.innerHTML=__RTE_TT(W.getHTMLCode()||"");var u=W.getEditable().querySelectorAll("ol,ul"),s=n.querySelectorAll("ol,ul");if(u.length===s.length)for(var i=0;i<u.length;i++){var l=u[i].ownerDocument.defaultView.getComputedStyle(u[i]).listStyleType;l&&(s[i].style.listStyleType=l)}try{ot(n)}catch{}var f=new ye(a,r,t),o=f.run(n),h=ut(o,a,r);return ht(h,a,t,r,e)}function ut(e,t,r){var a=t.height-t.margin.top,n=t.margin.bottom,u=[],s=[],i=a;function l(){u.push(s),s=[],i=a}for(var f=0;f<e.length;f++){var o=e[f];if(o.type==="pagebreak"){s.length&&l();continue}if(o.type==="rule"){i-r<n&&l(),i-=r*.6,s.push({op:"rule",y:i,indent:o.indent}),i-=r*.6;continue}if(o.type==="table"){i-=o.spaceBefore;for(var h=0;h<o.rows.length;h++){var v=o.rows[h];i-v.height<n&&(l(),o.rows[0]&&o.rows[0].header&&h>0&&(s.push({op:"row",row:o.rows[0],y:i,block:o}),i-=o.rows[0].height)),s.push({op:"row",row:v,y:i,block:o}),i-=v.height}i-=o.spaceAfter;continue}i-=o.spaceBefore;for(var c=0;c<o.lines.length;c++){var d=o.lines[c];i-d.height<n&&l(),s.push({op:"line",line:d,y:i,block:o,first:c===0}),i-=d.height}if(i-=o.spaceAfter,o.keepWithNext&&s.length&&e[f+1]&&e[f+1].type!=="pagebreak"){var x=ft(e[f+1]);if(i-x<n){for(var p=[];s.length&&s[s.length-1].block===o;)p.unshift(s.pop());if(s.length){l();for(var y=0;y<p.length;y++)p[y].y=i,s.push(p[y]),i-=p[y].line.height}else for(var F=0;F<p.length;F++)s.push(p[F])}}}return(s.length||!u.length)&&u.push(s),u}function ft(e){return e.type==="table"?e.rows[0]?e.rows[0].height:0:e.lines&&e.lines[0]?e.lines[0].height:0}function st(e,t){for(var r=t.font,a=1e3/r.units,n=Object.keys(t.used).map(Number).sort(function(F,R){return F-R}),u=Ye(r,t.used),s=e.add({dict:"<< /Length1 "+u.length+" /Length 0 >>",stream:u}),i="/RTEUNI+EmbeddedUnicode",l=e.add("<< /Type /FontDescriptor /FontName "+i+" /Flags 4 /FontBBox ["+r.bbox.map(function(F){return Math.round(F*a)}).join(" ")+"] /ItalicAngle "+r.italicAngle+" /Ascent "+Math.round(r.ascent*a)+" /Descent "+Math.round(r.descent*a)+" /CapHeight "+Math.round(r.capHeight*a)+" /StemV 80 /FontFile2 "+s+" 0 R >>"),f=n.map(function(F){return F+" ["+Math.round(r.advance(F)*a)+"]"}).join(" "),o=e.add("<< /Type /Font /Subtype /CIDFontType2 /BaseFont "+i+" /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> /FontDescriptor "+l+" 0 R /DW 1000 /W ["+f+"] /CIDToGIDMap /Identity >>"),h=`/CIDInit /ProcSet findresource begin
19
+ 12 dict begin
20
+ begincmap
21
+ /CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def
22
+ /CMapName /Adobe-Identity-UCS def
23
+ /CMapType 2 def
24
+ 1 begincodespacerange
25
+ <0000> <FFFF>
26
+ endcodespacerange
27
+ `,v=0;v<n.length;v+=100){var c=n.slice(v,v+100);h+=c.length+` beginbfchar
28
+ `;for(var d=0;d<c.length;d++){var x=t.used[c[d]],p=x>65535?me(55296+(x-65536>>10))+me(56320+(x-65536&1023)):me(x);h+="<"+me(c[d])+"> <"+p+`>
29
+ `}h+=`endbfchar
30
+ `}h+=`endcmap
31
+ CMapName currentdict /CMap defineresource pop
32
+ end
33
+ end`;var y=e.add({dict:"<< /Length 0 >>",stream:h});return e.add("<< /Type /Font /Subtype /Type0 /BaseFont "+i+" /Encoding /Identity-H /DescendantFonts ["+o+" 0 R] /ToUnicode "+y+" 0 R >>")}function ht(e,t,r,a,n){var u=new xe,s=ge[r],i=ge.courier,l={},f=[];function o(G,X,ee,ne){var Se=Fe(X,ee),qe=u.add("<< /Type /Font /Subtype /Type1 /BaseFont /"+G+" /Encoding /WinAnsiEncoding /FirstChar "+we+" /LastChar "+Ae+" /Widths ["+Se.join(" ")+"] >>");l[ne]=qe,f.push("/"+ne+" "+qe+" 0 R")}for(var h=0;h<4;h++)o(s.faces[h],r,h,"F"+h),o(i.faces[h],"courier",h,"M"+h);var v={},c=[];function d(G){var X=G.getAttribute("src")||"";if(v[X])return v[X];var ee=xt(G);if(!ee)return null;var ne=u.add({dict:"<< /Type /XObject /Subtype /Image /Width "+ee.width+" /Height "+ee.height+" /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length 0 >>",stream:ee.bytes}),Se="Im"+(c.length+1);return v[X]={id:ne,alias:Se},c.push("/"+Se+" "+ne+" 0 R"),v[X]}for(var x=[],p=[],y=[],F=0;F<e.length;F++)x.push(u.alloc()),p.push(u.alloc()),y.push([]);for(var R=u.alloc(),M=[],C=[],E=[],m=0;m<e.length;m++){for(var w=new Te(m),A=dt(e[m],t,r,a,d,m+1,e.length,n,w),L=0;L<(A.headings||[]).length;L++)A.headings[L].page=m,C.push(A.headings[L]);u.set(p[m],{dict:"<< /Length 0 >>",stream:A.content}),M.push(A.marks);for(var k=0;k<A.links.length;k++){var g=A.links[k],q=e.length+E.length,T=u.add("<< /Type /Annot /Subtype /Link /Rect ["+b(g.x0)+" "+b(g.y0)+" "+b(g.x1)+" "+b(g.y1)+"] /Border [0 0 0] /StructParent "+q+" /Contents "+le(String(g.text||g.href).replace(/\s+/g," ").trim()||g.href)+" /A << /S /URI /URI ("+ce(nt(g.href))+") >> >>");y[m].push(T),E.push({id:T,page:m,key:q,owner:g.owner})}for(var P=0;P<(A.comments||[]).length;P++){var O=A.comments[P],j=e.length+E.length,V=u.add("<< /Type /Annot /Subtype /Text /Rect ["+b(O.x0)+" "+b(O.y0)+" "+b(O.x1)+" "+b(O.y1)+"] /Contents "+le(O.text)+" /T "+le(O.author)+" /Name /Note /Open false /C [1 1 0] /StructParent "+j+" >>");y[m].push(V),E.push({id:V,page:m,key:j,owner:null,note:!0})}}K&&Object.keys(K.used).length&&f.push("/U0 "+st(u,K)+" 0 R");for(var D=ct(u,M,x,E),S=0;S<e.length;S++)u.set(x[S],"<< /Type /Page /Parent "+R+" 0 R /MediaBox [0 0 "+b(t.width)+" "+b(t.height)+"] /Resources << /Font << "+f.join(" ")+" >>"+(c.length?" /XObject << "+c.join(" ")+" >>":"")+" >> /Contents "+p[S]+" 0 R /StructParents "+S+(y[S].length?" /Annots ["+y[S].map(function(G){return G+" 0 R"}).join(" ")+"] /Tabs /S":"")+" >>");u.set(R,"<< /Type /Pages /Count "+e.length+" /Kids ["+x.map(function(G){return G+" 0 R"}).join(" ")+"] >>");var N=0;if(C.length){N=u.alloc();for(var $={id:N,kids:[]},z=[$],ae=[],I=0;I<C.length;I++){for(var H={h:C[I],id:u.alloc(),kids:[],parent:null};z.length>1&&z[z.length-1].h.level>=H.h.level;)z.pop();H.parent=z[z.length-1],H.parent.kids.push(H),z.push(H),ae.push(H)}for(var Z=function(G){for(var X=G.kids.length,ee=0;ee<G.kids.length;ee++)X+=Z(G.kids[ee]);return X},Q=0;Q<ae.length;Q++){var B=ae[Q],re=B.parent.kids,U=re.indexOf(B);u.set(B.id,"<< /Title "+le(B.h.title)+" /Parent "+B.parent.id+" 0 R"+(U>0?" /Prev "+re[U-1].id+" 0 R":"")+(U<re.length-1?" /Next "+re[U+1].id+" 0 R":"")+(B.kids.length?" /First "+B.kids[0].id+" 0 R /Last "+B.kids[B.kids.length-1].id+" 0 R /Count "+Z(B):"")+" /Dest ["+x[B.h.page]+" 0 R /XYZ null "+b(B.h.y)+" null] >>")}u.set(N,"<< /Type /Outlines /First "+$.kids[0].id+" 0 R /Last "+$.kids[$.kids.length-1].id+" 0 R /Count "+Z($)+" >>")}var be=n.title||Y.pdfExportTitle||document.title||"Document",ie=n.author||Y.pdfExportAuthor||"",fe=u.add("<< /Type /Catalog /Pages "+R+" 0 R /Lang ("+ce(String(n.lang||document.documentElement.lang||"en"))+") /MarkInfo << /Marked true >>"+(N?" /Outlines "+N+" 0 R":"")+" /StructTreeRoot "+D.rootId+" 0 R /ViewerPreferences << /DisplayDocTitle true >> >>"),se=u.add("<< /Title "+le(String(be))+(ie?" /Author "+le(String(ie)):"")+" /Producer (RichTextEditor) /Creator (RichTextEditor) /CreationDate ("+vt(new Date)+") >>");return u.build(fe,se)}function ct(e,t,r,a){var n=e.alloc(),u=[],s=[];function i(I,H){var Z={id:e.alloc(),role:I,kids:[],extra:H||"",children:[],parent:null,seq:[]};return u.push(Z),Z}for(var l=i("Document"),f=new Map,o=new Map,h=new Map,v=new Map,c=new Map,d=new Map,x=new Map,p=new Map,y=0;y<t.length;y++){var F=t[y];s[y]=[];for(var R=0;R<F.length;R++){var M=F[R].owner,C=F[R].mcid,E=g(M);E.kids.push({page:y,mcid:C}),E.seq.push({mcr:{page:y,mcid:C}}),s[y][C]=E.id}}function m(I,H){H.parent||(H.parent=I,I.children.push(H),I.seq.push({elem:H}))}for(var w=[],A=0;A<(a||[]).length;A++){if(a[A].note){var L=i("Note");m(l,L),L.objr=a[A],w.push(a[A].key+" "+L.id+" 0 R");continue}var k;a[A].owner&&a[A].owner.kind==="link"?k=g(a[A].owner):(k=i("Link"),m(g(a[A].owner),k)),k.objr=a[A],w.push(a[A].key+" "+k.id+" 0 R")}function g(I){if(I.kind==="link"){var H=p.get(I);return H||(H=i("Link"),p.set(I,H),m(g(I.parent),H)),H}if(I.kind==="cell"){var Z=c.get(I.block);Z||(Z=i("Table"),c.set(I.block,Z),m(l,Z));var Q=d.get(I.row);Q||(Q=i("TR"),d.set(I.row,Q),m(Z,Q));var B=x.get(I.row);if(B||(B={},x.set(I.row,B)),!B[I.col]){var re=(I.header?" /Scope /Column":"")+(I.span>1?" /ColSpan "+I.span:"")+(I.rowspan>1?" /RowSpan "+I.rowspan:"");B[I.col]=i(I.header?"TH":"TD",re?" /A << /O /Table"+re+" >>":""),m(Q,B[I.col])}return B[I.col]}var U=I.block,be=l;if(U.listId){var ie=f.get(U.listId);ie||(ie=i("L"),f.set(U.listId,ie),m(l,ie));var fe=o.get(U);fe||(fe=i("LI"),o.set(U,fe),m(ie,fe)),be=fe}if(I.kind==="lbl"){var se=h.get(U);return se||(se=i("Lbl"),h.set(U,se),m(be,se)),se}var G=v.get(U);if(!G){if(U.listId)G=i("LBody");else{var X=U.role==="Figure"?" /Alt "+le(U.alt||"Image"):"",ee=De,ne=String(U.lang||"").replace(/[^A-Za-z0-9-]/g,"");ne&&ne.toLowerCase()!==ee&&(X+=" /Lang ("+ne+")"),G=i(U.role||"P",X)}v.set(U,G),m(be,G)}return G}for(var q=0;q<u.length;q++){for(var T=u[q],P=[],O=0;O<T.seq.length;O++){var j=T.seq[O];j.elem?P.push(j.elem.id+" 0 R"):P.push("<< /Type /MCR /Pg "+r[j.mcr.page]+" 0 R /MCID "+j.mcr.mcid+" >>")}T.objr&&P.push("<< /Type /OBJR /Obj "+T.objr.id+" 0 R /Pg "+r[T.objr.page]+" 0 R >>");var V=T.parent?T.parent.id:n;e.set(T.id,"<< /Type /StructElem /S /"+T.role+" /P "+V+" 0 R"+T.extra+(P.length?" /K ["+P.join(" ")+"]":"")+" >>")}for(var D=[],S=0;S<s.length;S++){for(var N=s[S]||[],$=[],z=0;z<N.length;z++)$.push((N[z]||l.id)+" 0 R");D.push(S+" ["+$.join(" ")+"]")}var ae=e.add("<< /Nums ["+D.concat(w).join(" ")+"] >>");return e.set(n,"<< /Type /StructTreeRoot /K ["+l.id+" 0 R] /ParentTree "+ae+" 0 R /ParentTreeNextKey "+(s.length+w.length)+" >>"),{rootId:n}}function vt(e){function t(r){return(r<10?"0":"")+r}return"D:"+e.getFullYear()+t(e.getMonth()+1)+t(e.getDate())+t(e.getHours())+t(e.getMinutes())+t(e.getSeconds())+"Z"}function b(e){return(Math.round(e*100)/100).toString()}function Te(e){this.pageIndex=e,this.next=0,this.marks=[]}Te.prototype.open=function(e,t,r){var a=this.next++;return this.marks.push({owner:r,mcid:a,role:t}),e.push("/"+t+" << /MCID "+a+" >> BDC"),a},Te.prototype.close=function(e){e.push("EMC")},Te.prototype.artifact=function(e,t){e.push("/Artifact BMC"),t(),e.push("EMC")};function dt(e,t,r,a,n,u,s,i,l){var f=[],o=[],h=[];o.comments=[],o.seenComments={};for(var v=t.margin.left,c=0;c<e.length;c++){var d=e[c];if(d.op==="line"&&d.first&&d.block&&/^H[1-6]$/.test(d.block.role||"")){var x=(d.block.lines||[]).map(function(y){return(y.parts||[]).map(function(F){return F.text||""}).join("")}).join(" ").replace(/\s+/g," ").trim();x&&h.push({level:+d.block.role.charAt(1),title:x,y:d.y})}if(d.op==="rule"){l.artifact(f,function(){f.push("0.8 0.8 0.8 RG 0.5 w "+b(v+d.indent)+" "+b(d.y)+" m "+b(t.width-t.margin.right)+" "+b(d.y)+" l S")});continue}if(d.op==="row"){mt(d,t,f,v,n,o,l);continue}$e(d,t,f,v,r,n,o,l)}var p=pt(i);return(p.header||p.footer)&&l.artifact(f,function(){p.header&&je(f,p.header,t,t.height-t.margin.top*.55,r,a*.85,u,s),p.footer&&je(f,p.footer,t,t.margin.bottom*.55,r,a*.85,u,s)}),{content:f.join(`
34
+ `),links:o,marks:l.marks,headings:h,comments:o.comments}}function pt(e){var t=null;try{typeof W.getDocumentPageSetup=="function"&&(t=W.getDocumentPageSetup())}catch{}return t=t||{},{header:e.headerText||Y.pdfExportHeader||_e(t.headerHtml)||"",footer:e.footerText||Y.pdfExportFooter||_e(t.footerHtml)||""}}function _e(e){if(!e||typeof e!="string")return"";var t=document.createElement("div");return t.innerHTML=__RTE_TT(e),(t.textContent||"").replace(/\s+/g," ").trim()}function je(e,t,r,a,n,u,s,i){var l=String(t).replace(/\{page\}/g,s).replace(/\{total\}/g,i),f=oe(l),o=Re(f,n,0,u),h=(r.width-o)/2;e.push("BT /F0 "+b(u)+" Tf 0.4 0.4 0.4 rg "+b(h)+" "+b(a)+" Td ("+ce(f)+") Tj ET")}function $e(e,t,r,a,n,u,s,i){var l=e.line,f=e.block,o=a+(f.indent||0),h=t.width-t.margin.right-o;if(f.align==="center"?o+=(h-l.width)/2:f.align==="right"&&(o+=h-l.width),f.rule==="quote"&&!l.image){var v=b(a+f.indent-8),c=function(){r.push("0.8 0.8 0.85 RG 2 w "+v+" "+b(e.y-l.height+4)+" m "+v+" "+b(e.y+l.size*.8)+" l S")};i?i.artifact(r,c):c()}if(e.first&&f.marker){var d=f.markerStyle||{size:l.size,color:[0,0,0]},x=Re(f.marker,n,0,d.size);i&&i.open(r,"Lbl",{kind:"lbl",block:f}),r.push("BT /F0 "+b(d.size)+" Tf "+ke(d.color)+" "+b(o-x-6)+" "+b(e.y-l.size*.85)+" Td ("+ce(oe(f.marker))+") Tj ET"),i&&i.close(r)}var p=e.cell||{kind:"body",block:f},y=!1;i&&(i.open(r,l.image?"Figure":"Span",p),y=!0);for(var F=[],R=o,M=0;M<l.parts.length;M++){var C=l.parts[M];if(C.img){F.push({img:C,x:R,w:C.w}),R+=C.w;continue}var E=C.style,m=C.uni?"U0":(E.mono?"M":"F")+C.styleIndex,w=F.length?F[F.length-1]:null,A=w&&!w.img&&w.alias===m&&w.style.size===E.size&&gt(w.style.color,E.color)&&w.style.underline===E.underline&&w.style.strike===E.strike&&w.style.link===E.link&&(w.style.lang||"")===(E.lang||"")&&(w.style.comment?w.style.comment.text+"|"+w.style.comment.author:"")==(E.comment?E.comment.text+"|"+E.comment.author:"");A?(w.text+=C.text,w.w+=C.w):F.push({text:C.text,style:E,alias:m,x:R,w:C.w}),R+=C.w}for(var L=e.y-l.size*.85,k=0;k<F.length;k++){var g=F[k];if(g.img){var q=u(g.img.img);q&&r.push("q "+b(g.w)+" 0 0 "+b(g.img.h)+" "+b(g.x)+" "+b(e.y-g.img.h)+" cm /"+q.alias+" Do Q");continue}if(!(!g.text||/^\s+$/.test(g.text))){var T=g.style,P=null;i&&!l.image&&T.link?(y&&(i.close(r),y=!1),P={kind:"link",parent:p},i.open(r,"Span",P)):i&&!y&&(i.open(r,"Span",p),y=!0);var O=String(T.lang||"").replace(/[^A-Za-z0-9-]/g,""),j=O&&O.toLowerCase()!==String(f.lang||De||"").toLowerCase();if(j&&r.push("/Span << /Lang ("+O+") >> BDC"),g.alias==="U0"?r.push("BT /U0 "+b(T.size)+" Tf "+ke(T.color)+(T.bold?" "+Ne(T.color)+" 2 Tr "+b(T.size*.03)+" w":"")+" "+(T.italic?"1 0 0.21 1 "+b(g.x)+" "+b(L)+" Tm ":b(g.x)+" "+b(L)+" Td ")+Je(g.text)+" Tj"+(T.bold?" 0 Tr":"")+" ET"):r.push("BT /"+g.alias+" "+b(T.size)+" Tf "+ke(T.color)+" "+b(g.x)+" "+b(L)+" Td ("+ce(oe(g.text))+") Tj ET"),j&&r.push("EMC"),T.underline&&r.push(Ne(T.color)+" 0.5 w "+b(g.x)+" "+b(L-T.size*.12)+" m "+b(g.x+g.w)+" "+b(L-T.size*.12)+" l S"),T.strike&&r.push(Ne(T.color)+" 0.5 w "+b(g.x)+" "+b(L+T.size*.28)+" m "+b(g.x+g.w)+" "+b(L+T.size*.28)+" l S"),T.comment){var V=T.comment.text+"|"+T.comment.author;s.seenComments[V]||(s.seenComments[V]=!0,s.comments.push({x0:g.x,y0:L-2,x1:g.x+12,y1:L+10,text:T.comment.text,author:T.comment.author}))}T.link&&s.push({href:T.link,x0:g.x,y0:L-2,x1:g.x+g.w,y1:L+T.size,text:g.text||"",owner:P||p}),P&&i.close(r)}}i&&y&&i.close(r)}function gt(e,t){return e=e||[0,0,0],t=t||[0,0,0],e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function mt(e,t,r,a,n,u,s){for(var i=e.block,l=e.row,f=a+i.indent,o=e.y,h=e.y-l.height,v=0;v<l.cells.length;v++){for(var c=l.cells[v].span||1,d=l.cells[v].start!=null?l.cells[v].start:v,x=f,p=0,y=0;y<d+c;y++){var F=i.colWidths&&i.colWidths[y]!=null?i.colWidths[y]:i.colWidth;y<d?x+=F:p+=F}var R=function(){l.header&&r.push("0.94 0.95 0.97 rg "+b(x)+" "+b(h)+" "+b(p)+" "+b(l.height)+" re f"),r.push("0.75 0.78 0.82 RG 0.5 w "+b(x)+" "+b(h)+" "+b(p)+" "+b(l.height)+" re S")};s?s.artifact(r,R):R();for(var M={kind:"cell",block:i,row:l,col:d,span:c,rowspan:l.cells[v].rowspan||1,header:!!l.cells[v].header},C=o-i.pad,E=l.cells[v].lines,m=0;m<E.length;m++)$e({line:E[m],y:C,block:{indent:0,align:"left"},first:m===0,cell:M},{width:x+p+t.margin.right,margin:{right:t.margin.right}},r,x+i.pad,"helvetica",n,u,s),C-=E[m].height}}function ke(e){return e=e||[0,0,0],b(e[0])+" "+b(e[1])+" "+b(e[2])+" rg"}function Ne(e){return e=e||[0,0,0],b(e[0])+" "+b(e[1])+" "+b(e[2])+" RG"}function xt(e){try{var t=e.naturalWidth||e.width,r=e.naturalHeight||e.height;if(!t||!r)return null;var a=2e3,n=Math.min(1,a/Math.max(t,r)),u=Math.max(1,Math.round(t*n)),s=Math.max(1,Math.round(r*n)),i=document.createElement("canvas");i.width=u,i.height=s;var l=i.getContext("2d");l.fillStyle="#ffffff",l.fillRect(0,0,u,s),l.drawImage(e,0,0,u,s);var f=i.toDataURL("image/jpeg",.92),o=f.indexOf(",");if(o<0)return null;for(var h=atob(f.slice(o+1)),v=new Uint8Array(h.length),c=0;c<h.length;c++)v[c]=h.charCodeAt(c);return{bytes:v,width:u,height:s}}catch{return null}}function Ge(e){return!e||typeof e!="string"?"":e.replace(/\.pdf$/i,"").replace(/[\\/:*?"<>|]+/g,"").trim().slice(0,120)}function yt(){var e=new Date;function t(r){return(r<10?"0":"")+r}return"Export-"+String(e.getFullYear()).slice(2)+t(e.getMonth()+1)+t(e.getDate())+"-"+t(e.getHours())+t(e.getMinutes())+t(e.getSeconds())}function bt(e,t){var r=new Blob([e],{type:"application/pdf"}),a=URL.createObjectURL(r),n=document.createElement("a");return n.href=a,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),setTimeout(function(){URL.revokeObjectURL(a)},4e3),t}}
@@ -186,7 +186,7 @@ function RTE_Plugin_ReadAloud() {
186
186
  var voices = s.getVoices() || [];
187
187
  if (!voices.length) return;
188
188
  var cur = voiceSel.value;
189
- voiceSel.innerHTML = "";
189
+ voiceSel.innerHTML = __RTE_TT("");
190
190
  voices.forEach(function (v, i) {
191
191
  var o = voiceSel.ownerDocument.createElement("option");
192
192
  o.value = v.name; o.textContent = v.name + " (" + v.lang + ")";
@@ -1 +1 @@
1
- window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_readaloud=RTE_Plugin_ReadAloud,RTE_DefaultConfig.readAloudRate=RTE_DefaultConfig.readAloudRate||1,RTE_DefaultConfig.readAloudHighlight=typeof RTE_DefaultConfig.readAloudHighlight>"u"?!0:RTE_DefaultConfig.readAloudHighlight;function RTE_Plugin_ReadAloud(){var r=this,x,d,l=null,N,S,f,v,R=[],m=0,C=!1,_=!1,T=null;r.PluginName="ReadAloud";function E(){return window.speechSynthesis||null}function b(){return!!E()&&typeof window.SpeechSynthesisUtterance=="function"}r.InitConfig=function(e){x=e};function u(e,t){for(var n=x&&x["text_"+e]||t,a=2;a<arguments.length;a++)n=n.split("{"+(a-2)+"}").join(String(arguments[a]));return n}r.InitEditor=function(e){d=e,d.readAloud=function(t){r.Start(t||{})},d.stopReadAloud=function(){r.Stop()},d.attachEvent("exec_command_readaloud",function(t){if(t.returnValue=!0,!b()){r.NotifyUnsupported();return}l?r.CloseBar():r.OpenBar()});try{window.addEventListener("pagehide",function(){r.Stop()}),document.addEventListener("visibilitychange",function(){document.hidden&&r.Pause()})}catch{}},r.NotifyUnsupported=function(){try{var e=d.createDialog(d.getLangText&&d.getLangText("readaloudtitle")||"Read aloud","rte-dialog-readaloud"),t=e.ownerDocument.createElement("div");t.style.cssText="padding:16px;min-width:320px;font:13px -apple-system,Segoe UI,sans-serif",t.textContent=u("ra_unsupported","This browser does not provide a speech synthesizer (Web Speech API). Read-aloud is unavailable here."),e.appendChild(t)}catch{}};function L(){for(var e=d.getEditable(),t=e.ownerDocument,n=t.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:function(s){for(var h=s.parentNode;h&&h!==e;){var p=h.nodeName;if(p==="SCRIPT"||p==="STYLE"||p==="NOSCRIPT")return NodeFilter.FILTER_REJECT;h=h.parentNode}return s.data&&s.data.length?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),a=[],o="",i;i=n.nextNode();)a.push({node:i,start:o.length,len:i.data.length}),o+=i.data;function c(s){for(var h=0;h<a.length;h++){var p=a[h];if(s<=p.start+p.len)return{node:p.node,offset:Math.max(0,s-p.start)}}var D=a[a.length-1];return D?{node:D.node,offset:D.len}:null}function g(s,h){for(var p=0;p<a.length;p++)if(a[p].node===s)return a[p].start+h;return-1}return{full:o,locate:c,globalOffset:g,hasNodes:a.length>0}}function k(e,t){for(var n=[],a=/[^.!?\n\u3002\uff01\uff1f]*[.!?\n\u3002\uff01\uff1f]+|\S[^.!?\n]*$/g,o;(o=a.exec(e))!==null;)o[0]&&/\S/.test(o[0])&&n.push({text:o[0],start:t+o.index,end:t+o.index+o[0].length}),o.index===a.lastIndex&&a.lastIndex++;return!n.length&&/\S/.test(e)&&n.push({text:e,start:t,end:t+e.length}),n}r.Start=function(e){if(!b()){r.NotifyUnsupported();return}r.Stop();var t=L();if(!t.hasNodes){y(u("ra_nothing","Nothing to read"));return}var n=d.getSelection?d.getSelection():null,a=0,o=t.full.length;try{if(n&&n.rangeCount&&!n.isCollapsed){var i=n.getRangeAt(0),c=t.globalOffset(i.startContainer,i.startOffset),g=t.globalOffset(i.endContainer,i.endOffset);c>=0&&g>=0&&g>c&&(a=c,o=g)}}catch{}T=n&&n.rangeCount?n.getRangeAt(0).cloneRange():null;var s=t.full.substring(a,o);if(R=k(s,a),!R.length){y(u("ra_nothing","Nothing to read"));return}m=0,C=!0,_=!1,r._map=t,r._opts=e||{},A(),w()};function w(){var e=E();if(!e||m>=R.length){r.Stop();return}var t=R[m],n=new SpeechSynthesisUtterance(t.text),a=r._opts&&r._opts.rate||v&&parseFloat(v.value)||x.readAloudRate||1;n.rate=Math.min(2,Math.max(.5,a));var o=B();o&&(n.voice=o),n.onstart=function(){x.readAloudHighlight!==!1&&O(t),y(u("ra_readingof","Reading\u2026 ({0}/{1})",m+1,R.length))},n.onend=function(){C&&(m++,w())},n.onerror=function(){C&&(m++,w())};try{e.speak(n)}catch{m++,w()}}function O(e){try{var t=r._map;if(!t)return;var n=t.locate(e.start),a=t.locate(e.end);if(!n||!a)return;var o=d.getDocument(),i=o.createRange();i.setStart(n.node,n.offset),i.setEnd(a.node,a.offset);var c=d.getSelection();c&&(c.removeAllRanges(),c.addRange(i))}catch{}}r.Pause=function(){var e=E();if(!(!e||!C)&&!_){try{e.pause()}catch{}_=!0,A(),y(u("ra_paused","Paused"))}},r.Resume=function(){var e=E();if(!(!e||!C)&&_){try{e.resume()}catch{}_=!1,A(),y(u("ra_reading","Reading\u2026"))}},r.Stop=function(){var e=E();if(C=!1,_=!1,R=[],m=0,e)try{e.cancel()}catch{}try{if(T){var t=d.getSelection();t&&(t.removeAllRanges(),t.addRange(T))}}catch{}T=null,A(),y("")};function I(){var e=E();if(!(!e||!f)){var t=e.getVoices()||[];if(t.length){var n=f.value;f.innerHTML="",t.forEach(function(a,o){var i=f.ownerDocument.createElement("option");i.value=a.name,i.textContent=a.name+" ("+a.lang+")",a.default&&(i.textContent+=" (default)"),f.appendChild(i)}),n&&(f.value=n)}}}function B(){var e=E();if(!e)return null;var t=e.getVoices()||[];if(r._opts&&r._opts.voice){for(var n=0;n<t.length;n++)if(t[n].name===r._opts.voice)return t[n]}if(f&&f.value){for(var a=0;a<t.length;a++)if(t[a].name===f.value)return t[a]}return null}function P(e,t,n){var a=e.ownerDocument.createElement("button");return a.type="button",a.textContent=t,n&&(a.title=n),a.className="rte-readaloud-button",e.appendChild(a),a}r.OpenBar=function(){if(!l){var e=document;l=e.createElement("div");var t=!1;try{var n=d.container&&d.container.classList;t=!!n&&(n.contains("rte-dark")||n.contains("rte-auto-dark")&&!n.contains("rte-light")&&!!(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches))}catch{t=!1}l.className="rte-readaloud-bar"+(t?" rte-readaloud-dark":"");var a=e.createElement("span");a.className="rte-readaloud-title",a.textContent=u("ra_read","Read"),l.appendChild(a),N=P(l,u("ra_play","Play"),u("ra_playpause","Play / Pause"));var o=P(l,u("ra_stop","Stop"),u("ra_stop","Stop"));f=e.createElement("select"),f.className="rte-readaloud-voice",f.title=u("ra_voice","Voice"),l.appendChild(f),v=e.createElement("select"),v.className="rte-readaloud-rate",v.title=u("ra_speed","Speed"),["0.75","1","1.25","1.5","2"].forEach(function(g){var s=e.createElement("option");s.value=g,s.textContent=g+"x",g==="1"&&(s.selected=!0),v.appendChild(s)}),l.appendChild(v),S=e.createElement("span"),S.className="rte-readaloud-status",l.appendChild(S);var i=P(l,u("close","Close"),u("close","Close"));i.className+=" is-close",e.body.appendChild(l),I();var c=E();c&&typeof c.addEventListener=="function"&&c.addEventListener("voiceschanged",I),N.onclick=function(){C?_?r.Resume():r.Pause():r.Start({})},o.onclick=function(){r.Stop()},i.onclick=function(){r.CloseBar()},r.Start({})}},r.CloseBar=function(){r.Stop(),l&&l.parentNode&&l.parentNode.removeChild(l),l=null,N=S=f=v=null};function A(){N&&(N.textContent=C&&!_?u("ra_pause","Pause"):u("ra_play","Play"))}function y(e){S&&(S.textContent=e)}}
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_readaloud=RTE_Plugin_ReadAloud,RTE_DefaultConfig.readAloudRate=RTE_DefaultConfig.readAloudRate||1,RTE_DefaultConfig.readAloudHighlight=typeof RTE_DefaultConfig.readAloudHighlight>"u"?!0:RTE_DefaultConfig.readAloudHighlight;function RTE_Plugin_ReadAloud(){var r=this,x,d,l=null,T,R,f,v,S=[],m=0,_=!1,C=!1,N=null;r.PluginName="ReadAloud";function E(){return window.speechSynthesis||null}function b(){return!!E()&&typeof window.SpeechSynthesisUtterance=="function"}r.InitConfig=function(e){x=e};function u(e,t){for(var n=x&&x["text_"+e]||t,a=2;a<arguments.length;a++)n=n.split("{"+(a-2)+"}").join(String(arguments[a]));return n}r.InitEditor=function(e){d=e,d.readAloud=function(t){r.Start(t||{})},d.stopReadAloud=function(){r.Stop()},d.attachEvent("exec_command_readaloud",function(t){if(t.returnValue=!0,!b()){r.NotifyUnsupported();return}l?r.CloseBar():r.OpenBar()});try{window.addEventListener("pagehide",function(){r.Stop()}),document.addEventListener("visibilitychange",function(){document.hidden&&r.Pause()})}catch{}},r.NotifyUnsupported=function(){try{var e=d.createDialog(d.getLangText&&d.getLangText("readaloudtitle")||"Read aloud","rte-dialog-readaloud"),t=e.ownerDocument.createElement("div");t.style.cssText="padding:16px;min-width:320px;font:13px -apple-system,Segoe UI,sans-serif",t.textContent=u("ra_unsupported","This browser does not provide a speech synthesizer (Web Speech API). Read-aloud is unavailable here."),e.appendChild(t)}catch{}};function L(){for(var e=d.getEditable(),t=e.ownerDocument,n=t.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:function(s){for(var h=s.parentNode;h&&h!==e;){var p=h.nodeName;if(p==="SCRIPT"||p==="STYLE"||p==="NOSCRIPT")return NodeFilter.FILTER_REJECT;h=h.parentNode}return s.data&&s.data.length?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),a=[],o="",i;i=n.nextNode();)a.push({node:i,start:o.length,len:i.data.length}),o+=i.data;function c(s){for(var h=0;h<a.length;h++){var p=a[h];if(s<=p.start+p.len)return{node:p.node,offset:Math.max(0,s-p.start)}}var D=a[a.length-1];return D?{node:D.node,offset:D.len}:null}function g(s,h){for(var p=0;p<a.length;p++)if(a[p].node===s)return a[p].start+h;return-1}return{full:o,locate:c,globalOffset:g,hasNodes:a.length>0}}function k(e,t){for(var n=[],a=/[^.!?\n\u3002\uff01\uff1f]*[.!?\n\u3002\uff01\uff1f]+|\S[^.!?\n]*$/g,o;(o=a.exec(e))!==null;)o[0]&&/\S/.test(o[0])&&n.push({text:o[0],start:t+o.index,end:t+o.index+o[0].length}),o.index===a.lastIndex&&a.lastIndex++;return!n.length&&/\S/.test(e)&&n.push({text:e,start:t,end:t+e.length}),n}r.Start=function(e){if(!b()){r.NotifyUnsupported();return}r.Stop();var t=L();if(!t.hasNodes){y(u("ra_nothing","Nothing to read"));return}var n=d.getSelection?d.getSelection():null,a=0,o=t.full.length;try{if(n&&n.rangeCount&&!n.isCollapsed){var i=n.getRangeAt(0),c=t.globalOffset(i.startContainer,i.startOffset),g=t.globalOffset(i.endContainer,i.endOffset);c>=0&&g>=0&&g>c&&(a=c,o=g)}}catch{}N=n&&n.rangeCount?n.getRangeAt(0).cloneRange():null;var s=t.full.substring(a,o);if(S=k(s,a),!S.length){y(u("ra_nothing","Nothing to read"));return}m=0,_=!0,C=!1,r._map=t,r._opts=e||{},A(),w()};function w(){var e=E();if(!e||m>=S.length){r.Stop();return}var t=S[m],n=new SpeechSynthesisUtterance(t.text),a=r._opts&&r._opts.rate||v&&parseFloat(v.value)||x.readAloudRate||1;n.rate=Math.min(2,Math.max(.5,a));var o=B();o&&(n.voice=o),n.onstart=function(){x.readAloudHighlight!==!1&&O(t),y(u("ra_readingof","Reading\u2026 ({0}/{1})",m+1,S.length))},n.onend=function(){_&&(m++,w())},n.onerror=function(){_&&(m++,w())};try{e.speak(n)}catch{m++,w()}}function O(e){try{var t=r._map;if(!t)return;var n=t.locate(e.start),a=t.locate(e.end);if(!n||!a)return;var o=d.getDocument(),i=o.createRange();i.setStart(n.node,n.offset),i.setEnd(a.node,a.offset);var c=d.getSelection();c&&(c.removeAllRanges(),c.addRange(i))}catch{}}r.Pause=function(){var e=E();if(!(!e||!_)&&!C){try{e.pause()}catch{}C=!0,A(),y(u("ra_paused","Paused"))}},r.Resume=function(){var e=E();if(!(!e||!_)&&C){try{e.resume()}catch{}C=!1,A(),y(u("ra_reading","Reading\u2026"))}},r.Stop=function(){var e=E();if(_=!1,C=!1,S=[],m=0,e)try{e.cancel()}catch{}try{if(N){var t=d.getSelection();t&&(t.removeAllRanges(),t.addRange(N))}}catch{}N=null,A(),y("")};function I(){var e=E();if(!(!e||!f)){var t=e.getVoices()||[];if(t.length){var n=f.value;f.innerHTML=__RTE_TT(""),t.forEach(function(a,o){var i=f.ownerDocument.createElement("option");i.value=a.name,i.textContent=a.name+" ("+a.lang+")",a.default&&(i.textContent+=" (default)"),f.appendChild(i)}),n&&(f.value=n)}}}function B(){var e=E();if(!e)return null;var t=e.getVoices()||[];if(r._opts&&r._opts.voice){for(var n=0;n<t.length;n++)if(t[n].name===r._opts.voice)return t[n]}if(f&&f.value){for(var a=0;a<t.length;a++)if(t[a].name===f.value)return t[a]}return null}function P(e,t,n){var a=e.ownerDocument.createElement("button");return a.type="button",a.textContent=t,n&&(a.title=n),a.className="rte-readaloud-button",e.appendChild(a),a}r.OpenBar=function(){if(!l){var e=document;l=e.createElement("div");var t=!1;try{var n=d.container&&d.container.classList;t=!!n&&(n.contains("rte-dark")||n.contains("rte-auto-dark")&&!n.contains("rte-light")&&!!(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches))}catch{t=!1}l.className="rte-readaloud-bar"+(t?" rte-readaloud-dark":"");var a=e.createElement("span");a.className="rte-readaloud-title",a.textContent=u("ra_read","Read"),l.appendChild(a),T=P(l,u("ra_play","Play"),u("ra_playpause","Play / Pause"));var o=P(l,u("ra_stop","Stop"),u("ra_stop","Stop"));f=e.createElement("select"),f.className="rte-readaloud-voice",f.title=u("ra_voice","Voice"),l.appendChild(f),v=e.createElement("select"),v.className="rte-readaloud-rate",v.title=u("ra_speed","Speed"),["0.75","1","1.25","1.5","2"].forEach(function(g){var s=e.createElement("option");s.value=g,s.textContent=g+"x",g==="1"&&(s.selected=!0),v.appendChild(s)}),l.appendChild(v),R=e.createElement("span"),R.className="rte-readaloud-status",l.appendChild(R);var i=P(l,u("close","Close"),u("close","Close"));i.className+=" is-close",e.body.appendChild(l),I();var c=E();c&&typeof c.addEventListener=="function"&&c.addEventListener("voiceschanged",I),T.onclick=function(){_?C?r.Resume():r.Pause():r.Start({})},o.onclick=function(){r.Stop()},i.onclick=function(){r.CloseBar()},r.Start({})}},r.CloseBar=function(){r.Stop(),l&&l.parentNode&&l.parentNode.removeChild(l),l=null,T=R=f=v=null};function A(){T&&(T.textContent=_&&!C?u("ra_pause","Pause"):u("ra_play","Play"))}function y(e){R&&(R.textContent=e)}}
@@ -435,7 +435,7 @@ function RTE_Plugin_RevisionHistory() {
435
435
 
436
436
  function stripHtml(html) {
437
437
  var tmp = document.createElement("div");
438
- tmp.innerHTML = html || "";
438
+ tmp.innerHTML = __RTE_TT(html || "");
439
439
  return tmp.innerText || tmp.textContent || "";
440
440
  }
441
441
 
@@ -552,7 +552,7 @@ function RTE_Plugin_RevisionHistory() {
552
552
  // (or a previous render partially failed) `.rte-rev-panel` may be
553
553
  // missing. Bail out instead of dereferencing null on innerHTML.
554
554
  if (!panel) { closeDialog(); return; }
555
- panel.innerHTML = "";
555
+ panel.innerHTML = __RTE_TT("");
556
556
 
557
557
  var header = host.createElement("div");
558
558
  header.className = "rte-rev-header";
@@ -677,10 +677,10 @@ function RTE_Plugin_RevisionHistory() {
677
677
  setTimeout(function () {
678
678
  try {
679
679
  iframe.contentDocument.open();
680
- iframe.contentDocument.write(
680
+ iframe.contentDocument.write(__RTE_TT(
681
681
  '<!DOCTYPE html><html><head><meta charset="utf-8"><style>body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;padding:16px;color:#0f172a;line-height:1.6}img{max-width:100%}</style></head><body>' +
682
682
  (selected.html || "") +
683
- "</body></html>"
683
+ "</body></html>")
684
684
  );
685
685
  iframe.contentDocument.close();
686
686
  } catch (err) { }
@@ -1,3 +1,3 @@
1
- window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.svgCode_revisionhistory||(RTE_DefaultConfig.svgCode_revisionhistory='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 3-6.7"/><path d="M3 4v5h5"/><path d="M12 8v4l3 2"/></svg>'),RTE_DefaultConfig.plugin_revisionhistory=RTE_Plugin_RevisionHistory;function RTE_Plugin_RevisionHistory(){var z=this,a,o,s=null,Y=null,K="";z.PluginName="RevisionHistory",z.InitConfig=function(r){a=r,a.revisionHistoryEnabled!==!1&&(a.revisionHistoryMaxEntries=a.revisionHistoryMaxEntries||50,a.revisionHistoryAutoSnapshotMs=a.revisionHistoryAutoSnapshotMs||0,a.revisionHistoryUrl=a.revisionHistoryUrl||"",a.revisionHistoryRequestHeaders=a.revisionHistoryRequestHeaders||null,a.onRevisionHistorySyncError=a.onRevisionHistorySyncError||null,a.text_revisionhistory=a.text_revisionhistory||"Revision history",P("toolbar_default","#{revisionhistory}"),P("toolbar_full","#{revisionhistory}"),P("toolbar_mobile","#{revisionhistory}"),(a.controltoolbar_TEXT||"").indexOf("revisionhistory")===-1&&(a.controltoolbar_TEXT=(a.controltoolbar_TEXT||"")+"|{revisionhistory}"))},z.InitEditor=function(r){o=r,a.revisionHistoryEnabled!==!1&&(o.revisionHistory={snapshot:function(e,t){return D(e,t)},promptAndSnapshot:function(e){return pe(e)},rename:function(e,t){return he(e,t)},list:function(){return g().slice().sort(function(e,t){return(t.createdAt||0)-(e.createdAt||0)})},listNamed:function(){return g().slice().filter(function(e){return e.isNamed===!0}).sort(function(e,t){return(t.createdAt||0)-(e.createdAt||0)})},get:function(e){return m(e)},restore:function(e,t){return ie(e,t||{})},delete:function(e){return ae(e)},clear:function(){return me()},diff:function(e,t){return ge(e,t)},openBrowser:function(){$()},closeBrowser:function(){S()}},o.toolbarFactoryMap=o.toolbarFactoryMap||{},o.toolbarFactoryMap.revisionhistory=function(e){return o.createToolbarButton(e)},o.attachEvent("exec_command_revisionhistory",function(e){e.returnValue=!0,e.stopBubble=!0,$()}),ke(),ve(),K=o.getHTML?o.getHTML():"",a.revisionHistoryAutoSnapshotMs>0&&(o.bindDocumentEvent?function(e){o.bindDocumentEvent("input",e,!0)}:function(e){o.getDocument().addEventListener("input",e,!0)})(function(){Y&&clearTimeout(Y),Y=setTimeout(function(){var e=o.getHTML();e!==K&&D("Auto",{auto:!0})},a.revisionHistoryAutoSnapshotMs)}),(o.bindDocumentEvent?function(e){o.bindDocumentEvent("keydown",e,!0)}:function(e){o.getDocument().addEventListener("keydown",e,!0)})(function(e){(e.ctrlKey||e.metaKey)&&e.altKey&&e.shiftKey&&(e.key==="H"||e.key==="h"||e.code==="KeyH")&&(e.preventDefault(),$())}))};function P(r,e){a[r]&&a[r].indexOf(e)===-1&&(a[r]=a[r]+e)}function de(){return a.currentUser&&a.currentUser.id?a.currentUser:{id:"user",name:"User",color:"#64748b"}}var V=null,J="RTE.Revisions.default";function X(){if(a.revisionHistoryKey)return"RTE.Revisions."+a.revisionHistoryKey;if(a.aiToolkitPersistenceKey)return"RTE.Revisions."+a.aiToolkitPersistenceKey;if(V)return V;var r="default";try{r=location.pathname+location.search}catch{}var e="";try{var t=o.input;if(t&&(e=t.id||t.getAttribute("name")||""),!e&&o.container&&o.container.id&&(e=o.container.id),!e){for(var n=document.querySelectorAll(".richtexteditor"),l=1;l<n.length;l++)if(n[l]===o.container){e="editor-"+l;break}}}catch{}return V="RTE.Revisions."+r+(e?"#"+e:"")}function ce(){if(!(a.revisionHistoryKey||a.aiToolkitPersistenceKey||g().length))try{if(!window.localStorage||document.querySelectorAll(".richtexteditor").length!==1)return;var r=X(),e=window.localStorage.getItem(J);if(!e||r===J||window.localStorage.getItem(r))return;var t=JSON.parse(e);if(!Array.isArray(t))return;window.localStorage.setItem(r,e),window.localStorage.removeItem(J),o.__revisions=t,s&&s.isConnected&&h()}catch{}}function g(){return o.__revisions||(o.__revisions=[]),o.__revisions}function m(r){for(var e=g(),t=0;t<e.length;t++)if(e[t].id===r)return e[t];return null}function q(){for(var r=g();r.length>a.revisionHistoryMaxEntries;)r.shift();try{window.localStorage&&window.localStorage.setItem(X(),JSON.stringify(r))}catch(e){console.warn("revisionhistory: localStorage quota or access issue:",e&&e.message)}a.revisionHistoryUrl&&fe(r)}function fe(r){try{var e=new XMLHttpRequest;e.open("POST",a.revisionHistoryUrl,!0),e.setRequestHeader("Content-Type","application/json");var t=ue();for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(n)){var l=String(t[n]);if(!/\r|\n/.test(l))try{e.setRequestHeader(n,l)}catch{}}e.onerror=function(){j({reason:"network",status:e.status||0})},e.onload=function(){(e.status<200||e.status>=300)&&j({reason:"http",status:e.status,responseText:(e.responseText||"").slice(0,512)})},e.send(JSON.stringify({documentKey:a.aiToolkitPersistenceKey||"",savedAt:Date.now(),revisions:r}))}catch(c){j({reason:"exception",error:c})}}function ue(){var r=a.revisionHistoryRequestHeaders;if(typeof r=="function")try{r=r(o)}catch(e){return j({reason:"header-provider",error:e}),{}}return r&&typeof r=="object"?r:{}}function j(r){console.warn("revisionhistory: remote persistence failed:",r&&r.reason,r&&r.status);try{typeof a.onRevisionHistorySyncError=="function"&&a.onRevisionHistorySyncError(r)}catch{}try{typeof o.fireEvent=="function"&&o.fireEvent("revision_history_sync_error",r)}catch{}}function ve(){setTimeout(ce,0);try{if(!window.localStorage)return;var r=window.localStorage.getItem(X());if(!r)return;var e=JSON.parse(r);Array.isArray(e)&&(o.__revisions=e)}catch{}}function D(r,e){var t=o.getHTML?o.getHTML():o.getHTMLCode?o.getHTMLCode():"",n=de(),l=(r||"").toString().slice(0,120),c=l.length>0&&(!e||e.auto!==!0),i={id:"rev-"+Date.now()+"-"+Math.floor(Math.random()*1e4),html:t,text:o.getText?o.getText():N(t),label:l||be(),isNamed:c,author:{id:n.id,name:n.name,color:n.color},createdAt:Date.now(),metadata:e||{}};g().push(i),K=t,q(),s&&s.isConnected&&h();try{typeof o.fireEvent=="function"&&o.fireEvent("revision_snapshot",{id:i.id,label:i.label,isNamed:i.isNamed,createdAt:i.createdAt})}catch{}return i}function v(r,e,t){var n=a&&a["text_"+r]||e;return t===void 0?n:n.split("{0}").join(String(t))}function pe(r){var e=o.iframe?o.iframe.ownerDocument:document,t=e.defaultView||window,n=t.prompt(v("rh_nameversion",'Name this version (e.g. "Draft sent to legal"):'),r||"");if(n===null)return null;var l=(n||"").trim();return l?D(l,{user:!0}):null}function he(r,e){var t=m(r);if(!t)return!1;var n=(e||"").toString().trim().slice(0,120);return n?(t.label=n,t.isNamed=!0,q(),s&&s.isConnected&&h(),!0):!1}function ge(r,e){var t=m(r),n=m(e);if(!t||!n)return null;var l=t.text||N(t.html),c=n.text||N(n.html);return{oldEntry:t,newEntry:n,oldText:l,newText:c,lines:se(l,c)}}function be(){var r=new Date;function e(t){return t<10?"0"+t:""+t}return e(r.getHours())+":"+e(r.getMinutes())+":"+e(r.getSeconds())}function ie(r,e){e=e||{};var t=m(r);if(!t)return!1;var n=a.revisionHistorySnapshotBeforeRestore!==!1;if(!e.skipConfirm){var l=o.iframe?o.iframe.ownerDocument:document,c=n?v("rh_restorekeep","Restore this version? Your current content is kept as a version first, so you can go back to it."):v("rh_restorereplace","Restore this version? Your current content will be replaced (this itself is not auto-snapshotted).");if(!l.defaultView.confirm(c))return!1}if(n){for(var i=o.getHTML?o.getHTML():o.getHTMLCode?o.getHTMLCode():"",u=null,d=g(),f=0;f<d.length;f++)(!u||(d[f].createdAt||0)>=(u.createdAt||0))&&(u=d[f]);i!==t.html&&(!u||u.html!==i)&&D(v("rh_beforerestore","Before restoring {0}",t.label),{beforeRestore:t.id})}return o.setHTMLCode?o.setHTMLCode(t.html,{undoable:!0}):o.setHTML&&o.setHTML(t.html),K=t.html,s&&s.isConnected&&S(),!0}function ae(r){for(var e=g(),t=0;t<e.length;t++)if(e[t].id===r)return e.splice(t,1),q(),s&&s.isConnected&&h(),!0;return!1}function me(){o.__revisions=[],q(),s&&s.isConnected&&h()}function se(r,e){for(var t=String(r||"").split(/\r?\n/),n=String(e||"").split(/\r?\n/),l=[],c=ye(t,n),i=0,u=0,d=0;i<t.length&&u<n.length;)d<c.length&&t[i]===c[d]&&n[u]===c[d]?(l.push({type:"eq",text:t[i]}),i++,u++,d++):d<c.length&&t[i]!==c[d]?(l.push({type:"del",text:t[i]}),i++):d<c.length&&n[u]!==c[d]?(l.push({type:"add",text:n[u]}),u++):i<t.length?(l.push({type:"del",text:t[i]}),i++):u<n.length&&(l.push({type:"add",text:n[u]}),u++);for(;i<t.length;)l.push({type:"del",text:t[i]}),i++;for(;u<n.length;)l.push({type:"add",text:n[u]}),u++;return l}function ye(r,e){for(var t=r.length,n=e.length,l=new Array(n+1).fill(0),c=new Array(n+1).fill(0),i=[],d=0;d<=t;d++)i.push(new Array(n+1).fill(0));for(var d=1;d<=t;d++)for(var f=1;f<=n;f++)r[d-1]===e[f-1]?i[d][f]=i[d-1][f-1]+1:i[d][f]=Math.max(i[d-1][f],i[d][f-1]);for(var u=[],d=t,f=n;d>0&&f>0;)r[d-1]===e[f-1]?(u.unshift(r[d-1]),d--,f--):i[d-1][f]>=i[d][f-1]?d--:f--;return u}function N(r){var e=document.createElement("div");return e.innerHTML=r||"",e.innerText||e.textContent||""}function $(){if(!(s&&s.isConnected)&&!(!o||!o.iframe||!o.iframe.ownerDocument)){s&&!s.isConnected&&(s=null);var r=o.iframe.ownerDocument;if(!(!r||!r.body)){s=r.createElement("div");var e=!1;try{var t=o.container||o.getEditable&&o.getEditable().closest&&o.getEditable().closest(".richtexteditor");e=!!(t&&t.classList&&t.classList.contains("rte-dark"))}catch{}s.className="rte-rev-dialog"+(e?" rte-rev-dark":""),s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-labelledby","rte-rev-dialog-title");var n=r.createElement("div");n.className="rte-rev-backdrop",n.addEventListener("mousedown",function(c){c.target===n&&S()});var l=r.createElement("div");l.className="rte-rev-panel",n.appendChild(l),s.appendChild(n),G=r.activeElement,s.addEventListener("keydown",xe,!0),r.body.appendChild(s),h(),setTimeout(Z,0),setTimeout(function(){s&&!s.contains(s.ownerDocument.activeElement)&&Z()},250)}}}var G=null;function le(){if(!s)return[];for(var r=s.querySelectorAll("button, input, select, textarea, a[href], [tabindex]:not([tabindex='-1'])"),e=[],t=0;t<r.length;t++)!r[t].disabled&&r[t].offsetParent!==null&&e.push(r[t]);return e}function Z(){var r=le();if(r.length)try{r[0].focus()}catch{}}function T(r,e,t){r.setAttribute("data-rte-rev-key",e),r.addEventListener("mousedown",function(n){n.preventDefault()}),r.addEventListener("click",function(n){n.preventDefault();var l=n.detail===0;if(t(),!(!l||!s)){for(var c=s.querySelectorAll("[data-rte-rev-key]"),i=0;i<c.length;i++)if(c[i].getAttribute("data-rte-rev-key")===e){try{c[i].focus()}catch{}return}s.contains(s.ownerDocument.activeElement)||Z()}})}function xe(r){if(r.key==="Escape"||r.key==="Esc"){r.preventDefault(),r.stopPropagation(),S();return}if(r.key==="Tab"){var e=le();if(e.length){var t=s.ownerDocument.activeElement,n=e.indexOf(t);r.shiftKey&&n<=0?(r.preventDefault(),e[e.length-1].focus()):!r.shiftKey&&(n===-1||n===e.length-1)&&(r.preventDefault(),e[0].focus())}}}function S(){s&&s.parentNode&&s.parentNode.removeChild(s),s=null;var r=G;G=null;try{r&&r.isConnected&&r.tagName!=="IFRAME"&&r!==r.ownerDocument.body?r.focus():typeof o.focus=="function"&&o.focus()}catch{}}var y=null,x="preview";function h(){if(s){var r=s.ownerDocument,e=s.querySelector(".rte-rev-panel");if(!e){S();return}e.innerHTML="";var t=r.createElement("div");t.className="rte-rev-header";var n=r.createElement("div");n.id="rte-rev-dialog-title",n.className="rte-rev-title",n.textContent=v("revisionhistory","Revision history"),t.appendChild(n);var l=r.createElement("div");l.className="rte-rev-header-actions";var c=r.createElement("button");c.type="button",c.className="rte-rev-btn rte-rev-btn-ghost",c.textContent=v("rh_savenow","Save version now"),T(c,"save",function(){var p=r.defaultView.prompt(v("rh_labelversion","Label this version (optional):"),"");p!==null&&D(p||"")}),l.appendChild(c);var i=r.createElement("button");i.type="button",i.className="rte-rev-btn rte-rev-btn-ghost",i.textContent=v("close","Close"),i.setAttribute("aria-label",v("rh_closehistory","Close revision history")),T(i,"close",S),l.appendChild(i),t.appendChild(l),e.appendChild(t);var u=r.createElement("div");u.className="rte-rev-body";var d=r.createElement("div");d.className="rte-rev-list";var f=o.revisionHistory.list();if(f.length&&(d.setAttribute("role","listbox"),d.setAttribute("aria-label",v("rh_saved","Saved revisions"))),f.length){(!y||!m(y))&&(y=f[0].id);for(var Q=0;Q<f.length;Q++)(function(p){var b=r.createElement("button");b.type="button",b.className="rte-rev-row"+(p.id===y?" rte-rev-row-active":""),b.setAttribute("role","option"),b.setAttribute("aria-selected",p.id===y?"true":"false");var te=r.createElement("span");te.className="rte-rev-dot",te.style.background=p.author&&p.author.color||"#64748b";var oe=r.createElement("div");oe.className="rte-rev-row-who",oe.textContent=p.author&&p.author.name||v("rh_user","User");var ne=r.createElement("div");ne.className="rte-rev-row-when",ne.textContent=we(p.createdAt)+" \xB7 "+(p.label||"");var U=r.createElement("div");U.className="rte-rev-row-col",U.appendChild(oe),U.appendChild(ne),b.appendChild(te),b.appendChild(U),T(b,"row-"+p.id,function(){y=p.id,h()}),d.appendChild(b)})(f[Q])}else{var B=r.createElement("div");B.className="rte-rev-empty",B.textContent=v("rh_empty",'No revisions yet. Click "Save version now" to capture the current document.'),d.appendChild(B)}u.appendChild(d);var R=r.createElement("div");if(R.className="rte-rev-pane",f.length){var w=m(y)||f[0],H=r.createElement("div");H.className="rte-rev-tabs",H.setAttribute("role","tablist"),H.setAttribute("aria-label",v("rh_view","Revision view"));var k=r.createElement("button");k.type="button",k.className="rte-rev-tab"+(x==="preview"?" rte-rev-tab-active":""),k.setAttribute("role","tab"),k.setAttribute("aria-selected",x==="preview"?"true":"false"),k.textContent=v("rh_preview","Preview"),T(k,"tab-preview",function(){x="preview",h()});var E=r.createElement("button");E.type="button",E.className="rte-rev-tab"+(x==="diff"?" rte-rev-tab-active":""),E.setAttribute("role","tab"),E.setAttribute("aria-selected",x==="diff"?"true":"false"),E.textContent=v("rh_diff","Diff vs current"),T(E,"tab-diff",function(){x="diff",h()}),H.appendChild(k),H.appendChild(E),R.appendChild(H);var F=r.createElement("div");if(F.className="rte-rev-content",x==="preview"){var C=r.createElement("iframe");C.className="rte-rev-preview-frame",C.setAttribute("title",v("rh_previewframe","Revision preview")),C.setAttribute("sandbox","allow-same-origin"),F.appendChild(C),setTimeout(function(){try{C.contentDocument.open(),C.contentDocument.write('<!DOCTYPE html><html><head><meta charset="utf-8"><style>body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;padding:16px;color:#0f172a;line-height:1.6}img{max-width:100%}</style></head><body>'+(w.html||"")+"</body></html>"),C.contentDocument.close()}catch{}},0)}else{var Ee=o.getText?o.getText():N(o.getHTML()),M=se(w.text||N(w.html),Ee),W=r.createElement("pre");W.className="rte-rev-diff";for(var _=0;_<M.length;_++){var ee=r.createElement("span");ee.className="rte-rev-diff-line rte-rev-diff-"+M[_].type,ee.textContent=(M[_].type==="add"?"+ ":M[_].type==="del"?"- ":" ")+M[_].text+`
2
- `,W.appendChild(ee)}F.appendChild(W)}R.appendChild(F);var I=r.createElement("div");I.className="rte-rev-footer";var re=r.createElement("div");re.className="rte-rev-footer-info",re.textContent=w.label?v("rh_label","Label: {0}",w.label):"";var O=r.createElement("div");O.className="rte-rev-footer-btns";var L=r.createElement("button");L.type="button",L.className="rte-rev-btn rte-rev-btn-danger",L.textContent=v("delete","Delete"),T(L,"delete",function(){ae(w.id)});var A=r.createElement("button");A.type="button",A.className="rte-rev-btn rte-rev-btn-primary",A.textContent=v("rh_restore","Restore this version"),A.addEventListener("mousedown",function(p){p.preventDefault()}),A.addEventListener("click",function(p){p.preventDefault(),ie(w.id)}),O.appendChild(L),O.appendChild(A),I.appendChild(re),I.appendChild(O),R.appendChild(I)}f.length?u.appendChild(R):d.classList.add("rte-rev-list-solo"),e.appendChild(u)}}function we(r){if(!r)return"";var e=new Date(r),t=new Date;function n(c){return c<10?"0"+c:""+c}var l=n(e.getHours())+":"+n(e.getMinutes());return e.toDateString()===t.toDateString()?v("rh_today","Today {0}",l):e.getFullYear()+"-"+n(e.getMonth()+1)+"-"+n(e.getDate())+" "+l}function ke(){var r=o&&o.iframe&&o.iframe.ownerDocument||document;if(!r.querySelector("style[data-rte-revisionhistory]")){var e=r.createElement("style");e.setAttribute("data-rte-revisionhistory","1"),e.textContent=[".rte-rev-dialog{position:fixed;inset:0;z-index:2147483600;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;font-size:13px;color:#172033}",".rte-rev-backdrop{position:absolute;inset:0;background:linear-gradient(135deg,rgba(12,18,32,.44),rgba(40,54,77,.26));display:flex;align-items:center;justify-content:center;padding:18px}","/* 2026-07-12 revision dialog precision */",".rte-rev-panel{background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);border:1px solid rgba(117,137,163,.28);border-radius:8px;width:min(960px,calc(100vw - 28px));max-height:min(82vh,740px);display:flex;flex-direction:column;box-shadow:0 16px 40px rgba(35,48,72,.18);overflow:hidden}",".rte-rev-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid rgba(117,137,163,.18);background:rgba(255,255,255,.72)}",".rte-rev-title{font-size:16px;font-weight:760;letter-spacing:-.01em;color:#172033}",".rte-rev-header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}",".rte-rev-btn{padding:8px 12px;border-radius:7px;border:1px solid rgba(116,135,162,.25);font:inherit;font-size:12px;font-weight:680;line-height:1;cursor:pointer;background:#fff;color:#223652;box-shadow:0 1px 2px rgba(32,45,66,.06);transition:background .14s ease,border-color .14s ease,box-shadow .14s ease,transform .14s ease}",".rte-rev-btn:hover{background:#f5f8fc;border-color:rgba(81,111,151,.42);box-shadow:0 5px 14px rgba(32,45,66,.09);transform:translateY(-1px)}",".rte-rev-btn:focus-visible{outline:2px solid rgba(56,122,255,.34);outline-offset:2px}",".rte-rev-btn-ghost{background:#fff;color:#34506f}",".rte-rev-btn-primary{background:linear-gradient(135deg,#2563eb,#1d67ba);color:#fff;border-color:rgba(29,103,186,.85);box-shadow:0 8px 18px rgba(37,99,235,.22)}",".rte-rev-btn-primary:hover{background:linear-gradient(135deg,#1d4ed8,#195fad);color:#fff;border-color:rgba(29,78,216,.9);box-shadow:0 9px 20px rgba(37,99,235,.28)}",".rte-rev-btn-danger{background:#fff5f5;color:#9f1d1d;border-color:rgba(190,45,45,.22)}",".rte-rev-body{display:flex;flex:1;min-height:0;background:linear-gradient(90deg,#f8fbff 0%,#fff 42%)}",".rte-rev-list{width:258px;flex:0 0 258px;border-right:1px solid rgba(117,137,163,.18);overflow-y:auto;background:rgba(244,248,253,.78);padding:10px}",".rte-rev-empty{padding:16px;border:1px dashed rgba(99,118,145,.28);border-radius:8px;background:#fff;color:#5b6c81;font-size:12px;line-height:1.5}",".rte-rev-row{display:flex;align-items:center;gap:10px;width:100%;padding:10px;border:1px solid transparent;border-radius:8px;background:transparent;text-align:left;cursor:pointer;font:inherit;color:inherit}",".rte-rev-row:hover{background:#fff;border-color:rgba(93,122,161,.24);box-shadow:0 8px 18px rgba(33,48,70,.08)}",".rte-rev-row-active{background:#eef6ff;border-color:rgba(37,99,235,.28);box-shadow:0 8px 22px rgba(37,99,235,.12)}",".rte-rev-dot{width:9px;height:9px;border-radius:50%;flex:0 0 9px;box-shadow:0 0 0 3px rgba(255,255,255,.95),0 0 0 4px rgba(96,116,140,.18)}",".rte-rev-row-col{flex:1;min-width:0}",".rte-rev-row-who{font-weight:720;font-size:12px;line-height:1.25;color:#172033}",".rte-rev-row-when{margin-top:2px;font-size:11px;color:#637487;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-rev-pane{flex:1;display:flex;flex-direction:column;min-width:0;padding:10px}",".rte-rev-list.rte-rev-list-solo{flex:1 1 auto;width:auto;max-height:none;border-right:0;border-bottom:0}",".rte-rev-tabs{display:flex;align-self:flex-start;gap:3px;padding:3px;margin:0 0 10px;border:1px solid rgba(117,137,163,.2);border-radius:7px;background:#eef3f8}",".rte-rev-tab{padding:7px 12px;border:0;border-radius:6px;background:transparent;font:inherit;font-size:12px;font-weight:680;color:#637487;cursor:pointer}",".rte-rev-tab:hover{color:#1d3557;background:rgba(255,255,255,.58)}",".rte-rev-tab:focus-visible{outline:2px solid rgba(56,122,255,.34);outline-offset:2px}",".rte-rev-tab-active{color:#163966;background:#fff;box-shadow:0 2px 7px rgba(35,48,72,.08)}",".rte-rev-content{flex:1;overflow:auto;padding:0;border:1px solid rgba(117,137,163,.18);border-radius:8px;background:#fff;min-height:300px}",".rte-rev-preview-frame{width:100%;height:100%;min-height:330px;border:0;display:block;background:#fff}",".rte-rev-diff{margin:0;padding:14px 16px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;color:#172033;background:#fbfdff;min-height:100%}",".rte-rev-diff-line{display:block}",".rte-rev-diff-add{background:#e8f8ef;color:#17633f}",".rte-rev-diff-del{background:#fff0f0;color:#9f1d1d}",".rte-rev-diff-eq{color:#556575}",".rte-rev-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0 0;background:transparent}",".rte-rev-footer-info{font-size:12px;color:#637487;min-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",".rte-rev-footer-btns{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}","@media(max-width:720px){.rte-rev-backdrop{padding:10px;align-items:flex-start}.rte-rev-panel{width:calc(100vw - 20px);max-height:calc(100vh - 20px);border-radius:8px}.rte-rev-header{align-items:flex-start;flex-direction:column}.rte-rev-body{flex-direction:column}.rte-rev-list{width:auto;flex:0 0 auto;max-height:178px;border-right:0;border-bottom:1px solid rgba(117,137,163,.18)}.rte-rev-pane{min-height:360px}.rte-rev-footer{align-items:stretch;flex-direction:column}.rte-rev-footer-info{white-space:normal}.rte-rev-footer-btns{justify-content:stretch}.rte-rev-footer-btns .rte-rev-btn{flex:1}}",".rte-rev-dark{color:#e2e8f0}",".rte-rev-dark .rte-rev-panel{background:linear-gradient(180deg,#1e293b,#0f172a);border-color:#334155}",".rte-rev-dark .rte-rev-header{background:rgba(30,41,59,.72);border-color:#334155}",".rte-rev-dark .rte-rev-title,.rte-rev-dark .rte-rev-row-who{color:#e2e8f0}",".rte-rev-dark .rte-rev-btn,.rte-rev-dark .rte-rev-btn-ghost{background:#0f172a;color:#cbd5e1;border-color:#334155}",".rte-rev-dark .rte-rev-btn:hover{background:#334155}",".rte-rev-dark .rte-rev-btn-primary,.rte-rev-dark .rte-rev-btn-primary:hover{background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;border-color:#3b82f6}",".rte-rev-dark .rte-rev-body{background:#0f172a}",".rte-rev-dark .rte-rev-list{background:rgba(15,23,42,.6);border-color:#334155}",".rte-rev-dark .rte-rev-empty{background:#1e293b;color:#94a3b8;border-color:#334155}",".rte-rev-dark .rte-rev-row:hover{background:#1e293b;border-color:#334155}",".rte-rev-dark .rte-rev-row-active{background:#1e3a8a;border-color:#3b82f6}",".rte-rev-dark .rte-rev-row-when,.rte-rev-dark .rte-rev-footer-info{color:#94a3b8}",".rte-rev-dark .rte-rev-tabs{background:#1e293b;border-color:#334155}",".rte-rev-dark .rte-rev-tab{color:#94a3b8}.rte-rev-dark .rte-rev-tab-active{color:#fff;background:#1d4ed8}",".rte-rev-dark .rte-rev-diff{background:#0f172a;color:#cbd5e1}.rte-rev-dark .rte-rev-diff-eq{color:#94a3b8}",".rte-rev-dark .rte-rev-diff-add{background:rgba(16,185,129,.16);color:#6ee7b7}",".rte-rev-dark .rte-rev-diff-del{background:rgba(244,63,94,.16);color:#fda4af}"].join(`
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.svgCode_revisionhistory||(RTE_DefaultConfig.svgCode_revisionhistory='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 3-6.7"/><path d="M3 4v5h5"/><path d="M12 8v4l3 2"/></svg>'),RTE_DefaultConfig.plugin_revisionhistory=RTE_Plugin_RevisionHistory;function RTE_Plugin_RevisionHistory(){var z=this,a,o,s=null,Y=null,K="";z.PluginName="RevisionHistory",z.InitConfig=function(r){a=r,a.revisionHistoryEnabled!==!1&&(a.revisionHistoryMaxEntries=a.revisionHistoryMaxEntries||50,a.revisionHistoryAutoSnapshotMs=a.revisionHistoryAutoSnapshotMs||0,a.revisionHistoryUrl=a.revisionHistoryUrl||"",a.revisionHistoryRequestHeaders=a.revisionHistoryRequestHeaders||null,a.onRevisionHistorySyncError=a.onRevisionHistorySyncError||null,a.text_revisionhistory=a.text_revisionhistory||"Revision history",P("toolbar_default","#{revisionhistory}"),P("toolbar_full","#{revisionhistory}"),P("toolbar_mobile","#{revisionhistory}"),(a.controltoolbar_TEXT||"").indexOf("revisionhistory")===-1&&(a.controltoolbar_TEXT=(a.controltoolbar_TEXT||"")+"|{revisionhistory}"))},z.InitEditor=function(r){o=r,a.revisionHistoryEnabled!==!1&&(o.revisionHistory={snapshot:function(e,t){return R(e,t)},promptAndSnapshot:function(e){return pe(e)},rename:function(e,t){return he(e,t)},list:function(){return g().slice().sort(function(e,t){return(t.createdAt||0)-(e.createdAt||0)})},listNamed:function(){return g().slice().filter(function(e){return e.isNamed===!0}).sort(function(e,t){return(t.createdAt||0)-(e.createdAt||0)})},get:function(e){return m(e)},restore:function(e,t){return ie(e,t||{})},delete:function(e){return ae(e)},clear:function(){return me()},diff:function(e,t){return ge(e,t)},openBrowser:function(){$()},closeBrowser:function(){_()}},o.toolbarFactoryMap=o.toolbarFactoryMap||{},o.toolbarFactoryMap.revisionhistory=function(e){return o.createToolbarButton(e)},o.attachEvent("exec_command_revisionhistory",function(e){e.returnValue=!0,e.stopBubble=!0,$()}),ke(),ve(),K=o.getHTML?o.getHTML():"",a.revisionHistoryAutoSnapshotMs>0&&(o.bindDocumentEvent?function(e){o.bindDocumentEvent("input",e,!0)}:function(e){o.getDocument().addEventListener("input",e,!0)})(function(){Y&&clearTimeout(Y),Y=setTimeout(function(){var e=o.getHTML();e!==K&&R("Auto",{auto:!0})},a.revisionHistoryAutoSnapshotMs)}),(o.bindDocumentEvent?function(e){o.bindDocumentEvent("keydown",e,!0)}:function(e){o.getDocument().addEventListener("keydown",e,!0)})(function(e){(e.ctrlKey||e.metaKey)&&e.altKey&&e.shiftKey&&(e.key==="H"||e.key==="h"||e.code==="KeyH")&&(e.preventDefault(),$())}))};function P(r,e){a[r]&&a[r].indexOf(e)===-1&&(a[r]=a[r]+e)}function de(){return a.currentUser&&a.currentUser.id?a.currentUser:{id:"user",name:"User",color:"#64748b"}}var V=null,J="RTE.Revisions.default";function X(){if(a.revisionHistoryKey)return"RTE.Revisions."+a.revisionHistoryKey;if(a.aiToolkitPersistenceKey)return"RTE.Revisions."+a.aiToolkitPersistenceKey;if(V)return V;var r="default";try{r=location.pathname+location.search}catch{}var e="";try{var t=o.input;if(t&&(e=t.id||t.getAttribute("name")||""),!e&&o.container&&o.container.id&&(e=o.container.id),!e){for(var n=document.querySelectorAll(".richtexteditor"),l=1;l<n.length;l++)if(n[l]===o.container){e="editor-"+l;break}}}catch{}return V="RTE.Revisions."+r+(e?"#"+e:"")}function ce(){if(!(a.revisionHistoryKey||a.aiToolkitPersistenceKey||g().length))try{if(!window.localStorage||document.querySelectorAll(".richtexteditor").length!==1)return;var r=X(),e=window.localStorage.getItem(J);if(!e||r===J||window.localStorage.getItem(r))return;var t=JSON.parse(e);if(!Array.isArray(t))return;window.localStorage.setItem(r,e),window.localStorage.removeItem(J),o.__revisions=t,s&&s.isConnected&&h()}catch{}}function g(){return o.__revisions||(o.__revisions=[]),o.__revisions}function m(r){for(var e=g(),t=0;t<e.length;t++)if(e[t].id===r)return e[t];return null}function q(){for(var r=g();r.length>a.revisionHistoryMaxEntries;)r.shift();try{window.localStorage&&window.localStorage.setItem(X(),JSON.stringify(r))}catch(e){console.warn("revisionhistory: localStorage quota or access issue:",e&&e.message)}a.revisionHistoryUrl&&fe(r)}function fe(r){try{var e=new XMLHttpRequest;e.open("POST",a.revisionHistoryUrl,!0),e.setRequestHeader("Content-Type","application/json");var t=ue();for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(n)){var l=String(t[n]);if(!/\r|\n/.test(l))try{e.setRequestHeader(n,l)}catch{}}e.onerror=function(){j({reason:"network",status:e.status||0})},e.onload=function(){(e.status<200||e.status>=300)&&j({reason:"http",status:e.status,responseText:(e.responseText||"").slice(0,512)})},e.send(JSON.stringify({documentKey:a.aiToolkitPersistenceKey||"",savedAt:Date.now(),revisions:r}))}catch(c){j({reason:"exception",error:c})}}function ue(){var r=a.revisionHistoryRequestHeaders;if(typeof r=="function")try{r=r(o)}catch(e){return j({reason:"header-provider",error:e}),{}}return r&&typeof r=="object"?r:{}}function j(r){console.warn("revisionhistory: remote persistence failed:",r&&r.reason,r&&r.status);try{typeof a.onRevisionHistorySyncError=="function"&&a.onRevisionHistorySyncError(r)}catch{}try{typeof o.fireEvent=="function"&&o.fireEvent("revision_history_sync_error",r)}catch{}}function ve(){setTimeout(ce,0);try{if(!window.localStorage)return;var r=window.localStorage.getItem(X());if(!r)return;var e=JSON.parse(r);Array.isArray(e)&&(o.__revisions=e)}catch{}}function R(r,e){var t=o.getHTML?o.getHTML():o.getHTMLCode?o.getHTMLCode():"",n=de(),l=(r||"").toString().slice(0,120),c=l.length>0&&(!e||e.auto!==!0),i={id:"rev-"+Date.now()+"-"+Math.floor(Math.random()*1e4),html:t,text:o.getText?o.getText():D(t),label:l||be(),isNamed:c,author:{id:n.id,name:n.name,color:n.color},createdAt:Date.now(),metadata:e||{}};g().push(i),K=t,q(),s&&s.isConnected&&h();try{typeof o.fireEvent=="function"&&o.fireEvent("revision_snapshot",{id:i.id,label:i.label,isNamed:i.isNamed,createdAt:i.createdAt})}catch{}return i}function v(r,e,t){var n=a&&a["text_"+r]||e;return t===void 0?n:n.split("{0}").join(String(t))}function pe(r){var e=o.iframe?o.iframe.ownerDocument:document,t=e.defaultView||window,n=t.prompt(v("rh_nameversion",'Name this version (e.g. "Draft sent to legal"):'),r||"");if(n===null)return null;var l=(n||"").trim();return l?R(l,{user:!0}):null}function he(r,e){var t=m(r);if(!t)return!1;var n=(e||"").toString().trim().slice(0,120);return n?(t.label=n,t.isNamed=!0,q(),s&&s.isConnected&&h(),!0):!1}function ge(r,e){var t=m(r),n=m(e);if(!t||!n)return null;var l=t.text||D(t.html),c=n.text||D(n.html);return{oldEntry:t,newEntry:n,oldText:l,newText:c,lines:se(l,c)}}function be(){var r=new Date;function e(t){return t<10?"0"+t:""+t}return e(r.getHours())+":"+e(r.getMinutes())+":"+e(r.getSeconds())}function ie(r,e){e=e||{};var t=m(r);if(!t)return!1;var n=a.revisionHistorySnapshotBeforeRestore!==!1;if(!e.skipConfirm){var l=o.iframe?o.iframe.ownerDocument:document,c=n?v("rh_restorekeep","Restore this version? Your current content is kept as a version first, so you can go back to it."):v("rh_restorereplace","Restore this version? Your current content will be replaced (this itself is not auto-snapshotted).");if(!l.defaultView.confirm(c))return!1}if(n){for(var i=o.getHTML?o.getHTML():o.getHTMLCode?o.getHTMLCode():"",u=null,d=g(),f=0;f<d.length;f++)(!u||(d[f].createdAt||0)>=(u.createdAt||0))&&(u=d[f]);i!==t.html&&(!u||u.html!==i)&&R(v("rh_beforerestore","Before restoring {0}",t.label),{beforeRestore:t.id})}return o.setHTMLCode?o.setHTMLCode(t.html,{undoable:!0}):o.setHTML&&o.setHTML(t.html),K=t.html,s&&s.isConnected&&_(),!0}function ae(r){for(var e=g(),t=0;t<e.length;t++)if(e[t].id===r)return e.splice(t,1),q(),s&&s.isConnected&&h(),!0;return!1}function me(){o.__revisions=[],q(),s&&s.isConnected&&h()}function se(r,e){for(var t=String(r||"").split(/\r?\n/),n=String(e||"").split(/\r?\n/),l=[],c=ye(t,n),i=0,u=0,d=0;i<t.length&&u<n.length;)d<c.length&&t[i]===c[d]&&n[u]===c[d]?(l.push({type:"eq",text:t[i]}),i++,u++,d++):d<c.length&&t[i]!==c[d]?(l.push({type:"del",text:t[i]}),i++):d<c.length&&n[u]!==c[d]?(l.push({type:"add",text:n[u]}),u++):i<t.length?(l.push({type:"del",text:t[i]}),i++):u<n.length&&(l.push({type:"add",text:n[u]}),u++);for(;i<t.length;)l.push({type:"del",text:t[i]}),i++;for(;u<n.length;)l.push({type:"add",text:n[u]}),u++;return l}function ye(r,e){for(var t=r.length,n=e.length,l=new Array(n+1).fill(0),c=new Array(n+1).fill(0),i=[],d=0;d<=t;d++)i.push(new Array(n+1).fill(0));for(var d=1;d<=t;d++)for(var f=1;f<=n;f++)r[d-1]===e[f-1]?i[d][f]=i[d-1][f-1]+1:i[d][f]=Math.max(i[d-1][f],i[d][f-1]);for(var u=[],d=t,f=n;d>0&&f>0;)r[d-1]===e[f-1]?(u.unshift(r[d-1]),d--,f--):i[d-1][f]>=i[d][f-1]?d--:f--;return u}function D(r){var e=document.createElement("div");return e.innerHTML=__RTE_TT(r||""),e.innerText||e.textContent||""}function $(){if(!(s&&s.isConnected)&&!(!o||!o.iframe||!o.iframe.ownerDocument)){s&&!s.isConnected&&(s=null);var r=o.iframe.ownerDocument;if(!(!r||!r.body)){s=r.createElement("div");var e=!1;try{var t=o.container||o.getEditable&&o.getEditable().closest&&o.getEditable().closest(".richtexteditor");e=!!(t&&t.classList&&t.classList.contains("rte-dark"))}catch{}s.className="rte-rev-dialog"+(e?" rte-rev-dark":""),s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-labelledby","rte-rev-dialog-title");var n=r.createElement("div");n.className="rte-rev-backdrop",n.addEventListener("mousedown",function(c){c.target===n&&_()});var l=r.createElement("div");l.className="rte-rev-panel",n.appendChild(l),s.appendChild(n),G=r.activeElement,s.addEventListener("keydown",xe,!0),r.body.appendChild(s),h(),setTimeout(Z,0),setTimeout(function(){s&&!s.contains(s.ownerDocument.activeElement)&&Z()},250)}}}var G=null;function le(){if(!s)return[];for(var r=s.querySelectorAll("button, input, select, textarea, a[href], [tabindex]:not([tabindex='-1'])"),e=[],t=0;t<r.length;t++)!r[t].disabled&&r[t].offsetParent!==null&&e.push(r[t]);return e}function Z(){var r=le();if(r.length)try{r[0].focus()}catch{}}function T(r,e,t){r.setAttribute("data-rte-rev-key",e),r.addEventListener("mousedown",function(n){n.preventDefault()}),r.addEventListener("click",function(n){n.preventDefault();var l=n.detail===0;if(t(),!(!l||!s)){for(var c=s.querySelectorAll("[data-rte-rev-key]"),i=0;i<c.length;i++)if(c[i].getAttribute("data-rte-rev-key")===e){try{c[i].focus()}catch{}return}s.contains(s.ownerDocument.activeElement)||Z()}})}function xe(r){if(r.key==="Escape"||r.key==="Esc"){r.preventDefault(),r.stopPropagation(),_();return}if(r.key==="Tab"){var e=le();if(e.length){var t=s.ownerDocument.activeElement,n=e.indexOf(t);r.shiftKey&&n<=0?(r.preventDefault(),e[e.length-1].focus()):!r.shiftKey&&(n===-1||n===e.length-1)&&(r.preventDefault(),e[0].focus())}}}function _(){s&&s.parentNode&&s.parentNode.removeChild(s),s=null;var r=G;G=null;try{r&&r.isConnected&&r.tagName!=="IFRAME"&&r!==r.ownerDocument.body?r.focus():typeof o.focus=="function"&&o.focus()}catch{}}var y=null,x="preview";function h(){if(s){var r=s.ownerDocument,e=s.querySelector(".rte-rev-panel");if(!e){_();return}e.innerHTML=__RTE_TT("");var t=r.createElement("div");t.className="rte-rev-header";var n=r.createElement("div");n.id="rte-rev-dialog-title",n.className="rte-rev-title",n.textContent=v("revisionhistory","Revision history"),t.appendChild(n);var l=r.createElement("div");l.className="rte-rev-header-actions";var c=r.createElement("button");c.type="button",c.className="rte-rev-btn rte-rev-btn-ghost",c.textContent=v("rh_savenow","Save version now"),T(c,"save",function(){var p=r.defaultView.prompt(v("rh_labelversion","Label this version (optional):"),"");p!==null&&R(p||"")}),l.appendChild(c);var i=r.createElement("button");i.type="button",i.className="rte-rev-btn rte-rev-btn-ghost",i.textContent=v("close","Close"),i.setAttribute("aria-label",v("rh_closehistory","Close revision history")),T(i,"close",_),l.appendChild(i),t.appendChild(l),e.appendChild(t);var u=r.createElement("div");u.className="rte-rev-body";var d=r.createElement("div");d.className="rte-rev-list";var f=o.revisionHistory.list();if(f.length&&(d.setAttribute("role","listbox"),d.setAttribute("aria-label",v("rh_saved","Saved revisions"))),f.length){(!y||!m(y))&&(y=f[0].id);for(var Q=0;Q<f.length;Q++)(function(p){var b=r.createElement("button");b.type="button",b.className="rte-rev-row"+(p.id===y?" rte-rev-row-active":""),b.setAttribute("role","option"),b.setAttribute("aria-selected",p.id===y?"true":"false");var te=r.createElement("span");te.className="rte-rev-dot",te.style.background=p.author&&p.author.color||"#64748b";var oe=r.createElement("div");oe.className="rte-rev-row-who",oe.textContent=p.author&&p.author.name||v("rh_user","User");var ne=r.createElement("div");ne.className="rte-rev-row-when",ne.textContent=we(p.createdAt)+" \xB7 "+(p.label||"");var U=r.createElement("div");U.className="rte-rev-row-col",U.appendChild(oe),U.appendChild(ne),b.appendChild(te),b.appendChild(U),T(b,"row-"+p.id,function(){y=p.id,h()}),d.appendChild(b)})(f[Q])}else{var B=r.createElement("div");B.className="rte-rev-empty",B.textContent=v("rh_empty",'No revisions yet. Click "Save version now" to capture the current document.'),d.appendChild(B)}u.appendChild(d);var N=r.createElement("div");if(N.className="rte-rev-pane",f.length){var w=m(y)||f[0],S=r.createElement("div");S.className="rte-rev-tabs",S.setAttribute("role","tablist"),S.setAttribute("aria-label",v("rh_view","Revision view"));var k=r.createElement("button");k.type="button",k.className="rte-rev-tab"+(x==="preview"?" rte-rev-tab-active":""),k.setAttribute("role","tab"),k.setAttribute("aria-selected",x==="preview"?"true":"false"),k.textContent=v("rh_preview","Preview"),T(k,"tab-preview",function(){x="preview",h()});var E=r.createElement("button");E.type="button",E.className="rte-rev-tab"+(x==="diff"?" rte-rev-tab-active":""),E.setAttribute("role","tab"),E.setAttribute("aria-selected",x==="diff"?"true":"false"),E.textContent=v("rh_diff","Diff vs current"),T(E,"tab-diff",function(){x="diff",h()}),S.appendChild(k),S.appendChild(E),N.appendChild(S);var F=r.createElement("div");if(F.className="rte-rev-content",x==="preview"){var C=r.createElement("iframe");C.className="rte-rev-preview-frame",C.setAttribute("title",v("rh_previewframe","Revision preview")),C.setAttribute("sandbox","allow-same-origin"),F.appendChild(C),setTimeout(function(){try{C.contentDocument.open(),C.contentDocument.write(__RTE_TT('<!DOCTYPE html><html><head><meta charset="utf-8"><style>body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;padding:16px;color:#0f172a;line-height:1.6}img{max-width:100%}</style></head><body>'+(w.html||"")+"</body></html>")),C.contentDocument.close()}catch{}},0)}else{var Ee=o.getText?o.getText():D(o.getHTML()),M=se(w.text||D(w.html),Ee),W=r.createElement("pre");W.className="rte-rev-diff";for(var H=0;H<M.length;H++){var ee=r.createElement("span");ee.className="rte-rev-diff-line rte-rev-diff-"+M[H].type,ee.textContent=(M[H].type==="add"?"+ ":M[H].type==="del"?"- ":" ")+M[H].text+`
2
+ `,W.appendChild(ee)}F.appendChild(W)}N.appendChild(F);var I=r.createElement("div");I.className="rte-rev-footer";var re=r.createElement("div");re.className="rte-rev-footer-info",re.textContent=w.label?v("rh_label","Label: {0}",w.label):"";var O=r.createElement("div");O.className="rte-rev-footer-btns";var L=r.createElement("button");L.type="button",L.className="rte-rev-btn rte-rev-btn-danger",L.textContent=v("delete","Delete"),T(L,"delete",function(){ae(w.id)});var A=r.createElement("button");A.type="button",A.className="rte-rev-btn rte-rev-btn-primary",A.textContent=v("rh_restore","Restore this version"),A.addEventListener("mousedown",function(p){p.preventDefault()}),A.addEventListener("click",function(p){p.preventDefault(),ie(w.id)}),O.appendChild(L),O.appendChild(A),I.appendChild(re),I.appendChild(O),N.appendChild(I)}f.length?u.appendChild(N):d.classList.add("rte-rev-list-solo"),e.appendChild(u)}}function we(r){if(!r)return"";var e=new Date(r),t=new Date;function n(c){return c<10?"0"+c:""+c}var l=n(e.getHours())+":"+n(e.getMinutes());return e.toDateString()===t.toDateString()?v("rh_today","Today {0}",l):e.getFullYear()+"-"+n(e.getMonth()+1)+"-"+n(e.getDate())+" "+l}function ke(){var r=o&&o.iframe&&o.iframe.ownerDocument||document;if(!r.querySelector("style[data-rte-revisionhistory]")){var e=r.createElement("style");e.setAttribute("data-rte-revisionhistory","1"),e.textContent=[".rte-rev-dialog{position:fixed;inset:0;z-index:2147483600;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;font-size:13px;color:#172033}",".rte-rev-backdrop{position:absolute;inset:0;background:linear-gradient(135deg,rgba(12,18,32,.44),rgba(40,54,77,.26));display:flex;align-items:center;justify-content:center;padding:18px}","/* 2026-07-12 revision dialog precision */",".rte-rev-panel{background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);border:1px solid rgba(117,137,163,.28);border-radius:8px;width:min(960px,calc(100vw - 28px));max-height:min(82vh,740px);display:flex;flex-direction:column;box-shadow:0 16px 40px rgba(35,48,72,.18);overflow:hidden}",".rte-rev-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid rgba(117,137,163,.18);background:rgba(255,255,255,.72)}",".rte-rev-title{font-size:16px;font-weight:760;letter-spacing:-.01em;color:#172033}",".rte-rev-header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}",".rte-rev-btn{padding:8px 12px;border-radius:7px;border:1px solid rgba(116,135,162,.25);font:inherit;font-size:12px;font-weight:680;line-height:1;cursor:pointer;background:#fff;color:#223652;box-shadow:0 1px 2px rgba(32,45,66,.06);transition:background .14s ease,border-color .14s ease,box-shadow .14s ease,transform .14s ease}",".rte-rev-btn:hover{background:#f5f8fc;border-color:rgba(81,111,151,.42);box-shadow:0 5px 14px rgba(32,45,66,.09);transform:translateY(-1px)}",".rte-rev-btn:focus-visible{outline:2px solid rgba(56,122,255,.34);outline-offset:2px}",".rte-rev-btn-ghost{background:#fff;color:#34506f}",".rte-rev-btn-primary{background:linear-gradient(135deg,#2563eb,#1d67ba);color:#fff;border-color:rgba(29,103,186,.85);box-shadow:0 8px 18px rgba(37,99,235,.22)}",".rte-rev-btn-primary:hover{background:linear-gradient(135deg,#1d4ed8,#195fad);color:#fff;border-color:rgba(29,78,216,.9);box-shadow:0 9px 20px rgba(37,99,235,.28)}",".rte-rev-btn-danger{background:#fff5f5;color:#9f1d1d;border-color:rgba(190,45,45,.22)}",".rte-rev-body{display:flex;flex:1;min-height:0;background:linear-gradient(90deg,#f8fbff 0%,#fff 42%)}",".rte-rev-list{width:258px;flex:0 0 258px;border-right:1px solid rgba(117,137,163,.18);overflow-y:auto;background:rgba(244,248,253,.78);padding:10px}",".rte-rev-empty{padding:16px;border:1px dashed rgba(99,118,145,.28);border-radius:8px;background:#fff;color:#5b6c81;font-size:12px;line-height:1.5}",".rte-rev-row{display:flex;align-items:center;gap:10px;width:100%;padding:10px;border:1px solid transparent;border-radius:8px;background:transparent;text-align:left;cursor:pointer;font:inherit;color:inherit}",".rte-rev-row:hover{background:#fff;border-color:rgba(93,122,161,.24);box-shadow:0 8px 18px rgba(33,48,70,.08)}",".rte-rev-row-active{background:#eef6ff;border-color:rgba(37,99,235,.28);box-shadow:0 8px 22px rgba(37,99,235,.12)}",".rte-rev-dot{width:9px;height:9px;border-radius:50%;flex:0 0 9px;box-shadow:0 0 0 3px rgba(255,255,255,.95),0 0 0 4px rgba(96,116,140,.18)}",".rte-rev-row-col{flex:1;min-width:0}",".rte-rev-row-who{font-weight:720;font-size:12px;line-height:1.25;color:#172033}",".rte-rev-row-when{margin-top:2px;font-size:11px;color:#637487;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-rev-pane{flex:1;display:flex;flex-direction:column;min-width:0;padding:10px}",".rte-rev-list.rte-rev-list-solo{flex:1 1 auto;width:auto;max-height:none;border-right:0;border-bottom:0}",".rte-rev-tabs{display:flex;align-self:flex-start;gap:3px;padding:3px;margin:0 0 10px;border:1px solid rgba(117,137,163,.2);border-radius:7px;background:#eef3f8}",".rte-rev-tab{padding:7px 12px;border:0;border-radius:6px;background:transparent;font:inherit;font-size:12px;font-weight:680;color:#637487;cursor:pointer}",".rte-rev-tab:hover{color:#1d3557;background:rgba(255,255,255,.58)}",".rte-rev-tab:focus-visible{outline:2px solid rgba(56,122,255,.34);outline-offset:2px}",".rte-rev-tab-active{color:#163966;background:#fff;box-shadow:0 2px 7px rgba(35,48,72,.08)}",".rte-rev-content{flex:1;overflow:auto;padding:0;border:1px solid rgba(117,137,163,.18);border-radius:8px;background:#fff;min-height:300px}",".rte-rev-preview-frame{width:100%;height:100%;min-height:330px;border:0;display:block;background:#fff}",".rte-rev-diff{margin:0;padding:14px 16px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;color:#172033;background:#fbfdff;min-height:100%}",".rte-rev-diff-line{display:block}",".rte-rev-diff-add{background:#e8f8ef;color:#17633f}",".rte-rev-diff-del{background:#fff0f0;color:#9f1d1d}",".rte-rev-diff-eq{color:#556575}",".rte-rev-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0 0;background:transparent}",".rte-rev-footer-info{font-size:12px;color:#637487;min-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",".rte-rev-footer-btns{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}","@media(max-width:720px){.rte-rev-backdrop{padding:10px;align-items:flex-start}.rte-rev-panel{width:calc(100vw - 20px);max-height:calc(100vh - 20px);border-radius:8px}.rte-rev-header{align-items:flex-start;flex-direction:column}.rte-rev-body{flex-direction:column}.rte-rev-list{width:auto;flex:0 0 auto;max-height:178px;border-right:0;border-bottom:1px solid rgba(117,137,163,.18)}.rte-rev-pane{min-height:360px}.rte-rev-footer{align-items:stretch;flex-direction:column}.rte-rev-footer-info{white-space:normal}.rte-rev-footer-btns{justify-content:stretch}.rte-rev-footer-btns .rte-rev-btn{flex:1}}",".rte-rev-dark{color:#e2e8f0}",".rte-rev-dark .rte-rev-panel{background:linear-gradient(180deg,#1e293b,#0f172a);border-color:#334155}",".rte-rev-dark .rte-rev-header{background:rgba(30,41,59,.72);border-color:#334155}",".rte-rev-dark .rte-rev-title,.rte-rev-dark .rte-rev-row-who{color:#e2e8f0}",".rte-rev-dark .rte-rev-btn,.rte-rev-dark .rte-rev-btn-ghost{background:#0f172a;color:#cbd5e1;border-color:#334155}",".rte-rev-dark .rte-rev-btn:hover{background:#334155}",".rte-rev-dark .rte-rev-btn-primary,.rte-rev-dark .rte-rev-btn-primary:hover{background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;border-color:#3b82f6}",".rte-rev-dark .rte-rev-body{background:#0f172a}",".rte-rev-dark .rte-rev-list{background:rgba(15,23,42,.6);border-color:#334155}",".rte-rev-dark .rte-rev-empty{background:#1e293b;color:#94a3b8;border-color:#334155}",".rte-rev-dark .rte-rev-row:hover{background:#1e293b;border-color:#334155}",".rte-rev-dark .rte-rev-row-active{background:#1e3a8a;border-color:#3b82f6}",".rte-rev-dark .rte-rev-row-when,.rte-rev-dark .rte-rev-footer-info{color:#94a3b8}",".rte-rev-dark .rte-rev-tabs{background:#1e293b;border-color:#334155}",".rte-rev-dark .rte-rev-tab{color:#94a3b8}.rte-rev-dark .rte-rev-tab-active{color:#fff;background:#1d4ed8}",".rte-rev-dark .rte-rev-diff{background:#0f172a;color:#cbd5e1}.rte-rev-dark .rte-rev-diff-eq{color:#94a3b8}",".rte-rev-dark .rte-rev-diff-add{background:rgba(16,185,129,.16);color:#6ee7b7}",".rte-rev-dark .rte-rev-diff-del{background:rgba(244,63,94,.16);color:#fda4af}"].join(`
3
3
  `),r.head.appendChild(e),o&&typeof o.ensureStyleSheetLive=="function"&&o.ensureStyleSheetLive(r,e,"rte-revisionhistory-style",e.textContent)}}}
@@ -98,11 +98,11 @@ function RTE_Plugin_RubyAnnotation() {
98
98
  if (hostDoc.getElementById("rte-ruby-style")) return;
99
99
  var style = hostDoc.createElement("style");
100
100
  style.id = "rte-ruby-style";
101
- style.innerHTML = [
101
+ style.innerHTML = __RTE_TT([
102
102
  ".rte-ruby-annotated{ruby-position:over;}",
103
103
  ".rte-ruby-annotated>rt{font-size:.55em;line-height:1.15;opacity:.85;user-select:none;}",
104
104
  "@supports (display:ruby){.rte-ruby-annotated>rp{display:none;}}"
105
- ].join("");
105
+ ].join(""));
106
106
  hostDoc.head.appendChild(style);
107
107
  // A <style> element's rules are dropped under a strict style-src; this
108
108
  // re-injects them through the CSSOM in that case only. Missed in 2.9.0,
@@ -1 +1 @@
1
- window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_rubyannotation=RTE_Plugin_RubyAnnotation;function RTE_Plugin_RubyAnnotation(){var d=this,r,o;d.PluginName="RubyAnnotation",d.InitConfig=function(t){r=t,r.rubyAnnotationEnabled!==!1&&(typeof r.rubyAnnotationParentheses!="boolean"&&(r.rubyAnnotationParentheses=!0),r.text_rubyannotation||(r.text_rubyannotation="Ruby annotation"),r.text_rubyannotationtitle||(r.text_rubyannotationtitle="Ruby annotation"),T("toolbar_full","#{rubyannotation}"),w("subtoolbar_more","rubyannotation"))},d.InitEditor=function(t){o=t,r.rubyAnnotationEnabled!==!1&&(o.ruby={add:function(e){return h(e)},get:function(){var e=p();return e?x(e):null},isRuby:function(){return!!p()},open:function(){d.OpenRubyDialog()},remove:function(){return m()}},S(),o.toolbarFactoryMap=o.toolbarFactoryMap||{},o.toolbarFactoryMap.rubyannotation=function(e){return o.createToolbarButton(e)},o.attachEvent("exec_command_rubyannotation",function(e){e.returnValue=!0,e.stopBubble=!0,d.OpenRubyDialog()}))};function T(t,e){r[t]&&r[t].indexOf(e)===-1&&(r[t]=r[t]+e)}function w(t,e){var n=r[t];if(!(!n||n.indexOf(e)!==-1)){var a=n.indexOf("}");a!==-1&&(r[t]=n.substring(0,a)+","+e+n.substring(a))}}function S(){var t=r.container.ownerDocument;if(!t.getElementById("rte-ruby-style")){var e=t.createElement("style");e.id="rte-ruby-style",e.innerHTML=[".rte-ruby-annotated{ruby-position:over;}",".rte-ruby-annotated>rt{font-size:.55em;line-height:1.15;opacity:.85;user-select:none;}","@supports (display:ruby){.rte-ruby-annotated>rp{display:none;}}"].join(""),t.head.appendChild(e),o&&typeof o.ensureStyleSheetLive=="function"&&o.ensureStyleSheetLive(t,e,"rte-ruby-style",e.textContent)}}function E(){return o&&o.getEditable?o.getEditable():null}function c(){var t=o.getDocument();try{var e=t.getSelection();return!e||!e.rangeCount?null:e.getRangeAt(0)}catch{return null}}function p(){var t=c(),e=E();if(!t||!e)return null;for(var n=t.startContainer;n&&n!==e;){if(n.nodeType===1&&n.nodeName==="RUBY")return n;n=n.parentNode}return null}function x(t){var e=t.querySelector("rt");return e&&e.textContent||""}function g(t){for(var e="",n=0;n<t.childNodes.length;n++){var a=t.childNodes[n];a.nodeType===3?e+=a.nodeValue:a.nodeType===1&&a.nodeName!=="RT"&&a.nodeName!=="RP"&&(e+=a.textContent||"")}return e}function v(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function D(t,e){var n=r.rubyAnnotationParentheses;return'<ruby class="rte-ruby-annotated">'+v(t)+(n?"<rp>(</rp>":"")+"<rt>"+v(e)+"</rt>"+(n?"<rp>)</rp>":"")+"</ruby>"}function h(t){var e=p();if(e){var n=e.querySelector("rt");return n||(n=e.ownerDocument.createElement("rt"),e.appendChild(n)),n.textContent=String(t??""),o.focus(),e}var a=c();if(!a||a.collapsed)return null;var u=String(a.toString()||"");return u?(o.insertHTML(D(u,t)),o.focus(),!0):null}function m(){var t=p();if(!t)return!1;var e=t.ownerDocument,n=e.createTextNode(g(t));return t.parentNode.insertBefore(n,t),t.parentNode.removeChild(t),o.focus(),!0}function i(t,e,n,a){var u=t.ownerDocument.createElement(e);return n&&(u.style.cssText=n),a&&(u.className=a),t.appendChild(u),u}function k(){var t=o.getLangText?o.getLangText("rubyannotationtitle"):"";return t&&String(t).toLowerCase()!=="rubyannotationtitle"?t:"Ruby annotation"}d.OpenRubyDialog=function(){var t=p(),e=c(),n=t?g(t):e?String(e.toString()||""):"",a=o.createDialog(k(),"rte-dialog-ruby"),u=typeof a.close=="function"?function(){a.close()}:function(){o.closeCurrentPopup()},l=i(a,"div","padding:14px;min-width:340px;font:13px -apple-system,Segoe UI,sans-serif");i(l,"div","font-weight:600;margin-bottom:4px").innerText=r&&r.text_ruby_base||"Base text";var A=i(l,"div","padding:8px 10px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;min-height:20px;word-break:break-word");A.textContent=n,i(l,"div","font-weight:600;margin:10px 0 4px").innerText=r&&r.text_ruby_reading||"Reading";var f=i(l,"input","width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;font:13px inherit");f.type="text",f.value=t?x(t):"",f.placeholder="e.g. \u304B\u3093\u3058";var N=i(l,"div","font-size:11px;color:#94a3b8;margin-top:6px");N.innerText=n?r&&r.text_ruby_note||"Shown above the base text. Parentheses are emitted for readers without ruby support.":r&&r.text_ruby_selectfirst||"Select the text to annotate first, then reopen this dialog.";var _=i(l,"div","display:flex;justify-content:space-between;gap:8px;margin-top:14px"),O=i(_,"div","display:flex;gap:8px");if(t){var s=i(O,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#b91c1c;cursor:pointer");s.type="button",s.textContent=r&&r.text_ruby_remove||"Remove",s.onclick=function(){m(),u()}}var R=i(_,"div","display:flex;gap:8px"),y=i(R,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");y.type="button",y.textContent=r&&r.text_ruby_cancel||"Cancel",y.onclick=u;var b=i(R,"button","padding:6px 14px;border:1px solid #1d67ba;border-radius:8px;background:#1d67ba;color:#fff;cursor:pointer");b.type="button",b.textContent=t?r&&r.text_ruby_update||"Update":r&&r.text_ruby_add||"Add",b.disabled=!n,b.onclick=function(){var C=f.value.trim();if(!C||!n){u();return}h(C),u()},setTimeout(function(){f.focus()},0)}}
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_rubyannotation=RTE_Plugin_RubyAnnotation;function RTE_Plugin_RubyAnnotation(){var d=this,r,o;d.PluginName="RubyAnnotation",d.InitConfig=function(t){r=t,r.rubyAnnotationEnabled!==!1&&(typeof r.rubyAnnotationParentheses!="boolean"&&(r.rubyAnnotationParentheses=!0),r.text_rubyannotation||(r.text_rubyannotation="Ruby annotation"),r.text_rubyannotationtitle||(r.text_rubyannotationtitle="Ruby annotation"),C("toolbar_full","#{rubyannotation}"),w("subtoolbar_more","rubyannotation"))},d.InitEditor=function(t){o=t,r.rubyAnnotationEnabled!==!1&&(o.ruby={add:function(e){return h(e)},get:function(){var e=p();return e?x(e):null},isRuby:function(){return!!p()},open:function(){d.OpenRubyDialog()},remove:function(){return m()}},S(),o.toolbarFactoryMap=o.toolbarFactoryMap||{},o.toolbarFactoryMap.rubyannotation=function(e){return o.createToolbarButton(e)},o.attachEvent("exec_command_rubyannotation",function(e){e.returnValue=!0,e.stopBubble=!0,d.OpenRubyDialog()}))};function C(t,e){r[t]&&r[t].indexOf(e)===-1&&(r[t]=r[t]+e)}function w(t,e){var n=r[t];if(!(!n||n.indexOf(e)!==-1)){var a=n.indexOf("}");a!==-1&&(r[t]=n.substring(0,a)+","+e+n.substring(a))}}function S(){var t=r.container.ownerDocument;if(!t.getElementById("rte-ruby-style")){var e=t.createElement("style");e.id="rte-ruby-style",e.innerHTML=__RTE_TT([".rte-ruby-annotated{ruby-position:over;}",".rte-ruby-annotated>rt{font-size:.55em;line-height:1.15;opacity:.85;user-select:none;}","@supports (display:ruby){.rte-ruby-annotated>rp{display:none;}}"].join("")),t.head.appendChild(e),o&&typeof o.ensureStyleSheetLive=="function"&&o.ensureStyleSheetLive(t,e,"rte-ruby-style",e.textContent)}}function E(){return o&&o.getEditable?o.getEditable():null}function c(){var t=o.getDocument();try{var e=t.getSelection();return!e||!e.rangeCount?null:e.getRangeAt(0)}catch{return null}}function p(){var t=c(),e=E();if(!t||!e)return null;for(var n=t.startContainer;n&&n!==e;){if(n.nodeType===1&&n.nodeName==="RUBY")return n;n=n.parentNode}return null}function x(t){var e=t.querySelector("rt");return e&&e.textContent||""}function g(t){for(var e="",n=0;n<t.childNodes.length;n++){var a=t.childNodes[n];a.nodeType===3?e+=a.nodeValue:a.nodeType===1&&a.nodeName!=="RT"&&a.nodeName!=="RP"&&(e+=a.textContent||"")}return e}function v(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function D(t,e){var n=r.rubyAnnotationParentheses;return'<ruby class="rte-ruby-annotated">'+v(t)+(n?"<rp>(</rp>":"")+"<rt>"+v(e)+"</rt>"+(n?"<rp>)</rp>":"")+"</ruby>"}function h(t){var e=p();if(e){var n=e.querySelector("rt");return n||(n=e.ownerDocument.createElement("rt"),e.appendChild(n)),n.textContent=String(t??""),o.focus(),e}var a=c();if(!a||a.collapsed)return null;var u=String(a.toString()||"");return u?(o.insertHTML(D(u,t)),o.focus(),!0):null}function m(){var t=p();if(!t)return!1;var e=t.ownerDocument,n=e.createTextNode(g(t));return t.parentNode.insertBefore(n,t),t.parentNode.removeChild(t),o.focus(),!0}function i(t,e,n,a){var u=t.ownerDocument.createElement(e);return n&&(u.style.cssText=n),a&&(u.className=a),t.appendChild(u),u}function k(){var t=o.getLangText?o.getLangText("rubyannotationtitle"):"";return t&&String(t).toLowerCase()!=="rubyannotationtitle"?t:"Ruby annotation"}d.OpenRubyDialog=function(){var t=p(),e=c(),n=t?g(t):e?String(e.toString()||""):"",a=o.createDialog(k(),"rte-dialog-ruby"),u=typeof a.close=="function"?function(){a.close()}:function(){o.closeCurrentPopup()},l=i(a,"div","padding:14px;min-width:340px;font:13px -apple-system,Segoe UI,sans-serif");i(l,"div","font-weight:600;margin-bottom:4px").innerText=r&&r.text_ruby_base||"Base text";var A=i(l,"div","padding:8px 10px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;min-height:20px;word-break:break-word");A.textContent=n,i(l,"div","font-weight:600;margin:10px 0 4px").innerText=r&&r.text_ruby_reading||"Reading";var f=i(l,"input","width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;font:13px inherit");f.type="text",f.value=t?x(t):"",f.placeholder="e.g. \u304B\u3093\u3058";var N=i(l,"div","font-size:11px;color:#94a3b8;margin-top:6px");N.innerText=n?r&&r.text_ruby_note||"Shown above the base text. Parentheses are emitted for readers without ruby support.":r&&r.text_ruby_selectfirst||"Select the text to annotate first, then reopen this dialog.";var _=i(l,"div","display:flex;justify-content:space-between;gap:8px;margin-top:14px"),O=i(_,"div","display:flex;gap:8px");if(t){var s=i(O,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#b91c1c;cursor:pointer");s.type="button",s.textContent=r&&r.text_ruby_remove||"Remove",s.onclick=function(){m(),u()}}var R=i(_,"div","display:flex;gap:8px"),y=i(R,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");y.type="button",y.textContent=r&&r.text_ruby_cancel||"Cancel",y.onclick=u;var b=i(R,"button","padding:6px 14px;border:1px solid #1d67ba;border-radius:8px;background:#1d67ba;color:#fff;cursor:pointer");b.type="button",b.textContent=t?r&&r.text_ruby_update||"Update":r&&r.text_ruby_add||"Add",b.disabled=!n,b.onclick=function(){var T=f.value.trim();if(!T||!n){u();return}h(T),u()},setTimeout(function(){f.focus()},0)}}
@@ -100,7 +100,9 @@ function RTE_Plugin_Sanitizer() {
100
100
  // Inline SVG (icons, diagrams). Its dangerous children are dropped below.
101
101
  "svg,g,path,circle,ellipse,rect,line,polyline,polygon,text,tspan,defs,marker," +
102
102
  "linearGradient,radialGradient,stop,clipPath,mask,pattern,use,symbol,title,desc"
103
- ).split(",").forEach(function (t) { ALLOWED_TAGS[t] = true; });
103
+ // Lower-cased like the name it is looked up with: the camelCase SVG names (linearGradient, clipPath) were
104
+ // never found, so gradients and clip paths were unwrapped. tools/security/sanitizer-svg-camelcase.mjs
105
+ ).split(",").forEach(function (t) { ALLOWED_TAGS[t.toLowerCase()] = true; });
104
106
 
105
107
  // Removed WITH their contents: their text is markup, not prose.
106
108
  var DROP_WHOLE = {
@@ -339,6 +341,21 @@ function RTE_Plugin_Sanitizer() {
339
341
  }
340
342
  })(root);
341
343
 
344
+ // Before anything else: the content is clobbering the document this very loop works in
345
+ // (a later <font> calls ownerDocument.createElement, which <img name="createElement">
346
+ // replaces), so its clobbering names go first. See clobbers().
347
+ for (var c = 0; c < all.length; c++) {
348
+ if (all[c].nodeType !== 1) continue;
349
+ var cTag = (all[c].localName || all[c].nodeName || "").toLowerCase();
350
+ for (var ca = 0; ca < CLOBBER_ATTRS.length; ca++) {
351
+ var cv = all[c].getAttribute(CLOBBER_ATTRS[ca]);
352
+ if (cv && clobbers(cTag, CLOBBER_ATTRS[ca], cv, allowExtra)) {
353
+ note(report.removedAttributes, cTag + "[" + CLOBBER_ATTRS[ca] + "]");
354
+ all[c].removeAttribute(CLOBBER_ATTRS[ca]);
355
+ }
356
+ }
357
+ }
358
+
342
359
  for (var i = 0; i < all.length; i++) {
343
360
  var el = all[i];
344
361
  if (!el.parentNode) continue; // already removed with an ancestor
@@ -490,6 +507,41 @@ function RTE_Plugin_Sanitizer() {
490
507
  return root;
491
508
  }
492
509
 
510
+ // 2026-10-29 DOM clobbering. Named access on document overrides its built-ins, so a saved
511
+ // <img name="cookie"> rendered on a page IS document.cookie there, and <img name="currentScript">
512
+ // is document.currentScript (a public write-up pastes exactly that into our demo). A name, or an
513
+ // id on an image or form control, that matches a document or form property is such a clobber;
514
+ // DOMPurify removes the same set by default (SANITIZE_DOM). A form control's name is also a field
515
+ // the host's own form would submit, so it goes unless the host allows forms in content. Ids on
516
+ // headings and links stay: they are anchors and cannot replace a document or form built-in.
517
+ // The question is asked of a PRISTINE document: in Firefox and WebKit the content's own
518
+ // <img name="logo"> makes "logo" in its document true, so asking the working document
519
+ // dropped every image name there.
520
+ // tools/security/sanitizer-dom-clobbering.mjs
521
+ var CLOBBER_ATTRS = ["name", "id"];
522
+ var NAMED_ACCESS_TAGS = { img: 1, form: 1, embed: 1, iframe: 1, object: 1, input: 1, button: 1, select: 1, textarea: 1, fieldset: 1, output: 1 };
523
+ var FORM_FIELDS = { input: 1, button: 1, select: 1, textarea: 1 };
524
+ var probeDoc = null, probeForm = null;
525
+ function clobbers(tag, attr, value, allowExtra) {
526
+ if (!value) return false;
527
+ if (attr === "id" && !NAMED_ACCESS_TAGS[tag]) return false;
528
+ if (attr === "name" && FORM_FIELDS[tag] && !allowExtra("form")) return true;
529
+ if (!probeDoc) {
530
+ probeDoc = document.implementation.createHTMLDocument("");
531
+ probeForm = probeDoc.createElement("form");
532
+ }
533
+ return value in probeDoc || value in probeForm;
534
+ }
535
+ // doc.body itself can be clobbered (<img id="body" name="x">) before the clean-up has run,
536
+ // which emptied the content in Firefox and WebKit; the prototype's getter cannot be.
537
+ function bodyOf(doc) {
538
+ for (var p = Object.getPrototypeOf(doc); p; p = Object.getPrototypeOf(p)) {
539
+ var d = Object.getOwnPropertyDescriptor(p, "body");
540
+ if (d && d.get) return d.get.call(doc);
541
+ }
542
+ return doc.body;
543
+ }
544
+
493
545
  function unwrap(el) {
494
546
  var parent = el.parentNode;
495
547
  while (el.firstChild) parent.insertBefore(el.firstChild, el);
@@ -512,9 +564,10 @@ function RTE_Plugin_Sanitizer() {
512
564
  // we inspect it -- innerHTML on a live div would fire <img onerror>
513
565
  // before the first line of this ran.
514
566
  for (var pass = 0; pass < 3; pass++) {
515
- var doc = new DOMParser().parseFromString("<body>" + out + "</body>", "text/html");
516
- sanitizeNode(doc.body, report);
517
- var next = doc.body.innerHTML;
567
+ var doc = new DOMParser().parseFromString(__RTE_TT("<body>" + out + "</body>"), "text/html");
568
+ var body = bodyOf(doc);
569
+ sanitizeNode(body, report);
570
+ var next = body.innerHTML;
518
571
  report.lastPasses = pass + 1;
519
572
  // Re-parsing can RESURRECT markup: the classic mutation-XSS trick is
520
573
  // content that is inert in one parse and dangerous once the