var qe=function(f,D,ie,ne,O){"use strict";let rt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgrey:[211,211,211],lightgreen:[144,238,144],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0]},F={black:[rt.black,1],white:[rt.white,1],transparent:[rt.black,0]},It={quot:34,amp:38,lt:60,gt:62,apos:39,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,circ:710,tilde:732,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,permil:8240,lsaquo:8249,rsaquo:8250,euro:8364,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,fnof:402,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,bull:8226,hellip:8230,prime:8242,Prime:8243,oline:8254,frasl:8260,weierp:8472,image:8465,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Tt={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0},se={A3:!0,A4:!0,a3:!0,a4:!0},ae={color:{inherit:!0,initial:void 0},visibility:{inherit:!0,initial:"visible",values:{hidden:"hidden",collapse:"hidden",visible:"visible"}},fill:{inherit:!0,initial:F.black},stroke:{inherit:!0,initial:"none"},"stop-color":{inherit:!1,initial:F.black},"fill-opacity":{inherit:!0,initial:1},"stroke-opacity":{inherit:!0,initial:1},"stop-opacity":{inherit:!1,initial:1},"fill-rule":{inherit:!0,initial:"nonzero",values:{nonzero:"nonzero",evenodd:"evenodd"}},"clip-rule":{inherit:!0,initial:"nonzero",values:{nonzero:"nonzero",evenodd:"evenodd"}},"stroke-width":{inherit:!0,initial:1},"stroke-dasharray":{inherit:!0,initial:[]},"stroke-dashoffset":{inherit:!0,initial:0},"stroke-miterlimit":{inherit:!0,initial:4},"stroke-linejoin":{inherit:!0,initial:"miter",values:{miter:"miter",round:"round",bevel:"bevel"}},"stroke-linecap":{inherit:!0,initial:"butt",values:{butt:"butt",round:"round",square:"square"}},"font-size":{inherit:!0,initial:16,values:{"xx-small":9,"x-small":10,small:13,medium:16,large:18,"x-large":24,"xx-large":32}},"font-family":{inherit:!0,initial:"sans-serif"},"font-weight":{inherit:!0,initial:"normal",values:{600:"bold",700:"bold",800:"bold",900:"bold",bold:"bold",bolder:"bold",500:"normal",400:"normal",300:"normal",200:"normal",100:"normal",normal:"normal",lighter:"normal"}},"font-style":{inherit:!0,initial:"normal",values:{italic:"italic",oblique:"italic",normal:"normal"}},"text-anchor":{inherit:!0,initial:"start",values:{start:"start",middle:"middle",end:"end"}},direction:{inherit:!0,initial:"ltr",values:{ltr:"ltr",rtl:"rtl"}},"dominant-baseline":{inherit:!0,initial:"baseline",values:{auto:"baseline",baseline:"baseline","before-edge":"before-edge","text-before-edge":"before-edge",middle:"middle",central:"central","after-edge":"after-edge","text-after-edge":"after-edge",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"mathematical"}},"alignment-baseline":{inherit:!1,initial:void 0,values:{auto:"baseline",baseline:"baseline","before-edge":"before-edge","text-before-edge":"before-edge",middle:"middle",central:"central","after-edge":"after-edge","text-after-edge":"after-edge",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"mathematical"}},"baseline-shift":{inherit:!0,initial:"baseline",values:{baseline:"baseline",sub:"sub",super:"super"}},"word-spacing":{inherit:!0,initial:0,values:{normal:0}},"letter-spacing":{inherit:!0,initial:0,values:{normal:0}},"text-decoration":{inherit:!1,initial:"none",values:{none:"none",underline:"underline",overline:"overline","line-through":"line-through"}},"xml:space":{inherit:!0,initial:"default",css:"white-space",values:{preserve:"preserve",default:"default",pre:"preserve","pre-line":"preserve","pre-wrap":"preserve",nowrap:"default"}},"marker-start":{inherit:!0,initial:"none"},"marker-mid":{inherit:!0,initial:"none"},"marker-end":{inherit:!0,initial:"none"},opacity:{inherit:!1,initial:1},transform:{inherit:!1,initial:[1,0,0,1,0,0]},display:{inherit:!1,initial:"inline",values:{none:"none",inline:"inline",block:"inline"}},"clip-path":{inherit:!1,initial:"none"},mask:{inherit:!1,initial:"none"},overflow:{inherit:!1,initial:"hidden",values:{hidden:"hidden",scroll:"hidden",visible:"visible"}}};function X(n){let e=new function(){};return e.name="G"+(f._groupCount=(f._groupCount||0)+1),e.resources=f.ref(),e.xobj=f.ref({Type:"XObject",Subtype:"Form",FormType:1,BBox:n,Group:{S:"Transparency",CS:"DeviceRGB",I:!0,K:!1},Resources:e.resources}),e.xobj.write(""),e.savedMatrix=f._ctm,e.savedPage=f.page,wt.push(e),f._ctm=[1,0,0,1,0,0],f.page={width:f.page.width,height:f.page.height,write:function(t){e.xobj.write(t)},fonts:{},xobjects:{},ext_gstates:{},patterns:{}},e}function B(n){if(n!==wt.pop())throw"Group not matching";Object.keys(f.page.fonts).length&&(n.resources.data.Font=f.page.fonts),Object.keys(f.page.xobjects).length&&(n.resources.data.XObject=f.page.xobjects),Object.keys(f.page.ext_gstates).length&&(n.resources.data.ExtGState=f.page.ext_gstates),Object.keys(f.page.patterns).length&&(n.resources.data.Pattern=f.page.patterns),n.resources.end(),n.xobj.end(),f._ctm=n.savedMatrix,f.page=n.savedPage}function ht(n){f.page.xobjects[n.name]=n.xobj,f.addContent("/"+n.name+" Do")}function Ot(n,e){let t="M"+(f._maskCount=(f._maskCount||0)+1),r=f.ref({Type:"ExtGState",CA:1,ca:1,BM:"Normal",SMask:{S:"Luminosity",G:n.xobj,BC:e?[0,0,0]:[1,1,1]}});r.end(),f.page.ext_gstates[t]=r,f.addContent("/"+t+" gs")}function re(n,e,t,r){let a=new function(){};return a.group=n,a.dx=e,a.dy=t,a.matrix=r||[1,0,0,1,0,0],a}function Nt(n,e){let t="P"+(f._patternCount=(f._patternCount||0)+1),r=f.ref({Type:"Pattern",PatternType:1,PaintType:1,TilingType:2,BBox:[0,0,n.dx,n.dy],XStep:n.dx,YStep:n.dy,Matrix:A(f._ctm,n.matrix),Resources:{ProcSet:["PDF","Text","ImageB","ImageC","ImageI"],XObject:function(){let a={};return a[n.group.name]=n.group.xobj,a}()}});r.write("/"+n.group.name+" Do"),r.end(),f.page.patterns[t]=r,e?(f.addContent("/Pattern CS"),f.addContent("/"+t+" SCN")):(f.addContent("/Pattern cs"),f.addContent("/"+t+" scn"))}function he(n,e){f.page.fonts[n.id]||(f.page.fonts[n.id]=n.ref()),f.addContent("BT").addContent("/"+n.id+" "+e+" Tf")}function le(n,e,t,r,a,i){f.addContent(H(n)+" "+H(e)+" "+H(-t)+" "+H(-r)+" "+H(a)+" "+H(i)+" Tm")}function oe(n,e){let t=n&&e?2:e?1:n?0:3;f.addContent(t+" Tr")}function ge(n){f.addContent("<"+n+"> Tj")}function ue(){f.addContent("ET")}function Q(n){n[0].constructor.name==="PDFPattern"?(f.fillOpacity(n[1]),Nt(n[0],!1)):f.fillColor(n[0],n[1])}function kt(n){n[0].constructor.name==="PDFPattern"?(f.strokeOpacity(n[1]),Nt(n[0],!0)):f.strokeColor(n[0],n[1])}function fe(n,e,t,r,a){let i=f.ref({Type:"Annot",Subtype:"Link",Rect:[n,e,t,r],Border:[0,0,0],A:{S:"URI",URI:new String(a)}});i.end(),_t.push(i)}function Ht(n){let e=function(s,l,h,u){this.error=u,this.nodeName=s,this.nodeValue=h,this.nodeType=l,this.attributes=Object.create(null),this.childNodes=[],this.parentNode=null,this.id="",this.textContent="",this.classList=[]};e.prototype.getAttribute=function(s){return this.attributes[s]!=null?this.attributes[s]:null},e.prototype.getElementById=function(s){let l=null;return function h(u){if(!l&&u.nodeType===1){u.id===s&&(l=u);for(let c=0;c/)){for(;l=o();)h.childNodes.push(l),l.parentNode=h,h.textContent+=l.nodeType===3||l.nodeType===4?l.nodeValue:l.textContent;return(s=t.match(/^<\/([\w:.-]+)\s*>/,!0))?(s[1]===h.nodeName||(V('parseXml: tag not matching, opening "'+h.nodeName+'" & closing "'+s[1]+'"'),i=!0),h):(V('parseXml: tag not matching, opening "'+h.nodeName+'" & not closing'),i=!0,h)}else{if(t.match(/^\/>/))return h;V('parseXml: tag could not be parsed "'+h.nodeName+'"'),i=!0}}else{if(s=t.match(/^/))return new e(null,8,s,i);if(s=t.match(/^<\?[\s\S]*?\?>/))return new e(null,7,s,i);if(s=t.match(/^/))return new e(null,10,s,i);if(s=t.match(/^/,!0))return new e("#cdata-section",4,s[1],i);if(s=t.match(/^([^<]+)/,!0))return new e("#text",3,Wt(s[1]),i)}};for(;a=o();)a.nodeType===1&&!r?r=a:(a.nodeType===1||a.nodeType===3&&a.nodeValue.trim()!=="")&&V("parseXml: data after document end has been discarded");return t.matchAll()&&V("parseXml: parsing error"),r}function Wt(n){return n.replace(/&(?:#([0-9]+)|#[xX]([0-9A-Fa-f]+)|([0-9A-Za-z]+));/g,function(e,t,r,a){return t?String.fromCharCode(parseInt(t,10)):r?String.fromCharCode(parseInt(r,16)):a&&It[a]?String.fromCharCode(It[a]):e})}function lt(n){let e,t;return n=(n||"").trim(),(e=rt[n])?t=[e.slice(),1]:(e=n.match(/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)$/i))?(e[1]=parseInt(e[1]),e[2]=parseInt(e[2]),e[3]=parseInt(e[3]),e[4]=parseFloat(e[4]),e[1]<256&&e[2]<256&&e[3]<256&&e[4]<=1&&(t=[e.slice(1,4),e[4]])):(e=n.match(/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)$/i))?(e[1]=parseInt(e[1]),e[2]=parseInt(e[2]),e[3]=parseInt(e[3]),e[1]<256&&e[2]<256&&e[3]<256&&(t=[e.slice(1,4),1])):(e=n.match(/^rgb\(\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/i))?(e[1]=2.55*parseFloat(e[1]),e[2]=2.55*parseFloat(e[2]),e[3]=2.55*parseFloat(e[3]),e[1]<256&&e[2]<256&&e[3]<256&&(t=[e.slice(1,4),1])):(e=n.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i))?t=[[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)],1]:(e=n.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i))&&(t=[[17*parseInt(e[1],16),17*parseInt(e[2],16),17*parseInt(e[3],16)],1]),nt?nt(t,n):t}function ot(n,e,t){let r=n[0].slice(),a=n[1]*e;if(t){for(let i=0;i=0;e--)n=A(wt[e].savedMatrix,n);return n}function K(){return new _().M(0,0).L(f.page.width,0).L(f.page.width,f.page.height).L(0,f.page.height).transform(Ut(qt())).getBoundingBox()}function Ut(n){let e=n[0]*n[3]-n[1]*n[2];return[n[3]/e,-n[1]/e,-n[2]/e,n[0]/e,(n[2]*n[5]-n[3]*n[4])/e,(n[1]*n[4]-n[0]*n[5])/e]}function Mt(n){let e=H(n[0]),t=H(n[1]),r=H(n[2]),a=H(n[3]),i=H(n[4]),o=H(n[5]);if(j(e*a-t*r,0))return[e,t,r,a,i,o]}function Dt(n){let e=n[2]||0,t=n[1]||0,r=n[0]||0;if(N(e,0)&&N(t,0))return[];if(N(e,0))return[-r/t];{let a=t*t-4*e*r;return j(a,0)&&a>0?[(-t+Math.sqrt(a))/(2*e),(-t-Math.sqrt(a))/(2*e)]:N(a,0)?[-t/(2*e)]:[]}}function W(n,e){return(e[0]||0)+(e[1]||0)*n+(e[2]||0)*n*n+(e[3]||0)*n*n*n}function N(n,e){return Math.abs(n-e)<1e-10}function j(n,e){return Math.abs(n-e)>=1e-10}function H(n){return n>-1e21&&n<1e21?Math.round(n*1e6)/1e6:0}function ce(n){return typeof n=="object"&&n!==null&&typeof n.length=="number"}function yt(n){let e=new z((n||"").trim()),t=[1,0,0,1,0,0],r;for(;r=e.match(/^([A-Za-z]+)\s*[(]([^(]+)[)]/,!0);){let a=r[1],i=[],o=new z(r[2].trim()),s;for(;s=o.matchNumber();)i.push(Number(s)),o.matchSeparator();if(a==="matrix"&&i.length===6)t=A(t,[i[0],i[1],i[2],i[3],i[4],i[5]]);else if(a==="translate"&&i.length===2)t=A(t,[1,0,0,1,i[0],i[1]]);else if(a==="translate"&&i.length===1)t=A(t,[1,0,0,1,i[0],0]);else if(a==="scale"&&i.length===2)t=A(t,[i[0],0,0,i[1],0,0]);else if(a==="scale"&&i.length===1)t=A(t,[i[0],0,0,i[0],0,0]);else if(a==="rotate"&&i.length===3){let l=i[0]*Math.PI/180;t=A(t,[1,0,0,1,i[1],i[2]],[Math.cos(l),Math.sin(l),-Math.sin(l),Math.cos(l),0,0],[1,0,0,1,-i[1],-i[2]])}else if(a==="rotate"&&i.length===1){let l=i[0]*Math.PI/180;t=A(t,[Math.cos(l),Math.sin(l),-Math.sin(l),Math.cos(l),0,0])}else if(a==="skewX"&&i.length===1){let l=i[0]*Math.PI/180;t=A(t,[1,0,Math.tan(l),1,0,0])}else if(a==="skewY"&&i.length===1){let l=i[0]*Math.PI/180;t=A(t,[1,Math.tan(l),0,1,0,0])}else return;e.matchSeparator()}if(!e.matchAll())return t}function tt(n,e,t,r,a,i){let o=(n||"").trim().match(/^(none)$|^x(Min|Mid|Max)Y(Min|Mid|Max)(?:\s+(meet|slice))?$/)||[],s=o[1]||o[4]||"meet",l=o[2]||"Mid",h=o[3]||"Mid",u=e/r,c=t/a,m={Min:0,Mid:.5,Max:1}[l]-(i||0),w={Min:0,Mid:.5,Max:1}[h]-(i||0);return s==="slice"?c=u=Math.max(u,c):s==="meet"&&(c=u=Math.min(u,c)),[u,0,0,c,m*(e-r*u),w*(t-a*c)]}function Ft(n){let e=Object.create(null);n=(n||"").trim().split(/;/);for(let t=0;ta.selector.specificity||(e[i]=a.css[i],t[i]=a.selector.specificity)}return e}function et(n,e){return n.concat(e.slice(n.length))}function R(n,e){return Math.max(n.ascender,(n.bbox[3]||n.bbox.maxY)*(n.scale||1))*e/1e3}function gt(n,e){return Math.min(n.descender,(n.bbox[1]||n.bbox.minY)*(n.scale||1))*e/1e3}function ve(n,e){return(n.xHeight||.5*(n.ascender-n.descender))*e/1e3}function ke(n,e,t,r){let a,i;switch(t){case"middle":a=.5*ve(n,e);break;case"central":a=.5*(gt(n,e)+R(n,e));break;case"after-edge":case"text-after-edge":a=gt(n,e);break;case"alphabetic":case"auto":case"baseline":a=0;break;case"mathematical":a=.5*R(n,e);break;case"hanging":a=.8*R(n,e);break;case"before-edge":case"text-before-edge":a=R(n,e);break;default:a=0;break}switch(r){case"baseline":i=0;break;case"super":i=.6*e;break;case"sub":i=-.6*e;break;default:i=r;break}return a-i}function Me(n,e,t){let r=n.encode(""+t),a=r[0],i=r[1],o=[];for(let s=0;sv&&(d=v,v=g,g=d),p>M&&(d=M,M=p,p=d);let P=Dt(c);for(let S=0;S=0&&P[S]<=1){let k=W(P[S],h);kv&&(v=k)}let y=Dt(m);for(let S=0;S=0&&y[S]<=1){let k=W(y[S],u);kM&&(M=k)}return[g,p,v,M]},this.getPointAtLength=function(d){if(N(d,0))return this.startPoint;if(N(d,this.totalLength))return this.endPoint;if(!(d<0||d>this.totalLength))for(let g=1;g<=l;g++){let p=w[g-1],v=w[g];if(p<=d&&d<=v){let M=(g-(v-d)/(v-p))/l,P=W(M,h),y=W(M,u),S=W(M,c),k=W(M,m);return[P,y,Math.atan2(k,S)]}}}},Gt=function(n,e,t,r){this.totalLength=Math.sqrt((t-n)*(t-n)+(r-e)*(r-e)),this.startPoint=[n,e,Math.atan2(r-e,t-n)],this.endPoint=[t,r,Math.atan2(r-e,t-n)],this.getBoundingBox=function(){return[Math.min(this.startPoint[0],this.endPoint[0]),Math.min(this.startPoint[1],this.endPoint[1]),Math.max(this.startPoint[0],this.endPoint[0]),Math.max(this.startPoint[1],this.endPoint[1])]},this.getPointAtLength=function(a){if(a>=0&&a<=this.totalLength){let i=a/this.totalLength||0,o=this.startPoint[0]+i*(this.endPoint[0]-this.startPoint[0]),s=this.startPoint[1]+i*(this.endPoint[1]-this.startPoint[1]);return[o,s,this.startPoint[2]]}}},_=function(){this.pathCommands=[],this.pathSegments=[],this.startPoint=null,this.endPoint=null,this.totalLength=0;let n=0,e=0,t=0,r=0,a,i,o;this.move=function(s,l){return n=t=s,e=r=l,null},this.line=function(s,l){let h=new Gt(t,r,s,l);return t=s,r=l,h},this.curve=function(s,l,h,u,c,m){let w=new ye(t,r,s,l,h,u,c,m);return t=c,r=m,w},this.close=function(){let s=new Gt(t,r,n,e);return t=n,r=e,s},this.addCommand=function(s){this.pathCommands.push(s);let l=this[s[0]].apply(this,s.slice(3));l&&(l.hasStart=s[1],l.hasEnd=s[2],this.startPoint=this.startPoint||l.startPoint,this.endPoint=l.endPoint,this.pathSegments.push(l),this.totalLength+=l.totalLength)},this.M=function(s,l){return this.addCommand(["move",!0,!0,s,l]),a="M",this},this.m=function(s,l){return this.M(t+s,r+l)},this.Z=this.z=function(){return this.addCommand(["close",!0,!0]),a="Z",this},this.L=function(s,l){return this.addCommand(["line",!0,!0,s,l]),a="L",this},this.l=function(s,l){return this.L(t+s,r+l)},this.H=function(s){return this.L(s,r)},this.h=function(s){return this.L(t+s,r)},this.V=function(s){return this.L(t,s)},this.v=function(s){return this.L(t,r+s)},this.C=function(s,l,h,u,c,m){return this.addCommand(["curve",!0,!0,s,l,h,u,c,m]),a="C",i=h,o=u,this},this.c=function(s,l,h,u,c,m){return this.C(t+s,r+l,t+h,r+u,t+c,r+m)},this.S=function(s,l,h,u){return this.C(t+(a==="C"?t-i:0),r+(a==="C"?r-o:0),s,l,h,u)},this.s=function(s,l,h,u){return this.C(t+(a==="C"?t-i:0),r+(a==="C"?r-o:0),t+s,r+l,t+h,r+u)},this.Q=function(s,l,h,u){let c=t+.6666666666666666*(s-t),m=r+2/3*(l-r),w=h+2/3*(s-h),d=u+2/3*(l-u);return this.addCommand(["curve",!0,!0,c,m,w,d,h,u]),a="Q",i=s,o=l,this},this.q=function(s,l,h,u){return this.Q(t+s,r+l,t+h,r+u)},this.T=function(s,l){return this.Q(t+(a==="Q"?t-i:0),r+(a==="Q"?r-o:0),s,l)},this.t=function(s,l){return this.Q(t+(a==="Q"?t-i:0),r+(a==="Q"?r-o:0),t+s,r+l)},this.A=function(s,l,h,u,c,m,w){if(N(s,0)||N(l,0))this.addCommand(["line",!0,!0,m,w]);else{h=h*(Math.PI/180),s=Math.abs(s),l=Math.abs(l),u=1*!!u,c=1*!!c;let d=Math.cos(h)*(t-m)/2+Math.sin(h)*(r-w)/2,g=Math.cos(h)*(r-w)/2-Math.sin(h)*(t-m)/2,p=d*d/(s*s)+g*g/(l*l);p>1&&(s*=Math.sqrt(p),l*=Math.sqrt(p));let v=Math.sqrt(Math.max(0,s*s*l*l-s*s*g*g-l*l*d*d)/(s*s*g*g+l*l*d*d)),M=(u===c?-1:1)*v*s*g/l,P=(u===c?1:-1)*v*l*d/s,y=Math.cos(h)*M-Math.sin(h)*P+(t+m)/2,S=Math.sin(h)*M+Math.cos(h)*P+(r+w)/2,k=Math.atan2((g-P)/l,(d-M)/s),L=Math.atan2((-g-P)/l,(-d-M)/s);c===0&&L-k>0?L-=2*Math.PI:c===1&&L-k<0&&(L+=2*Math.PI);let I=Math.ceil(Math.abs(L-k)/(Math.PI/Zt));for(let b=0;bs[2]&&(s[2]=h[2]),h[1]s[3]&&(s[3]=h[3])}for(let h=0;h=0&&s<=this.totalLength){let l;for(let h=0;h=0&&o[3]>=0?o:i},this.getPercent=function(a,i){let o=this.attr(a),s=new z((o||"").trim()),l,h,u=s.matchNumber();return!u||(s.match("%")&&(u*=.01),s.matchAll())?i:Math.max(0,Math.min(1,u))},this.chooseValue=function(a){for(let i=0;i=0&&(s=h);break;case"stroke-miterlimit":h=parseFloat(o),h!=null&&h>=1&&(s=h);break;case"word-spacing":case"letter-spacing":s=this.computeLength(o,this.getViewport());break;case"stroke-dashoffset":if(s=this.computeLength(o,this.getViewport()),s!=null&&s<0){let u=this.get("stroke-dasharray");for(let c=0;c0?i:this.ref?this.ref.getChildren():[]},this.getPaint=function(i,o,s,l){let h=this.attr("patternUnits")!=="userSpaceOnUse",u=this.attr("patternContentUnits")==="objectBoundingBox",c=this.getLength("x",h?1:this.getParentVWidth(),0),m=this.getLength("y",h?1:this.getParentVHeight(),0),w=this.getLength("width",h?1:this.getParentVWidth(),0),d=this.getLength("height",h?1:this.getParentVHeight(),0);u&&!h?(c=(c-i[0])/(i[2]-i[0])||0,m=(m-i[1])/(i[3]-i[1])||0,w=w/(i[2]-i[0])||0,d=d/(i[3]-i[1])||0):!u&&h&&(c=i[0]+c*(i[2]-i[0]),m=i[1]+m*(i[3]-i[1]),w=w*(i[2]-i[0]),d=d*(i[3]-i[1]));let g=this.getViewbox("viewBox",[0,0,w,d]),p=(this.attr("preserveAspectRatio")||"").trim(),v=A(tt(p,w,d,g[2],g[3],0),[1,0,0,1,-g[0],-g[1]]),M=yt(this.attr("patternTransform"));if(u&&(M=A([i[2]-i[0],0,0,i[3]-i[1],i[0],i[1]],M)),M=A(M,[1,0,0,1,c,m]),(M=Mt(M))&&(v=Mt(v))&&(w=H(w))&&(d=H(d))){let P=X([0,0,w,d]);return f.transform.apply(f,v),this.drawChildren(s,l),B(P),[re(P,w,d,M),o]}else return t?[t[0],t[1]*o]:void 0},this.getVWidth=function(){let i=this.attr("patternUnits")!=="userSpaceOnUse",o=this.getLength("width",i?1:this.getParentVWidth(),0);return this.getViewbox("viewBox",[0,0,o,0])[2]},this.getVHeight=function(){let i=this.attr("patternUnits")!=="userSpaceOnUse",o=this.getLength("height",i?1:this.getParentVHeight(),0);return this.getViewbox("viewBox",[0,0,0,o])[3]}},pt=function(n,e,t){Lt.call(this,n,e),this.allowedChildren=["stop"],this.ref=function(){let i=this.getUrl("href")||this.getUrl("xlink:href");if(i&&i.nodeName===n.nodeName)return new pt(i,e,t)}.call(this);let r=this.attr;this.attr=function(i){let o=r.call(this,i);return o!=null||i==="href"||i==="xlink:href"?o:this.ref?this.ref.attr(i):null};let a=this.getChildren;this.getChildren=function(){let i=a.call(this);return i.length>0?i:this.ref?this.ref.getChildren():[]},this.getPaint=function(i,o,s,l){let h=this.getChildren();if(h.length===0)return;if(h.length===1){let k=h[0],L=k.get("stop-color");return L==="none"?void 0:ot(L,k.get("stop-opacity")*o,l)}let u=this.attr("gradientUnits")!=="userSpaceOnUse",c=yt(this.attr("gradientTransform")),m=this.attr("spreadMethod"),w,d,g,p,v,M,P=0,y=0,S=1;if(u&&(c=A([i[2]-i[0],0,0,i[3]-i[1],i[0],i[1]],c)),c=Mt(c)){if(this.name==="linearGradient")d=this.getLength("x1",u?1:this.getVWidth(),0),g=this.getLength("x2",u?1:this.getVWidth(),u?1:this.getVWidth()),p=this.getLength("y1",u?1:this.getVHeight(),0),v=this.getLength("y2",u?1:this.getVHeight(),0);else{g=this.getLength("cx",u?1:this.getVWidth(),u?.5:.5*this.getVWidth()),v=this.getLength("cy",u?1:this.getVHeight(),u?.5:.5*this.getVHeight()),M=this.getLength("r",u?1:this.getViewport(),u?.5:.5*this.getViewport()),d=this.getLength("fx",u?1:this.getVWidth(),g),p=this.getLength("fy",u?1:this.getVHeight(),v),M<0&&V("SvgElemGradient: negative r value");let k=Math.sqrt(Math.pow(g-d,2)+Math.pow(v-p,2)),L=1;k>M&&(L=M/k,d=g+(d-g)*L,p=v+(p-v)*L),M=Math.max(M,k*L*(1+1e-6))}if(m==="reflect"||m==="repeat"){let k=Ut(c),L=E([i[0],i[1]],k),I=E([i[2],i[1]],k),b=E([i[2],i[3]],k),C=E([i[0],i[3]],k);this.name==="linearGradient"?(P=Math.max((L[0]-g)*(g-d)+(L[1]-v)*(v-p),(I[0]-g)*(g-d)+(I[1]-v)*(v-p),(b[0]-g)*(g-d)+(b[1]-v)*(v-p),(C[0]-g)*(g-d)+(C[1]-v)*(v-p))/(Math.pow(g-d,2)+Math.pow(v-p,2)),y=Math.max((L[0]-d)*(d-g)+(L[1]-p)*(p-v),(I[0]-d)*(d-g)+(I[1]-p)*(p-v),(b[0]-d)*(d-g)+(b[1]-p)*(p-v),(C[0]-d)*(d-g)+(C[1]-p)*(p-v))/(Math.pow(g-d,2)+Math.pow(v-p,2))):P=Math.sqrt(Math.max(Math.pow(L[0]-g,2)+Math.pow(L[1]-v,2),Math.pow(I[0]-g,2)+Math.pow(I[1]-v,2),Math.pow(b[0]-g,2)+Math.pow(b[1]-v,2),Math.pow(C[0]-g,2)+Math.pow(C[1]-v,2)))/M-1,P=Math.ceil(P+.5),y=Math.ceil(y+.5),S=y+1+P}this.name==="linearGradient"?w=f.linearGradient(d-y*(g-d),p-y*(v-p),g+P*(g-d),v+P*(v-p)):w=f.radialGradient(d,p,0,g,v,M+P*M);for(let k=0;k0&&w.stop((k+0)/S,x[0],x[1]),w.stop((k+L)/(P+y+1),x[0],x[1]),b===h.length-1&&L<1&&w.stop((k+1)/S,x[0],x[1])}}return w.setTransform.apply(w,c),[w,1]}else return t?[t[0],t[1]*o]:void 0}},Y=function(n,e){ft.call(this,n,e),this.dashScale=1,this.getBoundingShape=function(){return this.shape},this.getTransformation=function(){return this.get("transform")},this.drawInDocument=function(t,r){if(!(this.get("visibility")==="hidden"||!this.shape)){if(f.save(),this.transform(),this.clip(),t)this.shape.insertInDocument(),Q(F.white),f.fill(this.get("clip-rule"));else{let a=this.mask(),i;a&&(i=X(K()));let o=this.shape.getSubPaths(),s=this.getFill(t,r),l=this.getStroke(t,r),h=this.get("stroke-width"),u=this.get("stroke-linecap");if(s||l){if(s&&Q(s),l){for(let p=0;p0&&o[p].startPoint&&o[p].startPoint.length>1){let v=o[p].startPoint[0],M=o[p].startPoint[1];Q(l),u==="square"?f.rect(v-.5*h,M-.5*h,h,h):u==="round"&&f.circle(v,M,.5*h),f.fill()}let d=this.get("stroke-dasharray"),g=this.get("stroke-dashoffset");if(j(this.dashScale,1)){for(let p=0;p0&&o[d].insertInDocument();s&&l?f.fillAndStroke(this.get("fill-rule")):s?f.fill(this.get("fill-rule")):l&&f.stroke()}let c=this.get("marker-start"),m=this.get("marker-mid"),w=this.get("marker-end");if(c!=="none"||m!=="none"||w!=="none"){let d=this.shape.getMarkers();if(c!=="none"&&new xt(c,null).drawMarker(!1,r,d[0],h),m!=="none")for(let g=1;g0&&i>0?o&&s?(o=Math.min(o,.5*a),s=Math.min(s,.5*i),this.shape=new _().M(t+o,r).L(t+a-o,r).A(o,s,0,0,1,t+a,r+s).L(t+a,r+i-s).A(o,s,0,0,1,t+a-o,r+i).L(t+o,r+i).A(o,s,0,0,1,t,r+i-s).L(t,r+s).A(o,s,0,0,1,t+o,r).Z()):this.shape=new _().M(t,r).L(t+a,r).L(t+a,r+i).L(t,r+i).Z():this.shape=new _},be=function(n,e){Y.call(this,n,e);let t=this.getLength("cx",this.getVWidth(),0),r=this.getLength("cy",this.getVHeight(),0),a=this.getLength("r",this.getViewport(),0);a>0?this.shape=new _().M(t+a,r).A(a,a,0,0,1,t-a,r).A(a,a,0,0,1,t+a,r).Z():this.shape=new _},Ve=function(n,e){Y.call(this,n,e);let t=this.getLength("cx",this.getVWidth(),0),r=this.getLength("cy",this.getVHeight(),0),a=this.getLength("rx",this.getVWidth(),0),i=this.getLength("ry",this.getVHeight(),0);a>0&&i>0?this.shape=new _().M(t+a,r).A(a,i,0,0,1,t-a,r).A(a,i,0,0,1,t+a,r).Z():this.shape=new _},_e=function(n,e){Y.call(this,n,e);let t=this.getLength("x1",this.getVWidth(),0),r=this.getLength("y1",this.getVHeight(),0),a=this.getLength("x2",this.getVWidth(),0),i=this.getLength("y2",this.getVHeight(),0);this.shape=new _().M(t,r).L(a,i)},Ae=function(n,e){Y.call(this,n,e);let t=this.getNumberList("points");this.shape=new _;for(let r=0;r0?t:void 0,this.dashScale=this.pathLength!==void 0?this.shape.totalLength/this.pathLength:1},xt=function(n,e){it.call(this,n,e);let t=this.getLength("markerWidth",this.getParentVWidth(),3),r=this.getLength("markerHeight",this.getParentVHeight(),3),a=this.getViewbox("viewBox",[0,0,t,r]);this.getVWidth=function(){return a[2]},this.getVHeight=function(){return a[3]},this.drawMarker=function(i,o,s,l){f.save();let h=this.attr("orient"),u=this.attr("markerUnits"),c=h==="auto"?s[2]:(parseFloat(h)||0)*Math.PI/180,m=u==="userSpaceOnUse"?1:l;f.transform(Math.cos(c)*m,Math.sin(c)*m,-Math.sin(c)*m,Math.cos(c)*m,s[0],s[1]);let w=this.getLength("refX",this.getVWidth(),0),d=this.getLength("refY",this.getVHeight(),0),g=tt(this.attr("preserveAspectRatio"),t,r,a[2],a[3],.5);this.get("overflow")==="hidden"&&f.rect(g[0]*(a[0]+a[2]/2-w)-t/2,g[3]*(a[1]+a[3]/2-d)-r/2,t,r).clip(),f.transform.apply(f,g),f.translate(-w,-d);let p;this.get("opacity")<1&&!i&&(p=X(K())),this.drawChildren(i,o),p&&(B(p),f.fillOpacity(this.get("opacity")),ht(p)),f.restore()}},Te=function(n,e){it.call(this,n,e),this.useMask=function(t){let r=X(K());f.save(),this.attr("clipPathUnits")==="objectBoundingBox"&&f.transform(t[2]-t[0],0,0,t[3]-t[1],t[0],t[1]),this.clip(),this.drawChildren(!0,!1),f.restore(),B(r),Ot(r,!0)}},Oe=function(n,e){it.call(this,n,e),this.useMask=function(t){let r=X(K());f.save();let a,i,o,s;this.attr("maskUnits")==="userSpaceOnUse"?(a=this.getLength("x",this.getVWidth(),-.1*(t[2]-t[0])+t[0]),i=this.getLength("y",this.getVHeight(),-.1*(t[3]-t[1])+t[1]),o=this.getLength("width",this.getVWidth(),1.2*(t[2]-t[0])),s=this.getLength("height",this.getVHeight(),1.2*(t[3]-t[1]))):(a=this.getLength("x",this.getVWidth(),-.1)*(t[2]-t[0])+t[0],i=this.getLength("y",this.getVHeight(),-.1)*(t[3]-t[1])+t[1],o=this.getLength("width",this.getVWidth(),1.2)*(t[2]-t[0]),s=this.getLength("height",this.getVHeight(),1.2)*(t[3]-t[1])),f.rect(a,i,o,s).clip(),this.attr("maskContentUnits")==="objectBoundingBox"&&f.transform(t[2]-t[0],0,0,t[3]-t[1],t[0],t[1]),this.clip(),this.drawChildren(!1,!0),f.restore(),B(r),Ot(r,!0)}},St=function(n,e){ft.call(this,n,e),this.allowedChildren=["tspan","#text","#cdata-section","a"],this.isText=!0,this.getBoundingShape=function(){let t=new _;for(let r=0;r0?i:this.pathObject.totalLength,this.pathScale=this.pathObject.totalLength/this.pathLength}else if((a=this.getUrl("href")||this.getUrl("xlink:href"))&&a.nodeName==="path"){let i=new Xt(a,this);this.pathObject=i.shape.clone().transform(i.get("transform")),this.pathLength=this.chooseValue(i.pathLength,this.pathObject.totalLength),this.pathScale=this.pathObject.totalLength/this.pathLength}},We=function(n,e){St.call(this,n,e),this.allowedChildren=["textPath","tspan","#text","#cdata-section","a"],function(t){let r="",a=n.textContent,i=[],o=[],s,l,h=0,u=0;function c(){if(o.length){let g=o[o.length-1],p=o[0],v=g.x+g.width-p.x,M={startltr:0,middleltr:.5,endltr:1,startrtl:1,middlertl:.5,endrtl:0}[s+l]*v||0;for(let P=0;P0&&k<1/0)for(let L=0;L=2){let k=(p-(S-y))/(g.length-1);for(let L=0;Lv||S<0)g._pos[y].hidden=!0;else{let k=p.getPointAtLength(S*M);j(M,1)&&(g._pos[y].scale*=M,g._pos[y].width*=M),g._pos[y].x=k[0]-.5*g._pos[y].width*Math.cos(k[2])-g._pos[y].y*Math.sin(k[2]),g._pos[y].y=k[1]-.5*g._pos[y].width*Math.sin(k[2])+g._pos[y].y*Math.cos(k[2]),g._pos[y].rotate=k[2]+g._pos[y].rotate,g._pos[y].continuous=!1}}}else for(let P=0;P