").append(t.clone()).html(),!0),i.ungroupSelectedElement(),i.moveSelectedElements(c,h,!0)}))},a=e.$,n=t,x.next=5,import("./locale/".concat(n.curPrefs.lang,".js"));case 5:return o=x.sent,r=o.default,i=n.canvas,"mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js",l=n.uiStrings,m=!1,a.extend(l,{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"}}),u=[{id:"tool_mathjax",type:"mode",icon:"mathjax.png",events:{click:function click(){return _asyncToGenerator(regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(i.setMode("mathjax"),!1!==m){e.next=17;break}return a('
\x3c!-- Here is where MathJax creates the math --\x3e
$${}$$
').insertAfter("#svg_prefs").hide(),a("#mathjax_container").draggable({cancel:"button,fieldset",containment:"window"}),a("#tool_mathjax_cancel").prepend(a.getSvgIcon("cancel",!0)).on("click touched",(function(){a("#mathjax").hide()})),a("#tool_mathjax_save").prepend(a.getSvgIcon("ok",!0)).on("click touched",(function(){d(),a("#mathjax").hide()})),a("body").addClass("tex2jax_ignore"),e.prev=7,e.next=10,import("mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js");case 10:MathJax.Hub.queue.Push((function(){s=MathJax.Hub.getAllJax("#mathjax_creator")[0],console.log(s),m=!0,console.log("MathJax Loaded")})),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(7),console.log("Failed loading MathJax."),a.alert("Failed loading MathJax. You will not be able to change the mathematics.");case 17:case"end":return e.stop()}}),_callee,null,[[7,13]])})))()}}}],x.abrupt("return",{name:r.name,svgicons:"mathjax-icons.xml",buttons:r.buttons.map((function(e,t){return Object.assign(u[t],e)})),mouseDown:function mouseDown(){if("mathjax"===i.getMode())return{started:!0}},mouseUp:function mouseUp(e){if("mathjax"===i.getMode()){var t=i.getZoom();return c=e.mouse_x/t,h=e.mouse_y/t,a("#mathjax").show(),{started:!1}}},callback:function callback(){a("