PageSourceSearch

https://www.questionfirst.org/assets/index-Bp5gGGJq.js

js questionfirst.org collected 2026-10-09 22:06:38 UTC 110,082 bytes, 2 lines download raw bytes

1import{c as ts,g as _e}from"./react-vendor-XDCjal2T.js";var vt={exports:{}},gt={exports:{}},es=gt.exports,me;function ss(){return me||(me=1,(function(){var l,t,e,s,i,r;typeof performance<"u"&&performance!==null&&performance.now?gt.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(gt.exports=function(){return(l()-i)/1e6},t=process.hrtime,l=function(){var a;return a=t(),a[0]*1e9+a[1]},s=l(),r=process.uptime()*1e9,i=s-r):Date.now?(gt.exports=function(){return Date.now()-e},e=Date.now()):(gt.exports=function(){return new Date().getTime()-e},e=new Date().getTime())}).call(es)),gt.exports}var xe;function is(){if(xe)return vt.exports;xe=1;for(var l=ss(),t=typeof window>"u"?ts:window,e=["moz","webkit"],s="AnimationFrame",i=t["request"+s],r=t["cancel"+s]||t["cancelRequest"+s],a=0;!i&&a<e.length;a++)i=t[e[a]+"Request"+s],r=t[e[a]+"Cancel"+s]||t[e[a]+"CancelRequest"+s];if(!i||!r){var n=0,o=0,h=[],c=1e3/60;i=function(f){if(h.length===0){var g=l(),u=Math.max(0,c-(g-n));n=u+g,setTimeout(function(){var d=h.slice(0);h.length=0;for(var p=0;p<d.length;p++)if(!d[p].cancelled)try{d[p].callback(n)}catch(y){setTimeout(function(){throw y},0)}},Math.round(u))}return h.push({handle:++o,callback:f,cancelled:!1}),o},r=function(f){for(var g=0;g<h.length;g++)h[g].handle===f&&(h[g].cancelled=!0)}}return vt.exports=function(f){return i.call(t,f)},vt.exports.cancel=function(){r.apply(t,arguments)},vt.exports.polyfill=function(f){f||(f=t),f.requestAnimationFrame=i,f.cancelAnimationFrame=r},vt.exports}var rs=is();const jt=_e(rs);var Kt,be;function ns(){return be||(be=1,Kt=function(l){this.ok=!1,this.alpha=1,l.charAt(0)=="#"&&(l=l.substr(1,6)),l=l.replace(/ /g,""),l=l.toLowerCase();var t={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:"90ee9
10",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"};l=t[l]||l;for(var e=[{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(o){return[parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),parseFloat(o[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(o){return[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(o){return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(o){return[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16)]}}],s=0;s<e.length;s++){var i=e[s].re,r=e[s].process,a=i.exec(l);if(a){var n=r(a);this.r=n[0],this.g=n[1],this.b=n[2],n.length>3&&(this.alpha=n[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 o=this.r.toString(16),h=this.g.toString(16),c=this.b.toString(16);return o.length==1&&(o="0"+o),h.length==1&&(h="0"+h),c.length==1&&(c="0"+c),"#"+o+h+c},this.getHelpXML=function(){for(var o=new Array,h=0;h<e.length;h++)for(var c=e[h].example,f=0;f<c.length;f++)o[o.length]=c[f];for(var g in t)o[o.length]=g;var u=document.createElement("ul");u.setAttribute("id","rgbcolor-examples");for(var h=0;h<o.length;h++)try{var d=document.createElement("li"),p=new RGBColor(o[h]),y=document.createElement("div");y.style.cssText="margin: 3px; border: 1px solid black; background:"+p.toHex()+"; color:"+p.toHex(),y.appendChild(document.createTextNode("test"));var x=document.createTextNode(" "+o[h]+" -> "+p.toRGB()+" -> "+p.toHex());d.appendChild(y),d.appendChild(x),u.appendChild(d)}catch{}return u}}),Kt}var as=ns();const se=_e(as);var Fe=function(l,t){return(Fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,s){e.__proto__=s}||function(e,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])})(l,t)};function ze(l,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=l}Fe(l,t),l.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function os(l){var t="";Array.isArray(l)||(l=[l]);for(var e=0;e<l.length;e++){var s=l[e];
vendor: 4,936 bytes, line 1
1if(s.type===m.CLOSE_PATH)t+="z";else if(s.type===m.HORIZ_LINE_TO)t+=(s.relative?"h":"H")+s.x;else if(s.type===m.VERT_LINE_TO)t+=(s.relative?"v":"V")+s.y;else if(s.type===m.MOVE_TO)t+=(s.relative?"m":"M")+s.x+" "+s.y;else if(s.type===m.LINE_TO)t+=(s.relative?"l":"L")+s.x+" "+s.y;else if(s.type===m.CURVE_TO)t+=(s.relative?"c":"C")+s.x1+" "+s.y1+" "+s.x2+" "+s.y2+" "+s.x+" "+s.y;else if(s.type===m.SMOOTH_CURVE_TO)t+=(s.relative?"s":"S")+s.x2+" "+s.y2+" "+s.x+" "+s.y;else if(s.type===m.QUAD_TO)t+=(s.relative?"q":"Q")+s.x1+" "+s.y1+" "+s.x+" "+s.y;else if(s.type===m.SMOOTH_QUAD_TO)t+=(s.relative?"t":"T")+s.x+" "+s.y;else{if(s.type!==m.ARC)throw new Error('Unexpected command type "'+s.type+'" at index '+e+".");t+=(s.relative?"a":"A")+s.rX+" "+s.rY+" "+s.xRot+" "+ +s.lArcFlag+" "+ +s.sweepFlag+" "+s.x+" "+s.y}}return t}function ie(l,t){var e=l[0],s=l[1];return[e*Math.cos(t)-s*Math.sin(t),e*Math.sin(t)+s*Math.cos(t)]}function K(){for(var l=[],t=0;t<arguments.length;t++)l[t]=arguments[t];for(var e=0;e<l.length;e++)if(typeof l[e]!="number")throw new Error("assertNumbers arguments["+e+"] is not a number. "+typeof l[e]+" == typeof "+l[e]);return!0}var nt=Math.PI;function Jt(l,t,e){l.lArcFlag=l.lArcFlag===0?0:1,l.sweepFlag=l.sweepFlag===0?0:1;var s=l.rX,i=l.rY,r=l.x,a=l.y;s=Math.abs(l.rX),i=Math.abs(l.rY);var n=ie([(t-r)/2,(e-a)/2],-l.xRot/180*nt),o=n[0],h=n[1],c=Math.pow(o,2)/Math.pow(s,2)+Math.pow(h,2)/Math.pow(i,2);1<c&&(s*=Math.sqrt(c),i*=Math.sqrt(c)),l.rX=s,l.rY=i;var f=Math.pow(s,2)*Math.pow(h,2)+Math.pow(i,2)*Math.pow(o,2),g=(l.lArcFlag!==l.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(s,2)*Math.pow(i,2)-f)/f)),u=s*h/i*g,d=-i*o/s*g,p=ie([u,d],l.xRot/180*nt);l.cX=p[0]+(t+r)/2,l.cY=p[1]+(e+a)/2,l.phi1=Math.atan2((h-d)/i,(o-u)/s),l.phi2=Math.atan2((-h-d)/i,(-o-u)/s),l.sweepFlag===0&&l.phi2>l.phi1&&(l.phi2-=2*nt),l.sweepFlag===1&&l.phi2<l.phi1&&(l.phi2+=2*nt),l.phi1*=180/nt,l.phi2*=180/nt}function ve(l,t,e){K(l,t,e);var s=l*l+t*t-e*e;if(0>s)return[];if(s===0)return[[l*e/(l*l+t*t),t*e/(l*l+t*t)]];var i=Math.sqrt(s);return[[(l*e+t*i)/(l*l+t*t),(t*e-l*i)/(l*l+t*t)],[(l*e-t*i)/(l*l+t*t),(t*e+l*i)/(l*l+t*t)]]}var D,et=Math.PI/180;function Ae(l,t,e){return(1-e)*l+e*t}function Se(l,t,e,s){return l+Math.cos(s/180*nt)*t+Math.sin(s/180*nt)*e}function Te(l,t,e,s){var i=1e-6,r=t-l,a=e-t,n=3*r+3*(s-e)-6*a,o=6*(a-r),h=3*r;return Math.abs(n)<i?[-h/o]:(function(c,f,g){var u=c*c/4-f;if(u<-g)return[];if(u<=g)return[-c/2];var d=Math.sqrt(u);return[-c/2-d,-c/2+d]})(o/n,h/n,i)}function we(l,t,e,s,i){var r=1-i;return l*(r*r*r)+t*(3*r*r*i)+e*(3*r*i*i)+s*(i*i*i)}(function(l){function t(){return i((function(n,o,h){return n.relative&&(n.x1!==void 0&&(n.x1+=o),n.y1!==void 0&&(n.y1+=h),n.x2!==void 0&&(n.x2+=o),n.y2!==void 0&&(n.y2+=h),n.x!==void 0&&(n.x+=o),n.y!==void 0&&(n.y+=h),n.relative=!1),n}))}function e(){var n=NaN,o=NaN,h=NaN,c=NaN;return i((function(f,g,u){return f.type&m.SMOOTH_CURVE_TO&&(f.type=m.CURVE_TO,n=isNaN(n)?g:n,o=isNaN(o)?u:o,f.x1=f.relative?g-n:2*g-n,f.y1=f.relative?u-o:2*u-o),f.type&m.CURVE_TO?(n=f.relative?g+f.x2:f.x2,o=f.relative?u+f.y2:f.y2):(n=NaN,o=NaN),f.type&m.SMOOTH_QUAD_TO&&(f.type=m.QUAD_TO,h=isNaN(h)?g:h,c=isNaN(c)?u:c,f.x1=f.relative?g-h:2*g-h,f.y1=f.relative?u-c:2*u-c),f.type&m.QUAD_TO?(h=f.relative?g+f.x1:f.x1,c=f.relative?u+f.y1:f.y1):(h=NaN,c=NaN),f}))}function s(){var n=NaN,o=NaN;return i((function(h,c,f){if(h.type&m.SMOOTH_QUAD_TO&&(h.type=m.QUAD_TO,n=isNaN(n)?c:n,o=isNaN(o)?f:o,h.x1=h.relative?c-n:2*c-n,h.y1=h.relative?f-o:2*f-o),h.type&m.QUAD_TO){n=h.relative?c+h.x1:h.x1,o=h.relative?f+h.y1:h.y1;var g=h.x1,u=h.y1;h.type=m.CURVE_TO,h.x1=((h.relative?0:c)+2*g)/3,h.y1=((h.relative?0:f)+2*u)/3,h.x2=(h.x+2*g)/3,h.y2=(h.y+2*u)/3}else n=NaN,o=NaN;return h}))}function i(n){var o=0,h=0,c=NaN,f=NaN;return function(g){if(isNaN(c)&&!(g.type&m.MOVE_TO))throw new Error("path must start with moveto");var u=n(g,o,h,c,f);return g.type&m.CLOSE_PATH&&(o=c,h=f),g.x!==void 0&&(o=g.relative?o+g.x:g.x),g.y!==void 0&&(h=g.relative?h+g.y:g.y),g.type&m.MOVE_TO&&(c=o,f=h),u}}function r(n,o,h,c,f,g){return K(n,o,h,c,f,g),i((function(u,d,p,y){var x=u.x1,S=u.x2,b=u.relative&&!isNaN(y),v=u.x!==void 0?u.x:b?0:d,E=u.y!==void 0?u.y:b?0:p;function C(Z){return Z*Z}u.type&m.HORIZ_LINE_TO&&o!==0&&(u.type=m.LINE_TO,u.y=u.relative?0:p),u.type&m.VERT_LINE_TO&&h!==0&&(u.type=m.LINE_TO,u.x=u.relative?0:d),u.x!==void 0&&(u.x=u.x*n+E*h+(b?0:f)),u.y!==void 0&&(u.y=v*o+u.y*c+(b?0:g)),u.x1!==void 0&&(u.x1=u.x1*n+u.y1*h+(b?0:f)),u.y1!==void 0&&(u.y1=x*o+u.y1*c+(b?0:g)),u.x2!==void 0&&(u.x2=u.x2*n+u.y2*h+(b?0:f)),u.y2!==void 0&&(u.y2=S*o+u.y2*c+(b?0:g));var T=n*c-o*h;if(u.xRot!==void 0&&(n!==1||o!==0||h!==0||c!==1))if(T===0)delete u.rX,delete u.rY,delete u.xRot,delete u.lArcFlag,delete u.sweepFlag,u.type=m.LINE_TO;else{var N=u.xRot*Math.PI/180,R=Math.sin(N),F=Math.cos(N),z=1/C(u.rX),_=1/C(u.rY),X=C(F)*z+C(R)*_,B=2*R*F*(z-_),L=C(R)*z+C(F)*_,H=X*c*c-B*o*c+L*o*o,U=B*(n*c+o*h)-2*(X*h*c+L*n*o
vendor: 4,114 bytes, line 1
1),G=X*h*h-B*n*h+L*n*n,k=(Math.atan2(U,H-G)+Math.PI)%Math.PI/2,O=Math.sin(k),Y=Math.cos(k);u.rX=Math.abs(T)/Math.sqrt(H*C(Y)+U*O*Y+G*C(O)),u.rY=Math.abs(T)/Math.sqrt(H*C(O)-U*O*Y+G*C(Y)),u.xRot=180*k/Math.PI}return u.sweepFlag!==void 0&&0>T&&(u.sweepFlag=+!u.sweepFlag),u}))}function a(){return function(n){var o={};for(var h in n)o[h]=n[h];return o}}l.ROUND=function(n){function o(h){return Math.round(h*n)/n}return n===void 0&&(n=1e13),K(n),function(h){return h.x1!==void 0&&(h.x1=o(h.x1)),h.y1!==void 0&&(h.y1=o(h.y1)),h.x2!==void 0&&(h.x2=o(h.x2)),h.y2!==void 0&&(h.y2=o(h.y2)),h.x!==void 0&&(h.x=o(h.x)),h.y!==void 0&&(h.y=o(h.y)),h.rX!==void 0&&(h.rX=o(h.rX)),h.rY!==void 0&&(h.rY=o(h.rY)),h}},l.TO_ABS=t,l.TO_REL=function(){return i((function(n,o,h){return n.relative||(n.x1!==void 0&&(n.x1-=o),n.y1!==void 0&&(n.y1-=h),n.x2!==void 0&&(n.x2-=o),n.y2!==void 0&&(n.y2-=h),n.x!==void 0&&(n.x-=o),n.y!==void 0&&(n.y-=h),n.relative=!0),n}))},l.NORMALIZE_HVZ=function(n,o,h){return n===void 0&&(n=!0),o===void 0&&(o=!0),h===void 0&&(h=!0),i((function(c,f,g,u,d){if(isNaN(u)&&!(c.type&m.MOVE_TO))throw new Error("path must start with moveto");return o&&c.type&m.HORIZ_LINE_TO&&(c.type=m.LINE_TO,c.y=c.relative?0:g),h&&c.type&m.VERT_LINE_TO&&(c.type=m.LINE_TO,c.x=c.relative?0:f),n&&c.type&m.CLOSE_PATH&&(c.type=m.LINE_TO,c.x=c.relative?u-f:u,c.y=c.relative?d-g:d),c.type&m.ARC&&(c.rX===0||c.rY===0)&&(c.type=m.LINE_TO,delete c.rX,delete c.rY,delete c.xRot,delete c.lArcFlag,delete c.sweepFlag),c}))},l.NORMALIZE_ST=e,l.QT_TO_C=s,l.INFO=i,l.SANITIZE=function(n){n===void 0&&(n=0),K(n);var o=NaN,h=NaN,c=NaN,f=NaN;return i((function(g,u,d,p,y){var x=Math.abs,S=!1,b=0,v=0;if(g.type&m.SMOOTH_CURVE_TO&&(b=isNaN(o)?0:u-o,v=isNaN(h)?0:d-h),g.type&(m.CURVE_TO|m.SMOOTH_CURVE_TO)?(o=g.relative?u+g.x2:g.x2,h=g.relative?d+g.y2:g.y2):(o=NaN,h=NaN),g.type&m.SMOOTH_QUAD_TO?(c=isNaN(c)?u:2*u-c,f=isNaN(f)?d:2*d-f):g.type&m.QUAD_TO?(c=g.relative?u+g.x1:g.x1,f=g.relative?d+g.y1:g.y2):(c=NaN,f=NaN),g.type&m.LINE_COMMANDS||g.type&m.ARC&&(g.rX===0||g.rY===0||!g.lArcFlag)||g.type&m.CURVE_TO||g.type&m.SMOOTH_CURVE_TO||g.type&m.QUAD_TO||g.type&m.SMOOTH_QUAD_TO){var E=g.x===void 0?0:g.relative?g.x:g.x-u,C=g.y===void 0?0:g.relative?g.y:g.y-d;b=isNaN(c)?g.x1===void 0?b:g.relative?g.x:g.x1-u:c-u,v=isNaN(f)?g.y1===void 0?v:g.relative?g.y:g.y1-d:f-d;var T=g.x2===void 0?0:g.relative?g.x:g.x2-u,N=g.y2===void 0?0:g.relative?g.y:g.y2-d;x(E)<=n&&x(C)<=n&&x(b)<=n&&x(v)<=n&&x(T)<=n&&x(N)<=n&&(S=!0)}return g.type&m.CLOSE_PATH&&x(u-p)<=n&&x(d-y)<=n&&(S=!0),S?[]:g}))},l.MATRIX=r,l.ROTATE=function(n,o,h){o===void 0&&(o=0),h===void 0&&(h=0),K(n,o,h);var c=Math.sin(n),f=Math.cos(n);return r(f,c,-c,f,o-o*f+h*c,h-o*c-h*f)},l.TRANSLATE=function(n,o){return o===void 0&&(o=0),K(n,o),r(1,0,0,1,n,o)},l.SCALE=function(n,o){return o===void 0&&(o=n),K(n,o),r(n,0,0,o,0,0)},l.SKEW_X=function(n){return K(n),r(1,0,Math.atan(n),1,0,0)},l.SKEW_Y=function(n){return K(n),r(1,Math.atan(n),0,1,0,0)},l.X_AXIS_SYMMETRY=function(n){return n===void 0&&(n=0),K(n),r(-1,0,0,1,n,0)},l.Y_AXIS_SYMMETRY=function(n){return n===void 0&&(n=0),K(n),r(1,0,0,-1,0,n)},l.A_TO_C=function(){return i((function(n,o,h){return m.ARC===n.type?(function(c,f,g){var u,d,p,y;c.cX||Jt(c,f,g);for(var x=Math.min(c.phi1,c.phi2),S=Math.max(c.phi1,c.phi2)-x,b=Math.ceil(S/90),v=new Array(b),E=f,C=g,T=0;T<b;T++){var N=Ae(c.phi1,c.phi2,T/b),R=Ae(c.phi1,c.phi2,(T+1)/b),F=R-N,z=4/3*Math.tan(F*et/4),_=[Math.cos(N*et)-z*Math.sin(N*et),Math.sin(N*et)+z*Math.cos(N*et)],X=_[0],B=_[1],L=[Math.cos(R*et),Math.sin(R*et)],H=L[0],U=L[1],G=[H+z*Math.sin(R*et),U-z*Math.cos(R*et)],k=G[0],O=G[1];v[T]={relative:c.relative,type:m.CURVE_TO};var Y=function(Z,tt){var rt=ie([Z*c.rX,tt*c.rY],c.xRot),yt=rt[0],wt=rt[1];return[c.cX+yt,c.cY+wt]};u=Y(X,B),v[T].x1=u[0],v[T].y1=u[1],d=Y(k,O),v[T].x2=d[0],v[T].y2=d[1],p=Y(H,U),v[T].x=p[0],v[T].y=p[1],c.relative&&(v[T].x1-=E,v[T].y1-=C,v[T].x2-=E,v[T].y2-=C,v[T].x-=E,v[T].y-=C),E=(y=[v[T].x,v[T].y])[0],C=y[1]}return v})(n,n.relative?0:o,n.relative?0:h):n}))},l.ANNOTATE_ARCS=function(){return i((function(n,o,h){return n.relative&&(o=0,h=0),m.ARC===n.t
vendor: 9,730 bytes, lines 1-2
1ype&&Jt(n,o,h),n}))},l.CLONE=a,l.CALCULATE_BOUNDS=function(){var n=function(g){var u={};for(var d in g)u[d]=g[d];return u},o=t(),h=s(),c=e(),f=i((function(g,u,d){var p=c(h(o(n(g))));function y(O){O>f.maxX&&(f.maxX=O),O<f.minX&&(f.minX=O)}function x(O){O>f.maxY&&(f.maxY=O),O<f.minY&&(f.minY=O)}if(p.type&m.DRAWING_COMMANDS&&(y(u),x(d)),p.type&m.HORIZ_LINE_TO&&y(p.x),p.type&m.VERT_LINE_TO&&x(p.y),p.type&m.LINE_TO&&(y(p.x),x(p.y)),p.type&m.CURVE_TO){y(p.x),x(p.y);for(var S=0,b=Te(u,p.x1,p.x2,p.x);S<b.length;S++)0<(k=b[S])&&1>k&&y(we(u,p.x1,p.x2,p.x,k));for(var v=0,E=Te(d,p.y1,p.y2,p.y);v<E.length;v++)0<(k=E[v])&&1>k&&x(we(d,p.y1,p.y2,p.y,k))}if(p.type&m.ARC){y(p.x),x(p.y),Jt(p,u,d);for(var C=p.xRot/180*Math.PI,T=Math.cos(C)*p.rX,N=Math.sin(C)*p.rX,R=-Math.sin(C)*p.rY,F=Math.cos(C)*p.rY,z=p.phi1<p.phi2?[p.phi1,p.phi2]:-180>p.phi2?[p.phi2+360,p.phi1+360]:[p.phi2,p.phi1],_=z[0],X=z[1],B=function(O){var Y=O[0],Z=O[1],tt=180*Math.atan2(Z,Y)/Math.PI;return tt<_?tt+360:tt},L=0,H=ve(R,-T,0).map(B);L<H.length;L++)(k=H[L])>_&&k<X&&y(Se(p.cX,T,R,k));for(var U=0,G=ve(F,-N,0).map(B);U<G.length;U++){var k;(k=G[U])>_&&k<X&&x(Se(p.cY,N,F,k))}}return g}));return f.minX=1/0,f.maxX=-1/0,f.minY=1/0,f.maxY=-1/0,f}})(D||(D={}));var j,Ue=(function(){function l(){}return l.prototype.round=function(t){return this.transform(D.ROUND(t))},l.prototype.toAbs=function(){return this.transform(D.TO_ABS())},l.prototype.toRel=function(){return this.transform(D.TO_REL())},l.prototype.normalizeHVZ=function(t,e,s){return this.transform(D.NORMALIZE_HVZ(t,e,s))},l.prototype.normalizeST=function(){return this.transform(D.NORMALIZE_ST())},l.prototype.qtToC=function(){return this.transform(D.QT_TO_C())},l.prototype.aToC=function(){return this.transform(D.A_TO_C())},l.prototype.sanitize=function(t){return this.transform(D.SANITIZE(t))},l.prototype.translate=function(t,e){return this.transform(D.TRANSLATE(t,e))},l.prototype.scale=function(t,e){return this.transform(D.SCALE(t,e))},l.prototype.rotate=function(t,e,s){return this.transform(D.ROTATE(t,e,s))},l.prototype.matrix=function(t,e,s,i,r,a){return this.transform(D.MATRIX(t,e,s,i,r,a))},l.prototype.skewX=function(t){return this.transform(D.SKEW_X(t))},l.prototype.skewY=function(t){return this.transform(D.SKEW_Y(t))},l.prototype.xSymmetry=function(t){return this.transform(D.X_AXIS_SYMMETRY(t))},l.prototype.ySymmetry=function(t){return this.transform(D.Y_AXIS_SYMMETRY(t))},l.prototype.annotateArcs=function(){return this.transform(D.ANNOTATE_ARCS())},l})(),hs=function(l){return l===" "||l==="	"||l==="\r"||l===`
2`},Ce=function(l){return 48<=l.charCodeAt(0)&&l.charCodeAt(0)<=57},ls=(function(l){function t(){var e=l.call(this)||this;return e.curNumber="",e.curCommandType=-1,e.curCommandRelative=!1,e.canParseCommandOrComma=!0,e.curNumberHasExp=!1,e.curNumberHasExpDigits=!1,e.curNumberHasDecimal=!1,e.curArgs=[],e}return ze(t,l),t.prototype.finish=function(e){if(e===void 0&&(e=[]),this.parse(" ",e),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return e},t.prototype.parse=function(e,s){var i=this;s===void 0&&(s=[]);for(var r=function(f){s.push(f),i.curArgs.length=0,i.canParseCommandOrComma=!0},a=0;a<e.length;a++){var n=e[a],o=!(this.curCommandType!==m.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),h=Ce(n)&&(this.curNumber==="0"&&n==="0"||o);if(!Ce(n)||h)if(n!=="e"&&n!=="E")if(n!=="-"&&n!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(n!=="."||this.curNumberHasExp||this.curNumberHasDecimal||o){if(this.curNumber&&this.curCommandType!==-1){var c=Number(this.curNumber);if(isNaN(c))throw new SyntaxError("Invalid number ending at "+a);if(this.curCommandType===m.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>c)throw new SyntaxError('Expected positive number, got "'+c+'" at index "'+a+'"')}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 "'+a+'"')}this.curArgs.push(c),this.curArgs.length===cs[this.curCommandType]&&(m.HORIZ_LINE_TO===this.curCommandType?r({type:m.HORIZ_LINE_TO,relative:this.curCommandRelative,x:c}):m.VERT_LINE_TO===this.curCommandType?r({type:m.VERT_LINE_TO,relative:this.curCommandRelative,y:c}):this.curCommandType===m.MOVE_TO||this.curCommandType===m.LINE_TO||this.curCommandType===m.SMOOTH_QUAD_TO?(r({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?r({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?r({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?r({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&&r({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(!hs(n))if(n===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(n!=="+"&&n!=="-"&&n!==".")if(h)this.curNumber=n,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+a+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+n+'" at index '+a+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,n!=="z"&&n!=="Z")if(n==="h"||n==="H")this.curCommandType=m.HORIZ_LINE_TO,this.curCommandRelative=n==="h";else if(n==="v"||n==="V")this.curCommandType=m.VERT_LINE_TO,this.curCommandRelative=n==="v";else if(n==="m"||n==="M")this.curCommandType=m.MOVE_TO,this.curCommandRelative=n==="m";else if(n==="l"||n==="L")this.curCommandType=m.LINE_TO,this.curCommandRelative=n==="l";else if(n==="c"||n==="C")this.curCommandType=m.CURVE_TO,this.curCommandRelative=n==="c";else if(n==="s"||n==="S")this.curCommandType=m.SMOOTH_CURVE_TO,this.curCommandRelative=n==="s";else if(n==="q"||n==="Q")this.curCommandType=m.QUAD_TO,this.curCommandRelative=n==="q";else if(n==="t"||n==="T")this.curCommandType=m.SMOOTH_QUAD_TO,this.curCommandRelative=n==="t";else{if(n!=="a"&&n!=="A")throw new SyntaxError('Unexpected character "'+n+'" at index '+a+".");this.curCommandType=m.ARC,this.curCommandRelative=n==="a"}else s.push({type:m.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=n,this.curNumberHasDecimal=n==="."}else this.curNumber+=n,this.curNumberHasDecimal=!0;else this.curNumber+=n;else this.curNumber+=n,this.curNumberHasExp=!0;else this.curNumber+=n,this.curNumberHasExpDigits=this.curNumberHasExp}return s},t.prototype.transform=function(e){return Object.create(this,{parse:{value:function(s,i){i===void 0&&(i=[]);for(var r=0,a=Object.getPrototypeOf(this).parse.call(this,s);r<a.length;r++){var n=a[r],o=e(n);Array.isArray(o)?i.push.apply(i,o):i.push(o)}return i}}})},t})(Ue),m=(function(l){function t(e){var s=l.call(this)||this;return s.commands=typeof e=="string"?t.parse(e):e,s}return ze(t,l),t.prototype.encode=function(){return t.encode(this.commands)},t.prototype.getBounds=function(){var e=D.CALCULATE_BOUNDS();return this.transform(e),e},t.prototype.transform=function(e){for(var s=[],i=0,r=this.commands;i<r.length;i++){var a=e(r[i]);Array.isArray(a)?s.push.apply(s,a):s.push(a)}return this.commands=s,this},t.encode=function(e){return os(e)},t.parse=function(e){var s=new ls,i=[];return s.parse(e,i),s.finish(i),i},t.CLOSE_PATH=1,t.MOVE_TO=2,t.HORIZ_LINE_TO=4,t.VERT_LINE_TO=8,t.LINE_TO=16,t.CURVE_TO=32,t.SMOOTH_CURVE_TO=64,t.QUAD_TO=128,t.SMOOTH_QUAD_TO=256,t.ARC=512,t.LINE_COMMANDS=t.LINE_TO|t.HORIZ_LINE_TO|t.VERT_LINE_TO,t.DRAWING_COMMANDS=t.HORIZ_LINE_TO|t.VERT_LINE_TO|t.LINE_TO|t.CURVE_TO|t.SMOOTH_CURVE_TO|t.QUAD_TO|t.SMOOTH_QUAD_TO|t.ARC,t})(Ue),cs=((j={})[m.MOVE_TO]=2,j[m.LINE_TO]=2,j[m.HORIZ_LINE_TO]=1,j[m.VERT_LINE_TO]=1,j[m.CLOSE_PATH]=0,j[m.QUAD_TO]=4,j[m.SMOOTH_QUAD_TO]=2,j[m.CURVE_TO]=6,j[m.SMOOTH_CURVE_TO]=4,j[m.ARC]=7,j);function It(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?It=function(t){return typeof t}:It=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(l)}function us(l,t){if(!(l instanceof t))throw new TypeError("Cannot call a class as a function")}var fs=[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,39
26,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],gs=[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 ds(l,t,e,s,i){if(typeof l=="string"&&(l=document.getElementById(l)),!l||It(l)!=="object"||!("getContext"in l))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var r=l.getContext("2d");try{return r.getImageData(t,e,s,i)}catch(a){throw new Error("unable to access image data: "+a)}}function ps(l,t,e,s,i,r){if(!(isNaN(r)||r<1)){r|=0;var a=ds(l,t,e,s,i);a=ys(a,t,e,s,i,r),l.getContext("2d").putImageData(a,t,e)}}function ys(l,t,e,s,i,r){for(var a=l.data,n=2*r+1,o=s-1,h=i-1,c=r+1,f=c*(c+1)/2,g=new Ee,u=g,d,p=1;p<n;p++)u=u.next=new Ee,p===c&&(d=u);u.next=g;for(var y=null,x=null,S=0,b=0,v=fs[r],E=gs[r],C=0;C<i;C++){u=g;for(var T=a[b],N=a[b+1],R=a[b+2],F=a[b+3],z=0;z<c;z++)u.r=T,u.g=N,u.b=R,u.a=F,u=u.next;for(var _=0,X=0,B=0,L=0,H=c*T,U=c*N,G=c*R,k=c*F,O=f*T,Y=f*N,Z=f*R,tt=f*F,rt=1;rt<c;rt++){var yt=b+((o<rt?o:rt)<<2),wt=a[yt],he=a[yt+1],le=a[yt+2],ce=a[yt+3],Ct=c-rt;O+=(u.r=wt)*Ct,Y+=(u.g=he)*Ct,Z+=(u.b=le)*Ct,tt+=(u.a=ce)*Ct,_+=wt,X+=he,B+=le,L+=ce,u=u.next}y=g,x=d;for(var Ft=0;Ft<s;Ft++){var zt=tt*v>>>E;if(a[b+3]=zt,zt!==0){var Ut=255/zt;a[b]=(O*v>>>E)*Ut,a[b+1]=(Y*v>>>E)*Ut,a[b+2]=(Z*v>>>E)*Ut}else a[b]=a[b+1]=a[b+2]=0;O-=H,Y-=U,Z-=G,tt-=k,H-=y.r,U-=y.g,G-=y.b,k-=y.a;var ht=Ft+r+1;ht=S+(ht<o?ht:o)<<2,_+=y.r=a[ht],X+=y.g=a[ht+1],B+=y.b=a[ht+2],L+=y.a=a[ht+3],O+=_,Y+=X,Z+=B,tt+=L,y=y.next;var Et=x,ue=Et.r,fe=Et.g,ge=Et.b,de=Et.a;H+=ue,U+=fe,G+=ge,k+=de,_-=ue,X-=fe,B-=ge,L-=de,x=x.next,b+=4}S+=s}for(var mt=0;mt<s;mt++){b=mt<<2;var lt=a[b],ct=a[b+1],ut=a[b+2],q=a[b+3],Xt=c*lt,Ht=c*ct,Yt=c*ut,Wt=c*q,Pt=f*lt,Mt=f*ct,Nt=f*ut,Ot=f*q;u=g;for(var pe=0;pe<c;pe++)u.r=lt,u.g=ct,u.b=ut,u.a=q,u=u.next;for(var ye=s,qt=0,Qt=0,Gt=0,$t=0,Vt=1;Vt<=r;Vt++){b=ye+mt<<2;var kt=c-Vt;Pt+=(u.r=lt=a[b])*kt,Mt+=(u.g=ct=a[b+1])*kt,Nt+=(u.b=ut=a[b+2])*kt,Ot+=(u.a=q=a[b+3])*kt,$t+=lt,qt+=ct,Qt+=ut,Gt+=q,u=u.next,Vt<h&&(ye+=s)}b=mt,y=g,x=d;for(var Zt=0;Zt<i;Zt++){var Q=b<<2;a[Q+3]=q=Ot*v>>>E,q>0?(q=255/q,a[Q]=(Pt*v>>>E)*q,a[Q+1]=(Mt*v>>>E)*q,a[Q+2]=(Nt*v>>>E)*q):a[Q]=a[Q+1]=a[Q+2]=0,Pt-=Xt,Mt-=Ht,Nt-=Yt,Ot-=Wt,Xt-=y.r,Ht-=y.g,Yt-=y.b,Wt-=y.a,Q=mt+((Q=Zt+c)<h?Q:h)*s<<2,Pt+=$t+=y.r=a[Q],Mt+=qt+=y.g=a[Q+1],Nt+=Qt+=y.b=a[Q+2],Ot+=Gt+=y.a=a[Q+3],y=y.next,Xt+=lt=x.r,Ht+=ct=x.g,Yt+=ut=x.b,Wt+=q=x.a,$t-=lt,qt-=ct,Qt-=ut,Gt-=q,x=x.next,b+=s}}return l}var Ee=function l(){us(this,l),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function ms(){let{DOMParser:l}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:l,createCanvas(e,s){return new OffscreenCanvas(e,s)},async createImage(e){const i=await(await fetch(e)).blob();return await createImageBitmap(i)}};return(typeof globalThis.DOMParser<"u"||typeof l>"u")&&Reflect.deleteProperty(t,"DOMParser"),t}function xs(l){let{DOMParser:t,canvas:e,fetch:s}=l;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,fetch:s,createCanvas:e.createCanvas,createImage:e.loadImage}}var Pi=Object.freeze({__proto__:null,offscreen:ms,node:xs});function bt(l){return l.replace(/(?!\u3000)\s+/gm," ")}function bs(l){return l.replace(/^[\n \t]+/,"")}function vs(l){return l.replace(/[\n \t]+$/,"")}function $(l){const t=l.match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm);return t?t.map(parseFloat):[]}function As(l){const t=$(l);return[t[0]||0,t[1]||0,t[2]||0,t[3]||0,t[4]||0,t[5]||0]}const Ss=/^[A-Z-]+$/;function Ts(l){return Ss.test(l)?l.toLowerCase():l}function Xe(l){const t=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(l);return t&&(t[2]||t[3]||t[4])||""}function ws(l){if(!l.startsWith("rgb"))return l;let t=3;return l.replace(/\d+(\.\d+)?/g,(s,i)=>t--&&i?String(Math.round(parseFloat(s))):s)}const Cs=/(\[[^\]]+\])/g,Es=/(#[^\s+>~.[:]+)/g,Ps=/(\.[^\s+>~.[:]+)/g,Ms=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,Ns=/(:[\w-]+\([^)]*\))/gi,Os=/(:[^\s+>~.[:]+)/g,Vs=/([^\s+>~.[:]+)/g;function ft(l,t){const e=t.exec(l);return e?[l.replace(t," "),e.length]:[l,0]}function ks(l){const t=[0,0,0];let e=l.replace(/:not\(([^)]*)\)/g,"     $1 ").replace(/{[\s\S]*/gm," "),s=0;return[e,s]=ft(e,Cs),t[1]+=s,[e,s]=ft(e,Es),t[0]+=s,[e,s]=ft(e,Ps),t[1]+=s,[e,s]=ft(e,Ms),t[2]+=s,[e,s]=ft(e,Ns),t[1]+=s,[e,s]=ft(e,Os),t[1]+=s,e=e.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[e,s]=ft(e,Vs),t[2]+=s,t.join("")}const xt=1e-8;function Pe(l){return Math.sqrt(Math.pow(l[0],2)+Math.pow(l[1],2))}function re(l,t){return(l[0]*t[0]+l[1]*t[1])/(Pe(l)*Pe(t))}function Me(l,t){return(l[0]*t[1]<l[1]*t[0]?-1:1)*Math.acos(re(l,t))}function Ne(l){return l*l*l}function Oe(l){return 3*l*l*(1-l)}function Ve(l){return 3*l*(1-l)*(1-l)}function ke(l){return(1-l)*(1-l)*(1-l)}function Re(l){return l*l}function Le(l){return 2*l*(1-l)}function Ie(l){return(1-l)*(1-l)}class A{static empty(t){return new A(t,"EMPTY","")}split(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:" ";const{document:e,name:s}=this;return bt(this.getString()).trim().split(t).map(i=>new A(e,s,i))}hasValue(t){const e=this.value;return e!==null&&e!==""&&(t||e!==0)&&typeof e<"u"}isString(t){const{value:e}=this,s=typeof e=="string";return!s||!t?s:t.test(e)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;const t=this.getString();switch(!0){case t.endsWith("px"):case/^[0-9]+$/.test(t):return!0;default:return!1}}setValue(t){return this.value=t,this}getValue(t){return typeof t>"u"||this.hasValue()?this.value:t}getNumber(t){if(!this.hasValue())return typeof t>"u"?0:parseFloat(t);const{value:e}=this;let s=parseFloat(e);return this.isString(/%$/)&&(s/=100),s}getString(t){return typeof t>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(t)}getColor(t){let e=this.getString(t);return this.isNormalizedColor||(this.isNormalizedColor=!0,e=ws(e),this.value=e),e}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}
2getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;const[s,i]=typeof t=="boolean"?[void 0,t]:[t],{viewPort:r}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(r.computeSize("x"),r.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(r.computeSize("x"),r.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*r.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*r.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()*r.computeSize(s);default:{const a=this.getNumber();return e&&a<1?a*r.computeSize(s):a}}}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(){const t=this.getString(),e=/#([^)'"]+)/.exec(t),s=e?.[1]||t;return this.document.definitions.get(s)}getFillStyleDefinition(t,e){let s=this.getDefinition();if(!s)return null;if(typeof s.createGradient=="function"&&"getBoundingBox"in t)return s.createGradient(this.document.ctx,t,e);if(typeof s.createPattern=="function"){if(s.getHrefAttribute().hasValue()){const i=s.getAttribute("patternTransform");s=s.getHrefAttribute().getDefinition(),s&&i.hasValue()&&s.getAttribute("patternTransform",!0).setValue(i.value)}if(s)return s.createPattern(this.document.ctx,t,e)}return null}getTextBaseline(){if(!this.hasValue())return null;const t=this.getString();return A.textBaselineMapping[t]||null}addOpacity(t){let e=this.getColor();const s=e.length;let i=0;for(let r=0;r<s&&(e[r]===","&&i++,i!==3);r++);if(t.hasValue()&&this.isString()&&i!==3){const r=new se(e);r.ok&&(r.alpha=t.getNumber(),e=r.toRGBA())}return new A(this.document,this.name,e)}constructor(t,e,s){this.document=t,this.name=e,this.value=s,this.isNormalizedColor=!1}}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 St{clear(){this.viewPorts=[]}setCurrent(t,e){this.viewPorts.push({width:t,height:e})}removeCurrent(){this.viewPorts.pop()}getRoot(){const[t]=this.viewPorts;return t||De()}getCurrent(){const{viewPorts:t}=this,e=t[t.length-1];return e||De()}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(t){return typeof t=="number"?t:t==="x"?this.width:t==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}constructor(){this.viewPorts=[]}}St.DEFAULT_VIEWPORT_WIDTH=800;St.DEFAULT_VIEWPORT_HEIGHT=600;function De(){return{width:St.DEFAULT_VIEWPORT_WIDTH,height:St.DEFAULT_VIEWPORT_HEIGHT}}class V{static parse(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const[s=e,i=e]=$(t);return new V(s,i)}static parseScale(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const[s=e,i=s]=$(t);return new V(s,i)}static parsePath(t){const e=$(t),s=e.length,i=[];for(let r=0;r<s;r+=2)i.push(new V(e[r],e[r+1]));return i}angleTo(t){return Math.atan2(t.y-this.y,t.x-this.x)}applyTransform(t){const{x:e,y:s}=this,i=e*t[0]+s*t[2]+t[4],r=e*t[1]+s*t[3]+t[5];this.x=i,this.y=r}constructor(t,e){this.x=t,this.y=e}}class Rs{isWorking(){return this.working}
2start(){if(this.working)return;const{screen:t,onClick:e,onMouseMove:s}=this,i=t.ctx.canvas;i.onclick=e,i.onmousemove=s,this.working=!0}stop(){if(!this.working)return;const t=this.screen.ctx.canvas;this.working=!1,t.onclick=null,t.onmousemove=null}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(!this.working)return;const{screen:t,events:e,eventElements:s}=this,{style:i}=t.ctx.canvas;let r;i&&(i.cursor=""),e.forEach((a,n)=>{let{run:o}=a;for(r=s[n];r;)o(r),r=r.parent}),this.events=[],this.eventElements=[]}checkPath(t,e){if(!this.working||!e)return;const{events:s,eventElements:i}=this;s.forEach((r,a)=>{let{x:n,y:o}=r;!i[a]&&e.isPointInPath&&e.isPointInPath(n,o)&&(i[a]=t)})}checkBoundingBox(t,e){if(!this.working||!e)return;const{events:s,eventElements:i}=this;s.forEach((r,a)=>{let{x:n,y:o}=r;!i[a]&&e.isPointInBox(n,o)&&(i[a]=t)})}mapXY(t,e){const{window:s,ctx:i}=this.screen,r=new V(t,e);let a=i.canvas;for(;a;)r.x-=a.offsetLeft,r.y-=a.offsetTop,a=a.offsetParent;return s?.scrollX&&(r.x+=s.scrollX),s?.scrollY&&(r.y+=s.scrollY),r}onClick(t){const{x:e,y:s}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onclick",x:e,y:s,run(i){i.onClick&&i.onClick()}})}onMouseMove(t){const{x:e,y:s}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onmousemove",x:e,y:s,run(i){i.onMouseMove&&i.onMouseMove()}})}constructor(t){this.screen=t,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}}const He=typeof window<"u"?window:null,Ye=typeof fetch<"u"?fetch.bind(void 0):void 0;class it{wait(t){this.waits.push(t)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;const t=this.waits.every(e=>e());return t&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=t,t}setDefaults(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4}setViewBox(t){let{document:e,ctx:s,aspectRatio:i,width:r,desiredWidth:a,height:n,desiredHeight:o,minX:h=0,minY:c=0,refX:f,refY:g,clip:u=!1,clipX:d=0,clipY:p=0}=t;const y=bt(i).replace(/^defer\s/,""),[x,S]=y.split(" "),b=x||"xMidYMid",v=S||"meet",E=r/a,C=n/o,T=Math.min(E,C),N=Math.max(E,C);let R=a,F=o;v==="meet"&&(R*=T,F*=T),v==="slice"&&(R*=N,F*=N);const z=new A(e,"refX",f),_=new A(e,"refY",g),X=z.hasValue()&&_.hasValue();if(X&&s.translate(-T*z.getPixels("x"),-T*_.getPixels("y")),u){const B=T*d,L=T*p;s.beginPath(),s.moveTo(B,L),s.lineTo(r,L),s.lineTo(r,n),s.lineTo(B,n),s.closePath(),s.clip()}if(!X){const B=v==="meet"&&T===C,L=v==="slice"&&N===C,H=v==="meet"&&T===E,U=v==="slice"&&N===E;b.startsWith("xMid")&&(B||L)&&s.translate(r/2-R/2,0),b.endsWith("YMid")&&(H||U)&&s.translate(0,n/2-F/2),b.startsWith("xMax")&&(B||L)&&s.translate(r-R,0),b.endsWith("YMax")&&(H||U)&&s.translate(0,n-F)}switch(!0){case b==="none":s.scale(E,C);break;case v==="meet":s.scale(T,T);break;case v==="slice":s.scale(N,N);break}s.translate(-h,-c)}start(t){let{enableRedraw:e=!1,ignoreMouse:s=!1,ignoreAnimation:i=!1,ignoreDimensions:r=!1,ignoreClear:a=!1,forceRedraw:n,scaleWidth:o,scaleHeight:h,offsetX:c,offsetY:f}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{mouse:g}=this,u=1e3/it.FRAMERATE;if(this.isReadyLock=!1,this.frameDuration=u,this.readyPromise=new Promise(S=>{this.resolveReady=S}),this.isReady()&&this.render(t,r,a,o,h,c,f),!e)return;let d=Date.now(),p=d,y=0;const x=()=>{d=Date.now(),y=d-p,y>=u&&(p=d-y%u,this.shouldUpdate(i,n)&&(this.render(t,r,a,o,h,c,f),g.runEvents())),this.intervalId=jt(x)};s||g.start(),this.intervalId=jt(x)}stop(){this.intervalId&&(jt.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(t,e){if(!t){const{frameDuration:s}=this;if(this.animations.reduce((r,a)=>a.update(s)||r,!1))return!0}return!!(typeof e=="function"&&e()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(t,e,s,i,r,a,n){const{viewPort:o,ctx:h,isFirstRender:c}=this,f=h.canvas;o.clear(),f.width&&f.height&&o.setCurrent(f.width,f.height);const g=t.getStyle("width"),u=t.getStyle("height");!e&&(c||typeof i!="number"&&typeof r!="number")&&(g.hasValue()&&(f.width=g.getPixels("x"),f.style&&(f.style.width="".concat(f.width,"px"))),u.hasValue()&&(f.height=u.getPixels("y"),f.style&&(f.style.height="".concat(f.height,"px"))));let d=f.clientWidth||f.width,p=f.clientHeight||f.height;if(e&&g.hasValue()&&u.hasValue()&&(d=g.getPixels("x"),p=u.getPixels("y")),o.setCurrent(d,p),typeof a=="number"&&t.getAttribute("x",!0).setValue(a),typeof n=="number"&&t.getAttribute("y",!0).setValue(n),typeof i=="number"||typeof r=="number"){const y=$(t.getAttribute("viewBox").getString());let x=0,S=0;if(typeof i=="number"){const v=t.getStyle("width");v.hasValue()?x=v.getPixels("x")/i:y[2]&&!isNaN(y[2])&&(x=y[2]/i)}if(typeof r=="number"){const v=t.getStyle("height");v.hasValue()?S=v.getPixels("y")/r:y[3]&&!isNaN(y[3])&&(S=y[3]/r)}x||(x=S),S||(S=x),t.getAttribute("width",!0).setValue(i),t.getAttribute("height",!0).setValue(r);const b=t.getStyle("transform",!0,!0);b.setValue("".concat(b.getString()," scale(").concat(1/x,", ").concat(1/S,")"))}s||h.clearRect(0,0,d,p),t.render(h),c&&(this.isFirstRender=!1)}constructor(t,{fetch:e=Ye,window:s=He}={}){if(this.ctx=t,this.viewPort=new St,this.mouse=new Rs(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=s,!e)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");this.fetch=e}}it.defaultWindow=He;it.defaultFetch=Ye;it.FRAMERATE=30;it.MAX_VIRTUAL_PIXELS=3e4;const{defaultFetch:Ls}=it,Is=typeof DOMParser<"u"?DOMParser:void 0;class te{async parse(t){return t.startsWith("<")?this.parseFromString(t):this.load(t)}parseFromString(t){const e=new this.DOMParser;try{return this.checkDocument(e.parseFromString(t,"image/svg+xml"))}catch{return this.checkDocument(e.parseFromString(t,"text/xml"))}}checkDocument(t){const e=t.getElementsByTagName("parsererror")[0];if(e)throw new Error(e.textContent||"Unknown parse error");return t}async load(t){const s=await(await this.fetch(t)).text();return this.parseFromString(s)}constructor({fetch:t=Ls,DOMParser:e=Is}={}){if(!t)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");
2if(!e)throw new Error("Can't find 'DOMParser' in 'globalThis', please provide it via options");this.fetch=t,this.DOMParser=e}}class Ds{apply(t){const{x:e,y:s}=this.point;t.translate(e||0,s||0)}unapply(t){const{x:e,y:s}=this.point;t.translate(-1*e||0,-1*s||0)}applyToPoint(t){const{x:e,y:s}=this.point;t.applyTransform([1,0,0,1,e||0,s||0])}constructor(t,e){this.type="translate",this.point=V.parse(e)}}class Bs{apply(t){const{cx:e,cy:s,originX:i,originY:r,angle:a}=this,n=e+i.getPixels("x"),o=s+r.getPixels("y");t.translate(n,o),t.rotate(a.getRadians()),t.translate(-n,-o)}unapply(t){const{cx:e,cy:s,originX:i,originY:r,angle:a}=this,n=e+i.getPixels("x"),o=s+r.getPixels("y");t.translate(n,o),t.rotate(-1*a.getRadians()),t.translate(-n,-o)}applyToPoint(t){const{cx:e,cy:s,angle:i}=this,r=i.getRadians();t.applyTransform([1,0,0,1,e||0,s||0]),t.applyTransform([Math.cos(r),Math.sin(r),-Math.sin(r),Math.cos(r),0,0]),t.applyTransform([1,0,0,1,-e||0,-s||0])}constructor(t,e,s){this.type="rotate";const i=$(e);this.angle=new A(t,"angle",i[0]),this.originX=s[0],this.originY=s[1],this.cx=i[1]||0,this.cy=i[2]||0}}class _s{apply(t){const{scale:{x:e,y:s},originX:i,originY:r}=this,a=i.getPixels("x"),n=r.getPixels("y");t.translate(a,n),t.scale(e,s||e),t.translate(-a,-n)}unapply(t){const{scale:{x:e,y:s},originX:i,originY:r}=this,a=i.getPixels("x"),n=r.getPixels("y");t.translate(a,n),t.scale(1/e,1/s||e),t.translate(-a,-n)}applyToPoint(t){const{x:e,y:s}=this.scale;t.applyTransform([e||0,0,0,s||0,0,0])}constructor(t,e,s){this.type="scale";const i=V.parseScale(e);(i.x===0||i.y===0)&&(i.x=xt,i.y=xt),this.scale=i,this.originX=s[0],this.originY=s[1]}}class We{apply(t){const{originX:e,originY:s,matrix:i}=this,r=e.getPixels("x"),a=s.getPixels("y");t.translate(r,a),t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),t.translate(-r,-a)}unapply(t){const{originX:e,originY:s,matrix:i}=this,r=i[0],a=i[2],n=i[4],o=i[1],h=i[3],c=i[5],f=0,g=0,u=1,d=1/(r*(h*u-c*g)-a*(o*u-c*f)+n*(o*g-h*f)),p=e.getPixels("x"),y=s.getPixels("y");t.translate(p,y),t.transform(d*(h*u-c*g),d*(c*f-o*u),d*(n*g-a*u),d*(r*u-n*f),d*(a*c-n*h),d*(n*o-r*c)),t.translate(-p,-y)}applyToPoint(t){t.applyTransform(this.matrix)}constructor(t,e,s){this.type="matrix",this.matrix=As(e),this.originX=s[0],this.originY=s[1]}}class qe extends We{constructor(t,e,s){super(t,e,s),this.type="skew",this.angle=new A(t,"angle",e)}}class Fs extends qe{constructor(t,e,s){super(t,e,s),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class zs extends qe{constructor(t,e,s){super(t,e,s),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function Us(l){return bt(l).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function Xs(l){const[t="",e=""]=l.split("(");return[t.trim(),e.trim().replace(")","")]}class dt{static fromElement(t,e){const s=e.getStyle("transform",!1,!0);if(s.hasValue()){const[i,r=i]=e.getStyle("transform-origin",!1,!0).split();if(i&&r){const a=[i,r];return new dt(t,s.getString(),a)}}return null}
2apply(t){this.transforms.forEach(e=>e.apply(t))}unapply(t){this.transforms.forEach(e=>e.unapply(t))}applyToPoint(t){this.transforms.forEach(e=>e.applyToPoint(t))}constructor(t,e,s){this.document=t,this.transforms=[],Us(e).forEach(r=>{if(r==="none")return;const[a,n]=Xs(r),o=dt.transformTypes[a];o&&this.transforms.push(new o(this.document,n,s))})}}dt.transformTypes={translate:Ds,rotate:Bs,scale:_s,matrix:We,skewX:Fs,skewY:zs};class M{getAttribute(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const s=this.attributes.get(t);if(!s&&e){const i=new A(this.document,t,"");return this.attributes.set(t,i),i}return s||A.empty(this.document)}getHrefAttribute(){let t;for(const[e,s]of this.attributes)if(e==="href"||e.endsWith(":href")){t=s;break}return t||A.empty(this.document)}getStyle(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=this.styles.get(t);if(i)return i;const r=this.getAttribute(t);if(r.hasValue())return this.styles.set(t,r),r;if(!s){const{parent:a}=this;if(a){const n=a.getStyle(t);if(n.hasValue())return n}}if(e){const a=new A(this.document,t,"");return this.styles.set(t,a),a}return A.empty(this.document)}render(t){if(!(this.getStyle("display").getString()==="none"||this.get
2Style("visibility").getString()==="hidden")){if(t.save(),this.getStyle("mask").hasValue()){const e=this.getStyle("mask").getDefinition();e&&(this.applyEffects(t),e.apply(t,this))}else if(this.getStyle("filter").getValue("none")!=="none"){const e=this.getStyle("filter").getDefinition();e&&(this.applyEffects(t),e.apply(t,this))}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}setContext(t){}applyEffects(t){const e=dt.fromElement(this.document,this);e&&e.apply(t);const s=this.getStyle("clip-path",!1,!0);if(s.hasValue()){const i=s.getDefinition();i&&i.apply(t)}}clearContext(t){}renderChildren(t){this.children.forEach(e=>{e.render(t)})}addChild(t){const e=t instanceof M?t:this.document.createElement(t);e.parent=this,M.ignoreChildTypes.includes(e.type)||this.children.push(e)}matchesSelector(t){var e;const{node:s}=this;if(typeof s.matches=="function")return s.matches(t);const i=(e=s.getAttribute)===null||e===void 0?void 0:e.call(s,"class");return!i||i===""?!1:i.split(" ").some(r=>".".concat(r)===t)}addStylesFromStyleDefinition(){const{styles:t,stylesSpecificity:e}=this.document;for(const[s,i]of t)if(!s.startsWith("@")&&this.matchesSelector(s)){const r=e.get(s);if(i)for(const[a,n]of i){let o=this.stylesSpecificity.get(a);typeof o>"u"&&(o="000"),r&&r>=o&&(n&&this.styles.set(a,n),this.stylesSpecificity.set(a,r))}}}removeStyles(t,e){return e.reduce((i,r)=>{const a=t.getStyle(r);if(!a.hasValue())return i;const n=a.getString();return a.setValue(""),[...i,[r,n]]},[])}restoreStyles(t,e){e.forEach(s=>{let[i,r]=s;t.getStyle(i,!0).setValue(r)})}isFirstChild(){var t;return((t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))===0}constructor(t,e,s=!1){if(this.document=t,this.node=e,this.captureTextNodes=s,this.type="",this.attributes=new Map,this.styles=new Map,this.stylesSpecificity=new Map,this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!e||e.nodeType!==1)return;Array.from(e.attributes).forEach(a=>{const n=Ts(a.nodeName);this.attributes.set(n,new A(t,n,a.value))}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()&&this.getAttribute("style").getString().split(";").map(n=>n.trim()).forEach(n=>{if(!n)return;const[o,h]=n.split(":").map(c=>c.trim());o&&this.styles.set(o,new A(t,o,h))});const{definitions:i}=t,r=this.getAttribute("id");r.hasValue()&&(i.has(r.getString())||i.set(r.getString(),this)),Array.from(e.childNodes).forEach(a=>{if(a.nodeType===1)this.addChild(a);else if(s&&(a.nodeType===3||a.nodeType===4)){const n=t.createTextNode(a);n.getText().length>0&&this.addChild(n)}})}}M.ignoreChildTypes=["title"];class Hs extends M{constructor(t,e,s){super(t,e,s)}}function Ys(l){const t=l.trim();return/^('|")/.test(t)?t:'"'.concat(t,'"')}function Ws(l){return typeof process>"u"?l:l.trim().split(",").map(Ys).join(",")}function qs(l){if(!l)return"";const t=l.trim().toLowerCase();switch(t){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return t;default:return/^oblique\s+(-|)\d+deg$/.test(t)?t:""}}function Qs(l){if(!l)return"";const t=l.trim().toLowerCase();switch(t){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return t;default:return/^[\d.]+$/.test(t)?t:""}}class W{static parse(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,s="",i="",r="",a="",n="";const o=bt(t).trim().split(" "),h={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return o.forEach(c=>{switch(!0){case(!h.fontStyle&&W.styles.includes(c)):c!=="inherit"&&(s=c),h.fontStyle=!0;break;case(!h.fontVariant&&W.variants.includes(c)):c!=="inherit"&&(i=c),h.fontStyle=!0,h.fontVariant=!0;break;case(!h.fontWeight&&W.weights.includes(c)):c!=="inherit"&&(r=c),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0;break;case!h.fontSize:c!=="inherit"&&(a=c.split("/")[0]||""),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0,h.fontSize=!0;break;default:c!=="inherit"&&(n+=c)}}),new W(s,i,r,a,n,e)}toString(){return[qs(this.fontStyle),this.fontVariant,Qs(this.fontWeight),this.fontSize,Ws(this.fontFamily)].join(" ").trim()}
2constructor(t,e,s,i,r,a){const n=a?typeof a=="string"?W.parse(a):a:{};this.fontFamily=r||n.fontFamily,this.fontSize=i||n.fontSize,this.fontStyle=t||n.fontStyle,this.fontWeight=s||n.fontWeight,this.fontVariant=e||n.fontVariant}}W.styles="normal|italic|oblique|inherit";W.variants="normal|small-caps|inherit";W.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class J{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(t,e){typeof t<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),typeof e<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))}addX(t){this.addPoint(t,0)}addY(t){this.addPoint(0,t)}addBoundingBox(t){if(!t)return;const{x1:e,y1:s,x2:i,y2:r}=t;this.addPoint(e,s),this.addPoint(i,r)}sumCubic(t,e,s,i,r){return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*s+3*(1-t)*Math.pow(t,2)*i+Math.pow(t,3)*r}bezierCurveAdd(t,e,s,i,r){const a=6*e-12*s+6*i,n=-3*e+9*s-9*i+3*r,o=3*s-3*e;if(n===0){if(a===0)return;const g=-o/a;0<g&&g<1&&(t?this.addX(this.sumCubic(g,e,s,i,r)):this.addY(this.sumCubic(g,e,s,i,r)));return}const h=Math.pow(a,2)-4*o*n;if(h<0)return;const c=(-a+Math.sqrt(h))/(2*n);0<c&&c<1&&(t?this.addX(this.sumCubic(c,e,s,i,r)):this.addY(this.sumCubic(c,e,s,i,r)));const f=(-a-Math.sqrt(h))/(2*n);0<f&&f<1&&(t?this.addX(this.sumCubic(f,e,s,i,r)):this.addY(this.sumCubic(f,e,s,i,r)))}addBezierCurve(t,e,s,i,r,a,n,o){this.addPoint(t,e),this.addPoint(n,o),this.bezierCurveAdd(!0,t,s,r,n),this.bezierCurveAdd(!1,e,i,a,o)}addQuadraticCurve(t,e,s,i,r,a){const n=t+.6666666666666666*(s-t),o=e+2/3*(i-e),h=n+1/3*(r-t),c=o+1/3*(a-e);this.addBezierCurve(t,e,n,h,o,c,r,a)}isPointInBox(t,e){const{x1:s,y1:i,x2:r,y2:a}=this;return s<=t&&t<=r&&i<=e&&e<=a}constructor(t=Number.NaN,e=Number.NaN,s=Number.NaN,i=Number.NaN){this.x1=t,this.y1=e,this.x2=s,this.y2=i,this.addPoint(t,e),this.addPoint(s,i)}}class pt extends M{calculateOpacity(){let t=1,e=this;for(;e;){const s=e.getStyle("opacity",!1,!0);s.hasValue(!0)&&(t*=s.getNumber()),e=e.parent}return t}setContext(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!e){const s=this.getStyle("fill"),i=this.getStyle("fill-opacity"),r=this.getStyle("stroke"),a=this.getStyle("stroke-opacity");if(s.isUrlDefinition()){const u=s.getFillStyleDefinition(this,i);u&&(t.fillStyle=u)}else if(s.hasValue()){s.getString()==="currentColor"&&s.setValue(this.getStyle("color").getColor());const u=s.getColor();u!=="inherit"&&(t.fillStyle=u==="none"?"rgba(0,0,0,0)":u)}if(i.hasValue()){const u=new A(this.document,"fill",t.fillStyle).addOpacity(i).getColor();t.fillStyle=u}if(r.isUrlDefinition()){const u=r.getFillStyleDefinition(this,a);u&&(t.strokeStyle=u)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());const u=r.getString();u!=="inherit"&&(t.strokeStyle=u==="none"?"rgba(0,0,0,0)":u)}if(a.hasValue()){const u=new A(this.document,"stroke",t.strokeStyle).addOpacity(a).getString();t.strokeStyle=u}const n=this.getStyle("stroke-width");if(n.hasValue()){const u=n.getPixels();t.lineWidth=u||xt}const o=this.getStyle("stroke-linecap"),h=this.getStyle("stroke-linejoin"),c=this.getStyle("stroke-miterlimit"),f=this.getStyle("stroke-dasharray"),g=this.getStyle("stroke-dashoffset");if(o.hasValue()&&(t.lineCap=o.getString()),h.hasValue()&&(t.lineJoin=h.getString()),c.hasValue()&&(t.miterLimit=c.getNumber()),f.hasValue()&&f.getString()!=="none"){const u=$(f.getString());typeof t.setLineDash<"u"?t.setLineDash(u):typeof t.webkitLineDash<"u"?t.webkitLineDash=u:typeof t.mozDash<"u"&&!(u.length===1&&u[0]===0)&&(t.mozDash=u);const d=g.getPixels();typeof t.lineDashOffset<"u"?t.lineDashOffset=d:typeof t.webkitLineDashOffset<"u"?t.webkitLineDashOffset=d:typeof t.mozDashOffset<"u"&&(t.mozDashOffset=d)}}if(this.modifiedEmSizeStack=!1,typeof t.font<"u"){const s=this.getStyle("font"),i=this.getStyle("font-style"),r=this.getStyle("font-variant"),a=this.getStyle("font-weight"),n=this.getStyle("font-size"),o=this.getStyle("font-family"),h=new W(i.getString(),r.getString(),a.getString(),n.hasValue()?"".concat(n.getPixels(!0),"px"):"",o.getString(),W.parse(s.getString(),t.font));i.setValue(h.fontStyle),r.setValue(h.fontVariant),a.setValue(h.fontWeight),n.setValue(h.fontSize),o.setValue(h.fontFamily),t.font=h.toString(),n.isPixels()&&(this.document.emSize=n.getPixels(),this.modifiedEmSizeStack=!0)}e||(this.applyEffects(t),t.globalAlpha=this.calculateOpacity())}clearContext(t){super.clearContext(t),this.modifiedEmSizeStack&&this.document.popEmSize()}constructor(...t){super(...t),this.modifiedEmSizeStack=!1}}class ot extends pt{setContext(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(t,e);const s=this.getStyle("dominant-baseline").getTextBaseline()||this.get
2Style("alignment-baseline").getTextBaseline();s&&(t.textBaseline=s)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(t){if(this.type!=="text")return this.getTElementBoundingBox(t);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t);let e=null;return this.children.forEach((s,i)=>{const r=this.getChildBoundingBox(t,this,this,i);e?e.addBoundingBox(r):e=r}),e}getFontSize(){const{document:t,parent:e}=this,s=W.parse(t.ctx.font).fontSize;return e.getStyle("font-size").getNumber(s)}getTElementBoundingBox(t){const e=this.getFontSize();return new J(this.x,this.y-e,this.x+this.measureText(t),this.y)}getGlyph(t,e,s){const i=e[s];let r;if(t.isArabic){var a;const n=e.length,o=e[s-1],h=e[s+1];let c="isolated";(s===0||o===" ")&&s<n-1&&h!==" "&&(c="terminal"),s>0&&o!==" "&&s<n-1&&h!==" "&&(c="medial"),s>0&&o!==" "&&(s===n-1||h===" ")&&(c="initial"),r=((a=t.arabicGlyphs.get(i))===null||a===void 0?void 0:a.get(c))||t.glyphs.get(i)}else r=t.glyphs.get(i);return r||(r=t.missingGlyph),r}getText(){return""}getTextFromNode(t){const e=t||this.node,s=Array.from(e.parentNode.childNodes),i=s.indexOf(e),r=s.length-1;let a=bt(e.textContent||"");return i===0&&(a=bs(a)),i===r&&(a=vs(a)),a}renderChildren(t){if(this.type!=="text"){this.renderTElementChildren(t);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t),this.children.forEach((s,i)=>{this.renderChild(t,this,this,i)});const{mouse:e}=this.document.screen;e.isWorking()&&e.checkBoundingBox(this,this.getBoundingBox(t))}renderTElementChildren(t){const{document:e,parent:s}=this,i=this.getText(),r=s.getStyle("font-family").getDefinition();if(r){const{unitsPerEm:o}=r.fontFace,h=W.parse(e.ctx.font),c=s.getStyle("font-size").getNumber(h.fontSize),f=s.getStyle("font-style").getString(h.fontStyle),g=c/o,u=r.isRTL?i.split("").reverse().join(""):i,d=$(s.getAttribute("dx").getString()),p=u.length;for(let y=0;y<p;y++){const x=this.getGlyph(r,u,y);t.translate(this.x,this.y),t.scale(g,-g);const S=t.lineWidth;t.lineWidth=t.lineWidth*o/c,f==="italic"&&t.transform(1,0,.4,1,0,0),x.render(t),f==="italic"&&t.transform(1,0,-.4,1,0,0),t.lineWidth=S,t.scale(1/g,-1/g),t.translate(-this.x,-this.y),this.x+=c*(x.horizAdvX||r.horizAdvX)/o,typeof d[y]<"u"&&!isNaN(d[y])&&(this.x+=d[y])}return}const{x:a,y:n}=this;t.fillStyle&&t.fillText(i,a,n),t.strokeStyle&&t.strokeText(i,a,n)}applyAnchoring(){if(this.textChunkStart>=this.leafTexts.length)return;const t=this.leafTexts[this.textChunkStart],e=t.getStyle("text-anchor").getString("start"),s=!1;let i=0;e==="start"&&!s||e==="end"&&s?i=t.x-this.minX:e==="end"&&!s||e==="start"&&s?i=t.x-this.maxX:i=t.x-(this.minX+this.maxX)/2;for(let r=this.textChunkStart;r<this.leafTexts.length;r++)this.leafTexts[r].x+=i;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}adjustChildCoordinatesRecursive(t){this.children.forEach((e,s)=>{this.adjustChildCoordinatesRecursiveCore(t,this,this,s)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(t,e,s,i){const r=s.children[i];r.children.length>0?r.children.forEach((a,n)=>{e.adjustChildCoordinatesRecursiveCore(t,e,r,n)}):this.adjustChildCoordinates(t,e,s,i)}adjustChildCoordinates(t,e,s,i){const r=s.children[i];if(typeof r.measureText!="function")return r;t.save(),r.setContext(t,!0);const a=r.getAttribute("x"),n=r.getAttribute("y"),o=r.getAttribute("dx"),h=r.getAttribute("dy"),c=r.getStyle("font-family").getDefinition(),f=!!c?.isRTL;i===0&&(a.hasValue()||a.setValue(r.getInheritedAttribute("x")),n.hasValue()||n.setValue(r.getInheritedAttribute("y")),o.hasValue()||o.setValue(r.getInheritedAttribute("dx")),h.hasValue()||h.setValue(r.getInheritedAttribute("dy")));const g=r.measureText(t);return f&&(e.x-=g),a.hasValue()?(e.applyAnchoring(),r.x=a.getPixels("x"),o.hasValue()&&(r.x+=o.getPixels("x"))):(o.hasValue()&&(e.x+=o.getPixels("x")),r.x=e.x),e.x=r.x,f||(e.x+=g),n.hasValue()?(r.y=n.getPixels("y"),h.hasValue()&&(r.y+=h.getPixels("y"))):(h.hasValue()&&(e.y+=h.getPixels("y")),r.y=e.y),e.y=r.y,e.leafTexts.push(r),e.minX=Math.min(e.minX,r.x,r.x+g),e.maxX=Math.max(e.maxX,r.x,r.x+g),r.clearContext(t),t.restore(
2),r}getChildBoundingBox(t,e,s,i){const r=s.children[i];if(typeof r.getBoundingBox!="function")return null;const a=r.getBoundingBox(t);return a&&r.children.forEach((n,o)=>{const h=e.getChildBoundingBox(t,e,r,o);a.addBoundingBox(h)}),a}renderChild(t,e,s,i){const r=s.children[i];r.render(t),r.children.forEach((a,n)=>{e.renderChild(t,e,r,n)})}measureText(t){const{measureCache:e}=this;if(~e)return e;const s=this.getText(),i=this.measureTargetText(t,s);return this.measureCache=i,i}measureTargetText(t,e){if(!e.length)return 0;const{parent:s}=this,i=s.getStyle("font-family").getDefinition();if(i){const a=this.getFontSize(),n=i.isRTL?e.split("").reverse().join(""):e,o=$(s.getAttribute("dx").getString()),h=n.length;let c=0;for(let f=0;f<h;f++){const g=this.getGlyph(i,n,f);c+=(g.horizAdvX||i.horizAdvX)*a/i.fontFace.unitsPerEm,typeof o[f]<"u"&&!isNaN(o[f])&&(c+=o[f])}return c}if(!t.measureText)return e.length*10;t.save(),this.setContext(t,!0);const{width:r}=t.measureText(e);return this.clearContext(t),t.restore(),r}getInheritedAttribute(t){let e=this;for(;e instanceof ot&&e.isFirstChild()&&e.parent;){const s=e.parent.getAttribute(t);if(s.hasValue(!0))return s.getString("0");e=e.parent}return null}constructor(t,e,s){super(t,e,new.target===ot?!0:s),this.type="text",this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.measureCache=-1}}class Dt extends ot{getText(){return this.text}constructor(t,e,s){super(t,e,new.target===Dt?!0:s),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}}class Gs extends Dt{constructor(...t){super(...t),this.type="textNode"}}class w extends m{reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new V(0,0),this.control=new V(0,0),this.current=new V(0,0),this.points=[],this.angles=[]}isEnd(){const{i:t,commands:e}=this;return t>=e.length-1}next(){const t=this.commands[++this.i];return this.previousCommand=this.command,this.command=t,t}getPoint(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y";const s=new V(this.command[t],this.command[e]);return this.makeAbsolute(s)}getAsControlPoint(t,e){const s=this.getPoint(t,e);return this.control=s,s}getAsCurrentPoint(t,e){const s=this.getPoint(t,e);return this.current=s,s}getReflectedControlPoint(){const t=this.previousCommand.type;if(t!==m.CURVE_TO&&t!==m.SMOOTH_CURVE_TO&&t!==m.QUAD_TO&&t!==m.SMOOTH_QUAD_TO)return this.current;const{current:{x:e,y:s},control:{x:i,y:r}}=this;return new V(2*e-i,2*s-r)}makeAbsolute(t){if(this.command.relative){const{x:e,y:s}=this.current;t.x+=e,t.y+=s}return t}addMarker(t,e,s){const{points:i,angles:r}=this;s&&r.length>0&&!r[r.length-1]&&(r[r.length-1]=i[i.length-1].angleTo(s)),this.addMarkerAngle(t,e?e.angleTo(t):null)}addMarkerAngle(t,e){this.points.push(t),this.angles.push(e)}getMarkerPoints(){return this.points}getMarkerAngles(){const{angles:t}=this,e=t.length;for(let s=0;s<e;s++)if(!t[s]){for(let i=s+1;i<e;i++)if(t[i]){t[s]=t[i];break}}return t}constructor(t){super(t.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=new V(0,0),this.start=new V(0,0),this.current=new V(0,0),this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}}class P extends pt{path(t){const{pathParser:e}=this,s=new J;for(e.reset(),t&&t.beginPath();!e.isEnd();)switch(e.next().type){case w.MOVE_TO:this.pathM(t,s);break;case w.LINE_TO:this.pathL(t,s);break;case w.HORIZ_LINE_TO:this.pathH(t,s);break;case w.VERT_LINE_TO:this.pathV(t,s);break;case w.CURVE_TO:this.pathC(t,s);break;case w.SMOOTH_CURVE_TO:this.pathS(t,s);break;case w.QUAD_TO:this.pathQ(t,s);break;case w.SMOOTH_QUAD_TO:this.pathT(t,s);break;case w.ARC:this.pathA(t,s);break;case w.CLOSE_PATH:this.pathZ(t,s);break}return s}getBoundingBox(t){return this.path()}getMarkers(){const{pathParser:t}=this,e=t.getMarkerPoints(),s=t.getMarkerAngles();return e.map((r,a)=>[r,s[a]])}renderChildren(t){this.path(t),this.document.screen.mouse.checkPath(this,t);const e=this.getStyle("fill-rule");t.fillStyle!==""&&(e.getString("inherit")!=="inherit"?t.fill(e.getString()):t.fill()),t.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(t.save(),t.setTransform(1,0,0,1,0,0),t.stroke(),t.restore(
2)):t.stroke());const s=this.getMarkers();if(s){const i=s.length-1,r=this.getStyle("marker-start"),a=this.getStyle("marker-mid"),n=this.getStyle("marker-end");if(r.isUrlDefinition()){const o=r.getDefinition(),[h,c]=s[0];o.render(t,h,c)}if(a.isUrlDefinition()){const o=a.getDefinition();for(let h=1;h<i;h++){const[c,f]=s[h];o.render(t,c,f)}}if(n.isUrlDefinition()){const o=n.getDefinition(),[h,c]=s[i];o.render(t,h,c)}}}static pathM(t){const e=t.getAsCurrentPoint();return t.start=t.current,{point:e}}pathM(t,e){const{pathParser:s}=this,{point:i}=P.pathM(s),{x:r,y:a}=i;s.addMarker(i),e.addPoint(r,a),t&&t.moveTo(r,a)}static pathL(t){const{current:e}=t,s=t.getAsCurrentPoint();return{current:e,point:s}}pathL(t,e){const{pathParser:s}=this,{current:i,point:r}=P.pathL(s),{x:a,y:n}=r;s.addMarker(r,i),e.addPoint(a,n),t&&t.lineTo(a,n)}static pathH(t){const{current:e,command:s}=t,i=new V((s.relative?e.x:0)+s.x,e.y);return t.current=i,{current:e,point:i}}pathH(t,e){const{pathParser:s}=this,{current:i,point:r}=P.pathH(s),{x:a,y:n}=r;s.addMarker(r,i),e.addPoint(a,n),t&&t.lineTo(a,n)}static pathV(t){const{current:e,command:s}=t,i=new V(e.x,(s.relative?e.y:0)+s.y);return t.current=i,{current:e,point:i}}pathV(t,e){const{pathParser:s}=this,{current:i,point:r}=P.pathV(s),{x:a,y:n}=r;s.addMarker(r,i),e.addPoint(a,n),t&&t.lineTo(a,n)}static pathC(t){const{current:e}=t,s=t.getPoint("x1","y1"),i=t.getAsControlPoint("x2","y2"),r=t.getAsCurrentPoint();return{current:e,point:s,controlPoint:i,currentPoint:r}}pathC(t,e){const{pathParser:s}=this,{current:i,point:r,controlPoint:a,currentPoint:n}=P.pathC(s);s.addMarker(n,a,r),e.addBezierCurve(i.x,i.y,r.x,r.y,a.x,a.y,n.x,n.y),t&&t.bezierCurveTo(r.x,r.y,a.x,a.y,n.x,n.y)}static pathS(t){const{current:e}=t,s=t.getReflectedControlPoint(),i=t.getAsControlPoint("x2","y2"),r=t.getAsCurrentPoint();return{current:e,point:s,controlPoint:i,currentPoint:r}}pathS(t,e){const{pathParser:s}=this,{current:i,point:r,controlPoint:a,currentPoint:n}=P.pathS(s);s.addMarker(n,a,r),e.addBezierCurve(i.x,i.y,r.x,r.y,a.x,a.y,n.x,n.y),t&&t.bezierCurveTo(r.x,r.y,a.x,a.y,n.x,n.y)}static pathQ(t){const{current:e}=t,s=t.getAsControlPoint("x1","y1"),i=t.getAsCurrentPoint();return{current:e,controlPoint:s,currentPoint:i}}pathQ(t,e){const{pathParser:s}=this,{current:i,controlPoint:r,currentPoint:a}=P.pathQ(s);s.addMarker(a,r,r),e.addQuadraticCurve(i.x,i.y,r.x,r.y,a.x,a.y),t&&t.quadraticCurveTo(r.x,r.y,a.x,a.y)}static pathT(t){const{current:e}=t,s=t.getReflectedControlPoint();t.control=s;const i=t.getAsCurrentPoint();return{current:e,controlPoint:s,currentPoint:i}}pathT(t,e){const{pathParser:s}=this,{current:i,controlPoint:r,currentPoint:a}=P.pathT(s);s.addMarker(a,r,r),e.addQuadraticCurve(i.x,i.y,r.x,r.y,a.x,a.y),t&&t.quadraticCurveTo(r.x,r.y,a.x,a.y)}static pathA(t){const{current:e,command:s}=t;let{rX:i,rY:r,xRot:a,lArcFlag:n,sweepFlag:o}=s;const h=a*(Math.PI/180),c=t.getAsCurrentPoint(),f=new V(Math.cos(h)*(e.x-c.x)/2+Math.sin(h)*(e.y-c.y)/2,-Math.sin(h)*(e.x-c.x)/2+Math.cos(h)*(e.y-c.y)/2),g=Math.pow(f.x,2)/Math.pow(i,2)+Math.pow(f.y,2)/Math.pow(r,2);g>1&&(i*=Math.sqrt(g),r*=Math.sqrt(g));let u=(n===o?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(r,2)-Math.pow(i,2)*Math.pow(f.y,2)-Math.pow(r,2)*Math.pow(f.x,2))/(Math.pow(i,2)*Math.pow(f.y,2)+Math.pow(r,2)*Math.pow(f.x,2)));isNaN(u)&&(u=0);const d=new V(u*i*f.y/r,u*-r*f.x/i),p=new V((e.x+c.x)/2+Math.cos(h)*d.x-Math.sin(h)*d.y,(e.y+c.y)/2+Math.sin(h)*d.x+Math.cos(h)*d.y),y=Me([1,0],[(f.x-d.x)/i,(f.y-d.y)/r]),x=[(f.x-d.x)/i,(f.y-d.y)/r],S=[(-f.x-d.x)/i,(-f.y-d.y)/r];let b=Me(x,S);return re(x,S)<=-1&&(b=Math.PI),re(x,S)>=1&&(b=0),{currentPoint:c,rX:i,rY:r,sweepFlag:o,xAxisRotation:h,centp:p,a1:y,ad:b}}pathA(t,e){const{pathParser:s}=this,{currentPoint:i,rX:r,rY:a,sweepFlag:n,xAxisRotation:o,centp:h,a1:c,ad:f}=P.pathA(s),g=1-n?1:-1,u=c+g*(f/2),d=new V(h.x+r*Math.cos(u),h.y+a*Math.sin(u));if(s.addMarkerAngle(d,u-g*Math.PI/2),s.addMarkerAngle(i,u-g*Math.PI),e.addPoint(i.x,i.y),t&&!isNaN(c)&&!isNaN(f)){const p=r>a?r:a,y=r>a?1:r/a,x=r>a?a/r:1;t.translate(h.x,h.y),t.rotate(o),t.scale(y,x),t.arc(0,0,p,c,c+f,!!(1-n)),t.scale(1/y,1/x),t.rotate(-o),t.translate(-h.x,-h.y)}}static pathZ(t){t.current=t.start}pathZ(t,e){P.pathZ(this.pathParser),t&&e.x1!==e.x2&&e.y1!==e.y2&&t.closePath()}constructor(t,e,s){super(t,e,s),this.type="path",this.pathParser=new w(this.getAttribute("d").getString())}}class Tt extends pt{setContext(t){var e;const{document:s}=this,{screen:i,window:r}=s,a=t.canvas;if(i.setDefaults(t),"style"in a&&typeof t.font<"u"&&r&&typeof r.getComputedStyle<"u"){t.font=r.getComputedStyle(a).getPropertyValue("font");const S=new A(s,"fontSize",W.parse(t.font).fontSize);S.hasValue()&&(s.rootEmSize=S.getPixels("y"),s.emSize=s.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);let{width:n,height:o}=i.viewPort;
2this.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");const h=this.getAttribute("refX"),c=this.getAttribute("refY"),f=this.getAttribute("viewBox"),g=f.hasValue()?$(f.getString()):null,u=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible";let d=0,p=0,y=0,x=0;g&&(d=g[0],p=g[1]),this.root||(n=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y"),this.type==="marker"&&(y=d,x=p,d=0,p=0)),i.viewPort.setCurrent(n,o),this.node&&(!this.parent||((e=this.node.parentNode)===null||e===void 0?void 0:e.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(t),t.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),g&&(n=g[2],o=g[3]),s.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:n,height:i.viewPort.height,desiredHeight:o,minX:d,minY:p,refX:h.getValue(),refY:c.getValue(),clip:u,clipX:y,clipY:x}),g&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(n,o))}clearContext(t){super.clearContext(t),this.document.screen.viewPort.removeCurrent()}resize(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=this.getAttribute("width",!0),r=this.getAttribute("height",!0),a=this.getAttribute("viewBox"),n=this.getAttribute("style"),o=i.getNumber(0),h=r.getNumber(0);if(s)if(typeof s=="string")this.getAttribute("preserveAspectRatio",!0).setValue(s);else{const c=this.getAttribute("preserveAspectRatio");c.hasValue()&&c.setValue(c.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(t),r.setValue(e),a.hasValue()||a.setValue("0 0 ".concat(o||t," ").concat(h||e)),n.hasValue()){const c=this.getStyle("width"),f=this.getStyle("height");c.hasValue()&&c.setValue("".concat(t,"px")),f.hasValue()&&f.setValue("".concat(e,"px"))}}constructor(...t){super(...t),this.type="svg",this.root=!1}}class Qe extends P{path(t){const e=this.getAttribute("x").getPixels("x"),s=this.getAttribute("y").getPixels("y"),i=this.getStyle("width",!1,!0).getPixels("x"),r=this.getStyle("height",!1,!0).getPixels("y"),a=this.getAttribute("rx"),n=this.getAttribute("ry");let o=a.getPixels("x"),h=n.getPixels("y");if(a.hasValue()&&!n.hasValue()&&(h=o),n.hasValue()&&!a.hasValue()&&(o=h),o=Math.min(o,i/2),h=Math.min(h,r/2),t){const c=4*((Math.sqrt(2)-1)/3);t.beginPath(),r>0&&i>0&&(t.moveTo(e+o,s),t.lineTo(e+i-o,s),t.bezierCurveTo(e+i-o+c*o,s,e+i,s+h-c*h,e+i,s+h),t.lineTo(e+i,s+r-h),t.bezierCurveTo(e+i,s+r-h+c*h,e+i-o+c*o,s+r,e+i-o,s+r),t.lineTo(e+o,s+r),t.bezierCurveTo(e+o-c*o,s+r,e,s+r-h+c*h,e,s+r-h),t.lineTo(e,s+h),t.bezierCurveTo(e,s+h-c*h,e+o-c*o,s,e+o,s),t.closePath())}return new J(e,s,e+i,s+r)}getMarkers(){return null}constructor(...t){super(...t),this.type="rect"}}class $s extends P{path(t){const e=this.getAttribute("cx").getPixels("x"),s=this.getAttribute("cy").getPixels("y"),i=this.getAttribute("r").getPixels();return t&&i>0&&(t.beginPath(),t.arc(e,s,i,0,Math.PI*2,!1),t.closePath()),new J(e-i,s-i,e+i,s+i)}getMarkers(){return null}constructor(...t){super(...t),this.type="circle"}}class Zs extends P{path(t){const e=4*((Math.sqrt(2)-1)/3),s=this.getAttribute("rx").getPixels("x"),i=this.getAttribute("ry").getPixels("y"),r=this.getAttribute("cx").getPixels("x"),a=this.getAttribute("cy").getPixels("y");return t&&s>0&&i>0&&(t.beginPath(),t.moveTo(r+s,a),t.bezierCurveTo(r+s,a+e*i,r+e*s,a+i,r,a+i),t.bezierCurveTo(r-e*s,a+i,r-s,a+e*i,r-s,a),t.bezierCurveTo(r-s,a-e*i,r-e*s,a-i,r,a-i),t.bezierCurveTo(r+e*s,a-i,r+s,a-e*i,r+s,a),t.closePath()),new J(r-s,a-i,r+s,a+i)}getMarkers(){return null}constructor(...t){super(...t),this.type="ellipse"}}class js extends P{getPoints(){return[new V(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new V(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(t){const[{x:e,y:s},{x:i,y:r}]=this.getPoints();return t&&(t.beginPath(),t.moveTo(e,s),t.lineTo(i,r)),new J(e,s,i,r)}getMarkers(){const[t,e]=this.getPoints(),s=t.angleTo(e);return[[t,s],[e,s]]}constructor(...t){super(...t),this.type="line"}}class Ge extends P{path(t){const{points:e}=this,[{x:s,y:i}]=e,r=new J(s,i);return t&&(t.beginPath(),t.moveTo(s,i)),e.forEach(a=>{let{x:n,y:o}=a;r.addPoint(n,o),t&&t.lineTo(n,o)}),r}
2getMarkers(){const{points:t}=this,e=t.length-1,s=[];return t.forEach((i,r)=>{r!==e&&s.push([i,i.angleTo(t[r+1])])}),s.length>0&&s.push([t[t.length-1],s[s.length-1][1]]),s}constructor(t,e,s){super(t,e,s),this.type="polyline",this.points=[],this.points=V.parsePath(this.getAttribute("points").getString())}}class Ks extends Ge{path(t){const e=super.path(t),[{x:s,y:i}]=this.points;return t&&(t.lineTo(s,i),t.closePath()),e}constructor(...t){super(...t),this.type="polygon"}}class Js extends M{createPattern(t,e,s){const i=this.getStyle("width").getPixels("x",!0),r=this.getStyle("height").getPixels("y",!0),a=new Tt(this.document,null);a.attributes.set("viewBox",new A(this.document,"viewBox",this.getAttribute("viewBox").getValue())),a.attributes.set("width",new A(this.document,"width","".concat(i,"px"))),a.attributes.set("height",new A(this.document,"height","".concat(r,"px"))),a.attributes.set("transform",new A(this.document,"transform",this.getAttribute("patternTransform").getValue())),a.children=this.children;const n=this.document.createCanvas(i,r),o=n.getContext("2d"),h=this.getAttribute("x"),c=this.getAttribute("y");h.hasValue()&&c.hasValue()&&o.translate(h.getPixels("x",!0),c.getPixels("y",!0)),s.hasValue()?this.styles.set("fill-opacity",s):this.styles.delete("fill-opacity");for(let g=-1;g<=1;g++)for(let u=-1;u<=1;u++)o.save(),a.attributes.set("x",new A(this.document,"x",g*n.width)),a.attributes.set("y",new A(this.document,"y",u*n.height)),a.render(o),o.restore();return t.createPattern(n,"repeat")}constructor(...t){super(...t),this.type="pattern"}}class ti extends M{render(t,e,s){if(!e)return;const{x:i,y:r}=e,a=this.getAttribute("orient").getString("auto"),n=this.getAttribute("markerUnits").getString("strokeWidth");t.translate(i,r),a==="auto"&&t.rotate(s),n==="strokeWidth"&&t.scale(t.lineWidth,t.lineWidth),t.save();const o=new Tt(this.document);
2o.type=this.type,o.attributes.set("viewBox",new A(this.document,"viewBox",this.getAttribute("viewBox").getValue())),o.attributes.set("refX",new A(this.document,"refX",this.getAttribute("refX").getValue())),o.attributes.set("refY",new A(this.document,"refY",this.getAttribute("refY").getValue())),o.attributes.set("width",new A(this.document,"width",this.getAttribute("markerWidth").getValue())),o.attributes.set("height",new A(this.document,"height",this.getAttribute("markerHeight").getValue())),o.attributes.set("overflow",new A(this.document,"overflow",this.getAttribute("overflow").getValue())),o.attributes.set("fill",new A(this.document,"fill",this.getAttribute("fill").getColor("black"))),o.attributes.set("stroke",new A(this.document,"stroke",this.getAttribute("stroke").getValue("none"))),o.children=this.children,o.render(t),t.restore(),n==="strokeWidth"&&t.scale(1/t.lineWidth,1/t.lineWidth),a==="auto"&&t.rotate(-s),t.translate(-i,-r)}constructor(...t){super(...t),this.type="marker"}}class ei extends M{render(){}constructor(...t){super(...t),this.type="defs"}}class ne extends pt{getBoundingBox(t){const e=new J;return this.children.forEach(s=>{e.addBoundingBox(s.getBoundingBox(t))}),e}constructor(...t){super(...t),this.type="g"}}class $e extends M{getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(t,e,s){let i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));const{stops:r}=i,a=this.getGradient(t,e);if(!a)return this.addParentOpacity(s,r[r.length-1].color);if(r.forEach(n=>{a.addColorStop(n.offset,this.addParentOpacity(s,n.color))}),this.getAttribute("gradientTransform").hasValue()){const{document:n}=this,{MAX_VIRTUAL_PIXELS:o}=it,{viewPort:h}=n.screen,c=h.getRoot(),f=new Qe(n);f.attributes.set("x",new A(n,"x",-o/3)),f.attributes.set("y",new A(n,"y",-o/3)),f.attributes.set("width",new A(n,"width",o)),f.attributes.set("height",new A(n,"height",o));const g=new ne(n);g.attributes.set("transform",new A(n,"transform",this.getAttribute("gradientTransform").getValue())),g.children=[f];const u=new Tt(n);u.attributes.set("x",new A(n,"x",0)),u.attributes.set("y",new A(n,"y",0)),u.attributes.set("width",new A(n,"width",c.width)),u.attributes.set("height",new A(n,"height",c.height)),u.children=[g];const d=n.createCanvas(c.width,c.height),p=d.getContext("2d");return p.fillStyle=a,u.render(p),p.createPattern(d,"no-repeat")}return a}inheritStopContainer(t){this.attributesToInherit.forEach(e=>{!this.getAttribute(e).hasValue()&&t.getAttribute(e).hasValue()&&this.getAttribute(e,!0).setValue(t.getAttribute(e).getValue())})}addParentOpacity(t,e){return t.hasValue()?new A(this.document,"color",e).addOpacity(t).getColor():e}constructor(t,e,s){super(t,e,s),this.attributesToInherit=["gradientUnits"],this.stops=[];const{stops:i,children:r}=this;r.forEach(a=>{a.type==="stop"&&i.push(a)})}}class si extends $e{getGradient(t,e){const s=this.getGradientUnits()==="objectBoundingBox",i=s?e.getBoundingBox(t):null;if(s&&!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));const r=s?i.x+i.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),a=s?i.y+i.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),n=s?i.x+i.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),o=s?i.y+i.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return r===n&&a===o?null:t.createLinearGradient(r,a,n,o)}constructor(t,e,s){super(t,e,s),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}}class ii extends $e{getGradient(t,e){const s=this.getGradientUnits()==="objectBoundingBox",i=e.getBoundingBox(t);if(s&&!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%");const r=s?i.x+i.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),a=s?i.y+i.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y");let n=r,o=a;this.getAttribute("fx").hasValue()&&(n=s?i.x+i.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(o=s?i.y+i.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));const h=s?(i.width+i.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),c=this.getAttribute("fr").getPixels();return t.createRadialGradient(n,o,c,r,a,h)}constructor(t,e,s){super(t,e,s),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}}class ri extends M{constructor(t,e,s){super(t,e,s),this.type="stop";const i=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),r=this.getStyle("stop-opacity");let a=this.getStyle("stop-color",!0);a.getString()===""&&a.setValue("#000"),r.hasValue()&&(a=a.addOpacity(r)),this.offset=i,this.color=a.getColor()}}class ae extends M{getProperty(){const t=this.getAttribute("attributeType").getString(),e=this.getAttribute("attributeName").getString();return t==="CSS"?this.parent.getStyle(e,!0):this.parent.getAttribute(e,!0)}calcValue(){const{initialUnits:t}=this,{progress:e,from:s,to:i}=this.getProgress();let r=s.getNumber()+(i.getNumber()-s.getNumber())*e;return t==="%"&&(r*=100),"".concat(r).concat(t)}update(t){const{parent:e}=this,s=this.getProperty();if(this.initialValue||(this.initialValue=s.getString(),this.initialUnits=s.getUnits()),this.duration>this.maxDuration){const r=this.getAttribute("fill").getString("remove");
2if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(r==="freeze"&&!this.frozen)this.frozen=!0,e&&s&&(e.animationFrozen=!0,e.animationFrozenValue=s.getString());else if(r==="remove"&&!this.removed)return this.removed=!0,e&&s&&s.setValue(e.animationFrozen?e.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=t;let i=!1;if(this.begin<this.duration){let r=this.calcValue();const a=this.getAttribute("type");if(a.hasValue()){const n=a.getString();r="".concat(n,"(").concat(r,")")}s.setValue(r),i=!0}return i}getProgress(){const{document:t,values:e}=this;let s=(this.duration-this.begin)/(this.maxDuration-this.begin),i,r;if(e.hasValue()){const a=s*(e.getValue().length-1),n=Math.floor(a),o=Math.ceil(a);let h;h=e.getValue()[n],i=new A(t,"from",h?parseFloat(h):0),h=e.getValue()[o],r=new A(t,"to",h?parseFloat(h):0),s=(a-n)/(o-n)}else i=this.from,r=this.to;return{progress:s,from:i,to:r}}constructor(t,e,s){super(t,e,s),this.type="animate",this.duration=0,this.initialUnits="",this.removed=!1,this.frozen=!1,t.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(t,"values",null);const i=this.getAttribute("values");i.hasValue()&&this.values.setValue(i.getString().split(";"))}}class ni extends ae{calcValue(){const{progress:t,from:e,to:s}=this.getProgress(),i=new se(e.getColor()),r=new se(s.getColor());if(i.ok&&r.ok){const a=i.r+(r.r-i.r)*t,n=i.g+(r.g-i.g)*t,o=i.b+(r.b-i.b)*t;return"rgb(".concat(Math.floor(a),", ").concat(Math.floor(n),", ").concat(Math.floor(o),")")}return this.getAttribute("from").getColor()}constructor(...t){super(...t),this.type="animateColor"}}class ai extends ae{calcValue(){const{progress:t,from:e,to:s}=this.getProgress(),i=$(e.getString()),r=$(s.getString());return i.map((n,o)=>{const h=r[o];return n+(h-n)*t}).join(" ")}constructor(...t){super(...t),this.type="animateTransform"}}class Ze extends M{constructor(t,e,s){super(t,e,s),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 oe extends P{constructor(t,e,s){super(t,e,s),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 je extends oe{constructor(...t){super(...t),this.type="missing-glyph",this.horizAdvX=0}}class oi extends M{render(){}constructor(t,e,s){super(t,e,s),this.type="font",this.isArabic=!1,this.glyphs=new Map,this.arabicGlyphs=new Map,this.isRTL=!1,this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();const{definitions:i}=t,{children:r}=this;for(const a of r)if(a instanceof Ze){this.fontFace=a;const n=a.getStyle("font-family");n.hasValue()&&i.set(n.getString(),this)}else if(a instanceof je)this.missingGlyph=a;else if(a instanceof oe)if(a.arabicForm){this.isRTL=!0,this.isArabic=!0;let n=this.arabicGlyphs.get(a.unicode);typeof n>"u"&&(n=new Map,this.arabicGlyphs.set(a.unicode,n)),n.set(a.arabicForm,a)}else this.glyphs.set(a.unicode,a)}}class hi extends ot{getText(){const t=this.getHrefAttribute().getDefinition();if(t){const e=t.children[0];if(e)return e.getText()}return""}constructor(...t){super(...t),this.type="tref"}}class li extends ot{getText(){return this.text}renderChildren(t){if(this.hasText){super.renderChildren(t);const{document:e,x:s,y:i}=this,{mouse:r}=e.screen,a=new A(e,"fontSize",W.parse(e.ctx.font).fontSize);r.isWorking()&&r.checkBoundingBox(this,new J(s,i-a.getPixels("y"),s+this.measureText(t),i))}else if(this.children.length>0){const e=new ne(this.document);e.children=this.children,e.parent=this,e.render(t)}}onClick(){const{window:t}=this.document;t&&t.open(this.getHrefAttribute().getString())}onMouseMove(){const t=this.document.ctx;t.canvas.style.cursor="pointer"}constructor(t,e,s){super(t,e,s),this.type="a";const{childNodes:i}=e,r=i[0],a=i.length>0&&Array.from(i).every(n=>n.nodeType===3);this.hasText=a,this.text=a?this.getTextFromNode(r):""}}class ci extends ot{getText(){return this.text}path(t){const{dataArray:e}=this;t&&t.beginPath(),e.forEach(s=>{let{type:i,points:r}=s;switch(i){case w.LINE_TO:t&&t.lineTo(r[0],r[1]);break;case w.MOVE_TO:t&&t.moveTo(r[0],r[1]);break;case w.CURVE_TO:t&&t.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case w.QUAD_TO:t&&t.quadraticCurveTo(r[0],r[1],r[2],r[3]);break;case w.ARC:{const[a,n,o,h,c,f,g,u]=r,d=o>h?o:h,p=o>h?1:o/h,y=o>h?h/o:1;t&&(t.translate(a,n),t.rotate(g),t.scale(p,y),t.arc(0,0,d,c,c+f,!!(1-u)),t.scale(1/p,1/y),t.rotate(-g),t.translate(-a,-n));break}case w.CLOSE_PATH:t&&t.closePath();break}})}renderChildren(t){this.setTextData(t),t.save();const e=this.parent.getStyle("text-decoration").getString(),s=this.getFontSize(),{glyphInfo:i}=this,r=t.fillStyle;
2e==="underline"&&t.beginPath(),i.forEach((a,n)=>{const{p0:o,p1:h,rotation:c,text:f}=a;t.save(),t.translate(o.x,o.y),t.rotate(c),t.fillStyle&&t.fillText(f,0,0),t.strokeStyle&&t.strokeText(f,0,0),t.restore(),e==="underline"&&(n===0&&t.moveTo(o.x,o.y+s/8),t.lineTo(h.x,h.y+s/5))}),e==="underline"&&(t.lineWidth=s/20,t.strokeStyle=r,t.stroke(),t.closePath()),t.restore()}getLetterSpacingAt(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[t]||0}findSegmentToFitChar(t,e,s,i,r,a,n,o,h){let c=a,f=this.measureText(t,o);o===" "&&e==="justify"&&s<i&&(f+=(i-s)/r),h>-1&&(c+=this.getLetterSpacingAt(h));const g=this.textHeight/20,u=this.getEquidistantPointOnPath(c,g,0),d=this.getEquidistantPointOnPath(c+f,g,0),p={p0:u,p1:d},y=u&&d?Math.atan2(d.y-u.y,d.x-u.x):0;if(n){const x=Math.cos(Math.PI/2+y)*n,S=Math.cos(-y)*n;p.p0={...u,x:u.x+x,y:u.y+S},p.p1={...d,x:d.x+x,y:d.y+S}}return c+=f,{offset:c,segment:p,rotation:y}}measureText(t,e){const{measuresCache:s}=this,i=e||this.getText();if(s.has(i))return s.get(i);const r=this.measureTargetText(t,i);return s.set(i,r),r}setTextData(t){if(this.glyphInfo)return;const e=this.getText(),s=e.split(""),i=e.split(" ").length-1,r=this.parent.getAttribute("dx").split().map(b=>b.getPixels("x")),a=this.parent.getAttribute("dy").getPixels("y"),n=this.parent.getStyle("text-anchor").getString("start"),o=this.getStyle("letter-spacing"),h=this.parent.getStyle("letter-spacing");let c=0;!o.hasValue()||o.getValue()==="inherit"?c=h.getPixels():o.hasValue()&&o.getValue()!=="initial"&&o.getValue()!=="unset"&&(c=o.getPixels());const f=[],g=e.length;this.letterSpacingCache=f;for(let b=0;b<g;b++)f.push(typeof r[b]<"u"?r[b]:c);const u=f.reduce((b,v,E)=>E===0?0:b+v||0,0),d=this.measureText(t),p=Math.max(d+u,0);this.textWidth=d,this.textHeight=this.getFontSize(),this.glyphInfo=[];const y=this.getPathLength(),x=this.getStyle("startOffset").getNumber(0)*y;let S=0;(n==="middle"||n==="center")&&(S=-p/2),(n==="end"||n==="right")&&(S=-p),S+=x,s.forEach((b,v)=>{const{offset:E,segment:C,rotation:T}=this.findSegmentToFitChar(t,n,p,y,i,S,a,b,v);S=E,!(!C.p0||!C.p1)&&this.glyphInfo.push({text:s[v],p0:C.p0,p1:C.p1,rotation:T})})}parsePathData(t){if(this.pathLength=-1,!t)return[];const e=[],{pathParser:s}=t;for(s.reset();!s.isEnd();){const{current:i}=s,r=i?i.x:0,a=i?i.y:0,n=s.next();let o=n.type,h=[];switch(n.type){case w.MOVE_TO:this.pathM(s,h);break;case w.LINE_TO:o=this.pathL(s,h);break;case w.HORIZ_LINE_TO:o=this.pathH(s,h);break;case w.VERT_LINE_TO:o=this.pathV(s,h);break;case w.CURVE_TO:this.pathC(s,h);break;case w.SMOOTH_CURVE_TO:o=this.pathS(s,h);break;case w.QUAD_TO:this.pathQ(s,h);break;case w.SMOOTH_QUAD_TO:o=this.pathT(s,h);break;case w.ARC:h=this.pathA(s);break;case w.CLOSE_PATH:P.pathZ(s);break}n.type!==w.CLOSE_PATH?e.push({type:o,points:h,start:{x:r,y:a},pathLength:this.calcLength(r,a,o,h)}):e.push({type:w.CLOSE_PATH,points:[],pathLength:0})}return e}pathM(t,e){const{x:s,y:i}=P.pathM(t).point;e.push(s,i)}pathL(t,e){const{x:s,y:i}=P.pathL(t).point;return e.push(s,i),w.LINE_TO}pathH(t,e){const{x:s,y:i}=P.pathH(t).point;return e.push(s,i),w.LINE_TO}pathV(t,e){const{x:s,y:i}=P.pathV(t).point;return e.push(s,i),w.LINE_TO}pathC(t,e){const{point:s,controlPoint:i,currentPoint:r}=P.pathC(t);e.push(s.x,s.y,i.x,i.y,r.x,r.y)}pathS(t,e){const{point:s,controlPoint:i,currentPoint:r}=P.pathS(t);return e.push(s.x,s.y,i.x,i.y,r.x,r.y),w.CURVE_TO}pathQ(t,e){const{controlPoint:s,currentPoint:i}=P.pathQ(t);e.push(s.x,s.y,i.x,i.y)}pathT(t,e){const{controlPoint:s,currentPoint:i}=P.pathT(t);return e.push(s.x,s.y,i.x,i.y),w.QUAD_TO}pathA(t){let{rX:e,rY:s,sweepFlag:i,xAxisRotation:r,centp:a,a1:n,ad:o}=P.pathA(t);return i===0&&o>0&&(o-=2*Math.PI),i===1&&o<0&&(o+=2*Math.PI),[a.x,a.y,e,s,n,o,r,i]}calcLength(t,e,s,i){let r=0,a=null,n=null,o=0;switch(s){case w.LINE_TO:return this.getLineLength(t,e,i[0],i[1]);case w.CURVE_TO:for(r=0,a=this.getPointOnCubicBezier(0,t,e,i[0],i[1],i[2],i[3],i[4],i[5]),o=.01;o<=1;o+=.01)n=this.getPointOnCubicBezier(o,t,e,i[0],i[1],i[2],i[3],i[4],i[5]),r+=this.getLineLength(a.x,a.y,n.x,n.y),a=n;return r;case w.QUAD_TO:for(r=0,a=this.getPointOnQuadraticBezier(0,t,e,i[0],i[1],i[2],i[3]),o=.01;o<=1;o+=.01)n=this.getPointOnQuadraticBezier(o,t,e,i[0],i[1],i[2],i[3]),r+=this.getLineLength(a.x,a.y,n.x,n.y),a=n;return r;case w.ARC:{r=0;const h=i[4],c=i[5],f=i[4]+c;let g=Math.PI/180;
2if(Math.abs(h-f)<g&&(g=Math.abs(h-f)),a=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],h,0),c<0)for(o=h-g;o>f;o-=g)n=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],o,0),r+=this.getLineLength(a.x,a.y,n.x,n.y),a=n;else for(o=h+g;o<f;o+=g)n=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],o,0),r+=this.getLineLength(a.x,a.y,n.x,n.y),a=n;return n=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),r+=this.getLineLength(a.x,a.y,n.x,n.y),r}}return 0}getPointOnLine(t,e,s,i,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:e,n=arguments.length>6&&arguments[6]!==void 0?arguments[6]:s;const o=(r-s)/(i-e+xt);let h=Math.sqrt(t*t/(1+o*o));i<e&&(h*=-1);let c=o*h,f=null;if(i===e)f={x:a,y:n+c};else if((n-s)/(a-e+xt)===o)f={x:a+h,y:n+c};else{let g=0,u=0;const d=this.getLineLength(e,s,i,r);if(d<xt)return null;let p=(a-e)*(i-e)+(n-s)*(r-s);p/=d*d,g=e+p*(i-e),u=s+p*(r-s);const y=this.getLineLength(a,n,g,u),x=Math.sqrt(t*t-y*y);h=Math.sqrt(x*x/(1+o*o)),i<e&&(h*=-1),c=o*h,f={x:g+h,y:u+c}}return f}getPointOnPath(t){const e=this.getPathLength();let s=0,i=null;if(t<-5e-5||t-5e-5>e)return null;const{dataArray:r}=this;for(const a of r){if(a&&(a.pathLength<5e-5||s+a.pathLength+5e-5<t)){s+=a.pathLength;continue}const n=t-s;let o=0;switch(a.type){case w.LINE_TO:i=this.getPointOnLine(n,a.start.x,a.start.y,a.points[0],a.points[1],a.start.x,a.start.y);break;case w.ARC:{const h=a.points[4],c=a.points[5],f=a.points[4]+c;if(o=h+n/a.pathLength*c,c<0&&o<f||c>=0&&o>f)break;i=this.getPointOnEllipticalArc(a.points[0],a.points[1],a.points[2],a.points[3],o,a.points[6]);break}case w.CURVE_TO:o=n/a.pathLength,o>1&&(o=1),i=this.getPointOnCubicBezier(o,a.start.x,a.start.y,a.points[0],a.points[1],a.points[2],a.points[3],a.points[4],a.points[5]);break;case w.QUAD_TO:o=n/a.pathLength,o>1&&(o=1),i=this.getPointOnQuadraticBezier(o,a.start.x,a.start.y,a.points[0],a.points[1],a.points[2],a.points[3]);break}if(i)return i;break}return null}getLineLength(t,e,s,i){return Math.sqrt((s-t)*(s-t)+(i-e)*(i-e))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((t,e)=>e.pathLength>0?t+e.pathLength:t,0)),this.pathLength}getPointOnCubicBezier(t,e,s,i,r,a,n,o,h){const c=o*Ne(t)+a*Oe(t)+i*Ve(t)+e*ke(t),f=h*Ne(t)+n*Oe(t)+r*Ve(t)+s*ke(t);return{x:c,y:f}}getPointOnQuadraticBezier(t,e,s,i,r,a,n){const o=a*Re(t)+i*Le(t)+e*Ie(t),h=n*Re(t)+r*Le(t)+s*Ie(t);return{x:o,y:h}}getPointOnEllipticalArc(t,e,s,i,r,a){const n=Math.cos(a),o=Math.sin(a),h={x:s*Math.cos(r),y:i*Math.sin(r)};return{x:t+(h.x*n-h.y*o),y:e+(h.x*o+h.y*n)}}buildEquidistantCache(t,e){const s=this.getPathLength(),i=e||.25,r=t||s/100;if(!this.equidistantCache||this.equidistantCache.step!==r||this.equidistantCache.precision!==i){this.equidistantCache={step:r,precision:i,points:[]};let a=0;for(let n=0;n<=s;n+=i){const o=this.getPointOnPath(n),h=this.getPointOnPath(n+i);!o||!h||(a+=this.getLineLength(o.x,o.y,h.x,h.y),a>=r&&(this.equidistantCache.points.push({x:o.x,y:o.y,distance:n}),a-=r))}}}getEquidistantPointOnPath(t,e,s){if(this.buildEquidistantCache(e,s),t<0||t-this.getPathLength()>5e-5)return null;const i=Math.round(t/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}constructor(t,e,s){super(t,e,s),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);const i=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(i)}}const ui=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class fi extends pt{async loadImage(t){try{const e=await this.document.createImage(t);this.image=e}catch(e){console.error('Error while loading image "'.concat(t,'":'),e)}this.loaded=!0}async loadSvg(t){const e=ui.exec(t);if(e){const s=e[5];s&&(e[4]==="base64"?this.image=atob(s):this.image=decodeURIComponent(s))}else try{const i=await(await this.document.fetch(t)).text();this.image=i}catch(s){console.error('Error while loading image "'.concat(t,'":'),s)}this.loaded=!0}renderChildren(t){const{document:e,image:s,loaded:i}=this,r=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),n=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");if(!(!i||!s||!n||!o)){if(t.save(),t.translate(r,a),typeof s=="string"){const h=e.canvg.forkString(t,s,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:n,scaleHeight:o}),{documentElement:c}=h.document;c&&(c.parent=this),h.render()}else e.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:n,desiredWidth:s.width,height:o,desiredHeight:s.height}),this.loaded&&(!("complete"in s)||s.complete)&&t.drawImage(s,0,0);
2t.restore()}}getBoundingBox(){const t=this.getAttribute("x").getPixels("x"),e=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new J(t,e,t+s,e+i)}constructor(t,e,s){super(t,e,s),this.type="image",this.loaded=!1;const i=this.getHrefAttribute().getString();if(!i)return;const r=i.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(i);t.images.push(this),r?this.loadSvg(i):this.loadImage(i)}}class gi extends pt{render(t){}constructor(...t){super(...t),this.type="symbol"}}class di{async load(t,e){try{const{document:s}=this,r=(await s.canvg.parser.load(e)).getElementsByTagName("font");Array.from(r).forEach(a=>{const n=s.createElement(a);s.definitions.set(t,n)})}catch(s){console.error('Error while loading font "'.concat(e,'":'),s)}this.loaded=!0}constructor(t){this.document=t,this.loaded=!1,t.fonts.push(this)}}class Ke extends M{constructor(t,e,s){super(t,e,s),this.type="style",bt(Array.from(e.childNodes).map(a=>a.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")).split("}").forEach(a=>{const n=a.trim();if(!n)return;const o=n.split("{"),h=o[0].split(","),c=o[1].split(";");h.forEach(f=>{const g=f.trim();if(!g)return;const u=t.styles.get(g)||new Map;if(c.forEach(d=>{const p=d.indexOf(":"),y=d.substr(0,p).trim(),x=d.substr(p+1,d.length-p).trim();y&&x&&u.set(y,new A(t,y,x))}),t.styles.set(g,u),t.stylesSpecificity.set(g,ks(g)),g==="@font-face"){const d=u.get("font-family").getString().replace(/"|'/g,"");u.get("src").getString().split(",").forEach(y=>{if(y.indexOf('format("svg")')>0){const x=Xe(y);x&&new di(t).load(d,x)}})}})})}}Ke.parseExternalUrl=Xe;class pi extends pt{setContext(t){super.setContext(t);const e=this.getAttribute("x"),s=this.getAttribute("y");e.hasValue()&&t.translate(e.getPixels("x"),0),s.hasValue()&&t.translate(0,s.getPixels("y"))}path(t){const{element:e}=this;e&&e.path(t)}renderChildren(t){const{document:e,element:s}=this;if(s){let i=s;if(s.type==="symbol"&&(i=new Tt(e),i.attributes.set("viewBox",new A(e,"viewBox",s.getAttribute("viewBox").getString())),i.attributes.set("preserveAspectRatio",new A(e,"preserveAspectRatio",s.getAttribute("preserveAspectRatio").getString())),i.attributes.set("overflow",new A(e,"overflow",s.getAttribute("overflow").getString())),i.children=s.children,s.styles.set("opacity",new A(e,"opacity",this.calculateOpacity()))),i.type==="svg"){const a=this.getStyle("width",!1,!0),n=this.getStyle("height",!1,!0);a.hasValue()&&i.attributes.set("width",new A(e,"width",a.getString())),n.hasValue()&&i.attributes.set("height",new A(e,"height",n.getString()))}const r=i.parent;i.parent=this,i.render(t),i.parent=r}}getBoundingBox(t){const{element:e}=this;return e?e.getBoundingBox(t):null}elementTransform(){const{document:t,element:e}=this;return e?dt.fromElement(t,e):null}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}constructor(...t){super(...t),this.type="use"}}function Rt(l,t,e,s,i,r){return l[e*s*4+t*4+r]}function Lt(l,t,e,s,i,r,a){l[e*s*4+t*4+r]=a}function I(l,t,e){return l[t]*e}function st(l,t,e,s){return t+Math.cos(l)*e+Math.sin(l)*s}class Je extends M{apply(t,e,s,i,r){const{includeOpacity:a,matrix:n}=this,o=t.getImageData(0,0,i,r);for(let h=0;h<r;h++)for(let c=0;c<i;c++){const f=Rt(o.data,c,h,i,r,0),g=Rt(o.data,c,h,i,r,1),u=Rt(o.data,c,h,i,r,2),d=Rt(o.data,c,h,i,r,3);let p=I(n,0,f)+I(n,1,g)+I(n,2,u)+I(n,3,d)+I(n,4,1),y=I(n,5,f)+I(n,6,g)+I(n,7,u)+I(n,8,d)+I(n,9,1),x=I(n,10,f)+I(n,11,g)+I(n,12,u)+I(n,13,d)+I(n,14,1),S=I(n,15,f)+I(n,16,g)+I(n,17,u)+I(n,18,d)+I(n,19,1);a&&(p=0,y=0,x=0,S*=d/255),Lt(o.data,c,h,i,r,0,p),Lt(o.data,c,h,i,r,1,y),Lt(o.data,c,h,i,r,2,x),Lt(o.data,c,h,i,r,3,S)}t.clearRect(0,0,i,r),t.putImageData(o,0,0)}constructor(t,e,s){super(t,e,s),this.type="feColorMatrix";let i=$(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{const r=i[0];i=[.213+.787*r,.715-.715*r,.072-.072*r,0,0,.213-.213*r,.715+.285*r,.072-.072*r,0,0,.213-.213*r,.715-.715*r,.072+.928*r,0,0,0,0,0,1,0,0,0,0,0,1];break}
2case"hueRotate":{const r=i[0]*Math.PI/180;i=[st(r,.213,.787,-.213),st(r,.715,-.715,-.715),st(r,.072,-.072,.928),0,0,st(r,.213,-.213,.143),st(r,.715,.285,.14),st(r,.072,-.072,-.283),0,0,st(r,.213,-.213,-.787),st(r,.715,-.715,.715),st(r,.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()}}class Bt extends M{apply(t,e){const{document:s}=this;let i=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),a=this.getStyle("width").getPixels("x"),n=this.getStyle("height").getPixels("y");if(!a&&!n){const u=new J;this.children.forEach(d=>{u.addBoundingBox(d.getBoundingBox(t))}),i=Math.floor(u.x1),r=Math.floor(u.y1),a=Math.floor(u.width),n=Math.floor(u.height)}const o=this.removeStyles(e,Bt.ignoreStyles),h=s.createCanvas(i+a,r+n),c=h.getContext("2d");s.screen.setDefaults(c),this.renderChildren(c),new Je(s,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,i+a,r+n);const f=s.createCanvas(i+a,r+n),g=f.getContext("2d");s.screen.setDefaults(g),e.render(g),g.globalCompositeOperation="destination-in",g.fillStyle=c.createPattern(h,"no-repeat"),g.fillRect(0,0,i+a,r+n),t.fillStyle=g.createPattern(f,"no-repeat"),t.fillRect(0,0,i+a,r+n),this.restoreStyles(e,o)}render(t){}constructor(...t){super(...t),this.type="mask"}}Bt.ignoreStyles=["mask","transform","clip-path"];const Be=()=>{};class yi extends M{apply(t){const{document:e}=this,s=Reflect.getPrototypeOf(t),{beginPath:i,closePath:r}=t;s&&(s.beginPath=Be,s.closePath=Be),Reflect.apply(i,t,[]),this.children.forEach(a=>{if(!("path"in a))return;let n="elementTransform"in a?a.elementTransform():null;n||(n=dt.fromElement(e,a)),n&&n.apply(t),a.path(t),s&&(s.closePath=r),n&&n.unapply(t)}),Reflect.apply(r,t,[]),t.clip(),s&&(s.beginPath=i,s.closePath=r)}render(t){}constructor(...t){super(...t),this.type="clipPath"}}class _t extends M{apply(t,e){const{document:s,children:i}=this,r="getBoundingBox"in e?e.getBoundingBox(t):null;if(!r)return;let a=0,n=0;i.forEach(x=>{const S=x.extraFilterDistance||0;a=Math.max(a,S),n=Math.max(n,S)});const o=Math.floor(r.width),h=Math.floor(r.height),c=o+2*a,f=h+2*n;if(c<1||f<1)return;const g=Math.floor(r.x),u=Math.floor(r.y),d=this.removeStyles(e,_t.ignoreStyles),p=s.createCanvas(c,f),y=p.getContext("2d");s.screen.setDefaults(y),y.translate(-g+a,-u+n),e.render(y),i.forEach(x=>{typeof x.apply=="function"&&x.apply(y,0,0,c,f)}),t.drawImage(p,0,0,c,f,g-a,u-n,c,f),this.restoreStyles(e,d)}render(t){}constructor(...t){super(...t),this.type="filter"}}_t.ignoreStyles=["filter","transform","clip-path"];class mi extends M{apply(t,e,s,i,r){}constructor(t,e,s){super(t,e,s),this.type="feDropShadow",this.addStylesFromStyleDefinition()}}class xi extends M{apply(t,e,s,i,r){}constructor(...t){super(...t),this.type="feMorphology"}}class bi extends M{apply(t,e,s,i,r){}constructor(...t){super(...t),this.type="feComposite"}}class vi extends M{apply(t,e,s,i,r){const{document:a,blurRadius:n}=this,o=a.window?a.window.document.body:null,h=t.canvas;h.id=a.getUniqueId(),o&&(h.style.display="none",o.appendChild(h)),ps(h,e,s,i,r,n),o&&o.removeChild(h)}constructor(t,e,s){super(t,e,s),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}}class Ai extends M{constructor(...t){super(...t),this.type="title"}}class Si extends M{constructor(...t){super(...t),this.type="desc"}}const Ti={svg:Tt,rect:Qe,circle:$s,ellipse:Zs,line:js,polyline:Ge,polygon:Ks,path:P,pattern:Js,marker:ti,defs:ei,linearGradient:si,radialGradient:ii,stop:ri,animate:ae,animateColor:ni,animateTransform:ai,font:oi,"font-face":Ze,"missing-glyph":je,glyph:oe,text:ot,tspan:Dt,tref:hi,a:li,textPath:ci,image:fi,g:ne,symbol:gi,style:Ke,use:pi,mask:Bt,clipPath:yi,filter:_t,feDropShadow:mi,feMorphology:xi,feComposite:bi,feColorMatrix:Je,feGaussianBlur:vi,title:Ai,desc:Si};function wi(l,t){const e=document.createElement("canvas");return e.width=l,e.height=t,e}async function Ci(l){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const e=document.createElement("img");return t&&(e.crossOrigin="Anonymous"),new Promise((s,i)=>{e.onload=()=>{s(e)},e.onerror=(r,a,n,o,h)=>
2{i(h)},e.src=l})}const ee=12;class at{bindCreateImage(t,e){return typeof e=="boolean"?(s,i)=>t(s,typeof i=="boolean"?i:e):t}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){const{emSizeStack:t}=this;return t[t.length-1]||ee}set emSize(t){const{emSizeStack:e}=this;e.push(t)}popEmSize(){const{emSizeStack:t}=this;t.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(t=>t.loaded)}isFontsLoaded(){return this.fonts.every(t=>t.loaded)}createDocumentElement(t){const e=this.createElement(t.documentElement);return e.root=!0,e.addStylesFromStyleDefinition(),this.documentElement=e,e}createElement(t){const e=t.nodeName.replace(/^[^:]+:/,""),s=at.elementTypes[e];return s?new s(this,t):new Hs(this,t)}createTextNode(t){return new Gs(this,t)}setViewBox(t){this.screen.setViewBox({document:this,...t})}constructor(t,{rootEmSize:e=ee,emSize:s=ee,createCanvas:i=at.createCanvas,createImage:r=at.createImage,anonymousCrossOrigin:a}={}){this.canvg=t,this.definitions=new Map,this.styles=new Map,this.stylesSpecificity=new Map,this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=t.screen,this.rootEmSize=e,this.emSize=s,this.createCanvas=i,this.createImage=this.bindCreateImage(r,a),this.screen.wait(()=>this.isImagesLoaded()),this.screen.wait(()=>this.isFontsLoaded())}}at.createCanvas=wi;at.createImage=Ci;at.elementTypes=Ti;class At{static async from(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=await new te(s).parse(e);return new At(t,r,s)}static fromString(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=new te(s).parseFromString(e);return new At(t,r,s)}fork(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return At.from(t,e,{...this.options,...s})}forkString(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return At.fromString(t,e,{...this.options,...s})}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}async render(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.start({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0,...t}),await this.ready(),this.stop()}start(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{documentElement:e,screen:s,options:i}=this;s.start(e,{enableRedraw:!0,...i,...t})}stop(){this.screen.stop()}resize(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(t,e,s)}constructor(t,e,s={}){this.parser=new te(s),this.screen=new it(t,s),this.options=s;const i=new at(this,s),r=i.createDocumentElement(e);this.document=i,this.documentElement=r}}export{li as AElement,ni as AnimateColorElement,ae as AnimateElement,ai as AnimateTransformElement,J as BoundingBox,Ne as CB1,Oe as CB2,Ve as CB3,ke as CB4,At as Canvg,$s as CircleElement,yi as ClipPathElement,ei as DefsElement,Si as DescElement,at as Document,M as Element,Zs as EllipseElement,Je as FeColorMatrixElement,bi as FeCompositeElement,mi as FeDropShadowElement,vi as FeGaussianBlurElement,xi as FeMorphologyElement,_t as FilterElement,W as Font,oi as FontElement,Ze as FontFaceElement,ne as GElement,oe as GlyphElement,$e as GradientElement,fi as ImageElement,js as LineElement,si as LinearGradientElement,ti as MarkerElement,Bt as MaskElement,We as Matrix,je as MissingGlyphElement,Rs as Mouse,xt as PSEUDO_ZERO,te as Parser,P as PathElement,w as PathParser,Js as PatternElement,V as Point,Ks as PolygonElement,Ge as PolylineElement,A as Property,Re as QB1,Le as QB2,Ie as QB3,ii as RadialGradientElement,Qe as RectElement,pt as RenderedElement,Bs as Rotate,Tt as SVGElement,di as SVGFontLoader,_s as Scale,it as Screen,qe as Skew,Fs as SkewX,zs as SkewY,ri as StopElement,Ke as StyleElement,gi as SymbolElement,hi as TRefElement,Dt as TSpanElement,ot as TextElement,ci as TextPathElement,Ai as TitleElement,dt as Transform,Ds as Translate,Hs as UnknownElement,pi as UseElement,St as ViewPort,bt as compressSpaces,Ti as elements,ks as getSelectorSpecificity,Ts as normalizeAttributeName,ws as normalizeColor,Xe as parseExternalUrl,Pi as presets,As as toMatrixValue,$ as toNumbers,bs as trimLeft,vs as trimRight,Pe as vectorMagnitude,Me as vectorsAngle,re as vectorsRatio};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.