tinymce.PluginManager.add("mathjax",function(t,e){let n=t.settings.mathjax.className||"math-tex",a=n+"-original",i=t.settings.mathjax.symbols||{start:"\\(",end:"\\)"},l=t.settings.mathjax.lib||null,o=[(t.settings.mathjax.configUrl||e+"/config.js")+"?class="+a];l&&o.push(l),t.on("init",function(){let e=t.getDoc().getElementsByTagName("script");for(let n=0;n=(i.start+i.end).length&&(s=latex_attribute.substr(i.start.length,latex_attribute.length-(i.start+i.end).length))),t.windowManager.open({title:"Mathjax",width:600,height:300,body:{type:"panel",items:[{type:"textarea",name:"title",label:"LaTex"},{type:"htmlpanel",html:'
LaTex
'},{type:"htmlpanel",html:''}]},buttons:[{type:"submit",text:"OK"}],onSubmit:function(a){let i=a.getData().title.trim();if(e)e.innerHTML="",e.setAttribute("data-latex",h(i)),r(e);else{let e=t.getDoc().createElement("span");e.innerHTML=h(i),e.classList.add(n),r(e),t.insertContent(e.outerHTML)}t.getDoc().defaultView.MathJax.startup.getComponents(),t.getDoc().defaultView.MathJax.typeset(),a.close()},onChange:function(t){var e=t.getData().title.trim();e!=s&&(p(e,document.getElementById(l)),s=e)},initialData:{title:s}});let d=document.getElementById(l),c=d.contentWindow||d.contentDocument.document||d.contentDocument,u=c.document,g=u.getElementsByTagName("head")[0],m=u.getElementsByTagName("body")[0],h=function(t,e){return e||(e=i),e.start+" "+t+" "+e.end},p=function(t){let e=c.MathJax,n=m.querySelector("div");n||((n=u.createElement("div")).classList.add(a),m.appendChild(n)),n.innerHTML=h(t,{start:"$$",end:"$$"}),e&&e.startup&&(e.startup.getComponents(),e.typeset())};p(s);for(let t=0;t