import{_ as Ha,c as Je,g as Do}from"./index-6U78idFG.js";function Rl(a,e){if(Ha(a)!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var r=t.call(a,e||"default");if(Ha(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function Il(a){var e=Rl(a,"string");return Ha(e)=="symbol"?e:e+""}function Oi(a,e,t){return e=Il(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}var ct=function(a){return a&&a.Math===Math&&a},U=ct(typeof globalThis=="object"&&globalThis)||ct(typeof window=="object"&&window)||ct(typeof self=="object"&&self)||ct(typeof Je=="object"&&Je)||ct(typeof Je=="object"&&Je)||function(){return this}()||Function("return this")(),ut={},L=function(a){try{return!!a()}catch{return!0}},Nl=L,ce=!Nl(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Ml=L,br=!Ml(function(){var a=(function(){}).bind();return typeof a!="function"||a.hasOwnProperty("prototype")}),_l=br,Ht=Function.prototype.call,Y=_l?Ht.bind(Ht):function(){return Ht.apply(Ht,arguments)},Vo={},Lo={}.propertyIsEnumerable,ko=Object.getOwnPropertyDescriptor,Dl=ko&&!Lo.call({1:2},1);Vo.f=Dl?function(e){var t=ko(this,e);return!!t&&t.enumerable}:Lo;var xr=function(a,e){return{enumerable:!(a&1),configurable:!(a&2),writable:!(a&4),value:e}},Bo=br,Fo=Function.prototype,Ya=Fo.call,Vl=Bo&&Fo.bind.bind(Ya,Ya),k=Bo?Vl:function(a){return function(){return Ya.apply(a,arguments)}},jo=k,Ll=jo({}.toString),kl=jo("".slice),Fe=function(a){return kl(Ll(a),8,-1)},Bl=k,Fl=L,jl=Fe,Jr=Object,Ul=Bl("".split),Uo=Fl(function(){return!Jr("z").propertyIsEnumerable(0)})?function(a){return jl(a)==="String"?Ul(a,""):Jr(a)}:Jr,je=function(a){return a==null},zl=je,Gl=TypeError,ge=function(a){if(zl(a))throw new Gl("Can't call method on "+a);return a},Hl=Uo,Yl=ge,At=function(a){return Hl(Yl(a))},Xa=typeof document=="object"&&document.all,Xl=typeof Xa>"u"&&Xa!==void 0,zo={all:Xa,IS_HTMLDDA:Xl},Go=zo,Wl=Go.all,D=Go.IS_HTMLDDA?function(a){return typeof a=="function"||a===Wl}:function(a){return typeof a=="function"},yn=D,Ho=zo,ql=Ho.all,Te=Ho.IS_HTMLDDA?function(a){return typeof a=="object"?a!==null:yn(a)||a===ql}:function(a){return typeof a=="object"?a!==null:yn(a)},ea=U,Ql=D,Kl=function(a){return Ql(a)?a:void 0},Ue=function(a,e){return arguments.length<2?Kl(ea[a]):ea[a]&&ea[a][e]},Zl=k,Tr=Zl({}.isPrototypeOf),Sr=typeof navigator<"u"&&String(navigator.userAgent)||"",Yo=U,ta=Sr,mn=Yo.process,bn=Yo.Deno,xn=mn&&mn.versions||bn&&bn.version,Tn=xn&&xn.v8,ue,cr;Tn&&(ue=Tn.split("."),cr=ue[0]>0&&ue[0]<4?1:+(ue[0]+ue[1]));!cr&&ta&&(ue=ta.match(/Edge\/(\d+)/),(!ue||ue[1]>=74)&&(ue=ta.match(/Chrome\/(\d+)/),ue&&(cr=+ue[1])));var Ei=cr,Sn=Ei,Jl=L,eh=U,th=eh.String,Xo=!!Object.getOwnPropertySymbols&&!Jl(function(){var a=Symbol("symbol detection");return!th(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&Sn&&Sn<41}),rh=Xo,Wo=rh&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ah=Ue,ih=D,nh=Tr,sh=Wo,oh=Object,qo=sh?function(a){return typeof a=="symbol"}:function(a){var e=ah("Symbol");return ih(e)&&nh(e.prototype,oh(a))},uh=String,Or=function(a){try{return uh(a)}catch{return"Object"}},lh=D,hh=Or,vh=TypeError,Se=function(a){if(lh(a))return a;throw new vh(hh(a)+" is not a function")},fh=Se,ch=je,lt=function(a,e){var t=a[e];return ch(t)?void 0:fh(t)},ra=Y,aa=D,ia=Te,gh=TypeError,dh=function(a,e){var t,r;if(e==="string"&&aa(t=a.toString)&&!ia(r=ra(t,a))||aa(t=a.valueOf)&&!ia(r=ra(t,a))||e!=="string"&&aa(t=a.toString)&&!ia(r=ra(t,a)))return r;throw new gh("Can't convert object to primitive value")},Qo={exports:{}},On=U,ph=Object.defineProperty,$i=function(a,e){try{ph(On,a,{value:e,configurable:!0,writable:!0})}catch{On[a]=e}return e},yh=U,mh=$i,En="__core-js_shared__",bh=yh[En]||mh(En,{}),wi=bh,$n=wi;(Qo.exports=function(a,e){return $n[a]||($n[a]=e!==void 0?e:{})})("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 Ci=Qo.exports,xh=ge,Th=Object,Er=function(a){return Th(xh(a))},Sh=k,Oh=Er,Eh=Sh({}.hasOwnProperty),le=Object.hasOwn||function(e,t){return Eh(Oh(e),t)},$h=k,wh=0,Ch=Math.random(),Ah=$h(1 .toString),Ko=function(a){return"Symbol("+(a===void 0?"":a)+")_"+Ah(++wh+Ch,36)},Ph=U,Rh=Ci,wn=le,Ih=Ko,Nh=Xo,Mh=Wo,et=Ph.Symbol,na=Rh("wks"),_h=Mh?et.for||et:et&&et.withoutSetter||Ih,G=function(a){return wn(na,a)||(na[a]=Nh&&wn(et,a)?et[a]:_h("Symbol."+a)),na[a]},Dh=Y,Cn=Te,An=qo,Vh=lt,Lh=dh,kh=G,Bh=TypeError,Fh=kh("toPrimitive"),jh=function(a,e){if(!Cn(a)||An(a))return a;var t=Vh(a,Fh),r;if(t){if(e===void 0&&(e="default"),r=Dh(t,a,e),!Cn(r)||An(r))return r;throw new Bh("Can't convert object to primitive value")}return e===void 0&&(e="number"),Lh(a,e)},Uh=jh,zh=qo,Ai=function(a){var e=Uh(a,"string");return zh(e)?e:e+""},Gh=U,Pn=Te,Wa=Gh.document,Hh=Pn(Wa)&&Pn(Wa.createElement),$r=function(a){return Hh?Wa.createElement(a):{}},Yh=ce,Xh=L,Wh=$r,Zo=!Yh&&!Xh(function(){return Object.defineProperty(Wh("div"),"a",{get:function(){return 7}}).a!==7}),qh=ce,Qh=Y,Kh=Vo,Zh=xr,Jh=At,ev=Ai,tv=le,rv=Zo,Rn=Object.getOwnPropertyDescriptor;ut.f=qh?Rn:function(e,t){if(e=Jh(e),t=ev(t),rv)try{return Rn(e,t)}catch{}if(tv(e,t))return Zh(!Qh(Kh.f,e,t),e[t])};var de={},av=ce,iv=L,Jo=av&&iv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),nv=Te,sv=String,ov=TypeError,K=function(a){if(nv(a))return a;throw new ov(sv(a)+" is not an object")},uv=ce,lv=Zo,hv=Jo,Yt=K,In=Ai,vv=TypeError,sa=Object.defineProperty,fv=Object.getOwnPropertyDescriptor,oa="enumerable",ua="configurable",la="writable";de.f=uv?hv?function(e,t,r){if(Yt(e),t=In(t),Yt(r),typeof e=="function"&&t==="prototype"&&"value"in r&&la in r&&!r[la]){var i=fv(e,t);i&&i[la]&&(e[t]=r.value,r={configurable:ua in r?r[ua]:i[ua],enumerable:oa in r?r[oa]:i[oa],writable:!1})}return sa(e,t,r)}:sa:function(e,t,r){if(Yt(e),t=In(t),Yt(r),lv)try{return sa(e,t,r)}catch{}if("get"in r||"set"in r)throw new vv("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var cv=ce,gv=de,dv=xr,Pt=cv?function(a,e,t){return gv.f(a,e,dv(1,t))}:function(a,e,t){return a[e]=t,a},eu={exports:{}},qa=ce,pv=le,tu=Function.prototype,yv=qa&&Object.getOwnPropertyDescriptor,Pi=pv(tu,"name"),mv=Pi&&(function(){}).name==="something",bv=Pi&&(!qa||qa&&yv(tu,"name").configurable),wr={EXISTS:Pi,PROPER:mv,CONFIGURABLE:bv},xv=k,Tv=D,Qa=wi,Sv=xv(Function.toString);Tv(Qa.inspectSource)||(Qa.inspectSource=function(a){return Sv(a)});var Ri=Qa.inspectSource,Ov=U,Ev=D,Nn=Ov.WeakMap,$v=Ev(Nn)&&/native code/.test(String(Nn)),wv=Ci,Cv=Ko,Mn=wv("keys"),Ii=function(a){return Mn[a]||(Mn[a]=Cv(a))},Ni={},Av=$v,ru=U,Pv=Te,Rv=Pt,ha=le,va=wi,Iv=Ii,Nv=Ni,_n="Object already initialized",Ka=ru.TypeError,Mv=ru.WeakMap,gr,$t,dr,_v=function(a){return dr(a)?$t(a):gr(a,{})},Dv=function(a){return function(e){var t;if(!Pv(e)||(t=$t(e)).type!==a)throw new Ka("Incompatible receiver, "+a+" required");return t}};if(Av||va.state){var fe=va.state||(va.state=new Mv);fe.get=fe.get,fe.has=fe.has,fe.set=fe.set,gr=function(a,e){if(fe.has(a))throw new Ka(_n);return e.facade=a,fe.set(a,e),e},$t=function(a){return fe.get(a)||{}},dr=function(a){return fe.has(a)}}else{var Xe=Iv("state");Nv[Xe]=!0,gr=function(a,e){if(ha(a,Xe))throw new Ka(_n);return e.facade=a,Rv(a,Xe,e),e},$t=function(a){return ha(a,Xe)?a[Xe]:{}},dr=function(a){return ha(a,Xe)}}var Cr={set:gr,get:$t,has:dr,enforce:_v,getterFor:Dv},Mi=k,Vv=L,Lv=D,Xt=le,Za=ce,kv=wr.CONFIGURABLE,Bv=Ri,au=Cr,Fv=au.enforce,jv=au.get,Dn=String,or=Object.defineProperty,Uv=Mi("".slice),zv=Mi("".replace),Gv=Mi([].join),Hv=Za&&!Vv(function(){return or(function(){},"length",{value:8}).length!==8}),Yv=String(String).split("String"),Xv=eu.exports=function(a,e,t){Uv(Dn(e),0,7)==="Symbol("&&(e="["+zv(Dn(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Xt(a,"name")||kv&&a.name!==e)&&(Za?or(a,"name",{value:e,configurable:!0}):a.name=e),Hv&&t&&Xt(t,"arity")&&a.length!==t.arity&&or(a,"length",{value:t.arity});try{t&&Xt(t,"constructor")&&t.constructor?Za&&or(a,"prototype",{writable:!1}):a.prototype&&(a.prototype=void 0)}catch{}var r=Fv(a);return Xt(r,"source")||(r.source=Gv(Yv,typeof e=="string"?e:"")),a};Function.prototype.toString=Xv(function(){return Lv(this)&&jv(this).source||Bv(this)},"toString");var iu=eu.exports,Wv=D,qv=de,Qv=iu,Kv=$i,ze=function(a,e,t,r){r||(r={});var i=r.enumerable,n=r.name!==void 0?r.name:e;if(Wv(t)&&Qv(t,n,r),r.global)i?a[e]=t:Kv(e,t);else{try{r.unsafe?a[e]&&(i=!0):delete a[e]}catch{}i?a[e]=t:qv.f(a,e,{value:t,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return a},nu={},Zv=Math.ceil,Jv=Math.floor,ef=Math.trunc||function(e){var t=+e;return(t>0?Jv:Zv)(t)},tf=ef,Ar=function(a){var e=+a;return e!==e||e===0?0:tf(e)},rf=Ar,af=Math.max,nf=Math.min,su=function(a,e){var t=rf(a);return t<0?af(t+e,0):nf(t,e)},sf=Ar,of=Math.min,ht=function(a){return a>0?of(sf(a),9007199254740991):0},uf=ht,Pr=function(a){return uf(a.length)},lf=At,hf=su,vf=Pr,Vn=function(a){return function(e,t,r){var i=lf(e),n=vf(i),o=hf(r,n),s;if(a&&t!==t){for(;n>o;)if(s=i[o++],s!==s)return!0}else for(;n>o;o++)if((a||o in i)&&i[o]===t)return a||o||0;return!a&&-1}},ou={includes:Vn(!0),indexOf:Vn(!1)},ff=k,fa=le,cf=At,gf=ou.indexOf,df=Ni,Ln=ff([].push),uu=function(a,e){var t=cf(a),r=0,i=[],n;for(n in t)!fa(df,n)&&fa(t,n)&&Ln(i,n);for(;e.length>r;)fa(t,n=e[r++])&&(~gf(i,n)||Ln(i,n));return i},_i=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],pf=uu,yf=_i,mf=yf.concat("length","prototype");nu.f=Object.getOwnPropertyNames||function(e){return pf(e,mf)};var lu={};lu.f=Object.getOwnPropertySymbols;var bf=Ue,xf=k,Tf=nu,Sf=lu,Of=K,Ef=xf([].concat),$f=bf("Reflect","ownKeys")||function(e){var t=Tf.f(Of(e)),r=Sf.f;return r?Ef(t,r(e)):t},kn=le,wf=$f,Cf=ut,Af=de,Pf=function(a,e,t){for(var r=wf(e),i=Af.f,n=Cf.f,o=0;of;f++)if(v=y(a[f]),v&&gs(ps,v))return v;return new hr(!1)}l=Cd(a,h)}for(d=n?a.next:l.next;!(g=Sd(d,l)).done;){try{v=y(g.value)}catch(x){ds(l,"throw",x)}if(typeof v=="object"&&v&&gs(ps,v))return v}return new hr(!1)},Rd=G,ju=Rd("iterator"),Uu=!1;try{var Id=0,ys={next:function(){return{done:!!Id++}},return:function(){Uu=!0}};ys[ju]=function(){return this},Array.from(ys,function(){throw 2})}catch{}var Nd=function(a,e){try{if(!e&&!Uu)return!1}catch{return!1}var t=!1;try{var r={};r[ju]=function(){return{next:function(){return{done:t=!0}}}},a(r)}catch{}return t},Md=Ir,_d=Nd,Dd=Mt.CONSTRUCTOR,zu=Dd||!_d(function(a){Md.all(a).then(void 0,function(){})}),Vd=ee,Ld=Y,kd=Se,Bd=vt,Fd=Fi,jd=Fu,Ud=zu;Vd({target:"Promise",stat:!0,forced:Ud},{all:function(e){var t=this,r=Bd.f(t),i=r.resolve,n=r.reject,o=Fd(function(){var s=kd(t.resolve),u=[],l=0,h=1;jd(e,function(f){var c=l++,v=!1;h++,Ld(s,t,f).then(function(d){v||(v=!0,u[c]=d,--h||i(u))},n)}),--h||i(u)});return o.error&&n(o.value),r.promise}});var zd=ee,Gd=Mt.CONSTRUCTOR,si=Ir,Hd=Ue,Yd=D,Xd=ze,ms=si&&si.prototype;zd({target:"Promise",proto:!0,forced:Gd,real:!0},{catch:function(a){return this.then(void 0,a)}});if(Yd(si)){var bs=Hd("Promise").prototype.catch;ms.catch!==bs&&Xd(ms,"catch",bs,{unsafe:!0})}var Wd=ee,qd=Y,Qd=Se,Kd=vt,Zd=Fi,Jd=Fu,ep=zu;Wd({target:"Promise",stat:!0,forced:ep},{race:function(e){var t=this,r=Kd.f(t),i=r.reject,n=Zd(function(){var o=Qd(t.resolve);Jd(e,function(s){qd(o,t,s).then(r.resolve,i)})});return n.error&&i(n.value),r.promise}});var tp=ee,rp=Y,ap=vt,ip=Mt.CONSTRUCTOR;tp({target:"Promise",stat:!0,forced:ip},{reject:function(e){var t=ap.f(this);return rp(t.reject,void 0,e),t.promise}});var np=K,sp=Te,op=vt,up=function(a,e){if(np(a),sp(e)&&e.constructor===a)return e;var t=op.f(a),r=t.resolve;return r(e),t.promise},lp=ee,hp=Ue,vp=Mt.CONSTRUCTOR,fp=up;hp("Promise");lp({target:"Promise",stat:!0,forced:vp},{resolve:function(e){return fp(this,e)}});function xs(a,e,t,r,i,n,o){try{var s=a[n](o),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(r,i)}function xe(a){return function(){var e=this,t=arguments;return new Promise(function(r,i){var n=a.apply(e,t);function o(u){xs(n,r,i,o,s,"next",u)}function s(u){xs(n,r,i,o,s,"throw",u)}o(void 0)})}}var cp=Di,gp=String,pe=function(a){if(cp(a)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return gp(a)},dp=K,Gu=function(){var a=dp(this),e="";return a.hasIndices&&(e+="d"),a.global&&(e+="g"),a.ignoreCase&&(e+="i"),a.multiline&&(e+="m"),a.dotAll&&(e+="s"),a.unicode&&(e+="u"),a.unicodeSets&&(e+="v"),a.sticky&&(e+="y"),e},Hi=L,pp=U,Yi=pp.RegExp,Xi=Hi(function(){var a=Yi("a","y");return a.lastIndex=2,a.exec("abcd")!==null}),yp=Xi||Hi(function(){return!Yi("a","y").sticky}),mp=Xi||Hi(function(){var a=Yi("^r","gy");return a.lastIndex=2,a.exec("str")!==null}),Hu={BROKEN_CARET:mp,MISSED_STICKY:yp,UNSUPPORTED_Y:Xi},Yu={},bp=uu,xp=_i,Tp=Object.keys||function(e){return bp(e,xp)},Sp=ce,Op=Jo,Ep=de,$p=K,wp=At,Cp=Tp;Yu.f=Sp&&!Op?Object.defineProperties:function(e,t){$p(e);for(var r=wp(t),i=Cp(t),n=i.length,o=0,s;n>o;)Ep.f(e,s=i[o++],r[s]);return e};var Ap=K,Pp=Yu,Ts=_i,Rp=Ni,Ip=bu,Np=$r,Mp=Ii,Ss=">",Os="<",oi="prototype",ui="script",Xu=Mp("IE_PROTO"),$a=function(){},Wu=function(a){return Os+ui+Ss+a+Os+"/"+ui+Ss},Es=function(a){a.write(Wu("")),a.close();var e=a.parentWindow.Object;return a=null,e},_p=function(){var a=Np("iframe"),e="java"+ui+":",t;return a.style.display="none",Ip.appendChild(a),a.src=String(e),t=a.contentWindow.document,t.open(),t.write(Wu("document.F=Object")),t.close(),t.F},er,vr=function(){try{er=new ActiveXObject("htmlfile")}catch{}vr=typeof document<"u"?document.domain&&er?Es(er):_p():Es(er);for(var a=Ts.length;a--;)delete vr[oi][Ts[a]];return vr()};Rp[Xu]=!0;var Wi=Object.create||function(e,t){var r;return e!==null?($a[oi]=Ap(e),r=new $a,$a[oi]=null,r[Xu]=e):r=vr(),t===void 0?r:Pp.f(r,t)},Dp=L,Vp=U,Lp=Vp.RegExp,kp=Dp(function(){var a=Lp(".","s");return!(a.dotAll&&a.test(` `)&&a.flags==="s")}),Bp=L,Fp=U,jp=Fp.RegExp,Up=Bp(function(){var a=jp("(?b)","g");return a.exec("b").groups.a!=="b"||"b".replace(a,"$c")!=="bc"}),rt=Y,Mr=k,zp=pe,Gp=Gu,Hp=Hu,Yp=Ci,Xp=Wi,Wp=Cr.get,qp=kp,Qp=Up,Kp=Yp("native-string-replace",String.prototype.replace),mr=RegExp.prototype.exec,li=mr,Zp=Mr("".charAt),Jp=Mr("".indexOf),ey=Mr("".replace),wa=Mr("".slice),hi=function(){var a=/a/,e=/b*/g;return rt(mr,a,"a"),rt(mr,e,"a"),a.lastIndex!==0||e.lastIndex!==0}(),qu=Hp.BROKEN_CARET,vi=/()??/.exec("")[1]!==void 0,ty=hi||vi||qu||qp||Qp;ty&&(li=function(e){var t=this,r=Wp(t),i=zp(e),n=r.raw,o,s,u,l,h,f,c;if(n)return n.lastIndex=t.lastIndex,o=rt(li,n,i),t.lastIndex=n.lastIndex,o;var v=r.groups,d=qu&&t.sticky,g=rt(Gp,t),p=t.source,y=0,x=i;if(d&&(g=ey(g,"y",""),Jp(g,"g")===-1&&(g+="g"),x=wa(i,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&Zp(i,t.lastIndex-1)!==` `)&&(p="(?: "+p+")",x=" "+x,y++),s=new RegExp("^(?:"+p+")",g)),vi&&(s=new RegExp("^"+p+"$(?!\\s)",g)),hi&&(u=t.lastIndex),l=rt(mr,d?s:t,x),d?l?(l.input=wa(l.input,y),l[0]=wa(l[0],y),l.index=t.lastIndex,t.lastIndex+=l[0].length):t.lastIndex=0:hi&&l&&(t.lastIndex=t.global?l.index+l[0].length:u),vi&&l&&l.length>1&&rt(Kp,l[0],s,function(){for(h=1;h=n?a?"":void 0:(o=Ps(r,i),o<55296||o>56319||i+1===n||(s=Ps(r,i+1))<56320||s>57343?a?ly(r,i):o:a?hy(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},vy={codeAt:Rs(!1),charAt:Rs(!0)},fy=vy.charAt,Ki=function(a,e,t){return e+(t?fy(a,e).length:1)},Is=Y,cy=K,gy=D,dy=Fe,py=_r,yy=TypeError,Zi=function(a,e){var t=a.exec;if(gy(t)){var r=Is(t,a,e);return r!==null&&cy(r),r}if(dy(a)==="RegExp")return Is(py,a,e);throw new yy("RegExp#exec called on incompatible receiver")},my=Y,by=qi,xy=K,Ty=je,Sy=ht,Aa=pe,Oy=ge,Ey=lt,$y=Ki,Ns=Zi;by("match",function(a,e,t){return[function(i){var n=Oy(this),o=Ty(i)?void 0:Ey(i,a);return o?my(o,i,n):new RegExp(i)[a](Aa(n))},function(r){var i=xy(this),n=Aa(r),o=t(e,i,n);if(o.done)return o.value;if(!i.global)return Ns(i,n);var s=i.unicode;i.lastIndex=0;for(var u=[],l=0,h;(h=Ns(i,n))!==null;){var f=Aa(h[0]);u[l]=f,f===""&&(i.lastIndex=$y(n,Sy(i.lastIndex),s)),l++}return l===0?null:u}]});var Ji=k,wy=Er,Cy=Math.floor,Pa=Ji("".charAt),Ay=Ji("".replace),Ra=Ji("".slice),Py=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Ry=/\$([$&'`]|\d{1,2})/g,Iy=function(a,e,t,r,i,n){var o=t+a.length,s=r.length,u=Ry;return i!==void 0&&(i=wy(i),u=Py),Ay(n,u,function(l,h){var f;switch(Pa(h,0)){case"$":return"$";case"&":return a;case"`":return Ra(e,0,t);case"'":return Ra(e,o);case"<":f=i[Ra(h,1,-1)];break;default:var c=+h;if(c===0)return l;if(c>s){var v=Cy(c/10);return v===0?l:v<=s?r[v-1]===void 0?Pa(h,1):r[v-1]+Pa(h,1):l}f=r[c-1]}return f===void 0?"":f})},Ny=Li,Ms=Y,Dr=k,My=qi,_y=L,Dy=K,Vy=D,Ly=je,ky=Ar,By=ht,qe=pe,Fy=ge,jy=Ki,Uy=lt,zy=Iy,Gy=Zi,Hy=G,fi=Hy("replace"),Yy=Math.max,Xy=Math.min,Wy=Dr([].concat),Ia=Dr([].push),_s=Dr("".indexOf),Ds=Dr("".slice),qy=function(a){return a===void 0?a:String(a)},Qy=function(){return"a".replace(/./,"$0")==="$0"}(),Vs=function(){return/./[fi]?/./[fi]("a","$0")==="":!1}(),Ky=!_y(function(){var a=/./;return a.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(a,"$")!=="7"});My("replace",function(a,e,t){var r=Vs?"$":"$0";return[function(n,o){var s=Fy(this),u=Ly(n)?void 0:Uy(n,fi);return u?Ms(u,n,s,o):Ms(e,qe(s),n,o)},function(i,n){var o=Dy(this),s=qe(i);if(typeof n=="string"&&_s(n,r)===-1&&_s(n,"$<")===-1){var u=t(e,o,s,n);if(u.done)return u.value}var l=Vy(n);l||(n=qe(n));var h=o.global,f;h&&(f=o.unicode,o.lastIndex=0);for(var c=[],v;v=Gy(o,s),!(v===null||(Ia(c,v),!h));){var d=qe(v[0]);d===""&&(o.lastIndex=jy(s,By(o.lastIndex),f))}for(var g="",p=0,y=0;y=p&&(g+=Ds(s,p,b)+$,p=b+x.length)}return g+Ds(s,p)}]},!Ky||!Qy||Vs);var Zy=Te,Jy=Fe,em=G,tm=em("match"),Ku=function(a){var e;return Zy(a)&&((e=a[tm])!==void 0?!!e:Jy(a)==="RegExp")},rm=Ku,am=TypeError,en=function(a){if(rm(a))throw new am("The method doesn't accept regular expressions");return a},im=G,nm=im("match"),tn=function(a){var e=/./;try{"/./"[a](e)}catch{try{return e[nm]=!1,"/./"[a](e)}catch{}}return!1},sm=ee,Zu=Nt,om=ut.f,um=ht,Ls=pe,lm=en,hm=ge,vm=tn,ks=Zu("".startsWith),fm=Zu("".slice),cm=Math.min,Ju=vm("startsWith"),gm=!Ju&&!!function(){var a=om(String.prototype,"startsWith");return a&&!a.writable}();sm({target:"String",proto:!0,forced:!gm&&!Ju},{startsWith:function(e){var t=Ls(hm(this));lm(e);var r=um(cm(arguments.length>1?arguments[1]:void 0,t.length)),i=Ls(e);return ks?ks(t,i,r):fm(t,r,r+i.length)===i}});var dm=G,pm=Wi,ym=de.f,ci=dm("unscopables"),gi=Array.prototype;gi[ci]===void 0&&ym(gi,ci,{configurable:!0,value:pm(null)});var mm=function(a){gi[ci][a]=!0},bm=L,xm=!bm(function(){function a(){}return a.prototype.constructor=null,Object.getPrototypeOf(new a)!==a.prototype}),Tm=le,Sm=D,Om=Er,Em=Ii,$m=xm,Bs=Em("IE_PROTO"),di=Object,wm=di.prototype,el=$m?di.getPrototypeOf:function(a){var e=Om(a);if(Tm(e,Bs))return e[Bs];var t=e.constructor;return Sm(t)&&e instanceof t?t.prototype:e instanceof di?wm:null},Cm=L,Am=D,Pm=Te,Fs=el,Rm=ze,Im=G,pi=Im("iterator"),tl=!1,ke,Na,Ma;[].keys&&(Ma=[].keys(),"next"in Ma?(Na=Fs(Fs(Ma)),Na!==Object.prototype&&(ke=Na)):tl=!0);var Nm=!Pm(ke)||Cm(function(){var a={};return ke[pi].call(a)!==a});Nm&&(ke={});Am(ke[pi])||Rm(ke,pi,function(){return this});var rl={IteratorPrototype:ke,BUGGY_SAFARI_ITERATORS:tl},Mm=rl.IteratorPrototype,_m=Wi,Dm=xr,Vm=Rr,Lm=_t,km=function(){return this},Bm=function(a,e,t,r){var i=e+" Iterator";return a.prototype=_m(Mm,{next:Dm(+!r,t)}),Vm(a,i,!1),Lm[i]=km,a},Fm=ee,jm=Y,al=wr,Um=D,zm=Bm,js=el,Us=vu,Gm=Rr,Hm=Pt,_a=ze,Ym=G,Xm=_t,il=rl,Wm=al.PROPER,qm=al.CONFIGURABLE,zs=il.IteratorPrototype,tr=il.BUGGY_SAFARI_ITERATORS,dt=Ym("iterator"),Gs="keys",pt="values",Hs="entries",Qm=function(){return this},Km=function(a,e,t,r,i,n,o){zm(t,e,r);var s=function(y){if(y===i&&c)return c;if(!tr&&y&&y in h)return h[y];switch(y){case Gs:return function(){return new t(this,y)};case pt:return function(){return new t(this,y)};case Hs:return function(){return new t(this,y)}}return function(){return new t(this)}},u=e+" Iterator",l=!1,h=a.prototype,f=h[dt]||h["@@iterator"]||i&&h[i],c=!tr&&f||s(i),v=e==="Array"&&h.entries||f,d,g,p;if(v&&(d=js(v.call(new a)),d!==Object.prototype&&d.next&&(js(d)!==zs&&(Us?Us(d,zs):Um(d[dt])||_a(d,dt,Qm)),Gm(d,u,!0))),Wm&&i===pt&&f&&f.name!==pt&&(qm?Hm(h,"name",pt):(l=!0,c=function(){return jm(f,this)})),i)if(g={values:s(pt),keys:n?c:s(Gs),entries:s(Hs)},o)for(p in g)(tr||l||!(p in h))&&_a(h,p,g[p]);else Fm({target:e,proto:!0,forced:tr||l},g);return h[dt]!==c&&_a(h,dt,c,{name:i}),Xm[e]=c,g},Zm=function(a,e){return{value:a,done:e}},Jm=At,rn=mm,Ys=_t,nl=Cr,e0=de.f,t0=Km,rr=Zm,r0=ce,sl="Array Iterator",a0=nl.set,i0=nl.getterFor(sl),n0=t0(Array,"Array",function(a,e){a0(this,{type:sl,target:Jm(a),index:0,kind:e})},function(){var a=i0(this),e=a.target,t=a.index++;if(!e||t>=e.length)return a.target=void 0,rr(void 0,!0);switch(a.kind){case"keys":return rr(t,!1);case"values":return rr(e[t],!1)}return rr([t,e[t]],!1)},"values"),Xs=Ys.Arguments=Ys.Array;rn("keys");rn("values");rn("entries");if(r0&&Xs.name!=="values")try{e0(Xs,"name",{value:"values"})}catch{}var s0={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},o0=$r,Da=o0("span").classList,Ws=Da&&Da.constructor&&Da.constructor.prototype,u0=Ws===Object.prototype?void 0:Ws,qs=U,ol=s0,l0=u0,xt=n0,Qs=Pt,h0=Rr,v0=G,Va=v0("iterator"),La=xt.values,ul=function(a,e){if(a){if(a[Va]!==La)try{Qs(a,Va,La)}catch{a[Va]=La}if(h0(a,e,!0),ol[e]){for(var t in xt)if(a[t]!==xt[t])try{Qs(a,t,xt[t])}catch{a[t]=xt[t]}}}};for(var ka in ol)ul(qs[ka]&&qs[ka].prototype,ka);ul(l0,"DOMTokenList");var f0=Se,c0=Er,g0=Uo,d0=Pr,p0=TypeError,Ks=function(a){return function(e,t,r,i){var n=c0(e),o=g0(n),s=d0(n);f0(t);var u=a?s-1:0,l=a?-1:1;if(r<2)for(;;){if(u in o){i=o[u],u+=l;break}if(u+=l,a?u<0:s<=u)throw new p0("Reduce of empty array with no initial value")}for(;a?u>=0:s>u;u+=l)u in o&&(i=t(i,o[u],u,n));return i}},y0={left:Ks(!1),right:Ks(!0)},m0=L,ll=function(a,e){var t=[][a];return!!t&&m0(function(){t.call(null,e||function(){return 1},1)})},b0=ee,x0=y0.left,T0=ll,Zs=Ei,S0=It,O0=!S0&&Zs>79&&Zs<83,E0=O0||!T0("reduce");b0({target:"Array",proto:!0,forced:E0},{reduce:function(e){var t=arguments.length;return x0(this,e,t,t>1?arguments[1]:void 0)}});var $0=ee,hl=Nt,w0=ut.f,C0=ht,Js=pe,A0=en,P0=ge,R0=tn,eo=hl("".endsWith),I0=hl("".slice),N0=Math.min,vl=R0("endsWith"),M0=!vl&&!!function(){var a=w0(String.prototype,"endsWith");return a&&!a.writable}();$0({target:"String",proto:!0,forced:!M0&&!vl},{endsWith:function(e){var t=Js(P0(this));A0(e);var r=arguments.length>1?arguments[1]:void 0,i=t.length,n=r===void 0?i:N0(C0(r),i),o=Js(e);return eo?eo(t,o,n):I0(t,n-o.length,n)===o}});var _0=Ai,D0=de,V0=xr,L0=function(a,e,t){var r=_0(e);r in a?D0.f(a,r,V0(0,t)):a[r]=t},to=su,k0=Pr,B0=L0,F0=Array,j0=Math.max,U0=function(a,e,t){for(var r=k0(a),i=to(e,r),n=to(t===void 0?r:t,r),o=F0(j0(n-i,0)),s=0;i1||"".split(/.?/).length?r=function(i,n){var o=Ba(ro(this)),s=n===void 0?no:n>>>0;if(s===0)return[];if(i===void 0)return[o];if(!X0(i))return yt(e,o,i,s);for(var u=[],l=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(i.sticky?"y":""),h=0,f=new RegExp(i.source,l+"g"),c,v,d;(c=yt(Z0,f,o))&&(v=f.lastIndex,!(v>h&&(Ke(u,mt(o,h,c.index)),c.length>1&&c.index=s)));)f.lastIndex===c.index&&f.lastIndex++;return h===o.length?(d||!rb(f,""))&&Ke(u,""):Ke(u,mt(o,h)),u.length>s?ao(u,0,s):u}:"0".split(void 0,0).length?r=function(i,n){return i===void 0&&n===0?[]:yt(e,this,i,n)}:r=e,[function(n,o){var s=ro(this),u=Y0(n)?void 0:K0(n,a);return u?yt(u,n,s,o):yt(r,Ba(s),n,o)},function(i,n){var o=H0(this),s=Ba(i),u=t(r,o,s,n,r!==e);if(u.done)return u.value;var l=W0(o,RegExp),h=o.unicode,f=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Qe?"g":"y"),c=new l(Qe?"^(?:"+o.source+")":o,f),v=n===void 0?no:n>>>0;if(v===0)return[];if(s.length===0)return io(c,s)===null?[s]:[];for(var d=0,g=0,p=[];g"u"?Je:window,ar=["moz","webkit"],it="AnimationFrame",ot=be["request"+it],Ct=be["cancel"+it]||be["cancelRequest"+it];for(var bt=0;!ot&&bt3&&(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),l=this.g.toString(16),h=this.b.toString(16);return u.length==1&&(u="0"+u),l.length==1&&(l="0"+l),h.length==1&&(h="0"+h),"#"+u+l+h},this.getHelpXML=function(){for(var u=new Array,l=0;l "+g.toRGB()+" -> "+g.toHex());d.appendChild(p),d.appendChild(y),v.appendChild(d)}catch{}return v}};const mi=Do(xb);var Tb=ee,Sb=Nt,Ob=ou.indexOf,Eb=ll,bi=Sb([].indexOf),gl=!!bi&&1/bi([1],1,-0)<0,$b=gl||!Eb("indexOf");Tb({target:"Array",proto:!0,forced:$b},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return gl?bi(this,e,t)||0:Ob(this,e,t)}});var wb=ee,Cb=k,Ab=en,Pb=ge,ho=pe,Rb=tn,Ib=Cb("".indexOf);wb({target:"String",proto:!0,forced:!Rb("includes")},{includes:function(e){return!!~Ib(ho(Pb(this)),ho(Ab(e)),arguments.length>1?arguments[1]:void 0)}});var Nb=Fe,Mb=Array.isArray||function(e){return Nb(e)==="Array"},_b=ee,Db=k,Vb=Mb,Lb=Db([].reverse),vo=[1,2];_b({target:"Array",proto:!0,forced:String(vo)===String(vo.reverse())},{reverse:function(){return Vb(this)&&(this.length=this.length),Lb(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 dl=function(a,e){return(dl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])})(a,e)};function pl(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=a}dl(a,e),a.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function kb(a){var e="";Array.isArray(a)||(a=[a]);for(var t=0;ta.phi1&&(a.phi2-=2*Ee),a.sweepFlag===1&&a.phi2r)return[];if(r===0)return[[a*t/(a*a+e*e),e*t/(a*a+e*e)]];var i=Math.sqrt(r);return[[(a*t+e*i)/(a*a+e*e),(e*t-a*i)/(a*a+e*e)],[(a*t-e*i)/(a*a+e*e),(e*t+a*i)/(a*a+e*e)]]}var j,ye=Math.PI/180;function co(a,e,t){return(1-t)*a+t*e}function go(a,e,t,r){return a+Math.cos(r/180*Ee)*e+Math.sin(r/180*Ee)*t}function po(a,e,t,r){var i=1e-6,n=e-a,o=t-e,s=3*n+3*(r-t)-6*o,u=6*(o-n),l=3*n;return Math.abs(s)S&&(v.sweepFlag=+!v.sweepFlag),v})}function o(){return function(s){var u={};for(var l in s)u[l]=s[l];return u}}a.ROUND=function(s){function u(l){return Math.round(l*s)/s}return s===void 0&&(s=1e13),oe(s),function(l){return l.x1!==void 0&&(l.x1=u(l.x1)),l.y1!==void 0&&(l.y1=u(l.y1)),l.x2!==void 0&&(l.x2=u(l.x2)),l.y2!==void 0&&(l.y2=u(l.y2)),l.x!==void 0&&(l.x=u(l.x)),l.y!==void 0&&(l.y=u(l.y)),l.rX!==void 0&&(l.rX=u(l.rX)),l.rY!==void 0&&(l.rY=u(l.rY)),l}},a.TO_ABS=e,a.TO_REL=function(){return i(function(s,u,l){return s.relative||(s.x1!==void 0&&(s.x1-=u),s.y1!==void 0&&(s.y1-=l),s.x2!==void 0&&(s.x2-=u),s.y2!==void 0&&(s.y2-=l),s.x!==void 0&&(s.x-=u),s.y!==void 0&&(s.y-=l),s.relative=!0),s})},a.NORMALIZE_HVZ=function(s,u,l){return s===void 0&&(s=!0),u===void 0&&(u=!0),l===void 0&&(l=!0),i(function(h,f,c,v,d){if(isNaN(v)&&!(h.type&m.MOVE_TO))throw new Error("path must start with moveto");return u&&h.type&m.HORIZ_LINE_TO&&(h.type=m.LINE_TO,h.y=h.relative?0:c),l&&h.type&m.VERT_LINE_TO&&(h.type=m.LINE_TO,h.x=h.relative?0:f),s&&h.type&m.CLOSE_PATH&&(h.type=m.LINE_TO,h.x=h.relative?v-f:v,h.y=h.relative?d-c:d),h.type&m.ARC&&(h.rX===0||h.rY===0)&&(h.type=m.LINE_TO,delete h.rX,delete h.rY,delete h.xRot,delete h.lArcFlag,delete h.sweepFlag),h})},a.NORMALIZE_ST=t,a.QT_TO_C=r,a.INFO=i,a.SANITIZE=function(s){s===void 0&&(s=0),oe(s);var u=NaN,l=NaN,h=NaN,f=NaN;return i(function(c,v,d,g,p){var y=Math.abs,x=!1,b=0,T=0;if(c.type&m.SMOOTH_CURVE_TO&&(b=isNaN(u)?0:v-u,T=isNaN(l)?0:d-l),c.type&(m.CURVE_TO|m.SMOOTH_CURVE_TO)?(u=c.relative?v+c.x2:c.x2,l=c.relative?d+c.y2:c.y2):(u=NaN,l=NaN),c.type&m.SMOOTH_QUAD_TO?(h=isNaN(h)?v:2*v-h,f=isNaN(f)?d:2*d-f):c.type&m.QUAD_TO?(h=c.relative?v+c.x1:c.x1,f=c.relative?d+c.y1:c.y2):(h=NaN,f=NaN),c.type&m.LINE_COMMANDS||c.type&m.ARC&&(c.rX===0||c.rY===0||!c.lArcFlag)||c.type&m.CURVE_TO||c.type&m.SMOOTH_CURVE_TO||c.type&m.QUAD_TO||c.type&m.SMOOTH_QUAD_TO){var $=c.x===void 0?0:c.relative?c.x:c.x-v,E=c.y===void 0?0:c.relative?c.y:c.y-d;b=isNaN(h)?c.x1===void 0?b:c.relative?c.x:c.x1-v:h-v,T=isNaN(f)?c.y1===void 0?T:c.relative?c.y:c.y1-d:f-d;var S=c.x2===void 0?0:c.relative?c.x:c.x2-v,C=c.y2===void 0?0:c.relative?c.y:c.y2-d;y($)<=s&&y(E)<=s&&y(b)<=s&&y(T)<=s&&y(S)<=s&&y(C)<=s&&(x=!0)}return c.type&m.CLOSE_PATH&&y(v-g)<=s&&y(d-p)<=s&&(x=!0),x?[]:c})},a.MATRIX=n,a.ROTATE=function(s,u,l){u===void 0&&(u=0),l===void 0&&(l=0),oe(s,u,l);var h=Math.sin(s),f=Math.cos(s);return n(f,h,-h,f,u-u*f+l*h,l-u*h-l*f)},a.TRANSLATE=function(s,u){return u===void 0&&(u=0),oe(s,u),n(1,0,0,1,s,u)},a.SCALE=function(s,u){return u===void 0&&(u=s),oe(s,u),n(s,0,0,u,0,0)},a.SKEW_X=function(s){return oe(s),n(1,0,Math.atan(s),1,0,0)},a.SKEW_Y=function(s){return oe(s),n(1,Math.atan(s),0,1,0,0)},a.X_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),oe(s),n(-1,0,0,1,s,0)},a.Y_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),oe(s),n(1,0,0,-1,0,s)},a.A_TO_C=function(){return i(function(s,u,l){return m.ARC===s.type?function(h,f,c){var v,d,g,p;h.cX||za(h,f,c);for(var y=Math.min(h.phi1,h.phi2),x=Math.max(h.phi1,h.phi2)-y,b=Math.ceil(x/90),T=new Array(b),$=f,E=c,S=0;Sf.maxX&&(f.maxX=M),Mf.maxY&&(f.maxY=M),MR&&p(yo(v,g.x1,g.x2,g.x,R));for(var T=0,$=po(d,g.y1,g.y2,g.y);T<$.length;T++)0<(R=$[T])&&1>R&&y(yo(d,g.y1,g.y2,g.y,R))}if(g.type&m.ARC){p(g.x),y(g.y),za(g,v,d);for(var E=g.xRot/180*Math.PI,S=Math.cos(E)*g.rX,C=Math.sin(E)*g.rX,N=-Math.sin(E)*g.rY,_=Math.cos(E)*g.rY,B=g.phi1g.phi2?[g.phi2+360,g.phi1+360]:[g.phi2,g.phi1],P=B[0],X=B[1],W=function(M){var Z=M[0],ne=M[1],ve=180*Math.atan2(ne,Z)/Math.PI;return veP&&RP&&Rh)throw new SyntaxError('Expected positive number, got "'+h+'" 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(h),this.curArgs.length===jb[this.curCommandType]&&(m.HORIZ_LINE_TO===this.curCommandType?n({type:m.HORIZ_LINE_TO,relative:this.curCommandRelative,x:h}):m.VERT_LINE_TO===this.curCommandType?n({type:m.VERT_LINE_TO,relative:this.curCommandRelative,y:h}):this.curCommandType===m.MOVE_TO||this.curCommandType===m.LINE_TO||this.curCommandType===m.SMOOTH_QUAD_TO?(n({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),m.MOVE_TO===this.curCommandType&&(this.curCommandType=m.LINE_TO)):this.curCommandType===m.CURVE_TO?n({type:m.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===m.SMOOTH_CURVE_TO?n({type:m.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===m.QUAD_TO?n({type:m.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===m.ARC&&n({type:m.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!Bb(s))if(s===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(s!=="+"&&s!=="-"&&s!==".")if(l)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=m.HORIZ_LINE_TO,this.curCommandRelative=s==="h";else if(s==="v"||s==="V")this.curCommandType=m.VERT_LINE_TO,this.curCommandRelative=s==="v";else if(s==="m"||s==="M")this.curCommandType=m.MOVE_TO,this.curCommandRelative=s==="m";else if(s==="l"||s==="L")this.curCommandType=m.LINE_TO,this.curCommandRelative=s==="l";else if(s==="c"||s==="C")this.curCommandType=m.CURVE_TO,this.curCommandRelative=s==="c";else if(s==="s"||s==="S")this.curCommandType=m.SMOOTH_CURVE_TO,this.curCommandRelative=s==="s";else if(s==="q"||s==="Q")this.curCommandType=m.QUAD_TO,this.curCommandRelative=s==="q";else if(s==="t"||s==="T")this.curCommandType=m.SMOOTH_QUAD_TO,this.curCommandRelative=s==="t";else{if(s!=="a"&&s!=="A")throw new SyntaxError('Unexpected character "'+s+'" at index '+o+".");this.curCommandType=m.ARC,this.curCommandRelative=s==="a"}else r.push({type:m.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=s,this.curNumberHasDecimal=s==="."}else this.curNumber+=s,this.curNumberHasDecimal=!0;else this.curNumber+=s;else this.curNumber+=s,this.curNumberHasExp=!0;else this.curNumber+=s,this.curNumberHasExpDigits=this.curNumberHasExp}return r},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(r,i){i===void 0&&(i=[]);for(var n=0,o=Object.getPrototypeOf(this).parse.call(this,r);n>$;if(o[b+3]=Ur,Ur!==0){var zr=255/Ur;o[b]=(M*T>>$)*zr,o[b+1]=(Z*T>>$)*zr,o[b+2]=(ne*T>>$)*zr}else o[b]=o[b+1]=o[b+2]=0;M-=q,Z-=H,ne-=Q,ve-=R,q-=p.r,H-=p.g,Q-=p.b,R-=p.a;var Ae=jr+n+1;Ae=x+(Ae>$,te>0?(te=255/te,o[re]=(Bt*T>>$)*te,o[re+1]=(Ft*T>>$)*te,o[re+2]=(jt*T>>$)*te):o[re]=o[re+1]=o[re+2]=0,Bt-=Gr,Ft-=Hr,jt-=Yr,Ut-=Xr,Gr-=p.r,Hr-=p.g,Yr-=p.b,Xr-=p.a,re=Ye+((re=Zr+h)0&&arguments[0]!==void 0?arguments[0]:{},e={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:a,createCanvas(t,r){return new OffscreenCanvas(t,r)},createImage(t){return xe(function*(){var r=yield fetch(t),i=yield r.blob(),n=yield createImageBitmap(i);return n})()}};return(typeof DOMParser<"u"||typeof a>"u")&&Reflect.deleteProperty(e,"DOMParser"),e}function u1(a){var{DOMParser:e,canvas:t,fetch:r}=a;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:r,createCanvas:t.createCanvas,createImage:t.loadImage}}var x2=Object.freeze({__proto__:null,offscreen:o1,node:u1});function ft(a){return a.replace(/(?!\u3000)\s+/gm," ")}function l1(a){return a.replace(/^[\n \t]+/,"")}function h1(a){return a.replace(/[\n \t]+$/,"")}function ie(a){var e=(a||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return e.map(parseFloat)}var v1=/^[A-Z-]+$/;function f1(a){return v1.test(a)?a.toLowerCase():a}function bl(a){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(a)||[];return e[2]||e[3]||e[4]}function c1(a){if(!a.startsWith("rgb"))return a;var e=3,t=a.replace(/\d+(\.\d+)?/g,(r,i)=>e--&&i?String(Math.round(parseFloat(r))):r);return t}var g1=/(\[[^\]]+\])/g,d1=/(#[^\s+>~.[:]+)/g,p1=/(\.[^\s+>~.[:]+)/g,y1=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,m1=/(:[\w-]+\([^)]*\))/gi,b1=/(:[^\s+>~.[:]+)/g,x1=/([^\s+>~.[:]+)/g;function _e(a,e){var t=e.exec(a);return t?[a.replace(e," "),t.length]:[a,0]}function T1(a){var e=[0,0,0],t=a.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[t,r]=_e(t,g1),e[1]+=r,[t,r]=_e(t,d1),e[0]+=r,[t,r]=_e(t,p1),e[1]+=r,[t,r]=_e(t,y1),e[2]+=r,[t,r]=_e(t,m1),e[1]+=r,[t,r]=_e(t,b1),e[1]+=r,t=t.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[t,r]=_e(t,x1),e[2]+=r,e.join("")}var nt=1e-8;function So(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2))}function Ti(a,e){return(a[0]*e[0]+a[1]*e[1])/(So(a)*So(e))}function Oo(a,e){return(a[0]*e[1]0&&arguments[0]!==void 0?arguments[0]:" ",{document:t,name:r}=this;return ft(this.getString()).trim().split(e).map(i=>new O(t,r,i))}hasValue(e){var{value:t}=this;return t!==null&&t!==""&&(e||t!==0)&&typeof t<"u"}isString(e){var{value:t}=this,r=typeof t=="string";return!r||!e?r:e.test(t)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e>"u"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e>"u"?0:parseFloat(e);var{value:t}=this,r=parseFloat(t);return this.isString(/%$/)&&(r/=100),r}getString(e){return typeof e>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(e)}getColor(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=c1(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;var[r,i]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:n}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(n.computeSize("x"),n.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(n.computeSize("x"),n.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*n.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*n.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&i):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*n.computeSize(r);default:{var o=this.getNumber();return t&&o<1?o*n.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 e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}getFillStyleDefinition(e,t){var r=this.getDefinition();if(!r)return null;if(typeof r.createGradient=="function")return r.createGradient(this.document.ctx,e,t);if(typeof r.createPattern=="function"){if(r.getHrefAttribute().hasValue()){var i=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),i.hasValue()&&r.getAttribute("patternTransform",!0).setValue(i.value)}return r.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){return this.hasValue()?O.textBaselineMapping[this.getString()]:null}addOpacity(e){for(var t=this.getColor(),r=t.length,i=0,n=0;n1&&arguments[1]!==void 0?arguments[1]:0,[r=t,i=t]=ie(e);return new V(r,i)}static parseScale(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[r=t,i=r]=ie(e);return new V(r,i)}static parsePath(e){for(var t=ie(e),r=t.length,i=[],n=0;n0}runEvents(){if(this.working){var{screen:e,events:t,eventElements:r}=this,{style:i}=e.ctx.canvas;i&&(i.cursor=""),t.forEach((n,o)=>{for(var{run:s}=n,u=r[o];u;)s(u),u=u.parent}),this.events=[],this.eventElements=[]}}checkPath(e,t){if(!(!this.working||!t)){var{events:r,eventElements:i}=this;r.forEach((n,o)=>{var{x:s,y:u}=n;!i[o]&&t.isPointInPath&&t.isPointInPath(s,u)&&(i[o]=e)})}}checkBoundingBox(e,t){if(!(!this.working||!t)){var{events:r,eventElements:i}=this;r.forEach((n,o)=>{var{x:s,y:u}=n;!i[o]&&t.isPointInBox(s,u)&&(i[o]=e)})}}mapXY(e,t){for(var{window:r,ctx:i}=this.screen,n=new V(e,t),o=i.canvas;o;)n.x-=o.offsetLeft,n.y-=o.offsetTop,o=o.offsetParent;return r.scrollX&&(n.x+=r.scrollX),r.scrollY&&(n.y+=r.scrollY),n}onClick(e){var{x:t,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:r,run(i){i.onClick&&i.onClick()}})}onMouseMove(e){var{x:t,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:r,run(i){i.onMouseMove&&i.onMouseMove()}})}}var xl=typeof window<"u"?window:null,Tl=typeof fetch<"u"?fetch.bind(void 0):null;class Lr{constructor(e){var{fetch:t=Tl,window:r=xl}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new S1,this.mouse=new O1(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=r,this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every(t=>t());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){var{document:t,ctx:r,aspectRatio:i,width:n,desiredWidth:o,height:s,desiredHeight:u,minX:l=0,minY:h=0,refX:f,refY:c,clip:v=!1,clipX:d=0,clipY:g=0}=e,p=ft(i).replace(/^defer\s/,""),[y,x]=p.split(" "),b=y||"xMidYMid",T=x||"meet",$=n/o,E=s/u,S=Math.min($,E),C=Math.max($,E),N=o,_=u;T==="meet"&&(N*=S,_*=S),T==="slice"&&(N*=C,_*=C);var B=new O(t,"refX",f),P=new O(t,"refY",c),X=B.hasValue()&&P.hasValue();if(X&&r.translate(-S*B.getPixels("x"),-S*P.getPixels("y")),v){var W=S*d,z=S*g;r.beginPath(),r.moveTo(W,z),r.lineTo(n,z),r.lineTo(n,s),r.lineTo(W,s),r.closePath(),r.clip()}if(!X){var q=T==="meet"&&S===E,H=T==="slice"&&C===E,Q=T==="meet"&&S===$,R=T==="slice"&&C===$;b.startsWith("xMid")&&(q||H)&&r.translate(n/2-N/2,0),b.endsWith("YMid")&&(Q||R)&&r.translate(0,s/2-_/2),b.startsWith("xMax")&&(q||H)&&r.translate(n-N,0),b.endsWith("YMax")&&(Q||R)&&r.translate(0,s-_)}switch(!0){case b==="none":r.scale($,E);break;case T==="meet":r.scale(S,S);break;case T==="slice":r.scale(C,C);break}r.translate(-l,-h)}start(e){var{enableRedraw:t=!1,ignoreMouse:r=!1,ignoreAnimation:i=!1,ignoreDimensions:n=!1,ignoreClear:o=!1,forceRedraw:s,scaleWidth:u,scaleHeight:l,offsetX:h,offsetY:f}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:c,mouse:v}=this,d=1e3/c;if(this.frameDuration=d,this.readyPromise=new Promise(b=>{this.resolveReady=b}),this.isReady()&&this.render(e,n,o,u,l,h,f),!!t){var g=Date.now(),p=g,y=0,x=()=>{g=Date.now(),y=g-p,y>=d&&(p=g-y%d,this.shouldUpdate(i,s)&&(this.render(e,n,o,u,l,h,f),v.runEvents())),this.intervalId=ja(x)};r||v.start(),this.intervalId=ja(x)}}stop(){this.intervalId&&(ja.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){var{frameDuration:r}=this,i=this.animations.reduce((n,o)=>o.update(r)||n,!1);if(i)return!0}return!!(typeof t=="function"&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,r,i,n,o,s){var{CLIENT_WIDTH:u,CLIENT_HEIGHT:l,viewPort:h,ctx:f,isFirstRender:c}=this,v=f.canvas;h.clear(),v.width&&v.height?h.setCurrent(v.width,v.height):h.setCurrent(u,l);var d=e.getStyle("width"),g=e.getStyle("height");!t&&(c||typeof i!="number"&&typeof n!="number")&&(d.hasValue()&&(v.width=d.getPixels("x"),v.style&&(v.style.width="".concat(v.width,"px"))),g.hasValue()&&(v.height=g.getPixels("y"),v.style&&(v.style.height="".concat(v.height,"px"))));var p=v.clientWidth||v.width,y=v.clientHeight||v.height;if(t&&d.hasValue()&&g.hasValue()&&(p=d.getPixels("x"),y=g.getPixels("y")),h.setCurrent(p,y),typeof o=="number"&&e.getAttribute("x",!0).setValue(o),typeof s=="number"&&e.getAttribute("y",!0).setValue(s),typeof i=="number"||typeof n=="number"){var x=ie(e.getAttribute("viewBox").getString()),b=0,T=0;if(typeof i=="number"){var $=e.getStyle("width");$.hasValue()?b=$.getPixels("x")/i:isNaN(x[2])||(b=x[2]/i)}if(typeof n=="number"){var E=e.getStyle("height");E.hasValue()?T=E.getPixels("y")/n:isNaN(x[3])||(T=x[3]/n)}b||(b=T),T||(T=b),e.getAttribute("width",!0).setValue(i),e.getAttribute("height",!0).setValue(n);var S=e.getStyle("transform",!0,!0);S.setValue("".concat(S.getString()," scale(").concat(1/b,", ").concat(1/T,")"))}r||f.clearRect(0,0,p,y),e.render(f),c&&(this.isFirstRender=!1)}}Lr.defaultWindow=xl;Lr.defaultFetch=Tl;var{defaultFetch:E1}=Lr,$1=typeof DOMParser<"u"?DOMParser:null;class Ga{constructor(){var{fetch:e=E1,DOMParser:t=$1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=e,this.DOMParser=t}parse(e){var t=this;return xe(function*(){return e.startsWith("<")?t.parseFromString(e):t.load(e)})()}parseFromString(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent);return e}load(e){var t=this;return xe(function*(){var r=yield t.fetch(e),i=yield r.text();return t.parseFromString(i)})()}}class w1{constructor(e,t){this.type="translate",this.point=null,this.point=V.parse(t)}apply(e){var{x:t,y:r}=this.point;e.translate(t||0,r||0)}unapply(e){var{x:t,y:r}=this.point;e.translate(-1*t||0,-1*r||0)}applyToPoint(e){var{x:t,y:r}=this.point;e.applyTransform([1,0,0,1,t||0,r||0])}}class C1{constructor(e,t,r){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var i=ie(t);this.angle=new O(e,"angle",i[0]),this.originX=r[0],this.originY=r[1],this.cx=i[1]||0,this.cy=i[2]||0}apply(e){var{cx:t,cy:r,originX:i,originY:n,angle:o}=this,s=t+i.getPixels("x"),u=r+n.getPixels("y");e.translate(s,u),e.rotate(o.getRadians()),e.translate(-s,-u)}unapply(e){var{cx:t,cy:r,originX:i,originY:n,angle:o}=this,s=t+i.getPixels("x"),u=r+n.getPixels("y");e.translate(s,u),e.rotate(-1*o.getRadians()),e.translate(-s,-u)}applyToPoint(e){var{cx:t,cy:r,angle:i}=this,n=i.getRadians();e.applyTransform([1,0,0,1,t||0,r||0]),e.applyTransform([Math.cos(n),Math.sin(n),-Math.sin(n),Math.cos(n),0,0]),e.applyTransform([1,0,0,1,-t||0,-r||0])}}class A1{constructor(e,t,r){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var i=V.parseScale(t);(i.x===0||i.y===0)&&(i.x=nt,i.y=nt),this.scale=i,this.originX=r[0],this.originY=r[1]}apply(e){var{scale:{x:t,y:r},originX:i,originY:n}=this,o=i.getPixels("x"),s=n.getPixels("y");e.translate(o,s),e.scale(t,r||t),e.translate(-o,-s)}unapply(e){var{scale:{x:t,y:r},originX:i,originY:n}=this,o=i.getPixels("x"),s=n.getPixels("y");e.translate(o,s),e.scale(1/t,1/r||t),e.translate(-o,-s)}applyToPoint(e){var{x:t,y:r}=this.scale;e.applyTransform([t||0,0,0,r||0,0,0])}}class Sl{constructor(e,t,r){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=ie(t),this.originX=r[0],this.originY=r[1]}apply(e){var{originX:t,originY:r,matrix:i}=this,n=t.getPixels("x"),o=r.getPixels("y");e.translate(n,o),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.translate(-n,-o)}unapply(e){var{originX:t,originY:r,matrix:i}=this,n=i[0],o=i[2],s=i[4],u=i[1],l=i[3],h=i[5],f=0,c=0,v=1,d=1/(n*(l*v-h*c)-o*(u*v-h*f)+s*(u*c-l*f)),g=t.getPixels("x"),p=r.getPixels("y");e.translate(g,p),e.transform(d*(l*v-h*c),d*(h*f-u*v),d*(s*c-o*v),d*(n*v-s*f),d*(o*h-s*l),d*(s*u-n*h)),e.translate(-g,-p)}applyToPoint(e){e.applyTransform(this.matrix)}}class Ol extends Sl{constructor(e,t,r){super(e,t,r),this.type="skew",this.angle=null,this.angle=new O(e,"angle",t)}}class P1 extends Ol{constructor(e,t,r){super(e,t,r),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class R1 extends Ol{constructor(e,t,r){super(e,t,r),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function I1(a){return ft(a).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function N1(a){var[e,t]=a.split("(");return[e.trim(),t.trim().replace(")","")]}class Be{constructor(e,t,r){this.document=e,this.transforms=[];var i=I1(t);i.forEach(n=>{if(n!=="none"){var[o,s]=N1(n),u=Be.transformTypes[o];typeof u<"u"&&this.transforms.push(new u(this.document,s,r))}})}static fromElement(e,t){var r=t.getStyle("transform",!1,!0),[i,n=i]=t.getStyle("transform-origin",!1,!0).split(),o=[i,n];return r.hasValue()?new Be(e,r.getString(),o):null}apply(e){for(var{transforms:t}=this,r=t.length,i=0;i=0;i--)t[i].unapply(e)}applyToPoint(e){for(var{transforms:t}=this,r=t.length,i=0;i2&&arguments[2]!==void 0?arguments[2]:!1;if(this.document=e,this.node=t,this.captureTextNodes=r,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!(!t||t.nodeType!==1)){if(Array.from(t.attributes).forEach(s=>{var u=f1(s.nodeName);this.attributes[u]=new O(e,u,s.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var i=this.getAttribute("style").getString().split(";").map(s=>s.trim());i.forEach(s=>{if(s){var[u,l]=s.split(":").map(h=>h.trim());this.styles[u]=new O(e,u,l)}})}var{definitions:n}=e,o=this.getAttribute("id");o.hasValue()&&(n[o.getString()]||(n[o.getString()]=this)),Array.from(t.childNodes).forEach(s=>{if(s.nodeType===1)this.addChild(s);else if(r&&(s.nodeType===3||s.nodeType===4)){var u=e.createTextNode(s);u.getText().length>0&&this.addChild(u)}})}}getAttribute(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.attributes[e];if(!r&&t){var i=new O(this.document,e,"");return this.attributes[e]=i,i}return r||O.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if(e==="href"||e.endsWith(":href"))return this.attributes[e];return O.empty(this.document)}getStyle(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.styles[e];if(i)return i;var n=this.getAttribute(e);if(n!=null&&n.hasValue())return this.styles[e]=n,n;if(!r){var{parent:o}=this;if(o){var s=o.getStyle(e);if(s!=null&&s.hasValue())return s}}if(t){var u=new O(this.document,e,"");return this.styles[e]=u,u}return i||O.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(e),r.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){var t=Be.fromElement(this.document,this);t&&t.apply(e);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var i=r.getDefinition();i&&i.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){var t=e instanceof I?e:this.document.createElement(e);t.parent=this,I.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){var t,{node:r}=this;if(typeof r.matches=="function")return r.matches(e);var i=(t=r.getAttribute)===null||t===void 0?void 0:t.call(r,"class");return!i||i===""?!1:i.split(" ").some(n=>".".concat(n)===e)}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:t}=this.document;for(var r in e)if(!r.startsWith("@")&&this.matchesSelector(r)){var i=e[r],n=t[r];if(i)for(var o in i){var s=this.stylesSpecificity[o];typeof s>"u"&&(s="000"),n>=s&&(this.styles[o]=i[o],this.stylesSpecificity[o]=n)}}}removeStyles(e,t){var r=t.reduce((i,n)=>{var o=e.getStyle(n);if(!o.hasValue())return i;var s=o.getString();return o.setValue(""),[...i,[n,s]]},[]);return r}restoreStyles(e,t){t.forEach(r=>{var[i,n]=r;e.getStyle(i,!0).setValue(n)})}isFirstChild(){var e;return((e=this.parent)===null||e===void 0?void 0:e.children.indexOf(this))===0}}I.ignoreChildTypes=["title"];class M1 extends I{constructor(e,t,r){super(e,t,r)}}function _1(a){var e=a.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function D1(a){return typeof process>"u"?a:a.trim().split(",").map(_1).join(",")}function V1(a){if(!a)return"";var e=a.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function L1(a){if(!a)return"";var e=a.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class J{constructor(e,t,r,i,n,o){var s=o?typeof o=="string"?J.parse(o):o:{};this.fontFamily=n||s.fontFamily,this.fontSize=i||s.fontSize,this.fontStyle=e||s.fontStyle,this.fontWeight=r||s.fontWeight,this.fontVariant=t||s.fontVariant}static parse(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r="",i="",n="",o="",s="",u=ft(e).trim().split(" "),l={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return u.forEach(h=>{switch(!0){case(!l.fontStyle&&J.styles.includes(h)):h!=="inherit"&&(r=h),l.fontStyle=!0;break;case(!l.fontVariant&&J.variants.includes(h)):h!=="inherit"&&(i=h),l.fontStyle=!0,l.fontVariant=!0;break;case(!l.fontWeight&&J.weights.includes(h)):h!=="inherit"&&(n=h),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0;break;case!l.fontSize:h!=="inherit"&&([o]=h.split("/")),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0,l.fontSize=!0;break;default:h!=="inherit"&&(s+=h)}}),new J(r,i,n,o,s,t)}toString(){return[V1(this.fontStyle),this.fontVariant,L1(this.fontWeight),this.fontSize,D1(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 he{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.NaN,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.NaN,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Number.NaN,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Number.NaN;this.x1=e,this.y1=t,this.x2=r,this.y2=i,this.addPoint(e,t),this.addPoint(r,i)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){typeof e<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),ethis.x2&&(this.x2=e)),typeof t<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(e){var{x1:t,y1:r,x2:i,y2:n}=e;this.addPoint(t,r),this.addPoint(i,n)}}sumCubic(e,t,r,i,n){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*r+3*(1-e)*Math.pow(e,2)*i+Math.pow(e,3)*n}bezierCurveAdd(e,t,r,i,n){var o=6*t-12*r+6*i,s=-3*t+9*r-9*i+3*n,u=3*r-3*t;if(s===0){if(o===0)return;var l=-u/o;0=t.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y",r=new V(this.command[e],this.command[t]);return this.makeAbsolute(r)}getAsControlPoint(e,t){var r=this.getPoint(e,t);return this.control=r,r}getAsCurrentPoint(e,t){var r=this.getPoint(e,t);return this.current=r,r}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==m.CURVE_TO&&e!==m.SMOOTH_CURVE_TO&&e!==m.QUAD_TO&&e!==m.SMOOTH_QUAD_TO)return this.current;var{current:{x:t,y:r},control:{x:i,y:n}}=this,o=new V(2*t-i,2*r-n);return o}makeAbsolute(e){if(this.command.relative){var{x:t,y:r}=this.current;e.x+=t,e.y+=r}return e}addMarker(e,t,r){var{points:i,angles:n}=this;r&&n.length>0&&!n[n.length-1]&&(n[n.length-1]=i[i.length-1].angleTo(r)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,t=e.length,r=0;r1&&arguments[1]!==void 0?arguments[1]:!1;if(!t){var r=this.getStyle("fill"),i=this.getStyle("fill-opacity"),n=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,i);s&&(e.fillStyle=s)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());var u=r.getColor();u!=="inherit"&&(e.fillStyle=u==="none"?"rgba(0,0,0,0)":u)}if(i.hasValue()){var l=new O(this.document,"fill",e.fillStyle).addOpacity(i).getColor();e.fillStyle=l}if(n.isUrlDefinition()){var h=n.getFillStyleDefinition(this,o);h&&(e.strokeStyle=h)}else if(n.hasValue()){n.getString()==="currentColor"&&n.setValue(this.getStyle("color").getColor());var f=n.getString();f!=="inherit"&&(e.strokeStyle=f==="none"?"rgba(0,0,0,0)":f)}if(o.hasValue()){var c=new O(this.document,"stroke",e.strokeStyle).addOpacity(o).getString();e.strokeStyle=c}var v=this.getStyle("stroke-width");if(v.hasValue()){var d=v.getPixels();e.lineWidth=d||nt}var g=this.getStyle("stroke-linecap"),p=this.getStyle("stroke-linejoin"),y=this.getStyle("stroke-miterlimit"),x=this.getStyle("stroke-dasharray"),b=this.getStyle("stroke-dashoffset");if(g.hasValue()&&(e.lineCap=g.getString()),p.hasValue()&&(e.lineJoin=p.getString()),y.hasValue()&&(e.miterLimit=y.getNumber()),x.hasValue()&&x.getString()!=="none"){var T=ie(x.getString());typeof e.setLineDash<"u"?e.setLineDash(T):typeof e.webkitLineDash<"u"?e.webkitLineDash=T:typeof e.mozDash<"u"&&!(T.length===1&&T[0]===0)&&(e.mozDash=T);var $=b.getPixels();typeof e.lineDashOffset<"u"?e.lineDashOffset=$:typeof e.webkitLineDashOffset<"u"?e.webkitLineDashOffset=$:typeof e.mozDashOffset<"u"&&(e.mozDashOffset=$)}}if(this.modifiedEmSizeStack=!1,typeof e.font<"u"){var E=this.getStyle("font"),S=this.getStyle("font-style"),C=this.getStyle("font-variant"),N=this.getStyle("font-weight"),_=this.getStyle("font-size"),B=this.getStyle("font-family"),P=new J(S.getString(),C.getString(),N.getString(),_.hasValue()?"".concat(_.getPixels(!0),"px"):"",B.getString(),J.parse(E.getString(),e.font));S.setValue(P.fontStyle),C.setValue(P.fontVariant),N.setValue(P.fontWeight),_.setValue(P.fontSize),B.setValue(P.fontFamily),e.font=P.toString(),_.isPixels()&&(this.document.emSize=_.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class A extends Ge{constructor(e,t,r){super(e,t,r),this.type="path",this.pathParser=null,this.pathParser=new w(this.getAttribute("d").getString())}path(e){var{pathParser:t}=this,r=new he;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case w.MOVE_TO:this.pathM(e,r);break;case w.LINE_TO:this.pathL(e,r);break;case w.HORIZ_LINE_TO:this.pathH(e,r);break;case w.VERT_LINE_TO:this.pathV(e,r);break;case w.CURVE_TO:this.pathC(e,r);break;case w.SMOOTH_CURVE_TO:this.pathS(e,r);break;case w.QUAD_TO:this.pathQ(e,r);break;case w.SMOOTH_QUAD_TO:this.pathT(e,r);break;case w.ARC:this.pathA(e,r);break;case w.CLOSE_PATH:this.pathZ(e,r);break}return r}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,t=e.getMarkerPoints(),r=e.getMarkerAngles(),i=t.map((n,o)=>[n,r[o]]);return i}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle("fill-rule");e.fillStyle!==""&&(t.getString("inherit")!=="inherit"?e.fill(t.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var r=this.getMarkers();if(r){var i=r.length-1,n=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(n.isUrlDefinition()){var u=n.getDefinition(),[l,h]=r[0];u.render(e,l,h)}if(o.isUrlDefinition())for(var f=o.getDefinition(),c=1;c1&&(i*=Math.sqrt(c),n*=Math.sqrt(c));var v=(s===u?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(n,2)-Math.pow(i,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(i,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2)));isNaN(v)&&(v=0);var d=new V(v*i*f.y/n,v*-n*f.x/i),g=new V((t.x+h.x)/2+Math.cos(l)*d.x-Math.sin(l)*d.y,(t.y+h.y)/2+Math.sin(l)*d.x+Math.cos(l)*d.y),p=Oo([1,0],[(f.x-d.x)/i,(f.y-d.y)/n]),y=[(f.x-d.x)/i,(f.y-d.y)/n],x=[(-f.x-d.x)/i,(-f.y-d.y)/n],b=Oo(y,x);return Ti(y,x)<=-1&&(b=Math.PI),Ti(y,x)>=1&&(b=0),{currentPoint:h,rX:i,rY:n,sweepFlag:u,xAxisRotation:l,centp:g,a1:p,ad:b}}pathA(e,t){var{pathParser:r}=this,{currentPoint:i,rX:n,rY:o,sweepFlag:s,xAxisRotation:u,centp:l,a1:h,ad:f}=A.pathA(r),c=1-s?1:-1,v=h+c*(f/2),d=new V(l.x+n*Math.cos(v),l.y+o*Math.sin(v));if(r.addMarkerAngle(d,v-c*Math.PI/2),r.addMarkerAngle(i,v-c*Math.PI),t.addPoint(i.x,i.y),e&&!isNaN(h)&&!isNaN(f)){var g=n>o?n:o,p=n>o?1:n/o,y=n>o?o/n:1;e.translate(l.x,l.y),e.rotate(u),e.scale(p,y),e.arc(0,0,g,h,h+f,!!(1-s)),e.scale(1/p,1/y),e.rotate(-u),e.translate(-l.x,-l.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){A.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}class El extends A{constructor(e,t,r){super(e,t,r),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class Ce extends Ge{constructor(e,t,r){super(e,t,new.target===Ce?!0:r),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(e,t);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(e.textBaseline=r)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var t=null;return this.children.forEach((r,i)=>{var n=this.getChildBoundingBox(e,this,this,i);t?t.addBoundingBox(n):t=n}),t}getFontSize(){var{document:e,parent:t}=this,r=J.parse(e.ctx.font).fontSize,i=t.getStyle("font-size").getNumber(r);return i}getTElementBoundingBox(e){var t=this.getFontSize();return new he(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,r){var i=t[r],n=null;if(e.isArabic){var o=t.length,s=t[r-1],u=t[r+1],l="isolated";if((r===0||s===" ")&&r0&&s!==" "&&r0&&s!==" "&&(r===o-1||u===" ")&&(l="initial"),typeof e.glyphs[i]<"u"){var h=e.glyphs[i];n=h instanceof El?h:h[l]}}else n=e.glyphs[i];return n||(n=e.missingGlyph),n}getText(){return""}getTextFromNode(e){var t=e||this.node,r=Array.from(t.parentNode.childNodes),i=r.indexOf(t),n=r.length-1,o=ft(t.textContent||"");return i===0&&(o=l1(o)),i===n&&(o=h1(o)),o}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((r,i)=>{this.renderChild(e,this,this,i)});var{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){var{document:t,parent:r}=this,i=this.getText(),n=r.getStyle("font-family").getDefinition();if(n){for(var{unitsPerEm:o}=n.fontFace,s=J.parse(t.ctx.font),u=r.getStyle("font-size").getNumber(s.fontSize),l=r.getStyle("font-style").getString(s.fontStyle),h=u/o,f=n.isRTL?i.split("").reverse().join(""):i,c=ie(r.getAttribute("dx").getString()),v=f.length,d=0;d=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),r=!1,i=0;t==="start"&&!r||t==="end"&&r?i=e.x-this.minX:t==="end"&&!r||t==="start"&&r?i=e.x-this.maxX:i=e.x-(this.minX+this.maxX)/2;for(var n=this.textChunkStart;n{this.adjustChildCoordinatesRecursiveCore(e,this,this,r)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,r,i){var n=r.children[i];n.children.length>0?n.children.forEach((o,s)=>{t.adjustChildCoordinatesRecursiveCore(e,t,n,s)}):this.adjustChildCoordinates(e,t,r,i)}adjustChildCoordinates(e,t,r,i){var n=r.children[i];if(typeof n.measureText!="function")return n;e.save(),n.setContext(e,!0);var o=n.getAttribute("x"),s=n.getAttribute("y"),u=n.getAttribute("dx"),l=n.getAttribute("dy"),h=n.getStyle("font-family").getDefinition(),f=!!h&&h.isRTL;i===0&&(o.hasValue()||o.setValue(n.getInheritedAttribute("x")),s.hasValue()||s.setValue(n.getInheritedAttribute("y")),u.hasValue()||u.setValue(n.getInheritedAttribute("dx")),l.hasValue()||l.setValue(n.getInheritedAttribute("dy")));var c=n.measureText(e);return f&&(t.x-=c),o.hasValue()?(t.applyAnchoring(),n.x=o.getPixels("x"),u.hasValue()&&(n.x+=u.getPixels("x"))):(u.hasValue()&&(t.x+=u.getPixels("x")),n.x=t.x),t.x=n.x,f||(t.x+=c),s.hasValue()?(n.y=s.getPixels("y"),l.hasValue()&&(n.y+=l.getPixels("y"))):(l.hasValue()&&(t.y+=l.getPixels("y")),n.y=t.y),t.y=n.y,t.leafTexts.push(n),t.minX=Math.min(t.minX,n.x,n.x+c),t.maxX=Math.max(t.maxX,n.x,n.x+c),n.clearContext(e),e.restore(),n}getChildBoundingBox(e,t,r,i){var n=r.children[i];if(typeof n.getBoundingBox!="function")return null;var o=n.getBoundingBox(e);return o?(n.children.forEach((s,u)=>{var l=t.getChildBoundingBox(e,t,n,u);o.addBoundingBox(l)}),o):null}renderChild(e,t,r,i){var n=r.children[i];n.render(e),n.children.forEach((o,s)=>{t.renderChild(e,t,n,s)})}measureText(e){var{measureCache:t}=this;if(~t)return t;var r=this.getText(),i=this.measureTargetText(e,r);return this.measureCache=i,i}measureTargetText(e,t){if(!t.length)return 0;var{parent:r}=this,i=r.getStyle("font-family").getDefinition();if(i){for(var n=this.getFontSize(),o=i.isRTL?t.split("").reverse().join(""):t,s=ie(r.getAttribute("dx").getString()),u=o.length,l=0,h=0;h0?"":this.getTextFromNode()}getText(){return this.text}}class k1 extends kr{constructor(){super(...arguments),this.type="textNode"}}class Dt extends Ge{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(e){var t,{document:r}=this,{screen:i,window:n}=r,o=e.canvas;if(i.setDefaults(e),o.style&&typeof e.font<"u"&&n&&typeof n.getComputedStyle<"u"){e.font=n.getComputedStyle(o).getPropertyValue("font");var s=new O(r,"fontSize",J.parse(e.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:u,height:l}=i.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var h=this.getAttribute("refX"),f=this.getAttribute("refY"),c=this.getAttribute("viewBox"),v=c.hasValue()?ie(c.getString()):null,d=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible",g=0,p=0,y=0,x=0;v&&(g=v[0],p=v[1]),this.root||(u=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y"),this.type==="marker"&&(y=g,x=p,g=0,p=0)),i.viewPort.setCurrent(u,l),this.node&&(!this.parent||((t=this.node.parentNode)===null||t===void 0?void 0:t.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),v&&(u=v[2],l=v[3]),r.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:u,height:i.viewPort.height,desiredHeight:l,minX:g,minY:p,refX:h.getValue(),refY:f.getValue(),clip:d,clipX:y,clipY:x}),v&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(u,l))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.getAttribute("width",!0),n=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),s=this.getAttribute("style"),u=i.getNumber(0),l=n.getNumber(0);if(r)if(typeof r=="string")this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var h=this.getAttribute("preserveAspectRatio");h.hasValue()&&h.setValue(h.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(e),n.setValue(t),o.hasValue()||o.setValue("0 0 ".concat(u||e," ").concat(l||t)),s.hasValue()){var f=this.getStyle("width"),c=this.getStyle("height");f.hasValue()&&f.setValue("".concat(e,"px")),c.hasValue()&&c.setValue("".concat(t,"px"))}}}class $l extends A{constructor(){super(...arguments),this.type="rect"}path(e){var t=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),i=this.getStyle("width",!1,!0).getPixels("x"),n=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),s=this.getAttribute("ry"),u=o.getPixels("x"),l=s.getPixels("y");if(o.hasValue()&&!s.hasValue()&&(l=u),s.hasValue()&&!o.hasValue()&&(u=l),u=Math.min(u,i/2),l=Math.min(l,n/2),e){var h=4*((Math.sqrt(2)-1)/3);e.beginPath(),n>0&&i>0&&(e.moveTo(t+u,r),e.lineTo(t+i-u,r),e.bezierCurveTo(t+i-u+h*u,r,t+i,r+l-h*l,t+i,r+l),e.lineTo(t+i,r+n-l),e.bezierCurveTo(t+i,r+n-l+h*l,t+i-u+h*u,r+n,t+i-u,r+n),e.lineTo(t+u,r+n),e.bezierCurveTo(t+u-h*u,r+n,t,r+n-l+h*l,t,r+n-l),e.lineTo(t,r+l),e.bezierCurveTo(t,r+l-h*l,t+u-h*u,r,t+u,r),e.closePath())}return new he(t,r,t+i,r+n)}getMarkers(){return null}}class B1 extends A{constructor(){super(...arguments),this.type="circle"}path(e){var t=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),i=this.getAttribute("r").getPixels();return e&&i>0&&(e.beginPath(),e.arc(t,r,i,0,Math.PI*2,!1),e.closePath()),new he(t-i,r-i,t+i,r+i)}getMarkers(){return null}}class F1 extends A{constructor(){super(...arguments),this.type="ellipse"}path(e){var t=4*((Math.sqrt(2)-1)/3),r=this.getAttribute("rx").getPixels("x"),i=this.getAttribute("ry").getPixels("y"),n=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return e&&r>0&&i>0&&(e.beginPath(),e.moveTo(n+r,o),e.bezierCurveTo(n+r,o+t*i,n+t*r,o+i,n,o+i),e.bezierCurveTo(n-t*r,o+i,n-r,o+t*i,n-r,o),e.bezierCurveTo(n-r,o-t*i,n-t*r,o-i,n,o-i),e.bezierCurveTo(n+t*r,o-i,n+r,o-t*i,n+r,o),e.closePath()),new he(n-r,o-i,n+r,o+i)}getMarkers(){return null}}class j1 extends A{constructor(){super(...arguments),this.type="line"}getPoints(){return[new V(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new V(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){var[{x:t,y:r},{x:i,y:n}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,r),e.lineTo(i,n)),new he(t,r,i,n)}getMarkers(){var[e,t]=this.getPoints(),r=e.angleTo(t);return[[e,r],[t,r]]}}class wl extends A{constructor(e,t,r){super(e,t,r),this.type="polyline",this.points=[],this.points=V.parsePath(this.getAttribute("points").getString())}path(e){var{points:t}=this,[{x:r,y:i}]=t,n=new he(r,i);return e&&(e.beginPath(),e.moveTo(r,i)),t.forEach(o=>{var{x:s,y:u}=o;n.addPoint(s,u),e&&e.lineTo(s,u)}),n}getMarkers(){var{points:e}=this,t=e.length-1,r=[];return e.forEach((i,n)=>{n!==t&&r.push([i,i.angleTo(e[n+1])])}),r.length>0&&r.push([e[e.length-1],r[r.length-1][1]]),r}}class U1 extends wl{constructor(){super(...arguments),this.type="polygon"}path(e){var t=super.path(e),[{x:r,y:i}]=this.points;return e&&(e.lineTo(r,i),e.closePath()),t}}class z1 extends I{constructor(){super(...arguments),this.type="pattern"}createPattern(e,t,r){var i=this.getStyle("width").getPixels("x",!0),n=this.getStyle("height").getPixels("y",!0),o=new Dt(this.document,null);o.attributes.viewBox=new O(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new O(this.document,"width","".concat(i,"px")),o.attributes.height=new O(this.document,"height","".concat(n,"px")),o.attributes.transform=new O(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;var s=this.document.createCanvas(i,n),u=s.getContext("2d"),l=this.getAttribute("x"),h=this.getAttribute("y");l.hasValue()&&h.hasValue()&&u.translate(l.getPixels("x",!0),h.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var f=-1;f<=1;f++)for(var c=-1;c<=1;c++)u.save(),o.attributes.x=new O(this.document,"x",f*s.width),o.attributes.y=new O(this.document,"y",c*s.height),o.render(u),u.restore();var v=e.createPattern(s,"repeat");return v}}class G1 extends I{constructor(){super(...arguments),this.type="marker"}render(e,t,r){if(t){var{x:i,y:n}=t,o=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(i,n),o==="auto"&&e.rotate(r),s==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();var u=new Dt(this.document,null);u.type=this.type,u.attributes.viewBox=new O(this.document,"viewBox",this.getAttribute("viewBox").getValue()),u.attributes.refX=new O(this.document,"refX",this.getAttribute("refX").getValue()),u.attributes.refY=new O(this.document,"refY",this.getAttribute("refY").getValue()),u.attributes.width=new O(this.document,"width",this.getAttribute("markerWidth").getValue()),u.attributes.height=new O(this.document,"height",this.getAttribute("markerHeight").getValue()),u.attributes.overflow=new O(this.document,"overflow",this.getAttribute("overflow").getValue()),u.attributes.fill=new O(this.document,"fill",this.getAttribute("fill").getColor("black")),u.attributes.stroke=new O(this.document,"stroke",this.getAttribute("stroke").getValue("none")),u.children=this.children,u.render(e),e.restore(),s==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),o==="auto"&&e.rotate(-r),e.translate(-i,-n)}}}class H1 extends I{constructor(){super(...arguments),this.type="defs"}render(){}}class sn extends Ge{constructor(){super(...arguments),this.type="g"}getBoundingBox(e){var t=new he;return this.children.forEach(r=>{t.addBoundingBox(r.getBoundingBox(e))}),t}}class Cl extends I{constructor(e,t,r){super(e,t,r),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:i,children:n}=this;n.forEach(o=>{o.type==="stop"&&i.push(o)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,r){var i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var{stops:n}=i,o=this.getGradient(e,t);if(!o)return this.addParentOpacity(r,n[n.length-1].color);if(n.forEach(p=>{o.addColorStop(p.offset,this.addParentOpacity(r,p.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:u,viewPort:l}=s.screen,[h]=l.viewPorts,f=new $l(s,null);f.attributes.x=new O(s,"x",-u/3),f.attributes.y=new O(s,"y",-u/3),f.attributes.width=new O(s,"width",u),f.attributes.height=new O(s,"height",u);var c=new sn(s,null);c.attributes.transform=new O(s,"transform",this.getAttribute("gradientTransform").getValue()),c.children=[f];var v=new Dt(s,null);v.attributes.x=new O(s,"x",0),v.attributes.y=new O(s,"y",0),v.attributes.width=new O(s,"width",h.width),v.attributes.height=new O(s,"height",h.height),v.children=[c];var d=s.createCanvas(h.width,h.height),g=d.getContext("2d");return g.fillStyle=o,v.render(g),g.createPattern(d,"no-repeat")}return o}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){if(e.hasValue()){var r=new O(this.document,"color",t);return r.addOpacity(e).getColor()}return t}}class Y1 extends Cl{constructor(e,t,r){super(e,t,r),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,t){var r=this.getGradientUnits()==="objectBoundingBox",i=r?t.getBoundingBox(e):null;if(r&&!i)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var n=r?i.x+i.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=r?i.y+i.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?i.x+i.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),u=r?i.y+i.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return n===s&&o===u?null:e.createLinearGradient(n,o,s,u)}}class X1 extends Cl{constructor(e,t,r){super(e,t,r),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,t){var r=this.getGradientUnits()==="objectBoundingBox",i=t.getBoundingBox(e);if(r&&!i)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var n=r?i.x+i.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=r?i.y+i.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=n,u=o;this.getAttribute("fx").hasValue()&&(s=r?i.x+i.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(u=r?i.y+i.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var l=r?(i.width+i.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),h=this.getAttribute("fr").getPixels();return e.createRadialGradient(s,u,h,n,o,l)}}class W1 extends I{constructor(e,t,r){super(e,t,r),this.type="stop";var i=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),n=this.getStyle("stop-opacity"),o=this.getStyle("stop-color",!0);o.getString()===""&&o.setValue("#000"),n.hasValue()&&(o=o.addOpacity(n)),this.offset=i,this.color=o.getColor()}}class on extends I{constructor(e,t,r){super(e,t,r),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new O(e,"values",null);var i=this.getAttribute("values");i.hasValue()&&this.values.setValue(i.getString().split(";"))}getProperty(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){var{initialUnits:e}=this,{progress:t,from:r,to:i}=this.getProgress(),n=r.getNumber()+(i.getNumber()-r.getNumber())*t;return e==="%"&&(n*=100),"".concat(n).concat(e)}update(e){var{parent:t}=this,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var i=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(i==="freeze"&&!this.frozen)this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=r.getString();else if(i==="remove"&&!this.removed)return this.removed=!0,r.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;var n=!1;if(this.begin{var l=n[u];return s+(l-s)*e}).join(" ");return o}}class K1 extends I{constructor(e,t,r){super(e,t,r),this.type="font",this.glyphs={},this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:i}=e,{children:n}=this;for(var o of n)switch(o.type){case"font-face":{this.fontFace=o;var s=o.getStyle("font-family");s.hasValue()&&(i[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 Z1 extends I{constructor(e,t,r){super(e,t,r),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class J1 extends A{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class e2 extends Ce{constructor(){super(...arguments),this.type="tref"}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}}class t2 extends Ce{constructor(e,t,r){super(e,t,r),this.type="a";var{childNodes:i}=t,n=i[0],o=i.length>0&&Array.from(i).every(s=>s.nodeType===3);this.hasText=o,this.text=o?this.getTextFromNode(n):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:t,x:r,y:i}=this,{mouse:n}=t.screen,o=new O(t,"fontSize",J.parse(t.ctx.font).fontSize);n.isWorking()&&n.checkBoundingBox(this,new he(r,i-o.getPixels("y"),r+this.measureText(e),i))}else if(this.children.length>0){var s=new sn(this.document,null);s.children=this.children,s.parent=this,s.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){var e=this.document.ctx;e.canvas.style.cursor="pointer"}}function Io(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,r)}return t}function ir(a){for(var e=1;e{var{type:i,points:n}=r;switch(i){case w.LINE_TO:e&&e.lineTo(n[0],n[1]);break;case w.MOVE_TO:e&&e.moveTo(n[0],n[1]);break;case w.CURVE_TO:e&&e.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]);break;case w.QUAD_TO:e&&e.quadraticCurveTo(n[0],n[1],n[2],n[3]);break;case w.ARC:{var[o,s,u,l,h,f,c,v]=n,d=u>l?u:l,g=u>l?1:u/l,p=u>l?l/u:1;e&&(e.translate(o,s),e.rotate(c),e.scale(g,p),e.arc(0,0,d,h,h+f,!!(1-v)),e.scale(1/g,1/p),e.rotate(-c),e.translate(-o,-s));break}case w.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),{glyphInfo:i}=this,n=e.fillStyle;t==="underline"&&e.beginPath(),i.forEach((o,s)=>{var{p0:u,p1:l,rotation:h,text:f}=o;e.save(),e.translate(u.x,u.y),e.rotate(h),e.fillStyle&&e.fillText(f,0,0),e.strokeStyle&&e.strokeText(f,0,0),e.restore(),t==="underline"&&(s===0&&e.moveTo(u.x,u.y+r/8),e.lineTo(l.x,l.y+r/5))}),t==="underline"&&(e.lineWidth=r/20,e.strokeStyle=n,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,r,i,n,o,s,u,l){var h=o,f=this.measureText(e,u);u===" "&&t==="justify"&&r-1&&(h+=this.getLetterSpacingAt(l));var c=this.textHeight/20,v=this.getEquidistantPointOnPath(h,c,0),d=this.getEquidistantPointOnPath(h+f,c,0),g={p0:v,p1:d},p=v&&d?Math.atan2(d.y-v.y,d.x-v.x):0;if(s){var y=Math.cos(Math.PI/2+p)*s,x=Math.cos(-p)*s;g.p0=ir(ir({},v),{},{x:v.x+y,y:v.y+x}),g.p1=ir(ir({},d),{},{x:d.x+y,y:d.y+x})}return h+=f,{offset:h,segment:g,rotation:p}}measureText(e,t){var{measuresCache:r}=this,i=t||this.getText();if(r.has(i))return r.get(i);var n=this.measureTargetText(e,i);return r.set(i,n),n}setTextData(e){if(!this.glyphInfo){var t=this.getText(),r=t.split(""),i=t.split(" ").length-1,n=this.parent.getAttribute("dx").split().map(T=>T.getPixels("x")),o=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),u=this.getStyle("letter-spacing"),l=this.parent.getStyle("letter-spacing"),h=0;!u.hasValue()||u.getValue()==="inherit"?h=l.getPixels():u.hasValue()&&u.getValue()!=="initial"&&u.getValue()!=="unset"&&(h=u.getPixels());var f=[],c=t.length;this.letterSpacingCache=f;for(var v=0;vE===0?0:T+$||0,0),g=this.measureText(e),p=Math.max(g+d,0);this.textWidth=g,this.textHeight=this.getFontSize(),this.glyphInfo=[];var y=this.getPathLength(),x=this.getStyle("startOffset").getNumber(0)*y,b=0;(s==="middle"||s==="center")&&(b=-p/2),(s==="end"||s==="right")&&(b=-p),b+=x,r.forEach((T,$)=>{var{offset:E,segment:S,rotation:C}=this.findSegmentToFitChar(e,s,p,y,i,b,o,T,$);b=E,!(!S.p0||!S.p1)&&this.glyphInfo.push({text:r[$],p0:S.p0,p1:S.p1,rotation:C})})}}parsePathData(e){if(this.pathLength=-1,!e)return[];var t=[],{pathParser:r}=e;for(r.reset();!r.isEnd();){var{current:i}=r,n=i?i.x:0,o=i?i.y:0,s=r.next(),u=s.type,l=[];switch(s.type){case w.MOVE_TO:this.pathM(r,l);break;case w.LINE_TO:u=this.pathL(r,l);break;case w.HORIZ_LINE_TO:u=this.pathH(r,l);break;case w.VERT_LINE_TO:u=this.pathV(r,l);break;case w.CURVE_TO:this.pathC(r,l);break;case w.SMOOTH_CURVE_TO:u=this.pathS(r,l);break;case w.QUAD_TO:this.pathQ(r,l);break;case w.SMOOTH_QUAD_TO:u=this.pathT(r,l);break;case w.ARC:l=this.pathA(r);break;case w.CLOSE_PATH:A.pathZ(r);break}s.type!==w.CLOSE_PATH?t.push({type:u,points:l,start:{x:n,y:o},pathLength:this.calcLength(n,o,u,l)}):t.push({type:w.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){var{x:r,y:i}=A.pathM(e).point;t.push(r,i)}pathL(e,t){var{x:r,y:i}=A.pathL(e).point;return t.push(r,i),w.LINE_TO}pathH(e,t){var{x:r,y:i}=A.pathH(e).point;return t.push(r,i),w.LINE_TO}pathV(e,t){var{x:r,y:i}=A.pathV(e).point;return t.push(r,i),w.LINE_TO}pathC(e,t){var{point:r,controlPoint:i,currentPoint:n}=A.pathC(e);t.push(r.x,r.y,i.x,i.y,n.x,n.y)}pathS(e,t){var{point:r,controlPoint:i,currentPoint:n}=A.pathS(e);return t.push(r.x,r.y,i.x,i.y,n.x,n.y),w.CURVE_TO}pathQ(e,t){var{controlPoint:r,currentPoint:i}=A.pathQ(e);t.push(r.x,r.y,i.x,i.y)}pathT(e,t){var{controlPoint:r,currentPoint:i}=A.pathT(e);return t.push(r.x,r.y,i.x,i.y),w.QUAD_TO}pathA(e){var{rX:t,rY:r,sweepFlag:i,xAxisRotation:n,centp:o,a1:s,ad:u}=A.pathA(e);return i===0&&u>0&&(u-=2*Math.PI),i===1&&u<0&&(u+=2*Math.PI),[o.x,o.y,t,r,s,u,n,i]}calcLength(e,t,r,i){var n=0,o=null,s=null,u=0;switch(r){case w.LINE_TO:return this.getLineLength(e,t,i[0],i[1]);case w.CURVE_TO:for(n=0,o=this.getPointOnCubicBezier(0,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),u=.01;u<=1;u+=.01)s=this.getPointOnCubicBezier(u,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return n;case w.QUAD_TO:for(n=0,o=this.getPointOnQuadraticBezier(0,e,t,i[0],i[1],i[2],i[3]),u=.01;u<=1;u+=.01)s=this.getPointOnQuadraticBezier(u,e,t,i[0],i[1],i[2],i[3]),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return n;case w.ARC:{n=0;var l=i[4],h=i[5],f=i[4]+h,c=Math.PI/180;if(Math.abs(l-f)f;u-=c)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(u=l+c;u5&&arguments[5]!==void 0?arguments[5]:t,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:r,u=(n-r)/(i-t+nt),l=Math.sqrt(e*e/(1+u*u));it)return null;var{dataArray:n}=this;for(var o of n){if(o&&(o.pathLength<5e-5||r+o.pathLength+5e-5=0&&u>f)break;i=this.getPointOnEllipticalArc(o.points[0],o.points[1],o.points[2],o.points[3],u,o.points[6]);break}case w.CURVE_TO:u=s/o.pathLength,u>1&&(u=1),i=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 w.QUAD_TO:u=s/o.pathLength,u>1&&(u=1),i=this.getPointOnQuadraticBezier(u,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3]);break}if(i)return i;break}return null}getLineLength(e,t,r,i){return Math.sqrt((r-e)*(r-e)+(i-t)*(i-t))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,r,i,n,o,s,u,l){var h=u*Eo(e)+o*$o(e)+i*wo(e)+t*Co(e),f=l*Eo(e)+s*$o(e)+n*wo(e)+r*Co(e);return{x:h,y:f}}getPointOnQuadraticBezier(e,t,r,i,n,o,s){var u=o*Ao(e)+i*Po(e)+t*Ro(e),l=s*Ao(e)+n*Po(e)+r*Ro(e);return{x:u,y:l}}getPointOnEllipticalArc(e,t,r,i,n,o){var s=Math.cos(o),u=Math.sin(o),l={x:r*Math.cos(n),y:i*Math.sin(n)};return{x:e+(l.x*s-l.y*u),y:t+(l.x*u+l.y*s)}}buildEquidistantCache(e,t){var r=this.getPathLength(),i=t||.25,n=e||r/100;if(!this.equidistantCache||this.equidistantCache.step!==n||this.equidistantCache.precision!==i){this.equidistantCache={step:n,precision:i,points:[]};for(var o=0,s=0;s<=r;s+=i){var u=this.getPointOnPath(s),l=this.getPointOnPath(s+i);!u||!l||(o+=this.getLineLength(u.x,u.y,l.x,l.y),o>=n&&(this.equidistantCache.points.push({x:u.x,y:u.y,distance:s}),o-=n))}}}getEquidistantPointOnPath(e,t,r){if(this.buildEquidistantCache(t,r),e<0||e-this.getPathLength()>5e-5)return null;var i=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}}var a2=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class i2 extends Ge{constructor(e,t,r){super(e,t,r),this.type="image",this.loaded=!1;var i=this.getHrefAttribute().getString();if(i){var n=i.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(i);e.images.push(this),n?this.loadSvg(i):this.loadImage(i),this.isSvg=n}}loadImage(e){var t=this;return xe(function*(){try{var r=yield t.document.createImage(e);t.image=r}catch(i){console.error('Error while loading image "'.concat(e,'":'),i)}t.loaded=!0})()}loadSvg(e){var t=this;return xe(function*(){var r=a2.exec(e);if(r){var i=r[5];r[4]==="base64"?t.image=atob(i):t.image=decodeURIComponent(i)}else try{var n=yield t.document.fetch(e),o=yield n.text();t.image=o}catch(s){console.error('Error while loading image "'.concat(e,'":'),s)}t.loaded=!0})()}renderChildren(e){var{document:t,image:r,loaded:i}=this,n=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),u=this.getStyle("height").getPixels("y");if(!(!i||!r||!s||!u)){if(e.save(),e.translate(n,o),this.isSvg){var l=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:u});l.document.documentElement.parent=this,l.render()}else{var h=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:h.width,height:u,desiredHeight:h.height}),this.loaded&&(typeof h.complete>"u"||h.complete)&&e.drawImage(h,0,0)}e.restore()}}getBoundingBox(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new he(e,t,e+r,t+i)}}class n2 extends Ge{constructor(){super(...arguments),this.type="symbol"}render(e){}}class s2{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,t){var r=this;return xe(function*(){try{var{document:i}=r,n=yield i.canvg.parser.load(t),o=n.getElementsByTagName("font");Array.from(o).forEach(s=>{var u=i.createElement(s);i.definitions[e]=u})}catch(s){console.error('Error while loading font "'.concat(t,'":'),s)}r.loaded=!0})()}}class Al extends I{constructor(e,t,r){super(e,t,r),this.type="style";var i=ft(Array.from(t.childNodes).map(o=>o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),n=i.split("}");n.forEach(o=>{var s=o.trim();if(s){var u=s.split("{"),l=u[0].split(","),h=u[1].split(";");l.forEach(f=>{var c=f.trim();if(c){var v=e.styles[c]||{};if(h.forEach(p=>{var y=p.indexOf(":"),x=p.substr(0,y).trim(),b=p.substr(y+1,p.length-y).trim();x&&b&&(v[x]=new O(e,x,b))}),e.styles[c]=v,e.stylesSpecificity[c]=T1(c),c==="@font-face"){var d=v["font-family"].getString().replace(/"|'/g,""),g=v.src.getString().split(",");g.forEach(p=>{if(p.indexOf('format("svg")')>0){var y=bl(p);y&&new s2(e).load(d,y)}})}}})}})}}Al.parseExternalUrl=bl;class o2 extends Ge{constructor(){super(...arguments),this.type="use"}setContext(e){super.setContext(e);var t=this.getAttribute("x"),r=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),r.hasValue()&&e.translate(0,r.getPixels("y"))}path(e){var{element:t}=this;t&&t.path(e)}renderChildren(e){var{document:t,element:r}=this;if(r){var i=r;if(r.type==="symbol"&&(i=new Dt(t,null),i.attributes.viewBox=new O(t,"viewBox",r.getAttribute("viewBox").getString()),i.attributes.preserveAspectRatio=new O(t,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),i.attributes.overflow=new O(t,"overflow",r.getAttribute("overflow").getString()),i.children=r.children,r.styles.opacity=new O(t,"opacity",this.calculateOpacity())),i.type==="svg"){var n=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);n.hasValue()&&(i.attributes.width=new O(t,"width",n.getString())),o.hasValue()&&(i.attributes.height=new O(t,"height",o.getString()))}var s=i.parent;i.parent=this,i.render(e),i.parent=s}}getBoundingBox(e){var{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){var{document:e,element:t}=this;return Be.fromElement(e,t)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function nr(a,e,t,r,i,n){return a[t*r*4+e*4+n]}function sr(a,e,t,r,i,n,o){a[t*r*4+e*4+n]=o}function F(a,e,t){var r=a[e];return r*t}function me(a,e,t,r){return e+Math.cos(a)*t+Math.sin(a)*r}class Pl extends I{constructor(e,t,r){super(e,t,r),this.type="feColorMatrix";var i=ie(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{var n=i[0];i=[.213+.787*n,.715-.715*n,.072-.072*n,0,0,.213-.213*n,.715+.285*n,.072-.072*n,0,0,.213-.213*n,.715-.715*n,.072+.928*n,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var o=i[0]*Math.PI/180;i=[me(o,.213,.787,-.213),me(o,.715,-.715,-.715),me(o,.072,-.072,.928),0,0,me(o,.213,-.213,.143),me(o,.715,.285,.14),me(o,.072,-.072,-.283),0,0,me(o,.213,-.213,-.787),me(o,.715,-.715,.715),me(o,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=i,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,t,r,i,n){for(var{includeOpacity:o,matrix:s}=this,u=e.getImageData(0,0,i,n),l=0;l{u.addBoundingBox(d.getBoundingBox(e))}),i=Math.floor(u.x1),n=Math.floor(u.y1),o=Math.floor(u.width),s=Math.floor(u.height)}var l=this.removeStyles(t,Br.ignoreStyles),h=r.createCanvas(i+o,n+s),f=h.getContext("2d");r.screen.setDefaults(f),this.renderChildren(f),new Pl(r,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(f,0,0,i+o,n+s);var c=r.createCanvas(i+o,n+s),v=c.getContext("2d");r.screen.setDefaults(v),t.render(v),v.globalCompositeOperation="destination-in",v.fillStyle=f.createPattern(h,"no-repeat"),v.fillRect(0,0,i+o,n+s),e.fillStyle=v.createPattern(c,"no-repeat"),e.fillRect(0,0,i+o,n+s),this.restoreStyles(t,l)}render(e){}}Br.ignoreStyles=["mask","transform","clip-path"];var No=()=>{};class u2 extends I{constructor(){super(...arguments),this.type="clipPath"}apply(e){var{document:t}=this,r=Reflect.getPrototypeOf(e),{beginPath:i,closePath:n}=e;r&&(r.beginPath=No,r.closePath=No),Reflect.apply(i,e,[]),this.children.forEach(o=>{if(!(typeof o.path>"u")){var s=typeof o.elementTransform<"u"?o.elementTransform():null;s||(s=Be.fromElement(t,o)),s&&s.apply(e),o.path(e),r&&(r.closePath=n),s&&s.unapply(e)}}),Reflect.apply(n,e,[]),e.clip(),r&&(r.beginPath=i,r.closePath=n)}render(e){}}class Fr extends I{constructor(){super(...arguments),this.type="filter"}apply(e,t){var{document:r,children:i}=this,n=t.getBoundingBox(e);if(n){var o=0,s=0;i.forEach(y=>{var x=y.extraFilterDistance||0;o=Math.max(o,x),s=Math.max(s,x)});var u=Math.floor(n.width),l=Math.floor(n.height),h=u+2*o,f=l+2*s;if(!(h<1||f<1)){var c=Math.floor(n.x),v=Math.floor(n.y),d=this.removeStyles(t,Fr.ignoreStyles),g=r.createCanvas(h,f),p=g.getContext("2d");r.screen.setDefaults(p),p.translate(-c+o,-v+s),t.render(p),i.forEach(y=>{typeof y.apply=="function"&&y.apply(p,0,0,h,f)}),e.drawImage(g,0,0,h,f,c-o,v-s,h,f),this.restoreStyles(t,d)}}}render(e){}}Fr.ignoreStyles=["filter","transform","clip-path"];class l2 extends I{constructor(e,t,r){super(e,t,r),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(e,t,r,i,n){}}class h2 extends I{constructor(){super(...arguments),this.type="feMorphology"}apply(e,t,r,i,n){}}class v2 extends I{constructor(){super(...arguments),this.type="feComposite"}apply(e,t,r,i,n){}}class f2 extends I{constructor(e,t,r){super(e,t,r),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,r,i,n){var{document:o,blurRadius:s}=this,u=o.window?o.window.document.body:null,l=e.canvas;l.id=o.getUniqueId(),u&&(l.style.display="none",u.appendChild(l)),n1(l,t,r,i,n,s),u&&u.removeChild(l)}}class c2 extends I{constructor(){super(...arguments),this.type="title"}}class g2 extends I{constructor(){super(...arguments),this.type="desc"}}var d2={svg:Dt,rect:$l,circle:B1,ellipse:F1,line:j1,polyline:wl,polygon:U1,path:A,pattern:z1,marker:G1,defs:H1,linearGradient:Y1,radialGradient:X1,stop:W1,animate:on,animateColor:q1,animateTransform:Q1,font:K1,"font-face":Z1,"missing-glyph":J1,glyph:El,text:Ce,tspan:kr,tref:e2,a:t2,textPath:r2,image:i2,g:sn,symbol:n2,style:Al,use:o2,mask:Br,clipPath:u2,filter:Fr,feDropShadow:l2,feMorphology:h2,feComposite:v2,feColorMatrix:Pl,feGaussianBlur:f2,title:c2,desc:g2};function Mo(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,r)}return t}function p2(a){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:!1,t=document.createElement("img");return e&&(t.crossOrigin="Anonymous"),new Promise((r,i)=>{t.onload=()=>{r(t)},t.onerror=(n,o,s,u,l)=>{i(l)},t.src=a})}),Si.apply(this,arguments)}class $e{constructor(e){var{rootEmSize:t=12,emSize:r=12,createCanvas:i=$e.createCanvas,createImage:n=$e.createImage,anonymousCrossOrigin:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=e,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=t,this.emSize=r,this.createCanvas=i,this.createImage=this.bindCreateImage(n,o),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,t){return typeof t=="boolean"?(r,i)=>e(r,typeof i=="boolean"?i:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:t}=this;t.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e){var t=e.nodeName.replace(/^[^:]+:/,""),r=$e.elementTypes[t];return typeof r<"u"?new r(this,e):new M1(this,e)}createTextNode(e){return new k1(this,e)}setViewBox(e){this.screen.setViewBox(p2({document:this},e))}}$e.createCanvas=y2;$e.createImage=m2;$e.elementTypes=d2;function _o(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,r)}return t}function De(a){for(var e=1;e2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new Ga(r),this.screen=new Lr(e,r),this.options=r;var i=new $e(this,r),n=i.createDocumentElement(t);this.document=i,this.documentElement=n}static from(e,t){var r=arguments;return xe(function*(){var i=r.length>2&&r[2]!==void 0?r[2]:{},n=new Ga(i),o=yield n.parse(t);return new St(e,o,i)})()}static fromString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=new Ga(r),n=i.parseFromString(t);return new St(e,n,r)}fork(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return St.from(e,t,De(De({},this.options),r))}forkString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return St.fromString(e,t,De(De({},this.options),r))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,t=this;return xe(function*(){var r=e.length>0&&e[0]!==void 0?e[0]:{};t.start(De({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},r)),yield t.ready(),t.stop()})()}start(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:t,screen:r,options:i}=this;r.start(t,De(De({enableRedraw:!0},i),e))}stop(){this.screen.stop()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(e,t,r)}}export{t2 as AElement,q1 as AnimateColorElement,on as AnimateElement,Q1 as AnimateTransformElement,he as BoundingBox,Eo as CB1,$o as CB2,wo as CB3,Co as CB4,St as Canvg,B1 as CircleElement,u2 as ClipPathElement,H1 as DefsElement,g2 as DescElement,$e as Document,I as Element,F1 as EllipseElement,Pl as FeColorMatrixElement,v2 as FeCompositeElement,l2 as FeDropShadowElement,f2 as FeGaussianBlurElement,h2 as FeMorphologyElement,Fr as FilterElement,J as Font,K1 as FontElement,Z1 as FontFaceElement,sn as GElement,El as GlyphElement,Cl as GradientElement,i2 as ImageElement,j1 as LineElement,Y1 as LinearGradientElement,G1 as MarkerElement,Br as MaskElement,Sl as Matrix,J1 as MissingGlyphElement,O1 as Mouse,nt as PSEUDO_ZERO,Ga as Parser,A as PathElement,w as PathParser,z1 as PatternElement,V as Point,U1 as PolygonElement,wl as PolylineElement,O as Property,Ao as QB1,Po as QB2,Ro as QB3,X1 as RadialGradientElement,$l as RectElement,Ge as RenderedElement,C1 as Rotate,Dt as SVGElement,s2 as SVGFontLoader,A1 as Scale,Lr as Screen,Ol as Skew,P1 as SkewX,R1 as SkewY,W1 as StopElement,Al as StyleElement,n2 as SymbolElement,e2 as TRefElement,kr as TSpanElement,Ce as TextElement,r2 as TextPathElement,c2 as TitleElement,Be as Transform,w1 as Translate,M1 as UnknownElement,o2 as UseElement,S1 as ViewPort,ft as compressSpaces,St as default,T1 as getSelectorSpecificity,f1 as normalizeAttributeName,c1 as normalizeColor,bl as parseExternalUrl,x2 as presets,ie as toNumbers,l1 as trimLeft,h1 as trimRight,So as vectorMagnitude,Oo as vectorsAngle,Ti as vectorsRatio};