@richscripts/richtexteditor 2.9.0 → 2.10.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.
@@ -67,10 +67,10 @@ endstream
67
67
  `),(b.head||b.getElementsByTagName("head")[0]).appendChild(m),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(b,m,"__rte_restrictedediting_styles",m.textContent)}}}function z(){var q=F();if(!q)return!1;x=!0,q.classList.add("rte-restricted");for(var b=0;b<q.children.length;b++){var m=q.children[b];m.querySelector("["+H+"='true']")?(m.setAttribute("contenteditable","true"),m.setAttribute(H+"-wrapper","true")):m.setAttribute("contenteditable","false")}return q.setAttribute("contenteditable","false"),$(),!0}function o(){var q=F();if(!q)return!1;x=!1,q.classList.remove("rte-restricted");for(var b=q.querySelectorAll("[contenteditable]"),m=0;m<b.length;m++)b[m].removeAttribute("contenteditable"),b[m].removeAttribute(H+"-wrapper");return q.setAttribute("contenteditable","true"),!0}function O(q){q=q||{};var b=F();if(!b)return null;var m=b.ownerDocument,k=m.getSelection();if(!k||k.rangeCount===0)return null;var M=k.getRangeAt(0);if(M.collapsed)return null;var I=m.createElement("span");I.setAttribute(H,"true"),q.label&&I.setAttribute("aria-label",q.label);try{M.surroundContents(I)}catch{var R=M.extractContents();I.appendChild(R),M.insertNode(I)}var l=m.createRange();return l.selectNodeContents(I),k.removeAllRanges(),k.addRange(l),$(),x&&z(),I}function V(q){if(q=q||(function(){var m=F(),k=m&&m.ownerDocument.getSelection();if(!k||k.rangeCount===0)return null;for(var M=k.anchorNode;M&&M!==m;){if(M.nodeType===1&&M.getAttribute&&M.getAttribute(H)==="true")return M;M=M.parentNode}return null})(),!q)return!1;for(var b=q.parentNode;q.firstChild;)b.insertBefore(q.firstChild,q);return b.removeChild(q),x&&z(),!0}function K(){var q=F();return q?Array.prototype.slice.call(q.querySelectorAll("["+H+"='true']")):[]}function W(q){var b=K();if(b.length===0)return null;var m=F(),k=m&&m.ownerDocument.getSelection(),M=null;if(k&&k.anchorNode)for(var I=k.anchorNode;I&&I!==m;){if(I.nodeType===1&&I.getAttribute&&I.getAttribute(H)==="true"){M=I;break}I=I.parentNode}var R=M?b.indexOf(M):-1,l=b[(R+q+b.length)%b.length];if(!l)return null;var f=m.ownerDocument.createRange();return f.selectNodeContents(l),f.collapse(!1),k.removeAllRanges(),k.addRange(f),l.scrollIntoView({block:"center",behavior:"smooth"}),l}}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 N=this,u,r,x=null,H=null,F="";N.PluginName="RevisionHistory",N.InitConfig=function(d){u=d,u.revisionHistoryEnabled!==!1&&(u.revisionHistoryMaxEntries=u.revisionHistoryMaxEntries||50,u.revisionHistoryAutoSnapshotMs=u.revisionHistoryAutoSnapshotMs||0,u.revisionHistoryUrl=u.revisionHistoryUrl||"",u.revisionHistoryRequestHeaders=u.revisionHistoryRequestHeaders||null,u.onRevisionHistorySyncError=u.onRevisionHistorySyncError||null,u.text_revisionhistory=u.text_revisionhistory||"Revision history",$("toolbar_default","#{revisionhistory}"),$("toolbar_full","#{revisionhistory}"),$("toolbar_mobile","#{revisionhistory}"),(u.controltoolbar_TEXT||"").indexOf("revisionhistory")===-1&&(u.controltoolbar_TEXT=(u.controltoolbar_TEXT||"")+"|{revisionhistory}"))},N.InitEditor=function(d){r=d,u.revisionHistoryEnabled!==!1&&(r.revisionHistory={snapshot:function(w,D){return k(w,D)},promptAndSnapshot:function(w){return M(w)},rename:function(w,D){return I(w,D)},list:function(){return O().slice().sort(function(w,D){return(D.createdAt||0)-(w.createdAt||0)})},listNamed:function(){return O().slice().filter(function(w){return w.isNamed===!0}).sort(function(w,D){return(D.createdAt||0)-(w.createdAt||0)})},get:function(w){return V(w)},restore:function(w,D){return f(w,D||{})},delete:function(w){return _(w)},clear:function(){return v()},diff:function(w,D){return R(w,D)},openBrowser:function(){g()},closeBrowser:function(){h()}},r.toolbarFactoryMap=r.toolbarFactoryMap||{},r.toolbarFactoryMap.revisionhistory=function(w){return r.createToolbarButton(w)},r.attachEvent("exec_command_revisionhistory",function(w){w.returnValue=!0,w.stopBubble=!0,g()}),y(),m(),F=r.getHTML?r.getHTML():"",u.revisionHistoryAutoSnapshotMs>0&&r.getDocument().addEventListener("input",function(){H&&clearTimeout(H),H=setTimeout(function(){var w=r.getHTML();w!==F&&k("Auto",{auto:!0})},u.revisionHistoryAutoSnapshotMs)},!0),r.getDocument().addEventListener("keydown",function(w){(w.ctrlKey||w.metaKey)&&w.shiftKey&&(w.key==="H"||w.key==="h")&&(w.preventDefault(),g())},!0))};function $(d,w){u[d]&&u[d].indexOf(w)===-1&&(u[d]=u[d]+w)}function z(){return u.currentUser&&u.currentUser.id?u.currentUser:{id:"user",name:"User",color:"#64748b"}}function o(){var d=u.aiToolkitPersistenceKey||"default";return"RTE.Revisions."+d}function O(){return r.__revisions||(r.__revisions=[]),r.__revisions}function V(d){for(var w=O(),D=0;D<w.length;D++)if(w[D].id===d)return w[D];return null}function K(){for(var d=O();d.length>u.revisionHistoryMaxEntries;)d.shift();try{window.localStorage&&window.localStorage.setItem(o(),JSON.stringify(d))}catch(w){console.warn("revisionhistory: localStorage quota or access issue:",w&&w.message)}u.revisionHistoryUrl&&W(d)}function W(d){try{var w=new XMLHttpRequest;w.open("POST",u.revisionHistoryUrl,!0),w.setRequestHeader("Content-Type","application/json");var D=q();for(var P in D)if(Object.prototype.hasOwnProperty.call(D,P)&&/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(P)){var B=String(D[P]);if(!/\r|\n/.test(B))try{w.setRequestHeader(P,B)}catch{}}w.onerror=function(){b({reason:"network",status:w.status||0})},w.onload=function(){(w.status<200||w.status>=300)&&b({reason:"http",status:w.status,responseText:(w.responseText||"").slice(0,512)})},w.send(JSON.stringify({documentKey:u.aiToolkitPersistenceKey||"",savedAt:Date.now(),revisions:d}))}catch(Z){b({reason:"exception",error:Z})}}function q(){var d=u.revisionHistoryRequestHeaders;if(typeof d=="function")try{d=d(r)}catch(w){return b({reason:"header-provider",error:w}),{}}return d&&typeof d=="object"?d:{}}function b(d){console.warn("revisionhistory: remote persistence failed:",d&&d.reason,d&&d.status);try{typeof u.onRevisionHistorySyncError=="function"&&u.onRevisionHistorySyncError(d)}catch{}try{typeof r.fireEvent=="function"&&r.fireEvent("revision_history_sync_error",d)}catch{}}function m(){try{if(!window.localStorage)return;var d=window.localStorage.getItem(o());if(!d)return;var w=JSON.parse(d);Array.isArray(w)&&(r.__revisions=w)}catch{}}function k(d,w){var D=r.getHTML?r.getHTML():r.getHTMLCode?r.getHTMLCode():"",P=z(),B=(d||"").toString().slice(0,120),Z=B.length>0&&(!w||w.auto!==!0),fe={id:"rev-"+Date.now()+"-"+Math.floor(Math.random()*1e4),html:D,text:r.getText?r.getText():p(D),label:B||l(),isNamed:Z,author:{id:P.id,name:P.name,color:P.color},createdAt:Date.now(),metadata:w||{}};O().push(fe),F=D,K(),x&&x.isConnected&&A();try{typeof r.fireEvent=="function"&&r.fireEvent("revision_snapshot",{id:fe.id,label:fe.label,isNamed:fe.isNamed,createdAt:fe.createdAt})}catch{}return fe}function M(d){var w=r.iframe?r.iframe.ownerDocument:document,D=w.defaultView||window,P=D.prompt('Name this version (e.g. "Draft sent to legal"):',d||"");if(P===null)return null;var B=(P||"").trim();return B?k(B,{user:!0}):null}function I(d,w){var D=V(d);if(!D)return!1;var P=(w||"").toString().trim().slice(0,120);return P?(D.label=P,D.isNamed=!0,K(),x&&x.isConnected&&A(),!0):!1}function R(d,w){var D=V(d),P=V(w);if(!D||!P)return null;var B=D.text||p(D.html),Z=P.text||p(P.html);return{oldEntry:D,newEntry:P,oldText:B,newText:Z,lines:s(B,Z)}}function l(){var d=new Date;function w(D){return D<10?"0"+D:""+D}return w(d.getHours())+":"+w(d.getMinutes())+":"+w(d.getSeconds())}function f(d,w){w=w||{};var D=V(d);if(!D)return!1;if(!w.skipConfirm){var P=r.iframe?r.iframe.ownerDocument:document;if(!P.defaultView.confirm("Restore this version? Your current content will be replaced (this itself is not auto-snapshotted)."))return!1}return r.setHTMLCode?r.setHTMLCode(D.html):r.setHTML&&r.setHTML(D.html),F=D.html,x&&x.isConnected&&h(),!0}function _(d){for(var w=O(),D=0;D<w.length;D++)if(w[D].id===d)return w.splice(D,1),K(),x&&x.isConnected&&A(),!0;return!1}function v(){r.__revisions=[],K(),x&&x.isConnected&&A()}function s(d,w){for(var D=String(d||"").split(/\r?\n/),P=String(w||"").split(/\r?\n/),B=[],Z=c(D,P),fe=0,re=0,ie=0;fe<D.length&&re<P.length;)ie<Z.length&&D[fe]===Z[ie]&&P[re]===Z[ie]?(B.push({type:"eq",text:D[fe]}),fe++,re++,ie++):ie<Z.length&&D[fe]!==Z[ie]?(B.push({type:"del",text:D[fe]}),fe++):ie<Z.length&&P[re]!==Z[ie]?(B.push({type:"add",text:P[re]}),re++):fe<D.length?(B.push({type:"del",text:D[fe]}),fe++):re<P.length&&(B.push({type:"add",text:P[re]}),re++);for(;fe<D.length;)B.push({type:"del",text:D[fe]}),fe++;for(;re<P.length;)B.push({type:"add",text:P[re]}),re++;return B}function c(d,w){for(var D=d.length,P=w.length,B=new Array(P+1).fill(0),Z=new Array(P+1).fill(0),fe=[],ie=0;ie<=D;ie++)fe.push(new Array(P+1).fill(0));for(var ie=1;ie<=D;ie++)for(var ae=1;ae<=P;ae++)d[ie-1]===w[ae-1]?fe[ie][ae]=fe[ie-1][ae-1]+1:fe[ie][ae]=Math.max(fe[ie-1][ae],fe[ie][ae-1]);for(var re=[],ie=D,ae=P;ie>0&&ae>0;)d[ie-1]===w[ae-1]?(re.unshift(d[ie-1]),ie--,ae--):fe[ie-1][ae]>=fe[ie][ae-1]?ie--:ae--;return re}function p(d){var w=document.createElement("div");return w.innerHTML=d||"",w.innerText||w.textContent||""}function g(){if(!(x&&x.isConnected)&&!(!r||!r.iframe||!r.iframe.ownerDocument)){x&&!x.isConnected&&(x=null);var d=r.iframe.ownerDocument;if(!(!d||!d.body)){x=d.createElement("div");var w=!1;try{var D=r.container||r.getEditable&&r.getEditable().closest&&r.getEditable().closest(".richtexteditor");w=!!(D&&D.classList&&D.classList.contains("rte-dark"))}catch{}x.className="rte-rev-dialog"+(w?" rte-rev-dark":""),x.setAttribute("role","dialog"),x.setAttribute("aria-modal","true"),x.setAttribute("aria-labelledby","rte-rev-dialog-title");var P=d.createElement("div");P.className="rte-rev-backdrop",P.addEventListener("mousedown",function(Z){Z.target===P&&h()});var B=d.createElement("div");B.className="rte-rev-panel",P.appendChild(B),x.appendChild(P),d.body.appendChild(x),A()}}}function h(){x&&x.parentNode&&x.parentNode.removeChild(x),x=null}var L=null,E="preview";function A(){if(x){var d=x.ownerDocument,w=x.querySelector(".rte-rev-panel");if(!w){h();return}w.innerHTML="";var D=d.createElement("div");D.className="rte-rev-header";var P=d.createElement("div");P.id="rte-rev-dialog-title",P.className="rte-rev-title",P.textContent="Revision history",D.appendChild(P);var B=d.createElement("div");B.className="rte-rev-header-actions";var Z=d.createElement("button");Z.type="button",Z.className="rte-rev-btn rte-rev-btn-ghost",Z.textContent="Save version now",Z.addEventListener("mousedown",function(Le){Le.preventDefault();var qe=d.defaultView.prompt("Label this version (optional):","");qe!==null&&k(qe||"")}),B.appendChild(Z);var fe=d.createElement("button");fe.type="button",fe.className="rte-rev-btn rte-rev-btn-ghost",fe.textContent="Close",fe.setAttribute("aria-label","Close revision history"),fe.addEventListener("mousedown",function(Le){Le.preventDefault(),h()}),B.appendChild(fe),D.appendChild(B),w.appendChild(D);var re=d.createElement("div");re.className="rte-rev-body";var ie=d.createElement("div");ie.className="rte-rev-list",ie.setAttribute("role","listbox"),ie.setAttribute("aria-label","Saved revisions");var ae=r.revisionHistory.list();if(ae.length){(!L||!V(L))&&(L=ae[0].id);for(var se=0;se<ae.length;se++)(function(Le){var qe=d.createElement("button");qe.type="button",qe.className="rte-rev-row"+(Le.id===L?" rte-rev-row-active":""),qe.setAttribute("role","option"),qe.setAttribute("aria-selected",Le.id===L?"true":"false");var Re=d.createElement("span");Re.className="rte-rev-dot",Re.style.background=Le.author&&Le.author.color||"#64748b";var Ie=d.createElement("div");Ie.className="rte-rev-row-who",Ie.textContent=Le.author&&Le.author.name||"User";var Ve=d.createElement("div");Ve.className="rte-rev-row-when",Ve.textContent=C(Le.createdAt)+" \xB7 "+(Le.label||"");var Ye=d.createElement("div");Ye.className="rte-rev-row-col",Ye.appendChild(Ie),Ye.appendChild(Ve),qe.appendChild(Re),qe.appendChild(Ye),qe.addEventListener("mousedown",function(ft){ft.preventDefault(),L=Le.id,A()}),ie.appendChild(qe)})(ae[se])}else{var de=d.createElement("div");de.className="rte-rev-empty",de.textContent='No revisions yet. Click "Save version now" to capture the current document.',ie.appendChild(de)}re.appendChild(ie);var U=d.createElement("div");if(U.className="rte-rev-pane",ae.length){var Q=V(L)||ae[0],j=d.createElement("div");j.className="rte-rev-tabs",j.setAttribute("role","tablist"),j.setAttribute("aria-label","Revision view");var J=d.createElement("button");J.type="button",J.className="rte-rev-tab"+(E==="preview"?" rte-rev-tab-active":""),J.setAttribute("role","tab"),J.setAttribute("aria-selected",E==="preview"?"true":"false"),J.textContent="Preview",J.addEventListener("mousedown",function(Le){Le.preventDefault(),E="preview",A()});var Y=d.createElement("button");Y.type="button",Y.className="rte-rev-tab"+(E==="diff"?" rte-rev-tab-active":""),Y.setAttribute("role","tab"),Y.setAttribute("aria-selected",E==="diff"?"true":"false"),Y.textContent="Diff vs current",Y.addEventListener("mousedown",function(Le){Le.preventDefault(),E="diff",A()}),j.appendChild(J),j.appendChild(Y),U.appendChild(j);var te=d.createElement("div");if(te.className="rte-rev-content",E==="preview"){var le=d.createElement("iframe");le.className="rte-rev-preview-frame",le.setAttribute("title","Revision preview"),le.setAttribute("sandbox","allow-same-origin"),te.appendChild(le),setTimeout(function(){try{le.contentDocument.open(),le.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>'+(Q.html||"")+"</body></html>"),le.contentDocument.close()}catch{}},0)}else{var pe=r.getText?r.getText():p(r.getHTML()),ye=s(Q.text||p(Q.html),pe),me=d.createElement("pre");me.className="rte-rev-diff";for(var ee=0;ee<ye.length;ee++){var ue=d.createElement("span");ue.className="rte-rev-diff-line rte-rev-diff-"+ye[ee].type,ue.textContent=(ye[ee].type==="add"?"+ ":ye[ee].type==="del"?"- ":" ")+ye[ee].text+`
68
68
  `,me.appendChild(ue)}te.appendChild(me)}U.appendChild(te);var ce=d.createElement("div");ce.className="rte-rev-footer";var ve=d.createElement("div");ve.className="rte-rev-footer-info",ve.textContent=Q.label?"Label: "+Q.label:"";var be=d.createElement("div");be.className="rte-rev-footer-btns";var ke=d.createElement("button");ke.type="button",ke.className="rte-rev-btn rte-rev-btn-danger",ke.textContent="Delete",ke.addEventListener("mousedown",function(Le){Le.preventDefault(),_(Q.id)});var Pe=d.createElement("button");Pe.type="button",Pe.className="rte-rev-btn rte-rev-btn-primary",Pe.textContent="Restore this version",Pe.addEventListener("mousedown",function(Le){Le.preventDefault()}),Pe.addEventListener("click",function(Le){Le.preventDefault(),f(Q.id)}),be.appendChild(ke),be.appendChild(Pe),ce.appendChild(ve),ce.appendChild(be),U.appendChild(ce)}re.appendChild(U),w.appendChild(re)}}function C(d){if(!d)return"";var w=new Date(d),D=new Date;function P(Z){return Z<10?"0"+Z:""+Z}var B=P(w.getHours())+":"+P(w.getMinutes());return w.toDateString()===D.toDateString()?"Today "+B:w.getFullYear()+"-"+P(w.getMonth()+1)+"-"+P(w.getDate())+" "+B}function y(){var d=r&&r.iframe&&r.iframe.ownerDocument||document;if(!d.querySelector("style[data-rte-revisionhistory]")){var w=d.createElement("style");w.setAttribute("data-rte-revisionhistory","1"),w.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(`
69
69
  `),d.head.appendChild(w),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(d,w,"rte-revisionhistory-style",w.textContent)}}}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 N=this,u,r,x=!1;N.PluginName="RtlUi",N.InitConfig=function(V){u=V},N.InitEditor=function(V){r=V,r.attachEvent("exec_command_rtlui",function(K){K.returnValue=!0,N.Toggle()}),H();try{r.attachEvent("ready",H)}catch{}try{r.attachEvent("aftersethtml",H)}catch{}setTimeout(H,0),r.setRtlUserInterface=function(K){return z(!!K)},r.toggleRtlUserInterface=function(){return z(!x)},r.isRtlUserInterface=function(){return x},r.getRtlUiCss=function(){return o()}},N.Toggle=function(){return z(!x)};function H(){O(),u.rtlUserInterface===!0?z(!0):u.rtlUserInterface===!1?z(!1):z(F())}function F(){try{if(typeof r.getBaseDirection=="function"&&r.getBaseDirection()==="rtl")return!0;var V=r.getEditable();if(V){var K=V.ownerDocument,W=K&&(K.defaultView||K.parentWindow);if(W&&W.getComputedStyle(V).direction==="rtl")return!0}}catch{}return!1}function $(){try{var V=r.getEditable();if(!V)return null;for(var K=V.ownerDocument.defaultView,W=K&&K.frameElement?K.frameElement:V;W&&W.classList&&!W.classList.contains("richtexteditor");)W=W.parentNode;return W&&W.classList?W:null}catch{return null}}function z(V){var K=$();return K&&(V?K.setAttribute("dir","rtl"):K.removeAttribute("dir"),x=!!V),x}function o(){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(`
