@richscripts/richtexteditor 2.14.1 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +182 -10
- package/angular/build-manifest.json +23 -0
- package/angular/index.d.ts +71 -76
- package/angular/index.mjs +2 -0
- package/angular/package.json +4 -0
- package/headless/index.d.ts +3 -1
- package/headless/index.js +72 -16
- package/index.d.ts +40 -52
- package/integrations/initialization-scope.js +27 -0
- package/integrations/native-mount.js +30 -0
- package/integrations/shared.d.ts +23 -1
- package/integrations/shared.js +68 -22
- package/package.json +25 -3
- package/react/index.js +118 -37
- package/react/index.mjs +29 -0
- package/richtexteditor/all_plugins.js +8816 -2373
- package/richtexteditor/all_plugins.min.js +77 -59
- package/richtexteditor/lang/emoji/LICENSE-CLDR.txt +41 -0
- package/richtexteditor/lang/emoji/rte-emoji-de.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-es.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-fr.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-it.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-ja.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-ko.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-nl.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-pt-pt.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-pt.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-ru.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-zh-Hans.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-zh-Hant.js +3 -0
- package/richtexteditor/lang/rte-lang-af.js +1 -0
- package/richtexteditor/lang/rte-lang-ar.js +1 -0
- package/richtexteditor/lang/rte-lang-bg.js +1 -0
- package/richtexteditor/lang/rte-lang-bn.js +1 -0
- package/richtexteditor/lang/rte-lang-bs.js +1 -0
- package/richtexteditor/lang/rte-lang-ca.js +1 -0
- package/richtexteditor/lang/rte-lang-cs.js +1 -0
- package/richtexteditor/lang/rte-lang-cy.js +1 -0
- package/richtexteditor/lang/rte-lang-da.js +1 -0
- package/richtexteditor/lang/rte-lang-de.js +1050 -2
- package/richtexteditor/lang/rte-lang-el.js +1 -0
- package/richtexteditor/lang/rte-lang-en.js +1 -0
- package/richtexteditor/lang/rte-lang-es.js +1056 -2
- package/richtexteditor/lang/rte-lang-et.js +1 -0
- package/richtexteditor/lang/rte-lang-fa.js +1 -0
- package/richtexteditor/lang/rte-lang-fi.js +1 -0
- package/richtexteditor/lang/rte-lang-fil.js +1 -0
- package/richtexteditor/lang/rte-lang-fj.js +1 -0
- package/richtexteditor/lang/rte-lang-fr.js +1056 -2
- package/richtexteditor/lang/rte-lang-ga.js +1 -0
- package/richtexteditor/lang/rte-lang-gu.js +1 -0
- package/richtexteditor/lang/rte-lang-he.js +1 -0
- package/richtexteditor/lang/rte-lang-hi.js +1 -0
- package/richtexteditor/lang/rte-lang-hr.js +1 -0
- package/richtexteditor/lang/rte-lang-ht.js +1 -0
- package/richtexteditor/lang/rte-lang-hu.js +1 -0
- package/richtexteditor/lang/rte-lang-id.js +1 -0
- package/richtexteditor/lang/rte-lang-is.js +1 -0
- package/richtexteditor/lang/rte-lang-it.js +1056 -2
- package/richtexteditor/lang/rte-lang-ja.js +1056 -2
- package/richtexteditor/lang/rte-lang-kn.js +1 -0
- package/richtexteditor/lang/rte-lang-ko.js +1056 -2
- package/richtexteditor/lang/rte-lang-lt.js +1 -0
- package/richtexteditor/lang/rte-lang-lv.js +1 -0
- package/richtexteditor/lang/rte-lang-mg.js +1 -0
- package/richtexteditor/lang/rte-lang-mi.js +1 -0
- package/richtexteditor/lang/rte-lang-ml.js +1 -0
- package/richtexteditor/lang/rte-lang-mr.js +1 -0
- package/richtexteditor/lang/rte-lang-ms.js +1 -0
- package/richtexteditor/lang/rte-lang-mt.js +1 -0
- package/richtexteditor/lang/rte-lang-mww.js +1 -0
- package/richtexteditor/lang/rte-lang-nb.js +1 -0
- package/richtexteditor/lang/rte-lang-nl.js +1056 -2
- package/richtexteditor/lang/rte-lang-otq.js +1 -0
- package/richtexteditor/lang/rte-lang-pa.js +1 -0
- package/richtexteditor/lang/rte-lang-pl.js +1 -0
- package/richtexteditor/lang/rte-lang-pt-pt.js +1056 -2
- package/richtexteditor/lang/rte-lang-pt.js +1056 -2
- package/richtexteditor/lang/rte-lang-ro.js +1 -0
- package/richtexteditor/lang/rte-lang-ru.js +1056 -2
- package/richtexteditor/lang/rte-lang-sk.js +1 -0
- package/richtexteditor/lang/rte-lang-sl.js +1 -0
- package/richtexteditor/lang/rte-lang-sm.js +1 -0
- package/richtexteditor/lang/rte-lang-sr-Cyrl.js +1 -0
- package/richtexteditor/lang/rte-lang-sr-Latn.js +1 -0
- package/richtexteditor/lang/rte-lang-sv.js +1 -0
- package/richtexteditor/lang/rte-lang-sw.js +1 -0
- package/richtexteditor/lang/rte-lang-ta.js +1 -0
- package/richtexteditor/lang/rte-lang-te.js +1 -0
- package/richtexteditor/lang/rte-lang-th.js +1 -0
- package/richtexteditor/lang/rte-lang-tlh-Latn.js +1 -0
- package/richtexteditor/lang/rte-lang-tlh-Piqd.js +1 -0
- package/richtexteditor/lang/rte-lang-to.js +1 -0
- package/richtexteditor/lang/rte-lang-tr.js +1 -0
- package/richtexteditor/lang/rte-lang-ty.js +1 -0
- package/richtexteditor/lang/rte-lang-uk.js +1 -0
- package/richtexteditor/lang/rte-lang-ur.js +1 -0
- package/richtexteditor/lang/rte-lang-vi.js +1 -0
- package/richtexteditor/lang/rte-lang-yua.js +1 -0
- package/richtexteditor/lang/rte-lang-zh-Hans.js +1050 -2
- package/richtexteditor/lang/rte-lang-zh-Hant.js +1050 -2
- package/richtexteditor/plugins/a11yenhance.js +4 -1
- package/richtexteditor/plugins/a11yenhance.min.js +1 -1
- package/richtexteditor/plugins/accessibilitychecker.js +256 -64
- package/richtexteditor/plugins/accessibilitychecker.min.js +1 -1
- package/richtexteditor/plugins/aitoolkit.js +1057 -386
- package/richtexteditor/plugins/aitoolkit.min.js +7 -7
- package/richtexteditor/plugins/all_plugins.js +8816 -2373
- package/richtexteditor/plugins/all_plugins.min.js +77 -59
- package/richtexteditor/plugins/autocorrect.js +66 -31
- package/richtexteditor/plugins/autocorrect.min.js +1 -1
- package/richtexteditor/plugins/autoembed.js +18 -1
- package/richtexteditor/plugins/autoembed.min.js +1 -1
- package/richtexteditor/plugins/blocktypes.js +18 -9
- package/richtexteditor/plugins/blocktypes.min.js +1 -1
- package/richtexteditor/plugins/bookmarkcard.js +12 -5
- package/richtexteditor/plugins/bookmarkcard.min.js +2 -2
- package/richtexteditor/plugins/changecase.js +72 -19
- package/richtexteditor/plugins/changecase.min.js +1 -1
- package/richtexteditor/plugins/charlimit.js +62 -2
- package/richtexteditor/plugins/charlimit.min.js +2 -2
- package/richtexteditor/plugins/comments.js +460 -61
- package/richtexteditor/plugins/comments.min.js +4 -3
- package/richtexteditor/plugins/contentminimap.js +28 -9
- package/richtexteditor/plugins/contentminimap.min.js +1 -1
- package/richtexteditor/plugins/crdt-engine.js +27 -1
- package/richtexteditor/plugins/crossreference.js +1 -1
- package/richtexteditor/plugins/crossreference.min.js +1 -1
- package/richtexteditor/plugins/dialoga11y.js +26 -4
- package/richtexteditor/plugins/dialoga11y.min.js +1 -1
- package/richtexteditor/plugins/dictation.js +1 -1
- package/richtexteditor/plugins/documentimport.js +250 -59
- package/richtexteditor/plugins/documentimport.min.js +4 -4
- package/richtexteditor/plugins/documentoutline.js +47 -8
- package/richtexteditor/plugins/documentoutline.min.js +1 -1
- package/richtexteditor/plugins/docxexport.js +233 -32
- package/richtexteditor/plugins/docxexport.min.js +2 -2
- package/richtexteditor/plugins/draghandle.js +267 -3
- package/richtexteditor/plugins/draghandle.min.js +1 -1
- package/richtexteditor/plugins/emailtoolkit.js +28 -14
- package/richtexteditor/plugins/emailtoolkit.min.js +1 -1
- package/richtexteditor/plugins/emojiautocomplete.js +111 -57
- package/richtexteditor/plugins/emojiautocomplete.min.js +1 -1
- package/richtexteditor/plugins/footnotes.js +65 -11
- package/richtexteditor/plugins/footnotes.min.js +1 -1
- package/richtexteditor/plugins/formatpainter.js +10 -0
- package/richtexteditor/plugins/formatpainter.min.js +1 -1
- package/richtexteditor/plugins/formattingmarks.js +6 -6
- package/richtexteditor/plugins/formattingmarks.min.js +1 -1
- package/richtexteditor/plugins/gapcursor.js +60 -0
- package/richtexteditor/plugins/gapcursor.min.js +1 -1
- package/richtexteditor/plugins/ghostcomplete.js +1 -1
- package/richtexteditor/plugins/html2pdf.js +8 -8
- package/richtexteditor/plugins/html2pdf.min.js +1 -1
- package/richtexteditor/plugins/imageeditor.js +31 -12
- package/richtexteditor/plugins/imageeditor.min.js +1 -1
- package/richtexteditor/plugins/importstyles.js +1 -1
- package/richtexteditor/plugins/inlinecode.js +25 -0
- package/richtexteditor/plugins/inlinecode.min.js +1 -1
- package/richtexteditor/plugins/insertcode.js +29 -11
- package/richtexteditor/plugins/insertcode.min.js +6 -6
- package/richtexteditor/plugins/insertemoji.js +113 -16
- package/richtexteditor/plugins/insertemoji.min.js +1 -1
- package/richtexteditor/plugins/insertgallery.js +46 -40
- package/richtexteditor/plugins/insertgallery.min.js +1 -1
- package/richtexteditor/plugins/inserttemplate.js +43 -19
- package/richtexteditor/plugins/inserttemplate.min.js +1 -1
- package/richtexteditor/plugins/keyboarda11y.js +66 -3
- package/richtexteditor/plugins/keyboarda11y.min.js +1 -1
- package/richtexteditor/plugins/layouttable.js +20 -0
- package/richtexteditor/plugins/layouttable.min.js +1 -1
- package/richtexteditor/plugins/linkchecker.js +29 -9
- package/richtexteditor/plugins/linkchecker.min.js +1 -1
- package/richtexteditor/plugins/localdraft.js +51 -7
- package/richtexteditor/plugins/localdraft.min.js +1 -1
- package/richtexteditor/plugins/markdownexport.js +159 -0
- package/richtexteditor/plugins/markdownexport.min.js +2 -2
- package/richtexteditor/plugins/mathdialog.js +11 -5
- package/richtexteditor/plugins/mathdialog.min.js +1 -1
- package/richtexteditor/plugins/mentionplugin.js +90 -27
- package/richtexteditor/plugins/mentionplugin.min.js +1 -1
- package/richtexteditor/plugins/mermaiddiagram.js +14 -8
- package/richtexteditor/plugins/mermaiddiagram.min.js +2 -2
- package/richtexteditor/plugins/multilevellist.js +4 -0
- package/richtexteditor/plugins/multilevellist.min.js +1 -1
- package/richtexteditor/plugins/nodetypes.js +1 -1
- package/richtexteditor/plugins/nodetypes.min.js +1 -1
- package/richtexteditor/plugins/pagination.js +2 -2
- package/richtexteditor/plugins/pagination.min.js +1 -1
- package/richtexteditor/plugins/pdfexport.js +1752 -1167
- package/richtexteditor/plugins/pdfexport.min.js +28 -13
- package/richtexteditor/plugins/permanentpen.js +3 -3
- package/richtexteditor/plugins/permanentpen.min.js +1 -1
- package/richtexteditor/plugins/readabilitystats.js +25 -11
- package/richtexteditor/plugins/readabilitystats.min.js +1 -1
- package/richtexteditor/plugins/readaloud.js +30 -16
- package/richtexteditor/plugins/readaloud.min.js +1 -1
- package/richtexteditor/plugins/restrictedediting.js +166 -0
- package/richtexteditor/plugins/restrictedediting.min.js +2 -2
- package/richtexteditor/plugins/revisionhistory.js +173 -41
- package/richtexteditor/plugins/revisionhistory.min.js +3 -3
- package/richtexteditor/plugins/rubyannotation.js +21 -11
- package/richtexteditor/plugins/rubyannotation.min.js +1 -1
- package/richtexteditor/plugins/sanitizer.js +119 -7
- package/richtexteditor/plugins/sanitizer.min.js +1 -1
- package/richtexteditor/plugins/slashcommand.js +32 -18
- package/richtexteditor/plugins/slashcommand.min.js +2 -2
- package/richtexteditor/plugins/smartchips.js +39 -25
- package/richtexteditor/plugins/smartchips.min.js +2 -2
- package/richtexteditor/plugins/spellcheck.js +20 -11
- package/richtexteditor/plugins/spellcheck.min.js +2 -2
- package/richtexteditor/plugins/stateinspector.js +21 -11
- package/richtexteditor/plugins/stateinspector.min.js +2 -2
- package/richtexteditor/plugins/structured-content-bridge.js +90 -32
- package/richtexteditor/plugins/structured-content-bridge.min.js +8 -8
- package/richtexteditor/plugins/tableofcontents.js +5 -2
- package/richtexteditor/plugins/tableofcontents.min.js +1 -1
- package/richtexteditor/plugins/tabletools.js +388 -3
- package/richtexteditor/plugins/tabletools.min.js +1 -1
- package/richtexteditor/plugins/textdirection.js +19 -6
- package/richtexteditor/plugins/textdirection.min.js +1 -1
- package/richtexteditor/plugins/textpartlanguage.js +161 -32
- package/richtexteditor/plugins/textpartlanguage.min.js +1 -1
- package/richtexteditor/plugins/todolist.js +90 -6
- package/richtexteditor/plugins/todolist.min.js +1 -1
- package/richtexteditor/plugins/trackedchanges.js +1812 -25
- package/richtexteditor/plugins/trackedchanges.min.js +5 -3
- package/richtexteditor/plugins/wordexport.js +2 -2
- package/richtexteditor/plugins/yjscollab.js +11 -6
- package/richtexteditor/plugins/yjscollab.min.js +1 -1
- package/richtexteditor/plugins/zz_richtextbox_dialog_style.js +22 -13
- package/richtexteditor/plugins/zz_richtextbox_dialog_style.min.js +1 -1
- package/richtexteditor/rte-config.js +144 -86
- package/richtexteditor/rte-headless.js +19 -4
- package/richtexteditor/rte-watchdog.js +3 -1
- package/richtexteditor/rte-webcomponent.js +91 -16
- package/richtexteditor/rte.js +146 -88
- package/richtexteditor/runtime/colorpicker_more_ns.htm +3 -1
- package/scripts/build-angular.mjs +97 -0
- package/svelte/index.d.ts +2 -1
- package/svelte/index.js +80 -9
- package/vue/index.js +130 -34
- package/angular/component.ts +0 -297
- package/angular/index.ts +0 -24
|
@@ -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(){var ae=this,M,N;ae.PluginName="PdfExport",ae.InitConfig=function(e){M=e},ae.InitEditor=function(e){N=e,M.pdfExport!==!1&&(N.getPdfBytes=function(t){return de(t||{})},N.exportToPdf=function(t,r){var n=de(r||{}),i=we(t)||we(M.pdfExportFileName)||Me();return We(n,i+".pdf")},N.downloadPdf=N.exportToPdf,N.attachEvent("exec_command_exportpdf",function(t){t.returnValue=!0,t.stopBubble=!0;try{N.exportToPdf()}catch(r){window.console&&console.error("pdfexport:",r)}}))};var G=72,se={letter:[612,792],legal:[612,1008],tabloid:[792,1224],a3:[842,1191],a4:[595,842],a5:[420,595]};function V(e,t){if(typeof e=="number"&&isFinite(e))return e*G;if(typeof e!="string")return t;var r=/^\s*(-?[\d.]+)\s*(mm|cm|in|px|pt)?\s*$/.exec(e);if(!r)return t;var n=parseFloat(r[1]);if(!isFinite(n))return t;switch(r[2]){case"mm":return n*G/25.4;case"cm":return n*G/2.54;case"pt":return n;case"px":return n*.75;default:return n*G}}function be(e){var t=null;try{typeof N.getDocumentPageSetup=="function"&&(t=N.getDocumentPageSetup())}catch{t=null}t=t||{};var r=String(e.format||t.format||"letter").toLowerCase(),n=se[r]||se.letter,i=String(e.orientation||t.orientation||"").toLowerCase()==="landscape",f=i?n[1]:n[0],s=i?n[0]:n[1],a=e.margins||t.margins||{},o=G/2;return{width:f,height:s,margin:{top:V(a.top,o),right:V(a.right,o),bottom:V(a.bottom,o),left:V(a.left,o)}}}var Q={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"]}},te=32,oe=255,le={};function re(e,t){var r=e+":"+t;if(le[r])return le[r];var n=Q[e]||Q.helvetica,i=re.canvas||(re.canvas=document.createElement("canvas")),f=i.getContext("2d"),s=t&1?"bold ":"",a=t&2?"italic ":"";f.font=s+a+"100px "+n.css;for(var o=[],u=te;u<=oe;u++){var l=f.measureText(String.fromCharCode(u)).width;o.push(Math.round(l*10))}return le[r]=o,o}function Te(e,t,r){return(r<te||r>oe)&&(r=63),re(e,t)[r-te]||500}function ue(e,t,r,n){for(var i=0,f=0;f<e.length;f++)i+=Te(t,r,e.charCodeAt(f));return i*n/1e3}var Ce={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 W(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<256){t+=String.fromCharCode(n);continue}var i=Ce[n];if(i){t+=String.fromCharCode(i);continue}if(n===160){t+=" ";continue}if(n>=8192&&n<=8202){t+=" ";continue}if(n===8722){t+="-";continue}t+="?"}return t}function H(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function Y(){this.objects=[]}Y.prototype.alloc=function(){return this.objects.push(null),this.objects.length},Y.prototype.set=function(e,t){this.objects[e-1]=t},Y.prototype.add=function(e){var t=this.alloc();return this.set(t,e),t},Y.prototype.build=function(e,t){var r=[],n=0;function i(m){var d=typeof m=="string"?he(m):m;return r.push(d),n+=d.length,n}i(`%PDF-1.4
|
|
2
|
-
`),
|
|
3
|
-
`);var
|
|
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
|
-
`),
|
|
5
|
+
`),n(l),n(`
|
|
6
6
|
endstream
|
|
7
|
-
`)}else i
|
|
8
|
-
`);
|
|
9
|
-
`)}for(var
|
|
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
|
-
`,
|
|
13
|
-
`;
|
|
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
|
-
`),
|
|
16
|
-
`+
|
|
15
|
+
`),n(`startxref
|
|
16
|
+
`+f+`
|
|
17
17
|
%%EOF
|
|
18
|
-
`);for(var h=new Uint8Array(n),v=0,p=0;p<r.length;p++)h.set(r[p],v),v+=r[p].length;return h};function Se(e){for(var t=String(e);t.length<10;)t="0"+t;return t}function he(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r)&255;return t}function _(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},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),(n==="sup"||n==="sub")&&(r.size=r.size*.75);var i=e.style;if(i){if(/bold|^[6-9]00$/.test(i.fontWeight||"")&&(r.bold=!0),(i.fontStyle==="italic"||i.fontStyle==="oblique")&&(r.italic=!0),(i.textDecorationLine||i.textDecoration||"").indexOf("underline")>=0&&(r.underline=!0),(i.textDecorationLine||i.textDecoration||"").indexOf("line-through")>=0&&(r.strike=!0),i.color){var f=ke(i.color);f&&(r.color=f)}if(i.fontSize){var s=V(i.fontSize,null);s&&(r.size=s)}}return r}function ke(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 n=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);return n?[n[1]/255,n[2]/255,n[3]/255]:null}var q={h1:2,h2:1.6,h3:1.35,h4:1.15,h5:1,h6:.9};function Z(e,t,r){this.geom=e,this.baseSize=t,this.family=r,this.contentWidth=e.width-e.margin.left-e.margin.right,this.blocks=[]}Z.prototype.runsOf=function(e,t){var r=[],n=this;return(function i(f,s){for(var a=0;a<f.childNodes.length;a++){var o=f.childNodes[a];if(o.nodeType===3){var u=(o.nodeValue||"").replace(/\s+/g," ");u&&r.push({text:u,style:s});continue}if(o.nodeType===1){var l=o.tagName.toLowerCase();if(l==="br"){r.push({br:!0,style:s});continue}if(l==="img"){r.push({img:o,style:s});continue}l==="script"||l==="style"||i(o,_(o,s))}}})(e,t),r},Z.prototype.wrap=function(e,t,r){var n=[],i=[],f=0,s=this,a=this.baseSize;function o(){for(;i.length&&/^\s+$/.test(i[i.length-1].text||"");)i.pop();n.push({parts:i,width:f,size:a}),i=[],f=0,a=s.baseSize}for(var u=0;u<e.length;u++){var l=e[u];if(l.br){o();continue}if(l.img){var c=ce(l.img,t);i.length&&o(),n.push({parts:[{img:l.img,w:c.w,h:c.h,style:l.style}],width:c.w,size:c.h,image:!0});continue}for(var h=(l.style.bold?1:0)|(l.style.italic?2:0),v=l.style.mono?"courier":this.family,p=l.text.split(/(\s+)/),m=0;m<p.length;m++){var d=p[m];if(d){var x=ue(W(d),v,h,l.style.size);f+x>t&&i.length&&!/^\s+$/.test(d)&&(o(),/^\s+$/.test(d))||(i.push({text:d,style:l.style,family:v,styleIndex:h,w:x}),f+=x,l.style.size>a&&(a=l.style.size))}}}i.length&&o(),n.length||n.push({parts:[],width:0,size:this.baseSize});for(var w=0;w<n.length;w++)n[w].height=n[w].image?n[w].size:n[w].size*r;return n};function ce(e,t){var r=e.naturalWidth||e.width||0,n=e.naturalHeight||e.height||0;if(!r||!n)return{w:0,h:0};var i=r*.75,f=n*.75;return i>t&&(f=f*t/i,i=t),{w:i,h:f}}Z.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 n(a){if(!a||!a.style)return 0;var o=a.style.marginLeft||a.style.paddingLeft||"",u=/^\s*(-?[\d.]+)\s*([a-z%]*)\s*$/i.exec(o);if(!u)return 0;var l=parseFloat(u[1]);if(!l||l<=0)return 0;var c=(u[2]||"px").toLowerCase(),h=c==="px"?l:c==="pt"?l*(4/3):c==="in"?l*96:c==="cm"?l*37.795:c==="mm"?l*3.7795:c==="em"||c==="rem"?l*16:0;return h*.75}function i(a,o,u,l,c,h,v){var p=a.tagName.toLowerCase(),m=_(a,o),d="left",x=a.style&&a.style.textAlign||"";(x==="center"||x==="right"||x==="justify")&&(d=x),q[p]&&(m.size=t.baseSize*q[p],m.bold=!0),p==="pre"&&(m.mono=!0);var w=t.contentWidth-u,y=t.runsOf(a,m),k=t.wrap(y,w,p==="pre"?1.25:1.4);t.blocks.push({type:"text",lines:k,indent:u,align:d,spaceBefore:q[p]?m.size*.6:t.baseSize*.35,spaceAfter:q[p]?m.size*.3:t.baseSize*.35,marker:l||null,markerStyle:m,keepWithNext:!!q[p],rule:p==="blockquote"?"quote":null,role:v||(q[p]?"H"+p.charAt(1):p==="blockquote"?"BlockQuote":"P"),listId:c||null,listOrdered:!!h})}function f(a,o,u,l){for(var c=0;c<a.childNodes.length;c++){var h=a.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:o}],t.contentWidth-u,1.4),indent:u,align:"left",spaceBefore:0,spaceAfter:t.baseSize*.35});continue}if(h.nodeType===1){var v=h.tagName.toLowerCase();if(!(v==="script"||v==="style"||v==="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"}),v==="hr"){t.blocks.push({type:"rule",indent:u});continue}if(v==="ul"||v==="ol"){for(var p=parseInt(h.getAttribute("start")||"1",10)||1,m="L"+(t.listSeq=(t.listSeq||0)+1),d=0;d<h.childNodes.length;d++){var x=h.childNodes[d];if(!(x.nodeType!==1||x.tagName.toLowerCase()!=="li")){var w=v==="ol"?p+++".":"\u2022";i(x,_(x,o),u+t.baseSize*1.6,w,m,v==="ol"),s(x,_(x,o),u+t.baseSize*1.6)}}continue}if(v==="table"){t.table(h,_(h,o),u);continue}if(v==="img"){var y=ce(h,t.contentWidth-u);y.w&&t.blocks.push({type:"text",role:"Figure",alt:h.getAttribute("alt")||"",lines:[{parts:[{img:h,w:y.w,h:y.h,style:o}],width:y.w,size:y.h,height:y.h,image:!0}],indent:u,align:"left",spaceBefore:4,spaceAfter:4});continue}if(ve(v)){var k=(v==="blockquote"?t.baseSize*1.5:0)+n(h),C=v==="blockquote"?"BlockQuote":l;if(ze(h)){f(h,_(h,o),u+k,C);continue}i(h,o,u+k,null,null,!1,C);continue}i(h,o,u,null)}}}}function s(a,o,u){for(var l=0;l<a.childNodes.length;l++){var c=a.childNodes[l];if(c.nodeType===1){var h=c.tagName.toLowerCase();(h==="ul"||h==="ol")&&f({childNodes:[c]},o,u)}}}return f(e,r,0),this.blocks};function ve(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 ze(e){for(var t=0;t<e.childNodes.length;t++){var r=e.childNodes[t];if(r.nodeType===1&&(ve(r.tagName.toLowerCase())||/^(ul|ol|table|hr)$/.test(r.tagName.toLowerCase())))return!0}return!1}Z.prototype.table=function(e,t,r){for(var n=this,i=[],f=e.getElementsByTagName("tr"),s=0,a=0;a<f.length;a++){for(var o=[],u=0;u<f[a].childNodes.length;u++){var l=f[a].childNodes[u];if(l.nodeType===1){var c=l.tagName.toLowerCase();c!=="td"&&c!=="th"||o.push({node:l,header:c==="th"})}}o.length&&(i.push(o),o.length>s&&(s=o.length))}if(i.length){for(var h=this.contentWidth-r,v=h/s,p=4,m=[],d=0;d<i.length;d++){for(var x=[],w=0,y=0;y<i[d].length;y++){var k=_(i[d][y].node,t);i[d][y].header&&(k.bold=!0);for(var C=n.wrap(n.runsOf(i[d][y].node,k),v-p*2,1.35),z=0,I=0;I<C.length;I++)z+=C[I].height;z>w&&(w=z),x.push({lines:C,header:i[d][y].header})}m.push({cells:x,height:w+p*2,header:i[d][0]&&i[d][0].header})}this.blocks.push({type:"table",rows:m,colWidth:v,cols:s,indent:r,pad:p,spaceBefore:this.baseSize*.5,spaceAfter:this.baseSize*.5})}};function de(e){var t=String(e.font||M.pdfExportFont||"helvetica").toLowerCase();Q[t]||(t="helvetica");var r=Number(e.fontSize||M.pdfExportBaseFontSize||11);(!isFinite(r)||r<=0)&&(r=11);var n=be(e),i=document.createElement("div");i.innerHTML=N.getHTMLCode()||"";var f=new Z(n,r,t),s=f.run(i),a=Ee(s,n,r);return Re(a,n,t,r,e)}function Ee(e,t,r){var n=t.height-t.margin.top,i=t.margin.bottom,f=[],s=[],a=n;function o(){f.push(s),s=[],a=n}for(var u=0;u<e.length;u++){var l=e[u];if(l.type==="pagebreak"){s.length&&o();continue}if(l.type==="rule"){a-r<i&&o(),a-=r*.6,s.push({op:"rule",y:a,indent:l.indent}),a-=r*.6;continue}if(l.type==="table"){a-=l.spaceBefore;for(var c=0;c<l.rows.length;c++){var h=l.rows[c];a-h.height<i&&(o(),l.rows[0]&&l.rows[0].header&&c>0&&(s.push({op:"row",row:l.rows[0],y:a,block:l}),a-=l.rows[0].height)),s.push({op:"row",row:h,y:a,block:l}),a-=h.height}a-=l.spaceAfter;continue}a-=l.spaceBefore;for(var v=0;v<l.lines.length;v++){var p=l.lines[v];a-p.height<i&&o(),s.push({op:"line",line:p,y:a,block:l,first:v===0}),a-=p.height}if(a-=l.spaceAfter,l.keepWithNext&&s.length&&e[u+1]&&e[u+1].type!=="pagebreak"){var m=Ae(e[u+1]);if(a-m<i){for(var d=[];s.length&&s[s.length-1].block===l;)d.unshift(s.pop());if(s.length){o();for(var x=0;x<d.length;x++)d[x].y=a,s.push(d[x]),a-=d[x].line.height}else for(var w=0;w<d.length;w++)s.push(d[w])}}}return(s.length||!f.length)&&f.push(s),f}function Ae(e){return e.type==="table"?e.rows[0]?e.rows[0].height:0:e.lines&&e.lines[0]?e.lines[0].height:0}function Re(e,t,r,n,i){var f=new Y,s=Q[r],a=Q.courier,o={},u=[];function l(B,F,O,T){var A=re(F,O),P=f.add("<< /Type /Font /Subtype /Type1 /BaseFont /"+B+" /Encoding /WinAnsiEncoding /FirstChar "+te+" /LastChar "+oe+" /Widths ["+A.join(" ")+"] >>");o[T]=P,u.push("/"+T+" "+P+" 0 R")}for(var c=0;c<4;c++)l(s.faces[c],r,c,"F"+c),l(a.faces[c],"courier",c,"M"+c);var h={},v=[];function p(B){var F=B.getAttribute("src")||"";if(h[F])return h[F];var O=Fe(B);if(!O)return null;var T=f.add({dict:"<< /Type /XObject /Subtype /Image /Width "+O.width+" /Height "+O.height+" /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length 0 >>",stream:O.bytes}),A="Im"+(v.length+1);return h[F]={id:T,alias:A},v.push("/"+A+" "+T+" 0 R"),h[F]}for(var m=[],d=[],x=[],w=0;w<e.length;w++)m.push(f.alloc()),d.push(f.alloc()),x.push([]);for(var y=f.alloc(),k=[],C=0;C<e.length;C++){var z=new ne(C),I=De(e[C],t,r,n,p,C+1,e.length,i,z);f.set(d[C],{dict:"<< /Length 0 >>",stream:I.content}),k.push(I.marks);for(var S=0;S<I.links.length;S++){var L=I.links[S];x[C].push(f.add("<< /Type /Annot /Subtype /Link /Rect ["+g(L.x0)+" "+g(L.y0)+" "+g(L.x1)+" "+g(L.y1)+"] /Border [0 0 0] /A << /S /URI /URI ("+H(W(L.href))+") >> >>"))}}for(var b=Ie(f,k,m),R=0;R<e.length;R++)f.set(m[R],"<< /Type /Page /Parent "+y+" 0 R /MediaBox [0 0 "+g(t.width)+" "+g(t.height)+"] /Resources << /Font << "+u.join(" ")+" >>"+(v.length?" /XObject << "+v.join(" ")+" >>":"")+" >> /Contents "+d[R]+" 0 R /StructParents "+R+(x[R].length?" /Annots ["+x[R].map(function(B){return B+" 0 R"}).join(" ")+"]":"")+" >>");f.set(y,"<< /Type /Pages /Count "+e.length+" /Kids ["+m.map(function(B){return B+" 0 R"}).join(" ")+"] >>");var E=i.title||M.pdfExportTitle||document.title||"Document",J=i.author||M.pdfExportAuthor||"",U=f.add("<< /Type /Catalog /Pages "+y+" 0 R /Lang ("+H(String(i.lang||document.documentElement.lang||"en"))+") /MarkInfo << /Marked true >> /StructTreeRoot "+b.rootId+" 0 R /ViewerPreferences << /DisplayDocTitle true >> >>"),ie=f.add("<< /Title ("+H(W(String(E)))+")"+(J?" /Author ("+H(W(String(J)))+")":"")+" /Producer (RichTextEditor) /Creator (RichTextEditor) /CreationDate ("+Le(new Date)+") >>");return f.build(U,ie)}function Ie(e,t,r){var n=e.alloc(),i=[],f=[];function s(T,A){var P={id:e.alloc(),role:T,kids:[],extra:A||"",children:[],parent:null};return i.push(P),P}for(var a=s("Document"),o=new Map,u=new Map,l=new Map,c=new Map,h=new Map,v=new Map,p=new Map,m=0;m<t.length;m++){var d=t[m];f[m]=[];for(var x=0;x<d.length;x++){var w=d[x].owner,y=d[x].mcid,k=z(w);k.kids.push({page:m,mcid:y}),f[m][y]=k.id}}function C(T,A){A.parent||(A.parent=T,T.children.push(A))}function z(T){if(T.kind==="cell"){var A=h.get(T.block);A||(A=s("Table"),h.set(T.block,A),C(a,A));var P=v.get(T.row);P||(P=s("TR"),v.set(T.row,P),C(A,P));var j=p.get(T.row);return j||(j={},p.set(T.row,j)),j[T.col]||(j[T.col]=s(T.header?"TH":"TD",T.header?" /Scope /Column":""),C(P,j[T.col])),j[T.col]}var D=T.block,fe=a;if(D.listId){var K=o.get(D.listId);K||(K=s("L"),o.set(D.listId,K),C(a,K));var X=u.get(D);X||(X=s("LI"),u.set(D,X),C(K,X)),fe=X}if(T.kind==="lbl"){var ee=l.get(D);return ee||(ee=s("Lbl"),l.set(D,ee),C(fe,ee)),ee}var $=c.get(D);if(!$){if(D.listId)$=s("LBody");else{var He=D.role==="Figure"?" /Alt ("+H(W(D.alt||"Image"))+")":"";$=s(D.role||"P",He)}c.set(D,$),C(fe,$)}return $}for(var I=0;I<i.length;I++){for(var S=i[I],L=[],b=0;b<S.children.length;b++)L.push(S.children[b].id+" 0 R");for(var R=0;R<S.kids.length;R++)L.push("<< /Type /MCR /Pg "+r[S.kids[R].page]+" 0 R /MCID "+S.kids[R].mcid+" >>");var E=S.parent?S.parent.id:n;e.set(S.id,"<< /Type /StructElem /S /"+S.role+" /P "+E+" 0 R"+S.extra+(L.length?" /K ["+L.join(" ")+"]":"")+" >>")}for(var J=[],U=0;U<f.length;U++){for(var ie=f[U]||[],B=[],F=0;F<ie.length;F++)B.push((ie[F]||a.id)+" 0 R");J.push(U+" ["+B.join(" ")+"]")}var O=e.add("<< /Nums ["+J.join(" ")+"] >>");return e.set(n,"<< /Type /StructTreeRoot /K ["+a.id+" 0 R] /ParentTree "+O+" 0 R /ParentTreeNextKey "+f.length+" >>"),{rootId:n}}function Le(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 g(e){return(Math.round(e*100)/100).toString()}function ne(e){this.pageIndex=e,this.next=0,this.marks=[]}ne.prototype.open=function(e,t,r){var n=this.next++;return this.marks.push({owner:r,mcid:n,role:t}),e.push("/"+t+" << /MCID "+n+" >> BDC"),n},ne.prototype.close=function(e){e.push("EMC")},ne.prototype.artifact=function(e,t){e.push("/Artifact BMC"),t(),e.push("EMC")};function De(e,t,r,n,i,f,s,a,o){for(var u=[],l=[],c=t.margin.left,h=0;h<e.length;h++){var v=e[h];if(v.op==="rule"){o.artifact(u,function(){u.push("0.8 0.8 0.8 RG 0.5 w "+g(c+v.indent)+" "+g(v.y)+" m "+g(t.width-t.margin.right)+" "+g(v.y)+" l S")});continue}if(v.op==="row"){Pe(v,t,u,c,i,l,o);continue}xe(v,t,u,c,r,i,l,o)}var p=Ne(a);return(p.header||p.footer)&&o.artifact(u,function(){p.header&&ge(u,p.header,t,t.height-t.margin.top*.55,r,n*.85,f,s),p.footer&&ge(u,p.footer,t,t.margin.bottom*.55,r,n*.85,f,s)}),{content:u.join(`
|
|
19
|
-
|
|
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&>(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}}
|
|
@@ -131,7 +131,7 @@ function RTE_Plugin_PermanentPen() {
|
|
|
131
131
|
function tidyRun(run) {
|
|
132
132
|
if (!run) return;
|
|
133
133
|
var text = run.textContent || "";
|
|
134
|
-
if (text.replace(
|
|
134
|
+
if (text.replace(/\u200b/g, "") === "") {
|
|
135
135
|
// Nothing was ever typed: remove the empty run entirely.
|
|
136
136
|
if (run.parentNode) run.parentNode.removeChild(run);
|
|
137
137
|
return;
|
|
@@ -139,7 +139,7 @@ function RTE_Plugin_PermanentPen() {
|
|
|
139
139
|
var walker = run.ownerDocument.createTreeWalker(run, 4 /* SHOW_TEXT */, null, false);
|
|
140
140
|
var n;
|
|
141
141
|
while ((n = walker.nextNode())) {
|
|
142
|
-
if (n.nodeValue.indexOf("
|
|
142
|
+
if (n.nodeValue.indexOf("\u200b") >= 0) n.nodeValue = n.nodeValue.replace(/\u200b/g, "");
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
@@ -173,7 +173,7 @@ function RTE_Plugin_PermanentPen() {
|
|
|
173
173
|
// A zero-width space gives the caret something real to sit inside; an
|
|
174
174
|
// empty inline element cannot hold a caret, so the first character would
|
|
175
175
|
// land outside the span and the pen would appear not to work.
|
|
176
|
-
span.appendChild(doc.createTextNode("
|
|
176
|
+
span.appendChild(doc.createTextNode("\u200b"));
|
|
177
177
|
|
|
178
178
|
range.insertNode(span);
|
|
179
179
|
var r = doc.createRange();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_permanentpen=RTE_Plugin_PermanentPen,typeof RTE_DefaultConfig.permanentPenStyle>"u"&&(RTE_DefaultConfig.permanentPenStyle={color:"#c81e1e","font-weight":"700"}),typeof RTE_DefaultConfig.permanentPenClass>"u"&&(RTE_DefaultConfig.permanentPenClass="rte-pen");function RTE_Plugin_PermanentPen(){var c=this,u,a,y=null,o=!1,i=null;c.PluginName="PermanentPen",c.InitConfig=function(t){u=t},c.InitEditor=function(t){a=t,a.attachEvent("exec_command_permanentpen",function(e){e.returnValue=!0,c.Toggle()}),s();try{a.attachEvent("ready",s)}catch{}try{a.attachEvent("aftersethtml",s)}catch{}setTimeout(s,0),a.setPermanentPen=function(e){return P(!!e)},a.togglePermanentPen=function(){return P(!o)},a.isPermanentPenActive=function(){return o},a.setPermanentPenStyle=function(e){return e&&typeof e=="object"&&(u.permanentPenStyle=e,i=null),u.permanentPenStyle},a.getPermanentPenStyle=function(){var e=u.permanentPenStyle||{},n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n}};function s(){var t=p();if(!(!t||t===y)){y=t;var e=d();e&&(e.addEventListener("beforeinput",R,!0),e.addEventListener("mouseup",function(){i=null}),e.addEventListener("keydown",function(n){/^Arrow|^Home|^End|^Page/.test(n.key)&&(i=null)}),e.addEventListener("blur",function(){i=null}))}}function p(){try{return a.getDocument()}catch{return null}}function d(){try{return a.getEditable()}catch{return null}}function P(t){var e=o;o=!!t;var n=d();return n&&n.classList&&(o?n.classList.add("rte-pen-active"):n.classList.remove("rte-pen-active")),e&&!o&&C(),i=null,o}function C(){var t=p();if(t){var e;try{e=a.getSelection()}catch{return}if(!(!e||e.rangeCount===0)){var n=h(e.getRangeAt(0).startContainer);if(!(!n||!n.parentNode)){E(n);try{var r=t.createRange();r.setStartAfter(n),r.collapse(!0),e.removeAllRanges(),e.addRange(r)}catch{}}}}}function E(t){if(t){var e=t.textContent||"";if(e.replace(
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_permanentpen=RTE_Plugin_PermanentPen,typeof RTE_DefaultConfig.permanentPenStyle>"u"&&(RTE_DefaultConfig.permanentPenStyle={color:"#c81e1e","font-weight":"700"}),typeof RTE_DefaultConfig.permanentPenClass>"u"&&(RTE_DefaultConfig.permanentPenClass="rte-pen");function RTE_Plugin_PermanentPen(){var c=this,u,a,y=null,o=!1,i=null;c.PluginName="PermanentPen",c.InitConfig=function(t){u=t},c.InitEditor=function(t){a=t,a.attachEvent("exec_command_permanentpen",function(e){e.returnValue=!0,c.Toggle()}),s();try{a.attachEvent("ready",s)}catch{}try{a.attachEvent("aftersethtml",s)}catch{}setTimeout(s,0),a.setPermanentPen=function(e){return P(!!e)},a.togglePermanentPen=function(){return P(!o)},a.isPermanentPenActive=function(){return o},a.setPermanentPenStyle=function(e){return e&&typeof e=="object"&&(u.permanentPenStyle=e,i=null),u.permanentPenStyle},a.getPermanentPenStyle=function(){var e=u.permanentPenStyle||{},n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n}};function s(){var t=p();if(!(!t||t===y)){y=t;var e=d();e&&(e.addEventListener("beforeinput",R,!0),e.addEventListener("mouseup",function(){i=null}),e.addEventListener("keydown",function(n){/^Arrow|^Home|^End|^Page/.test(n.key)&&(i=null)}),e.addEventListener("blur",function(){i=null}))}}function p(){try{return a.getDocument()}catch{return null}}function d(){try{return a.getEditable()}catch{return null}}function P(t){var e=o;o=!!t;var n=d();return n&&n.classList&&(o?n.classList.add("rte-pen-active"):n.classList.remove("rte-pen-active")),e&&!o&&C(),i=null,o}function C(){var t=p();if(t){var e;try{e=a.getSelection()}catch{return}if(!(!e||e.rangeCount===0)){var n=h(e.getRangeAt(0).startContainer);if(!(!n||!n.parentNode)){E(n);try{var r=t.createRange();r.setStartAfter(n),r.collapse(!0),e.removeAllRanges(),e.addRange(r)}catch{}}}}}function E(t){if(t){var e=t.textContent||"";if(e.replace(/\u200b/g,"")===""){t.parentNode&&t.parentNode.removeChild(t);return}for(var n=t.ownerDocument.createTreeWalker(t,4,null,!1),r;r=n.nextNode();)r.nodeValue.indexOf("\u200B")>=0&&(r.nodeValue=r.nodeValue.replace(/\u200b/g,""))}}function R(t){if(o&&!(t.inputType&&t.inputType!=="insertText"&&t.inputType!=="insertCompositionText")){var e=p();if(e){var n;try{n=a.getSelection()}catch{return}if(!(!n||n.rangeCount===0)){var r=n.getRangeAt(0);if(r.collapsed&&!(i&&T(i,r.startContainer))){var f=h(r.startContainer);if(f&&S(f)){i=f;return}var l=e.createElement("span");l.className=String(u.permanentPenClass||"rte-pen");var v=u.permanentPenStyle||{};for(var g in v)v.hasOwnProperty(g)&&l.style.setProperty(g,v[g]);l.appendChild(e.createTextNode("\u200B")),r.insertNode(l);var m=e.createRange();m.setStart(l.firstChild,1),m.collapse(!0),n.removeAllRanges(),n.addRange(m),i=l}}}}}function T(t,e){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function h(t){for(var e=d(),n=String(u.permanentPenClass||"rte-pen"),r=t&&t.nodeType===3?t.parentNode:t;r&&r!==e;){if(r.nodeType===1&&r.classList&&r.classList.contains(n))return r;r=r.parentNode}return null}function S(t){var e=u.permanentPenStyle||{};for(var n in e)if(e.hasOwnProperty(n)&&t.style.getPropertyValue(n)!==String(e[n]))return!1;return!0}}
|
|
@@ -26,6 +26,20 @@ function RTE_Plugin_ReadabilityStats() {
|
|
|
26
26
|
|
|
27
27
|
obj.InitConfig = function (argconfig) { config = argconfig; };
|
|
28
28
|
|
|
29
|
+
// 2026-10-18 the dialog's words read config.text_ keys at the display site (getReadabilityStats keeps its English
|
|
30
|
+
// easeLabel / readingTimeText). The title read getLangText("readabilitytitle"), which returns the KEY when a pack
|
|
31
|
+
// lacks it, so every page showed "readabilitytitle". tools/i18n/readability-language.mjs
|
|
32
|
+
function rT(key, en, a) { var s = (config && config["text_" + key]) || en; return a === undefined ? s : s.split("{0}").join(String(a)); }
|
|
33
|
+
function easeText(ease) {
|
|
34
|
+
if (ease >= 90) return rT("rd_e90", "Very easy (5th grade)");
|
|
35
|
+
if (ease >= 80) return rT("rd_e80", "Easy (6th grade)");
|
|
36
|
+
if (ease >= 70) return rT("rd_e70", "Fairly easy (7th grade)");
|
|
37
|
+
if (ease >= 60) return rT("rd_e60", "Standard (8\u20139th grade)");
|
|
38
|
+
if (ease >= 50) return rT("rd_e50", "Fairly difficult (10\u201312th grade)");
|
|
39
|
+
if (ease >= 30) return rT("rd_e30", "Difficult (college)");
|
|
40
|
+
return rT("rd_e0", "Very difficult (college graduate)");
|
|
41
|
+
}
|
|
42
|
+
|
|
29
43
|
obj.InitEditor = function (argeditor) {
|
|
30
44
|
editor = argeditor;
|
|
31
45
|
if (config.readabilityStats === false) return;
|
|
@@ -104,8 +118,8 @@ function RTE_Plugin_ReadabilityStats() {
|
|
|
104
118
|
if (ease >= 90) return "Very easy (5th grade)";
|
|
105
119
|
if (ease >= 80) return "Easy (6th grade)";
|
|
106
120
|
if (ease >= 70) return "Fairly easy (7th grade)";
|
|
107
|
-
if (ease >= 60) return "Standard (8
|
|
108
|
-
if (ease >= 50) return "Fairly difficult (10
|
|
121
|
+
if (ease >= 60) return "Standard (8\u20139th grade)";
|
|
122
|
+
if (ease >= 50) return "Fairly difficult (10\u201312th grade)";
|
|
109
123
|
if (ease >= 30) return "Difficult (college)";
|
|
110
124
|
return "Very difficult (college graduate)";
|
|
111
125
|
}
|
|
@@ -113,20 +127,20 @@ function RTE_Plugin_ReadabilityStats() {
|
|
|
113
127
|
function openDialog() {
|
|
114
128
|
var s = compute(currentText());
|
|
115
129
|
try {
|
|
116
|
-
var d = editor.createDialog((
|
|
130
|
+
var d = editor.createDialog(rT("readabilitytitle", "Readability statistics"), "rte-dialog-readability");
|
|
117
131
|
var doc = d.ownerDocument;
|
|
118
132
|
var wrap = doc.createElement("div");
|
|
119
133
|
wrap.style.cssText = "padding:14px 18px;min-width:340px;font:13px -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;color:#0f172a";
|
|
120
134
|
|
|
121
135
|
var rows = [
|
|
122
|
-
["Flesch Reading Ease", s.fleschReadingEase + "
|
|
123
|
-
["Flesch
|
|
124
|
-
["Reading time", s.
|
|
125
|
-
["Words", String(s.words), false],
|
|
126
|
-
["Sentences", String(s.sentences), false],
|
|
127
|
-
["Avg words / sentence", String(s.avgWordsPerSentence), false],
|
|
128
|
-
["Avg syllables / word", String(s.avgSyllablesPerWord), false],
|
|
129
|
-
["Characters (no spaces)", String(s.characters), false]
|
|
136
|
+
[rT("rd_ease", "Flesch Reading Ease"), s.fleschReadingEase + " \u2014 " + easeText(s.fleschReadingEase), true],
|
|
137
|
+
[rT("rd_grade", "Flesch\u2013Kincaid Grade"), String(s.fleschKincaidGrade), false],
|
|
138
|
+
[rT("rd_time", "Reading time"), s.readingTimeMinutes < 1 ? rT("rd_sec", "{0} sec", Math.max(1, Math.round(s.readingTimeMinutes * 60))) : rT("rd_min", "{0} min", Math.round(s.readingTimeMinutes)), false],
|
|
139
|
+
[rT("rd_words", "Words"), String(s.words), false],
|
|
140
|
+
[rT("rd_sentences", "Sentences"), String(s.sentences), false],
|
|
141
|
+
[rT("rd_avgwords", "Avg words / sentence"), String(s.avgWordsPerSentence), false],
|
|
142
|
+
[rT("rd_avgsyll", "Avg syllables / word"), String(s.avgSyllablesPerWord), false],
|
|
143
|
+
[rT("rd_chars", "Characters (no spaces)"), String(s.characters), false]
|
|
130
144
|
];
|
|
131
145
|
for (var i = 0; i < rows.length; i++) {
|
|
132
146
|
var r = doc.createElement("div");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_readabilitystats=RTE_Plugin_ReadabilityStats,typeof RTE_DefaultConfig.readabilityStats>"u"&&(RTE_DefaultConfig.readabilityStats=!0);function RTE_Plugin_ReadabilityStats(){var
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_readabilitystats=RTE_Plugin_ReadabilityStats,typeof RTE_DefaultConfig.readabilityStats>"u"&&(RTE_DefaultConfig.readabilityStats=!0);function RTE_Plugin_ReadabilityStats(){var y=this,c,d;y.PluginName="ReadabilityStats",y.InitConfig=function(e){c=e};function r(e,t,a){var i=c&&c["text_"+e]||t;return a===void 0?i:i.split("{0}").join(String(a))}function _(e){return e>=90?r("rd_e90","Very easy (5th grade)"):e>=80?r("rd_e80","Easy (6th grade)"):e>=70?r("rd_e70","Fairly easy (7th grade)"):e>=60?r("rd_e60","Standard (8\u20139th grade)"):e>=50?r("rd_e50","Fairly difficult (10\u201312th grade)"):e>=30?r("rd_e30","Difficult (college)"):r("rd_e0","Very difficult (college graduate)")}y.InitEditor=function(e){d=e,c.readabilityStats!==!1&&(d.countSyllables=function(t){return m(t)},d.getReadabilityStats=function(t){return b(t!=null?String(t):v())},d.attachEvent("exec_command_readability",function(t){t.returnValue=!0,t.stopBubble=!0,T()}))};function v(){try{var e=d.getEditable&&d.getEditable();if(e)return e.innerText||e.textContent||""}catch{}return""}function m(e){if(e=String(e||"").toLowerCase().replace(/[^a-z]/g,""),!e)return 0;if(e.length<=3)return 1;e=e.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"");var t=e.match(/[aeiouy]{1,2}/g);return t?t.length:1}function b(e){e=String(e||"").replace(/\s+/g," ").trim();var t=e?e.split(/\s+/):[],a=t.length,i=e.match(/[^.!?]+[.!?]+/g),n=i?i.length:a?1:0;a&&n===0&&(n=1);for(var l=0,s=0;s<t.length;s++)l+=m(t[s]);var o=e.replace(/\s/g,"").length,u=n?a/n:0,f=a?l/a:0,g=a?206.835-1.015*u-84.6*f:0,p=a?.39*u+11.8*f-15.59:0;g=Math.round(g*10)/10,p=Math.round(p*10)/10;var E=parseInt(c.readabilityWordsPerMinute,10)||200,h=a/E,x=h<1?Math.max(1,Math.round(h*60))+" sec":Math.round(h)+" min";return{words:a,sentences:n,syllables:l,characters:o,avgWordsPerSentence:Math.round(u*10)/10,avgSyllablesPerWord:Math.round(f*100)/100,fleschReadingEase:g,fleschKincaidGrade:Math.max(0,p),readingTimeMinutes:Math.round(h*10)/10,readingTimeText:x,easeLabel:S(g)}}function S(e){return e>=90?"Very easy (5th grade)":e>=80?"Easy (6th grade)":e>=70?"Fairly easy (7th grade)":e>=60?"Standard (8\u20139th grade)":e>=50?"Fairly difficult (10\u201312th grade)":e>=30?"Difficult (college)":"Very difficult (college graduate)"}function T(){var e=b(v());try{var t=d.createDialog(r("readabilitytitle","Readability statistics"),"rte-dialog-readability"),a=t.ownerDocument,i=a.createElement("div");i.style.cssText="padding:14px 18px;min-width:340px;font:13px -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;color:#0f172a";for(var n=[[r("rd_ease","Flesch Reading Ease"),e.fleschReadingEase+" \u2014 "+_(e.fleschReadingEase),!0],[r("rd_grade","Flesch\u2013Kincaid Grade"),String(e.fleschKincaidGrade),!1],[r("rd_time","Reading time"),e.readingTimeMinutes<1?r("rd_sec","{0} sec",Math.max(1,Math.round(e.readingTimeMinutes*60))):r("rd_min","{0} min",Math.round(e.readingTimeMinutes)),!1],[r("rd_words","Words"),String(e.words),!1],[r("rd_sentences","Sentences"),String(e.sentences),!1],[r("rd_avgwords","Avg words / sentence"),String(e.avgWordsPerSentence),!1],[r("rd_avgsyll","Avg syllables / word"),String(e.avgSyllablesPerWord),!1],[r("rd_chars","Characters (no spaces)"),String(e.characters),!1]],l=0;l<n.length;l++){var s=a.createElement("div");s.style.cssText="display:flex;justify-content:space-between;gap:24px;padding:6px 0;border-bottom:1px solid #eef2f7"+(n[l][2]?";font-weight:600;font-size:14px":"");var o=a.createElement("span");o.textContent=n[l][0],o.style.color="#475569";var u=a.createElement("span");u.textContent=n[l][1],u.style.textAlign="right",s.appendChild(o),s.appendChild(u),i.appendChild(s)}t.appendChild(i)}catch{window.console&&console.warn("readabilitystats:",e)}}}
|
|
@@ -28,6 +28,13 @@ function RTE_Plugin_ReadAloud() {
|
|
|
28
28
|
function supported() { return !!synth() && typeof window.SpeechSynthesisUtterance === "function"; }
|
|
29
29
|
|
|
30
30
|
obj.InitConfig = function (argconfig) { config = argconfig; };
|
|
31
|
+
// 2026-10-18 the words read config.text_ keys (language packs), English as the fallback; {0} / {1} fill a template.
|
|
32
|
+
// tools/i18n/plugin-bars-language.mjs
|
|
33
|
+
function pText(key, fallback) {
|
|
34
|
+
var s = (config && config["text_" + key]) || fallback;
|
|
35
|
+
for (var i = 2; i < arguments.length; i++) s = s.split("{" + (i - 2) + "}").join(String(arguments[i]));
|
|
36
|
+
return s;
|
|
37
|
+
}
|
|
31
38
|
|
|
32
39
|
obj.InitEditor = function (argeditor) {
|
|
33
40
|
editor = argeditor;
|
|
@@ -50,7 +57,7 @@ function RTE_Plugin_ReadAloud() {
|
|
|
50
57
|
var d = editor.createDialog((editor.getLangText && editor.getLangText("readaloudtitle")) || "Read aloud", "rte-dialog-readaloud");
|
|
51
58
|
var w = d.ownerDocument.createElement("div");
|
|
52
59
|
w.style.cssText = "padding:16px;min-width:320px;font:13px -apple-system,Segoe UI,sans-serif";
|
|
53
|
-
w.textContent = "This browser does not provide a speech synthesizer (Web Speech API). Read-aloud is unavailable here.";
|
|
60
|
+
w.textContent = pText("ra_unsupported", "This browser does not provide a speech synthesizer (Web Speech API). Read-aloud is unavailable here.");
|
|
54
61
|
d.appendChild(w);
|
|
55
62
|
} catch (e) { /* ignore */ }
|
|
56
63
|
};
|
|
@@ -89,7 +96,7 @@ function RTE_Plugin_ReadAloud() {
|
|
|
89
96
|
|
|
90
97
|
// Split [text] into sentence segments with absolute offsets (base added).
|
|
91
98
|
function splitSentences(text, base) {
|
|
92
|
-
var segs = [], re = /[^.!?\n
|
|
99
|
+
var segs = [], re = /[^.!?\n\u3002\uff01\uff1f]*[.!?\n\u3002\uff01\uff1f]+|\S[^.!?\n]*$/g, m;
|
|
93
100
|
while ((m = re.exec(text)) !== null) {
|
|
94
101
|
if (m[0] && /\S/.test(m[0])) segs.push({ text: m[0], start: base + m.index, end: base + m.index + m[0].length });
|
|
95
102
|
if (m.index === re.lastIndex) re.lastIndex++; // guard against zero-length
|
|
@@ -103,7 +110,7 @@ function RTE_Plugin_ReadAloud() {
|
|
|
103
110
|
if (!supported()) { obj.NotifyUnsupported(); return; }
|
|
104
111
|
obj.Stop(); // reset any prior run
|
|
105
112
|
var map = buildMap();
|
|
106
|
-
if (!map.hasNodes) { setStatus("Nothing to read"); return; }
|
|
113
|
+
if (!map.hasNodes) { setStatus(pText("ra_nothing", "Nothing to read")); return; }
|
|
107
114
|
// Selection range -> read just the selection; else whole doc.
|
|
108
115
|
var sel = editor.getSelection ? editor.getSelection() : null;
|
|
109
116
|
var rStart = 0, rEnd = map.full.length;
|
|
@@ -118,7 +125,7 @@ function RTE_Plugin_ReadAloud() {
|
|
|
118
125
|
savedRange = (sel && sel.rangeCount) ? sel.getRangeAt(0).cloneRange() : null;
|
|
119
126
|
var slice = map.full.substring(rStart, rEnd);
|
|
120
127
|
queue = splitSentences(slice, rStart);
|
|
121
|
-
if (!queue.length) { setStatus("Nothing to read"); return; }
|
|
128
|
+
if (!queue.length) { setStatus(pText("ra_nothing", "Nothing to read")); return; }
|
|
122
129
|
qIndex = 0; speaking = true; paused = false;
|
|
123
130
|
obj._map = map; obj._opts = opts || {};
|
|
124
131
|
updatePlayBtn();
|
|
@@ -134,7 +141,7 @@ function RTE_Plugin_ReadAloud() {
|
|
|
134
141
|
u.rate = Math.min(2, Math.max(0.5, rate));
|
|
135
142
|
var v = chosenVoice();
|
|
136
143
|
if (v) u.voice = v;
|
|
137
|
-
u.onstart = function () { if (config.readAloudHighlight !== false) highlight(seg); setStatus("Reading
|
|
144
|
+
u.onstart = function () { if (config.readAloudHighlight !== false) highlight(seg); setStatus(pText("ra_readingof", "Reading\u2026 ({0}/{1})", qIndex + 1, queue.length)); };
|
|
138
145
|
u.onend = function () { if (!speaking) return; qIndex++; speakNext(); };
|
|
139
146
|
u.onerror = function () { if (!speaking) return; qIndex++; speakNext(); };
|
|
140
147
|
try { s.speak(u); } catch (e) { qIndex++; speakNext(); }
|
|
@@ -155,11 +162,11 @@ function RTE_Plugin_ReadAloud() {
|
|
|
155
162
|
|
|
156
163
|
obj.Pause = function () {
|
|
157
164
|
var s = synth(); if (!s || !speaking) return;
|
|
158
|
-
if (!paused) { try { s.pause(); } catch (e) {} paused = true; updatePlayBtn(); setStatus("Paused"); }
|
|
165
|
+
if (!paused) { try { s.pause(); } catch (e) {} paused = true; updatePlayBtn(); setStatus(pText("ra_paused", "Paused")); }
|
|
159
166
|
};
|
|
160
167
|
obj.Resume = function () {
|
|
161
168
|
var s = synth(); if (!s || !speaking) return;
|
|
162
|
-
if (paused) { try { s.resume(); } catch (e) {} paused = false; updatePlayBtn(); setStatus("Reading
|
|
169
|
+
if (paused) { try { s.resume(); } catch (e) {} paused = false; updatePlayBtn(); setStatus(pText("ra_reading", "Reading\u2026")); }
|
|
163
170
|
};
|
|
164
171
|
obj.Stop = function () {
|
|
165
172
|
var s = synth();
|
|
@@ -179,7 +186,7 @@ function RTE_Plugin_ReadAloud() {
|
|
|
179
186
|
var voices = s.getVoices() || [];
|
|
180
187
|
if (!voices.length) return;
|
|
181
188
|
var cur = voiceSel.value;
|
|
182
|
-
voiceSel.innerHTML = "";
|
|
189
|
+
voiceSel.innerHTML = __RTE_TT("");
|
|
183
190
|
voices.forEach(function (v, i) {
|
|
184
191
|
var o = voiceSel.ownerDocument.createElement("option");
|
|
185
192
|
o.value = v.name; o.textContent = v.name + " (" + v.lang + ")";
|
|
@@ -207,16 +214,23 @@ function RTE_Plugin_ReadAloud() {
|
|
|
207
214
|
if (bar) return;
|
|
208
215
|
var d = document;
|
|
209
216
|
bar = d.createElement("div");
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
217
|
+
// 2026-10-17 appended to the page body, outside the editor, so rte-dark could not reach it: mirrored (and
|
|
218
|
+
// rte-auto-dark under a dark system setting). tools/a11y/readaloud-bar-dark.mjs
|
|
219
|
+
var barDark = false;
|
|
220
|
+
try {
|
|
221
|
+
var bk = editor.container && editor.container.classList;
|
|
222
|
+
barDark = !!bk && (bk.contains("rte-dark") || (bk.contains("rte-auto-dark") && !bk.contains("rte-light") && !!(window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches)));
|
|
223
|
+
} catch (x) { barDark = false; }
|
|
224
|
+
bar.className = "rte-readaloud-bar" + (barDark ? " rte-readaloud-dark" : "");
|
|
225
|
+
var title = d.createElement("span"); title.className = "rte-readaloud-title"; title.textContent = pText("ra_read", "Read"); bar.appendChild(title);
|
|
226
|
+
playBtn = btn(bar, pText("ra_play", "Play"), pText("ra_playpause", "Play / Pause"));
|
|
227
|
+
var stopBtn = btn(bar, pText("ra_stop", "Stop"), pText("ra_stop", "Stop"));
|
|
228
|
+
voiceSel = d.createElement("select"); voiceSel.className = "rte-readaloud-voice"; voiceSel.title = pText("ra_voice", "Voice"); bar.appendChild(voiceSel);
|
|
229
|
+
rateSel = d.createElement("select"); rateSel.className = "rte-readaloud-rate"; rateSel.title = pText("ra_speed", "Speed");
|
|
216
230
|
["0.75", "1", "1.25", "1.5", "2"].forEach(function (r) { var o = d.createElement("option"); o.value = r; o.textContent = r + "x"; if (r === "1") o.selected = true; rateSel.appendChild(o); });
|
|
217
231
|
bar.appendChild(rateSel);
|
|
218
232
|
statusEl = d.createElement("span"); statusEl.className = "rte-readaloud-status"; bar.appendChild(statusEl);
|
|
219
|
-
var closeBtn = btn(bar, "Close", "Close"); closeBtn.className += " is-close";
|
|
233
|
+
var closeBtn = btn(bar, pText("close", "Close"), pText("close", "Close")); closeBtn.className += " is-close";
|
|
220
234
|
d.body.appendChild(bar);
|
|
221
235
|
|
|
222
236
|
loadVoices();
|
|
@@ -238,6 +252,6 @@ function RTE_Plugin_ReadAloud() {
|
|
|
238
252
|
bar = null; playBtn = statusEl = voiceSel = rateSel = null;
|
|
239
253
|
};
|
|
240
254
|
|
|
241
|
-
function updatePlayBtn() { if (playBtn) playBtn.textContent = (speaking && !paused) ? "Pause" : "Play"; }
|
|
255
|
+
function updatePlayBtn() { if (playBtn) playBtn.textContent = (speaking && !paused) ? pText("ra_pause", "Pause") : pText("ra_play", "Play"); }
|
|
242
256
|
function setStatus(t) { if (statusEl) statusEl.textContent = t; }
|
|
243
257
|
}
|
|
@@ -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,
|
|
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)}}
|