functione(t){return(e="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(e){returntypeofe}:function(e){returne&&"function"==typeofSymbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeofe})(t)}functiont(e,t,n,r,a,i,o){try{vars=e[i](o),l=s.value}catch(e){returnvoidn(e)}s.done?t(l):Promise.resolve(l).then(r,a)}functionn(e){returnfunction(){varn=this,r=arguments;returnnewPromise((function(a,i){varo=e.apply(n,r);functions(e){t(o,a,i,s,l,"next",e)}functionl(e){t(o,a,i,s,l,"throw",e)}s(void0)}))}}functionr(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}functiona(e,t){for(varn=0;n<t.length;n++){varr=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}functioni(e,t,n){returnt&&a(e.prototype,t),n&&a(e,n),e}functiono(){return(o=Object.assign||function(e){for(vart=1;t<arguments.length;t++){varn=arguments[t];for(varrinn)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}returne}).apply(this,arguments)}functions(e,t){if("function"!=typeoft&&null!==t)thrownewTypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}functionl(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){returne.__proto__||Object.getPrototypeOf(e)})(e)}functionc(e,t){return(c=Object.setPrototypeOf||function(e,t){returne.__proto__=t,e})(e,t)}functionu(e,t){return!t||"object"!=typeoft&&"function"!=typeoft?function(e){if(void0===e)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returne}(e):t}functiond(e,t){returnfunction(e){if(Array.isArray(e))returne}(e)||function(e,t){if(!(Symbol.iteratorinObject(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;varn=[],r=!0,a=!1,i=void0;try{for(varo,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(a)throwi}}returnn}(e,t)||function(){thrownewTypeError("Invalid attempt to destructure non-iterable instance")}()}functionh(e){returnfunction(e){if(Array.isArray(e)){for(vart=0,n=newArray(e.length);t<e.length;t++)n[t]=e[t];returnn}}(e)||function(e){if(Symbol.iteratorinObject(e)||"[object Arguments]"===Object.prototype.toString.call(e))returnArray.from(e)}(e)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance")}()}functionf(e){vart=e.changedTouches,n=t[0],r="";switch(e.type){case"touchstart":r="mousedown";break;case"touchmove":r="mousemove";break;case"touchend":r="mouseup";break;default:return}vara=n.screenX,i=n.screenY,o=n.clientX,s=n.clientY,l=newMouseEvent(r,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:a,screenY:i,clientX:o,clientY:s,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});t.length<2&&(n.target.dispatchEvent(l),e.preventDefault())}document.addEventListener("touchstart",f,!0),document.addEventListener("touchmove",f,!0),document.addEventListener("touchend",f,!0),document.addEventListener("touchcancel",f,!0);
functionq(t){varn=t.fn.attr;returnt.fn.attr=function(t,r){vara=this.length;if(!a)returnn.call(this,t,r);for(vari=0;i<a;++i){varo=this[i];if("http://www.w3.org/2000/svg"!==o.namespaceURI)returnn.call(this,t,r);if(void0!==r)o.setAttribute(t,r);elseif(Array.isArray(t)){for(vars={},l=t.length;l--;){varc=t[l],u=o.getAttribute(c);(u||"0"===u)&&(u=isNaN(u)?u:u-0),s[c]=u}returns}if("object"!==e(t)){varh=o.getAttribute(t);return(h||"0"===h)&&(h=isNaN(h)?h:h-0),h}for(varf=0,p=Object.entries(t);f<p.length;f++){varg=d(p[f],2),m=g[0],v=g[1];o.setAttribute(m,v)}}returnthis},t}varY=document.createElementNS(p.SVG,"svg");functionW(e){vart=e.matrix,n="";switch(e.type){case1:n="matrix("+[t.a,t.b,t.c,t.d,t.e,t.f].join(",")+")";break;case2:n="translate("+t.e+","+t.f+")";break;case3:n=t.a===t.d?"scale("+t.a+")":"scale("+t.a+","+t.d+")";break;case4:varr=0,a=0;if(0!==e.angle){vari=1-t.a;a=(i*t.f+t.b*t.e)/(i*i+t.b*t.b),r=(t.e-t.b*a)/i}n="rotate("+e.angle+" "+r+","+a+")"}returnn}varX,Q={},K=function(){functione(t){r(this,e),this._elem=t||null,this._xforms=[],this._update=function(){for(vare="",t=0;t<this.numberOfItems;++t){e+=W(this._list.getItem(t))+" "}this._elem.setAttribute("transform",e)},this._list=this,this._init=function(){vare=this,t=this._elem.getAttribute("transform");if(t)for(varn=/\s*((scale|matrix|rotate|translate)\s*\(.*?\))\s*,?\s*/,r=!0;r;)r=t.match(n),t=t.replace(n,""),r&&r[1]&&function(){vart=r[1].split(/\s*\(/),n=t[0],a=t[1].match(/\s*(.*?)\s*\)/);a[1]=a[1].replace(/(\d)-/g,"$1 -");vari=a[1].split(/[, ]+/),o="abcdef".split(""),s=Y.createSVGMatrix();Object.values(i).forEach((function(e,t){i[t]=parseFloat(e),"matrix"===n&&(s[o[t]]=i[t])}));varl=Y.createSVGTransform(),c="set"+n.charAt(0).toUpperCase()+n.slice(1),u="matrix"===n?[s]:i;"scale"===n&&1===u.length?u.push(u[0]):"translate"===n&&1===u.length?u.push(0):"rotate"===n&&1===u.length&&u.push(0,0),l[c].apply(l,h(u)),e._list.appendItem(l)}()},this._removeFromOtherLists=function(e){e&&Object.values(Q).some((function(t){for(varn=0,r=t._xforms.length;n<r;++n)if(t._xforms[n]===e)returnt.removeItem(n),!0;return!1}))},this.numberOfItems=0}returni(e,[{key:"clear",value:function(){this.numberOfItems=0,this._xforms=[]}},{key:"initialize",value:function(e){this.numberOfItems=1,this._removeFromOtherLists(e),this._xforms=[e]}},{key:"getItem",value:function(e){if(e<this.numberOfItems&&e>=0)returnthis._xforms[e];vart=newError("DOMException with code=INDEX_SIZE_ERR");throwt.code=1,t}},{key:"insertItemBefore",value:function(e,t){varn=null;if(t>=0)if(t<this.numberOfItems){this._removeFromOtherLists(e);varr,a=newArray(this.numberOfItems+1);for(r=0;r<t;++r)a[r]=this._xforms[r];a[r]=e;for(vari=r+1;r<this.numberOfItems;++i,++r)a[i]=this._xforms[r];this.numberOfItems++,this._xforms=a,n=e,this._list._update()}elsen=this._list.appendItem(e);returnn}},{key:"replaceItem",value:function(e,t){varn=null;returnt<this.numberOfItems&&t>=0&&(this._removeFromOtherLists(e),this._xforms[t]=e,n=e,this._list._update()),n}},{key:"removeItem",value:function(e){if(e<this.numberOfItems&&e>=0){vart,n=this._xforms[e],r=newArray(this.numberOfItems-1);for(t=0;t<e;++t)r[t]=this._xforms[t];for(vara=t;a<this.numberOfItems-1;++a,++t)r[a]=this._xforms[t+1];returnthis.numberOfItems--,this._xforms=r,this._list._update(),n}vari=newError("DOMException with code=INDEX_SIZE_ERR");throwi.code=1,i}},{key:"appendItem",value:function(e){returnthis._removeFromOtherLists(e),this._xforms.push(e),this.numberOfItems++,this._list._update(),e}}]),e}(),Z=function(e){e.id&&Q[e.id]&&deleteQ[e.id]},$=function(e){if(!O){vart=e.id||"temp",n=Q[t];returnn&&"temp"!==t||(Q[t]=newK(e),Q[t]._init(),n=Q[t]),n}returne.transform?e.transform.baseVal:e.gradientTransform?e.gradientTransform.baseVal:e.patternTransform?e.patternTransform.baseVal:null},J=["x","x1","cx","rx","width"],ee=["y","y1","cy","ry","height"],te=["r","radius"].concat(J,ee),ne={},re=function(){returnne},ae=functione(t){varn=X.getRoundDigits();returnisNaN(t)?Array.isArray(t)?e(t[0])+","+e(t[1]):parseFloat(t).toFixed(n)-0:Number(
functionbr(e,t){returnvoid0===t&&(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)}window.console||(window.console={log:function(e){},dir:function(e){}});varxr,wr,Sr=function(e){returnnull==e},kr=jQuery,Cr=function(e,t,n){varr=kr("#svg_editor").parent();Object.entries(t).forEach((function(t){vara=d(t,2),i=a[0],o=a[1];o||console.log(i),n&&(i="#"+i);vars=r.find(i);if(s.length){varl=s[0];switch(e){case"aria-label":l.setAttribute("aria-label",o);break;case"content":h(l.childNodes).some((function(e){return!(3!==e.nodeType||!e.textContent.trim())&&(e.textContent=o,!0)}));break;case"title":l.title=o}}elseconsole.log("Missing element for localization: "+i)}))},Ar=function(){vare=n(regeneratorRuntime.mark((functione(t){varn,r,a,i,o,s,l,c,u,h;returnregeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case0:returne.next=2,wr.addLangData(xr);case2:if(n=e.sent,kr.each(n,(function(e,n){n.data&&(t=kr.merge(t,n.data))})),t.tools){e.next=6;break}returne.abrupt("return",void0);case6:returna=(r=t).tools,i=r.properties,o=r.config,s=r.layers,l=r.common,c=r.ui,Cr("content",{curve_segments:i.curve_segments,fitToContent:a.fitToContent,fit_to_all:a.fit_to_all,fit_to_canvas:a.fit_to_canvas,fit_to_layer_content:a.fit_to_layer_content,fit_to_sel:a.fit_to_sel,icon_large:o.icon_large,icon_medium:o.icon_medium,icon_small:o.icon_small,icon_xlarge:o.icon_xlarge,image_opt_embed:o.image_opt_embed,image_opt_ref:o.image_opt_ref,includedImages:o.included_images,largest_object:a.largest_object,layersLabel:s.layers,page:a.page,relativeToLabel:a.relativeTo,selLayerLabel:s.move_elems_to,selectedPredefined:o.select_predefined,selected_objects:a.selected_objects,smallest_object:a.smallest_object,straight_segments:i.straight_segments,svginfo_bg_url:o.editor_img_url+":",svginfo_bg_note:o.editor_bg_note,svginfo_change_background:o.background,svginfo_dim:o.doc_dims,svginfo_editor_prefs:o.editor_prefs,svginfo_height:l.height,svginfo_icons:o.icon_size,svginfo_image_props:o.image_props,svginfo_lang:o.language,svginfo_title:o.doc_title,svginfo_width:l.width,tool_docprops_cancel:l.cancel,tool_docprops_save:l.ok,tool_source_cancel:l.cancel,tool_source_save:l.ok,tool_prefs_cancel:l.cancel,tool_prefs_save:l.ok,sidepanel_handle:s.layers.split("").join(" "),tool_clear:a.new_doc,tool_docprops:a.docprops,tool_export:a.export_img,tool_import:a.import_doc,tool_open:a.open_doc,tool_save:a.save_doc,svginfo_units_rulers:o.units_and_rulers,svginfo_rulers_onoff:o.show_rulers,svginfo_unit:o.base_unit,svginfo_grid_settings:o.grid,svginfo_snap_onoff:o.snapping_onoff,svginfo_snap_step:o.snapping_stepsize,svginfo_grid_color:o.grid_color},!0),u={},["cut","copy","paste","paste_in_place","delete","group","ungroup","move_front","move_up","move_down","move_back"].forEach((function(e){u['#cmenu_canvas a[href="#'+e+'"]']=a[e]})),["dupe","merge_down","merge_all"].forEach((function(e){u['#cmenu_layers a[href="#'+e+'"]']=s[e]})),u['#cmenu_layers a[href="#delete"]']=s.del,Cr("content",u),h={},Object.entries({tool_blur:i.blur,tool_position:a.align_to_page,tool_font_family:i.font_family,zoom_panel:c.zoom_level,stroke_linejoin:i.linejoin_miter,stroke_linecap:i.linecap_butt,tool_opacity:i.opacity}).forEach((function(e){vart=d(e,2),n=t[0],r=t[1];h["#"+n+" button"]=r})),Object.entries({group_opacity:i.opacity,zoom:c.zoom_level}).forEach((function(e){vart=d(e,2),n=t[0],r=t[1];h["#"+n]=r})),Cr("aria-label",h),Cr("title",{align_relative_to:a.align_relative_to,circle_cx:i.circle_cx,circle_cy:i.circle_cy,circle_r:i.circle_r,cornerRadiusLabel:i.corner_radius,ellipse_cx:i.ellipse_cx,ellipse_cy:i.ellipse_cy,ellipse_rx:i.ellipse_rx,ellipse_ry:i.ellipse_ry,fill_color:i.fill_color,font_family:i.font_family,idLabel:i.id,image_height:i.image_height,image_url:i.image_url,image_width:i.image_width,layer_delete:s.del,layer_down:s.move_down,layer_new:s.new,layer_rename:s.rename,layer_moreopts:l.more_opts,layer_up:s.move_up,line_x1:i.line_x1,line_x2:i.line_x2,line_y1:i.line_y1,line_y2:i.line_y2,linecap_butt:i.linecap_butt,linecap_round:i.linecap_round,linecap_square:i.linecap_square,linejo