70
- `)}function O(){var V=document;if(!V.getElementById("rte-rtl-ui-styles")){var K=V.createElement("style");K.id="rte-rtl-ui-styles",K.appendChild(V.createTextNode(o())),(V.head||V.documentElement).appendChild(K),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(V,K,"rte-rtl-ui-styles",K.textContent)}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_rubyannotation=RTE_Plugin_RubyAnnotation;function RTE_Plugin_RubyAnnotation(){var N=this,u,r;N.PluginName="RubyAnnotation",N.InitConfig=function(k){u=k,u.rubyAnnotationEnabled!==!1&&(typeof u.rubyAnnotationParentheses!="boolean"&&(u.rubyAnnotationParentheses=!0),x("toolbar_full","#{rubyannotation}"),H("subtoolbar_more","rubyannotation"))},N.InitEditor=function(k){r=k,u.rubyAnnotationEnabled!==!1&&(r.ruby={add:function(M){return q(M)},get:function(){var M=o();return M?O(M):null},isRuby:function(){return!!o()},open:function(){N.OpenRubyDialog()},remove:function(){return b()}},F(),r.toolbarFactoryMap=r.toolbarFactoryMap||{},r.toolbarFactoryMap.rubyannotation=function(M){return r.createToolbarButton(M)},r.attachEvent("exec_command_rubyannotation",function(M){M.returnValue=!0,M.stopBubble=!0,N.OpenRubyDialog()}))};function x(k,M){u[k]&&u[k].indexOf(M)===-1&&(u[k]=u[k]+M)}function H(k,M){var I=u[k];if(!(!I||I.indexOf(M)!==-1)){var R=I.indexOf("}");R!==-1&&(u[k]=I.substring(0,R)+","+M+I.substring(R))}}function F(){var k=u.container.ownerDocument;if(!k.getElementById("rte-ruby-style")){var M=k.createElement("style");M.id="rte-ruby-style",M.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(""),k.head.appendChild(M)}}function $(){return r&&r.getEditable?r.getEditable():null}function z(){var k=r.getDocument();try{var M=k.getSelection();return!M||!M.rangeCount?null:M.getRangeAt(0)}catch{return null}}function o(){var k=z(),M=$();if(!k||!M)return null;for(var I=k.startContainer;I&&I!==M;){if(I.nodeType===1&&I.nodeName==="RUBY")return I;I=I.parentNode}return null}function O(k){var M=k.querySelector("rt");return M&&M.textContent||""}function V(k){for(var M="",I=0;I<k.childNodes.length;I++){var R=k.childNodes[I];R.nodeType===3?M+=R.nodeValue:R.nodeType===1&&R.nodeName!=="RT"&&R.nodeName!=="RP"&&(M+=R.textContent||"")}return M}function K(k){return String(k??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function W(k,M){var I=u.rubyAnnotationParentheses;return'<ruby class="rte-ruby-annotated">'+K(k)+(I?"<rp>(</rp>":"")+"<rt>"+K(M)+"</rt>"+(I?"<rp>)</rp>":"")+"</ruby>"}function q(k){var M=o();if(M){var I=M.querySelector("rt");return I||(I=M.ownerDocument.createElement("rt"),M.appendChild(I)),I.textContent=String(k??""),r.focus(),M}var R=z();if(!R||R.collapsed)return null;var l=String(R.toString()||"");return l?(r.insertHTML(W(l,k)),r.focus(),!0):null}function b(){var k=o();if(!k)return!1;var M=k.ownerDocument,I=M.createTextNode(V(k));return k.parentNode.insertBefore(I,k),k.parentNode.removeChild(k),r.focus(),!0}function m(k,M,I,R){var l=k.ownerDocument.createElement(M);return I&&(l.style.cssText=I),R&&(l.className=R),k.appendChild(l),l}N.OpenRubyDialog=function(){var k=o(),M=z(),I=k?V(k):M?String(M.toString()||""):"",R=r.createDialog(r.getLangText&&r.getLangText("rubyannotationtitle")||"Ruby annotation","rte-dialog-ruby"),l=typeof R.close=="function"?function(){R.close()}:function(){r.closeCurrentPopup()},f=m(R,"div","padding:14px;min-width:340px;font:13px -apple-system,Segoe UI,sans-serif");m(f,"div","font-weight:600;margin-bottom:4px").innerText="Base text";var _=m(f,"div","padding:8px 10px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;min-height:20px;word-break:break-word");_.textContent=I,m(f,"div","font-weight:600;margin:10px 0 4px").innerText="Reading";var v=m(f,"input","width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;font:13px inherit");v.type="text",v.value=k?O(k):"",v.placeholder="e.g. \u304B\u3093\u3058";var s=m(f,"div","font-size:11px;color:#94a3b8;margin-top:6px");s.innerText=I?"Shown above the base text. Parentheses are emitted for readers without ruby support.":"Select the text to annotate first, then reopen this dialog.";var c=m(f,"div","display:flex;justify-content:space-between;gap:8px;margin-top:14px"),p=m(c,"div","display:flex;gap:8px");if(k){var g=m(p,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#b91c1c;cursor:pointer");g.type="button",g.textContent="Remove",g.onclick=function(){b(),l()}}var h=m(c,"div","display:flex;gap:8px"),L=m(h,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");L.type="button",L.textContent="Cancel",L.onclick=l;var E=m(h,"button","padding:6px 14px;border:1px solid #1d67ba;border-radius:8px;background:#1d67ba;color:#fff;cursor:pointer");E.type="button",E.textContent=k?"Update":"Add",E.disabled=!I,E.onclick=function(){var A=v.value.trim();if(!A||!I){l();return}q(A),l()},setTimeout(function(){v.focus()},0)}}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 N=this,u,r,x=!1,H={removedTags:[],removedAttributes:[],calls:0,lastPasses:0},F=[];N.PluginName="Sanitizer",N.InitConfig=function(E){u=E},N.InitEditor=function(E){if(r=E,u.contentSanitizer===!1)return;r.sanitizeHtml=function(C){return l(String(C??""))},r.getSanitizerReport=function(){return JSON.parse(JSON.stringify(H))};function A(){try{f(),_()}catch{}try{L()}catch{}try{h()}catch{}}A();try{r.attachEvent("ready",A)}catch{}setTimeout(A,0),setTimeout(A,400)};var $={};"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){$[E]=!0});var z={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},o={};"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){o[E]=!0});var O={href:1,src:1,action:1,formaction:1,poster:1,cite:1,data:1,longdesc:1,background:1,ping:1,srcset:1},V=/^(https?|mailto|tel|ftp|sms|callto|webcal|geo|bitcoin):/i,K=/^data:image\/(png|jpe?g|gif|webp|bmp|x-icon|avif);base64,[a-z0-9+/=\s]+$/i;function W(E,A,C){var y=String(E??"").replace(/[\u0000-\u0020\u007F-\u00A0]+/g,"").trim();if(!y)return!1;if(A==="use")return y.charAt(0)==="#";if(/^[#?/]/.test(y))return!0;var d=/^([a-z][a-z0-9+.\-]*):/i.exec(y);return d?K.test(y)?A==="img"||A==="source"||C==="poster"||C==="srcset":/^blob:/i.test(y)?A==="img"||A==="video"||A==="audio"||A==="source":V.test(y):!0}function q(E){for(var A=[],C=String(E??"").split(";"),y=0;y<C.length;y++){var d=C[y];if(d.trim()&&!/expression\s*\(|(javascript|vbscript|livescript)\s*:|-moz-binding|behaviou?r\s*:|@import|-o-link/i.test(d)){var w=/url\s*\(\s*(['"]?)([^'")]*)\1\s*\)/i.exec(d);w&&!W(w[2],"img","src")||A.push(d.trim())}}return A.join("; ")}var b="allow-scripts allow-same-origin allow-presentation";function m(E){if(u.sanitizerAllowIframes===!1)return!1;var A=E.getAttribute("src")||"";if(!/^https?:/i.test(A))return!1;var C=u.sanitizerAllowedIframeHosts;if(!C||!C.length)return E.hasAttribute("sandbox")||E.setAttribute("sandbox",b),!0;try{for(var y=new URL(A).hostname.toLowerCase(),d=0;d<C.length;d++){var w=String(C[d]).toLowerCase();if(y===w||y.slice(-(w.length+1))==="."+w)return!0}}catch{}return!1}function k(E){var A={},C=[],y=[];(E||[]).forEach(function(w){if(w instanceof RegExp){y.push(w);return}var D=String(w).toLowerCase();if(D.indexOf("*")===-1){A[D]=!0;return}C.push(D.split("*"))});function d(w,D){var P=w[0];if(D.lastIndexOf(P,0)!==0)return!1;var B=w[w.length-1];if(B&&(D.length<B.length||D.indexOf(B,D.length-B.length)===-1))return!1;for(var Z=P.length,fe=1;fe<w.length;fe++)if(w[fe]){var re=D.indexOf(w[fe],Z);if(re===-1)return!1;Z=re+w[fe].length}return!0}return function(w){if(A[w])return!0;for(var D=0;D<C.length;D++)if(d(C[D],w))return!0;for(var P=0;P<y.length;P++)if(y[P].test(w))return!0;return!1}}function M(E,A){var C=k(u.sanitizerAllowTags),y=k(u.sanitizerAllowAttributes),d=u.sanitizerAllowStyleTags===!0,w=[];(function se(U){for(var Q=0;Q<U.childNodes.length;Q++){var j=U.childNodes[Q];j.nodeType===1?(w.push(j),se(j)):j.nodeType===8&&w.push(j)}})(E);for(var D=0;D<w.length;D++){var P=w[D];if(P.parentNode){if(P.nodeType===8){s(P.data)&&(R(A.removedTags,"#comment"),P.parentNode.removeChild(P));continue}var B=(P.localName||P.nodeName||"").toLowerCase();if(B==="style"){if(!d){R(A.removedTags,"style"),P.parentNode.removeChild(P);continue}}else if(B==="iframe"){if(P.hasAttribute("srcdoc")&&(R(A.removedAttributes,"iframe[srcdoc]"),P.removeAttribute("srcdoc")),!m(P)){R(A.removedTags,"iframe"),P.parentNode.removeChild(P);continue}}else if(B==="title"||B==="desc"){if(!P.closest||!P.closest("svg")){R(A.removedTags,B),P.parentNode.removeChild(P);continue}}else if(z[B]){R(A.removedTags,B),P.parentNode.removeChild(P);continue}else if(!$[B]&&!C(B)){R(A.removedTags,B),I(P);continue}for(var Z=[],fe=0;fe<P.attributes.length;fe++)Z.push(P.attributes[fe]);for(var re=0;re<Z.length;re++){var ie=Z[re].name.toLowerCase(),ae=Z[re].value;if(ie.indexOf("on")===0){R(A.removedAttributes,ie),P.removeAttribute(Z[re].name);continue}if(ie==="xlink:href"||ie==="xmlns:xlink"){W(ae,B,ie)||(R(A.removedAttributes,ie),P.removeAttribute(Z[re].name));continue}if(ie==="srcdoc"){R(A.removedAttributes,"srcdoc"),P.removeAttribute(Z[re].name);continue}if(ie==="style"){P.setAttribute("style",q(ae));continue}if(!(ie.indexOf("data-")===0||ie.indexOf("aria-")===0)){if(O[ie]){W(ae,B,ie)||(R(A.removedAttributes,B+"["+ie+"]"),P.removeAttribute(Z[re].name));continue}!o[ie]&&!y(ie)&&(R(A.removedAttributes,ie),P.removeAttribute(Z[re].name))}}if(B==="a"&&(P.getAttribute("target")||"").toLowerCase()==="_blank"){var de=(P.getAttribute("rel")||"").toLowerCase();de.indexOf("noopener")<0&&P.setAttribute("rel",(de?de+" ":"")+"noopener noreferrer")}}}return E}function I(E){for(var A=E.parentNode;E.firstChild;)A.insertBefore(E.firstChild,E);A.removeChild(E)}function R(E,A){E.indexOf(A)<0&&E.push(A)}function l(E){var A=E;H.calls++;for(var C=0;C<3;C++){var y=new DOMParser().parseFromString("<body>"+A+"</body>","text/html");M(y.body,H);var d=y.body.innerHTML;if(H.lastPasses=C+1,d===A)break;A=d}return A}function f(){if(!x){for(var E=["getHTMLCode","getHTMLContent"],A=!1,C=0;C<E.length;C++)(function(y){var d=r[y];if(!(typeof d!="function"||d.__rteSanitized)){var w=function(){var D=d.apply(r,arguments);return typeof D!="string"?D:l(D)};w.__rteSanitized=!0,r[y]=w,A=!0}})(E[C]);A&&(x=!0)}}function _(){for(var E=["setHTMLCode","setHTMLContent"],A=0;A<E.length;A++)(function(C){var y=r[C];if(!(typeof y!="function"||y.__rteSanitizedIn)){var d=function(w){var D=[].slice.call(arguments);return typeof w=="string"&&(D[0]=l(w)),y.apply(r,D)};d.__rteSanitizedIn=!0,r[C]=d}})(E[A])}function v(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 s(E){var A=String(E??"");return A.indexOf("-->")!==-1||A.indexOf("--!>")!==-1||A.charAt(0)===">"||A.charAt(0)==="-"&&A.charAt(1)===">"}var c=/^(script|iframe|object|embed|base|meta|link|form)$/;function p(E){if(!E.attributes)return!1;for(var A=0;A<E.attributes.length;A++){var C=E.attributes[A].name.toLowerCase();if(C.indexOf("on")===0||C==="srcdoc"||(C==="href"||C==="src"||C==="data"||C==="action"||C==="xlink:href")&&/(javascript|vbscript)\s*:|data:\s*text\/html/i.test(E.attributes[A].value||""))return!0}return!1}function g(E){if(c.test(E.localName||"")||p(E))return!0;for(var A=E.getElementsByTagName?E.getElementsByTagName("*"):[],C=0;C<A.length;C++)if(c.test(A[C].localName||"")||p(A[C]))return!0;return!1}function h(){if(u.sanitizerGuardLiveDom!==!1){var E=null;try{E=r.getEditable()}catch{return}if(!(!E||E.__rteLiveGuard)){E.__rteLiveGuard=!0;var A=new MutationObserver(function(C){for(var y=!1,d=0;d<C.length&&!y;d++){var w=C[d];if(w.type==="attributes"){var D=(w.attributeName||"").toLowerCase();(D.indexOf("on")===0||D==="srcdoc"||p(w.target))&&(y=!0);continue}for(var P=0;P<w.addedNodes.length;P++){var B=w.addedNodes[P];if(B.nodeType===8){if(s(B.data)){y=!0;break}continue}if(B.nodeType===1&&g(B)){y=!0;break}}}if(y)try{M(E,H)}catch{}});A.observe(E,{childList:!0,subtree:!0,attributes:!0}),F.push(A)}}}function L(){var E=null;try{E=r.getEditable()}catch{return}if(!E||E.__rteSanitizePaste)return;E.__rteSanitizePaste=!0,E.addEventListener("paste",function(C){var y=C.clipboardData||window.clipboardData;if(y){var d="";try{d=y.getData("text/html")||""}catch{return}if(!(!d||!v(d))){C.preventDefault(),C.stopImmediatePropagation();var w=l(d);try{r.insertHTML(w)}catch{try{r.insertText(y.getData("text/plain")||"")}catch{}}}}},!0);function A(){var C=function(){try{M(E,H)}catch{}};setTimeout(C,0),setTimeout(C,250)}E.addEventListener("paste",A,!1),E.addEventListener("drop",A,!0)}}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 N=this,u,r,x=null,H=null,F=null;N.PluginName="ShadowDom",N.InitConfig=function(I){u=I},N.InitEditor=function(I){r=I,r.getShadowRoot=function(){return z()},r.isInShadowDom=function(){return!!z()},r.adoptEditorStyles=function(R){return m(R||z(),!0)},r.getAdoptedStyleCount=function(){return F?F.size:0},!(u&&u.shadowStyleAdoption===!1)&&o(function(){x=z(),x&&(F=new(window.Set||Array),m(x,!1),M(x))})},N.Destroy=function(){if(H){try{H.disconnect()}catch{}H=null}};function $(){try{var I=r.getEditable(),R=I&&I.ownerDocument&&I.ownerDocument.defaultView?I.ownerDocument.defaultView.frameElement:null;if(!R)return null;for(var l=R;l;){if(l.classList&&l.classList.contains("richtexteditor"))return l;l=l.parentNode||l.host}return R}catch{return null}}function z(){var I=$();if(!I||typeof I.getRootNode!="function")return null;var R=I.getRootNode();return R&&R.host&&R!==document?R:null}function o(I){if($()){I();return}var R=0,l=window.setInterval(function(){($()||++R>100)&&(window.clearInterval(l),I())},50)}function O(){try{for(var I=document.getElementsByTagName("script"),R=0;R<I.length;R++){var l=I[R].src||"";if(/(^|\/)rte(\.min)?\.js(\?|$)/.test(l))return l.replace(/[^\/]*$/,"")}}catch{}return null}function V(I){var R=String(I.id||"");if(/^rte[-_]|^__rte/.test(R))return!0;var l=I.href||"";if(!l){if(I.tagName==="STYLE"){var f=I.textContent||"";return/[.]richtexteditor|rte-toolbar|rte-editor|rte-dialog|[.]rte-a11y/.test(f)}return!1}var _=O();return _&&l.indexOf(_)===0?!0:/rte_theme|rte_mobile|richtexteditor_content|richtexteditor_preview|aitoolkit/.test(l)}function K(){var I=u&&u.shadowStyleSources||null;return I?typeof I=="string"?[I]:I:[]}function W(I){return(I.href||"")+"|"+(I.id||"")+"|"+(I.textContent||"").length}function q(I){return F&&(F.has?F.has(I):F.indexOf(I)>=0)}function b(I){F&&(F.add?F.add(I):F.push(I))}function m(I,R){if(!I)return 0;F||(F=new(window.Set||Array));for(var l=0,f=document.querySelectorAll("link[rel~=stylesheet],style"),_=0;_<f.length;_++){var v=f[_];if(V(v)){var s=W(v);!R&&q(s)||q(s)||(I.appendChild(k(v,I)),b(s),l++)}}for(var c=K(),p=0;p<c.length;p++){var g="extra|"+c[p];if(!q(g)){var h=document.createElement("link");h.rel="stylesheet",h.href=c[p],h.setAttribute("data-rte-adopted","1"),I.appendChild(h),b(g),l++}}try{if(I.adoptedStyleSheets&&document.adoptedStyleSheets&&document.adoptedStyleSheets.length){for(var L=I.adoptedStyleSheets.slice(),E=0;E<document.adoptedStyleSheets.length;E++)L.indexOf(document.adoptedStyleSheets[E])<0&&L.push(document.adoptedStyleSheets[E]);I.adoptedStyleSheets=L}}catch{}return l}function k(I,R){if(I.tagName==="LINK"){var l=document.createElement("link");return l.rel="stylesheet",l.href=I.href,I.media&&(l.media=I.media),l.setAttribute("data-rte-adopted","1"),l}var f=document.createElement("style");return f.textContent=I.textContent,I.id&&f.setAttribute("data-rte-source-id",I.id),f.setAttribute("data-rte-adopted","1"),f}function M(I){window.MutationObserver&&(H=new MutationObserver(function(R){for(var l=!1,f=0;f<R.length&&!l;f++)for(var _=R[f].addedNodes||[],v=0;v<_.length;v++){var s=_[v];if(s.nodeType===1&&(s.tagName==="STYLE"||s.tagName==="LINK")&&V(s)){l=!0;break}}l&&m(I,!1)}),H.observe(document.head||document.documentElement,{childList:!0,subtree:!0}))}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_slashcommand=RTE_Plugin_SlashCommand;function RTE_Plugin_SlashCommand(){var N=this,u,r,x=null,H=null,F=null,$=[],z=[],o=0,O=!1,V=!1;N.PluginName="SlashCommand",N.InitConfig=function(Me){u=Me,u.slashCommandEnabled!==!1&&(u.slashCommandTrigger=u.slashCommandTrigger||"/",u.slashCommandMaxItems=u.slashCommandMaxItems||40,u.slashCommandIncludeAi=u.slashCommandIncludeAi!==!1,u.slashCommands=u.slashCommands||null)},N.InitEditor=function(Me){if(r=Me,u.slashCommandEnabled!==!1){if(r.slashCommands={register:K,remove:b,list:function(){return q(),$.slice()},open:function(){c(!0)},close:p,isOpen:function(){return!!H}},$=f(),Array.isArray(u.slashCommands))for(var Se=0;Se<u.slashCommands.length;Se++)K(u.slashCommands[Se]);setTimeout(q,0),B();var Ze=r.getDocument();Ze.addEventListener("keydown",_,!0),Ze.addEventListener("input",v,!0),Ze.addEventListener("compositionstart",function(){O=!0}),Ze.addEventListener("compositionend",function(){O=!1}),Ze.addEventListener("mousedown",function(){p()},!0),Ze.addEventListener("blur",function(){setTimeout(p,150)},!0),window.addEventListener("scroll",P,!0),window.addEventListener("resize",P,!0)}};function K(Me){if(!(!Me||!Me.id)){var Se=m(Me.id);Se>=0?$[Se]=M(Me):$.push(M(Me))}}var W={};function q(){if(r){for(var Me=[],Se=0;Se<$.length;Se++)$[Se]._default||Me.push($[Se]);for(var Ze=f(),nt=[],Nt=0;Nt<Ze.length;Nt++){var jt=Ze[Nt].id;if(!W[jt]){for(var Vt=!1,ut=0;ut<Me.length;ut++)if(Me[ut].id===jt){Vt=!0;break}Vt||nt.push(Ze[Nt])}}$=nt.concat(Me)}}function b(Me){W[Me]=!0;var Se=m(Me);Se>=0&&$.splice(Se,1)}function m(Me){for(var Se=0;Se<$.length;Se++)if($[Se].id===Me)return Se;return-1}function k(Me,Se){try{var Ze=String(Me).toLowerCase().replace(/[^a-z0-9_]/g,"_");if(u&&u["text_"+Ze]&&r&&typeof r.getLangText=="function")return r.getLangText(Ze)}catch{}return Se}function M(Me){var Se=Me.section||"Blocks";return{id:Me.id,section:k("slash_section_"+Se,Se),title:k("slash_"+Me.id,Me.title||Me.id),description:k("slash_"+Me.id+"_desc",Me.description||""),keywords:(Me.keywords||[]).slice(),icon:Me.icon||"",iconSvg:Me.iconSvg||"",run:Me.run||Me.action}}var I={P:1,DIV:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,BLOCKQUOTE:1,PRE:1,LI:1};function R(){var Me=r.getSelection();if(!Me||Me.rangeCount===0)return null;for(var Se=Me.getRangeAt(0).startContainer,Ze=r.getEditable();Se&&Se!==Ze;){if(Se.nodeType===1&&I[Se.nodeName])return Se;Se=Se.parentNode}return null}function l(Me){var Se=R();if(Me=Me.toUpperCase(),Se&&!Se.textContent.trim()){var Ze=r.getDocument(),nt=Ze.createElement(Me);nt.appendChild(Ze.createElement("br")),Se.parentNode.replaceChild(nt,Se);var Nt=Ze.createRange();Nt.setStart(nt,0),Nt.setEnd(nt,0);var jt=r.getSelection();jt.removeAllRanges(),jt.addRange(Nt);return}r.execCommand("formatblock",Me)}function f(){var Me=[];function Se(ut,sr,Fn,Un,Or,na,Ko){var co=M({id:sr,section:ut,title:Fn,description:Un,keywords:Or,iconSvg:na,run:Ko});co._default=!0,Me.push(co)}if(Se("Blocks","heading1","Heading 1","Large section heading",["h1","title"],Z("1"),function(){l("H1")}),Se("Blocks","heading2","Heading 2","Medium section heading",["h2","subtitle"],Z("2"),function(){l("H2")}),Se("Blocks","heading3","Heading 3","Small section heading",["h3"],Z("3"),function(){l("H3")}),Se("Blocks","paragraph","Paragraph","Plain body text",["p","text","body"],fe(),function(){l("P")}),Se("Blocks","bulletlist","Bulleted list","Unordered list",["ul","bullets","list"],re(),function(){r.execCommand("insertunorderedlist")}),Se("Blocks","numberlist","Numbered list","Ordered list",["ol","numbered"],ie(),function(){r.execCommand("insertorderedlist")}),Se("Blocks","quote","Quote","Block quotation",["blockquote"],ae(),function(){r.execCommand("insertblockquote")}),Se("Blocks","code","Code block","Monospaced code block",["pre","snippet"],de(),function(){r.isCommandEnabled&&r.isCommandEnabled("insertcode")?r.execCommand("insertcode"):r.execCommand("formatblock","PRE")}),Se("Blocks","divider","Divider","Horizontal rule",["hr","line","separator"],se(),function(){r.execCommand("inserthorizontalrule")}),(!r.isCommandEnabled||r.isCommandEnabled("insertcallout"))&&Se("Blocks","callout","Callout","Highlighted info / warning box",["admonition","info","warning","note","tip"],pe(),function(){r.execCommand("insertcallout")}),(!r.isCommandEnabled||r.isCommandEnabled("insertcolumns"))&&Se("Blocks","columns","Columns","Multi-column layout",["layout","grid","column"],ye(),function(){r.execCommand("insertcolumns")}),(!r.isCommandEnabled||r.isCommandEnabled("inserttoggle"))&&Se("Blocks","toggle","Toggle list","Collapsible toggle block",["collapse","details","accordion","expand"],me(),function(){r.execCommand("inserttoggle")}),(!r.isCommandEnabled||r.isCommandEnabled("insertmath"))&&Se("Insert","equation","Equation","Insert a math equation (TeX)",["math","latex","tex","formula","katex"],ee(),function(){r.execCommand("insertmath")}),(!r.isCommandEnabled||r.isCommandEnabled("inserttodolist"))&&Se("Blocks","todolist","To-do list","Checklist with clickable checkboxes",["task","todo","checklist","checkbox","check"],pt(),function(){r.execCommand("inserttodolist")}),(!r.isCommandEnabled||r.isCommandEnabled("insertdiagram"))&&Se("Insert","diagram","Diagram","Insert a Mermaid diagram",["mermaid","flowchart","sequence","gantt","graph","uml"],ke(),function(){r.execCommand("insertdiagram")}),(!r.isCommandEnabled||r.isCommandEnabled("insertbookmark"))&&Se("Insert","bookmark","Bookmark","Insert a link preview card",["link","url","embed","preview","card"],ue(),function(){r.execCommand("insertbookmark")}),(!r.isCommandEnabled||r.isCommandEnabled("spellcheck"))&&Se("Tools","spellcheck","Spell check","Check spelling",["spelling","grammar","proofread","typo"],ce(),function(){r.execCommand("spellcheck")}),(!r.isCommandEnabled||r.isCommandEnabled("insertdatechip"))&&Se("Insert","datechip","Date chip","Insert an interactive date chip",["date","calendar","chip","today"],ve(),function(){r.execCommand("insertdatechip")}),(!r.isCommandEnabled||r.isCommandEnabled("insertchip"))&&Se("Insert","chip","Smart chip","Insert a date / person / link chip",["chip","person","mention","link","pill"],ve(),function(){r.execCommand("insertchip")}),(!r.isCommandEnabled||r.isCommandEnabled("emailexport"))&&Se("Tools","emailexport","Export email HTML","Inline-styled HTML for email",["email","inline","mail","newsletter","html"],be(),function(){r.execCommand("emailexport")}),typeof r.openFindDialog=="function"&&Se("Tools","findreplace","Find & replace","Search the document and replace text",["find","replace","search","query","substitute"],yt(),function(){r.openFindDialog()}),typeof r.showShortcuts=="function"&&Se("Tools","shortcuts","Keyboard shortcuts","Show the keyboard shortcut cheat sheet (Ctrl+/)",["keyboard","shortcuts","hotkeys","keys","help","cheat"],Ge(),function(){r.showShortcuts()}),typeof r.foldAtCaret=="function"&&(Se("Tools","foldsection","Fold section","Collapse the section under the current heading",["fold","collapse","heading","outline","section"],Bt(),function(){r.foldAtCaret()}),Se("Tools","unfoldall","Unfold all","Expand every collapsed heading section",["unfold","expand","headings","collapse"],Bt(),function(){r.unfoldAll&&r.unfoldAll()})),(!r.isCommandEnabled||r.isCommandEnabled("readaloud"))&&Se("Tools","readaloud","Read aloud","Speak the selection or document (text-to-speech)",["tts","speak","speech","voice","accessibility","narrate"],Pe(),function(){r.execCommand("readaloud")}),typeof r.sortTableAtCaret=="function"&&(Se("Tools","sorttableasc","Sort table by this column","Sort the table rows by the column the caret is in",["sort","table","column","order","ascending"],ft(),function(){r.sortTableAtCaret("asc")}),Se("Tools","sorttabledesc","Sort table (descending)","Sort the table rows by this column, largest first",["sort","table","column","descending","reverse"],ft(),function(){r.sortTableAtCaret("desc")}),Se("Tools","tablerownumbers","Number table rows","Add or remove an automatic row-numbering column",["number","rows","table","count","index"],ft(),function(){r.execCommand("tablerownumbers")})),typeof r.setTableLayoutMode=="function"&&(Se("Insert","layouttable","Layout table","Insert a borderless table for positioning content (role=presentation)",["layout","table","grid","email","columns","presentation"],U(),function(){r.insertLayoutTable(2,2)}),Se("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"],U(),function(){r.setTableLayoutMode("layout")}),Se("Tools","tabledatamode","Mark table as data","This table states relationships \u2014 restore its header cells",["data","table","header","accessibility"],U(),function(){r.setTableLayoutMode("data",null,{promoteFirstRow:!0})})),typeof r.moveBlockUp=="function"&&(Se("Tools","moveblockup","Move block up","Move this paragraph or block above the previous one (Alt+Shift+Up)",["move","block","up","reorder","drag"],Le(),function(){r.moveBlockUp()}),Se("Tools","moveblockdown","Move block down","Move this paragraph or block below the next one (Alt+Shift+Down)",["move","block","down","reorder","drag"],Le(),function(){r.moveBlockDown()})),typeof r.toggleRtlUserInterface=="function"&&Se("Tools","rtlui","Mirror editor for RTL","Flip the toolbar, menus and dialogs for right-to-left languages",["rtl","mirror","interface","toolbar","arabic","hebrew"],qe(),function(){r.toggleRtlUserInterface()}),typeof r.setTextDirection=="function"&&(Se("Tools","rtl","Right-to-left","Set this paragraph to right-to-left (Arabic, Hebrew, Persian)",["rtl","arabic","hebrew","persian","urdu","direction","bidi"],qe(),function(){r.setTextDirection("rtl")}),Se("Tools","ltr","Left-to-right","Set this paragraph to left-to-right",["ltr","direction","bidi"],Re(),function(){r.setTextDirection("ltr")}),Se("Tools","autodir","Detect text direction","Set each paragraph's direction from its own content",["direction","detect","auto","rtl","bidi"],qe(),function(){r.autoDetectTextDirection()})),typeof r.toggleFormattingMarks=="function"&&Se("Tools","formattingmarks","Formatting marks","Show paragraph marks, block outlines and invisible characters",["marks","pilcrow","paragraph","invisible","whitespace","nbsp"],Ie(),function(){r.toggleFormattingMarks()}),typeof r.toggleWatermark=="function"&&Se("Tools","watermark","Watermark","Draw DRAFT or CONFIDENTIAL behind the content",["watermark","draft","confidential","background","stamp"],Ve(),function(){r.toggleWatermark()}),typeof r.toggleLineNumbers=="function"&&Se("Tools","linenumbers","Line numbers","Number every line in the margin, as pleadings and transcripts require",["line","numbers","margin","pleading","legal","transcript"],Ye(),function(){r.toggleLineNumbers()}),typeof r.togglePermanentPen=="function"&&Se("Tools","permanentpen","Permanent pen","Keep typing in a fixed annotation format until switched off",["pen","marker","annotate","highlight","review"],ht(),function(){r.togglePermanentPen()}),typeof r.checkLinks=="function"&&Se("Tools","checklinks","Check links","Find broken anchors, unsafe schemes and unlabelled links",["link","check","broken","audit","url","accessibility"],At(),function(){r.highlightLinkIssues(!0),r.checkLinks()}),typeof r.getMergeFieldDefinitions=="function"){for(var Ze=r.getMergeFieldDefinitions(),nt=0;nt<Ze.length;nt++)(function(ut){!ut||!ut.id||Se("Insert","mergefield-"+ut.id,ut.label||ut.id,"Insert the "+(ut.label||ut.id)+" merge field",["merge","field","placeholder","variable","mail merge",ut.id],Rt(),function(){r.insertMergeField(ut.id)})})(Ze[nt]);Se("Tools","mergepreview","Preview merge fields","Swap merge-field placeholders for sample data",["merge","preview","sample","data","placeholder"],Rt(),function(){r.toggleMergeFieldPreview()})}if(typeof r.listCrossReferenceTargets=="function"){var Nt=[];try{Nt=r.listCrossReferenceTargets()}catch{Nt=[]}for(var jt=0;jt<Nt.length&&jt<40;jt++)(function(ut){if(!(!ut||!ut.id)){var sr=ut.number?ut.number+" "+ut.label:ut.label;Se("Insert","xref-"+ut.id,"Reference: "+sr,"Insert a cross-reference to this "+ut.type+" that updates itself",["cross","reference","xref","see","refer",ut.type,ut.number||""],ar(),function(){r.insertCrossReference(ut.id,ut.number?"label":"text")})}})(Nt[jt])}if(typeof r.insertTableOfContents=="function"&&Se("Insert","toc","Table of contents","Insert a contents block that updates itself from your headings",["toc","contents","outline","index","headings"],ze(),function(){r.insertTableOfContents()}),typeof r.insertFootnote=="function"&&Se("Insert","footnote","Footnote","Insert a numbered footnote reference and note",["footnote","note","citation","reference","endnote","cite"],je(),function(){r.insertFootnote()}),typeof r.toggleFormatPainter=="function"&&Se("Tools","formatpainter","Format painter","Copy formatting here, then select the text to paint it onto",["format","painter","brush","copy","style","clone"],We(),function(){r.toggleFormatPainter()}),typeof r.changeCase=="function"&&(Se("Tools","caseupper","UPPERCASE","Convert the selection to upper case",["case","upper","caps","capitals"],Oe(),function(){r.changeCase("upper")}),Se("Tools","caselower","lowercase","Convert the selection to lower case",["case","lower","small"],Oe(),function(){r.changeCase("lower")}),Se("Tools","casetitle","Title Case","Capitalise each significant word in the selection",["case","title","headline","capitalise","capitalize"],Oe(),function(){r.changeCase("title")}),Se("Tools","casesentence","Sentence case","Capitalise the first letter of each sentence",["case","sentence","capitalise","capitalize"],Oe(),function(){r.changeCase("sentence")})),typeof r.requestGhostText=="function"&&Se("Tools","aicomplete","AI complete","Suggest an inline AI completion of the current sentence",["ai","complete","autocomplete","ghost","suggest","continue","copilot"],lr(),function(){r.requestGhostText()}),typeof r.exportToPdf=="function"&&Se("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"],Zt(),function(){r.exportToPdf()}),typeof r.exportToDocx=="function"&&Se("Tools","exportdocx","Export to Word (.docx)","A real OOXML document, built in the browser with no upload",["word","docx","ooxml","export","download","save","office"],$t(),function(){r.exportToDocx()}),typeof r.openImportDialog=="function"&&Se("Tools","import-document","Import document","Open a Markdown, HTML, text, or Word file into the editor",["import","open","file","word","docx","markdown","upload"],$t(),function(){r.openImportDialog({})}),typeof r.getReadabilityStats=="function"&&Se("Tools","readability-stats","Readability statistics","Flesch reading ease, grade level, and reading time",["readability","flesch","grade","reading","stats","score"],ce(),function(){r.execCommand("readability")}),typeof r.insertCrossReference=="function"&&Se("Insert","crossreference","Cross-reference","Insert a live reference to a heading, figure, table, or bookmark",["cross","reference","xref","see","figure","heading"],ar(),function(){r.execCommand("insertcrossreference")}),r.restrictedEditing&&Se("Tools","restrictedediting","Restricted editing","Lock the document and mark only the regions others may edit",["restrict","lock","protect","editable","region","permission"],ht(),function(){r.execCommand("restrictedediting")}),r.dictation&&Se("Tools","dictation","Dictation","Speak and have your words typed into the document",["dictate","speech","voice","microphone","talk"],Pe(),function(){r.execCommand("dictation")}),typeof r.copyAsMarkdown=="function"&&(Se("Tools","copymarkdown","Copy as Markdown","Copy the whole document to the clipboard as Markdown",["markdown","md","copy","clipboard","export"],zt(),function(){r.copyAsMarkdown()}),Se("Tools","downloadmarkdown","Download as Markdown","Save the document as a .md file",["markdown","md","download","export","save","file"],zt(),function(){r.downloadMarkdown()})),typeof r.toggleTypewriterMode=="function"&&(Se("Tools","typewriter","Typewriter mode","Keep the caret line centred as you type",["typewriter","center","scroll","focus","distraction","zen"],Et(),function(){r.toggleTypewriterMode()}),Se("Tools","focusmode","Focus mode","Dim everything except the current paragraph",["focus","dim","highlight","distraction","zen","concentrate"],lt(),function(){r.toggleFocusMode()})),Se("Insert","table","Table","Insert a table",["grid","rows","columns"],U(),function(){r.execCommand("inserttable")}),Se("Insert","image","Image","Upload or embed an image",["picture","photo","img"],Q(),function(){r.execCommand("imageupload")}),Se("Insert","link","Link","Insert a hyperlink",["url","anchor"],j(),function(){r.execCommand("insertlink")}),Se("Insert","emoji","Emoji","Insert an emoji",["smiley","icon"],J(),function(){r.execCommand("insertemoji")}),Se("Insert","template","Template","Insert from template gallery",["snippet"],Y(),function(){r.execCommand("inserttemplate")}),Se("Insert","date","Today's date","Insert the current date",["time","now"],te(),function(){r.execCommand("insertdate")}),u.slashCommandIncludeAi&&Array.isArray(u.aiToolkitActions))for(var Vt=0;Vt<u.aiToolkitActions.length;Vt++)(function(ut){Me.push(M({id:"ai-"+ut.id,section:"AI",title:ut.title||ut.id,description:ut.description||"",keywords:["ai",ut.id],iconSvg:u["svgCode_aiassist_"+(ut.icon||ut.id)]||u.svgCode_aiassist||"",run:function(){var sr=r.aiToolkit;if(sr){if(ut.id==="chat-panel"&&typeof sr.openChatPanel=="function"){sr.openChatPanel();return}if(ut.id==="review-panel"&&typeof sr.openReviewPanel=="function"){sr.openReviewPanel();return}if(ut.id==="open-dialog"&&typeof sr.openDialog=="function"){sr.openDialog();return}if(typeof sr.runQuickAction=="function"){sr.runQuickAction(ut.id);return}typeof sr.resolveAction=="function"&&sr.resolveAction(ut.id)}}}))})(u.aiToolkitActions[Vt]);return Me}function _(Me){if(!O){if(H)switch(Me.key){case"ArrowDown":Me.preventDefault(),Me.stopPropagation(),y(1);return;case"ArrowUp":Me.preventDefault(),Me.stopPropagation(),y(-1);return;case"Enter":case"Tab":if(z.length){Me.preventDefault(),Me.stopPropagation(),d();return}p();return;case"Escape":case"Esc":Me.preventDefault(),Me.stopPropagation(),p();return}if(Me.key===u.slashCommandTrigger&&!Me.ctrlKey&&!Me.metaKey&&!Me.altKey){if(!s())return;V=!1,setTimeout(function(){V||c(!1)},0)}}}function v(){H&&g()}function s(){var Me=r.getSelection();if(!Me||Me.rangeCount===0||!Me.isCollapsed)return!1;for(var Se=Me.getRangeAt(0),Ze=Se.startContainer,nt=Se.startOffset,Nt=r.getEditable(),jt=Ze.nodeType===1?Ze:Ze.parentNode;jt&&jt!==Nt;){var Vt=jt.nodeName;if(Vt==="CODE"||Vt==="PRE")return!1;jt=jt.parentNode}if(Ze.nodeType===3){if(nt===0)return!0;var ut=Ze.nodeValue.charAt(nt-1);return/\s/.test(ut)}return!0}function c(Me){q(),p();var Se=r.getSelection();if(!(!Se||Se.rangeCount===0)){var Ze=Se.getRangeAt(0).cloneRange();F={range:Ze,startNode:Ze.startContainer,startOffset:Ze.startOffset,triggerCharCount:Me?0:1,query:""},L(),D(),h("")}}function p(){H&&H.parentNode&&H.parentNode.removeChild(H),H=null,F=null,z=[],o=0}function g(){if(F){var Me=r.getSelection();if(!Me||Me.rangeCount===0||!Me.isCollapsed){p();return}var Se=Me.getRangeAt(0),Ze=Se.startContainer;if(Ze!==F.startNode){p();return}var nt=Se.startOffset;if(nt<F.startOffset){p();return}var Nt=(Ze.nodeType===3?Ze.nodeValue:"")||"",jt=Nt.substring(F.startOffset,nt);if(/\s/.test(jt)){p();return}F.query=jt,h(jt),D()}}function h(Me){var Se=(Me||"").toLowerCase();z=$.filter(function(Ze){if(!Se||Ze.title.toLowerCase().indexOf(Se)!==-1||Ze.description&&Ze.description.toLowerCase().indexOf(Se)!==-1)return!0;for(var nt=0;nt<Ze.keywords.length;nt++)if(String(Ze.keywords[nt]).toLowerCase().indexOf(Se)!==-1)return!0;return!1}).slice(0,u.slashCommandMaxItems),o=0,E()}function L(){x=r.iframe.ownerDocument,H=x.createElement("div"),H.className="rte-slash-popup";try{var Me=r.container||r.getEditable&&r.getEditable().closest&&r.getEditable().closest(".richtexteditor");Me&&Me.classList&&Me.classList.contains("rte-dark")&&(H.className+=" rte-slash-popup-dark")}catch{}H.setAttribute("role","listbox"),H.setAttribute("aria-label","Slash commands"),x.body.appendChild(H)}function E(){if(H){if(H.innerHTML="",!z.length){var Me=x.createElement("div");Me.className="rte-slash-empty",Me.textContent="No matching commands",H.appendChild(Me);return}for(var Se="",Ze=0;Ze<z.length;Ze++)(function(nt,Nt){if(nt.section!==Se){var jt=x.createElement("div");jt.className="rte-slash-section",jt.textContent=nt.section,H.appendChild(jt),Se=nt.section}var Vt=x.createElement("button");Vt.type="button",Vt.className="rte-slash-item"+(Nt===o?" rte-slash-item-active":""),Vt.setAttribute("role","option"),Vt.setAttribute("aria-selected",Nt===o?"true":"false"),Vt.setAttribute("data-index",Nt);var ut=x.createElement("span");ut.className="rte-slash-item-icon",ut.innerHTML=nt.iconSvg||le(),Vt.appendChild(ut);var sr=x.createElement("span");sr.className="rte-slash-item-body";var Fn=x.createElement("span");if(Fn.className="rte-slash-item-title",Fn.textContent=nt.title,sr.appendChild(Fn),nt.description){var Un=x.createElement("span");Un.className="rte-slash-item-desc",Un.textContent=nt.description,sr.appendChild(Un)}Vt.appendChild(sr),Vt.addEventListener("mousedown",function(Or){Or.preventDefault(),Or.stopPropagation(),o=Nt,d()}),Vt.addEventListener("click",function(Or){H&&(Or.preventDefault(),Or.stopPropagation(),o=Nt,d())}),Vt.addEventListener("mouseenter",function(){o!==Nt&&(o=Nt,A())}),H.appendChild(Vt)})(z[Ze],Ze)}}function A(){if(H){for(var Me=H.querySelectorAll(".rte-slash-item"),Se=0;Se<Me.length;Se++){var Ze=+Me[Se].getAttribute("data-index"),nt=Ze===o;Me[Se].classList.toggle("rte-slash-item-active",nt),Me[Se].setAttribute("aria-selected",nt?"true":"false")}C()}}function C(){if(H){var Me=H.querySelector(".rte-slash-item-active");if(Me){var Se=Me.offsetTop,Ze=Se+Me.offsetHeight;Se<H.scrollTop?H.scrollTop=Se:Ze>H.scrollTop+H.clientHeight&&(H.scrollTop=Ze-H.clientHeight)}}}function y(Me){z.length&&(o=(o+Me+z.length)%z.length,A())}function d(){if(!z.length){p();return}var Me=z[o],Se=F;if(p(),!(!Me||!Se)){w(Se);var Ze=r.getDocument();Ze.activeElement!==r.getEditable()&&!Ze.hasFocus()&&r.focus();try{Me.run(r)}catch(nt){console.warn("Slash command failed:",nt)}}}function w(Me){var Se=Me.startNode;if(Se){var Ze=Me.startOffset-(Me.triggerCharCount||0);Ze<0&&(Ze=0);var nt=r.getSelection();if(!(!nt||nt.rangeCount===0)){var Nt=nt.getRangeAt(0),jt,Vt;Se.nodeType===3&&Nt.startContainer===Se?(jt=Se,Vt=Nt.startOffset):(jt=Nt.startContainer,Vt=Nt.startOffset);var ut=r.getDocument().createRange();ut.setStart(Se,Ze),ut.setEnd(jt,Vt);try{ut.deleteContents()}catch{return}nt.removeAllRanges(),nt.addRange(ut)}}}function D(){if(!(!H||!F)){var Me=r.iframe,Se=Me.getBoundingClientRect(),Ze=F.range.getClientRects(),nt=Ze&&Ze.length?Ze[Ze.length-1]:null;nt||(nt=F.range.getBoundingClientRect());var Nt=Se.left+(nt.left||0)+window.pageXOffset,jt=Se.top+(nt.bottom||nt.top||0)+window.pageYOffset+4;H.style.position="absolute",H.style.left=Nt+"px",H.style.top=jt+"px";var Vt=window.innerHeight||document.documentElement.clientHeight,ut=H.getBoundingClientRect();ut.bottom>Vt-8&&Se.top+(nt.top||0)>ut.height+16&&(H.style.top=Se.top+(nt.top||0)+window.pageYOffset-ut.height-4+"px")}}function P(){H&&D()}function B(){var Me=r&&r.iframe&&r.iframe.ownerDocument||document;if(!Me.querySelector("style[data-rte-slashcommand]")){var Se=Me.createElement("style");Se.setAttribute("data-rte-slashcommand","1"),Se.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(`
70
+ `)}function O(){var V=document;if(!V.getElementById("rte-rtl-ui-styles")){var K=V.createElement("style");K.id="rte-rtl-ui-styles",K.appendChild(V.createTextNode(o())),(V.head||V.documentElement).appendChild(K),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(V,K,"rte-rtl-ui-styles",K.textContent)}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_rubyannotation=RTE_Plugin_RubyAnnotation;function RTE_Plugin_RubyAnnotation(){var N=this,u,r;N.PluginName="RubyAnnotation",N.InitConfig=function(k){u=k,u.rubyAnnotationEnabled!==!1&&(typeof u.rubyAnnotationParentheses!="boolean"&&(u.rubyAnnotationParentheses=!0),x("toolbar_full","#{rubyannotation}"),H("subtoolbar_more","rubyannotation"))},N.InitEditor=function(k){r=k,u.rubyAnnotationEnabled!==!1&&(r.ruby={add:function(M){return q(M)},get:function(){var M=o();return M?O(M):null},isRuby:function(){return!!o()},open:function(){N.OpenRubyDialog()},remove:function(){return b()}},F(),r.toolbarFactoryMap=r.toolbarFactoryMap||{},r.toolbarFactoryMap.rubyannotation=function(M){return r.createToolbarButton(M)},r.attachEvent("exec_command_rubyannotation",function(M){M.returnValue=!0,M.stopBubble=!0,N.OpenRubyDialog()}))};function x(k,M){u[k]&&u[k].indexOf(M)===-1&&(u[k]=u[k]+M)}function H(k,M){var I=u[k];if(!(!I||I.indexOf(M)!==-1)){var R=I.indexOf("}");R!==-1&&(u[k]=I.substring(0,R)+","+M+I.substring(R))}}function F(){var k=u.container.ownerDocument;if(!k.getElementById("rte-ruby-style")){var M=k.createElement("style");M.id="rte-ruby-style",M.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(""),k.head.appendChild(M),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(k,M,"rte-ruby-style",M.textContent)}}function $(){return r&&r.getEditable?r.getEditable():null}function z(){var k=r.getDocument();try{var M=k.getSelection();return!M||!M.rangeCount?null:M.getRangeAt(0)}catch{return null}}function o(){var k=z(),M=$();if(!k||!M)return null;for(var I=k.startContainer;I&&I!==M;){if(I.nodeType===1&&I.nodeName==="RUBY")return I;I=I.parentNode}return null}function O(k){var M=k.querySelector("rt");return M&&M.textContent||""}function V(k){for(var M="",I=0;I<k.childNodes.length;I++){var R=k.childNodes[I];R.nodeType===3?M+=R.nodeValue:R.nodeType===1&&R.nodeName!=="RT"&&R.nodeName!=="RP"&&(M+=R.textContent||"")}return M}function K(k){return String(k??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function W(k,M){var I=u.rubyAnnotationParentheses;return'<ruby class="rte-ruby-annotated">'+K(k)+(I?"<rp>(</rp>":"")+"<rt>"+K(M)+"</rt>"+(I?"<rp>)</rp>":"")+"</ruby>"}function q(k){var M=o();if(M){var I=M.querySelector("rt");return I||(I=M.ownerDocument.createElement("rt"),M.appendChild(I)),I.textContent=String(k??""),r.focus(),M}var R=z();if(!R||R.collapsed)return null;var l=String(R.toString()||"");return l?(r.insertHTML(W(l,k)),r.focus(),!0):null}function b(){var k=o();if(!k)return!1;var M=k.ownerDocument,I=M.createTextNode(V(k));return k.parentNode.insertBefore(I,k),k.parentNode.removeChild(k),r.focus(),!0}function m(k,M,I,R){var l=k.ownerDocument.createElement(M);return I&&(l.style.cssText=I),R&&(l.className=R),k.appendChild(l),l}N.OpenRubyDialog=function(){var k=o(),M=z(),I=k?V(k):M?String(M.toString()||""):"",R=r.createDialog(r.getLangText&&r.getLangText("rubyannotationtitle")||"Ruby annotation","rte-dialog-ruby"),l=typeof R.close=="function"?function(){R.close()}:function(){r.closeCurrentPopup()},f=m(R,"div","padding:14px;min-width:340px;font:13px -apple-system,Segoe UI,sans-serif");m(f,"div","font-weight:600;margin-bottom:4px").innerText="Base text";var _=m(f,"div","padding:8px 10px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;min-height:20px;word-break:break-word");_.textContent=I,m(f,"div","font-weight:600;margin:10px 0 4px").innerText="Reading";var v=m(f,"input","width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;font:13px inherit");v.type="text",v.value=k?O(k):"",v.placeholder="e.g. \u304B\u3093\u3058";var s=m(f,"div","font-size:11px;color:#94a3b8;margin-top:6px");s.innerText=I?"Shown above the base text. Parentheses are emitted for readers without ruby support.":"Select the text to annotate first, then reopen this dialog.";var c=m(f,"div","display:flex;justify-content:space-between;gap:8px;margin-top:14px"),p=m(c,"div","display:flex;gap:8px");if(k){var g=m(p,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#b91c1c;cursor:pointer");g.type="button",g.textContent="Remove",g.onclick=function(){b(),l()}}var h=m(c,"div","display:flex;gap:8px"),L=m(h,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");L.type="button",L.textContent="Cancel",L.onclick=l;var E=m(h,"button","padding:6px 14px;border:1px solid #1d67ba;border-radius:8px;background:#1d67ba;color:#fff;cursor:pointer");E.type="button",E.textContent=k?"Update":"Add",E.disabled=!I,E.onclick=function(){var A=v.value.trim();if(!A||!I){l();return}q(A),l()},setTimeout(function(){v.focus()},0)}}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 N=this,u,r,x=!1,H={removedTags:[],removedAttributes:[],calls:0,lastPasses:0},F=[];N.PluginName="Sanitizer",N.InitConfig=function(E){u=E},N.InitEditor=function(E){if(r=E,u.contentSanitizer===!1)return;r.sanitizeHtml=function(C){return l(String(C??""))},r.getSanitizerReport=function(){return JSON.parse(JSON.stringify(H))};function A(){try{f(),_()}catch{}try{L()}catch{}try{h()}catch{}}A();try{r.attachEvent("ready",A)}catch{}setTimeout(A,0),setTimeout(A,400)};var $={};"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){$[E]=!0});var z={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},o={};"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){o[E]=!0});var O={href:1,src:1,action:1,formaction:1,poster:1,cite:1,data:1,longdesc:1,background:1,ping:1,srcset:1},V=/^(https?|mailto|tel|ftp|sms|callto|webcal|geo|bitcoin):/i,K=/^data:image\/(png|jpe?g|gif|webp|bmp|x-icon|avif);base64,[a-z0-9+/=\s]+$/i;function W(E,A,C){var y=String(E??"").replace(/[\u0000-\u0020\u007F-\u00A0]+/g,"").trim();if(!y)return!1;if(A==="use")return y.charAt(0)==="#";if(/^[#?/]/.test(y))return!0;var d=/^([a-z][a-z0-9+.\-]*):/i.exec(y);return d?K.test(y)?A==="img"||A==="source"||C==="poster"||C==="srcset":/^blob:/i.test(y)?A==="img"||A==="video"||A==="audio"||A==="source":V.test(y):!0}function q(E){for(var A=[],C=String(E??"").split(";"),y=0;y<C.length;y++){var d=C[y];if(d.trim()&&!/expression\s*\(|(javascript|vbscript|livescript)\s*:|-moz-binding|behaviou?r\s*:|@import|-o-link/i.test(d)){var w=/url\s*\(\s*(['"]?)([^'")]*)\1\s*\)/i.exec(d);w&&!W(w[2],"img","src")||A.push(d.trim())}}return A.join("; ")}var b="allow-scripts allow-same-origin allow-presentation";function m(E){if(u.sanitizerAllowIframes===!1)return!1;var A=E.getAttribute("src")||"";if(!/^https?:/i.test(A))return!1;var C=u.sanitizerAllowedIframeHosts;if(!C||!C.length)return E.hasAttribute("sandbox")||E.setAttribute("sandbox",b),!0;try{for(var y=new URL(A).hostname.toLowerCase(),d=0;d<C.length;d++){var w=String(C[d]).toLowerCase();if(y===w||y.slice(-(w.length+1))==="."+w)return!0}}catch{}return!1}function k(E){var A={},C=[],y=[];(E||[]).forEach(function(w){if(w instanceof RegExp){y.push(w);return}var D=String(w).toLowerCase();if(D.indexOf("*")===-1){A[D]=!0;return}C.push(D.split("*"))});function d(w,D){var P=w[0];if(D.lastIndexOf(P,0)!==0)return!1;var B=w[w.length-1];if(B&&(D.length<B.length||D.indexOf(B,D.length-B.length)===-1))return!1;for(var Z=P.length,fe=1;fe<w.length;fe++)if(w[fe]){var re=D.indexOf(w[fe],Z);if(re===-1)return!1;Z=re+w[fe].length}return!0}return function(w){if(A[w])return!0;for(var D=0;D<C.length;D++)if(d(C[D],w))return!0;for(var P=0;P<y.length;P++)if(y[P].test(w))return!0;return!1}}function M(E,A){var C=k(u.sanitizerAllowTags),y=k(u.sanitizerAllowAttributes),d=u.sanitizerAllowStyleTags===!0,w=[];(function se(U){for(var Q=0;Q<U.childNodes.length;Q++){var j=U.childNodes[Q];j.nodeType===1?(w.push(j),se(j)):j.nodeType===8&&w.push(j)}})(E);for(var D=0;D<w.length;D++){var P=w[D];if(P.parentNode){if(P.nodeType===8){s(P.data)&&(R(A.removedTags,"#comment"),P.parentNode.removeChild(P));continue}var B=(P.localName||P.nodeName||"").toLowerCase();if(B==="style"){if(!d){R(A.removedTags,"style"),P.parentNode.removeChild(P);continue}}else if(B==="iframe"){if(P.hasAttribute("srcdoc")&&(R(A.removedAttributes,"iframe[srcdoc]"),P.removeAttribute("srcdoc")),!m(P)){R(A.removedTags,"iframe"),P.parentNode.removeChild(P);continue}}else if(B==="title"||B==="desc"){if(!P.closest||!P.closest("svg")){R(A.removedTags,B),P.parentNode.removeChild(P);continue}}else if(z[B]){R(A.removedTags,B),P.parentNode.removeChild(P);continue}else if(!$[B]&&!C(B)){R(A.removedTags,B),I(P);continue}for(var Z=[],fe=0;fe<P.attributes.length;fe++)Z.push(P.attributes[fe]);for(var re=0;re<Z.length;re++){var ie=Z[re].name.toLowerCase(),ae=Z[re].value;if(ie.indexOf("on")===0){R(A.removedAttributes,ie),P.removeAttribute(Z[re].name);continue}if(ie==="xlink:href"||ie==="xmlns:xlink"){W(ae,B,ie)||(R(A.removedAttributes,ie),P.removeAttribute(Z[re].name));continue}if(ie==="srcdoc"){R(A.removedAttributes,"srcdoc"),P.removeAttribute(Z[re].name);continue}if(ie==="style"){P.setAttribute("style",q(ae));continue}if(!(ie.indexOf("data-")===0||ie.indexOf("aria-")===0)){if(O[ie]){W(ae,B,ie)||(R(A.removedAttributes,B+"["+ie+"]"),P.removeAttribute(Z[re].name));continue}!o[ie]&&!y(ie)&&(R(A.removedAttributes,ie),P.removeAttribute(Z[re].name))}}if(B==="a"&&(P.getAttribute("target")||"").toLowerCase()==="_blank"){var de=(P.getAttribute("rel")||"").toLowerCase();de.indexOf("noopener")<0&&P.setAttribute("rel",(de?de+" ":"")+"noopener noreferrer")}}}return E}function I(E){for(var A=E.parentNode;E.firstChild;)A.insertBefore(E.firstChild,E);A.removeChild(E)}function R(E,A){E.indexOf(A)<0&&E.push(A)}function l(E){var A=E;H.calls++;for(var C=0;C<3;C++){var y=new DOMParser().parseFromString("<body>"+A+"</body>","text/html");M(y.body,H);var d=y.body.innerHTML;if(H.lastPasses=C+1,d===A)break;A=d}return A}function f(){if(!x){for(var E=["getHTMLCode","getHTMLContent"],A=!1,C=0;C<E.length;C++)(function(y){var d=r[y];if(!(typeof d!="function"||d.__rteSanitized)){var w=function(){var D=d.apply(r,arguments);return typeof D!="string"?D:l(D)};w.__rteSanitized=!0,r[y]=w,A=!0}})(E[C]);A&&(x=!0)}}function _(){for(var E=["setHTMLCode","setHTMLContent"],A=0;A<E.length;A++)(function(C){var y=r[C];if(!(typeof y!="function"||y.__rteSanitizedIn)){var d=function(w){var D=[].slice.call(arguments);return typeof w=="string"&&(D[0]=l(w)),y.apply(r,D)};d.__rteSanitizedIn=!0,r[C]=d}})(E[A])}function v(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 s(E){var A=String(E??"");return A.indexOf("-->")!==-1||A.indexOf("--!>")!==-1||A.charAt(0)===">"||A.charAt(0)==="-"&&A.charAt(1)===">"}var c=/^(script|iframe|object|embed|base|meta|link|form)$/;function p(E){if(!E.attributes)return!1;for(var A=0;A<E.attributes.length;A++){var C=E.attributes[A].name.toLowerCase();if(C.indexOf("on")===0||C==="srcdoc"||(C==="href"||C==="src"||C==="data"||C==="action"||C==="xlink:href")&&/(javascript|vbscript)\s*:|data:\s*text\/html/i.test(E.attributes[A].value||""))return!0}return!1}function g(E){if(c.test(E.localName||"")||p(E))return!0;for(var A=E.getElementsByTagName?E.getElementsByTagName("*"):[],C=0;C<A.length;C++)if(c.test(A[C].localName||"")||p(A[C]))return!0;return!1}function h(){if(u.sanitizerGuardLiveDom!==!1){var E=null;try{E=r.getEditable()}catch{return}if(!(!E||E.__rteLiveGuard)){E.__rteLiveGuard=!0;var A=new MutationObserver(function(C){for(var y=!1,d=0;d<C.length&&!y;d++){var w=C[d];if(w.type==="attributes"){var D=(w.attributeName||"").toLowerCase();(D.indexOf("on")===0||D==="srcdoc"||p(w.target))&&(y=!0);continue}for(var P=0;P<w.addedNodes.length;P++){var B=w.addedNodes[P];if(B.nodeType===8){if(s(B.data)){y=!0;break}continue}if(B.nodeType===1&&g(B)){y=!0;break}}}if(y)try{M(E,H)}catch{}});A.observe(E,{childList:!0,subtree:!0,attributes:!0}),F.push(A)}}}function L(){var E=null;try{E=r.getEditable()}catch{return}if(!E||E.__rteSanitizePaste)return;E.__rteSanitizePaste=!0,E.addEventListener("paste",function(C){var y=C.clipboardData||window.clipboardData;if(y){var d="";try{d=y.getData("text/html")||""}catch{return}if(!(!d||!v(d))){C.preventDefault(),C.stopImmediatePropagation();var w=l(d);try{r.insertHTML(w)}catch{try{r.insertText(y.getData("text/plain")||"")}catch{}}}}},!0);function A(){var C=function(){try{M(E,H)}catch{}};setTimeout(C,0),setTimeout(C,250)}E.addEventListener("paste",A,!1),E.addEventListener("drop",A,!0)}}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 N=this,u,r,x=null,H=null,F=null;N.PluginName="ShadowDom",N.InitConfig=function(I){u=I},N.InitEditor=function(I){r=I,r.getShadowRoot=function(){return z()},r.isInShadowDom=function(){return!!z()},r.adoptEditorStyles=function(R){return m(R||z(),!0)},r.getAdoptedStyleCount=function(){return F?F.size:0},!(u&&u.shadowStyleAdoption===!1)&&o(function(){x=z(),x&&(F=new(window.Set||Array),m(x,!1),M(x))})},N.Destroy=function(){if(H){try{H.disconnect()}catch{}H=null}};function $(){try{var I=r.getEditable(),R=I&&I.ownerDocument&&I.ownerDocument.defaultView?I.ownerDocument.defaultView.frameElement:null;if(!R)return null;for(var l=R;l;){if(l.classList&&l.classList.contains("richtexteditor"))return l;l=l.parentNode||l.host}return R}catch{return null}}function z(){var I=$();if(!I||typeof I.getRootNode!="function")return null;var R=I.getRootNode();return R&&R.host&&R!==document?R:null}function o(I){if($()){I();return}var R=0,l=window.setInterval(function(){($()||++R>100)&&(window.clearInterval(l),I())},50)}function O(){try{for(var I=document.getElementsByTagName("script"),R=0;R<I.length;R++){var l=I[R].src||"";if(/(^|\/)rte(\.min)?\.js(\?|$)/.test(l))return l.replace(/[^\/]*$/,"")}}catch{}return null}function V(I){var R=String(I.id||"");if(/^rte[-_]|^__rte/.test(R))return!0;var l=I.href||"";if(!l){if(I.tagName==="STYLE"){var f=I.textContent||"";return/[.]richtexteditor|rte-toolbar|rte-editor|rte-dialog|[.]rte-a11y/.test(f)}return!1}var _=O();return _&&l.indexOf(_)===0?!0:/rte_theme|rte_mobile|richtexteditor_content|richtexteditor_preview|aitoolkit/.test(l)}function K(){var I=u&&u.shadowStyleSources||null;return I?typeof I=="string"?[I]:I:[]}function W(I){return(I.href||"")+"|"+(I.id||"")+"|"+(I.textContent||"").length}function q(I){return F&&(F.has?F.has(I):F.indexOf(I)>=0)}function b(I){F&&(F.add?F.add(I):F.push(I))}function m(I,R){if(!I)return 0;F||(F=new(window.Set||Array));for(var l=0,f=document.querySelectorAll("link[rel~=stylesheet],style"),_=0;_<f.length;_++){var v=f[_];if(V(v)){var s=W(v);!R&&q(s)||q(s)||(I.appendChild(k(v,I)),b(s),l++)}}for(var c=K(),p=0;p<c.length;p++){var g="extra|"+c[p];if(!q(g)){var h=document.createElement("link");h.rel="stylesheet",h.href=c[p],h.setAttribute("data-rte-adopted","1"),I.appendChild(h),b(g),l++}}try{if(I.adoptedStyleSheets&&document.adoptedStyleSheets&&document.adoptedStyleSheets.length){for(var L=I.adoptedStyleSheets.slice(),E=0;E<document.adoptedStyleSheets.length;E++)L.indexOf(document.adoptedStyleSheets[E])<0&&L.push(document.adoptedStyleSheets[E]);I.adoptedStyleSheets=L}}catch{}return l}function k(I,R){if(I.tagName==="LINK"){var l=document.createElement("link");return l.rel="stylesheet",l.href=I.href,I.media&&(l.media=I.media),l.setAttribute("data-rte-adopted","1"),l}var f=document.createElement("style");return f.textContent=I.textContent,I.id&&f.setAttribute("data-rte-source-id",I.id),f.setAttribute("data-rte-adopted","1"),f}function M(I){window.MutationObserver&&(H=new MutationObserver(function(R){for(var l=!1,f=0;f<R.length&&!l;f++)for(var _=R[f].addedNodes||[],v=0;v<_.length;v++){var s=_[v];if(s.nodeType===1&&(s.tagName==="STYLE"||s.tagName==="LINK")&&V(s)){l=!0;break}}l&&m(I,!1)}),H.observe(document.head||document.documentElement,{childList:!0,subtree:!0}))}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_slashcommand=RTE_Plugin_SlashCommand;function RTE_Plugin_SlashCommand(){var N=this,u,r,x=null,H=null,F=null,$=[],z=[],o=0,O=!1,V=!1;N.PluginName="SlashCommand",N.InitConfig=function(Me){u=Me,u.slashCommandEnabled!==!1&&(u.slashCommandTrigger=u.slashCommandTrigger||"/",u.slashCommandMaxItems=u.slashCommandMaxItems||40,u.slashCommandIncludeAi=u.slashCommandIncludeAi!==!1,u.slashCommands=u.slashCommands||null)},N.InitEditor=function(Me){if(r=Me,u.slashCommandEnabled!==!1){if(r.slashCommands={register:K,remove:b,list:function(){return q(),$.slice()},open:function(){c(!0)},close:p,isOpen:function(){return!!H}},$=f(),Array.isArray(u.slashCommands))for(var Se=0;Se<u.slashCommands.length;Se++)K(u.slashCommands[Se]);setTimeout(q,0),B();var Ze=r.getDocument();Ze.addEventListener("keydown",_,!0),Ze.addEventListener("input",v,!0),Ze.addEventListener("compositionstart",function(){O=!0}),Ze.addEventListener("compositionend",function(){O=!1}),Ze.addEventListener("mousedown",function(){p()},!0),Ze.addEventListener("blur",function(){setTimeout(p,150)},!0),window.addEventListener("scroll",P,!0),window.addEventListener("resize",P,!0)}};function K(Me){if(!(!Me||!Me.id)){var Se=m(Me.id);Se>=0?$[Se]=M(Me):$.push(M(Me))}}var W={};function q(){if(r){for(var Me=[],Se=0;Se<$.length;Se++)$[Se]._default||Me.push($[Se]);for(var Ze=f(),nt=[],Nt=0;Nt<Ze.length;Nt++){var jt=Ze[Nt].id;if(!W[jt]){for(var Vt=!1,ut=0;ut<Me.length;ut++)if(Me[ut].id===jt){Vt=!0;break}Vt||nt.push(Ze[Nt])}}$=nt.concat(Me)}}function b(Me){W[Me]=!0;var Se=m(Me);Se>=0&&$.splice(Se,1)}function m(Me){for(var Se=0;Se<$.length;Se++)if($[Se].id===Me)return Se;return-1}function k(Me,Se){try{var Ze=String(Me).toLowerCase().replace(/[^a-z0-9_]/g,"_");if(u&&u["text_"+Ze]&&r&&typeof r.getLangText=="function")return r.getLangText(Ze)}catch{}return Se}function M(Me){var Se=Me.section||"Blocks";return{id:Me.id,section:k("slash_section_"+Se,Se),title:k("slash_"+Me.id,Me.title||Me.id),description:k("slash_"+Me.id+"_desc",Me.description||""),keywords:(Me.keywords||[]).slice(),icon:Me.icon||"",iconSvg:Me.iconSvg||"",run:Me.run||Me.action}}var I={P:1,DIV:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,BLOCKQUOTE:1,PRE:1,LI:1};function R(){var Me=r.getSelection();if(!Me||Me.rangeCount===0)return null;for(var Se=Me.getRangeAt(0).startContainer,Ze=r.getEditable();Se&&Se!==Ze;){if(Se.nodeType===1&&I[Se.nodeName])return Se;Se=Se.parentNode}return null}function l(Me){var Se=R();if(Me=Me.toUpperCase(),Se&&!Se.textContent.trim()){var Ze=r.getDocument(),nt=Ze.createElement(Me);nt.appendChild(Ze.createElement("br")),Se.parentNode.replaceChild(nt,Se);var Nt=Ze.createRange();Nt.setStart(nt,0),Nt.setEnd(nt,0);var jt=r.getSelection();jt.removeAllRanges(),jt.addRange(Nt);return}r.execCommand("formatblock",Me)}function f(){var Me=[];function Se(ut,sr,Fn,Un,Or,na,Ko){var co=M({id:sr,section:ut,title:Fn,description:Un,keywords:Or,iconSvg:na,run:Ko});co._default=!0,Me.push(co)}if(Se("Blocks","heading1","Heading 1","Large section heading",["h1","title"],Z("1"),function(){l("H1")}),Se("Blocks","heading2","Heading 2","Medium section heading",["h2","subtitle"],Z("2"),function(){l("H2")}),Se("Blocks","heading3","Heading 3","Small section heading",["h3"],Z("3"),function(){l("H3")}),Se("Blocks","paragraph","Paragraph","Plain body text",["p","text","body"],fe(),function(){l("P")}),Se("Blocks","bulletlist","Bulleted list","Unordered list",["ul","bullets","list"],re(),function(){r.execCommand("insertunorderedlist")}),Se("Blocks","numberlist","Numbered list","Ordered list",["ol","numbered"],ie(),function(){r.execCommand("insertorderedlist")}),Se("Blocks","quote","Quote","Block quotation",["blockquote"],ae(),function(){r.execCommand("insertblockquote")}),Se("Blocks","code","Code block","Monospaced code block",["pre","snippet"],de(),function(){r.isCommandEnabled&&r.isCommandEnabled("insertcode")?r.execCommand("insertcode"):r.execCommand("formatblock","PRE")}),Se("Blocks","divider","Divider","Horizontal rule",["hr","line","separator"],se(),function(){r.execCommand("inserthorizontalrule")}),(!r.isCommandEnabled||r.isCommandEnabled("insertcallout"))&&Se("Blocks","callout","Callout","Highlighted info / warning box",["admonition","info","warning","note","tip"],pe(),function(){r.execCommand("insertcallout")}),(!r.isCommandEnabled||r.isCommandEnabled("insertcolumns"))&&Se("Blocks","columns","Columns","Multi-column layout",["layout","grid","column"],ye(),function(){r.execCommand("insertcolumns")}),(!r.isCommandEnabled||r.isCommandEnabled("inserttoggle"))&&Se("Blocks","toggle","Toggle list","Collapsible toggle block",["collapse","details","accordion","expand"],me(),function(){r.execCommand("inserttoggle")}),(!r.isCommandEnabled||r.isCommandEnabled("insertmath"))&&Se("Insert","equation","Equation","Insert a math equation (TeX)",["math","latex","tex","formula","katex"],ee(),function(){r.execCommand("insertmath")}),(!r.isCommandEnabled||r.isCommandEnabled("inserttodolist"))&&Se("Blocks","todolist","To-do list","Checklist with clickable checkboxes",["task","todo","checklist","checkbox","check"],pt(),function(){r.execCommand("inserttodolist")}),(!r.isCommandEnabled||r.isCommandEnabled("insertdiagram"))&&Se("Insert","diagram","Diagram","Insert a Mermaid diagram",["mermaid","flowchart","sequence","gantt","graph","uml"],ke(),function(){r.execCommand("insertdiagram")}),(!r.isCommandEnabled||r.isCommandEnabled("insertbookmark"))&&Se("Insert","bookmark","Bookmark","Insert a link preview card",["link","url","embed","preview","card"],ue(),function(){r.execCommand("insertbookmark")}),(!r.isCommandEnabled||r.isCommandEnabled("spellcheck"))&&Se("Tools","spellcheck","Spell check","Check spelling",["spelling","grammar","proofread","typo"],ce(),function(){r.execCommand("spellcheck")}),(!r.isCommandEnabled||r.isCommandEnabled("insertdatechip"))&&Se("Insert","datechip","Date chip","Insert an interactive date chip",["date","calendar","chip","today"],ve(),function(){r.execCommand("insertdatechip")}),(!r.isCommandEnabled||r.isCommandEnabled("insertchip"))&&Se("Insert","chip","Smart chip","Insert a date / person / link chip",["chip","person","mention","link","pill"],ve(),function(){r.execCommand("insertchip")}),(!r.isCommandEnabled||r.isCommandEnabled("emailexport"))&&Se("Tools","emailexport","Export email HTML","Inline-styled HTML for email",["email","inline","mail","newsletter","html"],be(),function(){r.execCommand("emailexport")}),typeof r.openFindDialog=="function"&&Se("Tools","findreplace","Find & replace","Search the document and replace text",["find","replace","search","query","substitute"],yt(),function(){r.openFindDialog()}),typeof r.showShortcuts=="function"&&Se("Tools","shortcuts","Keyboard shortcuts","Show the keyboard shortcut cheat sheet (Ctrl+/)",["keyboard","shortcuts","hotkeys","keys","help","cheat"],Ge(),function(){r.showShortcuts()}),typeof r.foldAtCaret=="function"&&(Se("Tools","foldsection","Fold section","Collapse the section under the current heading",["fold","collapse","heading","outline","section"],Bt(),function(){r.foldAtCaret()}),Se("Tools","unfoldall","Unfold all","Expand every collapsed heading section",["unfold","expand","headings","collapse"],Bt(),function(){r.unfoldAll&&r.unfoldAll()})),(!r.isCommandEnabled||r.isCommandEnabled("readaloud"))&&Se("Tools","readaloud","Read aloud","Speak the selection or document (text-to-speech)",["tts","speak","speech","voice","accessibility","narrate"],Pe(),function(){r.execCommand("readaloud")}),typeof r.sortTableAtCaret=="function"&&(Se("Tools","sorttableasc","Sort table by this column","Sort the table rows by the column the caret is in",["sort","table","column","order","ascending"],ft(),function(){r.sortTableAtCaret("asc")}),Se("Tools","sorttabledesc","Sort table (descending)","Sort the table rows by this column, largest first",["sort","table","column","descending","reverse"],ft(),function(){r.sortTableAtCaret("desc")}),Se("Tools","tablerownumbers","Number table rows","Add or remove an automatic row-numbering column",["number","rows","table","count","index"],ft(),function(){r.execCommand("tablerownumbers")})),typeof r.setTableLayoutMode=="function"&&(Se("Insert","layouttable","Layout table","Insert a borderless table for positioning content (role=presentation)",["layout","table","grid","email","columns","presentation"],U(),function(){r.insertLayoutTable(2,2)}),Se("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"],U(),function(){r.setTableLayoutMode("layout")}),Se("Tools","tabledatamode","Mark table as data","This table states relationships \u2014 restore its header cells",["data","table","header","accessibility"],U(),function(){r.setTableLayoutMode("data",null,{promoteFirstRow:!0})})),typeof r.moveBlockUp=="function"&&(Se("Tools","moveblockup","Move block up","Move this paragraph or block above the previous one (Alt+Shift+Up)",["move","block","up","reorder","drag"],Le(),function(){r.moveBlockUp()}),Se("Tools","moveblockdown","Move block down","Move this paragraph or block below the next one (Alt+Shift+Down)",["move","block","down","reorder","drag"],Le(),function(){r.moveBlockDown()})),typeof r.toggleRtlUserInterface=="function"&&Se("Tools","rtlui","Mirror editor for RTL","Flip the toolbar, menus and dialogs for right-to-left languages",["rtl","mirror","interface","toolbar","arabic","hebrew"],qe(),function(){r.toggleRtlUserInterface()}),typeof r.setTextDirection=="function"&&(Se("Tools","rtl","Right-to-left","Set this paragraph to right-to-left (Arabic, Hebrew, Persian)",["rtl","arabic","hebrew","persian","urdu","direction","bidi"],qe(),function(){r.setTextDirection("rtl")}),Se("Tools","ltr","Left-to-right","Set this paragraph to left-to-right",["ltr","direction","bidi"],Re(),function(){r.setTextDirection("ltr")}),Se("Tools","autodir","Detect text direction","Set each paragraph's direction from its own content",["direction","detect","auto","rtl","bidi"],qe(),function(){r.autoDetectTextDirection()})),typeof r.toggleFormattingMarks=="function"&&Se("Tools","formattingmarks","Formatting marks","Show paragraph marks, block outlines and invisible characters",["marks","pilcrow","paragraph","invisible","whitespace","nbsp"],Ie(),function(){r.toggleFormattingMarks()}),typeof r.toggleWatermark=="function"&&Se("Tools","watermark","Watermark","Draw DRAFT or CONFIDENTIAL behind the content",["watermark","draft","confidential","background","stamp"],Ve(),function(){r.toggleWatermark()}),typeof r.toggleLineNumbers=="function"&&Se("Tools","linenumbers","Line numbers","Number every line in the margin, as pleadings and transcripts require",["line","numbers","margin","pleading","legal","transcript"],Ye(),function(){r.toggleLineNumbers()}),typeof r.togglePermanentPen=="function"&&Se("Tools","permanentpen","Permanent pen","Keep typing in a fixed annotation format until switched off",["pen","marker","annotate","highlight","review"],ht(),function(){r.togglePermanentPen()}),typeof r.checkLinks=="function"&&Se("Tools","checklinks","Check links","Find broken anchors, unsafe schemes and unlabelled links",["link","check","broken","audit","url","accessibility"],At(),function(){r.highlightLinkIssues(!0),r.checkLinks()}),typeof r.getMergeFieldDefinitions=="function"){for(var Ze=r.getMergeFieldDefinitions(),nt=0;nt<Ze.length;nt++)(function(ut){!ut||!ut.id||Se("Insert","mergefield-"+ut.id,ut.label||ut.id,"Insert the "+(ut.label||ut.id)+" merge field",["merge","field","placeholder","variable","mail merge",ut.id],Rt(),function(){r.insertMergeField(ut.id)})})(Ze[nt]);Se("Tools","mergepreview","Preview merge fields","Swap merge-field placeholders for sample data",["merge","preview","sample","data","placeholder"],Rt(),function(){r.toggleMergeFieldPreview()})}if(typeof r.listCrossReferenceTargets=="function"){var Nt=[];try{Nt=r.listCrossReferenceTargets()}catch{Nt=[]}for(var jt=0;jt<Nt.length&&jt<40;jt++)(function(ut){if(!(!ut||!ut.id)){var sr=ut.number?ut.number+" "+ut.label:ut.label;Se("Insert","xref-"+ut.id,"Reference: "+sr,"Insert a cross-reference to this "+ut.type+" that updates itself",["cross","reference","xref","see","refer",ut.type,ut.number||""],ar(),function(){r.insertCrossReference(ut.id,ut.number?"label":"text")})}})(Nt[jt])}if(typeof r.insertTableOfContents=="function"&&Se("Insert","toc","Table of contents","Insert a contents block that updates itself from your headings",["toc","contents","outline","index","headings"],ze(),function(){r.insertTableOfContents()}),typeof r.insertFootnote=="function"&&Se("Insert","footnote","Footnote","Insert a numbered footnote reference and note",["footnote","note","citation","reference","endnote","cite"],je(),function(){r.insertFootnote()}),typeof r.toggleFormatPainter=="function"&&Se("Tools","formatpainter","Format painter","Copy formatting here, then select the text to paint it onto",["format","painter","brush","copy","style","clone"],We(),function(){r.toggleFormatPainter()}),typeof r.changeCase=="function"&&(Se("Tools","caseupper","UPPERCASE","Convert the selection to upper case",["case","upper","caps","capitals"],Oe(),function(){r.changeCase("upper")}),Se("Tools","caselower","lowercase","Convert the selection to lower case",["case","lower","small"],Oe(),function(){r.changeCase("lower")}),Se("Tools","casetitle","Title Case","Capitalise each significant word in the selection",["case","title","headline","capitalise","capitalize"],Oe(),function(){r.changeCase("title")}),Se("Tools","casesentence","Sentence case","Capitalise the first letter of each sentence",["case","sentence","capitalise","capitalize"],Oe(),function(){r.changeCase("sentence")})),typeof r.requestGhostText=="function"&&Se("Tools","aicomplete","AI complete","Suggest an inline AI completion of the current sentence",["ai","complete","autocomplete","ghost","suggest","continue","copilot"],lr(),function(){r.requestGhostText()}),typeof r.exportToPdf=="function"&&Se("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"],Zt(),function(){r.exportToPdf()}),typeof r.exportToDocx=="function"&&Se("Tools","exportdocx","Export to Word (.docx)","A real OOXML document, built in the browser with no upload",["word","docx","ooxml","export","download","save","office"],$t(),function(){r.exportToDocx()}),typeof r.openImportDialog=="function"&&Se("Tools","import-document","Import document","Open a Markdown, HTML, text, or Word file into the editor",["import","open","file","word","docx","markdown","upload"],$t(),function(){r.openImportDialog({})}),typeof r.getReadabilityStats=="function"&&Se("Tools","readability-stats","Readability statistics","Flesch reading ease, grade level, and reading time",["readability","flesch","grade","reading","stats","score"],ce(),function(){r.execCommand("readability")}),typeof r.insertCrossReference=="function"&&Se("Insert","crossreference","Cross-reference","Insert a live reference to a heading, figure, table, or bookmark",["cross","reference","xref","see","figure","heading"],ar(),function(){r.execCommand("insertcrossreference")}),r.restrictedEditing&&Se("Tools","restrictedediting","Restricted editing","Lock the document and mark only the regions others may edit",["restrict","lock","protect","editable","region","permission"],ht(),function(){r.execCommand("restrictedediting")}),r.dictation&&Se("Tools","dictation","Dictation","Speak and have your words typed into the document",["dictate","speech","voice","microphone","talk"],Pe(),function(){r.execCommand("dictation")}),typeof r.copyAsMarkdown=="function"&&(Se("Tools","copymarkdown","Copy as Markdown","Copy the whole document to the clipboard as Markdown",["markdown","md","copy","clipboard","export"],zt(),function(){r.copyAsMarkdown()}),Se("Tools","downloadmarkdown","Download as Markdown","Save the document as a .md file",["markdown","md","download","export","save","file"],zt(),function(){r.downloadMarkdown()})),typeof r.toggleTypewriterMode=="function"&&(Se("Tools","typewriter","Typewriter mode","Keep the caret line centred as you type",["typewriter","center","scroll","focus","distraction","zen"],Et(),function(){r.toggleTypewriterMode()}),Se("Tools","focusmode","Focus mode","Dim everything except the current paragraph",["focus","dim","highlight","distraction","zen","concentrate"],lt(),function(){r.toggleFocusMode()})),Se("Insert","table","Table","Insert a table",["grid","rows","columns"],U(),function(){r.execCommand("inserttable")}),Se("Insert","image","Image","Upload or embed an image",["picture","photo","img"],Q(),function(){r.execCommand("imageupload")}),Se("Insert","link","Link","Insert a hyperlink",["url","anchor"],j(),function(){r.execCommand("insertlink")}),Se("Insert","emoji","Emoji","Insert an emoji",["smiley","icon"],J(),function(){r.execCommand("insertemoji")}),Se("Insert","template","Template","Insert from template gallery",["snippet"],Y(),function(){r.execCommand("inserttemplate")}),Se("Insert","date","Today's date","Insert the current date",["time","now"],te(),function(){r.execCommand("insertdate")}),u.slashCommandIncludeAi&&Array.isArray(u.aiToolkitActions))for(var Vt=0;Vt<u.aiToolkitActions.length;Vt++)(function(ut){Me.push(M({id:"ai-"+ut.id,section:"AI",title:ut.title||ut.id,description:ut.description||"",keywords:["ai",ut.id],iconSvg:u["svgCode_aiassist_"+(ut.icon||ut.id)]||u.svgCode_aiassist||"",run:function(){var sr=r.aiToolkit;if(sr){if(ut.id==="chat-panel"&&typeof sr.openChatPanel=="function"){sr.openChatPanel();return}if(ut.id==="review-panel"&&typeof sr.openReviewPanel=="function"){sr.openReviewPanel();return}if(ut.id==="open-dialog"&&typeof sr.openDialog=="function"){sr.openDialog();return}if(typeof sr.runQuickAction=="function"){sr.runQuickAction(ut.id);return}typeof sr.resolveAction=="function"&&sr.resolveAction(ut.id)}}}))})(u.aiToolkitActions[Vt]);return Me}function _(Me){if(!O){if(H)switch(Me.key){case"ArrowDown":Me.preventDefault(),Me.stopPropagation(),y(1);return;case"ArrowUp":Me.preventDefault(),Me.stopPropagation(),y(-1);return;case"Enter":case"Tab":if(z.length){Me.preventDefault(),Me.stopPropagation(),d();return}p();return;case"Escape":case"Esc":Me.preventDefault(),Me.stopPropagation(),p();return}if(Me.key===u.slashCommandTrigger&&!Me.ctrlKey&&!Me.metaKey&&!Me.altKey){if(!s())return;V=!1,setTimeout(function(){V||c(!1)},0)}}}function v(){H&&g()}function s(){var Me=r.getSelection();if(!Me||Me.rangeCount===0||!Me.isCollapsed)return!1;for(var Se=Me.getRangeAt(0),Ze=Se.startContainer,nt=Se.startOffset,Nt=r.getEditable(),jt=Ze.nodeType===1?Ze:Ze.parentNode;jt&&jt!==Nt;){var Vt=jt.nodeName;if(Vt==="CODE"||Vt==="PRE")return!1;jt=jt.parentNode}if(Ze.nodeType===3){if(nt===0)return!0;var ut=Ze.nodeValue.charAt(nt-1);return/\s/.test(ut)}return!0}function c(Me){q(),p();var Se=r.getSelection();if(!(!Se||Se.rangeCount===0)){var Ze=Se.getRangeAt(0).cloneRange();F={range:Ze,startNode:Ze.startContainer,startOffset:Ze.startOffset,triggerCharCount:Me?0:1,query:""},L(),D(),h("")}}function p(){H&&H.parentNode&&H.parentNode.removeChild(H),H=null,F=null,z=[],o=0}function g(){if(F){var Me=r.getSelection();if(!Me||Me.rangeCount===0||!Me.isCollapsed){p();return}var Se=Me.getRangeAt(0),Ze=Se.startContainer;if(Ze!==F.startNode){p();return}var nt=Se.startOffset;if(nt<F.startOffset){p();return}var Nt=(Ze.nodeType===3?Ze.nodeValue:"")||"",jt=Nt.substring(F.startOffset,nt);if(/\s/.test(jt)){p();return}F.query=jt,h(jt),D()}}function h(Me){var Se=(Me||"").toLowerCase();z=$.filter(function(Ze){if(!Se||Ze.title.toLowerCase().indexOf(Se)!==-1||Ze.description&&Ze.description.toLowerCase().indexOf(Se)!==-1)return!0;for(var nt=0;nt<Ze.keywords.length;nt++)if(String(Ze.keywords[nt]).toLowerCase().indexOf(Se)!==-1)return!0;return!1}).slice(0,u.slashCommandMaxItems),o=0,E()}function L(){x=r.iframe.ownerDocument,H=x.createElement("div"),H.className="rte-slash-popup";try{var Me=r.container||r.getEditable&&r.getEditable().closest&&r.getEditable().closest(".richtexteditor");Me&&Me.classList&&Me.classList.contains("rte-dark")&&(H.className+=" rte-slash-popup-dark")}catch{}H.setAttribute("role","listbox"),H.setAttribute("aria-label","Slash commands"),x.body.appendChild(H)}function E(){if(H){if(H.innerHTML="",!z.length){var Me=x.createElement("div");Me.className="rte-slash-empty",Me.textContent="No matching commands",H.appendChild(Me);return}for(var Se="",Ze=0;Ze<z.length;Ze++)(function(nt,Nt){if(nt.section!==Se){var jt=x.createElement("div");jt.className="rte-slash-section",jt.textContent=nt.section,H.appendChild(jt),Se=nt.section}var Vt=x.createElement("button");Vt.type="button",Vt.className="rte-slash-item"+(Nt===o?" rte-slash-item-active":""),Vt.setAttribute("role","option"),Vt.setAttribute("aria-selected",Nt===o?"true":"false"),Vt.setAttribute("data-index",Nt);var ut=x.createElement("span");ut.className="rte-slash-item-icon",ut.innerHTML=nt.iconSvg||le(),Vt.appendChild(ut);var sr=x.createElement("span");sr.className="rte-slash-item-body";var Fn=x.createElement("span");if(Fn.className="rte-slash-item-title",Fn.textContent=nt.title,sr.appendChild(Fn),nt.description){var Un=x.createElement("span");Un.className="rte-slash-item-desc",Un.textContent=nt.description,sr.appendChild(Un)}Vt.appendChild(sr),Vt.addEventListener("mousedown",function(Or){Or.preventDefault(),Or.stopPropagation(),o=Nt,d()}),Vt.addEventListener("click",function(Or){H&&(Or.preventDefault(),Or.stopPropagation(),o=Nt,d())}),Vt.addEventListener("mouseenter",function(){o!==Nt&&(o=Nt,A())}),H.appendChild(Vt)})(z[Ze],Ze)}}function A(){if(H){for(var Me=H.querySelectorAll(".rte-slash-item"),Se=0;Se<Me.length;Se++){var Ze=+Me[Se].getAttribute("data-index"),nt=Ze===o;Me[Se].classList.toggle("rte-slash-item-active",nt),Me[Se].setAttribute("aria-selected",nt?"true":"false")}C()}}function C(){if(H){var Me=H.querySelector(".rte-slash-item-active");if(Me){var Se=Me.offsetTop,Ze=Se+Me.offsetHeight;Se<H.scrollTop?H.scrollTop=Se:Ze>H.scrollTop+H.clientHeight&&(H.scrollTop=Ze-H.clientHeight)}}}function y(Me){z.length&&(o=(o+Me+z.length)%z.length,A())}function d(){if(!z.length){p();return}var Me=z[o],Se=F;if(p(),!(!Me||!Se)){w(Se);var Ze=r.getDocument();Ze.activeElement!==r.getEditable()&&!Ze.hasFocus()&&r.focus();try{Me.run(r)}catch(nt){console.warn("Slash command failed:",nt)}}}function w(Me){var Se=Me.startNode;if(Se){var Ze=Me.startOffset-(Me.triggerCharCount||0);Ze<0&&(Ze=0);var nt=r.getSelection();if(!(!nt||nt.rangeCount===0)){var Nt=nt.getRangeAt(0),jt,Vt;Se.nodeType===3&&Nt.startContainer===Se?(jt=Se,Vt=Nt.startOffset):(jt=Nt.startContainer,Vt=Nt.startOffset);var ut=r.getDocument().createRange();ut.setStart(Se,Ze),ut.setEnd(jt,Vt);try{ut.deleteContents()}catch{return}nt.removeAllRanges(),nt.addRange(ut)}}}function D(){if(!(!H||!F)){var Me=r.iframe,Se=Me.getBoundingClientRect(),Ze=F.range.getClientRects(),nt=Ze&&Ze.length?Ze[Ze.length-1]:null;nt||(nt=F.range.getBoundingClientRect());var Nt=Se.left+(nt.left||0)+window.pageXOffset,jt=Se.top+(nt.bottom||nt.top||0)+window.pageYOffset+4;H.style.position="absolute",H.style.left=Nt+"px",H.style.top=jt+"px";var Vt=window.innerHeight||document.documentElement.clientHeight,ut=H.getBoundingClientRect();ut.bottom>Vt-8&&Se.top+(nt.top||0)>ut.height+16&&(H.style.top=Se.top+(nt.top||0)+window.pageYOffset-ut.height-4+"px")}}function P(){H&&D()}function B(){var Me=r&&r.iframe&&r.iframe.ownerDocument||document;if(!Me.querySelector("style[data-rte-slashcommand]")){var Se=Me.createElement("style");Se.setAttribute("data-rte-slashcommand","1"),Se.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(`
71
71
  `),Me.head.appendChild(Se),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(Me,Se,"rte-slashcommand-style",Se.textContent)}}function Z(Me){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">'+Me+"</text></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="M13 4h5"/><path d="M13 4v16"/><path d="M17 4v16"/><path d="M13 4a4 4 0 000 8h0"/></svg>'}function re(){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 ie(){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 ae(){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 de(){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 se(){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 U(){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 Q(){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 j(){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 J(){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 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="4" width="16" height="16" rx="2"/><path d="M4 9h16"/><path d="M9 9v11"/></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="4" y="6" width="16" height="14" rx="1.5"/><path d="M4 10h16"/><path d="M9 3v4"/><path d="M15 3v4"/></svg>'}function le(){return'<svg viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="3"/></svg>'}function pe(){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 ye(){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 me(){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 ee(){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 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="5" width="18" height="14" rx="2"/><path d="M3 10h18"/><circle cx="7" cy="7.5" r=".6" fill="currentColor"/></svg>'}function ce(){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 ve(){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 be(){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 ke(){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 Pe(){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 Le(){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 qe(){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 Re(){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 Ie(){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 Ve(){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 Ye(){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 ft(){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 ht(){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 At(){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 Rt(){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 ar(){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 ze(){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 je(){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 We(){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 Oe(){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 pt(){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 Bt(){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 Ge(){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 yt(){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 Et(){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 lt(){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 zt(){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 lr(){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 Zt(){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 $t(){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>'}}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 N=this,u,r;N.PluginName="SmartChips",N.InitConfig=function(W){u=W},N.InitEditor=function(W){r=W,r.attachEvent("exec_command_insertdatechip",function(q){q.returnValue=!0,N.OpenDateChip()}),r.attachEvent("exec_command_insertchip",function(q){q.returnValue=!0,N.OpenChipMenu()}),K()};function x(W,q,b,m){var k=W.ownerDocument.createElement(q);return b&&(k.style.cssText=b),m&&(k.className=m),W.appendChild(k),k}function H(W){return String(W??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var F=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function $(W){if(u.chipDateFormat&&typeof u.chipDateFormat=="function")try{return String(u.chipDateFormat(W))}catch{}return F[W.getMonth()]+" "+W.getDate()+", "+W.getFullYear()}function z(W){function q(b){return(b<10?"0":"")+b}return W.getFullYear()+"-"+q(W.getMonth()+1)+"-"+q(W.getDate())}var o={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 O(W,q,b,m){var k=o[W]||"",M='class="rte-chip rte-chip-'+H(W)+'" data-rte-chip="'+H(W)+'" data-rte-chip-value="'+H(b||q)+'" contenteditable="false"',I='<span class="rte-chip-icon">'+k+'</span><span class="rte-chip-label">'+H(q)+"</span>";if(W==="link"&&m){var R=/^(javascript|data|vbscript):/i.test(m)?"#":m;return"<a "+M+' href="'+H(R)+'" target="_blank" rel="noopener noreferrer">'+I+"</a>"}return"<span "+M+">"+I+"</span>"}function V(W,q,b,m){K(),r.insertHTML(O(W,q,b,m)+"\u200B"),r.focus()}N.OpenDateChip=function(){var W=r.createDialog(r.getLangText&&r.getLangText("insertdatechiptitle")||"Date","rte-dialog-datechip"),q=typeof W.close=="function"?function(){W.close()}:function(){r.closeCurrentPopup()},b=x(W,"div","","rte-chip-dialog rte-chip-date-dialog");x(b,"div","","rte-chip-dialog-copy").textContent="Choose a quick date or insert a custom date chip.";function m(f,_){var v=x(b,"button","","rte-chip-quick");return v.type="button",v.textContent=f+" \u2014 "+$(_),v.onmouseover=function(){v.style.background="#eef2ff"},v.onmouseout=function(){v.style.background="transparent"},v.textContent="",x(v,"span","","rte-chip-quick-label").textContent=f,x(v,"span","","rte-chip-quick-value").textContent=$(_),v.onmouseover=null,v.onmouseout=null,v.setAttribute("aria-label","Insert "+f+", "+$(_)),v.onclick=function(){q(),V("date",$(_),z(_))},v}var k=new Date(r.__chipNow||Date.now());function M(f,_){var v=new Date(f.getTime());return v.setDate(v.getDate()+_),v}m("Today",k),m("Tomorrow",M(k,1)),m("Yesterday",M(k,-1)),m("Next week",M(k,7));var I=x(b,"div","","rte-chip-pick-row"),R=x(I,"input","","rte-chip-input");R.type="date",R.value=z(k),R.setAttribute("aria-label","Custom date");var l=x(I,"button","","rte-chip-action rte-chip-action-primary");l.type="button",l.textContent="Insert",l.onclick=function(){var f=(R.value||"").split("-");if(f.length===3){var _=new Date(parseInt(f[0],10),parseInt(f[1],10)-1,parseInt(f[2],10));q(),V("date",$(_),R.value)}else q()},setTimeout(function(){R.focus()},0)},N.OpenChipMenu=function(){var W=r.createDialog(r.getLangText&&r.getLangText("insertchiptitle")||"Insert chip","rte-dialog-chip"),q=typeof W.close=="function"?function(){W.close()}:function(){r.closeCurrentPopup()},b=x(W,"div","","rte-chip-dialog rte-chip-menu-dialog");x(b,"div","","rte-chip-dialog-copy").textContent="Insert a date, person, or link chip into the document.";var m=x(b,"div","","rte-chip-type-tabs");m.setAttribute("role","tablist"),m.setAttribute("aria-label","Chip type");var k=[["date","Date"],["person","Person"],["link","Link"]],M="date",I=x(b,"div","","rte-chip-dialog-body"),R={};k.forEach(function(v){var s=x(m,"button","","rte-chip-type-tab");s.type="button",s.textContent=v[1],s.setAttribute("role","tab"),s.setAttribute("aria-selected",v[0]===M?"true":"false"),R[v[0]]=s,s.onclick=function(){M=v[0],l(),f()}});function l(){k.forEach(function(v){var s=v[0]===M;R[v[0]].classList.toggle("is-selected",s),R[v[0]].setAttribute("aria-selected",s?"true":"false")})}function f(){if(I.innerHTML="",M==="date"){var v=x(I,"div","","rte-chip-field-label");v.textContent="Insert a date chip:";var s=x(I,"input","","rte-chip-input");s.type="date",s.value=z(new Date(r.__chipNow||Date.now())),s.setAttribute("aria-label","Date chip value"),_(function(){var h=(s.value||"").split("-");if(h.length===3){var L=new Date(+h[0],+h[1]-1,+h[2]);q(),V("date",$(L),s.value)}})}else{var c=x(I,"div","","rte-chip-field-label");c.textContent=M==="person"?"Name (or search):":"URL:";var p=x(I,"input","","rte-chip-input");p.type=M==="link"?"url":"text",p.placeholder=M==="person"?"Jane Doe":"https://example.com",p.setAttribute("aria-label",M==="person"?"Person chip name":"Link chip URL");var g=x(I,"div","","rte-chip-results");g.setAttribute("role","listbox"),g.setAttribute("aria-label","Chip suggestions"),u.chipResolver&&typeof u.chipResolver=="function"&&(p.oninput=function(){var h=p.value.trim();if(g.innerHTML="",!!h)try{var L=u.chipResolver(h,M);L&&L.then&&L.then(function(E){g.innerHTML="",(E||[]).slice(0,6).forEach(function(A){var C=x(g,"button","","rte-chip-suggestion");C.type="button",C.textContent=A.label||A.value,C.setAttribute("role","option"),C.onclick=function(){q(),V(M,A.label||A.value,A.value||A.label,A.href)}})})}catch{}}),_(function(){var h=p.value.trim();if(!h){q();return}if(M==="link"){if(/^(javascript|data|vbscript|file):/i.test(h)){p.style.borderColor="#dc2626",p.placeholder="Enter a valid http(s) URL",p.value="";return}if(!/^https?:\/\//i.test(h))if(/^[a-z0-9.-]+\.[a-z]{2,}([\/?#].*)?$/i.test(h))h="https://"+h;else{p.style.borderColor="#dc2626",p.placeholder="Enter a valid http(s) URL",p.value="";return}q(),V("link",h.replace(/^https?:\/\//i,"").replace(/\/$/,""),h,h)}else q(),V("person",h,h)}),setTimeout(function(){p.focus()},0)}}function _(v){var s=x(I,"div","","rte-chip-dialog-footer"),c=x(s,"button","","rte-chip-action rte-chip-action-primary");c.type="button",c.textContent="Insert",c.onclick=v}l(),f()};function K(){var W=[".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(`
