16 lines
110 KiB
JavaScript
16 lines
110 KiB
JavaScript
import{b as sr,c as nr,d as hr,e as or,f as ur,h as lr,i as fr,j as gr,k as cr,m as vr,g as Yt,n as dr,o as pr,p as mr,q as yr,s as br}from"./index-D4mISQVM.js";import{_ as it}from"./jspdf.es.min-B0xhe8Uc.js";import"./index-BbYcdrlh.js";sr();function xt(o,e,t,r,i,a,n){try{var s=o[a](n),h=s.value}catch(u){return void t(u)}s.done?e(h):Promise.resolve(h).then(r,i)}function ie(o){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=o.apply(e,t);function n(h){xt(a,r,i,n,s,"next",h)}function s(h){xt(a,r,i,n,s,"throw",h)}n(void 0)})}}nr();hr();or();ur();lr();function xr(o,e){if(it(o)!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var r=t.call(o,e);if(it(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function wr(o){var e=xr(o,"string");return it(e)=="symbol"?e:e+""}function ot(o,e,t){return(e=wr(e))in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}fr();gr();cr();var we={exports:{}},ve={exports:{}},Ar=ve.exports,wt;function Tr(){return wt||(wt=1,(function(){var o,e,t,r,i,a;typeof performance<"u"&&performance!==null&&performance.now?ve.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(ve.exports=function(){return(o()-i)/1e6},e=process.hrtime,o=function(){var n;return n=e(),n[0]*1e9+n[1]},r=o(),a=process.uptime()*1e9,i=r-a):Date.now?(ve.exports=function(){return Date.now()-t},t=Date.now()):(ve.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(Ar)),ve.exports}var At;function Cr(){if(At)return we.exports;At=1;for(var o=Tr(),e=typeof window>"u"?vr:window,t=["moz","webkit"],r="AnimationFrame",i=e["request"+r],a=e["cancel"+r]||e["cancelRequest"+r],n=0;!i&&n<t.length;n++)i=e[t[n]+"Request"+r],a=e[t[n]+"Cancel"+r]||e[t[n]+"CancelRequest"+r];if(!i||!a){var s=0,h=0,u=[],l=1e3/60;i=function(g){if(u.length===0){var c=o(),f=Math.max(0,l-(c-s));s=f+c,setTimeout(function(){var d=u.slice(0);u.length=0;for(var v=0;v<d.length;v++)if(!d[v].cancelled)try{d[v].callback(s)}catch(p){setTimeout(function(){throw p},0)}},Math.round(f))}return u.push({handle:++h,callback:g,cancelled:!1}),h},a=function(g){for(var c=0;c<u.length;c++)u[c].handle===g&&(u[c].cancelled=!0)}}return we.exports=function(g){return i.call(e,g)},we.exports.cancel=function(){a.apply(e,arguments)},we.exports.polyfill=function(g){g||(g=e),g.requestAnimationFrame=i,g.cancelAnimationFrame=a},we.exports}var Er=Cr();const Ke=Yt(Er);dr();var et,Tt;function Or(){return Tt||(Tt=1,et=function(o){this.ok=!1,this.alpha=1,o.charAt(0)=="#"&&(o=o.substr(1,6)),o=o.replace(/ /g,""),o=o.toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};o=e[o]||o;for(var t=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(h){return[parseInt(h[1]),parseInt(h[2]),parseInt(h[3]),parseFloat(h[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(h){return[parseInt(h[1]),parseInt(h[2]),parseInt(h[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(h){return[parseInt(h[1],16),parseInt(h[2],16),parseInt(h[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(h){return[parseInt(h[1]+h[1],16),parseInt(h[2]+h[2],16),parseInt(h[3]+h[3],16)]}}],r=0;r<t.length;r++){var i=t[r].re,a=t[r].process,n=i.exec(o);if(n){var s=a(n);this.r=s[0],this.g=s[1],this.b=s[2],s.length>3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var h=this.r.toString(16),u=this.g.toString(16),l=this.b.toString(16);return h.length==1&&(h="0"+h),u.length==1&&(u="0"+u),l.length==1&&(l="0"+l),"#"+h+u+l},this.getHelpXML=function(){for(var h=new Array,u=0;u<t.length;u++)for(var l=t[u].example,g=0;g<l.length;g++)h[h.length]=l[g];for(var c in e)h[h.length]=c;var f=document.createElement("ul");f.setAttribute("id","rgbcolor-examples");for(var u=0;u<h.length;u++)try{var d=document.createElement("li"),v=new RGBColor(h[u]),p=document.createElement("div");p.style.cssText="margin: 3px; border: 1px solid black; background:"+v.toHex()+"; color:"+v.toHex(),p.appendChild(document.createTextNode("test"));var y=document.createTextNode(" "+h[u]+" -> "+v.toRGB()+" -> "+v.toHex());d.appendChild(p),d.appendChild(y),f.appendChild(d)}catch{}return f}}),et}var Sr=Or();const at=Yt(Sr);pr();mr();yr();/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var qt=function(o,e){return(qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])})(o,e)};function jt(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=o}qt(o,e),o.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Nr(o){var e="";Array.isArray(o)||(o=[o]);for(var t=0;t<o.length;t++){var r=o[t];if(r.type===m.CLOSE_PATH)e+="z";else if(r.type===m.HORIZ_LINE_TO)e+=(r.relative?"h":"H")+r.x;else if(r.type===m.VERT_LINE_TO)e+=(r.relative?"v":"V")+r.y;else if(r.type===m.MOVE_TO)e+=(r.relative?"m":"M")+r.x+" "+r.y;else if(r.type===m.LINE_TO)e+=(r.relative?"l":"L")+r.x+" "+r.y;else if(r.type===m.CURVE_TO)e+=(r.relative?"c":"C")+r.x1+" "+r.y1+" "+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===m.SMOOTH_CURVE_TO)e+=(r.relative?"s":"S")+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===m.QUAD_TO)e+=(r.relative?"q":"Q")+r.x1+" "+r.y1+" "+r.x+" "+r.y;else if(r.type===m.SMOOTH_QUAD_TO)e+=(r.relative?"t":"T")+r.x+" "+r.y;else{if(r.type!==m.ARC)throw new Error('Unexpected command type "'+r.type+'" at index '+t+".");e+=(r.relative?"a":"A")+r.rX+" "+r.rY+" "+r.xRot+" "+ +r.lArcFlag+" "+ +r.sweepFlag+" "+r.x+" "+r.y}}return e}function st(o,e){var t=o[0],r=o[1];return[t*Math.cos(e)-r*Math.sin(e),t*Math.sin(e)+r*Math.cos(e)]}function J(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];for(var t=0;t<o.length;t++)if(typeof o[t]!="number")throw new Error("assertNumbers arguments["+t+"] is not a number. "+typeof o[t]+" == typeof "+o[t]);return!0}var se=Math.PI;function tt(o,e,t){o.lArcFlag=o.lArcFlag===0?0:1,o.sweepFlag=o.sweepFlag===0?0:1;var r=o.rX,i=o.rY,a=o.x,n=o.y;r=Math.abs(o.rX),i=Math.abs(o.rY);var s=st([(e-a)/2,(t-n)/2],-o.xRot/180*se),h=s[0],u=s[1],l=Math.pow(h,2)/Math.pow(r,2)+Math.pow(u,2)/Math.pow(i,2);1<l&&(r*=Math.sqrt(l),i*=Math.sqrt(l)),o.rX=r,o.rY=i;var g=Math.pow(r,2)*Math.pow(u,2)+Math.pow(i,2)*Math.pow(h,2),c=(o.lArcFlag!==o.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(i,2)-g)/g)),f=r*u/i*c,d=-i*h/r*c,v=st([f,d],o.xRot/180*se);o.cX=v[0]+(e+a)/2,o.cY=v[1]+(t+n)/2,o.phi1=Math.atan2((u-d)/i,(h-f)/r),o.phi2=Math.atan2((-u-d)/i,(-h-f)/r),o.sweepFlag===0&&o.phi2>o.phi1&&(o.phi2-=2*se),o.sweepFlag===1&&o.phi2<o.phi1&&(o.phi2+=2*se),o.phi1*=180/se,o.phi2*=180/se}function Ct(o,e,t){J(o,e,t);var r=o*o+e*e-t*t;if(0>r)return[];if(r===0)return[[o*t/(o*o+e*e),e*t/(o*o+e*e)]];var i=Math.sqrt(r);return[[(o*t+e*i)/(o*o+e*e),(e*t-o*i)/(o*o+e*e)],[(o*t-e*i)/(o*o+e*e),(e*t+o*i)/(o*o+e*e)]]}var B,te=Math.PI/180;function Et(o,e,t){return(1-t)*o+t*e}function Ot(o,e,t,r){return o+Math.cos(r/180*se)*e+Math.sin(r/180*se)*t}function St(o,e,t,r){var i=1e-6,a=e-o,n=t-e,s=3*a+3*(r-t)-6*n,h=6*(n-a),u=3*a;return Math.abs(s)<i?[-u/h]:(function(l,g,c){var f=l*l/4-g;if(f<-c)return[];if(f<=c)return[-l/2];var d=Math.sqrt(f);return[-l/2-d,-l/2+d]})(h/s,u/s,i)}function Nt(o,e,t,r,i){var a=1-i;return o*(a*a*a)+e*(3*a*a*i)+t*(3*a*i*i)+r*(i*i*i)}(function(o){function e(){return i((function(s,h,u){return s.relative&&(s.x1!==void 0&&(s.x1+=h),s.y1!==void 0&&(s.y1+=u),s.x2!==void 0&&(s.x2+=h),s.y2!==void 0&&(s.y2+=u),s.x!==void 0&&(s.x+=h),s.y!==void 0&&(s.y+=u),s.relative=!1),s}))}function t(){var s=NaN,h=NaN,u=NaN,l=NaN;return i((function(g,c,f){return g.type&m.SMOOTH_CURVE_TO&&(g.type=m.CURVE_TO,s=isNaN(s)?c:s,h=isNaN(h)?f:h,g.x1=g.relative?c-s:2*c-s,g.y1=g.relative?f-h:2*f-h),g.type&m.CURVE_TO?(s=g.relative?c+g.x2:g.x2,h=g.relative?f+g.y2:g.y2):(s=NaN,h=NaN),g.type&m.SMOOTH_QUAD_TO&&(g.type=m.QUAD_TO,u=isNaN(u)?c:u,l=isNaN(l)?f:l,g.x1=g.relative?c-u:2*c-u,g.y1=g.relative?f-l:2*f-l),g.type&m.QUAD_TO?(u=g.relative?c+g.x1:g.x1,l=g.relative?f+g.y1:g.y1):(u=NaN,l=NaN),g}))}function r(){var s=NaN,h=NaN;return i((function(u,l,g){if(u.type&m.SMOOTH_QUAD_TO&&(u.type=m.QUAD_TO,s=isNaN(s)?l:s,h=isNaN(h)?g:h,u.x1=u.relative?l-s:2*l-s,u.y1=u.relative?g-h:2*g-h),u.type&m.QUAD_TO){s=u.relative?l+u.x1:u.x1,h=u.relative?g+u.y1:u.y1;var c=u.x1,f=u.y1;u.type=m.CURVE_TO,u.x1=((u.relative?0:l)+2*c)/3,u.y1=((u.relative?0:g)+2*f)/3,u.x2=(u.x+2*c)/3,u.y2=(u.y+2*f)/3}else s=NaN,h=NaN;return u}))}function i(s){var h=0,u=0,l=NaN,g=NaN;return function(c){if(isNaN(l)&&!(c.type&m.MOVE_TO))throw new Error("path must start with moveto");var f=s(c,h,u,l,g);return c.type&m.CLOSE_PATH&&(h=l,u=g),c.x!==void 0&&(h=c.relative?h+c.x:c.x),c.y!==void 0&&(u=c.relative?u+c.y:c.y),c.type&m.MOVE_TO&&(l=h,g=u),f}}function a(s,h,u,l,g,c){return J(s,h,u,l,g,c),i((function(f,d,v,p){var y=f.x1,T=f.x2,b=f.relative&&!isNaN(p),x=f.x!==void 0?f.x:b?0:d,O=f.y!==void 0?f.y:b?0:v;function E(G){return G*G}f.type&m.HORIZ_LINE_TO&&h!==0&&(f.type=m.LINE_TO,f.y=f.relative?0:v),f.type&m.VERT_LINE_TO&&u!==0&&(f.type=m.LINE_TO,f.x=f.relative?0:d),f.x!==void 0&&(f.x=f.x*s+O*u+(b?0:g)),f.y!==void 0&&(f.y=x*h+f.y*l+(b?0:c)),f.x1!==void 0&&(f.x1=f.x1*s+f.y1*u+(b?0:g)),f.y1!==void 0&&(f.y1=y*h+f.y1*l+(b?0:c)),f.x2!==void 0&&(f.x2=f.x2*s+f.y2*u+(b?0:g)),f.y2!==void 0&&(f.y2=T*h+f.y2*l+(b?0:c));var w=s*l-h*u;if(f.xRot!==void 0&&(s!==1||h!==0||u!==0||l!==1))if(w===0)delete f.rX,delete f.rY,delete f.xRot,delete f.lArcFlag,delete f.sweepFlag,f.type=m.LINE_TO;else{var S=f.xRot*Math.PI/180,R=Math.sin(S),D=Math.cos(S),_=1/E(f.rX),M=1/E(f.rY),U=E(D)*_+E(R)*M,H=2*R*D*(_-M),z=E(R)*_+E(D)*M,X=U*l*l-H*h*l+z*h*h,F=H*(s*l+h*u)-2*(U*u*l+z*s*h),Y=U*u*u-H*s*u+z*s*s,P=(Math.atan2(F,X-Y)+Math.PI)%Math.PI/2,k=Math.sin(P),q=Math.cos(P);f.rX=Math.abs(w)/Math.sqrt(X*E(q)+F*k*q+Y*E(k)),f.rY=Math.abs(w)/Math.sqrt(X*E(k)-F*k*q+Y*E(q)),f.xRot=180*P/Math.PI}return f.sweepFlag!==void 0&&0>w&&(f.sweepFlag=+!f.sweepFlag),f}))}function n(){return function(s){var h={};for(var u in s)h[u]=s[u];return h}}o.ROUND=function(s){function h(u){return Math.round(u*s)/s}return s===void 0&&(s=1e13),J(s),function(u){return u.x1!==void 0&&(u.x1=h(u.x1)),u.y1!==void 0&&(u.y1=h(u.y1)),u.x2!==void 0&&(u.x2=h(u.x2)),u.y2!==void 0&&(u.y2=h(u.y2)),u.x!==void 0&&(u.x=h(u.x)),u.y!==void 0&&(u.y=h(u.y)),u.rX!==void 0&&(u.rX=h(u.rX)),u.rY!==void 0&&(u.rY=h(u.rY)),u}},o.TO_ABS=e,o.TO_REL=function(){return i((function(s,h,u){return s.relative||(s.x1!==void 0&&(s.x1-=h),s.y1!==void 0&&(s.y1-=u),s.x2!==void 0&&(s.x2-=h),s.y2!==void 0&&(s.y2-=u),s.x!==void 0&&(s.x-=h),s.y!==void 0&&(s.y-=u),s.relative=!0),s}))},o.NORMALIZE_HVZ=function(s,h,u){return s===void 0&&(s=!0),h===void 0&&(h=!0),u===void 0&&(u=!0),i((function(l,g,c,f,d){if(isNaN(f)&&!(l.type&m.MOVE_TO))throw new Error("path must start with moveto");return h&&l.type&m.HORIZ_LINE_TO&&(l.type=m.LINE_TO,l.y=l.relative?0:c),u&&l.type&m.VERT_LINE_TO&&(l.type=m.LINE_TO,l.x=l.relative?0:g),s&&l.type&m.CLOSE_PATH&&(l.type=m.LINE_TO,l.x=l.relative?f-g:f,l.y=l.relative?d-c:d),l.type&m.ARC&&(l.rX===0||l.rY===0)&&(l.type=m.LINE_TO,delete l.rX,delete l.rY,delete l.xRot,delete l.lArcFlag,delete l.sweepFlag),l}))},o.NORMALIZE_ST=t,o.QT_TO_C=r,o.INFO=i,o.SANITIZE=function(s){s===void 0&&(s=0),J(s);var h=NaN,u=NaN,l=NaN,g=NaN;return i((function(c,f,d,v,p){var y=Math.abs,T=!1,b=0,x=0;if(c.type&m.SMOOTH_CURVE_TO&&(b=isNaN(h)?0:f-h,x=isNaN(u)?0:d-u),c.type&(m.CURVE_TO|m.SMOOTH_CURVE_TO)?(h=c.relative?f+c.x2:c.x2,u=c.relative?d+c.y2:c.y2):(h=NaN,u=NaN),c.type&m.SMOOTH_QUAD_TO?(l=isNaN(l)?f:2*f-l,g=isNaN(g)?d:2*d-g):c.type&m.QUAD_TO?(l=c.relative?f+c.x1:c.x1,g=c.relative?d+c.y1:c.y2):(l=NaN,g=NaN),c.type&m.LINE_COMMANDS||c.type&m.ARC&&(c.rX===0||c.rY===0||!c.lArcFlag)||c.type&m.CURVE_TO||c.type&m.SMOOTH_CURVE_TO||c.type&m.QUAD_TO||c.type&m.SMOOTH_QUAD_TO){var O=c.x===void 0?0:c.relative?c.x:c.x-f,E=c.y===void 0?0:c.relative?c.y:c.y-d;b=isNaN(l)?c.x1===void 0?b:c.relative?c.x:c.x1-f:l-f,x=isNaN(g)?c.y1===void 0?x:c.relative?c.y:c.y1-d:g-d;var w=c.x2===void 0?0:c.relative?c.x:c.x2-f,S=c.y2===void 0?0:c.relative?c.y:c.y2-d;y(O)<=s&&y(E)<=s&&y(b)<=s&&y(x)<=s&&y(w)<=s&&y(S)<=s&&(T=!0)}return c.type&m.CLOSE_PATH&&y(f-v)<=s&&y(d-p)<=s&&(T=!0),T?[]:c}))},o.MATRIX=a,o.ROTATE=function(s,h,u){h===void 0&&(h=0),u===void 0&&(u=0),J(s,h,u);var l=Math.sin(s),g=Math.cos(s);return a(g,l,-l,g,h-h*g+u*l,u-h*l-u*g)},o.TRANSLATE=function(s,h){return h===void 0&&(h=0),J(s,h),a(1,0,0,1,s,h)},o.SCALE=function(s,h){return h===void 0&&(h=s),J(s,h),a(s,0,0,h,0,0)},o.SKEW_X=function(s){return J(s),a(1,0,Math.atan(s),1,0,0)},o.SKEW_Y=function(s){return J(s),a(1,Math.atan(s),0,1,0,0)},o.X_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),J(s),a(-1,0,0,1,s,0)},o.Y_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),J(s),a(1,0,0,-1,0,s)},o.A_TO_C=function(){return i((function(s,h,u){return m.ARC===s.type?(function(l,g,c){var f,d,v,p;l.cX||tt(l,g,c);for(var y=Math.min(l.phi1,l.phi2),T=Math.max(l.phi1,l.phi2)-y,b=Math.ceil(T/90),x=new Array(b),O=g,E=c,w=0;w<b;w++){var S=Et(l.phi1,l.phi2,w/b),R=Et(l.phi1,l.phi2,(w+1)/b),D=R-S,_=4/3*Math.tan(D*te/4),M=[Math.cos(S*te)-_*Math.sin(S*te),Math.sin(S*te)+_*Math.cos(S*te)],U=M[0],H=M[1],z=[Math.cos(R*te),Math.sin(R*te)],X=z[0],F=z[1],Y=[X+_*Math.sin(R*te),F-_*Math.cos(R*te)],P=Y[0],k=Y[1];x[w]={relative:l.relative,type:m.CURVE_TO};var q=function(G,ee){var ae=st([G*l.rX,ee*l.rY],l.xRot),me=ae[0],Ce=ae[1];return[l.cX+me,l.cY+Ce]};f=q(U,H),x[w].x1=f[0],x[w].y1=f[1],d=q(P,k),x[w].x2=d[0],x[w].y2=d[1],v=q(X,F),x[w].x=v[0],x[w].y=v[1],l.relative&&(x[w].x1-=O,x[w].y1-=E,x[w].x2-=O,x[w].y2-=E,x[w].x-=O,x[w].y-=E),O=(p=[x[w].x,x[w].y])[0],E=p[1]}return x})(s,s.relative?0:h,s.relative?0:u):s}))},o.ANNOTATE_ARCS=function(){return i((function(s,h,u){return s.relative&&(h=0,u=0),m.ARC===s.type&&tt(s,h,u),s}))},o.CLONE=n,o.CALCULATE_BOUNDS=function(){var s=function(c){var f={};for(var d in c)f[d]=c[d];return f},h=e(),u=r(),l=t(),g=i((function(c,f,d){var v=l(u(h(s(c))));function p(k){k>g.maxX&&(g.maxX=k),k<g.minX&&(g.minX=k)}function y(k){k>g.maxY&&(g.maxY=k),k<g.minY&&(g.minY=k)}if(v.type&m.DRAWING_COMMANDS&&(p(f),y(d)),v.type&m.HORIZ_LINE_TO&&p(v.x),v.type&m.VERT_LINE_TO&&y(v.y),v.type&m.LINE_TO&&(p(v.x),y(v.y)),v.type&m.CURVE_TO){p(v.x),y(v.y);for(var T=0,b=St(f,v.x1,v.x2,v.x);T<b.length;T++)0<(P=b[T])&&1>P&&p(Nt(f,v.x1,v.x2,v.x,P));for(var x=0,O=St(d,v.y1,v.y2,v.y);x<O.length;x++)0<(P=O[x])&&1>P&&y(Nt(d,v.y1,v.y2,v.y,P))}if(v.type&m.ARC){p(v.x),y(v.y),tt(v,f,d);for(var E=v.xRot/180*Math.PI,w=Math.cos(E)*v.rX,S=Math.sin(E)*v.rX,R=-Math.sin(E)*v.rY,D=Math.cos(E)*v.rY,_=v.phi1<v.phi2?[v.phi1,v.phi2]:-180>v.phi2?[v.phi2+360,v.phi1+360]:[v.phi2,v.phi1],M=_[0],U=_[1],H=function(k){var q=k[0],G=k[1],ee=180*Math.atan2(G,q)/Math.PI;return ee<M?ee+360:ee},z=0,X=Ct(R,-w,0).map(H);z<X.length;z++)(P=X[z])>M&&P<U&&p(Ot(v.cX,w,R,P));for(var F=0,Y=Ct(D,-S,0).map(H);F<Y.length;F++){var P;(P=Y[F])>M&&P<U&&y(Ot(v.cY,S,D,P))}}return c}));return g.minX=1/0,g.maxX=-1/0,g.minY=1/0,g.maxY=-1/0,g}})(B||(B={}));var Z,Wt=(function(){function o(){}return o.prototype.round=function(e){return this.transform(B.ROUND(e))},o.prototype.toAbs=function(){return this.transform(B.TO_ABS())},o.prototype.toRel=function(){return this.transform(B.TO_REL())},o.prototype.normalizeHVZ=function(e,t,r){return this.transform(B.NORMALIZE_HVZ(e,t,r))},o.prototype.normalizeST=function(){return this.transform(B.NORMALIZE_ST())},o.prototype.qtToC=function(){return this.transform(B.QT_TO_C())},o.prototype.aToC=function(){return this.transform(B.A_TO_C())},o.prototype.sanitize=function(e){return this.transform(B.SANITIZE(e))},o.prototype.translate=function(e,t){return this.transform(B.TRANSLATE(e,t))},o.prototype.scale=function(e,t){return this.transform(B.SCALE(e,t))},o.prototype.rotate=function(e,t,r){return this.transform(B.ROTATE(e,t,r))},o.prototype.matrix=function(e,t,r,i,a,n){return this.transform(B.MATRIX(e,t,r,i,a,n))},o.prototype.skewX=function(e){return this.transform(B.SKEW_X(e))},o.prototype.skewY=function(e){return this.transform(B.SKEW_Y(e))},o.prototype.xSymmetry=function(e){return this.transform(B.X_AXIS_SYMMETRY(e))},o.prototype.ySymmetry=function(e){return this.transform(B.Y_AXIS_SYMMETRY(e))},o.prototype.annotateArcs=function(){return this.transform(B.ANNOTATE_ARCS())},o})(),Mr=function(o){return o===" "||o===" "||o==="\r"||o===`
|
|
`},Mt=function(o){return 48<=o.charCodeAt(0)&&o.charCodeAt(0)<=57},Pr=(function(o){function e(){var t=o.call(this)||this;return t.curNumber="",t.curCommandType=-1,t.curCommandRelative=!1,t.canParseCommandOrComma=!0,t.curNumberHasExp=!1,t.curNumberHasExpDigits=!1,t.curNumberHasDecimal=!1,t.curArgs=[],t}return jt(e,o),e.prototype.finish=function(t){if(t===void 0&&(t=[]),this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,r){var i=this;r===void 0&&(r=[]);for(var a=function(g){r.push(g),i.curArgs.length=0,i.canParseCommandOrComma=!0},n=0;n<t.length;n++){var s=t[n],h=!(this.curCommandType!==m.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),u=Mt(s)&&(this.curNumber==="0"&&s==="0"||h);if(!Mt(s)||u)if(s!=="e"&&s!=="E")if(s!=="-"&&s!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(s!=="."||this.curNumberHasExp||this.curNumberHasDecimal||h){if(this.curNumber&&this.curCommandType!==-1){var l=Number(this.curNumber);if(isNaN(l))throw new SyntaxError("Invalid number ending at "+n);if(this.curCommandType===m.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>l)throw new SyntaxError('Expected positive number, got "'+l+'" at index "'+n+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+n+'"')}this.curArgs.push(l),this.curArgs.length===Vr[this.curCommandType]&&(m.HORIZ_LINE_TO===this.curCommandType?a({type:m.HORIZ_LINE_TO,relative:this.curCommandRelative,x:l}):m.VERT_LINE_TO===this.curCommandType?a({type:m.VERT_LINE_TO,relative:this.curCommandRelative,y:l}):this.curCommandType===m.MOVE_TO||this.curCommandType===m.LINE_TO||this.curCommandType===m.SMOOTH_QUAD_TO?(a({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),m.MOVE_TO===this.curCommandType&&(this.curCommandType=m.LINE_TO)):this.curCommandType===m.CURVE_TO?a({type:m.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===m.SMOOTH_CURVE_TO?a({type:m.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===m.QUAD_TO?a({type:m.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===m.ARC&&a({type:m.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!Mr(s))if(s===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(s!=="+"&&s!=="-"&&s!==".")if(u)this.curNumber=s,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+n+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+s+'" at index '+n+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,s!=="z"&&s!=="Z")if(s==="h"||s==="H")this.curCommandType=m.HORIZ_LINE_TO,this.curCommandRelative=s==="h";else if(s==="v"||s==="V")this.curCommandType=m.VERT_LINE_TO,this.curCommandRelative=s==="v";else if(s==="m"||s==="M")this.curCommandType=m.MOVE_TO,this.curCommandRelative=s==="m";else if(s==="l"||s==="L")this.curCommandType=m.LINE_TO,this.curCommandRelative=s==="l";else if(s==="c"||s==="C")this.curCommandType=m.CURVE_TO,this.curCommandRelative=s==="c";else if(s==="s"||s==="S")this.curCommandType=m.SMOOTH_CURVE_TO,this.curCommandRelative=s==="s";else if(s==="q"||s==="Q")this.curCommandType=m.QUAD_TO,this.curCommandRelative=s==="q";else if(s==="t"||s==="T")this.curCommandType=m.SMOOTH_QUAD_TO,this.curCommandRelative=s==="t";else{if(s!=="a"&&s!=="A")throw new SyntaxError('Unexpected character "'+s+'" at index '+n+".");this.curCommandType=m.ARC,this.curCommandRelative=s==="a"}else r.push({type:m.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=s,this.curNumberHasDecimal=s==="."}else this.curNumber+=s,this.curNumberHasDecimal=!0;else this.curNumber+=s;else this.curNumber+=s,this.curNumberHasExp=!0;else this.curNumber+=s,this.curNumberHasExpDigits=this.curNumberHasExp}return r},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(r,i){i===void 0&&(i=[]);for(var a=0,n=Object.getPrototypeOf(this).parse.call(this,r);a<n.length;a++){var s=n[a],h=t(s);Array.isArray(h)?i.push.apply(i,h):i.push(h)}return i}}})},e})(Wt),m=(function(o){function e(t){var r=o.call(this)||this;return r.commands=typeof t=="string"?e.parse(t):t,r}return jt(e,o),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=B.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var r=[],i=0,a=this.commands;i<a.length;i++){var n=t(a[i]);Array.isArray(n)?r.push.apply(r,n):r.push(n)}return this.commands=r,this},e.encode=function(t){return Nr(t)},e.parse=function(t){var r=new Pr,i=[];return r.parse(t,i),r.finish(i),i},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e})(Wt),Vr=((Z={})[m.MOVE_TO]=2,Z[m.LINE_TO]=2,Z[m.HORIZ_LINE_TO]=1,Z[m.VERT_LINE_TO]=1,Z[m.CLOSE_PATH]=0,Z[m.QUAD_TO]=4,Z[m.SMOOTH_QUAD_TO]=2,Z[m.CURVE_TO]=6,Z[m.SMOOTH_CURVE_TO]=4,Z[m.ARC]=7,Z);br();function _e(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_e=function(e){return typeof e}:_e=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_e(o)}function Rr(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}var kr=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Dr=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Lr(o,e,t,r,i){if(typeof o=="string"&&(o=document.getElementById(o)),!o||_e(o)!=="object"||!("getContext"in o))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var a=o.getContext("2d");try{return a.getImageData(e,t,r,i)}catch(n){throw new Error("unable to access image data: "+n)}}function _r(o,e,t,r,i,a){if(!(isNaN(a)||a<1)){a|=0;var n=Lr(o,e,t,r,i);n=Ir(n,e,t,r,i,a),o.getContext("2d").putImageData(n,e,t)}}function Ir(o,e,t,r,i,a){for(var n=o.data,s=2*a+1,h=r-1,u=i-1,l=a+1,g=l*(l+1)/2,c=new Pt,f=c,d,v=1;v<s;v++)f=f.next=new Pt,v===l&&(d=f);f.next=c;for(var p=null,y=null,T=0,b=0,x=kr[a],O=Dr[a],E=0;E<i;E++){f=c;for(var w=n[b],S=n[b+1],R=n[b+2],D=n[b+3],_=0;_<l;_++)f.r=w,f.g=S,f.b=R,f.a=D,f=f.next;for(var M=0,U=0,H=0,z=0,X=l*w,F=l*S,Y=l*R,P=l*D,k=g*w,q=g*S,G=g*R,ee=g*D,ae=1;ae<l;ae++){var me=b+((h<ae?h:ae)<<2),Ce=n[me],ft=n[me+1],gt=n[me+2],ct=n[me+3],Ee=l-ae;k+=(f.r=Ce)*Ee,q+=(f.g=ft)*Ee,G+=(f.b=gt)*Ee,ee+=(f.a=ct)*Ee,M+=Ce,U+=ft,H+=gt,z+=ct,f=f.next}p=c,y=d;for(var Ue=0;Ue<r;Ue++){var He=ee*x>>>O;if(n[b+3]=He,He!==0){var Xe=255/He;n[b]=(k*x>>>O)*Xe,n[b+1]=(q*x>>>O)*Xe,n[b+2]=(G*x>>>O)*Xe}else n[b]=n[b+1]=n[b+2]=0;k-=X,q-=F,G-=Y,ee-=P,X-=p.r,F-=p.g,Y-=p.b,P-=p.a;var oe=Ue+a+1;oe=T+(oe<h?oe:h)<<2,M+=p.r=n[oe],U+=p.g=n[oe+1],H+=p.b=n[oe+2],z+=p.a=n[oe+3],k+=M,q+=U,G+=H,ee+=z,p=p.next;var Oe=y,vt=Oe.r,dt=Oe.g,pt=Oe.b,mt=Oe.a;X+=vt,F+=dt,Y+=pt,P+=mt,M-=vt,U-=dt,H-=pt,z-=mt,y=y.next,b+=4}T+=r}for(var ye=0;ye<r;ye++){b=ye<<2;var ue=n[b],le=n[b+1],fe=n[b+2],W=n[b+3],Ye=l*ue,qe=l*le,je=l*fe,We=l*W,Se=g*ue,Ne=g*le,Me=g*fe,Pe=g*W;f=c;for(var yt=0;yt<l;yt++)f.r=ue,f.g=le,f.b=fe,f.a=W,f=f.next;for(var bt=r,Qe=0,$e=0,Ge=0,Ze=0,Ve=1;Ve<=a;Ve++){b=bt+ye<<2;var Re=l-Ve;Se+=(f.r=ue=n[b])*Re,Ne+=(f.g=le=n[b+1])*Re,Me+=(f.b=fe=n[b+2])*Re,Pe+=(f.a=W=n[b+3])*Re,Ze+=ue,Qe+=le,$e+=fe,Ge+=W,f=f.next,Ve<u&&(bt+=r)}b=ye,p=c,y=d;for(var Je=0;Je<i;Je++){var Q=b<<2;n[Q+3]=W=Pe*x>>>O,W>0?(W=255/W,n[Q]=(Se*x>>>O)*W,n[Q+1]=(Ne*x>>>O)*W,n[Q+2]=(Me*x>>>O)*W):n[Q]=n[Q+1]=n[Q+2]=0,Se-=Ye,Ne-=qe,Me-=je,Pe-=We,Ye-=p.r,qe-=p.g,je-=p.b,We-=p.a,Q=ye+((Q=Je+l)<u?Q:u)*r<<2,Se+=Ze+=p.r=n[Q],Ne+=Qe+=p.g=n[Q+1],Me+=$e+=p.b=n[Q+2],Pe+=Ge+=p.a=n[Q+3],p=p.next,Ye+=ue=y.r,qe+=le=y.g,je+=fe=y.b,We+=W=y.a,Ze-=ue,Qe-=le,$e-=fe,Ge-=W,y=y.next,b+=r}}return o}var Pt=function o(){Rr(this,o),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function Br(){var{DOMParser:o}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:o,createCanvas(t,r){return new OffscreenCanvas(t,r)},createImage(t){return ie(function*(){var r=yield fetch(t),i=yield r.blob(),a=yield createImageBitmap(i);return a})()}};return(typeof DOMParser<"u"||typeof o>"u")&&Reflect.deleteProperty(e,"DOMParser"),e}function zr(o){var{DOMParser:e,canvas:t,fetch:r}=o;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:r,createCanvas:t.createCanvas,createImage:t.loadImage}}var Ki=Object.freeze({__proto__:null,offscreen:Br,node:zr});function xe(o){return o.replace(/(?!\u3000)\s+/gm," ")}function Fr(o){return o.replace(/^[\n \t]+/,"")}function Ur(o){return o.replace(/[\n \t]+$/,"")}function $(o){var e=(o||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return e.map(parseFloat)}var Hr=/^[A-Z-]+$/;function Xr(o){return Hr.test(o)?o.toLowerCase():o}function Qt(o){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(o)||[];return e[2]||e[3]||e[4]}function Yr(o){if(!o.startsWith("rgb"))return o;var e=3,t=o.replace(/\d+(\.\d+)?/g,(r,i)=>e--&&i?String(Math.round(parseFloat(r))):r);return t}var qr=/(\[[^\]]+\])/g,jr=/(#[^\s+>~.[:]+)/g,Wr=/(\.[^\s+>~.[:]+)/g,Qr=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,$r=/(:[\w-]+\([^)]*\))/gi,Gr=/(:[^\s+>~.[:]+)/g,Zr=/([^\s+>~.[:]+)/g;function ge(o,e){var t=e.exec(o);return t?[o.replace(e," "),t.length]:[o,0]}function Jr(o){var e=[0,0,0],t=o.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[t,r]=ge(t,qr),e[1]+=r,[t,r]=ge(t,jr),e[0]+=r,[t,r]=ge(t,Wr),e[1]+=r,[t,r]=ge(t,Qr),e[2]+=r,[t,r]=ge(t,$r),e[1]+=r,[t,r]=ge(t,Gr),e[1]+=r,t=t.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[t,r]=ge(t,Zr),e[2]+=r,e.join("")}var be=1e-8;function Vt(o){return Math.sqrt(Math.pow(o[0],2)+Math.pow(o[1],2))}function nt(o,e){return(o[0]*e[0]+o[1]*e[1])/(Vt(o)*Vt(e))}function Rt(o,e){return(o[0]*e[1]<o[1]*e[0]?-1:1)*Math.acos(nt(o,e))}function kt(o){return o*o*o}function Dt(o){return 3*o*o*(1-o)}function Lt(o){return 3*o*(1-o)*(1-o)}function _t(o){return(1-o)*(1-o)*(1-o)}function It(o){return o*o}function Bt(o){return 2*o*(1-o)}function zt(o){return(1-o)*(1-o)}class A{constructor(e,t,r){this.document=e,this.name=t,this.value=r,this.isNormalizedColor=!1}static empty(e){return new A(e,"EMPTY","")}split(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:" ",{document:t,name:r}=this;return xe(this.getString()).trim().split(e).map(i=>new A(t,r,i))}hasValue(e){var{value:t}=this;return t!==null&&t!==""&&(e||t!==0)&&typeof t<"u"}isString(e){var{value:t}=this,r=typeof t=="string";return!r||!e?r:e.test(t)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e>"u"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e>"u"?0:parseFloat(e);var{value:t}=this,r=parseFloat(t);return this.isString(/%$/)&&(r/=100),r}getString(e){return typeof e>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(e)}getColor(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=Yr(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;var[r,i]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:a}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(a.computeSize("x"),a.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(a.computeSize("x"),a.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*a.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*a.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&i):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*a.computeSize(r);default:{var n=this.getNumber();return t&&n<1?n*a.computeSize(r):n}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}getFillStyleDefinition(e,t){var r=this.getDefinition();if(!r)return null;if(typeof r.createGradient=="function")return r.createGradient(this.document.ctx,e,t);if(typeof r.createPattern=="function"){if(r.getHrefAttribute().hasValue()){var i=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),i.hasValue()&&r.getAttribute("patternTransform",!0).setValue(i.value)}return r.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){return this.hasValue()?A.textBaselineMapping[this.getString()]:null}addOpacity(e){for(var t=this.getColor(),r=t.length,i=0,a=0;a<r&&(t[a]===","&&i++,i!==3);a++);if(e.hasValue()&&this.isString()&&i!==3){var n=new at(t);n.ok&&(n.alpha=e.getNumber(),t=n.toRGBA())}return new A(this.document,this.name,t)}}A.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class Kr{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(e,t){this.viewPorts.push({width:e,height:t})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:e}=this;return e[e.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return typeof e=="number"?e:e==="x"?this.width:e==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class L{constructor(e,t){this.x=e,this.y=t}static parse(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,[r=t,i=t]=$(e);return new L(r,i)}static parseScale(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[r=t,i=r]=$(e);return new L(r,i)}static parsePath(e){for(var t=$(e),r=t.length,i=[],a=0;a<r;a+=2)i.push(new L(t[a],t[a+1]));return i}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){var{x:t,y:r}=this,i=t*e[0]+r*e[2]+e[4],a=t*e[1]+r*e[3]+e[5];this.x=i,this.y=a}}class ei{constructor(e){this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:e,onClick:t,onMouseMove:r}=this,i=e.ctx.canvas;i.onclick=t,i.onmousemove=r,this.working=!0}}stop(){if(this.working){var e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:e,events:t,eventElements:r}=this,{style:i}=e.ctx.canvas;i&&(i.cursor=""),t.forEach((a,n)=>{for(var{run:s}=a,h=r[n];h;)s(h),h=h.parent}),this.events=[],this.eventElements=[]}}checkPath(e,t){if(!(!this.working||!t)){var{events:r,eventElements:i}=this;r.forEach((a,n)=>{var{x:s,y:h}=a;!i[n]&&t.isPointInPath&&t.isPointInPath(s,h)&&(i[n]=e)})}}checkBoundingBox(e,t){if(!(!this.working||!t)){var{events:r,eventElements:i}=this;r.forEach((a,n)=>{var{x:s,y:h}=a;!i[n]&&t.isPointInBox(s,h)&&(i[n]=e)})}}mapXY(e,t){for(var{window:r,ctx:i}=this.screen,a=new L(e,t),n=i.canvas;n;)a.x-=n.offsetLeft,a.y-=n.offsetTop,n=n.offsetParent;return r.scrollX&&(a.x+=r.scrollX),r.scrollY&&(a.y+=r.scrollY),a}onClick(e){var{x:t,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:r,run(i){i.onClick&&i.onClick()}})}onMouseMove(e){var{x:t,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:r,run(i){i.onMouseMove&&i.onMouseMove()}})}}var $t=typeof window<"u"?window:null,Gt=typeof fetch<"u"?fetch.bind(void 0):null;class Ie{constructor(e){var{fetch:t=Gt,window:r=$t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new Kr,this.mouse=new ei(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=r,this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every(t=>t());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){var{document:t,ctx:r,aspectRatio:i,width:a,desiredWidth:n,height:s,desiredHeight:h,minX:u=0,minY:l=0,refX:g,refY:c,clip:f=!1,clipX:d=0,clipY:v=0}=e,p=xe(i).replace(/^defer\s/,""),[y,T]=p.split(" "),b=y||"xMidYMid",x=T||"meet",O=a/n,E=s/h,w=Math.min(O,E),S=Math.max(O,E),R=n,D=h;x==="meet"&&(R*=w,D*=w),x==="slice"&&(R*=S,D*=S);var _=new A(t,"refX",g),M=new A(t,"refY",c),U=_.hasValue()&&M.hasValue();if(U&&r.translate(-w*_.getPixels("x"),-w*M.getPixels("y")),f){var H=w*d,z=w*v;r.beginPath(),r.moveTo(H,z),r.lineTo(a,z),r.lineTo(a,s),r.lineTo(H,s),r.closePath(),r.clip()}if(!U){var X=x==="meet"&&w===E,F=x==="slice"&&S===E,Y=x==="meet"&&w===O,P=x==="slice"&&S===O;b.startsWith("xMid")&&(X||F)&&r.translate(a/2-R/2,0),b.endsWith("YMid")&&(Y||P)&&r.translate(0,s/2-D/2),b.startsWith("xMax")&&(X||F)&&r.translate(a-R,0),b.endsWith("YMax")&&(Y||P)&&r.translate(0,s-D)}switch(!0){case b==="none":r.scale(O,E);break;case x==="meet":r.scale(w,w);break;case x==="slice":r.scale(S,S);break}r.translate(-u,-l)}start(e){var{enableRedraw:t=!1,ignoreMouse:r=!1,ignoreAnimation:i=!1,ignoreDimensions:a=!1,ignoreClear:n=!1,forceRedraw:s,scaleWidth:h,scaleHeight:u,offsetX:l,offsetY:g}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:c,mouse:f}=this,d=1e3/c;if(this.frameDuration=d,this.readyPromise=new Promise(b=>{this.resolveReady=b}),this.isReady()&&this.render(e,a,n,h,u,l,g),!!t){var v=Date.now(),p=v,y=0,T=()=>{v=Date.now(),y=v-p,y>=d&&(p=v-y%d,this.shouldUpdate(i,s)&&(this.render(e,a,n,h,u,l,g),f.runEvents())),this.intervalId=Ke(T)};r||f.start(),this.intervalId=Ke(T)}}stop(){this.intervalId&&(Ke.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){var{frameDuration:r}=this,i=this.animations.reduce((a,n)=>n.update(r)||a,!1);if(i)return!0}return!!(typeof t=="function"&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,r,i,a,n,s){var{CLIENT_WIDTH:h,CLIENT_HEIGHT:u,viewPort:l,ctx:g,isFirstRender:c}=this,f=g.canvas;l.clear(),f.width&&f.height?l.setCurrent(f.width,f.height):l.setCurrent(h,u);var d=e.getStyle("width"),v=e.getStyle("height");!t&&(c||typeof i!="number"&&typeof a!="number")&&(d.hasValue()&&(f.width=d.getPixels("x"),f.style&&(f.style.width="".concat(f.width,"px"))),v.hasValue()&&(f.height=v.getPixels("y"),f.style&&(f.style.height="".concat(f.height,"px"))));var p=f.clientWidth||f.width,y=f.clientHeight||f.height;if(t&&d.hasValue()&&v.hasValue()&&(p=d.getPixels("x"),y=v.getPixels("y")),l.setCurrent(p,y),typeof n=="number"&&e.getAttribute("x",!0).setValue(n),typeof s=="number"&&e.getAttribute("y",!0).setValue(s),typeof i=="number"||typeof a=="number"){var T=$(e.getAttribute("viewBox").getString()),b=0,x=0;if(typeof i=="number"){var O=e.getStyle("width");O.hasValue()?b=O.getPixels("x")/i:isNaN(T[2])||(b=T[2]/i)}if(typeof a=="number"){var E=e.getStyle("height");E.hasValue()?x=E.getPixels("y")/a:isNaN(T[3])||(x=T[3]/a)}b||(b=x),x||(x=b),e.getAttribute("width",!0).setValue(i),e.getAttribute("height",!0).setValue(a);var w=e.getStyle("transform",!0,!0);w.setValue("".concat(w.getString()," scale(").concat(1/b,", ").concat(1/x,")"))}r||g.clearRect(0,0,p,y),e.render(g),c&&(this.isFirstRender=!1)}}Ie.defaultWindow=$t;Ie.defaultFetch=Gt;var{defaultFetch:ti}=Ie,ri=typeof DOMParser<"u"?DOMParser:null;class rt{constructor(){var{fetch:e=ti,DOMParser:t=ri}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=e,this.DOMParser=t}parse(e){var t=this;return ie(function*(){return e.startsWith("<")?t.parseFromString(e):t.load(e)})()}parseFromString(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent);return e}load(e){var t=this;return ie(function*(){var r=yield t.fetch(e),i=yield r.text();return t.parseFromString(i)})()}}class ii{constructor(e,t){this.type="translate",this.point=null,this.point=L.parse(t)}apply(e){var{x:t,y:r}=this.point;e.translate(t||0,r||0)}unapply(e){var{x:t,y:r}=this.point;e.translate(-1*t||0,-1*r||0)}applyToPoint(e){var{x:t,y:r}=this.point;e.applyTransform([1,0,0,1,t||0,r||0])}}class ai{constructor(e,t,r){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var i=$(t);this.angle=new A(e,"angle",i[0]),this.originX=r[0],this.originY=r[1],this.cx=i[1]||0,this.cy=i[2]||0}apply(e){var{cx:t,cy:r,originX:i,originY:a,angle:n}=this,s=t+i.getPixels("x"),h=r+a.getPixels("y");e.translate(s,h),e.rotate(n.getRadians()),e.translate(-s,-h)}unapply(e){var{cx:t,cy:r,originX:i,originY:a,angle:n}=this,s=t+i.getPixels("x"),h=r+a.getPixels("y");e.translate(s,h),e.rotate(-1*n.getRadians()),e.translate(-s,-h)}applyToPoint(e){var{cx:t,cy:r,angle:i}=this,a=i.getRadians();e.applyTransform([1,0,0,1,t||0,r||0]),e.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]),e.applyTransform([1,0,0,1,-t||0,-r||0])}}class si{constructor(e,t,r){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var i=L.parseScale(t);(i.x===0||i.y===0)&&(i.x=be,i.y=be),this.scale=i,this.originX=r[0],this.originY=r[1]}apply(e){var{scale:{x:t,y:r},originX:i,originY:a}=this,n=i.getPixels("x"),s=a.getPixels("y");e.translate(n,s),e.scale(t,r||t),e.translate(-n,-s)}unapply(e){var{scale:{x:t,y:r},originX:i,originY:a}=this,n=i.getPixels("x"),s=a.getPixels("y");e.translate(n,s),e.scale(1/t,1/r||t),e.translate(-n,-s)}applyToPoint(e){var{x:t,y:r}=this.scale;e.applyTransform([t||0,0,0,r||0,0,0])}}class Zt{constructor(e,t,r){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=$(t),this.originX=r[0],this.originY=r[1]}apply(e){var{originX:t,originY:r,matrix:i}=this,a=t.getPixels("x"),n=r.getPixels("y");e.translate(a,n),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.translate(-a,-n)}unapply(e){var{originX:t,originY:r,matrix:i}=this,a=i[0],n=i[2],s=i[4],h=i[1],u=i[3],l=i[5],g=0,c=0,f=1,d=1/(a*(u*f-l*c)-n*(h*f-l*g)+s*(h*c-u*g)),v=t.getPixels("x"),p=r.getPixels("y");e.translate(v,p),e.transform(d*(u*f-l*c),d*(l*g-h*f),d*(s*c-n*f),d*(a*f-s*g),d*(n*l-s*u),d*(s*h-a*l)),e.translate(-v,-p)}applyToPoint(e){e.applyTransform(this.matrix)}}class Jt extends Zt{constructor(e,t,r){super(e,t,r),this.type="skew",this.angle=null,this.angle=new A(e,"angle",t)}}class ni extends Jt{constructor(e,t,r){super(e,t,r),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class hi extends Jt{constructor(e,t,r){super(e,t,r),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function oi(o){return xe(o).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function ui(o){var[e,t]=o.split("(");return[e.trim(),t.trim().replace(")","")]}class de{constructor(e,t,r){this.document=e,this.transforms=[];var i=oi(t);i.forEach(a=>{if(a!=="none"){var[n,s]=ui(a),h=de.transformTypes[n];typeof h<"u"&&this.transforms.push(new h(this.document,s,r))}})}static fromElement(e,t){var r=t.getStyle("transform",!1,!0),[i,a=i]=t.getStyle("transform-origin",!1,!0).split(),n=[i,a];return r.hasValue()?new de(e,r.getString(),n):null}apply(e){for(var{transforms:t}=this,r=t.length,i=0;i<r;i++)t[i].apply(e)}unapply(e){for(var{transforms:t}=this,r=t.length,i=r-1;i>=0;i--)t[i].unapply(e)}applyToPoint(e){for(var{transforms:t}=this,r=t.length,i=0;i<r;i++)t[i].applyToPoint(e)}}de.transformTypes={translate:ii,rotate:ai,scale:si,matrix:Zt,skewX:ni,skewY:hi};class V{constructor(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.document=e,this.node=t,this.captureTextNodes=r,this.attributes=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!(!t||t.nodeType!==1)){if(Array.from(t.attributes).forEach(s=>{var h=Xr(s.nodeName);this.attributes[h]=new A(e,h,s.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var i=this.getAttribute("style").getString().split(";").map(s=>s.trim());i.forEach(s=>{if(s){var[h,u]=s.split(":").map(l=>l.trim());this.styles[h]=new A(e,h,u)}})}var{definitions:a}=e,n=this.getAttribute("id");n.hasValue()&&(a[n.getString()]||(a[n.getString()]=this)),Array.from(t.childNodes).forEach(s=>{if(s.nodeType===1)this.addChild(s);else if(r&&(s.nodeType===3||s.nodeType===4)){var h=e.createTextNode(s);h.getText().length>0&&this.addChild(h)}})}}getAttribute(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.attributes[e];if(!r&&t){var i=new A(this.document,e,"");return this.attributes[e]=i,i}return r||A.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if(e==="href"||e.endsWith(":href"))return this.attributes[e];return A.empty(this.document)}getStyle(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.styles[e];if(i)return i;var a=this.getAttribute(e);if(a!=null&&a.hasValue())return this.styles[e]=a,a;if(!r){var{parent:n}=this;if(n){var s=n.getStyle(e);if(s!=null&&s.hasValue())return s}}if(t){var h=new A(this.document,e,"");return this.styles[e]=h,h}return i||A.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(e),r.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){var t=de.fromElement(this.document,this);t&&t.apply(e);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var i=r.getDefinition();i&&i.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){var t=e instanceof V?e:this.document.createElement(e);t.parent=this,V.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){var t,{node:r}=this;if(typeof r.matches=="function")return r.matches(e);var i=(t=r.getAttribute)===null||t===void 0?void 0:t.call(r,"class");return!i||i===""?!1:i.split(" ").some(a=>".".concat(a)===e)}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:t}=this.document;for(var r in e)if(!r.startsWith("@")&&this.matchesSelector(r)){var i=e[r],a=t[r];if(i)for(var n in i){var s=this.stylesSpecificity[n];typeof s>"u"&&(s="000"),a>=s&&(this.styles[n]=i[n],this.stylesSpecificity[n]=a)}}}removeStyles(e,t){var r=t.reduce((i,a)=>{var n=e.getStyle(a);if(!n.hasValue())return i;var s=n.getString();return n.setValue(""),[...i,[a,s]]},[]);return r}restoreStyles(e,t){t.forEach(r=>{var[i,a]=r;e.getStyle(i,!0).setValue(a)})}isFirstChild(){var e;return((e=this.parent)===null||e===void 0?void 0:e.children.indexOf(this))===0}}V.ignoreChildTypes=["title"];class li extends V{constructor(e,t,r){super(e,t,r)}}function fi(o){var e=o.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function gi(o){return typeof process>"u"?o:o.trim().split(",").map(fi).join(",")}function ci(o){if(!o)return"";var e=o.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function vi(o){if(!o)return"";var e=o.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class j{constructor(e,t,r,i,a,n){var s=n?typeof n=="string"?j.parse(n):n:{};this.fontFamily=a||s.fontFamily,this.fontSize=i||s.fontSize,this.fontStyle=e||s.fontStyle,this.fontWeight=r||s.fontWeight,this.fontVariant=t||s.fontVariant}static parse(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r="",i="",a="",n="",s="",h=xe(e).trim().split(" "),u={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return h.forEach(l=>{switch(!0){case(!u.fontStyle&&j.styles.includes(l)):l!=="inherit"&&(r=l),u.fontStyle=!0;break;case(!u.fontVariant&&j.variants.includes(l)):l!=="inherit"&&(i=l),u.fontStyle=!0,u.fontVariant=!0;break;case(!u.fontWeight&&j.weights.includes(l)):l!=="inherit"&&(a=l),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0;break;case!u.fontSize:l!=="inherit"&&([n]=l.split("/")),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0,u.fontSize=!0;break;default:l!=="inherit"&&(s+=l)}}),new j(r,i,a,n,s,t)}toString(){return[ci(this.fontStyle),this.fontVariant,vi(this.fontWeight),this.fontSize,gi(this.fontFamily)].join(" ").trim()}}j.styles="normal|italic|oblique|inherit";j.variants="normal|small-caps|inherit";j.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class K{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.NaN,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.NaN,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Number.NaN,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Number.NaN;this.x1=e,this.y1=t,this.x2=r,this.y2=i,this.addPoint(e,t),this.addPoint(r,i)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){typeof e<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(e){var{x1:t,y1:r,x2:i,y2:a}=e;this.addPoint(t,r),this.addPoint(i,a)}}sumCubic(e,t,r,i,a){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*r+3*(1-e)*Math.pow(e,2)*i+Math.pow(e,3)*a}bezierCurveAdd(e,t,r,i,a){var n=6*t-12*r+6*i,s=-3*t+9*r-9*i+3*a,h=3*r-3*t;if(s===0){if(n===0)return;var u=-h/n;0<u&&u<1&&(e?this.addX(this.sumCubic(u,t,r,i,a)):this.addY(this.sumCubic(u,t,r,i,a)));return}var l=Math.pow(n,2)-4*h*s;if(!(l<0)){var g=(-n+Math.sqrt(l))/(2*s);0<g&&g<1&&(e?this.addX(this.sumCubic(g,t,r,i,a)):this.addY(this.sumCubic(g,t,r,i,a)));var c=(-n-Math.sqrt(l))/(2*s);0<c&&c<1&&(e?this.addX(this.sumCubic(c,t,r,i,a)):this.addY(this.sumCubic(c,t,r,i,a)))}}addBezierCurve(e,t,r,i,a,n,s,h){this.addPoint(e,t),this.addPoint(s,h),this.bezierCurveAdd(!0,e,r,a,s),this.bezierCurveAdd(!1,t,i,n,h)}addQuadraticCurve(e,t,r,i,a,n){var s=e+.6666666666666666*(r-e),h=t+2/3*(i-t),u=s+1/3*(a-e),l=h+1/3*(n-t);this.addBezierCurve(e,t,s,u,h,l,a,n)}isPointInBox(e,t){var{x1:r,y1:i,x2:a,y2:n}=this;return r<=e&&e<=a&&i<=t&&t<=n}}class C extends m{constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new L(0,0),this.control=new L(0,0),this.current=new L(0,0),this.points=[],this.angles=[]}isEnd(){var{i:e,commands:t}=this;return e>=t.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y",r=new L(this.command[e],this.command[t]);return this.makeAbsolute(r)}getAsControlPoint(e,t){var r=this.getPoint(e,t);return this.control=r,r}getAsCurrentPoint(e,t){var r=this.getPoint(e,t);return this.current=r,r}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==m.CURVE_TO&&e!==m.SMOOTH_CURVE_TO&&e!==m.QUAD_TO&&e!==m.SMOOTH_QUAD_TO)return this.current;var{current:{x:t,y:r},control:{x:i,y:a}}=this,n=new L(2*t-i,2*r-a);return n}makeAbsolute(e){if(this.command.relative){var{x:t,y:r}=this.current;e.x+=t,e.y+=r}return e}addMarker(e,t,r){var{points:i,angles:a}=this;r&&a.length>0&&!a[a.length-1]&&(a[a.length-1]=i[i.length-1].angleTo(r)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,t=e.length,r=0;r<t;r++)if(!e[r]){for(var i=r+1;i<t;i++)if(e[i]){e[r]=e[i];break}}return e}}class pe extends V{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var e=1,t=this;t;){var r=t.getStyle("opacity",!1,!0);r.hasValue(!0)&&(e*=r.getNumber()),t=t.parent}return e}setContext(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!t){var r=this.getStyle("fill"),i=this.getStyle("fill-opacity"),a=this.getStyle("stroke"),n=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,i);s&&(e.fillStyle=s)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());var h=r.getColor();h!=="inherit"&&(e.fillStyle=h==="none"?"rgba(0,0,0,0)":h)}if(i.hasValue()){var u=new A(this.document,"fill",e.fillStyle).addOpacity(i).getColor();e.fillStyle=u}if(a.isUrlDefinition()){var l=a.getFillStyleDefinition(this,n);l&&(e.strokeStyle=l)}else if(a.hasValue()){a.getString()==="currentColor"&&a.setValue(this.getStyle("color").getColor());var g=a.getString();g!=="inherit"&&(e.strokeStyle=g==="none"?"rgba(0,0,0,0)":g)}if(n.hasValue()){var c=new A(this.document,"stroke",e.strokeStyle).addOpacity(n).getString();e.strokeStyle=c}var f=this.getStyle("stroke-width");if(f.hasValue()){var d=f.getPixels();e.lineWidth=d||be}var v=this.getStyle("stroke-linecap"),p=this.getStyle("stroke-linejoin"),y=this.getStyle("stroke-miterlimit"),T=this.getStyle("stroke-dasharray"),b=this.getStyle("stroke-dashoffset");if(v.hasValue()&&(e.lineCap=v.getString()),p.hasValue()&&(e.lineJoin=p.getString()),y.hasValue()&&(e.miterLimit=y.getNumber()),T.hasValue()&&T.getString()!=="none"){var x=$(T.getString());typeof e.setLineDash<"u"?e.setLineDash(x):typeof e.webkitLineDash<"u"?e.webkitLineDash=x:typeof e.mozDash<"u"&&!(x.length===1&&x[0]===0)&&(e.mozDash=x);var O=b.getPixels();typeof e.lineDashOffset<"u"?e.lineDashOffset=O:typeof e.webkitLineDashOffset<"u"?e.webkitLineDashOffset=O:typeof e.mozDashOffset<"u"&&(e.mozDashOffset=O)}}if(this.modifiedEmSizeStack=!1,typeof e.font<"u"){var E=this.getStyle("font"),w=this.getStyle("font-style"),S=this.getStyle("font-variant"),R=this.getStyle("font-weight"),D=this.getStyle("font-size"),_=this.getStyle("font-family"),M=new j(w.getString(),S.getString(),R.getString(),D.hasValue()?"".concat(D.getPixels(!0),"px"):"",_.getString(),j.parse(E.getString(),e.font));w.setValue(M.fontStyle),S.setValue(M.fontVariant),R.setValue(M.fontWeight),D.setValue(M.fontSize),_.setValue(M.fontFamily),e.font=M.toString(),D.isPixels()&&(this.document.emSize=D.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class N extends pe{constructor(e,t,r){super(e,t,r),this.type="path",this.pathParser=null,this.pathParser=new C(this.getAttribute("d").getString())}path(e){var{pathParser:t}=this,r=new K;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case C.MOVE_TO:this.pathM(e,r);break;case C.LINE_TO:this.pathL(e,r);break;case C.HORIZ_LINE_TO:this.pathH(e,r);break;case C.VERT_LINE_TO:this.pathV(e,r);break;case C.CURVE_TO:this.pathC(e,r);break;case C.SMOOTH_CURVE_TO:this.pathS(e,r);break;case C.QUAD_TO:this.pathQ(e,r);break;case C.SMOOTH_QUAD_TO:this.pathT(e,r);break;case C.ARC:this.pathA(e,r);break;case C.CLOSE_PATH:this.pathZ(e,r);break}return r}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,t=e.getMarkerPoints(),r=e.getMarkerAngles(),i=t.map((a,n)=>[a,r[n]]);return i}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle("fill-rule");e.fillStyle!==""&&(t.getString("inherit")!=="inherit"?e.fill(t.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var r=this.getMarkers();if(r){var i=r.length-1,a=this.getStyle("marker-start"),n=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(a.isUrlDefinition()){var h=a.getDefinition(),[u,l]=r[0];h.render(e,u,l)}if(n.isUrlDefinition())for(var g=n.getDefinition(),c=1;c<i;c++){var[f,d]=r[c];g.render(e,f,d)}if(s.isUrlDefinition()){var v=s.getDefinition(),[p,y]=r[i];v.render(e,p,y)}}}static pathM(e){var t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}pathM(e,t){var{pathParser:r}=this,{point:i}=N.pathM(r),{x:a,y:n}=i;r.addMarker(i),t.addPoint(a,n),e&&e.moveTo(a,n)}static pathL(e){var{current:t}=e,r=e.getAsCurrentPoint();return{current:t,point:r}}pathL(e,t){var{pathParser:r}=this,{current:i,point:a}=N.pathL(r),{x:n,y:s}=a;r.addMarker(a,i),t.addPoint(n,s),e&&e.lineTo(n,s)}static pathH(e){var{current:t,command:r}=e,i=new L((r.relative?t.x:0)+r.x,t.y);return e.current=i,{current:t,point:i}}pathH(e,t){var{pathParser:r}=this,{current:i,point:a}=N.pathH(r),{x:n,y:s}=a;r.addMarker(a,i),t.addPoint(n,s),e&&e.lineTo(n,s)}static pathV(e){var{current:t,command:r}=e,i=new L(t.x,(r.relative?t.y:0)+r.y);return e.current=i,{current:t,point:i}}pathV(e,t){var{pathParser:r}=this,{current:i,point:a}=N.pathV(r),{x:n,y:s}=a;r.addMarker(a,i),t.addPoint(n,s),e&&e.lineTo(n,s)}static pathC(e){var{current:t}=e,r=e.getPoint("x1","y1"),i=e.getAsControlPoint("x2","y2"),a=e.getAsCurrentPoint();return{current:t,point:r,controlPoint:i,currentPoint:a}}pathC(e,t){var{pathParser:r}=this,{current:i,point:a,controlPoint:n,currentPoint:s}=N.pathC(r);r.addMarker(s,n,a),t.addBezierCurve(i.x,i.y,a.x,a.y,n.x,n.y,s.x,s.y),e&&e.bezierCurveTo(a.x,a.y,n.x,n.y,s.x,s.y)}static pathS(e){var{current:t}=e,r=e.getReflectedControlPoint(),i=e.getAsControlPoint("x2","y2"),a=e.getAsCurrentPoint();return{current:t,point:r,controlPoint:i,currentPoint:a}}pathS(e,t){var{pathParser:r}=this,{current:i,point:a,controlPoint:n,currentPoint:s}=N.pathS(r);r.addMarker(s,n,a),t.addBezierCurve(i.x,i.y,a.x,a.y,n.x,n.y,s.x,s.y),e&&e.bezierCurveTo(a.x,a.y,n.x,n.y,s.x,s.y)}static pathQ(e){var{current:t}=e,r=e.getAsControlPoint("x1","y1"),i=e.getAsCurrentPoint();return{current:t,controlPoint:r,currentPoint:i}}pathQ(e,t){var{pathParser:r}=this,{current:i,controlPoint:a,currentPoint:n}=N.pathQ(r);r.addMarker(n,a,a),t.addQuadraticCurve(i.x,i.y,a.x,a.y,n.x,n.y),e&&e.quadraticCurveTo(a.x,a.y,n.x,n.y)}static pathT(e){var{current:t}=e,r=e.getReflectedControlPoint();e.control=r;var i=e.getAsCurrentPoint();return{current:t,controlPoint:r,currentPoint:i}}pathT(e,t){var{pathParser:r}=this,{current:i,controlPoint:a,currentPoint:n}=N.pathT(r);r.addMarker(n,a,a),t.addQuadraticCurve(i.x,i.y,a.x,a.y,n.x,n.y),e&&e.quadraticCurveTo(a.x,a.y,n.x,n.y)}static pathA(e){var{current:t,command:r}=e,{rX:i,rY:a,xRot:n,lArcFlag:s,sweepFlag:h}=r,u=n*(Math.PI/180),l=e.getAsCurrentPoint(),g=new L(Math.cos(u)*(t.x-l.x)/2+Math.sin(u)*(t.y-l.y)/2,-Math.sin(u)*(t.x-l.x)/2+Math.cos(u)*(t.y-l.y)/2),c=Math.pow(g.x,2)/Math.pow(i,2)+Math.pow(g.y,2)/Math.pow(a,2);c>1&&(i*=Math.sqrt(c),a*=Math.sqrt(c));var f=(s===h?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(a,2)-Math.pow(i,2)*Math.pow(g.y,2)-Math.pow(a,2)*Math.pow(g.x,2))/(Math.pow(i,2)*Math.pow(g.y,2)+Math.pow(a,2)*Math.pow(g.x,2)));isNaN(f)&&(f=0);var d=new L(f*i*g.y/a,f*-a*g.x/i),v=new L((t.x+l.x)/2+Math.cos(u)*d.x-Math.sin(u)*d.y,(t.y+l.y)/2+Math.sin(u)*d.x+Math.cos(u)*d.y),p=Rt([1,0],[(g.x-d.x)/i,(g.y-d.y)/a]),y=[(g.x-d.x)/i,(g.y-d.y)/a],T=[(-g.x-d.x)/i,(-g.y-d.y)/a],b=Rt(y,T);return nt(y,T)<=-1&&(b=Math.PI),nt(y,T)>=1&&(b=0),{currentPoint:l,rX:i,rY:a,sweepFlag:h,xAxisRotation:u,centp:v,a1:p,ad:b}}pathA(e,t){var{pathParser:r}=this,{currentPoint:i,rX:a,rY:n,sweepFlag:s,xAxisRotation:h,centp:u,a1:l,ad:g}=N.pathA(r),c=1-s?1:-1,f=l+c*(g/2),d=new L(u.x+a*Math.cos(f),u.y+n*Math.sin(f));if(r.addMarkerAngle(d,f-c*Math.PI/2),r.addMarkerAngle(i,f-c*Math.PI),t.addPoint(i.x,i.y),e&&!isNaN(l)&&!isNaN(g)){var v=a>n?a:n,p=a>n?1:a/n,y=a>n?n/a:1;e.translate(u.x,u.y),e.rotate(h),e.scale(p,y),e.arc(0,0,v,l,l+g,!!(1-s)),e.scale(1/p,1/y),e.rotate(-h),e.translate(-u.x,-u.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){N.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}class Kt extends N{constructor(e,t,r){super(e,t,r),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class he extends pe{constructor(e,t,r){super(e,t,new.target===he?!0:r),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(e,t);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(e.textBaseline=r)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var t=null;return this.children.forEach((r,i)=>{var a=this.getChildBoundingBox(e,this,this,i);t?t.addBoundingBox(a):t=a}),t}getFontSize(){var{document:e,parent:t}=this,r=j.parse(e.ctx.font).fontSize,i=t.getStyle("font-size").getNumber(r);return i}getTElementBoundingBox(e){var t=this.getFontSize();return new K(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,r){var i=t[r],a=null;if(e.isArabic){var n=t.length,s=t[r-1],h=t[r+1],u="isolated";if((r===0||s===" ")&&r<n-1&&h!==" "&&(u="terminal"),r>0&&s!==" "&&r<n-1&&h!==" "&&(u="medial"),r>0&&s!==" "&&(r===n-1||h===" ")&&(u="initial"),typeof e.glyphs[i]<"u"){var l=e.glyphs[i];a=l instanceof Kt?l:l[u]}}else a=e.glyphs[i];return a||(a=e.missingGlyph),a}getText(){return""}getTextFromNode(e){var t=e||this.node,r=Array.from(t.parentNode.childNodes),i=r.indexOf(t),a=r.length-1,n=xe(t.textContent||"");return i===0&&(n=Fr(n)),i===a&&(n=Ur(n)),n}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((r,i)=>{this.renderChild(e,this,this,i)});var{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){var{document:t,parent:r}=this,i=this.getText(),a=r.getStyle("font-family").getDefinition();if(a){for(var{unitsPerEm:n}=a.fontFace,s=j.parse(t.ctx.font),h=r.getStyle("font-size").getNumber(s.fontSize),u=r.getStyle("font-style").getString(s.fontStyle),l=h/n,g=a.isRTL?i.split("").reverse().join(""):i,c=$(r.getAttribute("dx").getString()),f=g.length,d=0;d<f;d++){var v=this.getGlyph(a,g,d);e.translate(this.x,this.y),e.scale(l,-l);var p=e.lineWidth;e.lineWidth=e.lineWidth*n/h,u==="italic"&&e.transform(1,0,.4,1,0,0),v.render(e),u==="italic"&&e.transform(1,0,-.4,1,0,0),e.lineWidth=p,e.scale(1/l,-1/l),e.translate(-this.x,-this.y),this.x+=h*(v.horizAdvX||a.horizAdvX)/n,typeof c[d]<"u"&&!isNaN(c[d])&&(this.x+=c[d])}return}var{x:y,y:T}=this;e.fillStyle&&e.fillText(i,y,T),e.strokeStyle&&e.strokeText(i,y,T)}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),r=!1,i=0;t==="start"&&!r||t==="end"&&r?i=e.x-this.minX:t==="end"&&!r||t==="start"&&r?i=e.x-this.maxX:i=e.x-(this.minX+this.maxX)/2;for(var a=this.textChunkStart;a<this.leafTexts.length;a++)this.leafTexts[a].x+=i;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(e){this.children.forEach((t,r)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,r)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,r,i){var a=r.children[i];a.children.length>0?a.children.forEach((n,s)=>{t.adjustChildCoordinatesRecursiveCore(e,t,a,s)}):this.adjustChildCoordinates(e,t,r,i)}adjustChildCoordinates(e,t,r,i){var a=r.children[i];if(typeof a.measureText!="function")return a;e.save(),a.setContext(e,!0);var n=a.getAttribute("x"),s=a.getAttribute("y"),h=a.getAttribute("dx"),u=a.getAttribute("dy"),l=a.getStyle("font-family").getDefinition(),g=!!l&&l.isRTL;i===0&&(n.hasValue()||n.setValue(a.getInheritedAttribute("x")),s.hasValue()||s.setValue(a.getInheritedAttribute("y")),h.hasValue()||h.setValue(a.getInheritedAttribute("dx")),u.hasValue()||u.setValue(a.getInheritedAttribute("dy")));var c=a.measureText(e);return g&&(t.x-=c),n.hasValue()?(t.applyAnchoring(),a.x=n.getPixels("x"),h.hasValue()&&(a.x+=h.getPixels("x"))):(h.hasValue()&&(t.x+=h.getPixels("x")),a.x=t.x),t.x=a.x,g||(t.x+=c),s.hasValue()?(a.y=s.getPixels("y"),u.hasValue()&&(a.y+=u.getPixels("y"))):(u.hasValue()&&(t.y+=u.getPixels("y")),a.y=t.y),t.y=a.y,t.leafTexts.push(a),t.minX=Math.min(t.minX,a.x,a.x+c),t.maxX=Math.max(t.maxX,a.x,a.x+c),a.clearContext(e),e.restore(),a}getChildBoundingBox(e,t,r,i){var a=r.children[i];if(typeof a.getBoundingBox!="function")return null;var n=a.getBoundingBox(e);return n?(a.children.forEach((s,h)=>{var u=t.getChildBoundingBox(e,t,a,h);n.addBoundingBox(u)}),n):null}renderChild(e,t,r,i){var a=r.children[i];a.render(e),a.children.forEach((n,s)=>{t.renderChild(e,t,a,s)})}measureText(e){var{measureCache:t}=this;if(~t)return t;var r=this.getText(),i=this.measureTargetText(e,r);return this.measureCache=i,i}measureTargetText(e,t){if(!t.length)return 0;var{parent:r}=this,i=r.getStyle("font-family").getDefinition();if(i){for(var a=this.getFontSize(),n=i.isRTL?t.split("").reverse().join(""):t,s=$(r.getAttribute("dx").getString()),h=n.length,u=0,l=0;l<h;l++){var g=this.getGlyph(i,n,l);u+=(g.horizAdvX||i.horizAdvX)*a/i.fontFace.unitsPerEm,typeof s[l]<"u"&&!isNaN(s[l])&&(u+=s[l])}return u}if(!e.measureText)return t.length*10;e.save(),this.setContext(e,!0);var{width:c}=e.measureText(t);return this.clearContext(e),e.restore(),c}getInheritedAttribute(e){for(var t=this;t instanceof he&&t.isFirstChild();){var r=t.parent.getAttribute(e);if(r.hasValue(!0))return r.getValue("0");t=t.parent}return null}}class Be extends he{constructor(e,t,r){super(e,t,new.target===Be?!0:r),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class di extends Be{constructor(){super(...arguments),this.type="textNode"}}class Te extends pe{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(e){var t,{document:r}=this,{screen:i,window:a}=r,n=e.canvas;if(i.setDefaults(e),n.style&&typeof e.font<"u"&&a&&typeof a.getComputedStyle<"u"){e.font=a.getComputedStyle(n).getPropertyValue("font");var s=new A(r,"fontSize",j.parse(e.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:h,height:u}=i.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var l=this.getAttribute("refX"),g=this.getAttribute("refY"),c=this.getAttribute("viewBox"),f=c.hasValue()?$(c.getString()):null,d=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible",v=0,p=0,y=0,T=0;f&&(v=f[0],p=f[1]),this.root||(h=this.getStyle("width").getPixels("x"),u=this.getStyle("height").getPixels("y"),this.type==="marker"&&(y=v,T=p,v=0,p=0)),i.viewPort.setCurrent(h,u),this.node&&(!this.parent||((t=this.node.parentNode)===null||t===void 0?void 0:t.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),f&&(h=f[2],u=f[3]),r.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:h,height:i.viewPort.height,desiredHeight:u,minX:v,minY:p,refX:l.getValue(),refY:g.getValue(),clip:d,clipX:y,clipY:T}),f&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(h,u))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.getAttribute("width",!0),a=this.getAttribute("height",!0),n=this.getAttribute("viewBox"),s=this.getAttribute("style"),h=i.getNumber(0),u=a.getNumber(0);if(r)if(typeof r=="string")this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var l=this.getAttribute("preserveAspectRatio");l.hasValue()&&l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(e),a.setValue(t),n.hasValue()||n.setValue("0 0 ".concat(h||e," ").concat(u||t)),s.hasValue()){var g=this.getStyle("width"),c=this.getStyle("height");g.hasValue()&&g.setValue("".concat(e,"px")),c.hasValue()&&c.setValue("".concat(t,"px"))}}}class er extends N{constructor(){super(...arguments),this.type="rect"}path(e){var t=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),i=this.getStyle("width",!1,!0).getPixels("x"),a=this.getStyle("height",!1,!0).getPixels("y"),n=this.getAttribute("rx"),s=this.getAttribute("ry"),h=n.getPixels("x"),u=s.getPixels("y");if(n.hasValue()&&!s.hasValue()&&(u=h),s.hasValue()&&!n.hasValue()&&(h=u),h=Math.min(h,i/2),u=Math.min(u,a/2),e){var l=4*((Math.sqrt(2)-1)/3);e.beginPath(),a>0&&i>0&&(e.moveTo(t+h,r),e.lineTo(t+i-h,r),e.bezierCurveTo(t+i-h+l*h,r,t+i,r+u-l*u,t+i,r+u),e.lineTo(t+i,r+a-u),e.bezierCurveTo(t+i,r+a-u+l*u,t+i-h+l*h,r+a,t+i-h,r+a),e.lineTo(t+h,r+a),e.bezierCurveTo(t+h-l*h,r+a,t,r+a-u+l*u,t,r+a-u),e.lineTo(t,r+u),e.bezierCurveTo(t,r+u-l*u,t+h-l*h,r,t+h,r),e.closePath())}return new K(t,r,t+i,r+a)}getMarkers(){return null}}class pi extends N{constructor(){super(...arguments),this.type="circle"}path(e){var t=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),i=this.getAttribute("r").getPixels();return e&&i>0&&(e.beginPath(),e.arc(t,r,i,0,Math.PI*2,!1),e.closePath()),new K(t-i,r-i,t+i,r+i)}getMarkers(){return null}}class mi extends N{constructor(){super(...arguments),this.type="ellipse"}path(e){var t=4*((Math.sqrt(2)-1)/3),r=this.getAttribute("rx").getPixels("x"),i=this.getAttribute("ry").getPixels("y"),a=this.getAttribute("cx").getPixels("x"),n=this.getAttribute("cy").getPixels("y");return e&&r>0&&i>0&&(e.beginPath(),e.moveTo(a+r,n),e.bezierCurveTo(a+r,n+t*i,a+t*r,n+i,a,n+i),e.bezierCurveTo(a-t*r,n+i,a-r,n+t*i,a-r,n),e.bezierCurveTo(a-r,n-t*i,a-t*r,n-i,a,n-i),e.bezierCurveTo(a+t*r,n-i,a+r,n-t*i,a+r,n),e.closePath()),new K(a-r,n-i,a+r,n+i)}getMarkers(){return null}}class yi extends N{constructor(){super(...arguments),this.type="line"}getPoints(){return[new L(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new L(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){var[{x:t,y:r},{x:i,y:a}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,r),e.lineTo(i,a)),new K(t,r,i,a)}getMarkers(){var[e,t]=this.getPoints(),r=e.angleTo(t);return[[e,r],[t,r]]}}class tr extends N{constructor(e,t,r){super(e,t,r),this.type="polyline",this.points=[],this.points=L.parsePath(this.getAttribute("points").getString())}path(e){var{points:t}=this,[{x:r,y:i}]=t,a=new K(r,i);return e&&(e.beginPath(),e.moveTo(r,i)),t.forEach(n=>{var{x:s,y:h}=n;a.addPoint(s,h),e&&e.lineTo(s,h)}),a}getMarkers(){var{points:e}=this,t=e.length-1,r=[];return e.forEach((i,a)=>{a!==t&&r.push([i,i.angleTo(e[a+1])])}),r.length>0&&r.push([e[e.length-1],r[r.length-1][1]]),r}}class bi extends tr{constructor(){super(...arguments),this.type="polygon"}path(e){var t=super.path(e),[{x:r,y:i}]=this.points;return e&&(e.lineTo(r,i),e.closePath()),t}}class xi extends V{constructor(){super(...arguments),this.type="pattern"}createPattern(e,t,r){var i=this.getStyle("width").getPixels("x",!0),a=this.getStyle("height").getPixels("y",!0),n=new Te(this.document,null);n.attributes.viewBox=new A(this.document,"viewBox",this.getAttribute("viewBox").getValue()),n.attributes.width=new A(this.document,"width","".concat(i,"px")),n.attributes.height=new A(this.document,"height","".concat(a,"px")),n.attributes.transform=new A(this.document,"transform",this.getAttribute("patternTransform").getValue()),n.children=this.children;var s=this.document.createCanvas(i,a),h=s.getContext("2d"),u=this.getAttribute("x"),l=this.getAttribute("y");u.hasValue()&&l.hasValue()&&h.translate(u.getPixels("x",!0),l.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var g=-1;g<=1;g++)for(var c=-1;c<=1;c++)h.save(),n.attributes.x=new A(this.document,"x",g*s.width),n.attributes.y=new A(this.document,"y",c*s.height),n.render(h),h.restore();var f=e.createPattern(s,"repeat");return f}}class wi extends V{constructor(){super(...arguments),this.type="marker"}render(e,t,r){if(t){var{x:i,y:a}=t,n=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(i,a),n==="auto"&&e.rotate(r),s==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();var h=new Te(this.document,null);h.type=this.type,h.attributes.viewBox=new A(this.document,"viewBox",this.getAttribute("viewBox").getValue()),h.attributes.refX=new A(this.document,"refX",this.getAttribute("refX").getValue()),h.attributes.refY=new A(this.document,"refY",this.getAttribute("refY").getValue()),h.attributes.width=new A(this.document,"width",this.getAttribute("markerWidth").getValue()),h.attributes.height=new A(this.document,"height",this.getAttribute("markerHeight").getValue()),h.attributes.overflow=new A(this.document,"overflow",this.getAttribute("overflow").getValue()),h.attributes.fill=new A(this.document,"fill",this.getAttribute("fill").getColor("black")),h.attributes.stroke=new A(this.document,"stroke",this.getAttribute("stroke").getValue("none")),h.children=this.children,h.render(e),e.restore(),s==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),n==="auto"&&e.rotate(-r),e.translate(-i,-a)}}}class Ai extends V{constructor(){super(...arguments),this.type="defs"}render(){}}class ut extends pe{constructor(){super(...arguments),this.type="g"}getBoundingBox(e){var t=new K;return this.children.forEach(r=>{t.addBoundingBox(r.getBoundingBox(e))}),t}}class rr extends V{constructor(e,t,r){super(e,t,r),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:i,children:a}=this;a.forEach(n=>{n.type==="stop"&&i.push(n)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,r){var i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var{stops:a}=i,n=this.getGradient(e,t);if(!n)return this.addParentOpacity(r,a[a.length-1].color);if(a.forEach(p=>{n.addColorStop(p.offset,this.addParentOpacity(r,p.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:h,viewPort:u}=s.screen,[l]=u.viewPorts,g=new er(s,null);g.attributes.x=new A(s,"x",-h/3),g.attributes.y=new A(s,"y",-h/3),g.attributes.width=new A(s,"width",h),g.attributes.height=new A(s,"height",h);var c=new ut(s,null);c.attributes.transform=new A(s,"transform",this.getAttribute("gradientTransform").getValue()),c.children=[g];var f=new Te(s,null);f.attributes.x=new A(s,"x",0),f.attributes.y=new A(s,"y",0),f.attributes.width=new A(s,"width",l.width),f.attributes.height=new A(s,"height",l.height),f.children=[c];var d=s.createCanvas(l.width,l.height),v=d.getContext("2d");return v.fillStyle=n,f.render(v),v.createPattern(d,"no-repeat")}return n}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){if(e.hasValue()){var r=new A(this.document,"color",t);return r.addOpacity(e).getColor()}return t}}class Ti extends rr{constructor(e,t,r){super(e,t,r),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,t){var r=this.getGradientUnits()==="objectBoundingBox",i=r?t.getBoundingBox(e):null;if(r&&!i)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var a=r?i.x+i.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),n=r?i.y+i.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?i.x+i.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),h=r?i.y+i.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return a===s&&n===h?null:e.createLinearGradient(a,n,s,h)}}class Ci extends rr{constructor(e,t,r){super(e,t,r),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,t){var r=this.getGradientUnits()==="objectBoundingBox",i=t.getBoundingBox(e);if(r&&!i)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var a=r?i.x+i.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),n=r?i.y+i.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=a,h=n;this.getAttribute("fx").hasValue()&&(s=r?i.x+i.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(h=r?i.y+i.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var u=r?(i.width+i.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),l=this.getAttribute("fr").getPixels();return e.createRadialGradient(s,h,l,a,n,u)}}class Ei extends V{constructor(e,t,r){super(e,t,r),this.type="stop";var i=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),a=this.getStyle("stop-opacity"),n=this.getStyle("stop-color",!0);n.getString()===""&&n.setValue("#000"),a.hasValue()&&(n=n.addOpacity(a)),this.offset=i,this.color=n.getColor()}}class lt extends V{constructor(e,t,r){super(e,t,r),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new A(e,"values",null);var i=this.getAttribute("values");i.hasValue()&&this.values.setValue(i.getString().split(";"))}getProperty(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){var{initialUnits:e}=this,{progress:t,from:r,to:i}=this.getProgress(),a=r.getNumber()+(i.getNumber()-r.getNumber())*t;return e==="%"&&(a*=100),"".concat(a).concat(e)}update(e){var{parent:t}=this,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var i=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(i==="freeze"&&!this.frozen)this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=r.getString();else if(i==="remove"&&!this.removed)return this.removed=!0,r.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;var a=!1;if(this.begin<this.duration){var n=this.calcValue(),s=this.getAttribute("type");if(s.hasValue()){var h=s.getString();n="".concat(h,"(").concat(n,")")}r.setValue(n),a=!0}return a}getProgress(){var{document:e,values:t}=this,r={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(t.hasValue()){var i=r.progress*(t.getValue().length-1),a=Math.floor(i),n=Math.ceil(i);r.from=new A(e,"from",parseFloat(t.getValue()[a])),r.to=new A(e,"to",parseFloat(t.getValue()[n])),r.progress=(i-a)/(n-a)}else r.from=this.from,r.to=this.to;return r}}class Oi extends lt{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:e,from:t,to:r}=this.getProgress(),i=new at(t.getColor()),a=new at(r.getColor());if(i.ok&&a.ok){var n=i.r+(a.r-i.r)*e,s=i.g+(a.g-i.g)*e,h=i.b+(a.b-i.b)*e;return"rgb(".concat(Math.floor(n),", ").concat(Math.floor(s),", ").concat(Math.floor(h),")")}return this.getAttribute("from").getColor()}}class Si extends lt{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:e,from:t,to:r}=this.getProgress(),i=$(t.getString()),a=$(r.getString()),n=i.map((s,h)=>{var u=a[h];return s+(u-s)*e}).join(" ");return n}}class Ni extends V{constructor(e,t,r){super(e,t,r),this.type="font",this.glyphs=Object.create(null),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:i}=e,{children:a}=this;for(var n of a)switch(n.type){case"font-face":{this.fontFace=n;var s=n.getStyle("font-family");s.hasValue()&&(i[s.getString()]=this);break}case"missing-glyph":this.missingGlyph=n;break;case"glyph":{var h=n;h.arabicForm?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[h.unicode]>"u"&&(this.glyphs[h.unicode]=Object.create(null)),this.glyphs[h.unicode][h.arabicForm]=h):this.glyphs[h.unicode]=h;break}}}render(){}}class Mi extends V{constructor(e,t,r){super(e,t,r),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class Pi extends N{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class Vi extends he{constructor(){super(...arguments),this.type="tref"}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}}class Ri extends he{constructor(e,t,r){super(e,t,r),this.type="a";var{childNodes:i}=t,a=i[0],n=i.length>0&&Array.from(i).every(s=>s.nodeType===3);this.hasText=n,this.text=n?this.getTextFromNode(a):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:t,x:r,y:i}=this,{mouse:a}=t.screen,n=new A(t,"fontSize",j.parse(t.ctx.font).fontSize);a.isWorking()&&a.checkBoundingBox(this,new K(r,i-n.getPixels("y"),r+this.measureText(e),i))}else if(this.children.length>0){var s=new ut(this.document,null);s.children=this.children,s.parent=this,s.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){var e=this.document.ctx;e.canvas.style.cursor="pointer"}}function Ft(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),t.push.apply(t,r)}return t}function ke(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ft(Object(t),!0).forEach(function(r){ot(o,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Ft(Object(t)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(t,r))})}return o}class ki extends he{constructor(e,t,r){super(e,t,r),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var i=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(i)}getText(){return this.text}path(e){var{dataArray:t}=this;e&&e.beginPath(),t.forEach(r=>{var{type:i,points:a}=r;switch(i){case C.LINE_TO:e&&e.lineTo(a[0],a[1]);break;case C.MOVE_TO:e&&e.moveTo(a[0],a[1]);break;case C.CURVE_TO:e&&e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case C.QUAD_TO:e&&e.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case C.ARC:{var[n,s,h,u,l,g,c,f]=a,d=h>u?h:u,v=h>u?1:h/u,p=h>u?u/h:1;e&&(e.translate(n,s),e.rotate(c),e.scale(v,p),e.arc(0,0,d,l,l+g,!!(1-f)),e.scale(1/v,1/p),e.rotate(-c),e.translate(-n,-s));break}case C.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),{glyphInfo:i}=this,a=e.fillStyle;t==="underline"&&e.beginPath(),i.forEach((n,s)=>{var{p0:h,p1:u,rotation:l,text:g}=n;e.save(),e.translate(h.x,h.y),e.rotate(l),e.fillStyle&&e.fillText(g,0,0),e.strokeStyle&&e.strokeText(g,0,0),e.restore(),t==="underline"&&(s===0&&e.moveTo(h.x,h.y+r/8),e.lineTo(u.x,u.y+r/5))}),t==="underline"&&(e.lineWidth=r/20,e.strokeStyle=a,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,r,i,a,n,s,h,u){var l=n,g=this.measureText(e,h);h===" "&&t==="justify"&&r<i&&(g+=(i-r)/a),u>-1&&(l+=this.getLetterSpacingAt(u));var c=this.textHeight/20,f=this.getEquidistantPointOnPath(l,c,0),d=this.getEquidistantPointOnPath(l+g,c,0),v={p0:f,p1:d},p=f&&d?Math.atan2(d.y-f.y,d.x-f.x):0;if(s){var y=Math.cos(Math.PI/2+p)*s,T=Math.cos(-p)*s;v.p0=ke(ke({},f),{},{x:f.x+y,y:f.y+T}),v.p1=ke(ke({},d),{},{x:d.x+y,y:d.y+T})}return l+=g,{offset:l,segment:v,rotation:p}}measureText(e,t){var{measuresCache:r}=this,i=t||this.getText();if(r.has(i))return r.get(i);var a=this.measureTargetText(e,i);return r.set(i,a),a}setTextData(e){if(!this.glyphInfo){var t=this.getText(),r=t.split(""),i=t.split(" ").length-1,a=this.parent.getAttribute("dx").split().map(x=>x.getPixels("x")),n=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),h=this.getStyle("letter-spacing"),u=this.parent.getStyle("letter-spacing"),l=0;!h.hasValue()||h.getValue()==="inherit"?l=u.getPixels():h.hasValue()&&h.getValue()!=="initial"&&h.getValue()!=="unset"&&(l=h.getPixels());var g=[],c=t.length;this.letterSpacingCache=g;for(var f=0;f<c;f++)g.push(typeof a[f]<"u"?a[f]:l);var d=g.reduce((x,O,E)=>E===0?0:x+O||0,0),v=this.measureText(e),p=Math.max(v+d,0);this.textWidth=v,this.textHeight=this.getFontSize(),this.glyphInfo=[];var y=this.getPathLength(),T=this.getStyle("startOffset").getNumber(0)*y,b=0;(s==="middle"||s==="center")&&(b=-p/2),(s==="end"||s==="right")&&(b=-p),b+=T,r.forEach((x,O)=>{var{offset:E,segment:w,rotation:S}=this.findSegmentToFitChar(e,s,p,y,i,b,n,x,O);b=E,!(!w.p0||!w.p1)&&this.glyphInfo.push({text:r[O],p0:w.p0,p1:w.p1,rotation:S})})}}parsePathData(e){if(this.pathLength=-1,!e)return[];var t=[],{pathParser:r}=e;for(r.reset();!r.isEnd();){var{current:i}=r,a=i?i.x:0,n=i?i.y:0,s=r.next(),h=s.type,u=[];switch(s.type){case C.MOVE_TO:this.pathM(r,u);break;case C.LINE_TO:h=this.pathL(r,u);break;case C.HORIZ_LINE_TO:h=this.pathH(r,u);break;case C.VERT_LINE_TO:h=this.pathV(r,u);break;case C.CURVE_TO:this.pathC(r,u);break;case C.SMOOTH_CURVE_TO:h=this.pathS(r,u);break;case C.QUAD_TO:this.pathQ(r,u);break;case C.SMOOTH_QUAD_TO:h=this.pathT(r,u);break;case C.ARC:u=this.pathA(r);break;case C.CLOSE_PATH:N.pathZ(r);break}s.type!==C.CLOSE_PATH?t.push({type:h,points:u,start:{x:a,y:n},pathLength:this.calcLength(a,n,h,u)}):t.push({type:C.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){var{x:r,y:i}=N.pathM(e).point;t.push(r,i)}pathL(e,t){var{x:r,y:i}=N.pathL(e).point;return t.push(r,i),C.LINE_TO}pathH(e,t){var{x:r,y:i}=N.pathH(e).point;return t.push(r,i),C.LINE_TO}pathV(e,t){var{x:r,y:i}=N.pathV(e).point;return t.push(r,i),C.LINE_TO}pathC(e,t){var{point:r,controlPoint:i,currentPoint:a}=N.pathC(e);t.push(r.x,r.y,i.x,i.y,a.x,a.y)}pathS(e,t){var{point:r,controlPoint:i,currentPoint:a}=N.pathS(e);return t.push(r.x,r.y,i.x,i.y,a.x,a.y),C.CURVE_TO}pathQ(e,t){var{controlPoint:r,currentPoint:i}=N.pathQ(e);t.push(r.x,r.y,i.x,i.y)}pathT(e,t){var{controlPoint:r,currentPoint:i}=N.pathT(e);return t.push(r.x,r.y,i.x,i.y),C.QUAD_TO}pathA(e){var{rX:t,rY:r,sweepFlag:i,xAxisRotation:a,centp:n,a1:s,ad:h}=N.pathA(e);return i===0&&h>0&&(h-=2*Math.PI),i===1&&h<0&&(h+=2*Math.PI),[n.x,n.y,t,r,s,h,a,i]}calcLength(e,t,r,i){var a=0,n=null,s=null,h=0;switch(r){case C.LINE_TO:return this.getLineLength(e,t,i[0],i[1]);case C.CURVE_TO:for(a=0,n=this.getPointOnCubicBezier(0,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),h=.01;h<=1;h+=.01)s=this.getPointOnCubicBezier(h,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),a+=this.getLineLength(n.x,n.y,s.x,s.y),n=s;return a;case C.QUAD_TO:for(a=0,n=this.getPointOnQuadraticBezier(0,e,t,i[0],i[1],i[2],i[3]),h=.01;h<=1;h+=.01)s=this.getPointOnQuadraticBezier(h,e,t,i[0],i[1],i[2],i[3]),a+=this.getLineLength(n.x,n.y,s.x,s.y),n=s;return a;case C.ARC:{a=0;var u=i[4],l=i[5],g=i[4]+l,c=Math.PI/180;if(Math.abs(u-g)<c&&(c=Math.abs(u-g)),n=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),l<0)for(h=u-c;h>g;h-=c)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],h,0),a+=this.getLineLength(n.x,n.y,s.x,s.y),n=s;else for(h=u+c;h<g;h+=c)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],h,0),a+=this.getLineLength(n.x,n.y,s.x,s.y),n=s;return s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],g,0),a+=this.getLineLength(n.x,n.y,s.x,s.y),a}}return 0}getPointOnLine(e,t,r,i,a){var n=arguments.length>5&&arguments[5]!==void 0?arguments[5]:t,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:r,h=(a-r)/(i-t+be),u=Math.sqrt(e*e/(1+h*h));i<t&&(u*=-1);var l=h*u,g=null;if(i===t)g={x:n,y:s+l};else if((s-r)/(n-t+be)===h)g={x:n+u,y:s+l};else{var c=0,f=0,d=this.getLineLength(t,r,i,a);if(d<be)return null;var v=(n-t)*(i-t)+(s-r)*(a-r);v/=d*d,c=t+v*(i-t),f=r+v*(a-r);var p=this.getLineLength(n,s,c,f),y=Math.sqrt(e*e-p*p);u=Math.sqrt(y*y/(1+h*h)),i<t&&(u*=-1),l=h*u,g={x:c+u,y:f+l}}return g}getPointOnPath(e){var t=this.getPathLength(),r=0,i=null;if(e<-5e-5||e-5e-5>t)return null;var{dataArray:a}=this;for(var n of a){if(n&&(n.pathLength<5e-5||r+n.pathLength+5e-5<e)){r+=n.pathLength;continue}var s=e-r,h=0;switch(n.type){case C.LINE_TO:i=this.getPointOnLine(s,n.start.x,n.start.y,n.points[0],n.points[1],n.start.x,n.start.y);break;case C.ARC:{var u=n.points[4],l=n.points[5],g=n.points[4]+l;if(h=u+s/n.pathLength*l,l<0&&h<g||l>=0&&h>g)break;i=this.getPointOnEllipticalArc(n.points[0],n.points[1],n.points[2],n.points[3],h,n.points[6]);break}case C.CURVE_TO:h=s/n.pathLength,h>1&&(h=1),i=this.getPointOnCubicBezier(h,n.start.x,n.start.y,n.points[0],n.points[1],n.points[2],n.points[3],n.points[4],n.points[5]);break;case C.QUAD_TO:h=s/n.pathLength,h>1&&(h=1),i=this.getPointOnQuadraticBezier(h,n.start.x,n.start.y,n.points[0],n.points[1],n.points[2],n.points[3]);break}if(i)return i;break}return null}getLineLength(e,t,r,i){return Math.sqrt((r-e)*(r-e)+(i-t)*(i-t))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,r,i,a,n,s,h,u){var l=h*kt(e)+n*Dt(e)+i*Lt(e)+t*_t(e),g=u*kt(e)+s*Dt(e)+a*Lt(e)+r*_t(e);return{x:l,y:g}}getPointOnQuadraticBezier(e,t,r,i,a,n,s){var h=n*It(e)+i*Bt(e)+t*zt(e),u=s*It(e)+a*Bt(e)+r*zt(e);return{x:h,y:u}}getPointOnEllipticalArc(e,t,r,i,a,n){var s=Math.cos(n),h=Math.sin(n),u={x:r*Math.cos(a),y:i*Math.sin(a)};return{x:e+(u.x*s-u.y*h),y:t+(u.x*h+u.y*s)}}buildEquidistantCache(e,t){var r=this.getPathLength(),i=t||.25,a=e||r/100;if(!this.equidistantCache||this.equidistantCache.step!==a||this.equidistantCache.precision!==i){this.equidistantCache={step:a,precision:i,points:[]};for(var n=0,s=0;s<=r;s+=i){var h=this.getPointOnPath(s),u=this.getPointOnPath(s+i);!h||!u||(n+=this.getLineLength(h.x,h.y,u.x,u.y),n>=a&&(this.equidistantCache.points.push({x:h.x,y:h.y,distance:s}),n-=a))}}}getEquidistantPointOnPath(e,t,r){if(this.buildEquidistantCache(t,r),e<0||e-this.getPathLength()>5e-5)return null;var i=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}}var Di=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class Li extends pe{constructor(e,t,r){super(e,t,r),this.type="image",this.loaded=!1;var i=this.getHrefAttribute().getString();if(i){var a=i.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(i);e.images.push(this),a?this.loadSvg(i):this.loadImage(i),this.isSvg=a}}loadImage(e){var t=this;return ie(function*(){try{var r=yield t.document.createImage(e);t.image=r}catch(i){console.error('Error while loading image "'.concat(e,'":'),i)}t.loaded=!0})()}loadSvg(e){var t=this;return ie(function*(){var r=Di.exec(e);if(r){var i=r[5];r[4]==="base64"?t.image=atob(i):t.image=decodeURIComponent(i)}else try{var a=yield t.document.fetch(e),n=yield a.text();t.image=n}catch(s){console.error('Error while loading image "'.concat(e,'":'),s)}t.loaded=!0})()}renderChildren(e){var{document:t,image:r,loaded:i}=this,a=this.getAttribute("x").getPixels("x"),n=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),h=this.getStyle("height").getPixels("y");if(!(!i||!r||!s||!h)){if(e.save(),e.translate(a,n),this.isSvg){var u=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:h});u.document.documentElement.parent=this,u.render()}else{var l=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:l.width,height:h,desiredHeight:l.height}),this.loaded&&(typeof l.complete>"u"||l.complete)&&e.drawImage(l,0,0)}e.restore()}}getBoundingBox(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new K(e,t,e+r,t+i)}}class _i extends pe{constructor(){super(...arguments),this.type="symbol"}render(e){}}class Ii{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,t){var r=this;return ie(function*(){try{var{document:i}=r,a=yield i.canvg.parser.load(t),n=a.getElementsByTagName("font");Array.from(n).forEach(s=>{var h=i.createElement(s);i.definitions[e]=h})}catch(s){console.error('Error while loading font "'.concat(t,'":'),s)}r.loaded=!0})()}}class ir extends V{constructor(e,t,r){super(e,t,r),this.type="style";var i=xe(Array.from(t.childNodes).map(n=>n.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),a=i.split("}");a.forEach(n=>{var s=n.trim();if(s){var h=s.split("{"),u=h[0].split(","),l=h[1].split(";");u.forEach(g=>{var c=g.trim();if(c){var f=e.styles[c]||{};if(l.forEach(p=>{var y=p.indexOf(":"),T=p.substr(0,y).trim(),b=p.substr(y+1,p.length-y).trim();T&&b&&(f[T]=new A(e,T,b))}),e.styles[c]=f,e.stylesSpecificity[c]=Jr(c),c==="@font-face"){var d=f["font-family"].getString().replace(/"|'/g,""),v=f.src.getString().split(",");v.forEach(p=>{if(p.indexOf('format("svg")')>0){var y=Qt(p);y&&new Ii(e).load(d,y)}})}}})}})}}ir.parseExternalUrl=Qt;class Bi extends pe{constructor(){super(...arguments),this.type="use"}setContext(e){super.setContext(e);var t=this.getAttribute("x"),r=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),r.hasValue()&&e.translate(0,r.getPixels("y"))}path(e){var{element:t}=this;t&&t.path(e)}renderChildren(e){var{document:t,element:r}=this;if(r){var i=r;if(r.type==="symbol"&&(i=new Te(t,null),i.attributes.viewBox=new A(t,"viewBox",r.getAttribute("viewBox").getString()),i.attributes.preserveAspectRatio=new A(t,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),i.attributes.overflow=new A(t,"overflow",r.getAttribute("overflow").getString()),i.children=r.children,r.styles.opacity=new A(t,"opacity",this.calculateOpacity())),i.type==="svg"){var a=this.getStyle("width",!1,!0),n=this.getStyle("height",!1,!0);a.hasValue()&&(i.attributes.width=new A(t,"width",a.getString())),n.hasValue()&&(i.attributes.height=new A(t,"height",n.getString()))}var s=i.parent;i.parent=this,i.render(e),i.parent=s}}getBoundingBox(e){var{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){var{document:e,element:t}=this;return de.fromElement(e,t)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function De(o,e,t,r,i,a){return o[t*r*4+e*4+a]}function Le(o,e,t,r,i,a,n){o[t*r*4+e*4+a]=n}function I(o,e,t){var r=o[e];return r*t}function re(o,e,t,r){return e+Math.cos(o)*t+Math.sin(o)*r}class ar extends V{constructor(e,t,r){super(e,t,r),this.type="feColorMatrix";var i=$(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{var a=i[0];i=[.213+.787*a,.715-.715*a,.072-.072*a,0,0,.213-.213*a,.715+.285*a,.072-.072*a,0,0,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var n=i[0]*Math.PI/180;i=[re(n,.213,.787,-.213),re(n,.715,-.715,-.715),re(n,.072,-.072,.928),0,0,re(n,.213,-.213,.143),re(n,.715,.285,.14),re(n,.072,-.072,-.283),0,0,re(n,.213,-.213,-.787),re(n,.715,-.715,.715),re(n,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=i,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,t,r,i,a){for(var{includeOpacity:n,matrix:s}=this,h=e.getImageData(0,0,i,a),u=0;u<a;u++)for(var l=0;l<i;l++){var g=De(h.data,l,u,i,a,0),c=De(h.data,l,u,i,a,1),f=De(h.data,l,u,i,a,2),d=De(h.data,l,u,i,a,3),v=I(s,0,g)+I(s,1,c)+I(s,2,f)+I(s,3,d)+I(s,4,1),p=I(s,5,g)+I(s,6,c)+I(s,7,f)+I(s,8,d)+I(s,9,1),y=I(s,10,g)+I(s,11,c)+I(s,12,f)+I(s,13,d)+I(s,14,1),T=I(s,15,g)+I(s,16,c)+I(s,17,f)+I(s,18,d)+I(s,19,1);n&&(v=0,p=0,y=0,T*=d/255),Le(h.data,l,u,i,a,0,v),Le(h.data,l,u,i,a,1,p),Le(h.data,l,u,i,a,2,y),Le(h.data,l,u,i,a,3,T)}e.clearRect(0,0,i,a),e.putImageData(h,0,0)}}class ze extends V{constructor(){super(...arguments),this.type="mask"}apply(e,t){var{document:r}=this,i=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),n=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(!n&&!s){var h=new K;this.children.forEach(d=>{h.addBoundingBox(d.getBoundingBox(e))}),i=Math.floor(h.x1),a=Math.floor(h.y1),n=Math.floor(h.width),s=Math.floor(h.height)}var u=this.removeStyles(t,ze.ignoreStyles),l=r.createCanvas(i+n,a+s),g=l.getContext("2d");r.screen.setDefaults(g),this.renderChildren(g),new ar(r,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(g,0,0,i+n,a+s);var c=r.createCanvas(i+n,a+s),f=c.getContext("2d");r.screen.setDefaults(f),t.render(f),f.globalCompositeOperation="destination-in",f.fillStyle=g.createPattern(l,"no-repeat"),f.fillRect(0,0,i+n,a+s),e.fillStyle=f.createPattern(c,"no-repeat"),e.fillRect(0,0,i+n,a+s),this.restoreStyles(t,u)}render(e){}}ze.ignoreStyles=["mask","transform","clip-path"];var Ut=()=>{};class zi extends V{constructor(){super(...arguments),this.type="clipPath"}apply(e){var{document:t}=this,r=Reflect.getPrototypeOf(e),{beginPath:i,closePath:a}=e;r&&(r.beginPath=Ut,r.closePath=Ut),Reflect.apply(i,e,[]),this.children.forEach(n=>{if(!(typeof n.path>"u")){var s=typeof n.elementTransform<"u"?n.elementTransform():null;s||(s=de.fromElement(t,n)),s&&s.apply(e),n.path(e),r&&(r.closePath=a),s&&s.unapply(e)}}),Reflect.apply(a,e,[]),e.clip(),r&&(r.beginPath=i,r.closePath=a)}render(e){}}class Fe extends V{constructor(){super(...arguments),this.type="filter"}apply(e,t){var{document:r,children:i}=this,a=t.getBoundingBox(e);if(a){var n=0,s=0;i.forEach(y=>{var T=y.extraFilterDistance||0;n=Math.max(n,T),s=Math.max(s,T)});var h=Math.floor(a.width),u=Math.floor(a.height),l=h+2*n,g=u+2*s;if(!(l<1||g<1)){var c=Math.floor(a.x),f=Math.floor(a.y),d=this.removeStyles(t,Fe.ignoreStyles),v=r.createCanvas(l,g),p=v.getContext("2d");r.screen.setDefaults(p),p.translate(-c+n,-f+s),t.render(p),i.forEach(y=>{typeof y.apply=="function"&&y.apply(p,0,0,l,g)}),e.drawImage(v,0,0,l,g,c-n,f-s,l,g),this.restoreStyles(t,d)}}}render(e){}}Fe.ignoreStyles=["filter","transform","clip-path"];class Fi extends V{constructor(e,t,r){super(e,t,r),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(e,t,r,i,a){}}class Ui extends V{constructor(){super(...arguments),this.type="feMorphology"}apply(e,t,r,i,a){}}class Hi extends V{constructor(){super(...arguments),this.type="feComposite"}apply(e,t,r,i,a){}}class Xi extends V{constructor(e,t,r){super(e,t,r),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,r,i,a){var{document:n,blurRadius:s}=this,h=n.window?n.window.document.body:null,u=e.canvas;u.id=n.getUniqueId(),h&&(u.style.display="none",h.appendChild(u)),_r(u,t,r,i,a,s),h&&h.removeChild(u)}}class Yi extends V{constructor(){super(...arguments),this.type="title"}}class qi extends V{constructor(){super(...arguments),this.type="desc"}}var ji={svg:Te,rect:er,circle:pi,ellipse:mi,line:yi,polyline:tr,polygon:bi,path:N,pattern:xi,marker:wi,defs:Ai,linearGradient:Ti,radialGradient:Ci,stop:Ei,animate:lt,animateColor:Oi,animateTransform:Si,font:Ni,"font-face":Mi,"missing-glyph":Pi,glyph:Kt,text:he,tspan:Be,tref:Vi,a:Ri,textPath:ki,image:Li,g:ut,symbol:_i,style:ir,use:Bi,mask:ze,clipPath:zi,filter:Fe,feDropShadow:Fi,feMorphology:Ui,feComposite:Hi,feColorMatrix:ar,feGaussianBlur:Xi,title:Yi,desc:qi};function Ht(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),t.push.apply(t,r)}return t}function Wi(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ht(Object(t),!0).forEach(function(r){ot(o,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Ht(Object(t)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(t,r))})}return o}function Qi(o,e){var t=document.createElement("canvas");return t.width=o,t.height=e,t}function $i(o){return ht.apply(this,arguments)}function ht(){return ht=ie(function*(o){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=document.createElement("img");return e&&(t.crossOrigin="Anonymous"),new Promise((r,i)=>{t.onload=()=>{r(t)},t.onerror=(a,n,s,h,u)=>{i(u)},t.src=o})}),ht.apply(this,arguments)}class ne{constructor(e){var{rootEmSize:t=12,emSize:r=12,createCanvas:i=ne.createCanvas,createImage:a=ne.createImage,anonymousCrossOrigin:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=e,this.definitions=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=t,this.emSize=r,this.createCanvas=i,this.createImage=this.bindCreateImage(a,n),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,t){return typeof t=="boolean"?(r,i)=>e(r,typeof i=="boolean"?i:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:t}=this;t.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e){var t=e.nodeName.replace(/^[^:]+:/,""),r=ne.elementTypes[t];return typeof r<"u"?new r(this,e):new li(this,e)}createTextNode(e){return new di(this,e)}setViewBox(e){this.screen.setViewBox(Wi({document:this},e))}}ne.createCanvas=Qi;ne.createImage=$i;ne.elementTypes=ji;function Xt(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),t.push.apply(t,r)}return t}function ce(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Xt(Object(t),!0).forEach(function(r){ot(o,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Xt(Object(t)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(t,r))})}return o}class Ae{constructor(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new rt(r),this.screen=new Ie(e,r),this.options=r;var i=new ne(this,r),a=i.createDocumentElement(t);this.document=i,this.documentElement=a}static from(e,t){var r=arguments;return ie(function*(){var i=r.length>2&&r[2]!==void 0?r[2]:{},a=new rt(i),n=yield a.parse(t);return new Ae(e,n,i)})()}static fromString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=new rt(r),a=i.parseFromString(t);return new Ae(e,a,r)}fork(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Ae.from(e,t,ce(ce({},this.options),r))}forkString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Ae.fromString(e,t,ce(ce({},this.options),r))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,t=this;return ie(function*(){var r=e.length>0&&e[0]!==void 0?e[0]:{};t.start(ce({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},r)),yield t.ready(),t.stop()})()}start(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:t,screen:r,options:i}=this;r.start(t,ce(ce({enableRedraw:!0},i),e))}stop(){this.screen.stop()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(e,t,r)}}export{Ri as AElement,Oi as AnimateColorElement,lt as AnimateElement,Si as AnimateTransformElement,K as BoundingBox,kt as CB1,Dt as CB2,Lt as CB3,_t as CB4,Ae as Canvg,pi as CircleElement,zi as ClipPathElement,Ai as DefsElement,qi as DescElement,ne as Document,V as Element,mi as EllipseElement,ar as FeColorMatrixElement,Hi as FeCompositeElement,Fi as FeDropShadowElement,Xi as FeGaussianBlurElement,Ui as FeMorphologyElement,Fe as FilterElement,j as Font,Ni as FontElement,Mi as FontFaceElement,ut as GElement,Kt as GlyphElement,rr as GradientElement,Li as ImageElement,yi as LineElement,Ti as LinearGradientElement,wi as MarkerElement,ze as MaskElement,Zt as Matrix,Pi as MissingGlyphElement,ei as Mouse,be as PSEUDO_ZERO,rt as Parser,N as PathElement,C as PathParser,xi as PatternElement,L as Point,bi as PolygonElement,tr as PolylineElement,A as Property,It as QB1,Bt as QB2,zt as QB3,Ci as RadialGradientElement,er as RectElement,pe as RenderedElement,ai as Rotate,Te as SVGElement,Ii as SVGFontLoader,si as Scale,Ie as Screen,Jt as Skew,ni as SkewX,hi as SkewY,Ei as StopElement,ir as StyleElement,_i as SymbolElement,Vi as TRefElement,Be as TSpanElement,he as TextElement,ki as TextPathElement,Yi as TitleElement,de as Transform,ii as Translate,li as UnknownElement,Bi as UseElement,Kr as ViewPort,xe as compressSpaces,Ae as default,Jr as getSelectorSpecificity,Xr as normalizeAttributeName,Yr as normalizeColor,Qt as parseExternalUrl,Ki as presets,$ as toNumbers,Fr as trimLeft,Ur as trimRight,Vt as vectorMagnitude,Rt as vectorsAngle,nt as vectorsRatio};
|