(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e=e||self,t(e.canvg={}))})(this,function(e){'use strict';var ce=Math.tan,pe=Math.atan2,ye=Math.PI,he=Math.round,fe=String.prototype,me=Math.max,xe=Math.min,be=Math.ceil,ve=Math.sin,ke=Math.cos,Se=Math.floor,Pe=Math.sqrt,Ae=Math.pow;function t(e,t){return t={exports:{}},e(t,t.exports),t.exports}function n(e,t){return RegExp(e,t)}function a(e){return e.replace(/(?!\u3000)\s+/gm," ")}function r(e){return e.replace(/^[\n \t]+/,"")}function l(e){return e.replace(/[\n \t]+$/,"")}function o(e){var t=(e||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return t.map(parseFloat)}function s(e){return ua.test(e)?e.toLowerCase():e}function d(e){var t=e.match(/url\(('([^']+)'|"([^"]+)"|([^'"\)]+))\)/)||[];return t[2]||t[3]||t[4]}function u(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],a=!0,r=!1,i=void 0;try{for(var l=e[Symbol.iterator](),o;!(a=(o=l.next()).done)&&(n.push(o.value),!(t&&n.length===t));a=!0);}catch(e){r=!0,i=e}finally{try{a||null==l["return"]||l["return"]()}finally{if(r)throw i}}return n}}function g(e,t){return ha(e)||fa(e,t)||ma()}function p(e,t){var n=e.match(t);return n?[e.replace(t," "),n.length]:[e,0]}function y(e){var t=[0,0,0],n=e.replace(/:not\(([^\)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),a=0,r=p(n,ba),i=xa(r,2);n=i[0],a=i[1],t[1]+=a;var l=p(n,va),o=xa(l,2);n=o[0],a=o[1],t[0]+=a;var s=p(n,ka),d=xa(s,2);n=d[0],a=d[1],t[1]+=a;var u=p(n,Sa),g=xa(u,2);n=g[0],a=g[1],t[2]+=a;var c=p(n,Pa),y=xa(c,2);n=y[0],a=y[1],t[1]+=a;var h=p(n,Aa),f=xa(h,2);n=f[0],a=f[1],t[1]+=a,n=n.replace(/[\*\s\+>~]/g," ").replace(/[#\.]/g," ");var m=p(n,Ea),x=xa(m,2);return n=x[0],a=x[1],t[2]+=a,t.join("")}function h(e){return Pe(Ae(e[0],2)+Ae(e[1],2))}function x(e,t){return(e[0]*t[0]+e[1]*t[1])/(h(e)*h(t))}function b(e,t){var n=Math.acos;return(e[0]*t[1]a&&(n--,a+=1e9)),[n,a]}function $(){var e=new Date;return(e-Eo)/1e3}function U(e){var t=e.trim();return /^('|")/.test(t)?t:"\"".concat(t,"\"")}function W(e){return"undefined"==typeof process?e:e.trim().split(",").map(U).join(",")}function q(e){if(!e)return"";var t=e.trim().toLowerCase();return"normal"===t||"italic"===t||"oblique"===t||"inherit"===t||"initial"===t||"unset"===t?t:/^oblique\s+(-|)\d+deg$/.test(t)?t:""}function X(e){if(!e)return"";var t=e.trim().toLowerCase();return"normal"===t||"bold"===t||"lighter"===t||"bolder"===t||"inherit"===t||"initial"===t||"unset"===t?t:/^[\d.]+$/.test(t)?t:""}function Q(e){return a(e).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function K(e){var t=e.split("("),n=xa(t,2),a=n[0],r=n[1];return[a.trim(),r.trim().replace(")","")]}function Z(e){var t=e.replace(/,/gm," ").replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2").replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2").replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2").replace(/([0-9])([+\-])/gm,"$1 $2").replace(/(\.[0-9]*)(\.)/gm,"$1 $2").replace(/(\.[0-9]*)(\.)/gm,"$1 $2").replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");return a(t).trim()}function J(e,t,n,a,r,i){return e[4*(n*a)+4*t+i]}function ee(e,t,n,a,r,i,l){e[4*(n*a)+4*t+i]=l}function te(e,t,n){var a=e[t];return a*(0>a?n-255:n)}function m(e,t,n,a){return t+ke(e)*n+ve(e)*a}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ae(e,t,n,a,r){if("string"==typeof e&&(e=document.getElementById(e)),!e||"object"!==c(e)||!("getContext"in e))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var i=e.getContext("2d");try{return i.getImageData(t,n,a,r)}catch(t){throw new Error("unable to access image data: "+t)}}function re(e,t,n,a,r,i){if(!(isNaN(i)||1>i)){i|=0;var l=ae(e,t,n,a,r);l=ie(l,t,n,a,r,i),e.getContext("2d").putImageData(l,t,n)}}function ie(e,t,n,a,r,l){var o=e.data,s=a-1,d=r-1,u=l+1,g=u*(u+1)/2,c=new og,h=c,f,m,b,v,k,S,P,A,E,T,C,w,O,V,R,L,I,D,N,M,z,B,_,F,j;for(b=1;b<2*l+1;b++)h=h.next=new og,b===u&&(j=h);h.next=c;var G=null,H=null;P=S=0;var Y=ig[l],$=lg[l];for(m=0;m>$,0===_?o[S]=o[S+1]=o[S+2]=0:(_=255/_,o[S]=(A*Y>>$)*_,o[S+1]=(E*Y>>$)*_,o[S+2]=(T*Y>>$)*_),A-=w,E-=O,T-=V,C-=R,w-=G.r,O-=G.g,V-=G.b,R-=G.a,v=P+((v=f+l+1)>$,0<_?(_=255/_,o[v]=(A*Y>>$)*_,o[v+1]=(E*Y>>$)*_,o[v+2]=(T*Y>>$)*_):o[v]=o[v+1]=o[v+2]=0,A-=w,E-=O,T-=V,C-=R,w-=G.r,O-=G.g,V-=G.b,R-=G.a,v=f+((v=m+u)arguments.length?Rt(Vt[e])||Rt(Ce[e]):Vt[e]&&Vt[e][t]||Ce[e]&&Ce[e][t]},It=function(e){return isNaN(e=+e)?0:(0n?me(n+t,0):xe(n,t)},Mt=function(e){return function(t,n,a){var r=Fe(t),i=Dt(r.length),l=Nt(a,i),o;if(e&&n!=n){for(;i>l;)if(o=r[l++],o!=o)return!0;}else for(;i>l;l++)if((e||l in r)&&r[l]===n)return e||l||0;return!e&&-1}},zt={includes:Mt(!0),indexOf:Mt(!1)},Bt=zt.indexOf,_t=function(e,t){var n=Fe(e),a=0,r=[],l;for(l in n)!Ye(mt,l)&&Ye(n,l)&&r.push(l);for(;t.length>a;)Ye(n,l=t[a++])&&(~Bt(r,l)||r.push(l));return r},Ft=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],jt=Ft.concat("length","prototype"),Gt=Object.getOwnPropertyNames||function(e){return _t(e,jt)},Ht={f:Gt},Yt=Object.getOwnPropertySymbols,$t={f:Yt},Ut=Lt("Reflect","ownKeys")||function(e){var t=Ht.f(Ze(e)),n=$t.f;return n?t.concat(n(e)):t},Wt=function(e,t){for(var n=Ut(t),a=tt.f,r=Ke.f,l=0,o;lc;c++)if((5==e||a||c in d)&&(h=d[c],f=u(h,c,s),e))if(t)y[c]=f;else if(f)switch(e){case 3:return!0;case 5:return h;case 6:return c;case 2:fn.call(y,h);}else if(n)return!1;return a?-1:3==e||n?n:y}},xn={forEach:mn(0),map:mn(1),filter:mn(2),some:mn(3),every:mn(4),find:mn(5),findIndex:mn(6)},bn=Lt("navigator","userAgent")||"",vn=Ce.process,kn=vn&&vn.versions,Sn=kn&&kn.v8,Pn,An;Sn?(Pn=Sn.split("."),An=Pn[0]+Pn[1]):bn&&(Pn=bn.match(/Edge\/(\d+)/),(!Pn||74<=Pn[1])&&(Pn=bn.match(/Chrome\/(\d+)/),Pn&&(An=Pn[1])));var En=An&&+An,Tn=pn("species"),Cn=function(e){return 51<=En||!we(function(){var t=[],n=t.constructor={};return n[Tn]=function(){return{foo:1}},1!==t[e](Boolean).foo})},wn=xn.map,On=Cn("map"),Vn=On&&!we(function(){[].map.call({length:-1,0:1},function(e){throw e})});nn({target:"Array",proto:!0,forced:!On||!Vn},{map:function(e){return wn(this,e,1")}),Jn=function(){return"$0"==="a".replace(/./,"$0")}(),ea=!we(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}),ta=function(e,t,n,a){var r=pn(e),i=!we(function(){var t={};return t[r]=function(){return 7},7!=""[e](t)}),l=i&&!we(function(){var t=!1,n=/a/;return"split"===e&&(n={},n.constructor={},n.constructor[Kn]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t});if(!i||!l||"replace"===e&&!(Zn&&Jn)||"split"===e&&!ea){var o=/./[r],s=n(r,""[e],function(e,t,n,a,r){return t.exec===Qn?i&&!r?{done:!0,value:o.call(t,n,a)}:{done:!0,value:e.call(n,t,a)}:{done:!1}},{REPLACE_KEEPS_$0:Jn}),d=s[0],u=s[1];Ot(String.prototype,e,d),Ot(RegExp.prototype,r,2==t?function(e,t){return u.call(e,this,t)}:function(e){return u.call(e,this)})}a&&nt(RegExp.prototype[r],"sham",!0)},na=function(e){return function(t,n){var a=_e(t)+"",r=It(n),i=a.length,l,o;return 0>r||r>=i?e?"":void 0:(l=a.charCodeAt(r),55296>l||56319(o=a.charCodeAt(r+1))||57343]*>)/g,sa=/\$([$&'`]|\d\d?)/g,da=function(e){return void 0===e?e:e+""};ta("replace",2,function(e,t,n,a){function r(e,a,r,i,l,o){var s=r+e.length,d=i.length,n=sa;return void 0!==l&&(l=ln(l),n=oa),t.call(o,n,function(t,o){var u;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return a.slice(0,r);case"'":return a.slice(s);case"<":u=l[o.slice(1,-1)];break;default:var g=+o;if(0==g)return t;if(g>d){var n=Se(g/10);return 0===n?t:n<=d?void 0===i[n-1]?o.charAt(1):i[n-1]+o.charAt(1):t}u=i[g-1];}return void 0===u?"":u})}return[function(n,a){var r=_e(this),i=null==n?void 0:n[e];return void 0===i?t.call(r+"",n,a):i.call(n,r,a)},function(e,l){if(a.REPLACE_KEEPS_$0||"string"==typeof l&&-1===l.indexOf("$0")){var o=n(t,e,this,l);if(o.done)return o.value}var s=Ze(e),d=this+"",u="function"==typeof l;u||(l+="");var g=s.global;if(g){var c=s.unicode;s.lastIndex=0}for(var p=[],y,h;(y=la(s,d),null!==y)&&(p.push(y),!!g);)h=y[0]+"",""==h&&(s.lastIndex=ia(d,Dt(s.lastIndex),c));for(var f="",m=0,x=0;x=m&&(f+=d.slice(m,v)+E,m=v+b.length)}return f+d.slice(m)}]});var ua=/^[A-Z-]+$/,ga=function(e,t){var n=[][e];return!n||!we(function(){n.call(null,t||function(){throw 1},1)})},ca=[].join,pa=Be!=Object,ya=ga("join",",");nn({target:"Array",proto:!0,forced:pa||ya},{join:function(e){return ca.call(Fe(this),void 0===e?",":e)}});var ha=function(e){if(Array.isArray(e))return e},fa=u,ma=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")},xa=g,ba=/(\[[^\]]+\])/g,va=/(#[^\s\+>~\.\[:]+)/g,ka=/(\.[^\s\+>~\.\[:]+)/g,Sa=/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi,Pa=/(:[\w-]+\([^\)]*\))/gi,Aa=/(:[^\s\+>~\.\[:]+)/g,Ea=/([^\s\+>~\.\[:]+)/g,Ta=1e-8,Ca=Object.keys||function(e){return _t(e,Ft)},wa=Oe?Object.defineProperties:function(e,t){Ze(e);for(var n=Ca(t),a=n.length,r=0,i;a>r;)tt.f(e,i=n[r++],t[i]);return e},Oa=Lt("document","documentElement"),Va=">",Ra="<",La="prototype",Ia="script",Da=ft("IE_PROTO"),Na=function(){},Ma=function(e){return Ra+Ia+Va+e+Ra+"/"+Ia+Va},za=function(e){e.write(Ma("")),e.close();var t=e.parentWindow.Object;return e=null,t},Ba=function(){var e=We("iframe"),t;return e.style.display="none",Oa.appendChild(e),e.src="java"+Ia+":"+"",t=e.contentWindow.document,t.open(),t.write(Ma("document.F=Object")),t.close(),t.F},_a=function(){try{Fa=document.domain&&new ActiveXObject("htmlfile")}catch(e){}_a=Fa?za(Fa):Ba();for(var e=Ft.length;e--;)delete _a[La][Ft[e]];return _a()},Fa;mt[Da]=!0;var ja=Object.create||function(e,t){var n;return null===e?n=_a():(Na[La]=Ze(e),n=new Na,Na[La]=null,n[Da]=e),void 0===t?n:wa(n,t)},Ga=Ht.f,Ha={}.toString,Ya="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],$a=function(e){try{return Ga(e)}catch(e){return Ya.slice()}},Ua={f:function(e){return Ya&&"[object Window]"==Ha.call(e)?$a(e):Ga(Fe(e))}},Wa={f:pn},qa=tt.f,Xa=function(e){var t=Vt.Symbol||(Vt.Symbol={});Ye(t,e)||qa(t,e,{value:Wa.f(e)})},Qa=tt.f,Ka=pn("toStringTag"),Za=function(e,t,n){e&&!Ye(e=n?e:e.prototype,Ka)&&Qa(e,Ka,{configurable:!0,value:t})},Ja=xn.forEach,er=ft("hidden"),tr="Symbol",nr="prototype",ar=pn("toPrimitive"),rr=wt.set,ir=wt.getterFor(tr),lr=Object[nr],or=Ce.Symbol,sr=Lt("JSON","stringify"),dr=Ke.f,ur=tt.f,gr=Ua.f,cr=f.f,pr=gt("symbols"),yr=gt("op-symbols"),hr=gt("string-to-symbol-registry"),fr=gt("symbol-to-string-registry"),mr=gt("wks"),xr=Ce.QObject,br=!xr||!xr[nr]||!xr[nr].findChild,vr=Oe&&we(function(){return 7!=ja(ur({},"a",{get:function(){return ur(this,"a",{value:7}).a}})).a})?function(e,t,n){var a=dr(lr,t);a&&delete lr[t],ur(e,t,n),a&&e!==lr&&ur(lr,t,a)}:ur,kr=function(e,t){var n=pr[e]=ja(or[nr]);return rr(n,{type:tr,tag:e,description:t}),Oe||(n.description=t),n},Sr=dn?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof or},Pr=function(e,t,n){e===lr&&Pr(yr,t,n),Ze(e);var a=Ge(t,!0);return Ze(n),Ye(pr,a)?(n.enumerable?(Ye(e,er)&&e[er][a]&&(e[er][a]=!1),n=ja(n,{enumerable:De(0,!1)})):(!Ye(e,er)&&ur(e,er,De(1,{})),e[er][a]=!0),vr(e,a,n)):ur(e,a,n)},Ar=function(e,t){Ze(e);var n=Fe(t),a=Ca(n).concat(wr(n));return Ja(a,function(t){(!Oe||Er.call(n,t))&&Pr(e,t,n[t])}),e},Er=function(e){var t=Ge(e,!0),n=cr.call(this,t);return(this!==lr||!Ye(pr,t)||Ye(yr,t))&&(!(n||!Ye(this,t)||!Ye(pr,t)||Ye(this,er)&&this[er][t])||n)},Tr=function(e,t){var n=Fe(e),a=Ge(t,!0);if(n!==lr||!Ye(pr,a)||Ye(yr,a)){var r=dr(n,a);return r&&Ye(pr,a)&&!(Ye(n,er)&&n[er][a])&&(r.enumerable=!0),r}},Cr=function(e){var t=gr(Fe(e)),n=[];return Ja(t,function(e){Ye(pr,e)||Ye(mt,e)||n.push(e)}),n},wr=function(e){var t=e===lr,n=gr(t?yr:Fe(e)),a=[];return Ja(n,function(e){Ye(pr,e)&&(!t||Ye(lr,e))&&a.push(pr[e])}),a};if(sn||(or=function(){if(this instanceof or)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?arguments[0]+"":void 0,t=yt(e),n=function(e){this===lr&&n.call(yr,e),Ye(this,er)&&Ye(this[er],t)&&(this[er][t]=!1),vr(this,t,De(1,e))};return Oe&&br&&vr(lr,t,{configurable:!0,set:n}),kr(t,e)},Ot(or[nr],"toString",function(){return ir(this).tag}),Ot(or,"withoutSetter",function(e){return kr(yt(e),e)}),f.f=Er,tt.f=Pr,Ke.f=Tr,Ht.f=Ua.f=Cr,$t.f=wr,Wa.f=function(e){return kr(pn(e),e)},Oe&&(ur(or[nr],"description",{configurable:!0,get:function(){return ir(this).description}}),Ot(lr,"propertyIsEnumerable",Er,{unsafe:!0}))),nn({global:!0,wrap:!0,forced:!sn,sham:!sn},{Symbol:or}),Ja(Ca(mr),function(e){Xa(e)}),nn({target:tr,stat:!0,forced:!sn},{for:function(e){var t=e+"";if(Ye(hr,t))return hr[t];var n=or(t);return hr[t]=n,fr[n]=t,n},keyFor:function(e){if(!Sr(e))throw TypeError(e+" is not a symbol");return Ye(fr,e)?fr[e]:void 0},useSetter:function(){br=!0},useSimple:function(){br=!1}}),nn({target:"Object",stat:!0,forced:!sn,sham:!Oe},{create:function(e,t){return void 0===t?ja(e):Ar(ja(e),t)},defineProperty:Pr,defineProperties:Ar,getOwnPropertyDescriptor:Tr}),nn({target:"Object",stat:!0,forced:!sn},{getOwnPropertyNames:Cr,getOwnPropertySymbols:wr}),nn({target:"Object",stat:!0,forced:we(function(){$t.f(1)})},{getOwnPropertySymbols:function(e){return $t.f(ln(e))}}),sr){var Or=!sn||we(function(){var e=or();return"[null]"!=sr([e])||"{}"!=sr({a:e})||"{}"!=sr(Object(e))});nn({target:"JSON",stat:!0,forced:Or},{stringify:function(e,t){for(var n=[e],a=1,r;arguments.length>a;)n.push(arguments[a++]);if(r=t,(je(t)||void 0!==e)&&!Sr(e))return on(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!Sr(t))return t}),n[1]=t,sr.apply(null,n)}})}or[nr][ar]||nt(or[nr],ar,or[nr].valueOf),Za(or,tr),mt[er]=!0;var Vr=xn.filter,Rr=Cn("filter"),Lr=Rr&&!we(function(){[].filter.call({length:-1,0:1},function(e){throw e})});nn({target:"Array",proto:!0,forced:!Rr||!Lr},{filter:function(e){return Vr(this,e,1i;)o=n(t,l=a[i++]),void 0!==o&&zr(r,l,o);return r}});var Br=we(function(){Ca(1)});nn({target:"Object",stat:!0,forced:Br},{keys:function(e){return Ca(ln(e))}});var _r={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var Fr in _r){var jr=Ce[Fr],Gr=jr&&jr.prototype;if(Gr&&Gr.forEach!==Dr)try{nt(Gr,"forEach",Dr)}catch(e){Gr.forEach=Dr}}var Hr=t(function(e){var t=function(e){function t(e,t,n,r){var i=t&&t.prototype instanceof a?t:a,l=Object.create(i.prototype),o=new c(r||[]);return l._invoke=s(e,n,o),l}function n(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function a(){}function r(){}function i(){}function l(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function o(e){function t(a,r,i,l){var o=n(e[a],e,r);if("throw"===o.type)l(o.arg);else{var s=o.arg,d=s.value;return d&&"object"==typeof d&&f.call(d,"__await")?Promise.resolve(d.__await).then(function(e){t("next",e,i,l)},function(e){t("throw",e,i,l)}):Promise.resolve(d).then(function(e){s.value=e,i(s)},function(e){return t("throw",e,i,l)})}}function a(e,n){function a(){return new Promise(function(a,r){t(e,n,a,r)})}return r=r?r.then(a,a):a()}var r;this._invoke=a}function s(e,t,a){var r="suspendedStart";return function(i,l){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw l;return y()}for(a.method=i,a.arg=l;;){var o=a.delegate;if(o){var s=d(o,a);if(s){if(s===S)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===r)throw r="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);r="executing";var u=n(e,t,a);if("normal"===u.type){if(r=a.done?"completed":"suspendedYield",u.arg===S)continue;return{value:u.arg,done:a.done}}"throw"===u.type&&(r="completed",a.method="throw",a.arg=u.arg)}}}function d(e,t){var a=e.iterator[t.method];if(a===k){if(t.delegate=null,"throw"===t.method){if(e.iterator["return"]&&(t.method="return",t.arg=k,d(e,t),"throw"===t.method))return S;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return S}var r=n(a,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,S;var i=r.arg;if(!i)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,S;if(i.done)t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=k);else return i;return t.delegate=null,S}function u(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function g(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function c(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(u,this),this.reset(!0)}function p(e){if(e){var t=e[x];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++nQr)throw TypeError(Kr);for(l=0;l=Qr)throw TypeError(Kr);zr(t,a++,d)}return t.length=a,t}});var ti=xn.every;nn({target:"Array",proto:!0,forced:ga("every")},{every:function(e){return ti(this,e,1a)for(;;){if(d in o){r=o[d],d+=u;break}if(d+=u,e?0>d:s<=d)throw TypeError("Reduce of empty array with no initial value")}for(;e?0<=d:s>d;d+=u)d in o&&(r=n(r,o[d],d,l));return r}},ai={left:ni(!1),right:ni(!0)},ri=ai.left;nn({target:"Array",proto:!0,forced:ga("reduce")},{reduce:function(e){return ri(this,e,arguments.length,1d;d++)if(g=r?l(Ze(p=e[d])[0],p[1]):l(e[d]),g&&g instanceof t)return g;return new t(!1)}o=s.call(e)}for(c=o.next;!(p=c.call(o)).done;)if(g=Oi(o,l,p.value,r),"object"==typeof g&&g&&g instanceof t)return g;return new t(!1)};n.stop=function(e){return new t(!0,e)}}),Ri=pn("iterator"),Li=!1;try{var Ii=0,Di={next:function(){return{done:!!Ii++}},return:function(){Li=!0}};Di[Ri]=function(){return this},Array.from(Di,function(){throw 2})}catch(e){}var Ni=function(e,t){if(!t&&!Li)return!1;var n=!1;try{var a={};a[Ri]=function(){return{next:function(){return{done:n=!0}}}},e(a)}catch(e){}return n},Mi=pn("species"),zi=function(e,t){var n=Ze(e).constructor,a;return void 0===n||null==(a=Ze(n)[Mi])?t:an(a)},Bi=/(iphone|ipod|ipad).*applewebkit/i.test(bn),_i=Ce.location,Fi=Ce.setImmediate,ji=Ce.clearImmediate,Gi=Ce.process,Hi=Ce.MessageChannel,Yi=Ce.Dispatch,$i=0,Ui={},Wi="onreadystatechange",qi=function(e){if(Ui.hasOwnProperty(e)){var t=Ui[e];delete Ui[e],t()}},Xi=function(e){return function(){qi(e)}},Qi=function(e){qi(e.data)},Ki=function(e){Ce.postMessage(e+"",_i.protocol+"//"+_i.host)},Zi,Ji,el;Fi&&ji||(Fi=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return Ui[++$i]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Zi($i),$i},ji=function(e){delete Ui[e]},"process"==Me(Gi)?Zi=function(e){Gi.nextTick(Xi(e))}:Yi&&Yi.now?Zi=function(e){Yi.now(Xi(e))}:Hi&&!Bi?(Ji=new Hi,el=Ji.port2,Ji.port1.onmessage=Qi,Zi=rn(el.postMessage,el,1)):!Ce.addEventListener||"function"!=typeof postMessage||Ce.importScripts||we(Ki)?Wi in We("script")?Zi=function(e){Oa.appendChild(We("script"))[Wi]=function(){Oa.removeChild(this),qi(e)}}:Zi=function(e){setTimeout(Xi(e),0)}:(Zi=Ki,Ce.addEventListener("message",Qi,!1)));var tl={set:Fi,clear:ji},nl=Ke.f,al=tl.set,rl=Ce.MutationObserver||Ce.WebKitMutationObserver,il=Ce.process,ll=Ce.Promise,ol="process"==Me(il),sl=nl(Ce,"queueMicrotask"),dl=sl&&sl.value,ul,gl,cl,pl,yl,hl,fl,ml;dl||(ul=function(){var e,t;for(ol&&(e=il.domain)&&e.exit();gl;){t=gl.fn,gl=gl.next;try{t()}catch(e){throw gl?pl():cl=void 0,e}}cl=void 0,e&&e.enter()},ol?pl=function(){il.nextTick(ul)}:rl&&!Bi?(yl=!0,hl=document.createTextNode(""),new rl(ul).observe(hl,{characterData:!0}),pl=function(){hl.data=yl=!yl}):ll&&ll.resolve?(fl=ll.resolve(void 0),ml=fl.then,pl=function(){ml.call(fl,ul)}):pl=function(){al.call(Ce,ul)});var xl=dl||function(e){var t={fn:e,next:void 0};cl&&(cl.next=t),gl||(gl=t,pl()),cl=t},bl=function(e){var t,n;this.promise=new e(function(e,a){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=a}),this.resolve=an(t),this.reject=an(n)},vl={f:function(e){return new bl(e)}},kl=function(e,t){if(Ze(e),je(t)&&t.constructor===e)return t;var n=vl.f(e),a=n.resolve;return a(t),n.promise},Sl=function(e,t){var n=Ce.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},Pl=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Al=tl.set,El=pn("species"),Tl="Promise",Cl=wt.get,wl=wt.set,Ol=wt.getterFor(Tl),Vl=xi,Rl=Ce.TypeError,Ll=Ce.document,Il=Ce.process,Dl=Lt("fetch"),Nl=vl.f,Ml=Nl,zl="process"==Me(Il),Bl=!!(Ll&&Ll.createEvent&&Ce.dispatchEvent),_l="unhandledrejection",Fl=0,jl=1,Gl=1,Hl=2,Yl=en(Tl,function(){var e=st(Vl)!==Vl+"";if(!e){if(66===En)return!0;if(!zl&&"function"!=typeof PromiseRejectionEvent)return!0}if(51<=En&&/native code/.test(Vl))return!1;var t=Vl.resolve(1),n=function(e){e(function(){},function(){})},a=t.constructor={};return a[El]=n,!(t.then(function(){})instanceof n)}),$l=Yl||!Ni(function(e){Vl.all(e)["catch"](function(){})}),Ul=function(e){var t;return!!(je(e)&&"function"==typeof(t=e.then))&&t},Wl=function(e,t,n){if(!t.notified){t.notified=!0;var a=t.reactions;xl(function(){for(var r=t.value,i=t.state==jl,l=0;a.length>l;){var o=a[l++],s=i?o.ok:o.fail,d=o.resolve,u=o.reject,g=o.domain,c,p,y;try{s?(!i&&(t.rejection===Hl&&Kl(e,t),t.rejection=Gl),!0===s?c=r:(g&&g.enter(),c=s(r),g&&(g.exit(),y=!0)),c===o.promise?u(Rl("Promise-chain cycle")):(p=Ul(c))?p.call(c,d,u):d(c)):u(r)}catch(e){g&&!y&&g.exit(),u(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&Xl(e,t)})}},ql=function(e,t,n){var a,r;Bl?(a=Ll.createEvent("Event"),a.promise=t,a.reason=n,a.initEvent(e,!1,!0),Ce.dispatchEvent(a)):a={promise:t,reason:n},(r=Ce["on"+e])?r(a):e===_l&&Sl("Unhandled promise rejection",n)},Xl=function(e,t){Al.call(Ce,function(){var n=t.value,a=Ql(t),r;if(a&&(r=Pl(function(){zl?Il.emit("unhandledRejection",n,e):ql(_l,e,n)}),t.rejection=zl||Ql(t)?Hl:Gl,r.error))throw r.value})},Ql=function(e){return e.rejection!==Gl&&!e.parent},Kl=function(e,t){Al.call(Ce,function(){zl?Il.emit("rejectionHandled",e):ql("rejectionhandled",e,t.value)})},Zl=function(e,t,n,a){return function(r){e(t,n,r,a)}},Jl=function(e,t,n,a){t.done||(t.done=!0,a&&(t=a),t.value=n,t.state=2,Wl(e,t,!0))},eo=function(e,t,n,a){if(!t.done){t.done=!0,a&&(t=a);try{if(e===n)throw Rl("Promise can't be resolved itself");var r=Ul(n);r?xl(function(){var a={done:!1};try{r.call(n,Zl(eo,e,a,t),Zl(Jl,e,a,t))}catch(n){Jl(e,a,n,t)}}):(t.value=n,t.state=jl,Wl(e,t,!1))}catch(n){Jl(e,{done:!1},n,t)}}},to,no,ao,ro;Yl&&(Vl=function(e){Si(this,Vl,Tl),an(e),to.call(this);var t=Cl(this);try{e(Zl(eo,this,t),Zl(Jl,this,t))}catch(e){Jl(this,t,e)}},to=function(){wl(this,{type:Tl,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:Fl,value:void 0})},to.prototype=bi(Vl.prototype,{then:function(e,t){var n=Ol(this),a=Nl(zi(this,Vl));return a.ok="function"!=typeof e||e,a.fail="function"==typeof t&&t,a.domain=zl?Il.domain:void 0,n.parent=!0,n.reactions.push(a),n.state!=Fl&&Wl(this,n,!1),a.promise},catch:function(e){return this.then(void 0,e)}}),no=function(){var e=new to,t=Cl(e);this.promise=e,this.resolve=Zl(eo,e,t),this.reject=Zl(Jl,e,t)},vl.f=Nl=function(e){return e===Vl||e===ao?new no(e):Ml(e)},"function"==typeof xi&&(ro=xi.prototype.then,Ot(xi.prototype,"then",function(e,t){var n=this;return new Vl(function(e,t){ro.call(n,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof Dl&&nn({global:!0,enumerable:!0,forced:!0},{fetch:function(){return kl(Vl,Dl.apply(Ce,arguments))}}))),nn({global:!0,wrap:!0,forced:Yl},{Promise:Vl}),Za(Vl,Tl,!1),ki(Tl),ao=Lt(Tl),nn({target:Tl,stat:!0,forced:Yl},{reject:function(e){var t=Nl(this);return t.reject.call(void 0,e),t.promise}}),nn({target:Tl,stat:!0,forced:Yl},{resolve:function(e){return kl(this,e)}}),nn({target:Tl,stat:!0,forced:$l},{all:function(e){var t=this,n=Nl(t),a=n.resolve,r=n.reject,i=Pl(function(){var n=an(t.resolve),i=[],l=0,o=1;Vi(e,function(e){var s=l++,d=!1;i.push(void 0),o++,n.call(t,e).then(function(e){d||(d=!0,i[s]=e,--o||a(i))},r)}),--o||a(i)});return i.error&&r(i.value),n.promise},race:function(e){var t=this,n=Nl(t),a=n.reject,r=Pl(function(){var r=an(t.resolve);Vi(e,function(e){r.call(t,e).then(n.resolve,a)})});return r.error&&a(r.value),n.promise}});var io=pn("match"),lo=function(e){var t;return je(e)&&(void 0===(t=e[io])?"RegExp"==Me(e):!!t)},oo=[].push,so=4294967295,uo=!we(function(){return!RegExp(so,"y")});ta("split",2,function(e,t,n){var a;return a="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||1<".".split(/()()/).length||"".split(/.?/).length?function(e,n){var a=_e(this)+"",r=void 0===n?so:n>>>0;if(0===r)return[];if(void 0===e)return[a];if(!lo(e))return t.call(a,e,r);for(var i=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),o=0,s=new RegExp(e.source,l+"g"),d,u,g;(d=Qn.call(s,a))&&(u=s.lastIndex,!(u>o&&(i.push(a.slice(o,d.index)),1=r)));)s.lastIndex===d.index&&s.lastIndex++;return o===a.length?(g||!s.test(""))&&i.push(""):i.push(a.slice(o)),i.length>r?i.slice(0,r):i}:function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)},[function(t,n){var r=_e(this),i=null==t?void 0:t[e];return void 0===i?a.call(r+"",t,n):i.call(t,r,n)},function(r,l){var o=n(a,r,this,l,a!==t);if(o.done)return o.value;var s=Ze(r),d=this+"",u=zi(s,RegExp),g=s.unicode,c=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(uo?"y":"g"),y=new u(uo?s:"^(?:"+s.source+")",c),h=void 0===l?so:l>>>0;if(0===h)return[];if(0===d.length)return null===la(y,d)?[d]:[];for(var f=0,m=0,x=[];mthis.r||isNaN(this.r)?0:255this.g||isNaN(this.g)?0:255this.b||isNaN(this.b)?0:255this.alpha?0:1 "+u.toRGB()+" -> "+u.toHex());d.appendChild(g),d.appendChild(c),s.appendChild(d)}catch(t){}return s}},Uo=function(){function e(t,n,a){Wr(this,e),this.document=t,this.name=n,this.value=a}return qr(e,[{key:"hasValue",value:function(){var e=this.value;return null!==e&&""!==e&&0!==e&&"undefined"!=typeof e}},{key:"isString",value:function(e){var t=this.value,n="string"==typeof t;return n&&e?e.test(t):n}},{key:"isUrlDefinition",value:function(){return this.isString(/^url\(/)}},{key:"isPixels",value:function(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case /px$/.test(e):case /^[0-9]+$/.test(e):return!0;default:return!1;}}},{key:"setValue",value:function(e){return this.value=e,this}},{key:"getValue",value:function(e){return"undefined"==typeof e||this.hasValue()?this.value:e}},{key:"getNumber",value:function(e){if(!this.hasValue())return"undefined"==typeof e?0:parseFloat(e);var t=this.value,a=parseFloat(t);return this.isString(/%$/)&&(a/=100),a}},{key:"getString",value:function(e){return"undefined"==typeof e||this.hasValue()?"undefined"==typeof this.value?"":this.value+"":e+""}},{key:"getDpi",value:function(){return 96}},{key:"getRem",value:function(){return this.document.rootEmSize}},{key:"getEm",value:function(){return this.document.emSize}},{key:"getUnits",value:function(){return this.getString().replace(/[0-9\.\-]/g,"")}},{key:"getPixels",value:function(e){var t=!!(1s?s*o.computeSize(i):s}}}},{key:"getMilliseconds",value:function(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}},{key:"getRadians",value:function(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(ye/180);case this.isString(/grad$/):return this.getNumber()*(ye/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(ye/180);}}},{key:"getDefinition",value:function(){var e=this.getString(),t=e.match(/#([^\)'"]+)/);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}},{key:"getFillStyleDefinition",value:function(e,t){var n=this.getDefinition();if(!n)return null;if("function"==typeof n.createGradient)return n.createGradient(this.document.ctx,e,t);if("function"==typeof n.createPattern){if(n.getHrefAttribute().hasValue()){var a=n.getAttribute("patternTransform");n=n.getHrefAttribute().getDefinition(),a.hasValue()&&n.getAttribute("patternTransform",!0).setValue(a.value)}return n.createPattern(this.document.ctx,e,t)}return null}},{key:"getTextBaseline",value:function(){return this.hasValue()?e.textBaselineMapping[this.getString()]:null}},{key:"addOpacity",value:function(t){for(var n=this.value,a=n.length,r=0,l=0;l=m&&(b=x-v%m,t.shouldUpdate(void 0!==i&&i,u)&&(t.render(e,o,d,g,c,p,y),f.runEvents())),t.intervalId=zo(n)};void 0!==r&&r||f.start(),this.intervalId=zo(k)}}},{key:"stop",value:function(){this.intervalId&&(zo.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}},{key:"shouldUpdate",value:function e(t,n){if(!t){var a=this.frameDuration,e=this.animations.reduce(function(e,t){return t.update(a)||e},!1);if(e)return!0}return!!("function"==typeof n&&n())||!this.isReadyLock&&this.isReady()||!!this.mouse.hasEvents()}},{key:"render",value:function(e,t,n,a,r,i,l){var s=this.CLIENT_WIDTH,d=this.CLIENT_HEIGHT,u=this.viewPort,g=this.ctx,c=this.isFirstRender,p=g.canvas;u.clear(),p.width&&p.height?u.setCurrent(p.width,p.height):u.setCurrent(s,d);var y=e.getStyle("width"),h=e.getStyle("height");!t&&(c||"number"!=typeof a&&"number"!=typeof r)&&(y.hasValue()&&(p.width=y.getPixels("x"),p.style&&(p.style.width="".concat(p.width,"px"))),h.hasValue()&&(p.height=h.getPixels("y"),p.style&&(p.style.height="".concat(p.height,"px"))));var f=p.clientWidth||p.width,m=p.clientHeight||p.height;if(t&&y.hasValue()&&h.hasValue()&&(f=y.getPixels("x"),m=h.getPixels("y")),u.setCurrent(f,m),"number"==typeof i&&e.getAttribute("x",!0).setValue(i),"number"==typeof l&&e.getAttribute("y",!0).setValue(l),"number"==typeof a||"number"==typeof r){var x=o(e.getAttribute("viewBox").getString()),b=0,v=0;if("number"==typeof a){var k=e.getStyle("width");k.hasValue()?b=k.getPixels("x")/a:!isNaN(x[2])&&(b=x[2]/a)}if("number"==typeof r){var S=e.getStyle("height");S.hasValue()?v=S.getPixels("y")/r:!isNaN(x[3])&&(v=x[3]/r)}b||(b=v),v||(v=b),e.getAttribute("width",!0).setValue(a),e.getAttribute("height",!0).setValue(r);var P=e.getStyle("transform",!0,!0);P.setValue("".concat(P.getString()," scale(").concat(1/b,", ").concat(1/v,")"))}n||g.clearRect(0,0,f,m),e.render(g),c&&(this.isFirstRender=!1)}}]),e}();Zo.defaultWindow=Qo,Zo.defaultFetch=Ko;var Jo=Zo.defaultFetch,es="undefined"==typeof DOMParser?null:DOMParser,ts=function(){function e(){var t=0l;l++)zr(d,l,i?r(t[l],l):t[l]);return d.length=l,d}});var ds=pn("unscopables"),us=Array.prototype;null==us[ds]&&tt.f(us,ds,{configurable:!0,value:ja(null)});var gs=function(e){us[ds][e]=!0},cs=zt.includes;nn({target:"Array",proto:!0},{includes:function(e){return cs(this,e,1=t.length?{value:void 0,done:!0}:(a=_s(t,n),e.index+=a.length,{value:a,done:!1})});var Hs=Nn.trim;nn({target:"String",proto:!0,forced:function(e){return we(function(){return!!"\t\n\x0B\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF"[e]()||"\u200B\x85\u180E"!="\u200B\x85\u180E"[e]()||"\t\n\x0B\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF"[e].name!==e})}("trim")},{trim:function(){return Hs(this)}});var Ys=function(){function e(t,n){var a=this,r=!!(2=o&&(this.styles[l]=r[l],this.stylesSpecificity[l]=i)}}}}]),e}();Ys.ignoreChildTypes=["title"];var $s=function(e){function t(e,n,a){var r;return Wr(this,t),r=rs(this,is(t).call(this,e,n,a)),console.warn("Element ".concat(n.nodeName," not yet implemented.")),r}return os(t,e),t}(Ys),Us=zt.indexOf,Ws=[].indexOf,qs=!!Ws&&0>1/[1].indexOf(1,-0),Xs=ga("indexOf");nn({target:"Array",proto:!0,forced:qs||Xs},{indexOf:function(e){return qs?Ws.apply(this,arguments)||0:Us(this,e,1d||d>i)return NaN;return parseInt(l,r)}return+t};if(en(od,!sd(" 0o1")||!sd("0b1")||sd("+0x1"))){for(var cd=function(e){var t=1>arguments.length?0:e,n=this;return n instanceof cd&&(ud?we(function(){dd.valueOf.call(n)}):Me(n)!=od)?td(new sd(gd(t)),n,cd):gd(t)},pd=Oe?nd(sd):["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY","EPSILON","isFinite","isInteger","isNaN","isSafeInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","parseFloat","parseInt","isInteger"],yd=0,hd;pd.length>yd;yd++)Ye(sd,hd=pd[yd])&&!Ye(cd,hd)&&rd(cd,hd,ad(sd,hd));cd.prototype=dd,dd.constructor=cd,Ot(Ce,od,cd)}var fd=function(){function e(){var t=Number.NaN,n=0this.x2&&(this.x2=e)),"undefined"!=typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))}},{key:"addX",value:function(e){this.addPoint(e,null)}},{key:"addY",value:function(e){this.addPoint(null,e)}},{key:"addBoundingBox",value:function(e){if(e){var t=e.x1,n=e.y1,a=e.x2,r=e.y2;this.addPoint(t,n),this.addPoint(a,r)}}},{key:"sumCubic",value:function(e,t,n,a,r){return Ae(1-e,3)*t+3*Ae(1-e,2)*e*n+3*(1-e)*Ae(e,2)*a+Ae(e,3)*r}},{key:"bezierCurveAdd",value:function(e,n,r,i,l){var o=6*n-12*r+6*i,s=-3*n+9*r-9*i+3*l,a=3*r-3*n;if(0===s){if(0===o)return;var d=-a/o;return void(0d&&(e?this.addX(this.sumCubic(d,n,r,i,l)):this.addY(this.sumCubic(d,n,r,i,l))))}var t=Ae(o,2)-4*a*s;if(!(0>t)){var u=(-o+Pe(t))/(2*s);0u&&(e?this.addX(this.sumCubic(u,n,r,i,l)):this.addY(this.sumCubic(u,n,r,i,l)));var g=(-o-Pe(t))/(2*s);0g&&(e?this.addX(this.sumCubic(g,n,r,i,l)):this.addY(this.sumCubic(g,n,r,i,l)))}}},{key:"addBezierCurve",value:function(e,t,n,a,r,i,l,o){this.addPoint(e,t),this.addPoint(l,o),this.bezierCurveAdd(!0,e,n,r,l),this.bezierCurveAdd(!1,t,a,i,o)}},{key:"addQuadraticCurve",value:function(e,t,n,a,r,i){var l=e+2/3*(n-e),o=t+2/3*(a-t);this.addBezierCurve(e,t,l,l+1/3*(r-e),o,o+1/3*(i-t),r,i)}},{key:"isPointInBox",value:function(e,t){var n=this.x1,a=this.y1,r=this.x2,i=this.y2;return n<=e&&e<=r&&a<=t&&t<=i}},{key:"x",get:function(){return this.x1}},{key:"y",get:function(){return this.y1}},{key:"width",get:function(){return this.x2-this.x1}},{key:"height",get:function(){return this.y2-this.y1}}]),e}(),md="toString",xd=RegExp.prototype,bd=xd[md],vd=we(function(){return"/a/b"!=bd.call({source:"a",flags:"b"})}),kd=bd.name!=md;(vd||kd)&&Ot(RegExp.prototype,md,function(){var e=Ze(this),t=e.source+"",n=e.flags,a=(void 0===n&&e instanceof RegExp&&!("flags"in xd)?Fn.call(e):n)+"";return"/"+t+"/"+a},{unsafe:!0});var Sd=function(){function e(t,n){Wr(this,e),this.type="translate",this.point=null,this.point=qo.parse(n)}return qr(e,[{key:"apply",value:function(e){var t=this.point,n=t.x,a=t.y;e.translate(n||0,a||0)}},{key:"unapply",value:function(e){var t=this.point,n=t.x,a=t.y;e.translate(-1*n||0,-1*a||0)}},{key:"applyToPoint",value:function(e){var t=this.point,n=t.x,a=t.y;e.applyTransform([1,0,0,1,n||0,a||0])}}]),e}(),Pd=function(){function e(t,n){var a=2n&&o.getAttribute("x").hasValue()||o.getAttribute("text-anchor").hasValue()));d++)s+=o.measureTextRecursive(e);return-1*("end"===a?s:s/2)}return 0}},{key:"adjustChildCoordinates",value:function(e,t,n,a){var r=n.children[a];if("function"!=typeof r.measureText)return r;var i=r.getAttribute("x"),l=r.getAttribute("y"),o=r.getAttribute("dx"),s=r.getAttribute("dy"),d=r.getAttribute("text-anchor").getString("start");if(0===a&&"textNode"!==r.type&&(!i.hasValue()&&i.setValue(t.getAttribute("x").getValue("0")),!l.hasValue()&&l.setValue(t.getAttribute("y").getValue("0")),!o.hasValue()&&o.setValue(t.getAttribute("dx").getValue("0")),!s.hasValue()&&s.setValue(t.getAttribute("dy").getValue("0"))),i.hasValue()){if(r.x=i.getPixels("x")+t.getAnchorDelta(e,n,a),"start"!==d){var u=r.measureTextRecursive(e);r.x+=-1*("end"===d?u:u/2)}o.hasValue()&&(r.x+=o.getPixels("x"))}else{if("start"!==d){var g=r.measureTextRecursive(e);t.x+=-1*("end"===d?g:g/2)}o.hasValue()&&(t.x+=o.getPixels("x")),r.x=t.x}return t.x=r.x+r.measureText(e),l.hasValue()?(r.y=l.getPixels("y"),s.hasValue()&&(r.y+=s.getPixels("y"))):(s.hasValue()&&(t.y+=s.getPixels("y")),r.y=t.y),t.y=r.y,r}},{key:"getChildBoundingBox",value:function(e,t,n,a){var r=this.adjustChildCoordinates(e,t,n,a),l=r.getBoundingBox(e);return l?(r.children.forEach(function(n,a){var i=t.getChildBoundingBox(e,t,r,a);l.addBoundingBox(i)}),l):null}},{key:"renderChild",value:function(e,t,n,a){var r=this.adjustChildCoordinates(e,t,n,a);r.render(e),r.children.forEach(function(n,a){t.renderChild(e,t,r,a)})}},{key:"measureTextRecursive",value:function(e){var t=this.children.reduce(function(t,n){return t+n.measureTextRecursive(e)},this.measureText(e));return t}},{key:"measureText",value:function(e){var t=this.measureCache;if(~t)return t;var n=this.getText(),a=this.measureTargetText(e,n);return this.measureCache=a,a}},{key:"measureTargetText",value:function(e,t){if(!t.length)return 0;var n=this.parent,a=n.getStyle("font-family").getDefinition();if(a){for(var r=this.getFontSize(),l=a.isRTL?t.split("").reverse().join(""):t,s=o(n.getAttribute("dx").getString()),d=l.length,u=0,g=0,c;gr;)t[r++]=e;return t}}),gs("fill");var Dd=function(){function e(t){Wr(this,e),this.control=null,this.start=null,this.current=null,this.command="",this.tokens=[],this.i=-1,this.previousCommand="",this.points=[],this.angles=[],this.tokens=Z(t).split(" ")}return qr(e,[{key:"reset",value:function(){this.i=-1,this.command="",this.previousCommand="",this.start=new qo(0,0),this.control=new qo(0,0),this.current=new qo(0,0),this.points=[],this.angles=[]}},{key:"isEnd",value:function(){var e=this.i,t=this.tokens;return e>=t.length-1}},{key:"isCommandOrEnd",value:function(){if(this.isEnd())return!0;var e=this.i,t=this.tokens;return /^[A-Za-z]$/.test(t[e+1])}},{key:"isRelativeCommand",value:function(){switch(this.command){case"m":case"l":case"h":case"v":case"c":case"s":case"q":case"t":case"a":case"z":return!0;default:return!1;}}},{key:"getToken",value:function(){return this.i++,this.tokens[this.i]}},{key:"getScalar",value:function(){return parseFloat(this.getToken())}},{key:"nextCommand",value:function(){this.previousCommand=this.command,this.command=this.getToken()}},{key:"getPoint",value:function(){var e=new qo(this.getScalar(),this.getScalar());return this.makeAbsolute(e)}},{key:"getAsControlPoint",value:function(){var e=this.getPoint();return this.control=e,e}},{key:"getAsCurrentPoint",value:function(){var e=this.getPoint();return this.current=e,e}},{key:"getReflectedControlPoint",value:function(){var e=this.previousCommand.toLowerCase();if("c"!==e&&"s"!==e&&"q"!==e&&"t"!==e)return this.current;var t=this.current,n=t.x,a=t.y,r=this.control,i=r.x,l=r.y,o=new qo(2*n-i,2*a-l);return o}},{key:"makeAbsolute",value:function(e){if(this.isRelativeCommand()){var t=this.current,n=t.x,a=t.y;e.x+=n,e.y+=a}return e}},{key:"addMarker",value:function(e,t,n){var a=this.points,r=this.angles;n&&0=x(S,u)&&(v=ye),1<=x(S,u)&&(v=0);var P=1-c?1:-1,A=k+P*(v/2),E=new qo(m.x+i*ke(A),m.y+o*ve(A));if(n.addMarkerAngle(E,A-P*ye/2),n.addMarkerAngle(p,A-P*ye),t.addPoint(p.x,p.y),e&&!isNaN(k)&&!isNaN(v)){var T=i>o?i:o,r=i>o?1:i/o,C=i>o?o/i:1;e.translate(m.x,m.y),e.rotate(d),e.scale(r,C),e.arc(0,0,T,k,k+v,!!(1-c)),e.scale(1/r,1/C),e.rotate(-d),e.translate(-m.x,-m.y)}}}},{key:"pathZ",value:function(e,t){var n=this.pathParser;e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath(),n.current=n.start}}]),t}(Vd),Md=function(e){function t(){var e;return Wr(this,t),e=rs(this,is(t).apply(this,arguments)),e.type="svg",e.root=!1,e}return os(t,e),qr(t,[{key:"clearContext",value:function(e){Js(is(t.prototype),"clearContext",this).call(this,e),this.document.screen.viewPort.removeCurrent()}},{key:"setContext",value:function(e){var n=this.document,a=n.screen,r=n.window,i=e.canvas;if(a.setDefaults(e),i.style&&"undefined"!=typeof e.font&&r&&"undefined"!=typeof r.getComputedStyle){e.font=r.getComputedStyle(i).getPropertyValue("font");var l=new Uo(n,"fontSize",ed.parse(e.font).fontSize);l.hasValue()&&(n.rootEmSize=l.getPixels("y"),n.emSize=n.rootEmSize)}Js(is(t.prototype),"setContext",this).call(this,e),this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y"));var s=a.viewPort,d=s.width,u=s.height;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%");var g=this.getAttribute("refX"),c=this.getAttribute("refY"),p=this.getAttribute("viewBox"),y=p.hasValue()?o(p.getString()):null,h=!this.root&&"visible"!==this.getAttribute("overflow").getValue("hidden"),f=0,m=0,x=0,b=0;y&&(f=y[0],m=y[1]),this.root||(d=this.getStyle("width").getPixels("x"),u=this.getStyle("height").getPixels("y"),"marker"===this.type&&(x=f,b=m,f=0,m=0)),a.viewPort.setCurrent(d,u),y&&(d=y[2],u=y[3]),n.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:a.viewPort.width,desiredWidth:d,height:a.viewPort.height,desiredHeight:u,minX:f,minY:m,refX:g.getValue(),refY:c.getValue(),clip:h,clipX:x,clipY:b}),y&&(a.viewPort.removeCurrent(),a.viewPort.setCurrent(d,u))}},{key:"resize",value:function(e){var t=1=u;u++)for(var g=-1;1>=g;g++)o.save(),i.attributes.x=new Uo(this.document,"x",u*l.width),i.attributes.y=new Uo(this.document,"y",g*l.height),i.render(o),o.restore();var c=e.createPattern(l,"repeat");return c}}]),t}(Ys),$d=function(e){function t(){var e;return Wr(this,t),e=rs(this,is(t).apply(this,arguments)),e.type="marker",e}return os(t,e),qr(t,[{key:"render",value:function(e,t,n){if(t){var a=t.x,r=t.y,i=this.getAttribute("orient").getValue("auto"),l=this.getAttribute("markerUnits").getValue("strokeWidth");e.translate(a,r),"auto"===i&&e.rotate(n),"strokeWidth"===l&&e.scale(e.lineWidth,e.lineWidth),e.save();var o=new Md(this.document,null);o.type=this.type,o.attributes.viewBox=new Uo(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.refX=new Uo(this.document,"refX",this.getAttribute("refX").getValue()),o.attributes.refY=new Uo(this.document,"refY",this.getAttribute("refY").getValue()),o.attributes.width=new Uo(this.document,"width",this.getAttribute("markerWidth").getValue()),o.attributes.height=new Uo(this.document,"height",this.getAttribute("markerHeight").getValue()),o.attributes.overflow=new Uo(this.document,"overflow",this.getAttribute("overflow").getValue()),o.attributes.fill=new Uo(this.document,"fill",this.getAttribute("fill").getValue("black")),o.attributes.stroke=new Uo(this.document,"stroke",this.getAttribute("stroke").getValue("none")),o.children=this.children,o.render(e),e.restore(),"strokeWidth"===l&&e.scale(1/e.lineWidth,1/e.lineWidth),"auto"===i&&e.rotate(-n),e.translate(-a,-r)}}}]),t}(Ys),Ud=function(e){function t(){var e;return Wr(this,t),e=rs(this,is(t).apply(this,arguments)),e.type="defs",e}return os(t,e),qr(t,[{key:"render",value:function(){}}]),t}(Ys),Wd=function(e){function t(){var e;return Wr(this,t),e=rs(this,is(t).apply(this,arguments)),e.type="g",e}return os(t,e),qr(t,[{key:"getBoundingBox",value:function(e){var t=new fd;return this.children.forEach(function(n){t.addBoundingBox(n.getBoundingBox(e))}),t}}]),t}(Vd),qd=function(e){function t(e,n,a){var r;Wr(this,t),r=rs(this,is(t).call(this,e,n,a)),r.attributesToInherit=["gradientUnits"],r.stops=[];var i=as(r),l=i.stops,o=i.children;return o.forEach(function(e){"stop"===e.type&&l.push(e)}),r}return os(t,e),qr(t,[{key:"getGradientUnits",value:function(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}},{key:"createGradient",value:function(e,t,n){var a=this,r=this;this.getHrefAttribute().hasValue()&&(r=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(r));var i=r,l=i.stops,o=this.getGradient(e,t);if(!o)return this.addParentOpacity(n,l[l.length-1].color);if(l.forEach(function(e){o.addColorStop(e.offset,a.addParentOpacity(n,e.color))}),this.getAttribute("gradientTransform").hasValue()){var s=this.document,d=s.screen,u=d.MAX_VIRTUAL_PIXELS,g=d.viewPort,c=xa(g.viewPorts,1),p=c[0],y=new zd(s,null);y.attributes.x=new Uo(s,"x",-u/3),y.attributes.y=new Uo(s,"y",-u/3),y.attributes.width=new Uo(s,"width",u),y.attributes.height=new Uo(s,"height",u);var h=new Wd(s,null);h.attributes.transform=new Uo(s,"transform",this.getAttribute("gradientTransform").getValue()),h.children=[y];var f=new Md(s,null);f.attributes.x=new Uo(s,"x",0),f.attributes.y=new Uo(s,"y",0),f.attributes.width=new Uo(s,"width",p.width),f.attributes.height=new Uo(s,"height",p.height),f.children=[h];var m=s.createCanvas(p.width,p.height),x=m.getContext("2d");return x.fillStyle=o,f.render(x),x.createPattern(m,"no-repeat")}return o}},{key:"inheritStopContainer",value:function(e){var t=this;this.attributesToInherit.forEach(function(n){!t.getAttribute(n).hasValue()&&e.getAttribute(n).hasValue()&&t.getAttribute(n,!0).setValue(e.getAttribute(n).getValue())})}},{key:"addParentOpacity",value:function(e,t){if(e.hasValue()){var n=new Uo(this.document,"color",t);return n.addOpacity(e).getString()}return t}}]),t}(Ys),Xd=function(e){function t(e,n,a){var r;return Wr(this,t),r=rs(this,is(t).call(this,e,n,a)),r.type="linearGradient",r.attributesToInherit.push("x1","y1","x2","y2"),r}return os(t,e),qr(t,[{key:"getGradient",value:function(e,t){var n="objectBoundingBox"===this.getGradientUnits(),a=n?t.getBoundingBox(e):null;if(n&&!a)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var r=n?a.x+a.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),i=n?a.y+a.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),l=n?a.x+a.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),o=n?a.y+a.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return r===l&&i===o?null:e.createLinearGradient(r,i,l,o)}}]),t}(qd),Qd=function(e){function t(e,n,a){var r;return Wr(this,t),r=rs(this,is(t).call(this,e,n,a)),r.type="radialGradient",r.attributesToInherit.push("cx","cy","r","fx","fy","fr"),r}return os(t,e),qr(t,[{key:"getGradient",value:function(e,t){var n="objectBoundingBox"===this.getGradientUnits(),a=t.getBoundingBox(e);if(n&&!a)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var i=n?a.x+a.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),l=n?a.y+a.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),o=i,s=l;this.getAttribute("fx").hasValue()&&(o=n?a.x+a.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(s=n?a.y+a.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var d=n?(a.width+a.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),r=this.getAttribute("fr").getPixels();return e.createRadialGradient(o,s,r,i,l,d)}}]),t}(qd),Kd=function(e){function t(e,n,a){var r;Wr(this,t),r=rs(this,is(t).call(this,e,n,a)),r.type="stop";var i=me(0,xe(1,r.getAttribute("offset").getNumber())),l=r.getStyle("stop-opacity"),o=r.getStyle("stop-color",!0);return""===o.getString()&&o.setValue("#000"),l.hasValue()&&(o=o.addOpacity(l)),r.offset=i,r.color=o.getString(),r}return os(t,e),t}(Ys),Zd="Array Iterator",Jd=wt.set,eu=wt.getterFor(Zd),tu=Bs(Array,"Array",function(e,t){Jd(this,{type:Zd,target:Fe(e),index:0,kind:t})},function(){var e=eu(this),t=e.target,n=e.kind,a=e.index++;return!t||a>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:a,done:!1}:"values"==n?{value:t[a],done:!1}:{value:[a,t[a]],done:!1}},"values");Pi.Arguments=Pi.Array,gs("keys"),gs("values"),gs("entries");var nu=pn("iterator"),au=pn("toStringTag"),ru=tu.values;for(var iu in _r){var lu=Ce[iu],ou=lu&&lu.prototype;if(ou){if(ou[nu]!==ru)try{nt(ou,nu,ru)}catch(e){ou[nu]=ru}if(ou[au]||nt(ou,au,iu),_r[iu])for(var su in tu)if(ou[su]!==tu[su])try{nt(ou,su,tu[su])}catch(e){ou[su]=tu[su]}}}var du=function(e){function t(e,n,a){var r;return Wr(this,t),r=rs(this,is(t).call(this,e,n,a)),r.type="animate",r.duration=0,r.initialValue=null,r.initialUnits="",r.removed=!1,r.frozen=!1,e.screen.animations.push(as(r)),r.begin=r.getAttribute("begin").getMilliseconds(),r.maxDuration=r.begin+r.getAttribute("dur").getMilliseconds(),r.from=r.getAttribute("from"),r.to=r.getAttribute("to"),r.values=r.getAttribute("values"),r.values.hasValue()&&r.values.setValue(r.values.getString().split(";")),r}return os(t,e),qr(t,[{key:"getProperty",value:function(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return"CSS"===e?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}},{key:"calcValue",value:function(){var e=this.initialUnits,t=this.getProgress(),n=t.progress,a=t.from,r=t.to,i=a.getNumber()+(r.getNumber()-a.getNumber())*n;return"%"===e&&(i*=100),"".concat(i).concat(e)}},{key:"update",value:function(e){var t=this.parent,n=this.getProperty();if(this.initialValue||(this.initialValue=n.getString(),this.initialUnits=n.getUnits()),this.duration>this.maxDuration){var a=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"===a&&!this.frozen)this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=n.getString();else if("remove"===a&&!this.removed)return this.removed=!0,n.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;var r=!1;if(this.begin>>0||(cu.test(n)?16:10))}:gu;nn({global:!0,forced:parseInt!=yu},{parseInt:yu});var hu=function(e){function t(){var e;return Wr(this,t),e=rs(this,is(t).apply(this,arguments)),e.type="animateColor",e}return os(t,e),qr(t,[{key:"calcValue",value:function(){var e=this.getProgress(),t=e.progress,n=e.from,a=e.to,i=new $o(n.getString()),l=new $o(a.getString());if(i.ok&&l.ok){var o=i.r+(l.r-i.r)*t,r=i.g+(l.g-i.g)*t,s=i.b+(l.b-i.b)*t;return"rgb(".concat(parseInt(o,10),", ").concat(parseInt(r,10),", ").concat(parseInt(s,10),")")}return this.getAttribute("from").getString()}}]),t}(du),fu=function(e){function t(){var e;return Wr(this,t),e=rs(this,is(t).apply(this,arguments)),e.type="animateTransform",e}return os(t,e),qr(t,[{key:"calcValue",value:function(){var e=this.getProgress(),t=e.progress,n=e.from,a=e.to,r=o(n.getString()),l=o(a.getString()),s=r.map(function(e,n){var a=l[n];return e+(a-e)*t}).join(" ");return s}}]),t}(du),mu=tt.f,xu=Ce.Symbol;if(Oe&&"function"==typeof xu&&(!("description"in xu.prototype)||void 0!==xu().description)){var bu={},vu=function(){var e=1>arguments.length||void 0===arguments[0]?void 0:arguments[0]+"",t=this instanceof vu?new xu(e):void 0===e?xu():xu(e);return""===e&&(bu[t]=!0),t};Wt(vu,xu);var ku=vu.prototype=xu.prototype;ku.constructor=vu;var Su=ku.toString,Pu="Symbol(test)"==xu("test")+"",Au=/^Symbol\((.*)\)[^)]+$/;mu(ku,"description",{configurable:!0,get:function(){var e=je(this)?this.valueOf():this,t=Su.call(e);if(Ye(bu,e))return"";var n=Pu?t.slice(7,-1):t.replace(Au,"$1");return""===n?void 0:n}}),nn({global:!0,forced:!0},{Symbol:vu})}Xa("iterator");var Eu=function(e){function t(e,n,a){var r;Wr(this,t),r=rs(this,is(t).call(this,e,n,a)),r.type="font",r.glyphs={},r.horizAdvX=r.getAttribute("horiz-adv-x").getNumber();var i=e.definitions,l=as(r),o=l.children,s=!0,d=!1,u=void 0;try{for(var g=o[Symbol.iterator](),c,p;!(s=(c=g.next()).done);s=!0)switch(p=c.value,p.type){case"font-face":{r.fontFace=p;var y=p.getStyle("font-family");y.hasValue()&&(i[y.getString()]=as(r));break}case"missing-glyph":r.missingGlyph=p;break;case"glyph":{var h=p;h.arabicForm?(r.isRTL=!0,r.isArabic=!0,"undefined"==typeof r.glyphs[h.unicode]&&(r.glyphs[h.unicode]={}),r.glyphs[h.unicode][h.arabicForm]=h):r.glyphs[h.unicode]=h;break}default:}}catch(e){d=!0,u=e}finally{try{s||null==g.return||g.return()}finally{if(d)throw u}}return r}return os(t,e),qr(t,[{key:"render",value:function(){}}]),t}(Ys),Tu=function(e){function t(e,n,a){var r;return Wr(this,t),r=rs(this,is(t).call(this,e,n,a)),r.type="font-face",r.ascent=r.getAttribute("ascent").getNumber(),r.descent=r.getAttribute("descent").getNumber(),r.unitsPerEm=r.getAttribute("units-per-em").getNumber(),r}return os(t,e),t}(Ys),Cu=function(e){function t(){var e;return Wr(this,t),e=rs(this,is(t).apply(this,arguments)),e.type="missing-glyph",e.horizAdvX=0,e}return os(t,e),t}(Nd),wu=function(e){function t(e,n,a){var r;return Wr(this,t),r=rs(this,is(t).call(this,e,n,a)),r.type="glyph",r.horizAdvX=r.getAttribute("horiz-adv-x").getNumber(),r.unicode=r.getAttribute("unicode").getString(),r.arabicForm=r.getAttribute("arabic-form").getString(),r}return os(t,e),t}(Nd),Ou=function(e){function t(){var e;return Wr(this,t),e=rs(this,is(t).apply(this,arguments)),e.type="tref",e}return os(t,e),qr(t,[{key:"getText",value:function(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}}]),t}(Rd),Vu=function(e){function t(e,n,a){var r;Wr(this,t),r=rs(this,is(t).call(this,e,n,a)),r.type="a";var i=n.childNodes,l=i[0],o=0s?o:s,r=o>s?1:o/s,y=o>s?s/o:1;e&&(e.translate(i,l),e.rotate(g),e.scale(r,y),e.arc(0,0,p,d,d+u,!!(1-c)),e.scale(1/r,1/y),e.rotate(-g),e.translate(-i,-l));break}case"z":e&&e.closePath();}})}},{key:"renderChildren",value:function(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),n=this.getFontSize(),a=this.glyphInfo,r=e.fillStyle;"underline"===t&&e.beginPath(),a.forEach(function(r,l){var i=r.p0,o=r.p1,s=r.text;e.save(),e.translate(i.x,i.y),e.rotate(a[l].rotation),e.fillStyle&&e.fillText(s,0,0),e.strokeStyle&&e.strokeText(s,0,0),e.restore(),"underline"===t&&(0===l&&e.moveTo(i.x,i.y+n/8),e.lineTo(o.x,o.y+n/5))}),"underline"===t&&(e.lineWidth=n/20,e.strokeStyle=r,e.stroke(),e.closePath()),e.restore()}},{key:"getLetterSpacingAt",value:function(){var e=0=x(f,u)&&(m=ye),1<=x(f,u)&&(m=0),0===o&&0m&&(m+=2*ye),[y.x,y.y,n,a,h,m,r,o]}}},{key:"calcLength",value:function(e,n,a,r){var i=Math.abs,l=0,o=null,s=null,d=0;switch(a){case"L":return this.getLineLength(e,n,r[0],r[1]);case"C":for(l=0,o=this.getPointOnCubicBezier(0,e,n,r[0],r[1],r[2],r[3],r[4],r[5]),d=.01;1>=d;d+=.01)s=this.getPointOnCubicBezier(d,e,n,r[0],r[1],r[2],r[3],r[4],r[5]),l+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return l;case"Q":for(l=0,o=this.getPointOnQuadraticBezier(0,e,n,r[0],r[1],r[2],r[3]),d=.01;1>=d;d+=.01)s=this.getPointOnQuadraticBezier(d,e,n,r[0],r[1],r[2],r[3]),l+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return l;case"A":l=0;var u=r[4],g=r[5],c=r[4]+g,p=ye/180;if(i(u-c)g)for(d=u-p;d>c;d-=p)s=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],d,0),l+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(d=u+p;de||e-5e-5>t)return null;var r=this.dataArray,i=!0,l=!1,o=void 0;try{for(var s=r[Symbol.iterator](),d,u;!(i=(d=s.next()).done);i=!0){if(u=d.value,u&&(5e-5>u.pathLength||n+u.pathLength+5e-5h&&cf)break;a=this.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],c,u.points[6]);break;case"C":c=g/u.pathLength,1=r&&(this.equidistantCache.points.push({x:d.x,y:d.y,distance:o}),i-=r))}}}},{key:"getEquidistantPointOnPath",value:function(e,t,n){if(this.buildEquidistantCache(t,n),0>e||5e-5