72
72
  `);try{var q=r.getDocument();if(!q)return;var b=q.head||q.getElementsByTagName&&q.getElementsByTagName("head")[0]||q.documentElement;if(b&&!q.querySelector("style[data-rte-smartchips]")){var m=q.createElement("style");m.setAttribute("data-rte-smartchips","1"),m.textContent=W,b.appendChild(m),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(q,m,"rte-smartchips-st",m.textContent)}}catch{}}}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 N=this,u,r;N.PluginName="SpellCheck",N.InitConfig=function(o){u=o},N.InitEditor=function(o){r=o;try{var O=r.getEditable&&r.getEditable();O&&O.setAttribute("spellcheck",u.spellCheckEnabled===!1?"false":"true")}catch{}r.attachEvent("exec_command_spellcheck",function(V){V.returnValue=!0,N.RunSpellCheck()}),z()};function x(o,O,V,K){var W=o.ownerDocument.createElement(O);return V&&(W.style.cssText=V),K&&(W.className=K),o.appendChild(W),W}function H(o){return String(o??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function F(o){try{!r.InvokeEventHook||r.InvokeEventHook("customdialog","spellcheck",o)}catch{}try{var O=r.getEditable(),V=O.ownerDocument,K=V.createElement("div");K.className="rte-spell-toast",K.setAttribute("role","status"),K.setAttribute("aria-live","polite"),K.textContent=o,V.body.appendChild(K),setTimeout(function(){K.parentNode&&K.parentNode.removeChild(K)},2600)}catch{}}function $(o,O){try{for(var V=r.getEditable(),K=r.getDocument(),W=K.createTreeWalker(V,NodeFilter.SHOW_TEXT,null),q,b=new RegExp("\\b"+o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b");q=W.nextNode();){var m=q.parentNode;if(!(m&&(m.nodeName==="CODE"||m.nodeName==="PRE"))){var k=q.data.search(b);if(k>=0)return q.data=q.data.substring(0,k)+O+q.data.substring(k+o.length),!0}}}catch{}return!1}N.RunSpellCheck=function(){if(!u.spellCheckResolver||typeof u.spellCheckResolver!="function"){try{var o=r.getEditable();o.setAttribute("spellcheck","true"),o.focus()}catch{}F(r.getLangText&&r.getLangText("spellchecknative")||"Browser spell-check is on \u2014 misspellings are underlined as you type.");return}var O;try{O=r.getEditable().innerText||""}catch{O=""}if(!O.trim()){F("Nothing to check.");return}var V=r.createDialog(r.getLangText&&r.getLangText("spellchecktitle")||"Spelling","rte-dialog-spell"),K=typeof V.close=="function"?function(){V.close()}:function(){r.closeCurrentPopup()},W=x(V,"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"),q=x(W,"div","color:#64748b;margin-bottom:8px");q.innerText="Checking\u2026";var b=x(W,"div","");function m(f){if(b.innerHTML="",!f||!f.length){q.innerText=r.getLangText&&r.getLangText("spellcheckclean")||"No spelling issues found.";return}q.innerText=f.length+" issue"+(f.length===1?"":"s")+" found.",f.forEach(function(_){if(!(!_||!_.word)){var v=x(b,"div","padding:8px 0;border-bottom:1px solid rgba(15,23,42,.08)","rte-spell-row"),s=x(v,"div","font-weight:600;color:#b91c1c;margin-bottom:4px");s.textContent=_.word;var c=x(v,"div","display:flex;flex-wrap:wrap;gap:6px"),p=(_.suggestions||[]).slice(0,6);p.length||(x(c,"span","font-size:12px;color:#94a3b8").textContent="(no suggestions)"),p.forEach(function(g){var h=x(c,"button","font-size:12px;padding:4px 9px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fbff;color:#315277;cursor:pointer");h.type="button",h.textContent=g,h.onclick=function(){$(_.word,g)&&(v.style.opacity="0.45",s.innerHTML=H(_.word)+' &rarr; <span style="color:#16a34a">'+H(g)+"</span>",c.innerHTML="")}})}})}var k=!1;function M(f){k||(k=!0,m(f))}try{var I=u.spellCheckResolver(O);I&&typeof I.then=="function"?(I.then(function(f){M(f||[])},function(){q.innerText="Spell-check service error."}),setTimeout(function(){k||(q.innerText="Spell-check timed out.",k=!0)},12e3)):M(I||[])}catch{q.innerText="Spell-check error."}var R=x(W,"div","display:flex;justify-content:flex-end;margin-top:12px"),l=x(R,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");l.type="button",l.textContent="Done",l.onclick=function(){K(),r.focus()}};function z(){var o=["/* 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(`
