@richscripts/richtexteditor 2.12.1 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/richtexteditor/all_plugins.js +211 -6
- package/richtexteditor/all_plugins.min.js +47 -47
- package/richtexteditor/plugins/a11yenhance.min.js +1 -0
- package/richtexteditor/plugins/accessibilitychecker.js +168 -0
- package/richtexteditor/plugins/accessibilitychecker.min.js +1 -0
- package/richtexteditor/plugins/aitoolkit.min.js +14 -0
- package/richtexteditor/plugins/all_plugins.js +211 -6
- package/richtexteditor/plugins/all_plugins.min.js +47 -47
- package/richtexteditor/plugins/autocorrect.min.js +1 -0
- package/richtexteditor/plugins/autoembed.min.js +1 -0
- package/richtexteditor/plugins/blocktypes.min.js +2 -0
- package/richtexteditor/plugins/bookmarkcard.min.js +2 -0
- package/richtexteditor/plugins/changecase.min.js +1 -0
- package/richtexteditor/plugins/charlimit.min.js +2 -0
- package/richtexteditor/plugins/comments.min.js +3 -0
- package/richtexteditor/plugins/contentminimap.min.js +1 -0
- package/richtexteditor/plugins/crossreference.min.js +1 -0
- package/richtexteditor/plugins/dialoga11y.min.js +1 -0
- package/richtexteditor/plugins/dictation.min.js +1 -0
- package/richtexteditor/plugins/documentimport.min.js +4 -0
- package/richtexteditor/plugins/documentoutline.js +43 -6
- package/richtexteditor/plugins/documentoutline.min.js +1 -0
- package/richtexteditor/plugins/docxexport.min.js +2 -0
- package/richtexteditor/plugins/draghandle.min.js +1 -0
- package/richtexteditor/plugins/emailtoolkit.min.js +1 -0
- package/richtexteditor/plugins/emojiautocomplete.min.js +1 -0
- package/richtexteditor/plugins/foldheadings.min.js +1 -0
- package/richtexteditor/plugins/footnotes.min.js +1 -0
- package/richtexteditor/plugins/formatpainter.min.js +1 -0
- package/richtexteditor/plugins/formattingmarks.min.js +1 -0
- package/richtexteditor/plugins/gapcursor.min.js +1 -0
- package/richtexteditor/plugins/ghostcomplete.min.js +1 -0
- package/richtexteditor/plugins/html2pdf.min.js +1 -0
- package/richtexteditor/plugins/imageeditor.min.js +1 -0
- package/richtexteditor/plugins/importstyles.min.js +1 -0
- package/richtexteditor/plugins/inlinecode.min.js +1 -0
- package/richtexteditor/plugins/insertcode.min.js +8 -0
- package/richtexteditor/plugins/insertemoji.min.js +1 -0
- package/richtexteditor/plugins/insertgallery.min.js +1 -0
- package/richtexteditor/plugins/inserttemplate.min.js +1 -0
- package/richtexteditor/plugins/keyboarda11y.min.js +1 -0
- package/richtexteditor/plugins/layouttable.min.js +1 -0
- package/richtexteditor/plugins/linenumbers.min.js +1 -0
- package/richtexteditor/plugins/linkchecker.min.js +1 -0
- package/richtexteditor/plugins/localdraft.min.js +1 -0
- package/richtexteditor/plugins/markdownexport.min.js +2 -0
- package/richtexteditor/plugins/mathdialog.min.js +1 -0
- package/richtexteditor/plugins/mentionplugin.min.js +3 -0
- package/richtexteditor/plugins/mergefields.min.js +1 -0
- package/richtexteditor/plugins/mermaiddiagram.min.js +16 -0
- package/richtexteditor/plugins/multilevellist.min.js +1 -0
- package/richtexteditor/plugins/multiroot.min.js +1 -0
- package/richtexteditor/plugins/nodetypes.min.js +1 -0
- package/richtexteditor/plugins/pagination.min.js +1 -0
- package/richtexteditor/plugins/pdfexport.min.js +19 -0
- package/richtexteditor/plugins/permanentpen.min.js +1 -0
- package/richtexteditor/plugins/readabilitystats.min.js +1 -0
- package/richtexteditor/plugins/readaloud.min.js +1 -0
- package/richtexteditor/plugins/restrictedediting.min.js +2 -0
- package/richtexteditor/plugins/revisionhistory.min.js +3 -0
- package/richtexteditor/plugins/rtlui.min.js +2 -0
- package/richtexteditor/plugins/rubyannotation.min.js +1 -0
- package/richtexteditor/plugins/sanitizer.min.js +1 -0
- package/richtexteditor/plugins/shadowdom.min.js +1 -0
- package/richtexteditor/plugins/slashcommand.min.js +2 -0
- package/richtexteditor/plugins/smartchips.min.js +2 -0
- package/richtexteditor/plugins/spellcheck.min.js +2 -0
- package/richtexteditor/plugins/stateinspector.min.js +2 -0
- package/richtexteditor/plugins/structured-content-bridge.js +5178 -0
- package/richtexteditor/plugins/structured-content-bridge.min.js +19 -0
- package/richtexteditor/plugins/tableofcontents.min.js +1 -0
- package/richtexteditor/plugins/tabletools.min.js +1 -0
- package/richtexteditor/plugins/textdirection.min.js +1 -0
- package/richtexteditor/plugins/textpartlanguage.min.js +1 -0
- package/richtexteditor/plugins/todolist.min.js +1 -0
- package/richtexteditor/plugins/trackedchanges.min.js +3 -0
- package/richtexteditor/plugins/typewriter.min.js +1 -0
- package/richtexteditor/plugins/watermark.min.js +1 -0
- package/richtexteditor/plugins/wordexport.min.js +23 -0
- package/richtexteditor/plugins/yjscollab.min.js +2 -0
- package/richtexteditor/plugins/zz_richtextbox_dialog_style.min.js +1 -0
- package/richtexteditor/rte-config.js +2 -0
- package/richtexteditor/rte.js +4 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_mermaiddiagram=RTE_Plugin_MermaidDiagram,RTE_DefaultConfig.diagramResolver=RTE_DefaultConfig.diagramResolver||null,RTE_DefaultConfig.diagramSamples=RTE_DefaultConfig.diagramSamples||[`graph TD
|
|
2
|
+
A[Start] --> B{Decision}
|
|
3
|
+
B -->|Yes| C[Do it]
|
|
4
|
+
B -->|No| D[Skip]`,`sequenceDiagram
|
|
5
|
+
Alice->>Bob: Hello Bob
|
|
6
|
+
Bob-->>Alice: Hi Alice`,`pie title Pets
|
|
7
|
+
"Dogs" : 386
|
|
8
|
+
"Cats" : 85
|
|
9
|
+
"Birds" : 24`,`gantt
|
|
10
|
+
title Schedule
|
|
11
|
+
dateFormat YYYY-MM-DD
|
|
12
|
+
section Phase 1
|
|
13
|
+
Spec :a1, 2026-01-01, 20d
|
|
14
|
+
Build :after a1, 30d`];var RTE_MermaidSeq=0;function RTE_Plugin_MermaidDiagram(){var s=this,f,n;s.PluginName="MermaidDiagram",s.InitConfig=function(e){f=e},s.InitEditor=function(e){n=e,n.renderDiagrams=function(){return s.RenderAll()},n.attachEvent("exec_command_insertdiagram",function(r){r.returnValue=!0,s.OpenDiagramDialog()});try{var t=n.getEditable();t&&t.addEventListener("dblclick",function(r){var a=x(r.target,t);a&&(r.preventDefault(),s.OpenDiagramDialog(a))}),t&&t.addEventListener("click",function(r){for(var a=r.target;a&&a!==t;){if(a.nodeType===1&&a.getAttribute&&a.getAttribute("data-rte-mermaid-remove")==="1"){var i=x(a,t);i&&(r.preventDefault(),r.stopPropagation(),S(i));return}a=a.parentNode}},!0),t&&t.addEventListener("keydown",function(r){if(!(r.key!=="Delete"&&r.key!=="Backspace")){var a=E();a&&(r.preventDefault(),S(a))}},!0)}catch{}};function u(e,t,r,a){var i=e.ownerDocument.createElement(t);return r&&(i.style.cssText=r),a&&(i.className=a),e.appendChild(i),i}function T(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function C(e){return String(e).replace(/"/g,'"').replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function M(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function x(e,t){for(;e&&e!==t;){if(e.nodeType===1&&e.classList&&e.classList.contains("rte-mermaid"))return e;e=e.parentNode}return null}function E(){try{var e=n.getSelection();return!e||e.rangeCount===0?null:x(e.getRangeAt(0).startContainer,n.getEditable())}catch{return null}}function S(e){if(!(!e||!e.parentNode)){e.parentNode.removeChild(e);try{typeof n.fireChange=="function"&&n.fireChange()}catch{}try{n.focus()}catch{}}}function R(e){if(!(!e||e.getElementById("rte-mermaid-styles"))){var t=".rte-mermaid{position:relative;display:block;margin:12px 0;padding:12px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;text-align:center;overflow:auto;}.rte-mermaid-remove{position:absolute;top:7px;right:7px;width:24px;height:24px;border:1px solid rgba(15,23,42,.14);border-radius:999px;background:rgba(255,255,255,.96);color:#334155;font:700 13px/1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;box-shadow:0 4px 12px rgba(15,23,42,.12);opacity:0;cursor:pointer;transition:opacity 120ms,border-color 120ms,color 120ms;}.rte-mermaid:hover .rte-mermaid-remove,.rte-mermaid-remove:focus{opacity:1;}.rte-mermaid-remove:hover{border-color:rgba(220,38,38,.38);color:#b91c1c;}.rte-mermaid svg{max-width:100%;height:auto;}.rte-mermaid .rte-mermaid-src{display:block;text-align:left;white-space:pre;overflow:auto;font:12px ui-monospace,Consolas,monospace;color:#334155;background:#f8fafc;border-radius:6px;padding:10px;margin:0;}.rte-mermaid .rte-mermaid-err{color:#b91c1c;font:12px ui-monospace,monospace;text-align:left;}",r=e.createElement("style");r.id="rte-mermaid-styles",r.appendChild(e.createTextNode(t)),(e.head||e.getElementsByTagName("head")[0]||e.documentElement).appendChild(r),n&&typeof n.ensureStyleSheetLive=="function"&&n.ensureStyleSheetLive(e,r,"rte-mermaid-styles",r.textContent)}}function L(e){try{return e.mermaid||e.parent&&e.parent.mermaid||null}catch{return null}}function B(e,t,r){return new Promise(function(a,i){try{var d=e.render(t,r);d&&typeof d.then=="function"?d.then(function(l){a(l&&l.svg?l.svg:l)},i):typeof d=="string"?a(d):i(new Error("Unsupported Mermaid API"))}catch(l){i(l)}})}function v(e,t){var r=e.ownerDocument,a=r.defaultView||window;function i(o){e.innerHTML="";var c=r.createElement("pre");if(c.className="rte-mermaid-src",c.textContent=t,e.appendChild(c),o){var g=r.createElement("div");g.className="rte-mermaid-err",g.textContent=o,e.appendChild(g)}}if(typeof f.diagramResolver=="function")return Promise.resolve().then(function(){return f.diagramResolver(t)}).then(function(o){if(o&&o.svg)e.innerHTML=o.svg;else if(o&&o.imageUrl){e.innerHTML="";var c=r.createElement("img");c.src=o.imageUrl,c.alt="diagram",c.style.maxWidth="100%",e.appendChild(c)}else i("")}).catch(function(o){i(o&&o.message?o.message:"resolver error")});var d=L(a);if(d&&typeof d.render=="function"){var l="rtemmd"+ ++RTE_MermaidSeq;return B(d,l,t).then(function(o){e.innerHTML=o}).catch(function(o){i(o&&o.message?o.message:"render error")})}return i(""),Promise.resolve()}s.RenderAll=function(){var e=n.getEditable();if(!e)return 0;R(n.getDocument());for(var t=e.querySelectorAll(".rte-mermaid[data-diagram]"),r=0;r<t.length;r++){var a=t[r],i=a.querySelector(".rte-mermaid-render");i||(i=a.ownerDocument.createElement("div"),i.className="rte-mermaid-render",a.appendChild(i)),v(i,C(a.getAttribute("data-diagram")||""))}return t.length};function N(e,t){var r=T(e);return'<div class="rte-mermaid" data-rte-diagram="1" data-diagram="'+r+'" contenteditable="false"'+(t?' id="'+t+'"':"")+'><button type="button" class="rte-mermaid-remove" data-rte-mermaid-remove="1" aria-label="Remove diagram" title="Remove diagram">x</button><div class="rte-mermaid-render"><pre class="rte-mermaid-src">'+M(e)+"</pre></div></div>"}s.OpenDiagramDialog=function(e){e||(e=E());var t=e?C(e.getAttribute("data-diagram")||""):"",r=n.createDialog(n.getLangText&&n.getLangText("insertdiagramtitle")||"Insert / edit diagram","rte-dialog-diagram"),a=typeof r.close=="function"?function(){r.close()}:function(){n.closeCurrentPopup()},i=r.ownerDocument.defaultView||window,d=u(r,"div","padding:14px;min-width:480px;font:13px -apple-system,Segoe UI,sans-serif");u(d,"div","font-weight:600;margin-bottom:4px").innerText=n.getLangText&&n.getLangText("insertdiagramlabel")||"Mermaid";var l=u(d,"textarea","width:100%;box-sizing:border-box;min-height:120px;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;font:12px ui-monospace,Consolas,monospace;resize:vertical");l.value=t,l.placeholder=`graph TD
|
|
15
|
+
A --> B`;var o=u(d,"div","display:flex;flex-wrap:wrap;gap:6px;margin:8px 0");(f.diagramSamples||[]).forEach(function(p){var m=u(o,"button","font:11px ui-monospace,monospace;padding:3px 8px;border:1px solid #e2e8f0;border-radius:6px;background:#f8fafc;cursor:pointer");m.type="button",m.textContent=(p.split(`
|
|
16
|
+
`)[0]||"sample").slice(0,22),m.title=p,m.onclick=function(){l.value=p,h(),l.focus()}}),u(d,"div","font-weight:600;margin:10px 0 4px").innerText=n.getLangText&&n.getLangText("insertdiagrampreview")||"Preview";var c=u(d,"div","min-height:80px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;overflow:auto;text-align:center"),g=u(d,"div","font-size:11px;color:#94a3b8;margin-top:4px");typeof f.diagramResolver!="function"&&!L(i)&&(g.innerText="No Mermaid renderer detected on the page \u2014 the diagram is stored as source and will render wherever Mermaid (or config.diagramResolver) is available.");var b=null;function h(){var p=l.value.trim();if(!p){c.textContent="";return}b&&clearTimeout(b),b=setTimeout(function(){var m=c.ownerDocument.createElement("div");m.className="rte-mermaid-render",c.innerHTML="",c.appendChild(m),v(m,p)},250)}l.oninput=h,setTimeout(function(){l.focus(),h()},0);var k=u(d,"div","display:flex;justify-content:flex-end;gap:8px;margin-top:14px"),y=u(k,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");y.type="button",y.textContent="Cancel",y.onclick=a;var w=u(k,"button","padding:6px 14px;border:1px solid #1d67ba;border-radius:8px;background:#1d67ba;color:#fff;cursor:pointer");w.type="button",w.textContent=e?"Update":"Insert",w.onclick=function(){var p=l.value.trim();if(!p){a();return}if(R(n.getDocument()),e){e.setAttribute("data-diagram",T(p));var m=e.querySelector(".rte-mermaid-render");m||(m=e.ownerDocument.createElement("div"),m.className="rte-mermaid-render",e.appendChild(m)),v(m,p),a(),n.focus();return}var A="rtemmd-pending-"+ ++RTE_MermaidSeq;n.insertHTML(N(p,A)),a();try{var _=n.getDocument(),D=_.getElementById(A);if(D){D.removeAttribute("id");var m=D.querySelector(".rte-mermaid-render");v(m,p)}}catch{}n.focus()}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_multilevellist=RTE_Plugin_MultiLevelList,typeof RTE_DefaultConfig.legalListClass>"u"&&(RTE_DefaultConfig.legalListClass="rte-legal-list"),typeof RTE_DefaultConfig.legalListSeparator>"u"&&(RTE_DefaultConfig.legalListSeparator="."),typeof RTE_DefaultConfig.legalListSuffix>"u"&&(RTE_DefaultConfig.legalListSuffix=".");function RTE_Plugin_MultiLevelList(){var s=this,a,l,u=null;s.PluginName="MultiLevelList",s.InitConfig=function(e){a=e},s.InitEditor=function(e){l=e,r();try{l.attachEvent("ready",r)}catch{}try{l.attachEvent("aftersethtml",r)}catch{}setTimeout(r,0),l.setLegalNumbering=function(i){return g(!!i)},l.toggleLegalNumbering=function(){return g(!f(o()))},l.isLegalNumbering=function(){return f(o())},l.getLegalListCss=function(){return c()}};function r(){var e=p();e&&e!==u?(d(e),u=e):e&&d(e)}function p(){try{return l.getDocument()}catch{return null}}function L(){try{return l.getEditable()}catch{return null}}function o(){try{var e=l.getSelection();if(!e||e.rangeCount===0)return null;var i=L(),t=e.getRangeAt(0).startContainer;t&&t.nodeType===3&&(t=t.parentNode);for(var n=null;t&&t!==i;)t.nodeName==="OL"&&(n=t),t=t.parentNode;return n}catch{return null}}function f(e){return!!(e&&e.classList&&e.classList.contains(a.legalListClass))}function g(e){var i=o();if(!i)return!1;e?i.classList.add(a.legalListClass):i.classList.remove(a.legalListClass);try{typeof l.updateDesign=="function"&&l.updateDesign()}catch{}try{l.fireEvent&&l.fireEvent("change")}catch{}return e}function c(){var e=a.legalListClass,i=String(a.legalListSeparator||".").replace(/"/g,'\\"'),t=String(a.legalListSuffix==null?".":a.legalListSuffix).replace(/"/g,'\\"');return"ol."+e+",ol."+e+" ol{counter-reset:rte-legal;list-style:none;}ol."+e+">li,ol."+e+" ol>li{counter-increment:rte-legal;position:relative;}ol."+e+">li::marker,ol."+e+' ol>li::marker{content:"";}ol.'+e+">li::before,ol."+e+' ol>li::before{content:counters(rte-legal,"'+i+'")"'+t+'";position:absolute;left:-3.2em;width:3em;text-align:right;font-variant-numeric:tabular-nums;}ol.'+e+"{padding-left:3.6em;}ol."+e+" ol{padding-left:3.2em;margin-top:.25em;}"}function d(e){if(e){var i=e.getElementById("rte-legal-list-styles"),t=c();if(i){if(i.getAttribute("data-css")===t)return;i.parentNode&&i.parentNode.removeChild(i)}var n=e.createElement("style");n.id="rte-legal-list-styles",n.setAttribute("data-css",t),n.appendChild(e.createTextNode(t)),(e.head||e.getElementsByTagName("head")[0]||e.documentElement).appendChild(n),l&&typeof l.ensureStyleSheetLive=="function"&&l.ensureStyleSheetLive(e,n,"rte-legal-list-styles",n.textContent)}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_multiroot=RTE_Plugin_MultiRoot,typeof RTE_DefaultConfig.multiRootGroup>"u"&&(RTE_DefaultConfig.multiRootGroup=null),typeof RTE_DefaultConfig.multiRootName>"u"&&(RTE_DefaultConfig.multiRootName=null),typeof RTE_DefaultConfig.multiRootToolbarHost>"u"&&(RTE_DefaultConfig.multiRootToolbarHost=null),window.__RTE_MultiRootGroups||(window.__RTE_MultiRootGroups={});function RTE_Plugin_MultiRoot(){var f=this,l,i,u=null;f.PluginName="MultiRoot",f.InitConfig=function(o){l=o},f.InitEditor=function(o){i=o;var t=l.multiRootGroup;if(t){u={name:l.multiRootName||R()||"root"+(a(t).roots.length+1),editor:i,container:c(),group:t},a(t).roots.push(u),i.multiRoot=h(t),setTimeout(function(){v(),s(t)},0);try{i.attachEvent("ready",function(){v(),s(t)})}catch{}}};function a(o){window.__RTE_MultiRootGroups[o]||(window.__RTE_MultiRootGroups[o]={roots:[],active:null,listeners:[]});var t=window.__RTE_MultiRootGroups[o];return t.listeners||(t.listeners=[]),t}function c(){try{if(i.container)return i.container;if(i.iframe){for(var o=i.iframe.parentNode;o&&!(o.classList&&o.classList.contains("richtexteditor"));)o=o.parentNode;return o||null}}catch{}return null}function R(){var o=c();return o&&o.id?o.id:null}function d(o){var t=o.container;return t?[].slice.call(t.querySelectorAll("rte-toolbar")):[]}function _(o,t){for(var e=d(o),r=0;r<e.length;r++){var n=e[r];t?n.__rteMultiRootPrevDisplay!==void 0&&(n.style.display=n.__rteMultiRootPrevDisplay,delete n.__rteMultiRootPrevDisplay):(n.__rteMultiRootPrevDisplay===void 0&&(n.__rteMultiRootPrevDisplay=n.style.display),n.style.display="none")}}function s(o){var t=a(o);if(t.roots.length){t.active||(t.active=t.roots[0]);for(var e=0;e<t.roots.length;e++)_(t.roots[e],t.roots[e]===t.active);p(t.active)}}function p(o){var t=l.multiRootToolbarHost;if(!(!t||!o)){var e=typeof t=="string"?document.getElementById(t):t;if(e)for(var r=d(o),n=0;n<r.length;n++)r[n].parentNode!==e&&e.appendChild(r[n])}}function v(){var o;try{o=i.getDocument()}catch{return}if(!(!o||o.__rteMultiRootBound)){o.__rteMultiRootBound=!0;var t=function(){if(u){var e=a(u.group);e.active!==u&&(e.active=u,s(u.group),g(u.group,u))}};o.addEventListener("focusin",t,!0),o.addEventListener("mousedown",t,!0)}}function g(o,t){for(var e=a(o).listeners,r=0;r<e.length;r++)try{e[r]({active:t.name,editor:t.editor})}catch{}}function h(o){var t=a(o);return{group:o,getRoots:function(){return t.roots.map(function(e){return e.name})},getActive:function(){return t.active?t.active.name:null},getEditor:function(e){for(var r=0;r<t.roots.length;r++)if(t.roots[r].name===e)return t.roots[r].editor;return null},focusRoot:function(e){for(var r=null,n=0;n<t.roots.length;n++)t.roots[n].name===e&&(r=t.roots[n]);if(!r)return!1;t.active=r,s(o);try{r.editor.focus()}catch{}return g(o,r),!0},getHTML:function(){for(var e={},r=0;r<t.roots.length;r++)try{e[t.roots[r].name]=t.roots[r].editor.getHTMLCode()}catch{e[t.roots[r].name]=null}return e},setHTML:function(e){if(!e)return!1;for(var r=0;r<t.roots.length;r++){var n=t.roots[r];if(n.name in e)try{n.editor.setHTMLCode(e[n.name])}catch{}}return!0},onActiveChange:function(e){return typeof e!="function"?function(){}:(t.listeners.push(e),function(){var r=t.listeners.indexOf(e);r>=0&&t.listeners.splice(r,1)})},getCapabilities:function(){return{sharedToolbar:!0,sharedGroupApi:!0,perRootUndo:!0,sharedUndoStack:!1,selectionAcrossRoots:!1,sharedCollaborationSession:!1,note:"Each root is a separate editor instance sharing one visible toolbar. Undo, selection and collaboration are per-root; the editor edits an iframe body, so a single instance cannot own several editables without core changes."}}}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_nodetypes=RTE_Plugin_NodeTypes;function RTE_Plugin_NodeTypes(){var E=this,c,a,v=[],g={},D=0,N=null;E.PluginName="NodeTypes",E.InitConfig=function(t){if(c=t,c.nodeTypesEnabled!==!1&&Array.isArray(c.nodeTypes))for(var r=0;r<c.nodeTypes.length;r++)R(c.nodeTypes[r])},E.InitEditor=function(t){a=t,c.nodeTypesEnabled!==!1&&(a.nodeTypes={find:function(r){return H(r)},get:function(r){return g[r]||null},insert:function(r,n){return B(r,n)},list:function(){return v.map(L)},register:function(r){return R(r)},serialize:function(){return _()},typeOf:function(r){var n=C(r);return n?n.name:null},unregister:function(r){return J(r)}},a.attachEvent("change",function(){x()}),I(),K(),setTimeout(F,0),O())};function R(t){if(!t||!t.name||typeof t.match!="string"&&typeof t.match!="function")return!1;g[t.name]&&J(t.name);var r={name:t.name,match:t.match,atomic:t.atomic!==!1,inline:!!t.inline,toJSON:typeof t.toJSON=="function"?t.toJSON:null,fromJSON:typeof t.fromJSON=="function"?t.fromJSON:null,toMarkdown:typeof t.toMarkdown=="function"?t.toMarkdown:null,toExportHTML:typeof t.toExportHTML=="function"?t.toExportHTML:null,toDocx:typeof t.toDocx=="function"?t.toDocx:null,toPdf:typeof t.toPdf=="function"?t.toPdf:null,toWord:typeof t.toWord=="function"?t.toWord:null,allowTags:t.allowTags||[],allowAttributes:t.allowAttributes||[]};return v.push(r),g[r.name]=r,W(r),a&&O(),!0}function J(t){return g[t]?(v=v.filter(function(r){return r.name!==t}),delete g[t],!0):!1}function L(t){return{name:t.name,atomic:t.atomic,inline:t.inline,hasToJSON:!!t.toJSON,hasFromJSON:!!t.fromJSON,hasToMarkdown:!!t.toMarkdown,hasExportHTML:!!(t.toExportHTML||t.toDocx||t.toPdf),instances:H(t.name).length}}function W(t){c&&(P("sanitizerAllowTags",t.allowTags),P("sanitizerAllowAttributes",t.allowAttributes))}function P(t,r){if(!(!r||!r.length)){var n=c[t];Array.isArray(n)||(n=n?[n]:[]);for(var e=0;e<r.length;e++)n.indexOf(r[e])===-1&&n.push(r[e]);c[t]=n}}function k(t,r){if(!r||r.nodeType!==1)return!1;if(typeof t.match=="string")try{return r.matches(t.match)}catch{return!1}try{return!!t.match(r)}catch{return!1}}function C(t){for(var r=0;r<v.length;r++)if(k(v[r],t))return v[r];return null}function b(){return a&&a.getEditable?a.getEditable():null}function H(t){var r=b(),n=g[t],e=[];if(!r||!n)return e;for(var o=r.querySelectorAll("*"),l=0;l<o.length;l++)k(n,o[l])&&e.push(o[l]);return e}function w(){var t=b(),r=[];if(!t)return r;for(var n=t.querySelectorAll("*"),e=0;e<n.length;e++){var o=C(n[e]);o&&r.push({type:o,el:n[e]})}return r}function B(t,r){var n=g[t];if(!n||!n.fromJSON||!a)return null;var e=n.fromJSON(r||{}),o=typeof e=="string"?e:e&&e.outerHTML;return o?(a.insertHTML(o),x(),o):null}function _(){for(var t=[],r=w(),n=0;n<r.length;n++){var e=r[n].type,o=r[n].el;t.push({name:e.name,data:e.toJSON?M(e.toJSON,o,{}):z(o)})}return t}function z(t){for(var r={},n=t.attributes,e=0;n&&e<n.length;e++)n[e].name.indexOf("data-")===0&&(r[n[e].name]=n[e].value);return r}function M(t,r,n){try{return t(r)}catch{return n}}function I(){var t=b();if(!(!t||typeof MutationObserver>"u")){var r=new MutationObserver(function(){x()});r.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["contenteditable"]})}}function x(){clearTimeout(D),D=setTimeout(O,60)}function O(){for(var t=w(),r=0;r<t.length;r++)t[r].type.atomic&&t[r].el.getAttribute("contenteditable")!=="false"&&t[r].el.setAttribute("contenteditable","false")}function F(){p("getDocxBlob","toDocx"),p("exportToDocx","toDocx"),p("getPdfBytes","toPdf"),p("exportToPdf","toPdf"),p("downloadPdf","toPdf"),p("getWordDocument","toWord"),p("exportToWord","toWord"),p("downloadWord","toWord")}function p(t,r){if(!(!a||typeof a[t]!="function")){var n=a[t];a[t]=function(){var e=arguments,o=w().filter(function(i){return i.type[r]||i.type.toExportHTML});if(!o.length)return n.apply(a,e);var l=q(o,r),u;try{u=n.apply(a,e)}catch(i){throw l(),i}return u&&typeof u.then=="function"?u.then(function(i){return l(),i},function(i){throw l(),i}):(l(),u)}}}function q(t,r){var n=a.getDocument(),e=[],o=null;try{var l=n.getSelection();l&&l.rangeCount&&(o=l.getRangeAt(0).cloneRange())}catch{o=null}for(var u=0;u<t.length;u++){var i=t[u].el,y=t[u].type[r]||t[u].type.toExportHTML,m=y?M(y,i,null):null;if(m!=null){var h=n.createElement(t[u].type.inline?"span":"div");h.innerHTML=String(m),i.parentNode.insertBefore(h,i),i.parentNode.removeChild(i),e.push({holder:h,original:i})}}var T=!1;return function(){if(!T){T=!0;for(var s=e.length-1;s>=0;s--){var f=e[s];f.holder.parentNode&&(f.holder.parentNode.insertBefore(f.original,f.holder),f.holder.parentNode.removeChild(f.holder))}if(o)try{var d=n.getSelection();d.removeAllRanges(),d.addRange(o)}catch{}}}}function K(){!a||typeof a.toMarkdown!="function"||(N=a.toMarkdown,a.toMarkdown=function(){var t=w().filter(function(A){return A.type.toMarkdown});if(!t.length)return N.call(a);var r=a.getDocument(),n=[],e=[],o=null;try{var l=r.getSelection();l&&l.rangeCount&&(o=l.getRangeAt(0).cloneRange())}catch{o=null}try{for(var u=0;u<t.length;u++){var i=t[u].el,y=M(t[u].type.toMarkdown,i,null);if(y!=null){var m="RTENODETYPETOKEN"+u+"ENDRTENODETYPETOKEN",h=r.createElement(t[u].type.inline?"span":"p");h.textContent=m,i.parentNode.insertBefore(h,i),i.parentNode.removeChild(i),n.push({holder:h,original:i}),e.push({token:m,markdown:String(y)})}}for(var T=N.call(a),s=0;s<e.length;s++)T=T.split(e[s].token).join(e[s].markdown);return T}finally{for(var f=n.length-1;f>=0;f--){var d=n[f];d.holder.parentNode&&(d.holder.parentNode.insertBefore(d.original,d.holder),d.holder.parentNode.removeChild(d.holder))}if(o)try{var S=r.getSelection();S.removeAllRanges(),S.addRange(o)}catch{}}})}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_pagination=RTE_Plugin_Pagination,typeof RTE_DefaultConfig.paginationEnabled>"u"&&(RTE_DefaultConfig.paginationEnabled=!1),typeof RTE_DefaultConfig.pageFormat>"u"&&(RTE_DefaultConfig.pageFormat="A4"),typeof RTE_DefaultConfig.pageOrientation>"u"&&(RTE_DefaultConfig.pageOrientation="portrait"),typeof RTE_DefaultConfig.pageMargins>"u"&&(RTE_DefaultConfig.pageMargins={top:1,right:1,bottom:1,left:1}),typeof RTE_DefaultConfig.paginationShowPageNumbers>"u"&&(RTE_DefaultConfig.paginationShowPageNumbers=!0),typeof RTE_DefaultConfig.paginationShowPageCount>"u"&&(RTE_DefaultConfig.paginationShowPageCount=!0);function RTE_Plugin_Pagination(){var M=this,l,o,s=!1,u=null,A=null,F=!1,R=0,N=1,T="";M.PluginName="Pagination";var m=96,c=25.4,B={a4:{w:210/c,h:297/c},letter:{w:8.5,h:11},legal:{w:8.5,h:14},a3:{w:297/c,h:420/c},a5:{w:148/c,h:210/c},tabloid:{w:11,h:17}};M.InitConfig=function(e){l=e,s=!!l.paginationEnabled},M.InitEditor=function(e){o=e,D();try{o.attachEvent("ready",D)}catch{}try{o.attachEvent("aftersethtml",v)}catch{}o.setPageView=function(t){return s=!!t,E(),s},o.togglePageView=function(){return s=!s,E(),s},o.isPageView=function(){return s},o.getPageCount=function(){return s&&I(),N},o.setPageSetup=function(t){return t&&typeof t=="object"&&(t.format&&(l.pageFormat=t.format),t.orientation&&(l.pageOrientation=t.orientation),t.margins&&(l.pageMargins=t.margins),typeof t.headerHtml=="string"&&(l.pageHeaderHtml=t.headerHtml),typeof t.footerHtml=="string"&&(l.pageFooterHtml=t.footerHtml)),T="",E(),x()},o.getPageGeometry=function(){return x()},o.getPageOfElement=function(t){return U(t)},setTimeout(D,0),setTimeout(v,250)};function D(){var e=L();if(e&&(K(e),e!==A)){e.addEventListener("input",v,!0),e.addEventListener("keyup",v,!0),A=e;var t=e.defaultView||e.parentWindow;if(t)try{t.addEventListener("resize",v,!0)}catch{}}X(),E()}function L(){try{return o.getDocument()}catch{return null}}function b(){try{return o.getEditable()}catch{return null}}function z(){var e=null;try{typeof o.getDocumentPageSetup=="function"&&(e=o.getDocumentPageSetup())}catch{e=null}return(!e||typeof e!="object")&&(e={}),{format:e.format||l.pageFormat||"A4",orientation:e.orientation||l.pageOrientation||"portrait",margins:e.margins||l.pageMargins||{top:1,right:1,bottom:1,left:1},headerHtml:typeof e.headerHtml=="string"?e.headerHtml:l.pageHeaderHtml||"",footerHtml:typeof e.footerHtml=="string"?e.footerHtml:l.pageFooterHtml||""}}function H(e,t){if(typeof e=="number"&&isFinite(e))return e*m;if(typeof e=="string"){var r=/^\s*(-?[\d.]+)\s*(mm|cm|in|px|pt)?\s*$/.exec(e);if(r){var n=parseFloat(r[1]);switch(r[2]){case"mm":return n/c*m;case"cm":return n*10/c*m;case"pt":return n/72*m;case"px":return n;default:return n*m}}}return(t||0)*m}function x(){var e=z(),t=B[String(e.format).toLowerCase()]||B.a4,r=t.w,n=t.h;if(String(e.orientation).toLowerCase()==="landscape"){var a=r;r=n,n=a}var f=e.margins||{},i={pageWidth:Math.round(r*m),pageHeight:Math.round(n*m),marginTop:Math.round(H(f.top,1)),marginRight:Math.round(H(f.right,1)),marginBottom:Math.round(H(f.bottom,1)),marginLeft:Math.round(H(f.left,1)),format:e.format,orientation:e.orientation,headerHtml:e.headerHtml,footerHtml:e.footerHtml};return i.contentHeight=Math.max(120,i.pageHeight-i.marginTop-i.marginBottom),i.contentWidth=Math.max(120,i.pageWidth-i.marginLeft-i.marginRight),i}function E(){var e=b();if(e){if(!s){V(e);return}var t=x();e.classList.add("rte-page-view"),e.style.width=t.contentWidth+"px",e.style.paddingLeft=t.marginLeft+"px",e.style.paddingRight=t.marginRight+"px",e.style.paddingTop=t.marginTop+"px",e.style.paddingBottom=t.marginBottom+"px",e.style.margin="24px auto",e.style.boxSizing="content-box",e.style.background="#fff",e.style.minHeight=t.contentHeight+"px",v()}}function V(e){if(e=e||b(),e){e.classList.remove("rte-page-view");for(var t=["width","paddingLeft","paddingRight","paddingTop","paddingBottom","margin","boxSizing","background","minHeight"],r=0;r<t.length;r++)e.style[t[r]]=""}J(),N=1,T=""}function v(){if(s&&!R){var e=L(),t=e&&(e.defaultView||e.parentWindow)||window,r=t&&typeof t.requestAnimationFrame=="function"?function(n){return t.requestAnimationFrame(n)}:function(n){return setTimeout(n,16)};R=r(function(){R=0,I()})}}function j(e){for(var t=e.children,r=0;r<t.length;r++){var n=t[r];if(n&&n.nodeType===1&&!(n.getAttribute&&n.getAttribute("data-rte-page-overlay")==="true"))return n.offsetTop}return e.offsetTop}function U(e){if(!s||!e)return null;var t=b();if(!t)return null;for(var r=e;r&&r.parentNode&&r.parentNode!==t;)r=r.parentNode;if(!r||r.parentNode!==t)return null;for(var n=O(t,x()),a=r.offsetTop,f=1,i=0;i<n.length;i++)n[i]<=a&&f++;return f}function O(e,t){var r=[],n=e.children;if(!n||!n.length)return r;for(var a=[],f=0;f<n.length;f++){var i=n[f];!i||i.nodeType!==1||i.getAttribute&&i.getAttribute("data-rte-page-overlay")==="true"||a.push(i)}if(!a.length)return r;var g=a[0].offsetTop,d,h,p,y;for(d=0;d<a.length;d++){h=a[d],p=h.offsetTop,y=d+1<a.length?a[d+1].offsetTop:p+h.offsetHeight;var w=h.hasAttribute&&(h.hasAttribute("data-rte-page-break")||h.querySelector&&!!h.querySelector("[data-rte-page-break]"));if(w&&p>g){r.push(p),g=p;continue}if(y-g>t.contentHeight)for(p>g&&(r.push(p),g=p);y-g>t.contentHeight;)g+=t.contentHeight,r.push(g)}return r}function I(){if(s){var e=b(),t=L();if(!(!e||!t)){var r=x(),n=O(e,r);N=n.length+1;var a=r.pageWidth+"x"+r.pageHeight+"|"+r.contentHeight+"|"+n.join(",")+"|"+e.offsetHeight;a!==T&&(T=a,$(t,e,r,n))}}}function G(e,t){return u&&u.parentNode||(u=e.createElement("div"),u.setAttribute("data-rte-page-overlay","true"),u.setAttribute("contenteditable","false"),u.setAttribute("aria-hidden","true"),u.className="rte-page-overlay",(t.parentNode||e.body||e.documentElement).appendChild(u)),u}function J(){u&&u.parentNode&&u.parentNode.removeChild(u),u=null}function W(e,t,r){return String(e).replace(/\{\s*page\s*\}/gi,String(t)).replace(/\{\s*total\s*\}/gi,String(r))}function $(e,t,r,n){for(var a=G(e,t);a.firstChild;)a.removeChild(a.firstChild);var f=t.offsetTop,i=j(t),g=[i].concat(n),d=g.length,h=g[d-1]+r.contentHeight+r.marginBottom;a.style.position="absolute",a.style.left=t.offsetLeft+"px",a.style.top=f+"px",a.style.width=t.offsetWidth+"px",a.style.height=Math.max(t.offsetHeight,h-f)+"px",a.style.pointerEvents="none",a.style.zIndex="1";var p,y;for(p=0;p<n.length;p++){y=n[p]-f-Math.round(r.marginTop/2);var w=e.createElement("div");w.className="rte-page-sep",w.style.top=y+"px",a.appendChild(w)}for(p=0;p<g.length;p++){var C=p+1,k=g[p]-f,q=k+r.contentHeight;if(l.paginationShowPageNumbers){var S=e.createElement("div");S.className="rte-page-num",S.style.top=q+6+"px",S.appendChild(e.createTextNode(l.paginationShowPageCount?"Page "+C+" of "+d:"Page "+C)),a.appendChild(S)}if(r.headerHtml){var P=e.createElement("div");P.className="rte-page-hf rte-page-header",P.style.top=k-Math.round(r.marginTop/2)+"px",P.innerHTML=W(r.headerHtml,C,d),a.appendChild(P)}if(r.footerHtml){var _=e.createElement("div");_.className="rte-page-hf rte-page-footer",_.style.top=q+Math.round(r.marginBottom/3)+"px",_.innerHTML=W(r.footerHtml,C,d),a.appendChild(_)}}}function K(e){if(!(!e||e.getElementById("rte-pagination-styles"))){var t=".rte-page-view{box-shadow:0 1px 4px rgba(15,23,42,.16),0 8px 28px rgba(15,23,42,.10);}body.rte-page-desk{background:#f1f5f9;}.rte-page-overlay{position:absolute;pointer-events:none;}.rte-page-sep{position:absolute;left:-24px;right:-24px;height:0;border-top:1px dashed #94a3b8;}.rte-page-num{position:absolute;right:8px;font:600 10px/1.4 'Segoe UI',system-ui,sans-serif;letter-spacing:.04em;color:#94a3b8;text-transform:uppercase;}.rte-page-hf{position:absolute;left:0;right:0;font:400 11px/1.4 'Segoe UI',system-ui,sans-serif;color:#64748b;}.rte-page-header{text-align:left;}.rte-page-footer{text-align:center;}@media print{.rte-page-overlay{display:none !important;}.rte-page-view{box-shadow:none !important;margin:0 !important;width:auto !important;}}",r=e.createElement("style");r.id="rte-pagination-styles",r.appendChild(e.createTextNode(t)),(e.head||e.getElementsByTagName("head")[0]||e.documentElement).appendChild(r),o&&typeof o.ensureStyleSheetLive=="function"&&o.ensureStyleSheetLive(e,r,"rte-pagination-styles",r.textContent)}}function Q(){var e=b();if(!e)return function(){};for(var t=e.querySelectorAll?e.querySelectorAll("[data-rte-page-overlay]"):[],r=[],n=0;n<t.length;n++){var a=t[n];r.push({node:a,parent:a.parentNode,next:a.nextSibling}),a.parentNode&&a.parentNode.removeChild(a)}return function(){for(var i=0;i<r.length;i++){var g=r[i];g.parent&&g.parent.insertBefore(g.node,g.next||null)}}}function X(){if(!F){for(var e=["getHTMLCode","getJSON","getHTMLContent","getText"],t=!1,r=0;r<e.length;r++)(function(n){var a=o[n];if(!(typeof a!="function"||a.__rtePgWrapped)){var f=function(){var i=Q();try{return a.apply(o,arguments)}finally{i()}};f.__rtePgWrapped=!0,o[n]=f,t=!0}})(e[r]);t&&(F=!0)}}}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
`),i(new Uint8Array([37,226,227,207,211,10]));for(var f=[],s=0;s<this.objects.length;s++){f[s]=n,i(s+1+` 0 obj
|
|
3
|
+
`);var a=this.objects[s];if(a&&a.stream){var o=typeof a.stream=="string"?he(a.stream):a.stream;i(a.dict.replace("/Length 0","/Length "+o.length)+`
|
|
4
|
+
stream
|
|
5
|
+
`),i(o),i(`
|
|
6
|
+
endstream
|
|
7
|
+
`)}else i(a+`
|
|
8
|
+
`);i(`endobj
|
|
9
|
+
`)}for(var u=n,l=`xref
|
|
10
|
+
0 `+(this.objects.length+1)+`
|
|
11
|
+
0000000000 65535 f
|
|
12
|
+
`,c=0;c<f.length;c++)l+=Se(f[c])+` 00000 n
|
|
13
|
+
`;i(l),i(`trailer
|
|
14
|
+
<< /Size `+(this.objects.length+1)+" /Root "+e+" 0 R /Info "+t+` 0 R >>
|
|
15
|
+
`),i(`startxref
|
|
16
|
+
`+u+`
|
|
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
|
+
`),links:l,marks:o.marks}}function Ne(e){var t=null;try{typeof N.getDocumentPageSetup=="function"&&(t=N.getDocumentPageSetup())}catch{}return t=t||{},{header:e.headerText||M.pdfExportHeader||pe(t.headerHtml)||"",footer:e.footerText||M.pdfExportFooter||pe(t.footerHtml)||""}}function pe(e){if(!e||typeof e!="string")return"";var t=document.createElement("div");return t.innerHTML=e,(t.textContent||"").replace(/\s+/g," ").trim()}function ge(e,t,r,n,i,f,s,a){var o=String(t).replace(/\{page\}/g,s).replace(/\{total\}/g,a),u=W(o),l=ue(u,i,0,f),c=(r.width-l)/2;e.push("BT /F0 "+g(f)+" Tf 0.4 0.4 0.4 rg "+g(c)+" "+g(n)+" Td ("+H(u)+") Tj ET")}function xe(e,t,r,n,i,f,s,a){var o=e.line,u=e.block,l=n+(u.indent||0),c=t.width-t.margin.right-l;if(u.align==="center"?l+=(c-o.width)/2:u.align==="right"&&(l+=c-o.width),u.rule==="quote"&&!o.image){var h=g(n+u.indent-8),v=function(){r.push("0.8 0.8 0.85 RG 2 w "+h+" "+g(e.y-o.height+4)+" m "+h+" "+g(e.y+o.size*.8)+" l S")};a?a.artifact(r,v):v()}if(e.first&&u.marker){var p=u.markerStyle||{size:o.size,color:[0,0,0]},m=ue(u.marker,i,0,p.size);a&&a.open(r,"Lbl",{kind:"lbl",block:u}),r.push("BT /F0 "+g(p.size)+" Tf "+me(p.color)+" "+g(l-m-6)+" "+g(e.y-o.size*.85)+" Td ("+H(W(u.marker))+") Tj ET"),a&&a.close(r)}a&&a.open(r,o.image?"Figure":"Span",e.cell||{kind:"body",block:u});for(var d=[],x=l,w=0;w<o.parts.length;w++){var y=o.parts[w];if(y.img){d.push({img:y,x,w:y.w}),x+=y.w;continue}var k=y.style,C=(k.mono?"M":"F")+y.styleIndex,z=d.length?d[d.length-1]:null,I=z&&!z.img&&z.alias===C&&z.style.size===k.size&&Be(z.style.color,k.color)&&z.style.underline===k.underline&&z.style.strike===k.strike&&z.style.link===k.link;I?(z.text+=y.text,z.w+=y.w):d.push({text:y.text,style:k,alias:C,x,w:y.w}),x+=y.w}for(var S=e.y-o.size*.85,L=0;L<d.length;L++){var b=d[L];if(b.img){var R=f(b.img.img);R&&r.push("q "+g(b.w)+" 0 0 "+g(b.img.h)+" "+g(b.x)+" "+g(e.y-b.img.h)+" cm /"+R.alias+" Do Q");continue}if(!(!b.text||/^\s+$/.test(b.text))){var E=b.style;r.push("BT /"+b.alias+" "+g(E.size)+" Tf "+me(E.color)+" "+g(b.x)+" "+g(S)+" Td ("+H(W(b.text))+") Tj ET"),E.underline&&r.push(ye(E.color)+" 0.5 w "+g(b.x)+" "+g(S-E.size*.12)+" m "+g(b.x+b.w)+" "+g(S-E.size*.12)+" l S"),E.strike&&r.push(ye(E.color)+" 0.5 w "+g(b.x)+" "+g(S+E.size*.28)+" m "+g(b.x+b.w)+" "+g(S+E.size*.28)+" l S"),E.link&&s.push({href:E.link,x0:b.x,y0:S-2,x1:b.x+b.w,y1:S+E.size})}}a&&a.close(r)}function Be(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 Pe(e,t,r,n,i,f,s){for(var a=e.block,o=e.row,u=n+a.indent,l=e.y,c=e.y-o.height,h=0;h<o.cells.length;h++){var v=u+h*a.colWidth,p=function(){o.header&&r.push("0.94 0.95 0.97 rg "+g(v)+" "+g(c)+" "+g(a.colWidth)+" "+g(o.height)+" re f"),r.push("0.75 0.78 0.82 RG 0.5 w "+g(v)+" "+g(c)+" "+g(a.colWidth)+" "+g(o.height)+" re S")};s?s.artifact(r,p):p();for(var m={kind:"cell",block:a,row:o,col:h,header:!!o.cells[h].header},d=l-a.pad,x=o.cells[h].lines,w=0;w<x.length;w++)xe({line:x[w],y:d,block:{indent:0,align:"left"},first:w===0,cell:m},{width:v+a.colWidth+t.margin.right,margin:{right:t.margin.right}},r,v+a.pad,"helvetica",i,f,s),d-=x[w].height}}function me(e){return e=e||[0,0,0],g(e[0])+" "+g(e[1])+" "+g(e[2])+" rg"}function ye(e){return e=e||[0,0,0],g(e[0])+" "+g(e[1])+" "+g(e[2])+" RG"}function Fe(e){try{var t=e.naturalWidth||e.width,r=e.naturalHeight||e.height;if(!t||!r)return null;var n=2e3,i=Math.min(1,n/Math.max(t,r)),f=Math.max(1,Math.round(t*i)),s=Math.max(1,Math.round(r*i)),a=document.createElement("canvas");a.width=f,a.height=s;var o=a.getContext("2d");o.fillStyle="#ffffff",o.fillRect(0,0,f,s),o.drawImage(e,0,0,f,s);var u=a.toDataURL("image/jpeg",.92),l=u.indexOf(",");if(l<0)return null;for(var c=atob(u.slice(l+1)),h=new Uint8Array(c.length),v=0;v<c.length;v++)h[v]=c.charCodeAt(v);return{bytes:h,width:f,height:s}}catch{return null}}function we(e){return!e||typeof e!="string"?"":e.replace(/\.pdf$/i,"").replace(/[\\/:*?"<>|]+/g,"").trim().slice(0,120)}function Me(){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 We(e,t){var r=new Blob([e],{type:"application/pdf"}),n=URL.createObjectURL(r),i=document.createElement("a");return i.href=n,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(function(){URL.revokeObjectURL(n)},4e3),t}}
|
|
@@ -0,0 +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(//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(//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}}
|
|
@@ -0,0 +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 u=this,h,r;u.PluginName="ReadabilityStats",u.InitConfig=function(e){h=e},u.InitEditor=function(e){r=e,h.readabilityStats!==!1&&(r.countSyllables=function(t){return v(t)},r.getReadabilityStats=function(t){return b(t!=null?String(t):p())},r.attachEvent("exec_command_readability",function(t){t.returnValue=!0,t.stopBubble=!0,S()}))};function p(){try{var e=r.getEditable&&r.getEditable();if(e)return e.innerText||e.textContent||""}catch{}return""}function v(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,o=e.match(/[^.!?]+[.!?]+/g),n=o?o.length:a?1:0;a&&n===0&&(n=1);for(var i=0,l=0;l<t.length;l++)i+=v(t[l]);var c=e.replace(/\s/g,"").length,s=n?a/n:0,d=a?i/a:0,g=a?206.835-1.015*s-84.6*d:0,y=a?.39*s+11.8*d-15.59:0;g=Math.round(g*10)/10,y=Math.round(y*10)/10;var T=parseInt(h.readabilityWordsPerMinute,10)||200,f=a/T,x=f<1?Math.max(1,Math.round(f*60))+" sec":Math.round(f)+" min";return{words:a,sentences:n,syllables:i,characters:c,avgWordsPerSentence:Math.round(s*10)/10,avgSyllablesPerWord:Math.round(d*100)/100,fleschReadingEase:g,fleschKincaidGrade:Math.max(0,y),readingTimeMinutes:Math.round(f*10)/10,readingTimeText:x,easeLabel:m(g)}}function m(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 S(){var e=b(p());try{var t=r.createDialog(r.getLangText&&r.getLangText("readabilitytitle")||"Readability statistics","rte-dialog-readability"),a=t.ownerDocument,o=a.createElement("div");o.style.cssText="padding:14px 18px;min-width:340px;font:13px -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;color:#0f172a";for(var n=[["Flesch Reading Ease",e.fleschReadingEase+" \u2014 "+e.easeLabel,!0],["Flesch\u2013Kincaid Grade",String(e.fleschKincaidGrade),!1],["Reading time",e.readingTimeText,!1],["Words",String(e.words),!1],["Sentences",String(e.sentences),!1],["Avg words / sentence",String(e.avgWordsPerSentence),!1],["Avg syllables / word",String(e.avgSyllablesPerWord),!1],["Characters (no spaces)",String(e.characters),!1]],i=0;i<n.length;i++){var l=a.createElement("div");l.style.cssText="display:flex;justify-content:space-between;gap:24px;padding:6px 0;border-bottom:1px solid #eef2f7"+(n[i][2]?";font-weight:600;font-size:14px":"");var c=a.createElement("span");c.textContent=n[i][0],c.style.color="#475569";var s=a.createElement("span");s.textContent=n[i][1],s.style.textAlign="right",l.appendChild(c),l.appendChild(s),o.appendChild(l)}t.appendChild(o)}catch{window.console&&console.warn("readabilitystats:",e)}}}
|
|
@@ -0,0 +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,w,f,i=null,N,E,u,h,R=[],v=0,g=!1,m=!1,x=null;r.PluginName="ReadAloud";function C(){return window.speechSynthesis||null}function P(){return!!C()&&typeof window.SpeechSynthesisUtterance=="function"}r.InitConfig=function(e){w=e},r.InitEditor=function(e){f=e,f.readAloud=function(t){r.Start(t||{})},f.stopReadAloud=function(){r.Stop()},f.attachEvent("exec_command_readaloud",function(t){if(t.returnValue=!0,!P()){r.NotifyUnsupported();return}i?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=f.createDialog(f.getLangText&&f.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="This browser does not provide a speech synthesizer (Web Speech API). Read-aloud is unavailable here.",e.appendChild(t)}catch{}};function I(){for(var e=f.getEditable(),t=e.ownerDocument,a=t.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:function(p){for(var c=p.parentNode;c&&c!==e;){var s=c.nodeName;if(s==="SCRIPT"||s==="STYLE"||s==="NOSCRIPT")return NodeFilter.FILTER_REJECT;c=c.parentNode}return p.data&&p.data.length?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),n=[],o="",l;l=a.nextNode();)n.push({node:l,start:o.length,len:l.data.length}),o+=l.data;function d(p){for(var c=0;c<n.length;c++){var s=n[c];if(p<=s.start+s.len)return{node:s.node,offset:Math.max(0,p-s.start)}}var b=n[n.length-1];return b?{node:b.node,offset:b.len}:null}function y(p,c){for(var s=0;s<n.length;s++)if(n[s].node===p)return n[s].start+c;return-1}return{full:o,locate:d,globalOffset:y,hasNodes:n.length>0}}function L(e,t){for(var a=[],n=/[^.!?\n。!?]*[.!?\n。!?]+|\S[^.!?\n]*$/g,o;(o=n.exec(e))!==null;)o[0]&&/\S/.test(o[0])&&a.push({text:o[0],start:t+o.index,end:t+o.index+o[0].length}),o.index===n.lastIndex&&n.lastIndex++;return!a.length&&/\S/.test(e)&&a.push({text:e,start:t,end:t+e.length}),a}r.Start=function(e){if(!P()){r.NotifyUnsupported();return}r.Stop();var t=I();if(!t.hasNodes){S("Nothing to read");return}var a=f.getSelection?f.getSelection():null,n=0,o=t.full.length;try{if(a&&a.rangeCount&&!a.isCollapsed){var l=a.getRangeAt(0),d=t.globalOffset(l.startContainer,l.startOffset),y=t.globalOffset(l.endContainer,l.endOffset);d>=0&&y>=0&&y>d&&(n=d,o=y)}}catch{}x=a&&a.rangeCount?a.getRangeAt(0).cloneRange():null;var p=t.full.substring(n,o);if(R=L(p,n),!R.length){S("Nothing to read");return}v=0,g=!0,m=!1,r._map=t,r._opts=e||{},_(),T()};function T(){var e=C();if(!e||v>=R.length){r.Stop();return}var t=R[v],a=new SpeechSynthesisUtterance(t.text),n=r._opts&&r._opts.rate||h&&parseFloat(h.value)||w.readAloudRate||1;a.rate=Math.min(2,Math.max(.5,n));var o=B();o&&(a.voice=o),a.onstart=function(){w.readAloudHighlight!==!1&&O(t),S("Reading\u2026 ("+(v+1)+"/"+R.length+")")},a.onend=function(){g&&(v++,T())},a.onerror=function(){g&&(v++,T())};try{e.speak(a)}catch{v++,T()}}function O(e){try{var t=r._map;if(!t)return;var a=t.locate(e.start),n=t.locate(e.end);if(!a||!n)return;var o=f.getDocument(),l=o.createRange();l.setStart(a.node,a.offset),l.setEnd(n.node,n.offset);var d=f.getSelection();d&&(d.removeAllRanges(),d.addRange(l))}catch{}}r.Pause=function(){var e=C();if(!(!e||!g)&&!m){try{e.pause()}catch{}m=!0,_(),S("Paused")}},r.Resume=function(){var e=C();if(!(!e||!g)&&m){try{e.resume()}catch{}m=!1,_(),S("Reading\u2026")}},r.Stop=function(){var e=C();if(g=!1,m=!1,R=[],v=0,e)try{e.cancel()}catch{}try{if(x){var t=f.getSelection();t&&(t.removeAllRanges(),t.addRange(x))}}catch{}x=null,_(),S("")};function D(){var e=C();if(!(!e||!u)){var t=e.getVoices()||[];if(t.length){var a=u.value;u.innerHTML="",t.forEach(function(n,o){var l=u.ownerDocument.createElement("option");l.value=n.name,l.textContent=n.name+" ("+n.lang+")",n.default&&(l.textContent+=" (default)"),u.appendChild(l)}),a&&(u.value=a)}}}function B(){var e=C();if(!e)return null;var t=e.getVoices()||[];if(r._opts&&r._opts.voice){for(var a=0;a<t.length;a++)if(t[a].name===r._opts.voice)return t[a]}if(u&&u.value){for(var n=0;n<t.length;n++)if(t[n].name===u.value)return t[n]}return null}function A(e,t,a){var n=e.ownerDocument.createElement("button");return n.type="button",n.textContent=t,a&&(n.title=a),n.className="rte-readaloud-button",e.appendChild(n),n}r.OpenBar=function(){if(!i){var e=document;i=e.createElement("div"),i.className="rte-readaloud-bar";var t=e.createElement("span");t.className="rte-readaloud-title",t.textContent="Read",i.appendChild(t),N=A(i,"Play","Play / Pause");var a=A(i,"Stop","Stop");u=e.createElement("select"),u.className="rte-readaloud-voice",u.title="Voice",i.appendChild(u),h=e.createElement("select"),h.className="rte-readaloud-rate",h.title="Speed",["0.75","1","1.25","1.5","2"].forEach(function(l){var d=e.createElement("option");d.value=l,d.textContent=l+"x",l==="1"&&(d.selected=!0),h.appendChild(d)}),i.appendChild(h),E=e.createElement("span"),E.className="rte-readaloud-status",i.appendChild(E);var n=A(i,"Close","Close");n.className+=" is-close",e.body.appendChild(i),D();var o=C();o&&typeof o.addEventListener=="function"&&o.addEventListener("voiceschanged",D),N.onclick=function(){g?m?r.Resume():r.Pause():r.Start({})},a.onclick=function(){r.Stop()},n.onclick=function(){r.CloseBar()},r.Start({})}},r.CloseBar=function(){r.Stop(),i&&i.parentNode&&i.parentNode.removeChild(i),i=null,N=E=u=h=null};function _(){N&&(N.textContent=g&&!m?"Pause":"Play")}function S(e){E&&(E.textContent=e)}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.svgCode_restrictedediting||(RTE_DefaultConfig.svgCode_restrictedediting='<svg viewBox="0 0 24 24" fill="none" stroke="#5F6368" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="11" width="14" height="9" rx="1.5"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/></svg>'),RTE_DefaultConfig.plugin_restrictedediting=RTE_Plugin_RestrictedEditing;function RTE_Plugin_RestrictedEditing(){var v=this,l,o,u=!1,d="data-rte-editable";v.PluginName="RestrictedEditing",v.InitConfig=function(e){l=e,l.text_restrictedediting=l.text_restrictedediting||"Restricted editing",l.text_restrictedediting_mark=l.text_restrictedediting_mark||"Mark as editable",l.text_restrictedediting_next=l.text_restrictedediting_next||"Next editable region",l.text_restrictedediting_hint=l.text_restrictedediting_hint||"Lock the document; only marked regions accept input."},v.InitEditor=function(e){o=e,u=!!l.restrictedEditingMode,o.restrictedEditing={isEnabled:function(){return u},enable:g,disable:_,toggle:function(){return u?_():g()},markSelection:m,unmark:x,list:p,goToNext:function(){return y(1)},goToPrev:function(){return y(-1)}},o.attachEvent("exec_command_restrictedediting",function(t){t.returnValue=!0,t.stopBubble=!0,o.restrictedEditing.toggle()}),u&&g(),o.attachEvent("change",f),f()};function c(){return o.getEditable?o.getEditable():null}function f(){var e=c();if(e){var t=e.ownerDocument;if(!(!t||t.getElementById("__rte_restrictedediting_styles"))){var r=t.createElement("style");r.id="__rte_restrictedediting_styles",r.textContent=["["+d+"='true']{background:rgba(34,197,94,.10);outline:1px dashed rgba(34,197,94,.55);outline-offset:1px;border-radius:2px;padding:1px 2px}","body.rte-restricted [contenteditable='false']{cursor:not-allowed}","body.rte-restricted ["+d+"='true']{background:rgba(34,197,94,.16)}"].join(`
|
|
2
|
+
`),(t.head||t.getElementsByTagName("head")[0]).appendChild(r),o&&typeof o.ensureStyleSheetLive=="function"&&o.ensureStyleSheetLive(t,r,"__rte_restrictedediting_styles",r.textContent)}}}function g(){var e=c();if(!e)return!1;u=!0,e.classList.add("rte-restricted");for(var t=0;t<e.children.length;t++){var r=e.children[t];r.querySelector("["+d+"='true']")?(r.setAttribute("contenteditable","true"),r.setAttribute(d+"-wrapper","true")):r.setAttribute("contenteditable","false")}return e.setAttribute("contenteditable","false"),f(),!0}function _(){var e=c();if(!e)return!1;u=!1,e.classList.remove("rte-restricted");for(var t=e.querySelectorAll("[contenteditable]"),r=0;r<t.length;r++)t[r].removeAttribute("contenteditable"),t[r].removeAttribute(d+"-wrapper");return e.setAttribute("contenteditable","true"),!0}function m(e){e=e||{};var t=c();if(!t)return null;var r=t.ownerDocument,a=r.getSelection();if(!a||a.rangeCount===0)return null;var n=a.getRangeAt(0);if(n.collapsed)return null;var i=r.createElement("span");i.setAttribute(d,"true"),e.label&&i.setAttribute("aria-label",e.label);try{n.surroundContents(i)}catch{var h=n.extractContents();i.appendChild(h),n.insertNode(i)}var s=r.createRange();return s.selectNodeContents(i),a.removeAllRanges(),a.addRange(s),f(),u&&g(),i}function x(e){if(e=e||(function(){var r=c(),a=r&&r.ownerDocument.getSelection();if(!a||a.rangeCount===0)return null;for(var n=a.anchorNode;n&&n!==r;){if(n.nodeType===1&&n.getAttribute&&n.getAttribute(d)==="true")return n;n=n.parentNode}return null})(),!e)return!1;for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);return t.removeChild(e),u&&g(),!0}function p(){var e=c();return e?Array.prototype.slice.call(e.querySelectorAll("["+d+"='true']")):[]}function y(e){var t=p();if(t.length===0)return null;var r=c(),a=r&&r.ownerDocument.getSelection(),n=null;if(a&&a.anchorNode)for(var i=a.anchorNode;i&&i!==r;){if(i.nodeType===1&&i.getAttribute&&i.getAttribute(d)==="true"){n=i;break}i=i.parentNode}var h=n?t.indexOf(n):-1,s=t[(h+e+t.length)%t.length];if(!s)return null;var b=r.ownerDocument.createRange();return b.selectNodeContents(s),b.collapse(!1),a.removeAllRanges(),a.addRange(b),s.scrollIntoView({block:"center",behavior:"smooth"}),s}}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.svgCode_revisionhistory||(RTE_DefaultConfig.svgCode_revisionhistory='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 3-6.7"/><path d="M3 4v5h5"/><path d="M12 8v4l3 2"/></svg>'),RTE_DefaultConfig.plugin_revisionhistory=RTE_Plugin_RevisionHistory;function RTE_Plugin_RevisionHistory(){var F=this,a,n,d=null,K=null,L="";F.PluginName="RevisionHistory",F.InitConfig=function(r){a=r,a.revisionHistoryEnabled!==!1&&(a.revisionHistoryMaxEntries=a.revisionHistoryMaxEntries||50,a.revisionHistoryAutoSnapshotMs=a.revisionHistoryAutoSnapshotMs||0,a.revisionHistoryUrl=a.revisionHistoryUrl||"",a.revisionHistoryRequestHeaders=a.revisionHistoryRequestHeaders||null,a.onRevisionHistorySyncError=a.onRevisionHistorySyncError||null,a.text_revisionhistory=a.text_revisionhistory||"Revision history",I("toolbar_default","#{revisionhistory}"),I("toolbar_full","#{revisionhistory}"),I("toolbar_mobile","#{revisionhistory}"),(a.controltoolbar_TEXT||"").indexOf("revisionhistory")===-1&&(a.controltoolbar_TEXT=(a.controltoolbar_TEXT||"")+"|{revisionhistory}"))},F.InitEditor=function(r){n=r,a.revisionHistoryEnabled!==!1&&(n.revisionHistory={snapshot:function(e,t){return j(e,t)},promptAndSnapshot:function(e){return ae(e)},rename:function(e,t){return se(e,t)},list:function(){return C().slice().sort(function(e,t){return(t.createdAt||0)-(e.createdAt||0)})},listNamed:function(){return C().slice().filter(function(e){return e.isNamed===!0}).sort(function(e,t){return(t.createdAt||0)-(e.createdAt||0)})},get:function(e){return g(e)},restore:function(e,t){return B(e,t||{})},delete:function(e){return ee(e)},clear:function(){return ce()},diff:function(e,t){return le(e,t)},openBrowser:function(){V()},closeBrowser:function(){N()}},n.toolbarFactoryMap=n.toolbarFactoryMap||{},n.toolbarFactoryMap.revisionhistory=function(e){return n.createToolbarButton(e)},n.attachEvent("exec_command_revisionhistory",function(e){e.returnValue=!0,e.stopBubble=!0,V()}),ve(),ie(),L=n.getHTML?n.getHTML():"",a.revisionHistoryAutoSnapshotMs>0&&n.getDocument().addEventListener("input",function(){K&&clearTimeout(K),K=setTimeout(function(){var e=n.getHTML();e!==L&&j("Auto",{auto:!0})},a.revisionHistoryAutoSnapshotMs)},!0),n.getDocument().addEventListener("keydown",function(e){(e.ctrlKey||e.metaKey)&&e.shiftKey&&(e.key==="H"||e.key==="h")&&(e.preventDefault(),V())},!0))};function I(r,e){a[r]&&a[r].indexOf(e)===-1&&(a[r]=a[r]+e)}function te(){return a.currentUser&&a.currentUser.id?a.currentUser:{id:"user",name:"User",color:"#64748b"}}function W(){var r=a.aiToolkitPersistenceKey||"default";return"RTE.Revisions."+r}function C(){return n.__revisions||(n.__revisions=[]),n.__revisions}function g(r){for(var e=C(),t=0;t<e.length;t++)if(e[t].id===r)return e[t];return null}function _(){for(var r=C();r.length>a.revisionHistoryMaxEntries;)r.shift();try{window.localStorage&&window.localStorage.setItem(W(),JSON.stringify(r))}catch(e){console.warn("revisionhistory: localStorage quota or access issue:",e&&e.message)}a.revisionHistoryUrl&&ne(r)}function ne(r){try{var e=new XMLHttpRequest;e.open("POST",a.revisionHistoryUrl,!0),e.setRequestHeader("Content-Type","application/json");var t=oe();for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(o)){var l=String(t[o]);if(!/\r|\n/.test(l))try{e.setRequestHeader(o,l)}catch{}}e.onerror=function(){R({reason:"network",status:e.status||0})},e.onload=function(){(e.status<200||e.status>=300)&&R({reason:"http",status:e.status,responseText:(e.responseText||"").slice(0,512)})},e.send(JSON.stringify({documentKey:a.aiToolkitPersistenceKey||"",savedAt:Date.now(),revisions:r}))}catch(c){R({reason:"exception",error:c})}}function oe(){var r=a.revisionHistoryRequestHeaders;if(typeof r=="function")try{r=r(n)}catch(e){return R({reason:"header-provider",error:e}),{}}return r&&typeof r=="object"?r:{}}function R(r){console.warn("revisionhistory: remote persistence failed:",r&&r.reason,r&&r.status);try{typeof a.onRevisionHistorySyncError=="function"&&a.onRevisionHistorySyncError(r)}catch{}try{typeof n.fireEvent=="function"&&n.fireEvent("revision_history_sync_error",r)}catch{}}function ie(){try{if(!window.localStorage)return;var r=window.localStorage.getItem(W());if(!r)return;var e=JSON.parse(r);Array.isArray(e)&&(n.__revisions=e)}catch{}}function j(r,e){var t=n.getHTML?n.getHTML():n.getHTMLCode?n.getHTMLCode():"",o=te(),l=(r||"").toString().slice(0,120),c=l.length>0&&(!e||e.auto!==!0),i={id:"rev-"+Date.now()+"-"+Math.floor(Math.random()*1e4),html:t,text:n.getText?n.getText():S(t),label:l||de(),isNamed:c,author:{id:o.id,name:o.name,color:o.color},createdAt:Date.now(),metadata:e||{}};C().push(i),L=t,_(),d&&d.isConnected&&b();try{typeof n.fireEvent=="function"&&n.fireEvent("revision_snapshot",{id:i.id,label:i.label,isNamed:i.isNamed,createdAt:i.createdAt})}catch{}return i}function ae(r){var e=n.iframe?n.iframe.ownerDocument:document,t=e.defaultView||window,o=t.prompt('Name this version (e.g. "Draft sent to legal"):',r||"");if(o===null)return null;var l=(o||"").trim();return l?j(l,{user:!0}):null}function se(r,e){var t=g(r);if(!t)return!1;var o=(e||"").toString().trim().slice(0,120);return o?(t.label=o,t.isNamed=!0,_(),d&&d.isConnected&&b(),!0):!1}function le(r,e){var t=g(r),o=g(e);if(!t||!o)return null;var l=t.text||S(t.html),c=o.text||S(o.html);return{oldEntry:t,newEntry:o,oldText:l,newText:c,lines:re(l,c)}}function de(){var r=new Date;function e(t){return t<10?"0"+t:""+t}return e(r.getHours())+":"+e(r.getMinutes())+":"+e(r.getSeconds())}function B(r,e){e=e||{};var t=g(r);if(!t)return!1;if(!e.skipConfirm){var o=n.iframe?n.iframe.ownerDocument:document;if(!o.defaultView.confirm("Restore this version? Your current content will be replaced (this itself is not auto-snapshotted)."))return!1}return n.setHTMLCode?n.setHTMLCode(t.html):n.setHTML&&n.setHTML(t.html),L=t.html,d&&d.isConnected&&N(),!0}function ee(r){for(var e=C(),t=0;t<e.length;t++)if(e[t].id===r)return e.splice(t,1),_(),d&&d.isConnected&&b(),!0;return!1}function ce(){n.__revisions=[],_(),d&&d.isConnected&&b()}function re(r,e){for(var t=String(r||"").split(/\r?\n/),o=String(e||"").split(/\r?\n/),l=[],c=fe(t,o),i=0,v=0,s=0;i<t.length&&v<o.length;)s<c.length&&t[i]===c[s]&&o[v]===c[s]?(l.push({type:"eq",text:t[i]}),i++,v++,s++):s<c.length&&t[i]!==c[s]?(l.push({type:"del",text:t[i]}),i++):s<c.length&&o[v]!==c[s]?(l.push({type:"add",text:o[v]}),v++):i<t.length?(l.push({type:"del",text:t[i]}),i++):v<o.length&&(l.push({type:"add",text:o[v]}),v++);for(;i<t.length;)l.push({type:"del",text:t[i]}),i++;for(;v<o.length;)l.push({type:"add",text:o[v]}),v++;return l}function fe(r,e){for(var t=r.length,o=e.length,l=new Array(o+1).fill(0),c=new Array(o+1).fill(0),i=[],s=0;s<=t;s++)i.push(new Array(o+1).fill(0));for(var s=1;s<=t;s++)for(var u=1;u<=o;u++)r[s-1]===e[u-1]?i[s][u]=i[s-1][u-1]+1:i[s][u]=Math.max(i[s-1][u],i[s][u-1]);for(var v=[],s=t,u=o;s>0&&u>0;)r[s-1]===e[u-1]?(v.unshift(r[s-1]),s--,u--):i[s-1][u]>=i[s][u-1]?s--:u--;return v}function S(r){var e=document.createElement("div");return e.innerHTML=r||"",e.innerText||e.textContent||""}function V(){if(!(d&&d.isConnected)&&!(!n||!n.iframe||!n.iframe.ownerDocument)){d&&!d.isConnected&&(d=null);var r=n.iframe.ownerDocument;if(!(!r||!r.body)){d=r.createElement("div");var e=!1;try{var t=n.container||n.getEditable&&n.getEditable().closest&&n.getEditable().closest(".richtexteditor");e=!!(t&&t.classList&&t.classList.contains("rte-dark"))}catch{}d.className="rte-rev-dialog"+(e?" rte-rev-dark":""),d.setAttribute("role","dialog"),d.setAttribute("aria-modal","true"),d.setAttribute("aria-labelledby","rte-rev-dialog-title");var o=r.createElement("div");o.className="rte-rev-backdrop",o.addEventListener("mousedown",function(c){c.target===o&&N()});var l=r.createElement("div");l.className="rte-rev-panel",o.appendChild(l),d.appendChild(o),r.body.appendChild(d),b()}}}function N(){d&&d.parentNode&&d.parentNode.removeChild(d),d=null}var h=null,m="preview";function b(){if(d){var r=d.ownerDocument,e=d.querySelector(".rte-rev-panel");if(!e){N();return}e.innerHTML="";var t=r.createElement("div");t.className="rte-rev-header";var o=r.createElement("div");o.id="rte-rev-dialog-title",o.className="rte-rev-title",o.textContent="Revision history",t.appendChild(o);var l=r.createElement("div");l.className="rte-rev-header-actions";var c=r.createElement("button");c.type="button",c.className="rte-rev-btn rte-rev-btn-ghost",c.textContent="Save version now",c.addEventListener("mousedown",function(f){f.preventDefault();var p=r.defaultView.prompt("Label this version (optional):","");p!==null&&j(p||"")}),l.appendChild(c);var i=r.createElement("button");i.type="button",i.className="rte-rev-btn rte-rev-btn-ghost",i.textContent="Close",i.setAttribute("aria-label","Close revision history"),i.addEventListener("mousedown",function(f){f.preventDefault(),N()}),l.appendChild(i),t.appendChild(l),e.appendChild(t);var v=r.createElement("div");v.className="rte-rev-body";var s=r.createElement("div");s.className="rte-rev-list",s.setAttribute("role","listbox"),s.setAttribute("aria-label","Saved revisions");var u=n.revisionHistory.list();if(u.length){(!h||!g(h))&&(h=u[0].id);for(var Y=0;Y<u.length;Y++)(function(f){var p=r.createElement("button");p.type="button",p.className="rte-rev-row"+(f.id===h?" rte-rev-row-active":""),p.setAttribute("role","option"),p.setAttribute("aria-selected",f.id===h?"true":"false");var Z=r.createElement("span");Z.className="rte-rev-dot",Z.style.background=f.author&&f.author.color||"#64748b";var G=r.createElement("div");G.className="rte-rev-row-who",G.textContent=f.author&&f.author.name||"User";var Q=r.createElement("div");Q.className="rte-rev-row-when",Q.textContent=ue(f.createdAt)+" \xB7 "+(f.label||"");var O=r.createElement("div");O.className="rte-rev-row-col",O.appendChild(G),O.appendChild(Q),p.appendChild(Z),p.appendChild(O),p.addEventListener("mousedown",function(be){be.preventDefault(),h=f.id,b()}),s.appendChild(p)})(u[Y])}else{var X=r.createElement("div");X.className="rte-rev-empty",X.textContent='No revisions yet. Click "Save version now" to capture the current document.',s.appendChild(X)}v.appendChild(s);var A=r.createElement("div");if(A.className="rte-rev-pane",u.length){var x=g(h)||u[0],E=r.createElement("div");E.className="rte-rev-tabs",E.setAttribute("role","tablist"),E.setAttribute("aria-label","Revision view");var y=r.createElement("button");y.type="button",y.className="rte-rev-tab"+(m==="preview"?" rte-rev-tab-active":""),y.setAttribute("role","tab"),y.setAttribute("aria-selected",m==="preview"?"true":"false"),y.textContent="Preview",y.addEventListener("mousedown",function(f){f.preventDefault(),m="preview",b()});var w=r.createElement("button");w.type="button",w.className="rte-rev-tab"+(m==="diff"?" rte-rev-tab-active":""),w.setAttribute("role","tab"),w.setAttribute("aria-selected",m==="diff"?"true":"false"),w.textContent="Diff vs current",w.addEventListener("mousedown",function(f){f.preventDefault(),m="diff",b()}),E.appendChild(y),E.appendChild(w),A.appendChild(E);var q=r.createElement("div");if(q.className="rte-rev-content",m==="preview"){var k=r.createElement("iframe");k.className="rte-rev-preview-frame",k.setAttribute("title","Revision preview"),k.setAttribute("sandbox","allow-same-origin"),q.appendChild(k),setTimeout(function(){try{k.contentDocument.open(),k.contentDocument.write('<!DOCTYPE html><html><head><meta charset="utf-8"><style>body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;padding:16px;color:#0f172a;line-height:1.6}img{max-width:100%}</style></head><body>'+(x.html||"")+"</body></html>"),k.contentDocument.close()}catch{}},0)}else{var pe=n.getText?n.getText():S(n.getHTML()),D=re(x.text||S(x.html),pe),J=r.createElement("pre");J.className="rte-rev-diff";for(var H=0;H<D.length;H++){var P=r.createElement("span");P.className="rte-rev-diff-line rte-rev-diff-"+D[H].type,P.textContent=(D[H].type==="add"?"+ ":D[H].type==="del"?"- ":" ")+D[H].text+`
|
|
2
|
+
`,J.appendChild(P)}q.appendChild(J)}A.appendChild(q);var U=r.createElement("div");U.className="rte-rev-footer";var $=r.createElement("div");$.className="rte-rev-footer-info",$.textContent=x.label?"Label: "+x.label:"";var z=r.createElement("div");z.className="rte-rev-footer-btns";var M=r.createElement("button");M.type="button",M.className="rte-rev-btn rte-rev-btn-danger",M.textContent="Delete",M.addEventListener("mousedown",function(f){f.preventDefault(),ee(x.id)});var T=r.createElement("button");T.type="button",T.className="rte-rev-btn rte-rev-btn-primary",T.textContent="Restore this version",T.addEventListener("mousedown",function(f){f.preventDefault()}),T.addEventListener("click",function(f){f.preventDefault(),B(x.id)}),z.appendChild(M),z.appendChild(T),U.appendChild($),U.appendChild(z),A.appendChild(U)}v.appendChild(A),e.appendChild(v)}}function ue(r){if(!r)return"";var e=new Date(r),t=new Date;function o(c){return c<10?"0"+c:""+c}var l=o(e.getHours())+":"+o(e.getMinutes());return e.toDateString()===t.toDateString()?"Today "+l:e.getFullYear()+"-"+o(e.getMonth()+1)+"-"+o(e.getDate())+" "+l}function ve(){var r=n&&n.iframe&&n.iframe.ownerDocument||document;if(!r.querySelector("style[data-rte-revisionhistory]")){var e=r.createElement("style");e.setAttribute("data-rte-revisionhistory","1"),e.textContent=[".rte-rev-dialog{position:fixed;inset:0;z-index:2147483600;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;font-size:13px;color:#172033}",".rte-rev-backdrop{position:absolute;inset:0;background:linear-gradient(135deg,rgba(12,18,32,.44),rgba(40,54,77,.26));display:flex;align-items:center;justify-content:center;padding:18px}","/* 2026-07-12 revision dialog precision */",".rte-rev-panel{background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);border:1px solid rgba(117,137,163,.28);border-radius:8px;width:min(960px,calc(100vw - 28px));max-height:min(82vh,740px);display:flex;flex-direction:column;box-shadow:0 16px 40px rgba(35,48,72,.18);overflow:hidden}",".rte-rev-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid rgba(117,137,163,.18);background:rgba(255,255,255,.72)}",".rte-rev-title{font-size:16px;font-weight:760;letter-spacing:-.01em;color:#172033}",".rte-rev-header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}",".rte-rev-btn{padding:8px 12px;border-radius:7px;border:1px solid rgba(116,135,162,.25);font:inherit;font-size:12px;font-weight:680;line-height:1;cursor:pointer;background:#fff;color:#223652;box-shadow:0 1px 2px rgba(32,45,66,.06);transition:background .14s ease,border-color .14s ease,box-shadow .14s ease,transform .14s ease}",".rte-rev-btn:hover{background:#f5f8fc;border-color:rgba(81,111,151,.42);box-shadow:0 5px 14px rgba(32,45,66,.09);transform:translateY(-1px)}",".rte-rev-btn:focus-visible{outline:2px solid rgba(56,122,255,.34);outline-offset:2px}",".rte-rev-btn-ghost{background:#fff;color:#34506f}",".rte-rev-btn-primary{background:linear-gradient(135deg,#2563eb,#1d67ba);color:#fff;border-color:rgba(29,103,186,.85);box-shadow:0 8px 18px rgba(37,99,235,.22)}",".rte-rev-btn-primary:hover{background:linear-gradient(135deg,#1d4ed8,#195fad);color:#fff;border-color:rgba(29,78,216,.9);box-shadow:0 9px 20px rgba(37,99,235,.28)}",".rte-rev-btn-danger{background:#fff5f5;color:#9f1d1d;border-color:rgba(190,45,45,.22)}",".rte-rev-body{display:flex;flex:1;min-height:0;background:linear-gradient(90deg,#f8fbff 0%,#fff 42%)}",".rte-rev-list{width:258px;flex:0 0 258px;border-right:1px solid rgba(117,137,163,.18);overflow-y:auto;background:rgba(244,248,253,.78);padding:10px}",".rte-rev-empty{padding:16px;border:1px dashed rgba(99,118,145,.28);border-radius:8px;background:#fff;color:#5b6c81;font-size:12px;line-height:1.5}",".rte-rev-row{display:flex;align-items:center;gap:10px;width:100%;padding:10px;border:1px solid transparent;border-radius:8px;background:transparent;text-align:left;cursor:pointer;font:inherit;color:inherit}",".rte-rev-row:hover{background:#fff;border-color:rgba(93,122,161,.24);box-shadow:0 8px 18px rgba(33,48,70,.08)}",".rte-rev-row-active{background:#eef6ff;border-color:rgba(37,99,235,.28);box-shadow:0 8px 22px rgba(37,99,235,.12)}",".rte-rev-dot{width:9px;height:9px;border-radius:50%;flex:0 0 9px;box-shadow:0 0 0 3px rgba(255,255,255,.95),0 0 0 4px rgba(96,116,140,.18)}",".rte-rev-row-col{flex:1;min-width:0}",".rte-rev-row-who{font-weight:720;font-size:12px;line-height:1.25;color:#172033}",".rte-rev-row-when{margin-top:2px;font-size:11px;color:#637487;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-rev-pane{flex:1;display:flex;flex-direction:column;min-width:0;padding:10px}",".rte-rev-tabs{display:flex;align-self:flex-start;gap:3px;padding:3px;margin:0 0 10px;border:1px solid rgba(117,137,163,.2);border-radius:7px;background:#eef3f8}",".rte-rev-tab{padding:7px 12px;border:0;border-radius:6px;background:transparent;font:inherit;font-size:12px;font-weight:680;color:#637487;cursor:pointer}",".rte-rev-tab:hover{color:#1d3557;background:rgba(255,255,255,.58)}",".rte-rev-tab:focus-visible{outline:2px solid rgba(56,122,255,.34);outline-offset:2px}",".rte-rev-tab-active{color:#163966;background:#fff;box-shadow:0 2px 7px rgba(35,48,72,.08)}",".rte-rev-content{flex:1;overflow:auto;padding:0;border:1px solid rgba(117,137,163,.18);border-radius:8px;background:#fff;min-height:300px}",".rte-rev-preview-frame{width:100%;height:100%;min-height:330px;border:0;display:block;background:#fff}",".rte-rev-diff{margin:0;padding:14px 16px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;color:#172033;background:#fbfdff;min-height:100%}",".rte-rev-diff-line{display:block}",".rte-rev-diff-add{background:#e8f8ef;color:#17633f}",".rte-rev-diff-del{background:#fff0f0;color:#9f1d1d}",".rte-rev-diff-eq{color:#556575}",".rte-rev-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0 0;background:transparent}",".rte-rev-footer-info{font-size:12px;color:#637487;min-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",".rte-rev-footer-btns{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}","@media(max-width:720px){.rte-rev-backdrop{padding:10px;align-items:flex-start}.rte-rev-panel{width:calc(100vw - 20px);max-height:calc(100vh - 20px);border-radius:8px}.rte-rev-header{align-items:flex-start;flex-direction:column}.rte-rev-body{flex-direction:column}.rte-rev-list{width:auto;flex:0 0 auto;max-height:178px;border-right:0;border-bottom:1px solid rgba(117,137,163,.18)}.rte-rev-pane{min-height:360px}.rte-rev-footer{align-items:stretch;flex-direction:column}.rte-rev-footer-info{white-space:normal}.rte-rev-footer-btns{justify-content:stretch}.rte-rev-footer-btns .rte-rev-btn{flex:1}}",".rte-rev-dark{color:#e2e8f0}",".rte-rev-dark .rte-rev-panel{background:linear-gradient(180deg,#1e293b,#0f172a);border-color:#334155}",".rte-rev-dark .rte-rev-header{background:rgba(30,41,59,.72);border-color:#334155}",".rte-rev-dark .rte-rev-title,.rte-rev-dark .rte-rev-row-who{color:#e2e8f0}",".rte-rev-dark .rte-rev-btn,.rte-rev-dark .rte-rev-btn-ghost{background:#0f172a;color:#cbd5e1;border-color:#334155}",".rte-rev-dark .rte-rev-btn:hover{background:#334155}",".rte-rev-dark .rte-rev-btn-primary,.rte-rev-dark .rte-rev-btn-primary:hover{background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;border-color:#3b82f6}",".rte-rev-dark .rte-rev-body{background:#0f172a}",".rte-rev-dark .rte-rev-list{background:rgba(15,23,42,.6);border-color:#334155}",".rte-rev-dark .rte-rev-empty{background:#1e293b;color:#94a3b8;border-color:#334155}",".rte-rev-dark .rte-rev-row:hover{background:#1e293b;border-color:#334155}",".rte-rev-dark .rte-rev-row-active{background:#1e3a8a;border-color:#3b82f6}",".rte-rev-dark .rte-rev-row-when,.rte-rev-dark .rte-rev-footer-info{color:#94a3b8}",".rte-rev-dark .rte-rev-tabs{background:#1e293b;border-color:#334155}",".rte-rev-dark .rte-rev-tab{color:#94a3b8}.rte-rev-dark .rte-rev-tab-active{color:#fff;background:#1d4ed8}",".rte-rev-dark .rte-rev-diff{background:#0f172a;color:#cbd5e1}.rte-rev-dark .rte-rev-diff-eq{color:#94a3b8}",".rte-rev-dark .rte-rev-diff-add{background:rgba(16,185,129,.16);color:#6ee7b7}",".rte-rev-dark .rte-rev-diff-del{background:rgba(244,63,94,.16);color:#fda4af}"].join(`
|
|
3
|
+
`),r.head.appendChild(e),n&&typeof n.ensureStyleSheetLive=="function"&&n.ensureStyleSheetLive(r,e,"rte-revisionhistory-style",e.textContent)}}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_rtlui=RTE_Plugin_RtlUi,typeof RTE_DefaultConfig.rtlUserInterface>"u"&&(RTE_DefaultConfig.rtlUserInterface="auto");function RTE_Plugin_RtlUi(){var a=this,c,r,n=!1;a.PluginName="RtlUi",a.InitConfig=function(e){c=e},a.InitEditor=function(e){r=e,r.attachEvent("exec_command_rtlui",function(t){t.returnValue=!0,a.Toggle()}),o();try{r.attachEvent("ready",o)}catch{}try{r.attachEvent("aftersethtml",o)}catch{}setTimeout(o,0),r.setRtlUserInterface=function(t){return l(!!t)},r.toggleRtlUserInterface=function(){return l(!n)},r.isRtlUserInterface=function(){return n},r.getRtlUiCss=function(){return d()}},a.Toggle=function(){return l(!n)};function o(){s(),c.rtlUserInterface===!0?l(!0):c.rtlUserInterface===!1?l(!1):l(u())}function u(){try{if(typeof r.getBaseDirection=="function"&&r.getBaseDirection()==="rtl")return!0;var e=r.getEditable();if(e){var t=e.ownerDocument,i=t&&(t.defaultView||t.parentWindow);if(i&&i.getComputedStyle(e).direction==="rtl")return!0}}catch{}return!1}function f(){try{var e=r.getEditable();if(!e)return null;for(var t=e.ownerDocument.defaultView,i=t&&t.frameElement?t.frameElement:e;i&&i.classList&&!i.classList.contains("richtexteditor");)i=i.parentNode;return i&&i.classList?i:null}catch{return null}}function l(e){var t=f();return t&&(e?t.setAttribute("dir","rtl"):t.removeAttribute("dir"),n=!!e),n}function d(){return['.richtexteditor[dir="rtl"]{direction:rtl;}','.richtexteditor[dir="rtl"] rte-dropdown,','.richtexteditor[dir="rtl"] rte-submenu,','.richtexteditor[dir="rtl"] rte-floatpanel{direction:rtl;text-align:right;}','.richtexteditor[dir="rtl"] rte-menuitem{flex-direction:row-reverse;}','.richtexteditor[dir="rtl"] rte-menutext{margin-left:0;margin-right:3px;}','.richtexteditor[dir="rtl"] rte-menuarrow{margin-right:0;margin-left:4px;}','.richtexteditor[dir="rtl"] rte-ribbon-group-right{margin-left:2px;margin-right:5px;}','.richtexteditor[dir="rtl"] rte-toolbar-arrowbutton{padding-right:0;padding-left:12px;}','.richtexteditor[dir="rtl"] rte-toolbar-dropdown-input{padding-left:0;padding-right:3px;}','.richtexteditor[dir="rtl"] rte-dialog-line-target rte-dialog-input-label{padding-left:0;padding-right:20px;}','.richtexteditor[dir="rtl"] .rte-find-replace-all{margin-left:0;margin-right:auto;}','.richtexteditor[dir="rtl"] .rte-gallery-browser-footer-text{margin-right:0;margin-left:auto;}','.richtexteditor[dir="rtl"] rte-bottom,','.richtexteditor[dir="rtl"] rte-taglist,','.richtexteditor[dir="rtl"] rte-textcounter{direction:rtl;}','.richtexteditor[dir="rtl"] rte-resizecorner{transform:scaleX(-1);}','.richtexteditor[dir="rtl"] [class*="indent"] svg,','.richtexteditor[dir="rtl"] [class*="outdent"] svg,','.richtexteditor[dir="rtl"] rte-menuarrow svg{transform:scaleX(-1);}'].join(`
|
|
2
|
+
`)}function s(){var e=document;if(!e.getElementById("rte-rtl-ui-styles")){var t=e.createElement("style");t.id="rte-rtl-ui-styles",t.appendChild(e.createTextNode(d())),(e.head||e.documentElement).appendChild(t),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(e,t,"rte-rtl-ui-styles",t.textContent)}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_rubyannotation=RTE_Plugin_RubyAnnotation;function RTE_Plugin_RubyAnnotation(){var d=this,a,r;d.PluginName="RubyAnnotation",d.InitConfig=function(e){a=e,a.rubyAnnotationEnabled!==!1&&(typeof a.rubyAnnotationParentheses!="boolean"&&(a.rubyAnnotationParentheses=!0),w("toolbar_full","#{rubyannotation}"),S("subtoolbar_more","rubyannotation"))},d.InitEditor=function(e){r=e,a.rubyAnnotationEnabled!==!1&&(r.ruby={add:function(t){return h(t)},get:function(){var t=p();return t?y(t):null},isRuby:function(){return!!p()},open:function(){d.OpenRubyDialog()},remove:function(){return m()}},E(),r.toolbarFactoryMap=r.toolbarFactoryMap||{},r.toolbarFactoryMap.rubyannotation=function(t){return r.createToolbarButton(t)},r.attachEvent("exec_command_rubyannotation",function(t){t.returnValue=!0,t.stopBubble=!0,d.OpenRubyDialog()}))};function w(e,t){a[e]&&a[e].indexOf(t)===-1&&(a[e]=a[e]+t)}function S(e,t){var n=a[e];if(!(!n||n.indexOf(t)!==-1)){var o=n.indexOf("}");o!==-1&&(a[e]=n.substring(0,o)+","+t+n.substring(o))}}function E(){var e=a.container.ownerDocument;if(!e.getElementById("rte-ruby-style")){var t=e.createElement("style");t.id="rte-ruby-style",t.innerHTML=[".rte-ruby-annotated{ruby-position:over;}",".rte-ruby-annotated>rt{font-size:.55em;line-height:1.15;opacity:.85;user-select:none;}","@supports (display:ruby){.rte-ruby-annotated>rp{display:none;}}"].join(""),e.head.appendChild(t),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(e,t,"rte-ruby-style",t.textContent)}}function D(){return r&&r.getEditable?r.getEditable():null}function b(){var e=r.getDocument();try{var t=e.getSelection();return!t||!t.rangeCount?null:t.getRangeAt(0)}catch{return null}}function p(){var e=b(),t=D();if(!e||!t)return null;for(var n=e.startContainer;n&&n!==t;){if(n.nodeType===1&&n.nodeName==="RUBY")return n;n=n.parentNode}return null}function y(e){var t=e.querySelector("rt");return t&&t.textContent||""}function x(e){for(var t="",n=0;n<e.childNodes.length;n++){var o=e.childNodes[n];o.nodeType===3?t+=o.nodeValue:o.nodeType===1&&o.nodeName!=="RT"&&o.nodeName!=="RP"&&(t+=o.textContent||"")}return t}function v(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function k(e,t){var n=a.rubyAnnotationParentheses;return'<ruby class="rte-ruby-annotated">'+v(e)+(n?"<rp>(</rp>":"")+"<rt>"+v(t)+"</rt>"+(n?"<rp>)</rp>":"")+"</ruby>"}function h(e){var t=p();if(t){var n=t.querySelector("rt");return n||(n=t.ownerDocument.createElement("rt"),t.appendChild(n)),n.textContent=String(e??""),r.focus(),t}var o=b();if(!o||o.collapsed)return null;var u=String(o.toString()||"");return u?(r.insertHTML(k(u,e)),r.focus(),!0):null}function m(){var e=p();if(!e)return!1;var t=e.ownerDocument,n=t.createTextNode(x(e));return e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),r.focus(),!0}function i(e,t,n,o){var u=e.ownerDocument.createElement(t);return n&&(u.style.cssText=n),o&&(u.className=o),e.appendChild(u),u}d.OpenRubyDialog=function(){var e=p(),t=b(),n=e?x(e):t?String(t.toString()||""):"",o=r.createDialog(r.getLangText&&r.getLangText("rubyannotationtitle")||"Ruby annotation","rte-dialog-ruby"),u=typeof o.close=="function"?function(){o.close()}:function(){r.closeCurrentPopup()},l=i(o,"div","padding:14px;min-width:340px;font:13px -apple-system,Segoe UI,sans-serif");i(l,"div","font-weight:600;margin-bottom:4px").innerText="Base text";var A=i(l,"div","padding:8px 10px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;min-height:20px;word-break:break-word");A.textContent=n,i(l,"div","font-weight:600;margin:10px 0 4px").innerText="Reading";var f=i(l,"input","width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;font:13px inherit");f.type="text",f.value=e?y(e):"",f.placeholder="e.g. \u304B\u3093\u3058";var N=i(l,"div","font-size:11px;color:#94a3b8;margin-top:6px");N.innerText=n?"Shown above the base text. Parentheses are emitted for readers without ruby support.":"Select the text to annotate first, then reopen this dialog.";var R=i(l,"div","display:flex;justify-content:space-between;gap:8px;margin-top:14px"),_=i(R,"div","display:flex;gap:8px");if(e){var s=i(_,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#b91c1c;cursor:pointer");s.type="button",s.textContent="Remove",s.onclick=function(){m(),u()}}var C=i(R,"div","display:flex;gap:8px"),g=i(C,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");g.type="button",g.textContent="Cancel",g.onclick=u;var c=i(C,"button","padding:6px 14px;border:1px solid #1d67ba;border-radius:8px;background:#1d67ba;color:#fff;cursor:pointer");c.type="button",c.textContent=e?"Update":"Add",c.disabled=!n,c.onclick=function(){var T=f.value.trim();if(!T||!n){u();return}h(T),u()},setTimeout(function(){f.focus()},0)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_sanitizer=RTE_Plugin_Sanitizer,typeof RTE_DefaultConfig.contentSanitizer>"u"&&(RTE_DefaultConfig.contentSanitizer=!0);function RTE_Plugin_Sanitizer(){var y=this,g,l,E=!1,b={removedTags:[],removedAttributes:[],calls:0,lastPasses:0},k=[];y.PluginName="Sanitizer",y.InitConfig=function(e){g=e},y.InitEditor=function(e){if(l=e,g.contentSanitizer===!1)return;l.sanitizeHtml=function(r){return m(String(r??""))},l.getSanitizerReport=function(){return JSON.parse(JSON.stringify(b))};function t(){try{B(),W()}catch{}try{X()}catch{}try{$()}catch{}}t();try{l.attachEvent("ready",t)}catch{}setTimeout(t,0),setTimeout(t,400)};var L={};"p,div,span,br,hr,h1,h2,h3,h4,h5,h6,b,strong,i,em,u,s,strike,del,ins,mark,small,sub,sup,abbr,cite,q,dfn,kbd,samp,var,time,data,bdi,bdo,wbr,ruby,rt,rp,ul,ol,li,dl,dt,dd,table,thead,tbody,tfoot,tr,td,th,caption,colgroup,col,blockquote,pre,code,figure,figcaption,section,article,header,footer,main,aside,nav,address,details,summary,a,img,picture,source,video,audio,track,map,area,input,label,button,svg,g,path,circle,ellipse,rect,line,polyline,polygon,text,tspan,defs,marker,linearGradient,radialGradient,stop,clipPath,mask,pattern,use,symbol,title,desc".split(",").forEach(function(e){L[e]=!0});var R={script:1,noscript:1,template:1,object:1,embed:1,applet:1,base:1,meta:1,link:1,frame:1,frameset:1,foreignobject:1,xml:1,"script:":1},z={};"id,class,style,title,lang,dir,translate,hidden,tabindex,role,contenteditable,spellcheck,autocomplete,draggable,sandbox,allowfullscreen,allow,frameborder,scrolling,href,src,srcset,sizes,alt,width,height,loading,decoding,referrerpolicy,target,rel,download,type,value,name,placeholder,checked,disabled,readonly,colspan,rowspan,headers,scope,span,align,valign,bgcolor,border,cellpadding,cellspacing,start,reversed,datetime,cite,open,controls,autoplay,loop,muted,playsinline,poster,preload,kind,srclang,label,usemap,ismap,coords,shape,viewbox,xmlns,fill,stroke,stroke-width,stroke-linecap,stroke-linejoin,stroke-dasharray,d,cx,cy,r,rx,ry,x,y,x1,y1,x2,y2,points,transform,opacity,fill-rule,clip-rule,gradientunits,offset,stop-color,stop-opacity,text-anchor,font-size,font-family,font-weight,preserveaspectratio,version".split(",").forEach(function(e){z[e]=!0});var M={href:1,src:1,action:1,formaction:1,poster:1,cite:1,data:1,longdesc:1,background:1,ping:1,srcset:1},I=/^(https?|mailto|tel|ftp|sms|callto|webcal|geo|bitcoin):/i,H=/^data:image\/(png|jpe?g|gif|webp|bmp|x-icon|avif);base64,[a-z0-9+/=\s]+$/i;function w(e,t,r){var n=String(e??"").replace(/[\u0000-\u0020\u007F-\u00A0]+/g,"").trim();if(!n)return!1;if(t==="use")return n.charAt(0)==="#";if(/^[#?/]/.test(n))return!0;var o=/^([a-z][a-z0-9+.\-]*):/i.exec(n);return o?H.test(n)?t==="img"||t==="source"||r==="poster"||r==="srcset":/^blob:/i.test(n)?t==="img"||t==="video"||t==="audio"||t==="source":I.test(n):!0}function P(e){for(var t=[],r=String(e??"").split(";"),n=0;n<r.length;n++){var o=r[n];if(o.trim()&&!/expression\s*\(|(javascript|vbscript|livescript)\s*:|-moz-binding|behaviou?r\s*:|@import|-o-link/i.test(o)){var i=/url\s*\(\s*(['"]?)([^'")]*)\1\s*\)/i.exec(o);i&&!w(i[2],"img","src")||t.push(o.trim())}}return t.join("; ")}var j="allow-scripts allow-same-origin allow-presentation";function G(e,t){var r=j.split(" "),n=!1;try{n=new URL(t,location.href).origin===location.origin}catch{}if(n&&(r=r.filter(function(i){return i!=="allow-same-origin"})),e.hasAttribute("sandbox")){var o=(e.getAttribute("sandbox")||"").toLowerCase().split(/\s+/);r=r.filter(function(i){return o.indexOf(i)>=0})}e.setAttribute("sandbox",r.join(" "))}function U(e){if(g.sanitizerAllowIframes===!1)return!1;var t=e.getAttribute("src")||"";if(!/^https?:/i.test(t))return!1;var r=g.sanitizerAllowedIframeHosts;if(!r||!r.length)return G(e,t),!0;try{for(var n=new URL(t).hostname.toLowerCase(),o=0;o<r.length;o++){var i=String(r[o]).toLowerCase();if(n===i||n.slice(-(i.length+1))==="."+i)return!0}}catch{}return!1}function C(e){var t={},r=[],n=[];(e||[]).forEach(function(i){if(i instanceof RegExp){n.push(i);return}var s=String(i).toLowerCase();if(s.indexOf("*")===-1){t[s]=!0;return}r.push(s.split("*"))});function o(i,s){var a=i[0];if(s.lastIndexOf(a,0)!==0)return!1;var u=i[i.length-1];if(u&&(s.length<u.length||s.indexOf(u,s.length-u.length)===-1))return!1;for(var c=a.length,p=1;p<i.length;p++)if(i[p]){var v=s.indexOf(i[p],c);if(v===-1)return!1;c=v+i[p].length}return!0}return function(i){if(t[i])return!0;for(var s=0;s<r.length;s++)if(o(r[s],i))return!0;for(var a=0;a<n.length;a++)if(n[a].test(i))return!0;return!1}}function x(e,t){var r=C(g.sanitizerAllowTags),n=C(g.sanitizerAllowAttributes),o=g.sanitizerAllowStyleTags===!0,i=[];(function K(D){for(var _=0;_<D.childNodes.length;_++){var h=D.childNodes[_];h.nodeType===1?(i.push(h),K(h)):h.nodeType===8&&i.push(h)}})(e);for(var s=0;s<i.length;s++){var a=i[s];if(a.parentNode){if(a.nodeType===8){O(a.data)&&(d(t.removedTags,"#comment"),a.parentNode.removeChild(a));continue}var u=(a.localName||a.nodeName||"").toLowerCase();if(u==="style"){if(!o){d(t.removedTags,"style"),a.parentNode.removeChild(a);continue}}else if(u==="iframe"){if(a.hasAttribute("srcdoc")&&(d(t.removedAttributes,"iframe[srcdoc]"),a.removeAttribute("srcdoc")),!U(a)){d(t.removedTags,"iframe"),a.parentNode.removeChild(a);continue}}else if(u==="title"||u==="desc"){if(!a.closest||!a.closest("svg")){d(t.removedTags,u),a.parentNode.removeChild(a);continue}}else if(R[u]){d(t.removedTags,u),a.parentNode.removeChild(a);continue}else if(!L[u]&&!r(u)){d(t.removedTags,u),F(a);continue}for(var c=[],p=0;p<a.attributes.length;p++)c.push(a.attributes[p]);for(var v=0;v<c.length;v++){var f=c[v].name.toLowerCase(),T=c[v].value;if(f.indexOf("on")===0){d(t.removedAttributes,f),a.removeAttribute(c[v].name);continue}if(f==="xlink:href"||f==="xmlns:xlink"){w(T,u,f)||(d(t.removedAttributes,f),a.removeAttribute(c[v].name));continue}if(f==="srcdoc"){d(t.removedAttributes,"srcdoc"),a.removeAttribute(c[v].name);continue}if(f==="style"){a.setAttribute("style",P(T));continue}if(!(f.indexOf("data-")===0||f.indexOf("aria-")===0)){if(M[f]){w(T,u,f)||(d(t.removedAttributes,u+"["+f+"]"),a.removeAttribute(c[v].name));continue}!z[f]&&!n(f)&&(d(t.removedAttributes,f),a.removeAttribute(c[v].name))}}if(u==="a"&&(a.getAttribute("target")||"").toLowerCase()==="_blank"){var S=(a.getAttribute("rel")||"").toLowerCase();S.indexOf("noopener")<0&&a.setAttribute("rel",(S?S+" ":"")+"noopener noreferrer")}}}return e}function F(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function d(e,t){e.indexOf(t)<0&&e.push(t)}function m(e){var t=e;b.calls++;for(var r=0;r<3;r++){var n=new DOMParser().parseFromString("<body>"+t+"</body>","text/html");x(n.body,b);var o=n.body.innerHTML;if(b.lastPasses=r+1,o===t)break;t=o}return t}function B(){if(!E){for(var e=["getHTMLCode","getHTMLContent"],t=!1,r=0;r<e.length;r++)(function(n){var o=l[n];if(!(typeof o!="function"||o.__rteSanitized)){var i=function(){var s=o.apply(l,arguments);return typeof s!="string"?s:m(s)};i.__rteSanitized=!0,l[n]=i,t=!0}})(e[r]);t&&(E=!0)}}function W(){for(var e=["setHTMLCode","setHTMLContent"],t=0;t<e.length;t++)(function(r){var n=l[r];if(!(typeof n!="function"||n.__rteSanitizedIn)){var o=function(i){var s=[].slice.call(arguments);return typeof i=="string"&&(s[0]=m(i)),n.apply(l,s)};o.__rteSanitizedIn=!0,l[r]=o}})(e[t])}function q(e){return/\son[a-z]+\s*=/i.test(e)||/<\s*(script|iframe|object|embed|base)\b/i.test(e)||/srcdoc\s*=/i.test(e)||/(javascript|vbscript)\s*:/i.test(e)||/data:\s*text\/html/i.test(e)}function O(e){var t=String(e??"");return t.indexOf("-->")!==-1||t.indexOf("--!>")!==-1||t.charAt(0)===">"||t.charAt(0)==="-"&&t.charAt(1)===">"}var N=/^(script|iframe|object|embed|base|meta|link|form)$/;function A(e){if(!e.attributes)return!1;for(var t=0;t<e.attributes.length;t++){var r=e.attributes[t].name.toLowerCase();if(r.indexOf("on")===0||r==="srcdoc"||(r==="href"||r==="src"||r==="data"||r==="action"||r==="xlink:href")&&/(javascript|vbscript)\s*:|data:\s*text\/html/i.test(e.attributes[t].value||""))return!0}return!1}function J(e){if(N.test(e.localName||"")||A(e))return!0;for(var t=e.getElementsByTagName?e.getElementsByTagName("*"):[],r=0;r<t.length;r++)if(N.test(t[r].localName||"")||A(t[r]))return!0;return!1}function $(){if(g.sanitizerGuardLiveDom!==!1){var e=null;try{e=l.getEditable()}catch{return}if(!(!e||e.__rteLiveGuard)){e.__rteLiveGuard=!0;var t=new MutationObserver(function(r){for(var n=!1,o=0;o<r.length&&!n;o++){var i=r[o];if(i.type==="attributes"){var s=(i.attributeName||"").toLowerCase();(s.indexOf("on")===0||s==="srcdoc"||A(i.target))&&(n=!0);continue}for(var a=0;a<i.addedNodes.length;a++){var u=i.addedNodes[a];if(u.nodeType===8){if(O(u.data)){n=!0;break}continue}if(u.nodeType===1&&J(u)){n=!0;break}}}if(n)try{x(e,b)}catch{}});t.observe(e,{childList:!0,subtree:!0,attributes:!0}),k.push(t)}}}function X(){var e=null;try{e=l.getEditable()}catch{return}if(!e||e.__rteSanitizePaste)return;e.__rteSanitizePaste=!0,e.addEventListener("paste",function(r){var n=r.clipboardData||window.clipboardData;if(n){var o="";try{o=n.getData("text/html")||""}catch{return}if(!(!o||!q(o))){r.preventDefault(),r.stopImmediatePropagation();var i=m(o);try{l.insertHTML(i)}catch{try{l.insertText(n.getData("text/plain")||"")}catch{}}}}},!0);function t(){var r=function(){try{x(e,b)}catch{}};setTimeout(r,0),setTimeout(r,250)}e.addEventListener("paste",t,!1),e.addEventListener("drop",t,!0)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_shadowdom=RTE_Plugin_ShadowDom,typeof RTE_DefaultConfig.shadowStyleAdoption>"u"&&(RTE_DefaultConfig.shadowStyleAdoption=!0),typeof RTE_DefaultConfig.shadowStyleSources>"u"&&(RTE_DefaultConfig.shadowStyleSources=null);function RTE_Plugin_ShadowDom(){var s=this,l,f,c=null,d=null,o=null;s.PluginName="ShadowDom",s.InitConfig=function(t){l=t},s.InitEditor=function(t){f=t,f.getShadowRoot=function(){return h()},f.isInShadowDom=function(){return!!h()},f.adoptEditorStyles=function(r){return p(r||h(),!0)},f.getAdoptedStyleCount=function(){return o?o.size:0},!(l&&l.shadowStyleAdoption===!1)&&D(function(){c=h(),c&&(o=new(window.Set||Array),p(c,!1),A(c))})},s.Destroy=function(){if(d){try{d.disconnect()}catch{}d=null}};function S(){try{var t=f.getEditable(),r=t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView.frameElement:null;if(!r)return null;for(var e=r;e;){if(e.classList&&e.classList.contains("richtexteditor"))return e;e=e.parentNode||e.host}return r}catch{return null}}function h(){var t=S();if(!t||typeof t.getRootNode!="function")return null;var r=t.getRootNode();return r&&r.host&&r!==document?r:null}function D(t){if(S()){t();return}var r=0,e=window.setInterval(function(){(S()||++r>100)&&(window.clearInterval(e),t())},50)}function R(){try{for(var t=document.getElementsByTagName("script"),r=0;r<t.length;r++){var e=t[r].src||"";if(/(^|\/)rte(\.min)?\.js(\?|$)/.test(e))return e.replace(/[^\/]*$/,"")}}catch{}return null}function _(t){var r=String(t.id||"");if(/^rte[-_]|^__rte/.test(r))return!0;var e=t.href||"";if(!e){if(t.tagName==="STYLE"){var n=t.textContent||"";return/[.]richtexteditor|rte-toolbar|rte-editor|rte-dialog|[.]rte-a11y/.test(n)}return!1}var i=R();return i&&e.indexOf(i)===0?!0:/rte_theme|rte_mobile|richtexteditor_content|richtexteditor_preview|aitoolkit/.test(e)}function b(){var t=l&&l.shadowStyleSources||null;return t?typeof t=="string"?[t]:t:[]}function N(t){return(t.href||"")+"|"+(t.id||"")+"|"+(t.textContent||"").length}function w(t){return o&&(o.has?o.has(t):o.indexOf(t)>=0)}function C(t){o&&(o.add?o.add(t):o.push(t))}function p(t,r){if(!t)return 0;o||(o=new(window.Set||Array));for(var e=0,n=document.querySelectorAll("link[rel~=stylesheet],style"),i=0;i<n.length;i++){var u=n[i];if(_(u)){var a=N(u);!r&&w(a)||w(a)||(t.appendChild(T(u,t)),C(a),e++)}}for(var g=b(),v=0;v<g.length;v++){var x="extra|"+g[v];if(!w(x)){var m=document.createElement("link");m.rel="stylesheet",m.href=g[v],m.setAttribute("data-rte-adopted","1"),t.appendChild(m),C(x),e++}}try{if(t.adoptedStyleSheets&&document.adoptedStyleSheets&&document.adoptedStyleSheets.length){for(var E=t.adoptedStyleSheets.slice(),y=0;y<document.adoptedStyleSheets.length;y++)E.indexOf(document.adoptedStyleSheets[y])<0&&E.push(document.adoptedStyleSheets[y]);t.adoptedStyleSheets=E}}catch{}return e}function T(t,r){if(t.tagName==="LINK"){var e=document.createElement("link");return e.rel="stylesheet",e.href=t.href,t.media&&(e.media=t.media),e.setAttribute("data-rte-adopted","1"),e}var n=document.createElement("style");return n.textContent=t.textContent,t.id&&n.setAttribute("data-rte-source-id",t.id),n.setAttribute("data-rte-adopted","1"),n}function A(t){window.MutationObserver&&(d=new MutationObserver(function(r){for(var e=!1,n=0;n<r.length&&!e;n++)for(var i=r[n].addedNodes||[],u=0;u<i.length;u++){var a=i[u];if(a.nodeType===1&&(a.tagName==="STYLE"||a.tagName==="LINK")&&_(a)){e=!0;break}}e&&p(t,!1)}),d.observe(document.head||document.documentElement,{childList:!0,subtree:!0}))}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_slashcommand=RTE_Plugin_SlashCommand;function RTE_Plugin_SlashCommand(){var T=this,d,e,v=null,a=null,g=null,h=[],m=[],p=0,E=!1,R=!1;T.PluginName="SlashCommand",T.InitConfig=function(o){d=o,d.slashCommandEnabled!==!1&&(d.slashCommandTrigger=d.slashCommandTrigger||"/",d.slashCommandMaxItems=d.slashCommandMaxItems||40,d.slashCommandIncludeAi=d.slashCommandIncludeAi!==!1,d.slashCommands=d.slashCommands||null)},T.InitEditor=function(o){if(e=o,d.slashCommandEnabled!==!1){if(e.slashCommands={register:P,remove:te,list:function(){return B(),h.slice()},open:function(){O(!0)},close:f,isOpen:function(){return!!a}},h=N(),Array.isArray(d.slashCommands))for(var t=0;t<d.slashCommands.length;t++)P(d.slashCommands[t]);setTimeout(B,0),he();var n=e.getDocument();n.addEventListener("keydown",re,!0),n.addEventListener("input",ie,!0),n.addEventListener("compositionstart",function(){E=!0}),n.addEventListener("compositionend",function(){E=!1}),n.addEventListener("mousedown",function(){f()},!0),n.addEventListener("blur",function(){setTimeout(f,150)},!0),window.addEventListener("scroll",U,!0),window.addEventListener("resize",U,!0)}};function P(o){if(!(!o||!o.id)){var t=F(o.id);t>=0?h[t]=b(o):h.push(b(o))}}var H={};function B(){if(e){for(var o=[],t=0;t<h.length;t++)h[t]._default||o.push(h[t]);for(var n=N(),i=[],s=0;s<n.length;s++){var l=n[s].id;if(!H[l]){for(var c=!1,r=0;r<o.length;r++)if(o[r].id===l){c=!0;break}c||i.push(n[s])}}h=i.concat(o)}}function te(o){H[o]=!0;var t=F(o);t>=0&&h.splice(t,1)}function F(o){for(var t=0;t<h.length;t++)if(h[t].id===o)return t;return-1}function I(o,t){try{var n=String(o).toLowerCase().replace(/[^a-z0-9_]/g,"_");if(d&&d["text_"+n]&&e&&typeof e.getLangText=="function")return e.getLangText(n)}catch{}return t}function b(o){var t=o.section||"Blocks";return{id:o.id,section:I("slash_section_"+t,t),title:I("slash_"+o.id,o.title||o.id),description:I("slash_"+o.id+"_desc",o.description||""),keywords:(o.keywords||[]).slice(),icon:o.icon||"",iconSvg:o.iconSvg||"",run:o.run||o.action}}var oe={P:1,DIV:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,BLOCKQUOTE:1,PRE:1,LI:1};function ne(){var o=e.getSelection();if(!o||o.rangeCount===0)return null;for(var t=o.getRangeAt(0).startContainer,n=e.getEditable();t&&t!==n;){if(t.nodeType===1&&oe[t.nodeName])return t;t=t.parentNode}return null}function C(o){var t=ne();if(o=o.toUpperCase(),t&&!t.textContent.trim()){var n=e.getDocument(),i=n.createElement(o);i.appendChild(n.createElement("br")),t.parentNode.replaceChild(i,t);var s=n.createRange();s.setStart(i,0),s.setEnd(i,0);var l=e.getSelection();l.removeAllRanges(),l.addRange(s);return}e.execCommand("formatblock",o)}function N(){var o=[];function t(r,u,x,w,k,Qe,Ge){var ee=b({id:u,section:r,title:x,description:w,keywords:k,iconSvg:Qe,run:Ge});ee._default=!0,o.push(ee)}if(t("Blocks","heading1","Heading 1","Large section heading",["h1","title"],S("1"),function(){C("H1")}),t("Blocks","heading2","Heading 2","Medium section heading",["h2","subtitle"],S("2"),function(){C("H2")}),t("Blocks","heading3","Heading 3","Small section heading",["h3"],S("3"),function(){C("H3")}),t("Blocks","paragraph","Paragraph","Plain body text",["p","text","body"],pe(),function(){C("P")}),t("Blocks","bulletlist","Bulleted list","Unordered list",["ul","bullets","list"],fe(),function(){e.execCommand("insertunorderedlist")}),t("Blocks","numberlist","Numbered list","Ordered list",["ol","numbered"],ge(),function(){e.execCommand("insertorderedlist")}),t("Blocks","quote","Quote","Block quotation",["blockquote"],me(),function(){e.execCommand("insertblockquote")}),t("Blocks","code","Code block","Monospaced code block",["pre","snippet"],ve(),function(){e.isCommandEnabled&&e.isCommandEnabled("insertcode")?e.execCommand("insertcode"):e.execCommand("formatblock","PRE")}),t("Blocks","divider","Divider","Horizontal rule",["hr","line","separator"],ke(),function(){e.execCommand("inserthorizontalrule")}),(!e.isCommandEnabled||e.isCommandEnabled("insertcallout"))&&t("Blocks","callout","Callout","Highlighted info / warning box",["admonition","info","warning","note","tip"],Te(),function(){e.execCommand("insertcallout")}),(!e.isCommandEnabled||e.isCommandEnabled("insertcolumns"))&&t("Blocks","columns","Columns","Multi-column layout",["layout","grid","column"],Ee(),function(){e.execCommand("insertcolumns")}),(!e.isCommandEnabled||e.isCommandEnabled("inserttoggle"))&&t("Blocks","toggle","Toggle list","Collapsible toggle block",["collapse","details","accordion","expand"],Be(),function(){e.execCommand("inserttoggle")}),(!e.isCommandEnabled||e.isCommandEnabled("insertmath"))&&t("Insert","equation","Equation","Insert a math equation (TeX)",["math","latex","tex","formula","katex"],Ie(),function(){e.execCommand("insertmath")}),(!e.isCommandEnabled||e.isCommandEnabled("inserttodolist"))&&t("Blocks","todolist","To-do list","Checklist with clickable checkboxes",["task","todo","checklist","checkbox","check"],ze(),function(){e.execCommand("inserttodolist")}),(!e.isCommandEnabled||e.isCommandEnabled("insertdiagram"))&&t("Insert","diagram","Diagram","Insert a Mermaid diagram",["mermaid","flowchart","sequence","gantt","graph","uml"],Se(),function(){e.execCommand("insertdiagram")}),(!e.isCommandEnabled||e.isCommandEnabled("insertbookmark"))&&t("Insert","bookmark","Bookmark","Insert a link preview card",["link","url","embed","preview","card"],Ae(),function(){e.execCommand("insertbookmark")}),(!e.isCommandEnabled||e.isCommandEnabled("spellcheck"))&&t("Tools","spellcheck","Spell check","Check spelling",["spelling","grammar","proofread","typo"],V(),function(){e.execCommand("spellcheck")}),(!e.isCommandEnabled||e.isCommandEnabled("insertdatechip"))&&t("Insert","datechip","Date chip","Insert an interactive date chip",["date","calendar","chip","today"],K(),function(){e.execCommand("insertdatechip")}),(!e.isCommandEnabled||e.isCommandEnabled("insertchip"))&&t("Insert","chip","Smart chip","Insert a date / person / link chip",["chip","person","mention","link","pill"],K(),function(){e.execCommand("insertchip")}),(!e.isCommandEnabled||e.isCommandEnabled("emailexport"))&&t("Tools","emailexport","Export email HTML","Inline-styled HTML for email",["email","inline","mail","newsletter","html"],Le(),function(){e.execCommand("emailexport")}),typeof e.openFindDialog=="function"&&t("Tools","findreplace","Find & replace","Search the document and replace text",["find","replace","search","query","substitute"],_e(),function(){e.openFindDialog()}),typeof e.showShortcuts=="function"&&t("Tools","shortcuts","Keyboard shortcuts","Show the keyboard shortcut cheat sheet (Ctrl+/)",["keyboard","shortcuts","hotkeys","keys","help","cheat"],qe(),function(){e.showShortcuts()}),typeof e.foldAtCaret=="function"&&(t("Tools","foldsection","Fold section","Collapse the section under the current heading",["fold","collapse","heading","outline","section"],J(),function(){e.foldAtCaret()}),t("Tools","unfoldall","Unfold all","Expand every collapsed heading section",["unfold","expand","headings","collapse"],J(),function(){e.unfoldAll&&e.unfoldAll()})),(!e.isCommandEnabled||e.isCommandEnabled("readaloud"))&&t("Tools","readaloud","Read aloud","Speak the selection or document (text-to-speech)",["tts","speak","speech","voice","accessibility","narrate"],W(),function(){e.execCommand("readaloud")}),typeof e.sortTableAtCaret=="function"&&(t("Tools","sorttableasc","Sort table by this column","Sort the table rows by the column the caret is in",["sort","table","column","order","ascending"],D(),function(){e.sortTableAtCaret("asc")}),t("Tools","sorttabledesc","Sort table (descending)","Sort the table rows by this column, largest first",["sort","table","column","descending","reverse"],D(),function(){e.sortTableAtCaret("desc")}),t("Tools","tablerownumbers","Number table rows","Add or remove an automatic row-numbering column",["number","rows","table","count","index"],D(),function(){e.execCommand("tablerownumbers")})),typeof e.setTableLayoutMode=="function"&&(t("Insert","layouttable","Layout table","Insert a borderless table for positioning content (role=presentation)",["layout","table","grid","email","columns","presentation"],y(),function(){e.insertLayoutTable(2,2)}),t("Tools","tablelayoutmode","Mark table as layout","This table only positions content \u2014 stop screen readers announcing it as data",["layout","table","presentation","accessibility","screen reader"],y(),function(){e.setTableLayoutMode("layout")}),t("Tools","tabledatamode","Mark table as data","This table states relationships \u2014 restore its header cells",["data","table","header","accessibility"],y(),function(){e.setTableLayoutMode("data",null,{promoteFirstRow:!0})})),typeof e.moveBlockUp=="function"&&(t("Tools","moveblockup","Move block up","Move this paragraph or block above the previous one (Alt+Shift+Up)",["move","block","up","reorder","drag"],Q(),function(){e.moveBlockUp()}),t("Tools","moveblockdown","Move block down","Move this paragraph or block below the next one (Alt+Shift+Down)",["move","block","down","reorder","drag"],Q(),function(){e.moveBlockDown()})),typeof e.toggleRtlUserInterface=="function"&&t("Tools","rtlui","Mirror editor for RTL","Flip the toolbar, menus and dialogs for right-to-left languages",["rtl","mirror","interface","toolbar","arabic","hebrew"],j(),function(){e.toggleRtlUserInterface()}),typeof e.setTextDirection=="function"&&(t("Tools","rtl","Right-to-left","Set this paragraph to right-to-left (Arabic, Hebrew, Persian)",["rtl","arabic","hebrew","persian","urdu","direction","bidi"],j(),function(){e.setTextDirection("rtl")}),t("Tools","ltr","Left-to-right","Set this paragraph to left-to-right",["ltr","direction","bidi"],je(),function(){e.setTextDirection("ltr")}),t("Tools","autodir","Detect text direction","Set each paragraph's direction from its own content",["direction","detect","auto","rtl","bidi"],j(),function(){e.autoDetectTextDirection()})),typeof e.toggleFormattingMarks=="function"&&t("Tools","formattingmarks","Formatting marks","Show paragraph marks, block outlines and invisible characters",["marks","pilcrow","paragraph","invisible","whitespace","nbsp"],De(),function(){e.toggleFormattingMarks()}),typeof e.toggleWatermark=="function"&&t("Tools","watermark","Watermark","Draw DRAFT or CONFIDENTIAL behind the content",["watermark","draft","confidential","background","stamp"],Re(),function(){e.toggleWatermark()}),typeof e.toggleLineNumbers=="function"&&t("Tools","linenumbers","Line numbers","Number every line in the margin, as pleadings and transcripts require",["line","numbers","margin","pleading","legal","transcript"],Pe(),function(){e.toggleLineNumbers()}),typeof e.togglePermanentPen=="function"&&t("Tools","permanentpen","Permanent pen","Keep typing in a fixed annotation format until switched off",["pen","marker","annotate","highlight","review"],G(),function(){e.togglePermanentPen()}),typeof e.checkLinks=="function"&&t("Tools","checklinks","Check links","Find broken anchors, unsafe schemes and unlabelled links",["link","check","broken","audit","url","accessibility"],He(),function(){e.highlightLinkIssues(!0),e.checkLinks()}),typeof e.getMergeFieldDefinitions=="function"){for(var n=e.getMergeFieldDefinitions(),i=0;i<n.length;i++)(function(r){!r||!r.id||t("Insert","mergefield-"+r.id,r.label||r.id,"Insert the "+(r.label||r.id)+" merge field",["merge","field","placeholder","variable","mail merge",r.id],X(),function(){e.insertMergeField(r.id)})})(n[i]);t("Tools","mergepreview","Preview merge fields","Swap merge-field placeholders for sample data",["merge","preview","sample","data","placeholder"],X(),function(){e.toggleMergeFieldPreview()})}if(typeof e.listCrossReferenceTargets=="function"){var s=[];try{s=e.listCrossReferenceTargets()}catch{s=[]}for(var l=0;l<s.length&&l<40;l++)(function(r){if(!(!r||!r.id)){var u=r.number?r.number+" "+r.label:r.label;t("Insert","xref-"+r.id,"Reference: "+u,"Insert a cross-reference to this "+r.type+" that updates itself",["cross","reference","xref","see","refer",r.type,r.number||""],Y(),function(){e.insertCrossReference(r.id,r.number?"label":"text")})}})(s[l])}if(typeof e.insertTableOfContents=="function"&&t("Insert","toc","Table of contents","Insert a contents block that updates itself from your headings",["toc","contents","outline","index","headings"],Fe(),function(){e.insertTableOfContents()}),typeof e.insertFootnote=="function"&&t("Insert","footnote","Footnote","Insert a numbered footnote reference and note",["footnote","note","citation","reference","endnote","cite"],Ne(),function(){e.insertFootnote()}),typeof e.toggleFormatPainter=="function"&&t("Tools","formatpainter","Format painter","Copy formatting here, then select the text to paint it onto",["format","painter","brush","copy","style","clone"],Oe(),function(){e.toggleFormatPainter()}),typeof e.changeCase=="function"&&(t("Tools","caseupper","UPPERCASE","Convert the selection to upper case",["case","upper","caps","capitals"],M(),function(){e.changeCase("upper")}),t("Tools","caselower","lowercase","Convert the selection to lower case",["case","lower","small"],M(),function(){e.changeCase("lower")}),t("Tools","casetitle","Title Case","Capitalise each significant word in the selection",["case","title","headline","capitalise","capitalize"],M(),function(){e.changeCase("title")}),t("Tools","casesentence","Sentence case","Capitalise the first letter of each sentence",["case","sentence","capitalise","capitalize"],M(),function(){e.changeCase("sentence")})),typeof e.requestGhostText=="function"&&t("Tools","aicomplete","AI complete","Suggest an inline AI completion of the current sentence",["ai","complete","autocomplete","ghost","suggest","continue","copilot"],Ke(),function(){e.requestGhostText()}),typeof e.exportToPdf=="function"&&t("Tools","exportpdf","Export to PDF","Real text, not a screenshot \u2014 selectable, searchable and screen-reader friendly",["pdf","export","download","save","print","text","accessible","searchable"],We(),function(){e.exportToPdf()}),typeof e.exportToDocx=="function"&&t("Tools","exportdocx","Export to Word (.docx)","A real OOXML document, built in the browser with no upload",["word","docx","ooxml","export","download","save","office"],$(),function(){e.exportToDocx()}),typeof e.openImportDialog=="function"&&t("Tools","import-document","Import document","Open a Markdown, HTML, text, or Word file into the editor",["import","open","file","word","docx","markdown","upload"],$(),function(){e.openImportDialog({})}),typeof e.getReadabilityStats=="function"&&t("Tools","readability-stats","Readability statistics","Flesch reading ease, grade level, and reading time",["readability","flesch","grade","reading","stats","score"],V(),function(){e.execCommand("readability")}),typeof e.insertCrossReference=="function"&&t("Insert","crossreference","Cross-reference","Insert a live reference to a heading, figure, table, or bookmark",["cross","reference","xref","see","figure","heading"],Y(),function(){e.execCommand("insertcrossreference")}),e.restrictedEditing&&t("Tools","restrictedediting","Restricted editing","Lock the document and mark only the regions others may edit",["restrict","lock","protect","editable","region","permission"],G(),function(){e.execCommand("restrictedediting")}),e.dictation&&t("Tools","dictation","Dictation","Speak and have your words typed into the document",["dictate","speech","voice","microphone","talk"],W(),function(){e.execCommand("dictation")}),typeof e.copyAsMarkdown=="function"&&(t("Tools","copymarkdown","Copy as Markdown","Copy the whole document to the clipboard as Markdown",["markdown","md","copy","clipboard","export"],Z(),function(){e.copyAsMarkdown()}),t("Tools","downloadmarkdown","Download as Markdown","Save the document as a .md file",["markdown","md","download","export","save","file"],Z(),function(){e.downloadMarkdown()})),typeof e.toggleTypewriterMode=="function"&&(t("Tools","typewriter","Typewriter mode","Keep the caret line centred as you type",["typewriter","center","scroll","focus","distraction","zen"],Ue(),function(){e.toggleTypewriterMode()}),t("Tools","focusmode","Focus mode","Dim everything except the current paragraph",["focus","dim","highlight","distraction","zen","concentrate"],Ve(),function(){e.toggleFocusMode()})),t("Insert","table","Table","Insert a table",["grid","rows","columns"],y(),function(){e.execCommand("inserttable")}),t("Insert","image","Image","Upload or embed an image",["picture","photo","img"],xe(),function(){e.execCommand("imageupload")}),t("Insert","link","Link","Insert a hyperlink",["url","anchor"],we(),function(){e.execCommand("insertlink")}),t("Insert","emoji","Emoji","Insert an emoji",["smiley","icon"],be(),function(){e.execCommand("insertemoji")}),t("Insert","template","Template","Insert from template gallery",["snippet"],Ce(),function(){e.execCommand("inserttemplate")}),t("Insert","date","Today's date","Insert the current date",["time","now"],ye(),function(){e.execCommand("insertdate")}),d.slashCommandIncludeAi&&Array.isArray(d.aiToolkitActions))for(var c=0;c<d.aiToolkitActions.length;c++)(function(r){o.push(b({id:"ai-"+r.id,section:"AI",title:r.title||r.id,description:r.description||"",keywords:["ai",r.id],iconSvg:d["svgCode_aiassist_"+(r.icon||r.id)]||d.svgCode_aiassist||"",run:function(){var u=e.aiToolkit;if(u){if(r.id==="chat-panel"&&typeof u.openChatPanel=="function"){u.openChatPanel();return}if(r.id==="review-panel"&&typeof u.openReviewPanel=="function"){u.openReviewPanel();return}if(r.id==="open-dialog"&&typeof u.openDialog=="function"){u.openDialog();return}if(typeof u.runQuickAction=="function"){u.runQuickAction(r.id);return}typeof u.resolveAction=="function"&&u.resolveAction(r.id)}}}))})(d.aiToolkitActions[c]);return o}function re(o){if(!E){if(a)switch(o.key){case"ArrowDown":o.preventDefault(),o.stopPropagation(),_(1);return;case"ArrowUp":o.preventDefault(),o.stopPropagation(),_(-1);return;case"Enter":case"Tab":if(m.length){o.preventDefault(),o.stopPropagation(),A();return}f();return;case"Escape":case"Esc":o.preventDefault(),o.stopPropagation(),f();return}if(o.key===d.slashCommandTrigger&&!o.ctrlKey&&!o.metaKey&&!o.altKey){if(!ae())return;R=!1,setTimeout(function(){R||O(!1)},0)}}}function ie(){a&&se()}function ae(){var o=e.getSelection();if(!o||o.rangeCount===0||!o.isCollapsed)return!1;for(var t=o.getRangeAt(0),n=t.startContainer,i=t.startOffset,s=e.getEditable(),l=n.nodeType===1?n:n.parentNode;l&&l!==s;){var c=l.nodeName;if(c==="CODE"||c==="PRE")return!1;l=l.parentNode}if(n.nodeType===3){if(i===0)return!0;var r=n.nodeValue.charAt(i-1);return/\s/.test(r)}return!0}function O(o){B(),f();var t=e.getSelection();if(!(!t||t.rangeCount===0)){var n=t.getRangeAt(0).cloneRange();g={range:n,startNode:n.startContainer,startOffset:n.startOffset,triggerCharCount:o?0:1,query:""},le(),L(),z("")}}function f(){a&&a.parentNode&&a.parentNode.removeChild(a),a=null,g=null,m=[],p=0}function se(){if(g){var o=e.getSelection();if(!o||o.rangeCount===0||!o.isCollapsed){f();return}var t=o.getRangeAt(0),n=t.startContainer;if(n!==g.startNode){f();return}var i=t.startOffset;if(i<g.startOffset){f();return}var s=(n.nodeType===3?n.nodeValue:"")||"",l=s.substring(g.startOffset,i);if(/\s/.test(l)){f();return}g.query=l,z(l),L()}}function z(o){var t=(o||"").toLowerCase();m=h.filter(function(n){if(!t||n.title.toLowerCase().indexOf(t)!==-1||n.description&&n.description.toLowerCase().indexOf(t)!==-1)return!0;for(var i=0;i<n.keywords.length;i++)if(String(n.keywords[i]).toLowerCase().indexOf(t)!==-1)return!0;return!1}).slice(0,d.slashCommandMaxItems),p=0,ce()}function le(){v=e.iframe.ownerDocument,a=v.createElement("div"),a.className="rte-slash-popup";try{var o=e.container||e.getEditable&&e.getEditable().closest&&e.getEditable().closest(".richtexteditor");o&&o.classList&&o.classList.contains("rte-dark")&&(a.className+=" rte-slash-popup-dark")}catch{}a.setAttribute("role","listbox"),a.setAttribute("aria-label","Slash commands"),v.body.appendChild(a)}function ce(){if(a){if(a.innerHTML="",!m.length){var o=v.createElement("div");o.className="rte-slash-empty",o.textContent="No matching commands",a.appendChild(o);return}for(var t="",n=0;n<m.length;n++)(function(i,s){if(i.section!==t){var l=v.createElement("div");l.className="rte-slash-section",l.textContent=i.section,a.appendChild(l),t=i.section}var c=v.createElement("button");c.type="button",c.className="rte-slash-item"+(s===p?" rte-slash-item-active":""),c.setAttribute("role","option"),c.setAttribute("aria-selected",s===p?"true":"false"),c.setAttribute("data-index",s);var r=v.createElement("span");r.className="rte-slash-item-icon",r.innerHTML=i.iconSvg||Me(),c.appendChild(r);var u=v.createElement("span");u.className="rte-slash-item-body";var x=v.createElement("span");if(x.className="rte-slash-item-title",x.textContent=i.title,u.appendChild(x),i.description){var w=v.createElement("span");w.className="rte-slash-item-desc",w.textContent=i.description,u.appendChild(w)}c.appendChild(u),c.addEventListener("mousedown",function(k){k.preventDefault(),k.stopPropagation(),p=s,A()}),c.addEventListener("click",function(k){a&&(k.preventDefault(),k.stopPropagation(),p=s,A())}),c.addEventListener("mouseenter",function(){p!==s&&(p=s,q())}),a.appendChild(c)})(m[n],n)}}function q(){if(a){for(var o=a.querySelectorAll(".rte-slash-item"),t=0;t<o.length;t++){var n=+o[t].getAttribute("data-index"),i=n===p;o[t].classList.toggle("rte-slash-item-active",i),o[t].setAttribute("aria-selected",i?"true":"false")}de()}}function de(){if(a){var o=a.querySelector(".rte-slash-item-active");if(o){var t=o.offsetTop,n=t+o.offsetHeight;t<a.scrollTop?a.scrollTop=t:n>a.scrollTop+a.clientHeight&&(a.scrollTop=n-a.clientHeight)}}}function _(o){m.length&&(p=(p+o+m.length)%m.length,q())}function A(){if(!m.length){f();return}var o=m[p],t=g;if(f(),!(!o||!t)){ue(t);var n=e.getDocument();n.activeElement!==e.getEditable()&&!n.hasFocus()&&e.focus();try{o.run(e)}catch(i){console.warn("Slash command failed:",i)}}}function ue(o){var t=o.startNode;if(t){var n=o.startOffset-(o.triggerCharCount||0);n<0&&(n=0);var i=e.getSelection();if(!(!i||i.rangeCount===0)){var s=i.getRangeAt(0),l,c;t.nodeType===3&&s.startContainer===t?(l=t,c=s.startOffset):(l=s.startContainer,c=s.startOffset);var r=e.getDocument().createRange();r.setStart(t,n),r.setEnd(l,c);try{r.deleteContents()}catch{return}i.removeAllRanges(),i.addRange(r)}}}function L(){if(!(!a||!g)){var o=e.iframe,t=o.getBoundingClientRect(),n=g.range.getClientRects(),i=n&&n.length?n[n.length-1]:null;i||(i=g.range.getBoundingClientRect());var s=t.left+(i.left||0)+window.pageXOffset,l=t.top+(i.bottom||i.top||0)+window.pageYOffset+4;a.style.position="absolute",a.style.left=s+"px",a.style.top=l+"px";var c=window.innerHeight||document.documentElement.clientHeight,r=a.getBoundingClientRect();r.bottom>c-8&&t.top+(i.top||0)>r.height+16&&(a.style.top=t.top+(i.top||0)+window.pageYOffset-r.height-4+"px")}}function U(){a&&L()}function he(){var o=e&&e.iframe&&e.iframe.ownerDocument||document;if(!o.querySelector("style[data-rte-slashcommand]")){var t=o.createElement("style");t.setAttribute("data-rte-slashcommand","1"),t.textContent=["/* 2026-07-03 slash command polish */",".rte-slash-popup{position:absolute;z-index:2147483000;min-width:280px;max-width:min(390px,calc(100vw - 24px));max-height:min(360px,64vh);overflow-y:auto;overscroll-behavior:contain;padding:6px;background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,251,255,.96));background-clip:padding-box;border:1px solid rgba(148,163,184,.22);box-shadow:0 16px 36px rgba(29,78,216,.14),0 2px 8px rgba(15,23,42,.08);border-radius:8px;font-family:Aptos,'Segoe UI',sans-serif;font-size:13px;color:#172033;scrollbar-width:thin}",".rte-slash-section{position:sticky;top:0;z-index:1;margin:4px 0 2px;padding:6px 8px 4px;background:linear-gradient(180deg,rgba(248,251,255,.98),rgba(248,251,255,.86));color:#52657e;font-size:10px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}",".rte-slash-item{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:8px;width:100%;min-height:40px;padding:6px 8px;border:0;background:transparent;text-align:left;cursor:pointer;color:inherit;font:inherit;border-radius:8px}",".rte-slash-item:hover,.rte-slash-item-active{background:#eef4ff;color:#1559d6}",".rte-slash-item:focus-visible{outline:2px solid rgba(37,99,235,.22);outline-offset:2px}",".rte-slash-item-icon{flex:0 0 28px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;color:#315277;background:#ffffff;border-radius:8px;box-shadow:inset 0 0 0 1px rgba(148,163,184,.18)}",".rte-slash-item-active .rte-slash-item-icon{color:#1559d6;background:#ffffff}",".rte-slash-item-icon svg{display:block;width:16px;height:16px;pointer-events:none}",".rte-slash-item-body{display:flex;flex-direction:column;min-width:0;flex:1}",".rte-slash-item-title{font-weight:780;font-size:13px;line-height:1.24;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-slash-item-desc{font-size:11px;color:#64748b;line-height:1.24;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-slash-item-active .rte-slash-item-desc{color:#315277}",".rte-slash-empty{padding:16px;color:#52657e;font-size:12px;font-weight:700;text-align:center}",".rte-slash-popup-dark{background:linear-gradient(180deg,#1e293b,#0f172a);border-color:#334155;color:#e2e8f0;box-shadow:0 20px 46px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.4)}",".rte-slash-popup-dark .rte-slash-section{background:linear-gradient(180deg,rgba(30,41,59,.98),rgba(30,41,59,.86));color:#94a3b8}",".rte-slash-popup-dark .rte-slash-item:hover,.rte-slash-popup-dark .rte-slash-item-active{background:#1d4ed8;color:#fff}",".rte-slash-popup-dark .rte-slash-item-icon{color:#cbd5e1;background:#0f172a;box-shadow:inset 0 0 0 1px rgba(148,163,184,.25)}",".rte-slash-popup-dark .rte-slash-item-active .rte-slash-item-icon{color:#fff;background:#1e3a8a}",".rte-slash-popup-dark .rte-slash-item-desc{color:#94a3b8}",".rte-slash-popup-dark .rte-slash-item-active .rte-slash-item-desc{color:#dbeafe}",".rte-slash-popup-dark .rte-slash-empty{color:#94a3b8}"].join(`
|
|
2
|
+
`),o.head.appendChild(t),e&&typeof e.ensureStyleSheetLive=="function"&&e.ensureStyleSheetLive(o,t,"rte-slashcommand-style",t.textContent)}}function S(o){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 4v16"/><path d="M14 4v16"/><path d="M6 12h8"/><text x="16" y="18" font-size="9" font-weight="700" fill="currentColor" stroke="none" font-family="-apple-system,Segoe UI,sans-serif">'+o+"</text></svg>"}function pe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 4h5"/><path d="M13 4v16"/><path d="M17 4v16"/><path d="M13 4a4 4 0 000 8h0"/></svg>'}function fe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="5" cy="7" r="1"/><circle cx="5" cy="12" r="1"/><circle cx="5" cy="17" r="1"/><path d="M9 7h11"/><path d="M9 12h11"/><path d="M9 17h11"/></svg>'}function ge(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h1v3"/><path d="M4 9h2"/><path d="M4 14h2a1 1 0 010 2H4v1h2"/><path d="M9 7h11"/><path d="M9 12h11"/><path d="M9 17h11"/></svg>'}function me(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 8c-2 0-3 1.5-3 4s1 4 3 4V8z"/><path d="M16 8c-2 0-3 1.5-3 4s1 4 3 4V8z"/></svg>'}function ve(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 8l-4 4 4 4"/><path d="M15 8l4 4-4 4"/></svg>'}function ke(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12h16"/><path d="M4 6h10"/><path d="M4 18h10"/></svg>'}function y(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="5" width="16" height="14" rx="1"/><path d="M4 10h16"/><path d="M4 15h16"/><path d="M10 5v14"/><path d="M16 5v14"/></svg>'}function xe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><circle cx="9" cy="10" r="1.5"/><path d="M21 16l-5-5-8 8"/></svg>'}function we(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 14a4 4 0 005.7 0l3-3a4 4 0 10-5.7-5.7L11 7"/><path d="M14 10a4 4 0 00-5.7 0l-3 3a4 4 0 105.7 5.7L13 17"/></svg>'}function be(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M8 14c1 1.5 2.5 2 4 2s3-.5 4-2"/><circle cx="9" cy="10" r=".8"/><circle cx="15" cy="10" r=".8"/></svg>'}function Ce(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M4 9h16"/><path d="M9 9v11"/></svg>'}function ye(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="6" width="16" height="14" rx="1.5"/><path d="M4 10h16"/><path d="M9 3v4"/><path d="M15 3v4"/></svg>'}function Me(){return'<svg viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="3"/></svg>'}function Te(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M12 9v4"/><path d="M12 16h.01"/></svg>'}function Ee(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="7" height="16" rx="1"/><rect x="14" y="4" width="7" height="16" rx="1"/></svg>'}function Be(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg>'}function Ie(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 5h9l-5 14"/><path d="M14 11h6"/><path d="M14 16h6"/></svg>'}function Ae(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 10h18"/><circle cx="7" cy="7.5" r=".6" fill="currentColor"/></svg>'}function V(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 17l4-10 4 10"/><path d="M5.5 13.5h5"/><path d="M14 14a2.5 2.5 0 105 0v-3"/><path d="M14 20l2 2 4-4"/></svg>'}function K(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="7" width="18" height="10" rx="5"/><circle cx="8" cy="12" r="1.6"/><path d="M12 12h6"/></svg>'}function Le(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M4 7l8 6 8-6"/></svg>'}function Se(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="6" height="5" rx="1"/><rect x="15" y="3" width="6" height="5" rx="1"/><rect x="9" y="16" width="6" height="5" rx="1"/><path d="M6 8v3h12V8M12 11v5"/></svg>'}function W(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 9v6h4l5 4V5L8 9H4z"/><path d="M16 8.5a4 4 0 010 7"/><path d="M19 6a7 7 0 010 12"/></svg>'}function Q(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v18"/><path d="M8 7l4-4 4 4"/><path d="M8 17l4 4 4-4"/></svg>'}function j(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6H10a3 3 0 000 6h3"/><path d="M13 6v12"/><path d="M17 6v12"/><path d="M7 18l-3-3 3-3"/></svg>'}function je(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 6H7a3 3 0 000 6h3"/><path d="M11 6v12"/><path d="M7 6v12"/><path d="M17 12l3 3-3 3"/></svg>'}function De(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 4v16"/><path d="M17 4v16"/><path d="M13 4H9a4 4 0 000 8h4"/></svg>'}function Re(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 15l4-5 3 3 3-4"/></svg>'}function Pe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h1v4"/><path d="M4 14h2l-2 3h2"/><path d="M10 7h10"/><path d="M10 12h10"/><path d="M10 17h10"/></svg>'}function D(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 4v16"/><path d="M4 8l3-4 3 4"/><path d="M14 6h6"/><path d="M14 12h5"/><path d="M14 18h3"/></svg>'}function G(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3l6 6L9 21H3v-6z"/><path d="M13 5l6 6"/></svg>'}function He(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 13a4 4 0 005.7 0l2-2a4 4 0 10-5.7-5.7l-1 1"/><path d="M13 11a4 4 0 00-5.7 0l-2 2a4 4 0 105.7 5.7l1-1"/><path d="M16 18l2 2 4-4"/></svg>'}function X(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4H7a2 2 0 00-2 2v3a2 2 0 01-2 2 2 2 0 012 2v3a2 2 0 002 2h2"/><path d="M15 4h2a2 2 0 012 2v3a2 2 0 002 2 2 2 0 00-2 2v3a2 2 0 01-2 2h-2"/></svg>'}function Y(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h8"/><path d="M4 12h5"/><path d="M4 17h8"/><path d="M14 12h6"/><path d="M17 9l3 3-3 3"/></svg>'}function Fe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h7"/><path d="M4 11h9"/><path d="M4 16h5"/><path d="M17 6h3"/><path d="M17 11h3"/><path d="M17 16h3"/></svg>'}function Ne(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h9"/><path d="M4 11h9"/><path d="M4 18h16"/><path d="M17 4v6"/><path d="M20 7h-6"/></svg>'}function Oe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 3h11a2 2 0 012 2v4a2 2 0 01-2 2H6z"/><path d="M12 11v3"/><path d="M10 14h4v5a2 2 0 01-4 0z"/></svg>'}function M(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 18L8 6l5 12"/><path d="M4.6 14.5h6.8"/><path d="M21 11.5a3 3 0 00-6 0"/><path d="M21 11.5V18"/><path d="M21 15.5a3 3 0 11-6 0 3 3 0 016 0z"/></svg>'}function ze(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="7" height="7" rx="1.5"/><path d="M4.5 7.5 6 9l2.5-3"/><line x1="13" y1="6" x2="21" y2="6"/><line x1="13" y1="13" x2="21" y2="13"/><line x1="3" y1="17" x2="21" y2="17"/><line x1="3" y1="20.5" x2="14" y2="20.5"/></svg>'}function J(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l3 3 3-3"/><path d="M9 18l3-3 3 3"/><line x1="4" y1="12" x2="20" y2="12"/></svg>'}function qe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.01M10 10h.01M14 10h.01M18 10h.01M6 14h.01M18 14h.01M9 14h6"/></svg>'}function _e(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="10.5" cy="10.5" r="6.5"/><line x1="15.5" y1="15.5" x2="21" y2="21"/></svg>'}function Ue(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="9" width="18" height="7" rx="1"/><path d="M7 9V5h10v4"/><line x1="7" y1="20" x2="17" y2="20"/></svg>'}function Ve(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M3 12h3M18 12h3M12 3v3M12 18v3"/></svg>'}function Z(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="5" width="20" height="14" rx="2"/><path d="M6 15V9l3 3 3-3v6"/><path d="M17 9v6M14.5 12.5L17 15l2.5-2.5"/></svg>'}function Ke(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 21V9a7 7 0 0114 0v12l-3-2-2 2-2-2-2 2-3-2z"/><circle cx="9.5" cy="10" r="1" fill="currentColor"/><circle cx="14.5" cy="10" r="1" fill="currentColor"/></svg>'}function We(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/><path d="M9 13h6M9 17h4"/></svg>'}function $(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/><path d="M8.5 12l1.3 5 2.2-3.6 2.2 3.6 1.3-5"/></svg>'}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_smartchips=RTE_Plugin_SmartChips,RTE_DefaultConfig.chipResolver=RTE_DefaultConfig.chipResolver||null,RTE_DefaultConfig.chipDateFormat=RTE_DefaultConfig.chipDateFormat||null;function RTE_Plugin_SmartChips(){var g=this,b,o;g.PluginName="SmartChips",g.InitConfig=function(e){b=e},g.InitEditor=function(e){o=e,o.attachEvent("exec_command_insertdatechip",function(t){t.returnValue=!0,g.OpenDateChip()}),o.attachEvent("exec_command_insertchip",function(t){t.returnValue=!0,g.OpenChipMenu()}),_()};function a(e,t,i,n){var s=e.ownerDocument.createElement(t);return i&&(s.style.cssText=i),n&&(s.className=n),e.appendChild(s),s}function k(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function y(e){if(b.chipDateFormat&&typeof b.chipDateFormat=="function")try{return String(b.chipDateFormat(e))}catch{}return M[e.getMonth()]+" "+e.getDate()+", "+e.getFullYear()}function R(e){function t(i){return(i<10?"0":"")+i}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())}var A={date:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><rect x="2" y="3" width="12" height="11" rx="1.5"/><path d="M2 6.5h12"/><path d="M5 1.5v3"/><path d="M11 1.5v3"/></svg>',person:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><circle cx="8" cy="5" r="2.6"/><path d="M3 13.5c0-2.5 2.2-4 5-4s5 1.5 5 4"/></svg>',link:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M6.5 9.5a3 3 0 004.2 0l2-2a3 3 0 10-4.2-4.2L7.4 4.3"/><path d="M9.5 6.5a3 3 0 00-4.2 0l-2 2a3 3 0 104.2 4.2l1-1"/></svg>'};function I(e,t,i,n){var s=A[e]||"",l='class="rte-chip rte-chip-'+k(e)+'" data-rte-chip="'+k(e)+'" data-rte-chip-value="'+k(i||t)+'" contenteditable="false"',u='<span class="rte-chip-icon">'+s+'</span><span class="rte-chip-label">'+k(t)+"</span>";if(e==="link"&&n){var d=/^(javascript|data|vbscript):/i.test(n)?"#":n;return"<a "+l+' href="'+k(d)+'" target="_blank" rel="noopener noreferrer">'+u+"</a>"}return"<span "+l+">"+u+"</span>"}function x(e,t,i,n){_(),o.insertHTML(I(e,t,i,n)+"\u200B"),o.focus()}g.OpenDateChip=function(){var e=o.createDialog(o.getLangText&&o.getLangText("insertdatechiptitle")||"Date","rte-dialog-datechip"),t=typeof e.close=="function"?function(){e.close()}:function(){o.closeCurrentPopup()},i=a(e,"div","","rte-chip-dialog rte-chip-date-dialog");a(i,"div","","rte-chip-dialog-copy").textContent="Choose a quick date or insert a custom date chip.";function n(h,v){var r=a(i,"button","","rte-chip-quick");return r.type="button",r.textContent=h+" \u2014 "+y(v),r.onmouseover=function(){r.style.background="#eef2ff"},r.onmouseout=function(){r.style.background="transparent"},r.textContent="",a(r,"span","","rte-chip-quick-label").textContent=h,a(r,"span","","rte-chip-quick-value").textContent=y(v),r.onmouseover=null,r.onmouseout=null,r.setAttribute("aria-label","Insert "+h+", "+y(v)),r.onclick=function(){t(),x("date",y(v),R(v))},r}var s=new Date(o.__chipNow||Date.now());function l(h,v){var r=new Date(h.getTime());return r.setDate(r.getDate()+v),r}n("Today",s),n("Tomorrow",l(s,1)),n("Yesterday",l(s,-1)),n("Next week",l(s,7));var u=a(i,"div","","rte-chip-pick-row"),d=a(u,"input","","rte-chip-input");d.type="date",d.value=R(s),d.setAttribute("aria-label","Custom date");var C=a(u,"button","","rte-chip-action rte-chip-action-primary");C.type="button",C.textContent="Insert",C.onclick=function(){var h=(d.value||"").split("-");if(h.length===3){var v=new Date(parseInt(h[0],10),parseInt(h[1],10)-1,parseInt(h[2],10));t(),x("date",y(v),d.value)}else t()},setTimeout(function(){d.focus()},0)},g.OpenChipMenu=function(){var e=o.createDialog(o.getLangText&&o.getLangText("insertchiptitle")||"Insert chip","rte-dialog-chip"),t=typeof e.close=="function"?function(){e.close()}:function(){o.closeCurrentPopup()},i=a(e,"div","","rte-chip-dialog rte-chip-menu-dialog");a(i,"div","","rte-chip-dialog-copy").textContent="Insert a date, person, or link chip into the document.";var n=a(i,"div","","rte-chip-type-tabs");n.setAttribute("role","tablist"),n.setAttribute("aria-label","Chip type");var s=[["date","Date"],["person","Person"],["link","Link"]],l="date",u=a(i,"div","","rte-chip-dialog-body"),d={};s.forEach(function(r){var p=a(n,"button","","rte-chip-type-tab");p.type="button",p.textContent=r[1],p.setAttribute("role","tab"),p.setAttribute("aria-selected",r[0]===l?"true":"false"),d[r[0]]=p,p.onclick=function(){l=r[0],C(),h()}});function C(){s.forEach(function(r){var p=r[0]===l;d[r[0]].classList.toggle("is-selected",p),d[r[0]].setAttribute("aria-selected",p?"true":"false")})}function h(){if(u.innerHTML="",l==="date"){var r=a(u,"div","","rte-chip-field-label");r.textContent="Insert a date chip:";var p=a(u,"input","","rte-chip-input");p.type="date",p.value=R(new Date(o.__chipNow||Date.now())),p.setAttribute("aria-label","Date chip value"),v(function(){var c=(p.value||"").split("-");if(c.length===3){var T=new Date(+c[0],+c[1]-1,+c[2]);t(),x("date",y(T),p.value)}})}else{var D=a(u,"div","","rte-chip-field-label");D.textContent=l==="person"?"Name (or search):":"URL:";var f=a(u,"input","","rte-chip-input");f.type=l==="link"?"url":"text",f.placeholder=l==="person"?"Jane Doe":"https://example.com",f.setAttribute("aria-label",l==="person"?"Person chip name":"Link chip URL");var w=a(u,"div","","rte-chip-results");w.setAttribute("role","listbox"),w.setAttribute("aria-label","Chip suggestions"),b.chipResolver&&typeof b.chipResolver=="function"&&(f.oninput=function(){var c=f.value.trim();if(w.innerHTML="",!!c)try{var T=b.chipResolver(c,l);T&&T.then&&T.then(function(L){w.innerHTML="",(L||[]).slice(0,6).forEach(function(m){var E=a(w,"button","","rte-chip-suggestion");E.type="button",E.textContent=m.label||m.value,E.setAttribute("role","option"),E.onclick=function(){t(),x(l,m.label||m.value,m.value||m.label,m.href)}})})}catch{}}),v(function(){var c=f.value.trim();if(!c){t();return}if(l==="link"){if(/^(javascript|data|vbscript|file):/i.test(c)){f.style.borderColor="#dc2626",f.placeholder="Enter a valid http(s) URL",f.value="";return}if(!/^https?:\/\//i.test(c))if(/^[a-z0-9.-]+\.[a-z]{2,}([\/?#].*)?$/i.test(c))c="https://"+c;else{f.style.borderColor="#dc2626",f.placeholder="Enter a valid http(s) URL",f.value="";return}t(),x("link",c.replace(/^https?:\/\//i,"").replace(/\/$/,""),c,c)}else t(),x("person",c,c)}),setTimeout(function(){f.focus()},0)}}function v(r){var p=a(u,"div","","rte-chip-dialog-footer"),D=a(p,"button","","rte-chip-action rte-chip-action-primary");D.type="button",D.textContent="Insert",D.onclick=r}C(),h()};function _(){var e=[".rte-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px 2px 6px;margin:0 1px;border:1px solid rgba(100,116,139,.16);border-radius:999px;background:linear-gradient(180deg,#f8fbff,#eef4ff);color:#315277;font-size:.92em;line-height:1.45;white-space:nowrap;text-decoration:none;vertical-align:baseline;cursor:default;user-select:none;box-shadow:0 1px 2px rgba(15,23,42,.06)}",".rte-chip-icon{display:inline-flex;align-items:center;opacity:.9}",".rte-chip-date{background:linear-gradient(180deg,#f0fdff,#e6f8fb);color:#0e7490;border-color:rgba(14,116,144,.18)}",".rte-chip-person{background:linear-gradient(180deg,#f6f7ff,#eef2ff);color:#3730a3;border-color:rgba(55,48,163,.18)}",".rte-chip-link{background:linear-gradient(180deg,#f5fff8,#ecfdf4);color:#15803d;border-color:rgba(21,128,61,.18);cursor:pointer}",".rte-chip-link:hover{text-decoration:underline}"].join(`
|
|
2
|
+
`);try{var t=o.getDocument();if(!t)return;var i=t.head||t.getElementsByTagName&&t.getElementsByTagName("head")[0]||t.documentElement;if(i&&!t.querySelector("style[data-rte-smartchips]")){var n=t.createElement("style");n.setAttribute("data-rte-smartchips","1"),n.textContent=e,i.appendChild(n),o&&typeof o.ensureStyleSheetLive=="function"&&o.ensureStyleSheetLive(t,n,"rte-smartchips-st",n.textContent)}}catch{}}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_spellcheck=RTE_Plugin_SpellCheck,RTE_DefaultConfig.spellCheckResolver=RTE_DefaultConfig.spellCheckResolver||null,typeof RTE_DefaultConfig.spellCheckEnabled>"u"&&(RTE_DefaultConfig.spellCheckEnabled=!0);function RTE_Plugin_SpellCheck(){var u=this,s,e;u.PluginName="SpellCheck",u.InitConfig=function(t){s=t},u.InitEditor=function(t){e=t;try{var r=e.getEditable&&e.getEditable();r&&r.setAttribute("spellcheck",s.spellCheckEnabled===!1?"false":"true")}catch{}e.attachEvent("exec_command_spellcheck",function(n){n.returnValue=!0,u.RunSpellCheck()}),R()};function c(t,r,n,o){var i=t.ownerDocument.createElement(r);return n&&(i.style.cssText=n),o&&(i.className=o),t.appendChild(i),i}function C(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function E(t){try{!e.InvokeEventHook||e.InvokeEventHook("customdialog","spellcheck",t)}catch{}try{var r=e.getEditable(),n=r.ownerDocument,o=n.createElement("div");o.className="rte-spell-toast",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.textContent=t,n.body.appendChild(o),setTimeout(function(){o.parentNode&&o.parentNode.removeChild(o)},2600)}catch{}}function S(t,r){try{for(var n=e.getEditable(),o=e.getDocument(),i=o.createTreeWalker(n,NodeFilter.SHOW_TEXT,null),l,g=new RegExp("\\b"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b");l=i.nextNode();){var d=l.parentNode;if(!(d&&(d.nodeName==="CODE"||d.nodeName==="PRE"))){var p=l.data.search(g);if(p>=0)return l.data=l.data.substring(0,p)+r+l.data.substring(p+t.length),!0}}}catch{}return!1}u.RunSpellCheck=function(){if(!s.spellCheckResolver||typeof s.spellCheckResolver!="function"){try{var t=e.getEditable();t.setAttribute("spellcheck","true"),t.focus()}catch{}E(e.getLangText&&e.getLangText("spellchecknative")||"Browser spell-check is on \u2014 misspellings are underlined as you type.");return}var r;try{r=e.getEditable().innerText||""}catch{r=""}if(!r.trim()){E("Nothing to check.");return}var n=e.createDialog(e.getLangText&&e.getLangText("spellchecktitle")||"Spelling","rte-dialog-spell"),o=typeof n.close=="function"?function(){n.close()}:function(){e.closeCurrentPopup()},i=c(n,"div","box-sizing:border-box;width:min(420px,calc(100vw - 32px));max-height:60vh;overflow:auto;padding:14px;font:13px -apple-system,Segoe UI,sans-serif"),l=c(i,"div","color:#64748b;margin-bottom:8px");l.innerText="Checking\u2026";var g=c(i,"div","");function d(a){if(g.innerHTML="",!a||!a.length){l.innerText=e.getLangText&&e.getLangText("spellcheckclean")||"No spelling issues found.";return}l.innerText=a.length+" issue"+(a.length===1?"":"s")+" found.",a.forEach(function(f){if(!(!f||!f.word)){var b=c(g,"div","padding:8px 0;border-bottom:1px solid rgba(15,23,42,.08)","rte-spell-row"),T=c(b,"div","font-weight:600;color:#b91c1c;margin-bottom:4px");T.textContent=f.word;var k=c(b,"div","display:flex;flex-wrap:wrap;gap:6px"),w=(f.suggestions||[]).slice(0,6);w.length||(c(k,"span","font-size:12px;color:#94a3b8").textContent="(no suggestions)"),w.forEach(function(m){var y=c(k,"button","font-size:12px;padding:4px 9px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fbff;color:#315277;cursor:pointer");y.type="button",y.textContent=m,y.onclick=function(){S(f.word,m)&&(b.style.opacity="0.45",T.innerHTML=C(f.word)+' → <span style="color:#16a34a">'+C(m)+"</span>",k.innerHTML="")}})}})}var p=!1;function x(a){p||(p=!0,d(a))}try{var h=s.spellCheckResolver(r);h&&typeof h.then=="function"?(h.then(function(a){x(a||[])},function(){l.innerText="Spell-check service error."}),setTimeout(function(){p||(l.innerText="Spell-check timed out.",p=!0)},12e3)):x(h||[])}catch{l.innerText="Spell-check error."}var D=c(i,"div","display:flex;justify-content:flex-end;margin-top:12px"),v=c(D,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");v.type="button",v.textContent="Done",v.onclick=function(){o(),e.focus()}};function R(){var t=["/* 2026-07-12 spell-check feedback precision */",".rte-spell-toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);max-width:calc(100vw - 32px);padding:9px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#172033;font:600 13px/1.35 -apple-system,Segoe UI,sans-serif;z-index:2147483600;box-shadow:0 10px 24px rgba(15,23,42,.14)}",".rte-spell-row:last-child{border-bottom:0}"].join(`
|
|
2
|
+
`);try{var r=e&&e.iframe&&e.iframe.ownerDocument||document;if(!r.querySelector("style[data-rte-spellcheck]")){var n=r.createElement("style");n.setAttribute("data-rte-spellcheck","1"),n.textContent=t,(r.head||r.documentElement).appendChild(n),e&&typeof e.ensureStyleSheetLive=="function"&&e.ensureStyleSheetLive(r,n,"rte-spellcheck-st",n.textContent)}}catch{}}}
|