jQuery;varBi=function(){vart=_asyncToGenerator(regeneratorRuntime.mark((function_callee2(t,e){varn;returnregeneratorRuntime.wrap((function_callee2$(r){for(;;)switch(r.prev=r.next){case0:returnr.prev=0,r.next=3,import("./extensions/ext-".concat(t,"/locale/").concat(e,".js"));case3:n=r.sent,r.next=12;break;case6:returnr.prev=6,r.t0=r.catch(0),console.error("Missing translation (".concat(e,") for extension ").concat(t," - using 'en'")),r.next=11,import("./extensions/ext-".concat(t,"/locale/en.js"));case11:n=r.sent;case12:returnr.abrupt("return",n.default);case13:case"end":returnr.stop()}}),_callee2,null,[[0,6]])})));returnfunctionloadExtensionTranslation(e,n){returnt.apply(this,arguments)}}(),qi={name:"mathjax",init:functioninit(t){vare=this;return_asyncToGenerator(regeneratorRuntime.mark((function_callee2(){varn,r,i,o,s,u,l,h,f,p,d;returnregeneratorRuntime.wrap((function_callee2$(m){for(;;)switch(m.prev=m.next){case0:returnp=function_saveMath(){vart=n("#mathjax_code_textarea").val();MathJax.Hub.queue.Push(["Text",u,"\\displaystyle{"+t+"}"]),MathJax.Hub.queue.Push((function(){vart=n(".MathJax_SVG"),e=n(t.html());e.find("use").each((function(){vart=n(this).attr("href")?n(this).attr("href").slice(1):n(this).attr("xlink:href").slice(1),e=n("#"+t).clone().removeAttr("id"),r=n(this).attr("x"),i=n(this).attr("y"),o=n(this).attr("transform");o&&(r||i)?e.attr("transform",o+" translate("+r+","+i+")"):o?e.attr("transform",o):(r||i)&&e.attr("transform","translate("+r+","+i+")"),n(this).replaceWith(e)})),e.removeAttr("style"),e.attr("xmlns","http://www.w3.org/2000/svg"),o.importSvgString(n("<div>").append(e.clone()).html(),!0),o.ungroupSelectedElement(),o.moveSelectedElements(l,h,!0)}))},n=t.$,r=e,m.next=5,Bi("mathjax",r.curPrefs.lang);case5:returni=m.sent,o=r.canvas,s=r.uiStrings,f=!1,n.extend(s,{mathjax:{embed_svg:"Save as mathematics",embed_mathml:"Save as figure",svg_save_warning:"The math will be transformed into a figure is manipulatable like everything else. You will not be able to manipulate the TeX-code anymore.",mathml_save_warning:"Advised. The math will be saved as a figure.",title:"Mathematics code editor"}}),d=[{id:"tool_mathjax",type:"mode",icon:"mathjax.png",events:{click:functionclick(){return_asyncToGenerator(regeneratorRuntime.mark((function_callee(){returnregeneratorRuntime.wrap((function_callee$(t){for(;;)switch(t.prev=t.next){case0:if(o.setMode("mathjax"),!1!==f){t.next=17;break}returnn('<div id="mathjax">\x3c!-- Here is where MathJax creates the math --\x3e<div id="mathjax_creator" class="tex2jax_process" style="display:none">$${}$$</div><div id="mathjax_overlay"></div><div id="mathjax_container"><div id="tool_mathjax_back" class="toolbar_button"><button id="tool_mathjax_save">OK</button><button id="tool_mathjax_cancel">Cancel</button></div><fieldset><legend id="mathjax_legend">Mathematics Editor</legend><label><span id="mathjax_explication">Please type your mathematics in <a href="https://en.wikipedia.org/wiki/Help:Displaying_a_formula" target="_blank">TeX</a> code.</span></label><textarea id="mathjax_code_textarea" spellcheck="false"></textarea></fieldset></div></div>').insertAfter("#svg_prefs").hide(),n("#mathjax_container").draggable({cancel:"button,fieldset",containment:"window"}),n("#tool_mathjax_cancel").prepend(n.getSvgIcon("cancel",!0)).on("click touched",(function(){n("#mathjax").hide()})),n("#tool_mathjax_save").prepend(n.getSvgIcon("ok",!0)).on("click touched",(function(){p(),n("#mathjax").hide()})),n("body").addClass("tex2jax_ignore"),t.prev=7,t.next=10,Promise.resolve().then((function(){returnjo}));case10:MathJax.Hub.queue.Push((function(){u=MathJax.Hub.getAllJax("#mathjax_creator")[0],console.log(u),f=!0,console.log("MathJax Loaded")})),t.next=17;break;case13:t.prev=13,t.t0=t.catch(7),console.log("Failed loading MathJax."),n.alert("Failed loading MathJax. You will not be able to change the mathematics.");case17:case"end":returnt.stop()}}),_callee,null,[[7,13]])})))()}}}],m.abrupt("return",{name:i.name,svgicons:"mathjax-icons.xml",buttons:i.buttons.map(