73
- `);try{var O=r&&r.iframe&&r.iframe.ownerDocument||document;if(!O.querySelector("style[data-rte-spellcheck]")){var V=O.createElement("style");V.setAttribute("data-rte-spellcheck","1"),V.textContent=o,(O.head||O.documentElement).appendChild(V),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(O,V,"rte-spellcheck-st",V.textContent)}}catch{}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_stateinspector=RTE_Plugin_StateInspector;function RTE_Plugin_StateInspector(){var N=this,u,r,x=null,H=null,F=null,$=null,z=null,o=0,O="issues",V=[],K=[],W=60,q=[{id:"issues",label:"Issues"},{id:"tree",label:"Tree"},{id:"selection",label:"Selection"},{id:"plugins",label:"Plugins"},{id:"log",label:"Log"}],b={A:1,ABBR:1,B:1,BDI:1,BDO:1,CITE:1,CODE:1,DEL:1,DFN:1,EM:1,I:1,INS:1,KBD:1,MARK:1,Q:1,S:1,SAMP:1,SMALL:1,SPAN:1,STRONG:1,SUB:1,SUP:1,U:1,VAR:1,FONT:1},m={AREA:1,BASE:1,BR:1,COL:1,EMBED:1,HR:1,IMG:1,INPUT:1,LINK:1,META:1,PARAM:1,SOURCE:1,TRACK:1,WBR:1},k={ADDRESS:1,ARTICLE:1,ASIDE:1,BLOCKQUOTE:1,DIV:1,DL:1,DT:1,DD:1,FIELDSET:1,FIGCAPTION:1,FIGURE:1,FOOTER:1,FORM:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,HEADER:1,HR:1,LI:1,MAIN:1,NAV:1,OL:1,P:1,PRE:1,SECTION:1,TABLE:1,UL:1},M=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/;N.PluginName="StateInspector",N.InitConfig=function(ee){u=ee,u.stateInspectorEnabled!==!1&&(u.stateInspectorTitle=u.stateInspectorTitle||"State inspector",u.stateInspectorHint=u.stateInspectorHint||"Derived document model, structural checks, and a copyable snapshot for bug reports.",u.stateInspectorEmptyText=u.stateInspectorEmptyText||"No content to inspect yet.",typeof u.stateInspectorAutoOpen!="boolean"&&(u.stateInspectorAutoOpen=!1),typeof u.stateInspectorToolbarButton!="boolean"&&(u.stateInspectorToolbarButton=!1),typeof u.stateInspectorMaxDepth!="number"&&(u.stateInspectorMaxDepth=24),typeof u.stateInspectorLogLimit=="number"&&(W=Math.max(10,Math.min(500,u.stateInspectorLogLimit))),V=R(u),u.stateInspectorToolbarButton&&(I("toolbar_default","#{stateinspector}"),I("toolbar_full","#{stateinspector}")))},N.InitEditor=function(ee){r=ee,u.stateInspectorEnabled!==!1&&(r.stateInspector={close:function(){ae()},isOpen:function(){return!!(x&&x.classList.contains("is-open"))},issues:function(){return A(v()).issues},log:function(){return K.slice(0)},open:function(){ie()},plugins:function(){return V.slice(0)},refresh:function(){Q()},snapshot:function(){return g()},toggle:function(){re()}},D(),r.toolbarFactoryMap=r.toolbarFactoryMap||{},r.toolbarFactoryMap.stateinspector=function(ue){return r.createToolbarButton(ue)},r.attachEvent("exec_command_stateinspector",function(ue){ue.returnValue=!0,ue.stopBubble=!0,re()}),r.attachEvent("change",function(){l("change"),de()}),r.attachEvent("selectionchange",function(){l("selectionchange"),de()}),r.slashCommands&&r.slashCommands.register&&r.slashCommands.register({id:"stateinspector",section:"Tools",title:u.stateInspectorTitle,description:"Inspect document structure, selection, and structural issues",keywords:["inspect","debug","devtools","state","structure"],run:function(){ie()}}),P(),u.stateInspectorAutoOpen&&ie())};function I(ee,ue){u[ee]&&u[ee].indexOf(ue)===-1&&(u[ee]=u[ee]+ue)}function R(ee){var ue=[];for(var ce in ee)ce[0]!=="p"||ce.substr(0,7)!=="plugin_"||!ee[ce]||!(ee[ce]instanceof Function)||ue.push({index:ue.length,key:ce,name:ce.substring(7)});return ue}function l(ee){K.push({at:Date.now(),event:ee}),K.length>W&&K.splice(0,K.length-W)}function f(ee){var ue={},ce=ee.attributes;if(!ce)return ue;for(var ve=0;ve<ce.length;ve++){var be=ce[ve].value;ue[ce[ve].name]=be.length>220?be.substring(0,220)+"\u2026":be}return ue}function _(ee,ue,ce,ve){if(ee.nodeType===3){var be=ee.nodeValue||"";return ve.textNodes++,ve.characters+=be.length,{type:"text",length:be.length,text:be.length>80?be.substring(0,80)+"\u2026":be}}if(ee.nodeType===8)return ve.comments++,{type:"comment",length:(ee.nodeValue||"").length};if(ee.nodeType!==1)return null;ve.elements++;var ke=ee.nodeName;ve.tags[ke]=(ve.tags[ke]||0)+1;var Pe={type:"element",name:ke.toLowerCase(),attrs:f(ee),children:[]};if(ue>=ce)return Pe.truncated=!0,Pe.childCount=ee.childNodes.length,Pe;for(var Le=0;Le<ee.childNodes.length;Le++){var qe=_(ee.childNodes[Le],ue+1,ce,ve);qe&&Pe.children.push(qe)}return Pe}function v(){var ee=r&&r.getEditable?r.getEditable():null,ue={elements:0,textNodes:0,comments:0,characters:0,tags:{}};if(!ee)return{root:null,counters:ue,editable:null};for(var ce=Math.max(2,u.stateInspectorMaxDepth||24),ve={type:"element",name:"root",attrs:{},children:[]},be=0;be<ee.childNodes.length;be++){var ke=_(ee.childNodes[be],1,ce,ue);ke&&ve.children.push(ke)}return{root:ve,counters:ue,editable:ee}}function s(){var ee=r&&r.getDocument?r.getDocument():null,ue=r&&r.getEditable?r.getEditable():null,ce={available:!1};if(!ee||!ee.getSelection)return ce;var ve;try{ve=ee.getSelection()}catch{return ce}if(!ve||ve.rangeCount===0)return ce;var be;try{be=ve.getRangeAt(0)}catch{return ce}if(!be)return ce;ce.available=!0,ce.collapsed=!!be.collapsed,ce.anchor=c(be.startContainer,be.startOffset),ce.focus=c(be.endContainer,be.endOffset),ce.insideEditable=!!(ue&&ue.contains(be.startContainer)&&ue.contains(be.endContainer));try{var ke=String(be.toString()||"");ce.textLength=ke.length,ce.text=ke.length>120?ke.substring(0,120)+"\u2026":ke}catch{ce.textLength=0}return ce.block=p(be.startContainer,ue),ce}function c(ee,ue){if(!ee)return{node:"(none)",offset:ue};if(ee.nodeType===3){var ce=ee.nodeValue||"";return{node:"#text",offset:ue,length:ce.length,zeroLength:ce.length===0}}return{node:ee.nodeName?ee.nodeName.toLowerCase():"(unknown)",offset:ue,childCount:ee.childNodes?ee.childNodes.length:0}}function p(ee,ue){for(var ce=[],ve=ee;ve&&ve!==ue;)ve.nodeType===1&&ce.unshift(ve.nodeName.toLowerCase()),ve=ve.parentNode;return ce.join(" > ")}function g(){var ee=v(),ue=A(ee);return{snapshotVersion:1,generatedAt:new Date().toISOString(),counters:ee.counters,issues:ue.issues,plugins:V.slice(0),recentEvents:K.slice(-20),selection:s(),tree:ee.root}}function h(ee,ue,ce,ve,be){ee.push({id:ue,severity:ce,message:ve,detail:be||""})}function L(ee,ue){for(var ce=[],ve=ee;ve&&ve!==ue&&ve.nodeType===1;){var be=ve.nodeName.toLowerCase();ve.id&&(be+="#"+ve.id),ce.unshift(be),ve=ve.parentNode}return ce.join(" > ")}function E(ee){if((ee.textContent||"").replace(/[\s\u200B\uFEFF]/g,"")!=="")return!0;for(var ue=0;ue<ee.childNodes.length;ue++){var ce=ee.childNodes[ue];if(ce.nodeType===1&&m[ce.nodeName])return!0}return!1}function A(ee){var ue=[],ce=ee.editable;if(!ce)return{issues:ue};for(var ve=ce.ownerDocument.createTreeWalker(ce,5,null,!1),be=0,ke;ke=ve.nextNode();){if(ke.nodeType===3){y(ke,ce,ue);continue}d(ke,ce,ue);var Pe=C(ke);Pe&&(be&&Pe>be+1&&h(ue,"heading-skip","warn","Heading level jumps from h"+be+" to h"+Pe,L(ke,ce)),be=Pe)}for(var Le=0;Le<ce.childNodes.length;Le++){var qe=ce.childNodes[Le];qe.nodeType===1&&qe.nodeName==="IMG"&&w(qe,ce,ue)}return{issues:ue}}function C(ee){var ue=ee.nodeName;return ue.length===2&&ue[0]==="H"&&ue[1]>="1"&&ue[1]<="6"?parseInt(ue[1],10):0}function y(ee,ue,ce){var ve=ee.nodeValue||"";if(ve.length===0){h(ce,"zero-length-text","warn","Zero-length text node",L(ee.parentNode,ue));return}M.test(ve)&&h(ce,"control-characters","error","Text contains control characters - Word will reject an exported .docx",L(ee.parentNode,ue))}function d(ee,ue,ce){for(var ve=ee.nodeName,be=L(ee,ue),ke=ee.attributes,Pe=0;ke&&Pe<ke.length;Pe++){var Le=ke[Pe].name.toLowerCase(),qe=ke[Pe].value||"";if(Le.indexOf("on")===0&&Le.length>2&&h(ce,"event-handler-attribute","error","Inline event handler "+Le+" present in document content",be),Le==="href"||Le==="src"||Le==="xlink:href"){var Re=qe.replace(/[\u0000-\u0020]/g,"").toLowerCase();Re.indexOf("javascript:")===0?h(ce,"unsafe-url-scheme","error","javascript: URL in "+Le,be):(Re.indexOf("data:text/html")===0||Re.indexOf("data:image/svg+xml")===0)&&h(ce,"unsafe-url-scheme","error","Scriptable data: URL in "+Le,be)}}if(ve==="IFRAME"&&ee.hasAttribute("srcdoc")&&h(ce,"iframe-srcdoc","error","iframe[srcdoc] executes when the saved content is rendered downstream",be),b[ve]&&!E(ee)&&h(ce,"empty-inline","warn","Empty inline <"+ve.toLowerCase()+"> - a caret entering it cannot leave by typing",be),b[ve]&&ee.parentNode&&ee.parentNode.nodeName===ve&&h(ce,"nested-duplicate-inline","warn","<"+ve.toLowerCase()+"> nested directly inside another <"+ve.toLowerCase()+">",be),b[ve])for(var Ie=0;Ie<ee.childNodes.length;Ie++){var Ve=ee.childNodes[Ie];if(Ve.nodeType===1&&k[Ve.nodeName]){h(ce,"block-inside-inline","warn","Block <"+Ve.nodeName.toLowerCase()+"> inside inline <"+ve.toLowerCase()+">",be);break}}if(ve==="LI"){var Ye=ee.parentNode?ee.parentNode.nodeName:"";Ye!=="UL"&&Ye!=="OL"&&h(ce,"orphan-list-item","warn","<li> outside a <ul> or <ol>",be)}ve==="IMG"&&w(ee,ue,ce),ee.hasAttribute&&ee.hasAttribute("data-rte-atomic")&&ee.getAttribute("contenteditable")!=="false"&&h(ce,"atomic-not-protected","error",'Atomic element without contenteditable="false"',be)}function w(ee,ue,ce){if(!(ee.getAttribute("role")==="presentation"||ee.getAttribute("aria-hidden")==="true")){var ve=ee.getAttribute("alt");ve===null&&h(ce,"image-missing-alt","warn","Image has no alt attribute",L(ee,ue))}}function D(){var ee=u.container.ownerDocument;if(!ee.getElementById("rte-state-inspector-style")){var ue=ee.createElement("style");ue.id="rte-state-inspector-style",ue.innerHTML=[".rte-state-inspector-shell{display:flex;align-items:stretch;gap:10px;}",".rte-state-inspector-shell>.rte-state-inspector-host{flex:1 1 auto;min-width:0;}",".rte-state-inspector-panel{display:none;flex:0 0 340px;min-width:290px;max-width:min(400px,36vw);border:1px solid rgba(148,163,184,.22);border-radius:8px;background:#fff;box-shadow:0 14px 32px rgba(29,78,216,.1),0 2px 8px rgba(15,23,42,.06);overflow:hidden;color:#172033;font-family:Aptos,'Segoe UI',sans-serif;}",".rte-state-inspector-shell.is-open>.rte-state-inspector-panel{display:flex;flex-direction:column;}",".rte-state-inspector-header{padding:12px 12px 9px 14px;border-bottom:1px solid rgba(148,163,184,.16);background:rgba(248,251,255,.72);}",".rte-state-inspector-kicker{font-size:10px;line-height:1.3;letter-spacing:.08em;text-transform:uppercase;color:#52657e;font-weight:850;}",".rte-state-inspector-title{margin-top:3px;font-size:15px;line-height:1.2;font-weight:850;color:#172033;}",".rte-state-inspector-copy{margin-top:5px;font-size:12px;line-height:1.42;color:#52657e;}",".rte-state-inspector-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px 8px 14px;border-bottom:1px solid rgba(148,163,184,.16);}",".rte-state-inspector-summary{min-width:0;font-size:12px;font-weight:750;color:#52657e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}",".rte-state-inspector-actions{display:flex;gap:6px;flex:0 0 auto;}",".rte-state-inspector-btn{appearance:none;border:1px solid rgba(100,116,139,.18);background:#fff;color:#315277;cursor:pointer;font-size:12px;font-weight:750;padding:6px 9px;border-radius:7px;line-height:1;}",".rte-state-inspector-btn:hover,.rte-state-inspector-btn:focus-visible{background:#eef4ff;color:#0f3f9f;border-color:rgba(37,99,235,.28);}",".rte-state-inspector-tabs{display:flex;gap:2px;padding:8px 10px 0 10px;border-bottom:1px solid rgba(148,163,184,.16);}",".rte-state-inspector-tab{appearance:none;border:1px solid transparent;border-bottom:none;background:transparent;color:#52657e;cursor:pointer;font-size:12px;font-weight:800;padding:7px 10px;border-radius:7px 7px 0 0;line-height:1;}",".rte-state-inspector-tab:hover,.rte-state-inspector-tab:focus-visible{background:#f8fbff;color:#0f3f9f;}",".rte-state-inspector-tab[aria-selected='true']{background:#eef4ff;border-color:rgba(37,99,235,.26);color:#0f3f9f;}",".rte-state-inspector-body{padding:10px;overflow:auto;min-height:160px;max-height:540px;scrollbar-width:thin;font-size:12px;line-height:1.5;}",".rte-state-inspector-issue{display:block;padding:8px 10px;margin-bottom:6px;border:1px solid rgba(148,163,184,.24);border-left-width:3px;border-radius:7px;background:#fff;}",".rte-state-inspector-issue.is-error{border-left-color:#dc2626;background:#fef4f4;}",".rte-state-inspector-issue.is-warn{border-left-color:#d97706;background:#fffaf1;}",".rte-state-inspector-issue-msg{font-weight:750;color:#172033;}",".rte-state-inspector-issue-meta{margin-top:3px;font-size:11px;color:#52657e;font-family:Consolas,'Cascadia Mono',monospace;word-break:break-all;}",".rte-state-inspector-ok{padding:14px;color:#166534;font-weight:750;background:#f0fdf4;border:1px dashed rgba(22,101,52,.3);border-radius:8px;}",".rte-state-inspector-empty{padding:14px;color:#52657e;font-weight:700;background:#fff;border:1px dashed rgba(148,163,184,.34);border-radius:8px;}",".rte-state-inspector-pre{margin:0;font-family:Consolas,'Cascadia Mono',monospace;font-size:11px;line-height:1.55;color:#172033;white-space:pre;}",".rte-state-inspector-row{display:flex;gap:8px;padding:4px 0;border-bottom:1px solid rgba(148,163,184,.14);}",".rte-state-inspector-row-key{flex:0 0 116px;color:#52657e;font-weight:750;}",".rte-state-inspector-row-val{flex:1 1 auto;min-width:0;font-family:Consolas,'Cascadia Mono',monospace;word-break:break-all;}",".rte-state-inspector-row.is-flagged .rte-state-inspector-row-val{color:#b91c1c;font-weight:750;}","@media (max-width: 1100px){.rte-state-inspector-shell{display:block;}.rte-state-inspector-panel{margin-top:12px;max-width:none;width:100%;}.rte-state-inspector-body{max-height:340px;}}"].join(""),ee.head.appendChild(ue)}}function P(){if(x)return x;var ee=u.container,ue=ee.ownerDocument;x=ue.createElement("div"),x.className="rte-state-inspector-shell";var ce=ue.createElement("div");ce.className="rte-state-inspector-host",ee.parentNode.insertBefore(x,ee),x.appendChild(ce),ce.appendChild(ee),H=ue.createElement("aside"),H.className="rte-state-inspector-panel",H.setAttribute("role","complementary"),H.setAttribute("aria-label",u.stateInspectorTitle);var ve=ue.createElement("div");ve.className="rte-state-inspector-header";var be=ue.createElement("div");be.className="rte-state-inspector-kicker",be.innerText="Developer";var ke=ue.createElement("div");ke.className="rte-state-inspector-title",ke.innerText=u.stateInspectorTitle;var Pe=ue.createElement("div");Pe.className="rte-state-inspector-copy",Pe.innerText=u.stateInspectorHint,ve.appendChild(be),ve.appendChild(ke),ve.appendChild(Pe);var Le=ue.createElement("div");Le.className="rte-state-inspector-toolbar",z=ue.createElement("div"),z.className="rte-state-inspector-summary",z.setAttribute("data-rte-inspector-summary","1");var qe=ue.createElement("div");qe.className="rte-state-inspector-actions",qe.appendChild(B(ue,"Copy","Copy the state snapshot as JSON",se)),qe.appendChild(B(ue,"Hide","Hide the state inspector",ae)),Le.appendChild(z),Le.appendChild(qe),$=ue.createElement("div"),$.className="rte-state-inspector-tabs",$.setAttribute("role","tablist");for(var Re=0;Re<q.length;Re++)$.appendChild(Z(ue,q[Re]));return F=ue.createElement("div"),F.className="rte-state-inspector-body",H.appendChild(ve),H.appendChild(Le),H.appendChild($),H.appendChild(F),x.appendChild(H),x}function B(ee,ue,ce,ve){var be=ee.createElement("button");return be.type="button",be.className="rte-state-inspector-btn",be.innerText=ue,be.setAttribute("aria-label",ce),be.onclick=ve,be}function Z(ee,ue){var ce=ee.createElement("button");return ce.type="button",ce.className="rte-state-inspector-tab",ce.innerText=ue.label,ce.setAttribute("role","tab"),ce.setAttribute("data-rte-inspector-tab",ue.id),ce.setAttribute("aria-selected",ue.id===O?"true":"false"),ce.onclick=function(){O=ue.id,fe(),Q()},ce}function fe(){if($)for(var ee=$.querySelectorAll("[data-rte-inspector-tab]"),ue=0;ue<ee.length;ue++){var ce=ee[ue].getAttribute("data-rte-inspector-tab");ee[ue].setAttribute("aria-selected",ce===O?"true":"false")}}function re(){x&&x.classList.contains("is-open")?ae():ie()}function ie(){P(),x.classList.add("is-open"),Q()}function ae(){x&&x.classList.remove("is-open")}function de(){!x||!x.classList.contains("is-open")||(clearTimeout(o),o=setTimeout(function(){Q()},120))}function se(){var ee=JSON.stringify(g(),null,2);if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(ee);return}var ue=u.container.ownerDocument,ce=ue.createElement("textarea");ce.value=ee,ce.style.position="fixed",ce.style.opacity="0",ue.body.appendChild(ce),ce.select();try{ue.execCommand("copy")}catch{}ue.body.removeChild(ce)}function U(ee){for(;ee.firstChild;)ee.removeChild(ee.firstChild)}function Q(){if(!(!x||!F)){for(var ee=v(),ue=A(ee),ce=u.container.ownerDocument,ve=0,be=0;be<ue.issues.length;be++)ue.issues[be].severity==="error"&&ve++;z&&(z.innerText=ee.counters.elements+" el \xB7 "+ue.issues.length+" issue"+(ue.issues.length===1?"":"s")+(ve?" \xB7 "+ve+" error"+(ve===1?"":"s"):"")),U(F),O==="issues"?j(ce,ue.issues):O==="tree"?J(ce,ee):O==="selection"?te(ce):O==="plugins"?ye(ce):O==="log"&&me(ce)}}function j(ee,ue){if(!ue.length){var ce=ee.createElement("div");ce.className="rte-state-inspector-ok",ce.innerText="No structural issues found.",F.appendChild(ce);return}for(var ve=0;ve<ue.length;ve++){var be=ue[ve],ke=ee.createElement("div");ke.className="rte-state-inspector-issue is-"+(be.severity==="error"?"error":"warn"),ke.setAttribute("data-rte-issue-id",be.id);var Pe=ee.createElement("div");Pe.className="rte-state-inspector-issue-msg",Pe.innerText=be.message;var Le=ee.createElement("div");Le.className="rte-state-inspector-issue-meta",Le.innerText=(be.detail||"(document root)")+" \xB7 "+be.id,ke.appendChild(Pe),ke.appendChild(Le),F.appendChild(ke)}}function J(ee,ue){if(!ue.root||!ue.root.children.length){var ce=ee.createElement("div");ce.className="rte-state-inspector-empty",ce.innerText=u.stateInspectorEmptyText,F.appendChild(ce);return}var ve=ee.createElement("pre");ve.className="rte-state-inspector-pre",ve.innerText=Y(ue.root,0).join(`
73
+ `);try{var O=r&&r.iframe&&r.iframe.ownerDocument||document;if(!O.querySelector("style[data-rte-spellcheck]")){var V=O.createElement("style");V.setAttribute("data-rte-spellcheck","1"),V.textContent=o,(O.head||O.documentElement).appendChild(V),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(O,V,"rte-spellcheck-st",V.textContent)}}catch{}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_stateinspector=RTE_Plugin_StateInspector;function RTE_Plugin_StateInspector(){var N=this,u,r,x=null,H=null,F=null,$=null,z=null,o=0,O="issues",V=[],K=[],W=60,q=[{id:"issues",label:"Issues"},{id:"tree",label:"Tree"},{id:"selection",label:"Selection"},{id:"plugins",label:"Plugins"},{id:"log",label:"Log"}],b={A:1,ABBR:1,B:1,BDI:1,BDO:1,CITE:1,CODE:1,DEL:1,DFN:1,EM:1,I:1,INS:1,KBD:1,MARK:1,Q:1,S:1,SAMP:1,SMALL:1,SPAN:1,STRONG:1,SUB:1,SUP:1,U:1,VAR:1,FONT:1},m={AREA:1,BASE:1,BR:1,COL:1,EMBED:1,HR:1,IMG:1,INPUT:1,LINK:1,META:1,PARAM:1,SOURCE:1,TRACK:1,WBR:1},k={ADDRESS:1,ARTICLE:1,ASIDE:1,BLOCKQUOTE:1,DIV:1,DL:1,DT:1,DD:1,FIELDSET:1,FIGCAPTION:1,FIGURE:1,FOOTER:1,FORM:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,HEADER:1,HR:1,LI:1,MAIN:1,NAV:1,OL:1,P:1,PRE:1,SECTION:1,TABLE:1,UL:1},M=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/;N.PluginName="StateInspector",N.InitConfig=function(ee){u=ee,u.stateInspectorEnabled!==!1&&(u.stateInspectorTitle=u.stateInspectorTitle||"State inspector",u.stateInspectorHint=u.stateInspectorHint||"Derived document model, structural checks, and a copyable snapshot for bug reports.",u.stateInspectorEmptyText=u.stateInspectorEmptyText||"No content to inspect yet.",typeof u.stateInspectorAutoOpen!="boolean"&&(u.stateInspectorAutoOpen=!1),typeof u.stateInspectorToolbarButton!="boolean"&&(u.stateInspectorToolbarButton=!1),typeof u.stateInspectorMaxDepth!="number"&&(u.stateInspectorMaxDepth=24),typeof u.stateInspectorLogLimit=="number"&&(W=Math.max(10,Math.min(500,u.stateInspectorLogLimit))),V=R(u),u.stateInspectorToolbarButton&&(I("toolbar_default","#{stateinspector}"),I("toolbar_full","#{stateinspector}")))},N.InitEditor=function(ee){r=ee,u.stateInspectorEnabled!==!1&&(r.stateInspector={close:function(){ae()},isOpen:function(){return!!(x&&x.classList.contains("is-open"))},issues:function(){return A(v()).issues},log:function(){return K.slice(0)},open:function(){ie()},plugins:function(){return V.slice(0)},refresh:function(){Q()},snapshot:function(){return g()},toggle:function(){re()}},D(),r.toolbarFactoryMap=r.toolbarFactoryMap||{},r.toolbarFactoryMap.stateinspector=function(ue){return r.createToolbarButton(ue)},r.attachEvent("exec_command_stateinspector",function(ue){ue.returnValue=!0,ue.stopBubble=!0,re()}),r.attachEvent("change",function(){l("change"),de()}),r.attachEvent("selectionchange",function(){l("selectionchange"),de()}),r.slashCommands&&r.slashCommands.register&&r.slashCommands.register({id:"stateinspector",section:"Tools",title:u.stateInspectorTitle,description:"Inspect document structure, selection, and structural issues",keywords:["inspect","debug","devtools","state","structure"],run:function(){ie()}}),P(),u.stateInspectorAutoOpen&&ie())};function I(ee,ue){u[ee]&&u[ee].indexOf(ue)===-1&&(u[ee]=u[ee]+ue)}function R(ee){var ue=[];for(var ce in ee)ce[0]!=="p"||ce.substr(0,7)!=="plugin_"||!ee[ce]||!(ee[ce]instanceof Function)||ue.push({index:ue.length,key:ce,name:ce.substring(7)});return ue}function l(ee){K.push({at:Date.now(),event:ee}),K.length>W&&K.splice(0,K.length-W)}function f(ee){var ue={},ce=ee.attributes;if(!ce)return ue;for(var ve=0;ve<ce.length;ve++){var be=ce[ve].value;ue[ce[ve].name]=be.length>220?be.substring(0,220)+"\u2026":be}return ue}function _(ee,ue,ce,ve){if(ee.nodeType===3){var be=ee.nodeValue||"";return ve.textNodes++,ve.characters+=be.length,{type:"text",length:be.length,text:be.length>80?be.substring(0,80)+"\u2026":be}}if(ee.nodeType===8)return ve.comments++,{type:"comment",length:(ee.nodeValue||"").length};if(ee.nodeType!==1)return null;ve.elements++;var ke=ee.nodeName;ve.tags[ke]=(ve.tags[ke]||0)+1;var Pe={type:"element",name:ke.toLowerCase(),attrs:f(ee),children:[]};if(ue>=ce)return Pe.truncated=!0,Pe.childCount=ee.childNodes.length,Pe;for(var Le=0;Le<ee.childNodes.length;Le++){var qe=_(ee.childNodes[Le],ue+1,ce,ve);qe&&Pe.children.push(qe)}return Pe}function v(){var ee=r&&r.getEditable?r.getEditable():null,ue={elements:0,textNodes:0,comments:0,characters:0,tags:{}};if(!ee)return{root:null,counters:ue,editable:null};for(var ce=Math.max(2,u.stateInspectorMaxDepth||24),ve={type:"element",name:"root",attrs:{},children:[]},be=0;be<ee.childNodes.length;be++){var ke=_(ee.childNodes[be],1,ce,ue);ke&&ve.children.push(ke)}return{root:ve,counters:ue,editable:ee}}function s(){var ee=r&&r.getDocument?r.getDocument():null,ue=r&&r.getEditable?r.getEditable():null,ce={available:!1};if(!ee||!ee.getSelection)return ce;var ve;try{ve=ee.getSelection()}catch{return ce}if(!ve||ve.rangeCount===0)return ce;var be;try{be=ve.getRangeAt(0)}catch{return ce}if(!be)return ce;ce.available=!0,ce.collapsed=!!be.collapsed,ce.anchor=c(be.startContainer,be.startOffset),ce.focus=c(be.endContainer,be.endOffset),ce.insideEditable=!!(ue&&ue.contains(be.startContainer)&&ue.contains(be.endContainer));try{var ke=String(be.toString()||"");ce.textLength=ke.length,ce.text=ke.length>120?ke.substring(0,120)+"\u2026":ke}catch{ce.textLength=0}return ce.block=p(be.startContainer,ue),ce}function c(ee,ue){if(!ee)return{node:"(none)",offset:ue};if(ee.nodeType===3){var ce=ee.nodeValue||"";return{node:"#text",offset:ue,length:ce.length,zeroLength:ce.length===0}}return{node:ee.nodeName?ee.nodeName.toLowerCase():"(unknown)",offset:ue,childCount:ee.childNodes?ee.childNodes.length:0}}function p(ee,ue){for(var ce=[],ve=ee;ve&&ve!==ue;)ve.nodeType===1&&ce.unshift(ve.nodeName.toLowerCase()),ve=ve.parentNode;return ce.join(" > ")}function g(){var ee=v(),ue=A(ee);return{snapshotVersion:1,generatedAt:new Date().toISOString(),counters:ee.counters,issues:ue.issues,plugins:V.slice(0),recentEvents:K.slice(-20),selection:s(),tree:ee.root}}function h(ee,ue,ce,ve,be){ee.push({id:ue,severity:ce,message:ve,detail:be||""})}function L(ee,ue){for(var ce=[],ve=ee;ve&&ve!==ue&&ve.nodeType===1;){var be=ve.nodeName.toLowerCase();ve.id&&(be+="#"+ve.id),ce.unshift(be),ve=ve.parentNode}return ce.join(" > ")}function E(ee){if((ee.textContent||"").replace(/[\s\u200B\uFEFF]/g,"")!=="")return!0;for(var ue=0;ue<ee.childNodes.length;ue++){var ce=ee.childNodes[ue];if(ce.nodeType===1&&m[ce.nodeName])return!0}return!1}function A(ee){var ue=[],ce=ee.editable;if(!ce)return{issues:ue};for(var ve=ce.ownerDocument.createTreeWalker(ce,5,null,!1),be=0,ke;ke=ve.nextNode();){if(ke.nodeType===3){y(ke,ce,ue);continue}d(ke,ce,ue);var Pe=C(ke);Pe&&(be&&Pe>be+1&&h(ue,"heading-skip","warn","Heading level jumps from h"+be+" to h"+Pe,L(ke,ce)),be=Pe)}for(var Le=0;Le<ce.childNodes.length;Le++){var qe=ce.childNodes[Le];qe.nodeType===1&&qe.nodeName==="IMG"&&w(qe,ce,ue)}return{issues:ue}}function C(ee){var ue=ee.nodeName;return ue.length===2&&ue[0]==="H"&&ue[1]>="1"&&ue[1]<="6"?parseInt(ue[1],10):0}function y(ee,ue,ce){var ve=ee.nodeValue||"";if(ve.length===0){h(ce,"zero-length-text","warn","Zero-length text node",L(ee.parentNode,ue));return}M.test(ve)&&h(ce,"control-characters","error","Text contains control characters - Word will reject an exported .docx",L(ee.parentNode,ue))}function d(ee,ue,ce){for(var ve=ee.nodeName,be=L(ee,ue),ke=ee.attributes,Pe=0;ke&&Pe<ke.length;Pe++){var Le=ke[Pe].name.toLowerCase(),qe=ke[Pe].value||"";if(Le.indexOf("on")===0&&Le.length>2&&h(ce,"event-handler-attribute","error","Inline event handler "+Le+" present in document content",be),Le==="href"||Le==="src"||Le==="xlink:href"){var Re=qe.replace(/[\u0000-\u0020]/g,"").toLowerCase();Re.indexOf("javascript:")===0?h(ce,"unsafe-url-scheme","error","javascript: URL in "+Le,be):(Re.indexOf("data:text/html")===0||Re.indexOf("data:image/svg+xml")===0)&&h(ce,"unsafe-url-scheme","error","Scriptable data: URL in "+Le,be)}}if(ve==="IFRAME"&&ee.hasAttribute("srcdoc")&&h(ce,"iframe-srcdoc","error","iframe[srcdoc] executes when the saved content is rendered downstream",be),b[ve]&&!E(ee)&&h(ce,"empty-inline","warn","Empty inline <"+ve.toLowerCase()+"> - a caret entering it cannot leave by typing",be),b[ve]&&ee.parentNode&&ee.parentNode.nodeName===ve&&h(ce,"nested-duplicate-inline","warn","<"+ve.toLowerCase()+"> nested directly inside another <"+ve.toLowerCase()+">",be),b[ve])for(var Ie=0;Ie<ee.childNodes.length;Ie++){var Ve=ee.childNodes[Ie];if(Ve.nodeType===1&&k[Ve.nodeName]){h(ce,"block-inside-inline","warn","Block <"+Ve.nodeName.toLowerCase()+"> inside inline <"+ve.toLowerCase()+">",be);break}}if(ve==="LI"){var Ye=ee.parentNode?ee.parentNode.nodeName:"";Ye!=="UL"&&Ye!=="OL"&&h(ce,"orphan-list-item","warn","<li> outside a <ul> or <ol>",be)}ve==="IMG"&&w(ee,ue,ce),ee.hasAttribute&&ee.hasAttribute("data-rte-atomic")&&ee.getAttribute("contenteditable")!=="false"&&h(ce,"atomic-not-protected","error",'Atomic element without contenteditable="false"',be)}function w(ee,ue,ce){if(!(ee.getAttribute("role")==="presentation"||ee.getAttribute("aria-hidden")==="true")){var ve=ee.getAttribute("alt");ve===null&&h(ce,"image-missing-alt","warn","Image has no alt attribute",L(ee,ue))}}function D(){var ee=u.container.ownerDocument;if(!ee.getElementById("rte-state-inspector-style")){var ue=ee.createElement("style");ue.id="rte-state-inspector-style",ue.innerHTML=[".rte-state-inspector-shell{display:flex;align-items:stretch;gap:10px;}",".rte-state-inspector-shell>.rte-state-inspector-host{flex:1 1 auto;min-width:0;}",".rte-state-inspector-panel{display:none;flex:0 0 340px;min-width:290px;max-width:min(400px,36vw);border:1px solid rgba(148,163,184,.22);border-radius:8px;background:#fff;box-shadow:0 14px 32px rgba(29,78,216,.1),0 2px 8px rgba(15,23,42,.06);overflow:hidden;color:#172033;font-family:Aptos,'Segoe UI',sans-serif;}",".rte-state-inspector-shell.is-open>.rte-state-inspector-panel{display:flex;flex-direction:column;}",".rte-state-inspector-header{padding:12px 12px 9px 14px;border-bottom:1px solid rgba(148,163,184,.16);background:rgba(248,251,255,.72);}",".rte-state-inspector-kicker{font-size:10px;line-height:1.3;letter-spacing:.08em;text-transform:uppercase;color:#52657e;font-weight:850;}",".rte-state-inspector-title{margin-top:3px;font-size:15px;line-height:1.2;font-weight:850;color:#172033;}",".rte-state-inspector-copy{margin-top:5px;font-size:12px;line-height:1.42;color:#52657e;}",".rte-state-inspector-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px 8px 14px;border-bottom:1px solid rgba(148,163,184,.16);}",".rte-state-inspector-summary{min-width:0;font-size:12px;font-weight:750;color:#52657e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}",".rte-state-inspector-actions{display:flex;gap:6px;flex:0 0 auto;}",".rte-state-inspector-btn{appearance:none;border:1px solid rgba(100,116,139,.18);background:#fff;color:#315277;cursor:pointer;font-size:12px;font-weight:750;padding:6px 9px;border-radius:7px;line-height:1;}",".rte-state-inspector-btn:hover,.rte-state-inspector-btn:focus-visible{background:#eef4ff;color:#0f3f9f;border-color:rgba(37,99,235,.28);}",".rte-state-inspector-tabs{display:flex;gap:2px;padding:8px 10px 0 10px;border-bottom:1px solid rgba(148,163,184,.16);}",".rte-state-inspector-tab{appearance:none;border:1px solid transparent;border-bottom:none;background:transparent;color:#52657e;cursor:pointer;font-size:12px;font-weight:800;padding:7px 10px;border-radius:7px 7px 0 0;line-height:1;}",".rte-state-inspector-tab:hover,.rte-state-inspector-tab:focus-visible{background:#f8fbff;color:#0f3f9f;}",".rte-state-inspector-tab[aria-selected='true']{background:#eef4ff;border-color:rgba(37,99,235,.26);color:#0f3f9f;}",".rte-state-inspector-body{padding:10px;overflow:auto;min-height:160px;max-height:540px;scrollbar-width:thin;font-size:12px;line-height:1.5;}",".rte-state-inspector-issue{display:block;padding:8px 10px;margin-bottom:6px;border:1px solid rgba(148,163,184,.24);border-left-width:3px;border-radius:7px;background:#fff;}",".rte-state-inspector-issue.is-error{border-left-color:#dc2626;background:#fef4f4;}",".rte-state-inspector-issue.is-warn{border-left-color:#d97706;background:#fffaf1;}",".rte-state-inspector-issue-msg{font-weight:750;color:#172033;}",".rte-state-inspector-issue-meta{margin-top:3px;font-size:11px;color:#52657e;font-family:Consolas,'Cascadia Mono',monospace;word-break:break-all;}",".rte-state-inspector-ok{padding:14px;color:#166534;font-weight:750;background:#f0fdf4;border:1px dashed rgba(22,101,52,.3);border-radius:8px;}",".rte-state-inspector-empty{padding:14px;color:#52657e;font-weight:700;background:#fff;border:1px dashed rgba(148,163,184,.34);border-radius:8px;}",".rte-state-inspector-pre{margin:0;font-family:Consolas,'Cascadia Mono',monospace;font-size:11px;line-height:1.55;color:#172033;white-space:pre;}",".rte-state-inspector-row{display:flex;gap:8px;padding:4px 0;border-bottom:1px solid rgba(148,163,184,.14);}",".rte-state-inspector-row-key{flex:0 0 116px;color:#52657e;font-weight:750;}",".rte-state-inspector-row-val{flex:1 1 auto;min-width:0;font-family:Consolas,'Cascadia Mono',monospace;word-break:break-all;}",".rte-state-inspector-row.is-flagged .rte-state-inspector-row-val{color:#b91c1c;font-weight:750;}","@media (max-width: 1100px){.rte-state-inspector-shell{display:block;}.rte-state-inspector-panel{margin-top:12px;max-width:none;width:100%;}.rte-state-inspector-body{max-height:340px;}}"].join(""),ee.head.appendChild(ue),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(ee,ue,"rte-state-inspector-style",ue.textContent)}}function P(){if(x)return x;var ee=u.container,ue=ee.ownerDocument;x=ue.createElement("div"),x.className="rte-state-inspector-shell";var ce=ue.createElement("div");ce.className="rte-state-inspector-host",ee.parentNode.insertBefore(x,ee),x.appendChild(ce),ce.appendChild(ee),H=ue.createElement("aside"),H.className="rte-state-inspector-panel",H.setAttribute("role","complementary"),H.setAttribute("aria-label",u.stateInspectorTitle);var ve=ue.createElement("div");ve.className="rte-state-inspector-header";var be=ue.createElement("div");be.className="rte-state-inspector-kicker",be.innerText="Developer";var ke=ue.createElement("div");ke.className="rte-state-inspector-title",ke.innerText=u.stateInspectorTitle;var Pe=ue.createElement("div");Pe.className="rte-state-inspector-copy",Pe.innerText=u.stateInspectorHint,ve.appendChild(be),ve.appendChild(ke),ve.appendChild(Pe);var Le=ue.createElement("div");Le.className="rte-state-inspector-toolbar",z=ue.createElement("div"),z.className="rte-state-inspector-summary",z.setAttribute("data-rte-inspector-summary","1");var qe=ue.createElement("div");qe.className="rte-state-inspector-actions",qe.appendChild(B(ue,"Copy","Copy the state snapshot as JSON",se)),qe.appendChild(B(ue,"Hide","Hide the state inspector",ae)),Le.appendChild(z),Le.appendChild(qe),$=ue.createElement("div"),$.className="rte-state-inspector-tabs",$.setAttribute("role","tablist");for(var Re=0;Re<q.length;Re++)$.appendChild(Z(ue,q[Re]));return F=ue.createElement("div"),F.className="rte-state-inspector-body",H.appendChild(ve),H.appendChild(Le),H.appendChild($),H.appendChild(F),x.appendChild(H),x}function B(ee,ue,ce,ve){var be=ee.createElement("button");return be.type="button",be.className="rte-state-inspector-btn",be.innerText=ue,be.setAttribute("aria-label",ce),be.onclick=ve,be}function Z(ee,ue){var ce=ee.createElement("button");return ce.type="button",ce.className="rte-state-inspector-tab",ce.innerText=ue.label,ce.setAttribute("role","tab"),ce.setAttribute("data-rte-inspector-tab",ue.id),ce.setAttribute("aria-selected",ue.id===O?"true":"false"),ce.onclick=function(){O=ue.id,fe(),Q()},ce}function fe(){if($)for(var ee=$.querySelectorAll("[data-rte-inspector-tab]"),ue=0;ue<ee.length;ue++){var ce=ee[ue].getAttribute("data-rte-inspector-tab");ee[ue].setAttribute("aria-selected",ce===O?"true":"false")}}function re(){x&&x.classList.contains("is-open")?ae():ie()}function ie(){P(),x.classList.add("is-open"),Q()}function ae(){x&&x.classList.remove("is-open")}function de(){!x||!x.classList.contains("is-open")||(clearTimeout(o),o=setTimeout(function(){Q()},120))}function se(){var ee=JSON.stringify(g(),null,2);if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(ee);return}var ue=u.container.ownerDocument,ce=ue.createElement("textarea");ce.value=ee,ce.style.position="fixed",ce.style.opacity="0",ue.body.appendChild(ce),ce.select();try{ue.execCommand("copy")}catch{}ue.body.removeChild(ce)}function U(ee){for(;ee.firstChild;)ee.removeChild(ee.firstChild)}function Q(){if(!(!x||!F)){for(var ee=v(),ue=A(ee),ce=u.container.ownerDocument,ve=0,be=0;be<ue.issues.length;be++)ue.issues[be].severity==="error"&&ve++;z&&(z.innerText=ee.counters.elements+" el \xB7 "+ue.issues.length+" issue"+(ue.issues.length===1?"":"s")+(ve?" \xB7 "+ve+" error"+(ve===1?"":"s"):"")),U(F),O==="issues"?j(ce,ue.issues):O==="tree"?J(ce,ee):O==="selection"?te(ce):O==="plugins"?ye(ce):O==="log"&&me(ce)}}function j(ee,ue){if(!ue.length){var ce=ee.createElement("div");ce.className="rte-state-inspector-ok",ce.innerText="No structural issues found.",F.appendChild(ce);return}for(var ve=0;ve<ue.length;ve++){var be=ue[ve],ke=ee.createElement("div");ke.className="rte-state-inspector-issue is-"+(be.severity==="error"?"error":"warn"),ke.setAttribute("data-rte-issue-id",be.id);var Pe=ee.createElement("div");Pe.className="rte-state-inspector-issue-msg",Pe.innerText=be.message;var Le=ee.createElement("div");Le.className="rte-state-inspector-issue-meta",Le.innerText=(be.detail||"(document root)")+" \xB7 "+be.id,ke.appendChild(Pe),ke.appendChild(Le),F.appendChild(ke)}}function J(ee,ue){if(!ue.root||!ue.root.children.length){var ce=ee.createElement("div");ce.className="rte-state-inspector-empty",ce.innerText=u.stateInspectorEmptyText,F.appendChild(ce);return}var ve=ee.createElement("pre");ve.className="rte-state-inspector-pre",ve.innerText=Y(ue.root,0).join(`
74
74
  `),F.appendChild(ve)}function Y(ee,ue){var ce=[],ve=new Array(ue+1).join(" ");if(ee.type==="text")return ce.push(ve+"#text("+ee.length+") "+JSON.stringify(ee.text)),ce;if(ee.type==="comment")return ce.push(ve+"#comment("+ee.length+")"),ce;var be=ve+"<"+ee.name,ke=[];for(var Pe in ee.attrs)ke.push(Pe);if(ke.length){ke.sort();for(var Le=0;Le<ke.length&&Le<4;Le++)be+=" "+ke[Le]+"="+JSON.stringify(ee.attrs[ke[Le]]);ke.length>4&&(be+=" \u2026+"+(ke.length-4))}be+=">",ee.truncated&&(be+=" \u2026 "+ee.childCount+" children (depth limit)"),ce.push(be);for(var qe=0;qe<(ee.children||[]).length;qe++)ce=ce.concat(Y(ee.children[qe],ue+1));return ce}function te(ee){var ue=s();if(!ue.available){var ce=ee.createElement("div");ce.className="rte-state-inspector-empty",ce.innerText="No selection in the document.",F.appendChild(ce);return}pe(ee,"Collapsed",String(ue.collapsed)),pe(ee,"In editable",String(ue.insideEditable),!ue.insideEditable),pe(ee,"Block path",ue.block||"(root)"),pe(ee,"Anchor",le(ue.anchor),!!(ue.anchor&&ue.anchor.zeroLength)),pe(ee,"Focus",le(ue.focus),!!(ue.focus&&ue.focus.zeroLength)),pe(ee,"Selected",ue.textLength+" chars"),ue.text&&pe(ee,"Text",ue.text)}function le(ee){if(!ee)return"(none)";var ue=ee.node+" @ "+ee.offset;return typeof ee.length=="number"&&(ue+=" (len "+ee.length+")"),typeof ee.childCount=="number"&&(ue+=" ("+ee.childCount+" children)"),ee.zeroLength&&(ue+=" \u2190 zero-length text node"),ue}function pe(ee,ue,ce,ve){var be=ee.createElement("div");be.className="rte-state-inspector-row"+(ve?" is-flagged":"");var ke=ee.createElement("div");ke.className="rte-state-inspector-row-key",ke.innerText=ue;var Pe=ee.createElement("div");Pe.className="rte-state-inspector-row-val",Pe.innerText=ce,be.appendChild(ke),be.appendChild(Pe),F.appendChild(be)}function ye(ee){if(!V.length){var ue=ee.createElement("div");ue.className="rte-state-inspector-empty",ue.innerText="No plugins registered.",F.appendChild(ue);return}var ce=ee.createElement("div");ce.className="rte-state-inspector-copy",ce.innerText="Initialization order. A plugin can only register into another plugin's API if it appears below it.",F.appendChild(ce);for(var ve=0;ve<V.length;ve++)pe(ee,String(ve+1).padStart?String(ve+1).padStart(3,"0"):String(ve+1),V[ve].name)}function me(ee){if(!K.length){var ue=ee.createElement("div");ue.className="rte-state-inspector-empty",ue.innerText="No editor events recorded yet.",F.appendChild(ue);return}for(var ce=K[0].at,ve=K.length-1;ve>=0;ve--)pe(ee,"+"+(K[ve].at-ce)+"ms",K[ve].event)}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_tableofcontents=RTE_Plugin_TableOfContents,typeof RTE_DefaultConfig.tocTitle>"u"&&(RTE_DefaultConfig.tocTitle="Contents"),typeof RTE_DefaultConfig.tocMinLevel>"u"&&(RTE_DefaultConfig.tocMinLevel=1),typeof RTE_DefaultConfig.tocMaxLevel>"u"&&(RTE_DefaultConfig.tocMaxLevel=3),typeof RTE_DefaultConfig.tocPageNumbers>"u"&&(RTE_DefaultConfig.tocPageNumbers="auto");function RTE_Plugin_TableOfContents(){var N=this,u,r,x=null,H=!1,F=0;N.PluginName="TableOfContents",N.InitConfig=function(f){u=f},N.InitEditor=function(f){r=f,r.attachEvent("exec_command_inserttoc",function(_){_.returnValue=!0,N.Insert()}),$();try{r.attachEvent("ready",$)}catch{}try{r.attachEvent("aftersethtml",function(){$(),O()})}catch{}setTimeout(function(){$(),O()},0),r.insertTableOfContents=function(){return N.Insert()},r.updateTableOfContents=function(){return M()},r.removeTableOfContents=function(){return N.Remove()},r.hasTableOfContents=function(){return!!W()},r.getTableOfContents=function(){return N.List()},r.getTocCss=function(){return R()}};function $(){var f=z();if(f&&(l(f),f!==x)){x=f;var _=o();_&&(_.addEventListener("keyup",O),_.addEventListener("cut",O),_.addEventListener("paste",O),_.addEventListener("drop",O),_.addEventListener("click",function(v){var s=V(v.target,"rte-toc-link",_);if(s){v.preventDefault();var c=_.querySelector("#"+K(s.getAttribute("data-toc-target")));if(c)try{c.scrollIntoView({block:"center"})}catch{c.scrollIntoView()}}}))}}function z(){try{return r.getDocument()}catch{return null}}function o(){try{return r.getEditable()}catch{return null}}function O(){H||(H=!0,setTimeout(function(){H=!1,M()},0))}function V(f,_,v){for(;f&&f!==v;){if(f.nodeType===1&&f.classList&&f.classList.contains(_))return f;f=f.parentNode}return null}function K(f){return String(f||"").replace(/["\\\]\[]/g,"\\$&")}function W(){var f=o();return f?f.querySelector("nav.rte-toc"):null}function q(){var f=Math.max(1,Math.min(6,parseInt(u.tocMinLevel,10)||1)),_=Math.max(f,Math.min(6,parseInt(u.tocMaxLevel,10)||3));return{min:f,max:_}}function b(){var f=o();if(!f)return[];for(var _=q(),v=[],s=_.min;s<=_.max;s++)v.push("h"+s);for(var c=f.querySelectorAll(v.join(",")),p=[],g=0;g<c.length;g++){var h=c[g];h.closest&&(h.closest("nav.rte-toc")||h.closest("section.rte-footnotes"))||(h.textContent||"").trim()&&p.push(h)}return p}function m(f){var _=f.getAttribute("id");return _&&_.indexOf("rte-h-")===0||_||(_="rte-h-"+Math.floor(Math.random()*1e9).toString(36)+(F++).toString(36),f.setAttribute("id",_)),_}function k(){var f=u.tocPageNumbers;if(f===!1||typeof r.getPageOfElement!="function")return!1;if(f===!0)return!0;try{return typeof r.isPageView=="function"&&r.isPageView()}catch{return!1}}N.Insert=function(){var f=z(),_=o();if(!f||!_)return!1;var v=W();if(v)return M(),!0;var s=f.createElement("nav");s.className="rte-toc",s.setAttribute("contenteditable","false"),s.setAttribute("data-rte-toc","1");var c=!1;try{typeof r.insertElement=="function"&&(r.insertElement(s),c=!0)}catch{}return c||_.insertBefore(s,_.firstChild),M(),I(),!0},N.Remove=function(){var f=W();return!f||!f.parentNode?!1:(f.parentNode.removeChild(f),I(),!0)};function M(){var f=W();if(!f)return[];var _=z();if(!_)return[];for(var v=b(),s=q(),c=k(),p={},g=f.querySelectorAll("li.rte-toc-item"),h=0;h<g.length;h++){var L=g[h].querySelector("a.rte-toc-link"),E=g[h].querySelector(".rte-toc-page");if(L&&E){var A=parseInt(E.textContent,10);A&&(p[L.getAttribute("data-toc-target")]=A)}}for(;f.firstChild;)f.removeChild(f.firstChild);var C=String(u.tocTitle==null?"":u.tocTitle);if(C){var y=_.createElement("div");y.className="rte-toc-title",y.textContent=C,f.appendChild(y)}if(!v.length){var d=_.createElement("div");return d.className="rte-toc-empty",d.textContent="No headings yet.",f.appendChild(d),[]}var w=_.createElement("ol");w.className="rte-toc-list";for(var D=[],P=0;P<v.length;P++){var B=v[P],Z=parseInt(B.nodeName.substring(1),10)||1,fe=m(B),re=(B.textContent||"").trim(),ie=_.createElement("li");ie.className="rte-toc-item rte-toc-l"+(Z-s.min+1);var ae=_.createElement("a");ae.className="rte-toc-link",ae.setAttribute("href","#"+fe),ae.setAttribute("data-toc-target",fe),ae.textContent=re,ie.appendChild(ae);var de=null;if(c)try{de=r.getPageOfElement(B)}catch{de=null}if(!de&&p[fe]&&(de=p[fe]),de){var se=_.createElement("span");se.className="rte-toc-page",se.textContent=String(de),ie.appendChild(se)}w.appendChild(ie),D.push({id:fe,level:Z,text:re,page:de})}return f.appendChild(w),D}N.List=function(){var f=W();if(!f)return[];for(var _=f.querySelectorAll("li.rte-toc-item"),v=[],s=0;s<_.length;s++){var c=_[s].querySelector("a.rte-toc-link"),p=_[s].querySelector(".rte-toc-page"),g=_[s].className.match(/rte-toc-l(\d+)/);v.push({id:c?c.getAttribute("data-toc-target"):null,level:g?parseInt(g[1],10):1,text:c?c.textContent:"",page:p?parseInt(p.textContent,10):null})}return v};function I(){try{typeof r.updateDesign=="function"&&r.updateDesign()}catch{}try{typeof r.fireChange=="function"&&r.fireChange()}catch{}}function R(){return"nav.rte-toc{margin:0 0 1.4em;padding:.9em 1.1em;border:1px solid #ddd;border-radius:6px;background:#fafbfc;}nav.rte-toc .rte-toc-title{font-weight:700;margin-bottom:.45em;}nav.rte-toc .rte-toc-empty{color:#888;font-style:italic;}ol.rte-toc-list{list-style:none;margin:0;padding:0;counter-reset:rte-toc;}ol.rte-toc-list>li{counter-increment:rte-toc;margin:.16em 0;display:flex;align-items:baseline;gap:.5em;}ol.rte-toc-list>li>a{color:#1474ea;text-decoration:none;cursor:pointer;}ol.rte-toc-list>li>a:hover{text-decoration:underline;}ol.rte-toc-list>li:has(>.rte-toc-page)>a::after{content:'';flex:1 1 auto;margin:0 .4em;border-bottom:1px dotted #bbb;transform:translateY(-.25em);display:inline-block;min-width:1.5em;}ol.rte-toc-list>li>a{flex:1 1 auto;display:flex;align-items:baseline;}.rte-toc-page{flex:0 0 auto;color:#666;font-variant-numeric:tabular-nums;}.rte-toc-l2{padding-left:1.3em;}.rte-toc-l3{padding-left:2.6em;}.rte-toc-l4{padding-left:3.9em;}.rte-toc-l5{padding-left:5.2em;}.rte-toc-l6{padding-left:6.5em;}"}function l(f){if(f){var _=f.getElementById("rte-toc-styles"),v=R();if(_){if(_.getAttribute("data-css")===v)return;_.parentNode&&_.parentNode.removeChild(_)}var s=f.createElement("style");s.id="rte-toc-styles",s.setAttribute("data-css",v),s.appendChild(f.createTextNode(v)),(f.head||f.getElementsByTagName("head")[0]||f.documentElement).appendChild(s),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(f,s,"rte-toc-styles",s.textContent)}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_tabletools=RTE_Plugin_TableTools,typeof RTE_DefaultConfig.tableNumberSeries>"u"&&(RTE_DefaultConfig.tableNumberSeries="numeric"),typeof RTE_DefaultConfig.tableNumberHeader>"u"&&(RTE_DefaultConfig.tableNumberHeader="#");function RTE_Plugin_TableTools(){var N=this,u,r;N.PluginName="TableTools",N.InitConfig=function(R){u=R},N.InitEditor=function(R){r=R,r.attachEvent("exec_command_sorttable",function(l){l.returnValue=!0,N.SortAtCaret(l&&l.value==="desc"?"desc":"asc")}),r.attachEvent("exec_command_tablerownumbers",function(l){l.returnValue=!0,N.ToggleRowNumbers()}),r.sortTableByColumn=function(l,f){return N.Sort(H(),l,f)},r.sortTableAtCaret=function(l){return N.SortAtCaret(l)},r.canSortTable=function(){return o(H())},r.addTableRowNumbers=function(l){return N.AddRowNumbers(l)},r.removeTableRowNumbers=function(){return N.RemoveRowNumbers()},r.hasTableRowNumbers=function(){var l=H();return!!(l&&l.querySelector("[data-rte-rownum]"))}};function x(){try{return r.getEditable()}catch{return null}}function H(){try{var R=r.getSelection();if(!R||R.rangeCount===0)return null;var l=R.getRangeAt(0).startContainer;l&&l.nodeType===3&&(l=l.parentNode);for(var f=x();l&&l!==f;){if(l.nodeName==="TABLE")return l;l=l.parentNode}return null}catch{return null}}function F(){try{var R=r.getSelection();if(!R||R.rangeCount===0)return null;var l=R.getRangeAt(0).startContainer;l&&l.nodeType===3&&(l=l.parentNode);for(var f=x();l&&l!==f;){if(l.nodeName==="TD"||l.nodeName==="TH")return l;l=l.parentNode}return null}catch{return null}}function $(R){if(!R)return[];for(var l=Array.prototype.slice.call(R.rows||[]),f=[],_=0;_<l.length;_++){var v=l[_],s=v.parentNode?v.parentNode.nodeName:"";s==="THEAD"||s==="TFOOT"||f.length===0&&_===0&&v.cells.length&&z(v)||f.push(v)}return f}function z(R){for(var l=0;l<R.cells.length;l++)if(R.cells[l].nodeName!=="TH")return!1;return!0}function o(R){if(!R)return{ok:!1,reason:"The caret is not inside a table."};var l=$(R);if(l.length<2)return{ok:!1,reason:"The table has fewer than two sortable rows."};for(var f=0;f<l.length;f++)for(var _=0;_<l[f].cells.length;_++){var v=l[f].cells[_];if((v.rowSpan||1)>1||(v.colSpan||1)>1)return{ok:!1,reason:"This table has merged cells. Sorting would move rows out from under a rowspan and break the table, so it has been left alone."}}return{ok:!0,reason:""}}function O(R){var l=String(R??"").trim();if(!l)return{type:"empty",v:""};if(/\d/.test(l)){var f=l.replace(/[\s ,]/g,"").replace(/^\(([^)]*)\)$/,"-$1").replace(/[^0-9.eE+-]/g,"");if(f&&/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(f))return{type:"number",v:parseFloat(f)};var _=Date.parse(l);if(!isNaN(_))return{type:"date",v:_}}return{type:"text",v:l.toLowerCase()}}function V(R,l){for(var f={number:0,date:0,text:0},_=0;_<R.length;_++){var v=R[_].cells[l];if(v){var s=O(v.textContent);s.type!=="empty"&&f[s.type]++}}return f.number>=f.date&&f.number>=f.text&&f.number>0?"number":f.date>=f.text&&f.date>0?"date":"text"}N.SortAtCaret=function(R){var l=H(),f=F();return!l||!f?!1:N.Sort(l,f.cellIndex,R)},N.Sort=function(R,l,f){var _=o(R);if(!_.ok)return _;for(var v=String(f).toLowerCase()==="desc",s=$(R),c=V(s,l),p=[],g=0;g<s.length;g++){var h=s[g].cells[l];p.push({row:s[g],order:g,val:O(h?h.textContent:"")})}p.sort(function(C,y){if(C.val.type==="empty"&&y.val.type==="empty")return C.order-y.order;if(C.val.type==="empty")return 1;if(y.val.type==="empty")return-1;var d;if(c==="number"||c==="date"){var w=C.val.type===c?C.val.v:Number.POSITIVE_INFINITY,D=y.val.type===c?y.val.v:Number.POSITIVE_INFINITY;d=w<D?-1:w>D?1:0}else{var P=String(C.val.v),B=String(y.val.v);d=P.localeCompare?P.localeCompare(B,void 0,{numeric:!0,sensitivity:"base"}):P<B?-1:P>B?1:0}return d===0?C.order-y.order:v?-d:d});var L=p.length?p[0].row.parentNode:null;if(!L)return{ok:!1,reason:"The table has no sortable rows."};for(var E=F(),A=0;A<p.length;A++)L.appendChild(p[A].row);return M(E),k(R),I(),{ok:!0,reason:"",sortedBy:l,direction:v?"desc":"asc",detectedType:c}};function K(R,l){switch(String(l)){case"upper-alpha":return W(R).toUpperCase();case"lower-alpha":return W(R);case"upper-roman":return q(R);case"lower-roman":return q(R).toLowerCase();default:return String(R)}}function W(R){for(var l="";R>0;){var f=(R-1)%26;l=String.fromCharCode(97+f)+l,R=Math.floor((R-1)/26)}return l||"a"}function q(R){for(var l=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],f="",_=0;_<l.length;_++)for(;R>=l[_][0];)f+=l[_][1],R-=l[_][0];return f||"I"}N.AddRowNumbers=function(R){var l=H();if(!l)return!1;if(l.querySelector("[data-rte-rownum]"))return k(l),!0;R=R||{};for(var f=R.series||u.tableNumberSeries,_=l.ownerDocument,v=Array.prototype.slice.call(l.rows||[]),s=$(l),c={},p=0;p<s.length;p++)c[m(s[p])]=!0;for(var g=0;g<v.length;g++){var h=v[g],L=c[m(h)],E=_.createElement(L?"td":"th");E.setAttribute("data-rte-rownum",L?"value":"header"),L||(E.textContent=String(u.tableNumberHeader==null?"#":u.tableNumberHeader)),h.insertBefore(E,h.firstChild)}return l.setAttribute("data-rte-rownum-series",f),k(l),I(),!0};var b=0;function m(R){return R.__rteKey||(R.__rteKey="r"+b++),R.__rteKey}N.RemoveRowNumbers=function(){var R=H();if(!R)return!1;var l=R.querySelectorAll("[data-rte-rownum]");if(!l.length)return!1;for(var f=0;f<l.length;f++)l[f].parentNode&&l[f].parentNode.removeChild(l[f]);return R.removeAttribute("data-rte-rownum-series"),I(),!0},N.ToggleRowNumbers=function(){var R=H();return R?R.querySelector("[data-rte-rownum]")?N.RemoveRowNumbers():N.AddRowNumbers():!1};function k(R){if(R)for(var l=R.getAttribute("data-rte-rownum-series")||u.tableNumberSeries,f=$(R),_=1,v=0;v<f.length;v++){var s=f[v].querySelector("[data-rte-rownum='value']");s&&(s.textContent=K(_++,l))}}function M(R){if(!(!R||!R.parentNode))try{var l=R.ownerDocument,f=l.createRange();f.selectNodeContents(R),f.collapse(!0);var _=r.getSelection();_.removeAllRanges(),_.addRange(f)}catch{}}function I(){try{typeof r.updateDesign=="function"&&r.updateDesign()}catch{}try{typeof r.fireChange=="function"&&r.fireChange()}catch{}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_textdirection=RTE_Plugin_TextDirection,typeof RTE_DefaultConfig.defaultTextDirection>"u"&&(RTE_DefaultConfig.defaultTextDirection=null),typeof RTE_DefaultConfig.textDirectionAutoDetect>"u"&&(RTE_DefaultConfig.textDirectionAutoDetect=!1),typeof RTE_DefaultConfig.textDirectionSwapAlign>"u"&&(RTE_DefaultConfig.textDirectionSwapAlign=!0);function RTE_Plugin_TextDirection(){var N=this,u,r,x=null,H={P:1,DIV:1,LI:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,BLOCKQUOTE:1,TD:1,TH:1,PRE:1,UL:1,OL:1,TABLE:1,SECTION:1,ARTICLE:1},F=/[֐-׿؀-ۿ܀-ݏݐ-ݿހ-޿߀-߿ࠀ-࠿ࡀ-࡟ࢠ-ࣿיִ-﷿ﹰ-]/,$=/[A-Za-zÀ-ʯͰ-֏ऀ-႟Ḁ-῿Ⰰ-ⷿ⺀-꓏가-힯]/;N.PluginName="TextDirection",N.InitConfig=function(R){u=R},N.InitEditor=function(R){r=R,r.attachEvent("exec_command_textdirection",function(l){l.returnValue=!0;var f=l&&l.value;f==="rtl"||f==="ltr"?N.Apply(f):N.Toggle()}),z();try{r.attachEvent("ready",z)}catch{}try{r.attachEvent("aftersethtml",function(){z(),o()})}catch{}setTimeout(function(){z(),o()},0),r.setTextDirection=function(l){return N.Apply(l)},r.toggleTextDirection=function(){return N.Toggle()},r.getTextDirection=function(){return N.Current()},r.setBaseDirection=function(l){return N.Base(l)},r.getBaseDirection=function(){var l=V();return l&&l.getAttribute("dir")||"ltr"},r.detectTextDirection=function(l){return K(String(l??""))},r.autoDetectTextDirection=function(){return N.AutoDetect()},r.isolateBidi=function(l,f){return N.Isolate(l,f)},r.insertIsolated=function(l,f){return N.InsertIsolated(l,f)},r.getTextDirectionCss=function(){return M()}};function z(){var R=O();!R||R===x||(x=R,I(R))}function o(){var R=V();R&&((u.defaultTextDirection==="rtl"||u.defaultTextDirection==="ltr")&&(R.getAttribute("dir")||N.Base(u.defaultTextDirection)),u.textDirectionAutoDetect&&N.AutoDetect())}function O(){try{return r.getDocument()}catch{return null}}function V(){try{return r.getEditable()}catch{return null}}function K(R){for(var l=0;l<R.length;l++){var f=R.charAt(l);if(F.test(f))return"rtl";if($.test(f))return"ltr"}return"neutral"}function W(){var R=V(),l=[];try{var f=r.getSelection();if(!f||f.rangeCount===0)return l;var _=f.getRangeAt(0),v=b(_.startContainer),s=b(_.endContainer);if(!v)return l;if(v===s||_.collapsed)return[v];for(var c=R.querySelectorAll("*"),p=!1,g=0;g<c.length;g++){var h=c[g];if(H[h.nodeName]&&(h===v&&(p=!0),p&&!q(h)&&l.push(h),h===s))break}l.length||l.push(v)}catch{}return l}function q(R){for(var l=0;l<R.children.length;l++)if(H[R.children[l].nodeName])return!0;return!1}function b(R){for(var l=V(),f=R&&R.nodeType===3?R.parentNode:R;f&&f!==l;){if(f.nodeType===1&&H[f.nodeName])return f;f=f.parentNode}return l&&l.firstElementChild?l.firstElementChild:null}N.Current=function(){var R=W()[0];if(!R)return r.getBaseDirection?r.getBaseDirection():"ltr";var l=R.getAttribute("dir");if(l)return l;try{var f=O(),_=f&&(f.defaultView||f.parentWindow);if(_)return _.getComputedStyle(R).direction||"ltr"}catch{}return"ltr"},N.Apply=function(R){R=R==="rtl"?"rtl":R==="auto"?"auto":"ltr";var l=W();if(!l.length)return!1;for(var f=0;f<l.length;f++){var _=l[f],v=_.getAttribute("dir")||"ltr";_.setAttribute("dir",R),u.textDirectionSwapAlign!==!1&&R!=="auto"&&v!==R&&m(_,R)}return k(),R},N.Toggle=function(){return N.Apply(N.Current()==="rtl"?"ltr":"rtl")};function m(R,l){var f=R.style&&R.style.textAlign||R.getAttribute("align")||"";if(f){var _=null;if(f==="left"?_="right":f==="right"&&(_="left"),!!_){var v=l==="rtl"?"right":"left";R.style&&(R.style.textAlign=_===v?"":_),R.getAttribute("align")&&R.removeAttribute("align")}}}N.Base=function(R){var l=V();return l?(R=R==="rtl"?"rtl":R==="auto"?"auto":"ltr",l.setAttribute("dir",R),k(),R):!1},N.AutoDetect=function(){var R=V();if(!R)return[];for(var l=[],f=R.querySelectorAll("*"),_=0;_<f.length;_++){var v=f[_];if(!(!H[v.nodeName]||q(v))){var s=K(v.textContent||"");s!=="neutral"&&v.getAttribute("dir")!==s&&(v.setAttribute("dir",s),l.push({tag:v.nodeName,dir:s}))}}return l.length&&k(),l},N.Isolate=function(R,l){var f=l==="rtl"||l==="ltr"?l:"auto";return'<bdi dir="'+f+'">'+String(R??"")+"</bdi>"},N.InsertIsolated=function(R,l){var f=O();if(!f)return!1;var _=f.createElement("bdi");_.setAttribute("dir",l==="rtl"||l==="ltr"?l:"auto"),_.innerHTML=String(R??"");try{if(typeof r.insertElement=="function")return r.insertElement(_),k(),!0}catch{}try{var v=r.getSelection();if(v&&v.rangeCount){var s=v.getRangeAt(0);return s.collapse(!1),s.insertNode(_),s.setStartAfter(_),s.collapse(!0),v.removeAllRanges(),v.addRange(s),k(),!0}}catch{}return!1};function k(){try{typeof r.updateDesign=="function"&&r.updateDesign()}catch{}try{typeof r.fireChange=="function"&&r.fireChange()}catch{}}function M(){return"[dir='rtl'] ul,[dir='rtl'] ol{padding-right:1.6em;padding-left:0;}[dir='rtl'] blockquote{border-right:3px solid #ddd;border-left:0;padding-right:.9em;padding-left:0;margin-right:0;}[dir='rtl'] table{direction:rtl;}bdi{unicode-bidi:isolate;}"}function I(R){if(R){var l=R.getElementById("rte-textdirection-styles"),f=M();if(l){if(l.getAttribute("data-css")===f)return;l.parentNode&&l.parentNode.removeChild(l)}var _=R.createElement("style");_.id="rte-textdirection-styles",_.setAttribute("data-css",f),_.appendChild(R.createTextNode(f)),(R.head||R.getElementsByTagName("head")[0]||R.documentElement).appendChild(_),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(R,_,"rte-textdirection-styles",_.textContent)}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_textpartlanguage=RTE_Plugin_TextPartLanguage,typeof RTE_DefaultConfig.textPartLanguages>"u"&&(RTE_DefaultConfig.textPartLanguages=[{code:"ar",label:"Arabic",dir:"rtl"},{code:"zh-Hans",label:"Chinese (Simplified)"},{code:"zh-Hant",label:"Chinese (Traditional)"},{code:"cs",label:"Czech"},{code:"nl",label:"Dutch"},{code:"en",label:"English"},{code:"fr",label:"French"},{code:"de",label:"German"},{code:"el",label:"Greek"},{code:"he",label:"Hebrew",dir:"rtl"},{code:"hi",label:"Hindi"},{code:"it",label:"Italian"},{code:"ja",label:"Japanese"},{code:"ko",label:"Korean"},{code:"fa",label:"Persian",dir:"rtl"},{code:"pl",label:"Polish"},{code:"pt",label:"Portuguese"},{code:"ru",label:"Russian"},{code:"es",label:"Spanish"},{code:"sv",label:"Swedish"},{code:"tr",label:"Turkish"},{code:"uk",label:"Ukrainian"},{code:"ur",label:"Urdu",dir:"rtl"},{code:"vi",label:"Vietnamese"}]),typeof RTE_DefaultConfig.textPartLanguageHighlight>"u"&&(RTE_DefaultConfig.textPartLanguageHighlight=!0);function RTE_Plugin_TextPartLanguage(){var N=this,u,r,x=null;N.PluginName="TextPartLanguage",N.InitConfig=function(v){u=v},N.InitEditor=function(v){r=v,r.attachEvent("exec_command_textpartlanguage",function(s){s.returnValue=!0;var c=s&&s.value;!c||c==="none"||c==="remove"?N.Remove():N.Apply(c)}),r.toolbarFactoryMap&&(r.toolbarFactoryMap.textpartlanguage=function(s){return r.createToolbarItemDropDownPanel(s,I)}),l();try{r.attachEvent("ready",l)}catch{}try{r.attachEvent("aftersethtml",l)}catch{}setTimeout(l,0),r.setTextLanguage=function(s){return N.Apply(s)},r.removeTextLanguage=function(){return N.Remove()},r.getTextLanguage=function(){return N.Current()},r.listTextLanguages=function(){return $().slice()},r.getMarkedLanguages=function(){return N.List()}};function H(){try{return r.getDocument()}catch{return null}}function F(){try{return r.getEditable()}catch{return null}}function $(){var v=u&&u.textPartLanguages;return v&&v.length?v:[]}function z(v){for(var s=$(),c=0;c<s.length;c++)if(s[c].code===v)return s[c];return{code:v,label:v}}function o(v){for(var s=F(),c=v&&v.nodeType===3?v.parentNode:v;c&&c!==s&&c.nodeType===1;){if(c.hasAttribute&&c.hasAttribute("lang"))return c;c=c.parentNode}return null}function O(){try{var v=r.getSelection();return!v||v.rangeCount===0?null:v.getRangeAt(0)}catch{return null}}N.Current=function(){var v=O();if(!v)return null;var s=o(v.startContainer);return s&&!v.collapsed&&o(v.endContainer)!==s?null:s?s.getAttribute("lang"):null},N.List=function(){var v=F(),s=[];if(!v)return s;for(var c={},p=v.querySelectorAll("[lang]"),g=0;g<p.length;g++){var h=p[g].getAttribute("lang");!h||c[h]||(c[h]=!0,s.push({code:h,label:z(h).label}))}return s},N.Apply=function(v){if(v=String(v??"").trim(),!v)return!1;var s=H(),c=O();if(!s||!c)return!1;if(N.Current()===v)return N.Remove();if(c.collapsed){var p=o(c.startContainer);return p?(K(p,v),M(),v):!1}var g=s.createElement("span");K(g,v);try{c.surroundContents(g)}catch{var h=c.extractContents();g.appendChild(h),c.insertNode(g)}return W(g),b(g),g.firstChild?(m(g),k(g),M(),v):(g.parentNode&&g.parentNode.removeChild(g),!1)},N.Remove=function(){var v=O();if(!v)return!1;var s=F();if(!s)return!1;var c=0,p=o(v.startContainer);if(p&&(q(p),c++),!v.collapsed)for(var g=s.querySelectorAll("[lang]"),h=g.length-1;h>=0;h--){var L=g[h];L!==p&&V(v,L)&&(q(L),c++)}return c&&M(),c>0};function V(v,s){try{var c=s.ownerDocument.createRange();return c.selectNodeContents(s),v.compareBoundaryPoints(Range.END_TO_START,c)<0&&v.compareBoundaryPoints(Range.START_TO_END,c)>0}catch{return!1}}function K(v,s){v.setAttribute("lang",s);var c=z(s).dir;c==="rtl"||c==="ltr"?v.setAttribute("dir",c):v.removeAttribute("dir")}function W(v){for(var s=v.querySelectorAll("[lang]"),c=s.length-1;c>=0;c--)q(s[c])}function q(v){if(!(!v||!v.parentNode))if(v.nodeName==="SPAN"&&v.attributes.length<=2&&!v.getAttribute("class")&&!v.getAttribute("style")&&!v.getAttribute("id")){for(var s=v.parentNode;v.firstChild;)s.insertBefore(v.firstChild,v);s.removeChild(v);try{s.normalize()}catch{}}else v.removeAttribute("lang"),v.removeAttribute("dir")}function b(v){for(var s=v.childNodes.length-1;s>=0;s--){var c=v.childNodes[s];c.nodeType===3&&c.nodeValue===""&&v.removeChild(c)}}function m(v){var s=v.getAttribute("lang"),c=v.previousSibling;if(c&&c.nodeType===1&&c.nodeName==="SPAN"&&c.getAttribute("lang")===s){for(;v.firstChild;)c.appendChild(v.firstChild);v.parentNode.removeChild(v),v=c}var p=v.nextSibling;if(p&&p.nodeType===1&&p.nodeName==="SPAN"&&p.getAttribute("lang")===s){for(;p.firstChild;)v.appendChild(p.firstChild);p.parentNode.removeChild(p)}try{v.normalize()}catch{}return v}function k(v){try{var s=r.getSelection(),c=v.ownerDocument.createRange();c.selectNodeContents(v),s.removeAllRanges(),s.addRange(c)}catch{}}function M(){try{typeof r.updateDesign=="function"&&r.updateDesign()}catch{}try{typeof r.fireChange=="function"&&r.fireChange()}catch{}}function I(v){var s=N.Current();v.style.width="220px",v.style.maxHeight="340px",v.style.overflowY="auto",v.style.padding="4px 0";var c=$();R(v,r.getLangText&&r.getLangText("removelanguage")||"Remove language",null,!s,function(){N.Remove()});var p=v.ownerDocument.createElement("div");p.style.cssText="height:1px;margin:4px 6px;background:var(--rte-border-color,#e0e0e0);",v.appendChild(p);for(var g=0;g<c.length;g++)(function(h){R(v,h.label,h.code,s===h.code,function(){N.Apply(h.code)})})(c[g]);setTimeout(function(){var h=v.querySelectorAll("rte-toolbar-dropdown-item");if(h.length){for(var L=h[0],E=0;E<h.length;E++)if(h[E].getAttribute("aria-checked")==="true"){L=h[E];break}try{L.focus()}catch{}}},0)}function R(v,s,c,p,g){var h=v.ownerDocument,L=h.createElement("rte-toolbar-dropdown-item");v.appendChild(L),L.setAttribute("role","menuitemradio"),L.setAttribute("aria-checked",p?"true":"false"),L.setAttribute("tabindex","0"),L.style.cssText="padding:5px 12px;cursor:pointer;white-space:nowrap;display:flex;justify-content:space-between;gap:12px;color:var(--rte-text-color,inherit);"+(p?"font-weight:600;":"");var E=h.createElement("span");if(E.appendChild(h.createTextNode(s)),L.appendChild(E),c){var A=h.createElement("span");A.style.cssText="opacity:.55;font-size:11px;",A.appendChild(h.createTextNode(c)),L.appendChild(A)}L.onmouseover=function(){L.style.backgroundColor="var(--rte-hover-bg,#e6e6e6)"},L.onmouseout=function(){L.style.backgroundColor=""},L.onclick=function(){try{r.closeCurrentPopup()}catch{}try{r.focus()}catch{}g()},L.onkeydown=function(C){var y=C.key;if(y==="Enter"||y===" "||y==="Spacebar"){C.preventDefault(),C.stopPropagation(),L.onclick();return}if(y==="ArrowDown"||y==="ArrowUp"){C.preventDefault(),C.stopPropagation();var d=v.querySelectorAll("rte-toolbar-dropdown-item"),w=Array.prototype.slice.call(d),D=w.indexOf(L),P=w[(D+(y==="ArrowDown"?1:-1)+w.length)%w.length];P&&P.focus();return}if(y==="Home"||y==="End"){C.preventDefault(),C.stopPropagation();var B=v.querySelectorAll("rte-toolbar-dropdown-item"),Z=y==="Home"?B[0]:B[B.length-1];Z&&Z.focus();return}if(y==="Escape"){C.preventDefault(),C.stopPropagation();try{r.closeCurrentPopup()}catch{}}}}function l(){var v=H();!v||v===x||(x=v,_(v))}function f(){return u&&u.textPartLanguageHighlight===!1?"":"[lang]:not(html):not(body){border-bottom:1px dotted rgba(120,120,120,.75);}[lang]:not(html):not(body):hover{background:rgba(120,120,120,.10);}"}function _(v){if(v){var s=f(),c=v.getElementById("rte-textpartlanguage-styles");if(c){if(c.getAttribute("data-css")===s)return;c.parentNode&&c.parentNode.removeChild(c)}if(s){var p=v.createElement("style");p.id="rte-textpartlanguage-styles",p.setAttribute("data-css",s),p.appendChild(v.createTextNode(s)),(v.head||v.getElementsByTagName("head")[0]||v.documentElement).appendChild(p),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(v,p,"rte-textpartlanguage-styles",p.textContent)}}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_todolist=RTE_Plugin_TodoList;function RTE_Plugin_TodoList(){var N=this,u,r,x,H;N.PluginName="TodoList",N.InitConfig=function(V){u=V},N.InitEditor=function(V){r=V,x=r.getEditable(),H=r.getDocument(),r.attachEvent("exec_command_inserttodolist",function(K){K.returnValue=!0,N.InsertTaskList()}),x&&(x.addEventListener("click",function(K){var W=F(K.target,"rte-task-checkbox",x);if(W){var q=W.parentNode;if(!(!q||!q.classList||!q.classList.contains("rte-task-item"))){var b=q.getAttribute("data-checked")==="true";q.setAttribute("data-checked",b?"false":"true"),K.preventDefault(),$()}}}),x.addEventListener("keyup",function(K){if(K.key==="Enter"&&!K.shiftKey){N.Normalize();var W=z();W&&W.setAttribute("data-checked","false")}}),setTimeout(function(){o(H)},0))};function F(V,K,W){for(;V&&V!==W;){if(V.nodeType===1&&V.classList&&V.classList.contains(K))return V;V=V.parentNode}return null}function $(){if(typeof r.fireChange=="function")try{r.fireChange()}catch{}}function z(){try{var V=r.getSelection();if(!V||V.rangeCount===0)return null;var K=V.getRangeAt(0).startContainer;return F(K,"rte-task-item",x)}catch{return null}}function o(V){if(!(!V||V.getElementById("rte-todolist-styles"))){var K="ul.rte-task-list{list-style:none;margin:.4em 0;padding-left:0;}ul.rte-task-list li.rte-task-item{position:relative;padding-left:28px;margin:3px 0;min-height:20px;}li.rte-task-item>.rte-task-checkbox{position:absolute;left:0;top:1px;width:18px;height:18px;border:2px solid #94a3b8;border-radius:5px;box-sizing:border-box;cursor:pointer;user-select:none;transition:background .12s,border-color .12s;}li.rte-task-item>.rte-task-checkbox:hover{border-color:#1d67ba;}li.rte-task-item[data-checked='true']>.rte-task-checkbox{background:#1d67ba;border-color:#1d67ba;}li.rte-task-item[data-checked='true']>.rte-task-checkbox::after{content:'';position:absolute;left:4px;top:0px;width:6px;height:11px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);}li.rte-task-item[data-checked='true']{color:#94a3b8;text-decoration:line-through;}",W=V.createElement("style");W.id="rte-todolist-styles",W.appendChild(V.createTextNode(K)),(V.head||V.getElementsByTagName("head")[0]||V.documentElement).appendChild(W),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(V,W,"rte-todolist-styles",W.textContent)}}function O(){var V=H.createElement("span");return V.className="rte-task-checkbox",V.setAttribute("contenteditable","false"),V}N.Normalize=function(){if(x)for(var V=x.querySelectorAll("ul.rte-task-list"),K=0;K<V.length;K++)for(var W=V[K].children,q=0;q<W.length;q++){var b=W[q];if(b.nodeName==="LI"){b.classList.add("rte-task-item"),b.getAttribute("data-checked")!=="true"&&b.getAttribute("data-checked")!=="false"&&b.setAttribute("data-checked","false");var m=b.firstChild;m&&m.nodeType===1&&m.classList&&m.classList.contains("rte-task-checkbox")||b.insertBefore(O(),b.firstChild)}}},N.InsertTaskList=function(){o(H);var V="rte-todo-pending",K='<ul class="rte-task-list"><li class="rte-task-item" data-checked="false" id="'+V+'"><span class="rte-task-checkbox" contenteditable="false"></span>&#8203;</li></ul>';r.insertHTML(K);try{var W=H.getElementById(V);if(W){W.removeAttribute("id");var q=H.createRange(),b=W.lastChild;b&&b.nodeType===3?q.setStart(b,b.length):q.setStart(W,W.childNodes.length),q.collapse(!0);var m=r.getSelection();m&&(m.removeAllRanges(),m.addRange(q))}}catch{}r.focus(),$()}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.svgCode_trackchanges||(RTE_DefaultConfig.svgCode_trackchanges='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 17l4-1 10-10-3-3L5 13l-1 4z"/><path d="M14 4l3 3"/><path d="M4 21h10"/></svg>'),RTE_DefaultConfig.plugin_trackedchanges=RTE_Plugin_TrackedChanges;function RTE_Plugin_TrackedChanges(){var N=this,u,r,x=!1;N.PluginName="TrackedChanges",N.InitConfig=function(se){u=se,u.trackChangesEnabled!==!1&&(u.currentUser=u.currentUser||null,u.trackChangesInsertClass=u.trackChangesInsertClass||"rte-tc rte-tc-insert",u.trackChangesDeleteClass=u.trackChangesDeleteClass||"rte-tc rte-tc-delete",u.reviewCanDecide=u.reviewCanDecide||null,u.onReviewDecisionDenied=u.onReviewDecisionDenied||null,u.text_trackchanges=u.text_trackchanges||"Suggesting mode",H("toolbar_default","#{trackchanges}"),H("toolbar_full","#{trackchanges}"),H("toolbar_mobile","#{trackchanges}"),(u.controltoolbar_TEXT||"").indexOf("trackchanges")===-1&&(u.controltoolbar_TEXT=(u.controltoolbar_TEXT||"")+"|{trackchanges}"))},N.InitEditor=function(se){r=se,u.trackChangesEnabled!==!1&&(r.trackedChanges={enable:function(U){F(U)},disable:function(){$()},isEnabled:function(){return x},acceptAll:function(U){return fe(U)},rejectAll:function(U){return re(U)},accept:function(U){return B(U)},reject:function(U){return Z(U)},canDecide:function(U,Q){var j=r.reviewLedger&&r.reviewLedger.get(U);return!!j&&P(j,Q||"accept")},list:function(U){if(!r.reviewLedger)return[];var Q=U&&U.all===!0;return r.reviewLedger.list().filter(function(j){return j.changeType!=="insert"&&j.changeType!=="delete"?!1:Q||j.status==="pending"})}},de(),r.toolbarFactoryMap=r.toolbarFactoryMap||{},r.toolbarFactoryMap.trackchanges=function(U){var Q=r.createToolbarButton(U);return Q.__tcSync=function(){x?Q.classList.add("rte-ui-active"):Q.classList.remove("rte-ui-active"),Q.setAttribute("aria-pressed",x?"true":"false"),Q.setAttribute("title",u.text_trackchanges||"Suggesting mode")},Q.__tcSync(),Q},r.attachEvent("exec_command_trackchanges",function(U){U.returnValue=!0,U.stopBubble=!0,x?$():F()}),r.getEditable().addEventListener("beforeinput",o,!0))};function H(se,U){u[se]&&u[se].indexOf(U)===-1&&(u[se]=u[se]+U)}function F(se){se&&(u.currentUser=se),u.currentUser||(u.currentUser={id:"user",name:"User",color:"#2563eb"},console.warn("trackedchanges: no config.currentUser configured; defaulting to generic user.")),x=!0,z()}function $(){x=!1,z()}function z(){for(var se=r.iframe&&r.iframe.ownerDocument||document,U=se.querySelectorAll(".rte_command_trackchanges"),Q=0;Q<U.length;Q++)U[Q].__tcSync&&U[Q].__tcSync()}function o(se){if(x&&r.reviewLedger){var U=se.inputType;if(U){if(U==="insertText"||U==="insertReplacementText"){se.preventDefault(),O(se.data||"");return}if(U==="deleteContentBackward"||U==="deleteContentForward"||U==="deleteByCut"){se.preventDefault(),k(U);return}}}}function O(se){if(se){var U=r.getSelection();if(!(!U||U.rangeCount===0)){var Q=U.getRangeAt(0);if(!Q.collapsed){if(!h(Q))return;Q=U.getRangeAt(0),b(se,Q);return}var j=V(Q);j?q(j,se):b(se,Q)}}}function V(se){var U=se.startContainer;if(U.nodeType===3&&U.parentNode&&K(U.parentNode))return U.parentNode;if(U.nodeType===1&&se.startOffset>0){var Q=U.childNodes[se.startOffset-1];if(Q&&Q.nodeType===1&&K(Q))return Q}return U.nodeType===3&&U.previousSibling&&K(U.previousSibling)&&se.startOffset===0?U.previousSibling:null}function K(se){return!se||se.nodeType!==1||!se.classList||!se.classList.contains("rte-tc-insert")?!1:se.getAttribute("data-tc-author")===u.currentUser.id}function W(se){if(!(!se||se.nodeType!==3)){var U=se.nodeValue;U.indexOf(" ")===-1&&U.indexOf("\xA0")===-1||(U=U.replace(/\u00a0/g," "),U=U.replace(/ (?= )/g,"\xA0"),U=U.replace(/ $/,"\xA0"),U!==se.nodeValue&&(se.nodeValue=U))}}function q(se,U){var Q=r.getDocument(),j=se.lastChild,J;j&&j.nodeType===3?(j.nodeValue=j.nodeValue+U,J=j):(J=Q.createTextNode(U),se.appendChild(J)),W(J),w(J),m(se)}function b(se,U){var Q=r.getDocument(),j=Q.createElement("span");j.className=u.trackChangesInsertClass;var J=u.currentUser,Y="tc-"+Date.now()+"-"+Math.floor(Math.random()*1e4);j.setAttribute("data-tc-id",Y),j.setAttribute("data-tc-author",J.id),j.setAttribute("data-tc-at",new Date().toISOString()),j.style.color=J.color,j.style.textDecoration="underline",j.appendChild(Q.createTextNode(se)),U.insertNode(j),W(j.firstChild),w(j.firstChild),r.reviewLedger.add({id:Y,changeType:"insert",author:J,text:se,status:"pending",sourceLabel:"Suggested insert",createdAt:Date.now()})}function m(se){var U=se.getAttribute("data-tc-id");U&&r.reviewLedger.update(U,{text:se.textContent})}function k(se){var U=r.getSelection();if(!(!U||U.rangeCount===0)){var Q=U.getRangeAt(0);if(!Q.collapsed){h(Q);return}var j=r.getDocument().createRange();if(se==="deleteContentBackward"){var J=R(Q.startContainer,Q.startOffset);if(!J)return;j.setStart(J.node,J.offset),j.setEnd(J.node,J.offset+1)}else{var Y=l(Q.startContainer,Q.startOffset);if(!Y)return;j.setStart(Y.node,Y.offset-1),j.setEnd(Y.node,Y.offset)}if(g(j)){j.deleteContents();var te=r.getSelection();te.removeAllRanges(),te.addRange(j),d();return}h(j)}}function M(se){for(var U=se.nodeType===1?se:se.parentNode;U&&U!==r.getEditable();){if(U.classList&&U.classList.contains("rte-tc-delete"))return!0;U=U.parentNode}return!1}function I(){for(var se=r.getEditable(),U=r.getDocument().createTreeWalker(se,NodeFilter.SHOW_TEXT,{acceptNode:function(J){return M(J)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),Q=[],j;j=U.nextNode();)Q.push(j);return Q}function R(se,U){var Q=I();if(!Q.length)return null;var j=f(se,U,Q);return j<=0?null:_(j-1,Q)}function l(se,U){var Q=I();if(!Q.length)return null;for(var j=0,J=0;J<Q.length;J++)j+=Q[J].nodeValue.length;var Y=f(se,U,Q);return Y>=j?null:_(Y+1,Q)}function f(se,U,Q){var j=r.getDocument().createRange();j.setStart(se,U),j.collapse(!0);for(var J=0,Y=0;Y<Q.length;Y++){var te=Q[Y],le=j.comparePoint(te,te.nodeValue.length);if(le<=0){J+=te.nodeValue.length;continue}var pe=j.comparePoint(te,0);if(pe>=0)break;for(var ye=0,me=te.nodeValue.length;ye<me;){var ee=ye+me>>1;j.comparePoint(te,ee)<0?ye=ee+1:me=ee}J+=ye;break}return J}function _(se,U){for(var Q=se,j=0;j<U.length;j++){if(Q<=U[j].nodeValue.length)return{node:U[j],offset:Q};Q-=U[j].nodeValue.length}return null}function v(se){if(!se)return null;if(se.nodeType===3)return se;var U=r.getDocument().createTreeWalker(se,NodeFilter.SHOW_TEXT);return U.nextNode()}function s(se){if(!se)return null;if(se.nodeType===3)return se;for(var U=r.getDocument().createTreeWalker(se,NodeFilter.SHOW_TEXT),Q=null,j;j=U.nextNode();)Q=j;return Q}function c(se){for(var U=r.getEditable(),Q=r.getDocument().createTreeWalker(U,NodeFilter.SHOW_TEXT),j=null,J;J=Q.nextNode();){if(J===se)return j;j=J}return null}function p(se){for(var U=r.getEditable(),Q=r.getDocument().createTreeWalker(U,NodeFilter.SHOW_TEXT),j=!1,J;J=Q.nextNode();){if(j)return J;J===se&&(j=!0)}return null}function g(se){for(var U=se.startContainer.parentNode;U&&U!==r.getEditable();){if(K(U))return se.endContainer.parentNode===U||U.contains(se.endContainer);U=U.parentNode}return!1}function h(se){if(se.collapsed)return!1;var U=r.getDocument(),Q=se.cloneContents();if(!y(Q))return!1;var j=u.currentUser,J=L(se,"before",j),Y=L(se,"after",j);if(se.deleteContents(),J){if(A(J,Q),Y&&Y!==J){for(;Y.firstChild;)J.appendChild(Y.firstChild);var te=Y.getAttribute("data-tc-id");Y.remove(),te&&r.reviewLedger&&r.reviewLedger.remove(te)}var le=U.createRange();le.setStartAfter(J),le.collapse(!0);var pe=r.getSelection();pe.removeAllRanges(),pe.addRange(le);var ye=J.getAttribute("data-tc-id");return ye&&r.reviewLedger&&r.reviewLedger.update(ye,{text:J.textContent}),!0}if(Y){C(Y,Q);var me=U.createRange();me.setStartBefore(Y),me.collapse(!0);var ee=r.getSelection();ee.removeAllRanges(),ee.addRange(me);var ue=Y.getAttribute("data-tc-id");return ue&&r.reviewLedger&&r.reviewLedger.update(ue,{text:Y.textContent}),!0}var ce=U.createElement("span");ce.className=u.trackChangesDeleteClass;var ve="tc-"+Date.now()+"-"+Math.floor(Math.random()*1e4);ce.setAttribute("data-tc-id",ve),ce.setAttribute("data-tc-author",j.id),ce.setAttribute("data-tc-at",new Date().toISOString()),ce.style.color=j.color,ce.style.textDecoration="line-through",ce.appendChild(Q),se.insertNode(ce);var be=U.createRange();be.setStartAfter(ce),be.collapse(!0);var ke=r.getSelection();return ke.removeAllRanges(),ke.addRange(be),r.reviewLedger.add({id:ve,changeType:"delete",author:j,text:ce.textContent,originalHtml:ce.innerHTML,status:"pending",sourceLabel:"Suggested delete",createdAt:Date.now()}),!0}function L(se,U,Q){var j=U==="before"?se.startContainer:se.endContainer,J=U==="before"?se.startOffset:se.endOffset;if(j.nodeType===3){if(U==="before"&&J===0){var Y=j.previousSibling;if(Y&&E(Y,Q))return Y}if(U==="after"&&J===j.nodeValue.length){var te=j.nextSibling;if(te&&E(te,Q))return te}return null}if(U==="before"&&J>0){var le=j.childNodes[J-1];if(le&&E(le,Q))return le}if(U==="after"&&J<j.childNodes.length){var pe=j.childNodes[J];if(pe&&E(pe,Q))return pe}return null}function E(se,U){return!se||se.nodeType!==1||!se.classList||!se.classList.contains("rte-tc-delete")?!1:se.getAttribute("data-tc-author")===U.id}function A(se,U){for(;U.firstChild;)se.appendChild(U.firstChild)}function C(se,U){for(var Q=se.firstChild;U.firstChild;)se.insertBefore(U.firstChild,Q)}function y(se){var U=(se.textContent||"").replace(/\s+/g,"");return!!U}function d(){for(var se=r.getEditable().querySelectorAll(".rte-tc-insert"),U=0;U<se.length;U++){var Q=se[U];if(!Q.textContent||!Q.textContent.length){var j=Q.getAttribute("data-tc-id");j&&r.reviewLedger&&r.reviewLedger.remove(j),Q.remove()}else m(Q)}}function w(se){if(se){var U=r.getDocument(),Q=U.createRange();se.nodeType===3?Q.setStart(se,se.nodeValue.length):Q.setStart(se,se.childNodes.length),Q.collapse(!0);var j=r.getSelection();j.removeAllRanges(),j.addRange(Q)}}function D(){return u.currentUser||{id:"user",name:"User",color:"#2563eb"}}function P(se,U){if(typeof u.reviewCanDecide!="function")return!0;var Q=!1,j=D();try{Q=u.reviewCanDecide(se,U,j,r)!==!1}catch(Y){console.warn("trackedchanges: reviewCanDecide threw; denying decision.",Y)}if(Q)return!0;var J={entry:se,action:U,user:j};try{typeof u.onReviewDecisionDenied=="function"&&u.onReviewDecisionDenied(J)}catch{}try{typeof r.fireEvent=="function"&&r.fireEvent("review_decision_denied",J)}catch{}return!1}function B(se){var U=r.reviewLedger.get(se);if(!U||!P(U,"accept"))return!1;var Q=r.getEditable().querySelector('[data-tc-id="'+ae(se)+'"]');return U.changeType==="insert"?Q&&ie(Q):U.changeType==="delete"&&Q&&Q.remove(),r.reviewLedger.update(se,{status:"accepted",decidedAt:Date.now(),decidedBy:D()}),!0}function Z(se){var U=r.reviewLedger.get(se);if(!U||!P(U,"reject"))return!1;var Q=r.getEditable().querySelector('[data-tc-id="'+ae(se)+'"]');return U.changeType==="insert"?Q&&Q.remove():U.changeType==="delete"&&Q&&ie(Q),r.reviewLedger.update(se,{status:"rejected",decidedAt:Date.now(),decidedBy:D()}),!0}function fe(se){for(var U=r.reviewLedger.list(se).filter(function(J){return(J.changeType==="insert"||J.changeType==="delete")&&J.status==="pending"}),Q=0,j=0;j<U.length;j++)B(U[j].id)&&Q++;return Q}function re(se){for(var U=r.reviewLedger.list(se).filter(function(J){return(J.changeType==="insert"||J.changeType==="delete")&&J.status==="pending"}),Q=0,j=0;j<U.length;j++)Z(U[j].id)&&Q++;return Q}function ie(se){var U=se.parentNode;if(U){for(;se.firstChild;)U.insertBefore(se.firstChild,se);U.removeChild(se)}}function ae(se){var U=String(se);if(typeof CSS<"u"&&typeof CSS.escape=="function")try{return CSS.escape(U)}catch{}return U.replace(/["\\\]\[\(\)\{\}'#:;,<>=`~!@$%^&*+/?\s\x00-\x1F]/g,function(Q){return"\\"+Q})}function de(){var se=r&&r.iframe&&r.iframe.ownerDocument||document;if(!se.querySelector("style[data-rte-trackchanges]")){var U=se.createElement("style");U.setAttribute("data-rte-trackchanges","1"),U.textContent=[".richtexteditor rte-toolbar-button.rte_command_trackchanges{position:relative;border-radius:8px;transition:background .14s ease,color .14s ease,box-shadow .14s ease}",".richtexteditor rte-toolbar-button.rte_command_trackchanges.rte-ui-active{background:linear-gradient(135deg,#e9f7ef,#eef5ff);color:#17633f;box-shadow:inset 0 0 0 1px rgba(34,132,82,.28),0 6px 14px rgba(34,132,82,.12)}",".richtexteditor rte-toolbar-button.rte_command_trackchanges.rte-ui-active:after{content:'';position:absolute;right:5px;top:5px;width:6px;height:6px;border-radius:50%;background:#22a66a;box-shadow:0 0 0 2px #fff}",".rte-tc{border-radius:4px;padding:0 2px;box-decoration-break:clone;-webkit-box-decoration-break:clone}",".rte-tc-insert{background:linear-gradient(180deg,rgba(232,248,239,.78),rgba(232,248,239,.38));color:#125b39;text-decoration:underline;text-decoration-color:#22a66a;text-decoration-thickness:2px;text-underline-offset:3px}",".rte-tc-delete{background:linear-gradient(180deg,rgba(255,240,240,.82),rgba(255,240,240,.42));color:#9f1d1d;text-decoration:line-through;text-decoration-color:#dc4c4c;text-decoration-thickness:2px;opacity:.92}"].join(`
75
75
  `),se.head.appendChild(U),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(se,U,"rte-trackedchanges-style",U.textContent)}var Q=r.getDocument();if(Q&&Q.head&&!Q.querySelector("style[data-rte-trackchanges-inline]")){var j=Q.createElement("style");j.setAttribute("data-rte-trackchanges-inline","1"),j.textContent=[".rte-tc{border-radius:4px;padding:0 2px;box-decoration-break:clone;-webkit-box-decoration-break:clone}",".rte-tc-insert{background:linear-gradient(180deg,rgba(232,248,239,.78),rgba(232,248,239,.38));color:#125b39;text-decoration:underline;text-decoration-color:#22a66a;text-decoration-thickness:2px;text-underline-offset:3px}",".rte-tc-delete{background:linear-gradient(180deg,rgba(255,240,240,.82),rgba(255,240,240,.42));color:#9f1d1d;text-decoration:line-through;text-decoration-color:#dc4c4c;text-decoration-thickness:2px;opacity:.92}"].join(`
76
76
  `),Q.head.appendChild(j),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(Q,j,"rte-trackedchanges-iStyle",j.textContent)}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_typewriter=RTE_Plugin_Typewriter,typeof RTE_DefaultConfig.typewriterModeEnabled>"u"&&(RTE_DefaultConfig.typewriterModeEnabled=!1),typeof RTE_DefaultConfig.focusModeEnabled>"u"&&(RTE_DefaultConfig.focusModeEnabled=!1),typeof RTE_DefaultConfig.typewriterAnchor>"u"&&(RTE_DefaultConfig.typewriterAnchor=.5);function RTE_Plugin_Typewriter(){var N=this,u,r,x=!1,H=!1,F=null,$=!1,z=0;N.PluginName="Typewriter",N.InitConfig=function(l){u=l,x=!!u.typewriterModeEnabled,H=!!u.focusModeEnabled},N.InitEditor=function(l){r=l,o();try{r.attachEvent("ready",o)}catch{}try{r.attachEvent("aftersethtml",o)}catch{}setTimeout(o,0),setTimeout(o,200),r.setTypewriterMode=function(f){return x=!!f,k(),x},r.setFocusMode=function(f){return H=!!f,k(),H},r.toggleTypewriterMode=function(){return x=!x,k(),x},r.toggleFocusMode=function(){return H=!H,k(),H},r.isTypewriterMode=function(){return x},r.isFocusMode=function(){return H}};function o(){var l=r.getDocument();l&&(M(l),l!==F&&(l.addEventListener("keyup",W,!0),l.addEventListener("mouseup",W,!0),l.addEventListener("input",W,!0),F=l)),R(),k()}function O(l){return l&&l.nodeType===1&&/^(P|H[1-6]|LI|BLOCKQUOTE|PRE|DIV|TD|TH|FIGCAPTION)$/.test(l.nodeName)}function V(){try{var l=r.getSelection();if(!l||l.rangeCount===0)return null;var f=r.getEditable(),_=l.getRangeAt(0).startContainer;_&&_.nodeType===3&&(_=_.parentNode);for(var v=null;_&&_!==f;)O(_)&&(v=_),_=_.parentNode;return v}catch{return null}}function K(){try{var l=r.getSelection();if(!l||l.rangeCount===0)return null;var f=l.getRangeAt(0).cloneRange(),_=f.getBoundingClientRect();if(_&&(_.top||_.bottom||_.height))return _;var v=V();return v?v.getBoundingClientRect():null}catch{return null}}function W(){if(!(!x&&!H)&&!z){var l=typeof requestAnimationFrame=="function"?requestAnimationFrame:function(f){return setTimeout(f,16)};z=l(function(){z=0,H&&q(),x&&b()})}}function q(){var l=r.getEditable();if(l){for(var f=l.querySelectorAll(".rte-focus-current"),_=0;_<f.length;_++)f[_].classList.remove("rte-focus-current");var v=V();v&&v.classList.add("rte-focus-current")}}function b(){var l=r.getDocument();if(l){var f=K();if(f){var _=l.defaultView||l.parentWindow;if(_){var v=_.innerHeight||l.documentElement.clientHeight;if(v){var s=v*m(u.typewriterAnchor,.15,.85),c=f.top+f.height/2,p=c-s;if(!(Math.abs(p)<2)){var g=l.scrollingElement||l.documentElement||l.body;if(g&&g.scrollHeight-g.clientHeight<=4){var h=r.getEditable();h&&h.scrollHeight-h.clientHeight>4&&(g=h)}g&&(g.scrollTop+=p)}}}}}}function m(l,f,_){return l=typeof l=="number"&&!isNaN(l)?l:.5,l<f?f:l>_?_:l}function k(){var l=r.getEditable();if(l){if(H)l.classList.add("rte-focus-active"),q();else{l.classList.remove("rte-focus-active");for(var f=l.querySelectorAll(".rte-focus-current"),_=0;_<f.length;_++)f[_].classList.remove("rte-focus-current")}x?(l.classList.add("rte-typewriter-active"),b()):l.classList.remove("rte-typewriter-active")}}function M(l){if(!(!l||l.getElementById("rte-typewriter-styles"))){var f=".rte-focus-active p,.rte-focus-active h1,.rte-focus-active h2,.rte-focus-active h3,.rte-focus-active h4,.rte-focus-active h5,.rte-focus-active h6,.rte-focus-active li,.rte-focus-active blockquote,.rte-focus-active pre,.rte-focus-active figcaption{opacity:.28;transition:opacity .18s ease;}.rte-focus-active .rte-focus-current,.rte-focus-active .rte-focus-current *{opacity:1 !important;}.rte-typewriter-active{padding-bottom:45vh !important;}@media (prefers-reduced-motion: reduce){.rte-focus-active p,.rte-focus-active h1,.rte-focus-active h2,.rte-focus-active h3,.rte-focus-active h4,.rte-focus-active h5,.rte-focus-active h6,.rte-focus-active li,.rte-focus-active blockquote,.rte-focus-active pre,.rte-focus-active figcaption{transition:none !important;}}",_=l.createElement("style");_.id="rte-typewriter-styles",_.appendChild(l.createTextNode(f)),(l.head||l.getElementsByTagName("head")[0]||l.documentElement).appendChild(_),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(l,_,"rte-typewriter-styles",_.textContent)}}function I(){var l=r.getEditable();if(!l)return function(){};for(var f=l.querySelectorAll(".rte-focus-current"),_=0;_<f.length;_++)f[_].classList.remove("rte-focus-current");return function(){for(var s=0;s<f.length;s++)f[s].classList.add("rte-focus-current")}}function R(){if(!$){for(var l=["getHTMLCode","getJSON","getHTMLContent"],f=!1,_=0;_<l.length;_++)(function(v){var s=r[v];if(!(typeof s!="function"||s.__rteTwWrapped)){var c=function(){var p=I();try{return s.apply(r,arguments)}finally{p()}};c.__rteTwWrapped=!0,r[v]=c,f=!0}})(l[_]);f&&($=!0)}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_watermark=RTE_Plugin_Watermark,typeof RTE_DefaultConfig.watermarkText>"u"&&(RTE_DefaultConfig.watermarkText="DRAFT"),typeof RTE_DefaultConfig.watermarkColor>"u"&&(RTE_DefaultConfig.watermarkColor="#94a3b8"),typeof RTE_DefaultConfig.watermarkOpacity>"u"&&(RTE_DefaultConfig.watermarkOpacity=.18),typeof RTE_DefaultConfig.watermarkAngle>"u"&&(RTE_DefaultConfig.watermarkAngle=-30),typeof RTE_DefaultConfig.watermarkFontSize>"u"&&(RTE_DefaultConfig.watermarkFontSize=48),typeof RTE_DefaultConfig.watermarkMode>"u"&&(RTE_DefaultConfig.watermarkMode="tile"),typeof RTE_DefaultConfig.watermarkPrint>"u"&&(RTE_DefaultConfig.watermarkPrint=!1),typeof RTE_DefaultConfig.watermarkImage>"u"&&(RTE_DefaultConfig.watermarkImage=null);function RTE_Plugin_Watermark(){var N=this,u,r,x=null,H=!1,F=!1;N.PluginName="Watermark",N.InitConfig=function(m){u=m},N.InitEditor=function(m){r=m,r.attachEvent("exec_command_watermark",function(k){k.returnValue=!0,N.Toggle()}),$();try{r.attachEvent("ready",$)}catch{}try{r.attachEvent("aftersethtml",$)}catch{}setTimeout($,0),r.setWatermark=function(k){return H=!!k,K(),H},r.toggleWatermark=function(){return H=!H,K(),H},r.isWatermark=function(){return H},r.setWatermarkOptions=function(k){if(k&&typeof k=="object"){var M=["watermarkText","watermarkColor","watermarkOpacity","watermarkAngle","watermarkFontSize","watermarkMode","watermarkPrint","watermarkImage"],I={text:0,color:1,opacity:2,angle:3,fontSize:4,mode:5,print:6,image:7};for(var R in k)k.hasOwnProperty(R)&&(I[R]!==void 0?u[M[I[R]]]=k[R]:M.indexOf(R)>=0&&(u[R]=k[R]))}return K(),N.Options()},r.getWatermarkOptions=function(){return N.Options()}},N.Options=function(){return{text:u.watermarkText,color:u.watermarkColor,opacity:u.watermarkOpacity,angle:u.watermarkAngle,fontSize:u.watermarkFontSize,mode:u.watermarkMode,print:u.watermarkPrint,image:u.watermarkImage}};function $(){var m=z();m&&(q(),m!==x&&(x=m),H&&K())}function z(){try{return r.getDocument()}catch{return null}}function o(){try{return r.getEditable()}catch{return null}}function O(m){return String(m??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function V(){if(u.watermarkImage)return String(u.watermarkImage);var m=String(u.watermarkText==null?"":u.watermarkText);if(!m)return null;var k=parseInt(u.watermarkFontSize,10)||48,M=parseFloat(u.watermarkAngle);isNaN(M)&&(M=-30);var I=Math.max(240,m.length*k*.72),R=Math.max(160,k*3.2),l='<svg xmlns="http://www.w3.org/2000/svg" width="'+Math.round(I)+'" height="'+Math.round(R)+'"><text x="50%" y="50%" text-anchor="middle" dominant-baseline="middle" transform="rotate('+M+" "+Math.round(I/2)+" "+Math.round(R/2)+')" font-family="Segoe UI, Arial, sans-serif" font-size="'+k+'" font-weight="700" fill="'+O(u.watermarkColor||"#94a3b8")+'">'+O(m)+"</text></svg>";return"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(l)}function K(){var m=o(),k=z();if(!(!m||!k)){if(b(k),!H){m.style.backgroundImage="",m.style.backgroundRepeat="",m.style.backgroundPosition="",m.removeAttribute("data-rte-watermark");return}var M=V();if(M){var I=String(u.watermarkMode)==="single";m.setAttribute("data-rte-watermark","true"),m.style.backgroundImage='url("'+M+'")',m.style.backgroundRepeat=I?"no-repeat":"repeat",m.style.backgroundPosition=I?"center center":"0 0";var R=parseFloat(u.watermarkOpacity);m.style.opacity="";var l=k.getElementById("rte-watermark-dynamic");l||(l=k.createElement("style"),l.id="rte-watermark-dynamic",(k.head||k.documentElement).appendChild(l)),l.textContent="[data-rte-watermark]{background-blend-mode:multiply;}[data-rte-watermark]::before{content:'';position:absolute;inset:0;pointer-events:none;background-image:inherit;background-repeat:inherit;background-position:inherit;opacity:"+(isNaN(R)?.18:R)+";z-index:0;}"+(u.watermarkPrint?"":"@media print{[data-rte-watermark]{background-image:none !important;}[data-rte-watermark]::before{display:none !important;}}"),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(k,l,"rte-watermark-dynamic",l.textContent)}}}function W(){var m=o();if(!m||!H)return function(){};var k=m.style.backgroundImage,M=m.style.backgroundRepeat,I=m.style.backgroundPosition,R=m.getAttribute("data-rte-watermark");return m.style.backgroundImage="",m.style.backgroundRepeat="",m.style.backgroundPosition="",m.removeAttribute("data-rte-watermark"),function(){m.style.backgroundImage=k,m.style.backgroundRepeat=M,m.style.backgroundPosition=I,R&&m.setAttribute("data-rte-watermark",R)}}function q(){if(!F){for(var m=["getHTMLCode","getJSON","getHTMLContent","getText"],k=!1,M=0;M<m.length;M++)(function(I){var R=r[I];if(!(typeof R!="function"||R.__rteWmWrapped)){var l=function(){var f=W();try{return R.apply(r,arguments)}finally{f()}};l.__rteWmWrapped=!0,r[I]=l,k=!0}})(m[M]);k&&(F=!0)}}function b(m){if(!(!m||m.getElementById("rte-watermark-styles"))){var k=m.createElement("style");k.id="rte-watermark-styles",k.appendChild(m.createTextNode("[data-rte-watermark]{position:relative;}")),(m.head||m.getElementsByTagName("head")[0]||m.documentElement).appendChild(k),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(m,k,"rte-watermark-styles",k.textContent)}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_wordexport=RTE_Plugin_WordExport,typeof RTE_DefaultConfig.wordExport>"u"&&(RTE_DefaultConfig.wordExport=!0);function RTE_Plugin_WordExport(){var N=this,u,r;N.PluginName="WordExport",N.InitConfig=function(K){u=K},N.InitEditor=function(K){if(r=K,u.wordExport!==!1&&(r.getWordDocument=function(W){return $(W||{})},r.exportToWord=function(W,q){var b=$(q||{}),m=O(W)||O(u.wordExportFileName)||o();return V(b,m+".doc")},r.downloadWord=r.exportToWord,r.attachEvent("exec_command_exportword",function(W){W.returnValue=!0,W.stopBubble=!0;try{r.exportToWord()}catch(q){window.console&&console.error("wordexport:",q)}}),r.slashCommands&&typeof r.slashCommands.register=="function"))try{r.slashCommands.register({id:"export-word",title:"Export to Word (legacy .doc)",description:"HTML wrapped for Word \u2014 use Export to Word (.docx) for a real OOXML file",keywords:["word","doc","legacy","html","export","download"],run:function(){r.exportToWord()}})}catch{}};function x(K){return String(K??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function H(){if(r&&typeof r.getHTMLCode=="function"){var K=r.getHTMLCode();if(K!=null)return K}var W=r&&r.getEditable?r.getEditable():null;return W?W.innerHTML:""}function F(){try{if(!r||typeof r.getDocumentPageSetup!="function")return null;var K=r.getDocumentPageSetup();if(!K||typeof K!="object")return null;var W={};K.width&&K.height&&(W.pageSize=K.width+" "+K.height),K.orientation&&(W.landscape=String(K.orientation).toLowerCase()==="landscape");var q=K.margins;return q&&typeof q=="object"&&q.top&&q.right&&q.bottom&&q.left&&(W.margin=q.top+" "+q.right+" "+q.bottom+" "+q.left),W}catch{return null}}function $(K){var W=F()||{},q=K.fontFamily||u.wordExportFontFamily||"Calibri, 'Segoe UI', Arial, sans-serif",b=K.fontSize||u.wordExportFontSize||"11pt",m=K.pageSize||W.pageSize||u.wordExportPageSize||"8.5in 11in",k=K.margin||W.margin||u.wordExportMargin||"1in",M=typeof K.landscape<"u"?K.landscape:typeof W.landscape<"u"?W.landscape:u.wordExportLandscape,I=x(K.title||z()||"Document"),R="Print",l=M?"landscape":"portrait";return`<!DOCTYPE html>\r