import{d as Yi}from"./index-cr91t7dU.js";var Jt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _o(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var fe=function(i){return i&&i.Math===Math&&i},z=fe(typeof globalThis=="object"&&globalThis)||fe(typeof window=="object"&&window)||fe(typeof self=="object"&&self)||fe(typeof Jt=="object"&&Jt)||fe(typeof Jt=="object"&&Jt)||function(){return this}()||Function("return this")(),ue={},D=function(i){try{return!!i()}catch{return!0}},Nh=D,ft=!Nh(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Vh=D,xr=!Vh(function(){var i=(function(){}).bind();return typeof i!="function"||i.hasOwnProperty("prototype")}),Rh=xr,Ye=Function.prototype.call,W=Rh?Ye.bind(Ye):function(){return Ye.apply(Ye,arguments)},Lo={},Do={}.propertyIsEnumerable,jo=Object.getOwnPropertyDescriptor,Ih=jo&&!Do.call({1:2},1);Lo.f=Ih?function(i){var t=jo(this,i);return!!t&&t.enumerable}:Do;var br=function(i,t){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:t}},Fo=xr,Uo=Function.prototype,Wi=Uo.call,kh=Fo&&Uo.bind.bind(Wi,Wi),j=Fo?kh:function(i){return function(){return Wi.apply(i,arguments)}},Bo=j,_h=Bo({}.toString),Lh=Bo("".slice),Ut=function(i){return Lh(_h(i),8,-1)},Dh=j,jh=D,Fh=Ut,Jr=Object,Uh=Dh("".split),zo=jh(function(){return!Jr("z").propertyIsEnumerable(0)})?function(i){return Fh(i)==="String"?Uh(i,""):Jr(i)}:Jr,Bt=function(i){return i==null},Bh=Bt,zh=TypeError,pt=function(i){if(Bh(i))throw new zh("Can't call method on "+i);return i},Hh=zo,Xh=pt,Pe=function(i){return Hh(Xh(i))},qi=typeof document=="object"&&document.all,Yh=typeof qi>"u"&&qi!==void 0,Ho={all:qi,IS_HTMLDDA:Yh},Xo=Ho,Wh=Xo.all,_=Xo.IS_HTMLDDA?function(i){return typeof i=="function"||i===Wh}:function(i){return typeof i=="function"},ya=_,Yo=Ho,qh=Yo.all,wt=Yo.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:ya(i)||i===qh}:function(i){return typeof i=="object"?i!==null:ya(i)},ti=z,Gh=_,Qh=function(i){return Gh(i)?i:void 0},zt=function(i,t){return arguments.length<2?Qh(ti[i]):ti[i]&&ti[i][t]},$h=j,wr=$h({}.isPrototypeOf),Sr=typeof navigator<"u"&&String(navigator.userAgent)||"",Wo=z,ei=Sr,va=Wo.process,xa=Wo.Deno,ba=va&&va.versions||xa&&xa.version,wa=ba&&ba.v8,ut,fr;wa&&(ut=wa.split("."),fr=ut[0]>0&&ut[0]<4?1:+(ut[0]+ut[1]));!fr&&ei&&(ut=ei.match(/Edge\/(\d+)/),(!ut||ut[1]>=74)&&(ut=ei.match(/Chrome\/(\d+)/),ut&&(fr=+ut[1])));var On=fr,Sa=On,Zh=D,Kh=z,Jh=Kh.String,qo=!!Object.getOwnPropertySymbols&&!Zh(function(){var i=Symbol("symbol detection");return!Jh(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&Sa&&Sa<41}),tl=qo,Go=tl&&!Symbol.sham&&typeof Symbol.iterator=="symbol",el=zt,rl=_,il=wr,nl=Go,al=Object,Qo=nl?function(i){return typeof i=="symbol"}:function(i){var t=el("Symbol");return rl(t)&&il(t.prototype,al(i))},sl=String,Tr=function(i){try{return sl(i)}catch{return"Object"}},ol=_,ul=Tr,hl=TypeError,St=function(i){if(ol(i))return i;throw new hl(ul(i)+" is not a function")},ll=St,cl=Bt,he=function(i,t){var e=i[t];return cl(e)?void 0:ll(e)},ri=W,ii=_,ni=wt,gl=TypeError,fl=function(i,t){var e,r;if(t==="string"&&ii(e=i.toString)&&!ni(r=ri(e,i))||ii(e=i.valueOf)&&!ni(r=ri(e,i))||t!=="string"&&ii(e=i.toString)&&!ni(r=ri(e,i)))return r;throw new gl("Can't convert object to primitive value")},$o={exports:{}},Ta=z,pl=Object.defineProperty,An=function(i,t){try{pl(Ta,i,{value:t,configurable:!0,writable:!0})}catch{Ta[i]=t}return t},dl=z,ml=An,Oa="__core-js_shared__",yl=dl[Oa]||ml(Oa,{}),Cn=yl,Aa=Cn;($o.exports=function(i,t){return Aa[i]||(Aa[i]=t!==void 0?t:{})})("versions",[]).push({version:"3.34.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE",source:"https://github.com/zloirock/core-js"});var En=$o.exports,vl=pt,xl=Object,Or=function(i){return xl(vl(i))},bl=j,wl=Or,Sl=bl({}.hasOwnProperty),ht=Object.hasOwn||function(i,t){return Sl(wl(i),t)},Tl=j,Ol=0,Al=Math.random(),Cl=Tl(1 .toString),Zo=function(i){return"Symbol("+(i===void 0?"":i)+")_"+Cl(++Ol+Al,36)},El=z,Pl=En,Ca=ht,Ml=Zo,Nl=qo,Vl=Go,te=El.Symbol,ai=Pl("wks"),Rl=Vl?te.for||te:te&&te.withoutSetter||Ml,X=function(i){return Ca(ai,i)||(ai[i]=Nl&&Ca(te,i)?te[i]:Rl("Symbol."+i)),ai[i]},Il=W,Ea=wt,Pa=Qo,kl=he,_l=fl,Ll=X,Dl=TypeError,jl=Ll("toPrimitive"),Fl=function(i,t){if(!Ea(i)||Pa(i))return i;var e=kl(i,jl),r;if(e){if(t===void 0&&(t="default"),r=Il(e,i,t),!Ea(r)||Pa(r))return r;throw new Dl("Can't convert object to primitive value")}return t===void 0&&(t="number"),_l(i,t)},Ul=Fl,Bl=Qo,Pn=function(i){var t=Ul(i,"string");return Bl(t)?t:t+""},zl=z,Ma=wt,Gi=zl.document,Hl=Ma(Gi)&&Ma(Gi.createElement),Ar=function(i){return Hl?Gi.createElement(i):{}},Xl=ft,Yl=D,Wl=Ar,Ko=!Xl&&!Yl(function(){return Object.defineProperty(Wl("div"),"a",{get:function(){return 7}}).a!==7}),ql=ft,Gl=W,Ql=Lo,$l=br,Zl=Pe,Kl=Pn,Jl=ht,tc=Ko,Na=Object.getOwnPropertyDescriptor;ue.f=ql?Na:function(i,t){if(i=Zl(i),t=Kl(t),tc)try{return Na(i,t)}catch{}if(Jl(i,t))return $l(!Gl(Ql.f,i,t),i[t])};var dt={},ec=ft,rc=D,Jo=ec&&rc(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ic=wt,nc=String,ac=TypeError,Z=function(i){if(ic(i))return i;throw new ac(nc(i)+" is not an object")},sc=ft,oc=Ko,uc=Jo,We=Z,Va=Pn,hc=TypeError,si=Object.defineProperty,lc=Object.getOwnPropertyDescriptor,oi="enumerable",ui="configurable",hi="writable";dt.f=sc?uc?function(i,t,e){if(We(i),t=Va(t),We(e),typeof i=="function"&&t==="prototype"&&"value"in e&&hi in e&&!e[hi]){var r=lc(i,t);r&&r[hi]&&(i[t]=e.value,e={configurable:ui in e?e[ui]:r[ui],enumerable:oi in e?e[oi]:r[oi],writable:!1})}return si(i,t,e)}:si:function(i,t,e){if(We(i),t=Va(t),We(e),oc)try{return si(i,t,e)}catch{}if("get"in e||"set"in e)throw new hc("Accessors not supported");return"value"in e&&(i[t]=e.value),i};var cc=ft,gc=dt,fc=br,Me=cc?function(i,t,e){return gc.f(i,t,fc(1,e))}:function(i,t,e){return i[t]=e,i},tu={exports:{}},Qi=ft,pc=ht,eu=Function.prototype,dc=Qi&&Object.getOwnPropertyDescriptor,Mn=pc(eu,"name"),mc=Mn&&(function(){}).name==="something",yc=Mn&&(!Qi||Qi&&dc(eu,"name").configurable),Cr={EXISTS:Mn,PROPER:mc,CONFIGURABLE:yc},vc=j,xc=_,$i=Cn,bc=vc(Function.toString);xc($i.inspectSource)||($i.inspectSource=function(i){return bc(i)});var Nn=$i.inspectSource,wc=z,Sc=_,Ra=wc.WeakMap,Tc=Sc(Ra)&&/native code/.test(String(Ra)),Oc=En,Ac=Zo,Ia=Oc("keys"),Vn=function(i){return Ia[i]||(Ia[i]=Ac(i))},Rn={},Cc=Tc,ru=z,Ec=wt,Pc=Me,li=ht,ci=Cn,Mc=Vn,Nc=Rn,ka="Object already initialized",Zi=ru.TypeError,Vc=ru.WeakMap,pr,Ae,dr,Rc=function(i){return dr(i)?Ae(i):pr(i,{})},Ic=function(i){return function(t){var e;if(!Ec(t)||(e=Ae(t)).type!==i)throw new Zi("Incompatible receiver, "+i+" required");return e}};if(Cc||ci.state){var gt=ci.state||(ci.state=new Vc);gt.get=gt.get,gt.has=gt.has,gt.set=gt.set,pr=function(i,t){if(gt.has(i))throw new Zi(ka);return t.facade=i,gt.set(i,t),t},Ae=function(i){return gt.get(i)||{}},dr=function(i){return gt.has(i)}}else{var qt=Mc("state");Nc[qt]=!0,pr=function(i,t){if(li(i,qt))throw new Zi(ka);return t.facade=i,Pc(i,qt,t),t},Ae=function(i){return li(i,qt)?i[qt]:{}},dr=function(i){return li(i,qt)}}var Er={set:pr,get:Ae,has:dr,enforce:Rc,getterFor:Ic},In=j,kc=D,_c=_,qe=ht,Ki=ft,Lc=Cr.CONFIGURABLE,Dc=Nn,iu=Er,jc=iu.enforce,Fc=iu.get,_a=String,or=Object.defineProperty,Uc=In("".slice),Bc=In("".replace),zc=In([].join),Hc=Ki&&!kc(function(){return or(function(){},"length",{value:8}).length!==8}),Xc=String(String).split("String"),Yc=tu.exports=function(i,t,e){Uc(_a(t),0,7)==="Symbol("&&(t="["+Bc(_a(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!qe(i,"name")||Lc&&i.name!==t)&&(Ki?or(i,"name",{value:t,configurable:!0}):i.name=t),Hc&&e&&qe(e,"arity")&&i.length!==e.arity&&or(i,"length",{value:e.arity});try{e&&qe(e,"constructor")&&e.constructor?Ki&&or(i,"prototype",{writable:!1}):i.prototype&&(i.prototype=void 0)}catch{}var r=jc(i);return qe(r,"source")||(r.source=zc(Xc,typeof t=="string"?t:"")),i};Function.prototype.toString=Yc(function(){return _c(this)&&Fc(this).source||Dc(this)},"toString");var nu=tu.exports,Wc=_,qc=dt,Gc=nu,Qc=An,Ht=function(i,t,e,r){r||(r={});var n=r.enumerable,a=r.name!==void 0?r.name:t;if(Wc(e)&&Gc(e,a,r),r.global)n?i[t]=e:Qc(t,e);else{try{r.unsafe?i[t]&&(n=!0):delete i[t]}catch{}n?i[t]=e:qc.f(i,t,{value:e,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return i},au={},$c=Math.ceil,Zc=Math.floor,Kc=Math.trunc||function(i){var t=+i;return(t>0?Zc:$c)(t)},Jc=Kc,Pr=function(i){var t=+i;return t!==t||t===0?0:Jc(t)},tg=Pr,eg=Math.max,rg=Math.min,su=function(i,t){var e=tg(i);return e<0?eg(e+t,0):rg(e,t)},ig=Pr,ng=Math.min,le=function(i){return i>0?ng(ig(i),9007199254740991):0},ag=le,Mr=function(i){return ag(i.length)},sg=Pe,og=su,ug=Mr,La=function(i){return function(t,e,r){var n=sg(t),a=ug(n),o=og(r,a),s;if(i&&e!==e){for(;a>o;)if(s=n[o++],s!==s)return!0}else for(;a>o;o++)if((i||o in n)&&n[o]===e)return i||o||0;return!i&&-1}},ou={includes:La(!0),indexOf:La(!1)},hg=j,gi=ht,lg=Pe,cg=ou.indexOf,gg=Rn,Da=hg([].push),uu=function(i,t){var e=lg(i),r=0,n=[],a;for(a in e)!gi(gg,a)&&gi(e,a)&&Da(n,a);for(;t.length>r;)gi(e,a=t[r++])&&(~cg(n,a)||Da(n,a));return n},kn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],fg=uu,pg=kn,dg=pg.concat("length","prototype");au.f=Object.getOwnPropertyNames||function(i){return fg(i,dg)};var hu={};hu.f=Object.getOwnPropertySymbols;var mg=zt,yg=j,vg=au,xg=hu,bg=Z,wg=yg([].concat),Sg=mg("Reflect","ownKeys")||function(i){var t=vg.f(bg(i)),e=xg.f;return e?wg(t,e(i)):t},ja=ht,Tg=Sg,Og=ue,Ag=dt,Cg=function(i,t,e){for(var r=Tg(t),n=Ag.f,a=Og.f,o=0;og;g++)if(c=y(i[g]),c&&ps(ms,c))return c;return new lr(!1)}h=Ad(i,l)}for(d=a?i.next:h.next;!(p=bd(d,h)).done;){try{c=y(p.value)}catch(b){ds(h,"throw",b)}if(typeof c=="object"&&c&&ps(ms,c))return c}return new lr(!1)},Pd=X,Bu=Pd("iterator"),zu=!1;try{var Md=0,ys={next:function(){return{done:!!Md++}},return:function(){zu=!0}};ys[Bu]=function(){return this},Array.from(ys,function(){throw 2})}catch{}var Nd=function(i,t){try{if(!t&&!zu)return!1}catch{return!1}var e=!1;try{var r={};r[Bu]=function(){return{next:function(){return{done:e=!0}}}},i(r)}catch{}return e},Vd=Vr,Rd=Nd,Id=Ie.CONSTRUCTOR,Hu=Id||!Rd(function(i){Vd.all(i).then(void 0,function(){})}),kd=tt,_d=W,Ld=St,Dd=ce,jd=Un,Fd=Uu,Ud=Hu;kd({target:"Promise",stat:!0,forced:Ud},{all:function(i){var t=this,e=Dd.f(t),r=e.resolve,n=e.reject,a=jd(function(){var o=Ld(t.resolve),s=[],u=0,h=1;Fd(i,function(l){var g=u++,f=!1;h++,_d(o,t,l).then(function(c){f||(f=!0,s[g]=c,--h||r(s))},n)}),--h||r(s)});return a.error&&n(a.value),e.promise}});var Bd=tt,zd=Ie.CONSTRUCTOR,on=Vr,Hd=zt,Xd=_,Yd=Ht,vs=on&&on.prototype;Bd({target:"Promise",proto:!0,forced:zd,real:!0},{catch:function(i){return this.then(void 0,i)}});if(Xd(on)){var xs=Hd("Promise").prototype.catch;vs.catch!==xs&&Yd(vs,"catch",xs,{unsafe:!0})}var Wd=tt,qd=W,Gd=St,Qd=ce,$d=Un,Zd=Uu,Kd=Hu;Wd({target:"Promise",stat:!0,forced:Kd},{race:function(i){var t=this,e=Qd.f(t),r=e.reject,n=$d(function(){var a=Gd(t.resolve);Zd(i,function(o){qd(a,t,o).then(e.resolve,r)})});return n.error&&r(n.value),e.promise}});var Jd=tt,tm=W,em=ce,rm=Ie.CONSTRUCTOR;Jd({target:"Promise",stat:!0,forced:rm},{reject:function(i){var t=em.f(this);return tm(t.reject,void 0,i),t.promise}});var im=Z,nm=wt,am=ce,sm=function(i,t){if(im(i),nm(t)&&t.constructor===i)return t;var e=am.f(i),r=e.resolve;return r(t),e.promise},om=tt,um=zt,hm=Ie.CONSTRUCTOR,lm=sm;um("Promise");om({target:"Promise",stat:!0,forced:hm},{resolve:function(i){return lm(this,i)}});function bs(i,t,e,r,n,a,o){try{var s=i[a](o),u=s.value}catch(h){e(h);return}s.done?t(u):Promise.resolve(u).then(r,n)}function bt(i){return function(){var t=this,e=arguments;return new Promise(function(r,n){var a=i.apply(t,e);function o(u){bs(a,r,n,o,s,"next",u)}function s(u){bs(a,r,n,o,s,"throw",u)}o(void 0)})}}var cm=_n,gm=String,mt=function(i){if(cm(i)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return gm(i)},fm=Z,Xu=function(){var i=fm(this),t="";return i.hasIndices&&(t+="d"),i.global&&(t+="g"),i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.dotAll&&(t+="s"),i.unicode&&(t+="u"),i.unicodeSets&&(t+="v"),i.sticky&&(t+="y"),t},Yn=D,pm=z,Wn=pm.RegExp,qn=Yn(function(){var i=Wn("a","y");return i.lastIndex=2,i.exec("abcd")!==null}),dm=qn||Yn(function(){return!Wn("a","y").sticky}),mm=qn||Yn(function(){var i=Wn("^r","gy");return i.lastIndex=2,i.exec("str")!==null}),Yu={BROKEN_CARET:mm,MISSED_STICKY:dm,UNSUPPORTED_Y:qn},Wu={},ym=uu,vm=kn,xm=Object.keys||function(i){return ym(i,vm)},bm=ft,wm=Jo,Sm=dt,Tm=Z,Om=Pe,Am=xm;Wu.f=bm&&!wm?Object.defineProperties:function(i,t){Tm(i);for(var e=Om(t),r=Am(t),n=r.length,a=0,o;n>a;)Sm.f(i,o=r[a++],e[o]);return i};var Cm=Z,Em=Wu,ws=kn,Pm=Rn,Mm=xu,Nm=Ar,Vm=Vn,Ss=">",Ts="<",un="prototype",hn="script",qu=Vm("IE_PROTO"),Ai=function(){},Gu=function(i){return Ts+hn+Ss+i+Ts+"/"+hn+Ss},Os=function(i){i.write(Gu("")),i.close();var t=i.parentWindow.Object;return i=null,t},Rm=function(){var i=Nm("iframe"),t="java"+hn+":",e;return i.style.display="none",Mm.appendChild(i),i.src=String(t),e=i.contentWindow.document,e.open(),e.write(Gu("document.F=Object")),e.close(),e.F},tr,cr=function(){try{tr=new ActiveXObject("htmlfile")}catch{}cr=typeof document<"u"?document.domain&&tr?Os(tr):Rm():Os(tr);for(var i=ws.length;i--;)delete cr[un][ws[i]];return cr()};Pm[qu]=!0;var Gn=Object.create||function(i,t){var e;return i!==null?(Ai[un]=Cm(i),e=new Ai,Ai[un]=null,e[qu]=i):e=cr(),t===void 0?e:Em.f(e,t)},Im=D,km=z,_m=km.RegExp,Lm=Im(function(){var i=_m(".","s");return!(i.dotAll&&i.test(` `)&&i.flags==="s")}),Dm=D,jm=z,Fm=jm.RegExp,Um=Dm(function(){var i=Fm("(?b)","g");return i.exec("b").groups.a!=="b"||"b".replace(i,"$c")!=="bc"}),re=W,Ir=j,Bm=mt,zm=Xu,Hm=Yu,Xm=En,Ym=Gn,Wm=Er.get,qm=Lm,Gm=Um,Qm=Xm("native-string-replace",String.prototype.replace),vr=RegExp.prototype.exec,ln=vr,$m=Ir("".charAt),Zm=Ir("".indexOf),Km=Ir("".replace),Ci=Ir("".slice),cn=function(){var i=/a/,t=/b*/g;return re(vr,i,"a"),re(vr,t,"a"),i.lastIndex!==0||t.lastIndex!==0}(),Qu=Hm.BROKEN_CARET,gn=/()??/.exec("")[1]!==void 0,Jm=cn||gn||Qu||qm||Gm;Jm&&(ln=function(i){var t=this,e=Wm(t),r=Bm(i),n=e.raw,a,o,s,u,h,l,g;if(n)return n.lastIndex=t.lastIndex,a=re(ln,n,r),t.lastIndex=n.lastIndex,a;var f=e.groups,c=Qu&&t.sticky,d=re(zm,t),p=t.source,m=0,y=r;if(c&&(d=Km(d,"y",""),Zm(d,"g")===-1&&(d+="g"),y=Ci(r,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&$m(r,t.lastIndex-1)!==` `)&&(p="(?: "+p+")",y=" "+y,m++),o=new RegExp("^(?:"+p+")",d)),gn&&(o=new RegExp("^"+p+"$(?!\\s)",d)),cn&&(s=t.lastIndex),u=re(vr,c?o:t,y),c?u?(u.input=Ci(u.input,m),u[0]=Ci(u[0],m),u.index=t.lastIndex,t.lastIndex+=u[0].length):t.lastIndex=0:cn&&u&&(t.lastIndex=t.global?u.index+u[0].length:s),gn&&u&&u.length>1&&re(Qm,u[0],o,function(){for(h=1;h=a?i?"":void 0:(o=Ms(r,n),o<55296||o>56319||n+1===a||(s=Ms(r,n+1))<56320||s>57343?i?o0(r,n):o:i?u0(r,n,n+2):(o-55296<<10)+(s-56320)+65536)}},h0={codeAt:Ns(!1),charAt:Ns(!0)},l0=h0.charAt,Zn=function(i,t,e){return t+(e?l0(i,t).length:1)},Vs=W,c0=Z,g0=_,f0=Ut,p0=kr,d0=TypeError,Kn=function(i,t){var e=i.exec;if(g0(e)){var r=Vs(e,i,t);return r!==null&&c0(r),r}if(f0(i)==="RegExp")return Vs(p0,i,t);throw new d0("RegExp#exec called on incompatible receiver")},m0=W,y0=Qn,v0=Z,x0=Bt,b0=le,Pi=mt,w0=pt,S0=he,T0=Zn,Rs=Kn;y0("match",function(i,t,e){return[function(r){var n=w0(this),a=x0(r)?void 0:S0(r,i);return a?m0(a,r,n):new RegExp(r)[i](Pi(n))},function(r){var n=v0(this),a=Pi(r),o=e(t,n,a);if(o.done)return o.value;if(!n.global)return Rs(n,a);var s=n.unicode;n.lastIndex=0;for(var u=[],h=0,l;(l=Rs(n,a))!==null;){var g=Pi(l[0]);u[h]=g,g===""&&(n.lastIndex=T0(a,b0(n.lastIndex),s)),h++}return h===0?null:u}]});var Jn=j,O0=Or,A0=Math.floor,Mi=Jn("".charAt),C0=Jn("".replace),Ni=Jn("".slice),E0=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,P0=/\$([$&'`]|\d{1,2})/g,M0=function(i,t,e,r,n,a){var o=e+i.length,s=r.length,u=P0;return n!==void 0&&(n=O0(n),u=E0),C0(a,u,function(h,l){var g;switch(Mi(l,0)){case"$":return"$";case"&":return i;case"`":return Ni(t,0,e);case"'":return Ni(t,o);case"<":g=n[Ni(l,1,-1)];break;default:var f=+l;if(f===0)return h;if(f>s){var c=A0(f/10);return c===0?h:c<=s?r[c-1]===void 0?Mi(l,1):r[c-1]+Mi(l,1):h}g=r[f-1]}return g===void 0?"":g})},N0=Dn,Is=W,_r=j,V0=Qn,R0=D,I0=Z,k0=_,_0=Bt,L0=Pr,D0=le,Qt=mt,j0=pt,F0=Zn,U0=he,B0=M0,z0=Kn,H0=X,fn=H0("replace"),X0=Math.max,Y0=Math.min,W0=_r([].concat),Vi=_r([].push),ks=_r("".indexOf),_s=_r("".slice),q0=function(i){return i===void 0?i:String(i)},G0=function(){return"a".replace(/./,"$0")==="$0"}(),Ls=function(){return/./[fn]?/./[fn]("a","$0")==="":!1}(),Q0=!R0(function(){var i=/./;return i.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(i,"$")!=="7"});V0("replace",function(i,t,e){var r=Ls?"$":"$0";return[function(n,a){var o=j0(this),s=_0(n)?void 0:U0(n,fn);return s?Is(s,n,o,a):Is(t,Qt(o),n,a)},function(n,a){var o=I0(this),s=Qt(n);if(typeof a=="string"&&ks(a,r)===-1&&ks(a,"$<")===-1){var u=e(t,o,s,a);if(u.done)return u.value}var h=k0(a);h||(a=Qt(a));var l=o.global,g;l&&(g=o.unicode,o.lastIndex=0);for(var f=[],c;c=z0(o,s),!(c===null||(Vi(f,c),!l));){var d=Qt(c[0]);d===""&&(o.lastIndex=F0(s,D0(o.lastIndex),g))}for(var p="",m=0,y=0;y=m&&(p+=_s(s,m,x)+A,m=x+b.length)}return p+_s(s,m)}]},!Q0||!G0||Ls);var $0=wt,Z0=Ut,K0=X,J0=K0("match"),Zu=function(i){var t;return $0(i)&&((t=i[J0])!==void 0?!!t:Z0(i)==="RegExp")},ty=Zu,ey=TypeError,ta=function(i){if(ty(i))throw new ey("The method doesn't accept regular expressions");return i},ry=X,iy=ry("match"),ea=function(i){var t=/./;try{"/./"[i](t)}catch{try{return t[iy]=!1,"/./"[i](t)}catch{}}return!1},ny=tt,Ku=Re,ay=ue.f,sy=le,Ds=mt,oy=ta,uy=pt,hy=ea,js=Ku("".startsWith),ly=Ku("".slice),cy=Math.min,Ju=hy("startsWith"),gy=!Ju&&!!function(){var i=ay(String.prototype,"startsWith");return i&&!i.writable}();ny({target:"String",proto:!0,forced:!gy&&!Ju},{startsWith:function(i){var t=Ds(uy(this));oy(i);var e=sy(cy(arguments.length>1?arguments[1]:void 0,t.length)),r=Ds(i);return js?js(t,r,e):ly(t,e,e+r.length)===r}});var fy=X,py=Gn,dy=dt.f,pn=fy("unscopables"),dn=Array.prototype;dn[pn]===void 0&&dy(dn,pn,{configurable:!0,value:py(null)});var my=function(i){dn[pn][i]=!0},yy=D,vy=!yy(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}),xy=ht,by=_,wy=Or,Sy=Vn,Ty=vy,Fs=Sy("IE_PROTO"),mn=Object,Oy=mn.prototype,th=Ty?mn.getPrototypeOf:function(i){var t=wy(i);if(xy(t,Fs))return t[Fs];var e=t.constructor;return by(e)&&t instanceof e?e.prototype:t instanceof mn?Oy:null},Ay=D,Cy=_,Ey=wt,Us=th,Py=Ht,My=X,yn=My("iterator"),eh=!1,jt,Ri,Ii;[].keys&&(Ii=[].keys(),"next"in Ii?(Ri=Us(Us(Ii)),Ri!==Object.prototype&&(jt=Ri)):eh=!0);var Ny=!Ey(jt)||Ay(function(){var i={};return jt[yn].call(i)!==i});Ny&&(jt={});Cy(jt[yn])||Py(jt,yn,function(){return this});var rh={IteratorPrototype:jt,BUGGY_SAFARI_ITERATORS:eh},Vy=rh.IteratorPrototype,Ry=Gn,Iy=br,ky=Nr,_y=ke,Ly=function(){return this},Dy=function(i,t,e,r){var n=t+" Iterator";return i.prototype=Ry(Vy,{next:Iy(+!r,e)}),ky(i,n,!1),_y[n]=Ly,i},jy=tt,Fy=W,ih=Cr,Uy=_,By=Dy,Bs=th,zs=cu,zy=Nr,Hy=Me,ki=Ht,Xy=X,Yy=ke,nh=rh,Wy=ih.PROPER,qy=ih.CONFIGURABLE,Hs=nh.IteratorPrototype,er=nh.BUGGY_SAFARI_ITERATORS,de=Xy("iterator"),Xs="keys",me="values",Ys="entries",Gy=function(){return this},Qy=function(i,t,e,r,n,a,o){By(e,t,r);var s=function(y){if(y===n&&f)return f;if(!er&&y&&y in l)return l[y];switch(y){case Xs:return function(){return new e(this,y)};case me:return function(){return new e(this,y)};case Ys:return function(){return new e(this,y)}}return function(){return new e(this)}},u=t+" Iterator",h=!1,l=i.prototype,g=l[de]||l["@@iterator"]||n&&l[n],f=!er&&g||s(n),c=t==="Array"&&l.entries||g,d,p,m;if(c&&(d=Bs(c.call(new i)),d!==Object.prototype&&d.next&&(Bs(d)!==Hs&&(zs?zs(d,Hs):Uy(d[de])||ki(d,de,Gy)),zy(d,u,!0))),Wy&&n===me&&g&&g.name!==me&&(qy?Hy(l,"name",me):(h=!0,f=function(){return Fy(g,this)})),n)if(p={values:s(me),keys:a?f:s(Xs),entries:s(Ys)},o)for(m in p)(er||h||!(m in l))&&ki(l,m,p[m]);else jy({target:t,proto:!0,forced:er||h},p);return l[de]!==f&&ki(l,de,f,{name:n}),Yy[t]=f,p},$y=function(i,t){return{value:i,done:t}},Zy=Pe,ra=my,Ws=ke,ah=Er,Ky=dt.f,Jy=Qy,rr=$y,tv=ft,sh="Array Iterator",ev=ah.set,rv=ah.getterFor(sh),iv=Jy(Array,"Array",function(i,t){ev(this,{type:sh,target:Zy(i),index:0,kind:t})},function(){var i=rv(this),t=i.target,e=i.index++;if(!t||e>=t.length)return i.target=void 0,rr(void 0,!0);switch(i.kind){case"keys":return rr(e,!1);case"values":return rr(t[e],!1)}return rr([e,t[e]],!1)},"values"),qs=Ws.Arguments=Ws.Array;ra("keys");ra("values");ra("entries");if(tv&&qs.name!=="values")try{Ky(qs,"name",{value:"values"})}catch{}var nv={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},av=Ar,_i=av("span").classList,Gs=_i&&_i.constructor&&_i.constructor.prototype,sv=Gs===Object.prototype?void 0:Gs,Qs=z,oh=nv,ov=sv,be=iv,$s=Me,uv=Nr,hv=X,Li=hv("iterator"),Di=be.values,uh=function(i,t){if(i){if(i[Li]!==Di)try{$s(i,Li,Di)}catch{i[Li]=Di}if(uv(i,t,!0),oh[t]){for(var e in be)if(i[e]!==be[e])try{$s(i,e,be[e])}catch{i[e]=be[e]}}}};for(var ji in oh)uh(Qs[ji]&&Qs[ji].prototype,ji);uh(ov,"DOMTokenList");function lv(i,t){if(Yi(i)!=="object"||i===null)return i;var e=i[Symbol.toPrimitive];if(e!==void 0){var r=e.call(i,t||"default");if(Yi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function cv(i){var t=lv(i,"string");return Yi(t)==="symbol"?t:String(t)}function ia(i,t,e){return t=cv(t),t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var gv=St,fv=Or,pv=zo,dv=Mr,mv=TypeError,Zs=function(i){return function(t,e,r,n){var a=fv(t),o=pv(a),s=dv(a);gv(e);var u=i?s-1:0,h=i?-1:1;if(r<2)for(;;){if(u in o){n=o[u],u+=h;break}if(u+=h,i?u<0:s<=u)throw new mv("Reduce of empty array with no initial value")}for(;i?u>=0:s>u;u+=h)u in o&&(n=e(n,o[u],u,a));return n}},yv={left:Zs(!1),right:Zs(!0)},vv=D,hh=function(i,t){var e=[][i];return!!e&&vv(function(){e.call(null,t||function(){return 1},1)})},xv=tt,bv=yv.left,wv=hh,Ks=On,Sv=Ve,Tv=!Sv&&Ks>79&&Ks<83,Ov=Tv||!wv("reduce");xv({target:"Array",proto:!0,forced:Ov},{reduce:function(i){var t=arguments.length;return bv(this,i,t,t>1?arguments[1]:void 0)}});var Av=tt,lh=Re,Cv=ue.f,Ev=le,Js=mt,Pv=ta,Mv=pt,Nv=ea,to=lh("".endsWith),Vv=lh("".slice),Rv=Math.min,ch=Nv("endsWith"),Iv=!ch&&!!function(){var i=Cv(String.prototype,"endsWith");return i&&!i.writable}();Av({target:"String",proto:!0,forced:!Iv&&!ch},{endsWith:function(i){var t=Js(Mv(this));Pv(i);var e=arguments.length>1?arguments[1]:void 0,r=t.length,n=e===void 0?r:Rv(Ev(e),r),a=Js(i);return to?to(t,a,n):Vv(t,n-a.length,n)===a}});var kv=Pn,_v=dt,Lv=br,Dv=function(i,t,e){var r=kv(t);r in i?_v.f(i,r,Lv(0,e)):i[r]=e},eo=su,jv=Mr,Fv=Dv,Uv=Array,Bv=Math.max,zv=function(i,t,e){for(var r=jv(i),n=eo(t,r),a=eo(e===void 0?r:e,r),o=Uv(Bv(a-n,0)),s=0;n1||"".split(/.?/).length?r=function(n,a){var o=Fi(ro(this)),s=a===void 0?ao:a>>>0;if(s===0)return[];if(n===void 0)return[o];if(!qv(n))return ye(t,o,n,s);for(var u=[],h=(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")+(n.sticky?"y":""),l=0,g=new RegExp(n.source,h+"g"),f,c,d;(f=ye(Kv,g,o))&&(c=g.lastIndex,!(c>l&&(Zt(u,ve(o,l,f.index)),f.length>1&&f.index=s)));)g.lastIndex===f.index&&g.lastIndex++;return l===o.length?(d||!rx(g,""))&&Zt(u,""):Zt(u,ve(o,l)),u.length>s?io(u,0,s):u}:"0".split(void 0,0).length?r=function(n,a){return n===void 0&&a===0?[]:ye(t,this,n,a)}:r=t,[function(n,a){var o=ro(this),s=Wv(n)?void 0:Zv(n,i);return s?ye(s,n,o,a):ye(r,Fi(o),n,a)},function(n,a){var o=Yv(this),s=Fi(n),u=e(r,o,s,a,r!==t);if(u.done)return u.value;var h=Gv(o,RegExp),l=o.unicode,g=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+($t?"g":"y"),f=new h($t?"^(?:"+o.source+")":o,g),c=a===void 0?ao:a>>>0;if(c===0)return[];if(s.length===0)return no(f,s)===null?[s]:[];for(var d=0,p=0,m=[];p"u"?Jt:window,ir=["moz","webkit"],ne="AnimationFrame",oe=xt["request"+ne],Ee=xt["cancel"+ne]||xt["cancelRequest"+ne];for(var xe=0;!oe&&xe3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var u=this.r.toString(16),h=this.g.toString(16),l=this.b.toString(16);return u.length==1&&(u="0"+u),h.length==1&&(h="0"+h),l.length==1&&(l="0"+l),"#"+u+h+l},this.getHelpXML=function(){for(var u=new Array,h=0;h "+p.toRGB()+" -> "+p.toHex());d.appendChild(m),d.appendChild(y),c.appendChild(d)}catch{}return c}};const xn=_o(bx);var wx=tt,Sx=Re,Tx=ou.indexOf,Ox=hh,bn=Sx([].indexOf),ph=!!bn&&1/bn([1],1,-0)<0,Ax=ph||!Ox("indexOf");wx({target:"Array",proto:!0,forced:Ax},{indexOf:function(i){var t=arguments.length>1?arguments[1]:void 0;return ph?bn(this,i,t)||0:Tx(this,i,t)}});var Cx=tt,Ex=j,Px=ta,Mx=pt,lo=mt,Nx=ea,Vx=Ex("".indexOf);Cx({target:"String",proto:!0,forced:!Nx("includes")},{includes:function(i){return!!~Vx(lo(Mx(this)),lo(Px(i)),arguments.length>1?arguments[1]:void 0)}});var Rx=Ut,Ix=Array.isArray||function(i){return Rx(i)==="Array"},kx=tt,_x=j,Lx=Ix,Dx=_x([].reverse),co=[1,2];kx({target:"Array",proto:!0,forced:String(co)===String(co.reverse())},{reverse:function(){return Lx(this)&&(this.length=this.length),Dx(this)}});/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var dh=function(i,t){return(dh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])})(i,t)};function mh(i,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=i}dh(i,t),i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function jx(i){var t="";Array.isArray(i)||(i=[i]);for(var e=0;ei.phi1&&(i.phi2-=2*Ot),i.sweepFlag===1&&i.phi2r)return[];if(r===0)return[[i*e/(i*i+t*t),t*e/(i*i+t*t)]];var n=Math.sqrt(r);return[[(i*e+t*n)/(i*i+t*t),(t*e-i*n)/(i*i+t*t)],[(i*e-t*n)/(i*i+t*t),(t*e+i*n)/(i*i+t*t)]]}var B,yt=Math.PI/180;function fo(i,t,e){return(1-e)*i+e*t}function po(i,t,e,r){return i+Math.cos(r/180*Ot)*t+Math.sin(r/180*Ot)*e}function mo(i,t,e,r){var n=1e-6,a=t-i,o=e-t,s=3*a+3*(r-e)-6*o,u=6*(o-a),h=3*a;return Math.abs(s)S&&(c.sweepFlag=+!c.sweepFlag),c})}function o(){return function(s){var u={};for(var h in s)u[h]=s[h];return u}}i.ROUND=function(s){function u(h){return Math.round(h*s)/s}return s===void 0&&(s=1e13),ot(s),function(h){return h.x1!==void 0&&(h.x1=u(h.x1)),h.y1!==void 0&&(h.y1=u(h.y1)),h.x2!==void 0&&(h.x2=u(h.x2)),h.y2!==void 0&&(h.y2=u(h.y2)),h.x!==void 0&&(h.x=u(h.x)),h.y!==void 0&&(h.y=u(h.y)),h.rX!==void 0&&(h.rX=u(h.rX)),h.rY!==void 0&&(h.rY=u(h.rY)),h}},i.TO_ABS=t,i.TO_REL=function(){return n(function(s,u,h){return s.relative||(s.x1!==void 0&&(s.x1-=u),s.y1!==void 0&&(s.y1-=h),s.x2!==void 0&&(s.x2-=u),s.y2!==void 0&&(s.y2-=h),s.x!==void 0&&(s.x-=u),s.y!==void 0&&(s.y-=h),s.relative=!0),s})},i.NORMALIZE_HVZ=function(s,u,h){return s===void 0&&(s=!0),u===void 0&&(u=!0),h===void 0&&(h=!0),n(function(l,g,f,c,d){if(isNaN(c)&&!(l.type&v.MOVE_TO))throw new Error("path must start with moveto");return u&&l.type&v.HORIZ_LINE_TO&&(l.type=v.LINE_TO,l.y=l.relative?0:f),h&&l.type&v.VERT_LINE_TO&&(l.type=v.LINE_TO,l.x=l.relative?0:g),s&&l.type&v.CLOSE_PATH&&(l.type=v.LINE_TO,l.x=l.relative?c-g:c,l.y=l.relative?d-f:d),l.type&v.ARC&&(l.rX===0||l.rY===0)&&(l.type=v.LINE_TO,delete l.rX,delete l.rY,delete l.xRot,delete l.lArcFlag,delete l.sweepFlag),l})},i.NORMALIZE_ST=e,i.QT_TO_C=r,i.INFO=n,i.SANITIZE=function(s){s===void 0&&(s=0),ot(s);var u=NaN,h=NaN,l=NaN,g=NaN;return n(function(f,c,d,p,m){var y=Math.abs,b=!1,x=0,w=0;if(f.type&v.SMOOTH_CURVE_TO&&(x=isNaN(u)?0:c-u,w=isNaN(h)?0:d-h),f.type&(v.CURVE_TO|v.SMOOTH_CURVE_TO)?(u=f.relative?c+f.x2:f.x2,h=f.relative?d+f.y2:f.y2):(u=NaN,h=NaN),f.type&v.SMOOTH_QUAD_TO?(l=isNaN(l)?c:2*c-l,g=isNaN(g)?d:2*d-g):f.type&v.QUAD_TO?(l=f.relative?c+f.x1:f.x1,g=f.relative?d+f.y1:f.y2):(l=NaN,g=NaN),f.type&v.LINE_COMMANDS||f.type&v.ARC&&(f.rX===0||f.rY===0||!f.lArcFlag)||f.type&v.CURVE_TO||f.type&v.SMOOTH_CURVE_TO||f.type&v.QUAD_TO||f.type&v.SMOOTH_QUAD_TO){var A=f.x===void 0?0:f.relative?f.x:f.x-c,O=f.y===void 0?0:f.relative?f.y:f.y-d;x=isNaN(l)?f.x1===void 0?x:f.relative?f.x:f.x1-c:l-c,w=isNaN(g)?f.y1===void 0?w:f.relative?f.y:f.y1-d:g-d;var S=f.x2===void 0?0:f.relative?f.x:f.x2-c,E=f.y2===void 0?0:f.relative?f.y:f.y2-d;y(A)<=s&&y(O)<=s&&y(x)<=s&&y(w)<=s&&y(S)<=s&&y(E)<=s&&(b=!0)}return f.type&v.CLOSE_PATH&&y(c-p)<=s&&y(d-m)<=s&&(b=!0),b?[]:f})},i.MATRIX=a,i.ROTATE=function(s,u,h){u===void 0&&(u=0),h===void 0&&(h=0),ot(s,u,h);var l=Math.sin(s),g=Math.cos(s);return a(g,l,-l,g,u-u*g+h*l,h-u*l-h*g)},i.TRANSLATE=function(s,u){return u===void 0&&(u=0),ot(s,u),a(1,0,0,1,s,u)},i.SCALE=function(s,u){return u===void 0&&(u=s),ot(s,u),a(s,0,0,u,0,0)},i.SKEW_X=function(s){return ot(s),a(1,0,Math.atan(s),1,0,0)},i.SKEW_Y=function(s){return ot(s),a(1,Math.atan(s),0,1,0,0)},i.X_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),ot(s),a(-1,0,0,1,s,0)},i.Y_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),ot(s),a(1,0,0,-1,0,s)},i.A_TO_C=function(){return n(function(s,u,h){return v.ARC===s.type?function(l,g,f){var c,d,p,m;l.cX||Hi(l,g,f);for(var y=Math.min(l.phi1,l.phi2),b=Math.max(l.phi1,l.phi2)-y,x=Math.ceil(b/90),w=new Array(x),A=g,O=f,S=0;Sg.maxX&&(g.maxX=I),Ig.maxY&&(g.maxY=I),IN&&m(yo(c,p.x1,p.x2,p.x,N));for(var w=0,A=mo(d,p.y1,p.y2,p.y);wN&&y(yo(d,p.y1,p.y2,p.y,N))}if(p.type&v.ARC){m(p.x),y(p.y),Hi(p,c,d);for(var O=p.xRot/180*Math.PI,S=Math.cos(O)*p.rX,E=Math.sin(O)*p.rX,R=-Math.sin(O)*p.rY,k=Math.cos(O)*p.rY,F=p.phi1p.phi2?[p.phi2+360,p.phi1+360]:[p.phi2,p.phi1],M=F[0],q=F[1],G=function(I){var K=I[0],at=I[1],ct=180*Math.atan2(at,K)/Math.PI;return ctM&&NM&&Nl)throw new SyntaxError('Expected positive number, got "'+l+'" at index "'+o+'"')}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 "'+o+'"')}this.curArgs.push(l),this.curArgs.length===Bx[this.curCommandType]&&(v.HORIZ_LINE_TO===this.curCommandType?a({type:v.HORIZ_LINE_TO,relative:this.curCommandRelative,x:l}):v.VERT_LINE_TO===this.curCommandType?a({type:v.VERT_LINE_TO,relative:this.curCommandRelative,y:l}):this.curCommandType===v.MOVE_TO||this.curCommandType===v.LINE_TO||this.curCommandType===v.SMOOTH_QUAD_TO?(a({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),v.MOVE_TO===this.curCommandType&&(this.curCommandType=v.LINE_TO)):this.curCommandType===v.CURVE_TO?a({type:v.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===v.SMOOTH_CURVE_TO?a({type:v.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===v.QUAD_TO?a({type:v.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===v.ARC&&a({type:v.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(!Fx(s))if(s===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(s!=="+"&&s!=="-"&&s!==".")if(h)this.curNumber=s,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+o+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+s+'" at index '+o+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,s!=="z"&&s!=="Z")if(s==="h"||s==="H")this.curCommandType=v.HORIZ_LINE_TO,this.curCommandRelative=s==="h";else if(s==="v"||s==="V")this.curCommandType=v.VERT_LINE_TO,this.curCommandRelative=s==="v";else if(s==="m"||s==="M")this.curCommandType=v.MOVE_TO,this.curCommandRelative=s==="m";else if(s==="l"||s==="L")this.curCommandType=v.LINE_TO,this.curCommandRelative=s==="l";else if(s==="c"||s==="C")this.curCommandType=v.CURVE_TO,this.curCommandRelative=s==="c";else if(s==="s"||s==="S")this.curCommandType=v.SMOOTH_CURVE_TO,this.curCommandRelative=s==="s";else if(s==="q"||s==="Q")this.curCommandType=v.QUAD_TO,this.curCommandRelative=s==="q";else if(s==="t"||s==="T")this.curCommandType=v.SMOOTH_QUAD_TO,this.curCommandRelative=s==="t";else{if(s!=="a"&&s!=="A")throw new SyntaxError('Unexpected character "'+s+'" at index '+o+".");this.curCommandType=v.ARC,this.curCommandRelative=s==="a"}else r.push({type:v.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=s,this.curNumberHasDecimal=s==="."}else this.curNumber+=s,this.curNumberHasDecimal=!0;else this.curNumber+=s;else this.curNumber+=s,this.curNumberHasExp=!0;else this.curNumber+=s,this.curNumberHasExpDigits=this.curNumberHasExp}return r},t.prototype.transform=function(e){return Object.create(this,{parse:{value:function(r,n){n===void 0&&(n=[]);for(var a=0,o=Object.getPrototypeOf(this).parse.call(this,r);a>A;if(o[x+3]=zr,zr!==0){var Hr=255/zr;o[x]=(I*w>>A)*Hr,o[x+1]=(K*w>>A)*Hr,o[x+2]=(at*w>>A)*Hr}else o[x]=o[x+1]=o[x+2]=0;I-=Q,K-=Y,at-=$,ct-=N,Q-=m.r,Y-=m.g,$-=m.b,N-=m.a;var Pt=Br+a+1;Pt=b+(Pt>A,et>0?(et=255/et,o[rt]=(Fe*w>>A)*et,o[rt+1]=(Ue*w>>A)*et,o[rt+2]=(Be*w>>A)*et):o[rt]=o[rt+1]=o[rt+2]=0,Fe-=Xr,Ue-=Yr,Be-=Wr,ze-=qr,Xr-=m.r,Yr-=m.g,Wr-=m.b,qr-=m.a,rt=Wt+((rt=Kr+l)0&&arguments[0]!==void 0?arguments[0]:{},t={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:i,createCanvas(e,r){return new OffscreenCanvas(e,r)},createImage(e){return bt(function*(){var r=yield fetch(e),n=yield r.blob(),a=yield createImageBitmap(n);return a})()}};return(typeof DOMParser<"u"||typeof i>"u")&&Reflect.deleteProperty(t,"DOMParser"),t}function u1(i){var{DOMParser:t,canvas:e,fetch:r}=i;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,fetch:r,createCanvas:e.createCanvas,createImage:e.loadImage}}var bb=Object.freeze({__proto__:null,offscreen:o1,node:u1});function ge(i){return i.replace(/(?!\u3000)\s+/gm," ")}function h1(i){return i.replace(/^[\n \t]+/,"")}function l1(i){return i.replace(/[\n \t]+$/,"")}function nt(i){var t=(i||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return t.map(parseFloat)}var c1=/^[A-Z-]+$/;function g1(i){return c1.test(i)?i.toLowerCase():i}function xh(i){var t=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(i)||[];return t[2]||t[3]||t[4]}function f1(i){if(!i.startsWith("rgb"))return i;var t=3,e=i.replace(/\d+(\.\d+)?/g,(r,n)=>t--&&n?String(Math.round(parseFloat(r))):r);return e}var p1=/(\[[^\]]+\])/g,d1=/(#[^\s+>~.[:]+)/g,m1=/(\.[^\s+>~.[:]+)/g,y1=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,v1=/(:[\w-]+\([^)]*\))/gi,x1=/(:[^\s+>~.[:]+)/g,b1=/([^\s+>~.[:]+)/g;function kt(i,t){var e=t.exec(i);return e?[i.replace(t," "),e.length]:[i,0]}function w1(i){var t=[0,0,0],e=i.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[e,r]=kt(e,p1),t[1]+=r,[e,r]=kt(e,d1),t[0]+=r,[e,r]=kt(e,m1),t[1]+=r,[e,r]=kt(e,y1),t[2]+=r,[e,r]=kt(e,v1),t[1]+=r,[e,r]=kt(e,x1),t[1]+=r,e=e.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[e,r]=kt(e,b1),t[2]+=r,t.join("")}var ae=1e-8;function So(i){return Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2))}function Sn(i,t){return(i[0]*t[0]+i[1]*t[1])/(So(i)*So(t))}function To(i,t){return(i[0]*t[1]0&&arguments[0]!==void 0?arguments[0]:" ",{document:e,name:r}=this;return ge(this.getString()).trim().split(t).map(n=>new T(e,r,n))}hasValue(t){var{value:e}=this;return e!==null&&e!==""&&(t||e!==0)&&typeof e<"u"}isString(t){var{value:e}=this,r=typeof e=="string";return!r||!t?r:t.test(e)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var 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);var{value:e}=this,r=parseFloat(e);return this.isString(/%$/)&&(r/=100),r}getString(t){return typeof t>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(t)}getColor(t){var e=this.getString(t);return this.isNormalizedColor||(this.isNormalizedColor=!0,e=f1(e),this.value=e),e}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;var[r,n]=typeof t=="boolean"?[void 0,t]:[t],{viewPort:a}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(a.computeSize("x"),a.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(a.computeSize("x"),a.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*a.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*a.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&n):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*a.computeSize(r);default:{var o=this.getNumber();return e&&o<1?o*a.computeSize(r):o}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var t=this.getString(),e=/#([^)'"]+)/.exec(t);return e&&(e=e[1]),e||(e=t),this.document.definitions[e]}getFillStyleDefinition(t,e){var r=this.getDefinition();if(!r)return null;if(typeof r.createGradient=="function")return r.createGradient(this.document.ctx,t,e);if(typeof r.createPattern=="function"){if(r.getHrefAttribute().hasValue()){var n=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),n.hasValue()&&r.getAttribute("patternTransform",!0).setValue(n.value)}return r.createPattern(this.document.ctx,t,e)}return null}getTextBaseline(){return this.hasValue()?T.textBaselineMapping[this.getString()]:null}addOpacity(t){for(var e=this.getColor(),r=e.length,n=0,a=0;a1&&arguments[1]!==void 0?arguments[1]:0,[r=e,n=e]=nt(t);return new L(r,n)}static parseScale(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[r=e,n=r]=nt(t);return new L(r,n)}static parsePath(t){for(var e=nt(t),r=e.length,n=[],a=0;a0}runEvents(){if(this.working){var{screen:t,events:e,eventElements:r}=this,{style:n}=t.ctx.canvas;n&&(n.cursor=""),e.forEach((a,o)=>{for(var{run:s}=a,u=r[o];u;)s(u),u=u.parent}),this.events=[],this.eventElements=[]}}checkPath(t,e){if(!(!this.working||!e)){var{events:r,eventElements:n}=this;r.forEach((a,o)=>{var{x:s,y:u}=a;!n[o]&&e.isPointInPath&&e.isPointInPath(s,u)&&(n[o]=t)})}}checkBoundingBox(t,e){if(!(!this.working||!e)){var{events:r,eventElements:n}=this;r.forEach((a,o)=>{var{x:s,y:u}=a;!n[o]&&e.isPointInBox(s,u)&&(n[o]=t)})}}mapXY(t,e){for(var{window:r,ctx:n}=this.screen,a=new L(t,e),o=n.canvas;o;)a.x-=o.offsetLeft,a.y-=o.offsetTop,o=o.offsetParent;return r.scrollX&&(a.x+=r.scrollX),r.scrollY&&(a.y+=r.scrollY),a}onClick(t){var{x:e,y:r}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onclick",x:e,y:r,run(n){n.onClick&&n.onClick()}})}onMouseMove(t){var{x:e,y:r}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onmousemove",x:e,y:r,run(n){n.onMouseMove&&n.onMouseMove()}})}}var bh=typeof window<"u"?window:null,wh=typeof fetch<"u"?fetch.bind(void 0):null;class Dr{constructor(t){var{fetch:e=wh,window:r=bh}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=t,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new S1,this.mouse=new T1(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=r,this.fetch=e}wait(t){this.waits.push(t)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var 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){var{document:e,ctx:r,aspectRatio:n,width:a,desiredWidth:o,height:s,desiredHeight:u,minX:h=0,minY:l=0,refX:g,refY:f,clip:c=!1,clipX:d=0,clipY:p=0}=t,m=ge(n).replace(/^defer\s/,""),[y,b]=m.split(" "),x=y||"xMidYMid",w=b||"meet",A=a/o,O=s/u,S=Math.min(A,O),E=Math.max(A,O),R=o,k=u;w==="meet"&&(R*=S,k*=S),w==="slice"&&(R*=E,k*=E);var F=new T(e,"refX",g),M=new T(e,"refY",f),q=F.hasValue()&&M.hasValue();if(q&&r.translate(-S*F.getPixels("x"),-S*M.getPixels("y")),c){var G=S*d,H=S*p;r.beginPath(),r.moveTo(G,H),r.lineTo(a,H),r.lineTo(a,s),r.lineTo(G,s),r.closePath(),r.clip()}if(!q){var Q=w==="meet"&&S===O,Y=w==="slice"&&E===O,$=w==="meet"&&S===A,N=w==="slice"&&E===A;x.startsWith("xMid")&&(Q||Y)&&r.translate(a/2-R/2,0),x.endsWith("YMid")&&($||N)&&r.translate(0,s/2-k/2),x.startsWith("xMax")&&(Q||Y)&&r.translate(a-R,0),x.endsWith("YMax")&&($||N)&&r.translate(0,s-k)}switch(!0){case x==="none":r.scale(A,O);break;case w==="meet":r.scale(S,S);break;case w==="slice":r.scale(E,E);break}r.translate(-h,-l)}start(t){var{enableRedraw:e=!1,ignoreMouse:r=!1,ignoreAnimation:n=!1,ignoreDimensions:a=!1,ignoreClear:o=!1,forceRedraw:s,scaleWidth:u,scaleHeight:h,offsetX:l,offsetY:g}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:f,mouse:c}=this,d=1e3/f;if(this.frameDuration=d,this.readyPromise=new Promise(x=>{this.resolveReady=x}),this.isReady()&&this.render(t,a,o,u,h,l,g),!!e){var p=Date.now(),m=p,y=0,b=()=>{p=Date.now(),y=p-m,y>=d&&(m=p-y%d,this.shouldUpdate(n,s)&&(this.render(t,a,o,u,h,l,g),c.runEvents())),this.intervalId=Bi(b)};r||c.start(),this.intervalId=Bi(b)}}stop(){this.intervalId&&(Bi.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(t,e){if(!t){var{frameDuration:r}=this,n=this.animations.reduce((a,o)=>o.update(r)||a,!1);if(n)return!0}return!!(typeof e=="function"&&e()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(t,e,r,n,a,o,s){var{CLIENT_WIDTH:u,CLIENT_HEIGHT:h,viewPort:l,ctx:g,isFirstRender:f}=this,c=g.canvas;l.clear(),c.width&&c.height?l.setCurrent(c.width,c.height):l.setCurrent(u,h);var d=t.getStyle("width"),p=t.getStyle("height");!e&&(f||typeof n!="number"&&typeof a!="number")&&(d.hasValue()&&(c.width=d.getPixels("x"),c.style&&(c.style.width="".concat(c.width,"px"))),p.hasValue()&&(c.height=p.getPixels("y"),c.style&&(c.style.height="".concat(c.height,"px"))));var m=c.clientWidth||c.width,y=c.clientHeight||c.height;if(e&&d.hasValue()&&p.hasValue()&&(m=d.getPixels("x"),y=p.getPixels("y")),l.setCurrent(m,y),typeof o=="number"&&t.getAttribute("x",!0).setValue(o),typeof s=="number"&&t.getAttribute("y",!0).setValue(s),typeof n=="number"||typeof a=="number"){var b=nt(t.getAttribute("viewBox").getString()),x=0,w=0;if(typeof n=="number"){var A=t.getStyle("width");A.hasValue()?x=A.getPixels("x")/n:isNaN(b[2])||(x=b[2]/n)}if(typeof a=="number"){var O=t.getStyle("height");O.hasValue()?w=O.getPixels("y")/a:isNaN(b[3])||(w=b[3]/a)}x||(x=w),w||(w=x),t.getAttribute("width",!0).setValue(n),t.getAttribute("height",!0).setValue(a);var S=t.getStyle("transform",!0,!0);S.setValue("".concat(S.getString()," scale(").concat(1/x,", ").concat(1/w,")"))}r||g.clearRect(0,0,m,y),t.render(g),f&&(this.isFirstRender=!1)}}Dr.defaultWindow=bh;Dr.defaultFetch=wh;var{defaultFetch:O1}=Dr,A1=typeof DOMParser<"u"?DOMParser:null;class Xi{constructor(){var{fetch:t=O1,DOMParser:e=A1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=t,this.DOMParser=e}parse(t){var e=this;return bt(function*(){return t.startsWith("<")?e.parseFromString(t):e.load(t)})()}parseFromString(t){var 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){var e=t.getElementsByTagName("parsererror")[0];if(e)throw new Error(e.textContent);return t}load(t){var e=this;return bt(function*(){var r=yield e.fetch(t),n=yield r.text();return e.parseFromString(n)})()}}class C1{constructor(t,e){this.type="translate",this.point=null,this.point=L.parse(e)}apply(t){var{x:e,y:r}=this.point;t.translate(e||0,r||0)}unapply(t){var{x:e,y:r}=this.point;t.translate(-1*e||0,-1*r||0)}applyToPoint(t){var{x:e,y:r}=this.point;t.applyTransform([1,0,0,1,e||0,r||0])}}class E1{constructor(t,e,r){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var n=nt(e);this.angle=new T(t,"angle",n[0]),this.originX=r[0],this.originY=r[1],this.cx=n[1]||0,this.cy=n[2]||0}apply(t){var{cx:e,cy:r,originX:n,originY:a,angle:o}=this,s=e+n.getPixels("x"),u=r+a.getPixels("y");t.translate(s,u),t.rotate(o.getRadians()),t.translate(-s,-u)}unapply(t){var{cx:e,cy:r,originX:n,originY:a,angle:o}=this,s=e+n.getPixels("x"),u=r+a.getPixels("y");t.translate(s,u),t.rotate(-1*o.getRadians()),t.translate(-s,-u)}applyToPoint(t){var{cx:e,cy:r,angle:n}=this,a=n.getRadians();t.applyTransform([1,0,0,1,e||0,r||0]),t.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]),t.applyTransform([1,0,0,1,-e||0,-r||0])}}class P1{constructor(t,e,r){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var n=L.parseScale(e);(n.x===0||n.y===0)&&(n.x=ae,n.y=ae),this.scale=n,this.originX=r[0],this.originY=r[1]}apply(t){var{scale:{x:e,y:r},originX:n,originY:a}=this,o=n.getPixels("x"),s=a.getPixels("y");t.translate(o,s),t.scale(e,r||e),t.translate(-o,-s)}unapply(t){var{scale:{x:e,y:r},originX:n,originY:a}=this,o=n.getPixels("x"),s=a.getPixels("y");t.translate(o,s),t.scale(1/e,1/r||e),t.translate(-o,-s)}applyToPoint(t){var{x:e,y:r}=this.scale;t.applyTransform([e||0,0,0,r||0,0,0])}}class Sh{constructor(t,e,r){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=nt(e),this.originX=r[0],this.originY=r[1]}apply(t){var{originX:e,originY:r,matrix:n}=this,a=e.getPixels("x"),o=r.getPixels("y");t.translate(a,o),t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),t.translate(-a,-o)}unapply(t){var{originX:e,originY:r,matrix:n}=this,a=n[0],o=n[2],s=n[4],u=n[1],h=n[3],l=n[5],g=0,f=0,c=1,d=1/(a*(h*c-l*f)-o*(u*c-l*g)+s*(u*f-h*g)),p=e.getPixels("x"),m=r.getPixels("y");t.translate(p,m),t.transform(d*(h*c-l*f),d*(l*g-u*c),d*(s*f-o*c),d*(a*c-s*g),d*(o*l-s*h),d*(s*u-a*l)),t.translate(-p,-m)}applyToPoint(t){t.applyTransform(this.matrix)}}class Th extends Sh{constructor(t,e,r){super(t,e,r),this.type="skew",this.angle=null,this.angle=new T(t,"angle",e)}}class M1 extends Th{constructor(t,e,r){super(t,e,r),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class N1 extends Th{constructor(t,e,r){super(t,e,r),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function V1(i){return ge(i).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function R1(i){var[t,e]=i.split("(");return[t.trim(),e.trim().replace(")","")]}class Ft{constructor(t,e,r){this.document=t,this.transforms=[];var n=V1(e);n.forEach(a=>{if(a!=="none"){var[o,s]=R1(a),u=Ft.transformTypes[o];typeof u<"u"&&this.transforms.push(new u(this.document,s,r))}})}static fromElement(t,e){var r=e.getStyle("transform",!1,!0),[n,a=n]=e.getStyle("transform-origin",!1,!0).split(),o=[n,a];return r.hasValue()?new Ft(t,r.getString(),o):null}apply(t){for(var{transforms:e}=this,r=e.length,n=0;n=0;n--)e[n].unapply(t)}applyToPoint(t){for(var{transforms:e}=this,r=e.length,n=0;n2&&arguments[2]!==void 0?arguments[2]:!1;if(this.document=t,this.node=e,this.captureTextNodes=r,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!(!e||e.nodeType!==1)){if(Array.from(e.attributes).forEach(s=>{var u=g1(s.nodeName);this.attributes[u]=new T(t,u,s.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var n=this.getAttribute("style").getString().split(";").map(s=>s.trim());n.forEach(s=>{if(s){var[u,h]=s.split(":").map(l=>l.trim());this.styles[u]=new T(t,u,h)}})}var{definitions:a}=t,o=this.getAttribute("id");o.hasValue()&&(a[o.getString()]||(a[o.getString()]=this)),Array.from(e.childNodes).forEach(s=>{if(s.nodeType===1)this.addChild(s);else if(r&&(s.nodeType===3||s.nodeType===4)){var u=t.createTextNode(s);u.getText().length>0&&this.addChild(u)}})}}getAttribute(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.attributes[t];if(!r&&e){var n=new T(this.document,t,"");return this.attributes[t]=n,n}return r||T.empty(this.document)}getHrefAttribute(){for(var t in this.attributes)if(t==="href"||t.endsWith(":href"))return this.attributes[t];return T.empty(this.document)}getStyle(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=this.styles[t];if(n)return n;var a=this.getAttribute(t);if(a!=null&&a.hasValue())return this.styles[t]=a,a;if(!r){var{parent:o}=this;if(o){var s=o.getStyle(t);if(s!=null&&s.hasValue())return s}}if(e){var u=new T(this.document,t,"");return this.styles[t]=u,u}return n||T.empty(this.document)}render(t){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(t.save(),this.getStyle("mask").hasValue()){var e=this.getStyle("mask").getDefinition();e&&(this.applyEffects(t),e.apply(t,this))}else if(this.getStyle("filter").getValue("none")!=="none"){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(t),r.apply(t,this))}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}setContext(t){}applyEffects(t){var e=Ft.fromElement(this.document,this);e&&e.apply(t);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var n=r.getDefinition();n&&n.apply(t)}}clearContext(t){}renderChildren(t){this.children.forEach(e=>{e.render(t)})}addChild(t){var e=t instanceof V?t:this.document.createElement(t);e.parent=this,V.ignoreChildTypes.includes(e.type)||this.children.push(e)}matchesSelector(t){var e,{node:r}=this;if(typeof r.matches=="function")return r.matches(t);var n=(e=r.getAttribute)===null||e===void 0?void 0:e.call(r,"class");return!n||n===""?!1:n.split(" ").some(a=>".".concat(a)===t)}addStylesFromStyleDefinition(){var{styles:t,stylesSpecificity:e}=this.document;for(var r in t)if(!r.startsWith("@")&&this.matchesSelector(r)){var n=t[r],a=e[r];if(n)for(var o in n){var s=this.stylesSpecificity[o];typeof s>"u"&&(s="000"),a>=s&&(this.styles[o]=n[o],this.stylesSpecificity[o]=a)}}}removeStyles(t,e){var r=e.reduce((n,a)=>{var o=t.getStyle(a);if(!o.hasValue())return n;var s=o.getString();return o.setValue(""),[...n,[a,s]]},[]);return r}restoreStyles(t,e){e.forEach(r=>{var[n,a]=r;t.getStyle(n,!0).setValue(a)})}isFirstChild(){var t;return((t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))===0}}V.ignoreChildTypes=["title"];class I1 extends V{constructor(t,e,r){super(t,e,r)}}function k1(i){var t=i.trim();return/^('|")/.test(t)?t:'"'.concat(t,'"')}function _1(i){return typeof process>"u"?i:i.trim().split(",").map(k1).join(",")}function L1(i){if(!i)return"";var t=i.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 D1(i){if(!i)return"";var t=i.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 J{constructor(t,e,r,n,a,o){var s=o?typeof o=="string"?J.parse(o):o:{};this.fontFamily=a||s.fontFamily,this.fontSize=n||s.fontSize,this.fontStyle=t||s.fontStyle,this.fontWeight=r||s.fontWeight,this.fontVariant=e||s.fontVariant}static parse(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,r="",n="",a="",o="",s="",u=ge(t).trim().split(" "),h={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return u.forEach(l=>{switch(!0){case(!h.fontStyle&&J.styles.includes(l)):l!=="inherit"&&(r=l),h.fontStyle=!0;break;case(!h.fontVariant&&J.variants.includes(l)):l!=="inherit"&&(n=l),h.fontStyle=!0,h.fontVariant=!0;break;case(!h.fontWeight&&J.weights.includes(l)):l!=="inherit"&&(a=l),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0;break;case!h.fontSize:l!=="inherit"&&([o]=l.split("/")),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0,h.fontSize=!0;break;default:l!=="inherit"&&(s+=l)}}),new J(r,n,a,o,s,e)}toString(){return[L1(this.fontStyle),this.fontVariant,D1(this.fontWeight),this.fontSize,_1(this.fontFamily)].join(" ").trim()}}J.styles="normal|italic|oblique|inherit";J.variants="normal|small-caps|inherit";J.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class lt{constructor(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.NaN,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.NaN,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Number.NaN,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Number.NaN;this.x1=t,this.y1=e,this.x2=r,this.y2=n,this.addPoint(t,e),this.addPoint(r,n)}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),tthis.x2&&(this.x2=t)),typeof e<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),ethis.y2&&(this.y2=e))}addX(t){this.addPoint(t,null)}addY(t){this.addPoint(null,t)}addBoundingBox(t){if(t){var{x1:e,y1:r,x2:n,y2:a}=t;this.addPoint(e,r),this.addPoint(n,a)}}sumCubic(t,e,r,n,a){return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*r+3*(1-t)*Math.pow(t,2)*n+Math.pow(t,3)*a}bezierCurveAdd(t,e,r,n,a){var o=6*e-12*r+6*n,s=-3*e+9*r-9*n+3*a,u=3*r-3*e;if(s===0){if(o===0)return;var h=-u/o;0=e.length-1}next(){var t=this.commands[++this.i];return this.previousCommand=this.command,this.command=t,t}getPoint(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y",r=new L(this.command[t],this.command[e]);return this.makeAbsolute(r)}getAsControlPoint(t,e){var r=this.getPoint(t,e);return this.control=r,r}getAsCurrentPoint(t,e){var r=this.getPoint(t,e);return this.current=r,r}getReflectedControlPoint(){var t=this.previousCommand.type;if(t!==v.CURVE_TO&&t!==v.SMOOTH_CURVE_TO&&t!==v.QUAD_TO&&t!==v.SMOOTH_QUAD_TO)return this.current;var{current:{x:e,y:r},control:{x:n,y:a}}=this,o=new L(2*e-n,2*r-a);return o}makeAbsolute(t){if(this.command.relative){var{x:e,y:r}=this.current;t.x+=e,t.y+=r}return t}addMarker(t,e,r){var{points:n,angles:a}=this;r&&a.length>0&&!a[a.length-1]&&(a[a.length-1]=n[n.length-1].angleTo(r)),this.addMarkerAngle(t,e?e.angleTo(t):null)}addMarkerAngle(t,e){this.points.push(t),this.angles.push(e)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:t}=this,e=t.length,r=0;r1&&arguments[1]!==void 0?arguments[1]:!1;if(!e){var r=this.getStyle("fill"),n=this.getStyle("fill-opacity"),a=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,n);s&&(t.fillStyle=s)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());var u=r.getColor();u!=="inherit"&&(t.fillStyle=u==="none"?"rgba(0,0,0,0)":u)}if(n.hasValue()){var h=new T(this.document,"fill",t.fillStyle).addOpacity(n).getColor();t.fillStyle=h}if(a.isUrlDefinition()){var l=a.getFillStyleDefinition(this,o);l&&(t.strokeStyle=l)}else if(a.hasValue()){a.getString()==="currentColor"&&a.setValue(this.getStyle("color").getColor());var g=a.getString();g!=="inherit"&&(t.strokeStyle=g==="none"?"rgba(0,0,0,0)":g)}if(o.hasValue()){var f=new T(this.document,"stroke",t.strokeStyle).addOpacity(o).getString();t.strokeStyle=f}var c=this.getStyle("stroke-width");if(c.hasValue()){var d=c.getPixels();t.lineWidth=d||ae}var p=this.getStyle("stroke-linecap"),m=this.getStyle("stroke-linejoin"),y=this.getStyle("stroke-miterlimit"),b=this.getStyle("stroke-dasharray"),x=this.getStyle("stroke-dashoffset");if(p.hasValue()&&(t.lineCap=p.getString()),m.hasValue()&&(t.lineJoin=m.getString()),y.hasValue()&&(t.miterLimit=y.getNumber()),b.hasValue()&&b.getString()!=="none"){var w=nt(b.getString());typeof t.setLineDash<"u"?t.setLineDash(w):typeof t.webkitLineDash<"u"?t.webkitLineDash=w:typeof t.mozDash<"u"&&!(w.length===1&&w[0]===0)&&(t.mozDash=w);var A=x.getPixels();typeof t.lineDashOffset<"u"?t.lineDashOffset=A:typeof t.webkitLineDashOffset<"u"?t.webkitLineDashOffset=A:typeof t.mozDashOffset<"u"&&(t.mozDashOffset=A)}}if(this.modifiedEmSizeStack=!1,typeof t.font<"u"){var O=this.getStyle("font"),S=this.getStyle("font-style"),E=this.getStyle("font-variant"),R=this.getStyle("font-weight"),k=this.getStyle("font-size"),F=this.getStyle("font-family"),M=new J(S.getString(),E.getString(),R.getString(),k.hasValue()?"".concat(k.getPixels(!0),"px"):"",F.getString(),J.parse(O.getString(),t.font));S.setValue(M.fontStyle),E.setValue(M.fontVariant),R.setValue(M.fontWeight),k.setValue(M.fontSize),F.setValue(M.fontFamily),t.font=M.toString(),k.isPixels()&&(this.document.emSize=k.getPixels(),this.modifiedEmSizeStack=!0)}e||(this.applyEffects(t),t.globalAlpha=this.calculateOpacity())}clearContext(t){super.clearContext(t),this.modifiedEmSizeStack&&this.document.popEmSize()}}class P extends Xt{constructor(t,e,r){super(t,e,r),this.type="path",this.pathParser=null,this.pathParser=new C(this.getAttribute("d").getString())}path(t){var{pathParser:e}=this,r=new lt;for(e.reset(),t&&t.beginPath();!e.isEnd();)switch(e.next().type){case C.MOVE_TO:this.pathM(t,r);break;case C.LINE_TO:this.pathL(t,r);break;case C.HORIZ_LINE_TO:this.pathH(t,r);break;case C.VERT_LINE_TO:this.pathV(t,r);break;case C.CURVE_TO:this.pathC(t,r);break;case C.SMOOTH_CURVE_TO:this.pathS(t,r);break;case C.QUAD_TO:this.pathQ(t,r);break;case C.SMOOTH_QUAD_TO:this.pathT(t,r);break;case C.ARC:this.pathA(t,r);break;case C.CLOSE_PATH:this.pathZ(t,r);break}return r}getBoundingBox(t){return this.path()}getMarkers(){var{pathParser:t}=this,e=t.getMarkerPoints(),r=t.getMarkerAngles(),n=e.map((a,o)=>[a,r[o]]);return n}renderChildren(t){this.path(t),this.document.screen.mouse.checkPath(this,t);var 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()):t.stroke());var r=this.getMarkers();if(r){var n=r.length-1,a=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(a.isUrlDefinition()){var u=a.getDefinition(),[h,l]=r[0];u.render(t,h,l)}if(o.isUrlDefinition())for(var g=o.getDefinition(),f=1;f1&&(n*=Math.sqrt(f),a*=Math.sqrt(f));var c=(s===u?-1:1)*Math.sqrt((Math.pow(n,2)*Math.pow(a,2)-Math.pow(n,2)*Math.pow(g.y,2)-Math.pow(a,2)*Math.pow(g.x,2))/(Math.pow(n,2)*Math.pow(g.y,2)+Math.pow(a,2)*Math.pow(g.x,2)));isNaN(c)&&(c=0);var d=new L(c*n*g.y/a,c*-a*g.x/n),p=new L((e.x+l.x)/2+Math.cos(h)*d.x-Math.sin(h)*d.y,(e.y+l.y)/2+Math.sin(h)*d.x+Math.cos(h)*d.y),m=To([1,0],[(g.x-d.x)/n,(g.y-d.y)/a]),y=[(g.x-d.x)/n,(g.y-d.y)/a],b=[(-g.x-d.x)/n,(-g.y-d.y)/a],x=To(y,b);return Sn(y,b)<=-1&&(x=Math.PI),Sn(y,b)>=1&&(x=0),{currentPoint:l,rX:n,rY:a,sweepFlag:u,xAxisRotation:h,centp:p,a1:m,ad:x}}pathA(t,e){var{pathParser:r}=this,{currentPoint:n,rX:a,rY:o,sweepFlag:s,xAxisRotation:u,centp:h,a1:l,ad:g}=P.pathA(r),f=1-s?1:-1,c=l+f*(g/2),d=new L(h.x+a*Math.cos(c),h.y+o*Math.sin(c));if(r.addMarkerAngle(d,c-f*Math.PI/2),r.addMarkerAngle(n,c-f*Math.PI),e.addPoint(n.x,n.y),t&&!isNaN(l)&&!isNaN(g)){var p=a>o?a:o,m=a>o?1:a/o,y=a>o?o/a:1;t.translate(h.x,h.y),t.rotate(u),t.scale(m,y),t.arc(0,0,p,l,l+g,!!(1-s)),t.scale(1/m,1/y),t.rotate(-u),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()}}class Oh extends P{constructor(t,e,r){super(t,e,r),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class Et extends Xt{constructor(t,e,r){super(t,e,new.target===Et?!0:r),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(t,e);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(t.textBaseline=r)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(t){if(this.type!=="text")return this.getTElementBoundingBox(t);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t);var e=null;return this.children.forEach((r,n)=>{var a=this.getChildBoundingBox(t,this,this,n);e?e.addBoundingBox(a):e=a}),e}getFontSize(){var{document:t,parent:e}=this,r=J.parse(t.ctx.font).fontSize,n=e.getStyle("font-size").getNumber(r);return n}getTElementBoundingBox(t){var e=this.getFontSize();return new lt(this.x,this.y-e,this.x+this.measureText(t),this.y)}getGlyph(t,e,r){var n=e[r],a=null;if(t.isArabic){var o=e.length,s=e[r-1],u=e[r+1],h="isolated";if((r===0||s===" ")&&r0&&s!==" "&&r0&&s!==" "&&(r===o-1||u===" ")&&(h="initial"),typeof t.glyphs[n]<"u"){var l=t.glyphs[n];a=l instanceof Oh?l:l[h]}}else a=t.glyphs[n];return a||(a=t.missingGlyph),a}getText(){return""}getTextFromNode(t){var e=t||this.node,r=Array.from(e.parentNode.childNodes),n=r.indexOf(e),a=r.length-1,o=ge(e.textContent||"");return n===0&&(o=h1(o)),n===a&&(o=l1(o)),o}renderChildren(t){if(this.type!=="text"){this.renderTElementChildren(t);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t),this.children.forEach((r,n)=>{this.renderChild(t,this,this,n)});var{mouse:e}=this.document.screen;e.isWorking()&&e.checkBoundingBox(this,this.getBoundingBox(t))}renderTElementChildren(t){var{document:e,parent:r}=this,n=this.getText(),a=r.getStyle("font-family").getDefinition();if(a){for(var{unitsPerEm:o}=a.fontFace,s=J.parse(e.ctx.font),u=r.getStyle("font-size").getNumber(s.fontSize),h=r.getStyle("font-style").getString(s.fontStyle),l=u/o,g=a.isRTL?n.split("").reverse().join(""):n,f=nt(r.getAttribute("dx").getString()),c=g.length,d=0;d=this.leafTexts.length)){var t=this.leafTexts[this.textChunkStart],e=t.getStyle("text-anchor").getString("start"),r=!1,n=0;e==="start"&&!r||e==="end"&&r?n=t.x-this.minX:e==="end"&&!r||e==="start"&&r?n=t.x-this.maxX:n=t.x-(this.minX+this.maxX)/2;for(var a=this.textChunkStart;a{this.adjustChildCoordinatesRecursiveCore(t,this,this,r)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(t,e,r,n){var a=r.children[n];a.children.length>0?a.children.forEach((o,s)=>{e.adjustChildCoordinatesRecursiveCore(t,e,a,s)}):this.adjustChildCoordinates(t,e,r,n)}adjustChildCoordinates(t,e,r,n){var a=r.children[n];if(typeof a.measureText!="function")return a;t.save(),a.setContext(t,!0);var o=a.getAttribute("x"),s=a.getAttribute("y"),u=a.getAttribute("dx"),h=a.getAttribute("dy"),l=a.getStyle("font-family").getDefinition(),g=!!l&&l.isRTL;n===0&&(o.hasValue()||o.setValue(a.getInheritedAttribute("x")),s.hasValue()||s.setValue(a.getInheritedAttribute("y")),u.hasValue()||u.setValue(a.getInheritedAttribute("dx")),h.hasValue()||h.setValue(a.getInheritedAttribute("dy")));var f=a.measureText(t);return g&&(e.x-=f),o.hasValue()?(e.applyAnchoring(),a.x=o.getPixels("x"),u.hasValue()&&(a.x+=u.getPixels("x"))):(u.hasValue()&&(e.x+=u.getPixels("x")),a.x=e.x),e.x=a.x,g||(e.x+=f),s.hasValue()?(a.y=s.getPixels("y"),h.hasValue()&&(a.y+=h.getPixels("y"))):(h.hasValue()&&(e.y+=h.getPixels("y")),a.y=e.y),e.y=a.y,e.leafTexts.push(a),e.minX=Math.min(e.minX,a.x,a.x+f),e.maxX=Math.max(e.maxX,a.x,a.x+f),a.clearContext(t),t.restore(),a}getChildBoundingBox(t,e,r,n){var a=r.children[n];if(typeof a.getBoundingBox!="function")return null;var o=a.getBoundingBox(t);return o?(a.children.forEach((s,u)=>{var h=e.getChildBoundingBox(t,e,a,u);o.addBoundingBox(h)}),o):null}renderChild(t,e,r,n){var a=r.children[n];a.render(t),a.children.forEach((o,s)=>{e.renderChild(t,e,a,s)})}measureText(t){var{measureCache:e}=this;if(~e)return e;var r=this.getText(),n=this.measureTargetText(t,r);return this.measureCache=n,n}measureTargetText(t,e){if(!e.length)return 0;var{parent:r}=this,n=r.getStyle("font-family").getDefinition();if(n){for(var a=this.getFontSize(),o=n.isRTL?e.split("").reverse().join(""):e,s=nt(r.getAttribute("dx").getString()),u=o.length,h=0,l=0;l0?"":this.getTextFromNode()}getText(){return this.text}}class j1 extends jr{constructor(){super(...arguments),this.type="textNode"}}class _e extends Xt{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(t){var e,{document:r}=this,{screen:n,window:a}=r,o=t.canvas;if(n.setDefaults(t),o.style&&typeof t.font<"u"&&a&&typeof a.getComputedStyle<"u"){t.font=a.getComputedStyle(o).getPropertyValue("font");var s=new T(r,"fontSize",J.parse(t.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:u,height:h}=n.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var l=this.getAttribute("refX"),g=this.getAttribute("refY"),f=this.getAttribute("viewBox"),c=f.hasValue()?nt(f.getString()):null,d=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible",p=0,m=0,y=0,b=0;c&&(p=c[0],m=c[1]),this.root||(u=this.getStyle("width").getPixels("x"),h=this.getStyle("height").getPixels("y"),this.type==="marker"&&(y=p,b=m,p=0,m=0)),n.viewPort.setCurrent(u,h),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")),c&&(u=c[2],h=c[3]),r.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:n.viewPort.width,desiredWidth:u,height:n.viewPort.height,desiredHeight:h,minX:p,minY:m,refX:l.getValue(),refY:g.getValue(),clip:d,clipX:y,clipY:b}),c&&(n.viewPort.removeCurrent(),n.viewPort.setCurrent(u,h))}clearContext(t){super.clearContext(t),this.document.screen.viewPort.removeCurrent()}resize(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=this.getAttribute("width",!0),a=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),s=this.getAttribute("style"),u=n.getNumber(0),h=a.getNumber(0);if(r)if(typeof r=="string")this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var l=this.getAttribute("preserveAspectRatio");l.hasValue()&&l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(n.setValue(t),a.setValue(e),o.hasValue()||o.setValue("0 0 ".concat(u||t," ").concat(h||e)),s.hasValue()){var g=this.getStyle("width"),f=this.getStyle("height");g.hasValue()&&g.setValue("".concat(t,"px")),f.hasValue()&&f.setValue("".concat(e,"px"))}}}class Ah extends P{constructor(){super(...arguments),this.type="rect"}path(t){var e=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),n=this.getStyle("width",!1,!0).getPixels("x"),a=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),s=this.getAttribute("ry"),u=o.getPixels("x"),h=s.getPixels("y");if(o.hasValue()&&!s.hasValue()&&(h=u),s.hasValue()&&!o.hasValue()&&(u=h),u=Math.min(u,n/2),h=Math.min(h,a/2),t){var l=4*((Math.sqrt(2)-1)/3);t.beginPath(),a>0&&n>0&&(t.moveTo(e+u,r),t.lineTo(e+n-u,r),t.bezierCurveTo(e+n-u+l*u,r,e+n,r+h-l*h,e+n,r+h),t.lineTo(e+n,r+a-h),t.bezierCurveTo(e+n,r+a-h+l*h,e+n-u+l*u,r+a,e+n-u,r+a),t.lineTo(e+u,r+a),t.bezierCurveTo(e+u-l*u,r+a,e,r+a-h+l*h,e,r+a-h),t.lineTo(e,r+h),t.bezierCurveTo(e,r+h-l*h,e+u-l*u,r,e+u,r),t.closePath())}return new lt(e,r,e+n,r+a)}getMarkers(){return null}}class F1 extends P{constructor(){super(...arguments),this.type="circle"}path(t){var e=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),n=this.getAttribute("r").getPixels();return t&&n>0&&(t.beginPath(),t.arc(e,r,n,0,Math.PI*2,!1),t.closePath()),new lt(e-n,r-n,e+n,r+n)}getMarkers(){return null}}class U1 extends P{constructor(){super(...arguments),this.type="ellipse"}path(t){var e=4*((Math.sqrt(2)-1)/3),r=this.getAttribute("rx").getPixels("x"),n=this.getAttribute("ry").getPixels("y"),a=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return t&&r>0&&n>0&&(t.beginPath(),t.moveTo(a+r,o),t.bezierCurveTo(a+r,o+e*n,a+e*r,o+n,a,o+n),t.bezierCurveTo(a-e*r,o+n,a-r,o+e*n,a-r,o),t.bezierCurveTo(a-r,o-e*n,a-e*r,o-n,a,o-n),t.bezierCurveTo(a+e*r,o-n,a+r,o-e*n,a+r,o),t.closePath()),new lt(a-r,o-n,a+r,o+n)}getMarkers(){return null}}class B1 extends P{constructor(){super(...arguments),this.type="line"}getPoints(){return[new L(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new L(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(t){var[{x:e,y:r},{x:n,y:a}]=this.getPoints();return t&&(t.beginPath(),t.moveTo(e,r),t.lineTo(n,a)),new lt(e,r,n,a)}getMarkers(){var[t,e]=this.getPoints(),r=t.angleTo(e);return[[t,r],[e,r]]}}class Ch extends P{constructor(t,e,r){super(t,e,r),this.type="polyline",this.points=[],this.points=L.parsePath(this.getAttribute("points").getString())}path(t){var{points:e}=this,[{x:r,y:n}]=e,a=new lt(r,n);return t&&(t.beginPath(),t.moveTo(r,n)),e.forEach(o=>{var{x:s,y:u}=o;a.addPoint(s,u),t&&t.lineTo(s,u)}),a}getMarkers(){var{points:t}=this,e=t.length-1,r=[];return t.forEach((n,a)=>{a!==e&&r.push([n,n.angleTo(t[a+1])])}),r.length>0&&r.push([t[t.length-1],r[r.length-1][1]]),r}}class z1 extends Ch{constructor(){super(...arguments),this.type="polygon"}path(t){var e=super.path(t),[{x:r,y:n}]=this.points;return t&&(t.lineTo(r,n),t.closePath()),e}}class H1 extends V{constructor(){super(...arguments),this.type="pattern"}createPattern(t,e,r){var n=this.getStyle("width").getPixels("x",!0),a=this.getStyle("height").getPixels("y",!0),o=new _e(this.document,null);o.attributes.viewBox=new T(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new T(this.document,"width","".concat(n,"px")),o.attributes.height=new T(this.document,"height","".concat(a,"px")),o.attributes.transform=new T(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;var s=this.document.createCanvas(n,a),u=s.getContext("2d"),h=this.getAttribute("x"),l=this.getAttribute("y");h.hasValue()&&l.hasValue()&&u.translate(h.getPixels("x",!0),l.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var g=-1;g<=1;g++)for(var f=-1;f<=1;f++)u.save(),o.attributes.x=new T(this.document,"x",g*s.width),o.attributes.y=new T(this.document,"y",f*s.height),o.render(u),u.restore();var c=t.createPattern(s,"repeat");return c}}class X1 extends V{constructor(){super(...arguments),this.type="marker"}render(t,e,r){if(e){var{x:n,y:a}=e,o=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");t.translate(n,a),o==="auto"&&t.rotate(r),s==="strokeWidth"&&t.scale(t.lineWidth,t.lineWidth),t.save();var u=new _e(this.document,null);u.type=this.type,u.attributes.viewBox=new T(this.document,"viewBox",this.getAttribute("viewBox").getValue()),u.attributes.refX=new T(this.document,"refX",this.getAttribute("refX").getValue()),u.attributes.refY=new T(this.document,"refY",this.getAttribute("refY").getValue()),u.attributes.width=new T(this.document,"width",this.getAttribute("markerWidth").getValue()),u.attributes.height=new T(this.document,"height",this.getAttribute("markerHeight").getValue()),u.attributes.overflow=new T(this.document,"overflow",this.getAttribute("overflow").getValue()),u.attributes.fill=new T(this.document,"fill",this.getAttribute("fill").getColor("black")),u.attributes.stroke=new T(this.document,"stroke",this.getAttribute("stroke").getValue("none")),u.children=this.children,u.render(t),t.restore(),s==="strokeWidth"&&t.scale(1/t.lineWidth,1/t.lineWidth),o==="auto"&&t.rotate(-r),t.translate(-n,-a)}}}class Y1 extends V{constructor(){super(...arguments),this.type="defs"}render(){}}class sa extends Xt{constructor(){super(...arguments),this.type="g"}getBoundingBox(t){var e=new lt;return this.children.forEach(r=>{e.addBoundingBox(r.getBoundingBox(t))}),e}}class Eh extends V{constructor(t,e,r){super(t,e,r),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:n,children:a}=this;a.forEach(o=>{o.type==="stop"&&n.push(o)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(t,e,r){var n=this;this.getHrefAttribute().hasValue()&&(n=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(n));var{stops:a}=n,o=this.getGradient(t,e);if(!o)return this.addParentOpacity(r,a[a.length-1].color);if(a.forEach(m=>{o.addColorStop(m.offset,this.addParentOpacity(r,m.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:u,viewPort:h}=s.screen,[l]=h.viewPorts,g=new Ah(s,null);g.attributes.x=new T(s,"x",-u/3),g.attributes.y=new T(s,"y",-u/3),g.attributes.width=new T(s,"width",u),g.attributes.height=new T(s,"height",u);var f=new sa(s,null);f.attributes.transform=new T(s,"transform",this.getAttribute("gradientTransform").getValue()),f.children=[g];var c=new _e(s,null);c.attributes.x=new T(s,"x",0),c.attributes.y=new T(s,"y",0),c.attributes.width=new T(s,"width",l.width),c.attributes.height=new T(s,"height",l.height),c.children=[f];var d=s.createCanvas(l.width,l.height),p=d.getContext("2d");return p.fillStyle=o,c.render(p),p.createPattern(d,"no-repeat")}return o}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){if(t.hasValue()){var r=new T(this.document,"color",e);return r.addOpacity(t).getColor()}return e}}class W1 extends Eh{constructor(t,e,r){super(t,e,r),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(t,e){var r=this.getGradientUnits()==="objectBoundingBox",n=r?e.getBoundingBox(t):null;if(r&&!n)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var a=r?n.x+n.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=r?n.y+n.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?n.x+n.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),u=r?n.y+n.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return a===s&&o===u?null:t.createLinearGradient(a,o,s,u)}}class q1 extends Eh{constructor(t,e,r){super(t,e,r),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(t,e){var r=this.getGradientUnits()==="objectBoundingBox",n=e.getBoundingBox(t);if(r&&!n)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var a=r?n.x+n.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=r?n.y+n.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=a,u=o;this.getAttribute("fx").hasValue()&&(s=r?n.x+n.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(u=r?n.y+n.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var h=r?(n.width+n.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),l=this.getAttribute("fr").getPixels();return t.createRadialGradient(s,u,l,a,o,h)}}class G1 extends V{constructor(t,e,r){super(t,e,r),this.type="stop";var n=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),a=this.getStyle("stop-opacity"),o=this.getStyle("stop-color",!0);o.getString()===""&&o.setValue("#000"),a.hasValue()&&(o=o.addOpacity(a)),this.offset=n,this.color=o.getColor()}}class oa extends V{constructor(t,e,r){super(t,e,r),this.type="animate",this.duration=0,this.initialValue=null,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 T(t,"values",null);var n=this.getAttribute("values");n.hasValue()&&this.values.setValue(n.getString().split(";"))}getProperty(){var t=this.getAttribute("attributeType").getString(),e=this.getAttribute("attributeName").getString();return t==="CSS"?this.parent.getStyle(e,!0):this.parent.getAttribute(e,!0)}calcValue(){var{initialUnits:t}=this,{progress:e,from:r,to:n}=this.getProgress(),a=r.getNumber()+(n.getNumber()-r.getNumber())*e;return t==="%"&&(a*=100),"".concat(a).concat(t)}update(t){var{parent:e}=this,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var n=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(n==="freeze"&&!this.frozen)this.frozen=!0,e.animationFrozen=!0,e.animationFrozenValue=r.getString();else if(n==="remove"&&!this.removed)return this.removed=!0,r.setValue(e.animationFrozen?e.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=t;var a=!1;if(this.begin{var h=a[u];return s+(h-s)*t}).join(" ");return o}}class Z1 extends V{constructor(t,e,r){super(t,e,r),this.type="font",this.glyphs={},this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:n}=t,{children:a}=this;for(var o of a)switch(o.type){case"font-face":{this.fontFace=o;var s=o.getStyle("font-family");s.hasValue()&&(n[s.getString()]=this);break}case"missing-glyph":this.missingGlyph=o;break;case"glyph":{var u=o;u.arabicForm?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[u.unicode]>"u"&&(this.glyphs[u.unicode]={}),this.glyphs[u.unicode][u.arabicForm]=u):this.glyphs[u.unicode]=u;break}}}render(){}}class K1 extends V{constructor(t,e,r){super(t,e,r),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class J1 extends P{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class tb extends Et{constructor(){super(...arguments),this.type="tref"}getText(){var t=this.getHrefAttribute().getDefinition();if(t){var e=t.children[0];if(e)return e.getText()}return""}}class eb extends Et{constructor(t,e,r){super(t,e,r),this.type="a";var{childNodes:n}=e,a=n[0],o=n.length>0&&Array.from(n).every(s=>s.nodeType===3);this.hasText=o,this.text=o?this.getTextFromNode(a):""}getText(){return this.text}renderChildren(t){if(this.hasText){super.renderChildren(t);var{document:e,x:r,y:n}=this,{mouse:a}=e.screen,o=new T(e,"fontSize",J.parse(e.ctx.font).fontSize);a.isWorking()&&a.checkBoundingBox(this,new lt(r,n-o.getPixels("y"),r+this.measureText(t),n))}else if(this.children.length>0){var s=new sa(this.document,null);s.children=this.children,s.parent=this,s.render(t)}}onClick(){var{window:t}=this.document;t&&t.open(this.getHrefAttribute().getString())}onMouseMove(){var t=this.document.ctx;t.canvas.style.cursor="pointer"}}function Vo(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),e.push.apply(e,r)}return e}function nr(i){for(var t=1;t{var{type:n,points:a}=r;switch(n){case C.LINE_TO:t&&t.lineTo(a[0],a[1]);break;case C.MOVE_TO:t&&t.moveTo(a[0],a[1]);break;case C.CURVE_TO:t&&t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case C.QUAD_TO:t&&t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case C.ARC:{var[o,s,u,h,l,g,f,c]=a,d=u>h?u:h,p=u>h?1:u/h,m=u>h?h/u:1;t&&(t.translate(o,s),t.rotate(f),t.scale(p,m),t.arc(0,0,d,l,l+g,!!(1-c)),t.scale(1/p,1/m),t.rotate(-f),t.translate(-o,-s));break}case C.CLOSE_PATH:t&&t.closePath();break}})}renderChildren(t){this.setTextData(t),t.save();var e=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),{glyphInfo:n}=this,a=t.fillStyle;e==="underline"&&t.beginPath(),n.forEach((o,s)=>{var{p0:u,p1:h,rotation:l,text:g}=o;t.save(),t.translate(u.x,u.y),t.rotate(l),t.fillStyle&&t.fillText(g,0,0),t.strokeStyle&&t.strokeText(g,0,0),t.restore(),e==="underline"&&(s===0&&t.moveTo(u.x,u.y+r/8),t.lineTo(h.x,h.y+r/5))}),e==="underline"&&(t.lineWidth=r/20,t.strokeStyle=a,t.stroke(),t.closePath()),t.restore()}getLetterSpacingAt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[t]||0}findSegmentToFitChar(t,e,r,n,a,o,s,u,h){var l=o,g=this.measureText(t,u);u===" "&&e==="justify"&&r-1&&(l+=this.getLetterSpacingAt(h));var f=this.textHeight/20,c=this.getEquidistantPointOnPath(l,f,0),d=this.getEquidistantPointOnPath(l+g,f,0),p={p0:c,p1:d},m=c&&d?Math.atan2(d.y-c.y,d.x-c.x):0;if(s){var y=Math.cos(Math.PI/2+m)*s,b=Math.cos(-m)*s;p.p0=nr(nr({},c),{},{x:c.x+y,y:c.y+b}),p.p1=nr(nr({},d),{},{x:d.x+y,y:d.y+b})}return l+=g,{offset:l,segment:p,rotation:m}}measureText(t,e){var{measuresCache:r}=this,n=e||this.getText();if(r.has(n))return r.get(n);var a=this.measureTargetText(t,n);return r.set(n,a),a}setTextData(t){if(!this.glyphInfo){var e=this.getText(),r=e.split(""),n=e.split(" ").length-1,a=this.parent.getAttribute("dx").split().map(w=>w.getPixels("x")),o=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),u=this.getStyle("letter-spacing"),h=this.parent.getStyle("letter-spacing"),l=0;!u.hasValue()||u.getValue()==="inherit"?l=h.getPixels():u.hasValue()&&u.getValue()!=="initial"&&u.getValue()!=="unset"&&(l=u.getPixels());var g=[],f=e.length;this.letterSpacingCache=g;for(var c=0;cO===0?0:w+A||0,0),p=this.measureText(t),m=Math.max(p+d,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];var y=this.getPathLength(),b=this.getStyle("startOffset").getNumber(0)*y,x=0;(s==="middle"||s==="center")&&(x=-m/2),(s==="end"||s==="right")&&(x=-m),x+=b,r.forEach((w,A)=>{var{offset:O,segment:S,rotation:E}=this.findSegmentToFitChar(t,s,m,y,n,x,o,w,A);x=O,!(!S.p0||!S.p1)&&this.glyphInfo.push({text:r[A],p0:S.p0,p1:S.p1,rotation:E})})}}parsePathData(t){if(this.pathLength=-1,!t)return[];var e=[],{pathParser:r}=t;for(r.reset();!r.isEnd();){var{current:n}=r,a=n?n.x:0,o=n?n.y:0,s=r.next(),u=s.type,h=[];switch(s.type){case C.MOVE_TO:this.pathM(r,h);break;case C.LINE_TO:u=this.pathL(r,h);break;case C.HORIZ_LINE_TO:u=this.pathH(r,h);break;case C.VERT_LINE_TO:u=this.pathV(r,h);break;case C.CURVE_TO:this.pathC(r,h);break;case C.SMOOTH_CURVE_TO:u=this.pathS(r,h);break;case C.QUAD_TO:this.pathQ(r,h);break;case C.SMOOTH_QUAD_TO:u=this.pathT(r,h);break;case C.ARC:h=this.pathA(r);break;case C.CLOSE_PATH:P.pathZ(r);break}s.type!==C.CLOSE_PATH?e.push({type:u,points:h,start:{x:a,y:o},pathLength:this.calcLength(a,o,u,h)}):e.push({type:C.CLOSE_PATH,points:[],pathLength:0})}return e}pathM(t,e){var{x:r,y:n}=P.pathM(t).point;e.push(r,n)}pathL(t,e){var{x:r,y:n}=P.pathL(t).point;return e.push(r,n),C.LINE_TO}pathH(t,e){var{x:r,y:n}=P.pathH(t).point;return e.push(r,n),C.LINE_TO}pathV(t,e){var{x:r,y:n}=P.pathV(t).point;return e.push(r,n),C.LINE_TO}pathC(t,e){var{point:r,controlPoint:n,currentPoint:a}=P.pathC(t);e.push(r.x,r.y,n.x,n.y,a.x,a.y)}pathS(t,e){var{point:r,controlPoint:n,currentPoint:a}=P.pathS(t);return e.push(r.x,r.y,n.x,n.y,a.x,a.y),C.CURVE_TO}pathQ(t,e){var{controlPoint:r,currentPoint:n}=P.pathQ(t);e.push(r.x,r.y,n.x,n.y)}pathT(t,e){var{controlPoint:r,currentPoint:n}=P.pathT(t);return e.push(r.x,r.y,n.x,n.y),C.QUAD_TO}pathA(t){var{rX:e,rY:r,sweepFlag:n,xAxisRotation:a,centp:o,a1:s,ad:u}=P.pathA(t);return n===0&&u>0&&(u-=2*Math.PI),n===1&&u<0&&(u+=2*Math.PI),[o.x,o.y,e,r,s,u,a,n]}calcLength(t,e,r,n){var a=0,o=null,s=null,u=0;switch(r){case C.LINE_TO:return this.getLineLength(t,e,n[0],n[1]);case C.CURVE_TO:for(a=0,o=this.getPointOnCubicBezier(0,t,e,n[0],n[1],n[2],n[3],n[4],n[5]),u=.01;u<=1;u+=.01)s=this.getPointOnCubicBezier(u,t,e,n[0],n[1],n[2],n[3],n[4],n[5]),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return a;case C.QUAD_TO:for(a=0,o=this.getPointOnQuadraticBezier(0,t,e,n[0],n[1],n[2],n[3]),u=.01;u<=1;u+=.01)s=this.getPointOnQuadraticBezier(u,t,e,n[0],n[1],n[2],n[3]),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return a;case C.ARC:{a=0;var h=n[4],l=n[5],g=n[4]+l,f=Math.PI/180;if(Math.abs(h-g)g;u-=f)s=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],u,0),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(u=h+f;u5&&arguments[5]!==void 0?arguments[5]:e,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:r,u=(a-r)/(n-e+ae),h=Math.sqrt(t*t/(1+u*u));ne)return null;var{dataArray:a}=this;for(var o of a){if(o&&(o.pathLength<5e-5||r+o.pathLength+5e-5=0&&u>g)break;n=this.getPointOnEllipticalArc(o.points[0],o.points[1],o.points[2],o.points[3],u,o.points[6]);break}case C.CURVE_TO:u=s/o.pathLength,u>1&&(u=1),n=this.getPointOnCubicBezier(u,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3],o.points[4],o.points[5]);break;case C.QUAD_TO:u=s/o.pathLength,u>1&&(u=1),n=this.getPointOnQuadraticBezier(u,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3]);break}if(n)return n;break}return null}getLineLength(t,e,r,n){return Math.sqrt((r-t)*(r-t)+(n-e)*(n-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,r,n,a,o,s,u,h){var l=u*Oo(t)+o*Ao(t)+n*Co(t)+e*Eo(t),g=h*Oo(t)+s*Ao(t)+a*Co(t)+r*Eo(t);return{x:l,y:g}}getPointOnQuadraticBezier(t,e,r,n,a,o,s){var u=o*Po(t)+n*Mo(t)+e*No(t),h=s*Po(t)+a*Mo(t)+r*No(t);return{x:u,y:h}}getPointOnEllipticalArc(t,e,r,n,a,o){var s=Math.cos(o),u=Math.sin(o),h={x:r*Math.cos(a),y:n*Math.sin(a)};return{x:t+(h.x*s-h.y*u),y:e+(h.x*u+h.y*s)}}buildEquidistantCache(t,e){var r=this.getPathLength(),n=e||.25,a=t||r/100;if(!this.equidistantCache||this.equidistantCache.step!==a||this.equidistantCache.precision!==n){this.equidistantCache={step:a,precision:n,points:[]};for(var o=0,s=0;s<=r;s+=n){var u=this.getPointOnPath(s),h=this.getPointOnPath(s+n);!u||!h||(o+=this.getLineLength(u.x,u.y,h.x,h.y),o>=a&&(this.equidistantCache.points.push({x:u.x,y:u.y,distance:s}),o-=a))}}}getEquidistantPointOnPath(t,e,r){if(this.buildEquidistantCache(e,r),t<0||t-this.getPathLength()>5e-5)return null;var n=Math.round(t/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[n]||null}}var ib=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class nb extends Xt{constructor(t,e,r){super(t,e,r),this.type="image",this.loaded=!1;var n=this.getHrefAttribute().getString();if(n){var a=n.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(n);t.images.push(this),a?this.loadSvg(n):this.loadImage(n),this.isSvg=a}}loadImage(t){var e=this;return bt(function*(){try{var r=yield e.document.createImage(t);e.image=r}catch(n){console.error('Error while loading image "'.concat(t,'":'),n)}e.loaded=!0})()}loadSvg(t){var e=this;return bt(function*(){var r=ib.exec(t);if(r){var n=r[5];r[4]==="base64"?e.image=atob(n):e.image=decodeURIComponent(n)}else try{var a=yield e.document.fetch(t),o=yield a.text();e.image=o}catch(s){console.error('Error while loading image "'.concat(t,'":'),s)}e.loaded=!0})()}renderChildren(t){var{document:e,image:r,loaded:n}=this,a=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),u=this.getStyle("height").getPixels("y");if(!(!n||!r||!s||!u)){if(t.save(),t.translate(a,o),this.isSvg){var h=e.canvg.forkString(t,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:u});h.document.documentElement.parent=this,h.render()}else{var l=this.image;e.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:l.width,height:u,desiredHeight:l.height}),this.loaded&&(typeof l.complete>"u"||l.complete)&&t.drawImage(l,0,0)}t.restore()}}getBoundingBox(){var t=this.getAttribute("x").getPixels("x"),e=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),n=this.getStyle("height").getPixels("y");return new lt(t,e,t+r,e+n)}}class ab extends Xt{constructor(){super(...arguments),this.type="symbol"}render(t){}}class sb{constructor(t){this.document=t,this.loaded=!1,t.fonts.push(this)}load(t,e){var r=this;return bt(function*(){try{var{document:n}=r,a=yield n.canvg.parser.load(e),o=a.getElementsByTagName("font");Array.from(o).forEach(s=>{var u=n.createElement(s);n.definitions[t]=u})}catch(s){console.error('Error while loading font "'.concat(e,'":'),s)}r.loaded=!0})()}}class Ph extends V{constructor(t,e,r){super(t,e,r),this.type="style";var n=ge(Array.from(e.childNodes).map(o=>o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),a=n.split("}");a.forEach(o=>{var s=o.trim();if(s){var u=s.split("{"),h=u[0].split(","),l=u[1].split(";");h.forEach(g=>{var f=g.trim();if(f){var c=t.styles[f]||{};if(l.forEach(m=>{var y=m.indexOf(":"),b=m.substr(0,y).trim(),x=m.substr(y+1,m.length-y).trim();b&&x&&(c[b]=new T(t,b,x))}),t.styles[f]=c,t.stylesSpecificity[f]=w1(f),f==="@font-face"){var d=c["font-family"].getString().replace(/"|'/g,""),p=c.src.getString().split(",");p.forEach(m=>{if(m.indexOf('format("svg")')>0){var y=xh(m);y&&new sb(t).load(d,y)}})}}})}})}}Ph.parseExternalUrl=xh;class ob extends Xt{constructor(){super(...arguments),this.type="use"}setContext(t){super.setContext(t);var e=this.getAttribute("x"),r=this.getAttribute("y");e.hasValue()&&t.translate(e.getPixels("x"),0),r.hasValue()&&t.translate(0,r.getPixels("y"))}path(t){var{element:e}=this;e&&e.path(t)}renderChildren(t){var{document:e,element:r}=this;if(r){var n=r;if(r.type==="symbol"&&(n=new _e(e,null),n.attributes.viewBox=new T(e,"viewBox",r.getAttribute("viewBox").getString()),n.attributes.preserveAspectRatio=new T(e,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),n.attributes.overflow=new T(e,"overflow",r.getAttribute("overflow").getString()),n.children=r.children,r.styles.opacity=new T(e,"opacity",this.calculateOpacity())),n.type==="svg"){var a=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);a.hasValue()&&(n.attributes.width=new T(e,"width",a.getString())),o.hasValue()&&(n.attributes.height=new T(e,"height",o.getString()))}var s=n.parent;n.parent=this,n.render(t),n.parent=s}}getBoundingBox(t){var{element:e}=this;return e?e.getBoundingBox(t):null}elementTransform(){var{document:t,element:e}=this;return Ft.fromElement(t,e)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function ar(i,t,e,r,n,a){return i[e*r*4+t*4+a]}function sr(i,t,e,r,n,a,o){i[e*r*4+t*4+a]=o}function U(i,t,e){var r=i[t];return r*e}function vt(i,t,e,r){return t+Math.cos(i)*e+Math.sin(i)*r}class Mh extends V{constructor(t,e,r){super(t,e,r),this.type="feColorMatrix";var n=nt(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{var a=n[0];n=[.213+.787*a,.715-.715*a,.072-.072*a,0,0,.213-.213*a,.715+.285*a,.072-.072*a,0,0,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var o=n[0]*Math.PI/180;n=[vt(o,.213,.787,-.213),vt(o,.715,-.715,-.715),vt(o,.072,-.072,.928),0,0,vt(o,.213,-.213,.143),vt(o,.715,.285,.14),vt(o,.072,-.072,-.283),0,0,vt(o,.213,-.213,-.787),vt(o,.715,-.715,.715),vt(o,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":n=[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=n,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(t,e,r,n,a){for(var{includeOpacity:o,matrix:s}=this,u=t.getImageData(0,0,n,a),h=0;h{u.addBoundingBox(d.getBoundingBox(t))}),n=Math.floor(u.x1),a=Math.floor(u.y1),o=Math.floor(u.width),s=Math.floor(u.height)}var h=this.removeStyles(e,Fr.ignoreStyles),l=r.createCanvas(n+o,a+s),g=l.getContext("2d");r.screen.setDefaults(g),this.renderChildren(g),new Mh(r,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(g,0,0,n+o,a+s);var f=r.createCanvas(n+o,a+s),c=f.getContext("2d");r.screen.setDefaults(c),e.render(c),c.globalCompositeOperation="destination-in",c.fillStyle=g.createPattern(l,"no-repeat"),c.fillRect(0,0,n+o,a+s),t.fillStyle=c.createPattern(f,"no-repeat"),t.fillRect(0,0,n+o,a+s),this.restoreStyles(e,h)}render(t){}}Fr.ignoreStyles=["mask","transform","clip-path"];var Ro=()=>{};class ub extends V{constructor(){super(...arguments),this.type="clipPath"}apply(t){var{document:e}=this,r=Reflect.getPrototypeOf(t),{beginPath:n,closePath:a}=t;r&&(r.beginPath=Ro,r.closePath=Ro),Reflect.apply(n,t,[]),this.children.forEach(o=>{if(!(typeof o.path>"u")){var s=typeof o.elementTransform<"u"?o.elementTransform():null;s||(s=Ft.fromElement(e,o)),s&&s.apply(t),o.path(t),r&&(r.closePath=a),s&&s.unapply(t)}}),Reflect.apply(a,t,[]),t.clip(),r&&(r.beginPath=n,r.closePath=a)}render(t){}}class Ur extends V{constructor(){super(...arguments),this.type="filter"}apply(t,e){var{document:r,children:n}=this,a=e.getBoundingBox(t);if(a){var o=0,s=0;n.forEach(y=>{var b=y.extraFilterDistance||0;o=Math.max(o,b),s=Math.max(s,b)});var u=Math.floor(a.width),h=Math.floor(a.height),l=u+2*o,g=h+2*s;if(!(l<1||g<1)){var f=Math.floor(a.x),c=Math.floor(a.y),d=this.removeStyles(e,Ur.ignoreStyles),p=r.createCanvas(l,g),m=p.getContext("2d");r.screen.setDefaults(m),m.translate(-f+o,-c+s),e.render(m),n.forEach(y=>{typeof y.apply=="function"&&y.apply(m,0,0,l,g)}),t.drawImage(p,0,0,l,g,f-o,c-s,l,g),this.restoreStyles(e,d)}}}render(t){}}Ur.ignoreStyles=["filter","transform","clip-path"];class hb extends V{constructor(t,e,r){super(t,e,r),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(t,e,r,n,a){}}class lb extends V{constructor(){super(...arguments),this.type="feMorphology"}apply(t,e,r,n,a){}}class cb extends V{constructor(){super(...arguments),this.type="feComposite"}apply(t,e,r,n,a){}}class gb extends V{constructor(t,e,r){super(t,e,r),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(t,e,r,n,a){var{document:o,blurRadius:s}=this,u=o.window?o.window.document.body:null,h=t.canvas;h.id=o.getUniqueId(),u&&(h.style.display="none",u.appendChild(h)),a1(h,e,r,n,a,s),u&&u.removeChild(h)}}class fb extends V{constructor(){super(...arguments),this.type="title"}}class pb extends V{constructor(){super(...arguments),this.type="desc"}}var db={svg:_e,rect:Ah,circle:F1,ellipse:U1,line:B1,polyline:Ch,polygon:z1,path:P,pattern:H1,marker:X1,defs:Y1,linearGradient:W1,radialGradient:q1,stop:G1,animate:oa,animateColor:Q1,animateTransform:$1,font:Z1,"font-face":K1,"missing-glyph":J1,glyph:Oh,text:Et,tspan:jr,tref:tb,a:eb,textPath:rb,image:nb,g:sa,symbol:ab,style:Ph,use:ob,mask:Fr,clipPath:ub,filter:Ur,feDropShadow:hb,feMorphology:lb,feComposite:cb,feColorMatrix:Mh,feGaussianBlur:gb,title:fb,desc:pb};function Io(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),e.push.apply(e,r)}return e}function mb(i){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:!1,e=document.createElement("img");return t&&(e.crossOrigin="Anonymous"),new Promise((r,n)=>{e.onload=()=>{r(e)},e.onerror=(a,o,s,u,h)=>{n(h)},e.src=i})}),Tn.apply(this,arguments)}class At{constructor(t){var{rootEmSize:e=12,emSize:r=12,createCanvas:n=At.createCanvas,createImage:a=At.createImage,anonymousCrossOrigin:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=t,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=t.screen,this.rootEmSize=e,this.emSize=r,this.createCanvas=n,this.createImage=this.bindCreateImage(a,o),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(t,e){return typeof e=="boolean"?(r,n)=>t(r,typeof n=="boolean"?n:e):t}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:t}=this;return t[t.length-1]}set emSize(t){var{emSizeStack:e}=this;e.push(t)}popEmSize(){var{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){var e=this.createElement(t.documentElement);return e.root=!0,e.addStylesFromStyleDefinition(),this.documentElement=e,e}createElement(t){var e=t.nodeName.replace(/^[^:]+:/,""),r=At.elementTypes[e];return typeof r<"u"?new r(this,t):new I1(this,t)}createTextNode(t){return new j1(this,t)}setViewBox(t){this.screen.setViewBox(mb({document:this},t))}}At.createCanvas=yb;At.createImage=vb;At.elementTypes=db;function ko(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),e.push.apply(e,r)}return e}function _t(i){for(var t=1;t2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new Xi(r),this.screen=new Dr(t,r),this.options=r;var n=new At(this,r),a=n.createDocumentElement(e);this.document=n,this.documentElement=a}static from(t,e){var r=arguments;return bt(function*(){var n=r.length>2&&r[2]!==void 0?r[2]:{},a=new Xi(n),o=yield a.parse(e);return new Se(t,o,n)})()}static fromString(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=new Xi(r),a=n.parseFromString(e);return new Se(t,a,r)}fork(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Se.from(t,e,_t(_t({},this.options),r))}forkString(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Se.fromString(t,e,_t(_t({},this.options),r))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var t=arguments,e=this;return bt(function*(){var r=t.length>0&&t[0]!==void 0?t[0]:{};e.start(_t({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},r)),yield e.ready(),e.stop()})()}start(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:e,screen:r,options:n}=this;r.start(e,_t(_t({enableRedraw:!0},n),t))}stop(){this.screen.stop()}resize(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(t,e,r)}}export{eb as AElement,Q1 as AnimateColorElement,oa as AnimateElement,$1 as AnimateTransformElement,lt as BoundingBox,Oo as CB1,Ao as CB2,Co as CB3,Eo as CB4,Se as Canvg,F1 as CircleElement,ub as ClipPathElement,Y1 as DefsElement,pb as DescElement,At as Document,V as Element,U1 as EllipseElement,Mh as FeColorMatrixElement,cb as FeCompositeElement,hb as FeDropShadowElement,gb as FeGaussianBlurElement,lb as FeMorphologyElement,Ur as FilterElement,J as Font,Z1 as FontElement,K1 as FontFaceElement,sa as GElement,Oh as GlyphElement,Eh as GradientElement,nb as ImageElement,B1 as LineElement,W1 as LinearGradientElement,X1 as MarkerElement,Fr as MaskElement,Sh as Matrix,J1 as MissingGlyphElement,T1 as Mouse,ae as PSEUDO_ZERO,Xi as Parser,P as PathElement,C as PathParser,H1 as PatternElement,L as Point,z1 as PolygonElement,Ch as PolylineElement,T as Property,Po as QB1,Mo as QB2,No as QB3,q1 as RadialGradientElement,Ah as RectElement,Xt as RenderedElement,E1 as Rotate,_e as SVGElement,sb as SVGFontLoader,P1 as Scale,Dr as Screen,Th as Skew,M1 as SkewX,N1 as SkewY,G1 as StopElement,Ph as StyleElement,ab as SymbolElement,tb as TRefElement,jr as TSpanElement,Et as TextElement,rb as TextPathElement,fb as TitleElement,Ft as Transform,C1 as Translate,I1 as UnknownElement,ob as UseElement,S1 as ViewPort,ge as compressSpaces,Se as default,w1 as getSelectorSpecificity,g1 as normalizeAttributeName,f1 as normalizeColor,xh as parseExternalUrl,bb as presets,nt as toNumbers,h1 as trimLeft,l1 as trimRight,So as vectorMagnitude,To as vectorsAngle,Sn as vectorsRatio};