emf-converter 5.0.0 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var chunk7JVB7NLG_js=require('./browser-chunks/chunk-7JVB7NLG.js'),chunk5OO5QZBQ_js=require('./browser-chunks/chunk-5OO5QZBQ.js'),chunkC3KBKW2L_js=require('./browser-chunks/chunk-C3KBKW2L.js'),chunkDO2CGP4P_js=require('./browser-chunks/chunk-DO2CGP4P.js'),chunkOB5ODU4B_js=require('./browser-chunks/chunk-OB5ODU4B.js'),chunk32ASPP2J_js=require('./browser-chunks/chunk-32ASPP2J.js');require('./browser-chunks/chunk-QX63UNWK.js'),require('./browser-chunks/chunk-J6UKX2SY.js');function Br(e){let t=e;return t.length>=8&&t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71?"image/png":t.length>=3&&t[0]===255&&t[1]===216&&t[2]===255?chunk32ASPP2J_js.a(t)==="standard"?"image/jpeg":null:t.length>=6&&t[0]===71&&t[1]===73&&t[2]===70&&t[3]===56?"image/gif":t.length>=12&&t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80?"image/webp":null}function Qi(e){if(e.kind==="rgba")return {w:e.width,h:e.height};if(e.kind!=="encoded")return null;let t=e.bytes,n=new DataView(t.buffer,t.byteOffset,t.byteLength);try{if(e.mime==="image/png"&&t.length>=24)return {w:n.getUint32(16),h:n.getUint32(20)};if(e.mime==="image/gif"&&t.length>=10)return {w:n.getUint16(6,!0),h:n.getUint16(8,!0)};if(e.mime==="image/jpeg")for(let r=2;r+9<t.length;){if(t[r]!==255){r++;continue}let o=t[r+1],i=n.getUint16(r+2);if(o>=192&&o<=207&&o!==196&&o!==200&&o!==204)return {w:n.getUint16(r+7),h:n.getUint16(r+5)};r+=2+i;}if(e.mime==="image/webp"&&t.length>=30){let r=String.fromCharCode(t[12],t[13],t[14],t[15]);if(r==="VP8X")return {w:1+(t[24]|t[25]<<8|t[26]<<16),h:1+(t[27]|t[28]<<8|t[29]<<16)};if(r==="VP8 ")return {w:n.getUint16(26,!0)&16383,h:n.getUint16(28,!0)&16383};if(r==="VP8L"){let o=n.getUint32(21,!0);return {w:(o&16383)+1,h:(o>>14&16383)+1}}}}catch{}return null}function So(e){let t=new DataView(e);if(t.byteLength<26||t.getUint8(0)!==66||t.getUint8(1)!==77)return null;let n=t.getUint32(10,true),r=chunk7JVB7NLG_js.d(t,14,n,t.byteLength-n);return r?{kind:"rgba",data:r.data,width:r.width,height:r.height}:null}var es=new Float32Array(1),ff=new Uint32Array(es.buffer);function D(e){let t=Math.fround(e);return t<=e||Number.isNaN(t)?t:t===0?(ff[0]=2147483649,es[0]):(es[0]=t,ff[0]+=t>0?-1:1,es[0])}var ke=Math.fround,Gn=D,au=new Float32Array(1),su=new Uint32Array(au.buffer);function bf(e){return au[0]=e,e>0?su[0]-=1:e<0?su[0]+=1:su[0]=2147483649,au[0]}var fe=(e,t)=>Gn(e+t),te=(e,t)=>Gn(e-t),Q=(e,t)=>Gn(e*t);function we(e,t){let n=e/t;if(!Number.isFinite(n))return n;let r=Gn(n);return (t>0?r*t>e:r*t<e)&&(r=bf(r)),r}function vo(e){let t=Math.sqrt(e);if(!Number.isFinite(t))return t;let n=Gn(t);return n*n>e&&(n=bf(n)),n}function On(e){let t=Math.floor(e);return t>=-2147483648&&t<=2147483647?t:-2147483648}function ts(e){let t=Math.ceil(e);return t>=-2147483648&&t<=2147483647?t:-2147483648}function Nn(e,t,n){return t=ke(t),n=ke(n),[fe(fe(Q(t,ke(e[0])),Q(n,ke(e[2]))),ke(e[4])),fe(fe(Q(t,ke(e[1])),Q(n,ke(e[3]))),ke(e[5]))]}var rt=(e,t)=>e>t,Wn=(e,t)=>e>=t,Xt=(e,t)=>!(e>=t),hf=(e,t)=>!(e>t);var Co=11920929e-14,ns=2**30;function Mn(e){let t=e>>>24;if(t<Co)return [0,0,0,0];let n=e>>>16&255,r=e>>>8&255,o=e&255;if(Math.abs(t-255)<Co)return [t,n,r,o];let i=we(t,255);return [t,Q(i,n),Q(i,r),Q(i,o)]}function Hn(e){let t=fe(Q(Q(e,16),16),.5);return Math.floor(t)+15>>4}function nx(e,t,n,r,o){let i=r-t,s=o-n,a=Math.abs(i)>Math.abs(s),u=(a?t:n)>>4,l=Math.abs(a?i:s)>>4,c=t,f=n,m,b;if(s>=0?(m=n+15>>4,b=o+15>>4):(i=-i,s=-s,c=r,f=o,m=o+15>>4,b=n+15>>4),b<=m)return null;let h,d;if(i>=0)i<s?(h=0,d=i):(h=Math.trunc(i/s),d=i%s);else {let E=-i;if(E<s)h=-1,d=s-E;else {h=-Math.trunc(E/s);let P=E%s;P>0?(h--,d=s-P):d=0;}}let p=-1,x=f&15;if(x!==0)for(let E=16-x;E>0;E--){p+=d;let P=h+c;p>=0?(p-=s,c=P+1):c=P;}let y=c&15;y!==0&&(p-=(16-y)*s,c+=15);let g=c>>4;p>>=4;let M=new Int32Array(b-m);for(let E=0;E<M.length;E++){M[E]=g,g+=h;let P=p+d;P>=0?(p=P-s,g+=1):p=P;}return {kind:e,yStart:m,yEnd:b,xs:M,xMajor:a,origin:u,steps:l}}var rs=class{constructor(t,n,r={}){this.shading=r;this.edges=[];this.rows=new Map;this.colors=n;let o=[Hn(t[0]),Hn(t[2]),Hn(t[4]),Hn(t[0])],i=[Hn(t[1]),Hn(t[3]),Hn(t[5]),Hn(t[1])],s=1/0,a=-1/0;for(let u=0;u<3;u++){let l=nx(u,o[u],i[u],o[u+1],i[u+1]);l&&(this.edges.push(l),s=Math.min(s,l.yStart),a=Math.max(a,l.yEnd));}this.yMin=s,this.yMax=a;}row(t,n=-ns,r=ns){if(t<this.yMin||t>=this.yMax)return null;let o=n===-ns&&r===ns?t:`${t}:${n}:${r}`,i=this.rows.get(o);return i===void 0&&(i=this.computeRow(t,n,r),this.rows.set(o,i)),i}computeRow(t,n,r){let o=[];for(let C of this.edges)t>=C.yStart&&t<C.yEnd&&o.push(C);if(o.length<2)return null;let i=o[0],s=o[1];i.xs[t-i.yStart]>s.xs[t-s.yStart]&&([i,s]=[s,i]);let a=i.xs[t-i.yStart],u=s.xs[t-s.yStart];if(a===u)return null;let[l,c]=this.weights(i,t),[f,m]=this.weights(s,t),b=Math.max(a,n),h=Math.min(u,r);if(b>=h)return null;let d=u-a,p=l,x=c,y=te(b,a);if(Math.abs(y)>Co){let C=we(y,d);p=fe(Q(te(f,l),C),l),x=fe(Q(te(m,c),C),c);}let g=te(u,h);if(Math.abs(g)>Co){let C=we(g,d);f=te(f,Q(te(f,l),C)),m=te(m,Q(te(m,c),C));}let M=h-b,E=we(te(f,p),M),P=we(te(m,x),M),[R,T,w]=this.colors,A=new Uint8Array(M*4),I=[0,0,0,0],{preset:S,adjust:v}=this.shading;for(let C=0;C<M;C++){if(S)S(te(te(1,p),x),I);else {let U=p,L=x;if(v){let k=v(te(te(1,p),x)),F=fe(x,p);if(F!==0){let _=we(te(1,k),F);U=Q(p,_),L=Q(x,_);}}for(let k=0;k<4;k++){let F=R[k],_=fe(Q(te(T[k],F),U),F);I[k]=fe(_,Q(te(w[k],F),L));}}p=fe(p,E),x=fe(x,P),uu(I,A,C*4);}return {xl:b,n:M,argb:A}}weights(t,n){let r=t.xMajor?t.xs[n-t.yStart]:n,o=we(Math.abs(r-t.origin),t.steps);return t.kind===0?[o,0]:t.kind===1?[te(1,o),o]:[0,te(1,o)]}};function uu(e,t,n){let r=e[0];if(!(Math.abs(r)>=Co)){t[n]=t[n+1]=t[n+2]=t[n+3]=0;return}0>r&&(r=0),r>255&&(r=255),t[n]=df(r);for(let o=1;o<4;o++){let i=e[o];0>i&&(i=0),i>r&&(i=r),t[n+o]=df(i);}}function df(e){let t=Math.floor(fe(e,.5));return Number.isFinite(t)?t&255:0}function Do(e,t,n,r,o=false){if(e===0)return 0;let i=o?we(255,e):0,s=a=>Math.min(255,o?Math.floor(Q(a,i)):Math.round(a*255/e));return (e<<24|s(t)<<16|s(n)<<8|s(r))>>>0}var lu=e=>Gn(1-ke(e));function os(e){if(!e||e.factors.length===0)return null;let t=e.factors.length;if(t===1){let o=ke(e.factors[0]);return o===1?null:i=>o>0&&i>=0&&i<=1?Gn(Math.pow(i,o)):i}let n=e.factors.map(lu).reverse(),r=e.positions.map(lu).reverse();return o=>{if(Xt(o,0)||Xt(1,o))return o;let i=1;if(rt(te(o,r[1]),pf))for(;;){if(i++,i>=t)return o;if(!rt(te(o,r[i]),pf))break}let s=te(r[i],r[i-1]);return rt(s,0)?fe(Q(we(te(o,r[i-1]),s),te(n[i],n[i-1])),n[i-1]):Q(fe(n[i],n[i-1]),.5)}}var pf=11920929e-14;function is(e){if(!e||e.argb.length<2)return null;let t=e.argb.length,n=e.argb.map(o=>Mn(o)).reverse(),r=e.positions.map(lu).reverse();return (o,i)=>{let s;if(Xt(o,0)||Xt(1,o)){s=Wn(0,o)?n[0]:n[t-1];for(let f=0;f<4;f++)i[f]=s[f];return}let a=1;for(;a<t&&rt(o,r[a]);)a++;if(a>=t){s=n[t-1];for(let f=0;f<4;f++)i[f]=s[f];return}let u=n[a-1],l=n[a],c=te(r[a],r[a-1]);if(rt(c,0)){let f=we(te(o,r[a-1]),c);for(let m=0;m<4;m++)i[m]=fe(Q(te(l[m],u[m]),f),u[m]);}else for(let f=0;f<4;f++)i[f]=Q(fe(l[f],u[f]),.5);}}var ss=2**30,xf=ke(-0.02),yf=ke(1.02),Or=class{constructor(t,n){this.minX=0;this.minY=0;this.width=0;this.height=0;this.e3x=0;this.e3y=0;this.e1x=0;this.e1y=0;this.e2x=0;this.e2y=0;this.p0x=0;this.p0y=0;this.a=0;this.det=0;this.yMin=0;this.yMax=0;this.flags=[0,0,0,0];this.yTop=[0,0,0,0];this.yBottom=[0,0,0,0];this.xTop=[0,0,0,0];this.slope=[0,0,0,0];if(this.constant=n,!t)return;let[r,o,i,s]=t,a=r[0],u=r[1],l=r[0],c=r[1];for(let h=1;h<4;h++){let[d,p]=t[h];d<a?a=d:d>l&&(l=d),p<u?u=p:p>c&&(c=p);}this.minX=a,this.minY=u,this.width=te(l,a),this.height=te(c,u),this.e3x=fe(te(te(r[0],o[0]),i[0]),s[0]),this.e3y=fe(te(te(r[1],o[1]),i[1]),s[1]),this.e1x=te(o[0],r[0]),this.e1y=te(o[1],r[1]),this.e2x=te(i[0],r[0]),this.e2y=te(i[1],r[1]),this.p0x=r[0],this.p0y=r[1],this.a=this.e3x===this.e2x&&this.e3y===this.e2y?0:te(Q(this.e2y,this.e3x),Q(this.e2x,this.e3y)),this.det=te(Q(this.e1x,this.e2y),Q(this.e1y,this.e2x));let f=[r,o,s,i];this.yMin=this.yMax=f[0][1];let m=f[0][0],b=f[0][0];for(let h=0;h<4;h++){let d=f[h],p=f[h+1&3];p[1]>d[1]?(this.flags[h]=1,this.yTop[h]=d[1],this.yBottom[h]=p[1],this.xTop[h]=d[0],this.slope[h]=we(te(p[0],d[0]),te(p[1],d[1]))):d[1]>p[1]?(this.flags[h]=2,this.yTop[h]=p[1],this.yBottom[h]=d[1],this.xTop[h]=p[0],this.slope[h]=we(te(p[0],d[0]),te(p[1],d[1]))):(this.flags[h]=0,this.yTop[h]=d[1],this.yBottom[h]=d[1],this.xTop[h]=d[0],this.slope[h]=0),d[0]<m&&(m=d[0]),d[0]>b&&(b=d[0]),d[1]<this.yMin&&(this.yMin=d[1]),d[1]>this.yMax&&(this.yMax=d[1]);}}spans(t,n,r){if(this.constant<0&&this.flags.every(c=>c===0))return [];let o=t;if(rt(this.minY,o))return [];if(Wn(o,fe(this.minY,this.height)))return [];let i=n,s=r;if(rt(this.minX,s))return [];if(Wn(i,fe(this.minX,this.width)))return [];if(rt(this.yMin,o))return [];if(Wn(o,this.yMax))return [];let a=[];for(let c=0;c<4;c++)this.flags[c]&&(Xt(o,this.yTop[c])||hf(this.yBottom[c],o)||a.push(fe(Q(te(o,this.yTop[c]),this.slope[c]),this.xTop[c])));let u=a.length&-2;if(u<2)return [];a.length=u,a.sort((c,f)=>c-f);let l=[];for(let c=0;c<u;c+=2){let f=a[c],m=a[c+1];if(Wn(f,s)||Wn(i,m))continue;f<i&&(f=i),m>s&&(m=s);let b=ts(f),h=ts(m);h>b&&l.push(b,h);}return l}parameter(t,n,r){if(this.constant>=0)return r[0]=r[1]=this.constant,true;let o=te(this.p0x,t),i=te(this.p0y,n),s=this.a,a=te(fe(Q(this.e3x,i),this.det),Q(this.e3y,o)),u=te(Q(this.e1x,i),Q(this.e1y,o)),l=0,c=0,f=0;if(s!==0||s!==s){let y=te(Q(a,a),Q(Q(s,4),u)),g=fe(s,s);if(rt(y,0)){l=2;let M=vo(y),E=fe(u,u),P=Xt(a,0)?te(M,a):te(-a,M),R=we(E,P),T=we(P,g);(rt(0,R)||rt(R,1))&&(Xt(T,0)||Xt(1,T)||([R,T]=[T,R])),c=R,f=T;}else y===0&&(l=1,c=we(-a,g));}else {if(a===0)return false;l=1,c=we(-u,a);}if(l===0)return false;let[m,b]=this.solveU(c,o,i);if(l===1)return b?(r[0]=m,r[1]=c,true):false;let h=y=>!(rt(xf,y)||rt(y,yf)),d=y=>!(Xt(y,xf)||Xt(yf,y));if(b&&h(m)&&h(c))return r[0]=m,r[1]=c,true;let[p,x]=this.solveU(f,o,i);return x&&d(p)&&d(f)?(r[0]=p,r[1]=f,true):b?(r[0]=m,r[1]=c,true):false}solveU(t,n,r){let o=fe(Q(this.e3x,t),this.e1x),i=fe(Q(this.e3y,t),this.e1y);return rt(Math.abs(o),Math.abs(i))?[we(-fe(Q(t,this.e2x),n),o),true]:rt(Math.abs(i),0)?[we(-fe(Q(t,this.e2y),r),i),true]:[0,false]}},cu=class{constructor(t,n,r,o,i){this.rows=new Map;this.quads=t,this.table=n,this.n=r,this.x0=o,this.width=i;}colorAt(t,n,r=-ss,o=ss){let i=r===-ss&&o===ss?n:`${n}:${r}:${o}`,s=this.rows.get(i);if(s===void 0&&(s=this.computeRow(n,r,o),this.rows.set(i,s)),!s)return null;let a=t-this.x0;if(a<0||a>=this.width)return null;let u=s[a];return u<0?null:u}colorForPosition(t){let n=ke(t);return rt(0,n)?n=0:n<1||(n=1),this.table[On(fe(Q(this.n,n),.5))]}computeRow(t,n,r){let o=null,i=[0,0],s=Math.max(n,this.x0-2),a=Math.min(r,this.x0+this.width+2);for(let u of this.quads){let l=u.spans(t,s,a);if(!l.length)continue;o||(o=new Float64Array(this.width).fill(-1)),i[0]=i[1]=0;let c=[];for(let m=0;m<l.length;m+=2)for(let b=l[m];b<l[m+1];b++)u.parameter(b,t,i),c.push(i[0]);let f=0;for(let m=0;m<l.length;m+=2)for(let b=l[m];b<l[m+1];b++){let h=this.colorForPosition(c[f++]),d=b-this.x0;d>=0&&d<this.width&&(o[d]=h);}}return o}};function mu(e,t){if(e.length===0)return 0;let n=ke(e[0].x),r=ke(e[0].y),o=n,i=r;for(let d of e){let p=ke(d.x),x=ke(d.y);p>o?o=p:p<n&&(n=p),x>i?i=x:x<r&&(r=x);}let s=te(o,n),a=te(i,r),u=(d,p)=>[fe(Q(p,ke(t[2])),Q(d,ke(t[0]))),fe(Q(p,ke(t[3])),Q(d,ke(t[1])))],l=u(0,0),c=u(s,0),f=u(s,a),m=u(0,a),b=(d,p)=>{let x=te(d[0],p[0]),y=te(d[1],p[1]);return vo(fe(Q(x,x),Q(y,y)))},h=fe(b(c,m),b(l,f));return Math.max(1,ts(h))}function Gr(e){return Q(On(fe(Q(e,16),.5)),.0625)}function gf(e,t){let n=e.boundary.length;if(n<2)return null;let r=mu(e.boundary,t),o=Mn(e.centerArgb),i=Mn(e.boundaryArgb[0]??4278190080),s=new Uint32Array(r+2),a=we(1,r),u=os(e.blend),l=is(e.preset),c=0,f=[0,0,0,0],m=new Uint8Array(4);for(let w=0;w<r+2;w++){if(l)l(c,f);else {let A=u?u(c):c;for(let I=0;I<4;I++)f[I]=fe(Q(te(i[I],o[I]),A),o[I]);}uu(f,m,0),s[w]=(m[0]<<24|m[1]<<16|m[2]<<8|m[3])>>>0,c=fe(c,a);}let b=Nn(t,e.center.x,e.center.y),h=Gr(b[0]),d=Gr(b[1]),p=ke(e.focus?.x??0),x=ke(e.focus?.y??0),y=p!==0||x!==0,g=[],M=[],E=h,P=h;for(let w=0;w<n;w++){let A=w+1<n?w+1:0,I=e.boundary[w],S=e.boundary[A];if(I.x===S.x&&I.y===S.y){g.push(new Or(null,-1)),y&&M.push(new Or(null,-1));continue}let v=Nn(t,I.x,I.y),C=Nn(t,S.x,S.y),U=Gr(v[0]),L=Gr(v[1]),k=Gr(C[0]),F=Gr(C[1]);E=Math.min(E,U,k),P=Math.max(P,U,k);let _=h,H=d,G=h,W=d;y&&(_=fe(Q(te(U,h),p),h),G=fe(Q(te(k,h),p),h),H=fe(Q(te(L,d),x),d),W=fe(Q(te(F,d),x),d),M.push(new Or([[h,d],[_,H],[h,d],[G,W]],0))),g.push(new Or([[_,H],[U,L],[G,W],[k,F]],-1));}let R=Math.floor(E)-2,T=Math.ceil(P)+3-R;return new cu(y?[...g,...M]:g,s,r,R,T)}var Rf=2.2;function rx(e,t){if(e<=3)return 16;let n=Math.abs(t.w)+Math.abs(t.h);return n>512?256:n>128?64:16}function ox(e){return e.preset?e.preset.positions.length:e.blend?e.blend.positions.length:2}function ix(e,t,n){let r=Math.min(e.length,t.length);if(r===0)return n;if(n<=e[0])return t[0];for(let o=1;o<r;o++)if(n<=e[o]){let i=e[o]-e[o-1],s=i>0?(n-e[o-1])/i:1;return t[o-1]+(t[o]-t[o-1])*s}return t[r-1]}function Nr(e,t){let n=e>>>24&255,r=n/255,o=i=>{let s=e>>>i&255;return (t?255*Math.pow(s/255,Rf):s)*r*(n<255?1-2**-40:1)};return [o(16),o(8),o(0),n]}function Mf(e,t,n){return [e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n,e[3]+(t[3]-e[3])*n]}var fu=new Float32Array(1),sx=new Int32Array(fu.buffer);function ne(e){let t=Math.fround(e);return Math.abs(t)>Math.abs(e)?(fu[0]=t,sx[0]-=1,fu[0]):t}function ax(e,t,n){let r=Math.min(e.length,t.length);if(r===0)return n;if(n<=e[0])return t[0];for(let o=1;o<r;o++)if(n<=e[o]){let i=ne(e[o]-e[o-1]),s=i>0?ne(ne(n-e[o-1])/i):1;return ne(t[o-1]+ne(ne(t[o]-t[o-1])*s))}return t[r-1]}function ux(e,t,n){let r=ne(1-n),o=(i,s)=>ne(ne(i*r)+ne(s*n));return [o(e[0],t[0]),o(e[1],t[1]),o(e[2],t[2]),o(e[3],t[3])]}function lx(e,t){let n=e.gammaCorrected;if(e.preset&&e.preset.positions.length>0){let{positions:i,argb:s}=e.preset,a=Math.min(i.length,s.length);if(t<=i[0]||a===1)return Nr(s[0],n);for(let u=1;u<a;u++)if(t<=i[u]){let l=i[u]-i[u-1],c=l>0?(t-i[u-1])/l:1;return Mf(Nr(s[u-1],n),Nr(s[u],n),c)}return Nr(s[a-1],n)}let r=Nr(e.startArgb,n),o=Nr(e.endArgb,n);return e.blend&&!n?ux(r,o,ax(e.blend.positions,e.blend.factors,t)):Mf(r,o,e.blend?ix(e.blend.positions,e.blend.factors,t):t)}function cx(e,t){if(t<=0)return 0;let n=t/255,r=Math.round(Math.min(1,Math.max(0,e/n/255))*1023)/1023;return 255*Math.pow(r,1/Rf)*n}function bu(e,t){let n=rx(ox(e),t),r=new Uint8Array((n+1)*4);for(let o=0;o<=n;o++){let i=lx(e,o/n),s=o*4;for(let a=0;a<3;a++){let u=e.gammaCorrected?cx(i[a],i[3]):i[a];r[s+a]=Math.min(255,Math.max(0,Math.floor(u+.5)));}r[s+3]=Math.min(255,Math.max(0,Math.floor(i[3]+.5)));}return {intervals:n,knots:r}}function hu(e){if(e.ramp)return e.ramp;let t=e.stops;return t.length===2&&t[0].offset===0&&t[1].offset===1&&t[0].argb!==void 0&&t[1].argb!==void 0?{startArgb:t[0].argb,endArgb:t[1].argb,preset:null,blend:null,gammaCorrected:false}:null}function mx(e,t){let n=t*4,r=e.knots[n+3];if(r===0)return 0;let o=i=>Math.min(255,Math.round(i*255/r));return (r<<24|o(e.knots[n])<<16|o(e.knots[n+1])<<8|o(e.knots[n+2]))>>>0}function Tf(e){let t=[];for(let n=0;n<=e.intervals;n++){let r=mx(e,n),o=(r>>>24&255)/255;t.push({offset:n/e.intervals,color:`rgba(${r>>>16&255},${r>>>8&255},${r&255},${Number(o.toFixed(4))})`,argb:r});}return t}var as=65536;function Ef(e,t,n){let r=(n==="tile-flip-x"||n==="tile-flip-xy"?2:1)*t*as;return (e%r+r)%r}function du(e,t){return Math.min(255,Math.floor(e*Math.floor(255*65536/t)/65536))}function fx(e,t,n,r,o=false){let i=e.intervals,s=Math.floor(t/as),a=Math.floor(t/256)&255,u=s<=i?s:2*i-s,l=s+1<=i?s+1:Math.max(0,2*i-s-1),c=e.knots,f=Math.min(i,u)*4,m=Math.min(i,l)*4,b=c[f+3]*(256-a)+c[m+3]*a+128>>8;if(b!==0){for(let h=0;h<3;h++){let d=c[f+h]*(256-a)+c[m+h]*a+128>>8;n[r+h]=b===255?d:o?du(d,b):Math.round(d*255/b);}n[r+3]=b;}}function bx(e,t,n,r){let o=e.intervals,i=Math.floor(t/as),s=Math.floor(t/256)&255,a=i<=o?i:2*o-i,u=i+1<=o?i+1:Math.max(0,2*o-i-1),l=e.knots,c=Math.min(o,a)*4,f=Math.min(o,u)*4;for(let m=0;m<4;m++)n[r+m]=l[c+m]*(256-s)+l[f+m]*s+128>>8;}function Pf(e,t){return [D(D(e[0]*t[0])+D(e[1]*t[2])),D(D(e[0]*t[1])+D(e[1]*t[3])),D(D(e[2]*t[0])+D(e[3]*t[2])),D(D(e[2]*t[1])+D(e[3]*t[3])),D(D(D(e[4]*t[0])+D(e[5]*t[2]))+t[4]),D(D(D(e[4]*t[1])+D(e[5]*t[3]))+t[5])]}function hx(e){let t=D(D(e[0]*e[3])-D(e[1]*e[2]));if(t===0)return null;let n=D(1/t),r=[D(e[3]*n),D(-e[1]*n),D(-e[2]*n),D(e[0]*n),D(D(D(e[5]*e[2])-D(e[4]*e[3]))*n),D(D(D(e[4]*e[1])-D(e[5]*e[0]))*n)];return r.every(Number.isFinite)?r:null}function dx(e){let t=Math.fround(e.x),n=Math.fround(e.y),r=Math.fround(e.w),o=Math.fround(e.h),i=[t,n],s=[D(t+r),n],a=[t,D(n+o)],u=D(D(D(D(r+t)*D(n+o))-D(n*t))+D(D(-o*t)-D(n*r)));if(Math.abs(u)<11920929e-14)return [1,0,0,1,0,0];let l=D(1/u),c=D(D(D(t+r)*D(n+o))-D(t*n)),f=D(-t*o),m=D(-n*r);return [D(D(D(o*s[0])+D(-o*i[0]))*l),D(D(D(o*s[1])+D(-o*i[1]))*l),D(D(D(r*a[0])+D(-r*i[0]))*l),D(D(D(r*a[1])+D(-r*i[1]))*l),D(D(D(D(f*s[0])+D(c*i[0]))+D(m*a[0]))*l),D(D(D(D(f*s[1])+D(c*i[1]))+D(m*a[1]))*l)]}function px(e,t,n,r){let o=Math.fround(e.x),i=Math.fround(e.y),s=Math.fround(e.w),a=Math.fround(e.h),u=r*as,l=D(o+s),c=D(i+a),f=D(D(l-o)/u),m=D(D(c-i)/u),b=[f,0,0,m,D(l-D(f*u)),D(c-D(m*u))],h=Pf(t.map(d=>Math.fround(d)),n.map(d=>Math.fround(d)));return hx(Pf(b,h))}function wf(e,t,n,r=false,o={x:0,y:0}){let i=e.rect,s=hu(e);if(!i||!s||!(Math.abs(i.w)>1e-9))return null;let a=bu(s,i),u=a.intervals,l=px(i,e.transform??dx(i),t,u);if(!l)return null;let c=n?.5:0,f=Math.floor(D(l[0]+.5)),m=Math.floor(D(l[2]+.5)),b=Math.floor(D(l[4]+(l[0]+l[2])*c+.5))-o.x*f-o.y*m,h=(d,p,x,y,g)=>{for(let M=0;M<y;M++){let E=b+d*f+(p+M)*m;for(let P=0;P<x;P++,E+=f)fx(a,Ef(E,u,e.wrapMode),g,(M*x+P)*4,r);}};return r&&(h.premultiplied=(d,p,x,y,g)=>{for(let M=0;M<y;M++){let E=b+d*f+(p+M)*m;for(let P=0;P<x;P++,E+=f)bx(a,Ef(E,u,e.wrapMode),g,(M*x+P)*4);}}),h}var Uo=[1,0,0,1,0,0];function je(e,t){return [e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function Sf(e){let t=e[0]*e[3]-e[1]*e[2];return !Number.isFinite(t)||Math.abs(t)<1e-12?null:[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t]}function Lo(e,t,n){let r=o=>{let i=e>>>o&255,s=t>>>o&255;return Math.round(i+(s-i)*n)};return (r(24)<<24|r(16)<<16|r(8)<<8|r(0))>>>0}function xx(e,t,n){let r=e>>>24&255,o=t>>>24&255;if(r===o)return Lo(e,t,n);let i=Math.round(r+(o-r)*n);if(i===0)return 0;let s=a=>{let u=(e>>>a&255)*r/255,l=(t>>>a&255)*o/255;return Math.min(255,Math.max(0,Math.round((u+(l-u)*n)*255/i)))};return (i<<24|s(16)<<16|s(8)<<8|s(0))>>>0}function vf(e,t=Uo){return mu(e,t)}function yx(e,t,n){let r=Math.min(e.length,t.length);if(r===0)return n;if(n<=e[0])return t[0];for(let o=1;o<r;o++)if(n<=e[o]){let i=e[o]-e[o-1],s=i>0?(n-e[o-1])/i:1;return t[o-1]+(t[o]-t[o-1])*s}return t[r-1]}function Af(e,t){if(e.length===0||e.some(n=>n.argb===void 0))return null;if(t<=e[0].offset)return e[0].argb;for(let n=1;n<e.length;n++){let r=e[n];if(t<=r.offset){let o=e[n-1],i=r.offset-o.offset;return Lo(o.argb,r.argb,i>0?(t-o.offset)/i:1)}}return e[e.length-1].argb}function us(e,t,n,r,o){let{center:i,boundary:s,boundaryArgb:a}=e,u=s.length,l=t-i.x,c=n-i.y,f=(r?.x??t)-i.x,m=(r?.y??n)-i.y,b=-1,h=0,d=0,p=1e-9;for(let T=0;T<u;T++){let w=s[T],A=s[(T+1)%u],I=w.x-i.x,S=w.y-i.y,v=A.x-w.x,C=A.y-w.y,U=I*C-S*v;if(Math.abs(U)<1e-12)continue;let L=(l*C-c*v)/U,k=(I*c-S*l)/U;if(L<-p||k<-p||k>L+p||L>1+p)continue;b=T;let F=(f*C-m*v)/U,_=(I*m-S*f)/U;h=Math.max(0,F),d=F>0?Math.min(1,Math.max(0,_/F)):0;}let x=b<0?1/0:h;if(e.focus){let T=Math.min(1,Math.max(0,e.focus.x)),w=Math.min(1,Math.max(0,e.focus.y));if(T===w)x=x<=T?0:(x-T)/(1-T);else if(x>0){let A=1-T,I=1-w,S=1/0,v=false;for(let C=0;C<u;C++){let U=s[C],L=s[(C+1)%u],k=U.x-i.x,F=U.y-i.y,_=L.x-U.x,H=L.y-U.y,G=k*H-F*_;if(Math.abs(G)<1e-12)continue;if(T===0&&w>0&&Math.abs((r?.x??t)-i.x)<p&&_>0&&Math.max(k,k+_)>0&&Math.abs(H)>p){let X=(((r?.y??n)-i.y)/w-F)/H;X>=-p&&X<=1+p&&(v=true);}if((T>0||Math.abs(l)<p)&&(w>0||Math.abs(c)<p)){let X=T>0?l/T:0,B=w>0?c/w:0,O=(X*H-B*_)/G,j=(k*B-F*X)/G;O>=-p&&O<=1+p&&j>=-p&&j<=O+p&&(v=true,b<0&&(b=C));}let W=G*A*I,N=G*(T*I+w*A)-l*H*I+c*_*A,Z=G*T*w-l*H*w+c*_*T,J=N*N-4*W*Z,K=Math.abs(W)<1e-12?Math.abs(N)>1e-12?[-Z/N]:[]:J>=0?[(-N-Math.sqrt(J))/(2*W),(-N+Math.sqrt(J))/(2*W)]:[],ie=0,ce=0,$=0;for(let X of K){if(X<-p||X>1+p)continue;let B=T+A*X,O=w+I*X;if(O===0&&B>0&&Math.abs(c)<p&&H>0&&Math.max(F,F+H)>0&&Math.abs(_)>p){let q=(l/B-k)/_;if(q>=-p&&q<=1+p){ie=1,ce=0,$=Math.min(1,Math.max(0,q));break}}if(B<=0||O<=0)continue;let j=Math.abs(_)>Math.abs(H)?(l/B-k)/_:(c/O-F)/H;j>=-p&&j<=1+p&&(ie++,ce=Math.max(0,X),$=Math.min(1,Math.max(0,j)));}ie===1&&(S=ce,b=C,d=$);}x=v?0:Number.isFinite(S)?S:x;}}if(b<0||!Number.isFinite(x))return null;o&&(o.s=x);let y=1-x;if(e.preset&&e.preset.positions.length>0){let{positions:T,argb:w}=e.preset;if(y<=T[0])return w[0];for(let A=1;A<T.length;A++)if(y<=T[A]){let I=T[A]-T[A-1];return Lo(w[A-1],w[A],I>0?(y-T[A-1])/I:1)}return w[T.length-1]}let g=a[b]??e.centerArgb,M=a[(b+1)%u]??g,E=Lo(g,M,d),P=e.blend?yx(e.blend.positions,e.blend.factors,y):y,R=Math.min(1,Math.max(0,P));return E>>>24!==e.centerArgb>>>24&&a.every(T=>T===a[0])?xx(E,e.centerArgb,R):Lo(E,e.centerArgb,R)}var gx=2048;function Cf(e){return {x:e==="tile-flip-x"||e==="tile-flip-xy",y:e==="tile-flip-y"||e==="tile-flip-xy"}}function ls(e,t,n,r,o,i,s,a,u){if(typeof e.createPattern!="function")return null;let l=o==="clamp"?{x:false,y:false}:Cf(o),c=n*(l.x?2:1),f=r*(l.y?2:1),m=chunk7JVB7NLG_js.Y(c,f);if(!m)return null;let b=t.w/n,h=t.h/r,d=E=>{let P=E%n*b+(.5+a.phaseX)*b;return E<n?P:t.w-a.lagX-(P-(.5+a.phaseX)*b)-.5*b},p=E=>{let P=(E%r+.5)*h;return E<r?P:t.h-a.lagY-P},x=new Uint8ClampedArray(c*f*4);for(let E=0;E<f;E++){let P=t.y+p(E);for(let R=0;R<c;R++){let T=u(t.x+d(R),P);if(T===null)continue;let w=(E*c+R)*4;x[w]=T>>>16&255,x[w+1]=T>>>8&255,x[w+2]=T&255,x[w+3]=T>>>24&255;}}chunk7JVB7NLG_js.la(m.ctx,chunk7JVB7NLG_js.na(x,c,f),0,0);let y=chunk7JVB7NLG_js.ma(e,m.canvas,o==="clamp"?"no-repeat":"repeat");if(!y||typeof y.setTransform!="function")return null;let g=[b,0,0,h,t.x+a.phaseX*b,t.y],M=je([1,0,0,1,s.x,s.y],je(i,g));try{y.setTransform({a:M[0],b:M[1],c:M[2],d:M[3],e:M[4],f:M[5]});}catch{return chunk7JVB7NLG_js.p("buildPattern: pattern.setTransform rejected"),null}return y}function Fo(e){let t=Sf(e);return t?{x:t[0]*.5+t[2]*.5,y:t[1]*.5+t[3]*.5}:{x:0,y:0}}var Mx=4;function pu(e,t,n){let r=t==="x"?Math.hypot(e[0],e[1]):Math.hypot(e[2],e[3]);return Math.max(2,Math.min(gx,Math.ceil(Math.abs(n)*r*Mx)))}function Df(e,t){let n=t??Uo,r=(c,f)=>({x:n[0]*c+n[2]*f+n[4],y:n[1]*c+n[3]*f+n[5]}),o=r(e.x,e.y+e.h/2),i=r(e.x+e.w,e.y+e.h/2),s=n[3],a=-n[2],u=s*s+a*a;if(u<1e-12)return {x1:o.x,y1:o.y,x2:i.x,y2:i.y};let l=((i.x-o.x)*s+(i.y-o.y)*a)/u;return {x1:o.x,y1:o.y,x2:o.x+s*l,y2:o.y+a*l}}function Ex(e,t){if(typeof e.createLinearGradient!="function")return null;let n=t.rect?Df(t.rect,t.transform):t;if(n.x1===n.x2&&n.y1===n.y2)return null;let r=e.createLinearGradient(n.x1,n.y1,n.x2,n.y2);for(let o of t.stops)r.addColorStop(o.offset,o.color);return r}var If=1e-5,Px=2048;function Rx(e){let t=e.canvas,n=t?.width,r=t?.height;return typeof n=="number"&&typeof r=="number"&&n>0&&r>0?{w:n,h:r}:null}function Tx(e,t,n,r){let o=Rx(e),i=Sf(r);if(!o||!i||typeof e.createLinearGradient!="function")return null;let s=Df(n,t.transform),a=Fo(r),u=s.x2-s.x1,l=s.y2-s.y1,c=s.x1+a.x+u*If,f=s.y1+a.y+l*If,m=u*u+l*l;if(!(m>1e-12))return null;let b=1/0,h=-1/0;for(let[E,P]of [[0,0],[o.w,0],[0,o.h],[o.w,o.h]]){let R=E-r[4],T=P-r[5],w=i[0]*R+i[2]*T,A=i[1]*R+i[3]*T,I=((w-c)*u+(A-f)*l)/m;b=Math.min(b,I),h=Math.max(h,I);}let d=Math.floor(b),p=Math.max(d+1,Math.ceil(h));if(p-d>Px)return null;let x=e.createLinearGradient(c+u*d,f+l*d,c+u*p,f+l*p),y=p-d,g=Cf(t.wrapMode).x,M=[...t.stops].reverse();for(let E=d;E<p;E++){let P=g&&(E%2+2)%2===1;for(let R of P?M:t.stops){let T=P?1-R.offset:R.offset;x.addColorStop(Math.min(1,Math.max(0,(E-d+T)/y)),R.color);}}return x}function wx(e){let t=e.rect?hu(e):null;return t&&e.rect?Tf(bu(t,e.rect)):e.stops}function Ax(e,t,n){let r={...t,stops:wx(t)},o=r.rect;if(r.wrapMode!=="clamp"&&o&&o.w!==0){let i=Tx(e,r,o,n);if(i)return i;if(Af(r.stops,0)!==null){let s=r.transform??Uo,a=pu(je(n,s),"x",o.w),u=ls(e,o,a,1,r.wrapMode,s,Fo(n),{phaseX:.5,lagX:0,lagY:0},l=>Af(r.stops,(l-o.x)/o.w));if(u)return u}chunk7JVB7NLG_js.p("createBrushGradient: linear gradient could not be tiled");}return Ex(e,r)}function Ix(e){if(e.length<3)return null;let t=1/0,n=1/0,r=-1/0,o=-1/0;for(let i of e)t=Math.min(t,i.x),n=Math.min(n,i.y),r=Math.max(r,i.x),o=Math.max(o,i.y);return r>t&&o>n?{x:t,y:n,w:r-t,h:o-n}:null}function Sx(e,t,n,r){let o=Ix(t.boundary);if(!o)return null;let i=t.transform??Uo,s=je(r,i),a=Math.hypot(s[0],s[1]),u=Math.hypot(s[2],s[3]);return ls(e,o,pu(s,"x",o.w),pu(s,"y",o.h),n,i,Fo(r),{phaseX:0,lagX:a>0?1/a:0,lagY:u>0?1/u:0},(l,c)=>us(t,l,c))}function vx(e,t){if(!(t.r>0)||typeof e.createRadialGradient!="function")return null;let n=e.createRadialGradient(t.cx,t.cy,0,t.cx,t.cy,t.r);for(let r of t.stops)n.addColorStop(r.offset,r.color);return n}function Lf(e,t,n=Uo){try{if(t.type==="linear")return Ax(e,t,n);if(t.shape){let r=Sx(e,t.shape,t.wrapMode,n);if(r)return r;chunk7JVB7NLG_js.p("createBrushGradient: path gradient pattern unavailable, using the radial approximation");}return vx(e,t)}catch{return null}}var cs,ms,fs,bs,Cx={johab:async()=>{cs??(cs=(await import('./browser-chunks/emf-ansi-johab-KHT3RJ3R.js')).JOHAB_ROWS);},illuminants:async()=>{ms??(ms=(await import('./browser-chunks/emf-gdi-illuminant-data-YYCDAVZT.js')).ILLUMINANT_CUBE_DATA);},chromaTies:async()=>{fs??(fs=(await import('./browser-chunks/emf-gdi-chroma-tie-data-YFCUXKFP.js')).CHROMA_TIE_FLIPS);},colorCurve:async()=>{bs??(bs=(await import('./browser-chunks/emf-plus-image-curves-OLOBXBF7.js')).nativeCurveLookup);}};async function xu(e){await Promise.all(Array.from(e,t=>Cx[t]()));}function Uf(e){if(!(e<128)){if(!cs)throw new Error("Johab replay data was not loaded");return cs[e]}}function Ff(e){if(!(e===0||e===6)){if(!ms)throw new Error("GDI color replay data was not loaded");return ms[e]}}function kf(e){if(!fs)throw new Error("GDI color replay data was not loaded");return fs[e]}function _f(e,t){if(!bs)throw new Error("GDI+ color curve replay data was not loaded");return bs(e,t)}var Dx={"633C80A4-1843-482B-9EF2-BE2834C5FDD4":"blur","D3A1DBE1-8EC4-4C17-9F4C-EA97AD1C343D":"brightnessContrast","537E597D-251E-48DA-9664-29CA496B70F8":"colorBalance","DD6A0022-58E4-4A67-9D9B-D48EB881A53D":"colorCurve","A7CE72A9-0F7F-40D7-B3CC-D0C02D5C3212":"colorLookupTable","718F2615-7933-40E3-A511-5F68FE14DD74":"colorMatrix","8B2DD6C3-EB07-4D87-A5F0-7108E26A9C5F":"hueSaturationLightness","99C354EC-2A31-4F3A-8C34-17A803B33A25":"levels","74D29D05-69A4-4266-9549-3CC52836B632":"redEyeCorrection","63CBF3EE-C526-402C-8F71-62C540BF5142":"sharpen","1077AF00-2848-4441-9489-44AD4C2D7A2C":"tint"},Nf=8192;var Wr={All:0,Red:1,Green:2,Blue:3},hs=(e,t)=>e.toString(16).toUpperCase().padStart(t,"0");function Lx(e,t){let n=[];for(let r=0;r<8;r++)n.push(hs(e.getUint8(t+8+r),2));return [hs(e.getUint32(t,true),8),hs(e.getUint16(t+4,true),4),hs(e.getUint16(t+6,true),4),n.slice(0,2).join(""),n.slice(2).join("")].join("-")}var Ne=(e,t,n)=>e<t?t:e>n?n:e,Ux=12;function ys(e,t,n){if(n<20||t<0||t+n>e.byteLength)return null;let r=Dx[Lx(e,t)],o=e.getUint32(t+16,true);if(!r||20+o>n)return null;let i=t+20,s=(l,c,f)=>Ne(e.getInt32(i+4*l,true),c,f),a=(l,c,f)=>{let m=e.getFloat32(i+4*l,true);return Number.isFinite(m)?Ne(m,c,f):0},u=l=>o>=l;switch(r){case "blur":return u(8)?{kind:r,radius:a(0,0,255),expandEdge:e.getUint32(i+4,true)!==0}:null;case "brightnessContrast":return u(8)?{kind:r,brightness:s(0,-255,255),contrast:s(1,-100,100)}:null;case "colorBalance":return u(12)?{kind:r,cyanRed:s(0,-100,100),magentaGreen:s(1,-100,100),yellowBlue:s(2,-100,100)}:null;case "colorCurve":{if(!u(Ux))return null;let l=e.getInt32(i,true),c=e.getInt32(i+4,true),f=e.getInt32(i+8,true),m=l<2?-255:l<6?-100:l===6?1:0,b=l===7?254:l<2||l===6?255:100;return l<0||l>7||c<0||c>3||f<m||f>b?null:{kind:r,adjustment:l,channel:c,intensity:f}}case "colorLookupTable":{if(!u(1024))return null;let l=c=>new Uint8Array(e.buffer.slice(e.byteOffset+i+256*c,e.byteOffset+i+256*(c+1)));return {kind:r,b:l(0),g:l(1),r:l(2),a:l(3)}}case "colorMatrix":{if(!u(100))return null;let l=[];for(let c=0;c<25;c++){let f=e.getFloat32(i+4*c,true);if(!Number.isFinite(f))return null;l.push(f);}return {kind:r,matrix:l}}case "hueSaturationLightness":return u(12)?{kind:r,hue:s(0,-180,180),saturation:s(1,-100,100),lightness:s(2,-100,100)}:null;case "levels":return u(12)?{kind:r,highlight:s(0,0,100),midtone:s(1,-100,100),shadow:s(2,0,100)}:null;case "redEyeCorrection":{if(!u(4))return null;let l=e.getInt32(i,true);if(l<0||4+16*l>o)return null;let c=[];for(let f=0;f<l;f++){let m=i+4+16*f;c.push({left:e.getInt32(m,true),top:e.getInt32(m+4,true),right:e.getInt32(m+8,true),bottom:e.getInt32(m+12,true)});}return {kind:r,areas:c}}case "sharpen":return u(8)?{kind:r,radius:a(0,0,255),amount:a(1,0,100)}:null;case "tint":return u(8)?{kind:r,hue:s(0,-180,180),amount:s(1,-100,100)}:null}}var Wf=e=>Math.ceil(e-.5);function Eu(e,t=Math.round){let n=new Uint8Array(256);for(let r=0;r<256;r++)n[r]=Ne(t(e(r)),0,255);return n}function Bf(e){let t=1,n=0,r=50;for(;Math.abs(e)>=r&&r<100;)t++,n=r,r=(r+100)/2;return t=Math.abs(e)===100?10:Math.min(10,ne(t+ne(ne(Math.abs(e)-n)/ne(r-n)))),e<0?ne(t):ne(1/ne(t))}function Fx(e,t){let n=t>=100?1e6:t>=0?100/(100-t):(100+t)/100,r=e/2;return Eu(o=>(o+r-127.5)*n+127.5+r)}function yu(e){return Eu(t=>t*(Math.floor((1+e/100)*65536)/65536))}function kx(e,t){if(!Number.isInteger(e)||e<0||e>7)return null;let n=e<2?-255:e<6?-100:e===6?1:0,r=e===7?254:e<2||e===6?255:100;return _f(e,Ne(Math.trunc(t),n,r)).slice()}function _x(e,t,n){if(e!==n){let s=e>n,a=ne((s?n:e)*255/100),u=ne((s?e:n)*255/100),l=ne(1/ne(u-a)),c=Bf(t),f=new Uint8Array(256);for(let m=0;m<256;m++){let b=Ne(ne(ne(m-a)*l),0,1);t!==0&&(b=ne(b**c));let h=s?ne(255*b):ne(255-ne(255*b));f[m]=Ne(Math.floor(h+.5),0,255);}return f}let r=n*255/100-(e===n&&n<50?1:0),o=e===n?1:(e-n)*255/100,i=Bf(t);return Eu(s=>{let a=Ne((s-r)/o,0,1);return 255*(e>=n?a**i:1-(1-a)**i)},Wf)}function ko(e,t,n,r,o=null){let i=new Uint8ClampedArray(e);for(let s=0;s<i.length;s+=4)t&&(i[s]=t[e[s]]),n&&(i[s+1]=n[e[s+1]]),r&&(i[s+2]=r[e[s+2]]),o&&(i[s+3]=o[e[s+3]]);return i}function Bx(e,t){let n=new Uint8ClampedArray(e.length);for(let r=0;r<e.length;r+=4){let o=e[r]/255,i=e[r+1]/255,s=e[r+2]/255,a=e[r+3]/255;for(let u=0;u<4;u++){let l=o*t[u]+i*t[5+u]+s*t[10+u]+a*t[15+u]+t[20+u];n[r+u]=Math.round(Ne(l,0,1)*255);}}return n}var Zt=43,ds=255;function Gx(e,t,n){let r=Math.max(e,t,n),o=r-Math.min(e,t,n),i=u=>Math.floor(u*Zt/o);if(r===e&&t>=n)return i(t-n);if(r===n&&n!==e)return e>=t?170+i(e-t):127+i(n-t);if(r===t)return n>=e?86+i(n-e):43+i(t-e);let s=i(n-t),a=(256-s-(s>=40?1:0))%256;return a-Math.floor((a+42)/86)}function Ox(e,t,n,r){let o=new Uint8ClampedArray(e),i=Math.round(t*ds/360),s=65536+Math.floor(n*65536/100),a=Math.round(255*Math.floor(r*65536/100)/65536);for(let u=0;u<e.length;u+=4){let l=e[u],c=e[u+1],f=e[u+2],m=Math.max(l,c,f),b=Math.min(l,c,f),h=Ne((m+b>>1)+a,0,255);if(m===b){o[u]=o[u+1]=o[u+2]=h;continue}let d=m+b,p=Ne(Math.round(Math.floor((m-b)*255/(d<=255?d:510-d))*s/65536),0,255),x=h<=127?Math.floor(h*(255+p)/255):h+p-Math.floor(h*p/255),y=2*h-x,g=x,M=((Gx(l,c,f)+i)%ds+ds)%ds,E=M+Math.floor((M+41)/85),P=Math.min(5,Math.floor(E/Zt)),R=E-P*Zt,T=y+Math.floor((g-y)*R/Zt),w=y+Math.floor((g-y)*(Zt-R)/Zt),[A,I,S]=[[g,T,y],[w,g,y],[y,g,T],[y,w,g],[T,y,g],[g,y,w]][P];o[u]=A,o[u+1]=I,o[u+2]=S;}return o}function Nx(e,t,n){let r=(Math.round(t*255/360)+256)%256,o=(r+Math.floor((r+41)/85))%258,i=Math.min(5,Math.floor(o/Zt)),s=o-i*Zt,a=Math.floor($n*s/Zt),u=Math.floor($n*(Zt-s)/Zt),[l,c,f]=[[$n,a,0],[u,$n,0],[0,$n,a],[0,u,$n],[a,0,$n],[$n,0,u]][i],m=Math.sign(n)*Math.floor((255*Math.abs(n)+49)/100),b=255-m,h=new Uint8ClampedArray(e);for(let d=0;d<e.length;d+=4){let p=e[d],x=e[d+1],y=e[d+2],g=m*Math.max(p,x,y)>>8,M=b*p+l*g,E=b*x+c*g,P=b*y+f*g,R=54*p+183*x+19*y-(54*(M>>8)+183*(E>>8)+19*(P>>8));h[d]=R+M>>8,h[d+1]=R+E>>8,h[d+2]=R+P>>8;}return h}var $n=254;function Wx(e,t,n,r){let o=new Uint8ClampedArray(e),i={x:0,y:0,set:false};for(let s of r)Kx(o,t,Ne(s.left,0,t),Ne(s.top,0,n),Ne(s.right,0,t),Ne(s.bottom,0,n),i);return o}var ps=60,Hx=15,$x=2/9,Xx=1;function jx(e,t){return Math.floor((9*e+2*t+5)/11)}var gu=5/16,Gf=[25,40,80],Yx=[.25,.5,.66,.75],Vx=40,zx=.33,qx=5;function Jx(e,t,n){let r=0,o=0,i=0;for(let s=0;s<n;s++)for(let a=0;a<t;a++){let u=255-e[s*t+a];r=ne(r+ne(u*a)),o=ne(o+ne(u*s)),i=ne(i+u);}return {cx:ne(ne(r/i)+.5),cy:ne(ne(o/i)+.5)}}function Kx(e,t,n,r,o,i,s){let a=o-n,u=i-r,l=a*u;if(!(l>0))return;let c=new Float64Array(l),f=new Float64Array(l),m=new Int32Array(l),b=0,h=0,d=0;for(let J=0;J<u;J++)for(let K=0;K<a;K++){let ie=((r+J)*t+n+K)*4,ce=e[ie],$=e[ie+1],X=e[ie+2],B=J*a+K;f[B]=$+$x*X;let O=jx($,X);m[B]=O;let j=ce-Math.max($,X);if(j>0){c[B]=j;let q=ne(O>=1?j/O:Xx);b=ne(b+ne(q*K)),h=ne(h+ne(q*J)),d=ne(d+q);}}if(d===0)return;s.set&&(b=ne(b+ne(s.x-.5)),h=ne(h+ne(s.y-.5)));let p=ne(ne(b/d)+.5),x=ne(ne(h/d)+.5);s.x=n+p,s.y=r+x,s.set=true;let y=false;Math.hypot(p-a/2,x-u/2)>=(a+u)/6&&(y=true,{cx:p,cy:x}=Jx(m,a,u));let g=n+p,M=r+x,E=Math.round(p)>a/2?a-p+.5:p-.5,P=Math.round(x)>u/2?u-x+.5:x-.5,R=g>M?Math.min(E,M-.5):Math.min(P,g-.5);if(!(R>0))return;let T=Int32Array.from(m).sort(),w=T[Math.floor(.7*l)],A=w-T[Math.floor(.3*l)],I=T[l-1],S=l>1?T[l-2]:-1,v=-1;I>S&&I-w>=Vx&&(v=m.indexOf(I));let C=0;for(;C<Gf.length&&A>Gf[C];)C++;let U=Yx[C],L=new Uint8Array(l),k=new Float64Array(l),F=new Float64Array(ps),_=new Float64Array(ps),H=new Float64Array(ps),G=180/Math.PI,W=ne(R*R);for(let J=0;J<u;J++)for(let K=0;K<a;K++){let ie=K+.5-p,ce=J+.5-x,$=J*a+K,X=ne(ne(ie*ie)+ne(ce*ce));k[$]=ne(Math.sqrt(X));let B=Math.atan2(ce,ie)*G;B<0&&(B+=360);let O=ie===0&&ce===0?Hx:ce===0?0:Math.min(ps-1,Math.floor(B/6));L[$]=O,X<W&&(F[O]+=c[$],_[O]+=f[$],H[O]++);}v>=0&&!(k[v]<R)&&(v=-1);let N=ne,Z=N(U);for(let J=0;J<u;J++)for(let K=0;K<a;K++){let ie=J*a+K,ce=c[ie];if(ce<=0||k[ie]>=R)continue;let $=L[ie],X=N(F[$]/H[$]),B=N(_[$]/H[$]),O=B>0?N(f[ie]/B):1,j=N(1-N(k[ie]/R)),q=O<2?N(.5*N(N(1-O)*N(1-O))):0,ae=Math.max(N(Z*N(j*j)),q,y?N(zx*j):0),se=N(N(1-ae)*X);if(v>=0){let ee=K-v%a,le=J-Math.floor(v/a);se=Math.min(se,qx*(ee*ee+le*le));}if(se>=ce)continue;let de=ce-se,me=((r+J)*t+n+K)*4;e[me]=Math.round(e[me]-(1-gu)*de),e[me+1]=Math.round(e[me+1]+gu*de),e[me+2]=Math.round(e[me+2]+gu*de);}}function Hf(e){let t=Math.ceil(e),n=new Float64Array(2*t+1);if(t===0)return n[0]=1,n;let r=ne(ne(1.4)/Math.fround(e)),o=new Float64Array(t+1);o[0]=1;let i=0,s=1;for(let u=1;u<=t;u++)i=ne(i+r),o[u]=ne(Math.exp(-ne(i*i))),s=ne(s+ne(2*o[u]));let a=ne(256/s);for(let u=0;u<=t;u++){let l=ne(o[u]*a)/256;n[t+u]=l,n[t-u]=l;}return n}function Mu(e,t){if(t===1)return 0;for(;e<0||e>=t;)e=e<0?-e:2*(t-1)-e;return e}function $f(e,t,n,r,o=0,i=false,s=Math.ceil(n/t)){let a=Hf(r),u=(a.length-1)/2,l=(u|1)>=t?m=>Math.max(0,Math.min(t-1,m)):m=>Mu(m,t),c=(u|1)>=n?m=>Math.max(0,Math.min(n-1,m)):m=>Mu(m,n),f=new Float64Array(t*n*4);for(let m=0;m<n;m++){let b=m*t*4;for(let h=0;h<t;h++){let d=0,p=0,x=0,y=0;for(let M=-u;M<=u;M++){let E=b+l(h+M)*4,P=M===0?a[u]*128:a[M+u]*256,R=M===0?2:1;d+=R*Math.round(P*e[E]),p+=R*Math.round(P*e[E+1]),x+=R*Math.round(P*e[E+2]),y+=R*Math.round(P*e[E+3]);}let g=b+h*4;f[g]=Math.floor((d+128)/256),f[g+1]=Math.floor((p+128)/256),f[g+2]=Math.floor((x+128)/256),f[g+3]=Math.floor((y+128)/256);}}if(u>0&&o>=0&&o<n){let m=f.slice(),b=Math.min(n,o+s);for(let h=o;h<b;h++){let d=new Float64Array(t*4);for(let p=-u;p<=u;p++){let x=h+p;if(i&&x<o)continue;let y=c(x)*t*4,g=p===0?a[u]*128:a[p+u]*256,M=p===0?2:1;for(let E=0;E<t*4;E++)d[E]+=M*Math.round(g*m[y+E])/256;}f.set(d,h*t*4);}}return f}function Xf(e){return e<20?1:e<40?2:e<=80?4:e<160?8:16}function Of(e,t,n,r,o,i,s,a={start:0,size:e,pad:0}){let u=Math.ceil(a.size/n),l=u+2*a.pad,c=(r.length-1)/2,f=(c|1)>=o?p=>Ne(p,0,l-1):p=>Mu(p,l),m=new Float64Array(l),b=new Float64Array(l),h=r.map(p=>p*256),d=h[c]/2;h[c]=0;for(let p=0;p<t;p++)for(let x=0;x<4;x++){for(let M=a.pad;M<a.pad+u;M++){let E=a.start+(M-a.pad)*n,P=Math.min(a.start+a.size,E+n),R=0;for(let T=E;T<P;T++)R+=i(T,p,x);m[M]=Math.floor(R/(P-E));}for(let M=0;M<l;M++){let E=0;if(M>=c&&M+c<l)for(let P=0;P<h.length;P++)E+=Math.round(h[P]*m[M-c+P]);else for(let P=0;P<h.length;P++){let R=M-c+P;E+=Math.round(h[P]*(a.zeroOutside&&(R<0||R>=l)?0:m[f(R)]));}E+=2*Math.round(d*m[M]),b[M]=Math.floor((E+128)/256);}let y=u===1&&a.pad>0,g=u===1&&a.size-Math.ceil(n/2)===1?a.start+a.size-1:-1;for(let M=0;M<e;M++){if(M===g){a.pad>0&&s(M,p,x,0);continue}let E=(M-a.start+.5)/n-.5;if(y){let T=Math.abs(M-a.start-(Math.min(a.size,n/2)-.5))/n;s(M,p,x,Ne(Math.floor((1+T)*b[a.pad]+1e-9),0,255));continue}let P=Ne(Math.floor(E),0,Math.max(0,u-2)),R=E-P;s(M,p,x,Ne(Math.floor((1-R)*b[a.pad+P]+R*b[a.pad+Math.min(u-1,P+1)]+1e-9),0,255));}}}function Pu(e,t,n,r,o,i=false){let s=Xf(r);if(s===1)return $f(e,t,n,r);let a=Hf(r/s),u=o?Math.ceil(Math.ceil(r)/s):0,l=o?{start:o.x,size:o.w,pad:u,zeroOutside:true}:i?{start:0,size:t,pad:0,zeroOutside:true}:void 0,c=o?{start:o.y,size:o.h,pad:u,zeroOutside:true}:i?{start:0,size:n,pad:0,zeroOutside:true}:void 0,f=new Uint8Array(e);Of(t,n,s,a,Math.ceil(t/s),(b,h,d)=>e[(h*t+b)*4+d],(b,h,d,p)=>{f[(h*t+b)*4+d]=p;},l);let m=Float64Array.from(f);return Of(n,t,s,a,Math.ceil(n/s),(b,h,d)=>f[(b*t+h)*4+d],(b,h,d,p)=>{m[(b*t+h)*4+d]=p;},c),m}function Zx(e,t,n,r){return Uint8ClampedArray.from(Pu(e,t,n,r),Math.round)}function Qx(e,t){return Wf(64*t/(250-2*t))/64}function ey(e,t,n,r,o){let i=Pu(e,t,n,r),s=Qx(r,o),a=new Uint8ClampedArray(e);for(let u=0;u<e.length;u+=4){for(let l=0;l<3;l++)a[u+l]=Math.round(e[u+l]+s*(e[u+l]-Math.round(i[u+l])));a[u+3]=Math.max(e[u+3],a[u],a[u+1],a[u+2]);}return a}function ty(e,t,n,r){if(t<=0||n<=0||e.length!==t*n*4)return null;switch(r.kind){case "blur":return Zx(e,t,n,r.radius);case "sharpen":return ey(e,t,n,r.radius,r.amount);case "brightnessContrast":{let o=Fx(r.brightness,r.contrast);return ko(e,o,o,o)}case "colorBalance":return ko(e,yu(r.cyanRed),yu(r.magentaGreen),yu(r.yellowBlue));case "colorCurve":{let o=kx(r.adjustment,r.intensity),i=r.channel;if(!o||i<Wr.All||i>Wr.Blue)return null;let s=a=>i===Wr.All||i===a?o:null;return ko(e,s(Wr.Red),s(Wr.Green),s(Wr.Blue))}case "colorLookupTable":return ko(e,r.r,r.g,r.b,r.a);case "colorMatrix":return Bx(e,r.matrix);case "hueSaturationLightness":return Ox(e,r.hue,r.saturation,r.lightness);case "levels":{let o=_x(r.highlight,r.midtone,r.shadow);return ko(e,o,o,o)}case "redEyeCorrection":return Wx(e,t,n,r.areas);case "tint":return Nx(e,r.hue,r.amount)}}function xs(e,t,n,r,o,i,s,a,u,l){for(let c=0;c<i;c++){let f=((r+c)*t+n)*4;s.set(e.subarray(f,f+o*4),((l+c)*a+u)*4);}}function ny(e,t,n,r,o,i,s,a,u){let l=Math.ceil(r),c=s-o+2*l,f=a-i+2*l,m=new Uint8ClampedArray(c*f*4);if(u)xs(e,t,o,i,s-o,a-i,m,c,l,l);else {let x=Math.max(0,o-l),y=Math.max(0,i-l),g=Math.min(t,s+l),M=Math.min(n,a+l);xs(e,t,x,y,g-x,M-y,m,c,x-(o-l),y-(i-l));}let b=Xf(r)>1?Pu(m,c,f,r,u?{x:l,y:l,w:s-o,h:a-i}:void 0,true):$f(m,c,f,r,u?l:0,u,Math.ceil((a-i)/(s-o))),h=s-o,d=new Uint8ClampedArray(h*(a-i)*4),p=new Uint8ClampedArray((a-i)*4);for(let x=0;x<a-i;x++){let y=((x+l)*c+l)*4;for(let g=0;g<h*4;g++)d[x*h*4+g]=Math.round(b[y+g]);for(let g=0;g<4;g++)p[x*4+g]=Math.round(b[y+h*4+g]);}return {out:d,halo:p}}function jf(e){let t=new Uint8ClampedArray(e);for(let n=0;n<t.length;n+=4){let r=t[n+3];if(r!==255)for(let o=0;o<3;o++)t[n+o]=r===0?0:Math.min(255,Math.floor(Math.round(t[n+o]*r/255)*255/r));}return t}function Yf(e,t,n,r,o){if(t<=0||n<=0||e.length!==t*n*4)return null;let i=0,s=0,a=t,u=n;if(o&&(i=Ne(Math.floor(o.x),0,t),s=Ne(Math.floor(o.y),0,n),a=Ne(Math.ceil(o.x+o.w)+1,0,t),u=Ne(Math.ceil(o.y+o.h)+1,0,n),a<=i||u<=s||o.x+o.w<=i||o.y+o.h<=s))return null;let l=a-i,c=u-s,f=o?Math.min(l,Math.ceil(o.x+o.w)-i):l,m=o?Math.min(c,Math.ceil(o.y+o.h)-s):c,b=x=>{if(f===l&&m===c)return {rgba:x,x:i,y:s,width:l,height:c};let y=new Uint8ClampedArray(f*m*4);return xs(x,l,0,0,f,m,y,f,0,0),{rgba:y,x:i,y:s,width:f,height:m}};if(o&&r.kind==="blur"&&r.expandEdge){let x=Math.ceil(o.x+o.w)<t&&Math.ceil(o.y+o.h)<n,{out:y,halo:g}=ny(e,t,n,r.radius,i,s,a,u,x),M=b(y);return f===l&&m===c&&(M.haloRight=g),M}let h=e;(l!==t||c!==n)&&(h=new Uint8ClampedArray(l*c*4),xs(e,t,i,s,l,c,h,l,0,0));let d=r.kind==="redEyeCorrection"?{kind:r.kind,areas:r.areas.map(x=>({left:x.left-i,top:x.top-s,right:x.right-i,bottom:x.bottom-s}))}:r,p=ty(h,l,c,d);return p?b(p):null}function Vf(e,t,n,r,o,i){let s=Math.abs(o),a=o>0,l=n*4+3&-4,c=l*r,f=new Uint8Array(c);for(let m=0;m<r;m++){let b=a?m:r-1-m,h=t+b*s,d=(r-1-m)*l;switch(i){case 2498570:case 925707:{for(let p=0;p<n;p++){let x=h+p*4;if(x+3>=e.byteLength)break;let y=e.getUint8(x),g=e.getUint8(x+1),M=e.getUint8(x+2),E=e.getUint8(x+3);i===925707&&E>0&&E<255&&(M=Math.min(255,Math.round(M*255/E)),g=Math.min(255,Math.round(g*255/E)),y=Math.min(255,Math.round(y*255/E)));let P=d+p*4;f[P]=y,f[P+1]=g,f[P+2]=M,f[P+3]=E;}break}case 139273:{for(let p=0;p<n;p++){let x=h+p*4;if(x+3>=e.byteLength)break;let y=d+p*4;f[y]=e.getUint8(x),f[y+1]=e.getUint8(x+1),f[y+2]=e.getUint8(x+2),f[y+3]=255;}break}case 137224:{for(let p=0;p<n;p++){let x=h+p*3;if(x+2>=e.byteLength)break;let y=d+p*4;f[y]=e.getUint8(x),f[y+1]=e.getUint8(x+1),f[y+2]=e.getUint8(x+2),f[y+3]=255;}break}default:return null}}return ry(f,l,n,r,c)}function zf(e,t,n,r,o,i){let s=Math.abs(o),a=o>0,u=new Uint8ClampedArray(n*r*4);for(let l=0;l<r;l++){let c=a?l:r-1-l,f=t+c*s,m=l*n*4;switch(i){case 2498570:case 925707:{for(let b=0;b<n;b++){let h=f+b*4;if(h+3>=e.byteLength)break;let d=e.getUint8(h),p=e.getUint8(h+1),x=e.getUint8(h+2),y=e.getUint8(h+3);i===925707&&y>0&&y<255&&(x=Math.min(255,Math.round(x*255/y)),p=Math.min(255,Math.round(p*255/y)),d=Math.min(255,Math.round(d*255/y)));let g=m+b*4;u[g]=x,u[g+1]=p,u[g+2]=d,u[g+3]=y;}break}case 139273:{for(let b=0;b<n;b++){let h=f+b*4;if(h+3>=e.byteLength)break;let d=m+b*4;u[d]=e.getUint8(h+2),u[d+1]=e.getUint8(h+1),u[d+2]=e.getUint8(h),u[d+3]=255;}break}case 137224:{for(let b=0;b<n;b++){let h=f+b*3;if(h+2>=e.byteLength)break;let d=m+b*4;u[d]=e.getUint8(h+2),u[d+1]=e.getUint8(h+1),u[d+2]=e.getUint8(h),u[d+3]=255;}break}default:return null}}return u}function ry(e,t,n,r,o){let a=122+o,u=new ArrayBuffer(a),l=new DataView(u),c=new Uint8Array(u);return l.setUint8(0,66),l.setUint8(1,77),l.setUint32(2,a,true),l.setUint32(6,0,true),l.setUint32(10,122,true),l.setUint32(14,108,true),l.setInt32(18,n,true),l.setInt32(22,r,true),l.setUint16(26,1,true),l.setUint16(28,32,true),l.setUint32(30,3,true),l.setUint32(34,o,true),l.setInt32(38,2835,true),l.setInt32(42,2835,true),l.setUint32(46,0,true),l.setUint32(50,0,true),l.setUint32(54,16711680,true),l.setUint32(58,65280,true),l.setUint32(62,255,true),l.setUint32(66,4278190080,true),l.setUint32(70,1934772034,true),c.set(e,122),u}var qf=Math.fround;function Dt(e){return Math.floor(qf(qf(e)*256+.5))+15>>4}function jt(e,t,n,r){let o=1/0,i=1/0,s=-1/0,a=-1/0;for(let P=0;P<8;P+=2)o=Math.min(o,e[P]),s=Math.max(s,e[P]),i=Math.min(i,e[P+1]),a=Math.max(a,e[P+1]);let u=o-16,l=i-16,c=[e[0]-u,e[2]-u,e[4]-u,e[6]-u],f=[e[1]-l,e[3]-l,e[5]-l,e[7]-l],m=(P,R)=>Math.floor(P/2**R),b=[c[0]*1024,(c[3]-c[0])*1024,3*(c[1]-2*c[2]+c[3])*2048,3*(c[0]-2*c[1]+c[2])*2048],h=[f[0]*1024,(f[3]-f[0])*1024,3*(f[1]-2*f[2]+f[3])*2048,3*(f[0]-2*f[1]+f[2])*2048],d=1,p=0,y=(P,R)=>Math.abs(P)>Math.abs(R)?Math.abs(P):Math.abs(R);for(let P=0;P<40;P++){let R=24576*2**p;if(y(b[2],b[3])<=R&&y(h[2],h[3])<=R)break;p+=2;for(let T of [b,h])T[2]=m(T[2]+T[3],1),T[1]=m(T[1]-m(T[2],p),1);d*=2;}for(let P of [b,h]){P[0]*=8,P[1]*=8;let R=p-3;R>=0?(P[2]=m(P[2],R),P[3]=m(P[3],R)):(P[2]*=2**-R,P[3]*=2**-R);}let g=P=>{P[0]+=P[1];let R=P[2];P[1]+=R,P[2]=R+R-P[3],P[3]=R;},M=1/d,E=M;g(b),g(h),d--;for(let P=0;P<1<<22;P++){if(t.push(m(b[0]+4096,13)+u,m(h[0]+4096,13)+l),r?.push(E),d===0)return;if(Math.max(y(b[2],b[3]),y(h[2],h[3]))>196608){for(let R of [b,h])R[2]=m(R[2]+R[3],3),R[1]=m(R[1]-R[2],1),R[3]=m(R[3],2);d*=2,M/=2;}for(;d%2===0&&y(b[3],2*b[2]-b[3])<=49152&&y(h[3],2*h[2]-h[3])<=49152;){for(let R of [b,h])R[3]*=4,R[1]=R[2]+2*R[1],R[2]=R[2]*8-R[3];d/=2,M*=2;}d--,E+=M,g(b),g(h);}}function oy(e,t,n,r,o,i,s,a){let u=Math.hypot(e-2*n+o,t-2*r+i),l=Math.hypot(n-2*o+s,r-2*i+a),c=Math.ceil(Math.sqrt(.75*Math.max(u,l)/.05));return Math.min(4096,Math.max(1,c))}function Jf(e,t){if(!(e>.05))return 1;let n=2*Math.acos(1-.05/e),r=Math.ceil(Math.abs(t)/n);return Math.min(4096,Math.max(1,r))}function Kf(e,t){let n=e%t;return n<0?n+t:n}function Hr(e){let t=[],n=[],r=false,o=0,i=0,s=()=>{n.length>=6&&t.push(n),n=[];},a=(l,c)=>{s(),n=[l,c],r=true,o=l,i=c;},u=(l,c)=>{if(!r){a(l,c);return}n.push(l,c),o=l,i=c;};for(let l of e)switch(l.op){case "moveTo":a(l.x,l.y);break;case "lineTo":u(l.x,l.y);break;case "rect":a(l.x,l.y),u(l.x+l.w,l.y),u(l.x+l.w,l.y+l.h),u(l.x,l.y+l.h),a(l.x,l.y);break;case "closePath":if(r){let c=n[0],f=n[1];a(c,f);}break;case "bezierCurveTo":{r||a(l.cp1x,l.cp1y);let c=o,f=i,m=oy(c,f,l.cp1x,l.cp1y,l.cp2x,l.cp2y,l.x,l.y);for(let b=1;b<m;b++){let h=b/m,d=1-h,p=d*d*d,x=3*d*d*h,y=3*d*h*h,g=h*h*h;u(p*c+x*l.cp1x+y*l.cp2x+g*l.x,p*f+x*l.cp1y+y*l.cp2y+g*l.y);}u(l.x,l.y);break}case "arcTo":{if(!r){a(l.x1,l.y1);break}let c=o,f=i,m=c-l.x1,b=f-l.y1,h=l.x2-l.x1,d=l.y2-l.y1,p=Math.hypot(m,b),x=Math.hypot(h,d),y=m*d-b*h;if(l.radius<=0||p===0||x===0||Math.abs(y)<1e-9*p*x){u(l.x1,l.y1);break}let g=m/p,M=b/p,E=h/x,P=d/x,R=Math.max(-1,Math.min(1,g*E+M*P)),T=Math.acos(R)/2,w=l.radius/Math.tan(T),A=l.x1+g*w,I=l.y1+M*w,S=l.x1+E*w,v=l.y1+P*w,C=g+E,U=M+P,L=Math.hypot(C,U),k=l.radius/Math.sin(T),F=l.x1+C/L*k,_=l.y1+U/L*k,H=Math.atan2(I-_,A-F),G=Math.atan2(v-_,S-F)-H;G>Math.PI?G-=2*Math.PI:G<-Math.PI&&(G+=2*Math.PI),u(A,I);let W=Jf(l.radius,G);for(let N=1;N<=W;N++){let Z=H+G*N/W;u(F+l.radius*Math.cos(Z),_+l.radius*Math.sin(Z));}break}case "ellipse":{let c=2*Math.PI,f;if(l.ccw){let y=l.startAngle-l.endAngle;f=-(y>=c?c:Kf(y,c));}else {let y=l.endAngle-l.startAngle;f=y>=c?c:Kf(y,c);}let m=Math.cos(l.rotation),b=Math.sin(l.rotation),h=y=>{let g=l.rx*Math.cos(y),M=l.ry*Math.sin(y);return [l.cx+g*m-M*b,l.cy+g*b+M*m]},[d,p]=h(l.startAngle);u(d,p);let x=Jf(Math.max(Math.abs(l.rx),Math.abs(l.ry)),f);for(let y=1;y<=x;y++){let[g,M]=h(l.startAngle+f*y/x);u(g,M);}break}}return s(),t}function iy(e){let t=Math.floor(e.x),n=Math.floor(e.y),r=Math.max(t,Math.min(t+32768,Math.ceil(e.x+e.w))),o=Math.max(n,Math.min(n+32768,Math.ceil(e.y+e.h)));return {x0:t,y0:n,x1:r,y1:o}}function Qf(...e){let t=1/0,n=1/0,r=-1/0,o=-1/0,i=(u,l)=>{Math.abs(u)<8388608&&Math.abs(l)<8388608&&(t=Math.min(t,u),n=Math.min(n,l),r=Math.max(r,u),o=Math.max(o,l));};for(let u of e)for(let l of u??[])for(let c of Hr(l.cmds))for(let f=0;f<c.length;f+=2)i(c[f],c[f+1]);if(!Number.isFinite(t))return {x:0,y:0,w:0,h:0};let s=Math.floor(t),a=Math.floor(n);return {x:s,y:a,w:Math.ceil(r)-s,h:Math.ceil(o)-a}}function sy(e,t,n){let r=[];for(let o of Hr(e.cmds)){let i=o.length/2;for(let s=0;s<i;s++){let a=o[2*s],u=o[2*s+1],l=(s+1)%i,c=o[2*l],f=o[2*l+1];if(u===f||!Number.isFinite(a+u+c+f))continue;let m=f>u?1:-1,b=m>0?a:c,h=m>0?u:f,d=m>0?f:u,p=(c-a)/(f-u),x=Math.max(t,Math.ceil(h-.5)),y=Math.min(n,Math.ceil(d-.5));x>=y||r.push({row0:x,row1:y,x:b+(x+.5-h)*p,slope:p,dir:m});}}return r.sort((o,i)=>o.row0-i.row0),r}function ay(e,t){let n=[],r=sy(e,t.y0,t.y1),o=e.fillRule==="evenodd",i=[],s=0,a=[];for(let u=t.y0;u<t.y1;u++){for(;s<r.length&&r[s].row0===u;)i.push(r[s++]);i=i.filter(m=>m.row1>u),a.length=0;for(let m of i)a.push({x:m.x+(u-m.row0)*m.slope,dir:m.dir});a.sort((m,b)=>m.x-b.x);let l=[],c=0,f=0;for(let m of a){let b=o?(c&1)!==0:c!==0;c+=m.dir;let h=o?(c&1)!==0:c!==0;if(!b&&h)f=m.x;else if(b&&!h){let d=Math.max(t.x0,Math.ceil(f-.5)),p=Math.min(t.x1,Math.ceil(m.x-.5));d<p&&(l.length>0&&l[l.length-1]>=d?l[l.length-1]=Math.max(l[l.length-1],p):l.push(d,p));}}n.push(l);}return n}function e0(e,t,n){let r=[],o=0,i=0,s=false,a=false,u=false;for(;o<e.length||i<t.length;){let l=Math.min(o<e.length?e[o]:1/0,i<t.length?t[i]:1/0);for(;o<e.length&&e[o]===l;)s=!s,o++;for(;i<t.length&&t[i]===l;)a=!a,i++;let c=n(s,a);c!==u&&(r.push(l),u=c);}return r}function Zf(e,t){let n=t.x1>t.x0?[t.x0,t.x1]:[],r=[];for(let o=t.y0;o<t.y1;o++)r.push(n);for(let o of e??[]){let i=ay(o,t);r=r.map((s,a)=>s.length===0?s:e0(s,i[a],t0));}return r}var t0=(e,t)=>e&&t,uy={replace:(e,t)=>t,intersect:t0,union:(e,t)=>e||t,xor:(e,t)=>e!==t,exclude:(e,t)=>e&&!t,complement:(e,t)=>t&&!e};function ly(e,t){if(e.length!==t.length)return false;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return false;return true}function cy(e,t){let n=[],r=0;for(let o=1;o<=e.length;o++){if(o<e.length&&ly(e[o],e[r]))continue;let i=e[r];for(let s=0;s<i.length;s+=2)n.push({x:i[s],y:t+r,w:i[s+1]-i[s],h:o-r});r=o;}return n}function tr(e,t,n,r){let o=iy(r);if(o.x1<=o.x0||o.y1<=o.y0)return [];let i=Zf(e,o),s=Zf(t,o),a=uy[n],u=i.map((l,c)=>e0(l,s[c],a));return cy(u,o.y0)}function n0(e){return e.w>32768||e.h>32768}var my=8192;function nr(e,t,n){if(n<12)return null;e.getUint32(t,true);let o=e.getUint32(t+4,true),i=e.getUint32(t+8,true);if(o===0||o>1e5)return null;let s=(i&16384)!==0;if(12+(o*(s?4:8)+o)>n)return null;let f=[],m=t+12;for(let d=0;d<o;d++)s?(f.push({x:e.getInt16(m,true),y:e.getInt16(m+2,true)}),m+=4):(f.push({x:e.getFloat32(m,true),y:e.getFloat32(m+4,true)}),m+=8);let b=m+3&-4,h=new Uint8Array(e.buffer,e.byteOffset+b,o);return {kind:"plus-path",points:f,types:new Uint8Array(h),fillRule:i&my?"nonzero":"evenodd"}}function fy(e,t){let n=(u,l)=>t[0]*u+t[2]*l+t[4],r=(u,l)=>t[1]*u+t[3]*l+t[5],o=[],i=e.points,s=e.types,a=0;for(;a<i.length;){let u=s[a]&15,l=(s[a]&128)!==0;if(u===0)o.push({op:"moveTo",x:n(i[a].x,i[a].y),y:r(i[a].x,i[a].y)}),a++;else if(u===3){if(a+2<i.length){o.push({op:"bezierCurveTo",cp1x:n(i[a].x,i[a].y),cp1y:r(i[a].x,i[a].y),cp2x:n(i[a+1].x,i[a+1].y),cp2y:r(i[a+1].x,i[a+1].y),x:n(i[a+2].x,i[a+2].y),y:r(i[a+2].x,i[a+2].y)}),(s[a+2]&128)!==0&&o.push({op:"closePath"}),a+=3;continue}break}else o.push({op:"lineTo",x:n(i[a].x,i[a].y),y:r(i[a].x,i[a].y)}),a++;l&&o.push({op:"closePath"});}return o}var by=512;function hy(e,t,n,r,o,i,s,a){let u=(s-o)*(t-i)-(a-i)*(e-o),l=(s-o)*(r-i)-(a-i)*(n-o),c=(n-e)*(i-t)-(r-t)*(o-e),f=(n-e)*(a-t)-(r-t)*(s-e);return u*l<0&&c*f<0}function dy(e){let t=Hr(e);if(t.length!==1)return false;let n=t[0],r=n.length/2;if(r<3)return true;if(r>by)return false;for(let o=0;o<r;o++){let i=(o+1)%r;for(let s=o+2;s<r;s++){let a=(s+1)%r;if(a!==o&&hy(n[2*o],n[2*o+1],n[2*i],n[2*i+1],n[2*s],n[2*s+1],n[2*a],n[2*a+1]))return false}}return true}function Ru(e,t){let n=fy(e,t);return {cmds:n,fillRule:e.fillRule??"nonzero",simple:dy(n)}}function $r(e,t){e.beginPath();let n=t.points,r=t.types,o=0;for(;o<n.length;){let i=r[o]&15,s=(r[o]&128)!==0;if(i===0)e.moveTo(n[o].x,n[o].y),o++;else if(i===1)e.lineTo(n[o].x,n[o].y),o++;else if(i===3)if(o+2<n.length){e.bezierCurveTo(n[o].x,n[o].y,n[o+1].x,n[o+1].y,n[o+2].x,n[o+2].y),(r[o+2]&128)!==0&&e.closePath(),o+=3;continue}else break;else e.lineTo(n[o].x,n[o].y),o++;s&&e.closePath();}}var My=1,Ps=2,o0=4,i0=8,Ey=64,Py=128,gs=4096;function Xr(e){return e>>>12===900097}function wu(e,t){return [e.getFloat32(t,true),e.getFloat32(t+4,true),e.getFloat32(t+8,true),e.getFloat32(t+12,true),e.getFloat32(t+16,true),e.getFloat32(t+20,true)]}function Ms(e,t,n){return {x:e[0]*t+e[2]*n+e[4],y:e[1]*t+e[3]*n+e[5]}}function Ry(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Au(e){switch(e){case 0:return "tile";case 1:return "tile-flip-x";case 2:return "tile-flip-y";case 3:return "tile-flip-xy";default:return "clamp"}}function s0(e){return e.map(t=>({...t,offset:Ry(t.offset)})).sort((t,n)=>t.offset-n.offset)}function a0(e,t,n){if(t+4>n)return null;let r=e.getUint32(t,true);if(r===0||r>gs)return null;let o=t+4,i=o+r*4,s=i+r*4;if(s>n)return null;let a=[];for(let u=0;u<r;u++){let l=e.getUint32(i+u*4,true);a.push({offset:e.getFloat32(o+u*4,true),color:chunk7JVB7NLG_js.b(l),argb:l});}return {stops:a,next:s}}function u0(e,t,n){if(t+4>n)return null;let r=e.getUint32(t,true);if(r===0||r>gs)return null;let o=t+4,i=o+r*4,s=i+r*4;if(s>n)return null;let a=[];for(let u=0;u<r;u++)a.push({pos:e.getFloat32(o+u*4,true),factor:e.getFloat32(i+u*4,true)});return {entries:a,next:s}}function Ty(e,t,n){if(t+40>n)return null;let r=e.getUint32(t,true),o=Au(e.getUint32(t+4,true)),i=e.getFloat32(t+8,true),s=e.getFloat32(t+12,true),a=e.getFloat32(t+16,true),u=e.getFloat32(t+20,true),l=e.getUint32(t+24,true),c=e.getUint32(t+28,true),f=t+40,m=null;r&Ps&&f+24<=n&&(m=wu(e,f),f+=24);let b=[{offset:0,color:chunk7JVB7NLG_js.b(l),argb:l},{offset:1,color:chunk7JVB7NLG_js.b(c),argb:c}],h={startArgb:l,endArgb:c,preset:null,blend:null,gammaCorrected:(r&Py)!==0};if(r&o0){let x=a0(e,f,n);x&&(b=x.stops,h.preset={positions:x.stops.map(y=>y.offset),argb:x.stops.map(y=>y.argb??0)});}else if(r&i0){let x=u0(e,f,n);x&&(b=x.entries.map(y=>({offset:y.pos,color:chunk7JVB7NLG_js.c(l,c,y.factor),argb:Iu(l,c,y.factor)})),h.blend={positions:x.entries.map(y=>y.pos),factors:x.entries.map(y=>y.factor)});}let d={x:i,y:s+u/2},p={x:i+a,y:s+u/2};return m&&(d=Ms(m,d.x,d.y),p=Ms(m,p.x,p.y)),chunk7JVB7NLG_js.p(`parseEmfPlusBrushObject: linear gradient (${d.x.toFixed(1)},${d.y.toFixed(1)})\u2192(${p.x.toFixed(1)},${p.y.toFixed(1)}), ${b.length} stop(s)`),{kind:"plus-brush",color:chunk7JVB7NLG_js.b(l),gradient:{type:"linear",x1:d.x,y1:d.y,x2:p.x,y2:p.y,stops:s0(b),wrapMode:o,rect:{x:i,y:s,w:a,h:u},transform:m,ramp:h}}}function l0(e,t,n){if(t+28>n||e.getUint32(t+4,true)!==1)return null;let o=e.getInt32(t+8,true),i=e.getInt32(t+12,true),s=e.getInt32(t+16,true),a=e.getUint32(t+20,true),u=t+28,l=Math.abs(s);if(o<=0||i<=0||o>8192||i>8192||u+l*i>n)return null;let c=zf(e,u,o,i,s,a);return c?{width:o,height:i,rgba:c}:null}function c0(e,t,n){if(t+28>n||e.getUint32(t+4,true)!==1||l0(e,t,n))return null;let r=t+28;return r<n?{start:r,end:n}:null}function m0(e,t,n){if(t+8>n)return null;let r=e.getUint32(t,true),o=t+8;return r&Ps&&o+24<=n&&(o+=24),o}function wy(e,t,n,r){if(t+8>n)return null;let o=e.getUint32(t,true),i=Au(e.getUint32(t+4,true)),s=t+8,a=null;o&Ps&&s+24<=n&&(a=wu(e,s),s+=24);let u=l0(e,s,n)??r??null;if(!u)return chunk7JVB7NLG_js.q("parseEmfPlusBrushObject: TextureFill brush has no synchronously-decodable pixel bitmap (compressed image or metafile texture, and no pre-decoded result was cached); falling back to black"),null;let l={width:u.width,height:u.height,rgba:u.rgba,wrapMode:i,transform:a},c=0,f=0,m=0,b=u.width*u.height;for(let d=0;d<b;d++)c+=u.rgba[d*4],f+=u.rgba[d*4+1],m+=u.rgba[d*4+2];let h=b>0?`rgba(${Math.round(c/b)},${Math.round(f/b)},${Math.round(m/b)},1)`:"rgba(128,128,128,1)";return chunk7JVB7NLG_js.p(`parseEmfPlusBrushObject: texture fill ${u.width}x${u.height}, wrapMode=${i}`),{kind:"plus-brush",color:h,texture:l}}function Ay(e,t,n){if(t+24>n)return null;let r=e.getUint32(t,true),o=Au(e.getUint32(t+4,true)),i=e.getUint32(t+8,true),s=e.getFloat32(t+12,true),a=e.getFloat32(t+16,true),u=e.getUint32(t+20,true);if(u>gs)return {kind:"plus-brush",color:chunk7JVB7NLG_js.b(i)};let l=[],c=t+24;for(let w=0;w<u&&c+4<=n;w++)l.push(e.getUint32(c,true)),c+=4;let f=[],m=[],b,h=w=>l.length>0?l[Math.min(w,l.length-1)]:i;if(r&My){if(c+4<=n){let w=e.getInt32(c,true);if(c+=4,w>0&&c+w<=n){let A=nr(e,c,w);if(A){let I=vy(A.points,A.types,h);f=I.points,m=I.argb;let S=A.points.length;for(let v=0;v<A.points.length;v++){if(v>0&&(A.types[v]&7)===0){S=v;break}if(A.types[v]&128){S=v+1;break}}A.types.slice(0,S).some(v=>(v&7)===3)&&(b={points:A.points.slice(0,S),types:A.types.slice(0,S)});}c+=w;}}}else if(c+4<=n){let w=e.getUint32(c,true);if(c+=4,w>0&&w<=gs&&c+w*8<=n){for(let A=0;A<w;A++)f.push({x:e.getFloat32(c+A*8,true),y:e.getFloat32(c+A*8+4,true)}),m.push(h(A));c+=w*8;}}let d=null;r&Ps&&c+24<=n&&(d=wu(e,c),c+=24);let p={x:s,y:a},x=d,y=x?f.map(w=>Ms(x,w.x,w.y)):f;x&&({x:s,y:a}=Ms(x,s,a));let g=l.length>0?l[0]:i,M=[{offset:0,color:chunk7JVB7NLG_js.b(i),argb:i},{offset:1,color:chunk7JVB7NLG_js.b(g),argb:g}],E=null,P=null;if(r&o0){let w=a0(e,c,n);w&&(M=w.stops.map(A=>({...A,offset:1-A.offset})),P={positions:w.stops.map(A=>A.offset),argb:w.stops.map(A=>A.argb??0)},c=w.next);}else if(r&i0){let w=u0(e,c,n);w&&(M=w.entries.map(A=>({offset:1-A.pos,color:chunk7JVB7NLG_js.c(g,i,A.factor),argb:Iu(g,i,A.factor)})),E={positions:w.entries.map(A=>A.pos),factors:w.entries.map(A=>A.factor)},c=w.next);}let R=null;r&Ey&&c+12<=n&&e.getUint32(c,true)===2&&(R={x:e.getFloat32(c+4,true),y:e.getFloat32(c+8,true)});let T=0;for(let w of y){let A=Math.hypot(w.x-s,w.y-a);A>T&&(T=A);}return T>0?(chunk7JVB7NLG_js.p(`parseEmfPlusBrushObject: path gradient centre=(${s.toFixed(1)},${a.toFixed(1)}), ${f.length} boundary point(s)`),{kind:"plus-brush",color:chunk7JVB7NLG_js.b(i),gradient:{type:"radial",cx:s,cy:a,r:T,stops:s0(M),wrapMode:o,shape:{center:p,centerArgb:i,boundary:f,source:b,boundaryArgb:m,blend:E,preset:P,focus:R,transform:d}}}):{kind:"plus-brush",color:chunk7JVB7NLG_js.b(i)}}function Iu(e,t,n){let r=Math.min(1,Math.max(0,n)),o=0;for(let i=24;i>=0;i-=8){let s=e>>>i&255,a=t>>>i&255;o=o*256+Math.round(s+(a-s)*r);}return o>>>0}var Iy=.25,Sy=10;function r0(e,t,n){let r=n.x-t.x,o=n.y-t.y,i=Math.hypot(r,o);return i<1e-12?Math.hypot(e.x-t.x,e.y-t.y):Math.abs((e.x-t.x)*o-(e.y-t.y)*r)/i}function Es(e,t,n,r,o,i=0,s=1,a=0){if(Math.max(r0(t,e,r),r0(n,e,r))<=Iy||a>=Sy){o.push({x:r.x,y:r.y,t:s});return}let l=(x,y)=>({x:(x.x+y.x)/2,y:(x.y+y.y)/2}),c=l(e,t),f=l(t,n),m=l(n,r),b=l(c,f),h=l(f,m),d=l(b,h),p=(i+s)/2;Es(e,c,b,d,o,i,p,a+1),Es(d,h,m,r,o,p,s,a+1);}function vy(e,t,n){let r=[],o=[];for(let s=0;s<e.length;s++){let a=t[s]&7;if(s>0&&a===0)break;if(a===3&&s>0&&s+2<e.length){let u=e.slice(s-1,s+3).flatMap(b=>[Dt(b.x),Dt(b.y)]);r[r.length-1]={x:u[0]/16,y:u[1]/16};let l=n(s-1),c=n(s+2),f=[],m=[];jt(u,f,void 0,m);for(let b=0;b<m.length;b++)r.push({x:f[b*2]/16,y:f[b*2+1]/16}),o.push(Iu(l,c,m[b]));if(s+=2,t[s]&128)break;continue}if(r.push(e[s]),o.push(n(s)),t[s]&128)break}let i=r.length;return i>1&&r[0].x===r[i-1].x&&r[0].y===r[i-1].y&&(r.pop(),o.pop()),{points:r,argb:o}}function Rs(e,t,n,r,o=t){if(n<8)return null;let i=t+n,s=Xr(e.getUint32(t,true)),a=t+(s?4:0);if(a+8>i)return null;let u=e.getUint32(a,true),l=a+4;switch(u){case 0:return {kind:"plus-brush",color:chunk7JVB7NLG_js.b(e.getUint32(l,true))};case 1:if(l+12<=i){let c=e.getUint32(l+4,true);return {kind:"plus-brush",color:chunk7JVB7NLG_js.b(c),hatch:{style:e.getUint32(l,true),fore:c,back:e.getUint32(l+8,true)}}}return l+8<=i?{kind:"plus-brush",color:chunk7JVB7NLG_js.b(e.getUint32(l+4,true))}:{kind:"plus-brush",color:"rgba(0,0,0,1)"};case 2:{let c=r?.get(o);return wy(e,l,i,c)??{kind:"plus-brush",color:"rgba(0,0,0,1)"}}case 4:return Ty(e,l,i)??{kind:"plus-brush",color:"rgba(0,0,0,1)"};case 3:return Ay(e,l,i)??{kind:"plus-brush",color:"rgba(0,0,0,1)"};default:return {kind:"plus-brush",color:"rgba(0,0,0,1)"}}}function Cy(e){let t=e[0]*e[3]-e[1]*e[2];if(!Number.isFinite(t)||Math.abs(t)<1e-12)return null;let n=e[3]/t,r=-e[1]/t,o=-e[2]/t,i=e[0]/t;return [n,r,o,i,-(n*e[4]+o*e[5]),-(r*e[4]+i*e[5])]}function _o(e,t){return {x:e[0]*t.x+e[2]*t.y+e[4],y:e[1]*t.x+e[3]*t.y+e[5]}}function rr(e,t,n,r,o,i){let s=Math.PI/2,a=Math.max(1,Math.ceil(Math.abs(i)/s-1e-9)),u=f=>({x:e+n*Math.cos(f),y:t+r*Math.sin(f)}),l=f=>({x:-n*Math.sin(f),y:r*Math.cos(f)}),c=[];for(let f=0;f<a;f++){let m=o+f*Math.sign(i)*s,b=f===a-1?o+i-m:Math.sign(i)*s,h=4/3*Math.tan(b/4),d=m+b,p=u(m),x=u(d),y=l(m),g=l(d);c.push([p,{x:p.x+h*y.x,y:p.y+h*y.y},{x:x.x-h*g.x,y:x.y-h*g.y},x]);}return c}function f0(e,t){let n=Cy(t);if(!n)return e;let r=null,o=null,i=l=>{e.moveTo(l.x,l.y),r=l,o=l;},s=l=>{e.lineTo(l.x,l.y),r=l;},a=(l,c,f,m)=>{let b=[];Es(_o(t,l),_o(t,c),_o(t,f),_o(t,m),b);for(let h=0;h<b.length-1;h++){let d=_o(n,b[h]);e.lineTo(d.x,d.y);}s(m);},u={beginPath(){e.beginPath(),r=null,o=null;},moveTo(l,c){i({x:l,y:c});},lineTo(l,c){if(!r){i({x:l,y:c});return}s({x:l,y:c});},closePath(){e.closePath(),r=o;},rect(l,c,f,m){i({x:l,y:c}),s({x:l+f,y:c}),s({x:l+f,y:c+m}),s({x:l,y:c+m}),e.closePath(),r={x:l,y:c};},bezierCurveTo(l,c,f,m,b,h){let d=r??{x:l,y:c};r||i(d),a(d,{x:l,y:c},{x:f,y:m},{x:b,y:h});},ellipse(l,c,f,m,b,h,d,p){let x=d-h;p?(x=x>0?x-2*Math.PI*Math.ceil(x/(2*Math.PI)):x,x<-2*Math.PI&&(x=-2*Math.PI)):(x=x<0?x+2*Math.PI*Math.ceil(-x/(2*Math.PI)):x,x>2*Math.PI&&(x=2*Math.PI));let y=Math.cos(b),g=Math.sin(b),M=R=>b===0?R:{x:l+(R.x-l)*y-(R.y-c)*g,y:c+(R.x-l)*g+(R.y-c)*y},E=rr(l,c,f,m,h,x).map(R=>R.map(M));if(E.length===0)return;let P=E[0][0];r?s(P):i(P);for(let[R,T,w,A]of E)a(R,T,w,A);}};return new Proxy(e,{get(l,c){if(typeof c=="string"&&c in u)return u[c];let f=l[c];return typeof f=="function"?f.bind(l):f},set(l,c,f){return l[c]=f,true}})}var Me=Math.fround;function x0(e,t,n){let r=t.map(m=>Me(m)),o=(m,b)=>Dt(Me(Me(Me(r[0]*Me(m))+Me(r[2]*Me(b)))+r[4])),i=(m,b)=>Dt(Me(Me(Me(r[1]*Me(m))+Me(r[3]*Me(b)))+r[5])),s=[],a=null,u=null,l=(m,b)=>{a={pts:[o(m,b),i(m,b)],closed:false,curved:false},s.push(a),u={x:m,y:b};},c=(m,b)=>{if(!a){l(m,b);return}a.pts.push(o(m,b),i(m,b));},f={beginPath(){a=null,u=null;},moveTo:l,lineTo:c,bezierCurveTo(m,b,h,d,p,x){a||l(m,b);let y=a;y.curved=true;let g=y.pts.length;jt([y.pts[g-2],y.pts[g-1],o(m,b),i(m,b),o(h,d),i(h,d),o(p,x),i(p,x)],y.pts);},ellipse(m,b,h,d,p,x,y,g){let M=y-x;g?(M=M>0?M-2*Math.PI*Math.ceil(M/(2*Math.PI)):M,M=Math.max(M,-2*Math.PI)):(M=M<0?M+2*Math.PI*Math.ceil(-M/(2*Math.PI)):M,M=Math.min(M,2*Math.PI));let E=Math.cos(p),P=Math.sin(p),R=A=>p===0?A:{x:m+(A.x-m)*E-(A.y-b)*P,y:b+(A.x-m)*P+(A.y-b)*E},T=rr(m,b,h,d,x,M);if(T.length===0)return;let w=R(T[0][0]);a?c(w.x,w.y):l(w.x,w.y);for(let A of T){let[,I,S,v]=A.map(R);f.bezierCurveTo(I.x,I.y,S.x,S.y,v.x,v.y);}},rect(m,b,h,d){l(m,b),c(m+h,b),c(m+h,b+d),c(m,b+d),f.closePath();},closePath(){if(a&&u){a.closed=true;let m=u;l(m.x,m.y);}}};return e(f),s.filter(m=>m.pts.length>=4)}function b0(e){let t=e.pts;return !e.closed||t.length<4?t:[...t,t[0],t[1]]}var h0=32;function Dy(e){let t=e.length/2,n=[];for(let r=0;r<t-1;r+=h0-1)n.push(e.slice(2*r,2*Math.min(t,r+h0)));return n}function Ly(e,t,n,r,o,i,s){let a=Me(n/16-e/16),u=Me(r/16-t/16);if(a===0&&u===0)return;let l=Math.abs(a),c=Math.abs(u),f=c<l,m=false,b;f?(b=u>=0?1:-1,a<0&&(m=true,[e,t,n,r]=[n,r,e,t],b=-b)):(b=a>=0?1:-1,u<0&&(m=true,[e,t,n,r]=[n,r,e,t],b=-b));let h=f?e:t,d=f?n:r,p=f?t:e,x=f?r:n,y=Me(f?Me(b*c)/l:Me(b*l)/c),g=d-h,M=(x-p)*b,E=0,P=0,R=0;if(s){let B=y===0?0:Me(1/y),O=(f?s.x:s.y)*16-8,j=(f?s.x+s.w:s.y+s.h)*16-8,q=(f?s.y:s.x)*16-8,ae=(f?s.y+s.h:s.x+s.w)*16-8;if(h<O||d>j){if(h>j||d<O)return;if(h<O){let ee=Me(Me((O-h)*y)+p),le=Math.floor(ee);p=le,h=O,E=Me(ee-le);}if(d>j){let ee=Me(Me((j-d)*y)+x),le=Math.floor(ee);o=true,x=le,d=j,P=Me(ee-le);}}let se=b===1,de=se?p:x,me=se?x:p;if(de<q||me>ae){if(de>ae||me<q)return;if(de<q){let ee=Math.floor(Me(Me(q-Me(de+(se?E:P)))*B));se?(h+=ee,p=q):(d+=ee,x=q);}if(me>ae){let ee=Math.floor(Me(Me(ae-Me(me+(se?P:E)))*B));se?(d+=ee,x=ae):(h+=ee,p=ae),o=true;}}P!==0&&(x&15)===8&&x++,E!==0&&(R=Math.floor(Me(Me(2*g*b)*E)));}let T=f&&g===M,w=T&&b===1,A=w?8:7,I=(B,O)=>{let j=Math.abs(B)+Math.abs(O);return j<8?true:j!==8?false:O===0&&B===(w?-8:8)||B===0&&O===8?true:T&&(w?B<0:B>0)&&O>0},S=h+A&-16,v=d+A&-16,C=I(h-S,p-(p+7&-16)),U=I(d-v,x-(x+7&-16)),L=h&15,k=d&15;m&&!o?(C||L<=8)&&(S+=16):L<=8&&!C&&(S+=16),!m&&!o?(k>8||U)&&(v-=16):!U&&k>8&&(v-=16);let F=S>>4,_=v>>4;if(_<F)return;let H=Math.floor((S-h)*y+p+E),G=H+7&-16,W=G>>4,N=R-((G-H)*b+8)*2*g>>4;if(!s){for(let B=F;B<=_;B++)f?i(B,W):i(W,B),N+=2*M,N>0&&(W+=b,N-=2*g);return}let J=Math.floor((v-d)*y+x+P)+7>>4,K=f?s.x:s.y,ie=(f?s.x+s.w:s.y+s.h)-1,ce=f?s.y:s.x,$=(f?s.y+s.h:s.x+s.w)-1,X=(J-W)*b;for(let B=F;B<=_&&X>=0;B++)B>=K&&B<=ie&&W>=ce&&W<=$&&(f?i(B,W):i(W,B)),N+=2*M,N>0&&(W+=b,N-=2*g,X--);}var d0=[0,-8,-8,0,0,8,8,0];function p0(e,t){return Math.abs(t)>Math.abs(e)?t<0?1:3:e<0?2:0}function Uy(e){let t=e.length/2;if(t<2)return [];let n=[],r=[],o=m=>e[2*m],i=m=>e[2*m+1],s=p0(o(1)-o(0),i(1)-i(0)),a=m=>d0[2*(m&3)],u=m=>d0[2*(m&3)+1];n.push(o(0)-a(s),i(0)-u(s),o(0)+a(s+1),i(0)+u(s+1));for(let m=0;m+1<t&&(n.push(o(m)+a(s),i(m)+u(s),o(m+1)+a(s),i(m+1)+u(s)),r.push(o(m)-a(s),i(m)-u(s),o(m+1)-a(s),i(m+1)-u(s)),!(m+2>=t));m++){let b=p0(o(m+2)-o(m+1),i(m+2)-i(m+1));if(b!==s){let h=o(m+1)-o(m),d=i(m+1)-i(m),p=o(m+2)-o(m+1),x=i(m+2)-i(m+1),y=o(m+1),g=i(m+1);if(h*x>=d*p){let M=s-1&3;M!==b&&n.push(y+a(M),g+u(M)),r.push(y,g);}else {let M=s+1&3;M!==b&&r.push(y-a(M),g-u(M)),n.push(y,g);}s=b;}}let l=o(t-1),c=i(t-1);n.push(l+a(s-1),c+u(s-1),l-a(s),c-u(s));let f=n.slice();for(let m=r.length-2;m>=0;m-=2)f.push(r[m],r[m+1]);return f}function Ts(e,t,n){if(!t.antialias&&t.opaqueSolid&&!e.some(o=>o.curved)){let o=t.half?8:0,i=new Uint8ClampedArray(n.w*n.h),s=(u,l)=>{let c=u-n.x,f=l-n.y;c>=0&&f>=0&&c<n.w&&f<n.h&&(i[f*n.w+c]=255);},a=t.clip&&!Fy(e,t.clip,o)?t.clip:void 0;for(let u of e){let l=b0(u);for(let c=0;c+3<l.length;c+=2)Ly(l[c]-o,l[c+1]-o,l[c+2]-o,l[c+3]-o,true,s,a);}return i}let r=[];for(let o of e)for(let i of Dy(b0(o))){let s=Uy(i);s.length>=6&&r.push(s);}return ot(r,false,t.antialias,t.half,n)}function Fy(e,t,n){let r=1/0,o=1/0,i=-1/0,s=-1/0;for(let a of e)for(let u=0;u+1<a.pts.length;u+=2){let l=(a.pts[u]-n)/16,c=(a.pts[u+1]-n)/16;r=Math.min(r,l),i=Math.max(i,l),o=Math.min(o,c),s=Math.max(s,c);}return Math.floor(r-.5)-1>=t.x&&Math.floor(o-.5)-1>=t.y&&Math.ceil(i+.5)+1<=t.x+t.w-1&&Math.ceil(s+.5)+1<=t.y+t.h-1}function Ge(e){return Math.ceil(Math.round(e*256-1e-6)/16)}function y0(e){return Math.floor(e*16+.5-1e-4)}function ky(e){let t=e.map(y0);if(t.length===10&&t[0]===t[8]&&t[1]===t[9]&&(t=t.slice(0,8)),t.length!==8)return null;let[n,r,o,i,s,a,u,l]=t;return r===i&&o===s&&a===l&&u===n||n===o&&i===a&&s===u&&l===r?t:null}function En(e,t){let n=[],r=null,o=null,i=(m,b)=>t[0]*m+t[2]*b+t[4],s=(m,b)=>t[1]*m+t[3]*b+t[5],a=(m,b)=>{r={pts:[i(m,b),s(m,b)],closed:false,curved:false},n.push(r),o={x:m,y:b};},u=(m,b)=>{if(!r){a(m,b);return}r.pts.push(i(m,b),s(m,b));},l=(m,b,h,d,p,x)=>{r||a(m,b);let y=r;y.curved=true;let g=y.pts.length,M=(I,S)=>Math.abs(I-y.pts[g-2])<.001&&Math.abs(S-y.pts[g-1])<.001,E=M(i(m,b),s(m,b))&&M(i(h,d),s(h,d))&&M(i(p,x),s(p,x)),P=I=>Ge(I),R=P(y.pts[g-2]),T=P(y.pts[g-1]);y.pts[g-2]=R/16,y.pts[g-1]=T/16,E&&(y.splits??(y.splits=[])).push({x:R/16,y:T/16});let w=[],A=[R,T,P(i(m,b)),P(s(m,b)),P(i(h,d)),P(s(h,d)),P(i(p,x)),P(s(p,x))];jt(A,w);for(let I of w)y.pts.push(I/16);},c=()=>{if(r&&o){r.closed=true;let m=o;a(m.x,m.y);}};return e({beginPath(){r=null,o=null;},moveTo:a,lineTo:u,closePath:c,rect(m,b,h,d){a(m,b),u(m+h,b),u(m+h,b+d),u(m,b+d),c();},bezierCurveTo:l,ellipse(m,b,h,d,p,x,y,g){let M=y-x;g?(M=M>0?M-2*Math.PI*Math.ceil(M/(2*Math.PI)):M,M=Math.max(M,-2*Math.PI)):(M=M<0?M+2*Math.PI*Math.ceil(-M/(2*Math.PI)):M,M=Math.min(M,2*Math.PI));let E=Math.cos(p),P=Math.sin(p),R=A=>p===0?A:{x:m+(A.x-m)*E-(A.y-b)*P,y:b+(A.x-m)*P+(A.y-b)*E},T=rr(m,b,h,d,x,M);if(T.length===0)return;let w=R(T[0][0]);r?u(w.x,w.y):a(w.x,w.y);for(let A of T){let[,I,S,v]=A.map(R);l(I.x,I.y,S.x,S.y,v.x,v.y);}}}),n.filter(m=>m.pts.length>=4)}function g0(e,t,n=false){return En(e,t).map(r=>(n&&!r.curved?ky(r.pts):null)??r.pts.map(Ge)).filter(r=>r.length>=6)}function _y(e,t){let n=Math.floor(e/t);for(;n*t>e;)n--;for(;(n+1)*t<=e;)n++;return n*t===e?n:n+1}function Bo(e,t){let n=1/0,r=1/0,o=-1/0,i=-1/0;for(let c of e)for(let f=0;f<c.length;f+=2)n=Math.min(n,c[f]),o=Math.max(o,c[f]),r=Math.min(r,c[f+1]),i=Math.max(i,c[f+1]);if(!Number.isFinite(n))return null;let s=Math.max(0,Math.floor(n/16)-1),a=Math.max(0,Math.floor(r/16)-1),u=Math.min(t.w,Math.ceil(o/16)+2),l=Math.min(t.h,Math.ceil(i/16)+2);return u>s&&l>a?{x:s,y:a,w:u-s,h:l-a}:null}function ot(e,t,n,r,o){let i=n?8:1,s=n?4:1,a=16/i,u=16/s,l=r?8:0,c=16*o.x+l-(n?8:0),f=16*o.y+l-(n?8:0),m=o.w*i,b=[];for(let y of e){let g=y.length/2;for(let M=0;M<g;M++){let E=(M+1)%g,P=y[2*M],R=y[2*M+1],T=y[2*E],w=y[2*E+1];R!==w&&b.push({ax:P,ay:R,bx:T,by:w,top:Math.min(R,w),bottom:Math.max(R,w),w:w>R?1:-1});}}let h=new Uint8ClampedArray(o.w*o.h),d=new Int32Array(o.w),p=new Int32Array(m+1),x=[];for(let y=0;y<o.h;y++){d.fill(0);for(let M=0;M<s;M++){let E=f+u*(y*s+M);x.length=0;for(let T of b){if(E<T.top||E>=T.bottom)continue;let w=T.by-T.ay,A=T.ax*w+(T.bx-T.ax)*(E-T.ay);w<0&&(w=-w,A=-A);let I=_y(A-c*w,a*w);x.push({k:Math.min(Math.max(I,0),m),w:T.w});}if(x.length<2)continue;x.sort((T,w)=>T.k-w.k),p.fill(0);let P=0;for(let T=0;T+1<x.length;T++)P+=x[T].w,(t?(P&1)!==0:P!==0)&&x[T+1].k>x[T].k&&(p[x[T].k]++,p[x[T+1].k]--);let R=0;for(let T=0;T<m;T++)R+=p[T],R>0&&d[T/i|0]++;}let g=i*s;for(let M=0;M<o.w;M++){let E=d[M];h[y*o.w+M]=E===0?0:E>=g?255:Math.round(E*255/g);}}return h}function M0(e,t,n){let r=[1,0,0,1,0,0],o=null;for(let a of e){let u;try{u=En(a.build,r).map(c=>c.pts.map(y0));}catch{return null}let l=ot(u,a.evenOdd,false,n,t);if(o)for(let c=0;c<l.length;c++)o[c]=o[c]&&l[c];else o=l;}let i=[];if(!o)return i;let s=new Map;for(let a=0;a<t.h;a++){let u=new Map;for(let l=0;l<t.w;){if(!o[a*t.w+l]){l++;continue}let c=l;for(;c<t.w&&o[a*t.w+c];)c++;let f=l+","+c,m=s.get(f);if(m)m.h++,u.set(f,m),s.delete(f);else {let b={x:t.x+l,y:t.y+a,w:c-l,h:1};i.push(b),u.set(f,b);}l=c;}s=u;}return i}var jr=Math.fround,Gt=(e,t)=>D(e+t),ct=(e,t)=>D(e-t),Ye=(e,t)=>D(e*t),Su=(e,t)=>D(e/t),vu=11920928955078125e-23;function As(e,t){let n=ct(jr(t.x),jr(e.x)),r=ct(jr(t.y),jr(e.y)),o=Gt(Ye(r,r),Ye(n,n)),i=0;return o>0&&(i=D(Math.sqrt(o)),n=Su(n,i),r=Su(r,i)),{gx:n,gy:r,len:i}}function By(e,t){let n=Math.sqrt(e*e+t*t);return n<vu?0:D(n)}var ws=jr(.552284777),Gy=[[1,0],[1,ws],[ws,1],[0,1],[-ws,1],[-1,ws],[-1,0]];function Oy(e,t,n,r,o){let i=o?-t.gx:t.gx,s=o?-t.gy:t.gy,a=Gt(n,r),u=Ye(ct(n,r),.5),l=Gt(Ye(Ye(a,t.gy),.5),e.x),c=ct(e.y,Ye(Ye(a,t.gx),.5)),f=Ye(u,s),m=Ye(-u,i);return (b,h)=>({x:Gt(ct(Ye(b,f),Ye(h,m)),l),y:Gt(Gt(Ye(h,f),Ye(b,m)),c)})}function E0(e,t,n,r,o){let i=Oy(e,t,n,r,o),s=[];for(let a of [.5,-0.5])for(let[u,l]of Gy)s.push(i(Gt(Ye(u,.5),a),Ye(l,.5)));return s}function P0(e,t,n){return n<0?{x:Gt(e.x,Ye(-n,t.gy)),y:Gt(e.y,Ye(-n,-t.gx))}:{x:ct(e.x,Ye(n,t.gy)),y:ct(e.y,Ye(n,-t.gx))}}function R0(e,t,n,r){let o=e.length;if(o<2||n.length===0)return [];let i=0;for(let y of n)i=Gt(i,y);if(!(i>0))return [];let s=jr(r%i);s<0&&(s=Gt(s,i));let a=0;for(let y=0;y<1e6;y++){let g=n[a%n.length];if(g>s){s=ct(g,s);break}s=ct(s,g),a++;}let u=a%2===0,l=a+1,c=[0];for(let y=1;y<o;y++)c.push(As(e[y-1],e[y]).len);let f,m,b;(f=e[o-1],m=0,b=By(ct(e[0].x,f.x),ct(e[0].y,f.y)));let h=s,d=[],p=null,x=(y,g)=>Math.abs(ct(y.x,g.x))<vu&&Math.abs(ct(y.y,g.y))<vu;for(let y=0;m<o&&y<1e7;y++){let g=e[m];if(h>b)h=ct(h,b),u&&(x(f,g)?(p&&p.length>1&&d.push(p),p=null):(p??(p=[f]),p.push(g))),f=g,m++,m<o&&(b=c[m]);else {let M=Su(h,b),E={x:Gt(Ye(ct(g.x,f.x),M),f.x),y:Gt(Ye(ct(g.y,f.y),M),f.y)};b=ct(b,h),u&&(x(f,E)?p&&p.length>1&&d.push(p):(p??(p=[f]),p.push(E),d.push(p)),p=null),f=E,h=n[l%n.length],l++,u=!u;}}return u&&p&&p.length>1&&d.push(p),d}function Go(e,t,n,r){let o=[];if(!(t>0)||r===0)return o;let i=Math.max(1,Math.ceil(Math.abs(r)/(Math.PI/2)-1e-9)),s=[];for(let a=0;a<i;a++)s.push(...rr(e.x,e.y,t,t,n+r*a/i,r/i));for(let[a,u,l,c]of s){let f=[];jt([Ge(a.x),Ge(a.y),Ge(u.x),Ge(u.y),Ge(l.x),Ge(l.y),Ge(c.x),Ge(c.y)],f);for(let m=0;m+1<f.length;m+=2)o.push({x:f[m]/16,y:f[m+1]/16});}return o}function T0(e,t){let n=[];for(let r=0;r+1<e.length;r+=2){let o={x:e[r],y:e[r+1]},i=n[n.length-1];(!i||Math.abs(i.x-o.x)>1e-9||Math.abs(i.y-o.y)>1e-9)&&n.push(o);}if(t&&n.length>1){let r=n[0],o=n[n.length-1];Math.abs(r.x-o.x)<=1e-9&&Math.abs(r.y-o.y)<=1e-9&&n.pop();}return n}var Ny=.99;function Vr(e,t){let n=Math.hypot(t.x-e.x,t.y-e.y),r=(t.x-e.x)/n,o=(t.y-e.y)/n;return {ux:r,uy:o,nx:-o,ny:r}}function C0(e,t,n,r,o,i=false){let s={x:e.x+t.nx*r,y:e.y+t.ny*r},a={x:e.x+n.nx*r,y:e.y+n.ny*r};if(r===0)return [e];let u=t.ux*n.uy-t.uy*n.ux;if(Math.abs(u)<1e-12&&t.ux*n.ux+t.uy*n.uy>0)return [a];let l=u*r<0;if(!l&&i){let d=t.ux*n.uy-t.uy*n.ux,p=((a.x-s.x)*n.uy-(a.y-s.y)*n.ux)/d;return [{x:s.x+t.ux*p,y:s.y+t.uy*p}]}if(o.join===2&&t.ux*n.ux+t.uy*n.uy>Ny)return [s];if(!l)return [s,a];if(o.join===2){let d=Math.atan2(s.y-e.y,s.x-e.x),p=Math.atan2(a.y-e.y,a.x-e.x)-d;for(;p>Math.PI;)p-=2*Math.PI;for(;p<-Math.PI;)p+=2*Math.PI;return [s,...Go(e,Math.abs(r),d,p),a]}if(o.join===1)return [s,a];let c=t.ux*n.uy-t.uy*n.ux,f=((a.x-s.x)*n.uy-(a.y-s.y)*n.ux)/c,m={x:s.x+t.ux*f,y:s.y+t.uy*f},b=Math.hypot(m.x-e.x,m.y-e.y),h=o.miterLimit*o.half;if(b<=h)return [m];if(o.join===3){let d=(p,x)=>{let y=x.x-p.x,g=x.y-p.y,M=p.x-e.x,E=p.y-e.y,P=y*y+g*g,R=M*y+E*g,T=M*M+E*E-h*h,w=Math.max(0,R*R-P*T),A=P===0?0:(-R+Math.sqrt(w))/P;return {x:p.x+y*A,y:p.y+g*A}};return [d(s,m),d(a,m)]}return [s,a]}function w0(e,t,n,r,o,i,s=false){let a=(c,f)=>({x:e.x+t.nx*c+t.ux*f,y:e.y+t.ny*c+t.uy*f}),u=o&15;switch(o===17?1:o===18?2:o===19||o===20?3:o>=16?0:u){case 1:return [a(r,i),a(n,i)];case 2:{if(s){let d=Math.abs(r-n)/4,p=Math.atan2(t.ny,t.nx),x=(n+r)/2,y=(r+x)/2,g=(n+x)/2;return [a(r,0),...Go(a(y,0),d,p,-Math.PI),a(x,0),...Go(a(g,0),d,p,-Math.PI),a(n,0)]}let c=(n+r)/2,f=Math.abs(r-n)/2,m=Math.abs(c)>1e-9?a(c,0):e,b=Math.atan2(t.ny,t.nx)+(r<c?Math.PI:0),h=r>c?-Math.PI:Math.PI;return [a(r,0),...Go(m,f,b,h),a(n,0)]}case 3:return s?[a(r,0),a(n,0)]:Math.abs(n+r)>1e-9?[a(r,0),a(n,0)]:[a(r,0),a((n+r)/2,i),a(n,0)];default:return [a(r,0),a(n,0)]}}function Is(e,t,n,r){let o=e.length,i=[],s=t?o:o-1,a=Array.from({length:s},(u,l)=>Vr(e[l],e[(l+1)%o]));for(let u=0;u<o;u++){let l=u-1>=0?u-1:t?s-1:-1,c=u<s?u:-1;if(l>=0&&c>=0)i.push(...C0(e[u],a[l],a[c],n,r,t&&!!r.compound));else {let f=a[c>=0?c:l];i.push({x:e[u].x+f.nx*n,y:e[u].y+f.ny*n});}}return i}function Wy(e,t,n,r){let o=n.dashCapWidth??2*n.half,i=n.dashCap!==0?o:0,s=n.dash.map((g,M)=>M%2===0?Math.max(g-i,$y*o):g+i),a=s.reduce((g,M)=>g+M,0),u=[];if(!(a>0))return u;let l=t?[e[e.length-1],...e]:e,c=((n.dashOffset-(t?i:0))%a+a)%a,f=0;for(;c>=s[f];)c-=s[f],f=(f+1)%s.length;let m=s[f]-c,b=f%2===0,h=b?[l[0]]:null,d=b,p=n.dashMetric,x=l.slice(1).map((g,M)=>{let E=g.x-l[M].x,P=g.y-l[M].y;return p?Math.hypot(p[0]*E+p[2]*P,p[1]*E+p[3]*P):Math.hypot(E,P)}),y=g=>x.slice(g+1).reduce((M,E)=>M+E,0);for(let g=0;g+1<l.length;g++){let M=l[g],E=l[g+1],P=x[g],R=0;for(;P-R>m+1e-9;){R+=m;let T={x:M.x+(E.x-M.x)*R/P,y:M.y+(E.y-M.y)*R/P};b&&h?(h.push(T),u.push({pts:h,first:d,last:!t&&i>0&&P-R+y(g)<=n.half+1e-9}),h=null):(h=[T],d=!t&&i>0&&u.length===0&&x.slice(0,g).reduce((w,A)=>w+A,0)+R<=n.half+1e-9),b=!b,f=(f+1)%s.length,m=s[f];}m-=P-R,b&&h&&(h.push(E),r&&g+2<l.length&&r.some(T=>Math.abs(T.x-E.x)<1e-6&&Math.abs(T.y-E.y)<1e-6)&&(u.push({pts:h,first:d,last:false}),h=[E],d=false)),P=0;}return b&&h&&h.length>1&&u.push({pts:h,first:d,last:true}),u.filter(g=>g.pts.length>1)}function Hy(e,t){let n=D(t.dashCapWidth??2*t.half),r=D(Math.fround(.001)*n),o=t.dash.map((s,a)=>{let u=D(s);if(a%2===1)return D(u+n);let l=D(u-n);return r>l?r:l}),i=[];for(let s=0;s+1<e.length;s+=2)i.push({x:Math.fround(e[s]),y:Math.fround(e[s+1])});return i.length>1&&i[0].x===i[i.length-1].x&&i[0].y===i[i.length-1].y&&i.pop(),R0(i,true,o,D(D(t.dashOffset)-n)).map(s=>({pts:s,first:false,last:false}))}function A0(e,t,n,r,o){let i=E0({x:Math.fround(e.x),y:Math.fround(e.y)},t,r,n,o),s=[i[0]];for(let[a,u,l,c]of [[0,1,2,3],[3,4,5,6],[7,8,9,10],[10,11,12,13]]){let f=[];jt([a,u,l,c].flatMap(m=>[Ge(i[m].x),Ge(i[m].y)]),f);for(let m=0;m+1<f.length;m+=2)s.push({x:f[m]/16,y:f[m+1]/16});}return s.reverse()}var I0=20;function S0(e,t,n,r){let o=t?e[e.length-1]:e[0],i=t?e[e.length-2]:e[1],s=Vr(i,o),a=(l,c)=>({x:o.x+s.ux*l+s.nx*c,y:o.y+s.uy*l+s.ny*c});if(r===18)return Go(o,2*n,Math.atan2(s.uy,s.ux),2*Math.PI);if(r===19)return [a(-2*n,0),a(0,-2*n),a(2*n,0),a(0,2*n)];let u=Math.SQRT2*n;return [a(-u,-u),a(u,-u),a(u,u),a(-u,u)]}function v0(e,t,n){let r=2*n,o=t?e[e.length-1]:e[0],i=t?e[e.length-2]:e[1],s=Math.hypot(i.x-o.x,i.y-o.y),a=(i.x-o.x)/s,u=(i.y-o.y)/s,l=2*r,c=2*r/Math.sqrt(3),f={x:o.x+a*l,y:o.y+u*l};return s>l&&(t?e[e.length-1]=f:e[0]=f),[o,{x:f.x-u*c,y:f.y+a*c},{x:f.x+u*c,y:f.y-a*c}]}var $y=.001;function Yr(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n],o=e[(n+1)%e.length];t+=r.x*o.y-o.x*r.y;}return t/2}function Xy(e,t){let n=false;for(let r=0,o=e.length-1;r<e.length;o=r++){let i=e[r],s=e[o];i.y>t.y!=s.y>t.y&&t.x<(s.x-i.x)*(t.y-i.y)/(s.y-i.y)+i.x&&(n=!n);}return n}function jy(e,t){let n=Yr(e)>0?1:-1,r=e.length,o=Array.from({length:r},(s,a)=>Vr(e[a],e[(a+1)%r])),i=e.map((s,a)=>{let u=o[(a+r-1)%r],l=o[a],c=u.nx*n,f=u.ny*n,m=l.nx*n,b=l.ny*n,h=1+c*m+f*b;return h<1e-9?{x:s.x+c*t,y:s.y+f*t}:{x:s.x+(c+m)*t/h,y:s.y+(f+b)*t/h}});return Math.sign(Yr(i))!==n||i.some(s=>!Xy(e,s))}function Yy(e,t,n){let r=Yr(e)>0?1:-1,o=e.length,i=Array.from({length:o},(a,u)=>Vr(e[u],e[(u+1)%o])),s=[];for(let a=0;a<o;a++){let u=i[(a+o-1)%o],l=i[a],c=r*t;if((u.ux*l.uy-u.uy*l.ux)*c<0)s.push(...C0(e[a],u,l,c,n));else {let m=u.nx*r,b=u.ny*r,h=l.nx*r,d=l.ny*r,p=1+m*h+b*d;s.push(p<1e-9?{x:e[a].x+m*t,y:e[a].y+b*t}:{x:e[a].x+(m+h)*t/p,y:e[a].y+(b+d)*t/p});}}return s}function Xn(e,t){let n=[],r=t.half;for(let o of e){let i=T0(o.pts,o.closed);if(i.length<2)continue;let s=o.closed&&i.length>2,a=-r,u=r;if(t.inset&&s&&!t.dash&&!t.compound){n.push(i.slice()),jy(i,2*r)||n.push(Yy(i,2*r,t).reverse());continue}t.inset&&s&&(Yr(i)>0?(a=0,u=2*r):(a=-2*r,u=0));let l=[],c=t.compound;if(c&&c.length>=2)for(let d=0;d+1<c.length;d+=2)l.push([a+(u-a)*c[d],a+(u-a)*c[d+1]]);else l.push([a,u]);let f=t.inset&&s?{...t,dashOffset:t.dashOffset*2}:t,m=!!t.dash&&!!t.doubleRoundCap&&t.dashCap===2&&s,b=m?Hy(o.pts,t):t.dash?Wy(i,s,f,o.splits):[{pts:i,first:true,last:true}],h=!t.dash&&s;for(let d of b){let p=T0(d.pts.flatMap(M=>[M.x,M.y]),false);if(p.length<2)continue;let x=[],y=null,g=null;!h&&!(t.dash&&s)&&(d.first&&t.startCap>=17&&t.startCap<=19&&(x.push(S0(p,false,r,t.startCap)),y=0),d.last&&t.endCap>=17&&t.endCap<=19&&(x.push(S0(p,true,r,t.endCap)),g=0),d.first&&t.startCap===I0&&(x.push(v0(p,false,r)),y=0),d.last&&t.endCap===I0&&(x.push(v0(p,true,r)),g=0));for(let[M,E]of l){if(h){n.push(Is(p,true,E,t)),n.push(Is(p,true,M,t).reverse());continue}let P=Is(p,false,E,t),R=Is(p,false,M,t).reverse(),T=Vr(p[p.length-2],p[p.length-1]),w=Vr(p[1],p[0]),A=g??(d.last&&!(t.dash&&s)?t.endCap:t.dashCap),I=y??(d.first&&!(t.dash&&s)?t.startCap:t.dashCap),S=m?As(p[p.length-2],p[p.length-1]):null,v=m?As(p[0],p[1]):null,C=S?A0(p[p.length-1],S,M,E,false):w0(p[p.length-1],T,M,E,A,r,t.doubleRoundCap),U=v?A0(p[0],v,M,E,true):w0(p[0],w,-E,-M,I,r,t.doubleRoundCap);if(v&&(P[0]=P0(p[0],v,E)),A===0&&C.length===2&&P.length>2&&R.length>2){let F=(G,W)=>(G.x-W.x)*T.ux+(G.y-W.y)*T.uy<-1e-9,_=P[P.length-2],H=R[1];F(C[0],_)&&(C[0]={x:_.x,y:_.y}),F(C[1],H)&&(C[1]={x:H.x,y:H.y});}let L=[...P.slice(I===1?1:0,-1),...C,...R.slice(1,-1),...U];n.push(L);let k=Math.sign(Yr(L));for(let F of x)n.push(Math.sign(Yr(F))===k?F:F.slice().reverse());}}}return n}var Vy=1,zy=2,Qt=11920928955078125e-23,oe=Math.fround;function Cu(e,t){let n=e.length;if(n<2)return 0;let o=(t[n-1]&128)!==0?e[n-1]:e[0],i=0;for(let s=0;s<n;s++){let a=e[s],u=oe(o.x-a.x);if(Math.abs(u)>=Qt){let l=oe(-a.x/u);if(!(l<-Qt)&&!(oe(l-1)>Qt)){let c=oe(oe(oe(o.y-a.y)*l)+a.y);i=Math.min(i,c);}}o=a;}return i<0?-i:0}function qy(e,t,n,r){let o=oe(t),i=oe(oe(e)*.5),s=[{x:i,y:-o},{x:0,y:0},{x:-i,y:-o}];r&&n!==0&&s.push({x:0,y:oe(oe(n)-o)});let a=new Uint8Array(s.length);return a.fill(1),a[0]=0,r&&(a[s.length-1]|=128),{kind:"plus-path",points:s,types:a,fillRule:"nonzero"}}function U0(e,t,n){let r=t+n;if(n<8||r>e.byteLength)return null;let o=e.getInt32(t+4,true),i=t+8,s=b=>e.getFloat32(i+b,true),a=b=>e.getUint32(i+b,true);if(o===1){if(i+52>r)return null;let b=s(0),h=s(4),d=s(8),p=a(12)!==0,x=qy(b,h,d,p),y=Cu(x.points,x.types);return {kind:"plus-customlinecap",capType:1,baseCap:0,baseInset:b!==0?oe(h/b):0,strokeStartCap:a(16),strokeEndCap:a(20),strokeJoin:a(24),strokeMiterLimit:s(28),widthScale:s(32),fillPath:p?x:null,linePath:p?null:x,fillLength:p?y:0,strokeLength:p?0:y,arrow:{width:b,height:h,middleInset:d,filled:p}}}if(o!==0||i+48>r)return null;let u=a(0),l=i+48,c=()=>{if(l+4>r)return null;let b=e.getInt32(l,true);if(l+=4,b<=0||l+b>r)return null;let h=nr(e,l,b);return l+=b,h},f=u&Vy?c():null,m=u&zy?c():null;return {kind:"plus-customlinecap",capType:0,baseCap:a(4),baseInset:s(8),strokeStartCap:a(12),strokeEndCap:a(16),strokeJoin:a(20),strokeMiterLimit:s(24),widthScale:s(28),fillPath:f,linePath:m,fillLength:f?Cu(f.points,f.types):0,strokeLength:m?Cu(m.points,m.types):0}}function Jy(e,t,n,r){let o=oe(r.x-n.x),i=oe(r.y-n.y),s=Math.sqrt(oe(oe(o*o)+oe(i*i)));if(s<Qt)return null;let a=oe(1/s),u=oe(o*a),l=oe(i*a),c=oe(e.x-n.x),f=oe(e.y-n.y),m=oe(oe(f*f)+oe(c*c)),b=oe(oe(f*l)+oe(c*u));if(b<Qt&&m>=t)return null;let h=t-m+b*b;if(h<Qt)return null;let d=Math.sqrt(h),p=null;if(m>=t){let y=b-d;y>Qt&&y>=0&&(p=y);}if(p===null){let y=d+b;y>Qt&&y>=0&&(p=y);}if(p===null)return null;let x=oe(p);return {x:oe(oe(x*u)+n.x),y:oe(oe(x*l)+n.y)}}function Ky(e,t,n,r,o){let i=e.length,s=g=>n?i-1-g:g,a={...e[s(0)]},u=0,l=false,c=false,f=s(0);for(;u<i;){let g=e[s(u)];f=s(u);let M=oe(g.x-a.x),E=oe(g.y-a.y);if(oe(oe(M*M)+oe(E*E))>r){l=true;break}c=t[s(u)],t[s(u)]=true,u++;}let m=s(Math.max(0,u-1));l&&!c&&(t[m]=false);let b=e[m],h=Jy(a,r,e[f],b)??{x:b.x,y:b.y},d=oe(h.x-a.x),p=oe(h.y-a.y),x=Math.sqrt(d*d+p*p);x>Qt?(d=oe(d/x),p=oe(p/x)):(d=0,p=0);let y=oe(1-o);return e[m]={x:oe(oe(oe(a.x-h.x)*y)+h.x),y:oe(oe(oe(a.y-h.y)*y)+h.y)},{x:d,y:p}}function D0(e,t,n,r){let o=oe(n.y*r),i=oe(-n.x*r),s=oe(n.x*r),a=oe(n.y*r),u=e.points.map(l=>({x:oe(oe(oe(o*l.x)+oe(s*l.y))+t.x),y:oe(oe(oe(i*l.x)+oe(a*l.y))+t.y)}));return {...e,points:u}}function L0(e,t){let n=En(r=>{let o=e.points,i=e.types,s=0;for(;s<o.length;){let a=i[s]&7;if(a===0||s===0)r.moveTo(o[s].x,o[s].y),s++;else if(a===3&&s+2<o.length){r.bezierCurveTo(o[s].x,o[s].y,o[s+1].x,o[s+1].y,o[s+2].x,o[s+2].y),s+=3,i[s-1]&128&&r.closePath();continue}else r.lineTo(o[s].x,o[s].y),s++;i[s-1]&128&&r.closePath();}},[1,0,0,1,0,0]);return t?n.map(r=>({...r,closed:true})):n}function F0(e,t,n,r,o={}){let i=[],s=[],a=[],u=o.minFillScale??2;for(let l of e){if(l.closed||!n&&!r){i.push(l),s.push({start:false,end:false});continue}let c=[];for(let p=0;p+1<l.pts.length;p+=2)c.push({x:l.pts[p],y:l.pts[p+1]});if(c.length<2){i.push(l),s.push({start:false,end:false});continue}let f=new Array(c.length).fill(false),m={...c[0]},b={...c[c.length-1]},h=(p,x,y)=>{let g=y?p.fillPath:p.linePath;if(!g||g.points.length===0)return;let M=oe(p.widthScale*t),E,P;y?(E=p.fillLength,P=Math.max(M,1)):(E=Math.abs(p.strokeLength)<Qt?1:p.strokeLength,P=M);let R=y&&Math.abs(E)<Qt?0:oe(p.baseInset/E),T=oe(E*P),w=Ky(c,f,x,oe(T*T),R),A={x:-w.x,y:-w.y},I=x?b:m;if(y){let S=D0(g,I,A,Math.max(P,u));for(let v of L0(S,true)){let C=[];for(let U=0;U+1<v.pts.length;U+=2)C.push({x:v.pts[U],y:v.pts[U+1]});a.push(C);}}else {let S=D0(g,I,A,P),v={half:Math.max(M,1)/2,join:(o.widenJoin??(C=>C))(p.strokeJoin),miterLimit:10,startCap:p.strokeStartCap,endCap:p.strokeEndCap,dashCap:0,dash:null,dashOffset:0,compound:null,inset:false};a.push(...(o.widen??Xn)(L0(S,false),v).map(C=>C.reverse()));}};n&&h(n,false,true),r&&h(r,true,true),n&&h(n,false,false),r&&h(r,true,false);let d=[];c.forEach((p,x)=>{f[x]||d.push(p.x,p.y);}),d.length>=4&&(i.push({pts:d,closed:false,curved:l.curved}),s.push({start:!!n,end:!!r}));}return {figures:i,capped:s,polygons:a}}var k0=1,_0=2,B0=4,G0=8,O0=16,Du=32,N0=64,W0=128,H0=256,$0=512,X0=1024,Lu=2048,j0=4096,Oo=1024;function Y0(e,t,n,r,o=t){if(n<20)return null;let i=t+n,s=Xr(e.getUint32(t,true)),a=e.getUint32(t+(s?8:4),true),u=e.getFloat32(t+16,true),l=t+20,c=()=>{if(l+4>i)return;let b=e.getUint32(l,true);return l+=4,b},f=()=>{if(l+4>i)return;let b=e.getFloat32(l,true);return l+=4,b},m={kind:"plus-pen",color:"rgba(0,0,0,1)",width:u,dashStyle:0};if(s&&(m.unit=e.getUint32(t+12,true)),a&k0&&(l+24<=i&&(m.transform=[0,4,8,12,16,20].map(b=>e.getFloat32(l+b,true))),l+=24),a&_0&&(m.startCap=c()),a&B0&&(m.endCap=c()),a&G0&&(m.lineJoin=c()),a&O0&&(m.miterLimit=f()),a&Du&&(m.dashStyle=c()??0),a&N0&&(m.dashCap=c()),a&W0&&(m.dashOffset=f()),a&H0){let b=c()??0;b>0&&b<=Oo&&l+b*4<=i&&(m.dashPattern=Array.from({length:b},(h,d)=>e.getFloat32(l+d*4,true)),a&Du||(m.dashStyle=5)),l+=Math.min(b,Oo)*4;}if(a&$0&&(m.alignment=c()),a&X0){let b=c()??0;b>=2&&b<=Oo&&l+b*4<=i&&(m.compound=Array.from({length:b},(h,d)=>e.getFloat32(l+d*4,true))),l+=Math.min(b,Oo)*4;}for(let b of [Lu,j0])if(a&b){let h=c()??0,d=l+h<=i?U0(e,l,h):null;b===Lu?m.customStartCap=d:m.customEndCap=d,l+=h;}if(l+8<=i){let b=Rs(e,l,i-l,r,o);b&&(m.color=b.color,m.brush=b);}return m}function V0(e,t,n){if(n<20)return null;let r=t+n,o=Xr(e.getUint32(t,true)),i=e.getUint32(t+(o?8:4),true),s=t+20,a=()=>{let u=s+4<=r?e.getUint32(s,true):0;s+=4+Math.min(u,Oo)*4;};i&k0&&(s+=24);for(let u of [_0,B0,G0,O0,Du,N0,W0])i&u&&(s+=4);i&H0&&a(),i&$0&&(s+=4),i&X0&&a();for(let u of [Lu,j0])if(i&u){let l=s+4<=r?e.getUint32(s,true):0;s+=4+l;}return s+8<=r?s:null}function Ss(e,t,n,r){let o=null,i=e.getUint32(t+4,true);if(chunk7JVB7NLG_js.p(`replayEmfPlusRecords: OBJECT Image id=${r}, imgType=${{1:"Bitmap",2:"Metafile"}[i]??`Unknown(${i})`}, recDataSize=${n}`),i===1&&n>=28){let a=e.getUint32(t+24,true);if(a===0){let u=e.getInt32(t+8,true),l=e.getInt32(t+12,true),c=e.getInt32(t+16,true),f=e.getUint32(t+20,true);chunk7JVB7NLG_js.p(` Bitmap(Pixel): ${u}\xD7${l}, stride=${c}, pixelFormat=0x${f.toString(16).padStart(8,"0")}`);let m=t+28,b=Math.abs(c);if(u>0&&l>0&&u<=8192&&l<=8192&&m+b*l<=e.byteLength){let h=Vf(e,m,u,l,c,f);h?(chunk7JVB7NLG_js.p(` Bitmap(Pixel): decoded successfully, size=${h.byteLength} bytes`),o=h):chunk7JVB7NLG_js.q(" Bitmap(Pixel): decodeEmfPlusBitmapPixels returned null");}}else if(a===1){let u=t+28,l=n-28;if(chunk7JVB7NLG_js.p(` Bitmap(Compressed): imgLen=${l}, imgStart=0x${u.toString(16)}`),l>0&&u+l<=e.byteLength){if(o=e.buffer.slice(e.byteOffset+u,e.byteOffset+u+l),o.byteLength>=4){let c=new Uint8Array(o,0,4);chunk7JVB7NLG_js.p(` Bitmap(Compressed): first 4 bytes = [${Array.from(c).map(f=>f.toString(16).padStart(2,"0")).join(" ")}]`);}}else chunk7JVB7NLG_js.q(" Bitmap(Compressed): out of bounds or empty");}else chunk7JVB7NLG_js.q(` Bitmap: unrecognised BitmapDataType ${a}`);}else if(i===2&&n>=12){let a=e.getUint32(t+8,true),u=e.getUint32(t+12,true);chunk7JVB7NLG_js.p(` Metafile: type=${{1:"WMF",2:"WMF+Placeable",3:"EMF",4:"EMF+Only",5:"EMF+Dual"}[a]??`Unknown(${a})`}, mfDataSize=${u}`);let c=t+16;if(u>0&&c+u<=e.byteLength){if(o=e.buffer.slice(e.byteOffset+c,e.byteOffset+c+u),o.byteLength>=4){let m=new DataView(o).getUint32(0,true);chunk7JVB7NLG_js.p(` Metafile: first 4 bytes recType=${m} (1=EMR_HEADER)`);}}else chunk7JVB7NLG_js.q(` Metafile: out of bounds or empty (mfStart=0x${c.toString(16)}, mfDataSize=${u}, viewLen=${e.byteLength})`);}return {data:o,type:i}}function z0(e,t,n){if(n<28)return null;let r=e.getFloat32(t+4,true),o=e.getUint32(t+8,true),i=e.getInt32(t+12,true),s=e.getUint32(t+20,true),a="sans-serif";return s>0&&t+24+s*2<=t+n&&(a=chunk7JVB7NLG_js.fa(e,t+24,s)||"sans-serif"),{kind:"plus-font",emSize:r||12,flags:i,family:a,unit:o}}var Zy=64*1024*1024;function vs(){return {continuationBuffer:null,continuationObjectId:-1,continuationObjectType:0,continuationTotalSize:0,continuationOffset:0,continuationKey:void 0}}function q0(e){e.continuationBuffer=null,e.continuationObjectId=-1,e.continuationObjectType=0,e.continuationTotalSize=0,e.continuationOffset=0,e.continuationKey=void 0;}function Qy(e,t,n,r){let o=e.continuationBuffer;if(!o)return;let i=n,s=r;s>=4&&t.getUint32(n,true)===e.continuationTotalSize&&(i+=4,s-=4);let a=Math.max(0,Math.min(s,e.continuationTotalSize-e.continuationOffset));o.set(new Uint8Array(t.buffer,t.byteOffset+i,a),e.continuationOffset),e.continuationOffset+=a;}function eg(e,t){let n=e.continuationBuffer,r=n?{view:new DataView(n.buffer,n.byteOffset,n.byteLength),flags:e.continuationObjectType<<8|t,dataOff:0,dataSize:e.continuationTotalSize,cacheKey:e.continuationKey??-1}:null;return q0(e),r}function Cs(e,t,n,r,o){let i=(n&32768)!==0,s=n&255,a=e.continuationBuffer!==null&&s===e.continuationObjectId;if(!i&&!a)return {view:t,flags:n,dataOff:r,dataSize:o,cacheKey:r};if(i&&!a){if(e.continuationBuffer!==null&&chunk7JVB7NLG_js.q(`EMFPLUS_OBJECT continuation: object ${e.continuationObjectId} never completed, dropping it`),q0(e),o<4)return null;let u=t.getUint32(r,true),l=t.byteLength-r;if(u<=0||u>Zy||u>l)return chunk7JVB7NLG_js.q(`EMFPLUS_OBJECT continuation: rejecting invalid totalObjectSize=${u} (remaining=${l}, recDataSize=${o})`),null;e.continuationBuffer=new Uint8Array(u),e.continuationObjectId=s,e.continuationObjectType=n>>8&127,e.continuationTotalSize=u,e.continuationOffset=0,e.continuationKey=r;}return Qy(e,t,r,o),!i||e.continuationOffset>=e.continuationTotalSize?eg(e,s):null}var $o=5e5;function tg(e,t){let n=e.flags>>8&127;if(n!==1&&n!==2||e.dataSize<8)return;let{view:r}=e,o=e.dataOff+e.dataSize,i=e.dataOff;if(n===2){let c=V0(r,e.dataOff,e.dataSize);if(c===null)return;i=c;}let s=Xr(r.getUint32(i,true)),a=i+(s?4:0);if(a+8>o||r.getUint32(a,true)!==2)return;let u=m0(r,a+4,o);if(u===null)return;let l=c0(r,u,o);l&&t.push({key:e.cacheKey,view:r,byteStart:l.start,byteEnd:l.end});}function ng(e,t,n,r,o,i){let s=t+n,a=t,u=0;for(;a+12<=s&&u<$o;){let l=e.getUint16(a,true),c=e.getUint16(a+2,true),f=e.getUint32(a+4,true),m=e.getUint32(a+8,true);if(f<12||a+f>s)break;if(u++,i&&m<=f-12&&i.plus(l,a+12,m),l===16392){let b=Cs(r,e,c,a+12,m);b&&o(b);}a+=f;}}function Xo(e,t,n){let r=vs(),o=0,i=e.byteLength,s=0;for(;o+8<=i&&s<$o;){let a=e.getUint32(o,true),u=e.getUint32(o+4,true);if(u<8||o+u>i)break;if(s++,n?.emf(a,o+8,u),a===70&&u>=16){let l=o+8,c=e.getUint32(l,true);e.getUint32(l+4,true)===726027589&&c>4&&ng(e,l+8,c-4,r,t,n);}else if(a===14)break;o+=u;}}function rg(e){let t=[];return Xo(e,n=>tg(n,t)),t}async function ku(e,t,n){let r=n-t;if(r<=0)return null;let o=new Uint8Array(e.buffer,e.byteOffset+t,r),i=new ArrayBuffer(r);new Uint8Array(i).set(o);try{let s=await chunk7JVB7NLG_js.ha(i);if(!s)return null;let{width:a,height:u}=s;if(a<=0||u<=0||a>8192||u>8192)return s.close(),null;let l=chunk7JVB7NLG_js.Y(a,u);if(!l)return s.close(),null;chunk7JVB7NLG_js.ja(l.ctx,s.drawable,0,0,a,u),s.close();let c=chunk7JVB7NLG_js.ka(l.ctx,0,0,a,u);return {width:a,height:u,rgba:new Uint8ClampedArray(c.data.buffer.slice(0))}}catch(s){return chunk7JVB7NLG_js.q("preDecodeEmfPlusTextures: failed to decode a compressed texture image:",s instanceof Error?s.message:s),null}}async function Ls(e){let t=new Map,n;try{n=rg(e);}catch(r){return chunk7JVB7NLG_js.q("preDecodeEmfPlusTextures: scan failed:",r instanceof Error?r.message:r),t}if(n.length===0)return t;chunk7JVB7NLG_js.p(`preDecodeEmfPlusTextures: found ${n.length} compressed-texture candidate(s)`);for(let r of n){let o=await ku(r.view,r.byteStart,r.byteEnd);o&&(t.set(r.key,o),chunk7JVB7NLG_js.p(`preDecodeEmfPlusTextures: decoded texture for key=0x${r.key.toString(16)}: ${o.width}x${o.height}`));}return t}var tb=1,nb=2,Us=24,og={flags:0,illuminant:0,redGamma:1e4,greenGamma:1e4,blueGamma:1e4,referenceBlack:0,referenceWhite:1e4,contrast:0,brightness:0,colorfulness:0,redGreenTint:0},J0=new Map;function rb(e){let t=J0.get(e);if(t===void 0){let n=Ff(e);if(t=null,n){let r=Uint8Array.from(atob(n),i=>i.charCodeAt(0)),o=chunkOB5ODU4B_js.b(r);t=new Uint8Array(32768*3);for(let i=0;i<3;i++)for(let s=0;s<32768;s++){let a=s&31?t[(s-1)*3+i]:0;t[s*3+i]=a+o[i*32768+s]&255;}}J0.set(e,t);}return t}var ig={1:[[1.64737,-0.59174,-0.05494],[.02963,.96126,.00881],[.2911,.40189,.30769]],2:[[1.22319,-0.17765,-0.04515],[.00275,.99054,.00645],[.05514,.12795,.81816]],3:[[1.02833,-0.01775,-0.01086],[.00861,.98431,.00728],[-0.01616,-0.0448,1.05995]],4:[[1.17271,-0.14059,-0.03174],[-474e-5,1.00266,.00183],[.05783,.14663,.79683]],5:[[1.10431,-0.08327,-0.02067],[-336e-5,1.0025,67e-5],[.03344,.09072,.87702]],7:[[.92515,.05628,.01822],[.00318,.9967,34e-5],[-0.02086,-0.06817,1.08783]],8:[[1.31275,-0.26259,-0.04977],[-244e-5,.99695,.00524],[.10854,.23443,.65827]]};function ob(e){return rb(e.illuminant)!==null}var or=Array.from({length:32},(e,t)=>Math.round(t*255/31));function sg(e){let t=Math.round(e*31/255);return or[t]===e?255*t/31:e}function _u(e){let t=bg(e)*255,n=Math.min(30,Math.floor(t*31/255));for(;n<30&&t>=or[n+1];)n++;for(;n>0&&t<or[n];)n--;return n+Math.min(1,Math.max(0,(t-or[n])/(or[n+1]-or[n])))}function ag(e,t,n,r){let o=_u(t),i=_u(n),s=_u(r),a=Math.min(30,Math.floor(o)),u=Math.min(30,Math.floor(i)),l=Math.min(30,Math.floor(s)),c=o-a,f=i-u,m=s-l,b=[0,0,0];for(let h=0;h<3;h++){let d=0;for(let p=0;p<8;p++){let x=p&1,y=p>>1&1,g=p>>2&1,M=(x?c:1-c)*(y?f:1-f)*(g?m:1-m);M!==0&&(d+=M*e[(((a+x)*32+u+y)*32+l+g)*3+h]);}b[h]=d/255;}return b}function ib(e){return !!e&&!ob(e)&&e.colorfulness===0&&e.redGreenTint===0}function Fs(e,t){let n={flags:e.getUint16(t+2,true),illuminant:e.getUint16(t+4,true),redGamma:e.getUint16(t+6,true),greenGamma:e.getUint16(t+8,true),blueGamma:e.getUint16(t+10,true),referenceBlack:e.getUint16(t+12,true),referenceWhite:e.getUint16(t+14,true),contrast:e.getInt16(t+16,true),brightness:e.getInt16(t+18,true),colorfulness:e.getInt16(t+20,true),redGreenTint:e.getInt16(t+22,true)},r=(i,s,a)=>i>=s&&i<=a;return (n.flags&-4)===0&&r(n.illuminant,0,8)&&r(n.redGamma,2500,65e3)&&r(n.greenGamma,2500,65e3)&&r(n.blueGamma,2500,65e3)&&r(n.referenceBlack,0,4e3)&&r(n.referenceWhite,6e3,1e4)&&r(n.contrast,-100,100)&&r(n.brightness,-100,100)&&r(n.colorfulness,-100,100)&&r(n.redGreenTint,-100,100)?n:null}function Gu(e){return !e||e.flags===0&&!ob(e)&&e.redGamma===1e4&&e.greenGamma===1e4&&e.blueGamma===1e4&&e.referenceBlack===0&&e.referenceWhite===1e4&&e.contrast===0&&e.brightness===0&&e.colorfulness===0&&e.redGreenTint===0}var ug=.0148885,lg=.95625,cg=1/100,mg=-Math.PI/3,en=[[.4123908,.3575843,.1804808],[.212639,.7151687,.0721923],[.0193308,.1191948,.9505322]],Pn=fg(en),jo=en.map(e=>e[0]+e[1]+e[2]),sb=jo[0]+15*jo[1]+3*jo[2],K0=4*jo[0]/sb,Z0=9*jo[1]/sb;function fg(e){let[[t,n,r],[o,i,s],[a,u,l]]=e,c=i*l-s*u,f=s*a-o*l,m=o*u-i*a,b=t*c+n*f+r*m;return [[c/b,(r*u-n*l)/b,(n*s-r*i)/b],[f/b,(t*l-r*a)/b,(r*o-t*s)/b],[m/b,(n*a-t*u)/b,(t*i-n*o)/b]]}var bg=e=>e<0?0:e>1?1:e,ir=e=>e<0?0:e>255?255:e,Q0=e=>Math.floor(e+.5+1e-7);function hg(e,t,n,r,o){let i=en[0][0]*e+en[0][1]*t+en[0][2]*n,s=en[1][0]*e+en[1][1]*t+en[1][2]*n,a=en[2][0]*e+en[2][1]*t+en[2][2]*n,u=i+15*s+3*a;if(u<=1e-9||s<=1e-9)return [ir(e),ir(t),ir(n)];let l=4*i/u-K0,c=9*s/u-Z0,f=Math.cos(o)*r,m=Math.sin(o)*r,b=Math.max(0,K0+l*f-c*m),h=Math.max(1e-6,Z0+l*m+c*f),d=s*9*b/(4*h),p=s*(12-3*b-20*h)/(4*h),x=[Pn[0][0]*d+Pn[0][1]*s+Pn[0][2]*p,Pn[1][0]*d+Pn[1][1]*s+Pn[1][2]*p,Pn[2][0]*d+Pn[2][1]*s+Pn[2][2]*p],y=Math.min(0,x[0],x[1],x[2]),g=Math.max(255,x[0],x[1],x[2]);if(y<0||g>255){let M=255/(g-y);return [(x[0]-y)*M,(x[1]-y)*M,(x[2]-y)*M]}return x}var eb=new Map;function dg(e){if(e.illuminant!==0&&e.illuminant!==6)return null;let t=`${e.colorfulness},${e.redGreenTint}`,n=eb.get(t);if(n===void 0){let r=kf(t);if(n=null,r){n=new Int8Array(32768*3);for(let o of r)n[o>>1]=o&1?1:-1;}eb.set(t,n);}return n}function Bu(e){let t=Math.round(e*31/255);return or[t]===e?t:-1}function pg(e){let t=Bu(e[0]),n=Bu(e[1]),r=Bu(e[2]);return t<0||n<0||r<0?-1:(t*32+n)*32+r}function xg(e,t){let n=rb(e.illuminant),r=ig[e.illuminant],o=[e.redGamma/1e4,e.greenGamma/1e4,e.blueGamma/1e4],i=e.referenceBlack/1e4*255,s=Math.max(1e-6,e.referenceWhite/1e4*255-i),a=Math.exp(ug*e.contrast),u=lg*e.brightness,l=e.colorfulness!==0||e.redGreenTint!==0,c=1+cg*e.colorfulness,f=mg*e.redGreenTint/100,m=(e.flags&nb)!==0,b=(e.flags&tb)!==0,h=l&&t?.chromaTies!==false?dg(e):null,d=(p,x)=>{let y=255*(ir(p)/255)**o[x];return y=(y-i)/s*255,y=y*a+u,m&&(y=255*Math.log2(1+7*ir(y)/255)/3),b&&(y=255-ir(y)),Q0(ir(y))};if(!n&&!l){let p=[0,1,2].map(x=>Uint8Array.from({length:256},(y,g)=>d(g,x)));return x=>p[0][x>>16&255]<<16|p[1][x>>8&255]<<8|p[2][x&255]}return p=>{let x=[p>>16&255,p>>8&255,p&255];if(l){let y=h?pg(x):-1;if(x=x.map(sg),r){let[g,M,E]=x;x=r.map(P=>P[0]*g+P[1]*M+P[2]*E);}x=hg(x[0],x[1],x[2],c,f),x=x.map(Q0),h&&y>=0&&(x=x.map((g,M)=>g+h[y*3+M]));}else if(n){let y=ag(n,x[0]/255,x[1]/255,x[2]/255);x=[y[0]*255,y[1]*255,y[2]*255];}return d(x[0],0)<<16|d(x[1],1)<<8|d(x[2],2)}}function ab(e){let n={...og,illuminant:e.illuminant,colorfulness:e.colorfulness,redGreenTint:e.redGreenTint},r={...e,illuminant:0,colorfulness:0,redGreenTint:0};return {palette:Gu(n)?void 0:n,curves:Gu(r)?void 0:r}}function Ou(e,t){if(!t||Gu(t))return;let n=xg(t),r=new Map;for(let o=0;o+2<e.length;o+=3){let i=e[o]<<16|e[o+1]<<8|e[o+2],s=r.get(i);s===void 0&&(s=n(i),r.size<65536&&r.set(i,s)),e[o]=s>>16&255,e[o+1]=s>>8&255,e[o+2]=s&255;}}var yg=["johab","illuminants","chromaTies","colorCurve"];function ub(e,t){let n=new Set,r=0,o=()=>{(++r&1023)===0&&t?.budget?.check();};return {needs:n,observer:{emf(s,a,u){if(o(),s===82&&u>=332&&e.getUint8(a+27)===130)n.add("johab");else if(s===23&&u>=8+Us){let l=Fs(e,a);l&&l.illuminant!==0&&l.illuminant!==6?n.add("illuminants"):l&&(l.colorfulness!==0||l.redGreenTint!==0)&&n.add("chromaTies");}},plus(s,a,u){o(),s===16440&&!n.has("colorCurve")&&ys(e,a,u)?.kind==="colorCurve"&&n.add("colorCurve");}}}}async function $u(e,t){t?.budget?.check(),e?.size!==0&&await xu(e??yg).finally(()=>t?.budget?.check());}function*gg(e,t,n){let r=t,o=0;for(;r+6<=e.byteLength&&o<n;){let i=e.getUint32(r,true)*2,s=e.getUint16(r+4,true);if(i<6||r+i>e.byteLength||s===0)break;if(chunkDO2CGP4P_js.c(),chunkDO2CGP4P_js.d()&&(yield),s===763&&i>=24&&e.getUint8(r+6+13)===130)return true;r+=i,o++;}return false}async function lb(e,t,n){let r=n.budget??null;await chunkDO2CGP4P_js.f(r,gg(e,t,n.maxRecords??2e5))&&await xu(["johab"]).finally(()=>r?.check());}var Xu=3;async function ju(e,t=0,n){let r=new Map,o=[],i=ub(e,n);try{Xo(e,s=>{if((s.flags>>8&127)!==5||s.dataSize<8)return;let u=Ss(s.view,s.dataOff,s.dataSize,s.flags&255);u.data&&u.data.byteLength>0&&o.push({key:s.cacheKey,type:u.type,data:u.data});},i?.observer);}catch(s){return n?.budget?.throwIfTripped(),chunk7JVB7NLG_js.q("preDecodeEmfPlusImages: scan failed:",s instanceof Error?s.message:s),i&&await $u(null,n),r}if(i){let s=(n?.maxRecords??0)>$o&&e.byteLength>=$o*8;await $u(s?null:i.needs,n);}for(let s of o){let a=new DataView(s.data,0,s.data.byteLength);if(s.type===2){if(t>=Xu)continue;r.set(s.key,{kind:"metafile",caches:await Mg(a,t+1,n?.budget)});continue}let u=await ku(a,0,s.data.byteLength);u&&(r.set(s.key,{kind:"bitmap",...u}),chunk7JVB7NLG_js.p(`preDecodeEmfPlusImages: decoded image key=0x${s.key.toString(16)}: ${u.width}x${u.height}`));}return r}async function Mg(e,t=0,n){return {textures:await Ls(e),images:await ju(e,t,{budget:n})}}function cb(e,t,n){if(!n)return (e%t+t)%t;let r=(e%(2*t)+2*t)%(2*t);return r<t?r:2*t-1-r}function Eg(e,t,n,r,o,i,s,a){let u=Math.floor(e+1e-9),l=Math.floor(t+1e-9),c=Math.round(Math.max(0,e-u)*2048)/2048,f=Math.round(Math.max(0,t-l)*2048)/2048,m=i==="clamp",b=i==="tile-flip-x"||i==="tile-flip-xy",h=i==="tile-flip-y"||i==="tile-flip-xy",d=0,p=0,x=0,y=0;for(let g=0;g<4;g++){let M=u+(g&1),E=l+(g>>1),P=(g&1?c:1-c)*(g>>1?f:1-f);if(P<=0)continue;let R,T;if(m){if(M<0||E<0||M>=n||E>=r)continue;R=M,T=E;}else R=cb(M,n,b),T=cb(E,r,h);let w=(T*n+R)*4,A=o[w+3];d+=P*Math.round(o[w]*A/255),p+=P*Math.round(o[w+1]*A/255),x+=P*Math.round(o[w+2]*A/255),y+=P*A;}y=Math.round(y),!(y<=0)&&(s[a]=Math.round(Math.round(d)*255/y),s[a+1]=Math.round(Math.round(p)*255/y),s[a+2]=Math.round(Math.round(x)*255/y),s[a+3]=y);}function Jo(e,t=false){let[n,r,o,i,s,a]=[e[0],e[1],e[2],e[3],e[4],e[5]].map(Math.fround),u=t?D(D(D(D(.5*n)+D(.5*o))+s)-.5):s,l=t?D(D(D(D(.5*r)+D(.5*i))+a)-.5):a,c=D(D(n*i)-D(r*o));if(!Number.isFinite(c)||c===0)return null;let f=D(1/c);return [D(i*f),D(-r*f),D(-o*f),D(n*f),D(D(D(o*l)-D(i*u))*f),D(D(D(r*u)-D(n*l))*f)]}function fb(e,t,n,r,o,i,s,a,u,l,c){let f=new Float64Array(a),m=new Float64Array(a);for(let b=0;b<u;b++){let h=0;for(;h<a;){let d=a;if(c){for(;h<a&&c[b*a+h]===0;)h++;if(h>=a)break;for(d=h;d<a&&c[b*a+d]!==0;)d++;}let p=d-h,x=f.subarray(h,d),y=m.subarray(h,d);Yu(e,i+h,s+b,x,y,p);for(let g=0;g<p;g++)Eg(x[g],y[g],t,n,r,o,l,(b*a+h+g)*4);h=d;}}}function Yu(e,t,n,r,o,i=r.length){if(i<=0)return;let[s,a,u,l,c,f]=e,m=E=>[D(D(D(s*E)+D(u*n))+c),D(D(D(a*E)+D(l*n))+f)],[b,h]=m(t),[d,p]=m(t+i),x=D(D(d-b)/i),y=D(D(p-h)/i),g=b,M=h;for(let E=0;E<i;E++)r[E]=g,o[E]=M,g=D(g+x),M=D(M+y);}var mb=[1,0,0,1,0,0];function Pg(e,t){return (e[t+3]<<24|e[t]<<16|e[t+1]<<8|e[t+2])>>>0}function bb(e,t,n=mb){let{width:r,height:o,rgba:i}=t;if(r<=0||o<=0)return null;try{let s=t.transform??mb,a=(u,l)=>{let c=Math.floor(u),f=Math.floor(l);return c<0||f<0||c>=r||f>=o?null:Pg(i,(f*r+c)*4)};return ls(e,{x:0,y:0,w:r,h:o},r,o,t.wrapMode,s,Fo(n),{phaseX:0,lagX:0,lagY:0},a)}catch{return null}}var zu=new Float32Array(1),Vu=new Uint32Array(zu.buffer);function hb(e){return zu[0]=e,e>0?Vu[0]-=1:e<0?Vu[0]+=1:Vu[0]=2147483649,zu[0]}function re(e,t){let n=e+t,r=n-e,o=e-(n-r)+(t-r),i=D(n);return Math.fround(n)===n&&o<0?hb(n):i}var Ve=(e,t)=>re(e,-t),z=(e,t)=>D(e*t);function sr(e,t){let n=D(e/t);return (t>0?n*t>e:n*t<e)&&(n=hb(n)),n}var ks=.000596046448;function qu(e){let[t,n,r,o,i,s]=e,a=Math.abs(t),u=Math.abs(o),l=Math.abs(n),c=Math.abs(r),f=a>u?a:u,m=l>c?n:c,b;f>m?b=a>u?t:o:b=l>c?n:r;let h=D(Math.abs(b)*ks),d=15;return h>l&&h>c?(d=3,ks>Math.abs(Ve(t,1))&&ks>Math.abs(Ve(o,1))&&(d=1)):h>Math.abs(Ve(t,o))&&h>Math.abs(re(r,n))&&(d=ks>Math.abs(Ve(re(z(n,n),z(t,t)),1))?5:7),i===0&&s===0&&(d&=-2),d}function Ko(e,t){let[n,r,o,i,s,a]=e,[u,l,c,f]=t,m=-f,b=-c,h=Ve(z(re(c,u),re(l,f)),z(l,u)),d=re(h,Ve(z(m,u),z(l,c)));if(!(Math.abs(d)>=11920929e-14))return null;let p=sr(1,d),x=z(re(z(f,o),z(m,n)),p),y=z(re(z(f,i),z(m,r)),p),g=z(re(z(c,s),z(b,n)),p),M=z(re(z(c,a),z(b,r)),p),E=z(-u,f),P=z(-l,c),R=Ve(z(re(u,c),re(l,f)),z(u,l)),T=z(re(re(z(E,o),z(R,n)),z(P,s)),p),w=z(re(re(z(E,i),z(R,r)),z(P,a)),p);return [x,y,g,M,T,w]}function Zo(e,t){let n=qu(e),[r,o,i,s,a,u]=e,l=[];for(let c=0;c<t.length;c+=2){let f=t[c],m=t[c+1];n===0?l.push(f,m):(n&-2)===0?l.push(re(a,f),re(u,m)):(n&-4)===0?l.push(re(z(r,f),a),re(z(s,m),u)):l.push(re(re(z(f,r),z(m,i)),a),re(re(z(f,o),z(m,s)),u));}return l}function Rg(e,t){let n=Ko(e,t);if(!n)return null;let[r,o,i,s]=t;return Zo(n,[r,o,re(r,i),o,r,re(o,s)])}function _s(e,t){let[n,r,o,i,s,a]=e,[u,l,c,f,m,b]=t;return [re(z(n,u),z(r,c)),re(z(n,l),z(r,f)),re(z(o,u),z(i,c)),re(z(o,l),z(i,f)),re(re(z(s,u),z(a,c)),m),re(re(z(s,l),z(a,f)),b)]}function Ju(e,t,n){let r=Rg(e,t);if(!r)return null;let o=Ko(r,t);return o?_s(o,n):null}function Ku(e){let[t,n,r,o,i,s]=e,a=Ve(z(t,o),z(n,r));if(!Number.isFinite(a)||a===0)return null;let u=sr(1,a);return [z(o,u),z(-n,u),z(-r,u),z(t,u),z(Ve(z(r,s),z(o,i)),u),z(Ve(z(n,i),z(t,s)),u)]}function db(e,t,n,r,o,i){let[s,a,u,l,c,f]=e,m=qu(e),b=P=>m===0?[P,n]:(m&-2)===0?[re(P,c),re(n,f)]:(m&-4)===0?[re(z(P,s),c),re(z(n,l),f)]:[re(re(z(s,P),z(u,n)),c),re(re(z(a,P),z(l,n)),f)],[h,d]=b(t),[p,x]=b(t+r),y=sr(Ve(p,h),r),g=sr(Ve(x,d),r),M=h,E=d;for(let P=0;P<r;P++)o[P]=M,i[P]=E,M=re(M,y),E=re(E,g);}function pb(e,t,n,r,o,i){let[s,a,u,l,c,f]=e,m=qu(e),b=w=>m===0?[w,n]:(m&-2)===0?[re(w,c),re(n,f)]:(m&-4)===0?[re(z(w,s),c),re(z(n,l),f)]:[re(re(z(s,w),z(u,n)),c),re(re(z(a,w),z(l,n)),f)],[h,d]=b(t),[p,x]=b(t+r),y=w=>{let A=Math.floor(re(z(w,65536),.5));return A>=-2147483648&&A<=2147483647?A:-2147483648},g=(w,A)=>M(sr(z(Ve(A,w),65536),r)),M=w=>{let A=Math.floor(re(w,.5));return A>=-2147483648&&A<=2147483647?A:-2147483648},E=y(h),P=y(d),R=g(h,p),T=g(d,x);for(let w=0;w<r;w++)o[w]=E,i[w]=P,E=E+R|0,P=P+T|0;}function Tg(e,t){let[n,r,o,i]=e.map(Math.fround),[s,a,u,l]=t.map(Math.fround),c=re(n,o),f=re(r,i),m=re(s,u),b=re(a,l);if(n===c||r===f)return null;let h=sr(Ve(m,s),Ve(c,n)),d=sr(Ve(b,a),Ve(f,r)),p=Ve(m,z(h,c)),x=Ve(b,z(d,f));return Zo([h,0,0,d,p,x],[n,r,c,r,n,f])}function Zu(e,t){let[n,r,o,i]=t.map(Math.fround),s=Zo(e,[n,r,re(n,o),re(r,i)]);return [s[0],s[1],Ve(s[2],s[0]),Ve(s[3],s[1])]}function Qu(e,t,n){let r=Tg(e,t);if(!r)return null;let o=Ko(r,e);return o?_s(o,n):null}var xb=[[-1675,5953,56660,6337,-1739],[-1612,5575,56650,6727,-1804],[-1550,5203,56630,7123,-1870],[-1489,4837,56600,7525,-1937],[-1429,4477,56561,7931,-2004],[-1371,4125,56510,8345,-2073],[-1313,3777,56451,8763,-2142],[-1257,3437,56381,9187,-2212],[-1202,3103,56301,9617,-2283],[-1148,2775,56211,10053,-2355],[-1095,2453,56112,10493,-2427],[-1044,2139,56002,10939,-2500],[-993,1829,55884,11389,-2573],[-945,1529,55754,11845,-2647],[-897,1233,55616,12305,-2721],[-851,945,55467,12771,-2796],[-806,663,55309,13241,-2871],[-762,387,55142,13715,-2946],[-720,119,54964,14195,-3022],[-679,-143,54778,14677,-3097],[-639,-399,54582,15165,-3173],[-600,-649,54377,15657,-3249],[-563,-891,54162,16153,-3325],[-528,-1125,53937,16653,-3401],[-493,-1355,53705,17155,-3476],[-460,-1577,53462,17663,-3552],[-429,-1791,53210,18173,-3627],[-398,-2001,52950,18687,-3702],[-369,-2203,52681,19203,-3776],[-341,-2399,52403,19723,-3850],[-315,-2587,52116,20245,-3923],[-289,-2771,51821,20771,-3996],[-265,-2947,51517,21299,-4068],[-243,-3115,51204,21829,-4139],[-221,-3279,50884,22361,-4209],[-201,-3435,50554,22897,-4279],[-182,-3585,50217,23433,-4347],[-164,-3729,49872,23971,-4414],[-147,-3867,49518,24513,-4481],[-131,-3999,49158,25053,-4545],[-117,-4123,48788,25597,-4609],[-103,-4243,48412,26141,-4671],[-90,-4357,48029,26685,-4731],[-79,-4463,47637,27231,-4790],[-68,-4565,47239,27777,-4847],[-59,-4659,46833,28323,-4902],[-50,-4749,46421,28869,-4955],[-42,-4833,46002,29415,-5006],[-35,-4911,45576,29961,-5055],[-29,-4983,45143,30507,-5102],[-24,-5049,44704,31051,-5146],[-19,-5111,44259,31595,-5188],[-15,-5167,43807,32139,-5228],[-11,-5219,43351,32679,-5264],[-8,-5265,42888,33219,-5298],[-6,-5305,42419,33757,-5329],[-4,-5341,41944,34295,-5358],[-3,-5371,41464,34829,-5383],[-2,-5397,40980,35359,-5404],[-1,-5419,40490,35889,-5423],[0,-5437,39996,36415,-5438],[0,-5449,39497,36937,-5449],[0,-5457,38993,37457,-5457],[0,-5461,38485,37973,-5461]];function el(e){return e<64?{first:-2,weights:xb[e]}:{first:-1,weights:xb[127-e].slice().reverse()}}var wg=(()=>{let e=new Int32Array(512).fill(Number.NaN);for(let t=0;t<128;t++){let{first:n,weights:r}=el(t),o=-32768;for(let i=0;i<=5;i++){let s=128*(n+i)-64-t-1;s>=-256&&s<=255&&(e[s+256]=o),i<5&&(o+=r[i]);}}return e})();function Bs(e){return e<-256?-32768:e>255?32768:wg[e+256]}var gb=1/65536;function Ag(e){return e<=-128?0:e>=128?65536:32768+(e<0?-(512*-e-2*e*e):512*e-2*e*e)}function Ig(e){return e<-256?0:e>255?65536:32768+Bs(e)}var We=e=>e|0,Mb=(e,t)=>Math.floor(e*t/65536);function Eb(e){return e>=-32768&&e<=32767}var ar=e=>On(fe(Q(e,65536),.5)),Gs=e=>On(fe(Q(e,16),.5));function nl(e,t,n,r){if(![e,t,n,r].every(Eb))return null;let o=ar(we(t,r));if(o===0)return null;let i=Gs(n),s=Gs(fe(Q(t,we(r,t)),n)),a=We(Math.min(i,s)<<12)>>16,u=We(Math.max(i,s)<<12)+65535>>16,l=D(o),c=o<0?te(D(u),fe(r,n)):te(D(a),n),f=Q(Q(c,l),gb),m=ar(o<0?te(e,f):fe(f,e));return {firstRow:a,yStart:m,yStep:o}}function Pb(e){let[t,n,r,o]=e.src.map(Math.fround),[i,s,a,u]=e.dest.map(Math.fround);if(![t,r,i,a].every(Eb))return null;let l=e.kernel==="cubic"?2:1,c=e.kernel==="cubic"?131072:65536,f=.5,m=ar(we(r,a));ar(we(a,r));ar(we(u,o));let d=nl(n,o,s,u);if(m===0||!d)return null;let{firstRow:p,yStart:x,yStep:y}=d,g=Gs(i),M=Gs(fe(Q(r,we(a,r)),i)),E=Math.min(g,M),P=Math.max(g,M),R=E+15>>4,T=We(E<<12),w=We(P<<12),A=Z=>D(Z),I=A(m),S,v;m<0?(S=A(w+65535>>16),v=fe(i,a)):(S=A(T>>16),v=i);let C=te(v,S);C=Q(C,I),C=Q(C,gb),C=fe(C,t);let U=ar(C),L=(Z,J)=>{let K=ar(we(Q(l,Z),J));return K<0&&(K=-K),K<c?c:K},k=L(r,a),F=On(fe(Q(we(65536,A(k)),65536),f)),_=L(o,u),H=On(fe(Q(we(65536,A(_)),65536),f)),G=(w+65535>>16)-(T>>16)+1,W=2*(_+65535>>16)+1,N=(Z,J)=>{let K=J-32768;return K>=-2147483648&&K<=2147483647&&K-Z>=-2147483648&&K+Z<=2147483647};return !N(k,U)||!N(_,x)?null:{request:e,firstColumn:R,columns:G,firstRow:p,xStart:U,xStep:m,xStretch:k,xRecip:F,yStart:x,yStep:y,yStretch:_,yRecip:H,kernelRows:W,table:e.kernel==="cubic"?Ig:Ag,shift:e.kernel==="cubic"?8:9,rows:new Map}}function tl(e,t,n){if(!n)return (e%t+t)%t;let r=(e%t+t)%t;return Math.floor(e/t)%2!==0?t-r-1:r}function Sg(e){return [e>>>16&255,e>>>8&255,e&255,e>>>24]}function Rb(e,t){let{request:n,columns:r,xStart:o,xStep:i,xStretch:s,xRecip:a,table:u,shift:l}=e,{width:c,wrap:f=4,clampArgb:m=0}=n,b=n.kernel==="cubic",h=new Uint8Array(r*4),d=Sg(m),p=f===1||f===3,x=We(o-32768),y=[0,0,0,0];for(let g=0;g<r;g++){let M=We(s+65535+x),E=M>>16,P=We(M-2*s)>>16;y[0]=y[1]=y[2]=y[3]=0;let R=0,T=(L,k,F)=>{let _=u(We(L)>>l),H=_-R;R=_,y[0]+=k[F]*H,y[1]+=k[F+1]*H,y[2]+=k[F+2]*H,y[3]+=k[F+3]*H;},w=L=>Mb(We(We(L<<16)-x),a),A=P<0?0:P,I=E<c-1?E:c-1,S=w(P);for(let L=P;L<Math.min(A,E+1);L++)f===4||!t?T(S,d,0):T(S,t,tl(L,c,p)*4),S=We(S+a);if(A<=I){S=w(A);for(let L=A;L<=I;L++)t?T(S,t,L*4):T(S,d,0),S=We(S+a);}let v=Math.max(I+1,P);if(v<=E){S=w(v);for(let L=v;L<=E;L++)f===4||!t?T(S,d,0):T(S,t,tl(L,c,p)*4),S=We(S+a);}let C=g*4,U=Math.max(0,Math.min(255,y[3]+32768>>16));h[C+3]=U;for(let L=0;L<3;L++){let k=y[L]+32768>>16;h[C+L]=b?Math.max(0,Math.min(U,k)):Math.min(255,k);}x=We(x+i);}return h}function yb(e,t){let{request:n}=e,{height:r,width:o,wrap:i=4}=n,s=t;if(s<0||s>=r){if(i===4)return null;s=tl(s,r,i===2||i===3);}let a=e.rows.get(s);if(!a){let u=n.pixels instanceof Uint8Array||n.pixels instanceof Uint8ClampedArray?n.pixels.subarray(s*o*4,(s+1)*o*4):Uint8Array.from(Array.prototype.slice.call(n.pixels,s*o*4,(s+1)*o*4));a=Rb(e,u),e.rows.set(s,a);}return a}function vg(e){let t=e.rows.get(Number.NaN);return t||(t=Rb(e,null),e.rows.set(Number.NaN,t)),t}function Tb(e,t,n,r){let{firstColumn:o,columns:i,firstRow:s,yStart:a,yStep:u,yStretch:l,yRecip:c,kernelRows:f,table:m,shift:b}=e,h=Math.max(n,o),d=Math.min(r,o+i);if(d<h||d-h>i)return null;let p=d-h,x=Math.max(t,s),y=We(a-32768+We((x-s)*u)),g=We(y+l+65535)>>16,M=We(y-l+65535)>>16;if(g<M)return null;let E=Mb(We(We(M<<16)-y),c),P=0,R=[],T=[];for(let I=0;I<f;I++){let S=M+I;if(S>g){T.push(0),R.push(null);continue}let v=m(We(E)>>b);T.push(v-P),P=v,E=We(E+c),R.push(S>=0&&S<e.request.height?yb(e,S):e.request.wrap===4||e.request.wrap===void 0?vg(e):yb(e,S));}let w=e.request.kernel==="cubic",A=new Uint8Array(p*4);for(let I=0;I<p;I++){let S=(h-o+I)*4,v=0,C=0,U=0,L=0;for(let _=0;_<f;_++){let H=R[_];if(!H)continue;let G=T[_];v+=H[S]*G,C+=H[S+1]*G,U+=H[S+2]*G,L+=H[S+3]*G;}let k=I*4,F=Math.max(0,Math.min(255,L+32768>>16));A[k+3]=F;for(let[_,H]of [[0,v],[1,C],[2,U]]){let G=H+32768>>16;A[k+_]=w?Math.max(0,Math.min(F,G)):Math.min(255,G);}}return {x:h,pixels:A}}var Cg={0:"bilinear",1:"bilinear",2:"hq-bicubic",3:"bilinear",4:"bicubic",5:"nearest",6:"hq-bilinear",7:"hq-bicubic"},Dg=new Set([2,4]),il=16*1024*1024;function Db(e){return Cg[e]??"bilinear"}function Rt(e){return Dg.has(e)}function Lb(e){let t=e[0]*e[3]-e[1]*e[2];if(!Number.isFinite(t)||Math.abs(t)<1e-12)return null;let n=e[3]/t,r=-e[1]/t,o=-e[2]/t,i=e[0]/t;return [n,r,o,i,-(n*e[4]+o*e[5]),-(r*e[4]+i*e[5])]}var zr=1e-6,qr=1e-9,Lg=1+2**-21,wb=5e-4,Lt=16;function Ug(e){let t=e.toDevice,n=(l,c)=>[Math.round((t[0]*l+t[2]*c+t[4])*Lt)/Lt,Math.round((t[1]*l+t[3]*c+t[5])*Lt)/Lt],[r,o]=n(e.srcX,e.srcY),[i,s,a,u]=t;return [i,s,a,u,r-i*e.srcX-a*e.srcY,o-s*e.srcX-u*e.srcY]}function Fg(e){let t=e.toDevice,n=(d,p)=>[t[0]*d+t[2]*p+t[4],t[1]*d+t[3]*p+t[5]],[r,o]=n(e.srcX,e.srcY),i=Math.round(r*Lt)/Lt,s=Math.round(o*Lt)/Lt,[a,u]=n(e.srcX+e.srcW,e.srcY),[l,c]=n(e.srcX,e.srcY+e.srcH),f=(a-i)/e.srcW,m=(u-s)/e.srcW,b=(l-i)/e.srcH,h=(c-s)/e.srcH;return [f,m,b,h,i-f*e.srcX-b*e.srcY,s-m*e.srcX-h*e.srcY]}function kg(e,t){let n=Math.abs(e);return n<1?((t+2)*n-(t+3))*n*n+1:n<2?t*(((n-5)*n+8)*n-4):0}function _g(e){let t=Math.min(1,Math.abs(e));return Math.sign(e)*(t-t*t/2)}function Bg(e,t){let n=Math.min(2,Math.abs(e)),r;if(n<1)r=(t+2)*n**4/4-(t+3)*n**3/3+n;else {let o=(t+2)/4-(t+3)/3+1,i=s=>t*(s**4/4-5*s**3/3+4*s*s-4*s);r=o+i(n)-i(1);}return Math.sign(e)*r}function ol(e){return Math.ceil(e*(1-15e-8))}function Ib(e,t){let n=ol(e)-t;return n>=-1&&n<=1}function Sb(e,t,n){let r=e-Math.round(e);if(r>-1/64+1e-9)return r<=1/64+1e-9;if(Math.abs(r+1/64)>1e-9||!Ns(n.srcW)||!Ns(n.srcH))return false;let o=(t-Math.round(t))*128;return n.srcW*n.srcH*Math.max(n.srcW,n.srcH)<=256||Math.abs(o-Math.round(o))<1e-9}var Gg=-0.5,Og=-1;function Os(e,t,n){switch(e){case "bilinear":return {radius:1,weight:(r,o)=>Math.max(0,1-Math.abs(r-o))};case "bicubic":return {radius:2,weight:(r,o)=>kg(r-o,Gg)};case "hq-bilinear":case "hq-bicubic":{if(n)return {radius:.5,weight:(a,u)=>Math.floor(u+.5)===a?1:0};let r=Math.min(1,Math.abs(t)),o=e==="hq-bicubic",i=o?2:1,s=o?a=>Bg(a,Og):_g;return {radius:i/r+.5,weight:(a,u)=>s(r*(a+.5-u))-s(r*(a-.5-u))}}default:return {radius:.5,weight:(r,o)=>Math.floor(o+.5)===r?1:0}}}function Ng(e,t,n,r,o,i,s,a,u={wrap:void 0,clamp:null},l=false,c=false,f=false){let[m,b,h,d]=a?[r,o,i,s]:[i,s,r,o],[p,x,y,g]=a?[n.x0,n.x1,n.y0,n.y1]:[n.y0,n.y1,n.x0,n.x1],M=0,E=0,P=0,R=0;for(let T=0;T<b.length;T++){let w=b[T],A=m+T;if(w===0)continue;let I=Qo(A,p,x,a?u.mirrorX:u.mirrorY,u);if(I===Jr)continue;let S=0,v=0,C=0,U=0;for(let k=0;k<d.length;k++){let F=d[k],_=h+k;if(F===0)continue;let H=Qo(_,y,g,a?u.mirrorY:u.mirrorX,u);if(H===Jr)continue;let G,W=0;H===lr||I===lr?G=u.clamp??[0,0,0,0]:(G=e,W=(a?H*t+I:I*t+H)*4);let N=G[W+3],Z=F*N/255,J=!!u.literal&&G===u.clamp;S+=c||J?F*G[W]:l||f?F*Math.round(N*G[W]/255):Z*G[W],v+=c||J?F*G[W+1]:l||f?F*Math.round(N*G[W+1]/255):Z*G[W+1],C+=c||J?F*G[W+2]:l||f?F*Math.round(N*G[W+2]/255):Z*G[W+2],U+=F*N;}l&&(S=Math.trunc(S),v=Math.trunc(v),C=Math.trunc(C),U=Math.trunc(U)),U=Math.min(255,Math.max(0,U));let L=u.literal&&f?1/0:U;M+=w*Math.min(L,Math.max(0,S)),E+=w*Math.min(L,Math.max(0,v)),P+=w*Math.min(L,Math.max(0,C)),R+=w*U;}return [M,E,P,R]}var Jr=-1,lr=-2;function Ub(e,t){let n=t>>>24;return e==="clamp"&&n>0&&n<255}function Qo(e,t,n,r,o){if(e>=t&&e<n)return e;if(!o.wrap)return Jr;if(o.wrap==="clamp")return lr;let i=n-t;if(!r)return t+((e-t)%i+i)%i;let s=((e-t)%(2*i)+2*i)%(2*i);return t+(s<i?s:2*i-1-s)}function Wg(e){let t=e-Math.floor(e);return t===0?e:Math.floor(e)+1-t}function cn(e,t,n,r,o,i={}){let{plainRotated:s=false,keepOrigin:a=false,premultSource:u=false,premultOut:l=false,rasterQuad:c,rasterHalf:f=false,chainPad:m=0}=typeof i=="boolean"?{plainRotated:i}:i;if(r.rightHalo&&r.rightHalo.length===n*4){let be=new Uint8ClampedArray((t+1)*n*4);for(let Pe=0;Pe<n;Pe++)be.set(e.subarray(Pe*t*4,(Pe+1)*t*4),Pe*(t+1)*4),be.set(r.rightHalo.subarray(Pe*4,Pe*4+4),(Pe*(t+1)+t)*4);return cn(be,t+1,n,{...r,rightHalo:void 0},o)}if(r.wrap==="clamp"&&!((r.clampArgb??0)>>>24)&&(r.kernel==="hq-bicubic"||r.kernel==="hq-bilinear"))return cn(e,t,n,{...r,wrap:void 0,clampArgb:void 0},o,i);if(r.kernel==="nearest"&&!r.wrap)return Kg(e,t,n,r,o);let b=!a&&(r.kernel==="bilinear"||r.kernel==="bicubic")&&(r.toDevice[1]!==0||r.toDevice[2]!==0),h=a||b?r.toDevice:Ug(r),d=r.kernel,p=d==="hq-bilinear"||d==="hq-bicubic";p&&(h[1]!==0||h[2]!==0)&&Math.abs(h[1])<=wb*Math.abs(h[0])&&Math.abs(h[2])<=wb*Math.abs(h[3])&&(h=[h[0],0,0,h[3],h[4],h[5]]);let x=h[1]===0&&h[2]===0;p&&!x&&!a&&(h=Fg(r));let g=d==="bicubic"&&x&&!r.halfPixelOffset&&h[0]===1&&h[3]===1&&Sb(h[4],h[5],r)&&Sb(h[5],h[4],r),E=0,P=0;if(p&&!x){let be=Math.hypot(h[0],h[1])*r.srcW,Pe=Math.hypot(h[2],h[3])*r.srcH,he=Ib(be,r.srcW)||Ib(Pe,r.srcH);return Jg(e,t,n,r,o,h,d,he)}let R=d==="bicubic";if(p&&x&&!u){let be=Vg(e,t,n,r,o,h,l);if(be!==void 0)return be}if(p&&x){let be=h[0]*r.srcX+h[4];h=[h[0],0,0,h[3],h[4]+Wg(be)-be,h[5]];}let T=Lb(h);if(!T)return null;let w=Math.max(0,Math.floor(r.srcX)),A=Math.max(0,Math.floor(r.srcY)),I=Math.min(t,Math.ceil(r.srcX+r.srcW)),S=Math.min(n,Math.ceil(r.srcY+r.srcH));if(I<=w||S<=A)return null;let v=1/0,C=1/0,U=-1/0,L=-1/0;for(let[be,Pe]of [[r.srcX,r.srcY],[r.srcX+r.srcW,r.srcY],[r.srcX,r.srcY+r.srcH],[r.srcX+r.srcW,r.srcY+r.srcH]]){let he=h[0]*be+h[2]*Pe+h[4],pe=h[1]*be+h[3]*Pe+h[5];v=Math.min(v,he),C=Math.min(C,pe),U=Math.max(U,he),L=Math.max(L,pe);}let k=Math.max(0,Math.floor(v)-1),F=Math.max(0,Math.floor(C)-1),_=Math.min(o.w,Math.ceil(U)+1),H=Math.min(o.h,Math.ceil(L)+1),G=_-k,W=H-F;if(!(G>0&&W>0)||G*W>il)return null;let N=c?ot([c],false,false,f,{x:k,y:F,w:G,h:W}):b?ot([[[r.srcX,r.srcY],[r.srcX+r.srcW,r.srcY],[r.srcX+r.srcW,r.srcY+r.srcH],[r.srcX,r.srcY+r.srcH]].flatMap(([be,Pe])=>[Ge(h[0]*be+h[2]*Pe+h[4]),Ge(h[1]*be+h[3]*Pe+h[5])])],false,false,!!r.halfPixelOffset,{x:k,y:F,w:G,h:W}):null,Z=Math.hypot(h[0],h[1]),J=Math.hypot(h[2],h[3]),K=be=>Math.abs(be-Math.round(be))<1e-9,ie=x&&Math.abs(Z-1)<1e-9&&K(h[4]),ce=x&&Math.abs(J-1)<1e-9&&K(h[5]),$=ie&&ce,X=Os(d,Z,$),B=Os(d,J,$),O=new Uint8ClampedArray(G*W*4),j=r.halfPixelOffset?.5:0,q=r.srcX+r.srcW,ae=r.srcY+r.srcH,se=[],de=[];Math.hypot(T[0],T[2]);Math.hypot(T[1],T[3]);let le=r.clampArgb??0,xe={wrap:r.wrap,clamp:[le>>>16&255,le>>>8&255,le&255,le>>>24&255],literal:Ub(r.wrap,le),mirrorX:r.wrap==="tile-flip-x"||r.wrap==="tile-flip-xy",mirrorY:r.wrap==="tile-flip-y"||r.wrap==="tile-flip-xy"},Je=Math.round(T[0]*it),At=Math.round(T[1]*it),et=!s&&(d==="bilinear"||d==="bicubic"&&!x)?Jo(h):null,gt=null;if((et||s)&&r.pointsForm&&r.worldPoints&&r.worldMatrix&&(d==="bilinear"||d==="bicubic")&&!r.halfPixelOffset&&!r.chainHalf&&!r.wrap){let be=Ju(r.worldPoints,r.chainSrc??[r.srcX,r.srcY,r.srcW,r.srcH],r.worldMatrix);gt=be&&Ku(be);}else if(s&&r.chainHalf&&r.pointsForm&&r.worldPoints&&r.worldMatrix&&r.chainSrc&&(d==="bilinear"||d==="bicubic")){let be=r.worldMatrix,Pe=Ju(r.worldPoints,r.chainSrc,[be[0],be[1],be[2],be[3],D(be[4]-.5),D(be[5]-.5)]);gt=Pe&&Ku(Pe);}let Fn=new Float64Array(G),kn=new Float64Array(G),mt=new Int32Array(G),Cr=new Int32Array(G),zt=0,Ka=(be,Pe)=>{let he=be+zr,pe=Pe+qr,Oe=T[0]*he+T[2]*pe+T[4],ve=T[1]*he+T[3]*pe+T[5];return !(Oe<r.srcX||ve<r.srcY||Oe>=q||ve>=ae)};et&&!gt&&r.pointsForm&&d==="bilinear"&&x&&(et[0]=Math.fround(1/Math.fround(h[0])));for(let be=0;be<W;be++){let Pe=F+be+j,he=-1,pe=0,Oe=0,ve=0,tt=0,Ft=0;for(let Re=0;Re<G;Re++){let ft=k+Re+j,Se=T[0]*(ft-E)+T[2]*(Pe-P)+T[4],Te=T[1]*(ft-E)+T[3]*(Pe-P)+T[5],It=ft+zr,St=Pe+qr,bt=T[0]*It+T[2]*St+T[4],nt=T[1]*It+T[3]*St+T[5];if(N?!N[be*G+Re]:bt<r.srcX||nt<r.srcY||bt>=q||nt>=ae)continue;if(gt){if(he<0){he=Re,zt=Re;let Ke=Re+1;for(;Ke<G&&(N?N[be*G+Ke]!==0:Ka(k+Ke+j,Pe));)Ke++;R?pb(gt,k+Re,F+be,Ke-Re,mt,Cr):db(gt,k+Re,F+be,Ke-Re,Fn,kn);}R?(Se=(mt[Re-zt]+m*it)/it,Te=(Cr[Re-zt]+m*it)/it):(Se=Fn[Re-zt]+m,Te=kn[Re-zt]+m);}else if(et){if(he<0){he=Re,Ft=Re;let Ke=Math.fround(r.toDevice[0]*r.srcX+r.toDevice[2]*r.srcY+r.toDevice[4]),Jt=Math.fround(r.toDevice[1]*r.srcX+r.toDevice[3]*r.srcY+r.toDevice[5]),_n=D(ft-Ke),xn=D(Pe-Jt);ve=D(D(D(et[0]*_n)+D(et[2]*xn))+Math.fround(r.srcX)),tt=D(D(D(et[1]*_n)+D(et[3]*xn))+Math.fround(r.srcY));}for(;Ft<Re;Ft++)ve=D(ve+et[0]),tt=D(tt+et[1]);Se=ve,Te=tt,r.pointsForm&&d==="bilinear"&&x&&(Te=r.srcY+(tt-r.srcY)*Lg);}R&&(gt||et?(Se=Math.floor(Se*64)/64,Te=Math.floor(Te*64)/64):(he<0&&(he=Re,pe=Math.round(Se*it),Oe=Math.round(Te*it)),Se=Math.floor((pe+(Re-he)*Je)/(it/64))/64,Te=Math.floor((Oe+(Re-he)*At)/(it/64))/64),g&&(Se=Math.round(Se),Te=Math.round(Te)));let kt={x0:0,y0:0,x1:t,y1:n},Fe=(Ke,Jt)=>{let _n=Math.ceil(Ke-X.radius),xn=Math.floor(Ke+X.radius),Gm=Math.ceil(Jt-B.radius),Z1=Math.floor(Jt+B.radius);se.length=0,de.length=0;for(let yn=_n;yn<=xn;yn++)se.push(R?Math.round(X.weight(yn,Ke)*65536)/65536:X.weight(yn,Ke));for(let yn=Gm;yn<=Z1;yn++)de.push(R?Math.round(B.weight(yn,Jt)*65536)/65536:B.weight(yn,Jt));return Ng(e,t,kt,_n,se,Gm,de,d==="bicubic",xe,R,u,d==="bilinear")};d==="bilinear"&&(Se=Math.floor(Se)+Math.round((Se-Math.floor(Se))*2048)/2048,Te=Math.floor(Te)+Math.round((Te-Math.floor(Te))*2048)/2048);let[Mt,Et,_t,vt]=Fe(Se,Te);if(vt<=0)continue;if(R){if(Mt=Math.trunc(Mt),Et=Math.trunc(Et),_t=Math.trunc(_t),vt=Math.trunc(vt),vt<=0)continue}else if((u||d==="bilinear")&&(Mt=Math.round(Mt),Et=Math.round(Et),_t=Math.round(_t),vt=Math.round(vt),vt<=0))continue;let ln=Math.min(255,vt),qt=(be*G+Re)*4;O[qt]=Math.min(Math.max(0,Mt),ln)*255/ln,O[qt+1]=Math.min(Math.max(0,Et),ln)*255/ln,O[qt+2]=Math.min(Math.max(0,_t),ln)*255/ln,O[qt+3]=ln;}}return {x:k,y:F,w:G,h:W,rgba:O}}var ur=128;function Ns(e){return Number.isInteger(e)&&e>0&&(e&e-1)===0}function Fb(e){return !e.pointsForm||Ns(e.srcW)&&Ns(e.srcH)}function Hg(e,t,n){return Fb(e)?t===1?-(n?2:1)*65536+(e.kernel==="hq-bicubic"?1:0):0:t<=1?1:0}function vb(e){return e<1?kb(65536/e):Math.round(65536/e)}var $g=.027;function kb(e){return Math.floor(e+.5+$g)}function Cb(e){return e>512?0:e>256?2:e>64?1:0}var Xg=.9375-1e-9;function jg(e){return e<=-128?-32768:e>=128?32768:e<0?-(512*-e-2*e*e):512*e-2*e*e}function Yg(e,t,n,r,o,i,s){let a=[],u=e?2*Math.round(Math.fround(t)*32768):Math.round(4294967296/n),l=(e?2:1)*(n/65536)+1;for(let c=i;c<=s;c++){let f=r(c),m=o+f/65536,b=Math.ceil(m-l),h=Math.floor(m+l),d=[],p=Number.NaN;for(let x=b;x<=h+1;x++){let y=((x-.5-o)*65536-f)*u/33554432,g=Math.floor(y),M=e?Bs(g):jg(g);x>b&&d.push((M-p)/65536),p=M;}a.push({first:b,weights:d});}return a}function Vg(e,t,n,r,o,i,s){let a=r.kernel,u=i[0]<0,l=Math.abs(i[0]),c=i[3];if(!(l>0&&c>0)||r.rightHalo)return;let f=he=>Math.abs(he-Math.round(he))<1e-9;if(l===1&&c===1&&!u&&f(i[4])&&f(i[5]))return;let m=u&&l===1,b=r.halfPixelOffset?.5:0,h=i[0]*r.srcX+i[4]-b,d=h+i[0]*r.srcW,p=r.toDevice[0]*(r.srcX+r.srcW)+r.toDevice[4]-b,x=u?p:D(D(Math.fround(r.toDevice[0])*r.srcX)+D(r.toDevice[4]))-b,y=u?Math.round(p*Lt)/Lt:Math.min(h,d),g=i[3]*r.srcY+i[5]-b,M=u?y+l*r.srcW:Math.max(h,d),E=g+i[3]*r.srcH,P=u?.5:Math.ceil(x*Lt-.5)/Lt,R=!u&&Number.isInteger(P)&&x-P>1e-5,T=!u&&Number.isInteger(P)&&P-x>1e-5,w=Math.ceil(R?x-zr:y-zr),A=Math.ceil(R?x+l*r.srcW-zr:M-zr)-1,I=D(D(Math.fround(r.toDevice[3])*r.srcY)+D(r.toDevice[5]))-b,S=Math.ceil(I*Lt-.5)/Lt,v=Number.isInteger(S)&&I-S>1e-5,C=Math.ceil(v?I-qr:g-qr),U=Math.ceil(v?I+i[3]*r.srcH-qr:E-qr)-1,L=Math.max(0,w),k=Math.max(0,C),F=Math.min(o.w-1,A),_=Math.min(o.h-1,U);if(F<L||_<k)return null;let H=F-L+1,G=_-k+1;if(H*G>il)return null;let W=zg(e,t,n,r,L,k,H,G,s);if(W)return W;let N=a==="hq-bicubic",Z=N?.5:1,J=vb(l),K=vb(c),ie=r.nominalScale;if(ie&&!u&&Math.abs(ie[0]/l-1)<1e-5&&Math.abs(ie[1]/c-1)<1e-5){let he=Math.fround,pe=he(1/he(ie[0]*ie[1])),Oe=(ve,tt)=>tt<1?kb(ve):Math.round(ve);J=Oe(65536*he(ie[1]*pe),l),K=Oe(65536*he(ie[0]*pe),c);}let ce=w-x,$=ce<1e-5?0:ce,X=Math.max(0,C-I);if(u&&(r.halfPixelOffset||!f(r.srcX)||!f(r.srcW)))return;let B=A-w+1+$,O=x-Math.floor(x),j=u?0:R?Math.round((1+O)*J):T?Math.round((O-1)*J):$>1e-9?Math.round((1-$)*J):0,q=X>1e-9?Math.round(X*K):0,ae=r.srcY+r.srcH,se;if(c===1&&!N&&!u&&!r.wrap&&!r.halfPixelOffset&&ae+1<n&&f(r.srcY)&&f(r.srcH)&&r.worldMatrix&&r.worldRect){let he=[r.srcX,r.srcY,r.srcW,r.srcH],pe=Qu(he,r.worldRect,r.worldMatrix),Oe=pe&&Zu(pe,he);if(Oe&&Oe[3]>=r.srcH){se=ae;let ve=nl(r.srcY,r.srcH,Oe[1],Oe[3]);ve&&ve.yStep===K&&(q=ve.yStart-r.srcY*65536+(C-ve.firstRow)*K);}}let de=x-Math.floor(x),me=u||de>=Xg?0:-Cb(x),ee=Cb(I),le=Os(a,l,false),xe=Os(a,c,false),Je=(he,pe,Oe,ve,tt,Ft,Re,ft,Se=false)=>{let Te=[],It=((pe&pe-1)===0?0:Math.round(r.srcW/170))+(Se?Hg(r,Re,$>1e-9):0),St=Fe=>Se?Math.round((B-Fe)*pe)+It:Fe*pe+Oe;if(Se&&m&&$<=1e-9&&Fb(r)){for(let Fe=tt;Fe<=Ft;Fe++)Te.push({first:Math.round(ve+St(Fe)/65536),weights:[1]});return Te}let bt=ve*ur,nt=Math.abs(bt-Math.round(bt))<1e-6;if(Re<1&&nt)return Yg(N,Re,pe,Fe=>St(Fe)+ft,ve,tt,Ft);let kt=N&&nt;for(let Fe=tt;Fe<=Ft;Fe++){let Mt=Math.floor((St(Fe)-1)/(65536/ur));if(kt){let qt=Math.round(bt)+Mt,Ke=el((qt%ur+ur)%ur);Te.push({first:Math.floor(qt/ur)+Ke.first,weights:Ke.weights.map(Jt=>Jt/65536)});continue}let Et=ve+(Mt+Z)/ur,_t=Math.ceil(Et-he.radius),vt=Math.floor(Et+he.radius),ln=[];for(let qt=_t;qt<=vt;qt++)ln.push(he.weight(qt,Et));Te.push({first:_t,weights:ln});}return Te},At=Je(le,J,j,r.srcX,L-w,F-w,l,me,u),et=Je(xe,K,q,r.srcY,k-C,_-C,c,ee),gt=1/0,Fn=-1/0;for(let he of et)gt=Math.min(gt,he.first),Fn=Math.max(Fn,he.first+he.weights.length-1);let kn=r.clampArgb??0,mt=r.wrap?{wrap:r.wrap,clamp:[kn>>>16&255,kn>>>8&255,kn&255,kn>>>24&255],literal:Ub(r.wrap,kn),mirrorX:r.wrap==="tile-flip-x"||r.wrap==="tile-flip-xy",mirrorY:r.wrap==="tile-flip-y"||r.wrap==="tile-flip-xy"}:null;mt||(gt=Math.max(0,gt),Fn=Math.min(n-1,Fn));let Cr=Math.max(0,Fn-gt+1),zt=Math.abs(c-1)<1e-9?1/0:Math.ceil((N?2:1)/Math.min(1,c)),Ka=se??ae+zt-1,be=new Uint8Array(Cr*H*4);for(let he=0;he<Cr;he++){let pe=gt+he;if(mt&&(Number.isFinite(zt)&&(pe=Qo(pe,Math.max(0,r.srcY-zt),Math.min(n,r.srcY+r.srcH+zt),mt.mirrorY,mt)),pe!==Jr&&pe!==lr&&(pe=Qo(pe,0,n,mt.mirrorY,mt))),pe===Jr||pe!==lr&&(pe<r.srcY-zt||pe>Ka))continue;let Oe=pe*t;for(let ve=0;ve<H;ve++){let tt=At[ve],Ft=0,Re=0,ft=0,Se=0;for(let bt=0;bt<tt.weights.length;bt++){let nt=tt.first+bt,kt=e,Fe=0;if(mt){if(nt=Qo(nt,0,t,mt.mirrorX,mt),nt===Jr)continue}else if(nt<0||nt>=t)continue;nt===lr||pe===lr?kt=mt?.clamp??[0,0,0,0]:Fe=(Oe+nt)*4;let Mt=kt[Fe+3];if(Mt===0)continue;let Et=tt.weights[bt],_t=!!mt?.literal&&kt===mt.clamp;Ft+=Et*(_t?kt[Fe]:Math.round(kt[Fe]*Mt/255)),Re+=Et*(_t?kt[Fe+1]:Math.round(kt[Fe+1]*Mt/255)),ft+=Et*(_t?kt[Fe+2]:Math.round(kt[Fe+2]*Mt/255)),Se+=Et*Mt;}let Te=Math.min(255,Math.max(0,Math.round(Se))),It=(he*H+ve)*4,St=mt?.literal?255:Te;be[It]=Math.min(St,Math.max(0,Math.round(Ft))),be[It+1]=Math.min(St,Math.max(0,Math.round(Re))),be[It+2]=Math.min(St,Math.max(0,Math.round(ft))),be[It+3]=Te;}}let Pe=new Uint8ClampedArray(H*G*4);for(let he=0;he<G;he++){let pe=et[he];for(let Oe=0;Oe<H;Oe++){let ve=0,tt=0,Ft=0,Re=0;for(let It=0;It<pe.weights.length;It++){let St=pe.first+It-gt;if(St<0||St>=Cr)continue;let bt=(St*H+Oe)*4,nt=pe.weights[It];ve+=nt*be[bt],tt+=nt*be[bt+1],Ft+=nt*be[bt+2],Re+=nt*be[bt+3];}let ft=Math.min(255,Math.max(0,Math.round(Re)));if(ft===0)continue;let Se=(he*H+Oe)*4,Te=s?1:255/ft;Pe[Se]=Math.min(ft,Math.max(0,Math.round(ve)))*Te,Pe[Se+1]=Math.min(ft,Math.max(0,Math.round(tt)))*Te,Pe[Se+2]=Math.min(ft,Math.max(0,Math.round(Ft)))*Te,Pe[Se+3]=ft;}}return {x:L,y:k,w:H,h:G,rgba:Pe,premultiplied:s}}function zg(e,t,n,r,o,i,s,a,u){let l=r.worldMatrix;if(r.halfPixelOffset||!l||r.wrap||r.srcX!==0||r.srcY!==0||r.srcW!==t||r.srcH!==n)return;let c=[r.srcX,r.srcY,r.srcW,r.srcH],f=r.worldRect?null:r.worldPoints?Ko(r.worldPoints,c):null,m=r.worldRect?Qu(c,r.worldRect,l):f?_s(f,l):null;if(!m||!(m[0]>0&&m[3]>0))return;let b=Zu(m,c),h=new Uint8Array(t*n*4);for(let x=0;x<t*n*4;x+=4){let y=e[x+3];h[x]=Math.round(e[x]*y/255),h[x+1]=Math.round(e[x+1]*y/255),h[x+2]=Math.round(e[x+2]*y/255),h[x+3]=y;}let d=Pb({kernel:r.kernel==="hq-bicubic"?"cubic":"tent",pixels:h,width:t,height:n,src:c,dest:b});if(!d)return;let p=new Uint8ClampedArray(s*a*4);for(let x=0;x<a;x++){let y=Tb(d,i+x,o,o+s);if(y)for(let g=0;g<y.pixels.length/4;g++){let M=y.pixels.subarray(g*4,g*4+4),E=M[3];if(E===0)continue;let P=(x*s+y.x-o+g)*4,R=u?1:255/E;p[P]=M[0]*R,p[P+1]=M[1]*R,p[P+2]=M[2]*R,p[P+3]=E;}}return {x:o,y:i,w:s,h:a,rgba:p,premultiplied:u}}function qg(e,t){let n=Zo(t,e),r=(o,i)=>Math.ceil(vo(re(Q(i,i),Q(o,o))));return [r(re(n[2],-n[0]),re(n[3],-n[1])),r(re(n[4],-n[0]),re(n[5],-n[1]))]}function Jg(e,t,n,r,o,i,s,a){let u=!!(r.pointsForm&&r.worldPoints&&r.worldMatrix&&!r.wrap),l=u?qg(r.worldPoints,r.worldMatrix):null,c=l?Math.abs(l[0]-r.srcW)<=1.0000001||Math.abs(l[1]-r.srcH)<=1.0000001:a,f=r.wrap?0:2,m,b,h,d,p,x,y,g,M,E=r.halfPixelOffset,P=0,R=0;if(c){b=t+2*f,h=n+2*f,m=new Uint8ClampedArray(b*h*4);for(let I=0;I<n;I++)for(let S=0;S<t;S++){let v=(I*t+S)*4,C=e[v+3],U=((I+f)*b+S+f)*4;m[U]=Math.round(e[v]*C/255),m[U+1]=Math.round(e[v+1]*C/255),m[U+2]=Math.round(e[v+2]*C/255),m[U+3]=C;}[d,p,x,y]=i,g=i[4]-(E?.5:0),M=i[5]-(E?.5:0);}else {let I=l?l[0]:ol(Math.hypot(i[0],i[1])*r.srcW),S=l?l[1]:ol(Math.hypot(i[2],i[3])*r.srcH);P=I,R=S;let v=I/r.srcW,C=S/r.srcH,U=cn(e,t,n,{srcX:r.srcX,srcY:r.srcY,srcW:r.srcW,srcH:r.srcH,toDevice:[v,0,0,C,-r.srcX*v,-r.srcY*C],kernel:s,halfPixelOffset:false,wrap:r.wrap,clampArgb:r.clampArgb},{w:I,h:S},{premultOut:true});if(!U)return null;if(!U.premultiplied)for(let F=0;F<U.rgba.length;F+=4){let _=U.rgba[F+3];U.rgba[F]=Math.round(U.rgba[F]*_/255),U.rgba[F+1]=Math.round(U.rgba[F+1]*_/255),U.rgba[F+2]=Math.round(U.rgba[F+2]*_/255);}b=I+2*f,h=S+2*f,m=new Uint8ClampedArray(b*h*4);for(let F=0;F<U.h;F++)for(let _=0;_<U.w;_++){let H=_+U.x,G=F+U.y;H<I&&G<S&&m.set(U.rgba.subarray((F*U.w+_)*4,(F*U.w+_)*4+4),((G+f)*b+H+f)*4);}d=i[0]/v,p=i[1]/v,x=i[2]/C,y=i[3]/C;let L=i[0]*r.srcX+i[2]*r.srcY+i[4],k=i[1]*r.srcX+i[3]*r.srcY+i[5];g=E?L-.5+.5*(d+x):L,M=E?k-.5+.5*(p+y):k;}let T=[[r.srcX,r.srcY],[r.srcX+r.srcW,r.srcY],[r.srcX+r.srcW,r.srcY+r.srcH],[r.srcX,r.srcY+r.srcH]].flatMap(([I,S])=>[Ge(i[0]*I+i[2]*S+i[4]),Ge(i[1]*I+i[3]*S+i[5])]),w=cn(m,b,h,{srcX:0,srcY:0,srcW:b,srcH:h,toDevice:[d,p,x,y,g-d*f-x*f,M-p*f-y*f],kernel:s==="hq-bicubic"?"bicubic":"bilinear",halfPixelOffset:false,wrap:r.wrap,clampArgb:r.clampArgb,...u?{pointsForm:true,worldPoints:r.worldPoints,worldMatrix:r.worldMatrix,chainSrc:c?[r.srcX,r.srcY,r.srcW,r.srcH]:[E?-0.5:0,E?-0.5:0,P,R],...E?{chainHalf:true}:{}}:{}},o,{plainRotated:true,keepOrigin:true,premultSource:true,...u?{rasterQuad:T,rasterHalf:E,chainPad:f}:{}});if(!w)return w;let A=ot([T],false,false,E,{x:w.x,y:w.y,w:w.w,h:w.h});for(let I=0;I<w.w*w.h;I++)A[I]||w.rgba.fill(0,I*4,I*4+4);return w}var it=65536;function Kg(e,t,n,r,o){let i=r.toDevice,s=Lb(i);if(!s)return null;let{srcX:a,srcY:u,srcW:l,srcH:c}=r,f=[[a,u],[a+l,u],[a+l,u+c],[a,u+c]].map(([C,U])=>[i[0]*C+i[2]*U+i[4],i[1]*C+i[3]*U+i[5]]),m=1/0,b=1/0,h=-1/0,d=-1/0;for(let[C,U]of f)m=Math.min(m,C),b=Math.min(b,U),h=Math.max(h,C),d=Math.max(d,U);if(![m,b,h,d].every(Number.isFinite))return null;let p=Math.max(0,Math.floor(m)-1),x=Math.max(0,Math.floor(b)-1),y=Math.min(o.w,Math.ceil(h)+2),g=Math.min(o.h,Math.ceil(d)+2),M=y-p,E=g-x;if(!(M>0&&E>0)||M*E>il)return null;let P={x:p,y:x,w:M,h:E},R=ot([f.flatMap(([C,U])=>[Ge(C),Ge(U)])],false,false,r.halfPixelOffset,P),T=Math.max(0,Math.floor(u)),w=Math.min(n,Math.ceil(u+c)),A=r.halfPixelOffset?.5:0,I=Math.round(s[0]*it),S=Math.round(s[1]*it),v=new Uint8ClampedArray(M*E*4);for(let C=0;C<E;C++){let U=x+C+A,L=-1,k=0,F=0;for(let _=0;_<M;_++){if(!R[C*M+_])continue;if(L<0){let J=p+_+A;L=_,k=Math.round((s[0]*J+s[2]*U+s[4])*it),F=Math.round((s[1]*J+s[3]*U+s[5])*it);}let H=_-L,G=Math.floor((k+H*I+it/2)/it),W=Math.floor((F+H*S+it/2)/it);if(G<0||G>=t||W<T||W>=w)continue;let N=(W*t+G)*4,Z=(C*M+_)*4;v[Z]=e[N],v[Z+1]=e[N+1],v[Z+2]=e[N+2],v[Z+3]=e[N+3];}}return {x:p,y:x,w:M,h:E,rgba:v}}var Ws=1<<24;function Bb(e,t,n,r){return {cmds:[{op:"rect",x:e,y:t,w:n,h:r}],fillRule:"nonzero",simple:true}}function mn(e){return {cmds:e.map(t=>({op:"rect",x:t.x,y:t.y,w:t.w,h:t.h})),fillRule:"nonzero",simple:true}}function Ot(){return {cmds:[{op:"rect",x:0,y:0,w:0,h:0}],fillRule:"nonzero",simple:true}}function Zg(e,t,n){return {...e,cmds:e.cmds.map(r=>{switch(r.op){case "rect":return {...r,x:r.x+t,y:r.y+n};case "moveTo":case "lineTo":return {...r,x:r.x+t,y:r.y+n};case "bezierCurveTo":return {...r,cp1x:r.cp1x+t,cp1y:r.cp1y+n,cp2x:r.cp2x+t,cp2y:r.cp2y+n,x:r.x+t,y:r.y+n};case "arcTo":return {...r,x1:r.x1+t,y1:r.y1+n,x2:r.x2+t,y2:r.y2+n};case "ellipse":return {...r,cx:r.cx+t,cy:r.cy+n};case "closePath":return r}})}}function mr(e,t,n){return e?e.map(r=>Zg(r,t,n)):null}function sl(e){return e.simple&&e.fillRule==="nonzero"}function cr(e){return e.fillRule==="evenodd"||sl(e)}function _b(e){let t=0;for(let n of Hr(e.cmds)){let r=0,o=n.length/2;for(let s=0;s<o;s++){let a=(s+1)%o;r+=n[2*s]*n[2*a+1]-n[2*a]*n[2*s+1];}let i=Math.abs(r)<1e-9?0:Math.sign(r);if(i!==0){if(t!==0&&i!==t)return NaN;t=i;}}return t}function Qg(e,t){if(!sl(e)||!sl(t))return false;let n=_b(e),r=_b(t);return !Number.isNaN(n)&&!Number.isNaN(r)&&(n===0||r===0||n===r)}function ei(e){return {cmds:[{op:"rect",x:-Ws,y:-Ws,w:2*Ws,h:2*Ws},...e.cmds],fillRule:"evenodd",simple:false}}var e2={x:1<<23,y:1<<23,w:1,h:1};function Tn(e,t,n,r){let o=r??Qf(e,t),i=tr(e,t,n,o),s=!n0(o);return !r&&tr(e,t,n,e2).length>0&&(s=false),{region:[i.length>0?mn(i):Ot()],exact:s}}function al(e,t,n,r){switch(n){case "replace":return {region:[t],exact:true};case "intersect":return {region:e?[...e,t]:[t],exact:true};case "exclude":{if(cr(t)){let o=ei(t);return {region:e?[...e,o]:[o],exact:true}}return Tn(e,[t],n,r)}case "union":return e?e.length===1&&Qg(e[0],t)?{region:[{cmds:[...e[0].cmds,...t.cmds],fillRule:"nonzero",simple:false}],exact:true}:Tn(e,[t],n,r):{region:null,exact:true};case "xor":return e?e.length===1&&cr(e[0])&&cr(t)?{region:[{cmds:[...e[0].cmds,...t.cmds],fillRule:"evenodd",simple:false}],exact:true}:Tn(e,[t],n,r):cr(t)?{region:[ei(t)],exact:true}:Tn(e,[t],n,r);case "complement":return e?e.length===1&&cr(e[0])?{region:[t,ei(e[0])],exact:true}:Tn(e,[t],n,r):{region:[Ot()],exact:true}}}function ul(e,t,n,r){if(n==="replace")return {region:t,exact:true};if(t&&t.length===1)return al(e,t[0],n,r);if(!t)switch(n){case "intersect":return {region:e,exact:true};case "union":return {region:null,exact:true};case "exclude":return {region:[Ot()],exact:true};case "xor":case "complement":return e?e.length===1&&cr(e[0])?{region:[ei(e[0])],exact:true}:Tn(e,t,n,r):{region:[Ot()],exact:true}}switch(n){case "intersect":return {region:e?[...e,...t]:t,exact:true};case "union":return e?Tn(e,t,n,r):{region:null,exact:true};case "complement":return e?e.length===1&&cr(e[0])?{region:[...t,ei(e[0])],exact:true}:Tn(e,t,n,r):{region:[Ot()],exact:true};case "xor":case "exclude":return Tn(e,t,n,r)}}function ti(e,t){for(let n of t)switch(n.op){case "rect":e.rect(n.x,n.y,n.w,n.h);break;case "moveTo":e.moveTo(n.x,n.y);break;case "lineTo":e.lineTo(n.x,n.y);break;case "bezierCurveTo":e.bezierCurveTo(n.cp1x,n.cp1y,n.cp2x,n.cp2y,n.x,n.y);break;case "arcTo":e.arcTo(n.x1,n.y1,n.x2,n.y2,n.radius);break;case "ellipse":e.ellipse(n.cx,n.cy,n.rx,n.ry,n.rotation,n.startAngle,n.endAngle,n.ccw);break;case "closePath":e.closePath();break}}function t2(e,t){for(let n of t){e.beginPath(),ti(e,n.cmds);try{e.clip(n.fillRule);}catch{}}}function Yt(e,t,n=false){let{ctx:r}=e;for(;e.clipSaveDepth>0;)r.restore(),e.clipSaveDepth--;t&&(r.save(),e.clipSaveDepth=1,n&&r.setTransform(1,0,0,1,0,0),t2(r,t));}var n2=[[255,0,0,0,0,0,0,0],[128,128,128,128,128,128,128,128],[128,64,32,16,8,4,2,1],[1,2,4,8,16,32,64,128],[255,128,128,128,128,128,128,128],[129,66,36,24,24,36,66,129],[128,0,0,0,8,0,0,0],[128,0,8,0,128,0,8,0],[136,0,34,0,136,0,34,0],[136,34,136,34,136,34,136,34],[170,68,170,17,170,68,170,17],[170,85,170,81,170,85,170,21],[170,85,170,85,170,85,170,85],[238,85,187,85,238,85,187,85],[119,221,119,221,119,221,119,221],[119,255,221,255,119,255,221,255],[239,255,254,255,239,255,254,255],[255,255,255,247,255,255,255,127],[136,68,34,17,136,68,34,17],[17,34,68,136,17,34,68,136],[204,102,51,153,204,102,51,153],[51,102,204,153,51,102,204,153],[193,224,112,56,28,14,7,131],[131,7,14,28,56,112,224,193],[136,136,136,136,136,136,136,136],[255,0,0,0,255,0,0,0],[85,85,85,85,85,85,85,85],[255,0,255,0,255,0,255,0],[204,204,204,204,204,204,204,204],[255,255,0,0,255,255,0,0],[0,0,136,68,34,17,0,0],[0,0,17,34,68,136,0,0],[240,0,0,0,15,0,0,0],[128,128,128,128,8,8,8,8],[128,8,64,2,16,1,32,4],[177,48,3,27,216,192,12,141],[129,66,36,24,129,66,36,24],[0,24,37,192,0,24,37,192],[1,2,4,8,24,36,66,129],[255,128,128,128,255,8,8,8],[136,84,34,69,136,20,34,81],[170,85,170,85,240,240,240,240],[0,16,8,16,0,128,1,128],[170,0,128,0,128,0,128,0],[128,0,34,0,8,0,34,0],[3,132,72,48,12,2,1,1],[255,102,255,153,255,102,255,153],[119,137,143,143,119,152,248,248],[255,136,136,136,255,136,136,136],[153,102,102,153,153,102,102,153],[240,240,240,240,15,15,15,15],[130,68,40,16,40,68,130,1],[16,56,124,254,124,56,16,0]],Gb=234,Ob=64;function r2(e,t,n){let r=()=>{let i=((t-n)%8+8)%8;return i===0?Gb:i===1||i===7?Ob:0},o=()=>{let i=((t+n-7)%8+8)%8;return i===0?Gb:i===1||i===7?Ob:0};switch(e){case 2:return r();case 3:return o();case 5:return Math.max(r(),o());default:{let i=n2[e];return i&&i[n]&128>>t?256:0}}}function o2(e,t,n){if(n>=256)return e>>>0;if(n<=0)return t>>>0;let r=e>>>24&255,o=t>>>24&255,i=r*n+o*(256-n)>>8;if(i===0)return 0;let s=i<<24;for(let a of [16,8,0]){let u=Math.round((e>>>a&255)*r/255),l=Math.round((t>>>a&255)*o/255),c=u*n+l*(256-n)>>8;s|=Math.min(255,Math.round(c*255/i))<<a;}return s>>>0}function Nb(e){let t=new Uint8ClampedArray(256);for(let n=0;n<8;n++)for(let r=0;r<8;r++){let o=o2(e.fore,e.back,r2(e.style,r,n)),i=(n*8+r)*4;t[i]=o>>>16&255,t[i+1]=o>>>8&255,t[i+2]=o&255,t[i+3]=o>>>24&255;}return t}function Wb(e,t,n){let r=Nb(e),o=n;return (i,s,a,u,l)=>{for(let c=0;c<u;c++)for(let f=0;f<a;f++){let m=i+f+.5,b=s+c+.5,h=Math.floor(o[0]*m+o[2]*b+o[4]),d=Math.floor(o[1]*m+o[3]*b+o[5]),p=((h-t.x)%8+8)%8+((d-t.y)%8+8)%8*8,x=(c*a+f)*4;l[x]=r[p*4],l[x+1]=r[p*4+1],l[x+2]=r[p*4+2],l[x+3]=r[p*4+3];}}}function Hb(e,t,n,r,o){if(typeof e.createPattern!="function")return null;let i=chunk7JVB7NLG_js.Y(8,8);if(!i)return null;chunk7JVB7NLG_js.la(i.ctx,chunk7JVB7NLG_js.na(Nb(t),8,8),0,0);let s=chunk7JVB7NLG_js.ma(e,i.canvas,"repeat");if(!s||typeof s.setTransform!="function")return s;let a=r[0]*r[3]-r[1]*r[2];if(!Number.isFinite(a)||Math.abs(a)<1e-12)return s;let u=[r[3]/a,-r[1]/a,-r[2]/a,r[0]/a,(r[2]*r[5]-r[3]*r[4])/a,(r[1]*r[4]-r[0]*r[5])/a],l=o,c=[l[0],l[1],l[2],l[3],l[0]*n.x+l[2]*n.y+l[4],l[1]*n.x+l[3]*n.y+l[5]],f=[u[0]*c[0]+u[2]*c[1],u[1]*c[0]+u[3]*c[1],u[0]*c[2]+u[2]*c[3],u[1]*c[2]+u[3]*c[3],u[0]*c[4]+u[2]*c[5]+u[4],u[1]*c[4]+u[3]*c[5]+u[5]];try{s.setTransform({a:f[0],b:f[1],c:f[2],d:f[3],e:f[4],f:f[5]});}catch{}return s}function L2(e,t,n){let r=D,o=r(Math.fround(t)*Math.fround(.0174532924)),i=r(Math.sin(o)),s=r(Math.cos(o));return n?[r(r(e[0]*s)-r(e[1]*i)),r(r(e[0]*i)+r(e[1]*s)),r(r(e[2]*s)-r(e[3]*i)),r(r(e[2]*i)+r(e[3]*s)),r(r(e[4]*s)-r(e[5]*i)),r(r(e[4]*i)+r(e[5]*s))]:[r(r(e[0]*s)+r(e[2]*i)),r(r(e[3]*i)+r(e[1]*s)),r(r(e[2]*s)-r(e[0]*i)),r(r(e[3]*s)-r(e[1]*i)),e[4],e[5]]}function wn(e,t){return [e[0]*t[0]+e[1]*t[2],e[0]*t[1]+e[1]*t[3],e[2]*t[0]+e[3]*t[2],e[2]*t[1]+e[3]*t[3],e[4]*t[0]+e[5]*t[2]+t[4],e[4]*t[1]+e[5]*t[3]+t[5]]}function Nt(e,t,n){if(t&32768)return chunk7JVB7NLG_js.b(n);let r=e.objectTable.get(n&255);return r&&r.kind==="plus-brush"?cl(e,r):"rgba(0,0,0,1)"}function cl(e,t){if(t.gradient){let n=Lf(e.ctx,t.gradient,_e(e));if(n)return n}if(t.texture){let n=bb(e.ctx,t.texture,_e(e));if(n)return n}if(t.hatch){let n=Hb(e.ctx,t.hatch,e.ext?.renderingOrigin??{x:0,y:0},_e(e),Ys(e));if(n)return n}return t.color}var ll=0,Xs=1,U2=6,br=96;function hr(e,t,n=br,r=true){let o;switch(e){case Xs:o=r?1:n/100;break;case 3:o=n/72;break;case 4:o=n;break;case 5:o=n/300;break;case 6:o=n/25.4;break;default:o=1;break}return o*t}function F2(e){let t=e.videoDisplay??true;return [hr(e.pageUnit,e.pageScale,e.dpiX??br,t),hr(e.pageUnit,e.pageScale,e.dpiY??br,t)]}function _e(e){let t=js(e),n=e.dpiScale,r=[t[0]*n,t[1]*n,t[2]*n,t[3]*n,t[4]*n,t[5]*n],o=e.baseTransform;return o?[o[0]*r[0]+o[2]*r[1],o[1]*r[0]+o[3]*r[1],o[0]*r[2]+o[2]*r[3],o[1]*r[2]+o[3]*r[3],o[0]*r[4]+o[2]*r[5]+o[4],o[1]*r[4]+o[3]*r[5]+o[5]]:r}function An(e){return e.ext||(e.ext={}),e.ext}function js(e){let t=e.ext;if(t?.tsDevice)return t.tsDevice;let n=e.worldTransform,[r,o]=F2(e),i=[n[0]*r,n[1]*o,n[2]*r,n[3]*o,n[4]*r,n[5]*o];return t?.containerTransform?wn(i,t.containerTransform):i}function Ys(e){let t=e.dpiScale,n=[t,0,0,t,0,0];return e.baseTransform?wn(n,e.baseTransform):n}function pt(e,t=true){let n=_e(e),r=t?ml(e):0;e.ctx.setTransform(n[0],n[1],n[2],n[3],n[4]+r,n[5]+r);}function ml(e){return chunk7JVB7NLG_js.pa(e.ctx)?0:e.antiAlias&&!Rt(e.pixelOffsetMode??0)?.5:0}function Vb(e,t){let n=An(e);e.saveStack.push({transform:[...e.worldTransform],snapshot:{clipRegion:e.clipRegion??null,antiAlias:e.antiAlias,interpolationMode:e.interpolationMode,pixelOffsetMode:e.pixelOffsetMode,textRenderingHint:e.textRenderingHint,pageUnit:e.pageUnit,pageScale:e.pageScale,ext:{...n,multiFormatSkip:void 0,pendingEffect:void 0}}}),e.saveIdMap.set(t,e.saveStack.length-1);}function $b(e,t){let n=e.saveIdMap.get(t);if(n!==void 0&&n<e.saveStack.length){let r=e.saveStack[n];e.worldTransform=[...r.transform];let o=r.snapshot;if(o){e.clipRegion=o.clipRegion,e.antiAlias=o.antiAlias,e.interpolationMode=o.interpolationMode,e.pixelOffsetMode=o.pixelOffsetMode,e.textRenderingHint=o.textRenderingHint,e.pageUnit=o.pageUnit,e.pageScale=o.pageScale;let s=An(e),{multiFormatSkip:a,pendingEffect:u}=s;for(let l of Object.keys(s))delete s[l];Object.assign(s,o.ext,{multiFormatSkip:a,pendingEffect:u});}e.saveStack.length=n;let i=new Map;for(let[s,a]of e.saveIdMap)a<n&&i.set(s,a);e.saveIdMap=i,o&&Kr(e);}}function Xb(e,t,n){let r=js(e),o=$s(e.ext?.containerClip,e.clipRegion);Vb(e,t);let i=An(e);i.containerTransform=n?wn(n,r):r,i.tsDevice=null,i.containerClip=o,i.compositingMode=void 0,i.compositingQuality=void 0,i.textContrast=void 0,e.clipRegion=null,e.worldTransform=[1,0,0,1,0,0],e.pageUnit=Xs,e.pageScale=1,e.antiAlias=false,e.interpolationMode=void 0,e.pixelOffsetMode=void 0,e.textRenderingHint=void 0,Kr(e);}function k2(e,t,n,r=br,o=br,i=true){let s=n===ll?r/100:hr(n,1,r,i),a=n===ll?o/100:hr(n,1,o,i),u=t.w*s,l=t.h*a;if(!(Math.abs(u)>0&&Math.abs(l)>0)||![e.x,e.y,e.w,e.h,u,l].every(Number.isFinite))return null;let c=e.w/u,f=e.h/l;return [c,0,0,f,e.x-t.x*s*c,e.y-t.y*a*f]}function $s(e,t){let n=[...e??[],...t??[]];return e||t?n:null}function Hs(e){return _e(e)}function zb(e,t,n,r,o){let i=(u,l)=>o[0]*u+o[2]*l+o[4],s=(u,l)=>o[1]*u+o[3]*l+o[5];return {cmds:[{op:"moveTo",x:i(e,t),y:s(e,t)},{op:"lineTo",x:i(e+n,t),y:s(e+n,t)},{op:"lineTo",x:i(e+n,t+r),y:s(e+n,t+r)},{op:"lineTo",x:i(e,t+r),y:s(e,t+r)},{op:"closePath"}],fillRule:"nonzero",simple:true}}function _2(e,t){return Ru(e.path,t)}var B2={0:"intersect",1:"intersect",2:"union",3:"xor",4:"exclude",5:"complement"},jb=64;function ni(e,t,n=0,r){if(n>jb)return chunk7JVB7NLG_js.q(`flattenRegionNode: depth limit (${jb}) exceeded`),{region:[Ot()],exact:false};switch(e.type){case "rect":return {region:[zb(e.x,e.y,e.width,e.height,t)],exact:true};case "path":return {region:[_2(e,t)],exact:true};case "infinite":return {region:null,exact:true};case "empty":return {region:[Ot()],exact:true};case "combine":{let o=ni(e.left,t,n+1,r),i=ni(e.right,t,n+1,r),s=B2[e.combineMode]??"intersect",a=ul(o.region,i.region,s,r);return {region:a.region,exact:a.exact&&o.exact&&i.exact}}}}var G2={0:"replace",1:"intersect",2:"union",3:"xor",4:"exclude",5:"complement"};function fl(e){if(!(e.canvasW===void 0||e.canvasH===void 0))return {x:0,y:0,w:e.canvasW,h:e.canvasH}}function qb(e){let t=e.ext;return $s($s(t?.containerClip,e.clipRegion??void 0)??void 0,t?.tsClip??void 0)}function Kr(e){Yt(e,qb(e),true);}function Jb(e,t){let n=fl(e);if(e.gdiAntialias===true||!t||!n||chunk7JVB7NLG_js.pa(e.ctx))return t;let r=Rt(e.pixelOffsetMode??0),o=M0(t.map(a=>({build:u=>ti(u,a.cmds),evenOdd:a.fillRule==="evenodd"})),n,r);if(o)return [mn(o)];let i=(r?0:.5)-1/32,s=mr(t,i,i);return [mn(tr(s,null,"intersect",n))]}function Kb(e,t,n,r){let o=Jb(e,t),i=G2[n];i||chunk7JVB7NLG_js.q(`${r}: unknown CombineMode ${n}, falling back to Intersect`);let s=ul(e.clipRegion??null,o,i??"intersect",fl(e));s.exact||chunk7JVB7NLG_js.q(`${r}: CombineMode ${n} approximated (no canvas domain for an unbounded result)`),e.clipRegion=s.region,Kr(e);}function Yb(e,t,n,r){Kb(e,[t],n,r);}function fr(e){e.ext?.tsDevice&&(e.ext.tsDevice=null);}function O2(e,t,n){let{view:r}=e;if(n<40||r.getUint32(t,true)&1&&n<296)return;let i=r.getUint8(t+4);e.antiAlias=i===2||i===4||i===5,e.textRenderingHint=r.getUint8(t+5);let s=An(e);s.compositingMode=r.getUint8(t+6),s.compositingQuality=r.getUint8(t+7),s.renderingOrigin={x:r.getInt16(t+8,true),y:r.getInt16(t+10,true)},s.textContrast=r.getUint16(t+12,true),e.interpolationMode=r.getUint8(t+14);let a=[0,4,8,12,16,20].map(u=>r.getFloat32(t+16+u,true));a.every(Number.isFinite)&&(s.tsDevice=a);}function N2(e,t,n,r){let o=r&32767,i=t+n,s=[];if(!(r&32768)){if(t+o*16>i)return null;for(let c=0;c<o;c++){let f=t+c*16;s.push({l:e.getInt32(f,true),t:e.getInt32(f+4,true),r:e.getInt32(f+8,true),b:e.getInt32(f+12,true)});}return s}let a=t,u=()=>{if(a>=i)return null;let c=e.getUint8(a);if(c&128){a+=1;let m=c&127;return m&64?m-128:m}if(a+2>i)return null;let f=c<<8|e.getUint8(a+1);return a+=2,f&16384?f-32768:f},l={l:0,r:0,b:0};for(let c=0;c<o;c++){let f=u(),m=u(),b=u(),h=u();if(f===null||m===null||b===null||h===null)return null;let d=l.b+m,p={l:l.l+f,t:d,r:l.r+b,b:d+h};s.push(p),l=p;}return s}function W2(e,t,n,r){let o=N2(e.view,n,r,t);if(!o)return;let i=Ys(e),s=(f,m)=>i[0]*f+i[2]*m+i[4],a=(f,m)=>i[1]*f+i[3]*m+i[5],u=[];for(let f of o)f.r<=f.l||f.b<=f.t||u.push({op:"moveTo",x:s(f.l,f.t),y:a(f.l,f.t)},{op:"lineTo",x:s(f.r,f.t),y:a(f.r,f.t)},{op:"lineTo",x:s(f.r,f.b),y:a(f.r,f.b)},{op:"lineTo",x:s(f.l,f.b),y:a(f.l,f.b)},{op:"closePath"});let l=u.length>0?{cmds:u,fillRule:"nonzero",simple:o.length===1}:Ot(),c=An(e);c.tsClip=$s(qb(e)??void 0,Jb(e,[l])??void 0),Kr(e);}function Zb(e,t,n,r,o){let{view:i}=e;switch(t){case 16426:return fr(e),o>=24&&(e.worldTransform=[i.getFloat32(r,true),i.getFloat32(r+4,true),i.getFloat32(r+8,true),i.getFloat32(r+12,true),i.getFloat32(r+16,true),i.getFloat32(r+20,true)]),true;case 16427:return fr(e),e.worldTransform=[1,0,0,1,0,0],true;case 16428:{if(fr(e),o>=24){let s=[i.getFloat32(r,true),i.getFloat32(r+4,true),i.getFloat32(r+8,true),i.getFloat32(r+12,true),i.getFloat32(r+16,true),i.getFloat32(r+20,true)];n&8192?e.worldTransform=wn(e.worldTransform,s):e.worldTransform=wn(s,e.worldTransform);}return true}case 16429:{if(fr(e),o>=8){let s=i.getFloat32(r,true),a=i.getFloat32(r+4,true),u=[1,0,0,1,s,a];n&8192?e.worldTransform=wn(e.worldTransform,u):e.worldTransform=wn(u,e.worldTransform);}return true}case 16430:{if(fr(e),o>=8){let s=i.getFloat32(r,true),a=i.getFloat32(r+4,true),u=[s,0,0,a,0,0];n&8192?e.worldTransform=wn(e.worldTransform,u):e.worldTransform=wn(u,e.worldTransform);}return true}case 16431:return fr(e),o>=4&&(e.worldTransform=L2(e.worldTransform,i.getFloat32(r,true),(n&8192)!==0)),true;case 16421:return o>=4&&Vb(e,i.getUint32(r,true)),true;case 16422:return o>=4&&$b(e,i.getUint32(r,true)),true;case 16434:{if(o>=16){let s=n>>8&15,a=i.getFloat32(r,true),u=i.getFloat32(r+4,true),l=i.getFloat32(r+8,true),c=i.getFloat32(r+12,true),f=zb(a,u,l,c,Hs(e));Yb(e,f,s,"SetClipRect");}return true}case 16433:return e.clipRegion=null,Kr(e),chunk7JVB7NLG_js.p("ResetClip: clip region cleared"),true;case 16436:{let s=n&255,a=n>>8&15,u=e.objectTable.get(s);if(u&&u.kind==="plus-region"&&u.nodes.length>0){let l=ni(u.nodes[0],Hs(e),0,fl(e));l.exact||chunk7JVB7NLG_js.q("SetClipRegion: region tree approximated (no canvas domain for an unbounded result)"),Kb(e,l.region,a,"SetClipRegion");}return true}case 16435:{let s=n&255,a=n>>8&15,u=e.objectTable.get(s);if(u&&u.kind==="plus-path"){let l=Ru(u,Hs(e));Yb(e,l,a,"SetClipPath");}return true}case 16437:{if(o>=8){let s=i.getFloat32(r,true),a=i.getFloat32(r+4,true);if(e.clipRegion){let u=Hs(e),l=u[0]*s+u[2]*a,c=u[1]*s+u[3]*a;e.clipRegion=mr(e.clipRegion,l,c),Kr(e),chunk7JVB7NLG_js.p(`OffsetClip: clip translated by world (${s},${a}) \u2192 device (${l},${c})`);}else chunk7JVB7NLG_js.p(`OffsetClip: dx=${s}, dy=${a}, no active clip, nothing to offset`);}return true}case 16424:return o>=4&&Xb(e,i.getUint32(r,true),null),true;case 16423:{if(o>=36){let s=u=>i.getFloat32(r+u,true),a=k2({x:s(0),y:s(4),w:s(8),h:s(12)},{x:s(16),y:s(20),w:s(24),h:s(28)},n&255,e.dpiX,e.dpiY,e.videoDisplay);Xb(e,i.getUint32(r+32,true),a??[1,0,0,1,0,0]);}return true}case 16425:return o>=4&&$b(e,i.getUint32(r,true)),true;case 16432:{fr(e);let s=n&255,a=o>=4?i.getFloat32(r,true):1;return s===ll||s>U2||!(a>0)||!Number.isFinite(a)?(chunk7JVB7NLG_js.p(`SetPageTransform: ignored unit=${s}, scale=${a}`),true):(e.pageUnit=s,e.pageScale=a,chunk7JVB7NLG_js.p(`SetPageTransform: unit=${{0:"World",1:"Display",2:"Pixel",3:"Point",4:"Inch",5:"Document",6:"Millimeter"}[s]??s}, scale=${a}`),true)}case 16417:return e.interpolationMode=n&255,true;case 16418:return e.pixelOffsetMode=n&255,true;case 16415:return e.textRenderingHint=n&255,true;case 16414:return e.antiAlias=(n&1)!==0,true;case 16420:return An(e).compositingQuality=n&255,true;case 16419:return An(e).compositingMode=n&255,true;case 16413:return o>=8&&(An(e).renderingOrigin={x:i.getInt32(r,true),y:i.getInt32(r+4,true)}),true;case 16416:return An(e).textContrast=n&4095,true;case 16441:return O2(e,r,o),true;case 16442:return W2(e,n,r,o),true;default:return false}}function th(e){let t=e.canvas,n=t?.width,r=t?.height;return typeof n=="number"&&typeof r=="number"&&n>0&&r>0?{w:n,h:r}:null}function Qb(e,t,n){let r=chunk7JVB7NLG_js.Y(t,n);return r?(chunk7JVB7NLG_js.la(r.ctx,chunk7JVB7NLG_js.na(e,t,n),0,0),r):null}function bl(e,t,n){let r=th(e);if(n.resample&&r){let i=cn(t.rgba,t.width,t.height,n.resample,r);if(i){let s=Qb(i.rgba,i.w,i.h);if(!s)return false;e.save();try{e.setTransform(1,0,0,1,0,0),e.imageSmoothingEnabled=!1,chunk7JVB7NLG_js.ja(e,s.canvas,i.x,i.y,i.w,i.h);}finally{e.restore();}return true}}let o=Qb(t.rgba,t.width,t.height);if(!o)return false;e.save();try{e.setTransform(...n.transform),chunk7JVB7NLG_js.ja(e,o.canvas,n.dx,n.dy,n.dw,n.dh);}finally{e.restore();}return true}function H2(e,t){if(!e.data)return null;let n=new Uint8Array(e.data.slice(0)),r=Br(n);return r?{kind:"encoded",bytes:n,mime:r}:t?{kind:"rgba",data:t.rgba,width:t.width,height:t.height}:So(n.buffer)}function eh(e,t,n,r,o=false){let i=o&&n?{kind:"rgba",data:n.rgba,width:n.width,height:n.height}:H2(t,n);if(!i)return false;let s=e.reserveSlot(),a=e.imageResampling==="exact"&&n&&r.resample?cn(n.rgba,n.width,n.height,r.resample,{w:e.canvas.width,h:e.canvas.height}):null,u=r.resample?Qi(i):null;if(a){let l={kind:"rgba",data:a.rgba,width:a.w,height:a.h};e.fillSlot(s,l,[1,0,0,1,0,0],a.x,a.y,a.w,a.h);}else if(r.resample&&u){let l=r.resample;e.fillSlotCropped(s,i,l.toDevice,u,l.srcX,l.srcY,l.srcW,l.srcH);}else e.fillSlot(s,i,r.transform,r.dx,r.dy,r.dw,r.dh);return e.shadow&&n&&bl(e.shadow,n,r),true}var hl=2,dl=null;function nh(e){dl=e;}function $2(e,t,n,r,o){let[i,s,a,u,l,c]=e,f=Math.hypot(i,s)*r,m=Math.hypot(a,u)*o;if(!(r>1&&o>1&&f>1&&m>1))return e;let b=(f-1)/f*(r/(r-1)),h=(m-1)/m*(o/(o-1)),d=i*b,p=s*b,x=a*h,y=u*h;return [d,p,x,y,l+(i-d)*t+(a-x)*n,c+(s-p)*t+(u-y)*n]}function X2(e,t,n,r){let o=e.nestingDepth??0;if(!dl||!r||!t.data||r.unit!==hl||o>=Xu)return false;let{srcX:i,srcY:s,srcW:a,srcH:u}=r;if(!(a>0&&u>0)||![i,s,a,u].every(Number.isFinite))return false;let l=th(e.ctx);if(!l)return false;let c=$2(je(_e(e),r.toWorld(i,s,a,u)),i,s,a,u),f=t.data.slice(0),m=n&&n.kind==="metafile"?n.caches:void 0,{ctx:b}=e;b.save();let h=null;try{b.setTransform(c[0],c[1],c[2],c[3],c[4],c[5]),b.beginPath(),b.rect(i,s,a,u),b.clip(),h=dl(f,b,l.w,l.h,c,{textureCache:m?.textures,imageCache:m?.images,fontFamilyMap:e.fontFamilyMap,gdiAntialias:e.gdiAntialias,codePages:e.codePages,nestingDepth:o+1});}finally{b.restore();}return h?(e.deferredImages.push(...h),true):false}function Vs(e,t,n,r,o){if(o&&o.unit!==hl)return null;let i=t;if(!i&&e.data){let d=So(e.data.slice(0));d&&d.kind==="rgba"&&(i={rgba:d.data,width:d.width,height:d.height});}if(!i)return null;let s=o&&o.unit===hl&&o.srcW>0&&o.srcH>0&&[o.srcX,o.srcY,o.srcW,o.srcH].every(Number.isFinite)?o:null,a=Yf(jf(i.rgba),i.width,i.height,n,s&&{x:s.srcX,y:s.srcY,w:s.srcW,h:s.srcH});if(!a)return null;let u={kind:"bitmap",width:a.width,height:a.height,rgba:a.rgba};if(!s)return {bitmap:u,draw:r};let l=s.srcX-a.x,c=s.srcY-a.y,f=s.srcW,m=s.srcH,b=[1,0,0,1,a.x,a.y],h=je(s.toWorld(s.srcX,s.srcY,s.srcW,s.srcH),b);return {bitmap:u,draw:{...r,transform:je(r.transform,h),dx:0,dy:0,dw:a.width,dh:a.height,resample:r.resample&&{...r.resample,srcX:l,srcY:c,srcW:f,srcH:m,toDevice:je(r.resample.toDevice,b),rightHalo:a.haloRight}}}}function rh(e,t,n,r,o=null){let i=t.cacheKey!==void 0?e.imageCache?.get(t.cacheKey):void 0;if(t.type===2)return X2(e,t,i,r);let s=i&&i.kind==="bitmap"?i:null,a=o?Vs(t,s,o,n,r):null;return a?chunk7JVB7NLG_js.pa(e.ctx)?eh(e.ctx,t,a.bitmap,a.draw,true):bl(e.ctx,a.bitmap,a.draw):o&&!s?false:chunk7JVB7NLG_js.pa(e.ctx)?eh(e.ctx,t,s,n):s?bl(e.ctx,s,n):false}function dr(e){if(chunk7JVB7NLG_js.p("parseEmfHeader: byteLength =",e.byteLength),e.byteLength<88)return chunk7JVB7NLG_js.q("parseEmfHeader: buffer too small (<88 bytes)"),null;let t=e.getUint32(0,true);if(t!==1)return chunk7JVB7NLG_js.q("parseEmfHeader: first record type is",t,"(expected 1 = EMR_HEADER)"),null;let n=e.getInt32(8,true),r=e.getInt32(12,true),o=e.getInt32(16,true),i=e.getInt32(20,true),s=e.getInt32(24,true),a=e.getInt32(28,true),u=e.getInt32(32,true),l=e.getInt32(36,true),c=u-s,f=l-a;return chunk7JVB7NLG_js.p(`parseEmfHeader: bounds=(${n},${r})\u2192(${o},${i}) [${o-n+1}\xD7${i-r+1}]`),chunk7JVB7NLG_js.p(`parseEmfHeader: frame=(${s},${a})\u2192(${u},${l}) [${c}\xD7${f}]`),{bounds:{left:n,top:r,right:o,bottom:i},frameW:c,frameH:f}}function zs(e){let t=e.bounds.right-e.bounds.left+1,n=e.bounds.bottom-e.bounds.top+1;return t>0&&n>0?(chunk7JVB7NLG_js.p(`getRenderableEmfBounds: using bounds ${t}\xD7${n}`),{...e.bounds,right:e.bounds.right+1,bottom:e.bounds.bottom+1}):e.frameW>0&&e.frameH>0?(chunk7JVB7NLG_js.p(`getRenderableEmfBounds: bounds invalid (${t}\xD7${n}), falling back to frame ${e.frameW}\xD7${e.frameH}`),{left:0,top:0,right:e.frameW,bottom:e.frameH}):(chunk7JVB7NLG_js.q("getRenderableEmfBounds: no valid bounds or frame, returning null"),null)}function oi(e){if(e.byteLength<22)return null;let t=e.getUint32(0,true),n=0,r=0,o=0,i=800,s=600,a=96;if(t===2596720087){r=e.getInt16(6,true),o=e.getInt16(8,true),i=e.getInt16(10,true),s=e.getInt16(12,true),a=e.getUint16(14,true)||96,n=22;let f=m=>[1,2].includes(e.getUint16(m,true))&&e.getUint16(m+2,true)===9;e.byteLength>=42&&!f(22)&&e.getUint16(22,true)===0&&f(24)&&(n=24);}if(n+18>e.byteLength)return null;let u=e.getUint16(n,true);if(u!==1&&u!==2)return null;let l=e.getUint16(n+2,true)*2,c=e.getUint32(n+8,true)*2;return {headerSize:n+l,maxRecordSize:c,boundsLeft:r,boundsTop:o,boundsRight:i,boundsBottom:s,unitsPerInch:a,placeable:n>0}}var K2=[0,8388608,32768,8421376,128,8388736,32896,12632256,12639424,10930928,16776176,10526884,8421504,16711680,65280,16776960,255,16711935,65535,16777215];function jn(e,t){return e.getUint32(t,true)}function ii(e){return e>>>24!==0}function tn(e){return e.palette?.entries??K2}function si(e,t){let n=e>>>24;if(n&16)return 0;if(n&1){let r=e&65535;return t.length===0?0:t[r<t.length?r:0]}return (e&255)<<16|e&65280|e>>>16&255}function xt(e,t){let n=si(t,tn(e));return chunk7JVB7NLG_js.a(n>>16&255,n>>8&255,n&255)}function sh(e,t,n){return xt(e,jn(t,n))}function Zr(e,t,n){let r={...e.colorRefs};n!==void 0&&ii(n)?r[t]=n:delete r[t],e.colorRefs=r;}function ah(e){let t=e.colorRefs;t&&(t.pen!==void 0&&(e.penColor=xt(e,t.pen)),t.brush!==void 0&&(e.brushColor=xt(e,t.brush)),t.text!==void 0&&(e.textColor=xt(e,t.text)),t.bk!==void 0&&(e.bkColor=xt(e,t.bk)));}function oh(e,t,n){let r=[];for(let o=0;o<n&&t+o*4+4<=e.byteLength;o++){let i=t+o*4;r.push(e.getUint8(i)<<16|e.getUint8(i+1)<<8|e.getUint8(i+2));}return r}function pl(e,t){let n=e.objectTable.get(t);return n&&n.kind==="palette"?n:null}function ih(e,t){e.state.palette===t&&ah(e.state);}function uh(e,t,n,r){let{view:o,state:i}=e;switch(t){case 49:{if(r>=16){let s=o.getUint32(n,true),a=o.getUint16(n+6,true);e.objectTable.set(s,{kind:"palette",entries:oh(o,n+8,Math.min(a,(r-16)/4))});}return true}case 48:{if(r>=12){let s=o.getUint32(n,true);if(s===2147483663)i.palette=null;else {let a=pl(e,s);if(!a)return true;i.palette=a;}ah(i);}return true}case 50:{if(r>=20){let s=pl(e,o.getUint32(n,true)),a=o.getUint32(n+4,true),u=o.getUint32(n+8,true);if(s){let l=oh(o,n+12,Math.min(u,(r-20)/4));for(let c=0;c<l.length&&a+c<s.entries.length;c++)s.entries[a+c]=l[c];ih(e,s);}}return true}case 51:{if(r>=16){let s=pl(e,o.getUint32(n,true)),a=Math.min(o.getUint32(n+4,true),1024);if(s){for(s.entries.length=Math.min(s.entries.length,a);s.entries.length<a;)s.entries.push(0);ih(e,s);}}return true}case 52:return true;default:return false}}function He(e,t){let n=e.state.worldTransform,r=n[0]*t+n[4];if(e.useMappingMode){let o=(r-e.windowOrg.x)/(e.windowExt.cx||1)*(e.viewportExt.cx||1)+e.viewportOrg.x;return e.deviceToCanvas?(o-e.bounds.left)*e.sx:o}return (r-e.bounds.left)*e.sx}function $e(e,t){let n=e.state.worldTransform,r=n[3]*t+n[5];if(e.useMappingMode){let o=(r-e.windowOrg.y)/(e.windowExt.cy||1)*(e.viewportExt.cy||1)+e.viewportOrg.y;return e.deviceToCanvas?(o-e.bounds.top)*e.sy:o}return (r-e.bounds.top)*e.sy}function Ze(e,t){let n=e.state.worldTransform[0]*t;return e.useMappingMode?n/(e.windowExt.cx||1)*(e.viewportExt.cx||1)*(e.deviceToCanvas?e.sx:1):n*e.sx}function st(e,t){let n=e.state.worldTransform[3]*t;return e.useMappingMode?n/(e.windowExt.cy||1)*(e.viewportExt.cy||1)*(e.deviceToCanvas?e.sy:1):n*e.sy}function In(e){return !e.useMappingMode||e.deviceToCanvas?e.sx:1}function Sn(e){return !e.useMappingMode||e.deviceToCanvas?e.sy:1}function xl(e,t){return !e.useMappingMode||e.deviceToCanvas?(t-e.bounds.left)*e.sx:t}function yl(e,t){return !e.useMappingMode||e.deviceToCanvas?(t-e.bounds.top)*e.sy:t}function Qr(e){e.useMappingMode=true;}function ze(e){let t=e.state.worldTransform;return t[1]!==0||t[2]!==0}function Ee(e){let t=e.state.worldTransform;if(e.useMappingMode){let o=(e.viewportExt.cx||1)/(e.windowExt.cx||1),i=(e.viewportExt.cy||1)/(e.windowExt.cy||1),[s,a,u,l]=e.deviceToCanvas?[e.sx,e.sy,e.bounds.left,e.bounds.top]:[1,1,0,0];return [t[0]*o*s,t[1]*i*a,t[2]*o*s,t[3]*i*a,((t[4]-e.windowOrg.x)*o+e.viewportOrg.x-u)*s,((t[5]-e.windowOrg.y)*i+e.viewportOrg.y-l)*a]}let n=e.sx||1,r=e.sy||1;return [t[0]*n,t[1]*r,t[2]*n,t[3]*r,(t[4]-e.bounds.left)*n,(t[5]-e.bounds.top)*r]}function Be(e,t,n){let r=Ee(e);return {x:r[0]*t+r[2]*n+r[4],y:r[1]*t+r[3]*n+r[5]}}function qs(e,t,n,r,o){let i=Ee(e),s=Be(e,t,n),a=i[0]*r,u=i[2]*o,l=i[1]*r,c=i[3]*o,f=a*a+u*u,m=a*l+u*c,b=l*l+c*c,h=(f+b)/2,d=Math.sqrt(Math.max(0,((f-b)/2)**2+m*m)),p=Math.max(0,h+d),x=Math.max(0,h-d),y=.5*Math.atan2(2*m,f-b);return {cx:s.x,cy:s.y,rx:Math.sqrt(p),ry:Math.sqrt(x),rotation:y}}function lh(e,t){for(let n of t)switch(n.op){case "moveTo":e.moveTo(n.x,n.y);break;case "lineTo":e.lineTo(n.x,n.y);break;case "rect":e.rect(n.x,n.y,n.w,n.h);break;case "bezierCurveTo":e.bezierCurveTo(n.cp1x,n.cp1y,n.cp2x,n.cp2y,n.x,n.y);break;case "arcTo":e.arcTo(n.x1,n.y1,n.x2,n.y2,n.radius);break;case "ellipse":e.ellipse(n.cx,n.cy,n.rx,n.ry,n.rotation,n.startAngle,n.endAngle,n.ccw);break;case "closePath":e.closePath();break}}function Wt(e){let{ctx:t,pathCmds:n}=e;return new Proxy(t,{get(r,o,i){switch(o){case "moveTo":return (s,a)=>(n.push({op:"moveTo",x:s,y:a}),r.moveTo(s,a));case "lineTo":return (s,a)=>(n.push({op:"lineTo",x:s,y:a}),r.lineTo(s,a));case "rect":return (s,a,u,l)=>(n.push({op:"rect",x:s,y:a,w:u,h:l}),r.rect(s,a,u,l));case "bezierCurveTo":return (s,a,u,l,c,f)=>(n.push({op:"bezierCurveTo",cp1x:s,cp1y:a,cp2x:u,cp2y:l,x:c,y:f}),r.bezierCurveTo(s,a,u,l,c,f));case "arcTo":return (s,a,u,l,c)=>(n.push({op:"arcTo",x1:s,y1:a,x2:u,y2:l,radius:c}),r.arcTo(s,a,u,l,c));case "ellipse":return (s,a,u,l,c,f,m,b)=>(n.push({op:"ellipse",cx:s,cy:a,rx:u,ry:l,rotation:c,startAngle:f,endAngle:m,ccw:!!b}),r.ellipse(s,a,u,l,c,f,m,b));case "closePath":return ()=>(n.push({op:"closePath"}),r.closePath());default:{let s=Reflect.get(r,o,i);return typeof s=="function"?s.bind(r):s}}}})}function gl(e){return e>>>16&255}function fn(e){let t=e&255;return {usesP:(t>>4&15)!==(t&15),usesS:(t>>2&51)!==(t&51),usesD:(t>>1&85)!==(t&85)}}function qe(e,t,n,r,o=16777215){let i=0,s=~t,a=~n,u=~r;for(let l=0;l<8;l++)e&1<<l&&(i|=(l&4?t:s)&(l&2?n:a)&(l&1?r:u));return i&o}function Js(e){let t=gl(e);switch(t){case 204:return {kind:"copy"};case 0:return {kind:"solid",color:"black"};case 255:return {kind:"solid",color:"white"};case 170:return {kind:"noop"};case 85:return {kind:"invert-dest"};default:return {kind:"ternary",index:t,operands:fn(t)}}}function ch(e,t,n,r,o,i){let s=e.data,a=t?t.data:null,u=e.width,l=e.height,c=typeof n=="number"?n:0,f=typeof n=="function"?n:null;for(let m=0;m<l;m++)for(let b=0;b<u;b++){let h=(m*u+b)*4,d=s[h]<<16|s[h+1]<<8|s[h+2],p=a?a[h]<<16|a[h+1]<<8|a[h+2]:0,x=f?f(o+b,i+m):c,y=qe(r,x,p,d);s[h]=y>>16&255,s[h+1]=y>>8&255,s[h+2]=y&255,s[h+3]=255;}}function mh(e,t,n,r,o,i){let s=n<0?e+n:e,a=r<0?t+r:t,u=Math.abs(n),l=Math.abs(r);s=Math.round(s),a=Math.round(a),u=Math.round(u),l=Math.round(l);let c=Math.min(s+u,Math.round(o)),f=Math.min(a+l,Math.round(i));return s=Math.max(s,0),a=Math.max(a,0),u=c-s,l=f-a,u<=0||l<=0?null:{x:s,y:a,w:u,h:l}}var uM={9:160,15:250,7:90,10:165,5:80,14:245,3:10,12:175,8:95,2:5};function Yn(e){return e in uM}function eo(e){if(!Number.isInteger(e)||e<1||e>16)return;let t=e-1;return (t>>2)*80+(t&3)*5}function Ml(e,t,n){return e<<16|t<<8|n}function El(e,t){switch(t){case "invert":return ~e&16777215;case "black":return 0;case "white":return 16777215;default:return e}}function vn(e){let t=e.canvas,n=t?.width,r=t?.height;return typeof n=="number"&&typeof r=="number"&&n>0&&r>0?{w:n,h:r}:null}function Pl(e,t,n){let r=1/0,o=1/0,i=-1/0,s=-1/0,a=0,u=0,l=false,c=(g,M,E=0)=>{r=Math.min(r,g+a-E),o=Math.min(o,M+u-E),i=Math.max(i,g+a+E),s=Math.max(s,M+u+E);},f=()=>{l=true;},m={moveTo:(g,M)=>c(g,M),lineTo:(g,M)=>c(g,M),rect:(g,M,E,P)=>{c(g,M),c(g+E,M+P);},fillRect:(g,M,E,P)=>{c(g,M),c(g+E,M+P);},strokeRect:(g,M,E,P)=>{c(g,M),c(g+E,M+P);},bezierCurveTo:(g,M,E,P,R,T)=>{c(g,M),c(E,P),c(R,T);},quadraticCurveTo:(g,M,E,P)=>{c(g,M),c(E,P);},arcTo:(g,M,E,P)=>{c(g,M),c(E,P);},arc:(g,M,E)=>c(g,M,Math.abs(E)),ellipse:(g,M,E,P)=>c(g,M,Math.max(Math.abs(E),Math.abs(P))),translate:(g,M)=>{a+=g,u+=M;},setTransform:f,transform:f,scale:f,rotate:f},b=()=>{},h=new Proxy(m,{get:(g,M)=>typeof M=="string"&&M in g?g[M]:b,set:()=>true});if(e(h),l)return {x:0,y:0,w:n.w,h:n.h};if(!Number.isFinite(r)||!Number.isFinite(o)||!Number.isFinite(i)||!Number.isFinite(s))return null;let d=Math.max(0,Math.floor(r-t)),p=Math.max(0,Math.floor(o-t)),x=Math.min(n.w,Math.ceil(i+t)),y=Math.min(n.h,Math.ceil(s+t));return x<=d||y<=p?null:{x:d,y:p,w:x-d,h:y-p}}var lM=1024*1024,xr=null;function nn(e,t){let n=xr&&xr.w>=e&&xr.h>=t?xr:null;if(!n){let o=Math.max(e,xr?.w??0),i=Math.max(t,xr?.h??0),s=o*i<=lM,a=s?chunk7JVB7NLG_js.Y(o,i):chunk7JVB7NLG_js.Y(e,t);if(!a)return null;n={canvas:a.canvas,ctx:a.ctx,w:s?o:e,h:s?i:t},s&&(xr=n);}let r=n.ctx;return r.setTransform(1,0,0,1,0,0),r.globalAlpha=1,r.globalCompositeOperation="source-over",r.clearRect(0,0,e,t),n}function rn(e,t,n,r){chunk7JVB7NLG_js.la(n.ctx,r,0,0);let o=e.drawImage;e.save();try{e.setTransform(1,0,0,1,0,0),e.globalAlpha=1,e.globalCompositeOperation="source-over",o.call(e,n.canvas,0,0,t.w,t.h,t.x,t.y,t.w,t.h);}finally{e.restore();}}function Ks(e,t){return chunk7JVB7NLG_js.pa(e)?e.unknownPixels(t.x,t.y,t.w,t.h):null}function Zs(e,t,n,r,o){let i=null,s=null,a=new Map,u=(c,f,m)=>{c[f*4]=m>>16&255,c[f*4+1]=m>>8&255,c[f*4+2]=m&255,c[f*4+3]=255;};for(let c=0;c<t;c++){if(!n[c]||e[c*4+3]===0)continue;let f=r(c,0),m=r(c,16777215);if(f===m)continue;let b=0,h=0,d=true;for(let x=16;x>=0;x-=8){let y=f>>x&255,g=m>>x&255;if(y===g)h|=y<<x;else if(y===0&&g===255)b|=255<<x;else if(y===255&&g===0)b|=255<<x,h|=255<<x;else {d=false;break}}if(d){e[c*4+3]=0,b!==16777215&&(i??(i=new Uint8ClampedArray(t*4)),u(i,c,b)),h!==0&&(s??(s=new Uint8ClampedArray(t*4)),u(s,c,h));continue}let p=o?.(c);if(p){if(e[c*4+3]=0,p.mode==="multiply"){i??(i=new Uint8ClampedArray(t*4)),u(i,c,p.color);continue}if(p.mode==="difference"){s??(s=new Uint8ClampedArray(t*4)),u(s,c,p.color);continue}let x=a.get(p.mode);x||(x=new Uint8ClampedArray(t*4),a.set(p.mode,x)),u(x,c,p.color);}}let l=[];i&&l.push({mode:"multiply",data:i}),s&&l.push({mode:"difference",data:s});for(let[c,f]of a)l.push({mode:c,data:f});return l}function Qs(e,t,n){if(chunk7JVB7NLG_js.pa(e))for(let r of n)e.blendPatch(r.data,t.x,t.y,t.w,t.h,r.mode);}function to(e,t,n,r){try{let o=chunk7JVB7NLG_js.ka(e,t.x,t.y,t.w,t.h),i=o.data,s=nn(t.w,t.h),a=s?chunk7JVB7NLG_js.ka(s.ctx,0,0,t.w,t.h):o,u=a.data;for(let f=0;f<t.h;f++)for(let m=0;m<t.w;m++){let b=(f*t.w+m)*4,h=n(t.x+m,t.y+f,Ml(i[b],i[b+1],i[b+2]));h<0||(u[b]=h>>16&255,u[b+1]=h>>8&255,u[b+2]=h&255,u[b+3]=255);}if(!s)return chunk7JVB7NLG_js.la(e,o,t.x,t.y),!0;let l=Ks(e,t),c=l?Zs(u,t.w*t.h,l,(f,m)=>n(t.x+f%t.w,t.y+Math.floor(f/t.w),m),r&&(f=>r(t.x+f%t.w,t.y+Math.floor(f/t.w)))):[];return rn(e,t,s,a),Qs(e,t,c),!0}catch{return false}}function Rl(e,t,n,r,o=2,i){let s=eo(t);if(s===void 0||!chunk7JVB7NLG_js.qa(e))return false;if(s===170)return true;let a=vn(e);if(!a)return false;try{let u=Pl(r,o,a);if(!u)return !0;let l=nn(u.w,u.h);if(!l)return !1;let c=l.ctx;c.save();try{c.fillStyle=n,c.strokeStyle=n,c.translate(-u.x,-u.y),r(c);}finally{c.restore();}let f=i!==void 0&&typeof c.isPointInPath=="function",m=/^#([0-9a-f]{6})$/i.exec(n.trim()),b=m?parseInt(m[1],16):-1,h=chunk7JVB7NLG_js.ka(c,0,0,u.w,u.h),d=h.data,p=s===240?null:chunk7JVB7NLG_js.ka(e,u.x,u.y,u.w,u.h).data,x=p?Ks(e,u):null,y=x?new Int32Array(u.w*u.h):null;for(let M=0;M<d.length;M+=4){let E=d[M+3],P;if(E===0)P=!1;else if(E===255)P=!0;else if(f){let w=(M>>2)%u.w,A=((M>>2)-w)/u.w;P=c.isPointInPath(w+.5,A+.5,i);}else P=E>=128;if(!P){d[M]=0,d[M+1]=0,d[M+2]=0,d[M+3]=0;continue}let R=b>=0?b:Ml(d[M],d[M+1],d[M+2]);y&&(y[M>>2]=R);let T=R;if(p){let w=Ml(p[M],p[M+1],p[M+2]);T=qe(s,R,w,w);}d[M]=T>>16&255,d[M+1]=T>>8&255,d[M+2]=T&255,d[M+3]=255;}let g=[];if(x&&y){let M=chunk7JVB7NLG_js.Z(t);g=Zs(d,u.w*u.h,x,(E,P)=>qe(s,y[E],P,P),E=>({color:El(y[E],M.colorTransform),mode:M.gco}));}return rn(e,u,l,h),Qs(e,u,g),!0}catch{return false}}var cM=16*1024*1024;function fh(e){if(e.gdiAntialias!==false)return null;if(e.rasterLayer!==void 0)return e.rasterLayer;let t=vn(e.ctx);return !t||chunk7JVB7NLG_js.pa(e.ctx)||t.w*t.h>cM?(e.rasterLayer=null,null):(e.rasterLayer={w:t.w,h:t.h,data:new Uint8ClampedArray(t.w*t.h*4),x0:t.w,y0:t.h,x1:0,y1:0},e.rasterLayer)}function Xe(e){let t=e.rasterLayer;if(!t||t.x1<=t.x0||t.y1<=t.y0)return;let n={x:t.x0,y:t.y0,w:t.x1-t.x0,h:t.y1-t.y0},r=new Uint8ClampedArray(n.w*n.h*4);for(let s=0;s<n.h;s++){let a=((n.y+s)*t.w+n.x)*4;r.set(t.data.subarray(a,a+n.w*4),s*n.w*4),t.data.fill(0,a,a+n.w*4);}t.x0=t.w,t.y0=t.h,t.x1=0,t.y1=0;let o=nn(n.w,n.h);if(o){rn(e.ctx,n,o,chunk7JVB7NLG_js.na(r,n.w,n.h));return}let i=chunk7JVB7NLG_js.ka(e.ctx,n.x,n.y,n.w,n.h);for(let s=0;s<r.length;s+=4)r[s+3]!==0&&(i.data[s]=r[s],i.data[s+1]=r[s+1],i.data[s+2]=r[s+2],i.data[s+3]=255);chunk7JVB7NLG_js.la(e.ctx,i,n.x,n.y);}var mM=new Set([2,3,4,5,6,7,8,27,41,42,43,44,45,46,47,54,55,56,59,60,61,62,63,64,65,66,68,71,72,73,74,85,86,87,88,89,90,91,92,37,38,39,40,82,93,94,95,9,10,11,12,13,17,18,19,20,21,22,24,25,31,32,33,35,36,57,58,16,23,48,49,50,51,52,99,100,101,102,103,104,105,106,109,110,111,112,113,119,120,121,122]);function ea(e){return mM.has(e)}function dh(e,t,n){if(e.kind!=="tile"||!e.skip)return false;let[r,o]=e.toDevice(t,n),{width:i,height:s}=e.tile,a=((r-e.orgX)%i+i)%i,u=((o-e.orgY)%s+s)%s;return e.skip[u*i+a]===1}function bh(e){return `#${(e&16777215).toString(16).padStart(6,"0")}`}function ph(e){for(let t of [0,16777215])if(qe(e,t,0,0)!==qe(e,t,0,16777215))return true;return false}function xh(e,t){e.beginPath();for(let n of Tl(t))e.rect(n.x,n.y,n.w,n.h);}function Tl(e){let t=[],n=e.length,r=e.data,o=new Array(n);for(let s=0;s<n;s++)o[s]=s*3;o.sort((s,a)=>r[s+1]-r[a+1]||r[s+2]-r[a+2]||r[s]-r[a]);let i=0;for(;i<n;){let s=o[i],a=r[s+1],u=r[s+2],l=r[s],c=l+1,f=i+1;for(;f<n;){let m=o[f];if(r[m+1]!==a||r[m+2]!==u||r[m]>c)break;r[m]===c&&c++,f++;}t.push({x:a,y:l,w:u-a,h:c-l}),i=f;}return t}function hh(e,t,n,r="source-over"){e.save();try{e.setTransform(1,0,0,1,0,0),e.globalAlpha=1,e.globalCompositeOperation=r,e.fillStyle=n,xh(e,t),e.fill("nonzero");}finally{e.restore();}}function at(e,t,n,r){if(t.length===0)return;let o=eo(r)??240;if(o===170)return;let i=ph(o)?null:fh(e);if(!i){Xe(e),fM(e.ctx,t,n,r);return}let{w:s,h:a,data:u}=i,l=t.data,c=n.kind==="solid"?qe(o,n.rgb,0,0):0;for(let f=0;f<t.length*3;f+=3){let m=l[f];if(m<0||m>=a)continue;let b=Math.max(0,l[f+1]),h=Math.min(s,l[f+2]);if(h<=b)continue;b<i.x0&&(i.x0=b),h>i.x1&&(i.x1=h),m<i.y0&&(i.y0=m),m+1>i.y1&&(i.y1=m+1);let d=(m*s+b)*4;for(let p=b;p<h;p++,d+=4){if(dh(n,p,m))continue;let x=c;if(n.kind==="tile"){let[y,g]=n.toDevice(p,m);x=qe(o,chunk7JVB7NLG_js.i(n.tile,y,g,n.orgX,n.orgY),0,0);}u[d]=x>>16&255,u[d+1]=x>>8&255,u[d+2]=x&255,u[d+3]=255;}}}function fM(e,t,n,r){if(t.length===0)return;let o=eo(r)??240;if(o===170)return;let i=ph(o);if(n.kind==="solid"&&!i){hh(e,t,bh(qe(o,n.rgb,0,0)));return}if(!chunk7JVB7NLG_js.qa(e)||n.kind==="tile"&&chunk7JVB7NLG_js.pa(e)&&o===240){if(n.kind==="tile"&&chunk7JVB7NLG_js.pa(e)&&o===240){let{tile:M,orgX:E,orgY:P}=n,R=new Uint8ClampedArray(M.width*M.height*4);for(let A=0;A<M.rgb.length;A++)R[A*4]=M.rgb[A]>>>16&255,R[A*4+1]=M.rgb[A]>>>8&255,R[A*4+2]=M.rgb[A]&255,R[A*4+3]=n.skip?.[A]===1?0:255;let[T,w]=n.toDevice(0,0);e.save(),e.setTransform(1,0,0,1,0,0),xh(e,t),e.fillWithTile({width:M.width,height:M.height,rgba:R},E-T,P-w,1,1,"nonzero"),e.restore();return}let y=n.kind==="solid"?n.rgb:n.tile.rgb[0],g=chunk7JVB7NLG_js.Z(r);hh(e,t,chunk7JVB7NLG_js._(bh(y),g.colorTransform),g.gco);return}let s=t.bounds(),a=vn(e);if(!s)return;let u=Math.max(0,s.x0),l=Math.max(0,s.y0),c=a?Math.min(a.w,s.x1):s.x1,f=a?Math.min(a.h,s.y1):s.y1;if(c<=u||f<=l)return;let m={x:u,y:l,w:c-u,h:f-l},b=nn(m.w,m.h);if(!b)return;let h=chunk7JVB7NLG_js.ka(e,m.x,m.y,m.w,m.h).data,d=chunk7JVB7NLG_js.ka(b.ctx,0,0,m.w,m.h),p=d.data,x=t.data;for(let y=0;y<t.length*3;y+=3){let g=x[y];if(g<l||g>=f)continue;let M=Math.max(u,x[y+1]),E=Math.min(c,x[y+2]);for(let P=M;P<E;P++){if(dh(n,P,g))continue;let R=((g-l)*m.w+(P-u))*4,T;if(n.kind==="solid")T=n.rgb;else {let[A,I]=n.toDevice(P,g);T=chunk7JVB7NLG_js.i(n.tile,A,I,n.orgX,n.orgY);}let w=T;if(i){let A=p[R+3]===255?p[R]<<16|p[R+1]<<8|p[R+2]:h[R]<<16|h[R+1]<<8|h[R+2];w=qe(o,T,A,A);}else w=qe(o,T,0,0);p[R]=w>>16&255,p[R+1]=w>>8&255,p[R+2]=w&255,p[R+3]=255;}}rn(e,m,b,d);}var bM=[[[0,-8],[-8,0],[0,8],[8,0]],[[8,-16],[-8,-16],[-16,0],[-8,16],[8,16],[16,0]],[[8,-24],[-8,-24],[-24,-8],[-24,8],[-8,24],[8,24],[24,8],[24,-8]],[[8,-32],[-8,-32],[-24,-24],[-32,-8],[-32,8],[-24,24],[-8,32],[8,32],[24,24],[32,8],[32,-8],[24,-24]],[[8,-40],[-8,-40],[-24,-32],[-32,-24],[-40,-8],[-40,8],[-32,24],[-24,32],[-8,40],[8,40],[24,32],[32,24],[40,8],[40,-8],[32,-24],[24,-32]],[[8,-48],[-8,-48],[-24,-40],[-40,-24],[-48,-8],[-48,8],[-40,24],[-24,40],[-8,48],[8,48],[24,40],[40,24],[48,8],[48,-8],[40,-24],[24,-40]]],Il=104;function hM(e,t){return e?t?.5:-0.5:0}function dM(e,t){if(Number.isSafeInteger(e)&&Number.isSafeInteger(t))return Math.floor(e/t);let n=BigInt(Math.round(e)),r=BigInt(Math.round(t)),o=n/r;return n%r!==0n&&n<0n!=r<0n&&(o-=1n),Number(o)}var yh=new Map;function Sl(e,t=e){let n=`${e},${t}`,r=yh.get(n);if(r)return r;let o;if(e===t&&e<Il){let i=Math.min(6,Math.max(1,Math.floor(e/16+.5)));o=bM[i-1];}else {let i=Math.ceil(e/2),s=Math.ceil(t/2),a=chunk7JVB7NLG_js.z(chunk7JVB7NLG_js.y(-i,-s,i,s)),u=[];for(let l=0;l+1<a.length&&(u.push([a[l],a[l+1]]),!(l>0&&a[l+1]===0));l+=2);u.pop(),o=[...u,...u.map(l=>[0-l[0]||0,0-l[1]||0])];}return yh.set(n,o),o}var wl=new Map;function ta(e){return Math.sign(e)*Math.floor(Math.abs(e)+.75)}function pM(e,t){let n=`${e},${t.join(",")}`,r=wl.get(n);if(r)return r;let o=Math.hypot(t[0],t[1]);if(Math.abs(Math.hypot(t[2],t[3])-o)<1e-4*o&&Math.abs(t[0]*t[2]+t[1]*t[3])<1e-4*o*o&&e*o<Il){let b=Sl(Math.round(e*o));return wl.set(n,b),b}let i=e/2,s=t[0]*t[3]-t[1]*t[2]<0?-1:1,a=[ta(t[0]*i),ta(t[1]*i)],u=[s*ta(t[2]*i),s*ta(t[3]*i)],l=chunk7JVB7NLG_js.x({ax:-a[0]-u[0],ay:-a[1]-u[1],exx:2*a[0],exy:2*a[1],eyx:2*u[0],eyy:2*u[1]}),c=chunk7JVB7NLG_js.z(l.slice(0,14)),f=[];for(let b=0;b+1<c.length;b+=2)f.push([c[b],c[b+1]]);f.pop();let m=[...f,...f.map(b=>[0-b[0]||0,0-b[1]||0])];return wl.set(n,m),m}function xM(e,t,n,r=1,o=r,i){let s=e.length,a=e.some(d=>d[1]===0),u=Math.abs(n)*(r===o?1:r),l=Math.abs(t)*(r===o?2:o);if(i){let d=i[0]*i[3]-i[1]*i[2];l=Math.abs((i[3]*t-i[2]*n)/d),u=Math.abs((-i[1]*t+i[0]*n)/d);}let f=(u>l||u===l&&a?n<0:t<0||t===0&&n<0)?-1:1;i&&i[0]*i[3]-i[1]*i[2]<0&&(f=-f);let m=0,b=-1/0,h=0;for(let d=0;d<s;d++){let p=n*e[d][0]-t*e[d][1],x=f*(t*e[d][0]+n*e[d][1]);(p>b||p===b&&x>h)&&(b=p,m=d,h=x);}return [m,(m+s/2)%s]}function na(e){return Math.sign(e)*8*Math.floor((Math.abs(e)+4)/8)}function yM(e,t,n,r=e,o){let i=t,s=n,a=i<0||i===0&&s<0;a&&(i=-i,s=-s);let u=o??Sl(e,r),l=u.length,c=-s,f=i,m=0,b=-1/0;for(let k=0;k<l;k++){let F=c*u[k][0]+f*u[k][1];F>b&&(b=F,m=k);}a&&m===0&&c*u[l-1][0]+f*u[l-1][1]===b&&(m=l-1);let h=u[(m+l-1)%l],d=u[(m+1)%l],p=u[m],x=c*h[0]+f*h[1],y=c*d[0]+f*d[1],[g,M,E]=x>=y?[h,x,y]:[d,y,x],P=2*(b-M+(b-E)),R=P===0?0:(M-E)/P,T=p[0]+(g[0]-p[0])*R,w=p[1]+(g[1]-p[1])*R,A=M-E,I=k=>Math.sign(P===0?p[k]:p[k]*P+(g[k]-p[k])*A),S=o?[I(0)!==0?-I(0):i===0?0:Math.sign(s),I(1)!==0?I(1):Math.sign(i)]:[i===0?0:Math.sign(s),Math.sign(i)],v=o?m<l/2:m===0&&x>=y,C=[0,1].map(k=>{let F=S[k]+2*hM(Math.abs(g[k]-p[k])%2===1,v);if(P===0)return 8*(k===1&&s<0?Math.ceil((p[k]+F/2+4)/8)-1:Math.floor((p[k]+F/2+4)/8));let _=p[k]*P+(g[k]-p[k])*A;return 8*dM(2*_+P*(F+8)-(k===1&&s<0?1:0),16*P)}),U=C[0],L=C[1];return {v:a?[-U,-L]:[U,L],ray:a?[-T,-w]:[T,w]}}function bn(e,t){return Math.sqrt(e*e+t*t)}function gh(e,t,n,r=1,o=e,i,s=false,a=s,u=1){if(i){let d=i[0]*i[3]-i[1]*i[2],p=(i[3]*t-i[2]*n)/d,x=(-i[1]*t+i[0]*n)/d,y=Math.hypot(p,x);if(s&&(y=bn(Math.sign(p)*Math.floor((Math.abs(p)+8)/16)*16,Math.sign(x)*Math.floor((Math.abs(x)+8)/16)*16),y===0))return [0,0];let g=e/2*r/y,M=a?E=>Math.sign(E)*Math.floor(Math.abs(E)+.5):E=>Math.floor(E+.5);return [M((i[0]*p+i[2]*x)*g),M((i[1]*p+i[3]*x)*g)]}let[c,f]=typeof u=="number"?[u,u]:u,m=e/2*r,b=a?d=>Math.sign(d)*Math.floor(Math.abs(d)+.5):d=>Math.floor(d+.5);if(s&&(e===o||c!==f)){let d=t/c,p=n/f,x=c===1&&f===1?0:8,y=M=>x?Math.sign(M)*Math.floor((Math.abs(M)+x)/16)*16:Math.floor(M/16)*16,g=bn(y(d),y(p));return g===0?[0,0]:[b(d/g*m),b(p*f/c/g*m)]}let h=e===o?bn(t,n):bn(t,n*e/o);return [b(t/h*m),b(n/h*m)]}function ra(e,t,n,r){let o=e*r-t*n;if(o!==0)return o;if(e*n+t*r>=0)return 0;let i=e>=0?1:-1,s=t>=0?1:-1,a=Math.abs(t)>Math.abs(e)||Math.abs(t)===Math.abs(e)&&t>0;return i*s<0!==a?-1:1}var Al=class{constructor(t,n){this.opts=t;this.out=n;this.pts=[];this.pen=t.matrix&&t.deviceNib?pM(t.width,t.matrix):Sl(t.width,t.height),this.n=this.pen.length,this.rr=t.cap==="round"&&t.join==="round",this.originalRoundJoinSides=t.join==="round"&&t.cap!=="flat",this.maxX=Math.max(...this.pen.map(r=>Math.abs(r[0])));}seg(t,n,r,o,i=false){let s=r?r[0]:n[0]-t[0],a=r?r[1]:n[1]-t[1],u=o??[s,a],l=this.opts.deviceNib?this.opts.matrix:void 0,[c,f]=xM(this.pen,u[0],u[1],this.opts.width,this.opts.height,l),m=i&&o?o:[s,a],b=yM(this.opts.width,m[0],m[1],this.opts.height,l?this.pen:void 0),h=!!o&&s*o[0]+a*o[1]<0;return {dx:s,dy:a,tx:h?o[0]:s,ty:h?o[1]:a,L:c,R:f,v:b.v,vRaw:b.ray,e:gh(this.opts.capWidth??this.opts.width,m[0],m[1],1,this.opts.height??this.opts.capWidth,l,!!(this.opts.wholePixelDashVectors||this.opts.cutToLogicalUnits),void 0,this.opts.logicalScale),pe:[m[0],m[1]],curveEnd:!!o,role:o?.[2]??3,tangentLength:o?o[0]*o[0]+o[1]*o[1]:0,curve:i}}push(t,n){this.pts.push([t[0]+n[0],t[1]+n[1]]);}penAt(t,n){let r=this.pen[n];(t[0]&15)===0&&(t[1]&15)===0?this.push(t,[r[0]-Math.sign(r[0]),r[1]-Math.sign(r[1])]):this.push(t,r);}walk(t,n,r,o,i){if(o&&this.penAt(t,n),n!==r){for(let s=(n+1)%this.n;s!==r;s=(s+1)%this.n)this.penAt(t,s);i&&this.penAt(t,r);}}wedge(t,n,r,o,i,s=-1){let a=Math.PI*2,u=Math.atan2(n[1],n[0]),l=b=>{let h=(u-Math.atan2(b[1],b[0]))%a;return h<0&&(h+=a),h},c=(b,h)=>b[0]*h[1]-b[1]*h[0]===0&&b[0]*h[0]+b[1]*h[1]>0,f=c(n,r)?a:l(r),m=[];for(let b=0;b<this.n;b++){let h=this.pen[b];if(c(n,h))o&&m.push([0,b]);else if(c(r,h))i&&m.push([f,b]);else {let d=l(h);d<f&&m.push([d,b]);}}m.sort((b,h)=>b[0]-h[0]),s>=0&&!m.some(([,b])=>b===s)&&m.push([1/0,s]);for(let[,b]of m)this.penAt(t,b);}extremeTail(t,n,r){let o=this.pen[n];return t&&Math.abs(r.dy)>Math.abs(r.dx)&&Math.abs(o[0])===this.maxX&&o[1]===0?n:-1}joinSide(t,n){if(this.originalRoundJoinSides||t.curve){let r=this.pen[n==="L"?t.L:t.R];return [na(r[0]),na(r[1])]}return n==="R"?t.v:[-t.v[0],-t.v[1]]}capSide(t,n){if(this.rr){let r=this.pen[n==="L"?t.L:t.R];return [na(r[0]),na(r[1])]}return n==="R"?t.v:[-t.v[0],-t.v[1]]}cap(t,n,r,o=1){let i=r?"L":"R",s=r?"R":"L",{cap:a}=this.opts;if(a==="round"){if(this.push(t,this.capSide(n,i)),this.rr)this.walk(t,n[i],n[s],false,false);else {let c=i==="R"?n.vRaw:[-n.vRaw[0],-n.vRaw[1]];this.wedge(t,c,[-c[0],-c[1]],true,false);}this.push(t,this.capSide(n,s));return}let u=this.capSide(n,i),l=this.capSide(n,s);if(a==="square"){let c=o===1||n.curveEnd?n.e:this.scaledExtension(n,o),f=r?[-c[0],-c[1]]:c;this.push(t,[u[0]+f[0],u[1]+f[1]]),this.push(t,[l[0]+f[0],l[1]+f[1]]);}else this.push(t,u),this.push(t,l);}scaledExtension(t,n){let r=this.opts;if(r.wholePixelDashVectors&&!r.matrix&&!r.dashMetric&&(r.height===void 0||r.height===r.width)){let o=bn(Math.floor(t.pe[0]/16),Math.floor(t.pe[1]/16))*16;if(o>0){let i=Math.fround(r.width/2/o),s=a=>Math.sign(a)*Math.floor(Math.fround(Math.abs(a)*i)+.5);return [s(t.pe[0]),s(t.pe[1])]}}return gh(r.width,t.pe[0],t.pe[1],n,r.height,r.deviceNib?r.matrix:void 0,false,!!r.wholePixelDashVectors)}join(t,n,r,o,i){let{cap:s,width:a,miterLimit:u}=this.opts,l=n.curve&&r.curve,c=l?"round":this.opts.join,f=this.originalRoundJoinSides||l,m=this.joinSide(n,o),b=this.joinSide(r,o),h=o==="R"?n.vRaw:[-n.vRaw[0],-n.vRaw[1]],d=o==="R"?r.vRaw:[-r.vRaw[0],-r.vRaw[1]];if(l&&!this.originalRoundJoinSides&&n.curveEnd&&r.curveEnd&&((o==="R"?n:r).role&2)!==0&&((o==="R"?r:n).role&1)!==0){let y=n.tangentLength>=r.tangentLength?n:r;m=b=o==="R"?y.v:[-y.v[0],-y.v[1]];}!l&&!this.originalRoundJoinSides&&(n.curve&&n.curveEnd&&(m=o==="R"?n.v:[-n.v[0],-n.v[1]]),r.curve&&r.curveEnd&&(b=o==="R"?r.v:[-r.v[0],-r.v[1]]));let p=o==="R"?n.R:n.L,x=o==="R"?r.R:r.L;if(f&&(p===x||l&&m[0]===b[0]&&m[1]===b[1])){this.push(t,m);return}if(this.push(t,m),i){if(c==="round")if(f){let y=this.pen[x],g=Math.abs(r.dy)>Math.abs(r.dx),M=o==="L"&&g&&Math.abs(y[0])===this.maxX&&y[0]*y[1]<=0;this.walk(t,p,x,false,M);}else {let y=m[0]===-b[0]&&m[1]===-b[1];(p!==x||y)&&this.wedge(t,h,d,!y,false,this.extremeTail(o==="L"&&!y,x,r));}else if(c==="miter"){let y=EM(m,[n.dx,n.dy],b,[r.dx,r.dy],a,u,o,this.opts.height,this.opts.deviceNib?this.opts.matrix:void 0);y&&this.push(t,y);}}else {if(this.pts.push([t[0],t[1]]),l&&!this.originalRoundJoinSides){if(this.push(t,b),s==="flat"&&p!==x&&!(n.curveEnd&&r.curveEnd)){let y=this.pts.length;this.wedge(t,d,h,false,false,this.extremeTail(o==="L",p,n)),this.pts.length-y<2&&(this.pts.length=y);}this.push(t,m),this.pts.push([t[0],t[1]]);}c==="round"&&s==="flat"&&!l&&(this.push(t,b),p!==x&&this.wedge(t,d,h,false,false,this.extremeTail(o==="L",p,n)),this.push(t,m),this.pts.push([t[0],t[1]]));}this.push(t,b);}flush(){let t=[],n=NaN,r=NaN;for(let[o,i]of this.pts)(o!==n||i!==r)&&(t.push(o,i),n=o,r=i);for(;t.length>=4&&t[0]===t[t.length-2]&&t[1]===t[t.length-1];)t.length-=2;t.length>=6&&this.out.push(t),this.pts=[];}open(t,n,r,o,i=1,s=1){if(t.length<2&&!n?.[0]){this.dot(t[0]);return}let a=[];for(let u=0;u+1<t.length;u++)a.push(this.seg(t[u],t[u+1],n?.[u],r?.[u],o?.[u]));if(a.length===0){let u=this.seg(t[0],t[0],n?.[0],r?.[0],o?.[0]);this.cap(t[0],u,true,i),this.cap(t[0],u,false,s),this.flush();return}this.cap(t[0],a[0],true,i);for(let u=0;u+1<a.length;u++){let l=a[u],c=a[u+1],f=ra(l.tx,l.ty,c.tx,c.ty);f===0?this.push(t[u+1],this.joinSide(l,"R")):this.join(t[u+1],l,c,"R",f<0);}this.cap(t[t.length-1],a[a.length-1],false,s);for(let u=a.length-1;u>0;u--){let l=a[u],c=a[u-1],f=ra(c.tx,c.ty,l.tx,l.ty);f===0?this.push(t[u],this.joinSide(l,"L")):this.join(t[u],l,c,"L",f>0);}this.flush();}closed(t,n,r){let o=t.length,i=[];for(let s=0;s<o;s++)i.push(this.seg(t[s],t[(s+1)%o],void 0,n?.[s],r?.[s]));for(let s=1;s<=o;s++){let a=s%o,u=i[(a+o-1)%o],l=i[a],c=ra(u.tx,u.ty,l.tx,l.ty);c===0?this.push(t[a],this.joinSide(u,"R")):this.join(t[a],u,l,"R",c<0);}this.flush();for(let s=0;s<o;s++){let a=(o-s)%o,u=i[a],l=i[(a+o-1)%o],c=ra(l.tx,l.ty,u.tx,u.ty);c===0?this.push(t[a],this.joinSide(u,"L")):this.join(t[a],u,l,"L",c>0);}this.flush();}dot(t){if(this.opts.cap!=="round")return;let n=t[0]%16===0&&t[1]%16===0,r=this.opts.matrix,o=!this.opts.deviceNib||!r||r[1]===0&&r[2]===0,i=!this.opts.deviceNib&&(this.opts.height===void 0||this.opts.height===this.opts.width)&&this.opts.width<Il;for(let s=0;s<this.n;s++){let a=this.pen[s],u=i?s===0||s===this.n/2:a[0]===0;this.push(t,n&&o&&!u?[a[0]-Math.sign(a[0]),a[1]-Math.sign(a[1])]:a);}this.flush();}};function oa(e){return Math.sign(e)*Math.floor((Math.abs(e)+8)/16)*16}function Mh(e,t,n,r){let o=Math.abs(t)*(n/r),i=Math.fround(e+(t<0?-o:o));return t<0?Math.ceil(i-.5):Math.floor(i+.5)}function gM(e,t,n,r,o,i,s,a){let u=[],l=[];for(let h=0;h<r.length;h+=2){let d=r[h],p=r[h+1]??0,x=Math.min(d,o);l.push(d-x,p+x);}if(l.reduce((h,d)=>h+d,0)<=0)return [];let c=0,f=l[0],m=true,b={pts:[e[0]],dirs:[],draws:[],curves:[],startScale:1,endScale:1};for(let h=0;h+1<e.length;h++){let[d,p]=e[h],[x,y]=e[h+1],g=[x-d,y-p],M=a?a[0]*a[3]-a[1]*a[2]:1,E=a?Math.hypot((a[3]*g[0]-a[2]*g[1])/M,(-a[1]*g[0]+a[0]*g[1])/M):s?Math.hypot(g[0]/s[0],g[1]/s[1]):bn(g[0],g[1]),P=s?bn(oa(g[0]/s[0]),oa(g[1]/s[1])):a?bn(oa((a[3]*g[0]-a[2]*g[1])/M),oa((-a[1]*g[0]+a[0]*g[1])/M)):i?bn(Math.floor(g[0]/16),Math.floor(g[1]/16))*16:bn(g[0],g[1]);if(P===0){m&&b&&(b.pts.push(e[h+1]),b.dirs.push(g),b.draws.push(t[h]),b.curves.push(n[h]));continue}let R=0;for(;P-R>f||f===0&&m;){R+=f;let T=[Mh(d,g[0],R,P),Mh(p,g[1],R,P)];m&&b?(b.pts.push(T),b.dirs.push(g),b.draws.push(t[h]),b.curves.push(n[h]),b.endScale=b.pts[0]===e[0]&&T[0]===e[0][0]&&T[1]===e[0][1]?1:E/P,u.push(b),b=null):b={pts:[T],dirs:[],draws:[],curves:[],startScale:E/P,endScale:1},m=!m,c=(c+1)%l.length,f=l[c];}f-=P-R,m&&b&&(b.pts.push(e[h+1]),b.dirs.push(g),b.draws.push(t[h]),b.curves.push(n[h]),b.endScale=E/P);}return m&&b&&b.dirs.length>0&&(b.endScale=1,u.push(b)),u}function MM(e,t,n){let[r,o,i,s]=n,a=r*s-o*i,u=(f,m)=>[(s*f-i*m)/a,(-o*f+r*m)/a],l=new chunk7JVB7NLG_js.F;for(let f of e.figures){let m=[];for(let h=0;h+1<f.pts.length;h+=2)m.push(...u(f.pts[h],f.pts[h+1]));let b={pts:m,closed:f.closed,roundWiden:f.roundWiden,curveSegs:f.curveSegs,tangentRoles:f.tangentRoles};f.tangents&&(b.tangents=new Map([...f.tangents].map(([h,d])=>[h,u(d[0],d[1])]))),l.figures.push(b);}return ai(l,{...t,matrix:void 0,height:void 0}).map(f=>{let m=[];for(let b=0;b+1<f.length;b+=2)m.push(Math.round(r*f[b]+i*f[b+1]),Math.round(o*f[b]+s*f[b+1]));return m})}function ai(e,t){if(t.matrix&&!t.deviceNib)return MM(e,t,t.matrix);let n=[],r=!!t.dashes&&t.dashes.length>0;for(let o of e.figures){let i=new Al(t,n),s=[],a=[],u=[];for(let c=0;c+1<o.pts.length;c+=2){let f=[o.pts[c],o.pts[c+1]],m=s[s.length-1];if(!(m&&m[0]===f[0]&&m[1]===f[1])){if(m){{let b=o.tangents?.get(c/2-1);a.push(b&&[b[0],b[1],(o.roundWiden?3:o.tangentRoles?.get(c/2-1))??3]);}u.push(!!o.roundWiden||!!o.curveSegs?.has(c/2-1));}s.push(f);}}if(s.length===0)continue;let l=o.closed&&s.length>=2;if(l&&s.length>=2&&s[0][0]===s[s.length-1][0]&&s[0][1]===s[s.length-1][1]&&(s=s.slice(0,-1)),r){let c=l?[...s,s[0]]:s,f=t.cap==="flat"||t.shortenDashes===false?0:t.dashMetric?t.width/t.dashMetric[0]:t.width,m=l?[...a,void 0]:a,b=l?[...u,!!o.roundWiden]:u;for(let h of gM(c,m,b,t.dashes,f,!!t.wholePixelDashVectors,t.dashMetric,t.deviceNib?t.matrix:void 0)){let d=h.pts,p=h.dirs,x=h.draws,y=h.curves;i.open(d,p.length>0?p:[h.dirs[0]],p.length>0?x:[h.draws[0]],p.length>0?y:[h.curves[0]],h.startScale,h.endScale);}}else l&&s.length>=3||l&&s.length===2?i.closed(s,a,u):i.open(s,void 0,a,u);}return n}function EM(e,t,n,r,o,i,s,a=o,u){let l=t[0]*r[1]-t[1]*r[0];if(l===0)return null;let c=n[0]-e[0],f=n[1]-e[1],m=(c*r[1]-f*r[0])/l,b=e[0]+t[0]*m,h=e[1]+t[1]*m,d=Math.sign(b)*Math.floor(Math.abs(b)+.5),p=Math.sign(h)*Math.floor(Math.abs(h)+.5),x=s==="L"?Math.ceil:Math.floor;if(u){let g=u[0]*u[3]-u[1]*u[2],M=(u[3]*d-u[2]*p)/g,E=(-u[1]*d+u[0]*p)/g;return Math.hypot(Math.round(M/16),Math.round(E/16))>i*o/32?null:[d,p]}let y=a===o?x(p/16):x(p/16)*o/a;return Math.hypot(x(d/16),y)>i*o/32?null:[d,p]}function vl(e){let t=/^#?([0-9a-f]{6})$/i.exec(e.trim());return t?parseInt(t[1],16):0}function ge(e,t,n){let r=Ee(e),o=Math.round((r[0]*t+r[2]*n)*16)+Math.round(r[4]*16),i=Math.round((r[1]*t+r[3]*n)*16)+Math.round(r[5]*16),s=e.wholeDevicePixels;if(s){let a=16*s[0],u=16*s[1];return [Math.round(Math.floor(o/a+.5)*a),Math.round(Math.floor(i/u+.5)*u)]}return [o,i]}function ui(e,t,n,r,o){let[i,s]=ge(e,t,n),[a,u]=ge(e,r,n),[l,c]=ge(e,t,o);return {ax:i,ay:s,exx:a-i,exy:u-s,eyx:l-i,eyy:c-s}}function Tt(e){return e.exy===0&&e.eyx===0}function PM(e){let{ax:t,ay:n,exx:r,exy:o,eyx:i,eyy:s}=e;return [t+r,n+o,t,n,t+i,n+s,t+r+i,n+o+s]}function RM(e){return {ax:e.ax+e.eyx,ay:e.ay+e.eyy,exx:e.exx,exy:e.exy,eyx:-e.eyx,eyy:-e.eyy}}function yr(e,t=false){let n=PM(t?RM(e):e);e.halfXRect&&(n[4]--,n[6]--);let r=new chunk7JVB7NLG_js.F;return r.moveTo(n[0],n[1]),r.lineTo(n[2],n[3]),r.lineTo(n[4],n[5]),r.lineTo(n[6],n[7]),r.closeFigure(),r}function li(e,t=false){let n=new chunk7JVB7NLG_js.F;return n.addBeziers(chunk7JVB7NLG_js.x(e,t),true),n.closeFigure(),n.figures[0].roundWiden=true,n}function Eh(e,t,n,r,o){return Tt(e)?(i,s)=>[i,s]:(i,s)=>{let a=r!==0?(i-t)/r:0,u=o!==0?(s-n)/o:0;return [Math.round(e.ax+e.exx*a+e.eyx*u),Math.round(e.ay+e.exy*a+e.eyy*u)]}}function Ph(e){if(Tt(e)){let r=e.ax,o=e.ax+e.exx,i=e.ay,s=e.ay+e.eyy;return {l:Math.min(r,o),t:Math.min(i,s),r:Math.max(r,o),b:Math.max(i,s)}}let t=Math.round(Math.hypot(e.exx,e.exy)),n=Math.round(Math.hypot(e.eyx,e.eyy));return {l:0,t:0,r:t,b:n}}function Cl(e,t,n,r=false,o=false){let i=Ph(e),s=Tt(e)&&e.exx<0,a=Tt(e)&&e.eyy<0,u=r!==a,l=chunk7JVB7NLG_js.A(i.l,i.t,i.r,i.b,t,n,o,u,s,Tt(e)?e.cornerRatio:void 0),c=Eh(e,i.l,i.t,i.r-i.l,i.b-i.t),f=[];for(let m=0;m<l.length;m+=2)f.push(...c(l[m],u?i.t+i.b-l[m+1]:l[m+1]));if(e.halfX)if(e.halfXCompat||!u){let m=(i.t+i.b)/2,b=(i.b-i.t)/2||1;for(let h=0;h<16;h++){let d=(m-f[2*h+1])/b;f[2*h]+=h>=8?Math.round(1+d):Math.ceil(d-.5);}}else {let m=e.cornerExact!==void 0&&e.cornerExact[1]*2>=Math.abs(e.eyy)-1e-9;for(let b of m?[1,2,3,4,5,6,8,15]:[0,1,2,3,4,5,6,7])f[2*b]++;}if(e.cornerExact&&Tt(e)){let m=i.r-i.l,b=i.b-i.t;if(m>=0&&b>=0){let h=m===0?0:Math.round(e.cornerExact[0]*(s?m-m%2:m+m%2)/m/2),d=b===0?0:Math.round(e.cornerExact[1]*(u?b+b%2:b-b%2)/b/2),p=s?Math.floor(chunk7JVB7NLG_js.v*h):Math.ceil(chunk7JVB7NLG_js.v*h),x=u?Math.ceil(chunk7JVB7NLG_js.v*d):Math.floor(chunk7JVB7NLG_js.v*d),y=(M,E,P)=>{E!==null&&(f[2*M]=E),f[2*M+1]=u?i.t+i.b-P:P;},g=e.halfX?1:0;y(0,null,i.t+d),y(1,null,i.t+d-x),y(2,i.r+g-h+p,i.t),y(3,i.r+g-h,i.t),y(4,i.l+g+h,i.t),y(5,i.l+g+h-p,i.t),y(6,null,i.t+d-x),y(7,null,i.t+d),y(8,null,i.b-d),y(9,null,i.b-d+x),y(10,i.l+h-p,i.b),y(11,i.l+h,i.b),y(12,i.r-h,i.b),y(13,i.r-h+p,i.b),y(14,null,i.b-d+x),y(15,null,i.b-d);}}if(s)for(let m=0;m<f.length;m+=2)f[m]=i.l+i.r-f[m];return f}function sa(e,t,n,r=false,o=false,i=false){if(o)return yr(e,r);let s=Cl(e,t,n,r,i),a=new chunk7JVB7NLG_js.F;for(let u=0;u<4;u++){let l=u*8;a.addBeziers(s.slice(l,l+8),u===0);}return a.closeFigure(),a}function no(e,t,n,r,o,i,s=new chunk7JVB7NLG_js.F,a){let u=Ph(e),l=Eh(e,u.l,u.t,u.r-u.l,u.b-u.t),c=t[0],f=t[1],m=n[0],b=n[1],h=r;if(Tt(e))a?(h=r!==a.y,a.x&&(c=u.l+u.r-c,m=u.l+u.r-m)):e.exx<0!=e.eyy<0&&(h=!h);else {let y=e.exx*e.eyy-e.exy*e.eyx||1,g=(M,E)=>{let P=M-e.ax,R=E-e.ay,T=(P*e.eyy-R*e.eyx)/y,w=(e.exx*R-e.exy*P)/y;return [u.l+T*(u.r-u.l),u.t+w*(u.b-u.t)]};[c,f]=g(c,f),[m,b]=g(m,b),y<0&&(h=!h);}let d=!!a?.x&&Tt(e),p=chunk7JVB7NLG_js.E(u.l,u.t,u.r,u.b,c,f,m,b,h,!!e.halfX,!!e.framed,d),x=[];for(let y=0;y<p.length;y+=2)x.push(...l(p[y],p[y+1]));if(o==="arcto"&&i?(s.continueAt(i[0],i[1]),s.addBeziers(x,false)):s.addBeziers(x,true),o==="pie"){let y=u.r-u.l,g=u.b-u.t,[M,E]=l(u.l+Math.ceil(y/2)+(e.halfX&&!d?1:0),u.t+Math.ceil(g/2));s.lineTo(M,E);}return (o==="pie"||o==="chord")&&s.closeFigure(),{path:s,end:[x[x.length-2],x[x.length-1]]}}var Rh=5,TM=65536;function aa(e){let t=Ee(e),n=Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2])),r=e.wholeDevicePixels;return r?Math.round(e.state.penWidth*n/r[0])*r[0]:e.state.penWidth*n}function yt(e){return ((e.state.penFlags??e.state.penStyle)&TM)===0&&e.state.penExtended?true:Math.round(aa(e)/(e.wholeDevicePixels?.[0]??1))<=1}function Dl(e){return (e.state.penStyle&15)!==Rh}function Ll(e,t={}){let{state:n}=e,r=n.penFlags??n.penStyle,o=Ee(e),i=e.wholeDevicePixels&&(r&15)===6?n.penWidth*Math.sqrt(Math.abs(o[0]*o[3]-o[1]*o[2])):aa(e),s=r&3840,a=r&61440,u=!e.wholeDevicePixels&&n.penWidth*Math.abs(o[0])*16>=1&&n.penWidth*Math.abs(o[3])*16>=1&&Math.abs(o[1])<1e-6&&Math.abs(o[2])<1e-6&&Math.abs(Math.abs(o[0])-Math.abs(o[3]))>1e-6,l=o[0]*o[3]-o[1]*o[2],c=Math.abs(o[1])>=1e-6||Math.abs(o[2])>=1e-6,f=Math.abs(o[0])<1e-9&&Math.abs(o[3])<1e-9,m=!e.wholeDevicePixels&&(c&&!f||u&&o[0]<0)&&Math.abs(l)>1e-9&&n.penWidth*Math.sqrt(Math.abs(l))*16>=1,b=Math.abs(o[1])<1e-6&&Math.abs(o[2])<1e-6,h=!e.wholeDevicePixels&&b&&(Math.abs(Math.abs(o[0])-1)>1e-6||Math.abs(Math.abs(o[3])-1)>1e-6),d=n.penExtended?u||m||h?chunk7JVB7NLG_js.I(r,n.penWidth,n.penUserStyle,1):chunk7JVB7NLG_js.I(r,i,n.penUserStyle,i/(n.penWidth||1)):null,p=(u||h)&&!m&&d?[Math.abs(o[0]),Math.abs(o[3])]:void 0;if(m)return {width:Math.round(n.penWidth*16),matrix:[o[0],o[1],o[2],o[3]],deviceNib:true,cap:t.roundPen||!n.penExtended||s===0?"round":s===256?"square":"flat",join:t.roundPen?"round":t.rectangle&&!n.penExtended?"miter":!n.penExtended||a===0?"round":a===4096?"bevel":"miter",miterLimit:n.miterLimit??10,dashes:d?d.map(y=>y*16):null,shortenDashes:(r&15)!==7,cutToLogicalUnits:!d};let x=h&&!u&&n.penExtended&&(r&15)!==6;return {width:Math.round((u?n.penWidth*Math.abs(o[0]):i)*16),...u?{height:Math.round(n.penWidth*Math.abs(o[3])*16)}:{},cap:t.roundPen||!n.penExtended||s===0?"round":s===256?"square":"flat",join:t.roundPen?"round":t.rectangle&&!n.penExtended?"miter":!n.penExtended||a===0?"round":a===4096?"bevel":"miter",miterLimit:n.miterLimit??10,dashes:d?d.map(y=>y*16):null,...p?{dashMetric:p}:{},shortenDashes:(r&15)!==7,wholePixelDashVectors:Math.abs(o[0]-1)<1e-6&&Math.abs(o[3]-1)<1e-6&&Math.abs(o[1])<1e-6&&Math.abs(o[2])<1e-6,...h?{cutToLogicalUnits:true,logicalScale:u?[Math.abs(o[0]),Math.abs(o[3])]:Math.abs(o[0]),...x?{capWidth:n.penWidth*Math.abs(o[0])*16}:{}}:{}}}function wM(e){let t=new Uint8Array(64);for(let n=0;n<8;n++)for(let r=0;r<8;r++)t[n*8+r]=chunk7JVB7NLG_js.e(e,r,n)?0:1;return t}function on(e){let t=chunk7JVB7NLG_js.h(e.state);if(t.kind==="none")return null;if(t.kind==="solid")return {kind:"solid",rgb:t.rgb};let n=e.sx||1,r=e.sy||1,{bounds:o,state:i}=e;return {kind:"tile",tile:t,toDevice:(s,a)=>[Math.floor(o.left+(s+.5)/n),Math.floor(o.top+(a+.5)/r)],orgX:i.brushOrgX,orgY:i.brushOrgY,...i.bkMode===1&&i.brushPattern?.kind==="hatch"?{skip:wM(i.brushPattern.hatch)}:{}}}function AM(e){if(!e.figures.some(n=>n.tangents))return e;let t=new chunk7JVB7NLG_js.F;return t.figures=e.figures.map(n=>({pts:n.pts,closed:n.closed,roundWiden:n.roundWiden})),t}function ia(e,t,n=false){if(!e.wmfLayoutRtl||n)return t;let r=Math.round(16*(e.wholeDevicePixels?.[0]??1)),o=new chunk7JVB7NLG_js.F;return o.figures=t.figures.map(i=>({...i,pts:i.pts.map((s,a)=>a%2===0?s-r:s)})),o}function Th(e,t,n){t=ia(e,t,n.rectangle||n.roundPen);let{ctx:r,state:o}=e,i=!!n.filled;if(n.fill){let c=on(e);if(c){i=true;let f=n.fillPath?ia(e,n.fillPath,n.rectangle||n.roundPen):t,m=chunk7JVB7NLG_js.G(f,!!n.winding);at(e,m,c,o.rop2);}}if(!n.stroke||o.penStyle===Rh)return true;if(!yt(e)){if(!Dl(e))return false;let c=ai(i?AM(t):t,Ll(e,n));return at(e,chunk7JVB7NLG_js.t(c,true),{kind:"solid",rgb:vl(o.penColor)},o.rop2),true}let s=chunk7JVB7NLG_js.H(o.penFlags??o.penStyle,o.penUserStyle),a=new chunk7JVB7NLG_js.s,l=s!==null&&o.bkMode===2&&chunk7JVB7NLG_js.J(o.penFlags??o.penStyle)?new chunk7JVB7NLG_js.s:null;return chunk7JVB7NLG_js.K(t,a,l,s,n.style??{pos:0}),l&&at(e,l,{kind:"solid",rgb:vl(o.bkColor)},o.rop2),at(e,a,{kind:"solid",rgb:vl(o.penColor)},o.rop2),true}var Ul=.5-1/32;function Fl(e,t){return t===0?e:n=>{n.save(),n.translate(t,t),e(n),n.restore();}}function kl(e){return e.gdiAntialias===false}function IM(e,t,n){let{ctx:r,bounds:o,state:i}=e,s=chunk7JVB7NLG_js.h(i);if(s.kind!=="tile")return false;let a=e.sx||1,u=e.sy||1,l=eo(i.rop2)??240,c=i.bkMode===1&&i.brushPattern?.kind==="hatch"?i.brushPattern.hatch:-1,f=(x,y)=>c>=0&&!chunk7JVB7NLG_js.e(c,((x-i.brushOrgX)%8+8)%8,((y-i.brushOrgY)%8+8)%8);if(chunk7JVB7NLG_js.pa(r)&&(l===240||!r.canReadPixels)){let x=new Uint8ClampedArray(s.width*s.height*4);for(let y=0;y<s.rgb.length;y++){let g=s.rgb[y];x[y*4]=g>>>16&255,x[y*4+1]=g>>>8&255,x[y*4+2]=g&255,x[y*4+3]=c>=0&&!chunk7JVB7NLG_js.e(c,y%8,Math.floor(y/8))?0:255;}return r.fillWithTile({width:s.width,height:s.height,rgba:x},(i.brushOrgX-o.left)*a,(i.brushOrgY-o.top)*u,a,u,t),true}let m=vn(r);if(!m||typeof r.isPointInPath!="function")return false;if(l===170)return true;let b=n?Pl(n,1,m):{x:0,y:0,w:m.w,h:m.h};if(!b)return true;let h=.5-Ul,d=(x,y)=>chunk7JVB7NLG_js.i(s,Math.floor(o.left+(x+.5)/a),Math.floor(o.top+(y+.5)/u),i.brushOrgX,i.brushOrgY),p=chunk7JVB7NLG_js.Z(i.rop2);return to(r,b,(x,y,g)=>{if(!r.isPointInPath(x+h,y+h,t)||c>=0&&f(Math.floor(o.left+(x+.5)/a),Math.floor(o.top+(y+.5)/u)))return -1;let M=d(x,y);return l===240?M:qe(l,M,g,g)},(x,y)=>({color:El(d(x,y),p.colorTransform),mode:p.gco}))}function SM(e,t,n="nonzero",r){let{ctx:o,state:i}=e;if(i.brushStyle===1)return;let s=r??t;if(chunk7JVB7NLG_js.h(i).kind==="tile"){r&&r(o);let l=IM(e,n,s);if(r&&t(o),l)return}else {let l=chunk7JVB7NLG_js.Z(i.rop2);if((kl(e)||!l.exact&&Yn(i.rop2))&&Rl(o,i.rop2,i.brushColor,f=>{Fl(s,Ul)(f),f.fill(n);},1,n))return}let a=ze(e)?Ul:0,u=a!==0||r!==void 0;u&&Fl(s,a)(o),chunk7JVB7NLG_js.aa(o,i),o.fill(n),u&&t(o);}var ci=5;function gr(e,t=1){return Math.max(e.penWidth*t,1)}function Vn(e){let t=Ee(e);return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))||1}function Mr(e,t=1){if(e.penStyle===ci)return 0;let n=gr(e,t);return Number.isInteger(n)&&n%2===1?.5:0}function wh(e,t){let{state:n}=t,r=Vn(t),o=gr(n,r),i=n.penFlags??n.penStyle;e.lineWidth=o;let s=yt(t);if(!s&&n.penExtended){let a=i&3840,u=i&61440;e.lineCap=a===256?"square":a===512?"butt":"round",e.lineJoin=u===4096?"bevel":u===8192?"miter":"round",e.miterLimit=n.miterLimit??10,e.setLineDash(chunk7JVB7NLG_js.I(i,o,n.penUserStyle,r)??[]);}else s?(e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.setLineDash([])):(e.lineCap="round",e.lineJoin="round",e.setLineDash([]));}function vM(e){let{state:t}=e;return t.penStyle===ci||!yt(e)?null:chunk7JVB7NLG_js.H(t.penFlags??t.penStyle,t.penUserStyle)}function CM(e,t,n,r){let{ctx:o,state:i}=e,s=i.penFlags??i.penStyle,a=n.reduce((m,b)=>m+b,0),u=chunk7JVB7NLG_js.Z(i.rop2),l=i.bkMode===2&&chunk7JVB7NLG_js.J(s),c=[];t.figures.forEach((m,b)=>{b>0&&(r.pos=0);let h=m.closed?[...m.pts,m.pts[0],m.pts[1]]:m.pts;for(let d=0;d+3<h.length;d+=2){let p=0;chunk7JVB7NLG_js.u(h[d],h[d+1],h[d+2],h[d+3],()=>{p++;}),p!==0&&(c.push([h[d],h[d+1],h[d+2],h[d+3],r.pos,p]),r.pos+=p);}});let f=m=>m/16+.5;o.save();try{o.globalCompositeOperation=u.gco,o.lineWidth=1,o.lineCap="butt";for(let m of l?["bk","fg"]:["fg"]){o.strokeStyle=chunk7JVB7NLG_js._(m==="bk"?i.bkColor:i.penColor,u.colorTransform);for(let[b,h,d,p,x,y]of c){let g=Math.hypot(d-b,p-h)/16/y;m==="fg"?(o.setLineDash(n.map(M=>M*g)),o.lineDashOffset=x%a*g):o.setLineDash([]),o.beginPath(),o.moveTo(f(b),f(h)),o.lineTo(f(d),f(p)),o.stroke();}}}finally{o.setLineDash([]),o.lineDashOffset=0,o.restore();}}function DM(e,t){let{ctx:n,state:r}=e,o=Vn(e),i=Mr(r,o),s=Fl(t,i),a=chunk7JVB7NLG_js.Z(r.rop2);r.penStyle!==ci&&(kl(e)||!a.exact&&Yn(r.rop2))&&Rl(n,r.rop2,r.penColor,l=>{wh(l,e),s(l),l.stroke();},gr(r,o)/2+2)||(i!==0&&s(n),chunk7JVB7NLG_js.$(n,r),r.penStyle!==ci&&wh(n,e),n.stroke());}function Qe(e,t){let{ctx:n,state:r}=e,o=kl(e),i=!chunk7JVB7NLG_js.Z(r.rop2).exact&&Yn(r.rop2),s=r.penStyle===ci,a=!s&&yt(e),u=null,l=()=>(u??(u=t.raster()),u),c=false,f=()=>{c||(t.build(n),c=true);},m=t.fillRule??"nonzero";if(t.fill&&r.brushStyle!==1){let h=chunk7JVB7NLG_js.h(r).kind==="tile";if(o||h||i){let d=on(e);if(d){let p=ia(e,l(),t.rectangle||t.roundPen),x=chunk7JVB7NLG_js.G(p,m==="nonzero");t.axisRect&&t.stroke&&a&&(x=LM(x,l())),at(e,x,d,r.rop2);}}else {f();let d=t.axisRect&&t.stroke&&!s?t.axisRect.interior:void 0;SM(e,t.build,m,d);}}if(!t.stroke||s)return;if((a||Dl(e))&&(o||i)){Th(e,l(),{fill:false,stroke:true,style:t.style,rectangle:t.rectangle,roundPen:t.roundPen,filled:!!t.fill&&r.brushStyle!==1});return}let b=vM(e);if(b&&!o&&!i){CM(e,l(),b,t.style??{pos:0});return}Xe(e),f(),DM(e,t.build);}function LM(e,t){let n=new chunk7JVB7NLG_js.s;chunk7JVB7NLG_js.K(t,n,null,null);let r=new Map,o=n.data;for(let a=0;a<n.length*3;a+=3){let u=r.get(o[a]);u||(u=[],r.set(o[a],u)),u.push([o[a+1],o[a+2]]);}let i=new chunk7JVB7NLG_js.s,s=e.data;for(let a=0;a<e.length*3;a+=3){let u=s[a],l=(r.get(u)??[]).slice().sort((m,b)=>m[0]-b[0]),c=s[a+1],f=s[a+2];for(let[m,b]of l)b<=c||m>=f||(i.add(u,c,Math.min(m,f)),c=Math.max(c,b));i.add(u,c,f);}return i}function Ah(e,t){let n=e.boundary.length;if(n<3||e.boundaryArgb.length<n||e.boundaryArgb.every(l=>l===e.boundaryArgb[0]))return null;let r=Nn(t,e.center.x,e.center.y),o=Mn(e.centerArgb),i=e.boundary.map(l=>Nn(t,l.x,l.y)),s=is(e.preset),a=s?{preset:s}:{adjust:os(e.blend)??void 0},u=[];for(let l=0;l<n;l++){let c=(l+1)%n;e.boundary[l].x===e.boundary[c].x&&e.boundary[l].y===e.boundary[c].y||u.push(new rs([r[0],r[1],i[l][0],i[l][1],i[c][0],i[c][1]],[o,Mn(e.boundaryArgb[l]),Mn(e.boundaryArgb[c])],a));}return {triangles:u}}function Ih(e,t,n,r,o,i=false){let s=null;for(let a of e.triangles){let u=a.row(n,r,o);if(!u||t<u.xl||t>=u.xl+u.n)continue;let l=(t-u.xl)*4;s=Do(u.argb[l],u.argb[l+1],u.argb[l+2],u.argb[l+3],i);}return s}var Bl=[1,0,0,1,0,0],Gl=16*1024*1024,UM=1e-4;function sn(e){let t=e[0]*e[3]-e[1]*e[2];if(!Number.isFinite(t)||Math.abs(t)<1e-12)return null;let n=e[3]/t,r=-e[1]/t,o=-e[2]/t,i=e[0]/t;return [n,r,o,i,-(n*e[4]+o*e[5]),-(r*e[4]+i*e[5])]}function FM(e){let t=e.canvas,n=t?.width,r=t?.height;return typeof n=="number"&&typeof r=="number"&&n>0&&r>0?{w:n,h:r}:null}function kM(e,t,n=false){let{width:r,height:o,rgba:i,wrapMode:s}=e;if(r<=0||o<=0)return null;let a=Jo(je(t,e.transform??Bl),n);return a?(u,l,c,f,m,b)=>{fb(a,r,o,i,s,u,l,c,f,m,b);}:null}function _M(e){if(e.length<3)return null;let t=1/0,n=1/0,r=-1/0,o=-1/0;for(let i of e)t=Math.min(t,i.x),n=Math.min(n,i.y),r=Math.max(r,i.x),o=Math.max(o,i.y);return r>t&&o>n?{x:t,y:n,w:r-t,h:o-n}:null}function Sh(e,t,n,r,o){let i=e-t,s=Math.floor(i/n),a=i-s*n;return r&&(s%2+2)%2===1?t+n-o-a:t+a}function BM(e,t){let n=1/0,r=1/0,o=-1/0,i=-1/0;for(let[s,a]of [[e.x,e.y],[e.x+e.w,e.y],[e.x,e.y+e.h],[e.x+e.w,e.y+e.h]]){let u=t[0]*s+t[2]*a+t[4],l=t[1]*s+t[3]*a+t[5];n=Math.min(n,u),r=Math.min(r,l),o=Math.max(o,u),i=Math.max(i,l);}return [Math.floor(n+.5),Math.floor(r+.5),Math.floor(o+.5),Math.floor(i+.5)]}function _l(e,t){let n=1/0,r=1/0,o=-1/0,i=-1/0;for(let s of e){let a=t[0]*s.x+t[2]*s.y+t[4],u=t[1]*s.x+t[3]*s.y+t[5];n=Math.min(n,a),r=Math.min(r,u),o=Math.max(o,a),i=Math.max(i,u);}return [n,r,o,i].every(s=>Math.abs(s-Math.round(s))<1e-6)}var ua=2048;function la(e,t,n){if(!n)return (e%t+t)%t;let r=(e%(2*t)+2*t)%(2*t);return r<t?r:2*t-1-r}function GM(e,t,n){let r=e.points.map(s=>t({x:n[0]*s.x+n[2]*s.y+n[4],y:n[1]*s.x+n[3]*s.y+n[5]})),o=[];for(let s=0;s<r.length;s++)if((e.types[s]&7)===3&&s>0&&s+2<r.length){let a=r.slice(s-1,s+3).flatMap(l=>[Dt(l.x),Dt(l.y)]);o[o.length-1]={x:a[0]/16,y:a[1]/16};let u=[];jt(a,u);for(let l=0;l<u.length;l+=2)o.push({x:u[l]/16,y:u[l+1]/16});s+=2;}else o.push(r[s]);let i=o.length;return i>1&&o[0].x===o[i-1].x&&o[0].y===o[i-1].y&&o.pop(),o}function OM(e,t,n){if(Math.abs(n[1])>1e-9||Math.abs(n[2])>1e-9||n[0]<=0||n[3]<=0||!e.boundaryArgb.every(g=>g===e.boundaryArgb[0]))return null;let r=1/0,o=1/0,i=-1/0,s=-1/0;for(let g of e.source?e.source.points:e.boundary){let M=n[0]*g.x+n[4],E=n[3]*g.y+n[5];r=Math.min(r,M),o=Math.min(o,E),i=Math.max(i,M),s=Math.max(s,E);}let a=g=>Math.floor(g+.5),u=a(i)-a(r),l=a(s)-a(o);if(!(i>r)||!(s>o)||u<1||l<1||u*l>4*1024*1024)return null;let c=u/(i-r),f=l/(s-o),m=Jo([(i-r)/u,0,0,(s-o)/l,r,o]);if(!m)return null;let b=g=>({x:(n[0]*g.x+n[4]-r)*c,y:(n[3]*g.y+n[5]-o)*f}),h=Ch({...e,boundary:e.source?GM(e.source,b,n):e.boundary.map(b),source:void 0,center:b(e.center),transform:null},"clamp",Bl,false,true);if(!h)return null;let d=t==="tile-flip-x"||t==="tile-flip-xy",p=t==="tile-flip-y"||t==="tile-flip-xy",x=null,y=()=>{if(x)return x;let g=new Uint8ClampedArray(u*l*4);h(0,0,u,l,g),x=new Float64Array(u*l*4);for(let M=0;M<u*l;M++){let E=g[M*4+3];x[M*4]=Math.floor(g[M*4]*E/255+.5),x[M*4+1]=Math.floor(g[M*4+1]*E/255+.5),x[M*4+2]=Math.floor(g[M*4+2]*E/255+.5),x[M*4+3]=E;}return x};return (g,M,E,P,R)=>{let T=y(),w=new Float64Array(E);Yu(m,g,0,w,new Float64Array(E));for(let A=0;A<P;A++){let I=f*(M+A-o),S=Math.floor(I),v=Math.floor((I-S)*ua+.5)/ua,C=la(S,l,p)*u,U=la(S+1,l,p)*u;for(let L=0;L<E;L++){let k=w[L],F=Math.floor(k),_=Math.floor((k-F)*ua+.5)/ua,H=la(F,u,d),G=la(F+1,u,d),W=(A*E+L)*4,N=K=>(1-_)*(1-v)*T[(C+H)*4+K]+_*(1-v)*T[(C+G)*4+K]+(1-_)*v*T[(U+H)*4+K]+_*v*T[(U+G)*4+K],Z=N(3),J=Math.floor(Z+.5);if(J<=0){R[W]=R[W+1]=R[W+2]=R[W+3]=0;continue}for(let K=0;K<3;K++){let ie=Math.floor(N(K)+.5);R[W+K]=Math.min(255,Z>=255?ie:Math.floor(ie*255/J+.5));}R[W+3]=J;}}}}function Ch(e,t,n,r=true,o=false){let i=_M(e.boundary),s=je(n,e.transform??Bl),a=sn(s);if(!i||!a)return null;if(t!=="clamp"&&!_l(e.boundary,s)){let E=OM(e,t,s);if(E)return E}let c=!e.boundaryArgb.every(E=>E===e.boundaryArgb[0])||t!=="clamp"&&!_l(e.boundary,s)?0:vf(e.boundary,s),f=t==="clamp"||_l(e.boundary,s)?Ah(e,s):null,m=c>0?gf(e,s):null,b=Math.hypot(s[0],s[1]),h=Math.hypot(s[2],s[3]),d=b>0?1/b:0,p=h>0?1/h:0,x=t==="tile-flip-x"||t==="tile-flip-xy",y=t==="tile-flip-y"||t==="tile-flip-xy",g=t==="clamp"?UM:0,M=t==="clamp"?null:BM(i,s);return (E,P,R,T,w,A)=>{let I=M!==null&&E>=M[0]&&E+R<=M[2]&&P>=M[1]&&P+T<=M[3],S=M&&!I?M[0]:E,v=M&&!I?M[2]:E+R,C=o||M!==null&&!I,U=A!==void 0&&!(M&&!I);for(let L=0;L<T;L++){let k=P+L,F=-1;for(let _=0;_<R;_++){if(U&&A[L*R+_]&&_>=F){let ie=_;for(;ie>0&&A[L*R+ie-1];)ie--;for(F=_;F<R&&A[L*R+F];)F++;S=E+ie,v=E+F;}let H=E+_+g,G=a[0]*H+a[2]*k+a[4],W=a[1]*H+a[3]*k+a[5];if(t!=="clamp"&&(G=Sh(G,i.x,i.w,x,d),W=Sh(W,i.y,i.h,y,p)),t==="clamp"&&W>=i.y+i.h&&!f&&!m)continue;let N=g?{x:G-a[0]*g,y:W-a[1]*g}:void 0,Z=null,J=false;if(f||m){let ie=t==="clamp"?E+_:s[0]*G+s[2]*W+s[4],ce=t==="clamp"?k:s[1]*G+s[3]*W+s[5],$=Math.round(ie),X=Math.round(ce);if(Math.abs(ie-$)<1e-6&&Math.abs(ce-X)<1e-6){if(f)Z=Ih(f,$,X,S,v,C),Z===null&&r&&(J=true);else if(m){let B=m.colorAt($,X,S,v);B!==null?Z=Do(B>>>24,B>>>16&255,B>>>8&255,B&255,C):r&&(J=true);}}}if(Z===null&&!J)if(m){let ie={s:NaN};if(us(e,G,W,N,ie)!==null){let ce=m.colorForPosition(ie.s);Z=Do(ce>>>24,ce>>>16&255,ce>>>8&255,ce&255,C);}}else Z=us(e,G,W,N);if(Z===null)continue;let K=(L*R+_)*4;w[K]=Z>>>16&255,w[K+1]=Z>>>8&255,w[K+2]=Z&255,w[K+3]=Z>>>24&255;}}}}function oo(e,t,n){if(t&32768)return null;let r=e.objectTable.get(n&255);return !r||r.kind!=="plus-brush"?null:Ol(e,r)}function Ol(e,t){let n=_e(e),r=e.baseTransform,o=r&&r[1]===0&&r[2]===0&&Number.isInteger(r[4])&&Number.isInteger(r[5])&&!e.ext?.tsDevice?{x:r[4],y:r[5]}:{x:0,y:0};if(t.hatch&&!chunk7JVB7NLG_js.pa(e.ctx)){let i=sn(Ys(e));if(i)return Wb(t.hatch,e.ext?.renderingOrigin??{x:0,y:0},i)}return t.texture?kM(t.texture,n,Rt(e.pixelOffsetMode??0)):t.gradient&&t.gradient.type==="radial"&&t.gradient.shape?Ch(t.gradient.shape,t.gradient.wrapMode,n):t.gradient&&t.gradient.type==="linear"&&!chunk7JVB7NLG_js.pa(e.ctx)?((o.x!==0||o.y!==0)&&(n=[n[0],n[1],n[2],n[3],n[4]-o.x,n[5]-o.y]),wf(t.gradient,n,Rt(e.pixelOffsetMode??0),e.ext?.compositingMode===1,o)):null}function Er(e,t,n,r=0){if(!e||e.length===0)return {x:0,y:0,w:n.w,h:n.h};let o=1/0,i=1/0,s=-1/0,a=-1/0;for(let b of e){let h=t[0]*b.x+t[2]*b.y+t[4],d=t[1]*b.x+t[3]*b.y+t[5];o=Math.min(o,h),i=Math.min(i,d),s=Math.max(s,h),a=Math.max(a,d);}if(!Number.isFinite(o+i+s+a))return {x:0,y:0,w:n.w,h:n.h};let u=Math.ceil(Math.max(0,r))+1,l=Math.max(0,Math.floor(o)-u),c=Math.max(0,Math.floor(i)-u),f=Math.min(n.w,Math.ceil(s)+u),m=Math.min(n.h,Math.ceil(a)+u);return f>l&&m>c?{x:l,y:c,w:f-l,h:m-c}:null}function Cn(e,t,n,r,o,i="nonzero"){let{ctx:s}=e,a=FM(s);if(!a||typeof s.clip!="function"||typeof s.drawImage!="function")return false;let u=fi(e);if(u!=="canvas"){let b=Nl(e,t,n);if(b&&WM(e,b,r,o,i,a,u))return true}let l=oo(e,t,n);if(!l)return false;let c=Er(o,_e(e),a);if(!c)return true;if(c.w*c.h>Gl)return false;let f=chunk7JVB7NLG_js.Y(c.w,c.h);if(!f)return false;let m=new Uint8ClampedArray(c.w*c.h*4);l(c.x,c.y,c.w,c.h,m),chunk7JVB7NLG_js.la(f.ctx,chunk7JVB7NLG_js.na(m,c.w,c.h),0,0),s.save();try{pt(e),s.beginPath(),r(s),s.clip(i),s.setTransform(1,0,0,1,0,0),s.imageSmoothingEnabled=!1,s.drawImage.call(s,f.canvas,c.x,c.y);}finally{s.restore();}return true}function mi(e,t,n,r,o="canvas",i,s=true){let a=o===true?"aliased":o===false?"canvas":o,u=a==="aliased",l=a==="gdiplus-aa",{ctx:c}=e;if(typeof c.drawImage!="function"||n.w*n.h>Gl)return false;let f=chunk7JVB7NLG_js.Y(n.w,n.h),m=chunk7JVB7NLG_js.Y(n.w,n.h);if(!f||!m||typeof f.ctx.getImageData!="function")return false;let b=_e(e),h=f.ctx,d=u?NM(e):s?ml(e):0;h.setTransform(b[0],b[1],b[2],b[3],b[4]-n.x+d,b[5]-n.y+d),h.fillStyle="#000",h.strokeStyle="#000",r(a!=="canvas"?f0(h,b):h);let p=chunk7JVB7NLG_js.ka(h,0,0,n.w,n.h).data;if(l&&i&&typeof h.isPointInPath=="function")for(let y=3;y<p.length;y+=4){let g=p[y];if(g===0||g===255)continue;let M=(y-3)/4,E=M%n.w,P=Math.floor(M/n.w),R=0;for(let T=0;T<4;T++)for(let w=0;w<8;w++)i(h,E+w/8+vh,P+T/4+vh)&&R++;p[y]=Math.round(R*255/32);}if(u){let y=i&&typeof h.isPointInPath=="function"?i:null;for(let g=3;g<p.length;g+=4){let M=p[g];if(!(M===0||M===255))if(y){let E=(g-3)/4,P=E%n.w+.5,R=Math.floor(E/n.w)+.5;p[g]=y(h,P,R)?255:0;}else p[g]=M>=128?255:0;}}let x=new Uint8ClampedArray(n.w*n.h*4);t(n.x,n.y,n.w,n.h,x);for(let y=3;y<x.length;y+=4)x[y]=(x[y]*p[y]+127)/255;chunk7JVB7NLG_js.la(m.ctx,chunk7JVB7NLG_js.na(x,n.w,n.h),0,0),c.save();try{c.setTransform(1,0,0,1,0,0),c.imageSmoothingEnabled=!1,c.drawImage.call(c,m.canvas,n.x,n.y);}finally{c.restore();}return true}function NM(e){return (Rt(e.pixelOffsetMode??0)?0:.5)-1/32}var vh=1/1024;function fi(e){return e.gdiAntialias===true||chunk7JVB7NLG_js.pa(e.ctx)?"canvas":e.antiAlias?"gdiplus-aa":"aliased"}function ro(e){let t=e>>>24&255,n=e>>>16&255,r=e>>>8&255,o=e&255;return (i,s,a,u,l)=>{for(let c=0;c<a*u*4;c+=4)l[c]=n,l[c+1]=r,l[c+2]=o,l[c+3]=t;}}function io(e){let t=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)$/.exec(e);if(t){let r=t[4]===void 0?1:Number(t[4]),o=i=>Math.min(255,Math.max(0,Math.round(Number(i))));return (Math.round(Math.min(1,Math.max(0,r))*255)<<24|o(t[1])<<16|o(t[2])<<8|o(t[3]))>>>0}let n=/^#([0-9a-f]{6})$/i.exec(e);return n?(4278190080|parseInt(n[1],16))>>>0:null}function Nl(e,t,n){if(t&32768)return ro(n>>>0);let r=oo(e,t,n);if(r)return r;let o=e.objectTable.get(n&255),i=o&&o.kind==="plus-brush"?io(o.color):null;return i===null?null:ro(i)}function WM(e,t,n,r,o,i,s){let a=_e(e),u=null;try{u=g0(n,a,s==="aliased");}catch{u=null;}if(u){let c=Bo(u,i);if(!c)return true;if(c.w*c.h<=Gl){let f=Rt(e.pixelOffsetMode??0),m=ot(u,o==="evenodd",s==="gdiplus-aa",f,c);return zn(e,t,c,m,1,true)}}let l=Er(r,a,i);return l?mi(e,t,l,c=>{c.beginPath(),n(c),c.fill(o);},s,(c,f,m)=>c.isPointInPath(f,m,o)):true}function HM(e,t,n){let r=true;for(let o=0;o<n.length;o++){let i=o*4,s=n[o],a=e[i+3];if(s===0||a===0){e[i+3]=0;continue}if(t[i+3]!==255){e[i+3]=(a*s+127)/255,r=false;continue}let u=s===255?32:Math.round(s*32/255),l=Math.round(a*u/32);for(let c=0;c<3;c++){let f=Math.round(e[i+c]*a/255);e[i+c]=Math.min(255,Math.round(f*u/32)+Math.round(t[i+c]*(255-l)/255));}e[i+3]=255;}return r}function $M(e,t,n,r=null){for(let o=0;o<n.length;o++){let i=o*4,s=n[o];if(s===0)e[i+3]=0;else if(s!==255){let a=Math.round(s*32/255),u=e[i+3],l=Math.round(u*a/32);if(l>0&&l<255)for(let c=0;c<3;c++){let f=r?r[i+c]:Math.round(e[i+c]*u/255);e[i+c]=du(Math.round(f*a/32),l);}e[i+3]=l;}}return e}function XM(e,t,n,r){let{ctx:o}=e,i=chunk7JVB7NLG_js.Y(t.w,t.h),s=chunk7JVB7NLG_js.Y(t.w,t.h);if(!i||!s)return false;let a=new Uint8ClampedArray(t.w*t.h*4);for(let u=0;u<r.length;u++)a[u*4+3]=r[u]?255:0;chunk7JVB7NLG_js.la(i.ctx,chunk7JVB7NLG_js.na(a,t.w,t.h),0,0),chunk7JVB7NLG_js.la(s.ctx,chunk7JVB7NLG_js.na(n,t.w,t.h),0,0),o.save();try{o.setTransform(1,0,0,1,0,0),o.imageSmoothingEnabled=!1;let u=o.drawImage;o.globalCompositeOperation="destination-out",u.call(o,i.canvas,t.x,t.y),o.globalCompositeOperation="source-over",u.call(o,s.canvas,t.x,t.y);}finally{o.restore();}return true}function jM(e){let t=new Uint8Array(256),n=new Uint8Array(256);for(let r=0;r<256;r++)t[r]=Math.round(255*Math.pow(r/255,e)),n[r]=Math.round(255*Math.pow(r/255,1/e));return {lin:t,inv:n}}function YM(e){let t=Math.round(e*6/255);return Math.abs(e-255*t/6)<=.51?t/6:e/255}function VM(e,t,n,r,o=1,i=false){if(t===0)return r;if(i)return n;let s=e.lin[r],a=e.lin[n];return e.inv[Math.min(255,Math.max(0,s+Math.round((a-s)*YM(t)*o)))]}function zn(e,t,n,r,o=1,i=false,s=1){let{ctx:a}=e,u=chunk7JVB7NLG_js.Y(n.w,n.h);if(typeof a.drawImage!="function"||!u)return false;let l=new Uint8ClampedArray(n.w*n.h*4);if(t(n.x,n.y,n.w,n.h,l,o===1?r:void 0),o===1&&e.ext?.compositingMode===1&&typeof a.getImageData=="function"){let c=chunk7JVB7NLG_js.ka(a,n.x,n.y,n.w,n.h).data,f=null;return t.premultiplied&&(f=new Uint8ClampedArray(n.w*n.h*4),t.premultiplied(n.x,n.y,n.w,n.h,f)),XM(e,n,$M(l,c,r,f),r)}if(o===1&&i&&typeof a.getImageData=="function"){let c=chunk7JVB7NLG_js.ka(a,n.x,n.y,n.w,n.h).data;HM(l,c,r),chunk7JVB7NLG_js.la(u.ctx,chunk7JVB7NLG_js.na(l,n.w,n.h),0,0),a.save();try{a.setTransform(1,0,0,1,0,0),a.imageSmoothingEnabled=!1,a.drawImage.call(a,u.canvas,n.x,n.y);}finally{a.restore();}return true}if(o===3){if(typeof a.getImageData!="function")return false;let c=chunk7JVB7NLG_js.ka(a,n.x,n.y,n.w,n.h).data,f=jM(s);for(let m=0;m<n.w*n.h;m++){let b=m*4,h=l[b+3]/255,d=false,p=h===1&&r[m*3]===255&&r[m*3+1]===255&&r[m*3+2]===255;for(let x=0;x<3;x++){let y=r[m*3+x];y>0&&(d=true),l[b+x]=VM(f,y,l[b+x],c[b+x],h,p);}l[b+3]=d?255:0;}}else for(let c=3;c<l.length;c+=4)l[c]=(l[c]*r[(c-3)/4]+127)/255;chunk7JVB7NLG_js.la(u.ctx,chunk7JVB7NLG_js.na(l,n.w,n.h),0,0),a.save();try{a.setTransform(1,0,0,1,0,0),a.imageSmoothingEnabled=!1,a.drawImage.call(a,u.canvas,n.x,n.y);}finally{a.restore();}return true}function eE(e){let{state:t}=e,r=!chunk7JVB7NLG_js.Z(t.rop2).exact&&Yn(t.rop2),o=t.penStyle===5||(t.penStyle===0||t.penStyle===6)&&yt(e);return r||e.gdiAntialias===false||chunk7JVB7NLG_js.h(t).kind==="tile"||!o}function Dn(e){return e.rasterPath??(e.rasterPath=new chunk7JVB7NLG_js.F),e.rasterPath}function Xl(e,t,n){let r=yr(t,n),o=r.figures[0].pts,i=Wt(e);i.moveTo(o[0]/16,o[1]/16);for(let s=2;s<o.length;s+=2)i.lineTo(o[s]/16,o[s+1]/16);i.closePath(),Dn(e).append(r);}function Uh(e,t,n){let r=Wt(e);r.moveTo(t[0]/16,t[1]/16);for(let o=n===6?2:0;o<t.length;o+=n){n===8&&o>0&&r.lineTo(t[o]/16,t[o+1]/16);let i=n===8?o+2:o;r.bezierCurveTo(t[i]/16,t[i+1]/16,t[i+2]/16,t[i+3]/16,t[i+4]/16,t[i+5]/16);}r.closePath();}function so(e){let t=Dn(e),[n,r]=Ln(e),o=t.figures.length;t.continueAt(n,r),t.figures.length!==o&&Wt(e).moveTo(n/16,r/16);}function tE(e){return e.lineStyle??(e.lineStyle={pos:0}),e.lineStyle}function ao(e){e.lineStyle={pos:0};}function Ln(e){let t=e.curFix,{state:n}=e;return t&&t.lx===n.curX&&t.ly===n.curY?[t.x,t.y]:ge(e,n.curX,n.curY)}function ca(e,t,n,r,o){return ui(e,Math.min(t,r),Math.min(n,o),Math.max(t,r),Math.max(n,o))}function Dh(e,t,n){let r=Ee(e),o=n===0?Math.hypot(r[0],r[1]):Math.hypot(r[2],r[3]);return Math.round(Math.abs(t)*o*16)}var Fh=6;function ma(e,t,n=false,r=false){if((e.state.penStyle&15)!==Fh||!Tt(t)||ze(e))return null;let o=Ee(e),i=In(e),s=Sn(e),a=Math.abs(e.state.penWidth*o[0])/i*16,u=Math.abs(e.state.penWidth*o[3])/s*16;if(Math.max(a,u)<24)return null;let l=Math.round(a),c=Math.round(u);if(Math.abs(t.exx)/i<l||Math.abs(t.eyy)/s<c)return null;let f=Math.floor(l/2),m=Math.ceil(l/2),b=Math.round((r?Math.floor(c/2):Math.ceil(c/2))*s);return {left:Math.round((n?m:f)*i),right:Math.round((n?f:m)*i),top:b,bottom:b,half:l%2===1&&!n,halfRect:l%2===1&&n}}function nE(e,t){if((e.state.penStyle&15)!==Fh||!Tt(t)||ze(e))return false;let n=Ee(e),r=In(e),o=Sn(e),i=Math.abs(e.state.penWidth*n[0])/r*16,s=Math.abs(e.state.penWidth*n[3])/o*16;return Math.max(i,s)<24?false:Math.abs(t.exx)/r<Math.round(i)||Math.abs(t.eyy)/o<Math.round(s)}function fa(e,t){let n=e.exx<0?-1:1,r=e.eyy<0?-1:1,o={ax:e.ax+n*t.left,ay:e.ay+r*t.top,exx:e.exx-n*(t.left+t.right),exy:0,eyx:0,eyy:e.eyy-r*(t.top+t.bottom),framed:true};return t.half&&n>0&&(o.halfX=true),t.halfRect&&n>0&&(o.halfXRect=true),o}function rE(e,t,n,r,o,i,s,a){let u=BigInt(2*o-e-n),l=BigInt(2*i-t-r),c=BigInt(2*s-e-n),f=BigInt(2*a-t-r);return u*f===l*c&&u*c+l*f>0n}function oE(e,t,n){let{ctx:r,view:o}=e;if(n>=20){let i=o.getInt32(t,true),s=o.getInt32(t+4,true),a=sh(e.state,o,t+8),u=ze(e)?Be(e,i,s):{x:He(e,i),y:$e(e,s)};r.fillStyle=a,r.fillRect(u.x,u.y,1,1);}return true}function iE(e,t,n){let{view:r,state:o,inPath:i}=e;if(n>=16&&(o.curX=r.getInt32(t,true),o.curY=r.getInt32(t+4,true),ao(e),e.curFix=void 0,i)){let s=ze(e)?Be(e,o.curX,o.curY):{x:He(e,o.curX),y:$e(e,o.curY)};Wt(e).moveTo(s.x,s.y);let a=ge(e,o.curX,o.curY);Dn(e).moveTo(a[0],a[1]);}return true}function sE(e,t,n){let{view:r,state:o,inPath:i}=e;if(n>=16){let s=r.getInt32(t,true),a=r.getInt32(t+4,true),u=ze(e),l=u?Be(e,s,a):{x:He(e,s),y:$e(e,a)},c=ge(e,s,a);if(i)so(e),Wt(e).lineTo(l.x,l.y),Dn(e).lineTo(c[0],c[1]);else {let f=u?Be(e,o.curX,o.curY):{x:He(e,o.curX),y:$e(e,o.curY)},m=Ln(e);Qe(e,{build:b=>{b.beginPath(),b.moveTo(f.x,f.y),b.lineTo(l.x,l.y);},raster:()=>{let b=new chunk7JVB7NLG_js.F;return b.moveTo(m[0],m[1]),b.lineTo(c[0],c[1]),b},fill:false,stroke:true,style:tE(e)});}o.curX=s,o.curY=a;}return true}function aE(e,t){let{state:n}=e;if(e.inPath||n.penStyle===5||n.penStyle===6||t.exy!==0||t.eyx!==0||t.exx===0||t.eyy===0||!yt(e))return t;let r=Math.ceil(t.ax/16)*16,o=Math.ceil(t.ay/16)*16;return {...t,ax:r,ay:o,exx:Math.ceil((t.ax+t.exx)/16)*16-r,eyy:Math.ceil((t.ay+t.eyy)/16)*16-o}}function uE(e){if(!Tt(e)||e.exx>=0&&e.eyy>=0)return e;let t=e.exx<0?e.ax+e.exx:e.ax,n=e.eyy<0?e.ay+e.eyy:e.ay;return {...e,ax:t,ay:n,exx:Math.abs(e.exx),eyy:Math.abs(e.eyy)}}function lE(e,t,n){let{ctx:r,view:o,state:i,inPath:s}=e;if(n>=24){let a=o.getInt32(t,true),u=o.getInt32(t+4,true),l=o.getInt32(t+8,true),c=o.getInt32(t+12,true),f=aE(e,ca(e,a,u,l,c)),m=ma(e,f,true,e.state.arcDirection===2),b=m?fa(f,m):f,h=e.state.arcDirection===2;if(s||ao(e),ze(e)){let M=Be(e,a,u),E=Be(e,l,u),P=Be(e,l,c),R=Be(e,a,c),T=w=>{w.moveTo(M.x,M.y),w.lineTo(E.x,E.y),w.lineTo(P.x,P.y),w.lineTo(R.x,R.y),w.closePath();};return s?Xl(e,b,h):Qe(e,{build:w=>{w.beginPath(),T(w);},raster:()=>yr(b,h),rectangle:true,fill:true,stroke:true,axisRect:Tt(b)?{}:void 0}),true}let p=He(e,a),x=$e(e,u),y=Ze(e,l-a),g=st(e,c-u);if(m&&(p=Math.min(b.ax,b.ax+b.exx)/16,x=Math.min(b.ay,b.ay+b.eyy)/16,y=Math.abs(b.exx)/16,g=Math.abs(b.eyy)/16),s)Xl(e,b,h);else if(eE(e))Qe(e,{build:M=>{M.beginPath(),M.rect(p,x,y,g);},raster:()=>yr(yt(e)?uE(b):b,h),rectangle:true,fill:true,stroke:true,axisRect:{interior:cE(i,p,x,y,g,Vn(e))}});else {chunk7JVB7NLG_js.aa(r,i),r.fillRect(p,x,y,g),chunk7JVB7NLG_js.$(r,i),r.lineWidth=1;let M=Mr(i,Vn(e));r.strokeRect(p+M,x+M,y,g);}}return true}function cE(e,t,n,r,o,i=1){if(Mr(e,i)===0||gr(e,i)!==1)return;let s=Math.min(t,t+r),a=Math.min(n,n+o),u=Math.abs(r)-1,l=Math.abs(o)-1;if(!(u<=0||l<=0))return c=>{c.beginPath(),c.rect(s+1,a+1,u,l);}}var Lh=.5522847498307936;function Wl(e,t,n,r,o,i,s,a){let u=Math.min(t,r),l=Math.max(t,r),c=Math.min(n,o),f=Math.max(n,o),m=Math.min(Math.abs(i),(l-u)/2),b=Math.min(Math.abs(s),(f-c)/2);if(!a){if(m<=0||b<=0){e.rect(u,c,l-u,f-c);return}let g=Math.PI/2;e.moveTo(u+m,c),e.lineTo(l-m,c),e.ellipse(l-m,c+b,m,b,0,-g,0),e.lineTo(l,f-b),e.ellipse(l-m,f-b,m,b,0,0,g),e.lineTo(u+m,f),e.ellipse(u+m,f-b,m,b,0,g,2*g),e.lineTo(u,c+b),e.ellipse(u+m,c+b,m,b,0,2*g,3*g),e.closePath();return}let h=(g,M)=>{let E=a(g,M);e.moveTo(E.x,E.y);},d=(g,M)=>{let E=a(g,M);e.lineTo(E.x,E.y);},p=(g,M,E,P,R,T)=>{let w=a(g,M),A=a(E,P),I=a(R,T);e.bezierCurveTo(w.x,w.y,A.x,A.y,I.x,I.y);};if(m<=0||b<=0){h(u,c),d(l,c),d(l,f),d(u,f),e.closePath();return}let x=m*Lh,y=b*Lh;h(u+m,c),d(l-m,c),p(l-m+x,c,l,c+b-y,l,c+b),d(l,f-b),p(l,f-b+y,l-m+x,f,l-m,f),d(u+m,f),p(u+m-x,f,u,f-b+y,u,f-b),d(u,c+b),p(u,c+b-y,u+m-x,c,u+m,c),e.closePath();}function mE(e,t,n){let{view:r,inPath:o}=e;if(n>=32){let i=r.getInt32(t,true),s=r.getInt32(t+4,true),a=r.getInt32(t+8,true),u=r.getInt32(t+12,true),l=r.getInt32(t+16,true),c=r.getInt32(t+20,true),f=e.state.arcDirection===2,m=ca(e,i,s,a,u),b=ma(e,m,false,f),h=b?fa(m,b):m,d=Ee(e),p=b?Math.abs(l*d[0])*16:Dh(e,l,0),x=b?Math.abs(c*d[3])*16:Dh(e,c,1),y=(T,w,A)=>b&&w!==0?Math.floor(Math.min(T,w)*A/w):T,g=y(p,Math.abs((a-i)*d[0])*16,Math.abs(h.exx)),M=y(x,Math.abs((u-s)*d[3])*16,Math.abs(h.eyy)),E=b?h:Vl(e,i,s,a,u,true);!b&&E.exx!==m.exx&&Math.abs(m.exx)>0&&Math.abs(m.eyy)>0&&l!==0&&c!==0&&(g=Math.floor(Math.min(p,Math.abs(m.exx))*Math.abs(E.exx)/Math.abs(m.exx)),M=Math.floor(Math.min(x,Math.abs(m.eyy))*Math.abs(E.eyy)/Math.abs(m.eyy))),!b&&E.exx===m.exx&&E.eyy===m.eyy&&l!==0&&c!==0&&a!==i&&u!==s&&!ze(e)&&(E.cornerRatio=[Math.fround(Math.min(Math.abs(l),Math.abs(a-i))/Math.abs(a-i)),Math.fround(Math.min(Math.abs(c),Math.abs(u-s))/Math.abs(u-s))]);let P=b?T=>Wl(T,Math.min(h.ax,h.ax+h.exx)/16,Math.min(h.ay,h.ay+h.eyy)/16,Math.max(h.ax,h.ax+h.exx)/16,Math.max(h.ay,h.ay+h.eyy)/16,g/32,M/32,null):ze(e)?T=>Wl(T,i,s,a,u,l/2,c/2,(w,A)=>Be(e,w,A)):T=>Wl(T,He(e,i),$e(e,s),He(e,a),$e(e,u),Ze(e,l)/2,st(e,c)/2,null);if(b){let T=Math.abs((a-i)*d[0])*16,w=Math.abs((u-s)*d[3])*16;T>0&&w>0&&(h.cornerExact=[Math.min(p,T)*Math.abs(h.exx)/T,Math.min(x,w)*Math.abs(h.eyy)/w]);}let R=(T=h)=>sa(T,g,M,f,l===0||c===0);if(o){let T=E;l===0||c===0?Xl(e,T,f):(Uh(e,Cl(T,g,M,f),8),Dn(e).append(R(T)));}else ao(e),Qe(e,{build:T=>{T.beginPath(),P(T);},raster:()=>R(E),roundPen:true,fill:true,stroke:true});}return true}function Vl(e,t,n,r,o,i=false){let s=i?ca(e,t,n,r,o):ui(e,t,n,r,o);if(e.state.penStyle!==5)return s;let a=Ee(e);if(a[1]!==0||a[2]!==0)return s;let l=s.ax%16===0&&s.ay%16===0&&s.exx%16===0&&s.eyy%16===0?4:0,c=l,f=s.exx<0?-1:1,m=s.eyy<0?-1:1;return {ax:s.ax-l*f,ay:s.ay-c*m,exx:s.exx+2*l*f,exy:0,eyx:0,eyy:s.eyy+2*c*m}}function fE(e,t,n){let{view:r,inPath:o}=e;if(n>=24){let i=r.getInt32(t,true),s=r.getInt32(t+4,true),a=r.getInt32(t+8,true),u=r.getInt32(t+12,true),l=e.state.arcDirection===2,c=ca(e,i,s,a,u),f=ma(e,c,false,e.state.arcDirection===2),m=f?fa(c,f):c,b=f?{cx:(m.ax+m.exx/2)/16,cy:(m.ay+m.eyy/2)/16,rx:Math.abs(m.exx)/32,ry:Math.abs(m.eyy)/32,rotation:0}:ze(e)?qs(e,(i+a)/2,(s+u)/2,Math.abs(a-i)/2,Math.abs(u-s)/2):{cx:He(e,(i+a)/2),cy:$e(e,(s+u)/2),rx:Math.abs(Ze(e,a-i))/2,ry:Math.abs(st(e,u-s))/2,rotation:0};if(o){let h=m;Uh(e,chunk7JVB7NLG_js.x(h,l),6),Dn(e).append(li(h,l));}else ao(e),Qe(e,{build:h=>{h.beginPath(),h.ellipse(b.cx,b.cy,b.rx,b.ry,b.rotation,0,Math.PI*2);},raster:()=>li(f?m:Vl(e,i,s,a,u,true),l),roundPen:true,fill:true,stroke:true});}return true}function bE(e,t,n,r){let{ctx:o,view:i,state:s,inPath:a}=e;if(r>=40){let u=i.getInt32(n,true),l=i.getInt32(n+4,true),c=i.getInt32(n+8,true),f=i.getInt32(n+12,true),m=i.getInt32(n+16,true),b=i.getInt32(n+20,true),h=i.getInt32(n+24,true),d=i.getInt32(n+28,true),p=(u+c)/2,x=(l+f)/2,y=Math.abs(c-u)/2,g=Math.abs(f-l)/2,M=Math.atan2((b-x)/(g||1),(m-p)/(y||1)),E=s.arcDirection===2,P=t!==47&&y>0&&g>0&&rE(u,l,c,f,m,b,h,d),R=P?M+(E?2:-2)*Math.PI:Math.atan2((d-x)/(g||1),(h-p)/(y||1)),T=ze(e),w=ui(e,u,l,c,f);if(t!==55&&nE(e,w))return true;let A=ma(e,w,false,e.state.arcDirection===2),I=A?fa(w,A):w,S=A?{cx:(I.ax+I.exx/2)/16,cy:(I.ay+I.eyy/2)/16,rx:Math.abs(I.exx)/32,ry:Math.abs(I.eyy)/32,rotation:0}:T?qs(e,p,x,y,g):{cx:He(e,p),cy:$e(e,x),rx:Math.abs(Ze(e,y)),ry:Math.abs(st(e,g)),rotation:0},v=t===55,C=t===47||t===46,U=T?Be(e,p+y*Math.cos(M),x+g*Math.sin(M)):{x:S.cx+S.rx*Math.cos(M),y:S.cy+S.ry*Math.sin(M)},L=N=>{if(t===47?N.moveTo(S.cx,S.cy):!v&&a&&N.moveTo(U.x,U.y),v){if(!a){let Z=Ln(e);N.moveTo(Z[0]/16,Z[1]/16);}N.lineTo(U.x,U.y);}N.ellipse(S.cx,S.cy,S.rx,S.ry,S.rotation,M,R,!E),C&&N.closePath();},k=v?"arcto":t===47?"pie":t===46?"chord":"arc",F=(N,Z,J)=>{let K=c-u,ie=f-l;if(K===0||ie===0)return ge(e,Z,J);let ce=(Z-u)/K,$=(J-l)/ie;return [N.ax+N.exx*ce+N.eyx*$,N.ay+N.exy*ce+N.eyy*$]},_=Ee(e),H=_[0]*_[3]-_[1]*_[2]<0,G=_[1]===0&&_[2]===0,W=(N=false)=>{let Z=A?I:N&&C?Vl(e,u,l,c,f):w,J=Z.exx*Z.eyy-Z.exy*Z.eyx<0,K=G&&Tt(Z)?{x:_[0]<0,y:_[3]<0}:void 0;return {box:Z,mirror:K,clockwise:K?E:E!==(H!==J),s:F(Z,m,b),e:P?F(Z,m,b):F(Z,h,d),from:Ln(e)}};if(a){v&&so(e),L(Wt(e));let N=W();no(N.box,N.s,N.e,N.clockwise,k,N.from,Dn(e),N.mirror),C&&Dn(e).closeFigure();}else ao(e),o.beginPath(),Qe(e,{build:N=>{N.beginPath(),L(N);},raster:()=>{let N=W(true);return no(N.box,N.s,N.e,N.clockwise,k,N.from,void 0,N.mirror).path},fill:C,stroke:true});if(v){let N=W(),Z=no(N.box,N.s,N.e,N.clockwise,"arc",void 0,void 0,N.mirror).end,J=Math.floor(Z[0]/16),K=Math.floor(Z[1]/16),ie=sn(Ee(e));ie?(s.curX=Math.round(ie[0]*J+ie[2]*K+ie[4]),s.curY=Math.round(ie[1]*J+ie[3]*K+ie[5])):(s.curX=Math.round(p+y*Math.cos(R)),s.curY=Math.round(x+g*Math.sin(R))),e.curFix=a?{x:Z[0],y:Z[1],lx:s.curX,ly:s.curY}:{x:J*16,y:K*16,lx:s.curX,ly:s.curY};}}return true}function hE(e,t,n){let{view:r,state:o,inPath:i}=e;if(n<28)return true;let s=r.getInt32(t,true),a=r.getInt32(t+4,true),u=r.getUint32(t+8,true),l=r.getFloat32(t+12,true),c=r.getFloat32(t+16,true);if(!Number.isFinite(l)||!Number.isFinite(c)||u>2147483647)return true;let f=l*Math.PI/180,m=(l+c)*Math.PI/180,b=s+u*Math.cos(f),h=a-u*Math.sin(f),d=s+u*Math.cos(m),p=a-u*Math.sin(m),x=c<0,y=Math.min(8,Math.trunc(Math.abs(c)/360)),g=ui(e,s-u,a-u,s+u,a+u),M;if(Tt(g))M=chunk7JVB7NLG_js.D(g,l,c);else {M=[...ge(e,s+u*Math.cos(f),a-u*Math.sin(f))];for(let v of chunk7JVB7NLG_js.B(l,c)){let C=chunk7JVB7NLG_js.C(s,a,u,u,v.from,v.to);for(let U=0;U<6;U+=2)M.push(...ge(e,C[U],C[U+1]));}}let E=[M[M.length-2],M[M.length-1]],P=(v,C)=>{v.continueAt(C[0],C[1]),v.addBeziers(M,false);},R=qs(e,s,a,u,u),T=Be(e,b,h),w=v=>{if(v.lineTo(T.x,T.y),u===0)return;let C=Math.min(Math.abs(m-f),Math.PI*2*(y+1));v.ellipse(R.cx,R.cy,R.rx,R.ry,R.rotation,-f,x?-f+C:-f-C,!x);};if(i)so(e),w(Wt(e)),P(Dn(e),Ln(e));else {ao(e);let v=Ln(e),C=Be(e,o.curX,o.curY);Qe(e,{build:U=>{U.beginPath(),U.moveTo(C.x,C.y),w(U);},raster:()=>{let U=new chunk7JVB7NLG_js.F;return P(U,v),U},fill:false,stroke:true});}let A=Math.floor(E[0]/16),I=Math.floor(E[1]/16),S=sn(Ee(e));return o.curX=Math.round(S?S[0]*A+S[2]*I+S[4]:d),o.curY=Math.round(S?S[1]*A+S[3]*I+S[5]:p),e.curFix=i?{x:E[0],y:E[1],lx:o.curX,ly:o.curY}:{x:A*16,y:I*16,lx:o.curX,ly:o.curY},true}function kh(e,t,n,r){switch(t){case 15:return oE(e,n,r);case 27:return iE(e,n,r);case 54:return sE(e,n,r);case 43:return lE(e,n,r);case 44:return mE(e,n,r);case 42:return fE(e,n,r);case 41:return hE(e,n,r);case 45:case 55:case 46:case 47:return bE(e,t,n,r);default:return false}}var dE=[[238,110,198,70,229,102,204,76,236,108,195,69,228,100,205,78],[46,174,7,134,39,166,12,140,45,171,5,132,36,164,15,142],[209,83,249,122,218,90,239,112,208,80,247,120,215,88,242,114],[18,146,59,185,26,154,49,176,16,144,56,184,25,152,50,178],[226,98,202,74,233,107,192,64,224,96,200,73,232,104,194,66],[35,162,11,138,42,170,1,128,32,160,8,136,40,168,2,130],[219,91,243,115,211,83,253,125,221,93,245,117,212,85,250,123],[28,154,52,178,19,147,61,188,29,157,53,181,22,149,59,187],[235,107,195,67,226,100,205,77,236,109,197,69,229,101,202,76],[43,171,4,131,35,163,14,141,45,173,5,133,38,164,11,139],[207,79,246,119,215,87,240,113,209,81,249,121,216,90,239,111],[15,143,56,183,23,151,49,177,18,145,57,185,25,153,47,175],[222,95,198,71,231,103,193,66,225,97,201,73,232,105,191,63],[32,159,8,135,39,167,1,129,33,161,9,137,42,169,1,127],[222,94,246,118,214,86,252,124,219,92,243,116,212,84,253,126],[30,158,54,181,22,150,60,188,28,156,52,180,21,147,62,190]],pE=66,_h=65;function xE(e){return e<63?e%16:e<=64?14:15}function yE(e){return e<63?e%16:e===63?14:15}var ba=(e,t)=>(e%t+t)%t;function zl(e,t){let n=ba(e-t-2,65);return n<63?n:n+1}function ql(e,t){return ba(e-t-2,_h)}function ha(e,t,n,r){return dE[yE(ba(t+r,_h))][xE(ba(e+n,pE))]}function gE(e){return Math.round(e*255/31)}function uo(e,t){let n=Math.floor((31*e+t)/255);return gE(n<0?0:n>31?31:n)}function ME(e,t,n){return n===e?16777216|n>>2<<8|t>>2:n|t<<8|e<<16}function da(e,t,n){if(t<=0||n<=0)return "replicate";let r=t*n;if(r<=2304)return "replicate";let o=b=>ME(e[b*3],e[b*3+1],e[b*3+2]),i=new Set;if(r>16384){for(let b=0;b<n;b+=6){for(let h=0;h<t;h++)i.add(o(b*t+h));if(i.size>=20)return "filter"}return "replicate"}let s=Math.floor(2304/t)+1;if(n<s)return "replicate";let a=n===s,u=a?289+Math.floor((s*t-2304)/8):145+Math.floor((s*t-2304)/16),l=0,c=0,f=0,m=false;for(let b=0;b<n;b++){let h=0;for(let d=0;d<t;d++){let p=o(b*t+d);i.has(p)||(i.add(p),h++);}if(l+=h,!m&&l>=u||(h===0?c++:f+=t,l>=20&&f>2304&&!(a&&m)))return "filter";(a?l+c*t>=u-1:l+(c+1)*t>=r-2305+u)&&(m=true);}return "replicate"}var Jl=1,Bh=2;var Rr=4;function di(e,t,n){let r=Math.floor((2*e+1)*t/(2*n));return Math.max(0,Math.min(t-1,r))}function Gh(e,t,n,r,o){let i=[],s=u=>r?e+t-1-u:e+u;if(n<=0||t<=0)return i;let a=-1;for(let u=0;u<n;u++){let l=di(u,t,n),c=[],f=o&&n<t?a+1:l;for(let m=f;m<=l;m++)c.push(s(m));i.push(c),a=l;}return i}function Hh(e,t,n,r,o,i,s,a){let u=Math.max(0,Math.round(Math.abs(i))),l=Math.max(0,Math.round(Math.abs(s))),c=i<0!=r<0,f=s<0!=o<0,m=a===Jl||a===Bh,b=Gh(Math.round(Math.min(t,t+r)),Math.round(Math.abs(r)),u,c,m),h=Gh(Math.round(Math.min(n,n+o)),Math.round(Math.abs(o)),l,f,m),d=new Uint8ClampedArray(u*l*4),p=e.data,x=(y,g)=>{if(y<0||g<0||y>=e.width||g>=e.height)return 0;let M=(g*e.width+y)*4;return p[M]<<16|p[M+1]<<8|p[M+2]};for(let y=0;y<l;y++){chunkDO2CGP4P_js.c();let g=h[y]??[];for(let M=0;M<u;M++){let E=b[M]??[],P=a===Jl?16777215:0,R=true;for(let w of g)for(let A of E){let I=x(A,w);a===Jl?P&=I:a===Bh?P|=I:R&&(P=I),R=false;}let T=(y*u+M)*4;d[T]=P>>16&255,d[T+1]=P>>8&255,d[T+2]=P&255,d[T+3]=255;}}return {width:u,height:l,data:d}}var lo=65536;function Zl(e,t,n){let r=(2*e+1)*t,o=2*n,i=Math.floor(r/o);return i*o===r&&i--,Math.max(0,Math.min(t-1,i))}function $h(e,t,n,r){let o=[];if(n<=0||t<=0)return o;let i=a=>e+a;if(n>=t){for(let a=0;a<n;a++)o.push([[i(Zl(a,t,n)),1]]);return r&&o.reverse(),o}let s=Math.ceil(t*lo/n);for(let a=0;a<n;a++){let u=a*s,l=(a+1)*s,c=[];for(let f=Math.floor(u/lo);f*lo<l&&f<t;f++){let m=Math.min(l,(f+1)*lo)-Math.max(u,f*lo);m>0&&c.push([i(f),m]);}o.push(c);}return r&&o.reverse(),o}var EE=13;function hi(e,t,n){if(t>=e)return $h(0,e,t,n);let r=2**EE,o=lo/r,i=[];for(let s=0;s<t;s++){let a=s*e,u=(s+1)*e,l=[];for(let c=Math.floor(a/t);c*t<u;c++){let f=Math.max(a,c*t)-a,m=Math.min(u,(c+1)*t)-a;m<=f||l.push([c,(Math.floor(m*r/e)-Math.floor(f*r/e))*o]);}i.push(l);}return n&&i.reverse(),i}function PE(e){if(e>=1)return 0;let t=1-e;return Math.abs(e-.5)<1e-9?t:Math.pow(t,e<.5?Math.SQRT1_2:Math.SQRT2)}function Xh(e,t){return RE(e,t).map(n=>{let r=0;return n.map(([o,i],s)=>{let a=s===n.length-1?8192:Math.ceil(i-1e-7),u=a-r;return r=a,[o,u/8192]})})}function RE(e,t){let n=t/e,r=Math.ceil(n)-1,o=[],i=0;for(let u=0;u<=r;u++){let l=PE(u/n);o.push(l),i+=u===0?l:2*l;}let s=[];for(let u=0;u<t;u++){let l=u/n,c=(u+1)/n,f=[];for(let m=Math.max(0,Math.floor(l));m<Math.min(e,c);m++){let b=Math.min(c,m+1)-Math.max(l,m);b>0&&f.push([m,b*n]);}s.push(f);}let a=[];for(let u=0;u<t;u++){let l=new Map;for(let m=-r;m<=r;m++){let b=o[Math.abs(m)]/i;if(b!==0)for(let[h,d]of s[Math.max(0,Math.min(t-1,u+m))])l.set(h,(l.get(h)??0)+b*d);}let c=[...l.entries()].sort((m,b)=>m[0]-b[0]),f=0;a.push(c.map(([m,b])=>(f+=b*8192,[m,f])));}return a}function Pr(e,t,n,r,o,i,s,a){for(let u=0;u<n;u++){let l=a?a[u]:u;for(let c=0;c<t;c++){let f=s?s[c]:c,m=ha(r.startX,r.startY,f,l),b=(u*t+c)*3;e[b]=uo(e[b],m),e[b+1]=uo(e[b+1],m),e[b+2]=uo(e[b+2],m);}}}function Oh(e,t,n){if(t<2||n<2)return;let r=e.slice(),o=(l,c)=>{let f=l<0?-l:l>=t?2*(t-1)-l:l,m=c<0?-c:c>=n?2*(n-1)-c:c;return (Math.max(0,Math.min(n-1,m))*t+Math.max(0,Math.min(t-1,f)))*3},i=(l,c)=>r[l]===r[c]&&r[l+1]===r[c+1]&&r[l+2]===r[c+2],s=t+1,a=new Uint8Array(s*(n+1));for(let l=-1;l<n;l++)for(let c=-1;c<t;c++){let f=o(c,l),m=o(c+1,l),b=o(c,l+1),h=o(c+1,l+1);a[(l+1)*s+c+1]=i(f,h)&&i(m,b)&&!i(f,m)?1:0;}let u=(l,c)=>a[(c+1)*s+l+1]===1;for(let l=0;l<n-1;l++)for(let c=0;c<t-1;c++){if(!u(c,l))continue;let f=o(c,l),m=o(c+1,l),b=[[c,l,1,1,true],[c+1,l+1,-1,-1,true],[c+1,l,-1,1,false],[c,l+1,1,-1,false]];if(u(c-1,l)&&u(c+1,l)||u(c,l-1)&&u(c,l+1)){for(let[d,p]of b){let x=(p*t+d)*3;for(let y=0;y<3;y++)e[x+y]=r[f+y]+r[m+y]+1>>1;}continue}let h=4*(r[f]-r[m])+8*(r[f+1]-r[m+1])+(r[f+2]-r[m+2]);for(let[d,p,x,y,g]of b){if(g?h<0:h>=0)continue;let M=(p*t+d)*3,E=o(d+x,p),P=o(d,p+y),R=o(d+2*x,p),T=o(d,p+2*y);for(let w=0;w<3;w++)e[M+w]=12*e[M+w]+r[E+w]+r[P+w]+r[R+w]+r[T+w]+8>>4;}}}function TE(e,t,n){let r=e.slice(),o=(i,s,a)=>r[(Math.max(0,Math.min(n-1,s))*t+Math.max(0,Math.min(t-1,i)))*3+a];for(let i=0;i<n;i++){chunkDO2CGP4P_js.c();for(let s=0;s<t;s++)for(let a=0;a<3;a++){let u=o(s,i,a),l=o(s-1,i,a)+o(s+1,i,a)+o(s,i-1,a)+o(s,i+1,a),c=u+Math.floor((4*u-l)/8);e[(i*t+s)*3+a]=c<0?0:c>255?255:c;}}}function wE(e,t,n,r){let o=r?t:n,i=(l,c)=>(r?c*t+l:l*t+c)*3,s=(l,c)=>e[l]===e[c]&&e[l+1]===e[c+1]&&e[l+2]===e[c+2],a=l=>l>=0&&l+1<o&&s(i(l,0),i(l+1,1))&&s(i(l,1),i(l+1,0))&&!s(i(l,0),i(l,1)),u=Array.from({length:o},(l,c)=>a(c-1)||a(c));for(let l=0;l<o;l++){if(!u[l])continue;let c=i(l,0),f=i(l,1);for(let m=0;m<3;m++)e[c+m]=e[f+m]=e[c+m]+e[f+m]+1>>1;}}function Nh(e,t,n,r){let o=r?t:n,i=new Int32Array(o*3);for(let s=0;s<o;s++){let a=(r?t+s:s*t+1)*3;for(let u=0;u<3;u++)i[s*3+u]=e[a+u];}return i}function AE(e,t,n,r,o,i,s){let a=hi(t,r,i),u=hi(n,o,s),l=new Int32Array(r*n*3);for(let b=0;b<n;b++){chunkDO2CGP4P_js.c();for(let h=0;h<r;h++){let d=0;for(let[,p]of a[h])d+=p;for(let p=0;p<3;p++){let x=0;for(let[y,g]of a[h])x+=e[(b*t+y)*3+p]*g;l[(b*r+h)*3+p]=Math.floor((2*x+d)/(2*d));}}}let c=new Float64Array(r*o*3);for(let b=0;b<o;b++){let h=0;for(let[,d]of u[b])h+=d;for(let d=0;d<r;d++)for(let p=0;p<3;p++){let x=0;for(let[y,g]of u[b])x+=l[(y*r+d)*3+p]*g;c[(b*r+d)*3+p]=x/h;}}let f=(b,h,d)=>c[(Math.max(0,Math.min(o-1,h))*r+Math.max(0,Math.min(r-1,b)))*3+d],m=new Int32Array(r*o*3);for(let b=0;b<o;b++)for(let h=0;h<r;h++)for(let d=0;d<3;d++){let p=f(h,b,d),x=f(h-1,b,d)+f(h+1,b,d)+f(h,b-1,d)+f(h,b+1,d);m[(b*r+h)*3+d]=Math.max(0,Math.min(255,Math.floor(p+(4*p-x)/8)));}return m}function IE(e,t,n,r,o,i,s){let a=o<n,u=a?hi(n,o,s):hi(t,r,i),l=new Float64Array(r*o*3);for(let m=0;m<o;m++)for(let b=0;b<r;b++){let h=a?u[m]:u[b],d=a?i?r-1-b:b:s?o-1-m:m,p=0;for(let[,x]of h)p+=x;for(let x=0;x<3;x++){let y=0;for(let[g,M]of h)y+=e[((a?g:d)*t+(a?d:g))*3+x]*M;l[(m*r+b)*3+x]=y/p;}}let c=new Int32Array(r*o*3),f=(m,b,h)=>l[(Math.max(0,Math.min(o-1,b))*r+Math.max(0,Math.min(r-1,m)))*3+h];for(let m=0;m<o;m++)for(let b=0;b<r;b++)for(let h=0;h<3;h++){let d=f(b,m,h),p=a?f(b,m-1,h)+f(b,m+1,h):f(b-1,m,h)+f(b+1,m,h);c[(m*r+b)*3+h]=Math.max(0,Math.min(255,Math.floor(d+(2*d-p)/4)));}return c}var jh={1:[[5,22,5,32]],2:[[4,12,0,16],[0,12,4,16]],3:[[6,10,0,16],[1,14,1,16],[0,10,6,16]],4:[[6,10,0,16],[3,12,1,16],[1,12,3,16],[0,10,6,16]],5:[[13,19,0,32],[6,25,1,32],[3,26,3,32],[1,25,6,32],[0,19,13,32]]};function Kl(e,t){if(t/e===2){let r=jh[2].map(([o,i,s])=>[o*512,i*512,s*512]);return Array.from({length:t},(o,i)=>{let s=Math.floor(i/2),[a,u,l]=r[i%2];return [[Math.max(0,s-1),a],[s,u],[Math.min(e-1,s+1),l]]})}return Xh(e,t).map(r=>r.map(([o,i])=>[o,Math.round(i*8192)]))}function SE(e,t,n,r,o,i){let s=r>t,a=s?t:n,u=new Int32Array(e.length),l=(m,b,h)=>b>=n&&i?i[Math.max(0,Math.min(t-1,m))*3+h]:e[(Math.max(0,Math.min(n-1,b))*t+Math.max(0,Math.min(t-1,m)))*3+h];for(let m=0;m<n;m++){chunkDO2CGP4P_js.c();for(let b=0;b<t;b++)for(let h=0;h<3;h++){let d=l(b,m,h),p=s?l(b-1,m,h)+l(b+1,m,h):l(b,m-1,h)+l(b,m+1,h),x=d+Math.floor((2*d-p)/4);u[(m*t+b)*3+h]=x<0?0:x>255?255:x;}}let c=Kl(a,s?r:o),f=new Int32Array(r*o*3);for(let m=0;m<o;m++)for(let b=0;b<r;b++)for(let h=0;h<3;h++){let d=0;if(s)for(let[p,x]of c[b])d+=x*u[(m*t+p)*3+h];else for(let[p,x]of c[m])d+=x*u[(p*t+b)*3+h];f[(m*r+b)*3+h]=Math.floor((d+4096)/8192);}return f}function Wh(e,t){let n=Array.from({length:t},(i,s)=>Zl(s,e,t)),r=new Map;for(let i of n)r.set(i,(r.get(i)??0)+1);let o=new Map;return n.map(i=>{let s=o.get(i)??0;return o.set(i,s+1),{k:i,weights:jh[r.get(i)][s]}})}function vE(e,t,n,r){return e>0&&t>0&&n>=e&&r>=t&&(n>e||r>t)}function CE(e,t,n,r,o,i,s){if(r>5*t||o>5*n){let u=new Int32Array((n+1)*t*3);return u.set(e),u.set(e.subarray((n-1)*t*3),n*t*3),Pr(u,t,n+1,i,false,false,void 0,Int32Array.from({length:n+1},(l,c)=>s?o-1-c:c)),u}let a=new Int32Array((n+4)*t*3);return a.set(e.subarray(0,t*3),0),a.set(e.subarray(0,t*3),t*3),a.set(e,2*t*3),a.set(e.subarray((n-1)*t*3),(n+2)*t*3),a.set(e.subarray((n-1)*t*3),(n+3)*t*3),Pr(a,t,n+4,{startX:i.startX,startY:(i.startY+(s?63:2))%65},false,false,void 0,Int32Array.from({length:n+4},(u,l)=>s?o-l+1:l-2)),a}function DE(e,t,n,r,o,i){if(r===t||o===n)return SE(e,t,n,r,o,i&&i.length===(n+1)*t*3?i.subarray(n*t*3):void 0);let s=x=>x<0?0:x>255?255:x,a=r>5*t||o>5*n,u=new Int32Array(r*o*3);if(a){let x=e.slice();if(i){let E=(P,R,T)=>i[(Math.max(0,Math.min(n,R))*t+Math.max(0,Math.min(t-1,P)))*3+T];for(let P=0;P<n;P++)for(let R=0;R<t;R++)for(let T=0;T<3;T++){let w=E(R,P,T),A=E(R-1,P,T)+E(R+1,P,T)+E(R,P-1,T)+E(R,P+1,T);x[(P*t+R)*3+T]=s(w+Math.floor((4*w-A)/8));}}else TE(x,t,n);let y=Kl(t,r),g=Kl(n,o),M=new Int32Array(r*n*3);for(let E=0;E<n;E++)for(let P=0;P<r;P++)for(let R=0;R<3;R++){let T=0;for(let[w,A]of y[P])T+=A*x[(E*t+w)*3+R];M[(E*r+P)*3+R]=Math.floor((T+4096)/8192);}for(let E=0;E<o;E++)for(let P=0;P<r;P++)for(let R=0;R<3;R++){let T=0;for(let[w,A]of g[E])T+=A*M[(w*r+P)*3+R];u[(E*r+P)*3+R]=s(Math.floor((T+4096)/8192));}return u}let l=n+2,c=new Int32Array(t*l*3),f;i&&i.length===(n+4)*t*3?f=i:(f=new Int32Array(t*(n+4)*3),i&&i.length===l*t*3?(f.set(i.subarray(t*3,2*t*3),0),f.set(i,t*3),f.set(i.subarray(n*t*3,(n+1)*t*3),(n+3)*t*3)):(f.set(e.subarray(0,t*3),0),f.set(e.subarray(0,t*3),t*3),f.set(e,2*t*3),f.set(e.subarray((n-1)*t*3),(n+2)*t*3),f.set(e.subarray((n-1)*t*3),(n+3)*t*3)));let m=f,b=(x,y,g)=>m[((y+1)*t+Math.max(0,Math.min(t-1,x)))*3+g];for(let x=0;x<l;x++)for(let y=0;y<t;y++)for(let g=0;g<3;g++){let M=b(y,x,g),E=b(y-1,x,g)+b(y+1,x,g)+b(y,x-1,g)+b(y,x+1,g);c[(x*t+y)*3+g]=s(M+Math.floor((4*M-E)/8));}let h=Wh(t,r),d=Wh(n,o),p=new Int32Array(t*3);for(let x=0;x<o;x++){let y=d[x].k+1,[g,M,E,P]=d[x].weights,R=(y-1)*t*3,T=y*t*3,w=(y+1)*t*3;for(let A=0;A<t*3;A++)p[A]=Math.floor((g*c[R+A]+M*c[T+A]+E*c[w+A]+P/2)/P);for(let A=0;A<r;A++){let I=h[A].k,[S,v,C,U]=h[A].weights,L=Math.max(0,I-1),k=Math.min(t-1,I+1);for(let F=0;F<3;F++)u[(x*r+A)*3+F]=Math.floor((S*p[L*3+F]+v*p[I*3+F]+C*p[k*3+F]+U/2)/U);}}return u}function LE(e,t,n,r,o){let i=r>t&&o*2<=n||o>n&&r*2<=t,s=o<n&&3*o+2<=2*n||r<t&&3*r+2<=2*t;if(i||s)return "reduced";let a=t*n<=2304;return !a&&da(e,t,n)==="filter"?"reduced":r*o<t*n?a?"despeckled":"reduced":"nearest"}function Yh(e,t,n,r,o,i,s,a,u=false,l=false,c,f){let m=Math.max(0,Math.round(Math.abs(i))),b=Math.max(0,Math.round(Math.abs(s))),h=Math.round(Math.abs(r)),d=Math.round(Math.abs(o)),p=Math.round(Math.min(t,t+r)),x=Math.round(Math.min(n,n+o)),y=i<0!=r<0,g=s<0!=o<0,M=new Uint8ClampedArray(m*b*4);if(m===0||b===0||h===0||d===0)return {width:m,height:b,data:M};let E=new Int32Array(h*d*3);for(let $=0;$<d;$++){let X=x+$;for(let B=0;B<h;B++){let O=p+B;if(X<0||X>=e.height||O<0||O>=e.width)continue;let j=(X*e.width+O)*4,q=($*h+B)*3;E[q]=e.data[j],E[q+1]=e.data[j+1],E[q+2]=e.data[j+2];}}let P=d===2&&b===1&&m>h&&(!a||u||!!c),R=h===2&&m===1&&b>d&&(!a||u||!!c);(P||R)&&(l||wE(E,h,d,P),P&&m>=2*h?(E=Nh(E,h,d,true),d=1):R&&b>=2*d&&(E=Nh(E,h,d,false),h=1));let T=m>=h&&b>=d&&(m>h||b>d),w=m<h&&b<d,A=m>h&&b<d||m<h&&b>d,I=!!c&&!!a&&!u,S=A&&(!a||u||I),v=S?LE(E,h,d,m,b):"nearest",C=S&&v==="nearest"&&(m<h&&m*2>h||b<d&&b*2>d),U=S&&v!=="nearest",L=h*d<=2304||h*d>16384,k=m<h&&b===d||b<d&&m===h,F=(w||k)&&L&&!l&&!(m<h&&3*m+2<=2*h)&&!(b<d&&3*b+2<=2*d)&&(h*d<=2304||da(E,h,d)==="replicate");if(k&&(!a||u||I)){F&&Oh(E,h,d);let $=IE(E,h,d,m,b,y,g);I?(Pr($,m,b,c),a($),f&&f($)):a&&a($);for(let X=0,B=0;X<m*b;X++,B+=3)M[X*4]=$[B],M[X*4+1]=$[B+1],M[X*4+2]=$[B+2],M[X*4+3]=255;return {width:m,height:b,data:M}}if(T&&vE(h,d,m,b)&&(!a||u||I)&&da(E,h,d)==="filter"){let $,X=E;I&&(m===h||b===d?b>d?($=new Int32Array((d+1)*h*3),$.set(E),$.set(E.subarray((d-1)*h*3),d*h*3),Pr($,h,d+1,c,false,false,void 0,Int32Array.from({length:d+1},(O,j)=>g?b-1-j:j)),a($),X=$.subarray(0,h*d*3)):(X=E.slice(),Pr(X,h,d,c,false,false,void 0,Int32Array.from({length:d},(O,j)=>g?b-1-j:j)),a(X)):($=CE(E,h,d,m,b,c,g),a($)));let B=DE(X,h,d,m,b,$);if(y||g){let O=B.slice();for(let j=0;j<b;j++)for(let q=0;q<m;q++){let ae=((g?b-1-j:j)*m+(y?m-1-q:q))*3;B.set(O.subarray(ae,ae+3),(j*m+q)*3);}}a&&u&&a(B),f&&I&&f(B);for(let O=0,j=0;O<m*b;O++,j+=3)M[O*4]=B[j],M[O*4+1]=B[j+1],M[O*4+2]=B[j+2],M[O*4+3]=255;return {width:m,height:b,data:M}}((T||C||v==="despeckled")&&L||w&&F)&&!l&&!P&&!R&&Oh(E,h,d);let _=I&&(m>=h&&b>=d||U&&m*b>=h*d),H=_&&U&&m<h&&b>d;if(H){let $=new Int32Array((d+1)*h*3);$.set(E),$.copyWithin(d*h*3,(d-1)*h*3,d*h*3),E=$;}_&&Pr(E,h,H?d+1:d,c,false,false,void 0,g?Int32Array.from({length:H?d+1:d},($,X)=>b-1-X):void 0),a&&!u&&(!I||_)&&a(E);let G=U?Math.min(h,m):m,W=U?Math.min(d,b):b,N=U?($,X,B)=>hi($,X,B):($,X,B)=>$h(0,$,X,B),Z=U&&m>h,J=U&&b>d,K=N(h,G,y&&!Z),ie=N(d,W,g&&!J);if(C){let $=(X,B,O,j)=>{for(let q=0;q<O;q++){let ae=j?O-1-q:q,se=O<B?Math.floor(((ae+1)*2*B-O)/(2*O)):Zl(ae,B,O);X[q]=[[Math.max(0,Math.min(B-1,se)),1]];}};$(K,h,m,y),$(ie,d,b,g);}else if(A&&!U){let $=(X,B,O,j)=>{if(!(O<=B))for(let q=0;q<O;q++){let ae=Math.max(0,Math.min(B-1,(q+.5)*B/O-.5)),se=Math.floor(ae),de=ae-se,me=ee=>j?B-1-ee:ee;X[q]=[[me(se),1-de],[me(Math.min(B-1,se+1)),de]];}};$(K,h,m,y),$(ie,d,b,g);}let ce=U?new Float64Array(G*W*3):new Int32Array(m*b*3);w&&(ce=AE(E,h,d,m,b,y,g));for(let $=0;!w&&$<W;$++){let X=ie[$];for(let B=0;B<G;B++){let O=K[B],j=0,q=0,ae=0,se=0;for(let[ee,le]of X)for(let[xe,Je]of O){let At=Je*le;se+=At;let et=(ee*h+xe)*3;j+=E[et]*At,q+=E[et+1]*At,ae+=E[et+2]*At;}let de=($*G+B)*3,me=ee=>U?ee/se:A?Math.ceil(ee/se-.5):Math.floor((2*ee+se)/(2*se));ce[de]=me(j),ce[de+1]=me(q),ce[de+2]=me(ae);}}if(U){let $=m<h,X;if(H){let ae=new Float64Array(G*3);for(let se=0;se<G;se++){let de=0,me=[0,0,0];for(let[ee,le]of K[se]){de+=le;for(let xe=0;xe<3;xe++)me[xe]+=E[(d*h+ee)*3+xe]*le;}for(let ee=0;ee<3;ee++)ae[se*3+ee]=me[ee]/de;}X=ae;}for(let ae of [$,!$]){let se=ce;ce=new Int32Array(se.length);let de=X,me=(ee,le,xe)=>le>=W&&de?de[Math.max(0,Math.min(G-1,ee))*3+xe]:se[(Math.max(0,Math.min(W-1,le))*G+Math.max(0,Math.min(G-1,ee)))*3+xe];if(ae&&de){let ee=new Int32Array(G*3);for(let le=0;le<G;le++)for(let xe=0;xe<3;xe++){let Je=de[le*3+xe],At=me(le-1,W,xe)+me(le+1,W,xe);ee[le*3+xe]=Math.max(0,Math.min(255,Math.floor(Je+(2*Je-At)/4)));}X=ee;}for(let ee=0;ee<W;ee++)for(let le=0;le<G;le++)for(let xe=0;xe<3;xe++){let Je=me(le,ee,xe),At=ae?me(le-1,ee,xe)+me(le+1,ee,xe):me(le,ee-1,xe)+me(le,ee+1,xe);ce[(ee*G+le)*3+xe]=Math.max(0,Math.min(255,Math.floor(Je+(2*Je-At)/4)));}}let B=ce;ce=new Int32Array(m*b*3);let O=(ae,se)=>ae===se?Array.from({length:se},(de,me)=>[[me,1]]):se===2*ae?Array.from({length:se},(de,me)=>{let ee=Math.max(0,Math.min(ae-1,(me+.5)*ae/se-.5)),le=Math.floor(ee);return [[le,1-(ee-le)],[Math.min(ae-1,le+1),ee-le]]}):Xh(ae,se),j=O(G,m),q=O(W,b);Z&&y&&j.reverse(),J&&g&&q.reverse();for(let ae=0;ae<b;ae++)for(let se=0;se<m;se++)for(let de=0;de<3;de++){let me=0;for(let[ee,le]of q[ae])for(let[xe,Je]of j[se])me+=B[(ee*G+xe)*3+de]*le*Je;ce[(ae*m+se)*3+de]=Math.max(0,Math.min(255,Math.floor(me+.5+1e-7)));}}if(A&&!U&&!C){let $=ce.slice(),X=(B,O,j)=>$[(Math.max(0,Math.min(b-1,O))*m+Math.max(0,Math.min(m-1,B)))*3+j];for(let B=0;B<b;B++)for(let O=0;O<m;O++)for(let j=0;j<3;j++){let q=X(O,B,j),ae=m<h?X(O-1,B,j)+X(O+1,B,j):X(O,B-1,j)+X(O,B+1,j);ce[(B*m+O)*3+j]=Math.max(0,Math.min(255,q+Math.floor((2*q-ae)/4)));}}if(I&&!_){let $=(j,q,ae,se)=>Int32Array.from({length:j},(de,me)=>ae>q?Math.max(0,Math.ceil((2*me+1)*q/(2*ae))-1):se?Math.max(0,Math.min(q-1,Math.floor(((me+1)*2*q-ae)/(2*ae)))):me),X=C&&m*b>h*d,B=X?$(m,h,m,true):void 0,O=X?$(b,d,b,false):void 0;B&&y&&(B=B.slice().reverse()),O&&g&&b>d&&(O=O.slice().reverse().map(j=>b-1-j)),Pr(ce,m,b,c,false,false,B,O),a(ce);}a&&u&&a(ce),f&&I&&f(ce);for(let $=0,X=0;$<m*b;$++,X+=3)M[$*4]=ce[X],M[$*4+1]=ce[X+1],M[$*4+2]=ce[X+2],M[$*4+3]=255;return {width:m,height:b,data:M}}function pa(e,t){if(t.kind==="solid")return t.rgb;if(t.kind==="none")return 0;let{state:n,bounds:r}=e,o=e.sx||1,i=e.sy||1;return (s,a)=>chunk7JVB7NLG_js.i(t,Math.floor(r.left+(s+.5)/o),Math.floor(r.top+(a+.5)/i),n.brushOrgX,n.brushOrgY)}function Kh(e,t,n,r,o,i,s,a){let u=Math.min(n.dx,n.dx+n.dw)-r,l=Math.min(n.dy,n.dy+n.dh)-o,c=i===Rr?Yh(t.pixels,n.sx,n.sy,n.sw,n.sh,n.dw,n.dh,t.adjust,t.adjustAfterSampling,n.dibOrigin==="bottom-left",t.adjust&&!t.adjustAfterSampling?{startX:zl(Math.min(n.dx,n.dx+n.dw),s),startY:ql(Math.min(n.dy,n.dy+n.dh),a)}:void 0,t.curves):Hh(t.pixels,n.sx,n.sy,n.sw,n.sh,n.dw,n.dh,i);if(c.width===0||c.height===0)return;let f=chunk7JVB7NLG_js.Y(c.width,c.height);f&&(chunk7JVB7NLG_js.la(f.ctx,chunk7JVB7NLG_js.na(c.data,c.width,c.height),0,0),e.save(),e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation="source-over",chunk7JVB7NLG_js.ja(e,f.canvas,Math.round(u),Math.round(l),c.width,c.height),e.restore());}function tc(e,t,n=false){if(!t.source)return null;let r=chunk7JVB7NLG_js.d(e.view,t.source.bmi,t.source.bits,t.source.cbBits,t.source.palColors?tn(e.state):null);if(!r)return null;let o=e.state.colorAdjustment;t.stretch&&e.state.stretchBltMode===Rr&&e.halftoneRotatedAdjusts===void 0&&(e.halftoneRotatedAdjusts=!n&&!!o);let i=t.stretch&&e.state.stretchBltMode===Rr&&o,s=ib(o),a=i&&!s?ab(o):void 0,u=i?(f=>Ou(f,a?.palette??o)):void 0,l=a?.curves,{sy:c}=t;return t.dibOrigin==="bottom-left"&&e.view.getInt32(t.source.bmi+8,true)>0&&(c=r.height-c-t.sh),{decoded:{pixels:r,adjust:u,adjustAfterSampling:s,curves:l?f=>Ou(f,l):void 0},req:{...t,sy:c}}}function Ql(e,t,n,r){let o=e.globalCompositeOperation,i=e.fillStyle;e.save(),e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation=n,e.fillStyle=t,e.fillRect(r.dx,r.dy,r.dw,r.dh),e.restore(),e.globalCompositeOperation=o,e.fillStyle=i;}var Vh={136:[204,"multiply"],34:[51,"multiply"],238:[204,"screen"],187:[51,"screen"],102:[204,"difference"],153:[51,"difference"],160:[240,"multiply"],10:[15,"multiply"],250:[240,"screen"],175:[15,"screen"],90:[240,"difference"],165:[15,"difference"]};function UE(e,t,n,r,o){let{ctx:i}=e,s=mh(t.dx,t.dy,t.dw,t.dh,e.canvasW,e.canvasH);if(!s)return;if(typeof i.getImageData!="function"){chunk7JVB7NLG_js.q("runTernary: context cannot read pixels back; ROP3 skipped");return}let a="source-over";if(!chunk7JVB7NLG_js.qa(i)&&fn(n).usesD){let d=Vh[n];if(!d){chunk7JVB7NLG_js.q(`runTernary: ROP3 0x${n.toString(16)} needs the destination, which SVG output without a raster mirror cannot read; skipped`);return}[n,a]=d,r=fn(n).usesP,o=fn(n).usesS;}let u=chunk7JVB7NLG_js.h(e.state);if(r&&u.kind==="none")return;let l=chunk7JVB7NLG_js.Y(s.w,s.h);if(!l)return;let c=null;if(o){let d=tc(e,t);if(!d)return;Kh(l.ctx,d.decoded,d.req,s.x,s.y,e.state.stretchBltMode,e.state.brushOrgX,e.state.brushOrgY),c=chunk7JVB7NLG_js.ka(l.ctx,0,0,s.w,s.h);}let f=chunk7JVB7NLG_js.ka(i,s.x,s.y,s.w,s.h),m=pa(e,u);ch(f,c,m,n,s.x,s.y);let b=a==="source-over"&&fn(n).usesD?Ks(i,s):null,h=[];if(b){let d=c?c.data:null,p=g=>typeof m=="number"?m:m(s.x+g%s.w,s.y+Math.floor(g/s.w)),x=g=>d?d[g*4]<<16|d[g*4+1]<<8|d[g*4+2]:0,y=Vh[n];h=Zs(f.data,s.w*s.h,b,(g,M)=>qe(n,p(g),x(g),M),y?g=>({color:qe(y[0],p(g),x(g),0),mode:y[1]}):void 0);}chunk7JVB7NLG_js.la(l.ctx,f,0,0),i.save(),i.setTransform(1,0,0,1,0,0),i.globalCompositeOperation=a,i.globalAlpha=1,chunk7JVB7NLG_js.ja(i,l.canvas,s.x,s.y,s.w,s.h),i.restore(),Qs(i,s,h);}function ec(e,t,n){return Math.sign(e!==0?e:t!==0?t:n)}function zh(e,t,n,r){return ec(e,n,r)>=0&&ec(e-t,n,r)<0}function qh(e,t,n,r){let o=Math.floor(e/t);return e===o*t&&ec(0,n,r)<0?o-1:o}function Zh(e,t,n,r,o,i,s,a,u,l,c,f,m){let{ctx:b}=e,h=gl(i);if(h===170)return;let d=fn(h);if(!chunk7JVB7NLG_js.qa(b)&&d.usesD){chunk7JVB7NLG_js.q("executeRotatedBlit: rotated destination-reading ROP3 needs pixel read-back; skipped in SVG output");return}if(typeof b.getImageData!="function"){chunk7JVB7NLG_js.q("executeRotatedBlit: context cannot read pixels back; rotated ROP3 skipped");return}if(r===0||o===0)return;let p=chunk7JVB7NLG_js.h(e.state);if(d.usesP&&p.kind==="none")return;let x=pa(e,p),y=null,g=a,M=u,E;if(d.usesS){let R=tc(e,{plan:{kind:"ternary",index:h,operands:d},dx:0,dy:0,dw:r,dh:o,source:s,sx:a,sy:u,sw:l,sh:c,dibOrigin:f,stretch:m},true);if(!R)return;if(y=R.decoded.pixels,R.decoded.adjust&&e.halftoneRotatedAdjusts){let{adjust:T,adjustAfterSampling:w,curves:A}=R.decoded,I=zl(0,e.state.brushOrgX),S=ql(0,e.state.brushOrgY),v=new Int32Array(3);E=(C,U,L)=>{if(v[0]=C>>16&255,v[1]=C>>8&255,v[2]=C&255,!w){let k=ha(I,S,U,L);for(let F=0;F<3;F++)v[F]=uo(v[F],k);}return T(v),A?.(v),v[0]<<16|v[1]<<8|v[2]};}g=R.req.sx,M=R.req.sy;}let P=(R,T)=>{if(!y)return 0;let w=l<0?g-1-R:g+R,A=c<0?M-1-T:M+T;w=Math.max(0,Math.min(y.width-1,w)),A=Math.max(0,Math.min(y.height-1,A));let I=(A*y.width+w)*4;return y.data[I]<<16|y.data[I+1]<<8|y.data[I+2]};nc(e,ge(e,t,n),ge(e,t+r,n),ge(e,t,n+o),l,c,(R,T,w,A,I)=>{let S=d.usesS?P(R,T):0;E&&d.usesS&&(S=E(S,w,A));let v=typeof x=="function"?x(w,A):x;return qe(h,v,S,I)});}function nc(e,t,n,r,o,i,s){let[a,u]=t,l=n[0]-a,c=n[1]-u,f=r[0]-a,m=r[1]-u,b=l*m-c*f;if(b===0)return;let h=b<0?-1:1;b*=h;let d=[a,n[0],r[0],n[0]+f],p=[u,n[1],r[1],n[1]+m],x=Math.max(0,Math.floor(Math.min(...d)/16)-1),y=Math.max(0,Math.floor(Math.min(...p)/16)-1),g=Math.min(e.canvasW,Math.ceil(Math.max(...d)/16)+2),M=Math.min(e.canvasH,Math.ceil(Math.max(...p)/16)+2);if(g<=x||M<=y)return;let E=Math.abs(o)||1,P=Math.abs(i)||1,R=h*m,T=-h*f,w=-h*c,A=h*l;to(e.ctx,{x,y,w:g-x,h:M-y},(I,S,v)=>{let C=I*16-a,U=S*16-u,L=h*(C*m-U*f),k=h*(l*U-c*C);if(!zh(L,b,R,T)||!zh(k,b,w,A))return -1;let F=Math.min(E-1,qh(L*E,b,R,T)),_=Math.min(P-1,qh(k*P,b,w,A));return s(F,_,I,S,v)});}function FE(e,t){let n=In(e),r=Sn(e);return {...t,dx:t.dw<0?t.dx+n:t.dx,dy:t.dh<0?t.dy+r:t.dy}}function Qh(e,t,n,r,o,i,s){rc(e,{plan:Js(13369376),dx:t,dy:n,dw:r,dh:o,source:i,...s,dibOrigin:"top-left",stretch:true});}function rc(e,t){let{ctx:n}=e,r=FE(e,t),o=r.plan;switch(o.kind){case "noop":return;case "solid":Ql(n,o.color==="black"?"#000000":"#ffffff","source-over",r);return;case "invert-dest":Ql(n,"#ffffff","difference",r);return;case "copy":{let i=tc(e,r);i&&Kh(n,i.decoded,i.req,0,0,e.state.stretchBltMode,e.state.brushOrgX,e.state.brushOrgY);return}case "ternary":{let i=chunk7JVB7NLG_js.h(e.state);if(o.index===240&&i.kind!=="tile"){i.kind==="solid"&&Ql(n,e.state.brushColor,"source-over",r);return}UE(e,r,o.index,o.operands.usesP,o.operands.usesS);}}}function xa(e,t,n,r,o,i=0){return t>0&&n>0&&r>0&&o>0?{bmi:e+t,bits:e+r,cbBits:o,...i===1?{palColors:true}:{}}:null}function Jh(e,t,n,r,o){let{view:i}=e;if(r<(o?108:96))return true;let s=i.getInt32(n+16,true),a=i.getInt32(n+20,true),u=i.getInt32(n+24,true),l=i.getInt32(n+28,true),c=i.getUint32(n+32,true),f=i.getInt32(n+36,true),m=i.getInt32(n+40,true),b=i.getFloat32(n+44,true),h=i.getFloat32(n+48,true),d=i.getFloat32(n+52,true),p=i.getFloat32(n+56,true),x=i.getFloat32(n+60,true),y=i.getFloat32(n+64,true),g=o?i.getInt32(n+92,true):u,M=o?i.getInt32(n+96,true):l,E=r>=100?xa(t,i.getUint32(n+76,true),i.getUint32(n+80,true),i.getUint32(n+84,true),i.getUint32(n+88,true),i.getUint32(n+72,true)):null,P=b===0&&p===0&&h===0&&d===0,R=P?1:b,T=P?1:p,w={sx:R*f+(P?0:d*m+x),sy:T*m+(P?0:h*f+y),sw:R*g,sh:T*M};return ze(e)?(Zh(e,s,a,u,l,c,E,w.sx,w.sy,w.sw,w.sh,"top-left",o),true):(rc(e,{plan:Js(c),dx:He(e,s),dy:$e(e,a),dw:Ze(e,u),dh:st(e,l),source:E,...w,dibOrigin:"top-left",stretch:o}),true)}function kE(e,t,n,r){let{view:o}=e;if(r<80)return true;let i=o.getInt32(n+16,true),s=o.getInt32(n+20,true),a=o.getInt32(n+64,true),u=o.getInt32(n+68,true),l=o.getUint32(n+60,true),c=xa(t,o.getUint32(n+40,true),o.getUint32(n+44,true),o.getUint32(n+48,true),o.getUint32(n+52,true),o.getUint32(n+56,true)),f=o.getInt32(n+24,true),m=o.getInt32(n+28,true),b=o.getInt32(n+32,true),h=o.getInt32(n+36,true);return ze(e)?(Zh(e,i,s,a,u,l,c,f,m,b,h,"bottom-left",true),true):(rc(e,{plan:Js(l),dx:He(e,i),dy:$e(e,s),dw:Ze(e,a),dh:st(e,u),source:c,sx:f,sy:m,sw:b,sh:h,dibOrigin:"bottom-left",stretch:true}),true)}function ed(e,t,n,r,o){switch(t){case 76:return Jh(e,n,r,o,false);case 77:return Jh(e,n,r,o,true);case 81:return kE(e,n,r,o);default:return false}}function ya(e,t,n,r,o,i,s,a=false){return !n||!r||!o||!i?null:chunk7JVB7NLG_js.d(e.view,t+n,t+o,i,s===1?tn(e.state):null,a)}function td(e,t,n,r,o,i){let{view:s}=e;if(!n||!r||!o||!i)return null;let a=t+n;if(a+16>s.byteLength)return null;let u=s.getInt32(a+4,true),l=s.getInt32(a+8,true),c=Math.abs(l);if(s.getUint16(a+14,true)!==1||u<=0||c===0||u>16384||c>16384)return null;let f=(u+31>>5)*4,m=t+o;if(m+f*c>s.byteLength)return null;let b=new Uint8Array(u*c);for(let h=0;h<c;h++){let d=l>0?c-1-h:h,p=m+h*f;for(let x=0;x<u;x++)b[d*u+x]=s.getUint8(p+(x>>3))>>7-(x&7)&1;}return {width:u,height:c,bits:b}}function ga(e,t,n,r,o,i){let s=e.getFloat32(t,true),a=e.getFloat32(t+4,true),u=e.getFloat32(t+8,true),l=e.getFloat32(t+12,true),c=e.getFloat32(t+16,true),f=e.getFloat32(t+20,true),m=s===0&&l===0&&a===0&&u===0,b=m?1:s,h=m?1:l;return {sx:Math.round(b*n+(m?0:u*r+c)),sy:Math.round(h*r+(m?0:a*n+f)),sw:Math.round(b*o),sh:Math.round(h*i)}}function co(e,t,n){let r=t<0?0:t>=e.width?e.width-1:t,i=((n<0?0:n>=e.height?e.height-1:n)*e.width+r)*4;return (e.data[i+3]<<24|e.data[i]<<16|e.data[i+1]<<8|e.data[i+2])>>>0}function Ma(e,t,n,r,o,i,s,a,u){let l=He(e,t),c=$e(e,n),f=Ze(e,r),m=st(e,o);f<0&&(l+=In(e)),m<0&&(c+=Sn(e));let b=Math.round(Math.abs(f)),h=Math.round(Math.abs(m)),d=Math.abs(a),p=Math.abs(u);if(b===0||h===0||d===0||p===0)return null;let x=Math.round(Math.min(l,l+f)),y=Math.round(Math.min(c,c+m)),g=Math.max(0,x),M=Math.max(0,y),E=Math.min(e.canvasW,x+b),P=Math.min(e.canvasH,y+h);if(E<=g||P<=M)return null;let R=Math.min(i,i+a),T=Math.min(s,s+u),w=new Int32Array(E-g),A=new Int32Array(P-M),I=f<0||m<0,S=(v,C,U)=>I?Math.min(C-1,Math.floor(v*C/U)):di(v,C,U);for(let v=g;v<E;v++){let C=S(v-x,d,b);w[v-g]=a<0!=f<0?R+d-1-C:R+C;}for(let v=M;v<P;v++){let C=S(v-y,p,h);A[v-M]=u<0!=m<0?T+p-1-C:T+C;}return {box:{x:g,y:M,w:E-g,h:P-M},col:w,row:A}}function gi(e,t,n){let{ctx:r}=e;if(chunk7JVB7NLG_js.qa(r)&&typeof r.getImageData=="function"&&to(r,t,n))return;let o=nn(t.w,t.h);if(!o)return;let i=new Uint8ClampedArray(t.w*t.h*4);for(let s=0;s<t.h;s++)for(let a=0;a<t.w;a++){let u=n(t.x+a,t.y+s,0);if(u<0)continue;let l=(s*t.w+a)*4;i[l]=u>>16&255,i[l+1]=u>>8&255,i[l+2]=u&255,i[l+3]=255;}rn(r,t,o,chunk7JVB7NLG_js.na(i,t.w,t.h));}function Tr(e){return Math.round(e/255)}function _E(e,t,n,r){let o=e>>>24;if(n===0)return -1;let i=e>>16&255,s=e>>8&255,a=e&255,u=t>>16&255,l=t>>8&255,c=t&255;if(!r||o===255&&n!==255)return u+Math.round((i-u)*n/255)<<16|l+Math.round((s-l)*n/255)<<8|c+Math.round((a-c)*n/255);if(o===0)return -1;let f=i,m=s,b=a,h=o;n!==255&&(f=Tr(i*n),m=Tr(s*n),b=Tr(a*n),h=Tr(o*n));let d=255-h,p=b+Tr(c*d),x=m+Tr(l*d)+(p>>8);return (f+Tr(u*d)+(x>>8)&255)<<16|(x&255)<<8|p&255}function BE(e,t,n,r){let{view:o}=e;if(r<108)return;let i=o.getUint32(n+32,true),s=i>>>16&255,a=(i>>>24&1)!==0,u=ya(e,t,o.getUint32(n+76,true),o.getUint32(n+80,true),o.getUint32(n+84,true),o.getUint32(n+88,true),o.getUint32(n+72,true),true);if(!u||s===0)return;let l=ga(o,n+44,o.getInt32(n+36,true),o.getInt32(n+40,true),o.getInt32(n+92,true),o.getInt32(n+96,true)),c=Ma(e,o.getInt32(n+16,true),o.getInt32(n+20,true),o.getInt32(n+24,true),o.getInt32(n+28,true),l.sx,l.sy,l.sw,l.sh);if(!c)return;let{box:f,col:m,row:b}=c;if(!chunk7JVB7NLG_js.qa(e.ctx)){GE(e,c,u,s,a);return}gi(e,f,(h,d,p)=>_E(co(u,m[h-f.x],b[d-f.y]),p,s,a));}function GE(e,t,n,r,o){let{box:i,col:s,row:a}=t,u=nn(i.w,i.h);if(!u)return;let l=new Uint8ClampedArray(i.w*i.h*4);for(let c=0;c<i.h;c++)for(let f=0;f<i.w;f++){let m=co(n,s[f],a[c]),b=o?(m>>>24)*r/255:r,h=(c*i.w+f)*4,d=o&&m>>>24>0?255/(m>>>24):1;l[h]=(m>>16&255)*d,l[h+1]=(m>>8&255)*d,l[h+2]=(m&255)*d,l[h+3]=b;}rn(e.ctx,i,u,chunk7JVB7NLG_js.na(l,i.w,i.h));}function OE(e,t,n,r){let{view:o}=e;if(r<108)return;let i=si(o.getUint32(n+32,true),tn(e.state)),s=ya(e,t,o.getUint32(n+76,true),o.getUint32(n+80,true),o.getUint32(n+84,true),o.getUint32(n+88,true),o.getUint32(n+72,true));if(!s)return;let a=ga(o,n+44,o.getInt32(n+36,true),o.getInt32(n+40,true),o.getInt32(n+92,true),o.getInt32(n+96,true)),u=Ma(e,o.getInt32(n+16,true),o.getInt32(n+20,true),o.getInt32(n+24,true),o.getInt32(n+28,true),a.sx,a.sy,a.sw,a.sh);if(!u)return;let{box:l,col:c,row:f}=u;gi(e,l,(m,b)=>{let h=co(s,c[m-l.x],f[b-l.y])&16777215;return h===i?-1:h});}function NE(e,t,n,r){let{view:o}=e;if(r<128)return;let i=o.getUint32(n+32,true),s=i>>>16&255,a=i>>>24&255,u=o.getInt32(n+24,true),l=o.getInt32(n+28,true),c=ya(e,t,o.getUint32(n+76,true),o.getUint32(n+80,true),o.getUint32(n+84,true),o.getUint32(n+88,true),o.getUint32(n+72,true)),f=td(e,t,o.getUint32(n+104,true),o.getUint32(n+108,true),o.getUint32(n+112,true),o.getUint32(n+116,true)),m=o.getInt32(n+92,true),b=o.getInt32(n+96,true),h=ga(o,n+44,o.getInt32(n+36,true),o.getInt32(n+40,true),u,l),d=Ma(e,o.getInt32(n+16,true),o.getInt32(n+20,true),u,l,h.sx,h.sy,h.sw,h.sh);if(!d)return;let{box:p,col:x,row:y}=d;if((fn(s).usesD||f!==null&&fn(a).usesD)&&!chunk7JVB7NLG_js.qa(e.ctx)){chunk7JVB7NLG_js.q("EMR_MASKBLT: a destination-reading ROP needs the raster mirror; skipped in SVG output without one");return}let M=pa(e,chunk7JVB7NLG_js.h(e.state)),E=Math.min(h.sx,h.sx+h.sw),P=Math.min(h.sy,h.sy+h.sh);gi(e,p,(R,T,w)=>{let A=x[R-p.x],I=y[T-p.y],S=s;if(f){let U=m+A-E,L=b+I-P;S=(U>=0&&L>=0&&U<f.width&&L<f.height?f.bits[L*f.width+U]:0)?s:a;}let v=c?co(c,A,I)&16777215:0,C=typeof M=="function"?M(R,T):M;return qe(S,C,v,w)});}function WE(e,t,n,r){let{view:o}=e;if(r<140)return;let i=[0,1,2].map(x=>ge(e,o.getInt32(n+16+x*8,true),o.getInt32(n+20+x*8,true))),s=o.getInt32(n+48,true),a=o.getInt32(n+52,true),u=ya(e,t,o.getUint32(n+88,true),o.getUint32(n+92,true),o.getUint32(n+96,true),o.getUint32(n+100,true),o.getUint32(n+84,true));if(!u)return;let l=td(e,t,o.getUint32(n+116,true),o.getUint32(n+120,true),o.getUint32(n+124,true),o.getUint32(n+128,true)),c=o.getInt32(n+104,true),f=o.getInt32(n+108,true),m=ga(o,n+56,o.getInt32(n+40,true),o.getInt32(n+44,true),s,a),b=(x,y,g=x,M=y)=>{if(l){let R=c+g,T=f+M;if(R<0||T<0||R>=l.width||T>=l.height||!l.bits[T*l.width+R])return -1}let E=m.sw<0?m.sx-1-x:m.sx+x,P=m.sh<0?m.sy-1-y:m.sy+y;return co(u,E,P)&16777215},[h,d,p]=i;if(d[1]===h[1]&&p[0]===h[0]){let x=Math.round(Math.abs(d[0]-h[0])/16),y=Math.round(Math.abs(p[1]-h[1])/16);if(!l&&e.state.stretchBltMode===Rr&&x>0&&y>0){Qh(e,Math.round(h[0]/16),Math.round(h[1]/16),d[0]<h[0]?-x:x,p[1]<h[1]?-y:y,xa(t,o.getUint32(n+88,true),o.getUint32(n+92,true),o.getUint32(n+96,true),o.getUint32(n+100,true),o.getUint32(n+84,true)),m);return}let g=Math.round(h[0]/16)+(d[0]<h[0]?1-x:0),M=Math.round(h[1]/16)+(p[1]<h[1]?1-y:0),E=Math.abs(m.sw),P=Math.abs(m.sh),R=Math.max(0,g),T=Math.max(0,M),w=Math.min(e.canvasW,g+x),A=Math.min(e.canvasH,M+y);if(w<=R||A<=T||E===0||P===0)return;let I=d[0]<h[0],S=p[1]<h[1];gi(e,{x:R,y:T,w:w-R,h:A-T},(v,C)=>{let U=di(v-g,E,x),L=di(C-M,P,y);return b(I?E-1-U:U,S?P-1-L:L,U,L)});return}e.state.stretchBltMode===Rr&&e.halftoneRotatedAdjusts===void 0&&(e.halftoneRotatedAdjusts=false),nc(e,h,d,p,m.sw,m.sh,(x,y)=>b(x,y));}function HE(e,t,n,r,o,i,s,a){let{view:u}=e;if(!n||!r||!o||!i||t+n+r>u.byteLength||t+o+i>u.byteLength)return null;let l=new Uint8Array(r+i);l.set(new Uint8Array(u.buffer,u.byteOffset+t+n,r),0),l.set(new Uint8Array(u.buffer,u.byteOffset+t+o,i),r);let c=new DataView(l.buffer),f=c.getInt32(8,true);return c.setInt32(8,f<0?-a:a,true),chunk7JVB7NLG_js.d(c,0,r,i,s===1?tn(e.state):null)}function $E(e,t,n,r){let{view:o}=e;if(r<76)return;let i=o.getInt32(n+24,true),s=o.getInt32(n+28,true),a=o.getInt32(n+32,true),u=o.getInt32(n+36,true),l=o.getUint32(n+40,true),c=o.getUint32(n+44,true),f=o.getUint32(n+60,true),m=o.getUint32(n+64,true);if(m===0||!l||t+l+12>o.byteLength)return;let b=o.getInt32(t+l+8,true),h=b<0,d=Math.abs(b),p=HE(e,t,l,c,o.getUint32(n+48,true),o.getUint32(n+52,true),o.getUint32(n+56,true),m);if(!p)return;let x=Ma(e,o.getInt32(n+16,true),o.getInt32(n+20,true),a,u,0,0,a,u);if(!x)return;let{box:y,col:g,row:M}=x;gi(e,y,(E,P)=>{let R=g[E-y.x],T=M[P-y.y],w=s+u-1-T,A=h?d-1-w-f:m-1-(w-f);if(A<0||A>=p.height)return -1;let I=i+R;return I<0||I>=p.width?-1:co(p,I,A)&16777215});}function nd(e,t,n,r,o){switch(t){case 114:return BE(e,n,r,o),true;case 116:return OE(e,n,r,o),true;case 78:return NE(e,n,r,o),true;case 79:return WE(e,n,r,o),true;case 80:return $E(e,n,r,o),true;default:return false}}var rd="\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",od={737:"\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u03C5\u03C6\u03C7\u03C8\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03C9\u03AC\u03AD\u03AE\u03CA\u03AF\u03CC\u03CD\u03CB\u03CE\u0386\u0388\u0389\u038A\u038C\u038E\u038F\xB1\u2265\u2264\u03AA\u03AB\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",775:"\u0106\xFC\xE9\u0101\xE4\u0123\xE5\u0107\u0142\u0113\u0156\u0157\u012B\u0179\xC4\xC5\xC9\xE6\xC6\u014D\xF6\u0122\xA2\u015A\u015B\xD6\xDC\xF8\xA3\xD8\xD7\xA4\u0100\u012A\xF3\u017B\u017C\u017A\u201D\xA6\xA9\xAE\xAC\xBD\xBC\u0141\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u0104\u010C\u0118\u0116\u2563\u2551\u2557\u255D\u012E\u0160\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u0172\u016A\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u017D\u0105\u010D\u0119\u0117\u012F\u0161\u0173\u016B\u017E\u2518\u250C\u2588\u2584\u258C\u2590\u2580\xD3\xDF\u014C\u0143\xF5\xD5\xB5\u0144\u0136\u0137\u013B\u013C\u0146\u0112\u0145\u2019\xAD\xB1\u201C\xBE\xB6\xA7\xF7\u201E\xB0\u2219\xB7\xB9\xB3\xB2\u25A0\xA0",850:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\xD7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xF0\xD0\xCA\xCB\xC8\u0131\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\xFE\xDE\xDA\xDB\xD9\xFD\xDD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0",852:"\xC7\xFC\xE9\xE2\xE4\u016F\u0107\xE7\u0142\xEB\u0150\u0151\xEE\u0179\xC4\u0106\xC9\u0139\u013A\xF4\xF6\u013D\u013E\u015A\u015B\xD6\xDC\u0164\u0165\u0141\xD7\u010D\xE1\xED\xF3\xFA\u0104\u0105\u017D\u017E\u0118\u0119\xAC\u017A\u010C\u015F\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\u011A\u015E\u2563\u2551\u2557\u255D\u017B\u017C\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u0102\u0103\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\u0111\u0110\u010E\xCB\u010F\u0147\xCD\xCE\u011B\u2518\u250C\u2588\u2584\u0162\u016E\u2580\xD3\xDF\xD4\u0143\u0144\u0148\u0160\u0161\u0154\xDA\u0155\u0170\xFD\xDD\u0163\xB4\xAD\u02DD\u02DB\u02C7\u02D8\xA7\xF7\xB8\xB0\xA8\u02D9\u0171\u0158\u0159\u25A0\xA0",855:"\u0452\u0402\u0453\u0403\u0451\u0401\u0454\u0404\u0455\u0405\u0456\u0406\u0457\u0407\u0458\u0408\u0459\u0409\u045A\u040A\u045B\u040B\u045C\u040C\u045E\u040E\u045F\u040F\u044E\u042E\u044A\u042A\u0430\u0410\u0431\u0411\u0446\u0426\u0434\u0414\u0435\u0415\u0444\u0424\u0433\u0413\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u0445\u0425\u0438\u0418\u2563\u2551\u2557\u255D\u0439\u0419\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u043A\u041A\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\u043B\u041B\u043C\u041C\u043D\u041D\u043E\u041E\u043F\u2518\u250C\u2588\u2584\u041F\u044F\u2580\u042F\u0440\u0420\u0441\u0421\u0442\u0422\u0443\u0423\u0436\u0416\u0432\u0412\u044C\u042C\u2116\xAD\u044B\u042B\u0437\u0417\u0448\u0428\u044D\u042D\u0449\u0429\u0447\u0427\xA7\u25A0\xA0",858:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\xD7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xF0\xD0\xCA\xCB\xC8\u20AC\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\xFE\xDE\xDA\xDB\xD9\xFD\xDD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0",860:"\xC7\xFC\xE9\xE2\xE3\xE0\xC1\xE7\xEA\xCA\xE8\xCD\xD4\xEC\xC3\xC2\xC9\xC0\xC8\xF4\xF5\xF2\xDA\xF9\xCC\xD5\xDC\xA2\xA3\xD9\u20A7\xD3\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xD2\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",861:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xD0\xF0\xDE\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xFE\xFB\xDD\xFD\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xC1\xCD\xD3\xDA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",862:"\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",863:"\xC7\xFC\xE9\xE2\xC2\xE0\xB6\xE7\xEA\xEB\xE8\xEF\xEE\u2017\xC0\xA7\xC9\xC8\xCA\xF4\xCB\xCF\xFB\xF9\xA4\xD4\xDC\xA2\xA3\xD9\xDB\u0192\xA6\xB4\xF3\xFA\xA8\xB8\xB3\xAF\xCE\u2310\xAC\xBD\xBC\xBE\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",865:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xA4\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",866:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\xA4\u25A0\xA0"};var XE=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376];function lc(e,t){return t===2?e:e>=128&&e<=159?XE[e-128]:e}var jE={0:"windows-1252",1:"windows-1252",77:"macintosh",128:"shift_jis",129:"euc-kr",130:"johab",134:"gbk",136:"big5",161:"windows-1253",162:"windows-1254",163:"windows-1258",177:"windows-1255",178:"windows-1256",186:"windows-1257",204:"windows-1251",222:"windows-874",238:"windows-1250",255:"ibm437"},YE={874:"windows-874",932:"shift_jis",936:"gbk",949:"euc-kr",950:"big5",1250:"windows-1250",1251:"windows-1251",1252:"windows-1252",1253:"windows-1253",1254:"windows-1254",1255:"windows-1255",1256:"windows-1256",1257:"windows-1257",1258:"windows-1258",54936:"gb18030",65001:"utf-8"},id={874:"windows-874",932:"shift_jis",936:"gbk",949:"euc-kr",950:"big5"};function VE(e,t){return {codes:e.map(n=>n<128?n:t.charCodeAt(n-128)),byteLengths:e.map(()=>1)}}function qn(e,t,n){if(t===2)return {codes:[...e],byteLengths:e.map(()=>1)};let r=n?.oem;if(t===255&&(r===void 0||!(r in id)))return VE(e,(r!==void 0?od[r]:void 0)??rd);if(t===130){let s=[],a=[];for(let u=0;u<e.length;u++){let l=e[u],c=Uf(l),f=c&&u+1<e.length?c.charCodeAt(e[u+1]):65533,m=l<128||f===65533?1:2;s.push(l<128?l:f),a.push(m),u+=m-1;}return {codes:s,byteLengths:a}}let o=n?.ansi,i=t===255&&r!==void 0?id[r]:(t===0||t===1)&&o!==void 0?YE[o]??"windows-1252":jE[t]??"windows-1252";if(i==="windows-1252")return {codes:e.map(s=>lc(s,t)),byteLengths:e.map(()=>1)};try{let s=new TextDecoder(i,{fatal:!0,ignoreBOM:!0}),a=new TextDecoder(i,{ignoreBOM:!0}),u=new Uint8Array(e),l=[],c=[],f=0;for(;f<e.length;){let m=null,b=1;for(let h=1;h<=Math.min(4,e.length-f);h++)try{let d=s.decode(u.subarray(f,f+h));if(d.length>0){m=d,b=h;break}}catch{}m===null&&(m=a.decode(u.subarray(f,f+1)));for(let h=0;h<m.length;h++)l.push(m.charCodeAt(h)),c.push(h===m.length-1?b:0);f+=b;}return {codes:l,byteLengths:c}}catch{return {codes:e.map(s=>lc(s,t)),byteLengths:e.map(()=>1)}}}var zE=[0,0,.4096065,.4875311,.5515784,.6070649,.656426,.7013281,.7426686,.7811829,.8173296,.8514569,.8838279,.9147507,.9443338,.9726402],qE=[0,0,.0556662,.0852493,.1161453,.1485431,.1826704,.2188171,.2572957,.2986719,.343574,.3929351,.4483443,.5124689,.5903349,.6957428],sd=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,23,23,24,24,25,26,26,27,28,28,29,30,30,31,32,32,33,34,35,35,36,37,38,38,39,40,41,42,42,43,44,45,46,47,48,49,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,69,70,71,72,73,74,75,77,78,79,80,81,83,84,85,86,88,89,90,92,93,94,96,97,98,100,101,102,104,105,107,108,109,111,112,114,115,117,118,120,121,123,124,126,128,129,131,132,134,136,137,139,141,142,144,146,147,149,151,153,154,156,158,160,161,163,165,167,169,171,173,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,213,215,217,219,221,223,225,228,230,232,234,237,239,241,243,246,248,250,253,255],JE=[0,24,32,39,44,48,52,55,59,62,64,67,70,72,74,77,79,81,83,85,86,88,90,92,93,95,97,98,100,101,103,104,106,107,108,110,111,112,114,115,116,117,118,120,121,122,123,124,125,127,128,129,130,131,132,133,134,135,136,137,138,139,140,140,142,143,144,145,145,146,147,148,149,150,151,152,152,153,154,154,156,157,157,158,159,160,161,161,162,163,164,165,165,166,167,167,168,169,170,171,171,172,173,173,174,175,176,176,177,178,178,178,180,180,181,182,182,183,184,184,185,186,186,187,188,188,189,189,190,191,192,192,193,193,194,195,195,196,196,197,198,198,199,199,200,201,201,202,202,203,204,204,205,205,206,206,207,208,208,208,209,210,210,211,211,212,212,213,214,214,215,215,216,216,217,217,218,218,219,219,220,220,221,221,222,222,223,224,224,225,225,225,226,227,227,228,228,229,229,229,230,230,231,231,232,232,233,233,234,234,235,235,236,236,237,237,238,238,239,239,239,240,240,240,241,242,242,243,243,244,244,245,245,245,246,246,247,247,248,248,249,249,249,250,250,251,251,252,252,252,253,253,254,254,255,255];function Mi(e,t,n,r){return n<=1?t:n>=16?e:r?JE[Math.floor((n*sd[e]+(16-n)*sd[t])/16)]:t+Math.floor((e-t)*(e>t?zE[n]:qE[n]))}var mo=2,fo=4,md=16,Pa=4096,Ei=8192,KE=[255,255,240,233,225,217,208,199,189,178,167,154,140,124,104,77,0];function fd(e){let t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return [0,0,0];let n=parseInt(t[1],16);return [n>>16&255,n>>8&255,n&255]}function bd(e,t,n,r){let o=[0,0,0],i=0,s=255;for(let a=0;a<3;a++)o[a]=r(n[a],255,a),i+=1-(o[a]-r(n[a],0,a))/255,s=Math.min(s,o[a]);if(i=Math.min(1,Math.max(i/3,1-s/255)),!(i<=0)){for(let a=0;a<3;a++)e[t+a]=Math.round((o[a]-255*(1-i))/i);e[t+3]=Math.round(i*255);}}function cc(e,t,n,r){let{left:o,top:i,right:s,bottom:a}=t;r&&(o=Math.max(o,r.left),i=Math.max(i,r.top),s=Math.min(s,r.right),a=Math.min(a,r.bottom)),!(s<=o||a<=i)&&(e.save(),e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation="source-over",e.globalAlpha=1,e.fillStyle=n,e.fillRect(o,i,s-o,a-i),e.restore());}function ad(e,t,n,r){e.save(),e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation="source-over",e.globalAlpha=1,r&&(e.beginPath(),e.rect(r.left,r.top,r.right-r.left,r.bottom-r.top),e.clip()),e.fillStyle=n,e.beginPath(),e.moveTo(t[0].x,t[0].y);for(let o=1;o<t.length;o++)e.lineTo(t[o].x,t[o].y);e.closePath(),e.fill(),e.restore();}function hd(e){return e>=128&&e<=159}function ud(e,t){return !e.glyphIndices&&!(e.options&Pa)&&hd(e.codes[t])}function dd(e,t){let n=t.codes.length,r=t.codes.map(L=>t.glyphIndices?L:e.glyphIndex(L)),o=!!t.matrix&&Math.abs(t.matrix[0])>1e-9&&Math.abs(t.matrix[1])>1e-9&&!!e.rotatedLinearAdvance,i=[];for(let L=0;L<n;L++)i.push(ud(t,L)&&!t.dx?0:t.dx&&L<t.dx.length?t.dx[L]:t.matrix?o?e.rotatedLinearAdvance(r[L]):e.rotatedAdvance(r[L],!!t.matrix&&t.matrix[0]<0):e.advance(r[L]));!t.dx&&t.textJustification&&!t.glyphIndices&&(i=chunk7JVB7NLG_js.l(i,t.codes,t.textJustification.extra,t.textJustification.count));let s=[];for(let L=0;L<n;L++)s.push(t.dy&&L<t.dy.length?t.dy[L]:0);let a=0,u=0;for(let L=0;L<n;L++)a+=i[L],u+=s[L];let l=t.matrix,c=l?l[0]:1,f=l?l[1]:0,m=l?l[2]:0,b=l?l[3]:1,h=o?L=>Math.round(L*16)/16:L=>L,d=0,p=0,x=0,y=t.textAlign&6;if(y===6?d=o?-a/2:-Math.ceil(a/2):y===2&&(d=-a),o&&y){let L=k=>{let F=Math.round(k*a*16);return (y===6?-Math.trunc(F/2):-F)/16};p=L(c),x=L(f);}let g=(L,k)=>o?{x:t.x+p+h(c*(L-d))+h(m*k),y:t.y+x+h(f*(L-d))+h(b*k)}:{x:t.x+c*L+m*k,y:t.y+f*L+b*k},M=t.textAlign&24,E=!!l&&Math.abs(l[0])>1e-9&&Math.abs(l[1])>1e-9,P=l?e.rotatedMetrics?.(l[0],l[1]):void 0,R=P?P.ascent:E?e.rotatedAscent??e.ascent:e.ascent,T=P?P.descent:E?e.rotatedDescent??e.descent:e.descent,w=M===24?0:M===8?-T:R,A=[],I=[],S=t.glyphMatrix??l,v=S?[S[0],S[1],S[2],S[3]]:void 0,C=d,U=w;for(let L=0;L<n;L++){let k=g(C,U),F=!!e.fractionalOrigins,_=F?Math.floor(k.x):Math.round(k.x),H=F?e.fractionalOrigins==="xy"?Math.round((k.x-_)*4)*16:e.fractionalOrigins==="x"?Math.round((k.x-_)*6)*(64/6):Math.round((k.x-_)*64):0,G=e.fractionalOrigins==="xy"?Math.floor(k.y):Math.round(k.y),W=e.fractionalOrigins==="xy"?Math.round((k.y-G)*4)*16:0;if(I.push({x:_+H/64,y:G+W/64,along:C,down:U}),!ud(t,L)){let N=e.glyph(r[L],v,H,W);N.bitmap&&A.push({x:_+N.bitmap.left,y:G-N.bitmap.top,bitmap:N.bitmap});}C+=i[L],U+=s[L];}return {glyphs:r,total:a,totalY:u,startAlong:d,baseDown:w,hAlign:y,at:g,placed:A,origins:I}}function fc(e,t,n,r){let{glyphs:o,total:i,totalY:s,startAlong:a,baseDown:u,at:l,placed:c,origins:f,hAlign:m}=dd(t,n),b=n.matrix,h=b?b[0]:1,d=b?b[1]:0,p=b?b[2]:0,x=b?b[3]:1,y=n.options&fo&&n.rect?n.rect:null;if(n.options&mo&&n.rect&&cc(e,n.rect,n.bkColor,null),n.bkMode===2&&i!==0)if(b){let P=[l(a,u-t.ascent),l(a+i,u-t.ascent),l(a+i,u+t.descent),l(a,u+t.descent)];ad(e,P,n.bkColor,y);}else {let P=Math.round(n.x+a),R=Math.round(n.y+u),T=Math.min(P,P+Math.round(i)),w=Math.max(P,P+Math.round(i));cc(e,{left:T,top:R-t.ascent,right:w,bottom:R+t.descent},n.bkColor,y);}let g=n.bkMode===2;if(!g&&n.options&mo&&n.rect&&c.length>0){let P,R,T,w;if(b){let A=[l(a,u-t.ascent),l(a+i,u-t.ascent),l(a+i,u+t.descent),l(a,u+t.descent)];P=Math.min(...A.map(I=>I.x)),T=Math.max(...A.map(I=>I.x)),R=Math.min(...A.map(I=>I.y)),w=Math.max(...A.map(I=>I.y));}else {let A=Math.round(n.x+a),I=Math.round(n.y+u);P=Math.min(A,A+Math.round(i)),T=Math.max(A,A+Math.round(i)),R=I-t.ascent,w=I+t.descent;}for(let A of c)P=Math.min(P,A.x),R=Math.min(R,A.y),T=Math.max(T,A.x+A.bitmap.width),w=Math.max(w,A.y+A.bitmap.height);g=n.rect.left<=P&&n.rect.top<=R&&n.rect.right>=T&&n.rect.bottom>=w;}if(chunk7JVB7NLG_js.pa(e)?(y&&(e.save(),e.setTransform(1,0,0,1,0,0),e.beginPath(),e.rect(y.left,y.top,y.right-y.left,y.bottom-y.top),e.clip()),ZE(e,t,n,o,f,r),y&&e.restore(),e.shadow&&ld(e.shadow,c,n.textColor,t.mode!=="mono",y,g)):ld(e,c,n.textColor,t.mode!=="mono",y,g),(n.underline||n.strikeOut)&&i!==0){let P=[];n.underline&&P.push([t.underlinePosition,Math.max(1,t.underlineThickness),0]),n.strikeOut&&P.push([t.strikeoutPosition,Math.max(1,t.strikeoutThickness),t.strikeoutShift??0]);let R=!b&&n.plusBars==="snapped"&&t.exactDecorations?mc(t.exactDecorations,n,n.x+a,n.y+u,i):null,T=0;for(let[w,A,I]of P){let S=R?.[T++];if(b){let v=[l(a,u-w),l(a+i,u-w),l(a+i,u-w+A),l(a,u-w+A)];ad(e,v,n.textColor,y);}else {let v=Math.round(n.x+a)+I,C=Math.round(n.y+u)-w,U=S?Math.round(S.left):Math.min(v,v+Math.round(i)),L=S?Math.round(S.right):Math.max(v,v+Math.round(i));cc(e,{left:U,top:C,right:L,bottom:C+A},n.textColor,y);}}}let M=m===6?0:m===2?-i:i,E=m===6?0:s;return {dx:h*M+p*E,dy:d*M+x*E}}function ZE(e,t,n,r,o,i){let s="",a=[];for(let b=0;b<o.length;b++){let h=n.glyphIndices?t.charForGlyph(r[b]):n.codes[b];!n.glyphIndices&&!(n.options&Pa)&&hd(h)||(s+=String.fromCodePoint(h),a.push(o[b]));}if(s.length===0)return;let u=n.matrix,l=t.ttf,c=t.syntheticBold||l.weightClass>=600,f=t.syntheticItalic||(l.fsSelection&1)!==0||(l.macStyle&2)!==0,m=a[0];e.fillGlyphRun({text:s,xs:a.map(b=>u?b.along-m.along:b.x),ys:a.map(b=>u?b.down-m.down:b.y),matrix:u?[u[0],u[1],u[2],u[3],m.x,m.y]:null,scaleX:t.ppemX!==t.ppem?t.ppemX/t.ppem:1,fontFamily:chunk7JVB7NLG_js.ba(l.family,i),fontSize:t.ppem,fontWeight:c?700:400,italic:f,aliased:t.mode==="mono",fill:n.textColor});}function ld(e,t,n,r,o,i=false){if(t.length===0)return;let s=1/0,a=1/0,u=-1/0,l=-1/0;for(let E of t)s=Math.min(s,E.x),a=Math.min(a,E.y),u=Math.max(u,E.x+E.bitmap.width),l=Math.max(l,E.y+E.bitmap.height);let c=e.canvas;typeof c?.width=="number"&&typeof c?.height=="number"&&(s=Math.max(s,0),a=Math.max(a,0),u=Math.min(u,c.width),l=Math.min(l,c.height)),o&&(s=Math.max(s,o.left),a=Math.max(a,o.top),u=Math.min(u,o.right),l=Math.min(l,o.bottom));let f=u-s,m=l-a;if(f<=0||m<=0||f*m>64*1024*1024)return;if(t.some(E=>E.bitmap.channels===3)){t3(e,t,n,s,a,f,m);return}let b=new Uint8Array(f*m),h=r?16:1;for(let E of t){let P=E.bitmap;for(let R=0;R<P.height;R++){let T=E.y+R-a;if(!(T<0||T>=m))for(let w=0;w<P.width;w++){let A=P.data[R*P.width+w];if(!A)continue;let I=E.x+w-s;if(I<0||I>=f)continue;let S=T*f+I;r&&b[S]?b[S]=((b[S]-1|A-1)&15)+1:A>b[S]&&(b[S]=A);}}}let d=chunk7JVB7NLG_js.Y(f,m);if(!d)return;let[p,x,y]=fd(n),g=new Uint8ClampedArray(f*m*4),M=null;if(r&&typeof e.getImageData=="function")try{M=chunk7JVB7NLG_js.ka(e,s,a,f,m).data;}catch{M=null;}for(let E=0;E<f*m;E++){let P=b[E];if(P<=(r?1:0))continue;let R=E*4;!r||P>=h?(g[R]=p,g[R+1]=x,g[R+2]=y,g[R+3]=255):M&&M[R+3]===255?(g[R]=Mi(p,M[R],P,i),g[R+1]=Mi(x,M[R+1],P,i),g[R+2]=Mi(y,M[R+2],P,i),g[R+3]=255):M?bd(g,R,[p,x,y],(T,w)=>Mi(T,w,P,i)):(g[R]=p,g[R+1]=x,g[R+2]=y,g[R+3]=255-KE[P]);}chunk7JVB7NLG_js.la(d.ctx,chunk7JVB7NLG_js.na(g,f,m),0,0),e.save(),e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation="source-over",e.globalAlpha=1,chunk7JVB7NLG_js.ja(e,d.canvas,s,a,f,m),e.restore();}function bc(e,t,n){let r=e.fontDetails,o=e.fontHeight*t;return {face:e.fontFamily,height:o<0?-Math.round(-o):Math.round(o),width:r&&r.width?Math.round(Math.abs(r.width*n)):0,weight:e.fontWeight,italic:e.fontItalic,charSet:r?r.charSet:1,pitchAndFamily:r?r.pitchAndFamily:0,quality:r?r.quality:0}}function Ra(e,t,n,r){let[o,i,s,a,u,l]=r.matrix,c=Math.hypot(o,i),f=Math.hypot(s,a);if(!(c>0)||!(f>0)||r.codes.length===0)return null;let m=i===0&&s===0&&n.fontEscapementTenthDeg%3600===0,b=bc(n,f,c);m&&r.playbackStretch&&r.playbackStretch!==1&&(b.playbackStretch=r.playbackStretch);let h=t.realize(b,n.fontFamilyMap);if(!h)return null;let p=i!==0||s!==0?[o/c,i/c,s/f,a/f]:null,x=p,y=n.fontEscapementTenthDeg%3600;if(y!==0){let S=(U,L)=>{let k=[L,-U,U,L];return p?[p[0]*k[0]+p[2]*k[1],p[1]*k[0]+p[3]*k[1],p[0]*k[2]+p[2]*k[3],p[1]*k[2]+p[3]*k[3]]:k},v=chunk7JVB7NLG_js.n(y),C=y/10*(Math.PI/180);x=S(v.sin,v.cos),p=S(Math.sin(C),Math.cos(C));}if(x&&r.playbackStretch&&r.playbackStretch!==1){let S=r.playbackStretch;x=[x[0]*S,x[1]*S,x[2],x[3]];}let g=(n.textAlign&1)!==0,M=g?n.curX:r.x,E=g?n.curY:r.y,P=(S,v)=>({x:o*S+s*v+u,y:i*S+a*v+l}),R=P(M,E),T=null;if(r.rect&&r.options&(mo|fo)){let S=P(r.rect.left,r.rect.top),v=P(r.rect.right,r.rect.bottom);T={left:Math.round(Math.min(S.x,v.x)),top:Math.round(Math.min(S.y,v.y)),right:Math.round(Math.max(S.x,v.x)),bottom:Math.round(Math.max(S.y,v.y))};}let w={codes:r.codes,glyphIndices:r.glyphIndices,x:R.x,y:R.y,dx:r.dx?r.dx.map(S=>S*c):null,dy:r.dy?r.dy.map(S=>-S*f):null,textJustification:r.textJustification?{...r.textJustification,extra:r.textJustification.extra*c}:void 0,textAlign:n.textAlign,textColor:n.textColor,bkColor:n.bkColor,bkMode:n.bkMode,options:r.options,rect:T,matrix:p,glyphMatrix:x,underline:n.fontUnderline,strikeOut:n.fontStrikeOut},A=fc(e,h,w,n.fontFamilyMap),I=o*a-i*s;return I===0?{dx:0,dy:0}:{dx:(a*A.dx-s*A.dy)/I,dy:(-i*A.dx+o*A.dy)/I}}var pd=1.2,cd=Uint8Array.from({length:256},(e,t)=>Math.floor(255*Math.pow(t/255,pd)+.5)),QE=Uint8Array.from({length:256},(e,t)=>Math.floor(255*Math.pow(t/255,1/pd)+.5));function Ea(e,t,n){let r=cd[e],o=cd[t],i=n===1&&r<o||n===5&&r>o;return QE[Math.floor((r*n+o*(6-n)+(i?2:3))/6)]}function hn(e){return Math.round(e*6/255)}function xd(e,t,n,r,o=Math.round){let i=n[r],s=n[r+1],a=n[r+2];if(!i&&!s&&!a)return;if(!e[t]&&!e[t+1]&&!e[t+2]){e[t]=i,e[t+1]=s,e[t+2]=a;return}let u=chunk5OO5QZBQ_js.a(Math.min(6,hn(e[t])+hn(i)),Math.min(6,hn(e[t+1])+hn(s)),Math.min(6,hn(e[t+2])+hn(a)));for(let l=0;l<3;l++)e[t+l]=o(u[l]*255/6);}function e3(e,t,n){return Ea(e,t,hn(n*255))}function t3(e,t,n,r,o,i,s){let a=new Uint8Array(i*s*3);for(let m of t){let b=m.bitmap,h=b.channels===3?3:1;for(let d=0;d<b.height;d++){let p=m.y+d-o;if(!(p<0||p>=s))for(let x=0;x<b.width;x++){let y=m.x+x-r;if(y<0||y>=i)continue;let g=(d*b.width+x)*h,M=(p*i+y)*3;if(b.additiveClearType){xd(a,M,b.data,g);continue}for(let E=0;E<3;E++){let P=h===3?b.data[g+E]:b.data[g]*255;P>a[M+E]&&(a[M+E]=P);}}}}let u=chunk7JVB7NLG_js.Y(i,s);if(!u)return;let l;try{l=chunk7JVB7NLG_js.ka(e,r,o,i,s).data;}catch{return}let c=fd(n),f=new Uint8ClampedArray(i*s*4);for(let m=0;m<i*s;m++){let b=a[m*3],h=a[m*3+1],d=a[m*3+2];if(!b&&!h&&!d)continue;let p=m*4;if(l[p+3]!==255){let M=[b/255,h/255,d/255];bd(f,p,c,(E,P,R)=>e3(E,P,M[R]));continue}let x=hn(b),y=hn(h),g=hn(d);x===6&&y===6&&g===6?(f[p]=c[0],f[p+1]=c[1],f[p+2]=c[2]):x||y||g?(f[p]=Ea(c[0],l[p],x),f[p+1]=Ea(c[1],l[p+1],y),f[p+2]=Ea(c[2],l[p+2],g)):(f[p]=l[p],f[p+1]=l[p+1],f[p+2]=l[p+2]),f[p+3]=255;}chunk7JVB7NLG_js.la(u.ctx,chunk7JVB7NLG_js.na(f,i,s),0,0),e.save(),e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation="source-over",e.globalAlpha=1,chunk7JVB7NLG_js.ja(e,u.canvas,r,o,i,s),e.restore();}function mc(e,t,n,r,o){let i=c=>Math.ceil(Math.floor(c*512+1e-7)/512*4-1e-9)/4,s=c=>Math.ceil(c*8-1e-9)/8,a=n+o,u=(c,f)=>{let m=Math.max(1,Math.round(f)),b=i(c-(m-1)/2);if(m===1){let h={left:n+.3,right:a+.8,top:b,bottom:b+1};if(a<n||Math.max(Math.abs(n),Math.abs(a),Math.abs(c))>=8388607)return h;let d=Dt(n),p=Dt(a),x=Dt(c),y=Math.floor(d/16),g=Math.floor(x/16);return {...h,nominal:{pts:[d,x,p,x],box:{x:y,y:g,w:Math.ceil(p/16+1)-y,h:Math.ceil(x/16+1)-g}}}}return {left:s(n+.5),right:s(a+.5),top:b,bottom:b+m}},l=[];return t.underline&&l.push(u(r-e.underlinePosition,e.underlineThickness)),t.strikeOut&&l.push(u(r-e.strikeoutPosition,e.strikeoutThickness)),l}function yd(e,t,n={}){let{placed:r,total:o,startAlong:i,baseDown:s}=dd(e,t),a=[],u=[];if(n.decorations&&t.plusBars==="fractional"&&e.exactDecorations&&!t.matrix&&o!==0&&e.mode==="gray")u.push(...mc(e.exactDecorations,t,t.x+i,t.y+s,o));else if(n.decorations&&!t.matrix&&o!==0){let g=Math.round(t.x+i),M=g+Math.round(o),E=t.plusBars==="snapped"&&e.exactDecorations?mc(e.exactDecorations,t,t.x+i,t.y+s,o):null,P=0,R=(T,w)=>{let A=Math.round(t.y+s)-T,I=E?.[P++],S=I?Math.round(I.left):g,v=I?Math.round(I.right):M;a.push({left:Math.min(S,v),right:Math.max(S,v),top:A,bottom:A+Math.max(1,w)});};t.underline&&R(e.underlinePosition,e.underlineThickness),t.strikeOut&&R(e.strikeoutPosition,e.strikeoutThickness);}if(r.length===0&&a.length===0&&u.length===0)return null;let l=1/0,c=1/0,f=-1/0,m=-1/0;for(let g of r)l=Math.min(l,g.x),c=Math.min(c,g.y),f=Math.max(f,g.x+g.bitmap.width),m=Math.max(m,g.y+g.bitmap.height);for(let g of a)l=Math.min(l,g.left),c=Math.min(c,g.top),f=Math.max(f,g.right),m=Math.max(m,g.bottom);for(let g of u){let M=g.nominal?.box;l=Math.min(l,M?.x??Math.floor(g.left)),c=Math.min(c,M?.y??Math.floor(g.top)),f=Math.max(f,M?M.x+M.w:Math.ceil(g.right)),m=Math.max(m,M?M.y+M.h:Math.ceil(g.bottom));}let b=f-l,h=m-c;if(b<=0||h<=0||b*h>64*1024*1024)return null;let d=r.some(g=>g.bitmap.channels===3)?3:1,p=new Uint8ClampedArray(b*h*d),x=e.mode==="mono"?1:n.grayLevels??16;for(let g of r){let M=g.bitmap,E=M.channels===3?3:1;for(let P=0;P<M.height;P++)for(let R=0;R<M.width;R++){let T=P*M.width+R,w=(g.y+P-c)*b+(g.x+R-l);if(d===3&&E===3){xd(p,w*3,M.data,T*3,M.additiveClearType?Math.round:Math.floor);continue}for(let A=0;A<d;A++){let I=Math.round(M.data[T]*255/x),S=w*d+A;I>p[S]&&(p[S]=I);}}}for(let g of a)for(let M=g.top;M<g.bottom;M++)p.fill(255,((M-c)*b+g.left-l)*d,((M-c)*b+g.right-l)*d);let y=u.length>0?new Uint8ClampedArray(b*h):void 0;for(let g of u){if(g.nominal){let{pts:M,box:E}=g.nominal,P=Ts([{pts:M,closed:false}],{antialias:true,half:false,opaqueSolid:true},E);for(let R=0;R<E.h;R++){let T=(E.y+R-c)*b+E.x-l;for(let w=0;w<E.w;w++)y[T+w]=Math.max(y[T+w],P[R*E.w+w]);}continue}for(let M=Math.floor(g.top);M<Math.ceil(g.bottom);M++){let E=Math.min(M+1,g.bottom)-Math.max(M,g.top);for(let P=Math.floor(g.left);P<Math.ceil(g.right);P++){let R=Math.round(E*4)*Math.round((Math.min(P+1,g.right)-Math.max(P,g.left))*8),T=Math.round(R*255/32),w=(M-c)*b+P-l;T>y[w]&&(y[w]=T);}}}return {x:l,y:c,width:b,height:h,channels:d,data:p,bars:y}}function gd(e,t,n,r,o){let i=e.getUint32(n+64,true);if(i===0)return null;let s=t+i,a=s+r*4;if(s<0||a>o)return null;let u=[];for(let l=0;l<r;l++)u.push(e.getInt32(s+l*4,true));return u}function n3(e,t,n,r,o,i){let{ctx:s,view:a,state:u}=e,l=e.fonts;if(!l)return false;let c=a.getUint32(n+44,true),f=[];for(let M=0;M<r;M++)f.push(a.getUint16(t+o+M*2,true));let m=(c&Ei)!==0,b=gd(a,t,n,m?r*2:r,i),h=b,d=null;if(b&&m){h=[],d=[];for(let M=0;M<r;M++)h.push(b[M*2]|0),d.push(b[M*2+1]|0);}let p=a.getFloat32(n+20,true),x=a.getFloat32(n+24,true),y=a.getUint32(n+16,true)===1&&p>0&&x>0?x/p:void 0,g=Ra(s,l,u,{playbackStretch:y,codes:f,glyphIndices:(c&md)!==0,x:a.getInt32(n+28,true),y:a.getInt32(n+32,true),options:c,rect:{left:a.getInt32(n+48,true),top:a.getInt32(n+52,true),right:a.getInt32(n+56,true),bottom:a.getInt32(n+60,true)},dx:h,dy:d,matrix:Ee(e),textJustification:u.textJustification});return g?(u.textAlign&1&&(u.curX+=g.dx,u.curY+=g.dy),true):false}function r3(e){return (e&6)===6?"center":e&2?"right":"left"}function o3(e){let t=e&24;return t===24?"alphabetic":t===8?"bottom":"top"}function hc(e,t,n,r,o,i,s,a,u=null){let l=r?chunk7JVB7NLG_js.k(r):e.measureText(n).width,c=r?o+chunk7JVB7NLG_js.m(l,s):o;if(t.bkMode===2){let f=chunk7JVB7NLG_js.ca(t,a),m=e.fillStyle;e.fillStyle=t.bkColor,e.fillRect(c,i-f,l,f),e.fillStyle=m;}if(e.fillStyle=t.textColor,r){let f=chunk7JVB7NLG_js.j(r),m=u?chunk7JVB7NLG_js.j(u):null,b=e.textAlign;e.textAlign="left";for(let h=0;h<n.length&&h<f.length;h++)e.fillText(n[h],c+f[h],i+(m?.[h]??0));e.textAlign=b;}else e.fillText(n,o,i);(t.fontUnderline||t.fontStrikeOut)&&chunk7JVB7NLG_js.ea(e,t,c,i,l,a);}function Md(e,t,n,r){let{ctx:o,view:i,state:s}=e;if(r<76)return true;let a=(s.textAlign&1)!==0,u=a?s.curX:i.getInt32(n+28,true),l=a?s.curY:i.getInt32(n+32,true),c=i.getUint32(n+36,true),f=i.getUint32(n+40,true),m=Math.min(i.byteLength,t+r);if(c===0||f===0||c>Math.floor((m-t-f)/2)||n3(e,t,n,c,f,m))return true;let b=chunk7JVB7NLG_js.fa(i,t+f,c);if(b.length===0)return true;let d=ze(e)?Ee(e):null,p=d?Math.hypot(d[2],d[3]):Math.abs(st(e,1)),x=d?Math.hypot(d[0],d[1]):null;chunk7JVB7NLG_js.da(o,s,p);let y=r3(s.textAlign);o.textBaseline=o3(s.textAlign),o.textAlign=y==="center"?"center":y==="right"?"right":"left";let g=(i.getUint32(n+44,true)&Ei)!==0,M=gd(i,t,n,g?c*2:c,m),E=M&&g?M.filter((I,S)=>S%2===0):M,P=M&&g?M.filter((I,S)=>S%2===1):null,R=P?P.map(I=>d?I*p:st(e,I)):null,T=E?E.map(I=>x!==null?I*x:Ze(e,I)):null;if(!T&&s.textJustification&&!g){let I=b.split(""),S=I.map(C=>o.measureText(C).width),v=x??Ze(e,1);T=chunk7JVB7NLG_js.l(S,I.map(C=>C.charCodeAt(0)),s.textJustification.extra*v,s.textJustification.count);}T&&(o.textAlign="left");let w=d?Be(e,u,l):{x:He(e,u),y:$e(e,l)},A=chunk7JVB7NLG_js.o(s.fontEscapementTenthDeg);if(d&&p>0&&x?(o.save(),o.translate(w.x,w.y),o.transform(d[0]/x,d[1]/x,d[2]/p,d[3]/p,0,0),A!==0&&o.rotate(A),hc(o,s,b,T,0,0,y,p,R),o.restore()):A!==0?(o.save(),o.translate(w.x,w.y),o.rotate(A),hc(o,s,b,T,0,0,y,p,R),o.restore()):hc(o,s,b,T,w.x,w.y,y,p,R),a){let I=x??Ze(e,1),S=T&&I?chunk7JVB7NLG_js.k(T)/I:I?o.measureText(b).width/I:0,v=y==="center"?0:y==="right"?-S:S,C=y!=="center"&&P?chunk7JVB7NLG_js.k(P):0;s.curX+=v*Math.cos(A)-C*Math.sin(A),s.curY+=v*Math.sin(A)+C*Math.cos(A);}return true}function pc(e,t,n,r,o,i,s){let a=r.length,u=76,l=u+a*2+3&-4,c=s?s.length:0,f=l+c*4,m=new DataView(new ArrayBuffer(f));m.setUint32(44,a,true),m.setUint32(48,u,true),m.setUint32(52,o,true),m.setInt32(36,t,true),m.setInt32(40,n,true),m.setInt32(56,i[0],true),m.setInt32(60,i[1],true),m.setInt32(64,i[2],true),m.setInt32(68,i[3],true),m.setUint32(72,s?l:0,true);for(let h=0;h<a;h++)m.setUint16(u+h*2,r[h],true);if(s)for(let h=0;h<c;h++)m.setInt32(l+h*4,s[h],true);let b={...e,view:m};Md(b,0,8,f);}function Ed(e,t,n,r){let{view:o}=e;return qn(Array.from({length:n},(i,s)=>o.getUint8(t+s)),r,e.codePages)}function Pd(e,t,n){if(!e)return null;let r=[],o=0;for(let i of t){let s=0,a=0;for(let u=0;u<i;u++)s+=e[o+u*(n?2:1)]??0,n&&(a+=e[o+u*2+1]??0);r.push(s),n&&r.push(a),o+=i*(n?2:1);}return r}function i3(e,t,n,r,o){let{view:i,state:s}=e,a=Math.min(i.byteLength,t+r);if(r<40)return true;let u=i.getUint32(n+28,true),l=n+32;if(u>Math.floor((a-l)/40))return true;let c=s.fontDetails?.charSet??1;for(let f=0;f<u;f++){let m=l+f*40,b=i.getInt32(m,true),h=i.getInt32(m+4,true),d=i.getUint32(m+8,true),p=i.getUint32(m+12,true),x=i.getUint32(m+16,true),y=[i.getInt32(m+20,true),i.getInt32(m+24,true),i.getInt32(m+28,true),i.getInt32(m+32,true)],g=i.getUint32(m+36,true),M=o?2:1;if(!p||p>a-t||d>Math.floor((a-(t+p))/M))continue;let E=o?null:Ed(e,t+p,d,c),P=o?Array.from({length:d},(A,I)=>i.getUint16(t+p+I*2,true)):E.codes,R=null,T=(x&Ei)!==0,w=d*(T?2:1);g&&g<=a-t&&w<=Math.floor((a-(t+g))/4)&&(R=Array.from({length:w},(A,I)=>i.getInt32(t+g+I*4,true)),o||(R=Pd(R,E.byteLengths,T))),pc(e,b,h,P,x|Pa,y,R);}return true}function s3(e,t,n,r){let{view:o}=e,i=Math.min(o.byteLength,t+r);if(r<36)return true;let s=o.getInt32(n,true),a=o.getInt32(n+4,true),u=o.getUint32(n+8,true),l=o.getUint32(n+12,true),c=(l&512)!==0,f=(l&256)!==0,m=n+28+(f?0:16);if(m>i||u>Math.floor((i-m)/(c?1:2)))return true;let b=f?[0,0,0,0]:[o.getInt32(n+28,true),o.getInt32(n+32,true),o.getInt32(n+36,true),o.getInt32(n+40,true)],h=c?Array.from({length:u},(d,p)=>o.getUint8(m+p)):Array.from({length:u},(d,p)=>o.getUint16(m+p*2,true));return pc(e,s,a,h,l,b,null),true}function Rd(e,t,n,r,o){if(t===84)return Md(e,n,r,o);if(t===83||t===96||t===97||t===108){if(t===96||t===97)return i3(e,n,r,o,t===97);if(t===108)return s3(e,n,r,o);let{view:i,state:s}=e,a=Math.min(i.byteLength,n+o);if(o<76)return true;let u=i.getInt32(r+28,true),l=i.getInt32(r+32,true),c=i.getUint32(r+36,true),f=i.getUint32(r+40,true),m=i.getUint32(r+44,true);if(!f||f>a-n||c>a-(n+f))return true;let b=Ed(e,n+f,c,s.fontDetails?.charSet??1),h=[i.getInt32(r+48,true),i.getInt32(r+52,true),i.getInt32(r+56,true),i.getInt32(r+60,true)],d=i.getUint32(r+64,true),p=null,x=(m&Ei)!==0,y=c*(x?2:1);return d&&d<=a-n&&y<=Math.floor((a-(n+d))/4)&&(p=Array.from({length:y},(g,M)=>i.getInt32(n+d+M*4,true)),p=Pd(p,b.byteLengths,x)),pc(e,u,l,b.codes,m,h,p),true}return false}function wr(e,t,n){let r=al(n==="replace"?null:e.clipRegion??null,t,n,{x:0,y:0,w:e.canvasW,h:e.canvasH});r.exact||chunk7JVB7NLG_js.p(`gdiCombineClip: '${n}' approximated (region exceeds the scanline domain)`),e.clipRegion=r.region,Yt(e,r.region);}function Td(e,t){let{view:n}=e,r=n.getInt32(t,true),o=n.getInt32(t+4,true),i=n.getInt32(t+8,true),s=n.getInt32(t+12,true);return Bb(He(e,r),$e(e,o),Ze(e,i-r),st(e,s-o))}function m3(e,t,n){return n>=24&&wr(e,Td(e,t),"intersect"),true}function f3(e,t,n){return n>=24&&wr(e,Td(e,t),"exclude"),true}var xc={1:"intersect",2:"union",3:"xor",4:"exclude",5:"replace"};function b3(e,t,n){let{view:r}=e;if(n<16)return true;let o=r.getUint32(t,true),i=r.getUint32(t+4,true),s=xc[i];if(!s)return chunk7JVB7NLG_js.p(`EMR_EXTSELECTCLIPRGN: unknown RegionMode ${i}: ignored`),true;if(o===0)return s==="replace"&&(e.clipRegion=null,Yt(e,null),chunk7JVB7NLG_js.p("EMR_EXTSELECTCLIPRGN: RGN_COPY with empty region: clip reset")),true;let a=t+8;if(o<32)return true;let u=r.getUint32(a+8,true);if(u===0)return true;let l=[],c=a+32;for(let f=0;f<u;f++){let m=c+f*16;if(m+16>t+8+o)break;let b=r.getInt32(m,true),h=r.getInt32(m+4,true),d=r.getInt32(m+8,true),p=r.getInt32(m+12,true),x=xl(e,b),y=yl(e,h);l.push({x,y,w:xl(e,d)-x,h:yl(e,p)-y});}return l.length===0||(wr(e,mn(l),s),chunk7JVB7NLG_js.p(`EMR_EXTSELECTCLIPRGN: mode=${i} (${s}) with ${l.length} rect(s)`)),true}function h3(e,t,n){if(n>=16){let r=e.view.getInt32(t,true),o=e.view.getInt32(t+4,true);if(e.clipRegion){let i=In(e),s=Sn(e),a=Math.round(Ze(e,r)/i)*i,u=Math.round(st(e,o)/s)*s;e.clipRegion=mr(e.clipRegion,a,u),Yt(e,e.clipRegion),chunk7JVB7NLG_js.p(`EMR_OFFSETCLIPRGN: clip translated by (${r},${o}) logical units`);}}return true}function wd(e,t,n,r){switch(t){case 30:return m3(e,n,r);case 75:return b3(e,n,r);case 29:return f3(e,n,r);case 26:return h3(e,n,r);default:return false}}var p3=1;function x3(e,t,n){let r=new Uint8Array(t*n);if(!e.clipRegion)return r.fill(1),r;for(let o of tr(e.clipRegion,null,"intersect",{x:0,y:0,w:t,h:n}))for(let i=Math.max(0,o.y);i<Math.min(n,o.y+o.h);i++)r.fill(1,i*t+Math.max(0,o.x),i*t+Math.min(t,o.x+o.w));return r}function y3(e,t,n,r,o,i,s){let a=new chunk7JVB7NLG_js.s,u=(m,b)=>{let h=b*t+m;return s[h]===1&&i(e[h*4]<<16|e[h*4+1]<<8|e[h*4+2])};if(r<0||o<0||r>=t||o>=n||!u(r,o))return a;let l=new Uint8Array(t*n),c=[r,o],f=[];for(;c.length>0;){let m=c.pop(),b=c.pop();if(l[m*t+b]||!u(b,m))continue;let h=b;for(;h>0&&!l[m*t+h-1]&&u(h-1,m);)h--;let d=b+1;for(;d<t&&!l[m*t+d]&&u(d,m);)d++;l.fill(1,m*t+h,m*t+d),f.push([m,h,d]);for(let p of [m-1,m+1]){if(p<0||p>=n)continue;let x=false;for(let y=h;y<d;y++){let g=!l[p*t+y]&&u(y,p);g&&!x&&c.push(y,p),x=g;}}}f.sort((m,b)=>m[0]-b[0]||m[1]-b[1]);for(let[m,b,h]of f)a.add(m,b,h);return a}function Ad(e,t,n,r){if(t!==53)return false;if(r<24)return true;let{ctx:o,view:i,state:s}=e;if(!chunk7JVB7NLG_js.qa(o)||typeof o.getImageData!="function")return chunk7JVB7NLG_js.q("EMR_EXTFLOODFILL: the destination cannot be read back (SVG output without a raster mirror); skipped"),true;let a=on(e);if(!a)return true;let u=e.canvasW,l=e.canvasH,[c,f]=ge(e,i.getInt32(n,true),i.getInt32(n+4,true)),m=si(i.getUint32(n+8,true),tn(s)),b=i.getUint32(n+12,true)===p3,h;try{h=chunk7JVB7NLG_js.ka(o,0,0,u,l).data;}catch{return true}let d=y3(h,u,l,Math.round(c/16),Math.round(f/16),b?p=>p===m:p=>p!==m,x3(e,u,l));return at(e,d,a,s.rop2),true}var M3=0,Id=1,Cd=2;function E3(e,t,n,r){let o=Math.floor((t-e)*65536/r);return Math.floor((e*65536+o*n)/65536)>>8}function P3(e,t){let n=chunk7JVB7NLG_js.t([e.flatMap(m=>[m.x,m.y])],false);if(n.length===0)return;let[r,o,i]=e.map(m=>({x:m.x/16,y:m.y/16,c:m.c.map(b=>Math.min(b,65280))})),s=(o.x-r.x)*(i.y-r.y)-(i.x-r.x)*(o.y-r.y);if(s===0)return;let a=[0,1,2].map(m=>((o.c[m]-r.c[m])*(i.y-r.y)-(i.c[m]-r.c[m])*(o.y-r.y))/s),u=[0,1,2].map(m=>((i.c[m]-r.c[m])*(o.x-r.x)-(o.c[m]-r.c[m])*(i.x-r.x))/s),l=a.map(m=>Math.floor(m*65536)),c=n.data,f=c[0];for(let m=0;m<n.length*3;m+=3){let b=c[m],h=c[m+1],d=c[m+2];if(b<t.y||b>=t.y+t.h)continue;let p=[0,1,2].map(x=>r.c[x]+a[x]*(h-r.x)+u[x]*(b-r.y)+(b===f?0:.5));for(let x=Math.max(h,t.x);x<Math.min(d,t.x+t.w);x++){let y=0;for(let g=0;g<3;g++){let M=Math.floor(p[g]+l[g]*(x-h)/65536+1e-9)>>8;y=y<<8|Math.max(0,Math.min(255,M));}t.rgb[(b-t.y)*t.w+(x-t.x)]=y;}}}function R3(e,t,n){let{view:r}=e;if(n<36)return null;let o=r.getUint32(t+16,true),i=r.getUint32(t+20,true),s=r.getUint32(t+24,true),a=s===Cd?3:2,u=t+28,l=u+o*16;if(o>1e6||i>1e6||l+i*a*4>t-8+n)return null;let c=[];for(let m=0;m<o;m++){let b=u+m*16,[h,d]=ge(e,r.getInt32(b,true),r.getInt32(b+4,true));c.push({x:h,y:d,c:[r.getUint16(b+8,true),r.getUint16(b+10,true),r.getUint16(b+12,true)]});}let f=[];for(let m=0;m<i;m++){let b=[];for(let h=0;h<a;h++)b.push(r.getUint32(l+(m*a+h)*4,true));b.every(h=>h<o)&&f.push(b);}return {mode:s,vertices:c,mesh:f}}function Sd(e,t){let n=Math.max(0,t.x),r=Math.max(0,t.y),o=Math.min(e.canvasW,t.x+t.w),i=Math.min(e.canvasH,t.y+t.h);if(o<=n||i<=r)return;let s=o-n,a=i-r,u=new Uint8ClampedArray(s*a*4),l=false;for(let f=0;f<a;f++)for(let m=0;m<s;m++){let b=t.rgb[(f+r-t.y)*t.w+(m+n-t.x)];if(b<0)continue;let h=(f*s+m)*4;u[h]=b>>16&255,u[h+1]=b>>8&255,u[h+2]=b&255,u[h+3]=255,l=true;}let c=l?nn(s,a):null;c&&rn(e.ctx,{x:n,y:r,w:s,h:a},c,chunk7JVB7NLG_js.na(u,s,a));}function vd(e){return `#${e.map(t=>(t>>8).toString(16).padStart(2,"0")).join("")}`}function T3(e,t,n){let r=Math.round(e.x/16),o=Math.round(e.y/16),i=Math.round(t.x/16),s=Math.round(t.y/16),a=(n?o<=s:r<=i)?e:t;return {l:Math.min(r,i),t:Math.min(o,s),r:Math.max(r,i),b:Math.max(o,s),first:a,second:a===e?t:e}}function Dd(e,t,n,r){if(t!==118)return false;let o=R3(e,n,r);if(!o)return true;let{ctx:i}=e;if(o.mode===M3||o.mode===Id){let s=o.mode===Id,a=chunk7JVB7NLG_js.pa(i)&&e.gdiAntialias!==false;for(let[u,l]of o.mesh){let c=T3(o.vertices[u],o.vertices[l],s),f=c.r-c.l,m=c.b-c.t;if(f<=0||m<=0)continue;if(a){let M=s?m:f,E=s?i.createLinearGradient(0,c.t,0,c.t+M):i.createLinearGradient(c.l,0,c.l+M,0);E.addColorStop(0,vd(c.first.c)),E.addColorStop(1,vd(c.second.c)),i.save(),i.setTransform(1,0,0,1,0,0),i.fillStyle=E,i.fillRect(c.l,c.t,f,m),i.restore();continue}let b=Math.max(c.l,0),h=Math.max(c.t,0),d=Math.min(c.r,e.canvasW),p=Math.min(c.b,e.canvasH);if(d<=b||p<=h)continue;let x={x:b,y:h,w:d-b,h:p-h,rgb:new Int32Array((d-b)*(p-h))},y=s?m:f,g=[];for(let M=s?h-c.t:b-c.l;M<(s?p-c.t:d-c.l);M++){let E=0;for(let P=0;P<3;P++)E=E<<8|Math.max(0,Math.min(255,E3(c.first.c[P],c.second.c[P],M,y)));g.push(E);}for(let M=0;M<x.h;M++)for(let E=0;E<x.w;E++)x.rgb[M*x.w+E]=g[s?M:E];Sd(e,x);}return true}if(o.mode===Cd)for(let s of o.mesh){let a=s.map(d=>o.vertices[d]),u=a.map(d=>d.x/16),l=a.map(d=>d.y/16),c=Math.max(0,Math.floor(Math.min(...u))-1),f=Math.max(0,Math.floor(Math.min(...l))-1),m=Math.min(e.canvasW,Math.ceil(Math.max(...u))+1),b=Math.min(e.canvasH,Math.ceil(Math.max(...l))+1);if(m<=c||b<=f)continue;let h={x:c,y:f,w:m-c,h:b-f,rgb:new Int32Array((m-c)*(b-f)).fill(-1)};P3(a,h),Sd(e,h);}return true}var S3=6;function yc(e,t,n){let r=[];if(n<32||t+32>e.byteLength)return r;let o=e.getUint32(t+8,true),i=Math.min(e.byteLength,t+n);for(let s=0;s<o;s++){let a=t+32+s*16;if(a+16>i)break;r.push([e.getInt32(a,true),e.getInt32(a+4,true),e.getInt32(a+8,true),e.getInt32(a+12,true)]);}return r}function gc(e,t){let n=new chunk7JVB7NLG_js.s;if(ze(e)){let r=t.map(([o,i,s,a])=>[...ge(e,o,i),...ge(e,s,i),...ge(e,s,a),...ge(e,o,a)]);return chunk7JVB7NLG_js.t(r,true,n)}for(let[r,o,i,s]of t){let a=Math.round(He(e,r)),u=Math.round(He(e,i)),l=Math.round($e(e,o)),c=Math.round($e(e,s)),f=Math.min(a,u),m=Math.max(a,u);for(let b=Math.min(l,c);b<Math.max(l,c);b++)n.add(b,f,m);}return n}function v3(e,t,n){let r=new chunk7JVB7NLG_js.s,o=e.bounds();if(!o)return r;let i=o.x1-o.x0,s=o.y1-o.y0,a=new Uint8Array(i*s),u=e.data;for(let f=0;f<e.length*3;f+=3)a.fill(1,(u[f]-o.y0)*i+u[f+1]-o.x0,(u[f]-o.y0)*i+u[f+2]-o.x0);let l=new Uint8Array(i*s);for(let f=0;f<s;f++)for(let m=0;m<i;m++){let b=1;for(let h=-t;h<=t&&b;h++){let d=m+h;b=d>=0&&d<i?a[f*i+d]:0;}l[f*i+m]=b;}let c=(f,m)=>{for(let b=-n;b<=n;b++){let h=m+b;if(h<0||h>=s||!l[h*i+f])return false}return true};for(let f=0;f<s;f++){let m=-1;for(let b=0;b<=i;b++){let h=b<i&&a[f*i+b]===1&&!c(b,f);h&&m<0?m=b:!h&&m>=0&&(r.add(f+o.y0,m+o.x0,b+o.x0),m=-1);}}return r}function Ud(e,t){let n=t>=2147483648?chunk7JVB7NLG_js.ga(t-2147483648):e.objectTable.get(t)??null;return n&&n.kind==="brush"?n:null}function Mc(e,t,n){let{state:r}=e,o={style:r.brushStyle,color:r.brushColor,pattern:r.brushPattern};n&&(r.brushStyle=n.style,r.brushColor=n.colorRef!==void 0?xt(r,n.colorRef):n.color,r.brushPattern=n.pattern??null);try{let i=on(e);i&&at(e,t,i,r.rop2);}finally{r.brushStyle=o.style,r.brushColor=o.color,r.brushPattern=o.pattern;}}function Fd(e,t,n,r){let{view:o}=e;switch(t){case 71:{if(r>=32){let i=o.getUint32(n+16,true),s=Ud(e,o.getUint32(n+20,true));s&&Mc(e,gc(e,yc(o,n+24,i)),s);}return true}case 72:{if(r>=40){let i=o.getUint32(n+16,true),s=Ud(e,o.getUint32(n+20,true)),a=Math.round(Math.abs(Ze(e,o.getInt32(n+24,true)))),u=Math.round(Math.abs(st(e,o.getInt32(n+28,true))));if(s){let l=gc(e,yc(o,n+32,i));Mc(e,v3(l,a,u),s);}}return true}case 73:case 74:{if(r>=24){let i=o.getUint32(n+16,true),s=gc(e,yc(o,n+20,i));t===73?at(e,s,{kind:"solid",rgb:0},S3):Mc(e,s,null);}return true}default:return false}}function kd(e,t,n,r,o){return Rd(e,t,n,r,o)||ed(e,t,n,r,o)||nd(e,t,n,r,o)||wd(e,t,r,o)||Fd(e,t,r,o)||Ad(e,t,r,o)||Dd(e,t,r,o)}function Aa(e,t,n,r,o){return kh(e,t,r,o)||kd(e,t,n,r,o)}function C3(e,t,n,r,o,i,s){let{view:a}=t,u=0;for(let l=0;l<o;l++){let c=a.getUint32(r+l*4,true);for(let f=0;f<c&&u<i;f++){let m=n(u);f===0?e.moveTo(m.x,m.y):e.lineTo(m.x,m.y),u++;}s&&e.closePath();}}function _d(e,t,n,r,o,i,s){let{view:a}=t,u=0;for(let l=0;l<o;l++){let c=a.getUint32(r+l*4,true);for(let f=0;f<c&&u<i;f++){let[m,b]=n(u),[h,d]=ge(t,m,b);f===0?e.moveTo(h,d):e.lineTo(h,d),u++;}s&&c>0&&e.closeFigure();}}function Ia(e,t,n,r,o,i){let{view:s,state:a,inPath:u}=e,l=s.getUint32(n+16,true),c=s.getUint32(n+20,true);if(l===0||l>=1e4||c>=1e5)return;let f=n+24,m=f+l*4;if(m+c*o>t+r)return;let b=p=>o===8?[s.getInt32(m+p*8,true),s.getInt32(m+p*8+4,true)]:[s.getInt16(m+p*4,true),s.getInt16(m+p*4+2,true)],h=p=>{let[x,y]=b(p);return Be(e,x,y)},d=p=>{C3(p,e,h,f,l,c,i);};if(u){d(Wt(e)),e.rasterPath??(e.rasterPath=new chunk7JVB7NLG_js.F),_d(e.rasterPath,e,b,f,l,c,i);return}e.lineStyle={pos:0},Qe(e,{build:p=>{p.beginPath(),d(p);},raster:()=>{let p=new chunk7JVB7NLG_js.F;return _d(p,e,b,f,l,c,i),p},fill:i,stroke:true,fillRule:a.polyFillMode===2?"nonzero":"evenodd"});}function Bd(e,t,n,r){Ia(e,t,n,r,8,true);}function Gd(e,t,n,r){Ia(e,t,n,r,8,false);}function Od(e,t,n,r){Ia(e,t,n,r,4,false);}function Nd(e,t,n,r){Ia(e,t,n,r,4,true);}function zd(e,t,n,r,o){let{state:i,inPath:s}=e,{polygon:a,bezier:u,to:l}=o,c=h=>{let[d,p]=r(h);return Be(e,d,p)},f=h=>{if(!l){let p=c(0);h.moveTo(p.x,p.y);}let d=l?0:1;if(u)for(;d+2<n;){let p=c(d),x=c(d+1),y=c(d+2);h.bezierCurveTo(p.x,p.y,x.x,x.y,y.x,y.y),d+=3;}else for(;d<n;d++){let p=c(d);h.lineTo(p.x,p.y);}a&&h.closePath();},m=h=>{let[d,p]=r(h);return ge(e,d,p)},b=(h,d)=>{let p=0;if(l)d&&h.moveTo(d[0],d[1]);else {let x=m(0);h.moveTo(x[0],x[1]),p=1;}if(u)for(;p+2<n;p+=3){let x=m(p),y=m(p+1),g=m(p+2);h.bezierTo(x[0],x[1],y[0],y[1],g[0],g[1]);}else for(;p<n;p++){let x=m(p);h.lineTo(x[0],x[1]);}a&&h.closeFigure();};if(s)l&&so(e),f(Wt(e)),e.rasterPath??(e.rasterPath=new chunk7JVB7NLG_js.F),b(e.rasterPath,null);else {let h=l?Ln(e):null,d=l?Be(e,i.curX,i.curY):null;e.lineStyle={pos:0},Qe(e,{build:p=>{p.beginPath(),d&&p.moveTo(d.x,d.y),f(p);},raster:()=>{let p=new chunk7JVB7NLG_js.F;return b(p,h),p},fill:a,stroke:true,fillRule:i.polyFillMode===2?"nonzero":"evenodd"});}if(l&&n>0){let[h,d]=r(n-1);i.curX=h,i.curY=d,e.curFix=void 0;}}function V3(e,t,n,r,o){let{view:i}=e;if(o<28)return true;let s=i.getUint32(r+16,true),a=r+20;return s===0||a+s*8>n+o||zd(e,t,s,u=>[i.getInt32(a+u*8,true),i.getInt32(a+u*8+4,true)],{polygon:t===3,bezier:t===2||t===5,to:t===5||t===6}),true}function z3(e,t,n,r,o){let{view:i}=e;if(o<28)return true;let s=i.getUint32(r+16,true),a=r+20;return s===0||a+s*4>n+o||zd(e,t,s,u=>[i.getInt16(a+u*4,true),i.getInt16(a+u*4+2,true)],{polygon:t===86,bezier:t===85||t===88,to:t===88||t===89}),true}var Ec=1,q3=2,J3=4,Wd=6;function Hd(e,t,n,r,o){let{view:i,state:s,inPath:a}=e;if(r<28)return;let u=i.getUint32(n+16,true),l=n+20,c=l+u*o;if(u===0||u>1e6||c+u>t+r)return;let f=x=>o===8?[i.getInt32(l+x*8,true),i.getInt32(l+x*8+4,true)]:[i.getInt16(l+x*4,true),i.getInt16(l+x*4+2,true)],m=x=>i.getUint8(c+x),b=(x,y,g,M)=>{let E=false,P=()=>{E||(M&&x?.moveTo(M.x,M.y),g&&y?.moveTo(g[0],g[1]),E=true);};for(let R=0;R<u;R++){let w=m(R)&~Ec;if(w===Wd){let[A,I]=f(R),S=Be(e,A,I),v=ge(e,A,I);x?.moveTo(S.x,S.y),y?.moveTo(v[0],v[1]),E=true;continue}if(w===q3){P();let[A,I]=f(R),S=Be(e,A,I),v=ge(e,A,I);x?.lineTo(S.x,S.y),y?.lineTo(v[0],v[1]);}else if(w===J3&&R+2<u){P();let A=[0,1,2].map(v=>f(R+v)),I=A.map(([v,C])=>Be(e,v,C)),S=A.map(([v,C])=>ge(e,v,C));x?.bezierCurveTo(I[0].x,I[0].y,I[1].x,I[1].y,I[2].x,I[2].y),y?.bezierTo(S[0][0],S[0][1],S[1][0],S[1][1],S[2][0],S[2][1]),R+=2;}else continue;m(R)&Ec&&(x?.closePath(),y?.closeFigure());}},h=(m(0)&~Ec)===Wd;if(a)h||so(e),e.rasterPath??(e.rasterPath=new chunk7JVB7NLG_js.F),b(Wt(e),e.rasterPath,null,null);else {let x=h?null:Ln(e),y=h?null:Be(e,s.curX,s.curY);e.lineStyle={pos:0},Qe(e,{build:g=>{g.beginPath(),b(g,null,null,y);},raster:()=>{let g=new chunk7JVB7NLG_js.F;return b(null,g,x,null),g},fill:false,stroke:true});}let[d,p]=f(u-1);s.curX=d,s.curY=p,e.curFix=void 0;}function K3(e){let t=[];for(let n of e)n.op==="moveTo"&&t.length>0&&t.push({op:"closePath"}),t.push(n);return t.length>0&&t.push({op:"closePath"}),t}function Pc(e,t,n){let{state:r}=e,o=t&&n,i=o?K3(e.pathCmds):e.pathCmds,s=u=>{u.beginPath(),lh(u,i);},a=e.rasterPath??new chunk7JVB7NLG_js.F;if(o){let u=new chunk7JVB7NLG_js.F;u.append(a);for(let l of u.figures)l.closed=true;a=u;}Qe(e,{build:s,raster:()=>a,fill:t,stroke:n,fillRule:r.polyFillMode===2?"nonzero":"evenodd"});}function Ti(e){e.pathCmds=[],e.rasterPath=new chunk7JVB7NLG_js.F;}function qd(e){let t=[];for(let n of e.rasterPath?.figures??[]){for(let r=0;r+1<n.pts.length;r+=2)t.push({op:r===0?"moveTo":"lineTo",x:n.pts[r]/16,y:n.pts[r+1]/16});n.closed&&t.push({op:"closePath"});}e.pathCmds=t;}function Z3(e){if(!(e.inPath||!e.rasterPath)){for(let t of e.rasterPath.figures)delete t.tangents,delete t.curveSegs,delete t.roundWiden;qd(e);}}function Q3(e){let{state:t}=e;if(e.inPath||!e.rasterPath||(t.penStyle&15)===5)return;let n=yt(e)?{width:16,cap:"round",join:"round",miterLimit:t.miterLimit??10}:Ll(e),r=ai(e.rasterPath,n),o=new chunk7JVB7NLG_js.F;for(let i of r)if(!(i.length<4)){o.moveTo(i[0],i[1]);for(let s=2;s+1<i.length;s+=2)o.lineTo(i[s],i[s+1]);o.closeFigure();}e.rasterPath=o,qd(e);}function va(e,t,n,r,o){let{ctx:i,state:s}=e;switch(t){case 4:case 3:case 2:case 5:case 6:return V3(e,t,n,r,o);case 87:case 86:case 85:case 88:case 89:return z3(e,t,n,r,o);case 7:return o>=28&&Gd(e,n,r,o),true;case 8:return o>=28&&Bd(e,n,r,o),true;case 91:return o>=28&&Nd(e,n,r,o),true;case 56:return Hd(e,n,r,o,8),true;case 92:return Hd(e,n,r,o,4),true;case 90:return o>=28&&Od(e,n,r,o),true;case 59:return e.inPath=true,e.pathCmds=[],e.rasterPath=new chunk7JVB7NLG_js.F,i.beginPath(),true;case 60:return e.inPath=false,true;case 61:return i.closePath(),e.inPath&&(e.pathCmds.push({op:"closePath"}),e.rasterPath?.closeFigure()),true;case 62:return Pc(e,true,false),Ti(e),true;case 63:return Pc(e,true,true),Ti(e),true;case 64:return Pc(e,false,true),Ti(e),true;case 65:return Z3(e),true;case 66:return Q3(e),true;case 68:return e.inPath=false,Ti(e),i.beginPath(),true;case 67:{let a=o>=12?e.view.getUint32(r,true):5,u=xc[a];if(e.inPath||!e.rasterPath||e.rasterPath.figures.length===0)return true;if(!u)return chunk7JVB7NLG_js.p(`EMR_SELECTCLIPPATH: unknown RegionMode ${a}: ignored`),true;let l=Tl(chunk7JVB7NLG_js.G(e.rasterPath,s.polyFillMode===2)),c=l.length>0?mn(l):Ot();return wr(e,c,u),Ti(e),true}default:return false}}var yP=new Set([16,99,100,101,102,103,104,105,106,109,110,111,112,113,119,121,122]);function Jd(e,t,n,r){let{view:o,state:i}=e;switch(t){case 120:{if(r>=16){let s=o.getInt32(n,true),a=o.getInt32(n+4,true);i.textJustification=s!==0&&a>0?{extra:s,count:a}:void 0;}return true}case 23:{let s=r>=8+Us?Fs(o,n):null;return s?i.colorAdjustment=s:chunk7JVB7NLG_js.p("EMR_SETCOLORADJUSTMENT: invalid COLORADJUSTMENT ignored"),true}default:return yP.has(t)?(chunk7JVB7NLG_js.p(`EMF record ${t} consumed (no effect on a raster surface)`),true):false}}function Zd(e,t,n,r){let{view:o,state:i}=e;switch(t){case 38:{if(r>=28){let s=o.getUint32(n,true),a=o.getUint32(n+4,true),u=o.getInt32(n+8,true),l=jn(o,n+16),c=xt(i,l);e.objectTable.set(s,{kind:"pen",style:a&255,widthX:u,color:c,flags:a,...ii(l)?{colorRef:l}:{}});}return true}case 95:{if(r>=52){let s=o.getUint32(n,true),a=o.getUint32(n+20,true),u=o.getInt32(n+24,true),l=jn(o,n+32),c=xt(i,l),f=o.getUint32(n+40,true),m=[];if((a&15)===7)for(let b=0;b<f&&b<16&&52+b*4+4<=r;b++)m.push(o.getUint32(n+44+b*4,true));e.objectTable.set(s,{kind:"pen",style:a&15,widthX:u,color:c,flags:a,extended:true,...ii(l)?{colorRef:l}:{},...m.length>0?{userStyle:m}:{}});}return true}case 39:{if(r>=24){let s=o.getUint32(n,true),a=o.getUint32(n+4,true),u=jn(o,n+8),l=xt(i,u),c=o.getUint32(n+12,true);e.objectTable.set(s,{kind:"brush",style:a,color:l,...ii(u)?{colorRef:u}:{},...a===2&&c<=5?{pattern:{kind:"hatch",hatch:c}}:{}});}return true}case 93:case 94:{if(r>=32){let s=o.getUint32(n,true),a=t===93,u=o.getUint32(n+4,true),l=chunk7JVB7NLG_js.g(o,n-8,n,a,u===1?tn(i):null);e.objectTable.set(s,{kind:"brush",style:l?a?3:6:0,color:"#808080",...l?{pattern:l}:{}});}return true}case 82:{if(r>=332){let s=o.getUint32(n,true),a=o.getInt32(n+4,true),u=o.getInt32(n+8,true),l=o.getInt32(n+12,true),c=o.getInt32(n+16,true),f=o.getInt32(n+20,true),m=o.getUint8(n+24),b=o.getUint8(n+25),h=o.getUint8(n+26),d=o.getUint8(n+27),p=o.getUint8(n+30),x=o.getUint8(n+31),y=chunk7JVB7NLG_js.fa(o,n+32,32)||"sans-serif";e.objectTable.set(s,{kind:"font",height:a,weight:f,italic:m!==0,underline:b!==0,strikeOut:h!==0,family:y,escapementTenthDeg:l,details:{width:u,orientationTenthDeg:c,charSet:d,quality:p,pitchAndFamily:x}});}return true}case 37:{if(r>=12){let s=o.getUint32(n,true),a=s>=2147483648?chunk7JVB7NLG_js.ga(s-2147483648):e.objectTable.get(s)??null;if(a)switch(a.kind){case "pen":i.penStyle=a.style,i.penWidth=a.widthX,i.penColor=a.colorRef!==void 0?xt(i,a.colorRef):a.color,Zr(i,"pen",a.colorRef),i.penFlags=a.flags??a.style,i.penUserStyle=a.userStyle,i.penExtended=a.extended===true;break;case "brush":i.brushStyle=a.style,i.brushColor=a.colorRef!==void 0?xt(i,a.colorRef):a.color,Zr(i,"brush",a.colorRef),i.brushPattern=a.pattern??null;break;case "font":i.fontHeight=a.height,i.fontWeight=a.weight,i.fontItalic=a.italic,i.fontUnderline=a.underline,i.fontStrikeOut=a.strikeOut,i.fontFamily=a.family,i.fontEscapementTenthDeg=a.escapementTenthDeg??0,i.fontDetails=a.details;break}}return true}case 40:return r>=12&&e.objectTable.delete(o.getUint32(n,true)),true;default:return false}}function Ic(e){return {...e.dpi?{dpi:{...e.dpi}}:{},mode:e.mode,winOrg:{...e.winOrg},winExt:{...e.winExt},vpOrg:{...e.vpOrg},vpExt:{...e.vpExt}}}var wP={2:254,3:2540,4:100,5:1e3,6:1440};function bo(e){if(e.mode!==7||!e.winExt.cx||!e.winExt.cy)return;let t=Math.abs(e.vpExt.cx/e.winExt.cx)/(e.dpi?.x??96),n=Math.abs(e.vpExt.cy/e.winExt.cy)/(e.dpi?.y??96);if(t>n){let r=e.vpExt.cx>=0?1:-1;e.vpExt.cx=Math.floor(e.vpExt.cx*n/t+.5)||r;}else if(n>t){let r=e.vpExt.cy>=0?1:-1;e.vpExt.cy=Math.floor(e.vpExt.cy*t/n+.5)||r;}}function Da(e,t){if(t<1||t>8)return;let n=wP[t===7?2:t];t===1?(e.winExt={cx:1,cy:1},e.vpExt={cx:1,cy:1}):n!==void 0&&(t!==7||e.mode!==7)&&(e.winExt={cx:n,cy:n},e.vpExt={cx:e.dpi?.x??96,cy:-(e.dpi?.y??96)}),e.mode=t;}function Ar(e){return e.mode===7||e.mode===8}function Qd(e,t,n){!Ar(e)||t===0||n===0||(e.winExt={cx:t,cy:n},bo(e));}function ep(e,t,n){!Ar(e)||t===0||n===0||(e.vpExt={cx:t,cy:n},bo(e));}function Ca(e,t,n){let r=Math.imul(e,t);return r===-2147483648&&n===-1?0:Math.trunc(r/n)}function La(e,t,n,r,o){if(!Ar(e)||!n||!o)return;let i=Ca(e.winExt.cx,t,n),s=Ca(e.winExt.cy,r,o);i===0||s===0||(e.winExt={cx:i,cy:s},bo(e));}function Ua(e,t,n,r,o){if(!Ar(e)||!n||!o)return;let i=Ca(e.vpExt.cx,t,n),s=Ca(e.vpExt.cy,r,o);i===0||s===0||(e.vpExt={cx:i,cy:s},bo(e));}function Sc(e,t,n,r,o=0){e.wmfLayoutRtl=o>0,e.useMappingMode=true,e.windowOrg={x:t.winOrg.x,y:t.winOrg.y},e.windowExt={cx:t.winExt.cx||1,cy:t.winExt.cy||1},e.viewportOrg={x:t.vpOrg.x*n,y:t.vpOrg.y*r},e.viewportExt={cx:(t.vpExt.cx||1)*n,cy:(t.vpExt.cy||1)*r},o>0&&(e.viewportOrg.x=o*n-e.viewportOrg.x,e.viewportExt.cx=-e.viewportExt.cx);}function AP(e,t){let n={mode:null,winExt:null,vpExt:null},r=t,o=0;for(;r+6<=e.byteLength&&o++<1e6;){let i=e.getUint32(r,true)*2,s=e.getUint16(r+4,true);if(i<6||r+i>e.byteLength||s===0)break;let a=r+6;s===259&&i>=8&&n.mode===null?n.mode=e.getUint16(a,true):s===524&&i>=10&&!n.winExt?n.winExt={cy:e.getInt16(a,true),cx:e.getInt16(a+2,true)}:s===526&&i>=10&&!n.vpExt&&(n.vpExt={cy:e.getInt16(a,true),cx:e.getInt16(a+2,true)}),r+=i;}return n}function ho(e,t,n){let r=d=>typeof d=="number"&&Number.isFinite(d)&&d>0?d:96,o={x:r(typeof n=="number"?n:n?.x),y:r(typeof n=="number"?n:n?.y)},i=n===void 0?{}:{dpi:o},s=t.boundsRight-t.boundsLeft,a=t.boundsBottom-t.boundsTop;if(t.placeable!==false){let d=t.unitsPerInch>0?t.unitsPerInch:96,p=Math.max(1,Math.round(Math.abs(s)*o.x/d)),x=Math.max(1,Math.round(Math.abs(a)*o.y/d));return {width:p,height:x,mapping:{...i,mode:8,winOrg:{x:t.boundsLeft,y:t.boundsTop},winExt:{cx:s||1,cy:a||1},vpOrg:{x:0,y:0},vpExt:{cx:p,cy:x}}}}let u=AP(e,t.headerSize),c=(u.mode===7||u.mode===8)&&u.vpExt?u.vpExt:u.winExt,f=Math.abs(c?c.cx:s),m=Math.abs(c?c.cy:a),b=Math.max(1,f||1),h=Math.max(1,m||1);return {width:b,height:h,mapping:{...i,mode:8,winOrg:{x:0,y:0},winExt:{cx:b,cy:h},vpOrg:{x:0,y:0},vpExt:{cx:b,cy:h}}}}function _P(e){if(e.byteLength<88||e.getUint32(0,true)!==1)return;let t=e.getInt32(72,true),n=e.getInt32(76,true),r=e.getInt32(80,true),o=e.getInt32(84,true);if(!(t<=0||n<=0||r<=0||o<=0))return {x:t*25.4/r,y:n*25.4/o}}function vc(e){let t=_P(e.view);return {...t?{dpi:t}:{},mode:e.mapMode??1,winOrg:e.windowOrg,winExt:{...e.windowExt},vpOrg:e.viewportOrg,vpExt:{...e.viewportExt}}}function Cc(e,t){e.mapMode=t.mode,e.windowExt=t.winExt,e.viewportExt=t.vpExt;}function np(e,t,n,r){let o=vc(e);!Ar(o)||n===0||r===0||(t?o.vpExt={cx:n,cy:r}:o.winExt={cx:n,cy:r},bo(o),Cc(e,o),Qr(e));}function BP(e,t,n,r,o,i){let s=vc(e);!Ar(s)||!r||!i||((t?Ua:La)(s,n,r,o,i),!(e.windowExt.cx===s.winExt.cx&&e.windowExt.cy===s.winExt.cy&&e.viewportExt.cx===s.vpExt.cx&&e.viewportExt.cy===s.vpExt.cy)&&(Cc(e,s),Qr(e)));}function GP(e,t,n,r){let{view:o}=e;switch(t){case 9:return r>=16&&np(e,false,o.getInt32(n,true),o.getInt32(n+4,true)),true;case 10:return r>=16&&(e.windowOrg.x=o.getInt32(n,true),e.windowOrg.y=o.getInt32(n+4,true),Qr(e)),true;case 11:return r>=16&&np(e,true,o.getInt32(n,true),o.getInt32(n+4,true)),true;case 12:return r>=16&&(e.viewportOrg.x=o.getInt32(n,true),e.viewportOrg.y=o.getInt32(n+4,true),Qr(e)),true;case 17:{if(r>=12){let i=o.getUint32(n,true);if(i>=1&&i<=8){let s=vc(e);Da(s,i),Cc(e,s),Qr(e);}}return true}case 31:case 32:return r>=24&&BP(e,t===31,o.getInt32(n,true),o.getInt32(n+4,true),o.getInt32(n+8,true),o.getInt32(n+12,true)),true;default:return false}}function OP(e,t,n,r){let{view:o,state:i}=e;switch(t){case 35:return r>=32&&(i.worldTransform=[o.getFloat32(n,true),o.getFloat32(n+4,true),o.getFloat32(n+8,true),o.getFloat32(n+12,true),o.getFloat32(n+16,true),o.getFloat32(n+20,true)]),true;case 36:{if(r>=36){let s=o.getUint32(n+24,true);if(s===1)i.worldTransform=[1,0,0,1,0,0];else if(s===2||s===3){let a=[o.getFloat32(n,true),o.getFloat32(n+4,true),o.getFloat32(n+8,true),o.getFloat32(n+12,true),o.getFloat32(n+16,true),o.getFloat32(n+20,true)],[u,l,c,f,m,b]=i.worldTransform;s===2?i.worldTransform=[a[0]*u+a[1]*c,a[0]*l+a[1]*f,a[2]*u+a[3]*c,a[2]*l+a[3]*f,a[4]*u+a[5]*c+m,a[4]*l+a[5]*f+b]:i.worldTransform=[u*a[0]+l*a[2],u*a[1]+l*a[3],c*a[0]+f*a[2],c*a[1]+f*a[3],m*a[0]+b*a[2]+a[4],m*a[1]+b*a[3]+a[5]];}}return true}default:return false}}function op(e,t,n,r){return GP(e,t,n,r)||OP(e,t,n,r)}function Fa(){return {penColor:"#000000",penWidth:1,penStyle:0,brushColor:"#ffffff",brushStyle:0,brushPattern:null,brushOrgX:0,brushOrgY:0,stretchBltMode:1,textColor:"#000000",bkColor:"#ffffff",bkMode:2,fontHeight:-12,fontWeight:400,fontItalic:false,fontFamily:"sans-serif",fontUnderline:false,fontStrikeOut:false,fontEscapementTenthDeg:0,rop2:13,curX:0,curY:0,polyFillMode:1,textAlign:0,worldTransform:[1,0,0,1,0,0]}}function ka(e){return {...e,worldTransform:[...e.worldTransform]}}function _a(){return {objectTable:new Map,worldTransform:[1,0,0,1,0,0],saveStack:[],saveIdMap:new Map,clipRegion:null,clipSaveDepth:0}}function Ii(e,t,n,r,o){if(op(e,t,r,o)||Zd(e,t,r,o)||uh(e,t,r,o)||Jd(e,t,r,o))return true;let{ctx:i,view:s,state:a}=e;switch(t){case 33:{for(;e.clipSaveDepth>0;)i.restore(),e.clipSaveDepth--;return e.clipStack??(e.clipStack=[]),e.clipStack.push({region:e.clipRegion??null}),e.mappingStack??(e.mappingStack=[]),e.mappingStack.push({mapMode:e.mapMode,windowOrg:{...e.windowOrg},windowExt:{...e.windowExt},viewportOrg:{...e.viewportOrg},viewportExt:{...e.viewportExt},useMappingMode:e.useMappingMode}),e.stateStack.push(ka(a)),i.save(),e.clipRegion&&Yt(e,e.clipRegion),true}case 34:{if(o>=12){let u=s.getInt32(r,true);if(u<0&&(u=e.stateStack.length+u+1),u<1||u>e.stateStack.length)return true;for(;e.clipSaveDepth>0;)i.restore(),e.clipSaveDepth--;for(;e.stateStack.length>u;)e.stateStack.pop(),e.clipStack?.pop(),e.mappingStack?.pop(),i.restore();let l=e.stateStack.pop();if(l){let c=e.clipStack?.pop(),f=e.mappingStack?.pop();Object.assign(a,l),f&&Object.assign(e,f),i.restore(),e.clipRegion=c?.region??null,e.clipRegion&&Yt(e,e.clipRegion);}}return true}case 24:{if(o>=12){let u=jn(s,r);a.textColor=xt(a,u),Zr(a,"text",u);}return true}case 25:{if(o>=12){let u=jn(s,r);a.bkColor=xt(a,u),Zr(a,"bk",u);}return true}case 18:return o>=12&&(a.bkMode=s.getUint32(r,true)),true;case 19:return o>=12&&(a.polyFillMode=s.getUint32(r,true)),true;case 20:return o>=12&&(a.rop2=s.getUint32(r,true)),true;case 21:return o>=12&&(a.stretchBltMode=s.getUint32(r,true)),true;case 13:return o>=16&&(a.brushOrgX=s.getInt32(r,true),a.brushOrgY=s.getInt32(r+4,true)),true;case 58:{if(o>=12){let u=s.getFloat32(r,true);a.miterLimit=Number.isFinite(u)&&u>=1?u:Math.max(1,s.getUint32(r,true));}return true}case 57:return o>=12&&(a.arcDirection=s.getUint32(r,true)===2?2:1),true;case 22:return o>=12&&(a.textAlign=s.getUint32(r,true)),true;default:return false}}function _c(e,t,n){return n?{x:e.getInt16(t,true),y:e.getInt16(t+2,true),w:e.getInt16(t+4,true),h:e.getInt16(t+6,true)}:{x:e.getFloat32(t,true),y:e.getFloat32(t+4,true),w:e.getFloat32(t+8,true),h:e.getFloat32(t+12,true)}}function Bc(e,t,n){return n?{x:e.getInt16(t,true),y:e.getInt16(t+2,true)}:{x:e.getFloat32(t,true),y:e.getFloat32(t+4,true)}}var jP=16384,Gc=2048;function ip(e,t,n){if(t>=n)return null;let r=e.getUint8(t);if(r&128){let i=r&127;return {value:i&64?i-128:i,size:1}}if(t+2>n)return null;let o=r<<8|e.getUint8(t+1);return {value:o&16384?o-32768:o,size:2}}function Un(e,t,n,r,o){if(!(r>=0)||r>1e6)return null;let i=[];if(o&Gc){let u=t,l=0,c=0;for(let f=0;f<r;f++){let m=ip(e,u,n);if(!m)return null;u+=m.size;let b=ip(e,u,n);if(!b)return null;u+=b.size,l+=m.value,c+=b.value,i.push({x:l,y:c});}return i}let s=(o&jP)!==0,a=s?4:8;if(t+r*a>n)return null;for(let u=0;u<r;u++)i.push(Bc(e,t+u*a,s));return i}var YP=64;function VP(e){return Math.floor(e*16+.5-1e-4)}function sp(e,t,n,r,o){let i;try{i=En(e,t).map(u=>u.pts.map(VP));}catch{return null}let s=ot(i.filter(u=>u.length>=6),n,false,o,r),a=new Uint8Array(r.w*r.h);for(let u=0;u<a.length;u++)a[u]=s[u]?1:0;return a}function Ba(e,t,n,r,o=0){if(o>YP)return null;switch(e.type){case "infinite":return new Uint8Array(n.w*n.h).fill(1);case "empty":return new Uint8Array(n.w*n.h);case "rect":{let{x:i,y:s,width:a,height:u}=e;return sp(l=>l.rect(i,s,a,u),t,false,n,r)}case "path":{let i=e.path;return sp(s=>$r(s,i),t,i.fillRule==="evenodd",n,r)}case "combine":{let i=Ba(e.left,t,n,r,o+1),s=i?Ba(e.right,t,n,r,o+1):null;if(!i||!s)return null;let a=e.combineMode;for(let u=0;u<i.length;u++){let l=i[u],c=s[u];i[u]=a===2?l|c:a===3?l^c:a===4?l&(c^1):a===5?c&(l^1):l&c;}return i}}}function ap(e,t){let n=1/0,r=1/0,o=-1,i=-1;for(let s=0;s<t.h;s++)for(let a=0;a<t.w;a++)e[s*t.w+a]&&(n=Math.min(n,a),o=Math.max(o,a),r=Math.min(r,s),i=Math.max(i,s));return o<0?null:{x:t.x+n,y:t.y+r,w:o-n+1,h:i-r+1}}function Ga(e,t,n,r=0,o){let i=e.length;if(i<(n?3:2))return [];let s=(Number.isFinite(t)?t:0)/3,a=m=>{let b,h;return n?(b=e[(m-1+i)%i],h=e[(m+1)%i]):(b=e[Math.max(0,m-1)],h=e[Math.min(i-1,m+1)]),{x:s*(h.x-b.x),y:s*(h.y-b.y)}},u=n?i:i-1,l=n?0:Math.max(0,Math.floor(r)),c=n?u:Math.min(u-l,o===void 0?u:Math.floor(o));if(!(c>0))return [];let f=[{x:e[l].x,y:e[l].y}];for(let m=l;m<l+c;m++){let b=e[m],h=e[(m+1)%i],d=a(m),p=a((m+1)%i);f.push({x:b.x+d.x,y:b.y+d.y},{x:h.x-p.x,y:h.y-p.y},{x:h.x,y:h.y});}return f}function up(e,t,n,r,o,i=false,s=[]){let a=ot(t,i,false,r,o),u=e.map(c=>{let f=ot(c,false,false,r,o);for(let m=0;m<f.length;m++)a[m]===0&&(f[m]=0);return f}),l=r?s.map(c=>c.map(f=>f-8)):s;return ot([...u.flatMap(c=>zP(c,o.w,o.h,o.x,o.y)),...l],false,n,false,o)}function zP(e,t,n,r,o){return ZP(e,t,n).filter(i=>i.length>=3).map(i=>{let s=[];for(let a of i)s.push((a.x+r)*16,(a.y+o)*16);return s})}function qP(e,t,n){let r=[],o=[],i=null;for(let s=0;s<n;s++){let a=[],u=false;for(let c=0;c<t;c++){let f=e[s*t+c]!==0;f!==u&&(a.push(c),u=f);}u&&a.push(t);let l=r[r.length-1];if(a.length===0){i=null;continue}i&&l&&l.y1===s&&i.length===a.length&&i.every((c,f)=>c===a[f])?l.y1=s+1:(r.push({y0:s,y1:s+1,s:o.length,n:a.length}),o.push(...a)),i=a;}return {bands:r,X:o}}function JP(e,t){let n=e.length,r=new Uint8Array(t.length+2),o=[];for(let i=0;i<n;i++){let s=e[i];for(let a=0;a<s.n;a++){if(r[s.s+a])continue;let u=[{x:t[s.s+a],y:s.y0}];r[s.s+a]=1;let l=a&1,c=1,f=i,m=a,b=false;for(let h=0;h<16*(t.length+8)&&!b;h++){for(;;){let p=e[f],x=f+1<n?e[f+1]:null;if(!x||x.y0!==p.y1)break;let y=p.s+m,g=t[y],M=x.s,E=x.n-l-1,P,R=false;if(t[M+l]>g)P=l;else {if(t[M+E]<=g)break;{let w=l,A=E,I=A+w>>1;for(;I!==w;)t[M+I]<=g?w=I:A=I,I=w+A>>1;P=A;}}if((P&1)===l?t[M+P]>=t[y+1]&&(R=true):m<=0?P-=1:t[M+P-1]<t[y-1]?(c=-1,R=true):P-=1,R)break;let T=t[M+P];g!==T&&u.push({x:g,y:p.y1},{x:T,y:p.y1}),r[M+P]=1,f+=1,m=P;}{let p=e[f];u.push({x:t[p.s+m],y:p.y1},{x:t[p.s+m+c],y:p.y1}),m+=c,r[p.s+m]=1,c=-1;}for(;;){let p=e[f],x=f-1;if(x<i)break;let y=e[x];if(y.y1!==p.y0)break;let g=p.s+m,M=t[g],E=y.s,P=y.n-l-1,R;if(t[E+P]<M)R=P;else {if(t[E+l]>=M)break;{let w=l,A=P,I=A+w>>1;for(;I!==w;)t[E+I]<M?w=I:A=I,I=w+A>>1;R=w;}}if((R&1)===l){if(m<p.n-1&&t[E+R+1]>t[g+1]){c=1;break}R+=1;}else if(t[E+R]<=t[g-1])break;let T=t[E+R];M!==T&&u.push({x:M,y:p.y0},{x:T,y:p.y0}),r[E+R]=1,f=x,m=R;}let d=e[f];f===i&&a===m-1?(u.push({x:t[d.s+m],y:d.y0}),b=true):(u.push({x:t[d.s+m],y:d.y0},{x:t[d.s+m+c],y:d.y0}),m+=c,r[d.s+m]=1,c=1);}b&&o.push(u);}}return o}function KP(e){let t=e.map(o=>{let i=1/0,s=1/0,a=-1/0,u=-1/0;for(let l of o)i=Math.min(i,l.x),s=Math.min(s,l.y),a=Math.max(a,l.x),u=Math.max(u,l.y);return {x0:i,y0:s,x1:a,y1:u}}),n=(o,i)=>i.x0>=o.x0&&i.y0>=o.y0&&o.x1>=i.x1&&o.y1>=i.y1,r=e.map(()=>false);for(let o=1;o<e.length;o++)for(let i=o-1;i>=0;i--)n(t[o],t[i])?r[i]=!r[i]:n(t[i],t[o])&&(r[o]=!r[o]);return e.map((o,i)=>{let s=0;for(let a=0;a<e.length;a++)a!==i&&!r[a]&&n(t[a],t[i])&&s++;return s%2===1})}function ZP(e,t,n){let{bands:r,X:o}=qP(e,t,n);if(r.length===0)return [];if(r.length===1&&r[0].n===2){let a=r[0];return [[{x:o[a.s],y:a.y0},{x:o[a.s+1],y:a.y0},{x:o[a.s+1],y:a.y1},{x:o[a.s],y:a.y1}]]}let i=JP(r,o).map(QP),s=KP(i);return i.map((a,u)=>s[u]?a.slice().reverse():a)}function QP(e){let t=e.length,n=[e[0],e[0],e[0]],r=[false,false,false],o=0,i=0,s=()=>{let M=o;o=(o+1)%3,i<t?(n[M]=e[i],r[M]=i===t-1,i++):(n[M]=e[0],r[M]=false);},a=[e[0]],u=0,l=e[0],c=e[0],f=0,m=0,b=M=>{if(u===0)l=M,u=1;else if(u===1)c=M,f=M.x-l.x,m=M.y-l.y,u=2;else {let E=M.x-c.x,P=M.y-c.y;E===f&&P===m||(a.push(l),l=c,f=E,m=P),c=M;}},h=()=>(a.push(l,c),a);s(),s(),s();let d=0,p=1,x=2,y,g;n[x].y===n[p].y?(y=n[p].y-n[d].y,g=1):(y=n[p].x-n[d].x,g=0);for(let M=0;M<8*t+16;M++){if(r[d])return h();let E,P;if(g===0?(P=n[x].y-n[p].y,E=P<0&&(y===1||P===-1)):(P=n[x].x-n[p].x,E=y>0&&(y===1||P===-1)),!E){s(),g^=1,y=P;let A=d;d=p,p=x,x=A,b(n[d]);continue}if(r[p])return h();s(),s();let R=d,T=x,w=p;d=T,p=R,x=w,y=g===0?n[p].x-n[d].x:n[p].y-n[d].y,b(n[d]);}return h()}var eR=1.5,cp={1:[3,1],2:[1,1],3:[3,1,1,1],4:[3,1,1,1,1,1]};function tR(e){switch(e){case 1:case 17:return "square";case 2:case 18:case 3:case 19:return "round";default:return "butt"}}function nR(e){return e===1?"bevel":e===2?"round":"miter"}function Oc(e){let t=e.width||1,n=e.dashStyle===5?e.dashPattern:cp[e.dashStyle];return !n||n.length===0||n.some(r=>!(r>=0))?[]:n.map(r=>r*t)}function lp(e,t,n=1){e.lineWidth=(t.width||1)*n;let r=Oc(t);e.lineCap=tR(r.length>0?t.dashCap??0:t.startCap??t.endCap),e.lineJoin=nR(t.lineJoin),e.miterLimit=t.miterLimit&&t.miterLimit>=1?t.miterLimit:10,typeof e.setLineDash=="function"&&e.setLineDash(r),e.lineDashOffset=r.length>0?(t.dashOffset??0)*(t.width||1):0;}function an(e,t,n,r,o=false,i=false){if(t){let m=oR(e,t);if(!m)return;t=m;}let{ctx:s}=e,a=iR(t);t=a.pen;let u=a.nib,l=!!t&&t.alignment===1&&o,c=l?2:1,f=m=>{(l||u)&&m.save(),l&&(m.beginPath(),n(m),m.clip()),m.beginPath(),n(m),u&&m.transform(u[0],u[1],u[2],u[3],0,0),m.stroke(),(l||u)&&m.restore();};if(t){let m=!!u&&Oc(t).length>0,b=[t.startCap,t.endCap].some(x=>x!==void 0&&x>=17&&x<=20);lp(s,t,c);let h=fi(e),d=t.brush&&!chunk7JVB7NLG_js.pa(s)?Ol(e,t.brush):null;if(!d&&h!=="canvas"){let x=io(t.color);d=x===null?null:ro(x);}if(d){let x=fR(s),y=_e(e),g=mp(u?je(y,u):y);if(h!=="canvas"&&x&&sR(e,t,u,d,n,y,x,h,o,i))return;let M=Oa(t)||b||m?dp(e,t,u,n,o):null,E=null;if(x&&M)E=Er(M.flat(),y,x,2);else if(x){let T=Math.max(1,s.miterLimit||10),w=t.width*g*T/2+2;E=Er(r,y,x,w);}if(x&&!E||E&&mi(e,d,E,M?T=>{pp(T,M),T.fill("nonzero");}:T=>{lp(T,t,c),f(T),T.beginPath(),n(T),u&&T.transform(u[0],u[1],u[2],u[3],0,0);},h,M?(T,w,A)=>T.isPointInPath(w,A,"nonzero"):(T,w,A)=>T.isPointInStroke(w,A)&&(!l||T.isPointInPath(w,A))))return}let p=t.brush?cl(e,t.brush):t.color;if((Oa(t)||b||m||u&&typeof p!="string")&&lR(e,t,u,p,n,o))return;s.strokeStyle=p;}pt(e),f(s);}var rR=2;function oR(e,t){let n=t.unit??0;if(n>=3&&n<=6)return null;if(n!==rR)return t;let r=js(e),o=sn([r[0],r[1],r[2],r[3],0,0]);return o?{...t,transform:je(o,t.transform??[1,0,0,1,0,0])}:t}function iR(e){if(!e?.transform)return {pen:e,nib:null};let[t,n,r,o]=e.transform,i=Math.hypot(t,n),s=Math.hypot(r,o),a=t*r+n*o,u=t*o-n*r,l={...e,transform:null};if(e.width===0||mR(e.transform)||!Number.isFinite(i+s+a+u)||Math.abs(u)<1e-12)return {pen:{...l,width:e.width===0?1:e.width},nib:null};if(Math.abs(i-s)<=1e-6*i&&Math.abs(a)<=1e-6*i*s){let c=e.dashStyle===5?e.dashPattern:cp[e.dashStyle],f=c&&c.length>0?{dashStyle:5,dashPattern:c.map(m=>m/i),dashOffset:(e.dashOffset??0)/i}:{};return {pen:{...l,...f,width:e.width*i},nib:null}}return {pen:l,nib:[t,n,r,o,0,0]}}function mp(e){let t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3],n=e[0]*e[3]-e[1]*e[2];return Math.sqrt((t+Math.sqrt(Math.max(0,t*t-4*n*n)))/2)}function fp(e,t){if(!t)return {record:e,unit:Math.hypot(e[0],e[1]),toDevice:cR};let n=je(e,t),r=mp(n),o=sn(t);return !o||!(r>0)||!Number.isFinite(r)?null:{record:[o[0]*r,o[1]*r,o[2]*r,o[3]*r,0,0],unit:r,toDevice:je(n,[1/r,0,0,1/r,0,0])}}function bp(e,t,n=null){let r=Oc(e).map(o=>o*t);return {half:(e.width||1)*t/2,join:e.lineJoin??0,miterLimit:e.miterLimit&&e.miterLimit>=1?e.miterLimit:10,startCap:e.startCap??0,endCap:e.endCap??0,dashCap:e.dashCap??0,dash:r.length>0?r:null,dashOffset:(e.dashOffset??0)*(e.width||1)*t,dashMetric:n?[n[0],n[1],n[2],n[3]]:void 0,compound:e.compound??null,inset:e.alignment===1}}function sR(e,t,n,r,o,i,s,a,u,l=false){if(!n){let R=Math.hypot(i[0],i[1]),T=Math.hypot(i[2],i[3]),w=i[0]*i[2]+i[1]*i[3];if(!(R>0)||Math.abs(R-T)>1e-6*R||Math.abs(w)>1e-6*R*T)return false}let c=fp(i,n);if(!c)return false;let f;try{f=En(o,c.record);}catch{return false}u&&(f=f.map(R=>({...R,closed:true})));let m=(t.width||1)*c.unit,b=bp(t,c.unit,n),h=a==="gdiplus-aa",d=R=>{let T=c.toDevice;return R.flatMap(w=>[Ge(T[0]*w.x+T[2]*w.y+T[4]),Ge(T[1]*w.x+T[3]*w.y+T[5])])},p,x=[],y=null,g=[];if(Oa(t))p=hp(f,m,b,t).map(d);else {if(m<=eR&&!b.dash&&!(((t.startCap??0)|(t.endCap??0)|(t.dashCap??0))&240))return uR(e,t,r,o,i,s,h,u);({fix:p,groups:x,insetFigures:y,open:g}=aR(f,b,d));}let M=Bo(p,s);if(!M)return true;if(M.w*M.h>16e6)return false;let E=Rt(e.pixelOffsetMode??0),P=y?up(x,y,h,E,M,l,g):ot(p,false,h,E,M);return zn(e,r,M,P,1,true)}function aR(e,t,n){let r=e.filter(u=>u.closed);if(!t.inset||t.compound||r.length===0){let u=Xn(e,t).map(n);return {fix:u,groups:[u],insetFigures:null,open:[]}}let o={...t,inset:false,half:t.half*2,dashOffset:t.dashOffset*2,dashCapWidth:t.half*2,doubleRoundCap:true},i=r.map(u=>Xn([u],o).map(n)),s=Xn(e.filter(u=>!u.closed),{...t,inset:false}).map(n).map(u=>{let l=[];for(let c=u.length/2-1;c>=0;c--)l.push(u[2*c],u[2*c+1]);return l}),a=e.map(u=>n(Array.from({length:u.pts.length>>1},(l,c)=>({x:u.pts[2*c],y:u.pts[2*c+1]}))));return {fix:[...i.flat(),...s],groups:i,insetFigures:a,open:s}}function uR(e,t,n,r,o,i,s,a){let u;try{u=x0(r,o);}catch{return false}a&&(u=u.map(h=>({...h,closed:true})));let l=Bo(u.map(h=>h.pts),i);if(!l)return true;if(l.w*l.h>16e6)return false;let c=io(t.color),m=(!t.brush||!t.brush.gradient&&!t.brush.texture&&!t.brush.hatch)&&c!==null&&c>>>24===255&&e.ext?.compositingMode!==1,b=Ts(u,{antialias:s,half:Rt(e.pixelOffsetMode??0),opaqueSolid:m,clip:{x:0,y:0,w:i.w,h:i.h}},l);return zn(e,n,l,b,1,true)}function Oa(e){return !!(e.customStartCap||e.customEndCap)}function hp(e,t,n,r){let o=F0(e,t,r.customStartCap??null,r.customEndCap??null),i=[];return o.figures.forEach((s,a)=>{let u=o.capped[a],l={...n,half:Math.max(t,1)/2,join:n.join===0?3:n.join,startCap:u.start?0:n.startCap,endCap:u.end?0:n.endCap};for(let c of Xn([s],l))i.push(c.slice().reverse());}),i.push(...o.polygons),i}function dp(e,t,n,r,o){let i=_e(e),s=fp(i,n),a=sn(i);if(!s||!a||!(s.unit>0))return null;let u;try{u=En(r,s.record);}catch{return null}o&&(u=u.map(b=>({...b,closed:true})));let l=(t.width||1)*s.unit,c=bp(t,s.unit,n),f=Oa(t)?hp(u,l,c,t):Xn(u,c),m=je(a,s.toDevice);return f.map(b=>b.map(h=>({x:m[0]*h.x+m[2]*h.y+m[4],y:m[1]*h.x+m[3]*h.y+m[5]})))}function pp(e,t){e.beginPath();for(let n of t)n.forEach((r,o)=>{o===0?e.moveTo(r.x,r.y):e.lineTo(r.x,r.y);}),e.closePath();}function lR(e,t,n,r,o,i){let s=dp(e,t,n,o,i);if(!s)return false;let{ctx:a}=e;a.save();try{a.fillStyle=r,pt(e),pp(a,s),a.fill("nonzero");}finally{a.restore();}return true}var cR=[1,0,0,1,0,0];function mR(e){return e[0]===1&&e[1]===0&&e[2]===0&&e[3]===1&&e[4]===0&&e[5]===0}function fR(e){let t=e.canvas,n=t?.width,r=t?.height;return typeof n=="number"&&typeof r=="number"&&n>0&&r>0?{w:n,h:r}:null}var bR=/^(?:\p{Script=Latin}|\p{Script=Common}|\p{Co})$/u,hR=/[\p{M}\p{Cf}\p{Emoji_Presentation}]/u;function xp(e,t,n,r,o,i,s){let a=n.alignment,u=n.lineAlignment;if(!a&&!u||a<0||a>2||u<0||u>2||e.gridFit||e.mode!=="gray"||!e.designAdvance||e.ttf.winDescent===void 0||e.syntheticBold||e.syntheticItalic||n.flags&3||![r,o,i,s].every(Number.isFinite)||i<=0||s<=0||t.some(x=>!Number.isInteger(x)||x<32||x>1114111||x>=127&&x<=159||x===8232||x===8233)||t.some(x=>{let y=String.fromCodePoint(x);return !bR.test(y)||hR.test(y)||e.glyphIndex(x)===0}))return null;let l=e.ppem,c=n.tracking??1.03,f=l*(n.leadingMargin??1/6),m=l*(n.trailingMargin??1/6);if(![c,f,m].every(x=>Number.isFinite(x)&&x>=0)||!(n.flags&4)&&(e.ttf.fsSelection&1||e.ttf.macStyle&2)&&a!==0)return null;let b=t.map(x=>e.designAdvance(e.glyphIndex(x),c)),h=t.length;if(!(n.flags&2048))for(;h>0&&t[h-1]===32;)h--;let d=b.slice(0,h).reduce((x,y)=>x+y,0)+f+m,p=l*(e.ttf.winAscent+e.ttf.winDescent)/e.ttf.unitsPerEm+(n.flags&4?0:l/8);return d>i||p>s?null:{x:Math.fround(r+a/2*(i-d)+f),y:Math.fround(o+u/2*(s-p))+Math.round(l*e.ttf.winAscent/e.ttf.unitsPerEm),dx:b}}function gR(e,t){let n=t<=255?e.objectTable.get(t):void 0;return !n||n.kind!=="plus-imageattributes"||!n.wrapMode?{}:{wrap:n.wrapMode,clampArgb:n.clampArgb}}var MR=2;function ER(e,t,n){let r=[];for(let o=0;o<n.length;o+=2){let i=n[o],s=n[o+1];r.push((e[0]*i+e[2]*s+e[4])*t,(e[1]*i+e[3]*s+e[5])*t);}return r}function PR(e,t,n,r,o,i,s,a){let{view:u}=e,l=Db(e.interpolationMode??0);if(n||u.getUint32(t+4,true)!==MR)return;let c=u.getFloat32(t+8,true),f=u.getFloat32(t+12,true),m=u.getFloat32(t+16,true),b=u.getFloat32(t+20,true);if(!(!(m>0&&b>0)||!Number.isFinite(c+f+m+b)))return {srcX:c,srcY:f,srcW:m,srcH:b,toDevice:je(_e(e),r(c,f,m,b)),kernel:l,halfPixelOffset:Rt(e.pixelOffsetMode??0),...o?{pointsForm:true}:{},...o&&s?{worldPoints:s,worldMatrix:_e(e)}:{},...!o&&a?{worldRect:a,worldMatrix:_e(e)}:{},...i?{nominalScale:i(m,b)}:{},...gR(e,u.getUint32(t,true))}}function yp(e,t,n,r,o,i,s,a,u=null,l=false,c,f,m){if(!t.data)return;let b=t.type===2,h={imageData:t.data,dx:r,dy:o,dw:i,dh:s,transform:_e(e),isMetafile:b,resample:PR(e,n,b,a,l,c,f,m)},{view:d}=e,p={unit:d.getUint32(n+4,true),srcX:d.getFloat32(n+8,true),srcY:d.getFloat32(n+12,true),srcW:d.getFloat32(n+16,true),srcH:d.getFloat32(n+20,true),toWorld:a};if(rh(e,t,h,p,u)){chunk7JVB7NLG_js.p("DrawImage: painted in record order");return}if(h.effect=u,h.effectSource=p,chunk7JVB7NLG_js.pa(e.ctx)){let x=a(p.srcX,p.srcY,p.srcW,p.srcH),y=[p.srcX,p.srcY,p.srcX+p.srcW,p.srcY,p.srcX+p.srcW,p.srcY+p.srcH,p.srcX,p.srcY+p.srcH],g=[];for(let M=0;M<y.length;M+=2)g.push(x[0]*y[M]+x[2]*y[M+1]+x[4],x[1]*y[M]+x[3]*y[M+1]+x[5]);h.svgSlot=e.ctx.reserveSlot(ER(_e(e),1,g));}e.deferredImages.push(h),chunk7JVB7NLG_js.p(`DrawImage: queued deferred image (total=${e.deferredImages.length})`);}function Xc(e,t,n,r){let{ctx:o}=e,i=r.fillRule??"nonzero";Cn(e,t,n,a=>$r(a,r),r.points,i)||(o.fillStyle=Nt(e,t,n),pt(e),$r(o,r),o.fill(i));}function jc(e,t,n){an(e,t,r=>$r(r,n),n.points,wR(n.types),n.fillRule==="evenodd");}function RR(e){return 1+(e===void 0||!Number.isFinite(e)?4:Math.min(12,Math.max(0,e)))/10}function TR(e,t){if(t===1)return;let n=1/t;for(let r=0;r<e.length;r++){let o=e[r]/255;e[r]=Math.round((1-Math.pow(1-o,n))*255);}}function wR(e){if(e.length===0)return false;for(let t=1;t<=e.length;t++)if((t===e.length||(e[t]&15)===0)&&!(e[t-1]&128))return false;return true}function Wc(e,t,n,r,o,i,s){let{ctx:a}=e,u=chunk7JVB7NLG_js.pa(a)?null:oo(e,t,n),l=a.canvas;if(u&&l&&typeof l.width=="number"&&typeof l.height=="number"){let c=typeof a.measureText=="function"?a.measureText(r).width:r.length*s,f=Math.abs(s)||1,m=[{x:o-c-f,y:i-2*f},{x:o+c+f,y:i-2*f},{x:o-c-f,y:i+2*f},{x:o+c+f,y:i+2*f}],b=Er(m,_e(e),{w:l.width,h:l.height});if(!b)return;let{font:h,textAlign:d,textBaseline:p}=a;if(mi(e,u,b,x=>{x.font=h,x.textAlign=d,x.textBaseline=p,x.fillText(r,o,i);},"canvas",void 0,false))return}a.fillStyle=Nt(e,t,n),pt(e,false),a.fillText(r,o,i);}var AR=[3,3,3,4,4,6],Jn=1/6,Nc=1.03;function IR(e){let t=/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)$/.exec(e.trim());return t?t[4]!==void 0&&Number(t[4])<1?null:"#"+[t[1],t[2],t[3]].map(n=>Number(n).toString(16).padStart(2,"0")).join(""):/^#[0-9a-f]{6}$/i.test(e)?e:null}function gp(e,t){if(!t||t.kind!=="plus-font")return t;let n=t.unit??0;if(n<3||n>6)return n===0?t:{...t,unit:0};let r=e.dpiY??br,o=hr(e.pageUnit,e.pageScale,r,e.videoDisplay??true),i=t.emSize*hr(n,1,r)/(o||1);return Number.isFinite(i)&&i>0?{...t,emSize:i,unit:0}:t}function SR(e,t){return e!==0?e:t==="mono"?1:t==="gray"?3:5}function Ep(e,t,n,r,o=false){let i=e.fonts,s=typeof n=="string"?IR(n):null,a=SR(e.textRenderingHint??0,i?.defaultSmoothing),l=!!s&&(a===3||a===4||a===5)&&!chunk7JVB7NLG_js.pa(e.ctx),c=chunk7JVB7NLG_js.pa(e.ctx)?null:l?ro(io(n)??4278190080):s?null:r,f=t.unit??0;if(!i||!s&&!c||f!==0&&f!==2)return null;let m=_e(e);if(m[1]!==0||m[2]!==0||m[0]<=0||m[3]<=0)return null;let b=t.emSize*m[3],h={face:t.family,height:-Math.round(b),width:0,weight:t.flags&1?700:400,italic:(t.flags&2)!==0,charSet:1,pitchAndFamily:0,quality:AR[a]??3,unhinted:a===2||a===4,ignoreGasp:a===4,gdiPlus:true,...a===1&&o?{defaultDrawStringFormat:true}:{},unscaledText:m[0]===1&&m[3]===1},d=i.realize(h,e.fontFamilyMap);return d?{realized:d,emPx:b,m,unhinted:h.unhinted===true,color:s,sampler:c,solidViaCoverage:l,underline:(t.flags&4)!==0,strikeOut:(t.flags&8)!==0,plusBars:a===4?"fractional":"snapped"}:null}function Na(e,t,n,r){let o={...n,textAlign:24,bkColor:"#ffffff",bkMode:1,options:r?fo:0,rect:r??null,matrix:null};if((!t.color||t.solidViaCoverage)&&t.sampler){let i=yd(t.realized,{...o,underline:t.underline,strikeOut:t.strikeOut,plusBars:t.plusBars},{decorations:true,grayLevels:15});if(!i)return true;if(r)for(let a=0;a<i.height;a++){let u=i.y+a;for(let l=0;l<i.width;l++){let c=i.x+l;if(c<r.left||c>=r.right||u<r.top||u>=r.bottom){let f=a*i.width+l;i.data.fill(0,f*i.channels,(f+1)*i.channels),i.bars&&(i.bars[f]=0);}}}let s=RR(e.ext?.textContrast);if(i.channels===1&&TR(i.data,s),i.bars){let a=i.width*i.height;for(let u=0;u<a;u++){let l=i.bars[u];if(l!==0)for(let c=0;c<i.channels;c++){let f=i.data[u*i.channels+c];i.data[u*i.channels+c]=255-Math.round((255-f)*(255-l)/255);}}}return zn(e,t.sampler,{x:i.x,y:i.y,w:i.width,h:i.height},i.data,i.channels,false,i.channels===3?s:1)}return fc(e.ctx,t.realized,{...o,textColor:t.color,underline:t.underline,strikeOut:t.strikeOut,plusBars:t.plusBars},e.fontFamilyMap),true}function vR(e,t,n,r,o,i,s,a,u,l,c=null){let f=!l||l.flags===0&&l.alignment===0&&l.lineAlignment===0&&(l.trimming??1)===1&&Math.fround(l.leadingMargin??Jn)===Math.fround(Jn)&&Math.fround(l.trailingMargin??Jn)===Math.fround(Jn)&&Math.fround(l.tracking??Nc)===Math.fround(Nc),m=Ep(e,t,a,c,f);if(!m)return false;let{realized:b,emPx:h,m:d,unhinted:p}=m,x=Array.from(n,B=>B.codePointAt(0));if(l&&(u!==0||l.lineAlignment!==0)&&p&&d[0]===d[3]&&Math.fround(h)===b.ppem){let B=xp(b,x,l,d[0]*r+d[4],d[3]*o+d[5],d[0]*i,d[3]*s);if(B)return Na(e,m,{codes:x,glyphIndices:false,...B,dy:null})}let y=b.ttf,g=h*y.winAscent/y.unitsPerEm,M=!b.syntheticBold&&!b.syntheticItalic&&h===b.ppem&&d[0]===1&&d[3]===1&&Number.isInteger(o+d[5])&&(l?.lineAlignment??0)===0,E=l?.flags??0;if(u!==0&&(u!==1&&u!==2||E!==0||b.mode!=="mono"||!b.gridFit||!M||!b.designAdvance||x.some(B=>B!==10&&B!==13&&(B<32||B>126))))return false;let P=p?Math.round(g):M?Math.max(Math.round(g),b.ascent):Math.ceil(g),R=h*(l?.leadingMargin??Jn),T=h*(l?.trailingMargin??Jn),w=d[0]*r+d[4]+R;p||(w=Math.round(w));let A=d[3]*o+d[5]+P,I=l?.tracking??Nc,S=!p&&b.mode==="cleartype"&&!!b.ctGridAdvance&&!b.syntheticItalic&&I>1,v=!!b.designAdvance&&d[0]===1&&d[3]===1,C=B=>{let O=b.glyphIndex(B);return p?v?b.designAdvance(O,I):b.advance(O)*I:S?b.ctGridAdvance(O):b.advance(O)},U=p||S?x.map(C):null,L=d[0]*r+d[4],k=d[3]*o+d[5],F=d[0]*i,_=d[3]*s,H=F>0&&_>0&&!(E&LR)?{left:Math.round(L),top:Math.round(k),right:Math.round(L+F),bottom:Math.round(k+_)}:void 0,G,W=F>0&&!(E&CR)?F-h*((l?.leadingMargin??Jn)+(l?.trailingMargin??Jn)):1/0,N=x.map(B=>b.designAdvance?.(b.glyphIndex(B),I)??C(B)),Z=N.map((B,O)=>O+1<x.length&&y.kerning?B+y.kerning(b.glyphIndex(x[O]),b.glyphIndex(x[O+1]))*h/y.unitsPerEm:B),J=UR(x,Z,W),K,ie=J.length>1;if(u!==0&&(!ie||!H))return false;ie&&(G=H);let ce=y.winDescent??0,$=y.hheaAscender!==void 0&&y.hheaDescender!==void 0?y.hheaAscender-y.hheaDescender+(y.hheaLineGap??0):y.winAscent+ce,X=$*h/y.unitsPerEm;if(H){let B=E&DR?Math.floor((_-(y.winAscent+ce)*h/y.unitsPerEm)/X)+1:Math.floor(_/X-.25)+1;if(J.length>B){if(u!==0)return false;G=H;let O=J.slice(0,Math.max(0,B));if(O.length>0&&(l?.trimming??1)===1){let j=O[O.length-1],q=j.start;for(;q<x.length&&x[q]!==10&&x[q]!==13;){let se=0;for(let de=j.start;de<=q;de++)se+=Z[de];if(se>W&&q>j.start)break;q++;}for(;q>j.start&&x[q-1]===32;)q--;let ae={start:j.start,end:q};q>j.end&&(K=ae),O[O.length-1]=ae;}J=O;}}if(J.length===0)return true;if(!ie)return Na(e,m,{codes:x.slice(0,J[0].end===Mp(x)?x.length:J[0].end),glyphIndices:false,x:w,y:A,dx:U?U.slice(0,J[0].end===Mp(x)?x.length:J[0].end):null,dy:null},G);for(let[B,O]of J.entries()){let j=k+(y.winAscent+B*$)*h/y.unitsPerEm,q=x.slice(O.start,O.end);if(q.length===0)continue;let ae=me=>{let ee=me+1<O.end&&y.kerning?y.kerning(b.glyphIndex(x[me]),b.glyphIndex(x[me+1]))*h/y.unitsPerEm:0;return p?ee:Math.round(ee)},se=Array.from({length:O.end-O.start},(me,ee)=>C(x[O.start+ee])+ae(O.start+ee));if(O===K&&!p&&b.mode==="mono"){let me=L+R,ee=w;for(let le=O.start;le<O.end;le++){let xe=le-O.start;if(me+=Z[le],ee+=se[xe],x[le]===32&&x[le-1]!==32&&x[le+1]!==32){let Je=Math.round(me);se[xe]+=Je-ee,ee=Je;}}}let de=w;if(u!==0){let me=se.length===1?N[O.start]:se.reduce((Je,At)=>Je+At,0),ee=Math.fround(me+Math.fround(R+T)),le=Math.fround(u/2*Math.fround(F-ee)),xe=Math.fround(Math.fround(L+le)+R);de=Math.ceil(xe-.5);}Na(e,m,{codes:q,glyphIndices:false,x:de,y:p?k+Math.round(g)+B*X:Math.round(j),dx:se.some((me,ee)=>me!==C(x[O.start+ee]))||U?se:null,dy:null},G);}return true}function Mp(e){let t=e.length;for(;t>0&&e[t-1]===32;)t--;return t}var CR=4096,DR=8192,LR=16384;function UR(e,t,n){let r=[],o=(a,u)=>{for(;u>a&&e[u-1]===32;)u--;return u},i=(a,u)=>{let l=0;for(let c=a;c<u;c++)l+=t[c];return l},s=0;for(;s<=e.length;){let a=s;for(;a<e.length&&e[a]!==10&&e[a]!==13;)a++;let u=s;do{let l=o(u,a);if(Number.isFinite(n)&&i(u,l)>n){let c=-1;for(let f=u+1;f<a;f++)e[f-1]===32&&e[f]!==32&&i(u,o(u,f))<=n&&(c=f);if(c>u)l=c;else for(l=u+1;l<a&&e[l]!==32&&i(u,l+1)<=n;)l++;}for(r.push({start:u,end:o(u,l)}),u=l;u<a&&e[u]===32&&u>s;)u++;}while(u<a);s=a+(e[a]===13&&e[a+1]===10?2:1);}return r}var FR=1,kR=2,_R=4;function BR(e,t,n,r,o,i,s){let a=(s&FR)!==0,u=(s&_R)!==0;if(!(s&kR)){let h=Nt(e,t,n),d=Ep(e,r,h,e.fonts?oo(e,t,n):null);if(d){let{m:p}=d,x=i.map(g=>({x:p[0]*g.x+p[4],y:p[3]*g.y+p[5]})),y=g=>x.map((M,E)=>E+1<x.length?x[E+1][g]-M[g]:0);Na(e,d,{codes:o,glyphIndices:!a,x:x[0].x,y:x[0].y,dx:u?null:y("x"),dy:u?null:y("y")});return}}if(!a){chunk7JVB7NLG_js.q("DrawDriverString: glyph indices need the GDI font engine (no fonts supplied); skipped");return}let{ctx:l}=e,c=r.flags&1?"bold ":"",f=r.flags&2?"italic ":"",m=chunk7JVB7NLG_js.ba(r.family,e.fontFamilyMap),b=()=>{l.font=`${f}${c}${r.emSize}px ${m}`,l.textBaseline="alphabetic",l.textAlign="left";};if(u){b(),Wc(e,t,n,String.fromCharCode(...o),i[0].x,i[0].y,r.emSize);return}for(let h=0;h<o.length;h++)b(),Wc(e,t,n,String.fromCharCode(o[h]),i[h].x,i[h].y,r.emSize);}function Pp(e,t,n,r,o){let{ctx:i,view:s,objectTable:a}=e;switch(t){case 16404:{if(o>=4){let u=a.get(n&255);u&&u.kind==="plus-path"&&Xc(e,n,s.getUint32(r,true),u);}return true}case 16405:{if(o>=4){let u=a.get(n&255),l=a.get(s.getUint32(r,true)&255);u&&u.kind==="plus-path"&&jc(e,l&&l.kind==="plus-pen"?l:null,u);}return true}case 16412:{if(o>=28){let u=s.getUint32(r,true),l=s.getUint32(r+4,true),c=s.getUint32(r+8,true),f=s.getFloat32(r+12,true),m=s.getFloat32(r+16,true),b=s.getFloat32(r+20,true),h=s.getFloat32(r+24,true),d=n&255,p=gp(e,a.get(d));if(c>0&&r+28+c*2<=r+o){let x=chunk7JVB7NLG_js.fa(s,r+28,c);if(x.length>0&&p&&p.kind==="plus-font"){let y=a.get(l),g=Nt(e,n,u),M=y&&y.kind==="plus-stringformat"?y.alignment:0,E=y&&y.kind==="plus-stringformat"?y:void 0;if(vR(e,p,x,f,m,b,h,g,M,E,e.fonts?oo(e,n,u):null))return true;let P=p.flags&1?"bold ":"",R=p.flags&2?"italic ":"",T=chunk7JVB7NLG_js.ba(p.family,e.fontFamilyMap);if(i.font=`${R}${P}${p.emSize}px ${T}`,i.textBaseline="top",y&&y.kind==="plus-stringformat")switch(y.alignment){case 1:i.textAlign="center";break;case 2:i.textAlign="right";break;default:i.textAlign="left";}else i.textAlign="left";Wc(e,n,u,x,f,m,p.emSize);}}}return true}case 16438:{if(o>=16){let u=s.getUint32(r,true),l=s.getUint32(r+4,true),c=s.getUint32(r+8,true)!==0,f=s.getUint32(r+12,true),m=gp(e,a.get(n&255)),b=r+16,h=b+f*2,d=h+f*8;if(f>0&&f<1e5&&d+(c?24:0)<=r+o&&m&&m.kind==="plus-font"){let p=[],x=[];for(let g=0;g<f;g++)p.push(s.getUint16(b+g*2,true)),x.push({x:s.getFloat32(h+g*8,true),y:s.getFloat32(h+g*8+4,true)});let y=e.worldTransform;if(c){let g=[0,4,8,12,16,20].map(M=>s.getFloat32(d+M,true));g.every(Number.isFinite)&&(e.worldTransform=je(y,g));}try{BR(e,n,u,m,p,x,l);}finally{e.worldTransform=y;}}}return true}case 16410:{if(o>=24){let u=n&255,l=a.get(u),c=(n&16384)!==0,f=r+24,m,b,h,d;if(c&&f+8<=r+o)m=s.getInt16(f,true),b=s.getInt16(f+2,true),h=s.getInt16(f+4,true),d=s.getInt16(f+6,true);else if(!c&&f+16<=r+o)m=s.getFloat32(f,true),b=s.getFloat32(f+4,true),h=s.getFloat32(f+8,true),d=s.getFloat32(f+12,true);else return chunk7JVB7NLG_js.q(`DrawImage: imgId=${u}, rect data out of bounds`),true;e.totalDrawImageCalls++;let p=l&&l.kind==="plus-image"&&l.data;chunk7JVB7NLG_js.p(`DrawImage: imgId=${u}, dest=(${m},${b},${h},${d}), compressed=${c}, hasObj=${!!l}, objKind=${l?.kind}, hasData=${!!p}, dataLen=${p?l.data.byteLength:0}, isMetafile=${l?.kind==="plus-image"?l.type===2:"N/A"}`),chunk7JVB7NLG_js.p(`DrawImage: worldTransform=[${e.worldTransform.map(x=>x.toFixed(3)).join(", ")}]`),l&&l.kind==="plus-image"&&l.data?yp(e,l,r,m,b,h,d,(x,y,g,M)=>[D(h/g),0,0,D(d/M),m-x*h/g,b-y*d/M],null,false,(x,y)=>[Math.fround(h/x),Math.fround(d/y)],void 0,[m,b,h,d]):chunk7JVB7NLG_js.q(`DrawImage: SKIPPED, no valid image data for id=${u}`);}return true}case 16411:{if(o>=28){let u=n&255,l=a.get(u),c=s.getUint32(r+24,true),f=r+28,m=(n&Nf)!==0?e.ext?.pendingEffect??null:null;if(e.ext&&(e.ext.pendingEffect=null),c>=3&&l&&l.kind==="plus-image"&&l.data){let b=Un(s,f,r+o,3,n);if(!b)return chunk7JVB7NLG_js.q(`DrawImagePoints: imgId=${u}, point data out of bounds`),true;let[{x:h,y:d},{x:p,y:x},{x:y,y:g}]=b,M=h,E=d,P=Math.sqrt((p-h)**2+(x-d)**2),R=Math.sqrt((y-h)**2+(g-d)**2);e.totalDrawImageCalls++,chunk7JVB7NLG_js.p(`DrawImagePoints: imgId=${u}, points=[(${h},${d}),(${p},${x}),(${y},${g})], dest=(${M.toFixed(1)},${E.toFixed(1)},${P.toFixed(1)},${R.toFixed(1)})`),chunk7JVB7NLG_js.p(`DrawImagePoints: worldTransform=[${e.worldTransform.map(T=>T.toFixed(3)).join(", ")}]`),yp(e,l,r,M,E,P,R,(T,w,A,I)=>{let S=D((p-h)/A),v=D((x-d)/A),C=D((y-h)/I),U=D((g-d)/I);return [S,v,C,U,h-S*T-C*w,d-v*T-U*w]},m,true,x===d&&y===h?(T,w)=>[Math.fround((p-h)/T),Math.fround((g-d)/w)]:void 0,[h,d,p,x,y,g]);}else {let b=l&&l.kind==="plus-image"&&l.data;chunk7JVB7NLG_js.q(`DrawImagePoints: SKIPPED, imgId=${u}, count=${c}, hasObj=${!!l}, hasData=${!!b}`);}}return true}default:return false}}var XR=8192;function Yc(e,t){let n=e.objectTable.get(t&255);return n&&n.kind==="plus-pen"?n:null}function Wa(e,t){return n=>{n.moveTo(e[0].x,e[0].y);for(let r=1;r+2<e.length;r+=3)n.bezierCurveTo(e[r].x,e[r].y,e[r+1].x,e[r+1].y,e[r+2].x,e[r+2].y);t&&n.closePath();}}function Rp(e,t,n,r,o){let{view:i}=e,s=r+o;switch(t){case 16409:{if(o<4)return true;let a=i.getUint32(r,true),u=Un(i,r+4,s,a,n);return !u||u.length<4||(u.length-1)%3!==0||an(e,Yc(e,n),Wa(u,false),u,false),true}case 16408:{if(o<16)return true;let a=i.getFloat32(r,true),u=i.getUint32(r+4,true),l=i.getUint32(r+8,true),c=i.getUint32(r+12,true),f=Un(i,r+16,s,c,n&16384);if(!f)return true;let m=Ga(f,a,false,u,l);return m.length>=4&&an(e,Yc(e,n),Wa(m,false),m,false),true}case 16407:{if(o<8)return true;let a=i.getFloat32(r,true),u=i.getUint32(r+4,true),l=Un(i,r+8,s,u,n),c=l?Ga(l,a,true):[];return c.length>=4&&an(e,Yc(e,n),Wa(c,true),c,true),true}case 16406:{if(o<12)return true;let a=i.getUint32(r,true),u=i.getFloat32(r+4,true),l=i.getUint32(r+8,true),c=Un(i,r+12,s,l,n),f=c?Ga(c,u,true):[];if(f.length<4)return true;let m=n&XR?"nonzero":"evenodd",b=Wa(f,true);if(!Cn(e,n,a,b,f,m)){let{ctx:h}=e;h.fillStyle=Nt(e,n,a),pt(e),h.beginPath(),b(h),h.fill(m);}return true}case 16439:return jR(e,n,r,o),true;case 16403:return o<4||VR(e,n,i.getUint32(r,true)),true;default:return false}}function jR(e,t,n,r){if(r<12)return;let{view:o,objectTable:i}=e,s=i.get(t&255),a=o.getUint32(n,true),u=o.getUint32(n+4,true);if(e.ext&&(e.ext.pendingEffect=null),!s||s.kind!=="plus-path")return;let l=u<=255?i.get(u):void 0;l&&l.kind==="plus-brush"&&Xc(e,0,u,s);let c=a<=255?i.get(a):void 0;c&&c.kind==="plus-pen"&&jc(e,c,s);}function YR(e){let t=e.canvas,n=t?.width,r=t?.height;return typeof n=="number"&&typeof r=="number"&&n>0&&r>0?{w:n,h:r}:null}function VR(e,t,n){let r=e.objectTable.get(t&255);if(!r||r.kind!=="plus-region"||r.nodes.length===0)return;let o=r.nodes[0],i=_e(e),{ctx:s}=e,a=YR(s);if(fi(e)!=="canvas"&&a){let m={x:0,y:0,w:a.w,h:a.h},b=Ba(o,i,m,Rt(e.pixelOffsetMode??0)),h=b?Nl(e,t,n):null;if(b&&h){let d=ap(b,m);if(!d)return;let p=new Uint8ClampedArray(d.w*d.h);for(let x=0;x<d.h;x++)for(let y=0;y<d.w;y++)p[x*d.w+y]=b[(d.y+x)*m.w+d.x+y]?255:0;if(zn(e,h,d,p,1,true))return}}let u=ni(o,i,0,a?{x:0,y:0,w:a.w,h:a.h}:void 0);u.exact||chunk7JVB7NLG_js.q("FillRegion: region approximated (no canvas domain for an unbounded result)");let l=u.region,c=sn(i);if(l&&l.length===0||!c)return;let f=a??{w:1e6,h:1e6};s.save();try{s.setTransform(1,0,0,1,0,0);for(let b of l??[])s.beginPath(),ti(s,b.cmds),s.clip(b.fillRule);s.fillStyle=Nt(e,t,n),pt(e);let m=[[0,0],[f.w,0],[f.w,f.h],[0,f.h]].map(([b,h])=>({x:c[0]*b+c[2]*h+c[4],y:c[1]*b+c[3]*h+c[5]}));s.beginPath(),s.moveTo(m[0].x,m[0].y);for(let b=1;b<4;b++)s.lineTo(m[b].x,m[b].y);s.closePath(),s.fill();}finally{s.restore();}}function tT(e,t,n,r){let o=u=>{let l=u*Math.PI/180;return n>0&&r>0?Math.atan2(n*Math.sin(l),r*Math.cos(l)):l},i=Math.max(-360,Math.min(360,t)),s=o(e);if(Math.abs(i)>=360)return {start:s,sweep:Math.sign(i)*2*Math.PI};let a=o(e+i)-s;return i>0&&a<0?a+=2*Math.PI:i<0&&a>0?a-=2*Math.PI:i===0&&(a=0),{start:s,sweep:a}}function Ap(e,t,n,r,o){if(o&Gc)return Un(e,t,n,r,o);let i=(o&16384)!==0,s=i?4:8,a=[];for(let u=0,l=t;u<r&&l+s<=n;u++,l+=s)a.push(Bc(e,l,i));return a}function Vc(e,t){let n=e.objectTable.get(t&255);return n&&n.kind==="plus-pen"?n:null}function Ip(e,t,n,r,o){let{ctx:i,view:s,objectTable:a}=e;switch(t){case 16394:{if(o>=8){let u=s.getUint32(r,true),l=s.getUint32(r+4,true),c=(n&16384)!==0,f=c?8:16,m=[],b=r+8;for(let d=0;d<l&&b+f<=r+o;d++)m.push(_c(s,b,c)),b+=f;if(!Cn(e,n,u,d=>{for(let p of m)d.rect(p.x,p.y,p.w,p.h);},m.flatMap(d=>[{x:d.x,y:d.y},{x:d.x+d.w,y:d.y},{x:d.x,y:d.y+d.h},{x:d.x+d.w,y:d.y+d.h}]))){i.fillStyle=Nt(e,n,u),pt(e);for(let d of m)i.fillRect(d.x,d.y,d.w,d.h);}}return true}case 16395:{if(o>=4){let u=s.getUint32(r,true),l=(n&16384)!==0,c=l?8:16,f=[],m=r+4;for(let b=0;b<u&&m+c<=r+o;b++)f.push(_c(s,m,l)),m+=c;an(e,Vc(e,n),b=>{for(let h of f)b.rect(h.x,h.y,h.w,h.h);},f.flatMap(b=>[{x:b.x,y:b.y},{x:b.x+b.w,y:b.y+b.h}]),true);}return true}case 16398:{if(o>=12){let u=s.getUint32(r,true),l=(n&16384)!==0,c,f,m,b;if(l)c=s.getInt16(r+4,true),f=s.getInt16(r+6,true),m=s.getInt16(r+8,true),b=s.getInt16(r+10,true);else {if(o<20)return true;c=s.getFloat32(r+4,true),f=s.getFloat32(r+8,true),m=s.getFloat32(r+12,true),b=s.getFloat32(r+16,true);}let h=p=>{p.ellipse(c+m/2,f+b/2,Math.abs(m)/2,Math.abs(b)/2,0,0,Math.PI*2);},d=[{x:c,y:f},{x:c+m,y:f},{x:c,y:f+b},{x:c+m,y:f+b}];Cn(e,n,u,h,d)||(i.fillStyle=Nt(e,n,u),pt(e),i.beginPath(),h(i),i.fill());}return true}case 16399:{let u=n&255,l=a.get(u),c=(n&16384)!==0,f,m,b,h;if(c&&o>=8)f=s.getInt16(r,true),m=s.getInt16(r+2,true),b=s.getInt16(r+4,true),h=s.getInt16(r+6,true);else if(!c&&o>=16)f=s.getFloat32(r,true),m=s.getFloat32(r+4,true),b=s.getFloat32(r+8,true),h=s.getFloat32(r+12,true);else return true;return an(e,l&&l.kind==="plus-pen"?l:null,d=>d.ellipse(f+b/2,m+h/2,Math.abs(b)/2,Math.abs(h)/2,0,0,Math.PI*2),[{x:f,y:m},{x:f+b,y:m+h}],true),true}case 16400:case 16401:case 16402:{let u=t===16400;if(o<(u?12:8))return true;let c=r,f=u?s.getUint32(c,true):0;u&&(c+=4);let m=s.getFloat32(c,true),b=s.getFloat32(c+4,true);c+=8;let h=(n&16384)!==0,d,p,x,y;if(h&&c+8<=r+o)d=s.getInt16(c,true),p=s.getInt16(c+2,true),x=s.getInt16(c+4,true),y=s.getInt16(c+6,true);else if(!h&&c+16<=r+o)d=s.getFloat32(c,true),p=s.getFloat32(c+4,true),x=s.getFloat32(c+8,true),y=s.getFloat32(c+12,true);else return true;let g=d+x/2,M=p+y/2,E=Math.abs(x)/2,P=Math.abs(y)/2,{start:R,sweep:T}=tT(m,b,E,P);if(u){let A=S=>{S.moveTo(g,M),S.ellipse(g,M,E,P,0,R,R+T,T<0),S.closePath();},I=[{x:d,y:p},{x:d+x,y:p},{x:d,y:p+y},{x:d+x,y:p+y}];return Cn(e,n,f,A,I)||(i.fillStyle=Nt(e,n,f),pt(e),i.beginPath(),A(i),i.fill()),true}let w=t===16401;return an(e,Vc(e,n),A=>{w&&A.moveTo(g,M),A.ellipse(g,M,E,P,0,R,R+T,T<0),w&&A.closePath();},[{x:d,y:p},{x:d+x,y:p+y}],w),true}case 16397:{if(o>=4){let u=s.getUint32(r,true),l=Ap(s,r+4,r+o,u,n);if(!l)return true;let c=(n&8192)!==0;an(e,Vc(e,n),f=>{l.forEach((m,b)=>b===0?f.moveTo(m.x,m.y):f.lineTo(m.x,m.y)),c&&f.closePath();},l,c);}return true}case 16396:{if(o>=8){let u=s.getUint32(r,true),l=s.getUint32(r+4,true),c=Ap(s,r+8,r+o,l,n);if(!c)return true;let f=m=>{c.forEach((b,h)=>h===0?m.moveTo(b.x,b.y):m.lineTo(b.x,b.y)),m.closePath();};Cn(e,n,u,f,c)||(i.fillStyle=Nt(e,n,u),pt(e),i.beginPath(),f(i),i.fill());}return true}default:return false}}function vp(e,t,n,r,o=n){let{view:i,objectTable:s}=e,a=t&255,u=t>>8&127;switch(u){case 1:{let l=Rs(i,n,r,e.textureCache,o);l&&s.set(a,l);break}case 2:{let l=Y0(i,n,r,e.textureCache,o);l&&s.set(a,l);break}case 3:{let l=nr(i,n,r);l&&s.set(a,l);break}case 6:{let l=z0(i,n,r);l&&s.set(a,l);break}case 7:{if(r>=16){let l=i.getUint32(n+4,true),c=i.getUint32(n+12,true),f=i.getUint32(n+16,true),m=r>=48;s.set(a,{kind:"plus-stringformat",flags:l,alignment:c??0,lineAlignment:f??0,leadingMargin:m?i.getFloat32(n+36,true):void 0,trailingMargin:m?i.getFloat32(n+40,true):void 0,tracking:m?i.getFloat32(n+44,true):void 0,trimming:r>=52?i.getUint32(n+48,true):void 0});}break}case 5:{if(r<8)break;let l=Ss(i,n,r,a);s.set(a,{kind:"plus-image",data:l.data,type:l.type,cacheKey:o}),e.totalImageObjects++,chunk7JVB7NLG_js.p(`replayEmfPlusRecords: Stored Image object id=${a}, hasData=${l.data!==null}, imgType=${l.type}`);break}case 8:{if(r>=16){let l=i.getUint32(n+8,true),c=["tile","tile-flip-x","tile-flip-y","tile-flip-xy","clamp"];s.set(a,{kind:"plus-imageattributes",wrapMode:c[l]??"clamp",clampArgb:i.getUint32(n+12,true)});}else s.set(a,{kind:"plus-imageattributes"});break}case 4:{let l=sT(i,n,r);l&&(s.set(a,l),chunk7JVB7NLG_js.p(`replayEmfPlusRecords: Stored Region object id=${a}`));break}default:chunk7JVB7NLG_js.q(`replayEmfPlusRecords: Unknown EMF+ object type: ${u}, id=${a}`);break}}var Sp=64;function zc(e,t,n,r=0){if(t+4>n)return null;if(r>Sp)return chunk7JVB7NLG_js.q(`parseRegionNode: depth limit (${Sp}) exceeded`),null;let o=e.getUint32(t,true),i=t+4;if(o<=5){let s=zc(e,i,n,r+1);if(!s)return null;i+=s.bytesRead;let a=zc(e,i,n,r+1);return a?(i+=a.bytesRead,{node:{type:"combine",combineMode:o,left:s.node,right:a.node},bytesRead:i-t}):null}if(o===268435456){if(i+16>n)return null;let s=e.getFloat32(i,true),a=e.getFloat32(i+4,true),u=e.getFloat32(i+8,true),l=e.getFloat32(i+12,true);return {node:{type:"rect",x:s,y:a,width:u,height:l},bytesRead:i+16-t}}if(o===268435457){if(i+4>n)return null;let s=e.getInt32(i,true);if(i+=4,s<=0||i+s>n)return null;let a=nr(e,i,s);return {node:a?{type:"path",path:a}:{type:"empty"},bytesRead:i+s-t}}return o===268435458?{node:{type:"empty"},bytesRead:4}:o===268435459?{node:{type:"infinite"},bytesRead:4}:(chunk7JVB7NLG_js.q(`parseRegionNode: unknown node type 0x${o.toString(16)}`),{node:{type:"empty"},bytesRead:4})}function sT(e,t,n){if(n<8)return null;e.getUint32(t,true);let o=e.getUint32(t+4,true);if(o>1e5)return chunk7JVB7NLG_js.q(`parseEmfPlusRegionObject: invalid node count ${o}`),null;let i=t+n,s=zc(e,t+8,i);return s?{kind:"plus-region",nodes:[s.node]}:(chunk7JVB7NLG_js.q("parseEmfPlusRegionObject: failed to parse region node tree"),null)}function fT(e,t,n){if(n<8)return;let r=e.view.getUint32(t,true);n<4+4*r||((e.ext??(e.ext={})).multiFormatSkip=true,chunk7JVB7NLG_js.p("MultiFormatStart: GDI+ plays no further EMF+ record"));}function Lp(e){return e>0&&e<=1e5?e:void 0}function*Up(e,t,n,r,o,i,s,a=1,u=5e5,l,c,f){let m=s??_a(),b={ctx:r,view:e,objectTable:m.objectTable,worldTransform:m.worldTransform,deferredImages:[],saveStack:m.saveStack,saveIdMap:m.saveIdMap,totalImageObjects:0,totalDrawImageCalls:0,clipSaveDepth:m.clipSaveDepth,clipRegion:m.clipRegion,pageUnit:m.pageUnit??Xs,pageScale:m.pageScale??1,dpiX:m.dpiX,dpiY:m.dpiY,videoDisplay:m.videoDisplay,...m.continuation??vs(),dpiScale:a,canvasW:o,canvasH:i,fontFamilyMap:l,textureCache:c,interpolationMode:m.interpolationMode,pixelOffsetMode:m.pixelOffsetMode,textRenderingHint:m.textRenderingHint,fonts:f,baseTransform:m.baseTransform,imageCache:m.imageCache,nestingDepth:m.nestingDepth,gdiAntialias:m.gdiAntialias,codePages:m.codePages,antiAlias:m.antiAlias,ext:m.ext??(m.ext={})},h=t+n,d=0,p=void 0;for(false;t+12<=h&&d<u;){chunkDO2CGP4P_js.c(),chunkDO2CGP4P_js.d()&&(yield);let x=e.getUint16(t,true),y=e.getUint16(t+2,true),g=e.getUint32(t+4,true),M=e.getUint32(t+8,true);if(g<12||t+g>h)break;d++;let E=t+12;if(m.gdiPassthrough=x===16388,b.ext?.multiFormatSkip&&x!==16386){t+=g;continue}switch(x){case 16385:{if(m.dualMode=(y&1)!==0,M>=16){let P=e.getUint32(E+4,true),R=e.getUint32(E+8,true),T=e.getUint32(E+12,true);b.dpiX=m.dpiX=Lp(R),b.dpiY=m.dpiY=Lp(T),b.videoDisplay=m.videoDisplay=(P&1)!==0;}break}case 16386:t=h;continue;case 16388:break;case 16389:fT(b,E,M);break;case 16390:case 16391:break;case 16440:(b.ext??(b.ext={})).pendingEffect=M<=g-12?ys(e,E,M):null;break;case 16393:{if(M>=4){let P=e.getUint32(E,true);r.save(),r.setTransform(1,0,0,1,0,0),r.globalAlpha=1,r.globalCompositeOperation="source-over",P>>>24!==255&&r.clearRect(0,0,o,i),r.fillStyle=chunk7JVB7NLG_js.b(P),r.fillRect(0,0,o,i),r.restore();}break}case 16392:{let P=Cs(b,e,y,E,M);P&&vp(P.view===e?b:{...b,view:P.view},P.flags,P.dataOff,P.dataSize,P.cacheKey);break}default:{Ip(b,x,y,E,M)||Rp(b,x,y,E,M)||Pp(b,x,y,E,M)||Zb(b,x,y,E,M)||console.warn(`[emf-converter] Unhandled EMF+ record type: 0x${x.toString(16)}`);break}}t+=g;}if(d>=u&&console.warn(`[emf-converter] EMF+ record limit reached (${u}). Output may be incomplete.`),p);return s&&(s.worldTransform=b.worldTransform,s.saveIdMap=b.saveIdMap,s.clipRegion=b.clipRegion??null,s.clipSaveDepth=b.clipSaveDepth,s.continuation={continuationBuffer:b.continuationBuffer,continuationObjectId:b.continuationObjectId,continuationObjectType:b.continuationObjectType,continuationTotalSize:b.continuationTotalSize,continuationOffset:b.continuationOffset,continuationKey:b.continuationKey},s.interpolationMode=b.interpolationMode,s.pixelOffsetMode=b.pixelOffsetMode,s.textRenderingHint=b.textRenderingHint,s.pageUnit=b.pageUnit,s.pageScale=b.pageScale,s.dpiX=b.dpiX,s.dpiY=b.dpiY,s.videoDisplay=b.videoDisplay,s.antiAlias=b.antiAlias),r.setTransform(1,0,0,1,0,0),b.deferredImages}function Fp(e,t,n,r,o,i=1,s={}){return chunkDO2CGP4P_js.g(Kc(e,t,n,r,o,i,s))}function*Kc(e,t,n,r,o,i=1,s={}){let a=[],u=_a(),l=s.maxRecords??2e5,c=s.maxRecordsEmfPlus??5e5,f=n.right-n.left||1,m=n.bottom-n.top||1,b=r/f,h=o/m,d=i>0?i:1;u.imageCache=s.imageCache,u.gdiAntialias=s.gdiAntialias,u.codePages=s.codePages,u.baseTransform=s.plusBaseTransform??[b/d,0,0,h/d,-n.left*b,-n.top*h],u.nestingDepth=s.nestingDepth;let p={ctx:t,view:e,objectTable:new Map,state:{...Fa(),fontFamilyMap:s.fontFamilyMap},stateStack:[],inPath:false,windowOrg:{x:0,y:0},windowExt:{cx:1,cy:1},viewportOrg:{x:0,y:0},viewportExt:{cx:1,cy:1},mapMode:1,useMappingMode:false,deviceToCanvas:true,clipSaveDepth:0,bounds:n,canvasW:r,canvasH:o,sx:b,sy:h,pathCmds:[],gdiAntialias:s.gdiAntialias,fonts:s.fonts,codePages:s.codePages},x=0,y=e.byteLength,g=0;for(;x+8<=y&&g<l;){chunkDO2CGP4P_js.c(),chunkDO2CGP4P_js.d()&&(yield);let P=e.getUint32(x,true),R=e.getUint32(x+4,true);if(R<8||x+R>y)break;g++;let T=x+8;if(P===70){if(R>=16){let A=e.getUint32(T,true),I=e.getUint32(T+4,true);if(I===726027589&&A>4){Xe(p);let S=yield*Up(e,T+8,A-4,t,r,o,u,i,c,s.fontFamilyMap,s.textureCache,s.fonts);a.push(...S);}}x+=R;continue}if(P===14){break}if(P===28||P===98||P===115||P===1){x+=R;continue}if(ea(P)||Xe(p),s.gdiDrawing===false){x+=R;continue}if(u.dualMode&&!u.gdiPassthrough){P===33?yT(p):P===34?R>=12&&gT(p,e.getInt32(T,true)):Ii(p,P,x,T,R),x+=R;continue}Ii(p,P,x,T,R)||Aa(p,P,x,T,R)||va(p,P,x,T,R)||console.warn(`[emf-converter] Unhandled EMR record type: ${P}`),x+=R;}if(Xe(p),g>=l&&console.warn(`[emf-converter] EMF record limit reached (${l}). Output may be incomplete.`),s.nestingDepth){let P=u.clipSaveDepth+p.clipSaveDepth+p.stateStack.length;for(;P-- >0;)t.restore();}return a}function yT(e){e.skippedDcStack??(e.skippedDcStack=[]),e.skippedDcStack.push({state:ka(e.state),mapping:{mapMode:e.mapMode,windowOrg:{...e.windowOrg},windowExt:{...e.windowExt},viewportOrg:{...e.viewportOrg},viewportExt:{...e.viewportExt},useMappingMode:e.useMappingMode}});}function gT(e,t){let n=e.skippedDcStack??[],r=t<0?n.length+t:t-1;if(r<0||r>=n.length)return;let o=n[r];n.length=r,Object.assign(e.state,o.state),Object.assign(e,o.mapping);}function MT(e,t,n,r,o,i){let s=new DataView(e);if(!dr(s))return null;let[u,l,c,f,m,b]=o;if(l===0&&c===0&&u>0&&f>0){let d=-m/u,p=-b/f,x={left:d,top:p,right:d+n/u,bottom:p+r/f};return Fp(s,t,x,n,r,1,i)}return Fp(s,t,{left:0,top:0,right:n,bottom:r},n,r,1,{...i,plusBaseTransform:o,gdiDrawing:false})}nh(MT);var kp=256*1024*1024;async function vi(e){let t;if(e instanceof ArrayBuffer)t=e;else if(ArrayBuffer.isView(e))t=e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer instanceof ArrayBuffer?e.buffer:ET(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));else if(typeof Blob<"u"&&e instanceof Blob)t=await e.arrayBuffer();else return chunk7JVB7NLG_js.q("readMetafileInput: expected an ArrayBuffer, a typed array / Buffer, or a Blob"),null;return PT(t)?RT(t):t}function ET(e){let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t}function PT(e){if(e.byteLength<18)return false;let t=new Uint8Array(e,0,3);return t[0]===31&&t[1]===139&&t[2]===8}async function RT(e){if(typeof DecompressionStream>"u")return chunk7JVB7NLG_js.q("readMetafileInput: gzip input (.emz/.wmz) needs DecompressionStream, which this runtime lacks"),null;try{let t=new Blob([e]).stream().pipeThrough(new DecompressionStream("gzip")).getReader(),n=[],r=0;for(;;){let{done:s,value:a}=await t.read();if(s)break;if(r+=a.byteLength,r>kp)return await t.cancel(),chunk7JVB7NLG_js.q(`readMetafileInput: gzip input inflates past ${kp} bytes; refused`),null;n.push(a);}let o=new Uint8Array(r),i=0;for(let s of n)o.set(s,i),i+=s.byteLength;return o.buffer}catch(t){return chunk7JVB7NLG_js.q("readMetafileInput: gzip input is corrupt:",t instanceof Error?t.message:t),null}}var TT=15,wT=1128680791;function Ha(e,t){let n=t,r=null,o=0,i=0,s=0,a=0,u=0;for(;n+6<=e.byteLength&&u++<1e6;){let c=e.getUint32(n,true)*2,f=e.getUint16(n+4,true);if(c<6||n+c>e.byteLength||f===0)break;if(f===1574&&c>=44){let m=n+6,b=e.getUint16(m,true),h=e.getUint16(m+2,true),d=m+4;if(b===TT&&h>=34&&e.getUint32(d,true)===wT&&e.getUint32(d+4,true)===1){let p=e.getUint32(d+18,true),x=e.getUint32(d+22,true),y=e.getUint32(d+26,true),g=e.getUint32(d+30,true),M=d+34;if(x>h-34||M+x>n+c)return null;if(!r){if(g===0||g>256*1024*1024)return null;r=new Uint8Array(g),i=g,s=p;}if(g!==i||o+x>i||y!==i-o-x)return null;r.set(new Uint8Array(e.buffer,e.byteOffset+M,x),o),o+=x,a++;}}n+=c;}if(!r||o!==i||a!==s)return null;let l=new DataView(r.buffer);return i<88||l.getUint32(0,true)!==1?null:r.buffer}var wt=class{constructor(t,n=64){this.type=t;this.len=8;this.bytes=new Uint8Array(Math.max(16,n)),this.view=new DataView(this.bytes.buffer);}ensure(t){if(this.len+t<=this.bytes.length)return;let n=new Uint8Array(Math.max(this.bytes.length*2,this.len+t));n.set(this.bytes),this.bytes=n,this.view=new DataView(n.buffer);}get offset(){return this.len}i32(t){return this.ensure(4),this.view.setInt32(this.len,t|0,true),this.len+=4,this}u32(t){return this.ensure(4),this.view.setUint32(this.len,t>>>0,true),this.len+=4,this}i16(t){return this.ensure(2),this.view.setInt16(this.len,t,true),this.len+=2,this}u16(t){return this.ensure(2),this.view.setUint16(this.len,t&65535,true),this.len+=2,this}f32(t){return this.ensure(4),this.view.setFloat32(this.len,t,true),this.len+=4,this}raw(t){return this.ensure(t.length),this.bytes.set(t,this.len),this.len+=t.length,this}align(){for(;this.len%4!==0;)this.ensure(1),this.bytes[this.len++]=0;return this}patchU32(t,n){return this.view.setUint32(t,n>>>0,true),this}finish(){return this.align(),this.view.setUint32(0,this.type,true),this.view.setUint32(4,this.len,true),new DataView(this.bytes.buffer,0,this.len)}};function Ht(e,t){let n=t.getUint32(0,true),r=t.getUint32(4,true);ea(n)||Xe(e);let o=e.view;e.view=t;try{!Ii(e,n,0,8,r)&&!Aa(e,n,0,8,r)&&va(e,n,0,8,r);}finally{e.view=o;}}var _p=[0,8388608,32768,8421376,128,8388736,32896,12632256,12639424,10930928,16776176,10526884,8421504,16711680,65280,16776960,255,16711935,65535,16777215];function Gp(){return {kind:"pen",style:0,width:0,color:0}}function Op(){return {kind:"brush",style:0,color:16777215,hatch:0}}function Bp(e,t,n){return e<<16|t<<8|n}function Kn(e,t){let n=e&255,r=e>>>8&255,o=e>>>16&255;if(e>>>24===1){let i=e&65535;if(t){let s=t.entries[i<t.entries.length?i:0];return s===void 0?0:Bp(s&255,s>>>8&255,s>>>16&255)}return _p[i<_p.length?i:0]}return Bp(n,r,o)}function Ir(e,t){let n=Kn(t,e.palette);return chunk7JVB7NLG_js.a(n>>16&255,n>>8&255,n&255)}function Zn(e,t){return e.getUint32(t,true)}function Np(e,t){e.pen=t;let n=e.rCtx.state;n.penStyle=t.style&15,n.penFlags=t.style&15,n.penWidth=t.width,n.penColor=Ir(e,t.color),n.penUserStyle=void 0,n.penExtended=false;}function Ci(e,t){e.brush=t;let n=e.rCtx.state;n.brushStyle=t.pattern?t.pattern.kind==="mono"?3:6:t.style,n.brushColor=Ir(e,t.color),n.brushPattern=t.pattern??(t.style===2&&t.hatch>=0&&t.hatch<=5?{kind:"hatch",hatch:t.hatch}:null);}function po(e){Np(e,e.pen),Ci(e,e.brush),e.rCtx.state.textColor=Ir(e,e.textColor),e.rCtx.state.bkColor=Ir(e,e.bkColor);}function $t(e,t){let n=0;for(;e.objects[n]!==void 0;)n++;e.objects[n]=t;}function Wp(e,t,n){let{view:r}=e;if(n<16){$t(e,{kind:"other"});return}$t(e,{kind:"pen",style:r.getUint16(t,true),width:r.getInt16(t+2,true),color:Zn(r,t+6)});}function Hp(e,t,n){let{view:r}=e;if(n<14){$t(e,{kind:"other"});return}$t(e,{kind:"brush",style:r.getUint16(t,true),color:Zn(r,t+2),hatch:r.getUint16(t+6,true)});}function $p(e,t,n,r){let{view:o}=e;if(n<24){$t(e,{kind:"other"});return}let i=[];for(let u=0;u<32&&t+18+u<r;u++){let l=o.getUint8(t+18+u);if(l===0)break;i.push(l);}let s=String.fromCharCode(...qn(i,1,{ansi:e.ansiCodePage}).codes),a={kind:"font",height:o.getInt16(t,true),weight:o.getInt16(t+8,true),italic:o.getUint8(t+10)!==0,underline:o.getUint8(t+11)!==0,strikeOut:o.getUint8(t+12)!==0,family:s||"sans-serif",escapementTenthDeg:o.getInt16(t+4,true),details:{width:o.getInt16(t+2,true),orientationTenthDeg:o.getInt16(t+6,true),charSet:o.getUint8(t+13),quality:o.getUint8(t+16),pitchAndFamily:o.getUint8(t+17)}};$t(e,{kind:"font",font:a});}function Qc(e,t,n,r){if(n+40>r)return null;let o=t.getUint32(n,true),i=t.getUint16(n+14,true),s=t.getUint32(n+32,true);if(o<40||i>8)return null;let a=s||1<<i,u=n+o+a*2;if(u>r)return null;let l=r-u,c=new Uint8Array(o+a*4+l),f=new Uint8Array(t.buffer,t.byteOffset+n,r-n);c.set(f.subarray(0,o),0);for(let m=0;m<a;m++){let b=Kn(16777216|t.getUint16(n+o+m*2,true),e.palette);c[o+m*4]=b&255,c[o+m*4+1]=b>>8&255,c[o+m*4+2]=b>>16&255,c[o+m*4+3]=0;}return c.set(f.subarray(u-n),o+a*4),c}function em(e,t,n){let r=e.getUint32(t,true),o=e.getUint16(t+14,true),i=e.getUint32(t+16,true),a=e.getUint32(t+32,true);a===0&&o<=8&&(a=1<<o);let l=r+a*(4);return i===3&&r===40&&(l+=12),l}function AT(e,t,n,r,o){let i=e.view,s=t,a=n;if(r===1){let f=Qc(e,e.view,t,n);if(!f)return null;i=new DataView(f.buffer),s=0,a=f.length;}if(s+40>a)return null;let u=s+em(i,s);if(o&&i.getUint16(s+14,true)===1){let f=chunk7JVB7NLG_js.f(i,s,u);if(f)return {kind:"mono",...f}}let l=chunk7JVB7NLG_js.d(i,s,u,Math.max(0,a-u));if(!l)return null;let c=new Uint32Array(l.width*l.height);for(let f=0;f<c.length;f++)c[f]=l.data[f*4]<<16|l.data[f*4+1]<<8|l.data[f*4+2];return {kind:"bitmap",width:l.width,height:l.height,rgb:c}}function Xp(e,t,n){let{view:r}=e;if(t+4+40>n){$t(e,{kind:"other"});return}let o=r.getUint16(t,true),i=r.getUint16(t+2,true),s=AT(e,t+4,n,i,o===3);$t(e,{kind:"brush",style:s?6:0,color:8421504,hatch:0,...s?{pattern:s}:{}});}function jp(e,t,n){let r=e.getUint16(t,true),o=e.getUint16(t+2,true),i=[];for(let s=0;s<o&&t+4+s*4+4<=n;s++)i.push(e.getUint32(t+4+s*4,true));return {start:r,entries:i}}function Yp(e,t,n){if(t+4>n){$t(e,{kind:"other"});return}$t(e,{kind:"palette",entries:jp(e.view,t,n).entries});}function tm(e,t,n,r){let o=e.palette;if(!o||t+4>n)return;let{start:i,entries:s}=jp(e.view,t,n);for(let a=0;a<s.length&&i+a<o.entries.length;a++)r&&(o.entries[i+a]>>>24&1)===0||(o.entries[i+a]=s[a]);po(e);}function Vp(e,t){let n=e.palette;if(n){if(t<n.entries.length)n.entries.length=t;else for(;n.entries.length<t;)n.entries.push(0);po(e);}}function zp(e,t){let n=e.objects[t];n?.kind==="palette"&&(e.palette=n,po(e));}function qp(e,t,n){let{view:r}=e,o={kind:"region",rects:[]};if(t+22<=n){let i=r.getUint16(t+10,true),s=t+22;for(let a=0;a<i&&s+6<=n;a++){let u=r.getUint16(s,true),l=r.getInt16(s+2,true),c=r.getInt16(s+4,true),f=s+6;for(let m=0;m+1<u&&f+4<=n;m+=2,f+=4){let b=r.getInt16(f,true),h=r.getInt16(f+2,true);h>b&&c>l&&o.rects.push([b,l,h,c]);}s=f+2;}if(i===0){let a=r.getInt16(t+14,true),u=r.getInt16(t+16,true),l=r.getInt16(t+18,true),c=r.getInt16(t+20,true);l>a&&c>u&&o.rects.push([a,u,l,c]);}}$t(e,o);}function Jp(e,t){let n=e.objects[t];if(!n)return;let r=e.rCtx.state;switch(n.kind){case "pen":Np(e,n);break;case "brush":Ci(e,n);break;case "font":{let o=n.font;r.fontHeight=o.height,r.fontWeight=o.weight,r.fontItalic=o.italic,r.fontUnderline=o.underline,r.fontStrikeOut=o.strikeOut,r.fontFamily=o.family,r.fontEscapementTenthDeg=o.escapementTenthDeg??0,r.fontDetails=o.details;break}}return n}function Kp(e,t){t>=0&&t<e.objects.length&&(e.objects[t]=void 0);}function nm(e,t,n,r,o){let i=Ee(e.rCtx),s=(l,c)=>[Math.floor((i[0]*l+i[2]*c+i[4])/e.kx+.5),Math.floor((i[1]*l+i[3]*c+i[5])/e.ky+.5)],a=s(t,n),u=s(t+r,n+o);return [a[0],a[1],u[0]-a[0],u[1]-a[1]]}function Zp(e,t){let{rCtx:n}=e,r={windowOrg:n.windowOrg,windowExt:n.windowExt,viewportOrg:n.viewportOrg,viewportExt:n.viewportExt};n.windowOrg={x:0,y:0},n.windowExt={cx:1,cy:1},n.viewportOrg={x:0,y:0},n.viewportExt={cx:e.kx,cy:e.ky};try{t();}finally{Object.assign(n,r);}}function IT(e,t){if(!t||t.bmi.length<48)return t;let n=new DataView(t.bmi.buffer,t.bmi.byteOffset,t.bmi.byteLength);if(n.getUint16(14,true)!==1)return t;let r=t.bmi.slice(),o=n.getUint32(0,true),i=(s,a)=>{r[o+s*4]=a&255,r[o+s*4+1]=a>>8&255,r[o+s*4+2]=a>>16&255,r[o+s*4+3]=0;};return i(0,Kn(e.textColor,e.palette)),i(1,Kn(e.bkColor,e.palette)),{bmi:r,bits:t.bits}}function rm(e,t,n,r){let{view:o}=e;if(t+40>n)return null;let i=new Uint8Array(o.buffer,o.byteOffset+t,n-t),s=new DataView(i.buffer,i.byteOffset,i.byteLength);if(r===1){let u=Qc(e,o,t,n);if(!u)return null;i=u,s=new DataView(u.buffer);}if(s.getUint32(0,true)<40)return null;let a=em(s,0);return a>i.length?null:{bmi:i.subarray(0,a),bits:i.subarray(a)}}function om(e,t,n,r,o,i,s,a,u,l,c,f){[r,o,i,s]=nm(e,r,o,i,s);let m=t?108:100,b=new wt(t?77:76,m+(f?f.bmi.length+f.bits.length+8:0));b.i32(0).i32(0).i32(-1).i32(-1),b.i32(r).i32(o).i32(i).i32(s),b.u32(n),b.i32(a).i32(u),b.f32(1).f32(0).f32(0).f32(1).f32(0).f32(0),b.u32(0),b.u32(0);let h=b.offset;if(b.u32(0).u32(0).u32(0).u32(0),t&&b.i32(l).i32(c),f){let p=b.offset;b.raw(f.bmi).align();let x=b.offset;b.raw(f.bits),b.patchU32(h,p).patchU32(h+4,f.bmi.length).patchU32(h+8,x).patchU32(h+12,f.bits.length);}let d=b.finish();Zp(e,()=>Ht(e.rCtx,d));}function Qp(e,t,n,r,o,i,s,a,u,l,c,f=false){f||([n,r,o,i]=nm(e,n,r,o,i));let m=new wt(81,80+c.bmi.length+c.bits.length+8);m.i32(0).i32(0).i32(-1).i32(-1),m.i32(n).i32(r),m.i32(s).i32(a).i32(u).i32(l);let b=m.offset;m.u32(0).u32(0).u32(0).u32(0),m.u32(0),m.u32(t),m.i32(o).i32(i);let h=m.offset;m.raw(c.bmi).align();let d=m.offset;m.raw(c.bits),m.patchU32(b,h).patchU32(b+4,c.bmi.length).patchU32(b+8,d).patchU32(b+12,c.bits.length);let p=m.finish();Zp(e,()=>Ht(e.rCtx,p));}function e1(e,t,n){let{view:r}=e;if(t+12>n)return;let o=r.getUint32(t,true),i=r.getInt16(t+4,true),s=r.getInt16(t+6,true),a=r.getInt16(t+8,true),u=r.getInt16(t+10,true);om(e,false,o,u,a,s,i,0,0,s,i,null);}function t1(e,t){return t/2===(e>>8)+3}function n1(e,t,n,r){let{view:o}=e,i=o.getUint16(n+4,true);if(!t1(i,r))return;let s=n+6,a=s+4+(t?4:0)+6;if(a+8>n+r)return;let u=o.getUint32(s,true),l=o.getInt16(a,true),c=o.getInt16(a+2,true),f=o.getInt16(a+4,true),m=o.getInt16(a+6,true);om(e,false,u,m,f,c,l,0,0,c,l,null);}function r1(e,t,n,r){let{view:o}=e,i=o.getUint16(n+4,true),s=n+6,a=n+r,u=t1(i,r),l=s+4,c=()=>{let E=o.getInt16(l,true);return l+=2,E};if(s+4+(t?16:12)>a)return;let f=o.getUint32(s,true),m=t?c():0,b=t?c():0,h=c(),d=c();u&&(l+=2);let p=c(),x=c(),y=c(),g=c(),M=u?null:IT(e,rm(e,l,a,0));om(e,t,f,g,y,x,p,d,h,t?b:x,t?m:p,M);}function o1(e,t,n){let{view:r}=e;if(t+22>n)return;let o=r.getUint32(t,true),i=r.getUint16(t+4,true),s=r.getInt16(t+6,true),a=r.getInt16(t+8,true),u=r.getInt16(t+10,true),l=r.getInt16(t+12,true),c=r.getInt16(t+14,true),f=r.getInt16(t+16,true),m=r.getInt16(t+18,true),b=r.getInt16(t+20,true),h=rm(e,t+22,n,i);h&&Qp(e,o,b,m,f,c,l,u,a,s,h);}function i1(e,t,n){let{view:r}=e;if(t+18>n)return;let o=r.getUint16(t,true),i=r.getUint16(t+2,true),s=r.getUint16(t+4,true),a=r.getInt16(t+6,true),u=r.getInt16(t+8,true),l=r.getInt16(t+10,true),c=r.getInt16(t+12,true),f=r.getInt16(t+14,true),m=r.getInt16(t+16,true),b=rm(e,t+18,n,o);if(!b||i===0)return;let h=Math.abs(new DataView(b.bmi.buffer,b.bmi.byteOffset,b.bmi.byteLength).getInt32(8,true));if(s!==0||i<h)return;let d=Math.max(a,s),p=Math.min(a+l,s+i);if(p<=d||c<=0)return;let x=b.bmi.slice(),y=new DataView(x.buffer),g=y.getInt32(8,true);y.setInt32(8,g<0?-i:i,true);let[M,E]=nm(e,m,f,0,0),P=e.layout&1?M-c:M;Qp(e,13369376,P,E+(a+l-p),c,p-d,u,d-s,c,p-d,{bmi:x,bits:b.bits},true);}function s1(e,t,n){let r=Ee(e.rCtx),o=Math.round((r[0]*t+r[2]*n)*16)+Math.round(r[4]*16),i=Math.round((r[1]*t+r[3]*n)*16)+Math.round(r[5]*16);return [Math.floor((o/e.kx+8)/16),Math.floor((i/e.ky+8)/16)]}function xo(e,t,n,r,o){let i=s1(e,t,n),s=s1(e,r,o);return [Math.min(i[0],s[0]),Math.min(i[1],s[1]),Math.max(i[0],s[0]),Math.max(i[1],s[1])]}function ST(e,t){return t.map(([n,r,o,i])=>({x:n*e.kx,y:r*e.ky,w:(o-n)*e.kx,h:(i-r)*e.ky}))}function im(e,t,n){Xe(e.rCtx);let r=t.length>0?mn(ST(e,t)):Ot();wr(e.rCtx,r,n);}function a1(e,t,n,r,o){im(e,[xo(e,t,n,r,o)],"intersect");}function u1(e,t,n,r,o){im(e,[xo(e,t,n,r,o)],"exclude");}function l1(e,t,n){let{rCtx:r}=e;if(!r.clipRegion)return;Xe(r);let o=Ee(r),i=Math.round(o[0]*t/e.kx)*e.kx,s=Math.round(o[3]*n/e.ky)*e.ky;r.clipRegion=mr(r.clipRegion,i,s),Yt(r,r.clipRegion);}function sm(e,t){let n=e.objects[t];if(n?.kind!=="region"){Xe(e.rCtx),e.rCtx.clipRegion=null,Yt(e.rCtx,null);return}im(e,n.rects,"replace");}function $a(e,t){return t.rects.map(([n,r,o,i])=>xo(e,n,r,o,i)).filter(([n,r,o,i])=>o>n&&i>r)}function c1(e,t){let n=new chunk7JVB7NLG_js.s,r=new Map;for(let[o,i,s,a]of t){let u=Math.round(o*e.kx),l=Math.round(s*e.kx);for(let c=Math.round(i*e.ky);c<Math.round(a*e.ky);c++){let f=r.get(c);f||(f=[],r.set(c,f)),f.push([u,l]);}}for(let o of [...r.keys()].sort((i,s)=>i-s)){let i=r.get(o).sort((u,l)=>u[0]-l[0]),[s,a]=i[0];for(let u=1;u<i.length;u++)i[u][0]<=a?a=Math.max(a,i[u][1]):(n.add(o,s,a),[s,a]=i[u]);n.add(o,s,a);}return n}function am(e,t,n){let r=e.brush;if(n!==null){let i=e.objects[n];if(i?.kind!=="brush")return;Ci(e,i);}let o=on(e.rCtx);o&&at(e.rCtx,c1(e,t),o,e.rCtx.state.rop2),n!==null&&Ci(e,r);}function Xa(e,t){let n=e.objects[t];return n?.kind==="region"?n:null}function m1(e,t,n){let r=Xa(e,t);r&&am(e,$a(e,r),n);}function f1(e,t){let n=Xa(e,t);n&&am(e,$a(e,n),null);}function b1(e,t){let n=Xa(e,t);n&&at(e.rCtx,c1(e,$a(e,n)),{kind:"solid",rgb:0},6);}function vT(e){if(e.length===0)return null;let t=1/0,n=1/0,r=-1/0,o=-1/0;for(let[u,l,c,f]of e)t=Math.min(t,u),n=Math.min(n,l),r=Math.max(r,c),o=Math.max(o,f);let i=r-t,s=o-n;if(i<=0||s<=0||i*s>64*1024*1024)return null;let a=new Uint8Array(i*s);for(let[u,l,c,f]of e)for(let m=l;m<f;m++)a.fill(1,(m-n)*i+(u-t),(m-n)*i+(c-t));return {x0:t,y0:n,w:i,h:s,m:a}}function h1(e,t,n,r,o){let i=Xa(e,t);if(!i)return;let s=Ee(e.rCtx),a=Math.abs(Math.round(s[0]*o/e.kx)),u=Math.abs(Math.round(s[3]*r/e.ky)),l=vT($a(e,i));if(!l)return;let{x0:c,y0:f,w:m,h:b}=l,h=(p,x)=>p>=0&&x>=0&&p<m&&x<b?l.m[x*m+p]:0,d=[];for(let p=0;p<b;p++){let x=-1;for(let y=0;y<=m;y++){let g=y<m&&h(y,p)===1,M=g&&h(y-a,p)===1&&h(y+a,p)===1&&h(y,p-u)===1&&h(y,p+u)===1&&h(y-a,p-u)===1&&h(y+a,p-u)===1&&h(y-a,p+u)===1&&h(y+a,p+u)===1,E=g&&!M;E&&x<0?x=y:!E&&x>=0&&(d.push([c+x,f+p,c+y,f+p+1]),x=-1);}}am(e,d,n);}function CT(e,t,n){let r=new chunk7JVB7NLG_js.s,o=Math.round(t*e.kx),i=Math.max(o+1,Math.round((t+1)*e.kx)),s=Math.round(n*e.ky),a=Math.max(s+1,Math.round((n+1)*e.ky));for(let u=s;u<a;u++)r.add(u,o,i);return r}function d1(e,t,n,r){let[o,i]=xo(e,t,n,t,n);at(e.rCtx,CT(e,o,i),{kind:"solid",rgb:Kn(r,e.palette)},13);}function um(e,t,n,r,o){let{rCtx:i}=e,{ctx:s}=i,a=vn(s);if(!a||!chunk7JVB7NLG_js.qa(s)||typeof s.getImageData!="function")return;let u=on(i);if(!u)return;Xe(i);let[l,c]=xo(e,t,n,t,n),f=Math.floor((l+.5)*e.kx),m=Math.floor((c+.5)*e.ky),{w:b,h}=a;if(f<0||m<0||f>=b||m>=h)return;let d=chunk7JVB7NLG_js.ka(s,0,0,b,h).data,p=Kn(r,e.palette),x=T=>d[T*4+3]===0?16777215:d[T*4]<<16|d[T*4+1]<<8|d[T*4+2],y=o===1,g=T=>y?x(T)===p:x(T)!==p,M=m*b+f;if(!g(M))return;let E=new Uint8Array(b*h),P=[M];for(E[M]=1;P.length>0;){let T=P.pop(),w=T%b,A=(T-w)/b,I=S=>{!E[S]&&g(S)&&(E[S]=1,P.push(S));};w>0&&I(T-1),w+1<b&&I(T+1),A>0&&I(T-b),A+1<h&&I(T+b);}let R=new chunk7JVB7NLG_js.s;for(let T=0;T<h;T++){let w=-1;for(let A=0;A<=b;A++){let I=A<b&&E[T*b+A]===1;I&&w<0?w=A:!I&&w>=0&&(R.add(T,w,A),w=-1);}}at(i,R,u,i.state.rop2);}var p1=5,x1=6;function ja(e,t,n,r,o,i={}){let s=i.exclusive!==false,a=ge(e.rCtx,t,n),u=ge(e.rCtx,r,o),l=16*e.kx,c=16*e.ky,f={x0:Math.min(a[0],u[0]),y0:Math.min(a[1],u[1]),x1:Math.max(a[0],u[0])-(s?Math.round(l):0),y1:Math.max(a[1],u[1])-(s?Math.round(c):0)};if(!s)return f;if(i.curved&&cm(e)&&(f.x0-=Math.round(l/4),f.y0-=Math.round(c/4),f.x1-=Math.round(l*3/4),f.y1-=Math.round(c*3/4)),(e.rCtx.state.penStyle&15)===x1&&Math.round(aa(e.rCtx)/e.kx)>1){let b={...f},h=Ee(e.rCtx),d=Math.round(Math.abs(e.rCtx.state.penWidth*h[0])/e.kx*16),p=Math.round(Math.abs(e.rCtx.state.penWidth*h[3])/e.ky*16);f.x1+=Math.round(l),f.y1+=Math.round(c),f.x0+=Math.round((i.curved||i.roundFrame?Math.floor(d/2):Math.ceil(d/2))*l/16),f.y0+=Math.round(Math.ceil(p/2)*c/16);let x=!!i.half&&d%2===1;if(f.x1-=Math.round((x?Math.ceil(d/2):Math.floor(d/2))*l/16),f.y1-=Math.round(Math.ceil(p/2)*c/16),x&&(f.halfX=true),i.clampEmpty&&(f.x1<f.x0||f.y1<f.y0))return {x0:b.x0,y0:b.y0,x1:b.x1+Math.round(l),y1:b.y1+Math.round(c)}}return f}function Ya(e,t,n=false){let r=n?chunk7JVB7NLG_js.w(e.x0,e.y0,e.x1,e.y1):chunk7JVB7NLG_js.w(e.x0,e.y0,Math.max(e.x0,e.x1),Math.max(e.y0,e.y1));return e.halfX&&(r.halfX=true,r.halfXCompat=true),t&&(r.cornerExact=t),r}function Di(e){return {x:e.x0/16,y:e.y0/16,w:Math.max(0,e.x1-e.x0)/16,h:Math.max(0,e.y1-e.y0)/16}}function DT(e,t){let{state:n}=e.rCtx,r=Vn(e.rCtx);if(Mr(n,r)===0||gr(n,r)!==1)return;let o=Di(t);if(!(o.w<=1||o.h<=1))return i=>{i.beginPath(),i.rect(o.x+1,o.y+1,o.w-1,o.h-1);}}function y1(e,t,n,r,o){let i=ja(e,t,n,r,o);if(i.x1<i.x0||i.y1<i.y0)return;let s=Di(i),{rCtx:a}=e,{state:u}=a,l=u.penStyle===p1||(u.penStyle===0||u.penStyle===6)&&yt(a);if(a.gdiAntialias!==false&&l&&chunk7JVB7NLG_js.h(u).kind!=="tile"&&(chunk7JVB7NLG_js.Z(u.rop2).exact||!Yn(u.rop2))){let{ctx:c}=a;Xe(a),chunk7JVB7NLG_js.aa(c,u),c.fillRect(s.x,s.y,s.w,s.h),chunk7JVB7NLG_js.$(c,u),c.lineWidth=1;let f=Mr(u,Vn(a));c.strokeRect(s.x+f,s.y+f,s.w,s.h);return}Qe(e.rCtx,{build:c=>{c.beginPath(),c.rect(s.x,s.y,s.w,s.h);},raster:()=>yr(Ya(i),lm(e)),rectangle:true,fill:true,stroke:true,axisRect:{interior:DT(e,i)}});}function LT(e,t,n,r,o){let i=Ee(e.rCtx);Math.round(Math.abs(t*i[0])*16);Math.round(Math.abs(n*i[3])*16);let u=16*e.kx,l=16*e.ky;if((e.rCtx.state.penStyle&15)===x1&&!yt(e.rCtx)){let d=r.x1-r.x0,p=r.y1-r.y0,x=Math.abs((o[2]-o[0])*i[0])*16||d,y=Math.abs((o[3]-o[1])*i[3])*16||p,g=Math.min(Math.abs(t*i[0])*16,x)*d/x;return [Math.floor(g),Math.floor(Math.min(Math.abs(n*i[3])*16,y)*p/y),[g,Math.min(Math.abs(n*i[3])*16,y)*p/y]]}let c=r.x1-r.x0,f=r.y1-r.y0,m=Math.abs((o[2]-o[0])*i[0])*16||c+u,b=Math.abs((o[3]-o[1])*i[3])*16||f+l,h=[Math.min(Math.abs(t*i[0])*16,m)*c/m,Math.min(Math.abs(n*i[3])*16,b)*f/b];return yt(e.rCtx)&&!cm(e)?h:[Math.floor(h[0]),Math.floor(h[1])]}function g1(e,t,n,r,o,i,s){let a=ja(e,t,n,r,o,{curved:true,half:true,clampEmpty:true});if(a.x1<a.x0||a.y1<a.y0)return;let[u,l,c]=LT(e,i,s,a,[t,n,r,o]),f=Di(a);Qe(e.rCtx,{build:m=>{m.beginPath();let b=Math.min(u/32,f.w/2),h=Math.min(l/32,f.h/2);if(b<=0||h<=0){m.rect(f.x,f.y,f.w,f.h);return}let d=Math.PI/2,p=f.x+f.w,x=f.y+f.h;m.moveTo(f.x+b,f.y),m.lineTo(p-b,f.y),m.ellipse(p-b,f.y+h,b,h,0,-d,0),m.lineTo(p,x-h),m.ellipse(p-b,x-h,b,h,0,0,d),m.lineTo(f.x+b,x),m.ellipse(f.x+b,x-h,b,h,0,d,2*d),m.lineTo(f.x,f.y+h),m.ellipse(f.x+b,f.y+h,b,h,0,2*d,3*d),m.closePath();},raster:()=>sa(Ya(a,c),u,l,lm(e),i===0||s===0,!cm(e)&&yt(e.rCtx)),roundPen:true,fill:true,stroke:true});}function M1(e,t,n,r,o){let i=ja(e,t,n,r,o,{curved:true,half:true,clampEmpty:true});if(i.x1<i.x0||i.y1<i.y0)return;let s=Di(i);Qe(e.rCtx,{build:a=>{a.beginPath(),a.ellipse(s.x+s.w/2,s.y+s.h/2,s.w/2,s.h/2,0,0,Math.PI*2);},raster:()=>li(Ya(i),lm(e)),roundPen:true,fill:true,stroke:true});}function UT(e,t,n,r,o,i,s,a,u,l,c=false){let f=ja(e,n,r,o,i,{curved:t==="chord"||t==="pie",roundFrame:true,half:true});if(f.y1<f.y0||!c&&f.x1<f.x0)return null;let m=Ee(e.rCtx),b=(E,P)=>[(m[0]*E+m[2]*P+m[4])*16,(m[1]*E+m[3]*P+m[5])*16],[h,d]=b(n,r),[p,x]=b(o,i),y={x0:Math.min(h,p),x1:Math.max(h,p),y0:Math.min(d,x),y1:Math.max(d,x)},g=(E,P,R,T,w)=>(T+w)/2+(R!==P?(E-(P+R)/2)*(w-T)/(R-P):E-(P+R)/2),M=(E,P)=>{let[R,T]=b(E,P);return [g(R,y.x0,y.x1,f.x0,f.x1),g(T,y.y0,y.y1,f.y0,f.y1)]};return {box:f,s:M(s,a),e:M(u,l)}}function E1(e,t,n,r,o,i,s,a,u,l){let c=UT(e,t,n,r,o,i,s,a,u,l);if(!c)return;let{box:f,s:m,e:b}=c,h=e.rCtx.state.arcDirection===2,d=Di(f),p=d.x+d.w/2,x=d.y+d.h/2,y=d.w/2||1,g=d.h/2||1,M=Math.atan2((m[1]/16-x)/g,(m[0]/16-p)/y),E=Math.atan2((b[1]/16-x)/g,(b[0]/16-p)/y),P=t==="chord"||t==="pie";Qe(e.rCtx,{build:R=>{R.beginPath(),t==="pie"&&R.moveTo(p,x),R.ellipse(p,x,d.w/2,d.h/2,0,M,E,!h),P&&R.closePath();},raster:()=>no(Ya(f),m,b,h,t).path,fill:P,stroke:true});}function lm(e){return e.rCtx.state.arcDirection===2}function cm(e){return (e.rCtx.state.penStyle&15)===p1}function FT(e,t){let n=e.rCtx.fonts;if(!n)return null;let r=Ee(e.rCtx),o=n.realize(bc(e.rCtx.state,Math.hypot(r[2],r[3]),Math.hypot(r[0],r[1])),e.rCtx.state.fontFamilyMap);return o?t.map(i=>o.advance(o.glyphIndex(i))):null}function kT(e,t){if(e.charExtra===0&&(e.justifyExtra===0||e.justifyCount===0))return null;let n=FT(e,t);if(!n)return null;let r=Ee(e.rCtx),o=Math.hypot(r[0],r[1])||1,i=Math.round(e.charExtra*o),s=32,a=e.justifyCount,u=a>0?Math.round(e.justifyExtra*o):0,l=f=>Math.round((f+1)*u/a)-Math.round(f*u/a),c=0;return n.map((f,m)=>{let b=f+i;return t[m]===s&&a>0&&(b+=l(c++)),b/o})}function _T(e,t,n,r){let{rCtx:o}=e;if(!o.fonts)return false;Xe(o);let i=t.rect,s=Ra(o.ctx,o.fonts,o.state,{codes:n,glyphIndices:false,x:t.x,y:t.y,options:t.options,rect:i?{left:i[0],top:i[1],right:i[2],bottom:i[3]}:null,dx:r,dy:null,matrix:Ee(o)});return s?(o.state.textAlign&1&&(o.state.curX+=s.dx,o.state.curY+=s.dy),true):false}function mm(e,t){let n=e.rCtx.state.fontDetails?.charSet??1,{codes:r,byteLengths:o}=qn(t.bytes,n,{ansi:e.ansiCodePage,oem:e.oemCodePage}),i=r.length;if(i===0)return;let s=0,a=t.dx?o.map(m=>{let b=0;for(let h=0;h<m;h++)b+=t.dx[s++]??0;return b}):kT(e,r);if(_T(e,t,r,a))return;let u=new wt(84,76+i*6+8);u.i32(0).i32(0).i32(-1).i32(-1),u.u32(1),u.f32(1).f32(1),u.i32(t.x).i32(t.y),u.u32(i);let l=u.offset;u.u32(0),u.u32(t.options);let c=t.rect??[0,0,0,0];u.i32(c[0]).i32(c[1]).i32(c[2]).i32(c[3]);let f=u.offset;u.u32(0),u.patchU32(l,u.offset);for(let m of r)u.u16(m);if(u.align(),a){u.patchU32(f,u.offset);for(let m of a)u.u32(Math.round(m)>>>0);}Ht(e.rCtx,u.finish());}function P1(e,t,n){let{view:r}=e;if(t+2>n)return;let o=r.getInt16(t,true),i=t+2,s=i+o+(o&1);if(o<=0||s+4>n)return;let a=[];for(let u=0;u<o;u++)a.push(r.getUint8(i+u));mm(e,{y:r.getInt16(s,true),x:r.getInt16(s+2,true),bytes:a,options:0,rect:null,dx:null});}function R1(e,t,n){let{view:r}=e;if(t+8>n)return;let o=r.getInt16(t,true),i=r.getInt16(t+2,true),s=r.getInt16(t+4,true),a=r.getUint16(t+6,true),u=(a&(mo|fo))!==0,l=t+8+(u?8:0),c=u&&t+16<=n?[r.getInt16(t+8,true),r.getInt16(t+10,true),r.getInt16(t+12,true),r.getInt16(t+14,true)]:null,f=Math.max(0,s);if(l+f>n)return;let m=[];for(let d=0;d<f;d++)m.push(r.getUint8(l+d));let b=l+f+(f&1),h=null;if(f>0&&b+f*2<=n){h=[];for(let d=0;d<f;d++)h.push(r.getInt16(b+d*2,true));}if(f===0){c&&a&mo&&mm(e,{x:i,y:o,bytes:[32],options:a,rect:c,dx:[0]});return}mm(e,{x:i,y:o,bytes:m,options:a,rect:c,dx:h});}function $4(e,t,n,r,o,i={}){let s=ho(e,n,i.wmfReferenceDpi),a=r/s.width,u=o/s.height,l={...Fa(),fontFamilyMap:i.fontFamilyMap},c={ctx:t,view:e,objectTable:new Map,state:l,stateStack:[],inPath:false,windowOrg:{x:0,y:0},windowExt:{cx:1,cy:1},viewportOrg:{x:0,y:0},viewportExt:{cx:1,cy:1},useMappingMode:true,clipSaveDepth:0,bounds:{left:0,top:0,right:s.width,bottom:s.height},canvasW:r,canvasH:o,sx:a,sy:u,pathCmds:[],gdiAntialias:i.gdiAntialias,fonts:i.fonts,wholeDevicePixels:[a,u]},f={rCtx:c,ansiCodePage:i.wmfAnsiCodePage??i.codePages?.ansi,oemCodePage:i.codePages?.oem,view:e,kx:a,ky:u,devW:s.width,devH:s.height,objects:[],stack:[],mapping:s.mapping,pen:Gp(),brush:Op(),palette:null,textColor:0,bkColor:16777215,charExtra:0,justifyExtra:0,justifyCount:0,layout:0};return Sc(c,f.mapping,a,u),po(f),f}function un(e){Sc(e.rCtx,e.mapping,e.kx,e.ky,e.layout&1?e.devW:0);}function X4(e){return {mapping:Ic(e.mapping),pen:e.pen,brush:e.brush,palette:e.palette,textColor:e.textColor,bkColor:e.bkColor,charExtra:e.charExtra,justifyExtra:e.justifyExtra,justifyCount:e.justifyCount,layout:e.layout}}function Li(e,t,n){Ht(e.rCtx,new wt(t,16).u32(n).finish());}function j4(e,t,n,r){let o=new wt(t,28+n*4);o.i32(0).i32(0).i32(-1).i32(-1).u32(n);for(let i=0;i<n;i++)o.i16(e.view.getInt16(r+i*4,true)).i16(e.view.getInt16(r+i*4+2,true));Ht(e.rCtx,o.finish());}function Y4(e,t,n,r){let{view:o,rCtx:i}=e,s=n+6,a=n+r,u=f=>s+f<=a,l=f=>o.getInt16(s+f*2,true),c=f=>o.getUint16(s+f*2,true);switch(t){case 259:u(2)&&(Da(e.mapping,c(0)),un(e));return;case 523:u(4)&&(e.mapping.winOrg={y:l(0),x:l(1)},un(e));return;case 524:u(4)&&(Qd(e.mapping,l(1),l(0)),un(e));return;case 525:u(4)&&(e.mapping.vpOrg={y:l(0),x:l(1)},un(e));return;case 526:u(4)&&(ep(e.mapping,l(1),l(0)),un(e));return;case 527:u(4)&&(e.mapping.winOrg={x:e.mapping.winOrg.x+l(1),y:e.mapping.winOrg.y+l(0)},un(e));return;case 529:u(4)&&(e.mapping.vpOrg={x:e.mapping.vpOrg.x+l(1),y:e.mapping.vpOrg.y+l(0)},un(e));return;case 1040:u(8)&&(La(e.mapping,l(3),l(2),l(1),l(0)),un(e));return;case 1042:u(8)&&(Ua(e.mapping,l(3),l(2),l(1),l(0)),un(e));return;case 30:e.stack.push(X4(e)),Ht(i,new wt(33,8).finish());return;case 295:{let f=u(2)?l(0):-1,m=e.stack.length;if(f<0&&(f=m+f+1),f<1||f>m)return;let b=e.stack[f-1];e.stack.length=f-1,Ht(i,new wt(34,12).i32(f).finish()),Object.assign(e,{...b,mapping:Ic(b.mapping)}),un(e),po(e);return}case 521:u(4)&&(e.textColor=Zn(o,s),i.state.textColor=Ir(e,e.textColor));return;case 513:u(4)&&(e.bkColor=Zn(o,s),i.state.bkColor=Ir(e,e.bkColor));return;case 258:u(2)&&Li(e,18,c(0));return;case 260:u(2)&&Li(e,20,c(0));return;case 262:u(2)&&Li(e,19,c(0));return;case 263:u(2)&&Li(e,21,c(0));return;case 302:u(2)&&Li(e,22,c(0));return;case 264:u(2)&&(e.charExtra=l(0));return;case 522:u(4)&&(e.justifyCount=l(0),e.justifyExtra=l(1));return;case 329:u(4)&&(e.layout=o.getUint32(s,true),un(e));return;case 261:case 561:case 1574:case 53:return;case 762:Wp(e,s,r);return;case 764:Hp(e,s,r);return;case 763:$p(e,s,r,a);return;case 322:Xp(e,s,a);return;case 505:return;case 247:Yp(e,s,a);return;case 1791:qp(e,s,a);return;case 248:case 1790:case 765:$t(e,{kind:"other"});return;case 301:u(2)&&(e.objects[c(0)]?.kind==="region"?sm(e,c(0)):Jp(e,c(0)));return;case 564:u(2)&&zp(e,c(0));return;case 55:tm(e,s,a,false);return;case 1078:tm(e,s,a,true);return;case 313:u(2)&&Vp(e,c(0));return;case 496:u(2)&&Kp(e,c(0));return;case 532:u(4)&&Ht(i,new wt(27,16).i32(l(1)).i32(l(0)).finish());return;case 531:u(4)&&Ht(i,new wt(54,16).i32(l(1)).i32(l(0)).finish());return;case 1051:u(8)&&y1(e,l(3),l(2),l(1),l(0));return;case 1564:u(12)&&g1(e,l(5),l(4),l(3),l(2),l(1),l(0));return;case 1048:u(8)&&M1(e,l(3),l(2),l(1),l(0));return;case 2071:case 2096:case 2074:u(16)&&E1(e,t===2071?"arc":t===2096?"chord":"pie",l(7),l(6),l(5),l(4),l(3),l(2),l(1),l(0));return;case 804:case 805:if(u(2)){let f=l(0);f>0&&u(2+f*4)&&j4(e,t===804?86:87,f,s+2);}return;case 1336:if(u(2)){let f=c(0);if(f===0||!u(2+f*2))return;let m=[],b=0;for(let p=0;p<f;p++){let x=o.getUint16(s+2+p*2,true);m.push(x),b+=x;}let h=s+2+f*2;if(!u(2+f*2+b*4))return;let d=new wt(91,32+f*4+b*4);d.i32(0).i32(0).i32(-1).i32(-1).u32(f).u32(b);for(let p of m)d.u32(p);for(let p=0;p<b;p++)d.i16(o.getInt16(h+p*4,true)).i16(o.getInt16(h+p*4+2,true));Ht(i,d.finish());}return;case 1313:P1(e,s,a);return;case 2610:R1(e,s,a);return;case 1565:e1(e,s,a);return;case 2338:case 2851:n1(e,t===2851,n,r);return;case 2368:case 2881:r1(e,t===2881,n,r);return;case 3907:o1(e,s,a);return;case 3379:i1(e,s,a);return;case 1046:u(8)&&a1(e,l(3),l(2),l(1),l(0));return;case 1045:u(8)&&u1(e,l(3),l(2),l(1),l(0));return;case 544:u(4)&&l1(e,l(1),l(0));return;case 300:u(2)&&sm(e,c(0));return;case 552:u(4)&&m1(e,c(0),c(1));return;case 299:u(2)&&f1(e,c(0));return;case 298:u(2)&&b1(e,c(0));return;case 1065:u(8)&&h1(e,c(0),c(1),l(2),l(3));return;case 1055:u(8)&&d1(e,l(3),l(2),Zn(o,s));return;case 1049:u(8)&&um(e,l(3),l(2),Zn(o,s),0);return;case 1352:u(10)&&um(e,l(4),l(3),Zn(o,s+2),c(0));return;default:return}}function*S1(e,t,n,r,o,i={}){let s=$4(e,t,n,r,o,i),a=n.headerSize,u=e.byteLength,l=i.maxRecords??2e5,c=0;for(;a+6<=u&&c<l;){let m=e.getUint32(a,true)*2,b=e.getUint16(a+4,true);if(m<6||a+m>u||b===0)break;c++,chunkDO2CGP4P_js.c(),chunkDO2CGP4P_js.d()&&(yield),Y4(s,b,a,m),a+=m;}Xe(s.rCtx);let f=s.rCtx.clipSaveDepth+s.rCtx.stateStack.length;for(;f-- >0;)t.restore();c>=l&&console.warn(`[emf-converter] WMF record limit reached (${l}). Output may be incomplete.`);}function ki(e,t){return t?{...e,[chunkDO2CGP4P_js.a]:t}:e}var Fi=3;async function C1(e,t,n){if(chunk7JVB7NLG_js.p(`replayMetafile: input buffer ${e.byteLength} bytes`),false);let r=t??{},o=chunkDO2CGP4P_js.b(r),i=r.dpiScale??chunk7JVB7NLG_js.V,s=new DataView(e),a=null;try{a=dr(s);}catch(u){chunk7JVB7NLG_js.q("replayMetafile: parseEmfHeader threw during detection:",u instanceof Error?u.message:u);}if(!a)try{let u=oi(s),l=u?Ha(s,u.headerSize):null;if(l){let c=new DataView(l);a=dr(c),a&&(chunk7JVB7NLG_js.p("replayMetafile: WMF carries an embedded EMF; playing the EMF"),s=c);}}catch(u){chunk7JVB7NLG_js.q("replayMetafile: embedded-EMF probe threw:",u instanceof Error?u.message:u);}if(a){chunk7JVB7NLG_js.p("replayMetafile: detected EMF (valid EMR_HEADER)");try{let u=await Ls(s),l=await ju(s,0,{maxRecords:r.maxRecords,budget:o});o?.check();let c=zs(a);if(!c)return chunk7JVB7NLG_js.p("replayMetafile: getRenderableEmfBounds returned null"),null;let f=n(c.right-c.left,c.bottom-c.top);if(!f)return chunk7JVB7NLG_js.p("replayMetafile: surface creation failed"),null;f.ctx.save();let m=await chunkDO2CGP4P_js.f(o,Kc(s,f.ctx,c,f.width,f.height,i,{maxRecords:r.maxRecords,maxRecordsEmfPlus:r.maxRecords,fontFamilyMap:r.fontFamilyMap,codePages:{ansi:r.ansiCodePage,oem:r.oemCodePage},textureCache:u,imageCache:l,gdiAntialias:r.gdiAntialias,fonts:await v1(r)}));return f.ctx.restore(),chunk7JVB7NLG_js.p(`replayMetafile: EMF replay done, ${m.length} deferred images`),{surface:f,deferredImages:m}}catch(u){return o?.throwIfTripped(),chunk7JVB7NLG_js.q("replayMetafile: EMF EXCEPTION:",u instanceof Error?u.message:u),console.warn("[emf-converter] EMF conversion failed:",u instanceof Error?u.message:u),null}}chunk7JVB7NLG_js.p("replayMetafile: not EMF, trying WMF");try{let u=oi(s);if(!u)return chunk7JVB7NLG_js.p("replayMetafile: parseWmfHeader returned null"),null;if(u.boundsRight-u.boundsLeft<=0||u.boundsBottom-u.boundsTop<=0)return chunk7JVB7NLG_js.p("replayMetafile: invalid WMF dimensions"),null;await lb(s,u.headerSize,{maxRecords:r.maxRecords,budget:o});let l=ho(s,u,r.wmfReferenceDpi),c=n(l.width,l.height);return c?(c.ctx.save(),await chunkDO2CGP4P_js.f(o,S1(s,c.ctx,u,c.width,c.height,{wmfReferenceDpi:r.wmfReferenceDpi,wmfAnsiCodePage:r.wmfAnsiCodePage,codePages:{ansi:r.ansiCodePage,oem:r.oemCodePage},maxRecords:r.maxRecords,fontFamilyMap:r.fontFamilyMap,gdiAntialias:r.gdiAntialias,fonts:await v1(r)})),c.ctx.restore(),{surface:c,deferredImages:[]}):null}catch(u){return o?.throwIfTripped(),chunk7JVB7NLG_js.q("replayMetafile: WMF EXCEPTION:",u instanceof Error?u.message:u),console.warn("[emf-converter] WMF conversion failed:",u instanceof Error?u.message:u),null}}async function v1(e){if(!e.fonts||e.fonts.length===0)return;let{GdiFontCollection:t}=await import('./browser-chunks/gdi-font-engine-VF73ZSE3.js'),n=t.for(e.fonts,e.fontSmoothing??"cleartype");return n.size>0?n:void 0}function Ui(e){let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}function V4(e,t,n){let r=e.canvas,o=r?.width,i=r?.height;if(typeof o!="number"||typeof i!="number")return false;let{width:s,height:a}=t,u=chunk7JVB7NLG_js.Y(s,a);if(!u)return false;chunk7JVB7NLG_js.ja(u.ctx,t.drawable,0,0,s,a);let l=chunk7JVB7NLG_js.ka(u.ctx,0,0,s,a),c=cn(l.data,s,a,n,{w:o,h:i});if(!c)return false;let f=chunk7JVB7NLG_js.Y(c.w,c.h);return f?(chunk7JVB7NLG_js.la(f.ctx,chunk7JVB7NLG_js.na(c.rgba,c.w,c.h),0,0),e.save(),e.setTransform(1,0,0,1,0,0),e.imageSmoothingEnabled=false,chunk7JVB7NLG_js.ja(e,f.canvas,c.x,c.y,c.w,c.h),e.restore(),true):false}async function z4(e,t,n,r){chunk7JVB7NLG_js.p(`processDeferredImages: ${t.length} deferred images (recursionDepth=${n})`);let o=true;for(let i=0;i<t.length;i++){let s=t[i];r?.check();try{let a=Ui(s.imageData);e.setTransform(...s.transform);let u=a,l;if(s.isMetafile){if(n>=Fi){chunk7JVB7NLG_js.q(` Deferred image [${i}]: skipping embedded metafile, recursion depth ${n}`);continue}let f=await gm(a,ki({},r),n+1);if(!f){chunk7JVB7NLG_js.q(` Deferred image [${i}]: metafile conversion returned null`),o=!1;continue}l=f.mimeType,u=Ui(f.data.buffer);}if(s.effect&&!s.isMetafile){let f=await Em(u);if(f){let m=Vs({kind:"plus-image",type:1,data:s.imageData},{kind:"bitmap",rgba:f.data,width:f.width,height:f.height},s.effect,s,s.effectSource);if(m){let{encodePng:b}=await import('./browser-chunks/png-encoder-BUYFBWDO.js');u=Ui((await b(m.bitmap.rgba,m.bitmap.width,m.bitmap.height)).buffer),s=m.draw,e.setTransform(...s.transform);}l="image/png";}}let c=await chunk7JVB7NLG_js.ha(u,l);c?(s.resample&&V4(e,c,s.resample)||chunk7JVB7NLG_js.ja(e,c.drawable,s.dx,s.dy,s.dw,s.dh),c.close()):(chunk7JVB7NLG_js.q(` Deferred image [${i}]: no image decoder available`),o=!1);}catch(a){r?.throwIfTripped(),o=false;let u=a instanceof Error?a.message:String(a);chunk7JVB7NLG_js.q(` Deferred image [${i}]: DRAW FAILED: ${u}`),console.warn("[emf-converter] Deferred image draw failed:",u,`(isMetafile=${s.isMetafile}, dataLen=${s.imageData.byteLength})`);}}return e.setTransform(1,0,0,1,0,0),o}var D1={png:"image/png",jpeg:"image/jpeg",webp:"image/webp",svg:"image/svg+xml"};async function q4(e,t,n=0){let r=t?.format??"png",o=chunkDO2CGP4P_js.b(t);if(o?.check(),t=ki(t,o),r==="svg"){let i=await k1(e,t,n);if(!i)return null;o?.check();let s=chunk7JVB7NLG_js.ra(await i.toTree({includeSize:t.includeSize}));return o?.check(),{format:r,mimeType:D1.svg,data:new TextEncoder().encode(s),width:i.canvas.width,height:i.canvas.height}}return t?.format==="jpeg"?L1(e,t,n):t?.format==="webp"?U1(e,t,n):gm(e,t,n)}async function ym(e,t,n,r,o){let i=chunkDO2CGP4P_js.b(t);t=ki(t,i);let s=await F1(e,t,n);if(!s)return null;try{let{width:a,height:u}=s;i?.check();let l=await o(s,i);return i?.check(),{format:r,mimeType:D1[r],data:l,width:a,height:u}}catch(a){return i?.throwIfTripped(),chunk7JVB7NLG_js.q("convertMetafile: EXCEPTION:",a instanceof Error?a.message:a),console.warn("[emf-converter] Conversion failed:",a instanceof Error?a.message:a),null}}function gm(e,t,n=0){return ym(e,t,n,"png",async({data:r,width:o,height:i},s)=>{let{encodePng:a}=await import('./browser-chunks/png-encoder-BUYFBWDO.js');return chunkDO2CGP4P_js.e(s,()=>a(r,o,i))})}function L1(e,t,n=0){return ym(e,t,n,"jpeg",async({data:r,width:o,height:i},s)=>{let{encodeJpeg:a}=await import('./browser-chunks/jpeg-encoder-5DE4U2SQ.js');return chunkDO2CGP4P_js.e(s,()=>a(r,o,i,{quality:t?.quality,background:Q4(t?.background),chromaSubsampling:t?.chromaSubsampling}))})}function U1(e,t,n=0){return ym(e,t,n,"webp",async({data:r,width:o,height:i},s)=>{let{encodeWebp:a}=await import('./browser-chunks/webp-encoder-4JPXFFZZ.js');return chunkDO2CGP4P_js.e(s,()=>a(r,o,i,{lossy:t?.lossless===!1,quality:t?.quality}))})}async function F1(e,t,n=0){let r=chunkDO2CGP4P_js.b(t);r?.check();let o=await vi(e);r?.check();let i=o?await ew(o,ki(t,r),n,"convertMetafileToImageData"):null;if(!i)return null;try{let{canvas:s,ctx:a}=i;return {data:s instanceof chunk7JVB7NLG_js.Q?new Uint8ClampedArray(s.pixels):chunk7JVB7NLG_js.ka(a,0,0,s.width,s.height).data,width:s.width,height:s.height}}catch(s){return r?.throwIfTripped(),chunk7JVB7NLG_js.q("convertMetafileToImageData: EXCEPTION:",s instanceof Error?s.message:s),console.warn("[emf-converter] Conversion failed:",s instanceof Error?s.message:s),null}}async function J4(e,t){return Mm(await gm(e,{...t}))}async function K4(e,t){return Mm(await L1(e,{...t}))}function Mm(e){return e?`data:${e.mimeType};base64,${chunk7JVB7NLG_js.sa(e.data)}`:null}async function Z4(e,t){return Mm(await U1(e,{...t}))}function Q4(e){if(e===void 0)return [255,255,255];let t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim())?.[1];if(!t)return chunk7JVB7NLG_js.q(`convertMetafileToJpegDataUrl: background "${e}" is not #rgb or #rrggbb; using white`),[255,255,255];let n=t.length===3?[...t].map(r=>r+r).join(""):t;return [0,2,4].map(r=>parseInt(n.slice(r,r+2),16))}async function ew(e,t,n,r){let o=chunkDO2CGP4P_js.b(t);if(await chunk7JVB7NLG_js.T(),n>Fi)return chunk7JVB7NLG_js.q(`${r}: recursion depth ${n} exceeds limit ${Fi}`),null;let i={...t,gdiAntialias:t?.gdiAntialias??false};o?.check();let s=null,a=await C1(e,i,(u,l)=>{let c=chunk7JVB7NLG_js.X(u,l,i.maxWidth,i.maxHeight,i.dpiScale??chunk7JVB7NLG_js.V,i.maxCanvasDimension);return c?(s=c.canvas,{ctx:c.ctx,width:c.canvas.width,height:c.canvas.height}):null});if(!a||!s)return null;try{let u=await z4(a.surface.ctx,a.deferredImages,n,o),l=s instanceof chunk7JVB7NLG_js.Q?s:null;return l&&(l.textDraws>0||!u)?(chunk7JVB7NLG_js.q(`${r}: no canvas backend and the drawing ${l.textDraws>0?`contains text (${l.textDraws} runs)`:"contains an image only a canvas can decode"}; install @napi-rs/canvas for raster output, or use SVG output`),null):{canvas:s,ctx:a.surface.ctx}}catch(u){return o?.throwIfTripped(),chunk7JVB7NLG_js.q(`${r}: EXCEPTION:`,u instanceof Error?u.message:u),console.warn("[emf-converter] Conversion failed:",u instanceof Error?u.message:u),null}}var xm=0;async function Em(e){let t=await chunk7JVB7NLG_js.ia(new Uint8Array(e));if(t||chunk7JVB7NLG_js.U())return t;let n=await chunk7JVB7NLG_js.ha(e);if(!n)return null;try{let r=chunk7JVB7NLG_js.Y(n.width,n.height);return r?(chunk7JVB7NLG_js.ja(r.ctx,n.drawable,0,0,n.width,n.height),{data:chunk7JVB7NLG_js.ka(r.ctx,0,0,n.width,n.height).data,width:n.width,height:n.height}):null}finally{n.close();}}async function tw(e,t,n){let r=await Em(e);return r?cn(r.data,r.width,r.height,t,{w:n.width,h:n.height}):null}async function nw(e,t,n,r,o){for(let i=0;i<t.length;i++){let s=t[i];o?.check();try{let a=Ui(s.imageData);if(s.effect&&!s.isMetafile){let f=await Em(a);if(f){let m=Vs({kind:"plus-image",type:1,data:s.imageData},{kind:"bitmap",rgba:f.data,width:f.width,height:f.height},s.effect,s,s.effectSource);if(m){let{encodePng:b}=await import('./browser-chunks/png-encoder-BUYFBWDO.js');a=Ui((await b(m.bitmap.rgba,m.bitmap.width,m.bitmap.height)).buffer),s=m.draw;}}}let u=null;if(s.isMetafile){if(r>=Fi){chunk7JVB7NLG_js.q(` Deferred image [${i}]: skipping embedded metafile, recursion depth ${r}`);continue}let f=await _i(a,{...n,includeSize:!0,idPrefix:void 0},r+1);f&&(u={kind:"url",url:chunk7JVB7NLG_js.ua(f)});}else {let f=new Uint8Array(a),m=Br(f);if(m)u={kind:"encoded",bytes:f,mime:m};else if(u=So(a),!u){let b=await chunk7JVB7NLG_js.ha(a);if(b){let h=chunk7JVB7NLG_js.X(b.width,b.height,void 0,void 0,1);h&&(chunk7JVB7NLG_js.ja(h.ctx,b.drawable,0,0,b.width,b.height),u={kind:"rgba",data:h.ctx.getImageData(0,0,b.width,b.height).data,width:b.width,height:b.height}),b.close();}}}if(!u){chunk7JVB7NLG_js.q(` Deferred image [${i}]: unsupported image data for SVG output`);continue}let l=s.svgSlot??e.reserveSlot();if(s.resample&&n.imageResampling==="exact"&&!s.isMetafile){let f=await tw(a,s.resample,e.canvas);if(f){e.fillSlot(l,{kind:"rgba",data:f.rgba,width:f.w,height:f.h},[1,0,0,1,0,0],f.x,f.y,f.w,f.h);continue}chunk7JVB7NLG_js.q(` Deferred image [${i}]: exact resampling unavailable (image not decodable here); renderer scaling used`);}let c=s.resample?Qi(u):null;if(s.resample&&c){let f=s.resample;e.fillSlotCropped(l,u,f.toDevice,c,f.srcX,f.srcY,f.srcW,f.srcH);}else e.fillSlot(l,u,s.transform,s.dx,s.dy,s.dw,s.dh);}catch(a){o?.throwIfTripped(),chunk7JVB7NLG_js.q(` Deferred image [${i}]: SVG embed failed: ${a instanceof Error?a.message:a}`);}}}async function _i(e,t,n=0){let r=await k1(e,t,n);return r?r.toTree({includeSize:t?.includeSize}):null}async function k1(e,t,n=0){let r=chunkDO2CGP4P_js.b(t);if(r?.check(),await chunk7JVB7NLG_js.T(),n>Fi)return null;let o=await vi(e);if(r?.check(),!o)return null;let i=ki(t??{},r),s=i.dpiScale??chunk7JVB7NLG_js.V,a=i.idPrefix===void 0?++xm:0,u=i.idPrefix??`emf${a}-`,l=null;try{let{SvgContext:c}=await import('./browser-chunks/svg-context-CVI7XPTM.js'),f=await C1(o,i,(b,h)=>{let d=chunk7JVB7NLG_js.W(b,h,i.maxWidth,i.maxHeight,s,i.maxCanvasDimension),p=i.exactRasterOps===!1?null:chunk7JVB7NLG_js.X(b,h,i.maxWidth,i.maxHeight,s,i.maxCanvasDimension)?.ctx??null;return l=new c(d.w,d.h,{shadow:p,idPrefix:u,imageResampling:i.imageResampling}),{ctx:l,width:d.w,height:d.h}});if(!f||!l)return null;let m=l;return await nw(m,f.deferredImages,i,n,r),m}catch(c){throw a!==0&&xm===a&&xm--,c}}async function _1(e,t){let n=await _i(e,t);return n?chunk7JVB7NLG_js.ra(n):null}async function rw(e,t){let n=await _1(e,t);return n?chunk7JVB7NLG_js.ta(n):null}function Ut(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}function ue(e){if(!Number.isFinite(e))return "0";let t=Math.round(e*1e6)/1e6;return t===0?"0":Number.isInteger(t)?String(t):t.toFixed(6).replace(/0+$/,"").replace(/\.$/,"")}function Pm(e){let t="FEFF";for(let n=0;n<e.length;n++)t+=e.charCodeAt(n).toString(16).padStart(4,"0").toUpperCase();return `<${t}>`}function Bi(e){let t="/";for(let n of e){let r=n.charCodeAt(0);t+=r>32&&r<127&&!"()<>[]{}/%#".includes(n)?n:`#${(r&255).toString(16).padStart(2,"0")}`;}return t}var za=class{constructor(){this.objects=[null];}reserve(){return this.objects.push(null),this.objects.length-1}set(t,n){this.objects[t]={kind:"raw",bytes:Ut(n)};}add(t){let n=this.reserve();return this.set(n,t),n}setStream(t,n,r,o=true){this.objects[t]={kind:"stream",dict:n,data:r,compress:o};}addStream(t,n,r=true){let o=this.reserve();return this.setStream(o,t,n,r),o}get count(){return this.objects.length-1}async finish(t,n){let r=[],o=[0],i=0,s=b=>{r.push(b),i+=b.length;};s(Uint8Array.from([...Ut(`%PDF-1.7
1
+ 'use strict';var chunkI7XOR2GO_js=require('./browser-chunks/chunk-I7XOR2GO.js'),chunk5OO5QZBQ_js=require('./browser-chunks/chunk-5OO5QZBQ.js'),chunkC3KBKW2L_js=require('./browser-chunks/chunk-C3KBKW2L.js'),chunkDO2CGP4P_js=require('./browser-chunks/chunk-DO2CGP4P.js'),chunkOB5ODU4B_js=require('./browser-chunks/chunk-OB5ODU4B.js'),chunk32ASPP2J_js=require('./browser-chunks/chunk-32ASPP2J.js');require('./browser-chunks/chunk-QX63UNWK.js'),require('./browser-chunks/chunk-J6UKX2SY.js');function Br(e){let t=e;return t.length>=8&&t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71?"image/png":t.length>=3&&t[0]===255&&t[1]===216&&t[2]===255?chunk32ASPP2J_js.a(t)==="standard"?"image/jpeg":null:t.length>=6&&t[0]===71&&t[1]===73&&t[2]===70&&t[3]===56?"image/gif":t.length>=12&&t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80?"image/webp":null}function Qi(e){if(e.kind==="rgba")return {w:e.width,h:e.height};if(e.kind!=="encoded")return null;let t=e.bytes,n=new DataView(t.buffer,t.byteOffset,t.byteLength);try{if(e.mime==="image/png"&&t.length>=24)return {w:n.getUint32(16),h:n.getUint32(20)};if(e.mime==="image/gif"&&t.length>=10)return {w:n.getUint16(6,!0),h:n.getUint16(8,!0)};if(e.mime==="image/jpeg")for(let r=2;r+9<t.length;){if(t[r]!==255){r++;continue}let o=t[r+1],i=n.getUint16(r+2);if(o>=192&&o<=207&&o!==196&&o!==200&&o!==204)return {w:n.getUint16(r+7),h:n.getUint16(r+5)};r+=2+i;}if(e.mime==="image/webp"&&t.length>=30){let r=String.fromCharCode(t[12],t[13],t[14],t[15]);if(r==="VP8X")return {w:1+(t[24]|t[25]<<8|t[26]<<16),h:1+(t[27]|t[28]<<8|t[29]<<16)};if(r==="VP8 ")return {w:n.getUint16(26,!0)&16383,h:n.getUint16(28,!0)&16383};if(r==="VP8L"){let o=n.getUint32(21,!0);return {w:(o&16383)+1,h:(o>>14&16383)+1}}}}catch{}return null}function So(e){let t=new DataView(e);if(t.byteLength<26||t.getUint8(0)!==66||t.getUint8(1)!==77)return null;let n=t.getUint32(10,true),r=chunkI7XOR2GO_js.e(t,14,n,t.byteLength-n);return r?{kind:"rgba",data:r.data,width:r.width,height:r.height}:null}var es=new Float32Array(1),bf=new Uint32Array(es.buffer);function D(e){let t=Math.fround(e);return t<=e||Number.isNaN(t)?t:t===0?(bf[0]=2147483649,es[0]):(es[0]=t,bf[0]+=t>0?-1:1,es[0])}var ke=Math.fround,Gn=D,au=new Float32Array(1),su=new Uint32Array(au.buffer);function hf(e){return au[0]=e,e>0?su[0]-=1:e<0?su[0]+=1:su[0]=2147483649,au[0]}var fe=(e,t)=>Gn(e+t),te=(e,t)=>Gn(e-t),Q=(e,t)=>Gn(e*t);function we(e,t){let n=e/t;if(!Number.isFinite(n))return n;let r=Gn(n);return (t>0?r*t>e:r*t<e)&&(r=hf(r)),r}function vo(e){let t=Math.sqrt(e);if(!Number.isFinite(t))return t;let n=Gn(t);return n*n>e&&(n=hf(n)),n}function On(e){let t=Math.floor(e);return t>=-2147483648&&t<=2147483647?t:-2147483648}function ts(e){let t=Math.ceil(e);return t>=-2147483648&&t<=2147483647?t:-2147483648}function Nn(e,t,n){return t=ke(t),n=ke(n),[fe(fe(Q(t,ke(e[0])),Q(n,ke(e[2]))),ke(e[4])),fe(fe(Q(t,ke(e[1])),Q(n,ke(e[3]))),ke(e[5]))]}var rt=(e,t)=>e>t,Wn=(e,t)=>e>=t,Xt=(e,t)=>!(e>=t),df=(e,t)=>!(e>t);var Co=11920929e-14,ns=2**30;function Mn(e){let t=e>>>24;if(t<Co)return [0,0,0,0];let n=e>>>16&255,r=e>>>8&255,o=e&255;if(Math.abs(t-255)<Co)return [t,n,r,o];let i=we(t,255);return [t,Q(i,n),Q(i,r),Q(i,o)]}function Hn(e){let t=fe(Q(Q(e,16),16),.5);return Math.floor(t)+15>>4}function rx(e,t,n,r,o){let i=r-t,s=o-n,a=Math.abs(i)>Math.abs(s),u=(a?t:n)>>4,l=Math.abs(a?i:s)>>4,c=t,f=n,m,b;if(s>=0?(m=n+15>>4,b=o+15>>4):(i=-i,s=-s,c=r,f=o,m=o+15>>4,b=n+15>>4),b<=m)return null;let h,d;if(i>=0)i<s?(h=0,d=i):(h=Math.trunc(i/s),d=i%s);else {let E=-i;if(E<s)h=-1,d=s-E;else {h=-Math.trunc(E/s);let P=E%s;P>0?(h--,d=s-P):d=0;}}let p=-1,x=f&15;if(x!==0)for(let E=16-x;E>0;E--){p+=d;let P=h+c;p>=0?(p-=s,c=P+1):c=P;}let y=c&15;y!==0&&(p-=(16-y)*s,c+=15);let g=c>>4;p>>=4;let M=new Int32Array(b-m);for(let E=0;E<M.length;E++){M[E]=g,g+=h;let P=p+d;P>=0?(p=P-s,g+=1):p=P;}return {kind:e,yStart:m,yEnd:b,xs:M,xMajor:a,origin:u,steps:l}}var rs=class{constructor(t,n,r={}){this.shading=r;this.edges=[];this.rows=new Map;this.colors=n;let o=[Hn(t[0]),Hn(t[2]),Hn(t[4]),Hn(t[0])],i=[Hn(t[1]),Hn(t[3]),Hn(t[5]),Hn(t[1])],s=1/0,a=-1/0;for(let u=0;u<3;u++){let l=rx(u,o[u],i[u],o[u+1],i[u+1]);l&&(this.edges.push(l),s=Math.min(s,l.yStart),a=Math.max(a,l.yEnd));}this.yMin=s,this.yMax=a;}row(t,n=-ns,r=ns){if(t<this.yMin||t>=this.yMax)return null;let o=n===-ns&&r===ns?t:`${t}:${n}:${r}`,i=this.rows.get(o);return i===void 0&&(i=this.computeRow(t,n,r),this.rows.set(o,i)),i}computeRow(t,n,r){let o=[];for(let C of this.edges)t>=C.yStart&&t<C.yEnd&&o.push(C);if(o.length<2)return null;let i=o[0],s=o[1];i.xs[t-i.yStart]>s.xs[t-s.yStart]&&([i,s]=[s,i]);let a=i.xs[t-i.yStart],u=s.xs[t-s.yStart];if(a===u)return null;let[l,c]=this.weights(i,t),[f,m]=this.weights(s,t),b=Math.max(a,n),h=Math.min(u,r);if(b>=h)return null;let d=u-a,p=l,x=c,y=te(b,a);if(Math.abs(y)>Co){let C=we(y,d);p=fe(Q(te(f,l),C),l),x=fe(Q(te(m,c),C),c);}let g=te(u,h);if(Math.abs(g)>Co){let C=we(g,d);f=te(f,Q(te(f,l),C)),m=te(m,Q(te(m,c),C));}let M=h-b,E=we(te(f,p),M),P=we(te(m,x),M),[R,T,w]=this.colors,A=new Uint8Array(M*4),I=[0,0,0,0],{preset:S,adjust:v}=this.shading;for(let C=0;C<M;C++){if(S)S(te(te(1,p),x),I);else {let U=p,L=x;if(v){let k=v(te(te(1,p),x)),F=fe(x,p);if(F!==0){let _=we(te(1,k),F);U=Q(p,_),L=Q(x,_);}}for(let k=0;k<4;k++){let F=R[k],_=fe(Q(te(T[k],F),U),F);I[k]=fe(_,Q(te(w[k],F),L));}}p=fe(p,E),x=fe(x,P),uu(I,A,C*4);}return {xl:b,n:M,argb:A}}weights(t,n){let r=t.xMajor?t.xs[n-t.yStart]:n,o=we(Math.abs(r-t.origin),t.steps);return t.kind===0?[o,0]:t.kind===1?[te(1,o),o]:[0,te(1,o)]}};function uu(e,t,n){let r=e[0];if(!(Math.abs(r)>=Co)){t[n]=t[n+1]=t[n+2]=t[n+3]=0;return}0>r&&(r=0),r>255&&(r=255),t[n]=pf(r);for(let o=1;o<4;o++){let i=e[o];0>i&&(i=0),i>r&&(i=r),t[n+o]=pf(i);}}function pf(e){let t=Math.floor(fe(e,.5));return Number.isFinite(t)?t&255:0}function Do(e,t,n,r,o=false){if(e===0)return 0;let i=o?we(255,e):0,s=a=>Math.min(255,o?Math.floor(Q(a,i)):Math.round(a*255/e));return (e<<24|s(t)<<16|s(n)<<8|s(r))>>>0}var lu=e=>Gn(1-ke(e));function os(e){if(!e||e.factors.length===0)return null;let t=e.factors.length;if(t===1){let o=ke(e.factors[0]);return o===1?null:i=>o>0&&i>=0&&i<=1?Gn(Math.pow(i,o)):i}let n=e.factors.map(lu).reverse(),r=e.positions.map(lu).reverse();return o=>{if(Xt(o,0)||Xt(1,o))return o;let i=1;if(rt(te(o,r[1]),xf))for(;;){if(i++,i>=t)return o;if(!rt(te(o,r[i]),xf))break}let s=te(r[i],r[i-1]);return rt(s,0)?fe(Q(we(te(o,r[i-1]),s),te(n[i],n[i-1])),n[i-1]):Q(fe(n[i],n[i-1]),.5)}}var xf=11920929e-14;function is(e){if(!e||e.argb.length<2)return null;let t=e.argb.length,n=e.argb.map(o=>Mn(o)).reverse(),r=e.positions.map(lu).reverse();return (o,i)=>{let s;if(Xt(o,0)||Xt(1,o)){s=Wn(0,o)?n[0]:n[t-1];for(let f=0;f<4;f++)i[f]=s[f];return}let a=1;for(;a<t&&rt(o,r[a]);)a++;if(a>=t){s=n[t-1];for(let f=0;f<4;f++)i[f]=s[f];return}let u=n[a-1],l=n[a],c=te(r[a],r[a-1]);if(rt(c,0)){let f=we(te(o,r[a-1]),c);for(let m=0;m<4;m++)i[m]=fe(Q(te(l[m],u[m]),f),u[m]);}else for(let f=0;f<4;f++)i[f]=Q(fe(l[f],u[f]),.5);}}var ss=2**30,yf=ke(-0.02),gf=ke(1.02),Or=class{constructor(t,n){this.minX=0;this.minY=0;this.width=0;this.height=0;this.e3x=0;this.e3y=0;this.e1x=0;this.e1y=0;this.e2x=0;this.e2y=0;this.p0x=0;this.p0y=0;this.a=0;this.det=0;this.yMin=0;this.yMax=0;this.flags=[0,0,0,0];this.yTop=[0,0,0,0];this.yBottom=[0,0,0,0];this.xTop=[0,0,0,0];this.slope=[0,0,0,0];if(this.constant=n,!t)return;let[r,o,i,s]=t,a=r[0],u=r[1],l=r[0],c=r[1];for(let h=1;h<4;h++){let[d,p]=t[h];d<a?a=d:d>l&&(l=d),p<u?u=p:p>c&&(c=p);}this.minX=a,this.minY=u,this.width=te(l,a),this.height=te(c,u),this.e3x=fe(te(te(r[0],o[0]),i[0]),s[0]),this.e3y=fe(te(te(r[1],o[1]),i[1]),s[1]),this.e1x=te(o[0],r[0]),this.e1y=te(o[1],r[1]),this.e2x=te(i[0],r[0]),this.e2y=te(i[1],r[1]),this.p0x=r[0],this.p0y=r[1],this.a=this.e3x===this.e2x&&this.e3y===this.e2y?0:te(Q(this.e2y,this.e3x),Q(this.e2x,this.e3y)),this.det=te(Q(this.e1x,this.e2y),Q(this.e1y,this.e2x));let f=[r,o,s,i];this.yMin=this.yMax=f[0][1];let m=f[0][0],b=f[0][0];for(let h=0;h<4;h++){let d=f[h],p=f[h+1&3];p[1]>d[1]?(this.flags[h]=1,this.yTop[h]=d[1],this.yBottom[h]=p[1],this.xTop[h]=d[0],this.slope[h]=we(te(p[0],d[0]),te(p[1],d[1]))):d[1]>p[1]?(this.flags[h]=2,this.yTop[h]=p[1],this.yBottom[h]=d[1],this.xTop[h]=p[0],this.slope[h]=we(te(p[0],d[0]),te(p[1],d[1]))):(this.flags[h]=0,this.yTop[h]=d[1],this.yBottom[h]=d[1],this.xTop[h]=d[0],this.slope[h]=0),d[0]<m&&(m=d[0]),d[0]>b&&(b=d[0]),d[1]<this.yMin&&(this.yMin=d[1]),d[1]>this.yMax&&(this.yMax=d[1]);}}spans(t,n,r){if(this.constant<0&&this.flags.every(c=>c===0))return [];let o=t;if(rt(this.minY,o))return [];if(Wn(o,fe(this.minY,this.height)))return [];let i=n,s=r;if(rt(this.minX,s))return [];if(Wn(i,fe(this.minX,this.width)))return [];if(rt(this.yMin,o))return [];if(Wn(o,this.yMax))return [];let a=[];for(let c=0;c<4;c++)this.flags[c]&&(Xt(o,this.yTop[c])||df(this.yBottom[c],o)||a.push(fe(Q(te(o,this.yTop[c]),this.slope[c]),this.xTop[c])));let u=a.length&-2;if(u<2)return [];a.length=u,a.sort((c,f)=>c-f);let l=[];for(let c=0;c<u;c+=2){let f=a[c],m=a[c+1];if(Wn(f,s)||Wn(i,m))continue;f<i&&(f=i),m>s&&(m=s);let b=ts(f),h=ts(m);h>b&&l.push(b,h);}return l}parameter(t,n,r){if(this.constant>=0)return r[0]=r[1]=this.constant,true;let o=te(this.p0x,t),i=te(this.p0y,n),s=this.a,a=te(fe(Q(this.e3x,i),this.det),Q(this.e3y,o)),u=te(Q(this.e1x,i),Q(this.e1y,o)),l=0,c=0,f=0;if(s!==0||s!==s){let y=te(Q(a,a),Q(Q(s,4),u)),g=fe(s,s);if(rt(y,0)){l=2;let M=vo(y),E=fe(u,u),P=Xt(a,0)?te(M,a):te(-a,M),R=we(E,P),T=we(P,g);(rt(0,R)||rt(R,1))&&(Xt(T,0)||Xt(1,T)||([R,T]=[T,R])),c=R,f=T;}else y===0&&(l=1,c=we(-a,g));}else {if(a===0)return false;l=1,c=we(-u,a);}if(l===0)return false;let[m,b]=this.solveU(c,o,i);if(l===1)return b?(r[0]=m,r[1]=c,true):false;let h=y=>!(rt(yf,y)||rt(y,gf)),d=y=>!(Xt(y,yf)||Xt(gf,y));if(b&&h(m)&&h(c))return r[0]=m,r[1]=c,true;let[p,x]=this.solveU(f,o,i);return x&&d(p)&&d(f)?(r[0]=p,r[1]=f,true):b?(r[0]=m,r[1]=c,true):false}solveU(t,n,r){let o=fe(Q(this.e3x,t),this.e1x),i=fe(Q(this.e3y,t),this.e1y);return rt(Math.abs(o),Math.abs(i))?[we(-fe(Q(t,this.e2x),n),o),true]:rt(Math.abs(i),0)?[we(-fe(Q(t,this.e2y),r),i),true]:[0,false]}},cu=class{constructor(t,n,r,o,i){this.rows=new Map;this.quads=t,this.table=n,this.n=r,this.x0=o,this.width=i;}colorAt(t,n,r=-ss,o=ss){let i=r===-ss&&o===ss?n:`${n}:${r}:${o}`,s=this.rows.get(i);if(s===void 0&&(s=this.computeRow(n,r,o),this.rows.set(i,s)),!s)return null;let a=t-this.x0;if(a<0||a>=this.width)return null;let u=s[a];return u<0?null:u}colorForPosition(t){let n=ke(t);return rt(0,n)?n=0:n<1||(n=1),this.table[On(fe(Q(this.n,n),.5))]}computeRow(t,n,r){let o=null,i=[0,0],s=Math.max(n,this.x0-2),a=Math.min(r,this.x0+this.width+2);for(let u of this.quads){let l=u.spans(t,s,a);if(!l.length)continue;o||(o=new Float64Array(this.width).fill(-1)),i[0]=i[1]=0;let c=[];for(let m=0;m<l.length;m+=2)for(let b=l[m];b<l[m+1];b++)u.parameter(b,t,i),c.push(i[0]);let f=0;for(let m=0;m<l.length;m+=2)for(let b=l[m];b<l[m+1];b++){let h=this.colorForPosition(c[f++]),d=b-this.x0;d>=0&&d<this.width&&(o[d]=h);}}return o}};function mu(e,t){if(e.length===0)return 0;let n=ke(e[0].x),r=ke(e[0].y),o=n,i=r;for(let d of e){let p=ke(d.x),x=ke(d.y);p>o?o=p:p<n&&(n=p),x>i?i=x:x<r&&(r=x);}let s=te(o,n),a=te(i,r),u=(d,p)=>[fe(Q(p,ke(t[2])),Q(d,ke(t[0]))),fe(Q(p,ke(t[3])),Q(d,ke(t[1])))],l=u(0,0),c=u(s,0),f=u(s,a),m=u(0,a),b=(d,p)=>{let x=te(d[0],p[0]),y=te(d[1],p[1]);return vo(fe(Q(x,x),Q(y,y)))},h=fe(b(c,m),b(l,f));return Math.max(1,ts(h))}function Gr(e){return Q(On(fe(Q(e,16),.5)),.0625)}function Mf(e,t){let n=e.boundary.length;if(n<2)return null;let r=mu(e.boundary,t),o=Mn(e.centerArgb),i=Mn(e.boundaryArgb[0]??4278190080),s=new Uint32Array(r+2),a=we(1,r),u=os(e.blend),l=is(e.preset),c=0,f=[0,0,0,0],m=new Uint8Array(4);for(let w=0;w<r+2;w++){if(l)l(c,f);else {let A=u?u(c):c;for(let I=0;I<4;I++)f[I]=fe(Q(te(i[I],o[I]),A),o[I]);}uu(f,m,0),s[w]=(m[0]<<24|m[1]<<16|m[2]<<8|m[3])>>>0,c=fe(c,a);}let b=Nn(t,e.center.x,e.center.y),h=Gr(b[0]),d=Gr(b[1]),p=ke(e.focus?.x??0),x=ke(e.focus?.y??0),y=p!==0||x!==0,g=[],M=[],E=h,P=h;for(let w=0;w<n;w++){let A=w+1<n?w+1:0,I=e.boundary[w],S=e.boundary[A];if(I.x===S.x&&I.y===S.y){g.push(new Or(null,-1)),y&&M.push(new Or(null,-1));continue}let v=Nn(t,I.x,I.y),C=Nn(t,S.x,S.y),U=Gr(v[0]),L=Gr(v[1]),k=Gr(C[0]),F=Gr(C[1]);E=Math.min(E,U,k),P=Math.max(P,U,k);let _=h,H=d,G=h,W=d;y&&(_=fe(Q(te(U,h),p),h),G=fe(Q(te(k,h),p),h),H=fe(Q(te(L,d),x),d),W=fe(Q(te(F,d),x),d),M.push(new Or([[h,d],[_,H],[h,d],[G,W]],0))),g.push(new Or([[_,H],[U,L],[G,W],[k,F]],-1));}let R=Math.floor(E)-2,T=Math.ceil(P)+3-R;return new cu(y?[...g,...M]:g,s,r,R,T)}var Tf=2.2;function ox(e,t){if(e<=3)return 16;let n=Math.abs(t.w)+Math.abs(t.h);return n>512?256:n>128?64:16}function ix(e){return e.preset?e.preset.positions.length:e.blend?e.blend.positions.length:2}function sx(e,t,n){let r=Math.min(e.length,t.length);if(r===0)return n;if(n<=e[0])return t[0];for(let o=1;o<r;o++)if(n<=e[o]){let i=e[o]-e[o-1],s=i>0?(n-e[o-1])/i:1;return t[o-1]+(t[o]-t[o-1])*s}return t[r-1]}function Nr(e,t){let n=e>>>24&255,r=n/255,o=i=>{let s=e>>>i&255;return (t?255*Math.pow(s/255,Tf):s)*r*(n<255?1-2**-40:1)};return [o(16),o(8),o(0),n]}function Ef(e,t,n){return [e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n,e[3]+(t[3]-e[3])*n]}var fu=new Float32Array(1),ax=new Int32Array(fu.buffer);function ne(e){let t=Math.fround(e);return Math.abs(t)>Math.abs(e)?(fu[0]=t,ax[0]-=1,fu[0]):t}function ux(e,t,n){let r=Math.min(e.length,t.length);if(r===0)return n;if(n<=e[0])return t[0];for(let o=1;o<r;o++)if(n<=e[o]){let i=ne(e[o]-e[o-1]),s=i>0?ne(ne(n-e[o-1])/i):1;return ne(t[o-1]+ne(ne(t[o]-t[o-1])*s))}return t[r-1]}function lx(e,t,n){let r=ne(1-n),o=(i,s)=>ne(ne(i*r)+ne(s*n));return [o(e[0],t[0]),o(e[1],t[1]),o(e[2],t[2]),o(e[3],t[3])]}function cx(e,t){let n=e.gammaCorrected;if(e.preset&&e.preset.positions.length>0){let{positions:i,argb:s}=e.preset,a=Math.min(i.length,s.length);if(t<=i[0]||a===1)return Nr(s[0],n);for(let u=1;u<a;u++)if(t<=i[u]){let l=i[u]-i[u-1],c=l>0?(t-i[u-1])/l:1;return Ef(Nr(s[u-1],n),Nr(s[u],n),c)}return Nr(s[a-1],n)}let r=Nr(e.startArgb,n),o=Nr(e.endArgb,n);return e.blend&&!n?lx(r,o,ux(e.blend.positions,e.blend.factors,t)):Ef(r,o,e.blend?sx(e.blend.positions,e.blend.factors,t):t)}function mx(e,t){if(t<=0)return 0;let n=t/255,r=Math.round(Math.min(1,Math.max(0,e/n/255))*1023)/1023;return 255*Math.pow(r,1/Tf)*n}function bu(e,t){let n=ox(ix(e),t),r=new Uint8Array((n+1)*4);for(let o=0;o<=n;o++){let i=cx(e,o/n),s=o*4;for(let a=0;a<3;a++){let u=e.gammaCorrected?mx(i[a],i[3]):i[a];r[s+a]=Math.min(255,Math.max(0,Math.floor(u+.5)));}r[s+3]=Math.min(255,Math.max(0,Math.floor(i[3]+.5)));}return {intervals:n,knots:r}}function hu(e){if(e.ramp)return e.ramp;let t=e.stops;return t.length===2&&t[0].offset===0&&t[1].offset===1&&t[0].argb!==void 0&&t[1].argb!==void 0?{startArgb:t[0].argb,endArgb:t[1].argb,preset:null,blend:null,gammaCorrected:false}:null}function fx(e,t){let n=t*4,r=e.knots[n+3];if(r===0)return 0;let o=i=>Math.min(255,Math.round(i*255/r));return (r<<24|o(e.knots[n])<<16|o(e.knots[n+1])<<8|o(e.knots[n+2]))>>>0}function wf(e){let t=[];for(let n=0;n<=e.intervals;n++){let r=fx(e,n),o=(r>>>24&255)/255;t.push({offset:n/e.intervals,color:`rgba(${r>>>16&255},${r>>>8&255},${r&255},${Number(o.toFixed(4))})`,argb:r});}return t}var as=65536;function Pf(e,t,n){let r=(n==="tile-flip-x"||n==="tile-flip-xy"?2:1)*t*as;return (e%r+r)%r}function du(e,t){return Math.min(255,Math.floor(e*Math.floor(255*65536/t)/65536))}function bx(e,t,n,r,o=false){let i=e.intervals,s=Math.floor(t/as),a=Math.floor(t/256)&255,u=s<=i?s:2*i-s,l=s+1<=i?s+1:Math.max(0,2*i-s-1),c=e.knots,f=Math.min(i,u)*4,m=Math.min(i,l)*4,b=c[f+3]*(256-a)+c[m+3]*a+128>>8;if(b!==0){for(let h=0;h<3;h++){let d=c[f+h]*(256-a)+c[m+h]*a+128>>8;n[r+h]=b===255?d:o?du(d,b):Math.round(d*255/b);}n[r+3]=b;}}function hx(e,t,n,r){let o=e.intervals,i=Math.floor(t/as),s=Math.floor(t/256)&255,a=i<=o?i:2*o-i,u=i+1<=o?i+1:Math.max(0,2*o-i-1),l=e.knots,c=Math.min(o,a)*4,f=Math.min(o,u)*4;for(let m=0;m<4;m++)n[r+m]=l[c+m]*(256-s)+l[f+m]*s+128>>8;}function Rf(e,t){return [D(D(e[0]*t[0])+D(e[1]*t[2])),D(D(e[0]*t[1])+D(e[1]*t[3])),D(D(e[2]*t[0])+D(e[3]*t[2])),D(D(e[2]*t[1])+D(e[3]*t[3])),D(D(D(e[4]*t[0])+D(e[5]*t[2]))+t[4]),D(D(D(e[4]*t[1])+D(e[5]*t[3]))+t[5])]}function dx(e){let t=D(D(e[0]*e[3])-D(e[1]*e[2]));if(t===0)return null;let n=D(1/t),r=[D(e[3]*n),D(-e[1]*n),D(-e[2]*n),D(e[0]*n),D(D(D(e[5]*e[2])-D(e[4]*e[3]))*n),D(D(D(e[4]*e[1])-D(e[5]*e[0]))*n)];return r.every(Number.isFinite)?r:null}function px(e){let t=Math.fround(e.x),n=Math.fround(e.y),r=Math.fround(e.w),o=Math.fround(e.h),i=[t,n],s=[D(t+r),n],a=[t,D(n+o)],u=D(D(D(D(r+t)*D(n+o))-D(n*t))+D(D(-o*t)-D(n*r)));if(Math.abs(u)<11920929e-14)return [1,0,0,1,0,0];let l=D(1/u),c=D(D(D(t+r)*D(n+o))-D(t*n)),f=D(-t*o),m=D(-n*r);return [D(D(D(o*s[0])+D(-o*i[0]))*l),D(D(D(o*s[1])+D(-o*i[1]))*l),D(D(D(r*a[0])+D(-r*i[0]))*l),D(D(D(r*a[1])+D(-r*i[1]))*l),D(D(D(D(f*s[0])+D(c*i[0]))+D(m*a[0]))*l),D(D(D(D(f*s[1])+D(c*i[1]))+D(m*a[1]))*l)]}function xx(e,t,n,r){let o=Math.fround(e.x),i=Math.fround(e.y),s=Math.fround(e.w),a=Math.fround(e.h),u=r*as,l=D(o+s),c=D(i+a),f=D(D(l-o)/u),m=D(D(c-i)/u),b=[f,0,0,m,D(l-D(f*u)),D(c-D(m*u))],h=Rf(t.map(d=>Math.fround(d)),n.map(d=>Math.fround(d)));return dx(Rf(b,h))}function Af(e,t,n,r=false,o={x:0,y:0}){let i=e.rect,s=hu(e);if(!i||!s||!(Math.abs(i.w)>1e-9))return null;let a=bu(s,i),u=a.intervals,l=xx(i,e.transform??px(i),t,u);if(!l)return null;let c=n?.5:0,f=Math.floor(D(l[0]+.5)),m=Math.floor(D(l[2]+.5)),b=Math.floor(D(l[4]+(l[0]+l[2])*c+.5))-o.x*f-o.y*m,h=(d,p,x,y,g)=>{for(let M=0;M<y;M++){let E=b+d*f+(p+M)*m;for(let P=0;P<x;P++,E+=f)bx(a,Pf(E,u,e.wrapMode),g,(M*x+P)*4,r);}};return r&&(h.premultiplied=(d,p,x,y,g)=>{for(let M=0;M<y;M++){let E=b+d*f+(p+M)*m;for(let P=0;P<x;P++,E+=f)hx(a,Pf(E,u,e.wrapMode),g,(M*x+P)*4);}}),h}var Uo=[1,0,0,1,0,0];function je(e,t){return [e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function vf(e){let t=e[0]*e[3]-e[1]*e[2];return !Number.isFinite(t)||Math.abs(t)<1e-12?null:[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t]}function Lo(e,t,n){let r=o=>{let i=e>>>o&255,s=t>>>o&255;return Math.round(i+(s-i)*n)};return (r(24)<<24|r(16)<<16|r(8)<<8|r(0))>>>0}function yx(e,t,n){let r=e>>>24&255,o=t>>>24&255;if(r===o)return Lo(e,t,n);let i=Math.round(r+(o-r)*n);if(i===0)return 0;let s=a=>{let u=(e>>>a&255)*r/255,l=(t>>>a&255)*o/255;return Math.min(255,Math.max(0,Math.round((u+(l-u)*n)*255/i)))};return (i<<24|s(16)<<16|s(8)<<8|s(0))>>>0}function Cf(e,t=Uo){return mu(e,t)}function gx(e,t,n){let r=Math.min(e.length,t.length);if(r===0)return n;if(n<=e[0])return t[0];for(let o=1;o<r;o++)if(n<=e[o]){let i=e[o]-e[o-1],s=i>0?(n-e[o-1])/i:1;return t[o-1]+(t[o]-t[o-1])*s}return t[r-1]}function If(e,t){if(e.length===0||e.some(n=>n.argb===void 0))return null;if(t<=e[0].offset)return e[0].argb;for(let n=1;n<e.length;n++){let r=e[n];if(t<=r.offset){let o=e[n-1],i=r.offset-o.offset;return Lo(o.argb,r.argb,i>0?(t-o.offset)/i:1)}}return e[e.length-1].argb}function us(e,t,n,r,o){let{center:i,boundary:s,boundaryArgb:a}=e,u=s.length,l=t-i.x,c=n-i.y,f=(r?.x??t)-i.x,m=(r?.y??n)-i.y,b=-1,h=0,d=0,p=1e-9;for(let T=0;T<u;T++){let w=s[T],A=s[(T+1)%u],I=w.x-i.x,S=w.y-i.y,v=A.x-w.x,C=A.y-w.y,U=I*C-S*v;if(Math.abs(U)<1e-12)continue;let L=(l*C-c*v)/U,k=(I*c-S*l)/U;if(L<-p||k<-p||k>L+p||L>1+p)continue;b=T;let F=(f*C-m*v)/U,_=(I*m-S*f)/U;h=Math.max(0,F),d=F>0?Math.min(1,Math.max(0,_/F)):0;}let x=b<0?1/0:h;if(e.focus){let T=Math.min(1,Math.max(0,e.focus.x)),w=Math.min(1,Math.max(0,e.focus.y));if(T===w)x=x<=T?0:(x-T)/(1-T);else if(x>0){let A=1-T,I=1-w,S=1/0,v=false;for(let C=0;C<u;C++){let U=s[C],L=s[(C+1)%u],k=U.x-i.x,F=U.y-i.y,_=L.x-U.x,H=L.y-U.y,G=k*H-F*_;if(Math.abs(G)<1e-12)continue;if(T===0&&w>0&&Math.abs((r?.x??t)-i.x)<p&&_>0&&Math.max(k,k+_)>0&&Math.abs(H)>p){let X=(((r?.y??n)-i.y)/w-F)/H;X>=-p&&X<=1+p&&(v=true);}if((T>0||Math.abs(l)<p)&&(w>0||Math.abs(c)<p)){let X=T>0?l/T:0,B=w>0?c/w:0,O=(X*H-B*_)/G,j=(k*B-F*X)/G;O>=-p&&O<=1+p&&j>=-p&&j<=O+p&&(v=true,b<0&&(b=C));}let W=G*A*I,N=G*(T*I+w*A)-l*H*I+c*_*A,Z=G*T*w-l*H*w+c*_*T,J=N*N-4*W*Z,K=Math.abs(W)<1e-12?Math.abs(N)>1e-12?[-Z/N]:[]:J>=0?[(-N-Math.sqrt(J))/(2*W),(-N+Math.sqrt(J))/(2*W)]:[],ie=0,ce=0,$=0;for(let X of K){if(X<-p||X>1+p)continue;let B=T+A*X,O=w+I*X;if(O===0&&B>0&&Math.abs(c)<p&&H>0&&Math.max(F,F+H)>0&&Math.abs(_)>p){let q=(l/B-k)/_;if(q>=-p&&q<=1+p){ie=1,ce=0,$=Math.min(1,Math.max(0,q));break}}if(B<=0||O<=0)continue;let j=Math.abs(_)>Math.abs(H)?(l/B-k)/_:(c/O-F)/H;j>=-p&&j<=1+p&&(ie++,ce=Math.max(0,X),$=Math.min(1,Math.max(0,j)));}ie===1&&(S=ce,b=C,d=$);}x=v?0:Number.isFinite(S)?S:x;}}if(b<0||!Number.isFinite(x))return null;o&&(o.s=x);let y=1-x;if(e.preset&&e.preset.positions.length>0){let{positions:T,argb:w}=e.preset;if(y<=T[0])return w[0];for(let A=1;A<T.length;A++)if(y<=T[A]){let I=T[A]-T[A-1];return Lo(w[A-1],w[A],I>0?(y-T[A-1])/I:1)}return w[T.length-1]}let g=a[b]??e.centerArgb,M=a[(b+1)%u]??g,E=Lo(g,M,d),P=e.blend?gx(e.blend.positions,e.blend.factors,y):y,R=Math.min(1,Math.max(0,P));return E>>>24!==e.centerArgb>>>24&&a.every(T=>T===a[0])?yx(E,e.centerArgb,R):Lo(E,e.centerArgb,R)}var Mx=2048;function Df(e){return {x:e==="tile-flip-x"||e==="tile-flip-xy",y:e==="tile-flip-y"||e==="tile-flip-xy"}}function ls(e,t,n,r,o,i,s,a,u){if(typeof e.createPattern!="function")return null;let l=o==="clamp"?{x:false,y:false}:Df(o),c=n*(l.x?2:1),f=r*(l.y?2:1),m=chunkI7XOR2GO_js.Z(c,f);if(!m)return null;let b=t.w/n,h=t.h/r,d=E=>{let P=E%n*b+(.5+a.phaseX)*b;return E<n?P:t.w-a.lagX-(P-(.5+a.phaseX)*b)-.5*b},p=E=>{let P=(E%r+.5)*h;return E<r?P:t.h-a.lagY-P},x=new Uint8ClampedArray(c*f*4);for(let E=0;E<f;E++){let P=t.y+p(E);for(let R=0;R<c;R++){let T=u(t.x+d(R),P);if(T===null)continue;let w=(E*c+R)*4;x[w]=T>>>16&255,x[w+1]=T>>>8&255,x[w+2]=T&255,x[w+3]=T>>>24&255;}}chunkI7XOR2GO_js.ma(m.ctx,chunkI7XOR2GO_js.oa(x,c,f),0,0);let y=chunkI7XOR2GO_js.na(e,m.canvas,o==="clamp"?"no-repeat":"repeat");if(!y||typeof y.setTransform!="function")return null;let g=[b,0,0,h,t.x+a.phaseX*b,t.y],M=je([1,0,0,1,s.x,s.y],je(i,g));try{y.setTransform({a:M[0],b:M[1],c:M[2],d:M[3],e:M[4],f:M[5]});}catch{return chunkI7XOR2GO_js.q("buildPattern: pattern.setTransform rejected"),null}return y}function Fo(e){let t=vf(e);return t?{x:t[0]*.5+t[2]*.5,y:t[1]*.5+t[3]*.5}:{x:0,y:0}}var Ex=4;function pu(e,t,n){let r=t==="x"?Math.hypot(e[0],e[1]):Math.hypot(e[2],e[3]);return Math.max(2,Math.min(Mx,Math.ceil(Math.abs(n)*r*Ex)))}function Lf(e,t){let n=t??Uo,r=(c,f)=>({x:n[0]*c+n[2]*f+n[4],y:n[1]*c+n[3]*f+n[5]}),o=r(e.x,e.y+e.h/2),i=r(e.x+e.w,e.y+e.h/2),s=n[3],a=-n[2],u=s*s+a*a;if(u<1e-12)return {x1:o.x,y1:o.y,x2:i.x,y2:i.y};let l=((i.x-o.x)*s+(i.y-o.y)*a)/u;return {x1:o.x,y1:o.y,x2:o.x+s*l,y2:o.y+a*l}}function Px(e,t){if(typeof e.createLinearGradient!="function")return null;let n=t.rect?Lf(t.rect,t.transform):t;if(n.x1===n.x2&&n.y1===n.y2)return null;let r=e.createLinearGradient(n.x1,n.y1,n.x2,n.y2);for(let o of t.stops)r.addColorStop(o.offset,o.color);return r}var Sf=1e-5,Rx=2048;function Tx(e){let t=e.canvas,n=t?.width,r=t?.height;return typeof n=="number"&&typeof r=="number"&&n>0&&r>0?{w:n,h:r}:null}function wx(e,t,n,r){let o=Tx(e),i=vf(r);if(!o||!i||typeof e.createLinearGradient!="function")return null;let s=Lf(n,t.transform),a=Fo(r),u=s.x2-s.x1,l=s.y2-s.y1,c=s.x1+a.x+u*Sf,f=s.y1+a.y+l*Sf,m=u*u+l*l;if(!(m>1e-12))return null;let b=1/0,h=-1/0;for(let[E,P]of [[0,0],[o.w,0],[0,o.h],[o.w,o.h]]){let R=E-r[4],T=P-r[5],w=i[0]*R+i[2]*T,A=i[1]*R+i[3]*T,I=((w-c)*u+(A-f)*l)/m;b=Math.min(b,I),h=Math.max(h,I);}let d=Math.floor(b),p=Math.max(d+1,Math.ceil(h));if(p-d>Rx)return null;let x=e.createLinearGradient(c+u*d,f+l*d,c+u*p,f+l*p),y=p-d,g=Df(t.wrapMode).x,M=[...t.stops].reverse();for(let E=d;E<p;E++){let P=g&&(E%2+2)%2===1;for(let R of P?M:t.stops){let T=P?1-R.offset:R.offset;x.addColorStop(Math.min(1,Math.max(0,(E-d+T)/y)),R.color);}}return x}function Ax(e){let t=e.rect?hu(e):null;return t&&e.rect?wf(bu(t,e.rect)):e.stops}function Ix(e,t,n){let r={...t,stops:Ax(t)},o=r.rect;if(r.wrapMode!=="clamp"&&o&&o.w!==0){let i=wx(e,r,o,n);if(i)return i;if(If(r.stops,0)!==null){let s=r.transform??Uo,a=pu(je(n,s),"x",o.w),u=ls(e,o,a,1,r.wrapMode,s,Fo(n),{phaseX:.5,lagX:0,lagY:0},l=>If(r.stops,(l-o.x)/o.w));if(u)return u}chunkI7XOR2GO_js.q("createBrushGradient: linear gradient could not be tiled");}return Px(e,r)}function Sx(e){if(e.length<3)return null;let t=1/0,n=1/0,r=-1/0,o=-1/0;for(let i of e)t=Math.min(t,i.x),n=Math.min(n,i.y),r=Math.max(r,i.x),o=Math.max(o,i.y);return r>t&&o>n?{x:t,y:n,w:r-t,h:o-n}:null}function vx(e,t,n,r){let o=Sx(t.boundary);if(!o)return null;let i=t.transform??Uo,s=je(r,i),a=Math.hypot(s[0],s[1]),u=Math.hypot(s[2],s[3]);return ls(e,o,pu(s,"x",o.w),pu(s,"y",o.h),n,i,Fo(r),{phaseX:0,lagX:a>0?1/a:0,lagY:u>0?1/u:0},(l,c)=>us(t,l,c))}function Cx(e,t){if(!(t.r>0)||typeof e.createRadialGradient!="function")return null;let n=e.createRadialGradient(t.cx,t.cy,0,t.cx,t.cy,t.r);for(let r of t.stops)n.addColorStop(r.offset,r.color);return n}function Uf(e,t,n=Uo){try{if(t.type==="linear")return Ix(e,t,n);if(t.shape){let r=vx(e,t.shape,t.wrapMode,n);if(r)return r;chunkI7XOR2GO_js.q("createBrushGradient: path gradient pattern unavailable, using the radial approximation");}return Cx(e,t)}catch{return null}}var cs,ms,fs,bs,Dx={johab:async()=>{cs??(cs=(await import('./browser-chunks/emf-ansi-johab-KHT3RJ3R.js')).JOHAB_ROWS);},illuminants:async()=>{ms??(ms=(await import('./browser-chunks/emf-gdi-illuminant-data-YYCDAVZT.js')).ILLUMINANT_CUBE_DATA);},chromaTies:async()=>{fs??(fs=(await import('./browser-chunks/emf-gdi-chroma-tie-data-YFCUXKFP.js')).CHROMA_TIE_FLIPS);},colorCurve:async()=>{bs??(bs=(await import('./browser-chunks/emf-plus-image-curves-OLOBXBF7.js')).nativeCurveLookup);}};async function xu(e){await Promise.all(Array.from(e,t=>Dx[t]()));}function Ff(e){if(!(e<128)){if(!cs)throw new Error("Johab replay data was not loaded");return cs[e]}}function kf(e){if(!(e===0||e===6)){if(!ms)throw new Error("GDI color replay data was not loaded");return ms[e]}}function _f(e){if(!fs)throw new Error("GDI color replay data was not loaded");return fs[e]}function Bf(e,t){if(!bs)throw new Error("GDI+ color curve replay data was not loaded");return bs(e,t)}var Lx={"633C80A4-1843-482B-9EF2-BE2834C5FDD4":"blur","D3A1DBE1-8EC4-4C17-9F4C-EA97AD1C343D":"brightnessContrast","537E597D-251E-48DA-9664-29CA496B70F8":"colorBalance","DD6A0022-58E4-4A67-9D9B-D48EB881A53D":"colorCurve","A7CE72A9-0F7F-40D7-B3CC-D0C02D5C3212":"colorLookupTable","718F2615-7933-40E3-A511-5F68FE14DD74":"colorMatrix","8B2DD6C3-EB07-4D87-A5F0-7108E26A9C5F":"hueSaturationLightness","99C354EC-2A31-4F3A-8C34-17A803B33A25":"levels","74D29D05-69A4-4266-9549-3CC52836B632":"redEyeCorrection","63CBF3EE-C526-402C-8F71-62C540BF5142":"sharpen","1077AF00-2848-4441-9489-44AD4C2D7A2C":"tint"},Wf=8192;var Wr={All:0,Red:1,Green:2,Blue:3},hs=(e,t)=>e.toString(16).toUpperCase().padStart(t,"0");function Ux(e,t){let n=[];for(let r=0;r<8;r++)n.push(hs(e.getUint8(t+8+r),2));return [hs(e.getUint32(t,true),8),hs(e.getUint16(t+4,true),4),hs(e.getUint16(t+6,true),4),n.slice(0,2).join(""),n.slice(2).join("")].join("-")}var Ne=(e,t,n)=>e<t?t:e>n?n:e,Fx=12;function ys(e,t,n){if(n<20||t<0||t+n>e.byteLength)return null;let r=Lx[Ux(e,t)],o=e.getUint32(t+16,true);if(!r||20+o>n)return null;let i=t+20,s=(l,c,f)=>Ne(e.getInt32(i+4*l,true),c,f),a=(l,c,f)=>{let m=e.getFloat32(i+4*l,true);return Number.isFinite(m)?Ne(m,c,f):0},u=l=>o>=l;switch(r){case "blur":return u(8)?{kind:r,radius:a(0,0,255),expandEdge:e.getUint32(i+4,true)!==0}:null;case "brightnessContrast":return u(8)?{kind:r,brightness:s(0,-255,255),contrast:s(1,-100,100)}:null;case "colorBalance":return u(12)?{kind:r,cyanRed:s(0,-100,100),magentaGreen:s(1,-100,100),yellowBlue:s(2,-100,100)}:null;case "colorCurve":{if(!u(Fx))return null;let l=e.getInt32(i,true),c=e.getInt32(i+4,true),f=e.getInt32(i+8,true),m=l<2?-255:l<6?-100:l===6?1:0,b=l===7?254:l<2||l===6?255:100;return l<0||l>7||c<0||c>3||f<m||f>b?null:{kind:r,adjustment:l,channel:c,intensity:f}}case "colorLookupTable":{if(!u(1024))return null;let l=c=>new Uint8Array(e.buffer.slice(e.byteOffset+i+256*c,e.byteOffset+i+256*(c+1)));return {kind:r,b:l(0),g:l(1),r:l(2),a:l(3)}}case "colorMatrix":{if(!u(100))return null;let l=[];for(let c=0;c<25;c++){let f=e.getFloat32(i+4*c,true);if(!Number.isFinite(f))return null;l.push(f);}return {kind:r,matrix:l}}case "hueSaturationLightness":return u(12)?{kind:r,hue:s(0,-180,180),saturation:s(1,-100,100),lightness:s(2,-100,100)}:null;case "levels":return u(12)?{kind:r,highlight:s(0,0,100),midtone:s(1,-100,100),shadow:s(2,0,100)}:null;case "redEyeCorrection":{if(!u(4))return null;let l=e.getInt32(i,true);if(l<0||4+16*l>o)return null;let c=[];for(let f=0;f<l;f++){let m=i+4+16*f;c.push({left:e.getInt32(m,true),top:e.getInt32(m+4,true),right:e.getInt32(m+8,true),bottom:e.getInt32(m+12,true)});}return {kind:r,areas:c}}case "sharpen":return u(8)?{kind:r,radius:a(0,0,255),amount:a(1,0,100)}:null;case "tint":return u(8)?{kind:r,hue:s(0,-180,180),amount:s(1,-100,100)}:null}}var Hf=e=>Math.ceil(e-.5);function Eu(e,t=Math.round){let n=new Uint8Array(256);for(let r=0;r<256;r++)n[r]=Ne(t(e(r)),0,255);return n}function Gf(e){let t=1,n=0,r=50;for(;Math.abs(e)>=r&&r<100;)t++,n=r,r=(r+100)/2;return t=Math.abs(e)===100?10:Math.min(10,ne(t+ne(ne(Math.abs(e)-n)/ne(r-n)))),e<0?ne(t):ne(1/ne(t))}function kx(e,t){let n=t>=100?1e6:t>=0?100/(100-t):(100+t)/100,r=e/2;return Eu(o=>(o+r-127.5)*n+127.5+r)}function yu(e){return Eu(t=>t*(Math.floor((1+e/100)*65536)/65536))}function _x(e,t){if(!Number.isInteger(e)||e<0||e>7)return null;let n=e<2?-255:e<6?-100:e===6?1:0,r=e===7?254:e<2||e===6?255:100;return Bf(e,Ne(Math.trunc(t),n,r)).slice()}function Bx(e,t,n){if(e!==n){let s=e>n,a=ne((s?n:e)*255/100),u=ne((s?e:n)*255/100),l=ne(1/ne(u-a)),c=Gf(t),f=new Uint8Array(256);for(let m=0;m<256;m++){let b=Ne(ne(ne(m-a)*l),0,1);t!==0&&(b=ne(b**c));let h=s?ne(255*b):ne(255-ne(255*b));f[m]=Ne(Math.floor(h+.5),0,255);}return f}let r=n*255/100-(e===n&&n<50?1:0),o=e===n?1:(e-n)*255/100,i=Gf(t);return Eu(s=>{let a=Ne((s-r)/o,0,1);return 255*(e>=n?a**i:1-(1-a)**i)},Hf)}function ko(e,t,n,r,o=null){let i=new Uint8ClampedArray(e);for(let s=0;s<i.length;s+=4)t&&(i[s]=t[e[s]]),n&&(i[s+1]=n[e[s+1]]),r&&(i[s+2]=r[e[s+2]]),o&&(i[s+3]=o[e[s+3]]);return i}function Gx(e,t){let n=new Uint8ClampedArray(e.length);for(let r=0;r<e.length;r+=4){let o=e[r]/255,i=e[r+1]/255,s=e[r+2]/255,a=e[r+3]/255;for(let u=0;u<4;u++){let l=o*t[u]+i*t[5+u]+s*t[10+u]+a*t[15+u]+t[20+u];n[r+u]=Math.round(Ne(l,0,1)*255);}}return n}var Zt=43,ds=255;function Ox(e,t,n){let r=Math.max(e,t,n),o=r-Math.min(e,t,n),i=u=>Math.floor(u*Zt/o);if(r===e&&t>=n)return i(t-n);if(r===n&&n!==e)return e>=t?170+i(e-t):127+i(n-t);if(r===t)return n>=e?86+i(n-e):43+i(t-e);let s=i(n-t),a=(256-s-(s>=40?1:0))%256;return a-Math.floor((a+42)/86)}function Nx(e,t,n,r){let o=new Uint8ClampedArray(e),i=Math.round(t*ds/360),s=65536+Math.floor(n*65536/100),a=Math.round(255*Math.floor(r*65536/100)/65536);for(let u=0;u<e.length;u+=4){let l=e[u],c=e[u+1],f=e[u+2],m=Math.max(l,c,f),b=Math.min(l,c,f),h=Ne((m+b>>1)+a,0,255);if(m===b){o[u]=o[u+1]=o[u+2]=h;continue}let d=m+b,p=Ne(Math.round(Math.floor((m-b)*255/(d<=255?d:510-d))*s/65536),0,255),x=h<=127?Math.floor(h*(255+p)/255):h+p-Math.floor(h*p/255),y=2*h-x,g=x,M=((Ox(l,c,f)+i)%ds+ds)%ds,E=M+Math.floor((M+41)/85),P=Math.min(5,Math.floor(E/Zt)),R=E-P*Zt,T=y+Math.floor((g-y)*R/Zt),w=y+Math.floor((g-y)*(Zt-R)/Zt),[A,I,S]=[[g,T,y],[w,g,y],[y,g,T],[y,w,g],[T,y,g],[g,y,w]][P];o[u]=A,o[u+1]=I,o[u+2]=S;}return o}function Wx(e,t,n){let r=(Math.round(t*255/360)+256)%256,o=(r+Math.floor((r+41)/85))%258,i=Math.min(5,Math.floor(o/Zt)),s=o-i*Zt,a=Math.floor($n*s/Zt),u=Math.floor($n*(Zt-s)/Zt),[l,c,f]=[[$n,a,0],[u,$n,0],[0,$n,a],[0,u,$n],[a,0,$n],[$n,0,u]][i],m=Math.sign(n)*Math.floor((255*Math.abs(n)+49)/100),b=255-m,h=new Uint8ClampedArray(e);for(let d=0;d<e.length;d+=4){let p=e[d],x=e[d+1],y=e[d+2],g=m*Math.max(p,x,y)>>8,M=b*p+l*g,E=b*x+c*g,P=b*y+f*g,R=54*p+183*x+19*y-(54*(M>>8)+183*(E>>8)+19*(P>>8));h[d]=R+M>>8,h[d+1]=R+E>>8,h[d+2]=R+P>>8;}return h}var $n=254;function Hx(e,t,n,r){let o=new Uint8ClampedArray(e),i={x:0,y:0,set:false};for(let s of r)Zx(o,t,Ne(s.left,0,t),Ne(s.top,0,n),Ne(s.right,0,t),Ne(s.bottom,0,n),i);return o}var ps=60,$x=15,Xx=2/9,jx=1;function Yx(e,t){return Math.floor((9*e+2*t+5)/11)}var gu=5/16,Of=[25,40,80],Vx=[.25,.5,.66,.75],zx=40,qx=.33,Jx=5;function Kx(e,t,n){let r=0,o=0,i=0;for(let s=0;s<n;s++)for(let a=0;a<t;a++){let u=255-e[s*t+a];r=ne(r+ne(u*a)),o=ne(o+ne(u*s)),i=ne(i+u);}return {cx:ne(ne(r/i)+.5),cy:ne(ne(o/i)+.5)}}function Zx(e,t,n,r,o,i,s){let a=o-n,u=i-r,l=a*u;if(!(l>0))return;let c=new Float64Array(l),f=new Float64Array(l),m=new Int32Array(l),b=0,h=0,d=0;for(let J=0;J<u;J++)for(let K=0;K<a;K++){let ie=((r+J)*t+n+K)*4,ce=e[ie],$=e[ie+1],X=e[ie+2],B=J*a+K;f[B]=$+Xx*X;let O=Yx($,X);m[B]=O;let j=ce-Math.max($,X);if(j>0){c[B]=j;let q=ne(O>=1?j/O:jx);b=ne(b+ne(q*K)),h=ne(h+ne(q*J)),d=ne(d+q);}}if(d===0)return;s.set&&(b=ne(b+ne(s.x-.5)),h=ne(h+ne(s.y-.5)));let p=ne(ne(b/d)+.5),x=ne(ne(h/d)+.5);s.x=n+p,s.y=r+x,s.set=true;let y=false;Math.hypot(p-a/2,x-u/2)>=(a+u)/6&&(y=true,{cx:p,cy:x}=Kx(m,a,u));let g=n+p,M=r+x,E=Math.round(p)>a/2?a-p+.5:p-.5,P=Math.round(x)>u/2?u-x+.5:x-.5,R=g>M?Math.min(E,M-.5):Math.min(P,g-.5);if(!(R>0))return;let T=Int32Array.from(m).sort(),w=T[Math.floor(.7*l)],A=w-T[Math.floor(.3*l)],I=T[l-1],S=l>1?T[l-2]:-1,v=-1;I>S&&I-w>=zx&&(v=m.indexOf(I));let C=0;for(;C<Of.length&&A>Of[C];)C++;let U=Vx[C],L=new Uint8Array(l),k=new Float64Array(l),F=new Float64Array(ps),_=new Float64Array(ps),H=new Float64Array(ps),G=180/Math.PI,W=ne(R*R);for(let J=0;J<u;J++)for(let K=0;K<a;K++){let ie=K+.5-p,ce=J+.5-x,$=J*a+K,X=ne(ne(ie*ie)+ne(ce*ce));k[$]=ne(Math.sqrt(X));let B=Math.atan2(ce,ie)*G;B<0&&(B+=360);let O=ie===0&&ce===0?$x:ce===0?0:Math.min(ps-1,Math.floor(B/6));L[$]=O,X<W&&(F[O]+=c[$],_[O]+=f[$],H[O]++);}v>=0&&!(k[v]<R)&&(v=-1);let N=ne,Z=N(U);for(let J=0;J<u;J++)for(let K=0;K<a;K++){let ie=J*a+K,ce=c[ie];if(ce<=0||k[ie]>=R)continue;let $=L[ie],X=N(F[$]/H[$]),B=N(_[$]/H[$]),O=B>0?N(f[ie]/B):1,j=N(1-N(k[ie]/R)),q=O<2?N(.5*N(N(1-O)*N(1-O))):0,ae=Math.max(N(Z*N(j*j)),q,y?N(qx*j):0),se=N(N(1-ae)*X);if(v>=0){let ee=K-v%a,le=J-Math.floor(v/a);se=Math.min(se,Jx*(ee*ee+le*le));}if(se>=ce)continue;let de=ce-se,me=((r+J)*t+n+K)*4;e[me]=Math.round(e[me]-(1-gu)*de),e[me+1]=Math.round(e[me+1]+gu*de),e[me+2]=Math.round(e[me+2]+gu*de);}}function $f(e){let t=Math.ceil(e),n=new Float64Array(2*t+1);if(t===0)return n[0]=1,n;let r=ne(ne(1.4)/Math.fround(e)),o=new Float64Array(t+1);o[0]=1;let i=0,s=1;for(let u=1;u<=t;u++)i=ne(i+r),o[u]=ne(Math.exp(-ne(i*i))),s=ne(s+ne(2*o[u]));let a=ne(256/s);for(let u=0;u<=t;u++){let l=ne(o[u]*a)/256;n[t+u]=l,n[t-u]=l;}return n}function Mu(e,t){if(t===1)return 0;for(;e<0||e>=t;)e=e<0?-e:2*(t-1)-e;return e}function Xf(e,t,n,r,o=0,i=false,s=Math.ceil(n/t)){let a=$f(r),u=(a.length-1)/2,l=(u|1)>=t?m=>Math.max(0,Math.min(t-1,m)):m=>Mu(m,t),c=(u|1)>=n?m=>Math.max(0,Math.min(n-1,m)):m=>Mu(m,n),f=new Float64Array(t*n*4);for(let m=0;m<n;m++){let b=m*t*4;for(let h=0;h<t;h++){let d=0,p=0,x=0,y=0;for(let M=-u;M<=u;M++){let E=b+l(h+M)*4,P=M===0?a[u]*128:a[M+u]*256,R=M===0?2:1;d+=R*Math.round(P*e[E]),p+=R*Math.round(P*e[E+1]),x+=R*Math.round(P*e[E+2]),y+=R*Math.round(P*e[E+3]);}let g=b+h*4;f[g]=Math.floor((d+128)/256),f[g+1]=Math.floor((p+128)/256),f[g+2]=Math.floor((x+128)/256),f[g+3]=Math.floor((y+128)/256);}}if(u>0&&o>=0&&o<n){let m=f.slice(),b=Math.min(n,o+s);for(let h=o;h<b;h++){let d=new Float64Array(t*4);for(let p=-u;p<=u;p++){let x=h+p;if(i&&x<o)continue;let y=c(x)*t*4,g=p===0?a[u]*128:a[p+u]*256,M=p===0?2:1;for(let E=0;E<t*4;E++)d[E]+=M*Math.round(g*m[y+E])/256;}f.set(d,h*t*4);}}return f}function jf(e){return e<20?1:e<40?2:e<=80?4:e<160?8:16}function Nf(e,t,n,r,o,i,s,a={start:0,size:e,pad:0}){let u=Math.ceil(a.size/n),l=u+2*a.pad,c=(r.length-1)/2,f=(c|1)>=o?p=>Ne(p,0,l-1):p=>Mu(p,l),m=new Float64Array(l),b=new Float64Array(l),h=r.map(p=>p*256),d=h[c]/2;h[c]=0;for(let p=0;p<t;p++)for(let x=0;x<4;x++){for(let M=a.pad;M<a.pad+u;M++){let E=a.start+(M-a.pad)*n,P=Math.min(a.start+a.size,E+n),R=0;for(let T=E;T<P;T++)R+=i(T,p,x);m[M]=Math.floor(R/(P-E));}for(let M=0;M<l;M++){let E=0;if(M>=c&&M+c<l)for(let P=0;P<h.length;P++)E+=Math.round(h[P]*m[M-c+P]);else for(let P=0;P<h.length;P++){let R=M-c+P;E+=Math.round(h[P]*(a.zeroOutside&&(R<0||R>=l)?0:m[f(R)]));}E+=2*Math.round(d*m[M]),b[M]=Math.floor((E+128)/256);}let y=u===1&&a.pad>0,g=u===1&&a.size-Math.ceil(n/2)===1?a.start+a.size-1:-1;for(let M=0;M<e;M++){if(M===g){a.pad>0&&s(M,p,x,0);continue}let E=(M-a.start+.5)/n-.5;if(y){let T=Math.abs(M-a.start-(Math.min(a.size,n/2)-.5))/n;s(M,p,x,Ne(Math.floor((1+T)*b[a.pad]+1e-9),0,255));continue}let P=Ne(Math.floor(E),0,Math.max(0,u-2)),R=E-P;s(M,p,x,Ne(Math.floor((1-R)*b[a.pad+P]+R*b[a.pad+Math.min(u-1,P+1)]+1e-9),0,255));}}}function Pu(e,t,n,r,o,i=false){let s=jf(r);if(s===1)return Xf(e,t,n,r);let a=$f(r/s),u=o?Math.ceil(Math.ceil(r)/s):0,l=o?{start:o.x,size:o.w,pad:u,zeroOutside:true}:i?{start:0,size:t,pad:0,zeroOutside:true}:void 0,c=o?{start:o.y,size:o.h,pad:u,zeroOutside:true}:i?{start:0,size:n,pad:0,zeroOutside:true}:void 0,f=new Uint8Array(e);Nf(t,n,s,a,Math.ceil(t/s),(b,h,d)=>e[(h*t+b)*4+d],(b,h,d,p)=>{f[(h*t+b)*4+d]=p;},l);let m=Float64Array.from(f);return Nf(n,t,s,a,Math.ceil(n/s),(b,h,d)=>f[(b*t+h)*4+d],(b,h,d,p)=>{m[(b*t+h)*4+d]=p;},c),m}function Qx(e,t,n,r){return Uint8ClampedArray.from(Pu(e,t,n,r),Math.round)}function ey(e,t){return Hf(64*t/(250-2*t))/64}function ty(e,t,n,r,o){let i=Pu(e,t,n,r),s=ey(r,o),a=new Uint8ClampedArray(e);for(let u=0;u<e.length;u+=4){for(let l=0;l<3;l++)a[u+l]=Math.round(e[u+l]+s*(e[u+l]-Math.round(i[u+l])));a[u+3]=Math.max(e[u+3],a[u],a[u+1],a[u+2]);}return a}function ny(e,t,n,r){if(t<=0||n<=0||e.length!==t*n*4)return null;switch(r.kind){case "blur":return Qx(e,t,n,r.radius);case "sharpen":return ty(e,t,n,r.radius,r.amount);case "brightnessContrast":{let o=kx(r.brightness,r.contrast);return ko(e,o,o,o)}case "colorBalance":return ko(e,yu(r.cyanRed),yu(r.magentaGreen),yu(r.yellowBlue));case "colorCurve":{let o=_x(r.adjustment,r.intensity),i=r.channel;if(!o||i<Wr.All||i>Wr.Blue)return null;let s=a=>i===Wr.All||i===a?o:null;return ko(e,s(Wr.Red),s(Wr.Green),s(Wr.Blue))}case "colorLookupTable":return ko(e,r.r,r.g,r.b,r.a);case "colorMatrix":return Gx(e,r.matrix);case "hueSaturationLightness":return Nx(e,r.hue,r.saturation,r.lightness);case "levels":{let o=Bx(r.highlight,r.midtone,r.shadow);return ko(e,o,o,o)}case "redEyeCorrection":return Hx(e,t,n,r.areas);case "tint":return Wx(e,r.hue,r.amount)}}function xs(e,t,n,r,o,i,s,a,u,l){for(let c=0;c<i;c++){let f=((r+c)*t+n)*4;s.set(e.subarray(f,f+o*4),((l+c)*a+u)*4);}}function ry(e,t,n,r,o,i,s,a,u){let l=Math.ceil(r),c=s-o+2*l,f=a-i+2*l,m=new Uint8ClampedArray(c*f*4);if(u)xs(e,t,o,i,s-o,a-i,m,c,l,l);else {let x=Math.max(0,o-l),y=Math.max(0,i-l),g=Math.min(t,s+l),M=Math.min(n,a+l);xs(e,t,x,y,g-x,M-y,m,c,x-(o-l),y-(i-l));}let b=jf(r)>1?Pu(m,c,f,r,u?{x:l,y:l,w:s-o,h:a-i}:void 0,true):Xf(m,c,f,r,u?l:0,u,Math.ceil((a-i)/(s-o))),h=s-o,d=new Uint8ClampedArray(h*(a-i)*4),p=new Uint8ClampedArray((a-i)*4);for(let x=0;x<a-i;x++){let y=((x+l)*c+l)*4;for(let g=0;g<h*4;g++)d[x*h*4+g]=Math.round(b[y+g]);for(let g=0;g<4;g++)p[x*4+g]=Math.round(b[y+h*4+g]);}return {out:d,halo:p}}function Yf(e){let t=new Uint8ClampedArray(e);for(let n=0;n<t.length;n+=4){let r=t[n+3];if(r!==255)for(let o=0;o<3;o++)t[n+o]=r===0?0:Math.min(255,Math.floor(Math.round(t[n+o]*r/255)*255/r));}return t}function Vf(e,t,n,r,o){if(t<=0||n<=0||e.length!==t*n*4)return null;let i=0,s=0,a=t,u=n;if(o&&(i=Ne(Math.floor(o.x),0,t),s=Ne(Math.floor(o.y),0,n),a=Ne(Math.ceil(o.x+o.w)+1,0,t),u=Ne(Math.ceil(o.y+o.h)+1,0,n),a<=i||u<=s||o.x+o.w<=i||o.y+o.h<=s))return null;let l=a-i,c=u-s,f=o?Math.min(l,Math.ceil(o.x+o.w)-i):l,m=o?Math.min(c,Math.ceil(o.y+o.h)-s):c,b=x=>{if(f===l&&m===c)return {rgba:x,x:i,y:s,width:l,height:c};let y=new Uint8ClampedArray(f*m*4);return xs(x,l,0,0,f,m,y,f,0,0),{rgba:y,x:i,y:s,width:f,height:m}};if(o&&r.kind==="blur"&&r.expandEdge){let x=Math.ceil(o.x+o.w)<t&&Math.ceil(o.y+o.h)<n,{out:y,halo:g}=ry(e,t,n,r.radius,i,s,a,u,x),M=b(y);return f===l&&m===c&&(M.haloRight=g),M}let h=e;(l!==t||c!==n)&&(h=new Uint8ClampedArray(l*c*4),xs(e,t,i,s,l,c,h,l,0,0));let d=r.kind==="redEyeCorrection"?{kind:r.kind,areas:r.areas.map(x=>({left:x.left-i,top:x.top-s,right:x.right-i,bottom:x.bottom-s}))}:r,p=ny(h,l,c,d);return p?b(p):null}function zf(e,t,n,r,o,i){let s=Math.abs(o),a=o>0,l=n*4+3&-4,c=l*r,f=new Uint8Array(c);for(let m=0;m<r;m++){let b=a?m:r-1-m,h=t+b*s,d=(r-1-m)*l;switch(i){case 2498570:case 925707:{for(let p=0;p<n;p++){let x=h+p*4;if(x+3>=e.byteLength)break;let y=e.getUint8(x),g=e.getUint8(x+1),M=e.getUint8(x+2),E=e.getUint8(x+3);i===925707&&E>0&&E<255&&(M=Math.min(255,Math.round(M*255/E)),g=Math.min(255,Math.round(g*255/E)),y=Math.min(255,Math.round(y*255/E)));let P=d+p*4;f[P]=y,f[P+1]=g,f[P+2]=M,f[P+3]=E;}break}case 139273:{for(let p=0;p<n;p++){let x=h+p*4;if(x+3>=e.byteLength)break;let y=d+p*4;f[y]=e.getUint8(x),f[y+1]=e.getUint8(x+1),f[y+2]=e.getUint8(x+2),f[y+3]=255;}break}case 137224:{for(let p=0;p<n;p++){let x=h+p*3;if(x+2>=e.byteLength)break;let y=d+p*4;f[y]=e.getUint8(x),f[y+1]=e.getUint8(x+1),f[y+2]=e.getUint8(x+2),f[y+3]=255;}break}default:return null}}return oy(f,l,n,r,c)}function qf(e,t,n,r,o,i){let s=Math.abs(o),a=o>0,u=new Uint8ClampedArray(n*r*4);for(let l=0;l<r;l++){let c=a?l:r-1-l,f=t+c*s,m=l*n*4;switch(i){case 2498570:case 925707:{for(let b=0;b<n;b++){let h=f+b*4;if(h+3>=e.byteLength)break;let d=e.getUint8(h),p=e.getUint8(h+1),x=e.getUint8(h+2),y=e.getUint8(h+3);i===925707&&y>0&&y<255&&(x=Math.min(255,Math.round(x*255/y)),p=Math.min(255,Math.round(p*255/y)),d=Math.min(255,Math.round(d*255/y)));let g=m+b*4;u[g]=x,u[g+1]=p,u[g+2]=d,u[g+3]=y;}break}case 139273:{for(let b=0;b<n;b++){let h=f+b*4;if(h+3>=e.byteLength)break;let d=m+b*4;u[d]=e.getUint8(h+2),u[d+1]=e.getUint8(h+1),u[d+2]=e.getUint8(h),u[d+3]=255;}break}case 137224:{for(let b=0;b<n;b++){let h=f+b*3;if(h+2>=e.byteLength)break;let d=m+b*4;u[d]=e.getUint8(h+2),u[d+1]=e.getUint8(h+1),u[d+2]=e.getUint8(h),u[d+3]=255;}break}default:return null}}return u}function oy(e,t,n,r,o){let a=122+o,u=new ArrayBuffer(a),l=new DataView(u),c=new Uint8Array(u);return l.setUint8(0,66),l.setUint8(1,77),l.setUint32(2,a,true),l.setUint32(6,0,true),l.setUint32(10,122,true),l.setUint32(14,108,true),l.setInt32(18,n,true),l.setInt32(22,r,true),l.setUint16(26,1,true),l.setUint16(28,32,true),l.setUint32(30,3,true),l.setUint32(34,o,true),l.setInt32(38,2835,true),l.setInt32(42,2835,true),l.setUint32(46,0,true),l.setUint32(50,0,true),l.setUint32(54,16711680,true),l.setUint32(58,65280,true),l.setUint32(62,255,true),l.setUint32(66,4278190080,true),l.setUint32(70,1934772034,true),c.set(e,122),u}var Jf=Math.fround;function Dt(e){return Math.floor(Jf(Jf(e)*256+.5))+15>>4}function jt(e,t,n,r){let o=1/0,i=1/0,s=-1/0,a=-1/0;for(let P=0;P<8;P+=2)o=Math.min(o,e[P]),s=Math.max(s,e[P]),i=Math.min(i,e[P+1]),a=Math.max(a,e[P+1]);let u=o-16,l=i-16,c=[e[0]-u,e[2]-u,e[4]-u,e[6]-u],f=[e[1]-l,e[3]-l,e[5]-l,e[7]-l],m=(P,R)=>Math.floor(P/2**R),b=[c[0]*1024,(c[3]-c[0])*1024,3*(c[1]-2*c[2]+c[3])*2048,3*(c[0]-2*c[1]+c[2])*2048],h=[f[0]*1024,(f[3]-f[0])*1024,3*(f[1]-2*f[2]+f[3])*2048,3*(f[0]-2*f[1]+f[2])*2048],d=1,p=0,y=(P,R)=>Math.abs(P)>Math.abs(R)?Math.abs(P):Math.abs(R);for(let P=0;P<40;P++){let R=24576*2**p;if(y(b[2],b[3])<=R&&y(h[2],h[3])<=R)break;p+=2;for(let T of [b,h])T[2]=m(T[2]+T[3],1),T[1]=m(T[1]-m(T[2],p),1);d*=2;}for(let P of [b,h]){P[0]*=8,P[1]*=8;let R=p-3;R>=0?(P[2]=m(P[2],R),P[3]=m(P[3],R)):(P[2]*=2**-R,P[3]*=2**-R);}let g=P=>{P[0]+=P[1];let R=P[2];P[1]+=R,P[2]=R+R-P[3],P[3]=R;},M=1/d,E=M;g(b),g(h),d--;for(let P=0;P<1<<22;P++){if(t.push(m(b[0]+4096,13)+u,m(h[0]+4096,13)+l),r?.push(E),d===0)return;if(Math.max(y(b[2],b[3]),y(h[2],h[3]))>196608){for(let R of [b,h])R[2]=m(R[2]+R[3],3),R[1]=m(R[1]-R[2],1),R[3]=m(R[3],2);d*=2,M/=2;}for(;d%2===0&&y(b[3],2*b[2]-b[3])<=49152&&y(h[3],2*h[2]-h[3])<=49152;){for(let R of [b,h])R[3]*=4,R[1]=R[2]+2*R[1],R[2]=R[2]*8-R[3];d/=2,M*=2;}d--,E+=M,g(b),g(h);}}function iy(e,t,n,r,o,i,s,a){let u=Math.hypot(e-2*n+o,t-2*r+i),l=Math.hypot(n-2*o+s,r-2*i+a),c=Math.ceil(Math.sqrt(.75*Math.max(u,l)/.05));return Math.min(4096,Math.max(1,c))}function Kf(e,t){if(!(e>.05))return 1;let n=2*Math.acos(1-.05/e),r=Math.ceil(Math.abs(t)/n);return Math.min(4096,Math.max(1,r))}function Zf(e,t){let n=e%t;return n<0?n+t:n}function Hr(e){let t=[],n=[],r=false,o=0,i=0,s=()=>{n.length>=6&&t.push(n),n=[];},a=(l,c)=>{s(),n=[l,c],r=true,o=l,i=c;},u=(l,c)=>{if(!r){a(l,c);return}n.push(l,c),o=l,i=c;};for(let l of e)switch(l.op){case "moveTo":a(l.x,l.y);break;case "lineTo":u(l.x,l.y);break;case "rect":a(l.x,l.y),u(l.x+l.w,l.y),u(l.x+l.w,l.y+l.h),u(l.x,l.y+l.h),a(l.x,l.y);break;case "closePath":if(r){let c=n[0],f=n[1];a(c,f);}break;case "bezierCurveTo":{r||a(l.cp1x,l.cp1y);let c=o,f=i,m=iy(c,f,l.cp1x,l.cp1y,l.cp2x,l.cp2y,l.x,l.y);for(let b=1;b<m;b++){let h=b/m,d=1-h,p=d*d*d,x=3*d*d*h,y=3*d*h*h,g=h*h*h;u(p*c+x*l.cp1x+y*l.cp2x+g*l.x,p*f+x*l.cp1y+y*l.cp2y+g*l.y);}u(l.x,l.y);break}case "arcTo":{if(!r){a(l.x1,l.y1);break}let c=o,f=i,m=c-l.x1,b=f-l.y1,h=l.x2-l.x1,d=l.y2-l.y1,p=Math.hypot(m,b),x=Math.hypot(h,d),y=m*d-b*h;if(l.radius<=0||p===0||x===0||Math.abs(y)<1e-9*p*x){u(l.x1,l.y1);break}let g=m/p,M=b/p,E=h/x,P=d/x,R=Math.max(-1,Math.min(1,g*E+M*P)),T=Math.acos(R)/2,w=l.radius/Math.tan(T),A=l.x1+g*w,I=l.y1+M*w,S=l.x1+E*w,v=l.y1+P*w,C=g+E,U=M+P,L=Math.hypot(C,U),k=l.radius/Math.sin(T),F=l.x1+C/L*k,_=l.y1+U/L*k,H=Math.atan2(I-_,A-F),G=Math.atan2(v-_,S-F)-H;G>Math.PI?G-=2*Math.PI:G<-Math.PI&&(G+=2*Math.PI),u(A,I);let W=Kf(l.radius,G);for(let N=1;N<=W;N++){let Z=H+G*N/W;u(F+l.radius*Math.cos(Z),_+l.radius*Math.sin(Z));}break}case "ellipse":{let c=2*Math.PI,f;if(l.ccw){let y=l.startAngle-l.endAngle;f=-(y>=c?c:Zf(y,c));}else {let y=l.endAngle-l.startAngle;f=y>=c?c:Zf(y,c);}let m=Math.cos(l.rotation),b=Math.sin(l.rotation),h=y=>{let g=l.rx*Math.cos(y),M=l.ry*Math.sin(y);return [l.cx+g*m-M*b,l.cy+g*b+M*m]},[d,p]=h(l.startAngle);u(d,p);let x=Kf(Math.max(Math.abs(l.rx),Math.abs(l.ry)),f);for(let y=1;y<=x;y++){let[g,M]=h(l.startAngle+f*y/x);u(g,M);}break}}return s(),t}function sy(e){let t=Math.floor(e.x),n=Math.floor(e.y),r=Math.max(t,Math.min(t+32768,Math.ceil(e.x+e.w))),o=Math.max(n,Math.min(n+32768,Math.ceil(e.y+e.h)));return {x0:t,y0:n,x1:r,y1:o}}function e0(...e){let t=1/0,n=1/0,r=-1/0,o=-1/0,i=(u,l)=>{Math.abs(u)<8388608&&Math.abs(l)<8388608&&(t=Math.min(t,u),n=Math.min(n,l),r=Math.max(r,u),o=Math.max(o,l));};for(let u of e)for(let l of u??[])for(let c of Hr(l.cmds))for(let f=0;f<c.length;f+=2)i(c[f],c[f+1]);if(!Number.isFinite(t))return {x:0,y:0,w:0,h:0};let s=Math.floor(t),a=Math.floor(n);return {x:s,y:a,w:Math.ceil(r)-s,h:Math.ceil(o)-a}}function ay(e,t,n){let r=[];for(let o of Hr(e.cmds)){let i=o.length/2;for(let s=0;s<i;s++){let a=o[2*s],u=o[2*s+1],l=(s+1)%i,c=o[2*l],f=o[2*l+1];if(u===f||!Number.isFinite(a+u+c+f))continue;let m=f>u?1:-1,b=m>0?a:c,h=m>0?u:f,d=m>0?f:u,p=(c-a)/(f-u),x=Math.max(t,Math.ceil(h-.5)),y=Math.min(n,Math.ceil(d-.5));x>=y||r.push({row0:x,row1:y,x:b+(x+.5-h)*p,slope:p,dir:m});}}return r.sort((o,i)=>o.row0-i.row0),r}function uy(e,t){let n=[],r=ay(e,t.y0,t.y1),o=e.fillRule==="evenodd",i=[],s=0,a=[];for(let u=t.y0;u<t.y1;u++){for(;s<r.length&&r[s].row0===u;)i.push(r[s++]);i=i.filter(m=>m.row1>u),a.length=0;for(let m of i)a.push({x:m.x+(u-m.row0)*m.slope,dir:m.dir});a.sort((m,b)=>m.x-b.x);let l=[],c=0,f=0;for(let m of a){let b=o?(c&1)!==0:c!==0;c+=m.dir;let h=o?(c&1)!==0:c!==0;if(!b&&h)f=m.x;else if(b&&!h){let d=Math.max(t.x0,Math.ceil(f-.5)),p=Math.min(t.x1,Math.ceil(m.x-.5));d<p&&(l.length>0&&l[l.length-1]>=d?l[l.length-1]=Math.max(l[l.length-1],p):l.push(d,p));}}n.push(l);}return n}function t0(e,t,n){let r=[],o=0,i=0,s=false,a=false,u=false;for(;o<e.length||i<t.length;){let l=Math.min(o<e.length?e[o]:1/0,i<t.length?t[i]:1/0);for(;o<e.length&&e[o]===l;)s=!s,o++;for(;i<t.length&&t[i]===l;)a=!a,i++;let c=n(s,a);c!==u&&(r.push(l),u=c);}return r}function Qf(e,t){let n=t.x1>t.x0?[t.x0,t.x1]:[],r=[];for(let o=t.y0;o<t.y1;o++)r.push(n);for(let o of e??[]){let i=uy(o,t);r=r.map((s,a)=>s.length===0?s:t0(s,i[a],n0));}return r}var n0=(e,t)=>e&&t,ly={replace:(e,t)=>t,intersect:n0,union:(e,t)=>e||t,xor:(e,t)=>e!==t,exclude:(e,t)=>e&&!t,complement:(e,t)=>t&&!e};function cy(e,t){if(e.length!==t.length)return false;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return false;return true}function my(e,t){let n=[],r=0;for(let o=1;o<=e.length;o++){if(o<e.length&&cy(e[o],e[r]))continue;let i=e[r];for(let s=0;s<i.length;s+=2)n.push({x:i[s],y:t+r,w:i[s+1]-i[s],h:o-r});r=o;}return n}function tr(e,t,n,r){let o=sy(r);if(o.x1<=o.x0||o.y1<=o.y0)return [];let i=Qf(e,o),s=Qf(t,o),a=ly[n],u=i.map((l,c)=>t0(l,s[c],a));return my(u,o.y0)}function r0(e){return e.w>32768||e.h>32768}var fy=8192;function nr(e,t,n){if(n<12)return null;e.getUint32(t,true);let o=e.getUint32(t+4,true),i=e.getUint32(t+8,true);if(o===0||o>1e5)return null;let s=(i&16384)!==0;if(12+(o*(s?4:8)+o)>n)return null;let f=[],m=t+12;for(let d=0;d<o;d++)s?(f.push({x:e.getInt16(m,true),y:e.getInt16(m+2,true)}),m+=4):(f.push({x:e.getFloat32(m,true),y:e.getFloat32(m+4,true)}),m+=8);let b=m+3&-4,h=new Uint8Array(e.buffer,e.byteOffset+b,o);return {kind:"plus-path",points:f,types:new Uint8Array(h),fillRule:i&fy?"nonzero":"evenodd"}}function by(e,t){let n=(u,l)=>t[0]*u+t[2]*l+t[4],r=(u,l)=>t[1]*u+t[3]*l+t[5],o=[],i=e.points,s=e.types,a=0;for(;a<i.length;){let u=s[a]&15,l=(s[a]&128)!==0;if(u===0)o.push({op:"moveTo",x:n(i[a].x,i[a].y),y:r(i[a].x,i[a].y)}),a++;else if(u===3){if(a+2<i.length){o.push({op:"bezierCurveTo",cp1x:n(i[a].x,i[a].y),cp1y:r(i[a].x,i[a].y),cp2x:n(i[a+1].x,i[a+1].y),cp2y:r(i[a+1].x,i[a+1].y),x:n(i[a+2].x,i[a+2].y),y:r(i[a+2].x,i[a+2].y)}),(s[a+2]&128)!==0&&o.push({op:"closePath"}),a+=3;continue}break}else o.push({op:"lineTo",x:n(i[a].x,i[a].y),y:r(i[a].x,i[a].y)}),a++;l&&o.push({op:"closePath"});}return o}var hy=512;function dy(e,t,n,r,o,i,s,a){let u=(s-o)*(t-i)-(a-i)*(e-o),l=(s-o)*(r-i)-(a-i)*(n-o),c=(n-e)*(i-t)-(r-t)*(o-e),f=(n-e)*(a-t)-(r-t)*(s-e);return u*l<0&&c*f<0}function py(e){let t=Hr(e);if(t.length!==1)return false;let n=t[0],r=n.length/2;if(r<3)return true;if(r>hy)return false;for(let o=0;o<r;o++){let i=(o+1)%r;for(let s=o+2;s<r;s++){let a=(s+1)%r;if(a!==o&&dy(n[2*o],n[2*o+1],n[2*i],n[2*i+1],n[2*s],n[2*s+1],n[2*a],n[2*a+1]))return false}}return true}function Ru(e,t){let n=by(e,t);return {cmds:n,fillRule:e.fillRule??"nonzero",simple:py(n)}}function $r(e,t){e.beginPath();let n=t.points,r=t.types,o=0;for(;o<n.length;){let i=r[o]&15,s=(r[o]&128)!==0;if(i===0)e.moveTo(n[o].x,n[o].y),o++;else if(i===1)e.lineTo(n[o].x,n[o].y),o++;else if(i===3)if(o+2<n.length){e.bezierCurveTo(n[o].x,n[o].y,n[o+1].x,n[o+1].y,n[o+2].x,n[o+2].y),(r[o+2]&128)!==0&&e.closePath(),o+=3;continue}else break;else e.lineTo(n[o].x,n[o].y),o++;s&&e.closePath();}}var Ey=1,Ps=2,i0=4,s0=8,Py=64,Ry=128,gs=4096;function Xr(e){return e>>>12===900097}function wu(e,t){return [e.getFloat32(t,true),e.getFloat32(t+4,true),e.getFloat32(t+8,true),e.getFloat32(t+12,true),e.getFloat32(t+16,true),e.getFloat32(t+20,true)]}function Ms(e,t,n){return {x:e[0]*t+e[2]*n+e[4],y:e[1]*t+e[3]*n+e[5]}}function Ty(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Au(e){switch(e){case 0:return "tile";case 1:return "tile-flip-x";case 2:return "tile-flip-y";case 3:return "tile-flip-xy";default:return "clamp"}}function a0(e){return e.map(t=>({...t,offset:Ty(t.offset)})).sort((t,n)=>t.offset-n.offset)}function u0(e,t,n){if(t+4>n)return null;let r=e.getUint32(t,true);if(r===0||r>gs)return null;let o=t+4,i=o+r*4,s=i+r*4;if(s>n)return null;let a=[];for(let u=0;u<r;u++){let l=e.getUint32(i+u*4,true);a.push({offset:e.getFloat32(o+u*4,true),color:chunkI7XOR2GO_js.c(l),argb:l});}return {stops:a,next:s}}function l0(e,t,n){if(t+4>n)return null;let r=e.getUint32(t,true);if(r===0||r>gs)return null;let o=t+4,i=o+r*4,s=i+r*4;if(s>n)return null;let a=[];for(let u=0;u<r;u++)a.push({pos:e.getFloat32(o+u*4,true),factor:e.getFloat32(i+u*4,true)});return {entries:a,next:s}}function wy(e,t,n){if(t+40>n)return null;let r=e.getUint32(t,true),o=Au(e.getUint32(t+4,true)),i=e.getFloat32(t+8,true),s=e.getFloat32(t+12,true),a=e.getFloat32(t+16,true),u=e.getFloat32(t+20,true),l=e.getUint32(t+24,true),c=e.getUint32(t+28,true),f=t+40,m=null;r&Ps&&f+24<=n&&(m=wu(e,f),f+=24);let b=[{offset:0,color:chunkI7XOR2GO_js.c(l),argb:l},{offset:1,color:chunkI7XOR2GO_js.c(c),argb:c}],h={startArgb:l,endArgb:c,preset:null,blend:null,gammaCorrected:(r&Ry)!==0};if(r&i0){let x=u0(e,f,n);x&&(b=x.stops,h.preset={positions:x.stops.map(y=>y.offset),argb:x.stops.map(y=>y.argb??0)});}else if(r&s0){let x=l0(e,f,n);x&&(b=x.entries.map(y=>({offset:y.pos,color:chunkI7XOR2GO_js.d(l,c,y.factor),argb:Iu(l,c,y.factor)})),h.blend={positions:x.entries.map(y=>y.pos),factors:x.entries.map(y=>y.factor)});}let d={x:i,y:s+u/2},p={x:i+a,y:s+u/2};return m&&(d=Ms(m,d.x,d.y),p=Ms(m,p.x,p.y)),chunkI7XOR2GO_js.q(`parseEmfPlusBrushObject: linear gradient (${d.x.toFixed(1)},${d.y.toFixed(1)})\u2192(${p.x.toFixed(1)},${p.y.toFixed(1)}), ${b.length} stop(s)`),{kind:"plus-brush",color:chunkI7XOR2GO_js.c(l),gradient:{type:"linear",x1:d.x,y1:d.y,x2:p.x,y2:p.y,stops:a0(b),wrapMode:o,rect:{x:i,y:s,w:a,h:u},transform:m,ramp:h}}}function c0(e,t,n){if(t+28>n||e.getUint32(t+4,true)!==1)return null;let o=e.getInt32(t+8,true),i=e.getInt32(t+12,true),s=e.getInt32(t+16,true),a=e.getUint32(t+20,true),u=t+28,l=Math.abs(s);if(o<=0||i<=0||o>8192||i>8192||u+l*i>n)return null;let c=qf(e,u,o,i,s,a);return c?{width:o,height:i,rgba:c}:null}function m0(e,t,n){if(t+28>n||e.getUint32(t+4,true)!==1||c0(e,t,n))return null;let r=t+28;return r<n?{start:r,end:n}:null}function f0(e,t,n){if(t+8>n)return null;let r=e.getUint32(t,true),o=t+8;return r&Ps&&o+24<=n&&(o+=24),o}function Ay(e,t,n,r){if(t+8>n)return null;let o=e.getUint32(t,true),i=Au(e.getUint32(t+4,true)),s=t+8,a=null;o&Ps&&s+24<=n&&(a=wu(e,s),s+=24);let u=c0(e,s,n)??r??null;if(!u)return chunkI7XOR2GO_js.r("parseEmfPlusBrushObject: TextureFill brush has no synchronously-decodable pixel bitmap (compressed image or metafile texture, and no pre-decoded result was cached); falling back to black"),null;let l={width:u.width,height:u.height,rgba:u.rgba,wrapMode:i,transform:a},c=0,f=0,m=0,b=u.width*u.height;for(let d=0;d<b;d++)c+=u.rgba[d*4],f+=u.rgba[d*4+1],m+=u.rgba[d*4+2];let h=b>0?`rgba(${Math.round(c/b)},${Math.round(f/b)},${Math.round(m/b)},1)`:"rgba(128,128,128,1)";return chunkI7XOR2GO_js.q(`parseEmfPlusBrushObject: texture fill ${u.width}x${u.height}, wrapMode=${i}`),{kind:"plus-brush",color:h,texture:l}}function Iy(e,t,n){if(t+24>n)return null;let r=e.getUint32(t,true),o=Au(e.getUint32(t+4,true)),i=e.getUint32(t+8,true),s=e.getFloat32(t+12,true),a=e.getFloat32(t+16,true),u=e.getUint32(t+20,true);if(u>gs)return {kind:"plus-brush",color:chunkI7XOR2GO_js.c(i)};let l=[],c=t+24;for(let w=0;w<u&&c+4<=n;w++)l.push(e.getUint32(c,true)),c+=4;let f=[],m=[],b,h=w=>l.length>0?l[Math.min(w,l.length-1)]:i;if(r&Ey){if(c+4<=n){let w=e.getInt32(c,true);if(c+=4,w>0&&c+w<=n){let A=nr(e,c,w);if(A){let I=Cy(A.points,A.types,h);f=I.points,m=I.argb;let S=A.points.length;for(let v=0;v<A.points.length;v++){if(v>0&&(A.types[v]&7)===0){S=v;break}if(A.types[v]&128){S=v+1;break}}A.types.slice(0,S).some(v=>(v&7)===3)&&(b={points:A.points.slice(0,S),types:A.types.slice(0,S)});}c+=w;}}}else if(c+4<=n){let w=e.getUint32(c,true);if(c+=4,w>0&&w<=gs&&c+w*8<=n){for(let A=0;A<w;A++)f.push({x:e.getFloat32(c+A*8,true),y:e.getFloat32(c+A*8+4,true)}),m.push(h(A));c+=w*8;}}let d=null;r&Ps&&c+24<=n&&(d=wu(e,c),c+=24);let p={x:s,y:a},x=d,y=x?f.map(w=>Ms(x,w.x,w.y)):f;x&&({x:s,y:a}=Ms(x,s,a));let g=l.length>0?l[0]:i,M=[{offset:0,color:chunkI7XOR2GO_js.c(i),argb:i},{offset:1,color:chunkI7XOR2GO_js.c(g),argb:g}],E=null,P=null;if(r&i0){let w=u0(e,c,n);w&&(M=w.stops.map(A=>({...A,offset:1-A.offset})),P={positions:w.stops.map(A=>A.offset),argb:w.stops.map(A=>A.argb??0)},c=w.next);}else if(r&s0){let w=l0(e,c,n);w&&(M=w.entries.map(A=>({offset:1-A.pos,color:chunkI7XOR2GO_js.d(g,i,A.factor),argb:Iu(g,i,A.factor)})),E={positions:w.entries.map(A=>A.pos),factors:w.entries.map(A=>A.factor)},c=w.next);}let R=null;r&Py&&c+12<=n&&e.getUint32(c,true)===2&&(R={x:e.getFloat32(c+4,true),y:e.getFloat32(c+8,true)});let T=0;for(let w of y){let A=Math.hypot(w.x-s,w.y-a);A>T&&(T=A);}return T>0?(chunkI7XOR2GO_js.q(`parseEmfPlusBrushObject: path gradient centre=(${s.toFixed(1)},${a.toFixed(1)}), ${f.length} boundary point(s)`),{kind:"plus-brush",color:chunkI7XOR2GO_js.c(i),gradient:{type:"radial",cx:s,cy:a,r:T,stops:a0(M),wrapMode:o,shape:{center:p,centerArgb:i,boundary:f,source:b,boundaryArgb:m,blend:E,preset:P,focus:R,transform:d}}}):{kind:"plus-brush",color:chunkI7XOR2GO_js.c(i)}}function Iu(e,t,n){let r=Math.min(1,Math.max(0,n)),o=0;for(let i=24;i>=0;i-=8){let s=e>>>i&255,a=t>>>i&255;o=o*256+Math.round(s+(a-s)*r);}return o>>>0}var Sy=.25,vy=10;function o0(e,t,n){let r=n.x-t.x,o=n.y-t.y,i=Math.hypot(r,o);return i<1e-12?Math.hypot(e.x-t.x,e.y-t.y):Math.abs((e.x-t.x)*o-(e.y-t.y)*r)/i}function Es(e,t,n,r,o,i=0,s=1,a=0){if(Math.max(o0(t,e,r),o0(n,e,r))<=Sy||a>=vy){o.push({x:r.x,y:r.y,t:s});return}let l=(x,y)=>({x:(x.x+y.x)/2,y:(x.y+y.y)/2}),c=l(e,t),f=l(t,n),m=l(n,r),b=l(c,f),h=l(f,m),d=l(b,h),p=(i+s)/2;Es(e,c,b,d,o,i,p,a+1),Es(d,h,m,r,o,p,s,a+1);}function Cy(e,t,n){let r=[],o=[];for(let s=0;s<e.length;s++){let a=t[s]&7;if(s>0&&a===0)break;if(a===3&&s>0&&s+2<e.length){let u=e.slice(s-1,s+3).flatMap(b=>[Dt(b.x),Dt(b.y)]);r[r.length-1]={x:u[0]/16,y:u[1]/16};let l=n(s-1),c=n(s+2),f=[],m=[];jt(u,f,void 0,m);for(let b=0;b<m.length;b++)r.push({x:f[b*2]/16,y:f[b*2+1]/16}),o.push(Iu(l,c,m[b]));if(s+=2,t[s]&128)break;continue}if(r.push(e[s]),o.push(n(s)),t[s]&128)break}let i=r.length;return i>1&&r[0].x===r[i-1].x&&r[0].y===r[i-1].y&&(r.pop(),o.pop()),{points:r,argb:o}}function Rs(e,t,n,r,o=t){if(n<8)return null;let i=t+n,s=Xr(e.getUint32(t,true)),a=t+(s?4:0);if(a+8>i)return null;let u=e.getUint32(a,true),l=a+4;switch(u){case 0:return {kind:"plus-brush",color:chunkI7XOR2GO_js.c(e.getUint32(l,true))};case 1:if(l+12<=i){let c=e.getUint32(l+4,true);return {kind:"plus-brush",color:chunkI7XOR2GO_js.c(c),hatch:{style:e.getUint32(l,true),fore:c,back:e.getUint32(l+8,true)}}}return l+8<=i?{kind:"plus-brush",color:chunkI7XOR2GO_js.c(e.getUint32(l+4,true))}:{kind:"plus-brush",color:"rgba(0,0,0,1)"};case 2:{let c=r?.get(o);return Ay(e,l,i,c)??{kind:"plus-brush",color:"rgba(0,0,0,1)"}}case 4:return wy(e,l,i)??{kind:"plus-brush",color:"rgba(0,0,0,1)"};case 3:return Iy(e,l,i)??{kind:"plus-brush",color:"rgba(0,0,0,1)"};default:return {kind:"plus-brush",color:"rgba(0,0,0,1)"}}}function Dy(e){let t=e[0]*e[3]-e[1]*e[2];if(!Number.isFinite(t)||Math.abs(t)<1e-12)return null;let n=e[3]/t,r=-e[1]/t,o=-e[2]/t,i=e[0]/t;return [n,r,o,i,-(n*e[4]+o*e[5]),-(r*e[4]+i*e[5])]}function _o(e,t){return {x:e[0]*t.x+e[2]*t.y+e[4],y:e[1]*t.x+e[3]*t.y+e[5]}}function rr(e,t,n,r,o,i){let s=Math.PI/2,a=Math.max(1,Math.ceil(Math.abs(i)/s-1e-9)),u=f=>({x:e+n*Math.cos(f),y:t+r*Math.sin(f)}),l=f=>({x:-n*Math.sin(f),y:r*Math.cos(f)}),c=[];for(let f=0;f<a;f++){let m=o+f*Math.sign(i)*s,b=f===a-1?o+i-m:Math.sign(i)*s,h=4/3*Math.tan(b/4),d=m+b,p=u(m),x=u(d),y=l(m),g=l(d);c.push([p,{x:p.x+h*y.x,y:p.y+h*y.y},{x:x.x-h*g.x,y:x.y-h*g.y},x]);}return c}function b0(e,t){let n=Dy(t);if(!n)return e;let r=null,o=null,i=l=>{e.moveTo(l.x,l.y),r=l,o=l;},s=l=>{e.lineTo(l.x,l.y),r=l;},a=(l,c,f,m)=>{let b=[];Es(_o(t,l),_o(t,c),_o(t,f),_o(t,m),b);for(let h=0;h<b.length-1;h++){let d=_o(n,b[h]);e.lineTo(d.x,d.y);}s(m);},u={beginPath(){e.beginPath(),r=null,o=null;},moveTo(l,c){i({x:l,y:c});},lineTo(l,c){if(!r){i({x:l,y:c});return}s({x:l,y:c});},closePath(){e.closePath(),r=o;},rect(l,c,f,m){i({x:l,y:c}),s({x:l+f,y:c}),s({x:l+f,y:c+m}),s({x:l,y:c+m}),e.closePath(),r={x:l,y:c};},bezierCurveTo(l,c,f,m,b,h){let d=r??{x:l,y:c};r||i(d),a(d,{x:l,y:c},{x:f,y:m},{x:b,y:h});},ellipse(l,c,f,m,b,h,d,p){let x=d-h;p?(x=x>0?x-2*Math.PI*Math.ceil(x/(2*Math.PI)):x,x<-2*Math.PI&&(x=-2*Math.PI)):(x=x<0?x+2*Math.PI*Math.ceil(-x/(2*Math.PI)):x,x>2*Math.PI&&(x=2*Math.PI));let y=Math.cos(b),g=Math.sin(b),M=R=>b===0?R:{x:l+(R.x-l)*y-(R.y-c)*g,y:c+(R.x-l)*g+(R.y-c)*y},E=rr(l,c,f,m,h,x).map(R=>R.map(M));if(E.length===0)return;let P=E[0][0];r?s(P):i(P);for(let[R,T,w,A]of E)a(R,T,w,A);}};return new Proxy(e,{get(l,c){if(typeof c=="string"&&c in u)return u[c];let f=l[c];return typeof f=="function"?f.bind(l):f},set(l,c,f){return l[c]=f,true}})}var Me=Math.fround;function y0(e,t,n){let r=t.map(m=>Me(m)),o=(m,b)=>Dt(Me(Me(Me(r[0]*Me(m))+Me(r[2]*Me(b)))+r[4])),i=(m,b)=>Dt(Me(Me(Me(r[1]*Me(m))+Me(r[3]*Me(b)))+r[5])),s=[],a=null,u=null,l=(m,b)=>{a={pts:[o(m,b),i(m,b)],closed:false,curved:false},s.push(a),u={x:m,y:b};},c=(m,b)=>{if(!a){l(m,b);return}a.pts.push(o(m,b),i(m,b));},f={beginPath(){a=null,u=null;},moveTo:l,lineTo:c,bezierCurveTo(m,b,h,d,p,x){a||l(m,b);let y=a;y.curved=true;let g=y.pts.length;jt([y.pts[g-2],y.pts[g-1],o(m,b),i(m,b),o(h,d),i(h,d),o(p,x),i(p,x)],y.pts);},ellipse(m,b,h,d,p,x,y,g){let M=y-x;g?(M=M>0?M-2*Math.PI*Math.ceil(M/(2*Math.PI)):M,M=Math.max(M,-2*Math.PI)):(M=M<0?M+2*Math.PI*Math.ceil(-M/(2*Math.PI)):M,M=Math.min(M,2*Math.PI));let E=Math.cos(p),P=Math.sin(p),R=A=>p===0?A:{x:m+(A.x-m)*E-(A.y-b)*P,y:b+(A.x-m)*P+(A.y-b)*E},T=rr(m,b,h,d,x,M);if(T.length===0)return;let w=R(T[0][0]);a?c(w.x,w.y):l(w.x,w.y);for(let A of T){let[,I,S,v]=A.map(R);f.bezierCurveTo(I.x,I.y,S.x,S.y,v.x,v.y);}},rect(m,b,h,d){l(m,b),c(m+h,b),c(m+h,b+d),c(m,b+d),f.closePath();},closePath(){if(a&&u){a.closed=true;let m=u;l(m.x,m.y);}}};return e(f),s.filter(m=>m.pts.length>=4)}function h0(e){let t=e.pts;return !e.closed||t.length<4?t:[...t,t[0],t[1]]}var d0=32;function Ly(e){let t=e.length/2,n=[];for(let r=0;r<t-1;r+=d0-1)n.push(e.slice(2*r,2*Math.min(t,r+d0)));return n}function Uy(e,t,n,r,o,i,s){let a=Me(n/16-e/16),u=Me(r/16-t/16);if(a===0&&u===0)return;let l=Math.abs(a),c=Math.abs(u),f=c<l,m=false,b;f?(b=u>=0?1:-1,a<0&&(m=true,[e,t,n,r]=[n,r,e,t],b=-b)):(b=a>=0?1:-1,u<0&&(m=true,[e,t,n,r]=[n,r,e,t],b=-b));let h=f?e:t,d=f?n:r,p=f?t:e,x=f?r:n,y=Me(f?Me(b*c)/l:Me(b*l)/c),g=d-h,M=(x-p)*b,E=0,P=0,R=0;if(s){let B=y===0?0:Me(1/y),O=(f?s.x:s.y)*16-8,j=(f?s.x+s.w:s.y+s.h)*16-8,q=(f?s.y:s.x)*16-8,ae=(f?s.y+s.h:s.x+s.w)*16-8;if(h<O||d>j){if(h>j||d<O)return;if(h<O){let ee=Me(Me((O-h)*y)+p),le=Math.floor(ee);p=le,h=O,E=Me(ee-le);}if(d>j){let ee=Me(Me((j-d)*y)+x),le=Math.floor(ee);o=true,x=le,d=j,P=Me(ee-le);}}let se=b===1,de=se?p:x,me=se?x:p;if(de<q||me>ae){if(de>ae||me<q)return;if(de<q){let ee=Math.floor(Me(Me(q-Me(de+(se?E:P)))*B));se?(h+=ee,p=q):(d+=ee,x=q);}if(me>ae){let ee=Math.floor(Me(Me(ae-Me(me+(se?P:E)))*B));se?(d+=ee,x=ae):(h+=ee,p=ae),o=true;}}P!==0&&(x&15)===8&&x++,E!==0&&(R=Math.floor(Me(Me(2*g*b)*E)));}let T=f&&g===M,w=T&&b===1,A=w?8:7,I=(B,O)=>{let j=Math.abs(B)+Math.abs(O);return j<8?true:j!==8?false:O===0&&B===(w?-8:8)||B===0&&O===8?true:T&&(w?B<0:B>0)&&O>0},S=h+A&-16,v=d+A&-16,C=I(h-S,p-(p+7&-16)),U=I(d-v,x-(x+7&-16)),L=h&15,k=d&15;m&&!o?(C||L<=8)&&(S+=16):L<=8&&!C&&(S+=16),!m&&!o?(k>8||U)&&(v-=16):!U&&k>8&&(v-=16);let F=S>>4,_=v>>4;if(_<F)return;let H=Math.floor((S-h)*y+p+E),G=H+7&-16,W=G>>4,N=R-((G-H)*b+8)*2*g>>4;if(!s){for(let B=F;B<=_;B++)f?i(B,W):i(W,B),N+=2*M,N>0&&(W+=b,N-=2*g);return}let J=Math.floor((v-d)*y+x+P)+7>>4,K=f?s.x:s.y,ie=(f?s.x+s.w:s.y+s.h)-1,ce=f?s.y:s.x,$=(f?s.y+s.h:s.x+s.w)-1,X=(J-W)*b;for(let B=F;B<=_&&X>=0;B++)B>=K&&B<=ie&&W>=ce&&W<=$&&(f?i(B,W):i(W,B)),N+=2*M,N>0&&(W+=b,N-=2*g,X--);}var p0=[0,-8,-8,0,0,8,8,0];function x0(e,t){return Math.abs(t)>Math.abs(e)?t<0?1:3:e<0?2:0}function Fy(e){let t=e.length/2;if(t<2)return [];let n=[],r=[],o=m=>e[2*m],i=m=>e[2*m+1],s=x0(o(1)-o(0),i(1)-i(0)),a=m=>p0[2*(m&3)],u=m=>p0[2*(m&3)+1];n.push(o(0)-a(s),i(0)-u(s),o(0)+a(s+1),i(0)+u(s+1));for(let m=0;m+1<t&&(n.push(o(m)+a(s),i(m)+u(s),o(m+1)+a(s),i(m+1)+u(s)),r.push(o(m)-a(s),i(m)-u(s),o(m+1)-a(s),i(m+1)-u(s)),!(m+2>=t));m++){let b=x0(o(m+2)-o(m+1),i(m+2)-i(m+1));if(b!==s){let h=o(m+1)-o(m),d=i(m+1)-i(m),p=o(m+2)-o(m+1),x=i(m+2)-i(m+1),y=o(m+1),g=i(m+1);if(h*x>=d*p){let M=s-1&3;M!==b&&n.push(y+a(M),g+u(M)),r.push(y,g);}else {let M=s+1&3;M!==b&&r.push(y-a(M),g-u(M)),n.push(y,g);}s=b;}}let l=o(t-1),c=i(t-1);n.push(l+a(s-1),c+u(s-1),l-a(s),c-u(s));let f=n.slice();for(let m=r.length-2;m>=0;m-=2)f.push(r[m],r[m+1]);return f}function Ts(e,t,n){if(!t.antialias&&t.opaqueSolid&&!e.some(o=>o.curved)){let o=t.half?8:0,i=new Uint8ClampedArray(n.w*n.h),s=(u,l)=>{let c=u-n.x,f=l-n.y;c>=0&&f>=0&&c<n.w&&f<n.h&&(i[f*n.w+c]=255);},a=t.clip&&!ky(e,t.clip,o)?t.clip:void 0;for(let u of e){let l=h0(u);for(let c=0;c+3<l.length;c+=2)Uy(l[c]-o,l[c+1]-o,l[c+2]-o,l[c+3]-o,true,s,a);}return i}let r=[];for(let o of e)for(let i of Ly(h0(o))){let s=Fy(i);s.length>=6&&r.push(s);}return ot(r,false,t.antialias,t.half,n)}function ky(e,t,n){let r=1/0,o=1/0,i=-1/0,s=-1/0;for(let a of e)for(let u=0;u+1<a.pts.length;u+=2){let l=(a.pts[u]-n)/16,c=(a.pts[u+1]-n)/16;r=Math.min(r,l),i=Math.max(i,l),o=Math.min(o,c),s=Math.max(s,c);}return Math.floor(r-.5)-1>=t.x&&Math.floor(o-.5)-1>=t.y&&Math.ceil(i+.5)+1<=t.x+t.w-1&&Math.ceil(s+.5)+1<=t.y+t.h-1}function Ge(e){return Math.ceil(Math.round(e*256-1e-6)/16)}function g0(e){return Math.floor(e*16+.5-1e-4)}function _y(e){let t=e.map(g0);if(t.length===10&&t[0]===t[8]&&t[1]===t[9]&&(t=t.slice(0,8)),t.length!==8)return null;let[n,r,o,i,s,a,u,l]=t;return r===i&&o===s&&a===l&&u===n||n===o&&i===a&&s===u&&l===r?t:null}function En(e,t){let n=[],r=null,o=null,i=(m,b)=>t[0]*m+t[2]*b+t[4],s=(m,b)=>t[1]*m+t[3]*b+t[5],a=(m,b)=>{r={pts:[i(m,b),s(m,b)],closed:false,curved:false},n.push(r),o={x:m,y:b};},u=(m,b)=>{if(!r){a(m,b);return}r.pts.push(i(m,b),s(m,b));},l=(m,b,h,d,p,x)=>{r||a(m,b);let y=r;y.curved=true;let g=y.pts.length,M=(I,S)=>Math.abs(I-y.pts[g-2])<.001&&Math.abs(S-y.pts[g-1])<.001,E=M(i(m,b),s(m,b))&&M(i(h,d),s(h,d))&&M(i(p,x),s(p,x)),P=I=>Ge(I),R=P(y.pts[g-2]),T=P(y.pts[g-1]);y.pts[g-2]=R/16,y.pts[g-1]=T/16,E&&(y.splits??(y.splits=[])).push({x:R/16,y:T/16});let w=[],A=[R,T,P(i(m,b)),P(s(m,b)),P(i(h,d)),P(s(h,d)),P(i(p,x)),P(s(p,x))];jt(A,w);for(let I of w)y.pts.push(I/16);},c=()=>{if(r&&o){r.closed=true;let m=o;a(m.x,m.y);}};return e({beginPath(){r=null,o=null;},moveTo:a,lineTo:u,closePath:c,rect(m,b,h,d){a(m,b),u(m+h,b),u(m+h,b+d),u(m,b+d),c();},bezierCurveTo:l,ellipse(m,b,h,d,p,x,y,g){let M=y-x;g?(M=M>0?M-2*Math.PI*Math.ceil(M/(2*Math.PI)):M,M=Math.max(M,-2*Math.PI)):(M=M<0?M+2*Math.PI*Math.ceil(-M/(2*Math.PI)):M,M=Math.min(M,2*Math.PI));let E=Math.cos(p),P=Math.sin(p),R=A=>p===0?A:{x:m+(A.x-m)*E-(A.y-b)*P,y:b+(A.x-m)*P+(A.y-b)*E},T=rr(m,b,h,d,x,M);if(T.length===0)return;let w=R(T[0][0]);r?u(w.x,w.y):a(w.x,w.y);for(let A of T){let[,I,S,v]=A.map(R);l(I.x,I.y,S.x,S.y,v.x,v.y);}}}),n.filter(m=>m.pts.length>=4)}function M0(e,t,n=false){return En(e,t).map(r=>(n&&!r.curved?_y(r.pts):null)??r.pts.map(Ge)).filter(r=>r.length>=6)}function By(e,t){let n=Math.floor(e/t);for(;n*t>e;)n--;for(;(n+1)*t<=e;)n++;return n*t===e?n:n+1}function Bo(e,t){let n=1/0,r=1/0,o=-1/0,i=-1/0;for(let c of e)for(let f=0;f<c.length;f+=2)n=Math.min(n,c[f]),o=Math.max(o,c[f]),r=Math.min(r,c[f+1]),i=Math.max(i,c[f+1]);if(!Number.isFinite(n))return null;let s=Math.max(0,Math.floor(n/16)-1),a=Math.max(0,Math.floor(r/16)-1),u=Math.min(t.w,Math.ceil(o/16)+2),l=Math.min(t.h,Math.ceil(i/16)+2);return u>s&&l>a?{x:s,y:a,w:u-s,h:l-a}:null}function ot(e,t,n,r,o){let i=n?8:1,s=n?4:1,a=16/i,u=16/s,l=r?8:0,c=16*o.x+l-(n?8:0),f=16*o.y+l-(n?8:0),m=o.w*i,b=f+u*(o.h*s-1),h=[];for(let g of e){let M=g.length/2;for(let E=0;E<M;E++){let P=(E+1)%M,R=g[2*E],T=g[2*E+1],w=g[2*P],A=g[2*P+1],I=Math.min(T,A),S=Math.max(T,A);if(!(I<S&&I<=b&&S>f))continue;let v=A-T;h.push({ay:T,base:R*v,dx:w-R,denominator:Math.abs(v),top:I,bottom:S,w:v>0?1:-1,k:0});}}let d=new Uint8ClampedArray(o.w*o.h),p=n?new Int32Array(o.w+2):null;h.sort((g,M)=>g.top-M.top);let x=[],y=0;for(let g=0;g<o.h;g++){let M=g*o.w;p?.fill(0);for(let E=0;E<s;E++){let P=f+u*(g*s+E),R=0;for(let w of x)P<w.bottom&&(x[R++]=w);for(x.length=R;y<h.length&&h[y].top<=P;){let w=h[y++];P<w.bottom&&x.push(w);}if(x.length<2)continue;for(let w of x){let A=(w.base+w.dx*(P-w.ay))*w.w-c*w.denominator,I=a*w.denominator;w.k=A<=0?0:A>=m*I?m:By(A,I);}x.sort((w,A)=>w.k-A.k);let T=0;for(let w=0;w+1<x.length;w++){T+=x[w].w;let A=t?(T&1)!==0:T!==0,I=x[w].k,S=x[w+1].k;if(!(!A||!(S>I)))if(!p)d.fill(255,M+I,M+S);else {let v=I>>3,C=S>>3,U=I&7,L=S&7;p[v]+=8-U,p[v+1]+=U,p[C]+=L-8,p[C+1]-=L;}}}if(p){let E=0;for(let P=0;P<o.w;P++)E+=p[P],d[M+P]=E*255+16>>5;}}return d}function E0(e,t,n){let r=[1,0,0,1,0,0],o=null;for(let a of e){let u;try{u=En(a.build,r).map(c=>c.pts.map(g0));}catch{return null}let l=ot(u,a.evenOdd,false,n,t);if(o)for(let c=0;c<l.length;c++)o[c]=o[c]&&l[c];else o=l;}let i=[];if(!o)return i;let s=new Map;for(let a=0;a<t.h;a++){let u=new Map;for(let l=0;l<t.w;){if(!o[a*t.w+l]){l++;continue}let c=l;for(;c<t.w&&o[a*t.w+c];)c++;let f=l+","+c,m=s.get(f);if(m)m.h++,u.set(f,m),s.delete(f);else {let b={x:t.x+l,y:t.y+a,w:c-l,h:1};i.push(b),u.set(f,b);}l=c;}s=u;}return i}var jr=Math.fround,Gt=(e,t)=>D(e+t),ct=(e,t)=>D(e-t),Ye=(e,t)=>D(e*t),Su=(e,t)=>D(e/t),vu=11920928955078125e-23;function As(e,t){let n=ct(jr(t.x),jr(e.x)),r=ct(jr(t.y),jr(e.y)),o=Gt(Ye(r,r),Ye(n,n)),i=0;return o>0&&(i=D(Math.sqrt(o)),n=Su(n,i),r=Su(r,i)),{gx:n,gy:r,len:i}}function Gy(e,t){let n=Math.sqrt(e*e+t*t);return n<vu?0:D(n)}var ws=jr(.552284777),Oy=[[1,0],[1,ws],[ws,1],[0,1],[-ws,1],[-1,ws],[-1,0]];function Ny(e,t,n,r,o){let i=o?-t.gx:t.gx,s=o?-t.gy:t.gy,a=Gt(n,r),u=Ye(ct(n,r),.5),l=Gt(Ye(Ye(a,t.gy),.5),e.x),c=ct(e.y,Ye(Ye(a,t.gx),.5)),f=Ye(u,s),m=Ye(-u,i);return (b,h)=>({x:Gt(ct(Ye(b,f),Ye(h,m)),l),y:Gt(Gt(Ye(h,f),Ye(b,m)),c)})}function P0(e,t,n,r,o){let i=Ny(e,t,n,r,o),s=[];for(let a of [.5,-0.5])for(let[u,l]of Oy)s.push(i(Gt(Ye(u,.5),a),Ye(l,.5)));return s}function R0(e,t,n){return n<0?{x:Gt(e.x,Ye(-n,t.gy)),y:Gt(e.y,Ye(-n,-t.gx))}:{x:ct(e.x,Ye(n,t.gy)),y:ct(e.y,Ye(n,-t.gx))}}function T0(e,t,n,r){let o=e.length;if(o<2||n.length===0)return [];let i=0;for(let y of n)i=Gt(i,y);if(!(i>0))return [];let s=jr(r%i);s<0&&(s=Gt(s,i));let a=0;for(let y=0;y<1e6;y++){let g=n[a%n.length];if(g>s){s=ct(g,s);break}s=ct(s,g),a++;}let u=a%2===0,l=a+1,c=[0];for(let y=1;y<o;y++)c.push(As(e[y-1],e[y]).len);let f,m,b;(f=e[o-1],m=0,b=Gy(ct(e[0].x,f.x),ct(e[0].y,f.y)));let h=s,d=[],p=null,x=(y,g)=>Math.abs(ct(y.x,g.x))<vu&&Math.abs(ct(y.y,g.y))<vu;for(let y=0;m<o&&y<1e7;y++){let g=e[m];if(h>b)h=ct(h,b),u&&(x(f,g)?(p&&p.length>1&&d.push(p),p=null):(p??(p=[f]),p.push(g))),f=g,m++,m<o&&(b=c[m]);else {let M=Su(h,b),E={x:Gt(Ye(ct(g.x,f.x),M),f.x),y:Gt(Ye(ct(g.y,f.y),M),f.y)};b=ct(b,h),u&&(x(f,E)?p&&p.length>1&&d.push(p):(p??(p=[f]),p.push(E),d.push(p)),p=null),f=E,h=n[l%n.length],l++,u=!u;}}return u&&p&&p.length>1&&d.push(p),d}function Go(e,t,n,r){let o=[];if(!(t>0)||r===0)return o;let i=Math.max(1,Math.ceil(Math.abs(r)/(Math.PI/2)-1e-9)),s=[];for(let a=0;a<i;a++)s.push(...rr(e.x,e.y,t,t,n+r*a/i,r/i));for(let[a,u,l,c]of s){let f=[];jt([Ge(a.x),Ge(a.y),Ge(u.x),Ge(u.y),Ge(l.x),Ge(l.y),Ge(c.x),Ge(c.y)],f);for(let m=0;m+1<f.length;m+=2)o.push({x:f[m]/16,y:f[m+1]/16});}return o}function w0(e,t){let n=[];for(let r=0;r+1<e.length;r+=2){let o={x:e[r],y:e[r+1]},i=n[n.length-1];(!i||Math.abs(i.x-o.x)>1e-9||Math.abs(i.y-o.y)>1e-9)&&n.push(o);}if(t&&n.length>1){let r=n[0],o=n[n.length-1];Math.abs(r.x-o.x)<=1e-9&&Math.abs(r.y-o.y)<=1e-9&&n.pop();}return n}var Wy=.99;function Vr(e,t){let n=Math.hypot(t.x-e.x,t.y-e.y),r=(t.x-e.x)/n,o=(t.y-e.y)/n;return {ux:r,uy:o,nx:-o,ny:r}}function D0(e,t,n,r,o,i=false){let s={x:e.x+t.nx*r,y:e.y+t.ny*r},a={x:e.x+n.nx*r,y:e.y+n.ny*r};if(r===0)return [e];let u=t.ux*n.uy-t.uy*n.ux;if(Math.abs(u)<1e-12&&t.ux*n.ux+t.uy*n.uy>0)return [a];let l=u*r<0;if(!l&&i){let d=t.ux*n.uy-t.uy*n.ux,p=((a.x-s.x)*n.uy-(a.y-s.y)*n.ux)/d;return [{x:s.x+t.ux*p,y:s.y+t.uy*p}]}if(o.join===2&&t.ux*n.ux+t.uy*n.uy>Wy)return [s];if(!l)return [s,a];if(o.join===2){let d=Math.atan2(s.y-e.y,s.x-e.x),p=Math.atan2(a.y-e.y,a.x-e.x)-d;for(;p>Math.PI;)p-=2*Math.PI;for(;p<-Math.PI;)p+=2*Math.PI;return [s,...Go(e,Math.abs(r),d,p),a]}if(o.join===1)return [s,a];let c=t.ux*n.uy-t.uy*n.ux,f=((a.x-s.x)*n.uy-(a.y-s.y)*n.ux)/c,m={x:s.x+t.ux*f,y:s.y+t.uy*f},b=Math.hypot(m.x-e.x,m.y-e.y),h=o.miterLimit*o.half;if(b<=h)return [m];if(o.join===3){let d=(p,x)=>{let y=x.x-p.x,g=x.y-p.y,M=p.x-e.x,E=p.y-e.y,P=y*y+g*g,R=M*y+E*g,T=M*M+E*E-h*h,w=Math.max(0,R*R-P*T),A=P===0?0:(-R+Math.sqrt(w))/P;return {x:p.x+y*A,y:p.y+g*A}};return [d(s,m),d(a,m)]}return [s,a]}function A0(e,t,n,r,o,i,s=false){let a=(c,f)=>({x:e.x+t.nx*c+t.ux*f,y:e.y+t.ny*c+t.uy*f}),u=o&15;switch(o===17?1:o===18?2:o===19||o===20?3:o>=16?0:u){case 1:return [a(r,i),a(n,i)];case 2:{if(s){let d=Math.abs(r-n)/4,p=Math.atan2(t.ny,t.nx),x=(n+r)/2,y=(r+x)/2,g=(n+x)/2;return [a(r,0),...Go(a(y,0),d,p,-Math.PI),a(x,0),...Go(a(g,0),d,p,-Math.PI),a(n,0)]}let c=(n+r)/2,f=Math.abs(r-n)/2,m=Math.abs(c)>1e-9?a(c,0):e,b=Math.atan2(t.ny,t.nx)+(r<c?Math.PI:0),h=r>c?-Math.PI:Math.PI;return [a(r,0),...Go(m,f,b,h),a(n,0)]}case 3:return s?[a(r,0),a(n,0)]:Math.abs(n+r)>1e-9?[a(r,0),a(n,0)]:[a(r,0),a((n+r)/2,i),a(n,0)];default:return [a(r,0),a(n,0)]}}function Is(e,t,n,r){let o=e.length,i=[],s=t?o:o-1,a=Array.from({length:s},(u,l)=>Vr(e[l],e[(l+1)%o]));for(let u=0;u<o;u++){let l=u-1>=0?u-1:t?s-1:-1,c=u<s?u:-1;if(l>=0&&c>=0)i.push(...D0(e[u],a[l],a[c],n,r,t&&!!r.compound));else {let f=a[c>=0?c:l];i.push({x:e[u].x+f.nx*n,y:e[u].y+f.ny*n});}}return i}function Hy(e,t,n,r){let o=n.dashCapWidth??2*n.half,i=n.dashCap!==0?o:0,s=n.dash.map((g,M)=>M%2===0?Math.max(g-i,Xy*o):g+i),a=s.reduce((g,M)=>g+M,0),u=[];if(!(a>0))return u;let l=t?[e[e.length-1],...e]:e,c=((n.dashOffset-(t?i:0))%a+a)%a,f=0;for(;c>=s[f];)c-=s[f],f=(f+1)%s.length;let m=s[f]-c,b=f%2===0,h=b?[l[0]]:null,d=b,p=n.dashMetric,x=l.slice(1).map((g,M)=>{let E=g.x-l[M].x,P=g.y-l[M].y;return p?Math.hypot(p[0]*E+p[2]*P,p[1]*E+p[3]*P):Math.hypot(E,P)}),y=g=>x.slice(g+1).reduce((M,E)=>M+E,0);for(let g=0;g+1<l.length;g++){let M=l[g],E=l[g+1],P=x[g],R=0;for(;P-R>m+1e-9;){R+=m;let T={x:M.x+(E.x-M.x)*R/P,y:M.y+(E.y-M.y)*R/P};b&&h?(h.push(T),u.push({pts:h,first:d,last:!t&&i>0&&P-R+y(g)<=n.half+1e-9}),h=null):(h=[T],d=!t&&i>0&&u.length===0&&x.slice(0,g).reduce((w,A)=>w+A,0)+R<=n.half+1e-9),b=!b,f=(f+1)%s.length,m=s[f];}m-=P-R,b&&h&&(h.push(E),r&&g+2<l.length&&r.some(T=>Math.abs(T.x-E.x)<1e-6&&Math.abs(T.y-E.y)<1e-6)&&(u.push({pts:h,first:d,last:false}),h=[E],d=false)),P=0;}return b&&h&&h.length>1&&u.push({pts:h,first:d,last:true}),u.filter(g=>g.pts.length>1)}function $y(e,t){let n=D(t.dashCapWidth??2*t.half),r=D(Math.fround(.001)*n),o=t.dash.map((s,a)=>{let u=D(s);if(a%2===1)return D(u+n);let l=D(u-n);return r>l?r:l}),i=[];for(let s=0;s+1<e.length;s+=2)i.push({x:Math.fround(e[s]),y:Math.fround(e[s+1])});return i.length>1&&i[0].x===i[i.length-1].x&&i[0].y===i[i.length-1].y&&i.pop(),T0(i,true,o,D(D(t.dashOffset)-n)).map(s=>({pts:s,first:false,last:false}))}function I0(e,t,n,r,o){let i=P0({x:Math.fround(e.x),y:Math.fround(e.y)},t,r,n,o),s=[i[0]];for(let[a,u,l,c]of [[0,1,2,3],[3,4,5,6],[7,8,9,10],[10,11,12,13]]){let f=[];jt([a,u,l,c].flatMap(m=>[Ge(i[m].x),Ge(i[m].y)]),f);for(let m=0;m+1<f.length;m+=2)s.push({x:f[m]/16,y:f[m+1]/16});}return s.reverse()}var S0=20;function v0(e,t,n,r){let o=t?e[e.length-1]:e[0],i=t?e[e.length-2]:e[1],s=Vr(i,o),a=(l,c)=>({x:o.x+s.ux*l+s.nx*c,y:o.y+s.uy*l+s.ny*c});if(r===18)return Go(o,2*n,Math.atan2(s.uy,s.ux),2*Math.PI);if(r===19)return [a(-2*n,0),a(0,-2*n),a(2*n,0),a(0,2*n)];let u=Math.SQRT2*n;return [a(-u,-u),a(u,-u),a(u,u),a(-u,u)]}function C0(e,t,n){let r=2*n,o=t?e[e.length-1]:e[0],i=t?e[e.length-2]:e[1],s=Math.hypot(i.x-o.x,i.y-o.y),a=(i.x-o.x)/s,u=(i.y-o.y)/s,l=2*r,c=2*r/Math.sqrt(3),f={x:o.x+a*l,y:o.y+u*l};return s>l&&(t?e[e.length-1]=f:e[0]=f),[o,{x:f.x-u*c,y:f.y+a*c},{x:f.x+u*c,y:f.y-a*c}]}var Xy=.001;function Yr(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n],o=e[(n+1)%e.length];t+=r.x*o.y-o.x*r.y;}return t/2}function jy(e,t){let n=false;for(let r=0,o=e.length-1;r<e.length;o=r++){let i=e[r],s=e[o];i.y>t.y!=s.y>t.y&&t.x<(s.x-i.x)*(t.y-i.y)/(s.y-i.y)+i.x&&(n=!n);}return n}function Yy(e,t){let n=Yr(e)>0?1:-1,r=e.length,o=Array.from({length:r},(s,a)=>Vr(e[a],e[(a+1)%r])),i=e.map((s,a)=>{let u=o[(a+r-1)%r],l=o[a],c=u.nx*n,f=u.ny*n,m=l.nx*n,b=l.ny*n,h=1+c*m+f*b;return h<1e-9?{x:s.x+c*t,y:s.y+f*t}:{x:s.x+(c+m)*t/h,y:s.y+(f+b)*t/h}});return Math.sign(Yr(i))!==n||i.some(s=>!jy(e,s))}function Vy(e,t,n){let r=Yr(e)>0?1:-1,o=e.length,i=Array.from({length:o},(a,u)=>Vr(e[u],e[(u+1)%o])),s=[];for(let a=0;a<o;a++){let u=i[(a+o-1)%o],l=i[a],c=r*t;if((u.ux*l.uy-u.uy*l.ux)*c<0)s.push(...D0(e[a],u,l,c,n));else {let m=u.nx*r,b=u.ny*r,h=l.nx*r,d=l.ny*r,p=1+m*h+b*d;s.push(p<1e-9?{x:e[a].x+m*t,y:e[a].y+b*t}:{x:e[a].x+(m+h)*t/p,y:e[a].y+(b+d)*t/p});}}return s}function Xn(e,t){let n=[],r=t.half;for(let o of e){let i=w0(o.pts,o.closed);if(i.length<2)continue;let s=o.closed&&i.length>2,a=-r,u=r;if(t.inset&&s&&!t.dash&&!t.compound){n.push(i.slice()),Yy(i,2*r)||n.push(Vy(i,2*r,t).reverse());continue}t.inset&&s&&(Yr(i)>0?(a=0,u=2*r):(a=-2*r,u=0));let l=[],c=t.compound;if(c&&c.length>=2)for(let d=0;d+1<c.length;d+=2)l.push([a+(u-a)*c[d],a+(u-a)*c[d+1]]);else l.push([a,u]);let f=t.inset&&s?{...t,dashOffset:t.dashOffset*2}:t,m=!!t.dash&&!!t.doubleRoundCap&&t.dashCap===2&&s,b=m?$y(o.pts,t):t.dash?Hy(i,s,f,o.splits):[{pts:i,first:true,last:true}],h=!t.dash&&s;for(let d of b){let p=w0(d.pts.flatMap(M=>[M.x,M.y]),false);if(p.length<2)continue;let x=[],y=null,g=null;!h&&!(t.dash&&s)&&(d.first&&t.startCap>=17&&t.startCap<=19&&(x.push(v0(p,false,r,t.startCap)),y=0),d.last&&t.endCap>=17&&t.endCap<=19&&(x.push(v0(p,true,r,t.endCap)),g=0),d.first&&t.startCap===S0&&(x.push(C0(p,false,r)),y=0),d.last&&t.endCap===S0&&(x.push(C0(p,true,r)),g=0));for(let[M,E]of l){if(h){n.push(Is(p,true,E,t)),n.push(Is(p,true,M,t).reverse());continue}let P=Is(p,false,E,t),R=Is(p,false,M,t).reverse(),T=Vr(p[p.length-2],p[p.length-1]),w=Vr(p[1],p[0]),A=g??(d.last&&!(t.dash&&s)?t.endCap:t.dashCap),I=y??(d.first&&!(t.dash&&s)?t.startCap:t.dashCap),S=m?As(p[p.length-2],p[p.length-1]):null,v=m?As(p[0],p[1]):null,C=S?I0(p[p.length-1],S,M,E,false):A0(p[p.length-1],T,M,E,A,r,t.doubleRoundCap),U=v?I0(p[0],v,M,E,true):A0(p[0],w,-E,-M,I,r,t.doubleRoundCap);if(v&&(P[0]=R0(p[0],v,E)),A===0&&C.length===2&&P.length>2&&R.length>2){let F=(G,W)=>(G.x-W.x)*T.ux+(G.y-W.y)*T.uy<-1e-9,_=P[P.length-2],H=R[1];F(C[0],_)&&(C[0]={x:_.x,y:_.y}),F(C[1],H)&&(C[1]={x:H.x,y:H.y});}let L=[...P.slice(I===1?1:0,-1),...C,...R.slice(1,-1),...U];n.push(L);let k=Math.sign(Yr(L));for(let F of x)n.push(Math.sign(Yr(F))===k?F:F.slice().reverse());}}}return n}var zy=1,qy=2,Qt=11920928955078125e-23,oe=Math.fround;function Cu(e,t){let n=e.length;if(n<2)return 0;let o=(t[n-1]&128)!==0?e[n-1]:e[0],i=0;for(let s=0;s<n;s++){let a=e[s],u=oe(o.x-a.x);if(Math.abs(u)>=Qt){let l=oe(-a.x/u);if(!(l<-Qt)&&!(oe(l-1)>Qt)){let c=oe(oe(oe(o.y-a.y)*l)+a.y);i=Math.min(i,c);}}o=a;}return i<0?-i:0}function Jy(e,t,n,r){let o=oe(t),i=oe(oe(e)*.5),s=[{x:i,y:-o},{x:0,y:0},{x:-i,y:-o}];r&&n!==0&&s.push({x:0,y:oe(oe(n)-o)});let a=new Uint8Array(s.length);return a.fill(1),a[0]=0,r&&(a[s.length-1]|=128),{kind:"plus-path",points:s,types:a,fillRule:"nonzero"}}function F0(e,t,n){let r=t+n;if(n<8||r>e.byteLength)return null;let o=e.getInt32(t+4,true),i=t+8,s=b=>e.getFloat32(i+b,true),a=b=>e.getUint32(i+b,true);if(o===1){if(i+52>r)return null;let b=s(0),h=s(4),d=s(8),p=a(12)!==0,x=Jy(b,h,d,p),y=Cu(x.points,x.types);return {kind:"plus-customlinecap",capType:1,baseCap:0,baseInset:b!==0?oe(h/b):0,strokeStartCap:a(16),strokeEndCap:a(20),strokeJoin:a(24),strokeMiterLimit:s(28),widthScale:s(32),fillPath:p?x:null,linePath:p?null:x,fillLength:p?y:0,strokeLength:p?0:y,arrow:{width:b,height:h,middleInset:d,filled:p}}}if(o!==0||i+48>r)return null;let u=a(0),l=i+48,c=()=>{if(l+4>r)return null;let b=e.getInt32(l,true);if(l+=4,b<=0||l+b>r)return null;let h=nr(e,l,b);return l+=b,h},f=u&zy?c():null,m=u&qy?c():null;return {kind:"plus-customlinecap",capType:0,baseCap:a(4),baseInset:s(8),strokeStartCap:a(12),strokeEndCap:a(16),strokeJoin:a(20),strokeMiterLimit:s(24),widthScale:s(28),fillPath:f,linePath:m,fillLength:f?Cu(f.points,f.types):0,strokeLength:m?Cu(m.points,m.types):0}}function Ky(e,t,n,r){let o=oe(r.x-n.x),i=oe(r.y-n.y),s=Math.sqrt(oe(oe(o*o)+oe(i*i)));if(s<Qt)return null;let a=oe(1/s),u=oe(o*a),l=oe(i*a),c=oe(e.x-n.x),f=oe(e.y-n.y),m=oe(oe(f*f)+oe(c*c)),b=oe(oe(f*l)+oe(c*u));if(b<Qt&&m>=t)return null;let h=t-m+b*b;if(h<Qt)return null;let d=Math.sqrt(h),p=null;if(m>=t){let y=b-d;y>Qt&&y>=0&&(p=y);}if(p===null){let y=d+b;y>Qt&&y>=0&&(p=y);}if(p===null)return null;let x=oe(p);return {x:oe(oe(x*u)+n.x),y:oe(oe(x*l)+n.y)}}function Zy(e,t,n,r,o){let i=e.length,s=g=>n?i-1-g:g,a={...e[s(0)]},u=0,l=false,c=false,f=s(0);for(;u<i;){let g=e[s(u)];f=s(u);let M=oe(g.x-a.x),E=oe(g.y-a.y);if(oe(oe(M*M)+oe(E*E))>r){l=true;break}c=t[s(u)],t[s(u)]=true,u++;}let m=s(Math.max(0,u-1));l&&!c&&(t[m]=false);let b=e[m],h=Ky(a,r,e[f],b)??{x:b.x,y:b.y},d=oe(h.x-a.x),p=oe(h.y-a.y),x=Math.sqrt(d*d+p*p);x>Qt?(d=oe(d/x),p=oe(p/x)):(d=0,p=0);let y=oe(1-o);return e[m]={x:oe(oe(oe(a.x-h.x)*y)+h.x),y:oe(oe(oe(a.y-h.y)*y)+h.y)},{x:d,y:p}}function L0(e,t,n,r){let o=oe(n.y*r),i=oe(-n.x*r),s=oe(n.x*r),a=oe(n.y*r),u=e.points.map(l=>({x:oe(oe(oe(o*l.x)+oe(s*l.y))+t.x),y:oe(oe(oe(i*l.x)+oe(a*l.y))+t.y)}));return {...e,points:u}}function U0(e,t){let n=En(r=>{let o=e.points,i=e.types,s=0;for(;s<o.length;){let a=i[s]&7;if(a===0||s===0)r.moveTo(o[s].x,o[s].y),s++;else if(a===3&&s+2<o.length){r.bezierCurveTo(o[s].x,o[s].y,o[s+1].x,o[s+1].y,o[s+2].x,o[s+2].y),s+=3,i[s-1]&128&&r.closePath();continue}else r.lineTo(o[s].x,o[s].y),s++;i[s-1]&128&&r.closePath();}},[1,0,0,1,0,0]);return t?n.map(r=>({...r,closed:true})):n}function k0(e,t,n,r,o={}){let i=[],s=[],a=[],u=o.minFillScale??2;for(let l of e){if(l.closed||!n&&!r){i.push(l),s.push({start:false,end:false});continue}let c=[];for(let p=0;p+1<l.pts.length;p+=2)c.push({x:l.pts[p],y:l.pts[p+1]});if(c.length<2){i.push(l),s.push({start:false,end:false});continue}let f=new Array(c.length).fill(false),m={...c[0]},b={...c[c.length-1]},h=(p,x,y)=>{let g=y?p.fillPath:p.linePath;if(!g||g.points.length===0)return;let M=oe(p.widthScale*t),E,P;y?(E=p.fillLength,P=Math.max(M,1)):(E=Math.abs(p.strokeLength)<Qt?1:p.strokeLength,P=M);let R=y&&Math.abs(E)<Qt?0:oe(p.baseInset/E),T=oe(E*P),w=Zy(c,f,x,oe(T*T),R),A={x:-w.x,y:-w.y},I=x?b:m;if(y){let S=L0(g,I,A,Math.max(P,u));for(let v of U0(S,true)){let C=[];for(let U=0;U+1<v.pts.length;U+=2)C.push({x:v.pts[U],y:v.pts[U+1]});a.push(C);}}else {let S=L0(g,I,A,P),v={half:Math.max(M,1)/2,join:(o.widenJoin??(C=>C))(p.strokeJoin),miterLimit:10,startCap:p.strokeStartCap,endCap:p.strokeEndCap,dashCap:0,dash:null,dashOffset:0,compound:null,inset:false};a.push(...(o.widen??Xn)(U0(S,false),v).map(C=>C.reverse()));}};n&&h(n,false,true),r&&h(r,true,true),n&&h(n,false,false),r&&h(r,true,false);let d=[];c.forEach((p,x)=>{f[x]||d.push(p.x,p.y);}),d.length>=4&&(i.push({pts:d,closed:false,curved:l.curved}),s.push({start:!!n,end:!!r}));}return {figures:i,capped:s,polygons:a}}var _0=1,B0=2,G0=4,O0=8,N0=16,Du=32,W0=64,H0=128,$0=256,X0=512,j0=1024,Lu=2048,Y0=4096,Oo=1024;function V0(e,t,n,r,o=t){if(n<20)return null;let i=t+n,s=Xr(e.getUint32(t,true)),a=e.getUint32(t+(s?8:4),true),u=e.getFloat32(t+16,true),l=t+20,c=()=>{if(l+4>i)return;let b=e.getUint32(l,true);return l+=4,b},f=()=>{if(l+4>i)return;let b=e.getFloat32(l,true);return l+=4,b},m={kind:"plus-pen",color:"rgba(0,0,0,1)",width:u,dashStyle:0};if(s&&(m.unit=e.getUint32(t+12,true)),a&_0&&(l+24<=i&&(m.transform=[0,4,8,12,16,20].map(b=>e.getFloat32(l+b,true))),l+=24),a&B0&&(m.startCap=c()),a&G0&&(m.endCap=c()),a&O0&&(m.lineJoin=c()),a&N0&&(m.miterLimit=f()),a&Du&&(m.dashStyle=c()??0),a&W0&&(m.dashCap=c()),a&H0&&(m.dashOffset=f()),a&$0){let b=c()??0;b>0&&b<=Oo&&l+b*4<=i&&(m.dashPattern=Array.from({length:b},(h,d)=>e.getFloat32(l+d*4,true)),a&Du||(m.dashStyle=5)),l+=Math.min(b,Oo)*4;}if(a&X0&&(m.alignment=c()),a&j0){let b=c()??0;b>=2&&b<=Oo&&l+b*4<=i&&(m.compound=Array.from({length:b},(h,d)=>e.getFloat32(l+d*4,true))),l+=Math.min(b,Oo)*4;}for(let b of [Lu,Y0])if(a&b){let h=c()??0,d=l+h<=i?F0(e,l,h):null;b===Lu?m.customStartCap=d:m.customEndCap=d,l+=h;}if(l+8<=i){let b=Rs(e,l,i-l,r,o);b&&(m.color=b.color,m.brush=b);}return m}function z0(e,t,n){if(n<20)return null;let r=t+n,o=Xr(e.getUint32(t,true)),i=e.getUint32(t+(o?8:4),true),s=t+20,a=()=>{let u=s+4<=r?e.getUint32(s,true):0;s+=4+Math.min(u,Oo)*4;};i&_0&&(s+=24);for(let u of [B0,G0,O0,N0,Du,W0,H0])i&u&&(s+=4);i&$0&&a(),i&X0&&(s+=4),i&j0&&a();for(let u of [Lu,Y0])if(i&u){let l=s+4<=r?e.getUint32(s,true):0;s+=4+l;}return s+8<=r?s:null}function Ss(e,t,n,r){let o=null,i=e.getUint32(t+4,true);if(chunkI7XOR2GO_js.q(`replayEmfPlusRecords: OBJECT Image id=${r}, imgType=${{1:"Bitmap",2:"Metafile"}[i]??`Unknown(${i})`}, recDataSize=${n}`),i===1&&n>=28){let a=e.getUint32(t+24,true);if(a===0){let u=e.getInt32(t+8,true),l=e.getInt32(t+12,true),c=e.getInt32(t+16,true),f=e.getUint32(t+20,true);chunkI7XOR2GO_js.q(` Bitmap(Pixel): ${u}\xD7${l}, stride=${c}, pixelFormat=0x${f.toString(16).padStart(8,"0")}`);let m=t+28,b=Math.abs(c);if(u>0&&l>0&&u<=8192&&l<=8192&&m+b*l<=e.byteLength){let h=zf(e,m,u,l,c,f);h?(chunkI7XOR2GO_js.q(` Bitmap(Pixel): decoded successfully, size=${h.byteLength} bytes`),o=h):chunkI7XOR2GO_js.r(" Bitmap(Pixel): decodeEmfPlusBitmapPixels returned null");}}else if(a===1){let u=t+28,l=n-28;if(chunkI7XOR2GO_js.q(` Bitmap(Compressed): imgLen=${l}, imgStart=0x${u.toString(16)}`),l>0&&u+l<=e.byteLength){if(o=e.buffer.slice(e.byteOffset+u,e.byteOffset+u+l),o.byteLength>=4){let c=new Uint8Array(o,0,4);chunkI7XOR2GO_js.q(` Bitmap(Compressed): first 4 bytes = [${Array.from(c).map(f=>f.toString(16).padStart(2,"0")).join(" ")}]`);}}else chunkI7XOR2GO_js.r(" Bitmap(Compressed): out of bounds or empty");}else chunkI7XOR2GO_js.r(` Bitmap: unrecognised BitmapDataType ${a}`);}else if(i===2&&n>=12){let a=e.getUint32(t+8,true),u=e.getUint32(t+12,true);chunkI7XOR2GO_js.q(` Metafile: type=${{1:"WMF",2:"WMF+Placeable",3:"EMF",4:"EMF+Only",5:"EMF+Dual"}[a]??`Unknown(${a})`}, mfDataSize=${u}`);let c=t+16;if(u>0&&c+u<=e.byteLength){if(o=e.buffer.slice(e.byteOffset+c,e.byteOffset+c+u),o.byteLength>=4){let m=new DataView(o).getUint32(0,true);chunkI7XOR2GO_js.q(` Metafile: first 4 bytes recType=${m} (1=EMR_HEADER)`);}}else chunkI7XOR2GO_js.r(` Metafile: out of bounds or empty (mfStart=0x${c.toString(16)}, mfDataSize=${u}, viewLen=${e.byteLength})`);}return {data:o,type:i}}function q0(e,t,n){if(n<28)return null;let r=e.getFloat32(t+4,true),o=e.getUint32(t+8,true),i=e.getInt32(t+12,true),s=e.getUint32(t+20,true),a="sans-serif";return s>0&&t+24+s*2<=t+n&&(a=chunkI7XOR2GO_js.ga(e,t+24,s)||"sans-serif"),{kind:"plus-font",emSize:r||12,flags:i,family:a,unit:o}}var Qy=64*1024*1024;function vs(){return {continuationBuffer:null,continuationObjectId:-1,continuationObjectType:0,continuationTotalSize:0,continuationOffset:0,continuationKey:void 0}}function J0(e){e.continuationBuffer=null,e.continuationObjectId=-1,e.continuationObjectType=0,e.continuationTotalSize=0,e.continuationOffset=0,e.continuationKey=void 0;}function eg(e,t,n,r){let o=e.continuationBuffer;if(!o)return;let i=n,s=r;s>=4&&t.getUint32(n,true)===e.continuationTotalSize&&(i+=4,s-=4);let a=Math.max(0,Math.min(s,e.continuationTotalSize-e.continuationOffset));o.set(new Uint8Array(t.buffer,t.byteOffset+i,a),e.continuationOffset),e.continuationOffset+=a;}function tg(e,t){let n=e.continuationBuffer,r=n?{view:new DataView(n.buffer,n.byteOffset,n.byteLength),flags:e.continuationObjectType<<8|t,dataOff:0,dataSize:e.continuationTotalSize,cacheKey:e.continuationKey??-1}:null;return J0(e),r}function Cs(e,t,n,r,o){let i=(n&32768)!==0,s=n&255,a=e.continuationBuffer!==null&&s===e.continuationObjectId;if(!i&&!a)return {view:t,flags:n,dataOff:r,dataSize:o,cacheKey:r};if(i&&!a){if(e.continuationBuffer!==null&&chunkI7XOR2GO_js.r(`EMFPLUS_OBJECT continuation: object ${e.continuationObjectId} never completed, dropping it`),J0(e),o<4)return null;let u=t.getUint32(r,true),l=t.byteLength-r;if(u<=0||u>Qy||u>l)return chunkI7XOR2GO_js.r(`EMFPLUS_OBJECT continuation: rejecting invalid totalObjectSize=${u} (remaining=${l}, recDataSize=${o})`),null;e.continuationBuffer=new Uint8Array(u),e.continuationObjectId=s,e.continuationObjectType=n>>8&127,e.continuationTotalSize=u,e.continuationOffset=0,e.continuationKey=r;}return eg(e,t,r,o),!i||e.continuationOffset>=e.continuationTotalSize?tg(e,s):null}var $o=5e5;function ng(e,t){let n=e.flags>>8&127;if(n!==1&&n!==2||e.dataSize<8)return;let{view:r}=e,o=e.dataOff+e.dataSize,i=e.dataOff;if(n===2){let c=z0(r,e.dataOff,e.dataSize);if(c===null)return;i=c;}let s=Xr(r.getUint32(i,true)),a=i+(s?4:0);if(a+8>o||r.getUint32(a,true)!==2)return;let u=f0(r,a+4,o);if(u===null)return;let l=m0(r,u,o);l&&t.push({key:e.cacheKey,view:r,byteStart:l.start,byteEnd:l.end});}function rg(e,t,n,r,o,i){let s=t+n,a=t,u=0;for(;a+12<=s&&u<$o;){let l=e.getUint16(a,true),c=e.getUint16(a+2,true),f=e.getUint32(a+4,true),m=e.getUint32(a+8,true);if(f<12||a+f>s)break;if(u++,i&&m<=f-12&&i.plus(l,a+12,m),l===16392){let b=Cs(r,e,c,a+12,m);b&&o(b);}a+=f;}}function Xo(e,t,n){let r=vs(),o=0,i=e.byteLength,s=0;for(;o+8<=i&&s<$o;){let a=e.getUint32(o,true),u=e.getUint32(o+4,true);if(u<8||o+u>i)break;if(s++,n?.emf(a,o+8,u),a===70&&u>=16){let l=o+8,c=e.getUint32(l,true);e.getUint32(l+4,true)===726027589&&c>4&&rg(e,l+8,c-4,r,t,n);}else if(a===14)break;o+=u;}}function og(e){let t=[];return Xo(e,n=>ng(n,t)),t}async function ku(e,t,n){let r=n-t;if(r<=0)return null;let o=new Uint8Array(e.buffer,e.byteOffset+t,r),i=new ArrayBuffer(r);new Uint8Array(i).set(o);try{let s=await chunkI7XOR2GO_js.ia(i);if(!s)return null;let{width:a,height:u}=s;if(a<=0||u<=0||a>8192||u>8192)return s.close(),null;let l=chunkI7XOR2GO_js.Z(a,u);if(!l)return s.close(),null;chunkI7XOR2GO_js.ka(l.ctx,s.drawable,0,0,a,u),s.close();let c=chunkI7XOR2GO_js.la(l.ctx,0,0,a,u);return {width:a,height:u,rgba:new Uint8ClampedArray(c.data.buffer.slice(0))}}catch(s){return chunkI7XOR2GO_js.r("preDecodeEmfPlusTextures: failed to decode a compressed texture image:",s instanceof Error?s.message:s),null}}async function Ls(e){let t=new Map,n;try{n=og(e);}catch(r){return chunkI7XOR2GO_js.r("preDecodeEmfPlusTextures: scan failed:",r instanceof Error?r.message:r),t}if(n.length===0)return t;chunkI7XOR2GO_js.q(`preDecodeEmfPlusTextures: found ${n.length} compressed-texture candidate(s)`);for(let r of n){let o=await ku(r.view,r.byteStart,r.byteEnd);o&&(t.set(r.key,o),chunkI7XOR2GO_js.q(`preDecodeEmfPlusTextures: decoded texture for key=0x${r.key.toString(16)}: ${o.width}x${o.height}`));}return t}var nb=1,rb=2,Us=24,ig={flags:0,illuminant:0,redGamma:1e4,greenGamma:1e4,blueGamma:1e4,referenceBlack:0,referenceWhite:1e4,contrast:0,brightness:0,colorfulness:0,redGreenTint:0},K0=new Map;function ob(e){let t=K0.get(e);if(t===void 0){let n=kf(e);if(t=null,n){let r=Uint8Array.from(atob(n),i=>i.charCodeAt(0)),o=chunkOB5ODU4B_js.b(r);t=new Uint8Array(32768*3);for(let i=0;i<3;i++)for(let s=0;s<32768;s++){let a=s&31?t[(s-1)*3+i]:0;t[s*3+i]=a+o[i*32768+s]&255;}}K0.set(e,t);}return t}var sg={1:[[1.64737,-0.59174,-0.05494],[.02963,.96126,.00881],[.2911,.40189,.30769]],2:[[1.22319,-0.17765,-0.04515],[.00275,.99054,.00645],[.05514,.12795,.81816]],3:[[1.02833,-0.01775,-0.01086],[.00861,.98431,.00728],[-0.01616,-0.0448,1.05995]],4:[[1.17271,-0.14059,-0.03174],[-474e-5,1.00266,.00183],[.05783,.14663,.79683]],5:[[1.10431,-0.08327,-0.02067],[-336e-5,1.0025,67e-5],[.03344,.09072,.87702]],7:[[.92515,.05628,.01822],[.00318,.9967,34e-5],[-0.02086,-0.06817,1.08783]],8:[[1.31275,-0.26259,-0.04977],[-244e-5,.99695,.00524],[.10854,.23443,.65827]]};function ib(e){return ob(e.illuminant)!==null}var or=Array.from({length:32},(e,t)=>Math.round(t*255/31));function ag(e){let t=Math.round(e*31/255);return or[t]===e?255*t/31:e}function _u(e){let t=hg(e)*255,n=Math.min(30,Math.floor(t*31/255));for(;n<30&&t>=or[n+1];)n++;for(;n>0&&t<or[n];)n--;return n+Math.min(1,Math.max(0,(t-or[n])/(or[n+1]-or[n])))}function ug(e,t,n,r){let o=_u(t),i=_u(n),s=_u(r),a=Math.min(30,Math.floor(o)),u=Math.min(30,Math.floor(i)),l=Math.min(30,Math.floor(s)),c=o-a,f=i-u,m=s-l,b=[0,0,0];for(let h=0;h<3;h++){let d=0;for(let p=0;p<8;p++){let x=p&1,y=p>>1&1,g=p>>2&1,M=(x?c:1-c)*(y?f:1-f)*(g?m:1-m);M!==0&&(d+=M*e[(((a+x)*32+u+y)*32+l+g)*3+h]);}b[h]=d/255;}return b}function sb(e){return !!e&&!ib(e)&&e.colorfulness===0&&e.redGreenTint===0}function Fs(e,t){let n={flags:e.getUint16(t+2,true),illuminant:e.getUint16(t+4,true),redGamma:e.getUint16(t+6,true),greenGamma:e.getUint16(t+8,true),blueGamma:e.getUint16(t+10,true),referenceBlack:e.getUint16(t+12,true),referenceWhite:e.getUint16(t+14,true),contrast:e.getInt16(t+16,true),brightness:e.getInt16(t+18,true),colorfulness:e.getInt16(t+20,true),redGreenTint:e.getInt16(t+22,true)},r=(i,s,a)=>i>=s&&i<=a;return (n.flags&-4)===0&&r(n.illuminant,0,8)&&r(n.redGamma,2500,65e3)&&r(n.greenGamma,2500,65e3)&&r(n.blueGamma,2500,65e3)&&r(n.referenceBlack,0,4e3)&&r(n.referenceWhite,6e3,1e4)&&r(n.contrast,-100,100)&&r(n.brightness,-100,100)&&r(n.colorfulness,-100,100)&&r(n.redGreenTint,-100,100)?n:null}function Gu(e){return !e||e.flags===0&&!ib(e)&&e.redGamma===1e4&&e.greenGamma===1e4&&e.blueGamma===1e4&&e.referenceBlack===0&&e.referenceWhite===1e4&&e.contrast===0&&e.brightness===0&&e.colorfulness===0&&e.redGreenTint===0}var lg=.0148885,cg=.95625,mg=1/100,fg=-Math.PI/3,en=[[.4123908,.3575843,.1804808],[.212639,.7151687,.0721923],[.0193308,.1191948,.9505322]],Pn=bg(en),jo=en.map(e=>e[0]+e[1]+e[2]),ab=jo[0]+15*jo[1]+3*jo[2],Z0=4*jo[0]/ab,Q0=9*jo[1]/ab;function bg(e){let[[t,n,r],[o,i,s],[a,u,l]]=e,c=i*l-s*u,f=s*a-o*l,m=o*u-i*a,b=t*c+n*f+r*m;return [[c/b,(r*u-n*l)/b,(n*s-r*i)/b],[f/b,(t*l-r*a)/b,(r*o-t*s)/b],[m/b,(n*a-t*u)/b,(t*i-n*o)/b]]}var hg=e=>e<0?0:e>1?1:e,ir=e=>e<0?0:e>255?255:e,eb=e=>Math.floor(e+.5+1e-7);function dg(e,t,n,r,o){let i=en[0][0]*e+en[0][1]*t+en[0][2]*n,s=en[1][0]*e+en[1][1]*t+en[1][2]*n,a=en[2][0]*e+en[2][1]*t+en[2][2]*n,u=i+15*s+3*a;if(u<=1e-9||s<=1e-9)return [ir(e),ir(t),ir(n)];let l=4*i/u-Z0,c=9*s/u-Q0,f=Math.cos(o)*r,m=Math.sin(o)*r,b=Math.max(0,Z0+l*f-c*m),h=Math.max(1e-6,Q0+l*m+c*f),d=s*9*b/(4*h),p=s*(12-3*b-20*h)/(4*h),x=[Pn[0][0]*d+Pn[0][1]*s+Pn[0][2]*p,Pn[1][0]*d+Pn[1][1]*s+Pn[1][2]*p,Pn[2][0]*d+Pn[2][1]*s+Pn[2][2]*p],y=Math.min(0,x[0],x[1],x[2]),g=Math.max(255,x[0],x[1],x[2]);if(y<0||g>255){let M=255/(g-y);return [(x[0]-y)*M,(x[1]-y)*M,(x[2]-y)*M]}return x}var tb=new Map;function pg(e){if(e.illuminant!==0&&e.illuminant!==6)return null;let t=`${e.colorfulness},${e.redGreenTint}`,n=tb.get(t);if(n===void 0){let r=_f(t);if(n=null,r){n=new Int8Array(32768*3);for(let o of r)n[o>>1]=o&1?1:-1;}tb.set(t,n);}return n}function Bu(e){let t=Math.round(e*31/255);return or[t]===e?t:-1}function xg(e){let t=Bu(e[0]),n=Bu(e[1]),r=Bu(e[2]);return t<0||n<0||r<0?-1:(t*32+n)*32+r}function yg(e,t){let n=ob(e.illuminant),r=sg[e.illuminant],o=[e.redGamma/1e4,e.greenGamma/1e4,e.blueGamma/1e4],i=e.referenceBlack/1e4*255,s=Math.max(1e-6,e.referenceWhite/1e4*255-i),a=Math.exp(lg*e.contrast),u=cg*e.brightness,l=e.colorfulness!==0||e.redGreenTint!==0,c=1+mg*e.colorfulness,f=fg*e.redGreenTint/100,m=(e.flags&rb)!==0,b=(e.flags&nb)!==0,h=l&&t?.chromaTies!==false?pg(e):null,d=(p,x)=>{let y=255*(ir(p)/255)**o[x];return y=(y-i)/s*255,y=y*a+u,m&&(y=255*Math.log2(1+7*ir(y)/255)/3),b&&(y=255-ir(y)),eb(ir(y))};if(!n&&!l){let p=[0,1,2].map(x=>Uint8Array.from({length:256},(y,g)=>d(g,x)));return x=>p[0][x>>16&255]<<16|p[1][x>>8&255]<<8|p[2][x&255]}return p=>{let x=[p>>16&255,p>>8&255,p&255];if(l){let y=h?xg(x):-1;if(x=x.map(ag),r){let[g,M,E]=x;x=r.map(P=>P[0]*g+P[1]*M+P[2]*E);}x=dg(x[0],x[1],x[2],c,f),x=x.map(eb),h&&y>=0&&(x=x.map((g,M)=>g+h[y*3+M]));}else if(n){let y=ug(n,x[0]/255,x[1]/255,x[2]/255);x=[y[0]*255,y[1]*255,y[2]*255];}return d(x[0],0)<<16|d(x[1],1)<<8|d(x[2],2)}}function ub(e){let n={...ig,illuminant:e.illuminant,colorfulness:e.colorfulness,redGreenTint:e.redGreenTint},r={...e,illuminant:0,colorfulness:0,redGreenTint:0};return {palette:Gu(n)?void 0:n,curves:Gu(r)?void 0:r}}function Ou(e,t){if(!t||Gu(t))return;let n=yg(t),r=new Map;for(let o=0;o+2<e.length;o+=3){let i=e[o]<<16|e[o+1]<<8|e[o+2],s=r.get(i);s===void 0&&(s=n(i),r.size<65536&&r.set(i,s)),e[o]=s>>16&255,e[o+1]=s>>8&255,e[o+2]=s&255;}}var gg=["johab","illuminants","chromaTies","colorCurve"];function lb(e,t){let n=new Set,r=0,o=()=>{(++r&1023)===0&&t?.budget?.check();};return {needs:n,observer:{emf(s,a,u){if(o(),s===82&&u>=332&&e.getUint8(a+27)===130)n.add("johab");else if(s===23&&u>=8+Us){let l=Fs(e,a);l&&l.illuminant!==0&&l.illuminant!==6?n.add("illuminants"):l&&(l.colorfulness!==0||l.redGreenTint!==0)&&n.add("chromaTies");}},plus(s,a,u){o(),s===16440&&!n.has("colorCurve")&&ys(e,a,u)?.kind==="colorCurve"&&n.add("colorCurve");}}}}async function $u(e,t){t?.budget?.check(),e?.size!==0&&await xu(e??gg).finally(()=>t?.budget?.check());}function*Mg(e,t,n){let r=t,o=0;for(;r+6<=e.byteLength&&o<n;){let i=e.getUint32(r,true)*2,s=e.getUint16(r+4,true);if(i<6||r+i>e.byteLength||s===0)break;if(chunkDO2CGP4P_js.c(),chunkDO2CGP4P_js.d()&&(yield),s===763&&i>=24&&e.getUint8(r+6+13)===130)return true;r+=i,o++;}return false}async function cb(e,t,n){let r=n.budget??null;await chunkDO2CGP4P_js.f(r,Mg(e,t,n.maxRecords??2e5))&&await xu(["johab"]).finally(()=>r?.check());}var Xu=3;async function ju(e,t=0,n){let r=new Map,o=[],i=lb(e,n);try{Xo(e,s=>{if((s.flags>>8&127)!==5||s.dataSize<8)return;let u=Ss(s.view,s.dataOff,s.dataSize,s.flags&255);u.data&&u.data.byteLength>0&&o.push({key:s.cacheKey,type:u.type,data:u.data});},i?.observer);}catch(s){return n?.budget?.throwIfTripped(),chunkI7XOR2GO_js.r("preDecodeEmfPlusImages: scan failed:",s instanceof Error?s.message:s),i&&await $u(null,n),r}if(i){let s=(n?.maxRecords??0)>$o&&e.byteLength>=$o*8;await $u(s?null:i.needs,n);}for(let s of o){let a=new DataView(s.data,0,s.data.byteLength);if(s.type===2){if(t>=Xu)continue;r.set(s.key,{kind:"metafile",caches:await Eg(a,t+1,n?.budget)});continue}let u=await ku(a,0,s.data.byteLength);u&&(r.set(s.key,{kind:"bitmap",...u}),chunkI7XOR2GO_js.q(`preDecodeEmfPlusImages: decoded image key=0x${s.key.toString(16)}: ${u.width}x${u.height}`));}return r}async function Eg(e,t=0,n){return {textures:await Ls(e),images:await ju(e,t,{budget:n})}}function mb(e,t,n){if(!n)return (e%t+t)%t;let r=(e%(2*t)+2*t)%(2*t);return r<t?r:2*t-1-r}function Pg(e,t,n,r,o,i,s,a){let u=Math.floor(e+1e-9),l=Math.floor(t+1e-9),c=Math.round(Math.max(0,e-u)*2048)/2048,f=Math.round(Math.max(0,t-l)*2048)/2048,m=i==="clamp",b=i==="tile-flip-x"||i==="tile-flip-xy",h=i==="tile-flip-y"||i==="tile-flip-xy",d=0,p=0,x=0,y=0;for(let g=0;g<4;g++){let M=u+(g&1),E=l+(g>>1),P=(g&1?c:1-c)*(g>>1?f:1-f);if(P<=0)continue;let R,T;if(m){if(M<0||E<0||M>=n||E>=r)continue;R=M,T=E;}else R=mb(M,n,b),T=mb(E,r,h);let w=(T*n+R)*4,A=o[w+3];d+=P*Math.round(o[w]*A/255),p+=P*Math.round(o[w+1]*A/255),x+=P*Math.round(o[w+2]*A/255),y+=P*A;}y=Math.round(y),!(y<=0)&&(s[a]=Math.round(Math.round(d)*255/y),s[a+1]=Math.round(Math.round(p)*255/y),s[a+2]=Math.round(Math.round(x)*255/y),s[a+3]=y);}function Jo(e,t=false){let[n,r,o,i,s,a]=[e[0],e[1],e[2],e[3],e[4],e[5]].map(Math.fround),u=t?D(D(D(D(.5*n)+D(.5*o))+s)-.5):s,l=t?D(D(D(D(.5*r)+D(.5*i))+a)-.5):a,c=D(D(n*i)-D(r*o));if(!Number.isFinite(c)||c===0)return null;let f=D(1/c);return [D(i*f),D(-r*f),D(-o*f),D(n*f),D(D(D(o*l)-D(i*u))*f),D(D(D(r*u)-D(n*l))*f)]}function bb(e,t,n,r,o,i,s,a,u,l,c){let f=new Float64Array(a),m=new Float64Array(a);for(let b=0;b<u;b++){let h=0;for(;h<a;){let d=a;if(c){for(;h<a&&c[b*a+h]===0;)h++;if(h>=a)break;for(d=h;d<a&&c[b*a+d]!==0;)d++;}let p=d-h,x=f.subarray(h,d),y=m.subarray(h,d);Yu(e,i+h,s+b,x,y,p);for(let g=0;g<p;g++)Pg(x[g],y[g],t,n,r,o,l,(b*a+h+g)*4);h=d;}}}function Yu(e,t,n,r,o,i=r.length){if(i<=0)return;let[s,a,u,l,c,f]=e,m=E=>[D(D(D(s*E)+D(u*n))+c),D(D(D(a*E)+D(l*n))+f)],[b,h]=m(t),[d,p]=m(t+i),x=D(D(d-b)/i),y=D(D(p-h)/i),g=b,M=h;for(let E=0;E<i;E++)r[E]=g,o[E]=M,g=D(g+x),M=D(M+y);}var fb=[1,0,0,1,0,0];function Rg(e,t){return (e[t+3]<<24|e[t]<<16|e[t+1]<<8|e[t+2])>>>0}function hb(e,t,n=fb){let{width:r,height:o,rgba:i}=t;if(r<=0||o<=0)return null;try{let s=t.transform??fb,a=(u,l)=>{let c=Math.floor(u),f=Math.floor(l);return c<0||f<0||c>=r||f>=o?null:Rg(i,(f*r+c)*4)};return ls(e,{x:0,y:0,w:r,h:o},r,o,t.wrapMode,s,Fo(n),{phaseX:0,lagX:0,lagY:0},a)}catch{return null}}var zu=new Float32Array(1),Vu=new Uint32Array(zu.buffer);function db(e){return zu[0]=e,e>0?Vu[0]-=1:e<0?Vu[0]+=1:Vu[0]=2147483649,zu[0]}function re(e,t){let n=e+t,r=n-e,o=e-(n-r)+(t-r),i=D(n);return Math.fround(n)===n&&o<0?db(n):i}var Ve=(e,t)=>re(e,-t),z=(e,t)=>D(e*t);function sr(e,t){let n=D(e/t);return (t>0?n*t>e:n*t<e)&&(n=db(n)),n}var ks=.000596046448;function qu(e){let[t,n,r,o,i,s]=e,a=Math.abs(t),u=Math.abs(o),l=Math.abs(n),c=Math.abs(r),f=a>u?a:u,m=l>c?n:c,b;f>m?b=a>u?t:o:b=l>c?n:r;let h=D(Math.abs(b)*ks),d=15;return h>l&&h>c?(d=3,ks>Math.abs(Ve(t,1))&&ks>Math.abs(Ve(o,1))&&(d=1)):h>Math.abs(Ve(t,o))&&h>Math.abs(re(r,n))&&(d=ks>Math.abs(Ve(re(z(n,n),z(t,t)),1))?5:7),i===0&&s===0&&(d&=-2),d}function Ko(e,t){let[n,r,o,i,s,a]=e,[u,l,c,f]=t,m=-f,b=-c,h=Ve(z(re(c,u),re(l,f)),z(l,u)),d=re(h,Ve(z(m,u),z(l,c)));if(!(Math.abs(d)>=11920929e-14))return null;let p=sr(1,d),x=z(re(z(f,o),z(m,n)),p),y=z(re(z(f,i),z(m,r)),p),g=z(re(z(c,s),z(b,n)),p),M=z(re(z(c,a),z(b,r)),p),E=z(-u,f),P=z(-l,c),R=Ve(z(re(u,c),re(l,f)),z(u,l)),T=z(re(re(z(E,o),z(R,n)),z(P,s)),p),w=z(re(re(z(E,i),z(R,r)),z(P,a)),p);return [x,y,g,M,T,w]}function Zo(e,t){let n=qu(e),[r,o,i,s,a,u]=e,l=[];for(let c=0;c<t.length;c+=2){let f=t[c],m=t[c+1];n===0?l.push(f,m):(n&-2)===0?l.push(re(a,f),re(u,m)):(n&-4)===0?l.push(re(z(r,f),a),re(z(s,m),u)):l.push(re(re(z(f,r),z(m,i)),a),re(re(z(f,o),z(m,s)),u));}return l}function Tg(e,t){let n=Ko(e,t);if(!n)return null;let[r,o,i,s]=t;return Zo(n,[r,o,re(r,i),o,r,re(o,s)])}function _s(e,t){let[n,r,o,i,s,a]=e,[u,l,c,f,m,b]=t;return [re(z(n,u),z(r,c)),re(z(n,l),z(r,f)),re(z(o,u),z(i,c)),re(z(o,l),z(i,f)),re(re(z(s,u),z(a,c)),m),re(re(z(s,l),z(a,f)),b)]}function Ju(e,t,n){let r=Tg(e,t);if(!r)return null;let o=Ko(r,t);return o?_s(o,n):null}function Ku(e){let[t,n,r,o,i,s]=e,a=Ve(z(t,o),z(n,r));if(!Number.isFinite(a)||a===0)return null;let u=sr(1,a);return [z(o,u),z(-n,u),z(-r,u),z(t,u),z(Ve(z(r,s),z(o,i)),u),z(Ve(z(n,i),z(t,s)),u)]}function pb(e,t,n,r,o,i){let[s,a,u,l,c,f]=e,m=qu(e),b=P=>m===0?[P,n]:(m&-2)===0?[re(P,c),re(n,f)]:(m&-4)===0?[re(z(P,s),c),re(z(n,l),f)]:[re(re(z(s,P),z(u,n)),c),re(re(z(a,P),z(l,n)),f)],[h,d]=b(t),[p,x]=b(t+r),y=sr(Ve(p,h),r),g=sr(Ve(x,d),r),M=h,E=d;for(let P=0;P<r;P++)o[P]=M,i[P]=E,M=re(M,y),E=re(E,g);}function xb(e,t,n,r,o,i){let[s,a,u,l,c,f]=e,m=qu(e),b=w=>m===0?[w,n]:(m&-2)===0?[re(w,c),re(n,f)]:(m&-4)===0?[re(z(w,s),c),re(z(n,l),f)]:[re(re(z(s,w),z(u,n)),c),re(re(z(a,w),z(l,n)),f)],[h,d]=b(t),[p,x]=b(t+r),y=w=>{let A=Math.floor(re(z(w,65536),.5));return A>=-2147483648&&A<=2147483647?A:-2147483648},g=(w,A)=>M(sr(z(Ve(A,w),65536),r)),M=w=>{let A=Math.floor(re(w,.5));return A>=-2147483648&&A<=2147483647?A:-2147483648},E=y(h),P=y(d),R=g(h,p),T=g(d,x);for(let w=0;w<r;w++)o[w]=E,i[w]=P,E=E+R|0,P=P+T|0;}function wg(e,t){let[n,r,o,i]=e.map(Math.fround),[s,a,u,l]=t.map(Math.fround),c=re(n,o),f=re(r,i),m=re(s,u),b=re(a,l);if(n===c||r===f)return null;let h=sr(Ve(m,s),Ve(c,n)),d=sr(Ve(b,a),Ve(f,r)),p=Ve(m,z(h,c)),x=Ve(b,z(d,f));return Zo([h,0,0,d,p,x],[n,r,c,r,n,f])}function Zu(e,t){let[n,r,o,i]=t.map(Math.fround),s=Zo(e,[n,r,re(n,o),re(r,i)]);return [s[0],s[1],Ve(s[2],s[0]),Ve(s[3],s[1])]}function Qu(e,t,n){let r=wg(e,t);if(!r)return null;let o=Ko(r,e);return o?_s(o,n):null}var yb=[[-1675,5953,56660,6337,-1739],[-1612,5575,56650,6727,-1804],[-1550,5203,56630,7123,-1870],[-1489,4837,56600,7525,-1937],[-1429,4477,56561,7931,-2004],[-1371,4125,56510,8345,-2073],[-1313,3777,56451,8763,-2142],[-1257,3437,56381,9187,-2212],[-1202,3103,56301,9617,-2283],[-1148,2775,56211,10053,-2355],[-1095,2453,56112,10493,-2427],[-1044,2139,56002,10939,-2500],[-993,1829,55884,11389,-2573],[-945,1529,55754,11845,-2647],[-897,1233,55616,12305,-2721],[-851,945,55467,12771,-2796],[-806,663,55309,13241,-2871],[-762,387,55142,13715,-2946],[-720,119,54964,14195,-3022],[-679,-143,54778,14677,-3097],[-639,-399,54582,15165,-3173],[-600,-649,54377,15657,-3249],[-563,-891,54162,16153,-3325],[-528,-1125,53937,16653,-3401],[-493,-1355,53705,17155,-3476],[-460,-1577,53462,17663,-3552],[-429,-1791,53210,18173,-3627],[-398,-2001,52950,18687,-3702],[-369,-2203,52681,19203,-3776],[-341,-2399,52403,19723,-3850],[-315,-2587,52116,20245,-3923],[-289,-2771,51821,20771,-3996],[-265,-2947,51517,21299,-4068],[-243,-3115,51204,21829,-4139],[-221,-3279,50884,22361,-4209],[-201,-3435,50554,22897,-4279],[-182,-3585,50217,23433,-4347],[-164,-3729,49872,23971,-4414],[-147,-3867,49518,24513,-4481],[-131,-3999,49158,25053,-4545],[-117,-4123,48788,25597,-4609],[-103,-4243,48412,26141,-4671],[-90,-4357,48029,26685,-4731],[-79,-4463,47637,27231,-4790],[-68,-4565,47239,27777,-4847],[-59,-4659,46833,28323,-4902],[-50,-4749,46421,28869,-4955],[-42,-4833,46002,29415,-5006],[-35,-4911,45576,29961,-5055],[-29,-4983,45143,30507,-5102],[-24,-5049,44704,31051,-5146],[-19,-5111,44259,31595,-5188],[-15,-5167,43807,32139,-5228],[-11,-5219,43351,32679,-5264],[-8,-5265,42888,33219,-5298],[-6,-5305,42419,33757,-5329],[-4,-5341,41944,34295,-5358],[-3,-5371,41464,34829,-5383],[-2,-5397,40980,35359,-5404],[-1,-5419,40490,35889,-5423],[0,-5437,39996,36415,-5438],[0,-5449,39497,36937,-5449],[0,-5457,38993,37457,-5457],[0,-5461,38485,37973,-5461]];function el(e){return e<64?{first:-2,weights:yb[e]}:{first:-1,weights:yb[127-e].slice().reverse()}}var Ag=(()=>{let e=new Int32Array(512).fill(Number.NaN);for(let t=0;t<128;t++){let{first:n,weights:r}=el(t),o=-32768;for(let i=0;i<=5;i++){let s=128*(n+i)-64-t-1;s>=-256&&s<=255&&(e[s+256]=o),i<5&&(o+=r[i]);}}return e})();function Bs(e){return e<-256?-32768:e>255?32768:Ag[e+256]}var Mb=1/65536;function Ig(e){return e<=-128?0:e>=128?65536:32768+(e<0?-(512*-e-2*e*e):512*e-2*e*e)}function Sg(e){return e<-256?0:e>255?65536:32768+Bs(e)}var We=e=>e|0,Eb=(e,t)=>Math.floor(e*t/65536);function Pb(e){return e>=-32768&&e<=32767}var ar=e=>On(fe(Q(e,65536),.5)),Gs=e=>On(fe(Q(e,16),.5));function nl(e,t,n,r){if(![e,t,n,r].every(Pb))return null;let o=ar(we(t,r));if(o===0)return null;let i=Gs(n),s=Gs(fe(Q(t,we(r,t)),n)),a=We(Math.min(i,s)<<12)>>16,u=We(Math.max(i,s)<<12)+65535>>16,l=D(o),c=o<0?te(D(u),fe(r,n)):te(D(a),n),f=Q(Q(c,l),Mb),m=ar(o<0?te(e,f):fe(f,e));return {firstRow:a,yStart:m,yStep:o}}function Rb(e){let[t,n,r,o]=e.src.map(Math.fround),[i,s,a,u]=e.dest.map(Math.fround);if(![t,r,i,a].every(Pb))return null;let l=e.kernel==="cubic"?2:1,c=e.kernel==="cubic"?131072:65536,f=.5,m=ar(we(r,a));ar(we(a,r));ar(we(u,o));let d=nl(n,o,s,u);if(m===0||!d)return null;let{firstRow:p,yStart:x,yStep:y}=d,g=Gs(i),M=Gs(fe(Q(r,we(a,r)),i)),E=Math.min(g,M),P=Math.max(g,M),R=E+15>>4,T=We(E<<12),w=We(P<<12),A=Z=>D(Z),I=A(m),S,v;m<0?(S=A(w+65535>>16),v=fe(i,a)):(S=A(T>>16),v=i);let C=te(v,S);C=Q(C,I),C=Q(C,Mb),C=fe(C,t);let U=ar(C),L=(Z,J)=>{let K=ar(we(Q(l,Z),J));return K<0&&(K=-K),K<c?c:K},k=L(r,a),F=On(fe(Q(we(65536,A(k)),65536),f)),_=L(o,u),H=On(fe(Q(we(65536,A(_)),65536),f)),G=(w+65535>>16)-(T>>16)+1,W=2*(_+65535>>16)+1,N=(Z,J)=>{let K=J-32768;return K>=-2147483648&&K<=2147483647&&K-Z>=-2147483648&&K+Z<=2147483647};return !N(k,U)||!N(_,x)?null:{request:e,firstColumn:R,columns:G,firstRow:p,xStart:U,xStep:m,xStretch:k,xRecip:F,yStart:x,yStep:y,yStretch:_,yRecip:H,kernelRows:W,table:e.kernel==="cubic"?Sg:Ig,shift:e.kernel==="cubic"?8:9,rows:new Map}}function tl(e,t,n){if(!n)return (e%t+t)%t;let r=(e%t+t)%t;return Math.floor(e/t)%2!==0?t-r-1:r}function vg(e){return [e>>>16&255,e>>>8&255,e&255,e>>>24]}function Tb(e,t){let{request:n,columns:r,xStart:o,xStep:i,xStretch:s,xRecip:a,table:u,shift:l}=e,{width:c,wrap:f=4,clampArgb:m=0}=n,b=n.kernel==="cubic",h=new Uint8Array(r*4),d=vg(m),p=f===1||f===3,x=We(o-32768),y=[0,0,0,0];for(let g=0;g<r;g++){let M=We(s+65535+x),E=M>>16,P=We(M-2*s)>>16;y[0]=y[1]=y[2]=y[3]=0;let R=0,T=(L,k,F)=>{let _=u(We(L)>>l),H=_-R;R=_,y[0]+=k[F]*H,y[1]+=k[F+1]*H,y[2]+=k[F+2]*H,y[3]+=k[F+3]*H;},w=L=>Eb(We(We(L<<16)-x),a),A=P<0?0:P,I=E<c-1?E:c-1,S=w(P);for(let L=P;L<Math.min(A,E+1);L++)f===4||!t?T(S,d,0):T(S,t,tl(L,c,p)*4),S=We(S+a);if(A<=I){S=w(A);for(let L=A;L<=I;L++)t?T(S,t,L*4):T(S,d,0),S=We(S+a);}let v=Math.max(I+1,P);if(v<=E){S=w(v);for(let L=v;L<=E;L++)f===4||!t?T(S,d,0):T(S,t,tl(L,c,p)*4),S=We(S+a);}let C=g*4,U=Math.max(0,Math.min(255,y[3]+32768>>16));h[C+3]=U;for(let L=0;L<3;L++){let k=y[L]+32768>>16;h[C+L]=b?Math.max(0,Math.min(U,k)):Math.min(255,k);}x=We(x+i);}return h}function gb(e,t){let{request:n}=e,{height:r,width:o,wrap:i=4}=n,s=t;if(s<0||s>=r){if(i===4)return null;s=tl(s,r,i===2||i===3);}let a=e.rows.get(s);if(!a){let u=n.pixels instanceof Uint8Array||n.pixels instanceof Uint8ClampedArray?n.pixels.subarray(s*o*4,(s+1)*o*4):Uint8Array.from(Array.prototype.slice.call(n.pixels,s*o*4,(s+1)*o*4));a=Tb(e,u),e.rows.set(s,a);}return a}function Cg(e){let t=e.rows.get(Number.NaN);return t||(t=Tb(e,null),e.rows.set(Number.NaN,t)),t}function wb(e,t,n,r){let{firstColumn:o,columns:i,firstRow:s,yStart:a,yStep:u,yStretch:l,yRecip:c,kernelRows:f,table:m,shift:b}=e,h=Math.max(n,o),d=Math.min(r,o+i);if(d<h||d-h>i)return null;let p=d-h,x=Math.max(t,s),y=We(a-32768+We((x-s)*u)),g=We(y+l+65535)>>16,M=We(y-l+65535)>>16;if(g<M)return null;let E=Eb(We(We(M<<16)-y),c),P=0,R=[],T=[];for(let I=0;I<f;I++){let S=M+I;if(S>g){T.push(0),R.push(null);continue}let v=m(We(E)>>b);T.push(v-P),P=v,E=We(E+c),R.push(S>=0&&S<e.request.height?gb(e,S):e.request.wrap===4||e.request.wrap===void 0?Cg(e):gb(e,S));}let w=e.request.kernel==="cubic",A=new Uint8Array(p*4);for(let I=0;I<p;I++){let S=(h-o+I)*4,v=0,C=0,U=0,L=0;for(let _=0;_<f;_++){let H=R[_];if(!H)continue;let G=T[_];v+=H[S]*G,C+=H[S+1]*G,U+=H[S+2]*G,L+=H[S+3]*G;}let k=I*4,F=Math.max(0,Math.min(255,L+32768>>16));A[k+3]=F;for(let[_,H]of [[0,v],[1,C],[2,U]]){let G=H+32768>>16;A[k+_]=w?Math.max(0,Math.min(F,G)):Math.min(255,G);}}return {x:h,pixels:A}}var Dg={0:"bilinear",1:"bilinear",2:"hq-bicubic",3:"bilinear",4:"bicubic",5:"nearest",6:"hq-bilinear",7:"hq-bicubic"},Lg=new Set([2,4]),il=16*1024*1024;function Lb(e){return Dg[e]??"bilinear"}function Rt(e){return Lg.has(e)}function Ub(e){let t=e[0]*e[3]-e[1]*e[2];if(!Number.isFinite(t)||Math.abs(t)<1e-12)return null;let n=e[3]/t,r=-e[1]/t,o=-e[2]/t,i=e[0]/t;return [n,r,o,i,-(n*e[4]+o*e[5]),-(r*e[4]+i*e[5])]}var zr=1e-6,qr=1e-9,Ug=1+2**-21,Ab=5e-4,Lt=16;function Fg(e){let t=e.toDevice,n=(l,c)=>[Math.round((t[0]*l+t[2]*c+t[4])*Lt)/Lt,Math.round((t[1]*l+t[3]*c+t[5])*Lt)/Lt],[r,o]=n(e.srcX,e.srcY),[i,s,a,u]=t;return [i,s,a,u,r-i*e.srcX-a*e.srcY,o-s*e.srcX-u*e.srcY]}function kg(e){let t=e.toDevice,n=(d,p)=>[t[0]*d+t[2]*p+t[4],t[1]*d+t[3]*p+t[5]],[r,o]=n(e.srcX,e.srcY),i=Math.round(r*Lt)/Lt,s=Math.round(o*Lt)/Lt,[a,u]=n(e.srcX+e.srcW,e.srcY),[l,c]=n(e.srcX,e.srcY+e.srcH),f=(a-i)/e.srcW,m=(u-s)/e.srcW,b=(l-i)/e.srcH,h=(c-s)/e.srcH;return [f,m,b,h,i-f*e.srcX-b*e.srcY,s-m*e.srcX-h*e.srcY]}function _g(e,t){let n=Math.abs(e);return n<1?((t+2)*n-(t+3))*n*n+1:n<2?t*(((n-5)*n+8)*n-4):0}function Bg(e){let t=Math.min(1,Math.abs(e));return Math.sign(e)*(t-t*t/2)}function Gg(e,t){let n=Math.min(2,Math.abs(e)),r;if(n<1)r=(t+2)*n**4/4-(t+3)*n**3/3+n;else {let o=(t+2)/4-(t+3)/3+1,i=s=>t*(s**4/4-5*s**3/3+4*s*s-4*s);r=o+i(n)-i(1);}return Math.sign(e)*r}function ol(e){return Math.ceil(e*(1-15e-8))}function Sb(e,t){let n=ol(e)-t;return n>=-1&&n<=1}function vb(e,t,n){let r=e-Math.round(e);if(r>-1/64+1e-9)return r<=1/64+1e-9;if(Math.abs(r+1/64)>1e-9||!Ns(n.srcW)||!Ns(n.srcH))return false;let o=(t-Math.round(t))*128;return n.srcW*n.srcH*Math.max(n.srcW,n.srcH)<=256||Math.abs(o-Math.round(o))<1e-9}var Og=-0.5,Ng=-1;function Os(e,t,n){switch(e){case "bilinear":return {radius:1,weight:(r,o)=>Math.max(0,1-Math.abs(r-o))};case "bicubic":return {radius:2,weight:(r,o)=>_g(r-o,Og)};case "hq-bilinear":case "hq-bicubic":{if(n)return {radius:.5,weight:(a,u)=>Math.floor(u+.5)===a?1:0};let r=Math.min(1,Math.abs(t)),o=e==="hq-bicubic",i=o?2:1,s=o?a=>Gg(a,Ng):Bg;return {radius:i/r+.5,weight:(a,u)=>s(r*(a+.5-u))-s(r*(a-.5-u))}}default:return {radius:.5,weight:(r,o)=>Math.floor(o+.5)===r?1:0}}}function Wg(e,t,n,r,o,i,s,a,u={wrap:void 0,clamp:null},l=false,c=false,f=false){let[m,b,h,d]=a?[r,o,i,s]:[i,s,r,o],[p,x,y,g]=a?[n.x0,n.x1,n.y0,n.y1]:[n.y0,n.y1,n.x0,n.x1],M=0,E=0,P=0,R=0;for(let T=0;T<b.length;T++){let w=b[T],A=m+T;if(w===0)continue;let I=Qo(A,p,x,a?u.mirrorX:u.mirrorY,u);if(I===Jr)continue;let S=0,v=0,C=0,U=0;for(let k=0;k<d.length;k++){let F=d[k],_=h+k;if(F===0)continue;let H=Qo(_,y,g,a?u.mirrorY:u.mirrorX,u);if(H===Jr)continue;let G,W=0;H===lr||I===lr?G=u.clamp??[0,0,0,0]:(G=e,W=(a?H*t+I:I*t+H)*4);let N=G[W+3],Z=F*N/255,J=!!u.literal&&G===u.clamp;S+=c||J?F*G[W]:l||f?F*Math.round(N*G[W]/255):Z*G[W],v+=c||J?F*G[W+1]:l||f?F*Math.round(N*G[W+1]/255):Z*G[W+1],C+=c||J?F*G[W+2]:l||f?F*Math.round(N*G[W+2]/255):Z*G[W+2],U+=F*N;}l&&(S=Math.trunc(S),v=Math.trunc(v),C=Math.trunc(C),U=Math.trunc(U)),U=Math.min(255,Math.max(0,U));let L=u.literal&&f?1/0:U;M+=w*Math.min(L,Math.max(0,S)),E+=w*Math.min(L,Math.max(0,v)),P+=w*Math.min(L,Math.max(0,C)),R+=w*U;}return [M,E,P,R]}var Jr=-1,lr=-2;function Fb(e,t){let n=t>>>24;return e==="clamp"&&n>0&&n<255}function Qo(e,t,n,r,o){if(e>=t&&e<n)return e;if(!o.wrap)return Jr;if(o.wrap==="clamp")return lr;let i=n-t;if(!r)return t+((e-t)%i+i)%i;let s=((e-t)%(2*i)+2*i)%(2*i);return t+(s<i?s:2*i-1-s)}function Hg(e){let t=e-Math.floor(e);return t===0?e:Math.floor(e)+1-t}function cn(e,t,n,r,o,i={}){let{plainRotated:s=false,keepOrigin:a=false,premultSource:u=false,premultOut:l=false,rasterQuad:c,rasterHalf:f=false,chainPad:m=0}=typeof i=="boolean"?{plainRotated:i}:i;if(r.rightHalo&&r.rightHalo.length===n*4){let be=new Uint8ClampedArray((t+1)*n*4);for(let Pe=0;Pe<n;Pe++)be.set(e.subarray(Pe*t*4,(Pe+1)*t*4),Pe*(t+1)*4),be.set(r.rightHalo.subarray(Pe*4,Pe*4+4),(Pe*(t+1)+t)*4);return cn(be,t+1,n,{...r,rightHalo:void 0},o)}if(r.wrap==="clamp"&&!((r.clampArgb??0)>>>24)&&(r.kernel==="hq-bicubic"||r.kernel==="hq-bilinear"))return cn(e,t,n,{...r,wrap:void 0,clampArgb:void 0},o,i);if(r.kernel==="nearest"&&!r.wrap)return Zg(e,t,n,r,o);let b=!a&&(r.kernel==="bilinear"||r.kernel==="bicubic")&&(r.toDevice[1]!==0||r.toDevice[2]!==0),h=a||b?r.toDevice:Fg(r),d=r.kernel,p=d==="hq-bilinear"||d==="hq-bicubic";p&&(h[1]!==0||h[2]!==0)&&Math.abs(h[1])<=Ab*Math.abs(h[0])&&Math.abs(h[2])<=Ab*Math.abs(h[3])&&(h=[h[0],0,0,h[3],h[4],h[5]]);let x=h[1]===0&&h[2]===0;p&&!x&&!a&&(h=kg(r));let g=d==="bicubic"&&x&&!r.halfPixelOffset&&h[0]===1&&h[3]===1&&vb(h[4],h[5],r)&&vb(h[5],h[4],r),E=0,P=0;if(p&&!x){let be=Math.hypot(h[0],h[1])*r.srcW,Pe=Math.hypot(h[2],h[3])*r.srcH,he=Sb(be,r.srcW)||Sb(Pe,r.srcH);return Kg(e,t,n,r,o,h,d,he)}let R=d==="bicubic";if(p&&x&&!u){let be=zg(e,t,n,r,o,h,l);if(be!==void 0)return be}if(p&&x){let be=h[0]*r.srcX+h[4];h=[h[0],0,0,h[3],h[4]+Hg(be)-be,h[5]];}let T=Ub(h);if(!T)return null;let w=Math.max(0,Math.floor(r.srcX)),A=Math.max(0,Math.floor(r.srcY)),I=Math.min(t,Math.ceil(r.srcX+r.srcW)),S=Math.min(n,Math.ceil(r.srcY+r.srcH));if(I<=w||S<=A)return null;let v=1/0,C=1/0,U=-1/0,L=-1/0;for(let[be,Pe]of [[r.srcX,r.srcY],[r.srcX+r.srcW,r.srcY],[r.srcX,r.srcY+r.srcH],[r.srcX+r.srcW,r.srcY+r.srcH]]){let he=h[0]*be+h[2]*Pe+h[4],pe=h[1]*be+h[3]*Pe+h[5];v=Math.min(v,he),C=Math.min(C,pe),U=Math.max(U,he),L=Math.max(L,pe);}let k=Math.max(0,Math.floor(v)-1),F=Math.max(0,Math.floor(C)-1),_=Math.min(o.w,Math.ceil(U)+1),H=Math.min(o.h,Math.ceil(L)+1),G=_-k,W=H-F;if(!(G>0&&W>0)||G*W>il)return null;let N=c?ot([c],false,false,f,{x:k,y:F,w:G,h:W}):b?ot([[[r.srcX,r.srcY],[r.srcX+r.srcW,r.srcY],[r.srcX+r.srcW,r.srcY+r.srcH],[r.srcX,r.srcY+r.srcH]].flatMap(([be,Pe])=>[Ge(h[0]*be+h[2]*Pe+h[4]),Ge(h[1]*be+h[3]*Pe+h[5])])],false,false,!!r.halfPixelOffset,{x:k,y:F,w:G,h:W}):null,Z=Math.hypot(h[0],h[1]),J=Math.hypot(h[2],h[3]),K=be=>Math.abs(be-Math.round(be))<1e-9,ie=x&&Math.abs(Z-1)<1e-9&&K(h[4]),ce=x&&Math.abs(J-1)<1e-9&&K(h[5]),$=ie&&ce,X=Os(d,Z,$),B=Os(d,J,$),O=new Uint8ClampedArray(G*W*4),j=r.halfPixelOffset?.5:0,q=r.srcX+r.srcW,ae=r.srcY+r.srcH,se=[],de=[];Math.hypot(T[0],T[2]);Math.hypot(T[1],T[3]);let le=r.clampArgb??0,xe={wrap:r.wrap,clamp:[le>>>16&255,le>>>8&255,le&255,le>>>24&255],literal:Fb(r.wrap,le),mirrorX:r.wrap==="tile-flip-x"||r.wrap==="tile-flip-xy",mirrorY:r.wrap==="tile-flip-y"||r.wrap==="tile-flip-xy"},Je=Math.round(T[0]*it),At=Math.round(T[1]*it),et=!s&&(d==="bilinear"||d==="bicubic"&&!x)?Jo(h):null,gt=null;if((et||s)&&r.pointsForm&&r.worldPoints&&r.worldMatrix&&(d==="bilinear"||d==="bicubic")&&!r.halfPixelOffset&&!r.chainHalf&&!r.wrap){let be=Ju(r.worldPoints,r.chainSrc??[r.srcX,r.srcY,r.srcW,r.srcH],r.worldMatrix);gt=be&&Ku(be);}else if(s&&r.chainHalf&&r.pointsForm&&r.worldPoints&&r.worldMatrix&&r.chainSrc&&(d==="bilinear"||d==="bicubic")){let be=r.worldMatrix,Pe=Ju(r.worldPoints,r.chainSrc,[be[0],be[1],be[2],be[3],D(be[4]-.5),D(be[5]-.5)]);gt=Pe&&Ku(Pe);}let Fn=new Float64Array(G),kn=new Float64Array(G),mt=new Int32Array(G),Cr=new Int32Array(G),zt=0,Ka=(be,Pe)=>{let he=be+zr,pe=Pe+qr,Oe=T[0]*he+T[2]*pe+T[4],ve=T[1]*he+T[3]*pe+T[5];return !(Oe<r.srcX||ve<r.srcY||Oe>=q||ve>=ae)};et&&!gt&&r.pointsForm&&d==="bilinear"&&x&&(et[0]=Math.fround(1/Math.fround(h[0])));for(let be=0;be<W;be++){let Pe=F+be+j,he=-1,pe=0,Oe=0,ve=0,tt=0,Ft=0;for(let Re=0;Re<G;Re++){let ft=k+Re+j,Se=T[0]*(ft-E)+T[2]*(Pe-P)+T[4],Te=T[1]*(ft-E)+T[3]*(Pe-P)+T[5],It=ft+zr,St=Pe+qr,bt=T[0]*It+T[2]*St+T[4],nt=T[1]*It+T[3]*St+T[5];if(N?!N[be*G+Re]:bt<r.srcX||nt<r.srcY||bt>=q||nt>=ae)continue;if(gt){if(he<0){he=Re,zt=Re;let Ke=Re+1;for(;Ke<G&&(N?N[be*G+Ke]!==0:Ka(k+Ke+j,Pe));)Ke++;R?xb(gt,k+Re,F+be,Ke-Re,mt,Cr):pb(gt,k+Re,F+be,Ke-Re,Fn,kn);}R?(Se=(mt[Re-zt]+m*it)/it,Te=(Cr[Re-zt]+m*it)/it):(Se=Fn[Re-zt]+m,Te=kn[Re-zt]+m);}else if(et){if(he<0){he=Re,Ft=Re;let Ke=Math.fround(r.toDevice[0]*r.srcX+r.toDevice[2]*r.srcY+r.toDevice[4]),Jt=Math.fround(r.toDevice[1]*r.srcX+r.toDevice[3]*r.srcY+r.toDevice[5]),_n=D(ft-Ke),xn=D(Pe-Jt);ve=D(D(D(et[0]*_n)+D(et[2]*xn))+Math.fround(r.srcX)),tt=D(D(D(et[1]*_n)+D(et[3]*xn))+Math.fround(r.srcY));}for(;Ft<Re;Ft++)ve=D(ve+et[0]),tt=D(tt+et[1]);Se=ve,Te=tt,r.pointsForm&&d==="bilinear"&&x&&(Te=r.srcY+(tt-r.srcY)*Ug);}R&&(gt||et?(Se=Math.floor(Se*64)/64,Te=Math.floor(Te*64)/64):(he<0&&(he=Re,pe=Math.round(Se*it),Oe=Math.round(Te*it)),Se=Math.floor((pe+(Re-he)*Je)/(it/64))/64,Te=Math.floor((Oe+(Re-he)*At)/(it/64))/64),g&&(Se=Math.round(Se),Te=Math.round(Te)));let kt={x0:0,y0:0,x1:t,y1:n},Fe=(Ke,Jt)=>{let _n=Math.ceil(Ke-X.radius),xn=Math.floor(Ke+X.radius),Gm=Math.ceil(Jt-B.radius),Q1=Math.floor(Jt+B.radius);se.length=0,de.length=0;for(let yn=_n;yn<=xn;yn++)se.push(R?Math.round(X.weight(yn,Ke)*65536)/65536:X.weight(yn,Ke));for(let yn=Gm;yn<=Q1;yn++)de.push(R?Math.round(B.weight(yn,Jt)*65536)/65536:B.weight(yn,Jt));return Wg(e,t,kt,_n,se,Gm,de,d==="bicubic",xe,R,u,d==="bilinear")};d==="bilinear"&&(Se=Math.floor(Se)+Math.round((Se-Math.floor(Se))*2048)/2048,Te=Math.floor(Te)+Math.round((Te-Math.floor(Te))*2048)/2048);let[Mt,Et,_t,vt]=Fe(Se,Te);if(vt<=0)continue;if(R){if(Mt=Math.trunc(Mt),Et=Math.trunc(Et),_t=Math.trunc(_t),vt=Math.trunc(vt),vt<=0)continue}else if((u||d==="bilinear")&&(Mt=Math.round(Mt),Et=Math.round(Et),_t=Math.round(_t),vt=Math.round(vt),vt<=0))continue;let ln=Math.min(255,vt),qt=(be*G+Re)*4;O[qt]=Math.min(Math.max(0,Mt),ln)*255/ln,O[qt+1]=Math.min(Math.max(0,Et),ln)*255/ln,O[qt+2]=Math.min(Math.max(0,_t),ln)*255/ln,O[qt+3]=ln;}}return {x:k,y:F,w:G,h:W,rgba:O}}var ur=128;function Ns(e){return Number.isInteger(e)&&e>0&&(e&e-1)===0}function kb(e){return !e.pointsForm||Ns(e.srcW)&&Ns(e.srcH)}function $g(e,t,n){return kb(e)?t===1?-(n?2:1)*65536+(e.kernel==="hq-bicubic"?1:0):0:t<=1?1:0}function Cb(e){return e<1?_b(65536/e):Math.round(65536/e)}var Xg=.027;function _b(e){return Math.floor(e+.5+Xg)}function Db(e){return e>512?0:e>256?2:e>64?1:0}var jg=.9375-1e-9;function Yg(e){return e<=-128?-32768:e>=128?32768:e<0?-(512*-e-2*e*e):512*e-2*e*e}function Vg(e,t,n,r,o,i,s){let a=[],u=e?2*Math.round(Math.fround(t)*32768):Math.round(4294967296/n),l=(e?2:1)*(n/65536)+1;for(let c=i;c<=s;c++){let f=r(c),m=o+f/65536,b=Math.ceil(m-l),h=Math.floor(m+l),d=[],p=Number.NaN;for(let x=b;x<=h+1;x++){let y=((x-.5-o)*65536-f)*u/33554432,g=Math.floor(y),M=e?Bs(g):Yg(g);x>b&&d.push((M-p)/65536),p=M;}a.push({first:b,weights:d});}return a}function zg(e,t,n,r,o,i,s){let a=r.kernel,u=i[0]<0,l=Math.abs(i[0]),c=i[3];if(!(l>0&&c>0)||r.rightHalo)return;let f=he=>Math.abs(he-Math.round(he))<1e-9;if(l===1&&c===1&&!u&&f(i[4])&&f(i[5]))return;let m=u&&l===1,b=r.halfPixelOffset?.5:0,h=i[0]*r.srcX+i[4]-b,d=h+i[0]*r.srcW,p=r.toDevice[0]*(r.srcX+r.srcW)+r.toDevice[4]-b,x=u?p:D(D(Math.fround(r.toDevice[0])*r.srcX)+D(r.toDevice[4]))-b,y=u?Math.round(p*Lt)/Lt:Math.min(h,d),g=i[3]*r.srcY+i[5]-b,M=u?y+l*r.srcW:Math.max(h,d),E=g+i[3]*r.srcH,P=u?.5:Math.ceil(x*Lt-.5)/Lt,R=!u&&Number.isInteger(P)&&x-P>1e-5,T=!u&&Number.isInteger(P)&&P-x>1e-5,w=Math.ceil(R?x-zr:y-zr),A=Math.ceil(R?x+l*r.srcW-zr:M-zr)-1,I=D(D(Math.fround(r.toDevice[3])*r.srcY)+D(r.toDevice[5]))-b,S=Math.ceil(I*Lt-.5)/Lt,v=Number.isInteger(S)&&I-S>1e-5,C=Math.ceil(v?I-qr:g-qr),U=Math.ceil(v?I+i[3]*r.srcH-qr:E-qr)-1,L=Math.max(0,w),k=Math.max(0,C),F=Math.min(o.w-1,A),_=Math.min(o.h-1,U);if(F<L||_<k)return null;let H=F-L+1,G=_-k+1;if(H*G>il)return null;let W=qg(e,t,n,r,L,k,H,G,s);if(W)return W;let N=a==="hq-bicubic",Z=N?.5:1,J=Cb(l),K=Cb(c),ie=r.nominalScale;if(ie&&!u&&Math.abs(ie[0]/l-1)<1e-5&&Math.abs(ie[1]/c-1)<1e-5){let he=Math.fround,pe=he(1/he(ie[0]*ie[1])),Oe=(ve,tt)=>tt<1?_b(ve):Math.round(ve);J=Oe(65536*he(ie[1]*pe),l),K=Oe(65536*he(ie[0]*pe),c);}let ce=w-x,$=ce<1e-5?0:ce,X=Math.max(0,C-I);if(u&&(r.halfPixelOffset||!f(r.srcX)||!f(r.srcW)))return;let B=A-w+1+$,O=x-Math.floor(x),j=u?0:R?Math.round((1+O)*J):T?Math.round((O-1)*J):$>1e-9?Math.round((1-$)*J):0,q=X>1e-9?Math.round(X*K):0,ae=r.srcY+r.srcH,se;if(c===1&&!N&&!u&&!r.wrap&&!r.halfPixelOffset&&ae+1<n&&f(r.srcY)&&f(r.srcH)&&r.worldMatrix&&r.worldRect){let he=[r.srcX,r.srcY,r.srcW,r.srcH],pe=Qu(he,r.worldRect,r.worldMatrix),Oe=pe&&Zu(pe,he);if(Oe&&Oe[3]>=r.srcH){se=ae;let ve=nl(r.srcY,r.srcH,Oe[1],Oe[3]);ve&&ve.yStep===K&&(q=ve.yStart-r.srcY*65536+(C-ve.firstRow)*K);}}let de=x-Math.floor(x),me=u||de>=jg?0:-Db(x),ee=Db(I),le=Os(a,l,false),xe=Os(a,c,false),Je=(he,pe,Oe,ve,tt,Ft,Re,ft,Se=false)=>{let Te=[],It=((pe&pe-1)===0?0:Math.round(r.srcW/170))+(Se?$g(r,Re,$>1e-9):0),St=Fe=>Se?Math.round((B-Fe)*pe)+It:Fe*pe+Oe;if(Se&&m&&$<=1e-9&&kb(r)){for(let Fe=tt;Fe<=Ft;Fe++)Te.push({first:Math.round(ve+St(Fe)/65536),weights:[1]});return Te}let bt=ve*ur,nt=Math.abs(bt-Math.round(bt))<1e-6;if(Re<1&&nt)return Vg(N,Re,pe,Fe=>St(Fe)+ft,ve,tt,Ft);let kt=N&&nt;for(let Fe=tt;Fe<=Ft;Fe++){let Mt=Math.floor((St(Fe)-1)/(65536/ur));if(kt){let qt=Math.round(bt)+Mt,Ke=el((qt%ur+ur)%ur);Te.push({first:Math.floor(qt/ur)+Ke.first,weights:Ke.weights.map(Jt=>Jt/65536)});continue}let Et=ve+(Mt+Z)/ur,_t=Math.ceil(Et-he.radius),vt=Math.floor(Et+he.radius),ln=[];for(let qt=_t;qt<=vt;qt++)ln.push(he.weight(qt,Et));Te.push({first:_t,weights:ln});}return Te},At=Je(le,J,j,r.srcX,L-w,F-w,l,me,u),et=Je(xe,K,q,r.srcY,k-C,_-C,c,ee),gt=1/0,Fn=-1/0;for(let he of et)gt=Math.min(gt,he.first),Fn=Math.max(Fn,he.first+he.weights.length-1);let kn=r.clampArgb??0,mt=r.wrap?{wrap:r.wrap,clamp:[kn>>>16&255,kn>>>8&255,kn&255,kn>>>24&255],literal:Fb(r.wrap,kn),mirrorX:r.wrap==="tile-flip-x"||r.wrap==="tile-flip-xy",mirrorY:r.wrap==="tile-flip-y"||r.wrap==="tile-flip-xy"}:null;mt||(gt=Math.max(0,gt),Fn=Math.min(n-1,Fn));let Cr=Math.max(0,Fn-gt+1),zt=Math.abs(c-1)<1e-9?1/0:Math.ceil((N?2:1)/Math.min(1,c)),Ka=se??ae+zt-1,be=new Uint8Array(Cr*H*4);for(let he=0;he<Cr;he++){let pe=gt+he;if(mt&&(Number.isFinite(zt)&&(pe=Qo(pe,Math.max(0,r.srcY-zt),Math.min(n,r.srcY+r.srcH+zt),mt.mirrorY,mt)),pe!==Jr&&pe!==lr&&(pe=Qo(pe,0,n,mt.mirrorY,mt))),pe===Jr||pe!==lr&&(pe<r.srcY-zt||pe>Ka))continue;let Oe=pe*t;for(let ve=0;ve<H;ve++){let tt=At[ve],Ft=0,Re=0,ft=0,Se=0;for(let bt=0;bt<tt.weights.length;bt++){let nt=tt.first+bt,kt=e,Fe=0;if(mt){if(nt=Qo(nt,0,t,mt.mirrorX,mt),nt===Jr)continue}else if(nt<0||nt>=t)continue;nt===lr||pe===lr?kt=mt?.clamp??[0,0,0,0]:Fe=(Oe+nt)*4;let Mt=kt[Fe+3];if(Mt===0)continue;let Et=tt.weights[bt],_t=!!mt?.literal&&kt===mt.clamp;Ft+=Et*(_t?kt[Fe]:Math.round(kt[Fe]*Mt/255)),Re+=Et*(_t?kt[Fe+1]:Math.round(kt[Fe+1]*Mt/255)),ft+=Et*(_t?kt[Fe+2]:Math.round(kt[Fe+2]*Mt/255)),Se+=Et*Mt;}let Te=Math.min(255,Math.max(0,Math.round(Se))),It=(he*H+ve)*4,St=mt?.literal?255:Te;be[It]=Math.min(St,Math.max(0,Math.round(Ft))),be[It+1]=Math.min(St,Math.max(0,Math.round(Re))),be[It+2]=Math.min(St,Math.max(0,Math.round(ft))),be[It+3]=Te;}}let Pe=new Uint8ClampedArray(H*G*4);for(let he=0;he<G;he++){let pe=et[he];for(let Oe=0;Oe<H;Oe++){let ve=0,tt=0,Ft=0,Re=0;for(let It=0;It<pe.weights.length;It++){let St=pe.first+It-gt;if(St<0||St>=Cr)continue;let bt=(St*H+Oe)*4,nt=pe.weights[It];ve+=nt*be[bt],tt+=nt*be[bt+1],Ft+=nt*be[bt+2],Re+=nt*be[bt+3];}let ft=Math.min(255,Math.max(0,Math.round(Re)));if(ft===0)continue;let Se=(he*H+Oe)*4,Te=s?1:255/ft;Pe[Se]=Math.min(ft,Math.max(0,Math.round(ve)))*Te,Pe[Se+1]=Math.min(ft,Math.max(0,Math.round(tt)))*Te,Pe[Se+2]=Math.min(ft,Math.max(0,Math.round(Ft)))*Te,Pe[Se+3]=ft;}}return {x:L,y:k,w:H,h:G,rgba:Pe,premultiplied:s}}function qg(e,t,n,r,o,i,s,a,u){let l=r.worldMatrix;if(r.halfPixelOffset||!l||r.wrap||r.srcX!==0||r.srcY!==0||r.srcW!==t||r.srcH!==n)return;let c=[r.srcX,r.srcY,r.srcW,r.srcH],f=r.worldRect?null:r.worldPoints?Ko(r.worldPoints,c):null,m=r.worldRect?Qu(c,r.worldRect,l):f?_s(f,l):null;if(!m||!(m[0]>0&&m[3]>0))return;let b=Zu(m,c),h=new Uint8Array(t*n*4);for(let x=0;x<t*n*4;x+=4){let y=e[x+3];h[x]=Math.round(e[x]*y/255),h[x+1]=Math.round(e[x+1]*y/255),h[x+2]=Math.round(e[x+2]*y/255),h[x+3]=y;}let d=Rb({kernel:r.kernel==="hq-bicubic"?"cubic":"tent",pixels:h,width:t,height:n,src:c,dest:b});if(!d)return;let p=new Uint8ClampedArray(s*a*4);for(let x=0;x<a;x++){let y=wb(d,i+x,o,o+s);if(y)for(let g=0;g<y.pixels.length/4;g++){let M=y.pixels.subarray(g*4,g*4+4),E=M[3];if(E===0)continue;let P=(x*s+y.x-o+g)*4,R=u?1:255/E;p[P]=M[0]*R,p[P+1]=M[1]*R,p[P+2]=M[2]*R,p[P+3]=E;}}return {x:o,y:i,w:s,h:a,rgba:p,premultiplied:u}}function Jg(e,t){let n=Zo(t,e),r=(o,i)=>Math.ceil(vo(re(Q(i,i),Q(o,o))));return [r(re(n[2],-n[0]),re(n[3],-n[1])),r(re(n[4],-n[0]),re(n[5],-n[1]))]}function Kg(e,t,n,r,o,i,s,a){let u=!!(r.pointsForm&&r.worldPoints&&r.worldMatrix&&!r.wrap),l=u?Jg(r.worldPoints,r.worldMatrix):null,c=l?Math.abs(l[0]-r.srcW)<=1.0000001||Math.abs(l[1]-r.srcH)<=1.0000001:a,f=r.wrap?0:2,m,b,h,d,p,x,y,g,M,E=r.halfPixelOffset,P=0,R=0;if(c){b=t+2*f,h=n+2*f,m=new Uint8ClampedArray(b*h*4);for(let I=0;I<n;I++)for(let S=0;S<t;S++){let v=(I*t+S)*4,C=e[v+3],U=((I+f)*b+S+f)*4;m[U]=Math.round(e[v]*C/255),m[U+1]=Math.round(e[v+1]*C/255),m[U+2]=Math.round(e[v+2]*C/255),m[U+3]=C;}[d,p,x,y]=i,g=i[4]-(E?.5:0),M=i[5]-(E?.5:0);}else {let I=l?l[0]:ol(Math.hypot(i[0],i[1])*r.srcW),S=l?l[1]:ol(Math.hypot(i[2],i[3])*r.srcH);P=I,R=S;let v=I/r.srcW,C=S/r.srcH,U=cn(e,t,n,{srcX:r.srcX,srcY:r.srcY,srcW:r.srcW,srcH:r.srcH,toDevice:[v,0,0,C,-r.srcX*v,-r.srcY*C],kernel:s,halfPixelOffset:false,wrap:r.wrap,clampArgb:r.clampArgb},{w:I,h:S},{premultOut:true});if(!U)return null;if(!U.premultiplied)for(let F=0;F<U.rgba.length;F+=4){let _=U.rgba[F+3];U.rgba[F]=Math.round(U.rgba[F]*_/255),U.rgba[F+1]=Math.round(U.rgba[F+1]*_/255),U.rgba[F+2]=Math.round(U.rgba[F+2]*_/255);}b=I+2*f,h=S+2*f,m=new Uint8ClampedArray(b*h*4);for(let F=0;F<U.h;F++)for(let _=0;_<U.w;_++){let H=_+U.x,G=F+U.y;H<I&&G<S&&m.set(U.rgba.subarray((F*U.w+_)*4,(F*U.w+_)*4+4),((G+f)*b+H+f)*4);}d=i[0]/v,p=i[1]/v,x=i[2]/C,y=i[3]/C;let L=i[0]*r.srcX+i[2]*r.srcY+i[4],k=i[1]*r.srcX+i[3]*r.srcY+i[5];g=E?L-.5+.5*(d+x):L,M=E?k-.5+.5*(p+y):k;}let T=[[r.srcX,r.srcY],[r.srcX+r.srcW,r.srcY],[r.srcX+r.srcW,r.srcY+r.srcH],[r.srcX,r.srcY+r.srcH]].flatMap(([I,S])=>[Ge(i[0]*I+i[2]*S+i[4]),Ge(i[1]*I+i[3]*S+i[5])]),w=cn(m,b,h,{srcX:0,srcY:0,srcW:b,srcH:h,toDevice:[d,p,x,y,g-d*f-x*f,M-p*f-y*f],kernel:s==="hq-bicubic"?"bicubic":"bilinear",halfPixelOffset:false,wrap:r.wrap,clampArgb:r.clampArgb,...u?{pointsForm:true,worldPoints:r.worldPoints,worldMatrix:r.worldMatrix,chainSrc:c?[r.srcX,r.srcY,r.srcW,r.srcH]:[E?-0.5:0,E?-0.5:0,P,R],...E?{chainHalf:true}:{}}:{}},o,{plainRotated:true,keepOrigin:true,premultSource:true,...u?{rasterQuad:T,rasterHalf:E,chainPad:f}:{}});if(!w)return w;let A=ot([T],false,false,E,{x:w.x,y:w.y,w:w.w,h:w.h});for(let I=0;I<w.w*w.h;I++)A[I]||w.rgba.fill(0,I*4,I*4+4);return w}var it=65536;function Zg(e,t,n,r,o){let i=r.toDevice,s=Ub(i);if(!s)return null;let{srcX:a,srcY:u,srcW:l,srcH:c}=r,f=[[a,u],[a+l,u],[a+l,u+c],[a,u+c]].map(([C,U])=>[i[0]*C+i[2]*U+i[4],i[1]*C+i[3]*U+i[5]]),m=1/0,b=1/0,h=-1/0,d=-1/0;for(let[C,U]of f)m=Math.min(m,C),b=Math.min(b,U),h=Math.max(h,C),d=Math.max(d,U);if(![m,b,h,d].every(Number.isFinite))return null;let p=Math.max(0,Math.floor(m)-1),x=Math.max(0,Math.floor(b)-1),y=Math.min(o.w,Math.ceil(h)+2),g=Math.min(o.h,Math.ceil(d)+2),M=y-p,E=g-x;if(!(M>0&&E>0)||M*E>il)return null;let P={x:p,y:x,w:M,h:E},R=ot([f.flatMap(([C,U])=>[Ge(C),Ge(U)])],false,false,r.halfPixelOffset,P),T=Math.max(0,Math.floor(u)),w=Math.min(n,Math.ceil(u+c)),A=r.halfPixelOffset?.5:0,I=Math.round(s[0]*it),S=Math.round(s[1]*it),v=new Uint8ClampedArray(M*E*4);for(let C=0;C<E;C++){let U=x+C+A,L=-1,k=0,F=0;for(let _=0;_<M;_++){if(!R[C*M+_])continue;if(L<0){let J=p+_+A;L=_,k=Math.round((s[0]*J+s[2]*U+s[4])*it),F=Math.round((s[1]*J+s[3]*U+s[5])*it);}let H=_-L,G=Math.floor((k+H*I+it/2)/it),W=Math.floor((F+H*S+it/2)/it);if(G<0||G>=t||W<T||W>=w)continue;let N=(W*t+G)*4,Z=(C*M+_)*4;v[Z]=e[N],v[Z+1]=e[N+1],v[Z+2]=e[N+2],v[Z+3]=e[N+3];}}return {x:p,y:x,w:M,h:E,rgba:v}}var Ws=1<<24;function Gb(e,t,n,r){return {cmds:[{op:"rect",x:e,y:t,w:n,h:r}],fillRule:"nonzero",simple:true}}function mn(e){return {cmds:e.map(t=>({op:"rect",x:t.x,y:t.y,w:t.w,h:t.h})),fillRule:"nonzero",simple:true}}function Ot(){return {cmds:[{op:"rect",x:0,y:0,w:0,h:0}],fillRule:"nonzero",simple:true}}function Qg(e,t,n){return {...e,cmds:e.cmds.map(r=>{switch(r.op){case "rect":return {...r,x:r.x+t,y:r.y+n};case "moveTo":case "lineTo":return {...r,x:r.x+t,y:r.y+n};case "bezierCurveTo":return {...r,cp1x:r.cp1x+t,cp1y:r.cp1y+n,cp2x:r.cp2x+t,cp2y:r.cp2y+n,x:r.x+t,y:r.y+n};case "arcTo":return {...r,x1:r.x1+t,y1:r.y1+n,x2:r.x2+t,y2:r.y2+n};case "ellipse":return {...r,cx:r.cx+t,cy:r.cy+n};case "closePath":return r}})}}function mr(e,t,n){return e?e.map(r=>Qg(r,t,n)):null}function sl(e){return e.simple&&e.fillRule==="nonzero"}function cr(e){return e.fillRule==="evenodd"||sl(e)}function Bb(e){let t=0;for(let n of Hr(e.cmds)){let r=0,o=n.length/2;for(let s=0;s<o;s++){let a=(s+1)%o;r+=n[2*s]*n[2*a+1]-n[2*a]*n[2*s+1];}let i=Math.abs(r)<1e-9?0:Math.sign(r);if(i!==0){if(t!==0&&i!==t)return NaN;t=i;}}return t}function e2(e,t){if(!sl(e)||!sl(t))return false;let n=Bb(e),r=Bb(t);return !Number.isNaN(n)&&!Number.isNaN(r)&&(n===0||r===0||n===r)}function ei(e){return {cmds:[{op:"rect",x:-Ws,y:-Ws,w:2*Ws,h:2*Ws},...e.cmds],fillRule:"evenodd",simple:false}}var t2={x:1<<23,y:1<<23,w:1,h:1};function Tn(e,t,n,r){let o=r??e0(e,t),i=tr(e,t,n,o),s=!r0(o);return !r&&tr(e,t,n,t2).length>0&&(s=false),{region:[i.length>0?mn(i):Ot()],exact:s}}function al(e,t,n,r){switch(n){case "replace":return {region:[t],exact:true};case "intersect":return {region:e?[...e,t]:[t],exact:true};case "exclude":{if(cr(t)){let o=ei(t);return {region:e?[...e,o]:[o],exact:true}}return Tn(e,[t],n,r)}case "union":return e?e.length===1&&e2(e[0],t)?{region:[{cmds:[...e[0].cmds,...t.cmds],fillRule:"nonzero",simple:false}],exact:true}:Tn(e,[t],n,r):{region:null,exact:true};case "xor":return e?e.length===1&&cr(e[0])&&cr(t)?{region:[{cmds:[...e[0].cmds,...t.cmds],fillRule:"evenodd",simple:false}],exact:true}:Tn(e,[t],n,r):cr(t)?{region:[ei(t)],exact:true}:Tn(e,[t],n,r);case "complement":return e?e.length===1&&cr(e[0])?{region:[t,ei(e[0])],exact:true}:Tn(e,[t],n,r):{region:[Ot()],exact:true}}}function ul(e,t,n,r){if(n==="replace")return {region:t,exact:true};if(t&&t.length===1)return al(e,t[0],n,r);if(!t)switch(n){case "intersect":return {region:e,exact:true};case "union":return {region:null,exact:true};case "exclude":return {region:[Ot()],exact:true};case "xor":case "complement":return e?e.length===1&&cr(e[0])?{region:[ei(e[0])],exact:true}:Tn(e,t,n,r):{region:[Ot()],exact:true}}switch(n){case "intersect":return {region:e?[...e,...t]:t,exact:true};case "union":return e?Tn(e,t,n,r):{region:null,exact:true};case "complement":return e?e.length===1&&cr(e[0])?{region:[...t,ei(e[0])],exact:true}:Tn(e,t,n,r):{region:[Ot()],exact:true};case "xor":case "exclude":return Tn(e,t,n,r)}}function ti(e,t){for(let n of t)switch(n.op){case "rect":e.rect(n.x,n.y,n.w,n.h);break;case "moveTo":e.moveTo(n.x,n.y);break;case "lineTo":e.lineTo(n.x,n.y);break;case "bezierCurveTo":e.bezierCurveTo(n.cp1x,n.cp1y,n.cp2x,n.cp2y,n.x,n.y);break;case "arcTo":e.arcTo(n.x1,n.y1,n.x2,n.y2,n.radius);break;case "ellipse":e.ellipse(n.cx,n.cy,n.rx,n.ry,n.rotation,n.startAngle,n.endAngle,n.ccw);break;case "closePath":e.closePath();break}}function n2(e,t){for(let n of t){e.beginPath(),ti(e,n.cmds);try{e.clip(n.fillRule);}catch{}}}function Yt(e,t,n=false){let{ctx:r}=e;for(;e.clipSaveDepth>0;)r.restore(),e.clipSaveDepth--;t&&(r.save(),e.clipSaveDepth=1,n&&r.setTransform(1,0,0,1,0,0),n2(r,t));}var r2=[[255,0,0,0,0,0,0,0],[128,128,128,128,128,128,128,128],[128,64,32,16,8,4,2,1],[1,2,4,8,16,32,64,128],[255,128,128,128,128,128,128,128],[129,66,36,24,24,36,66,129],[128,0,0,0,8,0,0,0],[128,0,8,0,128,0,8,0],[136,0,34,0,136,0,34,0],[136,34,136,34,136,34,136,34],[170,68,170,17,170,68,170,17],[170,85,170,81,170,85,170,21],[170,85,170,85,170,85,170,85],[238,85,187,85,238,85,187,85],[119,221,119,221,119,221,119,221],[119,255,221,255,119,255,221,255],[239,255,254,255,239,255,254,255],[255,255,255,247,255,255,255,127],[136,68,34,17,136,68,34,17],[17,34,68,136,17,34,68,136],[204,102,51,153,204,102,51,153],[51,102,204,153,51,102,204,153],[193,224,112,56,28,14,7,131],[131,7,14,28,56,112,224,193],[136,136,136,136,136,136,136,136],[255,0,0,0,255,0,0,0],[85,85,85,85,85,85,85,85],[255,0,255,0,255,0,255,0],[204,204,204,204,204,204,204,204],[255,255,0,0,255,255,0,0],[0,0,136,68,34,17,0,0],[0,0,17,34,68,136,0,0],[240,0,0,0,15,0,0,0],[128,128,128,128,8,8,8,8],[128,8,64,2,16,1,32,4],[177,48,3,27,216,192,12,141],[129,66,36,24,129,66,36,24],[0,24,37,192,0,24,37,192],[1,2,4,8,24,36,66,129],[255,128,128,128,255,8,8,8],[136,84,34,69,136,20,34,81],[170,85,170,85,240,240,240,240],[0,16,8,16,0,128,1,128],[170,0,128,0,128,0,128,0],[128,0,34,0,8,0,34,0],[3,132,72,48,12,2,1,1],[255,102,255,153,255,102,255,153],[119,137,143,143,119,152,248,248],[255,136,136,136,255,136,136,136],[153,102,102,153,153,102,102,153],[240,240,240,240,15,15,15,15],[130,68,40,16,40,68,130,1],[16,56,124,254,124,56,16,0]],Ob=234,Nb=64;function o2(e,t,n){let r=()=>{let i=((t-n)%8+8)%8;return i===0?Ob:i===1||i===7?Nb:0},o=()=>{let i=((t+n-7)%8+8)%8;return i===0?Ob:i===1||i===7?Nb:0};switch(e){case 2:return r();case 3:return o();case 5:return Math.max(r(),o());default:{let i=r2[e];return i&&i[n]&128>>t?256:0}}}function i2(e,t,n){if(n>=256)return e>>>0;if(n<=0)return t>>>0;let r=e>>>24&255,o=t>>>24&255,i=r*n+o*(256-n)>>8;if(i===0)return 0;let s=i<<24;for(let a of [16,8,0]){let u=Math.round((e>>>a&255)*r/255),l=Math.round((t>>>a&255)*o/255),c=u*n+l*(256-n)>>8;s|=Math.min(255,Math.round(c*255/i))<<a;}return s>>>0}function Wb(e){let t=new Uint8ClampedArray(256);for(let n=0;n<8;n++)for(let r=0;r<8;r++){let o=i2(e.fore,e.back,o2(e.style,r,n)),i=(n*8+r)*4;t[i]=o>>>16&255,t[i+1]=o>>>8&255,t[i+2]=o&255,t[i+3]=o>>>24&255;}return t}function Hb(e,t,n){let r=Wb(e),o=n;return (i,s,a,u,l)=>{for(let c=0;c<u;c++)for(let f=0;f<a;f++){let m=i+f+.5,b=s+c+.5,h=Math.floor(o[0]*m+o[2]*b+o[4]),d=Math.floor(o[1]*m+o[3]*b+o[5]),p=((h-t.x)%8+8)%8+((d-t.y)%8+8)%8*8,x=(c*a+f)*4;l[x]=r[p*4],l[x+1]=r[p*4+1],l[x+2]=r[p*4+2],l[x+3]=r[p*4+3];}}}function $b(e,t,n,r,o){if(typeof e.createPattern!="function")return null;let i=chunkI7XOR2GO_js.Z(8,8);if(!i)return null;chunkI7XOR2GO_js.ma(i.ctx,chunkI7XOR2GO_js.oa(Wb(t),8,8),0,0);let s=chunkI7XOR2GO_js.na(e,i.canvas,"repeat");if(!s||typeof s.setTransform!="function")return s;let a=r[0]*r[3]-r[1]*r[2];if(!Number.isFinite(a)||Math.abs(a)<1e-12)return s;let u=[r[3]/a,-r[1]/a,-r[2]/a,r[0]/a,(r[2]*r[5]-r[3]*r[4])/a,(r[1]*r[4]-r[0]*r[5])/a],l=o,c=[l[0],l[1],l[2],l[3],l[0]*n.x+l[2]*n.y+l[4],l[1]*n.x+l[3]*n.y+l[5]],f=[u[0]*c[0]+u[2]*c[1],u[1]*c[0]+u[3]*c[1],u[0]*c[2]+u[2]*c[3],u[1]*c[2]+u[3]*c[3],u[0]*c[4]+u[2]*c[5]+u[4],u[1]*c[4]+u[3]*c[5]+u[5]];try{s.setTransform({a:f[0],b:f[1],c:f[2],d:f[3],e:f[4],f:f[5]});}catch{}return s}function U2(e,t,n){let r=D,o=r(Math.fround(t)*Math.fround(.0174532924)),i=r(Math.sin(o)),s=r(Math.cos(o));return n?[r(r(e[0]*s)-r(e[1]*i)),r(r(e[0]*i)+r(e[1]*s)),r(r(e[2]*s)-r(e[3]*i)),r(r(e[2]*i)+r(e[3]*s)),r(r(e[4]*s)-r(e[5]*i)),r(r(e[4]*i)+r(e[5]*s))]:[r(r(e[0]*s)+r(e[2]*i)),r(r(e[3]*i)+r(e[1]*s)),r(r(e[2]*s)-r(e[0]*i)),r(r(e[3]*s)-r(e[1]*i)),e[4],e[5]]}function wn(e,t){return [e[0]*t[0]+e[1]*t[2],e[0]*t[1]+e[1]*t[3],e[2]*t[0]+e[3]*t[2],e[2]*t[1]+e[3]*t[3],e[4]*t[0]+e[5]*t[2]+t[4],e[4]*t[1]+e[5]*t[3]+t[5]]}function Nt(e,t,n){if(t&32768)return chunkI7XOR2GO_js.c(n);let r=e.objectTable.get(n&255);return r&&r.kind==="plus-brush"?cl(e,r):"rgba(0,0,0,1)"}function cl(e,t){if(t.gradient){let n=Uf(e.ctx,t.gradient,_e(e));if(n)return n}if(t.texture){let n=hb(e.ctx,t.texture,_e(e));if(n)return n}if(t.hatch){let n=$b(e.ctx,t.hatch,e.ext?.renderingOrigin??{x:0,y:0},_e(e),Ys(e));if(n)return n}return t.color}var ll=0,Xs=1,F2=6,br=96;function hr(e,t,n=br,r=true){let o;switch(e){case Xs:o=r?1:n/100;break;case 3:o=n/72;break;case 4:o=n;break;case 5:o=n/300;break;case 6:o=n/25.4;break;default:o=1;break}return o*t}function k2(e){let t=e.videoDisplay??true;return [hr(e.pageUnit,e.pageScale,e.dpiX??br,t),hr(e.pageUnit,e.pageScale,e.dpiY??br,t)]}function _e(e){let t=js(e),n=e.dpiScale,r=[t[0]*n,t[1]*n,t[2]*n,t[3]*n,t[4]*n,t[5]*n],o=e.baseTransform;return o?[o[0]*r[0]+o[2]*r[1],o[1]*r[0]+o[3]*r[1],o[0]*r[2]+o[2]*r[3],o[1]*r[2]+o[3]*r[3],o[0]*r[4]+o[2]*r[5]+o[4],o[1]*r[4]+o[3]*r[5]+o[5]]:r}function An(e){return e.ext||(e.ext={}),e.ext}function js(e){let t=e.ext;if(t?.tsDevice)return t.tsDevice;let n=e.worldTransform,[r,o]=k2(e),i=[n[0]*r,n[1]*o,n[2]*r,n[3]*o,n[4]*r,n[5]*o];return t?.containerTransform?wn(i,t.containerTransform):i}function Ys(e){let t=e.dpiScale,n=[t,0,0,t,0,0];return e.baseTransform?wn(n,e.baseTransform):n}function pt(e,t=true){let n=_e(e),r=t?ml(e):0;e.ctx.setTransform(n[0],n[1],n[2],n[3],n[4]+r,n[5]+r);}function ml(e){return chunkI7XOR2GO_js.qa(e.ctx)?0:e.antiAlias&&!Rt(e.pixelOffsetMode??0)?.5:0}function zb(e,t){let n=An(e);e.saveStack.push({transform:[...e.worldTransform],snapshot:{clipRegion:e.clipRegion??null,antiAlias:e.antiAlias,interpolationMode:e.interpolationMode,pixelOffsetMode:e.pixelOffsetMode,textRenderingHint:e.textRenderingHint,pageUnit:e.pageUnit,pageScale:e.pageScale,ext:{...n,multiFormatSkip:void 0,pendingEffect:void 0}}}),e.saveIdMap.set(t,e.saveStack.length-1);}function Xb(e,t){let n=e.saveIdMap.get(t);if(n!==void 0&&n<e.saveStack.length){let r=e.saveStack[n];e.worldTransform=[...r.transform];let o=r.snapshot;if(o){e.clipRegion=o.clipRegion,e.antiAlias=o.antiAlias,e.interpolationMode=o.interpolationMode,e.pixelOffsetMode=o.pixelOffsetMode,e.textRenderingHint=o.textRenderingHint,e.pageUnit=o.pageUnit,e.pageScale=o.pageScale;let s=An(e),{multiFormatSkip:a,pendingEffect:u}=s;for(let l of Object.keys(s))delete s[l];Object.assign(s,o.ext,{multiFormatSkip:a,pendingEffect:u});}e.saveStack.length=n;let i=new Map;for(let[s,a]of e.saveIdMap)a<n&&i.set(s,a);e.saveIdMap=i,o&&Kr(e);}}function jb(e,t,n){let r=js(e),o=$s(e.ext?.containerClip,e.clipRegion);zb(e,t);let i=An(e);i.containerTransform=n?wn(n,r):r,i.tsDevice=null,i.containerClip=o,i.compositingMode=void 0,i.compositingQuality=void 0,i.textContrast=void 0,e.clipRegion=null,e.worldTransform=[1,0,0,1,0,0],e.pageUnit=Xs,e.pageScale=1,e.antiAlias=false,e.interpolationMode=void 0,e.pixelOffsetMode=void 0,e.textRenderingHint=void 0,Kr(e);}function _2(e,t,n,r=br,o=br,i=true){let s=n===ll?r/100:hr(n,1,r,i),a=n===ll?o/100:hr(n,1,o,i),u=t.w*s,l=t.h*a;if(!(Math.abs(u)>0&&Math.abs(l)>0)||![e.x,e.y,e.w,e.h,u,l].every(Number.isFinite))return null;let c=e.w/u,f=e.h/l;return [c,0,0,f,e.x-t.x*s*c,e.y-t.y*a*f]}function $s(e,t){let n=[...e??[],...t??[]];return e||t?n:null}function Hs(e){return _e(e)}function qb(e,t,n,r,o){let i=(u,l)=>o[0]*u+o[2]*l+o[4],s=(u,l)=>o[1]*u+o[3]*l+o[5];return {cmds:[{op:"moveTo",x:i(e,t),y:s(e,t)},{op:"lineTo",x:i(e+n,t),y:s(e+n,t)},{op:"lineTo",x:i(e+n,t+r),y:s(e+n,t+r)},{op:"lineTo",x:i(e,t+r),y:s(e,t+r)},{op:"closePath"}],fillRule:"nonzero",simple:true}}function B2(e,t){return Ru(e.path,t)}var G2={0:"intersect",1:"intersect",2:"union",3:"xor",4:"exclude",5:"complement"},Yb=64;function ni(e,t,n=0,r){if(n>Yb)return chunkI7XOR2GO_js.r(`flattenRegionNode: depth limit (${Yb}) exceeded`),{region:[Ot()],exact:false};switch(e.type){case "rect":return {region:[qb(e.x,e.y,e.width,e.height,t)],exact:true};case "path":return {region:[B2(e,t)],exact:true};case "infinite":return {region:null,exact:true};case "empty":return {region:[Ot()],exact:true};case "combine":{let o=ni(e.left,t,n+1,r),i=ni(e.right,t,n+1,r),s=G2[e.combineMode]??"intersect",a=ul(o.region,i.region,s,r);return {region:a.region,exact:a.exact&&o.exact&&i.exact}}}}var O2={0:"replace",1:"intersect",2:"union",3:"xor",4:"exclude",5:"complement"};function fl(e){if(!(e.canvasW===void 0||e.canvasH===void 0))return {x:0,y:0,w:e.canvasW,h:e.canvasH}}function Jb(e){let t=e.ext;return $s($s(t?.containerClip,e.clipRegion??void 0)??void 0,t?.tsClip??void 0)}function Kr(e){Yt(e,Jb(e),true);}function Kb(e,t){let n=fl(e);if(e.gdiAntialias===true||!t||!n||chunkI7XOR2GO_js.qa(e.ctx))return t;let r=Rt(e.pixelOffsetMode??0),o=E0(t.map(a=>({build:u=>ti(u,a.cmds),evenOdd:a.fillRule==="evenodd"})),n,r);if(o)return [mn(o)];let i=(r?0:.5)-1/32,s=mr(t,i,i);return [mn(tr(s,null,"intersect",n))]}function Zb(e,t,n,r){let o=Kb(e,t),i=O2[n];i||chunkI7XOR2GO_js.r(`${r}: unknown CombineMode ${n}, falling back to Intersect`);let s=ul(e.clipRegion??null,o,i??"intersect",fl(e));s.exact||chunkI7XOR2GO_js.r(`${r}: CombineMode ${n} approximated (no canvas domain for an unbounded result)`),e.clipRegion=s.region,Kr(e);}function Vb(e,t,n,r){Zb(e,[t],n,r);}function fr(e){e.ext?.tsDevice&&(e.ext.tsDevice=null);}function N2(e,t,n){let{view:r}=e;if(n<40||r.getUint32(t,true)&1&&n<296)return;let i=r.getUint8(t+4);e.antiAlias=i===2||i===4||i===5,e.textRenderingHint=r.getUint8(t+5);let s=An(e);s.compositingMode=r.getUint8(t+6),s.compositingQuality=r.getUint8(t+7),s.renderingOrigin={x:r.getInt16(t+8,true),y:r.getInt16(t+10,true)},s.textContrast=r.getUint16(t+12,true),e.interpolationMode=r.getUint8(t+14);let a=[0,4,8,12,16,20].map(u=>r.getFloat32(t+16+u,true));a.every(Number.isFinite)&&(s.tsDevice=a);}function W2(e,t,n,r){let o=r&32767,i=t+n,s=[];if(!(r&32768)){if(t+o*16>i)return null;for(let c=0;c<o;c++){let f=t+c*16;s.push({l:e.getInt32(f,true),t:e.getInt32(f+4,true),r:e.getInt32(f+8,true),b:e.getInt32(f+12,true)});}return s}let a=t,u=()=>{if(a>=i)return null;let c=e.getUint8(a);if(c&128){a+=1;let m=c&127;return m&64?m-128:m}if(a+2>i)return null;let f=c<<8|e.getUint8(a+1);return a+=2,f&16384?f-32768:f},l={l:0,r:0,b:0};for(let c=0;c<o;c++){let f=u(),m=u(),b=u(),h=u();if(f===null||m===null||b===null||h===null)return null;let d=l.b+m,p={l:l.l+f,t:d,r:l.r+b,b:d+h};s.push(p),l=p;}return s}function H2(e,t,n,r){let o=W2(e.view,n,r,t);if(!o)return;let i=Ys(e),s=(f,m)=>i[0]*f+i[2]*m+i[4],a=(f,m)=>i[1]*f+i[3]*m+i[5],u=[];for(let f of o)f.r<=f.l||f.b<=f.t||u.push({op:"moveTo",x:s(f.l,f.t),y:a(f.l,f.t)},{op:"lineTo",x:s(f.r,f.t),y:a(f.r,f.t)},{op:"lineTo",x:s(f.r,f.b),y:a(f.r,f.b)},{op:"lineTo",x:s(f.l,f.b),y:a(f.l,f.b)},{op:"closePath"});let l=u.length>0?{cmds:u,fillRule:"nonzero",simple:o.length===1}:Ot(),c=An(e);c.tsClip=$s(Jb(e)??void 0,Kb(e,[l])??void 0),Kr(e);}function Qb(e,t,n,r,o){let{view:i}=e;switch(t){case 16426:return fr(e),o>=24&&(e.worldTransform=[i.getFloat32(r,true),i.getFloat32(r+4,true),i.getFloat32(r+8,true),i.getFloat32(r+12,true),i.getFloat32(r+16,true),i.getFloat32(r+20,true)]),true;case 16427:return fr(e),e.worldTransform=[1,0,0,1,0,0],true;case 16428:{if(fr(e),o>=24){let s=[i.getFloat32(r,true),i.getFloat32(r+4,true),i.getFloat32(r+8,true),i.getFloat32(r+12,true),i.getFloat32(r+16,true),i.getFloat32(r+20,true)];n&8192?e.worldTransform=wn(e.worldTransform,s):e.worldTransform=wn(s,e.worldTransform);}return true}case 16429:{if(fr(e),o>=8){let s=i.getFloat32(r,true),a=i.getFloat32(r+4,true),u=[1,0,0,1,s,a];n&8192?e.worldTransform=wn(e.worldTransform,u):e.worldTransform=wn(u,e.worldTransform);}return true}case 16430:{if(fr(e),o>=8){let s=i.getFloat32(r,true),a=i.getFloat32(r+4,true),u=[s,0,0,a,0,0];n&8192?e.worldTransform=wn(e.worldTransform,u):e.worldTransform=wn(u,e.worldTransform);}return true}case 16431:return fr(e),o>=4&&(e.worldTransform=U2(e.worldTransform,i.getFloat32(r,true),(n&8192)!==0)),true;case 16421:return o>=4&&zb(e,i.getUint32(r,true)),true;case 16422:return o>=4&&Xb(e,i.getUint32(r,true)),true;case 16434:{if(o>=16){let s=n>>8&15,a=i.getFloat32(r,true),u=i.getFloat32(r+4,true),l=i.getFloat32(r+8,true),c=i.getFloat32(r+12,true),f=qb(a,u,l,c,Hs(e));Vb(e,f,s,"SetClipRect");}return true}case 16433:return e.clipRegion=null,Kr(e),chunkI7XOR2GO_js.q("ResetClip: clip region cleared"),true;case 16436:{let s=n&255,a=n>>8&15,u=e.objectTable.get(s);if(u&&u.kind==="plus-region"&&u.nodes.length>0){let l=ni(u.nodes[0],Hs(e),0,fl(e));l.exact||chunkI7XOR2GO_js.r("SetClipRegion: region tree approximated (no canvas domain for an unbounded result)"),Zb(e,l.region,a,"SetClipRegion");}return true}case 16435:{let s=n&255,a=n>>8&15,u=e.objectTable.get(s);if(u&&u.kind==="plus-path"){let l=Ru(u,Hs(e));Vb(e,l,a,"SetClipPath");}return true}case 16437:{if(o>=8){let s=i.getFloat32(r,true),a=i.getFloat32(r+4,true);if(e.clipRegion){let u=Hs(e),l=u[0]*s+u[2]*a,c=u[1]*s+u[3]*a;e.clipRegion=mr(e.clipRegion,l,c),Kr(e),chunkI7XOR2GO_js.q(`OffsetClip: clip translated by world (${s},${a}) \u2192 device (${l},${c})`);}else chunkI7XOR2GO_js.q(`OffsetClip: dx=${s}, dy=${a}, no active clip, nothing to offset`);}return true}case 16424:return o>=4&&jb(e,i.getUint32(r,true),null),true;case 16423:{if(o>=36){let s=u=>i.getFloat32(r+u,true),a=_2({x:s(0),y:s(4),w:s(8),h:s(12)},{x:s(16),y:s(20),w:s(24),h:s(28)},n&255,e.dpiX,e.dpiY,e.videoDisplay);jb(e,i.getUint32(r+32,true),a??[1,0,0,1,0,0]);}return true}case 16425:return o>=4&&Xb(e,i.getUint32(r,true)),true;case 16432:{fr(e);let s=n&255,a=o>=4?i.getFloat32(r,true):1;return s===ll||s>F2||!(a>0)||!Number.isFinite(a)?(chunkI7XOR2GO_js.q(`SetPageTransform: ignored unit=${s}, scale=${a}`),true):(e.pageUnit=s,e.pageScale=a,chunkI7XOR2GO_js.q(`SetPageTransform: unit=${{0:"World",1:"Display",2:"Pixel",3:"Point",4:"Inch",5:"Document",6:"Millimeter"}[s]??s}, scale=${a}`),true)}case 16417:return e.interpolationMode=n&255,true;case 16418:return e.pixelOffsetMode=n&255,true;case 16415:return e.textRenderingHint=n&255,true;case 16414:return e.antiAlias=(n&1)!==0,true;case 16420:return An(e).compositingQuality=n&255,true;case 16419:return An(e).compositingMode=n&255,true;case 16413:return o>=8&&(An(e).renderingOrigin={x:i.getInt32(r,true),y:i.getInt32(r+4,true)}),true;case 16416:return An(e).textContrast=n&4095,true;case 16441:return N2(e,r,o),true;case 16442:return H2(e,n,r,o),true;default:return false}}function nh(e){let t=e.canvas,n=t?.width,r=t?.height;return typeof n=="number"&&typeof r=="number"&&n>0&&r>0?{w:n,h:r}:null}function eh(e,t,n){let r=chunkI7XOR2GO_js.Z(t,n);return r?(chunkI7XOR2GO_js.ma(r.ctx,chunkI7XOR2GO_js.oa(e,t,n),0,0),r):null}function bl(e,t,n){let r=nh(e);if(n.resample&&r){let i=cn(t.rgba,t.width,t.height,n.resample,r);if(i){let s=eh(i.rgba,i.w,i.h);if(!s)return false;e.save();try{e.setTransform(1,0,0,1,0,0),e.imageSmoothingEnabled=!1,chunkI7XOR2GO_js.ka(e,s.canvas,i.x,i.y,i.w,i.h);}finally{e.restore();}return true}}let o=eh(t.rgba,t.width,t.height);if(!o)return false;e.save();try{e.setTransform(...n.transform),chunkI7XOR2GO_js.ka(e,o.canvas,n.dx,n.dy,n.dw,n.dh);}finally{e.restore();}return true}function $2(e,t){if(!e.data)return null;let n=new Uint8Array(e.data.slice(0)),r=Br(n);return r?{kind:"encoded",bytes:n,mime:r}:t?{kind:"rgba",data:t.rgba,width:t.width,height:t.height}:So(n.buffer)}function th(e,t,n,r,o=false){let i=o&&n?{kind:"rgba",data:n.rgba,width:n.width,height:n.height}:$2(t,n);if(!i)return false;let s=e.reserveSlot(),a=e.imageResampling==="exact"&&n&&r.resample?cn(n.rgba,n.width,n.height,r.resample,{w:e.canvas.width,h:e.canvas.height}):null,u=r.resample?Qi(i):null;if(a){let l={kind:"rgba",data:a.rgba,width:a.w,height:a.h};e.fillSlot(s,l,[1,0,0,1,0,0],a.x,a.y,a.w,a.h);}else if(r.resample&&u){let l=r.resample;e.fillSlotCropped(s,i,l.toDevice,u,l.srcX,l.srcY,l.srcW,l.srcH);}else e.fillSlot(s,i,r.transform,r.dx,r.dy,r.dw,r.dh);return e.shadow&&n&&bl(e.shadow,n,r),true}var hl=2,dl=null;function rh(e){dl=e;}function X2(e,t,n,r,o){let[i,s,a,u,l,c]=e,f=Math.hypot(i,s)*r,m=Math.hypot(a,u)*o;if(!(r>1&&o>1&&f>1&&m>1))return e;let b=(f-1)/f*(r/(r-1)),h=(m-1)/m*(o/(o-1)),d=i*b,p=s*b,x=a*h,y=u*h;return [d,p,x,y,l+(i-d)*t+(a-x)*n,c+(s-p)*t+(u-y)*n]}function j2(e,t,n,r){let o=e.nestingDepth??0;if(!dl||!r||!t.data||r.unit!==hl||o>=Xu)return false;let{srcX:i,srcY:s,srcW:a,srcH:u}=r;if(!(a>0&&u>0)||![i,s,a,u].every(Number.isFinite))return false;let l=nh(e.ctx);if(!l)return false;let c=X2(je(_e(e),r.toWorld(i,s,a,u)),i,s,a,u),f=t.data.slice(0),m=n&&n.kind==="metafile"?n.caches:void 0,{ctx:b}=e;b.save();let h=null;try{b.setTransform(c[0],c[1],c[2],c[3],c[4],c[5]),b.beginPath(),b.rect(i,s,a,u),b.clip(),h=dl(f,b,l.w,l.h,c,{textureCache:m?.textures,imageCache:m?.images,fontFamilyMap:e.fontFamilyMap,gdiAntialias:e.gdiAntialias,codePages:e.codePages,nestingDepth:o+1});}finally{b.restore();}return h?(e.deferredImages.push(...h),true):false}function Vs(e,t,n,r,o){if(o&&o.unit!==hl)return null;let i=t;if(!i&&e.data){let d=So(e.data.slice(0));d&&d.kind==="rgba"&&(i={rgba:d.data,width:d.width,height:d.height});}if(!i)return null;let s=o&&o.unit===hl&&o.srcW>0&&o.srcH>0&&[o.srcX,o.srcY,o.srcW,o.srcH].every(Number.isFinite)?o:null,a=Vf(Yf(i.rgba),i.width,i.height,n,s&&{x:s.srcX,y:s.srcY,w:s.srcW,h:s.srcH});if(!a)return null;let u={kind:"bitmap",width:a.width,height:a.height,rgba:a.rgba};if(!s)return {bitmap:u,draw:r};let l=s.srcX-a.x,c=s.srcY-a.y,f=s.srcW,m=s.srcH,b=[1,0,0,1,a.x,a.y],h=je(s.toWorld(s.srcX,s.srcY,s.srcW,s.srcH),b);return {bitmap:u,draw:{...r,transform:je(r.transform,h),dx:0,dy:0,dw:a.width,dh:a.height,resample:r.resample&&{...r.resample,srcX:l,srcY:c,srcW:f,srcH:m,toDevice:je(r.resample.toDevice,b),rightHalo:a.haloRight}}}}function oh(e,t,n,r,o=null){let i=t.cacheKey!==void 0?e.imageCache?.get(t.cacheKey):void 0;if(t.type===2)return j2(e,t,i,r);let s=i&&i.kind==="bitmap"?i:null,a=o?Vs(t,s,o,n,r):null;return a?chunkI7XOR2GO_js.qa(e.ctx)?th(e.ctx,t,a.bitmap,a.draw,true):bl(e.ctx,a.bitmap,a.draw):o&&!s?false:chunkI7XOR2GO_js.qa(e.ctx)?th(e.ctx,t,s,n):s?bl(e.ctx,s,n):false}function dr(e){if(chunkI7XOR2GO_js.q("parseEmfHeader: byteLength =",e.byteLength),e.byteLength<88)return chunkI7XOR2GO_js.r("parseEmfHeader: buffer too small (<88 bytes)"),null;let t=e.getUint32(0,true);if(t!==1)return chunkI7XOR2GO_js.r("parseEmfHeader: first record type is",t,"(expected 1 = EMR_HEADER)"),null;let n=e.getInt32(8,true),r=e.getInt32(12,true),o=e.getInt32(16,true),i=e.getInt32(20,true),s=e.getInt32(24,true),a=e.getInt32(28,true),u=e.getInt32(32,true),l=e.getInt32(36,true),c=u-s,f=l-a;return chunkI7XOR2GO_js.q(`parseEmfHeader: bounds=(${n},${r})\u2192(${o},${i}) [${o-n+1}\xD7${i-r+1}]`),chunkI7XOR2GO_js.q(`parseEmfHeader: frame=(${s},${a})\u2192(${u},${l}) [${c}\xD7${f}]`),{bounds:{left:n,top:r,right:o,bottom:i},frameW:c,frameH:f}}function zs(e){let t=e.bounds.right-e.bounds.left+1,n=e.bounds.bottom-e.bounds.top+1;return t>0&&n>0?(chunkI7XOR2GO_js.q(`getRenderableEmfBounds: using bounds ${t}\xD7${n}`),{...e.bounds,right:e.bounds.right+1,bottom:e.bounds.bottom+1}):e.frameW>0&&e.frameH>0?(chunkI7XOR2GO_js.q(`getRenderableEmfBounds: bounds invalid (${t}\xD7${n}), falling back to frame ${e.frameW}\xD7${e.frameH}`),{left:0,top:0,right:e.frameW,bottom:e.frameH}):(chunkI7XOR2GO_js.r("getRenderableEmfBounds: no valid bounds or frame, returning null"),null)}function oi(e){if(e.byteLength<22)return null;let t=e.getUint32(0,true),n=0,r=0,o=0,i=800,s=600,a=96;if(t===2596720087){r=e.getInt16(6,true),o=e.getInt16(8,true),i=e.getInt16(10,true),s=e.getInt16(12,true),a=e.getUint16(14,true)||96,n=22;let f=m=>[1,2].includes(e.getUint16(m,true))&&e.getUint16(m+2,true)===9;e.byteLength>=42&&!f(22)&&e.getUint16(22,true)===0&&f(24)&&(n=24);}if(n+18>e.byteLength)return null;let u=e.getUint16(n,true);if(u!==1&&u!==2)return null;let l=e.getUint16(n+2,true)*2,c=e.getUint32(n+8,true)*2;return {headerSize:n+l,maxRecordSize:c,boundsLeft:r,boundsTop:o,boundsRight:i,boundsBottom:s,unitsPerInch:a,placeable:n>0}}var Z2=[0,8388608,32768,8421376,128,8388736,32896,12632256,12639424,10930928,16776176,10526884,8421504,16711680,65280,16776960,255,16711935,65535,16777215];function jn(e,t){return e.getUint32(t,true)}function ii(e){return e>>>24!==0}function tn(e){return e.palette?.entries??Z2}function si(e,t){let n=e>>>24;if(n&16)return 0;if(n&1){let r=e&65535;return t.length===0?0:t[r<t.length?r:0]}return (e&255)<<16|e&65280|e>>>16&255}function xt(e,t){let n=si(t,tn(e));return chunkI7XOR2GO_js.b(n>>16&255,n>>8&255,n&255)}function ah(e,t,n){return xt(e,jn(t,n))}function Zr(e,t,n){let r={...e.colorRefs};n!==void 0&&ii(n)?r[t]=n:delete r[t],e.colorRefs=r;}function uh(e){let t=e.colorRefs;t&&(t.pen!==void 0&&(e.penColor=xt(e,t.pen)),t.brush!==void 0&&(e.brushColor=xt(e,t.brush)),t.text!==void 0&&(e.textColor=xt(e,t.text)),t.bk!==void 0&&(e.bkColor=xt(e,t.bk)));}function ih(e,t,n){let r=[];for(let o=0;o<n&&t+o*4+4<=e.byteLength;o++){let i=t+o*4;r.push(e.getUint8(i)<<16|e.getUint8(i+1)<<8|e.getUint8(i+2));}return r}function pl(e,t){let n=e.objectTable.get(t);return n&&n.kind==="palette"?n:null}function sh(e,t){e.state.palette===t&&uh(e.state);}function lh(e,t,n,r){let{view:o,state:i}=e;switch(t){case 49:{if(r>=16){let s=o.getUint32(n,true),a=o.getUint16(n+6,true);e.objectTable.set(s,{kind:"palette",entries:ih(o,n+8,Math.min(a,(r-16)/4))});}return true}case 48:{if(r>=12){let s=o.getUint32(n,true);if(s===2147483663)i.palette=null;else {let a=pl(e,s);if(!a)return true;i.palette=a;}uh(i);}return true}case 50:{if(r>=20){let s=pl(e,o.getUint32(n,true)),a=o.getUint32(n+4,true),u=o.getUint32(n+8,true);if(s){let l=ih(o,n+12,Math.min(u,(r-20)/4));for(let c=0;c<l.length&&a+c<s.entries.length;c++)s.entries[a+c]=l[c];sh(e,s);}}return true}case 51:{if(r>=16){let s=pl(e,o.getUint32(n,true)),a=Math.min(o.getUint32(n+4,true),1024);if(s){for(s.entries.length=Math.min(s.entries.length,a);s.entries.length<a;)s.entries.push(0);sh(e,s);}}return true}case 52:return true;default:return false}}function He(e,t){let n=e.state.worldTransform,r=n[0]*t+n[4];if(e.useMappingMode){let o=(r-e.windowOrg.x)/(e.windowExt.cx||1)*(e.viewportExt.cx||1)+e.viewportOrg.x;return e.deviceToCanvas?(o-e.bounds.left)*e.sx:o}return (r-e.bounds.left)*e.sx}function $e(e,t){let n=e.state.worldTransform,r=n[3]*t+n[5];if(e.useMappingMode){let o=(r-e.windowOrg.y)/(e.windowExt.cy||1)*(e.viewportExt.cy||1)+e.viewportOrg.y;return e.deviceToCanvas?(o-e.bounds.top)*e.sy:o}return (r-e.bounds.top)*e.sy}function Ze(e,t){let n=e.state.worldTransform[0]*t;return e.useMappingMode?n/(e.windowExt.cx||1)*(e.viewportExt.cx||1)*(e.deviceToCanvas?e.sx:1):n*e.sx}function st(e,t){let n=e.state.worldTransform[3]*t;return e.useMappingMode?n/(e.windowExt.cy||1)*(e.viewportExt.cy||1)*(e.deviceToCanvas?e.sy:1):n*e.sy}function In(e){return !e.useMappingMode||e.deviceToCanvas?e.sx:1}function Sn(e){return !e.useMappingMode||e.deviceToCanvas?e.sy:1}function xl(e,t){return !e.useMappingMode||e.deviceToCanvas?(t-e.bounds.left)*e.sx:t}function yl(e,t){return !e.useMappingMode||e.deviceToCanvas?(t-e.bounds.top)*e.sy:t}function Qr(e){e.useMappingMode=true;}function ze(e){let t=e.state.worldTransform;return t[1]!==0||t[2]!==0}function Ee(e){let t=e.state.worldTransform;if(e.useMappingMode){let o=(e.viewportExt.cx||1)/(e.windowExt.cx||1),i=(e.viewportExt.cy||1)/(e.windowExt.cy||1),[s,a,u,l]=e.deviceToCanvas?[e.sx,e.sy,e.bounds.left,e.bounds.top]:[1,1,0,0];return [t[0]*o*s,t[1]*i*a,t[2]*o*s,t[3]*i*a,((t[4]-e.windowOrg.x)*o+e.viewportOrg.x-u)*s,((t[5]-e.windowOrg.y)*i+e.viewportOrg.y-l)*a]}let n=e.sx||1,r=e.sy||1;return [t[0]*n,t[1]*r,t[2]*n,t[3]*r,(t[4]-e.bounds.left)*n,(t[5]-e.bounds.top)*r]}function Be(e,t,n){let r=Ee(e);return {x:r[0]*t+r[2]*n+r[4],y:r[1]*t+r[3]*n+r[5]}}function qs(e,t,n,r,o){let i=Ee(e),s=Be(e,t,n),a=i[0]*r,u=i[2]*o,l=i[1]*r,c=i[3]*o,f=a*a+u*u,m=a*l+u*c,b=l*l+c*c,h=(f+b)/2,d=Math.sqrt(Math.max(0,((f-b)/2)**2+m*m)),p=Math.max(0,h+d),x=Math.max(0,h-d),y=.5*Math.atan2(2*m,f-b);return {cx:s.x,cy:s.y,rx:Math.sqrt(p),ry:Math.sqrt(x),rotation:y}}function ch(e,t){for(let n of t)switch(n.op){case "moveTo":e.moveTo(n.x,n.y);break;case "lineTo":e.lineTo(n.x,n.y);break;case "rect":e.rect(n.x,n.y,n.w,n.h);break;case "bezierCurveTo":e.bezierCurveTo(n.cp1x,n.cp1y,n.cp2x,n.cp2y,n.x,n.y);break;case "arcTo":e.arcTo(n.x1,n.y1,n.x2,n.y2,n.radius);break;case "ellipse":e.ellipse(n.cx,n.cy,n.rx,n.ry,n.rotation,n.startAngle,n.endAngle,n.ccw);break;case "closePath":e.closePath();break}}function Wt(e){let{ctx:t,pathCmds:n}=e;return new Proxy(t,{get(r,o,i){switch(o){case "moveTo":return (s,a)=>(n.push({op:"moveTo",x:s,y:a}),r.moveTo(s,a));case "lineTo":return (s,a)=>(n.push({op:"lineTo",x:s,y:a}),r.lineTo(s,a));case "rect":return (s,a,u,l)=>(n.push({op:"rect",x:s,y:a,w:u,h:l}),r.rect(s,a,u,l));case "bezierCurveTo":return (s,a,u,l,c,f)=>(n.push({op:"bezierCurveTo",cp1x:s,cp1y:a,cp2x:u,cp2y:l,x:c,y:f}),r.bezierCurveTo(s,a,u,l,c,f));case "arcTo":return (s,a,u,l,c)=>(n.push({op:"arcTo",x1:s,y1:a,x2:u,y2:l,radius:c}),r.arcTo(s,a,u,l,c));case "ellipse":return (s,a,u,l,c,f,m,b)=>(n.push({op:"ellipse",cx:s,cy:a,rx:u,ry:l,rotation:c,startAngle:f,endAngle:m,ccw:!!b}),r.ellipse(s,a,u,l,c,f,m,b));case "closePath":return ()=>(n.push({op:"closePath"}),r.closePath());default:{let s=Reflect.get(r,o,i);return typeof s=="function"?s.bind(r):s}}}})}function gl(e){return e>>>16&255}function fn(e){let t=e&255;return {usesP:(t>>4&15)!==(t&15),usesS:(t>>2&51)!==(t&51),usesD:(t>>1&85)!==(t&85)}}function qe(e,t,n,r,o=16777215){let i=0,s=~t,a=~n,u=~r;for(let l=0;l<8;l++)e&1<<l&&(i|=(l&4?t:s)&(l&2?n:a)&(l&1?r:u));return i&o}function Js(e){let t=gl(e);switch(t){case 204:return {kind:"copy"};case 0:return {kind:"solid",color:"black"};case 255:return {kind:"solid",color:"white"};case 170:return {kind:"noop"};case 85:return {kind:"invert-dest"};default:return {kind:"ternary",index:t,operands:fn(t)}}}function mh(e,t,n,r,o,i){let s=e.data,a=t?t.data:null,u=e.width,l=e.height,c=typeof n=="number"?n:0,f=typeof n=="function"?n:null;for(let m=0;m<l;m++)for(let b=0;b<u;b++){let h=(m*u+b)*4,d=s[h]<<16|s[h+1]<<8|s[h+2],p=a?a[h]<<16|a[h+1]<<8|a[h+2]:0,x=f?f(o+b,i+m):c,y=qe(r,x,p,d);s[h]=y>>16&255,s[h+1]=y>>8&255,s[h+2]=y&255,s[h+3]=255;}}function fh(e,t,n,r,o,i){let s=n<0?e+n:e,a=r<0?t+r:t,u=Math.abs(n),l=Math.abs(r);s=Math.round(s),a=Math.round(a),u=Math.round(u),l=Math.round(l);let c=Math.min(s+u,Math.round(o)),f=Math.min(a+l,Math.round(i));return s=Math.max(s,0),a=Math.max(a,0),u=c-s,l=f-a,u<=0||l<=0?null:{x:s,y:a,w:u,h:l}}var lM={9:160,15:250,7:90,10:165,5:80,14:245,3:10,12:175,8:95,2:5};function Yn(e){return e in lM}function eo(e){if(!Number.isInteger(e)||e<1||e>16)return;let t=e-1;return (t>>2)*80+(t&3)*5}function Ml(e,t,n){return e<<16|t<<8|n}function El(e,t){switch(t){case "invert":return ~e&16777215;case "black":return 0;case "white":return 16777215;default:return e}}function vn(e){let t=e.canvas,n=t?.width,r=t?.height;return typeof n=="number"&&typeof r=="number"&&n>0&&r>0?{w:n,h:r}:null}function Pl(e,t,n){let r=1/0,o=1/0,i=-1/0,s=-1/0,a=0,u=0,l=false,c=(g,M,E=0)=>{r=Math.min(r,g+a-E),o=Math.min(o,M+u-E),i=Math.max(i,g+a+E),s=Math.max(s,M+u+E);},f=()=>{l=true;},m={moveTo:(g,M)=>c(g,M),lineTo:(g,M)=>c(g,M),rect:(g,M,E,P)=>{c(g,M),c(g+E,M+P);},fillRect:(g,M,E,P)=>{c(g,M),c(g+E,M+P);},strokeRect:(g,M,E,P)=>{c(g,M),c(g+E,M+P);},bezierCurveTo:(g,M,E,P,R,T)=>{c(g,M),c(E,P),c(R,T);},quadraticCurveTo:(g,M,E,P)=>{c(g,M),c(E,P);},arcTo:(g,M,E,P)=>{c(g,M),c(E,P);},arc:(g,M,E)=>c(g,M,Math.abs(E)),ellipse:(g,M,E,P)=>c(g,M,Math.max(Math.abs(E),Math.abs(P))),translate:(g,M)=>{a+=g,u+=M;},setTransform:f,transform:f,scale:f,rotate:f},b=()=>{},h=new Proxy(m,{get:(g,M)=>typeof M=="string"&&M in g?g[M]:b,set:()=>true});if(e(h),l)return {x:0,y:0,w:n.w,h:n.h};if(!Number.isFinite(r)||!Number.isFinite(o)||!Number.isFinite(i)||!Number.isFinite(s))return null;let d=Math.max(0,Math.floor(r-t)),p=Math.max(0,Math.floor(o-t)),x=Math.min(n.w,Math.ceil(i+t)),y=Math.min(n.h,Math.ceil(s+t));return x<=d||y<=p?null:{x:d,y:p,w:x-d,h:y-p}}var cM=1024*1024,xr=null;function nn(e,t){let n=xr&&xr.w>=e&&xr.h>=t?xr:null;if(!n){let o=Math.max(e,xr?.w??0),i=Math.max(t,xr?.h??0),s=o*i<=cM,a=s?chunkI7XOR2GO_js.Z(o,i):chunkI7XOR2GO_js.Z(e,t);if(!a)return null;n={canvas:a.canvas,ctx:a.ctx,w:s?o:e,h:s?i:t},s&&(xr=n);}let r=n.ctx;return r.setTransform(1,0,0,1,0,0),r.globalAlpha=1,r.globalCompositeOperation="source-over",r.clearRect(0,0,e,t),n}function rn(e,t,n,r){chunkI7XOR2GO_js.ma(n.ctx,r,0,0);let o=e.drawImage;e.save();try{e.setTransform(1,0,0,1,0,0),e.globalAlpha=1,e.globalCompositeOperation="source-over",o.call(e,n.canvas,0,0,t.w,t.h,t.x,t.y,t.w,t.h);}finally{e.restore();}}function Ks(e,t){return chunkI7XOR2GO_js.qa(e)?e.unknownPixels(t.x,t.y,t.w,t.h):null}function Zs(e,t,n,r,o){let i=null,s=null,a=new Map,u=(c,f,m)=>{c[f*4]=m>>16&255,c[f*4+1]=m>>8&255,c[f*4+2]=m&255,c[f*4+3]=255;};for(let c=0;c<t;c++){if(!n[c]||e[c*4+3]===0)continue;let f=r(c,0),m=r(c,16777215);if(f===m)continue;let b=0,h=0,d=true;for(let x=16;x>=0;x-=8){let y=f>>x&255,g=m>>x&255;if(y===g)h|=y<<x;else if(y===0&&g===255)b|=255<<x;else if(y===255&&g===0)b|=255<<x,h|=255<<x;else {d=false;break}}if(d){e[c*4+3]=0,b!==16777215&&(i??(i=new Uint8ClampedArray(t*4)),u(i,c,b)),h!==0&&(s??(s=new Uint8ClampedArray(t*4)),u(s,c,h));continue}let p=o?.(c);if(p){if(e[c*4+3]=0,p.mode==="multiply"){i??(i=new Uint8ClampedArray(t*4)),u(i,c,p.color);continue}if(p.mode==="difference"){s??(s=new Uint8ClampedArray(t*4)),u(s,c,p.color);continue}let x=a.get(p.mode);x||(x=new Uint8ClampedArray(t*4),a.set(p.mode,x)),u(x,c,p.color);}}let l=[];i&&l.push({mode:"multiply",data:i}),s&&l.push({mode:"difference",data:s});for(let[c,f]of a)l.push({mode:c,data:f});return l}function Qs(e,t,n){if(chunkI7XOR2GO_js.qa(e))for(let r of n)e.blendPatch(r.data,t.x,t.y,t.w,t.h,r.mode);}function to(e,t,n,r){try{let o=chunkI7XOR2GO_js.la(e,t.x,t.y,t.w,t.h),i=o.data,s=nn(t.w,t.h),a=s?chunkI7XOR2GO_js.la(s.ctx,0,0,t.w,t.h):o,u=a.data;for(let f=0;f<t.h;f++)for(let m=0;m<t.w;m++){let b=(f*t.w+m)*4,h=n(t.x+m,t.y+f,Ml(i[b],i[b+1],i[b+2]));h<0||(u[b]=h>>16&255,u[b+1]=h>>8&255,u[b+2]=h&255,u[b+3]=255);}if(!s)return chunkI7XOR2GO_js.ma(e,o,t.x,t.y),!0;let l=Ks(e,t),c=l?Zs(u,t.w*t.h,l,(f,m)=>n(t.x+f%t.w,t.y+Math.floor(f/t.w),m),r&&(f=>r(t.x+f%t.w,t.y+Math.floor(f/t.w)))):[];return rn(e,t,s,a),Qs(e,t,c),!0}catch{return false}}function Rl(e,t,n,r,o=2,i){let s=eo(t);if(s===void 0||!chunkI7XOR2GO_js.ra(e))return false;if(s===170)return true;let a=vn(e);if(!a)return false;try{let u=Pl(r,o,a);if(!u)return !0;let l=nn(u.w,u.h);if(!l)return !1;let c=l.ctx;c.save();try{c.fillStyle=n,c.strokeStyle=n,c.translate(-u.x,-u.y),r(c);}finally{c.restore();}let f=i!==void 0&&typeof c.isPointInPath=="function",m=/^#([0-9a-f]{6})$/i.exec(n.trim()),b=m?parseInt(m[1],16):-1,h=chunkI7XOR2GO_js.la(c,0,0,u.w,u.h),d=h.data,p=s===240?null:chunkI7XOR2GO_js.la(e,u.x,u.y,u.w,u.h).data,x=p?Ks(e,u):null,y=x?new Int32Array(u.w*u.h):null;for(let M=0;M<d.length;M+=4){let E=d[M+3],P;if(E===0)P=!1;else if(E===255)P=!0;else if(f){let w=(M>>2)%u.w,A=((M>>2)-w)/u.w;P=c.isPointInPath(w+.5,A+.5,i);}else P=E>=128;if(!P){d[M]=0,d[M+1]=0,d[M+2]=0,d[M+3]=0;continue}let R=b>=0?b:Ml(d[M],d[M+1],d[M+2]);y&&(y[M>>2]=R);let T=R;if(p){let w=Ml(p[M],p[M+1],p[M+2]);T=qe(s,R,w,w);}d[M]=T>>16&255,d[M+1]=T>>8&255,d[M+2]=T&255,d[M+3]=255;}let g=[];if(x&&y){let M=chunkI7XOR2GO_js._(t);g=Zs(d,u.w*u.h,x,(E,P)=>qe(s,y[E],P,P),E=>({color:El(y[E],M.colorTransform),mode:M.gco}));}return rn(e,u,l,h),Qs(e,u,g),!0}catch{return false}}var mM=16*1024*1024;function bh(e){if(e.gdiAntialias!==false)return null;if(e.rasterLayer!==void 0)return e.rasterLayer;let t=vn(e.ctx);return !t||chunkI7XOR2GO_js.qa(e.ctx)||t.w*t.h>mM?(e.rasterLayer=null,null):(e.rasterLayer={w:t.w,h:t.h,data:new Uint8ClampedArray(t.w*t.h*4),x0:t.w,y0:t.h,x1:0,y1:0},e.rasterLayer)}function Xe(e){let t=e.rasterLayer;if(!t||t.x1<=t.x0||t.y1<=t.y0)return;let n={x:t.x0,y:t.y0,w:t.x1-t.x0,h:t.y1-t.y0},r=new Uint8ClampedArray(n.w*n.h*4);for(let s=0;s<n.h;s++){let a=((n.y+s)*t.w+n.x)*4;r.set(t.data.subarray(a,a+n.w*4),s*n.w*4),t.data.fill(0,a,a+n.w*4);}t.x0=t.w,t.y0=t.h,t.x1=0,t.y1=0;let o=nn(n.w,n.h);if(o){rn(e.ctx,n,o,chunkI7XOR2GO_js.oa(r,n.w,n.h));return}let i=chunkI7XOR2GO_js.la(e.ctx,n.x,n.y,n.w,n.h);for(let s=0;s<r.length;s+=4)r[s+3]!==0&&(i.data[s]=r[s],i.data[s+1]=r[s+1],i.data[s+2]=r[s+2],i.data[s+3]=255);chunkI7XOR2GO_js.ma(e.ctx,i,n.x,n.y);}var fM=new Set([2,3,4,5,6,7,8,27,41,42,43,44,45,46,47,54,55,56,59,60,61,62,63,64,65,66,68,71,72,73,74,85,86,87,88,89,90,91,92,37,38,39,40,82,93,94,95,9,10,11,12,13,17,18,19,20,21,22,24,25,31,32,33,35,36,57,58,16,23,48,49,50,51,52,99,100,101,102,103,104,105,106,109,110,111,112,113,119,120,121,122]);function ea(e){return fM.has(e)}function ph(e,t,n){if(e.kind!=="tile"||!e.skip)return false;let[r,o]=e.toDevice(t,n),{width:i,height:s}=e.tile,a=((r-e.orgX)%i+i)%i,u=((o-e.orgY)%s+s)%s;return e.skip[u*i+a]===1}function hh(e){return `#${(e&16777215).toString(16).padStart(6,"0")}`}function xh(e){for(let t of [0,16777215])if(qe(e,t,0,0)!==qe(e,t,0,16777215))return true;return false}function yh(e,t){e.beginPath();for(let n of Tl(t))e.rect(n.x,n.y,n.w,n.h);}function Tl(e){let t=[],n=e.length,r=e.data,o=new Array(n);for(let s=0;s<n;s++)o[s]=s*3;o.sort((s,a)=>r[s+1]-r[a+1]||r[s+2]-r[a+2]||r[s]-r[a]);let i=0;for(;i<n;){let s=o[i],a=r[s+1],u=r[s+2],l=r[s],c=l+1,f=i+1;for(;f<n;){let m=o[f];if(r[m+1]!==a||r[m+2]!==u||r[m]>c)break;r[m]===c&&c++,f++;}t.push({x:a,y:l,w:u-a,h:c-l}),i=f;}return t}function dh(e,t,n,r="source-over"){e.save();try{e.setTransform(1,0,0,1,0,0),e.globalAlpha=1,e.globalCompositeOperation=r,e.fillStyle=n,yh(e,t),e.fill("nonzero");}finally{e.restore();}}function at(e,t,n,r){if(t.length===0)return;let o=eo(r)??240;if(o===170)return;let i=xh(o)?null:bh(e);if(!i){Xe(e),bM(e.ctx,t,n,r);return}let{w:s,h:a,data:u}=i,l=t.data,c=n.kind==="solid"?qe(o,n.rgb,0,0):0;for(let f=0;f<t.length*3;f+=3){let m=l[f];if(m<0||m>=a)continue;let b=Math.max(0,l[f+1]),h=Math.min(s,l[f+2]);if(h<=b)continue;b<i.x0&&(i.x0=b),h>i.x1&&(i.x1=h),m<i.y0&&(i.y0=m),m+1>i.y1&&(i.y1=m+1);let d=(m*s+b)*4;for(let p=b;p<h;p++,d+=4){if(ph(n,p,m))continue;let x=c;if(n.kind==="tile"){let[y,g]=n.toDevice(p,m);x=qe(o,chunkI7XOR2GO_js.j(n.tile,y,g,n.orgX,n.orgY),0,0);}u[d]=x>>16&255,u[d+1]=x>>8&255,u[d+2]=x&255,u[d+3]=255;}}}function bM(e,t,n,r){if(t.length===0)return;let o=eo(r)??240;if(o===170)return;let i=xh(o);if(n.kind==="solid"&&!i){dh(e,t,hh(qe(o,n.rgb,0,0)));return}if(!chunkI7XOR2GO_js.ra(e)||n.kind==="tile"&&chunkI7XOR2GO_js.qa(e)&&o===240){if(n.kind==="tile"&&chunkI7XOR2GO_js.qa(e)&&o===240){let{tile:M,orgX:E,orgY:P}=n,R=new Uint8ClampedArray(M.width*M.height*4);for(let A=0;A<M.rgb.length;A++)R[A*4]=M.rgb[A]>>>16&255,R[A*4+1]=M.rgb[A]>>>8&255,R[A*4+2]=M.rgb[A]&255,R[A*4+3]=n.skip?.[A]===1?0:255;let[T,w]=n.toDevice(0,0);e.save(),e.setTransform(1,0,0,1,0,0),yh(e,t),e.fillWithTile({width:M.width,height:M.height,rgba:R},E-T,P-w,1,1,"nonzero"),e.restore();return}let y=n.kind==="solid"?n.rgb:n.tile.rgb[0],g=chunkI7XOR2GO_js._(r);dh(e,t,chunkI7XOR2GO_js.$(hh(y),g.colorTransform),g.gco);return}let s=t.bounds(),a=vn(e);if(!s)return;let u=Math.max(0,s.x0),l=Math.max(0,s.y0),c=a?Math.min(a.w,s.x1):s.x1,f=a?Math.min(a.h,s.y1):s.y1;if(c<=u||f<=l)return;let m={x:u,y:l,w:c-u,h:f-l},b=nn(m.w,m.h);if(!b)return;let h=chunkI7XOR2GO_js.la(e,m.x,m.y,m.w,m.h).data,d=chunkI7XOR2GO_js.la(b.ctx,0,0,m.w,m.h),p=d.data,x=t.data;for(let y=0;y<t.length*3;y+=3){let g=x[y];if(g<l||g>=f)continue;let M=Math.max(u,x[y+1]),E=Math.min(c,x[y+2]);for(let P=M;P<E;P++){if(ph(n,P,g))continue;let R=((g-l)*m.w+(P-u))*4,T;if(n.kind==="solid")T=n.rgb;else {let[A,I]=n.toDevice(P,g);T=chunkI7XOR2GO_js.j(n.tile,A,I,n.orgX,n.orgY);}let w=T;if(i){let A=p[R+3]===255?p[R]<<16|p[R+1]<<8|p[R+2]:h[R]<<16|h[R+1]<<8|h[R+2];w=qe(o,T,A,A);}else w=qe(o,T,0,0);p[R]=w>>16&255,p[R+1]=w>>8&255,p[R+2]=w&255,p[R+3]=255;}}rn(e,m,b,d);}var hM=[[[0,-8],[-8,0],[0,8],[8,0]],[[8,-16],[-8,-16],[-16,0],[-8,16],[8,16],[16,0]],[[8,-24],[-8,-24],[-24,-8],[-24,8],[-8,24],[8,24],[24,8],[24,-8]],[[8,-32],[-8,-32],[-24,-24],[-32,-8],[-32,8],[-24,24],[-8,32],[8,32],[24,24],[32,8],[32,-8],[24,-24]],[[8,-40],[-8,-40],[-24,-32],[-32,-24],[-40,-8],[-40,8],[-32,24],[-24,32],[-8,40],[8,40],[24,32],[32,24],[40,8],[40,-8],[32,-24],[24,-32]],[[8,-48],[-8,-48],[-24,-40],[-40,-24],[-48,-8],[-48,8],[-40,24],[-24,40],[-8,48],[8,48],[24,40],[40,24],[48,8],[48,-8],[40,-24],[24,-40]]],Il=104;function dM(e,t){return e?t?.5:-0.5:0}function pM(e,t){if(Number.isSafeInteger(e)&&Number.isSafeInteger(t))return Math.floor(e/t);let n=BigInt(Math.round(e)),r=BigInt(Math.round(t)),o=n/r;return n%r!==0n&&n<0n!=r<0n&&(o-=1n),Number(o)}var gh=new Map;function Sl(e,t=e){let n=`${e},${t}`,r=gh.get(n);if(r)return r;let o;if(e===t&&e<Il){let i=Math.min(6,Math.max(1,Math.floor(e/16+.5)));o=hM[i-1];}else {let i=Math.ceil(e/2),s=Math.ceil(t/2),a=chunkI7XOR2GO_js.A(chunkI7XOR2GO_js.z(-i,-s,i,s)),u=[];for(let l=0;l+1<a.length&&(u.push([a[l],a[l+1]]),!(l>0&&a[l+1]===0));l+=2);u.pop(),o=[...u,...u.map(l=>[0-l[0]||0,0-l[1]||0])];}return gh.set(n,o),o}var wl=new Map;function ta(e){return Math.sign(e)*Math.floor(Math.abs(e)+.75)}function xM(e,t){let n=`${e},${t.join(",")}`,r=wl.get(n);if(r)return r;let o=Math.hypot(t[0],t[1]);if(Math.abs(Math.hypot(t[2],t[3])-o)<1e-4*o&&Math.abs(t[0]*t[2]+t[1]*t[3])<1e-4*o*o&&e*o<Il){let b=Sl(Math.round(e*o));return wl.set(n,b),b}let i=e/2,s=t[0]*t[3]-t[1]*t[2]<0?-1:1,a=[ta(t[0]*i),ta(t[1]*i)],u=[s*ta(t[2]*i),s*ta(t[3]*i)],l=chunkI7XOR2GO_js.y({ax:-a[0]-u[0],ay:-a[1]-u[1],exx:2*a[0],exy:2*a[1],eyx:2*u[0],eyy:2*u[1]}),c=chunkI7XOR2GO_js.A(l.slice(0,14)),f=[];for(let b=0;b+1<c.length;b+=2)f.push([c[b],c[b+1]]);f.pop();let m=[...f,...f.map(b=>[0-b[0]||0,0-b[1]||0])];return wl.set(n,m),m}function yM(e,t,n,r=1,o=r,i){let s=e.length,a=e.some(d=>d[1]===0),u=Math.abs(n)*(r===o?1:r),l=Math.abs(t)*(r===o?2:o);if(i){let d=i[0]*i[3]-i[1]*i[2];l=Math.abs((i[3]*t-i[2]*n)/d),u=Math.abs((-i[1]*t+i[0]*n)/d);}let f=(u>l||u===l&&a?n<0:t<0||t===0&&n<0)?-1:1;i&&i[0]*i[3]-i[1]*i[2]<0&&(f=-f);let m=0,b=-1/0,h=0;for(let d=0;d<s;d++){let p=n*e[d][0]-t*e[d][1],x=f*(t*e[d][0]+n*e[d][1]);(p>b||p===b&&x>h)&&(b=p,m=d,h=x);}return [m,(m+s/2)%s]}function na(e){return Math.sign(e)*8*Math.floor((Math.abs(e)+4)/8)}function gM(e,t,n,r=e,o){let i=t,s=n,a=i<0||i===0&&s<0;a&&(i=-i,s=-s);let u=o??Sl(e,r),l=u.length,c=-s,f=i,m=0,b=-1/0;for(let k=0;k<l;k++){let F=c*u[k][0]+f*u[k][1];F>b&&(b=F,m=k);}a&&m===0&&c*u[l-1][0]+f*u[l-1][1]===b&&(m=l-1);let h=u[(m+l-1)%l],d=u[(m+1)%l],p=u[m],x=c*h[0]+f*h[1],y=c*d[0]+f*d[1],[g,M,E]=x>=y?[h,x,y]:[d,y,x],P=2*(b-M+(b-E)),R=P===0?0:(M-E)/P,T=p[0]+(g[0]-p[0])*R,w=p[1]+(g[1]-p[1])*R,A=M-E,I=k=>Math.sign(P===0?p[k]:p[k]*P+(g[k]-p[k])*A),S=o?[I(0)!==0?-I(0):i===0?0:Math.sign(s),I(1)!==0?I(1):Math.sign(i)]:[i===0?0:Math.sign(s),Math.sign(i)],v=o?m<l/2:m===0&&x>=y,C=[0,1].map(k=>{let F=S[k]+2*dM(Math.abs(g[k]-p[k])%2===1,v);if(P===0)return 8*(k===1&&s<0?Math.ceil((p[k]+F/2+4)/8)-1:Math.floor((p[k]+F/2+4)/8));let _=p[k]*P+(g[k]-p[k])*A;return 8*pM(2*_+P*(F+8)-(k===1&&s<0?1:0),16*P)}),U=C[0],L=C[1];return {v:a?[-U,-L]:[U,L],ray:a?[-T,-w]:[T,w]}}function bn(e,t){return Math.sqrt(e*e+t*t)}function Mh(e,t,n,r=1,o=e,i,s=false,a=s,u=1){if(i){let d=i[0]*i[3]-i[1]*i[2],p=(i[3]*t-i[2]*n)/d,x=(-i[1]*t+i[0]*n)/d,y=Math.hypot(p,x);if(s&&(y=bn(Math.sign(p)*Math.floor((Math.abs(p)+8)/16)*16,Math.sign(x)*Math.floor((Math.abs(x)+8)/16)*16),y===0))return [0,0];let g=e/2*r/y,M=a?E=>Math.sign(E)*Math.floor(Math.abs(E)+.5):E=>Math.floor(E+.5);return [M((i[0]*p+i[2]*x)*g),M((i[1]*p+i[3]*x)*g)]}let[c,f]=typeof u=="number"?[u,u]:u,m=e/2*r,b=a?d=>Math.sign(d)*Math.floor(Math.abs(d)+.5):d=>Math.floor(d+.5);if(s&&(e===o||c!==f)){let d=t/c,p=n/f,x=c===1&&f===1?0:8,y=M=>x?Math.sign(M)*Math.floor((Math.abs(M)+x)/16)*16:Math.floor(M/16)*16,g=bn(y(d),y(p));return g===0?[0,0]:[b(d/g*m),b(p*f/c/g*m)]}let h=e===o?bn(t,n):bn(t,n*e/o);return [b(t/h*m),b(n/h*m)]}function ra(e,t,n,r){let o=e*r-t*n;if(o!==0)return o;if(e*n+t*r>=0)return 0;let i=e>=0?1:-1,s=t>=0?1:-1,a=Math.abs(t)>Math.abs(e)||Math.abs(t)===Math.abs(e)&&t>0;return i*s<0!==a?-1:1}var Al=class{constructor(t,n){this.opts=t;this.out=n;this.pts=[];this.pen=t.matrix&&t.deviceNib?xM(t.width,t.matrix):Sl(t.width,t.height),this.n=this.pen.length,this.rr=t.cap==="round"&&t.join==="round",this.originalRoundJoinSides=t.join==="round"&&t.cap!=="flat",this.maxX=Math.max(...this.pen.map(r=>Math.abs(r[0])));}seg(t,n,r,o,i=false){let s=r?r[0]:n[0]-t[0],a=r?r[1]:n[1]-t[1],u=o??[s,a],l=this.opts.deviceNib?this.opts.matrix:void 0,[c,f]=yM(this.pen,u[0],u[1],this.opts.width,this.opts.height,l),m=i&&o?o:[s,a],b=gM(this.opts.width,m[0],m[1],this.opts.height,l?this.pen:void 0),h=!!o&&s*o[0]+a*o[1]<0;return {dx:s,dy:a,tx:h?o[0]:s,ty:h?o[1]:a,L:c,R:f,v:b.v,vRaw:b.ray,e:Mh(this.opts.capWidth??this.opts.width,m[0],m[1],1,this.opts.height??this.opts.capWidth,l,!!(this.opts.wholePixelDashVectors||this.opts.cutToLogicalUnits),void 0,this.opts.logicalScale),pe:[m[0],m[1]],curveEnd:!!o,role:o?.[2]??3,tangentLength:o?o[0]*o[0]+o[1]*o[1]:0,curve:i}}push(t,n){this.pts.push([t[0]+n[0],t[1]+n[1]]);}penAt(t,n){let r=this.pen[n];(t[0]&15)===0&&(t[1]&15)===0?this.push(t,[r[0]-Math.sign(r[0]),r[1]-Math.sign(r[1])]):this.push(t,r);}walk(t,n,r,o,i){if(o&&this.penAt(t,n),n!==r){for(let s=(n+1)%this.n;s!==r;s=(s+1)%this.n)this.penAt(t,s);i&&this.penAt(t,r);}}wedge(t,n,r,o,i,s=-1){let a=Math.PI*2,u=Math.atan2(n[1],n[0]),l=b=>{let h=(u-Math.atan2(b[1],b[0]))%a;return h<0&&(h+=a),h},c=(b,h)=>b[0]*h[1]-b[1]*h[0]===0&&b[0]*h[0]+b[1]*h[1]>0,f=c(n,r)?a:l(r),m=[];for(let b=0;b<this.n;b++){let h=this.pen[b];if(c(n,h))o&&m.push([0,b]);else if(c(r,h))i&&m.push([f,b]);else {let d=l(h);d<f&&m.push([d,b]);}}m.sort((b,h)=>b[0]-h[0]),s>=0&&!m.some(([,b])=>b===s)&&m.push([1/0,s]);for(let[,b]of m)this.penAt(t,b);}extremeTail(t,n,r){let o=this.pen[n];return t&&Math.abs(r.dy)>Math.abs(r.dx)&&Math.abs(o[0])===this.maxX&&o[1]===0?n:-1}joinSide(t,n){if(this.originalRoundJoinSides||t.curve){let r=this.pen[n==="L"?t.L:t.R];return [na(r[0]),na(r[1])]}return n==="R"?t.v:[-t.v[0],-t.v[1]]}capSide(t,n){if(this.rr){let r=this.pen[n==="L"?t.L:t.R];return [na(r[0]),na(r[1])]}return n==="R"?t.v:[-t.v[0],-t.v[1]]}cap(t,n,r,o=1){let i=r?"L":"R",s=r?"R":"L",{cap:a}=this.opts;if(a==="round"){if(this.push(t,this.capSide(n,i)),this.rr)this.walk(t,n[i],n[s],false,false);else {let c=i==="R"?n.vRaw:[-n.vRaw[0],-n.vRaw[1]];this.wedge(t,c,[-c[0],-c[1]],true,false);}this.push(t,this.capSide(n,s));return}let u=this.capSide(n,i),l=this.capSide(n,s);if(a==="square"){let c=o===1||n.curveEnd?n.e:this.scaledExtension(n,o),f=r?[-c[0],-c[1]]:c;this.push(t,[u[0]+f[0],u[1]+f[1]]),this.push(t,[l[0]+f[0],l[1]+f[1]]);}else this.push(t,u),this.push(t,l);}scaledExtension(t,n){let r=this.opts;if(r.wholePixelDashVectors&&!r.matrix&&!r.dashMetric&&(r.height===void 0||r.height===r.width)){let o=bn(Math.floor(t.pe[0]/16),Math.floor(t.pe[1]/16))*16;if(o>0){let i=Math.fround(r.width/2/o),s=a=>Math.sign(a)*Math.floor(Math.fround(Math.abs(a)*i)+.5);return [s(t.pe[0]),s(t.pe[1])]}}return Mh(r.width,t.pe[0],t.pe[1],n,r.height,r.deviceNib?r.matrix:void 0,false,!!r.wholePixelDashVectors)}join(t,n,r,o,i){let{cap:s,width:a,miterLimit:u}=this.opts,l=n.curve&&r.curve,c=l?"round":this.opts.join,f=this.originalRoundJoinSides||l,m=this.joinSide(n,o),b=this.joinSide(r,o),h=o==="R"?n.vRaw:[-n.vRaw[0],-n.vRaw[1]],d=o==="R"?r.vRaw:[-r.vRaw[0],-r.vRaw[1]];if(l&&!this.originalRoundJoinSides&&n.curveEnd&&r.curveEnd&&((o==="R"?n:r).role&2)!==0&&((o==="R"?r:n).role&1)!==0){let y=n.tangentLength>=r.tangentLength?n:r;m=b=o==="R"?y.v:[-y.v[0],-y.v[1]];}!l&&!this.originalRoundJoinSides&&(n.curve&&n.curveEnd&&(m=o==="R"?n.v:[-n.v[0],-n.v[1]]),r.curve&&r.curveEnd&&(b=o==="R"?r.v:[-r.v[0],-r.v[1]]));let p=o==="R"?n.R:n.L,x=o==="R"?r.R:r.L;if(f&&(p===x||l&&m[0]===b[0]&&m[1]===b[1])){this.push(t,m);return}if(this.push(t,m),i){if(c==="round")if(f){let y=this.pen[x],g=Math.abs(r.dy)>Math.abs(r.dx),M=o==="L"&&g&&Math.abs(y[0])===this.maxX&&y[0]*y[1]<=0;this.walk(t,p,x,false,M);}else {let y=m[0]===-b[0]&&m[1]===-b[1];(p!==x||y)&&this.wedge(t,h,d,!y,false,this.extremeTail(o==="L"&&!y,x,r));}else if(c==="miter"){let y=PM(m,[n.dx,n.dy],b,[r.dx,r.dy],a,u,o,this.opts.height,this.opts.deviceNib?this.opts.matrix:void 0);y&&this.push(t,y);}}else {if(this.pts.push([t[0],t[1]]),l&&!this.originalRoundJoinSides){if(this.push(t,b),s==="flat"&&p!==x&&!(n.curveEnd&&r.curveEnd)){let y=this.pts.length;this.wedge(t,d,h,false,false,this.extremeTail(o==="L",p,n)),this.pts.length-y<2&&(this.pts.length=y);}this.push(t,m),this.pts.push([t[0],t[1]]);}c==="round"&&s==="flat"&&!l&&(this.push(t,b),p!==x&&this.wedge(t,d,h,false,false,this.extremeTail(o==="L",p,n)),this.push(t,m),this.pts.push([t[0],t[1]]));}this.push(t,b);}flush(){let t=[],n=NaN,r=NaN;for(let[o,i]of this.pts)(o!==n||i!==r)&&(t.push(o,i),n=o,r=i);for(;t.length>=4&&t[0]===t[t.length-2]&&t[1]===t[t.length-1];)t.length-=2;t.length>=6&&this.out.push(t),this.pts=[];}open(t,n,r,o,i=1,s=1){if(t.length<2&&!n?.[0]){this.dot(t[0]);return}let a=[];for(let u=0;u+1<t.length;u++)a.push(this.seg(t[u],t[u+1],n?.[u],r?.[u],o?.[u]));if(a.length===0){let u=this.seg(t[0],t[0],n?.[0],r?.[0],o?.[0]);this.cap(t[0],u,true,i),this.cap(t[0],u,false,s),this.flush();return}this.cap(t[0],a[0],true,i);for(let u=0;u+1<a.length;u++){let l=a[u],c=a[u+1],f=ra(l.tx,l.ty,c.tx,c.ty);f===0?this.push(t[u+1],this.joinSide(l,"R")):this.join(t[u+1],l,c,"R",f<0);}this.cap(t[t.length-1],a[a.length-1],false,s);for(let u=a.length-1;u>0;u--){let l=a[u],c=a[u-1],f=ra(c.tx,c.ty,l.tx,l.ty);f===0?this.push(t[u],this.joinSide(l,"L")):this.join(t[u],l,c,"L",f>0);}this.flush();}closed(t,n,r){let o=t.length,i=[];for(let s=0;s<o;s++)i.push(this.seg(t[s],t[(s+1)%o],void 0,n?.[s],r?.[s]));for(let s=1;s<=o;s++){let a=s%o,u=i[(a+o-1)%o],l=i[a],c=ra(u.tx,u.ty,l.tx,l.ty);c===0?this.push(t[a],this.joinSide(u,"R")):this.join(t[a],u,l,"R",c<0);}this.flush();for(let s=0;s<o;s++){let a=(o-s)%o,u=i[a],l=i[(a+o-1)%o],c=ra(l.tx,l.ty,u.tx,u.ty);c===0?this.push(t[a],this.joinSide(u,"L")):this.join(t[a],u,l,"L",c>0);}this.flush();}dot(t){if(this.opts.cap!=="round")return;let n=t[0]%16===0&&t[1]%16===0,r=this.opts.matrix,o=!this.opts.deviceNib||!r||r[1]===0&&r[2]===0,i=!this.opts.deviceNib&&(this.opts.height===void 0||this.opts.height===this.opts.width)&&this.opts.width<Il;for(let s=0;s<this.n;s++){let a=this.pen[s],u=i?s===0||s===this.n/2:a[0]===0;this.push(t,n&&o&&!u?[a[0]-Math.sign(a[0]),a[1]-Math.sign(a[1])]:a);}this.flush();}};function oa(e){return Math.sign(e)*Math.floor((Math.abs(e)+8)/16)*16}function Eh(e,t,n,r){let o=Math.abs(t)*(n/r),i=Math.fround(e+(t<0?-o:o));return t<0?Math.ceil(i-.5):Math.floor(i+.5)}function MM(e,t,n,r,o,i,s,a){let u=[],l=[];for(let h=0;h<r.length;h+=2){let d=r[h],p=r[h+1]??0,x=Math.min(d,o);l.push(d-x,p+x);}if(l.reduce((h,d)=>h+d,0)<=0)return [];let c=0,f=l[0],m=true,b={pts:[e[0]],dirs:[],draws:[],curves:[],startScale:1,endScale:1};for(let h=0;h+1<e.length;h++){let[d,p]=e[h],[x,y]=e[h+1],g=[x-d,y-p],M=a?a[0]*a[3]-a[1]*a[2]:1,E=a?Math.hypot((a[3]*g[0]-a[2]*g[1])/M,(-a[1]*g[0]+a[0]*g[1])/M):s?Math.hypot(g[0]/s[0],g[1]/s[1]):bn(g[0],g[1]),P=s?bn(oa(g[0]/s[0]),oa(g[1]/s[1])):a?bn(oa((a[3]*g[0]-a[2]*g[1])/M),oa((-a[1]*g[0]+a[0]*g[1])/M)):i?bn(Math.floor(g[0]/16),Math.floor(g[1]/16))*16:bn(g[0],g[1]);if(P===0){m&&b&&(b.pts.push(e[h+1]),b.dirs.push(g),b.draws.push(t[h]),b.curves.push(n[h]));continue}let R=0;for(;P-R>f||f===0&&m;){R+=f;let T=[Eh(d,g[0],R,P),Eh(p,g[1],R,P)];m&&b?(b.pts.push(T),b.dirs.push(g),b.draws.push(t[h]),b.curves.push(n[h]),b.endScale=b.pts[0]===e[0]&&T[0]===e[0][0]&&T[1]===e[0][1]?1:E/P,u.push(b),b=null):b={pts:[T],dirs:[],draws:[],curves:[],startScale:E/P,endScale:1},m=!m,c=(c+1)%l.length,f=l[c];}f-=P-R,m&&b&&(b.pts.push(e[h+1]),b.dirs.push(g),b.draws.push(t[h]),b.curves.push(n[h]),b.endScale=E/P);}return m&&b&&b.dirs.length>0&&(b.endScale=1,u.push(b)),u}function EM(e,t,n){let[r,o,i,s]=n,a=r*s-o*i,u=(f,m)=>[(s*f-i*m)/a,(-o*f+r*m)/a],l=new chunkI7XOR2GO_js.G;for(let f of e.figures){let m=[];for(let h=0;h+1<f.pts.length;h+=2)m.push(...u(f.pts[h],f.pts[h+1]));let b={pts:m,closed:f.closed,roundWiden:f.roundWiden,curveSegs:f.curveSegs,tangentRoles:f.tangentRoles};f.tangents&&(b.tangents=new Map([...f.tangents].map(([h,d])=>[h,u(d[0],d[1])]))),l.figures.push(b);}return ai(l,{...t,matrix:void 0,height:void 0}).map(f=>{let m=[];for(let b=0;b+1<f.length;b+=2)m.push(Math.round(r*f[b]+i*f[b+1]),Math.round(o*f[b]+s*f[b+1]));return m})}function ai(e,t){if(t.matrix&&!t.deviceNib)return EM(e,t,t.matrix);let n=[],r=!!t.dashes&&t.dashes.length>0;for(let o of e.figures){let i=new Al(t,n),s=[],a=[],u=[];for(let c=0;c+1<o.pts.length;c+=2){let f=[o.pts[c],o.pts[c+1]],m=s[s.length-1];if(!(m&&m[0]===f[0]&&m[1]===f[1])){if(m){{let b=o.tangents?.get(c/2-1);a.push(b&&[b[0],b[1],(o.roundWiden?3:o.tangentRoles?.get(c/2-1))??3]);}u.push(!!o.roundWiden||!!o.curveSegs?.has(c/2-1));}s.push(f);}}if(s.length===0)continue;let l=o.closed&&s.length>=2;if(l&&s.length>=2&&s[0][0]===s[s.length-1][0]&&s[0][1]===s[s.length-1][1]&&(s=s.slice(0,-1)),r){let c=l?[...s,s[0]]:s,f=t.cap==="flat"||t.shortenDashes===false?0:t.dashMetric?t.width/t.dashMetric[0]:t.width,m=l?[...a,void 0]:a,b=l?[...u,!!o.roundWiden]:u;for(let h of MM(c,m,b,t.dashes,f,!!t.wholePixelDashVectors,t.dashMetric,t.deviceNib?t.matrix:void 0)){let d=h.pts,p=h.dirs,x=h.draws,y=h.curves;i.open(d,p.length>0?p:[h.dirs[0]],p.length>0?x:[h.draws[0]],p.length>0?y:[h.curves[0]],h.startScale,h.endScale);}}else l&&s.length>=3||l&&s.length===2?i.closed(s,a,u):i.open(s,void 0,a,u);}return n}function PM(e,t,n,r,o,i,s,a=o,u){let l=t[0]*r[1]-t[1]*r[0];if(l===0)return null;let c=n[0]-e[0],f=n[1]-e[1],m=(c*r[1]-f*r[0])/l,b=e[0]+t[0]*m,h=e[1]+t[1]*m,d=Math.sign(b)*Math.floor(Math.abs(b)+.5),p=Math.sign(h)*Math.floor(Math.abs(h)+.5),x=s==="L"?Math.ceil:Math.floor;if(u){let g=u[0]*u[3]-u[1]*u[2],M=(u[3]*d-u[2]*p)/g,E=(-u[1]*d+u[0]*p)/g;return Math.hypot(Math.round(M/16),Math.round(E/16))>i*o/32?null:[d,p]}let y=a===o?x(p/16):x(p/16)*o/a;return Math.hypot(x(d/16),y)>i*o/32?null:[d,p]}function vl(e){let t=/^#?([0-9a-f]{6})$/i.exec(e.trim());return t?parseInt(t[1],16):0}function ge(e,t,n){let r=Ee(e),o=Math.round((r[0]*t+r[2]*n)*16)+Math.round(r[4]*16),i=Math.round((r[1]*t+r[3]*n)*16)+Math.round(r[5]*16),s=e.wholeDevicePixels;if(s){let a=16*s[0],u=16*s[1];return [Math.round(Math.floor(o/a+.5)*a),Math.round(Math.floor(i/u+.5)*u)]}return [o,i]}function ui(e,t,n,r,o){let[i,s]=ge(e,t,n),[a,u]=ge(e,r,n),[l,c]=ge(e,t,o);return {ax:i,ay:s,exx:a-i,exy:u-s,eyx:l-i,eyy:c-s}}function Tt(e){return e.exy===0&&e.eyx===0}function RM(e){let{ax:t,ay:n,exx:r,exy:o,eyx:i,eyy:s}=e;return [t+r,n+o,t,n,t+i,n+s,t+r+i,n+o+s]}function TM(e){return {ax:e.ax+e.eyx,ay:e.ay+e.eyy,exx:e.exx,exy:e.exy,eyx:-e.eyx,eyy:-e.eyy}}function yr(e,t=false){let n=RM(t?TM(e):e);e.halfXRect&&(n[4]--,n[6]--);let r=new chunkI7XOR2GO_js.G;return r.moveTo(n[0],n[1]),r.lineTo(n[2],n[3]),r.lineTo(n[4],n[5]),r.lineTo(n[6],n[7]),r.closeFigure(),r}function li(e,t=false){let n=new chunkI7XOR2GO_js.G;return n.addBeziers(chunkI7XOR2GO_js.y(e,t),true),n.closeFigure(),n.figures[0].roundWiden=true,n}function Ph(e,t,n,r,o){return Tt(e)?(i,s)=>[i,s]:(i,s)=>{let a=r!==0?(i-t)/r:0,u=o!==0?(s-n)/o:0;return [Math.round(e.ax+e.exx*a+e.eyx*u),Math.round(e.ay+e.exy*a+e.eyy*u)]}}function Rh(e){if(Tt(e)){let r=e.ax,o=e.ax+e.exx,i=e.ay,s=e.ay+e.eyy;return {l:Math.min(r,o),t:Math.min(i,s),r:Math.max(r,o),b:Math.max(i,s)}}let t=Math.round(Math.hypot(e.exx,e.exy)),n=Math.round(Math.hypot(e.eyx,e.eyy));return {l:0,t:0,r:t,b:n}}function Cl(e,t,n,r=false,o=false){let i=Rh(e),s=Tt(e)&&e.exx<0,a=Tt(e)&&e.eyy<0,u=r!==a,l=chunkI7XOR2GO_js.B(i.l,i.t,i.r,i.b,t,n,o,u,s,Tt(e)?e.cornerRatio:void 0),c=Ph(e,i.l,i.t,i.r-i.l,i.b-i.t),f=[];for(let m=0;m<l.length;m+=2)f.push(...c(l[m],u?i.t+i.b-l[m+1]:l[m+1]));if(e.halfX)if(e.halfXCompat||!u){let m=(i.t+i.b)/2,b=(i.b-i.t)/2||1;for(let h=0;h<16;h++){let d=(m-f[2*h+1])/b;f[2*h]+=h>=8?Math.round(1+d):Math.ceil(d-.5);}}else {let m=e.cornerExact!==void 0&&e.cornerExact[1]*2>=Math.abs(e.eyy)-1e-9;for(let b of m?[1,2,3,4,5,6,8,15]:[0,1,2,3,4,5,6,7])f[2*b]++;}if(e.cornerExact&&Tt(e)){let m=i.r-i.l,b=i.b-i.t;if(m>=0&&b>=0){let h=m===0?0:Math.round(e.cornerExact[0]*(s?m-m%2:m+m%2)/m/2),d=b===0?0:Math.round(e.cornerExact[1]*(u?b+b%2:b-b%2)/b/2),p=s?Math.floor(chunkI7XOR2GO_js.w*h):Math.ceil(chunkI7XOR2GO_js.w*h),x=u?Math.ceil(chunkI7XOR2GO_js.w*d):Math.floor(chunkI7XOR2GO_js.w*d),y=(M,E,P)=>{E!==null&&(f[2*M]=E),f[2*M+1]=u?i.t+i.b-P:P;},g=e.halfX?1:0;y(0,null,i.t+d),y(1,null,i.t+d-x),y(2,i.r+g-h+p,i.t),y(3,i.r+g-h,i.t),y(4,i.l+g+h,i.t),y(5,i.l+g+h-p,i.t),y(6,null,i.t+d-x),y(7,null,i.t+d),y(8,null,i.b-d),y(9,null,i.b-d+x),y(10,i.l+h-p,i.b),y(11,i.l+h,i.b),y(12,i.r-h,i.b),y(13,i.r-h+p,i.b),y(14,null,i.b-d+x),y(15,null,i.b-d);}}if(s)for(let m=0;m<f.length;m+=2)f[m]=i.l+i.r-f[m];return f}function sa(e,t,n,r=false,o=false,i=false){if(o)return yr(e,r);let s=Cl(e,t,n,r,i),a=new chunkI7XOR2GO_js.G;for(let u=0;u<4;u++){let l=u*8;a.addBeziers(s.slice(l,l+8),u===0);}return a.closeFigure(),a}function no(e,t,n,r,o,i,s=new chunkI7XOR2GO_js.G,a){let u=Rh(e),l=Ph(e,u.l,u.t,u.r-u.l,u.b-u.t),c=t[0],f=t[1],m=n[0],b=n[1],h=r;if(Tt(e))a?(h=r!==a.y,a.x&&(c=u.l+u.r-c,m=u.l+u.r-m)):e.exx<0!=e.eyy<0&&(h=!h);else {let y=e.exx*e.eyy-e.exy*e.eyx||1,g=(M,E)=>{let P=M-e.ax,R=E-e.ay,T=(P*e.eyy-R*e.eyx)/y,w=(e.exx*R-e.exy*P)/y;return [u.l+T*(u.r-u.l),u.t+w*(u.b-u.t)]};[c,f]=g(c,f),[m,b]=g(m,b),y<0&&(h=!h);}let d=!!a?.x&&Tt(e),p=chunkI7XOR2GO_js.F(u.l,u.t,u.r,u.b,c,f,m,b,h,!!e.halfX,!!e.framed,d),x=[];for(let y=0;y<p.length;y+=2)x.push(...l(p[y],p[y+1]));if(o==="arcto"&&i?(s.continueAt(i[0],i[1]),s.addBeziers(x,false)):s.addBeziers(x,true),o==="pie"){let y=u.r-u.l,g=u.b-u.t,[M,E]=l(u.l+Math.ceil(y/2)+(e.halfX&&!d?1:0),u.t+Math.ceil(g/2));s.lineTo(M,E);}return (o==="pie"||o==="chord")&&s.closeFigure(),{path:s,end:[x[x.length-2],x[x.length-1]]}}var Th=5,wM=65536;function aa(e){let t=Ee(e),n=Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2])),r=e.wholeDevicePixels;return r?Math.round(e.state.penWidth*n/r[0])*r[0]:e.state.penWidth*n}function yt(e){return ((e.state.penFlags??e.state.penStyle)&wM)===0&&e.state.penExtended?true:Math.round(aa(e)/(e.wholeDevicePixels?.[0]??1))<=1}function Dl(e){return (e.state.penStyle&15)!==Th}function Ll(e,t={}){let{state:n}=e,r=n.penFlags??n.penStyle,o=Ee(e),i=e.wholeDevicePixels&&(r&15)===6?n.penWidth*Math.sqrt(Math.abs(o[0]*o[3]-o[1]*o[2])):aa(e),s=r&3840,a=r&61440,u=!e.wholeDevicePixels&&n.penWidth*Math.abs(o[0])*16>=1&&n.penWidth*Math.abs(o[3])*16>=1&&Math.abs(o[1])<1e-6&&Math.abs(o[2])<1e-6&&Math.abs(Math.abs(o[0])-Math.abs(o[3]))>1e-6,l=o[0]*o[3]-o[1]*o[2],c=Math.abs(o[1])>=1e-6||Math.abs(o[2])>=1e-6,f=Math.abs(o[0])<1e-9&&Math.abs(o[3])<1e-9,m=!e.wholeDevicePixels&&(c&&!f||u&&o[0]<0)&&Math.abs(l)>1e-9&&n.penWidth*Math.sqrt(Math.abs(l))*16>=1,b=Math.abs(o[1])<1e-6&&Math.abs(o[2])<1e-6,h=!e.wholeDevicePixels&&b&&(Math.abs(Math.abs(o[0])-1)>1e-6||Math.abs(Math.abs(o[3])-1)>1e-6),d=n.penExtended?u||m||h?chunkI7XOR2GO_js.J(r,n.penWidth,n.penUserStyle,1):chunkI7XOR2GO_js.J(r,i,n.penUserStyle,i/(n.penWidth||1)):null,p=(u||h)&&!m&&d?[Math.abs(o[0]),Math.abs(o[3])]:void 0;if(m)return {width:Math.round(n.penWidth*16),matrix:[o[0],o[1],o[2],o[3]],deviceNib:true,cap:t.roundPen||!n.penExtended||s===0?"round":s===256?"square":"flat",join:t.roundPen?"round":t.rectangle&&!n.penExtended?"miter":!n.penExtended||a===0?"round":a===4096?"bevel":"miter",miterLimit:n.miterLimit??10,dashes:d?d.map(y=>y*16):null,shortenDashes:(r&15)!==7,cutToLogicalUnits:!d};let x=h&&!u&&n.penExtended&&(r&15)!==6;return {width:Math.round((u?n.penWidth*Math.abs(o[0]):i)*16),...u?{height:Math.round(n.penWidth*Math.abs(o[3])*16)}:{},cap:t.roundPen||!n.penExtended||s===0?"round":s===256?"square":"flat",join:t.roundPen?"round":t.rectangle&&!n.penExtended?"miter":!n.penExtended||a===0?"round":a===4096?"bevel":"miter",miterLimit:n.miterLimit??10,dashes:d?d.map(y=>y*16):null,...p?{dashMetric:p}:{},shortenDashes:(r&15)!==7,wholePixelDashVectors:Math.abs(o[0]-1)<1e-6&&Math.abs(o[3]-1)<1e-6&&Math.abs(o[1])<1e-6&&Math.abs(o[2])<1e-6,...h?{cutToLogicalUnits:true,logicalScale:u?[Math.abs(o[0]),Math.abs(o[3])]:Math.abs(o[0]),...x?{capWidth:n.penWidth*Math.abs(o[0])*16}:{}}:{}}}function AM(e){let t=new Uint8Array(64);for(let n=0;n<8;n++)for(let r=0;r<8;r++)t[n*8+r]=chunkI7XOR2GO_js.f(e,r,n)?0:1;return t}function on(e){let t=chunkI7XOR2GO_js.i(e.state);if(t.kind==="none")return null;if(t.kind==="solid")return {kind:"solid",rgb:t.rgb};let n=e.sx||1,r=e.sy||1,{bounds:o,state:i}=e;return {kind:"tile",tile:t,toDevice:(s,a)=>[Math.floor(o.left+(s+.5)/n),Math.floor(o.top+(a+.5)/r)],orgX:i.brushOrgX,orgY:i.brushOrgY,...i.bkMode===1&&i.brushPattern?.kind==="hatch"?{skip:AM(i.brushPattern.hatch)}:{}}}function IM(e){if(!e.figures.some(n=>n.tangents))return e;let t=new chunkI7XOR2GO_js.G;return t.figures=e.figures.map(n=>({pts:n.pts,closed:n.closed,roundWiden:n.roundWiden})),t}function ia(e,t,n=false){if(!e.wmfLayoutRtl||n)return t;let r=Math.round(16*(e.wholeDevicePixels?.[0]??1)),o=new chunkI7XOR2GO_js.G;return o.figures=t.figures.map(i=>({...i,pts:i.pts.map((s,a)=>a%2===0?s-r:s)})),o}function wh(e,t,n){t=ia(e,t,n.rectangle||n.roundPen);let{ctx:r,state:o}=e,i=!!n.filled;if(n.fill){let c=on(e);if(c){i=true;let f=n.fillPath?ia(e,n.fillPath,n.rectangle||n.roundPen):t,m=chunkI7XOR2GO_js.H(f,!!n.winding);at(e,m,c,o.rop2);}}if(!n.stroke||o.penStyle===Th)return true;if(!yt(e)){if(!Dl(e))return false;let c=ai(i?IM(t):t,Ll(e,n));return at(e,chunkI7XOR2GO_js.u(c,true),{kind:"solid",rgb:vl(o.penColor)},o.rop2),true}let s=chunkI7XOR2GO_js.I(o.penFlags??o.penStyle,o.penUserStyle),a=new chunkI7XOR2GO_js.t,l=s!==null&&o.bkMode===2&&chunkI7XOR2GO_js.K(o.penFlags??o.penStyle)?new chunkI7XOR2GO_js.t:null;return chunkI7XOR2GO_js.L(t,a,l,s,n.style??{pos:0}),l&&at(e,l,{kind:"solid",rgb:vl(o.bkColor)},o.rop2),at(e,a,{kind:"solid",rgb:vl(o.penColor)},o.rop2),true}var Ul=.5-1/32;function Fl(e,t){return t===0?e:n=>{n.save(),n.translate(t,t),e(n),n.restore();}}function kl(e){return e.gdiAntialias===false}function SM(e,t,n){let{ctx:r,bounds:o,state:i}=e,s=chunkI7XOR2GO_js.i(i);if(s.kind!=="tile")return false;let a=e.sx||1,u=e.sy||1,l=eo(i.rop2)??240,c=i.bkMode===1&&i.brushPattern?.kind==="hatch"?i.brushPattern.hatch:-1,f=(x,y)=>c>=0&&!chunkI7XOR2GO_js.f(c,((x-i.brushOrgX)%8+8)%8,((y-i.brushOrgY)%8+8)%8);if(chunkI7XOR2GO_js.qa(r)&&(l===240||!r.canReadPixels)){let x=new Uint8ClampedArray(s.width*s.height*4);for(let y=0;y<s.rgb.length;y++){let g=s.rgb[y];x[y*4]=g>>>16&255,x[y*4+1]=g>>>8&255,x[y*4+2]=g&255,x[y*4+3]=c>=0&&!chunkI7XOR2GO_js.f(c,y%8,Math.floor(y/8))?0:255;}return r.fillWithTile({width:s.width,height:s.height,rgba:x},(i.brushOrgX-o.left)*a,(i.brushOrgY-o.top)*u,a,u,t),true}let m=vn(r);if(!m||typeof r.isPointInPath!="function")return false;if(l===170)return true;let b=n?Pl(n,1,m):{x:0,y:0,w:m.w,h:m.h};if(!b)return true;let h=.5-Ul,d=(x,y)=>chunkI7XOR2GO_js.j(s,Math.floor(o.left+(x+.5)/a),Math.floor(o.top+(y+.5)/u),i.brushOrgX,i.brushOrgY),p=chunkI7XOR2GO_js._(i.rop2);return to(r,b,(x,y,g)=>{if(!r.isPointInPath(x+h,y+h,t)||c>=0&&f(Math.floor(o.left+(x+.5)/a),Math.floor(o.top+(y+.5)/u)))return -1;let M=d(x,y);return l===240?M:qe(l,M,g,g)},(x,y)=>({color:El(d(x,y),p.colorTransform),mode:p.gco}))}function vM(e,t,n="nonzero",r){let{ctx:o,state:i}=e;if(i.brushStyle===1)return;let s=r??t;if(chunkI7XOR2GO_js.i(i).kind==="tile"){r&&r(o);let l=SM(e,n,s);if(r&&t(o),l)return}else {let l=chunkI7XOR2GO_js._(i.rop2);if((kl(e)||!l.exact&&Yn(i.rop2))&&Rl(o,i.rop2,i.brushColor,f=>{Fl(s,Ul)(f),f.fill(n);},1,n))return}let a=ze(e)?Ul:0,u=a!==0||r!==void 0;u&&Fl(s,a)(o),chunkI7XOR2GO_js.ba(o,i),o.fill(n),u&&t(o);}var ci=5;function gr(e,t=1){return Math.max(e.penWidth*t,1)}function Vn(e){let t=Ee(e);return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))||1}function Mr(e,t=1){if(e.penStyle===ci)return 0;let n=gr(e,t);return Number.isInteger(n)&&n%2===1?.5:0}function Ah(e,t){let{state:n}=t,r=Vn(t),o=gr(n,r),i=n.penFlags??n.penStyle;e.lineWidth=o;let s=yt(t);if(!s&&n.penExtended){let a=i&3840,u=i&61440;e.lineCap=a===256?"square":a===512?"butt":"round",e.lineJoin=u===4096?"bevel":u===8192?"miter":"round",e.miterLimit=n.miterLimit??10,e.setLineDash(chunkI7XOR2GO_js.J(i,o,n.penUserStyle,r)??[]);}else s?(e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.setLineDash([])):(e.lineCap="round",e.lineJoin="round",e.setLineDash([]));}function CM(e){let{state:t}=e;return t.penStyle===ci||!yt(e)?null:chunkI7XOR2GO_js.I(t.penFlags??t.penStyle,t.penUserStyle)}function DM(e,t,n,r){let{ctx:o,state:i}=e,s=i.penFlags??i.penStyle,a=n.reduce((m,b)=>m+b,0),u=chunkI7XOR2GO_js._(i.rop2),l=i.bkMode===2&&chunkI7XOR2GO_js.K(s),c=[];t.figures.forEach((m,b)=>{b>0&&(r.pos=0);let h=m.closed?[...m.pts,m.pts[0],m.pts[1]]:m.pts;for(let d=0;d+3<h.length;d+=2){let p=0;chunkI7XOR2GO_js.v(h[d],h[d+1],h[d+2],h[d+3],()=>{p++;}),p!==0&&(c.push([h[d],h[d+1],h[d+2],h[d+3],r.pos,p]),r.pos+=p);}});let f=m=>m/16+.5;o.save();try{o.globalCompositeOperation=u.gco,o.lineWidth=1,o.lineCap="butt";for(let m of l?["bk","fg"]:["fg"]){o.strokeStyle=chunkI7XOR2GO_js.$(m==="bk"?i.bkColor:i.penColor,u.colorTransform);for(let[b,h,d,p,x,y]of c){let g=Math.hypot(d-b,p-h)/16/y;m==="fg"?(o.setLineDash(n.map(M=>M*g)),o.lineDashOffset=x%a*g):o.setLineDash([]),o.beginPath(),o.moveTo(f(b),f(h)),o.lineTo(f(d),f(p)),o.stroke();}}}finally{o.setLineDash([]),o.lineDashOffset=0,o.restore();}}function LM(e,t){let{ctx:n,state:r}=e,o=Vn(e),i=Mr(r,o),s=Fl(t,i),a=chunkI7XOR2GO_js._(r.rop2);r.penStyle!==ci&&(kl(e)||!a.exact&&Yn(r.rop2))&&Rl(n,r.rop2,r.penColor,l=>{Ah(l,e),s(l),l.stroke();},gr(r,o)/2+2)||(i!==0&&s(n),chunkI7XOR2GO_js.aa(n,r),r.penStyle!==ci&&Ah(n,e),n.stroke());}function Qe(e,t){let{ctx:n,state:r}=e,o=kl(e),i=!chunkI7XOR2GO_js._(r.rop2).exact&&Yn(r.rop2),s=r.penStyle===ci,a=!s&&yt(e),u=null,l=()=>(u??(u=t.raster()),u),c=false,f=()=>{c||(t.build(n),c=true);},m=t.fillRule??"nonzero";if(t.fill&&r.brushStyle!==1){let h=chunkI7XOR2GO_js.i(r).kind==="tile";if(o||h||i){let d=on(e);if(d){let p=ia(e,l(),t.rectangle||t.roundPen),x=chunkI7XOR2GO_js.H(p,m==="nonzero");t.axisRect&&t.stroke&&a&&(x=UM(x,l())),at(e,x,d,r.rop2);}}else {f();let d=t.axisRect&&t.stroke&&!s?t.axisRect.interior:void 0;vM(e,t.build,m,d);}}if(!t.stroke||s)return;if((a||Dl(e))&&(o||i)){wh(e,l(),{fill:false,stroke:true,style:t.style,rectangle:t.rectangle,roundPen:t.roundPen,filled:!!t.fill&&r.brushStyle!==1});return}let b=CM(e);if(b&&!o&&!i){DM(e,l(),b,t.style??{pos:0});return}Xe(e),f(),LM(e,t.build);}function UM(e,t){let n=new chunkI7XOR2GO_js.t;chunkI7XOR2GO_js.L(t,n,null,null);let r=new Map,o=n.data;for(let a=0;a<n.length*3;a+=3){let u=r.get(o[a]);u||(u=[],r.set(o[a],u)),u.push([o[a+1],o[a+2]]);}let i=new chunkI7XOR2GO_js.t,s=e.data;for(let a=0;a<e.length*3;a+=3){let u=s[a],l=(r.get(u)??[]).slice().sort((m,b)=>m[0]-b[0]),c=s[a+1],f=s[a+2];for(let[m,b]of l)b<=c||m>=f||(i.add(u,c,Math.min(m,f)),c=Math.max(c,b));i.add(u,c,f);}return i}function Ih(e,t){let n=e.boundary.length;if(n<3||e.boundaryArgb.length<n||e.boundaryArgb.every(l=>l===e.boundaryArgb[0]))return null;let r=Nn(t,e.center.x,e.center.y),o=Mn(e.centerArgb),i=e.boundary.map(l=>Nn(t,l.x,l.y)),s=is(e.preset),a=s?{preset:s}:{adjust:os(e.blend)??void 0},u=[];for(let l=0;l<n;l++){let c=(l+1)%n;e.boundary[l].x===e.boundary[c].x&&e.boundary[l].y===e.boundary[c].y||u.push(new rs([r[0],r[1],i[l][0],i[l][1],i[c][0],i[c][1]],[o,Mn(e.boundaryArgb[l]),Mn(e.boundaryArgb[c])],a));}return {triangles:u}}function Sh(e,t,n,r,o,i=false){let s=null;for(let a of e.triangles){let u=a.row(n,r,o);if(!u||t<u.xl||t>=u.xl+u.n)continue;let l=(t-u.xl)*4;s=Do(u.argb[l],u.argb[l+1],u.argb[l+2],u.argb[l+3],i);}return s}var Bl=[1,0,0,1,0,0],Gl=16*1024*1024,FM=1e-4;function sn(e){let t=e[0]*e[3]-e[1]*e[2];if(!Number.isFinite(t)||Math.abs(t)<1e-12)return null;let n=e[3]/t,r=-e[1]/t,o=-e[2]/t,i=e[0]/t;return [n,r,o,i,-(n*e[4]+o*e[5]),-(r*e[4]+i*e[5])]}function kM(e){let t=e.canvas,n=t?.width,r=t?.height;return typeof n=="number"&&typeof r=="number"&&n>0&&r>0?{w:n,h:r}:null}function _M(e,t,n=false){let{width:r,height:o,rgba:i,wrapMode:s}=e;if(r<=0||o<=0)return null;let a=Jo(je(t,e.transform??Bl),n);return a?(u,l,c,f,m,b)=>{bb(a,r,o,i,s,u,l,c,f,m,b);}:null}function BM(e){if(e.length<3)return null;let t=1/0,n=1/0,r=-1/0,o=-1/0;for(let i of e)t=Math.min(t,i.x),n=Math.min(n,i.y),r=Math.max(r,i.x),o=Math.max(o,i.y);return r>t&&o>n?{x:t,y:n,w:r-t,h:o-n}:null}function vh(e,t,n,r,o){let i=e-t,s=Math.floor(i/n),a=i-s*n;return r&&(s%2+2)%2===1?t+n-o-a:t+a}function GM(e,t){let n=1/0,r=1/0,o=-1/0,i=-1/0;for(let[s,a]of [[e.x,e.y],[e.x+e.w,e.y],[e.x,e.y+e.h],[e.x+e.w,e.y+e.h]]){let u=t[0]*s+t[2]*a+t[4],l=t[1]*s+t[3]*a+t[5];n=Math.min(n,u),r=Math.min(r,l),o=Math.max(o,u),i=Math.max(i,l);}return [Math.floor(n+.5),Math.floor(r+.5),Math.floor(o+.5),Math.floor(i+.5)]}function _l(e,t){let n=1/0,r=1/0,o=-1/0,i=-1/0;for(let s of e){let a=t[0]*s.x+t[2]*s.y+t[4],u=t[1]*s.x+t[3]*s.y+t[5];n=Math.min(n,a),r=Math.min(r,u),o=Math.max(o,a),i=Math.max(i,u);}return [n,r,o,i].every(s=>Math.abs(s-Math.round(s))<1e-6)}var ua=2048;function la(e,t,n){if(!n)return (e%t+t)%t;let r=(e%(2*t)+2*t)%(2*t);return r<t?r:2*t-1-r}function OM(e,t,n){let r=e.points.map(s=>t({x:n[0]*s.x+n[2]*s.y+n[4],y:n[1]*s.x+n[3]*s.y+n[5]})),o=[];for(let s=0;s<r.length;s++)if((e.types[s]&7)===3&&s>0&&s+2<r.length){let a=r.slice(s-1,s+3).flatMap(l=>[Dt(l.x),Dt(l.y)]);o[o.length-1]={x:a[0]/16,y:a[1]/16};let u=[];jt(a,u);for(let l=0;l<u.length;l+=2)o.push({x:u[l]/16,y:u[l+1]/16});s+=2;}else o.push(r[s]);let i=o.length;return i>1&&o[0].x===o[i-1].x&&o[0].y===o[i-1].y&&o.pop(),o}function NM(e,t,n){if(Math.abs(n[1])>1e-9||Math.abs(n[2])>1e-9||n[0]<=0||n[3]<=0||!e.boundaryArgb.every(g=>g===e.boundaryArgb[0]))return null;let r=1/0,o=1/0,i=-1/0,s=-1/0;for(let g of e.source?e.source.points:e.boundary){let M=n[0]*g.x+n[4],E=n[3]*g.y+n[5];r=Math.min(r,M),o=Math.min(o,E),i=Math.max(i,M),s=Math.max(s,E);}let a=g=>Math.floor(g+.5),u=a(i)-a(r),l=a(s)-a(o);if(!(i>r)||!(s>o)||u<1||l<1||u*l>4*1024*1024)return null;let c=u/(i-r),f=l/(s-o),m=Jo([(i-r)/u,0,0,(s-o)/l,r,o]);if(!m)return null;let b=g=>({x:(n[0]*g.x+n[4]-r)*c,y:(n[3]*g.y+n[5]-o)*f}),h=Dh({...e,boundary:e.source?OM(e.source,b,n):e.boundary.map(b),source:void 0,center:b(e.center),transform:null},"clamp",Bl,false,true);if(!h)return null;let d=t==="tile-flip-x"||t==="tile-flip-xy",p=t==="tile-flip-y"||t==="tile-flip-xy",x=null,y=()=>{if(x)return x;let g=new Uint8ClampedArray(u*l*4);h(0,0,u,l,g),x=new Float64Array(u*l*4);for(let M=0;M<u*l;M++){let E=g[M*4+3];x[M*4]=Math.floor(g[M*4]*E/255+.5),x[M*4+1]=Math.floor(g[M*4+1]*E/255+.5),x[M*4+2]=Math.floor(g[M*4+2]*E/255+.5),x[M*4+3]=E;}return x};return (g,M,E,P,R)=>{let T=y(),w=new Float64Array(E);Yu(m,g,0,w,new Float64Array(E));for(let A=0;A<P;A++){let I=f*(M+A-o),S=Math.floor(I),v=Math.floor((I-S)*ua+.5)/ua,C=la(S,l,p)*u,U=la(S+1,l,p)*u;for(let L=0;L<E;L++){let k=w[L],F=Math.floor(k),_=Math.floor((k-F)*ua+.5)/ua,H=la(F,u,d),G=la(F+1,u,d),W=(A*E+L)*4,N=K=>(1-_)*(1-v)*T[(C+H)*4+K]+_*(1-v)*T[(C+G)*4+K]+(1-_)*v*T[(U+H)*4+K]+_*v*T[(U+G)*4+K],Z=N(3),J=Math.floor(Z+.5);if(J<=0){R[W]=R[W+1]=R[W+2]=R[W+3]=0;continue}for(let K=0;K<3;K++){let ie=Math.floor(N(K)+.5);R[W+K]=Math.min(255,Z>=255?ie:Math.floor(ie*255/J+.5));}R[W+3]=J;}}}}function Dh(e,t,n,r=true,o=false){let i=BM(e.boundary),s=je(n,e.transform??Bl),a=sn(s);if(!i||!a)return null;if(t!=="clamp"&&!_l(e.boundary,s)){let E=NM(e,t,s);if(E)return E}let c=!e.boundaryArgb.every(E=>E===e.boundaryArgb[0])||t!=="clamp"&&!_l(e.boundary,s)?0:Cf(e.boundary,s),f=t==="clamp"||_l(e.boundary,s)?Ih(e,s):null,m=c>0?Mf(e,s):null,b=Math.hypot(s[0],s[1]),h=Math.hypot(s[2],s[3]),d=b>0?1/b:0,p=h>0?1/h:0,x=t==="tile-flip-x"||t==="tile-flip-xy",y=t==="tile-flip-y"||t==="tile-flip-xy",g=t==="clamp"?FM:0,M=t==="clamp"?null:GM(i,s);return (E,P,R,T,w,A)=>{let I=M!==null&&E>=M[0]&&E+R<=M[2]&&P>=M[1]&&P+T<=M[3],S=M&&!I?M[0]:E,v=M&&!I?M[2]:E+R,C=o||M!==null&&!I,U=A!==void 0&&!(M&&!I);for(let L=0;L<T;L++){let k=P+L,F=-1;for(let _=0;_<R;_++){if(U&&A[L*R+_]&&_>=F){let ie=_;for(;ie>0&&A[L*R+ie-1];)ie--;for(F=_;F<R&&A[L*R+F];)F++;S=E+ie,v=E+F;}let H=E+_+g,G=a[0]*H+a[2]*k+a[4],W=a[1]*H+a[3]*k+a[5];if(t!=="clamp"&&(G=vh(G,i.x,i.w,x,d),W=vh(W,i.y,i.h,y,p)),t==="clamp"&&W>=i.y+i.h&&!f&&!m)continue;let N=g?{x:G-a[0]*g,y:W-a[1]*g}:void 0,Z=null,J=false;if(f||m){let ie=t==="clamp"?E+_:s[0]*G+s[2]*W+s[4],ce=t==="clamp"?k:s[1]*G+s[3]*W+s[5],$=Math.round(ie),X=Math.round(ce);if(Math.abs(ie-$)<1e-6&&Math.abs(ce-X)<1e-6){if(f)Z=Sh(f,$,X,S,v,C),Z===null&&r&&(J=true);else if(m){let B=m.colorAt($,X,S,v);B!==null?Z=Do(B>>>24,B>>>16&255,B>>>8&255,B&255,C):r&&(J=true);}}}if(Z===null&&!J)if(m){let ie={s:NaN};if(us(e,G,W,N,ie)!==null){let ce=m.colorForPosition(ie.s);Z=Do(ce>>>24,ce>>>16&255,ce>>>8&255,ce&255,C);}}else Z=us(e,G,W,N);if(Z===null)continue;let K=(L*R+_)*4;w[K]=Z>>>16&255,w[K+1]=Z>>>8&255,w[K+2]=Z&255,w[K+3]=Z>>>24&255;}}}}function oo(e,t,n){if(t&32768)return null;let r=e.objectTable.get(n&255);return !r||r.kind!=="plus-brush"?null:Ol(e,r)}function Ol(e,t){let n=_e(e),r=e.baseTransform,o=r&&r[1]===0&&r[2]===0&&Number.isInteger(r[4])&&Number.isInteger(r[5])&&!e.ext?.tsDevice?{x:r[4],y:r[5]}:{x:0,y:0};if(t.hatch&&!chunkI7XOR2GO_js.qa(e.ctx)){let i=sn(Ys(e));if(i)return Hb(t.hatch,e.ext?.renderingOrigin??{x:0,y:0},i)}return t.texture?_M(t.texture,n,Rt(e.pixelOffsetMode??0)):t.gradient&&t.gradient.type==="radial"&&t.gradient.shape?Dh(t.gradient.shape,t.gradient.wrapMode,n):t.gradient&&t.gradient.type==="linear"&&!chunkI7XOR2GO_js.qa(e.ctx)?((o.x!==0||o.y!==0)&&(n=[n[0],n[1],n[2],n[3],n[4]-o.x,n[5]-o.y]),Af(t.gradient,n,Rt(e.pixelOffsetMode??0),e.ext?.compositingMode===1,o)):null}function Er(e,t,n,r=0){if(!e||e.length===0)return {x:0,y:0,w:n.w,h:n.h};let o=1/0,i=1/0,s=-1/0,a=-1/0;for(let b of e){let h=t[0]*b.x+t[2]*b.y+t[4],d=t[1]*b.x+t[3]*b.y+t[5];o=Math.min(o,h),i=Math.min(i,d),s=Math.max(s,h),a=Math.max(a,d);}if(!Number.isFinite(o+i+s+a))return {x:0,y:0,w:n.w,h:n.h};let u=Math.ceil(Math.max(0,r))+1,l=Math.max(0,Math.floor(o)-u),c=Math.max(0,Math.floor(i)-u),f=Math.min(n.w,Math.ceil(s)+u),m=Math.min(n.h,Math.ceil(a)+u);return f>l&&m>c?{x:l,y:c,w:f-l,h:m-c}:null}function Cn(e,t,n,r,o,i="nonzero"){let{ctx:s}=e,a=kM(s);if(!a||typeof s.clip!="function"||typeof s.drawImage!="function")return false;let u=fi(e);if(u!=="canvas"){let b=Nl(e,t,n);if(b&&HM(e,b,r,o,i,a,u))return true}let l=oo(e,t,n);if(!l)return false;let c=Er(o,_e(e),a);if(!c)return true;if(c.w*c.h>Gl)return false;let f=chunkI7XOR2GO_js.Z(c.w,c.h);if(!f)return false;let m=new Uint8ClampedArray(c.w*c.h*4);l(c.x,c.y,c.w,c.h,m),chunkI7XOR2GO_js.ma(f.ctx,chunkI7XOR2GO_js.oa(m,c.w,c.h),0,0),s.save();try{pt(e),s.beginPath(),r(s),s.clip(i),s.setTransform(1,0,0,1,0,0),s.imageSmoothingEnabled=!1,s.drawImage.call(s,f.canvas,c.x,c.y);}finally{s.restore();}return true}function mi(e,t,n,r,o="canvas",i,s=true){let a=o===true?"aliased":o===false?"canvas":o,u=a==="aliased",l=a==="gdiplus-aa",{ctx:c}=e;if(typeof c.drawImage!="function"||n.w*n.h>Gl)return false;let f=chunkI7XOR2GO_js.Z(n.w,n.h),m=chunkI7XOR2GO_js.Z(n.w,n.h);if(!f||!m||typeof f.ctx.getImageData!="function")return false;let b=_e(e),h=f.ctx,d=u?WM(e):s?ml(e):0;h.setTransform(b[0],b[1],b[2],b[3],b[4]-n.x+d,b[5]-n.y+d),h.fillStyle="#000",h.strokeStyle="#000",r(a!=="canvas"?b0(h,b):h);let p=chunkI7XOR2GO_js.la(h,0,0,n.w,n.h).data;if(l&&i&&typeof h.isPointInPath=="function")for(let y=3;y<p.length;y+=4){let g=p[y];if(g===0||g===255)continue;let M=(y-3)/4,E=M%n.w,P=Math.floor(M/n.w),R=0;for(let T=0;T<4;T++)for(let w=0;w<8;w++)i(h,E+w/8+Ch,P+T/4+Ch)&&R++;p[y]=Math.round(R*255/32);}if(u){let y=i&&typeof h.isPointInPath=="function"?i:null;for(let g=3;g<p.length;g+=4){let M=p[g];if(!(M===0||M===255))if(y){let E=(g-3)/4,P=E%n.w+.5,R=Math.floor(E/n.w)+.5;p[g]=y(h,P,R)?255:0;}else p[g]=M>=128?255:0;}}let x=new Uint8ClampedArray(n.w*n.h*4);t(n.x,n.y,n.w,n.h,x);for(let y=3;y<x.length;y+=4)x[y]=(x[y]*p[y]+127)/255;chunkI7XOR2GO_js.ma(m.ctx,chunkI7XOR2GO_js.oa(x,n.w,n.h),0,0),c.save();try{c.setTransform(1,0,0,1,0,0),c.imageSmoothingEnabled=!1,c.drawImage.call(c,m.canvas,n.x,n.y);}finally{c.restore();}return true}function WM(e){return (Rt(e.pixelOffsetMode??0)?0:.5)-1/32}var Ch=1/1024;function fi(e){return e.gdiAntialias===true||chunkI7XOR2GO_js.qa(e.ctx)?"canvas":e.antiAlias?"gdiplus-aa":"aliased"}function ro(e){let t=e>>>24&255,n=e>>>16&255,r=e>>>8&255,o=e&255,i=chunkI7XOR2GO_js.a(n,r,o,t);return (s,a,u,l,c)=>{let f=u*l;if(c.byteOffset%4===0&&c.length>=f*4){new Uint32Array(c.buffer,c.byteOffset,f).fill(i);return}for(let m=0;m<f*4;m+=4)c[m]=n,c[m+1]=r,c[m+2]=o,c[m+3]=t;}}function io(e){let t=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)$/.exec(e);if(t){let r=t[4]===void 0?1:Number(t[4]),o=i=>Math.min(255,Math.max(0,Math.round(Number(i))));return (Math.round(Math.min(1,Math.max(0,r))*255)<<24|o(t[1])<<16|o(t[2])<<8|o(t[3]))>>>0}let n=/^#([0-9a-f]{6})$/i.exec(e);return n?(4278190080|parseInt(n[1],16))>>>0:null}function Nl(e,t,n){if(t&32768)return ro(n>>>0);let r=oo(e,t,n);if(r)return r;let o=e.objectTable.get(n&255),i=o&&o.kind==="plus-brush"?io(o.color):null;return i===null?null:ro(i)}function HM(e,t,n,r,o,i,s){let a=_e(e),u=null;try{u=M0(n,a,s==="aliased");}catch{u=null;}if(u){let c=Bo(u,i);if(!c)return true;if(c.w*c.h<=Gl){let f=Rt(e.pixelOffsetMode??0),m=ot(u,o==="evenodd",s==="gdiplus-aa",f,c);return zn(e,t,c,m,1,true)}}let l=Er(r,a,i);return l?mi(e,t,l,c=>{c.beginPath(),n(c),c.fill(o);},s,(c,f,m)=>c.isPointInPath(f,m,o)):true}function $M(e,t,n){let r=true;for(let o=0;o<n.length;o++){let i=o*4,s=n[o],a=e[i+3];if(s===0||a===0){e[i+3]=0;continue}if(t[i+3]!==255){e[i+3]=(a*s+127)/255,r=false;continue}if(s===255&&a===255)continue;let u=s===255?32:Math.round(s*32/255),l=Math.round(a*u/32);for(let c=0;c<3;c++){let f=Math.round(e[i+c]*a/255);e[i+c]=Math.min(255,Math.round(f*u/32)+Math.round(t[i+c]*(255-l)/255));}e[i+3]=255;}return r}function XM(e,t,n,r=null){for(let o=0;o<n.length;o++){let i=o*4,s=n[o];if(s===0)e[i+3]=0;else if(s!==255){let a=Math.round(s*32/255),u=e[i+3],l=Math.round(u*a/32);if(l>0&&l<255)for(let c=0;c<3;c++){let f=r?r[i+c]:Math.round(e[i+c]*u/255);e[i+c]=du(Math.round(f*a/32),l);}e[i+3]=l;}}return e}function jM(e,t,n,r){let{ctx:o}=e,i=chunkI7XOR2GO_js.Z(t.w,t.h),s=chunkI7XOR2GO_js.Z(t.w,t.h);if(!i||!s)return false;let a=new Uint8ClampedArray(t.w*t.h*4);for(let u=0;u<r.length;u++)a[u*4+3]=r[u]?255:0;chunkI7XOR2GO_js.ma(i.ctx,chunkI7XOR2GO_js.oa(a,t.w,t.h),0,0),chunkI7XOR2GO_js.ma(s.ctx,chunkI7XOR2GO_js.oa(n,t.w,t.h),0,0),o.save();try{o.setTransform(1,0,0,1,0,0),o.imageSmoothingEnabled=!1;let u=o.drawImage;o.globalCompositeOperation="destination-out",u.call(o,i.canvas,t.x,t.y),o.globalCompositeOperation="source-over",u.call(o,s.canvas,t.x,t.y);}finally{o.restore();}return true}function YM(e){let t=new Uint8Array(256),n=new Uint8Array(256);for(let r=0;r<256;r++)t[r]=Math.round(255*Math.pow(r/255,e)),n[r]=Math.round(255*Math.pow(r/255,1/e));return {lin:t,inv:n}}function VM(e){let t=Math.round(e*6/255);return Math.abs(e-255*t/6)<=.51?t/6:e/255}function zM(e,t,n,r,o=1,i=false){if(t===0)return r;if(i)return n;let s=e.lin[r],a=e.lin[n];return e.inv[Math.min(255,Math.max(0,s+Math.round((a-s)*VM(t)*o)))]}function zn(e,t,n,r,o=1,i=false,s=1){let{ctx:a}=e,u=chunkI7XOR2GO_js.Z(n.w,n.h);if(typeof a.drawImage!="function"||!u)return false;let l=new Uint8ClampedArray(n.w*n.h*4);if(t(n.x,n.y,n.w,n.h,l,o===1?r:void 0),o===1&&e.ext?.compositingMode===1&&typeof a.getImageData=="function"){let c=chunkI7XOR2GO_js.la(a,n.x,n.y,n.w,n.h).data,f=null;return t.premultiplied&&(f=new Uint8ClampedArray(n.w*n.h*4),t.premultiplied(n.x,n.y,n.w,n.h,f)),jM(e,n,XM(l,c,r,f),r)}if(o===1&&i&&typeof a.getImageData=="function"){let c=chunkI7XOR2GO_js.la(a,n.x,n.y,n.w,n.h).data;$M(l,c,r),chunkI7XOR2GO_js.ma(u.ctx,chunkI7XOR2GO_js.oa(l,n.w,n.h),0,0),a.save();try{a.setTransform(1,0,0,1,0,0),a.imageSmoothingEnabled=!1,a.drawImage.call(a,u.canvas,n.x,n.y);}finally{a.restore();}return true}if(o===3){if(typeof a.getImageData!="function")return false;let c=chunkI7XOR2GO_js.la(a,n.x,n.y,n.w,n.h).data,f=YM(s);for(let m=0;m<n.w*n.h;m++){let b=m*4,h=l[b+3]/255,d=false,p=h===1&&r[m*3]===255&&r[m*3+1]===255&&r[m*3+2]===255;for(let x=0;x<3;x++){let y=r[m*3+x];y>0&&(d=true),l[b+x]=zM(f,y,l[b+x],c[b+x],h,p);}l[b+3]=d?255:0;}}else for(let c=3;c<l.length;c+=4)l[c]=(l[c]*r[(c-3)/4]+127)/255;chunkI7XOR2GO_js.ma(u.ctx,chunkI7XOR2GO_js.oa(l,n.w,n.h),0,0),a.save();try{a.setTransform(1,0,0,1,0,0),a.imageSmoothingEnabled=!1,a.drawImage.call(a,u.canvas,n.x,n.y);}finally{a.restore();}return true}function tE(e){let{state:t}=e,r=!chunkI7XOR2GO_js._(t.rop2).exact&&Yn(t.rop2),o=t.penStyle===5||(t.penStyle===0||t.penStyle===6)&&yt(e);return r||e.gdiAntialias===false||chunkI7XOR2GO_js.i(t).kind==="tile"||!o}function Dn(e){return e.rasterPath??(e.rasterPath=new chunkI7XOR2GO_js.G),e.rasterPath}function Xl(e,t,n){let r=yr(t,n),o=r.figures[0].pts,i=Wt(e);i.moveTo(o[0]/16,o[1]/16);for(let s=2;s<o.length;s+=2)i.lineTo(o[s]/16,o[s+1]/16);i.closePath(),Dn(e).append(r);}function Fh(e,t,n){let r=Wt(e);r.moveTo(t[0]/16,t[1]/16);for(let o=n===6?2:0;o<t.length;o+=n){n===8&&o>0&&r.lineTo(t[o]/16,t[o+1]/16);let i=n===8?o+2:o;r.bezierCurveTo(t[i]/16,t[i+1]/16,t[i+2]/16,t[i+3]/16,t[i+4]/16,t[i+5]/16);}r.closePath();}function so(e){let t=Dn(e),[n,r]=Ln(e),o=t.figures.length;t.continueAt(n,r),t.figures.length!==o&&Wt(e).moveTo(n/16,r/16);}function nE(e){return e.lineStyle??(e.lineStyle={pos:0}),e.lineStyle}function ao(e){e.lineStyle={pos:0};}function Ln(e){let t=e.curFix,{state:n}=e;return t&&t.lx===n.curX&&t.ly===n.curY?[t.x,t.y]:ge(e,n.curX,n.curY)}function ca(e,t,n,r,o){return ui(e,Math.min(t,r),Math.min(n,o),Math.max(t,r),Math.max(n,o))}function Lh(e,t,n){let r=Ee(e),o=n===0?Math.hypot(r[0],r[1]):Math.hypot(r[2],r[3]);return Math.round(Math.abs(t)*o*16)}var kh=6;function ma(e,t,n=false,r=false){if((e.state.penStyle&15)!==kh||!Tt(t)||ze(e))return null;let o=Ee(e),i=In(e),s=Sn(e),a=Math.abs(e.state.penWidth*o[0])/i*16,u=Math.abs(e.state.penWidth*o[3])/s*16;if(Math.max(a,u)<24)return null;let l=Math.round(a),c=Math.round(u);if(Math.abs(t.exx)/i<l||Math.abs(t.eyy)/s<c)return null;let f=Math.floor(l/2),m=Math.ceil(l/2),b=Math.round((r?Math.floor(c/2):Math.ceil(c/2))*s);return {left:Math.round((n?m:f)*i),right:Math.round((n?f:m)*i),top:b,bottom:b,half:l%2===1&&!n,halfRect:l%2===1&&n}}function rE(e,t){if((e.state.penStyle&15)!==kh||!Tt(t)||ze(e))return false;let n=Ee(e),r=In(e),o=Sn(e),i=Math.abs(e.state.penWidth*n[0])/r*16,s=Math.abs(e.state.penWidth*n[3])/o*16;return Math.max(i,s)<24?false:Math.abs(t.exx)/r<Math.round(i)||Math.abs(t.eyy)/o<Math.round(s)}function fa(e,t){let n=e.exx<0?-1:1,r=e.eyy<0?-1:1,o={ax:e.ax+n*t.left,ay:e.ay+r*t.top,exx:e.exx-n*(t.left+t.right),exy:0,eyx:0,eyy:e.eyy-r*(t.top+t.bottom),framed:true};return t.half&&n>0&&(o.halfX=true),t.halfRect&&n>0&&(o.halfXRect=true),o}function oE(e,t,n,r,o,i,s,a){let u=BigInt(2*o-e-n),l=BigInt(2*i-t-r),c=BigInt(2*s-e-n),f=BigInt(2*a-t-r);return u*f===l*c&&u*c+l*f>0n}function iE(e,t,n){let{ctx:r,view:o}=e;if(n>=20){let i=o.getInt32(t,true),s=o.getInt32(t+4,true),a=ah(e.state,o,t+8),u=ze(e)?Be(e,i,s):{x:He(e,i),y:$e(e,s)};r.fillStyle=a,r.fillRect(u.x,u.y,1,1);}return true}function sE(e,t,n){let{view:r,state:o,inPath:i}=e;if(n>=16&&(o.curX=r.getInt32(t,true),o.curY=r.getInt32(t+4,true),ao(e),e.curFix=void 0,i)){let s=ze(e)?Be(e,o.curX,o.curY):{x:He(e,o.curX),y:$e(e,o.curY)};Wt(e).moveTo(s.x,s.y);let a=ge(e,o.curX,o.curY);Dn(e).moveTo(a[0],a[1]);}return true}function aE(e,t,n){let{view:r,state:o,inPath:i}=e;if(n>=16){let s=r.getInt32(t,true),a=r.getInt32(t+4,true),u=ze(e),l=u?Be(e,s,a):{x:He(e,s),y:$e(e,a)},c=ge(e,s,a);if(i)so(e),Wt(e).lineTo(l.x,l.y),Dn(e).lineTo(c[0],c[1]);else {let f=u?Be(e,o.curX,o.curY):{x:He(e,o.curX),y:$e(e,o.curY)},m=Ln(e);Qe(e,{build:b=>{b.beginPath(),b.moveTo(f.x,f.y),b.lineTo(l.x,l.y);},raster:()=>{let b=new chunkI7XOR2GO_js.G;return b.moveTo(m[0],m[1]),b.lineTo(c[0],c[1]),b},fill:false,stroke:true,style:nE(e)});}o.curX=s,o.curY=a;}return true}function uE(e,t){let{state:n}=e;if(e.inPath||n.penStyle===5||n.penStyle===6||t.exy!==0||t.eyx!==0||t.exx===0||t.eyy===0||!yt(e))return t;let r=Math.ceil(t.ax/16)*16,o=Math.ceil(t.ay/16)*16;return {...t,ax:r,ay:o,exx:Math.ceil((t.ax+t.exx)/16)*16-r,eyy:Math.ceil((t.ay+t.eyy)/16)*16-o}}function lE(e){if(!Tt(e)||e.exx>=0&&e.eyy>=0)return e;let t=e.exx<0?e.ax+e.exx:e.ax,n=e.eyy<0?e.ay+e.eyy:e.ay;return {...e,ax:t,ay:n,exx:Math.abs(e.exx),eyy:Math.abs(e.eyy)}}function cE(e,t,n){let{ctx:r,view:o,state:i,inPath:s}=e;if(n>=24){let a=o.getInt32(t,true),u=o.getInt32(t+4,true),l=o.getInt32(t+8,true),c=o.getInt32(t+12,true),f=uE(e,ca(e,a,u,l,c)),m=ma(e,f,true,e.state.arcDirection===2),b=m?fa(f,m):f,h=e.state.arcDirection===2;if(s||ao(e),ze(e)){let M=Be(e,a,u),E=Be(e,l,u),P=Be(e,l,c),R=Be(e,a,c),T=w=>{w.moveTo(M.x,M.y),w.lineTo(E.x,E.y),w.lineTo(P.x,P.y),w.lineTo(R.x,R.y),w.closePath();};return s?Xl(e,b,h):Qe(e,{build:w=>{w.beginPath(),T(w);},raster:()=>yr(b,h),rectangle:true,fill:true,stroke:true,axisRect:Tt(b)?{}:void 0}),true}let p=He(e,a),x=$e(e,u),y=Ze(e,l-a),g=st(e,c-u);if(m&&(p=Math.min(b.ax,b.ax+b.exx)/16,x=Math.min(b.ay,b.ay+b.eyy)/16,y=Math.abs(b.exx)/16,g=Math.abs(b.eyy)/16),s)Xl(e,b,h);else if(tE(e))Qe(e,{build:M=>{M.beginPath(),M.rect(p,x,y,g);},raster:()=>yr(yt(e)?lE(b):b,h),rectangle:true,fill:true,stroke:true,axisRect:{interior:mE(i,p,x,y,g,Vn(e))}});else {chunkI7XOR2GO_js.ba(r,i),r.fillRect(p,x,y,g),chunkI7XOR2GO_js.aa(r,i),r.lineWidth=1;let M=Mr(i,Vn(e));r.strokeRect(p+M,x+M,y,g);}}return true}function mE(e,t,n,r,o,i=1){if(Mr(e,i)===0||gr(e,i)!==1)return;let s=Math.min(t,t+r),a=Math.min(n,n+o),u=Math.abs(r)-1,l=Math.abs(o)-1;if(!(u<=0||l<=0))return c=>{c.beginPath(),c.rect(s+1,a+1,u,l);}}var Uh=.5522847498307936;function Wl(e,t,n,r,o,i,s,a){let u=Math.min(t,r),l=Math.max(t,r),c=Math.min(n,o),f=Math.max(n,o),m=Math.min(Math.abs(i),(l-u)/2),b=Math.min(Math.abs(s),(f-c)/2);if(!a){if(m<=0||b<=0){e.rect(u,c,l-u,f-c);return}let g=Math.PI/2;e.moveTo(u+m,c),e.lineTo(l-m,c),e.ellipse(l-m,c+b,m,b,0,-g,0),e.lineTo(l,f-b),e.ellipse(l-m,f-b,m,b,0,0,g),e.lineTo(u+m,f),e.ellipse(u+m,f-b,m,b,0,g,2*g),e.lineTo(u,c+b),e.ellipse(u+m,c+b,m,b,0,2*g,3*g),e.closePath();return}let h=(g,M)=>{let E=a(g,M);e.moveTo(E.x,E.y);},d=(g,M)=>{let E=a(g,M);e.lineTo(E.x,E.y);},p=(g,M,E,P,R,T)=>{let w=a(g,M),A=a(E,P),I=a(R,T);e.bezierCurveTo(w.x,w.y,A.x,A.y,I.x,I.y);};if(m<=0||b<=0){h(u,c),d(l,c),d(l,f),d(u,f),e.closePath();return}let x=m*Uh,y=b*Uh;h(u+m,c),d(l-m,c),p(l-m+x,c,l,c+b-y,l,c+b),d(l,f-b),p(l,f-b+y,l-m+x,f,l-m,f),d(u+m,f),p(u+m-x,f,u,f-b+y,u,f-b),d(u,c+b),p(u,c+b-y,u+m-x,c,u+m,c),e.closePath();}function fE(e,t,n){let{view:r,inPath:o}=e;if(n>=32){let i=r.getInt32(t,true),s=r.getInt32(t+4,true),a=r.getInt32(t+8,true),u=r.getInt32(t+12,true),l=r.getInt32(t+16,true),c=r.getInt32(t+20,true),f=e.state.arcDirection===2,m=ca(e,i,s,a,u),b=ma(e,m,false,f),h=b?fa(m,b):m,d=Ee(e),p=b?Math.abs(l*d[0])*16:Lh(e,l,0),x=b?Math.abs(c*d[3])*16:Lh(e,c,1),y=(T,w,A)=>b&&w!==0?Math.floor(Math.min(T,w)*A/w):T,g=y(p,Math.abs((a-i)*d[0])*16,Math.abs(h.exx)),M=y(x,Math.abs((u-s)*d[3])*16,Math.abs(h.eyy)),E=b?h:Vl(e,i,s,a,u,true);!b&&E.exx!==m.exx&&Math.abs(m.exx)>0&&Math.abs(m.eyy)>0&&l!==0&&c!==0&&(g=Math.floor(Math.min(p,Math.abs(m.exx))*Math.abs(E.exx)/Math.abs(m.exx)),M=Math.floor(Math.min(x,Math.abs(m.eyy))*Math.abs(E.eyy)/Math.abs(m.eyy))),!b&&E.exx===m.exx&&E.eyy===m.eyy&&l!==0&&c!==0&&a!==i&&u!==s&&!ze(e)&&(E.cornerRatio=[Math.fround(Math.min(Math.abs(l),Math.abs(a-i))/Math.abs(a-i)),Math.fround(Math.min(Math.abs(c),Math.abs(u-s))/Math.abs(u-s))]);let P=b?T=>Wl(T,Math.min(h.ax,h.ax+h.exx)/16,Math.min(h.ay,h.ay+h.eyy)/16,Math.max(h.ax,h.ax+h.exx)/16,Math.max(h.ay,h.ay+h.eyy)/16,g/32,M/32,null):ze(e)?T=>Wl(T,i,s,a,u,l/2,c/2,(w,A)=>Be(e,w,A)):T=>Wl(T,He(e,i),$e(e,s),He(e,a),$e(e,u),Ze(e,l)/2,st(e,c)/2,null);if(b){let T=Math.abs((a-i)*d[0])*16,w=Math.abs((u-s)*d[3])*16;T>0&&w>0&&(h.cornerExact=[Math.min(p,T)*Math.abs(h.exx)/T,Math.min(x,w)*Math.abs(h.eyy)/w]);}let R=(T=h)=>sa(T,g,M,f,l===0||c===0);if(o){let T=E;l===0||c===0?Xl(e,T,f):(Fh(e,Cl(T,g,M,f),8),Dn(e).append(R(T)));}else ao(e),Qe(e,{build:T=>{T.beginPath(),P(T);},raster:()=>R(E),roundPen:true,fill:true,stroke:true});}return true}function Vl(e,t,n,r,o,i=false){let s=i?ca(e,t,n,r,o):ui(e,t,n,r,o);if(e.state.penStyle!==5)return s;let a=Ee(e);if(a[1]!==0||a[2]!==0)return s;let l=s.ax%16===0&&s.ay%16===0&&s.exx%16===0&&s.eyy%16===0?4:0,c=l,f=s.exx<0?-1:1,m=s.eyy<0?-1:1;return {ax:s.ax-l*f,ay:s.ay-c*m,exx:s.exx+2*l*f,exy:0,eyx:0,eyy:s.eyy+2*c*m}}function bE(e,t,n){let{view:r,inPath:o}=e;if(n>=24){let i=r.getInt32(t,true),s=r.getInt32(t+4,true),a=r.getInt32(t+8,true),u=r.getInt32(t+12,true),l=e.state.arcDirection===2,c=ca(e,i,s,a,u),f=ma(e,c,false,e.state.arcDirection===2),m=f?fa(c,f):c,b=f?{cx:(m.ax+m.exx/2)/16,cy:(m.ay+m.eyy/2)/16,rx:Math.abs(m.exx)/32,ry:Math.abs(m.eyy)/32,rotation:0}:ze(e)?qs(e,(i+a)/2,(s+u)/2,Math.abs(a-i)/2,Math.abs(u-s)/2):{cx:He(e,(i+a)/2),cy:$e(e,(s+u)/2),rx:Math.abs(Ze(e,a-i))/2,ry:Math.abs(st(e,u-s))/2,rotation:0};if(o){let h=m;Fh(e,chunkI7XOR2GO_js.y(h,l),6),Dn(e).append(li(h,l));}else ao(e),Qe(e,{build:h=>{h.beginPath(),h.ellipse(b.cx,b.cy,b.rx,b.ry,b.rotation,0,Math.PI*2);},raster:()=>li(f?m:Vl(e,i,s,a,u,true),l),roundPen:true,fill:true,stroke:true});}return true}function hE(e,t,n,r){let{ctx:o,view:i,state:s,inPath:a}=e;if(r>=40){let u=i.getInt32(n,true),l=i.getInt32(n+4,true),c=i.getInt32(n+8,true),f=i.getInt32(n+12,true),m=i.getInt32(n+16,true),b=i.getInt32(n+20,true),h=i.getInt32(n+24,true),d=i.getInt32(n+28,true),p=(u+c)/2,x=(l+f)/2,y=Math.abs(c-u)/2,g=Math.abs(f-l)/2,M=Math.atan2((b-x)/(g||1),(m-p)/(y||1)),E=s.arcDirection===2,P=t!==47&&y>0&&g>0&&oE(u,l,c,f,m,b,h,d),R=P?M+(E?2:-2)*Math.PI:Math.atan2((d-x)/(g||1),(h-p)/(y||1)),T=ze(e),w=ui(e,u,l,c,f);if(t!==55&&rE(e,w))return true;let A=ma(e,w,false,e.state.arcDirection===2),I=A?fa(w,A):w,S=A?{cx:(I.ax+I.exx/2)/16,cy:(I.ay+I.eyy/2)/16,rx:Math.abs(I.exx)/32,ry:Math.abs(I.eyy)/32,rotation:0}:T?qs(e,p,x,y,g):{cx:He(e,p),cy:$e(e,x),rx:Math.abs(Ze(e,y)),ry:Math.abs(st(e,g)),rotation:0},v=t===55,C=t===47||t===46,U=T?Be(e,p+y*Math.cos(M),x+g*Math.sin(M)):{x:S.cx+S.rx*Math.cos(M),y:S.cy+S.ry*Math.sin(M)},L=N=>{if(t===47?N.moveTo(S.cx,S.cy):!v&&a&&N.moveTo(U.x,U.y),v){if(!a){let Z=Ln(e);N.moveTo(Z[0]/16,Z[1]/16);}N.lineTo(U.x,U.y);}N.ellipse(S.cx,S.cy,S.rx,S.ry,S.rotation,M,R,!E),C&&N.closePath();},k=v?"arcto":t===47?"pie":t===46?"chord":"arc",F=(N,Z,J)=>{let K=c-u,ie=f-l;if(K===0||ie===0)return ge(e,Z,J);let ce=(Z-u)/K,$=(J-l)/ie;return [N.ax+N.exx*ce+N.eyx*$,N.ay+N.exy*ce+N.eyy*$]},_=Ee(e),H=_[0]*_[3]-_[1]*_[2]<0,G=_[1]===0&&_[2]===0,W=(N=false)=>{let Z=A?I:N&&C?Vl(e,u,l,c,f):w,J=Z.exx*Z.eyy-Z.exy*Z.eyx<0,K=G&&Tt(Z)?{x:_[0]<0,y:_[3]<0}:void 0;return {box:Z,mirror:K,clockwise:K?E:E!==(H!==J),s:F(Z,m,b),e:P?F(Z,m,b):F(Z,h,d),from:Ln(e)}};if(a){v&&so(e),L(Wt(e));let N=W();no(N.box,N.s,N.e,N.clockwise,k,N.from,Dn(e),N.mirror),C&&Dn(e).closeFigure();}else ao(e),o.beginPath(),Qe(e,{build:N=>{N.beginPath(),L(N);},raster:()=>{let N=W(true);return no(N.box,N.s,N.e,N.clockwise,k,N.from,void 0,N.mirror).path},fill:C,stroke:true});if(v){let N=W(),Z=no(N.box,N.s,N.e,N.clockwise,"arc",void 0,void 0,N.mirror).end,J=Math.floor(Z[0]/16),K=Math.floor(Z[1]/16),ie=sn(Ee(e));ie?(s.curX=Math.round(ie[0]*J+ie[2]*K+ie[4]),s.curY=Math.round(ie[1]*J+ie[3]*K+ie[5])):(s.curX=Math.round(p+y*Math.cos(R)),s.curY=Math.round(x+g*Math.sin(R))),e.curFix=a?{x:Z[0],y:Z[1],lx:s.curX,ly:s.curY}:{x:J*16,y:K*16,lx:s.curX,ly:s.curY};}}return true}function dE(e,t,n){let{view:r,state:o,inPath:i}=e;if(n<28)return true;let s=r.getInt32(t,true),a=r.getInt32(t+4,true),u=r.getUint32(t+8,true),l=r.getFloat32(t+12,true),c=r.getFloat32(t+16,true);if(!Number.isFinite(l)||!Number.isFinite(c)||u>2147483647)return true;let f=l*Math.PI/180,m=(l+c)*Math.PI/180,b=s+u*Math.cos(f),h=a-u*Math.sin(f),d=s+u*Math.cos(m),p=a-u*Math.sin(m),x=c<0,y=Math.min(8,Math.trunc(Math.abs(c)/360)),g=ui(e,s-u,a-u,s+u,a+u),M;if(Tt(g))M=chunkI7XOR2GO_js.E(g,l,c);else {M=[...ge(e,s+u*Math.cos(f),a-u*Math.sin(f))];for(let v of chunkI7XOR2GO_js.C(l,c)){let C=chunkI7XOR2GO_js.D(s,a,u,u,v.from,v.to);for(let U=0;U<6;U+=2)M.push(...ge(e,C[U],C[U+1]));}}let E=[M[M.length-2],M[M.length-1]],P=(v,C)=>{v.continueAt(C[0],C[1]),v.addBeziers(M,false);},R=qs(e,s,a,u,u),T=Be(e,b,h),w=v=>{if(v.lineTo(T.x,T.y),u===0)return;let C=Math.min(Math.abs(m-f),Math.PI*2*(y+1));v.ellipse(R.cx,R.cy,R.rx,R.ry,R.rotation,-f,x?-f+C:-f-C,!x);};if(i)so(e),w(Wt(e)),P(Dn(e),Ln(e));else {ao(e);let v=Ln(e),C=Be(e,o.curX,o.curY);Qe(e,{build:U=>{U.beginPath(),U.moveTo(C.x,C.y),w(U);},raster:()=>{let U=new chunkI7XOR2GO_js.G;return P(U,v),U},fill:false,stroke:true});}let A=Math.floor(E[0]/16),I=Math.floor(E[1]/16),S=sn(Ee(e));return o.curX=Math.round(S?S[0]*A+S[2]*I+S[4]:d),o.curY=Math.round(S?S[1]*A+S[3]*I+S[5]:p),e.curFix=i?{x:E[0],y:E[1],lx:o.curX,ly:o.curY}:{x:A*16,y:I*16,lx:o.curX,ly:o.curY},true}function _h(e,t,n,r){switch(t){case 15:return iE(e,n,r);case 27:return sE(e,n,r);case 54:return aE(e,n,r);case 43:return cE(e,n,r);case 44:return fE(e,n,r);case 42:return bE(e,n,r);case 41:return dE(e,n,r);case 45:case 55:case 46:case 47:return hE(e,t,n,r);default:return false}}var pE=[[238,110,198,70,229,102,204,76,236,108,195,69,228,100,205,78],[46,174,7,134,39,166,12,140,45,171,5,132,36,164,15,142],[209,83,249,122,218,90,239,112,208,80,247,120,215,88,242,114],[18,146,59,185,26,154,49,176,16,144,56,184,25,152,50,178],[226,98,202,74,233,107,192,64,224,96,200,73,232,104,194,66],[35,162,11,138,42,170,1,128,32,160,8,136,40,168,2,130],[219,91,243,115,211,83,253,125,221,93,245,117,212,85,250,123],[28,154,52,178,19,147,61,188,29,157,53,181,22,149,59,187],[235,107,195,67,226,100,205,77,236,109,197,69,229,101,202,76],[43,171,4,131,35,163,14,141,45,173,5,133,38,164,11,139],[207,79,246,119,215,87,240,113,209,81,249,121,216,90,239,111],[15,143,56,183,23,151,49,177,18,145,57,185,25,153,47,175],[222,95,198,71,231,103,193,66,225,97,201,73,232,105,191,63],[32,159,8,135,39,167,1,129,33,161,9,137,42,169,1,127],[222,94,246,118,214,86,252,124,219,92,243,116,212,84,253,126],[30,158,54,181,22,150,60,188,28,156,52,180,21,147,62,190]],xE=66,Bh=65;function yE(e){return e<63?e%16:e<=64?14:15}function gE(e){return e<63?e%16:e===63?14:15}var ba=(e,t)=>(e%t+t)%t;function zl(e,t){let n=ba(e-t-2,65);return n<63?n:n+1}function ql(e,t){return ba(e-t-2,Bh)}function ha(e,t,n,r){return pE[gE(ba(t+r,Bh))][yE(ba(e+n,xE))]}function ME(e){return Math.round(e*255/31)}function uo(e,t){let n=Math.floor((31*e+t)/255);return ME(n<0?0:n>31?31:n)}function EE(e,t,n){return n===e?16777216|n>>2<<8|t>>2:n|t<<8|e<<16}function da(e,t,n){if(t<=0||n<=0)return "replicate";let r=t*n;if(r<=2304)return "replicate";let o=b=>EE(e[b*3],e[b*3+1],e[b*3+2]),i=new Set;if(r>16384){for(let b=0;b<n;b+=6){for(let h=0;h<t;h++)i.add(o(b*t+h));if(i.size>=20)return "filter"}return "replicate"}let s=Math.floor(2304/t)+1;if(n<s)return "replicate";let a=n===s,u=a?289+Math.floor((s*t-2304)/8):145+Math.floor((s*t-2304)/16),l=0,c=0,f=0,m=false;for(let b=0;b<n;b++){let h=0;for(let d=0;d<t;d++){let p=o(b*t+d);i.has(p)||(i.add(p),h++);}if(l+=h,!m&&l>=u||(h===0?c++:f+=t,l>=20&&f>2304&&!(a&&m)))return "filter";(a?l+c*t>=u-1:l+(c+1)*t>=r-2305+u)&&(m=true);}return "replicate"}var Jl=1,Gh=2;var Rr=4;function di(e,t,n){let r=Math.floor((2*e+1)*t/(2*n));return Math.max(0,Math.min(t-1,r))}function Oh(e,t,n,r,o){let i=[],s=u=>r?e+t-1-u:e+u;if(n<=0||t<=0)return i;let a=-1;for(let u=0;u<n;u++){let l=di(u,t,n),c=[],f=o&&n<t?a+1:l;for(let m=f;m<=l;m++)c.push(s(m));i.push(c),a=l;}return i}function $h(e,t,n,r,o,i,s,a){let u=Math.max(0,Math.round(Math.abs(i))),l=Math.max(0,Math.round(Math.abs(s))),c=i<0!=r<0,f=s<0!=o<0,m=a===Jl||a===Gh,b=Oh(Math.round(Math.min(t,t+r)),Math.round(Math.abs(r)),u,c,m),h=Oh(Math.round(Math.min(n,n+o)),Math.round(Math.abs(o)),l,f,m),d=new Uint8ClampedArray(u*l*4),p=e.data,x=(y,g)=>{if(y<0||g<0||y>=e.width||g>=e.height)return 0;let M=(g*e.width+y)*4;return p[M]<<16|p[M+1]<<8|p[M+2]};for(let y=0;y<l;y++){chunkDO2CGP4P_js.c();let g=h[y]??[];for(let M=0;M<u;M++){let E=b[M]??[],P=a===Jl?16777215:0,R=true;for(let w of g)for(let A of E){let I=x(A,w);a===Jl?P&=I:a===Gh?P|=I:R&&(P=I),R=false;}let T=(y*u+M)*4;d[T]=P>>16&255,d[T+1]=P>>8&255,d[T+2]=P&255,d[T+3]=255;}}return {width:u,height:l,data:d}}var lo=65536;function Zl(e,t,n){let r=(2*e+1)*t,o=2*n,i=Math.floor(r/o);return i*o===r&&i--,Math.max(0,Math.min(t-1,i))}function Xh(e,t,n,r){let o=[];if(n<=0||t<=0)return o;let i=a=>e+a;if(n>=t){for(let a=0;a<n;a++)o.push([[i(Zl(a,t,n)),1]]);return r&&o.reverse(),o}let s=Math.ceil(t*lo/n);for(let a=0;a<n;a++){let u=a*s,l=(a+1)*s,c=[];for(let f=Math.floor(u/lo);f*lo<l&&f<t;f++){let m=Math.min(l,(f+1)*lo)-Math.max(u,f*lo);m>0&&c.push([i(f),m]);}o.push(c);}return r&&o.reverse(),o}var PE=13;function hi(e,t,n){if(t>=e)return Xh(0,e,t,n);let r=2**PE,o=lo/r,i=[];for(let s=0;s<t;s++){let a=s*e,u=(s+1)*e,l=[];for(let c=Math.floor(a/t);c*t<u;c++){let f=Math.max(a,c*t)-a,m=Math.min(u,(c+1)*t)-a;m<=f||l.push([c,(Math.floor(m*r/e)-Math.floor(f*r/e))*o]);}i.push(l);}return n&&i.reverse(),i}function RE(e){if(e>=1)return 0;let t=1-e;return Math.abs(e-.5)<1e-9?t:Math.pow(t,e<.5?Math.SQRT1_2:Math.SQRT2)}function jh(e,t){return TE(e,t).map(n=>{let r=0;return n.map(([o,i],s)=>{let a=s===n.length-1?8192:Math.ceil(i-1e-7),u=a-r;return r=a,[o,u/8192]})})}function TE(e,t){let n=t/e,r=Math.ceil(n)-1,o=[],i=0;for(let u=0;u<=r;u++){let l=RE(u/n);o.push(l),i+=u===0?l:2*l;}let s=[];for(let u=0;u<t;u++){let l=u/n,c=(u+1)/n,f=[];for(let m=Math.max(0,Math.floor(l));m<Math.min(e,c);m++){let b=Math.min(c,m+1)-Math.max(l,m);b>0&&f.push([m,b*n]);}s.push(f);}let a=[];for(let u=0;u<t;u++){let l=new Map;for(let m=-r;m<=r;m++){let b=o[Math.abs(m)]/i;if(b!==0)for(let[h,d]of s[Math.max(0,Math.min(t-1,u+m))])l.set(h,(l.get(h)??0)+b*d);}let c=[...l.entries()].sort((m,b)=>m[0]-b[0]),f=0;a.push(c.map(([m,b])=>(f+=b*8192,[m,f])));}return a}function Pr(e,t,n,r,o,i,s,a){for(let u=0;u<n;u++){let l=a?a[u]:u;for(let c=0;c<t;c++){let f=s?s[c]:c,m=ha(r.startX,r.startY,f,l),b=(u*t+c)*3;e[b]=uo(e[b],m),e[b+1]=uo(e[b+1],m),e[b+2]=uo(e[b+2],m);}}}function Nh(e,t,n){if(t<2||n<2)return;let r=e.slice(),o=(l,c)=>{let f=l<0?-l:l>=t?2*(t-1)-l:l,m=c<0?-c:c>=n?2*(n-1)-c:c;return (Math.max(0,Math.min(n-1,m))*t+Math.max(0,Math.min(t-1,f)))*3},i=(l,c)=>r[l]===r[c]&&r[l+1]===r[c+1]&&r[l+2]===r[c+2],s=t+1,a=new Uint8Array(s*(n+1));for(let l=-1;l<n;l++)for(let c=-1;c<t;c++){let f=o(c,l),m=o(c+1,l),b=o(c,l+1),h=o(c+1,l+1);a[(l+1)*s+c+1]=i(f,h)&&i(m,b)&&!i(f,m)?1:0;}let u=(l,c)=>a[(c+1)*s+l+1]===1;for(let l=0;l<n-1;l++)for(let c=0;c<t-1;c++){if(!u(c,l))continue;let f=o(c,l),m=o(c+1,l),b=[[c,l,1,1,true],[c+1,l+1,-1,-1,true],[c+1,l,-1,1,false],[c,l+1,1,-1,false]];if(u(c-1,l)&&u(c+1,l)||u(c,l-1)&&u(c,l+1)){for(let[d,p]of b){let x=(p*t+d)*3;for(let y=0;y<3;y++)e[x+y]=r[f+y]+r[m+y]+1>>1;}continue}let h=4*(r[f]-r[m])+8*(r[f+1]-r[m+1])+(r[f+2]-r[m+2]);for(let[d,p,x,y,g]of b){if(g?h<0:h>=0)continue;let M=(p*t+d)*3,E=o(d+x,p),P=o(d,p+y),R=o(d+2*x,p),T=o(d,p+2*y);for(let w=0;w<3;w++)e[M+w]=12*e[M+w]+r[E+w]+r[P+w]+r[R+w]+r[T+w]+8>>4;}}}function wE(e,t,n){let r=e.slice(),o=(i,s,a)=>r[(Math.max(0,Math.min(n-1,s))*t+Math.max(0,Math.min(t-1,i)))*3+a];for(let i=0;i<n;i++){chunkDO2CGP4P_js.c();for(let s=0;s<t;s++)for(let a=0;a<3;a++){let u=o(s,i,a),l=o(s-1,i,a)+o(s+1,i,a)+o(s,i-1,a)+o(s,i+1,a),c=u+Math.floor((4*u-l)/8);e[(i*t+s)*3+a]=c<0?0:c>255?255:c;}}}function AE(e,t,n,r){let o=r?t:n,i=(l,c)=>(r?c*t+l:l*t+c)*3,s=(l,c)=>e[l]===e[c]&&e[l+1]===e[c+1]&&e[l+2]===e[c+2],a=l=>l>=0&&l+1<o&&s(i(l,0),i(l+1,1))&&s(i(l,1),i(l+1,0))&&!s(i(l,0),i(l,1)),u=Array.from({length:o},(l,c)=>a(c-1)||a(c));for(let l=0;l<o;l++){if(!u[l])continue;let c=i(l,0),f=i(l,1);for(let m=0;m<3;m++)e[c+m]=e[f+m]=e[c+m]+e[f+m]+1>>1;}}function Wh(e,t,n,r){let o=r?t:n,i=new Int32Array(o*3);for(let s=0;s<o;s++){let a=(r?t+s:s*t+1)*3;for(let u=0;u<3;u++)i[s*3+u]=e[a+u];}return i}function IE(e,t,n,r,o,i,s){let a=hi(t,r,i),u=hi(n,o,s),l=new Int32Array(r*n*3);for(let b=0;b<n;b++){chunkDO2CGP4P_js.c();for(let h=0;h<r;h++){let d=0;for(let[,p]of a[h])d+=p;for(let p=0;p<3;p++){let x=0;for(let[y,g]of a[h])x+=e[(b*t+y)*3+p]*g;l[(b*r+h)*3+p]=Math.floor((2*x+d)/(2*d));}}}let c=new Float64Array(r*o*3);for(let b=0;b<o;b++){let h=0;for(let[,d]of u[b])h+=d;for(let d=0;d<r;d++)for(let p=0;p<3;p++){let x=0;for(let[y,g]of u[b])x+=l[(y*r+d)*3+p]*g;c[(b*r+d)*3+p]=x/h;}}let f=(b,h,d)=>c[(Math.max(0,Math.min(o-1,h))*r+Math.max(0,Math.min(r-1,b)))*3+d],m=new Int32Array(r*o*3);for(let b=0;b<o;b++)for(let h=0;h<r;h++)for(let d=0;d<3;d++){let p=f(h,b,d),x=f(h-1,b,d)+f(h+1,b,d)+f(h,b-1,d)+f(h,b+1,d);m[(b*r+h)*3+d]=Math.max(0,Math.min(255,Math.floor(p+(4*p-x)/8)));}return m}function SE(e,t,n,r,o,i,s){let a=o<n,u=a?hi(n,o,s):hi(t,r,i),l=new Float64Array(r*o*3);for(let m=0;m<o;m++)for(let b=0;b<r;b++){let h=a?u[m]:u[b],d=a?i?r-1-b:b:s?o-1-m:m,p=0;for(let[,x]of h)p+=x;for(let x=0;x<3;x++){let y=0;for(let[g,M]of h)y+=e[((a?g:d)*t+(a?d:g))*3+x]*M;l[(m*r+b)*3+x]=y/p;}}let c=new Int32Array(r*o*3),f=(m,b,h)=>l[(Math.max(0,Math.min(o-1,b))*r+Math.max(0,Math.min(r-1,m)))*3+h];for(let m=0;m<o;m++)for(let b=0;b<r;b++)for(let h=0;h<3;h++){let d=f(b,m,h),p=a?f(b,m-1,h)+f(b,m+1,h):f(b-1,m,h)+f(b+1,m,h);c[(m*r+b)*3+h]=Math.max(0,Math.min(255,Math.floor(d+(2*d-p)/4)));}return c}var Yh={1:[[5,22,5,32]],2:[[4,12,0,16],[0,12,4,16]],3:[[6,10,0,16],[1,14,1,16],[0,10,6,16]],4:[[6,10,0,16],[3,12,1,16],[1,12,3,16],[0,10,6,16]],5:[[13,19,0,32],[6,25,1,32],[3,26,3,32],[1,25,6,32],[0,19,13,32]]};function Kl(e,t){if(t/e===2){let r=Yh[2].map(([o,i,s])=>[o*512,i*512,s*512]);return Array.from({length:t},(o,i)=>{let s=Math.floor(i/2),[a,u,l]=r[i%2];return [[Math.max(0,s-1),a],[s,u],[Math.min(e-1,s+1),l]]})}return jh(e,t).map(r=>r.map(([o,i])=>[o,Math.round(i*8192)]))}function vE(e,t,n,r,o,i){let s=r>t,a=s?t:n,u=new Int32Array(e.length),l=(m,b,h)=>b>=n&&i?i[Math.max(0,Math.min(t-1,m))*3+h]:e[(Math.max(0,Math.min(n-1,b))*t+Math.max(0,Math.min(t-1,m)))*3+h];for(let m=0;m<n;m++){chunkDO2CGP4P_js.c();for(let b=0;b<t;b++)for(let h=0;h<3;h++){let d=l(b,m,h),p=s?l(b-1,m,h)+l(b+1,m,h):l(b,m-1,h)+l(b,m+1,h),x=d+Math.floor((2*d-p)/4);u[(m*t+b)*3+h]=x<0?0:x>255?255:x;}}let c=Kl(a,s?r:o),f=new Int32Array(r*o*3);for(let m=0;m<o;m++)for(let b=0;b<r;b++)for(let h=0;h<3;h++){let d=0;if(s)for(let[p,x]of c[b])d+=x*u[(m*t+p)*3+h];else for(let[p,x]of c[m])d+=x*u[(p*t+b)*3+h];f[(m*r+b)*3+h]=Math.floor((d+4096)/8192);}return f}function Hh(e,t){let n=Array.from({length:t},(i,s)=>Zl(s,e,t)),r=new Map;for(let i of n)r.set(i,(r.get(i)??0)+1);let o=new Map;return n.map(i=>{let s=o.get(i)??0;return o.set(i,s+1),{k:i,weights:Yh[r.get(i)][s]}})}function CE(e,t,n,r){return e>0&&t>0&&n>=e&&r>=t&&(n>e||r>t)}function DE(e,t,n,r,o,i,s){if(r>5*t||o>5*n){let u=new Int32Array((n+1)*t*3);return u.set(e),u.set(e.subarray((n-1)*t*3),n*t*3),Pr(u,t,n+1,i,false,false,void 0,Int32Array.from({length:n+1},(l,c)=>s?o-1-c:c)),u}let a=new Int32Array((n+4)*t*3);return a.set(e.subarray(0,t*3),0),a.set(e.subarray(0,t*3),t*3),a.set(e,2*t*3),a.set(e.subarray((n-1)*t*3),(n+2)*t*3),a.set(e.subarray((n-1)*t*3),(n+3)*t*3),Pr(a,t,n+4,{startX:i.startX,startY:(i.startY+(s?63:2))%65},false,false,void 0,Int32Array.from({length:n+4},(u,l)=>s?o-l+1:l-2)),a}function LE(e,t,n,r,o,i){if(r===t||o===n)return vE(e,t,n,r,o,i&&i.length===(n+1)*t*3?i.subarray(n*t*3):void 0);let s=x=>x<0?0:x>255?255:x,a=r>5*t||o>5*n,u=new Int32Array(r*o*3);if(a){let x=e.slice();if(i){let E=(P,R,T)=>i[(Math.max(0,Math.min(n,R))*t+Math.max(0,Math.min(t-1,P)))*3+T];for(let P=0;P<n;P++)for(let R=0;R<t;R++)for(let T=0;T<3;T++){let w=E(R,P,T),A=E(R-1,P,T)+E(R+1,P,T)+E(R,P-1,T)+E(R,P+1,T);x[(P*t+R)*3+T]=s(w+Math.floor((4*w-A)/8));}}else wE(x,t,n);let y=Kl(t,r),g=Kl(n,o),M=new Int32Array(r*n*3);for(let E=0;E<n;E++)for(let P=0;P<r;P++)for(let R=0;R<3;R++){let T=0;for(let[w,A]of y[P])T+=A*x[(E*t+w)*3+R];M[(E*r+P)*3+R]=Math.floor((T+4096)/8192);}for(let E=0;E<o;E++)for(let P=0;P<r;P++)for(let R=0;R<3;R++){let T=0;for(let[w,A]of g[E])T+=A*M[(w*r+P)*3+R];u[(E*r+P)*3+R]=s(Math.floor((T+4096)/8192));}return u}let l=n+2,c=new Int32Array(t*l*3),f;i&&i.length===(n+4)*t*3?f=i:(f=new Int32Array(t*(n+4)*3),i&&i.length===l*t*3?(f.set(i.subarray(t*3,2*t*3),0),f.set(i,t*3),f.set(i.subarray(n*t*3,(n+1)*t*3),(n+3)*t*3)):(f.set(e.subarray(0,t*3),0),f.set(e.subarray(0,t*3),t*3),f.set(e,2*t*3),f.set(e.subarray((n-1)*t*3),(n+2)*t*3),f.set(e.subarray((n-1)*t*3),(n+3)*t*3)));let m=f,b=(x,y,g)=>m[((y+1)*t+Math.max(0,Math.min(t-1,x)))*3+g];for(let x=0;x<l;x++)for(let y=0;y<t;y++)for(let g=0;g<3;g++){let M=b(y,x,g),E=b(y-1,x,g)+b(y+1,x,g)+b(y,x-1,g)+b(y,x+1,g);c[(x*t+y)*3+g]=s(M+Math.floor((4*M-E)/8));}let h=Hh(t,r),d=Hh(n,o),p=new Int32Array(t*3);for(let x=0;x<o;x++){let y=d[x].k+1,[g,M,E,P]=d[x].weights,R=(y-1)*t*3,T=y*t*3,w=(y+1)*t*3;for(let A=0;A<t*3;A++)p[A]=Math.floor((g*c[R+A]+M*c[T+A]+E*c[w+A]+P/2)/P);for(let A=0;A<r;A++){let I=h[A].k,[S,v,C,U]=h[A].weights,L=Math.max(0,I-1),k=Math.min(t-1,I+1);for(let F=0;F<3;F++)u[(x*r+A)*3+F]=Math.floor((S*p[L*3+F]+v*p[I*3+F]+C*p[k*3+F]+U/2)/U);}}return u}function UE(e,t,n,r,o){let i=r>t&&o*2<=n||o>n&&r*2<=t,s=o<n&&3*o+2<=2*n||r<t&&3*r+2<=2*t;if(i||s)return "reduced";let a=t*n<=2304;return !a&&da(e,t,n)==="filter"?"reduced":r*o<t*n?a?"despeckled":"reduced":"nearest"}function Vh(e,t,n,r,o,i,s,a,u=false,l=false,c,f){let m=Math.max(0,Math.round(Math.abs(i))),b=Math.max(0,Math.round(Math.abs(s))),h=Math.round(Math.abs(r)),d=Math.round(Math.abs(o)),p=Math.round(Math.min(t,t+r)),x=Math.round(Math.min(n,n+o)),y=i<0!=r<0,g=s<0!=o<0,M=new Uint8ClampedArray(m*b*4);if(m===0||b===0||h===0||d===0)return {width:m,height:b,data:M};let E=new Int32Array(h*d*3);for(let $=0;$<d;$++){let X=x+$;for(let B=0;B<h;B++){let O=p+B;if(X<0||X>=e.height||O<0||O>=e.width)continue;let j=(X*e.width+O)*4,q=($*h+B)*3;E[q]=e.data[j],E[q+1]=e.data[j+1],E[q+2]=e.data[j+2];}}let P=d===2&&b===1&&m>h&&(!a||u||!!c),R=h===2&&m===1&&b>d&&(!a||u||!!c);(P||R)&&(l||AE(E,h,d,P),P&&m>=2*h?(E=Wh(E,h,d,true),d=1):R&&b>=2*d&&(E=Wh(E,h,d,false),h=1));let T=m>=h&&b>=d&&(m>h||b>d),w=m<h&&b<d,A=m>h&&b<d||m<h&&b>d,I=!!c&&!!a&&!u,S=A&&(!a||u||I),v=S?UE(E,h,d,m,b):"nearest",C=S&&v==="nearest"&&(m<h&&m*2>h||b<d&&b*2>d),U=S&&v!=="nearest",L=h*d<=2304||h*d>16384,k=m<h&&b===d||b<d&&m===h,F=(w||k)&&L&&!l&&!(m<h&&3*m+2<=2*h)&&!(b<d&&3*b+2<=2*d)&&(h*d<=2304||da(E,h,d)==="replicate");if(k&&(!a||u||I)){F&&Nh(E,h,d);let $=SE(E,h,d,m,b,y,g);I?(Pr($,m,b,c),a($),f&&f($)):a&&a($);for(let X=0,B=0;X<m*b;X++,B+=3)M[X*4]=$[B],M[X*4+1]=$[B+1],M[X*4+2]=$[B+2],M[X*4+3]=255;return {width:m,height:b,data:M}}if(T&&CE(h,d,m,b)&&(!a||u||I)&&da(E,h,d)==="filter"){let $,X=E;I&&(m===h||b===d?b>d?($=new Int32Array((d+1)*h*3),$.set(E),$.set(E.subarray((d-1)*h*3),d*h*3),Pr($,h,d+1,c,false,false,void 0,Int32Array.from({length:d+1},(O,j)=>g?b-1-j:j)),a($),X=$.subarray(0,h*d*3)):(X=E.slice(),Pr(X,h,d,c,false,false,void 0,Int32Array.from({length:d},(O,j)=>g?b-1-j:j)),a(X)):($=DE(E,h,d,m,b,c,g),a($)));let B=LE(X,h,d,m,b,$);if(y||g){let O=B.slice();for(let j=0;j<b;j++)for(let q=0;q<m;q++){let ae=((g?b-1-j:j)*m+(y?m-1-q:q))*3;B.set(O.subarray(ae,ae+3),(j*m+q)*3);}}a&&u&&a(B),f&&I&&f(B);for(let O=0,j=0;O<m*b;O++,j+=3)M[O*4]=B[j],M[O*4+1]=B[j+1],M[O*4+2]=B[j+2],M[O*4+3]=255;return {width:m,height:b,data:M}}((T||C||v==="despeckled")&&L||w&&F)&&!l&&!P&&!R&&Nh(E,h,d);let _=I&&(m>=h&&b>=d||U&&m*b>=h*d),H=_&&U&&m<h&&b>d;if(H){let $=new Int32Array((d+1)*h*3);$.set(E),$.copyWithin(d*h*3,(d-1)*h*3,d*h*3),E=$;}_&&Pr(E,h,H?d+1:d,c,false,false,void 0,g?Int32Array.from({length:H?d+1:d},($,X)=>b-1-X):void 0),a&&!u&&(!I||_)&&a(E);let G=U?Math.min(h,m):m,W=U?Math.min(d,b):b,N=U?($,X,B)=>hi($,X,B):($,X,B)=>Xh(0,$,X,B),Z=U&&m>h,J=U&&b>d,K=N(h,G,y&&!Z),ie=N(d,W,g&&!J);if(C){let $=(X,B,O,j)=>{for(let q=0;q<O;q++){let ae=j?O-1-q:q,se=O<B?Math.floor(((ae+1)*2*B-O)/(2*O)):Zl(ae,B,O);X[q]=[[Math.max(0,Math.min(B-1,se)),1]];}};$(K,h,m,y),$(ie,d,b,g);}else if(A&&!U){let $=(X,B,O,j)=>{if(!(O<=B))for(let q=0;q<O;q++){let ae=Math.max(0,Math.min(B-1,(q+.5)*B/O-.5)),se=Math.floor(ae),de=ae-se,me=ee=>j?B-1-ee:ee;X[q]=[[me(se),1-de],[me(Math.min(B-1,se+1)),de]];}};$(K,h,m,y),$(ie,d,b,g);}let ce=U?new Float64Array(G*W*3):new Int32Array(m*b*3);w&&(ce=IE(E,h,d,m,b,y,g));for(let $=0;!w&&$<W;$++){let X=ie[$];for(let B=0;B<G;B++){let O=K[B],j=0,q=0,ae=0,se=0;for(let[ee,le]of X)for(let[xe,Je]of O){let At=Je*le;se+=At;let et=(ee*h+xe)*3;j+=E[et]*At,q+=E[et+1]*At,ae+=E[et+2]*At;}let de=($*G+B)*3,me=ee=>U?ee/se:A?Math.ceil(ee/se-.5):Math.floor((2*ee+se)/(2*se));ce[de]=me(j),ce[de+1]=me(q),ce[de+2]=me(ae);}}if(U){let $=m<h,X;if(H){let ae=new Float64Array(G*3);for(let se=0;se<G;se++){let de=0,me=[0,0,0];for(let[ee,le]of K[se]){de+=le;for(let xe=0;xe<3;xe++)me[xe]+=E[(d*h+ee)*3+xe]*le;}for(let ee=0;ee<3;ee++)ae[se*3+ee]=me[ee]/de;}X=ae;}for(let ae of [$,!$]){let se=ce;ce=new Int32Array(se.length);let de=X,me=(ee,le,xe)=>le>=W&&de?de[Math.max(0,Math.min(G-1,ee))*3+xe]:se[(Math.max(0,Math.min(W-1,le))*G+Math.max(0,Math.min(G-1,ee)))*3+xe];if(ae&&de){let ee=new Int32Array(G*3);for(let le=0;le<G;le++)for(let xe=0;xe<3;xe++){let Je=de[le*3+xe],At=me(le-1,W,xe)+me(le+1,W,xe);ee[le*3+xe]=Math.max(0,Math.min(255,Math.floor(Je+(2*Je-At)/4)));}X=ee;}for(let ee=0;ee<W;ee++)for(let le=0;le<G;le++)for(let xe=0;xe<3;xe++){let Je=me(le,ee,xe),At=ae?me(le-1,ee,xe)+me(le+1,ee,xe):me(le,ee-1,xe)+me(le,ee+1,xe);ce[(ee*G+le)*3+xe]=Math.max(0,Math.min(255,Math.floor(Je+(2*Je-At)/4)));}}let B=ce;ce=new Int32Array(m*b*3);let O=(ae,se)=>ae===se?Array.from({length:se},(de,me)=>[[me,1]]):se===2*ae?Array.from({length:se},(de,me)=>{let ee=Math.max(0,Math.min(ae-1,(me+.5)*ae/se-.5)),le=Math.floor(ee);return [[le,1-(ee-le)],[Math.min(ae-1,le+1),ee-le]]}):jh(ae,se),j=O(G,m),q=O(W,b);Z&&y&&j.reverse(),J&&g&&q.reverse();for(let ae=0;ae<b;ae++)for(let se=0;se<m;se++)for(let de=0;de<3;de++){let me=0;for(let[ee,le]of q[ae])for(let[xe,Je]of j[se])me+=B[(ee*G+xe)*3+de]*le*Je;ce[(ae*m+se)*3+de]=Math.max(0,Math.min(255,Math.floor(me+.5+1e-7)));}}if(A&&!U&&!C){let $=ce.slice(),X=(B,O,j)=>$[(Math.max(0,Math.min(b-1,O))*m+Math.max(0,Math.min(m-1,B)))*3+j];for(let B=0;B<b;B++)for(let O=0;O<m;O++)for(let j=0;j<3;j++){let q=X(O,B,j),ae=m<h?X(O-1,B,j)+X(O+1,B,j):X(O,B-1,j)+X(O,B+1,j);ce[(B*m+O)*3+j]=Math.max(0,Math.min(255,q+Math.floor((2*q-ae)/4)));}}if(I&&!_){let $=(j,q,ae,se)=>Int32Array.from({length:j},(de,me)=>ae>q?Math.max(0,Math.ceil((2*me+1)*q/(2*ae))-1):se?Math.max(0,Math.min(q-1,Math.floor(((me+1)*2*q-ae)/(2*ae)))):me),X=C&&m*b>h*d,B=X?$(m,h,m,true):void 0,O=X?$(b,d,b,false):void 0;B&&y&&(B=B.slice().reverse()),O&&g&&b>d&&(O=O.slice().reverse().map(j=>b-1-j)),Pr(ce,m,b,c,false,false,B,O),a(ce);}a&&u&&a(ce),f&&I&&f(ce);for(let $=0,X=0;$<m*b;$++,X+=3)M[$*4]=ce[X],M[$*4+1]=ce[X+1],M[$*4+2]=ce[X+2],M[$*4+3]=255;return {width:m,height:b,data:M}}function pa(e,t){if(t.kind==="solid")return t.rgb;if(t.kind==="none")return 0;let{state:n,bounds:r}=e,o=e.sx||1,i=e.sy||1;return (s,a)=>chunkI7XOR2GO_js.j(t,Math.floor(r.left+(s+.5)/o),Math.floor(r.top+(a+.5)/i),n.brushOrgX,n.brushOrgY)}function Zh(e,t,n,r,o,i,s,a){let u=Math.min(n.dx,n.dx+n.dw)-r,l=Math.min(n.dy,n.dy+n.dh)-o,c=i===Rr?Vh(t.pixels,n.sx,n.sy,n.sw,n.sh,n.dw,n.dh,t.adjust,t.adjustAfterSampling,n.dibOrigin==="bottom-left",t.adjust&&!t.adjustAfterSampling?{startX:zl(Math.min(n.dx,n.dx+n.dw),s),startY:ql(Math.min(n.dy,n.dy+n.dh),a)}:void 0,t.curves):$h(t.pixels,n.sx,n.sy,n.sw,n.sh,n.dw,n.dh,i);if(c.width===0||c.height===0)return;let f=chunkI7XOR2GO_js.Z(c.width,c.height);f&&(chunkI7XOR2GO_js.ma(f.ctx,chunkI7XOR2GO_js.oa(c.data,c.width,c.height),0,0),e.save(),e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation="source-over",chunkI7XOR2GO_js.ka(e,f.canvas,Math.round(u),Math.round(l),c.width,c.height),e.restore());}function tc(e,t,n=false){if(!t.source)return null;let r=chunkI7XOR2GO_js.e(e.view,t.source.bmi,t.source.bits,t.source.cbBits,t.source.palColors?tn(e.state):null);if(!r)return null;let o=e.state.colorAdjustment;t.stretch&&e.state.stretchBltMode===Rr&&e.halftoneRotatedAdjusts===void 0&&(e.halftoneRotatedAdjusts=!n&&!!o);let i=t.stretch&&e.state.stretchBltMode===Rr&&o,s=sb(o),a=i&&!s?ub(o):void 0,u=i?(f=>Ou(f,a?.palette??o)):void 0,l=a?.curves,{sy:c}=t;return t.dibOrigin==="bottom-left"&&e.view.getInt32(t.source.bmi+8,true)>0&&(c=r.height-c-t.sh),{decoded:{pixels:r,adjust:u,adjustAfterSampling:s,curves:l?f=>Ou(f,l):void 0},req:{...t,sy:c}}}function Ql(e,t,n,r){let o=e.globalCompositeOperation,i=e.fillStyle;e.save(),e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation=n,e.fillStyle=t,e.fillRect(r.dx,r.dy,r.dw,r.dh),e.restore(),e.globalCompositeOperation=o,e.fillStyle=i;}var zh={136:[204,"multiply"],34:[51,"multiply"],238:[204,"screen"],187:[51,"screen"],102:[204,"difference"],153:[51,"difference"],160:[240,"multiply"],10:[15,"multiply"],250:[240,"screen"],175:[15,"screen"],90:[240,"difference"],165:[15,"difference"]};function FE(e,t,n,r,o){let{ctx:i}=e,s=fh(t.dx,t.dy,t.dw,t.dh,e.canvasW,e.canvasH);if(!s)return;if(typeof i.getImageData!="function"){chunkI7XOR2GO_js.r("runTernary: context cannot read pixels back; ROP3 skipped");return}let a="source-over";if(!chunkI7XOR2GO_js.ra(i)&&fn(n).usesD){let d=zh[n];if(!d){chunkI7XOR2GO_js.r(`runTernary: ROP3 0x${n.toString(16)} needs the destination, which SVG output without a raster mirror cannot read; skipped`);return}[n,a]=d,r=fn(n).usesP,o=fn(n).usesS;}let u=chunkI7XOR2GO_js.i(e.state);if(r&&u.kind==="none")return;let l=chunkI7XOR2GO_js.Z(s.w,s.h);if(!l)return;let c=null;if(o){let d=tc(e,t);if(!d)return;Zh(l.ctx,d.decoded,d.req,s.x,s.y,e.state.stretchBltMode,e.state.brushOrgX,e.state.brushOrgY),c=chunkI7XOR2GO_js.la(l.ctx,0,0,s.w,s.h);}let f=chunkI7XOR2GO_js.la(i,s.x,s.y,s.w,s.h),m=pa(e,u);mh(f,c,m,n,s.x,s.y);let b=a==="source-over"&&fn(n).usesD?Ks(i,s):null,h=[];if(b){let d=c?c.data:null,p=g=>typeof m=="number"?m:m(s.x+g%s.w,s.y+Math.floor(g/s.w)),x=g=>d?d[g*4]<<16|d[g*4+1]<<8|d[g*4+2]:0,y=zh[n];h=Zs(f.data,s.w*s.h,b,(g,M)=>qe(n,p(g),x(g),M),y?g=>({color:qe(y[0],p(g),x(g),0),mode:y[1]}):void 0);}chunkI7XOR2GO_js.ma(l.ctx,f,0,0),i.save(),i.setTransform(1,0,0,1,0,0),i.globalCompositeOperation=a,i.globalAlpha=1,chunkI7XOR2GO_js.ka(i,l.canvas,s.x,s.y,s.w,s.h),i.restore(),Qs(i,s,h);}function ec(e,t,n){return Math.sign(e!==0?e:t!==0?t:n)}function qh(e,t,n,r){return ec(e,n,r)>=0&&ec(e-t,n,r)<0}function Jh(e,t,n,r){let o=Math.floor(e/t);return e===o*t&&ec(0,n,r)<0?o-1:o}function Qh(e,t,n,r,o,i,s,a,u,l,c,f,m){let{ctx:b}=e,h=gl(i);if(h===170)return;let d=fn(h);if(!chunkI7XOR2GO_js.ra(b)&&d.usesD){chunkI7XOR2GO_js.r("executeRotatedBlit: rotated destination-reading ROP3 needs pixel read-back; skipped in SVG output");return}if(typeof b.getImageData!="function"){chunkI7XOR2GO_js.r("executeRotatedBlit: context cannot read pixels back; rotated ROP3 skipped");return}if(r===0||o===0)return;let p=chunkI7XOR2GO_js.i(e.state);if(d.usesP&&p.kind==="none")return;let x=pa(e,p),y=null,g=a,M=u,E;if(d.usesS){let R=tc(e,{plan:{kind:"ternary",index:h,operands:d},dx:0,dy:0,dw:r,dh:o,source:s,sx:a,sy:u,sw:l,sh:c,dibOrigin:f,stretch:m},true);if(!R)return;if(y=R.decoded.pixels,R.decoded.adjust&&e.halftoneRotatedAdjusts){let{adjust:T,adjustAfterSampling:w,curves:A}=R.decoded,I=zl(0,e.state.brushOrgX),S=ql(0,e.state.brushOrgY),v=new Int32Array(3);E=(C,U,L)=>{if(v[0]=C>>16&255,v[1]=C>>8&255,v[2]=C&255,!w){let k=ha(I,S,U,L);for(let F=0;F<3;F++)v[F]=uo(v[F],k);}return T(v),A?.(v),v[0]<<16|v[1]<<8|v[2]};}g=R.req.sx,M=R.req.sy;}let P=(R,T)=>{if(!y)return 0;let w=l<0?g-1-R:g+R,A=c<0?M-1-T:M+T;w=Math.max(0,Math.min(y.width-1,w)),A=Math.max(0,Math.min(y.height-1,A));let I=(A*y.width+w)*4;return y.data[I]<<16|y.data[I+1]<<8|y.data[I+2]};nc(e,ge(e,t,n),ge(e,t+r,n),ge(e,t,n+o),l,c,(R,T,w,A,I)=>{let S=d.usesS?P(R,T):0;E&&d.usesS&&(S=E(S,w,A));let v=typeof x=="function"?x(w,A):x;return qe(h,v,S,I)});}function nc(e,t,n,r,o,i,s){let[a,u]=t,l=n[0]-a,c=n[1]-u,f=r[0]-a,m=r[1]-u,b=l*m-c*f;if(b===0)return;let h=b<0?-1:1;b*=h;let d=[a,n[0],r[0],n[0]+f],p=[u,n[1],r[1],n[1]+m],x=Math.max(0,Math.floor(Math.min(...d)/16)-1),y=Math.max(0,Math.floor(Math.min(...p)/16)-1),g=Math.min(e.canvasW,Math.ceil(Math.max(...d)/16)+2),M=Math.min(e.canvasH,Math.ceil(Math.max(...p)/16)+2);if(g<=x||M<=y)return;let E=Math.abs(o)||1,P=Math.abs(i)||1,R=h*m,T=-h*f,w=-h*c,A=h*l;to(e.ctx,{x,y,w:g-x,h:M-y},(I,S,v)=>{let C=I*16-a,U=S*16-u,L=h*(C*m-U*f),k=h*(l*U-c*C);if(!qh(L,b,R,T)||!qh(k,b,w,A))return -1;let F=Math.min(E-1,Jh(L*E,b,R,T)),_=Math.min(P-1,Jh(k*P,b,w,A));return s(F,_,I,S,v)});}function kE(e,t){let n=In(e),r=Sn(e);return {...t,dx:t.dw<0?t.dx+n:t.dx,dy:t.dh<0?t.dy+r:t.dy}}function ed(e,t,n,r,o,i,s){rc(e,{plan:Js(13369376),dx:t,dy:n,dw:r,dh:o,source:i,...s,dibOrigin:"top-left",stretch:true});}function rc(e,t){let{ctx:n}=e,r=kE(e,t),o=r.plan;switch(o.kind){case "noop":return;case "solid":Ql(n,o.color==="black"?"#000000":"#ffffff","source-over",r);return;case "invert-dest":Ql(n,"#ffffff","difference",r);return;case "copy":{let i=tc(e,r);i&&Zh(n,i.decoded,i.req,0,0,e.state.stretchBltMode,e.state.brushOrgX,e.state.brushOrgY);return}case "ternary":{let i=chunkI7XOR2GO_js.i(e.state);if(o.index===240&&i.kind!=="tile"){i.kind==="solid"&&Ql(n,e.state.brushColor,"source-over",r);return}FE(e,r,o.index,o.operands.usesP,o.operands.usesS);}}}function xa(e,t,n,r,o,i=0){return t>0&&n>0&&r>0&&o>0?{bmi:e+t,bits:e+r,cbBits:o,...i===1?{palColors:true}:{}}:null}function Kh(e,t,n,r,o){let{view:i}=e;if(r<(o?108:96))return true;let s=i.getInt32(n+16,true),a=i.getInt32(n+20,true),u=i.getInt32(n+24,true),l=i.getInt32(n+28,true),c=i.getUint32(n+32,true),f=i.getInt32(n+36,true),m=i.getInt32(n+40,true),b=i.getFloat32(n+44,true),h=i.getFloat32(n+48,true),d=i.getFloat32(n+52,true),p=i.getFloat32(n+56,true),x=i.getFloat32(n+60,true),y=i.getFloat32(n+64,true),g=o?i.getInt32(n+92,true):u,M=o?i.getInt32(n+96,true):l,E=r>=100?xa(t,i.getUint32(n+76,true),i.getUint32(n+80,true),i.getUint32(n+84,true),i.getUint32(n+88,true),i.getUint32(n+72,true)):null,P=b===0&&p===0&&h===0&&d===0,R=P?1:b,T=P?1:p,w={sx:R*f+(P?0:d*m+x),sy:T*m+(P?0:h*f+y),sw:R*g,sh:T*M};return ze(e)?(Qh(e,s,a,u,l,c,E,w.sx,w.sy,w.sw,w.sh,"top-left",o),true):(rc(e,{plan:Js(c),dx:He(e,s),dy:$e(e,a),dw:Ze(e,u),dh:st(e,l),source:E,...w,dibOrigin:"top-left",stretch:o}),true)}function _E(e,t,n,r){let{view:o}=e;if(r<80)return true;let i=o.getInt32(n+16,true),s=o.getInt32(n+20,true),a=o.getInt32(n+64,true),u=o.getInt32(n+68,true),l=o.getUint32(n+60,true),c=xa(t,o.getUint32(n+40,true),o.getUint32(n+44,true),o.getUint32(n+48,true),o.getUint32(n+52,true),o.getUint32(n+56,true)),f=o.getInt32(n+24,true),m=o.getInt32(n+28,true),b=o.getInt32(n+32,true),h=o.getInt32(n+36,true);return ze(e)?(Qh(e,i,s,a,u,l,c,f,m,b,h,"bottom-left",true),true):(rc(e,{plan:Js(l),dx:He(e,i),dy:$e(e,s),dw:Ze(e,a),dh:st(e,u),source:c,sx:f,sy:m,sw:b,sh:h,dibOrigin:"bottom-left",stretch:true}),true)}function td(e,t,n,r,o){switch(t){case 76:return Kh(e,n,r,o,false);case 77:return Kh(e,n,r,o,true);case 81:return _E(e,n,r,o);default:return false}}function ya(e,t,n,r,o,i,s,a=false){return !n||!r||!o||!i?null:chunkI7XOR2GO_js.e(e.view,t+n,t+o,i,s===1?tn(e.state):null,a)}function nd(e,t,n,r,o,i){let{view:s}=e;if(!n||!r||!o||!i)return null;let a=t+n;if(a+16>s.byteLength)return null;let u=s.getInt32(a+4,true),l=s.getInt32(a+8,true),c=Math.abs(l);if(s.getUint16(a+14,true)!==1||u<=0||c===0||u>16384||c>16384)return null;let f=(u+31>>5)*4,m=t+o;if(m+f*c>s.byteLength)return null;let b=new Uint8Array(u*c);for(let h=0;h<c;h++){let d=l>0?c-1-h:h,p=m+h*f;for(let x=0;x<u;x++)b[d*u+x]=s.getUint8(p+(x>>3))>>7-(x&7)&1;}return {width:u,height:c,bits:b}}function ga(e,t,n,r,o,i){let s=e.getFloat32(t,true),a=e.getFloat32(t+4,true),u=e.getFloat32(t+8,true),l=e.getFloat32(t+12,true),c=e.getFloat32(t+16,true),f=e.getFloat32(t+20,true),m=s===0&&l===0&&a===0&&u===0,b=m?1:s,h=m?1:l;return {sx:Math.round(b*n+(m?0:u*r+c)),sy:Math.round(h*r+(m?0:a*n+f)),sw:Math.round(b*o),sh:Math.round(h*i)}}function co(e,t,n){let r=t<0?0:t>=e.width?e.width-1:t,i=((n<0?0:n>=e.height?e.height-1:n)*e.width+r)*4;return (e.data[i+3]<<24|e.data[i]<<16|e.data[i+1]<<8|e.data[i+2])>>>0}function Ma(e,t,n,r,o,i,s,a,u){let l=He(e,t),c=$e(e,n),f=Ze(e,r),m=st(e,o);f<0&&(l+=In(e)),m<0&&(c+=Sn(e));let b=Math.round(Math.abs(f)),h=Math.round(Math.abs(m)),d=Math.abs(a),p=Math.abs(u);if(b===0||h===0||d===0||p===0)return null;let x=Math.round(Math.min(l,l+f)),y=Math.round(Math.min(c,c+m)),g=Math.max(0,x),M=Math.max(0,y),E=Math.min(e.canvasW,x+b),P=Math.min(e.canvasH,y+h);if(E<=g||P<=M)return null;let R=Math.min(i,i+a),T=Math.min(s,s+u),w=new Int32Array(E-g),A=new Int32Array(P-M),I=f<0||m<0,S=(v,C,U)=>I?Math.min(C-1,Math.floor(v*C/U)):di(v,C,U);for(let v=g;v<E;v++){let C=S(v-x,d,b);w[v-g]=a<0!=f<0?R+d-1-C:R+C;}for(let v=M;v<P;v++){let C=S(v-y,p,h);A[v-M]=u<0!=m<0?T+p-1-C:T+C;}return {box:{x:g,y:M,w:E-g,h:P-M},col:w,row:A}}function gi(e,t,n){let{ctx:r}=e;if(chunkI7XOR2GO_js.ra(r)&&typeof r.getImageData=="function"&&to(r,t,n))return;let o=nn(t.w,t.h);if(!o)return;let i=new Uint8ClampedArray(t.w*t.h*4);for(let s=0;s<t.h;s++)for(let a=0;a<t.w;a++){let u=n(t.x+a,t.y+s,0);if(u<0)continue;let l=(s*t.w+a)*4;i[l]=u>>16&255,i[l+1]=u>>8&255,i[l+2]=u&255,i[l+3]=255;}rn(r,t,o,chunkI7XOR2GO_js.oa(i,t.w,t.h));}function Tr(e){return Math.round(e/255)}function BE(e,t,n,r){let o=e>>>24;if(n===0)return -1;let i=e>>16&255,s=e>>8&255,a=e&255,u=t>>16&255,l=t>>8&255,c=t&255;if(!r||o===255&&n!==255)return u+Math.round((i-u)*n/255)<<16|l+Math.round((s-l)*n/255)<<8|c+Math.round((a-c)*n/255);if(o===0)return -1;let f=i,m=s,b=a,h=o;n!==255&&(f=Tr(i*n),m=Tr(s*n),b=Tr(a*n),h=Tr(o*n));let d=255-h,p=b+Tr(c*d),x=m+Tr(l*d)+(p>>8);return (f+Tr(u*d)+(x>>8)&255)<<16|(x&255)<<8|p&255}function GE(e,t,n,r){let{view:o}=e;if(r<108)return;let i=o.getUint32(n+32,true),s=i>>>16&255,a=(i>>>24&1)!==0,u=ya(e,t,o.getUint32(n+76,true),o.getUint32(n+80,true),o.getUint32(n+84,true),o.getUint32(n+88,true),o.getUint32(n+72,true),true);if(!u||s===0)return;let l=ga(o,n+44,o.getInt32(n+36,true),o.getInt32(n+40,true),o.getInt32(n+92,true),o.getInt32(n+96,true)),c=Ma(e,o.getInt32(n+16,true),o.getInt32(n+20,true),o.getInt32(n+24,true),o.getInt32(n+28,true),l.sx,l.sy,l.sw,l.sh);if(!c)return;let{box:f,col:m,row:b}=c;if(!chunkI7XOR2GO_js.ra(e.ctx)){OE(e,c,u,s,a);return}gi(e,f,(h,d,p)=>BE(co(u,m[h-f.x],b[d-f.y]),p,s,a));}function OE(e,t,n,r,o){let{box:i,col:s,row:a}=t,u=nn(i.w,i.h);if(!u)return;let l=new Uint8ClampedArray(i.w*i.h*4);for(let c=0;c<i.h;c++)for(let f=0;f<i.w;f++){let m=co(n,s[f],a[c]),b=o?(m>>>24)*r/255:r,h=(c*i.w+f)*4,d=o&&m>>>24>0?255/(m>>>24):1;l[h]=(m>>16&255)*d,l[h+1]=(m>>8&255)*d,l[h+2]=(m&255)*d,l[h+3]=b;}rn(e.ctx,i,u,chunkI7XOR2GO_js.oa(l,i.w,i.h));}function NE(e,t,n,r){let{view:o}=e;if(r<108)return;let i=si(o.getUint32(n+32,true),tn(e.state)),s=ya(e,t,o.getUint32(n+76,true),o.getUint32(n+80,true),o.getUint32(n+84,true),o.getUint32(n+88,true),o.getUint32(n+72,true));if(!s)return;let a=ga(o,n+44,o.getInt32(n+36,true),o.getInt32(n+40,true),o.getInt32(n+92,true),o.getInt32(n+96,true)),u=Ma(e,o.getInt32(n+16,true),o.getInt32(n+20,true),o.getInt32(n+24,true),o.getInt32(n+28,true),a.sx,a.sy,a.sw,a.sh);if(!u)return;let{box:l,col:c,row:f}=u;gi(e,l,(m,b)=>{let h=co(s,c[m-l.x],f[b-l.y])&16777215;return h===i?-1:h});}function WE(e,t,n,r){let{view:o}=e;if(r<128)return;let i=o.getUint32(n+32,true),s=i>>>16&255,a=i>>>24&255,u=o.getInt32(n+24,true),l=o.getInt32(n+28,true),c=ya(e,t,o.getUint32(n+76,true),o.getUint32(n+80,true),o.getUint32(n+84,true),o.getUint32(n+88,true),o.getUint32(n+72,true)),f=nd(e,t,o.getUint32(n+104,true),o.getUint32(n+108,true),o.getUint32(n+112,true),o.getUint32(n+116,true)),m=o.getInt32(n+92,true),b=o.getInt32(n+96,true),h=ga(o,n+44,o.getInt32(n+36,true),o.getInt32(n+40,true),u,l),d=Ma(e,o.getInt32(n+16,true),o.getInt32(n+20,true),u,l,h.sx,h.sy,h.sw,h.sh);if(!d)return;let{box:p,col:x,row:y}=d;if((fn(s).usesD||f!==null&&fn(a).usesD)&&!chunkI7XOR2GO_js.ra(e.ctx)){chunkI7XOR2GO_js.r("EMR_MASKBLT: a destination-reading ROP needs the raster mirror; skipped in SVG output without one");return}let M=pa(e,chunkI7XOR2GO_js.i(e.state)),E=Math.min(h.sx,h.sx+h.sw),P=Math.min(h.sy,h.sy+h.sh);gi(e,p,(R,T,w)=>{let A=x[R-p.x],I=y[T-p.y],S=s;if(f){let U=m+A-E,L=b+I-P;S=(U>=0&&L>=0&&U<f.width&&L<f.height?f.bits[L*f.width+U]:0)?s:a;}let v=c?co(c,A,I)&16777215:0,C=typeof M=="function"?M(R,T):M;return qe(S,C,v,w)});}function HE(e,t,n,r){let{view:o}=e;if(r<140)return;let i=[0,1,2].map(x=>ge(e,o.getInt32(n+16+x*8,true),o.getInt32(n+20+x*8,true))),s=o.getInt32(n+48,true),a=o.getInt32(n+52,true),u=ya(e,t,o.getUint32(n+88,true),o.getUint32(n+92,true),o.getUint32(n+96,true),o.getUint32(n+100,true),o.getUint32(n+84,true));if(!u)return;let l=nd(e,t,o.getUint32(n+116,true),o.getUint32(n+120,true),o.getUint32(n+124,true),o.getUint32(n+128,true)),c=o.getInt32(n+104,true),f=o.getInt32(n+108,true),m=ga(o,n+56,o.getInt32(n+40,true),o.getInt32(n+44,true),s,a),b=(x,y,g=x,M=y)=>{if(l){let R=c+g,T=f+M;if(R<0||T<0||R>=l.width||T>=l.height||!l.bits[T*l.width+R])return -1}let E=m.sw<0?m.sx-1-x:m.sx+x,P=m.sh<0?m.sy-1-y:m.sy+y;return co(u,E,P)&16777215},[h,d,p]=i;if(d[1]===h[1]&&p[0]===h[0]){let x=Math.round(Math.abs(d[0]-h[0])/16),y=Math.round(Math.abs(p[1]-h[1])/16);if(!l&&e.state.stretchBltMode===Rr&&x>0&&y>0){ed(e,Math.round(h[0]/16),Math.round(h[1]/16),d[0]<h[0]?-x:x,p[1]<h[1]?-y:y,xa(t,o.getUint32(n+88,true),o.getUint32(n+92,true),o.getUint32(n+96,true),o.getUint32(n+100,true),o.getUint32(n+84,true)),m);return}let g=Math.round(h[0]/16)+(d[0]<h[0]?1-x:0),M=Math.round(h[1]/16)+(p[1]<h[1]?1-y:0),E=Math.abs(m.sw),P=Math.abs(m.sh),R=Math.max(0,g),T=Math.max(0,M),w=Math.min(e.canvasW,g+x),A=Math.min(e.canvasH,M+y);if(w<=R||A<=T||E===0||P===0)return;let I=d[0]<h[0],S=p[1]<h[1];gi(e,{x:R,y:T,w:w-R,h:A-T},(v,C)=>{let U=di(v-g,E,x),L=di(C-M,P,y);return b(I?E-1-U:U,S?P-1-L:L,U,L)});return}e.state.stretchBltMode===Rr&&e.halftoneRotatedAdjusts===void 0&&(e.halftoneRotatedAdjusts=false),nc(e,h,d,p,m.sw,m.sh,(x,y)=>b(x,y));}function $E(e,t,n,r,o,i,s,a){let{view:u}=e;if(!n||!r||!o||!i||t+n+r>u.byteLength||t+o+i>u.byteLength)return null;let l=new Uint8Array(r+i);l.set(new Uint8Array(u.buffer,u.byteOffset+t+n,r),0),l.set(new Uint8Array(u.buffer,u.byteOffset+t+o,i),r);let c=new DataView(l.buffer),f=c.getInt32(8,true);return c.setInt32(8,f<0?-a:a,true),chunkI7XOR2GO_js.e(c,0,r,i,s===1?tn(e.state):null)}function XE(e,t,n,r){let{view:o}=e;if(r<76)return;let i=o.getInt32(n+24,true),s=o.getInt32(n+28,true),a=o.getInt32(n+32,true),u=o.getInt32(n+36,true),l=o.getUint32(n+40,true),c=o.getUint32(n+44,true),f=o.getUint32(n+60,true),m=o.getUint32(n+64,true);if(m===0||!l||t+l+12>o.byteLength)return;let b=o.getInt32(t+l+8,true),h=b<0,d=Math.abs(b),p=$E(e,t,l,c,o.getUint32(n+48,true),o.getUint32(n+52,true),o.getUint32(n+56,true),m);if(!p)return;let x=Ma(e,o.getInt32(n+16,true),o.getInt32(n+20,true),a,u,0,0,a,u);if(!x)return;let{box:y,col:g,row:M}=x;gi(e,y,(E,P)=>{let R=g[E-y.x],T=M[P-y.y],w=s+u-1-T,A=h?d-1-w-f:m-1-(w-f);if(A<0||A>=p.height)return -1;let I=i+R;return I<0||I>=p.width?-1:co(p,I,A)&16777215});}function rd(e,t,n,r,o){switch(t){case 114:return GE(e,n,r,o),true;case 116:return NE(e,n,r,o),true;case 78:return WE(e,n,r,o),true;case 79:return HE(e,n,r,o),true;case 80:return XE(e,n,r,o),true;default:return false}}var od="\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",id={737:"\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u03C5\u03C6\u03C7\u03C8\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03C9\u03AC\u03AD\u03AE\u03CA\u03AF\u03CC\u03CD\u03CB\u03CE\u0386\u0388\u0389\u038A\u038C\u038E\u038F\xB1\u2265\u2264\u03AA\u03AB\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",775:"\u0106\xFC\xE9\u0101\xE4\u0123\xE5\u0107\u0142\u0113\u0156\u0157\u012B\u0179\xC4\xC5\xC9\xE6\xC6\u014D\xF6\u0122\xA2\u015A\u015B\xD6\xDC\xF8\xA3\xD8\xD7\xA4\u0100\u012A\xF3\u017B\u017C\u017A\u201D\xA6\xA9\xAE\xAC\xBD\xBC\u0141\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u0104\u010C\u0118\u0116\u2563\u2551\u2557\u255D\u012E\u0160\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u0172\u016A\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u017D\u0105\u010D\u0119\u0117\u012F\u0161\u0173\u016B\u017E\u2518\u250C\u2588\u2584\u258C\u2590\u2580\xD3\xDF\u014C\u0143\xF5\xD5\xB5\u0144\u0136\u0137\u013B\u013C\u0146\u0112\u0145\u2019\xAD\xB1\u201C\xBE\xB6\xA7\xF7\u201E\xB0\u2219\xB7\xB9\xB3\xB2\u25A0\xA0",850:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\xD7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xF0\xD0\xCA\xCB\xC8\u0131\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\xFE\xDE\xDA\xDB\xD9\xFD\xDD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0",852:"\xC7\xFC\xE9\xE2\xE4\u016F\u0107\xE7\u0142\xEB\u0150\u0151\xEE\u0179\xC4\u0106\xC9\u0139\u013A\xF4\xF6\u013D\u013E\u015A\u015B\xD6\xDC\u0164\u0165\u0141\xD7\u010D\xE1\xED\xF3\xFA\u0104\u0105\u017D\u017E\u0118\u0119\xAC\u017A\u010C\u015F\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\u011A\u015E\u2563\u2551\u2557\u255D\u017B\u017C\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u0102\u0103\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\u0111\u0110\u010E\xCB\u010F\u0147\xCD\xCE\u011B\u2518\u250C\u2588\u2584\u0162\u016E\u2580\xD3\xDF\xD4\u0143\u0144\u0148\u0160\u0161\u0154\xDA\u0155\u0170\xFD\xDD\u0163\xB4\xAD\u02DD\u02DB\u02C7\u02D8\xA7\xF7\xB8\xB0\xA8\u02D9\u0171\u0158\u0159\u25A0\xA0",855:"\u0452\u0402\u0453\u0403\u0451\u0401\u0454\u0404\u0455\u0405\u0456\u0406\u0457\u0407\u0458\u0408\u0459\u0409\u045A\u040A\u045B\u040B\u045C\u040C\u045E\u040E\u045F\u040F\u044E\u042E\u044A\u042A\u0430\u0410\u0431\u0411\u0446\u0426\u0434\u0414\u0435\u0415\u0444\u0424\u0433\u0413\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u0445\u0425\u0438\u0418\u2563\u2551\u2557\u255D\u0439\u0419\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u043A\u041A\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\u043B\u041B\u043C\u041C\u043D\u041D\u043E\u041E\u043F\u2518\u250C\u2588\u2584\u041F\u044F\u2580\u042F\u0440\u0420\u0441\u0421\u0442\u0422\u0443\u0423\u0436\u0416\u0432\u0412\u044C\u042C\u2116\xAD\u044B\u042B\u0437\u0417\u0448\u0428\u044D\u042D\u0449\u0429\u0447\u0427\xA7\u25A0\xA0",858:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\xD7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xF0\xD0\xCA\xCB\xC8\u20AC\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\xFE\xDE\xDA\xDB\xD9\xFD\xDD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0",860:"\xC7\xFC\xE9\xE2\xE3\xE0\xC1\xE7\xEA\xCA\xE8\xCD\xD4\xEC\xC3\xC2\xC9\xC0\xC8\xF4\xF5\xF2\xDA\xF9\xCC\xD5\xDC\xA2\xA3\xD9\u20A7\xD3\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xD2\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",861:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xD0\xF0\xDE\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xFE\xFB\xDD\xFD\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xC1\xCD\xD3\xDA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",862:"\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",863:"\xC7\xFC\xE9\xE2\xC2\xE0\xB6\xE7\xEA\xEB\xE8\xEF\xEE\u2017\xC0\xA7\xC9\xC8\xCA\xF4\xCB\xCF\xFB\xF9\xA4\xD4\xDC\xA2\xA3\xD9\xDB\u0192\xA6\xB4\xF3\xFA\xA8\xB8\xB3\xAF\xCE\u2310\xAC\xBD\xBC\xBE\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",865:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xA4\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0",866:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\xA4\u25A0\xA0"};var jE=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376];function lc(e,t){return t===2?e:e>=128&&e<=159?jE[e-128]:e}var YE={0:"windows-1252",1:"windows-1252",77:"macintosh",128:"shift_jis",129:"euc-kr",130:"johab",134:"gbk",136:"big5",161:"windows-1253",162:"windows-1254",163:"windows-1258",177:"windows-1255",178:"windows-1256",186:"windows-1257",204:"windows-1251",222:"windows-874",238:"windows-1250",255:"ibm437"},VE={874:"windows-874",932:"shift_jis",936:"gbk",949:"euc-kr",950:"big5",1250:"windows-1250",1251:"windows-1251",1252:"windows-1252",1253:"windows-1253",1254:"windows-1254",1255:"windows-1255",1256:"windows-1256",1257:"windows-1257",1258:"windows-1258",54936:"gb18030",65001:"utf-8"},sd={874:"windows-874",932:"shift_jis",936:"gbk",949:"euc-kr",950:"big5"};function zE(e,t){return {codes:e.map(n=>n<128?n:t.charCodeAt(n-128)),byteLengths:e.map(()=>1)}}function qn(e,t,n){if(t===2)return {codes:[...e],byteLengths:e.map(()=>1)};let r=n?.oem;if(t===255&&(r===void 0||!(r in sd)))return zE(e,(r!==void 0?id[r]:void 0)??od);if(t===130){let s=[],a=[];for(let u=0;u<e.length;u++){let l=e[u],c=Ff(l),f=c&&u+1<e.length?c.charCodeAt(e[u+1]):65533,m=l<128||f===65533?1:2;s.push(l<128?l:f),a.push(m),u+=m-1;}return {codes:s,byteLengths:a}}let o=n?.ansi,i=t===255&&r!==void 0?sd[r]:(t===0||t===1)&&o!==void 0?VE[o]??"windows-1252":YE[t]??"windows-1252";if(i==="windows-1252")return {codes:e.map(s=>lc(s,t)),byteLengths:e.map(()=>1)};try{let s=new TextDecoder(i,{fatal:!0,ignoreBOM:!0}),a=new TextDecoder(i,{ignoreBOM:!0}),u=new Uint8Array(e),l=[],c=[],f=0;for(;f<e.length;){let m=null,b=1;for(let h=1;h<=Math.min(4,e.length-f);h++)try{let d=s.decode(u.subarray(f,f+h));if(d.length>0){m=d,b=h;break}}catch{}m===null&&(m=a.decode(u.subarray(f,f+1)));for(let h=0;h<m.length;h++)l.push(m.charCodeAt(h)),c.push(h===m.length-1?b:0);f+=b;}return {codes:l,byteLengths:c}}catch{return {codes:e.map(s=>lc(s,t)),byteLengths:e.map(()=>1)}}}var qE=[0,0,.4096065,.4875311,.5515784,.6070649,.656426,.7013281,.7426686,.7811829,.8173296,.8514569,.8838279,.9147507,.9443338,.9726402],JE=[0,0,.0556662,.0852493,.1161453,.1485431,.1826704,.2188171,.2572957,.2986719,.343574,.3929351,.4483443,.5124689,.5903349,.6957428],ad=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,23,23,24,24,25,26,26,27,28,28,29,30,30,31,32,32,33,34,35,35,36,37,38,38,39,40,41,42,42,43,44,45,46,47,48,49,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,69,70,71,72,73,74,75,77,78,79,80,81,83,84,85,86,88,89,90,92,93,94,96,97,98,100,101,102,104,105,107,108,109,111,112,114,115,117,118,120,121,123,124,126,128,129,131,132,134,136,137,139,141,142,144,146,147,149,151,153,154,156,158,160,161,163,165,167,169,171,173,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,213,215,217,219,221,223,225,228,230,232,234,237,239,241,243,246,248,250,253,255],KE=[0,24,32,39,44,48,52,55,59,62,64,67,70,72,74,77,79,81,83,85,86,88,90,92,93,95,97,98,100,101,103,104,106,107,108,110,111,112,114,115,116,117,118,120,121,122,123,124,125,127,128,129,130,131,132,133,134,135,136,137,138,139,140,140,142,143,144,145,145,146,147,148,149,150,151,152,152,153,154,154,156,157,157,158,159,160,161,161,162,163,164,165,165,166,167,167,168,169,170,171,171,172,173,173,174,175,176,176,177,178,178,178,180,180,181,182,182,183,184,184,185,186,186,187,188,188,189,189,190,191,192,192,193,193,194,195,195,196,196,197,198,198,199,199,200,201,201,202,202,203,204,204,205,205,206,206,207,208,208,208,209,210,210,211,211,212,212,213,214,214,215,215,216,216,217,217,218,218,219,219,220,220,221,221,222,222,223,224,224,225,225,225,226,227,227,228,228,229,229,229,230,230,231,231,232,232,233,233,234,234,235,235,236,236,237,237,238,238,239,239,239,240,240,240,241,242,242,243,243,244,244,245,245,245,246,246,247,247,248,248,249,249,249,250,250,251,251,252,252,252,253,253,254,254,255,255];function Mi(e,t,n,r){return n<=1?t:n>=16?e:r?KE[Math.floor((n*ad[e]+(16-n)*ad[t])/16)]:t+Math.floor((e-t)*(e>t?qE[n]:JE[n]))}var mo=2,fo=4,fd=16,Pa=4096,Ei=8192,ZE=[255,255,240,233,225,217,208,199,189,178,167,154,140,124,104,77,0];function bd(e){let t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return [0,0,0];let n=parseInt(t[1],16);return [n>>16&255,n>>8&255,n&255]}function hd(e,t,n,r){let o=[0,0,0],i=0,s=255;for(let a=0;a<3;a++)o[a]=r(n[a],255,a),i+=1-(o[a]-r(n[a],0,a))/255,s=Math.min(s,o[a]);if(i=Math.min(1,Math.max(i/3,1-s/255)),!(i<=0)){for(let a=0;a<3;a++)e[t+a]=Math.round((o[a]-255*(1-i))/i);e[t+3]=Math.round(i*255);}}function cc(e,t,n,r){let{left:o,top:i,right:s,bottom:a}=t;r&&(o=Math.max(o,r.left),i=Math.max(i,r.top),s=Math.min(s,r.right),a=Math.min(a,r.bottom)),!(s<=o||a<=i)&&(e.save(),e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation="source-over",e.globalAlpha=1,e.fillStyle=n,e.fillRect(o,i,s-o,a-i),e.restore());}function ud(e,t,n,r){e.save(),e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation="source-over",e.globalAlpha=1,r&&(e.beginPath(),e.rect(r.left,r.top,r.right-r.left,r.bottom-r.top),e.clip()),e.fillStyle=n,e.beginPath(),e.moveTo(t[0].x,t[0].y);for(let o=1;o<t.length;o++)e.lineTo(t[o].x,t[o].y);e.closePath(),e.fill(),e.restore();}function dd(e){return e>=128&&e<=159}function ld(e,t){return !e.glyphIndices&&!(e.options&Pa)&&dd(e.codes[t])}function pd(e,t){let n=t.codes.length,r=t.codes.map(L=>t.glyphIndices?L:e.glyphIndex(L)),o=!!t.matrix&&Math.abs(t.matrix[0])>1e-9&&Math.abs(t.matrix[1])>1e-9&&!!e.rotatedLinearAdvance,i=[];for(let L=0;L<n;L++)i.push(ld(t,L)&&!t.dx?0:t.dx&&L<t.dx.length?t.dx[L]:t.matrix?o?e.rotatedLinearAdvance(r[L]):e.rotatedAdvance(r[L],!!t.matrix&&t.matrix[0]<0):e.advance(r[L]));!t.dx&&t.textJustification&&!t.glyphIndices&&(i=chunkI7XOR2GO_js.m(i,t.codes,t.textJustification.extra,t.textJustification.count));let s=[];for(let L=0;L<n;L++)s.push(t.dy&&L<t.dy.length?t.dy[L]:0);let a=0,u=0;for(let L=0;L<n;L++)a+=i[L],u+=s[L];let l=t.matrix,c=l?l[0]:1,f=l?l[1]:0,m=l?l[2]:0,b=l?l[3]:1,h=o?L=>Math.round(L*16)/16:L=>L,d=0,p=0,x=0,y=t.textAlign&6;if(y===6?d=o?-a/2:-Math.ceil(a/2):y===2&&(d=-a),o&&y){let L=k=>{let F=Math.round(k*a*16);return (y===6?-Math.trunc(F/2):-F)/16};p=L(c),x=L(f);}let g=(L,k)=>o?{x:t.x+p+h(c*(L-d))+h(m*k),y:t.y+x+h(f*(L-d))+h(b*k)}:{x:t.x+c*L+m*k,y:t.y+f*L+b*k},M=t.textAlign&24,E=!!l&&Math.abs(l[0])>1e-9&&Math.abs(l[1])>1e-9,P=l?e.rotatedMetrics?.(l[0],l[1]):void 0,R=P?P.ascent:E?e.rotatedAscent??e.ascent:e.ascent,T=P?P.descent:E?e.rotatedDescent??e.descent:e.descent,w=M===24?0:M===8?-T:R,A=[],I=[],S=t.glyphMatrix??l,v=S?[S[0],S[1],S[2],S[3]]:void 0,C=d,U=w;for(let L=0;L<n;L++){let k=g(C,U),F=!!e.fractionalOrigins,_=F?Math.floor(k.x):Math.round(k.x),H=F?e.fractionalOrigins==="xy"?Math.round((k.x-_)*4)*16:e.fractionalOrigins==="x"?Math.round((k.x-_)*6)*(64/6):Math.round((k.x-_)*64):0,G=e.fractionalOrigins==="xy"?Math.floor(k.y):Math.round(k.y),W=e.fractionalOrigins==="xy"?Math.round((k.y-G)*4)*16:0;if(I.push({x:_+H/64,y:G+W/64,along:C,down:U}),!ld(t,L)){let N=e.glyph(r[L],v,H,W);N.bitmap&&A.push({x:_+N.bitmap.left,y:G-N.bitmap.top,bitmap:N.bitmap});}C+=i[L],U+=s[L];}return {glyphs:r,total:a,totalY:u,startAlong:d,baseDown:w,hAlign:y,at:g,placed:A,origins:I}}function fc(e,t,n,r){let{glyphs:o,total:i,totalY:s,startAlong:a,baseDown:u,at:l,placed:c,origins:f,hAlign:m}=pd(t,n),b=n.matrix,h=b?b[0]:1,d=b?b[1]:0,p=b?b[2]:0,x=b?b[3]:1,y=n.options&fo&&n.rect?n.rect:null;if(n.options&mo&&n.rect&&cc(e,n.rect,n.bkColor,null),n.bkMode===2&&i!==0)if(b){let P=[l(a,u-t.ascent),l(a+i,u-t.ascent),l(a+i,u+t.descent),l(a,u+t.descent)];ud(e,P,n.bkColor,y);}else {let P=Math.round(n.x+a),R=Math.round(n.y+u),T=Math.min(P,P+Math.round(i)),w=Math.max(P,P+Math.round(i));cc(e,{left:T,top:R-t.ascent,right:w,bottom:R+t.descent},n.bkColor,y);}let g=n.bkMode===2;if(!g&&n.options&mo&&n.rect&&c.length>0){let P,R,T,w;if(b){let A=[l(a,u-t.ascent),l(a+i,u-t.ascent),l(a+i,u+t.descent),l(a,u+t.descent)];P=Math.min(...A.map(I=>I.x)),T=Math.max(...A.map(I=>I.x)),R=Math.min(...A.map(I=>I.y)),w=Math.max(...A.map(I=>I.y));}else {let A=Math.round(n.x+a),I=Math.round(n.y+u);P=Math.min(A,A+Math.round(i)),T=Math.max(A,A+Math.round(i)),R=I-t.ascent,w=I+t.descent;}for(let A of c)P=Math.min(P,A.x),R=Math.min(R,A.y),T=Math.max(T,A.x+A.bitmap.width),w=Math.max(w,A.y+A.bitmap.height);g=n.rect.left<=P&&n.rect.top<=R&&n.rect.right>=T&&n.rect.bottom>=w;}if(chunkI7XOR2GO_js.qa(e)?(y&&(e.save(),e.setTransform(1,0,0,1,0,0),e.beginPath(),e.rect(y.left,y.top,y.right-y.left,y.bottom-y.top),e.clip()),QE(e,t,n,o,f,r),y&&e.restore(),e.shadow&&cd(e.shadow,c,n.textColor,t.mode!=="mono",y,g)):cd(e,c,n.textColor,t.mode!=="mono",y,g),(n.underline||n.strikeOut)&&i!==0){let P=[];n.underline&&P.push([t.underlinePosition,Math.max(1,t.underlineThickness),0]),n.strikeOut&&P.push([t.strikeoutPosition,Math.max(1,t.strikeoutThickness),t.strikeoutShift??0]);let R=!b&&n.plusBars==="snapped"&&t.exactDecorations?mc(t.exactDecorations,n,n.x+a,n.y+u,i):null,T=0;for(let[w,A,I]of P){let S=R?.[T++];if(b){let v=[l(a,u-w),l(a+i,u-w),l(a+i,u-w+A),l(a,u-w+A)];ud(e,v,n.textColor,y);}else {let v=Math.round(n.x+a)+I,C=Math.round(n.y+u)-w,U=S?Math.round(S.left):Math.min(v,v+Math.round(i)),L=S?Math.round(S.right):Math.max(v,v+Math.round(i));cc(e,{left:U,top:C,right:L,bottom:C+A},n.textColor,y);}}}let M=m===6?0:m===2?-i:i,E=m===6?0:s;return {dx:h*M+p*E,dy:d*M+x*E}}function QE(e,t,n,r,o,i){let s="",a=[];for(let b=0;b<o.length;b++){let h=n.glyphIndices?t.charForGlyph(r[b]):n.codes[b];!n.glyphIndices&&!(n.options&Pa)&&dd(h)||(s+=String.fromCodePoint(h),a.push(o[b]));}if(s.length===0)return;let u=n.matrix,l=t.ttf,c=t.syntheticBold||l.weightClass>=600,f=t.syntheticItalic||(l.fsSelection&1)!==0||(l.macStyle&2)!==0,m=a[0];e.fillGlyphRun({text:s,xs:a.map(b=>u?b.along-m.along:b.x),ys:a.map(b=>u?b.down-m.down:b.y),matrix:u?[u[0],u[1],u[2],u[3],m.x,m.y]:null,scaleX:t.ppemX!==t.ppem?t.ppemX/t.ppem:1,fontFamily:chunkI7XOR2GO_js.ca(l.family,i),fontSize:t.ppem,fontWeight:c?700:400,italic:f,aliased:t.mode==="mono",fill:n.textColor});}function cd(e,t,n,r,o,i=false){if(t.length===0)return;let s=1/0,a=1/0,u=-1/0,l=-1/0;for(let E of t)s=Math.min(s,E.x),a=Math.min(a,E.y),u=Math.max(u,E.x+E.bitmap.width),l=Math.max(l,E.y+E.bitmap.height);let c=e.canvas;typeof c?.width=="number"&&typeof c?.height=="number"&&(s=Math.max(s,0),a=Math.max(a,0),u=Math.min(u,c.width),l=Math.min(l,c.height)),o&&(s=Math.max(s,o.left),a=Math.max(a,o.top),u=Math.min(u,o.right),l=Math.min(l,o.bottom));let f=u-s,m=l-a;if(f<=0||m<=0||f*m>64*1024*1024)return;if(t.some(E=>E.bitmap.channels===3)){n3(e,t,n,s,a,f,m);return}let b=new Uint8Array(f*m),h=r?16:1;for(let E of t){let P=E.bitmap;for(let R=0;R<P.height;R++){let T=E.y+R-a;if(!(T<0||T>=m))for(let w=0;w<P.width;w++){let A=P.data[R*P.width+w];if(!A)continue;let I=E.x+w-s;if(I<0||I>=f)continue;let S=T*f+I;r&&b[S]?b[S]=((b[S]-1|A-1)&15)+1:A>b[S]&&(b[S]=A);}}}let d=chunkI7XOR2GO_js.Z(f,m);if(!d)return;let[p,x,y]=bd(n),g=new Uint8ClampedArray(f*m*4),M=null;if(r&&typeof e.getImageData=="function")try{M=chunkI7XOR2GO_js.la(e,s,a,f,m).data;}catch{M=null;}for(let E=0;E<f*m;E++){let P=b[E];if(P<=(r?1:0))continue;let R=E*4;!r||P>=h?(g[R]=p,g[R+1]=x,g[R+2]=y,g[R+3]=255):M&&M[R+3]===255?(g[R]=Mi(p,M[R],P,i),g[R+1]=Mi(x,M[R+1],P,i),g[R+2]=Mi(y,M[R+2],P,i),g[R+3]=255):M?hd(g,R,[p,x,y],(T,w)=>Mi(T,w,P,i)):(g[R]=p,g[R+1]=x,g[R+2]=y,g[R+3]=255-ZE[P]);}chunkI7XOR2GO_js.ma(d.ctx,chunkI7XOR2GO_js.oa(g,f,m),0,0),e.save(),e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation="source-over",e.globalAlpha=1,chunkI7XOR2GO_js.ka(e,d.canvas,s,a,f,m),e.restore();}function bc(e,t,n){let r=e.fontDetails,o=e.fontHeight*t;return {face:e.fontFamily,height:o<0?-Math.round(-o):Math.round(o),width:r&&r.width?Math.round(Math.abs(r.width*n)):0,weight:e.fontWeight,italic:e.fontItalic,charSet:r?r.charSet:1,pitchAndFamily:r?r.pitchAndFamily:0,quality:r?r.quality:0}}function Ra(e,t,n,r){let[o,i,s,a,u,l]=r.matrix,c=Math.hypot(o,i),f=Math.hypot(s,a);if(!(c>0)||!(f>0)||r.codes.length===0)return null;let m=i===0&&s===0&&n.fontEscapementTenthDeg%3600===0,b=bc(n,f,c);m&&r.playbackStretch&&r.playbackStretch!==1&&(b.playbackStretch=r.playbackStretch);let h=t.realize(b,n.fontFamilyMap);if(!h)return null;let p=i!==0||s!==0?[o/c,i/c,s/f,a/f]:null,x=p,y=n.fontEscapementTenthDeg%3600;if(y!==0){let S=(U,L)=>{let k=[L,-U,U,L];return p?[p[0]*k[0]+p[2]*k[1],p[1]*k[0]+p[3]*k[1],p[0]*k[2]+p[2]*k[3],p[1]*k[2]+p[3]*k[3]]:k},v=chunkI7XOR2GO_js.o(y),C=y/10*(Math.PI/180);x=S(v.sin,v.cos),p=S(Math.sin(C),Math.cos(C));}if(x&&r.playbackStretch&&r.playbackStretch!==1){let S=r.playbackStretch;x=[x[0]*S,x[1]*S,x[2],x[3]];}let g=(n.textAlign&1)!==0,M=g?n.curX:r.x,E=g?n.curY:r.y,P=(S,v)=>({x:o*S+s*v+u,y:i*S+a*v+l}),R=P(M,E),T=null;if(r.rect&&r.options&(mo|fo)){let S=P(r.rect.left,r.rect.top),v=P(r.rect.right,r.rect.bottom);T={left:Math.round(Math.min(S.x,v.x)),top:Math.round(Math.min(S.y,v.y)),right:Math.round(Math.max(S.x,v.x)),bottom:Math.round(Math.max(S.y,v.y))};}let w={codes:r.codes,glyphIndices:r.glyphIndices,x:R.x,y:R.y,dx:r.dx?r.dx.map(S=>S*c):null,dy:r.dy?r.dy.map(S=>-S*f):null,textJustification:r.textJustification?{...r.textJustification,extra:r.textJustification.extra*c}:void 0,textAlign:n.textAlign,textColor:n.textColor,bkColor:n.bkColor,bkMode:n.bkMode,options:r.options,rect:T,matrix:p,glyphMatrix:x,underline:n.fontUnderline,strikeOut:n.fontStrikeOut},A=fc(e,h,w,n.fontFamilyMap),I=o*a-i*s;return I===0?{dx:0,dy:0}:{dx:(a*A.dx-s*A.dy)/I,dy:(-i*A.dx+o*A.dy)/I}}var xd=1.2,md=Uint8Array.from({length:256},(e,t)=>Math.floor(255*Math.pow(t/255,xd)+.5)),e3=Uint8Array.from({length:256},(e,t)=>Math.floor(255*Math.pow(t/255,1/xd)+.5));function Ea(e,t,n){let r=md[e],o=md[t],i=n===1&&r<o||n===5&&r>o;return e3[Math.floor((r*n+o*(6-n)+(i?2:3))/6)]}function hn(e){return Math.round(e*6/255)}function yd(e,t,n,r,o=Math.round){let i=n[r],s=n[r+1],a=n[r+2];if(!i&&!s&&!a)return;if(!e[t]&&!e[t+1]&&!e[t+2]){e[t]=i,e[t+1]=s,e[t+2]=a;return}let u=chunk5OO5QZBQ_js.a(Math.min(6,hn(e[t])+hn(i)),Math.min(6,hn(e[t+1])+hn(s)),Math.min(6,hn(e[t+2])+hn(a)));for(let l=0;l<3;l++)e[t+l]=o(u[l]*255/6);}function t3(e,t,n){return Ea(e,t,hn(n*255))}function n3(e,t,n,r,o,i,s){let a=new Uint8Array(i*s*3);for(let m of t){let b=m.bitmap,h=b.channels===3?3:1;for(let d=0;d<b.height;d++){let p=m.y+d-o;if(!(p<0||p>=s))for(let x=0;x<b.width;x++){let y=m.x+x-r;if(y<0||y>=i)continue;let g=(d*b.width+x)*h,M=(p*i+y)*3;if(b.additiveClearType){yd(a,M,b.data,g);continue}for(let E=0;E<3;E++){let P=h===3?b.data[g+E]:b.data[g]*255;P>a[M+E]&&(a[M+E]=P);}}}}let u=chunkI7XOR2GO_js.Z(i,s);if(!u)return;let l;try{l=chunkI7XOR2GO_js.la(e,r,o,i,s).data;}catch{return}let c=bd(n),f=new Uint8ClampedArray(i*s*4);for(let m=0;m<i*s;m++){let b=a[m*3],h=a[m*3+1],d=a[m*3+2];if(!b&&!h&&!d)continue;let p=m*4;if(l[p+3]!==255){let M=[b/255,h/255,d/255];hd(f,p,c,(E,P,R)=>t3(E,P,M[R]));continue}let x=hn(b),y=hn(h),g=hn(d);x===6&&y===6&&g===6?(f[p]=c[0],f[p+1]=c[1],f[p+2]=c[2]):x||y||g?(f[p]=Ea(c[0],l[p],x),f[p+1]=Ea(c[1],l[p+1],y),f[p+2]=Ea(c[2],l[p+2],g)):(f[p]=l[p],f[p+1]=l[p+1],f[p+2]=l[p+2]),f[p+3]=255;}chunkI7XOR2GO_js.ma(u.ctx,chunkI7XOR2GO_js.oa(f,i,s),0,0),e.save(),e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation="source-over",e.globalAlpha=1,chunkI7XOR2GO_js.ka(e,u.canvas,r,o,i,s),e.restore();}function mc(e,t,n,r,o){let i=c=>Math.ceil(Math.floor(c*512+1e-7)/512*4-1e-9)/4,s=c=>Math.ceil(c*8-1e-9)/8,a=n+o,u=(c,f)=>{let m=Math.max(1,Math.round(f)),b=i(c-(m-1)/2);if(m===1){let h={left:n+.3,right:a+.8,top:b,bottom:b+1};if(a<n||Math.max(Math.abs(n),Math.abs(a),Math.abs(c))>=8388607)return h;let d=Dt(n),p=Dt(a),x=Dt(c),y=Math.floor(d/16),g=Math.floor(x/16);return {...h,nominal:{pts:[d,x,p,x],box:{x:y,y:g,w:Math.ceil(p/16+1)-y,h:Math.ceil(x/16+1)-g}}}}return {left:s(n+.5),right:s(a+.5),top:b,bottom:b+m}},l=[];return t.underline&&l.push(u(r-e.underlinePosition,e.underlineThickness)),t.strikeOut&&l.push(u(r-e.strikeoutPosition,e.strikeoutThickness)),l}function gd(e,t,n={}){let{placed:r,total:o,startAlong:i,baseDown:s}=pd(e,t),a=[],u=[];if(n.decorations&&t.plusBars==="fractional"&&e.exactDecorations&&!t.matrix&&o!==0&&e.mode==="gray")u.push(...mc(e.exactDecorations,t,t.x+i,t.y+s,o));else if(n.decorations&&!t.matrix&&o!==0){let g=Math.round(t.x+i),M=g+Math.round(o),E=t.plusBars==="snapped"&&e.exactDecorations?mc(e.exactDecorations,t,t.x+i,t.y+s,o):null,P=0,R=(T,w)=>{let A=Math.round(t.y+s)-T,I=E?.[P++],S=I?Math.round(I.left):g,v=I?Math.round(I.right):M;a.push({left:Math.min(S,v),right:Math.max(S,v),top:A,bottom:A+Math.max(1,w)});};t.underline&&R(e.underlinePosition,e.underlineThickness),t.strikeOut&&R(e.strikeoutPosition,e.strikeoutThickness);}if(r.length===0&&a.length===0&&u.length===0)return null;let l=1/0,c=1/0,f=-1/0,m=-1/0;for(let g of r)l=Math.min(l,g.x),c=Math.min(c,g.y),f=Math.max(f,g.x+g.bitmap.width),m=Math.max(m,g.y+g.bitmap.height);for(let g of a)l=Math.min(l,g.left),c=Math.min(c,g.top),f=Math.max(f,g.right),m=Math.max(m,g.bottom);for(let g of u){let M=g.nominal?.box;l=Math.min(l,M?.x??Math.floor(g.left)),c=Math.min(c,M?.y??Math.floor(g.top)),f=Math.max(f,M?M.x+M.w:Math.ceil(g.right)),m=Math.max(m,M?M.y+M.h:Math.ceil(g.bottom));}let b=f-l,h=m-c;if(b<=0||h<=0||b*h>64*1024*1024)return null;let d=r.some(g=>g.bitmap.channels===3)?3:1,p=new Uint8ClampedArray(b*h*d),x=e.mode==="mono"?1:n.grayLevels??16;for(let g of r){let M=g.bitmap,E=M.channels===3?3:1;for(let P=0;P<M.height;P++)for(let R=0;R<M.width;R++){let T=P*M.width+R,w=(g.y+P-c)*b+(g.x+R-l);if(d===3&&E===3){yd(p,w*3,M.data,T*3,M.additiveClearType?Math.round:Math.floor);continue}for(let A=0;A<d;A++){let I=Math.round(M.data[T]*255/x),S=w*d+A;I>p[S]&&(p[S]=I);}}}for(let g of a)for(let M=g.top;M<g.bottom;M++)p.fill(255,((M-c)*b+g.left-l)*d,((M-c)*b+g.right-l)*d);let y=u.length>0?new Uint8ClampedArray(b*h):void 0;for(let g of u){if(g.nominal){let{pts:M,box:E}=g.nominal,P=Ts([{pts:M,closed:false}],{antialias:true,half:false,opaqueSolid:true},E);for(let R=0;R<E.h;R++){let T=(E.y+R-c)*b+E.x-l;for(let w=0;w<E.w;w++)y[T+w]=Math.max(y[T+w],P[R*E.w+w]);}continue}for(let M=Math.floor(g.top);M<Math.ceil(g.bottom);M++){let E=Math.min(M+1,g.bottom)-Math.max(M,g.top);for(let P=Math.floor(g.left);P<Math.ceil(g.right);P++){let R=Math.round(E*4)*Math.round((Math.min(P+1,g.right)-Math.max(P,g.left))*8),T=Math.round(R*255/32),w=(M-c)*b+P-l;T>y[w]&&(y[w]=T);}}}return {x:l,y:c,width:b,height:h,channels:d,data:p,bars:y}}function Md(e,t,n,r,o){let i=e.getUint32(n+64,true);if(i===0)return null;let s=t+i,a=s+r*4;if(s<0||a>o)return null;let u=[];for(let l=0;l<r;l++)u.push(e.getInt32(s+l*4,true));return u}function r3(e,t,n,r,o,i){let{ctx:s,view:a,state:u}=e,l=e.fonts;if(!l)return false;let c=a.getUint32(n+44,true),f=[];for(let M=0;M<r;M++)f.push(a.getUint16(t+o+M*2,true));let m=(c&Ei)!==0,b=Md(a,t,n,m?r*2:r,i),h=b,d=null;if(b&&m){h=[],d=[];for(let M=0;M<r;M++)h.push(b[M*2]|0),d.push(b[M*2+1]|0);}let p=a.getFloat32(n+20,true),x=a.getFloat32(n+24,true),y=a.getUint32(n+16,true)===1&&p>0&&x>0?x/p:void 0,g=Ra(s,l,u,{playbackStretch:y,codes:f,glyphIndices:(c&fd)!==0,x:a.getInt32(n+28,true),y:a.getInt32(n+32,true),options:c,rect:{left:a.getInt32(n+48,true),top:a.getInt32(n+52,true),right:a.getInt32(n+56,true),bottom:a.getInt32(n+60,true)},dx:h,dy:d,matrix:Ee(e),textJustification:u.textJustification});return g?(u.textAlign&1&&(u.curX+=g.dx,u.curY+=g.dy),true):false}function o3(e){return (e&6)===6?"center":e&2?"right":"left"}function i3(e){let t=e&24;return t===24?"alphabetic":t===8?"bottom":"top"}function hc(e,t,n,r,o,i,s,a,u=null){let l=r?chunkI7XOR2GO_js.l(r):e.measureText(n).width,c=r?o+chunkI7XOR2GO_js.n(l,s):o;if(t.bkMode===2){let f=chunkI7XOR2GO_js.da(t,a),m=e.fillStyle;e.fillStyle=t.bkColor,e.fillRect(c,i-f,l,f),e.fillStyle=m;}if(e.fillStyle=t.textColor,r){let f=chunkI7XOR2GO_js.k(r),m=u?chunkI7XOR2GO_js.k(u):null,b=e.textAlign;e.textAlign="left";for(let h=0;h<n.length&&h<f.length;h++)e.fillText(n[h],c+f[h],i+(m?.[h]??0));e.textAlign=b;}else e.fillText(n,o,i);(t.fontUnderline||t.fontStrikeOut)&&chunkI7XOR2GO_js.fa(e,t,c,i,l,a);}function Ed(e,t,n,r){let{ctx:o,view:i,state:s}=e;if(r<76)return true;let a=(s.textAlign&1)!==0,u=a?s.curX:i.getInt32(n+28,true),l=a?s.curY:i.getInt32(n+32,true),c=i.getUint32(n+36,true),f=i.getUint32(n+40,true),m=Math.min(i.byteLength,t+r);if(c===0||f===0||c>Math.floor((m-t-f)/2)||r3(e,t,n,c,f,m))return true;let b=chunkI7XOR2GO_js.ga(i,t+f,c);if(b.length===0)return true;let d=ze(e)?Ee(e):null,p=d?Math.hypot(d[2],d[3]):Math.abs(st(e,1)),x=d?Math.hypot(d[0],d[1]):null;chunkI7XOR2GO_js.ea(o,s,p);let y=o3(s.textAlign);o.textBaseline=i3(s.textAlign),o.textAlign=y==="center"?"center":y==="right"?"right":"left";let g=(i.getUint32(n+44,true)&Ei)!==0,M=Md(i,t,n,g?c*2:c,m),E=M&&g?M.filter((I,S)=>S%2===0):M,P=M&&g?M.filter((I,S)=>S%2===1):null,R=P?P.map(I=>d?I*p:st(e,I)):null,T=E?E.map(I=>x!==null?I*x:Ze(e,I)):null;if(!T&&s.textJustification&&!g){let I=b.split(""),S=I.map(C=>o.measureText(C).width),v=x??Ze(e,1);T=chunkI7XOR2GO_js.m(S,I.map(C=>C.charCodeAt(0)),s.textJustification.extra*v,s.textJustification.count);}T&&(o.textAlign="left");let w=d?Be(e,u,l):{x:He(e,u),y:$e(e,l)},A=chunkI7XOR2GO_js.p(s.fontEscapementTenthDeg);if(d&&p>0&&x?(o.save(),o.translate(w.x,w.y),o.transform(d[0]/x,d[1]/x,d[2]/p,d[3]/p,0,0),A!==0&&o.rotate(A),hc(o,s,b,T,0,0,y,p,R),o.restore()):A!==0?(o.save(),o.translate(w.x,w.y),o.rotate(A),hc(o,s,b,T,0,0,y,p,R),o.restore()):hc(o,s,b,T,w.x,w.y,y,p,R),a){let I=x??Ze(e,1),S=T&&I?chunkI7XOR2GO_js.l(T)/I:I?o.measureText(b).width/I:0,v=y==="center"?0:y==="right"?-S:S,C=y!=="center"&&P?chunkI7XOR2GO_js.l(P):0;s.curX+=v*Math.cos(A)-C*Math.sin(A),s.curY+=v*Math.sin(A)+C*Math.cos(A);}return true}function pc(e,t,n,r,o,i,s){let a=r.length,u=76,l=u+a*2+3&-4,c=s?s.length:0,f=l+c*4,m=new DataView(new ArrayBuffer(f));m.setUint32(44,a,true),m.setUint32(48,u,true),m.setUint32(52,o,true),m.setInt32(36,t,true),m.setInt32(40,n,true),m.setInt32(56,i[0],true),m.setInt32(60,i[1],true),m.setInt32(64,i[2],true),m.setInt32(68,i[3],true),m.setUint32(72,s?l:0,true);for(let h=0;h<a;h++)m.setUint16(u+h*2,r[h],true);if(s)for(let h=0;h<c;h++)m.setInt32(l+h*4,s[h],true);let b={...e,view:m};Ed(b,0,8,f);}function Pd(e,t,n,r){let{view:o}=e;return qn(Array.from({length:n},(i,s)=>o.getUint8(t+s)),r,e.codePages)}function Rd(e,t,n){if(!e)return null;let r=[],o=0;for(let i of t){let s=0,a=0;for(let u=0;u<i;u++)s+=e[o+u*(n?2:1)]??0,n&&(a+=e[o+u*2+1]??0);r.push(s),n&&r.push(a),o+=i*(n?2:1);}return r}function s3(e,t,n,r,o){let{view:i,state:s}=e,a=Math.min(i.byteLength,t+r);if(r<40)return true;let u=i.getUint32(n+28,true),l=n+32;if(u>Math.floor((a-l)/40))return true;let c=s.fontDetails?.charSet??1;for(let f=0;f<u;f++){let m=l+f*40,b=i.getInt32(m,true),h=i.getInt32(m+4,true),d=i.getUint32(m+8,true),p=i.getUint32(m+12,true),x=i.getUint32(m+16,true),y=[i.getInt32(m+20,true),i.getInt32(m+24,true),i.getInt32(m+28,true),i.getInt32(m+32,true)],g=i.getUint32(m+36,true),M=o?2:1;if(!p||p>a-t||d>Math.floor((a-(t+p))/M))continue;let E=o?null:Pd(e,t+p,d,c),P=o?Array.from({length:d},(A,I)=>i.getUint16(t+p+I*2,true)):E.codes,R=null,T=(x&Ei)!==0,w=d*(T?2:1);g&&g<=a-t&&w<=Math.floor((a-(t+g))/4)&&(R=Array.from({length:w},(A,I)=>i.getInt32(t+g+I*4,true)),o||(R=Rd(R,E.byteLengths,T))),pc(e,b,h,P,x|Pa,y,R);}return true}function a3(e,t,n,r){let{view:o}=e,i=Math.min(o.byteLength,t+r);if(r<36)return true;let s=o.getInt32(n,true),a=o.getInt32(n+4,true),u=o.getUint32(n+8,true),l=o.getUint32(n+12,true),c=(l&512)!==0,f=(l&256)!==0,m=n+28+(f?0:16);if(m>i||u>Math.floor((i-m)/(c?1:2)))return true;let b=f?[0,0,0,0]:[o.getInt32(n+28,true),o.getInt32(n+32,true),o.getInt32(n+36,true),o.getInt32(n+40,true)],h=c?Array.from({length:u},(d,p)=>o.getUint8(m+p)):Array.from({length:u},(d,p)=>o.getUint16(m+p*2,true));return pc(e,s,a,h,l,b,null),true}function Td(e,t,n,r,o){if(t===84)return Ed(e,n,r,o);if(t===83||t===96||t===97||t===108){if(t===96||t===97)return s3(e,n,r,o,t===97);if(t===108)return a3(e,n,r,o);let{view:i,state:s}=e,a=Math.min(i.byteLength,n+o);if(o<76)return true;let u=i.getInt32(r+28,true),l=i.getInt32(r+32,true),c=i.getUint32(r+36,true),f=i.getUint32(r+40,true),m=i.getUint32(r+44,true);if(!f||f>a-n||c>a-(n+f))return true;let b=Pd(e,n+f,c,s.fontDetails?.charSet??1),h=[i.getInt32(r+48,true),i.getInt32(r+52,true),i.getInt32(r+56,true),i.getInt32(r+60,true)],d=i.getUint32(r+64,true),p=null,x=(m&Ei)!==0,y=c*(x?2:1);return d&&d<=a-n&&y<=Math.floor((a-(n+d))/4)&&(p=Array.from({length:y},(g,M)=>i.getInt32(n+d+M*4,true)),p=Rd(p,b.byteLengths,x)),pc(e,u,l,b.codes,m,h,p),true}return false}function wr(e,t,n){let r=al(n==="replace"?null:e.clipRegion??null,t,n,{x:0,y:0,w:e.canvasW,h:e.canvasH});r.exact||chunkI7XOR2GO_js.q(`gdiCombineClip: '${n}' approximated (region exceeds the scanline domain)`),e.clipRegion=r.region,Yt(e,r.region);}function wd(e,t){let{view:n}=e,r=n.getInt32(t,true),o=n.getInt32(t+4,true),i=n.getInt32(t+8,true),s=n.getInt32(t+12,true);return Gb(He(e,r),$e(e,o),Ze(e,i-r),st(e,s-o))}function f3(e,t,n){return n>=24&&wr(e,wd(e,t),"intersect"),true}function b3(e,t,n){return n>=24&&wr(e,wd(e,t),"exclude"),true}var xc={1:"intersect",2:"union",3:"xor",4:"exclude",5:"replace"};function h3(e,t,n){let{view:r}=e;if(n<16)return true;let o=r.getUint32(t,true),i=r.getUint32(t+4,true),s=xc[i];if(!s)return chunkI7XOR2GO_js.q(`EMR_EXTSELECTCLIPRGN: unknown RegionMode ${i}: ignored`),true;if(o===0)return s==="replace"&&(e.clipRegion=null,Yt(e,null),chunkI7XOR2GO_js.q("EMR_EXTSELECTCLIPRGN: RGN_COPY with empty region: clip reset")),true;let a=t+8;if(o<32)return true;let u=r.getUint32(a+8,true);if(u===0)return true;let l=[],c=a+32;for(let f=0;f<u;f++){let m=c+f*16;if(m+16>t+8+o)break;let b=r.getInt32(m,true),h=r.getInt32(m+4,true),d=r.getInt32(m+8,true),p=r.getInt32(m+12,true),x=xl(e,b),y=yl(e,h);l.push({x,y,w:xl(e,d)-x,h:yl(e,p)-y});}return l.length===0||(wr(e,mn(l),s),chunkI7XOR2GO_js.q(`EMR_EXTSELECTCLIPRGN: mode=${i} (${s}) with ${l.length} rect(s)`)),true}function d3(e,t,n){if(n>=16){let r=e.view.getInt32(t,true),o=e.view.getInt32(t+4,true);if(e.clipRegion){let i=In(e),s=Sn(e),a=Math.round(Ze(e,r)/i)*i,u=Math.round(st(e,o)/s)*s;e.clipRegion=mr(e.clipRegion,a,u),Yt(e,e.clipRegion),chunkI7XOR2GO_js.q(`EMR_OFFSETCLIPRGN: clip translated by (${r},${o}) logical units`);}}return true}function Ad(e,t,n,r){switch(t){case 30:return f3(e,n,r);case 75:return h3(e,n,r);case 29:return b3(e,n,r);case 26:return d3(e,n,r);default:return false}}var x3=1;function y3(e,t,n){let r=new Uint8Array(t*n);if(!e.clipRegion)return r.fill(1),r;for(let o of tr(e.clipRegion,null,"intersect",{x:0,y:0,w:t,h:n}))for(let i=Math.max(0,o.y);i<Math.min(n,o.y+o.h);i++)r.fill(1,i*t+Math.max(0,o.x),i*t+Math.min(t,o.x+o.w));return r}function g3(e,t,n,r,o,i,s){let a=new chunkI7XOR2GO_js.t,u=(m,b)=>{let h=b*t+m;return s[h]===1&&i(e[h*4]<<16|e[h*4+1]<<8|e[h*4+2])};if(r<0||o<0||r>=t||o>=n||!u(r,o))return a;let l=new Uint8Array(t*n),c=[r,o],f=[];for(;c.length>0;){let m=c.pop(),b=c.pop();if(l[m*t+b]||!u(b,m))continue;let h=b;for(;h>0&&!l[m*t+h-1]&&u(h-1,m);)h--;let d=b+1;for(;d<t&&!l[m*t+d]&&u(d,m);)d++;l.fill(1,m*t+h,m*t+d),f.push([m,h,d]);for(let p of [m-1,m+1]){if(p<0||p>=n)continue;let x=false;for(let y=h;y<d;y++){let g=!l[p*t+y]&&u(y,p);g&&!x&&c.push(y,p),x=g;}}}f.sort((m,b)=>m[0]-b[0]||m[1]-b[1]);for(let[m,b,h]of f)a.add(m,b,h);return a}function Id(e,t,n,r){if(t!==53)return false;if(r<24)return true;let{ctx:o,view:i,state:s}=e;if(!chunkI7XOR2GO_js.ra(o)||typeof o.getImageData!="function")return chunkI7XOR2GO_js.r("EMR_EXTFLOODFILL: the destination cannot be read back (SVG output without a raster mirror); skipped"),true;let a=on(e);if(!a)return true;let u=e.canvasW,l=e.canvasH,[c,f]=ge(e,i.getInt32(n,true),i.getInt32(n+4,true)),m=si(i.getUint32(n+8,true),tn(s)),b=i.getUint32(n+12,true)===x3,h;try{h=chunkI7XOR2GO_js.la(o,0,0,u,l).data;}catch{return true}let d=g3(h,u,l,Math.round(c/16),Math.round(f/16),b?p=>p===m:p=>p!==m,y3(e,u,l));return at(e,d,a,s.rop2),true}var E3=0,Sd=1,Dd=2;function P3(e,t,n,r){let o=Math.floor((t-e)*65536/r);return Math.floor((e*65536+o*n)/65536)>>8}function R3(e,t){let n=chunkI7XOR2GO_js.u([e.flatMap(m=>[m.x,m.y])],false);if(n.length===0)return;let[r,o,i]=e.map(m=>({x:m.x/16,y:m.y/16,c:m.c.map(b=>Math.min(b,65280))})),s=(o.x-r.x)*(i.y-r.y)-(i.x-r.x)*(o.y-r.y);if(s===0)return;let a=[0,1,2].map(m=>((o.c[m]-r.c[m])*(i.y-r.y)-(i.c[m]-r.c[m])*(o.y-r.y))/s),u=[0,1,2].map(m=>((i.c[m]-r.c[m])*(o.x-r.x)-(o.c[m]-r.c[m])*(i.x-r.x))/s),l=a.map(m=>Math.floor(m*65536)),c=n.data,f=c[0];for(let m=0;m<n.length*3;m+=3){let b=c[m],h=c[m+1],d=c[m+2];if(b<t.y||b>=t.y+t.h)continue;let p=[0,1,2].map(x=>r.c[x]+a[x]*(h-r.x)+u[x]*(b-r.y)+(b===f?0:.5));for(let x=Math.max(h,t.x);x<Math.min(d,t.x+t.w);x++){let y=0;for(let g=0;g<3;g++){let M=Math.floor(p[g]+l[g]*(x-h)/65536+1e-9)>>8;y=y<<8|Math.max(0,Math.min(255,M));}t.rgb[(b-t.y)*t.w+(x-t.x)]=y;}}}function T3(e,t,n){let{view:r}=e;if(n<36)return null;let o=r.getUint32(t+16,true),i=r.getUint32(t+20,true),s=r.getUint32(t+24,true),a=s===Dd?3:2,u=t+28,l=u+o*16;if(o>1e6||i>1e6||l+i*a*4>t-8+n)return null;let c=[];for(let m=0;m<o;m++){let b=u+m*16,[h,d]=ge(e,r.getInt32(b,true),r.getInt32(b+4,true));c.push({x:h,y:d,c:[r.getUint16(b+8,true),r.getUint16(b+10,true),r.getUint16(b+12,true)]});}let f=[];for(let m=0;m<i;m++){let b=[];for(let h=0;h<a;h++)b.push(r.getUint32(l+(m*a+h)*4,true));b.every(h=>h<o)&&f.push(b);}return {mode:s,vertices:c,mesh:f}}function vd(e,t){let n=Math.max(0,t.x),r=Math.max(0,t.y),o=Math.min(e.canvasW,t.x+t.w),i=Math.min(e.canvasH,t.y+t.h);if(o<=n||i<=r)return;let s=o-n,a=i-r,u=new Uint8ClampedArray(s*a*4),l=false;for(let f=0;f<a;f++)for(let m=0;m<s;m++){let b=t.rgb[(f+r-t.y)*t.w+(m+n-t.x)];if(b<0)continue;let h=(f*s+m)*4;u[h]=b>>16&255,u[h+1]=b>>8&255,u[h+2]=b&255,u[h+3]=255,l=true;}let c=l?nn(s,a):null;c&&rn(e.ctx,{x:n,y:r,w:s,h:a},c,chunkI7XOR2GO_js.oa(u,s,a));}function Cd(e){return `#${e.map(t=>(t>>8).toString(16).padStart(2,"0")).join("")}`}function w3(e,t,n){let r=Math.round(e.x/16),o=Math.round(e.y/16),i=Math.round(t.x/16),s=Math.round(t.y/16),a=(n?o<=s:r<=i)?e:t;return {l:Math.min(r,i),t:Math.min(o,s),r:Math.max(r,i),b:Math.max(o,s),first:a,second:a===e?t:e}}function Ld(e,t,n,r){if(t!==118)return false;let o=T3(e,n,r);if(!o)return true;let{ctx:i}=e;if(o.mode===E3||o.mode===Sd){let s=o.mode===Sd,a=chunkI7XOR2GO_js.qa(i)&&e.gdiAntialias!==false;for(let[u,l]of o.mesh){let c=w3(o.vertices[u],o.vertices[l],s),f=c.r-c.l,m=c.b-c.t;if(f<=0||m<=0)continue;if(a){let M=s?m:f,E=s?i.createLinearGradient(0,c.t,0,c.t+M):i.createLinearGradient(c.l,0,c.l+M,0);E.addColorStop(0,Cd(c.first.c)),E.addColorStop(1,Cd(c.second.c)),i.save(),i.setTransform(1,0,0,1,0,0),i.fillStyle=E,i.fillRect(c.l,c.t,f,m),i.restore();continue}let b=Math.max(c.l,0),h=Math.max(c.t,0),d=Math.min(c.r,e.canvasW),p=Math.min(c.b,e.canvasH);if(d<=b||p<=h)continue;let x={x:b,y:h,w:d-b,h:p-h,rgb:new Int32Array((d-b)*(p-h))},y=s?m:f,g=[];for(let M=s?h-c.t:b-c.l;M<(s?p-c.t:d-c.l);M++){let E=0;for(let P=0;P<3;P++)E=E<<8|Math.max(0,Math.min(255,P3(c.first.c[P],c.second.c[P],M,y)));g.push(E);}for(let M=0;M<x.h;M++)for(let E=0;E<x.w;E++)x.rgb[M*x.w+E]=g[s?M:E];vd(e,x);}return true}if(o.mode===Dd)for(let s of o.mesh){let a=s.map(d=>o.vertices[d]),u=a.map(d=>d.x/16),l=a.map(d=>d.y/16),c=Math.max(0,Math.floor(Math.min(...u))-1),f=Math.max(0,Math.floor(Math.min(...l))-1),m=Math.min(e.canvasW,Math.ceil(Math.max(...u))+1),b=Math.min(e.canvasH,Math.ceil(Math.max(...l))+1);if(m<=c||b<=f)continue;let h={x:c,y:f,w:m-c,h:b-f,rgb:new Int32Array((m-c)*(b-f)).fill(-1)};R3(a,h),vd(e,h);}return true}var v3=6;function yc(e,t,n){let r=[];if(n<32||t+32>e.byteLength)return r;let o=e.getUint32(t+8,true),i=Math.min(e.byteLength,t+n);for(let s=0;s<o;s++){let a=t+32+s*16;if(a+16>i)break;r.push([e.getInt32(a,true),e.getInt32(a+4,true),e.getInt32(a+8,true),e.getInt32(a+12,true)]);}return r}function gc(e,t){let n=new chunkI7XOR2GO_js.t;if(ze(e)){let r=t.map(([o,i,s,a])=>[...ge(e,o,i),...ge(e,s,i),...ge(e,s,a),...ge(e,o,a)]);return chunkI7XOR2GO_js.u(r,true,n)}for(let[r,o,i,s]of t){let a=Math.round(He(e,r)),u=Math.round(He(e,i)),l=Math.round($e(e,o)),c=Math.round($e(e,s)),f=Math.min(a,u),m=Math.max(a,u);for(let b=Math.min(l,c);b<Math.max(l,c);b++)n.add(b,f,m);}return n}function C3(e,t,n){let r=new chunkI7XOR2GO_js.t,o=e.bounds();if(!o)return r;let i=o.x1-o.x0,s=o.y1-o.y0,a=new Uint8Array(i*s),u=e.data;for(let f=0;f<e.length*3;f+=3)a.fill(1,(u[f]-o.y0)*i+u[f+1]-o.x0,(u[f]-o.y0)*i+u[f+2]-o.x0);let l=new Uint8Array(i*s);for(let f=0;f<s;f++)for(let m=0;m<i;m++){let b=1;for(let h=-t;h<=t&&b;h++){let d=m+h;b=d>=0&&d<i?a[f*i+d]:0;}l[f*i+m]=b;}let c=(f,m)=>{for(let b=-n;b<=n;b++){let h=m+b;if(h<0||h>=s||!l[h*i+f])return false}return true};for(let f=0;f<s;f++){let m=-1;for(let b=0;b<=i;b++){let h=b<i&&a[f*i+b]===1&&!c(b,f);h&&m<0?m=b:!h&&m>=0&&(r.add(f+o.y0,m+o.x0,b+o.x0),m=-1);}}return r}function Fd(e,t){let n=t>=2147483648?chunkI7XOR2GO_js.ha(t-2147483648):e.objectTable.get(t)??null;return n&&n.kind==="brush"?n:null}function Mc(e,t,n){let{state:r}=e,o={style:r.brushStyle,color:r.brushColor,pattern:r.brushPattern};n&&(r.brushStyle=n.style,r.brushColor=n.colorRef!==void 0?xt(r,n.colorRef):n.color,r.brushPattern=n.pattern??null);try{let i=on(e);i&&at(e,t,i,r.rop2);}finally{r.brushStyle=o.style,r.brushColor=o.color,r.brushPattern=o.pattern;}}function kd(e,t,n,r){let{view:o}=e;switch(t){case 71:{if(r>=32){let i=o.getUint32(n+16,true),s=Fd(e,o.getUint32(n+20,true));s&&Mc(e,gc(e,yc(o,n+24,i)),s);}return true}case 72:{if(r>=40){let i=o.getUint32(n+16,true),s=Fd(e,o.getUint32(n+20,true)),a=Math.round(Math.abs(Ze(e,o.getInt32(n+24,true)))),u=Math.round(Math.abs(st(e,o.getInt32(n+28,true))));if(s){let l=gc(e,yc(o,n+32,i));Mc(e,C3(l,a,u),s);}}return true}case 73:case 74:{if(r>=24){let i=o.getUint32(n+16,true),s=gc(e,yc(o,n+20,i));t===73?at(e,s,{kind:"solid",rgb:0},v3):Mc(e,s,null);}return true}default:return false}}function _d(e,t,n,r,o){return Td(e,t,n,r,o)||td(e,t,n,r,o)||rd(e,t,n,r,o)||Ad(e,t,r,o)||kd(e,t,r,o)||Id(e,t,r,o)||Ld(e,t,r,o)}function Aa(e,t,n,r,o){return _h(e,t,r,o)||_d(e,t,n,r,o)}function D3(e,t,n,r,o,i,s){let{view:a}=t,u=0;for(let l=0;l<o;l++){let c=a.getUint32(r+l*4,true);for(let f=0;f<c&&u<i;f++){let m=n(u);f===0?e.moveTo(m.x,m.y):e.lineTo(m.x,m.y),u++;}s&&e.closePath();}}function Bd(e,t,n,r,o,i,s){let{view:a}=t,u=0;for(let l=0;l<o;l++){let c=a.getUint32(r+l*4,true);for(let f=0;f<c&&u<i;f++){let[m,b]=n(u),[h,d]=ge(t,m,b);f===0?e.moveTo(h,d):e.lineTo(h,d),u++;}s&&c>0&&e.closeFigure();}}function Ia(e,t,n,r,o,i){let{view:s,state:a,inPath:u}=e,l=s.getUint32(n+16,true),c=s.getUint32(n+20,true);if(l===0||l>=1e4||c>=1e5)return;let f=n+24,m=f+l*4;if(m+c*o>t+r)return;let b=p=>o===8?[s.getInt32(m+p*8,true),s.getInt32(m+p*8+4,true)]:[s.getInt16(m+p*4,true),s.getInt16(m+p*4+2,true)],h=p=>{let[x,y]=b(p);return Be(e,x,y)},d=p=>{D3(p,e,h,f,l,c,i);};if(u){d(Wt(e)),e.rasterPath??(e.rasterPath=new chunkI7XOR2GO_js.G),Bd(e.rasterPath,e,b,f,l,c,i);return}e.lineStyle={pos:0},Qe(e,{build:p=>{p.beginPath(),d(p);},raster:()=>{let p=new chunkI7XOR2GO_js.G;return Bd(p,e,b,f,l,c,i),p},fill:i,stroke:true,fillRule:a.polyFillMode===2?"nonzero":"evenodd"});}function Gd(e,t,n,r){Ia(e,t,n,r,8,true);}function Od(e,t,n,r){Ia(e,t,n,r,8,false);}function Nd(e,t,n,r){Ia(e,t,n,r,4,false);}function Wd(e,t,n,r){Ia(e,t,n,r,4,true);}function qd(e,t,n,r,o){let{state:i,inPath:s}=e,{polygon:a,bezier:u,to:l}=o,c=h=>{let[d,p]=r(h);return Be(e,d,p)},f=h=>{if(!l){let p=c(0);h.moveTo(p.x,p.y);}let d=l?0:1;if(u)for(;d+2<n;){let p=c(d),x=c(d+1),y=c(d+2);h.bezierCurveTo(p.x,p.y,x.x,x.y,y.x,y.y),d+=3;}else for(;d<n;d++){let p=c(d);h.lineTo(p.x,p.y);}a&&h.closePath();},m=h=>{let[d,p]=r(h);return ge(e,d,p)},b=(h,d)=>{let p=0;if(l)d&&h.moveTo(d[0],d[1]);else {let x=m(0);h.moveTo(x[0],x[1]),p=1;}if(u)for(;p+2<n;p+=3){let x=m(p),y=m(p+1),g=m(p+2);h.bezierTo(x[0],x[1],y[0],y[1],g[0],g[1]);}else for(;p<n;p++){let x=m(p);h.lineTo(x[0],x[1]);}a&&h.closeFigure();};if(s)l&&so(e),f(Wt(e)),e.rasterPath??(e.rasterPath=new chunkI7XOR2GO_js.G),b(e.rasterPath,null);else {let h=l?Ln(e):null,d=l?Be(e,i.curX,i.curY):null;e.lineStyle={pos:0},Qe(e,{build:p=>{p.beginPath(),d&&p.moveTo(d.x,d.y),f(p);},raster:()=>{let p=new chunkI7XOR2GO_js.G;return b(p,h),p},fill:a,stroke:true,fillRule:i.polyFillMode===2?"nonzero":"evenodd"});}if(l&&n>0){let[h,d]=r(n-1);i.curX=h,i.curY=d,e.curFix=void 0;}}function z3(e,t,n,r,o){let{view:i}=e;if(o<28)return true;let s=i.getUint32(r+16,true),a=r+20;return s===0||a+s*8>n+o||qd(e,t,s,u=>[i.getInt32(a+u*8,true),i.getInt32(a+u*8+4,true)],{polygon:t===3,bezier:t===2||t===5,to:t===5||t===6}),true}function q3(e,t,n,r,o){let{view:i}=e;if(o<28)return true;let s=i.getUint32(r+16,true),a=r+20;return s===0||a+s*4>n+o||qd(e,t,s,u=>[i.getInt16(a+u*4,true),i.getInt16(a+u*4+2,true)],{polygon:t===86,bezier:t===85||t===88,to:t===88||t===89}),true}var Ec=1,J3=2,K3=4,Hd=6;function $d(e,t,n,r,o){let{view:i,state:s,inPath:a}=e;if(r<28)return;let u=i.getUint32(n+16,true),l=n+20,c=l+u*o;if(u===0||u>1e6||c+u>t+r)return;let f=x=>o===8?[i.getInt32(l+x*8,true),i.getInt32(l+x*8+4,true)]:[i.getInt16(l+x*4,true),i.getInt16(l+x*4+2,true)],m=x=>i.getUint8(c+x),b=(x,y,g,M)=>{let E=false,P=()=>{E||(M&&x?.moveTo(M.x,M.y),g&&y?.moveTo(g[0],g[1]),E=true);};for(let R=0;R<u;R++){let w=m(R)&~Ec;if(w===Hd){let[A,I]=f(R),S=Be(e,A,I),v=ge(e,A,I);x?.moveTo(S.x,S.y),y?.moveTo(v[0],v[1]),E=true;continue}if(w===J3){P();let[A,I]=f(R),S=Be(e,A,I),v=ge(e,A,I);x?.lineTo(S.x,S.y),y?.lineTo(v[0],v[1]);}else if(w===K3&&R+2<u){P();let A=[0,1,2].map(v=>f(R+v)),I=A.map(([v,C])=>Be(e,v,C)),S=A.map(([v,C])=>ge(e,v,C));x?.bezierCurveTo(I[0].x,I[0].y,I[1].x,I[1].y,I[2].x,I[2].y),y?.bezierTo(S[0][0],S[0][1],S[1][0],S[1][1],S[2][0],S[2][1]),R+=2;}else continue;m(R)&Ec&&(x?.closePath(),y?.closeFigure());}},h=(m(0)&~Ec)===Hd;if(a)h||so(e),e.rasterPath??(e.rasterPath=new chunkI7XOR2GO_js.G),b(Wt(e),e.rasterPath,null,null);else {let x=h?null:Ln(e),y=h?null:Be(e,s.curX,s.curY);e.lineStyle={pos:0},Qe(e,{build:g=>{g.beginPath(),b(g,null,null,y);},raster:()=>{let g=new chunkI7XOR2GO_js.G;return b(null,g,x,null),g},fill:false,stroke:true});}let[d,p]=f(u-1);s.curX=d,s.curY=p,e.curFix=void 0;}function Z3(e){let t=[];for(let n of e)n.op==="moveTo"&&t.length>0&&t.push({op:"closePath"}),t.push(n);return t.length>0&&t.push({op:"closePath"}),t}function Pc(e,t,n){let{state:r}=e,o=t&&n,i=o?Z3(e.pathCmds):e.pathCmds,s=u=>{u.beginPath(),ch(u,i);},a=e.rasterPath??new chunkI7XOR2GO_js.G;if(o){let u=new chunkI7XOR2GO_js.G;u.append(a);for(let l of u.figures)l.closed=true;a=u;}Qe(e,{build:s,raster:()=>a,fill:t,stroke:n,fillRule:r.polyFillMode===2?"nonzero":"evenodd"});}function Ti(e){e.pathCmds=[],e.rasterPath=new chunkI7XOR2GO_js.G;}function Jd(e){let t=[];for(let n of e.rasterPath?.figures??[]){for(let r=0;r+1<n.pts.length;r+=2)t.push({op:r===0?"moveTo":"lineTo",x:n.pts[r]/16,y:n.pts[r+1]/16});n.closed&&t.push({op:"closePath"});}e.pathCmds=t;}function Q3(e){if(!(e.inPath||!e.rasterPath)){for(let t of e.rasterPath.figures)delete t.tangents,delete t.curveSegs,delete t.roundWiden;Jd(e);}}function eP(e){let{state:t}=e;if(e.inPath||!e.rasterPath||(t.penStyle&15)===5)return;let n=yt(e)?{width:16,cap:"round",join:"round",miterLimit:t.miterLimit??10}:Ll(e),r=ai(e.rasterPath,n),o=new chunkI7XOR2GO_js.G;for(let i of r)if(!(i.length<4)){o.moveTo(i[0],i[1]);for(let s=2;s+1<i.length;s+=2)o.lineTo(i[s],i[s+1]);o.closeFigure();}e.rasterPath=o,Jd(e);}function va(e,t,n,r,o){let{ctx:i,state:s}=e;switch(t){case 4:case 3:case 2:case 5:case 6:return z3(e,t,n,r,o);case 87:case 86:case 85:case 88:case 89:return q3(e,t,n,r,o);case 7:return o>=28&&Od(e,n,r,o),true;case 8:return o>=28&&Gd(e,n,r,o),true;case 91:return o>=28&&Wd(e,n,r,o),true;case 56:return $d(e,n,r,o,8),true;case 92:return $d(e,n,r,o,4),true;case 90:return o>=28&&Nd(e,n,r,o),true;case 59:return e.inPath=true,e.pathCmds=[],e.rasterPath=new chunkI7XOR2GO_js.G,i.beginPath(),true;case 60:return e.inPath=false,true;case 61:return i.closePath(),e.inPath&&(e.pathCmds.push({op:"closePath"}),e.rasterPath?.closeFigure()),true;case 62:return Pc(e,true,false),Ti(e),true;case 63:return Pc(e,true,true),Ti(e),true;case 64:return Pc(e,false,true),Ti(e),true;case 65:return Q3(e),true;case 66:return eP(e),true;case 68:return e.inPath=false,Ti(e),i.beginPath(),true;case 67:{let a=o>=12?e.view.getUint32(r,true):5,u=xc[a];if(e.inPath||!e.rasterPath||e.rasterPath.figures.length===0)return true;if(!u)return chunkI7XOR2GO_js.q(`EMR_SELECTCLIPPATH: unknown RegionMode ${a}: ignored`),true;let l=Tl(chunkI7XOR2GO_js.H(e.rasterPath,s.polyFillMode===2)),c=l.length>0?mn(l):Ot();return wr(e,c,u),Ti(e),true}default:return false}}var gP=new Set([16,99,100,101,102,103,104,105,106,109,110,111,112,113,119,121,122]);function Kd(e,t,n,r){let{view:o,state:i}=e;switch(t){case 120:{if(r>=16){let s=o.getInt32(n,true),a=o.getInt32(n+4,true);i.textJustification=s!==0&&a>0?{extra:s,count:a}:void 0;}return true}case 23:{let s=r>=8+Us?Fs(o,n):null;return s?i.colorAdjustment=s:chunkI7XOR2GO_js.q("EMR_SETCOLORADJUSTMENT: invalid COLORADJUSTMENT ignored"),true}default:return gP.has(t)?(chunkI7XOR2GO_js.q(`EMF record ${t} consumed (no effect on a raster surface)`),true):false}}function Qd(e,t,n,r){let{view:o,state:i}=e;switch(t){case 38:{if(r>=28){let s=o.getUint32(n,true),a=o.getUint32(n+4,true),u=o.getInt32(n+8,true),l=jn(o,n+16),c=xt(i,l);e.objectTable.set(s,{kind:"pen",style:a&255,widthX:u,color:c,flags:a,...ii(l)?{colorRef:l}:{}});}return true}case 95:{if(r>=52){let s=o.getUint32(n,true),a=o.getUint32(n+20,true),u=o.getInt32(n+24,true),l=jn(o,n+32),c=xt(i,l),f=o.getUint32(n+40,true),m=[];if((a&15)===7)for(let b=0;b<f&&b<16&&52+b*4+4<=r;b++)m.push(o.getUint32(n+44+b*4,true));e.objectTable.set(s,{kind:"pen",style:a&15,widthX:u,color:c,flags:a,extended:true,...ii(l)?{colorRef:l}:{},...m.length>0?{userStyle:m}:{}});}return true}case 39:{if(r>=24){let s=o.getUint32(n,true),a=o.getUint32(n+4,true),u=jn(o,n+8),l=xt(i,u),c=o.getUint32(n+12,true);e.objectTable.set(s,{kind:"brush",style:a,color:l,...ii(u)?{colorRef:u}:{},...a===2&&c<=5?{pattern:{kind:"hatch",hatch:c}}:{}});}return true}case 93:case 94:{if(r>=32){let s=o.getUint32(n,true),a=t===93,u=o.getUint32(n+4,true),l=chunkI7XOR2GO_js.h(o,n-8,n,a,u===1?tn(i):null);e.objectTable.set(s,{kind:"brush",style:l?a?3:6:0,color:"#808080",...l?{pattern:l}:{}});}return true}case 82:{if(r>=332){let s=o.getUint32(n,true),a=o.getInt32(n+4,true),u=o.getInt32(n+8,true),l=o.getInt32(n+12,true),c=o.getInt32(n+16,true),f=o.getInt32(n+20,true),m=o.getUint8(n+24),b=o.getUint8(n+25),h=o.getUint8(n+26),d=o.getUint8(n+27),p=o.getUint8(n+30),x=o.getUint8(n+31),y=chunkI7XOR2GO_js.ga(o,n+32,32)||"sans-serif";e.objectTable.set(s,{kind:"font",height:a,weight:f,italic:m!==0,underline:b!==0,strikeOut:h!==0,family:y,escapementTenthDeg:l,details:{width:u,orientationTenthDeg:c,charSet:d,quality:p,pitchAndFamily:x}});}return true}case 37:{if(r>=12){let s=o.getUint32(n,true),a=s>=2147483648?chunkI7XOR2GO_js.ha(s-2147483648):e.objectTable.get(s)??null;if(a)switch(a.kind){case "pen":i.penStyle=a.style,i.penWidth=a.widthX,i.penColor=a.colorRef!==void 0?xt(i,a.colorRef):a.color,Zr(i,"pen",a.colorRef),i.penFlags=a.flags??a.style,i.penUserStyle=a.userStyle,i.penExtended=a.extended===true;break;case "brush":i.brushStyle=a.style,i.brushColor=a.colorRef!==void 0?xt(i,a.colorRef):a.color,Zr(i,"brush",a.colorRef),i.brushPattern=a.pattern??null;break;case "font":i.fontHeight=a.height,i.fontWeight=a.weight,i.fontItalic=a.italic,i.fontUnderline=a.underline,i.fontStrikeOut=a.strikeOut,i.fontFamily=a.family,i.fontEscapementTenthDeg=a.escapementTenthDeg??0,i.fontDetails=a.details;break}}return true}case 40:return r>=12&&e.objectTable.delete(o.getUint32(n,true)),true;default:return false}}function Ic(e){return {...e.dpi?{dpi:{...e.dpi}}:{},mode:e.mode,winOrg:{...e.winOrg},winExt:{...e.winExt},vpOrg:{...e.vpOrg},vpExt:{...e.vpExt}}}var AP={2:254,3:2540,4:100,5:1e3,6:1440};function bo(e){if(e.mode!==7||!e.winExt.cx||!e.winExt.cy)return;let t=Math.abs(e.vpExt.cx/e.winExt.cx)/(e.dpi?.x??96),n=Math.abs(e.vpExt.cy/e.winExt.cy)/(e.dpi?.y??96);if(t>n){let r=e.vpExt.cx>=0?1:-1;e.vpExt.cx=Math.floor(e.vpExt.cx*n/t+.5)||r;}else if(n>t){let r=e.vpExt.cy>=0?1:-1;e.vpExt.cy=Math.floor(e.vpExt.cy*t/n+.5)||r;}}function Da(e,t){if(t<1||t>8)return;let n=AP[t===7?2:t];t===1?(e.winExt={cx:1,cy:1},e.vpExt={cx:1,cy:1}):n!==void 0&&(t!==7||e.mode!==7)&&(e.winExt={cx:n,cy:n},e.vpExt={cx:e.dpi?.x??96,cy:-(e.dpi?.y??96)}),e.mode=t;}function Ar(e){return e.mode===7||e.mode===8}function ep(e,t,n){!Ar(e)||t===0||n===0||(e.winExt={cx:t,cy:n},bo(e));}function tp(e,t,n){!Ar(e)||t===0||n===0||(e.vpExt={cx:t,cy:n},bo(e));}function Ca(e,t,n){let r=Math.imul(e,t);return r===-2147483648&&n===-1?0:Math.trunc(r/n)}function La(e,t,n,r,o){if(!Ar(e)||!n||!o)return;let i=Ca(e.winExt.cx,t,n),s=Ca(e.winExt.cy,r,o);i===0||s===0||(e.winExt={cx:i,cy:s},bo(e));}function Ua(e,t,n,r,o){if(!Ar(e)||!n||!o)return;let i=Ca(e.vpExt.cx,t,n),s=Ca(e.vpExt.cy,r,o);i===0||s===0||(e.vpExt={cx:i,cy:s},bo(e));}function Sc(e,t,n,r,o=0){e.wmfLayoutRtl=o>0,e.useMappingMode=true,e.windowOrg={x:t.winOrg.x,y:t.winOrg.y},e.windowExt={cx:t.winExt.cx||1,cy:t.winExt.cy||1},e.viewportOrg={x:t.vpOrg.x*n,y:t.vpOrg.y*r},e.viewportExt={cx:(t.vpExt.cx||1)*n,cy:(t.vpExt.cy||1)*r},o>0&&(e.viewportOrg.x=o*n-e.viewportOrg.x,e.viewportExt.cx=-e.viewportExt.cx);}function IP(e,t){let n={mode:null,winExt:null,vpExt:null},r=t,o=0;for(;r+6<=e.byteLength&&o++<1e6;){let i=e.getUint32(r,true)*2,s=e.getUint16(r+4,true);if(i<6||r+i>e.byteLength||s===0)break;let a=r+6;s===259&&i>=8&&n.mode===null?n.mode=e.getUint16(a,true):s===524&&i>=10&&!n.winExt?n.winExt={cy:e.getInt16(a,true),cx:e.getInt16(a+2,true)}:s===526&&i>=10&&!n.vpExt&&(n.vpExt={cy:e.getInt16(a,true),cx:e.getInt16(a+2,true)}),r+=i;}return n}function ho(e,t,n){let r=d=>typeof d=="number"&&Number.isFinite(d)&&d>0?d:96,o={x:r(typeof n=="number"?n:n?.x),y:r(typeof n=="number"?n:n?.y)},i=n===void 0?{}:{dpi:o},s=t.boundsRight-t.boundsLeft,a=t.boundsBottom-t.boundsTop;if(t.placeable!==false){let d=t.unitsPerInch>0?t.unitsPerInch:96,p=Math.max(1,Math.round(Math.abs(s)*o.x/d)),x=Math.max(1,Math.round(Math.abs(a)*o.y/d));return {width:p,height:x,mapping:{...i,mode:8,winOrg:{x:t.boundsLeft,y:t.boundsTop},winExt:{cx:s||1,cy:a||1},vpOrg:{x:0,y:0},vpExt:{cx:p,cy:x}}}}let u=IP(e,t.headerSize),c=(u.mode===7||u.mode===8)&&u.vpExt?u.vpExt:u.winExt,f=Math.abs(c?c.cx:s),m=Math.abs(c?c.cy:a),b=Math.max(1,f||1),h=Math.max(1,m||1);return {width:b,height:h,mapping:{...i,mode:8,winOrg:{x:0,y:0},winExt:{cx:b,cy:h},vpOrg:{x:0,y:0},vpExt:{cx:b,cy:h}}}}function BP(e){if(e.byteLength<88||e.getUint32(0,true)!==1)return;let t=e.getInt32(72,true),n=e.getInt32(76,true),r=e.getInt32(80,true),o=e.getInt32(84,true);if(!(t<=0||n<=0||r<=0||o<=0))return {x:t*25.4/r,y:n*25.4/o}}function vc(e){let t=BP(e.view);return {...t?{dpi:t}:{},mode:e.mapMode??1,winOrg:e.windowOrg,winExt:{...e.windowExt},vpOrg:e.viewportOrg,vpExt:{...e.viewportExt}}}function Cc(e,t){e.mapMode=t.mode,e.windowExt=t.winExt,e.viewportExt=t.vpExt;}function rp(e,t,n,r){let o=vc(e);!Ar(o)||n===0||r===0||(t?o.vpExt={cx:n,cy:r}:o.winExt={cx:n,cy:r},bo(o),Cc(e,o),Qr(e));}function GP(e,t,n,r,o,i){let s=vc(e);!Ar(s)||!r||!i||((t?Ua:La)(s,n,r,o,i),!(e.windowExt.cx===s.winExt.cx&&e.windowExt.cy===s.winExt.cy&&e.viewportExt.cx===s.vpExt.cx&&e.viewportExt.cy===s.vpExt.cy)&&(Cc(e,s),Qr(e)));}function OP(e,t,n,r){let{view:o}=e;switch(t){case 9:return r>=16&&rp(e,false,o.getInt32(n,true),o.getInt32(n+4,true)),true;case 10:return r>=16&&(e.windowOrg.x=o.getInt32(n,true),e.windowOrg.y=o.getInt32(n+4,true),Qr(e)),true;case 11:return r>=16&&rp(e,true,o.getInt32(n,true),o.getInt32(n+4,true)),true;case 12:return r>=16&&(e.viewportOrg.x=o.getInt32(n,true),e.viewportOrg.y=o.getInt32(n+4,true),Qr(e)),true;case 17:{if(r>=12){let i=o.getUint32(n,true);if(i>=1&&i<=8){let s=vc(e);Da(s,i),Cc(e,s),Qr(e);}}return true}case 31:case 32:return r>=24&&GP(e,t===31,o.getInt32(n,true),o.getInt32(n+4,true),o.getInt32(n+8,true),o.getInt32(n+12,true)),true;default:return false}}function NP(e,t,n,r){let{view:o,state:i}=e;switch(t){case 35:return r>=32&&(i.worldTransform=[o.getFloat32(n,true),o.getFloat32(n+4,true),o.getFloat32(n+8,true),o.getFloat32(n+12,true),o.getFloat32(n+16,true),o.getFloat32(n+20,true)]),true;case 36:{if(r>=36){let s=o.getUint32(n+24,true);if(s===1)i.worldTransform=[1,0,0,1,0,0];else if(s===2||s===3){let a=[o.getFloat32(n,true),o.getFloat32(n+4,true),o.getFloat32(n+8,true),o.getFloat32(n+12,true),o.getFloat32(n+16,true),o.getFloat32(n+20,true)],[u,l,c,f,m,b]=i.worldTransform;s===2?i.worldTransform=[a[0]*u+a[1]*c,a[0]*l+a[1]*f,a[2]*u+a[3]*c,a[2]*l+a[3]*f,a[4]*u+a[5]*c+m,a[4]*l+a[5]*f+b]:i.worldTransform=[u*a[0]+l*a[2],u*a[1]+l*a[3],c*a[0]+f*a[2],c*a[1]+f*a[3],m*a[0]+b*a[2]+a[4],m*a[1]+b*a[3]+a[5]];}}return true}default:return false}}function ip(e,t,n,r){return OP(e,t,n,r)||NP(e,t,n,r)}function Fa(){return {penColor:"#000000",penWidth:1,penStyle:0,brushColor:"#ffffff",brushStyle:0,brushPattern:null,brushOrgX:0,brushOrgY:0,stretchBltMode:1,textColor:"#000000",bkColor:"#ffffff",bkMode:2,fontHeight:-12,fontWeight:400,fontItalic:false,fontFamily:"sans-serif",fontUnderline:false,fontStrikeOut:false,fontEscapementTenthDeg:0,rop2:13,curX:0,curY:0,polyFillMode:1,textAlign:0,worldTransform:[1,0,0,1,0,0]}}function ka(e){return {...e,worldTransform:[...e.worldTransform]}}function _a(){return {objectTable:new Map,worldTransform:[1,0,0,1,0,0],saveStack:[],saveIdMap:new Map,clipRegion:null,clipSaveDepth:0}}function Ii(e,t,n,r,o){if(ip(e,t,r,o)||Qd(e,t,r,o)||lh(e,t,r,o)||Kd(e,t,r,o))return true;let{ctx:i,view:s,state:a}=e;switch(t){case 33:{for(;e.clipSaveDepth>0;)i.restore(),e.clipSaveDepth--;return e.clipStack??(e.clipStack=[]),e.clipStack.push({region:e.clipRegion??null}),e.mappingStack??(e.mappingStack=[]),e.mappingStack.push({mapMode:e.mapMode,windowOrg:{...e.windowOrg},windowExt:{...e.windowExt},viewportOrg:{...e.viewportOrg},viewportExt:{...e.viewportExt},useMappingMode:e.useMappingMode}),e.stateStack.push(ka(a)),i.save(),e.clipRegion&&Yt(e,e.clipRegion),true}case 34:{if(o>=12){let u=s.getInt32(r,true);if(u<0&&(u=e.stateStack.length+u+1),u<1||u>e.stateStack.length)return true;for(;e.clipSaveDepth>0;)i.restore(),e.clipSaveDepth--;for(;e.stateStack.length>u;)e.stateStack.pop(),e.clipStack?.pop(),e.mappingStack?.pop(),i.restore();let l=e.stateStack.pop();if(l){let c=e.clipStack?.pop(),f=e.mappingStack?.pop();Object.assign(a,l),f&&Object.assign(e,f),i.restore(),e.clipRegion=c?.region??null,e.clipRegion&&Yt(e,e.clipRegion);}}return true}case 24:{if(o>=12){let u=jn(s,r);a.textColor=xt(a,u),Zr(a,"text",u);}return true}case 25:{if(o>=12){let u=jn(s,r);a.bkColor=xt(a,u),Zr(a,"bk",u);}return true}case 18:return o>=12&&(a.bkMode=s.getUint32(r,true)),true;case 19:return o>=12&&(a.polyFillMode=s.getUint32(r,true)),true;case 20:return o>=12&&(a.rop2=s.getUint32(r,true)),true;case 21:return o>=12&&(a.stretchBltMode=s.getUint32(r,true)),true;case 13:return o>=16&&(a.brushOrgX=s.getInt32(r,true),a.brushOrgY=s.getInt32(r+4,true)),true;case 58:{if(o>=12){let u=s.getFloat32(r,true);a.miterLimit=Number.isFinite(u)&&u>=1?u:Math.max(1,s.getUint32(r,true));}return true}case 57:return o>=12&&(a.arcDirection=s.getUint32(r,true)===2?2:1),true;case 22:return o>=12&&(a.textAlign=s.getUint32(r,true)),true;default:return false}}function _c(e,t,n){return n?{x:e.getInt16(t,true),y:e.getInt16(t+2,true),w:e.getInt16(t+4,true),h:e.getInt16(t+6,true)}:{x:e.getFloat32(t,true),y:e.getFloat32(t+4,true),w:e.getFloat32(t+8,true),h:e.getFloat32(t+12,true)}}function Bc(e,t,n){return n?{x:e.getInt16(t,true),y:e.getInt16(t+2,true)}:{x:e.getFloat32(t,true),y:e.getFloat32(t+4,true)}}var YP=16384,Gc=2048;function sp(e,t,n){if(t>=n)return null;let r=e.getUint8(t);if(r&128){let i=r&127;return {value:i&64?i-128:i,size:1}}if(t+2>n)return null;let o=r<<8|e.getUint8(t+1);return {value:o&16384?o-32768:o,size:2}}function Un(e,t,n,r,o){if(!(r>=0)||r>1e6)return null;let i=[];if(o&Gc){let u=t,l=0,c=0;for(let f=0;f<r;f++){let m=sp(e,u,n);if(!m)return null;u+=m.size;let b=sp(e,u,n);if(!b)return null;u+=b.size,l+=m.value,c+=b.value,i.push({x:l,y:c});}return i}let s=(o&YP)!==0,a=s?4:8;if(t+r*a>n)return null;for(let u=0;u<r;u++)i.push(Bc(e,t+u*a,s));return i}var VP=64;function zP(e){return Math.floor(e*16+.5-1e-4)}function ap(e,t,n,r,o){let i;try{i=En(e,t).map(u=>u.pts.map(zP));}catch{return null}let s=ot(i.filter(u=>u.length>=6),n,false,o,r),a=new Uint8Array(r.w*r.h);for(let u=0;u<a.length;u++)a[u]=s[u]?1:0;return a}function Ba(e,t,n,r,o=0){if(o>VP)return null;switch(e.type){case "infinite":return new Uint8Array(n.w*n.h).fill(1);case "empty":return new Uint8Array(n.w*n.h);case "rect":{let{x:i,y:s,width:a,height:u}=e;return ap(l=>l.rect(i,s,a,u),t,false,n,r)}case "path":{let i=e.path;return ap(s=>$r(s,i),t,i.fillRule==="evenodd",n,r)}case "combine":{let i=Ba(e.left,t,n,r,o+1),s=i?Ba(e.right,t,n,r,o+1):null;if(!i||!s)return null;let a=e.combineMode;for(let u=0;u<i.length;u++){let l=i[u],c=s[u];i[u]=a===2?l|c:a===3?l^c:a===4?l&(c^1):a===5?c&(l^1):l&c;}return i}}}function up(e,t){let n=1/0,r=1/0,o=-1,i=-1;for(let s=0;s<t.h;s++)for(let a=0;a<t.w;a++)e[s*t.w+a]&&(n=Math.min(n,a),o=Math.max(o,a),r=Math.min(r,s),i=Math.max(i,s));return o<0?null:{x:t.x+n,y:t.y+r,w:o-n+1,h:i-r+1}}function Ga(e,t,n,r=0,o){let i=e.length;if(i<(n?3:2))return [];let s=(Number.isFinite(t)?t:0)/3,a=m=>{let b,h;return n?(b=e[(m-1+i)%i],h=e[(m+1)%i]):(b=e[Math.max(0,m-1)],h=e[Math.min(i-1,m+1)]),{x:s*(h.x-b.x),y:s*(h.y-b.y)}},u=n?i:i-1,l=n?0:Math.max(0,Math.floor(r)),c=n?u:Math.min(u-l,o===void 0?u:Math.floor(o));if(!(c>0))return [];let f=[{x:e[l].x,y:e[l].y}];for(let m=l;m<l+c;m++){let b=e[m],h=e[(m+1)%i],d=a(m),p=a((m+1)%i);f.push({x:b.x+d.x,y:b.y+d.y},{x:h.x-p.x,y:h.y-p.y},{x:h.x,y:h.y});}return f}function lp(e,t,n,r,o,i=false,s=[]){let a=ot(t,i,false,r,o),u=e.map(c=>{let f=ot(c,false,false,r,o);for(let m=0;m<f.length;m++)a[m]===0&&(f[m]=0);return f}),l=r?s.map(c=>c.map(f=>f-8)):s;return ot([...u.flatMap(c=>qP(c,o.w,o.h,o.x,o.y)),...l],false,n,false,o)}function qP(e,t,n,r,o){return QP(e,t,n).filter(i=>i.length>=3).map(i=>{let s=[];for(let a of i)s.push((a.x+r)*16,(a.y+o)*16);return s})}function JP(e,t,n){let r=[],o=[],i=null;for(let s=0;s<n;s++){let a=[],u=false;for(let c=0;c<t;c++){let f=e[s*t+c]!==0;f!==u&&(a.push(c),u=f);}u&&a.push(t);let l=r[r.length-1];if(a.length===0){i=null;continue}i&&l&&l.y1===s&&i.length===a.length&&i.every((c,f)=>c===a[f])?l.y1=s+1:(r.push({y0:s,y1:s+1,s:o.length,n:a.length}),o.push(...a)),i=a;}return {bands:r,X:o}}function KP(e,t){let n=e.length,r=new Uint8Array(t.length+2),o=[];for(let i=0;i<n;i++){let s=e[i];for(let a=0;a<s.n;a++){if(r[s.s+a])continue;let u=[{x:t[s.s+a],y:s.y0}];r[s.s+a]=1;let l=a&1,c=1,f=i,m=a,b=false;for(let h=0;h<16*(t.length+8)&&!b;h++){for(;;){let p=e[f],x=f+1<n?e[f+1]:null;if(!x||x.y0!==p.y1)break;let y=p.s+m,g=t[y],M=x.s,E=x.n-l-1,P,R=false;if(t[M+l]>g)P=l;else {if(t[M+E]<=g)break;{let w=l,A=E,I=A+w>>1;for(;I!==w;)t[M+I]<=g?w=I:A=I,I=w+A>>1;P=A;}}if((P&1)===l?t[M+P]>=t[y+1]&&(R=true):m<=0?P-=1:t[M+P-1]<t[y-1]?(c=-1,R=true):P-=1,R)break;let T=t[M+P];g!==T&&u.push({x:g,y:p.y1},{x:T,y:p.y1}),r[M+P]=1,f+=1,m=P;}{let p=e[f];u.push({x:t[p.s+m],y:p.y1},{x:t[p.s+m+c],y:p.y1}),m+=c,r[p.s+m]=1,c=-1;}for(;;){let p=e[f],x=f-1;if(x<i)break;let y=e[x];if(y.y1!==p.y0)break;let g=p.s+m,M=t[g],E=y.s,P=y.n-l-1,R;if(t[E+P]<M)R=P;else {if(t[E+l]>=M)break;{let w=l,A=P,I=A+w>>1;for(;I!==w;)t[E+I]<M?w=I:A=I,I=w+A>>1;R=w;}}if((R&1)===l){if(m<p.n-1&&t[E+R+1]>t[g+1]){c=1;break}R+=1;}else if(t[E+R]<=t[g-1])break;let T=t[E+R];M!==T&&u.push({x:M,y:p.y0},{x:T,y:p.y0}),r[E+R]=1,f=x,m=R;}let d=e[f];f===i&&a===m-1?(u.push({x:t[d.s+m],y:d.y0}),b=true):(u.push({x:t[d.s+m],y:d.y0},{x:t[d.s+m+c],y:d.y0}),m+=c,r[d.s+m]=1,c=1);}b&&o.push(u);}}return o}function ZP(e){let t=e.map(o=>{let i=1/0,s=1/0,a=-1/0,u=-1/0;for(let l of o)i=Math.min(i,l.x),s=Math.min(s,l.y),a=Math.max(a,l.x),u=Math.max(u,l.y);return {x0:i,y0:s,x1:a,y1:u}}),n=(o,i)=>i.x0>=o.x0&&i.y0>=o.y0&&o.x1>=i.x1&&o.y1>=i.y1,r=e.map(()=>false);for(let o=1;o<e.length;o++)for(let i=o-1;i>=0;i--)n(t[o],t[i])?r[i]=!r[i]:n(t[i],t[o])&&(r[o]=!r[o]);return e.map((o,i)=>{let s=0;for(let a=0;a<e.length;a++)a!==i&&!r[a]&&n(t[a],t[i])&&s++;return s%2===1})}function QP(e,t,n){let{bands:r,X:o}=JP(e,t,n);if(r.length===0)return [];if(r.length===1&&r[0].n===2){let a=r[0];return [[{x:o[a.s],y:a.y0},{x:o[a.s+1],y:a.y0},{x:o[a.s+1],y:a.y1},{x:o[a.s],y:a.y1}]]}let i=KP(r,o).map(eR),s=ZP(i);return i.map((a,u)=>s[u]?a.slice().reverse():a)}function eR(e){let t=e.length,n=[e[0],e[0],e[0]],r=[false,false,false],o=0,i=0,s=()=>{let M=o;o=(o+1)%3,i<t?(n[M]=e[i],r[M]=i===t-1,i++):(n[M]=e[0],r[M]=false);},a=[e[0]],u=0,l=e[0],c=e[0],f=0,m=0,b=M=>{if(u===0)l=M,u=1;else if(u===1)c=M,f=M.x-l.x,m=M.y-l.y,u=2;else {let E=M.x-c.x,P=M.y-c.y;E===f&&P===m||(a.push(l),l=c,f=E,m=P),c=M;}},h=()=>(a.push(l,c),a);s(),s(),s();let d=0,p=1,x=2,y,g;n[x].y===n[p].y?(y=n[p].y-n[d].y,g=1):(y=n[p].x-n[d].x,g=0);for(let M=0;M<8*t+16;M++){if(r[d])return h();let E,P;if(g===0?(P=n[x].y-n[p].y,E=P<0&&(y===1||P===-1)):(P=n[x].x-n[p].x,E=y>0&&(y===1||P===-1)),!E){s(),g^=1,y=P;let A=d;d=p,p=x,x=A,b(n[d]);continue}if(r[p])return h();s(),s();let R=d,T=x,w=p;d=T,p=R,x=w,y=g===0?n[p].x-n[d].x:n[p].y-n[d].y,b(n[d]);}return h()}var tR=1.5,mp={1:[3,1],2:[1,1],3:[3,1,1,1],4:[3,1,1,1,1,1]};function nR(e){switch(e){case 1:case 17:return "square";case 2:case 18:case 3:case 19:return "round";default:return "butt"}}function rR(e){return e===1?"bevel":e===2?"round":"miter"}function Oc(e){let t=e.width||1,n=e.dashStyle===5?e.dashPattern:mp[e.dashStyle];return !n||n.length===0||n.some(r=>!(r>=0))?[]:n.map(r=>r*t)}function cp(e,t,n=1){e.lineWidth=(t.width||1)*n;let r=Oc(t);e.lineCap=nR(r.length>0?t.dashCap??0:t.startCap??t.endCap),e.lineJoin=rR(t.lineJoin),e.miterLimit=t.miterLimit&&t.miterLimit>=1?t.miterLimit:10,typeof e.setLineDash=="function"&&e.setLineDash(r),e.lineDashOffset=r.length>0?(t.dashOffset??0)*(t.width||1):0;}function an(e,t,n,r,o=false,i=false){if(t){let m=iR(e,t);if(!m)return;t=m;}let{ctx:s}=e,a=sR(t);t=a.pen;let u=a.nib,l=!!t&&t.alignment===1&&o,c=l?2:1,f=m=>{(l||u)&&m.save(),l&&(m.beginPath(),n(m),m.clip()),m.beginPath(),n(m),u&&m.transform(u[0],u[1],u[2],u[3],0,0),m.stroke(),(l||u)&&m.restore();};if(t){let m=!!u&&Oc(t).length>0,b=[t.startCap,t.endCap].some(x=>x!==void 0&&x>=17&&x<=20);cp(s,t,c);let h=fi(e),d=t.brush&&!chunkI7XOR2GO_js.qa(s)?Ol(e,t.brush):null;if(!d&&h!=="canvas"){let x=io(t.color);d=x===null?null:ro(x);}if(d){let x=bR(s),y=_e(e),g=fp(u?je(y,u):y);if(h!=="canvas"&&x&&aR(e,t,u,d,n,y,x,h,o,i))return;let M=Oa(t)||b||m?pp(e,t,u,n,o):null,E=null;if(x&&M)E=Er(M.flat(),y,x,2);else if(x){let T=Math.max(1,s.miterLimit||10),w=t.width*g*T/2+2;E=Er(r,y,x,w);}if(x&&!E||E&&mi(e,d,E,M?T=>{xp(T,M),T.fill("nonzero");}:T=>{cp(T,t,c),f(T),T.beginPath(),n(T),u&&T.transform(u[0],u[1],u[2],u[3],0,0);},h,M?(T,w,A)=>T.isPointInPath(w,A,"nonzero"):(T,w,A)=>T.isPointInStroke(w,A)&&(!l||T.isPointInPath(w,A))))return}let p=t.brush?cl(e,t.brush):t.color;if((Oa(t)||b||m||u&&typeof p!="string")&&cR(e,t,u,p,n,o))return;s.strokeStyle=p;}pt(e),f(s);}var oR=2;function iR(e,t){let n=t.unit??0;if(n>=3&&n<=6)return null;if(n!==oR)return t;let r=js(e),o=sn([r[0],r[1],r[2],r[3],0,0]);return o?{...t,transform:je(o,t.transform??[1,0,0,1,0,0])}:t}function sR(e){if(!e?.transform)return {pen:e,nib:null};let[t,n,r,o]=e.transform,i=Math.hypot(t,n),s=Math.hypot(r,o),a=t*r+n*o,u=t*o-n*r,l={...e,transform:null};if(e.width===0||fR(e.transform)||!Number.isFinite(i+s+a+u)||Math.abs(u)<1e-12)return {pen:{...l,width:e.width===0?1:e.width},nib:null};if(Math.abs(i-s)<=1e-6*i&&Math.abs(a)<=1e-6*i*s){let c=e.dashStyle===5?e.dashPattern:mp[e.dashStyle],f=c&&c.length>0?{dashStyle:5,dashPattern:c.map(m=>m/i),dashOffset:(e.dashOffset??0)/i}:{};return {pen:{...l,...f,width:e.width*i},nib:null}}return {pen:l,nib:[t,n,r,o,0,0]}}function fp(e){let t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3],n=e[0]*e[3]-e[1]*e[2];return Math.sqrt((t+Math.sqrt(Math.max(0,t*t-4*n*n)))/2)}function bp(e,t){if(!t)return {record:e,unit:Math.hypot(e[0],e[1]),toDevice:mR};let n=je(e,t),r=fp(n),o=sn(t);return !o||!(r>0)||!Number.isFinite(r)?null:{record:[o[0]*r,o[1]*r,o[2]*r,o[3]*r,0,0],unit:r,toDevice:je(n,[1/r,0,0,1/r,0,0])}}function hp(e,t,n=null){let r=Oc(e).map(o=>o*t);return {half:(e.width||1)*t/2,join:e.lineJoin??0,miterLimit:e.miterLimit&&e.miterLimit>=1?e.miterLimit:10,startCap:e.startCap??0,endCap:e.endCap??0,dashCap:e.dashCap??0,dash:r.length>0?r:null,dashOffset:(e.dashOffset??0)*(e.width||1)*t,dashMetric:n?[n[0],n[1],n[2],n[3]]:void 0,compound:e.compound??null,inset:e.alignment===1}}function aR(e,t,n,r,o,i,s,a,u,l=false){if(!n){let R=Math.hypot(i[0],i[1]),T=Math.hypot(i[2],i[3]),w=i[0]*i[2]+i[1]*i[3];if(!(R>0)||Math.abs(R-T)>1e-6*R||Math.abs(w)>1e-6*R*T)return false}let c=bp(i,n);if(!c)return false;let f;try{f=En(o,c.record);}catch{return false}u&&(f=f.map(R=>({...R,closed:true})));let m=(t.width||1)*c.unit,b=hp(t,c.unit,n),h=a==="gdiplus-aa",d=R=>{let T=c.toDevice;return R.flatMap(w=>[Ge(T[0]*w.x+T[2]*w.y+T[4]),Ge(T[1]*w.x+T[3]*w.y+T[5])])},p,x=[],y=null,g=[];if(Oa(t))p=dp(f,m,b,t).map(d);else {if(m<=tR&&!b.dash&&!(((t.startCap??0)|(t.endCap??0)|(t.dashCap??0))&240))return lR(e,t,r,o,i,s,h,u);({fix:p,groups:x,insetFigures:y,open:g}=uR(f,b,d));}let M=Bo(p,s);if(!M)return true;if(M.w*M.h>16e6)return false;let E=Rt(e.pixelOffsetMode??0),P=y?lp(x,y,h,E,M,l,g):ot(p,false,h,E,M);return zn(e,r,M,P,1,true)}function uR(e,t,n){let r=e.filter(u=>u.closed);if(!t.inset||t.compound||r.length===0){let u=Xn(e,t).map(n);return {fix:u,groups:[u],insetFigures:null,open:[]}}let o={...t,inset:false,half:t.half*2,dashOffset:t.dashOffset*2,dashCapWidth:t.half*2,doubleRoundCap:true},i=r.map(u=>Xn([u],o).map(n)),s=Xn(e.filter(u=>!u.closed),{...t,inset:false}).map(n).map(u=>{let l=[];for(let c=u.length/2-1;c>=0;c--)l.push(u[2*c],u[2*c+1]);return l}),a=e.map(u=>n(Array.from({length:u.pts.length>>1},(l,c)=>({x:u.pts[2*c],y:u.pts[2*c+1]}))));return {fix:[...i.flat(),...s],groups:i,insetFigures:a,open:s}}function lR(e,t,n,r,o,i,s,a){let u;try{u=y0(r,o);}catch{return false}a&&(u=u.map(h=>({...h,closed:true})));let l=Bo(u.map(h=>h.pts),i);if(!l)return true;if(l.w*l.h>16e6)return false;let c=io(t.color),m=(!t.brush||!t.brush.gradient&&!t.brush.texture&&!t.brush.hatch)&&c!==null&&c>>>24===255&&e.ext?.compositingMode!==1,b=Ts(u,{antialias:s,half:Rt(e.pixelOffsetMode??0),opaqueSolid:m,clip:{x:0,y:0,w:i.w,h:i.h}},l);return zn(e,n,l,b,1,true)}function Oa(e){return !!(e.customStartCap||e.customEndCap)}function dp(e,t,n,r){let o=k0(e,t,r.customStartCap??null,r.customEndCap??null),i=[];return o.figures.forEach((s,a)=>{let u=o.capped[a],l={...n,half:Math.max(t,1)/2,join:n.join===0?3:n.join,startCap:u.start?0:n.startCap,endCap:u.end?0:n.endCap};for(let c of Xn([s],l))i.push(c.slice().reverse());}),i.push(...o.polygons),i}function pp(e,t,n,r,o){let i=_e(e),s=bp(i,n),a=sn(i);if(!s||!a||!(s.unit>0))return null;let u;try{u=En(r,s.record);}catch{return null}o&&(u=u.map(b=>({...b,closed:true})));let l=(t.width||1)*s.unit,c=hp(t,s.unit,n),f=Oa(t)?dp(u,l,c,t):Xn(u,c),m=je(a,s.toDevice);return f.map(b=>b.map(h=>({x:m[0]*h.x+m[2]*h.y+m[4],y:m[1]*h.x+m[3]*h.y+m[5]})))}function xp(e,t){e.beginPath();for(let n of t)n.forEach((r,o)=>{o===0?e.moveTo(r.x,r.y):e.lineTo(r.x,r.y);}),e.closePath();}function cR(e,t,n,r,o,i){let s=pp(e,t,n,o,i);if(!s)return false;let{ctx:a}=e;a.save();try{a.fillStyle=r,pt(e),xp(a,s),a.fill("nonzero");}finally{a.restore();}return true}var mR=[1,0,0,1,0,0];function fR(e){return e[0]===1&&e[1]===0&&e[2]===0&&e[3]===1&&e[4]===0&&e[5]===0}function bR(e){let t=e.canvas,n=t?.width,r=t?.height;return typeof n=="number"&&typeof r=="number"&&n>0&&r>0?{w:n,h:r}:null}var hR=/^(?:\p{Script=Latin}|\p{Script=Common}|\p{Co})$/u,dR=/[\p{M}\p{Cf}\p{Emoji_Presentation}]/u;function yp(e,t,n,r,o,i,s){let a=n.alignment,u=n.lineAlignment;if(!a&&!u||a<0||a>2||u<0||u>2||e.gridFit||e.mode!=="gray"||!e.designAdvance||e.ttf.winDescent===void 0||e.syntheticBold||e.syntheticItalic||n.flags&3||![r,o,i,s].every(Number.isFinite)||i<=0||s<=0||t.some(x=>!Number.isInteger(x)||x<32||x>1114111||x>=127&&x<=159||x===8232||x===8233)||t.some(x=>{let y=String.fromCodePoint(x);return !hR.test(y)||dR.test(y)||e.glyphIndex(x)===0}))return null;let l=e.ppem,c=n.tracking??1.03,f=l*(n.leadingMargin??1/6),m=l*(n.trailingMargin??1/6);if(![c,f,m].every(x=>Number.isFinite(x)&&x>=0)||!(n.flags&4)&&(e.ttf.fsSelection&1||e.ttf.macStyle&2)&&a!==0)return null;let b=t.map(x=>e.designAdvance(e.glyphIndex(x),c)),h=t.length;if(!(n.flags&2048))for(;h>0&&t[h-1]===32;)h--;let d=b.slice(0,h).reduce((x,y)=>x+y,0)+f+m,p=l*(e.ttf.winAscent+e.ttf.winDescent)/e.ttf.unitsPerEm+(n.flags&4?0:l/8);return d>i||p>s?null:{x:Math.fround(r+a/2*(i-d)+f),y:Math.fround(o+u/2*(s-p))+Math.round(l*e.ttf.winAscent/e.ttf.unitsPerEm),dx:b}}function MR(e,t){let n=t<=255?e.objectTable.get(t):void 0;return !n||n.kind!=="plus-imageattributes"||!n.wrapMode?{}:{wrap:n.wrapMode,clampArgb:n.clampArgb}}var ER=2;function PR(e,t,n){let r=[];for(let o=0;o<n.length;o+=2){let i=n[o],s=n[o+1];r.push((e[0]*i+e[2]*s+e[4])*t,(e[1]*i+e[3]*s+e[5])*t);}return r}function RR(e,t,n,r,o,i,s,a){let{view:u}=e,l=Lb(e.interpolationMode??0);if(n||u.getUint32(t+4,true)!==ER)return;let c=u.getFloat32(t+8,true),f=u.getFloat32(t+12,true),m=u.getFloat32(t+16,true),b=u.getFloat32(t+20,true);if(!(!(m>0&&b>0)||!Number.isFinite(c+f+m+b)))return {srcX:c,srcY:f,srcW:m,srcH:b,toDevice:je(_e(e),r(c,f,m,b)),kernel:l,halfPixelOffset:Rt(e.pixelOffsetMode??0),...o?{pointsForm:true}:{},...o&&s?{worldPoints:s,worldMatrix:_e(e)}:{},...!o&&a?{worldRect:a,worldMatrix:_e(e)}:{},...i?{nominalScale:i(m,b)}:{},...MR(e,u.getUint32(t,true))}}function gp(e,t,n,r,o,i,s,a,u=null,l=false,c,f,m){if(!t.data)return;let b=t.type===2,h={imageData:t.data,dx:r,dy:o,dw:i,dh:s,transform:_e(e),isMetafile:b,resample:RR(e,n,b,a,l,c,f,m)},{view:d}=e,p={unit:d.getUint32(n+4,true),srcX:d.getFloat32(n+8,true),srcY:d.getFloat32(n+12,true),srcW:d.getFloat32(n+16,true),srcH:d.getFloat32(n+20,true),toWorld:a};if(oh(e,t,h,p,u)){chunkI7XOR2GO_js.q("DrawImage: painted in record order");return}if(h.effect=u,h.effectSource=p,chunkI7XOR2GO_js.qa(e.ctx)){let x=a(p.srcX,p.srcY,p.srcW,p.srcH),y=[p.srcX,p.srcY,p.srcX+p.srcW,p.srcY,p.srcX+p.srcW,p.srcY+p.srcH,p.srcX,p.srcY+p.srcH],g=[];for(let M=0;M<y.length;M+=2)g.push(x[0]*y[M]+x[2]*y[M+1]+x[4],x[1]*y[M]+x[3]*y[M+1]+x[5]);h.svgSlot=e.ctx.reserveSlot(PR(_e(e),1,g));}e.deferredImages.push(h),chunkI7XOR2GO_js.q(`DrawImage: queued deferred image (total=${e.deferredImages.length})`);}function Xc(e,t,n,r){let{ctx:o}=e,i=r.fillRule??"nonzero";Cn(e,t,n,a=>$r(a,r),r.points,i)||(o.fillStyle=Nt(e,t,n),pt(e),$r(o,r),o.fill(i));}function jc(e,t,n){an(e,t,r=>$r(r,n),n.points,AR(n.types),n.fillRule==="evenodd");}function TR(e){return 1+(e===void 0||!Number.isFinite(e)?4:Math.min(12,Math.max(0,e)))/10}function wR(e,t){if(t===1)return;let n=1/t;for(let r=0;r<e.length;r++){let o=e[r]/255;e[r]=Math.round((1-Math.pow(1-o,n))*255);}}function AR(e){if(e.length===0)return false;for(let t=1;t<=e.length;t++)if((t===e.length||(e[t]&15)===0)&&!(e[t-1]&128))return false;return true}function Wc(e,t,n,r,o,i,s){let{ctx:a}=e,u=chunkI7XOR2GO_js.qa(a)?null:oo(e,t,n),l=a.canvas;if(u&&l&&typeof l.width=="number"&&typeof l.height=="number"){let c=typeof a.measureText=="function"?a.measureText(r).width:r.length*s,f=Math.abs(s)||1,m=[{x:o-c-f,y:i-2*f},{x:o+c+f,y:i-2*f},{x:o-c-f,y:i+2*f},{x:o+c+f,y:i+2*f}],b=Er(m,_e(e),{w:l.width,h:l.height});if(!b)return;let{font:h,textAlign:d,textBaseline:p}=a;if(mi(e,u,b,x=>{x.font=h,x.textAlign=d,x.textBaseline=p,x.fillText(r,o,i);},"canvas",void 0,false))return}a.fillStyle=Nt(e,t,n),pt(e,false),a.fillText(r,o,i);}var IR=[3,3,3,4,4,6],Jn=1/6,Nc=1.03;function SR(e){let t=/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)$/.exec(e.trim());return t?t[4]!==void 0&&Number(t[4])<1?null:"#"+[t[1],t[2],t[3]].map(n=>Number(n).toString(16).padStart(2,"0")).join(""):/^#[0-9a-f]{6}$/i.test(e)?e:null}function Mp(e,t){if(!t||t.kind!=="plus-font")return t;let n=t.unit??0;if(n<3||n>6)return n===0?t:{...t,unit:0};let r=e.dpiY??br,o=hr(e.pageUnit,e.pageScale,r,e.videoDisplay??true),i=t.emSize*hr(n,1,r)/(o||1);return Number.isFinite(i)&&i>0?{...t,emSize:i,unit:0}:t}function vR(e,t){return e!==0?e:t==="mono"?1:t==="gray"?3:5}function Pp(e,t,n,r,o=false){let i=e.fonts,s=typeof n=="string"?SR(n):null,a=vR(e.textRenderingHint??0,i?.defaultSmoothing),l=!!s&&(a===3||a===4||a===5)&&!chunkI7XOR2GO_js.qa(e.ctx),c=chunkI7XOR2GO_js.qa(e.ctx)?null:l?ro(io(n)??4278190080):s?null:r,f=t.unit??0;if(!i||!s&&!c||f!==0&&f!==2)return null;let m=_e(e);if(m[1]!==0||m[2]!==0||m[0]<=0||m[3]<=0)return null;let b=t.emSize*m[3],h={face:t.family,height:-Math.round(b),width:0,weight:t.flags&1?700:400,italic:(t.flags&2)!==0,charSet:1,pitchAndFamily:0,quality:IR[a]??3,unhinted:a===2||a===4,ignoreGasp:a===4,gdiPlus:true,...a===1&&o?{defaultDrawStringFormat:true}:{},unscaledText:m[0]===1&&m[3]===1},d=i.realize(h,e.fontFamilyMap);return d?{realized:d,emPx:b,m,unhinted:h.unhinted===true,color:s,sampler:c,solidViaCoverage:l,underline:(t.flags&4)!==0,strikeOut:(t.flags&8)!==0,plusBars:a===4?"fractional":"snapped"}:null}function Na(e,t,n,r){let o={...n,textAlign:24,bkColor:"#ffffff",bkMode:1,options:r?fo:0,rect:r??null,matrix:null};if((!t.color||t.solidViaCoverage)&&t.sampler){let i=gd(t.realized,{...o,underline:t.underline,strikeOut:t.strikeOut,plusBars:t.plusBars},{decorations:true,grayLevels:15});if(!i)return true;if(r)for(let a=0;a<i.height;a++){let u=i.y+a;for(let l=0;l<i.width;l++){let c=i.x+l;if(c<r.left||c>=r.right||u<r.top||u>=r.bottom){let f=a*i.width+l;i.data.fill(0,f*i.channels,(f+1)*i.channels),i.bars&&(i.bars[f]=0);}}}let s=TR(e.ext?.textContrast);if(i.channels===1&&wR(i.data,s),i.bars){let a=i.width*i.height;for(let u=0;u<a;u++){let l=i.bars[u];if(l!==0)for(let c=0;c<i.channels;c++){let f=i.data[u*i.channels+c];i.data[u*i.channels+c]=255-Math.round((255-f)*(255-l)/255);}}}return zn(e,t.sampler,{x:i.x,y:i.y,w:i.width,h:i.height},i.data,i.channels,false,i.channels===3?s:1)}return fc(e.ctx,t.realized,{...o,textColor:t.color,underline:t.underline,strikeOut:t.strikeOut,plusBars:t.plusBars},e.fontFamilyMap),true}function CR(e,t,n,r,o,i,s,a,u,l,c=null){let f=!l||l.flags===0&&l.alignment===0&&l.lineAlignment===0&&(l.trimming??1)===1&&Math.fround(l.leadingMargin??Jn)===Math.fround(Jn)&&Math.fround(l.trailingMargin??Jn)===Math.fround(Jn)&&Math.fround(l.tracking??Nc)===Math.fround(Nc),m=Pp(e,t,a,c,f);if(!m)return false;let{realized:b,emPx:h,m:d,unhinted:p}=m,x=Array.from(n,B=>B.codePointAt(0));if(l&&(u!==0||l.lineAlignment!==0)&&p&&d[0]===d[3]&&Math.fround(h)===b.ppem){let B=yp(b,x,l,d[0]*r+d[4],d[3]*o+d[5],d[0]*i,d[3]*s);if(B)return Na(e,m,{codes:x,glyphIndices:false,...B,dy:null})}let y=b.ttf,g=h*y.winAscent/y.unitsPerEm,M=!b.syntheticBold&&!b.syntheticItalic&&h===b.ppem&&d[0]===1&&d[3]===1&&Number.isInteger(o+d[5])&&(l?.lineAlignment??0)===0,E=l?.flags??0;if(u!==0&&(u!==1&&u!==2||E!==0||b.mode!=="mono"||!b.gridFit||!M||!b.designAdvance||x.some(B=>B!==10&&B!==13&&(B<32||B>126))))return false;let P=p?Math.round(g):M?Math.max(Math.round(g),b.ascent):Math.ceil(g),R=h*(l?.leadingMargin??Jn),T=h*(l?.trailingMargin??Jn),w=d[0]*r+d[4]+R;p||(w=Math.round(w));let A=d[3]*o+d[5]+P,I=l?.tracking??Nc,S=!p&&b.mode==="cleartype"&&!!b.ctGridAdvance&&!b.syntheticItalic&&I>1,v=!!b.designAdvance&&d[0]===1&&d[3]===1,C=B=>{let O=b.glyphIndex(B);return p?v?b.designAdvance(O,I):b.advance(O)*I:S?b.ctGridAdvance(O):b.advance(O)},U=p||S?x.map(C):null,L=d[0]*r+d[4],k=d[3]*o+d[5],F=d[0]*i,_=d[3]*s,H=F>0&&_>0&&!(E&UR)?{left:Math.round(L),top:Math.round(k),right:Math.round(L+F),bottom:Math.round(k+_)}:void 0,G,W=F>0&&!(E&DR)?F-h*((l?.leadingMargin??Jn)+(l?.trailingMargin??Jn)):1/0,N=x.map(B=>b.designAdvance?.(b.glyphIndex(B),I)??C(B)),Z=N.map((B,O)=>O+1<x.length&&y.kerning?B+y.kerning(b.glyphIndex(x[O]),b.glyphIndex(x[O+1]))*h/y.unitsPerEm:B),J=FR(x,Z,W),K,ie=J.length>1;if(u!==0&&(!ie||!H))return false;ie&&(G=H);let ce=y.winDescent??0,$=y.hheaAscender!==void 0&&y.hheaDescender!==void 0?y.hheaAscender-y.hheaDescender+(y.hheaLineGap??0):y.winAscent+ce,X=$*h/y.unitsPerEm;if(H){let B=E&LR?Math.floor((_-(y.winAscent+ce)*h/y.unitsPerEm)/X)+1:Math.floor(_/X-.25)+1;if(J.length>B){if(u!==0)return false;G=H;let O=J.slice(0,Math.max(0,B));if(O.length>0&&(l?.trimming??1)===1){let j=O[O.length-1],q=j.start;for(;q<x.length&&x[q]!==10&&x[q]!==13;){let se=0;for(let de=j.start;de<=q;de++)se+=Z[de];if(se>W&&q>j.start)break;q++;}for(;q>j.start&&x[q-1]===32;)q--;let ae={start:j.start,end:q};q>j.end&&(K=ae),O[O.length-1]=ae;}J=O;}}if(J.length===0)return true;if(!ie)return Na(e,m,{codes:x.slice(0,J[0].end===Ep(x)?x.length:J[0].end),glyphIndices:false,x:w,y:A,dx:U?U.slice(0,J[0].end===Ep(x)?x.length:J[0].end):null,dy:null},G);for(let[B,O]of J.entries()){let j=k+(y.winAscent+B*$)*h/y.unitsPerEm,q=x.slice(O.start,O.end);if(q.length===0)continue;let ae=me=>{let ee=me+1<O.end&&y.kerning?y.kerning(b.glyphIndex(x[me]),b.glyphIndex(x[me+1]))*h/y.unitsPerEm:0;return p?ee:Math.round(ee)},se=Array.from({length:O.end-O.start},(me,ee)=>C(x[O.start+ee])+ae(O.start+ee));if(O===K&&!p&&b.mode==="mono"){let me=L+R,ee=w;for(let le=O.start;le<O.end;le++){let xe=le-O.start;if(me+=Z[le],ee+=se[xe],x[le]===32&&x[le-1]!==32&&x[le+1]!==32){let Je=Math.round(me);se[xe]+=Je-ee,ee=Je;}}}let de=w;if(u!==0){let me=se.length===1?N[O.start]:se.reduce((Je,At)=>Je+At,0),ee=Math.fround(me+Math.fround(R+T)),le=Math.fround(u/2*Math.fround(F-ee)),xe=Math.fround(Math.fround(L+le)+R);de=Math.ceil(xe-.5);}Na(e,m,{codes:q,glyphIndices:false,x:de,y:p?k+Math.round(g)+B*X:Math.round(j),dx:se.some((me,ee)=>me!==C(x[O.start+ee]))||U?se:null,dy:null},G);}return true}function Ep(e){let t=e.length;for(;t>0&&e[t-1]===32;)t--;return t}var DR=4096,LR=8192,UR=16384;function FR(e,t,n){let r=[],o=(a,u)=>{for(;u>a&&e[u-1]===32;)u--;return u},i=(a,u)=>{let l=0;for(let c=a;c<u;c++)l+=t[c];return l},s=0;for(;s<=e.length;){let a=s;for(;a<e.length&&e[a]!==10&&e[a]!==13;)a++;let u=s;do{let l=o(u,a);if(Number.isFinite(n)&&i(u,l)>n){let c=-1;for(let f=u+1;f<a;f++)e[f-1]===32&&e[f]!==32&&i(u,o(u,f))<=n&&(c=f);if(c>u)l=c;else for(l=u+1;l<a&&e[l]!==32&&i(u,l+1)<=n;)l++;}for(r.push({start:u,end:o(u,l)}),u=l;u<a&&e[u]===32&&u>s;)u++;}while(u<a);s=a+(e[a]===13&&e[a+1]===10?2:1);}return r}var kR=1,_R=2,BR=4;function GR(e,t,n,r,o,i,s){let a=(s&kR)!==0,u=(s&BR)!==0;if(!(s&_R)){let b=Nt(e,t,n),h=Pp(e,r,b,e.fonts?oo(e,t,n):null);if(h){let{m:d}=h,p=i.map(y=>({x:d[0]*y.x+d[4],y:d[3]*y.y+d[5]})),x=y=>p.map((g,M)=>M+1<p.length?p[M+1][y]-g[y]:0);Na(e,h,{codes:o,glyphIndices:!a,x:p[0].x,y:p[0].y,dx:u?null:x("x"),dy:u?null:x("y")});return}}if(!a){chunkI7XOR2GO_js.r("DrawDriverString: glyph indices need the GDI font engine (no fonts supplied); skipped");return}let{ctx:l}=e,c=r.flags&1?"bold ":"",f=r.flags&2?"italic ":"",m=chunkI7XOR2GO_js.ca(r.family,e.fontFamilyMap);if(l.font=`${f}${c}${r.emSize}px ${m}`,l.textBaseline="alphabetic",l.textAlign="left",u){Wc(e,t,n,String.fromCharCode(...o),i[0].x,i[0].y,r.emSize);return}for(let b=0;b<o.length;b++)Wc(e,t,n,String.fromCharCode(o[b]),i[b].x,i[b].y,r.emSize);}function Rp(e,t,n,r,o){let{ctx:i,view:s,objectTable:a}=e;switch(t){case 16404:{if(o>=4){let u=a.get(n&255);u&&u.kind==="plus-path"&&Xc(e,n,s.getUint32(r,true),u);}return true}case 16405:{if(o>=4){let u=a.get(n&255),l=a.get(s.getUint32(r,true)&255);u&&u.kind==="plus-path"&&jc(e,l&&l.kind==="plus-pen"?l:null,u);}return true}case 16412:{if(o>=28){let u=s.getUint32(r,true),l=s.getUint32(r+4,true),c=s.getUint32(r+8,true),f=s.getFloat32(r+12,true),m=s.getFloat32(r+16,true),b=s.getFloat32(r+20,true),h=s.getFloat32(r+24,true),d=n&255,p=Mp(e,a.get(d));if(c>0&&r+28+c*2<=r+o){let x=chunkI7XOR2GO_js.ga(s,r+28,c);if(x.length>0&&p&&p.kind==="plus-font"){let y=a.get(l),g=Nt(e,n,u),M=y&&y.kind==="plus-stringformat"?y.alignment:0,E=y&&y.kind==="plus-stringformat"?y:void 0;if(CR(e,p,x,f,m,b,h,g,M,E,e.fonts?oo(e,n,u):null))return true;let P=p.flags&1?"bold ":"",R=p.flags&2?"italic ":"",T=chunkI7XOR2GO_js.ca(p.family,e.fontFamilyMap);if(i.font=`${R}${P}${p.emSize}px ${T}`,i.textBaseline="top",y&&y.kind==="plus-stringformat")switch(y.alignment){case 1:i.textAlign="center";break;case 2:i.textAlign="right";break;default:i.textAlign="left";}else i.textAlign="left";Wc(e,n,u,x,f,m,p.emSize);}}}return true}case 16438:{if(o>=16){let u=s.getUint32(r,true),l=s.getUint32(r+4,true),c=s.getUint32(r+8,true)!==0,f=s.getUint32(r+12,true),m=Mp(e,a.get(n&255)),b=r+16,h=b+f*2,d=h+f*8;if(f>0&&f<1e5&&d+(c?24:0)<=r+o&&m&&m.kind==="plus-font"){let p=[],x=[];for(let g=0;g<f;g++)p.push(s.getUint16(b+g*2,true)),x.push({x:s.getFloat32(h+g*8,true),y:s.getFloat32(h+g*8+4,true)});let y=e.worldTransform;if(c){let g=[0,4,8,12,16,20].map(M=>s.getFloat32(d+M,true));g.every(Number.isFinite)&&(e.worldTransform=je(y,g));}try{GR(e,n,u,m,p,x,l);}finally{e.worldTransform=y;}}}return true}case 16410:{if(o>=24){let u=n&255,l=a.get(u),c=(n&16384)!==0,f=r+24,m,b,h,d;if(c&&f+8<=r+o)m=s.getInt16(f,true),b=s.getInt16(f+2,true),h=s.getInt16(f+4,true),d=s.getInt16(f+6,true);else if(!c&&f+16<=r+o)m=s.getFloat32(f,true),b=s.getFloat32(f+4,true),h=s.getFloat32(f+8,true),d=s.getFloat32(f+12,true);else return chunkI7XOR2GO_js.r(`DrawImage: imgId=${u}, rect data out of bounds`),true;e.totalDrawImageCalls++;let p=l&&l.kind==="plus-image"&&l.data;chunkI7XOR2GO_js.q(`DrawImage: imgId=${u}, dest=(${m},${b},${h},${d}), compressed=${c}, hasObj=${!!l}, objKind=${l?.kind}, hasData=${!!p}, dataLen=${p?l.data.byteLength:0}, isMetafile=${l?.kind==="plus-image"?l.type===2:"N/A"}`),chunkI7XOR2GO_js.q(`DrawImage: worldTransform=[${e.worldTransform.map(x=>x.toFixed(3)).join(", ")}]`),l&&l.kind==="plus-image"&&l.data?gp(e,l,r,m,b,h,d,(x,y,g,M)=>[D(h/g),0,0,D(d/M),m-x*h/g,b-y*d/M],null,false,(x,y)=>[Math.fround(h/x),Math.fround(d/y)],void 0,[m,b,h,d]):chunkI7XOR2GO_js.r(`DrawImage: SKIPPED, no valid image data for id=${u}`);}return true}case 16411:{if(o>=28){let u=n&255,l=a.get(u),c=s.getUint32(r+24,true),f=r+28,m=(n&Wf)!==0?e.ext?.pendingEffect??null:null;if(e.ext&&(e.ext.pendingEffect=null),c>=3&&l&&l.kind==="plus-image"&&l.data){let b=Un(s,f,r+o,3,n);if(!b)return chunkI7XOR2GO_js.r(`DrawImagePoints: imgId=${u}, point data out of bounds`),true;let[{x:h,y:d},{x:p,y:x},{x:y,y:g}]=b,M=h,E=d,P=Math.sqrt((p-h)**2+(x-d)**2),R=Math.sqrt((y-h)**2+(g-d)**2);e.totalDrawImageCalls++,chunkI7XOR2GO_js.q(`DrawImagePoints: imgId=${u}, points=[(${h},${d}),(${p},${x}),(${y},${g})], dest=(${M.toFixed(1)},${E.toFixed(1)},${P.toFixed(1)},${R.toFixed(1)})`),chunkI7XOR2GO_js.q(`DrawImagePoints: worldTransform=[${e.worldTransform.map(T=>T.toFixed(3)).join(", ")}]`),gp(e,l,r,M,E,P,R,(T,w,A,I)=>{let S=D((p-h)/A),v=D((x-d)/A),C=D((y-h)/I),U=D((g-d)/I);return [S,v,C,U,h-S*T-C*w,d-v*T-U*w]},m,true,x===d&&y===h?(T,w)=>[Math.fround((p-h)/T),Math.fround((g-d)/w)]:void 0,[h,d,p,x,y,g]);}else {let b=l&&l.kind==="plus-image"&&l.data;chunkI7XOR2GO_js.r(`DrawImagePoints: SKIPPED, imgId=${u}, count=${c}, hasObj=${!!l}, hasData=${!!b}`);}}return true}default:return false}}var jR=8192;function Yc(e,t){let n=e.objectTable.get(t&255);return n&&n.kind==="plus-pen"?n:null}function Wa(e,t){return n=>{n.moveTo(e[0].x,e[0].y);for(let r=1;r+2<e.length;r+=3)n.bezierCurveTo(e[r].x,e[r].y,e[r+1].x,e[r+1].y,e[r+2].x,e[r+2].y);t&&n.closePath();}}function Tp(e,t,n,r,o){let{view:i}=e,s=r+o;switch(t){case 16409:{if(o<4)return true;let a=i.getUint32(r,true),u=Un(i,r+4,s,a,n);return !u||u.length<4||(u.length-1)%3!==0||an(e,Yc(e,n),Wa(u,false),u,false),true}case 16408:{if(o<16)return true;let a=i.getFloat32(r,true),u=i.getUint32(r+4,true),l=i.getUint32(r+8,true),c=i.getUint32(r+12,true),f=Un(i,r+16,s,c,n&16384);if(!f)return true;let m=Ga(f,a,false,u,l);return m.length>=4&&an(e,Yc(e,n),Wa(m,false),m,false),true}case 16407:{if(o<8)return true;let a=i.getFloat32(r,true),u=i.getUint32(r+4,true),l=Un(i,r+8,s,u,n),c=l?Ga(l,a,true):[];return c.length>=4&&an(e,Yc(e,n),Wa(c,true),c,true),true}case 16406:{if(o<12)return true;let a=i.getUint32(r,true),u=i.getFloat32(r+4,true),l=i.getUint32(r+8,true),c=Un(i,r+12,s,l,n),f=c?Ga(c,u,true):[];if(f.length<4)return true;let m=n&jR?"nonzero":"evenodd",b=Wa(f,true);if(!Cn(e,n,a,b,f,m)){let{ctx:h}=e;h.fillStyle=Nt(e,n,a),pt(e),h.beginPath(),b(h),h.fill(m);}return true}case 16439:return YR(e,n,r,o),true;case 16403:return o<4||zR(e,n,i.getUint32(r,true)),true;default:return false}}function YR(e,t,n,r){if(r<12)return;let{view:o,objectTable:i}=e,s=i.get(t&255),a=o.getUint32(n,true),u=o.getUint32(n+4,true);if(e.ext&&(e.ext.pendingEffect=null),!s||s.kind!=="plus-path")return;let l=u<=255?i.get(u):void 0;l&&l.kind==="plus-brush"&&Xc(e,0,u,s);let c=a<=255?i.get(a):void 0;c&&c.kind==="plus-pen"&&jc(e,c,s);}function VR(e){let t=e.canvas,n=t?.width,r=t?.height;return typeof n=="number"&&typeof r=="number"&&n>0&&r>0?{w:n,h:r}:null}function zR(e,t,n){let r=e.objectTable.get(t&255);if(!r||r.kind!=="plus-region"||r.nodes.length===0)return;let o=r.nodes[0],i=_e(e),{ctx:s}=e,a=VR(s);if(fi(e)!=="canvas"&&a){let m={x:0,y:0,w:a.w,h:a.h},b=Ba(o,i,m,Rt(e.pixelOffsetMode??0)),h=b?Nl(e,t,n):null;if(b&&h){let d=up(b,m);if(!d)return;let p=new Uint8ClampedArray(d.w*d.h);for(let x=0;x<d.h;x++)for(let y=0;y<d.w;y++)p[x*d.w+y]=b[(d.y+x)*m.w+d.x+y]?255:0;if(zn(e,h,d,p,1,true))return}}let u=ni(o,i,0,a?{x:0,y:0,w:a.w,h:a.h}:void 0);u.exact||chunkI7XOR2GO_js.r("FillRegion: region approximated (no canvas domain for an unbounded result)");let l=u.region,c=sn(i);if(l&&l.length===0||!c)return;let f=a??{w:1e6,h:1e6};s.save();try{s.setTransform(1,0,0,1,0,0);for(let b of l??[])s.beginPath(),ti(s,b.cmds),s.clip(b.fillRule);s.fillStyle=Nt(e,t,n),pt(e);let m=[[0,0],[f.w,0],[f.w,f.h],[0,f.h]].map(([b,h])=>({x:c[0]*b+c[2]*h+c[4],y:c[1]*b+c[3]*h+c[5]}));s.beginPath(),s.moveTo(m[0].x,m[0].y);for(let b=1;b<4;b++)s.lineTo(m[b].x,m[b].y);s.closePath(),s.fill();}finally{s.restore();}}function nT(e,t,n,r){let o=u=>{let l=u*Math.PI/180;return n>0&&r>0?Math.atan2(n*Math.sin(l),r*Math.cos(l)):l},i=Math.max(-360,Math.min(360,t)),s=o(e);if(Math.abs(i)>=360)return {start:s,sweep:Math.sign(i)*2*Math.PI};let a=o(e+i)-s;return i>0&&a<0?a+=2*Math.PI:i<0&&a>0?a-=2*Math.PI:i===0&&(a=0),{start:s,sweep:a}}function Ip(e,t,n,r,o){if(o&Gc)return Un(e,t,n,r,o);let i=(o&16384)!==0,s=i?4:8,a=[];for(let u=0,l=t;u<r&&l+s<=n;u++,l+=s)a.push(Bc(e,l,i));return a}function Vc(e,t){let n=e.objectTable.get(t&255);return n&&n.kind==="plus-pen"?n:null}function Sp(e,t,n,r,o){let{ctx:i,view:s,objectTable:a}=e;switch(t){case 16394:{if(o>=8){let u=s.getUint32(r,true),l=s.getUint32(r+4,true),c=(n&16384)!==0,f=c?8:16,m=[],b=r+8;for(let d=0;d<l&&b+f<=r+o;d++)m.push(_c(s,b,c)),b+=f;if(!Cn(e,n,u,d=>{for(let p of m)d.rect(p.x,p.y,p.w,p.h);},m.flatMap(d=>[{x:d.x,y:d.y},{x:d.x+d.w,y:d.y},{x:d.x,y:d.y+d.h},{x:d.x+d.w,y:d.y+d.h}]))){i.fillStyle=Nt(e,n,u),pt(e);for(let d of m)i.fillRect(d.x,d.y,d.w,d.h);}}return true}case 16395:{if(o>=4){let u=s.getUint32(r,true),l=(n&16384)!==0,c=l?8:16,f=[],m=r+4;for(let b=0;b<u&&m+c<=r+o;b++)f.push(_c(s,m,l)),m+=c;an(e,Vc(e,n),b=>{for(let h of f)b.rect(h.x,h.y,h.w,h.h);},f.flatMap(b=>[{x:b.x,y:b.y},{x:b.x+b.w,y:b.y+b.h}]),true);}return true}case 16398:{if(o>=12){let u=s.getUint32(r,true),l=(n&16384)!==0,c,f,m,b;if(l)c=s.getInt16(r+4,true),f=s.getInt16(r+6,true),m=s.getInt16(r+8,true),b=s.getInt16(r+10,true);else {if(o<20)return true;c=s.getFloat32(r+4,true),f=s.getFloat32(r+8,true),m=s.getFloat32(r+12,true),b=s.getFloat32(r+16,true);}let h=p=>{p.ellipse(c+m/2,f+b/2,Math.abs(m)/2,Math.abs(b)/2,0,0,Math.PI*2);},d=[{x:c,y:f},{x:c+m,y:f},{x:c,y:f+b},{x:c+m,y:f+b}];Cn(e,n,u,h,d)||(i.fillStyle=Nt(e,n,u),pt(e),i.beginPath(),h(i),i.fill());}return true}case 16399:{let u=n&255,l=a.get(u),c=(n&16384)!==0,f,m,b,h;if(c&&o>=8)f=s.getInt16(r,true),m=s.getInt16(r+2,true),b=s.getInt16(r+4,true),h=s.getInt16(r+6,true);else if(!c&&o>=16)f=s.getFloat32(r,true),m=s.getFloat32(r+4,true),b=s.getFloat32(r+8,true),h=s.getFloat32(r+12,true);else return true;return an(e,l&&l.kind==="plus-pen"?l:null,d=>d.ellipse(f+b/2,m+h/2,Math.abs(b)/2,Math.abs(h)/2,0,0,Math.PI*2),[{x:f,y:m},{x:f+b,y:m+h}],true),true}case 16400:case 16401:case 16402:{let u=t===16400;if(o<(u?12:8))return true;let c=r,f=u?s.getUint32(c,true):0;u&&(c+=4);let m=s.getFloat32(c,true),b=s.getFloat32(c+4,true);c+=8;let h=(n&16384)!==0,d,p,x,y;if(h&&c+8<=r+o)d=s.getInt16(c,true),p=s.getInt16(c+2,true),x=s.getInt16(c+4,true),y=s.getInt16(c+6,true);else if(!h&&c+16<=r+o)d=s.getFloat32(c,true),p=s.getFloat32(c+4,true),x=s.getFloat32(c+8,true),y=s.getFloat32(c+12,true);else return true;let g=d+x/2,M=p+y/2,E=Math.abs(x)/2,P=Math.abs(y)/2,{start:R,sweep:T}=nT(m,b,E,P);if(u){let A=S=>{S.moveTo(g,M),S.ellipse(g,M,E,P,0,R,R+T,T<0),S.closePath();},I=[{x:d,y:p},{x:d+x,y:p},{x:d,y:p+y},{x:d+x,y:p+y}];return Cn(e,n,f,A,I)||(i.fillStyle=Nt(e,n,f),pt(e),i.beginPath(),A(i),i.fill()),true}let w=t===16401;return an(e,Vc(e,n),A=>{w&&A.moveTo(g,M),A.ellipse(g,M,E,P,0,R,R+T,T<0),w&&A.closePath();},[{x:d,y:p},{x:d+x,y:p+y}],w),true}case 16397:{if(o>=4){let u=s.getUint32(r,true),l=Ip(s,r+4,r+o,u,n);if(!l)return true;let c=(n&8192)!==0;an(e,Vc(e,n),f=>{l.forEach((m,b)=>b===0?f.moveTo(m.x,m.y):f.lineTo(m.x,m.y)),c&&f.closePath();},l,c);}return true}case 16396:{if(o>=8){let u=s.getUint32(r,true),l=s.getUint32(r+4,true),c=Ip(s,r+8,r+o,l,n);if(!c)return true;let f=m=>{c.forEach((b,h)=>h===0?m.moveTo(b.x,b.y):m.lineTo(b.x,b.y)),m.closePath();};Cn(e,n,u,f,c)||(i.fillStyle=Nt(e,n,u),pt(e),i.beginPath(),f(i),i.fill());}return true}default:return false}}function Cp(e,t,n,r,o=n){let{view:i,objectTable:s}=e,a=t&255,u=t>>8&127;switch(u){case 1:{let l=Rs(i,n,r,e.textureCache,o);l&&s.set(a,l);break}case 2:{let l=V0(i,n,r,e.textureCache,o);l&&s.set(a,l);break}case 3:{let l=nr(i,n,r);l&&s.set(a,l);break}case 6:{let l=q0(i,n,r);l&&s.set(a,l);break}case 7:{if(r>=16){let l=i.getUint32(n+4,true),c=i.getUint32(n+12,true),f=i.getUint32(n+16,true),m=r>=48;s.set(a,{kind:"plus-stringformat",flags:l,alignment:c??0,lineAlignment:f??0,leadingMargin:m?i.getFloat32(n+36,true):void 0,trailingMargin:m?i.getFloat32(n+40,true):void 0,tracking:m?i.getFloat32(n+44,true):void 0,trimming:r>=52?i.getUint32(n+48,true):void 0});}break}case 5:{if(r<8)break;let l=Ss(i,n,r,a);s.set(a,{kind:"plus-image",data:l.data,type:l.type,cacheKey:o}),e.totalImageObjects++,chunkI7XOR2GO_js.q(`replayEmfPlusRecords: Stored Image object id=${a}, hasData=${l.data!==null}, imgType=${l.type}`);break}case 8:{if(r>=16){let l=i.getUint32(n+8,true),c=["tile","tile-flip-x","tile-flip-y","tile-flip-xy","clamp"];s.set(a,{kind:"plus-imageattributes",wrapMode:c[l]??"clamp",clampArgb:i.getUint32(n+12,true)});}else s.set(a,{kind:"plus-imageattributes"});break}case 4:{let l=aT(i,n,r);l&&(s.set(a,l),chunkI7XOR2GO_js.q(`replayEmfPlusRecords: Stored Region object id=${a}`));break}default:chunkI7XOR2GO_js.r(`replayEmfPlusRecords: Unknown EMF+ object type: ${u}, id=${a}`);break}}var vp=64;function zc(e,t,n,r=0){if(t+4>n)return null;if(r>vp)return chunkI7XOR2GO_js.r(`parseRegionNode: depth limit (${vp}) exceeded`),null;let o=e.getUint32(t,true),i=t+4;if(o<=5){let s=zc(e,i,n,r+1);if(!s)return null;i+=s.bytesRead;let a=zc(e,i,n,r+1);return a?(i+=a.bytesRead,{node:{type:"combine",combineMode:o,left:s.node,right:a.node},bytesRead:i-t}):null}if(o===268435456){if(i+16>n)return null;let s=e.getFloat32(i,true),a=e.getFloat32(i+4,true),u=e.getFloat32(i+8,true),l=e.getFloat32(i+12,true);return {node:{type:"rect",x:s,y:a,width:u,height:l},bytesRead:i+16-t}}if(o===268435457){if(i+4>n)return null;let s=e.getInt32(i,true);if(i+=4,s<=0||i+s>n)return null;let a=nr(e,i,s);return {node:a?{type:"path",path:a}:{type:"empty"},bytesRead:i+s-t}}return o===268435458?{node:{type:"empty"},bytesRead:4}:o===268435459?{node:{type:"infinite"},bytesRead:4}:(chunkI7XOR2GO_js.r(`parseRegionNode: unknown node type 0x${o.toString(16)}`),{node:{type:"empty"},bytesRead:4})}function aT(e,t,n){if(n<8)return null;e.getUint32(t,true);let o=e.getUint32(t+4,true);if(o>1e5)return chunkI7XOR2GO_js.r(`parseEmfPlusRegionObject: invalid node count ${o}`),null;let i=t+n,s=zc(e,t+8,i);return s?{kind:"plus-region",nodes:[s.node]}:(chunkI7XOR2GO_js.r("parseEmfPlusRegionObject: failed to parse region node tree"),null)}function bT(e,t,n){if(n<8)return;let r=e.view.getUint32(t,true);n<4+4*r||((e.ext??(e.ext={})).multiFormatSkip=true,chunkI7XOR2GO_js.q("MultiFormatStart: GDI+ plays no further EMF+ record"));}function Up(e){return e>0&&e<=1e5?e:void 0}function*Fp(e,t,n,r,o,i,s,a=1,u=5e5,l,c,f){let m=s??_a(),b={ctx:r,view:e,objectTable:m.objectTable,worldTransform:m.worldTransform,deferredImages:[],saveStack:m.saveStack,saveIdMap:m.saveIdMap,totalImageObjects:0,totalDrawImageCalls:0,clipSaveDepth:m.clipSaveDepth,clipRegion:m.clipRegion,pageUnit:m.pageUnit??Xs,pageScale:m.pageScale??1,dpiX:m.dpiX,dpiY:m.dpiY,videoDisplay:m.videoDisplay,...m.continuation??vs(),dpiScale:a,canvasW:o,canvasH:i,fontFamilyMap:l,textureCache:c,interpolationMode:m.interpolationMode,pixelOffsetMode:m.pixelOffsetMode,textRenderingHint:m.textRenderingHint,fonts:f,baseTransform:m.baseTransform,imageCache:m.imageCache,nestingDepth:m.nestingDepth,gdiAntialias:m.gdiAntialias,codePages:m.codePages,antiAlias:m.antiAlias,ext:m.ext??(m.ext={})},h=t+n,d=0,p=void 0;for(false;t+12<=h&&d<u;){chunkDO2CGP4P_js.c(),chunkDO2CGP4P_js.d()&&(yield);let x=e.getUint16(t,true),y=e.getUint16(t+2,true),g=e.getUint32(t+4,true),M=e.getUint32(t+8,true);if(g<12||t+g>h)break;d++;let E=t+12;if(m.gdiPassthrough=x===16388,b.ext?.multiFormatSkip&&x!==16386){t+=g;continue}switch(x){case 16385:{if(m.dualMode=(y&1)!==0,M>=16){let P=e.getUint32(E+4,true),R=e.getUint32(E+8,true),T=e.getUint32(E+12,true);b.dpiX=m.dpiX=Up(R),b.dpiY=m.dpiY=Up(T),b.videoDisplay=m.videoDisplay=(P&1)!==0;}break}case 16386:t=h;continue;case 16388:break;case 16389:bT(b,E,M);break;case 16390:case 16391:break;case 16440:(b.ext??(b.ext={})).pendingEffect=M<=g-12?ys(e,E,M):null;break;case 16393:{if(M>=4){let P=e.getUint32(E,true);r.save(),r.setTransform(1,0,0,1,0,0),r.globalAlpha=1,r.globalCompositeOperation="source-over",P>>>24!==255&&r.clearRect(0,0,o,i),r.fillStyle=chunkI7XOR2GO_js.c(P),r.fillRect(0,0,o,i),r.restore();}break}case 16392:{let P=Cs(b,e,y,E,M);P&&Cp(P.view===e?b:{...b,view:P.view},P.flags,P.dataOff,P.dataSize,P.cacheKey);break}default:{Sp(b,x,y,E,M)||Tp(b,x,y,E,M)||Rp(b,x,y,E,M)||Qb(b,x,y,E,M)||console.warn(`[emf-converter] Unhandled EMF+ record type: 0x${x.toString(16)}`);break}}t+=g;}if(d>=u&&console.warn(`[emf-converter] EMF+ record limit reached (${u}). Output may be incomplete.`),p);return s&&(s.worldTransform=b.worldTransform,s.saveIdMap=b.saveIdMap,s.clipRegion=b.clipRegion??null,s.clipSaveDepth=b.clipSaveDepth,s.continuation={continuationBuffer:b.continuationBuffer,continuationObjectId:b.continuationObjectId,continuationObjectType:b.continuationObjectType,continuationTotalSize:b.continuationTotalSize,continuationOffset:b.continuationOffset,continuationKey:b.continuationKey},s.interpolationMode=b.interpolationMode,s.pixelOffsetMode=b.pixelOffsetMode,s.textRenderingHint=b.textRenderingHint,s.pageUnit=b.pageUnit,s.pageScale=b.pageScale,s.dpiX=b.dpiX,s.dpiY=b.dpiY,s.videoDisplay=b.videoDisplay,s.antiAlias=b.antiAlias),r.setTransform(1,0,0,1,0,0),b.deferredImages}function kp(e,t,n,r,o,i=1,s={}){return chunkDO2CGP4P_js.g(Kc(e,t,n,r,o,i,s))}function*Kc(e,t,n,r,o,i=1,s={}){let a=[],u=_a(),l=s.maxRecords??2e5,c=s.maxRecordsEmfPlus??5e5,f=n.right-n.left||1,m=n.bottom-n.top||1,b=r/f,h=o/m,d=i>0?i:1;u.imageCache=s.imageCache,u.gdiAntialias=s.gdiAntialias,u.codePages=s.codePages,u.baseTransform=s.plusBaseTransform??[b/d,0,0,h/d,-n.left*b,-n.top*h],u.nestingDepth=s.nestingDepth;let p={ctx:t,view:e,objectTable:new Map,state:{...Fa(),fontFamilyMap:s.fontFamilyMap},stateStack:[],inPath:false,windowOrg:{x:0,y:0},windowExt:{cx:1,cy:1},viewportOrg:{x:0,y:0},viewportExt:{cx:1,cy:1},mapMode:1,useMappingMode:false,deviceToCanvas:true,clipSaveDepth:0,bounds:n,canvasW:r,canvasH:o,sx:b,sy:h,pathCmds:[],gdiAntialias:s.gdiAntialias,fonts:s.fonts,codePages:s.codePages},x=0,y=e.byteLength,g=0;for(;x+8<=y&&g<l;){chunkDO2CGP4P_js.c(),chunkDO2CGP4P_js.d()&&(yield);let P=e.getUint32(x,true),R=e.getUint32(x+4,true);if(R<8||x+R>y)break;g++;let T=x+8;if(P===70){if(R>=16){let A=e.getUint32(T,true),I=e.getUint32(T+4,true);if(I===726027589&&A>4){Xe(p);let S=yield*Fp(e,T+8,A-4,t,r,o,u,i,c,s.fontFamilyMap,s.textureCache,s.fonts);a.push(...S);}}x+=R;continue}if(P===14){break}if(P===28||P===98||P===115||P===1){x+=R;continue}if(ea(P)||Xe(p),s.gdiDrawing===false){x+=R;continue}if(u.dualMode&&!u.gdiPassthrough){P===33?gT(p):P===34?R>=12&&MT(p,e.getInt32(T,true)):Ii(p,P,x,T,R),x+=R;continue}Ii(p,P,x,T,R)||Aa(p,P,x,T,R)||va(p,P,x,T,R)||console.warn(`[emf-converter] Unhandled EMR record type: ${P}`),x+=R;}if(Xe(p),g>=l&&console.warn(`[emf-converter] EMF record limit reached (${l}). Output may be incomplete.`),s.nestingDepth){let P=u.clipSaveDepth+p.clipSaveDepth+p.stateStack.length;for(;P-- >0;)t.restore();}return a}function gT(e){e.skippedDcStack??(e.skippedDcStack=[]),e.skippedDcStack.push({state:ka(e.state),mapping:{mapMode:e.mapMode,windowOrg:{...e.windowOrg},windowExt:{...e.windowExt},viewportOrg:{...e.viewportOrg},viewportExt:{...e.viewportExt},useMappingMode:e.useMappingMode}});}function MT(e,t){let n=e.skippedDcStack??[],r=t<0?n.length+t:t-1;if(r<0||r>=n.length)return;let o=n[r];n.length=r,Object.assign(e.state,o.state),Object.assign(e,o.mapping);}function ET(e,t,n,r,o,i){let s=new DataView(e);if(!dr(s))return null;let[u,l,c,f,m,b]=o;if(l===0&&c===0&&u>0&&f>0){let d=-m/u,p=-b/f,x={left:d,top:p,right:d+n/u,bottom:p+r/f};return kp(s,t,x,n,r,1,i)}return kp(s,t,{left:0,top:0,right:n,bottom:r},n,r,1,{...i,plusBaseTransform:o,gdiDrawing:false})}rh(ET);var _p=256*1024*1024;async function vi(e){let t;if(e instanceof ArrayBuffer)t=e;else if(ArrayBuffer.isView(e))t=e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer instanceof ArrayBuffer?e.buffer:PT(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));else if(typeof Blob<"u"&&e instanceof Blob)t=await e.arrayBuffer();else return chunkI7XOR2GO_js.r("readMetafileInput: expected an ArrayBuffer, a typed array / Buffer, or a Blob"),null;return RT(t)?TT(t):t}function PT(e){let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t}function RT(e){if(e.byteLength<18)return false;let t=new Uint8Array(e,0,3);return t[0]===31&&t[1]===139&&t[2]===8}async function TT(e){if(typeof DecompressionStream>"u")return chunkI7XOR2GO_js.r("readMetafileInput: gzip input (.emz/.wmz) needs DecompressionStream, which this runtime lacks"),null;try{let t=new Blob([e]).stream().pipeThrough(new DecompressionStream("gzip")).getReader(),n=[],r=0;for(;;){let{done:s,value:a}=await t.read();if(s)break;if(r+=a.byteLength,r>_p)return await t.cancel(),chunkI7XOR2GO_js.r(`readMetafileInput: gzip input inflates past ${_p} bytes; refused`),null;n.push(a);}let o=new Uint8Array(r),i=0;for(let s of n)o.set(s,i),i+=s.byteLength;return o.buffer}catch(t){return chunkI7XOR2GO_js.r("readMetafileInput: gzip input is corrupt:",t instanceof Error?t.message:t),null}}var wT=15,AT=1128680791;function Ha(e,t){let n=t,r=null,o=0,i=0,s=0,a=0,u=0;for(;n+6<=e.byteLength&&u++<1e6;){let c=e.getUint32(n,true)*2,f=e.getUint16(n+4,true);if(c<6||n+c>e.byteLength||f===0)break;if(f===1574&&c>=44){let m=n+6,b=e.getUint16(m,true),h=e.getUint16(m+2,true),d=m+4;if(b===wT&&h>=34&&e.getUint32(d,true)===AT&&e.getUint32(d+4,true)===1){let p=e.getUint32(d+18,true),x=e.getUint32(d+22,true),y=e.getUint32(d+26,true),g=e.getUint32(d+30,true),M=d+34;if(x>h-34||M+x>n+c)return null;if(!r){if(g===0||g>256*1024*1024)return null;r=new Uint8Array(g),i=g,s=p;}if(g!==i||o+x>i||y!==i-o-x)return null;r.set(new Uint8Array(e.buffer,e.byteOffset+M,x),o),o+=x,a++;}}n+=c;}if(!r||o!==i||a!==s)return null;let l=new DataView(r.buffer);return i<88||l.getUint32(0,true)!==1?null:r.buffer}var wt=class{constructor(t,n=64){this.type=t;this.len=8;this.bytes=new Uint8Array(Math.max(16,n)),this.view=new DataView(this.bytes.buffer);}ensure(t){if(this.len+t<=this.bytes.length)return;let n=new Uint8Array(Math.max(this.bytes.length*2,this.len+t));n.set(this.bytes),this.bytes=n,this.view=new DataView(n.buffer);}get offset(){return this.len}i32(t){return this.ensure(4),this.view.setInt32(this.len,t|0,true),this.len+=4,this}u32(t){return this.ensure(4),this.view.setUint32(this.len,t>>>0,true),this.len+=4,this}i16(t){return this.ensure(2),this.view.setInt16(this.len,t,true),this.len+=2,this}u16(t){return this.ensure(2),this.view.setUint16(this.len,t&65535,true),this.len+=2,this}f32(t){return this.ensure(4),this.view.setFloat32(this.len,t,true),this.len+=4,this}raw(t){return this.ensure(t.length),this.bytes.set(t,this.len),this.len+=t.length,this}align(){for(;this.len%4!==0;)this.ensure(1),this.bytes[this.len++]=0;return this}patchU32(t,n){return this.view.setUint32(t,n>>>0,true),this}finish(){return this.align(),this.view.setUint32(0,this.type,true),this.view.setUint32(4,this.len,true),new DataView(this.bytes.buffer,0,this.len)}};function Ht(e,t){let n=t.getUint32(0,true),r=t.getUint32(4,true);ea(n)||Xe(e);let o=e.view;e.view=t;try{!Ii(e,n,0,8,r)&&!Aa(e,n,0,8,r)&&va(e,n,0,8,r);}finally{e.view=o;}}var Bp=[0,8388608,32768,8421376,128,8388736,32896,12632256,12639424,10930928,16776176,10526884,8421504,16711680,65280,16776960,255,16711935,65535,16777215];function Op(){return {kind:"pen",style:0,width:0,color:0}}function Np(){return {kind:"brush",style:0,color:16777215,hatch:0}}function Gp(e,t,n){return e<<16|t<<8|n}function Kn(e,t){let n=e&255,r=e>>>8&255,o=e>>>16&255;if(e>>>24===1){let i=e&65535;if(t){let s=t.entries[i<t.entries.length?i:0];return s===void 0?0:Gp(s&255,s>>>8&255,s>>>16&255)}return Bp[i<Bp.length?i:0]}return Gp(n,r,o)}function Ir(e,t){let n=Kn(t,e.palette);return chunkI7XOR2GO_js.b(n>>16&255,n>>8&255,n&255)}function Zn(e,t){return e.getUint32(t,true)}function Wp(e,t){e.pen=t;let n=e.rCtx.state;n.penStyle=t.style&15,n.penFlags=t.style&15,n.penWidth=t.width,n.penColor=Ir(e,t.color),n.penUserStyle=void 0,n.penExtended=false;}function Ci(e,t){e.brush=t;let n=e.rCtx.state;n.brushStyle=t.pattern?t.pattern.kind==="mono"?3:6:t.style,n.brushColor=Ir(e,t.color),n.brushPattern=t.pattern??(t.style===2&&t.hatch>=0&&t.hatch<=5?{kind:"hatch",hatch:t.hatch}:null);}function po(e){Wp(e,e.pen),Ci(e,e.brush),e.rCtx.state.textColor=Ir(e,e.textColor),e.rCtx.state.bkColor=Ir(e,e.bkColor);}function $t(e,t){let n=0;for(;e.objects[n]!==void 0;)n++;e.objects[n]=t;}function Hp(e,t,n){let{view:r}=e;if(n<16){$t(e,{kind:"other"});return}$t(e,{kind:"pen",style:r.getUint16(t,true),width:r.getInt16(t+2,true),color:Zn(r,t+6)});}function $p(e,t,n){let{view:r}=e;if(n<14){$t(e,{kind:"other"});return}$t(e,{kind:"brush",style:r.getUint16(t,true),color:Zn(r,t+2),hatch:r.getUint16(t+6,true)});}function Xp(e,t,n,r){let{view:o}=e;if(n<24){$t(e,{kind:"other"});return}let i=[];for(let u=0;u<32&&t+18+u<r;u++){let l=o.getUint8(t+18+u);if(l===0)break;i.push(l);}let s=String.fromCharCode(...qn(i,1,{ansi:e.ansiCodePage}).codes),a={kind:"font",height:o.getInt16(t,true),weight:o.getInt16(t+8,true),italic:o.getUint8(t+10)!==0,underline:o.getUint8(t+11)!==0,strikeOut:o.getUint8(t+12)!==0,family:s||"sans-serif",escapementTenthDeg:o.getInt16(t+4,true),details:{width:o.getInt16(t+2,true),orientationTenthDeg:o.getInt16(t+6,true),charSet:o.getUint8(t+13),quality:o.getUint8(t+16),pitchAndFamily:o.getUint8(t+17)}};$t(e,{kind:"font",font:a});}function Qc(e,t,n,r){if(n+40>r)return null;let o=t.getUint32(n,true),i=t.getUint16(n+14,true),s=t.getUint32(n+32,true);if(o<40||i>8)return null;let a=s||1<<i,u=n+o+a*2;if(u>r)return null;let l=r-u,c=new Uint8Array(o+a*4+l),f=new Uint8Array(t.buffer,t.byteOffset+n,r-n);c.set(f.subarray(0,o),0);for(let m=0;m<a;m++){let b=Kn(16777216|t.getUint16(n+o+m*2,true),e.palette);c[o+m*4]=b&255,c[o+m*4+1]=b>>8&255,c[o+m*4+2]=b>>16&255,c[o+m*4+3]=0;}return c.set(f.subarray(u-n),o+a*4),c}function em(e,t,n){let r=e.getUint32(t,true),o=e.getUint16(t+14,true),i=e.getUint32(t+16,true),a=e.getUint32(t+32,true);a===0&&o<=8&&(a=1<<o);let l=r+a*(4);return i===3&&r===40&&(l+=12),l}function IT(e,t,n,r,o){let i=e.view,s=t,a=n;if(r===1){let f=Qc(e,e.view,t,n);if(!f)return null;i=new DataView(f.buffer),s=0,a=f.length;}if(s+40>a)return null;let u=s+em(i,s);if(o&&i.getUint16(s+14,true)===1){let f=chunkI7XOR2GO_js.g(i,s,u);if(f)return {kind:"mono",...f}}let l=chunkI7XOR2GO_js.e(i,s,u,Math.max(0,a-u));if(!l)return null;let c=new Uint32Array(l.width*l.height);for(let f=0;f<c.length;f++)c[f]=l.data[f*4]<<16|l.data[f*4+1]<<8|l.data[f*4+2];return {kind:"bitmap",width:l.width,height:l.height,rgb:c}}function jp(e,t,n){let{view:r}=e;if(t+4+40>n){$t(e,{kind:"other"});return}let o=r.getUint16(t,true),i=r.getUint16(t+2,true),s=IT(e,t+4,n,i,o===3);$t(e,{kind:"brush",style:s?6:0,color:8421504,hatch:0,...s?{pattern:s}:{}});}function Yp(e,t,n){let r=e.getUint16(t,true),o=e.getUint16(t+2,true),i=[];for(let s=0;s<o&&t+4+s*4+4<=n;s++)i.push(e.getUint32(t+4+s*4,true));return {start:r,entries:i}}function Vp(e,t,n){if(t+4>n){$t(e,{kind:"other"});return}$t(e,{kind:"palette",entries:Yp(e.view,t,n).entries});}function tm(e,t,n,r){let o=e.palette;if(!o||t+4>n)return;let{start:i,entries:s}=Yp(e.view,t,n);for(let a=0;a<s.length&&i+a<o.entries.length;a++)r&&(o.entries[i+a]>>>24&1)===0||(o.entries[i+a]=s[a]);po(e);}function zp(e,t){let n=e.palette;if(n){if(t<n.entries.length)n.entries.length=t;else for(;n.entries.length<t;)n.entries.push(0);po(e);}}function qp(e,t){let n=e.objects[t];n?.kind==="palette"&&(e.palette=n,po(e));}function Jp(e,t,n){let{view:r}=e,o={kind:"region",rects:[]};if(t+22<=n){let i=r.getUint16(t+10,true),s=t+22;for(let a=0;a<i&&s+6<=n;a++){let u=r.getUint16(s,true),l=r.getInt16(s+2,true),c=r.getInt16(s+4,true),f=s+6;for(let m=0;m+1<u&&f+4<=n;m+=2,f+=4){let b=r.getInt16(f,true),h=r.getInt16(f+2,true);h>b&&c>l&&o.rects.push([b,l,h,c]);}s=f+2;}if(i===0){let a=r.getInt16(t+14,true),u=r.getInt16(t+16,true),l=r.getInt16(t+18,true),c=r.getInt16(t+20,true);l>a&&c>u&&o.rects.push([a,u,l,c]);}}$t(e,o);}function Kp(e,t){let n=e.objects[t];if(!n)return;let r=e.rCtx.state;switch(n.kind){case "pen":Wp(e,n);break;case "brush":Ci(e,n);break;case "font":{let o=n.font;r.fontHeight=o.height,r.fontWeight=o.weight,r.fontItalic=o.italic,r.fontUnderline=o.underline,r.fontStrikeOut=o.strikeOut,r.fontFamily=o.family,r.fontEscapementTenthDeg=o.escapementTenthDeg??0,r.fontDetails=o.details;break}}return n}function Zp(e,t){t>=0&&t<e.objects.length&&(e.objects[t]=void 0);}function nm(e,t,n,r,o){let i=Ee(e.rCtx),s=(l,c)=>[Math.floor((i[0]*l+i[2]*c+i[4])/e.kx+.5),Math.floor((i[1]*l+i[3]*c+i[5])/e.ky+.5)],a=s(t,n),u=s(t+r,n+o);return [a[0],a[1],u[0]-a[0],u[1]-a[1]]}function Qp(e,t){let{rCtx:n}=e,r={windowOrg:n.windowOrg,windowExt:n.windowExt,viewportOrg:n.viewportOrg,viewportExt:n.viewportExt};n.windowOrg={x:0,y:0},n.windowExt={cx:1,cy:1},n.viewportOrg={x:0,y:0},n.viewportExt={cx:e.kx,cy:e.ky};try{t();}finally{Object.assign(n,r);}}function ST(e,t){if(!t||t.bmi.length<48)return t;let n=new DataView(t.bmi.buffer,t.bmi.byteOffset,t.bmi.byteLength);if(n.getUint16(14,true)!==1)return t;let r=t.bmi.slice(),o=n.getUint32(0,true),i=(s,a)=>{r[o+s*4]=a&255,r[o+s*4+1]=a>>8&255,r[o+s*4+2]=a>>16&255,r[o+s*4+3]=0;};return i(0,Kn(e.textColor,e.palette)),i(1,Kn(e.bkColor,e.palette)),{bmi:r,bits:t.bits}}function rm(e,t,n,r){let{view:o}=e;if(t+40>n)return null;let i=new Uint8Array(o.buffer,o.byteOffset+t,n-t),s=new DataView(i.buffer,i.byteOffset,i.byteLength);if(r===1){let u=Qc(e,o,t,n);if(!u)return null;i=u,s=new DataView(u.buffer);}if(s.getUint32(0,true)<40)return null;let a=em(s,0);return a>i.length?null:{bmi:i.subarray(0,a),bits:i.subarray(a)}}function om(e,t,n,r,o,i,s,a,u,l,c,f){[r,o,i,s]=nm(e,r,o,i,s);let m=t?108:100,b=new wt(t?77:76,m+(f?f.bmi.length+f.bits.length+8:0));b.i32(0).i32(0).i32(-1).i32(-1),b.i32(r).i32(o).i32(i).i32(s),b.u32(n),b.i32(a).i32(u),b.f32(1).f32(0).f32(0).f32(1).f32(0).f32(0),b.u32(0),b.u32(0);let h=b.offset;if(b.u32(0).u32(0).u32(0).u32(0),t&&b.i32(l).i32(c),f){let p=b.offset;b.raw(f.bmi).align();let x=b.offset;b.raw(f.bits),b.patchU32(h,p).patchU32(h+4,f.bmi.length).patchU32(h+8,x).patchU32(h+12,f.bits.length);}let d=b.finish();Qp(e,()=>Ht(e.rCtx,d));}function e1(e,t,n,r,o,i,s,a,u,l,c,f=false){f||([n,r,o,i]=nm(e,n,r,o,i));let m=new wt(81,80+c.bmi.length+c.bits.length+8);m.i32(0).i32(0).i32(-1).i32(-1),m.i32(n).i32(r),m.i32(s).i32(a).i32(u).i32(l);let b=m.offset;m.u32(0).u32(0).u32(0).u32(0),m.u32(0),m.u32(t),m.i32(o).i32(i);let h=m.offset;m.raw(c.bmi).align();let d=m.offset;m.raw(c.bits),m.patchU32(b,h).patchU32(b+4,c.bmi.length).patchU32(b+8,d).patchU32(b+12,c.bits.length);let p=m.finish();Qp(e,()=>Ht(e.rCtx,p));}function t1(e,t,n){let{view:r}=e;if(t+12>n)return;let o=r.getUint32(t,true),i=r.getInt16(t+4,true),s=r.getInt16(t+6,true),a=r.getInt16(t+8,true),u=r.getInt16(t+10,true);om(e,false,o,u,a,s,i,0,0,s,i,null);}function n1(e,t){return t/2===(e>>8)+3}function r1(e,t,n,r){let{view:o}=e,i=o.getUint16(n+4,true);if(!n1(i,r))return;let s=n+6,a=s+4+(t?4:0)+6;if(a+8>n+r)return;let u=o.getUint32(s,true),l=o.getInt16(a,true),c=o.getInt16(a+2,true),f=o.getInt16(a+4,true),m=o.getInt16(a+6,true);om(e,false,u,m,f,c,l,0,0,c,l,null);}function o1(e,t,n,r){let{view:o}=e,i=o.getUint16(n+4,true),s=n+6,a=n+r,u=n1(i,r),l=s+4,c=()=>{let E=o.getInt16(l,true);return l+=2,E};if(s+4+(t?16:12)>a)return;let f=o.getUint32(s,true),m=t?c():0,b=t?c():0,h=c(),d=c();u&&(l+=2);let p=c(),x=c(),y=c(),g=c(),M=u?null:ST(e,rm(e,l,a,0));om(e,t,f,g,y,x,p,d,h,t?b:x,t?m:p,M);}function i1(e,t,n){let{view:r}=e;if(t+22>n)return;let o=r.getUint32(t,true),i=r.getUint16(t+4,true),s=r.getInt16(t+6,true),a=r.getInt16(t+8,true),u=r.getInt16(t+10,true),l=r.getInt16(t+12,true),c=r.getInt16(t+14,true),f=r.getInt16(t+16,true),m=r.getInt16(t+18,true),b=r.getInt16(t+20,true),h=rm(e,t+22,n,i);h&&e1(e,o,b,m,f,c,l,u,a,s,h);}function s1(e,t,n){let{view:r}=e;if(t+18>n)return;let o=r.getUint16(t,true),i=r.getUint16(t+2,true),s=r.getUint16(t+4,true),a=r.getInt16(t+6,true),u=r.getInt16(t+8,true),l=r.getInt16(t+10,true),c=r.getInt16(t+12,true),f=r.getInt16(t+14,true),m=r.getInt16(t+16,true),b=rm(e,t+18,n,o);if(!b||i===0)return;let h=Math.abs(new DataView(b.bmi.buffer,b.bmi.byteOffset,b.bmi.byteLength).getInt32(8,true));if(s!==0||i<h)return;let d=Math.max(a,s),p=Math.min(a+l,s+i);if(p<=d||c<=0)return;let x=b.bmi.slice(),y=new DataView(x.buffer),g=y.getInt32(8,true);y.setInt32(8,g<0?-i:i,true);let[M,E]=nm(e,m,f,0,0),P=e.layout&1?M-c:M;e1(e,13369376,P,E+(a+l-p),c,p-d,u,d-s,c,p-d,{bmi:x,bits:b.bits},true);}function a1(e,t,n){let r=Ee(e.rCtx),o=Math.round((r[0]*t+r[2]*n)*16)+Math.round(r[4]*16),i=Math.round((r[1]*t+r[3]*n)*16)+Math.round(r[5]*16);return [Math.floor((o/e.kx+8)/16),Math.floor((i/e.ky+8)/16)]}function xo(e,t,n,r,o){let i=a1(e,t,n),s=a1(e,r,o);return [Math.min(i[0],s[0]),Math.min(i[1],s[1]),Math.max(i[0],s[0]),Math.max(i[1],s[1])]}function vT(e,t){return t.map(([n,r,o,i])=>({x:n*e.kx,y:r*e.ky,w:(o-n)*e.kx,h:(i-r)*e.ky}))}function im(e,t,n){Xe(e.rCtx);let r=t.length>0?mn(vT(e,t)):Ot();wr(e.rCtx,r,n);}function u1(e,t,n,r,o){im(e,[xo(e,t,n,r,o)],"intersect");}function l1(e,t,n,r,o){im(e,[xo(e,t,n,r,o)],"exclude");}function c1(e,t,n){let{rCtx:r}=e;if(!r.clipRegion)return;Xe(r);let o=Ee(r),i=Math.round(o[0]*t/e.kx)*e.kx,s=Math.round(o[3]*n/e.ky)*e.ky;r.clipRegion=mr(r.clipRegion,i,s),Yt(r,r.clipRegion);}function sm(e,t){let n=e.objects[t];if(n?.kind!=="region"){Xe(e.rCtx),e.rCtx.clipRegion=null,Yt(e.rCtx,null);return}im(e,n.rects,"replace");}function $a(e,t){return t.rects.map(([n,r,o,i])=>xo(e,n,r,o,i)).filter(([n,r,o,i])=>o>n&&i>r)}function m1(e,t){let n=new chunkI7XOR2GO_js.t,r=new Map;for(let[o,i,s,a]of t){let u=Math.round(o*e.kx),l=Math.round(s*e.kx);for(let c=Math.round(i*e.ky);c<Math.round(a*e.ky);c++){let f=r.get(c);f||(f=[],r.set(c,f)),f.push([u,l]);}}for(let o of [...r.keys()].sort((i,s)=>i-s)){let i=r.get(o).sort((u,l)=>u[0]-l[0]),[s,a]=i[0];for(let u=1;u<i.length;u++)i[u][0]<=a?a=Math.max(a,i[u][1]):(n.add(o,s,a),[s,a]=i[u]);n.add(o,s,a);}return n}function am(e,t,n){let r=e.brush;if(n!==null){let i=e.objects[n];if(i?.kind!=="brush")return;Ci(e,i);}let o=on(e.rCtx);o&&at(e.rCtx,m1(e,t),o,e.rCtx.state.rop2),n!==null&&Ci(e,r);}function Xa(e,t){let n=e.objects[t];return n?.kind==="region"?n:null}function f1(e,t,n){let r=Xa(e,t);r&&am(e,$a(e,r),n);}function b1(e,t){let n=Xa(e,t);n&&am(e,$a(e,n),null);}function h1(e,t){let n=Xa(e,t);n&&at(e.rCtx,m1(e,$a(e,n)),{kind:"solid",rgb:0},6);}function CT(e){if(e.length===0)return null;let t=1/0,n=1/0,r=-1/0,o=-1/0;for(let[u,l,c,f]of e)t=Math.min(t,u),n=Math.min(n,l),r=Math.max(r,c),o=Math.max(o,f);let i=r-t,s=o-n;if(i<=0||s<=0||i*s>64*1024*1024)return null;let a=new Uint8Array(i*s);for(let[u,l,c,f]of e)for(let m=l;m<f;m++)a.fill(1,(m-n)*i+(u-t),(m-n)*i+(c-t));return {x0:t,y0:n,w:i,h:s,m:a}}function d1(e,t,n,r,o){let i=Xa(e,t);if(!i)return;let s=Ee(e.rCtx),a=Math.abs(Math.round(s[0]*o/e.kx)),u=Math.abs(Math.round(s[3]*r/e.ky)),l=CT($a(e,i));if(!l)return;let{x0:c,y0:f,w:m,h:b}=l,h=(p,x)=>p>=0&&x>=0&&p<m&&x<b?l.m[x*m+p]:0,d=[];for(let p=0;p<b;p++){let x=-1;for(let y=0;y<=m;y++){let g=y<m&&h(y,p)===1,M=g&&h(y-a,p)===1&&h(y+a,p)===1&&h(y,p-u)===1&&h(y,p+u)===1&&h(y-a,p-u)===1&&h(y+a,p-u)===1&&h(y-a,p+u)===1&&h(y+a,p+u)===1,E=g&&!M;E&&x<0?x=y:!E&&x>=0&&(d.push([c+x,f+p,c+y,f+p+1]),x=-1);}}am(e,d,n);}function DT(e,t,n){let r=new chunkI7XOR2GO_js.t,o=Math.round(t*e.kx),i=Math.max(o+1,Math.round((t+1)*e.kx)),s=Math.round(n*e.ky),a=Math.max(s+1,Math.round((n+1)*e.ky));for(let u=s;u<a;u++)r.add(u,o,i);return r}function p1(e,t,n,r){let[o,i]=xo(e,t,n,t,n);at(e.rCtx,DT(e,o,i),{kind:"solid",rgb:Kn(r,e.palette)},13);}function um(e,t,n,r,o){let{rCtx:i}=e,{ctx:s}=i,a=vn(s);if(!a||!chunkI7XOR2GO_js.ra(s)||typeof s.getImageData!="function")return;let u=on(i);if(!u)return;Xe(i);let[l,c]=xo(e,t,n,t,n),f=Math.floor((l+.5)*e.kx),m=Math.floor((c+.5)*e.ky),{w:b,h}=a;if(f<0||m<0||f>=b||m>=h)return;let d=chunkI7XOR2GO_js.la(s,0,0,b,h).data,p=Kn(r,e.palette),x=T=>d[T*4+3]===0?16777215:d[T*4]<<16|d[T*4+1]<<8|d[T*4+2],y=o===1,g=T=>y?x(T)===p:x(T)!==p,M=m*b+f;if(!g(M))return;let E=new Uint8Array(b*h),P=[M];for(E[M]=1;P.length>0;){let T=P.pop(),w=T%b,A=(T-w)/b,I=S=>{!E[S]&&g(S)&&(E[S]=1,P.push(S));};w>0&&I(T-1),w+1<b&&I(T+1),A>0&&I(T-b),A+1<h&&I(T+b);}let R=new chunkI7XOR2GO_js.t;for(let T=0;T<h;T++){let w=-1;for(let A=0;A<=b;A++){let I=A<b&&E[T*b+A]===1;I&&w<0?w=A:!I&&w>=0&&(R.add(T,w,A),w=-1);}}at(i,R,u,i.state.rop2);}var x1=5,y1=6;function ja(e,t,n,r,o,i={}){let s=i.exclusive!==false,a=ge(e.rCtx,t,n),u=ge(e.rCtx,r,o),l=16*e.kx,c=16*e.ky,f={x0:Math.min(a[0],u[0]),y0:Math.min(a[1],u[1]),x1:Math.max(a[0],u[0])-(s?Math.round(l):0),y1:Math.max(a[1],u[1])-(s?Math.round(c):0)};if(!s)return f;if(i.curved&&cm(e)&&(f.x0-=Math.round(l/4),f.y0-=Math.round(c/4),f.x1-=Math.round(l*3/4),f.y1-=Math.round(c*3/4)),(e.rCtx.state.penStyle&15)===y1&&Math.round(aa(e.rCtx)/e.kx)>1){let b={...f},h=Ee(e.rCtx),d=Math.round(Math.abs(e.rCtx.state.penWidth*h[0])/e.kx*16),p=Math.round(Math.abs(e.rCtx.state.penWidth*h[3])/e.ky*16);f.x1+=Math.round(l),f.y1+=Math.round(c),f.x0+=Math.round((i.curved||i.roundFrame?Math.floor(d/2):Math.ceil(d/2))*l/16),f.y0+=Math.round(Math.ceil(p/2)*c/16);let x=!!i.half&&d%2===1;if(f.x1-=Math.round((x?Math.ceil(d/2):Math.floor(d/2))*l/16),f.y1-=Math.round(Math.ceil(p/2)*c/16),x&&(f.halfX=true),i.clampEmpty&&(f.x1<f.x0||f.y1<f.y0))return {x0:b.x0,y0:b.y0,x1:b.x1+Math.round(l),y1:b.y1+Math.round(c)}}return f}function Ya(e,t,n=false){let r=n?chunkI7XOR2GO_js.x(e.x0,e.y0,e.x1,e.y1):chunkI7XOR2GO_js.x(e.x0,e.y0,Math.max(e.x0,e.x1),Math.max(e.y0,e.y1));return e.halfX&&(r.halfX=true,r.halfXCompat=true),t&&(r.cornerExact=t),r}function Di(e){return {x:e.x0/16,y:e.y0/16,w:Math.max(0,e.x1-e.x0)/16,h:Math.max(0,e.y1-e.y0)/16}}function LT(e,t){let{state:n}=e.rCtx,r=Vn(e.rCtx);if(Mr(n,r)===0||gr(n,r)!==1)return;let o=Di(t);if(!(o.w<=1||o.h<=1))return i=>{i.beginPath(),i.rect(o.x+1,o.y+1,o.w-1,o.h-1);}}function g1(e,t,n,r,o){let i=ja(e,t,n,r,o);if(i.x1<i.x0||i.y1<i.y0)return;let s=Di(i),{rCtx:a}=e,{state:u}=a,l=u.penStyle===x1||(u.penStyle===0||u.penStyle===6)&&yt(a);if(a.gdiAntialias!==false&&l&&chunkI7XOR2GO_js.i(u).kind!=="tile"&&(chunkI7XOR2GO_js._(u.rop2).exact||!Yn(u.rop2))){let{ctx:c}=a;Xe(a),chunkI7XOR2GO_js.ba(c,u),c.fillRect(s.x,s.y,s.w,s.h),chunkI7XOR2GO_js.aa(c,u),c.lineWidth=1;let f=Mr(u,Vn(a));c.strokeRect(s.x+f,s.y+f,s.w,s.h);return}Qe(e.rCtx,{build:c=>{c.beginPath(),c.rect(s.x,s.y,s.w,s.h);},raster:()=>yr(Ya(i),lm(e)),rectangle:true,fill:true,stroke:true,axisRect:{interior:LT(e,i)}});}function UT(e,t,n,r,o){let i=Ee(e.rCtx);Math.round(Math.abs(t*i[0])*16);Math.round(Math.abs(n*i[3])*16);let u=16*e.kx,l=16*e.ky;if((e.rCtx.state.penStyle&15)===y1&&!yt(e.rCtx)){let d=r.x1-r.x0,p=r.y1-r.y0,x=Math.abs((o[2]-o[0])*i[0])*16||d,y=Math.abs((o[3]-o[1])*i[3])*16||p,g=Math.min(Math.abs(t*i[0])*16,x)*d/x;return [Math.floor(g),Math.floor(Math.min(Math.abs(n*i[3])*16,y)*p/y),[g,Math.min(Math.abs(n*i[3])*16,y)*p/y]]}let c=r.x1-r.x0,f=r.y1-r.y0,m=Math.abs((o[2]-o[0])*i[0])*16||c+u,b=Math.abs((o[3]-o[1])*i[3])*16||f+l,h=[Math.min(Math.abs(t*i[0])*16,m)*c/m,Math.min(Math.abs(n*i[3])*16,b)*f/b];return yt(e.rCtx)&&!cm(e)?h:[Math.floor(h[0]),Math.floor(h[1])]}function M1(e,t,n,r,o,i,s){let a=ja(e,t,n,r,o,{curved:true,half:true,clampEmpty:true});if(a.x1<a.x0||a.y1<a.y0)return;let[u,l,c]=UT(e,i,s,a,[t,n,r,o]),f=Di(a);Qe(e.rCtx,{build:m=>{m.beginPath();let b=Math.min(u/32,f.w/2),h=Math.min(l/32,f.h/2);if(b<=0||h<=0){m.rect(f.x,f.y,f.w,f.h);return}let d=Math.PI/2,p=f.x+f.w,x=f.y+f.h;m.moveTo(f.x+b,f.y),m.lineTo(p-b,f.y),m.ellipse(p-b,f.y+h,b,h,0,-d,0),m.lineTo(p,x-h),m.ellipse(p-b,x-h,b,h,0,0,d),m.lineTo(f.x+b,x),m.ellipse(f.x+b,x-h,b,h,0,d,2*d),m.lineTo(f.x,f.y+h),m.ellipse(f.x+b,f.y+h,b,h,0,2*d,3*d),m.closePath();},raster:()=>sa(Ya(a,c),u,l,lm(e),i===0||s===0,!cm(e)&&yt(e.rCtx)),roundPen:true,fill:true,stroke:true});}function E1(e,t,n,r,o){let i=ja(e,t,n,r,o,{curved:true,half:true,clampEmpty:true});if(i.x1<i.x0||i.y1<i.y0)return;let s=Di(i);Qe(e.rCtx,{build:a=>{a.beginPath(),a.ellipse(s.x+s.w/2,s.y+s.h/2,s.w/2,s.h/2,0,0,Math.PI*2);},raster:()=>li(Ya(i),lm(e)),roundPen:true,fill:true,stroke:true});}function FT(e,t,n,r,o,i,s,a,u,l,c=false){let f=ja(e,n,r,o,i,{curved:t==="chord"||t==="pie",roundFrame:true,half:true});if(f.y1<f.y0||!c&&f.x1<f.x0)return null;let m=Ee(e.rCtx),b=(E,P)=>[(m[0]*E+m[2]*P+m[4])*16,(m[1]*E+m[3]*P+m[5])*16],[h,d]=b(n,r),[p,x]=b(o,i),y={x0:Math.min(h,p),x1:Math.max(h,p),y0:Math.min(d,x),y1:Math.max(d,x)},g=(E,P,R,T,w)=>(T+w)/2+(R!==P?(E-(P+R)/2)*(w-T)/(R-P):E-(P+R)/2),M=(E,P)=>{let[R,T]=b(E,P);return [g(R,y.x0,y.x1,f.x0,f.x1),g(T,y.y0,y.y1,f.y0,f.y1)]};return {box:f,s:M(s,a),e:M(u,l)}}function P1(e,t,n,r,o,i,s,a,u,l){let c=FT(e,t,n,r,o,i,s,a,u,l);if(!c)return;let{box:f,s:m,e:b}=c,h=e.rCtx.state.arcDirection===2,d=Di(f),p=d.x+d.w/2,x=d.y+d.h/2,y=d.w/2||1,g=d.h/2||1,M=Math.atan2((m[1]/16-x)/g,(m[0]/16-p)/y),E=Math.atan2((b[1]/16-x)/g,(b[0]/16-p)/y),P=t==="chord"||t==="pie";Qe(e.rCtx,{build:R=>{R.beginPath(),t==="pie"&&R.moveTo(p,x),R.ellipse(p,x,d.w/2,d.h/2,0,M,E,!h),P&&R.closePath();},raster:()=>no(Ya(f),m,b,h,t).path,fill:P,stroke:true});}function lm(e){return e.rCtx.state.arcDirection===2}function cm(e){return (e.rCtx.state.penStyle&15)===x1}function kT(e,t){let n=e.rCtx.fonts;if(!n)return null;let r=Ee(e.rCtx),o=n.realize(bc(e.rCtx.state,Math.hypot(r[2],r[3]),Math.hypot(r[0],r[1])),e.rCtx.state.fontFamilyMap);return o?t.map(i=>o.advance(o.glyphIndex(i))):null}function _T(e,t){if(e.charExtra===0&&(e.justifyExtra===0||e.justifyCount===0))return null;let n=kT(e,t);if(!n)return null;let r=Ee(e.rCtx),o=Math.hypot(r[0],r[1])||1,i=Math.round(e.charExtra*o),s=32,a=e.justifyCount,u=a>0?Math.round(e.justifyExtra*o):0,l=f=>Math.round((f+1)*u/a)-Math.round(f*u/a),c=0;return n.map((f,m)=>{let b=f+i;return t[m]===s&&a>0&&(b+=l(c++)),b/o})}function BT(e,t,n,r){let{rCtx:o}=e;if(!o.fonts)return false;Xe(o);let i=t.rect,s=Ra(o.ctx,o.fonts,o.state,{codes:n,glyphIndices:false,x:t.x,y:t.y,options:t.options,rect:i?{left:i[0],top:i[1],right:i[2],bottom:i[3]}:null,dx:r,dy:null,matrix:Ee(o)});return s?(o.state.textAlign&1&&(o.state.curX+=s.dx,o.state.curY+=s.dy),true):false}function mm(e,t){let n=e.rCtx.state.fontDetails?.charSet??1,{codes:r,byteLengths:o}=qn(t.bytes,n,{ansi:e.ansiCodePage,oem:e.oemCodePage}),i=r.length;if(i===0)return;let s=0,a=t.dx?o.map(m=>{let b=0;for(let h=0;h<m;h++)b+=t.dx[s++]??0;return b}):_T(e,r);if(BT(e,t,r,a))return;let u=new wt(84,76+i*6+8);u.i32(0).i32(0).i32(-1).i32(-1),u.u32(1),u.f32(1).f32(1),u.i32(t.x).i32(t.y),u.u32(i);let l=u.offset;u.u32(0),u.u32(t.options);let c=t.rect??[0,0,0,0];u.i32(c[0]).i32(c[1]).i32(c[2]).i32(c[3]);let f=u.offset;u.u32(0),u.patchU32(l,u.offset);for(let m of r)u.u16(m);if(u.align(),a){u.patchU32(f,u.offset);for(let m of a)u.u32(Math.round(m)>>>0);}Ht(e.rCtx,u.finish());}function R1(e,t,n){let{view:r}=e;if(t+2>n)return;let o=r.getInt16(t,true),i=t+2,s=i+o+(o&1);if(o<=0||s+4>n)return;let a=[];for(let u=0;u<o;u++)a.push(r.getUint8(i+u));mm(e,{y:r.getInt16(s,true),x:r.getInt16(s+2,true),bytes:a,options:0,rect:null,dx:null});}function T1(e,t,n){let{view:r}=e;if(t+8>n)return;let o=r.getInt16(t,true),i=r.getInt16(t+2,true),s=r.getInt16(t+4,true),a=r.getUint16(t+6,true),u=(a&(mo|fo))!==0,l=t+8+(u?8:0),c=u&&t+16<=n?[r.getInt16(t+8,true),r.getInt16(t+10,true),r.getInt16(t+12,true),r.getInt16(t+14,true)]:null,f=Math.max(0,s);if(l+f>n)return;let m=[];for(let d=0;d<f;d++)m.push(r.getUint8(l+d));let b=l+f+(f&1),h=null;if(f>0&&b+f*2<=n){h=[];for(let d=0;d<f;d++)h.push(r.getInt16(b+d*2,true));}if(f===0){c&&a&mo&&mm(e,{x:i,y:o,bytes:[32],options:a,rect:c,dx:[0]});return}mm(e,{x:i,y:o,bytes:m,options:a,rect:c,dx:h});}function X4(e,t,n,r,o,i={}){let s=ho(e,n,i.wmfReferenceDpi),a=r/s.width,u=o/s.height,l={...Fa(),fontFamilyMap:i.fontFamilyMap},c={ctx:t,view:e,objectTable:new Map,state:l,stateStack:[],inPath:false,windowOrg:{x:0,y:0},windowExt:{cx:1,cy:1},viewportOrg:{x:0,y:0},viewportExt:{cx:1,cy:1},useMappingMode:true,clipSaveDepth:0,bounds:{left:0,top:0,right:s.width,bottom:s.height},canvasW:r,canvasH:o,sx:a,sy:u,pathCmds:[],gdiAntialias:i.gdiAntialias,fonts:i.fonts,wholeDevicePixels:[a,u]},f={rCtx:c,ansiCodePage:i.wmfAnsiCodePage??i.codePages?.ansi,oemCodePage:i.codePages?.oem,view:e,kx:a,ky:u,devW:s.width,devH:s.height,objects:[],stack:[],mapping:s.mapping,pen:Op(),brush:Np(),palette:null,textColor:0,bkColor:16777215,charExtra:0,justifyExtra:0,justifyCount:0,layout:0};return Sc(c,f.mapping,a,u),po(f),f}function un(e){Sc(e.rCtx,e.mapping,e.kx,e.ky,e.layout&1?e.devW:0);}function j4(e){return {mapping:Ic(e.mapping),pen:e.pen,brush:e.brush,palette:e.palette,textColor:e.textColor,bkColor:e.bkColor,charExtra:e.charExtra,justifyExtra:e.justifyExtra,justifyCount:e.justifyCount,layout:e.layout}}function Li(e,t,n){Ht(e.rCtx,new wt(t,16).u32(n).finish());}function Y4(e,t,n,r){let o=new wt(t,28+n*4);o.i32(0).i32(0).i32(-1).i32(-1).u32(n);for(let i=0;i<n;i++)o.i16(e.view.getInt16(r+i*4,true)).i16(e.view.getInt16(r+i*4+2,true));Ht(e.rCtx,o.finish());}function V4(e,t,n,r){let{view:o,rCtx:i}=e,s=n+6,a=n+r,u=f=>s+f<=a,l=f=>o.getInt16(s+f*2,true),c=f=>o.getUint16(s+f*2,true);switch(t){case 259:u(2)&&(Da(e.mapping,c(0)),un(e));return;case 523:u(4)&&(e.mapping.winOrg={y:l(0),x:l(1)},un(e));return;case 524:u(4)&&(ep(e.mapping,l(1),l(0)),un(e));return;case 525:u(4)&&(e.mapping.vpOrg={y:l(0),x:l(1)},un(e));return;case 526:u(4)&&(tp(e.mapping,l(1),l(0)),un(e));return;case 527:u(4)&&(e.mapping.winOrg={x:e.mapping.winOrg.x+l(1),y:e.mapping.winOrg.y+l(0)},un(e));return;case 529:u(4)&&(e.mapping.vpOrg={x:e.mapping.vpOrg.x+l(1),y:e.mapping.vpOrg.y+l(0)},un(e));return;case 1040:u(8)&&(La(e.mapping,l(3),l(2),l(1),l(0)),un(e));return;case 1042:u(8)&&(Ua(e.mapping,l(3),l(2),l(1),l(0)),un(e));return;case 30:e.stack.push(j4(e)),Ht(i,new wt(33,8).finish());return;case 295:{let f=u(2)?l(0):-1,m=e.stack.length;if(f<0&&(f=m+f+1),f<1||f>m)return;let b=e.stack[f-1];e.stack.length=f-1,Ht(i,new wt(34,12).i32(f).finish()),Object.assign(e,{...b,mapping:Ic(b.mapping)}),un(e),po(e);return}case 521:u(4)&&(e.textColor=Zn(o,s),i.state.textColor=Ir(e,e.textColor));return;case 513:u(4)&&(e.bkColor=Zn(o,s),i.state.bkColor=Ir(e,e.bkColor));return;case 258:u(2)&&Li(e,18,c(0));return;case 260:u(2)&&Li(e,20,c(0));return;case 262:u(2)&&Li(e,19,c(0));return;case 263:u(2)&&Li(e,21,c(0));return;case 302:u(2)&&Li(e,22,c(0));return;case 264:u(2)&&(e.charExtra=l(0));return;case 522:u(4)&&(e.justifyCount=l(0),e.justifyExtra=l(1));return;case 329:u(4)&&(e.layout=o.getUint32(s,true),un(e));return;case 261:case 561:case 1574:case 53:return;case 762:Hp(e,s,r);return;case 764:$p(e,s,r);return;case 763:Xp(e,s,r,a);return;case 322:jp(e,s,a);return;case 505:return;case 247:Vp(e,s,a);return;case 1791:Jp(e,s,a);return;case 248:case 1790:case 765:$t(e,{kind:"other"});return;case 301:u(2)&&(e.objects[c(0)]?.kind==="region"?sm(e,c(0)):Kp(e,c(0)));return;case 564:u(2)&&qp(e,c(0));return;case 55:tm(e,s,a,false);return;case 1078:tm(e,s,a,true);return;case 313:u(2)&&zp(e,c(0));return;case 496:u(2)&&Zp(e,c(0));return;case 532:u(4)&&Ht(i,new wt(27,16).i32(l(1)).i32(l(0)).finish());return;case 531:u(4)&&Ht(i,new wt(54,16).i32(l(1)).i32(l(0)).finish());return;case 1051:u(8)&&g1(e,l(3),l(2),l(1),l(0));return;case 1564:u(12)&&M1(e,l(5),l(4),l(3),l(2),l(1),l(0));return;case 1048:u(8)&&E1(e,l(3),l(2),l(1),l(0));return;case 2071:case 2096:case 2074:u(16)&&P1(e,t===2071?"arc":t===2096?"chord":"pie",l(7),l(6),l(5),l(4),l(3),l(2),l(1),l(0));return;case 804:case 805:if(u(2)){let f=l(0);f>0&&u(2+f*4)&&Y4(e,t===804?86:87,f,s+2);}return;case 1336:if(u(2)){let f=c(0);if(f===0||!u(2+f*2))return;let m=[],b=0;for(let p=0;p<f;p++){let x=o.getUint16(s+2+p*2,true);m.push(x),b+=x;}let h=s+2+f*2;if(!u(2+f*2+b*4))return;let d=new wt(91,32+f*4+b*4);d.i32(0).i32(0).i32(-1).i32(-1).u32(f).u32(b);for(let p of m)d.u32(p);for(let p=0;p<b;p++)d.i16(o.getInt16(h+p*4,true)).i16(o.getInt16(h+p*4+2,true));Ht(i,d.finish());}return;case 1313:R1(e,s,a);return;case 2610:T1(e,s,a);return;case 1565:t1(e,s,a);return;case 2338:case 2851:r1(e,t===2851,n,r);return;case 2368:case 2881:o1(e,t===2881,n,r);return;case 3907:i1(e,s,a);return;case 3379:s1(e,s,a);return;case 1046:u(8)&&u1(e,l(3),l(2),l(1),l(0));return;case 1045:u(8)&&l1(e,l(3),l(2),l(1),l(0));return;case 544:u(4)&&c1(e,l(1),l(0));return;case 300:u(2)&&sm(e,c(0));return;case 552:u(4)&&f1(e,c(0),c(1));return;case 299:u(2)&&b1(e,c(0));return;case 298:u(2)&&h1(e,c(0));return;case 1065:u(8)&&d1(e,c(0),c(1),l(2),l(3));return;case 1055:u(8)&&p1(e,l(3),l(2),Zn(o,s));return;case 1049:u(8)&&um(e,l(3),l(2),Zn(o,s),0);return;case 1352:u(10)&&um(e,l(4),l(3),Zn(o,s+2),c(0));return;default:return}}function*v1(e,t,n,r,o,i={}){let s=X4(e,t,n,r,o,i),a=n.headerSize,u=e.byteLength,l=i.maxRecords??2e5,c=0;for(;a+6<=u&&c<l;){let m=e.getUint32(a,true)*2,b=e.getUint16(a+4,true);if(m<6||a+m>u||b===0)break;c++,chunkDO2CGP4P_js.c(),chunkDO2CGP4P_js.d()&&(yield),V4(s,b,a,m),a+=m;}Xe(s.rCtx);let f=s.rCtx.clipSaveDepth+s.rCtx.stateStack.length;for(;f-- >0;)t.restore();c>=l&&console.warn(`[emf-converter] WMF record limit reached (${l}). Output may be incomplete.`);}function ki(e,t){return t?{...e,[chunkDO2CGP4P_js.a]:t}:e}var Fi=3;async function D1(e,t,n){if(chunkI7XOR2GO_js.q(`replayMetafile: input buffer ${e.byteLength} bytes`),false);let r=t??{},o=chunkDO2CGP4P_js.b(r),i=r.dpiScale??chunkI7XOR2GO_js.W,s=new DataView(e),a=null;try{a=dr(s);}catch(u){chunkI7XOR2GO_js.r("replayMetafile: parseEmfHeader threw during detection:",u instanceof Error?u.message:u);}if(!a)try{let u=oi(s),l=u?Ha(s,u.headerSize):null;if(l){let c=new DataView(l);a=dr(c),a&&(chunkI7XOR2GO_js.q("replayMetafile: WMF carries an embedded EMF; playing the EMF"),s=c);}}catch(u){chunkI7XOR2GO_js.r("replayMetafile: embedded-EMF probe threw:",u instanceof Error?u.message:u);}if(a){chunkI7XOR2GO_js.q("replayMetafile: detected EMF (valid EMR_HEADER)");try{let u=await Ls(s),l=await ju(s,0,{maxRecords:r.maxRecords,budget:o});o?.check();let c=zs(a);if(!c)return chunkI7XOR2GO_js.q("replayMetafile: getRenderableEmfBounds returned null"),null;let f=n(c.right-c.left,c.bottom-c.top);if(!f)return chunkI7XOR2GO_js.q("replayMetafile: surface creation failed"),null;f.ctx.save();let m=await chunkDO2CGP4P_js.f(o,Kc(s,f.ctx,c,f.width,f.height,i,{maxRecords:r.maxRecords,maxRecordsEmfPlus:r.maxRecords,fontFamilyMap:r.fontFamilyMap,codePages:{ansi:r.ansiCodePage,oem:r.oemCodePage},textureCache:u,imageCache:l,gdiAntialias:r.gdiAntialias,fonts:await C1(r)}));return f.ctx.restore(),chunkI7XOR2GO_js.q(`replayMetafile: EMF replay done, ${m.length} deferred images`),{surface:f,deferredImages:m}}catch(u){return o?.throwIfTripped(),chunkI7XOR2GO_js.r("replayMetafile: EMF EXCEPTION:",u instanceof Error?u.message:u),console.warn("[emf-converter] EMF conversion failed:",u instanceof Error?u.message:u),null}}chunkI7XOR2GO_js.q("replayMetafile: not EMF, trying WMF");try{let u=oi(s);if(!u)return chunkI7XOR2GO_js.q("replayMetafile: parseWmfHeader returned null"),null;if(u.boundsRight-u.boundsLeft<=0||u.boundsBottom-u.boundsTop<=0)return chunkI7XOR2GO_js.q("replayMetafile: invalid WMF dimensions"),null;await cb(s,u.headerSize,{maxRecords:r.maxRecords,budget:o});let l=ho(s,u,r.wmfReferenceDpi),c=n(l.width,l.height);return c?(c.ctx.save(),await chunkDO2CGP4P_js.f(o,v1(s,c.ctx,u,c.width,c.height,{wmfReferenceDpi:r.wmfReferenceDpi,wmfAnsiCodePage:r.wmfAnsiCodePage,codePages:{ansi:r.ansiCodePage,oem:r.oemCodePage},maxRecords:r.maxRecords,fontFamilyMap:r.fontFamilyMap,gdiAntialias:r.gdiAntialias,fonts:await C1(r)})),c.ctx.restore(),{surface:c,deferredImages:[]}):null}catch(u){return o?.throwIfTripped(),chunkI7XOR2GO_js.r("replayMetafile: WMF EXCEPTION:",u instanceof Error?u.message:u),console.warn("[emf-converter] WMF conversion failed:",u instanceof Error?u.message:u),null}}async function C1(e){if(!e.fonts||e.fonts.length===0)return;let{GdiFontCollection:t}=await import('./browser-chunks/gdi-font-engine-VF73ZSE3.js'),n=t.for(e.fonts,e.fontSmoothing??"cleartype");return n.size>0?n:void 0}function Ui(e){let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}function z4(e,t,n){let r=e.canvas,o=r?.width,i=r?.height;if(typeof o!="number"||typeof i!="number")return false;let{width:s,height:a}=t,u=chunkI7XOR2GO_js.Z(s,a);if(!u)return false;chunkI7XOR2GO_js.ka(u.ctx,t.drawable,0,0,s,a);let l=chunkI7XOR2GO_js.la(u.ctx,0,0,s,a),c=cn(l.data,s,a,n,{w:o,h:i});if(!c)return false;let f=chunkI7XOR2GO_js.Z(c.w,c.h);return f?(chunkI7XOR2GO_js.ma(f.ctx,chunkI7XOR2GO_js.oa(c.rgba,c.w,c.h),0,0),e.save(),e.setTransform(1,0,0,1,0,0),e.imageSmoothingEnabled=false,chunkI7XOR2GO_js.ka(e,f.canvas,c.x,c.y,c.w,c.h),e.restore(),true):false}async function q4(e,t,n,r){chunkI7XOR2GO_js.q(`processDeferredImages: ${t.length} deferred images (recursionDepth=${n})`);let o=true;for(let i=0;i<t.length;i++){let s=t[i];r?.check();try{let a=Ui(s.imageData);e.setTransform(...s.transform);let u=a,l;if(s.isMetafile){if(n>=Fi){chunkI7XOR2GO_js.r(` Deferred image [${i}]: skipping embedded metafile, recursion depth ${n}`);continue}let f=await gm(a,ki({},r),n+1);if(!f){chunkI7XOR2GO_js.r(` Deferred image [${i}]: metafile conversion returned null`),o=!1;continue}l=f.mimeType,u=Ui(f.data.buffer);}if(s.effect&&!s.isMetafile){let f=await Em(u);if(f){let m=Vs({kind:"plus-image",type:1,data:s.imageData},{kind:"bitmap",rgba:f.data,width:f.width,height:f.height},s.effect,s,s.effectSource);if(m){let{encodePng:b}=await import('./browser-chunks/png-encoder-BUYFBWDO.js');u=Ui((await b(m.bitmap.rgba,m.bitmap.width,m.bitmap.height)).buffer),s=m.draw,e.setTransform(...s.transform);}l="image/png";}}let c=await chunkI7XOR2GO_js.ia(u,l);c?(s.resample&&z4(e,c,s.resample)||chunkI7XOR2GO_js.ka(e,c.drawable,s.dx,s.dy,s.dw,s.dh),c.close()):(chunkI7XOR2GO_js.r(` Deferred image [${i}]: no image decoder available`),o=!1);}catch(a){r?.throwIfTripped(),o=false;let u=a instanceof Error?a.message:String(a);chunkI7XOR2GO_js.r(` Deferred image [${i}]: DRAW FAILED: ${u}`),console.warn("[emf-converter] Deferred image draw failed:",u,`(isMetafile=${s.isMetafile}, dataLen=${s.imageData.byteLength})`);}}return e.setTransform(1,0,0,1,0,0),o}var L1={png:"image/png",jpeg:"image/jpeg",webp:"image/webp",svg:"image/svg+xml"};async function J4(e,t,n=0){let r=t?.format??"png",o=chunkDO2CGP4P_js.b(t);if(o?.check(),t=ki(t,o),r==="svg"){let i=await _1(e,t,n);if(!i)return null;o?.check();let s=chunkI7XOR2GO_js.sa(await i.toTree({includeSize:t.includeSize}));return o?.check(),{format:r,mimeType:L1.svg,data:new TextEncoder().encode(s),width:i.canvas.width,height:i.canvas.height}}return t?.format==="jpeg"?U1(e,t,n):t?.format==="webp"?F1(e,t,n):gm(e,t,n)}async function ym(e,t,n,r,o){let i=chunkDO2CGP4P_js.b(t);t=ki(t,i);let s=await k1(e,t,n);if(!s)return null;try{let{width:a,height:u}=s;i?.check();let l=await o(s,i);return i?.check(),{format:r,mimeType:L1[r],data:l,width:a,height:u}}catch(a){return i?.throwIfTripped(),chunkI7XOR2GO_js.r("convertMetafile: EXCEPTION:",a instanceof Error?a.message:a),console.warn("[emf-converter] Conversion failed:",a instanceof Error?a.message:a),null}}function gm(e,t,n=0){return ym(e,t,n,"png",async({data:r,width:o,height:i},s)=>{let{encodePng:a}=await import('./browser-chunks/png-encoder-BUYFBWDO.js');return chunkDO2CGP4P_js.e(s,()=>a(r,o,i))})}function U1(e,t,n=0){return ym(e,t,n,"jpeg",async({data:r,width:o,height:i},s)=>{let{encodeJpeg:a}=await import('./browser-chunks/jpeg-encoder-5DE4U2SQ.js');return chunkDO2CGP4P_js.e(s,()=>a(r,o,i,{quality:t?.quality,background:ew(t?.background),chromaSubsampling:t?.chromaSubsampling}))})}function F1(e,t,n=0){return ym(e,t,n,"webp",async({data:r,width:o,height:i},s)=>{let{encodeWebp:a}=await import('./browser-chunks/webp-encoder-4JPXFFZZ.js');return chunkDO2CGP4P_js.e(s,()=>a(r,o,i,{lossy:t?.lossless===!1,quality:t?.quality}))})}async function k1(e,t,n=0){let r=chunkDO2CGP4P_js.b(t);r?.check();let o=await vi(e);r?.check();let i=o?await tw(o,ki(t,r),n,"convertMetafileToImageData"):null;if(!i)return null;try{let{canvas:s,ctx:a}=i;return {data:s instanceof chunkI7XOR2GO_js.R?new Uint8ClampedArray(s.pixels):chunkI7XOR2GO_js.la(a,0,0,s.width,s.height).data,width:s.width,height:s.height}}catch(s){return r?.throwIfTripped(),chunkI7XOR2GO_js.r("convertMetafileToImageData: EXCEPTION:",s instanceof Error?s.message:s),console.warn("[emf-converter] Conversion failed:",s instanceof Error?s.message:s),null}}async function K4(e,t){return Mm(await gm(e,{...t}))}async function Z4(e,t){return Mm(await U1(e,{...t}))}function Mm(e){return e?`data:${e.mimeType};base64,${chunkI7XOR2GO_js.ta(e.data)}`:null}async function Q4(e,t){return Mm(await F1(e,{...t}))}function ew(e){if(e===void 0)return [255,255,255];let t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim())?.[1];if(!t)return chunkI7XOR2GO_js.r(`convertMetafileToJpegDataUrl: background "${e}" is not #rgb or #rrggbb; using white`),[255,255,255];let n=t.length===3?[...t].map(r=>r+r).join(""):t;return [0,2,4].map(r=>parseInt(n.slice(r,r+2),16))}async function tw(e,t,n,r){let o=chunkDO2CGP4P_js.b(t);if(await chunkI7XOR2GO_js.U(),n>Fi)return chunkI7XOR2GO_js.r(`${r}: recursion depth ${n} exceeds limit ${Fi}`),null;let i={...t,gdiAntialias:t?.gdiAntialias??false};o?.check();let s=null,a=await D1(e,i,(u,l)=>{let c=chunkI7XOR2GO_js.Y(u,l,i.maxWidth,i.maxHeight,i.dpiScale??chunkI7XOR2GO_js.W,i.maxCanvasDimension);return c?(s=c.canvas,{ctx:c.ctx,width:c.canvas.width,height:c.canvas.height}):null});if(!a||!s)return null;try{let u=await q4(a.surface.ctx,a.deferredImages,n,o),l=s instanceof chunkI7XOR2GO_js.R?s:null;return l&&(l.textDraws>0||!u)?(chunkI7XOR2GO_js.r(`${r}: no canvas backend and the drawing ${l.textDraws>0?`contains text (${l.textDraws} runs)`:"contains an image only a canvas can decode"}; install @napi-rs/canvas for raster output, or use SVG output`),null):{canvas:s,ctx:a.surface.ctx}}catch(u){return o?.throwIfTripped(),chunkI7XOR2GO_js.r(`${r}: EXCEPTION:`,u instanceof Error?u.message:u),console.warn("[emf-converter] Conversion failed:",u instanceof Error?u.message:u),null}}var xm=0;async function Em(e){let t=await chunkI7XOR2GO_js.ja(new Uint8Array(e));if(t||chunkI7XOR2GO_js.V())return t;let n=await chunkI7XOR2GO_js.ia(e);if(!n)return null;try{let r=chunkI7XOR2GO_js.Z(n.width,n.height);return r?(chunkI7XOR2GO_js.ka(r.ctx,n.drawable,0,0,n.width,n.height),{data:chunkI7XOR2GO_js.la(r.ctx,0,0,n.width,n.height).data,width:n.width,height:n.height}):null}finally{n.close();}}async function nw(e,t,n){let r=await Em(e);return r?cn(r.data,r.width,r.height,t,{w:n.width,h:n.height}):null}async function rw(e,t,n,r,o){for(let i=0;i<t.length;i++){let s=t[i];o?.check();try{let a=Ui(s.imageData);if(s.effect&&!s.isMetafile){let f=await Em(a);if(f){let m=Vs({kind:"plus-image",type:1,data:s.imageData},{kind:"bitmap",rgba:f.data,width:f.width,height:f.height},s.effect,s,s.effectSource);if(m){let{encodePng:b}=await import('./browser-chunks/png-encoder-BUYFBWDO.js');a=Ui((await b(m.bitmap.rgba,m.bitmap.width,m.bitmap.height)).buffer),s=m.draw;}}}let u=null;if(s.isMetafile){if(r>=Fi){chunkI7XOR2GO_js.r(` Deferred image [${i}]: skipping embedded metafile, recursion depth ${r}`);continue}let f=await _i(a,{...n,includeSize:!0,idPrefix:void 0},r+1);f&&(u={kind:"url",url:chunkI7XOR2GO_js.va(f)});}else {let f=new Uint8Array(a),m=Br(f);if(m)u={kind:"encoded",bytes:f,mime:m};else if(u=So(a),!u){let b=await chunkI7XOR2GO_js.ia(a);if(b){let h=chunkI7XOR2GO_js.Y(b.width,b.height,void 0,void 0,1);h&&(chunkI7XOR2GO_js.ka(h.ctx,b.drawable,0,0,b.width,b.height),u={kind:"rgba",data:h.ctx.getImageData(0,0,b.width,b.height).data,width:b.width,height:b.height}),b.close();}}}if(!u){chunkI7XOR2GO_js.r(` Deferred image [${i}]: unsupported image data for SVG output`);continue}let l=s.svgSlot??e.reserveSlot();if(s.resample&&n.imageResampling==="exact"&&!s.isMetafile){let f=await nw(a,s.resample,e.canvas);if(f){e.fillSlot(l,{kind:"rgba",data:f.rgba,width:f.w,height:f.h},[1,0,0,1,0,0],f.x,f.y,f.w,f.h);continue}chunkI7XOR2GO_js.r(` Deferred image [${i}]: exact resampling unavailable (image not decodable here); renderer scaling used`);}let c=s.resample?Qi(u):null;if(s.resample&&c){let f=s.resample;e.fillSlotCropped(l,u,f.toDevice,c,f.srcX,f.srcY,f.srcW,f.srcH);}else e.fillSlot(l,u,s.transform,s.dx,s.dy,s.dw,s.dh);}catch(a){o?.throwIfTripped(),chunkI7XOR2GO_js.r(` Deferred image [${i}]: SVG embed failed: ${a instanceof Error?a.message:a}`);}}}async function _i(e,t,n=0){let r=await _1(e,t,n);return r?r.toTree({includeSize:t?.includeSize}):null}async function _1(e,t,n=0){let r=chunkDO2CGP4P_js.b(t);if(r?.check(),await chunkI7XOR2GO_js.U(),n>Fi)return null;let o=await vi(e);if(r?.check(),!o)return null;let i=ki(t??{},r),s=i.dpiScale??chunkI7XOR2GO_js.W,a=i.idPrefix===void 0?++xm:0,u=i.idPrefix??`emf${a}-`,l=null;try{let{SvgContext:c}=await import('./browser-chunks/svg-context-UTA3A5ZL.js'),f=await D1(o,i,(b,h)=>{let d=chunkI7XOR2GO_js.X(b,h,i.maxWidth,i.maxHeight,s,i.maxCanvasDimension),p=i.exactRasterOps===!1?null:chunkI7XOR2GO_js.Y(b,h,i.maxWidth,i.maxHeight,s,i.maxCanvasDimension)?.ctx??null;return l=new c(d.w,d.h,{shadow:p,idPrefix:u,imageResampling:i.imageResampling}),{ctx:l,width:d.w,height:d.h}});if(!f||!l)return null;let m=l;return await rw(m,f.deferredImages,i,n,r),m}catch(c){throw a!==0&&xm===a&&xm--,c}}async function B1(e,t){let n=await _i(e,t);return n?chunkI7XOR2GO_js.sa(n):null}async function ow(e,t){let n=await B1(e,t);return n?chunkI7XOR2GO_js.ua(n):null}function Ut(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}function ue(e){if(!Number.isFinite(e))return "0";let t=Math.round(e*1e6)/1e6;return t===0?"0":Number.isInteger(t)?String(t):t.toFixed(6).replace(/0+$/,"").replace(/\.$/,"")}function Pm(e){let t="FEFF";for(let n=0;n<e.length;n++)t+=e.charCodeAt(n).toString(16).padStart(4,"0").toUpperCase();return `<${t}>`}function Bi(e){let t="/";for(let n of e){let r=n.charCodeAt(0);t+=r>32&&r<127&&!"()<>[]{}/%#".includes(n)?n:`#${(r&255).toString(16).padStart(2,"0")}`;}return t}var za=class{constructor(){this.objects=[null];}reserve(){return this.objects.push(null),this.objects.length-1}set(t,n){this.objects[t]={kind:"raw",bytes:Ut(n)};}add(t){let n=this.reserve();return this.set(n,t),n}setStream(t,n,r,o=true){this.objects[t]={kind:"stream",dict:n,data:r,compress:o};}addStream(t,n,r=true){let o=this.reserve();return this.setStream(o,t,n,r),o}get count(){return this.objects.length-1}async finish(t,n){let r=[],o=[0],i=0,s=b=>{r.push(b),i+=b.length;};s(Uint8Array.from([...Ut(`%PDF-1.7
2
2
  %`),226,227,207,211,10]));for(let b=1;b<this.objects.length;b++){let h=this.objects[b]??{kind:"raw",bytes:Ut("null")};if(o[b]=i,s(Ut(`${b} 0 obj
3
3
  `)),h.kind==="raw")s(h.bytes);else {let d=h.data,p="";if(h.compress&&d.length>0){let x=await chunkC3KBKW2L_js.a(d);x.length<d.length&&(d=x,p="/Filter /FlateDecode ");}s(Ut(`<< ${h.dict} ${p}/Length ${d.length} >>
4
4
  stream
@@ -12,7 +12,7 @@ ${a}
12
12
  %%EOF
13
13
  `;s(Ut(l.join(`
14
14
  `)+`
15
- `+c));let f=new Uint8Array(i),m=0;for(let b of r)f.set(b,m),m+=b.length;return f}};var ow={8364:128,8218:130,402:131,8222:132,8230:133,8224:134,8225:135,710:136,8240:137,352:138,8249:139,338:140,381:142,8216:145,8217:146,8220:147,8221:148,8226:149,8211:150,8212:151,732:152,8482:153,353:154,8250:155,339:156,382:158,376:159};function iw(e){return e>=32&&e<127||e>=160&&e<=255?e:ow[e]??-1}function sw(e){let t=e.toLowerCase();return /courier|mono|consolas|lucida console|terminal|fixedsys|andale|menlo|monaco|typewriter/.test(t)?"Courier":/sans|arial|helvet|verdana|tahoma|calibri|segoe|trebuchet|impact/.test(t)?"Helvetica":/times|serif|georgia|garamond|palatino|cambria|book antiqua|century|bookman|minion|constantia|baskerville|didot/.test(t)?"Times":"Helvetica"}function aw(e,t,n){return e==="Times"?t?n?"Times-BoldItalic":"Times-Bold":n?"Times-Italic":"Times-Roman":`${e}${t||n?"-":""}${t?"Bold":""}${n?e==="Courier"||e==="Helvetica"?"Oblique":"Italic":""}`}function wm(e,t){return String.fromCharCode(e.getUint8(t),e.getUint8(t+1),e.getUint8(t+2),e.getUint8(t+3))}function uw(e){let t=e instanceof ArrayBuffer?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),n=[];try{let r=[];if(t.byteLength>=12&&wm(t,0)==="ttcf"){let o=t.getUint32(8);for(let i=0;i<o&&12+i*4+4<=t.byteLength;i++)r.push(t.getUint32(12+i*4));}else r.push(0);for(let o of r){let i=chunk5OO5QZBQ_js.i(t,o);i&&n.push({view:t,base:o,ttf:i});}}catch{}return n}function B1(e){let t=0,n=e.length&-4;for(let r=0;r<n;r+=4)t=t+(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0;if(n<e.length){let r=0;for(let o=n;o<n+4;o++)r=r<<8|(o<e.length?e[o]:0);t=t+r>>>0;}return t}function lw(e,t){let{view:n,base:r,ttf:o}=e,i=new Map,s=n.getUint16(r+4);for(let F=0;F<s;F++){let _=r+12+F*16;i.set(wm(n,_),{offset:n.getUint32(_+8),length:n.getUint32(_+12)});}let a=F=>{let _=i.get(F);return _&&_.offset+_.length<=n.byteLength?new Uint8Array(n.buffer,n.byteOffset+_.offset,_.length):null},u=a("head"),l=a("glyf"),c=a("loca"),f=a("hhea"),m=a("maxp"),b=a("hmtx");if(!u||!l||!c||!f||!m||!b)return null;let h=new DataView(u.buffer,u.byteOffset,u.length).getInt16(50)===1,d=new DataView(c.buffer,c.byteOffset,c.length),p=F=>h?d.getUint32(F*4):d.getUint16(F*2)*2,x=o.numGlyphs,y=[],g=new DataView(new ArrayBuffer((x+1)*4)),M=0;for(let F=0;F<x;F++){if(g.setUint32(F*4,M),!t.has(F))continue;let _=p(F),H=p(F+1);if(H>_&&H<=l.length){let G=H-_+3&-4,W=new Uint8Array(G);W.set(l.subarray(_,H)),y.push(W),M+=G;}}g.setUint32(x*4,M);let E=new Uint8Array(M),P=0;for(let F of y)E.set(F,P),P+=F.length;let R=u.slice(),T=new DataView(R.buffer);T.setInt16(50,1),T.setUint32(8,0);let w=[["head",R],["hhea",f],["maxp",m],["hmtx",b],["loca",new Uint8Array(g.buffer)],["glyf",E]];for(let F of ["cvt ","fpgm","prep"]){let _=a(F);_&&w.push([F,_]);}w.sort((F,_)=>F[0]<_[0]?-1:1);let A=w.length,I=0;for(;1<<I+1<=A;)I++;let S=(1<<I)*16,v=12+A*16,C=[];for(let[,F]of w)C.push(v),v+=F.length+3&-4;let U=new Uint8Array(v),L=new DataView(U.buffer);L.setUint32(0,65536),L.setUint16(4,A),L.setUint16(6,S),L.setUint16(8,I),L.setUint16(10,A*16-S),w.forEach(([F,_],H)=>{let G=12+H*16;for(let W=0;W<4;W++)U[G+W]=F.charCodeAt(W);L.setUint32(G+4,B1(_)),L.setUint32(G+8,C[H]),L.setUint32(G+12,_.length),U.set(_,C[H]);});let k=w.findIndex(([F])=>F==="head");return L.setUint32(C[k]+8,2981146554-B1(U)>>>0),U}var Rm=class{constructor(t,n,r){this.obj=t;this.face=n;this.baseName=r;this.embedded=true;this.used=new Map;let o=n.ttf;this.upem=o.unitsPerEm||1e3,this.ascent=(o.hheaAscender||o.winAscent||this.upem*.8)/this.upem,this.descent=Math.abs(o.hheaDescender||-o.winDescent||-this.upem*.2)/this.upem;}glyph(t){let n=this.face.ttf.glyphIndex(t);return n===0?null:(this.used.has(n)||this.used.set(n,t),{hex:n.toString(16).padStart(4,"0"),advance:this.face.ttf.hMetrics(n).advance/this.upem})}width(t){let n=0;for(let r of t){let o=this.face.ttf.glyphIndex(r.codePointAt(0));n+=this.face.ttf.hMetrics(o).advance/this.upem;}return n}finish(t,n){let{ttf:r}=this.face,o=new Set([0,...this.used.keys()]),i=[...o];for(;i.length;){let M=i.pop();for(let E of r.loadGlyph(M)?.components??[])o.has(E.glyphIndex)||(o.add(E.glyphIndex),i.push(E.glyphIndex));}let s=lw(this.face,o),a=1e3/this.upem,u=[],l=[];for(let[M,E]of [...this.used.entries()].sort((P,R)=>P[0]-R[0]))u.push(`${M} [${Math.round(r.hMetrics(M).advance*a)}]`),l.push(`<${M.toString(16).padStart(4,"0")}> <${cw(E)}>`);let c=this.baseName,f=s?t.addStream(`/Length1 ${s.length}`,s,n):0,m=this.bbox(),b=(r.fsSelection&1)!==0||(r.macStyle&2)!==0?-12:0,h=32|(r.isFixedPitch?1:0)|(b?64:0),d=t.add(`<< /Type /FontDescriptor /FontName ${Bi(c)} /Flags ${h} /FontBBox [${m}] /ItalicAngle ${b} /Ascent ${Math.round(this.ascent*1e3)} /Descent ${-Math.round(this.descent*1e3)} /CapHeight ${Math.round(this.ascent*700)} /StemV ${r.weightClass>=600?140:80}${f?` /FontFile2 ${f} 0 R`:""} >>`),p=t.add(`<< /Type /Font /Subtype /CIDFontType2 /BaseFont ${Bi(c)} /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> /FontDescriptor ${d} 0 R /DW 1000 /W [${u.join(" ")}] /CIDToGIDMap /Identity >>`),x=[];for(let M=0;M<l.length;M+=100){let E=l.slice(M,M+100);x.push(`${E.length} beginbfchar
15
+ `+c));let f=new Uint8Array(i),m=0;for(let b of r)f.set(b,m),m+=b.length;return f}};var iw={8364:128,8218:130,402:131,8222:132,8230:133,8224:134,8225:135,710:136,8240:137,352:138,8249:139,338:140,381:142,8216:145,8217:146,8220:147,8221:148,8226:149,8211:150,8212:151,732:152,8482:153,353:154,8250:155,339:156,382:158,376:159};function sw(e){return e>=32&&e<127||e>=160&&e<=255?e:iw[e]??-1}function aw(e){let t=e.toLowerCase();return /courier|mono|consolas|lucida console|terminal|fixedsys|andale|menlo|monaco|typewriter/.test(t)?"Courier":/sans|arial|helvet|verdana|tahoma|calibri|segoe|trebuchet|impact/.test(t)?"Helvetica":/times|serif|georgia|garamond|palatino|cambria|book antiqua|century|bookman|minion|constantia|baskerville|didot/.test(t)?"Times":"Helvetica"}function uw(e,t,n){return e==="Times"?t?n?"Times-BoldItalic":"Times-Bold":n?"Times-Italic":"Times-Roman":`${e}${t||n?"-":""}${t?"Bold":""}${n?e==="Courier"||e==="Helvetica"?"Oblique":"Italic":""}`}function wm(e,t){return String.fromCharCode(e.getUint8(t),e.getUint8(t+1),e.getUint8(t+2),e.getUint8(t+3))}function lw(e){let t=e instanceof ArrayBuffer?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),n=[];try{let r=[];if(t.byteLength>=12&&wm(t,0)==="ttcf"){let o=t.getUint32(8);for(let i=0;i<o&&12+i*4+4<=t.byteLength;i++)r.push(t.getUint32(12+i*4));}else r.push(0);for(let o of r){let i=chunk5OO5QZBQ_js.i(t,o);i&&n.push({view:t,base:o,ttf:i});}}catch{}return n}function G1(e){let t=0,n=e.length&-4;for(let r=0;r<n;r+=4)t=t+(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0;if(n<e.length){let r=0;for(let o=n;o<n+4;o++)r=r<<8|(o<e.length?e[o]:0);t=t+r>>>0;}return t}function cw(e,t){let{view:n,base:r,ttf:o}=e,i=new Map,s=n.getUint16(r+4);for(let F=0;F<s;F++){let _=r+12+F*16;i.set(wm(n,_),{offset:n.getUint32(_+8),length:n.getUint32(_+12)});}let a=F=>{let _=i.get(F);return _&&_.offset+_.length<=n.byteLength?new Uint8Array(n.buffer,n.byteOffset+_.offset,_.length):null},u=a("head"),l=a("glyf"),c=a("loca"),f=a("hhea"),m=a("maxp"),b=a("hmtx");if(!u||!l||!c||!f||!m||!b)return null;let h=new DataView(u.buffer,u.byteOffset,u.length).getInt16(50)===1,d=new DataView(c.buffer,c.byteOffset,c.length),p=F=>h?d.getUint32(F*4):d.getUint16(F*2)*2,x=o.numGlyphs,y=[],g=new DataView(new ArrayBuffer((x+1)*4)),M=0;for(let F=0;F<x;F++){if(g.setUint32(F*4,M),!t.has(F))continue;let _=p(F),H=p(F+1);if(H>_&&H<=l.length){let G=H-_+3&-4,W=new Uint8Array(G);W.set(l.subarray(_,H)),y.push(W),M+=G;}}g.setUint32(x*4,M);let E=new Uint8Array(M),P=0;for(let F of y)E.set(F,P),P+=F.length;let R=u.slice(),T=new DataView(R.buffer);T.setInt16(50,1),T.setUint32(8,0);let w=[["head",R],["hhea",f],["maxp",m],["hmtx",b],["loca",new Uint8Array(g.buffer)],["glyf",E]];for(let F of ["cvt ","fpgm","prep"]){let _=a(F);_&&w.push([F,_]);}w.sort((F,_)=>F[0]<_[0]?-1:1);let A=w.length,I=0;for(;1<<I+1<=A;)I++;let S=(1<<I)*16,v=12+A*16,C=[];for(let[,F]of w)C.push(v),v+=F.length+3&-4;let U=new Uint8Array(v),L=new DataView(U.buffer);L.setUint32(0,65536),L.setUint16(4,A),L.setUint16(6,S),L.setUint16(8,I),L.setUint16(10,A*16-S),w.forEach(([F,_],H)=>{let G=12+H*16;for(let W=0;W<4;W++)U[G+W]=F.charCodeAt(W);L.setUint32(G+4,G1(_)),L.setUint32(G+8,C[H]),L.setUint32(G+12,_.length),U.set(_,C[H]);});let k=w.findIndex(([F])=>F==="head");return L.setUint32(C[k]+8,2981146554-G1(U)>>>0),U}var Rm=class{constructor(t,n,r){this.obj=t;this.face=n;this.baseName=r;this.embedded=true;this.used=new Map;let o=n.ttf;this.upem=o.unitsPerEm||1e3,this.ascent=(o.hheaAscender||o.winAscent||this.upem*.8)/this.upem,this.descent=Math.abs(o.hheaDescender||-o.winDescent||-this.upem*.2)/this.upem;}glyph(t){let n=this.face.ttf.glyphIndex(t);return n===0?null:(this.used.has(n)||this.used.set(n,t),{hex:n.toString(16).padStart(4,"0"),advance:this.face.ttf.hMetrics(n).advance/this.upem})}width(t){let n=0;for(let r of t){let o=this.face.ttf.glyphIndex(r.codePointAt(0));n+=this.face.ttf.hMetrics(o).advance/this.upem;}return n}finish(t,n){let{ttf:r}=this.face,o=new Set([0,...this.used.keys()]),i=[...o];for(;i.length;){let M=i.pop();for(let E of r.loadGlyph(M)?.components??[])o.has(E.glyphIndex)||(o.add(E.glyphIndex),i.push(E.glyphIndex));}let s=cw(this.face,o),a=1e3/this.upem,u=[],l=[];for(let[M,E]of [...this.used.entries()].sort((P,R)=>P[0]-R[0]))u.push(`${M} [${Math.round(r.hMetrics(M).advance*a)}]`),l.push(`<${M.toString(16).padStart(4,"0")}> <${mw(E)}>`);let c=this.baseName,f=s?t.addStream(`/Length1 ${s.length}`,s,n):0,m=this.bbox(),b=(r.fsSelection&1)!==0||(r.macStyle&2)!==0?-12:0,h=32|(r.isFixedPitch?1:0)|(b?64:0),d=t.add(`<< /Type /FontDescriptor /FontName ${Bi(c)} /Flags ${h} /FontBBox [${m}] /ItalicAngle ${b} /Ascent ${Math.round(this.ascent*1e3)} /Descent ${-Math.round(this.descent*1e3)} /CapHeight ${Math.round(this.ascent*700)} /StemV ${r.weightClass>=600?140:80}${f?` /FontFile2 ${f} 0 R`:""} >>`),p=t.add(`<< /Type /Font /Subtype /CIDFontType2 /BaseFont ${Bi(c)} /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> /FontDescriptor ${d} 0 R /DW 1000 /W [${u.join(" ")}] /CIDToGIDMap /Identity >>`),x=[];for(let M=0;M<l.length;M+=100){let E=l.slice(M,M+100);x.push(`${E.length} beginbfchar
16
16
  ${E.join(`
17
17
  `)}
18
18
  endbfchar`);}let y=`/CIDInit /ProcSet findresource begin
@@ -29,11 +29,11 @@ endcodespacerange
29
29
  endcmap
30
30
  CMapName currentdict /CMap defineresource pop
31
31
  end
32
- end`,g=t.addStream("",Uint8Array.from(y,M=>M.charCodeAt(0)&255),n);t.set(this.obj,`<< /Type /Font /Subtype /Type0 /BaseFont ${Bi(c)} /Encoding /Identity-H /DescendantFonts [${p} 0 R] /ToUnicode ${g} 0 R >>`);}bbox(){let t=this.face.ttf,n=this.face.view,r=n.getUint16(this.face.base+4);for(let o=0;o<r;o++){let i=this.face.base+12+o*16;if(wm(n,i)==="head"){let s=n.getUint32(i+8),a=1e3/this.upem;return [n.getInt16(s+36),n.getInt16(s+38),n.getInt16(s+40),n.getInt16(s+42)].map(u=>Math.round(u*a)).join(" ")}}return `0 ${t.headYMin} 1000 ${t.headYMax}`}};function cw(e){if(e>65535){let t=e-65536;return (55296+(t>>10)).toString(16).padStart(4,"0")+(56320+(t&1023)).toString(16).padStart(4,"0")}return e.toString(16).padStart(4,"0")}var Tm=class{constructor(t,n){this.obj=t;this.family=n;this.embedded=false;this.ascent=n==="Courier"?.63:n==="Times"?.68:.72,this.descent=n==="Courier"?.2:.22;}glyph(t){let n=iw(t);return n<0&&(n=63),{hex:n.toString(16).padStart(2,"0"),advance:this.advanceOf(String.fromCodePoint(t))}}advanceOf(t){return this.family==="Courier"?.6*[...t].length:chunk7JVB7NLG_js.P(t,1)}width(t){return this.advanceOf(t)}};function mw(e){return e.split(",").map(t=>t.trim().replace(/^["']|["']$/g,"").trim()).filter(Boolean)}var qa=class{constructor(t,n=[],r=true){this.writer=t;this.compress=r;this.byFamily=new Map;this.cache=new Map;this.embeddedFonts=[];this.subsetCounter=0;for(let o of n)for(let i of uw(o))for(let s of [i.ttf.family,i.ttf.typoFamily,i.ttf.fullName])if(s){let a=s.toLowerCase().trim(),u=this.byFamily.get(a)??[];u.includes(i)||u.push(i),this.byFamily.set(a,u);}}findFace(t,n,r){for(let o of t){let i=this.byFamily.get(o.toLowerCase());if(!i||i.length===0)continue;let s=n?700:400,a=i[0],u=1/0;for(let l of i){let c=(l.ttf.fsSelection&1)!==0||(l.ttf.macStyle&2)!==0,f=Math.abs(l.ttf.weightClass-s)+(c!==r?1e3:0);f<u&&(u=f,a=l);}return a}return null}resolve(t,n,r){let o=this.findFace(mw(t),n,r);if(o){let u=`ttf:${o.ttf.fullName}:${o.base}:${o.ttf.family}:${o.ttf.weightClass}:${o.view.byteLength}`,l=this.cache.get(u);if(!l){let c=String.fromCharCode(65+this.subsetCounter%26,65+Math.floor(this.subsetCounter/26)%26,65,66,67,68);this.subsetCounter++;let f=(o.ttf.fullName||o.ttf.family||"Font").replace(/[^A-Za-z0-9-]/g,"")||"Font",m=new Rm(this.writer.reserve(),o,`${c}+${f}`);this.embeddedFonts.push(m),l=m,this.cache.set(u,l);}return l}let i=sw(t),s=aw(i,n,r),a=this.cache.get(s);return a||(a=new Tm(this.writer.add(`<< /Type /Font /Subtype /Type1 /BaseFont ${Bi(s)} /Encoding /WinAnsiEncoding >>`),i),this.cache.set(s,a)),a}finish(){for(let t of this.embeddedFonts)t.finish(this.writer,this.compress);}};function Am(e){return e.replace(/&(#x[0-9a-f]+|#\d+|amp|lt|gt|quot|apos);/gi,(t,n)=>{switch(n.toLowerCase()){case "amp":return "&";case "lt":return "<";case "gt":return ">";case "quot":return '"';case "apos":return "'"}let r=n[1]==="x"||n[1]==="X"?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return Number.isFinite(r)&&r>=0&&r<=1114111?String.fromCodePoint(r):""})}function G1(e){let t=/<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<!\[CDATA\[[\s\S]*?\]\]>|<!DOCTYPE[^>]*>|<(\/?)([A-Za-z_][\w:.-]*)((?:\s+[\w:.-]+\s*=\s*(?:"[^"]*"|'[^']*'))*)\s*(\/?)>|([^<]+)/g,n=/([\w:.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,r=[],o=null,i,s=0;for(;i=t.exec(e);){if(i.index!==s)return null;s=t.lastIndex;let[a,u,l,c,f,m]=i;if(m!==void 0){let x=r[r.length-1];(x&&m.trim()!==""||x&&x.tag==="text")&&(x.text=(x.text??"")+Am(m));continue}if(!l)continue;if(u){let x=r.pop();if(!x||x.tag!==l)return null;r.length===0&&(o=x);continue}let b={};n.lastIndex=0;let h;for(;h=n.exec(c);)b[h[1]]=Am(h[2]??h[3]??"");let d={tag:l,attrs:b},p=r[r.length-1];p&&(p.children??(p.children=[])).push(d),f?p||(o=d):r.push(d);}return r.length>0||s!==e.length?null:o}var Ja=[1,0,0,1,0,0];function pn(e,t){return [e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function fw(e){let t=e[0]*e[3]-e[1]*e[2];return !t||!Number.isFinite(t)?null:[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[3]*e[4])/t,(e[1]*e[4]-e[0]*e[5])/t]}var bw=e=>e.every((t,n)=>t===Ja[n]),dn=e=>`${e.map(ue).join(" ")} cm`;function Sr(e){let t=[...Ja];if(e===void 0)return t;let n=/(matrix|translate|scale|rotate)\s*\(([^)]*)\)/g,r;for(;r=n.exec(String(e));){let o=r[2].split(/[\s,]+/).filter(Boolean).map(Number),i=null;if(r[1]==="matrix"&&o.length===6)i=o;else if(r[1]==="translate")i=[1,0,0,1,o[0]??0,o[1]??0];else if(r[1]==="scale")i=[o[0]??1,0,0,o[1]??o[0]??1,0,0];else if(r[1]==="rotate"){let s=(o[0]??0)*Math.PI/180,a=Math.cos(s),u=Math.sin(s);i=[a,u,-u,a,0,0],o.length===3&&(i=pn(pn([1,0,0,1,o[1],o[2]],i),[1,0,0,1,-o[1],-o[2]]));}i&&i.every(Number.isFinite)&&(t=pn(t,i));}return t}var hw={black:[0,0,0],white:[255,255,255],red:[255,0,0],green:[0,128,0],lime:[0,255,0],blue:[0,0,255],yellow:[255,255,0],cyan:[0,255,255],aqua:[0,255,255],magenta:[255,0,255],fuchsia:[255,0,255],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],purple:[128,0,128],teal:[0,128,128],orange:[255,165,0]};function O1(e){let t=e.trim().toLowerCase(),n=/^#([0-9a-f]{6})/.exec(t);if(n){let r=parseInt(n[1],16);return [r>>16&255,r>>8&255,r&255]}if(n=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(t),n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];if(n=/^rgba?\(([^)]*)\)$/.exec(t),n){let r=n[1].split(/[\s,/]+/).filter(Boolean),o=i=>Math.max(0,Math.min(255,i===void 0?0:i.endsWith("%")?parseFloat(i)*255/100:parseFloat(i)));return [o(r[0]),o(r[1]),o(r[2])]}return hw[t]??null}var N1=e=>e.map(t=>ue(t/255)).join(" "),ye=(e,t=0)=>{let n=typeof e=="number"?e:e===void 0?NaN:parseFloat(e);return Number.isFinite(n)?n:t};function yo(e){return e===void 0?[]:String(e).split(/[\s,]+/).filter(Boolean).map(Number).filter(Number.isFinite)}function Im(e){let t={};for(let n of String(e??"").split(";")){let r=n.indexOf(":");r>0&&(t[n.slice(0,r).trim()]=n.slice(r+1).trim());}return t}var Sm={multiply:"Multiply",screen:"Screen",overlay:"Overlay",darken:"Darken",lighten:"Lighten","color-dodge":"ColorDodge","color-burn":"ColorBurn","hard-light":"HardLight","soft-light":"SoftLight",difference:"Difference",exclusion:"Exclusion",hue:"Hue",saturation:"Saturation",color:"Color",luminosity:"Luminosity"};function W1(e){let t=/^url\(\s*#([^)\s]+)\s*\)$/.exec(String(e??"").trim());return t?t[1]:null}function H1(e){let t=e.match(/[a-zA-Z]|[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g)??[],n=[],r=0,o="",i=0,s=0,a=0,u=0,l=0,c=0,f="",m=false,b=()=>parseFloat(t[r++]),h=()=>r<t.length&&!/^[a-zA-Z]$/.test(t[r]),d=()=>{m&&(n.push(`${ue(a)} ${ue(u)} m`),m=false);},p=(x,y,g,M,E,P)=>{d(),n.push(`${ue(x)} ${ue(y)} ${ue(g)} ${ue(M)} ${ue(E)} ${ue(P)} c`),l=g,c=M,f="c",i=E,s=P;};for(;r<t.length;){if(/^[a-zA-Z]$/.test(t[r])){if(o=t[r++],o==="z"||o==="Z"){n.push("h"),i=a,s=u,m=true,f="";continue}}else if(!o)break;let x=o===o.toLowerCase(),y=x?i:0,g=x?s:0,M=o.toUpperCase();if(M!=="C"&&M!=="S"&&M!=="Q"&&M!=="T"&&(f=""),!h()){o="";continue}switch(M){case "M":{let E=b()+y,P=b()+g;n.push(`${ue(E)} ${ue(P)} m`),i=a=E,s=u=P,m=false,o=x?"l":"L";break}case "L":{let E=b()+y,P=b()+g;d(),n.push(`${ue(E)} ${ue(P)} l`),i=E,s=P;break}case "H":{let E=b()+y;d(),n.push(`${ue(E)} ${ue(s)} l`),i=E;break}case "V":{let E=b()+g;d(),n.push(`${ue(i)} ${ue(E)} l`),s=E;break}case "C":{let E=b()+y,P=b()+g,R=b()+y,T=b()+g;p(E,P,R,T,b()+y,b()+g);break}case "S":{let E=f==="c"?2*i-l:i,P=f==="c"?2*s-c:s,R=b()+y,T=b()+g;p(E,P,R,T,b()+y,b()+g);break}case "Q":case "T":{let E,P;M==="Q"?(E=b()+y,P=b()+g):(E=f==="q"?2*i-l:i,P=f==="q"?2*s-c:s);let R=b()+y,T=b()+g,w=i,A=s;p(w+2/3*(E-w),A+2/3*(P-A),R+2/3*(E-R),T+2/3*(P-T),R,T),l=E,c=P,f="q";break}case "A":{r+=5;let E=b()+y,P=b()+g;d(),n.push(`${ue(E)} ${ue(P)} l`),i=E,s=P,chunk7JVB7NLG_js.q("PDF: SVG arc segment approximated by a straight line");break}default:r=t.length;}}return n.join(" ")}function dw(e){let t=e.replace(/[^A-Za-z0-9+/]/g,""),n=new Uint8Array(Math.floor(t.length*3/4)),r=i=>i>=65&&i<=90?i-65:i>=97&&i<=122?i-71:i>=48&&i<=57?i+4:i===43?62:63,o=0;for(let i=0;i<t.length;i+=4){let s=r(t.charCodeAt(i)),a=r(t.charCodeAt(i+1)),u=i+2<t.length?r(t.charCodeAt(i+2)):0,l=i+3<t.length?r(t.charCodeAt(i+3)):0,c=s<<18|a<<12|u<<6|l;o<n.length&&(n[o++]=c>>16&255),o<n.length&&(n[o++]=c>>8&255),o<n.length&&(n[o++]=c&255);}return n}function pw(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n of e)t+=String.fromCharCode(n);return t}function xw(e){if(e.length<4||e[0]!==255||e[1]!==216)return null;let t=false,n=2;for(;n+4<=e.length;){if(e[n]!==255){n++;continue}let r=e[n+1];if(r===255){n++;continue}if(r===216||r===1||r>=208&&r<=215){n+=2;continue}let o=e[n+2]<<8|e[n+3];if(r===238&&o>=12&&e[n+4]===65&&e[n+5]===100&&e[n+6]===111&&(t=true),r>=192&&r<=207&&r!==196&&r!==200&&r!==204)return n+10>e.length?null:{height:e[n+5]<<8|e[n+6],width:e[n+7]<<8|e[n+8],components:e[n+9],adobe:t};n+=2+o;}return null}function yw(e,t,n){let r=t*n,o=new Uint8Array(r*3),i=new Uint8Array(r),s=false;for(let a=0;a<r;a++){o[a*3]=e[a*4],o[a*3+1]=e[a*4+1],o[a*3+2]=e[a*4+2];let u=e[a*4+3];i[a]=u,u!==255&&(s=true);}return {kind:"raster",rgb:o,alpha:s?i:null,width:t,height:n}}var gw={ExtGState:"G",Pattern:"P",XObject:"X",Font:"F",Shading:"S"},go=class{constructor(){this.maps=new Map;}use(t,n){let r=this.maps.get(t);r||(r=new Map,this.maps.set(t,r));let o=r.get(n);return o||(o=`${gw[t]}${r.size+1}`,r.set(n,o)),`/${o}`}dict(){let t="<< /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]";for(let[n,r]of this.maps)t+=` /${n} << ${[...r].map(([o,i])=>`/${i} ${o} 0 R`).join(" ")} >>`;return t+" >>"}};function Cm(e,t){let n=e.attrs.id;n!==void 0&&t.set(String(n),e);for(let r of e.children??[])Cm(r,t);}var vm=class{constructor(t){this.options=t;this.writer=new za;this.prepared=new Map;this.gsCache=new Map;this.cache=new Map;this.imageObjs=new Map;this.alphaImages=new Map;this.smaskObjs=new Map;this.formObjs=new Map;this.warned=new Set;this.compress=t.compress??true,this.fontBook=new qa(this.writer,t.fonts??[],this.compress);}warnOnce(t){this.warned.has(t)||(this.warned.add(t),chunk7JVB7NLG_js.q(`PDF: ${t}`));}async prepare(t){if(t.tag==="image"){let n=t.attrs.href??t.attrs["xlink:href"];typeof n=="string"&&!this.prepared.has(n)&&(this.prepared.set(n,null),this.prepared.set(n,await this.prepareImage(n)));}for(let n of t.children??[])await this.prepare(n);}async prepareImage(t){let n=/^data:([^;,]*)((?:;[^;,]*)*),([\s\S]*)$/.exec(t);if(!n)return this.warnOnce("external image reference skipped (only data: URLs are embedded)"),null;let r=n[1].toLowerCase(),o=n[2].includes(";base64")?dw(n[3]):Ut(decodeURIComponent(n[3]));if(r==="image/svg+xml"){let a=G1(pw(o));if(!a)return this.warnOnce("nested SVG image could not be parsed"),null;await this.prepare(a);let u=yo(a.attrs.viewBox);return {kind:"svg",tree:a,width:u[2]??ye(a.attrs.width,1),height:u[3]??ye(a.attrs.height,1)}}let i=xw(o);if(i&&(i.components===1||i.components===3||i.components===4)&&i.width>0&&i.height>0)return {kind:"jpeg",bytes:o,width:i.width,height:i.height,components:i.components,invertedCmyk:i.components===4&&i.adobe};let s=null;try{s=await chunk7JVB7NLG_js.ia(o),!s&&this.options.decodeImage&&(s=await this.options.decodeImage(o,r));}catch{s=null;}return !s||s.width<=0||s.height<=0?(this.warnOnce(`image skipped: no decoder for ${r||"unknown"} data`),null):yw(s.data,s.width,s.height)}imageObj(t,n){let r=this.imageObjs.get(t)??{};this.imageObjs.set(t,r);let o=n?r.smooth:r.sharp;if(o)return o;let i=`/Interpolate ${n}`,s;if(t.kind==="jpeg"){let a=t.components===1?"/DeviceGray":t.components===3?"/DeviceRGB":"/DeviceCMYK";s=this.writer.addStream(`/Type /XObject /Subtype /Image /Width ${t.width} /Height ${t.height} /ColorSpace ${a} /BitsPerComponent 8 ${t.invertedCmyk?"/Decode [1 0 1 0 1 0 1 0] ":""}/Filter /DCTDecode ${i}`,t.bytes,false);}else {let a="";if(t.alpha){let u=this.alphaImages.get(t);u||(u=this.writer.addStream(`/Type /XObject /Subtype /Image /Width ${t.width} /Height ${t.height} /ColorSpace /DeviceGray /BitsPerComponent 8 ${i}`,t.alpha,this.compress),this.alphaImages.set(t,u)),a=` /SMask ${u} 0 R`;}s=this.writer.addStream(`/Type /XObject /Subtype /Image /Width ${t.width} /Height ${t.height} /ColorSpace /DeviceRGB /BitsPerComponent 8 ${i}${a}`,t.rgb,this.compress);}return n?r.smooth=s:r.sharp=s,s}gsObj(t,n,r){let o=`${ue(t)}|${n??""}|${r}`,i=this.gsCache.get(o);return i||(i=this.writer.add(`<< /Type /ExtGState /ca ${ue(t)} /CA ${ue(t)}${n?` /BM /${n}`:""}${r?` /SMask << /Type /Mask /S /Luminosity /G ${r} 0 R >>`:""} >>`),this.gsCache.set(o,i)),i}cached(t,n){let r=this.cache.get(t);return r===void 0&&(r=n(),this.cache.set(t,r)),r}gradientStops(t){let n=[];for(let r of t.children??[]){if(r.tag!=="stop")continue;let o=Math.max(0,Math.min(1,ye(r.attrs.offset,0))),i=O1(String(r.attrs["stop-color"]??"#000000"))??[0,0,0];n.push({offset:o,color:i,alpha:Math.max(0,Math.min(1,ye(r.attrs["stop-opacity"],1)))});}return n.sort((r,o)=>r.offset-o.offset),n}stopFunction(t,n){let r=[...t];r[0].offset>0&&r.unshift({...r[0],offset:0}),r[r.length-1].offset<1&&r.push({...r[r.length-1],offset:1});let o=(a,u)=>this.writer.add(`<< /FunctionType 2 /Domain [0 1] /C0 [${n(a).map(ue).join(" ")}] /C1 [${n(u).map(ue).join(" ")}] /N 1 >>`);if(r.length===2)return o(r[0],r[1]);let i=[];for(let a=0;a+1<r.length;a++)i.push(o(r[a],r[a+1]));let s=r.slice(1,-1).map(a=>ue(a.offset));return this.writer.add(`<< /FunctionType 3 /Domain [0 1] /Functions [${i.map(a=>`${a} 0 R`).join(" ")}] /Bounds [${s.join(" ")}] /Encode [${i.map(()=>"0 1").join(" ")}] >>`)}shadingObj(t,n,r){let o=`sh:${t.attrs.id}:${r}`,i=t.attrs,s,a;if(t.tag==="linearGradient"){let u=ye(i.x1),l=ye(i.y1),c=ye(i.x2),f=ye(i.y2);if(u===c&&l===f)return null;s=[u,l,c,f].map(ue).join(" "),a=2;}else {let u=ye(i.fx,ye(i.cx)),l=ye(i.fy,ye(i.cy)),c=Math.max(0,ye(i.fr)),f=ye(i.cx),m=ye(i.cy),b=Math.max(0,ye(i.r));if(b===0&&c===0)return null;s=[u,l,c,f,m,b].map(ue).join(" "),a=3;}return this.cached(o,()=>{let u=this.stopFunction(n,r?l=>[l.alpha]:l=>l.color.map(c=>c/255));return this.writer.add(`<< /ShadingType ${a} /ColorSpace ${r?"/DeviceGray":"/DeviceRGB"} /Coords [${s}] /Function ${u} 0 R /Extend [true true] >>`)})}applyPaint(t,n,r,o,i,s,a){if(r<=0||n==="none")return false;let u=0,l,c=W1(n);if(c){let f=a.defs.get(c);if(!f)return false;if(f.tag==="linearGradient"||f.tag==="radialGradient"){let m=this.gradientStops(f);if(m.length===0)return false;let b=Sr(f.attrs.gradientTransform),h=new Set(m.map(p=>p.alpha)),d=this.shadingObj(f,m,false);if(h.size===1&&(r*=m[0].alpha),r<=0)return false;if(d===null){let p=m[m.length-1];l=`${N1(p.color)} ${i?"RG":"rg"}`;}else {h.size>1&&(u=this.alphaMask(t,f,m,b,s));let p=this.cached(`gp:${f.attrs.id}:${pn(s,b).map(ue).join(",")}`,()=>this.writer.add(`<< /Type /Pattern /PatternType 2 /Shading ${d} 0 R /Matrix [${pn(s,b).map(ue).join(" ")}] >>`));l=`/Pattern ${i?"CS":"cs"} ${t.res.use("Pattern",p)} ${i?"SCN":"scn"}`;}}else if(f.tag==="pattern"){let m=this.tilingPattern(f,s,a);if(!m)return false;l=`/Pattern ${i?"CS":"cs"} ${t.res.use("Pattern",m)} ${i?"SCN":"scn"}`;}else return false}else {let f=O1(n);if(!f)return false;l=`${N1(f)} ${i?"RG":"rg"}`;}return (r<1||o||u)&&t.ops.push(`${t.res.use("ExtGState",this.gsObj(Math.min(1,r),o,u))} gs`),t.ops.push(l),true}alphaMask(t,n,r,o,i){let s=this.shadingObj(n,r,true);if(s===null)return 0;let a=fw(i),u=[-1e5,-1e5,1e5,1e5];if(a){let[f,m,b,h]=t.bounds,d=[[f,m],[b,m],[f,h],[b,h]].map(([p,x])=>[a[0]*p+a[2]*x+a[4],a[1]*p+a[3]*x+a[5]]);u=[Math.min(...d.map(p=>p[0])),Math.min(...d.map(p=>p[1])),Math.max(...d.map(p=>p[0])),Math.max(...d.map(p=>p[1]))];}let l=`sm:${n.attrs.id}:${i.map(ue).join(",")}:${u.map(ue).join(",")}`,c=this.smaskObjs.get(l);if(c===void 0){let f=new go,m=f.use("Shading",s);c=this.writer.addStream(`/Type /XObject /Subtype /Form /FormType 1 /BBox [${u.map(ue).join(" ")}] /Group << /S /Transparency /CS /DeviceGray >> /Resources ${f.dict()}`,Ut(`${bw(o)?"":dn(o)+`
32
+ end`,g=t.addStream("",Uint8Array.from(y,M=>M.charCodeAt(0)&255),n);t.set(this.obj,`<< /Type /Font /Subtype /Type0 /BaseFont ${Bi(c)} /Encoding /Identity-H /DescendantFonts [${p} 0 R] /ToUnicode ${g} 0 R >>`);}bbox(){let t=this.face.ttf,n=this.face.view,r=n.getUint16(this.face.base+4);for(let o=0;o<r;o++){let i=this.face.base+12+o*16;if(wm(n,i)==="head"){let s=n.getUint32(i+8),a=1e3/this.upem;return [n.getInt16(s+36),n.getInt16(s+38),n.getInt16(s+40),n.getInt16(s+42)].map(u=>Math.round(u*a)).join(" ")}}return `0 ${t.headYMin} 1000 ${t.headYMax}`}};function mw(e){if(e>65535){let t=e-65536;return (55296+(t>>10)).toString(16).padStart(4,"0")+(56320+(t&1023)).toString(16).padStart(4,"0")}return e.toString(16).padStart(4,"0")}var Tm=class{constructor(t,n){this.obj=t;this.family=n;this.embedded=false;this.ascent=n==="Courier"?.63:n==="Times"?.68:.72,this.descent=n==="Courier"?.2:.22;}glyph(t){let n=sw(t);return n<0&&(n=63),{hex:n.toString(16).padStart(2,"0"),advance:this.advanceOf(String.fromCodePoint(t))}}advanceOf(t){return this.family==="Courier"?.6*[...t].length:chunkI7XOR2GO_js.Q(t,1)}width(t){return this.advanceOf(t)}};function fw(e){return e.split(",").map(t=>t.trim().replace(/^["']|["']$/g,"").trim()).filter(Boolean)}var qa=class{constructor(t,n=[],r=true){this.writer=t;this.compress=r;this.byFamily=new Map;this.cache=new Map;this.embeddedFonts=[];this.subsetCounter=0;for(let o of n)for(let i of lw(o))for(let s of [i.ttf.family,i.ttf.typoFamily,i.ttf.fullName])if(s){let a=s.toLowerCase().trim(),u=this.byFamily.get(a)??[];u.includes(i)||u.push(i),this.byFamily.set(a,u);}}findFace(t,n,r){for(let o of t){let i=this.byFamily.get(o.toLowerCase());if(!i||i.length===0)continue;let s=n?700:400,a=i[0],u=1/0;for(let l of i){let c=(l.ttf.fsSelection&1)!==0||(l.ttf.macStyle&2)!==0,f=Math.abs(l.ttf.weightClass-s)+(c!==r?1e3:0);f<u&&(u=f,a=l);}return a}return null}resolve(t,n,r){let o=this.findFace(fw(t),n,r);if(o){let u=`ttf:${o.ttf.fullName}:${o.base}:${o.ttf.family}:${o.ttf.weightClass}:${o.view.byteLength}`,l=this.cache.get(u);if(!l){let c=String.fromCharCode(65+this.subsetCounter%26,65+Math.floor(this.subsetCounter/26)%26,65,66,67,68);this.subsetCounter++;let f=(o.ttf.fullName||o.ttf.family||"Font").replace(/[^A-Za-z0-9-]/g,"")||"Font",m=new Rm(this.writer.reserve(),o,`${c}+${f}`);this.embeddedFonts.push(m),l=m,this.cache.set(u,l);}return l}let i=aw(t),s=uw(i,n,r),a=this.cache.get(s);return a||(a=new Tm(this.writer.add(`<< /Type /Font /Subtype /Type1 /BaseFont ${Bi(s)} /Encoding /WinAnsiEncoding >>`),i),this.cache.set(s,a)),a}finish(){for(let t of this.embeddedFonts)t.finish(this.writer,this.compress);}};function Am(e){return e.replace(/&(#x[0-9a-f]+|#\d+|amp|lt|gt|quot|apos);/gi,(t,n)=>{switch(n.toLowerCase()){case "amp":return "&";case "lt":return "<";case "gt":return ">";case "quot":return '"';case "apos":return "'"}let r=n[1]==="x"||n[1]==="X"?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return Number.isFinite(r)&&r>=0&&r<=1114111?String.fromCodePoint(r):""})}function O1(e){let t=/<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<!\[CDATA\[[\s\S]*?\]\]>|<!DOCTYPE[^>]*>|<(\/?)([A-Za-z_][\w:.-]*)((?:\s+[\w:.-]+\s*=\s*(?:"[^"]*"|'[^']*'))*)\s*(\/?)>|([^<]+)/g,n=/([\w:.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,r=[],o=null,i,s=0;for(;i=t.exec(e);){if(i.index!==s)return null;s=t.lastIndex;let[a,u,l,c,f,m]=i;if(m!==void 0){let x=r[r.length-1];(x&&m.trim()!==""||x&&x.tag==="text")&&(x.text=(x.text??"")+Am(m));continue}if(!l)continue;if(u){let x=r.pop();if(!x||x.tag!==l)return null;r.length===0&&(o=x);continue}let b={};n.lastIndex=0;let h;for(;h=n.exec(c);)b[h[1]]=Am(h[2]??h[3]??"");let d={tag:l,attrs:b},p=r[r.length-1];p&&(p.children??(p.children=[])).push(d),f?p||(o=d):r.push(d);}return r.length>0||s!==e.length?null:o}var Ja=[1,0,0,1,0,0];function pn(e,t){return [e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function bw(e){let t=e[0]*e[3]-e[1]*e[2];return !t||!Number.isFinite(t)?null:[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[3]*e[4])/t,(e[1]*e[4]-e[0]*e[5])/t]}var hw=e=>e.every((t,n)=>t===Ja[n]),dn=e=>`${e.map(ue).join(" ")} cm`;function Sr(e){let t=[...Ja];if(e===void 0)return t;let n=/(matrix|translate|scale|rotate)\s*\(([^)]*)\)/g,r;for(;r=n.exec(String(e));){let o=r[2].split(/[\s,]+/).filter(Boolean).map(Number),i=null;if(r[1]==="matrix"&&o.length===6)i=o;else if(r[1]==="translate")i=[1,0,0,1,o[0]??0,o[1]??0];else if(r[1]==="scale")i=[o[0]??1,0,0,o[1]??o[0]??1,0,0];else if(r[1]==="rotate"){let s=(o[0]??0)*Math.PI/180,a=Math.cos(s),u=Math.sin(s);i=[a,u,-u,a,0,0],o.length===3&&(i=pn(pn([1,0,0,1,o[1],o[2]],i),[1,0,0,1,-o[1],-o[2]]));}i&&i.every(Number.isFinite)&&(t=pn(t,i));}return t}var dw={black:[0,0,0],white:[255,255,255],red:[255,0,0],green:[0,128,0],lime:[0,255,0],blue:[0,0,255],yellow:[255,255,0],cyan:[0,255,255],aqua:[0,255,255],magenta:[255,0,255],fuchsia:[255,0,255],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],purple:[128,0,128],teal:[0,128,128],orange:[255,165,0]};function N1(e){let t=e.trim().toLowerCase(),n=/^#([0-9a-f]{6})/.exec(t);if(n){let r=parseInt(n[1],16);return [r>>16&255,r>>8&255,r&255]}if(n=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(t),n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];if(n=/^rgba?\(([^)]*)\)$/.exec(t),n){let r=n[1].split(/[\s,/]+/).filter(Boolean),o=i=>Math.max(0,Math.min(255,i===void 0?0:i.endsWith("%")?parseFloat(i)*255/100:parseFloat(i)));return [o(r[0]),o(r[1]),o(r[2])]}return dw[t]??null}var W1=e=>e.map(t=>ue(t/255)).join(" "),ye=(e,t=0)=>{let n=typeof e=="number"?e:e===void 0?NaN:parseFloat(e);return Number.isFinite(n)?n:t};function yo(e){return e===void 0?[]:String(e).split(/[\s,]+/).filter(Boolean).map(Number).filter(Number.isFinite)}function Im(e){let t={};for(let n of String(e??"").split(";")){let r=n.indexOf(":");r>0&&(t[n.slice(0,r).trim()]=n.slice(r+1).trim());}return t}var Sm={multiply:"Multiply",screen:"Screen",overlay:"Overlay",darken:"Darken",lighten:"Lighten","color-dodge":"ColorDodge","color-burn":"ColorBurn","hard-light":"HardLight","soft-light":"SoftLight",difference:"Difference",exclusion:"Exclusion",hue:"Hue",saturation:"Saturation",color:"Color",luminosity:"Luminosity"};function H1(e){let t=/^url\(\s*#([^)\s]+)\s*\)$/.exec(String(e??"").trim());return t?t[1]:null}function $1(e){let t=e.match(/[a-zA-Z]|[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g)??[],n=[],r=0,o="",i=0,s=0,a=0,u=0,l=0,c=0,f="",m=false,b=()=>parseFloat(t[r++]),h=()=>r<t.length&&!/^[a-zA-Z]$/.test(t[r]),d=()=>{m&&(n.push(`${ue(a)} ${ue(u)} m`),m=false);},p=(x,y,g,M,E,P)=>{d(),n.push(`${ue(x)} ${ue(y)} ${ue(g)} ${ue(M)} ${ue(E)} ${ue(P)} c`),l=g,c=M,f="c",i=E,s=P;};for(;r<t.length;){if(/^[a-zA-Z]$/.test(t[r])){if(o=t[r++],o==="z"||o==="Z"){n.push("h"),i=a,s=u,m=true,f="";continue}}else if(!o)break;let x=o===o.toLowerCase(),y=x?i:0,g=x?s:0,M=o.toUpperCase();if(M!=="C"&&M!=="S"&&M!=="Q"&&M!=="T"&&(f=""),!h()){o="";continue}switch(M){case "M":{let E=b()+y,P=b()+g;n.push(`${ue(E)} ${ue(P)} m`),i=a=E,s=u=P,m=false,o=x?"l":"L";break}case "L":{let E=b()+y,P=b()+g;d(),n.push(`${ue(E)} ${ue(P)} l`),i=E,s=P;break}case "H":{let E=b()+y;d(),n.push(`${ue(E)} ${ue(s)} l`),i=E;break}case "V":{let E=b()+g;d(),n.push(`${ue(i)} ${ue(E)} l`),s=E;break}case "C":{let E=b()+y,P=b()+g,R=b()+y,T=b()+g;p(E,P,R,T,b()+y,b()+g);break}case "S":{let E=f==="c"?2*i-l:i,P=f==="c"?2*s-c:s,R=b()+y,T=b()+g;p(E,P,R,T,b()+y,b()+g);break}case "Q":case "T":{let E,P;M==="Q"?(E=b()+y,P=b()+g):(E=f==="q"?2*i-l:i,P=f==="q"?2*s-c:s);let R=b()+y,T=b()+g,w=i,A=s;p(w+2/3*(E-w),A+2/3*(P-A),R+2/3*(E-R),T+2/3*(P-T),R,T),l=E,c=P,f="q";break}case "A":{r+=5;let E=b()+y,P=b()+g;d(),n.push(`${ue(E)} ${ue(P)} l`),i=E,s=P,chunkI7XOR2GO_js.r("PDF: SVG arc segment approximated by a straight line");break}default:r=t.length;}}return n.join(" ")}function pw(e){let t=e.replace(/[^A-Za-z0-9+/]/g,""),n=new Uint8Array(Math.floor(t.length*3/4)),r=i=>i>=65&&i<=90?i-65:i>=97&&i<=122?i-71:i>=48&&i<=57?i+4:i===43?62:63,o=0;for(let i=0;i<t.length;i+=4){let s=r(t.charCodeAt(i)),a=r(t.charCodeAt(i+1)),u=i+2<t.length?r(t.charCodeAt(i+2)):0,l=i+3<t.length?r(t.charCodeAt(i+3)):0,c=s<<18|a<<12|u<<6|l;o<n.length&&(n[o++]=c>>16&255),o<n.length&&(n[o++]=c>>8&255),o<n.length&&(n[o++]=c&255);}return n}function xw(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n of e)t+=String.fromCharCode(n);return t}function yw(e){if(e.length<4||e[0]!==255||e[1]!==216)return null;let t=false,n=2;for(;n+4<=e.length;){if(e[n]!==255){n++;continue}let r=e[n+1];if(r===255){n++;continue}if(r===216||r===1||r>=208&&r<=215){n+=2;continue}let o=e[n+2]<<8|e[n+3];if(r===238&&o>=12&&e[n+4]===65&&e[n+5]===100&&e[n+6]===111&&(t=true),r>=192&&r<=207&&r!==196&&r!==200&&r!==204)return n+10>e.length?null:{height:e[n+5]<<8|e[n+6],width:e[n+7]<<8|e[n+8],components:e[n+9],adobe:t};n+=2+o;}return null}function gw(e,t,n){let r=t*n,o=new Uint8Array(r*3),i=new Uint8Array(r),s=false;for(let a=0;a<r;a++){o[a*3]=e[a*4],o[a*3+1]=e[a*4+1],o[a*3+2]=e[a*4+2];let u=e[a*4+3];i[a]=u,u!==255&&(s=true);}return {kind:"raster",rgb:o,alpha:s?i:null,width:t,height:n}}var Mw={ExtGState:"G",Pattern:"P",XObject:"X",Font:"F",Shading:"S"},go=class{constructor(){this.maps=new Map;}use(t,n){let r=this.maps.get(t);r||(r=new Map,this.maps.set(t,r));let o=r.get(n);return o||(o=`${Mw[t]}${r.size+1}`,r.set(n,o)),`/${o}`}dict(){let t="<< /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]";for(let[n,r]of this.maps)t+=` /${n} << ${[...r].map(([o,i])=>`/${i} ${o} 0 R`).join(" ")} >>`;return t+" >>"}};function Cm(e,t){let n=e.attrs.id;n!==void 0&&t.set(String(n),e);for(let r of e.children??[])Cm(r,t);}var vm=class{constructor(t){this.options=t;this.writer=new za;this.prepared=new Map;this.gsCache=new Map;this.cache=new Map;this.imageObjs=new Map;this.alphaImages=new Map;this.smaskObjs=new Map;this.formObjs=new Map;this.warned=new Set;this.compress=t.compress??true,this.fontBook=new qa(this.writer,t.fonts??[],this.compress);}warnOnce(t){this.warned.has(t)||(this.warned.add(t),chunkI7XOR2GO_js.r(`PDF: ${t}`));}async prepare(t){if(t.tag==="image"){let n=t.attrs.href??t.attrs["xlink:href"];typeof n=="string"&&!this.prepared.has(n)&&(this.prepared.set(n,null),this.prepared.set(n,await this.prepareImage(n)));}for(let n of t.children??[])await this.prepare(n);}async prepareImage(t){let n=/^data:([^;,]*)((?:;[^;,]*)*),([\s\S]*)$/.exec(t);if(!n)return this.warnOnce("external image reference skipped (only data: URLs are embedded)"),null;let r=n[1].toLowerCase(),o=n[2].includes(";base64")?pw(n[3]):Ut(decodeURIComponent(n[3]));if(r==="image/svg+xml"){let a=O1(xw(o));if(!a)return this.warnOnce("nested SVG image could not be parsed"),null;await this.prepare(a);let u=yo(a.attrs.viewBox);return {kind:"svg",tree:a,width:u[2]??ye(a.attrs.width,1),height:u[3]??ye(a.attrs.height,1)}}let i=yw(o);if(i&&(i.components===1||i.components===3||i.components===4)&&i.width>0&&i.height>0)return {kind:"jpeg",bytes:o,width:i.width,height:i.height,components:i.components,invertedCmyk:i.components===4&&i.adobe};let s=null;try{s=await chunkI7XOR2GO_js.ja(o),!s&&this.options.decodeImage&&(s=await this.options.decodeImage(o,r));}catch{s=null;}return !s||s.width<=0||s.height<=0?(this.warnOnce(`image skipped: no decoder for ${r||"unknown"} data`),null):gw(s.data,s.width,s.height)}imageObj(t,n){let r=this.imageObjs.get(t)??{};this.imageObjs.set(t,r);let o=n?r.smooth:r.sharp;if(o)return o;let i=`/Interpolate ${n}`,s;if(t.kind==="jpeg"){let a=t.components===1?"/DeviceGray":t.components===3?"/DeviceRGB":"/DeviceCMYK";s=this.writer.addStream(`/Type /XObject /Subtype /Image /Width ${t.width} /Height ${t.height} /ColorSpace ${a} /BitsPerComponent 8 ${t.invertedCmyk?"/Decode [1 0 1 0 1 0 1 0] ":""}/Filter /DCTDecode ${i}`,t.bytes,false);}else {let a="";if(t.alpha){let u=this.alphaImages.get(t);u||(u=this.writer.addStream(`/Type /XObject /Subtype /Image /Width ${t.width} /Height ${t.height} /ColorSpace /DeviceGray /BitsPerComponent 8 ${i}`,t.alpha,this.compress),this.alphaImages.set(t,u)),a=` /SMask ${u} 0 R`;}s=this.writer.addStream(`/Type /XObject /Subtype /Image /Width ${t.width} /Height ${t.height} /ColorSpace /DeviceRGB /BitsPerComponent 8 ${i}${a}`,t.rgb,this.compress);}return n?r.smooth=s:r.sharp=s,s}gsObj(t,n,r){let o=`${ue(t)}|${n??""}|${r}`,i=this.gsCache.get(o);return i||(i=this.writer.add(`<< /Type /ExtGState /ca ${ue(t)} /CA ${ue(t)}${n?` /BM /${n}`:""}${r?` /SMask << /Type /Mask /S /Luminosity /G ${r} 0 R >>`:""} >>`),this.gsCache.set(o,i)),i}cached(t,n){let r=this.cache.get(t);return r===void 0&&(r=n(),this.cache.set(t,r)),r}gradientStops(t){let n=[];for(let r of t.children??[]){if(r.tag!=="stop")continue;let o=Math.max(0,Math.min(1,ye(r.attrs.offset,0))),i=N1(String(r.attrs["stop-color"]??"#000000"))??[0,0,0];n.push({offset:o,color:i,alpha:Math.max(0,Math.min(1,ye(r.attrs["stop-opacity"],1)))});}return n.sort((r,o)=>r.offset-o.offset),n}stopFunction(t,n){let r=[...t];r[0].offset>0&&r.unshift({...r[0],offset:0}),r[r.length-1].offset<1&&r.push({...r[r.length-1],offset:1});let o=(a,u)=>this.writer.add(`<< /FunctionType 2 /Domain [0 1] /C0 [${n(a).map(ue).join(" ")}] /C1 [${n(u).map(ue).join(" ")}] /N 1 >>`);if(r.length===2)return o(r[0],r[1]);let i=[];for(let a=0;a+1<r.length;a++)i.push(o(r[a],r[a+1]));let s=r.slice(1,-1).map(a=>ue(a.offset));return this.writer.add(`<< /FunctionType 3 /Domain [0 1] /Functions [${i.map(a=>`${a} 0 R`).join(" ")}] /Bounds [${s.join(" ")}] /Encode [${i.map(()=>"0 1").join(" ")}] >>`)}shadingObj(t,n,r){let o=`sh:${t.attrs.id}:${r}`,i=t.attrs,s,a;if(t.tag==="linearGradient"){let u=ye(i.x1),l=ye(i.y1),c=ye(i.x2),f=ye(i.y2);if(u===c&&l===f)return null;s=[u,l,c,f].map(ue).join(" "),a=2;}else {let u=ye(i.fx,ye(i.cx)),l=ye(i.fy,ye(i.cy)),c=Math.max(0,ye(i.fr)),f=ye(i.cx),m=ye(i.cy),b=Math.max(0,ye(i.r));if(b===0&&c===0)return null;s=[u,l,c,f,m,b].map(ue).join(" "),a=3;}return this.cached(o,()=>{let u=this.stopFunction(n,r?l=>[l.alpha]:l=>l.color.map(c=>c/255));return this.writer.add(`<< /ShadingType ${a} /ColorSpace ${r?"/DeviceGray":"/DeviceRGB"} /Coords [${s}] /Function ${u} 0 R /Extend [true true] >>`)})}applyPaint(t,n,r,o,i,s,a){if(r<=0||n==="none")return false;let u=0,l,c=H1(n);if(c){let f=a.defs.get(c);if(!f)return false;if(f.tag==="linearGradient"||f.tag==="radialGradient"){let m=this.gradientStops(f);if(m.length===0)return false;let b=Sr(f.attrs.gradientTransform),h=new Set(m.map(p=>p.alpha)),d=this.shadingObj(f,m,false);if(h.size===1&&(r*=m[0].alpha),r<=0)return false;if(d===null){let p=m[m.length-1];l=`${W1(p.color)} ${i?"RG":"rg"}`;}else {h.size>1&&(u=this.alphaMask(t,f,m,b,s));let p=this.cached(`gp:${f.attrs.id}:${pn(s,b).map(ue).join(",")}`,()=>this.writer.add(`<< /Type /Pattern /PatternType 2 /Shading ${d} 0 R /Matrix [${pn(s,b).map(ue).join(" ")}] >>`));l=`/Pattern ${i?"CS":"cs"} ${t.res.use("Pattern",p)} ${i?"SCN":"scn"}`;}}else if(f.tag==="pattern"){let m=this.tilingPattern(f,s,a);if(!m)return false;l=`/Pattern ${i?"CS":"cs"} ${t.res.use("Pattern",m)} ${i?"SCN":"scn"}`;}else return false}else {let f=N1(n);if(!f)return false;l=`${W1(f)} ${i?"RG":"rg"}`;}return (r<1||o||u)&&t.ops.push(`${t.res.use("ExtGState",this.gsObj(Math.min(1,r),o,u))} gs`),t.ops.push(l),true}alphaMask(t,n,r,o,i){let s=this.shadingObj(n,r,true);if(s===null)return 0;let a=bw(i),u=[-1e5,-1e5,1e5,1e5];if(a){let[f,m,b,h]=t.bounds,d=[[f,m],[b,m],[f,h],[b,h]].map(([p,x])=>[a[0]*p+a[2]*x+a[4],a[1]*p+a[3]*x+a[5]]);u=[Math.min(...d.map(p=>p[0])),Math.min(...d.map(p=>p[1])),Math.max(...d.map(p=>p[0])),Math.max(...d.map(p=>p[1]))];}let l=`sm:${n.attrs.id}:${i.map(ue).join(",")}:${u.map(ue).join(",")}`,c=this.smaskObjs.get(l);if(c===void 0){let f=new go,m=f.use("Shading",s);c=this.writer.addStream(`/Type /XObject /Subtype /Form /FormType 1 /BBox [${u.map(ue).join(" ")}] /Group << /S /Transparency /CS /DeviceGray >> /Resources ${f.dict()}`,Ut(`${hw(o)?"":dn(o)+`
33
33
  `}${m} sh`),this.compress),this.smaskObjs.set(l,c);}return c}tilingPattern(t,n,r){let o=ye(t.attrs.width),i=ye(t.attrs.height);if(o<=0||i<=0)return null;let s=pn(n,Sr(t.attrs.patternTransform));return this.cached(`tp:${t.attrs.id}:${s.map(ue).join(",")}`,()=>{let a={ops:[],res:new go,bounds:[0,0,o,i]};for(let u of t.children??[])this.render(u,a,Ja,r);return this.writer.addStream(`/Type /Pattern /PatternType 1 /PaintType 1 /TilingType 1 /BBox [0 0 ${ue(o)} ${ue(i)}] /XStep ${ue(o)} /YStep ${ue(i)} /Matrix [${s.map(ue).join(" ")}] /Resources ${a.res.dict()}`,Ut(a.ops.join(`
34
- `)),this.compress)})}clipOps(t,n,r,o=0){let i=W1(n),s=i?r.defs.get(i):void 0;if(!s||s.tag!=="clipPath"||o>64)return;this.clipOps(t,s.attrs["clip-path"],r,o+1);let a=[],u=false;for(let c of s.children??[]){c.attrs["clip-path"]!==void 0&&this.clipOps(t,c.attrs["clip-path"],r,o+1);let f=c.attrs.transform!==void 0?Sr(c.attrs.transform):null;if(f&&t.ops.push(dn(f)),c.tag==="path")a.push(H1(String(c.attrs.d??"")));else if(c.tag==="rect"){let m=ye(c.attrs.x),b=ye(c.attrs.y);a.push(`${ue(m)} ${ue(b)} ${ue(ye(c.attrs.width))} ${ue(ye(c.attrs.height))} re`);}c.attrs["clip-rule"]==="evenodd"&&(u=true);}let l=a.join(" ").trim();t.ops.push(l?`${l} ${u?"W*":"W"} n`:"0 0 0 0 re W n");}render(t,n,r,o){switch(t.tag){case "defs":case "clipPath":case "linearGradient":case "radialGradient":case "pattern":return;case "g":{n.ops.push("q");let i=r;if(t.attrs.transform!==void 0){let s=Sr(t.attrs.transform);n.ops.push(dn(s)),i=pn(r,s);}this.clipOps(n,t.attrs["clip-path"],o);for(let s of t.children??[])this.render(s,n,i,o);n.ops.push("Q");return}case "path":this.renderPath(t,n,r,o);return;case "text":this.renderText(t,n,r,o);return;case "image":this.renderImage(t,n,r,o);return;default:this.warnOnce(`unsupported SVG element <${t.tag}> skipped`);}}renderPath(t,n,r,o){let i=t.attrs,s=H1(String(i.d??""));if(!s)return;let a=Im(i.style),u=Sm[a["mix-blend-mode"]]??null,l=i.transform!==void 0?Sr(i.transform):null,c=l?pn(r,l):r;if(!isFinite(c[0]+c[3])||c[0]*c[3]-c[1]*c[2]===0)return;let f=i.fill===void 0?"#000000":String(i.fill);if(f!=="none"&&(n.ops.push("q"),l&&n.ops.push(dn(l)),this.applyPaint(n,f,ye(i["fill-opacity"],1),u,false,c,o)&&n.ops.push(`${s} ${i["fill-rule"]==="evenodd"?"f*":"f"}`),n.ops.push("Q")),i.stroke!==void 0&&i.stroke!=="none"){if(n.ops.push("q"),l&&n.ops.push(dn(l)),this.applyPaint(n,String(i.stroke),ye(i["stroke-opacity"],1),u,true,c,o)){n.ops.push(`${ue(ye(i["stroke-width"],1))} w`);let m={butt:0,round:1,square:2}[String(i["stroke-linecap"]??"butt")]??0,b={miter:0,round:1,bevel:2}[String(i["stroke-linejoin"]??"miter")]??0;n.ops.push(`${m} J ${b} j`),n.ops.push(`${ue(Math.max(1,ye(i["stroke-miterlimit"],10)))} M`);let h=yo(i["stroke-dasharray"]);h.length&&h.some(d=>d>0)&&h.every(d=>d>=0)&&n.ops.push(`[${h.map(ue).join(" ")}] ${ue(ye(i["stroke-dashoffset"],0))} d`),n.ops.push(`${s} S`);}n.ops.push("Q");}}renderImage(t,n,r,o){let i=t.attrs.href??t.attrs["xlink:href"],s=typeof i=="string"?this.prepared.get(i):null;if(!s||typeof i!="string")return;let a=t.attrs,u=ye(a.x),l=ye(a.y),c=ye(a.width),f=ye(a.height);if(c===0||f===0)return;let m=Im(a.style),b=Sm[m["mix-blend-mode"]]??null,h=ye(a.opacity,1);if(!(h<=0)){if(n.ops.push("q"),a.transform!==void 0&&n.ops.push(dn(Sr(a.transform))),this.clipOps(n,a["clip-path"],o),(h<1||b)&&n.ops.push(`${n.res.use("ExtGState",this.gsObj(h,b,0))} gs`),s.kind==="svg"){let d=this.nestedForm(i,s);n.ops.push(dn([c/s.width,0,0,f/s.height,u,l])),n.ops.push(`${n.res.use("XObject",d)} Do`);}else {let d=!(m["image-rendering"]==="pixelated"||a["image-rendering"]==="optimizeSpeed"),p=this.imageObj(s,d);n.ops.push(dn([c,0,0,-f,u,l+f])),n.ops.push(`${n.res.use("XObject",p)} Do`);}n.ops.push("Q");}}nestedForm(t,n){let r=this.formObjs.get(t);if(r===void 0){let o=yo(n.tree.attrs.viewBox),i=[o[0]??0,o[1]??0,(o[0]??0)+n.width,(o[1]??0)+n.height],s={ops:[],res:new go,bounds:i},a={defs:new Map};Cm(n.tree,a.defs);for(let u of n.tree.children??[])this.render(u,s,Ja,a);r=this.writer.addStream(`/Type /XObject /Subtype /Form /FormType 1 /BBox [${i.map(ue).join(" ")}] /Group << /S /Transparency /I true /CS /DeviceRGB >> /Resources ${s.res.dict()}`,Ut(s.ops.join(`
35
- `)),this.compress),this.formObjs.set(t,r);}return r}renderText(t,n,r,o){let i=t.text,s=t.attrs;if(!i)return;let a=ye(s["font-size"],10);if(!(a>0))return;let u=Im(s.style),l=Sm[u["mix-blend-mode"]]??null,c=String(s["font-weight"]??""),f=c==="bold"||c==="bolder"||ye(c,400)>=600,m=/italic|oblique/.test(String(s["font-style"]??"")),b=String(s["font-family"]??"sans-serif"),h=this.fontBook.resolve(b,f,m),d=s.transform!==void 0?Sr(s.transform):null,p=d?pn(r,d):r;if(n.ops.push("q"),d&&n.ops.push(dn(d)),!this.applyPaint(n,String(s.fill??"#000000"),ye(s["fill-opacity"],1),l,false,p,o)){n.ops.pop(),d&&n.ops.pop();return}let x=yo(s.x),y=yo(s.y),g=[],M=[];for(let I=0;I<i.length;I++){let S=i.codePointAt(I);M[I]=S,g[I]=S<32?null:h.glyph(S),S>65535&&(I++,M[I]=-1,g[I]=null);}let E=1,P=0,R=0;if(x.length<=1){let I=h.width(i)*a,S=ye(s.textLength,0);S>0&&I>S&&(E=S/I);let v=s["text-anchor"];P=v==="middle"?-I*E/2:v==="end"?-I*E:0;let C=s["dominant-baseline"];R=C==="text-before-edge"?h.ascent*a:C==="central"?(h.ascent-h.descent)/2*a:C==="text-after-edge"?-h.descent*a:C==="hanging"?h.ascent*a*.8:C==="ideographic"?-h.descent*a:0;}let T=x[0]??0;n.ops.push("BT",`${n.res.use("Font",h.obj)} ${ue(a)} Tf`);let w=T,A=0;for(let I=0;I<i.length;I++){if(M[I]===-1)continue;let S=I<x.length?x[I]:I===0?T:w+A*a,v=y.length?y[Math.min(I,y.length-1)]:0,C=g[I],U=C?C.advance:.5;if(C){let L=T+(S-T)*E+P;n.ops.push(`${ue(E)} 0 0 -1 ${ue(L)} ${ue(v+R)} Tm <${C.hex}> Tj`);}w=S,A=U;}n.ops.push("ET","Q");}};function $1(e){if(e===void 0||/%/.test(String(e)))return null;let t=parseFloat(String(e));return Number.isFinite(t)&&t>0?t:null}async function Dm(e,t={}){try{if(e.tag!=="svg")return null;let n=yo(e.attrs.viewBox),r=$1(e.attrs.width)??(n.length===4?n[2]:null),o=$1(e.attrs.height)??(n.length===4?n[3]:null);if(!r||!o)return null;let i=new vm(t);await i.prepare(e);let[s,a,u,l]=n.length===4&&n[2]>0&&n[3]>0?n:[0,0,r,o],c=[r/u,0,0,o/l,-s*r/u,-a*o/l],f=r*.75,m=o*.75,b=.75,h=0,d=0,p=typeof t.pageSize=="object"?t.pageSize:null;p&&p.width>0&&p.height>0&&(f=p.width,m=p.height,b=Math.min(f/r,m/o),h=(f-r*b)/2,d=(m-o*b)/2);let x=[b,0,0,-b,h,m-d],y=pn(x,c),g={ops:[],res:new go,bounds:[0,0,f,m]},M={defs:new Map};Cm(e,M.defs),g.ops.push(dn(y)),p&&g.ops.push(`${ue(s)} ${ue(a)} ${ue(u)} ${ue(l)} re W n`);for(let I of e.children??[])i.render(I,g,y,M);i.fontBook.finish();let E=i.writer,P=E.reserve(),R=E.reserve(),T=E.addStream("",Ut(g.ops.join(`
36
- `)),i.compress);E.set(R,`<< /Type /Page /Parent ${P} 0 R /MediaBox [0 0 ${ue(f)} ${ue(m)}] /Contents ${T} 0 R /Resources ${g.res.dict()} /Group << /Type /Group /S /Transparency /CS /DeviceRGB /I true >> >>`),E.set(P,`<< /Type /Pages /Kids [${R} 0 R] /Count 1 >>`);let w=E.add(`<< /Type /Catalog /Pages ${P} 0 R >>`),A=E.add(`<< /Producer ${Pm("emf-converter")}${t.title?` /Title ${Pm(t.title)}`:""} >>`);return await E.finish(w,A)}catch(n){return chunk7JVB7NLG_js.q("PDF: serialisation failed:",n instanceof Error?n.message:n),null}}async function Mw(e,t={}){let n=await _i(e,{...t,includeSize:true});return n?Dm(n,t):null}var Ew=`
34
+ `)),this.compress)})}clipOps(t,n,r,o=0){let i=H1(n),s=i?r.defs.get(i):void 0;if(!s||s.tag!=="clipPath"||o>64)return;this.clipOps(t,s.attrs["clip-path"],r,o+1);let a=[],u=false;for(let c of s.children??[]){c.attrs["clip-path"]!==void 0&&this.clipOps(t,c.attrs["clip-path"],r,o+1);let f=c.attrs.transform!==void 0?Sr(c.attrs.transform):null;if(f&&t.ops.push(dn(f)),c.tag==="path")a.push($1(String(c.attrs.d??"")));else if(c.tag==="rect"){let m=ye(c.attrs.x),b=ye(c.attrs.y);a.push(`${ue(m)} ${ue(b)} ${ue(ye(c.attrs.width))} ${ue(ye(c.attrs.height))} re`);}c.attrs["clip-rule"]==="evenodd"&&(u=true);}let l=a.join(" ").trim();t.ops.push(l?`${l} ${u?"W*":"W"} n`:"0 0 0 0 re W n");}render(t,n,r,o){switch(t.tag){case "defs":case "clipPath":case "linearGradient":case "radialGradient":case "pattern":return;case "g":{n.ops.push("q");let i=r;if(t.attrs.transform!==void 0){let s=Sr(t.attrs.transform);n.ops.push(dn(s)),i=pn(r,s);}this.clipOps(n,t.attrs["clip-path"],o);for(let s of t.children??[])this.render(s,n,i,o);n.ops.push("Q");return}case "path":this.renderPath(t,n,r,o);return;case "text":this.renderText(t,n,r,o);return;case "image":this.renderImage(t,n,r,o);return;default:this.warnOnce(`unsupported SVG element <${t.tag}> skipped`);}}renderPath(t,n,r,o){let i=t.attrs,s=$1(String(i.d??""));if(!s)return;let a=Im(i.style),u=Sm[a["mix-blend-mode"]]??null,l=i.transform!==void 0?Sr(i.transform):null,c=l?pn(r,l):r;if(!isFinite(c[0]+c[3])||c[0]*c[3]-c[1]*c[2]===0)return;let f=i.fill===void 0?"#000000":String(i.fill);if(f!=="none"&&(n.ops.push("q"),l&&n.ops.push(dn(l)),this.applyPaint(n,f,ye(i["fill-opacity"],1),u,false,c,o)&&n.ops.push(`${s} ${i["fill-rule"]==="evenodd"?"f*":"f"}`),n.ops.push("Q")),i.stroke!==void 0&&i.stroke!=="none"){if(n.ops.push("q"),l&&n.ops.push(dn(l)),this.applyPaint(n,String(i.stroke),ye(i["stroke-opacity"],1),u,true,c,o)){n.ops.push(`${ue(ye(i["stroke-width"],1))} w`);let m={butt:0,round:1,square:2}[String(i["stroke-linecap"]??"butt")]??0,b={miter:0,round:1,bevel:2}[String(i["stroke-linejoin"]??"miter")]??0;n.ops.push(`${m} J ${b} j`),n.ops.push(`${ue(Math.max(1,ye(i["stroke-miterlimit"],10)))} M`);let h=yo(i["stroke-dasharray"]);h.length&&h.some(d=>d>0)&&h.every(d=>d>=0)&&n.ops.push(`[${h.map(ue).join(" ")}] ${ue(ye(i["stroke-dashoffset"],0))} d`),n.ops.push(`${s} S`);}n.ops.push("Q");}}renderImage(t,n,r,o){let i=t.attrs.href??t.attrs["xlink:href"],s=typeof i=="string"?this.prepared.get(i):null;if(!s||typeof i!="string")return;let a=t.attrs,u=ye(a.x),l=ye(a.y),c=ye(a.width),f=ye(a.height);if(c===0||f===0)return;let m=Im(a.style),b=Sm[m["mix-blend-mode"]]??null,h=ye(a.opacity,1);if(!(h<=0)){if(n.ops.push("q"),a.transform!==void 0&&n.ops.push(dn(Sr(a.transform))),this.clipOps(n,a["clip-path"],o),(h<1||b)&&n.ops.push(`${n.res.use("ExtGState",this.gsObj(h,b,0))} gs`),s.kind==="svg"){let d=this.nestedForm(i,s);n.ops.push(dn([c/s.width,0,0,f/s.height,u,l])),n.ops.push(`${n.res.use("XObject",d)} Do`);}else {let d=!(m["image-rendering"]==="pixelated"||a["image-rendering"]==="optimizeSpeed"),p=this.imageObj(s,d);n.ops.push(dn([c,0,0,-f,u,l+f])),n.ops.push(`${n.res.use("XObject",p)} Do`);}n.ops.push("Q");}}nestedForm(t,n){let r=this.formObjs.get(t);if(r===void 0){let o=yo(n.tree.attrs.viewBox),i=[o[0]??0,o[1]??0,(o[0]??0)+n.width,(o[1]??0)+n.height],s={ops:[],res:new go,bounds:i},a={defs:new Map};Cm(n.tree,a.defs);for(let u of n.tree.children??[])this.render(u,s,Ja,a);r=this.writer.addStream(`/Type /XObject /Subtype /Form /FormType 1 /BBox [${i.map(ue).join(" ")}] /Group << /S /Transparency /I true /CS /DeviceRGB >> /Resources ${s.res.dict()}`,Ut(s.ops.join(`
35
+ `)),this.compress),this.formObjs.set(t,r);}return r}renderText(t,n,r,o){let i=t.text,s=t.attrs;if(!i)return;let a=ye(s["font-size"],10);if(!(a>0))return;let u=Im(s.style),l=Sm[u["mix-blend-mode"]]??null,c=String(s["font-weight"]??""),f=c==="bold"||c==="bolder"||ye(c,400)>=600,m=/italic|oblique/.test(String(s["font-style"]??"")),b=String(s["font-family"]??"sans-serif"),h=this.fontBook.resolve(b,f,m),d=s.transform!==void 0?Sr(s.transform):null,p=d?pn(r,d):r;if(n.ops.push("q"),d&&n.ops.push(dn(d)),!this.applyPaint(n,String(s.fill??"#000000"),ye(s["fill-opacity"],1),l,false,p,o)){n.ops.pop(),d&&n.ops.pop();return}let x=yo(s.x),y=yo(s.y),g=[],M=[];for(let I=0;I<i.length;I++){let S=i.codePointAt(I);M[I]=S,g[I]=S<32?null:h.glyph(S),S>65535&&(I++,M[I]=-1,g[I]=null);}let E=1,P=0,R=0;if(x.length<=1){let I=h.width(i)*a,S=ye(s.textLength,0);S>0&&I>S&&(E=S/I);let v=s["text-anchor"];P=v==="middle"?-I*E/2:v==="end"?-I*E:0;let C=s["dominant-baseline"];R=C==="text-before-edge"?h.ascent*a:C==="central"?(h.ascent-h.descent)/2*a:C==="text-after-edge"?-h.descent*a:C==="hanging"?h.ascent*a*.8:C==="ideographic"?-h.descent*a:0;}let T=x[0]??0;n.ops.push("BT",`${n.res.use("Font",h.obj)} ${ue(a)} Tf`);let w=T,A=0;for(let I=0;I<i.length;I++){if(M[I]===-1)continue;let S=I<x.length?x[I]:I===0?T:w+A*a,v=y.length?y[Math.min(I,y.length-1)]:0,C=g[I],U=C?C.advance:.5;if(C){let L=T+(S-T)*E+P;n.ops.push(`${ue(E)} 0 0 -1 ${ue(L)} ${ue(v+R)} Tm <${C.hex}> Tj`);}w=S,A=U;}n.ops.push("ET","Q");}};function X1(e){if(e===void 0||/%/.test(String(e)))return null;let t=parseFloat(String(e));return Number.isFinite(t)&&t>0?t:null}async function Dm(e,t={}){try{if(e.tag!=="svg")return null;let n=yo(e.attrs.viewBox),r=X1(e.attrs.width)??(n.length===4?n[2]:null),o=X1(e.attrs.height)??(n.length===4?n[3]:null);if(!r||!o)return null;let i=new vm(t);await i.prepare(e);let[s,a,u,l]=n.length===4&&n[2]>0&&n[3]>0?n:[0,0,r,o],c=[r/u,0,0,o/l,-s*r/u,-a*o/l],f=r*.75,m=o*.75,b=.75,h=0,d=0,p=typeof t.pageSize=="object"?t.pageSize:null;p&&p.width>0&&p.height>0&&(f=p.width,m=p.height,b=Math.min(f/r,m/o),h=(f-r*b)/2,d=(m-o*b)/2);let x=[b,0,0,-b,h,m-d],y=pn(x,c),g={ops:[],res:new go,bounds:[0,0,f,m]},M={defs:new Map};Cm(e,M.defs),g.ops.push(dn(y)),p&&g.ops.push(`${ue(s)} ${ue(a)} ${ue(u)} ${ue(l)} re W n`);for(let I of e.children??[])i.render(I,g,y,M);i.fontBook.finish();let E=i.writer,P=E.reserve(),R=E.reserve(),T=E.addStream("",Ut(g.ops.join(`
36
+ `)),i.compress);E.set(R,`<< /Type /Page /Parent ${P} 0 R /MediaBox [0 0 ${ue(f)} ${ue(m)}] /Contents ${T} 0 R /Resources ${g.res.dict()} /Group << /Type /Group /S /Transparency /CS /DeviceRGB /I true >> >>`),E.set(P,`<< /Type /Pages /Kids [${R} 0 R] /Count 1 >>`);let w=E.add(`<< /Type /Catalog /Pages ${P} 0 R >>`),A=E.add(`<< /Producer ${Pm("emf-converter")}${t.title?` /Title ${Pm(t.title)}`:""} >>`);return await E.finish(w,A)}catch(n){return chunkI7XOR2GO_js.r("PDF: serialisation failed:",n instanceof Error?n.message:n),null}}async function Ew(e,t={}){let n=await _i(e,{...t,includeSize:true});return n?Dm(n,t):null}var Pw=`
37
37
  1:HEADER 2:POLYBEZIER 3:POLYGON 4:POLYLINE 5:POLYBEZIERTO 6:POLYLINETO 7:POLYPOLYLINE 8:POLYPOLYGON
38
38
  9:SETWINDOWEXTEX 10:SETWINDOWORGEX 11:SETVIEWPORTEXTEX 12:SETVIEWPORTORGEX 13:SETBRUSHORGEX 14:EOF
39
39
  15:SETPIXELV 16:SETMAPPERFLAGS 17:SETMAPMODE 18:SETBKMODE 19:SETPOLYFILLMODE 20:SETROP2 21:SETSTRETCHBLTMODE
@@ -53,7 +53,7 @@ end`,g=t.addStream("",Uint8Array.from(y,M=>M.charCodeAt(0)&255),n);t.set(this.ob
53
53
  110:NAMEDESCAPE 111:COLORCORRECTPALETTE 112:SETICMPROFILEA 113:SETICMPROFILEW 114:ALPHABLEND 115:SETLAYOUT
54
54
  116:TRANSPARENTBLT 118:GRADIENTFILL 119:SETLINKEDUFIS 120:SETTEXTJUSTIFICATION 121:COLORMATCHTOTARGETW
55
55
  122:CREATECOLORSPACEW
56
- `,Pw=`
56
+ `,Rw=`
57
57
  0x0000:EOF 0x001e:SAVEDC 0x0035:REALIZEPALETTE 0x0037:SETPALENTRIES 0x00f7:CREATEPALETTE 0x00f8:CREATEBRUSH
58
58
  0x0102:SETBKMODE 0x0103:SETMAPMODE 0x0104:SETROP2 0x0105:SETRELABS 0x0106:SETPOLYFILLMODE
59
59
  0x0107:SETSTRETCHBLTMODE 0x0108:SETTEXTCHAREXTRA 0x0127:RESTOREDC 0x012a:INVERTREGION 0x012b:PAINTREGION
@@ -68,7 +68,7 @@ end`,g=t.addStream("",Uint8Array.from(y,M=>M.charCodeAt(0)&255),n);t.set(this.ob
68
68
  0x0521:TEXTOUT 0x0538:POLYPOLYGON 0x0548:EXTFLOODFILL 0x061c:ROUNDRECT 0x061d:PATBLT 0x0626:ESCAPE
69
69
  0x06fe:CREATEBITMAP 0x06ff:CREATEREGION 0x0817:ARC 0x081a:PIE 0x0830:CHORD 0x0922:BITBLT 0x0940:DIBBITBLT
70
70
  0x0a32:EXTTEXTOUT 0x0b23:STRETCHBLT 0x0b41:DIBSTRETCHBLT 0x0d33:SETDIBTODEV 0x0f43:STRETCHDIB
71
- `,Rw=`
71
+ `,Tw=`
72
72
  0x4001:HEADER 0x4002:ENDOFFILE 0x4003:COMMENT 0x4004:GETDC 0x4005:MULTIFORMATSTART 0x4006:MULTIFORMATSECTION
73
73
  0x4007:MULTIFORMATEND 0x4008:OBJECT 0x4009:CLEAR 0x400a:FILLRECTS 0x400b:DRAWRECTS 0x400c:FILLPOLYGON
74
74
  0x400d:DRAWLINES 0x400e:FILLELLIPSE 0x400f:DRAWELLIPSE 0x4010:FILLPIE 0x4011:DRAWPIE 0x4012:DRAWARC
@@ -81,5 +81,5 @@ end`,g=t.addStream("",Uint8Array.from(y,M=>M.charCodeAt(0)&255),n);t.set(this.ob
81
81
  0x402d:TRANSLATEWORLDTRANSFORM 0x402e:SCALEWORLDTRANSFORM 0x402f:ROTATEWORLDTRANSFORM 0x4030:SETPAGETRANSFORM
82
82
  0x4031:RESETCLIP 0x4032:SETCLIPRECT 0x4033:SETCLIPPATH 0x4034:SETCLIPREGION 0x4035:OFFSETCLIP
83
83
  0x4036:DRAWDRIVERSTRING 0x4037:STROKEFILLPATH 0x4038:SERIALIZABLEOBJECT 0x4039:SETTSGRAPHICS 0x403a:SETTSCLIP
84
- `;function Lm(e,t,n){let r=new Map;for(let o of e.split(/\s+/)){let i=o.indexOf(":");i>0&&r.set(n?parseInt(o.slice(0,i),16):Number(o.slice(0,i)),t+o.slice(i+1));}return r}function X1(){return {emr:Lm(Ew,"EMR_",false),meta:Lm(Pw,"META_",true),plus:Lm(Rw,"EMFPLUS_",true)}}var Tw=3,Um=null;function Fm(){return Um??(Um=X1()),Um}function km(e,t){e[t]=(e[t]??0)+1;}function _m(){return {recordCount:0,emfPlusRecordCount:0,recordTypes:{},fonts:new Map,hasText:false,imageCount:0,mimeTypes:new Set,embeddedMetafiles:0,truncated:false,plus:"none"}}function vr(e,t,n){if(!t)return;let r=t.toLowerCase(),o=e.fonts.get(r)??{name:t,gdi:false,emfPlus:false};o[n]=true,e.fonts.set(r,o);}function Gi(e,t){e.imageCount++,e.mimeTypes.add(t);}function ww(e,t){for(let n of t.fonts.values())n.gdi&&vr(e,n.name,"gdi"),n.emfPlus&&vr(e,n.name,"emfPlus");e.hasText||(e.hasText=t.hasText);}function V1(e,t){if(t<0||t+20>e.byteLength)return null;let n=e.getUint32(t+16,true);return n===4?"image/jpeg":n===5?"image/png":"image/bmp"}function Aw(e){let t=Br(e);if(t)return t;let n=e;return n.length>=4&&(n[0]===73&&n[1]===73&&n[2]===42&&n[3]===0||n[0]===77&&n[1]===77&&n[2]===0&&n[3]===42)?"image/tiff":n.length>=2&&n[0]===66&&n[1]===77?"image/bmp":n.length>=3&&n[0]===255&&n[1]===216&&n[2]===255?"image/jpeg":"application/octet-stream"}function Bm(e){try{return dr(e)}catch{return null}}var Iw=new Set([83,84,96,97,108]),j1={76:84,77:84,78:84,114:84,116:84,79:96,80:48,81:48};function z1(e,t,n,r){let o=Fm().emr,i=0;for(;i+8<=e.byteLength;){if(t.recordCount>=n){t.truncated=true;return}let s=e.getUint32(i,true),a=e.getUint32(i+4,true);if(a<8||i+a>e.byteLength){t.truncated=true;return}if(t.recordCount++,km(t.recordTypes,o.get(s)??`UNKNOWN_0x${s.toString(16)}`),s===82)a>=332&&vr(t,chunk7JVB7NLG_js.fa(e,i+8+32,32),"gdi");else if(Iw.has(s))t.hasText=true;else if(s===70)Sw(e,i+8,i+a,t,r);else if(s in j1){let u=j1[s];if(a>=u+8){let l=e.getUint32(i+u,true),c=e.getUint32(i+u+4,true);if(c>=20&&l>=8&&l+c<=a){let f=V1(e,i+l);f&&Gi(t,f);}}}else if(s===14)return;i+=a;}}function Sw(e,t,n,r,o){if(t+8>n)return;let i=e.getUint32(t,true);if(e.getUint32(t+4,true)!==726027589||i<=4)return;let s=Fm().plus,a=Math.min(n,t+8+i-4),u=t+8;for(;u+12<=a;){if(r.emfPlusRecordCount>=o){r.truncated=true;return}let l=e.getUint16(u,true),c=e.getUint16(u+2,true),f=e.getUint32(u+4,true);if(f<12||u+f>a){r.truncated=true;return}r.emfPlusRecordCount++,km(r.recordTypes,s.get(l)??`UNKNOWN_0x${l.toString(16)}`),l===16385&&r.plus==="none"?r.plus=(c&1)!==0?"dual":"only":(l===16412||l===16438)&&(r.hasText=true),u+=f;}}function q1(e,t,n,r){Xo(e,o=>{let i=o.flags>>8&127,s=o.view,a=o.dataOff,u=o.dataSize;if(i===6&&u>=28){let l=s.getUint32(a+20,true);l>0&&24+l*2<=u&&vr(t,chunk7JVB7NLG_js.fa(s,a+24,l),"emfPlus");}else if(i===5&&u>=8){let l=s.getUint32(a+4,true);if(l===1&&u>=28)s.getUint32(a+24,true)===1&&u>28?Gi(t,Aw(new Uint8Array(s.buffer,s.byteOffset+a+28,Math.min(u-28,16)))):Gi(t,"image/bmp");else if(l===2&&u>=16){let c=s.getUint32(a+8,true),f=s.getUint32(a+12,true);if(t.embeddedMetafiles++,Gi(t,c<=2?"image/wmf":"image/emf"),c>=3&&n<Tw&&f>0&&16+f<=u){let m=new DataView(s.buffer,s.byteOffset+a+16,f);if(Bm(m)){let b=_m();z1(m,b,r,r),q1(m,b,n+1,r),ww(t,b);}}}}});}function vw(e){if(e.byteLength<68)return null;let t=e.getUint32(60,true),n=e.getUint32(64,true);if(t===0||n<88||n+t*2>e.byteLength)return null;let r=[],o="";for(let i=0;i<t;i++){let s=e.getUint16(n+i*2,true);s===0?(r.push(o),o=""):o+=String.fromCharCode(s);}return r.push(o),r.filter(i=>i.length>0).join(`
85
- `)||null}function J1(e,t,n){let r=zs(t);if(!r)return null;let o=_m();z1(e,o,n.maxRecords??2e5,n.maxRecords??5e5),q1(e,o,0,n.maxRecords??2e5);let i=chunk7JVB7NLG_js.W(r.right-r.left,r.bottom-r.top),s={left:e.getInt32(24,true),top:e.getInt32(28,true),right:e.getInt32(32,true),bottom:e.getInt32(36,true)},a={width:e.getInt32(72,true),height:e.getInt32(76,true)},u={width:e.getInt32(80,true),height:e.getInt32(84,true)},l=a.width>0&&a.height>0&&u.width>0&&u.height>0;return K1(o,{format:o.plus==="none"?"emf":o.plus==="dual"?"emf+dual":"emf+",bounds:t.bounds,frame:s,device:l?a:null,deviceMm:l?u:null,dpi:l?{x:a.width*25.4/u.width,y:a.height*25.4/u.height}:{x:96,y:96},width:i.w,height:i.h,description:vw(e)})}function K1(e,t){return {...t,recordCount:e.recordCount,emfPlusRecordCount:e.emfPlusRecordCount,recordTypes:e.recordTypes,fonts:[...e.fonts.values()],hasText:e.hasText,images:{count:e.imageCount,mimeTypes:[...e.mimeTypes].sort()},embeddedMetafiles:e.embeddedMetafiles,truncated:e.truncated}}var Y1={2368:16,2881:20,3907:22,3379:18};function Cw(e,t,n,r,o){let i=Fm().meta,s=t;for(;s+6<=e.byteLength;){if(n.recordCount>=r){n.truncated=true;return}let a=e.getUint32(s,true)*2,u=e.getUint16(s+4,true);if(a<6||s+a>e.byteLength){n.truncated=true;return}if(u===0)return;n.recordCount++,km(n.recordTypes,i.get(u)??`UNKNOWN_0x${u.toString(16)}`);let l=s+6,c=s+a;if(u===763){if(a>=24){let f=[];for(let m=0;m<32&&l+18+m<c;m++){let b=e.getUint8(l+18+m);if(b===0)break;f.push(b);}vr(n,String.fromCharCode(...qn(f,1,{ansi:o}).codes),"gdi");}}else if(u===1313||u===2610)n.hasText=true;else if(u in Y1){let f=l+Y1[u];if(f+40<=c){let m=V1(e,f);m&&Gi(n,m);}}s+=a;}}function Dw(e,t){let n=oi(e);if(!n||n.boundsRight-n.boundsLeft<=0||n.boundsBottom-n.boundsTop<=0)return null;let r=_m();Cw(e,n.headerSize,r,t.maxRecords??2e5,t.ansiCodePage);let o=ho(e,n),i=chunk7JVB7NLG_js.W(o.width,o.height),s=i.w,a=i.h,u=null,l=false,c=Ha(e,n.headerSize);if(c){let b=new DataView(c),h=Bm(b),d=h?J1(b,h,t):null;if(d){l=true,s=d.width,a=d.height,u=d.description;for(let p of d.fonts)vr(r,p.name,p.gdi?"gdi":"emfPlus"),p.gdi&&p.emfPlus&&vr(r,p.name,"emfPlus");r.hasText||(r.hasText=d.hasText),r.imageCount+=d.images.count,d.images.mimeTypes.forEach(p=>r.mimeTypes.add(p)),r.embeddedMetafiles+=d.embeddedMetafiles;}}let f={left:n.boundsLeft,top:n.boundsTop,right:n.boundsRight,bottom:n.boundsBottom},m=b=>Math.round(b*2540/n.unitsPerInch);return K1(r,{format:"wmf",placeable:n.placeable,playsEmbeddedEmf:l,bounds:f,frame:n.placeable?{left:m(f.left),top:m(f.top),right:m(f.right),bottom:m(f.bottom)}:null,unitsPerInch:n.unitsPerInch,device:null,deviceMm:null,dpi:{x:96,y:96},width:s,height:a,description:u})}async function Lw(e,t){try{let n=await vi(e);if(!n)return null;let r=new DataView(n),o=t??{},i=Bm(r);return i?J1(r,i,o):Dw(r,o)}catch(n){return chunk7JVB7NLG_js.q("getMetafileInfo: EXCEPTION:",n instanceof Error?n.message:n),null}}Object.defineProperty(exports,"DEFAULT_DPI_SCALE",{enumerable:true,get:function(){return chunk7JVB7NLG_js.V}});Object.defineProperty(exports,"loadSystemFonts",{enumerable:true,get:function(){return chunk7JVB7NLG_js.r}});Object.defineProperty(exports,"svgTreeToDataUrl",{enumerable:true,get:function(){return chunk7JVB7NLG_js.ua}});Object.defineProperty(exports,"svgTreeToJsx",{enumerable:true,get:function(){return chunk7JVB7NLG_js.wa}});Object.defineProperty(exports,"svgTreeToReact",{enumerable:true,get:function(){return chunk7JVB7NLG_js.va}});Object.defineProperty(exports,"svgTreeToString",{enumerable:true,get:function(){return chunk7JVB7NLG_js.ra}});exports.convertMetafile=q4;exports.convertMetafileToDataUrl=J4;exports.convertMetafileToImageData=F1;exports.convertMetafileToJpegDataUrl=K4;exports.convertMetafileToPdf=Mw;exports.convertMetafileToSvg=_1;exports.convertMetafileToSvgDataUrl=rw;exports.convertMetafileToSvgTree=_i;exports.convertMetafileToWebpDataUrl=Z4;exports.getMetafileInfo=Lw;exports.svgTreeToPdf=Dm;
84
+ `;function Lm(e,t,n){let r=new Map;for(let o of e.split(/\s+/)){let i=o.indexOf(":");i>0&&r.set(n?parseInt(o.slice(0,i),16):Number(o.slice(0,i)),t+o.slice(i+1));}return r}function j1(){return {emr:Lm(Pw,"EMR_",false),meta:Lm(Rw,"META_",true),plus:Lm(Tw,"EMFPLUS_",true)}}var ww=3,Um=null;function Fm(){return Um??(Um=j1()),Um}function km(e,t){e[t]=(e[t]??0)+1;}function _m(){return {recordCount:0,emfPlusRecordCount:0,recordTypes:{},fonts:new Map,hasText:false,imageCount:0,mimeTypes:new Set,embeddedMetafiles:0,truncated:false,plus:"none"}}function vr(e,t,n){if(!t)return;let r=t.toLowerCase(),o=e.fonts.get(r)??{name:t,gdi:false,emfPlus:false};o[n]=true,e.fonts.set(r,o);}function Gi(e,t){e.imageCount++,e.mimeTypes.add(t);}function Aw(e,t){for(let n of t.fonts.values())n.gdi&&vr(e,n.name,"gdi"),n.emfPlus&&vr(e,n.name,"emfPlus");e.hasText||(e.hasText=t.hasText);}function z1(e,t){if(t<0||t+20>e.byteLength)return null;let n=e.getUint32(t+16,true);return n===4?"image/jpeg":n===5?"image/png":"image/bmp"}function Iw(e){let t=Br(e);if(t)return t;let n=e;return n.length>=4&&(n[0]===73&&n[1]===73&&n[2]===42&&n[3]===0||n[0]===77&&n[1]===77&&n[2]===0&&n[3]===42)?"image/tiff":n.length>=2&&n[0]===66&&n[1]===77?"image/bmp":n.length>=3&&n[0]===255&&n[1]===216&&n[2]===255?"image/jpeg":"application/octet-stream"}function Bm(e){try{return dr(e)}catch{return null}}var Sw=new Set([83,84,96,97,108]),Y1={76:84,77:84,78:84,114:84,116:84,79:96,80:48,81:48};function q1(e,t,n,r){let o=Fm().emr,i=0;for(;i+8<=e.byteLength;){if(t.recordCount>=n){t.truncated=true;return}let s=e.getUint32(i,true),a=e.getUint32(i+4,true);if(a<8||i+a>e.byteLength){t.truncated=true;return}if(t.recordCount++,km(t.recordTypes,o.get(s)??`UNKNOWN_0x${s.toString(16)}`),s===82)a>=332&&vr(t,chunkI7XOR2GO_js.ga(e,i+8+32,32),"gdi");else if(Sw.has(s))t.hasText=true;else if(s===70)vw(e,i+8,i+a,t,r);else if(s in Y1){let u=Y1[s];if(a>=u+8){let l=e.getUint32(i+u,true),c=e.getUint32(i+u+4,true);if(c>=20&&l>=8&&l+c<=a){let f=z1(e,i+l);f&&Gi(t,f);}}}else if(s===14)return;i+=a;}}function vw(e,t,n,r,o){if(t+8>n)return;let i=e.getUint32(t,true);if(e.getUint32(t+4,true)!==726027589||i<=4)return;let s=Fm().plus,a=Math.min(n,t+8+i-4),u=t+8;for(;u+12<=a;){if(r.emfPlusRecordCount>=o){r.truncated=true;return}let l=e.getUint16(u,true),c=e.getUint16(u+2,true),f=e.getUint32(u+4,true);if(f<12||u+f>a){r.truncated=true;return}r.emfPlusRecordCount++,km(r.recordTypes,s.get(l)??`UNKNOWN_0x${l.toString(16)}`),l===16385&&r.plus==="none"?r.plus=(c&1)!==0?"dual":"only":(l===16412||l===16438)&&(r.hasText=true),u+=f;}}function J1(e,t,n,r){Xo(e,o=>{let i=o.flags>>8&127,s=o.view,a=o.dataOff,u=o.dataSize;if(i===6&&u>=28){let l=s.getUint32(a+20,true);l>0&&24+l*2<=u&&vr(t,chunkI7XOR2GO_js.ga(s,a+24,l),"emfPlus");}else if(i===5&&u>=8){let l=s.getUint32(a+4,true);if(l===1&&u>=28)s.getUint32(a+24,true)===1&&u>28?Gi(t,Iw(new Uint8Array(s.buffer,s.byteOffset+a+28,Math.min(u-28,16)))):Gi(t,"image/bmp");else if(l===2&&u>=16){let c=s.getUint32(a+8,true),f=s.getUint32(a+12,true);if(t.embeddedMetafiles++,Gi(t,c<=2?"image/wmf":"image/emf"),c>=3&&n<ww&&f>0&&16+f<=u){let m=new DataView(s.buffer,s.byteOffset+a+16,f);if(Bm(m)){let b=_m();q1(m,b,r,r),J1(m,b,n+1,r),Aw(t,b);}}}}});}function Cw(e){if(e.byteLength<68)return null;let t=e.getUint32(60,true),n=e.getUint32(64,true);if(t===0||n<88||n+t*2>e.byteLength)return null;let r=[],o="";for(let i=0;i<t;i++){let s=e.getUint16(n+i*2,true);s===0?(r.push(o),o=""):o+=String.fromCharCode(s);}return r.push(o),r.filter(i=>i.length>0).join(`
85
+ `)||null}function K1(e,t,n){let r=zs(t);if(!r)return null;let o=_m();q1(e,o,n.maxRecords??2e5,n.maxRecords??5e5),J1(e,o,0,n.maxRecords??2e5);let i=chunkI7XOR2GO_js.X(r.right-r.left,r.bottom-r.top),s={left:e.getInt32(24,true),top:e.getInt32(28,true),right:e.getInt32(32,true),bottom:e.getInt32(36,true)},a={width:e.getInt32(72,true),height:e.getInt32(76,true)},u={width:e.getInt32(80,true),height:e.getInt32(84,true)},l=a.width>0&&a.height>0&&u.width>0&&u.height>0;return Z1(o,{format:o.plus==="none"?"emf":o.plus==="dual"?"emf+dual":"emf+",bounds:t.bounds,frame:s,device:l?a:null,deviceMm:l?u:null,dpi:l?{x:a.width*25.4/u.width,y:a.height*25.4/u.height}:{x:96,y:96},width:i.w,height:i.h,description:Cw(e)})}function Z1(e,t){return {...t,recordCount:e.recordCount,emfPlusRecordCount:e.emfPlusRecordCount,recordTypes:e.recordTypes,fonts:[...e.fonts.values()],hasText:e.hasText,images:{count:e.imageCount,mimeTypes:[...e.mimeTypes].sort()},embeddedMetafiles:e.embeddedMetafiles,truncated:e.truncated}}var V1={2368:16,2881:20,3907:22,3379:18};function Dw(e,t,n,r,o){let i=Fm().meta,s=t;for(;s+6<=e.byteLength;){if(n.recordCount>=r){n.truncated=true;return}let a=e.getUint32(s,true)*2,u=e.getUint16(s+4,true);if(a<6||s+a>e.byteLength){n.truncated=true;return}if(u===0)return;n.recordCount++,km(n.recordTypes,i.get(u)??`UNKNOWN_0x${u.toString(16)}`);let l=s+6,c=s+a;if(u===763){if(a>=24){let f=[];for(let m=0;m<32&&l+18+m<c;m++){let b=e.getUint8(l+18+m);if(b===0)break;f.push(b);}vr(n,String.fromCharCode(...qn(f,1,{ansi:o}).codes),"gdi");}}else if(u===1313||u===2610)n.hasText=true;else if(u in V1){let f=l+V1[u];if(f+40<=c){let m=z1(e,f);m&&Gi(n,m);}}s+=a;}}function Lw(e,t){let n=oi(e);if(!n||n.boundsRight-n.boundsLeft<=0||n.boundsBottom-n.boundsTop<=0)return null;let r=_m();Dw(e,n.headerSize,r,t.maxRecords??2e5,t.ansiCodePage);let o=ho(e,n),i=chunkI7XOR2GO_js.X(o.width,o.height),s=i.w,a=i.h,u=null,l=false,c=Ha(e,n.headerSize);if(c){let b=new DataView(c),h=Bm(b),d=h?K1(b,h,t):null;if(d){l=true,s=d.width,a=d.height,u=d.description;for(let p of d.fonts)vr(r,p.name,p.gdi?"gdi":"emfPlus"),p.gdi&&p.emfPlus&&vr(r,p.name,"emfPlus");r.hasText||(r.hasText=d.hasText),r.imageCount+=d.images.count,d.images.mimeTypes.forEach(p=>r.mimeTypes.add(p)),r.embeddedMetafiles+=d.embeddedMetafiles;}}let f={left:n.boundsLeft,top:n.boundsTop,right:n.boundsRight,bottom:n.boundsBottom},m=b=>Math.round(b*2540/n.unitsPerInch);return Z1(r,{format:"wmf",placeable:n.placeable,playsEmbeddedEmf:l,bounds:f,frame:n.placeable?{left:m(f.left),top:m(f.top),right:m(f.right),bottom:m(f.bottom)}:null,unitsPerInch:n.unitsPerInch,device:null,deviceMm:null,dpi:{x:96,y:96},width:s,height:a,description:u})}async function Uw(e,t){try{let n=await vi(e);if(!n)return null;let r=new DataView(n),o=t??{},i=Bm(r);return i?K1(r,i,o):Lw(r,o)}catch(n){return chunkI7XOR2GO_js.r("getMetafileInfo: EXCEPTION:",n instanceof Error?n.message:n),null}}Object.defineProperty(exports,"DEFAULT_DPI_SCALE",{enumerable:true,get:function(){return chunkI7XOR2GO_js.W}});Object.defineProperty(exports,"loadSystemFonts",{enumerable:true,get:function(){return chunkI7XOR2GO_js.s}});Object.defineProperty(exports,"svgTreeToDataUrl",{enumerable:true,get:function(){return chunkI7XOR2GO_js.va}});Object.defineProperty(exports,"svgTreeToJsx",{enumerable:true,get:function(){return chunkI7XOR2GO_js.xa}});Object.defineProperty(exports,"svgTreeToReact",{enumerable:true,get:function(){return chunkI7XOR2GO_js.wa}});Object.defineProperty(exports,"svgTreeToString",{enumerable:true,get:function(){return chunkI7XOR2GO_js.sa}});exports.convertMetafile=J4;exports.convertMetafileToDataUrl=K4;exports.convertMetafileToImageData=k1;exports.convertMetafileToJpegDataUrl=Z4;exports.convertMetafileToPdf=Ew;exports.convertMetafileToSvg=B1;exports.convertMetafileToSvgDataUrl=ow;exports.convertMetafileToSvgTree=_i;exports.convertMetafileToWebpDataUrl=Q4;exports.getMetafileInfo=Uw;exports.svgTreeToPdf=Dm;